bundle.js 1.4 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220
  1. /******/ (function(modules) { // webpackBootstrap
  2. /******/ // The module cache
  3. /******/ var installedModules = {};
  4. /******/ // The require function
  5. /******/ function __webpack_require__(moduleId) {
  6. /******/ // Check if module is in cache
  7. /******/ if(installedModules[moduleId])
  8. /******/ return installedModules[moduleId].exports;
  9. /******/ // Create a new module (and put it into the cache)
  10. /******/ var module = installedModules[moduleId] = {
  11. /******/ i: moduleId,
  12. /******/ l: false,
  13. /******/ exports: {}
  14. /******/ };
  15. /******/ // Execute the module function
  16. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  17. /******/ // Flag the module as loaded
  18. /******/ module.l = true;
  19. /******/ // Return the exports of the module
  20. /******/ return module.exports;
  21. /******/ }
  22. /******/ // expose the modules object (__webpack_modules__)
  23. /******/ __webpack_require__.m = modules;
  24. /******/ // expose the module cache
  25. /******/ __webpack_require__.c = installedModules;
  26. /******/ // identity function for calling harmony imports with the correct context
  27. /******/ __webpack_require__.i = function(value) { return value; };
  28. /******/ // define getter function for harmony exports
  29. /******/ __webpack_require__.d = function(exports, name, getter) {
  30. /******/ if(!__webpack_require__.o(exports, name)) {
  31. /******/ Object.defineProperty(exports, name, {
  32. /******/ configurable: false,
  33. /******/ enumerable: true,
  34. /******/ get: getter
  35. /******/ });
  36. /******/ }
  37. /******/ };
  38. /******/ // getDefaultExport function for compatibility with non-harmony modules
  39. /******/ __webpack_require__.n = function(module) {
  40. /******/ var getter = module && module.__esModule ?
  41. /******/ function getDefault() { return module['default']; } :
  42. /******/ function getModuleExports() { return module; };
  43. /******/ __webpack_require__.d(getter, 'a', getter);
  44. /******/ return getter;
  45. /******/ };
  46. /******/ // Object.prototype.hasOwnProperty.call
  47. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  48. /******/ // __webpack_public_path__
  49. /******/ __webpack_require__.p = "";
  50. /******/ // Load entry module and return exports
  51. /******/ return __webpack_require__(__webpack_require__.s = 192);
  52. /******/ })
  53. /************************************************************************/
  54. /******/ ([
  55. /* 0 */
  56. /***/ (function(module, exports, __webpack_require__) {
  57. /* WEBPACK VAR INJECTION */(function(module) {//! moment.js
  58. //! version : 2.17.1
  59. //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
  60. //! license : MIT
  61. //! momentjs.com
  62. ;(function (global, factory) {
  63. true ? module.exports = factory() :
  64. typeof define === 'function' && define.amd ? define(factory) :
  65. global.moment = factory()
  66. }(this, (function () { 'use strict';
  67. var hookCallback;
  68. function hooks () {
  69. return hookCallback.apply(null, arguments);
  70. }
  71. // This is done to register the method called with moment()
  72. // without creating circular dependencies.
  73. function setHookCallback (callback) {
  74. hookCallback = callback;
  75. }
  76. function isArray(input) {
  77. return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';
  78. }
  79. function isObject(input) {
  80. // IE8 will treat undefined and null as object if it wasn't for
  81. // input != null
  82. return input != null && Object.prototype.toString.call(input) === '[object Object]';
  83. }
  84. function isObjectEmpty(obj) {
  85. var k;
  86. for (k in obj) {
  87. // even if its not own property I'd still call it non-empty
  88. return false;
  89. }
  90. return true;
  91. }
  92. function isNumber(input) {
  93. return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';
  94. }
  95. function isDate(input) {
  96. return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
  97. }
  98. function map(arr, fn) {
  99. var res = [], i;
  100. for (i = 0; i < arr.length; ++i) {
  101. res.push(fn(arr[i], i));
  102. }
  103. return res;
  104. }
  105. function hasOwnProp(a, b) {
  106. return Object.prototype.hasOwnProperty.call(a, b);
  107. }
  108. function extend(a, b) {
  109. for (var i in b) {
  110. if (hasOwnProp(b, i)) {
  111. a[i] = b[i];
  112. }
  113. }
  114. if (hasOwnProp(b, 'toString')) {
  115. a.toString = b.toString;
  116. }
  117. if (hasOwnProp(b, 'valueOf')) {
  118. a.valueOf = b.valueOf;
  119. }
  120. return a;
  121. }
  122. function createUTC (input, format, locale, strict) {
  123. return createLocalOrUTC(input, format, locale, strict, true).utc();
  124. }
  125. function defaultParsingFlags() {
  126. // We need to deep clone this object.
  127. return {
  128. empty : false,
  129. unusedTokens : [],
  130. unusedInput : [],
  131. overflow : -2,
  132. charsLeftOver : 0,
  133. nullInput : false,
  134. invalidMonth : null,
  135. invalidFormat : false,
  136. userInvalidated : false,
  137. iso : false,
  138. parsedDateParts : [],
  139. meridiem : null
  140. };
  141. }
  142. function getParsingFlags(m) {
  143. if (m._pf == null) {
  144. m._pf = defaultParsingFlags();
  145. }
  146. return m._pf;
  147. }
  148. var some;
  149. if (Array.prototype.some) {
  150. some = Array.prototype.some;
  151. } else {
  152. some = function (fun) {
  153. var t = Object(this);
  154. var len = t.length >>> 0;
  155. for (var i = 0; i < len; i++) {
  156. if (i in t && fun.call(this, t[i], i, t)) {
  157. return true;
  158. }
  159. }
  160. return false;
  161. };
  162. }
  163. var some$1 = some;
  164. function isValid(m) {
  165. if (m._isValid == null) {
  166. var flags = getParsingFlags(m);
  167. var parsedParts = some$1.call(flags.parsedDateParts, function (i) {
  168. return i != null;
  169. });
  170. var isNowValid = !isNaN(m._d.getTime()) &&
  171. flags.overflow < 0 &&
  172. !flags.empty &&
  173. !flags.invalidMonth &&
  174. !flags.invalidWeekday &&
  175. !flags.nullInput &&
  176. !flags.invalidFormat &&
  177. !flags.userInvalidated &&
  178. (!flags.meridiem || (flags.meridiem && parsedParts));
  179. if (m._strict) {
  180. isNowValid = isNowValid &&
  181. flags.charsLeftOver === 0 &&
  182. flags.unusedTokens.length === 0 &&
  183. flags.bigHour === undefined;
  184. }
  185. if (Object.isFrozen == null || !Object.isFrozen(m)) {
  186. m._isValid = isNowValid;
  187. }
  188. else {
  189. return isNowValid;
  190. }
  191. }
  192. return m._isValid;
  193. }
  194. function createInvalid (flags) {
  195. var m = createUTC(NaN);
  196. if (flags != null) {
  197. extend(getParsingFlags(m), flags);
  198. }
  199. else {
  200. getParsingFlags(m).userInvalidated = true;
  201. }
  202. return m;
  203. }
  204. function isUndefined(input) {
  205. return input === void 0;
  206. }
  207. // Plugins that add properties should also add the key here (null value),
  208. // so we can properly clone ourselves.
  209. var momentProperties = hooks.momentProperties = [];
  210. function copyConfig(to, from) {
  211. var i, prop, val;
  212. if (!isUndefined(from._isAMomentObject)) {
  213. to._isAMomentObject = from._isAMomentObject;
  214. }
  215. if (!isUndefined(from._i)) {
  216. to._i = from._i;
  217. }
  218. if (!isUndefined(from._f)) {
  219. to._f = from._f;
  220. }
  221. if (!isUndefined(from._l)) {
  222. to._l = from._l;
  223. }
  224. if (!isUndefined(from._strict)) {
  225. to._strict = from._strict;
  226. }
  227. if (!isUndefined(from._tzm)) {
  228. to._tzm = from._tzm;
  229. }
  230. if (!isUndefined(from._isUTC)) {
  231. to._isUTC = from._isUTC;
  232. }
  233. if (!isUndefined(from._offset)) {
  234. to._offset = from._offset;
  235. }
  236. if (!isUndefined(from._pf)) {
  237. to._pf = getParsingFlags(from);
  238. }
  239. if (!isUndefined(from._locale)) {
  240. to._locale = from._locale;
  241. }
  242. if (momentProperties.length > 0) {
  243. for (i in momentProperties) {
  244. prop = momentProperties[i];
  245. val = from[prop];
  246. if (!isUndefined(val)) {
  247. to[prop] = val;
  248. }
  249. }
  250. }
  251. return to;
  252. }
  253. var updateInProgress = false;
  254. // Moment prototype object
  255. function Moment(config) {
  256. copyConfig(this, config);
  257. this._d = new Date(config._d != null ? config._d.getTime() : NaN);
  258. if (!this.isValid()) {
  259. this._d = new Date(NaN);
  260. }
  261. // Prevent infinite loop in case updateOffset creates new moment
  262. // objects.
  263. if (updateInProgress === false) {
  264. updateInProgress = true;
  265. hooks.updateOffset(this);
  266. updateInProgress = false;
  267. }
  268. }
  269. function isMoment (obj) {
  270. return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);
  271. }
  272. function absFloor (number) {
  273. if (number < 0) {
  274. // -0 -> 0
  275. return Math.ceil(number) || 0;
  276. } else {
  277. return Math.floor(number);
  278. }
  279. }
  280. function toInt(argumentForCoercion) {
  281. var coercedNumber = +argumentForCoercion,
  282. value = 0;
  283. if (coercedNumber !== 0 && isFinite(coercedNumber)) {
  284. value = absFloor(coercedNumber);
  285. }
  286. return value;
  287. }
  288. // compare two arrays, return the number of differences
  289. function compareArrays(array1, array2, dontConvert) {
  290. var len = Math.min(array1.length, array2.length),
  291. lengthDiff = Math.abs(array1.length - array2.length),
  292. diffs = 0,
  293. i;
  294. for (i = 0; i < len; i++) {
  295. if ((dontConvert && array1[i] !== array2[i]) ||
  296. (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
  297. diffs++;
  298. }
  299. }
  300. return diffs + lengthDiff;
  301. }
  302. function warn(msg) {
  303. if (hooks.suppressDeprecationWarnings === false &&
  304. (typeof console !== 'undefined') && console.warn) {
  305. console.warn('Deprecation warning: ' + msg);
  306. }
  307. }
  308. function deprecate(msg, fn) {
  309. var firstTime = true;
  310. return extend(function () {
  311. if (hooks.deprecationHandler != null) {
  312. hooks.deprecationHandler(null, msg);
  313. }
  314. if (firstTime) {
  315. var args = [];
  316. var arg;
  317. for (var i = 0; i < arguments.length; i++) {
  318. arg = '';
  319. if (typeof arguments[i] === 'object') {
  320. arg += '\n[' + i + '] ';
  321. for (var key in arguments[0]) {
  322. arg += key + ': ' + arguments[0][key] + ', ';
  323. }
  324. arg = arg.slice(0, -2); // Remove trailing comma and space
  325. } else {
  326. arg = arguments[i];
  327. }
  328. args.push(arg);
  329. }
  330. warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + (new Error()).stack);
  331. firstTime = false;
  332. }
  333. return fn.apply(this, arguments);
  334. }, fn);
  335. }
  336. var deprecations = {};
  337. function deprecateSimple(name, msg) {
  338. if (hooks.deprecationHandler != null) {
  339. hooks.deprecationHandler(name, msg);
  340. }
  341. if (!deprecations[name]) {
  342. warn(msg);
  343. deprecations[name] = true;
  344. }
  345. }
  346. hooks.suppressDeprecationWarnings = false;
  347. hooks.deprecationHandler = null;
  348. function isFunction(input) {
  349. return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
  350. }
  351. function set (config) {
  352. var prop, i;
  353. for (i in config) {
  354. prop = config[i];
  355. if (isFunction(prop)) {
  356. this[i] = prop;
  357. } else {
  358. this['_' + i] = prop;
  359. }
  360. }
  361. this._config = config;
  362. // Lenient ordinal parsing accepts just a number in addition to
  363. // number + (possibly) stuff coming from _ordinalParseLenient.
  364. this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source);
  365. }
  366. function mergeConfigs(parentConfig, childConfig) {
  367. var res = extend({}, parentConfig), prop;
  368. for (prop in childConfig) {
  369. if (hasOwnProp(childConfig, prop)) {
  370. if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
  371. res[prop] = {};
  372. extend(res[prop], parentConfig[prop]);
  373. extend(res[prop], childConfig[prop]);
  374. } else if (childConfig[prop] != null) {
  375. res[prop] = childConfig[prop];
  376. } else {
  377. delete res[prop];
  378. }
  379. }
  380. }
  381. for (prop in parentConfig) {
  382. if (hasOwnProp(parentConfig, prop) &&
  383. !hasOwnProp(childConfig, prop) &&
  384. isObject(parentConfig[prop])) {
  385. // make sure changes to properties don't modify parent config
  386. res[prop] = extend({}, res[prop]);
  387. }
  388. }
  389. return res;
  390. }
  391. function Locale(config) {
  392. if (config != null) {
  393. this.set(config);
  394. }
  395. }
  396. var keys;
  397. if (Object.keys) {
  398. keys = Object.keys;
  399. } else {
  400. keys = function (obj) {
  401. var i, res = [];
  402. for (i in obj) {
  403. if (hasOwnProp(obj, i)) {
  404. res.push(i);
  405. }
  406. }
  407. return res;
  408. };
  409. }
  410. var keys$1 = keys;
  411. var defaultCalendar = {
  412. sameDay : '[Today at] LT',
  413. nextDay : '[Tomorrow at] LT',
  414. nextWeek : 'dddd [at] LT',
  415. lastDay : '[Yesterday at] LT',
  416. lastWeek : '[Last] dddd [at] LT',
  417. sameElse : 'L'
  418. };
  419. function calendar (key, mom, now) {
  420. var output = this._calendar[key] || this._calendar['sameElse'];
  421. return isFunction(output) ? output.call(mom, now) : output;
  422. }
  423. var defaultLongDateFormat = {
  424. LTS : 'h:mm:ss A',
  425. LT : 'h:mm A',
  426. L : 'MM/DD/YYYY',
  427. LL : 'MMMM D, YYYY',
  428. LLL : 'MMMM D, YYYY h:mm A',
  429. LLLL : 'dddd, MMMM D, YYYY h:mm A'
  430. };
  431. function longDateFormat (key) {
  432. var format = this._longDateFormat[key],
  433. formatUpper = this._longDateFormat[key.toUpperCase()];
  434. if (format || !formatUpper) {
  435. return format;
  436. }
  437. this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
  438. return val.slice(1);
  439. });
  440. return this._longDateFormat[key];
  441. }
  442. var defaultInvalidDate = 'Invalid date';
  443. function invalidDate () {
  444. return this._invalidDate;
  445. }
  446. var defaultOrdinal = '%d';
  447. var defaultOrdinalParse = /\d{1,2}/;
  448. function ordinal (number) {
  449. return this._ordinal.replace('%d', number);
  450. }
  451. var defaultRelativeTime = {
  452. future : 'in %s',
  453. past : '%s ago',
  454. s : 'a few seconds',
  455. m : 'a minute',
  456. mm : '%d minutes',
  457. h : 'an hour',
  458. hh : '%d hours',
  459. d : 'a day',
  460. dd : '%d days',
  461. M : 'a month',
  462. MM : '%d months',
  463. y : 'a year',
  464. yy : '%d years'
  465. };
  466. function relativeTime (number, withoutSuffix, string, isFuture) {
  467. var output = this._relativeTime[string];
  468. return (isFunction(output)) ?
  469. output(number, withoutSuffix, string, isFuture) :
  470. output.replace(/%d/i, number);
  471. }
  472. function pastFuture (diff, output) {
  473. var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
  474. return isFunction(format) ? format(output) : format.replace(/%s/i, output);
  475. }
  476. var aliases = {};
  477. function addUnitAlias (unit, shorthand) {
  478. var lowerCase = unit.toLowerCase();
  479. aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
  480. }
  481. function normalizeUnits(units) {
  482. return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
  483. }
  484. function normalizeObjectUnits(inputObject) {
  485. var normalizedInput = {},
  486. normalizedProp,
  487. prop;
  488. for (prop in inputObject) {
  489. if (hasOwnProp(inputObject, prop)) {
  490. normalizedProp = normalizeUnits(prop);
  491. if (normalizedProp) {
  492. normalizedInput[normalizedProp] = inputObject[prop];
  493. }
  494. }
  495. }
  496. return normalizedInput;
  497. }
  498. var priorities = {};
  499. function addUnitPriority(unit, priority) {
  500. priorities[unit] = priority;
  501. }
  502. function getPrioritizedUnits(unitsObj) {
  503. var units = [];
  504. for (var u in unitsObj) {
  505. units.push({unit: u, priority: priorities[u]});
  506. }
  507. units.sort(function (a, b) {
  508. return a.priority - b.priority;
  509. });
  510. return units;
  511. }
  512. function makeGetSet (unit, keepTime) {
  513. return function (value) {
  514. if (value != null) {
  515. set$1(this, unit, value);
  516. hooks.updateOffset(this, keepTime);
  517. return this;
  518. } else {
  519. return get(this, unit);
  520. }
  521. };
  522. }
  523. function get (mom, unit) {
  524. return mom.isValid() ?
  525. mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;
  526. }
  527. function set$1 (mom, unit, value) {
  528. if (mom.isValid()) {
  529. mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
  530. }
  531. }
  532. // MOMENTS
  533. function stringGet (units) {
  534. units = normalizeUnits(units);
  535. if (isFunction(this[units])) {
  536. return this[units]();
  537. }
  538. return this;
  539. }
  540. function stringSet (units, value) {
  541. if (typeof units === 'object') {
  542. units = normalizeObjectUnits(units);
  543. var prioritized = getPrioritizedUnits(units);
  544. for (var i = 0; i < prioritized.length; i++) {
  545. this[prioritized[i].unit](units[prioritized[i].unit]);
  546. }
  547. } else {
  548. units = normalizeUnits(units);
  549. if (isFunction(this[units])) {
  550. return this[units](value);
  551. }
  552. }
  553. return this;
  554. }
  555. function zeroFill(number, targetLength, forceSign) {
  556. var absNumber = '' + Math.abs(number),
  557. zerosToFill = targetLength - absNumber.length,
  558. sign = number >= 0;
  559. return (sign ? (forceSign ? '+' : '') : '-') +
  560. Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
  561. }
  562. var 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;
  563. var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
  564. var formatFunctions = {};
  565. var formatTokenFunctions = {};
  566. // token: 'M'
  567. // padded: ['MM', 2]
  568. // ordinal: 'Mo'
  569. // callback: function () { this.month() + 1 }
  570. function addFormatToken (token, padded, ordinal, callback) {
  571. var func = callback;
  572. if (typeof callback === 'string') {
  573. func = function () {
  574. return this[callback]();
  575. };
  576. }
  577. if (token) {
  578. formatTokenFunctions[token] = func;
  579. }
  580. if (padded) {
  581. formatTokenFunctions[padded[0]] = function () {
  582. return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
  583. };
  584. }
  585. if (ordinal) {
  586. formatTokenFunctions[ordinal] = function () {
  587. return this.localeData().ordinal(func.apply(this, arguments), token);
  588. };
  589. }
  590. }
  591. function removeFormattingTokens(input) {
  592. if (input.match(/\[[\s\S]/)) {
  593. return input.replace(/^\[|\]$/g, '');
  594. }
  595. return input.replace(/\\/g, '');
  596. }
  597. function makeFormatFunction(format) {
  598. var array = format.match(formattingTokens), i, length;
  599. for (i = 0, length = array.length; i < length; i++) {
  600. if (formatTokenFunctions[array[i]]) {
  601. array[i] = formatTokenFunctions[array[i]];
  602. } else {
  603. array[i] = removeFormattingTokens(array[i]);
  604. }
  605. }
  606. return function (mom) {
  607. var output = '', i;
  608. for (i = 0; i < length; i++) {
  609. output += array[i] instanceof Function ? array[i].call(mom, format) : array[i];
  610. }
  611. return output;
  612. };
  613. }
  614. // format date using native date object
  615. function formatMoment(m, format) {
  616. if (!m.isValid()) {
  617. return m.localeData().invalidDate();
  618. }
  619. format = expandFormat(format, m.localeData());
  620. formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
  621. return formatFunctions[format](m);
  622. }
  623. function expandFormat(format, locale) {
  624. var i = 5;
  625. function replaceLongDateFormatTokens(input) {
  626. return locale.longDateFormat(input) || input;
  627. }
  628. localFormattingTokens.lastIndex = 0;
  629. while (i >= 0 && localFormattingTokens.test(format)) {
  630. format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
  631. localFormattingTokens.lastIndex = 0;
  632. i -= 1;
  633. }
  634. return format;
  635. }
  636. var match1 = /\d/; // 0 - 9
  637. var match2 = /\d\d/; // 00 - 99
  638. var match3 = /\d{3}/; // 000 - 999
  639. var match4 = /\d{4}/; // 0000 - 9999
  640. var match6 = /[+-]?\d{6}/; // -999999 - 999999
  641. var match1to2 = /\d\d?/; // 0 - 99
  642. var match3to4 = /\d\d\d\d?/; // 999 - 9999
  643. var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999
  644. var match1to3 = /\d{1,3}/; // 0 - 999
  645. var match1to4 = /\d{1,4}/; // 0 - 9999
  646. var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999
  647. var matchUnsigned = /\d+/; // 0 - inf
  648. var matchSigned = /[+-]?\d+/; // -inf - inf
  649. var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
  650. var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z
  651. var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123
  652. // any word (or two) characters or numbers including two/three word month in arabic.
  653. // includes scottish gaelic two word and hyphenated months
  654. var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i;
  655. var regexes = {};
  656. function addRegexToken (token, regex, strictRegex) {
  657. regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {
  658. return (isStrict && strictRegex) ? strictRegex : regex;
  659. };
  660. }
  661. function getParseRegexForToken (token, config) {
  662. if (!hasOwnProp(regexes, token)) {
  663. return new RegExp(unescapeFormat(token));
  664. }
  665. return regexes[token](config._strict, config._locale);
  666. }
  667. // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
  668. function unescapeFormat(s) {
  669. return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
  670. return p1 || p2 || p3 || p4;
  671. }));
  672. }
  673. function regexEscape(s) {
  674. return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
  675. }
  676. var tokens = {};
  677. function addParseToken (token, callback) {
  678. var i, func = callback;
  679. if (typeof token === 'string') {
  680. token = [token];
  681. }
  682. if (isNumber(callback)) {
  683. func = function (input, array) {
  684. array[callback] = toInt(input);
  685. };
  686. }
  687. for (i = 0; i < token.length; i++) {
  688. tokens[token[i]] = func;
  689. }
  690. }
  691. function addWeekParseToken (token, callback) {
  692. addParseToken(token, function (input, array, config, token) {
  693. config._w = config._w || {};
  694. callback(input, config._w, config, token);
  695. });
  696. }
  697. function addTimeToArrayFromToken(token, input, config) {
  698. if (input != null && hasOwnProp(tokens, token)) {
  699. tokens[token](input, config._a, config, token);
  700. }
  701. }
  702. var YEAR = 0;
  703. var MONTH = 1;
  704. var DATE = 2;
  705. var HOUR = 3;
  706. var MINUTE = 4;
  707. var SECOND = 5;
  708. var MILLISECOND = 6;
  709. var WEEK = 7;
  710. var WEEKDAY = 8;
  711. var indexOf;
  712. if (Array.prototype.indexOf) {
  713. indexOf = Array.prototype.indexOf;
  714. } else {
  715. indexOf = function (o) {
  716. // I know
  717. var i;
  718. for (i = 0; i < this.length; ++i) {
  719. if (this[i] === o) {
  720. return i;
  721. }
  722. }
  723. return -1;
  724. };
  725. }
  726. var indexOf$1 = indexOf;
  727. function daysInMonth(year, month) {
  728. return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
  729. }
  730. // FORMATTING
  731. addFormatToken('M', ['MM', 2], 'Mo', function () {
  732. return this.month() + 1;
  733. });
  734. addFormatToken('MMM', 0, 0, function (format) {
  735. return this.localeData().monthsShort(this, format);
  736. });
  737. addFormatToken('MMMM', 0, 0, function (format) {
  738. return this.localeData().months(this, format);
  739. });
  740. // ALIASES
  741. addUnitAlias('month', 'M');
  742. // PRIORITY
  743. addUnitPriority('month', 8);
  744. // PARSING
  745. addRegexToken('M', match1to2);
  746. addRegexToken('MM', match1to2, match2);
  747. addRegexToken('MMM', function (isStrict, locale) {
  748. return locale.monthsShortRegex(isStrict);
  749. });
  750. addRegexToken('MMMM', function (isStrict, locale) {
  751. return locale.monthsRegex(isStrict);
  752. });
  753. addParseToken(['M', 'MM'], function (input, array) {
  754. array[MONTH] = toInt(input) - 1;
  755. });
  756. addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
  757. var month = config._locale.monthsParse(input, token, config._strict);
  758. // if we didn't find a month name, mark the date as invalid.
  759. if (month != null) {
  760. array[MONTH] = month;
  761. } else {
  762. getParsingFlags(config).invalidMonth = input;
  763. }
  764. });
  765. // LOCALES
  766. var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;
  767. var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
  768. function localeMonths (m, format) {
  769. if (!m) {
  770. return this._months;
  771. }
  772. return isArray(this._months) ? this._months[m.month()] :
  773. this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];
  774. }
  775. var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
  776. function localeMonthsShort (m, format) {
  777. if (!m) {
  778. return this._monthsShort;
  779. }
  780. return isArray(this._monthsShort) ? this._monthsShort[m.month()] :
  781. this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];
  782. }
  783. function handleStrictParse(monthName, format, strict) {
  784. var i, ii, mom, llc = monthName.toLocaleLowerCase();
  785. if (!this._monthsParse) {
  786. // this is not used
  787. this._monthsParse = [];
  788. this._longMonthsParse = [];
  789. this._shortMonthsParse = [];
  790. for (i = 0; i < 12; ++i) {
  791. mom = createUTC([2000, i]);
  792. this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();
  793. this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
  794. }
  795. }
  796. if (strict) {
  797. if (format === 'MMM') {
  798. ii = indexOf$1.call(this._shortMonthsParse, llc);
  799. return ii !== -1 ? ii : null;
  800. } else {
  801. ii = indexOf$1.call(this._longMonthsParse, llc);
  802. return ii !== -1 ? ii : null;
  803. }
  804. } else {
  805. if (format === 'MMM') {
  806. ii = indexOf$1.call(this._shortMonthsParse, llc);
  807. if (ii !== -1) {
  808. return ii;
  809. }
  810. ii = indexOf$1.call(this._longMonthsParse, llc);
  811. return ii !== -1 ? ii : null;
  812. } else {
  813. ii = indexOf$1.call(this._longMonthsParse, llc);
  814. if (ii !== -1) {
  815. return ii;
  816. }
  817. ii = indexOf$1.call(this._shortMonthsParse, llc);
  818. return ii !== -1 ? ii : null;
  819. }
  820. }
  821. }
  822. function localeMonthsParse (monthName, format, strict) {
  823. var i, mom, regex;
  824. if (this._monthsParseExact) {
  825. return handleStrictParse.call(this, monthName, format, strict);
  826. }
  827. if (!this._monthsParse) {
  828. this._monthsParse = [];
  829. this._longMonthsParse = [];
  830. this._shortMonthsParse = [];
  831. }
  832. // TODO: add sorting
  833. // Sorting makes sure if one month (or abbr) is a prefix of another
  834. // see sorting in computeMonthsParse
  835. for (i = 0; i < 12; i++) {
  836. // make the regex if we don't have it already
  837. mom = createUTC([2000, i]);
  838. if (strict && !this._longMonthsParse[i]) {
  839. this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
  840. this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
  841. }
  842. if (!strict && !this._monthsParse[i]) {
  843. regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
  844. this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
  845. }
  846. // test the regex
  847. if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
  848. return i;
  849. } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
  850. return i;
  851. } else if (!strict && this._monthsParse[i].test(monthName)) {
  852. return i;
  853. }
  854. }
  855. }
  856. // MOMENTS
  857. function setMonth (mom, value) {
  858. var dayOfMonth;
  859. if (!mom.isValid()) {
  860. // No op
  861. return mom;
  862. }
  863. if (typeof value === 'string') {
  864. if (/^\d+$/.test(value)) {
  865. value = toInt(value);
  866. } else {
  867. value = mom.localeData().monthsParse(value);
  868. // TODO: Another silent failure?
  869. if (!isNumber(value)) {
  870. return mom;
  871. }
  872. }
  873. }
  874. dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
  875. mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
  876. return mom;
  877. }
  878. function getSetMonth (value) {
  879. if (value != null) {
  880. setMonth(this, value);
  881. hooks.updateOffset(this, true);
  882. return this;
  883. } else {
  884. return get(this, 'Month');
  885. }
  886. }
  887. function getDaysInMonth () {
  888. return daysInMonth(this.year(), this.month());
  889. }
  890. var defaultMonthsShortRegex = matchWord;
  891. function monthsShortRegex (isStrict) {
  892. if (this._monthsParseExact) {
  893. if (!hasOwnProp(this, '_monthsRegex')) {
  894. computeMonthsParse.call(this);
  895. }
  896. if (isStrict) {
  897. return this._monthsShortStrictRegex;
  898. } else {
  899. return this._monthsShortRegex;
  900. }
  901. } else {
  902. if (!hasOwnProp(this, '_monthsShortRegex')) {
  903. this._monthsShortRegex = defaultMonthsShortRegex;
  904. }
  905. return this._monthsShortStrictRegex && isStrict ?
  906. this._monthsShortStrictRegex : this._monthsShortRegex;
  907. }
  908. }
  909. var defaultMonthsRegex = matchWord;
  910. function monthsRegex (isStrict) {
  911. if (this._monthsParseExact) {
  912. if (!hasOwnProp(this, '_monthsRegex')) {
  913. computeMonthsParse.call(this);
  914. }
  915. if (isStrict) {
  916. return this._monthsStrictRegex;
  917. } else {
  918. return this._monthsRegex;
  919. }
  920. } else {
  921. if (!hasOwnProp(this, '_monthsRegex')) {
  922. this._monthsRegex = defaultMonthsRegex;
  923. }
  924. return this._monthsStrictRegex && isStrict ?
  925. this._monthsStrictRegex : this._monthsRegex;
  926. }
  927. }
  928. function computeMonthsParse () {
  929. function cmpLenRev(a, b) {
  930. return b.length - a.length;
  931. }
  932. var shortPieces = [], longPieces = [], mixedPieces = [],
  933. i, mom;
  934. for (i = 0; i < 12; i++) {
  935. // make the regex if we don't have it already
  936. mom = createUTC([2000, i]);
  937. shortPieces.push(this.monthsShort(mom, ''));
  938. longPieces.push(this.months(mom, ''));
  939. mixedPieces.push(this.months(mom, ''));
  940. mixedPieces.push(this.monthsShort(mom, ''));
  941. }
  942. // Sorting makes sure if one month (or abbr) is a prefix of another it
  943. // will match the longer piece.
  944. shortPieces.sort(cmpLenRev);
  945. longPieces.sort(cmpLenRev);
  946. mixedPieces.sort(cmpLenRev);
  947. for (i = 0; i < 12; i++) {
  948. shortPieces[i] = regexEscape(shortPieces[i]);
  949. longPieces[i] = regexEscape(longPieces[i]);
  950. }
  951. for (i = 0; i < 24; i++) {
  952. mixedPieces[i] = regexEscape(mixedPieces[i]);
  953. }
  954. this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  955. this._monthsShortRegex = this._monthsRegex;
  956. this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
  957. this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
  958. }
  959. // FORMATTING
  960. addFormatToken('Y', 0, 0, function () {
  961. var y = this.year();
  962. return y <= 9999 ? '' + y : '+' + y;
  963. });
  964. addFormatToken(0, ['YY', 2], 0, function () {
  965. return this.year() % 100;
  966. });
  967. addFormatToken(0, ['YYYY', 4], 0, 'year');
  968. addFormatToken(0, ['YYYYY', 5], 0, 'year');
  969. addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
  970. // ALIASES
  971. addUnitAlias('year', 'y');
  972. // PRIORITIES
  973. addUnitPriority('year', 1);
  974. // PARSING
  975. addRegexToken('Y', matchSigned);
  976. addRegexToken('YY', match1to2, match2);
  977. addRegexToken('YYYY', match1to4, match4);
  978. addRegexToken('YYYYY', match1to6, match6);
  979. addRegexToken('YYYYYY', match1to6, match6);
  980. addParseToken(['YYYYY', 'YYYYYY'], YEAR);
  981. addParseToken('YYYY', function (input, array) {
  982. array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
  983. });
  984. addParseToken('YY', function (input, array) {
  985. array[YEAR] = hooks.parseTwoDigitYear(input);
  986. });
  987. addParseToken('Y', function (input, array) {
  988. array[YEAR] = parseInt(input, 10);
  989. });
  990. // HELPERS
  991. function daysInYear(year) {
  992. return isLeapYear(year) ? 366 : 365;
  993. }
  994. function isLeapYear(year) {
  995. return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
  996. }
  997. // HOOKS
  998. hooks.parseTwoDigitYear = function (input) {
  999. return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
  1000. };
  1001. // MOMENTS
  1002. var getSetYear = makeGetSet('FullYear', true);
  1003. function getIsLeapYear () {
  1004. return isLeapYear(this.year());
  1005. }
  1006. function createDate (y, m, d, h, M, s, ms) {
  1007. //can't just apply() to create a date:
  1008. //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply
  1009. var date = new Date(y, m, d, h, M, s, ms);
  1010. //the date constructor remaps years 0-99 to 1900-1999
  1011. if (y < 100 && y >= 0 && isFinite(date.getFullYear())) {
  1012. date.setFullYear(y);
  1013. }
  1014. return date;
  1015. }
  1016. function createUTCDate (y) {
  1017. var date = new Date(Date.UTC.apply(null, arguments));
  1018. //the Date.UTC function remaps years 0-99 to 1900-1999
  1019. if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) {
  1020. date.setUTCFullYear(y);
  1021. }
  1022. return date;
  1023. }
  1024. // start-of-first-week - start-of-year
  1025. function firstWeekOffset(year, dow, doy) {
  1026. var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
  1027. fwd = 7 + dow - doy,
  1028. // first-week day local weekday -- which local weekday is fwd
  1029. fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
  1030. return -fwdlw + fwd - 1;
  1031. }
  1032. //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
  1033. function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
  1034. var localWeekday = (7 + weekday - dow) % 7,
  1035. weekOffset = firstWeekOffset(year, dow, doy),
  1036. dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
  1037. resYear, resDayOfYear;
  1038. if (dayOfYear <= 0) {
  1039. resYear = year - 1;
  1040. resDayOfYear = daysInYear(resYear) + dayOfYear;
  1041. } else if (dayOfYear > daysInYear(year)) {
  1042. resYear = year + 1;
  1043. resDayOfYear = dayOfYear - daysInYear(year);
  1044. } else {
  1045. resYear = year;
  1046. resDayOfYear = dayOfYear;
  1047. }
  1048. return {
  1049. year: resYear,
  1050. dayOfYear: resDayOfYear
  1051. };
  1052. }
  1053. function weekOfYear(mom, dow, doy) {
  1054. var weekOffset = firstWeekOffset(mom.year(), dow, doy),
  1055. week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
  1056. resWeek, resYear;
  1057. if (week < 1) {
  1058. resYear = mom.year() - 1;
  1059. resWeek = week + weeksInYear(resYear, dow, doy);
  1060. } else if (week > weeksInYear(mom.year(), dow, doy)) {
  1061. resWeek = week - weeksInYear(mom.year(), dow, doy);
  1062. resYear = mom.year() + 1;
  1063. } else {
  1064. resYear = mom.year();
  1065. resWeek = week;
  1066. }
  1067. return {
  1068. week: resWeek,
  1069. year: resYear
  1070. };
  1071. }
  1072. function weeksInYear(year, dow, doy) {
  1073. var weekOffset = firstWeekOffset(year, dow, doy),
  1074. weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
  1075. return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
  1076. }
  1077. // FORMATTING
  1078. addFormatToken('w', ['ww', 2], 'wo', 'week');
  1079. addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
  1080. // ALIASES
  1081. addUnitAlias('week', 'w');
  1082. addUnitAlias('isoWeek', 'W');
  1083. // PRIORITIES
  1084. addUnitPriority('week', 5);
  1085. addUnitPriority('isoWeek', 5);
  1086. // PARSING
  1087. addRegexToken('w', match1to2);
  1088. addRegexToken('ww', match1to2, match2);
  1089. addRegexToken('W', match1to2);
  1090. addRegexToken('WW', match1to2, match2);
  1091. addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
  1092. week[token.substr(0, 1)] = toInt(input);
  1093. });
  1094. // HELPERS
  1095. // LOCALES
  1096. function localeWeek (mom) {
  1097. return weekOfYear(mom, this._week.dow, this._week.doy).week;
  1098. }
  1099. var defaultLocaleWeek = {
  1100. dow : 0, // Sunday is the first day of the week.
  1101. doy : 6 // The week that contains Jan 1st is the first week of the year.
  1102. };
  1103. function localeFirstDayOfWeek () {
  1104. return this._week.dow;
  1105. }
  1106. function localeFirstDayOfYear () {
  1107. return this._week.doy;
  1108. }
  1109. // MOMENTS
  1110. function getSetWeek (input) {
  1111. var week = this.localeData().week(this);
  1112. return input == null ? week : this.add((input - week) * 7, 'd');
  1113. }
  1114. function getSetISOWeek (input) {
  1115. var week = weekOfYear(this, 1, 4).week;
  1116. return input == null ? week : this.add((input - week) * 7, 'd');
  1117. }
  1118. // FORMATTING
  1119. addFormatToken('d', 0, 'do', 'day');
  1120. addFormatToken('dd', 0, 0, function (format) {
  1121. return this.localeData().weekdaysMin(this, format);
  1122. });
  1123. addFormatToken('ddd', 0, 0, function (format) {
  1124. return this.localeData().weekdaysShort(this, format);
  1125. });
  1126. addFormatToken('dddd', 0, 0, function (format) {
  1127. return this.localeData().weekdays(this, format);
  1128. });
  1129. addFormatToken('e', 0, 0, 'weekday');
  1130. addFormatToken('E', 0, 0, 'isoWeekday');
  1131. // ALIASES
  1132. addUnitAlias('day', 'd');
  1133. addUnitAlias('weekday', 'e');
  1134. addUnitAlias('isoWeekday', 'E');
  1135. // PRIORITY
  1136. addUnitPriority('day', 11);
  1137. addUnitPriority('weekday', 11);
  1138. addUnitPriority('isoWeekday', 11);
  1139. // PARSING
  1140. addRegexToken('d', match1to2);
  1141. addRegexToken('e', match1to2);
  1142. addRegexToken('E', match1to2);
  1143. addRegexToken('dd', function (isStrict, locale) {
  1144. return locale.weekdaysMinRegex(isStrict);
  1145. });
  1146. addRegexToken('ddd', function (isStrict, locale) {
  1147. return locale.weekdaysShortRegex(isStrict);
  1148. });
  1149. addRegexToken('dddd', function (isStrict, locale) {
  1150. return locale.weekdaysRegex(isStrict);
  1151. });
  1152. addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
  1153. var weekday = config._locale.weekdaysParse(input, token, config._strict);
  1154. // if we didn't get a weekday name, mark the date as invalid
  1155. if (weekday != null) {
  1156. week.d = weekday;
  1157. } else {
  1158. getParsingFlags(config).invalidWeekday = input;
  1159. }
  1160. });
  1161. addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
  1162. week[token] = toInt(input);
  1163. });
  1164. // HELPERS
  1165. function parseWeekday(input, locale) {
  1166. if (typeof input !== 'string') {
  1167. return input;
  1168. }
  1169. if (!isNaN(input)) {
  1170. return parseInt(input, 10);
  1171. }
  1172. input = locale.weekdaysParse(input);
  1173. if (typeof input === 'number') {
  1174. return input;
  1175. }
  1176. return null;
  1177. }
  1178. function parseIsoWeekday(input, locale) {
  1179. if (typeof input === 'string') {
  1180. return locale.weekdaysParse(input) % 7 || 7;
  1181. }
  1182. return isNaN(input) ? null : input;
  1183. }
  1184. // LOCALES
  1185. var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
  1186. function localeWeekdays (m, format) {
  1187. if (!m) {
  1188. return this._weekdays;
  1189. }
  1190. return isArray(this._weekdays) ? this._weekdays[m.day()] :
  1191. this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()];
  1192. }
  1193. var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
  1194. function localeWeekdaysShort (m) {
  1195. return (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort;
  1196. }
  1197. var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
  1198. function localeWeekdaysMin (m) {
  1199. return (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin;
  1200. }
  1201. function handleStrictParse$1(weekdayName, format, strict) {
  1202. var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
  1203. if (!this._weekdaysParse) {
  1204. this._weekdaysParse = [];
  1205. this._shortWeekdaysParse = [];
  1206. this._minWeekdaysParse = [];
  1207. for (i = 0; i < 7; ++i) {
  1208. mom = createUTC([2000, 1]).day(i);
  1209. this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();
  1210. this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();
  1211. this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
  1212. }
  1213. }
  1214. if (strict) {
  1215. if (format === 'dddd') {
  1216. ii = indexOf$1.call(this._weekdaysParse, llc);
  1217. return ii !== -1 ? ii : null;
  1218. } else if (format === 'ddd') {
  1219. ii = indexOf$1.call(this._shortWeekdaysParse, llc);
  1220. return ii !== -1 ? ii : null;
  1221. } else {
  1222. ii = indexOf$1.call(this._minWeekdaysParse, llc);
  1223. return ii !== -1 ? ii : null;
  1224. }
  1225. } else {
  1226. if (format === 'dddd') {
  1227. ii = indexOf$1.call(this._weekdaysParse, llc);
  1228. if (ii !== -1) {
  1229. return ii;
  1230. }
  1231. ii = indexOf$1.call(this._shortWeekdaysParse, llc);
  1232. if (ii !== -1) {
  1233. return ii;
  1234. }
  1235. ii = indexOf$1.call(this._minWeekdaysParse, llc);
  1236. return ii !== -1 ? ii : null;
  1237. } else if (format === 'ddd') {
  1238. ii = indexOf$1.call(this._shortWeekdaysParse, llc);
  1239. if (ii !== -1) {
  1240. return ii;
  1241. }
  1242. ii = indexOf$1.call(this._weekdaysParse, llc);
  1243. if (ii !== -1) {
  1244. return ii;
  1245. }
  1246. ii = indexOf$1.call(this._minWeekdaysParse, llc);
  1247. return ii !== -1 ? ii : null;
  1248. } else {
  1249. ii = indexOf$1.call(this._minWeekdaysParse, llc);
  1250. if (ii !== -1) {
  1251. return ii;
  1252. }
  1253. ii = indexOf$1.call(this._weekdaysParse, llc);
  1254. if (ii !== -1) {
  1255. return ii;
  1256. }
  1257. ii = indexOf$1.call(this._shortWeekdaysParse, llc);
  1258. return ii !== -1 ? ii : null;
  1259. }
  1260. }
  1261. }
  1262. function localeWeekdaysParse (weekdayName, format, strict) {
  1263. var i, mom, regex;
  1264. if (this._weekdaysParseExact) {
  1265. return handleStrictParse$1.call(this, weekdayName, format, strict);
  1266. }
  1267. if (!this._weekdaysParse) {
  1268. this._weekdaysParse = [];
  1269. this._minWeekdaysParse = [];
  1270. this._shortWeekdaysParse = [];
  1271. this._fullWeekdaysParse = [];
  1272. }
  1273. for (i = 0; i < 7; i++) {
  1274. // make the regex if we don't have it already
  1275. mom = createUTC([2000, 1]).day(i);
  1276. if (strict && !this._fullWeekdaysParse[i]) {
  1277. this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i');
  1278. this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i');
  1279. this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i');
  1280. }
  1281. if (!this._weekdaysParse[i]) {
  1282. regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
  1283. this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
  1284. }
  1285. // test the regex
  1286. if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
  1287. return i;
  1288. } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
  1289. return i;
  1290. } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
  1291. return i;
  1292. } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
  1293. return i;
  1294. }
  1295. }
  1296. }
  1297. // MOMENTS
  1298. function getSetDayOfWeek (input) {
  1299. if (!this.isValid()) {
  1300. return input != null ? this : NaN;
  1301. }
  1302. var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
  1303. if (input != null) {
  1304. input = parseWeekday(input, this.localeData());
  1305. return this.add(input - day, 'd');
  1306. } else {
  1307. return day;
  1308. }
  1309. }
  1310. function getSetLocaleDayOfWeek (input) {
  1311. if (!this.isValid()) {
  1312. return input != null ? this : NaN;
  1313. }
  1314. var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
  1315. return input == null ? weekday : this.add(input - weekday, 'd');
  1316. }
  1317. function getSetISODayOfWeek (input) {
  1318. if (!this.isValid()) {
  1319. return input != null ? this : NaN;
  1320. }
  1321. // behaves the same as moment#day except
  1322. // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
  1323. // as a setter, sunday should belong to the previous week.
  1324. if (input != null) {
  1325. var weekday = parseIsoWeekday(input, this.localeData());
  1326. return this.day(this.day() % 7 ? weekday : weekday - 7);
  1327. } else {
  1328. return this.day() || 7;
  1329. }
  1330. }
  1331. var defaultWeekdaysRegex = matchWord;
  1332. function weekdaysRegex (isStrict) {
  1333. if (this._weekdaysParseExact) {
  1334. if (!hasOwnProp(this, '_weekdaysRegex')) {
  1335. computeWeekdaysParse.call(this);
  1336. }
  1337. if (isStrict) {
  1338. return this._weekdaysStrictRegex;
  1339. } else {
  1340. return this._weekdaysRegex;
  1341. }
  1342. } else {
  1343. if (!hasOwnProp(this, '_weekdaysRegex')) {
  1344. this._weekdaysRegex = defaultWeekdaysRegex;
  1345. }
  1346. return this._weekdaysStrictRegex && isStrict ?
  1347. this._weekdaysStrictRegex : this._weekdaysRegex;
  1348. }
  1349. }
  1350. var defaultWeekdaysShortRegex = matchWord;
  1351. function weekdaysShortRegex (isStrict) {
  1352. if (this._weekdaysParseExact) {
  1353. if (!hasOwnProp(this, '_weekdaysRegex')) {
  1354. computeWeekdaysParse.call(this);
  1355. }
  1356. if (isStrict) {
  1357. return this._weekdaysShortStrictRegex;
  1358. } else {
  1359. return this._weekdaysShortRegex;
  1360. }
  1361. } else {
  1362. if (!hasOwnProp(this, '_weekdaysShortRegex')) {
  1363. this._weekdaysShortRegex = defaultWeekdaysShortRegex;
  1364. }
  1365. return this._weekdaysShortStrictRegex && isStrict ?
  1366. this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
  1367. }
  1368. }
  1369. var defaultWeekdaysMinRegex = matchWord;
  1370. function weekdaysMinRegex (isStrict) {
  1371. if (this._weekdaysParseExact) {
  1372. if (!hasOwnProp(this, '_weekdaysRegex')) {
  1373. computeWeekdaysParse.call(this);
  1374. }
  1375. if (isStrict) {
  1376. return this._weekdaysMinStrictRegex;
  1377. } else {
  1378. return this._weekdaysMinRegex;
  1379. }
  1380. } else {
  1381. if (!hasOwnProp(this, '_weekdaysMinRegex')) {
  1382. this._weekdaysMinRegex = defaultWeekdaysMinRegex;
  1383. }
  1384. return this._weekdaysMinStrictRegex && isStrict ?
  1385. this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
  1386. }
  1387. }
  1388. function computeWeekdaysParse () {
  1389. function cmpLenRev(a, b) {
  1390. return b.length - a.length;
  1391. }
  1392. var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [],
  1393. i, mom, minp, shortp, longp;
  1394. for (i = 0; i < 7; i++) {
  1395. // make the regex if we don't have it already
  1396. mom = createUTC([2000, 1]).day(i);
  1397. minp = this.weekdaysMin(mom, '');
  1398. shortp = this.weekdaysShort(mom, '');
  1399. longp = this.weekdays(mom, '');
  1400. minPieces.push(minp);
  1401. shortPieces.push(shortp);
  1402. longPieces.push(longp);
  1403. mixedPieces.push(minp);
  1404. mixedPieces.push(shortp);
  1405. mixedPieces.push(longp);
  1406. }
  1407. // Sorting makes sure if one weekday (or abbr) is a prefix of another it
  1408. // will match the longer piece.
  1409. minPieces.sort(cmpLenRev);
  1410. shortPieces.sort(cmpLenRev);
  1411. longPieces.sort(cmpLenRev);
  1412. mixedPieces.sort(cmpLenRev);
  1413. for (i = 0; i < 7; i++) {
  1414. shortPieces[i] = regexEscape(shortPieces[i]);
  1415. longPieces[i] = regexEscape(longPieces[i]);
  1416. mixedPieces[i] = regexEscape(mixedPieces[i]);
  1417. }
  1418. this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  1419. this._weekdaysShortRegex = this._weekdaysRegex;
  1420. this._weekdaysMinRegex = this._weekdaysRegex;
  1421. this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
  1422. this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
  1423. this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');
  1424. }
  1425. // FORMATTING
  1426. function hFormat() {
  1427. return this.hours() % 12 || 12;
  1428. }
  1429. function kFormat() {
  1430. return this.hours() || 24;
  1431. }
  1432. addFormatToken('H', ['HH', 2], 0, 'hour');
  1433. addFormatToken('h', ['hh', 2], 0, hFormat);
  1434. addFormatToken('k', ['kk', 2], 0, kFormat);
  1435. addFormatToken('hmm', 0, 0, function () {
  1436. return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
  1437. });
  1438. addFormatToken('hmmss', 0, 0, function () {
  1439. return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) +
  1440. zeroFill(this.seconds(), 2);
  1441. });
  1442. addFormatToken('Hmm', 0, 0, function () {
  1443. return '' + this.hours() + zeroFill(this.minutes(), 2);
  1444. });
  1445. addFormatToken('Hmmss', 0, 0, function () {
  1446. return '' + this.hours() + zeroFill(this.minutes(), 2) +
  1447. zeroFill(this.seconds(), 2);
  1448. });
  1449. function meridiem (token, lowercase) {
  1450. addFormatToken(token, 0, 0, function () {
  1451. return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
  1452. });
  1453. }
  1454. meridiem('a', true);
  1455. meridiem('A', false);
  1456. // ALIASES
  1457. addUnitAlias('hour', 'h');
  1458. // PRIORITY
  1459. addUnitPriority('hour', 13);
  1460. // PARSING
  1461. function matchMeridiem (isStrict, locale) {
  1462. return locale._meridiemParse;
  1463. }
  1464. addRegexToken('a', matchMeridiem);
  1465. addRegexToken('A', matchMeridiem);
  1466. addRegexToken('H', match1to2);
  1467. addRegexToken('h', match1to2);
  1468. addRegexToken('HH', match1to2, match2);
  1469. addRegexToken('hh', match1to2, match2);
  1470. addRegexToken('hmm', match3to4);
  1471. addRegexToken('hmmss', match5to6);
  1472. addRegexToken('Hmm', match3to4);
  1473. addRegexToken('Hmmss', match5to6);
  1474. addParseToken(['H', 'HH'], HOUR);
  1475. addParseToken(['a', 'A'], function (input, array, config) {
  1476. config._isPm = config._locale.isPM(input);
  1477. config._meridiem = input;
  1478. });
  1479. addParseToken(['h', 'hh'], function (input, array, config) {
  1480. array[HOUR] = toInt(input);
  1481. getParsingFlags(config).bigHour = true;
  1482. });
  1483. addParseToken('hmm', function (input, array, config) {
  1484. var pos = input.length - 2;
  1485. array[HOUR] = toInt(input.substr(0, pos));
  1486. array[MINUTE] = toInt(input.substr(pos));
  1487. getParsingFlags(config).bigHour = true;
  1488. });
  1489. addParseToken('hmmss', function (input, array, config) {
  1490. var pos1 = input.length - 4;
  1491. var pos2 = input.length - 2;
  1492. array[HOUR] = toInt(input.substr(0, pos1));
  1493. array[MINUTE] = toInt(input.substr(pos1, 2));
  1494. array[SECOND] = toInt(input.substr(pos2));
  1495. getParsingFlags(config).bigHour = true;
  1496. });
  1497. addParseToken('Hmm', function (input, array, config) {
  1498. var pos = input.length - 2;
  1499. array[HOUR] = toInt(input.substr(0, pos));
  1500. array[MINUTE] = toInt(input.substr(pos));
  1501. });
  1502. addParseToken('Hmmss', function (input, array, config) {
  1503. var pos1 = input.length - 4;
  1504. var pos2 = input.length - 2;
  1505. array[HOUR] = toInt(input.substr(0, pos1));
  1506. array[MINUTE] = toInt(input.substr(pos1, 2));
  1507. array[SECOND] = toInt(input.substr(pos2));
  1508. });
  1509. // LOCALES
  1510. function localeIsPM (input) {
  1511. // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
  1512. // Using charAt should be more compatible.
  1513. return ((input + '').toLowerCase().charAt(0) === 'p');
  1514. }
  1515. var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
  1516. function localeMeridiem (hours, minutes, isLower) {
  1517. if (hours > 11) {
  1518. return isLower ? 'pm' : 'PM';
  1519. } else {
  1520. return isLower ? 'am' : 'AM';
  1521. }
  1522. }
  1523. // MOMENTS
  1524. // Setting the hour should keep the time, because the user explicitly
  1525. // specified which hour he wants. So trying to maintain the same hour (in
  1526. // a new timezone) makes sense. Adding/subtracting hours does not follow
  1527. // this rule.
  1528. var getSetHour = makeGetSet('Hours', true);
  1529. // months
  1530. // week
  1531. // weekdays
  1532. // meridiem
  1533. var baseConfig = {
  1534. calendar: defaultCalendar,
  1535. longDateFormat: defaultLongDateFormat,
  1536. invalidDate: defaultInvalidDate,
  1537. ordinal: defaultOrdinal,
  1538. ordinalParse: defaultOrdinalParse,
  1539. relativeTime: defaultRelativeTime,
  1540. months: defaultLocaleMonths,
  1541. monthsShort: defaultLocaleMonthsShort,
  1542. week: defaultLocaleWeek,
  1543. weekdays: defaultLocaleWeekdays,
  1544. weekdaysMin: defaultLocaleWeekdaysMin,
  1545. weekdaysShort: defaultLocaleWeekdaysShort,
  1546. meridiemParse: defaultLocaleMeridiemParse
  1547. };
  1548. // internal storage for locale config files
  1549. var locales = {};
  1550. var localeFamilies = {};
  1551. var globalLocale;
  1552. function normalizeLocale(key) {
  1553. return key ? key.toLowerCase().replace('_', '-') : key;
  1554. }
  1555. // pick the locale from the array
  1556. // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
  1557. // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
  1558. function chooseLocale(names) {
  1559. var i = 0, j, next, locale, split;
  1560. while (i < names.length) {
  1561. split = normalizeLocale(names[i]).split('-');
  1562. j = split.length;
  1563. next = normalizeLocale(names[i + 1]);
  1564. next = next ? next.split('-') : null;
  1565. while (j > 0) {
  1566. locale = loadLocale(split.slice(0, j).join('-'));
  1567. if (locale) {
  1568. return locale;
  1569. }
  1570. if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
  1571. //the next array item is better than a shallower substring of this one
  1572. break;
  1573. }
  1574. j--;
  1575. }
  1576. i++;
  1577. }
  1578. return null;
  1579. }
  1580. function loadLocale(name) {
  1581. var oldLocale = null;
  1582. // TODO: Find a better way to register and load all the locales in Node
  1583. if (!locales[name] && (typeof module !== 'undefined') &&
  1584. module && module.exports) {
  1585. try {
  1586. oldLocale = globalLocale._abbr;
  1587. __webpack_require__(125)("./" + name);
  1588. // because defineLocale currently also sets the global locale, we
  1589. // want to undo that for lazy loaded locales
  1590. getSetGlobalLocale(oldLocale);
  1591. } catch (e) { }
  1592. }
  1593. return locales[name];
  1594. }
  1595. // This function will load locale and then set the global locale. If
  1596. // no arguments are passed in, it will simply return the current global
  1597. // locale key.
  1598. function getSetGlobalLocale (key, values) {
  1599. var data;
  1600. if (key) {
  1601. if (isUndefined(values)) {
  1602. data = getLocale(key);
  1603. }
  1604. else {
  1605. data = defineLocale(key, values);
  1606. }
  1607. if (data) {
  1608. // moment.duration._locale = moment._locale = data;
  1609. globalLocale = data;
  1610. }
  1611. }
  1612. return globalLocale._abbr;
  1613. }
  1614. function defineLocale (name, config) {
  1615. if (config !== null) {
  1616. var parentConfig = baseConfig;
  1617. config.abbr = name;
  1618. if (locales[name] != null) {
  1619. deprecateSimple('defineLocaleOverride',
  1620. 'use moment.updateLocale(localeName, config) to change ' +
  1621. 'an existing locale. moment.defineLocale(localeName, ' +
  1622. 'config) should only be used for creating a new locale ' +
  1623. 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');
  1624. parentConfig = locales[name]._config;
  1625. } else if (config.parentLocale != null) {
  1626. if (locales[config.parentLocale] != null) {
  1627. parentConfig = locales[config.parentLocale]._config;
  1628. } else {
  1629. if (!localeFamilies[config.parentLocale]) {
  1630. localeFamilies[config.parentLocale] = [];
  1631. }
  1632. localeFamilies[config.parentLocale].push({
  1633. name: name,
  1634. config: config
  1635. });
  1636. return null;
  1637. }
  1638. }
  1639. locales[name] = new Locale(mergeConfigs(parentConfig, config));
  1640. if (localeFamilies[name]) {
  1641. localeFamilies[name].forEach(function (x) {
  1642. defineLocale(x.name, x.config);
  1643. });
  1644. }
  1645. // backwards compat for now: also set the locale
  1646. // make sure we set the locale AFTER all child locales have been
  1647. // created, so we won't end up with the child locale set.
  1648. getSetGlobalLocale(name);
  1649. return locales[name];
  1650. } else {
  1651. // useful for testing
  1652. delete locales[name];
  1653. return null;
  1654. }
  1655. }
  1656. function updateLocale(name, config) {
  1657. if (config != null) {
  1658. var locale, parentConfig = baseConfig;
  1659. // MERGE
  1660. if (locales[name] != null) {
  1661. parentConfig = locales[name]._config;
  1662. }
  1663. config = mergeConfigs(parentConfig, config);
  1664. locale = new Locale(config);
  1665. locale.parentLocale = locales[name];
  1666. locales[name] = locale;
  1667. // backwards compat for now: also set the locale
  1668. getSetGlobalLocale(name);
  1669. } else {
  1670. // pass null for config to unupdate, useful for tests
  1671. if (locales[name] != null) {
  1672. if (locales[name].parentLocale != null) {
  1673. locales[name] = locales[name].parentLocale;
  1674. } else if (locales[name] != null) {
  1675. delete locales[name];
  1676. }
  1677. }
  1678. }
  1679. return locales[name];
  1680. }
  1681. // returns locale data
  1682. function getLocale (key) {
  1683. var locale;
  1684. if (key && key._locale && key._locale._abbr) {
  1685. key = key._locale._abbr;
  1686. }
  1687. if (!key) {
  1688. return globalLocale;
  1689. }
  1690. if (!isArray(key)) {
  1691. //short-circuit everything else
  1692. locale = loadLocale(key);
  1693. if (locale) {
  1694. return locale;
  1695. }
  1696. key = [key];
  1697. }
  1698. return chooseLocale(key);
  1699. }
  1700. function listLocales() {
  1701. return keys$1(locales);
  1702. }
  1703. function checkOverflow (m) {
  1704. var overflow;
  1705. var a = m._a;
  1706. if (a && getParsingFlags(m).overflow === -2) {
  1707. overflow =
  1708. a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :
  1709. a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
  1710. a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
  1711. a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :
  1712. a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :
  1713. a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :
  1714. -1;
  1715. if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
  1716. overflow = DATE;
  1717. }
  1718. if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
  1719. overflow = WEEK;
  1720. }
  1721. if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
  1722. overflow = WEEKDAY;
  1723. }
  1724. getParsingFlags(m).overflow = overflow;
  1725. }
  1726. return m;
  1727. }
  1728. // iso 8601 regex
  1729. // 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)
  1730. var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
  1731. var 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)?)?$/;
  1732. var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/;
  1733. var isoDates = [
  1734. ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
  1735. ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
  1736. ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
  1737. ['GGGG-[W]WW', /\d{4}-W\d\d/, false],
  1738. ['YYYY-DDD', /\d{4}-\d{3}/],
  1739. ['YYYY-MM', /\d{4}-\d\d/, false],
  1740. ['YYYYYYMMDD', /[+-]\d{10}/],
  1741. ['YYYYMMDD', /\d{8}/],
  1742. // YYYYMM is NOT allowed by the standard
  1743. ['GGGG[W]WWE', /\d{4}W\d{3}/],
  1744. ['GGGG[W]WW', /\d{4}W\d{2}/, false],
  1745. ['YYYYDDD', /\d{7}/]
  1746. ];
  1747. // iso time formats and regexes
  1748. var isoTimes = [
  1749. ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
  1750. ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
  1751. ['HH:mm:ss', /\d\d:\d\d:\d\d/],
  1752. ['HH:mm', /\d\d:\d\d/],
  1753. ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
  1754. ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
  1755. ['HHmmss', /\d\d\d\d\d\d/],
  1756. ['HHmm', /\d\d\d\d/],
  1757. ['HH', /\d\d/]
  1758. ];
  1759. var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
  1760. // date from iso format
  1761. function configFromISO(config) {
  1762. var i, l,
  1763. string = config._i,
  1764. match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
  1765. allowTime, dateFormat, timeFormat, tzFormat;
  1766. if (match) {
  1767. getParsingFlags(config).iso = true;
  1768. for (i = 0, l = isoDates.length; i < l; i++) {
  1769. if (isoDates[i][1].exec(match[1])) {
  1770. dateFormat = isoDates[i][0];
  1771. allowTime = isoDates[i][2] !== false;
  1772. break;
  1773. }
  1774. }
  1775. if (dateFormat == null) {
  1776. config._isValid = false;
  1777. return;
  1778. }
  1779. if (match[3]) {
  1780. for (i = 0, l = isoTimes.length; i < l; i++) {
  1781. if (isoTimes[i][1].exec(match[3])) {
  1782. // match[2] should be 'T' or space
  1783. timeFormat = (match[2] || ' ') + isoTimes[i][0];
  1784. break;
  1785. }
  1786. }
  1787. if (timeFormat == null) {
  1788. config._isValid = false;
  1789. return;
  1790. }
  1791. }
  1792. if (!allowTime && timeFormat != null) {
  1793. config._isValid = false;
  1794. return;
  1795. }
  1796. if (match[4]) {
  1797. if (tzRegex.exec(match[4])) {
  1798. tzFormat = 'Z';
  1799. } else {
  1800. config._isValid = false;
  1801. return;
  1802. }
  1803. }
  1804. config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
  1805. configFromStringAndFormat(config);
  1806. } else {
  1807. config._isValid = false;
  1808. }
  1809. }
  1810. // date from iso format or fallback
  1811. function configFromString(config) {
  1812. var matched = aspNetJsonRegex.exec(config._i);
  1813. if (matched !== null) {
  1814. config._d = new Date(+matched[1]);
  1815. return;
  1816. }
  1817. configFromISO(config);
  1818. if (config._isValid === false) {
  1819. delete config._isValid;
  1820. hooks.createFromInputFallback(config);
  1821. }
  1822. }
  1823. hooks.createFromInputFallback = deprecate(
  1824. 'value provided is not in a recognized ISO format. moment construction falls back to js Date(), ' +
  1825. 'which is not reliable across all browsers and versions. Non ISO date formats are ' +
  1826. 'discouraged and will be removed in an upcoming major release. Please refer to ' +
  1827. 'http://momentjs.com/guides/#/warnings/js-date/ for more info.',
  1828. function (config) {
  1829. config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
  1830. }
  1831. );
  1832. // Pick the first defined of two or three arguments.
  1833. function defaults(a, b, c) {
  1834. if (a != null) {
  1835. return a;
  1836. }
  1837. if (b != null) {
  1838. return b;
  1839. }
  1840. return c;
  1841. }
  1842. function currentDateArray(config) {
  1843. // hooks is actually the exported moment object
  1844. var nowValue = new Date(hooks.now());
  1845. if (config._useUTC) {
  1846. return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
  1847. }
  1848. return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
  1849. }
  1850. // convert an array to a date.
  1851. // the array should mirror the parameters below
  1852. // note: all values past the year are optional and will default to the lowest possible value.
  1853. // [year, month, day , hour, minute, second, millisecond]
  1854. function configFromArray (config) {
  1855. var i, date, input = [], currentDate, yearToUse;
  1856. if (config._d) {
  1857. return;
  1858. }
  1859. currentDate = currentDateArray(config);
  1860. //compute day of the year from weeks and weekdays
  1861. if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
  1862. dayOfYearFromWeekInfo(config);
  1863. }
  1864. //if the day of the year is set, figure out what it is
  1865. if (config._dayOfYear) {
  1866. yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
  1867. if (config._dayOfYear > daysInYear(yearToUse)) {
  1868. getParsingFlags(config)._overflowDayOfYear = true;
  1869. }
  1870. date = createUTCDate(yearToUse, 0, config._dayOfYear);
  1871. config._a[MONTH] = date.getUTCMonth();
  1872. config._a[DATE] = date.getUTCDate();
  1873. }
  1874. // Default to current date.
  1875. // * if no year, month, day of month are given, default to today
  1876. // * if day of month is given, default month and year
  1877. // * if month is given, default only year
  1878. // * if year is given, don't default anything
  1879. for (i = 0; i < 3 && config._a[i] == null; ++i) {
  1880. config._a[i] = input[i] = currentDate[i];
  1881. }
  1882. // Zero out whatever was not defaulted, including time
  1883. for (; i < 7; i++) {
  1884. config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
  1885. }
  1886. // Check for 24:00:00.000
  1887. if (config._a[HOUR] === 24 &&
  1888. config._a[MINUTE] === 0 &&
  1889. config._a[SECOND] === 0 &&
  1890. config._a[MILLISECOND] === 0) {
  1891. config._nextDay = true;
  1892. config._a[HOUR] = 0;
  1893. }
  1894. config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
  1895. // Apply timezone offset from input. The actual utcOffset can be changed
  1896. // with parseZone.
  1897. if (config._tzm != null) {
  1898. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  1899. }
  1900. if (config._nextDay) {
  1901. config._a[HOUR] = 24;
  1902. }
  1903. }
  1904. function dayOfYearFromWeekInfo(config) {
  1905. var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
  1906. w = config._w;
  1907. if (w.GG != null || w.W != null || w.E != null) {
  1908. dow = 1;
  1909. doy = 4;
  1910. // TODO: We need to take the current isoWeekYear, but that depends on
  1911. // how we interpret now (local, utc, fixed offset). So create
  1912. // a now version of current config (take local/utc/offset flags, and
  1913. // create now).
  1914. weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);
  1915. week = defaults(w.W, 1);
  1916. weekday = defaults(w.E, 1);
  1917. if (weekday < 1 || weekday > 7) {
  1918. weekdayOverflow = true;
  1919. }
  1920. } else {
  1921. dow = config._locale._week.dow;
  1922. doy = config._locale._week.doy;
  1923. var curWeek = weekOfYear(createLocal(), dow, doy);
  1924. weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
  1925. // Default to current week.
  1926. week = defaults(w.w, curWeek.week);
  1927. if (w.d != null) {
  1928. // weekday -- low day numbers are considered next week
  1929. weekday = w.d;
  1930. if (weekday < 0 || weekday > 6) {
  1931. weekdayOverflow = true;
  1932. }
  1933. } else if (w.e != null) {
  1934. // local weekday -- counting starts from begining of week
  1935. weekday = w.e + dow;
  1936. if (w.e < 0 || w.e > 6) {
  1937. weekdayOverflow = true;
  1938. }
  1939. } else {
  1940. // default to begining of week
  1941. weekday = dow;
  1942. }
  1943. }
  1944. if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
  1945. getParsingFlags(config)._overflowWeeks = true;
  1946. } else if (weekdayOverflow != null) {
  1947. getParsingFlags(config)._overflowWeekday = true;
  1948. } else {
  1949. temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
  1950. config._a[YEAR] = temp.year;
  1951. config._dayOfYear = temp.dayOfYear;
  1952. }
  1953. }
  1954. // constant that refers to the ISO standard
  1955. hooks.ISO_8601 = function () {};
  1956. // date from string and format string
  1957. function configFromStringAndFormat(config) {
  1958. // TODO: Move this to another part of the creation flow to prevent circular deps
  1959. if (config._f === hooks.ISO_8601) {
  1960. configFromISO(config);
  1961. return;
  1962. }
  1963. config._a = [];
  1964. getParsingFlags(config).empty = true;
  1965. // This array is used to make a Date, either with `new Date` or `Date.UTC`
  1966. var string = '' + config._i,
  1967. i, parsedInput, tokens, token, skipped,
  1968. stringLength = string.length,
  1969. totalParsedInputLength = 0;
  1970. tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
  1971. for (i = 0; i < tokens.length; i++) {
  1972. token = tokens[i];
  1973. parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
  1974. // console.log('token', token, 'parsedInput', parsedInput,
  1975. // 'regex', getParseRegexForToken(token, config));
  1976. if (parsedInput) {
  1977. skipped = string.substr(0, string.indexOf(parsedInput));
  1978. if (skipped.length > 0) {
  1979. getParsingFlags(config).unusedInput.push(skipped);
  1980. }
  1981. string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
  1982. totalParsedInputLength += parsedInput.length;
  1983. }
  1984. // don't parse if it's not a known token
  1985. if (formatTokenFunctions[token]) {
  1986. if (parsedInput) {
  1987. getParsingFlags(config).empty = false;
  1988. }
  1989. else {
  1990. getParsingFlags(config).unusedTokens.push(token);
  1991. }
  1992. addTimeToArrayFromToken(token, parsedInput, config);
  1993. }
  1994. else if (config._strict && !parsedInput) {
  1995. getParsingFlags(config).unusedTokens.push(token);
  1996. }
  1997. }
  1998. // add remaining unparsed input length to the string
  1999. getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
  2000. if (string.length > 0) {
  2001. getParsingFlags(config).unusedInput.push(string);
  2002. }
  2003. // clear _12h flag if hour is <= 12
  2004. if (config._a[HOUR] <= 12 &&
  2005. getParsingFlags(config).bigHour === true &&
  2006. config._a[HOUR] > 0) {
  2007. getParsingFlags(config).bigHour = undefined;
  2008. }
  2009. getParsingFlags(config).parsedDateParts = config._a.slice(0);
  2010. getParsingFlags(config).meridiem = config._meridiem;
  2011. // handle meridiem
  2012. config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
  2013. configFromArray(config);
  2014. checkOverflow(config);
  2015. }
  2016. function meridiemFixWrap (locale, hour, meridiem) {
  2017. var isPm;
  2018. if (meridiem == null) {
  2019. // nothing to do
  2020. return hour;
  2021. }
  2022. if (locale.meridiemHour != null) {
  2023. return locale.meridiemHour(hour, meridiem);
  2024. } else if (locale.isPM != null) {
  2025. // Fallback
  2026. isPm = locale.isPM(meridiem);
  2027. if (isPm && hour < 12) {
  2028. hour += 12;
  2029. }
  2030. if (!isPm && hour === 12) {
  2031. hour = 0;
  2032. }
  2033. return hour;
  2034. } else {
  2035. // this is not supposed to happen
  2036. return hour;
  2037. }
  2038. }
  2039. // date from string and array of format strings
  2040. function configFromStringAndArray(config) {
  2041. var tempConfig,
  2042. bestMoment,
  2043. scoreToBeat,
  2044. i,
  2045. currentScore;
  2046. if (config._f.length === 0) {
  2047. getParsingFlags(config).invalidFormat = true;
  2048. config._d = new Date(NaN);
  2049. return;
  2050. }
  2051. for (i = 0; i < config._f.length; i++) {
  2052. currentScore = 0;
  2053. tempConfig = copyConfig({}, config);
  2054. if (config._useUTC != null) {
  2055. tempConfig._useUTC = config._useUTC;
  2056. }
  2057. tempConfig._f = config._f[i];
  2058. configFromStringAndFormat(tempConfig);
  2059. if (!isValid(tempConfig)) {
  2060. continue;
  2061. }
  2062. // if there is any input that was not parsed add a penalty for that format
  2063. currentScore += getParsingFlags(tempConfig).charsLeftOver;
  2064. //or tokens
  2065. currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
  2066. getParsingFlags(tempConfig).score = currentScore;
  2067. if (scoreToBeat == null || currentScore < scoreToBeat) {
  2068. scoreToBeat = currentScore;
  2069. bestMoment = tempConfig;
  2070. }
  2071. }
  2072. extend(config, bestMoment || tempConfig);
  2073. }
  2074. function configFromObject(config) {
  2075. if (config._d) {
  2076. return;
  2077. }
  2078. var i = normalizeObjectUnits(config._i);
  2079. config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {
  2080. return obj && parseInt(obj, 10);
  2081. });
  2082. configFromArray(config);
  2083. }
  2084. function createFromConfig (config) {
  2085. var res = new Moment(checkOverflow(prepareConfig(config)));
  2086. if (res._nextDay) {
  2087. // Adding is smart enough around DST
  2088. res.add(1, 'd');
  2089. res._nextDay = undefined;
  2090. }
  2091. return res;
  2092. }
  2093. function prepareConfig (config) {
  2094. var input = config._i,
  2095. format = config._f;
  2096. config._locale = config._locale || getLocale(config._l);
  2097. if (input === null || (format === undefined && input === '')) {
  2098. return createInvalid({nullInput: true});
  2099. }
  2100. if (typeof input === 'string') {
  2101. config._i = input = config._locale.preparse(input);
  2102. }
  2103. if (isMoment(input)) {
  2104. return new Moment(checkOverflow(input));
  2105. } else if (isDate(input)) {
  2106. config._d = input;
  2107. } else if (isArray(format)) {
  2108. configFromStringAndArray(config);
  2109. } else if (format) {
  2110. configFromStringAndFormat(config);
  2111. } else {
  2112. configFromInput(config);
  2113. }
  2114. if (!isValid(config)) {
  2115. config._d = null;
  2116. }
  2117. return config;
  2118. }
  2119. function configFromInput(config) {
  2120. var input = config._i;
  2121. if (input === undefined) {
  2122. config._d = new Date(hooks.now());
  2123. } else if (isDate(input)) {
  2124. config._d = new Date(input.valueOf());
  2125. } else if (typeof input === 'string') {
  2126. configFromString(config);
  2127. } else if (isArray(input)) {
  2128. config._a = map(input.slice(0), function (obj) {
  2129. return parseInt(obj, 10);
  2130. });
  2131. configFromArray(config);
  2132. } else if (typeof(input) === 'object') {
  2133. configFromObject(config);
  2134. } else if (isNumber(input)) {
  2135. // from milliseconds
  2136. config._d = new Date(input);
  2137. } else {
  2138. hooks.createFromInputFallback(config);
  2139. }
  2140. }
  2141. function createLocalOrUTC (input, format, locale, strict, isUTC) {
  2142. var c = {};
  2143. if (locale === true || locale === false) {
  2144. strict = locale;
  2145. locale = undefined;
  2146. }
  2147. if ((isObject(input) && isObjectEmpty(input)) ||
  2148. (isArray(input) && input.length === 0)) {
  2149. input = undefined;
  2150. }
  2151. // object construction must be done this way.
  2152. // https://github.com/moment/moment/issues/1423
  2153. c._isAMomentObject = true;
  2154. c._useUTC = c._isUTC = isUTC;
  2155. c._l = locale;
  2156. c._i = input;
  2157. c._f = format;
  2158. c._strict = strict;
  2159. return createFromConfig(c);
  2160. }
  2161. function createLocal (input, format, locale, strict) {
  2162. return createLocalOrUTC(input, format, locale, strict, false);
  2163. }
  2164. var prototypeMin = deprecate(
  2165. 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
  2166. function () {
  2167. var other = createLocal.apply(null, arguments);
  2168. if (this.isValid() && other.isValid()) {
  2169. return other < this ? this : other;
  2170. } else {
  2171. return createInvalid();
  2172. }
  2173. }
  2174. );
  2175. var prototypeMax = deprecate(
  2176. 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
  2177. function () {
  2178. var other = createLocal.apply(null, arguments);
  2179. if (this.isValid() && other.isValid()) {
  2180. return other > this ? this : other;
  2181. } else {
  2182. return createInvalid();
  2183. }
  2184. }
  2185. );
  2186. // Pick a moment m from moments so that m[fn](other) is true for all
  2187. // other. This relies on the function fn to be transitive.
  2188. //
  2189. // moments should either be an array of moment objects or an array, whose
  2190. // first element is an array of moment objects.
  2191. function pickBy(fn, moments) {
  2192. var res, i;
  2193. if (moments.length === 1 && isArray(moments[0])) {
  2194. moments = moments[0];
  2195. }
  2196. if (!moments.length) {
  2197. return createLocal();
  2198. }
  2199. res = moments[0];
  2200. for (i = 1; i < moments.length; ++i) {
  2201. if (!moments[i].isValid() || moments[i][fn](res)) {
  2202. res = moments[i];
  2203. }
  2204. }
  2205. return res;
  2206. }
  2207. // TODO: Use [].sort instead?
  2208. function min () {
  2209. var args = [].slice.call(arguments, 0);
  2210. return pickBy('isBefore', args);
  2211. }
  2212. function max () {
  2213. var args = [].slice.call(arguments, 0);
  2214. return pickBy('isAfter', args);
  2215. }
  2216. var now = function () {
  2217. return Date.now ? Date.now() : +(new Date());
  2218. };
  2219. function Duration (duration) {
  2220. var normalizedInput = normalizeObjectUnits(duration),
  2221. years = normalizedInput.year || 0,
  2222. quarters = normalizedInput.quarter || 0,
  2223. months = normalizedInput.month || 0,
  2224. weeks = normalizedInput.week || 0,
  2225. days = normalizedInput.day || 0,
  2226. hours = normalizedInput.hour || 0,
  2227. minutes = normalizedInput.minute || 0,
  2228. seconds = normalizedInput.second || 0,
  2229. milliseconds = normalizedInput.millisecond || 0;
  2230. // representation for dateAddRemove
  2231. this._milliseconds = +milliseconds +
  2232. seconds * 1e3 + // 1000
  2233. minutes * 6e4 + // 1000 * 60
  2234. hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
  2235. // Because of dateAddRemove treats 24 hours as different from a
  2236. // day when working around DST, we need to store them separately
  2237. this._days = +days +
  2238. weeks * 7;
  2239. // It is impossible translate months into days without knowing
  2240. // which months you are are talking about, so we have to store
  2241. // it separately.
  2242. this._months = +months +
  2243. quarters * 3 +
  2244. years * 12;
  2245. this._data = {};
  2246. this._locale = getLocale();
  2247. this._bubble();
  2248. }
  2249. function isDuration (obj) {
  2250. return obj instanceof Duration;
  2251. }
  2252. function absRound (number) {
  2253. if (number < 0) {
  2254. return Math.round(-1 * number) * -1;
  2255. } else {
  2256. return Math.round(number);
  2257. }
  2258. }
  2259. // FORMATTING
  2260. function offset (token, separator) {
  2261. addFormatToken(token, 0, 0, function () {
  2262. var offset = this.utcOffset();
  2263. var sign = '+';
  2264. if (offset < 0) {
  2265. offset = -offset;
  2266. sign = '-';
  2267. }
  2268. return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);
  2269. });
  2270. }
  2271. offset('Z', ':');
  2272. offset('ZZ', '');
  2273. // PARSING
  2274. addRegexToken('Z', matchShortOffset);
  2275. addRegexToken('ZZ', matchShortOffset);
  2276. addParseToken(['Z', 'ZZ'], function (input, array, config) {
  2277. config._useUTC = true;
  2278. config._tzm = offsetFromString(matchShortOffset, input);
  2279. });
  2280. // HELPERS
  2281. // timezone chunker
  2282. // '+10:00' > ['10', '00']
  2283. // '-1530' > ['-15', '30']
  2284. var chunkOffset = /([\+\-]|\d\d)/gi;
  2285. function offsetFromString(matcher, string) {
  2286. var matches = (string || '').match(matcher);
  2287. if (matches === null) {
  2288. return null;
  2289. }
  2290. var chunk = matches[matches.length - 1] || [];
  2291. var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
  2292. var minutes = +(parts[1] * 60) + toInt(parts[2]);
  2293. return minutes === 0 ?
  2294. 0 :
  2295. parts[0] === '+' ? minutes : -minutes;
  2296. }
  2297. // Return a moment from input, that is local/utc/zone equivalent to model.
  2298. function cloneWithOffset(input, model) {
  2299. var res, diff;
  2300. if (model._isUTC) {
  2301. res = model.clone();
  2302. diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();
  2303. // Use low-level api, because this fn is low-level api.
  2304. res._d.setTime(res._d.valueOf() + diff);
  2305. hooks.updateOffset(res, false);
  2306. return res;
  2307. } else {
  2308. return createLocal(input).local();
  2309. }
  2310. }
  2311. function getDateOffset (m) {
  2312. // On Firefox.24 Date#getTimezoneOffset returns a floating point.
  2313. // https://github.com/moment/moment/pull/1871
  2314. return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
  2315. }
  2316. // HOOKS
  2317. // This function will be called whenever a moment is mutated.
  2318. // It is intended to keep the offset in sync with the timezone.
  2319. hooks.updateOffset = function () {};
  2320. // MOMENTS
  2321. // keepLocalTime = true means only change the timezone, without
  2322. // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
  2323. // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
  2324. // +0200, so we adjust the time as needed, to be valid.
  2325. //
  2326. // Keeping the time actually adds/subtracts (one hour)
  2327. // from the actual represented time. That is why we call updateOffset
  2328. // a second time. In case it wants us to change the offset again
  2329. // _changeInProgress == true case, then we have to adjust, because
  2330. // there is no such time in the given timezone.
  2331. function getSetOffset (input, keepLocalTime) {
  2332. var offset = this._offset || 0,
  2333. localAdjust;
  2334. if (!this.isValid()) {
  2335. return input != null ? this : NaN;
  2336. }
  2337. if (input != null) {
  2338. if (typeof input === 'string') {
  2339. input = offsetFromString(matchShortOffset, input);
  2340. if (input === null) {
  2341. return this;
  2342. }
  2343. } else if (Math.abs(input) < 16) {
  2344. input = input * 60;
  2345. }
  2346. if (!this._isUTC && keepLocalTime) {
  2347. localAdjust = getDateOffset(this);
  2348. }
  2349. this._offset = input;
  2350. this._isUTC = true;
  2351. if (localAdjust != null) {
  2352. this.add(localAdjust, 'm');
  2353. }
  2354. if (offset !== input) {
  2355. if (!keepLocalTime || this._changeInProgress) {
  2356. addSubtract(this, createDuration(input - offset, 'm'), 1, false);
  2357. } else if (!this._changeInProgress) {
  2358. this._changeInProgress = true;
  2359. hooks.updateOffset(this, true);
  2360. this._changeInProgress = null;
  2361. }
  2362. }
  2363. return this;
  2364. } else {
  2365. return this._isUTC ? offset : getDateOffset(this);
  2366. }
  2367. }
  2368. function getSetZone (input, keepLocalTime) {
  2369. if (input != null) {
  2370. if (typeof input !== 'string') {
  2371. input = -input;
  2372. }
  2373. this.utcOffset(input, keepLocalTime);
  2374. return this;
  2375. } else {
  2376. return -this.utcOffset();
  2377. }
  2378. }
  2379. function setOffsetToUTC (keepLocalTime) {
  2380. return this.utcOffset(0, keepLocalTime);
  2381. }
  2382. function setOffsetToLocal (keepLocalTime) {
  2383. if (this._isUTC) {
  2384. this.utcOffset(0, keepLocalTime);
  2385. this._isUTC = false;
  2386. if (keepLocalTime) {
  2387. this.subtract(getDateOffset(this), 'm');
  2388. }
  2389. }
  2390. return this;
  2391. }
  2392. function setOffsetToParsedOffset () {
  2393. if (this._tzm != null) {
  2394. this.utcOffset(this._tzm);
  2395. } else if (typeof this._i === 'string') {
  2396. var tZone = offsetFromString(matchOffset, this._i);
  2397. if (tZone != null) {
  2398. this.utcOffset(tZone);
  2399. }
  2400. else {
  2401. this.utcOffset(0, true);
  2402. }
  2403. }
  2404. return this;
  2405. }
  2406. function hasAlignedHourOffset (input) {
  2407. if (!this.isValid()) {
  2408. return false;
  2409. }
  2410. input = input ? createLocal(input).utcOffset() : 0;
  2411. return (this.utcOffset() - input) % 60 === 0;
  2412. }
  2413. function isDaylightSavingTime () {
  2414. return (
  2415. this.utcOffset() > this.clone().month(0).utcOffset() ||
  2416. this.utcOffset() > this.clone().month(5).utcOffset()
  2417. );
  2418. }
  2419. function isDaylightSavingTimeShifted () {
  2420. if (!isUndefined(this._isDSTShifted)) {
  2421. return this._isDSTShifted;
  2422. }
  2423. var c = {};
  2424. copyConfig(c, this);
  2425. c = prepareConfig(c);
  2426. if (c._a) {
  2427. var other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
  2428. this._isDSTShifted = this.isValid() &&
  2429. compareArrays(c._a, other.toArray()) > 0;
  2430. } else {
  2431. this._isDSTShifted = false;
  2432. }
  2433. return this._isDSTShifted;
  2434. }
  2435. function isLocal () {
  2436. return this.isValid() ? !this._isUTC : false;
  2437. }
  2438. function isUtcOffset () {
  2439. return this.isValid() ? this._isUTC : false;
  2440. }
  2441. function isUtc () {
  2442. return this.isValid() ? this._isUTC && this._offset === 0 : false;
  2443. }
  2444. // ASP.NET json date format regex
  2445. var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/;
  2446. // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
  2447. // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
  2448. // and further modified to allow for strings containing both week and day
  2449. var isoRegex = /^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;
  2450. function createDuration (input, key) {
  2451. var duration = input,
  2452. // matching against regexp is expensive, do it on demand
  2453. match = null,
  2454. sign,
  2455. ret,
  2456. diffRes;
  2457. if (isDuration(input)) {
  2458. duration = {
  2459. ms : input._milliseconds,
  2460. d : input._days,
  2461. M : input._months
  2462. };
  2463. } else if (isNumber(input)) {
  2464. duration = {};
  2465. if (key) {
  2466. duration[key] = input;
  2467. } else {
  2468. duration.milliseconds = input;
  2469. }
  2470. } else if (!!(match = aspNetRegex.exec(input))) {
  2471. sign = (match[1] === '-') ? -1 : 1;
  2472. duration = {
  2473. y : 0,
  2474. d : toInt(match[DATE]) * sign,
  2475. h : toInt(match[HOUR]) * sign,
  2476. m : toInt(match[MINUTE]) * sign,
  2477. s : toInt(match[SECOND]) * sign,
  2478. ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match
  2479. };
  2480. } else if (!!(match = isoRegex.exec(input))) {
  2481. sign = (match[1] === '-') ? -1 : 1;
  2482. duration = {
  2483. y : parseIso(match[2], sign),
  2484. M : parseIso(match[3], sign),
  2485. w : parseIso(match[4], sign),
  2486. d : parseIso(match[5], sign),
  2487. h : parseIso(match[6], sign),
  2488. m : parseIso(match[7], sign),
  2489. s : parseIso(match[8], sign)
  2490. };
  2491. } else if (duration == null) {// checks for null or undefined
  2492. duration = {};
  2493. } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {
  2494. diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));
  2495. duration = {};
  2496. duration.ms = diffRes.milliseconds;
  2497. duration.M = diffRes.months;
  2498. }
  2499. ret = new Duration(duration);
  2500. if (isDuration(input) && hasOwnProp(input, '_locale')) {
  2501. ret._locale = input._locale;
  2502. }
  2503. return ret;
  2504. }
  2505. createDuration.fn = Duration.prototype;
  2506. function parseIso (inp, sign) {
  2507. // We'd normally use ~~inp for this, but unfortunately it also
  2508. // converts floats to ints.
  2509. // inp may be undefined, so careful calling replace on it.
  2510. var res = inp && parseFloat(inp.replace(',', '.'));
  2511. // apply sign while we're at it
  2512. return (isNaN(res) ? 0 : res) * sign;
  2513. }
  2514. function positiveMomentsDifference(base, other) {
  2515. var res = {milliseconds: 0, months: 0};
  2516. res.months = other.month() - base.month() +
  2517. (other.year() - base.year()) * 12;
  2518. if (base.clone().add(res.months, 'M').isAfter(other)) {
  2519. --res.months;
  2520. }
  2521. res.milliseconds = +other - +(base.clone().add(res.months, 'M'));
  2522. return res;
  2523. }
  2524. function momentsDifference(base, other) {
  2525. var res;
  2526. if (!(base.isValid() && other.isValid())) {
  2527. return {milliseconds: 0, months: 0};
  2528. }
  2529. other = cloneWithOffset(other, base);
  2530. if (base.isBefore(other)) {
  2531. res = positiveMomentsDifference(base, other);
  2532. } else {
  2533. res = positiveMomentsDifference(other, base);
  2534. res.milliseconds = -res.milliseconds;
  2535. res.months = -res.months;
  2536. }
  2537. return res;
  2538. }
  2539. // TODO: remove 'name' arg after deprecation is removed
  2540. function createAdder(direction, name) {
  2541. return function (val, period) {
  2542. var dur, tmp;
  2543. //invert the arguments, but complain about it
  2544. if (period !== null && !isNaN(+period)) {
  2545. deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +
  2546. 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');
  2547. tmp = val; val = period; period = tmp;
  2548. }
  2549. val = typeof val === 'string' ? +val : val;
  2550. dur = createDuration(val, period);
  2551. addSubtract(this, dur, direction);
  2552. return this;
  2553. };
  2554. }
  2555. function addSubtract (mom, duration, isAdding, updateOffset) {
  2556. var milliseconds = duration._milliseconds,
  2557. days = absRound(duration._days),
  2558. months = absRound(duration._months);
  2559. if (!mom.isValid()) {
  2560. // No op
  2561. return;
  2562. }
  2563. updateOffset = updateOffset == null ? true : updateOffset;
  2564. if (milliseconds) {
  2565. mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
  2566. }
  2567. if (days) {
  2568. set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
  2569. }
  2570. if (months) {
  2571. setMonth(mom, get(mom, 'Month') + months * isAdding);
  2572. }
  2573. if (updateOffset) {
  2574. hooks.updateOffset(mom, days || months);
  2575. }
  2576. }
  2577. var add = createAdder(1, 'add');
  2578. var subtract = createAdder(-1, 'subtract');
  2579. function getCalendarFormat(myMoment, now) {
  2580. var diff = myMoment.diff(now, 'days', true);
  2581. return diff < -6 ? 'sameElse' :
  2582. diff < -1 ? 'lastWeek' :
  2583. diff < 0 ? 'lastDay' :
  2584. diff < 1 ? 'sameDay' :
  2585. diff < 2 ? 'nextDay' :
  2586. diff < 7 ? 'nextWeek' : 'sameElse';
  2587. }
  2588. function calendar$1 (time, formats) {
  2589. // We want to compare the start of today, vs this.
  2590. // Getting start-of-today depends on whether we're local/utc/offset or not.
  2591. var now = time || createLocal(),
  2592. sod = cloneWithOffset(now, this).startOf('day'),
  2593. format = hooks.calendarFormat(this, sod) || 'sameElse';
  2594. var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);
  2595. return this.format(output || this.localeData().calendar(format, this, createLocal(now)));
  2596. }
  2597. function clone () {
  2598. return new Moment(this);
  2599. }
  2600. function isAfter (input, units) {
  2601. var localInput = isMoment(input) ? input : createLocal(input);
  2602. if (!(this.isValid() && localInput.isValid())) {
  2603. return false;
  2604. }
  2605. units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
  2606. if (units === 'millisecond') {
  2607. return this.valueOf() > localInput.valueOf();
  2608. } else {
  2609. return localInput.valueOf() < this.clone().startOf(units).valueOf();
  2610. }
  2611. }
  2612. function isBefore (input, units) {
  2613. var localInput = isMoment(input) ? input : createLocal(input);
  2614. if (!(this.isValid() && localInput.isValid())) {
  2615. return false;
  2616. }
  2617. units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
  2618. if (units === 'millisecond') {
  2619. return this.valueOf() < localInput.valueOf();
  2620. } else {
  2621. return this.clone().endOf(units).valueOf() < localInput.valueOf();
  2622. }
  2623. }
  2624. function isBetween (from, to, units, inclusivity) {
  2625. inclusivity = inclusivity || '()';
  2626. return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) &&
  2627. (inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units));
  2628. }
  2629. function isSame (input, units) {
  2630. var localInput = isMoment(input) ? input : createLocal(input),
  2631. inputMs;
  2632. if (!(this.isValid() && localInput.isValid())) {
  2633. return false;
  2634. }
  2635. units = normalizeUnits(units || 'millisecond');
  2636. if (units === 'millisecond') {
  2637. return this.valueOf() === localInput.valueOf();
  2638. } else {
  2639. inputMs = localInput.valueOf();
  2640. return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
  2641. }
  2642. }
  2643. function isSameOrAfter (input, units) {
  2644. return this.isSame(input, units) || this.isAfter(input,units);
  2645. }
  2646. function isSameOrBefore (input, units) {
  2647. return this.isSame(input, units) || this.isBefore(input,units);
  2648. }
  2649. function diff (input, units, asFloat) {
  2650. var that,
  2651. zoneDelta,
  2652. delta, output;
  2653. if (!this.isValid()) {
  2654. return NaN;
  2655. }
  2656. that = cloneWithOffset(input, this);
  2657. if (!that.isValid()) {
  2658. return NaN;
  2659. }
  2660. zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
  2661. units = normalizeUnits(units);
  2662. if (units === 'year' || units === 'month' || units === 'quarter') {
  2663. output = monthDiff(this, that);
  2664. if (units === 'quarter') {
  2665. output = output / 3;
  2666. } else if (units === 'year') {
  2667. output = output / 12;
  2668. }
  2669. } else {
  2670. delta = this - that;
  2671. output = units === 'second' ? delta / 1e3 : // 1000
  2672. units === 'minute' ? delta / 6e4 : // 1000 * 60
  2673. units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60
  2674. units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst
  2675. units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst
  2676. delta;
  2677. }
  2678. return asFloat ? output : absFloor(output);
  2679. }
  2680. function monthDiff (a, b) {
  2681. // difference in months
  2682. var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
  2683. // b is in (anchor - 1 month, anchor + 1 month)
  2684. anchor = a.clone().add(wholeMonthDiff, 'months'),
  2685. anchor2, adjust;
  2686. if (b - anchor < 0) {
  2687. anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
  2688. // linear across the month
  2689. adjust = (b - anchor) / (anchor - anchor2);
  2690. } else {
  2691. anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
  2692. // linear across the month
  2693. adjust = (b - anchor) / (anchor2 - anchor);
  2694. }
  2695. //check for negative zero, return zero if negative zero
  2696. return -(wholeMonthDiff + adjust) || 0;
  2697. }
  2698. hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
  2699. hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
  2700. function toString () {
  2701. return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
  2702. }
  2703. function toISOString () {
  2704. var m = this.clone().utc();
  2705. if (0 < m.year() && m.year() <= 9999) {
  2706. if (isFunction(Date.prototype.toISOString)) {
  2707. // native implementation is ~50x faster, use it when we can
  2708. return this.toDate().toISOString();
  2709. } else {
  2710. return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
  2711. }
  2712. } else {
  2713. return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
  2714. }
  2715. }
  2716. /**
  2717. * Return a human readable representation of a moment that can
  2718. * also be evaluated to get a new moment which is the same
  2719. *
  2720. * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
  2721. */
  2722. function inspect () {
  2723. if (!this.isValid()) {
  2724. return 'moment.invalid(/* ' + this._i + ' */)';
  2725. }
  2726. var func = 'moment';
  2727. var zone = '';
  2728. if (!this.isLocal()) {
  2729. func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
  2730. zone = 'Z';
  2731. }
  2732. var prefix = '[' + func + '("]';
  2733. var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';
  2734. var datetime = '-MM-DD[T]HH:mm:ss.SSS';
  2735. var suffix = zone + '[")]';
  2736. return this.format(prefix + year + datetime + suffix);
  2737. }
  2738. function format (inputString) {
  2739. if (!inputString) {
  2740. inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;
  2741. }
  2742. var output = formatMoment(this, inputString);
  2743. return this.localeData().postformat(output);
  2744. }
  2745. function from (time, withoutSuffix) {
  2746. if (this.isValid() &&
  2747. ((isMoment(time) && time.isValid()) ||
  2748. createLocal(time).isValid())) {
  2749. return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);
  2750. } else {
  2751. return this.localeData().invalidDate();
  2752. }
  2753. }
  2754. function fromNow (withoutSuffix) {
  2755. return this.from(createLocal(), withoutSuffix);
  2756. }
  2757. function to (time, withoutSuffix) {
  2758. if (this.isValid() &&
  2759. ((isMoment(time) && time.isValid()) ||
  2760. createLocal(time).isValid())) {
  2761. return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);
  2762. } else {
  2763. return this.localeData().invalidDate();
  2764. }
  2765. }
  2766. function toNow (withoutSuffix) {
  2767. return this.to(createLocal(), withoutSuffix);
  2768. }
  2769. // If passed a locale key, it will set the locale for this
  2770. // instance. Otherwise, it will return the locale configuration
  2771. // variables for this instance.
  2772. function locale (key) {
  2773. var newLocaleData;
  2774. if (key === undefined) {
  2775. return this._locale._abbr;
  2776. } else {
  2777. newLocaleData = getLocale(key);
  2778. if (newLocaleData != null) {
  2779. this._locale = newLocaleData;
  2780. }
  2781. return this;
  2782. }
  2783. }
  2784. var lang = deprecate(
  2785. 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
  2786. function (key) {
  2787. if (key === undefined) {
  2788. return this.localeData();
  2789. } else {
  2790. return this.locale(key);
  2791. }
  2792. }
  2793. );
  2794. function localeData () {
  2795. return this._locale;
  2796. }
  2797. function startOf (units) {
  2798. units = normalizeUnits(units);
  2799. // the following switch intentionally omits break keywords
  2800. // to utilize falling through the cases.
  2801. switch (units) {
  2802. case 'year':
  2803. this.month(0);
  2804. /* falls through */
  2805. case 'quarter':
  2806. case 'month':
  2807. this.date(1);
  2808. /* falls through */
  2809. case 'week':
  2810. case 'isoWeek':
  2811. case 'day':
  2812. case 'date':
  2813. this.hours(0);
  2814. /* falls through */
  2815. case 'hour':
  2816. this.minutes(0);
  2817. /* falls through */
  2818. case 'minute':
  2819. this.seconds(0);
  2820. /* falls through */
  2821. case 'second':
  2822. this.milliseconds(0);
  2823. }
  2824. // weeks are a special case
  2825. if (units === 'week') {
  2826. this.weekday(0);
  2827. }
  2828. if (units === 'isoWeek') {
  2829. this.isoWeekday(1);
  2830. }
  2831. // quarters are also special
  2832. if (units === 'quarter') {
  2833. this.month(Math.floor(this.month() / 3) * 3);
  2834. }
  2835. return this;
  2836. }
  2837. function endOf (units) {
  2838. units = normalizeUnits(units);
  2839. if (units === undefined || units === 'millisecond') {
  2840. return this;
  2841. }
  2842. // 'date' is an alias for 'day', so it should be considered as such.
  2843. if (units === 'date') {
  2844. units = 'day';
  2845. }
  2846. return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');
  2847. }
  2848. function valueOf () {
  2849. return this._d.valueOf() - ((this._offset || 0) * 60000);
  2850. }
  2851. function unix () {
  2852. return Math.floor(this.valueOf() / 1000);
  2853. }
  2854. function toDate () {
  2855. return new Date(this.valueOf());
  2856. }
  2857. function toArray () {
  2858. var m = this;
  2859. return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
  2860. }
  2861. function toObject () {
  2862. var m = this;
  2863. return {
  2864. years: m.year(),
  2865. months: m.month(),
  2866. date: m.date(),
  2867. hours: m.hours(),
  2868. minutes: m.minutes(),
  2869. seconds: m.seconds(),
  2870. milliseconds: m.milliseconds()
  2871. };
  2872. }
  2873. function toJSON () {
  2874. // new Date(NaN).toJSON() === null
  2875. return this.isValid() ? this.toISOString() : null;
  2876. }
  2877. function isValid$1 () {
  2878. return isValid(this);
  2879. }
  2880. function parsingFlags () {
  2881. return extend({}, getParsingFlags(this));
  2882. }
  2883. function invalidAt () {
  2884. return getParsingFlags(this).overflow;
  2885. }
  2886. function creationData() {
  2887. return {
  2888. input: this._i,
  2889. format: this._f,
  2890. locale: this._locale,
  2891. isUTC: this._isUTC,
  2892. strict: this._strict
  2893. };
  2894. }
  2895. // FORMATTING
  2896. addFormatToken(0, ['gg', 2], 0, function () {
  2897. return this.weekYear() % 100;
  2898. });
  2899. addFormatToken(0, ['GG', 2], 0, function () {
  2900. return this.isoWeekYear() % 100;
  2901. });
  2902. function addWeekYearFormatToken (token, getter) {
  2903. addFormatToken(0, [token, token.length], 0, getter);
  2904. }
  2905. addWeekYearFormatToken('gggg', 'weekYear');
  2906. addWeekYearFormatToken('ggggg', 'weekYear');
  2907. addWeekYearFormatToken('GGGG', 'isoWeekYear');
  2908. addWeekYearFormatToken('GGGGG', 'isoWeekYear');
  2909. // ALIASES
  2910. addUnitAlias('weekYear', 'gg');
  2911. addUnitAlias('isoWeekYear', 'GG');
  2912. // PRIORITY
  2913. addUnitPriority('weekYear', 1);
  2914. addUnitPriority('isoWeekYear', 1);
  2915. // PARSING
  2916. addRegexToken('G', matchSigned);
  2917. addRegexToken('g', matchSigned);
  2918. addRegexToken('GG', match1to2, match2);
  2919. addRegexToken('gg', match1to2, match2);
  2920. addRegexToken('GGGG', match1to4, match4);
  2921. addRegexToken('gggg', match1to4, match4);
  2922. addRegexToken('GGGGG', match1to6, match6);
  2923. addRegexToken('ggggg', match1to6, match6);
  2924. addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
  2925. week[token.substr(0, 2)] = toInt(input);
  2926. });
  2927. addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
  2928. week[token] = hooks.parseTwoDigitYear(input);
  2929. });
  2930. // MOMENTS
  2931. function getSetWeekYear (input) {
  2932. return getSetWeekYearHelper.call(this,
  2933. input,
  2934. this.week(),
  2935. this.weekday(),
  2936. this.localeData()._week.dow,
  2937. this.localeData()._week.doy);
  2938. }
  2939. function getSetISOWeekYear (input) {
  2940. return getSetWeekYearHelper.call(this,
  2941. input, this.isoWeek(), this.isoWeekday(), 1, 4);
  2942. }
  2943. function getISOWeeksInYear () {
  2944. return weeksInYear(this.year(), 1, 4);
  2945. }
  2946. function getWeeksInYear () {
  2947. var weekInfo = this.localeData()._week;
  2948. return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
  2949. }
  2950. function getSetWeekYearHelper(input, week, weekday, dow, doy) {
  2951. var weeksTarget;
  2952. if (input == null) {
  2953. return weekOfYear(this, dow, doy).year;
  2954. } else {
  2955. weeksTarget = weeksInYear(input, dow, doy);
  2956. if (week > weeksTarget) {
  2957. week = weeksTarget;
  2958. }
  2959. return setWeekAll.call(this, input, week, weekday, dow, doy);
  2960. }
  2961. }
  2962. function setWeekAll(weekYear, week, weekday, dow, doy) {
  2963. var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
  2964. date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
  2965. this.year(date.getUTCFullYear());
  2966. this.month(date.getUTCMonth());
  2967. this.date(date.getUTCDate());
  2968. return this;
  2969. }
  2970. // FORMATTING
  2971. addFormatToken('Q', 0, 'Qo', 'quarter');
  2972. // ALIASES
  2973. addUnitAlias('quarter', 'Q');
  2974. // PRIORITY
  2975. addUnitPriority('quarter', 7);
  2976. // PARSING
  2977. addRegexToken('Q', match1);
  2978. addParseToken('Q', function (input, array) {
  2979. array[MONTH] = (toInt(input) - 1) * 3;
  2980. });
  2981. // MOMENTS
  2982. function getSetQuarter (input) {
  2983. return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
  2984. }
  2985. // FORMATTING
  2986. addFormatToken('D', ['DD', 2], 'Do', 'date');
  2987. // ALIASES
  2988. addUnitAlias('date', 'D');
  2989. // PRIOROITY
  2990. addUnitPriority('date', 9);
  2991. // PARSING
  2992. addRegexToken('D', match1to2);
  2993. addRegexToken('DD', match1to2, match2);
  2994. addRegexToken('Do', function (isStrict, locale) {
  2995. return isStrict ? locale._ordinalParse : locale._ordinalParseLenient;
  2996. });
  2997. addParseToken(['D', 'DD'], DATE);
  2998. addParseToken('Do', function (input, array) {
  2999. array[DATE] = toInt(input.match(match1to2)[0], 10);
  3000. });
  3001. // MOMENTS
  3002. var getSetDayOfMonth = makeGetSet('Date', true);
  3003. // FORMATTING
  3004. addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
  3005. // ALIASES
  3006. addUnitAlias('dayOfYear', 'DDD');
  3007. // PRIORITY
  3008. addUnitPriority('dayOfYear', 4);
  3009. // PARSING
  3010. addRegexToken('DDD', match1to3);
  3011. addRegexToken('DDDD', match3);
  3012. addParseToken(['DDD', 'DDDD'], function (input, array, config) {
  3013. config._dayOfYear = toInt(input);
  3014. });
  3015. // HELPERS
  3016. // MOMENTS
  3017. function getSetDayOfYear (input) {
  3018. var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
  3019. return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');
  3020. }
  3021. // FORMATTING
  3022. addFormatToken('m', ['mm', 2], 0, 'minute');
  3023. // ALIASES
  3024. addUnitAlias('minute', 'm');
  3025. // PRIORITY
  3026. addUnitPriority('minute', 14);
  3027. // PARSING
  3028. addRegexToken('m', match1to2);
  3029. addRegexToken('mm', match1to2, match2);
  3030. addParseToken(['m', 'mm'], MINUTE);
  3031. // MOMENTS
  3032. var getSetMinute = makeGetSet('Minutes', false);
  3033. // FORMATTING
  3034. addFormatToken('s', ['ss', 2], 0, 'second');
  3035. // ALIASES
  3036. addUnitAlias('second', 's');
  3037. // PRIORITY
  3038. addUnitPriority('second', 15);
  3039. // PARSING
  3040. addRegexToken('s', match1to2);
  3041. addRegexToken('ss', match1to2, match2);
  3042. addParseToken(['s', 'ss'], SECOND);
  3043. // MOMENTS
  3044. var getSetSecond = makeGetSet('Seconds', false);
  3045. // FORMATTING
  3046. addFormatToken('S', 0, 0, function () {
  3047. return ~~(this.millisecond() / 100);
  3048. });
  3049. addFormatToken(0, ['SS', 2], 0, function () {
  3050. return ~~(this.millisecond() / 10);
  3051. });
  3052. addFormatToken(0, ['SSS', 3], 0, 'millisecond');
  3053. addFormatToken(0, ['SSSS', 4], 0, function () {
  3054. return this.millisecond() * 10;
  3055. });
  3056. addFormatToken(0, ['SSSSS', 5], 0, function () {
  3057. return this.millisecond() * 100;
  3058. });
  3059. addFormatToken(0, ['SSSSSS', 6], 0, function () {
  3060. return this.millisecond() * 1000;
  3061. });
  3062. addFormatToken(0, ['SSSSSSS', 7], 0, function () {
  3063. return this.millisecond() * 10000;
  3064. });
  3065. addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
  3066. return this.millisecond() * 100000;
  3067. });
  3068. addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
  3069. return this.millisecond() * 1000000;
  3070. });
  3071. // ALIASES
  3072. addUnitAlias('millisecond', 'ms');
  3073. // PRIORITY
  3074. addUnitPriority('millisecond', 16);
  3075. // PARSING
  3076. addRegexToken('S', match1to3, match1);
  3077. addRegexToken('SS', match1to3, match2);
  3078. addRegexToken('SSS', match1to3, match3);
  3079. var token;
  3080. for (token = 'SSSS'; token.length <= 9; token += 'S') {
  3081. addRegexToken(token, matchUnsigned);
  3082. }
  3083. function parseMs(input, array) {
  3084. array[MILLISECOND] = toInt(('0.' + input) * 1000);
  3085. }
  3086. for (token = 'S'; token.length <= 9; token += 'S') {
  3087. addParseToken(token, parseMs);
  3088. }
  3089. // MOMENTS
  3090. var getSetMillisecond = makeGetSet('Milliseconds', false);
  3091. // FORMATTING
  3092. addFormatToken('z', 0, 0, 'zoneAbbr');
  3093. addFormatToken('zz', 0, 0, 'zoneName');
  3094. // MOMENTS
  3095. function getZoneAbbr () {
  3096. return this._isUTC ? 'UTC' : '';
  3097. }
  3098. function getZoneName () {
  3099. return this._isUTC ? 'Coordinated Universal Time' : '';
  3100. }
  3101. var proto = Moment.prototype;
  3102. proto.add = add;
  3103. proto.calendar = calendar$1;
  3104. proto.clone = clone;
  3105. proto.diff = diff;
  3106. proto.endOf = endOf;
  3107. proto.format = format;
  3108. proto.from = from;
  3109. proto.fromNow = fromNow;
  3110. proto.to = to;
  3111. proto.toNow = toNow;
  3112. proto.get = stringGet;
  3113. proto.invalidAt = invalidAt;
  3114. proto.isAfter = isAfter;
  3115. proto.isBefore = isBefore;
  3116. proto.isBetween = isBetween;
  3117. proto.isSame = isSame;
  3118. proto.isSameOrAfter = isSameOrAfter;
  3119. proto.isSameOrBefore = isSameOrBefore;
  3120. proto.isValid = isValid$1;
  3121. proto.lang = lang;
  3122. proto.locale = locale;
  3123. proto.localeData = localeData;
  3124. proto.max = prototypeMax;
  3125. proto.min = prototypeMin;
  3126. proto.parsingFlags = parsingFlags;
  3127. proto.set = stringSet;
  3128. proto.startOf = startOf;
  3129. proto.subtract = subtract;
  3130. proto.toArray = toArray;
  3131. proto.toObject = toObject;
  3132. proto.toDate = toDate;
  3133. proto.toISOString = toISOString;
  3134. proto.inspect = inspect;
  3135. proto.toJSON = toJSON;
  3136. proto.toString = toString;
  3137. proto.unix = unix;
  3138. proto.valueOf = valueOf;
  3139. proto.creationData = creationData;
  3140. // Year
  3141. proto.year = getSetYear;
  3142. proto.isLeapYear = getIsLeapYear;
  3143. // Week Year
  3144. proto.weekYear = getSetWeekYear;
  3145. proto.isoWeekYear = getSetISOWeekYear;
  3146. // Quarter
  3147. proto.quarter = proto.quarters = getSetQuarter;
  3148. // Month
  3149. proto.month = getSetMonth;
  3150. proto.daysInMonth = getDaysInMonth;
  3151. // Week
  3152. proto.week = proto.weeks = getSetWeek;
  3153. proto.isoWeek = proto.isoWeeks = getSetISOWeek;
  3154. proto.weeksInYear = getWeeksInYear;
  3155. proto.isoWeeksInYear = getISOWeeksInYear;
  3156. // Day
  3157. proto.date = getSetDayOfMonth;
  3158. proto.day = proto.days = getSetDayOfWeek;
  3159. proto.weekday = getSetLocaleDayOfWeek;
  3160. proto.isoWeekday = getSetISODayOfWeek;
  3161. proto.dayOfYear = getSetDayOfYear;
  3162. // Hour
  3163. proto.hour = proto.hours = getSetHour;
  3164. // Minute
  3165. proto.minute = proto.minutes = getSetMinute;
  3166. // Second
  3167. proto.second = proto.seconds = getSetSecond;
  3168. // Millisecond
  3169. proto.millisecond = proto.milliseconds = getSetMillisecond;
  3170. // Offset
  3171. proto.utcOffset = getSetOffset;
  3172. proto.utc = setOffsetToUTC;
  3173. proto.local = setOffsetToLocal;
  3174. proto.parseZone = setOffsetToParsedOffset;
  3175. proto.hasAlignedHourOffset = hasAlignedHourOffset;
  3176. proto.isDST = isDaylightSavingTime;
  3177. proto.isLocal = isLocal;
  3178. proto.isUtcOffset = isUtcOffset;
  3179. proto.isUtc = isUtc;
  3180. proto.isUTC = isUtc;
  3181. // Timezone
  3182. proto.zoneAbbr = getZoneAbbr;
  3183. proto.zoneName = getZoneName;
  3184. // Deprecations
  3185. proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
  3186. proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
  3187. proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
  3188. proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);
  3189. proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);
  3190. function createUnix (input) {
  3191. return createLocal(input * 1000);
  3192. }
  3193. function createInZone () {
  3194. return createLocal.apply(null, arguments).parseZone();
  3195. }
  3196. function preParsePostFormat (string) {
  3197. return string;
  3198. }
  3199. var proto$1 = Locale.prototype;
  3200. proto$1.calendar = calendar;
  3201. proto$1.longDateFormat = longDateFormat;
  3202. proto$1.invalidDate = invalidDate;
  3203. proto$1.ordinal = ordinal;
  3204. proto$1.preparse = preParsePostFormat;
  3205. proto$1.postformat = preParsePostFormat;
  3206. proto$1.relativeTime = relativeTime;
  3207. proto$1.pastFuture = pastFuture;
  3208. proto$1.set = set;
  3209. // Month
  3210. proto$1.months = localeMonths;
  3211. proto$1.monthsShort = localeMonthsShort;
  3212. proto$1.monthsParse = localeMonthsParse;
  3213. proto$1.monthsRegex = monthsRegex;
  3214. proto$1.monthsShortRegex = monthsShortRegex;
  3215. // Week
  3216. proto$1.week = localeWeek;
  3217. proto$1.firstDayOfYear = localeFirstDayOfYear;
  3218. proto$1.firstDayOfWeek = localeFirstDayOfWeek;
  3219. // Day of Week
  3220. proto$1.weekdays = localeWeekdays;
  3221. proto$1.weekdaysMin = localeWeekdaysMin;
  3222. proto$1.weekdaysShort = localeWeekdaysShort;
  3223. proto$1.weekdaysParse = localeWeekdaysParse;
  3224. proto$1.weekdaysRegex = weekdaysRegex;
  3225. proto$1.weekdaysShortRegex = weekdaysShortRegex;
  3226. proto$1.weekdaysMinRegex = weekdaysMinRegex;
  3227. // Hours
  3228. proto$1.isPM = localeIsPM;
  3229. proto$1.meridiem = localeMeridiem;
  3230. function get$1 (format, index, field, setter) {
  3231. var locale = getLocale();
  3232. var utc = createUTC().set(setter, index);
  3233. return locale[field](utc, format);
  3234. }
  3235. function listMonthsImpl (format, index, field) {
  3236. if (isNumber(format)) {
  3237. index = format;
  3238. format = undefined;
  3239. }
  3240. format = format || '';
  3241. if (index != null) {
  3242. return get$1(format, index, field, 'month');
  3243. }
  3244. var i;
  3245. var out = [];
  3246. for (i = 0; i < 12; i++) {
  3247. out[i] = get$1(format, i, field, 'month');
  3248. }
  3249. return out;
  3250. }
  3251. // ()
  3252. // (5)
  3253. // (fmt, 5)
  3254. // (fmt)
  3255. // (true)
  3256. // (true, 5)
  3257. // (true, fmt, 5)
  3258. // (true, fmt)
  3259. function listWeekdaysImpl (localeSorted, format, index, field) {
  3260. if (typeof localeSorted === 'boolean') {
  3261. if (isNumber(format)) {
  3262. index = format;
  3263. format = undefined;
  3264. }
  3265. format = format || '';
  3266. } else {
  3267. format = localeSorted;
  3268. index = format;
  3269. localeSorted = false;
  3270. if (isNumber(format)) {
  3271. index = format;
  3272. format = undefined;
  3273. }
  3274. format = format || '';
  3275. }
  3276. var locale = getLocale(),
  3277. shift = localeSorted ? locale._week.dow : 0;
  3278. if (index != null) {
  3279. return get$1(format, (index + shift) % 7, field, 'day');
  3280. }
  3281. var i;
  3282. var out = [];
  3283. for (i = 0; i < 7; i++) {
  3284. out[i] = get$1(format, (i + shift) % 7, field, 'day');
  3285. }
  3286. return out;
  3287. }
  3288. function listMonths (format, index) {
  3289. return listMonthsImpl(format, index, 'months');
  3290. }
  3291. function listMonthsShort (format, index) {
  3292. return listMonthsImpl(format, index, 'monthsShort');
  3293. }
  3294. function listWeekdays (localeSorted, format, index) {
  3295. return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
  3296. }
  3297. function listWeekdaysShort (localeSorted, format, index) {
  3298. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
  3299. }
  3300. function listWeekdaysMin (localeSorted, format, index) {
  3301. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
  3302. }
  3303. getSetGlobalLocale('en', {
  3304. ordinalParse: /\d{1,2}(th|st|nd|rd)/,
  3305. ordinal : function (number) {
  3306. var b = number % 10,
  3307. output = (toInt(number % 100 / 10) === 1) ? 'th' :
  3308. (b === 1) ? 'st' :
  3309. (b === 2) ? 'nd' :
  3310. (b === 3) ? 'rd' : 'th';
  3311. return number + output;
  3312. }
  3313. });
  3314. // Side effect imports
  3315. hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);
  3316. hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);
  3317. var mathAbs = Math.abs;
  3318. function abs () {
  3319. var data = this._data;
  3320. this._milliseconds = mathAbs(this._milliseconds);
  3321. this._days = mathAbs(this._days);
  3322. this._months = mathAbs(this._months);
  3323. data.milliseconds = mathAbs(data.milliseconds);
  3324. data.seconds = mathAbs(data.seconds);
  3325. data.minutes = mathAbs(data.minutes);
  3326. data.hours = mathAbs(data.hours);
  3327. data.months = mathAbs(data.months);
  3328. data.years = mathAbs(data.years);
  3329. return this;
  3330. }
  3331. function addSubtract$1 (duration, input, value, direction) {
  3332. var other = createDuration(input, value);
  3333. duration._milliseconds += direction * other._milliseconds;
  3334. duration._days += direction * other._days;
  3335. duration._months += direction * other._months;
  3336. return duration._bubble();
  3337. }
  3338. // supports only 2.0-style add(1, 's') or add(duration)
  3339. function add$1 (input, value) {
  3340. return addSubtract$1(this, input, value, 1);
  3341. }
  3342. // supports only 2.0-style subtract(1, 's') or subtract(duration)
  3343. function subtract$1 (input, value) {
  3344. return addSubtract$1(this, input, value, -1);
  3345. }
  3346. function absCeil (number) {
  3347. if (number < 0) {
  3348. return Math.floor(number);
  3349. } else {
  3350. return Math.ceil(number);
  3351. }
  3352. }
  3353. function bubble () {
  3354. var milliseconds = this._milliseconds;
  3355. var days = this._days;
  3356. var months = this._months;
  3357. var data = this._data;
  3358. var seconds, minutes, hours, years, monthsFromDays;
  3359. // if we have a mix of positive and negative values, bubble down first
  3360. // check: https://github.com/moment/moment/issues/2166
  3361. if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
  3362. (milliseconds <= 0 && days <= 0 && months <= 0))) {
  3363. milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
  3364. days = 0;
  3365. months = 0;
  3366. }
  3367. // The following code bubbles up values, see the tests for
  3368. // examples of what that means.
  3369. data.milliseconds = milliseconds % 1000;
  3370. seconds = absFloor(milliseconds / 1000);
  3371. data.seconds = seconds % 60;
  3372. minutes = absFloor(seconds / 60);
  3373. data.minutes = minutes % 60;
  3374. hours = absFloor(minutes / 60);
  3375. data.hours = hours % 24;
  3376. days += absFloor(hours / 24);
  3377. // convert days to months
  3378. monthsFromDays = absFloor(daysToMonths(days));
  3379. months += monthsFromDays;
  3380. days -= absCeil(monthsToDays(monthsFromDays));
  3381. // 12 months -> 1 year
  3382. years = absFloor(months / 12);
  3383. months %= 12;
  3384. data.days = days;
  3385. data.months = months;
  3386. data.years = years;
  3387. return this;
  3388. }
  3389. function daysToMonths (days) {
  3390. // 400 years have 146097 days (taking into account leap year rules)
  3391. // 400 years have 12 months === 4800
  3392. return days * 4800 / 146097;
  3393. }
  3394. function monthsToDays (months) {
  3395. // the reverse of daysToMonths
  3396. return months * 146097 / 4800;
  3397. }
  3398. function as (units) {
  3399. var days;
  3400. var months;
  3401. var milliseconds = this._milliseconds;
  3402. units = normalizeUnits(units);
  3403. if (units === 'month' || units === 'year') {
  3404. days = this._days + milliseconds / 864e5;
  3405. months = this._months + daysToMonths(days);
  3406. return units === 'month' ? months : months / 12;
  3407. } else {
  3408. // handle milliseconds separately because of floating point math errors (issue #1867)
  3409. days = this._days + Math.round(monthsToDays(this._months));
  3410. switch (units) {
  3411. case 'week' : return days / 7 + milliseconds / 6048e5;
  3412. case 'day' : return days + milliseconds / 864e5;
  3413. case 'hour' : return days * 24 + milliseconds / 36e5;
  3414. case 'minute' : return days * 1440 + milliseconds / 6e4;
  3415. case 'second' : return days * 86400 + milliseconds / 1000;
  3416. // Math.floor prevents floating point math errors here
  3417. case 'millisecond': return Math.floor(days * 864e5) + milliseconds;
  3418. default: throw new Error('Unknown unit ' + units);
  3419. }
  3420. }
  3421. }
  3422. // TODO: Use this.as('ms')?
  3423. function valueOf$1 () {
  3424. return (
  3425. this._milliseconds +
  3426. this._days * 864e5 +
  3427. (this._months % 12) * 2592e6 +
  3428. toInt(this._months / 12) * 31536e6
  3429. );
  3430. }
  3431. function makeAs (alias) {
  3432. return function () {
  3433. return this.as(alias);
  3434. };
  3435. }
  3436. var asMilliseconds = makeAs('ms');
  3437. var asSeconds = makeAs('s');
  3438. var asMinutes = makeAs('m');
  3439. var asHours = makeAs('h');
  3440. var asDays = makeAs('d');
  3441. var asWeeks = makeAs('w');
  3442. var asMonths = makeAs('M');
  3443. var asYears = makeAs('y');
  3444. function get$2 (units) {
  3445. units = normalizeUnits(units);
  3446. return this[units + 's']();
  3447. }
  3448. function makeGetter(name) {
  3449. return function () {
  3450. return this._data[name];
  3451. };
  3452. }
  3453. var milliseconds = makeGetter('milliseconds');
  3454. var seconds = makeGetter('seconds');
  3455. var minutes = makeGetter('minutes');
  3456. var hours = makeGetter('hours');
  3457. var days = makeGetter('days');
  3458. var months = makeGetter('months');
  3459. var years = makeGetter('years');
  3460. function weeks () {
  3461. return absFloor(this.days() / 7);
  3462. }
  3463. var round = Math.round;
  3464. var thresholds = {
  3465. s: 45, // seconds to minute
  3466. m: 45, // minutes to hour
  3467. h: 22, // hours to day
  3468. d: 26, // days to month
  3469. M: 11 // months to year
  3470. };
  3471. // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
  3472. function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
  3473. return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
  3474. }
  3475. function relativeTime$1 (posNegDuration, withoutSuffix, locale) {
  3476. var duration = createDuration(posNegDuration).abs();
  3477. var seconds = round(duration.as('s'));
  3478. var minutes = round(duration.as('m'));
  3479. var hours = round(duration.as('h'));
  3480. var days = round(duration.as('d'));
  3481. var months = round(duration.as('M'));
  3482. var years = round(duration.as('y'));
  3483. var a = seconds < thresholds.s && ['s', seconds] ||
  3484. minutes <= 1 && ['m'] ||
  3485. minutes < thresholds.m && ['mm', minutes] ||
  3486. hours <= 1 && ['h'] ||
  3487. hours < thresholds.h && ['hh', hours] ||
  3488. days <= 1 && ['d'] ||
  3489. days < thresholds.d && ['dd', days] ||
  3490. months <= 1 && ['M'] ||
  3491. months < thresholds.M && ['MM', months] ||
  3492. years <= 1 && ['y'] || ['yy', years];
  3493. a[2] = withoutSuffix;
  3494. a[3] = +posNegDuration > 0;
  3495. a[4] = locale;
  3496. return substituteTimeAgo.apply(null, a);
  3497. }
  3498. // This function allows you to set the rounding function for relative time strings
  3499. function getSetRelativeTimeRounding (roundingFunction) {
  3500. if (roundingFunction === undefined) {
  3501. return round;
  3502. }
  3503. if (typeof(roundingFunction) === 'function') {
  3504. round = roundingFunction;
  3505. return true;
  3506. }
  3507. return false;
  3508. }
  3509. // This function allows you to set a threshold for relative time strings
  3510. function getSetRelativeTimeThreshold (threshold, limit) {
  3511. if (thresholds[threshold] === undefined) {
  3512. return false;
  3513. }
  3514. if (limit === undefined) {
  3515. return thresholds[threshold];
  3516. }
  3517. thresholds[threshold] = limit;
  3518. return true;
  3519. }
  3520. function humanize (withSuffix) {
  3521. var locale = this.localeData();
  3522. var output = relativeTime$1(this, !withSuffix, locale);
  3523. if (withSuffix) {
  3524. output = locale.pastFuture(+this, output);
  3525. }
  3526. return locale.postformat(output);
  3527. }
  3528. var abs$1 = Math.abs;
  3529. function toISOString$1() {
  3530. // for ISO strings we do not use the normal bubbling rules:
  3531. // * milliseconds bubble up until they become hours
  3532. // * days do not bubble at all
  3533. // * months bubble up until they become years
  3534. // This is because there is no context-free conversion between hours and days
  3535. // (think of clock changes)
  3536. // and also not between days and months (28-31 days per month)
  3537. var seconds = abs$1(this._milliseconds) / 1000;
  3538. var days = abs$1(this._days);
  3539. var months = abs$1(this._months);
  3540. var minutes, hours, years;
  3541. // 3600 seconds -> 60 minutes -> 1 hour
  3542. minutes = absFloor(seconds / 60);
  3543. hours = absFloor(minutes / 60);
  3544. seconds %= 60;
  3545. minutes %= 60;
  3546. // 12 months -> 1 year
  3547. years = absFloor(months / 12);
  3548. months %= 12;
  3549. // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
  3550. var Y = years;
  3551. var M = months;
  3552. var D = days;
  3553. var h = hours;
  3554. var m = minutes;
  3555. var s = seconds;
  3556. var total = this.asSeconds();
  3557. if (!total) {
  3558. // this is the same as C#'s (Noda) and python (isodate)...
  3559. // but not other JS (goog.date)
  3560. return 'P0D';
  3561. }
  3562. return (total < 0 ? '-' : '') +
  3563. 'P' +
  3564. (Y ? Y + 'Y' : '') +
  3565. (M ? M + 'M' : '') +
  3566. (D ? D + 'D' : '') +
  3567. ((h || m || s) ? 'T' : '') +
  3568. (h ? h + 'H' : '') +
  3569. (m ? m + 'M' : '') +
  3570. (s ? s + 'S' : '');
  3571. }
  3572. var proto$2 = Duration.prototype;
  3573. proto$2.abs = abs;
  3574. proto$2.add = add$1;
  3575. proto$2.subtract = subtract$1;
  3576. proto$2.as = as;
  3577. proto$2.asMilliseconds = asMilliseconds;
  3578. proto$2.asSeconds = asSeconds;
  3579. proto$2.asMinutes = asMinutes;
  3580. proto$2.asHours = asHours;
  3581. proto$2.asDays = asDays;
  3582. proto$2.asWeeks = asWeeks;
  3583. proto$2.asMonths = asMonths;
  3584. proto$2.asYears = asYears;
  3585. proto$2.valueOf = valueOf$1;
  3586. proto$2._bubble = bubble;
  3587. proto$2.get = get$2;
  3588. proto$2.milliseconds = milliseconds;
  3589. proto$2.seconds = seconds;
  3590. proto$2.minutes = minutes;
  3591. proto$2.hours = hours;
  3592. proto$2.days = days;
  3593. proto$2.weeks = weeks;
  3594. proto$2.months = months;
  3595. proto$2.years = years;
  3596. proto$2.humanize = humanize;
  3597. proto$2.toISOString = toISOString$1;
  3598. proto$2.toString = toISOString$1;
  3599. proto$2.toJSON = toISOString$1;
  3600. proto$2.locale = locale;
  3601. proto$2.localeData = localeData;
  3602. // Deprecations
  3603. proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1);
  3604. proto$2.lang = lang;
  3605. // Side effect imports
  3606. // FORMATTING
  3607. addFormatToken('X', 0, 0, 'unix');
  3608. addFormatToken('x', 0, 0, 'valueOf');
  3609. // PARSING
  3610. addRegexToken('x', matchSigned);
  3611. addRegexToken('X', matchTimestamp);
  3612. addParseToken('X', function (input, array, config) {
  3613. config._d = new Date(parseFloat(input, 10) * 1000);
  3614. });
  3615. addParseToken('x', function (input, array, config) {
  3616. config._d = new Date(toInt(input));
  3617. });
  3618. // Side effect imports
  3619. hooks.version = '2.17.1';
  3620. setHookCallback(createLocal);
  3621. hooks.fn = proto;
  3622. hooks.min = min;
  3623. hooks.max = max;
  3624. hooks.now = now;
  3625. hooks.utc = createUTC;
  3626. hooks.unix = createUnix;
  3627. hooks.months = listMonths;
  3628. hooks.isDate = isDate;
  3629. hooks.locale = getSetGlobalLocale;
  3630. hooks.invalid = createInvalid;
  3631. hooks.duration = createDuration;
  3632. hooks.isMoment = isMoment;
  3633. hooks.weekdays = listWeekdays;
  3634. hooks.parseZone = createInZone;
  3635. hooks.localeData = getLocale;
  3636. hooks.isDuration = isDuration;
  3637. hooks.monthsShort = listMonthsShort;
  3638. hooks.weekdaysMin = listWeekdaysMin;
  3639. hooks.defineLocale = defineLocale;
  3640. hooks.updateLocale = updateLocale;
  3641. hooks.locales = listLocales;
  3642. hooks.weekdaysShort = listWeekdaysShort;
  3643. hooks.normalizeUnits = normalizeUnits;
  3644. hooks.relativeTimeRounding = getSetRelativeTimeRounding;
  3645. hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
  3646. hooks.calendarFormat = getCalendarFormat;
  3647. hooks.prototype = proto;
  3648. return hooks;
  3649. })));
  3650. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(191)(module)))
  3651. /***/ }),
  3652. /* 1 */
  3653. /***/ (function(module, exports) {
  3654. module.exports = function normalizeComponent (
  3655. rawScriptExports,
  3656. compiledTemplate,
  3657. scopeId,
  3658. cssModules
  3659. ) {
  3660. var esModule
  3661. var scriptExports = rawScriptExports = rawScriptExports || {}
  3662. // ES6 modules interop
  3663. var type = typeof rawScriptExports.default
  3664. if (type === 'object' || type === 'function') {
  3665. esModule = rawScriptExports
  3666. scriptExports = rawScriptExports.default
  3667. }
  3668. // Vue.extend constructor export interop
  3669. var options = typeof scriptExports === 'function'
  3670. ? scriptExports.options
  3671. : scriptExports
  3672. // render functions
  3673. if (compiledTemplate) {
  3674. options.render = compiledTemplate.render
  3675. options.staticRenderFns = compiledTemplate.staticRenderFns
  3676. }
  3677. // scopedId
  3678. if (scopeId) {
  3679. options._scopeId = scopeId
  3680. }
  3681. // inject cssModules
  3682. if (cssModules) {
  3683. var computed = options.computed || (options.computed = {})
  3684. Object.keys(cssModules).forEach(function (key) {
  3685. var module = cssModules[key]
  3686. computed[key] = function () { return module }
  3687. })
  3688. }
  3689. return {
  3690. esModule: esModule,
  3691. exports: scriptExports,
  3692. options: options
  3693. }
  3694. }
  3695. /***/ }),
  3696. /* 2 */
  3697. /***/ (function(module, exports, __webpack_require__) {
  3698. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  3699. * jQuery JavaScript Library v3.1.1
  3700. * https://jquery.com/
  3701. *
  3702. * Includes Sizzle.js
  3703. * https://sizzlejs.com/
  3704. *
  3705. * Copyright jQuery Foundation and other contributors
  3706. * Released under the MIT license
  3707. * https://jquery.org/license
  3708. *
  3709. * Date: 2016-09-22T22:30Z
  3710. */
  3711. ( function( global, factory ) {
  3712. "use strict";
  3713. if ( typeof module === "object" && typeof module.exports === "object" ) {
  3714. // For CommonJS and CommonJS-like environments where a proper `window`
  3715. // is present, execute the factory and get jQuery.
  3716. // For environments that do not have a `window` with a `document`
  3717. // (such as Node.js), expose a factory as module.exports.
  3718. // This accentuates the need for the creation of a real `window`.
  3719. // e.g. var jQuery = require("jquery")(window);
  3720. // See ticket #14549 for more info.
  3721. module.exports = global.document ?
  3722. factory( global, true ) :
  3723. function( w ) {
  3724. if ( !w.document ) {
  3725. throw new Error( "jQuery requires a window with a document" );
  3726. }
  3727. return factory( w );
  3728. };
  3729. } else {
  3730. factory( global );
  3731. }
  3732. // Pass this if window is not defined yet
  3733. } )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
  3734. // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
  3735. // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
  3736. // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
  3737. // enough that all such attempts are guarded in a try block.
  3738. "use strict";
  3739. var arr = [];
  3740. var document = window.document;
  3741. var getProto = Object.getPrototypeOf;
  3742. var slice = arr.slice;
  3743. var concat = arr.concat;
  3744. var push = arr.push;
  3745. var indexOf = arr.indexOf;
  3746. var class2type = {};
  3747. var toString = class2type.toString;
  3748. var hasOwn = class2type.hasOwnProperty;
  3749. var fnToString = hasOwn.toString;
  3750. var ObjectFunctionString = fnToString.call( Object );
  3751. var support = {};
  3752. function DOMEval( code, doc ) {
  3753. doc = doc || document;
  3754. var script = doc.createElement( "script" );
  3755. script.text = code;
  3756. doc.head.appendChild( script ).parentNode.removeChild( script );
  3757. }
  3758. /* global Symbol */
  3759. // Defining this global in .eslintrc.json would create a danger of using the global
  3760. // unguarded in another place, it seems safer to define global only for this module
  3761. var
  3762. version = "3.1.1",
  3763. // Define a local copy of jQuery
  3764. jQuery = function( selector, context ) {
  3765. // The jQuery object is actually just the init constructor 'enhanced'
  3766. // Need init if jQuery is called (just allow error to be thrown if not included)
  3767. return new jQuery.fn.init( selector, context );
  3768. },
  3769. // Support: Android <=4.0 only
  3770. // Make sure we trim BOM and NBSP
  3771. rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
  3772. // Matches dashed string for camelizing
  3773. rmsPrefix = /^-ms-/,
  3774. rdashAlpha = /-([a-z])/g,
  3775. // Used by jQuery.camelCase as callback to replace()
  3776. fcamelCase = function( all, letter ) {
  3777. return letter.toUpperCase();
  3778. };
  3779. jQuery.fn = jQuery.prototype = {
  3780. // The current version of jQuery being used
  3781. jquery: version,
  3782. constructor: jQuery,
  3783. // The default length of a jQuery object is 0
  3784. length: 0,
  3785. toArray: function() {
  3786. return slice.call( this );
  3787. },
  3788. // Get the Nth element in the matched element set OR
  3789. // Get the whole matched element set as a clean array
  3790. get: function( num ) {
  3791. // Return all the elements in a clean array
  3792. if ( num == null ) {
  3793. return slice.call( this );
  3794. }
  3795. // Return just the one element from the set
  3796. return num < 0 ? this[ num + this.length ] : this[ num ];
  3797. },
  3798. // Take an array of elements and push it onto the stack
  3799. // (returning the new matched element set)
  3800. pushStack: function( elems ) {
  3801. // Build a new jQuery matched element set
  3802. var ret = jQuery.merge( this.constructor(), elems );
  3803. // Add the old object onto the stack (as a reference)
  3804. ret.prevObject = this;
  3805. // Return the newly-formed element set
  3806. return ret;
  3807. },
  3808. // Execute a callback for every element in the matched set.
  3809. each: function( callback ) {
  3810. return jQuery.each( this, callback );
  3811. },
  3812. map: function( callback ) {
  3813. return this.pushStack( jQuery.map( this, function( elem, i ) {
  3814. return callback.call( elem, i, elem );
  3815. } ) );
  3816. },
  3817. slice: function() {
  3818. return this.pushStack( slice.apply( this, arguments ) );
  3819. },
  3820. first: function() {
  3821. return this.eq( 0 );
  3822. },
  3823. last: function() {
  3824. return this.eq( -1 );
  3825. },
  3826. eq: function( i ) {
  3827. var len = this.length,
  3828. j = +i + ( i < 0 ? len : 0 );
  3829. return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
  3830. },
  3831. end: function() {
  3832. return this.prevObject || this.constructor();
  3833. },
  3834. // For internal use only.
  3835. // Behaves like an Array's method, not like a jQuery method.
  3836. push: push,
  3837. sort: arr.sort,
  3838. splice: arr.splice
  3839. };
  3840. jQuery.extend = jQuery.fn.extend = function() {
  3841. var options, name, src, copy, copyIsArray, clone,
  3842. target = arguments[ 0 ] || {},
  3843. i = 1,
  3844. length = arguments.length,
  3845. deep = false;
  3846. // Handle a deep copy situation
  3847. if ( typeof target === "boolean" ) {
  3848. deep = target;
  3849. // Skip the boolean and the target
  3850. target = arguments[ i ] || {};
  3851. i++;
  3852. }
  3853. // Handle case when target is a string or something (possible in deep copy)
  3854. if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
  3855. target = {};
  3856. }
  3857. // Extend jQuery itself if only one argument is passed
  3858. if ( i === length ) {
  3859. target = this;
  3860. i--;
  3861. }
  3862. for ( ; i < length; i++ ) {
  3863. // Only deal with non-null/undefined values
  3864. if ( ( options = arguments[ i ] ) != null ) {
  3865. // Extend the base object
  3866. for ( name in options ) {
  3867. src = target[ name ];
  3868. copy = options[ name ];
  3869. // Prevent never-ending loop
  3870. if ( target === copy ) {
  3871. continue;
  3872. }
  3873. // Recurse if we're merging plain objects or arrays
  3874. if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
  3875. ( copyIsArray = jQuery.isArray( copy ) ) ) ) {
  3876. if ( copyIsArray ) {
  3877. copyIsArray = false;
  3878. clone = src && jQuery.isArray( src ) ? src : [];
  3879. } else {
  3880. clone = src && jQuery.isPlainObject( src ) ? src : {};
  3881. }
  3882. // Never move original objects, clone them
  3883. target[ name ] = jQuery.extend( deep, clone, copy );
  3884. // Don't bring in undefined values
  3885. } else if ( copy !== undefined ) {
  3886. target[ name ] = copy;
  3887. }
  3888. }
  3889. }
  3890. }
  3891. // Return the modified object
  3892. return target;
  3893. };
  3894. jQuery.extend( {
  3895. // Unique for each copy of jQuery on the page
  3896. expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
  3897. // Assume jQuery is ready without the ready module
  3898. isReady: true,
  3899. error: function( msg ) {
  3900. throw new Error( msg );
  3901. },
  3902. noop: function() {},
  3903. isFunction: function( obj ) {
  3904. return jQuery.type( obj ) === "function";
  3905. },
  3906. isArray: Array.isArray,
  3907. isWindow: function( obj ) {
  3908. return obj != null && obj === obj.window;
  3909. },
  3910. isNumeric: function( obj ) {
  3911. // As of jQuery 3.0, isNumeric is limited to
  3912. // strings and numbers (primitives or objects)
  3913. // that can be coerced to finite numbers (gh-2662)
  3914. var type = jQuery.type( obj );
  3915. return ( type === "number" || type === "string" ) &&
  3916. // parseFloat NaNs numeric-cast false positives ("")
  3917. // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  3918. // subtraction forces infinities to NaN
  3919. !isNaN( obj - parseFloat( obj ) );
  3920. },
  3921. isPlainObject: function( obj ) {
  3922. var proto, Ctor;
  3923. // Detect obvious negatives
  3924. // Use toString instead of jQuery.type to catch host objects
  3925. if ( !obj || toString.call( obj ) !== "[object Object]" ) {
  3926. return false;
  3927. }
  3928. proto = getProto( obj );
  3929. // Objects with no prototype (e.g., `Object.create( null )`) are plain
  3930. if ( !proto ) {
  3931. return true;
  3932. }
  3933. // Objects with prototype are plain iff they were constructed by a global Object function
  3934. Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
  3935. return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
  3936. },
  3937. isEmptyObject: function( obj ) {
  3938. /* eslint-disable no-unused-vars */
  3939. // See https://github.com/eslint/eslint/issues/6125
  3940. var name;
  3941. for ( name in obj ) {
  3942. return false;
  3943. }
  3944. return true;
  3945. },
  3946. type: function( obj ) {
  3947. if ( obj == null ) {
  3948. return obj + "";
  3949. }
  3950. // Support: Android <=2.3 only (functionish RegExp)
  3951. return typeof obj === "object" || typeof obj === "function" ?
  3952. class2type[ toString.call( obj ) ] || "object" :
  3953. typeof obj;
  3954. },
  3955. // Evaluates a script in a global context
  3956. globalEval: function( code ) {
  3957. DOMEval( code );
  3958. },
  3959. // Convert dashed to camelCase; used by the css and data modules
  3960. // Support: IE <=9 - 11, Edge 12 - 13
  3961. // Microsoft forgot to hump their vendor prefix (#9572)
  3962. camelCase: function( string ) {
  3963. return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  3964. },
  3965. nodeName: function( elem, name ) {
  3966. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  3967. },
  3968. each: function( obj, callback ) {
  3969. var length, i = 0;
  3970. if ( isArrayLike( obj ) ) {
  3971. length = obj.length;
  3972. for ( ; i < length; i++ ) {
  3973. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  3974. break;
  3975. }
  3976. }
  3977. } else {
  3978. for ( i in obj ) {
  3979. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  3980. break;
  3981. }
  3982. }
  3983. }
  3984. return obj;
  3985. },
  3986. // Support: Android <=4.0 only
  3987. trim: function( text ) {
  3988. return text == null ?
  3989. "" :
  3990. ( text + "" ).replace( rtrim, "" );
  3991. },
  3992. // results is for internal usage only
  3993. makeArray: function( arr, results ) {
  3994. var ret = results || [];
  3995. if ( arr != null ) {
  3996. if ( isArrayLike( Object( arr ) ) ) {
  3997. jQuery.merge( ret,
  3998. typeof arr === "string" ?
  3999. [ arr ] : arr
  4000. );
  4001. } else {
  4002. push.call( ret, arr );
  4003. }
  4004. }
  4005. return ret;
  4006. },
  4007. inArray: function( elem, arr, i ) {
  4008. return arr == null ? -1 : indexOf.call( arr, elem, i );
  4009. },
  4010. // Support: Android <=4.0 only, PhantomJS 1 only
  4011. // push.apply(_, arraylike) throws on ancient WebKit
  4012. merge: function( first, second ) {
  4013. var len = +second.length,
  4014. j = 0,
  4015. i = first.length;
  4016. for ( ; j < len; j++ ) {
  4017. first[ i++ ] = second[ j ];
  4018. }
  4019. first.length = i;
  4020. return first;
  4021. },
  4022. grep: function( elems, callback, invert ) {
  4023. var callbackInverse,
  4024. matches = [],
  4025. i = 0,
  4026. length = elems.length,
  4027. callbackExpect = !invert;
  4028. // Go through the array, only saving the items
  4029. // that pass the validator function
  4030. for ( ; i < length; i++ ) {
  4031. callbackInverse = !callback( elems[ i ], i );
  4032. if ( callbackInverse !== callbackExpect ) {
  4033. matches.push( elems[ i ] );
  4034. }
  4035. }
  4036. return matches;
  4037. },
  4038. // arg is for internal usage only
  4039. map: function( elems, callback, arg ) {
  4040. var length, value,
  4041. i = 0,
  4042. ret = [];
  4043. // Go through the array, translating each of the items to their new values
  4044. if ( isArrayLike( elems ) ) {
  4045. length = elems.length;
  4046. for ( ; i < length; i++ ) {
  4047. value = callback( elems[ i ], i, arg );
  4048. if ( value != null ) {
  4049. ret.push( value );
  4050. }
  4051. }
  4052. // Go through every key on the object,
  4053. } else {
  4054. for ( i in elems ) {
  4055. value = callback( elems[ i ], i, arg );
  4056. if ( value != null ) {
  4057. ret.push( value );
  4058. }
  4059. }
  4060. }
  4061. // Flatten any nested arrays
  4062. return concat.apply( [], ret );
  4063. },
  4064. // A global GUID counter for objects
  4065. guid: 1,
  4066. // Bind a function to a context, optionally partially applying any
  4067. // arguments.
  4068. proxy: function( fn, context ) {
  4069. var tmp, args, proxy;
  4070. if ( typeof context === "string" ) {
  4071. tmp = fn[ context ];
  4072. context = fn;
  4073. fn = tmp;
  4074. }
  4075. // Quick check to determine if target is callable, in the spec
  4076. // this throws a TypeError, but we will just return undefined.
  4077. if ( !jQuery.isFunction( fn ) ) {
  4078. return undefined;
  4079. }
  4080. // Simulated bind
  4081. args = slice.call( arguments, 2 );
  4082. proxy = function() {
  4083. return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
  4084. };
  4085. // Set the guid of unique handler to the same of original handler, so it can be removed
  4086. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  4087. return proxy;
  4088. },
  4089. now: Date.now,
  4090. // jQuery.support is not used in Core but other projects attach their
  4091. // properties to it so it needs to exist.
  4092. support: support
  4093. } );
  4094. if ( typeof Symbol === "function" ) {
  4095. jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
  4096. }
  4097. // Populate the class2type map
  4098. jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
  4099. function( i, name ) {
  4100. class2type[ "[object " + name + "]" ] = name.toLowerCase();
  4101. } );
  4102. function isArrayLike( obj ) {
  4103. // Support: real iOS 8.2 only (not reproducible in simulator)
  4104. // `in` check used to prevent JIT error (gh-2145)
  4105. // hasOwn isn't used here due to false negatives
  4106. // regarding Nodelist length in IE
  4107. var length = !!obj && "length" in obj && obj.length,
  4108. type = jQuery.type( obj );
  4109. if ( type === "function" || jQuery.isWindow( obj ) ) {
  4110. return false;
  4111. }
  4112. return type === "array" || length === 0 ||
  4113. typeof length === "number" && length > 0 && ( length - 1 ) in obj;
  4114. }
  4115. var Sizzle =
  4116. /*!
  4117. * Sizzle CSS Selector Engine v2.3.3
  4118. * https://sizzlejs.com/
  4119. *
  4120. * Copyright jQuery Foundation and other contributors
  4121. * Released under the MIT license
  4122. * http://jquery.org/license
  4123. *
  4124. * Date: 2016-08-08
  4125. */
  4126. (function( window ) {
  4127. var i,
  4128. support,
  4129. Expr,
  4130. getText,
  4131. isXML,
  4132. tokenize,
  4133. compile,
  4134. select,
  4135. outermostContext,
  4136. sortInput,
  4137. hasDuplicate,
  4138. // Local document vars
  4139. setDocument,
  4140. document,
  4141. docElem,
  4142. documentIsHTML,
  4143. rbuggyQSA,
  4144. rbuggyMatches,
  4145. matches,
  4146. contains,
  4147. // Instance-specific data
  4148. expando = "sizzle" + 1 * new Date(),
  4149. preferredDoc = window.document,
  4150. dirruns = 0,
  4151. done = 0,
  4152. classCache = createCache(),
  4153. tokenCache = createCache(),
  4154. compilerCache = createCache(),
  4155. sortOrder = function( a, b ) {
  4156. if ( a === b ) {
  4157. hasDuplicate = true;
  4158. }
  4159. return 0;
  4160. },
  4161. // Instance methods
  4162. hasOwn = ({}).hasOwnProperty,
  4163. arr = [],
  4164. pop = arr.pop,
  4165. push_native = arr.push,
  4166. push = arr.push,
  4167. slice = arr.slice,
  4168. // Use a stripped-down indexOf as it's faster than native
  4169. // https://jsperf.com/thor-indexof-vs-for/5
  4170. indexOf = function( list, elem ) {
  4171. var i = 0,
  4172. len = list.length;
  4173. for ( ; i < len; i++ ) {
  4174. if ( list[i] === elem ) {
  4175. return i;
  4176. }
  4177. }
  4178. return -1;
  4179. },
  4180. booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
  4181. // Regular expressions
  4182. // http://www.w3.org/TR/css3-selectors/#whitespace
  4183. whitespace = "[\\x20\\t\\r\\n\\f]",
  4184. // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
  4185. identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
  4186. // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
  4187. attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
  4188. // Operator (capture 2)
  4189. "*([*^$|!~]?=)" + whitespace +
  4190. // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
  4191. "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
  4192. "*\\]",
  4193. pseudos = ":(" + identifier + ")(?:\\((" +
  4194. // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
  4195. // 1. quoted (capture 3; capture 4 or capture 5)
  4196. "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
  4197. // 2. simple (capture 6)
  4198. "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
  4199. // 3. anything else (capture 2)
  4200. ".*" +
  4201. ")\\)|)",
  4202. // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
  4203. rwhitespace = new RegExp( whitespace + "+", "g" ),
  4204. rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
  4205. rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
  4206. rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
  4207. rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
  4208. rpseudo = new RegExp( pseudos ),
  4209. ridentifier = new RegExp( "^" + identifier + "$" ),
  4210. matchExpr = {
  4211. "ID": new RegExp( "^#(" + identifier + ")" ),
  4212. "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
  4213. "TAG": new RegExp( "^(" + identifier + "|[*])" ),
  4214. "ATTR": new RegExp( "^" + attributes ),
  4215. "PSEUDO": new RegExp( "^" + pseudos ),
  4216. "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
  4217. "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
  4218. "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
  4219. "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
  4220. // For use in libraries implementing .is()
  4221. // We use this for POS matching in `select`
  4222. "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
  4223. whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
  4224. },
  4225. rinputs = /^(?:input|select|textarea|button)$/i,
  4226. rheader = /^h\d$/i,
  4227. rnative = /^[^{]+\{\s*\[native \w/,
  4228. // Easily-parseable/retrievable ID or TAG or CLASS selectors
  4229. rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  4230. rsibling = /[+~]/,
  4231. // CSS escapes
  4232. // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
  4233. runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
  4234. funescape = function( _, escaped, escapedWhitespace ) {
  4235. var high = "0x" + escaped - 0x10000;
  4236. // NaN means non-codepoint
  4237. // Support: Firefox<24
  4238. // Workaround erroneous numeric interpretation of +"0x"
  4239. return high !== high || escapedWhitespace ?
  4240. escaped :
  4241. high < 0 ?
  4242. // BMP codepoint
  4243. String.fromCharCode( high + 0x10000 ) :
  4244. // Supplemental Plane codepoint (surrogate pair)
  4245. String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
  4246. },
  4247. // CSS string/identifier serialization
  4248. // https://drafts.csswg.org/cssom/#common-serializing-idioms
  4249. rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
  4250. fcssescape = function( ch, asCodePoint ) {
  4251. if ( asCodePoint ) {
  4252. // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
  4253. if ( ch === "\0" ) {
  4254. return "\uFFFD";
  4255. }
  4256. // Control characters and (dependent upon position) numbers get escaped as code points
  4257. return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
  4258. }
  4259. // Other potentially-special ASCII characters get backslash-escaped
  4260. return "\\" + ch;
  4261. },
  4262. // Used for iframes
  4263. // See setDocument()
  4264. // Removing the function wrapper causes a "Permission Denied"
  4265. // error in IE
  4266. unloadHandler = function() {
  4267. setDocument();
  4268. },
  4269. disabledAncestor = addCombinator(
  4270. function( elem ) {
  4271. return elem.disabled === true && ("form" in elem || "label" in elem);
  4272. },
  4273. { dir: "parentNode", next: "legend" }
  4274. );
  4275. // Optimize for push.apply( _, NodeList )
  4276. try {
  4277. push.apply(
  4278. (arr = slice.call( preferredDoc.childNodes )),
  4279. preferredDoc.childNodes
  4280. );
  4281. // Support: Android<4.0
  4282. // Detect silently failing push.apply
  4283. arr[ preferredDoc.childNodes.length ].nodeType;
  4284. } catch ( e ) {
  4285. push = { apply: arr.length ?
  4286. // Leverage slice if possible
  4287. function( target, els ) {
  4288. push_native.apply( target, slice.call(els) );
  4289. } :
  4290. // Support: IE<9
  4291. // Otherwise append directly
  4292. function( target, els ) {
  4293. var j = target.length,
  4294. i = 0;
  4295. // Can't trust NodeList.length
  4296. while ( (target[j++] = els[i++]) ) {}
  4297. target.length = j - 1;
  4298. }
  4299. };
  4300. }
  4301. function Sizzle( selector, context, results, seed ) {
  4302. var m, i, elem, nid, match, groups, newSelector,
  4303. newContext = context && context.ownerDocument,
  4304. // nodeType defaults to 9, since context defaults to document
  4305. nodeType = context ? context.nodeType : 9;
  4306. results = results || [];
  4307. // Return early from calls with invalid selector or context
  4308. if ( typeof selector !== "string" || !selector ||
  4309. nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
  4310. return results;
  4311. }
  4312. // Try to shortcut find operations (as opposed to filters) in HTML documents
  4313. if ( !seed ) {
  4314. if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
  4315. setDocument( context );
  4316. }
  4317. context = context || document;
  4318. if ( documentIsHTML ) {
  4319. // If the selector is sufficiently simple, try using a "get*By*" DOM method
  4320. // (excepting DocumentFragment context, where the methods don't exist)
  4321. if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
  4322. // ID selector
  4323. if ( (m = match[1]) ) {
  4324. // Document context
  4325. if ( nodeType === 9 ) {
  4326. if ( (elem = context.getElementById( m )) ) {
  4327. // Support: IE, Opera, Webkit
  4328. // TODO: identify versions
  4329. // getElementById can match elements by name instead of ID
  4330. if ( elem.id === m ) {
  4331. results.push( elem );
  4332. return results;
  4333. }
  4334. } else {
  4335. return results;
  4336. }
  4337. // Element context
  4338. } else {
  4339. // Support: IE, Opera, Webkit
  4340. // TODO: identify versions
  4341. // getElementById can match elements by name instead of ID
  4342. if ( newContext && (elem = newContext.getElementById( m )) &&
  4343. contains( context, elem ) &&
  4344. elem.id === m ) {
  4345. results.push( elem );
  4346. return results;
  4347. }
  4348. }
  4349. // Type selector
  4350. } else if ( match[2] ) {
  4351. push.apply( results, context.getElementsByTagName( selector ) );
  4352. return results;
  4353. // Class selector
  4354. } else if ( (m = match[3]) && support.getElementsByClassName &&
  4355. context.getElementsByClassName ) {
  4356. push.apply( results, context.getElementsByClassName( m ) );
  4357. return results;
  4358. }
  4359. }
  4360. // Take advantage of querySelectorAll
  4361. if ( support.qsa &&
  4362. !compilerCache[ selector + " " ] &&
  4363. (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
  4364. if ( nodeType !== 1 ) {
  4365. newContext = context;
  4366. newSelector = selector;
  4367. // qSA looks outside Element context, which is not what we want
  4368. // Thanks to Andrew Dupont for this workaround technique
  4369. // Support: IE <=8
  4370. // Exclude object elements
  4371. } else if ( context.nodeName.toLowerCase() !== "object" ) {
  4372. // Capture the context ID, setting it first if necessary
  4373. if ( (nid = context.getAttribute( "id" )) ) {
  4374. nid = nid.replace( rcssescape, fcssescape );
  4375. } else {
  4376. context.setAttribute( "id", (nid = expando) );
  4377. }
  4378. // Prefix every selector in the list
  4379. groups = tokenize( selector );
  4380. i = groups.length;
  4381. while ( i-- ) {
  4382. groups[i] = "#" + nid + " " + toSelector( groups[i] );
  4383. }
  4384. newSelector = groups.join( "," );
  4385. // Expand context for sibling selectors
  4386. newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
  4387. context;
  4388. }
  4389. if ( newSelector ) {
  4390. try {
  4391. push.apply( results,
  4392. newContext.querySelectorAll( newSelector )
  4393. );
  4394. return results;
  4395. } catch ( qsaError ) {
  4396. } finally {
  4397. if ( nid === expando ) {
  4398. context.removeAttribute( "id" );
  4399. }
  4400. }
  4401. }
  4402. }
  4403. }
  4404. }
  4405. // All others
  4406. return select( selector.replace( rtrim, "$1" ), context, results, seed );
  4407. }
  4408. /**
  4409. * Create key-value caches of limited size
  4410. * @returns {function(string, object)} Returns the Object data after storing it on itself with
  4411. * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
  4412. * deleting the oldest entry
  4413. */
  4414. function createCache() {
  4415. var keys = [];
  4416. function cache( key, value ) {
  4417. // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
  4418. if ( keys.push( key + " " ) > Expr.cacheLength ) {
  4419. // Only keep the most recent entries
  4420. delete cache[ keys.shift() ];
  4421. }
  4422. return (cache[ key + " " ] = value);
  4423. }
  4424. return cache;
  4425. }
  4426. /**
  4427. * Mark a function for special use by Sizzle
  4428. * @param {Function} fn The function to mark
  4429. */
  4430. function markFunction( fn ) {
  4431. fn[ expando ] = true;
  4432. return fn;
  4433. }
  4434. /**
  4435. * Support testing using an element
  4436. * @param {Function} fn Passed the created element and returns a boolean result
  4437. */
  4438. function assert( fn ) {
  4439. var el = document.createElement("fieldset");
  4440. try {
  4441. return !!fn( el );
  4442. } catch (e) {
  4443. return false;
  4444. } finally {
  4445. // Remove from its parent by default
  4446. if ( el.parentNode ) {
  4447. el.parentNode.removeChild( el );
  4448. }
  4449. // release memory in IE
  4450. el = null;
  4451. }
  4452. }
  4453. /**
  4454. * Adds the same handler for all of the specified attrs
  4455. * @param {String} attrs Pipe-separated list of attributes
  4456. * @param {Function} handler The method that will be applied
  4457. */
  4458. function addHandle( attrs, handler ) {
  4459. var arr = attrs.split("|"),
  4460. i = arr.length;
  4461. while ( i-- ) {
  4462. Expr.attrHandle[ arr[i] ] = handler;
  4463. }
  4464. }
  4465. /**
  4466. * Checks document order of two siblings
  4467. * @param {Element} a
  4468. * @param {Element} b
  4469. * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
  4470. */
  4471. function siblingCheck( a, b ) {
  4472. var cur = b && a,
  4473. diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
  4474. a.sourceIndex - b.sourceIndex;
  4475. // Use IE sourceIndex if available on both nodes
  4476. if ( diff ) {
  4477. return diff;
  4478. }
  4479. // Check if b follows a
  4480. if ( cur ) {
  4481. while ( (cur = cur.nextSibling) ) {
  4482. if ( cur === b ) {
  4483. return -1;
  4484. }
  4485. }
  4486. }
  4487. return a ? 1 : -1;
  4488. }
  4489. /**
  4490. * Returns a function to use in pseudos for input types
  4491. * @param {String} type
  4492. */
  4493. function createInputPseudo( type ) {
  4494. return function( elem ) {
  4495. var name = elem.nodeName.toLowerCase();
  4496. return name === "input" && elem.type === type;
  4497. };
  4498. }
  4499. /**
  4500. * Returns a function to use in pseudos for buttons
  4501. * @param {String} type
  4502. */
  4503. function createButtonPseudo( type ) {
  4504. return function( elem ) {
  4505. var name = elem.nodeName.toLowerCase();
  4506. return (name === "input" || name === "button") && elem.type === type;
  4507. };
  4508. }
  4509. /**
  4510. * Returns a function to use in pseudos for :enabled/:disabled
  4511. * @param {Boolean} disabled true for :disabled; false for :enabled
  4512. */
  4513. function createDisabledPseudo( disabled ) {
  4514. // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
  4515. return function( elem ) {
  4516. // Only certain elements can match :enabled or :disabled
  4517. // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
  4518. // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
  4519. if ( "form" in elem ) {
  4520. // Check for inherited disabledness on relevant non-disabled elements:
  4521. // * listed form-associated elements in a disabled fieldset
  4522. // https://html.spec.whatwg.org/multipage/forms.html#category-listed
  4523. // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
  4524. // * option elements in a disabled optgroup
  4525. // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
  4526. // All such elements have a "form" property.
  4527. if ( elem.parentNode && elem.disabled === false ) {
  4528. // Option elements defer to a parent optgroup if present
  4529. if ( "label" in elem ) {
  4530. if ( "label" in elem.parentNode ) {
  4531. return elem.parentNode.disabled === disabled;
  4532. } else {
  4533. return elem.disabled === disabled;
  4534. }
  4535. }
  4536. // Support: IE 6 - 11
  4537. // Use the isDisabled shortcut property to check for disabled fieldset ancestors
  4538. return elem.isDisabled === disabled ||
  4539. // Where there is no isDisabled, check manually
  4540. /* jshint -W018 */
  4541. elem.isDisabled !== !disabled &&
  4542. disabledAncestor( elem ) === disabled;
  4543. }
  4544. return elem.disabled === disabled;
  4545. // Try to winnow out elements that can't be disabled before trusting the disabled property.
  4546. // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
  4547. // even exist on them, let alone have a boolean value.
  4548. } else if ( "label" in elem ) {
  4549. return elem.disabled === disabled;
  4550. }
  4551. // Remaining elements are neither :enabled nor :disabled
  4552. return false;
  4553. };
  4554. }
  4555. /**
  4556. * Returns a function to use in pseudos for positionals
  4557. * @param {Function} fn
  4558. */
  4559. function createPositionalPseudo( fn ) {
  4560. return markFunction(function( argument ) {
  4561. argument = +argument;
  4562. return markFunction(function( seed, matches ) {
  4563. var j,
  4564. matchIndexes = fn( [], seed.length, argument ),
  4565. i = matchIndexes.length;
  4566. // Match elements found at the specified indexes
  4567. while ( i-- ) {
  4568. if ( seed[ (j = matchIndexes[i]) ] ) {
  4569. seed[j] = !(matches[j] = seed[j]);
  4570. }
  4571. }
  4572. });
  4573. });
  4574. }
  4575. /**
  4576. * Checks a node for validity as a Sizzle context
  4577. * @param {Element|Object=} context
  4578. * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  4579. */
  4580. function testContext( context ) {
  4581. return context && typeof context.getElementsByTagName !== "undefined" && context;
  4582. }
  4583. // Expose support vars for convenience
  4584. support = Sizzle.support = {};
  4585. /**
  4586. * Detects XML nodes
  4587. * @param {Element|Object} elem An element or a document
  4588. * @returns {Boolean} True iff elem is a non-HTML XML node
  4589. */
  4590. isXML = Sizzle.isXML = function( elem ) {
  4591. // documentElement is verified for cases where it doesn't yet exist
  4592. // (such as loading iframes in IE - #4833)
  4593. var documentElement = elem && (elem.ownerDocument || elem).documentElement;
  4594. return documentElement ? documentElement.nodeName !== "HTML" : false;
  4595. };
  4596. /**
  4597. * Sets document-related variables once based on the current document
  4598. * @param {Element|Object} [doc] An element or document object to use to set the document
  4599. * @returns {Object} Returns the current document
  4600. */
  4601. setDocument = Sizzle.setDocument = function( node ) {
  4602. var hasCompare, subWindow,
  4603. doc = node ? node.ownerDocument || node : preferredDoc;
  4604. // Return early if doc is invalid or already selected
  4605. if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
  4606. return document;
  4607. }
  4608. // Update global variables
  4609. document = doc;
  4610. docElem = document.documentElement;
  4611. documentIsHTML = !isXML( document );
  4612. // Support: IE 9-11, Edge
  4613. // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
  4614. if ( preferredDoc !== document &&
  4615. (subWindow = document.defaultView) && subWindow.top !== subWindow ) {
  4616. // Support: IE 11, Edge
  4617. if ( subWindow.addEventListener ) {
  4618. subWindow.addEventListener( "unload", unloadHandler, false );
  4619. // Support: IE 9 - 10 only
  4620. } else if ( subWindow.attachEvent ) {
  4621. subWindow.attachEvent( "onunload", unloadHandler );
  4622. }
  4623. }
  4624. /* Attributes
  4625. ---------------------------------------------------------------------- */
  4626. // Support: IE<8
  4627. // Verify that getAttribute really returns attributes and not properties
  4628. // (excepting IE8 booleans)
  4629. support.attributes = assert(function( el ) {
  4630. el.className = "i";
  4631. return !el.getAttribute("className");
  4632. });
  4633. /* getElement(s)By*
  4634. ---------------------------------------------------------------------- */
  4635. // Check if getElementsByTagName("*") returns only elements
  4636. support.getElementsByTagName = assert(function( el ) {
  4637. el.appendChild( document.createComment("") );
  4638. return !el.getElementsByTagName("*").length;
  4639. });
  4640. // Support: IE<9
  4641. support.getElementsByClassName = rnative.test( document.getElementsByClassName );
  4642. // Support: IE<10
  4643. // Check if getElementById returns elements by name
  4644. // The broken getElementById methods don't pick up programmatically-set names,
  4645. // so use a roundabout getElementsByName test
  4646. support.getById = assert(function( el ) {
  4647. docElem.appendChild( el ).id = expando;
  4648. return !document.getElementsByName || !document.getElementsByName( expando ).length;
  4649. });
  4650. // ID filter and find
  4651. if ( support.getById ) {
  4652. Expr.filter["ID"] = function( id ) {
  4653. var attrId = id.replace( runescape, funescape );
  4654. return function( elem ) {
  4655. return elem.getAttribute("id") === attrId;
  4656. };
  4657. };
  4658. Expr.find["ID"] = function( id, context ) {
  4659. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  4660. var elem = context.getElementById( id );
  4661. return elem ? [ elem ] : [];
  4662. }
  4663. };
  4664. } else {
  4665. Expr.filter["ID"] = function( id ) {
  4666. var attrId = id.replace( runescape, funescape );
  4667. return function( elem ) {
  4668. var node = typeof elem.getAttributeNode !== "undefined" &&
  4669. elem.getAttributeNode("id");
  4670. return node && node.value === attrId;
  4671. };
  4672. };
  4673. // Support: IE 6 - 7 only
  4674. // getElementById is not reliable as a find shortcut
  4675. Expr.find["ID"] = function( id, context ) {
  4676. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  4677. var node, i, elems,
  4678. elem = context.getElementById( id );
  4679. if ( elem ) {
  4680. // Verify the id attribute
  4681. node = elem.getAttributeNode("id");
  4682. if ( node && node.value === id ) {
  4683. return [ elem ];
  4684. }
  4685. // Fall back on getElementsByName
  4686. elems = context.getElementsByName( id );
  4687. i = 0;
  4688. while ( (elem = elems[i++]) ) {
  4689. node = elem.getAttributeNode("id");
  4690. if ( node && node.value === id ) {
  4691. return [ elem ];
  4692. }
  4693. }
  4694. }
  4695. return [];
  4696. }
  4697. };
  4698. }
  4699. // Tag
  4700. Expr.find["TAG"] = support.getElementsByTagName ?
  4701. function( tag, context ) {
  4702. if ( typeof context.getElementsByTagName !== "undefined" ) {
  4703. return context.getElementsByTagName( tag );
  4704. // DocumentFragment nodes don't have gEBTN
  4705. } else if ( support.qsa ) {
  4706. return context.querySelectorAll( tag );
  4707. }
  4708. } :
  4709. function( tag, context ) {
  4710. var elem,
  4711. tmp = [],
  4712. i = 0,
  4713. // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
  4714. results = context.getElementsByTagName( tag );
  4715. // Filter out possible comments
  4716. if ( tag === "*" ) {
  4717. while ( (elem = results[i++]) ) {
  4718. if ( elem.nodeType === 1 ) {
  4719. tmp.push( elem );
  4720. }
  4721. }
  4722. return tmp;
  4723. }
  4724. return results;
  4725. };
  4726. // Class
  4727. Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
  4728. if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
  4729. return context.getElementsByClassName( className );
  4730. }
  4731. };
  4732. /* QSA/matchesSelector
  4733. ---------------------------------------------------------------------- */
  4734. // QSA and matchesSelector support
  4735. // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
  4736. rbuggyMatches = [];
  4737. // qSa(:focus) reports false when true (Chrome 21)
  4738. // We allow this because of a bug in IE8/9 that throws an error
  4739. // whenever `document.activeElement` is accessed on an iframe
  4740. // So, we allow :focus to pass through QSA all the time to avoid the IE error
  4741. // See https://bugs.jquery.com/ticket/13378
  4742. rbuggyQSA = [];
  4743. if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
  4744. // Build QSA regex
  4745. // Regex strategy adopted from Diego Perini
  4746. assert(function( el ) {
  4747. // Select is set to empty string on purpose
  4748. // This is to test IE's treatment of not explicitly
  4749. // setting a boolean content attribute,
  4750. // since its presence should be enough
  4751. // https://bugs.jquery.com/ticket/12359
  4752. docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
  4753. "<select id='" + expando + "-\r\\' msallowcapture=''>" +
  4754. "<option selected=''></option></select>";
  4755. // Support: IE8, Opera 11-12.16
  4756. // Nothing should be selected when empty strings follow ^= or $= or *=
  4757. // The test attribute must be unknown in Opera but "safe" for WinRT
  4758. // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
  4759. if ( el.querySelectorAll("[msallowcapture^='']").length ) {
  4760. rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
  4761. }
  4762. // Support: IE8
  4763. // Boolean attributes and "value" are not treated correctly
  4764. if ( !el.querySelectorAll("[selected]").length ) {
  4765. rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
  4766. }
  4767. // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
  4768. if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
  4769. rbuggyQSA.push("~=");
  4770. }
  4771. // Webkit/Opera - :checked should return selected option elements
  4772. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  4773. // IE8 throws error here and will not see later tests
  4774. if ( !el.querySelectorAll(":checked").length ) {
  4775. rbuggyQSA.push(":checked");
  4776. }
  4777. // Support: Safari 8+, iOS 8+
  4778. // https://bugs.webkit.org/show_bug.cgi?id=136851
  4779. // In-page `selector#id sibling-combinator selector` fails
  4780. if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
  4781. rbuggyQSA.push(".#.+[+~]");
  4782. }
  4783. });
  4784. assert(function( el ) {
  4785. el.innerHTML = "<a href='' disabled='disabled'></a>" +
  4786. "<select disabled='disabled'><option/></select>";
  4787. // Support: Windows 8 Native Apps
  4788. // The type and name attributes are restricted during .innerHTML assignment
  4789. var input = document.createElement("input");
  4790. input.setAttribute( "type", "hidden" );
  4791. el.appendChild( input ).setAttribute( "name", "D" );
  4792. // Support: IE8
  4793. // Enforce case-sensitivity of name attribute
  4794. if ( el.querySelectorAll("[name=d]").length ) {
  4795. rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
  4796. }
  4797. // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
  4798. // IE8 throws error here and will not see later tests
  4799. if ( el.querySelectorAll(":enabled").length !== 2 ) {
  4800. rbuggyQSA.push( ":enabled", ":disabled" );
  4801. }
  4802. // Support: IE9-11+
  4803. // IE's :disabled selector does not pick up the children of disabled fieldsets
  4804. docElem.appendChild( el ).disabled = true;
  4805. if ( el.querySelectorAll(":disabled").length !== 2 ) {
  4806. rbuggyQSA.push( ":enabled", ":disabled" );
  4807. }
  4808. // Opera 10-11 does not throw on post-comma invalid pseudos
  4809. el.querySelectorAll("*,:x");
  4810. rbuggyQSA.push(",.*:");
  4811. });
  4812. }
  4813. if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
  4814. docElem.webkitMatchesSelector ||
  4815. docElem.mozMatchesSelector ||
  4816. docElem.oMatchesSelector ||
  4817. docElem.msMatchesSelector) )) ) {
  4818. assert(function( el ) {
  4819. // Check to see if it's possible to do matchesSelector
  4820. // on a disconnected node (IE 9)
  4821. support.disconnectedMatch = matches.call( el, "*" );
  4822. // This should fail with an exception
  4823. // Gecko does not error, returns false instead
  4824. matches.call( el, "[s!='']:x" );
  4825. rbuggyMatches.push( "!=", pseudos );
  4826. });
  4827. }
  4828. rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
  4829. rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
  4830. /* Contains
  4831. ---------------------------------------------------------------------- */
  4832. hasCompare = rnative.test( docElem.compareDocumentPosition );
  4833. // Element contains another
  4834. // Purposefully self-exclusive
  4835. // As in, an element does not contain itself
  4836. contains = hasCompare || rnative.test( docElem.contains ) ?
  4837. function( a, b ) {
  4838. var adown = a.nodeType === 9 ? a.documentElement : a,
  4839. bup = b && b.parentNode;
  4840. return a === bup || !!( bup && bup.nodeType === 1 && (
  4841. adown.contains ?
  4842. adown.contains( bup ) :
  4843. a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
  4844. ));
  4845. } :
  4846. function( a, b ) {
  4847. if ( b ) {
  4848. while ( (b = b.parentNode) ) {
  4849. if ( b === a ) {
  4850. return true;
  4851. }
  4852. }
  4853. }
  4854. return false;
  4855. };
  4856. /* Sorting
  4857. ---------------------------------------------------------------------- */
  4858. // Document order sorting
  4859. sortOrder = hasCompare ?
  4860. function( a, b ) {
  4861. // Flag for duplicate removal
  4862. if ( a === b ) {
  4863. hasDuplicate = true;
  4864. return 0;
  4865. }
  4866. // Sort on method existence if only one input has compareDocumentPosition
  4867. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  4868. if ( compare ) {
  4869. return compare;
  4870. }
  4871. // Calculate position if both inputs belong to the same document
  4872. compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
  4873. a.compareDocumentPosition( b ) :
  4874. // Otherwise we know they are disconnected
  4875. 1;
  4876. // Disconnected nodes
  4877. if ( compare & 1 ||
  4878. (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
  4879. // Choose the first element that is related to our preferred document
  4880. if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
  4881. return -1;
  4882. }
  4883. if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
  4884. return 1;
  4885. }
  4886. // Maintain original order
  4887. return sortInput ?
  4888. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  4889. 0;
  4890. }
  4891. return compare & 4 ? -1 : 1;
  4892. } :
  4893. function( a, b ) {
  4894. // Exit early if the nodes are identical
  4895. if ( a === b ) {
  4896. hasDuplicate = true;
  4897. return 0;
  4898. }
  4899. var cur,
  4900. i = 0,
  4901. aup = a.parentNode,
  4902. bup = b.parentNode,
  4903. ap = [ a ],
  4904. bp = [ b ];
  4905. // Parentless nodes are either documents or disconnected
  4906. if ( !aup || !bup ) {
  4907. return a === document ? -1 :
  4908. b === document ? 1 :
  4909. aup ? -1 :
  4910. bup ? 1 :
  4911. sortInput ?
  4912. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  4913. 0;
  4914. // If the nodes are siblings, we can do a quick check
  4915. } else if ( aup === bup ) {
  4916. return siblingCheck( a, b );
  4917. }
  4918. // Otherwise we need full lists of their ancestors for comparison
  4919. cur = a;
  4920. while ( (cur = cur.parentNode) ) {
  4921. ap.unshift( cur );
  4922. }
  4923. cur = b;
  4924. while ( (cur = cur.parentNode) ) {
  4925. bp.unshift( cur );
  4926. }
  4927. // Walk down the tree looking for a discrepancy
  4928. while ( ap[i] === bp[i] ) {
  4929. i++;
  4930. }
  4931. return i ?
  4932. // Do a sibling check if the nodes have a common ancestor
  4933. siblingCheck( ap[i], bp[i] ) :
  4934. // Otherwise nodes in our document sort first
  4935. ap[i] === preferredDoc ? -1 :
  4936. bp[i] === preferredDoc ? 1 :
  4937. 0;
  4938. };
  4939. return document;
  4940. };
  4941. Sizzle.matches = function( expr, elements ) {
  4942. return Sizzle( expr, null, null, elements );
  4943. };
  4944. Sizzle.matchesSelector = function( elem, expr ) {
  4945. // Set document vars if needed
  4946. if ( ( elem.ownerDocument || elem ) !== document ) {
  4947. setDocument( elem );
  4948. }
  4949. // Make sure that attribute selectors are quoted
  4950. expr = expr.replace( rattributeQuotes, "='$1']" );
  4951. if ( support.matchesSelector && documentIsHTML &&
  4952. !compilerCache[ expr + " " ] &&
  4953. ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
  4954. ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
  4955. try {
  4956. var ret = matches.call( elem, expr );
  4957. // IE 9's matchesSelector returns false on disconnected nodes
  4958. if ( ret || support.disconnectedMatch ||
  4959. // As well, disconnected nodes are said to be in a document
  4960. // fragment in IE 9
  4961. elem.document && elem.document.nodeType !== 11 ) {
  4962. return ret;
  4963. }
  4964. } catch (e) {}
  4965. }
  4966. return Sizzle( expr, document, null, [ elem ] ).length > 0;
  4967. };
  4968. Sizzle.contains = function( context, elem ) {
  4969. // Set document vars if needed
  4970. if ( ( context.ownerDocument || context ) !== document ) {
  4971. setDocument( context );
  4972. }
  4973. return contains( context, elem );
  4974. };
  4975. Sizzle.attr = function( elem, name ) {
  4976. // Set document vars if needed
  4977. if ( ( elem.ownerDocument || elem ) !== document ) {
  4978. setDocument( elem );
  4979. }
  4980. var fn = Expr.attrHandle[ name.toLowerCase() ],
  4981. // Don't get fooled by Object.prototype properties (jQuery #13807)
  4982. val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
  4983. fn( elem, name, !documentIsHTML ) :
  4984. undefined;
  4985. return val !== undefined ?
  4986. val :
  4987. support.attributes || !documentIsHTML ?
  4988. elem.getAttribute( name ) :
  4989. (val = elem.getAttributeNode(name)) && val.specified ?
  4990. val.value :
  4991. null;
  4992. };
  4993. Sizzle.escape = function( sel ) {
  4994. return (sel + "").replace( rcssescape, fcssescape );
  4995. };
  4996. Sizzle.error = function( msg ) {
  4997. throw new Error( "Syntax error, unrecognized expression: " + msg );
  4998. };
  4999. /**
  5000. * Document sorting and removing duplicates
  5001. * @param {ArrayLike} results
  5002. */
  5003. Sizzle.uniqueSort = function( results ) {
  5004. var elem,
  5005. duplicates = [],
  5006. j = 0,
  5007. i = 0;
  5008. // Unless we *know* we can detect duplicates, assume their presence
  5009. hasDuplicate = !support.detectDuplicates;
  5010. sortInput = !support.sortStable && results.slice( 0 );
  5011. results.sort( sortOrder );
  5012. if ( hasDuplicate ) {
  5013. while ( (elem = results[i++]) ) {
  5014. if ( elem === results[ i ] ) {
  5015. j = duplicates.push( i );
  5016. }
  5017. }
  5018. while ( j-- ) {
  5019. results.splice( duplicates[ j ], 1 );
  5020. }
  5021. }
  5022. // Clear input after sorting to release objects
  5023. // See https://github.com/jquery/sizzle/pull/225
  5024. sortInput = null;
  5025. return results;
  5026. };
  5027. /**
  5028. * Utility function for retrieving the text value of an array of DOM nodes
  5029. * @param {Array|Element} elem
  5030. */
  5031. getText = Sizzle.getText = function( elem ) {
  5032. var node,
  5033. ret = "",
  5034. i = 0,
  5035. nodeType = elem.nodeType;
  5036. if ( !nodeType ) {
  5037. // If no nodeType, this is expected to be an array
  5038. while ( (node = elem[i++]) ) {
  5039. // Do not traverse comment nodes
  5040. ret += getText( node );
  5041. }
  5042. } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
  5043. // Use textContent for elements
  5044. // innerText usage removed for consistency of new lines (jQuery #11153)
  5045. if ( typeof elem.textContent === "string" ) {
  5046. return elem.textContent;
  5047. } else {
  5048. // Traverse its children
  5049. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  5050. ret += getText( elem );
  5051. }
  5052. }
  5053. } else if ( nodeType === 3 || nodeType === 4 ) {
  5054. return elem.nodeValue;
  5055. }
  5056. // Do not include comment or processing instruction nodes
  5057. return ret;
  5058. };
  5059. Expr = Sizzle.selectors = {
  5060. // Can be adjusted by the user
  5061. cacheLength: 50,
  5062. createPseudo: markFunction,
  5063. match: matchExpr,
  5064. attrHandle: {},
  5065. find: {},
  5066. relative: {
  5067. ">": { dir: "parentNode", first: true },
  5068. " ": { dir: "parentNode" },
  5069. "+": { dir: "previousSibling", first: true },
  5070. "~": { dir: "previousSibling" }
  5071. },
  5072. preFilter: {
  5073. "ATTR": function( match ) {
  5074. match[1] = match[1].replace( runescape, funescape );
  5075. // Move the given value to match[3] whether quoted or unquoted
  5076. match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
  5077. if ( match[2] === "~=" ) {
  5078. match[3] = " " + match[3] + " ";
  5079. }
  5080. return match.slice( 0, 4 );
  5081. },
  5082. "CHILD": function( match ) {
  5083. /* matches from matchExpr["CHILD"]
  5084. 1 type (only|nth|...)
  5085. 2 what (child|of-type)
  5086. 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
  5087. 4 xn-component of xn+y argument ([+-]?\d*n|)
  5088. 5 sign of xn-component
  5089. 6 x of xn-component
  5090. 7 sign of y-component
  5091. 8 y of y-component
  5092. */
  5093. match[1] = match[1].toLowerCase();
  5094. if ( match[1].slice( 0, 3 ) === "nth" ) {
  5095. // nth-* requires argument
  5096. if ( !match[3] ) {
  5097. Sizzle.error( match[0] );
  5098. }
  5099. // numeric x and y parameters for Expr.filter.CHILD
  5100. // remember that false/true cast respectively to 0/1
  5101. match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
  5102. match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
  5103. // other types prohibit arguments
  5104. } else if ( match[3] ) {
  5105. Sizzle.error( match[0] );
  5106. }
  5107. return match;
  5108. },
  5109. "PSEUDO": function( match ) {
  5110. var excess,
  5111. unquoted = !match[6] && match[2];
  5112. if ( matchExpr["CHILD"].test( match[0] ) ) {
  5113. return null;
  5114. }
  5115. // Accept quoted arguments as-is
  5116. if ( match[3] ) {
  5117. match[2] = match[4] || match[5] || "";
  5118. // Strip excess characters from unquoted arguments
  5119. } else if ( unquoted && rpseudo.test( unquoted ) &&
  5120. // Get excess from tokenize (recursively)
  5121. (excess = tokenize( unquoted, true )) &&
  5122. // advance to the next closing parenthesis
  5123. (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
  5124. // excess is a negative index
  5125. match[0] = match[0].slice( 0, excess );
  5126. match[2] = unquoted.slice( 0, excess );
  5127. }
  5128. // Return only captures needed by the pseudo filter method (type and argument)
  5129. return match.slice( 0, 3 );
  5130. }
  5131. },
  5132. filter: {
  5133. "TAG": function( nodeNameSelector ) {
  5134. var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
  5135. return nodeNameSelector === "*" ?
  5136. function() { return true; } :
  5137. function( elem ) {
  5138. return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
  5139. };
  5140. },
  5141. "CLASS": function( className ) {
  5142. var pattern = classCache[ className + " " ];
  5143. return pattern ||
  5144. (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
  5145. classCache( className, function( elem ) {
  5146. return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
  5147. });
  5148. },
  5149. "ATTR": function( name, operator, check ) {
  5150. return function( elem ) {
  5151. var result = Sizzle.attr( elem, name );
  5152. if ( result == null ) {
  5153. return operator === "!=";
  5154. }
  5155. if ( !operator ) {
  5156. return true;
  5157. }
  5158. result += "";
  5159. return operator === "=" ? result === check :
  5160. operator === "!=" ? result !== check :
  5161. operator === "^=" ? check && result.indexOf( check ) === 0 :
  5162. operator === "*=" ? check && result.indexOf( check ) > -1 :
  5163. operator === "$=" ? check && result.slice( -check.length ) === check :
  5164. operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
  5165. operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
  5166. false;
  5167. };
  5168. },
  5169. "CHILD": function( type, what, argument, first, last ) {
  5170. var simple = type.slice( 0, 3 ) !== "nth",
  5171. forward = type.slice( -4 ) !== "last",
  5172. ofType = what === "of-type";
  5173. return first === 1 && last === 0 ?
  5174. // Shortcut for :nth-*(n)
  5175. function( elem ) {
  5176. return !!elem.parentNode;
  5177. } :
  5178. function( elem, context, xml ) {
  5179. var cache, uniqueCache, outerCache, node, nodeIndex, start,
  5180. dir = simple !== forward ? "nextSibling" : "previousSibling",
  5181. parent = elem.parentNode,
  5182. name = ofType && elem.nodeName.toLowerCase(),
  5183. useCache = !xml && !ofType,
  5184. diff = false;
  5185. if ( parent ) {
  5186. // :(first|last|only)-(child|of-type)
  5187. if ( simple ) {
  5188. while ( dir ) {
  5189. node = elem;
  5190. while ( (node = node[ dir ]) ) {
  5191. if ( ofType ?
  5192. node.nodeName.toLowerCase() === name :
  5193. node.nodeType === 1 ) {
  5194. return false;
  5195. }
  5196. }
  5197. // Reverse direction for :only-* (if we haven't yet done so)
  5198. start = dir = type === "only" && !start && "nextSibling";
  5199. }
  5200. return true;
  5201. }
  5202. start = [ forward ? parent.firstChild : parent.lastChild ];
  5203. // non-xml :nth-child(...) stores cache data on `parent`
  5204. if ( forward && useCache ) {
  5205. // Seek `elem` from a previously-cached index
  5206. // ...in a gzip-friendly way
  5207. node = parent;
  5208. outerCache = node[ expando ] || (node[ expando ] = {});
  5209. // Support: IE <9 only
  5210. // Defend against cloned attroperties (jQuery gh-1709)
  5211. uniqueCache = outerCache[ node.uniqueID ] ||
  5212. (outerCache[ node.uniqueID ] = {});
  5213. cache = uniqueCache[ type ] || [];
  5214. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  5215. diff = nodeIndex && cache[ 2 ];
  5216. node = nodeIndex && parent.childNodes[ nodeIndex ];
  5217. while ( (node = ++nodeIndex && node && node[ dir ] ||
  5218. // Fallback to seeking `elem` from the start
  5219. (diff = nodeIndex = 0) || start.pop()) ) {
  5220. // When found, cache indexes on `parent` and break
  5221. if ( node.nodeType === 1 && ++diff && node === elem ) {
  5222. uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
  5223. break;
  5224. }
  5225. }
  5226. } else {
  5227. // Use previously-cached element index if available
  5228. if ( useCache ) {
  5229. // ...in a gzip-friendly way
  5230. node = elem;
  5231. outerCache = node[ expando ] || (node[ expando ] = {});
  5232. // Support: IE <9 only
  5233. // Defend against cloned attroperties (jQuery gh-1709)
  5234. uniqueCache = outerCache[ node.uniqueID ] ||
  5235. (outerCache[ node.uniqueID ] = {});
  5236. cache = uniqueCache[ type ] || [];
  5237. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  5238. diff = nodeIndex;
  5239. }
  5240. // xml :nth-child(...)
  5241. // or :nth-last-child(...) or :nth(-last)?-of-type(...)
  5242. if ( diff === false ) {
  5243. // Use the same loop as above to seek `elem` from the start
  5244. while ( (node = ++nodeIndex && node && node[ dir ] ||
  5245. (diff = nodeIndex = 0) || start.pop()) ) {
  5246. if ( ( ofType ?
  5247. node.nodeName.toLowerCase() === name :
  5248. node.nodeType === 1 ) &&
  5249. ++diff ) {
  5250. // Cache the index of each encountered element
  5251. if ( useCache ) {
  5252. outerCache = node[ expando ] || (node[ expando ] = {});
  5253. // Support: IE <9 only
  5254. // Defend against cloned attroperties (jQuery gh-1709)
  5255. uniqueCache = outerCache[ node.uniqueID ] ||
  5256. (outerCache[ node.uniqueID ] = {});
  5257. uniqueCache[ type ] = [ dirruns, diff ];
  5258. }
  5259. if ( node === elem ) {
  5260. break;
  5261. }
  5262. }
  5263. }
  5264. }
  5265. }
  5266. // Incorporate the offset, then check against cycle size
  5267. diff -= last;
  5268. return diff === first || ( diff % first === 0 && diff / first >= 0 );
  5269. }
  5270. };
  5271. },
  5272. "PSEUDO": function( pseudo, argument ) {
  5273. // pseudo-class names are case-insensitive
  5274. // http://www.w3.org/TR/selectors/#pseudo-classes
  5275. // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
  5276. // Remember that setFilters inherits from pseudos
  5277. var args,
  5278. fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
  5279. Sizzle.error( "unsupported pseudo: " + pseudo );
  5280. // The user may use createPseudo to indicate that
  5281. // arguments are needed to create the filter function
  5282. // just as Sizzle does
  5283. if ( fn[ expando ] ) {
  5284. return fn( argument );
  5285. }
  5286. // But maintain support for old signatures
  5287. if ( fn.length > 1 ) {
  5288. args = [ pseudo, pseudo, "", argument ];
  5289. return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
  5290. markFunction(function( seed, matches ) {
  5291. var idx,
  5292. matched = fn( seed, argument ),
  5293. i = matched.length;
  5294. while ( i-- ) {
  5295. idx = indexOf( seed, matched[i] );
  5296. seed[ idx ] = !( matches[ idx ] = matched[i] );
  5297. }
  5298. }) :
  5299. function( elem ) {
  5300. return fn( elem, 0, args );
  5301. };
  5302. }
  5303. return fn;
  5304. }
  5305. },
  5306. pseudos: {
  5307. // Potentially complex pseudos
  5308. "not": markFunction(function( selector ) {
  5309. // Trim the selector passed to compile
  5310. // to avoid treating leading and trailing
  5311. // spaces as combinators
  5312. var input = [],
  5313. results = [],
  5314. matcher = compile( selector.replace( rtrim, "$1" ) );
  5315. return matcher[ expando ] ?
  5316. markFunction(function( seed, matches, context, xml ) {
  5317. var elem,
  5318. unmatched = matcher( seed, null, xml, [] ),
  5319. i = seed.length;
  5320. // Match elements unmatched by `matcher`
  5321. while ( i-- ) {
  5322. if ( (elem = unmatched[i]) ) {
  5323. seed[i] = !(matches[i] = elem);
  5324. }
  5325. }
  5326. }) :
  5327. function( elem, context, xml ) {
  5328. input[0] = elem;
  5329. matcher( input, null, xml, results );
  5330. // Don't keep the element (issue #299)
  5331. input[0] = null;
  5332. return !results.pop();
  5333. };
  5334. }),
  5335. "has": markFunction(function( selector ) {
  5336. return function( elem ) {
  5337. return Sizzle( selector, elem ).length > 0;
  5338. };
  5339. }),
  5340. "contains": markFunction(function( text ) {
  5341. text = text.replace( runescape, funescape );
  5342. return function( elem ) {
  5343. return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
  5344. };
  5345. }),
  5346. // "Whether an element is represented by a :lang() selector
  5347. // is based solely on the element's language value
  5348. // being equal to the identifier C,
  5349. // or beginning with the identifier C immediately followed by "-".
  5350. // The matching of C against the element's language value is performed case-insensitively.
  5351. // The identifier C does not have to be a valid language name."
  5352. // http://www.w3.org/TR/selectors/#lang-pseudo
  5353. "lang": markFunction( function( lang ) {
  5354. // lang value must be a valid identifier
  5355. if ( !ridentifier.test(lang || "") ) {
  5356. Sizzle.error( "unsupported lang: " + lang );
  5357. }
  5358. lang = lang.replace( runescape, funescape ).toLowerCase();
  5359. return function( elem ) {
  5360. var elemLang;
  5361. do {
  5362. if ( (elemLang = documentIsHTML ?
  5363. elem.lang :
  5364. elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
  5365. elemLang = elemLang.toLowerCase();
  5366. return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
  5367. }
  5368. } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
  5369. return false;
  5370. };
  5371. }),
  5372. // Miscellaneous
  5373. "target": function( elem ) {
  5374. var hash = window.location && window.location.hash;
  5375. return hash && hash.slice( 1 ) === elem.id;
  5376. },
  5377. "root": function( elem ) {
  5378. return elem === docElem;
  5379. },
  5380. "focus": function( elem ) {
  5381. return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
  5382. },
  5383. // Boolean properties
  5384. "enabled": createDisabledPseudo( false ),
  5385. "disabled": createDisabledPseudo( true ),
  5386. "checked": function( elem ) {
  5387. // In CSS3, :checked should return both checked and selected elements
  5388. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  5389. var nodeName = elem.nodeName.toLowerCase();
  5390. return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
  5391. },
  5392. "selected": function( elem ) {
  5393. // Accessing this property makes selected-by-default
  5394. // options in Safari work properly
  5395. if ( elem.parentNode ) {
  5396. elem.parentNode.selectedIndex;
  5397. }
  5398. return elem.selected === true;
  5399. },
  5400. // Contents
  5401. "empty": function( elem ) {
  5402. // http://www.w3.org/TR/selectors/#empty-pseudo
  5403. // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
  5404. // but not by others (comment: 8; processing instruction: 7; etc.)
  5405. // nodeType < 6 works because attributes (2) do not appear as children
  5406. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  5407. if ( elem.nodeType < 6 ) {
  5408. return false;
  5409. }
  5410. }
  5411. return true;
  5412. },
  5413. "parent": function( elem ) {
  5414. return !Expr.pseudos["empty"]( elem );
  5415. },
  5416. // Element/input types
  5417. "header": function( elem ) {
  5418. return rheader.test( elem.nodeName );
  5419. },
  5420. "input": function( elem ) {
  5421. return rinputs.test( elem.nodeName );
  5422. },
  5423. "button": function( elem ) {
  5424. var name = elem.nodeName.toLowerCase();
  5425. return name === "input" && elem.type === "button" || name === "button";
  5426. },
  5427. "text": function( elem ) {
  5428. var attr;
  5429. return elem.nodeName.toLowerCase() === "input" &&
  5430. elem.type === "text" &&
  5431. // Support: IE<8
  5432. // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
  5433. ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
  5434. },
  5435. // Position-in-collection
  5436. "first": createPositionalPseudo(function() {
  5437. return [ 0 ];
  5438. }),
  5439. "last": createPositionalPseudo(function( matchIndexes, length ) {
  5440. return [ length - 1 ];
  5441. }),
  5442. "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
  5443. return [ argument < 0 ? argument + length : argument ];
  5444. }),
  5445. "even": createPositionalPseudo(function( matchIndexes, length ) {
  5446. var i = 0;
  5447. for ( ; i < length; i += 2 ) {
  5448. matchIndexes.push( i );
  5449. }
  5450. return matchIndexes;
  5451. }),
  5452. "odd": createPositionalPseudo(function( matchIndexes, length ) {
  5453. var i = 1;
  5454. for ( ; i < length; i += 2 ) {
  5455. matchIndexes.push( i );
  5456. }
  5457. return matchIndexes;
  5458. }),
  5459. "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  5460. var i = argument < 0 ? argument + length : argument;
  5461. for ( ; --i >= 0; ) {
  5462. matchIndexes.push( i );
  5463. }
  5464. return matchIndexes;
  5465. }),
  5466. "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  5467. var i = argument < 0 ? argument + length : argument;
  5468. for ( ; ++i < length; ) {
  5469. matchIndexes.push( i );
  5470. }
  5471. return matchIndexes;
  5472. })
  5473. }
  5474. };
  5475. Expr.pseudos["nth"] = Expr.pseudos["eq"];
  5476. // Add button/input type pseudos
  5477. for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
  5478. Expr.pseudos[ i ] = createInputPseudo( i );
  5479. }
  5480. for ( i in { submit: true, reset: true } ) {
  5481. Expr.pseudos[ i ] = createButtonPseudo( i );
  5482. }
  5483. // Easy API for creating new setFilters
  5484. function setFilters() {}
  5485. setFilters.prototype = Expr.filters = Expr.pseudos;
  5486. Expr.setFilters = new setFilters();
  5487. tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
  5488. var matched, match, tokens, type,
  5489. soFar, groups, preFilters,
  5490. cached = tokenCache[ selector + " " ];
  5491. if ( cached ) {
  5492. return parseOnly ? 0 : cached.slice( 0 );
  5493. }
  5494. soFar = selector;
  5495. groups = [];
  5496. preFilters = Expr.preFilter;
  5497. while ( soFar ) {
  5498. // Comma and first run
  5499. if ( !matched || (match = rcomma.exec( soFar )) ) {
  5500. if ( match ) {
  5501. // Don't consume trailing commas as valid
  5502. soFar = soFar.slice( match[0].length ) || soFar;
  5503. }
  5504. groups.push( (tokens = []) );
  5505. }
  5506. matched = false;
  5507. // Combinators
  5508. if ( (match = rcombinators.exec( soFar )) ) {
  5509. matched = match.shift();
  5510. tokens.push({
  5511. value: matched,
  5512. // Cast descendant combinators to space
  5513. type: match[0].replace( rtrim, " " )
  5514. });
  5515. soFar = soFar.slice( matched.length );
  5516. }
  5517. // Filters
  5518. for ( type in Expr.filter ) {
  5519. if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
  5520. (match = preFilters[ type ]( match ))) ) {
  5521. matched = match.shift();
  5522. tokens.push({
  5523. value: matched,
  5524. type: type,
  5525. matches: match
  5526. });
  5527. soFar = soFar.slice( matched.length );
  5528. }
  5529. }
  5530. if ( !matched ) {
  5531. break;
  5532. }
  5533. }
  5534. // Return the length of the invalid excess
  5535. // if we're just parsing
  5536. // Otherwise, throw an error or return tokens
  5537. return parseOnly ?
  5538. soFar.length :
  5539. soFar ?
  5540. Sizzle.error( selector ) :
  5541. // Cache the tokens
  5542. tokenCache( selector, groups ).slice( 0 );
  5543. };
  5544. function toSelector( tokens ) {
  5545. var i = 0,
  5546. len = tokens.length,
  5547. selector = "";
  5548. for ( ; i < len; i++ ) {
  5549. selector += tokens[i].value;
  5550. }
  5551. return selector;
  5552. }
  5553. function addCombinator( matcher, combinator, base ) {
  5554. var dir = combinator.dir,
  5555. skip = combinator.next,
  5556. key = skip || dir,
  5557. checkNonElements = base && key === "parentNode",
  5558. doneName = done++;
  5559. return combinator.first ?
  5560. // Check against closest ancestor/preceding element
  5561. function( elem, context, xml ) {
  5562. while ( (elem = elem[ dir ]) ) {
  5563. if ( elem.nodeType === 1 || checkNonElements ) {
  5564. return matcher( elem, context, xml );
  5565. }
  5566. }
  5567. return false;
  5568. } :
  5569. // Check against all ancestor/preceding elements
  5570. function( elem, context, xml ) {
  5571. var oldCache, uniqueCache, outerCache,
  5572. newCache = [ dirruns, doneName ];
  5573. // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
  5574. if ( xml ) {
  5575. while ( (elem = elem[ dir ]) ) {
  5576. if ( elem.nodeType === 1 || checkNonElements ) {
  5577. if ( matcher( elem, context, xml ) ) {
  5578. return true;
  5579. }
  5580. }
  5581. }
  5582. } else {
  5583. while ( (elem = elem[ dir ]) ) {
  5584. if ( elem.nodeType === 1 || checkNonElements ) {
  5585. outerCache = elem[ expando ] || (elem[ expando ] = {});
  5586. // Support: IE <9 only
  5587. // Defend against cloned attroperties (jQuery gh-1709)
  5588. uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
  5589. if ( skip && skip === elem.nodeName.toLowerCase() ) {
  5590. elem = elem[ dir ] || elem;
  5591. } else if ( (oldCache = uniqueCache[ key ]) &&
  5592. oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
  5593. // Assign to newCache so results back-propagate to previous elements
  5594. return (newCache[ 2 ] = oldCache[ 2 ]);
  5595. } else {
  5596. // Reuse newcache so results back-propagate to previous elements
  5597. uniqueCache[ key ] = newCache;
  5598. // A match means we're done; a fail means we have to keep checking
  5599. if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
  5600. return true;
  5601. }
  5602. }
  5603. }
  5604. }
  5605. }
  5606. return false;
  5607. };
  5608. }
  5609. function elementMatcher( matchers ) {
  5610. return matchers.length > 1 ?
  5611. function( elem, context, xml ) {
  5612. var i = matchers.length;
  5613. while ( i-- ) {
  5614. if ( !matchers[i]( elem, context, xml ) ) {
  5615. return false;
  5616. }
  5617. }
  5618. return true;
  5619. } :
  5620. matchers[0];
  5621. }
  5622. function multipleContexts( selector, contexts, results ) {
  5623. var i = 0,
  5624. len = contexts.length;
  5625. for ( ; i < len; i++ ) {
  5626. Sizzle( selector, contexts[i], results );
  5627. }
  5628. return results;
  5629. }
  5630. function condense( unmatched, map, filter, context, xml ) {
  5631. var elem,
  5632. newUnmatched = [],
  5633. i = 0,
  5634. len = unmatched.length,
  5635. mapped = map != null;
  5636. for ( ; i < len; i++ ) {
  5637. if ( (elem = unmatched[i]) ) {
  5638. if ( !filter || filter( elem, context, xml ) ) {
  5639. newUnmatched.push( elem );
  5640. if ( mapped ) {
  5641. map.push( i );
  5642. }
  5643. }
  5644. }
  5645. }
  5646. return newUnmatched;
  5647. }
  5648. function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
  5649. if ( postFilter && !postFilter[ expando ] ) {
  5650. postFilter = setMatcher( postFilter );
  5651. }
  5652. if ( postFinder && !postFinder[ expando ] ) {
  5653. postFinder = setMatcher( postFinder, postSelector );
  5654. }
  5655. return markFunction(function( seed, results, context, xml ) {
  5656. var temp, i, elem,
  5657. preMap = [],
  5658. postMap = [],
  5659. preexisting = results.length,
  5660. // Get initial elements from seed or context
  5661. elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
  5662. // Prefilter to get matcher input, preserving a map for seed-results synchronization
  5663. matcherIn = preFilter && ( seed || !selector ) ?
  5664. condense( elems, preMap, preFilter, context, xml ) :
  5665. elems,
  5666. matcherOut = matcher ?
  5667. // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
  5668. postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
  5669. // ...intermediate processing is necessary
  5670. [] :
  5671. // ...otherwise use results directly
  5672. results :
  5673. matcherIn;
  5674. // Find primary matches
  5675. if ( matcher ) {
  5676. matcher( matcherIn, matcherOut, context, xml );
  5677. }
  5678. // Apply postFilter
  5679. if ( postFilter ) {
  5680. temp = condense( matcherOut, postMap );
  5681. postFilter( temp, [], context, xml );
  5682. // Un-match failing elements by moving them back to matcherIn
  5683. i = temp.length;
  5684. while ( i-- ) {
  5685. if ( (elem = temp[i]) ) {
  5686. matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
  5687. }
  5688. }
  5689. }
  5690. if ( seed ) {
  5691. if ( postFinder || preFilter ) {
  5692. if ( postFinder ) {
  5693. // Get the final matcherOut by condensing this intermediate into postFinder contexts
  5694. temp = [];
  5695. i = matcherOut.length;
  5696. while ( i-- ) {
  5697. if ( (elem = matcherOut[i]) ) {
  5698. // Restore matcherIn since elem is not yet a final match
  5699. temp.push( (matcherIn[i] = elem) );
  5700. }
  5701. }
  5702. postFinder( null, (matcherOut = []), temp, xml );
  5703. }
  5704. // Move matched elements from seed to results to keep them synchronized
  5705. i = matcherOut.length;
  5706. while ( i-- ) {
  5707. if ( (elem = matcherOut[i]) &&
  5708. (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
  5709. seed[temp] = !(results[temp] = elem);
  5710. }
  5711. }
  5712. }
  5713. // Add elements to results, through postFinder if defined
  5714. } else {
  5715. matcherOut = condense(
  5716. matcherOut === results ?
  5717. matcherOut.splice( preexisting, matcherOut.length ) :
  5718. matcherOut
  5719. );
  5720. if ( postFinder ) {
  5721. postFinder( null, results, matcherOut, xml );
  5722. } else {
  5723. push.apply( results, matcherOut );
  5724. }
  5725. }
  5726. });
  5727. }
  5728. function matcherFromTokens( tokens ) {
  5729. var checkContext, matcher, j,
  5730. len = tokens.length,
  5731. leadingRelative = Expr.relative[ tokens[0].type ],
  5732. implicitRelative = leadingRelative || Expr.relative[" "],
  5733. i = leadingRelative ? 1 : 0,
  5734. // The foundational matcher ensures that elements are reachable from top-level context(s)
  5735. matchContext = addCombinator( function( elem ) {
  5736. return elem === checkContext;
  5737. }, implicitRelative, true ),
  5738. matchAnyContext = addCombinator( function( elem ) {
  5739. return indexOf( checkContext, elem ) > -1;
  5740. }, implicitRelative, true ),
  5741. matchers = [ function( elem, context, xml ) {
  5742. var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
  5743. (checkContext = context).nodeType ?
  5744. matchContext( elem, context, xml ) :
  5745. matchAnyContext( elem, context, xml ) );
  5746. // Avoid hanging onto element (issue #299)
  5747. checkContext = null;
  5748. return ret;
  5749. } ];
  5750. for ( ; i < len; i++ ) {
  5751. if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
  5752. matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
  5753. } else {
  5754. matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
  5755. // Return special upon seeing a positional matcher
  5756. if ( matcher[ expando ] ) {
  5757. // Find the next relative operator (if any) for proper handling
  5758. j = ++i;
  5759. for ( ; j < len; j++ ) {
  5760. if ( Expr.relative[ tokens[j].type ] ) {
  5761. break;
  5762. }
  5763. }
  5764. return setMatcher(
  5765. i > 1 && elementMatcher( matchers ),
  5766. i > 1 && toSelector(
  5767. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  5768. tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
  5769. ).replace( rtrim, "$1" ),
  5770. matcher,
  5771. i < j && matcherFromTokens( tokens.slice( i, j ) ),
  5772. j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
  5773. j < len && toSelector( tokens )
  5774. );
  5775. }
  5776. matchers.push( matcher );
  5777. }
  5778. }
  5779. return elementMatcher( matchers );
  5780. }
  5781. function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  5782. var bySet = setMatchers.length > 0,
  5783. byElement = elementMatchers.length > 0,
  5784. superMatcher = function( seed, context, xml, results, outermost ) {
  5785. var elem, j, matcher,
  5786. matchedCount = 0,
  5787. i = "0",
  5788. unmatched = seed && [],
  5789. setMatched = [],
  5790. contextBackup = outermostContext,
  5791. // We must always have either seed elements or outermost context
  5792. elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
  5793. // Use integer dirruns iff this is the outermost matcher
  5794. dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
  5795. len = elems.length;
  5796. if ( outermost ) {
  5797. outermostContext = context === document || context || outermost;
  5798. }
  5799. // Add elements passing elementMatchers directly to results
  5800. // Support: IE<9, Safari
  5801. // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
  5802. for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
  5803. if ( byElement && elem ) {
  5804. j = 0;
  5805. if ( !context && elem.ownerDocument !== document ) {
  5806. setDocument( elem );
  5807. xml = !documentIsHTML;
  5808. }
  5809. while ( (matcher = elementMatchers[j++]) ) {
  5810. if ( matcher( elem, context || document, xml) ) {
  5811. results.push( elem );
  5812. break;
  5813. }
  5814. }
  5815. if ( outermost ) {
  5816. dirruns = dirrunsUnique;
  5817. }
  5818. }
  5819. // Track unmatched elements for set filters
  5820. if ( bySet ) {
  5821. // They will have gone through all possible matchers
  5822. if ( (elem = !matcher && elem) ) {
  5823. matchedCount--;
  5824. }
  5825. // Lengthen the array for every element, matched or not
  5826. if ( seed ) {
  5827. unmatched.push( elem );
  5828. }
  5829. }
  5830. }
  5831. // `i` is now the count of elements visited above, and adding it to `matchedCount`
  5832. // makes the latter nonnegative.
  5833. matchedCount += i;
  5834. // Apply set filters to unmatched elements
  5835. // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
  5836. // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
  5837. // no element matchers and no seed.
  5838. // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
  5839. // case, which will result in a "00" `matchedCount` that differs from `i` but is also
  5840. // numerically zero.
  5841. if ( bySet && i !== matchedCount ) {
  5842. j = 0;
  5843. while ( (matcher = setMatchers[j++]) ) {
  5844. matcher( unmatched, setMatched, context, xml );
  5845. }
  5846. if ( seed ) {
  5847. // Reintegrate element matches to eliminate the need for sorting
  5848. if ( matchedCount > 0 ) {
  5849. while ( i-- ) {
  5850. if ( !(unmatched[i] || setMatched[i]) ) {
  5851. setMatched[i] = pop.call( results );
  5852. }
  5853. }
  5854. }
  5855. // Discard index placeholder values to get only actual matches
  5856. setMatched = condense( setMatched );
  5857. }
  5858. // Add matches to results
  5859. push.apply( results, setMatched );
  5860. // Seedless set matches succeeding multiple successful matchers stipulate sorting
  5861. if ( outermost && !seed && setMatched.length > 0 &&
  5862. ( matchedCount + setMatchers.length ) > 1 ) {
  5863. Sizzle.uniqueSort( results );
  5864. }
  5865. }
  5866. // Override manipulation of globals by nested matchers
  5867. if ( outermost ) {
  5868. dirruns = dirrunsUnique;
  5869. outermostContext = contextBackup;
  5870. }
  5871. return unmatched;
  5872. };
  5873. return bySet ?
  5874. markFunction( superMatcher ) :
  5875. superMatcher;
  5876. }
  5877. compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
  5878. var i,
  5879. setMatchers = [],
  5880. elementMatchers = [],
  5881. cached = compilerCache[ selector + " " ];
  5882. if ( !cached ) {
  5883. // Generate a function of recursive functions that can be used to check each element
  5884. if ( !match ) {
  5885. match = tokenize( selector );
  5886. }
  5887. i = match.length;
  5888. while ( i-- ) {
  5889. cached = matcherFromTokens( match[i] );
  5890. if ( cached[ expando ] ) {
  5891. setMatchers.push( cached );
  5892. } else {
  5893. elementMatchers.push( cached );
  5894. }
  5895. }
  5896. // Cache the compiled function
  5897. cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
  5898. // Save selector and tokenization
  5899. cached.selector = selector;
  5900. }
  5901. return cached;
  5902. };
  5903. /**
  5904. * A low-level selection function that works with Sizzle's compiled
  5905. * selector functions
  5906. * @param {String|Function} selector A selector or a pre-compiled
  5907. * selector function built with Sizzle.compile
  5908. * @param {Element} context
  5909. * @param {Array} [results]
  5910. * @param {Array} [seed] A set of elements to match against
  5911. */
  5912. select = Sizzle.select = function( selector, context, results, seed ) {
  5913. var i, tokens, token, type, find,
  5914. compiled = typeof selector === "function" && selector,
  5915. match = !seed && tokenize( (selector = compiled.selector || selector) );
  5916. results = results || [];
  5917. // Try to minimize operations if there is only one selector in the list and no seed
  5918. // (the latter of which guarantees us context)
  5919. if ( match.length === 1 ) {
  5920. // Reduce context if the leading compound selector is an ID
  5921. tokens = match[0] = match[0].slice( 0 );
  5922. if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
  5923. context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
  5924. context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
  5925. if ( !context ) {
  5926. return results;
  5927. // Precompiled matchers will still verify ancestry, so step up a level
  5928. } else if ( compiled ) {
  5929. context = context.parentNode;
  5930. }
  5931. selector = selector.slice( tokens.shift().value.length );
  5932. }
  5933. // Fetch a seed set for right-to-left matching
  5934. i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
  5935. while ( i-- ) {
  5936. token = tokens[i];
  5937. // Abort if we hit a combinator
  5938. if ( Expr.relative[ (type = token.type) ] ) {
  5939. break;
  5940. }
  5941. if ( (find = Expr.find[ type ]) ) {
  5942. // Search, expanding context for leading sibling combinators
  5943. if ( (seed = find(
  5944. token.matches[0].replace( runescape, funescape ),
  5945. rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
  5946. )) ) {
  5947. // If seed is empty or no tokens remain, we can return early
  5948. tokens.splice( i, 1 );
  5949. selector = seed.length && toSelector( tokens );
  5950. if ( !selector ) {
  5951. push.apply( results, seed );
  5952. return results;
  5953. }
  5954. break;
  5955. }
  5956. }
  5957. }
  5958. }
  5959. // Compile and execute a filtering function if one is not provided
  5960. // Provide `match` to avoid retokenization if we modified the selector above
  5961. ( compiled || compile( selector, match ) )(
  5962. seed,
  5963. context,
  5964. !documentIsHTML,
  5965. results,
  5966. !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
  5967. );
  5968. return results;
  5969. };
  5970. // One-time assignments
  5971. // Sort stability
  5972. support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
  5973. // Support: Chrome 14-35+
  5974. // Always assume duplicates if they aren't passed to the comparison function
  5975. support.detectDuplicates = !!hasDuplicate;
  5976. // Initialize against the default document
  5977. setDocument();
  5978. // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
  5979. // Detached nodes confoundingly follow *each other*
  5980. support.sortDetached = assert(function( el ) {
  5981. // Should return 1, but returns 4 (following)
  5982. return el.compareDocumentPosition( document.createElement("fieldset") ) & 1;
  5983. });
  5984. // Support: IE<8
  5985. // Prevent attribute/property "interpolation"
  5986. // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
  5987. if ( !assert(function( el ) {
  5988. el.innerHTML = "<a href='#'></a>";
  5989. return el.firstChild.getAttribute("href") === "#" ;
  5990. }) ) {
  5991. addHandle( "type|href|height|width", function( elem, name, isXML ) {
  5992. if ( !isXML ) {
  5993. return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
  5994. }
  5995. });
  5996. }
  5997. // Support: IE<9
  5998. // Use defaultValue in place of getAttribute("value")
  5999. if ( !support.attributes || !assert(function( el ) {
  6000. el.innerHTML = "<input/>";
  6001. el.firstChild.setAttribute( "value", "" );
  6002. return el.firstChild.getAttribute( "value" ) === "";
  6003. }) ) {
  6004. addHandle( "value", function( elem, name, isXML ) {
  6005. if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
  6006. return elem.defaultValue;
  6007. }
  6008. });
  6009. }
  6010. // Support: IE<9
  6011. // Use getAttributeNode to fetch booleans when getAttribute lies
  6012. if ( !assert(function( el ) {
  6013. return el.getAttribute("disabled") == null;
  6014. }) ) {
  6015. addHandle( booleans, function( elem, name, isXML ) {
  6016. var val;
  6017. if ( !isXML ) {
  6018. return elem[ name ] === true ? name.toLowerCase() :
  6019. (val = elem.getAttributeNode( name )) && val.specified ?
  6020. val.value :
  6021. null;
  6022. }
  6023. });
  6024. }
  6025. return Sizzle;
  6026. })( window );
  6027. jQuery.find = Sizzle;
  6028. jQuery.expr = Sizzle.selectors;
  6029. // Deprecated
  6030. jQuery.expr[ ":" ] = jQuery.expr.pseudos;
  6031. jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
  6032. jQuery.text = Sizzle.getText;
  6033. jQuery.isXMLDoc = Sizzle.isXML;
  6034. jQuery.contains = Sizzle.contains;
  6035. jQuery.escapeSelector = Sizzle.escape;
  6036. var dir = function( elem, dir, until ) {
  6037. var matched = [],
  6038. truncate = until !== undefined;
  6039. while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
  6040. if ( elem.nodeType === 1 ) {
  6041. if ( truncate && jQuery( elem ).is( until ) ) {
  6042. break;
  6043. }
  6044. matched.push( elem );
  6045. }
  6046. }
  6047. return matched;
  6048. };
  6049. var siblings = function( n, elem ) {
  6050. var matched = [];
  6051. for ( ; n; n = n.nextSibling ) {
  6052. if ( n.nodeType === 1 && n !== elem ) {
  6053. matched.push( n );
  6054. }
  6055. }
  6056. return matched;
  6057. };
  6058. var rneedsContext = jQuery.expr.match.needsContext;
  6059. var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
  6060. var risSimple = /^.[^:#\[\.,]*$/;
  6061. // Implement the identical functionality for filter and not
  6062. function winnow( elements, qualifier, not ) {
  6063. if ( jQuery.isFunction( qualifier ) ) {
  6064. return jQuery.grep( elements, function( elem, i ) {
  6065. return !!qualifier.call( elem, i, elem ) !== not;
  6066. } );
  6067. }
  6068. // Single element
  6069. if ( qualifier.nodeType ) {
  6070. return jQuery.grep( elements, function( elem ) {
  6071. return ( elem === qualifier ) !== not;
  6072. } );
  6073. }
  6074. // Arraylike of elements (jQuery, arguments, Array)
  6075. if ( typeof qualifier !== "string" ) {
  6076. return jQuery.grep( elements, function( elem ) {
  6077. return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
  6078. } );
  6079. }
  6080. // Simple selector that can be filtered directly, removing non-Elements
  6081. if ( risSimple.test( qualifier ) ) {
  6082. return jQuery.filter( qualifier, elements, not );
  6083. }
  6084. // Complex selector, compare the two sets, removing non-Elements
  6085. qualifier = jQuery.filter( qualifier, elements );
  6086. return jQuery.grep( elements, function( elem ) {
  6087. return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1;
  6088. } );
  6089. }
  6090. jQuery.filter = function( expr, elems, not ) {
  6091. var elem = elems[ 0 ];
  6092. if ( not ) {
  6093. expr = ":not(" + expr + ")";
  6094. }
  6095. if ( elems.length === 1 && elem.nodeType === 1 ) {
  6096. return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
  6097. }
  6098. return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
  6099. return elem.nodeType === 1;
  6100. } ) );
  6101. };
  6102. jQuery.fn.extend( {
  6103. find: function( selector ) {
  6104. var i, ret,
  6105. len = this.length,
  6106. self = this;
  6107. if ( typeof selector !== "string" ) {
  6108. return this.pushStack( jQuery( selector ).filter( function() {
  6109. for ( i = 0; i < len; i++ ) {
  6110. if ( jQuery.contains( self[ i ], this ) ) {
  6111. return true;
  6112. }
  6113. }
  6114. } ) );
  6115. }
  6116. ret = this.pushStack( [] );
  6117. for ( i = 0; i < len; i++ ) {
  6118. jQuery.find( selector, self[ i ], ret );
  6119. }
  6120. return len > 1 ? jQuery.uniqueSort( ret ) : ret;
  6121. },
  6122. filter: function( selector ) {
  6123. return this.pushStack( winnow( this, selector || [], false ) );
  6124. },
  6125. not: function( selector ) {
  6126. return this.pushStack( winnow( this, selector || [], true ) );
  6127. },
  6128. is: function( selector ) {
  6129. return !!winnow(
  6130. this,
  6131. // If this is a positional/relative selector, check membership in the returned set
  6132. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  6133. typeof selector === "string" && rneedsContext.test( selector ) ?
  6134. jQuery( selector ) :
  6135. selector || [],
  6136. false
  6137. ).length;
  6138. }
  6139. } );
  6140. // Initialize a jQuery object
  6141. // A central reference to the root jQuery(document)
  6142. var rootjQuery,
  6143. // A simple way to check for HTML strings
  6144. // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
  6145. // Strict HTML recognition (#11290: must start with <)
  6146. // Shortcut simple #id case for speed
  6147. rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
  6148. init = jQuery.fn.init = function( selector, context, root ) {
  6149. var match, elem;
  6150. // HANDLE: $(""), $(null), $(undefined), $(false)
  6151. if ( !selector ) {
  6152. return this;
  6153. }
  6154. // Method init() accepts an alternate rootjQuery
  6155. // so migrate can support jQuery.sub (gh-2101)
  6156. root = root || rootjQuery;
  6157. // Handle HTML strings
  6158. if ( typeof selector === "string" ) {
  6159. if ( selector[ 0 ] === "<" &&
  6160. selector[ selector.length - 1 ] === ">" &&
  6161. selector.length >= 3 ) {
  6162. // Assume that strings that start and end with <> are HTML and skip the regex check
  6163. match = [ null, selector, null ];
  6164. } else {
  6165. match = rquickExpr.exec( selector );
  6166. }
  6167. // Match html or make sure no context is specified for #id
  6168. if ( match && ( match[ 1 ] || !context ) ) {
  6169. // HANDLE: $(html) -> $(array)
  6170. if ( match[ 1 ] ) {
  6171. context = context instanceof jQuery ? context[ 0 ] : context;
  6172. // Option to run scripts is true for back-compat
  6173. // Intentionally let the error be thrown if parseHTML is not present
  6174. jQuery.merge( this, jQuery.parseHTML(
  6175. match[ 1 ],
  6176. context && context.nodeType ? context.ownerDocument || context : document,
  6177. true
  6178. ) );
  6179. // HANDLE: $(html, props)
  6180. if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
  6181. for ( match in context ) {
  6182. // Properties of context are called as methods if possible
  6183. if ( jQuery.isFunction( this[ match ] ) ) {
  6184. this[ match ]( context[ match ] );
  6185. // ...and otherwise set as attributes
  6186. } else {
  6187. this.attr( match, context[ match ] );
  6188. }
  6189. }
  6190. }
  6191. return this;
  6192. // HANDLE: $(#id)
  6193. } else {
  6194. elem = document.getElementById( match[ 2 ] );
  6195. if ( elem ) {
  6196. // Inject the element directly into the jQuery object
  6197. this[ 0 ] = elem;
  6198. this.length = 1;
  6199. }
  6200. return this;
  6201. }
  6202. // HANDLE: $(expr, $(...))
  6203. } else if ( !context || context.jquery ) {
  6204. return ( context || root ).find( selector );
  6205. // HANDLE: $(expr, context)
  6206. // (which is just equivalent to: $(context).find(expr)
  6207. } else {
  6208. return this.constructor( context ).find( selector );
  6209. }
  6210. // HANDLE: $(DOMElement)
  6211. } else if ( selector.nodeType ) {
  6212. this[ 0 ] = selector;
  6213. this.length = 1;
  6214. return this;
  6215. // HANDLE: $(function)
  6216. // Shortcut for document ready
  6217. } else if ( jQuery.isFunction( selector ) ) {
  6218. return root.ready !== undefined ?
  6219. root.ready( selector ) :
  6220. // Execute immediately if ready is not present
  6221. selector( jQuery );
  6222. }
  6223. return jQuery.makeArray( selector, this );
  6224. };
  6225. // Give the init function the jQuery prototype for later instantiation
  6226. init.prototype = jQuery.fn;
  6227. // Initialize central reference
  6228. rootjQuery = jQuery( document );
  6229. var rparentsprev = /^(?:parents|prev(?:Until|All))/,
  6230. // Methods guaranteed to produce a unique set when starting from a unique set
  6231. guaranteedUnique = {
  6232. children: true,
  6233. contents: true,
  6234. next: true,
  6235. prev: true
  6236. };
  6237. jQuery.fn.extend( {
  6238. has: function( target ) {
  6239. var targets = jQuery( target, this ),
  6240. l = targets.length;
  6241. return this.filter( function() {
  6242. var i = 0;
  6243. for ( ; i < l; i++ ) {
  6244. if ( jQuery.contains( this, targets[ i ] ) ) {
  6245. return true;
  6246. }
  6247. }
  6248. } );
  6249. },
  6250. closest: function( selectors, context ) {
  6251. var cur,
  6252. i = 0,
  6253. l = this.length,
  6254. matched = [],
  6255. targets = typeof selectors !== "string" && jQuery( selectors );
  6256. // Positional selectors never match, since there's no _selection_ context
  6257. if ( !rneedsContext.test( selectors ) ) {
  6258. for ( ; i < l; i++ ) {
  6259. for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
  6260. // Always skip document fragments
  6261. if ( cur.nodeType < 11 && ( targets ?
  6262. targets.index( cur ) > -1 :
  6263. // Don't pass non-elements to Sizzle
  6264. cur.nodeType === 1 &&
  6265. jQuery.find.matchesSelector( cur, selectors ) ) ) {
  6266. matched.push( cur );
  6267. break;
  6268. }
  6269. }
  6270. }
  6271. }
  6272. return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
  6273. },
  6274. // Determine the position of an element within the set
  6275. index: function( elem ) {
  6276. // No argument, return index in parent
  6277. if ( !elem ) {
  6278. return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
  6279. }
  6280. // Index in selector
  6281. if ( typeof elem === "string" ) {
  6282. return indexOf.call( jQuery( elem ), this[ 0 ] );
  6283. }
  6284. // Locate the position of the desired element
  6285. return indexOf.call( this,
  6286. // If it receives a jQuery object, the first element is used
  6287. elem.jquery ? elem[ 0 ] : elem
  6288. );
  6289. },
  6290. add: function( selector, context ) {
  6291. return this.pushStack(
  6292. jQuery.uniqueSort(
  6293. jQuery.merge( this.get(), jQuery( selector, context ) )
  6294. )
  6295. );
  6296. },
  6297. addBack: function( selector ) {
  6298. return this.add( selector == null ?
  6299. this.prevObject : this.prevObject.filter( selector )
  6300. );
  6301. }
  6302. } );
  6303. function sibling( cur, dir ) {
  6304. while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
  6305. return cur;
  6306. }
  6307. jQuery.each( {
  6308. parent: function( elem ) {
  6309. var parent = elem.parentNode;
  6310. return parent && parent.nodeType !== 11 ? parent : null;
  6311. },
  6312. parents: function( elem ) {
  6313. return dir( elem, "parentNode" );
  6314. },
  6315. parentsUntil: function( elem, i, until ) {
  6316. return dir( elem, "parentNode", until );
  6317. },
  6318. next: function( elem ) {
  6319. return sibling( elem, "nextSibling" );
  6320. },
  6321. prev: function( elem ) {
  6322. return sibling( elem, "previousSibling" );
  6323. },
  6324. nextAll: function( elem ) {
  6325. return dir( elem, "nextSibling" );
  6326. },
  6327. prevAll: function( elem ) {
  6328. return dir( elem, "previousSibling" );
  6329. },
  6330. nextUntil: function( elem, i, until ) {
  6331. return dir( elem, "nextSibling", until );
  6332. },
  6333. prevUntil: function( elem, i, until ) {
  6334. return dir( elem, "previousSibling", until );
  6335. },
  6336. siblings: function( elem ) {
  6337. return siblings( ( elem.parentNode || {} ).firstChild, elem );
  6338. },
  6339. children: function( elem ) {
  6340. return siblings( elem.firstChild );
  6341. },
  6342. contents: function( elem ) {
  6343. return elem.contentDocument || jQuery.merge( [], elem.childNodes );
  6344. }
  6345. }, function( name, fn ) {
  6346. jQuery.fn[ name ] = function( until, selector ) {
  6347. var matched = jQuery.map( this, fn, until );
  6348. if ( name.slice( -5 ) !== "Until" ) {
  6349. selector = until;
  6350. }
  6351. if ( selector && typeof selector === "string" ) {
  6352. matched = jQuery.filter( selector, matched );
  6353. }
  6354. if ( this.length > 1 ) {
  6355. // Remove duplicates
  6356. if ( !guaranteedUnique[ name ] ) {
  6357. jQuery.uniqueSort( matched );
  6358. }
  6359. // Reverse order for parents* and prev-derivatives
  6360. if ( rparentsprev.test( name ) ) {
  6361. matched.reverse();
  6362. }
  6363. }
  6364. return this.pushStack( matched );
  6365. };
  6366. } );
  6367. var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
  6368. // Convert String-formatted options into Object-formatted ones
  6369. function createOptions( options ) {
  6370. var object = {};
  6371. jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
  6372. object[ flag ] = true;
  6373. } );
  6374. return object;
  6375. }
  6376. /*
  6377. * Create a callback list using the following parameters:
  6378. *
  6379. * options: an optional list of space-separated options that will change how
  6380. * the callback list behaves or a more traditional option object
  6381. *
  6382. * By default a callback list will act like an event callback list and can be
  6383. * "fired" multiple times.
  6384. *
  6385. * Possible options:
  6386. *
  6387. * once: will ensure the callback list can only be fired once (like a Deferred)
  6388. *
  6389. * memory: will keep track of previous values and will call any callback added
  6390. * after the list has been fired right away with the latest "memorized"
  6391. * values (like a Deferred)
  6392. *
  6393. * unique: will ensure a callback can only be added once (no duplicate in the list)
  6394. *
  6395. * stopOnFalse: interrupt callings when a callback returns false
  6396. *
  6397. */
  6398. jQuery.Callbacks = function( options ) {
  6399. // Convert options from String-formatted to Object-formatted if needed
  6400. // (we check in cache first)
  6401. options = typeof options === "string" ?
  6402. createOptions( options ) :
  6403. jQuery.extend( {}, options );
  6404. var // Flag to know if list is currently firing
  6405. firing,
  6406. // Last fire value for non-forgettable lists
  6407. memory,
  6408. // Flag to know if list was already fired
  6409. fired,
  6410. // Flag to prevent firing
  6411. locked,
  6412. // Actual callback list
  6413. list = [],
  6414. // Queue of execution data for repeatable lists
  6415. queue = [],
  6416. // Index of currently firing callback (modified by add/remove as needed)
  6417. firingIndex = -1,
  6418. // Fire callbacks
  6419. fire = function() {
  6420. // Enforce single-firing
  6421. locked = options.once;
  6422. // Execute callbacks for all pending executions,
  6423. // respecting firingIndex overrides and runtime changes
  6424. fired = firing = true;
  6425. for ( ; queue.length; firingIndex = -1 ) {
  6426. memory = queue.shift();
  6427. while ( ++firingIndex < list.length ) {
  6428. // Run callback and check for early termination
  6429. if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
  6430. options.stopOnFalse ) {
  6431. // Jump to end and forget the data so .add doesn't re-fire
  6432. firingIndex = list.length;
  6433. memory = false;
  6434. }
  6435. }
  6436. }
  6437. // Forget the data if we're done with it
  6438. if ( !options.memory ) {
  6439. memory = false;
  6440. }
  6441. firing = false;
  6442. // Clean up if we're done firing for good
  6443. if ( locked ) {
  6444. // Keep an empty list if we have data for future add calls
  6445. if ( memory ) {
  6446. list = [];
  6447. // Otherwise, this object is spent
  6448. } else {
  6449. list = "";
  6450. }
  6451. }
  6452. },
  6453. // Actual Callbacks object
  6454. self = {
  6455. // Add a callback or a collection of callbacks to the list
  6456. add: function() {
  6457. if ( list ) {
  6458. // If we have memory from a past run, we should fire after adding
  6459. if ( memory && !firing ) {
  6460. firingIndex = list.length - 1;
  6461. queue.push( memory );
  6462. }
  6463. ( function add( args ) {
  6464. jQuery.each( args, function( _, arg ) {
  6465. if ( jQuery.isFunction( arg ) ) {
  6466. if ( !options.unique || !self.has( arg ) ) {
  6467. list.push( arg );
  6468. }
  6469. } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) {
  6470. // Inspect recursively
  6471. add( arg );
  6472. }
  6473. } );
  6474. } )( arguments );
  6475. if ( memory && !firing ) {
  6476. fire();
  6477. }
  6478. }
  6479. return this;
  6480. },
  6481. // Remove a callback from the list
  6482. remove: function() {
  6483. jQuery.each( arguments, function( _, arg ) {
  6484. var index;
  6485. while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
  6486. list.splice( index, 1 );
  6487. // Handle firing indexes
  6488. if ( index <= firingIndex ) {
  6489. firingIndex--;
  6490. }
  6491. }
  6492. } );
  6493. return this;
  6494. },
  6495. // Check if a given callback is in the list.
  6496. // If no argument is given, return whether or not list has callbacks attached.
  6497. has: function( fn ) {
  6498. return fn ?
  6499. jQuery.inArray( fn, list ) > -1 :
  6500. list.length > 0;
  6501. },
  6502. // Remove all callbacks from the list
  6503. empty: function() {
  6504. if ( list ) {
  6505. list = [];
  6506. }
  6507. return this;
  6508. },
  6509. // Disable .fire and .add
  6510. // Abort any current/pending executions
  6511. // Clear all callbacks and values
  6512. disable: function() {
  6513. locked = queue = [];
  6514. list = memory = "";
  6515. return this;
  6516. },
  6517. disabled: function() {
  6518. return !list;
  6519. },
  6520. // Disable .fire
  6521. // Also disable .add unless we have memory (since it would have no effect)
  6522. // Abort any pending executions
  6523. lock: function() {
  6524. locked = queue = [];
  6525. if ( !memory && !firing ) {
  6526. list = memory = "";
  6527. }
  6528. return this;
  6529. },
  6530. locked: function() {
  6531. return !!locked;
  6532. },
  6533. // Call all callbacks with the given context and arguments
  6534. fireWith: function( context, args ) {
  6535. if ( !locked ) {
  6536. args = args || [];
  6537. args = [ context, args.slice ? args.slice() : args ];
  6538. queue.push( args );
  6539. if ( !firing ) {
  6540. fire();
  6541. }
  6542. }
  6543. return this;
  6544. },
  6545. // Call all the callbacks with the given arguments
  6546. fire: function() {
  6547. self.fireWith( this, arguments );
  6548. return this;
  6549. },
  6550. // To know if the callbacks have already been called at least once
  6551. fired: function() {
  6552. return !!fired;
  6553. }
  6554. };
  6555. return self;
  6556. };
  6557. function Identity( v ) {
  6558. return v;
  6559. }
  6560. function Thrower( ex ) {
  6561. throw ex;
  6562. }
  6563. function adoptValue( value, resolve, reject ) {
  6564. var method;
  6565. try {
  6566. // Check for promise aspect first to privilege synchronous behavior
  6567. if ( value && jQuery.isFunction( ( method = value.promise ) ) ) {
  6568. method.call( value ).done( resolve ).fail( reject );
  6569. // Other thenables
  6570. } else if ( value && jQuery.isFunction( ( method = value.then ) ) ) {
  6571. method.call( value, resolve, reject );
  6572. // Other non-thenables
  6573. } else {
  6574. // Support: Android 4.0 only
  6575. // Strict mode functions invoked without .call/.apply get global-object context
  6576. resolve.call( undefined, value );
  6577. }
  6578. // For Promises/A+, convert exceptions into rejections
  6579. // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
  6580. // Deferred#then to conditionally suppress rejection.
  6581. } catch ( value ) {
  6582. // Support: Android 4.0 only
  6583. // Strict mode functions invoked without .call/.apply get global-object context
  6584. reject.call( undefined, value );
  6585. }
  6586. }
  6587. jQuery.extend( {
  6588. Deferred: function( func ) {
  6589. var tuples = [
  6590. // action, add listener, callbacks,
  6591. // ... .then handlers, argument index, [final state]
  6592. [ "notify", "progress", jQuery.Callbacks( "memory" ),
  6593. jQuery.Callbacks( "memory" ), 2 ],
  6594. [ "resolve", "done", jQuery.Callbacks( "once memory" ),
  6595. jQuery.Callbacks( "once memory" ), 0, "resolved" ],
  6596. [ "reject", "fail", jQuery.Callbacks( "once memory" ),
  6597. jQuery.Callbacks( "once memory" ), 1, "rejected" ]
  6598. ],
  6599. state = "pending",
  6600. promise = {
  6601. state: function() {
  6602. return state;
  6603. },
  6604. always: function() {
  6605. deferred.done( arguments ).fail( arguments );
  6606. return this;
  6607. },
  6608. "catch": function( fn ) {
  6609. return promise.then( null, fn );
  6610. },
  6611. // Keep pipe for back-compat
  6612. pipe: function( /* fnDone, fnFail, fnProgress */ ) {
  6613. var fns = arguments;
  6614. return jQuery.Deferred( function( newDefer ) {
  6615. jQuery.each( tuples, function( i, tuple ) {
  6616. // Map tuples (progress, done, fail) to arguments (done, fail, progress)
  6617. var fn = jQuery.isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
  6618. // deferred.progress(function() { bind to newDefer or newDefer.notify })
  6619. // deferred.done(function() { bind to newDefer or newDefer.resolve })
  6620. // deferred.fail(function() { bind to newDefer or newDefer.reject })
  6621. deferred[ tuple[ 1 ] ]( function() {
  6622. var returned = fn && fn.apply( this, arguments );
  6623. if ( returned && jQuery.isFunction( returned.promise ) ) {
  6624. returned.promise()
  6625. .progress( newDefer.notify )
  6626. .done( newDefer.resolve )
  6627. .fail( newDefer.reject );
  6628. } else {
  6629. newDefer[ tuple[ 0 ] + "With" ](
  6630. this,
  6631. fn ? [ returned ] : arguments
  6632. );
  6633. }
  6634. } );
  6635. } );
  6636. fns = null;
  6637. } ).promise();
  6638. },
  6639. then: function( onFulfilled, onRejected, onProgress ) {
  6640. var maxDepth = 0;
  6641. function resolve( depth, deferred, handler, special ) {
  6642. return function() {
  6643. var that = this,
  6644. args = arguments,
  6645. mightThrow = function() {
  6646. var returned, then;
  6647. // Support: Promises/A+ section 2.3.3.3.3
  6648. // https://promisesaplus.com/#point-59
  6649. // Ignore double-resolution attempts
  6650. if ( depth < maxDepth ) {
  6651. return;
  6652. }
  6653. returned = handler.apply( that, args );
  6654. // Support: Promises/A+ section 2.3.1
  6655. // https://promisesaplus.com/#point-48
  6656. if ( returned === deferred.promise() ) {
  6657. throw new TypeError( "Thenable self-resolution" );
  6658. }
  6659. // Support: Promises/A+ sections 2.3.3.1, 3.5
  6660. // https://promisesaplus.com/#point-54
  6661. // https://promisesaplus.com/#point-75
  6662. // Retrieve `then` only once
  6663. then = returned &&
  6664. // Support: Promises/A+ section 2.3.4
  6665. // https://promisesaplus.com/#point-64
  6666. // Only check objects and functions for thenability
  6667. ( typeof returned === "object" ||
  6668. typeof returned === "function" ) &&
  6669. returned.then;
  6670. // Handle a returned thenable
  6671. if ( jQuery.isFunction( then ) ) {
  6672. // Special processors (notify) just wait for resolution
  6673. if ( special ) {
  6674. then.call(
  6675. returned,
  6676. resolve( maxDepth, deferred, Identity, special ),
  6677. resolve( maxDepth, deferred, Thrower, special )
  6678. );
  6679. // Normal processors (resolve) also hook into progress
  6680. } else {
  6681. // ...and disregard older resolution values
  6682. maxDepth++;
  6683. then.call(
  6684. returned,
  6685. resolve( maxDepth, deferred, Identity, special ),
  6686. resolve( maxDepth, deferred, Thrower, special ),
  6687. resolve( maxDepth, deferred, Identity,
  6688. deferred.notifyWith )
  6689. );
  6690. }
  6691. // Handle all other returned values
  6692. } else {
  6693. // Only substitute handlers pass on context
  6694. // and multiple values (non-spec behavior)
  6695. if ( handler !== Identity ) {
  6696. that = undefined;
  6697. args = [ returned ];
  6698. }
  6699. // Process the value(s)
  6700. // Default process is resolve
  6701. ( special || deferred.resolveWith )( that, args );
  6702. }
  6703. },
  6704. // Only normal processors (resolve) catch and reject exceptions
  6705. process = special ?
  6706. mightThrow :
  6707. function() {
  6708. try {
  6709. mightThrow();
  6710. } catch ( e ) {
  6711. if ( jQuery.Deferred.exceptionHook ) {
  6712. jQuery.Deferred.exceptionHook( e,
  6713. process.stackTrace );
  6714. }
  6715. // Support: Promises/A+ section 2.3.3.3.4.1
  6716. // https://promisesaplus.com/#point-61
  6717. // Ignore post-resolution exceptions
  6718. if ( depth + 1 >= maxDepth ) {
  6719. // Only substitute handlers pass on context
  6720. // and multiple values (non-spec behavior)
  6721. if ( handler !== Thrower ) {
  6722. that = undefined;
  6723. args = [ e ];
  6724. }
  6725. deferred.rejectWith( that, args );
  6726. }
  6727. }
  6728. };
  6729. // Support: Promises/A+ section 2.3.3.3.1
  6730. // https://promisesaplus.com/#point-57
  6731. // Re-resolve promises immediately to dodge false rejection from
  6732. // subsequent errors
  6733. if ( depth ) {
  6734. process();
  6735. } else {
  6736. // Call an optional hook to record the stack, in case of exception
  6737. // since it's otherwise lost when execution goes async
  6738. if ( jQuery.Deferred.getStackHook ) {
  6739. process.stackTrace = jQuery.Deferred.getStackHook();
  6740. }
  6741. window.setTimeout( process );
  6742. }
  6743. };
  6744. }
  6745. return jQuery.Deferred( function( newDefer ) {
  6746. // progress_handlers.add( ... )
  6747. tuples[ 0 ][ 3 ].add(
  6748. resolve(
  6749. 0,
  6750. newDefer,
  6751. jQuery.isFunction( onProgress ) ?
  6752. onProgress :
  6753. Identity,
  6754. newDefer.notifyWith
  6755. )
  6756. );
  6757. // fulfilled_handlers.add( ... )
  6758. tuples[ 1 ][ 3 ].add(
  6759. resolve(
  6760. 0,
  6761. newDefer,
  6762. jQuery.isFunction( onFulfilled ) ?
  6763. onFulfilled :
  6764. Identity
  6765. )
  6766. );
  6767. // rejected_handlers.add( ... )
  6768. tuples[ 2 ][ 3 ].add(
  6769. resolve(
  6770. 0,
  6771. newDefer,
  6772. jQuery.isFunction( onRejected ) ?
  6773. onRejected :
  6774. Thrower
  6775. )
  6776. );
  6777. } ).promise();
  6778. },
  6779. // Get a promise for this deferred
  6780. // If obj is provided, the promise aspect is added to the object
  6781. promise: function( obj ) {
  6782. return obj != null ? jQuery.extend( obj, promise ) : promise;
  6783. }
  6784. },
  6785. deferred = {};
  6786. // Add list-specific methods
  6787. jQuery.each( tuples, function( i, tuple ) {
  6788. var list = tuple[ 2 ],
  6789. stateString = tuple[ 5 ];
  6790. // promise.progress = list.add
  6791. // promise.done = list.add
  6792. // promise.fail = list.add
  6793. promise[ tuple[ 1 ] ] = list.add;
  6794. // Handle state
  6795. if ( stateString ) {
  6796. list.add(
  6797. function() {
  6798. // state = "resolved" (i.e., fulfilled)
  6799. // state = "rejected"
  6800. state = stateString;
  6801. },
  6802. // rejected_callbacks.disable
  6803. // fulfilled_callbacks.disable
  6804. tuples[ 3 - i ][ 2 ].disable,
  6805. // progress_callbacks.lock
  6806. tuples[ 0 ][ 2 ].lock
  6807. );
  6808. }
  6809. // progress_handlers.fire
  6810. // fulfilled_handlers.fire
  6811. // rejected_handlers.fire
  6812. list.add( tuple[ 3 ].fire );
  6813. // deferred.notify = function() { deferred.notifyWith(...) }
  6814. // deferred.resolve = function() { deferred.resolveWith(...) }
  6815. // deferred.reject = function() { deferred.rejectWith(...) }
  6816. deferred[ tuple[ 0 ] ] = function() {
  6817. deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
  6818. return this;
  6819. };
  6820. // deferred.notifyWith = list.fireWith
  6821. // deferred.resolveWith = list.fireWith
  6822. // deferred.rejectWith = list.fireWith
  6823. deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
  6824. } );
  6825. // Make the deferred a promise
  6826. promise.promise( deferred );
  6827. // Call given func if any
  6828. if ( func ) {
  6829. func.call( deferred, deferred );
  6830. }
  6831. // All done!
  6832. return deferred;
  6833. },
  6834. // Deferred helper
  6835. when: function( singleValue ) {
  6836. var
  6837. // count of uncompleted subordinates
  6838. remaining = arguments.length,
  6839. // count of unprocessed arguments
  6840. i = remaining,
  6841. // subordinate fulfillment data
  6842. resolveContexts = Array( i ),
  6843. resolveValues = slice.call( arguments ),
  6844. // the master Deferred
  6845. master = jQuery.Deferred(),
  6846. // subordinate callback factory
  6847. updateFunc = function( i ) {
  6848. return function( value ) {
  6849. resolveContexts[ i ] = this;
  6850. resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
  6851. if ( !( --remaining ) ) {
  6852. master.resolveWith( resolveContexts, resolveValues );
  6853. }
  6854. };
  6855. };
  6856. // Single- and empty arguments are adopted like Promise.resolve
  6857. if ( remaining <= 1 ) {
  6858. adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject );
  6859. // Use .then() to unwrap secondary thenables (cf. gh-3000)
  6860. if ( master.state() === "pending" ||
  6861. jQuery.isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
  6862. return master.then();
  6863. }
  6864. }
  6865. // Multiple arguments are aggregated like Promise.all array elements
  6866. while ( i-- ) {
  6867. adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
  6868. }
  6869. return master.promise();
  6870. }
  6871. } );
  6872. // These usually indicate a programmer mistake during development,
  6873. // warn about them ASAP rather than swallowing them by default.
  6874. var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
  6875. jQuery.Deferred.exceptionHook = function( error, stack ) {
  6876. // Support: IE 8 - 9 only
  6877. // Console exists when dev tools are open, which can happen at any time
  6878. if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
  6879. window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
  6880. }
  6881. };
  6882. jQuery.readyException = function( error ) {
  6883. window.setTimeout( function() {
  6884. throw error;
  6885. } );
  6886. };
  6887. // The deferred used on DOM ready
  6888. var readyList = jQuery.Deferred();
  6889. jQuery.fn.ready = function( fn ) {
  6890. readyList
  6891. .then( fn )
  6892. // Wrap jQuery.readyException in a function so that the lookup
  6893. // happens at the time of error handling instead of callback
  6894. // registration.
  6895. .catch( function( error ) {
  6896. jQuery.readyException( error );
  6897. } );
  6898. return this;
  6899. };
  6900. jQuery.extend( {
  6901. // Is the DOM ready to be used? Set to true once it occurs.
  6902. isReady: false,
  6903. // A counter to track how many items to wait for before
  6904. // the ready event fires. See #6781
  6905. readyWait: 1,
  6906. // Hold (or release) the ready event
  6907. holdReady: function( hold ) {
  6908. if ( hold ) {
  6909. jQuery.readyWait++;
  6910. } else {
  6911. jQuery.ready( true );
  6912. }
  6913. },
  6914. // Handle when the DOM is ready
  6915. ready: function( wait ) {
  6916. // Abort if there are pending holds or we're already ready
  6917. if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
  6918. return;
  6919. }
  6920. // Remember that the DOM is ready
  6921. jQuery.isReady = true;
  6922. // If a normal DOM Ready event fired, decrement, and wait if need be
  6923. if ( wait !== true && --jQuery.readyWait > 0 ) {
  6924. return;
  6925. }
  6926. // If there are functions bound, to execute
  6927. readyList.resolveWith( document, [ jQuery ] );
  6928. }
  6929. } );
  6930. jQuery.ready.then = readyList.then;
  6931. // The ready event handler and self cleanup method
  6932. function completed() {
  6933. document.removeEventListener( "DOMContentLoaded", completed );
  6934. window.removeEventListener( "load", completed );
  6935. jQuery.ready();
  6936. }
  6937. // Catch cases where $(document).ready() is called
  6938. // after the browser event has already occurred.
  6939. // Support: IE <=9 - 10 only
  6940. // Older IE sometimes signals "interactive" too soon
  6941. if ( document.readyState === "complete" ||
  6942. ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
  6943. // Handle it asynchronously to allow scripts the opportunity to delay ready
  6944. window.setTimeout( jQuery.ready );
  6945. } else {
  6946. // Use the handy event callback
  6947. document.addEventListener( "DOMContentLoaded", completed );
  6948. // A fallback to window.onload, that will always work
  6949. window.addEventListener( "load", completed );
  6950. }
  6951. // Multifunctional method to get and set values of a collection
  6952. // The value/s can optionally be executed if it's a function
  6953. var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
  6954. var i = 0,
  6955. len = elems.length,
  6956. bulk = key == null;
  6957. // Sets many values
  6958. if ( jQuery.type( key ) === "object" ) {
  6959. chainable = true;
  6960. for ( i in key ) {
  6961. access( elems, fn, i, key[ i ], true, emptyGet, raw );
  6962. }
  6963. // Sets one value
  6964. } else if ( value !== undefined ) {
  6965. chainable = true;
  6966. if ( !jQuery.isFunction( value ) ) {
  6967. raw = true;
  6968. }
  6969. if ( bulk ) {
  6970. // Bulk operations run against the entire set
  6971. if ( raw ) {
  6972. fn.call( elems, value );
  6973. fn = null;
  6974. // ...except when executing function values
  6975. } else {
  6976. bulk = fn;
  6977. fn = function( elem, key, value ) {
  6978. return bulk.call( jQuery( elem ), value );
  6979. };
  6980. }
  6981. }
  6982. if ( fn ) {
  6983. for ( ; i < len; i++ ) {
  6984. fn(
  6985. elems[ i ], key, raw ?
  6986. value :
  6987. value.call( elems[ i ], i, fn( elems[ i ], key ) )
  6988. );
  6989. }
  6990. }
  6991. }
  6992. if ( chainable ) {
  6993. return elems;
  6994. }
  6995. // Gets
  6996. if ( bulk ) {
  6997. return fn.call( elems );
  6998. }
  6999. return len ? fn( elems[ 0 ], key ) : emptyGet;
  7000. };
  7001. var acceptData = function( owner ) {
  7002. // Accepts only:
  7003. // - Node
  7004. // - Node.ELEMENT_NODE
  7005. // - Node.DOCUMENT_NODE
  7006. // - Object
  7007. // - Any
  7008. return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
  7009. };
  7010. function Data() {
  7011. this.expando = jQuery.expando + Data.uid++;
  7012. }
  7013. Data.uid = 1;
  7014. Data.prototype = {
  7015. cache: function( owner ) {
  7016. // Check if the owner object already has a cache
  7017. var value = owner[ this.expando ];
  7018. // If not, create one
  7019. if ( !value ) {
  7020. value = {};
  7021. // We can accept data for non-element nodes in modern browsers,
  7022. // but we should not, see #8335.
  7023. // Always return an empty object.
  7024. if ( acceptData( owner ) ) {
  7025. // If it is a node unlikely to be stringify-ed or looped over
  7026. // use plain assignment
  7027. if ( owner.nodeType ) {
  7028. owner[ this.expando ] = value;
  7029. // Otherwise secure it in a non-enumerable property
  7030. // configurable must be true to allow the property to be
  7031. // deleted when data is removed
  7032. } else {
  7033. Object.defineProperty( owner, this.expando, {
  7034. value: value,
  7035. configurable: true
  7036. } );
  7037. }
  7038. }
  7039. }
  7040. return value;
  7041. },
  7042. set: function( owner, data, value ) {
  7043. var prop,
  7044. cache = this.cache( owner );
  7045. // Handle: [ owner, key, value ] args
  7046. // Always use camelCase key (gh-2257)
  7047. if ( typeof data === "string" ) {
  7048. cache[ jQuery.camelCase( data ) ] = value;
  7049. // Handle: [ owner, { properties } ] args
  7050. } else {
  7051. // Copy the properties one-by-one to the cache object
  7052. for ( prop in data ) {
  7053. cache[ jQuery.camelCase( prop ) ] = data[ prop ];
  7054. }
  7055. }
  7056. return cache;
  7057. },
  7058. get: function( owner, key ) {
  7059. return key === undefined ?
  7060. this.cache( owner ) :
  7061. // Always use camelCase key (gh-2257)
  7062. owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ];
  7063. },
  7064. access: function( owner, key, value ) {
  7065. // In cases where either:
  7066. //
  7067. // 1. No key was specified
  7068. // 2. A string key was specified, but no value provided
  7069. //
  7070. // Take the "read" path and allow the get method to determine
  7071. // which value to return, respectively either:
  7072. //
  7073. // 1. The entire cache object
  7074. // 2. The data stored at the key
  7075. //
  7076. if ( key === undefined ||
  7077. ( ( key && typeof key === "string" ) && value === undefined ) ) {
  7078. return this.get( owner, key );
  7079. }
  7080. // When the key is not a string, or both a key and value
  7081. // are specified, set or extend (existing objects) with either:
  7082. //
  7083. // 1. An object of properties
  7084. // 2. A key and value
  7085. //
  7086. this.set( owner, key, value );
  7087. // Since the "set" path can have two possible entry points
  7088. // return the expected data based on which path was taken[*]
  7089. return value !== undefined ? value : key;
  7090. },
  7091. remove: function( owner, key ) {
  7092. var i,
  7093. cache = owner[ this.expando ];
  7094. if ( cache === undefined ) {
  7095. return;
  7096. }
  7097. if ( key !== undefined ) {
  7098. // Support array or space separated string of keys
  7099. if ( jQuery.isArray( key ) ) {
  7100. // If key is an array of keys...
  7101. // We always set camelCase keys, so remove that.
  7102. key = key.map( jQuery.camelCase );
  7103. } else {
  7104. key = jQuery.camelCase( key );
  7105. // If a key with the spaces exists, use it.
  7106. // Otherwise, create an array by matching non-whitespace
  7107. key = key in cache ?
  7108. [ key ] :
  7109. ( key.match( rnothtmlwhite ) || [] );
  7110. }
  7111. i = key.length;
  7112. while ( i-- ) {
  7113. delete cache[ key[ i ] ];
  7114. }
  7115. }
  7116. // Remove the expando if there's no more data
  7117. if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
  7118. // Support: Chrome <=35 - 45
  7119. // Webkit & Blink performance suffers when deleting properties
  7120. // from DOM nodes, so set to undefined instead
  7121. // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
  7122. if ( owner.nodeType ) {
  7123. owner[ this.expando ] = undefined;
  7124. } else {
  7125. delete owner[ this.expando ];
  7126. }
  7127. }
  7128. },
  7129. hasData: function( owner ) {
  7130. var cache = owner[ this.expando ];
  7131. return cache !== undefined && !jQuery.isEmptyObject( cache );
  7132. }
  7133. };
  7134. var dataPriv = new Data();
  7135. var dataUser = new Data();
  7136. // Implementation Summary
  7137. //
  7138. // 1. Enforce API surface and semantic compatibility with 1.9.x branch
  7139. // 2. Improve the module's maintainability by reducing the storage
  7140. // paths to a single mechanism.
  7141. // 3. Use the same single mechanism to support "private" and "user" data.
  7142. // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
  7143. // 5. Avoid exposing implementation details on user objects (eg. expando properties)
  7144. // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
  7145. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
  7146. rmultiDash = /[A-Z]/g;
  7147. function getData( data ) {
  7148. if ( data === "true" ) {
  7149. return true;
  7150. }
  7151. if ( data === "false" ) {
  7152. return false;
  7153. }
  7154. if ( data === "null" ) {
  7155. return null;
  7156. }
  7157. // Only convert to a number if it doesn't change the string
  7158. if ( data === +data + "" ) {
  7159. return +data;
  7160. }
  7161. if ( rbrace.test( data ) ) {
  7162. return JSON.parse( data );
  7163. }
  7164. return data;
  7165. }
  7166. function dataAttr( elem, key, data ) {
  7167. var name;
  7168. // If nothing was found internally, try to fetch any
  7169. // data from the HTML5 data-* attribute
  7170. if ( data === undefined && elem.nodeType === 1 ) {
  7171. name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
  7172. data = elem.getAttribute( name );
  7173. if ( typeof data === "string" ) {
  7174. try {
  7175. data = getData( data );
  7176. } catch ( e ) {}
  7177. // Make sure we set the data so it isn't changed later
  7178. dataUser.set( elem, key, data );
  7179. } else {
  7180. data = undefined;
  7181. }
  7182. }
  7183. return data;
  7184. }
  7185. jQuery.extend( {
  7186. hasData: function( elem ) {
  7187. return dataUser.hasData( elem ) || dataPriv.hasData( elem );
  7188. },
  7189. data: function( elem, name, data ) {
  7190. return dataUser.access( elem, name, data );
  7191. },
  7192. removeData: function( elem, name ) {
  7193. dataUser.remove( elem, name );
  7194. },
  7195. // TODO: Now that all calls to _data and _removeData have been replaced
  7196. // with direct calls to dataPriv methods, these can be deprecated.
  7197. _data: function( elem, name, data ) {
  7198. return dataPriv.access( elem, name, data );
  7199. },
  7200. _removeData: function( elem, name ) {
  7201. dataPriv.remove( elem, name );
  7202. }
  7203. } );
  7204. jQuery.fn.extend( {
  7205. data: function( key, value ) {
  7206. var i, name, data,
  7207. elem = this[ 0 ],
  7208. attrs = elem && elem.attributes;
  7209. // Gets all values
  7210. if ( key === undefined ) {
  7211. if ( this.length ) {
  7212. data = dataUser.get( elem );
  7213. if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
  7214. i = attrs.length;
  7215. while ( i-- ) {
  7216. // Support: IE 11 only
  7217. // The attrs elements can be null (#14894)
  7218. if ( attrs[ i ] ) {
  7219. name = attrs[ i ].name;
  7220. if ( name.indexOf( "data-" ) === 0 ) {
  7221. name = jQuery.camelCase( name.slice( 5 ) );
  7222. dataAttr( elem, name, data[ name ] );
  7223. }
  7224. }
  7225. }
  7226. dataPriv.set( elem, "hasDataAttrs", true );
  7227. }
  7228. }
  7229. return data;
  7230. }
  7231. // Sets multiple values
  7232. if ( typeof key === "object" ) {
  7233. return this.each( function() {
  7234. dataUser.set( this, key );
  7235. } );
  7236. }
  7237. return access( this, function( value ) {
  7238. var data;
  7239. // The calling jQuery object (element matches) is not empty
  7240. // (and therefore has an element appears at this[ 0 ]) and the
  7241. // `value` parameter was not undefined. An empty jQuery object
  7242. // will result in `undefined` for elem = this[ 0 ] which will
  7243. // throw an exception if an attempt to read a data cache is made.
  7244. if ( elem && value === undefined ) {
  7245. // Attempt to get data from the cache
  7246. // The key will always be camelCased in Data
  7247. data = dataUser.get( elem, key );
  7248. if ( data !== undefined ) {
  7249. return data;
  7250. }
  7251. // Attempt to "discover" the data in
  7252. // HTML5 custom data-* attrs
  7253. data = dataAttr( elem, key );
  7254. if ( data !== undefined ) {
  7255. return data;
  7256. }
  7257. // We tried really hard, but the data doesn't exist.
  7258. return;
  7259. }
  7260. // Set the data...
  7261. this.each( function() {
  7262. // We always store the camelCased key
  7263. dataUser.set( this, key, value );
  7264. } );
  7265. }, null, value, arguments.length > 1, null, true );
  7266. },
  7267. removeData: function( key ) {
  7268. return this.each( function() {
  7269. dataUser.remove( this, key );
  7270. } );
  7271. }
  7272. } );
  7273. jQuery.extend( {
  7274. queue: function( elem, type, data ) {
  7275. var queue;
  7276. if ( elem ) {
  7277. type = ( type || "fx" ) + "queue";
  7278. queue = dataPriv.get( elem, type );
  7279. // Speed up dequeue by getting out quickly if this is just a lookup
  7280. if ( data ) {
  7281. if ( !queue || jQuery.isArray( data ) ) {
  7282. queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
  7283. } else {
  7284. queue.push( data );
  7285. }
  7286. }
  7287. return queue || [];
  7288. }
  7289. },
  7290. dequeue: function( elem, type ) {
  7291. type = type || "fx";
  7292. var queue = jQuery.queue( elem, type ),
  7293. startLength = queue.length,
  7294. fn = queue.shift(),
  7295. hooks = jQuery._queueHooks( elem, type ),
  7296. next = function() {
  7297. jQuery.dequeue( elem, type );
  7298. };
  7299. // If the fx queue is dequeued, always remove the progress sentinel
  7300. if ( fn === "inprogress" ) {
  7301. fn = queue.shift();
  7302. startLength--;
  7303. }
  7304. if ( fn ) {
  7305. // Add a progress sentinel to prevent the fx queue from being
  7306. // automatically dequeued
  7307. if ( type === "fx" ) {
  7308. queue.unshift( "inprogress" );
  7309. }
  7310. // Clear up the last queue stop function
  7311. delete hooks.stop;
  7312. fn.call( elem, next, hooks );
  7313. }
  7314. if ( !startLength && hooks ) {
  7315. hooks.empty.fire();
  7316. }
  7317. },
  7318. // Not public - generate a queueHooks object, or return the current one
  7319. _queueHooks: function( elem, type ) {
  7320. var key = type + "queueHooks";
  7321. return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
  7322. empty: jQuery.Callbacks( "once memory" ).add( function() {
  7323. dataPriv.remove( elem, [ type + "queue", key ] );
  7324. } )
  7325. } );
  7326. }
  7327. } );
  7328. jQuery.fn.extend( {
  7329. queue: function( type, data ) {
  7330. var setter = 2;
  7331. if ( typeof type !== "string" ) {
  7332. data = type;
  7333. type = "fx";
  7334. setter--;
  7335. }
  7336. if ( arguments.length < setter ) {
  7337. return jQuery.queue( this[ 0 ], type );
  7338. }
  7339. return data === undefined ?
  7340. this :
  7341. this.each( function() {
  7342. var queue = jQuery.queue( this, type, data );
  7343. // Ensure a hooks for this queue
  7344. jQuery._queueHooks( this, type );
  7345. if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
  7346. jQuery.dequeue( this, type );
  7347. }
  7348. } );
  7349. },
  7350. dequeue: function( type ) {
  7351. return this.each( function() {
  7352. jQuery.dequeue( this, type );
  7353. } );
  7354. },
  7355. clearQueue: function( type ) {
  7356. return this.queue( type || "fx", [] );
  7357. },
  7358. // Get a promise resolved when queues of a certain type
  7359. // are emptied (fx is the type by default)
  7360. promise: function( type, obj ) {
  7361. var tmp,
  7362. count = 1,
  7363. defer = jQuery.Deferred(),
  7364. elements = this,
  7365. i = this.length,
  7366. resolve = function() {
  7367. if ( !( --count ) ) {
  7368. defer.resolveWith( elements, [ elements ] );
  7369. }
  7370. };
  7371. if ( typeof type !== "string" ) {
  7372. obj = type;
  7373. type = undefined;
  7374. }
  7375. type = type || "fx";
  7376. while ( i-- ) {
  7377. tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
  7378. if ( tmp && tmp.empty ) {
  7379. count++;
  7380. tmp.empty.add( resolve );
  7381. }
  7382. }
  7383. resolve();
  7384. return defer.promise( obj );
  7385. }
  7386. } );
  7387. var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
  7388. var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
  7389. var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
  7390. var isHiddenWithinTree = function( elem, el ) {
  7391. // isHiddenWithinTree might be called from jQuery#filter function;
  7392. // in that case, element will be second argument
  7393. elem = el || elem;
  7394. // Inline style trumps all
  7395. return elem.style.display === "none" ||
  7396. elem.style.display === "" &&
  7397. // Otherwise, check computed style
  7398. // Support: Firefox <=43 - 45
  7399. // Disconnected elements can have computed display: none, so first confirm that elem is
  7400. // in the document.
  7401. jQuery.contains( elem.ownerDocument, elem ) &&
  7402. jQuery.css( elem, "display" ) === "none";
  7403. };
  7404. var swap = function( elem, options, callback, args ) {
  7405. var ret, name,
  7406. old = {};
  7407. // Remember the old values, and insert the new ones
  7408. for ( name in options ) {
  7409. old[ name ] = elem.style[ name ];
  7410. elem.style[ name ] = options[ name ];
  7411. }
  7412. ret = callback.apply( elem, args || [] );
  7413. // Revert the old values
  7414. for ( name in options ) {
  7415. elem.style[ name ] = old[ name ];
  7416. }
  7417. return ret;
  7418. };
  7419. function adjustCSS( elem, prop, valueParts, tween ) {
  7420. var adjusted,
  7421. scale = 1,
  7422. maxIterations = 20,
  7423. currentValue = tween ?
  7424. function() {
  7425. return tween.cur();
  7426. } :
  7427. function() {
  7428. return jQuery.css( elem, prop, "" );
  7429. },
  7430. initial = currentValue(),
  7431. unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
  7432. // Starting value computation is required for potential unit mismatches
  7433. initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
  7434. rcssNum.exec( jQuery.css( elem, prop ) );
  7435. if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
  7436. // Trust units reported by jQuery.css
  7437. unit = unit || initialInUnit[ 3 ];
  7438. // Make sure we update the tween properties later on
  7439. valueParts = valueParts || [];
  7440. // Iteratively approximate from a nonzero starting point
  7441. initialInUnit = +initial || 1;
  7442. do {
  7443. // If previous iteration zeroed out, double until we get *something*.
  7444. // Use string for doubling so we don't accidentally see scale as unchanged below
  7445. scale = scale || ".5";
  7446. // Adjust and apply
  7447. initialInUnit = initialInUnit / scale;
  7448. jQuery.style( elem, prop, initialInUnit + unit );
  7449. // Update scale, tolerating zero or NaN from tween.cur()
  7450. // Break the loop if scale is unchanged or perfect, or if we've just had enough.
  7451. } while (
  7452. scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations
  7453. );
  7454. }
  7455. if ( valueParts ) {
  7456. initialInUnit = +initialInUnit || +initial || 0;
  7457. // Apply relative offset (+=/-=) if specified
  7458. adjusted = valueParts[ 1 ] ?
  7459. initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
  7460. +valueParts[ 2 ];
  7461. if ( tween ) {
  7462. tween.unit = unit;
  7463. tween.start = initialInUnit;
  7464. tween.end = adjusted;
  7465. }
  7466. }
  7467. return adjusted;
  7468. }
  7469. var defaultDisplayMap = {};
  7470. function getDefaultDisplay( elem ) {
  7471. var temp,
  7472. doc = elem.ownerDocument,
  7473. nodeName = elem.nodeName,
  7474. display = defaultDisplayMap[ nodeName ];
  7475. if ( display ) {
  7476. return display;
  7477. }
  7478. temp = doc.body.appendChild( doc.createElement( nodeName ) );
  7479. display = jQuery.css( temp, "display" );
  7480. temp.parentNode.removeChild( temp );
  7481. if ( display === "none" ) {
  7482. display = "block";
  7483. }
  7484. defaultDisplayMap[ nodeName ] = display;
  7485. return display;
  7486. }
  7487. function showHide( elements, show ) {
  7488. var display, elem,
  7489. values = [],
  7490. index = 0,
  7491. length = elements.length;
  7492. // Determine new display value for elements that need to change
  7493. for ( ; index < length; index++ ) {
  7494. elem = elements[ index ];
  7495. if ( !elem.style ) {
  7496. continue;
  7497. }
  7498. display = elem.style.display;
  7499. if ( show ) {
  7500. // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
  7501. // check is required in this first loop unless we have a nonempty display value (either
  7502. // inline or about-to-be-restored)
  7503. if ( display === "none" ) {
  7504. values[ index ] = dataPriv.get( elem, "display" ) || null;
  7505. if ( !values[ index ] ) {
  7506. elem.style.display = "";
  7507. }
  7508. }
  7509. if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
  7510. values[ index ] = getDefaultDisplay( elem );
  7511. }
  7512. } else {
  7513. if ( display !== "none" ) {
  7514. values[ index ] = "none";
  7515. // Remember what we're overwriting
  7516. dataPriv.set( elem, "display", display );
  7517. }
  7518. }
  7519. }
  7520. // Set the display of the elements in a second loop to avoid constant reflow
  7521. for ( index = 0; index < length; index++ ) {
  7522. if ( values[ index ] != null ) {
  7523. elements[ index ].style.display = values[ index ];
  7524. }
  7525. }
  7526. return elements;
  7527. }
  7528. jQuery.fn.extend( {
  7529. show: function() {
  7530. return showHide( this, true );
  7531. },
  7532. hide: function() {
  7533. return showHide( this );
  7534. },
  7535. toggle: function( state ) {
  7536. if ( typeof state === "boolean" ) {
  7537. return state ? this.show() : this.hide();
  7538. }
  7539. return this.each( function() {
  7540. if ( isHiddenWithinTree( this ) ) {
  7541. jQuery( this ).show();
  7542. } else {
  7543. jQuery( this ).hide();
  7544. }
  7545. } );
  7546. }
  7547. } );
  7548. var rcheckableType = ( /^(?:checkbox|radio)$/i );
  7549. var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i );
  7550. var rscriptType = ( /^$|\/(?:java|ecma)script/i );
  7551. // We have to close these tags to support XHTML (#13200)
  7552. var wrapMap = {
  7553. // Support: IE <=9 only
  7554. option: [ 1, "<select multiple='multiple'>", "</select>" ],
  7555. // XHTML parsers do not magically insert elements in the
  7556. // same way that tag soup parsers do. So we cannot shorten
  7557. // this by omitting <tbody> or other required elements.
  7558. thead: [ 1, "<table>", "</table>" ],
  7559. col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
  7560. tr: [ 2, "<table><tbody>", "</tbody></table>" ],
  7561. td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
  7562. _default: [ 0, "", "" ]
  7563. };
  7564. // Support: IE <=9 only
  7565. wrapMap.optgroup = wrapMap.option;
  7566. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  7567. wrapMap.th = wrapMap.td;
  7568. function getAll( context, tag ) {
  7569. // Support: IE <=9 - 11 only
  7570. // Use typeof to avoid zero-argument method invocation on host objects (#15151)
  7571. var ret;
  7572. if ( typeof context.getElementsByTagName !== "undefined" ) {
  7573. ret = context.getElementsByTagName( tag || "*" );
  7574. } else if ( typeof context.querySelectorAll !== "undefined" ) {
  7575. ret = context.querySelectorAll( tag || "*" );
  7576. } else {
  7577. ret = [];
  7578. }
  7579. if ( tag === undefined || tag && jQuery.nodeName( context, tag ) ) {
  7580. return jQuery.merge( [ context ], ret );
  7581. }
  7582. return ret;
  7583. }
  7584. // Mark scripts as having already been evaluated
  7585. function setGlobalEval( elems, refElements ) {
  7586. var i = 0,
  7587. l = elems.length;
  7588. for ( ; i < l; i++ ) {
  7589. dataPriv.set(
  7590. elems[ i ],
  7591. "globalEval",
  7592. !refElements || dataPriv.get( refElements[ i ], "globalEval" )
  7593. );
  7594. }
  7595. }
  7596. var rhtml = /<|&#?\w+;/;
  7597. function buildFragment( elems, context, scripts, selection, ignored ) {
  7598. var elem, tmp, tag, wrap, contains, j,
  7599. fragment = context.createDocumentFragment(),
  7600. nodes = [],
  7601. i = 0,
  7602. l = elems.length;
  7603. for ( ; i < l; i++ ) {
  7604. elem = elems[ i ];
  7605. if ( elem || elem === 0 ) {
  7606. // Add nodes directly
  7607. if ( jQuery.type( elem ) === "object" ) {
  7608. // Support: Android <=4.0 only, PhantomJS 1 only
  7609. // push.apply(_, arraylike) throws on ancient WebKit
  7610. jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
  7611. // Convert non-html into a text node
  7612. } else if ( !rhtml.test( elem ) ) {
  7613. nodes.push( context.createTextNode( elem ) );
  7614. // Convert html into DOM nodes
  7615. } else {
  7616. tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
  7617. // Deserialize a standard representation
  7618. tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
  7619. wrap = wrapMap[ tag ] || wrapMap._default;
  7620. tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
  7621. // Descend through wrappers to the right content
  7622. j = wrap[ 0 ];
  7623. while ( j-- ) {
  7624. tmp = tmp.lastChild;
  7625. }
  7626. // Support: Android <=4.0 only, PhantomJS 1 only
  7627. // push.apply(_, arraylike) throws on ancient WebKit
  7628. jQuery.merge( nodes, tmp.childNodes );
  7629. // Remember the top-level container
  7630. tmp = fragment.firstChild;
  7631. // Ensure the created nodes are orphaned (#12392)
  7632. tmp.textContent = "";
  7633. }
  7634. }
  7635. }
  7636. // Remove wrapper from fragment
  7637. fragment.textContent = "";
  7638. i = 0;
  7639. while ( ( elem = nodes[ i++ ] ) ) {
  7640. // Skip elements already in the context collection (trac-4087)
  7641. if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
  7642. if ( ignored ) {
  7643. ignored.push( elem );
  7644. }
  7645. continue;
  7646. }
  7647. contains = jQuery.contains( elem.ownerDocument, elem );
  7648. // Append to fragment
  7649. tmp = getAll( fragment.appendChild( elem ), "script" );
  7650. // Preserve script evaluation history
  7651. if ( contains ) {
  7652. setGlobalEval( tmp );
  7653. }
  7654. // Capture executables
  7655. if ( scripts ) {
  7656. j = 0;
  7657. while ( ( elem = tmp[ j++ ] ) ) {
  7658. if ( rscriptType.test( elem.type || "" ) ) {
  7659. scripts.push( elem );
  7660. }
  7661. }
  7662. }
  7663. }
  7664. return fragment;
  7665. }
  7666. ( function() {
  7667. var fragment = document.createDocumentFragment(),
  7668. div = fragment.appendChild( document.createElement( "div" ) ),
  7669. input = document.createElement( "input" );
  7670. // Support: Android 4.0 - 4.3 only
  7671. // Check state lost if the name is set (#11217)
  7672. // Support: Windows Web Apps (WWA)
  7673. // `name` and `type` must use .setAttribute for WWA (#14901)
  7674. input.setAttribute( "type", "radio" );
  7675. input.setAttribute( "checked", "checked" );
  7676. input.setAttribute( "name", "t" );
  7677. div.appendChild( input );
  7678. // Support: Android <=4.1 only
  7679. // Older WebKit doesn't clone checked state correctly in fragments
  7680. support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
  7681. // Support: IE <=11 only
  7682. // Make sure textarea (and checkbox) defaultValue is properly cloned
  7683. div.innerHTML = "<textarea>x</textarea>";
  7684. support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
  7685. } )();
  7686. var documentElement = document.documentElement;
  7687. var
  7688. rkeyEvent = /^key/,
  7689. rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
  7690. rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
  7691. function returnTrue() {
  7692. return true;
  7693. }
  7694. function returnFalse() {
  7695. return false;
  7696. }
  7697. // Support: IE <=9 only
  7698. // See #13393 for more info
  7699. function safeActiveElement() {
  7700. try {
  7701. return document.activeElement;
  7702. } catch ( err ) { }
  7703. }
  7704. function on( elem, types, selector, data, fn, one ) {
  7705. var origFn, type;
  7706. // Types can be a map of types/handlers
  7707. if ( typeof types === "object" ) {
  7708. // ( types-Object, selector, data )
  7709. if ( typeof selector !== "string" ) {
  7710. // ( types-Object, data )
  7711. data = data || selector;
  7712. selector = undefined;
  7713. }
  7714. for ( type in types ) {
  7715. on( elem, type, selector, data, types[ type ], one );
  7716. }
  7717. return elem;
  7718. }
  7719. if ( data == null && fn == null ) {
  7720. // ( types, fn )
  7721. fn = selector;
  7722. data = selector = undefined;
  7723. } else if ( fn == null ) {
  7724. if ( typeof selector === "string" ) {
  7725. // ( types, selector, fn )
  7726. fn = data;
  7727. data = undefined;
  7728. } else {
  7729. // ( types, data, fn )
  7730. fn = data;
  7731. data = selector;
  7732. selector = undefined;
  7733. }
  7734. }
  7735. if ( fn === false ) {
  7736. fn = returnFalse;
  7737. } else if ( !fn ) {
  7738. return elem;
  7739. }
  7740. if ( one === 1 ) {
  7741. origFn = fn;
  7742. fn = function( event ) {
  7743. // Can use an empty set, since event contains the info
  7744. jQuery().off( event );
  7745. return origFn.apply( this, arguments );
  7746. };
  7747. // Use same guid so caller can remove using origFn
  7748. fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
  7749. }
  7750. return elem.each( function() {
  7751. jQuery.event.add( this, types, fn, data, selector );
  7752. } );
  7753. }
  7754. /*
  7755. * Helper functions for managing events -- not part of the public interface.
  7756. * Props to Dean Edwards' addEvent library for many of the ideas.
  7757. */
  7758. jQuery.event = {
  7759. global: {},
  7760. add: function( elem, types, handler, data, selector ) {
  7761. var handleObjIn, eventHandle, tmp,
  7762. events, t, handleObj,
  7763. special, handlers, type, namespaces, origType,
  7764. elemData = dataPriv.get( elem );
  7765. // Don't attach events to noData or text/comment nodes (but allow plain objects)
  7766. if ( !elemData ) {
  7767. return;
  7768. }
  7769. // Caller can pass in an object of custom data in lieu of the handler
  7770. if ( handler.handler ) {
  7771. handleObjIn = handler;
  7772. handler = handleObjIn.handler;
  7773. selector = handleObjIn.selector;
  7774. }
  7775. // Ensure that invalid selectors throw exceptions at attach time
  7776. // Evaluate against documentElement in case elem is a non-element node (e.g., document)
  7777. if ( selector ) {
  7778. jQuery.find.matchesSelector( documentElement, selector );
  7779. }
  7780. // Make sure that the handler has a unique ID, used to find/remove it later
  7781. if ( !handler.guid ) {
  7782. handler.guid = jQuery.guid++;
  7783. }
  7784. // Init the element's event structure and main handler, if this is the first
  7785. if ( !( events = elemData.events ) ) {
  7786. events = elemData.events = {};
  7787. }
  7788. if ( !( eventHandle = elemData.handle ) ) {
  7789. eventHandle = elemData.handle = function( e ) {
  7790. // Discard the second event of a jQuery.event.trigger() and
  7791. // when an event is called after a page has unloaded
  7792. return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
  7793. jQuery.event.dispatch.apply( elem, arguments ) : undefined;
  7794. };
  7795. }
  7796. // Handle multiple events separated by a space
  7797. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  7798. t = types.length;
  7799. while ( t-- ) {
  7800. tmp = rtypenamespace.exec( types[ t ] ) || [];
  7801. type = origType = tmp[ 1 ];
  7802. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  7803. // There *must* be a type, no attaching namespace-only handlers
  7804. if ( !type ) {
  7805. continue;
  7806. }
  7807. // If event changes its type, use the special event handlers for the changed type
  7808. special = jQuery.event.special[ type ] || {};
  7809. // If selector defined, determine special event api type, otherwise given type
  7810. type = ( selector ? special.delegateType : special.bindType ) || type;
  7811. // Update special based on newly reset type
  7812. special = jQuery.event.special[ type ] || {};
  7813. // handleObj is passed to all event handlers
  7814. handleObj = jQuery.extend( {
  7815. type: type,
  7816. origType: origType,
  7817. data: data,
  7818. handler: handler,
  7819. guid: handler.guid,
  7820. selector: selector,
  7821. needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
  7822. namespace: namespaces.join( "." )
  7823. }, handleObjIn );
  7824. // Init the event handler queue if we're the first
  7825. if ( !( handlers = events[ type ] ) ) {
  7826. handlers = events[ type ] = [];
  7827. handlers.delegateCount = 0;
  7828. // Only use addEventListener if the special events handler returns false
  7829. if ( !special.setup ||
  7830. special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  7831. if ( elem.addEventListener ) {
  7832. elem.addEventListener( type, eventHandle );
  7833. }
  7834. }
  7835. }
  7836. if ( special.add ) {
  7837. special.add.call( elem, handleObj );
  7838. if ( !handleObj.handler.guid ) {
  7839. handleObj.handler.guid = handler.guid;
  7840. }
  7841. }
  7842. // Add to the element's handler list, delegates in front
  7843. if ( selector ) {
  7844. handlers.splice( handlers.delegateCount++, 0, handleObj );
  7845. } else {
  7846. handlers.push( handleObj );
  7847. }
  7848. // Keep track of which events have ever been used, for event optimization
  7849. jQuery.event.global[ type ] = true;
  7850. }
  7851. },
  7852. // Detach an event or set of events from an element
  7853. remove: function( elem, types, handler, selector, mappedTypes ) {
  7854. var j, origCount, tmp,
  7855. events, t, handleObj,
  7856. special, handlers, type, namespaces, origType,
  7857. elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
  7858. if ( !elemData || !( events = elemData.events ) ) {
  7859. return;
  7860. }
  7861. // Once for each type.namespace in types; type may be omitted
  7862. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  7863. t = types.length;
  7864. while ( t-- ) {
  7865. tmp = rtypenamespace.exec( types[ t ] ) || [];
  7866. type = origType = tmp[ 1 ];
  7867. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  7868. // Unbind all events (on this namespace, if provided) for the element
  7869. if ( !type ) {
  7870. for ( type in events ) {
  7871. jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
  7872. }
  7873. continue;
  7874. }
  7875. special = jQuery.event.special[ type ] || {};
  7876. type = ( selector ? special.delegateType : special.bindType ) || type;
  7877. handlers = events[ type ] || [];
  7878. tmp = tmp[ 2 ] &&
  7879. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
  7880. // Remove matching events
  7881. origCount = j = handlers.length;
  7882. while ( j-- ) {
  7883. handleObj = handlers[ j ];
  7884. if ( ( mappedTypes || origType === handleObj.origType ) &&
  7885. ( !handler || handler.guid === handleObj.guid ) &&
  7886. ( !tmp || tmp.test( handleObj.namespace ) ) &&
  7887. ( !selector || selector === handleObj.selector ||
  7888. selector === "**" && handleObj.selector ) ) {
  7889. handlers.splice( j, 1 );
  7890. if ( handleObj.selector ) {
  7891. handlers.delegateCount--;
  7892. }
  7893. if ( special.remove ) {
  7894. special.remove.call( elem, handleObj );
  7895. }
  7896. }
  7897. }
  7898. // Remove generic event handler if we removed something and no more handlers exist
  7899. // (avoids potential for endless recursion during removal of special event handlers)
  7900. if ( origCount && !handlers.length ) {
  7901. if ( !special.teardown ||
  7902. special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
  7903. jQuery.removeEvent( elem, type, elemData.handle );
  7904. }
  7905. delete events[ type ];
  7906. }
  7907. }
  7908. // Remove data and the expando if it's no longer used
  7909. if ( jQuery.isEmptyObject( events ) ) {
  7910. dataPriv.remove( elem, "handle events" );
  7911. }
  7912. },
  7913. dispatch: function( nativeEvent ) {
  7914. // Make a writable jQuery.Event from the native event object
  7915. var event = jQuery.event.fix( nativeEvent );
  7916. var i, j, ret, matched, handleObj, handlerQueue,
  7917. args = new Array( arguments.length ),
  7918. handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
  7919. special = jQuery.event.special[ event.type ] || {};
  7920. // Use the fix-ed jQuery.Event rather than the (read-only) native event
  7921. args[ 0 ] = event;
  7922. for ( i = 1; i < arguments.length; i++ ) {
  7923. args[ i ] = arguments[ i ];
  7924. }
  7925. event.delegateTarget = this;
  7926. // Call the preDispatch hook for the mapped type, and let it bail if desired
  7927. if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
  7928. return;
  7929. }
  7930. // Determine handlers
  7931. handlerQueue = jQuery.event.handlers.call( this, event, handlers );
  7932. // Run delegates first; they may want to stop propagation beneath us
  7933. i = 0;
  7934. while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
  7935. event.currentTarget = matched.elem;
  7936. j = 0;
  7937. while ( ( handleObj = matched.handlers[ j++ ] ) &&
  7938. !event.isImmediatePropagationStopped() ) {
  7939. // Triggered event must either 1) have no namespace, or 2) have namespace(s)
  7940. // a subset or equal to those in the bound event (both can have no namespace).
  7941. if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {
  7942. event.handleObj = handleObj;
  7943. event.data = handleObj.data;
  7944. ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
  7945. handleObj.handler ).apply( matched.elem, args );
  7946. if ( ret !== undefined ) {
  7947. if ( ( event.result = ret ) === false ) {
  7948. event.preventDefault();
  7949. event.stopPropagation();
  7950. }
  7951. }
  7952. }
  7953. }
  7954. }
  7955. // Call the postDispatch hook for the mapped type
  7956. if ( special.postDispatch ) {
  7957. special.postDispatch.call( this, event );
  7958. }
  7959. return event.result;
  7960. },
  7961. handlers: function( event, handlers ) {
  7962. var i, handleObj, sel, matchedHandlers, matchedSelectors,
  7963. handlerQueue = [],
  7964. delegateCount = handlers.delegateCount,
  7965. cur = event.target;
  7966. // Find delegate handlers
  7967. if ( delegateCount &&
  7968. // Support: IE <=9
  7969. // Black-hole SVG <use> instance trees (trac-13180)
  7970. cur.nodeType &&
  7971. // Support: Firefox <=42
  7972. // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
  7973. // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
  7974. // Support: IE 11 only
  7975. // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
  7976. !( event.type === "click" && event.button >= 1 ) ) {
  7977. for ( ; cur !== this; cur = cur.parentNode || this ) {
  7978. // Don't check non-elements (#13208)
  7979. // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
  7980. if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
  7981. matchedHandlers = [];
  7982. matchedSelectors = {};
  7983. for ( i = 0; i < delegateCount; i++ ) {
  7984. handleObj = handlers[ i ];
  7985. // Don't conflict with Object.prototype properties (#13203)
  7986. sel = handleObj.selector + " ";
  7987. if ( matchedSelectors[ sel ] === undefined ) {
  7988. matchedSelectors[ sel ] = handleObj.needsContext ?
  7989. jQuery( sel, this ).index( cur ) > -1 :
  7990. jQuery.find( sel, this, null, [ cur ] ).length;
  7991. }
  7992. if ( matchedSelectors[ sel ] ) {
  7993. matchedHandlers.push( handleObj );
  7994. }
  7995. }
  7996. if ( matchedHandlers.length ) {
  7997. handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
  7998. }
  7999. }
  8000. }
  8001. }
  8002. // Add the remaining (directly-bound) handlers
  8003. cur = this;
  8004. if ( delegateCount < handlers.length ) {
  8005. handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
  8006. }
  8007. return handlerQueue;
  8008. },
  8009. addProp: function( name, hook ) {
  8010. Object.defineProperty( jQuery.Event.prototype, name, {
  8011. enumerable: true,
  8012. configurable: true,
  8013. get: jQuery.isFunction( hook ) ?
  8014. function() {
  8015. if ( this.originalEvent ) {
  8016. return hook( this.originalEvent );
  8017. }
  8018. } :
  8019. function() {
  8020. if ( this.originalEvent ) {
  8021. return this.originalEvent[ name ];
  8022. }
  8023. },
  8024. set: function( value ) {
  8025. Object.defineProperty( this, name, {
  8026. enumerable: true,
  8027. configurable: true,
  8028. writable: true,
  8029. value: value
  8030. } );
  8031. }
  8032. } );
  8033. },
  8034. fix: function( originalEvent ) {
  8035. return originalEvent[ jQuery.expando ] ?
  8036. originalEvent :
  8037. new jQuery.Event( originalEvent );
  8038. },
  8039. special: {
  8040. load: {
  8041. // Prevent triggered image.load events from bubbling to window.load
  8042. noBubble: true
  8043. },
  8044. focus: {
  8045. // Fire native event if possible so blur/focus sequence is correct
  8046. trigger: function() {
  8047. if ( this !== safeActiveElement() && this.focus ) {
  8048. this.focus();
  8049. return false;
  8050. }
  8051. },
  8052. delegateType: "focusin"
  8053. },
  8054. blur: {
  8055. trigger: function() {
  8056. if ( this === safeActiveElement() && this.blur ) {
  8057. this.blur();
  8058. return false;
  8059. }
  8060. },
  8061. delegateType: "focusout"
  8062. },
  8063. click: {
  8064. // For checkbox, fire native event so checked state will be right
  8065. trigger: function() {
  8066. if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
  8067. this.click();
  8068. return false;
  8069. }
  8070. },
  8071. // For cross-browser consistency, don't fire native .click() on links
  8072. _default: function( event ) {
  8073. return jQuery.nodeName( event.target, "a" );
  8074. }
  8075. },
  8076. beforeunload: {
  8077. postDispatch: function( event ) {
  8078. // Support: Firefox 20+
  8079. // Firefox doesn't alert if the returnValue field is not set.
  8080. if ( event.result !== undefined && event.originalEvent ) {
  8081. event.originalEvent.returnValue = event.result;
  8082. }
  8083. }
  8084. }
  8085. }
  8086. };
  8087. jQuery.removeEvent = function( elem, type, handle ) {
  8088. // This "if" is needed for plain objects
  8089. if ( elem.removeEventListener ) {
  8090. elem.removeEventListener( type, handle );
  8091. }
  8092. };
  8093. jQuery.Event = function( src, props ) {
  8094. // Allow instantiation without the 'new' keyword
  8095. if ( !( this instanceof jQuery.Event ) ) {
  8096. return new jQuery.Event( src, props );
  8097. }
  8098. // Event object
  8099. if ( src && src.type ) {
  8100. this.originalEvent = src;
  8101. this.type = src.type;
  8102. // Events bubbling up the document may have been marked as prevented
  8103. // by a handler lower down the tree; reflect the correct value.
  8104. this.isDefaultPrevented = src.defaultPrevented ||
  8105. src.defaultPrevented === undefined &&
  8106. // Support: Android <=2.3 only
  8107. src.returnValue === false ?
  8108. returnTrue :
  8109. returnFalse;
  8110. // Create target properties
  8111. // Support: Safari <=6 - 7 only
  8112. // Target should not be a text node (#504, #13143)
  8113. this.target = ( src.target && src.target.nodeType === 3 ) ?
  8114. src.target.parentNode :
  8115. src.target;
  8116. this.currentTarget = src.currentTarget;
  8117. this.relatedTarget = src.relatedTarget;
  8118. // Event type
  8119. } else {
  8120. this.type = src;
  8121. }
  8122. // Put explicitly provided properties onto the event object
  8123. if ( props ) {
  8124. jQuery.extend( this, props );
  8125. }
  8126. // Create a timestamp if incoming event doesn't have one
  8127. this.timeStamp = src && src.timeStamp || jQuery.now();
  8128. // Mark it as fixed
  8129. this[ jQuery.expando ] = true;
  8130. };
  8131. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  8132. // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  8133. jQuery.Event.prototype = {
  8134. constructor: jQuery.Event,
  8135. isDefaultPrevented: returnFalse,
  8136. isPropagationStopped: returnFalse,
  8137. isImmediatePropagationStopped: returnFalse,
  8138. isSimulated: false,
  8139. preventDefault: function() {
  8140. var e = this.originalEvent;
  8141. this.isDefaultPrevented = returnTrue;
  8142. if ( e && !this.isSimulated ) {
  8143. e.preventDefault();
  8144. }
  8145. },
  8146. stopPropagation: function() {
  8147. var e = this.originalEvent;
  8148. this.isPropagationStopped = returnTrue;
  8149. if ( e && !this.isSimulated ) {
  8150. e.stopPropagation();
  8151. }
  8152. },
  8153. stopImmediatePropagation: function() {
  8154. var e = this.originalEvent;
  8155. this.isImmediatePropagationStopped = returnTrue;
  8156. if ( e && !this.isSimulated ) {
  8157. e.stopImmediatePropagation();
  8158. }
  8159. this.stopPropagation();
  8160. }
  8161. };
  8162. // Includes all common event props including KeyEvent and MouseEvent specific props
  8163. jQuery.each( {
  8164. altKey: true,
  8165. bubbles: true,
  8166. cancelable: true,
  8167. changedTouches: true,
  8168. ctrlKey: true,
  8169. detail: true,
  8170. eventPhase: true,
  8171. metaKey: true,
  8172. pageX: true,
  8173. pageY: true,
  8174. shiftKey: true,
  8175. view: true,
  8176. "char": true,
  8177. charCode: true,
  8178. key: true,
  8179. keyCode: true,
  8180. button: true,
  8181. buttons: true,
  8182. clientX: true,
  8183. clientY: true,
  8184. offsetX: true,
  8185. offsetY: true,
  8186. pointerId: true,
  8187. pointerType: true,
  8188. screenX: true,
  8189. screenY: true,
  8190. targetTouches: true,
  8191. toElement: true,
  8192. touches: true,
  8193. which: function( event ) {
  8194. var button = event.button;
  8195. // Add which for key events
  8196. if ( event.which == null && rkeyEvent.test( event.type ) ) {
  8197. return event.charCode != null ? event.charCode : event.keyCode;
  8198. }
  8199. // Add which for click: 1 === left; 2 === middle; 3 === right
  8200. if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
  8201. if ( button & 1 ) {
  8202. return 1;
  8203. }
  8204. if ( button & 2 ) {
  8205. return 3;
  8206. }
  8207. if ( button & 4 ) {
  8208. return 2;
  8209. }
  8210. return 0;
  8211. }
  8212. return event.which;
  8213. }
  8214. }, jQuery.event.addProp );
  8215. // Create mouseenter/leave events using mouseover/out and event-time checks
  8216. // so that event delegation works in jQuery.
  8217. // Do the same for pointerenter/pointerleave and pointerover/pointerout
  8218. //
  8219. // Support: Safari 7 only
  8220. // Safari sends mouseenter too often; see:
  8221. // https://bugs.chromium.org/p/chromium/issues/detail?id=470258
  8222. // for the description of the bug (it existed in older Chrome versions as well).
  8223. jQuery.each( {
  8224. mouseenter: "mouseover",
  8225. mouseleave: "mouseout",
  8226. pointerenter: "pointerover",
  8227. pointerleave: "pointerout"
  8228. }, function( orig, fix ) {
  8229. jQuery.event.special[ orig ] = {
  8230. delegateType: fix,
  8231. bindType: fix,
  8232. handle: function( event ) {
  8233. var ret,
  8234. target = this,
  8235. related = event.relatedTarget,
  8236. handleObj = event.handleObj;
  8237. // For mouseenter/leave call the handler if related is outside the target.
  8238. // NB: No relatedTarget if the mouse left/entered the browser window
  8239. if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
  8240. event.type = handleObj.origType;
  8241. ret = handleObj.handler.apply( this, arguments );
  8242. event.type = fix;
  8243. }
  8244. return ret;
  8245. }
  8246. };
  8247. } );
  8248. jQuery.fn.extend( {
  8249. on: function( types, selector, data, fn ) {
  8250. return on( this, types, selector, data, fn );
  8251. },
  8252. one: function( types, selector, data, fn ) {
  8253. return on( this, types, selector, data, fn, 1 );
  8254. },
  8255. off: function( types, selector, fn ) {
  8256. var handleObj, type;
  8257. if ( types && types.preventDefault && types.handleObj ) {
  8258. // ( event ) dispatched jQuery.Event
  8259. handleObj = types.handleObj;
  8260. jQuery( types.delegateTarget ).off(
  8261. handleObj.namespace ?
  8262. handleObj.origType + "." + handleObj.namespace :
  8263. handleObj.origType,
  8264. handleObj.selector,
  8265. handleObj.handler
  8266. );
  8267. return this;
  8268. }
  8269. if ( typeof types === "object" ) {
  8270. // ( types-object [, selector] )
  8271. for ( type in types ) {
  8272. this.off( type, selector, types[ type ] );
  8273. }
  8274. return this;
  8275. }
  8276. if ( selector === false || typeof selector === "function" ) {
  8277. // ( types [, fn] )
  8278. fn = selector;
  8279. selector = undefined;
  8280. }
  8281. if ( fn === false ) {
  8282. fn = returnFalse;
  8283. }
  8284. return this.each( function() {
  8285. jQuery.event.remove( this, types, fn, selector );
  8286. } );
  8287. }
  8288. } );
  8289. var
  8290. /* eslint-disable max-len */
  8291. // See https://github.com/eslint/eslint/issues/3229
  8292. rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
  8293. /* eslint-enable */
  8294. // Support: IE <=10 - 11, Edge 12 - 13
  8295. // In IE/Edge using regex groups here causes severe slowdowns.
  8296. // See https://connect.microsoft.com/IE/feedback/details/1736512/
  8297. rnoInnerhtml = /<script|<style|<link/i,
  8298. // checked="checked" or checked
  8299. rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
  8300. rscriptTypeMasked = /^true\/(.*)/,
  8301. rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
  8302. function manipulationTarget( elem, content ) {
  8303. if ( jQuery.nodeName( elem, "table" ) &&
  8304. jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
  8305. return elem.getElementsByTagName( "tbody" )[ 0 ] || elem;
  8306. }
  8307. return elem;
  8308. }
  8309. // Replace/restore the type attribute of script elements for safe DOM manipulation
  8310. function disableScript( elem ) {
  8311. elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
  8312. return elem;
  8313. }
  8314. function restoreScript( elem ) {
  8315. var match = rscriptTypeMasked.exec( elem.type );
  8316. if ( match ) {
  8317. elem.type = match[ 1 ];
  8318. } else {
  8319. elem.removeAttribute( "type" );
  8320. }
  8321. return elem;
  8322. }
  8323. function cloneCopyEvent( src, dest ) {
  8324. var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
  8325. if ( dest.nodeType !== 1 ) {
  8326. return;
  8327. }
  8328. // 1. Copy private data: events, handlers, etc.
  8329. if ( dataPriv.hasData( src ) ) {
  8330. pdataOld = dataPriv.access( src );
  8331. pdataCur = dataPriv.set( dest, pdataOld );
  8332. events = pdataOld.events;
  8333. if ( events ) {
  8334. delete pdataCur.handle;
  8335. pdataCur.events = {};
  8336. for ( type in events ) {
  8337. for ( i = 0, l = events[ type ].length; i < l; i++ ) {
  8338. jQuery.event.add( dest, type, events[ type ][ i ] );
  8339. }
  8340. }
  8341. }
  8342. }
  8343. // 2. Copy user data
  8344. if ( dataUser.hasData( src ) ) {
  8345. udataOld = dataUser.access( src );
  8346. udataCur = jQuery.extend( {}, udataOld );
  8347. dataUser.set( dest, udataCur );
  8348. }
  8349. }
  8350. // Fix IE bugs, see support tests
  8351. function fixInput( src, dest ) {
  8352. var nodeName = dest.nodeName.toLowerCase();
  8353. // Fails to persist the checked state of a cloned checkbox or radio button.
  8354. if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
  8355. dest.checked = src.checked;
  8356. // Fails to return the selected option to the default selected state when cloning options
  8357. } else if ( nodeName === "input" || nodeName === "textarea" ) {
  8358. dest.defaultValue = src.defaultValue;
  8359. }
  8360. }
  8361. function domManip( collection, args, callback, ignored ) {
  8362. // Flatten any nested arrays
  8363. args = concat.apply( [], args );
  8364. var fragment, first, scripts, hasScripts, node, doc,
  8365. i = 0,
  8366. l = collection.length,
  8367. iNoClone = l - 1,
  8368. value = args[ 0 ],
  8369. isFunction = jQuery.isFunction( value );
  8370. // We can't cloneNode fragments that contain checked, in WebKit
  8371. if ( isFunction ||
  8372. ( l > 1 && typeof value === "string" &&
  8373. !support.checkClone && rchecked.test( value ) ) ) {
  8374. return collection.each( function( index ) {
  8375. var self = collection.eq( index );
  8376. if ( isFunction ) {
  8377. args[ 0 ] = value.call( this, index, self.html() );
  8378. }
  8379. domManip( self, args, callback, ignored );
  8380. } );
  8381. }
  8382. if ( l ) {
  8383. fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
  8384. first = fragment.firstChild;
  8385. if ( fragment.childNodes.length === 1 ) {
  8386. fragment = first;
  8387. }
  8388. // Require either new content or an interest in ignored elements to invoke the callback
  8389. if ( first || ignored ) {
  8390. scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
  8391. hasScripts = scripts.length;
  8392. // Use the original fragment for the last item
  8393. // instead of the first because it can end up
  8394. // being emptied incorrectly in certain situations (#8070).
  8395. for ( ; i < l; i++ ) {
  8396. node = fragment;
  8397. if ( i !== iNoClone ) {
  8398. node = jQuery.clone( node, true, true );
  8399. // Keep references to cloned scripts for later restoration
  8400. if ( hasScripts ) {
  8401. // Support: Android <=4.0 only, PhantomJS 1 only
  8402. // push.apply(_, arraylike) throws on ancient WebKit
  8403. jQuery.merge( scripts, getAll( node, "script" ) );
  8404. }
  8405. }
  8406. callback.call( collection[ i ], node, i );
  8407. }
  8408. if ( hasScripts ) {
  8409. doc = scripts[ scripts.length - 1 ].ownerDocument;
  8410. // Reenable scripts
  8411. jQuery.map( scripts, restoreScript );
  8412. // Evaluate executable scripts on first document insertion
  8413. for ( i = 0; i < hasScripts; i++ ) {
  8414. node = scripts[ i ];
  8415. if ( rscriptType.test( node.type || "" ) &&
  8416. !dataPriv.access( node, "globalEval" ) &&
  8417. jQuery.contains( doc, node ) ) {
  8418. if ( node.src ) {
  8419. // Optional AJAX dependency, but won't run scripts if not present
  8420. if ( jQuery._evalUrl ) {
  8421. jQuery._evalUrl( node.src );
  8422. }
  8423. } else {
  8424. DOMEval( node.textContent.replace( rcleanScript, "" ), doc );
  8425. }
  8426. }
  8427. }
  8428. }
  8429. }
  8430. }
  8431. return collection;
  8432. }
  8433. function remove( elem, selector, keepData ) {
  8434. var node,
  8435. nodes = selector ? jQuery.filter( selector, elem ) : elem,
  8436. i = 0;
  8437. for ( ; ( node = nodes[ i ] ) != null; i++ ) {
  8438. if ( !keepData && node.nodeType === 1 ) {
  8439. jQuery.cleanData( getAll( node ) );
  8440. }
  8441. if ( node.parentNode ) {
  8442. if ( keepData && jQuery.contains( node.ownerDocument, node ) ) {
  8443. setGlobalEval( getAll( node, "script" ) );
  8444. }
  8445. node.parentNode.removeChild( node );
  8446. }
  8447. }
  8448. return elem;
  8449. }
  8450. jQuery.extend( {
  8451. htmlPrefilter: function( html ) {
  8452. return html.replace( rxhtmlTag, "<$1></$2>" );
  8453. },
  8454. clone: function( elem, dataAndEvents, deepDataAndEvents ) {
  8455. var i, l, srcElements, destElements,
  8456. clone = elem.cloneNode( true ),
  8457. inPage = jQuery.contains( elem.ownerDocument, elem );
  8458. // Fix IE cloning issues
  8459. if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
  8460. !jQuery.isXMLDoc( elem ) ) {
  8461. // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
  8462. destElements = getAll( clone );
  8463. srcElements = getAll( elem );
  8464. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  8465. fixInput( srcElements[ i ], destElements[ i ] );
  8466. }
  8467. }
  8468. // Copy the events from the original to the clone
  8469. if ( dataAndEvents ) {
  8470. if ( deepDataAndEvents ) {
  8471. srcElements = srcElements || getAll( elem );
  8472. destElements = destElements || getAll( clone );
  8473. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  8474. cloneCopyEvent( srcElements[ i ], destElements[ i ] );
  8475. }
  8476. } else {
  8477. cloneCopyEvent( elem, clone );
  8478. }
  8479. }
  8480. // Preserve script evaluation history
  8481. destElements = getAll( clone, "script" );
  8482. if ( destElements.length > 0 ) {
  8483. setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
  8484. }
  8485. // Return the cloned set
  8486. return clone;
  8487. },
  8488. cleanData: function( elems ) {
  8489. var data, elem, type,
  8490. special = jQuery.event.special,
  8491. i = 0;
  8492. for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
  8493. if ( acceptData( elem ) ) {
  8494. if ( ( data = elem[ dataPriv.expando ] ) ) {
  8495. if ( data.events ) {
  8496. for ( type in data.events ) {
  8497. if ( special[ type ] ) {
  8498. jQuery.event.remove( elem, type );
  8499. // This is a shortcut to avoid jQuery.event.remove's overhead
  8500. } else {
  8501. jQuery.removeEvent( elem, type, data.handle );
  8502. }
  8503. }
  8504. }
  8505. // Support: Chrome <=35 - 45+
  8506. // Assign undefined instead of using delete, see Data#remove
  8507. elem[ dataPriv.expando ] = undefined;
  8508. }
  8509. if ( elem[ dataUser.expando ] ) {
  8510. // Support: Chrome <=35 - 45+
  8511. // Assign undefined instead of using delete, see Data#remove
  8512. elem[ dataUser.expando ] = undefined;
  8513. }
  8514. }
  8515. }
  8516. }
  8517. } );
  8518. jQuery.fn.extend( {
  8519. detach: function( selector ) {
  8520. return remove( this, selector, true );
  8521. },
  8522. remove: function( selector ) {
  8523. return remove( this, selector );
  8524. },
  8525. text: function( value ) {
  8526. return access( this, function( value ) {
  8527. return value === undefined ?
  8528. jQuery.text( this ) :
  8529. this.empty().each( function() {
  8530. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  8531. this.textContent = value;
  8532. }
  8533. } );
  8534. }, null, value, arguments.length );
  8535. },
  8536. append: function() {
  8537. return domManip( this, arguments, function( elem ) {
  8538. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  8539. var target = manipulationTarget( this, elem );
  8540. target.appendChild( elem );
  8541. }
  8542. } );
  8543. },
  8544. prepend: function() {
  8545. return domManip( this, arguments, function( elem ) {
  8546. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  8547. var target = manipulationTarget( this, elem );
  8548. target.insertBefore( elem, target.firstChild );
  8549. }
  8550. } );
  8551. },
  8552. before: function() {
  8553. return domManip( this, arguments, function( elem ) {
  8554. if ( this.parentNode ) {
  8555. this.parentNode.insertBefore( elem, this );
  8556. }
  8557. } );
  8558. },
  8559. after: function() {
  8560. return domManip( this, arguments, function( elem ) {
  8561. if ( this.parentNode ) {
  8562. this.parentNode.insertBefore( elem, this.nextSibling );
  8563. }
  8564. } );
  8565. },
  8566. empty: function() {
  8567. var elem,
  8568. i = 0;
  8569. for ( ; ( elem = this[ i ] ) != null; i++ ) {
  8570. if ( elem.nodeType === 1 ) {
  8571. // Prevent memory leaks
  8572. jQuery.cleanData( getAll( elem, false ) );
  8573. // Remove any remaining nodes
  8574. elem.textContent = "";
  8575. }
  8576. }
  8577. return this;
  8578. },
  8579. clone: function( dataAndEvents, deepDataAndEvents ) {
  8580. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  8581. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  8582. return this.map( function() {
  8583. return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
  8584. } );
  8585. },
  8586. html: function( value ) {
  8587. return access( this, function( value ) {
  8588. var elem = this[ 0 ] || {},
  8589. i = 0,
  8590. l = this.length;
  8591. if ( value === undefined && elem.nodeType === 1 ) {
  8592. return elem.innerHTML;
  8593. }
  8594. // See if we can take a shortcut and just use innerHTML
  8595. if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
  8596. !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
  8597. value = jQuery.htmlPrefilter( value );
  8598. try {
  8599. for ( ; i < l; i++ ) {
  8600. elem = this[ i ] || {};
  8601. // Remove element nodes and prevent memory leaks
  8602. if ( elem.nodeType === 1 ) {
  8603. jQuery.cleanData( getAll( elem, false ) );
  8604. elem.innerHTML = value;
  8605. }
  8606. }
  8607. elem = 0;
  8608. // If using innerHTML throws an exception, use the fallback method
  8609. } catch ( e ) {}
  8610. }
  8611. if ( elem ) {
  8612. this.empty().append( value );
  8613. }
  8614. }, null, value, arguments.length );
  8615. },
  8616. replaceWith: function() {
  8617. var ignored = [];
  8618. // Make the changes, replacing each non-ignored context element with the new content
  8619. return domManip( this, arguments, function( elem ) {
  8620. var parent = this.parentNode;
  8621. if ( jQuery.inArray( this, ignored ) < 0 ) {
  8622. jQuery.cleanData( getAll( this ) );
  8623. if ( parent ) {
  8624. parent.replaceChild( elem, this );
  8625. }
  8626. }
  8627. // Force callback invocation
  8628. }, ignored );
  8629. }
  8630. } );
  8631. jQuery.each( {
  8632. appendTo: "append",
  8633. prependTo: "prepend",
  8634. insertBefore: "before",
  8635. insertAfter: "after",
  8636. replaceAll: "replaceWith"
  8637. }, function( name, original ) {
  8638. jQuery.fn[ name ] = function( selector ) {
  8639. var elems,
  8640. ret = [],
  8641. insert = jQuery( selector ),
  8642. last = insert.length - 1,
  8643. i = 0;
  8644. for ( ; i <= last; i++ ) {
  8645. elems = i === last ? this : this.clone( true );
  8646. jQuery( insert[ i ] )[ original ]( elems );
  8647. // Support: Android <=4.0 only, PhantomJS 1 only
  8648. // .get() because push.apply(_, arraylike) throws on ancient WebKit
  8649. push.apply( ret, elems.get() );
  8650. }
  8651. return this.pushStack( ret );
  8652. };
  8653. } );
  8654. var rmargin = ( /^margin/ );
  8655. var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
  8656. var getStyles = function( elem ) {
  8657. // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
  8658. // IE throws on elements created in popups
  8659. // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
  8660. var view = elem.ownerDocument.defaultView;
  8661. if ( !view || !view.opener ) {
  8662. view = window;
  8663. }
  8664. return view.getComputedStyle( elem );
  8665. };
  8666. ( function() {
  8667. // Executing both pixelPosition & boxSizingReliable tests require only one layout
  8668. // so they're executed at the same time to save the second computation.
  8669. function computeStyleTests() {
  8670. // This is a singleton, we need to execute it only once
  8671. if ( !div ) {
  8672. return;
  8673. }
  8674. div.style.cssText =
  8675. "box-sizing:border-box;" +
  8676. "position:relative;display:block;" +
  8677. "margin:auto;border:1px;padding:1px;" +
  8678. "top:1%;width:50%";
  8679. div.innerHTML = "";
  8680. documentElement.appendChild( container );
  8681. var divStyle = window.getComputedStyle( div );
  8682. pixelPositionVal = divStyle.top !== "1%";
  8683. // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
  8684. reliableMarginLeftVal = divStyle.marginLeft === "2px";
  8685. boxSizingReliableVal = divStyle.width === "4px";
  8686. // Support: Android 4.0 - 4.3 only
  8687. // Some styles come back with percentage values, even though they shouldn't
  8688. div.style.marginRight = "50%";
  8689. pixelMarginRightVal = divStyle.marginRight === "4px";
  8690. documentElement.removeChild( container );
  8691. // Nullify the div so it wouldn't be stored in the memory and
  8692. // it will also be a sign that checks already performed
  8693. div = null;
  8694. }
  8695. var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal,
  8696. container = document.createElement( "div" ),
  8697. div = document.createElement( "div" );
  8698. // Finish early in limited (non-browser) environments
  8699. if ( !div.style ) {
  8700. return;
  8701. }
  8702. // Support: IE <=9 - 11 only
  8703. // Style of cloned element affects source element cloned (#8908)
  8704. div.style.backgroundClip = "content-box";
  8705. div.cloneNode( true ).style.backgroundClip = "";
  8706. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  8707. container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" +
  8708. "padding:0;margin-top:1px;position:absolute";
  8709. container.appendChild( div );
  8710. jQuery.extend( support, {
  8711. pixelPosition: function() {
  8712. computeStyleTests();
  8713. return pixelPositionVal;
  8714. },
  8715. boxSizingReliable: function() {
  8716. computeStyleTests();
  8717. return boxSizingReliableVal;
  8718. },
  8719. pixelMarginRight: function() {
  8720. computeStyleTests();
  8721. return pixelMarginRightVal;
  8722. },
  8723. reliableMarginLeft: function() {
  8724. computeStyleTests();
  8725. return reliableMarginLeftVal;
  8726. }
  8727. } );
  8728. } )();
  8729. function curCSS( elem, name, computed ) {
  8730. var width, minWidth, maxWidth, ret,
  8731. style = elem.style;
  8732. computed = computed || getStyles( elem );
  8733. // Support: IE <=9 only
  8734. // getPropertyValue is only needed for .css('filter') (#12537)
  8735. if ( computed ) {
  8736. ret = computed.getPropertyValue( name ) || computed[ name ];
  8737. if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
  8738. ret = jQuery.style( elem, name );
  8739. }
  8740. // A tribute to the "awesome hack by Dean Edwards"
  8741. // Android Browser returns percentage for some values,
  8742. // but width seems to be reliably pixels.
  8743. // This is against the CSSOM draft spec:
  8744. // https://drafts.csswg.org/cssom/#resolved-values
  8745. if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
  8746. // Remember the original values
  8747. width = style.width;
  8748. minWidth = style.minWidth;
  8749. maxWidth = style.maxWidth;
  8750. // Put in the new values to get a computed value out
  8751. style.minWidth = style.maxWidth = style.width = ret;
  8752. ret = computed.width;
  8753. // Revert the changed values
  8754. style.width = width;
  8755. style.minWidth = minWidth;
  8756. style.maxWidth = maxWidth;
  8757. }
  8758. }
  8759. return ret !== undefined ?
  8760. // Support: IE <=9 - 11 only
  8761. // IE returns zIndex value as an integer.
  8762. ret + "" :
  8763. ret;
  8764. }
  8765. function addGetHookIf( conditionFn, hookFn ) {
  8766. // Define the hook, we'll check on the first run if it's really needed.
  8767. return {
  8768. get: function() {
  8769. if ( conditionFn() ) {
  8770. // Hook not needed (or it's not possible to use it due
  8771. // to missing dependency), remove it.
  8772. delete this.get;
  8773. return;
  8774. }
  8775. // Hook needed; redefine it so that the support test is not executed again.
  8776. return ( this.get = hookFn ).apply( this, arguments );
  8777. }
  8778. };
  8779. }
  8780. var
  8781. // Swappable if display is none or starts with table
  8782. // except "table", "table-cell", or "table-caption"
  8783. // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
  8784. rdisplayswap = /^(none|table(?!-c[ea]).+)/,
  8785. cssShow = { position: "absolute", visibility: "hidden", display: "block" },
  8786. cssNormalTransform = {
  8787. letterSpacing: "0",
  8788. fontWeight: "400"
  8789. },
  8790. cssPrefixes = [ "Webkit", "Moz", "ms" ],
  8791. emptyStyle = document.createElement( "div" ).style;
  8792. // Return a css property mapped to a potentially vendor prefixed property
  8793. function vendorPropName( name ) {
  8794. // Shortcut for names that are not vendor prefixed
  8795. if ( name in emptyStyle ) {
  8796. return name;
  8797. }
  8798. // Check for vendor prefixed names
  8799. var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
  8800. i = cssPrefixes.length;
  8801. while ( i-- ) {
  8802. name = cssPrefixes[ i ] + capName;
  8803. if ( name in emptyStyle ) {
  8804. return name;
  8805. }
  8806. }
  8807. }
  8808. function setPositiveNumber( elem, value, subtract ) {
  8809. // Any relative (+/-) values have already been
  8810. // normalized at this point
  8811. var matches = rcssNum.exec( value );
  8812. return matches ?
  8813. // Guard against undefined "subtract", e.g., when used as in cssHooks
  8814. Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
  8815. value;
  8816. }
  8817. function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
  8818. var i,
  8819. val = 0;
  8820. // If we already have the right measurement, avoid augmentation
  8821. if ( extra === ( isBorderBox ? "border" : "content" ) ) {
  8822. i = 4;
  8823. // Otherwise initialize for horizontal or vertical properties
  8824. } else {
  8825. i = name === "width" ? 1 : 0;
  8826. }
  8827. for ( ; i < 4; i += 2 ) {
  8828. // Both box models exclude margin, so add it if we want it
  8829. if ( extra === "margin" ) {
  8830. val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
  8831. }
  8832. if ( isBorderBox ) {
  8833. // border-box includes padding, so remove it if we want content
  8834. if ( extra === "content" ) {
  8835. val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  8836. }
  8837. // At this point, extra isn't border nor margin, so remove border
  8838. if ( extra !== "margin" ) {
  8839. val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  8840. }
  8841. } else {
  8842. // At this point, extra isn't content, so add padding
  8843. val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  8844. // At this point, extra isn't content nor padding, so add border
  8845. if ( extra !== "padding" ) {
  8846. val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  8847. }
  8848. }
  8849. }
  8850. return val;
  8851. }
  8852. function getWidthOrHeight( elem, name, extra ) {
  8853. // Start with offset property, which is equivalent to the border-box value
  8854. var val,
  8855. valueIsBorderBox = true,
  8856. styles = getStyles( elem ),
  8857. isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
  8858. // Support: IE <=11 only
  8859. // Running getBoundingClientRect on a disconnected node
  8860. // in IE throws an error.
  8861. if ( elem.getClientRects().length ) {
  8862. val = elem.getBoundingClientRect()[ name ];
  8863. }
  8864. // Some non-html elements return undefined for offsetWidth, so check for null/undefined
  8865. // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
  8866. // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
  8867. if ( val <= 0 || val == null ) {
  8868. // Fall back to computed then uncomputed css if necessary
  8869. val = curCSS( elem, name, styles );
  8870. if ( val < 0 || val == null ) {
  8871. val = elem.style[ name ];
  8872. }
  8873. // Computed unit is not pixels. Stop here and return.
  8874. if ( rnumnonpx.test( val ) ) {
  8875. return val;
  8876. }
  8877. // Check for style in case a browser which returns unreliable values
  8878. // for getComputedStyle silently falls back to the reliable elem.style
  8879. valueIsBorderBox = isBorderBox &&
  8880. ( support.boxSizingReliable() || val === elem.style[ name ] );
  8881. // Normalize "", auto, and prepare for extra
  8882. val = parseFloat( val ) || 0;
  8883. }
  8884. // Use the active box-sizing model to add/subtract irrelevant styles
  8885. return ( val +
  8886. augmentWidthOrHeight(
  8887. elem,
  8888. name,
  8889. extra || ( isBorderBox ? "border" : "content" ),
  8890. valueIsBorderBox,
  8891. styles
  8892. )
  8893. ) + "px";
  8894. }
  8895. jQuery.extend( {
  8896. // Add in style property hooks for overriding the default
  8897. // behavior of getting and setting a style property
  8898. cssHooks: {
  8899. opacity: {
  8900. get: function( elem, computed ) {
  8901. if ( computed ) {
  8902. // We should always get a number back from opacity
  8903. var ret = curCSS( elem, "opacity" );
  8904. return ret === "" ? "1" : ret;
  8905. }
  8906. }
  8907. }
  8908. },
  8909. // Don't automatically add "px" to these possibly-unitless properties
  8910. cssNumber: {
  8911. "animationIterationCount": true,
  8912. "columnCount": true,
  8913. "fillOpacity": true,
  8914. "flexGrow": true,
  8915. "flexShrink": true,
  8916. "fontWeight": true,
  8917. "lineHeight": true,
  8918. "opacity": true,
  8919. "order": true,
  8920. "orphans": true,
  8921. "widows": true,
  8922. "zIndex": true,
  8923. "zoom": true
  8924. },
  8925. // Add in properties whose names you wish to fix before
  8926. // setting or getting the value
  8927. cssProps: {
  8928. "float": "cssFloat"
  8929. },
  8930. // Get and set the style property on a DOM Node
  8931. style: function( elem, name, value, extra ) {
  8932. // Don't set styles on text and comment nodes
  8933. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
  8934. return;
  8935. }
  8936. // Make sure that we're working with the right name
  8937. var ret, type, hooks,
  8938. origName = jQuery.camelCase( name ),
  8939. style = elem.style;
  8940. name = jQuery.cssProps[ origName ] ||
  8941. ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
  8942. // Gets hook for the prefixed version, then unprefixed version
  8943. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  8944. // Check if we're setting a value
  8945. if ( value !== undefined ) {
  8946. type = typeof value;
  8947. // Convert "+=" or "-=" to relative numbers (#7345)
  8948. if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
  8949. value = adjustCSS( elem, name, ret );
  8950. // Fixes bug #9237
  8951. type = "number";
  8952. }
  8953. // Make sure that null and NaN values aren't set (#7116)
  8954. if ( value == null || value !== value ) {
  8955. return;
  8956. }
  8957. // If a number was passed in, add the unit (except for certain CSS properties)
  8958. if ( type === "number" ) {
  8959. value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
  8960. }
  8961. // background-* props affect original clone's values
  8962. if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
  8963. style[ name ] = "inherit";
  8964. }
  8965. // If a hook was provided, use that value, otherwise just set the specified value
  8966. if ( !hooks || !( "set" in hooks ) ||
  8967. ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
  8968. style[ name ] = value;
  8969. }
  8970. } else {
  8971. // If a hook was provided get the non-computed value from there
  8972. if ( hooks && "get" in hooks &&
  8973. ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
  8974. return ret;
  8975. }
  8976. // Otherwise just get the value from the style object
  8977. return style[ name ];
  8978. }
  8979. },
  8980. css: function( elem, name, extra, styles ) {
  8981. var val, num, hooks,
  8982. origName = jQuery.camelCase( name );
  8983. // Make sure that we're working with the right name
  8984. name = jQuery.cssProps[ origName ] ||
  8985. ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
  8986. // Try prefixed name followed by the unprefixed name
  8987. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  8988. // If a hook was provided get the computed value from there
  8989. if ( hooks && "get" in hooks ) {
  8990. val = hooks.get( elem, true, extra );
  8991. }
  8992. // Otherwise, if a way to get the computed value exists, use that
  8993. if ( val === undefined ) {
  8994. val = curCSS( elem, name, styles );
  8995. }
  8996. // Convert "normal" to computed value
  8997. if ( val === "normal" && name in cssNormalTransform ) {
  8998. val = cssNormalTransform[ name ];
  8999. }
  9000. // Make numeric if forced or a qualifier was provided and val looks numeric
  9001. if ( extra === "" || extra ) {
  9002. num = parseFloat( val );
  9003. return extra === true || isFinite( num ) ? num || 0 : val;
  9004. }
  9005. return val;
  9006. }
  9007. } );
  9008. jQuery.each( [ "height", "width" ], function( i, name ) {
  9009. jQuery.cssHooks[ name ] = {
  9010. get: function( elem, computed, extra ) {
  9011. if ( computed ) {
  9012. // Certain elements can have dimension info if we invisibly show them
  9013. // but it must have a current display style that would benefit
  9014. return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
  9015. // Support: Safari 8+
  9016. // Table columns in Safari have non-zero offsetWidth & zero
  9017. // getBoundingClientRect().width unless display is changed.
  9018. // Support: IE <=11 only
  9019. // Running getBoundingClientRect on a disconnected node
  9020. // in IE throws an error.
  9021. ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
  9022. swap( elem, cssShow, function() {
  9023. return getWidthOrHeight( elem, name, extra );
  9024. } ) :
  9025. getWidthOrHeight( elem, name, extra );
  9026. }
  9027. },
  9028. set: function( elem, value, extra ) {
  9029. var matches,
  9030. styles = extra && getStyles( elem ),
  9031. subtract = extra && augmentWidthOrHeight(
  9032. elem,
  9033. name,
  9034. extra,
  9035. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  9036. styles
  9037. );
  9038. // Convert to pixels if value adjustment is needed
  9039. if ( subtract && ( matches = rcssNum.exec( value ) ) &&
  9040. ( matches[ 3 ] || "px" ) !== "px" ) {
  9041. elem.style[ name ] = value;
  9042. value = jQuery.css( elem, name );
  9043. }
  9044. return setPositiveNumber( elem, value, subtract );
  9045. }
  9046. };
  9047. } );
  9048. jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
  9049. function( elem, computed ) {
  9050. if ( computed ) {
  9051. return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
  9052. elem.getBoundingClientRect().left -
  9053. swap( elem, { marginLeft: 0 }, function() {
  9054. return elem.getBoundingClientRect().left;
  9055. } )
  9056. ) + "px";
  9057. }
  9058. }
  9059. );
  9060. // These hooks are used by animate to expand properties
  9061. jQuery.each( {
  9062. margin: "",
  9063. padding: "",
  9064. border: "Width"
  9065. }, function( prefix, suffix ) {
  9066. jQuery.cssHooks[ prefix + suffix ] = {
  9067. expand: function( value ) {
  9068. var i = 0,
  9069. expanded = {},
  9070. // Assumes a single number if not a string
  9071. parts = typeof value === "string" ? value.split( " " ) : [ value ];
  9072. for ( ; i < 4; i++ ) {
  9073. expanded[ prefix + cssExpand[ i ] + suffix ] =
  9074. parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
  9075. }
  9076. return expanded;
  9077. }
  9078. };
  9079. if ( !rmargin.test( prefix ) ) {
  9080. jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
  9081. }
  9082. } );
  9083. jQuery.fn.extend( {
  9084. css: function( name, value ) {
  9085. return access( this, function( elem, name, value ) {
  9086. var styles, len,
  9087. map = {},
  9088. i = 0;
  9089. if ( jQuery.isArray( name ) ) {
  9090. styles = getStyles( elem );
  9091. len = name.length;
  9092. for ( ; i < len; i++ ) {
  9093. map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
  9094. }
  9095. return map;
  9096. }
  9097. return value !== undefined ?
  9098. jQuery.style( elem, name, value ) :
  9099. jQuery.css( elem, name );
  9100. }, name, value, arguments.length > 1 );
  9101. }
  9102. } );
  9103. function Tween( elem, options, prop, end, easing ) {
  9104. return new Tween.prototype.init( elem, options, prop, end, easing );
  9105. }
  9106. jQuery.Tween = Tween;
  9107. Tween.prototype = {
  9108. constructor: Tween,
  9109. init: function( elem, options, prop, end, easing, unit ) {
  9110. this.elem = elem;
  9111. this.prop = prop;
  9112. this.easing = easing || jQuery.easing._default;
  9113. this.options = options;
  9114. this.start = this.now = this.cur();
  9115. this.end = end;
  9116. this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
  9117. },
  9118. cur: function() {
  9119. var hooks = Tween.propHooks[ this.prop ];
  9120. return hooks && hooks.get ?
  9121. hooks.get( this ) :
  9122. Tween.propHooks._default.get( this );
  9123. },
  9124. run: function( percent ) {
  9125. var eased,
  9126. hooks = Tween.propHooks[ this.prop ];
  9127. if ( this.options.duration ) {
  9128. this.pos = eased = jQuery.easing[ this.easing ](
  9129. percent, this.options.duration * percent, 0, 1, this.options.duration
  9130. );
  9131. } else {
  9132. this.pos = eased = percent;
  9133. }
  9134. this.now = ( this.end - this.start ) * eased + this.start;
  9135. if ( this.options.step ) {
  9136. this.options.step.call( this.elem, this.now, this );
  9137. }
  9138. if ( hooks && hooks.set ) {
  9139. hooks.set( this );
  9140. } else {
  9141. Tween.propHooks._default.set( this );
  9142. }
  9143. return this;
  9144. }
  9145. };
  9146. Tween.prototype.init.prototype = Tween.prototype;
  9147. Tween.propHooks = {
  9148. _default: {
  9149. get: function( tween ) {
  9150. var result;
  9151. // Use a property on the element directly when it is not a DOM element,
  9152. // or when there is no matching style property that exists.
  9153. if ( tween.elem.nodeType !== 1 ||
  9154. tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
  9155. return tween.elem[ tween.prop ];
  9156. }
  9157. // Passing an empty string as a 3rd parameter to .css will automatically
  9158. // attempt a parseFloat and fallback to a string if the parse fails.
  9159. // Simple values such as "10px" are parsed to Float;
  9160. // complex values such as "rotate(1rad)" are returned as-is.
  9161. result = jQuery.css( tween.elem, tween.prop, "" );
  9162. // Empty strings, null, undefined and "auto" are converted to 0.
  9163. return !result || result === "auto" ? 0 : result;
  9164. },
  9165. set: function( tween ) {
  9166. // Use step hook for back compat.
  9167. // Use cssHook if its there.
  9168. // Use .style if available and use plain properties where available.
  9169. if ( jQuery.fx.step[ tween.prop ] ) {
  9170. jQuery.fx.step[ tween.prop ]( tween );
  9171. } else if ( tween.elem.nodeType === 1 &&
  9172. ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||
  9173. jQuery.cssHooks[ tween.prop ] ) ) {
  9174. jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
  9175. } else {
  9176. tween.elem[ tween.prop ] = tween.now;
  9177. }
  9178. }
  9179. }
  9180. };
  9181. // Support: IE <=9 only
  9182. // Panic based approach to setting things on disconnected nodes
  9183. Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
  9184. set: function( tween ) {
  9185. if ( tween.elem.nodeType && tween.elem.parentNode ) {
  9186. tween.elem[ tween.prop ] = tween.now;
  9187. }
  9188. }
  9189. };
  9190. jQuery.easing = {
  9191. linear: function( p ) {
  9192. return p;
  9193. },
  9194. swing: function( p ) {
  9195. return 0.5 - Math.cos( p * Math.PI ) / 2;
  9196. },
  9197. _default: "swing"
  9198. };
  9199. jQuery.fx = Tween.prototype.init;
  9200. // Back compat <1.8 extension point
  9201. jQuery.fx.step = {};
  9202. var
  9203. fxNow, timerId,
  9204. rfxtypes = /^(?:toggle|show|hide)$/,
  9205. rrun = /queueHooks$/;
  9206. function raf() {
  9207. if ( timerId ) {
  9208. window.requestAnimationFrame( raf );
  9209. jQuery.fx.tick();
  9210. }
  9211. }
  9212. // Animations created synchronously will run synchronously
  9213. function createFxNow() {
  9214. window.setTimeout( function() {
  9215. fxNow = undefined;
  9216. } );
  9217. return ( fxNow = jQuery.now() );
  9218. }
  9219. // Generate parameters to create a standard animation
  9220. function genFx( type, includeWidth ) {
  9221. var which,
  9222. i = 0,
  9223. attrs = { height: type };
  9224. // If we include width, step value is 1 to do all cssExpand values,
  9225. // otherwise step value is 2 to skip over Left and Right
  9226. includeWidth = includeWidth ? 1 : 0;
  9227. for ( ; i < 4; i += 2 - includeWidth ) {
  9228. which = cssExpand[ i ];
  9229. attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
  9230. }
  9231. if ( includeWidth ) {
  9232. attrs.opacity = attrs.width = type;
  9233. }
  9234. return attrs;
  9235. }
  9236. function createTween( value, prop, animation ) {
  9237. var tween,
  9238. collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
  9239. index = 0,
  9240. length = collection.length;
  9241. for ( ; index < length; index++ ) {
  9242. if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
  9243. // We're done with this property
  9244. return tween;
  9245. }
  9246. }
  9247. }
  9248. function defaultPrefilter( elem, props, opts ) {
  9249. var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
  9250. isBox = "width" in props || "height" in props,
  9251. anim = this,
  9252. orig = {},
  9253. style = elem.style,
  9254. hidden = elem.nodeType && isHiddenWithinTree( elem ),
  9255. dataShow = dataPriv.get( elem, "fxshow" );
  9256. // Queue-skipping animations hijack the fx hooks
  9257. if ( !opts.queue ) {
  9258. hooks = jQuery._queueHooks( elem, "fx" );
  9259. if ( hooks.unqueued == null ) {
  9260. hooks.unqueued = 0;
  9261. oldfire = hooks.empty.fire;
  9262. hooks.empty.fire = function() {
  9263. if ( !hooks.unqueued ) {
  9264. oldfire();
  9265. }
  9266. };
  9267. }
  9268. hooks.unqueued++;
  9269. anim.always( function() {
  9270. // Ensure the complete handler is called before this completes
  9271. anim.always( function() {
  9272. hooks.unqueued--;
  9273. if ( !jQuery.queue( elem, "fx" ).length ) {
  9274. hooks.empty.fire();
  9275. }
  9276. } );
  9277. } );
  9278. }
  9279. // Detect show/hide animations
  9280. for ( prop in props ) {
  9281. value = props[ prop ];
  9282. if ( rfxtypes.test( value ) ) {
  9283. delete props[ prop ];
  9284. toggle = toggle || value === "toggle";
  9285. if ( value === ( hidden ? "hide" : "show" ) ) {
  9286. // Pretend to be hidden if this is a "show" and
  9287. // there is still data from a stopped show/hide
  9288. if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
  9289. hidden = true;
  9290. // Ignore all other no-op show/hide data
  9291. } else {
  9292. continue;
  9293. }
  9294. }
  9295. orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
  9296. }
  9297. }
  9298. // Bail out if this is a no-op like .hide().hide()
  9299. propTween = !jQuery.isEmptyObject( props );
  9300. if ( !propTween && jQuery.isEmptyObject( orig ) ) {
  9301. return;
  9302. }
  9303. // Restrict "overflow" and "display" styles during box animations
  9304. if ( isBox && elem.nodeType === 1 ) {
  9305. // Support: IE <=9 - 11, Edge 12 - 13
  9306. // Record all 3 overflow attributes because IE does not infer the shorthand
  9307. // from identically-valued overflowX and overflowY
  9308. opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
  9309. // Identify a display type, preferring old show/hide data over the CSS cascade
  9310. restoreDisplay = dataShow && dataShow.display;
  9311. if ( restoreDisplay == null ) {
  9312. restoreDisplay = dataPriv.get( elem, "display" );
  9313. }
  9314. display = jQuery.css( elem, "display" );
  9315. if ( display === "none" ) {
  9316. if ( restoreDisplay ) {
  9317. display = restoreDisplay;
  9318. } else {
  9319. // Get nonempty value(s) by temporarily forcing visibility
  9320. showHide( [ elem ], true );
  9321. restoreDisplay = elem.style.display || restoreDisplay;
  9322. display = jQuery.css( elem, "display" );
  9323. showHide( [ elem ] );
  9324. }
  9325. }
  9326. // Animate inline elements as inline-block
  9327. if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
  9328. if ( jQuery.css( elem, "float" ) === "none" ) {
  9329. // Restore the original display value at the end of pure show/hide animations
  9330. if ( !propTween ) {
  9331. anim.done( function() {
  9332. style.display = restoreDisplay;
  9333. } );
  9334. if ( restoreDisplay == null ) {
  9335. display = style.display;
  9336. restoreDisplay = display === "none" ? "" : display;
  9337. }
  9338. }
  9339. style.display = "inline-block";
  9340. }
  9341. }
  9342. }
  9343. if ( opts.overflow ) {
  9344. style.overflow = "hidden";
  9345. anim.always( function() {
  9346. style.overflow = opts.overflow[ 0 ];
  9347. style.overflowX = opts.overflow[ 1 ];
  9348. style.overflowY = opts.overflow[ 2 ];
  9349. } );
  9350. }
  9351. // Implement show/hide animations
  9352. propTween = false;
  9353. for ( prop in orig ) {
  9354. // General show/hide setup for this element animation
  9355. if ( !propTween ) {
  9356. if ( dataShow ) {
  9357. if ( "hidden" in dataShow ) {
  9358. hidden = dataShow.hidden;
  9359. }
  9360. } else {
  9361. dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
  9362. }
  9363. // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
  9364. if ( toggle ) {
  9365. dataShow.hidden = !hidden;
  9366. }
  9367. // Show elements before animating them
  9368. if ( hidden ) {
  9369. showHide( [ elem ], true );
  9370. }
  9371. /* eslint-disable no-loop-func */
  9372. anim.done( function() {
  9373. /* eslint-enable no-loop-func */
  9374. // The final step of a "hide" animation is actually hiding the element
  9375. if ( !hidden ) {
  9376. showHide( [ elem ] );
  9377. }
  9378. dataPriv.remove( elem, "fxshow" );
  9379. for ( prop in orig ) {
  9380. jQuery.style( elem, prop, orig[ prop ] );
  9381. }
  9382. } );
  9383. }
  9384. // Per-property setup
  9385. propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
  9386. if ( !( prop in dataShow ) ) {
  9387. dataShow[ prop ] = propTween.start;
  9388. if ( hidden ) {
  9389. propTween.end = propTween.start;
  9390. propTween.start = 0;
  9391. }
  9392. }
  9393. }
  9394. }
  9395. function propFilter( props, specialEasing ) {
  9396. var index, name, easing, value, hooks;
  9397. // camelCase, specialEasing and expand cssHook pass
  9398. for ( index in props ) {
  9399. name = jQuery.camelCase( index );
  9400. easing = specialEasing[ name ];
  9401. value = props[ index ];
  9402. if ( jQuery.isArray( value ) ) {
  9403. easing = value[ 1 ];
  9404. value = props[ index ] = value[ 0 ];
  9405. }
  9406. if ( index !== name ) {
  9407. props[ name ] = value;
  9408. delete props[ index ];
  9409. }
  9410. hooks = jQuery.cssHooks[ name ];
  9411. if ( hooks && "expand" in hooks ) {
  9412. value = hooks.expand( value );
  9413. delete props[ name ];
  9414. // Not quite $.extend, this won't overwrite existing keys.
  9415. // Reusing 'index' because we have the correct "name"
  9416. for ( index in value ) {
  9417. if ( !( index in props ) ) {
  9418. props[ index ] = value[ index ];
  9419. specialEasing[ index ] = easing;
  9420. }
  9421. }
  9422. } else {
  9423. specialEasing[ name ] = easing;
  9424. }
  9425. }
  9426. }
  9427. function Animation( elem, properties, options ) {
  9428. var result,
  9429. stopped,
  9430. index = 0,
  9431. length = Animation.prefilters.length,
  9432. deferred = jQuery.Deferred().always( function() {
  9433. // Don't match elem in the :animated selector
  9434. delete tick.elem;
  9435. } ),
  9436. tick = function() {
  9437. if ( stopped ) {
  9438. return false;
  9439. }
  9440. var currentTime = fxNow || createFxNow(),
  9441. remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
  9442. // Support: Android 2.3 only
  9443. // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
  9444. temp = remaining / animation.duration || 0,
  9445. percent = 1 - temp,
  9446. index = 0,
  9447. length = animation.tweens.length;
  9448. for ( ; index < length; index++ ) {
  9449. animation.tweens[ index ].run( percent );
  9450. }
  9451. deferred.notifyWith( elem, [ animation, percent, remaining ] );
  9452. if ( percent < 1 && length ) {
  9453. return remaining;
  9454. } else {
  9455. deferred.resolveWith( elem, [ animation ] );
  9456. return false;
  9457. }
  9458. },
  9459. animation = deferred.promise( {
  9460. elem: elem,
  9461. props: jQuery.extend( {}, properties ),
  9462. opts: jQuery.extend( true, {
  9463. specialEasing: {},
  9464. easing: jQuery.easing._default
  9465. }, options ),
  9466. originalProperties: properties,
  9467. originalOptions: options,
  9468. startTime: fxNow || createFxNow(),
  9469. duration: options.duration,
  9470. tweens: [],
  9471. createTween: function( prop, end ) {
  9472. var tween = jQuery.Tween( elem, animation.opts, prop, end,
  9473. animation.opts.specialEasing[ prop ] || animation.opts.easing );
  9474. animation.tweens.push( tween );
  9475. return tween;
  9476. },
  9477. stop: function( gotoEnd ) {
  9478. var index = 0,
  9479. // If we are going to the end, we want to run all the tweens
  9480. // otherwise we skip this part
  9481. length = gotoEnd ? animation.tweens.length : 0;
  9482. if ( stopped ) {
  9483. return this;
  9484. }
  9485. stopped = true;
  9486. for ( ; index < length; index++ ) {
  9487. animation.tweens[ index ].run( 1 );
  9488. }
  9489. // Resolve when we played the last frame; otherwise, reject
  9490. if ( gotoEnd ) {
  9491. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  9492. deferred.resolveWith( elem, [ animation, gotoEnd ] );
  9493. } else {
  9494. deferred.rejectWith( elem, [ animation, gotoEnd ] );
  9495. }
  9496. return this;
  9497. }
  9498. } ),
  9499. props = animation.props;
  9500. propFilter( props, animation.opts.specialEasing );
  9501. for ( ; index < length; index++ ) {
  9502. result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
  9503. if ( result ) {
  9504. if ( jQuery.isFunction( result.stop ) ) {
  9505. jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
  9506. jQuery.proxy( result.stop, result );
  9507. }
  9508. return result;
  9509. }
  9510. }
  9511. jQuery.map( props, createTween, animation );
  9512. if ( jQuery.isFunction( animation.opts.start ) ) {
  9513. animation.opts.start.call( elem, animation );
  9514. }
  9515. jQuery.fx.timer(
  9516. jQuery.extend( tick, {
  9517. elem: elem,
  9518. anim: animation,
  9519. queue: animation.opts.queue
  9520. } )
  9521. );
  9522. // attach callbacks from options
  9523. return animation.progress( animation.opts.progress )
  9524. .done( animation.opts.done, animation.opts.complete )
  9525. .fail( animation.opts.fail )
  9526. .always( animation.opts.always );
  9527. }
  9528. jQuery.Animation = jQuery.extend( Animation, {
  9529. tweeners: {
  9530. "*": [ function( prop, value ) {
  9531. var tween = this.createTween( prop, value );
  9532. adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
  9533. return tween;
  9534. } ]
  9535. },
  9536. tweener: function( props, callback ) {
  9537. if ( jQuery.isFunction( props ) ) {
  9538. callback = props;
  9539. props = [ "*" ];
  9540. } else {
  9541. props = props.match( rnothtmlwhite );
  9542. }
  9543. var prop,
  9544. index = 0,
  9545. length = props.length;
  9546. for ( ; index < length; index++ ) {
  9547. prop = props[ index ];
  9548. Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
  9549. Animation.tweeners[ prop ].unshift( callback );
  9550. }
  9551. },
  9552. prefilters: [ defaultPrefilter ],
  9553. prefilter: function( callback, prepend ) {
  9554. if ( prepend ) {
  9555. Animation.prefilters.unshift( callback );
  9556. } else {
  9557. Animation.prefilters.push( callback );
  9558. }
  9559. }
  9560. } );
  9561. jQuery.speed = function( speed, easing, fn ) {
  9562. var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
  9563. complete: fn || !fn && easing ||
  9564. jQuery.isFunction( speed ) && speed,
  9565. duration: speed,
  9566. easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
  9567. };
  9568. // Go to the end state if fx are off or if document is hidden
  9569. if ( jQuery.fx.off || document.hidden ) {
  9570. opt.duration = 0;
  9571. } else {
  9572. if ( typeof opt.duration !== "number" ) {
  9573. if ( opt.duration in jQuery.fx.speeds ) {
  9574. opt.duration = jQuery.fx.speeds[ opt.duration ];
  9575. } else {
  9576. opt.duration = jQuery.fx.speeds._default;
  9577. }
  9578. }
  9579. }
  9580. // Normalize opt.queue - true/undefined/null -> "fx"
  9581. if ( opt.queue == null || opt.queue === true ) {
  9582. opt.queue = "fx";
  9583. }
  9584. // Queueing
  9585. opt.old = opt.complete;
  9586. opt.complete = function() {
  9587. if ( jQuery.isFunction( opt.old ) ) {
  9588. opt.old.call( this );
  9589. }
  9590. if ( opt.queue ) {
  9591. jQuery.dequeue( this, opt.queue );
  9592. }
  9593. };
  9594. return opt;
  9595. };
  9596. jQuery.fn.extend( {
  9597. fadeTo: function( speed, to, easing, callback ) {
  9598. // Show any hidden elements after setting opacity to 0
  9599. return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
  9600. // Animate to the value specified
  9601. .end().animate( { opacity: to }, speed, easing, callback );
  9602. },
  9603. animate: function( prop, speed, easing, callback ) {
  9604. var empty = jQuery.isEmptyObject( prop ),
  9605. optall = jQuery.speed( speed, easing, callback ),
  9606. doAnimation = function() {
  9607. // Operate on a copy of prop so per-property easing won't be lost
  9608. var anim = Animation( this, jQuery.extend( {}, prop ), optall );
  9609. // Empty animations, or finishing resolves immediately
  9610. if ( empty || dataPriv.get( this, "finish" ) ) {
  9611. anim.stop( true );
  9612. }
  9613. };
  9614. doAnimation.finish = doAnimation;
  9615. return empty || optall.queue === false ?
  9616. this.each( doAnimation ) :
  9617. this.queue( optall.queue, doAnimation );
  9618. },
  9619. stop: function( type, clearQueue, gotoEnd ) {
  9620. var stopQueue = function( hooks ) {
  9621. var stop = hooks.stop;
  9622. delete hooks.stop;
  9623. stop( gotoEnd );
  9624. };
  9625. if ( typeof type !== "string" ) {
  9626. gotoEnd = clearQueue;
  9627. clearQueue = type;
  9628. type = undefined;
  9629. }
  9630. if ( clearQueue && type !== false ) {
  9631. this.queue( type || "fx", [] );
  9632. }
  9633. return this.each( function() {
  9634. var dequeue = true,
  9635. index = type != null && type + "queueHooks",
  9636. timers = jQuery.timers,
  9637. data = dataPriv.get( this );
  9638. if ( index ) {
  9639. if ( data[ index ] && data[ index ].stop ) {
  9640. stopQueue( data[ index ] );
  9641. }
  9642. } else {
  9643. for ( index in data ) {
  9644. if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
  9645. stopQueue( data[ index ] );
  9646. }
  9647. }
  9648. }
  9649. for ( index = timers.length; index--; ) {
  9650. if ( timers[ index ].elem === this &&
  9651. ( type == null || timers[ index ].queue === type ) ) {
  9652. timers[ index ].anim.stop( gotoEnd );
  9653. dequeue = false;
  9654. timers.splice( index, 1 );
  9655. }
  9656. }
  9657. // Start the next in the queue if the last step wasn't forced.
  9658. // Timers currently will call their complete callbacks, which
  9659. // will dequeue but only if they were gotoEnd.
  9660. if ( dequeue || !gotoEnd ) {
  9661. jQuery.dequeue( this, type );
  9662. }
  9663. } );
  9664. },
  9665. finish: function( type ) {
  9666. if ( type !== false ) {
  9667. type = type || "fx";
  9668. }
  9669. return this.each( function() {
  9670. var index,
  9671. data = dataPriv.get( this ),
  9672. queue = data[ type + "queue" ],
  9673. hooks = data[ type + "queueHooks" ],
  9674. timers = jQuery.timers,
  9675. length = queue ? queue.length : 0;
  9676. // Enable finishing flag on private data
  9677. data.finish = true;
  9678. // Empty the queue first
  9679. jQuery.queue( this, type, [] );
  9680. if ( hooks && hooks.stop ) {
  9681. hooks.stop.call( this, true );
  9682. }
  9683. // Look for any active animations, and finish them
  9684. for ( index = timers.length; index--; ) {
  9685. if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
  9686. timers[ index ].anim.stop( true );
  9687. timers.splice( index, 1 );
  9688. }
  9689. }
  9690. // Look for any animations in the old queue and finish them
  9691. for ( index = 0; index < length; index++ ) {
  9692. if ( queue[ index ] && queue[ index ].finish ) {
  9693. queue[ index ].finish.call( this );
  9694. }
  9695. }
  9696. // Turn off finishing flag
  9697. delete data.finish;
  9698. } );
  9699. }
  9700. } );
  9701. jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
  9702. var cssFn = jQuery.fn[ name ];
  9703. jQuery.fn[ name ] = function( speed, easing, callback ) {
  9704. return speed == null || typeof speed === "boolean" ?
  9705. cssFn.apply( this, arguments ) :
  9706. this.animate( genFx( name, true ), speed, easing, callback );
  9707. };
  9708. } );
  9709. // Generate shortcuts for custom animations
  9710. jQuery.each( {
  9711. slideDown: genFx( "show" ),
  9712. slideUp: genFx( "hide" ),
  9713. slideToggle: genFx( "toggle" ),
  9714. fadeIn: { opacity: "show" },
  9715. fadeOut: { opacity: "hide" },
  9716. fadeToggle: { opacity: "toggle" }
  9717. }, function( name, props ) {
  9718. jQuery.fn[ name ] = function( speed, easing, callback ) {
  9719. return this.animate( props, speed, easing, callback );
  9720. };
  9721. } );
  9722. jQuery.timers = [];
  9723. jQuery.fx.tick = function() {
  9724. var timer,
  9725. i = 0,
  9726. timers = jQuery.timers;
  9727. fxNow = jQuery.now();
  9728. for ( ; i < timers.length; i++ ) {
  9729. timer = timers[ i ];
  9730. // Checks the timer has not already been removed
  9731. if ( !timer() && timers[ i ] === timer ) {
  9732. timers.splice( i--, 1 );
  9733. }
  9734. }
  9735. if ( !timers.length ) {
  9736. jQuery.fx.stop();
  9737. }
  9738. fxNow = undefined;
  9739. };
  9740. jQuery.fx.timer = function( timer ) {
  9741. jQuery.timers.push( timer );
  9742. if ( timer() ) {
  9743. jQuery.fx.start();
  9744. } else {
  9745. jQuery.timers.pop();
  9746. }
  9747. };
  9748. jQuery.fx.interval = 13;
  9749. jQuery.fx.start = function() {
  9750. if ( !timerId ) {
  9751. timerId = window.requestAnimationFrame ?
  9752. window.requestAnimationFrame( raf ) :
  9753. window.setInterval( jQuery.fx.tick, jQuery.fx.interval );
  9754. }
  9755. };
  9756. jQuery.fx.stop = function() {
  9757. if ( window.cancelAnimationFrame ) {
  9758. window.cancelAnimationFrame( timerId );
  9759. } else {
  9760. window.clearInterval( timerId );
  9761. }
  9762. timerId = null;
  9763. };
  9764. jQuery.fx.speeds = {
  9765. slow: 600,
  9766. fast: 200,
  9767. // Default speed
  9768. _default: 400
  9769. };
  9770. // Based off of the plugin by Clint Helfers, with permission.
  9771. // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
  9772. jQuery.fn.delay = function( time, type ) {
  9773. time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
  9774. type = type || "fx";
  9775. return this.queue( type, function( next, hooks ) {
  9776. var timeout = window.setTimeout( next, time );
  9777. hooks.stop = function() {
  9778. window.clearTimeout( timeout );
  9779. };
  9780. } );
  9781. };
  9782. ( function() {
  9783. var input = document.createElement( "input" ),
  9784. select = document.createElement( "select" ),
  9785. opt = select.appendChild( document.createElement( "option" ) );
  9786. input.type = "checkbox";
  9787. // Support: Android <=4.3 only
  9788. // Default value for a checkbox should be "on"
  9789. support.checkOn = input.value !== "";
  9790. // Support: IE <=11 only
  9791. // Must access selectedIndex to make default options select
  9792. support.optSelected = opt.selected;
  9793. // Support: IE <=11 only
  9794. // An input loses its value after becoming a radio
  9795. input = document.createElement( "input" );
  9796. input.value = "t";
  9797. input.type = "radio";
  9798. support.radioValue = input.value === "t";
  9799. } )();
  9800. var boolHook,
  9801. attrHandle = jQuery.expr.attrHandle;
  9802. jQuery.fn.extend( {
  9803. attr: function( name, value ) {
  9804. return access( this, jQuery.attr, name, value, arguments.length > 1 );
  9805. },
  9806. removeAttr: function( name ) {
  9807. return this.each( function() {
  9808. jQuery.removeAttr( this, name );
  9809. } );
  9810. }
  9811. } );
  9812. jQuery.extend( {
  9813. attr: function( elem, name, value ) {
  9814. var ret, hooks,
  9815. nType = elem.nodeType;
  9816. // Don't get/set attributes on text, comment and attribute nodes
  9817. if ( nType === 3 || nType === 8 || nType === 2 ) {
  9818. return;
  9819. }
  9820. // Fallback to prop when attributes are not supported
  9821. if ( typeof elem.getAttribute === "undefined" ) {
  9822. return jQuery.prop( elem, name, value );
  9823. }
  9824. // Attribute hooks are determined by the lowercase version
  9825. // Grab necessary hook if one is defined
  9826. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  9827. hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
  9828. ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
  9829. }
  9830. if ( value !== undefined ) {
  9831. if ( value === null ) {
  9832. jQuery.removeAttr( elem, name );
  9833. return;
  9834. }
  9835. if ( hooks && "set" in hooks &&
  9836. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  9837. return ret;
  9838. }
  9839. elem.setAttribute( name, value + "" );
  9840. return value;
  9841. }
  9842. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  9843. return ret;
  9844. }
  9845. ret = jQuery.find.attr( elem, name );
  9846. // Non-existent attributes return null, we normalize to undefined
  9847. return ret == null ? undefined : ret;
  9848. },
  9849. attrHooks: {
  9850. type: {
  9851. set: function( elem, value ) {
  9852. if ( !support.radioValue && value === "radio" &&
  9853. jQuery.nodeName( elem, "input" ) ) {
  9854. var val = elem.value;
  9855. elem.setAttribute( "type", value );
  9856. if ( val ) {
  9857. elem.value = val;
  9858. }
  9859. return value;
  9860. }
  9861. }
  9862. }
  9863. },
  9864. removeAttr: function( elem, value ) {
  9865. var name,
  9866. i = 0,
  9867. // Attribute names can contain non-HTML whitespace characters
  9868. // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
  9869. attrNames = value && value.match( rnothtmlwhite );
  9870. if ( attrNames && elem.nodeType === 1 ) {
  9871. while ( ( name = attrNames[ i++ ] ) ) {
  9872. elem.removeAttribute( name );
  9873. }
  9874. }
  9875. }
  9876. } );
  9877. // Hooks for boolean attributes
  9878. boolHook = {
  9879. set: function( elem, value, name ) {
  9880. if ( value === false ) {
  9881. // Remove boolean attributes when set to false
  9882. jQuery.removeAttr( elem, name );
  9883. } else {
  9884. elem.setAttribute( name, name );
  9885. }
  9886. return name;
  9887. }
  9888. };
  9889. jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
  9890. var getter = attrHandle[ name ] || jQuery.find.attr;
  9891. attrHandle[ name ] = function( elem, name, isXML ) {
  9892. var ret, handle,
  9893. lowercaseName = name.toLowerCase();
  9894. if ( !isXML ) {
  9895. // Avoid an infinite loop by temporarily removing this function from the getter
  9896. handle = attrHandle[ lowercaseName ];
  9897. attrHandle[ lowercaseName ] = ret;
  9898. ret = getter( elem, name, isXML ) != null ?
  9899. lowercaseName :
  9900. null;
  9901. attrHandle[ lowercaseName ] = handle;
  9902. }
  9903. return ret;
  9904. };
  9905. } );
  9906. var rfocusable = /^(?:input|select|textarea|button)$/i,
  9907. rclickable = /^(?:a|area)$/i;
  9908. jQuery.fn.extend( {
  9909. prop: function( name, value ) {
  9910. return access( this, jQuery.prop, name, value, arguments.length > 1 );
  9911. },
  9912. removeProp: function( name ) {
  9913. return this.each( function() {
  9914. delete this[ jQuery.propFix[ name ] || name ];
  9915. } );
  9916. }
  9917. } );
  9918. jQuery.extend( {
  9919. prop: function( elem, name, value ) {
  9920. var ret, hooks,
  9921. nType = elem.nodeType;
  9922. // Don't get/set properties on text, comment and attribute nodes
  9923. if ( nType === 3 || nType === 8 || nType === 2 ) {
  9924. return;
  9925. }
  9926. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  9927. // Fix name and attach hooks
  9928. name = jQuery.propFix[ name ] || name;
  9929. hooks = jQuery.propHooks[ name ];
  9930. }
  9931. if ( value !== undefined ) {
  9932. if ( hooks && "set" in hooks &&
  9933. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  9934. return ret;
  9935. }
  9936. return ( elem[ name ] = value );
  9937. }
  9938. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  9939. return ret;
  9940. }
  9941. return elem[ name ];
  9942. },
  9943. propHooks: {
  9944. tabIndex: {
  9945. get: function( elem ) {
  9946. // Support: IE <=9 - 11 only
  9947. // elem.tabIndex doesn't always return the
  9948. // correct value when it hasn't been explicitly set
  9949. // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
  9950. // Use proper attribute retrieval(#12072)
  9951. var tabindex = jQuery.find.attr( elem, "tabindex" );
  9952. if ( tabindex ) {
  9953. return parseInt( tabindex, 10 );
  9954. }
  9955. if (
  9956. rfocusable.test( elem.nodeName ) ||
  9957. rclickable.test( elem.nodeName ) &&
  9958. elem.href
  9959. ) {
  9960. return 0;
  9961. }
  9962. return -1;
  9963. }
  9964. }
  9965. },
  9966. propFix: {
  9967. "for": "htmlFor",
  9968. "class": "className"
  9969. }
  9970. } );
  9971. // Support: IE <=11 only
  9972. // Accessing the selectedIndex property
  9973. // forces the browser to respect setting selected
  9974. // on the option
  9975. // The getter ensures a default option is selected
  9976. // when in an optgroup
  9977. // eslint rule "no-unused-expressions" is disabled for this code
  9978. // since it considers such accessions noop
  9979. if ( !support.optSelected ) {
  9980. jQuery.propHooks.selected = {
  9981. get: function( elem ) {
  9982. /* eslint no-unused-expressions: "off" */
  9983. var parent = elem.parentNode;
  9984. if ( parent && parent.parentNode ) {
  9985. parent.parentNode.selectedIndex;
  9986. }
  9987. return null;
  9988. },
  9989. set: function( elem ) {
  9990. /* eslint no-unused-expressions: "off" */
  9991. var parent = elem.parentNode;
  9992. if ( parent ) {
  9993. parent.selectedIndex;
  9994. if ( parent.parentNode ) {
  9995. parent.parentNode.selectedIndex;
  9996. }
  9997. }
  9998. }
  9999. };
  10000. }
  10001. jQuery.each( [
  10002. "tabIndex",
  10003. "readOnly",
  10004. "maxLength",
  10005. "cellSpacing",
  10006. "cellPadding",
  10007. "rowSpan",
  10008. "colSpan",
  10009. "useMap",
  10010. "frameBorder",
  10011. "contentEditable"
  10012. ], function() {
  10013. jQuery.propFix[ this.toLowerCase() ] = this;
  10014. } );
  10015. // Strip and collapse whitespace according to HTML spec
  10016. // https://html.spec.whatwg.org/multipage/infrastructure.html#strip-and-collapse-whitespace
  10017. function stripAndCollapse( value ) {
  10018. var tokens = value.match( rnothtmlwhite ) || [];
  10019. return tokens.join( " " );
  10020. }
  10021. function getClass( elem ) {
  10022. return elem.getAttribute && elem.getAttribute( "class" ) || "";
  10023. }
  10024. jQuery.fn.extend( {
  10025. addClass: function( value ) {
  10026. var classes, elem, cur, curValue, clazz, j, finalValue,
  10027. i = 0;
  10028. if ( jQuery.isFunction( value ) ) {
  10029. return this.each( function( j ) {
  10030. jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
  10031. } );
  10032. }
  10033. if ( typeof value === "string" && value ) {
  10034. classes = value.match( rnothtmlwhite ) || [];
  10035. while ( ( elem = this[ i++ ] ) ) {
  10036. curValue = getClass( elem );
  10037. cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  10038. if ( cur ) {
  10039. j = 0;
  10040. while ( ( clazz = classes[ j++ ] ) ) {
  10041. if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
  10042. cur += clazz + " ";
  10043. }
  10044. }
  10045. // Only assign if different to avoid unneeded rendering.
  10046. finalValue = stripAndCollapse( cur );
  10047. if ( curValue !== finalValue ) {
  10048. elem.setAttribute( "class", finalValue );
  10049. }
  10050. }
  10051. }
  10052. }
  10053. return this;
  10054. },
  10055. removeClass: function( value ) {
  10056. var classes, elem, cur, curValue, clazz, j, finalValue,
  10057. i = 0;
  10058. if ( jQuery.isFunction( value ) ) {
  10059. return this.each( function( j ) {
  10060. jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
  10061. } );
  10062. }
  10063. if ( !arguments.length ) {
  10064. return this.attr( "class", "" );
  10065. }
  10066. if ( typeof value === "string" && value ) {
  10067. classes = value.match( rnothtmlwhite ) || [];
  10068. while ( ( elem = this[ i++ ] ) ) {
  10069. curValue = getClass( elem );
  10070. // This expression is here for better compressibility (see addClass)
  10071. cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  10072. if ( cur ) {
  10073. j = 0;
  10074. while ( ( clazz = classes[ j++ ] ) ) {
  10075. // Remove *all* instances
  10076. while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
  10077. cur = cur.replace( " " + clazz + " ", " " );
  10078. }
  10079. }
  10080. // Only assign if different to avoid unneeded rendering.
  10081. finalValue = stripAndCollapse( cur );
  10082. if ( curValue !== finalValue ) {
  10083. elem.setAttribute( "class", finalValue );
  10084. }
  10085. }
  10086. }
  10087. }
  10088. return this;
  10089. },
  10090. toggleClass: function( value, stateVal ) {
  10091. var type = typeof value;
  10092. if ( typeof stateVal === "boolean" && type === "string" ) {
  10093. return stateVal ? this.addClass( value ) : this.removeClass( value );
  10094. }
  10095. if ( jQuery.isFunction( value ) ) {
  10096. return this.each( function( i ) {
  10097. jQuery( this ).toggleClass(
  10098. value.call( this, i, getClass( this ), stateVal ),
  10099. stateVal
  10100. );
  10101. } );
  10102. }
  10103. return this.each( function() {
  10104. var className, i, self, classNames;
  10105. if ( type === "string" ) {
  10106. // Toggle individual class names
  10107. i = 0;
  10108. self = jQuery( this );
  10109. classNames = value.match( rnothtmlwhite ) || [];
  10110. while ( ( className = classNames[ i++ ] ) ) {
  10111. // Check each className given, space separated list
  10112. if ( self.hasClass( className ) ) {
  10113. self.removeClass( className );
  10114. } else {
  10115. self.addClass( className );
  10116. }
  10117. }
  10118. // Toggle whole class name
  10119. } else if ( value === undefined || type === "boolean" ) {
  10120. className = getClass( this );
  10121. if ( className ) {
  10122. // Store className if set
  10123. dataPriv.set( this, "__className__", className );
  10124. }
  10125. // If the element has a class name or if we're passed `false`,
  10126. // then remove the whole classname (if there was one, the above saved it).
  10127. // Otherwise bring back whatever was previously saved (if anything),
  10128. // falling back to the empty string if nothing was stored.
  10129. if ( this.setAttribute ) {
  10130. this.setAttribute( "class",
  10131. className || value === false ?
  10132. "" :
  10133. dataPriv.get( this, "__className__" ) || ""
  10134. );
  10135. }
  10136. }
  10137. } );
  10138. },
  10139. hasClass: function( selector ) {
  10140. var className, elem,
  10141. i = 0;
  10142. className = " " + selector + " ";
  10143. while ( ( elem = this[ i++ ] ) ) {
  10144. if ( elem.nodeType === 1 &&
  10145. ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
  10146. return true;
  10147. }
  10148. }
  10149. return false;
  10150. }
  10151. } );
  10152. var rreturn = /\r/g;
  10153. jQuery.fn.extend( {
  10154. val: function( value ) {
  10155. var hooks, ret, isFunction,
  10156. elem = this[ 0 ];
  10157. if ( !arguments.length ) {
  10158. if ( elem ) {
  10159. hooks = jQuery.valHooks[ elem.type ] ||
  10160. jQuery.valHooks[ elem.nodeName.toLowerCase() ];
  10161. if ( hooks &&
  10162. "get" in hooks &&
  10163. ( ret = hooks.get( elem, "value" ) ) !== undefined
  10164. ) {
  10165. return ret;
  10166. }
  10167. ret = elem.value;
  10168. // Handle most common string cases
  10169. if ( typeof ret === "string" ) {
  10170. return ret.replace( rreturn, "" );
  10171. }
  10172. // Handle cases where value is null/undef or number
  10173. return ret == null ? "" : ret;
  10174. }
  10175. return;
  10176. }
  10177. isFunction = jQuery.isFunction( value );
  10178. return this.each( function( i ) {
  10179. var val;
  10180. if ( this.nodeType !== 1 ) {
  10181. return;
  10182. }
  10183. if ( isFunction ) {
  10184. val = value.call( this, i, jQuery( this ).val() );
  10185. } else {
  10186. val = value;
  10187. }
  10188. // Treat null/undefined as ""; convert numbers to string
  10189. if ( val == null ) {
  10190. val = "";
  10191. } else if ( typeof val === "number" ) {
  10192. val += "";
  10193. } else if ( jQuery.isArray( val ) ) {
  10194. val = jQuery.map( val, function( value ) {
  10195. return value == null ? "" : value + "";
  10196. } );
  10197. }
  10198. hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
  10199. // If set returns undefined, fall back to normal setting
  10200. if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
  10201. this.value = val;
  10202. }
  10203. } );
  10204. }
  10205. } );
  10206. jQuery.extend( {
  10207. valHooks: {
  10208. option: {
  10209. get: function( elem ) {
  10210. var val = jQuery.find.attr( elem, "value" );
  10211. return val != null ?
  10212. val :
  10213. // Support: IE <=10 - 11 only
  10214. // option.text throws exceptions (#14686, #14858)
  10215. // Strip and collapse whitespace
  10216. // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
  10217. stripAndCollapse( jQuery.text( elem ) );
  10218. }
  10219. },
  10220. select: {
  10221. get: function( elem ) {
  10222. var value, option, i,
  10223. options = elem.options,
  10224. index = elem.selectedIndex,
  10225. one = elem.type === "select-one",
  10226. values = one ? null : [],
  10227. max = one ? index + 1 : options.length;
  10228. if ( index < 0 ) {
  10229. i = max;
  10230. } else {
  10231. i = one ? index : 0;
  10232. }
  10233. // Loop through all the selected options
  10234. for ( ; i < max; i++ ) {
  10235. option = options[ i ];
  10236. // Support: IE <=9 only
  10237. // IE8-9 doesn't update selected after form reset (#2551)
  10238. if ( ( option.selected || i === index ) &&
  10239. // Don't return options that are disabled or in a disabled optgroup
  10240. !option.disabled &&
  10241. ( !option.parentNode.disabled ||
  10242. !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
  10243. // Get the specific value for the option
  10244. value = jQuery( option ).val();
  10245. // We don't need an array for one selects
  10246. if ( one ) {
  10247. return value;
  10248. }
  10249. // Multi-Selects return an array
  10250. values.push( value );
  10251. }
  10252. }
  10253. return values;
  10254. },
  10255. set: function( elem, value ) {
  10256. var optionSet, option,
  10257. options = elem.options,
  10258. values = jQuery.makeArray( value ),
  10259. i = options.length;
  10260. while ( i-- ) {
  10261. option = options[ i ];
  10262. /* eslint-disable no-cond-assign */
  10263. if ( option.selected =
  10264. jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
  10265. ) {
  10266. optionSet = true;
  10267. }
  10268. /* eslint-enable no-cond-assign */
  10269. }
  10270. // Force browsers to behave consistently when non-matching value is set
  10271. if ( !optionSet ) {
  10272. elem.selectedIndex = -1;
  10273. }
  10274. return values;
  10275. }
  10276. }
  10277. }
  10278. } );
  10279. // Radios and checkboxes getter/setter
  10280. jQuery.each( [ "radio", "checkbox" ], function() {
  10281. jQuery.valHooks[ this ] = {
  10282. set: function( elem, value ) {
  10283. if ( jQuery.isArray( value ) ) {
  10284. return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
  10285. }
  10286. }
  10287. };
  10288. if ( !support.checkOn ) {
  10289. jQuery.valHooks[ this ].get = function( elem ) {
  10290. return elem.getAttribute( "value" ) === null ? "on" : elem.value;
  10291. };
  10292. }
  10293. } );
  10294. // Return jQuery for attributes-only inclusion
  10295. var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/;
  10296. jQuery.extend( jQuery.event, {
  10297. trigger: function( event, data, elem, onlyHandlers ) {
  10298. var i, cur, tmp, bubbleType, ontype, handle, special,
  10299. eventPath = [ elem || document ],
  10300. type = hasOwn.call( event, "type" ) ? event.type : event,
  10301. namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
  10302. cur = tmp = elem = elem || document;
  10303. // Don't do events on text and comment nodes
  10304. if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  10305. return;
  10306. }
  10307. // focus/blur morphs to focusin/out; ensure we're not firing them right now
  10308. if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
  10309. return;
  10310. }
  10311. if ( type.indexOf( "." ) > -1 ) {
  10312. // Namespaced trigger; create a regexp to match event type in handle()
  10313. namespaces = type.split( "." );
  10314. type = namespaces.shift();
  10315. namespaces.sort();
  10316. }
  10317. ontype = type.indexOf( ":" ) < 0 && "on" + type;
  10318. // Caller can pass in a jQuery.Event object, Object, or just an event type string
  10319. event = event[ jQuery.expando ] ?
  10320. event :
  10321. new jQuery.Event( type, typeof event === "object" && event );
  10322. // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
  10323. event.isTrigger = onlyHandlers ? 2 : 3;
  10324. event.namespace = namespaces.join( "." );
  10325. event.rnamespace = event.namespace ?
  10326. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
  10327. null;
  10328. // Clean up the event in case it is being reused
  10329. event.result = undefined;
  10330. if ( !event.target ) {
  10331. event.target = elem;
  10332. }
  10333. // Clone any incoming data and prepend the event, creating the handler arg list
  10334. data = data == null ?
  10335. [ event ] :
  10336. jQuery.makeArray( data, [ event ] );
  10337. // Allow special events to draw outside the lines
  10338. special = jQuery.event.special[ type ] || {};
  10339. if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
  10340. return;
  10341. }
  10342. // Determine event propagation path in advance, per W3C events spec (#9951)
  10343. // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
  10344. if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
  10345. bubbleType = special.delegateType || type;
  10346. if ( !rfocusMorph.test( bubbleType + type ) ) {
  10347. cur = cur.parentNode;
  10348. }
  10349. for ( ; cur; cur = cur.parentNode ) {
  10350. eventPath.push( cur );
  10351. tmp = cur;
  10352. }
  10353. // Only add window if we got to document (e.g., not plain obj or detached DOM)
  10354. if ( tmp === ( elem.ownerDocument || document ) ) {
  10355. eventPath.push( tmp.defaultView || tmp.parentWindow || window );
  10356. }
  10357. }
  10358. // Fire handlers on the event path
  10359. i = 0;
  10360. while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
  10361. event.type = i > 1 ?
  10362. bubbleType :
  10363. special.bindType || type;
  10364. // jQuery handler
  10365. handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] &&
  10366. dataPriv.get( cur, "handle" );
  10367. if ( handle ) {
  10368. handle.apply( cur, data );
  10369. }
  10370. // Native handler
  10371. handle = ontype && cur[ ontype ];
  10372. if ( handle && handle.apply && acceptData( cur ) ) {
  10373. event.result = handle.apply( cur, data );
  10374. if ( event.result === false ) {
  10375. event.preventDefault();
  10376. }
  10377. }
  10378. }
  10379. event.type = type;
  10380. // If nobody prevented the default action, do it now
  10381. if ( !onlyHandlers && !event.isDefaultPrevented() ) {
  10382. if ( ( !special._default ||
  10383. special._default.apply( eventPath.pop(), data ) === false ) &&
  10384. acceptData( elem ) ) {
  10385. // Call a native DOM method on the target with the same name as the event.
  10386. // Don't do default actions on window, that's where global variables be (#6170)
  10387. if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
  10388. // Don't re-trigger an onFOO event when we call its FOO() method
  10389. tmp = elem[ ontype ];
  10390. if ( tmp ) {
  10391. elem[ ontype ] = null;
  10392. }
  10393. // Prevent re-triggering of the same event, since we already bubbled it above
  10394. jQuery.event.triggered = type;
  10395. elem[ type ]();
  10396. jQuery.event.triggered = undefined;
  10397. if ( tmp ) {
  10398. elem[ ontype ] = tmp;
  10399. }
  10400. }
  10401. }
  10402. }
  10403. return event.result;
  10404. },
  10405. // Piggyback on a donor event to simulate a different one
  10406. // Used only for `focus(in | out)` events
  10407. simulate: function( type, elem, event ) {
  10408. var e = jQuery.extend(
  10409. new jQuery.Event(),
  10410. event,
  10411. {
  10412. type: type,
  10413. isSimulated: true
  10414. }
  10415. );
  10416. jQuery.event.trigger( e, null, elem );
  10417. }
  10418. } );
  10419. jQuery.fn.extend( {
  10420. trigger: function( type, data ) {
  10421. return this.each( function() {
  10422. jQuery.event.trigger( type, data, this );
  10423. } );
  10424. },
  10425. triggerHandler: function( type, data ) {
  10426. var elem = this[ 0 ];
  10427. if ( elem ) {
  10428. return jQuery.event.trigger( type, data, elem, true );
  10429. }
  10430. }
  10431. } );
  10432. jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
  10433. "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
  10434. "change select submit keydown keypress keyup contextmenu" ).split( " " ),
  10435. function( i, name ) {
  10436. // Handle event binding
  10437. jQuery.fn[ name ] = function( data, fn ) {
  10438. return arguments.length > 0 ?
  10439. this.on( name, null, data, fn ) :
  10440. this.trigger( name );
  10441. };
  10442. } );
  10443. jQuery.fn.extend( {
  10444. hover: function( fnOver, fnOut ) {
  10445. return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
  10446. }
  10447. } );
  10448. support.focusin = "onfocusin" in window;
  10449. // Support: Firefox <=44
  10450. // Firefox doesn't have focus(in | out) events
  10451. // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
  10452. //
  10453. // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
  10454. // focus(in | out) events fire after focus & blur events,
  10455. // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
  10456. // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
  10457. if ( !support.focusin ) {
  10458. jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
  10459. // Attach a single capturing handler on the document while someone wants focusin/focusout
  10460. var handler = function( event ) {
  10461. jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
  10462. };
  10463. jQuery.event.special[ fix ] = {
  10464. setup: function() {
  10465. var doc = this.ownerDocument || this,
  10466. attaches = dataPriv.access( doc, fix );
  10467. if ( !attaches ) {
  10468. doc.addEventListener( orig, handler, true );
  10469. }
  10470. dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
  10471. },
  10472. teardown: function() {
  10473. var doc = this.ownerDocument || this,
  10474. attaches = dataPriv.access( doc, fix ) - 1;
  10475. if ( !attaches ) {
  10476. doc.removeEventListener( orig, handler, true );
  10477. dataPriv.remove( doc, fix );
  10478. } else {
  10479. dataPriv.access( doc, fix, attaches );
  10480. }
  10481. }
  10482. };
  10483. } );
  10484. }
  10485. var location = window.location;
  10486. var nonce = jQuery.now();
  10487. var rquery = ( /\?/ );
  10488. // Cross-browser xml parsing
  10489. jQuery.parseXML = function( data ) {
  10490. var xml;
  10491. if ( !data || typeof data !== "string" ) {
  10492. return null;
  10493. }
  10494. // Support: IE 9 - 11 only
  10495. // IE throws on parseFromString with invalid input.
  10496. try {
  10497. xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
  10498. } catch ( e ) {
  10499. xml = undefined;
  10500. }
  10501. if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
  10502. jQuery.error( "Invalid XML: " + data );
  10503. }
  10504. return xml;
  10505. };
  10506. var
  10507. rbracket = /\[\]$/,
  10508. rCRLF = /\r?\n/g,
  10509. rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
  10510. rsubmittable = /^(?:input|select|textarea|keygen)/i;
  10511. function buildParams( prefix, obj, traditional, add ) {
  10512. var name;
  10513. if ( jQuery.isArray( obj ) ) {
  10514. // Serialize array item.
  10515. jQuery.each( obj, function( i, v ) {
  10516. if ( traditional || rbracket.test( prefix ) ) {
  10517. // Treat each array item as a scalar.
  10518. add( prefix, v );
  10519. } else {
  10520. // Item is non-scalar (array or object), encode its numeric index.
  10521. buildParams(
  10522. prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
  10523. v,
  10524. traditional,
  10525. add
  10526. );
  10527. }
  10528. } );
  10529. } else if ( !traditional && jQuery.type( obj ) === "object" ) {
  10530. // Serialize object item.
  10531. for ( name in obj ) {
  10532. buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
  10533. }
  10534. } else {
  10535. // Serialize scalar item.
  10536. add( prefix, obj );
  10537. }
  10538. }
  10539. // Serialize an array of form elements or a set of
  10540. // key/values into a query string
  10541. jQuery.param = function( a, traditional ) {
  10542. var prefix,
  10543. s = [],
  10544. add = function( key, valueOrFunction ) {
  10545. // If value is a function, invoke it and use its return value
  10546. var value = jQuery.isFunction( valueOrFunction ) ?
  10547. valueOrFunction() :
  10548. valueOrFunction;
  10549. s[ s.length ] = encodeURIComponent( key ) + "=" +
  10550. encodeURIComponent( value == null ? "" : value );
  10551. };
  10552. // If an array was passed in, assume that it is an array of form elements.
  10553. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
  10554. // Serialize the form elements
  10555. jQuery.each( a, function() {
  10556. add( this.name, this.value );
  10557. } );
  10558. } else {
  10559. // If traditional, encode the "old" way (the way 1.3.2 or older
  10560. // did it), otherwise encode params recursively.
  10561. for ( prefix in a ) {
  10562. buildParams( prefix, a[ prefix ], traditional, add );
  10563. }
  10564. }
  10565. // Return the resulting serialization
  10566. return s.join( "&" );
  10567. };
  10568. jQuery.fn.extend( {
  10569. serialize: function() {
  10570. return jQuery.param( this.serializeArray() );
  10571. },
  10572. serializeArray: function() {
  10573. return this.map( function() {
  10574. // Can add propHook for "elements" to filter or add form elements
  10575. var elements = jQuery.prop( this, "elements" );
  10576. return elements ? jQuery.makeArray( elements ) : this;
  10577. } )
  10578. .filter( function() {
  10579. var type = this.type;
  10580. // Use .is( ":disabled" ) so that fieldset[disabled] works
  10581. return this.name && !jQuery( this ).is( ":disabled" ) &&
  10582. rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
  10583. ( this.checked || !rcheckableType.test( type ) );
  10584. } )
  10585. .map( function( i, elem ) {
  10586. var val = jQuery( this ).val();
  10587. if ( val == null ) {
  10588. return null;
  10589. }
  10590. if ( jQuery.isArray( val ) ) {
  10591. return jQuery.map( val, function( val ) {
  10592. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  10593. } );
  10594. }
  10595. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  10596. } ).get();
  10597. }
  10598. } );
  10599. var
  10600. r20 = /%20/g,
  10601. rhash = /#.*$/,
  10602. rantiCache = /([?&])_=[^&]*/,
  10603. rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
  10604. // #7653, #8125, #8152: local protocol detection
  10605. rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
  10606. rnoContent = /^(?:GET|HEAD)$/,
  10607. rprotocol = /^\/\//,
  10608. /* Prefilters
  10609. * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
  10610. * 2) These are called:
  10611. * - BEFORE asking for a transport
  10612. * - AFTER param serialization (s.data is a string if s.processData is true)
  10613. * 3) key is the dataType
  10614. * 4) the catchall symbol "*" can be used
  10615. * 5) execution will start with transport dataType and THEN continue down to "*" if needed
  10616. */
  10617. prefilters = {},
  10618. /* Transports bindings
  10619. * 1) key is the dataType
  10620. * 2) the catchall symbol "*" can be used
  10621. * 3) selection will start with transport dataType and THEN go to "*" if needed
  10622. */
  10623. transports = {},
  10624. // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
  10625. allTypes = "*/".concat( "*" ),
  10626. // Anchor tag for parsing the document origin
  10627. originAnchor = document.createElement( "a" );
  10628. originAnchor.href = location.href;
  10629. // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
  10630. function addToPrefiltersOrTransports( structure ) {
  10631. // dataTypeExpression is optional and defaults to "*"
  10632. return function( dataTypeExpression, func ) {
  10633. if ( typeof dataTypeExpression !== "string" ) {
  10634. func = dataTypeExpression;
  10635. dataTypeExpression = "*";
  10636. }
  10637. var dataType,
  10638. i = 0,
  10639. dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
  10640. if ( jQuery.isFunction( func ) ) {
  10641. // For each dataType in the dataTypeExpression
  10642. while ( ( dataType = dataTypes[ i++ ] ) ) {
  10643. // Prepend if requested
  10644. if ( dataType[ 0 ] === "+" ) {
  10645. dataType = dataType.slice( 1 ) || "*";
  10646. ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
  10647. // Otherwise append
  10648. } else {
  10649. ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
  10650. }
  10651. }
  10652. }
  10653. };
  10654. }
  10655. // Base inspection function for prefilters and transports
  10656. function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
  10657. var inspected = {},
  10658. seekingTransport = ( structure === transports );
  10659. function inspect( dataType ) {
  10660. var selected;
  10661. inspected[ dataType ] = true;
  10662. jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
  10663. var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
  10664. if ( typeof dataTypeOrTransport === "string" &&
  10665. !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
  10666. options.dataTypes.unshift( dataTypeOrTransport );
  10667. inspect( dataTypeOrTransport );
  10668. return false;
  10669. } else if ( seekingTransport ) {
  10670. return !( selected = dataTypeOrTransport );
  10671. }
  10672. } );
  10673. return selected;
  10674. }
  10675. return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
  10676. }
  10677. // A special extend for ajax options
  10678. // that takes "flat" options (not to be deep extended)
  10679. // Fixes #9887
  10680. function ajaxExtend( target, src ) {
  10681. var key, deep,
  10682. flatOptions = jQuery.ajaxSettings.flatOptions || {};
  10683. for ( key in src ) {
  10684. if ( src[ key ] !== undefined ) {
  10685. ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
  10686. }
  10687. }
  10688. if ( deep ) {
  10689. jQuery.extend( true, target, deep );
  10690. }
  10691. return target;
  10692. }
  10693. /* Handles responses to an ajax request:
  10694. * - finds the right dataType (mediates between content-type and expected dataType)
  10695. * - returns the corresponding response
  10696. */
  10697. function ajaxHandleResponses( s, jqXHR, responses ) {
  10698. var ct, type, finalDataType, firstDataType,
  10699. contents = s.contents,
  10700. dataTypes = s.dataTypes;
  10701. // Remove auto dataType and get content-type in the process
  10702. while ( dataTypes[ 0 ] === "*" ) {
  10703. dataTypes.shift();
  10704. if ( ct === undefined ) {
  10705. ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
  10706. }
  10707. }
  10708. // Check if we're dealing with a known content-type
  10709. if ( ct ) {
  10710. for ( type in contents ) {
  10711. if ( contents[ type ] && contents[ type ].test( ct ) ) {
  10712. dataTypes.unshift( type );
  10713. break;
  10714. }
  10715. }
  10716. }
  10717. // Check to see if we have a response for the expected dataType
  10718. if ( dataTypes[ 0 ] in responses ) {
  10719. finalDataType = dataTypes[ 0 ];
  10720. } else {
  10721. // Try convertible dataTypes
  10722. for ( type in responses ) {
  10723. if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
  10724. finalDataType = type;
  10725. break;
  10726. }
  10727. if ( !firstDataType ) {
  10728. firstDataType = type;
  10729. }
  10730. }
  10731. // Or just use first one
  10732. finalDataType = finalDataType || firstDataType;
  10733. }
  10734. // If we found a dataType
  10735. // We add the dataType to the list if needed
  10736. // and return the corresponding response
  10737. if ( finalDataType ) {
  10738. if ( finalDataType !== dataTypes[ 0 ] ) {
  10739. dataTypes.unshift( finalDataType );
  10740. }
  10741. return responses[ finalDataType ];
  10742. }
  10743. }
  10744. /* Chain conversions given the request and the original response
  10745. * Also sets the responseXXX fields on the jqXHR instance
  10746. */
  10747. function ajaxConvert( s, response, jqXHR, isSuccess ) {
  10748. var conv2, current, conv, tmp, prev,
  10749. converters = {},
  10750. // Work with a copy of dataTypes in case we need to modify it for conversion
  10751. dataTypes = s.dataTypes.slice();
  10752. // Create converters map with lowercased keys
  10753. if ( dataTypes[ 1 ] ) {
  10754. for ( conv in s.converters ) {
  10755. converters[ conv.toLowerCase() ] = s.converters[ conv ];
  10756. }
  10757. }
  10758. current = dataTypes.shift();
  10759. // Convert to each sequential dataType
  10760. while ( current ) {
  10761. if ( s.responseFields[ current ] ) {
  10762. jqXHR[ s.responseFields[ current ] ] = response;
  10763. }
  10764. // Apply the dataFilter if provided
  10765. if ( !prev && isSuccess && s.dataFilter ) {
  10766. response = s.dataFilter( response, s.dataType );
  10767. }
  10768. prev = current;
  10769. current = dataTypes.shift();
  10770. if ( current ) {
  10771. // There's only work to do if current dataType is non-auto
  10772. if ( current === "*" ) {
  10773. current = prev;
  10774. // Convert response if prev dataType is non-auto and differs from current
  10775. } else if ( prev !== "*" && prev !== current ) {
  10776. // Seek a direct converter
  10777. conv = converters[ prev + " " + current ] || converters[ "* " + current ];
  10778. // If none found, seek a pair
  10779. if ( !conv ) {
  10780. for ( conv2 in converters ) {
  10781. // If conv2 outputs current
  10782. tmp = conv2.split( " " );
  10783. if ( tmp[ 1 ] === current ) {
  10784. // If prev can be converted to accepted input
  10785. conv = converters[ prev + " " + tmp[ 0 ] ] ||
  10786. converters[ "* " + tmp[ 0 ] ];
  10787. if ( conv ) {
  10788. // Condense equivalence converters
  10789. if ( conv === true ) {
  10790. conv = converters[ conv2 ];
  10791. // Otherwise, insert the intermediate dataType
  10792. } else if ( converters[ conv2 ] !== true ) {
  10793. current = tmp[ 0 ];
  10794. dataTypes.unshift( tmp[ 1 ] );
  10795. }
  10796. break;
  10797. }
  10798. }
  10799. }
  10800. }
  10801. // Apply converter (if not an equivalence)
  10802. if ( conv !== true ) {
  10803. // Unless errors are allowed to bubble, catch and return them
  10804. if ( conv && s.throws ) {
  10805. response = conv( response );
  10806. } else {
  10807. try {
  10808. response = conv( response );
  10809. } catch ( e ) {
  10810. return {
  10811. state: "parsererror",
  10812. error: conv ? e : "No conversion from " + prev + " to " + current
  10813. };
  10814. }
  10815. }
  10816. }
  10817. }
  10818. }
  10819. }
  10820. return { state: "success", data: response };
  10821. }
  10822. jQuery.extend( {
  10823. // Counter for holding the number of active queries
  10824. active: 0,
  10825. // Last-Modified header cache for next request
  10826. lastModified: {},
  10827. etag: {},
  10828. ajaxSettings: {
  10829. url: location.href,
  10830. type: "GET",
  10831. isLocal: rlocalProtocol.test( location.protocol ),
  10832. global: true,
  10833. processData: true,
  10834. async: true,
  10835. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  10836. /*
  10837. timeout: 0,
  10838. data: null,
  10839. dataType: null,
  10840. username: null,
  10841. password: null,
  10842. cache: null,
  10843. throws: false,
  10844. traditional: false,
  10845. headers: {},
  10846. */
  10847. accepts: {
  10848. "*": allTypes,
  10849. text: "text/plain",
  10850. html: "text/html",
  10851. xml: "application/xml, text/xml",
  10852. json: "application/json, text/javascript"
  10853. },
  10854. contents: {
  10855. xml: /\bxml\b/,
  10856. html: /\bhtml/,
  10857. json: /\bjson\b/
  10858. },
  10859. responseFields: {
  10860. xml: "responseXML",
  10861. text: "responseText",
  10862. json: "responseJSON"
  10863. },
  10864. // Data converters
  10865. // Keys separate source (or catchall "*") and destination types with a single space
  10866. converters: {
  10867. // Convert anything to text
  10868. "* text": String,
  10869. // Text to html (true = no transformation)
  10870. "text html": true,
  10871. // Evaluate text as a json expression
  10872. "text json": JSON.parse,
  10873. // Parse text as xml
  10874. "text xml": jQuery.parseXML
  10875. },
  10876. // For options that shouldn't be deep extended:
  10877. // you can add your own custom options here if
  10878. // and when you create one that shouldn't be
  10879. // deep extended (see ajaxExtend)
  10880. flatOptions: {
  10881. url: true,
  10882. context: true
  10883. }
  10884. },
  10885. // Creates a full fledged settings object into target
  10886. // with both ajaxSettings and settings fields.
  10887. // If target is omitted, writes into ajaxSettings.
  10888. ajaxSetup: function( target, settings ) {
  10889. return settings ?
  10890. // Building a settings object
  10891. ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
  10892. // Extending ajaxSettings
  10893. ajaxExtend( jQuery.ajaxSettings, target );
  10894. },
  10895. ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
  10896. ajaxTransport: addToPrefiltersOrTransports( transports ),
  10897. // Main method
  10898. ajax: function( url, options ) {
  10899. // If url is an object, simulate pre-1.5 signature
  10900. if ( typeof url === "object" ) {
  10901. options = url;
  10902. url = undefined;
  10903. }
  10904. // Force options to be an object
  10905. options = options || {};
  10906. var transport,
  10907. // URL without anti-cache param
  10908. cacheURL,
  10909. // Response headers
  10910. responseHeadersString,
  10911. responseHeaders,
  10912. // timeout handle
  10913. timeoutTimer,
  10914. // Url cleanup var
  10915. urlAnchor,
  10916. // Request state (becomes false upon send and true upon completion)
  10917. completed,
  10918. // To know if global events are to be dispatched
  10919. fireGlobals,
  10920. // Loop variable
  10921. i,
  10922. // uncached part of the url
  10923. uncached,
  10924. // Create the final options object
  10925. s = jQuery.ajaxSetup( {}, options ),
  10926. // Callbacks context
  10927. callbackContext = s.context || s,
  10928. // Context for global events is callbackContext if it is a DOM node or jQuery collection
  10929. globalEventContext = s.context &&
  10930. ( callbackContext.nodeType || callbackContext.jquery ) ?
  10931. jQuery( callbackContext ) :
  10932. jQuery.event,
  10933. // Deferreds
  10934. deferred = jQuery.Deferred(),
  10935. completeDeferred = jQuery.Callbacks( "once memory" ),
  10936. // Status-dependent callbacks
  10937. statusCode = s.statusCode || {},
  10938. // Headers (they are sent all at once)
  10939. requestHeaders = {},
  10940. requestHeadersNames = {},
  10941. // Default abort message
  10942. strAbort = "canceled",
  10943. // Fake xhr
  10944. jqXHR = {
  10945. readyState: 0,
  10946. // Builds headers hashtable if needed
  10947. getResponseHeader: function( key ) {
  10948. var match;
  10949. if ( completed ) {
  10950. if ( !responseHeaders ) {
  10951. responseHeaders = {};
  10952. while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
  10953. responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ];
  10954. }
  10955. }
  10956. match = responseHeaders[ key.toLowerCase() ];
  10957. }
  10958. return match == null ? null : match;
  10959. },
  10960. // Raw string
  10961. getAllResponseHeaders: function() {
  10962. return completed ? responseHeadersString : null;
  10963. },
  10964. // Caches the header
  10965. setRequestHeader: function( name, value ) {
  10966. if ( completed == null ) {
  10967. name = requestHeadersNames[ name.toLowerCase() ] =
  10968. requestHeadersNames[ name.toLowerCase() ] || name;
  10969. requestHeaders[ name ] = value;
  10970. }
  10971. return this;
  10972. },
  10973. // Overrides response content-type header
  10974. overrideMimeType: function( type ) {
  10975. if ( completed == null ) {
  10976. s.mimeType = type;
  10977. }
  10978. return this;
  10979. },
  10980. // Status-dependent callbacks
  10981. statusCode: function( map ) {
  10982. var code;
  10983. if ( map ) {
  10984. if ( completed ) {
  10985. // Execute the appropriate callbacks
  10986. jqXHR.always( map[ jqXHR.status ] );
  10987. } else {
  10988. // Lazy-add the new callbacks in a way that preserves old ones
  10989. for ( code in map ) {
  10990. statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
  10991. }
  10992. }
  10993. }
  10994. return this;
  10995. },
  10996. // Cancel the request
  10997. abort: function( statusText ) {
  10998. var finalText = statusText || strAbort;
  10999. if ( transport ) {
  11000. transport.abort( finalText );
  11001. }
  11002. done( 0, finalText );
  11003. return this;
  11004. }
  11005. };
  11006. // Attach deferreds
  11007. deferred.promise( jqXHR );
  11008. // Add protocol if not provided (prefilters might expect it)
  11009. // Handle falsy url in the settings object (#10093: consistency with old signature)
  11010. // We also use the url parameter if available
  11011. s.url = ( ( url || s.url || location.href ) + "" )
  11012. .replace( rprotocol, location.protocol + "//" );
  11013. // Alias method option to type as per ticket #12004
  11014. s.type = options.method || options.type || s.method || s.type;
  11015. // Extract dataTypes list
  11016. s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
  11017. // A cross-domain request is in order when the origin doesn't match the current origin.
  11018. if ( s.crossDomain == null ) {
  11019. urlAnchor = document.createElement( "a" );
  11020. // Support: IE <=8 - 11, Edge 12 - 13
  11021. // IE throws exception on accessing the href property if url is malformed,
  11022. // e.g. http://example.com:80x/
  11023. try {
  11024. urlAnchor.href = s.url;
  11025. // Support: IE <=8 - 11 only
  11026. // Anchor's host property isn't correctly set when s.url is relative
  11027. urlAnchor.href = urlAnchor.href;
  11028. s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
  11029. urlAnchor.protocol + "//" + urlAnchor.host;
  11030. } catch ( e ) {
  11031. // If there is an error parsing the URL, assume it is crossDomain,
  11032. // it can be rejected by the transport if it is invalid
  11033. s.crossDomain = true;
  11034. }
  11035. }
  11036. // Convert data if not already a string
  11037. if ( s.data && s.processData && typeof s.data !== "string" ) {
  11038. s.data = jQuery.param( s.data, s.traditional );
  11039. }
  11040. // Apply prefilters
  11041. inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
  11042. // If request was aborted inside a prefilter, stop there
  11043. if ( completed ) {
  11044. return jqXHR;
  11045. }
  11046. // We can fire global events as of now if asked to
  11047. // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
  11048. fireGlobals = jQuery.event && s.global;
  11049. // Watch for a new set of requests
  11050. if ( fireGlobals && jQuery.active++ === 0 ) {
  11051. jQuery.event.trigger( "ajaxStart" );
  11052. }
  11053. // Uppercase the type
  11054. s.type = s.type.toUpperCase();
  11055. // Determine if request has content
  11056. s.hasContent = !rnoContent.test( s.type );
  11057. // Save the URL in case we're toying with the If-Modified-Since
  11058. // and/or If-None-Match header later on
  11059. // Remove hash to simplify url manipulation
  11060. cacheURL = s.url.replace( rhash, "" );
  11061. // More options handling for requests with no content
  11062. if ( !s.hasContent ) {
  11063. // Remember the hash so we can put it back
  11064. uncached = s.url.slice( cacheURL.length );
  11065. // If data is available, append data to url
  11066. if ( s.data ) {
  11067. cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
  11068. // #9682: remove data so that it's not used in an eventual retry
  11069. delete s.data;
  11070. }
  11071. // Add or update anti-cache param if needed
  11072. if ( s.cache === false ) {
  11073. cacheURL = cacheURL.replace( rantiCache, "$1" );
  11074. uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached;
  11075. }
  11076. // Put hash and anti-cache on the URL that will be requested (gh-1732)
  11077. s.url = cacheURL + uncached;
  11078. // Change '%20' to '+' if this is encoded form body content (gh-2658)
  11079. } else if ( s.data && s.processData &&
  11080. ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
  11081. s.data = s.data.replace( r20, "+" );
  11082. }
  11083. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  11084. if ( s.ifModified ) {
  11085. if ( jQuery.lastModified[ cacheURL ] ) {
  11086. jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
  11087. }
  11088. if ( jQuery.etag[ cacheURL ] ) {
  11089. jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
  11090. }
  11091. }
  11092. // Set the correct header, if data is being sent
  11093. if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
  11094. jqXHR.setRequestHeader( "Content-Type", s.contentType );
  11095. }
  11096. // Set the Accepts header for the server, depending on the dataType
  11097. jqXHR.setRequestHeader(
  11098. "Accept",
  11099. s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
  11100. s.accepts[ s.dataTypes[ 0 ] ] +
  11101. ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
  11102. s.accepts[ "*" ]
  11103. );
  11104. // Check for headers option
  11105. for ( i in s.headers ) {
  11106. jqXHR.setRequestHeader( i, s.headers[ i ] );
  11107. }
  11108. // Allow custom headers/mimetypes and early abort
  11109. if ( s.beforeSend &&
  11110. ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
  11111. // Abort if not done already and return
  11112. return jqXHR.abort();
  11113. }
  11114. // Aborting is no longer a cancellation
  11115. strAbort = "abort";
  11116. // Install callbacks on deferreds
  11117. completeDeferred.add( s.complete );
  11118. jqXHR.done( s.success );
  11119. jqXHR.fail( s.error );
  11120. // Get transport
  11121. transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
  11122. // If no transport, we auto-abort
  11123. if ( !transport ) {
  11124. done( -1, "No Transport" );
  11125. } else {
  11126. jqXHR.readyState = 1;
  11127. // Send global event
  11128. if ( fireGlobals ) {
  11129. globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
  11130. }
  11131. // If request was aborted inside ajaxSend, stop there
  11132. if ( completed ) {
  11133. return jqXHR;
  11134. }
  11135. // Timeout
  11136. if ( s.async && s.timeout > 0 ) {
  11137. timeoutTimer = window.setTimeout( function() {
  11138. jqXHR.abort( "timeout" );
  11139. }, s.timeout );
  11140. }
  11141. try {
  11142. completed = false;
  11143. transport.send( requestHeaders, done );
  11144. } catch ( e ) {
  11145. // Rethrow post-completion exceptions
  11146. if ( completed ) {
  11147. throw e;
  11148. }
  11149. // Propagate others as results
  11150. done( -1, e );
  11151. }
  11152. }
  11153. // Callback for when everything is done
  11154. function done( status, nativeStatusText, responses, headers ) {
  11155. var isSuccess, success, error, response, modified,
  11156. statusText = nativeStatusText;
  11157. // Ignore repeat invocations
  11158. if ( completed ) {
  11159. return;
  11160. }
  11161. completed = true;
  11162. // Clear timeout if it exists
  11163. if ( timeoutTimer ) {
  11164. window.clearTimeout( timeoutTimer );
  11165. }
  11166. // Dereference transport for early garbage collection
  11167. // (no matter how long the jqXHR object will be used)
  11168. transport = undefined;
  11169. // Cache response headers
  11170. responseHeadersString = headers || "";
  11171. // Set readyState
  11172. jqXHR.readyState = status > 0 ? 4 : 0;
  11173. // Determine if successful
  11174. isSuccess = status >= 200 && status < 300 || status === 304;
  11175. // Get response data
  11176. if ( responses ) {
  11177. response = ajaxHandleResponses( s, jqXHR, responses );
  11178. }
  11179. // Convert no matter what (that way responseXXX fields are always set)
  11180. response = ajaxConvert( s, response, jqXHR, isSuccess );
  11181. // If successful, handle type chaining
  11182. if ( isSuccess ) {
  11183. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  11184. if ( s.ifModified ) {
  11185. modified = jqXHR.getResponseHeader( "Last-Modified" );
  11186. if ( modified ) {
  11187. jQuery.lastModified[ cacheURL ] = modified;
  11188. }
  11189. modified = jqXHR.getResponseHeader( "etag" );
  11190. if ( modified ) {
  11191. jQuery.etag[ cacheURL ] = modified;
  11192. }
  11193. }
  11194. // if no content
  11195. if ( status === 204 || s.type === "HEAD" ) {
  11196. statusText = "nocontent";
  11197. // if not modified
  11198. } else if ( status === 304 ) {
  11199. statusText = "notmodified";
  11200. // If we have data, let's convert it
  11201. } else {
  11202. statusText = response.state;
  11203. success = response.data;
  11204. error = response.error;
  11205. isSuccess = !error;
  11206. }
  11207. } else {
  11208. // Extract error from statusText and normalize for non-aborts
  11209. error = statusText;
  11210. if ( status || !statusText ) {
  11211. statusText = "error";
  11212. if ( status < 0 ) {
  11213. status = 0;
  11214. }
  11215. }
  11216. }
  11217. // Set data for the fake xhr object
  11218. jqXHR.status = status;
  11219. jqXHR.statusText = ( nativeStatusText || statusText ) + "";
  11220. // Success/Error
  11221. if ( isSuccess ) {
  11222. deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
  11223. } else {
  11224. deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
  11225. }
  11226. // Status-dependent callbacks
  11227. jqXHR.statusCode( statusCode );
  11228. statusCode = undefined;
  11229. if ( fireGlobals ) {
  11230. globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
  11231. [ jqXHR, s, isSuccess ? success : error ] );
  11232. }
  11233. // Complete
  11234. completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
  11235. if ( fireGlobals ) {
  11236. globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
  11237. // Handle the global AJAX counter
  11238. if ( !( --jQuery.active ) ) {
  11239. jQuery.event.trigger( "ajaxStop" );
  11240. }
  11241. }
  11242. }
  11243. return jqXHR;
  11244. },
  11245. getJSON: function( url, data, callback ) {
  11246. return jQuery.get( url, data, callback, "json" );
  11247. },
  11248. getScript: function( url, callback ) {
  11249. return jQuery.get( url, undefined, callback, "script" );
  11250. }
  11251. } );
  11252. jQuery.each( [ "get", "post" ], function( i, method ) {
  11253. jQuery[ method ] = function( url, data, callback, type ) {
  11254. // Shift arguments if data argument was omitted
  11255. if ( jQuery.isFunction( data ) ) {
  11256. type = type || callback;
  11257. callback = data;
  11258. data = undefined;
  11259. }
  11260. // The url can be an options object (which then must have .url)
  11261. return jQuery.ajax( jQuery.extend( {
  11262. url: url,
  11263. type: method,
  11264. dataType: type,
  11265. data: data,
  11266. success: callback
  11267. }, jQuery.isPlainObject( url ) && url ) );
  11268. };
  11269. } );
  11270. jQuery._evalUrl = function( url ) {
  11271. return jQuery.ajax( {
  11272. url: url,
  11273. // Make this explicit, since user can override this through ajaxSetup (#11264)
  11274. type: "GET",
  11275. dataType: "script",
  11276. cache: true,
  11277. async: false,
  11278. global: false,
  11279. "throws": true
  11280. } );
  11281. };
  11282. jQuery.fn.extend( {
  11283. wrapAll: function( html ) {
  11284. var wrap;
  11285. if ( this[ 0 ] ) {
  11286. if ( jQuery.isFunction( html ) ) {
  11287. html = html.call( this[ 0 ] );
  11288. }
  11289. // The elements to wrap the target around
  11290. wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
  11291. if ( this[ 0 ].parentNode ) {
  11292. wrap.insertBefore( this[ 0 ] );
  11293. }
  11294. wrap.map( function() {
  11295. var elem = this;
  11296. while ( elem.firstElementChild ) {
  11297. elem = elem.firstElementChild;
  11298. }
  11299. return elem;
  11300. } ).append( this );
  11301. }
  11302. return this;
  11303. },
  11304. wrapInner: function( html ) {
  11305. if ( jQuery.isFunction( html ) ) {
  11306. return this.each( function( i ) {
  11307. jQuery( this ).wrapInner( html.call( this, i ) );
  11308. } );
  11309. }
  11310. return this.each( function() {
  11311. var self = jQuery( this ),
  11312. contents = self.contents();
  11313. if ( contents.length ) {
  11314. contents.wrapAll( html );
  11315. } else {
  11316. self.append( html );
  11317. }
  11318. } );
  11319. },
  11320. wrap: function( html ) {
  11321. var isFunction = jQuery.isFunction( html );
  11322. return this.each( function( i ) {
  11323. jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html );
  11324. } );
  11325. },
  11326. unwrap: function( selector ) {
  11327. this.parent( selector ).not( "body" ).each( function() {
  11328. jQuery( this ).replaceWith( this.childNodes );
  11329. } );
  11330. return this;
  11331. }
  11332. } );
  11333. jQuery.expr.pseudos.hidden = function( elem ) {
  11334. return !jQuery.expr.pseudos.visible( elem );
  11335. };
  11336. jQuery.expr.pseudos.visible = function( elem ) {
  11337. return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
  11338. };
  11339. jQuery.ajaxSettings.xhr = function() {
  11340. try {
  11341. return new window.XMLHttpRequest();
  11342. } catch ( e ) {}
  11343. };
  11344. var xhrSuccessStatus = {
  11345. // File protocol always yields status code 0, assume 200
  11346. 0: 200,
  11347. // Support: IE <=9 only
  11348. // #1450: sometimes IE returns 1223 when it should be 204
  11349. 1223: 204
  11350. },
  11351. xhrSupported = jQuery.ajaxSettings.xhr();
  11352. support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
  11353. support.ajax = xhrSupported = !!xhrSupported;
  11354. jQuery.ajaxTransport( function( options ) {
  11355. var callback, errorCallback;
  11356. // Cross domain only allowed if supported through XMLHttpRequest
  11357. if ( support.cors || xhrSupported && !options.crossDomain ) {
  11358. return {
  11359. send: function( headers, complete ) {
  11360. var i,
  11361. xhr = options.xhr();
  11362. xhr.open(
  11363. options.type,
  11364. options.url,
  11365. options.async,
  11366. options.username,
  11367. options.password
  11368. );
  11369. // Apply custom fields if provided
  11370. if ( options.xhrFields ) {
  11371. for ( i in options.xhrFields ) {
  11372. xhr[ i ] = options.xhrFields[ i ];
  11373. }
  11374. }
  11375. // Override mime type if needed
  11376. if ( options.mimeType && xhr.overrideMimeType ) {
  11377. xhr.overrideMimeType( options.mimeType );
  11378. }
  11379. // X-Requested-With header
  11380. // For cross-domain requests, seeing as conditions for a preflight are
  11381. // akin to a jigsaw puzzle, we simply never set it to be sure.
  11382. // (it can always be set on a per-request basis or even using ajaxSetup)
  11383. // For same-domain requests, won't change header if already provided.
  11384. if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
  11385. headers[ "X-Requested-With" ] = "XMLHttpRequest";
  11386. }
  11387. // Set headers
  11388. for ( i in headers ) {
  11389. xhr.setRequestHeader( i, headers[ i ] );
  11390. }
  11391. // Callback
  11392. callback = function( type ) {
  11393. return function() {
  11394. if ( callback ) {
  11395. callback = errorCallback = xhr.onload =
  11396. xhr.onerror = xhr.onabort = xhr.onreadystatechange = null;
  11397. if ( type === "abort" ) {
  11398. xhr.abort();
  11399. } else if ( type === "error" ) {
  11400. // Support: IE <=9 only
  11401. // On a manual native abort, IE9 throws
  11402. // errors on any property access that is not readyState
  11403. if ( typeof xhr.status !== "number" ) {
  11404. complete( 0, "error" );
  11405. } else {
  11406. complete(
  11407. // File: protocol always yields status 0; see #8605, #14207
  11408. xhr.status,
  11409. xhr.statusText
  11410. );
  11411. }
  11412. } else {
  11413. complete(
  11414. xhrSuccessStatus[ xhr.status ] || xhr.status,
  11415. xhr.statusText,
  11416. // Support: IE <=9 only
  11417. // IE9 has no XHR2 but throws on binary (trac-11426)
  11418. // For XHR2 non-text, let the caller handle it (gh-2498)
  11419. ( xhr.responseType || "text" ) !== "text" ||
  11420. typeof xhr.responseText !== "string" ?
  11421. { binary: xhr.response } :
  11422. { text: xhr.responseText },
  11423. xhr.getAllResponseHeaders()
  11424. );
  11425. }
  11426. }
  11427. };
  11428. };
  11429. // Listen to events
  11430. xhr.onload = callback();
  11431. errorCallback = xhr.onerror = callback( "error" );
  11432. // Support: IE 9 only
  11433. // Use onreadystatechange to replace onabort
  11434. // to handle uncaught aborts
  11435. if ( xhr.onabort !== undefined ) {
  11436. xhr.onabort = errorCallback;
  11437. } else {
  11438. xhr.onreadystatechange = function() {
  11439. // Check readyState before timeout as it changes
  11440. if ( xhr.readyState === 4 ) {
  11441. // Allow onerror to be called first,
  11442. // but that will not handle a native abort
  11443. // Also, save errorCallback to a variable
  11444. // as xhr.onerror cannot be accessed
  11445. window.setTimeout( function() {
  11446. if ( callback ) {
  11447. errorCallback();
  11448. }
  11449. } );
  11450. }
  11451. };
  11452. }
  11453. // Create the abort callback
  11454. callback = callback( "abort" );
  11455. try {
  11456. // Do send the request (this may raise an exception)
  11457. xhr.send( options.hasContent && options.data || null );
  11458. } catch ( e ) {
  11459. // #14683: Only rethrow if this hasn't been notified as an error yet
  11460. if ( callback ) {
  11461. throw e;
  11462. }
  11463. }
  11464. },
  11465. abort: function() {
  11466. if ( callback ) {
  11467. callback();
  11468. }
  11469. }
  11470. };
  11471. }
  11472. } );
  11473. // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
  11474. jQuery.ajaxPrefilter( function( s ) {
  11475. if ( s.crossDomain ) {
  11476. s.contents.script = false;
  11477. }
  11478. } );
  11479. // Install script dataType
  11480. jQuery.ajaxSetup( {
  11481. accepts: {
  11482. script: "text/javascript, application/javascript, " +
  11483. "application/ecmascript, application/x-ecmascript"
  11484. },
  11485. contents: {
  11486. script: /\b(?:java|ecma)script\b/
  11487. },
  11488. converters: {
  11489. "text script": function( text ) {
  11490. jQuery.globalEval( text );
  11491. return text;
  11492. }
  11493. }
  11494. } );
  11495. // Handle cache's special case and crossDomain
  11496. jQuery.ajaxPrefilter( "script", function( s ) {
  11497. if ( s.cache === undefined ) {
  11498. s.cache = false;
  11499. }
  11500. if ( s.crossDomain ) {
  11501. s.type = "GET";
  11502. }
  11503. } );
  11504. // Bind script tag hack transport
  11505. jQuery.ajaxTransport( "script", function( s ) {
  11506. // This transport only deals with cross domain requests
  11507. if ( s.crossDomain ) {
  11508. var script, callback;
  11509. return {
  11510. send: function( _, complete ) {
  11511. script = jQuery( "<script>" ).prop( {
  11512. charset: s.scriptCharset,
  11513. src: s.url
  11514. } ).on(
  11515. "load error",
  11516. callback = function( evt ) {
  11517. script.remove();
  11518. callback = null;
  11519. if ( evt ) {
  11520. complete( evt.type === "error" ? 404 : 200, evt.type );
  11521. }
  11522. }
  11523. );
  11524. // Use native DOM manipulation to avoid our domManip AJAX trickery
  11525. document.head.appendChild( script[ 0 ] );
  11526. },
  11527. abort: function() {
  11528. if ( callback ) {
  11529. callback();
  11530. }
  11531. }
  11532. };
  11533. }
  11534. } );
  11535. var oldCallbacks = [],
  11536. rjsonp = /(=)\?(?=&|$)|\?\?/;
  11537. // Default jsonp settings
  11538. jQuery.ajaxSetup( {
  11539. jsonp: "callback",
  11540. jsonpCallback: function() {
  11541. var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
  11542. this[ callback ] = true;
  11543. return callback;
  11544. }
  11545. } );
  11546. // Detect, normalize options and install callbacks for jsonp requests
  11547. jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
  11548. var callbackName, overwritten, responseContainer,
  11549. jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
  11550. "url" :
  11551. typeof s.data === "string" &&
  11552. ( s.contentType || "" )
  11553. .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
  11554. rjsonp.test( s.data ) && "data"
  11555. );
  11556. // Handle iff the expected data type is "jsonp" or we have a parameter to set
  11557. if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
  11558. // Get callback name, remembering preexisting value associated with it
  11559. callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
  11560. s.jsonpCallback() :
  11561. s.jsonpCallback;
  11562. // Insert callback into url or form data
  11563. if ( jsonProp ) {
  11564. s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
  11565. } else if ( s.jsonp !== false ) {
  11566. s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
  11567. }
  11568. // Use data converter to retrieve json after script execution
  11569. s.converters[ "script json" ] = function() {
  11570. if ( !responseContainer ) {
  11571. jQuery.error( callbackName + " was not called" );
  11572. }
  11573. return responseContainer[ 0 ];
  11574. };
  11575. // Force json dataType
  11576. s.dataTypes[ 0 ] = "json";
  11577. // Install callback
  11578. overwritten = window[ callbackName ];
  11579. window[ callbackName ] = function() {
  11580. responseContainer = arguments;
  11581. };
  11582. // Clean-up function (fires after converters)
  11583. jqXHR.always( function() {
  11584. // If previous value didn't exist - remove it
  11585. if ( overwritten === undefined ) {
  11586. jQuery( window ).removeProp( callbackName );
  11587. // Otherwise restore preexisting value
  11588. } else {
  11589. window[ callbackName ] = overwritten;
  11590. }
  11591. // Save back as free
  11592. if ( s[ callbackName ] ) {
  11593. // Make sure that re-using the options doesn't screw things around
  11594. s.jsonpCallback = originalSettings.jsonpCallback;
  11595. // Save the callback name for future use
  11596. oldCallbacks.push( callbackName );
  11597. }
  11598. // Call if it was a function and we have a response
  11599. if ( responseContainer && jQuery.isFunction( overwritten ) ) {
  11600. overwritten( responseContainer[ 0 ] );
  11601. }
  11602. responseContainer = overwritten = undefined;
  11603. } );
  11604. // Delegate to script
  11605. return "script";
  11606. }
  11607. } );
  11608. // Support: Safari 8 only
  11609. // In Safari 8 documents created via document.implementation.createHTMLDocument
  11610. // collapse sibling forms: the second one becomes a child of the first one.
  11611. // Because of that, this security measure has to be disabled in Safari 8.
  11612. // https://bugs.webkit.org/show_bug.cgi?id=137337
  11613. support.createHTMLDocument = ( function() {
  11614. var body = document.implementation.createHTMLDocument( "" ).body;
  11615. body.innerHTML = "<form></form><form></form>";
  11616. return body.childNodes.length === 2;
  11617. } )();
  11618. // Argument "data" should be string of html
  11619. // context (optional): If specified, the fragment will be created in this context,
  11620. // defaults to document
  11621. // keepScripts (optional): If true, will include scripts passed in the html string
  11622. jQuery.parseHTML = function( data, context, keepScripts ) {
  11623. if ( typeof data !== "string" ) {
  11624. return [];
  11625. }
  11626. if ( typeof context === "boolean" ) {
  11627. keepScripts = context;
  11628. context = false;
  11629. }
  11630. var base, parsed, scripts;
  11631. if ( !context ) {
  11632. // Stop scripts or inline event handlers from being executed immediately
  11633. // by using document.implementation
  11634. if ( support.createHTMLDocument ) {
  11635. context = document.implementation.createHTMLDocument( "" );
  11636. // Set the base href for the created document
  11637. // so any parsed elements with URLs
  11638. // are based on the document's URL (gh-2965)
  11639. base = context.createElement( "base" );
  11640. base.href = document.location.href;
  11641. context.head.appendChild( base );
  11642. } else {
  11643. context = document;
  11644. }
  11645. }
  11646. parsed = rsingleTag.exec( data );
  11647. scripts = !keepScripts && [];
  11648. // Single tag
  11649. if ( parsed ) {
  11650. return [ context.createElement( parsed[ 1 ] ) ];
  11651. }
  11652. parsed = buildFragment( [ data ], context, scripts );
  11653. if ( scripts && scripts.length ) {
  11654. jQuery( scripts ).remove();
  11655. }
  11656. return jQuery.merge( [], parsed.childNodes );
  11657. };
  11658. /**
  11659. * Load a url into a page
  11660. */
  11661. jQuery.fn.load = function( url, params, callback ) {
  11662. var selector, type, response,
  11663. self = this,
  11664. off = url.indexOf( " " );
  11665. if ( off > -1 ) {
  11666. selector = stripAndCollapse( url.slice( off ) );
  11667. url = url.slice( 0, off );
  11668. }
  11669. // If it's a function
  11670. if ( jQuery.isFunction( params ) ) {
  11671. // We assume that it's the callback
  11672. callback = params;
  11673. params = undefined;
  11674. // Otherwise, build a param string
  11675. } else if ( params && typeof params === "object" ) {
  11676. type = "POST";
  11677. }
  11678. // If we have elements to modify, make the request
  11679. if ( self.length > 0 ) {
  11680. jQuery.ajax( {
  11681. url: url,
  11682. // If "type" variable is undefined, then "GET" method will be used.
  11683. // Make value of this field explicit since
  11684. // user can override it through ajaxSetup method
  11685. type: type || "GET",
  11686. dataType: "html",
  11687. data: params
  11688. } ).done( function( responseText ) {
  11689. // Save response for use in complete callback
  11690. response = arguments;
  11691. self.html( selector ?
  11692. // If a selector was specified, locate the right elements in a dummy div
  11693. // Exclude scripts to avoid IE 'Permission Denied' errors
  11694. jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
  11695. // Otherwise use the full result
  11696. responseText );
  11697. // If the request succeeds, this function gets "data", "status", "jqXHR"
  11698. // but they are ignored because response was set above.
  11699. // If it fails, this function gets "jqXHR", "status", "error"
  11700. } ).always( callback && function( jqXHR, status ) {
  11701. self.each( function() {
  11702. callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
  11703. } );
  11704. } );
  11705. }
  11706. return this;
  11707. };
  11708. // Attach a bunch of functions for handling common AJAX events
  11709. jQuery.each( [
  11710. "ajaxStart",
  11711. "ajaxStop",
  11712. "ajaxComplete",
  11713. "ajaxError",
  11714. "ajaxSuccess",
  11715. "ajaxSend"
  11716. ], function( i, type ) {
  11717. jQuery.fn[ type ] = function( fn ) {
  11718. return this.on( type, fn );
  11719. };
  11720. } );
  11721. jQuery.expr.pseudos.animated = function( elem ) {
  11722. return jQuery.grep( jQuery.timers, function( fn ) {
  11723. return elem === fn.elem;
  11724. } ).length;
  11725. };
  11726. /**
  11727. * Gets a window from an element
  11728. */
  11729. function getWindow( elem ) {
  11730. return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;
  11731. }
  11732. jQuery.offset = {
  11733. setOffset: function( elem, options, i ) {
  11734. var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
  11735. position = jQuery.css( elem, "position" ),
  11736. curElem = jQuery( elem ),
  11737. props = {};
  11738. // Set position first, in-case top/left are set even on static elem
  11739. if ( position === "static" ) {
  11740. elem.style.position = "relative";
  11741. }
  11742. curOffset = curElem.offset();
  11743. curCSSTop = jQuery.css( elem, "top" );
  11744. curCSSLeft = jQuery.css( elem, "left" );
  11745. calculatePosition = ( position === "absolute" || position === "fixed" ) &&
  11746. ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
  11747. // Need to be able to calculate position if either
  11748. // top or left is auto and position is either absolute or fixed
  11749. if ( calculatePosition ) {
  11750. curPosition = curElem.position();
  11751. curTop = curPosition.top;
  11752. curLeft = curPosition.left;
  11753. } else {
  11754. curTop = parseFloat( curCSSTop ) || 0;
  11755. curLeft = parseFloat( curCSSLeft ) || 0;
  11756. }
  11757. if ( jQuery.isFunction( options ) ) {
  11758. // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
  11759. options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
  11760. }
  11761. if ( options.top != null ) {
  11762. props.top = ( options.top - curOffset.top ) + curTop;
  11763. }
  11764. if ( options.left != null ) {
  11765. props.left = ( options.left - curOffset.left ) + curLeft;
  11766. }
  11767. if ( "using" in options ) {
  11768. options.using.call( elem, props );
  11769. } else {
  11770. curElem.css( props );
  11771. }
  11772. }
  11773. };
  11774. jQuery.fn.extend( {
  11775. offset: function( options ) {
  11776. // Preserve chaining for setter
  11777. if ( arguments.length ) {
  11778. return options === undefined ?
  11779. this :
  11780. this.each( function( i ) {
  11781. jQuery.offset.setOffset( this, options, i );
  11782. } );
  11783. }
  11784. var docElem, win, rect, doc,
  11785. elem = this[ 0 ];
  11786. if ( !elem ) {
  11787. return;
  11788. }
  11789. // Support: IE <=11 only
  11790. // Running getBoundingClientRect on a
  11791. // disconnected node in IE throws an error
  11792. if ( !elem.getClientRects().length ) {
  11793. return { top: 0, left: 0 };
  11794. }
  11795. rect = elem.getBoundingClientRect();
  11796. // Make sure element is not hidden (display: none)
  11797. if ( rect.width || rect.height ) {
  11798. doc = elem.ownerDocument;
  11799. win = getWindow( doc );
  11800. docElem = doc.documentElement;
  11801. return {
  11802. top: rect.top + win.pageYOffset - docElem.clientTop,
  11803. left: rect.left + win.pageXOffset - docElem.clientLeft
  11804. };
  11805. }
  11806. // Return zeros for disconnected and hidden elements (gh-2310)
  11807. return rect;
  11808. },
  11809. position: function() {
  11810. if ( !this[ 0 ] ) {
  11811. return;
  11812. }
  11813. var offsetParent, offset,
  11814. elem = this[ 0 ],
  11815. parentOffset = { top: 0, left: 0 };
  11816. // Fixed elements are offset from window (parentOffset = {top:0, left: 0},
  11817. // because it is its only offset parent
  11818. if ( jQuery.css( elem, "position" ) === "fixed" ) {
  11819. // Assume getBoundingClientRect is there when computed position is fixed
  11820. offset = elem.getBoundingClientRect();
  11821. } else {
  11822. // Get *real* offsetParent
  11823. offsetParent = this.offsetParent();
  11824. // Get correct offsets
  11825. offset = this.offset();
  11826. if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
  11827. parentOffset = offsetParent.offset();
  11828. }
  11829. // Add offsetParent borders
  11830. parentOffset = {
  11831. top: parentOffset.top + jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ),
  11832. left: parentOffset.left + jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true )
  11833. };
  11834. }
  11835. // Subtract parent offsets and element margins
  11836. return {
  11837. top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
  11838. left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
  11839. };
  11840. },
  11841. // This method will return documentElement in the following cases:
  11842. // 1) For the element inside the iframe without offsetParent, this method will return
  11843. // documentElement of the parent window
  11844. // 2) For the hidden or detached element
  11845. // 3) For body or html element, i.e. in case of the html node - it will return itself
  11846. //
  11847. // but those exceptions were never presented as a real life use-cases
  11848. // and might be considered as more preferable results.
  11849. //
  11850. // This logic, however, is not guaranteed and can change at any point in the future
  11851. offsetParent: function() {
  11852. return this.map( function() {
  11853. var offsetParent = this.offsetParent;
  11854. while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
  11855. offsetParent = offsetParent.offsetParent;
  11856. }
  11857. return offsetParent || documentElement;
  11858. } );
  11859. }
  11860. } );
  11861. // Create scrollLeft and scrollTop methods
  11862. jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
  11863. var top = "pageYOffset" === prop;
  11864. jQuery.fn[ method ] = function( val ) {
  11865. return access( this, function( elem, method, val ) {
  11866. var win = getWindow( elem );
  11867. if ( val === undefined ) {
  11868. return win ? win[ prop ] : elem[ method ];
  11869. }
  11870. if ( win ) {
  11871. win.scrollTo(
  11872. !top ? val : win.pageXOffset,
  11873. top ? val : win.pageYOffset
  11874. );
  11875. } else {
  11876. elem[ method ] = val;
  11877. }
  11878. }, method, val, arguments.length );
  11879. };
  11880. } );
  11881. // Support: Safari <=7 - 9.1, Chrome <=37 - 49
  11882. // Add the top/left cssHooks using jQuery.fn.position
  11883. // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
  11884. // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
  11885. // getComputedStyle returns percent when specified for top/left/bottom/right;
  11886. // rather than make the css module depend on the offset module, just check for it here
  11887. jQuery.each( [ "top", "left" ], function( i, prop ) {
  11888. jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
  11889. function( elem, computed ) {
  11890. if ( computed ) {
  11891. computed = curCSS( elem, prop );
  11892. // If curCSS returns percentage, fallback to offset
  11893. return rnumnonpx.test( computed ) ?
  11894. jQuery( elem ).position()[ prop ] + "px" :
  11895. computed;
  11896. }
  11897. }
  11898. );
  11899. } );
  11900. // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
  11901. jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
  11902. jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
  11903. function( defaultExtra, funcName ) {
  11904. // Margin is only for outerHeight, outerWidth
  11905. jQuery.fn[ funcName ] = function( margin, value ) {
  11906. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  11907. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  11908. return access( this, function( elem, type, value ) {
  11909. var doc;
  11910. if ( jQuery.isWindow( elem ) ) {
  11911. // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
  11912. return funcName.indexOf( "outer" ) === 0 ?
  11913. elem[ "inner" + name ] :
  11914. elem.document.documentElement[ "client" + name ];
  11915. }
  11916. // Get document width or height
  11917. if ( elem.nodeType === 9 ) {
  11918. doc = elem.documentElement;
  11919. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
  11920. // whichever is greatest
  11921. return Math.max(
  11922. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  11923. elem.body[ "offset" + name ], doc[ "offset" + name ],
  11924. doc[ "client" + name ]
  11925. );
  11926. }
  11927. return value === undefined ?
  11928. // Get width or height on the element, requesting but not forcing parseFloat
  11929. jQuery.css( elem, type, extra ) :
  11930. // Set width or height on the element
  11931. jQuery.style( elem, type, value, extra );
  11932. }, type, chainable ? margin : undefined, chainable );
  11933. };
  11934. } );
  11935. } );
  11936. jQuery.fn.extend( {
  11937. bind: function( types, data, fn ) {
  11938. return this.on( types, null, data, fn );
  11939. },
  11940. unbind: function( types, fn ) {
  11941. return this.off( types, null, fn );
  11942. },
  11943. delegate: function( selector, types, data, fn ) {
  11944. return this.on( types, selector, data, fn );
  11945. },
  11946. undelegate: function( selector, types, fn ) {
  11947. // ( namespace ) or ( selector, types [, fn] )
  11948. return arguments.length === 1 ?
  11949. this.off( selector, "**" ) :
  11950. this.off( types, selector || "**", fn );
  11951. }
  11952. } );
  11953. jQuery.parseJSON = JSON.parse;
  11954. // Register as a named AMD module, since jQuery can be concatenated with other
  11955. // files that may use define, but not via a proper concatenation script that
  11956. // understands anonymous AMD modules. A named AMD is safest and most robust
  11957. // way to register. Lowercase jquery is used because AMD module names are
  11958. // derived from file names, and jQuery is normally delivered in a lowercase
  11959. // file name. Do this after creating the global so that if an AMD module wants
  11960. // to call noConflict to hide this version of jQuery, it will work.
  11961. // Note that for maximum portability, libraries that are not jQuery should
  11962. // declare themselves as anonymous modules, and avoid setting a global if an
  11963. // AMD loader is present. jQuery is a special case. For more information, see
  11964. // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
  11965. if ( true ) {
  11966. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() {
  11967. return jQuery;
  11968. }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  11969. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  11970. }
  11971. var
  11972. // Map over jQuery in case of overwrite
  11973. _jQuery = window.jQuery,
  11974. // Map over the $ in case of overwrite
  11975. _$ = window.$;
  11976. jQuery.noConflict = function( deep ) {
  11977. if ( window.$ === jQuery ) {
  11978. window.$ = _$;
  11979. }
  11980. if ( deep && window.jQuery === jQuery ) {
  11981. window.jQuery = _jQuery;
  11982. }
  11983. return jQuery;
  11984. };
  11985. // Expose jQuery and $ identifiers, even in AMD
  11986. // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
  11987. // and CommonJS for browser emulators (#13566)
  11988. if ( !noGlobal ) {
  11989. window.jQuery = window.$ = jQuery;
  11990. }
  11991. return jQuery;
  11992. } );
  11993. /***/ }),
  11994. /* 3 */
  11995. /***/ (function(module, exports, __webpack_require__) {
  11996. /*!
  11997. * sweetalert2 v6.4.2
  11998. * Released under the MIT License.
  11999. */
  12000. (function (global, factory) {
  12001. true ? module.exports = factory() :
  12002. typeof define === 'function' && define.amd ? define(factory) :
  12003. (global.Sweetalert2 = factory());
  12004. }(this, (function () { 'use strict';
  12005. var defaultParams = {
  12006. title: '',
  12007. titleText: '',
  12008. text: '',
  12009. html: '',
  12010. type: null,
  12011. customClass: '',
  12012. target: 'body',
  12013. animation: true,
  12014. allowOutsideClick: true,
  12015. allowEscapeKey: true,
  12016. allowEnterKey: true,
  12017. showConfirmButton: true,
  12018. showCancelButton: false,
  12019. preConfirm: null,
  12020. confirmButtonText: 'OK',
  12021. confirmButtonColor: '#3085d6',
  12022. confirmButtonClass: null,
  12023. cancelButtonText: 'Cancel',
  12024. cancelButtonColor: '#aaa',
  12025. cancelButtonClass: null,
  12026. buttonsStyling: true,
  12027. reverseButtons: false,
  12028. focusCancel: false,
  12029. showCloseButton: false,
  12030. showLoaderOnConfirm: false,
  12031. imageUrl: null,
  12032. imageWidth: null,
  12033. imageHeight: null,
  12034. imageClass: null,
  12035. timer: null,
  12036. width: 500,
  12037. padding: 20,
  12038. background: '#fff',
  12039. input: null,
  12040. inputPlaceholder: '',
  12041. inputValue: '',
  12042. inputOptions: {},
  12043. inputAutoTrim: true,
  12044. inputClass: null,
  12045. inputAttributes: {},
  12046. inputValidator: null,
  12047. progressSteps: [],
  12048. currentProgressStep: null,
  12049. progressStepsDistance: '40px',
  12050. onOpen: null,
  12051. onClose: null
  12052. };
  12053. var swalPrefix = 'swal2-';
  12054. var prefix = function prefix(items) {
  12055. var result = {};
  12056. for (var i in items) {
  12057. result[items[i]] = swalPrefix + items[i];
  12058. }
  12059. return result;
  12060. };
  12061. var swalClasses = prefix(['container', 'shown', 'iosfix', 'modal', 'overlay', 'fade', 'show', 'hide', 'noanimation', 'close', 'title', 'content', 'spacer', 'confirm', 'cancel', 'icon', 'image', 'input', 'file', 'range', 'select', 'radio', 'checkbox', 'textarea', 'inputerror', 'validationerror', 'progresssteps', 'activeprogressstep', 'progresscircle', 'progressline', 'loading', 'styled']);
  12062. var iconTypes = prefix(['success', 'warning', 'info', 'question', 'error']);
  12063. /*
  12064. * Set hover, active and focus-states for buttons (source: http://www.sitepoint.com/javascript-generate-lighter-darker-color)
  12065. */
  12066. var colorLuminance = function colorLuminance(hex, lum) {
  12067. // Validate hex string
  12068. hex = String(hex).replace(/[^0-9a-f]/gi, '');
  12069. if (hex.length < 6) {
  12070. hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
  12071. }
  12072. lum = lum || 0;
  12073. // Convert to decimal and change luminosity
  12074. var rgb = '#';
  12075. for (var i = 0; i < 3; i++) {
  12076. var c = parseInt(hex.substr(i * 2, 2), 16);
  12077. c = Math.round(Math.min(Math.max(0, c + c * lum), 255)).toString(16);
  12078. rgb += ('00' + c).substr(c.length);
  12079. }
  12080. return rgb;
  12081. };
  12082. /* global MouseEvent */
  12083. // Remember state in cases where opening and handling a modal will fiddle with it.
  12084. var states = {
  12085. previousWindowKeyDown: null,
  12086. previousActiveElement: null,
  12087. previousBodyPadding: null
  12088. };
  12089. /*
  12090. * Add modal + overlay to DOM
  12091. */
  12092. var init = function init(params) {
  12093. if (typeof document === 'undefined') {
  12094. console.error('SweetAlert2 requires document to initialize');
  12095. return;
  12096. }
  12097. var container = document.createElement('div');
  12098. container.className = swalClasses.container;
  12099. container.innerHTML = sweetHTML;
  12100. var targetElement = document.querySelector(params.target);
  12101. if (!targetElement) {
  12102. console.warn('SweetAlert2: Can\'t find the target "' + params.target + '"');
  12103. targetElement = document.body;
  12104. }
  12105. targetElement.appendChild(container);
  12106. var modal = getModal();
  12107. var input = getChildByClass(modal, swalClasses.input);
  12108. var file = getChildByClass(modal, swalClasses.file);
  12109. var range = modal.querySelector('.' + swalClasses.range + ' input');
  12110. var rangeOutput = modal.querySelector('.' + swalClasses.range + ' output');
  12111. var select = getChildByClass(modal, swalClasses.select);
  12112. var checkbox = modal.querySelector('.' + swalClasses.checkbox + ' input');
  12113. var textarea = getChildByClass(modal, swalClasses.textarea);
  12114. input.oninput = function () {
  12115. sweetAlert.resetValidationError();
  12116. };
  12117. input.onkeydown = function (event) {
  12118. setTimeout(function () {
  12119. if (event.keyCode === 13 && params.allowEnterKey) {
  12120. event.stopPropagation();
  12121. sweetAlert.clickConfirm();
  12122. }
  12123. }, 0);
  12124. };
  12125. file.onchange = function () {
  12126. sweetAlert.resetValidationError();
  12127. };
  12128. range.oninput = function () {
  12129. sweetAlert.resetValidationError();
  12130. rangeOutput.value = range.value;
  12131. };
  12132. range.onchange = function () {
  12133. sweetAlert.resetValidationError();
  12134. range.previousSibling.value = range.value;
  12135. };
  12136. select.onchange = function () {
  12137. sweetAlert.resetValidationError();
  12138. };
  12139. checkbox.onchange = function () {
  12140. sweetAlert.resetValidationError();
  12141. };
  12142. textarea.oninput = function () {
  12143. sweetAlert.resetValidationError();
  12144. };
  12145. return modal;
  12146. };
  12147. /*
  12148. * Manipulate DOM
  12149. */
  12150. var sweetHTML = ('\n <div role="dialog" aria-labelledby="modalTitleId" aria-describedby="modalContentId" class="' + swalClasses.modal + '" tabIndex="-1" >\n <ul class="' + swalClasses.progresssteps + '"></ul>\n <div class="' + swalClasses.icon + ' ' + iconTypes.error + '">\n <span class="x-mark"><span class="line left"></span><span class="line right"></span></span>\n </div>\n <div class="' + swalClasses.icon + ' ' + iconTypes.question + '">?</div>\n <div class="' + swalClasses.icon + ' ' + iconTypes.warning + '">!</div>\n <div class="' + swalClasses.icon + ' ' + iconTypes.info + '">i</div>\n <div class="' + swalClasses.icon + ' ' + iconTypes.success + '">\n <span class="line tip"></span> <span class="line long"></span>\n <div class="placeholder"></div> <div class="fix"></div>\n </div>\n <img class="' + swalClasses.image + '">\n <h2 class="' + swalClasses.title + '" id="modalTitleId"></h2>\n <div id="modalContentId" class="' + swalClasses.content + '"></div>\n <input class="' + swalClasses.input + '">\n <input type="file" class="' + swalClasses.file + '">\n <div class="' + swalClasses.range + '">\n <output></output>\n <input type="range">\n </div>\n <select class="' + swalClasses.select + '"></select>\n <div class="' + swalClasses.radio + '"></div>\n <label for="' + swalClasses.checkbox + '" class="' + swalClasses.checkbox + '">\n <input type="checkbox">\n </label>\n <textarea class="' + swalClasses.textarea + '"></textarea>\n <div class="' + swalClasses.validationerror + '"></div>\n <hr class="' + swalClasses.spacer + '">\n <button type="button" role="button" tabIndex="0" class="' + swalClasses.confirm + '">OK</button>\n <button type="button" role="button" tabIndex="0" class="' + swalClasses.cancel + '">Cancel</button>\n <span class="' + swalClasses.close + '">&times;</span>\n </div>\n').replace(/(^|\n)\s*/g, '');
  12151. var getContainer = function getContainer() {
  12152. return document.body.querySelector('.' + swalClasses.container);
  12153. };
  12154. var getModal = function getModal() {
  12155. return getContainer() ? getContainer().querySelector('.' + swalClasses.modal) : null;
  12156. };
  12157. var getIcons = function getIcons() {
  12158. var modal = getModal();
  12159. return modal.querySelectorAll('.' + swalClasses.icon);
  12160. };
  12161. var elementByClass = function elementByClass(className) {
  12162. return getContainer() ? getContainer().querySelector('.' + className) : null;
  12163. };
  12164. var getTitle = function getTitle() {
  12165. return elementByClass(swalClasses.title);
  12166. };
  12167. var getContent = function getContent() {
  12168. return elementByClass(swalClasses.content);
  12169. };
  12170. var getImage = function getImage() {
  12171. return elementByClass(swalClasses.image);
  12172. };
  12173. var getSpacer = function getSpacer() {
  12174. return elementByClass(swalClasses.spacer);
  12175. };
  12176. var getProgressSteps = function getProgressSteps() {
  12177. return elementByClass(swalClasses.progresssteps);
  12178. };
  12179. var getValidationError = function getValidationError() {
  12180. return elementByClass(swalClasses.validationerror);
  12181. };
  12182. var getConfirmButton = function getConfirmButton() {
  12183. return elementByClass(swalClasses.confirm);
  12184. };
  12185. var getCancelButton = function getCancelButton() {
  12186. return elementByClass(swalClasses.cancel);
  12187. };
  12188. var getCloseButton = function getCloseButton() {
  12189. return elementByClass(swalClasses.close);
  12190. };
  12191. var getFocusableElements = function getFocusableElements(focusCancel) {
  12192. var buttons = [getConfirmButton(), getCancelButton()];
  12193. if (focusCancel) {
  12194. buttons.reverse();
  12195. }
  12196. return buttons.concat(Array.prototype.slice.call(getModal().querySelectorAll('button:not([class^=' + swalPrefix + ']), input:not([type=hidden]), textarea, select')));
  12197. };
  12198. var hasClass = function hasClass(elem, className) {
  12199. if (elem.classList) {
  12200. return elem.classList.contains(className);
  12201. }
  12202. return false;
  12203. };
  12204. var focusInput = function focusInput(input) {
  12205. input.focus();
  12206. // place cursor at end of text in text input
  12207. if (input.type !== 'file') {
  12208. // http://stackoverflow.com/a/2345915/1331425
  12209. var val = input.value;
  12210. input.value = '';
  12211. input.value = val;
  12212. }
  12213. };
  12214. var addClass = function addClass(elem, className) {
  12215. if (!elem || !className) {
  12216. return;
  12217. }
  12218. var classes = className.split(/\s+/).filter(Boolean);
  12219. classes.forEach(function (className) {
  12220. elem.classList.add(className);
  12221. });
  12222. };
  12223. var removeClass = function removeClass(elem, className) {
  12224. if (!elem || !className) {
  12225. return;
  12226. }
  12227. var classes = className.split(/\s+/).filter(Boolean);
  12228. classes.forEach(function (className) {
  12229. elem.classList.remove(className);
  12230. });
  12231. };
  12232. var getChildByClass = function getChildByClass(elem, className) {
  12233. for (var i = 0; i < elem.childNodes.length; i++) {
  12234. if (hasClass(elem.childNodes[i], className)) {
  12235. return elem.childNodes[i];
  12236. }
  12237. }
  12238. };
  12239. var show = function show(elem, display) {
  12240. if (!display) {
  12241. display = 'block';
  12242. }
  12243. elem.style.opacity = '';
  12244. elem.style.display = display;
  12245. };
  12246. var hide = function hide(elem) {
  12247. elem.style.opacity = '';
  12248. elem.style.display = 'none';
  12249. };
  12250. var empty = function empty(elem) {
  12251. while (elem.firstChild) {
  12252. elem.removeChild(elem.firstChild);
  12253. }
  12254. };
  12255. // borrowed from jqeury $(elem).is(':visible') implementation
  12256. var isVisible = function isVisible(elem) {
  12257. return elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length;
  12258. };
  12259. var removeStyleProperty = function removeStyleProperty(elem, property) {
  12260. if (elem.style.removeProperty) {
  12261. elem.style.removeProperty(property);
  12262. } else {
  12263. elem.style.removeAttribute(property);
  12264. }
  12265. };
  12266. var fireClick = function fireClick(node) {
  12267. if (!isVisible(node)) {
  12268. return false;
  12269. }
  12270. // Taken from http://www.nonobtrusive.com/2011/11/29/programatically-fire-crossbrowser-click-event-with-javascript/
  12271. // Then fixed for today's Chrome browser.
  12272. if (typeof MouseEvent === 'function') {
  12273. // Up-to-date approach
  12274. var mevt = new MouseEvent('click', {
  12275. view: window,
  12276. bubbles: false,
  12277. cancelable: true
  12278. });
  12279. node.dispatchEvent(mevt);
  12280. } else if (document.createEvent) {
  12281. // Fallback
  12282. var evt = document.createEvent('MouseEvents');
  12283. evt.initEvent('click', false, false);
  12284. node.dispatchEvent(evt);
  12285. } else if (document.createEventObject) {
  12286. node.fireEvent('onclick');
  12287. } else if (typeof node.onclick === 'function') {
  12288. node.onclick();
  12289. }
  12290. };
  12291. var animationEndEvent = function () {
  12292. var testEl = document.createElement('div');
  12293. var transEndEventNames = {
  12294. 'WebkitAnimation': 'webkitAnimationEnd',
  12295. 'OAnimation': 'oAnimationEnd oanimationend',
  12296. 'msAnimation': 'MSAnimationEnd',
  12297. 'animation': 'animationend'
  12298. };
  12299. for (var i in transEndEventNames) {
  12300. if (transEndEventNames.hasOwnProperty(i) && testEl.style[i] !== undefined) {
  12301. return transEndEventNames[i];
  12302. }
  12303. }
  12304. return false;
  12305. }();
  12306. // Reset previous window keydown handler and focued element
  12307. var resetPrevState = function resetPrevState() {
  12308. window.onkeydown = states.previousWindowKeyDown;
  12309. if (states.previousActiveElement && states.previousActiveElement.focus) {
  12310. var x = window.scrollX;
  12311. var y = window.scrollY;
  12312. states.previousActiveElement.focus();
  12313. if (x && y) {
  12314. // IE has no scrollX/scrollY support
  12315. window.scrollTo(x, y);
  12316. }
  12317. }
  12318. };
  12319. // Measure width of scrollbar
  12320. // https://github.com/twbs/bootstrap/blob/master/js/modal.js#L279-L286
  12321. var measureScrollbar = function measureScrollbar() {
  12322. var supportsTouch = 'ontouchstart' in window || navigator.msMaxTouchPoints;
  12323. if (supportsTouch) {
  12324. return 0;
  12325. }
  12326. var scrollDiv = document.createElement('div');
  12327. scrollDiv.style.width = '50px';
  12328. scrollDiv.style.height = '50px';
  12329. scrollDiv.style.overflow = 'scroll';
  12330. document.body.appendChild(scrollDiv);
  12331. var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
  12332. document.body.removeChild(scrollDiv);
  12333. return scrollbarWidth;
  12334. };
  12335. // JavaScript Debounce Function
  12336. // Simplivied version of https://davidwalsh.name/javascript-debounce-function
  12337. var debounce = function debounce(func, wait) {
  12338. var timeout = void 0;
  12339. return function () {
  12340. var later = function later() {
  12341. timeout = null;
  12342. func();
  12343. };
  12344. clearTimeout(timeout);
  12345. timeout = setTimeout(later, wait);
  12346. };
  12347. };
  12348. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
  12349. return typeof obj;
  12350. } : function (obj) {
  12351. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  12352. };
  12353. var _extends = Object.assign || function (target) {
  12354. for (var i = 1; i < arguments.length; i++) {
  12355. var source = arguments[i];
  12356. for (var key in source) {
  12357. if (Object.prototype.hasOwnProperty.call(source, key)) {
  12358. target[key] = source[key];
  12359. }
  12360. }
  12361. }
  12362. return target;
  12363. };
  12364. var modalParams = _extends({}, defaultParams);
  12365. var queue = [];
  12366. var swal2Observer = void 0;
  12367. /*
  12368. * Set type, text and actions on modal
  12369. */
  12370. var setParameters = function setParameters(params) {
  12371. var modal = getModal() || init(params);
  12372. for (var param in params) {
  12373. if (!defaultParams.hasOwnProperty(param) && param !== 'extraParams') {
  12374. console.warn('SweetAlert2: Unknown parameter "' + param + '"');
  12375. }
  12376. }
  12377. // set modal width and margin-left
  12378. modal.style.width = typeof params.width === 'number' ? params.width + 'px' : params.width;
  12379. modal.style.padding = params.padding + 'px';
  12380. modal.style.background = params.background;
  12381. var title = getTitle();
  12382. var content = getContent();
  12383. var confirmButton = getConfirmButton();
  12384. var cancelButton = getCancelButton();
  12385. var closeButton = getCloseButton();
  12386. // Title
  12387. if (params.titleText) {
  12388. title.innerText = params.titleText;
  12389. } else {
  12390. title.innerHTML = params.title.split('\n').join('<br>');
  12391. }
  12392. // Content
  12393. if (params.text || params.html) {
  12394. if (_typeof(params.html) === 'object') {
  12395. content.innerHTML = '';
  12396. if (0 in params.html) {
  12397. for (var i = 0; i in params.html; i++) {
  12398. content.appendChild(params.html[i].cloneNode(true));
  12399. }
  12400. } else {
  12401. content.appendChild(params.html.cloneNode(true));
  12402. }
  12403. } else if (params.html) {
  12404. content.innerHTML = params.html;
  12405. } else if (params.text) {
  12406. content.textContent = params.text;
  12407. }
  12408. show(content);
  12409. } else {
  12410. hide(content);
  12411. }
  12412. // Close button
  12413. if (params.showCloseButton) {
  12414. show(closeButton);
  12415. } else {
  12416. hide(closeButton);
  12417. }
  12418. // Custom Class
  12419. modal.className = swalClasses.modal;
  12420. if (params.customClass) {
  12421. addClass(modal, params.customClass);
  12422. }
  12423. // Progress steps
  12424. var progressStepsContainer = getProgressSteps();
  12425. var currentProgressStep = parseInt(params.currentProgressStep === null ? sweetAlert.getQueueStep() : params.currentProgressStep, 10);
  12426. if (params.progressSteps.length) {
  12427. show(progressStepsContainer);
  12428. empty(progressStepsContainer);
  12429. if (currentProgressStep >= params.progressSteps.length) {
  12430. console.warn('SweetAlert2: Invalid currentProgressStep parameter, it should be less than progressSteps.length ' + '(currentProgressStep like JS arrays starts from 0)');
  12431. }
  12432. params.progressSteps.forEach(function (step, index) {
  12433. var circle = document.createElement('li');
  12434. addClass(circle, swalClasses.progresscircle);
  12435. circle.innerHTML = step;
  12436. if (index === currentProgressStep) {
  12437. addClass(circle, swalClasses.activeprogressstep);
  12438. }
  12439. progressStepsContainer.appendChild(circle);
  12440. if (index !== params.progressSteps.length - 1) {
  12441. var line = document.createElement('li');
  12442. addClass(line, swalClasses.progressline);
  12443. line.style.width = params.progressStepsDistance;
  12444. progressStepsContainer.appendChild(line);
  12445. }
  12446. });
  12447. } else {
  12448. hide(progressStepsContainer);
  12449. }
  12450. // Icon
  12451. var icons = getIcons();
  12452. for (var _i = 0; _i < icons.length; _i++) {
  12453. hide(icons[_i]);
  12454. }
  12455. if (params.type) {
  12456. var validType = false;
  12457. for (var iconType in iconTypes) {
  12458. if (params.type === iconType) {
  12459. validType = true;
  12460. break;
  12461. }
  12462. }
  12463. if (!validType) {
  12464. console.error('SweetAlert2: Unknown alert type: ' + params.type);
  12465. return false;
  12466. }
  12467. var icon = modal.querySelector('.' + swalClasses.icon + '.' + iconTypes[params.type]);
  12468. show(icon);
  12469. // Animate icon
  12470. switch (params.type) {
  12471. case 'success':
  12472. addClass(icon, 'animate');
  12473. addClass(icon.querySelector('.tip'), 'animate-success-tip');
  12474. addClass(icon.querySelector('.long'), 'animate-success-long');
  12475. break;
  12476. case 'error':
  12477. addClass(icon, 'animate-error-icon');
  12478. addClass(icon.querySelector('.x-mark'), 'animate-x-mark');
  12479. break;
  12480. case 'warning':
  12481. addClass(icon, 'pulse-warning');
  12482. break;
  12483. default:
  12484. break;
  12485. }
  12486. }
  12487. // Custom image
  12488. var image = getImage();
  12489. if (params.imageUrl) {
  12490. image.setAttribute('src', params.imageUrl);
  12491. show(image);
  12492. if (params.imageWidth) {
  12493. image.setAttribute('width', params.imageWidth);
  12494. } else {
  12495. image.removeAttribute('width');
  12496. }
  12497. if (params.imageHeight) {
  12498. image.setAttribute('height', params.imageHeight);
  12499. } else {
  12500. image.removeAttribute('height');
  12501. }
  12502. image.className = swalClasses.image;
  12503. if (params.imageClass) {
  12504. addClass(image, params.imageClass);
  12505. }
  12506. } else {
  12507. hide(image);
  12508. }
  12509. // Cancel button
  12510. if (params.showCancelButton) {
  12511. cancelButton.style.display = 'inline-block';
  12512. } else {
  12513. hide(cancelButton);
  12514. }
  12515. // Confirm button
  12516. if (params.showConfirmButton) {
  12517. removeStyleProperty(confirmButton, 'display');
  12518. } else {
  12519. hide(confirmButton);
  12520. }
  12521. // Buttons spacer
  12522. var spacer = getSpacer();
  12523. if (!params.showConfirmButton && !params.showCancelButton) {
  12524. hide(spacer);
  12525. } else {
  12526. show(spacer);
  12527. }
  12528. // Edit text on cancel and confirm buttons
  12529. confirmButton.innerHTML = params.confirmButtonText;
  12530. cancelButton.innerHTML = params.cancelButtonText;
  12531. // Set buttons to selected background colors
  12532. if (params.buttonsStyling) {
  12533. confirmButton.style.backgroundColor = params.confirmButtonColor;
  12534. cancelButton.style.backgroundColor = params.cancelButtonColor;
  12535. }
  12536. // Add buttons custom classes
  12537. confirmButton.className = swalClasses.confirm;
  12538. addClass(confirmButton, params.confirmButtonClass);
  12539. cancelButton.className = swalClasses.cancel;
  12540. addClass(cancelButton, params.cancelButtonClass);
  12541. // Buttons styling
  12542. if (params.buttonsStyling) {
  12543. addClass(confirmButton, swalClasses.styled);
  12544. addClass(cancelButton, swalClasses.styled);
  12545. } else {
  12546. removeClass(confirmButton, swalClasses.styled);
  12547. removeClass(cancelButton, swalClasses.styled);
  12548. confirmButton.style.backgroundColor = confirmButton.style.borderLeftColor = confirmButton.style.borderRightColor = '';
  12549. cancelButton.style.backgroundColor = cancelButton.style.borderLeftColor = cancelButton.style.borderRightColor = '';
  12550. }
  12551. // CSS animation
  12552. if (params.animation === true) {
  12553. removeClass(modal, swalClasses.noanimation);
  12554. } else {
  12555. addClass(modal, swalClasses.noanimation);
  12556. }
  12557. };
  12558. /*
  12559. * Animations
  12560. */
  12561. var openModal = function openModal(animation, onComplete) {
  12562. var container = getContainer();
  12563. var modal = getModal();
  12564. if (animation) {
  12565. addClass(modal, swalClasses.show);
  12566. addClass(container, swalClasses.fade);
  12567. removeClass(modal, swalClasses.hide);
  12568. } else {
  12569. removeClass(modal, swalClasses.fade);
  12570. }
  12571. show(modal);
  12572. // scrolling is 'hidden' until animation is done, after that 'auto'
  12573. container.style.overflowY = 'hidden';
  12574. if (animationEndEvent && !hasClass(modal, swalClasses.noanimation)) {
  12575. modal.addEventListener(animationEndEvent, function swalCloseEventFinished() {
  12576. modal.removeEventListener(animationEndEvent, swalCloseEventFinished);
  12577. container.style.overflowY = 'auto';
  12578. });
  12579. } else {
  12580. container.style.overflowY = 'auto';
  12581. }
  12582. addClass(document.documentElement, swalClasses.shown);
  12583. addClass(document.body, swalClasses.shown);
  12584. addClass(container, swalClasses.shown);
  12585. fixScrollbar();
  12586. iOSfix();
  12587. states.previousActiveElement = document.activeElement;
  12588. if (onComplete !== null && typeof onComplete === 'function') {
  12589. setTimeout(function () {
  12590. onComplete(modal);
  12591. });
  12592. }
  12593. };
  12594. var fixScrollbar = function fixScrollbar() {
  12595. // for queues, do not do this more than once
  12596. if (states.previousBodyPadding !== null) {
  12597. return;
  12598. }
  12599. // if the body has overflow
  12600. if (document.body.scrollHeight > window.innerHeight) {
  12601. // add padding so the content doesn't shift after removal of scrollbar
  12602. states.previousBodyPadding = document.body.style.paddingRight;
  12603. document.body.style.paddingRight = measureScrollbar() + 'px';
  12604. }
  12605. };
  12606. var undoScrollbar = function undoScrollbar() {
  12607. if (states.previousBodyPadding !== null) {
  12608. document.body.style.paddingRight = states.previousBodyPadding;
  12609. states.previousBodyPadding = null;
  12610. }
  12611. };
  12612. // Fix iOS scrolling http://stackoverflow.com/q/39626302/1331425
  12613. var iOSfix = function iOSfix() {
  12614. var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
  12615. if (iOS && !hasClass(document.body, swalClasses.iosfix)) {
  12616. var offset = document.body.scrollTop;
  12617. document.body.style.top = offset * -1 + 'px';
  12618. addClass(document.body, swalClasses.iosfix);
  12619. }
  12620. };
  12621. var undoIOSfix = function undoIOSfix() {
  12622. if (hasClass(document.body, swalClasses.iosfix)) {
  12623. var offset = parseInt(document.body.style.top, 10);
  12624. removeClass(document.body, swalClasses.iosfix);
  12625. document.body.style.top = '';
  12626. document.body.scrollTop = offset * -1;
  12627. }
  12628. };
  12629. // SweetAlert entry point
  12630. var sweetAlert = function sweetAlert() {
  12631. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  12632. args[_key] = arguments[_key];
  12633. }
  12634. if (args[0] === undefined) {
  12635. console.error('SweetAlert2 expects at least 1 attribute!');
  12636. return false;
  12637. }
  12638. var params = _extends({}, modalParams);
  12639. switch (_typeof(args[0])) {
  12640. case 'string':
  12641. params.title = args[0];
  12642. params.html = args[1];
  12643. params.type = args[2];
  12644. break;
  12645. case 'object':
  12646. _extends(params, args[0]);
  12647. params.extraParams = args[0].extraParams;
  12648. if (params.input === 'email' && params.inputValidator === null) {
  12649. params.inputValidator = function (email) {
  12650. return new Promise(function (resolve, reject) {
  12651. var emailRegex = /^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/;
  12652. if (emailRegex.test(email)) {
  12653. resolve();
  12654. } else {
  12655. reject('Invalid email address');
  12656. }
  12657. });
  12658. };
  12659. }
  12660. break;
  12661. default:
  12662. console.error('SweetAlert2: Unexpected type of argument! Expected "string" or "object", got ' + _typeof(args[0]));
  12663. return false;
  12664. }
  12665. setParameters(params);
  12666. var container = getContainer();
  12667. var modal = getModal();
  12668. return new Promise(function (resolve, reject) {
  12669. // Close on timer
  12670. if (params.timer) {
  12671. modal.timeout = setTimeout(function () {
  12672. sweetAlert.closeModal(params.onClose);
  12673. reject('timer');
  12674. }, params.timer);
  12675. }
  12676. // Get input element by specified type or, if type isn't specified, by params.input
  12677. var getInput = function getInput(inputType) {
  12678. inputType = inputType || params.input;
  12679. if (!inputType) {
  12680. return null;
  12681. }
  12682. switch (inputType) {
  12683. case 'select':
  12684. case 'textarea':
  12685. case 'file':
  12686. return getChildByClass(modal, swalClasses[inputType]);
  12687. case 'checkbox':
  12688. return modal.querySelector('.' + swalClasses.checkbox + ' input');
  12689. case 'radio':
  12690. return modal.querySelector('.' + swalClasses.radio + ' input:checked') || modal.querySelector('.' + swalClasses.radio + ' input:first-child');
  12691. case 'range':
  12692. return modal.querySelector('.' + swalClasses.range + ' input');
  12693. default:
  12694. return getChildByClass(modal, swalClasses.input);
  12695. }
  12696. };
  12697. // Get the value of the modal input
  12698. var getInputValue = function getInputValue() {
  12699. var input = getInput();
  12700. if (!input) {
  12701. return null;
  12702. }
  12703. switch (params.input) {
  12704. case 'checkbox':
  12705. return input.checked ? 1 : 0;
  12706. case 'radio':
  12707. return input.checked ? input.value : null;
  12708. case 'file':
  12709. return input.files.length ? input.files[0] : null;
  12710. default:
  12711. return params.inputAutoTrim ? input.value.trim() : input.value;
  12712. }
  12713. };
  12714. // input autofocus
  12715. if (params.input) {
  12716. setTimeout(function () {
  12717. var input = getInput();
  12718. if (input) {
  12719. focusInput(input);
  12720. }
  12721. }, 0);
  12722. }
  12723. var confirm = function confirm(value) {
  12724. if (params.showLoaderOnConfirm) {
  12725. sweetAlert.showLoading();
  12726. }
  12727. if (params.preConfirm) {
  12728. params.preConfirm(value, params.extraParams).then(function (preConfirmValue) {
  12729. sweetAlert.closeModal(params.onClose);
  12730. resolve(preConfirmValue || value);
  12731. }, function (error) {
  12732. sweetAlert.hideLoading();
  12733. if (error) {
  12734. sweetAlert.showValidationError(error);
  12735. }
  12736. });
  12737. } else {
  12738. sweetAlert.closeModal(params.onClose);
  12739. resolve(value);
  12740. }
  12741. };
  12742. // Mouse interactions
  12743. var onButtonEvent = function onButtonEvent(event) {
  12744. var e = event || window.event;
  12745. var target = e.target || e.srcElement;
  12746. var confirmButton = getConfirmButton();
  12747. var cancelButton = getCancelButton();
  12748. var targetedConfirm = confirmButton === target || confirmButton.contains(target);
  12749. var targetedCancel = cancelButton === target || cancelButton.contains(target);
  12750. switch (e.type) {
  12751. case 'mouseover':
  12752. case 'mouseup':
  12753. if (params.buttonsStyling) {
  12754. if (targetedConfirm) {
  12755. confirmButton.style.backgroundColor = colorLuminance(params.confirmButtonColor, -0.1);
  12756. } else if (targetedCancel) {
  12757. cancelButton.style.backgroundColor = colorLuminance(params.cancelButtonColor, -0.1);
  12758. }
  12759. }
  12760. break;
  12761. case 'mouseout':
  12762. if (params.buttonsStyling) {
  12763. if (targetedConfirm) {
  12764. confirmButton.style.backgroundColor = params.confirmButtonColor;
  12765. } else if (targetedCancel) {
  12766. cancelButton.style.backgroundColor = params.cancelButtonColor;
  12767. }
  12768. }
  12769. break;
  12770. case 'mousedown':
  12771. if (params.buttonsStyling) {
  12772. if (targetedConfirm) {
  12773. confirmButton.style.backgroundColor = colorLuminance(params.confirmButtonColor, -0.2);
  12774. } else if (targetedCancel) {
  12775. cancelButton.style.backgroundColor = colorLuminance(params.cancelButtonColor, -0.2);
  12776. }
  12777. }
  12778. break;
  12779. case 'click':
  12780. // Clicked 'confirm'
  12781. if (targetedConfirm && sweetAlert.isVisible()) {
  12782. sweetAlert.disableButtons();
  12783. if (params.input) {
  12784. (function () {
  12785. var inputValue = getInputValue();
  12786. if (params.inputValidator) {
  12787. sweetAlert.disableInput();
  12788. params.inputValidator(inputValue, params.extraParams).then(function () {
  12789. sweetAlert.enableButtons();
  12790. sweetAlert.enableInput();
  12791. confirm(inputValue);
  12792. }, function (error) {
  12793. sweetAlert.enableButtons();
  12794. sweetAlert.enableInput();
  12795. if (error) {
  12796. sweetAlert.showValidationError(error);
  12797. }
  12798. });
  12799. } else {
  12800. confirm(inputValue);
  12801. }
  12802. })();
  12803. } else {
  12804. confirm(true);
  12805. }
  12806. // Clicked 'cancel'
  12807. } else if (targetedCancel && sweetAlert.isVisible()) {
  12808. sweetAlert.disableButtons();
  12809. sweetAlert.closeModal(params.onClose);
  12810. reject('cancel');
  12811. }
  12812. break;
  12813. default:
  12814. }
  12815. };
  12816. var buttons = modal.querySelectorAll('button');
  12817. for (var i = 0; i < buttons.length; i++) {
  12818. buttons[i].onclick = onButtonEvent;
  12819. buttons[i].onmouseover = onButtonEvent;
  12820. buttons[i].onmouseout = onButtonEvent;
  12821. buttons[i].onmousedown = onButtonEvent;
  12822. }
  12823. // Closing modal by close button
  12824. getCloseButton().onclick = function () {
  12825. sweetAlert.closeModal(params.onClose);
  12826. reject('close');
  12827. };
  12828. // Closing modal by overlay click
  12829. container.onclick = function (e) {
  12830. if (e.target !== container) {
  12831. return;
  12832. }
  12833. if (params.allowOutsideClick) {
  12834. sweetAlert.closeModal(params.onClose);
  12835. reject('overlay');
  12836. }
  12837. };
  12838. var confirmButton = getConfirmButton();
  12839. var cancelButton = getCancelButton();
  12840. // Reverse buttons (Confirm on the right side)
  12841. if (params.reverseButtons) {
  12842. confirmButton.parentNode.insertBefore(cancelButton, confirmButton);
  12843. } else {
  12844. confirmButton.parentNode.insertBefore(confirmButton, cancelButton);
  12845. }
  12846. // Focus handling
  12847. var setFocus = function setFocus(index, increment) {
  12848. var focusableElements = getFocusableElements(params.focusCancel);
  12849. // search for visible elements and select the next possible match
  12850. for (var _i2 = 0; _i2 < focusableElements.length; _i2++) {
  12851. index = index + increment;
  12852. // rollover to first item
  12853. if (index === focusableElements.length) {
  12854. index = 0;
  12855. // go to last item
  12856. } else if (index === -1) {
  12857. index = focusableElements.length - 1;
  12858. }
  12859. // determine if element is visible
  12860. var el = focusableElements[index];
  12861. if (isVisible(el)) {
  12862. return el.focus();
  12863. }
  12864. }
  12865. };
  12866. var handleKeyDown = function handleKeyDown(event) {
  12867. var e = event || window.event;
  12868. var keyCode = e.keyCode || e.which;
  12869. if ([9, 13, 32, 27].indexOf(keyCode) === -1) {
  12870. // Don't do work on keys we don't care about.
  12871. return;
  12872. }
  12873. var targetElement = e.target || e.srcElement;
  12874. var focusableElements = getFocusableElements(params.focusCancel);
  12875. var btnIndex = -1; // Find the button - note, this is a nodelist, not an array.
  12876. for (var _i3 = 0; _i3 < focusableElements.length; _i3++) {
  12877. if (targetElement === focusableElements[_i3]) {
  12878. btnIndex = _i3;
  12879. break;
  12880. }
  12881. }
  12882. // TAB
  12883. if (keyCode === 9) {
  12884. if (!e.shiftKey) {
  12885. // Cycle to the next button
  12886. setFocus(btnIndex, 1);
  12887. } else {
  12888. // Cycle to the prev button
  12889. setFocus(btnIndex, -1);
  12890. }
  12891. e.stopPropagation();
  12892. e.preventDefault();
  12893. // ENTER/SPACE
  12894. } else if (keyCode === 13 || keyCode === 32) {
  12895. if (btnIndex === -1 && params.allowEnterKey) {
  12896. // ENTER/SPACE clicked outside of a button.
  12897. if (params.focusCancel) {
  12898. fireClick(cancelButton, e);
  12899. } else {
  12900. fireClick(confirmButton, e);
  12901. }
  12902. }
  12903. // ESC
  12904. } else if (keyCode === 27 && params.allowEscapeKey === true) {
  12905. sweetAlert.closeModal(params.onClose);
  12906. reject('esc');
  12907. }
  12908. };
  12909. states.previousWindowKeyDown = window.onkeydown;
  12910. window.onkeydown = handleKeyDown;
  12911. // Loading state
  12912. if (params.buttonsStyling) {
  12913. confirmButton.style.borderLeftColor = params.confirmButtonColor;
  12914. confirmButton.style.borderRightColor = params.confirmButtonColor;
  12915. }
  12916. /**
  12917. * Show spinner instead of Confirm button and disable Cancel button
  12918. */
  12919. sweetAlert.showLoading = sweetAlert.enableLoading = function () {
  12920. show(getSpacer());
  12921. show(confirmButton, 'inline-block');
  12922. addClass(confirmButton, swalClasses.loading);
  12923. addClass(modal, swalClasses.loading);
  12924. confirmButton.disabled = true;
  12925. cancelButton.disabled = true;
  12926. };
  12927. /**
  12928. * Show spinner instead of Confirm button and disable Cancel button
  12929. */
  12930. sweetAlert.hideLoading = sweetAlert.disableLoading = function () {
  12931. if (!params.showConfirmButton) {
  12932. hide(confirmButton);
  12933. if (!params.showCancelButton) {
  12934. hide(getSpacer());
  12935. }
  12936. }
  12937. removeClass(confirmButton, swalClasses.loading);
  12938. removeClass(modal, swalClasses.loading);
  12939. confirmButton.disabled = false;
  12940. cancelButton.disabled = false;
  12941. };
  12942. sweetAlert.getTitle = function () {
  12943. return getTitle();
  12944. };
  12945. sweetAlert.getContent = function () {
  12946. return getContent();
  12947. };
  12948. sweetAlert.getInput = function () {
  12949. return getInput();
  12950. };
  12951. sweetAlert.getImage = function () {
  12952. return getImage();
  12953. };
  12954. sweetAlert.getConfirmButton = function () {
  12955. return getConfirmButton();
  12956. };
  12957. sweetAlert.getCancelButton = function () {
  12958. return getCancelButton();
  12959. };
  12960. sweetAlert.enableButtons = function () {
  12961. confirmButton.disabled = false;
  12962. cancelButton.disabled = false;
  12963. };
  12964. sweetAlert.disableButtons = function () {
  12965. confirmButton.disabled = true;
  12966. cancelButton.disabled = true;
  12967. };
  12968. sweetAlert.enableConfirmButton = function () {
  12969. confirmButton.disabled = false;
  12970. };
  12971. sweetAlert.disableConfirmButton = function () {
  12972. confirmButton.disabled = true;
  12973. };
  12974. sweetAlert.enableInput = function () {
  12975. var input = getInput();
  12976. if (!input) {
  12977. return false;
  12978. }
  12979. if (input.type === 'radio') {
  12980. var radiosContainer = input.parentNode.parentNode;
  12981. var radios = radiosContainer.querySelectorAll('input');
  12982. for (var _i4 = 0; _i4 < radios.length; _i4++) {
  12983. radios[_i4].disabled = false;
  12984. }
  12985. } else {
  12986. input.disabled = false;
  12987. }
  12988. };
  12989. sweetAlert.disableInput = function () {
  12990. var input = getInput();
  12991. if (!input) {
  12992. return false;
  12993. }
  12994. if (input && input.type === 'radio') {
  12995. var radiosContainer = input.parentNode.parentNode;
  12996. var radios = radiosContainer.querySelectorAll('input');
  12997. for (var _i5 = 0; _i5 < radios.length; _i5++) {
  12998. radios[_i5].disabled = true;
  12999. }
  13000. } else {
  13001. input.disabled = true;
  13002. }
  13003. };
  13004. // Set modal min-height to disable scrolling inside the modal
  13005. sweetAlert.recalculateHeight = debounce(function () {
  13006. var modal = getModal();
  13007. if (!modal) {
  13008. return;
  13009. }
  13010. var prevState = modal.style.display;
  13011. modal.style.minHeight = '';
  13012. show(modal);
  13013. modal.style.minHeight = modal.scrollHeight + 1 + 'px';
  13014. modal.style.display = prevState;
  13015. }, 50);
  13016. // Show block with validation error
  13017. sweetAlert.showValidationError = function (error) {
  13018. var validationError = getValidationError();
  13019. validationError.innerHTML = error;
  13020. show(validationError);
  13021. var input = getInput();
  13022. if (input) {
  13023. focusInput(input);
  13024. addClass(input, swalClasses.inputerror);
  13025. }
  13026. };
  13027. // Hide block with validation error
  13028. sweetAlert.resetValidationError = function () {
  13029. var validationError = getValidationError();
  13030. hide(validationError);
  13031. sweetAlert.recalculateHeight();
  13032. var input = getInput();
  13033. if (input) {
  13034. removeClass(input, swalClasses.inputerror);
  13035. }
  13036. };
  13037. sweetAlert.getProgressSteps = function () {
  13038. return params.progressSteps;
  13039. };
  13040. sweetAlert.setProgressSteps = function (progressSteps) {
  13041. params.progressSteps = progressSteps;
  13042. setParameters(params);
  13043. };
  13044. sweetAlert.showProgressSteps = function () {
  13045. show(getProgressSteps());
  13046. };
  13047. sweetAlert.hideProgressSteps = function () {
  13048. hide(getProgressSteps());
  13049. };
  13050. sweetAlert.enableButtons();
  13051. sweetAlert.hideLoading();
  13052. sweetAlert.resetValidationError();
  13053. // inputs
  13054. var inputTypes = ['input', 'file', 'range', 'select', 'radio', 'checkbox', 'textarea'];
  13055. var input = void 0;
  13056. for (var _i6 = 0; _i6 < inputTypes.length; _i6++) {
  13057. var inputClass = swalClasses[inputTypes[_i6]];
  13058. var inputContainer = getChildByClass(modal, inputClass);
  13059. input = getInput(inputTypes[_i6]);
  13060. // set attributes
  13061. if (input) {
  13062. for (var j in input.attributes) {
  13063. if (input.attributes.hasOwnProperty(j)) {
  13064. var attrName = input.attributes[j].name;
  13065. if (attrName !== 'type' && attrName !== 'value') {
  13066. input.removeAttribute(attrName);
  13067. }
  13068. }
  13069. }
  13070. for (var attr in params.inputAttributes) {
  13071. input.setAttribute(attr, params.inputAttributes[attr]);
  13072. }
  13073. }
  13074. // set class
  13075. inputContainer.className = inputClass;
  13076. if (params.inputClass) {
  13077. addClass(inputContainer, params.inputClass);
  13078. }
  13079. hide(inputContainer);
  13080. }
  13081. var populateInputOptions = void 0;
  13082. (function () {
  13083. switch (params.input) {
  13084. case 'text':
  13085. case 'email':
  13086. case 'password':
  13087. case 'number':
  13088. case 'tel':
  13089. input = getChildByClass(modal, swalClasses.input);
  13090. input.value = params.inputValue;
  13091. input.placeholder = params.inputPlaceholder;
  13092. input.type = params.input;
  13093. show(input);
  13094. break;
  13095. case 'file':
  13096. input = getChildByClass(modal, swalClasses.file);
  13097. input.placeholder = params.inputPlaceholder;
  13098. input.type = params.input;
  13099. show(input);
  13100. break;
  13101. case 'range':
  13102. var range = getChildByClass(modal, swalClasses.range);
  13103. var rangeInput = range.querySelector('input');
  13104. var rangeOutput = range.querySelector('output');
  13105. rangeInput.value = params.inputValue;
  13106. rangeInput.type = params.input;
  13107. rangeOutput.value = params.inputValue;
  13108. show(range);
  13109. break;
  13110. case 'select':
  13111. var select = getChildByClass(modal, swalClasses.select);
  13112. select.innerHTML = '';
  13113. if (params.inputPlaceholder) {
  13114. var placeholder = document.createElement('option');
  13115. placeholder.innerHTML = params.inputPlaceholder;
  13116. placeholder.value = '';
  13117. placeholder.disabled = true;
  13118. placeholder.selected = true;
  13119. select.appendChild(placeholder);
  13120. }
  13121. populateInputOptions = function populateInputOptions(inputOptions) {
  13122. for (var optionValue in inputOptions) {
  13123. var option = document.createElement('option');
  13124. option.value = optionValue;
  13125. option.innerHTML = inputOptions[optionValue];
  13126. if (params.inputValue === optionValue) {
  13127. option.selected = true;
  13128. }
  13129. select.appendChild(option);
  13130. }
  13131. show(select);
  13132. select.focus();
  13133. };
  13134. break;
  13135. case 'radio':
  13136. var radio = getChildByClass(modal, swalClasses.radio);
  13137. radio.innerHTML = '';
  13138. populateInputOptions = function populateInputOptions(inputOptions) {
  13139. for (var radioValue in inputOptions) {
  13140. var radioInput = document.createElement('input');
  13141. var radioLabel = document.createElement('label');
  13142. var radioLabelSpan = document.createElement('span');
  13143. radioInput.type = 'radio';
  13144. radioInput.name = swalClasses.radio;
  13145. radioInput.value = radioValue;
  13146. if (params.inputValue === radioValue) {
  13147. radioInput.checked = true;
  13148. }
  13149. radioLabelSpan.innerHTML = inputOptions[radioValue];
  13150. radioLabel.appendChild(radioInput);
  13151. radioLabel.appendChild(radioLabelSpan);
  13152. radioLabel.for = radioInput.id;
  13153. radio.appendChild(radioLabel);
  13154. }
  13155. show(radio);
  13156. var radios = radio.querySelectorAll('input');
  13157. if (radios.length) {
  13158. radios[0].focus();
  13159. }
  13160. };
  13161. break;
  13162. case 'checkbox':
  13163. var checkbox = getChildByClass(modal, swalClasses.checkbox);
  13164. var checkboxInput = getInput('checkbox');
  13165. checkboxInput.type = 'checkbox';
  13166. checkboxInput.value = 1;
  13167. checkboxInput.id = swalClasses.checkbox;
  13168. checkboxInput.checked = Boolean(params.inputValue);
  13169. var label = checkbox.getElementsByTagName('span');
  13170. if (label.length) {
  13171. checkbox.removeChild(label[0]);
  13172. }
  13173. label = document.createElement('span');
  13174. label.innerHTML = params.inputPlaceholder;
  13175. checkbox.appendChild(label);
  13176. show(checkbox);
  13177. break;
  13178. case 'textarea':
  13179. var textarea = getChildByClass(modal, swalClasses.textarea);
  13180. textarea.value = params.inputValue;
  13181. textarea.placeholder = params.inputPlaceholder;
  13182. show(textarea);
  13183. break;
  13184. case null:
  13185. break;
  13186. default:
  13187. console.error('SweetAlert2: Unexpected type of input! Expected "text", "email", "password", "select", "checkbox", "textarea" or "file", got "' + params.input + '"');
  13188. break;
  13189. }
  13190. })();
  13191. if (params.input === 'select' || params.input === 'radio') {
  13192. if (params.inputOptions instanceof Promise) {
  13193. sweetAlert.showLoading();
  13194. params.inputOptions.then(function (inputOptions) {
  13195. sweetAlert.hideLoading();
  13196. populateInputOptions(inputOptions);
  13197. });
  13198. } else if (_typeof(params.inputOptions) === 'object') {
  13199. populateInputOptions(params.inputOptions);
  13200. } else {
  13201. console.error('SweetAlert2: Unexpected type of inputOptions! Expected object or Promise, got ' + _typeof(params.inputOptions));
  13202. }
  13203. }
  13204. openModal(params.animation, params.onOpen);
  13205. // Focus the first element (input or button)
  13206. if (params.allowEnterKey) {
  13207. setFocus(-1, 1);
  13208. } else {
  13209. if (document.activeElement) {
  13210. document.activeElement.blur();
  13211. }
  13212. }
  13213. // fix scroll
  13214. getContainer().scrollTop = 0;
  13215. // Observe changes inside the modal and adjust height
  13216. if (typeof MutationObserver !== 'undefined' && !swal2Observer) {
  13217. swal2Observer = new MutationObserver(sweetAlert.recalculateHeight);
  13218. swal2Observer.observe(modal, { childList: true, characterData: true, subtree: true });
  13219. }
  13220. });
  13221. };
  13222. /*
  13223. * Global function to determine if swal2 modal is shown
  13224. */
  13225. sweetAlert.isVisible = function () {
  13226. return !!getModal();
  13227. };
  13228. /*
  13229. * Global function for chaining sweetAlert modals
  13230. */
  13231. sweetAlert.queue = function (steps) {
  13232. queue = steps;
  13233. var resetQueue = function resetQueue() {
  13234. queue = [];
  13235. document.body.removeAttribute('data-swal2-queue-step');
  13236. };
  13237. var queueResult = [];
  13238. return new Promise(function (resolve, reject) {
  13239. (function step(i, callback) {
  13240. if (i < queue.length) {
  13241. document.body.setAttribute('data-swal2-queue-step', i);
  13242. sweetAlert(queue[i]).then(function (result) {
  13243. queueResult.push(result);
  13244. step(i + 1, callback);
  13245. }, function (dismiss) {
  13246. resetQueue();
  13247. reject(dismiss);
  13248. });
  13249. } else {
  13250. resetQueue();
  13251. resolve(queueResult);
  13252. }
  13253. })(0);
  13254. });
  13255. };
  13256. /*
  13257. * Global function for getting the index of current modal in queue
  13258. */
  13259. sweetAlert.getQueueStep = function () {
  13260. return document.body.getAttribute('data-swal2-queue-step');
  13261. };
  13262. /*
  13263. * Global function for inserting a modal to the queue
  13264. */
  13265. sweetAlert.insertQueueStep = function (step, index) {
  13266. if (index && index < queue.length) {
  13267. return queue.splice(index, 0, step);
  13268. }
  13269. return queue.push(step);
  13270. };
  13271. /*
  13272. * Global function for deleting a modal from the queue
  13273. */
  13274. sweetAlert.deleteQueueStep = function (index) {
  13275. if (typeof queue[index] !== 'undefined') {
  13276. queue.splice(index, 1);
  13277. }
  13278. };
  13279. /*
  13280. * Global function to close sweetAlert
  13281. */
  13282. sweetAlert.close = sweetAlert.closeModal = function (onComplete) {
  13283. var container = getContainer();
  13284. var modal = getModal();
  13285. if (!modal) {
  13286. return;
  13287. }
  13288. removeClass(modal, swalClasses.show);
  13289. addClass(modal, swalClasses.hide);
  13290. clearTimeout(modal.timeout);
  13291. resetPrevState();
  13292. var removeModalAndResetState = function removeModalAndResetState() {
  13293. container.parentNode.removeChild(container);
  13294. removeClass(document.documentElement, swalClasses.shown);
  13295. removeClass(document.body, swalClasses.shown);
  13296. undoScrollbar();
  13297. undoIOSfix();
  13298. };
  13299. // If animation is supported, animate
  13300. if (animationEndEvent && !hasClass(modal, swalClasses.noanimation)) {
  13301. modal.addEventListener(animationEndEvent, function swalCloseEventFinished() {
  13302. modal.removeEventListener(animationEndEvent, swalCloseEventFinished);
  13303. if (hasClass(modal, swalClasses.hide)) {
  13304. removeModalAndResetState();
  13305. }
  13306. });
  13307. } else {
  13308. // Otherwise, remove immediately
  13309. removeModalAndResetState();
  13310. }
  13311. if (onComplete !== null && typeof onComplete === 'function') {
  13312. setTimeout(function () {
  13313. onComplete(modal);
  13314. });
  13315. }
  13316. };
  13317. /*
  13318. * Global function to click 'Confirm' button
  13319. */
  13320. sweetAlert.clickConfirm = function () {
  13321. return getConfirmButton().click();
  13322. };
  13323. /*
  13324. * Global function to click 'Cancel' button
  13325. */
  13326. sweetAlert.clickCancel = function () {
  13327. return getCancelButton().click();
  13328. };
  13329. /**
  13330. * Set default params for each popup
  13331. * @param {Object} userParams
  13332. */
  13333. sweetAlert.setDefaults = function (userParams) {
  13334. if (!userParams || (typeof userParams === 'undefined' ? 'undefined' : _typeof(userParams)) !== 'object') {
  13335. return console.error('SweetAlert2: the argument for setDefaults() is required and has to be a object');
  13336. }
  13337. for (var param in userParams) {
  13338. if (!defaultParams.hasOwnProperty(param) && param !== 'extraParams') {
  13339. console.warn('SweetAlert2: Unknown parameter "' + param + '"');
  13340. delete userParams[param];
  13341. }
  13342. }
  13343. _extends(modalParams, userParams);
  13344. };
  13345. /**
  13346. * Reset default params for each popup
  13347. */
  13348. sweetAlert.resetDefaults = function () {
  13349. modalParams = _extends({}, defaultParams);
  13350. };
  13351. sweetAlert.noop = function () {};
  13352. sweetAlert.version = '6.4.2';
  13353. sweetAlert.default = sweetAlert;
  13354. return sweetAlert;
  13355. })));
  13356. if (window.Sweetalert2) window.sweetAlert = window.swal = window.Sweetalert2;
  13357. /***/ }),
  13358. /* 4 */
  13359. /***/ (function(module, exports, __webpack_require__) {
  13360. //! moment.js locale configuration
  13361. //! locale : Afrikaans [af]
  13362. //! author : Werner Mollentze : https://github.com/wernerm
  13363. ;(function (global, factory) {
  13364. true ? factory(__webpack_require__(0)) :
  13365. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  13366. factory(global.moment)
  13367. }(this, (function (moment) { 'use strict';
  13368. var af = moment.defineLocale('af', {
  13369. months : 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split('_'),
  13370. monthsShort : 'Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),
  13371. weekdays : 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split('_'),
  13372. weekdaysShort : 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),
  13373. weekdaysMin : 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),
  13374. meridiemParse: /vm|nm/i,
  13375. isPM : function (input) {
  13376. return /^nm$/i.test(input);
  13377. },
  13378. meridiem : function (hours, minutes, isLower) {
  13379. if (hours < 12) {
  13380. return isLower ? 'vm' : 'VM';
  13381. } else {
  13382. return isLower ? 'nm' : 'NM';
  13383. }
  13384. },
  13385. longDateFormat : {
  13386. LT : 'HH:mm',
  13387. LTS : 'HH:mm:ss',
  13388. L : 'DD/MM/YYYY',
  13389. LL : 'D MMMM YYYY',
  13390. LLL : 'D MMMM YYYY HH:mm',
  13391. LLLL : 'dddd, D MMMM YYYY HH:mm'
  13392. },
  13393. calendar : {
  13394. sameDay : '[Vandag om] LT',
  13395. nextDay : '[Môre om] LT',
  13396. nextWeek : 'dddd [om] LT',
  13397. lastDay : '[Gister om] LT',
  13398. lastWeek : '[Laas] dddd [om] LT',
  13399. sameElse : 'L'
  13400. },
  13401. relativeTime : {
  13402. future : 'oor %s',
  13403. past : '%s gelede',
  13404. s : '\'n paar sekondes',
  13405. m : '\'n minuut',
  13406. mm : '%d minute',
  13407. h : '\'n uur',
  13408. hh : '%d ure',
  13409. d : '\'n dag',
  13410. dd : '%d dae',
  13411. M : '\'n maand',
  13412. MM : '%d maande',
  13413. y : '\'n jaar',
  13414. yy : '%d jaar'
  13415. },
  13416. ordinalParse: /\d{1,2}(ste|de)/,
  13417. ordinal : function (number) {
  13418. return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); // Thanks to Joris Röling : https://github.com/jjupiter
  13419. },
  13420. week : {
  13421. dow : 1, // Maandag is die eerste dag van die week.
  13422. doy : 4 // Die week wat die 4de Januarie bevat is die eerste week van die jaar.
  13423. }
  13424. });
  13425. return af;
  13426. })));
  13427. /***/ }),
  13428. /* 5 */
  13429. /***/ (function(module, exports, __webpack_require__) {
  13430. //! moment.js locale configuration
  13431. //! locale : Arabic (Algeria) [ar-dz]
  13432. //! author : Noureddine LOUAHEDJ : https://github.com/noureddineme
  13433. ;(function (global, factory) {
  13434. true ? factory(__webpack_require__(0)) :
  13435. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  13436. factory(global.moment)
  13437. }(this, (function (moment) { 'use strict';
  13438. var arDz = moment.defineLocale('ar-dz', {
  13439. months : 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
  13440. monthsShort : 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
  13441. weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  13442. weekdaysShort : 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
  13443. weekdaysMin : 'أح_إث_ثلا_أر_خم_جم_سب'.split('_'),
  13444. weekdaysParseExact : true,
  13445. longDateFormat : {
  13446. LT : 'HH:mm',
  13447. LTS : 'HH:mm:ss',
  13448. L : 'DD/MM/YYYY',
  13449. LL : 'D MMMM YYYY',
  13450. LLL : 'D MMMM YYYY HH:mm',
  13451. LLLL : 'dddd D MMMM YYYY HH:mm'
  13452. },
  13453. calendar : {
  13454. sameDay: '[اليوم على الساعة] LT',
  13455. nextDay: '[غدا على الساعة] LT',
  13456. nextWeek: 'dddd [على الساعة] LT',
  13457. lastDay: '[أمس على الساعة] LT',
  13458. lastWeek: 'dddd [على الساعة] LT',
  13459. sameElse: 'L'
  13460. },
  13461. relativeTime : {
  13462. future : 'في %s',
  13463. past : 'منذ %s',
  13464. s : 'ثوان',
  13465. m : 'دقيقة',
  13466. mm : '%d دقائق',
  13467. h : 'ساعة',
  13468. hh : '%d ساعات',
  13469. d : 'يوم',
  13470. dd : '%d أيام',
  13471. M : 'شهر',
  13472. MM : '%d أشهر',
  13473. y : 'سنة',
  13474. yy : '%d سنوات'
  13475. },
  13476. week : {
  13477. dow : 0, // Sunday is the first day of the week.
  13478. doy : 4 // The week that contains Jan 1st is the first week of the year.
  13479. }
  13480. });
  13481. return arDz;
  13482. })));
  13483. /***/ }),
  13484. /* 6 */
  13485. /***/ (function(module, exports, __webpack_require__) {
  13486. //! moment.js locale configuration
  13487. //! locale : Arabic (Lybia) [ar-ly]
  13488. //! author : Ali Hmer: https://github.com/kikoanis
  13489. ;(function (global, factory) {
  13490. true ? factory(__webpack_require__(0)) :
  13491. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  13492. factory(global.moment)
  13493. }(this, (function (moment) { 'use strict';
  13494. var symbolMap = {
  13495. '1': '1',
  13496. '2': '2',
  13497. '3': '3',
  13498. '4': '4',
  13499. '5': '5',
  13500. '6': '6',
  13501. '7': '7',
  13502. '8': '8',
  13503. '9': '9',
  13504. '0': '0'
  13505. };
  13506. var pluralForm = function (n) {
  13507. return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5;
  13508. };
  13509. var plurals = {
  13510. s : ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'],
  13511. m : ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'],
  13512. h : ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'],
  13513. d : ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'],
  13514. M : ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'],
  13515. y : ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام']
  13516. };
  13517. var pluralize = function (u) {
  13518. return function (number, withoutSuffix, string, isFuture) {
  13519. var f = pluralForm(number),
  13520. str = plurals[u][pluralForm(number)];
  13521. if (f === 2) {
  13522. str = str[withoutSuffix ? 0 : 1];
  13523. }
  13524. return str.replace(/%d/i, number);
  13525. };
  13526. };
  13527. var months = [
  13528. 'يناير',
  13529. 'فبراير',
  13530. 'مارس',
  13531. 'أبريل',
  13532. 'مايو',
  13533. 'يونيو',
  13534. 'يوليو',
  13535. 'أغسطس',
  13536. 'سبتمبر',
  13537. 'أكتوبر',
  13538. 'نوفمبر',
  13539. 'ديسمبر'
  13540. ];
  13541. var arLy = moment.defineLocale('ar-ly', {
  13542. months : months,
  13543. monthsShort : months,
  13544. weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  13545. weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  13546. weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  13547. weekdaysParseExact : true,
  13548. longDateFormat : {
  13549. LT : 'HH:mm',
  13550. LTS : 'HH:mm:ss',
  13551. L : 'D/\u200FM/\u200FYYYY',
  13552. LL : 'D MMMM YYYY',
  13553. LLL : 'D MMMM YYYY HH:mm',
  13554. LLLL : 'dddd D MMMM YYYY HH:mm'
  13555. },
  13556. meridiemParse: /ص|م/,
  13557. isPM : function (input) {
  13558. return 'م' === input;
  13559. },
  13560. meridiem : function (hour, minute, isLower) {
  13561. if (hour < 12) {
  13562. return 'ص';
  13563. } else {
  13564. return 'م';
  13565. }
  13566. },
  13567. calendar : {
  13568. sameDay: '[اليوم عند الساعة] LT',
  13569. nextDay: '[غدًا عند الساعة] LT',
  13570. nextWeek: 'dddd [عند الساعة] LT',
  13571. lastDay: '[أمس عند الساعة] LT',
  13572. lastWeek: 'dddd [عند الساعة] LT',
  13573. sameElse: 'L'
  13574. },
  13575. relativeTime : {
  13576. future : 'بعد %s',
  13577. past : 'منذ %s',
  13578. s : pluralize('s'),
  13579. m : pluralize('m'),
  13580. mm : pluralize('m'),
  13581. h : pluralize('h'),
  13582. hh : pluralize('h'),
  13583. d : pluralize('d'),
  13584. dd : pluralize('d'),
  13585. M : pluralize('M'),
  13586. MM : pluralize('M'),
  13587. y : pluralize('y'),
  13588. yy : pluralize('y')
  13589. },
  13590. preparse: function (string) {
  13591. return string.replace(/\u200f/g, '').replace(/،/g, ',');
  13592. },
  13593. postformat: function (string) {
  13594. return string.replace(/\d/g, function (match) {
  13595. return symbolMap[match];
  13596. }).replace(/,/g, '،');
  13597. },
  13598. week : {
  13599. dow : 6, // Saturday is the first day of the week.
  13600. doy : 12 // The week that contains Jan 1st is the first week of the year.
  13601. }
  13602. });
  13603. return arLy;
  13604. })));
  13605. /***/ }),
  13606. /* 7 */
  13607. /***/ (function(module, exports, __webpack_require__) {
  13608. //! moment.js locale configuration
  13609. //! locale : Arabic (Morocco) [ar-ma]
  13610. //! author : ElFadili Yassine : https://github.com/ElFadiliY
  13611. //! author : Abdel Said : https://github.com/abdelsaid
  13612. ;(function (global, factory) {
  13613. true ? factory(__webpack_require__(0)) :
  13614. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  13615. factory(global.moment)
  13616. }(this, (function (moment) { 'use strict';
  13617. var arMa = moment.defineLocale('ar-ma', {
  13618. months : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
  13619. monthsShort : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
  13620. weekdays : 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  13621. weekdaysShort : 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
  13622. weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  13623. weekdaysParseExact : true,
  13624. longDateFormat : {
  13625. LT : 'HH:mm',
  13626. LTS : 'HH:mm:ss',
  13627. L : 'DD/MM/YYYY',
  13628. LL : 'D MMMM YYYY',
  13629. LLL : 'D MMMM YYYY HH:mm',
  13630. LLLL : 'dddd D MMMM YYYY HH:mm'
  13631. },
  13632. calendar : {
  13633. sameDay: '[اليوم على الساعة] LT',
  13634. nextDay: '[غدا على الساعة] LT',
  13635. nextWeek: 'dddd [على الساعة] LT',
  13636. lastDay: '[أمس على الساعة] LT',
  13637. lastWeek: 'dddd [على الساعة] LT',
  13638. sameElse: 'L'
  13639. },
  13640. relativeTime : {
  13641. future : 'في %s',
  13642. past : 'منذ %s',
  13643. s : 'ثوان',
  13644. m : 'دقيقة',
  13645. mm : '%d دقائق',
  13646. h : 'ساعة',
  13647. hh : '%d ساعات',
  13648. d : 'يوم',
  13649. dd : '%d أيام',
  13650. M : 'شهر',
  13651. MM : '%d أشهر',
  13652. y : 'سنة',
  13653. yy : '%d سنوات'
  13654. },
  13655. week : {
  13656. dow : 6, // Saturday is the first day of the week.
  13657. doy : 12 // The week that contains Jan 1st is the first week of the year.
  13658. }
  13659. });
  13660. return arMa;
  13661. })));
  13662. /***/ }),
  13663. /* 8 */
  13664. /***/ (function(module, exports, __webpack_require__) {
  13665. //! moment.js locale configuration
  13666. //! locale : Arabic (Saudi Arabia) [ar-sa]
  13667. //! author : Suhail Alkowaileet : https://github.com/xsoh
  13668. ;(function (global, factory) {
  13669. true ? factory(__webpack_require__(0)) :
  13670. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  13671. factory(global.moment)
  13672. }(this, (function (moment) { 'use strict';
  13673. var symbolMap = {
  13674. '1': '١',
  13675. '2': '٢',
  13676. '3': '٣',
  13677. '4': '٤',
  13678. '5': '٥',
  13679. '6': '٦',
  13680. '7': '٧',
  13681. '8': '٨',
  13682. '9': '٩',
  13683. '0': '٠'
  13684. };
  13685. var numberMap = {
  13686. '١': '1',
  13687. '٢': '2',
  13688. '٣': '3',
  13689. '٤': '4',
  13690. '٥': '5',
  13691. '٦': '6',
  13692. '٧': '7',
  13693. '٨': '8',
  13694. '٩': '9',
  13695. '٠': '0'
  13696. };
  13697. var arSa = moment.defineLocale('ar-sa', {
  13698. months : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
  13699. monthsShort : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
  13700. weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  13701. weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  13702. weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  13703. weekdaysParseExact : true,
  13704. longDateFormat : {
  13705. LT : 'HH:mm',
  13706. LTS : 'HH:mm:ss',
  13707. L : 'DD/MM/YYYY',
  13708. LL : 'D MMMM YYYY',
  13709. LLL : 'D MMMM YYYY HH:mm',
  13710. LLLL : 'dddd D MMMM YYYY HH:mm'
  13711. },
  13712. meridiemParse: /ص|م/,
  13713. isPM : function (input) {
  13714. return 'م' === input;
  13715. },
  13716. meridiem : function (hour, minute, isLower) {
  13717. if (hour < 12) {
  13718. return 'ص';
  13719. } else {
  13720. return 'م';
  13721. }
  13722. },
  13723. calendar : {
  13724. sameDay: '[اليوم على الساعة] LT',
  13725. nextDay: '[غدا على الساعة] LT',
  13726. nextWeek: 'dddd [على الساعة] LT',
  13727. lastDay: '[أمس على الساعة] LT',
  13728. lastWeek: 'dddd [على الساعة] LT',
  13729. sameElse: 'L'
  13730. },
  13731. relativeTime : {
  13732. future : 'في %s',
  13733. past : 'منذ %s',
  13734. s : 'ثوان',
  13735. m : 'دقيقة',
  13736. mm : '%d دقائق',
  13737. h : 'ساعة',
  13738. hh : '%d ساعات',
  13739. d : 'يوم',
  13740. dd : '%d أيام',
  13741. M : 'شهر',
  13742. MM : '%d أشهر',
  13743. y : 'سنة',
  13744. yy : '%d سنوات'
  13745. },
  13746. preparse: function (string) {
  13747. return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
  13748. return numberMap[match];
  13749. }).replace(/،/g, ',');
  13750. },
  13751. postformat: function (string) {
  13752. return string.replace(/\d/g, function (match) {
  13753. return symbolMap[match];
  13754. }).replace(/,/g, '،');
  13755. },
  13756. week : {
  13757. dow : 0, // Sunday is the first day of the week.
  13758. doy : 6 // The week that contains Jan 1st is the first week of the year.
  13759. }
  13760. });
  13761. return arSa;
  13762. })));
  13763. /***/ }),
  13764. /* 9 */
  13765. /***/ (function(module, exports, __webpack_require__) {
  13766. //! moment.js locale configuration
  13767. //! locale : Arabic (Tunisia) [ar-tn]
  13768. //! author : Nader Toukabri : https://github.com/naderio
  13769. ;(function (global, factory) {
  13770. true ? factory(__webpack_require__(0)) :
  13771. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  13772. factory(global.moment)
  13773. }(this, (function (moment) { 'use strict';
  13774. var arTn = moment.defineLocale('ar-tn', {
  13775. months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
  13776. monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
  13777. weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  13778. weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  13779. weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  13780. weekdaysParseExact : true,
  13781. longDateFormat: {
  13782. LT: 'HH:mm',
  13783. LTS: 'HH:mm:ss',
  13784. L: 'DD/MM/YYYY',
  13785. LL: 'D MMMM YYYY',
  13786. LLL: 'D MMMM YYYY HH:mm',
  13787. LLLL: 'dddd D MMMM YYYY HH:mm'
  13788. },
  13789. calendar: {
  13790. sameDay: '[اليوم على الساعة] LT',
  13791. nextDay: '[غدا على الساعة] LT',
  13792. nextWeek: 'dddd [على الساعة] LT',
  13793. lastDay: '[أمس على الساعة] LT',
  13794. lastWeek: 'dddd [على الساعة] LT',
  13795. sameElse: 'L'
  13796. },
  13797. relativeTime: {
  13798. future: 'في %s',
  13799. past: 'منذ %s',
  13800. s: 'ثوان',
  13801. m: 'دقيقة',
  13802. mm: '%d دقائق',
  13803. h: 'ساعة',
  13804. hh: '%d ساعات',
  13805. d: 'يوم',
  13806. dd: '%d أيام',
  13807. M: 'شهر',
  13808. MM: '%d أشهر',
  13809. y: 'سنة',
  13810. yy: '%d سنوات'
  13811. },
  13812. week: {
  13813. dow: 1, // Monday is the first day of the week.
  13814. doy: 4 // The week that contains Jan 4th is the first week of the year.
  13815. }
  13816. });
  13817. return arTn;
  13818. })));
  13819. /***/ }),
  13820. /* 10 */
  13821. /***/ (function(module, exports, __webpack_require__) {
  13822. //! moment.js locale configuration
  13823. //! locale : Arabic [ar]
  13824. //! author : Abdel Said: https://github.com/abdelsaid
  13825. //! author : Ahmed Elkhatib
  13826. //! author : forabi https://github.com/forabi
  13827. ;(function (global, factory) {
  13828. true ? factory(__webpack_require__(0)) :
  13829. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  13830. factory(global.moment)
  13831. }(this, (function (moment) { 'use strict';
  13832. var symbolMap = {
  13833. '1': '١',
  13834. '2': '٢',
  13835. '3': '٣',
  13836. '4': '٤',
  13837. '5': '٥',
  13838. '6': '٦',
  13839. '7': '٧',
  13840. '8': '٨',
  13841. '9': '٩',
  13842. '0': '٠'
  13843. };
  13844. var numberMap = {
  13845. '١': '1',
  13846. '٢': '2',
  13847. '٣': '3',
  13848. '٤': '4',
  13849. '٥': '5',
  13850. '٦': '6',
  13851. '٧': '7',
  13852. '٨': '8',
  13853. '٩': '9',
  13854. '٠': '0'
  13855. };
  13856. var pluralForm = function (n) {
  13857. return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5;
  13858. };
  13859. var plurals = {
  13860. s : ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'],
  13861. m : ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'],
  13862. h : ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'],
  13863. d : ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'],
  13864. M : ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'],
  13865. y : ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام']
  13866. };
  13867. var pluralize = function (u) {
  13868. return function (number, withoutSuffix, string, isFuture) {
  13869. var f = pluralForm(number),
  13870. str = plurals[u][pluralForm(number)];
  13871. if (f === 2) {
  13872. str = str[withoutSuffix ? 0 : 1];
  13873. }
  13874. return str.replace(/%d/i, number);
  13875. };
  13876. };
  13877. var months = [
  13878. 'كانون الثاني يناير',
  13879. 'شباط فبراير',
  13880. 'آذار مارس',
  13881. 'نيسان أبريل',
  13882. 'أيار مايو',
  13883. 'حزيران يونيو',
  13884. 'تموز يوليو',
  13885. 'آب أغسطس',
  13886. 'أيلول سبتمبر',
  13887. 'تشرين الأول أكتوبر',
  13888. 'تشرين الثاني نوفمبر',
  13889. 'كانون الأول ديسمبر'
  13890. ];
  13891. var ar = moment.defineLocale('ar', {
  13892. months : months,
  13893. monthsShort : months,
  13894. weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  13895. weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  13896. weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  13897. weekdaysParseExact : true,
  13898. longDateFormat : {
  13899. LT : 'HH:mm',
  13900. LTS : 'HH:mm:ss',
  13901. L : 'D/\u200FM/\u200FYYYY',
  13902. LL : 'D MMMM YYYY',
  13903. LLL : 'D MMMM YYYY HH:mm',
  13904. LLLL : 'dddd D MMMM YYYY HH:mm'
  13905. },
  13906. meridiemParse: /ص|م/,
  13907. isPM : function (input) {
  13908. return 'م' === input;
  13909. },
  13910. meridiem : function (hour, minute, isLower) {
  13911. if (hour < 12) {
  13912. return 'ص';
  13913. } else {
  13914. return 'م';
  13915. }
  13916. },
  13917. calendar : {
  13918. sameDay: '[اليوم عند الساعة] LT',
  13919. nextDay: '[غدًا عند الساعة] LT',
  13920. nextWeek: 'dddd [عند الساعة] LT',
  13921. lastDay: '[أمس عند الساعة] LT',
  13922. lastWeek: 'dddd [عند الساعة] LT',
  13923. sameElse: 'L'
  13924. },
  13925. relativeTime : {
  13926. future : 'بعد %s',
  13927. past : 'منذ %s',
  13928. s : pluralize('s'),
  13929. m : pluralize('m'),
  13930. mm : pluralize('m'),
  13931. h : pluralize('h'),
  13932. hh : pluralize('h'),
  13933. d : pluralize('d'),
  13934. dd : pluralize('d'),
  13935. M : pluralize('M'),
  13936. MM : pluralize('M'),
  13937. y : pluralize('y'),
  13938. yy : pluralize('y')
  13939. },
  13940. preparse: function (string) {
  13941. return string.replace(/\u200f/g, '').replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
  13942. return numberMap[match];
  13943. }).replace(/،/g, ',');
  13944. },
  13945. postformat: function (string) {
  13946. return string.replace(/\d/g, function (match) {
  13947. return symbolMap[match];
  13948. }).replace(/,/g, '،');
  13949. },
  13950. week : {
  13951. dow : 6, // Saturday is the first day of the week.
  13952. doy : 12 // The week that contains Jan 1st is the first week of the year.
  13953. }
  13954. });
  13955. return ar;
  13956. })));
  13957. /***/ }),
  13958. /* 11 */
  13959. /***/ (function(module, exports, __webpack_require__) {
  13960. //! moment.js locale configuration
  13961. //! locale : Azerbaijani [az]
  13962. //! author : topchiyev : https://github.com/topchiyev
  13963. ;(function (global, factory) {
  13964. true ? factory(__webpack_require__(0)) :
  13965. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  13966. factory(global.moment)
  13967. }(this, (function (moment) { 'use strict';
  13968. var suffixes = {
  13969. 1: '-inci',
  13970. 5: '-inci',
  13971. 8: '-inci',
  13972. 70: '-inci',
  13973. 80: '-inci',
  13974. 2: '-nci',
  13975. 7: '-nci',
  13976. 20: '-nci',
  13977. 50: '-nci',
  13978. 3: '-üncü',
  13979. 4: '-üncü',
  13980. 100: '-üncü',
  13981. 6: '-ncı',
  13982. 9: '-uncu',
  13983. 10: '-uncu',
  13984. 30: '-uncu',
  13985. 60: '-ıncı',
  13986. 90: '-ıncı'
  13987. };
  13988. var az = moment.defineLocale('az', {
  13989. months : 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split('_'),
  13990. monthsShort : 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'),
  13991. weekdays : 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split('_'),
  13992. weekdaysShort : 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'),
  13993. weekdaysMin : 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'),
  13994. weekdaysParseExact : true,
  13995. longDateFormat : {
  13996. LT : 'HH:mm',
  13997. LTS : 'HH:mm:ss',
  13998. L : 'DD.MM.YYYY',
  13999. LL : 'D MMMM YYYY',
  14000. LLL : 'D MMMM YYYY HH:mm',
  14001. LLLL : 'dddd, D MMMM YYYY HH:mm'
  14002. },
  14003. calendar : {
  14004. sameDay : '[bugün saat] LT',
  14005. nextDay : '[sabah saat] LT',
  14006. nextWeek : '[gələn həftə] dddd [saat] LT',
  14007. lastDay : '[dünən] LT',
  14008. lastWeek : '[keçən həftə] dddd [saat] LT',
  14009. sameElse : 'L'
  14010. },
  14011. relativeTime : {
  14012. future : '%s sonra',
  14013. past : '%s əvvəl',
  14014. s : 'birneçə saniyyə',
  14015. m : 'bir dəqiqə',
  14016. mm : '%d dəqiqə',
  14017. h : 'bir saat',
  14018. hh : '%d saat',
  14019. d : 'bir gün',
  14020. dd : '%d gün',
  14021. M : 'bir ay',
  14022. MM : '%d ay',
  14023. y : 'bir il',
  14024. yy : '%d il'
  14025. },
  14026. meridiemParse: /gecə|səhər|gündüz|axşam/,
  14027. isPM : function (input) {
  14028. return /^(gündüz|axşam)$/.test(input);
  14029. },
  14030. meridiem : function (hour, minute, isLower) {
  14031. if (hour < 4) {
  14032. return 'gecə';
  14033. } else if (hour < 12) {
  14034. return 'səhər';
  14035. } else if (hour < 17) {
  14036. return 'gündüz';
  14037. } else {
  14038. return 'axşam';
  14039. }
  14040. },
  14041. ordinalParse: /\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,
  14042. ordinal : function (number) {
  14043. if (number === 0) { // special case for zero
  14044. return number + '-ıncı';
  14045. }
  14046. var a = number % 10,
  14047. b = number % 100 - a,
  14048. c = number >= 100 ? 100 : null;
  14049. return number + (suffixes[a] || suffixes[b] || suffixes[c]);
  14050. },
  14051. week : {
  14052. dow : 1, // Monday is the first day of the week.
  14053. doy : 7 // The week that contains Jan 1st is the first week of the year.
  14054. }
  14055. });
  14056. return az;
  14057. })));
  14058. /***/ }),
  14059. /* 12 */
  14060. /***/ (function(module, exports, __webpack_require__) {
  14061. //! moment.js locale configuration
  14062. //! locale : Belarusian [be]
  14063. //! author : Dmitry Demidov : https://github.com/demidov91
  14064. //! author: Praleska: http://praleska.pro/
  14065. //! Author : Menelion Elensúle : https://github.com/Oire
  14066. ;(function (global, factory) {
  14067. true ? factory(__webpack_require__(0)) :
  14068. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  14069. factory(global.moment)
  14070. }(this, (function (moment) { 'use strict';
  14071. function plural(word, num) {
  14072. var forms = word.split('_');
  14073. 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]);
  14074. }
  14075. function relativeTimeWithPlural(number, withoutSuffix, key) {
  14076. var format = {
  14077. 'mm': withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін',
  14078. 'hh': withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін',
  14079. 'dd': 'дзень_дні_дзён',
  14080. 'MM': 'месяц_месяцы_месяцаў',
  14081. 'yy': 'год_гады_гадоў'
  14082. };
  14083. if (key === 'm') {
  14084. return withoutSuffix ? 'хвіліна' : 'хвіліну';
  14085. }
  14086. else if (key === 'h') {
  14087. return withoutSuffix ? 'гадзіна' : 'гадзіну';
  14088. }
  14089. else {
  14090. return number + ' ' + plural(format[key], +number);
  14091. }
  14092. }
  14093. var be = moment.defineLocale('be', {
  14094. months : {
  14095. format: 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_'),
  14096. standalone: 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_')
  14097. },
  14098. monthsShort : 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'),
  14099. weekdays : {
  14100. format: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_'),
  14101. standalone: 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'),
  14102. isFormat: /\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/
  14103. },
  14104. weekdaysShort : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
  14105. weekdaysMin : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
  14106. longDateFormat : {
  14107. LT : 'HH:mm',
  14108. LTS : 'HH:mm:ss',
  14109. L : 'DD.MM.YYYY',
  14110. LL : 'D MMMM YYYY г.',
  14111. LLL : 'D MMMM YYYY г., HH:mm',
  14112. LLLL : 'dddd, D MMMM YYYY г., HH:mm'
  14113. },
  14114. calendar : {
  14115. sameDay: '[Сёння ў] LT',
  14116. nextDay: '[Заўтра ў] LT',
  14117. lastDay: '[Учора ў] LT',
  14118. nextWeek: function () {
  14119. return '[У] dddd [ў] LT';
  14120. },
  14121. lastWeek: function () {
  14122. switch (this.day()) {
  14123. case 0:
  14124. case 3:
  14125. case 5:
  14126. case 6:
  14127. return '[У мінулую] dddd [ў] LT';
  14128. case 1:
  14129. case 2:
  14130. case 4:
  14131. return '[У мінулы] dddd [ў] LT';
  14132. }
  14133. },
  14134. sameElse: 'L'
  14135. },
  14136. relativeTime : {
  14137. future : 'праз %s',
  14138. past : '%s таму',
  14139. s : 'некалькі секунд',
  14140. m : relativeTimeWithPlural,
  14141. mm : relativeTimeWithPlural,
  14142. h : relativeTimeWithPlural,
  14143. hh : relativeTimeWithPlural,
  14144. d : 'дзень',
  14145. dd : relativeTimeWithPlural,
  14146. M : 'месяц',
  14147. MM : relativeTimeWithPlural,
  14148. y : 'год',
  14149. yy : relativeTimeWithPlural
  14150. },
  14151. meridiemParse: /ночы|раніцы|дня|вечара/,
  14152. isPM : function (input) {
  14153. return /^(дня|вечара)$/.test(input);
  14154. },
  14155. meridiem : function (hour, minute, isLower) {
  14156. if (hour < 4) {
  14157. return 'ночы';
  14158. } else if (hour < 12) {
  14159. return 'раніцы';
  14160. } else if (hour < 17) {
  14161. return 'дня';
  14162. } else {
  14163. return 'вечара';
  14164. }
  14165. },
  14166. ordinalParse: /\d{1,2}-(і|ы|га)/,
  14167. ordinal: function (number, period) {
  14168. switch (period) {
  14169. case 'M':
  14170. case 'd':
  14171. case 'DDD':
  14172. case 'w':
  14173. case 'W':
  14174. return (number % 10 === 2 || number % 10 === 3) && (number % 100 !== 12 && number % 100 !== 13) ? number + '-і' : number + '-ы';
  14175. case 'D':
  14176. return number + '-га';
  14177. default:
  14178. return number;
  14179. }
  14180. },
  14181. week : {
  14182. dow : 1, // Monday is the first day of the week.
  14183. doy : 7 // The week that contains Jan 1st is the first week of the year.
  14184. }
  14185. });
  14186. return be;
  14187. })));
  14188. /***/ }),
  14189. /* 13 */
  14190. /***/ (function(module, exports, __webpack_require__) {
  14191. //! moment.js locale configuration
  14192. //! locale : Bulgarian [bg]
  14193. //! author : Krasen Borisov : https://github.com/kraz
  14194. ;(function (global, factory) {
  14195. true ? factory(__webpack_require__(0)) :
  14196. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  14197. factory(global.moment)
  14198. }(this, (function (moment) { 'use strict';
  14199. var bg = moment.defineLocale('bg', {
  14200. months : 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'),
  14201. monthsShort : 'янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'),
  14202. weekdays : 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split('_'),
  14203. weekdaysShort : 'нед_пон_вто_сря_чет_пет_съб'.split('_'),
  14204. weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
  14205. longDateFormat : {
  14206. LT : 'H:mm',
  14207. LTS : 'H:mm:ss',
  14208. L : 'D.MM.YYYY',
  14209. LL : 'D MMMM YYYY',
  14210. LLL : 'D MMMM YYYY H:mm',
  14211. LLLL : 'dddd, D MMMM YYYY H:mm'
  14212. },
  14213. calendar : {
  14214. sameDay : '[Днес в] LT',
  14215. nextDay : '[Утре в] LT',
  14216. nextWeek : 'dddd [в] LT',
  14217. lastDay : '[Вчера в] LT',
  14218. lastWeek : function () {
  14219. switch (this.day()) {
  14220. case 0:
  14221. case 3:
  14222. case 6:
  14223. return '[В изминалата] dddd [в] LT';
  14224. case 1:
  14225. case 2:
  14226. case 4:
  14227. case 5:
  14228. return '[В изминалия] dddd [в] LT';
  14229. }
  14230. },
  14231. sameElse : 'L'
  14232. },
  14233. relativeTime : {
  14234. future : 'след %s',
  14235. past : 'преди %s',
  14236. s : 'няколко секунди',
  14237. m : 'минута',
  14238. mm : '%d минути',
  14239. h : 'час',
  14240. hh : '%d часа',
  14241. d : 'ден',
  14242. dd : '%d дни',
  14243. M : 'месец',
  14244. MM : '%d месеца',
  14245. y : 'година',
  14246. yy : '%d години'
  14247. },
  14248. ordinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
  14249. ordinal : function (number) {
  14250. var lastDigit = number % 10,
  14251. last2Digits = number % 100;
  14252. if (number === 0) {
  14253. return number + '-ев';
  14254. } else if (last2Digits === 0) {
  14255. return number + '-ен';
  14256. } else if (last2Digits > 10 && last2Digits < 20) {
  14257. return number + '-ти';
  14258. } else if (lastDigit === 1) {
  14259. return number + '-ви';
  14260. } else if (lastDigit === 2) {
  14261. return number + '-ри';
  14262. } else if (lastDigit === 7 || lastDigit === 8) {
  14263. return number + '-ми';
  14264. } else {
  14265. return number + '-ти';
  14266. }
  14267. },
  14268. week : {
  14269. dow : 1, // Monday is the first day of the week.
  14270. doy : 7 // The week that contains Jan 1st is the first week of the year.
  14271. }
  14272. });
  14273. return bg;
  14274. })));
  14275. /***/ }),
  14276. /* 14 */
  14277. /***/ (function(module, exports, __webpack_require__) {
  14278. //! moment.js locale configuration
  14279. //! locale : Bengali [bn]
  14280. //! author : Kaushik Gandhi : https://github.com/kaushikgandhi
  14281. ;(function (global, factory) {
  14282. true ? factory(__webpack_require__(0)) :
  14283. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  14284. factory(global.moment)
  14285. }(this, (function (moment) { 'use strict';
  14286. var symbolMap = {
  14287. '1': '১',
  14288. '2': '২',
  14289. '3': '৩',
  14290. '4': '৪',
  14291. '5': '৫',
  14292. '6': '৬',
  14293. '7': '৭',
  14294. '8': '৮',
  14295. '9': '৯',
  14296. '0': '০'
  14297. };
  14298. var numberMap = {
  14299. '১': '1',
  14300. '২': '2',
  14301. '৩': '3',
  14302. '৪': '4',
  14303. '৫': '5',
  14304. '৬': '6',
  14305. '৭': '7',
  14306. '৮': '8',
  14307. '৯': '9',
  14308. '০': '0'
  14309. };
  14310. var bn = moment.defineLocale('bn', {
  14311. months : 'জানুয়ারী_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split('_'),
  14312. monthsShort : 'জানু_ফেব_মার্চ_এপ্র_মে_জুন_জুল_আগ_সেপ্ট_অক্টো_নভে_ডিসে'.split('_'),
  14313. weekdays : 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split('_'),
  14314. weekdaysShort : 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'),
  14315. weekdaysMin : 'রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি'.split('_'),
  14316. longDateFormat : {
  14317. LT : 'A h:mm সময়',
  14318. LTS : 'A h:mm:ss সময়',
  14319. L : 'DD/MM/YYYY',
  14320. LL : 'D MMMM YYYY',
  14321. LLL : 'D MMMM YYYY, A h:mm সময়',
  14322. LLLL : 'dddd, D MMMM YYYY, A h:mm সময়'
  14323. },
  14324. calendar : {
  14325. sameDay : '[আজ] LT',
  14326. nextDay : '[আগামীকাল] LT',
  14327. nextWeek : 'dddd, LT',
  14328. lastDay : '[গতকাল] LT',
  14329. lastWeek : '[গত] dddd, LT',
  14330. sameElse : 'L'
  14331. },
  14332. relativeTime : {
  14333. future : '%s পরে',
  14334. past : '%s আগে',
  14335. s : 'কয়েক সেকেন্ড',
  14336. m : 'এক মিনিট',
  14337. mm : '%d মিনিট',
  14338. h : 'এক ঘন্টা',
  14339. hh : '%d ঘন্টা',
  14340. d : 'এক দিন',
  14341. dd : '%d দিন',
  14342. M : 'এক মাস',
  14343. MM : '%d মাস',
  14344. y : 'এক বছর',
  14345. yy : '%d বছর'
  14346. },
  14347. preparse: function (string) {
  14348. return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {
  14349. return numberMap[match];
  14350. });
  14351. },
  14352. postformat: function (string) {
  14353. return string.replace(/\d/g, function (match) {
  14354. return symbolMap[match];
  14355. });
  14356. },
  14357. meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/,
  14358. meridiemHour : function (hour, meridiem) {
  14359. if (hour === 12) {
  14360. hour = 0;
  14361. }
  14362. if ((meridiem === 'রাত' && hour >= 4) ||
  14363. (meridiem === 'দুপুর' && hour < 5) ||
  14364. meridiem === 'বিকাল') {
  14365. return hour + 12;
  14366. } else {
  14367. return hour;
  14368. }
  14369. },
  14370. meridiem : function (hour, minute, isLower) {
  14371. if (hour < 4) {
  14372. return 'রাত';
  14373. } else if (hour < 10) {
  14374. return 'সকাল';
  14375. } else if (hour < 17) {
  14376. return 'দুপুর';
  14377. } else if (hour < 20) {
  14378. return 'বিকাল';
  14379. } else {
  14380. return 'রাত';
  14381. }
  14382. },
  14383. week : {
  14384. dow : 0, // Sunday is the first day of the week.
  14385. doy : 6 // The week that contains Jan 1st is the first week of the year.
  14386. }
  14387. });
  14388. return bn;
  14389. })));
  14390. /***/ }),
  14391. /* 15 */
  14392. /***/ (function(module, exports, __webpack_require__) {
  14393. //! moment.js locale configuration
  14394. //! locale : Tibetan [bo]
  14395. //! author : Thupten N. Chakrishar : https://github.com/vajradog
  14396. ;(function (global, factory) {
  14397. true ? factory(__webpack_require__(0)) :
  14398. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  14399. factory(global.moment)
  14400. }(this, (function (moment) { 'use strict';
  14401. var symbolMap = {
  14402. '1': '༡',
  14403. '2': '༢',
  14404. '3': '༣',
  14405. '4': '༤',
  14406. '5': '༥',
  14407. '6': '༦',
  14408. '7': '༧',
  14409. '8': '༨',
  14410. '9': '༩',
  14411. '0': '༠'
  14412. };
  14413. var numberMap = {
  14414. '༡': '1',
  14415. '༢': '2',
  14416. '༣': '3',
  14417. '༤': '4',
  14418. '༥': '5',
  14419. '༦': '6',
  14420. '༧': '7',
  14421. '༨': '8',
  14422. '༩': '9',
  14423. '༠': '0'
  14424. };
  14425. var bo = moment.defineLocale('bo', {
  14426. months : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),
  14427. monthsShort : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),
  14428. weekdays : 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split('_'),
  14429. weekdaysShort : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),
  14430. weekdaysMin : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),
  14431. longDateFormat : {
  14432. LT : 'A h:mm',
  14433. LTS : 'A h:mm:ss',
  14434. L : 'DD/MM/YYYY',
  14435. LL : 'D MMMM YYYY',
  14436. LLL : 'D MMMM YYYY, A h:mm',
  14437. LLLL : 'dddd, D MMMM YYYY, A h:mm'
  14438. },
  14439. calendar : {
  14440. sameDay : '[དི་རིང] LT',
  14441. nextDay : '[སང་ཉིན] LT',
  14442. nextWeek : '[བདུན་ཕྲག་རྗེས་མ], LT',
  14443. lastDay : '[ཁ་སང] LT',
  14444. lastWeek : '[བདུན་ཕྲག་མཐའ་མ] dddd, LT',
  14445. sameElse : 'L'
  14446. },
  14447. relativeTime : {
  14448. future : '%s ལ་',
  14449. past : '%s སྔན་ལ',
  14450. s : 'ལམ་སང',
  14451. m : 'སྐར་མ་གཅིག',
  14452. mm : '%d སྐར་མ',
  14453. h : 'ཆུ་ཚོད་གཅིག',
  14454. hh : '%d ཆུ་ཚོད',
  14455. d : 'ཉིན་གཅིག',
  14456. dd : '%d ཉིན་',
  14457. M : 'ཟླ་བ་གཅིག',
  14458. MM : '%d ཟླ་བ',
  14459. y : 'ལོ་གཅིག',
  14460. yy : '%d ལོ'
  14461. },
  14462. preparse: function (string) {
  14463. return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, function (match) {
  14464. return numberMap[match];
  14465. });
  14466. },
  14467. postformat: function (string) {
  14468. return string.replace(/\d/g, function (match) {
  14469. return symbolMap[match];
  14470. });
  14471. },
  14472. meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,
  14473. meridiemHour : function (hour, meridiem) {
  14474. if (hour === 12) {
  14475. hour = 0;
  14476. }
  14477. if ((meridiem === 'མཚན་མོ' && hour >= 4) ||
  14478. (meridiem === 'ཉིན་གུང' && hour < 5) ||
  14479. meridiem === 'དགོང་དག') {
  14480. return hour + 12;
  14481. } else {
  14482. return hour;
  14483. }
  14484. },
  14485. meridiem : function (hour, minute, isLower) {
  14486. if (hour < 4) {
  14487. return 'མཚན་མོ';
  14488. } else if (hour < 10) {
  14489. return 'ཞོགས་ཀས';
  14490. } else if (hour < 17) {
  14491. return 'ཉིན་གུང';
  14492. } else if (hour < 20) {
  14493. return 'དགོང་དག';
  14494. } else {
  14495. return 'མཚན་མོ';
  14496. }
  14497. },
  14498. week : {
  14499. dow : 0, // Sunday is the first day of the week.
  14500. doy : 6 // The week that contains Jan 1st is the first week of the year.
  14501. }
  14502. });
  14503. return bo;
  14504. })));
  14505. /***/ }),
  14506. /* 16 */
  14507. /***/ (function(module, exports, __webpack_require__) {
  14508. //! moment.js locale configuration
  14509. //! locale : Breton [br]
  14510. //! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou
  14511. ;(function (global, factory) {
  14512. true ? factory(__webpack_require__(0)) :
  14513. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  14514. factory(global.moment)
  14515. }(this, (function (moment) { 'use strict';
  14516. function relativeTimeWithMutation(number, withoutSuffix, key) {
  14517. var format = {
  14518. 'mm': 'munutenn',
  14519. 'MM': 'miz',
  14520. 'dd': 'devezh'
  14521. };
  14522. return number + ' ' + mutation(format[key], number);
  14523. }
  14524. function specialMutationForYears(number) {
  14525. switch (lastNumber(number)) {
  14526. case 1:
  14527. case 3:
  14528. case 4:
  14529. case 5:
  14530. case 9:
  14531. return number + ' bloaz';
  14532. default:
  14533. return number + ' vloaz';
  14534. }
  14535. }
  14536. function lastNumber(number) {
  14537. if (number > 9) {
  14538. return lastNumber(number % 10);
  14539. }
  14540. return number;
  14541. }
  14542. function mutation(text, number) {
  14543. if (number === 2) {
  14544. return softMutation(text);
  14545. }
  14546. return text;
  14547. }
  14548. function softMutation(text) {
  14549. var mutationTable = {
  14550. 'm': 'v',
  14551. 'b': 'v',
  14552. 'd': 'z'
  14553. };
  14554. if (mutationTable[text.charAt(0)] === undefined) {
  14555. return text;
  14556. }
  14557. return mutationTable[text.charAt(0)] + text.substring(1);
  14558. }
  14559. var br = moment.defineLocale('br', {
  14560. months : 'Genver_C\'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split('_'),
  14561. monthsShort : 'Gen_C\'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'),
  14562. weekdays : 'Sul_Lun_Meurzh_Merc\'her_Yaou_Gwener_Sadorn'.split('_'),
  14563. weekdaysShort : 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'),
  14564. weekdaysMin : 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'),
  14565. weekdaysParseExact : true,
  14566. longDateFormat : {
  14567. LT : 'h[e]mm A',
  14568. LTS : 'h[e]mm:ss A',
  14569. L : 'DD/MM/YYYY',
  14570. LL : 'D [a viz] MMMM YYYY',
  14571. LLL : 'D [a viz] MMMM YYYY h[e]mm A',
  14572. LLLL : 'dddd, D [a viz] MMMM YYYY h[e]mm A'
  14573. },
  14574. calendar : {
  14575. sameDay : '[Hiziv da] LT',
  14576. nextDay : '[Warc\'hoazh da] LT',
  14577. nextWeek : 'dddd [da] LT',
  14578. lastDay : '[Dec\'h da] LT',
  14579. lastWeek : 'dddd [paset da] LT',
  14580. sameElse : 'L'
  14581. },
  14582. relativeTime : {
  14583. future : 'a-benn %s',
  14584. past : '%s \'zo',
  14585. s : 'un nebeud segondennoù',
  14586. m : 'ur vunutenn',
  14587. mm : relativeTimeWithMutation,
  14588. h : 'un eur',
  14589. hh : '%d eur',
  14590. d : 'un devezh',
  14591. dd : relativeTimeWithMutation,
  14592. M : 'ur miz',
  14593. MM : relativeTimeWithMutation,
  14594. y : 'ur bloaz',
  14595. yy : specialMutationForYears
  14596. },
  14597. ordinalParse: /\d{1,2}(añ|vet)/,
  14598. ordinal : function (number) {
  14599. var output = (number === 1) ? 'añ' : 'vet';
  14600. return number + output;
  14601. },
  14602. week : {
  14603. dow : 1, // Monday is the first day of the week.
  14604. doy : 4 // The week that contains Jan 4th is the first week of the year.
  14605. }
  14606. });
  14607. return br;
  14608. })));
  14609. /***/ }),
  14610. /* 17 */
  14611. /***/ (function(module, exports, __webpack_require__) {
  14612. //! moment.js locale configuration
  14613. //! locale : Bosnian [bs]
  14614. //! author : Nedim Cholich : https://github.com/frontyard
  14615. //! based on (hr) translation by Bojan Marković
  14616. ;(function (global, factory) {
  14617. true ? factory(__webpack_require__(0)) :
  14618. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  14619. factory(global.moment)
  14620. }(this, (function (moment) { 'use strict';
  14621. function translate(number, withoutSuffix, key) {
  14622. var result = number + ' ';
  14623. switch (key) {
  14624. case 'm':
  14625. return withoutSuffix ? 'jedna minuta' : 'jedne minute';
  14626. case 'mm':
  14627. if (number === 1) {
  14628. result += 'minuta';
  14629. } else if (number === 2 || number === 3 || number === 4) {
  14630. result += 'minute';
  14631. } else {
  14632. result += 'minuta';
  14633. }
  14634. return result;
  14635. case 'h':
  14636. return withoutSuffix ? 'jedan sat' : 'jednog sata';
  14637. case 'hh':
  14638. if (number === 1) {
  14639. result += 'sat';
  14640. } else if (number === 2 || number === 3 || number === 4) {
  14641. result += 'sata';
  14642. } else {
  14643. result += 'sati';
  14644. }
  14645. return result;
  14646. case 'dd':
  14647. if (number === 1) {
  14648. result += 'dan';
  14649. } else {
  14650. result += 'dana';
  14651. }
  14652. return result;
  14653. case 'MM':
  14654. if (number === 1) {
  14655. result += 'mjesec';
  14656. } else if (number === 2 || number === 3 || number === 4) {
  14657. result += 'mjeseca';
  14658. } else {
  14659. result += 'mjeseci';
  14660. }
  14661. return result;
  14662. case 'yy':
  14663. if (number === 1) {
  14664. result += 'godina';
  14665. } else if (number === 2 || number === 3 || number === 4) {
  14666. result += 'godine';
  14667. } else {
  14668. result += 'godina';
  14669. }
  14670. return result;
  14671. }
  14672. }
  14673. var bs = moment.defineLocale('bs', {
  14674. months : 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split('_'),
  14675. monthsShort : 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split('_'),
  14676. monthsParseExact: true,
  14677. weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
  14678. weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
  14679. weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'),
  14680. weekdaysParseExact : true,
  14681. longDateFormat : {
  14682. LT : 'H:mm',
  14683. LTS : 'H:mm:ss',
  14684. L : 'DD.MM.YYYY',
  14685. LL : 'D. MMMM YYYY',
  14686. LLL : 'D. MMMM YYYY H:mm',
  14687. LLLL : 'dddd, D. MMMM YYYY H:mm'
  14688. },
  14689. calendar : {
  14690. sameDay : '[danas u] LT',
  14691. nextDay : '[sutra u] LT',
  14692. nextWeek : function () {
  14693. switch (this.day()) {
  14694. case 0:
  14695. return '[u] [nedjelju] [u] LT';
  14696. case 3:
  14697. return '[u] [srijedu] [u] LT';
  14698. case 6:
  14699. return '[u] [subotu] [u] LT';
  14700. case 1:
  14701. case 2:
  14702. case 4:
  14703. case 5:
  14704. return '[u] dddd [u] LT';
  14705. }
  14706. },
  14707. lastDay : '[jučer u] LT',
  14708. lastWeek : function () {
  14709. switch (this.day()) {
  14710. case 0:
  14711. case 3:
  14712. return '[prošlu] dddd [u] LT';
  14713. case 6:
  14714. return '[prošle] [subote] [u] LT';
  14715. case 1:
  14716. case 2:
  14717. case 4:
  14718. case 5:
  14719. return '[prošli] dddd [u] LT';
  14720. }
  14721. },
  14722. sameElse : 'L'
  14723. },
  14724. relativeTime : {
  14725. future : 'za %s',
  14726. past : 'prije %s',
  14727. s : 'par sekundi',
  14728. m : translate,
  14729. mm : translate,
  14730. h : translate,
  14731. hh : translate,
  14732. d : 'dan',
  14733. dd : translate,
  14734. M : 'mjesec',
  14735. MM : translate,
  14736. y : 'godinu',
  14737. yy : translate
  14738. },
  14739. ordinalParse: /\d{1,2}\./,
  14740. ordinal : '%d.',
  14741. week : {
  14742. dow : 1, // Monday is the first day of the week.
  14743. doy : 7 // The week that contains Jan 1st is the first week of the year.
  14744. }
  14745. });
  14746. return bs;
  14747. })));
  14748. /***/ }),
  14749. /* 18 */
  14750. /***/ (function(module, exports, __webpack_require__) {
  14751. //! moment.js locale configuration
  14752. //! locale : Catalan [ca]
  14753. //! author : Juan G. Hurtado : https://github.com/juanghurtado
  14754. ;(function (global, factory) {
  14755. true ? factory(__webpack_require__(0)) :
  14756. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  14757. factory(global.moment)
  14758. }(this, (function (moment) { 'use strict';
  14759. var ca = moment.defineLocale('ca', {
  14760. months : 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split('_'),
  14761. monthsShort : 'gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.'.split('_'),
  14762. monthsParseExact : true,
  14763. weekdays : 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split('_'),
  14764. weekdaysShort : 'dg._dl._dt._dc._dj._dv._ds.'.split('_'),
  14765. weekdaysMin : 'Dg_Dl_Dt_Dc_Dj_Dv_Ds'.split('_'),
  14766. weekdaysParseExact : true,
  14767. longDateFormat : {
  14768. LT : 'H:mm',
  14769. LTS : 'H:mm:ss',
  14770. L : 'DD/MM/YYYY',
  14771. LL : 'D MMMM YYYY',
  14772. LLL : 'D MMMM YYYY H:mm',
  14773. LLLL : 'dddd D MMMM YYYY H:mm'
  14774. },
  14775. calendar : {
  14776. sameDay : function () {
  14777. return '[avui a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
  14778. },
  14779. nextDay : function () {
  14780. return '[demà a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
  14781. },
  14782. nextWeek : function () {
  14783. return 'dddd [a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
  14784. },
  14785. lastDay : function () {
  14786. return '[ahir a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
  14787. },
  14788. lastWeek : function () {
  14789. return '[el] dddd [passat a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
  14790. },
  14791. sameElse : 'L'
  14792. },
  14793. relativeTime : {
  14794. future : 'd\'aquí %s',
  14795. past : 'fa %s',
  14796. s : 'uns segons',
  14797. m : 'un minut',
  14798. mm : '%d minuts',
  14799. h : 'una hora',
  14800. hh : '%d hores',
  14801. d : 'un dia',
  14802. dd : '%d dies',
  14803. M : 'un mes',
  14804. MM : '%d mesos',
  14805. y : 'un any',
  14806. yy : '%d anys'
  14807. },
  14808. ordinalParse: /\d{1,2}(r|n|t|è|a)/,
  14809. ordinal : function (number, period) {
  14810. var output = (number === 1) ? 'r' :
  14811. (number === 2) ? 'n' :
  14812. (number === 3) ? 'r' :
  14813. (number === 4) ? 't' : 'è';
  14814. if (period === 'w' || period === 'W') {
  14815. output = 'a';
  14816. }
  14817. return number + output;
  14818. },
  14819. week : {
  14820. dow : 1, // Monday is the first day of the week.
  14821. doy : 4 // The week that contains Jan 4th is the first week of the year.
  14822. }
  14823. });
  14824. return ca;
  14825. })));
  14826. /***/ }),
  14827. /* 19 */
  14828. /***/ (function(module, exports, __webpack_require__) {
  14829. //! moment.js locale configuration
  14830. //! locale : Czech [cs]
  14831. //! author : petrbela : https://github.com/petrbela
  14832. ;(function (global, factory) {
  14833. true ? factory(__webpack_require__(0)) :
  14834. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  14835. factory(global.moment)
  14836. }(this, (function (moment) { 'use strict';
  14837. var months = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split('_');
  14838. var monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_');
  14839. function plural(n) {
  14840. return (n > 1) && (n < 5) && (~~(n / 10) !== 1);
  14841. }
  14842. function translate(number, withoutSuffix, key, isFuture) {
  14843. var result = number + ' ';
  14844. switch (key) {
  14845. case 's': // a few seconds / in a few seconds / a few seconds ago
  14846. return (withoutSuffix || isFuture) ? 'pár sekund' : 'pár sekundami';
  14847. case 'm': // a minute / in a minute / a minute ago
  14848. return withoutSuffix ? 'minuta' : (isFuture ? 'minutu' : 'minutou');
  14849. case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
  14850. if (withoutSuffix || isFuture) {
  14851. return result + (plural(number) ? 'minuty' : 'minut');
  14852. } else {
  14853. return result + 'minutami';
  14854. }
  14855. break;
  14856. case 'h': // an hour / in an hour / an hour ago
  14857. return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');
  14858. case 'hh': // 9 hours / in 9 hours / 9 hours ago
  14859. if (withoutSuffix || isFuture) {
  14860. return result + (plural(number) ? 'hodiny' : 'hodin');
  14861. } else {
  14862. return result + 'hodinami';
  14863. }
  14864. break;
  14865. case 'd': // a day / in a day / a day ago
  14866. return (withoutSuffix || isFuture) ? 'den' : 'dnem';
  14867. case 'dd': // 9 days / in 9 days / 9 days ago
  14868. if (withoutSuffix || isFuture) {
  14869. return result + (plural(number) ? 'dny' : 'dní');
  14870. } else {
  14871. return result + 'dny';
  14872. }
  14873. break;
  14874. case 'M': // a month / in a month / a month ago
  14875. return (withoutSuffix || isFuture) ? 'měsíc' : 'měsícem';
  14876. case 'MM': // 9 months / in 9 months / 9 months ago
  14877. if (withoutSuffix || isFuture) {
  14878. return result + (plural(number) ? 'měsíce' : 'měsíců');
  14879. } else {
  14880. return result + 'měsíci';
  14881. }
  14882. break;
  14883. case 'y': // a year / in a year / a year ago
  14884. return (withoutSuffix || isFuture) ? 'rok' : 'rokem';
  14885. case 'yy': // 9 years / in 9 years / 9 years ago
  14886. if (withoutSuffix || isFuture) {
  14887. return result + (plural(number) ? 'roky' : 'let');
  14888. } else {
  14889. return result + 'lety';
  14890. }
  14891. break;
  14892. }
  14893. }
  14894. var cs = moment.defineLocale('cs', {
  14895. months : months,
  14896. monthsShort : monthsShort,
  14897. monthsParse : (function (months, monthsShort) {
  14898. var i, _monthsParse = [];
  14899. for (i = 0; i < 12; i++) {
  14900. // use custom parser to solve problem with July (červenec)
  14901. _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i');
  14902. }
  14903. return _monthsParse;
  14904. }(months, monthsShort)),
  14905. shortMonthsParse : (function (monthsShort) {
  14906. var i, _shortMonthsParse = [];
  14907. for (i = 0; i < 12; i++) {
  14908. _shortMonthsParse[i] = new RegExp('^' + monthsShort[i] + '$', 'i');
  14909. }
  14910. return _shortMonthsParse;
  14911. }(monthsShort)),
  14912. longMonthsParse : (function (months) {
  14913. var i, _longMonthsParse = [];
  14914. for (i = 0; i < 12; i++) {
  14915. _longMonthsParse[i] = new RegExp('^' + months[i] + '$', 'i');
  14916. }
  14917. return _longMonthsParse;
  14918. }(months)),
  14919. weekdays : 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),
  14920. weekdaysShort : 'ne_po_út_st_čt_pá_so'.split('_'),
  14921. weekdaysMin : 'ne_po_út_st_čt_pá_so'.split('_'),
  14922. longDateFormat : {
  14923. LT: 'H:mm',
  14924. LTS : 'H:mm:ss',
  14925. L : 'DD.MM.YYYY',
  14926. LL : 'D. MMMM YYYY',
  14927. LLL : 'D. MMMM YYYY H:mm',
  14928. LLLL : 'dddd D. MMMM YYYY H:mm',
  14929. l : 'D. M. YYYY'
  14930. },
  14931. calendar : {
  14932. sameDay: '[dnes v] LT',
  14933. nextDay: '[zítra v] LT',
  14934. nextWeek: function () {
  14935. switch (this.day()) {
  14936. case 0:
  14937. return '[v neděli v] LT';
  14938. case 1:
  14939. case 2:
  14940. return '[v] dddd [v] LT';
  14941. case 3:
  14942. return '[ve středu v] LT';
  14943. case 4:
  14944. return '[ve čtvrtek v] LT';
  14945. case 5:
  14946. return '[v pátek v] LT';
  14947. case 6:
  14948. return '[v sobotu v] LT';
  14949. }
  14950. },
  14951. lastDay: '[včera v] LT',
  14952. lastWeek: function () {
  14953. switch (this.day()) {
  14954. case 0:
  14955. return '[minulou neděli v] LT';
  14956. case 1:
  14957. case 2:
  14958. return '[minulé] dddd [v] LT';
  14959. case 3:
  14960. return '[minulou středu v] LT';
  14961. case 4:
  14962. case 5:
  14963. return '[minulý] dddd [v] LT';
  14964. case 6:
  14965. return '[minulou sobotu v] LT';
  14966. }
  14967. },
  14968. sameElse: 'L'
  14969. },
  14970. relativeTime : {
  14971. future : 'za %s',
  14972. past : 'před %s',
  14973. s : translate,
  14974. m : translate,
  14975. mm : translate,
  14976. h : translate,
  14977. hh : translate,
  14978. d : translate,
  14979. dd : translate,
  14980. M : translate,
  14981. MM : translate,
  14982. y : translate,
  14983. yy : translate
  14984. },
  14985. ordinalParse : /\d{1,2}\./,
  14986. ordinal : '%d.',
  14987. week : {
  14988. dow : 1, // Monday is the first day of the week.
  14989. doy : 4 // The week that contains Jan 4th is the first week of the year.
  14990. }
  14991. });
  14992. return cs;
  14993. })));
  14994. /***/ }),
  14995. /* 20 */
  14996. /***/ (function(module, exports, __webpack_require__) {
  14997. //! moment.js locale configuration
  14998. //! locale : Chuvash [cv]
  14999. //! author : Anatoly Mironov : https://github.com/mirontoli
  15000. ;(function (global, factory) {
  15001. true ? factory(__webpack_require__(0)) :
  15002. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15003. factory(global.moment)
  15004. }(this, (function (moment) { 'use strict';
  15005. var cv = moment.defineLocale('cv', {
  15006. months : 'кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав'.split('_'),
  15007. monthsShort : 'кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш'.split('_'),
  15008. weekdays : 'вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун'.split('_'),
  15009. weekdaysShort : 'выр_тун_ытл_юн_кӗҫ_эрн_шӑм'.split('_'),
  15010. weekdaysMin : 'вр_тн_ыт_юн_кҫ_эр_шм'.split('_'),
  15011. longDateFormat : {
  15012. LT : 'HH:mm',
  15013. LTS : 'HH:mm:ss',
  15014. L : 'DD-MM-YYYY',
  15015. LL : 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]',
  15016. LLL : 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',
  15017. LLLL : 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm'
  15018. },
  15019. calendar : {
  15020. sameDay: '[Паян] LT [сехетре]',
  15021. nextDay: '[Ыран] LT [сехетре]',
  15022. lastDay: '[Ӗнер] LT [сехетре]',
  15023. nextWeek: '[Ҫитес] dddd LT [сехетре]',
  15024. lastWeek: '[Иртнӗ] dddd LT [сехетре]',
  15025. sameElse: 'L'
  15026. },
  15027. relativeTime : {
  15028. future : function (output) {
  15029. var affix = /сехет$/i.exec(output) ? 'рен' : /ҫул$/i.exec(output) ? 'тан' : 'ран';
  15030. return output + affix;
  15031. },
  15032. past : '%s каялла',
  15033. s : 'пӗр-ик ҫеккунт',
  15034. m : 'пӗр минут',
  15035. mm : '%d минут',
  15036. h : 'пӗр сехет',
  15037. hh : '%d сехет',
  15038. d : 'пӗр кун',
  15039. dd : '%d кун',
  15040. M : 'пӗр уйӑх',
  15041. MM : '%d уйӑх',
  15042. y : 'пӗр ҫул',
  15043. yy : '%d ҫул'
  15044. },
  15045. ordinalParse: /\d{1,2}-мӗш/,
  15046. ordinal : '%d-мӗш',
  15047. week : {
  15048. dow : 1, // Monday is the first day of the week.
  15049. doy : 7 // The week that contains Jan 1st is the first week of the year.
  15050. }
  15051. });
  15052. return cv;
  15053. })));
  15054. /***/ }),
  15055. /* 21 */
  15056. /***/ (function(module, exports, __webpack_require__) {
  15057. //! moment.js locale configuration
  15058. //! locale : Welsh [cy]
  15059. //! author : Robert Allen : https://github.com/robgallen
  15060. //! author : https://github.com/ryangreaves
  15061. ;(function (global, factory) {
  15062. true ? factory(__webpack_require__(0)) :
  15063. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15064. factory(global.moment)
  15065. }(this, (function (moment) { 'use strict';
  15066. var cy = moment.defineLocale('cy', {
  15067. months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split('_'),
  15068. monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split('_'),
  15069. weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split('_'),
  15070. weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'),
  15071. weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'),
  15072. weekdaysParseExact : true,
  15073. // time formats are the same as en-gb
  15074. longDateFormat: {
  15075. LT: 'HH:mm',
  15076. LTS : 'HH:mm:ss',
  15077. L: 'DD/MM/YYYY',
  15078. LL: 'D MMMM YYYY',
  15079. LLL: 'D MMMM YYYY HH:mm',
  15080. LLLL: 'dddd, D MMMM YYYY HH:mm'
  15081. },
  15082. calendar: {
  15083. sameDay: '[Heddiw am] LT',
  15084. nextDay: '[Yfory am] LT',
  15085. nextWeek: 'dddd [am] LT',
  15086. lastDay: '[Ddoe am] LT',
  15087. lastWeek: 'dddd [diwethaf am] LT',
  15088. sameElse: 'L'
  15089. },
  15090. relativeTime: {
  15091. future: 'mewn %s',
  15092. past: '%s yn ôl',
  15093. s: 'ychydig eiliadau',
  15094. m: 'munud',
  15095. mm: '%d munud',
  15096. h: 'awr',
  15097. hh: '%d awr',
  15098. d: 'diwrnod',
  15099. dd: '%d diwrnod',
  15100. M: 'mis',
  15101. MM: '%d mis',
  15102. y: 'blwyddyn',
  15103. yy: '%d flynedd'
  15104. },
  15105. ordinalParse: /\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,
  15106. // traditional ordinal numbers above 31 are not commonly used in colloquial Welsh
  15107. ordinal: function (number) {
  15108. var b = number,
  15109. output = '',
  15110. lookup = [
  15111. '', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed
  15112. 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed' // 11eg to 20fed
  15113. ];
  15114. if (b > 20) {
  15115. if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) {
  15116. output = 'fed'; // not 30ain, 70ain or 90ain
  15117. } else {
  15118. output = 'ain';
  15119. }
  15120. } else if (b > 0) {
  15121. output = lookup[b];
  15122. }
  15123. return number + output;
  15124. },
  15125. week : {
  15126. dow : 1, // Monday is the first day of the week.
  15127. doy : 4 // The week that contains Jan 4th is the first week of the year.
  15128. }
  15129. });
  15130. return cy;
  15131. })));
  15132. /***/ }),
  15133. /* 22 */
  15134. /***/ (function(module, exports, __webpack_require__) {
  15135. //! moment.js locale configuration
  15136. //! locale : Danish [da]
  15137. //! author : Ulrik Nielsen : https://github.com/mrbase
  15138. ;(function (global, factory) {
  15139. true ? factory(__webpack_require__(0)) :
  15140. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15141. factory(global.moment)
  15142. }(this, (function (moment) { 'use strict';
  15143. var da = moment.defineLocale('da', {
  15144. months : 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split('_'),
  15145. monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
  15146. weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
  15147. weekdaysShort : 'søn_man_tir_ons_tor_fre_lør'.split('_'),
  15148. weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'),
  15149. longDateFormat : {
  15150. LT : 'HH:mm',
  15151. LTS : 'HH:mm:ss',
  15152. L : 'DD/MM/YYYY',
  15153. LL : 'D. MMMM YYYY',
  15154. LLL : 'D. MMMM YYYY HH:mm',
  15155. LLLL : 'dddd [d.] D. MMMM YYYY HH:mm'
  15156. },
  15157. calendar : {
  15158. sameDay : '[I dag kl.] LT',
  15159. nextDay : '[I morgen kl.] LT',
  15160. nextWeek : 'dddd [kl.] LT',
  15161. lastDay : '[I går kl.] LT',
  15162. lastWeek : '[sidste] dddd [kl] LT',
  15163. sameElse : 'L'
  15164. },
  15165. relativeTime : {
  15166. future : 'om %s',
  15167. past : '%s siden',
  15168. s : 'få sekunder',
  15169. m : 'et minut',
  15170. mm : '%d minutter',
  15171. h : 'en time',
  15172. hh : '%d timer',
  15173. d : 'en dag',
  15174. dd : '%d dage',
  15175. M : 'en måned',
  15176. MM : '%d måneder',
  15177. y : 'et år',
  15178. yy : '%d år'
  15179. },
  15180. ordinalParse: /\d{1,2}\./,
  15181. ordinal : '%d.',
  15182. week : {
  15183. dow : 1, // Monday is the first day of the week.
  15184. doy : 4 // The week that contains Jan 4th is the first week of the year.
  15185. }
  15186. });
  15187. return da;
  15188. })));
  15189. /***/ }),
  15190. /* 23 */
  15191. /***/ (function(module, exports, __webpack_require__) {
  15192. //! moment.js locale configuration
  15193. //! locale : German (Austria) [de-at]
  15194. //! author : lluchs : https://github.com/lluchs
  15195. //! author: Menelion Elensúle: https://github.com/Oire
  15196. //! author : Martin Groller : https://github.com/MadMG
  15197. //! author : Mikolaj Dadela : https://github.com/mik01aj
  15198. ;(function (global, factory) {
  15199. true ? factory(__webpack_require__(0)) :
  15200. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15201. factory(global.moment)
  15202. }(this, (function (moment) { 'use strict';
  15203. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  15204. var format = {
  15205. 'm': ['eine Minute', 'einer Minute'],
  15206. 'h': ['eine Stunde', 'einer Stunde'],
  15207. 'd': ['ein Tag', 'einem Tag'],
  15208. 'dd': [number + ' Tage', number + ' Tagen'],
  15209. 'M': ['ein Monat', 'einem Monat'],
  15210. 'MM': [number + ' Monate', number + ' Monaten'],
  15211. 'y': ['ein Jahr', 'einem Jahr'],
  15212. 'yy': [number + ' Jahre', number + ' Jahren']
  15213. };
  15214. return withoutSuffix ? format[key][0] : format[key][1];
  15215. }
  15216. var deAt = moment.defineLocale('de-at', {
  15217. months : 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
  15218. monthsShort : 'Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),
  15219. monthsParseExact : true,
  15220. weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
  15221. weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
  15222. weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
  15223. weekdaysParseExact : true,
  15224. longDateFormat : {
  15225. LT: 'HH:mm',
  15226. LTS: 'HH:mm:ss',
  15227. L : 'DD.MM.YYYY',
  15228. LL : 'D. MMMM YYYY',
  15229. LLL : 'D. MMMM YYYY HH:mm',
  15230. LLLL : 'dddd, D. MMMM YYYY HH:mm'
  15231. },
  15232. calendar : {
  15233. sameDay: '[heute um] LT [Uhr]',
  15234. sameElse: 'L',
  15235. nextDay: '[morgen um] LT [Uhr]',
  15236. nextWeek: 'dddd [um] LT [Uhr]',
  15237. lastDay: '[gestern um] LT [Uhr]',
  15238. lastWeek: '[letzten] dddd [um] LT [Uhr]'
  15239. },
  15240. relativeTime : {
  15241. future : 'in %s',
  15242. past : 'vor %s',
  15243. s : 'ein paar Sekunden',
  15244. m : processRelativeTime,
  15245. mm : '%d Minuten',
  15246. h : processRelativeTime,
  15247. hh : '%d Stunden',
  15248. d : processRelativeTime,
  15249. dd : processRelativeTime,
  15250. M : processRelativeTime,
  15251. MM : processRelativeTime,
  15252. y : processRelativeTime,
  15253. yy : processRelativeTime
  15254. },
  15255. ordinalParse: /\d{1,2}\./,
  15256. ordinal : '%d.',
  15257. week : {
  15258. dow : 1, // Monday is the first day of the week.
  15259. doy : 4 // The week that contains Jan 4th is the first week of the year.
  15260. }
  15261. });
  15262. return deAt;
  15263. })));
  15264. /***/ }),
  15265. /* 24 */
  15266. /***/ (function(module, exports, __webpack_require__) {
  15267. //! moment.js locale configuration
  15268. //! locale : German [de]
  15269. //! author : lluchs : https://github.com/lluchs
  15270. //! author: Menelion Elensúle: https://github.com/Oire
  15271. //! author : Mikolaj Dadela : https://github.com/mik01aj
  15272. ;(function (global, factory) {
  15273. true ? factory(__webpack_require__(0)) :
  15274. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15275. factory(global.moment)
  15276. }(this, (function (moment) { 'use strict';
  15277. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  15278. var format = {
  15279. 'm': ['eine Minute', 'einer Minute'],
  15280. 'h': ['eine Stunde', 'einer Stunde'],
  15281. 'd': ['ein Tag', 'einem Tag'],
  15282. 'dd': [number + ' Tage', number + ' Tagen'],
  15283. 'M': ['ein Monat', 'einem Monat'],
  15284. 'MM': [number + ' Monate', number + ' Monaten'],
  15285. 'y': ['ein Jahr', 'einem Jahr'],
  15286. 'yy': [number + ' Jahre', number + ' Jahren']
  15287. };
  15288. return withoutSuffix ? format[key][0] : format[key][1];
  15289. }
  15290. var de = moment.defineLocale('de', {
  15291. months : 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
  15292. monthsShort : 'Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),
  15293. monthsParseExact : true,
  15294. weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
  15295. weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
  15296. weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
  15297. weekdaysParseExact : true,
  15298. longDateFormat : {
  15299. LT: 'HH:mm',
  15300. LTS: 'HH:mm:ss',
  15301. L : 'DD.MM.YYYY',
  15302. LL : 'D. MMMM YYYY',
  15303. LLL : 'D. MMMM YYYY HH:mm',
  15304. LLLL : 'dddd, D. MMMM YYYY HH:mm'
  15305. },
  15306. calendar : {
  15307. sameDay: '[heute um] LT [Uhr]',
  15308. sameElse: 'L',
  15309. nextDay: '[morgen um] LT [Uhr]',
  15310. nextWeek: 'dddd [um] LT [Uhr]',
  15311. lastDay: '[gestern um] LT [Uhr]',
  15312. lastWeek: '[letzten] dddd [um] LT [Uhr]'
  15313. },
  15314. relativeTime : {
  15315. future : 'in %s',
  15316. past : 'vor %s',
  15317. s : 'ein paar Sekunden',
  15318. m : processRelativeTime,
  15319. mm : '%d Minuten',
  15320. h : processRelativeTime,
  15321. hh : '%d Stunden',
  15322. d : processRelativeTime,
  15323. dd : processRelativeTime,
  15324. M : processRelativeTime,
  15325. MM : processRelativeTime,
  15326. y : processRelativeTime,
  15327. yy : processRelativeTime
  15328. },
  15329. ordinalParse: /\d{1,2}\./,
  15330. ordinal : '%d.',
  15331. week : {
  15332. dow : 1, // Monday is the first day of the week.
  15333. doy : 4 // The week that contains Jan 4th is the first week of the year.
  15334. }
  15335. });
  15336. return de;
  15337. })));
  15338. /***/ }),
  15339. /* 25 */
  15340. /***/ (function(module, exports, __webpack_require__) {
  15341. //! moment.js locale configuration
  15342. //! locale : Maldivian [dv]
  15343. //! author : Jawish Hameed : https://github.com/jawish
  15344. ;(function (global, factory) {
  15345. true ? factory(__webpack_require__(0)) :
  15346. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15347. factory(global.moment)
  15348. }(this, (function (moment) { 'use strict';
  15349. var months = [
  15350. 'ޖެނުއަރީ',
  15351. 'ފެބްރުއަރީ',
  15352. 'މާރިޗު',
  15353. 'އޭޕްރީލު',
  15354. 'މޭ',
  15355. 'ޖޫން',
  15356. 'ޖުލައި',
  15357. 'އޯގަސްޓު',
  15358. 'ސެޕްޓެމްބަރު',
  15359. 'އޮކްޓޯބަރު',
  15360. 'ނޮވެމްބަރު',
  15361. 'ޑިސެމްބަރު'
  15362. ];
  15363. var weekdays = [
  15364. 'އާދިއްތަ',
  15365. 'ހޯމަ',
  15366. 'އަންގާރަ',
  15367. 'ބުދަ',
  15368. 'ބުރާސްފަތި',
  15369. 'ހުކުރު',
  15370. 'ހޮނިހިރު'
  15371. ];
  15372. var dv = moment.defineLocale('dv', {
  15373. months : months,
  15374. monthsShort : months,
  15375. weekdays : weekdays,
  15376. weekdaysShort : weekdays,
  15377. weekdaysMin : 'އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި'.split('_'),
  15378. longDateFormat : {
  15379. LT : 'HH:mm',
  15380. LTS : 'HH:mm:ss',
  15381. L : 'D/M/YYYY',
  15382. LL : 'D MMMM YYYY',
  15383. LLL : 'D MMMM YYYY HH:mm',
  15384. LLLL : 'dddd D MMMM YYYY HH:mm'
  15385. },
  15386. meridiemParse: /މކ|މފ/,
  15387. isPM : function (input) {
  15388. return 'މފ' === input;
  15389. },
  15390. meridiem : function (hour, minute, isLower) {
  15391. if (hour < 12) {
  15392. return 'މކ';
  15393. } else {
  15394. return 'މފ';
  15395. }
  15396. },
  15397. calendar : {
  15398. sameDay : '[މިއަދު] LT',
  15399. nextDay : '[މާދަމާ] LT',
  15400. nextWeek : 'dddd LT',
  15401. lastDay : '[އިއްޔެ] LT',
  15402. lastWeek : '[ފާއިތުވި] dddd LT',
  15403. sameElse : 'L'
  15404. },
  15405. relativeTime : {
  15406. future : 'ތެރޭގައި %s',
  15407. past : 'ކުރިން %s',
  15408. s : 'ސިކުންތުކޮޅެއް',
  15409. m : 'މިނިޓެއް',
  15410. mm : 'މިނިޓު %d',
  15411. h : 'ގަޑިއިރެއް',
  15412. hh : 'ގަޑިއިރު %d',
  15413. d : 'ދުވަހެއް',
  15414. dd : 'ދުވަސް %d',
  15415. M : 'މަހެއް',
  15416. MM : 'މަސް %d',
  15417. y : 'އަހަރެއް',
  15418. yy : 'އަހަރު %d'
  15419. },
  15420. preparse: function (string) {
  15421. return string.replace(/،/g, ',');
  15422. },
  15423. postformat: function (string) {
  15424. return string.replace(/,/g, '،');
  15425. },
  15426. week : {
  15427. dow : 7, // Sunday is the first day of the week.
  15428. doy : 12 // The week that contains Jan 1st is the first week of the year.
  15429. }
  15430. });
  15431. return dv;
  15432. })));
  15433. /***/ }),
  15434. /* 26 */
  15435. /***/ (function(module, exports, __webpack_require__) {
  15436. //! moment.js locale configuration
  15437. //! locale : Greek [el]
  15438. //! author : Aggelos Karalias : https://github.com/mehiel
  15439. ;(function (global, factory) {
  15440. true ? factory(__webpack_require__(0)) :
  15441. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15442. factory(global.moment)
  15443. }(this, (function (moment) { 'use strict';
  15444. function isFunction(input) {
  15445. return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
  15446. }
  15447. var el = moment.defineLocale('el', {
  15448. monthsNominativeEl : 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split('_'),
  15449. monthsGenitiveEl : 'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split('_'),
  15450. months : function (momentToFormat, format) {
  15451. if (/D/.test(format.substring(0, format.indexOf('MMMM')))) { // if there is a day number before 'MMMM'
  15452. return this._monthsGenitiveEl[momentToFormat.month()];
  15453. } else {
  15454. return this._monthsNominativeEl[momentToFormat.month()];
  15455. }
  15456. },
  15457. monthsShort : 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'),
  15458. weekdays : 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split('_'),
  15459. weekdaysShort : 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'),
  15460. weekdaysMin : 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'),
  15461. meridiem : function (hours, minutes, isLower) {
  15462. if (hours > 11) {
  15463. return isLower ? 'μμ' : 'ΜΜ';
  15464. } else {
  15465. return isLower ? 'πμ' : 'ΠΜ';
  15466. }
  15467. },
  15468. isPM : function (input) {
  15469. return ((input + '').toLowerCase()[0] === 'μ');
  15470. },
  15471. meridiemParse : /[ΠΜ]\.?Μ?\.?/i,
  15472. longDateFormat : {
  15473. LT : 'h:mm A',
  15474. LTS : 'h:mm:ss A',
  15475. L : 'DD/MM/YYYY',
  15476. LL : 'D MMMM YYYY',
  15477. LLL : 'D MMMM YYYY h:mm A',
  15478. LLLL : 'dddd, D MMMM YYYY h:mm A'
  15479. },
  15480. calendarEl : {
  15481. sameDay : '[Σήμερα {}] LT',
  15482. nextDay : '[Αύριο {}] LT',
  15483. nextWeek : 'dddd [{}] LT',
  15484. lastDay : '[Χθες {}] LT',
  15485. lastWeek : function () {
  15486. switch (this.day()) {
  15487. case 6:
  15488. return '[το προηγούμενο] dddd [{}] LT';
  15489. default:
  15490. return '[την προηγούμενη] dddd [{}] LT';
  15491. }
  15492. },
  15493. sameElse : 'L'
  15494. },
  15495. calendar : function (key, mom) {
  15496. var output = this._calendarEl[key],
  15497. hours = mom && mom.hours();
  15498. if (isFunction(output)) {
  15499. output = output.apply(mom);
  15500. }
  15501. return output.replace('{}', (hours % 12 === 1 ? 'στη' : 'στις'));
  15502. },
  15503. relativeTime : {
  15504. future : 'σε %s',
  15505. past : '%s πριν',
  15506. s : 'λίγα δευτερόλεπτα',
  15507. m : 'ένα λεπτό',
  15508. mm : '%d λεπτά',
  15509. h : 'μία ώρα',
  15510. hh : '%d ώρες',
  15511. d : 'μία μέρα',
  15512. dd : '%d μέρες',
  15513. M : 'ένας μήνας',
  15514. MM : '%d μήνες',
  15515. y : 'ένας χρόνος',
  15516. yy : '%d χρόνια'
  15517. },
  15518. ordinalParse: /\d{1,2}η/,
  15519. ordinal: '%dη',
  15520. week : {
  15521. dow : 1, // Monday is the first day of the week.
  15522. doy : 4 // The week that contains Jan 4st is the first week of the year.
  15523. }
  15524. });
  15525. return el;
  15526. })));
  15527. /***/ }),
  15528. /* 27 */
  15529. /***/ (function(module, exports, __webpack_require__) {
  15530. //! moment.js locale configuration
  15531. //! locale : English (Australia) [en-au]
  15532. //! author : Jared Morse : https://github.com/jarcoal
  15533. ;(function (global, factory) {
  15534. true ? factory(__webpack_require__(0)) :
  15535. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15536. factory(global.moment)
  15537. }(this, (function (moment) { 'use strict';
  15538. var enAu = moment.defineLocale('en-au', {
  15539. months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
  15540. monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  15541. weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
  15542. weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  15543. weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  15544. longDateFormat : {
  15545. LT : 'h:mm A',
  15546. LTS : 'h:mm:ss A',
  15547. L : 'DD/MM/YYYY',
  15548. LL : 'D MMMM YYYY',
  15549. LLL : 'D MMMM YYYY h:mm A',
  15550. LLLL : 'dddd, D MMMM YYYY h:mm A'
  15551. },
  15552. calendar : {
  15553. sameDay : '[Today at] LT',
  15554. nextDay : '[Tomorrow at] LT',
  15555. nextWeek : 'dddd [at] LT',
  15556. lastDay : '[Yesterday at] LT',
  15557. lastWeek : '[Last] dddd [at] LT',
  15558. sameElse : 'L'
  15559. },
  15560. relativeTime : {
  15561. future : 'in %s',
  15562. past : '%s ago',
  15563. s : 'a few seconds',
  15564. m : 'a minute',
  15565. mm : '%d minutes',
  15566. h : 'an hour',
  15567. hh : '%d hours',
  15568. d : 'a day',
  15569. dd : '%d days',
  15570. M : 'a month',
  15571. MM : '%d months',
  15572. y : 'a year',
  15573. yy : '%d years'
  15574. },
  15575. ordinalParse: /\d{1,2}(st|nd|rd|th)/,
  15576. ordinal : function (number) {
  15577. var b = number % 10,
  15578. output = (~~(number % 100 / 10) === 1) ? 'th' :
  15579. (b === 1) ? 'st' :
  15580. (b === 2) ? 'nd' :
  15581. (b === 3) ? 'rd' : 'th';
  15582. return number + output;
  15583. },
  15584. week : {
  15585. dow : 1, // Monday is the first day of the week.
  15586. doy : 4 // The week that contains Jan 4th is the first week of the year.
  15587. }
  15588. });
  15589. return enAu;
  15590. })));
  15591. /***/ }),
  15592. /* 28 */
  15593. /***/ (function(module, exports, __webpack_require__) {
  15594. //! moment.js locale configuration
  15595. //! locale : English (Canada) [en-ca]
  15596. //! author : Jonathan Abourbih : https://github.com/jonbca
  15597. ;(function (global, factory) {
  15598. true ? factory(__webpack_require__(0)) :
  15599. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15600. factory(global.moment)
  15601. }(this, (function (moment) { 'use strict';
  15602. var enCa = moment.defineLocale('en-ca', {
  15603. months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
  15604. monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  15605. weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
  15606. weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  15607. weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  15608. longDateFormat : {
  15609. LT : 'h:mm A',
  15610. LTS : 'h:mm:ss A',
  15611. L : 'YYYY-MM-DD',
  15612. LL : 'MMMM D, YYYY',
  15613. LLL : 'MMMM D, YYYY h:mm A',
  15614. LLLL : 'dddd, MMMM D, YYYY h:mm A'
  15615. },
  15616. calendar : {
  15617. sameDay : '[Today at] LT',
  15618. nextDay : '[Tomorrow at] LT',
  15619. nextWeek : 'dddd [at] LT',
  15620. lastDay : '[Yesterday at] LT',
  15621. lastWeek : '[Last] dddd [at] LT',
  15622. sameElse : 'L'
  15623. },
  15624. relativeTime : {
  15625. future : 'in %s',
  15626. past : '%s ago',
  15627. s : 'a few seconds',
  15628. m : 'a minute',
  15629. mm : '%d minutes',
  15630. h : 'an hour',
  15631. hh : '%d hours',
  15632. d : 'a day',
  15633. dd : '%d days',
  15634. M : 'a month',
  15635. MM : '%d months',
  15636. y : 'a year',
  15637. yy : '%d years'
  15638. },
  15639. ordinalParse: /\d{1,2}(st|nd|rd|th)/,
  15640. ordinal : function (number) {
  15641. var b = number % 10,
  15642. output = (~~(number % 100 / 10) === 1) ? 'th' :
  15643. (b === 1) ? 'st' :
  15644. (b === 2) ? 'nd' :
  15645. (b === 3) ? 'rd' : 'th';
  15646. return number + output;
  15647. }
  15648. });
  15649. return enCa;
  15650. })));
  15651. /***/ }),
  15652. /* 29 */
  15653. /***/ (function(module, exports, __webpack_require__) {
  15654. //! moment.js locale configuration
  15655. //! locale : English (United Kingdom) [en-gb]
  15656. //! author : Chris Gedrim : https://github.com/chrisgedrim
  15657. ;(function (global, factory) {
  15658. true ? factory(__webpack_require__(0)) :
  15659. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15660. factory(global.moment)
  15661. }(this, (function (moment) { 'use strict';
  15662. var enGb = moment.defineLocale('en-gb', {
  15663. months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
  15664. monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  15665. weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
  15666. weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  15667. weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  15668. longDateFormat : {
  15669. LT : 'HH:mm',
  15670. LTS : 'HH:mm:ss',
  15671. L : 'DD/MM/YYYY',
  15672. LL : 'D MMMM YYYY',
  15673. LLL : 'D MMMM YYYY HH:mm',
  15674. LLLL : 'dddd, D MMMM YYYY HH:mm'
  15675. },
  15676. calendar : {
  15677. sameDay : '[Today at] LT',
  15678. nextDay : '[Tomorrow at] LT',
  15679. nextWeek : 'dddd [at] LT',
  15680. lastDay : '[Yesterday at] LT',
  15681. lastWeek : '[Last] dddd [at] LT',
  15682. sameElse : 'L'
  15683. },
  15684. relativeTime : {
  15685. future : 'in %s',
  15686. past : '%s ago',
  15687. s : 'a few seconds',
  15688. m : 'a minute',
  15689. mm : '%d minutes',
  15690. h : 'an hour',
  15691. hh : '%d hours',
  15692. d : 'a day',
  15693. dd : '%d days',
  15694. M : 'a month',
  15695. MM : '%d months',
  15696. y : 'a year',
  15697. yy : '%d years'
  15698. },
  15699. ordinalParse: /\d{1,2}(st|nd|rd|th)/,
  15700. ordinal : function (number) {
  15701. var b = number % 10,
  15702. output = (~~(number % 100 / 10) === 1) ? 'th' :
  15703. (b === 1) ? 'st' :
  15704. (b === 2) ? 'nd' :
  15705. (b === 3) ? 'rd' : 'th';
  15706. return number + output;
  15707. },
  15708. week : {
  15709. dow : 1, // Monday is the first day of the week.
  15710. doy : 4 // The week that contains Jan 4th is the first week of the year.
  15711. }
  15712. });
  15713. return enGb;
  15714. })));
  15715. /***/ }),
  15716. /* 30 */
  15717. /***/ (function(module, exports, __webpack_require__) {
  15718. //! moment.js locale configuration
  15719. //! locale : English (Ireland) [en-ie]
  15720. //! author : Chris Cartlidge : https://github.com/chriscartlidge
  15721. ;(function (global, factory) {
  15722. true ? factory(__webpack_require__(0)) :
  15723. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15724. factory(global.moment)
  15725. }(this, (function (moment) { 'use strict';
  15726. var enIe = moment.defineLocale('en-ie', {
  15727. months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
  15728. monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  15729. weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
  15730. weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  15731. weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  15732. longDateFormat : {
  15733. LT : 'HH:mm',
  15734. LTS : 'HH:mm:ss',
  15735. L : 'DD-MM-YYYY',
  15736. LL : 'D MMMM YYYY',
  15737. LLL : 'D MMMM YYYY HH:mm',
  15738. LLLL : 'dddd D MMMM YYYY HH:mm'
  15739. },
  15740. calendar : {
  15741. sameDay : '[Today at] LT',
  15742. nextDay : '[Tomorrow at] LT',
  15743. nextWeek : 'dddd [at] LT',
  15744. lastDay : '[Yesterday at] LT',
  15745. lastWeek : '[Last] dddd [at] LT',
  15746. sameElse : 'L'
  15747. },
  15748. relativeTime : {
  15749. future : 'in %s',
  15750. past : '%s ago',
  15751. s : 'a few seconds',
  15752. m : 'a minute',
  15753. mm : '%d minutes',
  15754. h : 'an hour',
  15755. hh : '%d hours',
  15756. d : 'a day',
  15757. dd : '%d days',
  15758. M : 'a month',
  15759. MM : '%d months',
  15760. y : 'a year',
  15761. yy : '%d years'
  15762. },
  15763. ordinalParse: /\d{1,2}(st|nd|rd|th)/,
  15764. ordinal : function (number) {
  15765. var b = number % 10,
  15766. output = (~~(number % 100 / 10) === 1) ? 'th' :
  15767. (b === 1) ? 'st' :
  15768. (b === 2) ? 'nd' :
  15769. (b === 3) ? 'rd' : 'th';
  15770. return number + output;
  15771. },
  15772. week : {
  15773. dow : 1, // Monday is the first day of the week.
  15774. doy : 4 // The week that contains Jan 4th is the first week of the year.
  15775. }
  15776. });
  15777. return enIe;
  15778. })));
  15779. /***/ }),
  15780. /* 31 */
  15781. /***/ (function(module, exports, __webpack_require__) {
  15782. //! moment.js locale configuration
  15783. //! locale : English (New Zealand) [en-nz]
  15784. //! author : Luke McGregor : https://github.com/lukemcgregor
  15785. ;(function (global, factory) {
  15786. true ? factory(__webpack_require__(0)) :
  15787. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15788. factory(global.moment)
  15789. }(this, (function (moment) { 'use strict';
  15790. var enNz = moment.defineLocale('en-nz', {
  15791. months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
  15792. monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  15793. weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
  15794. weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  15795. weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  15796. longDateFormat : {
  15797. LT : 'h:mm A',
  15798. LTS : 'h:mm:ss A',
  15799. L : 'DD/MM/YYYY',
  15800. LL : 'D MMMM YYYY',
  15801. LLL : 'D MMMM YYYY h:mm A',
  15802. LLLL : 'dddd, D MMMM YYYY h:mm A'
  15803. },
  15804. calendar : {
  15805. sameDay : '[Today at] LT',
  15806. nextDay : '[Tomorrow at] LT',
  15807. nextWeek : 'dddd [at] LT',
  15808. lastDay : '[Yesterday at] LT',
  15809. lastWeek : '[Last] dddd [at] LT',
  15810. sameElse : 'L'
  15811. },
  15812. relativeTime : {
  15813. future : 'in %s',
  15814. past : '%s ago',
  15815. s : 'a few seconds',
  15816. m : 'a minute',
  15817. mm : '%d minutes',
  15818. h : 'an hour',
  15819. hh : '%d hours',
  15820. d : 'a day',
  15821. dd : '%d days',
  15822. M : 'a month',
  15823. MM : '%d months',
  15824. y : 'a year',
  15825. yy : '%d years'
  15826. },
  15827. ordinalParse: /\d{1,2}(st|nd|rd|th)/,
  15828. ordinal : function (number) {
  15829. var b = number % 10,
  15830. output = (~~(number % 100 / 10) === 1) ? 'th' :
  15831. (b === 1) ? 'st' :
  15832. (b === 2) ? 'nd' :
  15833. (b === 3) ? 'rd' : 'th';
  15834. return number + output;
  15835. },
  15836. week : {
  15837. dow : 1, // Monday is the first day of the week.
  15838. doy : 4 // The week that contains Jan 4th is the first week of the year.
  15839. }
  15840. });
  15841. return enNz;
  15842. })));
  15843. /***/ }),
  15844. /* 32 */
  15845. /***/ (function(module, exports, __webpack_require__) {
  15846. //! moment.js locale configuration
  15847. //! locale : Esperanto [eo]
  15848. //! author : Colin Dean : https://github.com/colindean
  15849. //! komento: Mi estas malcerta se mi korekte traktis akuzativojn en tiu traduko.
  15850. //! Se ne, bonvolu korekti kaj avizi min por ke mi povas lerni!
  15851. ;(function (global, factory) {
  15852. true ? factory(__webpack_require__(0)) :
  15853. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15854. factory(global.moment)
  15855. }(this, (function (moment) { 'use strict';
  15856. var eo = moment.defineLocale('eo', {
  15857. months : 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split('_'),
  15858. monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec'.split('_'),
  15859. weekdays : 'Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato'.split('_'),
  15860. weekdaysShort : 'Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab'.split('_'),
  15861. weekdaysMin : 'Di_Lu_Ma_Me_Ĵa_Ve_Sa'.split('_'),
  15862. longDateFormat : {
  15863. LT : 'HH:mm',
  15864. LTS : 'HH:mm:ss',
  15865. L : 'YYYY-MM-DD',
  15866. LL : 'D[-an de] MMMM, YYYY',
  15867. LLL : 'D[-an de] MMMM, YYYY HH:mm',
  15868. LLLL : 'dddd, [la] D[-an de] MMMM, YYYY HH:mm'
  15869. },
  15870. meridiemParse: /[ap]\.t\.m/i,
  15871. isPM: function (input) {
  15872. return input.charAt(0).toLowerCase() === 'p';
  15873. },
  15874. meridiem : function (hours, minutes, isLower) {
  15875. if (hours > 11) {
  15876. return isLower ? 'p.t.m.' : 'P.T.M.';
  15877. } else {
  15878. return isLower ? 'a.t.m.' : 'A.T.M.';
  15879. }
  15880. },
  15881. calendar : {
  15882. sameDay : '[Hodiaŭ je] LT',
  15883. nextDay : '[Morgaŭ je] LT',
  15884. nextWeek : 'dddd [je] LT',
  15885. lastDay : '[Hieraŭ je] LT',
  15886. lastWeek : '[pasinta] dddd [je] LT',
  15887. sameElse : 'L'
  15888. },
  15889. relativeTime : {
  15890. future : 'je %s',
  15891. past : 'antaŭ %s',
  15892. s : 'sekundoj',
  15893. m : 'minuto',
  15894. mm : '%d minutoj',
  15895. h : 'horo',
  15896. hh : '%d horoj',
  15897. d : 'tago',//ne 'diurno', ĉar estas uzita por proksimumo
  15898. dd : '%d tagoj',
  15899. M : 'monato',
  15900. MM : '%d monatoj',
  15901. y : 'jaro',
  15902. yy : '%d jaroj'
  15903. },
  15904. ordinalParse: /\d{1,2}a/,
  15905. ordinal : '%da',
  15906. week : {
  15907. dow : 1, // Monday is the first day of the week.
  15908. doy : 7 // The week that contains Jan 1st is the first week of the year.
  15909. }
  15910. });
  15911. return eo;
  15912. })));
  15913. /***/ }),
  15914. /* 33 */
  15915. /***/ (function(module, exports, __webpack_require__) {
  15916. //! moment.js locale configuration
  15917. //! locale : Spanish (Dominican Republic) [es-do]
  15918. ;(function (global, factory) {
  15919. true ? factory(__webpack_require__(0)) :
  15920. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15921. factory(global.moment)
  15922. }(this, (function (moment) { 'use strict';
  15923. var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_');
  15924. var monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');
  15925. var esDo = moment.defineLocale('es-do', {
  15926. months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),
  15927. monthsShort : function (m, format) {
  15928. if (/-MMM-/.test(format)) {
  15929. return monthsShort[m.month()];
  15930. } else {
  15931. return monthsShortDot[m.month()];
  15932. }
  15933. },
  15934. monthsParseExact : true,
  15935. weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
  15936. weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
  15937. weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'),
  15938. weekdaysParseExact : true,
  15939. longDateFormat : {
  15940. LT : 'h:mm A',
  15941. LTS : 'h:mm:ss A',
  15942. L : 'DD/MM/YYYY',
  15943. LL : 'D [de] MMMM [de] YYYY',
  15944. LLL : 'D [de] MMMM [de] YYYY h:mm A',
  15945. LLLL : 'dddd, D [de] MMMM [de] YYYY h:mm A'
  15946. },
  15947. calendar : {
  15948. sameDay : function () {
  15949. return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  15950. },
  15951. nextDay : function () {
  15952. return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  15953. },
  15954. nextWeek : function () {
  15955. return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  15956. },
  15957. lastDay : function () {
  15958. return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  15959. },
  15960. lastWeek : function () {
  15961. return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  15962. },
  15963. sameElse : 'L'
  15964. },
  15965. relativeTime : {
  15966. future : 'en %s',
  15967. past : 'hace %s',
  15968. s : 'unos segundos',
  15969. m : 'un minuto',
  15970. mm : '%d minutos',
  15971. h : 'una hora',
  15972. hh : '%d horas',
  15973. d : 'un día',
  15974. dd : '%d días',
  15975. M : 'un mes',
  15976. MM : '%d meses',
  15977. y : 'un año',
  15978. yy : '%d años'
  15979. },
  15980. ordinalParse : /\d{1,2}º/,
  15981. ordinal : '%dº',
  15982. week : {
  15983. dow : 1, // Monday is the first day of the week.
  15984. doy : 4 // The week that contains Jan 4th is the first week of the year.
  15985. }
  15986. });
  15987. return esDo;
  15988. })));
  15989. /***/ }),
  15990. /* 34 */
  15991. /***/ (function(module, exports, __webpack_require__) {
  15992. //! moment.js locale configuration
  15993. //! locale : Spanish [es]
  15994. //! author : Julio Napurí : https://github.com/julionc
  15995. ;(function (global, factory) {
  15996. true ? factory(__webpack_require__(0)) :
  15997. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15998. factory(global.moment)
  15999. }(this, (function (moment) { 'use strict';
  16000. var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_');
  16001. var monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');
  16002. var es = moment.defineLocale('es', {
  16003. months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),
  16004. monthsShort : function (m, format) {
  16005. if (/-MMM-/.test(format)) {
  16006. return monthsShort[m.month()];
  16007. } else {
  16008. return monthsShortDot[m.month()];
  16009. }
  16010. },
  16011. monthsParseExact : true,
  16012. weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
  16013. weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
  16014. weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'),
  16015. weekdaysParseExact : true,
  16016. longDateFormat : {
  16017. LT : 'H:mm',
  16018. LTS : 'H:mm:ss',
  16019. L : 'DD/MM/YYYY',
  16020. LL : 'D [de] MMMM [de] YYYY',
  16021. LLL : 'D [de] MMMM [de] YYYY H:mm',
  16022. LLLL : 'dddd, D [de] MMMM [de] YYYY H:mm'
  16023. },
  16024. calendar : {
  16025. sameDay : function () {
  16026. return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  16027. },
  16028. nextDay : function () {
  16029. return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  16030. },
  16031. nextWeek : function () {
  16032. return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  16033. },
  16034. lastDay : function () {
  16035. return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  16036. },
  16037. lastWeek : function () {
  16038. return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  16039. },
  16040. sameElse : 'L'
  16041. },
  16042. relativeTime : {
  16043. future : 'en %s',
  16044. past : 'hace %s',
  16045. s : 'unos segundos',
  16046. m : 'un minuto',
  16047. mm : '%d minutos',
  16048. h : 'una hora',
  16049. hh : '%d horas',
  16050. d : 'un día',
  16051. dd : '%d días',
  16052. M : 'un mes',
  16053. MM : '%d meses',
  16054. y : 'un año',
  16055. yy : '%d años'
  16056. },
  16057. ordinalParse : /\d{1,2}º/,
  16058. ordinal : '%dº',
  16059. week : {
  16060. dow : 1, // Monday is the first day of the week.
  16061. doy : 4 // The week that contains Jan 4th is the first week of the year.
  16062. }
  16063. });
  16064. return es;
  16065. })));
  16066. /***/ }),
  16067. /* 35 */
  16068. /***/ (function(module, exports, __webpack_require__) {
  16069. //! moment.js locale configuration
  16070. //! locale : Estonian [et]
  16071. //! author : Henry Kehlmann : https://github.com/madhenry
  16072. //! improvements : Illimar Tambek : https://github.com/ragulka
  16073. ;(function (global, factory) {
  16074. true ? factory(__webpack_require__(0)) :
  16075. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  16076. factory(global.moment)
  16077. }(this, (function (moment) { 'use strict';
  16078. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  16079. var format = {
  16080. 's' : ['mõne sekundi', 'mõni sekund', 'paar sekundit'],
  16081. 'm' : ['ühe minuti', 'üks minut'],
  16082. 'mm': [number + ' minuti', number + ' minutit'],
  16083. 'h' : ['ühe tunni', 'tund aega', 'üks tund'],
  16084. 'hh': [number + ' tunni', number + ' tundi'],
  16085. 'd' : ['ühe päeva', 'üks päev'],
  16086. 'M' : ['kuu aja', 'kuu aega', 'üks kuu'],
  16087. 'MM': [number + ' kuu', number + ' kuud'],
  16088. 'y' : ['ühe aasta', 'aasta', 'üks aasta'],
  16089. 'yy': [number + ' aasta', number + ' aastat']
  16090. };
  16091. if (withoutSuffix) {
  16092. return format[key][2] ? format[key][2] : format[key][1];
  16093. }
  16094. return isFuture ? format[key][0] : format[key][1];
  16095. }
  16096. var et = moment.defineLocale('et', {
  16097. months : 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split('_'),
  16098. monthsShort : 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split('_'),
  16099. weekdays : 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split('_'),
  16100. weekdaysShort : 'P_E_T_K_N_R_L'.split('_'),
  16101. weekdaysMin : 'P_E_T_K_N_R_L'.split('_'),
  16102. longDateFormat : {
  16103. LT : 'H:mm',
  16104. LTS : 'H:mm:ss',
  16105. L : 'DD.MM.YYYY',
  16106. LL : 'D. MMMM YYYY',
  16107. LLL : 'D. MMMM YYYY H:mm',
  16108. LLLL : 'dddd, D. MMMM YYYY H:mm'
  16109. },
  16110. calendar : {
  16111. sameDay : '[Täna,] LT',
  16112. nextDay : '[Homme,] LT',
  16113. nextWeek : '[Järgmine] dddd LT',
  16114. lastDay : '[Eile,] LT',
  16115. lastWeek : '[Eelmine] dddd LT',
  16116. sameElse : 'L'
  16117. },
  16118. relativeTime : {
  16119. future : '%s pärast',
  16120. past : '%s tagasi',
  16121. s : processRelativeTime,
  16122. m : processRelativeTime,
  16123. mm : processRelativeTime,
  16124. h : processRelativeTime,
  16125. hh : processRelativeTime,
  16126. d : processRelativeTime,
  16127. dd : '%d päeva',
  16128. M : processRelativeTime,
  16129. MM : processRelativeTime,
  16130. y : processRelativeTime,
  16131. yy : processRelativeTime
  16132. },
  16133. ordinalParse: /\d{1,2}\./,
  16134. ordinal : '%d.',
  16135. week : {
  16136. dow : 1, // Monday is the first day of the week.
  16137. doy : 4 // The week that contains Jan 4th is the first week of the year.
  16138. }
  16139. });
  16140. return et;
  16141. })));
  16142. /***/ }),
  16143. /* 36 */
  16144. /***/ (function(module, exports, __webpack_require__) {
  16145. //! moment.js locale configuration
  16146. //! locale : Basque [eu]
  16147. //! author : Eneko Illarramendi : https://github.com/eillarra
  16148. ;(function (global, factory) {
  16149. true ? factory(__webpack_require__(0)) :
  16150. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  16151. factory(global.moment)
  16152. }(this, (function (moment) { 'use strict';
  16153. var eu = moment.defineLocale('eu', {
  16154. months : 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split('_'),
  16155. monthsShort : 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split('_'),
  16156. monthsParseExact : true,
  16157. weekdays : 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split('_'),
  16158. weekdaysShort : 'ig._al._ar._az._og._ol._lr.'.split('_'),
  16159. weekdaysMin : 'ig_al_ar_az_og_ol_lr'.split('_'),
  16160. weekdaysParseExact : true,
  16161. longDateFormat : {
  16162. LT : 'HH:mm',
  16163. LTS : 'HH:mm:ss',
  16164. L : 'YYYY-MM-DD',
  16165. LL : 'YYYY[ko] MMMM[ren] D[a]',
  16166. LLL : 'YYYY[ko] MMMM[ren] D[a] HH:mm',
  16167. LLLL : 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm',
  16168. l : 'YYYY-M-D',
  16169. ll : 'YYYY[ko] MMM D[a]',
  16170. lll : 'YYYY[ko] MMM D[a] HH:mm',
  16171. llll : 'ddd, YYYY[ko] MMM D[a] HH:mm'
  16172. },
  16173. calendar : {
  16174. sameDay : '[gaur] LT[etan]',
  16175. nextDay : '[bihar] LT[etan]',
  16176. nextWeek : 'dddd LT[etan]',
  16177. lastDay : '[atzo] LT[etan]',
  16178. lastWeek : '[aurreko] dddd LT[etan]',
  16179. sameElse : 'L'
  16180. },
  16181. relativeTime : {
  16182. future : '%s barru',
  16183. past : 'duela %s',
  16184. s : 'segundo batzuk',
  16185. m : 'minutu bat',
  16186. mm : '%d minutu',
  16187. h : 'ordu bat',
  16188. hh : '%d ordu',
  16189. d : 'egun bat',
  16190. dd : '%d egun',
  16191. M : 'hilabete bat',
  16192. MM : '%d hilabete',
  16193. y : 'urte bat',
  16194. yy : '%d urte'
  16195. },
  16196. ordinalParse: /\d{1,2}\./,
  16197. ordinal : '%d.',
  16198. week : {
  16199. dow : 1, // Monday is the first day of the week.
  16200. doy : 7 // The week that contains Jan 1st is the first week of the year.
  16201. }
  16202. });
  16203. return eu;
  16204. })));
  16205. /***/ }),
  16206. /* 37 */
  16207. /***/ (function(module, exports, __webpack_require__) {
  16208. //! moment.js locale configuration
  16209. //! locale : Persian [fa]
  16210. //! author : Ebrahim Byagowi : https://github.com/ebraminio
  16211. ;(function (global, factory) {
  16212. true ? factory(__webpack_require__(0)) :
  16213. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  16214. factory(global.moment)
  16215. }(this, (function (moment) { 'use strict';
  16216. var symbolMap = {
  16217. '1': '۱',
  16218. '2': '۲',
  16219. '3': '۳',
  16220. '4': '۴',
  16221. '5': '۵',
  16222. '6': '۶',
  16223. '7': '۷',
  16224. '8': '۸',
  16225. '9': '۹',
  16226. '0': '۰'
  16227. };
  16228. var numberMap = {
  16229. '۱': '1',
  16230. '۲': '2',
  16231. '۳': '3',
  16232. '۴': '4',
  16233. '۵': '5',
  16234. '۶': '6',
  16235. '۷': '7',
  16236. '۸': '8',
  16237. '۹': '9',
  16238. '۰': '0'
  16239. };
  16240. var fa = moment.defineLocale('fa', {
  16241. months : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),
  16242. monthsShort : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),
  16243. weekdays : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'),
  16244. weekdaysShort : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'),
  16245. weekdaysMin : 'ی_د_س_چ_پ_ج_ش'.split('_'),
  16246. weekdaysParseExact : true,
  16247. longDateFormat : {
  16248. LT : 'HH:mm',
  16249. LTS : 'HH:mm:ss',
  16250. L : 'DD/MM/YYYY',
  16251. LL : 'D MMMM YYYY',
  16252. LLL : 'D MMMM YYYY HH:mm',
  16253. LLLL : 'dddd, D MMMM YYYY HH:mm'
  16254. },
  16255. meridiemParse: /قبل از ظهر|بعد از ظهر/,
  16256. isPM: function (input) {
  16257. return /بعد از ظهر/.test(input);
  16258. },
  16259. meridiem : function (hour, minute, isLower) {
  16260. if (hour < 12) {
  16261. return 'قبل از ظهر';
  16262. } else {
  16263. return 'بعد از ظهر';
  16264. }
  16265. },
  16266. calendar : {
  16267. sameDay : '[امروز ساعت] LT',
  16268. nextDay : '[فردا ساعت] LT',
  16269. nextWeek : 'dddd [ساعت] LT',
  16270. lastDay : '[دیروز ساعت] LT',
  16271. lastWeek : 'dddd [پیش] [ساعت] LT',
  16272. sameElse : 'L'
  16273. },
  16274. relativeTime : {
  16275. future : 'در %s',
  16276. past : '%s پیش',
  16277. s : 'چندین ثانیه',
  16278. m : 'یک دقیقه',
  16279. mm : '%d دقیقه',
  16280. h : 'یک ساعت',
  16281. hh : '%d ساعت',
  16282. d : 'یک روز',
  16283. dd : '%d روز',
  16284. M : 'یک ماه',
  16285. MM : '%d ماه',
  16286. y : 'یک سال',
  16287. yy : '%d سال'
  16288. },
  16289. preparse: function (string) {
  16290. return string.replace(/[۰-۹]/g, function (match) {
  16291. return numberMap[match];
  16292. }).replace(/،/g, ',');
  16293. },
  16294. postformat: function (string) {
  16295. return string.replace(/\d/g, function (match) {
  16296. return symbolMap[match];
  16297. }).replace(/,/g, '،');
  16298. },
  16299. ordinalParse: /\d{1,2}م/,
  16300. ordinal : '%dم',
  16301. week : {
  16302. dow : 6, // Saturday is the first day of the week.
  16303. doy : 12 // The week that contains Jan 1st is the first week of the year.
  16304. }
  16305. });
  16306. return fa;
  16307. })));
  16308. /***/ }),
  16309. /* 38 */
  16310. /***/ (function(module, exports, __webpack_require__) {
  16311. //! moment.js locale configuration
  16312. //! locale : Finnish [fi]
  16313. //! author : Tarmo Aidantausta : https://github.com/bleadof
  16314. ;(function (global, factory) {
  16315. true ? factory(__webpack_require__(0)) :
  16316. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  16317. factory(global.moment)
  16318. }(this, (function (moment) { 'use strict';
  16319. var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(' ');
  16320. var numbersFuture = [
  16321. 'nolla', 'yhden', 'kahden', 'kolmen', 'neljän', 'viiden', 'kuuden',
  16322. numbersPast[7], numbersPast[8], numbersPast[9]
  16323. ];
  16324. function translate(number, withoutSuffix, key, isFuture) {
  16325. var result = '';
  16326. switch (key) {
  16327. case 's':
  16328. return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';
  16329. case 'm':
  16330. return isFuture ? 'minuutin' : 'minuutti';
  16331. case 'mm':
  16332. result = isFuture ? 'minuutin' : 'minuuttia';
  16333. break;
  16334. case 'h':
  16335. return isFuture ? 'tunnin' : 'tunti';
  16336. case 'hh':
  16337. result = isFuture ? 'tunnin' : 'tuntia';
  16338. break;
  16339. case 'd':
  16340. return isFuture ? 'päivän' : 'päivä';
  16341. case 'dd':
  16342. result = isFuture ? 'päivän' : 'päivää';
  16343. break;
  16344. case 'M':
  16345. return isFuture ? 'kuukauden' : 'kuukausi';
  16346. case 'MM':
  16347. result = isFuture ? 'kuukauden' : 'kuukautta';
  16348. break;
  16349. case 'y':
  16350. return isFuture ? 'vuoden' : 'vuosi';
  16351. case 'yy':
  16352. result = isFuture ? 'vuoden' : 'vuotta';
  16353. break;
  16354. }
  16355. result = verbalNumber(number, isFuture) + ' ' + result;
  16356. return result;
  16357. }
  16358. function verbalNumber(number, isFuture) {
  16359. return number < 10 ? (isFuture ? numbersFuture[number] : numbersPast[number]) : number;
  16360. }
  16361. var fi = moment.defineLocale('fi', {
  16362. months : 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split('_'),
  16363. monthsShort : 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split('_'),
  16364. weekdays : 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split('_'),
  16365. weekdaysShort : 'su_ma_ti_ke_to_pe_la'.split('_'),
  16366. weekdaysMin : 'su_ma_ti_ke_to_pe_la'.split('_'),
  16367. longDateFormat : {
  16368. LT : 'HH.mm',
  16369. LTS : 'HH.mm.ss',
  16370. L : 'DD.MM.YYYY',
  16371. LL : 'Do MMMM[ta] YYYY',
  16372. LLL : 'Do MMMM[ta] YYYY, [klo] HH.mm',
  16373. LLLL : 'dddd, Do MMMM[ta] YYYY, [klo] HH.mm',
  16374. l : 'D.M.YYYY',
  16375. ll : 'Do MMM YYYY',
  16376. lll : 'Do MMM YYYY, [klo] HH.mm',
  16377. llll : 'ddd, Do MMM YYYY, [klo] HH.mm'
  16378. },
  16379. calendar : {
  16380. sameDay : '[tänään] [klo] LT',
  16381. nextDay : '[huomenna] [klo] LT',
  16382. nextWeek : 'dddd [klo] LT',
  16383. lastDay : '[eilen] [klo] LT',
  16384. lastWeek : '[viime] dddd[na] [klo] LT',
  16385. sameElse : 'L'
  16386. },
  16387. relativeTime : {
  16388. future : '%s päästä',
  16389. past : '%s sitten',
  16390. s : translate,
  16391. m : translate,
  16392. mm : translate,
  16393. h : translate,
  16394. hh : translate,
  16395. d : translate,
  16396. dd : translate,
  16397. M : translate,
  16398. MM : translate,
  16399. y : translate,
  16400. yy : translate
  16401. },
  16402. ordinalParse: /\d{1,2}\./,
  16403. ordinal : '%d.',
  16404. week : {
  16405. dow : 1, // Monday is the first day of the week.
  16406. doy : 4 // The week that contains Jan 4th is the first week of the year.
  16407. }
  16408. });
  16409. return fi;
  16410. })));
  16411. /***/ }),
  16412. /* 39 */
  16413. /***/ (function(module, exports, __webpack_require__) {
  16414. //! moment.js locale configuration
  16415. //! locale : Faroese [fo]
  16416. //! author : Ragnar Johannesen : https://github.com/ragnar123
  16417. ;(function (global, factory) {
  16418. true ? factory(__webpack_require__(0)) :
  16419. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  16420. factory(global.moment)
  16421. }(this, (function (moment) { 'use strict';
  16422. var fo = moment.defineLocale('fo', {
  16423. months : 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
  16424. monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),
  16425. weekdays : 'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split('_'),
  16426. weekdaysShort : 'sun_mán_týs_mik_hós_frí_ley'.split('_'),
  16427. weekdaysMin : 'su_má_tý_mi_hó_fr_le'.split('_'),
  16428. longDateFormat : {
  16429. LT : 'HH:mm',
  16430. LTS : 'HH:mm:ss',
  16431. L : 'DD/MM/YYYY',
  16432. LL : 'D MMMM YYYY',
  16433. LLL : 'D MMMM YYYY HH:mm',
  16434. LLLL : 'dddd D. MMMM, YYYY HH:mm'
  16435. },
  16436. calendar : {
  16437. sameDay : '[Í dag kl.] LT',
  16438. nextDay : '[Í morgin kl.] LT',
  16439. nextWeek : 'dddd [kl.] LT',
  16440. lastDay : '[Í gjár kl.] LT',
  16441. lastWeek : '[síðstu] dddd [kl] LT',
  16442. sameElse : 'L'
  16443. },
  16444. relativeTime : {
  16445. future : 'um %s',
  16446. past : '%s síðani',
  16447. s : 'fá sekund',
  16448. m : 'ein minutt',
  16449. mm : '%d minuttir',
  16450. h : 'ein tími',
  16451. hh : '%d tímar',
  16452. d : 'ein dagur',
  16453. dd : '%d dagar',
  16454. M : 'ein mánaði',
  16455. MM : '%d mánaðir',
  16456. y : 'eitt ár',
  16457. yy : '%d ár'
  16458. },
  16459. ordinalParse: /\d{1,2}\./,
  16460. ordinal : '%d.',
  16461. week : {
  16462. dow : 1, // Monday is the first day of the week.
  16463. doy : 4 // The week that contains Jan 4th is the first week of the year.
  16464. }
  16465. });
  16466. return fo;
  16467. })));
  16468. /***/ }),
  16469. /* 40 */
  16470. /***/ (function(module, exports, __webpack_require__) {
  16471. //! moment.js locale configuration
  16472. //! locale : French (Canada) [fr-ca]
  16473. //! author : Jonathan Abourbih : https://github.com/jonbca
  16474. ;(function (global, factory) {
  16475. true ? factory(__webpack_require__(0)) :
  16476. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  16477. factory(global.moment)
  16478. }(this, (function (moment) { 'use strict';
  16479. var frCa = moment.defineLocale('fr-ca', {
  16480. months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
  16481. monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
  16482. monthsParseExact : true,
  16483. weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
  16484. weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
  16485. weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),
  16486. weekdaysParseExact : true,
  16487. longDateFormat : {
  16488. LT : 'HH:mm',
  16489. LTS : 'HH:mm:ss',
  16490. L : 'YYYY-MM-DD',
  16491. LL : 'D MMMM YYYY',
  16492. LLL : 'D MMMM YYYY HH:mm',
  16493. LLLL : 'dddd D MMMM YYYY HH:mm'
  16494. },
  16495. calendar : {
  16496. sameDay: '[Aujourd\'hui à] LT',
  16497. nextDay: '[Demain à] LT',
  16498. nextWeek: 'dddd [à] LT',
  16499. lastDay: '[Hier à] LT',
  16500. lastWeek: 'dddd [dernier à] LT',
  16501. sameElse: 'L'
  16502. },
  16503. relativeTime : {
  16504. future : 'dans %s',
  16505. past : 'il y a %s',
  16506. s : 'quelques secondes',
  16507. m : 'une minute',
  16508. mm : '%d minutes',
  16509. h : 'une heure',
  16510. hh : '%d heures',
  16511. d : 'un jour',
  16512. dd : '%d jours',
  16513. M : 'un mois',
  16514. MM : '%d mois',
  16515. y : 'un an',
  16516. yy : '%d ans'
  16517. },
  16518. ordinalParse: /\d{1,2}(er|e)/,
  16519. ordinal : function (number) {
  16520. return number + (number === 1 ? 'er' : 'e');
  16521. }
  16522. });
  16523. return frCa;
  16524. })));
  16525. /***/ }),
  16526. /* 41 */
  16527. /***/ (function(module, exports, __webpack_require__) {
  16528. //! moment.js locale configuration
  16529. //! locale : French (Switzerland) [fr-ch]
  16530. //! author : Gaspard Bucher : https://github.com/gaspard
  16531. ;(function (global, factory) {
  16532. true ? factory(__webpack_require__(0)) :
  16533. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  16534. factory(global.moment)
  16535. }(this, (function (moment) { 'use strict';
  16536. var frCh = moment.defineLocale('fr-ch', {
  16537. months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
  16538. monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
  16539. monthsParseExact : true,
  16540. weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
  16541. weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
  16542. weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),
  16543. weekdaysParseExact : true,
  16544. longDateFormat : {
  16545. LT : 'HH:mm',
  16546. LTS : 'HH:mm:ss',
  16547. L : 'DD.MM.YYYY',
  16548. LL : 'D MMMM YYYY',
  16549. LLL : 'D MMMM YYYY HH:mm',
  16550. LLLL : 'dddd D MMMM YYYY HH:mm'
  16551. },
  16552. calendar : {
  16553. sameDay: '[Aujourd\'hui à] LT',
  16554. nextDay: '[Demain à] LT',
  16555. nextWeek: 'dddd [à] LT',
  16556. lastDay: '[Hier à] LT',
  16557. lastWeek: 'dddd [dernier à] LT',
  16558. sameElse: 'L'
  16559. },
  16560. relativeTime : {
  16561. future : 'dans %s',
  16562. past : 'il y a %s',
  16563. s : 'quelques secondes',
  16564. m : 'une minute',
  16565. mm : '%d minutes',
  16566. h : 'une heure',
  16567. hh : '%d heures',
  16568. d : 'un jour',
  16569. dd : '%d jours',
  16570. M : 'un mois',
  16571. MM : '%d mois',
  16572. y : 'un an',
  16573. yy : '%d ans'
  16574. },
  16575. ordinalParse: /\d{1,2}(er|e)/,
  16576. ordinal : function (number) {
  16577. return number + (number === 1 ? 'er' : 'e');
  16578. },
  16579. week : {
  16580. dow : 1, // Monday is the first day of the week.
  16581. doy : 4 // The week that contains Jan 4th is the first week of the year.
  16582. }
  16583. });
  16584. return frCh;
  16585. })));
  16586. /***/ }),
  16587. /* 42 */
  16588. /***/ (function(module, exports, __webpack_require__) {
  16589. //! moment.js locale configuration
  16590. //! locale : French [fr]
  16591. //! author : John Fischer : https://github.com/jfroffice
  16592. ;(function (global, factory) {
  16593. true ? factory(__webpack_require__(0)) :
  16594. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  16595. factory(global.moment)
  16596. }(this, (function (moment) { 'use strict';
  16597. var fr = moment.defineLocale('fr', {
  16598. months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
  16599. monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
  16600. monthsParseExact : true,
  16601. weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
  16602. weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
  16603. weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),
  16604. weekdaysParseExact : true,
  16605. longDateFormat : {
  16606. LT : 'HH:mm',
  16607. LTS : 'HH:mm:ss',
  16608. L : 'DD/MM/YYYY',
  16609. LL : 'D MMMM YYYY',
  16610. LLL : 'D MMMM YYYY HH:mm',
  16611. LLLL : 'dddd D MMMM YYYY HH:mm'
  16612. },
  16613. calendar : {
  16614. sameDay: '[Aujourd\'hui à] LT',
  16615. nextDay: '[Demain à] LT',
  16616. nextWeek: 'dddd [à] LT',
  16617. lastDay: '[Hier à] LT',
  16618. lastWeek: 'dddd [dernier à] LT',
  16619. sameElse: 'L'
  16620. },
  16621. relativeTime : {
  16622. future : 'dans %s',
  16623. past : 'il y a %s',
  16624. s : 'quelques secondes',
  16625. m : 'une minute',
  16626. mm : '%d minutes',
  16627. h : 'une heure',
  16628. hh : '%d heures',
  16629. d : 'un jour',
  16630. dd : '%d jours',
  16631. M : 'un mois',
  16632. MM : '%d mois',
  16633. y : 'un an',
  16634. yy : '%d ans'
  16635. },
  16636. ordinalParse: /\d{1,2}(er|)/,
  16637. ordinal : function (number) {
  16638. return number + (number === 1 ? 'er' : '');
  16639. },
  16640. week : {
  16641. dow : 1, // Monday is the first day of the week.
  16642. doy : 4 // The week that contains Jan 4th is the first week of the year.
  16643. }
  16644. });
  16645. return fr;
  16646. })));
  16647. /***/ }),
  16648. /* 43 */
  16649. /***/ (function(module, exports, __webpack_require__) {
  16650. //! moment.js locale configuration
  16651. //! locale : Frisian [fy]
  16652. //! author : Robin van der Vliet : https://github.com/robin0van0der0v
  16653. ;(function (global, factory) {
  16654. true ? factory(__webpack_require__(0)) :
  16655. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  16656. factory(global.moment)
  16657. }(this, (function (moment) { 'use strict';
  16658. var monthsShortWithDots = 'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split('_');
  16659. var monthsShortWithoutDots = 'jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_');
  16660. var fy = moment.defineLocale('fy', {
  16661. months : 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split('_'),
  16662. monthsShort : function (m, format) {
  16663. if (/-MMM-/.test(format)) {
  16664. return monthsShortWithoutDots[m.month()];
  16665. } else {
  16666. return monthsShortWithDots[m.month()];
  16667. }
  16668. },
  16669. monthsParseExact : true,
  16670. weekdays : 'snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon'.split('_'),
  16671. weekdaysShort : 'si._mo._ti._wo._to._fr._so.'.split('_'),
  16672. weekdaysMin : 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'),
  16673. weekdaysParseExact : true,
  16674. longDateFormat : {
  16675. LT : 'HH:mm',
  16676. LTS : 'HH:mm:ss',
  16677. L : 'DD-MM-YYYY',
  16678. LL : 'D MMMM YYYY',
  16679. LLL : 'D MMMM YYYY HH:mm',
  16680. LLLL : 'dddd D MMMM YYYY HH:mm'
  16681. },
  16682. calendar : {
  16683. sameDay: '[hjoed om] LT',
  16684. nextDay: '[moarn om] LT',
  16685. nextWeek: 'dddd [om] LT',
  16686. lastDay: '[juster om] LT',
  16687. lastWeek: '[ôfrûne] dddd [om] LT',
  16688. sameElse: 'L'
  16689. },
  16690. relativeTime : {
  16691. future : 'oer %s',
  16692. past : '%s lyn',
  16693. s : 'in pear sekonden',
  16694. m : 'ien minút',
  16695. mm : '%d minuten',
  16696. h : 'ien oere',
  16697. hh : '%d oeren',
  16698. d : 'ien dei',
  16699. dd : '%d dagen',
  16700. M : 'ien moanne',
  16701. MM : '%d moannen',
  16702. y : 'ien jier',
  16703. yy : '%d jierren'
  16704. },
  16705. ordinalParse: /\d{1,2}(ste|de)/,
  16706. ordinal : function (number) {
  16707. return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');
  16708. },
  16709. week : {
  16710. dow : 1, // Monday is the first day of the week.
  16711. doy : 4 // The week that contains Jan 4th is the first week of the year.
  16712. }
  16713. });
  16714. return fy;
  16715. })));
  16716. /***/ }),
  16717. /* 44 */
  16718. /***/ (function(module, exports, __webpack_require__) {
  16719. //! moment.js locale configuration
  16720. //! locale : Scottish Gaelic [gd]
  16721. //! author : Jon Ashdown : https://github.com/jonashdown
  16722. ;(function (global, factory) {
  16723. true ? factory(__webpack_require__(0)) :
  16724. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  16725. factory(global.moment)
  16726. }(this, (function (moment) { 'use strict';
  16727. var months = [
  16728. 'Am Faoilleach', 'An Gearran', 'Am Màrt', 'An Giblean', 'An Cèitean', 'An t-Ògmhios', 'An t-Iuchar', 'An Lùnastal', 'An t-Sultain', 'An Dàmhair', 'An t-Samhain', 'An Dùbhlachd'
  16729. ];
  16730. var monthsShort = ['Faoi', 'Gear', 'Màrt', 'Gibl', 'Cèit', 'Ògmh', 'Iuch', 'Lùn', 'Sult', 'Dàmh', 'Samh', 'Dùbh'];
  16731. var weekdays = ['Didòmhnaich', 'Diluain', 'Dimàirt', 'Diciadain', 'Diardaoin', 'Dihaoine', 'Disathairne'];
  16732. var weekdaysShort = ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis'];
  16733. var weekdaysMin = ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa'];
  16734. var gd = moment.defineLocale('gd', {
  16735. months : months,
  16736. monthsShort : monthsShort,
  16737. monthsParseExact : true,
  16738. weekdays : weekdays,
  16739. weekdaysShort : weekdaysShort,
  16740. weekdaysMin : weekdaysMin,
  16741. longDateFormat : {
  16742. LT : 'HH:mm',
  16743. LTS : 'HH:mm:ss',
  16744. L : 'DD/MM/YYYY',
  16745. LL : 'D MMMM YYYY',
  16746. LLL : 'D MMMM YYYY HH:mm',
  16747. LLLL : 'dddd, D MMMM YYYY HH:mm'
  16748. },
  16749. calendar : {
  16750. sameDay : '[An-diugh aig] LT',
  16751. nextDay : '[A-màireach aig] LT',
  16752. nextWeek : 'dddd [aig] LT',
  16753. lastDay : '[An-dè aig] LT',
  16754. lastWeek : 'dddd [seo chaidh] [aig] LT',
  16755. sameElse : 'L'
  16756. },
  16757. relativeTime : {
  16758. future : 'ann an %s',
  16759. past : 'bho chionn %s',
  16760. s : 'beagan diogan',
  16761. m : 'mionaid',
  16762. mm : '%d mionaidean',
  16763. h : 'uair',
  16764. hh : '%d uairean',
  16765. d : 'latha',
  16766. dd : '%d latha',
  16767. M : 'mìos',
  16768. MM : '%d mìosan',
  16769. y : 'bliadhna',
  16770. yy : '%d bliadhna'
  16771. },
  16772. ordinalParse : /\d{1,2}(d|na|mh)/,
  16773. ordinal : function (number) {
  16774. var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh';
  16775. return number + output;
  16776. },
  16777. week : {
  16778. dow : 1, // Monday is the first day of the week.
  16779. doy : 4 // The week that contains Jan 4th is the first week of the year.
  16780. }
  16781. });
  16782. return gd;
  16783. })));
  16784. /***/ }),
  16785. /* 45 */
  16786. /***/ (function(module, exports, __webpack_require__) {
  16787. //! moment.js locale configuration
  16788. //! locale : Galician [gl]
  16789. //! author : Juan G. Hurtado : https://github.com/juanghurtado
  16790. ;(function (global, factory) {
  16791. true ? factory(__webpack_require__(0)) :
  16792. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  16793. factory(global.moment)
  16794. }(this, (function (moment) { 'use strict';
  16795. var gl = moment.defineLocale('gl', {
  16796. months : 'xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro'.split('_'),
  16797. monthsShort : 'xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.'.split('_'),
  16798. monthsParseExact: true,
  16799. weekdays : 'domingo_luns_martes_mércores_xoves_venres_sábado'.split('_'),
  16800. weekdaysShort : 'dom._lun._mar._mér._xov._ven._sáb.'.split('_'),
  16801. weekdaysMin : 'do_lu_ma_mé_xo_ve_sá'.split('_'),
  16802. weekdaysParseExact : true,
  16803. longDateFormat : {
  16804. LT : 'H:mm',
  16805. LTS : 'H:mm:ss',
  16806. L : 'DD/MM/YYYY',
  16807. LL : 'D [de] MMMM [de] YYYY',
  16808. LLL : 'D [de] MMMM [de] YYYY H:mm',
  16809. LLLL : 'dddd, D [de] MMMM [de] YYYY H:mm'
  16810. },
  16811. calendar : {
  16812. sameDay : function () {
  16813. return '[hoxe ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT';
  16814. },
  16815. nextDay : function () {
  16816. return '[mañá ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT';
  16817. },
  16818. nextWeek : function () {
  16819. return 'dddd [' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';
  16820. },
  16821. lastDay : function () {
  16822. return '[onte ' + ((this.hours() !== 1) ? 'á' : 'a') + '] LT';
  16823. },
  16824. lastWeek : function () {
  16825. return '[o] dddd [pasado ' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';
  16826. },
  16827. sameElse : 'L'
  16828. },
  16829. relativeTime : {
  16830. future : function (str) {
  16831. if (str.indexOf('un') === 0) {
  16832. return 'n' + str;
  16833. }
  16834. return 'en ' + str;
  16835. },
  16836. past : 'hai %s',
  16837. s : 'uns segundos',
  16838. m : 'un minuto',
  16839. mm : '%d minutos',
  16840. h : 'unha hora',
  16841. hh : '%d horas',
  16842. d : 'un día',
  16843. dd : '%d días',
  16844. M : 'un mes',
  16845. MM : '%d meses',
  16846. y : 'un ano',
  16847. yy : '%d anos'
  16848. },
  16849. ordinalParse : /\d{1,2}º/,
  16850. ordinal : '%dº',
  16851. week : {
  16852. dow : 1, // Monday is the first day of the week.
  16853. doy : 4 // The week that contains Jan 4th is the first week of the year.
  16854. }
  16855. });
  16856. return gl;
  16857. })));
  16858. /***/ }),
  16859. /* 46 */
  16860. /***/ (function(module, exports, __webpack_require__) {
  16861. //! moment.js locale configuration
  16862. //! locale : Hebrew [he]
  16863. //! author : Tomer Cohen : https://github.com/tomer
  16864. //! author : Moshe Simantov : https://github.com/DevelopmentIL
  16865. //! author : Tal Ater : https://github.com/TalAter
  16866. ;(function (global, factory) {
  16867. true ? factory(__webpack_require__(0)) :
  16868. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  16869. factory(global.moment)
  16870. }(this, (function (moment) { 'use strict';
  16871. var he = moment.defineLocale('he', {
  16872. months : 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split('_'),
  16873. monthsShort : 'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split('_'),
  16874. weekdays : 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'),
  16875. weekdaysShort : 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'),
  16876. weekdaysMin : 'א_ב_ג_ד_ה_ו_ש'.split('_'),
  16877. longDateFormat : {
  16878. LT : 'HH:mm',
  16879. LTS : 'HH:mm:ss',
  16880. L : 'DD/MM/YYYY',
  16881. LL : 'D [ב]MMMM YYYY',
  16882. LLL : 'D [ב]MMMM YYYY HH:mm',
  16883. LLLL : 'dddd, D [ב]MMMM YYYY HH:mm',
  16884. l : 'D/M/YYYY',
  16885. ll : 'D MMM YYYY',
  16886. lll : 'D MMM YYYY HH:mm',
  16887. llll : 'ddd, D MMM YYYY HH:mm'
  16888. },
  16889. calendar : {
  16890. sameDay : '[היום ב־]LT',
  16891. nextDay : '[מחר ב־]LT',
  16892. nextWeek : 'dddd [בשעה] LT',
  16893. lastDay : '[אתמול ב־]LT',
  16894. lastWeek : '[ביום] dddd [האחרון בשעה] LT',
  16895. sameElse : 'L'
  16896. },
  16897. relativeTime : {
  16898. future : 'בעוד %s',
  16899. past : 'לפני %s',
  16900. s : 'מספר שניות',
  16901. m : 'דקה',
  16902. mm : '%d דקות',
  16903. h : 'שעה',
  16904. hh : function (number) {
  16905. if (number === 2) {
  16906. return 'שעתיים';
  16907. }
  16908. return number + ' שעות';
  16909. },
  16910. d : 'יום',
  16911. dd : function (number) {
  16912. if (number === 2) {
  16913. return 'יומיים';
  16914. }
  16915. return number + ' ימים';
  16916. },
  16917. M : 'חודש',
  16918. MM : function (number) {
  16919. if (number === 2) {
  16920. return 'חודשיים';
  16921. }
  16922. return number + ' חודשים';
  16923. },
  16924. y : 'שנה',
  16925. yy : function (number) {
  16926. if (number === 2) {
  16927. return 'שנתיים';
  16928. } else if (number % 10 === 0 && number !== 10) {
  16929. return number + ' שנה';
  16930. }
  16931. return number + ' שנים';
  16932. }
  16933. },
  16934. meridiemParse: /אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,
  16935. isPM : function (input) {
  16936. return /^(אחה"צ|אחרי הצהריים|בערב)$/.test(input);
  16937. },
  16938. meridiem : function (hour, minute, isLower) {
  16939. if (hour < 5) {
  16940. return 'לפנות בוקר';
  16941. } else if (hour < 10) {
  16942. return 'בבוקר';
  16943. } else if (hour < 12) {
  16944. return isLower ? 'לפנה"צ' : 'לפני הצהריים';
  16945. } else if (hour < 18) {
  16946. return isLower ? 'אחה"צ' : 'אחרי הצהריים';
  16947. } else {
  16948. return 'בערב';
  16949. }
  16950. }
  16951. });
  16952. return he;
  16953. })));
  16954. /***/ }),
  16955. /* 47 */
  16956. /***/ (function(module, exports, __webpack_require__) {
  16957. //! moment.js locale configuration
  16958. //! locale : Hindi [hi]
  16959. //! author : Mayank Singhal : https://github.com/mayanksinghal
  16960. ;(function (global, factory) {
  16961. true ? factory(__webpack_require__(0)) :
  16962. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  16963. factory(global.moment)
  16964. }(this, (function (moment) { 'use strict';
  16965. var symbolMap = {
  16966. '1': '१',
  16967. '2': '२',
  16968. '3': '३',
  16969. '4': '४',
  16970. '5': '५',
  16971. '6': '६',
  16972. '7': '७',
  16973. '8': '८',
  16974. '9': '९',
  16975. '0': '०'
  16976. };
  16977. var numberMap = {
  16978. '१': '1',
  16979. '२': '2',
  16980. '३': '3',
  16981. '४': '4',
  16982. '५': '5',
  16983. '६': '6',
  16984. '७': '7',
  16985. '८': '8',
  16986. '९': '9',
  16987. '०': '0'
  16988. };
  16989. var hi = moment.defineLocale('hi', {
  16990. months : 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split('_'),
  16991. monthsShort : 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split('_'),
  16992. monthsParseExact: true,
  16993. weekdays : 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
  16994. weekdaysShort : 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'),
  16995. weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'),
  16996. longDateFormat : {
  16997. LT : 'A h:mm बजे',
  16998. LTS : 'A h:mm:ss बजे',
  16999. L : 'DD/MM/YYYY',
  17000. LL : 'D MMMM YYYY',
  17001. LLL : 'D MMMM YYYY, A h:mm बजे',
  17002. LLLL : 'dddd, D MMMM YYYY, A h:mm बजे'
  17003. },
  17004. calendar : {
  17005. sameDay : '[आज] LT',
  17006. nextDay : '[कल] LT',
  17007. nextWeek : 'dddd, LT',
  17008. lastDay : '[कल] LT',
  17009. lastWeek : '[पिछले] dddd, LT',
  17010. sameElse : 'L'
  17011. },
  17012. relativeTime : {
  17013. future : '%s में',
  17014. past : '%s पहले',
  17015. s : 'कुछ ही क्षण',
  17016. m : 'एक मिनट',
  17017. mm : '%d मिनट',
  17018. h : 'एक घंटा',
  17019. hh : '%d घंटे',
  17020. d : 'एक दिन',
  17021. dd : '%d दिन',
  17022. M : 'एक महीने',
  17023. MM : '%d महीने',
  17024. y : 'एक वर्ष',
  17025. yy : '%d वर्ष'
  17026. },
  17027. preparse: function (string) {
  17028. return string.replace(/[१२३४५६७८९०]/g, function (match) {
  17029. return numberMap[match];
  17030. });
  17031. },
  17032. postformat: function (string) {
  17033. return string.replace(/\d/g, function (match) {
  17034. return symbolMap[match];
  17035. });
  17036. },
  17037. // Hindi notation for meridiems are quite fuzzy in practice. While there exists
  17038. // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.
  17039. meridiemParse: /रात|सुबह|दोपहर|शाम/,
  17040. meridiemHour : function (hour, meridiem) {
  17041. if (hour === 12) {
  17042. hour = 0;
  17043. }
  17044. if (meridiem === 'रात') {
  17045. return hour < 4 ? hour : hour + 12;
  17046. } else if (meridiem === 'सुबह') {
  17047. return hour;
  17048. } else if (meridiem === 'दोपहर') {
  17049. return hour >= 10 ? hour : hour + 12;
  17050. } else if (meridiem === 'शाम') {
  17051. return hour + 12;
  17052. }
  17053. },
  17054. meridiem : function (hour, minute, isLower) {
  17055. if (hour < 4) {
  17056. return 'रात';
  17057. } else if (hour < 10) {
  17058. return 'सुबह';
  17059. } else if (hour < 17) {
  17060. return 'दोपहर';
  17061. } else if (hour < 20) {
  17062. return 'शाम';
  17063. } else {
  17064. return 'रात';
  17065. }
  17066. },
  17067. week : {
  17068. dow : 0, // Sunday is the first day of the week.
  17069. doy : 6 // The week that contains Jan 1st is the first week of the year.
  17070. }
  17071. });
  17072. return hi;
  17073. })));
  17074. /***/ }),
  17075. /* 48 */
  17076. /***/ (function(module, exports, __webpack_require__) {
  17077. //! moment.js locale configuration
  17078. //! locale : Croatian [hr]
  17079. //! author : Bojan Marković : https://github.com/bmarkovic
  17080. ;(function (global, factory) {
  17081. true ? factory(__webpack_require__(0)) :
  17082. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  17083. factory(global.moment)
  17084. }(this, (function (moment) { 'use strict';
  17085. function translate(number, withoutSuffix, key) {
  17086. var result = number + ' ';
  17087. switch (key) {
  17088. case 'm':
  17089. return withoutSuffix ? 'jedna minuta' : 'jedne minute';
  17090. case 'mm':
  17091. if (number === 1) {
  17092. result += 'minuta';
  17093. } else if (number === 2 || number === 3 || number === 4) {
  17094. result += 'minute';
  17095. } else {
  17096. result += 'minuta';
  17097. }
  17098. return result;
  17099. case 'h':
  17100. return withoutSuffix ? 'jedan sat' : 'jednog sata';
  17101. case 'hh':
  17102. if (number === 1) {
  17103. result += 'sat';
  17104. } else if (number === 2 || number === 3 || number === 4) {
  17105. result += 'sata';
  17106. } else {
  17107. result += 'sati';
  17108. }
  17109. return result;
  17110. case 'dd':
  17111. if (number === 1) {
  17112. result += 'dan';
  17113. } else {
  17114. result += 'dana';
  17115. }
  17116. return result;
  17117. case 'MM':
  17118. if (number === 1) {
  17119. result += 'mjesec';
  17120. } else if (number === 2 || number === 3 || number === 4) {
  17121. result += 'mjeseca';
  17122. } else {
  17123. result += 'mjeseci';
  17124. }
  17125. return result;
  17126. case 'yy':
  17127. if (number === 1) {
  17128. result += 'godina';
  17129. } else if (number === 2 || number === 3 || number === 4) {
  17130. result += 'godine';
  17131. } else {
  17132. result += 'godina';
  17133. }
  17134. return result;
  17135. }
  17136. }
  17137. var hr = moment.defineLocale('hr', {
  17138. months : {
  17139. format: 'siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca'.split('_'),
  17140. standalone: 'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split('_')
  17141. },
  17142. monthsShort : 'sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split('_'),
  17143. monthsParseExact: true,
  17144. weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
  17145. weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
  17146. weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'),
  17147. weekdaysParseExact : true,
  17148. longDateFormat : {
  17149. LT : 'H:mm',
  17150. LTS : 'H:mm:ss',
  17151. L : 'DD.MM.YYYY',
  17152. LL : 'D. MMMM YYYY',
  17153. LLL : 'D. MMMM YYYY H:mm',
  17154. LLLL : 'dddd, D. MMMM YYYY H:mm'
  17155. },
  17156. calendar : {
  17157. sameDay : '[danas u] LT',
  17158. nextDay : '[sutra u] LT',
  17159. nextWeek : function () {
  17160. switch (this.day()) {
  17161. case 0:
  17162. return '[u] [nedjelju] [u] LT';
  17163. case 3:
  17164. return '[u] [srijedu] [u] LT';
  17165. case 6:
  17166. return '[u] [subotu] [u] LT';
  17167. case 1:
  17168. case 2:
  17169. case 4:
  17170. case 5:
  17171. return '[u] dddd [u] LT';
  17172. }
  17173. },
  17174. lastDay : '[jučer u] LT',
  17175. lastWeek : function () {
  17176. switch (this.day()) {
  17177. case 0:
  17178. case 3:
  17179. return '[prošlu] dddd [u] LT';
  17180. case 6:
  17181. return '[prošle] [subote] [u] LT';
  17182. case 1:
  17183. case 2:
  17184. case 4:
  17185. case 5:
  17186. return '[prošli] dddd [u] LT';
  17187. }
  17188. },
  17189. sameElse : 'L'
  17190. },
  17191. relativeTime : {
  17192. future : 'za %s',
  17193. past : 'prije %s',
  17194. s : 'par sekundi',
  17195. m : translate,
  17196. mm : translate,
  17197. h : translate,
  17198. hh : translate,
  17199. d : 'dan',
  17200. dd : translate,
  17201. M : 'mjesec',
  17202. MM : translate,
  17203. y : 'godinu',
  17204. yy : translate
  17205. },
  17206. ordinalParse: /\d{1,2}\./,
  17207. ordinal : '%d.',
  17208. week : {
  17209. dow : 1, // Monday is the first day of the week.
  17210. doy : 7 // The week that contains Jan 1st is the first week of the year.
  17211. }
  17212. });
  17213. return hr;
  17214. })));
  17215. /***/ }),
  17216. /* 49 */
  17217. /***/ (function(module, exports, __webpack_require__) {
  17218. //! moment.js locale configuration
  17219. //! locale : Hungarian [hu]
  17220. //! author : Adam Brunner : https://github.com/adambrunner
  17221. ;(function (global, factory) {
  17222. true ? factory(__webpack_require__(0)) :
  17223. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  17224. factory(global.moment)
  17225. }(this, (function (moment) { 'use strict';
  17226. var weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(' ');
  17227. function translate(number, withoutSuffix, key, isFuture) {
  17228. var num = number,
  17229. suffix;
  17230. switch (key) {
  17231. case 's':
  17232. return (isFuture || withoutSuffix) ? 'néhány másodperc' : 'néhány másodperce';
  17233. case 'm':
  17234. return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce');
  17235. case 'mm':
  17236. return num + (isFuture || withoutSuffix ? ' perc' : ' perce');
  17237. case 'h':
  17238. return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája');
  17239. case 'hh':
  17240. return num + (isFuture || withoutSuffix ? ' óra' : ' órája');
  17241. case 'd':
  17242. return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja');
  17243. case 'dd':
  17244. return num + (isFuture || withoutSuffix ? ' nap' : ' napja');
  17245. case 'M':
  17246. return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
  17247. case 'MM':
  17248. return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
  17249. case 'y':
  17250. return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve');
  17251. case 'yy':
  17252. return num + (isFuture || withoutSuffix ? ' év' : ' éve');
  17253. }
  17254. return '';
  17255. }
  17256. function week(isFuture) {
  17257. return (isFuture ? '' : '[múlt] ') + '[' + weekEndings[this.day()] + '] LT[-kor]';
  17258. }
  17259. var hu = moment.defineLocale('hu', {
  17260. months : 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split('_'),
  17261. monthsShort : 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split('_'),
  17262. weekdays : 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'),
  17263. weekdaysShort : 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'),
  17264. weekdaysMin : 'v_h_k_sze_cs_p_szo'.split('_'),
  17265. longDateFormat : {
  17266. LT : 'H:mm',
  17267. LTS : 'H:mm:ss',
  17268. L : 'YYYY.MM.DD.',
  17269. LL : 'YYYY. MMMM D.',
  17270. LLL : 'YYYY. MMMM D. H:mm',
  17271. LLLL : 'YYYY. MMMM D., dddd H:mm'
  17272. },
  17273. meridiemParse: /de|du/i,
  17274. isPM: function (input) {
  17275. return input.charAt(1).toLowerCase() === 'u';
  17276. },
  17277. meridiem : function (hours, minutes, isLower) {
  17278. if (hours < 12) {
  17279. return isLower === true ? 'de' : 'DE';
  17280. } else {
  17281. return isLower === true ? 'du' : 'DU';
  17282. }
  17283. },
  17284. calendar : {
  17285. sameDay : '[ma] LT[-kor]',
  17286. nextDay : '[holnap] LT[-kor]',
  17287. nextWeek : function () {
  17288. return week.call(this, true);
  17289. },
  17290. lastDay : '[tegnap] LT[-kor]',
  17291. lastWeek : function () {
  17292. return week.call(this, false);
  17293. },
  17294. sameElse : 'L'
  17295. },
  17296. relativeTime : {
  17297. future : '%s múlva',
  17298. past : '%s',
  17299. s : translate,
  17300. m : translate,
  17301. mm : translate,
  17302. h : translate,
  17303. hh : translate,
  17304. d : translate,
  17305. dd : translate,
  17306. M : translate,
  17307. MM : translate,
  17308. y : translate,
  17309. yy : translate
  17310. },
  17311. ordinalParse: /\d{1,2}\./,
  17312. ordinal : '%d.',
  17313. week : {
  17314. dow : 1, // Monday is the first day of the week.
  17315. doy : 4 // The week that contains Jan 4th is the first week of the year.
  17316. }
  17317. });
  17318. return hu;
  17319. })));
  17320. /***/ }),
  17321. /* 50 */
  17322. /***/ (function(module, exports, __webpack_require__) {
  17323. //! moment.js locale configuration
  17324. //! locale : Armenian [hy-am]
  17325. //! author : Armendarabyan : https://github.com/armendarabyan
  17326. ;(function (global, factory) {
  17327. true ? factory(__webpack_require__(0)) :
  17328. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  17329. factory(global.moment)
  17330. }(this, (function (moment) { 'use strict';
  17331. var hyAm = moment.defineLocale('hy-am', {
  17332. months : {
  17333. format: 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_'),
  17334. standalone: 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_')
  17335. },
  17336. monthsShort : 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'),
  17337. weekdays : 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_'),
  17338. weekdaysShort : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
  17339. weekdaysMin : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
  17340. longDateFormat : {
  17341. LT : 'HH:mm',
  17342. LTS : 'HH:mm:ss',
  17343. L : 'DD.MM.YYYY',
  17344. LL : 'D MMMM YYYY թ.',
  17345. LLL : 'D MMMM YYYY թ., HH:mm',
  17346. LLLL : 'dddd, D MMMM YYYY թ., HH:mm'
  17347. },
  17348. calendar : {
  17349. sameDay: '[այսօր] LT',
  17350. nextDay: '[վաղը] LT',
  17351. lastDay: '[երեկ] LT',
  17352. nextWeek: function () {
  17353. return 'dddd [օրը ժամը] LT';
  17354. },
  17355. lastWeek: function () {
  17356. return '[անցած] dddd [օրը ժամը] LT';
  17357. },
  17358. sameElse: 'L'
  17359. },
  17360. relativeTime : {
  17361. future : '%s հետո',
  17362. past : '%s առաջ',
  17363. s : 'մի քանի վայրկյան',
  17364. m : 'րոպե',
  17365. mm : '%d րոպե',
  17366. h : 'ժամ',
  17367. hh : '%d ժամ',
  17368. d : 'օր',
  17369. dd : '%d օր',
  17370. M : 'ամիս',
  17371. MM : '%d ամիս',
  17372. y : 'տարի',
  17373. yy : '%d տարի'
  17374. },
  17375. meridiemParse: /գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,
  17376. isPM: function (input) {
  17377. return /^(ցերեկվա|երեկոյան)$/.test(input);
  17378. },
  17379. meridiem : function (hour) {
  17380. if (hour < 4) {
  17381. return 'գիշերվա';
  17382. } else if (hour < 12) {
  17383. return 'առավոտվա';
  17384. } else if (hour < 17) {
  17385. return 'ցերեկվա';
  17386. } else {
  17387. return 'երեկոյան';
  17388. }
  17389. },
  17390. ordinalParse: /\d{1,2}|\d{1,2}-(ին|րդ)/,
  17391. ordinal: function (number, period) {
  17392. switch (period) {
  17393. case 'DDD':
  17394. case 'w':
  17395. case 'W':
  17396. case 'DDDo':
  17397. if (number === 1) {
  17398. return number + '-ին';
  17399. }
  17400. return number + '-րդ';
  17401. default:
  17402. return number;
  17403. }
  17404. },
  17405. week : {
  17406. dow : 1, // Monday is the first day of the week.
  17407. doy : 7 // The week that contains Jan 1st is the first week of the year.
  17408. }
  17409. });
  17410. return hyAm;
  17411. })));
  17412. /***/ }),
  17413. /* 51 */
  17414. /***/ (function(module, exports, __webpack_require__) {
  17415. //! moment.js locale configuration
  17416. //! locale : Indonesian [id]
  17417. //! author : Mohammad Satrio Utomo : https://github.com/tyok
  17418. //! reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan
  17419. ;(function (global, factory) {
  17420. true ? factory(__webpack_require__(0)) :
  17421. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  17422. factory(global.moment)
  17423. }(this, (function (moment) { 'use strict';
  17424. var id = moment.defineLocale('id', {
  17425. months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'),
  17426. monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des'.split('_'),
  17427. weekdays : 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),
  17428. weekdaysShort : 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),
  17429. weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),
  17430. longDateFormat : {
  17431. LT : 'HH.mm',
  17432. LTS : 'HH.mm.ss',
  17433. L : 'DD/MM/YYYY',
  17434. LL : 'D MMMM YYYY',
  17435. LLL : 'D MMMM YYYY [pukul] HH.mm',
  17436. LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
  17437. },
  17438. meridiemParse: /pagi|siang|sore|malam/,
  17439. meridiemHour : function (hour, meridiem) {
  17440. if (hour === 12) {
  17441. hour = 0;
  17442. }
  17443. if (meridiem === 'pagi') {
  17444. return hour;
  17445. } else if (meridiem === 'siang') {
  17446. return hour >= 11 ? hour : hour + 12;
  17447. } else if (meridiem === 'sore' || meridiem === 'malam') {
  17448. return hour + 12;
  17449. }
  17450. },
  17451. meridiem : function (hours, minutes, isLower) {
  17452. if (hours < 11) {
  17453. return 'pagi';
  17454. } else if (hours < 15) {
  17455. return 'siang';
  17456. } else if (hours < 19) {
  17457. return 'sore';
  17458. } else {
  17459. return 'malam';
  17460. }
  17461. },
  17462. calendar : {
  17463. sameDay : '[Hari ini pukul] LT',
  17464. nextDay : '[Besok pukul] LT',
  17465. nextWeek : 'dddd [pukul] LT',
  17466. lastDay : '[Kemarin pukul] LT',
  17467. lastWeek : 'dddd [lalu pukul] LT',
  17468. sameElse : 'L'
  17469. },
  17470. relativeTime : {
  17471. future : 'dalam %s',
  17472. past : '%s yang lalu',
  17473. s : 'beberapa detik',
  17474. m : 'semenit',
  17475. mm : '%d menit',
  17476. h : 'sejam',
  17477. hh : '%d jam',
  17478. d : 'sehari',
  17479. dd : '%d hari',
  17480. M : 'sebulan',
  17481. MM : '%d bulan',
  17482. y : 'setahun',
  17483. yy : '%d tahun'
  17484. },
  17485. week : {
  17486. dow : 1, // Monday is the first day of the week.
  17487. doy : 7 // The week that contains Jan 1st is the first week of the year.
  17488. }
  17489. });
  17490. return id;
  17491. })));
  17492. /***/ }),
  17493. /* 52 */
  17494. /***/ (function(module, exports, __webpack_require__) {
  17495. //! moment.js locale configuration
  17496. //! locale : Icelandic [is]
  17497. //! author : Hinrik Örn Sigurðsson : https://github.com/hinrik
  17498. ;(function (global, factory) {
  17499. true ? factory(__webpack_require__(0)) :
  17500. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  17501. factory(global.moment)
  17502. }(this, (function (moment) { 'use strict';
  17503. function plural(n) {
  17504. if (n % 100 === 11) {
  17505. return true;
  17506. } else if (n % 10 === 1) {
  17507. return false;
  17508. }
  17509. return true;
  17510. }
  17511. function translate(number, withoutSuffix, key, isFuture) {
  17512. var result = number + ' ';
  17513. switch (key) {
  17514. case 's':
  17515. return withoutSuffix || isFuture ? 'nokkrar sekúndur' : 'nokkrum sekúndum';
  17516. case 'm':
  17517. return withoutSuffix ? 'mínúta' : 'mínútu';
  17518. case 'mm':
  17519. if (plural(number)) {
  17520. return result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum');
  17521. } else if (withoutSuffix) {
  17522. return result + 'mínúta';
  17523. }
  17524. return result + 'mínútu';
  17525. case 'hh':
  17526. if (plural(number)) {
  17527. return result + (withoutSuffix || isFuture ? 'klukkustundir' : 'klukkustundum');
  17528. }
  17529. return result + 'klukkustund';
  17530. case 'd':
  17531. if (withoutSuffix) {
  17532. return 'dagur';
  17533. }
  17534. return isFuture ? 'dag' : 'degi';
  17535. case 'dd':
  17536. if (plural(number)) {
  17537. if (withoutSuffix) {
  17538. return result + 'dagar';
  17539. }
  17540. return result + (isFuture ? 'daga' : 'dögum');
  17541. } else if (withoutSuffix) {
  17542. return result + 'dagur';
  17543. }
  17544. return result + (isFuture ? 'dag' : 'degi');
  17545. case 'M':
  17546. if (withoutSuffix) {
  17547. return 'mánuður';
  17548. }
  17549. return isFuture ? 'mánuð' : 'mánuði';
  17550. case 'MM':
  17551. if (plural(number)) {
  17552. if (withoutSuffix) {
  17553. return result + 'mánuðir';
  17554. }
  17555. return result + (isFuture ? 'mánuði' : 'mánuðum');
  17556. } else if (withoutSuffix) {
  17557. return result + 'mánuður';
  17558. }
  17559. return result + (isFuture ? 'mánuð' : 'mánuði');
  17560. case 'y':
  17561. return withoutSuffix || isFuture ? 'ár' : 'ári';
  17562. case 'yy':
  17563. if (plural(number)) {
  17564. return result + (withoutSuffix || isFuture ? 'ár' : 'árum');
  17565. }
  17566. return result + (withoutSuffix || isFuture ? 'ár' : 'ári');
  17567. }
  17568. }
  17569. var is = moment.defineLocale('is', {
  17570. months : 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split('_'),
  17571. monthsShort : 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'),
  17572. weekdays : 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split('_'),
  17573. weekdaysShort : 'sun_mán_þri_mið_fim_fös_lau'.split('_'),
  17574. weekdaysMin : 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'),
  17575. longDateFormat : {
  17576. LT : 'H:mm',
  17577. LTS : 'H:mm:ss',
  17578. L : 'DD.MM.YYYY',
  17579. LL : 'D. MMMM YYYY',
  17580. LLL : 'D. MMMM YYYY [kl.] H:mm',
  17581. LLLL : 'dddd, D. MMMM YYYY [kl.] H:mm'
  17582. },
  17583. calendar : {
  17584. sameDay : '[í dag kl.] LT',
  17585. nextDay : '[á morgun kl.] LT',
  17586. nextWeek : 'dddd [kl.] LT',
  17587. lastDay : '[í gær kl.] LT',
  17588. lastWeek : '[síðasta] dddd [kl.] LT',
  17589. sameElse : 'L'
  17590. },
  17591. relativeTime : {
  17592. future : 'eftir %s',
  17593. past : 'fyrir %s síðan',
  17594. s : translate,
  17595. m : translate,
  17596. mm : translate,
  17597. h : 'klukkustund',
  17598. hh : translate,
  17599. d : translate,
  17600. dd : translate,
  17601. M : translate,
  17602. MM : translate,
  17603. y : translate,
  17604. yy : translate
  17605. },
  17606. ordinalParse: /\d{1,2}\./,
  17607. ordinal : '%d.',
  17608. week : {
  17609. dow : 1, // Monday is the first day of the week.
  17610. doy : 4 // The week that contains Jan 4th is the first week of the year.
  17611. }
  17612. });
  17613. return is;
  17614. })));
  17615. /***/ }),
  17616. /* 53 */
  17617. /***/ (function(module, exports, __webpack_require__) {
  17618. //! moment.js locale configuration
  17619. //! locale : Italian [it]
  17620. //! author : Lorenzo : https://github.com/aliem
  17621. //! author: Mattia Larentis: https://github.com/nostalgiaz
  17622. ;(function (global, factory) {
  17623. true ? factory(__webpack_require__(0)) :
  17624. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  17625. factory(global.moment)
  17626. }(this, (function (moment) { 'use strict';
  17627. var it = moment.defineLocale('it', {
  17628. months : 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'),
  17629. monthsShort : 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
  17630. weekdays : 'Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato'.split('_'),
  17631. weekdaysShort : 'Dom_Lun_Mar_Mer_Gio_Ven_Sab'.split('_'),
  17632. weekdaysMin : 'Do_Lu_Ma_Me_Gi_Ve_Sa'.split('_'),
  17633. longDateFormat : {
  17634. LT : 'HH:mm',
  17635. LTS : 'HH:mm:ss',
  17636. L : 'DD/MM/YYYY',
  17637. LL : 'D MMMM YYYY',
  17638. LLL : 'D MMMM YYYY HH:mm',
  17639. LLLL : 'dddd, D MMMM YYYY HH:mm'
  17640. },
  17641. calendar : {
  17642. sameDay: '[Oggi alle] LT',
  17643. nextDay: '[Domani alle] LT',
  17644. nextWeek: 'dddd [alle] LT',
  17645. lastDay: '[Ieri alle] LT',
  17646. lastWeek: function () {
  17647. switch (this.day()) {
  17648. case 0:
  17649. return '[la scorsa] dddd [alle] LT';
  17650. default:
  17651. return '[lo scorso] dddd [alle] LT';
  17652. }
  17653. },
  17654. sameElse: 'L'
  17655. },
  17656. relativeTime : {
  17657. future : function (s) {
  17658. return ((/^[0-9].+$/).test(s) ? 'tra' : 'in') + ' ' + s;
  17659. },
  17660. past : '%s fa',
  17661. s : 'alcuni secondi',
  17662. m : 'un minuto',
  17663. mm : '%d minuti',
  17664. h : 'un\'ora',
  17665. hh : '%d ore',
  17666. d : 'un giorno',
  17667. dd : '%d giorni',
  17668. M : 'un mese',
  17669. MM : '%d mesi',
  17670. y : 'un anno',
  17671. yy : '%d anni'
  17672. },
  17673. ordinalParse : /\d{1,2}º/,
  17674. ordinal: '%dº',
  17675. week : {
  17676. dow : 1, // Monday is the first day of the week.
  17677. doy : 4 // The week that contains Jan 4th is the first week of the year.
  17678. }
  17679. });
  17680. return it;
  17681. })));
  17682. /***/ }),
  17683. /* 54 */
  17684. /***/ (function(module, exports, __webpack_require__) {
  17685. //! moment.js locale configuration
  17686. //! locale : Japanese [ja]
  17687. //! author : LI Long : https://github.com/baryon
  17688. ;(function (global, factory) {
  17689. true ? factory(__webpack_require__(0)) :
  17690. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  17691. factory(global.moment)
  17692. }(this, (function (moment) { 'use strict';
  17693. var ja = moment.defineLocale('ja', {
  17694. months : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
  17695. monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
  17696. weekdays : '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'),
  17697. weekdaysShort : '日_月_火_水_木_金_土'.split('_'),
  17698. weekdaysMin : '日_月_火_水_木_金_土'.split('_'),
  17699. longDateFormat : {
  17700. LT : 'Ah時m分',
  17701. LTS : 'Ah時m分s秒',
  17702. L : 'YYYY/MM/DD',
  17703. LL : 'YYYY年M月D日',
  17704. LLL : 'YYYY年M月D日Ah時m分',
  17705. LLLL : 'YYYY年M月D日Ah時m分 dddd'
  17706. },
  17707. meridiemParse: /午前|午後/i,
  17708. isPM : function (input) {
  17709. return input === '午後';
  17710. },
  17711. meridiem : function (hour, minute, isLower) {
  17712. if (hour < 12) {
  17713. return '午前';
  17714. } else {
  17715. return '午後';
  17716. }
  17717. },
  17718. calendar : {
  17719. sameDay : '[今日] LT',
  17720. nextDay : '[明日] LT',
  17721. nextWeek : '[来週]dddd LT',
  17722. lastDay : '[昨日] LT',
  17723. lastWeek : '[前週]dddd LT',
  17724. sameElse : 'L'
  17725. },
  17726. ordinalParse : /\d{1,2}日/,
  17727. ordinal : function (number, period) {
  17728. switch (period) {
  17729. case 'd':
  17730. case 'D':
  17731. case 'DDD':
  17732. return number + '日';
  17733. default:
  17734. return number;
  17735. }
  17736. },
  17737. relativeTime : {
  17738. future : '%s後',
  17739. past : '%s前',
  17740. s : '数秒',
  17741. m : '1分',
  17742. mm : '%d分',
  17743. h : '1時間',
  17744. hh : '%d時間',
  17745. d : '1日',
  17746. dd : '%d日',
  17747. M : '1ヶ月',
  17748. MM : '%dヶ月',
  17749. y : '1年',
  17750. yy : '%d年'
  17751. }
  17752. });
  17753. return ja;
  17754. })));
  17755. /***/ }),
  17756. /* 55 */
  17757. /***/ (function(module, exports, __webpack_require__) {
  17758. //! moment.js locale configuration
  17759. //! locale : Javanese [jv]
  17760. //! author : Rony Lantip : https://github.com/lantip
  17761. //! reference: http://jv.wikipedia.org/wiki/Basa_Jawa
  17762. ;(function (global, factory) {
  17763. true ? factory(__webpack_require__(0)) :
  17764. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  17765. factory(global.moment)
  17766. }(this, (function (moment) { 'use strict';
  17767. var jv = moment.defineLocale('jv', {
  17768. months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember'.split('_'),
  17769. monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des'.split('_'),
  17770. weekdays : 'Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu'.split('_'),
  17771. weekdaysShort : 'Min_Sen_Sel_Reb_Kem_Jem_Sep'.split('_'),
  17772. weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sp'.split('_'),
  17773. longDateFormat : {
  17774. LT : 'HH.mm',
  17775. LTS : 'HH.mm.ss',
  17776. L : 'DD/MM/YYYY',
  17777. LL : 'D MMMM YYYY',
  17778. LLL : 'D MMMM YYYY [pukul] HH.mm',
  17779. LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
  17780. },
  17781. meridiemParse: /enjing|siyang|sonten|ndalu/,
  17782. meridiemHour : function (hour, meridiem) {
  17783. if (hour === 12) {
  17784. hour = 0;
  17785. }
  17786. if (meridiem === 'enjing') {
  17787. return hour;
  17788. } else if (meridiem === 'siyang') {
  17789. return hour >= 11 ? hour : hour + 12;
  17790. } else if (meridiem === 'sonten' || meridiem === 'ndalu') {
  17791. return hour + 12;
  17792. }
  17793. },
  17794. meridiem : function (hours, minutes, isLower) {
  17795. if (hours < 11) {
  17796. return 'enjing';
  17797. } else if (hours < 15) {
  17798. return 'siyang';
  17799. } else if (hours < 19) {
  17800. return 'sonten';
  17801. } else {
  17802. return 'ndalu';
  17803. }
  17804. },
  17805. calendar : {
  17806. sameDay : '[Dinten puniko pukul] LT',
  17807. nextDay : '[Mbenjang pukul] LT',
  17808. nextWeek : 'dddd [pukul] LT',
  17809. lastDay : '[Kala wingi pukul] LT',
  17810. lastWeek : 'dddd [kepengker pukul] LT',
  17811. sameElse : 'L'
  17812. },
  17813. relativeTime : {
  17814. future : 'wonten ing %s',
  17815. past : '%s ingkang kepengker',
  17816. s : 'sawetawis detik',
  17817. m : 'setunggal menit',
  17818. mm : '%d menit',
  17819. h : 'setunggal jam',
  17820. hh : '%d jam',
  17821. d : 'sedinten',
  17822. dd : '%d dinten',
  17823. M : 'sewulan',
  17824. MM : '%d wulan',
  17825. y : 'setaun',
  17826. yy : '%d taun'
  17827. },
  17828. week : {
  17829. dow : 1, // Monday is the first day of the week.
  17830. doy : 7 // The week that contains Jan 1st is the first week of the year.
  17831. }
  17832. });
  17833. return jv;
  17834. })));
  17835. /***/ }),
  17836. /* 56 */
  17837. /***/ (function(module, exports, __webpack_require__) {
  17838. //! moment.js locale configuration
  17839. //! locale : Georgian [ka]
  17840. //! author : Irakli Janiashvili : https://github.com/irakli-janiashvili
  17841. ;(function (global, factory) {
  17842. true ? factory(__webpack_require__(0)) :
  17843. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  17844. factory(global.moment)
  17845. }(this, (function (moment) { 'use strict';
  17846. var ka = moment.defineLocale('ka', {
  17847. months : {
  17848. standalone: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'),
  17849. format: 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_')
  17850. },
  17851. monthsShort : 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'),
  17852. weekdays : {
  17853. standalone: 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'),
  17854. format: 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_'),
  17855. isFormat: /(წინა|შემდეგ)/
  17856. },
  17857. weekdaysShort : 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'),
  17858. weekdaysMin : 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'),
  17859. longDateFormat : {
  17860. LT : 'h:mm A',
  17861. LTS : 'h:mm:ss A',
  17862. L : 'DD/MM/YYYY',
  17863. LL : 'D MMMM YYYY',
  17864. LLL : 'D MMMM YYYY h:mm A',
  17865. LLLL : 'dddd, D MMMM YYYY h:mm A'
  17866. },
  17867. calendar : {
  17868. sameDay : '[დღეს] LT[-ზე]',
  17869. nextDay : '[ხვალ] LT[-ზე]',
  17870. lastDay : '[გუშინ] LT[-ზე]',
  17871. nextWeek : '[შემდეგ] dddd LT[-ზე]',
  17872. lastWeek : '[წინა] dddd LT-ზე',
  17873. sameElse : 'L'
  17874. },
  17875. relativeTime : {
  17876. future : function (s) {
  17877. return (/(წამი|წუთი|საათი|წელი)/).test(s) ?
  17878. s.replace(/ი$/, 'ში') :
  17879. s + 'ში';
  17880. },
  17881. past : function (s) {
  17882. if ((/(წამი|წუთი|საათი|დღე|თვე)/).test(s)) {
  17883. return s.replace(/(ი|ე)$/, 'ის წინ');
  17884. }
  17885. if ((/წელი/).test(s)) {
  17886. return s.replace(/წელი$/, 'წლის წინ');
  17887. }
  17888. },
  17889. s : 'რამდენიმე წამი',
  17890. m : 'წუთი',
  17891. mm : '%d წუთი',
  17892. h : 'საათი',
  17893. hh : '%d საათი',
  17894. d : 'დღე',
  17895. dd : '%d დღე',
  17896. M : 'თვე',
  17897. MM : '%d თვე',
  17898. y : 'წელი',
  17899. yy : '%d წელი'
  17900. },
  17901. ordinalParse: /0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,
  17902. ordinal : function (number) {
  17903. if (number === 0) {
  17904. return number;
  17905. }
  17906. if (number === 1) {
  17907. return number + '-ლი';
  17908. }
  17909. if ((number < 20) || (number <= 100 && (number % 20 === 0)) || (number % 100 === 0)) {
  17910. return 'მე-' + number;
  17911. }
  17912. return number + '-ე';
  17913. },
  17914. week : {
  17915. dow : 1,
  17916. doy : 7
  17917. }
  17918. });
  17919. return ka;
  17920. })));
  17921. /***/ }),
  17922. /* 57 */
  17923. /***/ (function(module, exports, __webpack_require__) {
  17924. //! moment.js locale configuration
  17925. //! locale : Kazakh [kk]
  17926. //! authors : Nurlan Rakhimzhanov : https://github.com/nurlan
  17927. ;(function (global, factory) {
  17928. true ? factory(__webpack_require__(0)) :
  17929. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  17930. factory(global.moment)
  17931. }(this, (function (moment) { 'use strict';
  17932. var suffixes = {
  17933. 0: '-ші',
  17934. 1: '-ші',
  17935. 2: '-ші',
  17936. 3: '-ші',
  17937. 4: '-ші',
  17938. 5: '-ші',
  17939. 6: '-шы',
  17940. 7: '-ші',
  17941. 8: '-ші',
  17942. 9: '-шы',
  17943. 10: '-шы',
  17944. 20: '-шы',
  17945. 30: '-шы',
  17946. 40: '-шы',
  17947. 50: '-ші',
  17948. 60: '-шы',
  17949. 70: '-ші',
  17950. 80: '-ші',
  17951. 90: '-шы',
  17952. 100: '-ші'
  17953. };
  17954. var kk = moment.defineLocale('kk', {
  17955. months : 'қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан'.split('_'),
  17956. monthsShort : 'қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел'.split('_'),
  17957. weekdays : 'жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі'.split('_'),
  17958. weekdaysShort : 'жек_дүй_сей_сәр_бей_жұм_сен'.split('_'),
  17959. weekdaysMin : 'жк_дй_сй_ср_бй_жм_сн'.split('_'),
  17960. longDateFormat : {
  17961. LT : 'HH:mm',
  17962. LTS : 'HH:mm:ss',
  17963. L : 'DD.MM.YYYY',
  17964. LL : 'D MMMM YYYY',
  17965. LLL : 'D MMMM YYYY HH:mm',
  17966. LLLL : 'dddd, D MMMM YYYY HH:mm'
  17967. },
  17968. calendar : {
  17969. sameDay : '[Бүгін сағат] LT',
  17970. nextDay : '[Ертең сағат] LT',
  17971. nextWeek : 'dddd [сағат] LT',
  17972. lastDay : '[Кеше сағат] LT',
  17973. lastWeek : '[Өткен аптаның] dddd [сағат] LT',
  17974. sameElse : 'L'
  17975. },
  17976. relativeTime : {
  17977. future : '%s ішінде',
  17978. past : '%s бұрын',
  17979. s : 'бірнеше секунд',
  17980. m : 'бір минут',
  17981. mm : '%d минут',
  17982. h : 'бір сағат',
  17983. hh : '%d сағат',
  17984. d : 'бір күн',
  17985. dd : '%d күн',
  17986. M : 'бір ай',
  17987. MM : '%d ай',
  17988. y : 'бір жыл',
  17989. yy : '%d жыл'
  17990. },
  17991. ordinalParse: /\d{1,2}-(ші|шы)/,
  17992. ordinal : function (number) {
  17993. var a = number % 10,
  17994. b = number >= 100 ? 100 : null;
  17995. return number + (suffixes[number] || suffixes[a] || suffixes[b]);
  17996. },
  17997. week : {
  17998. dow : 1, // Monday is the first day of the week.
  17999. doy : 7 // The week that contains Jan 1st is the first week of the year.
  18000. }
  18001. });
  18002. return kk;
  18003. })));
  18004. /***/ }),
  18005. /* 58 */
  18006. /***/ (function(module, exports, __webpack_require__) {
  18007. //! moment.js locale configuration
  18008. //! locale : Cambodian [km]
  18009. //! author : Kruy Vanna : https://github.com/kruyvanna
  18010. ;(function (global, factory) {
  18011. true ? factory(__webpack_require__(0)) :
  18012. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  18013. factory(global.moment)
  18014. }(this, (function (moment) { 'use strict';
  18015. var km = moment.defineLocale('km', {
  18016. months: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),
  18017. monthsShort: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),
  18018. weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
  18019. weekdaysShort: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
  18020. weekdaysMin: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
  18021. longDateFormat: {
  18022. LT: 'HH:mm',
  18023. LTS : 'HH:mm:ss',
  18024. L: 'DD/MM/YYYY',
  18025. LL: 'D MMMM YYYY',
  18026. LLL: 'D MMMM YYYY HH:mm',
  18027. LLLL: 'dddd, D MMMM YYYY HH:mm'
  18028. },
  18029. calendar: {
  18030. sameDay: '[ថ្ងៃនេះ ម៉ោង] LT',
  18031. nextDay: '[ស្អែក ម៉ោង] LT',
  18032. nextWeek: 'dddd [ម៉ោង] LT',
  18033. lastDay: '[ម្សិលមិញ ម៉ោង] LT',
  18034. lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT',
  18035. sameElse: 'L'
  18036. },
  18037. relativeTime: {
  18038. future: '%sទៀត',
  18039. past: '%sមុន',
  18040. s: 'ប៉ុន្មានវិនាទី',
  18041. m: 'មួយនាទី',
  18042. mm: '%d នាទី',
  18043. h: 'មួយម៉ោង',
  18044. hh: '%d ម៉ោង',
  18045. d: 'មួយថ្ងៃ',
  18046. dd: '%d ថ្ងៃ',
  18047. M: 'មួយខែ',
  18048. MM: '%d ខែ',
  18049. y: 'មួយឆ្នាំ',
  18050. yy: '%d ឆ្នាំ'
  18051. },
  18052. week: {
  18053. dow: 1, // Monday is the first day of the week.
  18054. doy: 4 // The week that contains Jan 4th is the first week of the year.
  18055. }
  18056. });
  18057. return km;
  18058. })));
  18059. /***/ }),
  18060. /* 59 */
  18061. /***/ (function(module, exports, __webpack_require__) {
  18062. //! moment.js locale configuration
  18063. //! locale : Korean [ko]
  18064. //! author : Kyungwook, Park : https://github.com/kyungw00k
  18065. //! author : Jeeeyul Lee <jeeeyul@gmail.com>
  18066. ;(function (global, factory) {
  18067. true ? factory(__webpack_require__(0)) :
  18068. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  18069. factory(global.moment)
  18070. }(this, (function (moment) { 'use strict';
  18071. var ko = moment.defineLocale('ko', {
  18072. months : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),
  18073. monthsShort : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),
  18074. weekdays : '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'),
  18075. weekdaysShort : '일_월_화_수_목_금_토'.split('_'),
  18076. weekdaysMin : '일_월_화_수_목_금_토'.split('_'),
  18077. longDateFormat : {
  18078. LT : 'A h시 m분',
  18079. LTS : 'A h시 m분 s초',
  18080. L : 'YYYY.MM.DD',
  18081. LL : 'YYYY년 MMMM D일',
  18082. LLL : 'YYYY년 MMMM D일 A h시 m분',
  18083. LLLL : 'YYYY년 MMMM D일 dddd A h시 m분'
  18084. },
  18085. calendar : {
  18086. sameDay : '오늘 LT',
  18087. nextDay : '내일 LT',
  18088. nextWeek : 'dddd LT',
  18089. lastDay : '어제 LT',
  18090. lastWeek : '지난주 dddd LT',
  18091. sameElse : 'L'
  18092. },
  18093. relativeTime : {
  18094. future : '%s 후',
  18095. past : '%s 전',
  18096. s : '몇 초',
  18097. ss : '%d초',
  18098. m : '일분',
  18099. mm : '%d분',
  18100. h : '한 시간',
  18101. hh : '%d시간',
  18102. d : '하루',
  18103. dd : '%d일',
  18104. M : '한 달',
  18105. MM : '%d달',
  18106. y : '일 년',
  18107. yy : '%d년'
  18108. },
  18109. ordinalParse : /\d{1,2}일/,
  18110. ordinal : '%d일',
  18111. meridiemParse : /오전|오후/,
  18112. isPM : function (token) {
  18113. return token === '오후';
  18114. },
  18115. meridiem : function (hour, minute, isUpper) {
  18116. return hour < 12 ? '오전' : '오후';
  18117. }
  18118. });
  18119. return ko;
  18120. })));
  18121. /***/ }),
  18122. /* 60 */
  18123. /***/ (function(module, exports, __webpack_require__) {
  18124. //! moment.js locale configuration
  18125. //! locale : Kyrgyz [ky]
  18126. //! author : Chyngyz Arystan uulu : https://github.com/chyngyz
  18127. ;(function (global, factory) {
  18128. true ? factory(__webpack_require__(0)) :
  18129. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  18130. factory(global.moment)
  18131. }(this, (function (moment) { 'use strict';
  18132. var suffixes = {
  18133. 0: '-чү',
  18134. 1: '-чи',
  18135. 2: '-чи',
  18136. 3: '-чү',
  18137. 4: '-чү',
  18138. 5: '-чи',
  18139. 6: '-чы',
  18140. 7: '-чи',
  18141. 8: '-чи',
  18142. 9: '-чу',
  18143. 10: '-чу',
  18144. 20: '-чы',
  18145. 30: '-чу',
  18146. 40: '-чы',
  18147. 50: '-чү',
  18148. 60: '-чы',
  18149. 70: '-чи',
  18150. 80: '-чи',
  18151. 90: '-чу',
  18152. 100: '-чү'
  18153. };
  18154. var ky = moment.defineLocale('ky', {
  18155. months : 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),
  18156. monthsShort : 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'),
  18157. weekdays : 'Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби'.split('_'),
  18158. weekdaysShort : 'Жек_Дүй_Шей_Шар_Бей_Жум_Ише'.split('_'),
  18159. weekdaysMin : 'Жк_Дй_Шй_Шр_Бй_Жм_Иш'.split('_'),
  18160. longDateFormat : {
  18161. LT : 'HH:mm',
  18162. LTS : 'HH:mm:ss',
  18163. L : 'DD.MM.YYYY',
  18164. LL : 'D MMMM YYYY',
  18165. LLL : 'D MMMM YYYY HH:mm',
  18166. LLLL : 'dddd, D MMMM YYYY HH:mm'
  18167. },
  18168. calendar : {
  18169. sameDay : '[Бүгүн саат] LT',
  18170. nextDay : '[Эртең саат] LT',
  18171. nextWeek : 'dddd [саат] LT',
  18172. lastDay : '[Кече саат] LT',
  18173. lastWeek : '[Өткен аптанын] dddd [күнү] [саат] LT',
  18174. sameElse : 'L'
  18175. },
  18176. relativeTime : {
  18177. future : '%s ичинде',
  18178. past : '%s мурун',
  18179. s : 'бирнече секунд',
  18180. m : 'бир мүнөт',
  18181. mm : '%d мүнөт',
  18182. h : 'бир саат',
  18183. hh : '%d саат',
  18184. d : 'бир күн',
  18185. dd : '%d күн',
  18186. M : 'бир ай',
  18187. MM : '%d ай',
  18188. y : 'бир жыл',
  18189. yy : '%d жыл'
  18190. },
  18191. ordinalParse: /\d{1,2}-(чи|чы|чү|чу)/,
  18192. ordinal : function (number) {
  18193. var a = number % 10,
  18194. b = number >= 100 ? 100 : null;
  18195. return number + (suffixes[number] || suffixes[a] || suffixes[b]);
  18196. },
  18197. week : {
  18198. dow : 1, // Monday is the first day of the week.
  18199. doy : 7 // The week that contains Jan 1st is the first week of the year.
  18200. }
  18201. });
  18202. return ky;
  18203. })));
  18204. /***/ }),
  18205. /* 61 */
  18206. /***/ (function(module, exports, __webpack_require__) {
  18207. //! moment.js locale configuration
  18208. //! locale : Luxembourgish [lb]
  18209. //! author : mweimerskirch : https://github.com/mweimerskirch
  18210. //! author : David Raison : https://github.com/kwisatz
  18211. ;(function (global, factory) {
  18212. true ? factory(__webpack_require__(0)) :
  18213. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  18214. factory(global.moment)
  18215. }(this, (function (moment) { 'use strict';
  18216. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  18217. var format = {
  18218. 'm': ['eng Minutt', 'enger Minutt'],
  18219. 'h': ['eng Stonn', 'enger Stonn'],
  18220. 'd': ['een Dag', 'engem Dag'],
  18221. 'M': ['ee Mount', 'engem Mount'],
  18222. 'y': ['ee Joer', 'engem Joer']
  18223. };
  18224. return withoutSuffix ? format[key][0] : format[key][1];
  18225. }
  18226. function processFutureTime(string) {
  18227. var number = string.substr(0, string.indexOf(' '));
  18228. if (eifelerRegelAppliesToNumber(number)) {
  18229. return 'a ' + string;
  18230. }
  18231. return 'an ' + string;
  18232. }
  18233. function processPastTime(string) {
  18234. var number = string.substr(0, string.indexOf(' '));
  18235. if (eifelerRegelAppliesToNumber(number)) {
  18236. return 'viru ' + string;
  18237. }
  18238. return 'virun ' + string;
  18239. }
  18240. /**
  18241. * Returns true if the word before the given number loses the '-n' ending.
  18242. * e.g. 'an 10 Deeg' but 'a 5 Deeg'
  18243. *
  18244. * @param number {integer}
  18245. * @returns {boolean}
  18246. */
  18247. function eifelerRegelAppliesToNumber(number) {
  18248. number = parseInt(number, 10);
  18249. if (isNaN(number)) {
  18250. return false;
  18251. }
  18252. if (number < 0) {
  18253. // Negative Number --> always true
  18254. return true;
  18255. } else if (number < 10) {
  18256. // Only 1 digit
  18257. if (4 <= number && number <= 7) {
  18258. return true;
  18259. }
  18260. return false;
  18261. } else if (number < 100) {
  18262. // 2 digits
  18263. var lastDigit = number % 10, firstDigit = number / 10;
  18264. if (lastDigit === 0) {
  18265. return eifelerRegelAppliesToNumber(firstDigit);
  18266. }
  18267. return eifelerRegelAppliesToNumber(lastDigit);
  18268. } else if (number < 10000) {
  18269. // 3 or 4 digits --> recursively check first digit
  18270. while (number >= 10) {
  18271. number = number / 10;
  18272. }
  18273. return eifelerRegelAppliesToNumber(number);
  18274. } else {
  18275. // Anything larger than 4 digits: recursively check first n-3 digits
  18276. number = number / 1000;
  18277. return eifelerRegelAppliesToNumber(number);
  18278. }
  18279. }
  18280. var lb = moment.defineLocale('lb', {
  18281. months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
  18282. monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),
  18283. monthsParseExact : true,
  18284. weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split('_'),
  18285. weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'),
  18286. weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'),
  18287. weekdaysParseExact : true,
  18288. longDateFormat: {
  18289. LT: 'H:mm [Auer]',
  18290. LTS: 'H:mm:ss [Auer]',
  18291. L: 'DD.MM.YYYY',
  18292. LL: 'D. MMMM YYYY',
  18293. LLL: 'D. MMMM YYYY H:mm [Auer]',
  18294. LLLL: 'dddd, D. MMMM YYYY H:mm [Auer]'
  18295. },
  18296. calendar: {
  18297. sameDay: '[Haut um] LT',
  18298. sameElse: 'L',
  18299. nextDay: '[Muer um] LT',
  18300. nextWeek: 'dddd [um] LT',
  18301. lastDay: '[Gëschter um] LT',
  18302. lastWeek: function () {
  18303. // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule
  18304. switch (this.day()) {
  18305. case 2:
  18306. case 4:
  18307. return '[Leschten] dddd [um] LT';
  18308. default:
  18309. return '[Leschte] dddd [um] LT';
  18310. }
  18311. }
  18312. },
  18313. relativeTime : {
  18314. future : processFutureTime,
  18315. past : processPastTime,
  18316. s : 'e puer Sekonnen',
  18317. m : processRelativeTime,
  18318. mm : '%d Minutten',
  18319. h : processRelativeTime,
  18320. hh : '%d Stonnen',
  18321. d : processRelativeTime,
  18322. dd : '%d Deeg',
  18323. M : processRelativeTime,
  18324. MM : '%d Méint',
  18325. y : processRelativeTime,
  18326. yy : '%d Joer'
  18327. },
  18328. ordinalParse: /\d{1,2}\./,
  18329. ordinal: '%d.',
  18330. week: {
  18331. dow: 1, // Monday is the first day of the week.
  18332. doy: 4 // The week that contains Jan 4th is the first week of the year.
  18333. }
  18334. });
  18335. return lb;
  18336. })));
  18337. /***/ }),
  18338. /* 62 */
  18339. /***/ (function(module, exports, __webpack_require__) {
  18340. //! moment.js locale configuration
  18341. //! locale : Lao [lo]
  18342. //! author : Ryan Hart : https://github.com/ryanhart2
  18343. ;(function (global, factory) {
  18344. true ? factory(__webpack_require__(0)) :
  18345. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  18346. factory(global.moment)
  18347. }(this, (function (moment) { 'use strict';
  18348. var lo = moment.defineLocale('lo', {
  18349. months : 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'),
  18350. monthsShort : 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'),
  18351. weekdays : 'ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),
  18352. weekdaysShort : 'ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),
  18353. weekdaysMin : 'ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ'.split('_'),
  18354. weekdaysParseExact : true,
  18355. longDateFormat : {
  18356. LT : 'HH:mm',
  18357. LTS : 'HH:mm:ss',
  18358. L : 'DD/MM/YYYY',
  18359. LL : 'D MMMM YYYY',
  18360. LLL : 'D MMMM YYYY HH:mm',
  18361. LLLL : 'ວັນdddd D MMMM YYYY HH:mm'
  18362. },
  18363. meridiemParse: /ຕອນເຊົ້າ|ຕອນແລງ/,
  18364. isPM: function (input) {
  18365. return input === 'ຕອນແລງ';
  18366. },
  18367. meridiem : function (hour, minute, isLower) {
  18368. if (hour < 12) {
  18369. return 'ຕອນເຊົ້າ';
  18370. } else {
  18371. return 'ຕອນແລງ';
  18372. }
  18373. },
  18374. calendar : {
  18375. sameDay : '[ມື້ນີ້ເວລາ] LT',
  18376. nextDay : '[ມື້ອື່ນເວລາ] LT',
  18377. nextWeek : '[ວັນ]dddd[ໜ້າເວລາ] LT',
  18378. lastDay : '[ມື້ວານນີ້ເວລາ] LT',
  18379. lastWeek : '[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT',
  18380. sameElse : 'L'
  18381. },
  18382. relativeTime : {
  18383. future : 'ອີກ %s',
  18384. past : '%sຜ່ານມາ',
  18385. s : 'ບໍ່ເທົ່າໃດວິນາທີ',
  18386. m : '1 ນາທີ',
  18387. mm : '%d ນາທີ',
  18388. h : '1 ຊົ່ວໂມງ',
  18389. hh : '%d ຊົ່ວໂມງ',
  18390. d : '1 ມື້',
  18391. dd : '%d ມື້',
  18392. M : '1 ເດືອນ',
  18393. MM : '%d ເດືອນ',
  18394. y : '1 ປີ',
  18395. yy : '%d ປີ'
  18396. },
  18397. ordinalParse: /(ທີ່)\d{1,2}/,
  18398. ordinal : function (number) {
  18399. return 'ທີ່' + number;
  18400. }
  18401. });
  18402. return lo;
  18403. })));
  18404. /***/ }),
  18405. /* 63 */
  18406. /***/ (function(module, exports, __webpack_require__) {
  18407. //! moment.js locale configuration
  18408. //! locale : Lithuanian [lt]
  18409. //! author : Mindaugas Mozūras : https://github.com/mmozuras
  18410. ;(function (global, factory) {
  18411. true ? factory(__webpack_require__(0)) :
  18412. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  18413. factory(global.moment)
  18414. }(this, (function (moment) { 'use strict';
  18415. var units = {
  18416. 'm' : 'minutė_minutės_minutę',
  18417. 'mm': 'minutės_minučių_minutes',
  18418. 'h' : 'valanda_valandos_valandą',
  18419. 'hh': 'valandos_valandų_valandas',
  18420. 'd' : 'diena_dienos_dieną',
  18421. 'dd': 'dienos_dienų_dienas',
  18422. 'M' : 'mėnuo_mėnesio_mėnesį',
  18423. 'MM': 'mėnesiai_mėnesių_mėnesius',
  18424. 'y' : 'metai_metų_metus',
  18425. 'yy': 'metai_metų_metus'
  18426. };
  18427. function translateSeconds(number, withoutSuffix, key, isFuture) {
  18428. if (withoutSuffix) {
  18429. return 'kelios sekundės';
  18430. } else {
  18431. return isFuture ? 'kelių sekundžių' : 'kelias sekundes';
  18432. }
  18433. }
  18434. function translateSingular(number, withoutSuffix, key, isFuture) {
  18435. return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : forms(key)[2]);
  18436. }
  18437. function special(number) {
  18438. return number % 10 === 0 || (number > 10 && number < 20);
  18439. }
  18440. function forms(key) {
  18441. return units[key].split('_');
  18442. }
  18443. function translate(number, withoutSuffix, key, isFuture) {
  18444. var result = number + ' ';
  18445. if (number === 1) {
  18446. return result + translateSingular(number, withoutSuffix, key[0], isFuture);
  18447. } else if (withoutSuffix) {
  18448. return result + (special(number) ? forms(key)[1] : forms(key)[0]);
  18449. } else {
  18450. if (isFuture) {
  18451. return result + forms(key)[1];
  18452. } else {
  18453. return result + (special(number) ? forms(key)[1] : forms(key)[2]);
  18454. }
  18455. }
  18456. }
  18457. var lt = moment.defineLocale('lt', {
  18458. months : {
  18459. format: 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_'),
  18460. standalone: 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split('_'),
  18461. isFormat: /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/
  18462. },
  18463. monthsShort : 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'),
  18464. weekdays : {
  18465. format: 'sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį'.split('_'),
  18466. standalone: 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_'),
  18467. isFormat: /dddd HH:mm/
  18468. },
  18469. weekdaysShort : 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'),
  18470. weekdaysMin : 'S_P_A_T_K_Pn_Š'.split('_'),
  18471. weekdaysParseExact : true,
  18472. longDateFormat : {
  18473. LT : 'HH:mm',
  18474. LTS : 'HH:mm:ss',
  18475. L : 'YYYY-MM-DD',
  18476. LL : 'YYYY [m.] MMMM D [d.]',
  18477. LLL : 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
  18478. LLLL : 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]',
  18479. l : 'YYYY-MM-DD',
  18480. ll : 'YYYY [m.] MMMM D [d.]',
  18481. lll : 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
  18482. llll : 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]'
  18483. },
  18484. calendar : {
  18485. sameDay : '[Šiandien] LT',
  18486. nextDay : '[Rytoj] LT',
  18487. nextWeek : 'dddd LT',
  18488. lastDay : '[Vakar] LT',
  18489. lastWeek : '[Praėjusį] dddd LT',
  18490. sameElse : 'L'
  18491. },
  18492. relativeTime : {
  18493. future : 'po %s',
  18494. past : 'prieš %s',
  18495. s : translateSeconds,
  18496. m : translateSingular,
  18497. mm : translate,
  18498. h : translateSingular,
  18499. hh : translate,
  18500. d : translateSingular,
  18501. dd : translate,
  18502. M : translateSingular,
  18503. MM : translate,
  18504. y : translateSingular,
  18505. yy : translate
  18506. },
  18507. ordinalParse: /\d{1,2}-oji/,
  18508. ordinal : function (number) {
  18509. return number + '-oji';
  18510. },
  18511. week : {
  18512. dow : 1, // Monday is the first day of the week.
  18513. doy : 4 // The week that contains Jan 4th is the first week of the year.
  18514. }
  18515. });
  18516. return lt;
  18517. })));
  18518. /***/ }),
  18519. /* 64 */
  18520. /***/ (function(module, exports, __webpack_require__) {
  18521. //! moment.js locale configuration
  18522. //! locale : Latvian [lv]
  18523. //! author : Kristaps Karlsons : https://github.com/skakri
  18524. //! author : Jānis Elmeris : https://github.com/JanisE
  18525. ;(function (global, factory) {
  18526. true ? factory(__webpack_require__(0)) :
  18527. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  18528. factory(global.moment)
  18529. }(this, (function (moment) { 'use strict';
  18530. var units = {
  18531. 'm': 'minūtes_minūtēm_minūte_minūtes'.split('_'),
  18532. 'mm': 'minūtes_minūtēm_minūte_minūtes'.split('_'),
  18533. 'h': 'stundas_stundām_stunda_stundas'.split('_'),
  18534. 'hh': 'stundas_stundām_stunda_stundas'.split('_'),
  18535. 'd': 'dienas_dienām_diena_dienas'.split('_'),
  18536. 'dd': 'dienas_dienām_diena_dienas'.split('_'),
  18537. 'M': 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),
  18538. 'MM': 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),
  18539. 'y': 'gada_gadiem_gads_gadi'.split('_'),
  18540. 'yy': 'gada_gadiem_gads_gadi'.split('_')
  18541. };
  18542. /**
  18543. * @param withoutSuffix boolean true = a length of time; false = before/after a period of time.
  18544. */
  18545. function format(forms, number, withoutSuffix) {
  18546. if (withoutSuffix) {
  18547. // E.g. "21 minūte", "3 minūtes".
  18548. return number % 10 === 1 && number % 100 !== 11 ? forms[2] : forms[3];
  18549. } else {
  18550. // E.g. "21 minūtes" as in "pēc 21 minūtes".
  18551. // E.g. "3 minūtēm" as in "pēc 3 minūtēm".
  18552. return number % 10 === 1 && number % 100 !== 11 ? forms[0] : forms[1];
  18553. }
  18554. }
  18555. function relativeTimeWithPlural(number, withoutSuffix, key) {
  18556. return number + ' ' + format(units[key], number, withoutSuffix);
  18557. }
  18558. function relativeTimeWithSingular(number, withoutSuffix, key) {
  18559. return format(units[key], number, withoutSuffix);
  18560. }
  18561. function relativeSeconds(number, withoutSuffix) {
  18562. return withoutSuffix ? 'dažas sekundes' : 'dažām sekundēm';
  18563. }
  18564. var lv = moment.defineLocale('lv', {
  18565. months : 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split('_'),
  18566. monthsShort : 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'),
  18567. weekdays : 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split('_'),
  18568. weekdaysShort : 'Sv_P_O_T_C_Pk_S'.split('_'),
  18569. weekdaysMin : 'Sv_P_O_T_C_Pk_S'.split('_'),
  18570. weekdaysParseExact : true,
  18571. longDateFormat : {
  18572. LT : 'HH:mm',
  18573. LTS : 'HH:mm:ss',
  18574. L : 'DD.MM.YYYY.',
  18575. LL : 'YYYY. [gada] D. MMMM',
  18576. LLL : 'YYYY. [gada] D. MMMM, HH:mm',
  18577. LLLL : 'YYYY. [gada] D. MMMM, dddd, HH:mm'
  18578. },
  18579. calendar : {
  18580. sameDay : '[Šodien pulksten] LT',
  18581. nextDay : '[Rīt pulksten] LT',
  18582. nextWeek : 'dddd [pulksten] LT',
  18583. lastDay : '[Vakar pulksten] LT',
  18584. lastWeek : '[Pagājušā] dddd [pulksten] LT',
  18585. sameElse : 'L'
  18586. },
  18587. relativeTime : {
  18588. future : 'pēc %s',
  18589. past : 'pirms %s',
  18590. s : relativeSeconds,
  18591. m : relativeTimeWithSingular,
  18592. mm : relativeTimeWithPlural,
  18593. h : relativeTimeWithSingular,
  18594. hh : relativeTimeWithPlural,
  18595. d : relativeTimeWithSingular,
  18596. dd : relativeTimeWithPlural,
  18597. M : relativeTimeWithSingular,
  18598. MM : relativeTimeWithPlural,
  18599. y : relativeTimeWithSingular,
  18600. yy : relativeTimeWithPlural
  18601. },
  18602. ordinalParse: /\d{1,2}\./,
  18603. ordinal : '%d.',
  18604. week : {
  18605. dow : 1, // Monday is the first day of the week.
  18606. doy : 4 // The week that contains Jan 4th is the first week of the year.
  18607. }
  18608. });
  18609. return lv;
  18610. })));
  18611. /***/ }),
  18612. /* 65 */
  18613. /***/ (function(module, exports, __webpack_require__) {
  18614. //! moment.js locale configuration
  18615. //! locale : Montenegrin [me]
  18616. //! author : Miodrag Nikač <miodrag@restartit.me> : https://github.com/miodragnikac
  18617. ;(function (global, factory) {
  18618. true ? factory(__webpack_require__(0)) :
  18619. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  18620. factory(global.moment)
  18621. }(this, (function (moment) { 'use strict';
  18622. var translator = {
  18623. words: { //Different grammatical cases
  18624. m: ['jedan minut', 'jednog minuta'],
  18625. mm: ['minut', 'minuta', 'minuta'],
  18626. h: ['jedan sat', 'jednog sata'],
  18627. hh: ['sat', 'sata', 'sati'],
  18628. dd: ['dan', 'dana', 'dana'],
  18629. MM: ['mjesec', 'mjeseca', 'mjeseci'],
  18630. yy: ['godina', 'godine', 'godina']
  18631. },
  18632. correctGrammaticalCase: function (number, wordKey) {
  18633. return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);
  18634. },
  18635. translate: function (number, withoutSuffix, key) {
  18636. var wordKey = translator.words[key];
  18637. if (key.length === 1) {
  18638. return withoutSuffix ? wordKey[0] : wordKey[1];
  18639. } else {
  18640. return number + ' ' + translator.correctGrammaticalCase(number, wordKey);
  18641. }
  18642. }
  18643. };
  18644. var me = moment.defineLocale('me', {
  18645. months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split('_'),
  18646. monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),
  18647. monthsParseExact : true,
  18648. weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
  18649. weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
  18650. weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
  18651. weekdaysParseExact : true,
  18652. longDateFormat: {
  18653. LT: 'H:mm',
  18654. LTS : 'H:mm:ss',
  18655. L: 'DD.MM.YYYY',
  18656. LL: 'D. MMMM YYYY',
  18657. LLL: 'D. MMMM YYYY H:mm',
  18658. LLLL: 'dddd, D. MMMM YYYY H:mm'
  18659. },
  18660. calendar: {
  18661. sameDay: '[danas u] LT',
  18662. nextDay: '[sjutra u] LT',
  18663. nextWeek: function () {
  18664. switch (this.day()) {
  18665. case 0:
  18666. return '[u] [nedjelju] [u] LT';
  18667. case 3:
  18668. return '[u] [srijedu] [u] LT';
  18669. case 6:
  18670. return '[u] [subotu] [u] LT';
  18671. case 1:
  18672. case 2:
  18673. case 4:
  18674. case 5:
  18675. return '[u] dddd [u] LT';
  18676. }
  18677. },
  18678. lastDay : '[juče u] LT',
  18679. lastWeek : function () {
  18680. var lastWeekDays = [
  18681. '[prošle] [nedjelje] [u] LT',
  18682. '[prošlog] [ponedjeljka] [u] LT',
  18683. '[prošlog] [utorka] [u] LT',
  18684. '[prošle] [srijede] [u] LT',
  18685. '[prošlog] [četvrtka] [u] LT',
  18686. '[prošlog] [petka] [u] LT',
  18687. '[prošle] [subote] [u] LT'
  18688. ];
  18689. return lastWeekDays[this.day()];
  18690. },
  18691. sameElse : 'L'
  18692. },
  18693. relativeTime : {
  18694. future : 'za %s',
  18695. past : 'prije %s',
  18696. s : 'nekoliko sekundi',
  18697. m : translator.translate,
  18698. mm : translator.translate,
  18699. h : translator.translate,
  18700. hh : translator.translate,
  18701. d : 'dan',
  18702. dd : translator.translate,
  18703. M : 'mjesec',
  18704. MM : translator.translate,
  18705. y : 'godinu',
  18706. yy : translator.translate
  18707. },
  18708. ordinalParse: /\d{1,2}\./,
  18709. ordinal : '%d.',
  18710. week : {
  18711. dow : 1, // Monday is the first day of the week.
  18712. doy : 7 // The week that contains Jan 1st is the first week of the year.
  18713. }
  18714. });
  18715. return me;
  18716. })));
  18717. /***/ }),
  18718. /* 66 */
  18719. /***/ (function(module, exports, __webpack_require__) {
  18720. //! moment.js locale configuration
  18721. //! locale : Maori [mi]
  18722. //! author : John Corrigan <robbiecloset@gmail.com> : https://github.com/johnideal
  18723. ;(function (global, factory) {
  18724. true ? factory(__webpack_require__(0)) :
  18725. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  18726. factory(global.moment)
  18727. }(this, (function (moment) { 'use strict';
  18728. var mi = moment.defineLocale('mi', {
  18729. months: 'Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea'.split('_'),
  18730. monthsShort: 'Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki'.split('_'),
  18731. monthsRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
  18732. monthsStrictRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
  18733. monthsShortRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
  18734. monthsShortStrictRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,
  18735. weekdays: 'Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei'.split('_'),
  18736. weekdaysShort: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),
  18737. weekdaysMin: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),
  18738. longDateFormat: {
  18739. LT: 'HH:mm',
  18740. LTS: 'HH:mm:ss',
  18741. L: 'DD/MM/YYYY',
  18742. LL: 'D MMMM YYYY',
  18743. LLL: 'D MMMM YYYY [i] HH:mm',
  18744. LLLL: 'dddd, D MMMM YYYY [i] HH:mm'
  18745. },
  18746. calendar: {
  18747. sameDay: '[i teie mahana, i] LT',
  18748. nextDay: '[apopo i] LT',
  18749. nextWeek: 'dddd [i] LT',
  18750. lastDay: '[inanahi i] LT',
  18751. lastWeek: 'dddd [whakamutunga i] LT',
  18752. sameElse: 'L'
  18753. },
  18754. relativeTime: {
  18755. future: 'i roto i %s',
  18756. past: '%s i mua',
  18757. s: 'te hēkona ruarua',
  18758. m: 'he meneti',
  18759. mm: '%d meneti',
  18760. h: 'te haora',
  18761. hh: '%d haora',
  18762. d: 'he ra',
  18763. dd: '%d ra',
  18764. M: 'he marama',
  18765. MM: '%d marama',
  18766. y: 'he tau',
  18767. yy: '%d tau'
  18768. },
  18769. ordinalParse: /\d{1,2}º/,
  18770. ordinal: '%dº',
  18771. week : {
  18772. dow : 1, // Monday is the first day of the week.
  18773. doy : 4 // The week that contains Jan 4th is the first week of the year.
  18774. }
  18775. });
  18776. return mi;
  18777. })));
  18778. /***/ }),
  18779. /* 67 */
  18780. /***/ (function(module, exports, __webpack_require__) {
  18781. //! moment.js locale configuration
  18782. //! locale : Macedonian [mk]
  18783. //! author : Borislav Mickov : https://github.com/B0k0
  18784. ;(function (global, factory) {
  18785. true ? factory(__webpack_require__(0)) :
  18786. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  18787. factory(global.moment)
  18788. }(this, (function (moment) { 'use strict';
  18789. var mk = moment.defineLocale('mk', {
  18790. months : 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split('_'),
  18791. monthsShort : 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'),
  18792. weekdays : 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split('_'),
  18793. weekdaysShort : 'нед_пон_вто_сре_чет_пет_саб'.split('_'),
  18794. weekdaysMin : 'нe_пo_вт_ср_че_пе_сa'.split('_'),
  18795. longDateFormat : {
  18796. LT : 'H:mm',
  18797. LTS : 'H:mm:ss',
  18798. L : 'D.MM.YYYY',
  18799. LL : 'D MMMM YYYY',
  18800. LLL : 'D MMMM YYYY H:mm',
  18801. LLLL : 'dddd, D MMMM YYYY H:mm'
  18802. },
  18803. calendar : {
  18804. sameDay : '[Денес во] LT',
  18805. nextDay : '[Утре во] LT',
  18806. nextWeek : '[Во] dddd [во] LT',
  18807. lastDay : '[Вчера во] LT',
  18808. lastWeek : function () {
  18809. switch (this.day()) {
  18810. case 0:
  18811. case 3:
  18812. case 6:
  18813. return '[Изминатата] dddd [во] LT';
  18814. case 1:
  18815. case 2:
  18816. case 4:
  18817. case 5:
  18818. return '[Изминатиот] dddd [во] LT';
  18819. }
  18820. },
  18821. sameElse : 'L'
  18822. },
  18823. relativeTime : {
  18824. future : 'после %s',
  18825. past : 'пред %s',
  18826. s : 'неколку секунди',
  18827. m : 'минута',
  18828. mm : '%d минути',
  18829. h : 'час',
  18830. hh : '%d часа',
  18831. d : 'ден',
  18832. dd : '%d дена',
  18833. M : 'месец',
  18834. MM : '%d месеци',
  18835. y : 'година',
  18836. yy : '%d години'
  18837. },
  18838. ordinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
  18839. ordinal : function (number) {
  18840. var lastDigit = number % 10,
  18841. last2Digits = number % 100;
  18842. if (number === 0) {
  18843. return number + '-ев';
  18844. } else if (last2Digits === 0) {
  18845. return number + '-ен';
  18846. } else if (last2Digits > 10 && last2Digits < 20) {
  18847. return number + '-ти';
  18848. } else if (lastDigit === 1) {
  18849. return number + '-ви';
  18850. } else if (lastDigit === 2) {
  18851. return number + '-ри';
  18852. } else if (lastDigit === 7 || lastDigit === 8) {
  18853. return number + '-ми';
  18854. } else {
  18855. return number + '-ти';
  18856. }
  18857. },
  18858. week : {
  18859. dow : 1, // Monday is the first day of the week.
  18860. doy : 7 // The week that contains Jan 1st is the first week of the year.
  18861. }
  18862. });
  18863. return mk;
  18864. })));
  18865. /***/ }),
  18866. /* 68 */
  18867. /***/ (function(module, exports, __webpack_require__) {
  18868. //! moment.js locale configuration
  18869. //! locale : Malayalam [ml]
  18870. //! author : Floyd Pink : https://github.com/floydpink
  18871. ;(function (global, factory) {
  18872. true ? factory(__webpack_require__(0)) :
  18873. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  18874. factory(global.moment)
  18875. }(this, (function (moment) { 'use strict';
  18876. var ml = moment.defineLocale('ml', {
  18877. months : 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split('_'),
  18878. monthsShort : 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split('_'),
  18879. monthsParseExact : true,
  18880. weekdays : 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split('_'),
  18881. weekdaysShort : 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'),
  18882. weekdaysMin : 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'),
  18883. longDateFormat : {
  18884. LT : 'A h:mm -നു',
  18885. LTS : 'A h:mm:ss -നു',
  18886. L : 'DD/MM/YYYY',
  18887. LL : 'D MMMM YYYY',
  18888. LLL : 'D MMMM YYYY, A h:mm -നു',
  18889. LLLL : 'dddd, D MMMM YYYY, A h:mm -നു'
  18890. },
  18891. calendar : {
  18892. sameDay : '[ഇന്ന്] LT',
  18893. nextDay : '[നാളെ] LT',
  18894. nextWeek : 'dddd, LT',
  18895. lastDay : '[ഇന്നലെ] LT',
  18896. lastWeek : '[കഴിഞ്ഞ] dddd, LT',
  18897. sameElse : 'L'
  18898. },
  18899. relativeTime : {
  18900. future : '%s കഴിഞ്ഞ്',
  18901. past : '%s മുൻപ്',
  18902. s : 'അൽപ നിമിഷങ്ങൾ',
  18903. m : 'ഒരു മിനിറ്റ്',
  18904. mm : '%d മിനിറ്റ്',
  18905. h : 'ഒരു മണിക്കൂർ',
  18906. hh : '%d മണിക്കൂർ',
  18907. d : 'ഒരു ദിവസം',
  18908. dd : '%d ദിവസം',
  18909. M : 'ഒരു മാസം',
  18910. MM : '%d മാസം',
  18911. y : 'ഒരു വർഷം',
  18912. yy : '%d വർഷം'
  18913. },
  18914. meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,
  18915. meridiemHour : function (hour, meridiem) {
  18916. if (hour === 12) {
  18917. hour = 0;
  18918. }
  18919. if ((meridiem === 'രാത്രി' && hour >= 4) ||
  18920. meridiem === 'ഉച്ച കഴിഞ്ഞ്' ||
  18921. meridiem === 'വൈകുന്നേരം') {
  18922. return hour + 12;
  18923. } else {
  18924. return hour;
  18925. }
  18926. },
  18927. meridiem : function (hour, minute, isLower) {
  18928. if (hour < 4) {
  18929. return 'രാത്രി';
  18930. } else if (hour < 12) {
  18931. return 'രാവിലെ';
  18932. } else if (hour < 17) {
  18933. return 'ഉച്ച കഴിഞ്ഞ്';
  18934. } else if (hour < 20) {
  18935. return 'വൈകുന്നേരം';
  18936. } else {
  18937. return 'രാത്രി';
  18938. }
  18939. }
  18940. });
  18941. return ml;
  18942. })));
  18943. /***/ }),
  18944. /* 69 */
  18945. /***/ (function(module, exports, __webpack_require__) {
  18946. //! moment.js locale configuration
  18947. //! locale : Marathi [mr]
  18948. //! author : Harshad Kale : https://github.com/kalehv
  18949. //! author : Vivek Athalye : https://github.com/vnathalye
  18950. ;(function (global, factory) {
  18951. true ? factory(__webpack_require__(0)) :
  18952. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  18953. factory(global.moment)
  18954. }(this, (function (moment) { 'use strict';
  18955. var symbolMap = {
  18956. '1': '१',
  18957. '2': '२',
  18958. '3': '३',
  18959. '4': '४',
  18960. '5': '५',
  18961. '6': '६',
  18962. '7': '७',
  18963. '8': '८',
  18964. '9': '९',
  18965. '0': '०'
  18966. };
  18967. var numberMap = {
  18968. '१': '1',
  18969. '२': '2',
  18970. '३': '3',
  18971. '४': '4',
  18972. '५': '5',
  18973. '६': '6',
  18974. '७': '7',
  18975. '८': '8',
  18976. '९': '9',
  18977. '०': '0'
  18978. };
  18979. function relativeTimeMr(number, withoutSuffix, string, isFuture)
  18980. {
  18981. var output = '';
  18982. if (withoutSuffix) {
  18983. switch (string) {
  18984. case 's': output = 'काही सेकंद'; break;
  18985. case 'm': output = 'एक मिनिट'; break;
  18986. case 'mm': output = '%d मिनिटे'; break;
  18987. case 'h': output = 'एक तास'; break;
  18988. case 'hh': output = '%d तास'; break;
  18989. case 'd': output = 'एक दिवस'; break;
  18990. case 'dd': output = '%d दिवस'; break;
  18991. case 'M': output = 'एक महिना'; break;
  18992. case 'MM': output = '%d महिने'; break;
  18993. case 'y': output = 'एक वर्ष'; break;
  18994. case 'yy': output = '%d वर्षे'; break;
  18995. }
  18996. }
  18997. else {
  18998. switch (string) {
  18999. case 's': output = 'काही सेकंदां'; break;
  19000. case 'm': output = 'एका मिनिटा'; break;
  19001. case 'mm': output = '%d मिनिटां'; break;
  19002. case 'h': output = 'एका तासा'; break;
  19003. case 'hh': output = '%d तासां'; break;
  19004. case 'd': output = 'एका दिवसा'; break;
  19005. case 'dd': output = '%d दिवसां'; break;
  19006. case 'M': output = 'एका महिन्या'; break;
  19007. case 'MM': output = '%d महिन्यां'; break;
  19008. case 'y': output = 'एका वर्षा'; break;
  19009. case 'yy': output = '%d वर्षां'; break;
  19010. }
  19011. }
  19012. return output.replace(/%d/i, number);
  19013. }
  19014. var mr = moment.defineLocale('mr', {
  19015. months : 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split('_'),
  19016. monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split('_'),
  19017. monthsParseExact : true,
  19018. weekdays : 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
  19019. weekdaysShort : 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'),
  19020. weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'),
  19021. longDateFormat : {
  19022. LT : 'A h:mm वाजता',
  19023. LTS : 'A h:mm:ss वाजता',
  19024. L : 'DD/MM/YYYY',
  19025. LL : 'D MMMM YYYY',
  19026. LLL : 'D MMMM YYYY, A h:mm वाजता',
  19027. LLLL : 'dddd, D MMMM YYYY, A h:mm वाजता'
  19028. },
  19029. calendar : {
  19030. sameDay : '[आज] LT',
  19031. nextDay : '[उद्या] LT',
  19032. nextWeek : 'dddd, LT',
  19033. lastDay : '[काल] LT',
  19034. lastWeek: '[मागील] dddd, LT',
  19035. sameElse : 'L'
  19036. },
  19037. relativeTime : {
  19038. future: '%sमध्ये',
  19039. past: '%sपूर्वी',
  19040. s: relativeTimeMr,
  19041. m: relativeTimeMr,
  19042. mm: relativeTimeMr,
  19043. h: relativeTimeMr,
  19044. hh: relativeTimeMr,
  19045. d: relativeTimeMr,
  19046. dd: relativeTimeMr,
  19047. M: relativeTimeMr,
  19048. MM: relativeTimeMr,
  19049. y: relativeTimeMr,
  19050. yy: relativeTimeMr
  19051. },
  19052. preparse: function (string) {
  19053. return string.replace(/[१२३४५६७८९०]/g, function (match) {
  19054. return numberMap[match];
  19055. });
  19056. },
  19057. postformat: function (string) {
  19058. return string.replace(/\d/g, function (match) {
  19059. return symbolMap[match];
  19060. });
  19061. },
  19062. meridiemParse: /रात्री|सकाळी|दुपारी|सायंकाळी/,
  19063. meridiemHour : function (hour, meridiem) {
  19064. if (hour === 12) {
  19065. hour = 0;
  19066. }
  19067. if (meridiem === 'रात्री') {
  19068. return hour < 4 ? hour : hour + 12;
  19069. } else if (meridiem === 'सकाळी') {
  19070. return hour;
  19071. } else if (meridiem === 'दुपारी') {
  19072. return hour >= 10 ? hour : hour + 12;
  19073. } else if (meridiem === 'सायंकाळी') {
  19074. return hour + 12;
  19075. }
  19076. },
  19077. meridiem: function (hour, minute, isLower) {
  19078. if (hour < 4) {
  19079. return 'रात्री';
  19080. } else if (hour < 10) {
  19081. return 'सकाळी';
  19082. } else if (hour < 17) {
  19083. return 'दुपारी';
  19084. } else if (hour < 20) {
  19085. return 'सायंकाळी';
  19086. } else {
  19087. return 'रात्री';
  19088. }
  19089. },
  19090. week : {
  19091. dow : 0, // Sunday is the first day of the week.
  19092. doy : 6 // The week that contains Jan 1st is the first week of the year.
  19093. }
  19094. });
  19095. return mr;
  19096. })));
  19097. /***/ }),
  19098. /* 70 */
  19099. /***/ (function(module, exports, __webpack_require__) {
  19100. //! moment.js locale configuration
  19101. //! locale : Malay [ms-my]
  19102. //! note : DEPRECATED, the correct one is [ms]
  19103. //! author : Weldan Jamili : https://github.com/weldan
  19104. ;(function (global, factory) {
  19105. true ? factory(__webpack_require__(0)) :
  19106. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  19107. factory(global.moment)
  19108. }(this, (function (moment) { 'use strict';
  19109. var msMy = moment.defineLocale('ms-my', {
  19110. months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'),
  19111. monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
  19112. weekdays : 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
  19113. weekdaysShort : 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
  19114. weekdaysMin : 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
  19115. longDateFormat : {
  19116. LT : 'HH.mm',
  19117. LTS : 'HH.mm.ss',
  19118. L : 'DD/MM/YYYY',
  19119. LL : 'D MMMM YYYY',
  19120. LLL : 'D MMMM YYYY [pukul] HH.mm',
  19121. LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
  19122. },
  19123. meridiemParse: /pagi|tengahari|petang|malam/,
  19124. meridiemHour: function (hour, meridiem) {
  19125. if (hour === 12) {
  19126. hour = 0;
  19127. }
  19128. if (meridiem === 'pagi') {
  19129. return hour;
  19130. } else if (meridiem === 'tengahari') {
  19131. return hour >= 11 ? hour : hour + 12;
  19132. } else if (meridiem === 'petang' || meridiem === 'malam') {
  19133. return hour + 12;
  19134. }
  19135. },
  19136. meridiem : function (hours, minutes, isLower) {
  19137. if (hours < 11) {
  19138. return 'pagi';
  19139. } else if (hours < 15) {
  19140. return 'tengahari';
  19141. } else if (hours < 19) {
  19142. return 'petang';
  19143. } else {
  19144. return 'malam';
  19145. }
  19146. },
  19147. calendar : {
  19148. sameDay : '[Hari ini pukul] LT',
  19149. nextDay : '[Esok pukul] LT',
  19150. nextWeek : 'dddd [pukul] LT',
  19151. lastDay : '[Kelmarin pukul] LT',
  19152. lastWeek : 'dddd [lepas pukul] LT',
  19153. sameElse : 'L'
  19154. },
  19155. relativeTime : {
  19156. future : 'dalam %s',
  19157. past : '%s yang lepas',
  19158. s : 'beberapa saat',
  19159. m : 'seminit',
  19160. mm : '%d minit',
  19161. h : 'sejam',
  19162. hh : '%d jam',
  19163. d : 'sehari',
  19164. dd : '%d hari',
  19165. M : 'sebulan',
  19166. MM : '%d bulan',
  19167. y : 'setahun',
  19168. yy : '%d tahun'
  19169. },
  19170. week : {
  19171. dow : 1, // Monday is the first day of the week.
  19172. doy : 7 // The week that contains Jan 1st is the first week of the year.
  19173. }
  19174. });
  19175. return msMy;
  19176. })));
  19177. /***/ }),
  19178. /* 71 */
  19179. /***/ (function(module, exports, __webpack_require__) {
  19180. //! moment.js locale configuration
  19181. //! locale : Malay [ms]
  19182. //! author : Weldan Jamili : https://github.com/weldan
  19183. ;(function (global, factory) {
  19184. true ? factory(__webpack_require__(0)) :
  19185. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  19186. factory(global.moment)
  19187. }(this, (function (moment) { 'use strict';
  19188. var ms = moment.defineLocale('ms', {
  19189. months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'),
  19190. monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
  19191. weekdays : 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
  19192. weekdaysShort : 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
  19193. weekdaysMin : 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
  19194. longDateFormat : {
  19195. LT : 'HH.mm',
  19196. LTS : 'HH.mm.ss',
  19197. L : 'DD/MM/YYYY',
  19198. LL : 'D MMMM YYYY',
  19199. LLL : 'D MMMM YYYY [pukul] HH.mm',
  19200. LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
  19201. },
  19202. meridiemParse: /pagi|tengahari|petang|malam/,
  19203. meridiemHour: function (hour, meridiem) {
  19204. if (hour === 12) {
  19205. hour = 0;
  19206. }
  19207. if (meridiem === 'pagi') {
  19208. return hour;
  19209. } else if (meridiem === 'tengahari') {
  19210. return hour >= 11 ? hour : hour + 12;
  19211. } else if (meridiem === 'petang' || meridiem === 'malam') {
  19212. return hour + 12;
  19213. }
  19214. },
  19215. meridiem : function (hours, minutes, isLower) {
  19216. if (hours < 11) {
  19217. return 'pagi';
  19218. } else if (hours < 15) {
  19219. return 'tengahari';
  19220. } else if (hours < 19) {
  19221. return 'petang';
  19222. } else {
  19223. return 'malam';
  19224. }
  19225. },
  19226. calendar : {
  19227. sameDay : '[Hari ini pukul] LT',
  19228. nextDay : '[Esok pukul] LT',
  19229. nextWeek : 'dddd [pukul] LT',
  19230. lastDay : '[Kelmarin pukul] LT',
  19231. lastWeek : 'dddd [lepas pukul] LT',
  19232. sameElse : 'L'
  19233. },
  19234. relativeTime : {
  19235. future : 'dalam %s',
  19236. past : '%s yang lepas',
  19237. s : 'beberapa saat',
  19238. m : 'seminit',
  19239. mm : '%d minit',
  19240. h : 'sejam',
  19241. hh : '%d jam',
  19242. d : 'sehari',
  19243. dd : '%d hari',
  19244. M : 'sebulan',
  19245. MM : '%d bulan',
  19246. y : 'setahun',
  19247. yy : '%d tahun'
  19248. },
  19249. week : {
  19250. dow : 1, // Monday is the first day of the week.
  19251. doy : 7 // The week that contains Jan 1st is the first week of the year.
  19252. }
  19253. });
  19254. return ms;
  19255. })));
  19256. /***/ }),
  19257. /* 72 */
  19258. /***/ (function(module, exports, __webpack_require__) {
  19259. //! moment.js locale configuration
  19260. //! locale : Burmese [my]
  19261. //! author : Squar team, mysquar.com
  19262. //! author : David Rossellat : https://github.com/gholadr
  19263. //! author : Tin Aung Lin : https://github.com/thanyawzinmin
  19264. ;(function (global, factory) {
  19265. true ? factory(__webpack_require__(0)) :
  19266. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  19267. factory(global.moment)
  19268. }(this, (function (moment) { 'use strict';
  19269. var symbolMap = {
  19270. '1': '၁',
  19271. '2': '၂',
  19272. '3': '၃',
  19273. '4': '၄',
  19274. '5': '၅',
  19275. '6': '၆',
  19276. '7': '၇',
  19277. '8': '၈',
  19278. '9': '၉',
  19279. '0': '၀'
  19280. };
  19281. var numberMap = {
  19282. '၁': '1',
  19283. '၂': '2',
  19284. '၃': '3',
  19285. '၄': '4',
  19286. '၅': '5',
  19287. '၆': '6',
  19288. '၇': '7',
  19289. '၈': '8',
  19290. '၉': '9',
  19291. '၀': '0'
  19292. };
  19293. var my = moment.defineLocale('my', {
  19294. months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split('_'),
  19295. monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'),
  19296. weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ'.split('_'),
  19297. weekdaysShort: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
  19298. weekdaysMin: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
  19299. longDateFormat: {
  19300. LT: 'HH:mm',
  19301. LTS: 'HH:mm:ss',
  19302. L: 'DD/MM/YYYY',
  19303. LL: 'D MMMM YYYY',
  19304. LLL: 'D MMMM YYYY HH:mm',
  19305. LLLL: 'dddd D MMMM YYYY HH:mm'
  19306. },
  19307. calendar: {
  19308. sameDay: '[ယနေ.] LT [မှာ]',
  19309. nextDay: '[မနက်ဖြန်] LT [မှာ]',
  19310. nextWeek: 'dddd LT [မှာ]',
  19311. lastDay: '[မနေ.က] LT [မှာ]',
  19312. lastWeek: '[ပြီးခဲ့သော] dddd LT [မှာ]',
  19313. sameElse: 'L'
  19314. },
  19315. relativeTime: {
  19316. future: 'လာမည့် %s မှာ',
  19317. past: 'လွန်ခဲ့သော %s က',
  19318. s: 'စက္ကန်.အနည်းငယ်',
  19319. m: 'တစ်မိနစ်',
  19320. mm: '%d မိနစ်',
  19321. h: 'တစ်နာရီ',
  19322. hh: '%d နာရီ',
  19323. d: 'တစ်ရက်',
  19324. dd: '%d ရက်',
  19325. M: 'တစ်လ',
  19326. MM: '%d လ',
  19327. y: 'တစ်နှစ်',
  19328. yy: '%d နှစ်'
  19329. },
  19330. preparse: function (string) {
  19331. return string.replace(/[၁၂၃၄၅၆၇၈၉၀]/g, function (match) {
  19332. return numberMap[match];
  19333. });
  19334. },
  19335. postformat: function (string) {
  19336. return string.replace(/\d/g, function (match) {
  19337. return symbolMap[match];
  19338. });
  19339. },
  19340. week: {
  19341. dow: 1, // Monday is the first day of the week.
  19342. doy: 4 // The week that contains Jan 1st is the first week of the year.
  19343. }
  19344. });
  19345. return my;
  19346. })));
  19347. /***/ }),
  19348. /* 73 */
  19349. /***/ (function(module, exports, __webpack_require__) {
  19350. //! moment.js locale configuration
  19351. //! locale : Norwegian Bokmål [nb]
  19352. //! authors : Espen Hovlandsdal : https://github.com/rexxars
  19353. //! Sigurd Gartmann : https://github.com/sigurdga
  19354. ;(function (global, factory) {
  19355. true ? factory(__webpack_require__(0)) :
  19356. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  19357. factory(global.moment)
  19358. }(this, (function (moment) { 'use strict';
  19359. var nb = moment.defineLocale('nb', {
  19360. months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
  19361. monthsShort : 'jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.'.split('_'),
  19362. monthsParseExact : true,
  19363. weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
  19364. weekdaysShort : 'sø._ma._ti._on._to._fr._lø.'.split('_'),
  19365. weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'),
  19366. weekdaysParseExact : true,
  19367. longDateFormat : {
  19368. LT : 'HH:mm',
  19369. LTS : 'HH:mm:ss',
  19370. L : 'DD.MM.YYYY',
  19371. LL : 'D. MMMM YYYY',
  19372. LLL : 'D. MMMM YYYY [kl.] HH:mm',
  19373. LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm'
  19374. },
  19375. calendar : {
  19376. sameDay: '[i dag kl.] LT',
  19377. nextDay: '[i morgen kl.] LT',
  19378. nextWeek: 'dddd [kl.] LT',
  19379. lastDay: '[i går kl.] LT',
  19380. lastWeek: '[forrige] dddd [kl.] LT',
  19381. sameElse: 'L'
  19382. },
  19383. relativeTime : {
  19384. future : 'om %s',
  19385. past : '%s siden',
  19386. s : 'noen sekunder',
  19387. m : 'ett minutt',
  19388. mm : '%d minutter',
  19389. h : 'en time',
  19390. hh : '%d timer',
  19391. d : 'en dag',
  19392. dd : '%d dager',
  19393. M : 'en måned',
  19394. MM : '%d måneder',
  19395. y : 'ett år',
  19396. yy : '%d år'
  19397. },
  19398. ordinalParse: /\d{1,2}\./,
  19399. ordinal : '%d.',
  19400. week : {
  19401. dow : 1, // Monday is the first day of the week.
  19402. doy : 4 // The week that contains Jan 4th is the first week of the year.
  19403. }
  19404. });
  19405. return nb;
  19406. })));
  19407. /***/ }),
  19408. /* 74 */
  19409. /***/ (function(module, exports, __webpack_require__) {
  19410. //! moment.js locale configuration
  19411. //! locale : Nepalese [ne]
  19412. //! author : suvash : https://github.com/suvash
  19413. ;(function (global, factory) {
  19414. true ? factory(__webpack_require__(0)) :
  19415. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  19416. factory(global.moment)
  19417. }(this, (function (moment) { 'use strict';
  19418. var symbolMap = {
  19419. '1': '१',
  19420. '2': '२',
  19421. '3': '३',
  19422. '4': '४',
  19423. '5': '५',
  19424. '6': '६',
  19425. '7': '७',
  19426. '8': '८',
  19427. '9': '९',
  19428. '0': '०'
  19429. };
  19430. var numberMap = {
  19431. '१': '1',
  19432. '२': '2',
  19433. '३': '3',
  19434. '४': '4',
  19435. '५': '5',
  19436. '६': '6',
  19437. '७': '7',
  19438. '८': '8',
  19439. '९': '9',
  19440. '०': '0'
  19441. };
  19442. var ne = moment.defineLocale('ne', {
  19443. months : 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split('_'),
  19444. monthsShort : 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split('_'),
  19445. monthsParseExact : true,
  19446. weekdays : 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split('_'),
  19447. weekdaysShort : 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'),
  19448. weekdaysMin : 'आ._सो._मं._बु._बि._शु._श.'.split('_'),
  19449. weekdaysParseExact : true,
  19450. longDateFormat : {
  19451. LT : 'Aको h:mm बजे',
  19452. LTS : 'Aको h:mm:ss बजे',
  19453. L : 'DD/MM/YYYY',
  19454. LL : 'D MMMM YYYY',
  19455. LLL : 'D MMMM YYYY, Aको h:mm बजे',
  19456. LLLL : 'dddd, D MMMM YYYY, Aको h:mm बजे'
  19457. },
  19458. preparse: function (string) {
  19459. return string.replace(/[१२३४५६७८९०]/g, function (match) {
  19460. return numberMap[match];
  19461. });
  19462. },
  19463. postformat: function (string) {
  19464. return string.replace(/\d/g, function (match) {
  19465. return symbolMap[match];
  19466. });
  19467. },
  19468. meridiemParse: /राति|बिहान|दिउँसो|साँझ/,
  19469. meridiemHour : function (hour, meridiem) {
  19470. if (hour === 12) {
  19471. hour = 0;
  19472. }
  19473. if (meridiem === 'राति') {
  19474. return hour < 4 ? hour : hour + 12;
  19475. } else if (meridiem === 'बिहान') {
  19476. return hour;
  19477. } else if (meridiem === 'दिउँसो') {
  19478. return hour >= 10 ? hour : hour + 12;
  19479. } else if (meridiem === 'साँझ') {
  19480. return hour + 12;
  19481. }
  19482. },
  19483. meridiem : function (hour, minute, isLower) {
  19484. if (hour < 3) {
  19485. return 'राति';
  19486. } else if (hour < 12) {
  19487. return 'बिहान';
  19488. } else if (hour < 16) {
  19489. return 'दिउँसो';
  19490. } else if (hour < 20) {
  19491. return 'साँझ';
  19492. } else {
  19493. return 'राति';
  19494. }
  19495. },
  19496. calendar : {
  19497. sameDay : '[आज] LT',
  19498. nextDay : '[भोलि] LT',
  19499. nextWeek : '[आउँदो] dddd[,] LT',
  19500. lastDay : '[हिजो] LT',
  19501. lastWeek : '[गएको] dddd[,] LT',
  19502. sameElse : 'L'
  19503. },
  19504. relativeTime : {
  19505. future : '%sमा',
  19506. past : '%s अगाडि',
  19507. s : 'केही क्षण',
  19508. m : 'एक मिनेट',
  19509. mm : '%d मिनेट',
  19510. h : 'एक घण्टा',
  19511. hh : '%d घण्टा',
  19512. d : 'एक दिन',
  19513. dd : '%d दिन',
  19514. M : 'एक महिना',
  19515. MM : '%d महिना',
  19516. y : 'एक बर्ष',
  19517. yy : '%d बर्ष'
  19518. },
  19519. week : {
  19520. dow : 0, // Sunday is the first day of the week.
  19521. doy : 6 // The week that contains Jan 1st is the first week of the year.
  19522. }
  19523. });
  19524. return ne;
  19525. })));
  19526. /***/ }),
  19527. /* 75 */
  19528. /***/ (function(module, exports, __webpack_require__) {
  19529. //! moment.js locale configuration
  19530. //! locale : Dutch (Belgium) [nl-be]
  19531. //! author : Joris Röling : https://github.com/jorisroling
  19532. //! author : Jacob Middag : https://github.com/middagj
  19533. ;(function (global, factory) {
  19534. true ? factory(__webpack_require__(0)) :
  19535. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  19536. factory(global.moment)
  19537. }(this, (function (moment) { 'use strict';
  19538. var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_');
  19539. var monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');
  19540. var monthsParse = [/^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];
  19541. var monthsRegex = /^(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;
  19542. var nlBe = moment.defineLocale('nl-be', {
  19543. months : 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),
  19544. monthsShort : function (m, format) {
  19545. if (/-MMM-/.test(format)) {
  19546. return monthsShortWithoutDots[m.month()];
  19547. } else {
  19548. return monthsShortWithDots[m.month()];
  19549. }
  19550. },
  19551. monthsRegex: monthsRegex,
  19552. monthsShortRegex: monthsRegex,
  19553. monthsStrictRegex: /^(januari|februari|maart|mei|ju[nl]i|april|augustus|september|oktober|november|december)/i,
  19554. monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,
  19555. monthsParse : monthsParse,
  19556. longMonthsParse : monthsParse,
  19557. shortMonthsParse : monthsParse,
  19558. weekdays : 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),
  19559. weekdaysShort : 'zo._ma._di._wo._do._vr._za.'.split('_'),
  19560. weekdaysMin : 'Zo_Ma_Di_Wo_Do_Vr_Za'.split('_'),
  19561. weekdaysParseExact : true,
  19562. longDateFormat : {
  19563. LT : 'HH:mm',
  19564. LTS : 'HH:mm:ss',
  19565. L : 'DD/MM/YYYY',
  19566. LL : 'D MMMM YYYY',
  19567. LLL : 'D MMMM YYYY HH:mm',
  19568. LLLL : 'dddd D MMMM YYYY HH:mm'
  19569. },
  19570. calendar : {
  19571. sameDay: '[vandaag om] LT',
  19572. nextDay: '[morgen om] LT',
  19573. nextWeek: 'dddd [om] LT',
  19574. lastDay: '[gisteren om] LT',
  19575. lastWeek: '[afgelopen] dddd [om] LT',
  19576. sameElse: 'L'
  19577. },
  19578. relativeTime : {
  19579. future : 'over %s',
  19580. past : '%s geleden',
  19581. s : 'een paar seconden',
  19582. m : 'één minuut',
  19583. mm : '%d minuten',
  19584. h : 'één uur',
  19585. hh : '%d uur',
  19586. d : 'één dag',
  19587. dd : '%d dagen',
  19588. M : 'één maand',
  19589. MM : '%d maanden',
  19590. y : 'één jaar',
  19591. yy : '%d jaar'
  19592. },
  19593. ordinalParse: /\d{1,2}(ste|de)/,
  19594. ordinal : function (number) {
  19595. return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');
  19596. },
  19597. week : {
  19598. dow : 1, // Monday is the first day of the week.
  19599. doy : 4 // The week that contains Jan 4th is the first week of the year.
  19600. }
  19601. });
  19602. return nlBe;
  19603. })));
  19604. /***/ }),
  19605. /* 76 */
  19606. /***/ (function(module, exports, __webpack_require__) {
  19607. //! moment.js locale configuration
  19608. //! locale : Dutch [nl]
  19609. //! author : Joris Röling : https://github.com/jorisroling
  19610. //! author : Jacob Middag : https://github.com/middagj
  19611. ;(function (global, factory) {
  19612. true ? factory(__webpack_require__(0)) :
  19613. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  19614. factory(global.moment)
  19615. }(this, (function (moment) { 'use strict';
  19616. var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_');
  19617. var monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');
  19618. var monthsParse = [/^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];
  19619. var monthsRegex = /^(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;
  19620. var nl = moment.defineLocale('nl', {
  19621. months : 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),
  19622. monthsShort : function (m, format) {
  19623. if (/-MMM-/.test(format)) {
  19624. return monthsShortWithoutDots[m.month()];
  19625. } else {
  19626. return monthsShortWithDots[m.month()];
  19627. }
  19628. },
  19629. monthsRegex: monthsRegex,
  19630. monthsShortRegex: monthsRegex,
  19631. monthsStrictRegex: /^(januari|februari|maart|mei|ju[nl]i|april|augustus|september|oktober|november|december)/i,
  19632. monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,
  19633. monthsParse : monthsParse,
  19634. longMonthsParse : monthsParse,
  19635. shortMonthsParse : monthsParse,
  19636. weekdays : 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),
  19637. weekdaysShort : 'zo._ma._di._wo._do._vr._za.'.split('_'),
  19638. weekdaysMin : 'Zo_Ma_Di_Wo_Do_Vr_Za'.split('_'),
  19639. weekdaysParseExact : true,
  19640. longDateFormat : {
  19641. LT : 'HH:mm',
  19642. LTS : 'HH:mm:ss',
  19643. L : 'DD-MM-YYYY',
  19644. LL : 'D MMMM YYYY',
  19645. LLL : 'D MMMM YYYY HH:mm',
  19646. LLLL : 'dddd D MMMM YYYY HH:mm'
  19647. },
  19648. calendar : {
  19649. sameDay: '[vandaag om] LT',
  19650. nextDay: '[morgen om] LT',
  19651. nextWeek: 'dddd [om] LT',
  19652. lastDay: '[gisteren om] LT',
  19653. lastWeek: '[afgelopen] dddd [om] LT',
  19654. sameElse: 'L'
  19655. },
  19656. relativeTime : {
  19657. future : 'over %s',
  19658. past : '%s geleden',
  19659. s : 'een paar seconden',
  19660. m : 'één minuut',
  19661. mm : '%d minuten',
  19662. h : 'één uur',
  19663. hh : '%d uur',
  19664. d : 'één dag',
  19665. dd : '%d dagen',
  19666. M : 'één maand',
  19667. MM : '%d maanden',
  19668. y : 'één jaar',
  19669. yy : '%d jaar'
  19670. },
  19671. ordinalParse: /\d{1,2}(ste|de)/,
  19672. ordinal : function (number) {
  19673. return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');
  19674. },
  19675. week : {
  19676. dow : 1, // Monday is the first day of the week.
  19677. doy : 4 // The week that contains Jan 4th is the first week of the year.
  19678. }
  19679. });
  19680. return nl;
  19681. })));
  19682. /***/ }),
  19683. /* 77 */
  19684. /***/ (function(module, exports, __webpack_require__) {
  19685. //! moment.js locale configuration
  19686. //! locale : Nynorsk [nn]
  19687. //! author : https://github.com/mechuwind
  19688. ;(function (global, factory) {
  19689. true ? factory(__webpack_require__(0)) :
  19690. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  19691. factory(global.moment)
  19692. }(this, (function (moment) { 'use strict';
  19693. var nn = moment.defineLocale('nn', {
  19694. months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
  19695. monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),
  19696. weekdays : 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'),
  19697. weekdaysShort : 'sun_mån_tys_ons_tor_fre_lau'.split('_'),
  19698. weekdaysMin : 'su_må_ty_on_to_fr_lø'.split('_'),
  19699. longDateFormat : {
  19700. LT : 'HH:mm',
  19701. LTS : 'HH:mm:ss',
  19702. L : 'DD.MM.YYYY',
  19703. LL : 'D. MMMM YYYY',
  19704. LLL : 'D. MMMM YYYY [kl.] H:mm',
  19705. LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm'
  19706. },
  19707. calendar : {
  19708. sameDay: '[I dag klokka] LT',
  19709. nextDay: '[I morgon klokka] LT',
  19710. nextWeek: 'dddd [klokka] LT',
  19711. lastDay: '[I går klokka] LT',
  19712. lastWeek: '[Føregåande] dddd [klokka] LT',
  19713. sameElse: 'L'
  19714. },
  19715. relativeTime : {
  19716. future : 'om %s',
  19717. past : '%s sidan',
  19718. s : 'nokre sekund',
  19719. m : 'eit minutt',
  19720. mm : '%d minutt',
  19721. h : 'ein time',
  19722. hh : '%d timar',
  19723. d : 'ein dag',
  19724. dd : '%d dagar',
  19725. M : 'ein månad',
  19726. MM : '%d månader',
  19727. y : 'eit år',
  19728. yy : '%d år'
  19729. },
  19730. ordinalParse: /\d{1,2}\./,
  19731. ordinal : '%d.',
  19732. week : {
  19733. dow : 1, // Monday is the first day of the week.
  19734. doy : 4 // The week that contains Jan 4th is the first week of the year.
  19735. }
  19736. });
  19737. return nn;
  19738. })));
  19739. /***/ }),
  19740. /* 78 */
  19741. /***/ (function(module, exports, __webpack_require__) {
  19742. //! moment.js locale configuration
  19743. //! locale : Punjabi (India) [pa-in]
  19744. //! author : Harpreet Singh : https://github.com/harpreetkhalsagtbit
  19745. ;(function (global, factory) {
  19746. true ? factory(__webpack_require__(0)) :
  19747. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  19748. factory(global.moment)
  19749. }(this, (function (moment) { 'use strict';
  19750. var symbolMap = {
  19751. '1': '੧',
  19752. '2': '੨',
  19753. '3': '੩',
  19754. '4': '੪',
  19755. '5': '੫',
  19756. '6': '੬',
  19757. '7': '੭',
  19758. '8': '੮',
  19759. '9': '੯',
  19760. '0': '੦'
  19761. };
  19762. var numberMap = {
  19763. '੧': '1',
  19764. '੨': '2',
  19765. '੩': '3',
  19766. '੪': '4',
  19767. '੫': '5',
  19768. '੬': '6',
  19769. '੭': '7',
  19770. '੮': '8',
  19771. '੯': '9',
  19772. '੦': '0'
  19773. };
  19774. var paIn = moment.defineLocale('pa-in', {
  19775. // There are months name as per Nanakshahi Calender but they are not used as rigidly in modern Punjabi.
  19776. months : 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'),
  19777. monthsShort : 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'),
  19778. weekdays : 'ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ'.split('_'),
  19779. weekdaysShort : 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),
  19780. weekdaysMin : 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),
  19781. longDateFormat : {
  19782. LT : 'A h:mm ਵਜੇ',
  19783. LTS : 'A h:mm:ss ਵਜੇ',
  19784. L : 'DD/MM/YYYY',
  19785. LL : 'D MMMM YYYY',
  19786. LLL : 'D MMMM YYYY, A h:mm ਵਜੇ',
  19787. LLLL : 'dddd, D MMMM YYYY, A h:mm ਵਜੇ'
  19788. },
  19789. calendar : {
  19790. sameDay : '[ਅਜ] LT',
  19791. nextDay : '[ਕਲ] LT',
  19792. nextWeek : 'dddd, LT',
  19793. lastDay : '[ਕਲ] LT',
  19794. lastWeek : '[ਪਿਛਲੇ] dddd, LT',
  19795. sameElse : 'L'
  19796. },
  19797. relativeTime : {
  19798. future : '%s ਵਿੱਚ',
  19799. past : '%s ਪਿਛਲੇ',
  19800. s : 'ਕੁਝ ਸਕਿੰਟ',
  19801. m : 'ਇਕ ਮਿੰਟ',
  19802. mm : '%d ਮਿੰਟ',
  19803. h : 'ਇੱਕ ਘੰਟਾ',
  19804. hh : '%d ਘੰਟੇ',
  19805. d : 'ਇੱਕ ਦਿਨ',
  19806. dd : '%d ਦਿਨ',
  19807. M : 'ਇੱਕ ਮਹੀਨਾ',
  19808. MM : '%d ਮਹੀਨੇ',
  19809. y : 'ਇੱਕ ਸਾਲ',
  19810. yy : '%d ਸਾਲ'
  19811. },
  19812. preparse: function (string) {
  19813. return string.replace(/[੧੨੩੪੫੬੭੮੯੦]/g, function (match) {
  19814. return numberMap[match];
  19815. });
  19816. },
  19817. postformat: function (string) {
  19818. return string.replace(/\d/g, function (match) {
  19819. return symbolMap[match];
  19820. });
  19821. },
  19822. // Punjabi notation for meridiems are quite fuzzy in practice. While there exists
  19823. // a rigid notion of a 'Pahar' it is not used as rigidly in modern Punjabi.
  19824. meridiemParse: /ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,
  19825. meridiemHour : function (hour, meridiem) {
  19826. if (hour === 12) {
  19827. hour = 0;
  19828. }
  19829. if (meridiem === 'ਰਾਤ') {
  19830. return hour < 4 ? hour : hour + 12;
  19831. } else if (meridiem === 'ਸਵੇਰ') {
  19832. return hour;
  19833. } else if (meridiem === 'ਦੁਪਹਿਰ') {
  19834. return hour >= 10 ? hour : hour + 12;
  19835. } else if (meridiem === 'ਸ਼ਾਮ') {
  19836. return hour + 12;
  19837. }
  19838. },
  19839. meridiem : function (hour, minute, isLower) {
  19840. if (hour < 4) {
  19841. return 'ਰਾਤ';
  19842. } else if (hour < 10) {
  19843. return 'ਸਵੇਰ';
  19844. } else if (hour < 17) {
  19845. return 'ਦੁਪਹਿਰ';
  19846. } else if (hour < 20) {
  19847. return 'ਸ਼ਾਮ';
  19848. } else {
  19849. return 'ਰਾਤ';
  19850. }
  19851. },
  19852. week : {
  19853. dow : 0, // Sunday is the first day of the week.
  19854. doy : 6 // The week that contains Jan 1st is the first week of the year.
  19855. }
  19856. });
  19857. return paIn;
  19858. })));
  19859. /***/ }),
  19860. /* 79 */
  19861. /***/ (function(module, exports, __webpack_require__) {
  19862. //! moment.js locale configuration
  19863. //! locale : Polish [pl]
  19864. //! author : Rafal Hirsz : https://github.com/evoL
  19865. ;(function (global, factory) {
  19866. true ? factory(__webpack_require__(0)) :
  19867. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  19868. factory(global.moment)
  19869. }(this, (function (moment) { 'use strict';
  19870. var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split('_');
  19871. var monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split('_');
  19872. function plural(n) {
  19873. return (n % 10 < 5) && (n % 10 > 1) && ((~~(n / 10) % 10) !== 1);
  19874. }
  19875. function translate(number, withoutSuffix, key) {
  19876. var result = number + ' ';
  19877. switch (key) {
  19878. case 'm':
  19879. return withoutSuffix ? 'minuta' : 'minutę';
  19880. case 'mm':
  19881. return result + (plural(number) ? 'minuty' : 'minut');
  19882. case 'h':
  19883. return withoutSuffix ? 'godzina' : 'godzinę';
  19884. case 'hh':
  19885. return result + (plural(number) ? 'godziny' : 'godzin');
  19886. case 'MM':
  19887. return result + (plural(number) ? 'miesiące' : 'miesięcy');
  19888. case 'yy':
  19889. return result + (plural(number) ? 'lata' : 'lat');
  19890. }
  19891. }
  19892. var pl = moment.defineLocale('pl', {
  19893. months : function (momentToFormat, format) {
  19894. if (format === '') {
  19895. // Hack: if format empty we know this is used to generate
  19896. // RegExp by moment. Give then back both valid forms of months
  19897. // in RegExp ready format.
  19898. return '(' + monthsSubjective[momentToFormat.month()] + '|' + monthsNominative[momentToFormat.month()] + ')';
  19899. } else if (/D MMMM/.test(format)) {
  19900. return monthsSubjective[momentToFormat.month()];
  19901. } else {
  19902. return monthsNominative[momentToFormat.month()];
  19903. }
  19904. },
  19905. monthsShort : 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),
  19906. weekdays : 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'),
  19907. weekdaysShort : 'ndz_pon_wt_śr_czw_pt_sob'.split('_'),
  19908. weekdaysMin : 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'),
  19909. longDateFormat : {
  19910. LT : 'HH:mm',
  19911. LTS : 'HH:mm:ss',
  19912. L : 'DD.MM.YYYY',
  19913. LL : 'D MMMM YYYY',
  19914. LLL : 'D MMMM YYYY HH:mm',
  19915. LLLL : 'dddd, D MMMM YYYY HH:mm'
  19916. },
  19917. calendar : {
  19918. sameDay: '[Dziś o] LT',
  19919. nextDay: '[Jutro o] LT',
  19920. nextWeek: '[W] dddd [o] LT',
  19921. lastDay: '[Wczoraj o] LT',
  19922. lastWeek: function () {
  19923. switch (this.day()) {
  19924. case 0:
  19925. return '[W zeszłą niedzielę o] LT';
  19926. case 3:
  19927. return '[W zeszłą środę o] LT';
  19928. case 6:
  19929. return '[W zeszłą sobotę o] LT';
  19930. default:
  19931. return '[W zeszły] dddd [o] LT';
  19932. }
  19933. },
  19934. sameElse: 'L'
  19935. },
  19936. relativeTime : {
  19937. future : 'za %s',
  19938. past : '%s temu',
  19939. s : 'kilka sekund',
  19940. m : translate,
  19941. mm : translate,
  19942. h : translate,
  19943. hh : translate,
  19944. d : '1 dzień',
  19945. dd : '%d dni',
  19946. M : 'miesiąc',
  19947. MM : translate,
  19948. y : 'rok',
  19949. yy : translate
  19950. },
  19951. ordinalParse: /\d{1,2}\./,
  19952. ordinal : '%d.',
  19953. week : {
  19954. dow : 1, // Monday is the first day of the week.
  19955. doy : 4 // The week that contains Jan 4th is the first week of the year.
  19956. }
  19957. });
  19958. return pl;
  19959. })));
  19960. /***/ }),
  19961. /* 80 */
  19962. /***/ (function(module, exports, __webpack_require__) {
  19963. //! moment.js locale configuration
  19964. //! locale : Portuguese (Brazil) [pt-br]
  19965. //! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira
  19966. ;(function (global, factory) {
  19967. true ? factory(__webpack_require__(0)) :
  19968. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  19969. factory(global.moment)
  19970. }(this, (function (moment) { 'use strict';
  19971. var ptBr = moment.defineLocale('pt-br', {
  19972. months : 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'),
  19973. monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),
  19974. weekdays : 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split('_'),
  19975. weekdaysShort : 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),
  19976. weekdaysMin : 'Dom_2ª_3ª_4ª_5ª_6ª_Sáb'.split('_'),
  19977. weekdaysParseExact : true,
  19978. longDateFormat : {
  19979. LT : 'HH:mm',
  19980. LTS : 'HH:mm:ss',
  19981. L : 'DD/MM/YYYY',
  19982. LL : 'D [de] MMMM [de] YYYY',
  19983. LLL : 'D [de] MMMM [de] YYYY [às] HH:mm',
  19984. LLLL : 'dddd, D [de] MMMM [de] YYYY [às] HH:mm'
  19985. },
  19986. calendar : {
  19987. sameDay: '[Hoje às] LT',
  19988. nextDay: '[Amanhã às] LT',
  19989. nextWeek: 'dddd [às] LT',
  19990. lastDay: '[Ontem às] LT',
  19991. lastWeek: function () {
  19992. return (this.day() === 0 || this.day() === 6) ?
  19993. '[Último] dddd [às] LT' : // Saturday + Sunday
  19994. '[Última] dddd [às] LT'; // Monday - Friday
  19995. },
  19996. sameElse: 'L'
  19997. },
  19998. relativeTime : {
  19999. future : 'em %s',
  20000. past : '%s atrás',
  20001. s : 'poucos segundos',
  20002. m : 'um minuto',
  20003. mm : '%d minutos',
  20004. h : 'uma hora',
  20005. hh : '%d horas',
  20006. d : 'um dia',
  20007. dd : '%d dias',
  20008. M : 'um mês',
  20009. MM : '%d meses',
  20010. y : 'um ano',
  20011. yy : '%d anos'
  20012. },
  20013. ordinalParse: /\d{1,2}º/,
  20014. ordinal : '%dº'
  20015. });
  20016. return ptBr;
  20017. })));
  20018. /***/ }),
  20019. /* 81 */
  20020. /***/ (function(module, exports, __webpack_require__) {
  20021. //! moment.js locale configuration
  20022. //! locale : Portuguese [pt]
  20023. //! author : Jefferson : https://github.com/jalex79
  20024. ;(function (global, factory) {
  20025. true ? factory(__webpack_require__(0)) :
  20026. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  20027. factory(global.moment)
  20028. }(this, (function (moment) { 'use strict';
  20029. var pt = moment.defineLocale('pt', {
  20030. months : 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'),
  20031. monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),
  20032. weekdays : 'Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado'.split('_'),
  20033. weekdaysShort : 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),
  20034. weekdaysMin : 'Dom_2ª_3ª_4ª_5ª_6ª_Sáb'.split('_'),
  20035. weekdaysParseExact : true,
  20036. longDateFormat : {
  20037. LT : 'HH:mm',
  20038. LTS : 'HH:mm:ss',
  20039. L : 'DD/MM/YYYY',
  20040. LL : 'D [de] MMMM [de] YYYY',
  20041. LLL : 'D [de] MMMM [de] YYYY HH:mm',
  20042. LLLL : 'dddd, D [de] MMMM [de] YYYY HH:mm'
  20043. },
  20044. calendar : {
  20045. sameDay: '[Hoje às] LT',
  20046. nextDay: '[Amanhã às] LT',
  20047. nextWeek: 'dddd [às] LT',
  20048. lastDay: '[Ontem às] LT',
  20049. lastWeek: function () {
  20050. return (this.day() === 0 || this.day() === 6) ?
  20051. '[Último] dddd [às] LT' : // Saturday + Sunday
  20052. '[Última] dddd [às] LT'; // Monday - Friday
  20053. },
  20054. sameElse: 'L'
  20055. },
  20056. relativeTime : {
  20057. future : 'em %s',
  20058. past : 'há %s',
  20059. s : 'segundos',
  20060. m : 'um minuto',
  20061. mm : '%d minutos',
  20062. h : 'uma hora',
  20063. hh : '%d horas',
  20064. d : 'um dia',
  20065. dd : '%d dias',
  20066. M : 'um mês',
  20067. MM : '%d meses',
  20068. y : 'um ano',
  20069. yy : '%d anos'
  20070. },
  20071. ordinalParse: /\d{1,2}º/,
  20072. ordinal : '%dº',
  20073. week : {
  20074. dow : 1, // Monday is the first day of the week.
  20075. doy : 4 // The week that contains Jan 4th is the first week of the year.
  20076. }
  20077. });
  20078. return pt;
  20079. })));
  20080. /***/ }),
  20081. /* 82 */
  20082. /***/ (function(module, exports, __webpack_require__) {
  20083. //! moment.js locale configuration
  20084. //! locale : Romanian [ro]
  20085. //! author : Vlad Gurdiga : https://github.com/gurdiga
  20086. //! author : Valentin Agachi : https://github.com/avaly
  20087. ;(function (global, factory) {
  20088. true ? factory(__webpack_require__(0)) :
  20089. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  20090. factory(global.moment)
  20091. }(this, (function (moment) { 'use strict';
  20092. function relativeTimeWithPlural(number, withoutSuffix, key) {
  20093. var format = {
  20094. 'mm': 'minute',
  20095. 'hh': 'ore',
  20096. 'dd': 'zile',
  20097. 'MM': 'luni',
  20098. 'yy': 'ani'
  20099. },
  20100. separator = ' ';
  20101. if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) {
  20102. separator = ' de ';
  20103. }
  20104. return number + separator + format[key];
  20105. }
  20106. var ro = moment.defineLocale('ro', {
  20107. months : 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split('_'),
  20108. monthsShort : 'ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split('_'),
  20109. monthsParseExact: true,
  20110. weekdays : 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),
  20111. weekdaysShort : 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),
  20112. weekdaysMin : 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),
  20113. longDateFormat : {
  20114. LT : 'H:mm',
  20115. LTS : 'H:mm:ss',
  20116. L : 'DD.MM.YYYY',
  20117. LL : 'D MMMM YYYY',
  20118. LLL : 'D MMMM YYYY H:mm',
  20119. LLLL : 'dddd, D MMMM YYYY H:mm'
  20120. },
  20121. calendar : {
  20122. sameDay: '[azi la] LT',
  20123. nextDay: '[mâine la] LT',
  20124. nextWeek: 'dddd [la] LT',
  20125. lastDay: '[ieri la] LT',
  20126. lastWeek: '[fosta] dddd [la] LT',
  20127. sameElse: 'L'
  20128. },
  20129. relativeTime : {
  20130. future : 'peste %s',
  20131. past : '%s în urmă',
  20132. s : 'câteva secunde',
  20133. m : 'un minut',
  20134. mm : relativeTimeWithPlural,
  20135. h : 'o oră',
  20136. hh : relativeTimeWithPlural,
  20137. d : 'o zi',
  20138. dd : relativeTimeWithPlural,
  20139. M : 'o lună',
  20140. MM : relativeTimeWithPlural,
  20141. y : 'un an',
  20142. yy : relativeTimeWithPlural
  20143. },
  20144. week : {
  20145. dow : 1, // Monday is the first day of the week.
  20146. doy : 7 // The week that contains Jan 1st is the first week of the year.
  20147. }
  20148. });
  20149. return ro;
  20150. })));
  20151. /***/ }),
  20152. /* 83 */
  20153. /***/ (function(module, exports, __webpack_require__) {
  20154. //! moment.js locale configuration
  20155. //! locale : Russian [ru]
  20156. //! author : Viktorminator : https://github.com/Viktorminator
  20157. //! Author : Menelion Elensúle : https://github.com/Oire
  20158. //! author : Коренберг Марк : https://github.com/socketpair
  20159. ;(function (global, factory) {
  20160. true ? factory(__webpack_require__(0)) :
  20161. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  20162. factory(global.moment)
  20163. }(this, (function (moment) { 'use strict';
  20164. function plural(word, num) {
  20165. var forms = word.split('_');
  20166. 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]);
  20167. }
  20168. function relativeTimeWithPlural(number, withoutSuffix, key) {
  20169. var format = {
  20170. 'mm': withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',
  20171. 'hh': 'час_часа_часов',
  20172. 'dd': 'день_дня_дней',
  20173. 'MM': 'месяц_месяца_месяцев',
  20174. 'yy': 'год_года_лет'
  20175. };
  20176. if (key === 'm') {
  20177. return withoutSuffix ? 'минута' : 'минуту';
  20178. }
  20179. else {
  20180. return number + ' ' + plural(format[key], +number);
  20181. }
  20182. }
  20183. var monthsParse = [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[йя]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i];
  20184. // http://new.gramota.ru/spravka/rules/139-prop : § 103
  20185. // Сокращения месяцев: http://new.gramota.ru/spravka/buro/search-answer?s=242637
  20186. // CLDR data: http://www.unicode.org/cldr/charts/28/summary/ru.html#1753
  20187. var ru = moment.defineLocale('ru', {
  20188. months : {
  20189. format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_'),
  20190. standalone: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_')
  20191. },
  20192. monthsShort : {
  20193. // по CLDR именно "июл." и "июн.", но какой смысл менять букву на точку ?
  20194. format: 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split('_'),
  20195. standalone: 'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split('_')
  20196. },
  20197. weekdays : {
  20198. standalone: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'),
  20199. format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_'),
  20200. isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/
  20201. },
  20202. weekdaysShort : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
  20203. weekdaysMin : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
  20204. monthsParse : monthsParse,
  20205. longMonthsParse : monthsParse,
  20206. shortMonthsParse : monthsParse,
  20207. // полные названия с падежами, по три буквы, для некоторых, по 4 буквы, сокращения с точкой и без точки
  20208. monthsRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,
  20209. // копия предыдущего
  20210. monthsShortRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,
  20211. // полные названия с падежами
  20212. monthsStrictRegex: /^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,
  20213. // Выражение, которое соотвествует только сокращённым формам
  20214. monthsShortStrictRegex: /^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,
  20215. longDateFormat : {
  20216. LT : 'HH:mm',
  20217. LTS : 'HH:mm:ss',
  20218. L : 'DD.MM.YYYY',
  20219. LL : 'D MMMM YYYY г.',
  20220. LLL : 'D MMMM YYYY г., HH:mm',
  20221. LLLL : 'dddd, D MMMM YYYY г., HH:mm'
  20222. },
  20223. calendar : {
  20224. sameDay: '[Сегодня в] LT',
  20225. nextDay: '[Завтра в] LT',
  20226. lastDay: '[Вчера в] LT',
  20227. nextWeek: function (now) {
  20228. if (now.week() !== this.week()) {
  20229. switch (this.day()) {
  20230. case 0:
  20231. return '[В следующее] dddd [в] LT';
  20232. case 1:
  20233. case 2:
  20234. case 4:
  20235. return '[В следующий] dddd [в] LT';
  20236. case 3:
  20237. case 5:
  20238. case 6:
  20239. return '[В следующую] dddd [в] LT';
  20240. }
  20241. } else {
  20242. if (this.day() === 2) {
  20243. return '[Во] dddd [в] LT';
  20244. } else {
  20245. return '[В] dddd [в] LT';
  20246. }
  20247. }
  20248. },
  20249. lastWeek: function (now) {
  20250. if (now.week() !== this.week()) {
  20251. switch (this.day()) {
  20252. case 0:
  20253. return '[В прошлое] dddd [в] LT';
  20254. case 1:
  20255. case 2:
  20256. case 4:
  20257. return '[В прошлый] dddd [в] LT';
  20258. case 3:
  20259. case 5:
  20260. case 6:
  20261. return '[В прошлую] dddd [в] LT';
  20262. }
  20263. } else {
  20264. if (this.day() === 2) {
  20265. return '[Во] dddd [в] LT';
  20266. } else {
  20267. return '[В] dddd [в] LT';
  20268. }
  20269. }
  20270. },
  20271. sameElse: 'L'
  20272. },
  20273. relativeTime : {
  20274. future : 'через %s',
  20275. past : '%s назад',
  20276. s : 'несколько секунд',
  20277. m : relativeTimeWithPlural,
  20278. mm : relativeTimeWithPlural,
  20279. h : 'час',
  20280. hh : relativeTimeWithPlural,
  20281. d : 'день',
  20282. dd : relativeTimeWithPlural,
  20283. M : 'месяц',
  20284. MM : relativeTimeWithPlural,
  20285. y : 'год',
  20286. yy : relativeTimeWithPlural
  20287. },
  20288. meridiemParse: /ночи|утра|дня|вечера/i,
  20289. isPM : function (input) {
  20290. return /^(дня|вечера)$/.test(input);
  20291. },
  20292. meridiem : function (hour, minute, isLower) {
  20293. if (hour < 4) {
  20294. return 'ночи';
  20295. } else if (hour < 12) {
  20296. return 'утра';
  20297. } else if (hour < 17) {
  20298. return 'дня';
  20299. } else {
  20300. return 'вечера';
  20301. }
  20302. },
  20303. ordinalParse: /\d{1,2}-(й|го|я)/,
  20304. ordinal: function (number, period) {
  20305. switch (period) {
  20306. case 'M':
  20307. case 'd':
  20308. case 'DDD':
  20309. return number + '-й';
  20310. case 'D':
  20311. return number + '-го';
  20312. case 'w':
  20313. case 'W':
  20314. return number + '-я';
  20315. default:
  20316. return number;
  20317. }
  20318. },
  20319. week : {
  20320. dow : 1, // Monday is the first day of the week.
  20321. doy : 7 // The week that contains Jan 1st is the first week of the year.
  20322. }
  20323. });
  20324. return ru;
  20325. })));
  20326. /***/ }),
  20327. /* 84 */
  20328. /***/ (function(module, exports, __webpack_require__) {
  20329. //! moment.js locale configuration
  20330. //! locale : Northern Sami [se]
  20331. //! authors : Bård Rolstad Henriksen : https://github.com/karamell
  20332. ;(function (global, factory) {
  20333. true ? factory(__webpack_require__(0)) :
  20334. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  20335. factory(global.moment)
  20336. }(this, (function (moment) { 'use strict';
  20337. var se = moment.defineLocale('se', {
  20338. months : 'ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu'.split('_'),
  20339. monthsShort : 'ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov'.split('_'),
  20340. weekdays : 'sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat'.split('_'),
  20341. weekdaysShort : 'sotn_vuos_maŋ_gask_duor_bear_láv'.split('_'),
  20342. weekdaysMin : 's_v_m_g_d_b_L'.split('_'),
  20343. longDateFormat : {
  20344. LT : 'HH:mm',
  20345. LTS : 'HH:mm:ss',
  20346. L : 'DD.MM.YYYY',
  20347. LL : 'MMMM D. [b.] YYYY',
  20348. LLL : 'MMMM D. [b.] YYYY [ti.] HH:mm',
  20349. LLLL : 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm'
  20350. },
  20351. calendar : {
  20352. sameDay: '[otne ti] LT',
  20353. nextDay: '[ihttin ti] LT',
  20354. nextWeek: 'dddd [ti] LT',
  20355. lastDay: '[ikte ti] LT',
  20356. lastWeek: '[ovddit] dddd [ti] LT',
  20357. sameElse: 'L'
  20358. },
  20359. relativeTime : {
  20360. future : '%s geažes',
  20361. past : 'maŋit %s',
  20362. s : 'moadde sekunddat',
  20363. m : 'okta minuhta',
  20364. mm : '%d minuhtat',
  20365. h : 'okta diimmu',
  20366. hh : '%d diimmut',
  20367. d : 'okta beaivi',
  20368. dd : '%d beaivvit',
  20369. M : 'okta mánnu',
  20370. MM : '%d mánut',
  20371. y : 'okta jahki',
  20372. yy : '%d jagit'
  20373. },
  20374. ordinalParse: /\d{1,2}\./,
  20375. ordinal : '%d.',
  20376. week : {
  20377. dow : 1, // Monday is the first day of the week.
  20378. doy : 4 // The week that contains Jan 4th is the first week of the year.
  20379. }
  20380. });
  20381. return se;
  20382. })));
  20383. /***/ }),
  20384. /* 85 */
  20385. /***/ (function(module, exports, __webpack_require__) {
  20386. //! moment.js locale configuration
  20387. //! locale : Sinhalese [si]
  20388. //! author : Sampath Sitinamaluwa : https://github.com/sampathsris
  20389. ;(function (global, factory) {
  20390. true ? factory(__webpack_require__(0)) :
  20391. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  20392. factory(global.moment)
  20393. }(this, (function (moment) { 'use strict';
  20394. /*jshint -W100*/
  20395. var si = moment.defineLocale('si', {
  20396. months : 'ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්'.split('_'),
  20397. monthsShort : 'ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ'.split('_'),
  20398. weekdays : 'ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා'.split('_'),
  20399. weekdaysShort : 'ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන'.split('_'),
  20400. weekdaysMin : 'ඉ_ස_අ_බ_බ්‍ර_සි_සෙ'.split('_'),
  20401. weekdaysParseExact : true,
  20402. longDateFormat : {
  20403. LT : 'a h:mm',
  20404. LTS : 'a h:mm:ss',
  20405. L : 'YYYY/MM/DD',
  20406. LL : 'YYYY MMMM D',
  20407. LLL : 'YYYY MMMM D, a h:mm',
  20408. LLLL : 'YYYY MMMM D [වැනි] dddd, a h:mm:ss'
  20409. },
  20410. calendar : {
  20411. sameDay : '[අද] LT[ට]',
  20412. nextDay : '[හෙට] LT[ට]',
  20413. nextWeek : 'dddd LT[ට]',
  20414. lastDay : '[ඊයේ] LT[ට]',
  20415. lastWeek : '[පසුගිය] dddd LT[ට]',
  20416. sameElse : 'L'
  20417. },
  20418. relativeTime : {
  20419. future : '%sකින්',
  20420. past : '%sකට පෙර',
  20421. s : 'තත්පර කිහිපය',
  20422. m : 'මිනිත්තුව',
  20423. mm : 'මිනිත්තු %d',
  20424. h : 'පැය',
  20425. hh : 'පැය %d',
  20426. d : 'දිනය',
  20427. dd : 'දින %d',
  20428. M : 'මාසය',
  20429. MM : 'මාස %d',
  20430. y : 'වසර',
  20431. yy : 'වසර %d'
  20432. },
  20433. ordinalParse: /\d{1,2} වැනි/,
  20434. ordinal : function (number) {
  20435. return number + ' වැනි';
  20436. },
  20437. meridiemParse : /පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,
  20438. isPM : function (input) {
  20439. return input === 'ප.ව.' || input === 'පස් වරු';
  20440. },
  20441. meridiem : function (hours, minutes, isLower) {
  20442. if (hours > 11) {
  20443. return isLower ? 'ප.ව.' : 'පස් වරු';
  20444. } else {
  20445. return isLower ? 'පෙ.ව.' : 'පෙර වරු';
  20446. }
  20447. }
  20448. });
  20449. return si;
  20450. })));
  20451. /***/ }),
  20452. /* 86 */
  20453. /***/ (function(module, exports, __webpack_require__) {
  20454. //! moment.js locale configuration
  20455. //! locale : Slovak [sk]
  20456. //! author : Martin Minka : https://github.com/k2s
  20457. //! based on work of petrbela : https://github.com/petrbela
  20458. ;(function (global, factory) {
  20459. true ? factory(__webpack_require__(0)) :
  20460. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  20461. factory(global.moment)
  20462. }(this, (function (moment) { 'use strict';
  20463. var months = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split('_');
  20464. var monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');
  20465. function plural(n) {
  20466. return (n > 1) && (n < 5);
  20467. }
  20468. function translate(number, withoutSuffix, key, isFuture) {
  20469. var result = number + ' ';
  20470. switch (key) {
  20471. case 's': // a few seconds / in a few seconds / a few seconds ago
  20472. return (withoutSuffix || isFuture) ? 'pár sekúnd' : 'pár sekundami';
  20473. case 'm': // a minute / in a minute / a minute ago
  20474. return withoutSuffix ? 'minúta' : (isFuture ? 'minútu' : 'minútou');
  20475. case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
  20476. if (withoutSuffix || isFuture) {
  20477. return result + (plural(number) ? 'minúty' : 'minút');
  20478. } else {
  20479. return result + 'minútami';
  20480. }
  20481. break;
  20482. case 'h': // an hour / in an hour / an hour ago
  20483. return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');
  20484. case 'hh': // 9 hours / in 9 hours / 9 hours ago
  20485. if (withoutSuffix || isFuture) {
  20486. return result + (plural(number) ? 'hodiny' : 'hodín');
  20487. } else {
  20488. return result + 'hodinami';
  20489. }
  20490. break;
  20491. case 'd': // a day / in a day / a day ago
  20492. return (withoutSuffix || isFuture) ? 'deň' : 'dňom';
  20493. case 'dd': // 9 days / in 9 days / 9 days ago
  20494. if (withoutSuffix || isFuture) {
  20495. return result + (plural(number) ? 'dni' : 'dní');
  20496. } else {
  20497. return result + 'dňami';
  20498. }
  20499. break;
  20500. case 'M': // a month / in a month / a month ago
  20501. return (withoutSuffix || isFuture) ? 'mesiac' : 'mesiacom';
  20502. case 'MM': // 9 months / in 9 months / 9 months ago
  20503. if (withoutSuffix || isFuture) {
  20504. return result + (plural(number) ? 'mesiace' : 'mesiacov');
  20505. } else {
  20506. return result + 'mesiacmi';
  20507. }
  20508. break;
  20509. case 'y': // a year / in a year / a year ago
  20510. return (withoutSuffix || isFuture) ? 'rok' : 'rokom';
  20511. case 'yy': // 9 years / in 9 years / 9 years ago
  20512. if (withoutSuffix || isFuture) {
  20513. return result + (plural(number) ? 'roky' : 'rokov');
  20514. } else {
  20515. return result + 'rokmi';
  20516. }
  20517. break;
  20518. }
  20519. }
  20520. var sk = moment.defineLocale('sk', {
  20521. months : months,
  20522. monthsShort : monthsShort,
  20523. weekdays : 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),
  20524. weekdaysShort : 'ne_po_ut_st_št_pi_so'.split('_'),
  20525. weekdaysMin : 'ne_po_ut_st_št_pi_so'.split('_'),
  20526. longDateFormat : {
  20527. LT: 'H:mm',
  20528. LTS : 'H:mm:ss',
  20529. L : 'DD.MM.YYYY',
  20530. LL : 'D. MMMM YYYY',
  20531. LLL : 'D. MMMM YYYY H:mm',
  20532. LLLL : 'dddd D. MMMM YYYY H:mm'
  20533. },
  20534. calendar : {
  20535. sameDay: '[dnes o] LT',
  20536. nextDay: '[zajtra o] LT',
  20537. nextWeek: function () {
  20538. switch (this.day()) {
  20539. case 0:
  20540. return '[v nedeľu o] LT';
  20541. case 1:
  20542. case 2:
  20543. return '[v] dddd [o] LT';
  20544. case 3:
  20545. return '[v stredu o] LT';
  20546. case 4:
  20547. return '[vo štvrtok o] LT';
  20548. case 5:
  20549. return '[v piatok o] LT';
  20550. case 6:
  20551. return '[v sobotu o] LT';
  20552. }
  20553. },
  20554. lastDay: '[včera o] LT',
  20555. lastWeek: function () {
  20556. switch (this.day()) {
  20557. case 0:
  20558. return '[minulú nedeľu o] LT';
  20559. case 1:
  20560. case 2:
  20561. return '[minulý] dddd [o] LT';
  20562. case 3:
  20563. return '[minulú stredu o] LT';
  20564. case 4:
  20565. case 5:
  20566. return '[minulý] dddd [o] LT';
  20567. case 6:
  20568. return '[minulú sobotu o] LT';
  20569. }
  20570. },
  20571. sameElse: 'L'
  20572. },
  20573. relativeTime : {
  20574. future : 'za %s',
  20575. past : 'pred %s',
  20576. s : translate,
  20577. m : translate,
  20578. mm : translate,
  20579. h : translate,
  20580. hh : translate,
  20581. d : translate,
  20582. dd : translate,
  20583. M : translate,
  20584. MM : translate,
  20585. y : translate,
  20586. yy : translate
  20587. },
  20588. ordinalParse: /\d{1,2}\./,
  20589. ordinal : '%d.',
  20590. week : {
  20591. dow : 1, // Monday is the first day of the week.
  20592. doy : 4 // The week that contains Jan 4th is the first week of the year.
  20593. }
  20594. });
  20595. return sk;
  20596. })));
  20597. /***/ }),
  20598. /* 87 */
  20599. /***/ (function(module, exports, __webpack_require__) {
  20600. //! moment.js locale configuration
  20601. //! locale : Slovenian [sl]
  20602. //! author : Robert Sedovšek : https://github.com/sedovsek
  20603. ;(function (global, factory) {
  20604. true ? factory(__webpack_require__(0)) :
  20605. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  20606. factory(global.moment)
  20607. }(this, (function (moment) { 'use strict';
  20608. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  20609. var result = number + ' ';
  20610. switch (key) {
  20611. case 's':
  20612. return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami';
  20613. case 'm':
  20614. return withoutSuffix ? 'ena minuta' : 'eno minuto';
  20615. case 'mm':
  20616. if (number === 1) {
  20617. result += withoutSuffix ? 'minuta' : 'minuto';
  20618. } else if (number === 2) {
  20619. result += withoutSuffix || isFuture ? 'minuti' : 'minutama';
  20620. } else if (number < 5) {
  20621. result += withoutSuffix || isFuture ? 'minute' : 'minutami';
  20622. } else {
  20623. result += withoutSuffix || isFuture ? 'minut' : 'minutami';
  20624. }
  20625. return result;
  20626. case 'h':
  20627. return withoutSuffix ? 'ena ura' : 'eno uro';
  20628. case 'hh':
  20629. if (number === 1) {
  20630. result += withoutSuffix ? 'ura' : 'uro';
  20631. } else if (number === 2) {
  20632. result += withoutSuffix || isFuture ? 'uri' : 'urama';
  20633. } else if (number < 5) {
  20634. result += withoutSuffix || isFuture ? 'ure' : 'urami';
  20635. } else {
  20636. result += withoutSuffix || isFuture ? 'ur' : 'urami';
  20637. }
  20638. return result;
  20639. case 'd':
  20640. return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';
  20641. case 'dd':
  20642. if (number === 1) {
  20643. result += withoutSuffix || isFuture ? 'dan' : 'dnem';
  20644. } else if (number === 2) {
  20645. result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';
  20646. } else {
  20647. result += withoutSuffix || isFuture ? 'dni' : 'dnevi';
  20648. }
  20649. return result;
  20650. case 'M':
  20651. return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';
  20652. case 'MM':
  20653. if (number === 1) {
  20654. result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';
  20655. } else if (number === 2) {
  20656. result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';
  20657. } else if (number < 5) {
  20658. result += withoutSuffix || isFuture ? 'mesece' : 'meseci';
  20659. } else {
  20660. result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';
  20661. }
  20662. return result;
  20663. case 'y':
  20664. return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';
  20665. case 'yy':
  20666. if (number === 1) {
  20667. result += withoutSuffix || isFuture ? 'leto' : 'letom';
  20668. } else if (number === 2) {
  20669. result += withoutSuffix || isFuture ? 'leti' : 'letoma';
  20670. } else if (number < 5) {
  20671. result += withoutSuffix || isFuture ? 'leta' : 'leti';
  20672. } else {
  20673. result += withoutSuffix || isFuture ? 'let' : 'leti';
  20674. }
  20675. return result;
  20676. }
  20677. }
  20678. var sl = moment.defineLocale('sl', {
  20679. months : 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split('_'),
  20680. monthsShort : 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split('_'),
  20681. monthsParseExact: true,
  20682. weekdays : 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'),
  20683. weekdaysShort : 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),
  20684. weekdaysMin : 'ne_po_to_sr_če_pe_so'.split('_'),
  20685. weekdaysParseExact : true,
  20686. longDateFormat : {
  20687. LT : 'H:mm',
  20688. LTS : 'H:mm:ss',
  20689. L : 'DD.MM.YYYY',
  20690. LL : 'D. MMMM YYYY',
  20691. LLL : 'D. MMMM YYYY H:mm',
  20692. LLLL : 'dddd, D. MMMM YYYY H:mm'
  20693. },
  20694. calendar : {
  20695. sameDay : '[danes ob] LT',
  20696. nextDay : '[jutri ob] LT',
  20697. nextWeek : function () {
  20698. switch (this.day()) {
  20699. case 0:
  20700. return '[v] [nedeljo] [ob] LT';
  20701. case 3:
  20702. return '[v] [sredo] [ob] LT';
  20703. case 6:
  20704. return '[v] [soboto] [ob] LT';
  20705. case 1:
  20706. case 2:
  20707. case 4:
  20708. case 5:
  20709. return '[v] dddd [ob] LT';
  20710. }
  20711. },
  20712. lastDay : '[včeraj ob] LT',
  20713. lastWeek : function () {
  20714. switch (this.day()) {
  20715. case 0:
  20716. return '[prejšnjo] [nedeljo] [ob] LT';
  20717. case 3:
  20718. return '[prejšnjo] [sredo] [ob] LT';
  20719. case 6:
  20720. return '[prejšnjo] [soboto] [ob] LT';
  20721. case 1:
  20722. case 2:
  20723. case 4:
  20724. case 5:
  20725. return '[prejšnji] dddd [ob] LT';
  20726. }
  20727. },
  20728. sameElse : 'L'
  20729. },
  20730. relativeTime : {
  20731. future : 'čez %s',
  20732. past : 'pred %s',
  20733. s : processRelativeTime,
  20734. m : processRelativeTime,
  20735. mm : processRelativeTime,
  20736. h : processRelativeTime,
  20737. hh : processRelativeTime,
  20738. d : processRelativeTime,
  20739. dd : processRelativeTime,
  20740. M : processRelativeTime,
  20741. MM : processRelativeTime,
  20742. y : processRelativeTime,
  20743. yy : processRelativeTime
  20744. },
  20745. ordinalParse: /\d{1,2}\./,
  20746. ordinal : '%d.',
  20747. week : {
  20748. dow : 1, // Monday is the first day of the week.
  20749. doy : 7 // The week that contains Jan 1st is the first week of the year.
  20750. }
  20751. });
  20752. return sl;
  20753. })));
  20754. /***/ }),
  20755. /* 88 */
  20756. /***/ (function(module, exports, __webpack_require__) {
  20757. //! moment.js locale configuration
  20758. //! locale : Albanian [sq]
  20759. //! author : Flakërim Ismani : https://github.com/flakerimi
  20760. //! author : Menelion Elensúle : https://github.com/Oire
  20761. //! author : Oerd Cukalla : https://github.com/oerd
  20762. ;(function (global, factory) {
  20763. true ? factory(__webpack_require__(0)) :
  20764. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  20765. factory(global.moment)
  20766. }(this, (function (moment) { 'use strict';
  20767. var sq = moment.defineLocale('sq', {
  20768. months : 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split('_'),
  20769. monthsShort : 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'),
  20770. weekdays : 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split('_'),
  20771. weekdaysShort : 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'),
  20772. weekdaysMin : 'D_H_Ma_Më_E_P_Sh'.split('_'),
  20773. weekdaysParseExact : true,
  20774. meridiemParse: /PD|MD/,
  20775. isPM: function (input) {
  20776. return input.charAt(0) === 'M';
  20777. },
  20778. meridiem : function (hours, minutes, isLower) {
  20779. return hours < 12 ? 'PD' : 'MD';
  20780. },
  20781. longDateFormat : {
  20782. LT : 'HH:mm',
  20783. LTS : 'HH:mm:ss',
  20784. L : 'DD/MM/YYYY',
  20785. LL : 'D MMMM YYYY',
  20786. LLL : 'D MMMM YYYY HH:mm',
  20787. LLLL : 'dddd, D MMMM YYYY HH:mm'
  20788. },
  20789. calendar : {
  20790. sameDay : '[Sot në] LT',
  20791. nextDay : '[Nesër në] LT',
  20792. nextWeek : 'dddd [në] LT',
  20793. lastDay : '[Dje në] LT',
  20794. lastWeek : 'dddd [e kaluar në] LT',
  20795. sameElse : 'L'
  20796. },
  20797. relativeTime : {
  20798. future : 'në %s',
  20799. past : '%s më parë',
  20800. s : 'disa sekonda',
  20801. m : 'një minutë',
  20802. mm : '%d minuta',
  20803. h : 'një orë',
  20804. hh : '%d orë',
  20805. d : 'një ditë',
  20806. dd : '%d ditë',
  20807. M : 'një muaj',
  20808. MM : '%d muaj',
  20809. y : 'një vit',
  20810. yy : '%d vite'
  20811. },
  20812. ordinalParse: /\d{1,2}\./,
  20813. ordinal : '%d.',
  20814. week : {
  20815. dow : 1, // Monday is the first day of the week.
  20816. doy : 4 // The week that contains Jan 4th is the first week of the year.
  20817. }
  20818. });
  20819. return sq;
  20820. })));
  20821. /***/ }),
  20822. /* 89 */
  20823. /***/ (function(module, exports, __webpack_require__) {
  20824. //! moment.js locale configuration
  20825. //! locale : Serbian Cyrillic [sr-cyrl]
  20826. //! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j
  20827. ;(function (global, factory) {
  20828. true ? factory(__webpack_require__(0)) :
  20829. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  20830. factory(global.moment)
  20831. }(this, (function (moment) { 'use strict';
  20832. var translator = {
  20833. words: { //Different grammatical cases
  20834. m: ['један минут', 'једне минуте'],
  20835. mm: ['минут', 'минуте', 'минута'],
  20836. h: ['један сат', 'једног сата'],
  20837. hh: ['сат', 'сата', 'сати'],
  20838. dd: ['дан', 'дана', 'дана'],
  20839. MM: ['месец', 'месеца', 'месеци'],
  20840. yy: ['година', 'године', 'година']
  20841. },
  20842. correctGrammaticalCase: function (number, wordKey) {
  20843. return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);
  20844. },
  20845. translate: function (number, withoutSuffix, key) {
  20846. var wordKey = translator.words[key];
  20847. if (key.length === 1) {
  20848. return withoutSuffix ? wordKey[0] : wordKey[1];
  20849. } else {
  20850. return number + ' ' + translator.correctGrammaticalCase(number, wordKey);
  20851. }
  20852. }
  20853. };
  20854. var srCyrl = moment.defineLocale('sr-cyrl', {
  20855. months: 'јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар'.split('_'),
  20856. monthsShort: 'јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.'.split('_'),
  20857. monthsParseExact: true,
  20858. weekdays: 'недеља_понедељак_уторак_среда_четвртак_петак_субота'.split('_'),
  20859. weekdaysShort: 'нед._пон._уто._сре._чет._пет._суб.'.split('_'),
  20860. weekdaysMin: 'не_по_ут_ср_че_пе_су'.split('_'),
  20861. weekdaysParseExact : true,
  20862. longDateFormat: {
  20863. LT: 'H:mm',
  20864. LTS : 'H:mm:ss',
  20865. L: 'DD.MM.YYYY',
  20866. LL: 'D. MMMM YYYY',
  20867. LLL: 'D. MMMM YYYY H:mm',
  20868. LLLL: 'dddd, D. MMMM YYYY H:mm'
  20869. },
  20870. calendar: {
  20871. sameDay: '[данас у] LT',
  20872. nextDay: '[сутра у] LT',
  20873. nextWeek: function () {
  20874. switch (this.day()) {
  20875. case 0:
  20876. return '[у] [недељу] [у] LT';
  20877. case 3:
  20878. return '[у] [среду] [у] LT';
  20879. case 6:
  20880. return '[у] [суботу] [у] LT';
  20881. case 1:
  20882. case 2:
  20883. case 4:
  20884. case 5:
  20885. return '[у] dddd [у] LT';
  20886. }
  20887. },
  20888. lastDay : '[јуче у] LT',
  20889. lastWeek : function () {
  20890. var lastWeekDays = [
  20891. '[прошле] [недеље] [у] LT',
  20892. '[прошлог] [понедељка] [у] LT',
  20893. '[прошлог] [уторка] [у] LT',
  20894. '[прошле] [среде] [у] LT',
  20895. '[прошлог] [четвртка] [у] LT',
  20896. '[прошлог] [петка] [у] LT',
  20897. '[прошле] [суботе] [у] LT'
  20898. ];
  20899. return lastWeekDays[this.day()];
  20900. },
  20901. sameElse : 'L'
  20902. },
  20903. relativeTime : {
  20904. future : 'за %s',
  20905. past : 'пре %s',
  20906. s : 'неколико секунди',
  20907. m : translator.translate,
  20908. mm : translator.translate,
  20909. h : translator.translate,
  20910. hh : translator.translate,
  20911. d : 'дан',
  20912. dd : translator.translate,
  20913. M : 'месец',
  20914. MM : translator.translate,
  20915. y : 'годину',
  20916. yy : translator.translate
  20917. },
  20918. ordinalParse: /\d{1,2}\./,
  20919. ordinal : '%d.',
  20920. week : {
  20921. dow : 1, // Monday is the first day of the week.
  20922. doy : 7 // The week that contains Jan 1st is the first week of the year.
  20923. }
  20924. });
  20925. return srCyrl;
  20926. })));
  20927. /***/ }),
  20928. /* 90 */
  20929. /***/ (function(module, exports, __webpack_require__) {
  20930. //! moment.js locale configuration
  20931. //! locale : Serbian [sr]
  20932. //! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j
  20933. ;(function (global, factory) {
  20934. true ? factory(__webpack_require__(0)) :
  20935. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  20936. factory(global.moment)
  20937. }(this, (function (moment) { 'use strict';
  20938. var translator = {
  20939. words: { //Different grammatical cases
  20940. m: ['jedan minut', 'jedne minute'],
  20941. mm: ['minut', 'minute', 'minuta'],
  20942. h: ['jedan sat', 'jednog sata'],
  20943. hh: ['sat', 'sata', 'sati'],
  20944. dd: ['dan', 'dana', 'dana'],
  20945. MM: ['mesec', 'meseca', 'meseci'],
  20946. yy: ['godina', 'godine', 'godina']
  20947. },
  20948. correctGrammaticalCase: function (number, wordKey) {
  20949. return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);
  20950. },
  20951. translate: function (number, withoutSuffix, key) {
  20952. var wordKey = translator.words[key];
  20953. if (key.length === 1) {
  20954. return withoutSuffix ? wordKey[0] : wordKey[1];
  20955. } else {
  20956. return number + ' ' + translator.correctGrammaticalCase(number, wordKey);
  20957. }
  20958. }
  20959. };
  20960. var sr = moment.defineLocale('sr', {
  20961. months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split('_'),
  20962. monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),
  20963. monthsParseExact: true,
  20964. weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split('_'),
  20965. weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'),
  20966. weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
  20967. weekdaysParseExact : true,
  20968. longDateFormat: {
  20969. LT: 'H:mm',
  20970. LTS : 'H:mm:ss',
  20971. L: 'DD.MM.YYYY',
  20972. LL: 'D. MMMM YYYY',
  20973. LLL: 'D. MMMM YYYY H:mm',
  20974. LLLL: 'dddd, D. MMMM YYYY H:mm'
  20975. },
  20976. calendar: {
  20977. sameDay: '[danas u] LT',
  20978. nextDay: '[sutra u] LT',
  20979. nextWeek: function () {
  20980. switch (this.day()) {
  20981. case 0:
  20982. return '[u] [nedelju] [u] LT';
  20983. case 3:
  20984. return '[u] [sredu] [u] LT';
  20985. case 6:
  20986. return '[u] [subotu] [u] LT';
  20987. case 1:
  20988. case 2:
  20989. case 4:
  20990. case 5:
  20991. return '[u] dddd [u] LT';
  20992. }
  20993. },
  20994. lastDay : '[juče u] LT',
  20995. lastWeek : function () {
  20996. var lastWeekDays = [
  20997. '[prošle] [nedelje] [u] LT',
  20998. '[prošlog] [ponedeljka] [u] LT',
  20999. '[prošlog] [utorka] [u] LT',
  21000. '[prošle] [srede] [u] LT',
  21001. '[prošlog] [četvrtka] [u] LT',
  21002. '[prošlog] [petka] [u] LT',
  21003. '[prošle] [subote] [u] LT'
  21004. ];
  21005. return lastWeekDays[this.day()];
  21006. },
  21007. sameElse : 'L'
  21008. },
  21009. relativeTime : {
  21010. future : 'za %s',
  21011. past : 'pre %s',
  21012. s : 'nekoliko sekundi',
  21013. m : translator.translate,
  21014. mm : translator.translate,
  21015. h : translator.translate,
  21016. hh : translator.translate,
  21017. d : 'dan',
  21018. dd : translator.translate,
  21019. M : 'mesec',
  21020. MM : translator.translate,
  21021. y : 'godinu',
  21022. yy : translator.translate
  21023. },
  21024. ordinalParse: /\d{1,2}\./,
  21025. ordinal : '%d.',
  21026. week : {
  21027. dow : 1, // Monday is the first day of the week.
  21028. doy : 7 // The week that contains Jan 1st is the first week of the year.
  21029. }
  21030. });
  21031. return sr;
  21032. })));
  21033. /***/ }),
  21034. /* 91 */
  21035. /***/ (function(module, exports, __webpack_require__) {
  21036. //! moment.js locale configuration
  21037. //! locale : siSwati [ss]
  21038. //! author : Nicolai Davies<mail@nicolai.io> : https://github.com/nicolaidavies
  21039. ;(function (global, factory) {
  21040. true ? factory(__webpack_require__(0)) :
  21041. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  21042. factory(global.moment)
  21043. }(this, (function (moment) { 'use strict';
  21044. var ss = moment.defineLocale('ss', {
  21045. months : "Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split('_'),
  21046. monthsShort : 'Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo'.split('_'),
  21047. weekdays : 'Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo'.split('_'),
  21048. weekdaysShort : 'Lis_Umb_Lsb_Les_Lsi_Lsh_Umg'.split('_'),
  21049. weekdaysMin : 'Li_Us_Lb_Lt_Ls_Lh_Ug'.split('_'),
  21050. weekdaysParseExact : true,
  21051. longDateFormat : {
  21052. LT : 'h:mm A',
  21053. LTS : 'h:mm:ss A',
  21054. L : 'DD/MM/YYYY',
  21055. LL : 'D MMMM YYYY',
  21056. LLL : 'D MMMM YYYY h:mm A',
  21057. LLLL : 'dddd, D MMMM YYYY h:mm A'
  21058. },
  21059. calendar : {
  21060. sameDay : '[Namuhla nga] LT',
  21061. nextDay : '[Kusasa nga] LT',
  21062. nextWeek : 'dddd [nga] LT',
  21063. lastDay : '[Itolo nga] LT',
  21064. lastWeek : 'dddd [leliphelile] [nga] LT',
  21065. sameElse : 'L'
  21066. },
  21067. relativeTime : {
  21068. future : 'nga %s',
  21069. past : 'wenteka nga %s',
  21070. s : 'emizuzwana lomcane',
  21071. m : 'umzuzu',
  21072. mm : '%d emizuzu',
  21073. h : 'lihora',
  21074. hh : '%d emahora',
  21075. d : 'lilanga',
  21076. dd : '%d emalanga',
  21077. M : 'inyanga',
  21078. MM : '%d tinyanga',
  21079. y : 'umnyaka',
  21080. yy : '%d iminyaka'
  21081. },
  21082. meridiemParse: /ekuseni|emini|entsambama|ebusuku/,
  21083. meridiem : function (hours, minutes, isLower) {
  21084. if (hours < 11) {
  21085. return 'ekuseni';
  21086. } else if (hours < 15) {
  21087. return 'emini';
  21088. } else if (hours < 19) {
  21089. return 'entsambama';
  21090. } else {
  21091. return 'ebusuku';
  21092. }
  21093. },
  21094. meridiemHour : function (hour, meridiem) {
  21095. if (hour === 12) {
  21096. hour = 0;
  21097. }
  21098. if (meridiem === 'ekuseni') {
  21099. return hour;
  21100. } else if (meridiem === 'emini') {
  21101. return hour >= 11 ? hour : hour + 12;
  21102. } else if (meridiem === 'entsambama' || meridiem === 'ebusuku') {
  21103. if (hour === 0) {
  21104. return 0;
  21105. }
  21106. return hour + 12;
  21107. }
  21108. },
  21109. ordinalParse: /\d{1,2}/,
  21110. ordinal : '%d',
  21111. week : {
  21112. dow : 1, // Monday is the first day of the week.
  21113. doy : 4 // The week that contains Jan 4th is the first week of the year.
  21114. }
  21115. });
  21116. return ss;
  21117. })));
  21118. /***/ }),
  21119. /* 92 */
  21120. /***/ (function(module, exports, __webpack_require__) {
  21121. //! moment.js locale configuration
  21122. //! locale : Swedish [sv]
  21123. //! author : Jens Alm : https://github.com/ulmus
  21124. ;(function (global, factory) {
  21125. true ? factory(__webpack_require__(0)) :
  21126. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  21127. factory(global.moment)
  21128. }(this, (function (moment) { 'use strict';
  21129. var sv = moment.defineLocale('sv', {
  21130. months : 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split('_'),
  21131. monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
  21132. weekdays : 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'),
  21133. weekdaysShort : 'sön_mån_tis_ons_tor_fre_lör'.split('_'),
  21134. weekdaysMin : 'sö_må_ti_on_to_fr_lö'.split('_'),
  21135. longDateFormat : {
  21136. LT : 'HH:mm',
  21137. LTS : 'HH:mm:ss',
  21138. L : 'YYYY-MM-DD',
  21139. LL : 'D MMMM YYYY',
  21140. LLL : 'D MMMM YYYY [kl.] HH:mm',
  21141. LLLL : 'dddd D MMMM YYYY [kl.] HH:mm',
  21142. lll : 'D MMM YYYY HH:mm',
  21143. llll : 'ddd D MMM YYYY HH:mm'
  21144. },
  21145. calendar : {
  21146. sameDay: '[Idag] LT',
  21147. nextDay: '[Imorgon] LT',
  21148. lastDay: '[Igår] LT',
  21149. nextWeek: '[På] dddd LT',
  21150. lastWeek: '[I] dddd[s] LT',
  21151. sameElse: 'L'
  21152. },
  21153. relativeTime : {
  21154. future : 'om %s',
  21155. past : 'för %s sedan',
  21156. s : 'några sekunder',
  21157. m : 'en minut',
  21158. mm : '%d minuter',
  21159. h : 'en timme',
  21160. hh : '%d timmar',
  21161. d : 'en dag',
  21162. dd : '%d dagar',
  21163. M : 'en månad',
  21164. MM : '%d månader',
  21165. y : 'ett år',
  21166. yy : '%d år'
  21167. },
  21168. ordinalParse: /\d{1,2}(e|a)/,
  21169. ordinal : function (number) {
  21170. var b = number % 10,
  21171. output = (~~(number % 100 / 10) === 1) ? 'e' :
  21172. (b === 1) ? 'a' :
  21173. (b === 2) ? 'a' :
  21174. (b === 3) ? 'e' : 'e';
  21175. return number + output;
  21176. },
  21177. week : {
  21178. dow : 1, // Monday is the first day of the week.
  21179. doy : 4 // The week that contains Jan 4th is the first week of the year.
  21180. }
  21181. });
  21182. return sv;
  21183. })));
  21184. /***/ }),
  21185. /* 93 */
  21186. /***/ (function(module, exports, __webpack_require__) {
  21187. //! moment.js locale configuration
  21188. //! locale : Swahili [sw]
  21189. //! author : Fahad Kassim : https://github.com/fadsel
  21190. ;(function (global, factory) {
  21191. true ? factory(__webpack_require__(0)) :
  21192. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  21193. factory(global.moment)
  21194. }(this, (function (moment) { 'use strict';
  21195. var sw = moment.defineLocale('sw', {
  21196. months : 'Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba'.split('_'),
  21197. monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des'.split('_'),
  21198. weekdays : 'Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi'.split('_'),
  21199. weekdaysShort : 'Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos'.split('_'),
  21200. weekdaysMin : 'J2_J3_J4_J5_Al_Ij_J1'.split('_'),
  21201. weekdaysParseExact : true,
  21202. longDateFormat : {
  21203. LT : 'HH:mm',
  21204. LTS : 'HH:mm:ss',
  21205. L : 'DD.MM.YYYY',
  21206. LL : 'D MMMM YYYY',
  21207. LLL : 'D MMMM YYYY HH:mm',
  21208. LLLL : 'dddd, D MMMM YYYY HH:mm'
  21209. },
  21210. calendar : {
  21211. sameDay : '[leo saa] LT',
  21212. nextDay : '[kesho saa] LT',
  21213. nextWeek : '[wiki ijayo] dddd [saat] LT',
  21214. lastDay : '[jana] LT',
  21215. lastWeek : '[wiki iliyopita] dddd [saat] LT',
  21216. sameElse : 'L'
  21217. },
  21218. relativeTime : {
  21219. future : '%s baadaye',
  21220. past : 'tokea %s',
  21221. s : 'hivi punde',
  21222. m : 'dakika moja',
  21223. mm : 'dakika %d',
  21224. h : 'saa limoja',
  21225. hh : 'masaa %d',
  21226. d : 'siku moja',
  21227. dd : 'masiku %d',
  21228. M : 'mwezi mmoja',
  21229. MM : 'miezi %d',
  21230. y : 'mwaka mmoja',
  21231. yy : 'miaka %d'
  21232. },
  21233. week : {
  21234. dow : 1, // Monday is the first day of the week.
  21235. doy : 7 // The week that contains Jan 1st is the first week of the year.
  21236. }
  21237. });
  21238. return sw;
  21239. })));
  21240. /***/ }),
  21241. /* 94 */
  21242. /***/ (function(module, exports, __webpack_require__) {
  21243. //! moment.js locale configuration
  21244. //! locale : Tamil [ta]
  21245. //! author : Arjunkumar Krishnamoorthy : https://github.com/tk120404
  21246. ;(function (global, factory) {
  21247. true ? factory(__webpack_require__(0)) :
  21248. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  21249. factory(global.moment)
  21250. }(this, (function (moment) { 'use strict';
  21251. var symbolMap = {
  21252. '1': '௧',
  21253. '2': '௨',
  21254. '3': '௩',
  21255. '4': '௪',
  21256. '5': '௫',
  21257. '6': '௬',
  21258. '7': '௭',
  21259. '8': '௮',
  21260. '9': '௯',
  21261. '0': '௦'
  21262. };
  21263. var numberMap = {
  21264. '௧': '1',
  21265. '௨': '2',
  21266. '௩': '3',
  21267. '௪': '4',
  21268. '௫': '5',
  21269. '௬': '6',
  21270. '௭': '7',
  21271. '௮': '8',
  21272. '௯': '9',
  21273. '௦': '0'
  21274. };
  21275. var ta = moment.defineLocale('ta', {
  21276. months : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),
  21277. monthsShort : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),
  21278. weekdays : 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split('_'),
  21279. weekdaysShort : 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split('_'),
  21280. weekdaysMin : 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'),
  21281. longDateFormat : {
  21282. LT : 'HH:mm',
  21283. LTS : 'HH:mm:ss',
  21284. L : 'DD/MM/YYYY',
  21285. LL : 'D MMMM YYYY',
  21286. LLL : 'D MMMM YYYY, HH:mm',
  21287. LLLL : 'dddd, D MMMM YYYY, HH:mm'
  21288. },
  21289. calendar : {
  21290. sameDay : '[இன்று] LT',
  21291. nextDay : '[நாளை] LT',
  21292. nextWeek : 'dddd, LT',
  21293. lastDay : '[நேற்று] LT',
  21294. lastWeek : '[கடந்த வாரம்] dddd, LT',
  21295. sameElse : 'L'
  21296. },
  21297. relativeTime : {
  21298. future : '%s இல்',
  21299. past : '%s முன்',
  21300. s : 'ஒரு சில விநாடிகள்',
  21301. m : 'ஒரு நிமிடம்',
  21302. mm : '%d நிமிடங்கள்',
  21303. h : 'ஒரு மணி நேரம்',
  21304. hh : '%d மணி நேரம்',
  21305. d : 'ஒரு நாள்',
  21306. dd : '%d நாட்கள்',
  21307. M : 'ஒரு மாதம்',
  21308. MM : '%d மாதங்கள்',
  21309. y : 'ஒரு வருடம்',
  21310. yy : '%d ஆண்டுகள்'
  21311. },
  21312. ordinalParse: /\d{1,2}வது/,
  21313. ordinal : function (number) {
  21314. return number + 'வது';
  21315. },
  21316. preparse: function (string) {
  21317. return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) {
  21318. return numberMap[match];
  21319. });
  21320. },
  21321. postformat: function (string) {
  21322. return string.replace(/\d/g, function (match) {
  21323. return symbolMap[match];
  21324. });
  21325. },
  21326. // refer http://ta.wikipedia.org/s/1er1
  21327. meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,
  21328. meridiem : function (hour, minute, isLower) {
  21329. if (hour < 2) {
  21330. return ' யாமம்';
  21331. } else if (hour < 6) {
  21332. return ' வைகறை'; // வைகறை
  21333. } else if (hour < 10) {
  21334. return ' காலை'; // காலை
  21335. } else if (hour < 14) {
  21336. return ' நண்பகல்'; // நண்பகல்
  21337. } else if (hour < 18) {
  21338. return ' எற்பாடு'; // எற்பாடு
  21339. } else if (hour < 22) {
  21340. return ' மாலை'; // மாலை
  21341. } else {
  21342. return ' யாமம்';
  21343. }
  21344. },
  21345. meridiemHour : function (hour, meridiem) {
  21346. if (hour === 12) {
  21347. hour = 0;
  21348. }
  21349. if (meridiem === 'யாமம்') {
  21350. return hour < 2 ? hour : hour + 12;
  21351. } else if (meridiem === 'வைகறை' || meridiem === 'காலை') {
  21352. return hour;
  21353. } else if (meridiem === 'நண்பகல்') {
  21354. return hour >= 10 ? hour : hour + 12;
  21355. } else {
  21356. return hour + 12;
  21357. }
  21358. },
  21359. week : {
  21360. dow : 0, // Sunday is the first day of the week.
  21361. doy : 6 // The week that contains Jan 1st is the first week of the year.
  21362. }
  21363. });
  21364. return ta;
  21365. })));
  21366. /***/ }),
  21367. /* 95 */
  21368. /***/ (function(module, exports, __webpack_require__) {
  21369. //! moment.js locale configuration
  21370. //! locale : Telugu [te]
  21371. //! author : Krishna Chaitanya Thota : https://github.com/kcthota
  21372. ;(function (global, factory) {
  21373. true ? factory(__webpack_require__(0)) :
  21374. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  21375. factory(global.moment)
  21376. }(this, (function (moment) { 'use strict';
  21377. var te = moment.defineLocale('te', {
  21378. months : 'జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జూలై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్'.split('_'),
  21379. monthsShort : 'జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జూలై_ఆగ._సెప్._అక్టో._నవ._డిసె.'.split('_'),
  21380. monthsParseExact : true,
  21381. weekdays : 'ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం'.split('_'),
  21382. weekdaysShort : 'ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని'.split('_'),
  21383. weekdaysMin : 'ఆ_సో_మం_బు_గు_శు_శ'.split('_'),
  21384. longDateFormat : {
  21385. LT : 'A h:mm',
  21386. LTS : 'A h:mm:ss',
  21387. L : 'DD/MM/YYYY',
  21388. LL : 'D MMMM YYYY',
  21389. LLL : 'D MMMM YYYY, A h:mm',
  21390. LLLL : 'dddd, D MMMM YYYY, A h:mm'
  21391. },
  21392. calendar : {
  21393. sameDay : '[నేడు] LT',
  21394. nextDay : '[రేపు] LT',
  21395. nextWeek : 'dddd, LT',
  21396. lastDay : '[నిన్న] LT',
  21397. lastWeek : '[గత] dddd, LT',
  21398. sameElse : 'L'
  21399. },
  21400. relativeTime : {
  21401. future : '%s లో',
  21402. past : '%s క్రితం',
  21403. s : 'కొన్ని క్షణాలు',
  21404. m : 'ఒక నిమిషం',
  21405. mm : '%d నిమిషాలు',
  21406. h : 'ఒక గంట',
  21407. hh : '%d గంటలు',
  21408. d : 'ఒక రోజు',
  21409. dd : '%d రోజులు',
  21410. M : 'ఒక నెల',
  21411. MM : '%d నెలలు',
  21412. y : 'ఒక సంవత్సరం',
  21413. yy : '%d సంవత్సరాలు'
  21414. },
  21415. ordinalParse : /\d{1,2}వ/,
  21416. ordinal : '%dవ',
  21417. meridiemParse: /రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,
  21418. meridiemHour : function (hour, meridiem) {
  21419. if (hour === 12) {
  21420. hour = 0;
  21421. }
  21422. if (meridiem === 'రాత్రి') {
  21423. return hour < 4 ? hour : hour + 12;
  21424. } else if (meridiem === 'ఉదయం') {
  21425. return hour;
  21426. } else if (meridiem === 'మధ్యాహ్నం') {
  21427. return hour >= 10 ? hour : hour + 12;
  21428. } else if (meridiem === 'సాయంత్రం') {
  21429. return hour + 12;
  21430. }
  21431. },
  21432. meridiem : function (hour, minute, isLower) {
  21433. if (hour < 4) {
  21434. return 'రాత్రి';
  21435. } else if (hour < 10) {
  21436. return 'ఉదయం';
  21437. } else if (hour < 17) {
  21438. return 'మధ్యాహ్నం';
  21439. } else if (hour < 20) {
  21440. return 'సాయంత్రం';
  21441. } else {
  21442. return 'రాత్రి';
  21443. }
  21444. },
  21445. week : {
  21446. dow : 0, // Sunday is the first day of the week.
  21447. doy : 6 // The week that contains Jan 1st is the first week of the year.
  21448. }
  21449. });
  21450. return te;
  21451. })));
  21452. /***/ }),
  21453. /* 96 */
  21454. /***/ (function(module, exports, __webpack_require__) {
  21455. //! moment.js locale configuration
  21456. //! locale : Tetun Dili (East Timor) [tet]
  21457. //! author : Joshua Brooks : https://github.com/joshbrooks
  21458. //! author : Onorio De J. Afonso : https://github.com/marobo
  21459. ;(function (global, factory) {
  21460. true ? factory(__webpack_require__(0)) :
  21461. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  21462. factory(global.moment)
  21463. }(this, (function (moment) { 'use strict';
  21464. var tet = moment.defineLocale('tet', {
  21465. months : 'Janeiru_Fevereiru_Marsu_Abril_Maiu_Juniu_Juliu_Augustu_Setembru_Outubru_Novembru_Dezembru'.split('_'),
  21466. monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Aug_Set_Out_Nov_Dez'.split('_'),
  21467. weekdays : 'Domingu_Segunda_Tersa_Kuarta_Kinta_Sexta_Sabadu'.split('_'),
  21468. weekdaysShort : 'Dom_Seg_Ters_Kua_Kint_Sext_Sab'.split('_'),
  21469. weekdaysMin : 'Do_Seg_Te_Ku_Ki_Sex_Sa'.split('_'),
  21470. longDateFormat : {
  21471. LT : 'HH:mm',
  21472. LTS : 'HH:mm:ss',
  21473. L : 'DD/MM/YYYY',
  21474. LL : 'D MMMM YYYY',
  21475. LLL : 'D MMMM YYYY HH:mm',
  21476. LLLL : 'dddd, D MMMM YYYY HH:mm'
  21477. },
  21478. calendar : {
  21479. sameDay: '[Ohin iha] LT',
  21480. nextDay: '[Aban iha] LT',
  21481. nextWeek: 'dddd [iha] LT',
  21482. lastDay: '[Horiseik iha] LT',
  21483. lastWeek: 'dddd [semana kotuk] [iha] LT',
  21484. sameElse: 'L'
  21485. },
  21486. relativeTime : {
  21487. future : 'iha %s',
  21488. past : '%s liuba',
  21489. s : 'minutu balun',
  21490. m : 'minutu ida',
  21491. mm : 'minutus %d',
  21492. h : 'horas ida',
  21493. hh : 'horas %d',
  21494. d : 'loron ida',
  21495. dd : 'loron %d',
  21496. M : 'fulan ida',
  21497. MM : 'fulan %d',
  21498. y : 'tinan ida',
  21499. yy : 'tinan %d'
  21500. },
  21501. ordinalParse: /\d{1,2}(st|nd|rd|th)/,
  21502. ordinal : function (number) {
  21503. var b = number % 10,
  21504. output = (~~(number % 100 / 10) === 1) ? 'th' :
  21505. (b === 1) ? 'st' :
  21506. (b === 2) ? 'nd' :
  21507. (b === 3) ? 'rd' : 'th';
  21508. return number + output;
  21509. },
  21510. week : {
  21511. dow : 1, // Monday is the first day of the week.
  21512. doy : 4 // The week that contains Jan 4th is the first week of the year.
  21513. }
  21514. });
  21515. return tet;
  21516. })));
  21517. /***/ }),
  21518. /* 97 */
  21519. /***/ (function(module, exports, __webpack_require__) {
  21520. //! moment.js locale configuration
  21521. //! locale : Thai [th]
  21522. //! author : Kridsada Thanabulpong : https://github.com/sirn
  21523. ;(function (global, factory) {
  21524. true ? factory(__webpack_require__(0)) :
  21525. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  21526. factory(global.moment)
  21527. }(this, (function (moment) { 'use strict';
  21528. var th = moment.defineLocale('th', {
  21529. months : 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split('_'),
  21530. monthsShort : 'ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.'.split('_'),
  21531. monthsParseExact: true,
  21532. weekdays : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'),
  21533. weekdaysShort : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์'.split('_'), // yes, three characters difference
  21534. weekdaysMin : 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'),
  21535. weekdaysParseExact : true,
  21536. longDateFormat : {
  21537. LT : 'H:mm',
  21538. LTS : 'H:mm:ss',
  21539. L : 'YYYY/MM/DD',
  21540. LL : 'D MMMM YYYY',
  21541. LLL : 'D MMMM YYYY เวลา H:mm',
  21542. LLLL : 'วันddddที่ D MMMM YYYY เวลา H:mm'
  21543. },
  21544. meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/,
  21545. isPM: function (input) {
  21546. return input === 'หลังเที่ยง';
  21547. },
  21548. meridiem : function (hour, minute, isLower) {
  21549. if (hour < 12) {
  21550. return 'ก่อนเที่ยง';
  21551. } else {
  21552. return 'หลังเที่ยง';
  21553. }
  21554. },
  21555. calendar : {
  21556. sameDay : '[วันนี้ เวลา] LT',
  21557. nextDay : '[พรุ่งนี้ เวลา] LT',
  21558. nextWeek : 'dddd[หน้า เวลา] LT',
  21559. lastDay : '[เมื่อวานนี้ เวลา] LT',
  21560. lastWeek : '[วัน]dddd[ที่แล้ว เวลา] LT',
  21561. sameElse : 'L'
  21562. },
  21563. relativeTime : {
  21564. future : 'อีก %s',
  21565. past : '%sที่แล้ว',
  21566. s : 'ไม่กี่วินาที',
  21567. m : '1 นาที',
  21568. mm : '%d นาที',
  21569. h : '1 ชั่วโมง',
  21570. hh : '%d ชั่วโมง',
  21571. d : '1 วัน',
  21572. dd : '%d วัน',
  21573. M : '1 เดือน',
  21574. MM : '%d เดือน',
  21575. y : '1 ปี',
  21576. yy : '%d ปี'
  21577. }
  21578. });
  21579. return th;
  21580. })));
  21581. /***/ }),
  21582. /* 98 */
  21583. /***/ (function(module, exports, __webpack_require__) {
  21584. //! moment.js locale configuration
  21585. //! locale : Tagalog (Philippines) [tl-ph]
  21586. //! author : Dan Hagman : https://github.com/hagmandan
  21587. ;(function (global, factory) {
  21588. true ? factory(__webpack_require__(0)) :
  21589. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  21590. factory(global.moment)
  21591. }(this, (function (moment) { 'use strict';
  21592. var tlPh = moment.defineLocale('tl-ph', {
  21593. months : 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split('_'),
  21594. monthsShort : 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),
  21595. weekdays : 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split('_'),
  21596. weekdaysShort : 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),
  21597. weekdaysMin : 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),
  21598. longDateFormat : {
  21599. LT : 'HH:mm',
  21600. LTS : 'HH:mm:ss',
  21601. L : 'MM/D/YYYY',
  21602. LL : 'MMMM D, YYYY',
  21603. LLL : 'MMMM D, YYYY HH:mm',
  21604. LLLL : 'dddd, MMMM DD, YYYY HH:mm'
  21605. },
  21606. calendar : {
  21607. sameDay: 'LT [ngayong araw]',
  21608. nextDay: '[Bukas ng] LT',
  21609. nextWeek: 'LT [sa susunod na] dddd',
  21610. lastDay: 'LT [kahapon]',
  21611. lastWeek: 'LT [noong nakaraang] dddd',
  21612. sameElse: 'L'
  21613. },
  21614. relativeTime : {
  21615. future : 'sa loob ng %s',
  21616. past : '%s ang nakalipas',
  21617. s : 'ilang segundo',
  21618. m : 'isang minuto',
  21619. mm : '%d minuto',
  21620. h : 'isang oras',
  21621. hh : '%d oras',
  21622. d : 'isang araw',
  21623. dd : '%d araw',
  21624. M : 'isang buwan',
  21625. MM : '%d buwan',
  21626. y : 'isang taon',
  21627. yy : '%d taon'
  21628. },
  21629. ordinalParse: /\d{1,2}/,
  21630. ordinal : function (number) {
  21631. return number;
  21632. },
  21633. week : {
  21634. dow : 1, // Monday is the first day of the week.
  21635. doy : 4 // The week that contains Jan 4th is the first week of the year.
  21636. }
  21637. });
  21638. return tlPh;
  21639. })));
  21640. /***/ }),
  21641. /* 99 */
  21642. /***/ (function(module, exports, __webpack_require__) {
  21643. //! moment.js locale configuration
  21644. //! locale : Klingon [tlh]
  21645. //! author : Dominika Kruk : https://github.com/amaranthrose
  21646. ;(function (global, factory) {
  21647. true ? factory(__webpack_require__(0)) :
  21648. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  21649. factory(global.moment)
  21650. }(this, (function (moment) { 'use strict';
  21651. var numbersNouns = 'pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut'.split('_');
  21652. function translateFuture(output) {
  21653. var time = output;
  21654. time = (output.indexOf('jaj') !== -1) ?
  21655. time.slice(0, -3) + 'leS' :
  21656. (output.indexOf('jar') !== -1) ?
  21657. time.slice(0, -3) + 'waQ' :
  21658. (output.indexOf('DIS') !== -1) ?
  21659. time.slice(0, -3) + 'nem' :
  21660. time + ' pIq';
  21661. return time;
  21662. }
  21663. function translatePast(output) {
  21664. var time = output;
  21665. time = (output.indexOf('jaj') !== -1) ?
  21666. time.slice(0, -3) + 'Hu’' :
  21667. (output.indexOf('jar') !== -1) ?
  21668. time.slice(0, -3) + 'wen' :
  21669. (output.indexOf('DIS') !== -1) ?
  21670. time.slice(0, -3) + 'ben' :
  21671. time + ' ret';
  21672. return time;
  21673. }
  21674. function translate(number, withoutSuffix, string, isFuture) {
  21675. var numberNoun = numberAsNoun(number);
  21676. switch (string) {
  21677. case 'mm':
  21678. return numberNoun + ' tup';
  21679. case 'hh':
  21680. return numberNoun + ' rep';
  21681. case 'dd':
  21682. return numberNoun + ' jaj';
  21683. case 'MM':
  21684. return numberNoun + ' jar';
  21685. case 'yy':
  21686. return numberNoun + ' DIS';
  21687. }
  21688. }
  21689. function numberAsNoun(number) {
  21690. var hundred = Math.floor((number % 1000) / 100),
  21691. ten = Math.floor((number % 100) / 10),
  21692. one = number % 10,
  21693. word = '';
  21694. if (hundred > 0) {
  21695. word += numbersNouns[hundred] + 'vatlh';
  21696. }
  21697. if (ten > 0) {
  21698. word += ((word !== '') ? ' ' : '') + numbersNouns[ten] + 'maH';
  21699. }
  21700. if (one > 0) {
  21701. word += ((word !== '') ? ' ' : '') + numbersNouns[one];
  21702. }
  21703. return (word === '') ? 'pagh' : word;
  21704. }
  21705. var tlh = moment.defineLocale('tlh', {
  21706. months : 'tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’'.split('_'),
  21707. monthsShort : 'jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’'.split('_'),
  21708. monthsParseExact : true,
  21709. weekdays : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
  21710. weekdaysShort : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
  21711. weekdaysMin : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
  21712. longDateFormat : {
  21713. LT : 'HH:mm',
  21714. LTS : 'HH:mm:ss',
  21715. L : 'DD.MM.YYYY',
  21716. LL : 'D MMMM YYYY',
  21717. LLL : 'D MMMM YYYY HH:mm',
  21718. LLLL : 'dddd, D MMMM YYYY HH:mm'
  21719. },
  21720. calendar : {
  21721. sameDay: '[DaHjaj] LT',
  21722. nextDay: '[wa’leS] LT',
  21723. nextWeek: 'LLL',
  21724. lastDay: '[wa’Hu’] LT',
  21725. lastWeek: 'LLL',
  21726. sameElse: 'L'
  21727. },
  21728. relativeTime : {
  21729. future : translateFuture,
  21730. past : translatePast,
  21731. s : 'puS lup',
  21732. m : 'wa’ tup',
  21733. mm : translate,
  21734. h : 'wa’ rep',
  21735. hh : translate,
  21736. d : 'wa’ jaj',
  21737. dd : translate,
  21738. M : 'wa’ jar',
  21739. MM : translate,
  21740. y : 'wa’ DIS',
  21741. yy : translate
  21742. },
  21743. ordinalParse: /\d{1,2}\./,
  21744. ordinal : '%d.',
  21745. week : {
  21746. dow : 1, // Monday is the first day of the week.
  21747. doy : 4 // The week that contains Jan 4th is the first week of the year.
  21748. }
  21749. });
  21750. return tlh;
  21751. })));
  21752. /***/ }),
  21753. /* 100 */
  21754. /***/ (function(module, exports, __webpack_require__) {
  21755. //! moment.js locale configuration
  21756. //! locale : Turkish [tr]
  21757. //! authors : Erhan Gundogan : https://github.com/erhangundogan,
  21758. //! Burak Yiğit Kaya: https://github.com/BYK
  21759. ;(function (global, factory) {
  21760. true ? factory(__webpack_require__(0)) :
  21761. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  21762. factory(global.moment)
  21763. }(this, (function (moment) { 'use strict';
  21764. var suffixes = {
  21765. 1: '\'inci',
  21766. 5: '\'inci',
  21767. 8: '\'inci',
  21768. 70: '\'inci',
  21769. 80: '\'inci',
  21770. 2: '\'nci',
  21771. 7: '\'nci',
  21772. 20: '\'nci',
  21773. 50: '\'nci',
  21774. 3: '\'üncü',
  21775. 4: '\'üncü',
  21776. 100: '\'üncü',
  21777. 6: '\'ncı',
  21778. 9: '\'uncu',
  21779. 10: '\'uncu',
  21780. 30: '\'uncu',
  21781. 60: '\'ıncı',
  21782. 90: '\'ıncı'
  21783. };
  21784. var tr = moment.defineLocale('tr', {
  21785. months : 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split('_'),
  21786. monthsShort : 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'),
  21787. weekdays : 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split('_'),
  21788. weekdaysShort : 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'),
  21789. weekdaysMin : 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'),
  21790. longDateFormat : {
  21791. LT : 'HH:mm',
  21792. LTS : 'HH:mm:ss',
  21793. L : 'DD.MM.YYYY',
  21794. LL : 'D MMMM YYYY',
  21795. LLL : 'D MMMM YYYY HH:mm',
  21796. LLLL : 'dddd, D MMMM YYYY HH:mm'
  21797. },
  21798. calendar : {
  21799. sameDay : '[bugün saat] LT',
  21800. nextDay : '[yarın saat] LT',
  21801. nextWeek : '[haftaya] dddd [saat] LT',
  21802. lastDay : '[dün] LT',
  21803. lastWeek : '[geçen hafta] dddd [saat] LT',
  21804. sameElse : 'L'
  21805. },
  21806. relativeTime : {
  21807. future : '%s sonra',
  21808. past : '%s önce',
  21809. s : 'birkaç saniye',
  21810. m : 'bir dakika',
  21811. mm : '%d dakika',
  21812. h : 'bir saat',
  21813. hh : '%d saat',
  21814. d : 'bir gün',
  21815. dd : '%d gün',
  21816. M : 'bir ay',
  21817. MM : '%d ay',
  21818. y : 'bir yıl',
  21819. yy : '%d yıl'
  21820. },
  21821. ordinalParse: /\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,
  21822. ordinal : function (number) {
  21823. if (number === 0) { // special case for zero
  21824. return number + '\'ıncı';
  21825. }
  21826. var a = number % 10,
  21827. b = number % 100 - a,
  21828. c = number >= 100 ? 100 : null;
  21829. return number + (suffixes[a] || suffixes[b] || suffixes[c]);
  21830. },
  21831. week : {
  21832. dow : 1, // Monday is the first day of the week.
  21833. doy : 7 // The week that contains Jan 1st is the first week of the year.
  21834. }
  21835. });
  21836. return tr;
  21837. })));
  21838. /***/ }),
  21839. /* 101 */
  21840. /***/ (function(module, exports, __webpack_require__) {
  21841. //! moment.js locale configuration
  21842. //! locale : Talossan [tzl]
  21843. //! author : Robin van der Vliet : https://github.com/robin0van0der0v
  21844. //! author : Iustì Canun
  21845. ;(function (global, factory) {
  21846. true ? factory(__webpack_require__(0)) :
  21847. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  21848. factory(global.moment)
  21849. }(this, (function (moment) { 'use strict';
  21850. // After the year there should be a slash and the amount of years since December 26, 1979 in Roman numerals.
  21851. // This is currently too difficult (maybe even impossible) to add.
  21852. var tzl = moment.defineLocale('tzl', {
  21853. months : 'Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar'.split('_'),
  21854. monthsShort : 'Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec'.split('_'),
  21855. weekdays : 'Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi'.split('_'),
  21856. weekdaysShort : 'Súl_Lún_Mai_Már_Xhú_Vié_Sát'.split('_'),
  21857. weekdaysMin : 'Sú_Lú_Ma_Má_Xh_Vi_Sá'.split('_'),
  21858. longDateFormat : {
  21859. LT : 'HH.mm',
  21860. LTS : 'HH.mm.ss',
  21861. L : 'DD.MM.YYYY',
  21862. LL : 'D. MMMM [dallas] YYYY',
  21863. LLL : 'D. MMMM [dallas] YYYY HH.mm',
  21864. LLLL : 'dddd, [li] D. MMMM [dallas] YYYY HH.mm'
  21865. },
  21866. meridiemParse: /d\'o|d\'a/i,
  21867. isPM : function (input) {
  21868. return 'd\'o' === input.toLowerCase();
  21869. },
  21870. meridiem : function (hours, minutes, isLower) {
  21871. if (hours > 11) {
  21872. return isLower ? 'd\'o' : 'D\'O';
  21873. } else {
  21874. return isLower ? 'd\'a' : 'D\'A';
  21875. }
  21876. },
  21877. calendar : {
  21878. sameDay : '[oxhi à] LT',
  21879. nextDay : '[demà à] LT',
  21880. nextWeek : 'dddd [à] LT',
  21881. lastDay : '[ieiri à] LT',
  21882. lastWeek : '[sür el] dddd [lasteu à] LT',
  21883. sameElse : 'L'
  21884. },
  21885. relativeTime : {
  21886. future : 'osprei %s',
  21887. past : 'ja%s',
  21888. s : processRelativeTime,
  21889. m : processRelativeTime,
  21890. mm : processRelativeTime,
  21891. h : processRelativeTime,
  21892. hh : processRelativeTime,
  21893. d : processRelativeTime,
  21894. dd : processRelativeTime,
  21895. M : processRelativeTime,
  21896. MM : processRelativeTime,
  21897. y : processRelativeTime,
  21898. yy : processRelativeTime
  21899. },
  21900. ordinalParse: /\d{1,2}\./,
  21901. ordinal : '%d.',
  21902. week : {
  21903. dow : 1, // Monday is the first day of the week.
  21904. doy : 4 // The week that contains Jan 4th is the first week of the year.
  21905. }
  21906. });
  21907. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  21908. var format = {
  21909. 's': ['viensas secunds', '\'iensas secunds'],
  21910. 'm': ['\'n míut', '\'iens míut'],
  21911. 'mm': [number + ' míuts', '' + number + ' míuts'],
  21912. 'h': ['\'n þora', '\'iensa þora'],
  21913. 'hh': [number + ' þoras', '' + number + ' þoras'],
  21914. 'd': ['\'n ziua', '\'iensa ziua'],
  21915. 'dd': [number + ' ziuas', '' + number + ' ziuas'],
  21916. 'M': ['\'n mes', '\'iens mes'],
  21917. 'MM': [number + ' mesen', '' + number + ' mesen'],
  21918. 'y': ['\'n ar', '\'iens ar'],
  21919. 'yy': [number + ' ars', '' + number + ' ars']
  21920. };
  21921. return isFuture ? format[key][0] : (withoutSuffix ? format[key][0] : format[key][1]);
  21922. }
  21923. return tzl;
  21924. })));
  21925. /***/ }),
  21926. /* 102 */
  21927. /***/ (function(module, exports, __webpack_require__) {
  21928. //! moment.js locale configuration
  21929. //! locale : Central Atlas Tamazight Latin [tzm-latn]
  21930. //! author : Abdel Said : https://github.com/abdelsaid
  21931. ;(function (global, factory) {
  21932. true ? factory(__webpack_require__(0)) :
  21933. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  21934. factory(global.moment)
  21935. }(this, (function (moment) { 'use strict';
  21936. var tzmLatn = moment.defineLocale('tzm-latn', {
  21937. months : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),
  21938. monthsShort : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),
  21939. weekdays : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
  21940. weekdaysShort : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
  21941. weekdaysMin : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
  21942. longDateFormat : {
  21943. LT : 'HH:mm',
  21944. LTS : 'HH:mm:ss',
  21945. L : 'DD/MM/YYYY',
  21946. LL : 'D MMMM YYYY',
  21947. LLL : 'D MMMM YYYY HH:mm',
  21948. LLLL : 'dddd D MMMM YYYY HH:mm'
  21949. },
  21950. calendar : {
  21951. sameDay: '[asdkh g] LT',
  21952. nextDay: '[aska g] LT',
  21953. nextWeek: 'dddd [g] LT',
  21954. lastDay: '[assant g] LT',
  21955. lastWeek: 'dddd [g] LT',
  21956. sameElse: 'L'
  21957. },
  21958. relativeTime : {
  21959. future : 'dadkh s yan %s',
  21960. past : 'yan %s',
  21961. s : 'imik',
  21962. m : 'minuḍ',
  21963. mm : '%d minuḍ',
  21964. h : 'saɛa',
  21965. hh : '%d tassaɛin',
  21966. d : 'ass',
  21967. dd : '%d ossan',
  21968. M : 'ayowr',
  21969. MM : '%d iyyirn',
  21970. y : 'asgas',
  21971. yy : '%d isgasn'
  21972. },
  21973. week : {
  21974. dow : 6, // Saturday is the first day of the week.
  21975. doy : 12 // The week that contains Jan 1st is the first week of the year.
  21976. }
  21977. });
  21978. return tzmLatn;
  21979. })));
  21980. /***/ }),
  21981. /* 103 */
  21982. /***/ (function(module, exports, __webpack_require__) {
  21983. //! moment.js locale configuration
  21984. //! locale : Central Atlas Tamazight [tzm]
  21985. //! author : Abdel Said : https://github.com/abdelsaid
  21986. ;(function (global, factory) {
  21987. true ? factory(__webpack_require__(0)) :
  21988. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  21989. factory(global.moment)
  21990. }(this, (function (moment) { 'use strict';
  21991. var tzm = moment.defineLocale('tzm', {
  21992. months : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),
  21993. monthsShort : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),
  21994. weekdays : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
  21995. weekdaysShort : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
  21996. weekdaysMin : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
  21997. longDateFormat : {
  21998. LT : 'HH:mm',
  21999. LTS: 'HH:mm:ss',
  22000. L : 'DD/MM/YYYY',
  22001. LL : 'D MMMM YYYY',
  22002. LLL : 'D MMMM YYYY HH:mm',
  22003. LLLL : 'dddd D MMMM YYYY HH:mm'
  22004. },
  22005. calendar : {
  22006. sameDay: '[ⴰⵙⴷⵅ ⴴ] LT',
  22007. nextDay: '[ⴰⵙⴽⴰ ⴴ] LT',
  22008. nextWeek: 'dddd [ⴴ] LT',
  22009. lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT',
  22010. lastWeek: 'dddd [ⴴ] LT',
  22011. sameElse: 'L'
  22012. },
  22013. relativeTime : {
  22014. future : 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s',
  22015. past : 'ⵢⴰⵏ %s',
  22016. s : 'ⵉⵎⵉⴽ',
  22017. m : 'ⵎⵉⵏⵓⴺ',
  22018. mm : '%d ⵎⵉⵏⵓⴺ',
  22019. h : 'ⵙⴰⵄⴰ',
  22020. hh : '%d ⵜⴰⵙⵙⴰⵄⵉⵏ',
  22021. d : 'ⴰⵙⵙ',
  22022. dd : '%d oⵙⵙⴰⵏ',
  22023. M : 'ⴰⵢoⵓⵔ',
  22024. MM : '%d ⵉⵢⵢⵉⵔⵏ',
  22025. y : 'ⴰⵙⴳⴰⵙ',
  22026. yy : '%d ⵉⵙⴳⴰⵙⵏ'
  22027. },
  22028. week : {
  22029. dow : 6, // Saturday is the first day of the week.
  22030. doy : 12 // The week that contains Jan 1st is the first week of the year.
  22031. }
  22032. });
  22033. return tzm;
  22034. })));
  22035. /***/ }),
  22036. /* 104 */
  22037. /***/ (function(module, exports, __webpack_require__) {
  22038. //! moment.js locale configuration
  22039. //! locale : Ukrainian [uk]
  22040. //! author : zemlanin : https://github.com/zemlanin
  22041. //! Author : Menelion Elensúle : https://github.com/Oire
  22042. ;(function (global, factory) {
  22043. true ? factory(__webpack_require__(0)) :
  22044. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  22045. factory(global.moment)
  22046. }(this, (function (moment) { 'use strict';
  22047. function plural(word, num) {
  22048. var forms = word.split('_');
  22049. 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]);
  22050. }
  22051. function relativeTimeWithPlural(number, withoutSuffix, key) {
  22052. var format = {
  22053. 'mm': withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин',
  22054. 'hh': withoutSuffix ? 'година_години_годин' : 'годину_години_годин',
  22055. 'dd': 'день_дні_днів',
  22056. 'MM': 'місяць_місяці_місяців',
  22057. 'yy': 'рік_роки_років'
  22058. };
  22059. if (key === 'm') {
  22060. return withoutSuffix ? 'хвилина' : 'хвилину';
  22061. }
  22062. else if (key === 'h') {
  22063. return withoutSuffix ? 'година' : 'годину';
  22064. }
  22065. else {
  22066. return number + ' ' + plural(format[key], +number);
  22067. }
  22068. }
  22069. function weekdaysCaseReplace(m, format) {
  22070. var weekdays = {
  22071. 'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'),
  22072. 'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'),
  22073. 'genitive': 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_')
  22074. },
  22075. nounCase = (/(\[[ВвУу]\]) ?dddd/).test(format) ?
  22076. 'accusative' :
  22077. ((/\[?(?:минулої|наступної)? ?\] ?dddd/).test(format) ?
  22078. 'genitive' :
  22079. 'nominative');
  22080. return weekdays[nounCase][m.day()];
  22081. }
  22082. function processHoursFunction(str) {
  22083. return function () {
  22084. return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT';
  22085. };
  22086. }
  22087. var uk = moment.defineLocale('uk', {
  22088. months : {
  22089. 'format': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_'),
  22090. 'standalone': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_')
  22091. },
  22092. monthsShort : 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'),
  22093. weekdays : weekdaysCaseReplace,
  22094. weekdaysShort : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
  22095. weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
  22096. longDateFormat : {
  22097. LT : 'HH:mm',
  22098. LTS : 'HH:mm:ss',
  22099. L : 'DD.MM.YYYY',
  22100. LL : 'D MMMM YYYY р.',
  22101. LLL : 'D MMMM YYYY р., HH:mm',
  22102. LLLL : 'dddd, D MMMM YYYY р., HH:mm'
  22103. },
  22104. calendar : {
  22105. sameDay: processHoursFunction('[Сьогодні '),
  22106. nextDay: processHoursFunction('[Завтра '),
  22107. lastDay: processHoursFunction('[Вчора '),
  22108. nextWeek: processHoursFunction('[У] dddd ['),
  22109. lastWeek: function () {
  22110. switch (this.day()) {
  22111. case 0:
  22112. case 3:
  22113. case 5:
  22114. case 6:
  22115. return processHoursFunction('[Минулої] dddd [').call(this);
  22116. case 1:
  22117. case 2:
  22118. case 4:
  22119. return processHoursFunction('[Минулого] dddd [').call(this);
  22120. }
  22121. },
  22122. sameElse: 'L'
  22123. },
  22124. relativeTime : {
  22125. future : 'за %s',
  22126. past : '%s тому',
  22127. s : 'декілька секунд',
  22128. m : relativeTimeWithPlural,
  22129. mm : relativeTimeWithPlural,
  22130. h : 'годину',
  22131. hh : relativeTimeWithPlural,
  22132. d : 'день',
  22133. dd : relativeTimeWithPlural,
  22134. M : 'місяць',
  22135. MM : relativeTimeWithPlural,
  22136. y : 'рік',
  22137. yy : relativeTimeWithPlural
  22138. },
  22139. // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason
  22140. meridiemParse: /ночі|ранку|дня|вечора/,
  22141. isPM: function (input) {
  22142. return /^(дня|вечора)$/.test(input);
  22143. },
  22144. meridiem : function (hour, minute, isLower) {
  22145. if (hour < 4) {
  22146. return 'ночі';
  22147. } else if (hour < 12) {
  22148. return 'ранку';
  22149. } else if (hour < 17) {
  22150. return 'дня';
  22151. } else {
  22152. return 'вечора';
  22153. }
  22154. },
  22155. ordinalParse: /\d{1,2}-(й|го)/,
  22156. ordinal: function (number, period) {
  22157. switch (period) {
  22158. case 'M':
  22159. case 'd':
  22160. case 'DDD':
  22161. case 'w':
  22162. case 'W':
  22163. return number + '-й';
  22164. case 'D':
  22165. return number + '-го';
  22166. default:
  22167. return number;
  22168. }
  22169. },
  22170. week : {
  22171. dow : 1, // Monday is the first day of the week.
  22172. doy : 7 // The week that contains Jan 1st is the first week of the year.
  22173. }
  22174. });
  22175. return uk;
  22176. })));
  22177. /***/ }),
  22178. /* 105 */
  22179. /***/ (function(module, exports, __webpack_require__) {
  22180. //! moment.js locale configuration
  22181. //! locale : Uzbek [uz]
  22182. //! author : Sardor Muminov : https://github.com/muminoff
  22183. ;(function (global, factory) {
  22184. true ? factory(__webpack_require__(0)) :
  22185. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  22186. factory(global.moment)
  22187. }(this, (function (moment) { 'use strict';
  22188. var uz = moment.defineLocale('uz', {
  22189. months : 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split('_'),
  22190. monthsShort : 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),
  22191. weekdays : 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'),
  22192. weekdaysShort : 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'),
  22193. weekdaysMin : 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'),
  22194. longDateFormat : {
  22195. LT : 'HH:mm',
  22196. LTS : 'HH:mm:ss',
  22197. L : 'DD/MM/YYYY',
  22198. LL : 'D MMMM YYYY',
  22199. LLL : 'D MMMM YYYY HH:mm',
  22200. LLLL : 'D MMMM YYYY, dddd HH:mm'
  22201. },
  22202. calendar : {
  22203. sameDay : '[Бугун соат] LT [да]',
  22204. nextDay : '[Эртага] LT [да]',
  22205. nextWeek : 'dddd [куни соат] LT [да]',
  22206. lastDay : '[Кеча соат] LT [да]',
  22207. lastWeek : '[Утган] dddd [куни соат] LT [да]',
  22208. sameElse : 'L'
  22209. },
  22210. relativeTime : {
  22211. future : 'Якин %s ичида',
  22212. past : 'Бир неча %s олдин',
  22213. s : 'фурсат',
  22214. m : 'бир дакика',
  22215. mm : '%d дакика',
  22216. h : 'бир соат',
  22217. hh : '%d соат',
  22218. d : 'бир кун',
  22219. dd : '%d кун',
  22220. M : 'бир ой',
  22221. MM : '%d ой',
  22222. y : 'бир йил',
  22223. yy : '%d йил'
  22224. },
  22225. week : {
  22226. dow : 1, // Monday is the first day of the week.
  22227. doy : 7 // The week that contains Jan 4th is the first week of the year.
  22228. }
  22229. });
  22230. return uz;
  22231. })));
  22232. /***/ }),
  22233. /* 106 */
  22234. /***/ (function(module, exports, __webpack_require__) {
  22235. //! moment.js locale configuration
  22236. //! locale : Vietnamese [vi]
  22237. //! author : Bang Nguyen : https://github.com/bangnk
  22238. ;(function (global, factory) {
  22239. true ? factory(__webpack_require__(0)) :
  22240. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  22241. factory(global.moment)
  22242. }(this, (function (moment) { 'use strict';
  22243. var vi = moment.defineLocale('vi', {
  22244. 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('_'),
  22245. monthsShort : 'Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12'.split('_'),
  22246. monthsParseExact : true,
  22247. weekdays : 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split('_'),
  22248. weekdaysShort : 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
  22249. weekdaysMin : 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
  22250. weekdaysParseExact : true,
  22251. meridiemParse: /sa|ch/i,
  22252. isPM : function (input) {
  22253. return /^ch$/i.test(input);
  22254. },
  22255. meridiem : function (hours, minutes, isLower) {
  22256. if (hours < 12) {
  22257. return isLower ? 'sa' : 'SA';
  22258. } else {
  22259. return isLower ? 'ch' : 'CH';
  22260. }
  22261. },
  22262. longDateFormat : {
  22263. LT : 'HH:mm',
  22264. LTS : 'HH:mm:ss',
  22265. L : 'DD/MM/YYYY',
  22266. LL : 'D MMMM [năm] YYYY',
  22267. LLL : 'D MMMM [năm] YYYY HH:mm',
  22268. LLLL : 'dddd, D MMMM [năm] YYYY HH:mm',
  22269. l : 'DD/M/YYYY',
  22270. ll : 'D MMM YYYY',
  22271. lll : 'D MMM YYYY HH:mm',
  22272. llll : 'ddd, D MMM YYYY HH:mm'
  22273. },
  22274. calendar : {
  22275. sameDay: '[Hôm nay lúc] LT',
  22276. nextDay: '[Ngày mai lúc] LT',
  22277. nextWeek: 'dddd [tuần tới lúc] LT',
  22278. lastDay: '[Hôm qua lúc] LT',
  22279. lastWeek: 'dddd [tuần rồi lúc] LT',
  22280. sameElse: 'L'
  22281. },
  22282. relativeTime : {
  22283. future : '%s tới',
  22284. past : '%s trước',
  22285. s : 'vài giây',
  22286. m : 'một phút',
  22287. mm : '%d phút',
  22288. h : 'một giờ',
  22289. hh : '%d giờ',
  22290. d : 'một ngày',
  22291. dd : '%d ngày',
  22292. M : 'một tháng',
  22293. MM : '%d tháng',
  22294. y : 'một năm',
  22295. yy : '%d năm'
  22296. },
  22297. ordinalParse: /\d{1,2}/,
  22298. ordinal : function (number) {
  22299. return number;
  22300. },
  22301. week : {
  22302. dow : 1, // Monday is the first day of the week.
  22303. doy : 4 // The week that contains Jan 4th is the first week of the year.
  22304. }
  22305. });
  22306. return vi;
  22307. })));
  22308. /***/ }),
  22309. /* 107 */
  22310. /***/ (function(module, exports, __webpack_require__) {
  22311. //! moment.js locale configuration
  22312. //! locale : Pseudo [x-pseudo]
  22313. //! author : Andrew Hood : https://github.com/andrewhood125
  22314. ;(function (global, factory) {
  22315. true ? factory(__webpack_require__(0)) :
  22316. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  22317. factory(global.moment)
  22318. }(this, (function (moment) { 'use strict';
  22319. var xPseudo = moment.defineLocale('x-pseudo', {
  22320. months : 'J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér'.split('_'),
  22321. monthsShort : 'J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc'.split('_'),
  22322. monthsParseExact : true,
  22323. weekdays : 'S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý'.split('_'),
  22324. weekdaysShort : 'S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát'.split('_'),
  22325. weekdaysMin : 'S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá'.split('_'),
  22326. weekdaysParseExact : true,
  22327. longDateFormat : {
  22328. LT : 'HH:mm',
  22329. L : 'DD/MM/YYYY',
  22330. LL : 'D MMMM YYYY',
  22331. LLL : 'D MMMM YYYY HH:mm',
  22332. LLLL : 'dddd, D MMMM YYYY HH:mm'
  22333. },
  22334. calendar : {
  22335. sameDay : '[T~ódá~ý át] LT',
  22336. nextDay : '[T~ómó~rró~w át] LT',
  22337. nextWeek : 'dddd [át] LT',
  22338. lastDay : '[Ý~ést~érdá~ý át] LT',
  22339. lastWeek : '[L~ást] dddd [át] LT',
  22340. sameElse : 'L'
  22341. },
  22342. relativeTime : {
  22343. future : 'í~ñ %s',
  22344. past : '%s á~gó',
  22345. s : 'á ~féw ~sécó~ñds',
  22346. m : 'á ~míñ~úté',
  22347. mm : '%d m~íñú~tés',
  22348. h : 'á~ñ hó~úr',
  22349. hh : '%d h~óúrs',
  22350. d : 'á ~dáý',
  22351. dd : '%d d~áýs',
  22352. M : 'á ~móñ~th',
  22353. MM : '%d m~óñt~hs',
  22354. y : 'á ~ýéár',
  22355. yy : '%d ý~éárs'
  22356. },
  22357. ordinalParse: /\d{1,2}(th|st|nd|rd)/,
  22358. ordinal : function (number) {
  22359. var b = number % 10,
  22360. output = (~~(number % 100 / 10) === 1) ? 'th' :
  22361. (b === 1) ? 'st' :
  22362. (b === 2) ? 'nd' :
  22363. (b === 3) ? 'rd' : 'th';
  22364. return number + output;
  22365. },
  22366. week : {
  22367. dow : 1, // Monday is the first day of the week.
  22368. doy : 4 // The week that contains Jan 4th is the first week of the year.
  22369. }
  22370. });
  22371. return xPseudo;
  22372. })));
  22373. /***/ }),
  22374. /* 108 */
  22375. /***/ (function(module, exports, __webpack_require__) {
  22376. //! moment.js locale configuration
  22377. //! locale : Yoruba Nigeria [yo]
  22378. //! author : Atolagbe Abisoye : https://github.com/andela-batolagbe
  22379. ;(function (global, factory) {
  22380. true ? factory(__webpack_require__(0)) :
  22381. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  22382. factory(global.moment)
  22383. }(this, (function (moment) { 'use strict';
  22384. var yo = moment.defineLocale('yo', {
  22385. months : 'Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀'.split('_'),
  22386. monthsShort : 'Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀'.split('_'),
  22387. weekdays : 'Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta'.split('_'),
  22388. weekdaysShort : 'Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá'.split('_'),
  22389. weekdaysMin : 'Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb'.split('_'),
  22390. longDateFormat : {
  22391. LT : 'h:mm A',
  22392. LTS : 'h:mm:ss A',
  22393. L : 'DD/MM/YYYY',
  22394. LL : 'D MMMM YYYY',
  22395. LLL : 'D MMMM YYYY h:mm A',
  22396. LLLL : 'dddd, D MMMM YYYY h:mm A'
  22397. },
  22398. calendar : {
  22399. sameDay : '[Ònì ni] LT',
  22400. nextDay : '[Ọ̀la ni] LT',
  22401. nextWeek : 'dddd [Ọsẹ̀ tón\'bọ] [ni] LT',
  22402. lastDay : '[Àna ni] LT',
  22403. lastWeek : 'dddd [Ọsẹ̀ tólọ́] [ni] LT',
  22404. sameElse : 'L'
  22405. },
  22406. relativeTime : {
  22407. future : 'ní %s',
  22408. past : '%s kọjá',
  22409. s : 'ìsẹjú aayá die',
  22410. m : 'ìsẹjú kan',
  22411. mm : 'ìsẹjú %d',
  22412. h : 'wákati kan',
  22413. hh : 'wákati %d',
  22414. d : 'ọjọ́ kan',
  22415. dd : 'ọjọ́ %d',
  22416. M : 'osù kan',
  22417. MM : 'osù %d',
  22418. y : 'ọdún kan',
  22419. yy : 'ọdún %d'
  22420. },
  22421. ordinalParse : /ọjọ́\s\d{1,2}/,
  22422. ordinal : 'ọjọ́ %d',
  22423. week : {
  22424. dow : 1, // Monday is the first day of the week.
  22425. doy : 4 // The week that contains Jan 4th is the first week of the year.
  22426. }
  22427. });
  22428. return yo;
  22429. })));
  22430. /***/ }),
  22431. /* 109 */
  22432. /***/ (function(module, exports, __webpack_require__) {
  22433. //! moment.js locale configuration
  22434. //! locale : Chinese (China) [zh-cn]
  22435. //! author : suupic : https://github.com/suupic
  22436. //! author : Zeno Zeng : https://github.com/zenozeng
  22437. ;(function (global, factory) {
  22438. true ? factory(__webpack_require__(0)) :
  22439. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  22440. factory(global.moment)
  22441. }(this, (function (moment) { 'use strict';
  22442. var zhCn = moment.defineLocale('zh-cn', {
  22443. months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
  22444. monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
  22445. weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
  22446. weekdaysShort : '周日_周一_周二_周三_周四_周五_周六'.split('_'),
  22447. weekdaysMin : '日_一_二_三_四_五_六'.split('_'),
  22448. longDateFormat : {
  22449. LT : 'Ah点mm分',
  22450. LTS : 'Ah点m分s秒',
  22451. L : 'YYYY-MM-DD',
  22452. LL : 'YYYY年MMMD日',
  22453. LLL : 'YYYY年MMMD日Ah点mm分',
  22454. LLLL : 'YYYY年MMMD日ddddAh点mm分',
  22455. l : 'YYYY-MM-DD',
  22456. ll : 'YYYY年MMMD日',
  22457. lll : 'YYYY年MMMD日Ah点mm分',
  22458. llll : 'YYYY年MMMD日ddddAh点mm分'
  22459. },
  22460. meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
  22461. meridiemHour: function (hour, meridiem) {
  22462. if (hour === 12) {
  22463. hour = 0;
  22464. }
  22465. if (meridiem === '凌晨' || meridiem === '早上' ||
  22466. meridiem === '上午') {
  22467. return hour;
  22468. } else if (meridiem === '下午' || meridiem === '晚上') {
  22469. return hour + 12;
  22470. } else {
  22471. // '中午'
  22472. return hour >= 11 ? hour : hour + 12;
  22473. }
  22474. },
  22475. meridiem : function (hour, minute, isLower) {
  22476. var hm = hour * 100 + minute;
  22477. if (hm < 600) {
  22478. return '凌晨';
  22479. } else if (hm < 900) {
  22480. return '早上';
  22481. } else if (hm < 1130) {
  22482. return '上午';
  22483. } else if (hm < 1230) {
  22484. return '中午';
  22485. } else if (hm < 1800) {
  22486. return '下午';
  22487. } else {
  22488. return '晚上';
  22489. }
  22490. },
  22491. calendar : {
  22492. sameDay : function () {
  22493. return this.minutes() === 0 ? '[今天]Ah[点整]' : '[今天]LT';
  22494. },
  22495. nextDay : function () {
  22496. return this.minutes() === 0 ? '[明天]Ah[点整]' : '[明天]LT';
  22497. },
  22498. lastDay : function () {
  22499. return this.minutes() === 0 ? '[昨天]Ah[点整]' : '[昨天]LT';
  22500. },
  22501. nextWeek : function () {
  22502. var startOfWeek, prefix;
  22503. startOfWeek = moment().startOf('week');
  22504. prefix = this.diff(startOfWeek, 'days') >= 7 ? '[下]' : '[本]';
  22505. return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm';
  22506. },
  22507. lastWeek : function () {
  22508. var startOfWeek, prefix;
  22509. startOfWeek = moment().startOf('week');
  22510. prefix = this.unix() < startOfWeek.unix() ? '[上]' : '[本]';
  22511. return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm';
  22512. },
  22513. sameElse : 'LL'
  22514. },
  22515. ordinalParse: /\d{1,2}(日|月|周)/,
  22516. ordinal : function (number, period) {
  22517. switch (period) {
  22518. case 'd':
  22519. case 'D':
  22520. case 'DDD':
  22521. return number + '日';
  22522. case 'M':
  22523. return number + '月';
  22524. case 'w':
  22525. case 'W':
  22526. return number + '周';
  22527. default:
  22528. return number;
  22529. }
  22530. },
  22531. relativeTime : {
  22532. future : '%s内',
  22533. past : '%s前',
  22534. s : '几秒',
  22535. m : '1 分钟',
  22536. mm : '%d 分钟',
  22537. h : '1 小时',
  22538. hh : '%d 小时',
  22539. d : '1 天',
  22540. dd : '%d 天',
  22541. M : '1 个月',
  22542. MM : '%d 个月',
  22543. y : '1 年',
  22544. yy : '%d 年'
  22545. },
  22546. week : {
  22547. // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
  22548. dow : 1, // Monday is the first day of the week.
  22549. doy : 4 // The week that contains Jan 4th is the first week of the year.
  22550. }
  22551. });
  22552. return zhCn;
  22553. })));
  22554. /***/ }),
  22555. /* 110 */
  22556. /***/ (function(module, exports, __webpack_require__) {
  22557. //! moment.js locale configuration
  22558. //! locale : Chinese (Hong Kong) [zh-hk]
  22559. //! author : Ben : https://github.com/ben-lin
  22560. //! author : Chris Lam : https://github.com/hehachris
  22561. //! author : Konstantin : https://github.com/skfd
  22562. ;(function (global, factory) {
  22563. true ? factory(__webpack_require__(0)) :
  22564. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  22565. factory(global.moment)
  22566. }(this, (function (moment) { 'use strict';
  22567. var zhHk = moment.defineLocale('zh-hk', {
  22568. months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
  22569. monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
  22570. weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
  22571. weekdaysShort : '週日_週一_週二_週三_週四_週五_週六'.split('_'),
  22572. weekdaysMin : '日_一_二_三_四_五_六'.split('_'),
  22573. longDateFormat : {
  22574. LT : 'Ah點mm分',
  22575. LTS : 'Ah點m分s秒',
  22576. L : 'YYYY年MMMD日',
  22577. LL : 'YYYY年MMMD日',
  22578. LLL : 'YYYY年MMMD日Ah點mm分',
  22579. LLLL : 'YYYY年MMMD日ddddAh點mm分',
  22580. l : 'YYYY年MMMD日',
  22581. ll : 'YYYY年MMMD日',
  22582. lll : 'YYYY年MMMD日Ah點mm分',
  22583. llll : 'YYYY年MMMD日ddddAh點mm分'
  22584. },
  22585. meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
  22586. meridiemHour : function (hour, meridiem) {
  22587. if (hour === 12) {
  22588. hour = 0;
  22589. }
  22590. if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
  22591. return hour;
  22592. } else if (meridiem === '中午') {
  22593. return hour >= 11 ? hour : hour + 12;
  22594. } else if (meridiem === '下午' || meridiem === '晚上') {
  22595. return hour + 12;
  22596. }
  22597. },
  22598. meridiem : function (hour, minute, isLower) {
  22599. var hm = hour * 100 + minute;
  22600. if (hm < 600) {
  22601. return '凌晨';
  22602. } else if (hm < 900) {
  22603. return '早上';
  22604. } else if (hm < 1130) {
  22605. return '上午';
  22606. } else if (hm < 1230) {
  22607. return '中午';
  22608. } else if (hm < 1800) {
  22609. return '下午';
  22610. } else {
  22611. return '晚上';
  22612. }
  22613. },
  22614. calendar : {
  22615. sameDay : '[今天]LT',
  22616. nextDay : '[明天]LT',
  22617. nextWeek : '[下]ddddLT',
  22618. lastDay : '[昨天]LT',
  22619. lastWeek : '[上]ddddLT',
  22620. sameElse : 'L'
  22621. },
  22622. ordinalParse: /\d{1,2}(日|月|週)/,
  22623. ordinal : function (number, period) {
  22624. switch (period) {
  22625. case 'd' :
  22626. case 'D' :
  22627. case 'DDD' :
  22628. return number + '日';
  22629. case 'M' :
  22630. return number + '月';
  22631. case 'w' :
  22632. case 'W' :
  22633. return number + '週';
  22634. default :
  22635. return number;
  22636. }
  22637. },
  22638. relativeTime : {
  22639. future : '%s內',
  22640. past : '%s前',
  22641. s : '幾秒',
  22642. m : '1 分鐘',
  22643. mm : '%d 分鐘',
  22644. h : '1 小時',
  22645. hh : '%d 小時',
  22646. d : '1 天',
  22647. dd : '%d 天',
  22648. M : '1 個月',
  22649. MM : '%d 個月',
  22650. y : '1 年',
  22651. yy : '%d 年'
  22652. }
  22653. });
  22654. return zhHk;
  22655. })));
  22656. /***/ }),
  22657. /* 111 */
  22658. /***/ (function(module, exports, __webpack_require__) {
  22659. //! moment.js locale configuration
  22660. //! locale : Chinese (Taiwan) [zh-tw]
  22661. //! author : Ben : https://github.com/ben-lin
  22662. //! author : Chris Lam : https://github.com/hehachris
  22663. ;(function (global, factory) {
  22664. true ? factory(__webpack_require__(0)) :
  22665. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  22666. factory(global.moment)
  22667. }(this, (function (moment) { 'use strict';
  22668. var zhTw = moment.defineLocale('zh-tw', {
  22669. months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
  22670. monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
  22671. weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
  22672. weekdaysShort : '週日_週一_週二_週三_週四_週五_週六'.split('_'),
  22673. weekdaysMin : '日_一_二_三_四_五_六'.split('_'),
  22674. longDateFormat : {
  22675. LT : 'Ah點mm分',
  22676. LTS : 'Ah點m分s秒',
  22677. L : 'YYYY年MMMD日',
  22678. LL : 'YYYY年MMMD日',
  22679. LLL : 'YYYY年MMMD日Ah點mm分',
  22680. LLLL : 'YYYY年MMMD日ddddAh點mm分',
  22681. l : 'YYYY年MMMD日',
  22682. ll : 'YYYY年MMMD日',
  22683. lll : 'YYYY年MMMD日Ah點mm分',
  22684. llll : 'YYYY年MMMD日ddddAh點mm分'
  22685. },
  22686. meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
  22687. meridiemHour : function (hour, meridiem) {
  22688. if (hour === 12) {
  22689. hour = 0;
  22690. }
  22691. if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
  22692. return hour;
  22693. } else if (meridiem === '中午') {
  22694. return hour >= 11 ? hour : hour + 12;
  22695. } else if (meridiem === '下午' || meridiem === '晚上') {
  22696. return hour + 12;
  22697. }
  22698. },
  22699. meridiem : function (hour, minute, isLower) {
  22700. var hm = hour * 100 + minute;
  22701. if (hm < 600) {
  22702. return '凌晨';
  22703. } else if (hm < 900) {
  22704. return '早上';
  22705. } else if (hm < 1130) {
  22706. return '上午';
  22707. } else if (hm < 1230) {
  22708. return '中午';
  22709. } else if (hm < 1800) {
  22710. return '下午';
  22711. } else {
  22712. return '晚上';
  22713. }
  22714. },
  22715. calendar : {
  22716. sameDay : '[今天]LT',
  22717. nextDay : '[明天]LT',
  22718. nextWeek : '[下]ddddLT',
  22719. lastDay : '[昨天]LT',
  22720. lastWeek : '[上]ddddLT',
  22721. sameElse : 'L'
  22722. },
  22723. ordinalParse: /\d{1,2}(日|月|週)/,
  22724. ordinal : function (number, period) {
  22725. switch (period) {
  22726. case 'd' :
  22727. case 'D' :
  22728. case 'DDD' :
  22729. return number + '日';
  22730. case 'M' :
  22731. return number + '月';
  22732. case 'w' :
  22733. case 'W' :
  22734. return number + '週';
  22735. default :
  22736. return number;
  22737. }
  22738. },
  22739. relativeTime : {
  22740. future : '%s內',
  22741. past : '%s前',
  22742. s : '幾秒',
  22743. m : '1 分鐘',
  22744. mm : '%d 分鐘',
  22745. h : '1 小時',
  22746. hh : '%d 小時',
  22747. d : '1 天',
  22748. dd : '%d 天',
  22749. M : '1 個月',
  22750. MM : '%d 個月',
  22751. y : '1 年',
  22752. yy : '%d 年'
  22753. }
  22754. });
  22755. return zhTw;
  22756. })));
  22757. /***/ }),
  22758. /* 112 */
  22759. /***/ (function(module, exports) {
  22760. /*
  22761. MIT License http://www.opensource.org/licenses/mit-license.php
  22762. Author Tobias Koppers @sokra
  22763. */
  22764. // css base code, injected by the css-loader
  22765. module.exports = function() {
  22766. var list = [];
  22767. // return the list of modules as css string
  22768. list.toString = function toString() {
  22769. var result = [];
  22770. for(var i = 0; i < this.length; i++) {
  22771. var item = this[i];
  22772. if(item[2]) {
  22773. result.push("@media " + item[2] + "{" + item[1] + "}");
  22774. } else {
  22775. result.push(item[1]);
  22776. }
  22777. }
  22778. return result.join("");
  22779. };
  22780. // import a list of modules into the list
  22781. list.i = function(modules, mediaQuery) {
  22782. if(typeof modules === "string")
  22783. modules = [[null, modules, ""]];
  22784. var alreadyImportedModules = {};
  22785. for(var i = 0; i < this.length; i++) {
  22786. var id = this[i][0];
  22787. if(typeof id === "number")
  22788. alreadyImportedModules[id] = true;
  22789. }
  22790. for(i = 0; i < modules.length; i++) {
  22791. var item = modules[i];
  22792. // skip already imported module
  22793. // this implementation is not 100% perfect for weird media query combinations
  22794. // when a module is imported multiple times with different media queries.
  22795. // I hope this will never occur (Hey this way we have smaller bundles)
  22796. if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
  22797. if(mediaQuery && !item[2]) {
  22798. item[2] = mediaQuery;
  22799. } else if(mediaQuery) {
  22800. item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
  22801. }
  22802. list.push(item);
  22803. }
  22804. }
  22805. };
  22806. return list;
  22807. };
  22808. /***/ }),
  22809. /* 113 */
  22810. /***/ (function(module, exports) {
  22811. // shim for using process in browser
  22812. var process = module.exports = {};
  22813. // cached from whatever global is present so that test runners that stub it
  22814. // don't break things. But we need to wrap it in a try catch in case it is
  22815. // wrapped in strict mode code which doesn't define any globals. It's inside a
  22816. // function because try/catches deoptimize in certain engines.
  22817. var cachedSetTimeout;
  22818. var cachedClearTimeout;
  22819. function defaultSetTimout() {
  22820. throw new Error('setTimeout has not been defined');
  22821. }
  22822. function defaultClearTimeout () {
  22823. throw new Error('clearTimeout has not been defined');
  22824. }
  22825. (function () {
  22826. try {
  22827. if (typeof setTimeout === 'function') {
  22828. cachedSetTimeout = setTimeout;
  22829. } else {
  22830. cachedSetTimeout = defaultSetTimout;
  22831. }
  22832. } catch (e) {
  22833. cachedSetTimeout = defaultSetTimout;
  22834. }
  22835. try {
  22836. if (typeof clearTimeout === 'function') {
  22837. cachedClearTimeout = clearTimeout;
  22838. } else {
  22839. cachedClearTimeout = defaultClearTimeout;
  22840. }
  22841. } catch (e) {
  22842. cachedClearTimeout = defaultClearTimeout;
  22843. }
  22844. } ())
  22845. function runTimeout(fun) {
  22846. if (cachedSetTimeout === setTimeout) {
  22847. //normal enviroments in sane situations
  22848. return setTimeout(fun, 0);
  22849. }
  22850. // if setTimeout wasn't available but was latter defined
  22851. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  22852. cachedSetTimeout = setTimeout;
  22853. return setTimeout(fun, 0);
  22854. }
  22855. try {
  22856. // when when somebody has screwed with setTimeout but no I.E. maddness
  22857. return cachedSetTimeout(fun, 0);
  22858. } catch(e){
  22859. try {
  22860. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  22861. return cachedSetTimeout.call(null, fun, 0);
  22862. } catch(e){
  22863. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  22864. return cachedSetTimeout.call(this, fun, 0);
  22865. }
  22866. }
  22867. }
  22868. function runClearTimeout(marker) {
  22869. if (cachedClearTimeout === clearTimeout) {
  22870. //normal enviroments in sane situations
  22871. return clearTimeout(marker);
  22872. }
  22873. // if clearTimeout wasn't available but was latter defined
  22874. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  22875. cachedClearTimeout = clearTimeout;
  22876. return clearTimeout(marker);
  22877. }
  22878. try {
  22879. // when when somebody has screwed with setTimeout but no I.E. maddness
  22880. return cachedClearTimeout(marker);
  22881. } catch (e){
  22882. try {
  22883. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  22884. return cachedClearTimeout.call(null, marker);
  22885. } catch (e){
  22886. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  22887. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  22888. return cachedClearTimeout.call(this, marker);
  22889. }
  22890. }
  22891. }
  22892. var queue = [];
  22893. var draining = false;
  22894. var currentQueue;
  22895. var queueIndex = -1;
  22896. function cleanUpNextTick() {
  22897. if (!draining || !currentQueue) {
  22898. return;
  22899. }
  22900. draining = false;
  22901. if (currentQueue.length) {
  22902. queue = currentQueue.concat(queue);
  22903. } else {
  22904. queueIndex = -1;
  22905. }
  22906. if (queue.length) {
  22907. drainQueue();
  22908. }
  22909. }
  22910. function drainQueue() {
  22911. if (draining) {
  22912. return;
  22913. }
  22914. var timeout = runTimeout(cleanUpNextTick);
  22915. draining = true;
  22916. var len = queue.length;
  22917. while(len) {
  22918. currentQueue = queue;
  22919. queue = [];
  22920. while (++queueIndex < len) {
  22921. if (currentQueue) {
  22922. currentQueue[queueIndex].run();
  22923. }
  22924. }
  22925. queueIndex = -1;
  22926. len = queue.length;
  22927. }
  22928. currentQueue = null;
  22929. draining = false;
  22930. runClearTimeout(timeout);
  22931. }
  22932. process.nextTick = function (fun) {
  22933. var args = new Array(arguments.length - 1);
  22934. if (arguments.length > 1) {
  22935. for (var i = 1; i < arguments.length; i++) {
  22936. args[i - 1] = arguments[i];
  22937. }
  22938. }
  22939. queue.push(new Item(fun, args));
  22940. if (queue.length === 1 && !draining) {
  22941. runTimeout(drainQueue);
  22942. }
  22943. };
  22944. // v8 likes predictible objects
  22945. function Item(fun, array) {
  22946. this.fun = fun;
  22947. this.array = array;
  22948. }
  22949. Item.prototype.run = function () {
  22950. this.fun.apply(null, this.array);
  22951. };
  22952. process.title = 'browser';
  22953. process.browser = true;
  22954. process.env = {};
  22955. process.argv = [];
  22956. process.version = ''; // empty string to avoid regexp issues
  22957. process.versions = {};
  22958. function noop() {}
  22959. process.on = noop;
  22960. process.addListener = noop;
  22961. process.once = noop;
  22962. process.off = noop;
  22963. process.removeListener = noop;
  22964. process.removeAllListeners = noop;
  22965. process.emit = noop;
  22966. process.binding = function (name) {
  22967. throw new Error('process.binding is not supported');
  22968. };
  22969. process.cwd = function () { return '/' };
  22970. process.chdir = function (dir) {
  22971. throw new Error('process.chdir is not supported');
  22972. };
  22973. process.umask = function() { return 0; };
  22974. /***/ }),
  22975. /* 114 */
  22976. /***/ (function(module, exports, __webpack_require__) {
  22977. /*
  22978. MIT License http://www.opensource.org/licenses/mit-license.php
  22979. Author Tobias Koppers @sokra
  22980. Modified by Evan You @yyx990803
  22981. */
  22982. var hasDocument = typeof document !== 'undefined'
  22983. if (typeof DEBUG !== 'undefined' && DEBUG) {
  22984. if (!hasDocument) {
  22985. throw new Error(
  22986. 'vue-style-loader cannot be used in a non-browser environment. ' +
  22987. "Use { target: 'node' } in your Webpack config to indicate a server-rendering environment."
  22988. ) }
  22989. }
  22990. var listToStyles = __webpack_require__(189)
  22991. /*
  22992. type StyleObject = {
  22993. id: number;
  22994. parts: Array<StyleObjectPart>
  22995. }
  22996. type StyleObjectPart = {
  22997. css: string;
  22998. media: string;
  22999. sourceMap: ?string
  23000. }
  23001. */
  23002. var stylesInDom = {/*
  23003. [id: number]: {
  23004. id: number,
  23005. refs: number,
  23006. parts: Array<(obj?: StyleObjectPart) => void>
  23007. }
  23008. */}
  23009. var head = hasDocument && (document.head || document.getElementsByTagName('head')[0])
  23010. var singletonElement = null
  23011. var singletonCounter = 0
  23012. var isProduction = false
  23013. var noop = function () {}
  23014. // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  23015. // tags it will allow on a page
  23016. var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\b/.test(navigator.userAgent.toLowerCase())
  23017. module.exports = function (parentId, list, _isProduction) {
  23018. isProduction = _isProduction
  23019. var styles = listToStyles(parentId, list)
  23020. addStylesToDom(styles)
  23021. return function update (newList) {
  23022. var mayRemove = []
  23023. for (var i = 0; i < styles.length; i++) {
  23024. var item = styles[i]
  23025. var domStyle = stylesInDom[item.id]
  23026. domStyle.refs--
  23027. mayRemove.push(domStyle)
  23028. }
  23029. if (newList) {
  23030. styles = listToStyles(parentId, newList)
  23031. addStylesToDom(styles)
  23032. } else {
  23033. styles = []
  23034. }
  23035. for (var i = 0; i < mayRemove.length; i++) {
  23036. var domStyle = mayRemove[i]
  23037. if (domStyle.refs === 0) {
  23038. for (var j = 0; j < domStyle.parts.length; j++) {
  23039. domStyle.parts[j]()
  23040. }
  23041. delete stylesInDom[domStyle.id]
  23042. }
  23043. }
  23044. }
  23045. }
  23046. function addStylesToDom (styles /* Array<StyleObject> */) {
  23047. for (var i = 0; i < styles.length; i++) {
  23048. var item = styles[i]
  23049. var domStyle = stylesInDom[item.id]
  23050. if (domStyle) {
  23051. domStyle.refs++
  23052. for (var j = 0; j < domStyle.parts.length; j++) {
  23053. domStyle.parts[j](item.parts[j])
  23054. }
  23055. for (; j < item.parts.length; j++) {
  23056. domStyle.parts.push(addStyle(item.parts[j]))
  23057. }
  23058. if (domStyle.parts.length > item.parts.length) {
  23059. domStyle.parts.length = item.parts.length
  23060. }
  23061. } else {
  23062. var parts = []
  23063. for (var j = 0; j < item.parts.length; j++) {
  23064. parts.push(addStyle(item.parts[j]))
  23065. }
  23066. stylesInDom[item.id] = { id: item.id, refs: 1, parts: parts }
  23067. }
  23068. }
  23069. }
  23070. function listToStyles (parentId, list) {
  23071. var styles = []
  23072. var newStyles = {}
  23073. for (var i = 0; i < list.length; i++) {
  23074. var item = list[i]
  23075. var id = item[0]
  23076. var css = item[1]
  23077. var media = item[2]
  23078. var sourceMap = item[3]
  23079. var part = { css: css, media: media, sourceMap: sourceMap }
  23080. if (!newStyles[id]) {
  23081. part.id = parentId + ':0'
  23082. styles.push(newStyles[id] = { id: id, parts: [part] })
  23083. } else {
  23084. part.id = parentId + ':' + newStyles[id].parts.length
  23085. newStyles[id].parts.push(part)
  23086. }
  23087. }
  23088. return styles
  23089. }
  23090. function createStyleElement () {
  23091. var styleElement = document.createElement('style')
  23092. styleElement.type = 'text/css'
  23093. head.appendChild(styleElement)
  23094. return styleElement
  23095. }
  23096. function addStyle (obj /* StyleObjectPart */) {
  23097. var update, remove
  23098. var styleElement = document.querySelector('style[data-vue-ssr-id~="' + obj.id + '"]')
  23099. var hasSSR = styleElement != null
  23100. // if in production mode and style is already provided by SSR,
  23101. // simply do nothing.
  23102. if (hasSSR && isProduction) {
  23103. return noop
  23104. }
  23105. if (isOldIE) {
  23106. // use singleton mode for IE9.
  23107. var styleIndex = singletonCounter++
  23108. styleElement = singletonElement || (singletonElement = createStyleElement())
  23109. update = applyToSingletonTag.bind(null, styleElement, styleIndex, false)
  23110. remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true)
  23111. } else {
  23112. // use multi-style-tag mode in all other cases
  23113. styleElement = styleElement || createStyleElement()
  23114. update = applyToTag.bind(null, styleElement)
  23115. remove = function () {
  23116. styleElement.parentNode.removeChild(styleElement)
  23117. }
  23118. }
  23119. if (!hasSSR) {
  23120. update(obj)
  23121. }
  23122. return function updateStyle (newObj /* StyleObjectPart */) {
  23123. if (newObj) {
  23124. if (newObj.css === obj.css &&
  23125. newObj.media === obj.media &&
  23126. newObj.sourceMap === obj.sourceMap) {
  23127. return
  23128. }
  23129. update(obj = newObj)
  23130. } else {
  23131. remove()
  23132. }
  23133. }
  23134. }
  23135. var replaceText = (function () {
  23136. var textStore = []
  23137. return function (index, replacement) {
  23138. textStore[index] = replacement
  23139. return textStore.filter(Boolean).join('\n')
  23140. }
  23141. })()
  23142. function applyToSingletonTag (styleElement, index, remove, obj) {
  23143. var css = remove ? '' : obj.css
  23144. if (styleElement.styleSheet) {
  23145. styleElement.styleSheet.cssText = replaceText(index, css)
  23146. } else {
  23147. var cssNode = document.createTextNode(css)
  23148. var childNodes = styleElement.childNodes
  23149. if (childNodes[index]) styleElement.removeChild(childNodes[index])
  23150. if (childNodes.length) {
  23151. styleElement.insertBefore(cssNode, childNodes[index])
  23152. } else {
  23153. styleElement.appendChild(cssNode)
  23154. }
  23155. }
  23156. }
  23157. function applyToTag (styleElement, obj) {
  23158. var css = obj.css
  23159. var media = obj.media
  23160. var sourceMap = obj.sourceMap
  23161. if (media) {
  23162. styleElement.setAttribute('media', media)
  23163. }
  23164. if (sourceMap) {
  23165. // https://developer.chrome.com/devtools/docs/javascript-debugging
  23166. // this makes source maps inside style tags work properly in Chrome
  23167. css += '\n/*# sourceURL=' + sourceMap.sources[0] + ' */'
  23168. // http://stackoverflow.com/a/26603875
  23169. css += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */'
  23170. }
  23171. if (styleElement.styleSheet) {
  23172. styleElement.styleSheet.cssText = css
  23173. } else {
  23174. while (styleElement.firstChild) {
  23175. styleElement.removeChild(styleElement.firstChild)
  23176. }
  23177. styleElement.appendChild(document.createTextNode(css))
  23178. }
  23179. }
  23180. /***/ }),
  23181. /* 115 */
  23182. /***/ (function(module, exports) {
  23183. // removed by extract-text-webpack-plugin
  23184. /***/ }),
  23185. /* 116 */
  23186. /***/ (function(module, exports) {
  23187. // removed by extract-text-webpack-plugin
  23188. /***/ }),
  23189. /* 117 */
  23190. /***/ (function(module, exports, __webpack_require__) {
  23191. /* styles */
  23192. __webpack_require__(187)
  23193. var Component = __webpack_require__(1)(
  23194. /* script */
  23195. __webpack_require__(175),
  23196. /* template */
  23197. __webpack_require__(181),
  23198. /* scopeId */
  23199. null,
  23200. /* cssModules */
  23201. null
  23202. )
  23203. Component.options.__file = "/Users/KsawK/Desktop/Programing/servers-stats/webSource/config.vue"
  23204. if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key !== "__esModule"})) {console.error("named exports are not supported in *.vue files.")}
  23205. if (Component.options.functional) {console.error("[vue-loader] config.vue: functional components are not supported with templates, they should use render functions.")}
  23206. /* hot reload */
  23207. if (false) {(function () {
  23208. var hotAPI = require("vue-hot-reload-api")
  23209. hotAPI.install(require("vue"), false)
  23210. if (!hotAPI.compatible) return
  23211. module.hot.accept()
  23212. if (!module.hot.data) {
  23213. hotAPI.createRecord("data-v-32332a9d", Component.options)
  23214. } else {
  23215. hotAPI.reload("data-v-32332a9d", Component.options)
  23216. }
  23217. })()}
  23218. module.exports = Component.exports
  23219. /***/ }),
  23220. /* 118 */
  23221. /***/ (function(module, exports, __webpack_require__) {
  23222. var Component = __webpack_require__(1)(
  23223. /* script */
  23224. __webpack_require__(176),
  23225. /* template */
  23226. __webpack_require__(185),
  23227. /* scopeId */
  23228. null,
  23229. /* cssModules */
  23230. null
  23231. )
  23232. Component.options.__file = "/Users/KsawK/Desktop/Programing/servers-stats/webSource/server.vue"
  23233. if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key !== "__esModule"})) {console.error("named exports are not supported in *.vue files.")}
  23234. if (Component.options.functional) {console.error("[vue-loader] server.vue: functional components are not supported with templates, they should use render functions.")}
  23235. /* hot reload */
  23236. if (false) {(function () {
  23237. var hotAPI = require("vue-hot-reload-api")
  23238. hotAPI.install(require("vue"), false)
  23239. if (!hotAPI.compatible) return
  23240. module.hot.accept()
  23241. if (!module.hot.data) {
  23242. hotAPI.createRecord("data-v-d86423c4", Component.options)
  23243. } else {
  23244. hotAPI.reload("data-v-d86423c4", Component.options)
  23245. }
  23246. })()}
  23247. module.exports = Component.exports
  23248. /***/ }),
  23249. /* 119 */
  23250. /***/ (function(module, exports, __webpack_require__) {
  23251. var Component = __webpack_require__(1)(
  23252. /* script */
  23253. __webpack_require__(177),
  23254. /* template */
  23255. __webpack_require__(182),
  23256. /* scopeId */
  23257. null,
  23258. /* cssModules */
  23259. null
  23260. )
  23261. Component.options.__file = "/Users/KsawK/Desktop/Programing/servers-stats/webSource/serverDetails.vue"
  23262. if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key !== "__esModule"})) {console.error("named exports are not supported in *.vue files.")}
  23263. if (Component.options.functional) {console.error("[vue-loader] serverDetails.vue: functional components are not supported with templates, they should use render functions.")}
  23264. /* hot reload */
  23265. if (false) {(function () {
  23266. var hotAPI = require("vue-hot-reload-api")
  23267. hotAPI.install(require("vue"), false)
  23268. if (!hotAPI.compatible) return
  23269. module.hot.accept()
  23270. if (!module.hot.data) {
  23271. hotAPI.createRecord("data-v-4fd03d74", Component.options)
  23272. } else {
  23273. hotAPI.reload("data-v-4fd03d74", Component.options)
  23274. }
  23275. })()}
  23276. module.exports = Component.exports
  23277. /***/ }),
  23278. /* 120 */
  23279. /***/ (function(module, exports, __webpack_require__) {
  23280. /* styles */
  23281. __webpack_require__(188)
  23282. var Component = __webpack_require__(1)(
  23283. /* script */
  23284. __webpack_require__(178),
  23285. /* template */
  23286. __webpack_require__(184),
  23287. /* scopeId */
  23288. null,
  23289. /* cssModules */
  23290. null
  23291. )
  23292. Component.options.__file = "/Users/KsawK/Desktop/Programing/servers-stats/webSource/serverList.vue"
  23293. if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key !== "__esModule"})) {console.error("named exports are not supported in *.vue files.")}
  23294. if (Component.options.functional) {console.error("[vue-loader] serverList.vue: functional components are not supported with templates, they should use render functions.")}
  23295. /* hot reload */
  23296. if (false) {(function () {
  23297. var hotAPI = require("vue-hot-reload-api")
  23298. hotAPI.install(require("vue"), false)
  23299. if (!hotAPI.compatible) return
  23300. module.hot.accept()
  23301. if (!module.hot.data) {
  23302. hotAPI.createRecord("data-v-7b0050dc", Component.options)
  23303. } else {
  23304. hotAPI.reload("data-v-7b0050dc", Component.options)
  23305. }
  23306. })()}
  23307. module.exports = Component.exports
  23308. /***/ }),
  23309. /* 121 */
  23310. /***/ (function(module, exports, __webpack_require__) {
  23311. var Component = __webpack_require__(1)(
  23312. /* script */
  23313. __webpack_require__(179),
  23314. /* template */
  23315. __webpack_require__(186),
  23316. /* scopeId */
  23317. null,
  23318. /* cssModules */
  23319. null
  23320. )
  23321. Component.options.__file = "/Users/KsawK/Desktop/Programing/servers-stats/webSource/serveredit.vue"
  23322. if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key !== "__esModule"})) {console.error("named exports are not supported in *.vue files.")}
  23323. if (Component.options.functional) {console.error("[vue-loader] serveredit.vue: functional components are not supported with templates, they should use render functions.")}
  23324. /* hot reload */
  23325. if (false) {(function () {
  23326. var hotAPI = require("vue-hot-reload-api")
  23327. hotAPI.install(require("vue"), false)
  23328. if (!hotAPI.compatible) return
  23329. module.hot.accept()
  23330. if (!module.hot.data) {
  23331. hotAPI.createRecord("data-v-f323d7b0", Component.options)
  23332. } else {
  23333. hotAPI.reload("data-v-f323d7b0", Component.options)
  23334. }
  23335. })()}
  23336. module.exports = Component.exports
  23337. /***/ }),
  23338. /* 122 */
  23339. /***/ (function(module, exports, __webpack_require__) {
  23340. var Component = __webpack_require__(1)(
  23341. /* script */
  23342. __webpack_require__(180),
  23343. /* template */
  23344. __webpack_require__(183),
  23345. /* scopeId */
  23346. null,
  23347. /* cssModules */
  23348. null
  23349. )
  23350. Component.options.__file = "/Users/KsawK/Desktop/Programing/servers-stats/webSource/servergraph.vue"
  23351. if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key !== "__esModule"})) {console.error("named exports are not supported in *.vue files.")}
  23352. if (Component.options.functional) {console.error("[vue-loader] servergraph.vue: functional components are not supported with templates, they should use render functions.")}
  23353. /* hot reload */
  23354. if (false) {(function () {
  23355. var hotAPI = require("vue-hot-reload-api")
  23356. hotAPI.install(require("vue"), false)
  23357. if (!hotAPI.compatible) return
  23358. module.hot.accept()
  23359. if (!module.hot.data) {
  23360. hotAPI.createRecord("data-v-73392520", Component.options)
  23361. } else {
  23362. hotAPI.reload("data-v-73392520", Component.options)
  23363. }
  23364. })()}
  23365. module.exports = Component.exports
  23366. /***/ }),
  23367. /* 123 */
  23368. /***/ (function(module, exports, __webpack_require__) {
  23369. "use strict";
  23370. /* WEBPACK VAR INJECTION */(function(process) {/**
  23371. * vue-router v2.2.1
  23372. * (c) 2017 Evan You
  23373. * @license MIT
  23374. */
  23375. /* */
  23376. function assert (condition, message) {
  23377. if (!condition) {
  23378. throw new Error(("[vue-router] " + message))
  23379. }
  23380. }
  23381. function warn (condition, message) {
  23382. if (!condition) {
  23383. typeof console !== 'undefined' && console.warn(("[vue-router] " + message));
  23384. }
  23385. }
  23386. var View = {
  23387. name: 'router-view',
  23388. functional: true,
  23389. props: {
  23390. name: {
  23391. type: String,
  23392. default: 'default'
  23393. }
  23394. },
  23395. render: function render (h, ref) {
  23396. var props = ref.props;
  23397. var children = ref.children;
  23398. var parent = ref.parent;
  23399. var data = ref.data;
  23400. data.routerView = true;
  23401. var name = props.name;
  23402. var route = parent.$route;
  23403. var cache = parent._routerViewCache || (parent._routerViewCache = {});
  23404. // determine current view depth, also check to see if the tree
  23405. // has been toggled inactive but kept-alive.
  23406. var depth = 0;
  23407. var inactive = false;
  23408. while (parent) {
  23409. if (parent.$vnode && parent.$vnode.data.routerView) {
  23410. depth++;
  23411. }
  23412. if (parent._inactive) {
  23413. inactive = true;
  23414. }
  23415. parent = parent.$parent;
  23416. }
  23417. data.routerViewDepth = depth;
  23418. // render previous view if the tree is inactive and kept-alive
  23419. if (inactive) {
  23420. return h(cache[name], data, children)
  23421. }
  23422. var matched = route.matched[depth];
  23423. // render empty node if no matched route
  23424. if (!matched) {
  23425. cache[name] = null;
  23426. return h()
  23427. }
  23428. var component = cache[name] = matched.components[name];
  23429. // inject instance registration hooks
  23430. var hooks = data.hook || (data.hook = {});
  23431. hooks.init = function (vnode) {
  23432. matched.instances[name] = vnode.child;
  23433. };
  23434. hooks.prepatch = function (oldVnode, vnode) {
  23435. matched.instances[name] = vnode.child;
  23436. };
  23437. hooks.destroy = function (vnode) {
  23438. if (matched.instances[name] === vnode.child) {
  23439. matched.instances[name] = undefined;
  23440. }
  23441. };
  23442. // resolve props
  23443. data.props = resolveProps(route, matched.props && matched.props[name]);
  23444. return h(component, data, children)
  23445. }
  23446. };
  23447. function resolveProps (route, config) {
  23448. switch (typeof config) {
  23449. case 'undefined':
  23450. return
  23451. case 'object':
  23452. return config
  23453. case 'function':
  23454. return config(route)
  23455. case 'boolean':
  23456. return config ? route.params : undefined
  23457. default:
  23458. warn(false, ("props in \"" + (route.path) + "\" is a " + (typeof config) + ", expecting an object, function or boolean."));
  23459. }
  23460. }
  23461. /* */
  23462. var encodeReserveRE = /[!'()*]/g;
  23463. var encodeReserveReplacer = function (c) { return '%' + c.charCodeAt(0).toString(16); };
  23464. var commaRE = /%2C/g;
  23465. // fixed encodeURIComponent which is more comformant to RFC3986:
  23466. // - escapes [!'()*]
  23467. // - preserve commas
  23468. var encode = function (str) { return encodeURIComponent(str)
  23469. .replace(encodeReserveRE, encodeReserveReplacer)
  23470. .replace(commaRE, ','); };
  23471. var decode = decodeURIComponent;
  23472. function resolveQuery (
  23473. query,
  23474. extraQuery
  23475. ) {
  23476. if ( extraQuery === void 0 ) extraQuery = {};
  23477. if (query) {
  23478. var parsedQuery;
  23479. try {
  23480. parsedQuery = parseQuery(query);
  23481. } catch (e) {
  23482. process.env.NODE_ENV !== 'production' && warn(false, e.message);
  23483. parsedQuery = {};
  23484. }
  23485. for (var key in extraQuery) {
  23486. parsedQuery[key] = extraQuery[key];
  23487. }
  23488. return parsedQuery
  23489. } else {
  23490. return extraQuery
  23491. }
  23492. }
  23493. function parseQuery (query) {
  23494. var res = {};
  23495. query = query.trim().replace(/^(\?|#|&)/, '');
  23496. if (!query) {
  23497. return res
  23498. }
  23499. query.split('&').forEach(function (param) {
  23500. var parts = param.replace(/\+/g, ' ').split('=');
  23501. var key = decode(parts.shift());
  23502. var val = parts.length > 0
  23503. ? decode(parts.join('='))
  23504. : null;
  23505. if (res[key] === undefined) {
  23506. res[key] = val;
  23507. } else if (Array.isArray(res[key])) {
  23508. res[key].push(val);
  23509. } else {
  23510. res[key] = [res[key], val];
  23511. }
  23512. });
  23513. return res
  23514. }
  23515. function stringifyQuery (obj) {
  23516. var res = obj ? Object.keys(obj).map(function (key) {
  23517. var val = obj[key];
  23518. if (val === undefined) {
  23519. return ''
  23520. }
  23521. if (val === null) {
  23522. return encode(key)
  23523. }
  23524. if (Array.isArray(val)) {
  23525. var result = [];
  23526. val.slice().forEach(function (val2) {
  23527. if (val2 === undefined) {
  23528. return
  23529. }
  23530. if (val2 === null) {
  23531. result.push(encode(key));
  23532. } else {
  23533. result.push(encode(key) + '=' + encode(val2));
  23534. }
  23535. });
  23536. return result.join('&')
  23537. }
  23538. return encode(key) + '=' + encode(val)
  23539. }).filter(function (x) { return x.length > 0; }).join('&') : null;
  23540. return res ? ("?" + res) : ''
  23541. }
  23542. /* */
  23543. var trailingSlashRE = /\/?$/;
  23544. function createRoute (
  23545. record,
  23546. location,
  23547. redirectedFrom
  23548. ) {
  23549. var route = {
  23550. name: location.name || (record && record.name),
  23551. meta: (record && record.meta) || {},
  23552. path: location.path || '/',
  23553. hash: location.hash || '',
  23554. query: location.query || {},
  23555. params: location.params || {},
  23556. fullPath: getFullPath(location),
  23557. matched: record ? formatMatch(record) : []
  23558. };
  23559. if (redirectedFrom) {
  23560. route.redirectedFrom = getFullPath(redirectedFrom);
  23561. }
  23562. return Object.freeze(route)
  23563. }
  23564. // the starting route that represents the initial state
  23565. var START = createRoute(null, {
  23566. path: '/'
  23567. });
  23568. function formatMatch (record) {
  23569. var res = [];
  23570. while (record) {
  23571. res.unshift(record);
  23572. record = record.parent;
  23573. }
  23574. return res
  23575. }
  23576. function getFullPath (ref) {
  23577. var path = ref.path;
  23578. var query = ref.query; if ( query === void 0 ) query = {};
  23579. var hash = ref.hash; if ( hash === void 0 ) hash = '';
  23580. return (path || '/') + stringifyQuery(query) + hash
  23581. }
  23582. function isSameRoute (a, b) {
  23583. if (b === START) {
  23584. return a === b
  23585. } else if (!b) {
  23586. return false
  23587. } else if (a.path && b.path) {
  23588. return (
  23589. a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') &&
  23590. a.hash === b.hash &&
  23591. isObjectEqual(a.query, b.query)
  23592. )
  23593. } else if (a.name && b.name) {
  23594. return (
  23595. a.name === b.name &&
  23596. a.hash === b.hash &&
  23597. isObjectEqual(a.query, b.query) &&
  23598. isObjectEqual(a.params, b.params)
  23599. )
  23600. } else {
  23601. return false
  23602. }
  23603. }
  23604. function isObjectEqual (a, b) {
  23605. if ( a === void 0 ) a = {};
  23606. if ( b === void 0 ) b = {};
  23607. var aKeys = Object.keys(a);
  23608. var bKeys = Object.keys(b);
  23609. if (aKeys.length !== bKeys.length) {
  23610. return false
  23611. }
  23612. return aKeys.every(function (key) { return String(a[key]) === String(b[key]); })
  23613. }
  23614. function isIncludedRoute (current, target) {
  23615. return (
  23616. current.path.replace(trailingSlashRE, '/').indexOf(
  23617. target.path.replace(trailingSlashRE, '/')
  23618. ) === 0 &&
  23619. (!target.hash || current.hash === target.hash) &&
  23620. queryIncludes(current.query, target.query)
  23621. )
  23622. }
  23623. function queryIncludes (current, target) {
  23624. for (var key in target) {
  23625. if (!(key in current)) {
  23626. return false
  23627. }
  23628. }
  23629. return true
  23630. }
  23631. /* */
  23632. // work around weird flow bug
  23633. var toTypes = [String, Object];
  23634. var eventTypes = [String, Array];
  23635. var Link = {
  23636. name: 'router-link',
  23637. props: {
  23638. to: {
  23639. type: toTypes,
  23640. required: true
  23641. },
  23642. tag: {
  23643. type: String,
  23644. default: 'a'
  23645. },
  23646. exact: Boolean,
  23647. append: Boolean,
  23648. replace: Boolean,
  23649. activeClass: String,
  23650. event: {
  23651. type: eventTypes,
  23652. default: 'click'
  23653. }
  23654. },
  23655. render: function render (h) {
  23656. var this$1 = this;
  23657. var router = this.$router;
  23658. var current = this.$route;
  23659. var ref = router.resolve(this.to, current, this.append);
  23660. var location = ref.location;
  23661. var route = ref.route;
  23662. var href = ref.href;
  23663. var classes = {};
  23664. var activeClass = this.activeClass || router.options.linkActiveClass || 'router-link-active';
  23665. var compareTarget = location.path ? createRoute(null, location) : route;
  23666. classes[activeClass] = this.exact
  23667. ? isSameRoute(current, compareTarget)
  23668. : isIncludedRoute(current, compareTarget);
  23669. var handler = function (e) {
  23670. if (guardEvent(e)) {
  23671. if (this$1.replace) {
  23672. router.replace(location);
  23673. } else {
  23674. router.push(location);
  23675. }
  23676. }
  23677. };
  23678. var on = { click: guardEvent };
  23679. if (Array.isArray(this.event)) {
  23680. this.event.forEach(function (e) { on[e] = handler; });
  23681. } else {
  23682. on[this.event] = handler;
  23683. }
  23684. var data = {
  23685. class: classes
  23686. };
  23687. if (this.tag === 'a') {
  23688. data.on = on;
  23689. data.attrs = { href: href };
  23690. } else {
  23691. // find the first <a> child and apply listener and href
  23692. var a = findAnchor(this.$slots.default);
  23693. if (a) {
  23694. // in case the <a> is a static node
  23695. a.isStatic = false;
  23696. var extend = _Vue.util.extend;
  23697. var aData = a.data = extend({}, a.data);
  23698. aData.on = on;
  23699. var aAttrs = a.data.attrs = extend({}, a.data.attrs);
  23700. aAttrs.href = href;
  23701. } else {
  23702. // doesn't have <a> child, apply listener to self
  23703. data.on = on;
  23704. }
  23705. }
  23706. return h(this.tag, data, this.$slots.default)
  23707. }
  23708. };
  23709. function guardEvent (e) {
  23710. // don't redirect with control keys
  23711. if (e.metaKey || e.ctrlKey || e.shiftKey) { return }
  23712. // don't redirect when preventDefault called
  23713. if (e.defaultPrevented) { return }
  23714. // don't redirect on right click
  23715. if (e.button !== undefined && e.button !== 0) { return }
  23716. // don't redirect if `target="_blank"`
  23717. if (e.target && e.target.getAttribute) {
  23718. var target = e.target.getAttribute('target');
  23719. if (/\b_blank\b/i.test(target)) { return }
  23720. }
  23721. // this may be a Weex event which doesn't have this method
  23722. if (e.preventDefault) {
  23723. e.preventDefault();
  23724. }
  23725. return true
  23726. }
  23727. function findAnchor (children) {
  23728. if (children) {
  23729. var child;
  23730. for (var i = 0; i < children.length; i++) {
  23731. child = children[i];
  23732. if (child.tag === 'a') {
  23733. return child
  23734. }
  23735. if (child.children && (child = findAnchor(child.children))) {
  23736. return child
  23737. }
  23738. }
  23739. }
  23740. }
  23741. var _Vue;
  23742. function install (Vue) {
  23743. if (install.installed) { return }
  23744. install.installed = true;
  23745. _Vue = Vue;
  23746. Object.defineProperty(Vue.prototype, '$router', {
  23747. get: function get () { return this.$root._router }
  23748. });
  23749. Object.defineProperty(Vue.prototype, '$route', {
  23750. get: function get () { return this.$root._route }
  23751. });
  23752. Vue.mixin({
  23753. beforeCreate: function beforeCreate () {
  23754. if (this.$options.router) {
  23755. this._router = this.$options.router;
  23756. this._router.init(this);
  23757. Vue.util.defineReactive(this, '_route', this._router.history.current);
  23758. }
  23759. }
  23760. });
  23761. Vue.component('router-view', View);
  23762. Vue.component('router-link', Link);
  23763. var strats = Vue.config.optionMergeStrategies;
  23764. // use the same hook merging strategy for route hooks
  23765. strats.beforeRouteEnter = strats.beforeRouteLeave = strats.created;
  23766. }
  23767. /* */
  23768. var inBrowser = typeof window !== 'undefined';
  23769. /* */
  23770. function resolvePath (
  23771. relative,
  23772. base,
  23773. append
  23774. ) {
  23775. if (relative.charAt(0) === '/') {
  23776. return relative
  23777. }
  23778. if (relative.charAt(0) === '?' || relative.charAt(0) === '#') {
  23779. return base + relative
  23780. }
  23781. var stack = base.split('/');
  23782. // remove trailing segment if:
  23783. // - not appending
  23784. // - appending to trailing slash (last segment is empty)
  23785. if (!append || !stack[stack.length - 1]) {
  23786. stack.pop();
  23787. }
  23788. // resolve relative path
  23789. var segments = relative.replace(/^\//, '').split('/');
  23790. for (var i = 0; i < segments.length; i++) {
  23791. var segment = segments[i];
  23792. if (segment === '.') {
  23793. continue
  23794. } else if (segment === '..') {
  23795. stack.pop();
  23796. } else {
  23797. stack.push(segment);
  23798. }
  23799. }
  23800. // ensure leading slash
  23801. if (stack[0] !== '') {
  23802. stack.unshift('');
  23803. }
  23804. return stack.join('/')
  23805. }
  23806. function parsePath (path) {
  23807. var hash = '';
  23808. var query = '';
  23809. var hashIndex = path.indexOf('#');
  23810. if (hashIndex >= 0) {
  23811. hash = path.slice(hashIndex);
  23812. path = path.slice(0, hashIndex);
  23813. }
  23814. var queryIndex = path.indexOf('?');
  23815. if (queryIndex >= 0) {
  23816. query = path.slice(queryIndex + 1);
  23817. path = path.slice(0, queryIndex);
  23818. }
  23819. return {
  23820. path: path,
  23821. query: query,
  23822. hash: hash
  23823. }
  23824. }
  23825. function cleanPath (path) {
  23826. return path.replace(/\/\//g, '/')
  23827. }
  23828. /* */
  23829. function createRouteMap (
  23830. routes,
  23831. oldPathMap,
  23832. oldNameMap
  23833. ) {
  23834. var pathMap = oldPathMap || Object.create(null);
  23835. var nameMap = oldNameMap || Object.create(null);
  23836. routes.forEach(function (route) {
  23837. addRouteRecord(pathMap, nameMap, route);
  23838. });
  23839. return {
  23840. pathMap: pathMap,
  23841. nameMap: nameMap
  23842. }
  23843. }
  23844. function addRouteRecord (
  23845. pathMap,
  23846. nameMap,
  23847. route,
  23848. parent,
  23849. matchAs
  23850. ) {
  23851. var path = route.path;
  23852. var name = route.name;
  23853. if (process.env.NODE_ENV !== 'production') {
  23854. assert(path != null, "\"path\" is required in a route configuration.");
  23855. assert(
  23856. typeof route.component !== 'string',
  23857. "route config \"component\" for path: " + (String(path || name)) + " cannot be a " +
  23858. "string id. Use an actual component instead."
  23859. );
  23860. }
  23861. var record = {
  23862. path: normalizePath(path, parent),
  23863. components: route.components || { default: route.component },
  23864. instances: {},
  23865. name: name,
  23866. parent: parent,
  23867. matchAs: matchAs,
  23868. redirect: route.redirect,
  23869. beforeEnter: route.beforeEnter,
  23870. meta: route.meta || {},
  23871. props: route.props == null
  23872. ? {}
  23873. : route.components
  23874. ? route.props
  23875. : { default: route.props }
  23876. };
  23877. if (route.children) {
  23878. // Warn if route is named and has a default child route.
  23879. // If users navigate to this route by name, the default child will
  23880. // not be rendered (GH Issue #629)
  23881. if (process.env.NODE_ENV !== 'production') {
  23882. if (route.name && route.children.some(function (child) { return /^\/?$/.test(child.path); })) {
  23883. warn(
  23884. false,
  23885. "Named Route '" + (route.name) + "' has a default child route. " +
  23886. "When navigating to this named route (:to=\"{name: '" + (route.name) + "'\"), " +
  23887. "the default child route will not be rendered. Remove the name from " +
  23888. "this route and use the name of the default child route for named " +
  23889. "links instead."
  23890. );
  23891. }
  23892. }
  23893. route.children.forEach(function (child) {
  23894. var childMatchAs = matchAs
  23895. ? cleanPath((matchAs + "/" + (child.path)))
  23896. : undefined;
  23897. addRouteRecord(pathMap, nameMap, child, record, childMatchAs);
  23898. });
  23899. }
  23900. if (route.alias !== undefined) {
  23901. if (Array.isArray(route.alias)) {
  23902. route.alias.forEach(function (alias) {
  23903. var aliasRoute = {
  23904. path: alias,
  23905. children: route.children
  23906. };
  23907. addRouteRecord(pathMap, nameMap, aliasRoute, parent, record.path);
  23908. });
  23909. } else {
  23910. var aliasRoute = {
  23911. path: route.alias,
  23912. children: route.children
  23913. };
  23914. addRouteRecord(pathMap, nameMap, aliasRoute, parent, record.path);
  23915. }
  23916. }
  23917. if (!pathMap[record.path]) {
  23918. pathMap[record.path] = record;
  23919. }
  23920. if (name) {
  23921. if (!nameMap[name]) {
  23922. nameMap[name] = record;
  23923. } else if (process.env.NODE_ENV !== 'production' && !matchAs) {
  23924. warn(
  23925. false,
  23926. "Duplicate named routes definition: " +
  23927. "{ name: \"" + name + "\", path: \"" + (record.path) + "\" }"
  23928. );
  23929. }
  23930. }
  23931. }
  23932. function normalizePath (path, parent) {
  23933. path = path.replace(/\/$/, '');
  23934. if (path[0] === '/') { return path }
  23935. if (parent == null) { return path }
  23936. return cleanPath(((parent.path) + "/" + path))
  23937. }
  23938. var index$1 = Array.isArray || function (arr) {
  23939. return Object.prototype.toString.call(arr) == '[object Array]';
  23940. };
  23941. var isarray = index$1;
  23942. /**
  23943. * Expose `pathToRegexp`.
  23944. */
  23945. var index = pathToRegexp;
  23946. var parse_1 = parse;
  23947. var compile_1 = compile;
  23948. var tokensToFunction_1 = tokensToFunction;
  23949. var tokensToRegExp_1 = tokensToRegExp;
  23950. /**
  23951. * The main path matching regexp utility.
  23952. *
  23953. * @type {RegExp}
  23954. */
  23955. var PATH_REGEXP = new RegExp([
  23956. // Match escaped characters that would otherwise appear in future matches.
  23957. // This allows the user to escape special characters that won't transform.
  23958. '(\\\\.)',
  23959. // Match Express-style parameters and un-named parameters with a prefix
  23960. // and optional suffixes. Matches appear as:
  23961. //
  23962. // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
  23963. // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
  23964. // "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
  23965. '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'
  23966. ].join('|'), 'g');
  23967. /**
  23968. * Parse a string for the raw tokens.
  23969. *
  23970. * @param {string} str
  23971. * @param {Object=} options
  23972. * @return {!Array}
  23973. */
  23974. function parse (str, options) {
  23975. var tokens = [];
  23976. var key = 0;
  23977. var index = 0;
  23978. var path = '';
  23979. var defaultDelimiter = options && options.delimiter || '/';
  23980. var res;
  23981. while ((res = PATH_REGEXP.exec(str)) != null) {
  23982. var m = res[0];
  23983. var escaped = res[1];
  23984. var offset = res.index;
  23985. path += str.slice(index, offset);
  23986. index = offset + m.length;
  23987. // Ignore already escaped sequences.
  23988. if (escaped) {
  23989. path += escaped[1];
  23990. continue
  23991. }
  23992. var next = str[index];
  23993. var prefix = res[2];
  23994. var name = res[3];
  23995. var capture = res[4];
  23996. var group = res[5];
  23997. var modifier = res[6];
  23998. var asterisk = res[7];
  23999. // Push the current path onto the tokens.
  24000. if (path) {
  24001. tokens.push(path);
  24002. path = '';
  24003. }
  24004. var partial = prefix != null && next != null && next !== prefix;
  24005. var repeat = modifier === '+' || modifier === '*';
  24006. var optional = modifier === '?' || modifier === '*';
  24007. var delimiter = res[2] || defaultDelimiter;
  24008. var pattern = capture || group;
  24009. tokens.push({
  24010. name: name || key++,
  24011. prefix: prefix || '',
  24012. delimiter: delimiter,
  24013. optional: optional,
  24014. repeat: repeat,
  24015. partial: partial,
  24016. asterisk: !!asterisk,
  24017. pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')
  24018. });
  24019. }
  24020. // Match any characters still remaining.
  24021. if (index < str.length) {
  24022. path += str.substr(index);
  24023. }
  24024. // If the path exists, push it onto the end.
  24025. if (path) {
  24026. tokens.push(path);
  24027. }
  24028. return tokens
  24029. }
  24030. /**
  24031. * Compile a string to a template function for the path.
  24032. *
  24033. * @param {string} str
  24034. * @param {Object=} options
  24035. * @return {!function(Object=, Object=)}
  24036. */
  24037. function compile (str, options) {
  24038. return tokensToFunction(parse(str, options))
  24039. }
  24040. /**
  24041. * Prettier encoding of URI path segments.
  24042. *
  24043. * @param {string}
  24044. * @return {string}
  24045. */
  24046. function encodeURIComponentPretty (str) {
  24047. return encodeURI(str).replace(/[\/?#]/g, function (c) {
  24048. return '%' + c.charCodeAt(0).toString(16).toUpperCase()
  24049. })
  24050. }
  24051. /**
  24052. * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.
  24053. *
  24054. * @param {string}
  24055. * @return {string}
  24056. */
  24057. function encodeAsterisk (str) {
  24058. return encodeURI(str).replace(/[?#]/g, function (c) {
  24059. return '%' + c.charCodeAt(0).toString(16).toUpperCase()
  24060. })
  24061. }
  24062. /**
  24063. * Expose a method for transforming tokens into the path function.
  24064. */
  24065. function tokensToFunction (tokens) {
  24066. // Compile all the tokens into regexps.
  24067. var matches = new Array(tokens.length);
  24068. // Compile all the patterns before compilation.
  24069. for (var i = 0; i < tokens.length; i++) {
  24070. if (typeof tokens[i] === 'object') {
  24071. matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$');
  24072. }
  24073. }
  24074. return function (obj, opts) {
  24075. var path = '';
  24076. var data = obj || {};
  24077. var options = opts || {};
  24078. var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;
  24079. for (var i = 0; i < tokens.length; i++) {
  24080. var token = tokens[i];
  24081. if (typeof token === 'string') {
  24082. path += token;
  24083. continue
  24084. }
  24085. var value = data[token.name];
  24086. var segment;
  24087. if (value == null) {
  24088. if (token.optional) {
  24089. // Prepend partial segment prefixes.
  24090. if (token.partial) {
  24091. path += token.prefix;
  24092. }
  24093. continue
  24094. } else {
  24095. throw new TypeError('Expected "' + token.name + '" to be defined')
  24096. }
  24097. }
  24098. if (isarray(value)) {
  24099. if (!token.repeat) {
  24100. throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
  24101. }
  24102. if (value.length === 0) {
  24103. if (token.optional) {
  24104. continue
  24105. } else {
  24106. throw new TypeError('Expected "' + token.name + '" to not be empty')
  24107. }
  24108. }
  24109. for (var j = 0; j < value.length; j++) {
  24110. segment = encode(value[j]);
  24111. if (!matches[i].test(segment)) {
  24112. throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`')
  24113. }
  24114. path += (j === 0 ? token.prefix : token.delimiter) + segment;
  24115. }
  24116. continue
  24117. }
  24118. segment = token.asterisk ? encodeAsterisk(value) : encode(value);
  24119. if (!matches[i].test(segment)) {
  24120. throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"')
  24121. }
  24122. path += token.prefix + segment;
  24123. }
  24124. return path
  24125. }
  24126. }
  24127. /**
  24128. * Escape a regular expression string.
  24129. *
  24130. * @param {string} str
  24131. * @return {string}
  24132. */
  24133. function escapeString (str) {
  24134. return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1')
  24135. }
  24136. /**
  24137. * Escape the capturing group by escaping special characters and meaning.
  24138. *
  24139. * @param {string} group
  24140. * @return {string}
  24141. */
  24142. function escapeGroup (group) {
  24143. return group.replace(/([=!:$\/()])/g, '\\$1')
  24144. }
  24145. /**
  24146. * Attach the keys as a property of the regexp.
  24147. *
  24148. * @param {!RegExp} re
  24149. * @param {Array} keys
  24150. * @return {!RegExp}
  24151. */
  24152. function attachKeys (re, keys) {
  24153. re.keys = keys;
  24154. return re
  24155. }
  24156. /**
  24157. * Get the flags for a regexp from the options.
  24158. *
  24159. * @param {Object} options
  24160. * @return {string}
  24161. */
  24162. function flags (options) {
  24163. return options.sensitive ? '' : 'i'
  24164. }
  24165. /**
  24166. * Pull out keys from a regexp.
  24167. *
  24168. * @param {!RegExp} path
  24169. * @param {!Array} keys
  24170. * @return {!RegExp}
  24171. */
  24172. function regexpToRegexp (path, keys) {
  24173. // Use a negative lookahead to match only capturing groups.
  24174. var groups = path.source.match(/\((?!\?)/g);
  24175. if (groups) {
  24176. for (var i = 0; i < groups.length; i++) {
  24177. keys.push({
  24178. name: i,
  24179. prefix: null,
  24180. delimiter: null,
  24181. optional: false,
  24182. repeat: false,
  24183. partial: false,
  24184. asterisk: false,
  24185. pattern: null
  24186. });
  24187. }
  24188. }
  24189. return attachKeys(path, keys)
  24190. }
  24191. /**
  24192. * Transform an array into a regexp.
  24193. *
  24194. * @param {!Array} path
  24195. * @param {Array} keys
  24196. * @param {!Object} options
  24197. * @return {!RegExp}
  24198. */
  24199. function arrayToRegexp (path, keys, options) {
  24200. var parts = [];
  24201. for (var i = 0; i < path.length; i++) {
  24202. parts.push(pathToRegexp(path[i], keys, options).source);
  24203. }
  24204. var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));
  24205. return attachKeys(regexp, keys)
  24206. }
  24207. /**
  24208. * Create a path regexp from string input.
  24209. *
  24210. * @param {string} path
  24211. * @param {!Array} keys
  24212. * @param {!Object} options
  24213. * @return {!RegExp}
  24214. */
  24215. function stringToRegexp (path, keys, options) {
  24216. return tokensToRegExp(parse(path, options), keys, options)
  24217. }
  24218. /**
  24219. * Expose a function for taking tokens and returning a RegExp.
  24220. *
  24221. * @param {!Array} tokens
  24222. * @param {(Array|Object)=} keys
  24223. * @param {Object=} options
  24224. * @return {!RegExp}
  24225. */
  24226. function tokensToRegExp (tokens, keys, options) {
  24227. if (!isarray(keys)) {
  24228. options = /** @type {!Object} */ (keys || options);
  24229. keys = [];
  24230. }
  24231. options = options || {};
  24232. var strict = options.strict;
  24233. var end = options.end !== false;
  24234. var route = '';
  24235. // Iterate over the tokens and create our regexp string.
  24236. for (var i = 0; i < tokens.length; i++) {
  24237. var token = tokens[i];
  24238. if (typeof token === 'string') {
  24239. route += escapeString(token);
  24240. } else {
  24241. var prefix = escapeString(token.prefix);
  24242. var capture = '(?:' + token.pattern + ')';
  24243. keys.push(token);
  24244. if (token.repeat) {
  24245. capture += '(?:' + prefix + capture + ')*';
  24246. }
  24247. if (token.optional) {
  24248. if (!token.partial) {
  24249. capture = '(?:' + prefix + '(' + capture + '))?';
  24250. } else {
  24251. capture = prefix + '(' + capture + ')?';
  24252. }
  24253. } else {
  24254. capture = prefix + '(' + capture + ')';
  24255. }
  24256. route += capture;
  24257. }
  24258. }
  24259. var delimiter = escapeString(options.delimiter || '/');
  24260. var endsWithDelimiter = route.slice(-delimiter.length) === delimiter;
  24261. // In non-strict mode we allow a slash at the end of match. If the path to
  24262. // match already ends with a slash, we remove it for consistency. The slash
  24263. // is valid at the end of a path match, not in the middle. This is important
  24264. // in non-ending mode, where "/test/" shouldn't match "/test//route".
  24265. if (!strict) {
  24266. route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?';
  24267. }
  24268. if (end) {
  24269. route += '$';
  24270. } else {
  24271. // In non-ending mode, we need the capturing groups to match as much as
  24272. // possible by using a positive lookahead to the end or next path segment.
  24273. route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)';
  24274. }
  24275. return attachKeys(new RegExp('^' + route, flags(options)), keys)
  24276. }
  24277. /**
  24278. * Normalize the given path string, returning a regular expression.
  24279. *
  24280. * An empty array can be passed in for the keys, which will hold the
  24281. * placeholder key descriptions. For example, using `/user/:id`, `keys` will
  24282. * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
  24283. *
  24284. * @param {(string|RegExp|Array)} path
  24285. * @param {(Array|Object)=} keys
  24286. * @param {Object=} options
  24287. * @return {!RegExp}
  24288. */
  24289. function pathToRegexp (path, keys, options) {
  24290. if (!isarray(keys)) {
  24291. options = /** @type {!Object} */ (keys || options);
  24292. keys = [];
  24293. }
  24294. options = options || {};
  24295. if (path instanceof RegExp) {
  24296. return regexpToRegexp(path, /** @type {!Array} */ (keys))
  24297. }
  24298. if (isarray(path)) {
  24299. return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
  24300. }
  24301. return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)
  24302. }
  24303. index.parse = parse_1;
  24304. index.compile = compile_1;
  24305. index.tokensToFunction = tokensToFunction_1;
  24306. index.tokensToRegExp = tokensToRegExp_1;
  24307. /* */
  24308. var regexpCache = Object.create(null);
  24309. function getRouteRegex (path) {
  24310. var hit = regexpCache[path];
  24311. var keys, regexp;
  24312. if (hit) {
  24313. keys = hit.keys;
  24314. regexp = hit.regexp;
  24315. } else {
  24316. keys = [];
  24317. regexp = index(path, keys);
  24318. regexpCache[path] = { keys: keys, regexp: regexp };
  24319. }
  24320. return { keys: keys, regexp: regexp }
  24321. }
  24322. var regexpCompileCache = Object.create(null);
  24323. function fillParams (
  24324. path,
  24325. params,
  24326. routeMsg
  24327. ) {
  24328. try {
  24329. var filler =
  24330. regexpCompileCache[path] ||
  24331. (regexpCompileCache[path] = index.compile(path));
  24332. return filler(params || {}, { pretty: true })
  24333. } catch (e) {
  24334. if (process.env.NODE_ENV !== 'production') {
  24335. warn(false, ("missing param for " + routeMsg + ": " + (e.message)));
  24336. }
  24337. return ''
  24338. }
  24339. }
  24340. /* */
  24341. function normalizeLocation (
  24342. raw,
  24343. current,
  24344. append
  24345. ) {
  24346. var next = typeof raw === 'string' ? { path: raw } : raw;
  24347. // named target
  24348. if (next.name || next._normalized) {
  24349. return next
  24350. }
  24351. // relative params
  24352. if (!next.path && next.params && current) {
  24353. next = assign({}, next);
  24354. next._normalized = true;
  24355. var params = assign(assign({}, current.params), next.params);
  24356. if (current.name) {
  24357. next.name = current.name;
  24358. next.params = params;
  24359. } else if (current.matched) {
  24360. var rawPath = current.matched[current.matched.length - 1].path;
  24361. next.path = fillParams(rawPath, params, ("path " + (current.path)));
  24362. } else if (process.env.NODE_ENV !== 'production') {
  24363. warn(false, "relative params navigation requires a current route.");
  24364. }
  24365. return next
  24366. }
  24367. var parsedPath = parsePath(next.path || '');
  24368. var basePath = (current && current.path) || '/';
  24369. var path = parsedPath.path
  24370. ? resolvePath(parsedPath.path, basePath, append || next.append)
  24371. : (current && current.path) || '/';
  24372. var query = resolveQuery(parsedPath.query, next.query);
  24373. var hash = next.hash || parsedPath.hash;
  24374. if (hash && hash.charAt(0) !== '#') {
  24375. hash = "#" + hash;
  24376. }
  24377. return {
  24378. _normalized: true,
  24379. path: path,
  24380. query: query,
  24381. hash: hash
  24382. }
  24383. }
  24384. function assign (a, b) {
  24385. for (var key in b) {
  24386. a[key] = b[key];
  24387. }
  24388. return a
  24389. }
  24390. /* */
  24391. function createMatcher (routes) {
  24392. var ref = createRouteMap(routes);
  24393. var pathMap = ref.pathMap;
  24394. var nameMap = ref.nameMap;
  24395. function addRoutes (routes) {
  24396. createRouteMap(routes, pathMap, nameMap);
  24397. }
  24398. function match (
  24399. raw,
  24400. currentRoute,
  24401. redirectedFrom
  24402. ) {
  24403. var location = normalizeLocation(raw, currentRoute);
  24404. var name = location.name;
  24405. if (name) {
  24406. var record = nameMap[name];
  24407. if (process.env.NODE_ENV !== 'production') {
  24408. warn(record, ("Route with name '" + name + "' does not exist"));
  24409. }
  24410. var paramNames = getRouteRegex(record.path).keys
  24411. .filter(function (key) { return !key.optional; })
  24412. .map(function (key) { return key.name; });
  24413. if (typeof location.params !== 'object') {
  24414. location.params = {};
  24415. }
  24416. if (currentRoute && typeof currentRoute.params === 'object') {
  24417. for (var key in currentRoute.params) {
  24418. if (!(key in location.params) && paramNames.indexOf(key) > -1) {
  24419. location.params[key] = currentRoute.params[key];
  24420. }
  24421. }
  24422. }
  24423. if (record) {
  24424. location.path = fillParams(record.path, location.params, ("named route \"" + name + "\""));
  24425. return _createRoute(record, location, redirectedFrom)
  24426. }
  24427. } else if (location.path) {
  24428. location.params = {};
  24429. for (var path in pathMap) {
  24430. if (matchRoute(path, location.params, location.path)) {
  24431. return _createRoute(pathMap[path], location, redirectedFrom)
  24432. }
  24433. }
  24434. }
  24435. // no match
  24436. return _createRoute(null, location)
  24437. }
  24438. function redirect (
  24439. record,
  24440. location
  24441. ) {
  24442. var originalRedirect = record.redirect;
  24443. var redirect = typeof originalRedirect === 'function'
  24444. ? originalRedirect(createRoute(record, location))
  24445. : originalRedirect;
  24446. if (typeof redirect === 'string') {
  24447. redirect = { path: redirect };
  24448. }
  24449. if (!redirect || typeof redirect !== 'object') {
  24450. process.env.NODE_ENV !== 'production' && warn(
  24451. false, ("invalid redirect option: " + (JSON.stringify(redirect)))
  24452. );
  24453. return _createRoute(null, location)
  24454. }
  24455. var re = redirect;
  24456. var name = re.name;
  24457. var path = re.path;
  24458. var query = location.query;
  24459. var hash = location.hash;
  24460. var params = location.params;
  24461. query = re.hasOwnProperty('query') ? re.query : query;
  24462. hash = re.hasOwnProperty('hash') ? re.hash : hash;
  24463. params = re.hasOwnProperty('params') ? re.params : params;
  24464. if (name) {
  24465. // resolved named direct
  24466. var targetRecord = nameMap[name];
  24467. if (process.env.NODE_ENV !== 'production') {
  24468. assert(targetRecord, ("redirect failed: named route \"" + name + "\" not found."));
  24469. }
  24470. return match({
  24471. _normalized: true,
  24472. name: name,
  24473. query: query,
  24474. hash: hash,
  24475. params: params
  24476. }, undefined, location)
  24477. } else if (path) {
  24478. // 1. resolve relative redirect
  24479. var rawPath = resolveRecordPath(path, record);
  24480. // 2. resolve params
  24481. var resolvedPath = fillParams(rawPath, params, ("redirect route with path \"" + rawPath + "\""));
  24482. // 3. rematch with existing query and hash
  24483. return match({
  24484. _normalized: true,
  24485. path: resolvedPath,
  24486. query: query,
  24487. hash: hash
  24488. }, undefined, location)
  24489. } else {
  24490. warn(false, ("invalid redirect option: " + (JSON.stringify(redirect))));
  24491. return _createRoute(null, location)
  24492. }
  24493. }
  24494. function alias (
  24495. record,
  24496. location,
  24497. matchAs
  24498. ) {
  24499. var aliasedPath = fillParams(matchAs, location.params, ("aliased route with path \"" + matchAs + "\""));
  24500. var aliasedMatch = match({
  24501. _normalized: true,
  24502. path: aliasedPath
  24503. });
  24504. if (aliasedMatch) {
  24505. var matched = aliasedMatch.matched;
  24506. var aliasedRecord = matched[matched.length - 1];
  24507. location.params = aliasedMatch.params;
  24508. return _createRoute(aliasedRecord, location)
  24509. }
  24510. return _createRoute(null, location)
  24511. }
  24512. function _createRoute (
  24513. record,
  24514. location,
  24515. redirectedFrom
  24516. ) {
  24517. if (record && record.redirect) {
  24518. return redirect(record, redirectedFrom || location)
  24519. }
  24520. if (record && record.matchAs) {
  24521. return alias(record, location, record.matchAs)
  24522. }
  24523. return createRoute(record, location, redirectedFrom)
  24524. }
  24525. return {
  24526. match: match,
  24527. addRoutes: addRoutes
  24528. }
  24529. }
  24530. function matchRoute (
  24531. path,
  24532. params,
  24533. pathname
  24534. ) {
  24535. var ref = getRouteRegex(path);
  24536. var regexp = ref.regexp;
  24537. var keys = ref.keys;
  24538. var m = pathname.match(regexp);
  24539. if (!m) {
  24540. return false
  24541. } else if (!params) {
  24542. return true
  24543. }
  24544. for (var i = 1, len = m.length; i < len; ++i) {
  24545. var key = keys[i - 1];
  24546. var val = typeof m[i] === 'string' ? decodeURIComponent(m[i]) : m[i];
  24547. if (key) { params[key.name] = val; }
  24548. }
  24549. return true
  24550. }
  24551. function resolveRecordPath (path, record) {
  24552. return resolvePath(path, record.parent ? record.parent.path : '/', true)
  24553. }
  24554. /* */
  24555. var positionStore = Object.create(null);
  24556. function setupScroll () {
  24557. window.addEventListener('popstate', function (e) {
  24558. saveScrollPosition();
  24559. if (e.state && e.state.key) {
  24560. setStateKey(e.state.key);
  24561. }
  24562. });
  24563. }
  24564. function handleScroll (
  24565. router,
  24566. to,
  24567. from,
  24568. isPop
  24569. ) {
  24570. if (!router.app) {
  24571. return
  24572. }
  24573. var behavior = router.options.scrollBehavior;
  24574. if (!behavior) {
  24575. return
  24576. }
  24577. if (process.env.NODE_ENV !== 'production') {
  24578. assert(typeof behavior === 'function', "scrollBehavior must be a function");
  24579. }
  24580. // wait until re-render finishes before scrolling
  24581. router.app.$nextTick(function () {
  24582. var position = getScrollPosition();
  24583. var shouldScroll = behavior(to, from, isPop ? position : null);
  24584. if (!shouldScroll) {
  24585. return
  24586. }
  24587. var isObject = typeof shouldScroll === 'object';
  24588. if (isObject && typeof shouldScroll.selector === 'string') {
  24589. var el = document.querySelector(shouldScroll.selector);
  24590. if (el) {
  24591. position = getElementPosition(el);
  24592. } else if (isValidPosition(shouldScroll)) {
  24593. position = normalizePosition(shouldScroll);
  24594. }
  24595. } else if (isObject && isValidPosition(shouldScroll)) {
  24596. position = normalizePosition(shouldScroll);
  24597. }
  24598. if (position) {
  24599. window.scrollTo(position.x, position.y);
  24600. }
  24601. });
  24602. }
  24603. function saveScrollPosition () {
  24604. var key = getStateKey();
  24605. if (key) {
  24606. positionStore[key] = {
  24607. x: window.pageXOffset,
  24608. y: window.pageYOffset
  24609. };
  24610. }
  24611. }
  24612. function getScrollPosition () {
  24613. var key = getStateKey();
  24614. if (key) {
  24615. return positionStore[key]
  24616. }
  24617. }
  24618. function getElementPosition (el) {
  24619. var docRect = document.documentElement.getBoundingClientRect();
  24620. var elRect = el.getBoundingClientRect();
  24621. return {
  24622. x: elRect.left - docRect.left,
  24623. y: elRect.top - docRect.top
  24624. }
  24625. }
  24626. function isValidPosition (obj) {
  24627. return isNumber(obj.x) || isNumber(obj.y)
  24628. }
  24629. function normalizePosition (obj) {
  24630. return {
  24631. x: isNumber(obj.x) ? obj.x : window.pageXOffset,
  24632. y: isNumber(obj.y) ? obj.y : window.pageYOffset
  24633. }
  24634. }
  24635. function isNumber (v) {
  24636. return typeof v === 'number'
  24637. }
  24638. /* */
  24639. var supportsPushState = inBrowser && (function () {
  24640. var ua = window.navigator.userAgent;
  24641. if (
  24642. (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&
  24643. ua.indexOf('Mobile Safari') !== -1 &&
  24644. ua.indexOf('Chrome') === -1 &&
  24645. ua.indexOf('Windows Phone') === -1
  24646. ) {
  24647. return false
  24648. }
  24649. return window.history && 'pushState' in window.history
  24650. })();
  24651. // use User Timing api (if present) for more accurate key precision
  24652. var Time = inBrowser && window.performance && window.performance.now
  24653. ? window.performance
  24654. : Date;
  24655. var _key = genKey();
  24656. function genKey () {
  24657. return Time.now().toFixed(3)
  24658. }
  24659. function getStateKey () {
  24660. return _key
  24661. }
  24662. function setStateKey (key) {
  24663. _key = key;
  24664. }
  24665. function pushState (url, replace) {
  24666. saveScrollPosition();
  24667. // try...catch the pushState call to get around Safari
  24668. // DOM Exception 18 where it limits to 100 pushState calls
  24669. var history = window.history;
  24670. try {
  24671. if (replace) {
  24672. history.replaceState({ key: _key }, '', url);
  24673. } else {
  24674. _key = genKey();
  24675. history.pushState({ key: _key }, '', url);
  24676. }
  24677. } catch (e) {
  24678. window.location[replace ? 'replace' : 'assign'](url);
  24679. }
  24680. }
  24681. function replaceState (url) {
  24682. pushState(url, true);
  24683. }
  24684. /* */
  24685. function runQueue (queue, fn, cb) {
  24686. var step = function (index) {
  24687. if (index >= queue.length) {
  24688. cb();
  24689. } else {
  24690. if (queue[index]) {
  24691. fn(queue[index], function () {
  24692. step(index + 1);
  24693. });
  24694. } else {
  24695. step(index + 1);
  24696. }
  24697. }
  24698. };
  24699. step(0);
  24700. }
  24701. /* */
  24702. var History = function History (router, base) {
  24703. this.router = router;
  24704. this.base = normalizeBase(base);
  24705. // start with a route object that stands for "nowhere"
  24706. this.current = START;
  24707. this.pending = null;
  24708. this.ready = false;
  24709. this.readyCbs = [];
  24710. };
  24711. History.prototype.listen = function listen (cb) {
  24712. this.cb = cb;
  24713. };
  24714. History.prototype.onReady = function onReady (cb) {
  24715. if (this.ready) {
  24716. cb();
  24717. } else {
  24718. this.readyCbs.push(cb);
  24719. }
  24720. };
  24721. History.prototype.transitionTo = function transitionTo (location, onComplete, onAbort) {
  24722. var this$1 = this;
  24723. var route = this.router.match(location, this.current);
  24724. this.confirmTransition(route, function () {
  24725. this$1.updateRoute(route);
  24726. onComplete && onComplete(route);
  24727. this$1.ensureURL();
  24728. // fire ready cbs once
  24729. if (!this$1.ready) {
  24730. this$1.ready = true;
  24731. this$1.readyCbs.forEach(function (cb) {
  24732. cb(route);
  24733. });
  24734. }
  24735. }, onAbort);
  24736. };
  24737. History.prototype.confirmTransition = function confirmTransition (route, onComplete, onAbort) {
  24738. var this$1 = this;
  24739. var current = this.current;
  24740. var abort = function () { onAbort && onAbort(); };
  24741. if (
  24742. isSameRoute(route, current) &&
  24743. // in the case the route map has been dynamically appended to
  24744. route.matched.length === current.matched.length
  24745. ) {
  24746. this.ensureURL();
  24747. return abort()
  24748. }
  24749. var ref = resolveQueue(this.current.matched, route.matched);
  24750. var updated = ref.updated;
  24751. var deactivated = ref.deactivated;
  24752. var activated = ref.activated;
  24753. var queue = [].concat(
  24754. // in-component leave guards
  24755. extractLeaveGuards(deactivated),
  24756. // global before hooks
  24757. this.router.beforeHooks,
  24758. // in-component update hooks
  24759. extractUpdateHooks(updated),
  24760. // in-config enter guards
  24761. activated.map(function (m) { return m.beforeEnter; }),
  24762. // async components
  24763. resolveAsyncComponents(activated)
  24764. );
  24765. this.pending = route;
  24766. var iterator = function (hook, next) {
  24767. if (this$1.pending !== route) {
  24768. return abort()
  24769. }
  24770. hook(route, current, function (to) {
  24771. if (to === false) {
  24772. // next(false) -> abort navigation, ensure current URL
  24773. this$1.ensureURL(true);
  24774. abort();
  24775. } else if (typeof to === 'string' || typeof to === 'object') {
  24776. // next('/') or next({ path: '/' }) -> redirect
  24777. (typeof to === 'object' && to.replace) ? this$1.replace(to) : this$1.push(to);
  24778. abort();
  24779. } else {
  24780. // confirm transition and pass on the value
  24781. next(to);
  24782. }
  24783. });
  24784. };
  24785. runQueue(queue, iterator, function () {
  24786. var postEnterCbs = [];
  24787. var isValid = function () { return this$1.current === route; };
  24788. var enterGuards = extractEnterGuards(activated, postEnterCbs, isValid);
  24789. // wait until async components are resolved before
  24790. // extracting in-component enter guards
  24791. runQueue(enterGuards, iterator, function () {
  24792. if (this$1.pending !== route) {
  24793. return abort()
  24794. }
  24795. this$1.pending = null;
  24796. onComplete(route);
  24797. if (this$1.router.app) {
  24798. this$1.router.app.$nextTick(function () {
  24799. postEnterCbs.forEach(function (cb) { return cb(); });
  24800. });
  24801. }
  24802. });
  24803. });
  24804. };
  24805. History.prototype.updateRoute = function updateRoute (route) {
  24806. var prev = this.current;
  24807. this.current = route;
  24808. this.cb && this.cb(route);
  24809. this.router.afterHooks.forEach(function (hook) {
  24810. hook && hook(route, prev);
  24811. });
  24812. };
  24813. function normalizeBase (base) {
  24814. if (!base) {
  24815. if (inBrowser) {
  24816. // respect <base> tag
  24817. var baseEl = document.querySelector('base');
  24818. base = baseEl ? baseEl.getAttribute('href') : '/';
  24819. } else {
  24820. base = '/';
  24821. }
  24822. }
  24823. // make sure there's the starting slash
  24824. if (base.charAt(0) !== '/') {
  24825. base = '/' + base;
  24826. }
  24827. // remove trailing slash
  24828. return base.replace(/\/$/, '')
  24829. }
  24830. function resolveQueue (
  24831. current,
  24832. next
  24833. ) {
  24834. var i;
  24835. var max = Math.max(current.length, next.length);
  24836. for (i = 0; i < max; i++) {
  24837. if (current[i] !== next[i]) {
  24838. break
  24839. }
  24840. }
  24841. return {
  24842. updated: next.slice(0, i),
  24843. activated: next.slice(i),
  24844. deactivated: current.slice(i)
  24845. }
  24846. }
  24847. function extractGuards (
  24848. records,
  24849. name,
  24850. bind,
  24851. reverse
  24852. ) {
  24853. var guards = flatMapComponents(records, function (def, instance, match, key) {
  24854. var guard = extractGuard(def, name);
  24855. if (guard) {
  24856. return Array.isArray(guard)
  24857. ? guard.map(function (guard) { return bind(guard, instance, match, key); })
  24858. : bind(guard, instance, match, key)
  24859. }
  24860. });
  24861. return flatten(reverse ? guards.reverse() : guards)
  24862. }
  24863. function extractGuard (
  24864. def,
  24865. key
  24866. ) {
  24867. if (typeof def !== 'function') {
  24868. // extend now so that global mixins are applied.
  24869. def = _Vue.extend(def);
  24870. }
  24871. return def.options[key]
  24872. }
  24873. function extractLeaveGuards (deactivated) {
  24874. return extractGuards(deactivated, 'beforeRouteLeave', bindGuard, true)
  24875. }
  24876. function extractUpdateHooks (updated) {
  24877. return extractGuards(updated, 'beforeRouteUpdate', bindGuard)
  24878. }
  24879. function bindGuard (guard, instance) {
  24880. return function boundRouteGuard () {
  24881. return guard.apply(instance, arguments)
  24882. }
  24883. }
  24884. function extractEnterGuards (
  24885. activated,
  24886. cbs,
  24887. isValid
  24888. ) {
  24889. return extractGuards(activated, 'beforeRouteEnter', function (guard, _, match, key) {
  24890. return bindEnterGuard(guard, match, key, cbs, isValid)
  24891. })
  24892. }
  24893. function bindEnterGuard (
  24894. guard,
  24895. match,
  24896. key,
  24897. cbs,
  24898. isValid
  24899. ) {
  24900. return function routeEnterGuard (to, from, next) {
  24901. return guard(to, from, function (cb) {
  24902. next(cb);
  24903. if (typeof cb === 'function') {
  24904. cbs.push(function () {
  24905. // #750
  24906. // if a router-view is wrapped with an out-in transition,
  24907. // the instance may not have been registered at this time.
  24908. // we will need to poll for registration until current route
  24909. // is no longer valid.
  24910. poll(cb, match.instances, key, isValid);
  24911. });
  24912. }
  24913. })
  24914. }
  24915. }
  24916. function poll (
  24917. cb, // somehow flow cannot infer this is a function
  24918. instances,
  24919. key,
  24920. isValid
  24921. ) {
  24922. if (instances[key]) {
  24923. cb(instances[key]);
  24924. } else if (isValid()) {
  24925. setTimeout(function () {
  24926. poll(cb, instances, key, isValid);
  24927. }, 16);
  24928. }
  24929. }
  24930. function resolveAsyncComponents (matched) {
  24931. return flatMapComponents(matched, function (def, _, match, key) {
  24932. // if it's a function and doesn't have Vue options attached,
  24933. // assume it's an async component resolve function.
  24934. // we are not using Vue's default async resolving mechanism because
  24935. // we want to halt the navigation until the incoming component has been
  24936. // resolved.
  24937. if (typeof def === 'function' && !def.options) {
  24938. return function (to, from, next) {
  24939. var resolve = once(function (resolvedDef) {
  24940. match.components[key] = resolvedDef;
  24941. next();
  24942. });
  24943. var reject = once(function (reason) {
  24944. warn(false, ("Failed to resolve async component " + key + ": " + reason));
  24945. next(false);
  24946. });
  24947. var res = def(resolve, reject);
  24948. if (res && typeof res.then === 'function') {
  24949. res.then(resolve, reject);
  24950. }
  24951. }
  24952. }
  24953. })
  24954. }
  24955. function flatMapComponents (
  24956. matched,
  24957. fn
  24958. ) {
  24959. return flatten(matched.map(function (m) {
  24960. return Object.keys(m.components).map(function (key) { return fn(
  24961. m.components[key],
  24962. m.instances[key],
  24963. m, key
  24964. ); })
  24965. }))
  24966. }
  24967. function flatten (arr) {
  24968. return Array.prototype.concat.apply([], arr)
  24969. }
  24970. // in Webpack 2, require.ensure now also returns a Promise
  24971. // so the resolve/reject functions may get called an extra time
  24972. // if the user uses an arrow function shorthand that happens to
  24973. // return that Promise.
  24974. function once (fn) {
  24975. var called = false;
  24976. return function () {
  24977. if (called) { return }
  24978. called = true;
  24979. return fn.apply(this, arguments)
  24980. }
  24981. }
  24982. /* */
  24983. var HTML5History = (function (History$$1) {
  24984. function HTML5History (router, base) {
  24985. var this$1 = this;
  24986. History$$1.call(this, router, base);
  24987. var expectScroll = router.options.scrollBehavior;
  24988. if (expectScroll) {
  24989. setupScroll();
  24990. }
  24991. window.addEventListener('popstate', function (e) {
  24992. this$1.transitionTo(getLocation(this$1.base), function (route) {
  24993. if (expectScroll) {
  24994. handleScroll(router, route, this$1.current, true);
  24995. }
  24996. });
  24997. });
  24998. }
  24999. if ( History$$1 ) HTML5History.__proto__ = History$$1;
  25000. HTML5History.prototype = Object.create( History$$1 && History$$1.prototype );
  25001. HTML5History.prototype.constructor = HTML5History;
  25002. HTML5History.prototype.go = function go (n) {
  25003. window.history.go(n);
  25004. };
  25005. HTML5History.prototype.push = function push (location, onComplete, onAbort) {
  25006. var this$1 = this;
  25007. this.transitionTo(location, function (route) {
  25008. pushState(cleanPath(this$1.base + route.fullPath));
  25009. handleScroll(this$1.router, route, this$1.current, false);
  25010. onComplete && onComplete(route);
  25011. }, onAbort);
  25012. };
  25013. HTML5History.prototype.replace = function replace (location, onComplete, onAbort) {
  25014. var this$1 = this;
  25015. this.transitionTo(location, function (route) {
  25016. replaceState(cleanPath(this$1.base + route.fullPath));
  25017. handleScroll(this$1.router, route, this$1.current, false);
  25018. onComplete && onComplete(route);
  25019. }, onAbort);
  25020. };
  25021. HTML5History.prototype.ensureURL = function ensureURL (push) {
  25022. if (getLocation(this.base) !== this.current.fullPath) {
  25023. var current = cleanPath(this.base + this.current.fullPath);
  25024. push ? pushState(current) : replaceState(current);
  25025. }
  25026. };
  25027. HTML5History.prototype.getCurrentLocation = function getCurrentLocation () {
  25028. return getLocation(this.base)
  25029. };
  25030. return HTML5History;
  25031. }(History));
  25032. function getLocation (base) {
  25033. var path = window.location.pathname;
  25034. if (base && path.indexOf(base) === 0) {
  25035. path = path.slice(base.length);
  25036. }
  25037. return (path || '/') + window.location.search + window.location.hash
  25038. }
  25039. /* */
  25040. var HashHistory = (function (History$$1) {
  25041. function HashHistory (router, base, fallback) {
  25042. History$$1.call(this, router, base);
  25043. // check history fallback deeplinking
  25044. if (fallback && checkFallback(this.base)) {
  25045. return
  25046. }
  25047. ensureSlash();
  25048. }
  25049. if ( History$$1 ) HashHistory.__proto__ = History$$1;
  25050. HashHistory.prototype = Object.create( History$$1 && History$$1.prototype );
  25051. HashHistory.prototype.constructor = HashHistory;
  25052. // this is delayed until the app mounts
  25053. // to avoid the hashchange listener being fired too early
  25054. HashHistory.prototype.setupListeners = function setupListeners () {
  25055. var this$1 = this;
  25056. window.addEventListener('hashchange', function () {
  25057. if (!ensureSlash()) {
  25058. return
  25059. }
  25060. this$1.transitionTo(getHash(), function (route) {
  25061. replaceHash(route.fullPath);
  25062. });
  25063. });
  25064. };
  25065. HashHistory.prototype.push = function push (location, onComplete, onAbort) {
  25066. this.transitionTo(location, function (route) {
  25067. pushHash(route.fullPath);
  25068. onComplete && onComplete(route);
  25069. }, onAbort);
  25070. };
  25071. HashHistory.prototype.replace = function replace (location, onComplete, onAbort) {
  25072. this.transitionTo(location, function (route) {
  25073. replaceHash(route.fullPath);
  25074. onComplete && onComplete(route);
  25075. }, onAbort);
  25076. };
  25077. HashHistory.prototype.go = function go (n) {
  25078. window.history.go(n);
  25079. };
  25080. HashHistory.prototype.ensureURL = function ensureURL (push) {
  25081. var current = this.current.fullPath;
  25082. if (getHash() !== current) {
  25083. push ? pushHash(current) : replaceHash(current);
  25084. }
  25085. };
  25086. HashHistory.prototype.getCurrentLocation = function getCurrentLocation () {
  25087. return getHash()
  25088. };
  25089. return HashHistory;
  25090. }(History));
  25091. function checkFallback (base) {
  25092. var location = getLocation(base);
  25093. if (!/^\/#/.test(location)) {
  25094. window.location.replace(
  25095. cleanPath(base + '/#' + location)
  25096. );
  25097. return true
  25098. }
  25099. }
  25100. function ensureSlash () {
  25101. var path = getHash();
  25102. if (path.charAt(0) === '/') {
  25103. return true
  25104. }
  25105. replaceHash('/' + path);
  25106. return false
  25107. }
  25108. function getHash () {
  25109. // We can't use window.location.hash here because it's not
  25110. // consistent across browsers - Firefox will pre-decode it!
  25111. var href = window.location.href;
  25112. var index = href.indexOf('#');
  25113. return index === -1 ? '' : href.slice(index + 1)
  25114. }
  25115. function pushHash (path) {
  25116. window.location.hash = path;
  25117. }
  25118. function replaceHash (path) {
  25119. var i = window.location.href.indexOf('#');
  25120. window.location.replace(
  25121. window.location.href.slice(0, i >= 0 ? i : 0) + '#' + path
  25122. );
  25123. }
  25124. /* */
  25125. var AbstractHistory = (function (History$$1) {
  25126. function AbstractHistory (router, base) {
  25127. History$$1.call(this, router, base);
  25128. this.stack = [];
  25129. this.index = -1;
  25130. }
  25131. if ( History$$1 ) AbstractHistory.__proto__ = History$$1;
  25132. AbstractHistory.prototype = Object.create( History$$1 && History$$1.prototype );
  25133. AbstractHistory.prototype.constructor = AbstractHistory;
  25134. AbstractHistory.prototype.push = function push (location, onComplete, onAbort) {
  25135. var this$1 = this;
  25136. this.transitionTo(location, function (route) {
  25137. this$1.stack = this$1.stack.slice(0, this$1.index + 1).concat(route);
  25138. this$1.index++;
  25139. onComplete && onComplete(route);
  25140. }, onAbort);
  25141. };
  25142. AbstractHistory.prototype.replace = function replace (location, onComplete, onAbort) {
  25143. var this$1 = this;
  25144. this.transitionTo(location, function (route) {
  25145. this$1.stack = this$1.stack.slice(0, this$1.index).concat(route);
  25146. onComplete && onComplete(route);
  25147. }, onAbort);
  25148. };
  25149. AbstractHistory.prototype.go = function go (n) {
  25150. var this$1 = this;
  25151. var targetIndex = this.index + n;
  25152. if (targetIndex < 0 || targetIndex >= this.stack.length) {
  25153. return
  25154. }
  25155. var route = this.stack[targetIndex];
  25156. this.confirmTransition(route, function () {
  25157. this$1.index = targetIndex;
  25158. this$1.updateRoute(route);
  25159. });
  25160. };
  25161. AbstractHistory.prototype.getCurrentLocation = function getCurrentLocation () {
  25162. var current = this.stack[this.stack.length - 1];
  25163. return current ? current.fullPath : '/'
  25164. };
  25165. AbstractHistory.prototype.ensureURL = function ensureURL () {
  25166. // noop
  25167. };
  25168. return AbstractHistory;
  25169. }(History));
  25170. /* */
  25171. var VueRouter = function VueRouter (options) {
  25172. if ( options === void 0 ) options = {};
  25173. this.app = null;
  25174. this.apps = [];
  25175. this.options = options;
  25176. this.beforeHooks = [];
  25177. this.afterHooks = [];
  25178. this.matcher = createMatcher(options.routes || []);
  25179. var mode = options.mode || 'hash';
  25180. this.fallback = mode === 'history' && !supportsPushState;
  25181. if (this.fallback) {
  25182. mode = 'hash';
  25183. }
  25184. if (!inBrowser) {
  25185. mode = 'abstract';
  25186. }
  25187. this.mode = mode;
  25188. switch (mode) {
  25189. case 'history':
  25190. this.history = new HTML5History(this, options.base);
  25191. break
  25192. case 'hash':
  25193. this.history = new HashHistory(this, options.base, this.fallback);
  25194. break
  25195. case 'abstract':
  25196. this.history = new AbstractHistory(this, options.base);
  25197. break
  25198. default:
  25199. if (process.env.NODE_ENV !== 'production') {
  25200. assert(false, ("invalid mode: " + mode));
  25201. }
  25202. }
  25203. };
  25204. var prototypeAccessors = { currentRoute: {} };
  25205. VueRouter.prototype.match = function match (
  25206. raw,
  25207. current,
  25208. redirectedFrom
  25209. ) {
  25210. return this.matcher.match(raw, current, redirectedFrom)
  25211. };
  25212. prototypeAccessors.currentRoute.get = function () {
  25213. return this.history && this.history.current
  25214. };
  25215. VueRouter.prototype.init = function init (app /* Vue component instance */) {
  25216. var this$1 = this;
  25217. process.env.NODE_ENV !== 'production' && assert(
  25218. install.installed,
  25219. "not installed. Make sure to call `Vue.use(VueRouter)` " +
  25220. "before creating root instance."
  25221. );
  25222. this.apps.push(app);
  25223. // main app already initialized.
  25224. if (this.app) {
  25225. return
  25226. }
  25227. this.app = app;
  25228. var history = this.history;
  25229. if (history instanceof HTML5History) {
  25230. history.transitionTo(history.getCurrentLocation());
  25231. } else if (history instanceof HashHistory) {
  25232. var setupHashListener = function () {
  25233. history.setupListeners();
  25234. };
  25235. history.transitionTo(
  25236. history.getCurrentLocation(),
  25237. setupHashListener,
  25238. setupHashListener
  25239. );
  25240. }
  25241. history.listen(function (route) {
  25242. this$1.apps.forEach(function (app) {
  25243. app._route = route;
  25244. });
  25245. });
  25246. };
  25247. VueRouter.prototype.beforeEach = function beforeEach (fn) {
  25248. this.beforeHooks.push(fn);
  25249. };
  25250. VueRouter.prototype.afterEach = function afterEach (fn) {
  25251. this.afterHooks.push(fn);
  25252. };
  25253. VueRouter.prototype.onReady = function onReady (cb) {
  25254. this.history.onReady(cb);
  25255. };
  25256. VueRouter.prototype.push = function push (location, onComplete, onAbort) {
  25257. this.history.push(location, onComplete, onAbort);
  25258. };
  25259. VueRouter.prototype.replace = function replace (location, onComplete, onAbort) {
  25260. this.history.replace(location, onComplete, onAbort);
  25261. };
  25262. VueRouter.prototype.go = function go (n) {
  25263. this.history.go(n);
  25264. };
  25265. VueRouter.prototype.back = function back () {
  25266. this.go(-1);
  25267. };
  25268. VueRouter.prototype.forward = function forward () {
  25269. this.go(1);
  25270. };
  25271. VueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {
  25272. var route = to
  25273. ? this.resolve(to).route
  25274. : this.currentRoute;
  25275. if (!route) {
  25276. return []
  25277. }
  25278. return [].concat.apply([], route.matched.map(function (m) {
  25279. return Object.keys(m.components).map(function (key) {
  25280. return m.components[key]
  25281. })
  25282. }))
  25283. };
  25284. VueRouter.prototype.resolve = function resolve (
  25285. to,
  25286. current,
  25287. append
  25288. ) {
  25289. var location = normalizeLocation(to, current || this.history.current, append);
  25290. var route = this.match(location, current);
  25291. var fullPath = route.redirectedFrom || route.fullPath;
  25292. var base = this.history.base;
  25293. var href = createHref(base, fullPath, this.mode);
  25294. return {
  25295. location: location,
  25296. route: route,
  25297. href: href,
  25298. // for backwards compat
  25299. normalizedTo: location,
  25300. resolved: route
  25301. }
  25302. };
  25303. VueRouter.prototype.addRoutes = function addRoutes (routes) {
  25304. this.matcher.addRoutes(routes);
  25305. if (this.history.current !== START) {
  25306. this.history.transitionTo(this.history.getCurrentLocation());
  25307. }
  25308. };
  25309. Object.defineProperties( VueRouter.prototype, prototypeAccessors );
  25310. function createHref (base, fullPath, mode) {
  25311. var path = mode === 'hash' ? '#' + fullPath : fullPath;
  25312. return base ? cleanPath(base + '/' + path) : path
  25313. }
  25314. VueRouter.install = install;
  25315. VueRouter.version = '2.2.1';
  25316. if (inBrowser && window.Vue) {
  25317. window.Vue.use(VueRouter);
  25318. }
  25319. module.exports = VueRouter;
  25320. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(113)))
  25321. /***/ }),
  25322. /* 124 */
  25323. /***/ (function(module, exports, __webpack_require__) {
  25324. "use strict";
  25325. /* WEBPACK VAR INJECTION */(function(process, global) {/*!
  25326. * Vue.js v2.1.10
  25327. * (c) 2014-2017 Evan You
  25328. * Released under the MIT License.
  25329. */
  25330. /* */
  25331. /**
  25332. * Convert a value to a string that is actually rendered.
  25333. */
  25334. function _toString (val) {
  25335. return val == null
  25336. ? ''
  25337. : typeof val === 'object'
  25338. ? JSON.stringify(val, null, 2)
  25339. : String(val)
  25340. }
  25341. /**
  25342. * Convert a input value to a number for persistence.
  25343. * If the conversion fails, return original string.
  25344. */
  25345. function toNumber (val) {
  25346. var n = parseFloat(val);
  25347. return isNaN(n) ? val : n
  25348. }
  25349. /**
  25350. * Make a map and return a function for checking if a key
  25351. * is in that map.
  25352. */
  25353. function makeMap (
  25354. str,
  25355. expectsLowerCase
  25356. ) {
  25357. var map = Object.create(null);
  25358. var list = str.split(',');
  25359. for (var i = 0; i < list.length; i++) {
  25360. map[list[i]] = true;
  25361. }
  25362. return expectsLowerCase
  25363. ? function (val) { return map[val.toLowerCase()]; }
  25364. : function (val) { return map[val]; }
  25365. }
  25366. /**
  25367. * Check if a tag is a built-in tag.
  25368. */
  25369. var isBuiltInTag = makeMap('slot,component', true);
  25370. /**
  25371. * Remove an item from an array
  25372. */
  25373. function remove$1 (arr, item) {
  25374. if (arr.length) {
  25375. var index = arr.indexOf(item);
  25376. if (index > -1) {
  25377. return arr.splice(index, 1)
  25378. }
  25379. }
  25380. }
  25381. /**
  25382. * Check whether the object has the property.
  25383. */
  25384. var hasOwnProperty = Object.prototype.hasOwnProperty;
  25385. function hasOwn (obj, key) {
  25386. return hasOwnProperty.call(obj, key)
  25387. }
  25388. /**
  25389. * Check if value is primitive
  25390. */
  25391. function isPrimitive (value) {
  25392. return typeof value === 'string' || typeof value === 'number'
  25393. }
  25394. /**
  25395. * Create a cached version of a pure function.
  25396. */
  25397. function cached (fn) {
  25398. var cache = Object.create(null);
  25399. return (function cachedFn (str) {
  25400. var hit = cache[str];
  25401. return hit || (cache[str] = fn(str))
  25402. })
  25403. }
  25404. /**
  25405. * Camelize a hyphen-delimited string.
  25406. */
  25407. var camelizeRE = /-(\w)/g;
  25408. var camelize = cached(function (str) {
  25409. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  25410. });
  25411. /**
  25412. * Capitalize a string.
  25413. */
  25414. var capitalize = cached(function (str) {
  25415. return str.charAt(0).toUpperCase() + str.slice(1)
  25416. });
  25417. /**
  25418. * Hyphenate a camelCase string.
  25419. */
  25420. var hyphenateRE = /([^-])([A-Z])/g;
  25421. var hyphenate = cached(function (str) {
  25422. return str
  25423. .replace(hyphenateRE, '$1-$2')
  25424. .replace(hyphenateRE, '$1-$2')
  25425. .toLowerCase()
  25426. });
  25427. /**
  25428. * Simple bind, faster than native
  25429. */
  25430. function bind$1 (fn, ctx) {
  25431. function boundFn (a) {
  25432. var l = arguments.length;
  25433. return l
  25434. ? l > 1
  25435. ? fn.apply(ctx, arguments)
  25436. : fn.call(ctx, a)
  25437. : fn.call(ctx)
  25438. }
  25439. // record original fn length
  25440. boundFn._length = fn.length;
  25441. return boundFn
  25442. }
  25443. /**
  25444. * Convert an Array-like object to a real Array.
  25445. */
  25446. function toArray (list, start) {
  25447. start = start || 0;
  25448. var i = list.length - start;
  25449. var ret = new Array(i);
  25450. while (i--) {
  25451. ret[i] = list[i + start];
  25452. }
  25453. return ret
  25454. }
  25455. /**
  25456. * Mix properties into target object.
  25457. */
  25458. function extend (to, _from) {
  25459. for (var key in _from) {
  25460. to[key] = _from[key];
  25461. }
  25462. return to
  25463. }
  25464. /**
  25465. * Quick object check - this is primarily used to tell
  25466. * Objects from primitive values when we know the value
  25467. * is a JSON-compliant type.
  25468. */
  25469. function isObject (obj) {
  25470. return obj !== null && typeof obj === 'object'
  25471. }
  25472. /**
  25473. * Strict object type check. Only returns true
  25474. * for plain JavaScript objects.
  25475. */
  25476. var toString = Object.prototype.toString;
  25477. var OBJECT_STRING = '[object Object]';
  25478. function isPlainObject (obj) {
  25479. return toString.call(obj) === OBJECT_STRING
  25480. }
  25481. /**
  25482. * Merge an Array of Objects into a single Object.
  25483. */
  25484. function toObject (arr) {
  25485. var res = {};
  25486. for (var i = 0; i < arr.length; i++) {
  25487. if (arr[i]) {
  25488. extend(res, arr[i]);
  25489. }
  25490. }
  25491. return res
  25492. }
  25493. /**
  25494. * Perform no operation.
  25495. */
  25496. function noop () {}
  25497. /**
  25498. * Always return false.
  25499. */
  25500. var no = function () { return false; };
  25501. /**
  25502. * Return same value
  25503. */
  25504. var identity = function (_) { return _; };
  25505. /**
  25506. * Generate a static keys string from compiler modules.
  25507. */
  25508. function genStaticKeys (modules) {
  25509. return modules.reduce(function (keys, m) {
  25510. return keys.concat(m.staticKeys || [])
  25511. }, []).join(',')
  25512. }
  25513. /**
  25514. * Check if two values are loosely equal - that is,
  25515. * if they are plain objects, do they have the same shape?
  25516. */
  25517. function looseEqual (a, b) {
  25518. var isObjectA = isObject(a);
  25519. var isObjectB = isObject(b);
  25520. if (isObjectA && isObjectB) {
  25521. return JSON.stringify(a) === JSON.stringify(b)
  25522. } else if (!isObjectA && !isObjectB) {
  25523. return String(a) === String(b)
  25524. } else {
  25525. return false
  25526. }
  25527. }
  25528. function looseIndexOf (arr, val) {
  25529. for (var i = 0; i < arr.length; i++) {
  25530. if (looseEqual(arr[i], val)) { return i }
  25531. }
  25532. return -1
  25533. }
  25534. /* */
  25535. var config = {
  25536. /**
  25537. * Option merge strategies (used in core/util/options)
  25538. */
  25539. optionMergeStrategies: Object.create(null),
  25540. /**
  25541. * Whether to suppress warnings.
  25542. */
  25543. silent: false,
  25544. /**
  25545. * Whether to enable devtools
  25546. */
  25547. devtools: process.env.NODE_ENV !== 'production',
  25548. /**
  25549. * Error handler for watcher errors
  25550. */
  25551. errorHandler: null,
  25552. /**
  25553. * Ignore certain custom elements
  25554. */
  25555. ignoredElements: [],
  25556. /**
  25557. * Custom user key aliases for v-on
  25558. */
  25559. keyCodes: Object.create(null),
  25560. /**
  25561. * Check if a tag is reserved so that it cannot be registered as a
  25562. * component. This is platform-dependent and may be overwritten.
  25563. */
  25564. isReservedTag: no,
  25565. /**
  25566. * Check if a tag is an unknown element.
  25567. * Platform-dependent.
  25568. */
  25569. isUnknownElement: no,
  25570. /**
  25571. * Get the namespace of an element
  25572. */
  25573. getTagNamespace: noop,
  25574. /**
  25575. * Parse the real tag name for the specific platform.
  25576. */
  25577. parsePlatformTagName: identity,
  25578. /**
  25579. * Check if an attribute must be bound using property, e.g. value
  25580. * Platform-dependent.
  25581. */
  25582. mustUseProp: no,
  25583. /**
  25584. * List of asset types that a component can own.
  25585. */
  25586. _assetTypes: [
  25587. 'component',
  25588. 'directive',
  25589. 'filter'
  25590. ],
  25591. /**
  25592. * List of lifecycle hooks.
  25593. */
  25594. _lifecycleHooks: [
  25595. 'beforeCreate',
  25596. 'created',
  25597. 'beforeMount',
  25598. 'mounted',
  25599. 'beforeUpdate',
  25600. 'updated',
  25601. 'beforeDestroy',
  25602. 'destroyed',
  25603. 'activated',
  25604. 'deactivated'
  25605. ],
  25606. /**
  25607. * Max circular updates allowed in a scheduler flush cycle.
  25608. */
  25609. _maxUpdateCount: 100
  25610. };
  25611. /* */
  25612. /**
  25613. * Check if a string starts with $ or _
  25614. */
  25615. function isReserved (str) {
  25616. var c = (str + '').charCodeAt(0);
  25617. return c === 0x24 || c === 0x5F
  25618. }
  25619. /**
  25620. * Define a property.
  25621. */
  25622. function def (obj, key, val, enumerable) {
  25623. Object.defineProperty(obj, key, {
  25624. value: val,
  25625. enumerable: !!enumerable,
  25626. writable: true,
  25627. configurable: true
  25628. });
  25629. }
  25630. /**
  25631. * Parse simple path.
  25632. */
  25633. var bailRE = /[^\w.$]/;
  25634. function parsePath (path) {
  25635. if (bailRE.test(path)) {
  25636. return
  25637. } else {
  25638. var segments = path.split('.');
  25639. return function (obj) {
  25640. for (var i = 0; i < segments.length; i++) {
  25641. if (!obj) { return }
  25642. obj = obj[segments[i]];
  25643. }
  25644. return obj
  25645. }
  25646. }
  25647. }
  25648. /* */
  25649. /* globals MutationObserver */
  25650. // can we use __proto__?
  25651. var hasProto = '__proto__' in {};
  25652. // Browser environment sniffing
  25653. var inBrowser = typeof window !== 'undefined';
  25654. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  25655. var isIE = UA && /msie|trident/.test(UA);
  25656. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  25657. var isEdge = UA && UA.indexOf('edge/') > 0;
  25658. var isAndroid = UA && UA.indexOf('android') > 0;
  25659. var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
  25660. // this needs to be lazy-evaled because vue may be required before
  25661. // vue-server-renderer can set VUE_ENV
  25662. var _isServer;
  25663. var isServerRendering = function () {
  25664. if (_isServer === undefined) {
  25665. /* istanbul ignore if */
  25666. if (!inBrowser && typeof global !== 'undefined') {
  25667. // detect presence of vue-server-renderer and avoid
  25668. // Webpack shimming the process
  25669. _isServer = global['process'].env.VUE_ENV === 'server';
  25670. } else {
  25671. _isServer = false;
  25672. }
  25673. }
  25674. return _isServer
  25675. };
  25676. // detect devtools
  25677. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  25678. /* istanbul ignore next */
  25679. function isNative (Ctor) {
  25680. return /native code/.test(Ctor.toString())
  25681. }
  25682. /**
  25683. * Defer a task to execute it asynchronously.
  25684. */
  25685. var nextTick = (function () {
  25686. var callbacks = [];
  25687. var pending = false;
  25688. var timerFunc;
  25689. function nextTickHandler () {
  25690. pending = false;
  25691. var copies = callbacks.slice(0);
  25692. callbacks.length = 0;
  25693. for (var i = 0; i < copies.length; i++) {
  25694. copies[i]();
  25695. }
  25696. }
  25697. // the nextTick behavior leverages the microtask queue, which can be accessed
  25698. // via either native Promise.then or MutationObserver.
  25699. // MutationObserver has wider support, however it is seriously bugged in
  25700. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  25701. // completely stops working after triggering a few times... so, if native
  25702. // Promise is available, we will use it:
  25703. /* istanbul ignore if */
  25704. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  25705. var p = Promise.resolve();
  25706. var logError = function (err) { console.error(err); };
  25707. timerFunc = function () {
  25708. p.then(nextTickHandler).catch(logError);
  25709. // in problematic UIWebViews, Promise.then doesn't completely break, but
  25710. // it can get stuck in a weird state where callbacks are pushed into the
  25711. // microtask queue but the queue isn't being flushed, until the browser
  25712. // needs to do some other work, e.g. handle a timer. Therefore we can
  25713. // "force" the microtask queue to be flushed by adding an empty timer.
  25714. if (isIOS) { setTimeout(noop); }
  25715. };
  25716. } else if (typeof MutationObserver !== 'undefined' && (
  25717. isNative(MutationObserver) ||
  25718. // PhantomJS and iOS 7.x
  25719. MutationObserver.toString() === '[object MutationObserverConstructor]'
  25720. )) {
  25721. // use MutationObserver where native Promise is not available,
  25722. // e.g. PhantomJS IE11, iOS7, Android 4.4
  25723. var counter = 1;
  25724. var observer = new MutationObserver(nextTickHandler);
  25725. var textNode = document.createTextNode(String(counter));
  25726. observer.observe(textNode, {
  25727. characterData: true
  25728. });
  25729. timerFunc = function () {
  25730. counter = (counter + 1) % 2;
  25731. textNode.data = String(counter);
  25732. };
  25733. } else {
  25734. // fallback to setTimeout
  25735. /* istanbul ignore next */
  25736. timerFunc = function () {
  25737. setTimeout(nextTickHandler, 0);
  25738. };
  25739. }
  25740. return function queueNextTick (cb, ctx) {
  25741. var _resolve;
  25742. callbacks.push(function () {
  25743. if (cb) { cb.call(ctx); }
  25744. if (_resolve) { _resolve(ctx); }
  25745. });
  25746. if (!pending) {
  25747. pending = true;
  25748. timerFunc();
  25749. }
  25750. if (!cb && typeof Promise !== 'undefined') {
  25751. return new Promise(function (resolve) {
  25752. _resolve = resolve;
  25753. })
  25754. }
  25755. }
  25756. })();
  25757. var _Set;
  25758. /* istanbul ignore if */
  25759. if (typeof Set !== 'undefined' && isNative(Set)) {
  25760. // use native Set when available.
  25761. _Set = Set;
  25762. } else {
  25763. // a non-standard Set polyfill that only works with primitive keys.
  25764. _Set = (function () {
  25765. function Set () {
  25766. this.set = Object.create(null);
  25767. }
  25768. Set.prototype.has = function has (key) {
  25769. return this.set[key] === true
  25770. };
  25771. Set.prototype.add = function add (key) {
  25772. this.set[key] = true;
  25773. };
  25774. Set.prototype.clear = function clear () {
  25775. this.set = Object.create(null);
  25776. };
  25777. return Set;
  25778. }());
  25779. }
  25780. var warn = noop;
  25781. var formatComponentName;
  25782. if (process.env.NODE_ENV !== 'production') {
  25783. var hasConsole = typeof console !== 'undefined';
  25784. warn = function (msg, vm) {
  25785. if (hasConsole && (!config.silent)) {
  25786. console.error("[Vue warn]: " + msg + " " + (
  25787. vm ? formatLocation(formatComponentName(vm)) : ''
  25788. ));
  25789. }
  25790. };
  25791. formatComponentName = function (vm) {
  25792. if (vm.$root === vm) {
  25793. return 'root instance'
  25794. }
  25795. var name = vm._isVue
  25796. ? vm.$options.name || vm.$options._componentTag
  25797. : vm.name;
  25798. return (
  25799. (name ? ("component <" + name + ">") : "anonymous component") +
  25800. (vm._isVue && vm.$options.__file ? (" at " + (vm.$options.__file)) : '')
  25801. )
  25802. };
  25803. var formatLocation = function (str) {
  25804. if (str === 'anonymous component') {
  25805. str += " - use the \"name\" option for better debugging messages.";
  25806. }
  25807. return ("\n(found in " + str + ")")
  25808. };
  25809. }
  25810. /* */
  25811. var uid$1 = 0;
  25812. /**
  25813. * A dep is an observable that can have multiple
  25814. * directives subscribing to it.
  25815. */
  25816. var Dep = function Dep () {
  25817. this.id = uid$1++;
  25818. this.subs = [];
  25819. };
  25820. Dep.prototype.addSub = function addSub (sub) {
  25821. this.subs.push(sub);
  25822. };
  25823. Dep.prototype.removeSub = function removeSub (sub) {
  25824. remove$1(this.subs, sub);
  25825. };
  25826. Dep.prototype.depend = function depend () {
  25827. if (Dep.target) {
  25828. Dep.target.addDep(this);
  25829. }
  25830. };
  25831. Dep.prototype.notify = function notify () {
  25832. // stablize the subscriber list first
  25833. var subs = this.subs.slice();
  25834. for (var i = 0, l = subs.length; i < l; i++) {
  25835. subs[i].update();
  25836. }
  25837. };
  25838. // the current target watcher being evaluated.
  25839. // this is globally unique because there could be only one
  25840. // watcher being evaluated at any time.
  25841. Dep.target = null;
  25842. var targetStack = [];
  25843. function pushTarget (_target) {
  25844. if (Dep.target) { targetStack.push(Dep.target); }
  25845. Dep.target = _target;
  25846. }
  25847. function popTarget () {
  25848. Dep.target = targetStack.pop();
  25849. }
  25850. /*
  25851. * not type checking this file because flow doesn't play well with
  25852. * dynamically accessing methods on Array prototype
  25853. */
  25854. var arrayProto = Array.prototype;
  25855. var arrayMethods = Object.create(arrayProto);[
  25856. 'push',
  25857. 'pop',
  25858. 'shift',
  25859. 'unshift',
  25860. 'splice',
  25861. 'sort',
  25862. 'reverse'
  25863. ]
  25864. .forEach(function (method) {
  25865. // cache original method
  25866. var original = arrayProto[method];
  25867. def(arrayMethods, method, function mutator () {
  25868. var arguments$1 = arguments;
  25869. // avoid leaking arguments:
  25870. // http://jsperf.com/closure-with-arguments
  25871. var i = arguments.length;
  25872. var args = new Array(i);
  25873. while (i--) {
  25874. args[i] = arguments$1[i];
  25875. }
  25876. var result = original.apply(this, args);
  25877. var ob = this.__ob__;
  25878. var inserted;
  25879. switch (method) {
  25880. case 'push':
  25881. inserted = args;
  25882. break
  25883. case 'unshift':
  25884. inserted = args;
  25885. break
  25886. case 'splice':
  25887. inserted = args.slice(2);
  25888. break
  25889. }
  25890. if (inserted) { ob.observeArray(inserted); }
  25891. // notify change
  25892. ob.dep.notify();
  25893. return result
  25894. });
  25895. });
  25896. /* */
  25897. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  25898. /**
  25899. * By default, when a reactive property is set, the new value is
  25900. * also converted to become reactive. However when passing down props,
  25901. * we don't want to force conversion because the value may be a nested value
  25902. * under a frozen data structure. Converting it would defeat the optimization.
  25903. */
  25904. var observerState = {
  25905. shouldConvert: true,
  25906. isSettingProps: false
  25907. };
  25908. /**
  25909. * Observer class that are attached to each observed
  25910. * object. Once attached, the observer converts target
  25911. * object's property keys into getter/setters that
  25912. * collect dependencies and dispatches updates.
  25913. */
  25914. var Observer = function Observer (value) {
  25915. this.value = value;
  25916. this.dep = new Dep();
  25917. this.vmCount = 0;
  25918. def(value, '__ob__', this);
  25919. if (Array.isArray(value)) {
  25920. var augment = hasProto
  25921. ? protoAugment
  25922. : copyAugment;
  25923. augment(value, arrayMethods, arrayKeys);
  25924. this.observeArray(value);
  25925. } else {
  25926. this.walk(value);
  25927. }
  25928. };
  25929. /**
  25930. * Walk through each property and convert them into
  25931. * getter/setters. This method should only be called when
  25932. * value type is Object.
  25933. */
  25934. Observer.prototype.walk = function walk (obj) {
  25935. var keys = Object.keys(obj);
  25936. for (var i = 0; i < keys.length; i++) {
  25937. defineReactive$$1(obj, keys[i], obj[keys[i]]);
  25938. }
  25939. };
  25940. /**
  25941. * Observe a list of Array items.
  25942. */
  25943. Observer.prototype.observeArray = function observeArray (items) {
  25944. for (var i = 0, l = items.length; i < l; i++) {
  25945. observe(items[i]);
  25946. }
  25947. };
  25948. // helpers
  25949. /**
  25950. * Augment an target Object or Array by intercepting
  25951. * the prototype chain using __proto__
  25952. */
  25953. function protoAugment (target, src) {
  25954. /* eslint-disable no-proto */
  25955. target.__proto__ = src;
  25956. /* eslint-enable no-proto */
  25957. }
  25958. /**
  25959. * Augment an target Object or Array by defining
  25960. * hidden properties.
  25961. */
  25962. /* istanbul ignore next */
  25963. function copyAugment (target, src, keys) {
  25964. for (var i = 0, l = keys.length; i < l; i++) {
  25965. var key = keys[i];
  25966. def(target, key, src[key]);
  25967. }
  25968. }
  25969. /**
  25970. * Attempt to create an observer instance for a value,
  25971. * returns the new observer if successfully observed,
  25972. * or the existing observer if the value already has one.
  25973. */
  25974. function observe (value, asRootData) {
  25975. if (!isObject(value)) {
  25976. return
  25977. }
  25978. var ob;
  25979. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  25980. ob = value.__ob__;
  25981. } else if (
  25982. observerState.shouldConvert &&
  25983. !isServerRendering() &&
  25984. (Array.isArray(value) || isPlainObject(value)) &&
  25985. Object.isExtensible(value) &&
  25986. !value._isVue
  25987. ) {
  25988. ob = new Observer(value);
  25989. }
  25990. if (asRootData && ob) {
  25991. ob.vmCount++;
  25992. }
  25993. return ob
  25994. }
  25995. /**
  25996. * Define a reactive property on an Object.
  25997. */
  25998. function defineReactive$$1 (
  25999. obj,
  26000. key,
  26001. val,
  26002. customSetter
  26003. ) {
  26004. var dep = new Dep();
  26005. var property = Object.getOwnPropertyDescriptor(obj, key);
  26006. if (property && property.configurable === false) {
  26007. return
  26008. }
  26009. // cater for pre-defined getter/setters
  26010. var getter = property && property.get;
  26011. var setter = property && property.set;
  26012. var childOb = observe(val);
  26013. Object.defineProperty(obj, key, {
  26014. enumerable: true,
  26015. configurable: true,
  26016. get: function reactiveGetter () {
  26017. var value = getter ? getter.call(obj) : val;
  26018. if (Dep.target) {
  26019. dep.depend();
  26020. if (childOb) {
  26021. childOb.dep.depend();
  26022. }
  26023. if (Array.isArray(value)) {
  26024. dependArray(value);
  26025. }
  26026. }
  26027. return value
  26028. },
  26029. set: function reactiveSetter (newVal) {
  26030. var value = getter ? getter.call(obj) : val;
  26031. /* eslint-disable no-self-compare */
  26032. if (newVal === value || (newVal !== newVal && value !== value)) {
  26033. return
  26034. }
  26035. /* eslint-enable no-self-compare */
  26036. if (process.env.NODE_ENV !== 'production' && customSetter) {
  26037. customSetter();
  26038. }
  26039. if (setter) {
  26040. setter.call(obj, newVal);
  26041. } else {
  26042. val = newVal;
  26043. }
  26044. childOb = observe(newVal);
  26045. dep.notify();
  26046. }
  26047. });
  26048. }
  26049. /**
  26050. * Set a property on an object. Adds the new property and
  26051. * triggers change notification if the property doesn't
  26052. * already exist.
  26053. */
  26054. function set$1 (obj, key, val) {
  26055. if (Array.isArray(obj)) {
  26056. obj.length = Math.max(obj.length, key);
  26057. obj.splice(key, 1, val);
  26058. return val
  26059. }
  26060. if (hasOwn(obj, key)) {
  26061. obj[key] = val;
  26062. return
  26063. }
  26064. var ob = obj.__ob__;
  26065. if (obj._isVue || (ob && ob.vmCount)) {
  26066. process.env.NODE_ENV !== 'production' && warn(
  26067. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  26068. 'at runtime - declare it upfront in the data option.'
  26069. );
  26070. return
  26071. }
  26072. if (!ob) {
  26073. obj[key] = val;
  26074. return
  26075. }
  26076. defineReactive$$1(ob.value, key, val);
  26077. ob.dep.notify();
  26078. return val
  26079. }
  26080. /**
  26081. * Delete a property and trigger change if necessary.
  26082. */
  26083. function del (obj, key) {
  26084. var ob = obj.__ob__;
  26085. if (obj._isVue || (ob && ob.vmCount)) {
  26086. process.env.NODE_ENV !== 'production' && warn(
  26087. 'Avoid deleting properties on a Vue instance or its root $data ' +
  26088. '- just set it to null.'
  26089. );
  26090. return
  26091. }
  26092. if (!hasOwn(obj, key)) {
  26093. return
  26094. }
  26095. delete obj[key];
  26096. if (!ob) {
  26097. return
  26098. }
  26099. ob.dep.notify();
  26100. }
  26101. /**
  26102. * Collect dependencies on array elements when the array is touched, since
  26103. * we cannot intercept array element access like property getters.
  26104. */
  26105. function dependArray (value) {
  26106. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  26107. e = value[i];
  26108. e && e.__ob__ && e.__ob__.dep.depend();
  26109. if (Array.isArray(e)) {
  26110. dependArray(e);
  26111. }
  26112. }
  26113. }
  26114. /* */
  26115. /**
  26116. * Option overwriting strategies are functions that handle
  26117. * how to merge a parent option value and a child option
  26118. * value into the final value.
  26119. */
  26120. var strats = config.optionMergeStrategies;
  26121. /**
  26122. * Options with restrictions
  26123. */
  26124. if (process.env.NODE_ENV !== 'production') {
  26125. strats.el = strats.propsData = function (parent, child, vm, key) {
  26126. if (!vm) {
  26127. warn(
  26128. "option \"" + key + "\" can only be used during instance " +
  26129. 'creation with the `new` keyword.'
  26130. );
  26131. }
  26132. return defaultStrat(parent, child)
  26133. };
  26134. }
  26135. /**
  26136. * Helper that recursively merges two data objects together.
  26137. */
  26138. function mergeData (to, from) {
  26139. if (!from) { return to }
  26140. var key, toVal, fromVal;
  26141. var keys = Object.keys(from);
  26142. for (var i = 0; i < keys.length; i++) {
  26143. key = keys[i];
  26144. toVal = to[key];
  26145. fromVal = from[key];
  26146. if (!hasOwn(to, key)) {
  26147. set$1(to, key, fromVal);
  26148. } else if (isPlainObject(toVal) && isPlainObject(fromVal)) {
  26149. mergeData(toVal, fromVal);
  26150. }
  26151. }
  26152. return to
  26153. }
  26154. /**
  26155. * Data
  26156. */
  26157. strats.data = function (
  26158. parentVal,
  26159. childVal,
  26160. vm
  26161. ) {
  26162. if (!vm) {
  26163. // in a Vue.extend merge, both should be functions
  26164. if (!childVal) {
  26165. return parentVal
  26166. }
  26167. if (typeof childVal !== 'function') {
  26168. process.env.NODE_ENV !== 'production' && warn(
  26169. 'The "data" option should be a function ' +
  26170. 'that returns a per-instance value in component ' +
  26171. 'definitions.',
  26172. vm
  26173. );
  26174. return parentVal
  26175. }
  26176. if (!parentVal) {
  26177. return childVal
  26178. }
  26179. // when parentVal & childVal are both present,
  26180. // we need to return a function that returns the
  26181. // merged result of both functions... no need to
  26182. // check if parentVal is a function here because
  26183. // it has to be a function to pass previous merges.
  26184. return function mergedDataFn () {
  26185. return mergeData(
  26186. childVal.call(this),
  26187. parentVal.call(this)
  26188. )
  26189. }
  26190. } else if (parentVal || childVal) {
  26191. return function mergedInstanceDataFn () {
  26192. // instance merge
  26193. var instanceData = typeof childVal === 'function'
  26194. ? childVal.call(vm)
  26195. : childVal;
  26196. var defaultData = typeof parentVal === 'function'
  26197. ? parentVal.call(vm)
  26198. : undefined;
  26199. if (instanceData) {
  26200. return mergeData(instanceData, defaultData)
  26201. } else {
  26202. return defaultData
  26203. }
  26204. }
  26205. }
  26206. };
  26207. /**
  26208. * Hooks and param attributes are merged as arrays.
  26209. */
  26210. function mergeHook (
  26211. parentVal,
  26212. childVal
  26213. ) {
  26214. return childVal
  26215. ? parentVal
  26216. ? parentVal.concat(childVal)
  26217. : Array.isArray(childVal)
  26218. ? childVal
  26219. : [childVal]
  26220. : parentVal
  26221. }
  26222. config._lifecycleHooks.forEach(function (hook) {
  26223. strats[hook] = mergeHook;
  26224. });
  26225. /**
  26226. * Assets
  26227. *
  26228. * When a vm is present (instance creation), we need to do
  26229. * a three-way merge between constructor options, instance
  26230. * options and parent options.
  26231. */
  26232. function mergeAssets (parentVal, childVal) {
  26233. var res = Object.create(parentVal || null);
  26234. return childVal
  26235. ? extend(res, childVal)
  26236. : res
  26237. }
  26238. config._assetTypes.forEach(function (type) {
  26239. strats[type + 's'] = mergeAssets;
  26240. });
  26241. /**
  26242. * Watchers.
  26243. *
  26244. * Watchers hashes should not overwrite one
  26245. * another, so we merge them as arrays.
  26246. */
  26247. strats.watch = function (parentVal, childVal) {
  26248. /* istanbul ignore if */
  26249. if (!childVal) { return parentVal }
  26250. if (!parentVal) { return childVal }
  26251. var ret = {};
  26252. extend(ret, parentVal);
  26253. for (var key in childVal) {
  26254. var parent = ret[key];
  26255. var child = childVal[key];
  26256. if (parent && !Array.isArray(parent)) {
  26257. parent = [parent];
  26258. }
  26259. ret[key] = parent
  26260. ? parent.concat(child)
  26261. : [child];
  26262. }
  26263. return ret
  26264. };
  26265. /**
  26266. * Other object hashes.
  26267. */
  26268. strats.props =
  26269. strats.methods =
  26270. strats.computed = function (parentVal, childVal) {
  26271. if (!childVal) { return parentVal }
  26272. if (!parentVal) { return childVal }
  26273. var ret = Object.create(null);
  26274. extend(ret, parentVal);
  26275. extend(ret, childVal);
  26276. return ret
  26277. };
  26278. /**
  26279. * Default strategy.
  26280. */
  26281. var defaultStrat = function (parentVal, childVal) {
  26282. return childVal === undefined
  26283. ? parentVal
  26284. : childVal
  26285. };
  26286. /**
  26287. * Validate component names
  26288. */
  26289. function checkComponents (options) {
  26290. for (var key in options.components) {
  26291. var lower = key.toLowerCase();
  26292. if (isBuiltInTag(lower) || config.isReservedTag(lower)) {
  26293. warn(
  26294. 'Do not use built-in or reserved HTML elements as component ' +
  26295. 'id: ' + key
  26296. );
  26297. }
  26298. }
  26299. }
  26300. /**
  26301. * Ensure all props option syntax are normalized into the
  26302. * Object-based format.
  26303. */
  26304. function normalizeProps (options) {
  26305. var props = options.props;
  26306. if (!props) { return }
  26307. var res = {};
  26308. var i, val, name;
  26309. if (Array.isArray(props)) {
  26310. i = props.length;
  26311. while (i--) {
  26312. val = props[i];
  26313. if (typeof val === 'string') {
  26314. name = camelize(val);
  26315. res[name] = { type: null };
  26316. } else if (process.env.NODE_ENV !== 'production') {
  26317. warn('props must be strings when using array syntax.');
  26318. }
  26319. }
  26320. } else if (isPlainObject(props)) {
  26321. for (var key in props) {
  26322. val = props[key];
  26323. name = camelize(key);
  26324. res[name] = isPlainObject(val)
  26325. ? val
  26326. : { type: val };
  26327. }
  26328. }
  26329. options.props = res;
  26330. }
  26331. /**
  26332. * Normalize raw function directives into object format.
  26333. */
  26334. function normalizeDirectives (options) {
  26335. var dirs = options.directives;
  26336. if (dirs) {
  26337. for (var key in dirs) {
  26338. var def = dirs[key];
  26339. if (typeof def === 'function') {
  26340. dirs[key] = { bind: def, update: def };
  26341. }
  26342. }
  26343. }
  26344. }
  26345. /**
  26346. * Merge two option objects into a new one.
  26347. * Core utility used in both instantiation and inheritance.
  26348. */
  26349. function mergeOptions (
  26350. parent,
  26351. child,
  26352. vm
  26353. ) {
  26354. if (process.env.NODE_ENV !== 'production') {
  26355. checkComponents(child);
  26356. }
  26357. normalizeProps(child);
  26358. normalizeDirectives(child);
  26359. var extendsFrom = child.extends;
  26360. if (extendsFrom) {
  26361. parent = typeof extendsFrom === 'function'
  26362. ? mergeOptions(parent, extendsFrom.options, vm)
  26363. : mergeOptions(parent, extendsFrom, vm);
  26364. }
  26365. if (child.mixins) {
  26366. for (var i = 0, l = child.mixins.length; i < l; i++) {
  26367. var mixin = child.mixins[i];
  26368. if (mixin.prototype instanceof Vue$3) {
  26369. mixin = mixin.options;
  26370. }
  26371. parent = mergeOptions(parent, mixin, vm);
  26372. }
  26373. }
  26374. var options = {};
  26375. var key;
  26376. for (key in parent) {
  26377. mergeField(key);
  26378. }
  26379. for (key in child) {
  26380. if (!hasOwn(parent, key)) {
  26381. mergeField(key);
  26382. }
  26383. }
  26384. function mergeField (key) {
  26385. var strat = strats[key] || defaultStrat;
  26386. options[key] = strat(parent[key], child[key], vm, key);
  26387. }
  26388. return options
  26389. }
  26390. /**
  26391. * Resolve an asset.
  26392. * This function is used because child instances need access
  26393. * to assets defined in its ancestor chain.
  26394. */
  26395. function resolveAsset (
  26396. options,
  26397. type,
  26398. id,
  26399. warnMissing
  26400. ) {
  26401. /* istanbul ignore if */
  26402. if (typeof id !== 'string') {
  26403. return
  26404. }
  26405. var assets = options[type];
  26406. // check local registration variations first
  26407. if (hasOwn(assets, id)) { return assets[id] }
  26408. var camelizedId = camelize(id);
  26409. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  26410. var PascalCaseId = capitalize(camelizedId);
  26411. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  26412. // fallback to prototype chain
  26413. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  26414. if (process.env.NODE_ENV !== 'production' && warnMissing && !res) {
  26415. warn(
  26416. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  26417. options
  26418. );
  26419. }
  26420. return res
  26421. }
  26422. /* */
  26423. function validateProp (
  26424. key,
  26425. propOptions,
  26426. propsData,
  26427. vm
  26428. ) {
  26429. var prop = propOptions[key];
  26430. var absent = !hasOwn(propsData, key);
  26431. var value = propsData[key];
  26432. // handle boolean props
  26433. if (isType(Boolean, prop.type)) {
  26434. if (absent && !hasOwn(prop, 'default')) {
  26435. value = false;
  26436. } else if (!isType(String, prop.type) && (value === '' || value === hyphenate(key))) {
  26437. value = true;
  26438. }
  26439. }
  26440. // check default value
  26441. if (value === undefined) {
  26442. value = getPropDefaultValue(vm, prop, key);
  26443. // since the default value is a fresh copy,
  26444. // make sure to observe it.
  26445. var prevShouldConvert = observerState.shouldConvert;
  26446. observerState.shouldConvert = true;
  26447. observe(value);
  26448. observerState.shouldConvert = prevShouldConvert;
  26449. }
  26450. if (process.env.NODE_ENV !== 'production') {
  26451. assertProp(prop, key, value, vm, absent);
  26452. }
  26453. return value
  26454. }
  26455. /**
  26456. * Get the default value of a prop.
  26457. */
  26458. function getPropDefaultValue (vm, prop, key) {
  26459. // no default, return undefined
  26460. if (!hasOwn(prop, 'default')) {
  26461. return undefined
  26462. }
  26463. var def = prop.default;
  26464. // warn against non-factory defaults for Object & Array
  26465. if (isObject(def)) {
  26466. process.env.NODE_ENV !== 'production' && warn(
  26467. 'Invalid default value for prop "' + key + '": ' +
  26468. 'Props with type Object/Array must use a factory function ' +
  26469. 'to return the default value.',
  26470. vm
  26471. );
  26472. }
  26473. // the raw prop value was also undefined from previous render,
  26474. // return previous default value to avoid unnecessary watcher trigger
  26475. if (vm && vm.$options.propsData &&
  26476. vm.$options.propsData[key] === undefined &&
  26477. vm[key] !== undefined) {
  26478. return vm[key]
  26479. }
  26480. // call factory function for non-Function types
  26481. return typeof def === 'function' && prop.type !== Function
  26482. ? def.call(vm)
  26483. : def
  26484. }
  26485. /**
  26486. * Assert whether a prop is valid.
  26487. */
  26488. function assertProp (
  26489. prop,
  26490. name,
  26491. value,
  26492. vm,
  26493. absent
  26494. ) {
  26495. if (prop.required && absent) {
  26496. warn(
  26497. 'Missing required prop: "' + name + '"',
  26498. vm
  26499. );
  26500. return
  26501. }
  26502. if (value == null && !prop.required) {
  26503. return
  26504. }
  26505. var type = prop.type;
  26506. var valid = !type || type === true;
  26507. var expectedTypes = [];
  26508. if (type) {
  26509. if (!Array.isArray(type)) {
  26510. type = [type];
  26511. }
  26512. for (var i = 0; i < type.length && !valid; i++) {
  26513. var assertedType = assertType(value, type[i]);
  26514. expectedTypes.push(assertedType.expectedType || '');
  26515. valid = assertedType.valid;
  26516. }
  26517. }
  26518. if (!valid) {
  26519. warn(
  26520. 'Invalid prop: type check failed for prop "' + name + '".' +
  26521. ' Expected ' + expectedTypes.map(capitalize).join(', ') +
  26522. ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',
  26523. vm
  26524. );
  26525. return
  26526. }
  26527. var validator = prop.validator;
  26528. if (validator) {
  26529. if (!validator(value)) {
  26530. warn(
  26531. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  26532. vm
  26533. );
  26534. }
  26535. }
  26536. }
  26537. /**
  26538. * Assert the type of a value
  26539. */
  26540. function assertType (value, type) {
  26541. var valid;
  26542. var expectedType = getType(type);
  26543. if (expectedType === 'String') {
  26544. valid = typeof value === (expectedType = 'string');
  26545. } else if (expectedType === 'Number') {
  26546. valid = typeof value === (expectedType = 'number');
  26547. } else if (expectedType === 'Boolean') {
  26548. valid = typeof value === (expectedType = 'boolean');
  26549. } else if (expectedType === 'Function') {
  26550. valid = typeof value === (expectedType = 'function');
  26551. } else if (expectedType === 'Object') {
  26552. valid = isPlainObject(value);
  26553. } else if (expectedType === 'Array') {
  26554. valid = Array.isArray(value);
  26555. } else {
  26556. valid = value instanceof type;
  26557. }
  26558. return {
  26559. valid: valid,
  26560. expectedType: expectedType
  26561. }
  26562. }
  26563. /**
  26564. * Use function string name to check built-in types,
  26565. * because a simple equality check will fail when running
  26566. * across different vms / iframes.
  26567. */
  26568. function getType (fn) {
  26569. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  26570. return match && match[1]
  26571. }
  26572. function isType (type, fn) {
  26573. if (!Array.isArray(fn)) {
  26574. return getType(fn) === getType(type)
  26575. }
  26576. for (var i = 0, len = fn.length; i < len; i++) {
  26577. if (getType(fn[i]) === getType(type)) {
  26578. return true
  26579. }
  26580. }
  26581. /* istanbul ignore next */
  26582. return false
  26583. }
  26584. var util = Object.freeze({
  26585. defineReactive: defineReactive$$1,
  26586. _toString: _toString,
  26587. toNumber: toNumber,
  26588. makeMap: makeMap,
  26589. isBuiltInTag: isBuiltInTag,
  26590. remove: remove$1,
  26591. hasOwn: hasOwn,
  26592. isPrimitive: isPrimitive,
  26593. cached: cached,
  26594. camelize: camelize,
  26595. capitalize: capitalize,
  26596. hyphenate: hyphenate,
  26597. bind: bind$1,
  26598. toArray: toArray,
  26599. extend: extend,
  26600. isObject: isObject,
  26601. isPlainObject: isPlainObject,
  26602. toObject: toObject,
  26603. noop: noop,
  26604. no: no,
  26605. identity: identity,
  26606. genStaticKeys: genStaticKeys,
  26607. looseEqual: looseEqual,
  26608. looseIndexOf: looseIndexOf,
  26609. isReserved: isReserved,
  26610. def: def,
  26611. parsePath: parsePath,
  26612. hasProto: hasProto,
  26613. inBrowser: inBrowser,
  26614. UA: UA,
  26615. isIE: isIE,
  26616. isIE9: isIE9,
  26617. isEdge: isEdge,
  26618. isAndroid: isAndroid,
  26619. isIOS: isIOS,
  26620. isServerRendering: isServerRendering,
  26621. devtools: devtools,
  26622. nextTick: nextTick,
  26623. get _Set () { return _Set; },
  26624. mergeOptions: mergeOptions,
  26625. resolveAsset: resolveAsset,
  26626. get warn () { return warn; },
  26627. get formatComponentName () { return formatComponentName; },
  26628. validateProp: validateProp
  26629. });
  26630. /* not type checking this file because flow doesn't play well with Proxy */
  26631. var initProxy;
  26632. if (process.env.NODE_ENV !== 'production') {
  26633. var allowedGlobals = makeMap(
  26634. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  26635. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  26636. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  26637. 'require' // for Webpack/Browserify
  26638. );
  26639. var warnNonPresent = function (target, key) {
  26640. warn(
  26641. "Property or method \"" + key + "\" is not defined on the instance but " +
  26642. "referenced during render. Make sure to declare reactive data " +
  26643. "properties in the data option.",
  26644. target
  26645. );
  26646. };
  26647. var hasProxy =
  26648. typeof Proxy !== 'undefined' &&
  26649. Proxy.toString().match(/native code/);
  26650. if (hasProxy) {
  26651. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta');
  26652. config.keyCodes = new Proxy(config.keyCodes, {
  26653. set: function set (target, key, value) {
  26654. if (isBuiltInModifier(key)) {
  26655. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  26656. return false
  26657. } else {
  26658. target[key] = value;
  26659. return true
  26660. }
  26661. }
  26662. });
  26663. }
  26664. var hasHandler = {
  26665. has: function has (target, key) {
  26666. var has = key in target;
  26667. var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';
  26668. if (!has && !isAllowed) {
  26669. warnNonPresent(target, key);
  26670. }
  26671. return has || !isAllowed
  26672. }
  26673. };
  26674. var getHandler = {
  26675. get: function get (target, key) {
  26676. if (typeof key === 'string' && !(key in target)) {
  26677. warnNonPresent(target, key);
  26678. }
  26679. return target[key]
  26680. }
  26681. };
  26682. initProxy = function initProxy (vm) {
  26683. if (hasProxy) {
  26684. // determine which proxy handler to use
  26685. var options = vm.$options;
  26686. var handlers = options.render && options.render._withStripped
  26687. ? getHandler
  26688. : hasHandler;
  26689. vm._renderProxy = new Proxy(vm, handlers);
  26690. } else {
  26691. vm._renderProxy = vm;
  26692. }
  26693. };
  26694. }
  26695. /* */
  26696. var VNode = function VNode (
  26697. tag,
  26698. data,
  26699. children,
  26700. text,
  26701. elm,
  26702. context,
  26703. componentOptions
  26704. ) {
  26705. this.tag = tag;
  26706. this.data = data;
  26707. this.children = children;
  26708. this.text = text;
  26709. this.elm = elm;
  26710. this.ns = undefined;
  26711. this.context = context;
  26712. this.functionalContext = undefined;
  26713. this.key = data && data.key;
  26714. this.componentOptions = componentOptions;
  26715. this.componentInstance = undefined;
  26716. this.parent = undefined;
  26717. this.raw = false;
  26718. this.isStatic = false;
  26719. this.isRootInsert = true;
  26720. this.isComment = false;
  26721. this.isCloned = false;
  26722. this.isOnce = false;
  26723. };
  26724. var prototypeAccessors = { child: {} };
  26725. // DEPRECATED: alias for componentInstance for backwards compat.
  26726. /* istanbul ignore next */
  26727. prototypeAccessors.child.get = function () {
  26728. return this.componentInstance
  26729. };
  26730. Object.defineProperties( VNode.prototype, prototypeAccessors );
  26731. var createEmptyVNode = function () {
  26732. var node = new VNode();
  26733. node.text = '';
  26734. node.isComment = true;
  26735. return node
  26736. };
  26737. function createTextVNode (val) {
  26738. return new VNode(undefined, undefined, undefined, String(val))
  26739. }
  26740. // optimized shallow clone
  26741. // used for static nodes and slot nodes because they may be reused across
  26742. // multiple renders, cloning them avoids errors when DOM manipulations rely
  26743. // on their elm reference.
  26744. function cloneVNode (vnode) {
  26745. var cloned = new VNode(
  26746. vnode.tag,
  26747. vnode.data,
  26748. vnode.children,
  26749. vnode.text,
  26750. vnode.elm,
  26751. vnode.context,
  26752. vnode.componentOptions
  26753. );
  26754. cloned.ns = vnode.ns;
  26755. cloned.isStatic = vnode.isStatic;
  26756. cloned.key = vnode.key;
  26757. cloned.isCloned = true;
  26758. return cloned
  26759. }
  26760. function cloneVNodes (vnodes) {
  26761. var res = new Array(vnodes.length);
  26762. for (var i = 0; i < vnodes.length; i++) {
  26763. res[i] = cloneVNode(vnodes[i]);
  26764. }
  26765. return res
  26766. }
  26767. /* */
  26768. var hooks = { init: init, prepatch: prepatch, insert: insert, destroy: destroy$1 };
  26769. var hooksToMerge = Object.keys(hooks);
  26770. function createComponent (
  26771. Ctor,
  26772. data,
  26773. context,
  26774. children,
  26775. tag
  26776. ) {
  26777. if (!Ctor) {
  26778. return
  26779. }
  26780. var baseCtor = context.$options._base;
  26781. if (isObject(Ctor)) {
  26782. Ctor = baseCtor.extend(Ctor);
  26783. }
  26784. if (typeof Ctor !== 'function') {
  26785. if (process.env.NODE_ENV !== 'production') {
  26786. warn(("Invalid Component definition: " + (String(Ctor))), context);
  26787. }
  26788. return
  26789. }
  26790. // async component
  26791. if (!Ctor.cid) {
  26792. if (Ctor.resolved) {
  26793. Ctor = Ctor.resolved;
  26794. } else {
  26795. Ctor = resolveAsyncComponent(Ctor, baseCtor, function () {
  26796. // it's ok to queue this on every render because
  26797. // $forceUpdate is buffered by the scheduler.
  26798. context.$forceUpdate();
  26799. });
  26800. if (!Ctor) {
  26801. // return nothing if this is indeed an async component
  26802. // wait for the callback to trigger parent update.
  26803. return
  26804. }
  26805. }
  26806. }
  26807. // resolve constructor options in case global mixins are applied after
  26808. // component constructor creation
  26809. resolveConstructorOptions(Ctor);
  26810. data = data || {};
  26811. // extract props
  26812. var propsData = extractProps(data, Ctor);
  26813. // functional component
  26814. if (Ctor.options.functional) {
  26815. return createFunctionalComponent(Ctor, propsData, data, context, children)
  26816. }
  26817. // extract listeners, since these needs to be treated as
  26818. // child component listeners instead of DOM listeners
  26819. var listeners = data.on;
  26820. // replace with listeners with .native modifier
  26821. data.on = data.nativeOn;
  26822. if (Ctor.options.abstract) {
  26823. // abstract components do not keep anything
  26824. // other than props & listeners
  26825. data = {};
  26826. }
  26827. // merge component management hooks onto the placeholder node
  26828. mergeHooks(data);
  26829. // return a placeholder vnode
  26830. var name = Ctor.options.name || tag;
  26831. var vnode = new VNode(
  26832. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  26833. data, undefined, undefined, undefined, context,
  26834. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }
  26835. );
  26836. return vnode
  26837. }
  26838. function createFunctionalComponent (
  26839. Ctor,
  26840. propsData,
  26841. data,
  26842. context,
  26843. children
  26844. ) {
  26845. var props = {};
  26846. var propOptions = Ctor.options.props;
  26847. if (propOptions) {
  26848. for (var key in propOptions) {
  26849. props[key] = validateProp(key, propOptions, propsData);
  26850. }
  26851. }
  26852. // ensure the createElement function in functional components
  26853. // gets a unique context - this is necessary for correct named slot check
  26854. var _context = Object.create(context);
  26855. var h = function (a, b, c, d) { return createElement(_context, a, b, c, d, true); };
  26856. var vnode = Ctor.options.render.call(null, h, {
  26857. props: props,
  26858. data: data,
  26859. parent: context,
  26860. children: children,
  26861. slots: function () { return resolveSlots(children, context); }
  26862. });
  26863. if (vnode instanceof VNode) {
  26864. vnode.functionalContext = context;
  26865. if (data.slot) {
  26866. (vnode.data || (vnode.data = {})).slot = data.slot;
  26867. }
  26868. }
  26869. return vnode
  26870. }
  26871. function createComponentInstanceForVnode (
  26872. vnode, // we know it's MountedComponentVNode but flow doesn't
  26873. parent, // activeInstance in lifecycle state
  26874. parentElm,
  26875. refElm
  26876. ) {
  26877. var vnodeComponentOptions = vnode.componentOptions;
  26878. var options = {
  26879. _isComponent: true,
  26880. parent: parent,
  26881. propsData: vnodeComponentOptions.propsData,
  26882. _componentTag: vnodeComponentOptions.tag,
  26883. _parentVnode: vnode,
  26884. _parentListeners: vnodeComponentOptions.listeners,
  26885. _renderChildren: vnodeComponentOptions.children,
  26886. _parentElm: parentElm || null,
  26887. _refElm: refElm || null
  26888. };
  26889. // check inline-template render functions
  26890. var inlineTemplate = vnode.data.inlineTemplate;
  26891. if (inlineTemplate) {
  26892. options.render = inlineTemplate.render;
  26893. options.staticRenderFns = inlineTemplate.staticRenderFns;
  26894. }
  26895. return new vnodeComponentOptions.Ctor(options)
  26896. }
  26897. function init (
  26898. vnode,
  26899. hydrating,
  26900. parentElm,
  26901. refElm
  26902. ) {
  26903. if (!vnode.componentInstance || vnode.componentInstance._isDestroyed) {
  26904. var child = vnode.componentInstance = createComponentInstanceForVnode(
  26905. vnode,
  26906. activeInstance,
  26907. parentElm,
  26908. refElm
  26909. );
  26910. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  26911. } else if (vnode.data.keepAlive) {
  26912. // kept-alive components, treat as a patch
  26913. var mountedNode = vnode; // work around flow
  26914. prepatch(mountedNode, mountedNode);
  26915. }
  26916. }
  26917. function prepatch (
  26918. oldVnode,
  26919. vnode
  26920. ) {
  26921. var options = vnode.componentOptions;
  26922. var child = vnode.componentInstance = oldVnode.componentInstance;
  26923. child._updateFromParent(
  26924. options.propsData, // updated props
  26925. options.listeners, // updated listeners
  26926. vnode, // new parent vnode
  26927. options.children // new children
  26928. );
  26929. }
  26930. function insert (vnode) {
  26931. if (!vnode.componentInstance._isMounted) {
  26932. vnode.componentInstance._isMounted = true;
  26933. callHook(vnode.componentInstance, 'mounted');
  26934. }
  26935. if (vnode.data.keepAlive) {
  26936. vnode.componentInstance._inactive = false;
  26937. callHook(vnode.componentInstance, 'activated');
  26938. }
  26939. }
  26940. function destroy$1 (vnode) {
  26941. if (!vnode.componentInstance._isDestroyed) {
  26942. if (!vnode.data.keepAlive) {
  26943. vnode.componentInstance.$destroy();
  26944. } else {
  26945. vnode.componentInstance._inactive = true;
  26946. callHook(vnode.componentInstance, 'deactivated');
  26947. }
  26948. }
  26949. }
  26950. function resolveAsyncComponent (
  26951. factory,
  26952. baseCtor,
  26953. cb
  26954. ) {
  26955. if (factory.requested) {
  26956. // pool callbacks
  26957. factory.pendingCallbacks.push(cb);
  26958. } else {
  26959. factory.requested = true;
  26960. var cbs = factory.pendingCallbacks = [cb];
  26961. var sync = true;
  26962. var resolve = function (res) {
  26963. if (isObject(res)) {
  26964. res = baseCtor.extend(res);
  26965. }
  26966. // cache resolved
  26967. factory.resolved = res;
  26968. // invoke callbacks only if this is not a synchronous resolve
  26969. // (async resolves are shimmed as synchronous during SSR)
  26970. if (!sync) {
  26971. for (var i = 0, l = cbs.length; i < l; i++) {
  26972. cbs[i](res);
  26973. }
  26974. }
  26975. };
  26976. var reject = function (reason) {
  26977. process.env.NODE_ENV !== 'production' && warn(
  26978. "Failed to resolve async component: " + (String(factory)) +
  26979. (reason ? ("\nReason: " + reason) : '')
  26980. );
  26981. };
  26982. var res = factory(resolve, reject);
  26983. // handle promise
  26984. if (res && typeof res.then === 'function' && !factory.resolved) {
  26985. res.then(resolve, reject);
  26986. }
  26987. sync = false;
  26988. // return in case resolved synchronously
  26989. return factory.resolved
  26990. }
  26991. }
  26992. function extractProps (data, Ctor) {
  26993. // we are only extracting raw values here.
  26994. // validation and default values are handled in the child
  26995. // component itself.
  26996. var propOptions = Ctor.options.props;
  26997. if (!propOptions) {
  26998. return
  26999. }
  27000. var res = {};
  27001. var attrs = data.attrs;
  27002. var props = data.props;
  27003. var domProps = data.domProps;
  27004. if (attrs || props || domProps) {
  27005. for (var key in propOptions) {
  27006. var altKey = hyphenate(key);
  27007. checkProp(res, props, key, altKey, true) ||
  27008. checkProp(res, attrs, key, altKey) ||
  27009. checkProp(res, domProps, key, altKey);
  27010. }
  27011. }
  27012. return res
  27013. }
  27014. function checkProp (
  27015. res,
  27016. hash,
  27017. key,
  27018. altKey,
  27019. preserve
  27020. ) {
  27021. if (hash) {
  27022. if (hasOwn(hash, key)) {
  27023. res[key] = hash[key];
  27024. if (!preserve) {
  27025. delete hash[key];
  27026. }
  27027. return true
  27028. } else if (hasOwn(hash, altKey)) {
  27029. res[key] = hash[altKey];
  27030. if (!preserve) {
  27031. delete hash[altKey];
  27032. }
  27033. return true
  27034. }
  27035. }
  27036. return false
  27037. }
  27038. function mergeHooks (data) {
  27039. if (!data.hook) {
  27040. data.hook = {};
  27041. }
  27042. for (var i = 0; i < hooksToMerge.length; i++) {
  27043. var key = hooksToMerge[i];
  27044. var fromParent = data.hook[key];
  27045. var ours = hooks[key];
  27046. data.hook[key] = fromParent ? mergeHook$1(ours, fromParent) : ours;
  27047. }
  27048. }
  27049. function mergeHook$1 (one, two) {
  27050. return function (a, b, c, d) {
  27051. one(a, b, c, d);
  27052. two(a, b, c, d);
  27053. }
  27054. }
  27055. /* */
  27056. function mergeVNodeHook (def, hookKey, hook, key) {
  27057. key = key + hookKey;
  27058. var injectedHash = def.__injected || (def.__injected = {});
  27059. if (!injectedHash[key]) {
  27060. injectedHash[key] = true;
  27061. var oldHook = def[hookKey];
  27062. if (oldHook) {
  27063. def[hookKey] = function () {
  27064. oldHook.apply(this, arguments);
  27065. hook.apply(this, arguments);
  27066. };
  27067. } else {
  27068. def[hookKey] = hook;
  27069. }
  27070. }
  27071. }
  27072. /* */
  27073. var normalizeEvent = cached(function (name) {
  27074. var once = name.charAt(0) === '~'; // Prefixed last, checked first
  27075. name = once ? name.slice(1) : name;
  27076. var capture = name.charAt(0) === '!';
  27077. name = capture ? name.slice(1) : name;
  27078. return {
  27079. name: name,
  27080. once: once,
  27081. capture: capture
  27082. }
  27083. });
  27084. function createEventHandle (fn) {
  27085. var handle = {
  27086. fn: fn,
  27087. invoker: function () {
  27088. var arguments$1 = arguments;
  27089. var fn = handle.fn;
  27090. if (Array.isArray(fn)) {
  27091. for (var i = 0; i < fn.length; i++) {
  27092. fn[i].apply(null, arguments$1);
  27093. }
  27094. } else {
  27095. fn.apply(null, arguments);
  27096. }
  27097. }
  27098. };
  27099. return handle
  27100. }
  27101. function updateListeners (
  27102. on,
  27103. oldOn,
  27104. add,
  27105. remove$$1,
  27106. vm
  27107. ) {
  27108. var name, cur, old, event;
  27109. for (name in on) {
  27110. cur = on[name];
  27111. old = oldOn[name];
  27112. event = normalizeEvent(name);
  27113. if (!cur) {
  27114. process.env.NODE_ENV !== 'production' && warn(
  27115. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  27116. vm
  27117. );
  27118. } else if (!old) {
  27119. if (!cur.invoker) {
  27120. cur = on[name] = createEventHandle(cur);
  27121. }
  27122. add(event.name, cur.invoker, event.once, event.capture);
  27123. } else if (cur !== old) {
  27124. old.fn = cur;
  27125. on[name] = old;
  27126. }
  27127. }
  27128. for (name in oldOn) {
  27129. if (!on[name]) {
  27130. event = normalizeEvent(name);
  27131. remove$$1(event.name, oldOn[name].invoker, event.capture);
  27132. }
  27133. }
  27134. }
  27135. /* */
  27136. // The template compiler attempts to minimize the need for normalization by
  27137. // statically analyzing the template at compile time.
  27138. //
  27139. // For plain HTML markup, normalization can be completely skipped because the
  27140. // generated render function is guaranteed to return Array<VNode>. There are
  27141. // two cases where extra normalization is needed:
  27142. // 1. When the children contains components - because a functional component
  27143. // may return an Array instead of a single root. In this case, just a simple
  27144. // nomralization is needed - if any child is an Array, we flatten the whole
  27145. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  27146. // because functional components already normalize their own children.
  27147. function simpleNormalizeChildren (children) {
  27148. for (var i = 0; i < children.length; i++) {
  27149. if (Array.isArray(children[i])) {
  27150. return Array.prototype.concat.apply([], children)
  27151. }
  27152. }
  27153. return children
  27154. }
  27155. // 2. When the children contains constrcuts that always generated nested Arrays,
  27156. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  27157. // with hand-written render functions / JSX. In such cases a full normalization
  27158. // is needed to cater to all possible types of children values.
  27159. function normalizeChildren (children) {
  27160. return isPrimitive(children)
  27161. ? [createTextVNode(children)]
  27162. : Array.isArray(children)
  27163. ? normalizeArrayChildren(children)
  27164. : undefined
  27165. }
  27166. function normalizeArrayChildren (children, nestedIndex) {
  27167. var res = [];
  27168. var i, c, last;
  27169. for (i = 0; i < children.length; i++) {
  27170. c = children[i];
  27171. if (c == null || typeof c === 'boolean') { continue }
  27172. last = res[res.length - 1];
  27173. // nested
  27174. if (Array.isArray(c)) {
  27175. res.push.apply(res, normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i)));
  27176. } else if (isPrimitive(c)) {
  27177. if (last && last.text) {
  27178. last.text += String(c);
  27179. } else if (c !== '') {
  27180. // convert primitive to vnode
  27181. res.push(createTextVNode(c));
  27182. }
  27183. } else {
  27184. if (c.text && last && last.text) {
  27185. res[res.length - 1] = createTextVNode(last.text + c.text);
  27186. } else {
  27187. // default key for nested array children (likely generated by v-for)
  27188. if (c.tag && c.key == null && nestedIndex != null) {
  27189. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  27190. }
  27191. res.push(c);
  27192. }
  27193. }
  27194. }
  27195. return res
  27196. }
  27197. /* */
  27198. function getFirstComponentChild (children) {
  27199. return children && children.filter(function (c) { return c && c.componentOptions; })[0]
  27200. }
  27201. /* */
  27202. var SIMPLE_NORMALIZE = 1;
  27203. var ALWAYS_NORMALIZE = 2;
  27204. // wrapper function for providing a more flexible interface
  27205. // without getting yelled at by flow
  27206. function createElement (
  27207. context,
  27208. tag,
  27209. data,
  27210. children,
  27211. normalizationType,
  27212. alwaysNormalize
  27213. ) {
  27214. if (Array.isArray(data) || isPrimitive(data)) {
  27215. normalizationType = children;
  27216. children = data;
  27217. data = undefined;
  27218. }
  27219. if (alwaysNormalize) { normalizationType = ALWAYS_NORMALIZE; }
  27220. return _createElement(context, tag, data, children, normalizationType)
  27221. }
  27222. function _createElement (
  27223. context,
  27224. tag,
  27225. data,
  27226. children,
  27227. normalizationType
  27228. ) {
  27229. if (data && data.__ob__) {
  27230. process.env.NODE_ENV !== 'production' && warn(
  27231. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  27232. 'Always create fresh vnode data objects in each render!',
  27233. context
  27234. );
  27235. return createEmptyVNode()
  27236. }
  27237. if (!tag) {
  27238. // in case of component :is set to falsy value
  27239. return createEmptyVNode()
  27240. }
  27241. // support single function children as default scoped slot
  27242. if (Array.isArray(children) &&
  27243. typeof children[0] === 'function') {
  27244. data = data || {};
  27245. data.scopedSlots = { default: children[0] };
  27246. children.length = 0;
  27247. }
  27248. if (normalizationType === ALWAYS_NORMALIZE) {
  27249. children = normalizeChildren(children);
  27250. } else if (normalizationType === SIMPLE_NORMALIZE) {
  27251. children = simpleNormalizeChildren(children);
  27252. }
  27253. var vnode, ns;
  27254. if (typeof tag === 'string') {
  27255. var Ctor;
  27256. ns = config.getTagNamespace(tag);
  27257. if (config.isReservedTag(tag)) {
  27258. // platform built-in elements
  27259. vnode = new VNode(
  27260. config.parsePlatformTagName(tag), data, children,
  27261. undefined, undefined, context
  27262. );
  27263. } else if ((Ctor = resolveAsset(context.$options, 'components', tag))) {
  27264. // component
  27265. vnode = createComponent(Ctor, data, context, children, tag);
  27266. } else {
  27267. // unknown or unlisted namespaced elements
  27268. // check at runtime because it may get assigned a namespace when its
  27269. // parent normalizes children
  27270. vnode = new VNode(
  27271. tag, data, children,
  27272. undefined, undefined, context
  27273. );
  27274. }
  27275. } else {
  27276. // direct component options / constructor
  27277. vnode = createComponent(tag, data, context, children);
  27278. }
  27279. if (vnode) {
  27280. if (ns) { applyNS(vnode, ns); }
  27281. return vnode
  27282. } else {
  27283. return createEmptyVNode()
  27284. }
  27285. }
  27286. function applyNS (vnode, ns) {
  27287. vnode.ns = ns;
  27288. if (vnode.tag === 'foreignObject') {
  27289. // use default namespace inside foreignObject
  27290. return
  27291. }
  27292. if (vnode.children) {
  27293. for (var i = 0, l = vnode.children.length; i < l; i++) {
  27294. var child = vnode.children[i];
  27295. if (child.tag && !child.ns) {
  27296. applyNS(child, ns);
  27297. }
  27298. }
  27299. }
  27300. }
  27301. /* */
  27302. function initRender (vm) {
  27303. vm.$vnode = null; // the placeholder node in parent tree
  27304. vm._vnode = null; // the root of the child tree
  27305. vm._staticTrees = null;
  27306. var parentVnode = vm.$options._parentVnode;
  27307. var renderContext = parentVnode && parentVnode.context;
  27308. vm.$slots = resolveSlots(vm.$options._renderChildren, renderContext);
  27309. vm.$scopedSlots = {};
  27310. // bind the createElement fn to this instance
  27311. // so that we get proper render context inside it.
  27312. // args order: tag, data, children, normalizationType, alwaysNormalize
  27313. // internal version is used by render functions compiled from templates
  27314. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  27315. // normalization is always applied for the public version, used in
  27316. // user-written render functions.
  27317. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  27318. }
  27319. function renderMixin (Vue) {
  27320. Vue.prototype.$nextTick = function (fn) {
  27321. return nextTick(fn, this)
  27322. };
  27323. Vue.prototype._render = function () {
  27324. var vm = this;
  27325. var ref = vm.$options;
  27326. var render = ref.render;
  27327. var staticRenderFns = ref.staticRenderFns;
  27328. var _parentVnode = ref._parentVnode;
  27329. if (vm._isMounted) {
  27330. // clone slot nodes on re-renders
  27331. for (var key in vm.$slots) {
  27332. vm.$slots[key] = cloneVNodes(vm.$slots[key]);
  27333. }
  27334. }
  27335. if (_parentVnode && _parentVnode.data.scopedSlots) {
  27336. vm.$scopedSlots = _parentVnode.data.scopedSlots;
  27337. }
  27338. if (staticRenderFns && !vm._staticTrees) {
  27339. vm._staticTrees = [];
  27340. }
  27341. // set parent vnode. this allows render functions to have access
  27342. // to the data on the placeholder node.
  27343. vm.$vnode = _parentVnode;
  27344. // render self
  27345. var vnode;
  27346. try {
  27347. vnode = render.call(vm._renderProxy, vm.$createElement);
  27348. } catch (e) {
  27349. /* istanbul ignore else */
  27350. if (config.errorHandler) {
  27351. config.errorHandler.call(null, e, vm);
  27352. } else {
  27353. if (process.env.NODE_ENV !== 'production') {
  27354. warn(("Error when rendering " + (formatComponentName(vm)) + ":"));
  27355. }
  27356. throw e
  27357. }
  27358. // return previous vnode to prevent render error causing blank component
  27359. vnode = vm._vnode;
  27360. }
  27361. // return empty vnode in case the render function errored out
  27362. if (!(vnode instanceof VNode)) {
  27363. if (process.env.NODE_ENV !== 'production' && Array.isArray(vnode)) {
  27364. warn(
  27365. 'Multiple root nodes returned from render function. Render function ' +
  27366. 'should return a single root node.',
  27367. vm
  27368. );
  27369. }
  27370. vnode = createEmptyVNode();
  27371. }
  27372. // set parent
  27373. vnode.parent = _parentVnode;
  27374. return vnode
  27375. };
  27376. // toString for mustaches
  27377. Vue.prototype._s = _toString;
  27378. // convert text to vnode
  27379. Vue.prototype._v = createTextVNode;
  27380. // number conversion
  27381. Vue.prototype._n = toNumber;
  27382. // empty vnode
  27383. Vue.prototype._e = createEmptyVNode;
  27384. // loose equal
  27385. Vue.prototype._q = looseEqual;
  27386. // loose indexOf
  27387. Vue.prototype._i = looseIndexOf;
  27388. // render static tree by index
  27389. Vue.prototype._m = function renderStatic (
  27390. index,
  27391. isInFor
  27392. ) {
  27393. var tree = this._staticTrees[index];
  27394. // if has already-rendered static tree and not inside v-for,
  27395. // we can reuse the same tree by doing a shallow clone.
  27396. if (tree && !isInFor) {
  27397. return Array.isArray(tree)
  27398. ? cloneVNodes(tree)
  27399. : cloneVNode(tree)
  27400. }
  27401. // otherwise, render a fresh tree.
  27402. tree = this._staticTrees[index] = this.$options.staticRenderFns[index].call(this._renderProxy);
  27403. markStatic(tree, ("__static__" + index), false);
  27404. return tree
  27405. };
  27406. // mark node as static (v-once)
  27407. Vue.prototype._o = function markOnce (
  27408. tree,
  27409. index,
  27410. key
  27411. ) {
  27412. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  27413. return tree
  27414. };
  27415. function markStatic (tree, key, isOnce) {
  27416. if (Array.isArray(tree)) {
  27417. for (var i = 0; i < tree.length; i++) {
  27418. if (tree[i] && typeof tree[i] !== 'string') {
  27419. markStaticNode(tree[i], (key + "_" + i), isOnce);
  27420. }
  27421. }
  27422. } else {
  27423. markStaticNode(tree, key, isOnce);
  27424. }
  27425. }
  27426. function markStaticNode (node, key, isOnce) {
  27427. node.isStatic = true;
  27428. node.key = key;
  27429. node.isOnce = isOnce;
  27430. }
  27431. // filter resolution helper
  27432. Vue.prototype._f = function resolveFilter (id) {
  27433. return resolveAsset(this.$options, 'filters', id, true) || identity
  27434. };
  27435. // render v-for
  27436. Vue.prototype._l = function renderList (
  27437. val,
  27438. render
  27439. ) {
  27440. var ret, i, l, keys, key;
  27441. if (Array.isArray(val) || typeof val === 'string') {
  27442. ret = new Array(val.length);
  27443. for (i = 0, l = val.length; i < l; i++) {
  27444. ret[i] = render(val[i], i);
  27445. }
  27446. } else if (typeof val === 'number') {
  27447. ret = new Array(val);
  27448. for (i = 0; i < val; i++) {
  27449. ret[i] = render(i + 1, i);
  27450. }
  27451. } else if (isObject(val)) {
  27452. keys = Object.keys(val);
  27453. ret = new Array(keys.length);
  27454. for (i = 0, l = keys.length; i < l; i++) {
  27455. key = keys[i];
  27456. ret[i] = render(val[key], key, i);
  27457. }
  27458. }
  27459. return ret
  27460. };
  27461. // renderSlot
  27462. Vue.prototype._t = function (
  27463. name,
  27464. fallback,
  27465. props,
  27466. bindObject
  27467. ) {
  27468. var scopedSlotFn = this.$scopedSlots[name];
  27469. if (scopedSlotFn) { // scoped slot
  27470. props = props || {};
  27471. if (bindObject) {
  27472. extend(props, bindObject);
  27473. }
  27474. return scopedSlotFn(props) || fallback
  27475. } else {
  27476. var slotNodes = this.$slots[name];
  27477. // warn duplicate slot usage
  27478. if (slotNodes && process.env.NODE_ENV !== 'production') {
  27479. slotNodes._rendered && warn(
  27480. "Duplicate presence of slot \"" + name + "\" found in the same render tree " +
  27481. "- this will likely cause render errors.",
  27482. this
  27483. );
  27484. slotNodes._rendered = true;
  27485. }
  27486. return slotNodes || fallback
  27487. }
  27488. };
  27489. // apply v-bind object
  27490. Vue.prototype._b = function bindProps (
  27491. data,
  27492. tag,
  27493. value,
  27494. asProp
  27495. ) {
  27496. if (value) {
  27497. if (!isObject(value)) {
  27498. process.env.NODE_ENV !== 'production' && warn(
  27499. 'v-bind without argument expects an Object or Array value',
  27500. this
  27501. );
  27502. } else {
  27503. if (Array.isArray(value)) {
  27504. value = toObject(value);
  27505. }
  27506. for (var key in value) {
  27507. if (key === 'class' || key === 'style') {
  27508. data[key] = value[key];
  27509. } else {
  27510. var type = data.attrs && data.attrs.type;
  27511. var hash = asProp || config.mustUseProp(tag, type, key)
  27512. ? data.domProps || (data.domProps = {})
  27513. : data.attrs || (data.attrs = {});
  27514. hash[key] = value[key];
  27515. }
  27516. }
  27517. }
  27518. }
  27519. return data
  27520. };
  27521. // check v-on keyCodes
  27522. Vue.prototype._k = function checkKeyCodes (
  27523. eventKeyCode,
  27524. key,
  27525. builtInAlias
  27526. ) {
  27527. var keyCodes = config.keyCodes[key] || builtInAlias;
  27528. if (Array.isArray(keyCodes)) {
  27529. return keyCodes.indexOf(eventKeyCode) === -1
  27530. } else {
  27531. return keyCodes !== eventKeyCode
  27532. }
  27533. };
  27534. }
  27535. function resolveSlots (
  27536. children,
  27537. context
  27538. ) {
  27539. var slots = {};
  27540. if (!children) {
  27541. return slots
  27542. }
  27543. var defaultSlot = [];
  27544. var name, child;
  27545. for (var i = 0, l = children.length; i < l; i++) {
  27546. child = children[i];
  27547. // named slots should only be respected if the vnode was rendered in the
  27548. // same context.
  27549. if ((child.context === context || child.functionalContext === context) &&
  27550. child.data && (name = child.data.slot)) {
  27551. var slot = (slots[name] || (slots[name] = []));
  27552. if (child.tag === 'template') {
  27553. slot.push.apply(slot, child.children);
  27554. } else {
  27555. slot.push(child);
  27556. }
  27557. } else {
  27558. defaultSlot.push(child);
  27559. }
  27560. }
  27561. // ignore single whitespace
  27562. if (defaultSlot.length && !(
  27563. defaultSlot.length === 1 &&
  27564. (defaultSlot[0].text === ' ' || defaultSlot[0].isComment)
  27565. )) {
  27566. slots.default = defaultSlot;
  27567. }
  27568. return slots
  27569. }
  27570. /* */
  27571. function initEvents (vm) {
  27572. vm._events = Object.create(null);
  27573. vm._hasHookEvent = false;
  27574. // init parent attached events
  27575. var listeners = vm.$options._parentListeners;
  27576. if (listeners) {
  27577. updateComponentListeners(vm, listeners);
  27578. }
  27579. }
  27580. var target;
  27581. function add$1 (event, fn, once) {
  27582. if (once) {
  27583. target.$once(event, fn);
  27584. } else {
  27585. target.$on(event, fn);
  27586. }
  27587. }
  27588. function remove$2 (event, fn) {
  27589. target.$off(event, fn);
  27590. }
  27591. function updateComponentListeners (
  27592. vm,
  27593. listeners,
  27594. oldListeners
  27595. ) {
  27596. target = vm;
  27597. updateListeners(listeners, oldListeners || {}, add$1, remove$2, vm);
  27598. }
  27599. function eventsMixin (Vue) {
  27600. var hookRE = /^hook:/;
  27601. Vue.prototype.$on = function (event, fn) {
  27602. var vm = this;(vm._events[event] || (vm._events[event] = [])).push(fn);
  27603. // optimize hook:event cost by using a boolean flag marked at registration
  27604. // instead of a hash lookup
  27605. if (hookRE.test(event)) {
  27606. vm._hasHookEvent = true;
  27607. }
  27608. return vm
  27609. };
  27610. Vue.prototype.$once = function (event, fn) {
  27611. var vm = this;
  27612. function on () {
  27613. vm.$off(event, on);
  27614. fn.apply(vm, arguments);
  27615. }
  27616. on.fn = fn;
  27617. vm.$on(event, on);
  27618. return vm
  27619. };
  27620. Vue.prototype.$off = function (event, fn) {
  27621. var vm = this;
  27622. // all
  27623. if (!arguments.length) {
  27624. vm._events = Object.create(null);
  27625. return vm
  27626. }
  27627. // specific event
  27628. var cbs = vm._events[event];
  27629. if (!cbs) {
  27630. return vm
  27631. }
  27632. if (arguments.length === 1) {
  27633. vm._events[event] = null;
  27634. return vm
  27635. }
  27636. // specific handler
  27637. var cb;
  27638. var i = cbs.length;
  27639. while (i--) {
  27640. cb = cbs[i];
  27641. if (cb === fn || cb.fn === fn) {
  27642. cbs.splice(i, 1);
  27643. break
  27644. }
  27645. }
  27646. return vm
  27647. };
  27648. Vue.prototype.$emit = function (event) {
  27649. var vm = this;
  27650. var cbs = vm._events[event];
  27651. if (cbs) {
  27652. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  27653. var args = toArray(arguments, 1);
  27654. for (var i = 0, l = cbs.length; i < l; i++) {
  27655. cbs[i].apply(vm, args);
  27656. }
  27657. }
  27658. return vm
  27659. };
  27660. }
  27661. /* */
  27662. var activeInstance = null;
  27663. function initLifecycle (vm) {
  27664. var options = vm.$options;
  27665. // locate first non-abstract parent
  27666. var parent = options.parent;
  27667. if (parent && !options.abstract) {
  27668. while (parent.$options.abstract && parent.$parent) {
  27669. parent = parent.$parent;
  27670. }
  27671. parent.$children.push(vm);
  27672. }
  27673. vm.$parent = parent;
  27674. vm.$root = parent ? parent.$root : vm;
  27675. vm.$children = [];
  27676. vm.$refs = {};
  27677. vm._watcher = null;
  27678. vm._inactive = false;
  27679. vm._isMounted = false;
  27680. vm._isDestroyed = false;
  27681. vm._isBeingDestroyed = false;
  27682. }
  27683. function lifecycleMixin (Vue) {
  27684. Vue.prototype._mount = function (
  27685. el,
  27686. hydrating
  27687. ) {
  27688. var vm = this;
  27689. vm.$el = el;
  27690. if (!vm.$options.render) {
  27691. vm.$options.render = createEmptyVNode;
  27692. if (process.env.NODE_ENV !== 'production') {
  27693. /* istanbul ignore if */
  27694. if (vm.$options.template && vm.$options.template.charAt(0) !== '#') {
  27695. warn(
  27696. 'You are using the runtime-only build of Vue where the template ' +
  27697. 'option is not available. Either pre-compile the templates into ' +
  27698. 'render functions, or use the compiler-included build.',
  27699. vm
  27700. );
  27701. } else {
  27702. warn(
  27703. 'Failed to mount component: template or render function not defined.',
  27704. vm
  27705. );
  27706. }
  27707. }
  27708. }
  27709. callHook(vm, 'beforeMount');
  27710. vm._watcher = new Watcher(vm, function updateComponent () {
  27711. vm._update(vm._render(), hydrating);
  27712. }, noop);
  27713. hydrating = false;
  27714. // manually mounted instance, call mounted on self
  27715. // mounted is called for render-created child components in its inserted hook
  27716. if (vm.$vnode == null) {
  27717. vm._isMounted = true;
  27718. callHook(vm, 'mounted');
  27719. }
  27720. return vm
  27721. };
  27722. Vue.prototype._update = function (vnode, hydrating) {
  27723. var vm = this;
  27724. if (vm._isMounted) {
  27725. callHook(vm, 'beforeUpdate');
  27726. }
  27727. var prevEl = vm.$el;
  27728. var prevVnode = vm._vnode;
  27729. var prevActiveInstance = activeInstance;
  27730. activeInstance = vm;
  27731. vm._vnode = vnode;
  27732. // Vue.prototype.__patch__ is injected in entry points
  27733. // based on the rendering backend used.
  27734. if (!prevVnode) {
  27735. // initial render
  27736. vm.$el = vm.__patch__(
  27737. vm.$el, vnode, hydrating, false /* removeOnly */,
  27738. vm.$options._parentElm,
  27739. vm.$options._refElm
  27740. );
  27741. } else {
  27742. // updates
  27743. vm.$el = vm.__patch__(prevVnode, vnode);
  27744. }
  27745. activeInstance = prevActiveInstance;
  27746. // update __vue__ reference
  27747. if (prevEl) {
  27748. prevEl.__vue__ = null;
  27749. }
  27750. if (vm.$el) {
  27751. vm.$el.__vue__ = vm;
  27752. }
  27753. // if parent is an HOC, update its $el as well
  27754. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  27755. vm.$parent.$el = vm.$el;
  27756. }
  27757. // updated hook is called by the scheduler to ensure that children are
  27758. // updated in a parent's updated hook.
  27759. };
  27760. Vue.prototype._updateFromParent = function (
  27761. propsData,
  27762. listeners,
  27763. parentVnode,
  27764. renderChildren
  27765. ) {
  27766. var vm = this;
  27767. var hasChildren = !!(vm.$options._renderChildren || renderChildren);
  27768. vm.$options._parentVnode = parentVnode;
  27769. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  27770. if (vm._vnode) { // update child tree's parent
  27771. vm._vnode.parent = parentVnode;
  27772. }
  27773. vm.$options._renderChildren = renderChildren;
  27774. // update props
  27775. if (propsData && vm.$options.props) {
  27776. observerState.shouldConvert = false;
  27777. if (process.env.NODE_ENV !== 'production') {
  27778. observerState.isSettingProps = true;
  27779. }
  27780. var propKeys = vm.$options._propKeys || [];
  27781. for (var i = 0; i < propKeys.length; i++) {
  27782. var key = propKeys[i];
  27783. vm[key] = validateProp(key, vm.$options.props, propsData, vm);
  27784. }
  27785. observerState.shouldConvert = true;
  27786. if (process.env.NODE_ENV !== 'production') {
  27787. observerState.isSettingProps = false;
  27788. }
  27789. vm.$options.propsData = propsData;
  27790. }
  27791. // update listeners
  27792. if (listeners) {
  27793. var oldListeners = vm.$options._parentListeners;
  27794. vm.$options._parentListeners = listeners;
  27795. updateComponentListeners(vm, listeners, oldListeners);
  27796. }
  27797. // resolve slots + force update if has children
  27798. if (hasChildren) {
  27799. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  27800. vm.$forceUpdate();
  27801. }
  27802. };
  27803. Vue.prototype.$forceUpdate = function () {
  27804. var vm = this;
  27805. if (vm._watcher) {
  27806. vm._watcher.update();
  27807. }
  27808. };
  27809. Vue.prototype.$destroy = function () {
  27810. var vm = this;
  27811. if (vm._isBeingDestroyed) {
  27812. return
  27813. }
  27814. callHook(vm, 'beforeDestroy');
  27815. vm._isBeingDestroyed = true;
  27816. // remove self from parent
  27817. var parent = vm.$parent;
  27818. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  27819. remove$1(parent.$children, vm);
  27820. }
  27821. // teardown watchers
  27822. if (vm._watcher) {
  27823. vm._watcher.teardown();
  27824. }
  27825. var i = vm._watchers.length;
  27826. while (i--) {
  27827. vm._watchers[i].teardown();
  27828. }
  27829. // remove reference from data ob
  27830. // frozen object may not have observer.
  27831. if (vm._data.__ob__) {
  27832. vm._data.__ob__.vmCount--;
  27833. }
  27834. // call the last hook...
  27835. vm._isDestroyed = true;
  27836. callHook(vm, 'destroyed');
  27837. // turn off all instance listeners.
  27838. vm.$off();
  27839. // remove __vue__ reference
  27840. if (vm.$el) {
  27841. vm.$el.__vue__ = null;
  27842. }
  27843. // invoke destroy hooks on current rendered tree
  27844. vm.__patch__(vm._vnode, null);
  27845. };
  27846. }
  27847. function callHook (vm, hook) {
  27848. var handlers = vm.$options[hook];
  27849. if (handlers) {
  27850. for (var i = 0, j = handlers.length; i < j; i++) {
  27851. handlers[i].call(vm);
  27852. }
  27853. }
  27854. if (vm._hasHookEvent) {
  27855. vm.$emit('hook:' + hook);
  27856. }
  27857. }
  27858. /* */
  27859. var queue = [];
  27860. var has$1 = {};
  27861. var circular = {};
  27862. var waiting = false;
  27863. var flushing = false;
  27864. var index = 0;
  27865. /**
  27866. * Reset the scheduler's state.
  27867. */
  27868. function resetSchedulerState () {
  27869. queue.length = 0;
  27870. has$1 = {};
  27871. if (process.env.NODE_ENV !== 'production') {
  27872. circular = {};
  27873. }
  27874. waiting = flushing = false;
  27875. }
  27876. /**
  27877. * Flush both queues and run the watchers.
  27878. */
  27879. function flushSchedulerQueue () {
  27880. flushing = true;
  27881. var watcher, id, vm;
  27882. // Sort queue before flush.
  27883. // This ensures that:
  27884. // 1. Components are updated from parent to child. (because parent is always
  27885. // created before the child)
  27886. // 2. A component's user watchers are run before its render watcher (because
  27887. // user watchers are created before the render watcher)
  27888. // 3. If a component is destroyed during a parent component's watcher run,
  27889. // its watchers can be skipped.
  27890. queue.sort(function (a, b) { return a.id - b.id; });
  27891. // do not cache length because more watchers might be pushed
  27892. // as we run existing watchers
  27893. for (index = 0; index < queue.length; index++) {
  27894. watcher = queue[index];
  27895. id = watcher.id;
  27896. has$1[id] = null;
  27897. watcher.run();
  27898. // in dev build, check and stop circular updates.
  27899. if (process.env.NODE_ENV !== 'production' && has$1[id] != null) {
  27900. circular[id] = (circular[id] || 0) + 1;
  27901. if (circular[id] > config._maxUpdateCount) {
  27902. warn(
  27903. 'You may have an infinite update loop ' + (
  27904. watcher.user
  27905. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  27906. : "in a component render function."
  27907. ),
  27908. watcher.vm
  27909. );
  27910. break
  27911. }
  27912. }
  27913. }
  27914. // call updated hooks
  27915. index = queue.length;
  27916. while (index--) {
  27917. watcher = queue[index];
  27918. vm = watcher.vm;
  27919. if (vm._watcher === watcher && vm._isMounted) {
  27920. callHook(vm, 'updated');
  27921. }
  27922. }
  27923. // devtool hook
  27924. /* istanbul ignore if */
  27925. if (devtools && config.devtools) {
  27926. devtools.emit('flush');
  27927. }
  27928. resetSchedulerState();
  27929. }
  27930. /**
  27931. * Push a watcher into the watcher queue.
  27932. * Jobs with duplicate IDs will be skipped unless it's
  27933. * pushed when the queue is being flushed.
  27934. */
  27935. function queueWatcher (watcher) {
  27936. var id = watcher.id;
  27937. if (has$1[id] == null) {
  27938. has$1[id] = true;
  27939. if (!flushing) {
  27940. queue.push(watcher);
  27941. } else {
  27942. // if already flushing, splice the watcher based on its id
  27943. // if already past its id, it will be run next immediately.
  27944. var i = queue.length - 1;
  27945. while (i >= 0 && queue[i].id > watcher.id) {
  27946. i--;
  27947. }
  27948. queue.splice(Math.max(i, index) + 1, 0, watcher);
  27949. }
  27950. // queue the flush
  27951. if (!waiting) {
  27952. waiting = true;
  27953. nextTick(flushSchedulerQueue);
  27954. }
  27955. }
  27956. }
  27957. /* */
  27958. var uid$2 = 0;
  27959. /**
  27960. * A watcher parses an expression, collects dependencies,
  27961. * and fires callback when the expression value changes.
  27962. * This is used for both the $watch() api and directives.
  27963. */
  27964. var Watcher = function Watcher (
  27965. vm,
  27966. expOrFn,
  27967. cb,
  27968. options
  27969. ) {
  27970. this.vm = vm;
  27971. vm._watchers.push(this);
  27972. // options
  27973. if (options) {
  27974. this.deep = !!options.deep;
  27975. this.user = !!options.user;
  27976. this.lazy = !!options.lazy;
  27977. this.sync = !!options.sync;
  27978. } else {
  27979. this.deep = this.user = this.lazy = this.sync = false;
  27980. }
  27981. this.cb = cb;
  27982. this.id = ++uid$2; // uid for batching
  27983. this.active = true;
  27984. this.dirty = this.lazy; // for lazy watchers
  27985. this.deps = [];
  27986. this.newDeps = [];
  27987. this.depIds = new _Set();
  27988. this.newDepIds = new _Set();
  27989. this.expression = process.env.NODE_ENV !== 'production'
  27990. ? expOrFn.toString()
  27991. : '';
  27992. // parse expression for getter
  27993. if (typeof expOrFn === 'function') {
  27994. this.getter = expOrFn;
  27995. } else {
  27996. this.getter = parsePath(expOrFn);
  27997. if (!this.getter) {
  27998. this.getter = function () {};
  27999. process.env.NODE_ENV !== 'production' && warn(
  28000. "Failed watching path: \"" + expOrFn + "\" " +
  28001. 'Watcher only accepts simple dot-delimited paths. ' +
  28002. 'For full control, use a function instead.',
  28003. vm
  28004. );
  28005. }
  28006. }
  28007. this.value = this.lazy
  28008. ? undefined
  28009. : this.get();
  28010. };
  28011. /**
  28012. * Evaluate the getter, and re-collect dependencies.
  28013. */
  28014. Watcher.prototype.get = function get () {
  28015. pushTarget(this);
  28016. var value = this.getter.call(this.vm, this.vm);
  28017. // "touch" every property so they are all tracked as
  28018. // dependencies for deep watching
  28019. if (this.deep) {
  28020. traverse(value);
  28021. }
  28022. popTarget();
  28023. this.cleanupDeps();
  28024. return value
  28025. };
  28026. /**
  28027. * Add a dependency to this directive.
  28028. */
  28029. Watcher.prototype.addDep = function addDep (dep) {
  28030. var id = dep.id;
  28031. if (!this.newDepIds.has(id)) {
  28032. this.newDepIds.add(id);
  28033. this.newDeps.push(dep);
  28034. if (!this.depIds.has(id)) {
  28035. dep.addSub(this);
  28036. }
  28037. }
  28038. };
  28039. /**
  28040. * Clean up for dependency collection.
  28041. */
  28042. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  28043. var this$1 = this;
  28044. var i = this.deps.length;
  28045. while (i--) {
  28046. var dep = this$1.deps[i];
  28047. if (!this$1.newDepIds.has(dep.id)) {
  28048. dep.removeSub(this$1);
  28049. }
  28050. }
  28051. var tmp = this.depIds;
  28052. this.depIds = this.newDepIds;
  28053. this.newDepIds = tmp;
  28054. this.newDepIds.clear();
  28055. tmp = this.deps;
  28056. this.deps = this.newDeps;
  28057. this.newDeps = tmp;
  28058. this.newDeps.length = 0;
  28059. };
  28060. /**
  28061. * Subscriber interface.
  28062. * Will be called when a dependency changes.
  28063. */
  28064. Watcher.prototype.update = function update () {
  28065. /* istanbul ignore else */
  28066. if (this.lazy) {
  28067. this.dirty = true;
  28068. } else if (this.sync) {
  28069. this.run();
  28070. } else {
  28071. queueWatcher(this);
  28072. }
  28073. };
  28074. /**
  28075. * Scheduler job interface.
  28076. * Will be called by the scheduler.
  28077. */
  28078. Watcher.prototype.run = function run () {
  28079. if (this.active) {
  28080. var value = this.get();
  28081. if (
  28082. value !== this.value ||
  28083. // Deep watchers and watchers on Object/Arrays should fire even
  28084. // when the value is the same, because the value may
  28085. // have mutated.
  28086. isObject(value) ||
  28087. this.deep
  28088. ) {
  28089. // set new value
  28090. var oldValue = this.value;
  28091. this.value = value;
  28092. if (this.user) {
  28093. try {
  28094. this.cb.call(this.vm, value, oldValue);
  28095. } catch (e) {
  28096. /* istanbul ignore else */
  28097. if (config.errorHandler) {
  28098. config.errorHandler.call(null, e, this.vm);
  28099. } else {
  28100. process.env.NODE_ENV !== 'production' && warn(
  28101. ("Error in watcher \"" + (this.expression) + "\""),
  28102. this.vm
  28103. );
  28104. throw e
  28105. }
  28106. }
  28107. } else {
  28108. this.cb.call(this.vm, value, oldValue);
  28109. }
  28110. }
  28111. }
  28112. };
  28113. /**
  28114. * Evaluate the value of the watcher.
  28115. * This only gets called for lazy watchers.
  28116. */
  28117. Watcher.prototype.evaluate = function evaluate () {
  28118. this.value = this.get();
  28119. this.dirty = false;
  28120. };
  28121. /**
  28122. * Depend on all deps collected by this watcher.
  28123. */
  28124. Watcher.prototype.depend = function depend () {
  28125. var this$1 = this;
  28126. var i = this.deps.length;
  28127. while (i--) {
  28128. this$1.deps[i].depend();
  28129. }
  28130. };
  28131. /**
  28132. * Remove self from all dependencies' subscriber list.
  28133. */
  28134. Watcher.prototype.teardown = function teardown () {
  28135. var this$1 = this;
  28136. if (this.active) {
  28137. // remove self from vm's watcher list
  28138. // this is a somewhat expensive operation so we skip it
  28139. // if the vm is being destroyed.
  28140. if (!this.vm._isBeingDestroyed) {
  28141. remove$1(this.vm._watchers, this);
  28142. }
  28143. var i = this.deps.length;
  28144. while (i--) {
  28145. this$1.deps[i].removeSub(this$1);
  28146. }
  28147. this.active = false;
  28148. }
  28149. };
  28150. /**
  28151. * Recursively traverse an object to evoke all converted
  28152. * getters, so that every nested property inside the object
  28153. * is collected as a "deep" dependency.
  28154. */
  28155. var seenObjects = new _Set();
  28156. function traverse (val) {
  28157. seenObjects.clear();
  28158. _traverse(val, seenObjects);
  28159. }
  28160. function _traverse (val, seen) {
  28161. var i, keys;
  28162. var isA = Array.isArray(val);
  28163. if ((!isA && !isObject(val)) || !Object.isExtensible(val)) {
  28164. return
  28165. }
  28166. if (val.__ob__) {
  28167. var depId = val.__ob__.dep.id;
  28168. if (seen.has(depId)) {
  28169. return
  28170. }
  28171. seen.add(depId);
  28172. }
  28173. if (isA) {
  28174. i = val.length;
  28175. while (i--) { _traverse(val[i], seen); }
  28176. } else {
  28177. keys = Object.keys(val);
  28178. i = keys.length;
  28179. while (i--) { _traverse(val[keys[i]], seen); }
  28180. }
  28181. }
  28182. /* */
  28183. function initState (vm) {
  28184. vm._watchers = [];
  28185. var opts = vm.$options;
  28186. if (opts.props) { initProps(vm, opts.props); }
  28187. if (opts.methods) { initMethods(vm, opts.methods); }
  28188. if (opts.data) {
  28189. initData(vm);
  28190. } else {
  28191. observe(vm._data = {}, true /* asRootData */);
  28192. }
  28193. if (opts.computed) { initComputed(vm, opts.computed); }
  28194. if (opts.watch) { initWatch(vm, opts.watch); }
  28195. }
  28196. var isReservedProp = { key: 1, ref: 1, slot: 1 };
  28197. function initProps (vm, props) {
  28198. var propsData = vm.$options.propsData || {};
  28199. var keys = vm.$options._propKeys = Object.keys(props);
  28200. var isRoot = !vm.$parent;
  28201. // root instance props should be converted
  28202. observerState.shouldConvert = isRoot;
  28203. var loop = function ( i ) {
  28204. var key = keys[i];
  28205. /* istanbul ignore else */
  28206. if (process.env.NODE_ENV !== 'production') {
  28207. if (isReservedProp[key]) {
  28208. warn(
  28209. ("\"" + key + "\" is a reserved attribute and cannot be used as component prop."),
  28210. vm
  28211. );
  28212. }
  28213. defineReactive$$1(vm, key, validateProp(key, props, propsData, vm), function () {
  28214. if (vm.$parent && !observerState.isSettingProps) {
  28215. warn(
  28216. "Avoid mutating a prop directly since the value will be " +
  28217. "overwritten whenever the parent component re-renders. " +
  28218. "Instead, use a data or computed property based on the prop's " +
  28219. "value. Prop being mutated: \"" + key + "\"",
  28220. vm
  28221. );
  28222. }
  28223. });
  28224. } else {
  28225. defineReactive$$1(vm, key, validateProp(key, props, propsData, vm));
  28226. }
  28227. };
  28228. for (var i = 0; i < keys.length; i++) loop( i );
  28229. observerState.shouldConvert = true;
  28230. }
  28231. function initData (vm) {
  28232. var data = vm.$options.data;
  28233. data = vm._data = typeof data === 'function'
  28234. ? data.call(vm)
  28235. : data || {};
  28236. if (!isPlainObject(data)) {
  28237. data = {};
  28238. process.env.NODE_ENV !== 'production' && warn(
  28239. 'data functions should return an object:\n' +
  28240. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  28241. vm
  28242. );
  28243. }
  28244. // proxy data on instance
  28245. var keys = Object.keys(data);
  28246. var props = vm.$options.props;
  28247. var i = keys.length;
  28248. while (i--) {
  28249. if (props && hasOwn(props, keys[i])) {
  28250. process.env.NODE_ENV !== 'production' && warn(
  28251. "The data property \"" + (keys[i]) + "\" is already declared as a prop. " +
  28252. "Use prop default value instead.",
  28253. vm
  28254. );
  28255. } else {
  28256. proxy(vm, keys[i]);
  28257. }
  28258. }
  28259. // observe data
  28260. observe(data, true /* asRootData */);
  28261. }
  28262. var computedSharedDefinition = {
  28263. enumerable: true,
  28264. configurable: true,
  28265. get: noop,
  28266. set: noop
  28267. };
  28268. function initComputed (vm, computed) {
  28269. for (var key in computed) {
  28270. /* istanbul ignore if */
  28271. if (process.env.NODE_ENV !== 'production' && key in vm) {
  28272. warn(
  28273. "existing instance property \"" + key + "\" will be " +
  28274. "overwritten by a computed property with the same name.",
  28275. vm
  28276. );
  28277. }
  28278. var userDef = computed[key];
  28279. if (typeof userDef === 'function') {
  28280. computedSharedDefinition.get = makeComputedGetter(userDef, vm);
  28281. computedSharedDefinition.set = noop;
  28282. } else {
  28283. computedSharedDefinition.get = userDef.get
  28284. ? userDef.cache !== false
  28285. ? makeComputedGetter(userDef.get, vm)
  28286. : bind$1(userDef.get, vm)
  28287. : noop;
  28288. computedSharedDefinition.set = userDef.set
  28289. ? bind$1(userDef.set, vm)
  28290. : noop;
  28291. }
  28292. Object.defineProperty(vm, key, computedSharedDefinition);
  28293. }
  28294. }
  28295. function makeComputedGetter (getter, owner) {
  28296. var watcher = new Watcher(owner, getter, noop, {
  28297. lazy: true
  28298. });
  28299. return function computedGetter () {
  28300. if (watcher.dirty) {
  28301. watcher.evaluate();
  28302. }
  28303. if (Dep.target) {
  28304. watcher.depend();
  28305. }
  28306. return watcher.value
  28307. }
  28308. }
  28309. function initMethods (vm, methods) {
  28310. for (var key in methods) {
  28311. vm[key] = methods[key] == null ? noop : bind$1(methods[key], vm);
  28312. if (process.env.NODE_ENV !== 'production' && methods[key] == null) {
  28313. warn(
  28314. "method \"" + key + "\" has an undefined value in the component definition. " +
  28315. "Did you reference the function correctly?",
  28316. vm
  28317. );
  28318. }
  28319. }
  28320. }
  28321. function initWatch (vm, watch) {
  28322. for (var key in watch) {
  28323. var handler = watch[key];
  28324. if (Array.isArray(handler)) {
  28325. for (var i = 0; i < handler.length; i++) {
  28326. createWatcher(vm, key, handler[i]);
  28327. }
  28328. } else {
  28329. createWatcher(vm, key, handler);
  28330. }
  28331. }
  28332. }
  28333. function createWatcher (vm, key, handler) {
  28334. var options;
  28335. if (isPlainObject(handler)) {
  28336. options = handler;
  28337. handler = handler.handler;
  28338. }
  28339. if (typeof handler === 'string') {
  28340. handler = vm[handler];
  28341. }
  28342. vm.$watch(key, handler, options);
  28343. }
  28344. function stateMixin (Vue) {
  28345. // flow somehow has problems with directly declared definition object
  28346. // when using Object.defineProperty, so we have to procedurally build up
  28347. // the object here.
  28348. var dataDef = {};
  28349. dataDef.get = function () {
  28350. return this._data
  28351. };
  28352. if (process.env.NODE_ENV !== 'production') {
  28353. dataDef.set = function (newData) {
  28354. warn(
  28355. 'Avoid replacing instance root $data. ' +
  28356. 'Use nested data properties instead.',
  28357. this
  28358. );
  28359. };
  28360. }
  28361. Object.defineProperty(Vue.prototype, '$data', dataDef);
  28362. Vue.prototype.$set = set$1;
  28363. Vue.prototype.$delete = del;
  28364. Vue.prototype.$watch = function (
  28365. expOrFn,
  28366. cb,
  28367. options
  28368. ) {
  28369. var vm = this;
  28370. options = options || {};
  28371. options.user = true;
  28372. var watcher = new Watcher(vm, expOrFn, cb, options);
  28373. if (options.immediate) {
  28374. cb.call(vm, watcher.value);
  28375. }
  28376. return function unwatchFn () {
  28377. watcher.teardown();
  28378. }
  28379. };
  28380. }
  28381. function proxy (vm, key) {
  28382. if (!isReserved(key)) {
  28383. Object.defineProperty(vm, key, {
  28384. configurable: true,
  28385. enumerable: true,
  28386. get: function proxyGetter () {
  28387. return vm._data[key]
  28388. },
  28389. set: function proxySetter (val) {
  28390. vm._data[key] = val;
  28391. }
  28392. });
  28393. }
  28394. }
  28395. /* */
  28396. var uid = 0;
  28397. function initMixin (Vue) {
  28398. Vue.prototype._init = function (options) {
  28399. var vm = this;
  28400. // a uid
  28401. vm._uid = uid++;
  28402. // a flag to avoid this being observed
  28403. vm._isVue = true;
  28404. // merge options
  28405. if (options && options._isComponent) {
  28406. // optimize internal component instantiation
  28407. // since dynamic options merging is pretty slow, and none of the
  28408. // internal component options needs special treatment.
  28409. initInternalComponent(vm, options);
  28410. } else {
  28411. vm.$options = mergeOptions(
  28412. resolveConstructorOptions(vm.constructor),
  28413. options || {},
  28414. vm
  28415. );
  28416. }
  28417. /* istanbul ignore else */
  28418. if (process.env.NODE_ENV !== 'production') {
  28419. initProxy(vm);
  28420. } else {
  28421. vm._renderProxy = vm;
  28422. }
  28423. // expose real self
  28424. vm._self = vm;
  28425. initLifecycle(vm);
  28426. initEvents(vm);
  28427. initRender(vm);
  28428. callHook(vm, 'beforeCreate');
  28429. initState(vm);
  28430. callHook(vm, 'created');
  28431. if (vm.$options.el) {
  28432. vm.$mount(vm.$options.el);
  28433. }
  28434. };
  28435. }
  28436. function initInternalComponent (vm, options) {
  28437. var opts = vm.$options = Object.create(vm.constructor.options);
  28438. // doing this because it's faster than dynamic enumeration.
  28439. opts.parent = options.parent;
  28440. opts.propsData = options.propsData;
  28441. opts._parentVnode = options._parentVnode;
  28442. opts._parentListeners = options._parentListeners;
  28443. opts._renderChildren = options._renderChildren;
  28444. opts._componentTag = options._componentTag;
  28445. opts._parentElm = options._parentElm;
  28446. opts._refElm = options._refElm;
  28447. if (options.render) {
  28448. opts.render = options.render;
  28449. opts.staticRenderFns = options.staticRenderFns;
  28450. }
  28451. }
  28452. function resolveConstructorOptions (Ctor) {
  28453. var options = Ctor.options;
  28454. if (Ctor.super) {
  28455. var superOptions = Ctor.super.options;
  28456. var cachedSuperOptions = Ctor.superOptions;
  28457. var extendOptions = Ctor.extendOptions;
  28458. if (superOptions !== cachedSuperOptions) {
  28459. // super option changed
  28460. Ctor.superOptions = superOptions;
  28461. extendOptions.render = options.render;
  28462. extendOptions.staticRenderFns = options.staticRenderFns;
  28463. extendOptions._scopeId = options._scopeId;
  28464. options = Ctor.options = mergeOptions(superOptions, extendOptions);
  28465. if (options.name) {
  28466. options.components[options.name] = Ctor;
  28467. }
  28468. }
  28469. }
  28470. return options
  28471. }
  28472. function Vue$3 (options) {
  28473. if (process.env.NODE_ENV !== 'production' &&
  28474. !(this instanceof Vue$3)) {
  28475. warn('Vue is a constructor and should be called with the `new` keyword');
  28476. }
  28477. this._init(options);
  28478. }
  28479. initMixin(Vue$3);
  28480. stateMixin(Vue$3);
  28481. eventsMixin(Vue$3);
  28482. lifecycleMixin(Vue$3);
  28483. renderMixin(Vue$3);
  28484. /* */
  28485. function initUse (Vue) {
  28486. Vue.use = function (plugin) {
  28487. /* istanbul ignore if */
  28488. if (plugin.installed) {
  28489. return
  28490. }
  28491. // additional parameters
  28492. var args = toArray(arguments, 1);
  28493. args.unshift(this);
  28494. if (typeof plugin.install === 'function') {
  28495. plugin.install.apply(plugin, args);
  28496. } else {
  28497. plugin.apply(null, args);
  28498. }
  28499. plugin.installed = true;
  28500. return this
  28501. };
  28502. }
  28503. /* */
  28504. function initMixin$1 (Vue) {
  28505. Vue.mixin = function (mixin) {
  28506. this.options = mergeOptions(this.options, mixin);
  28507. };
  28508. }
  28509. /* */
  28510. function initExtend (Vue) {
  28511. /**
  28512. * Each instance constructor, including Vue, has a unique
  28513. * cid. This enables us to create wrapped "child
  28514. * constructors" for prototypal inheritance and cache them.
  28515. */
  28516. Vue.cid = 0;
  28517. var cid = 1;
  28518. /**
  28519. * Class inheritance
  28520. */
  28521. Vue.extend = function (extendOptions) {
  28522. extendOptions = extendOptions || {};
  28523. var Super = this;
  28524. var SuperId = Super.cid;
  28525. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  28526. if (cachedCtors[SuperId]) {
  28527. return cachedCtors[SuperId]
  28528. }
  28529. var name = extendOptions.name || Super.options.name;
  28530. if (process.env.NODE_ENV !== 'production') {
  28531. if (!/^[a-zA-Z][\w-]*$/.test(name)) {
  28532. warn(
  28533. 'Invalid component name: "' + name + '". Component names ' +
  28534. 'can only contain alphanumeric characters and the hyphen, ' +
  28535. 'and must start with a letter.'
  28536. );
  28537. }
  28538. }
  28539. var Sub = function VueComponent (options) {
  28540. this._init(options);
  28541. };
  28542. Sub.prototype = Object.create(Super.prototype);
  28543. Sub.prototype.constructor = Sub;
  28544. Sub.cid = cid++;
  28545. Sub.options = mergeOptions(
  28546. Super.options,
  28547. extendOptions
  28548. );
  28549. Sub['super'] = Super;
  28550. // allow further extension/mixin/plugin usage
  28551. Sub.extend = Super.extend;
  28552. Sub.mixin = Super.mixin;
  28553. Sub.use = Super.use;
  28554. // create asset registers, so extended classes
  28555. // can have their private assets too.
  28556. config._assetTypes.forEach(function (type) {
  28557. Sub[type] = Super[type];
  28558. });
  28559. // enable recursive self-lookup
  28560. if (name) {
  28561. Sub.options.components[name] = Sub;
  28562. }
  28563. // keep a reference to the super options at extension time.
  28564. // later at instantiation we can check if Super's options have
  28565. // been updated.
  28566. Sub.superOptions = Super.options;
  28567. Sub.extendOptions = extendOptions;
  28568. // cache constructor
  28569. cachedCtors[SuperId] = Sub;
  28570. return Sub
  28571. };
  28572. }
  28573. /* */
  28574. function initAssetRegisters (Vue) {
  28575. /**
  28576. * Create asset registration methods.
  28577. */
  28578. config._assetTypes.forEach(function (type) {
  28579. Vue[type] = function (
  28580. id,
  28581. definition
  28582. ) {
  28583. if (!definition) {
  28584. return this.options[type + 's'][id]
  28585. } else {
  28586. /* istanbul ignore if */
  28587. if (process.env.NODE_ENV !== 'production') {
  28588. if (type === 'component' && config.isReservedTag(id)) {
  28589. warn(
  28590. 'Do not use built-in or reserved HTML elements as component ' +
  28591. 'id: ' + id
  28592. );
  28593. }
  28594. }
  28595. if (type === 'component' && isPlainObject(definition)) {
  28596. definition.name = definition.name || id;
  28597. definition = this.options._base.extend(definition);
  28598. }
  28599. if (type === 'directive' && typeof definition === 'function') {
  28600. definition = { bind: definition, update: definition };
  28601. }
  28602. this.options[type + 's'][id] = definition;
  28603. return definition
  28604. }
  28605. };
  28606. });
  28607. }
  28608. /* */
  28609. var patternTypes = [String, RegExp];
  28610. function getComponentName (opts) {
  28611. return opts && (opts.Ctor.options.name || opts.tag)
  28612. }
  28613. function matches (pattern, name) {
  28614. if (typeof pattern === 'string') {
  28615. return pattern.split(',').indexOf(name) > -1
  28616. } else {
  28617. return pattern.test(name)
  28618. }
  28619. }
  28620. function pruneCache (cache, filter) {
  28621. for (var key in cache) {
  28622. var cachedNode = cache[key];
  28623. if (cachedNode) {
  28624. var name = getComponentName(cachedNode.componentOptions);
  28625. if (name && !filter(name)) {
  28626. pruneCacheEntry(cachedNode);
  28627. cache[key] = null;
  28628. }
  28629. }
  28630. }
  28631. }
  28632. function pruneCacheEntry (vnode) {
  28633. if (vnode) {
  28634. if (!vnode.componentInstance._inactive) {
  28635. callHook(vnode.componentInstance, 'deactivated');
  28636. }
  28637. vnode.componentInstance.$destroy();
  28638. }
  28639. }
  28640. var KeepAlive = {
  28641. name: 'keep-alive',
  28642. abstract: true,
  28643. props: {
  28644. include: patternTypes,
  28645. exclude: patternTypes
  28646. },
  28647. created: function created () {
  28648. this.cache = Object.create(null);
  28649. },
  28650. destroyed: function destroyed () {
  28651. var this$1 = this;
  28652. for (var key in this.cache) {
  28653. pruneCacheEntry(this$1.cache[key]);
  28654. }
  28655. },
  28656. watch: {
  28657. include: function include (val) {
  28658. pruneCache(this.cache, function (name) { return matches(val, name); });
  28659. },
  28660. exclude: function exclude (val) {
  28661. pruneCache(this.cache, function (name) { return !matches(val, name); });
  28662. }
  28663. },
  28664. render: function render () {
  28665. var vnode = getFirstComponentChild(this.$slots.default);
  28666. var componentOptions = vnode && vnode.componentOptions;
  28667. if (componentOptions) {
  28668. // check pattern
  28669. var name = getComponentName(componentOptions);
  28670. if (name && (
  28671. (this.include && !matches(this.include, name)) ||
  28672. (this.exclude && matches(this.exclude, name))
  28673. )) {
  28674. return vnode
  28675. }
  28676. var key = vnode.key == null
  28677. // same constructor may get registered as different local components
  28678. // so cid alone is not enough (#3269)
  28679. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  28680. : vnode.key;
  28681. if (this.cache[key]) {
  28682. vnode.componentInstance = this.cache[key].componentInstance;
  28683. } else {
  28684. this.cache[key] = vnode;
  28685. }
  28686. vnode.data.keepAlive = true;
  28687. }
  28688. return vnode
  28689. }
  28690. };
  28691. var builtInComponents = {
  28692. KeepAlive: KeepAlive
  28693. };
  28694. /* */
  28695. function initGlobalAPI (Vue) {
  28696. // config
  28697. var configDef = {};
  28698. configDef.get = function () { return config; };
  28699. if (process.env.NODE_ENV !== 'production') {
  28700. configDef.set = function () {
  28701. warn(
  28702. 'Do not replace the Vue.config object, set individual fields instead.'
  28703. );
  28704. };
  28705. }
  28706. Object.defineProperty(Vue, 'config', configDef);
  28707. Vue.util = util;
  28708. Vue.set = set$1;
  28709. Vue.delete = del;
  28710. Vue.nextTick = nextTick;
  28711. Vue.options = Object.create(null);
  28712. config._assetTypes.forEach(function (type) {
  28713. Vue.options[type + 's'] = Object.create(null);
  28714. });
  28715. // this is used to identify the "base" constructor to extend all plain-object
  28716. // components with in Weex's multi-instance scenarios.
  28717. Vue.options._base = Vue;
  28718. extend(Vue.options.components, builtInComponents);
  28719. initUse(Vue);
  28720. initMixin$1(Vue);
  28721. initExtend(Vue);
  28722. initAssetRegisters(Vue);
  28723. }
  28724. initGlobalAPI(Vue$3);
  28725. Object.defineProperty(Vue$3.prototype, '$isServer', {
  28726. get: isServerRendering
  28727. });
  28728. Vue$3.version = '2.1.10';
  28729. /* */
  28730. // attributes that should be using props for binding
  28731. var acceptValue = makeMap('input,textarea,option,select');
  28732. var mustUseProp = function (tag, type, attr) {
  28733. return (
  28734. (attr === 'value' && acceptValue(tag)) && type !== 'button' ||
  28735. (attr === 'selected' && tag === 'option') ||
  28736. (attr === 'checked' && tag === 'input') ||
  28737. (attr === 'muted' && tag === 'video')
  28738. )
  28739. };
  28740. var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
  28741. var isBooleanAttr = makeMap(
  28742. 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
  28743. 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
  28744. 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
  28745. 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
  28746. 'required,reversed,scoped,seamless,selected,sortable,translate,' +
  28747. 'truespeed,typemustmatch,visible'
  28748. );
  28749. var xlinkNS = 'http://www.w3.org/1999/xlink';
  28750. var isXlink = function (name) {
  28751. return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
  28752. };
  28753. var getXlinkProp = function (name) {
  28754. return isXlink(name) ? name.slice(6, name.length) : ''
  28755. };
  28756. var isFalsyAttrValue = function (val) {
  28757. return val == null || val === false
  28758. };
  28759. /* */
  28760. function genClassForVnode (vnode) {
  28761. var data = vnode.data;
  28762. var parentNode = vnode;
  28763. var childNode = vnode;
  28764. while (childNode.componentInstance) {
  28765. childNode = childNode.componentInstance._vnode;
  28766. if (childNode.data) {
  28767. data = mergeClassData(childNode.data, data);
  28768. }
  28769. }
  28770. while ((parentNode = parentNode.parent)) {
  28771. if (parentNode.data) {
  28772. data = mergeClassData(data, parentNode.data);
  28773. }
  28774. }
  28775. return genClassFromData(data)
  28776. }
  28777. function mergeClassData (child, parent) {
  28778. return {
  28779. staticClass: concat(child.staticClass, parent.staticClass),
  28780. class: child.class
  28781. ? [child.class, parent.class]
  28782. : parent.class
  28783. }
  28784. }
  28785. function genClassFromData (data) {
  28786. var dynamicClass = data.class;
  28787. var staticClass = data.staticClass;
  28788. if (staticClass || dynamicClass) {
  28789. return concat(staticClass, stringifyClass(dynamicClass))
  28790. }
  28791. /* istanbul ignore next */
  28792. return ''
  28793. }
  28794. function concat (a, b) {
  28795. return a ? b ? (a + ' ' + b) : a : (b || '')
  28796. }
  28797. function stringifyClass (value) {
  28798. var res = '';
  28799. if (!value) {
  28800. return res
  28801. }
  28802. if (typeof value === 'string') {
  28803. return value
  28804. }
  28805. if (Array.isArray(value)) {
  28806. var stringified;
  28807. for (var i = 0, l = value.length; i < l; i++) {
  28808. if (value[i]) {
  28809. if ((stringified = stringifyClass(value[i]))) {
  28810. res += stringified + ' ';
  28811. }
  28812. }
  28813. }
  28814. return res.slice(0, -1)
  28815. }
  28816. if (isObject(value)) {
  28817. for (var key in value) {
  28818. if (value[key]) { res += key + ' '; }
  28819. }
  28820. return res.slice(0, -1)
  28821. }
  28822. /* istanbul ignore next */
  28823. return res
  28824. }
  28825. /* */
  28826. var namespaceMap = {
  28827. svg: 'http://www.w3.org/2000/svg',
  28828. math: 'http://www.w3.org/1998/Math/MathML'
  28829. };
  28830. var isHTMLTag = makeMap(
  28831. 'html,body,base,head,link,meta,style,title,' +
  28832. 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
  28833. 'div,dd,dl,dt,figcaption,figure,hr,img,li,main,ol,p,pre,ul,' +
  28834. 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
  28835. 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
  28836. 'embed,object,param,source,canvas,script,noscript,del,ins,' +
  28837. 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
  28838. 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
  28839. 'output,progress,select,textarea,' +
  28840. 'details,dialog,menu,menuitem,summary,' +
  28841. 'content,element,shadow,template'
  28842. );
  28843. // this map is intentionally selective, only covering SVG elements that may
  28844. // contain child elements.
  28845. var isSVG = makeMap(
  28846. 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,' +
  28847. 'font-face,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
  28848. 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
  28849. true
  28850. );
  28851. var isPreTag = function (tag) { return tag === 'pre'; };
  28852. var isReservedTag = function (tag) {
  28853. return isHTMLTag(tag) || isSVG(tag)
  28854. };
  28855. function getTagNamespace (tag) {
  28856. if (isSVG(tag)) {
  28857. return 'svg'
  28858. }
  28859. // basic support for MathML
  28860. // note it doesn't support other MathML elements being component roots
  28861. if (tag === 'math') {
  28862. return 'math'
  28863. }
  28864. }
  28865. var unknownElementCache = Object.create(null);
  28866. function isUnknownElement (tag) {
  28867. /* istanbul ignore if */
  28868. if (!inBrowser) {
  28869. return true
  28870. }
  28871. if (isReservedTag(tag)) {
  28872. return false
  28873. }
  28874. tag = tag.toLowerCase();
  28875. /* istanbul ignore if */
  28876. if (unknownElementCache[tag] != null) {
  28877. return unknownElementCache[tag]
  28878. }
  28879. var el = document.createElement(tag);
  28880. if (tag.indexOf('-') > -1) {
  28881. // http://stackoverflow.com/a/28210364/1070244
  28882. return (unknownElementCache[tag] = (
  28883. el.constructor === window.HTMLUnknownElement ||
  28884. el.constructor === window.HTMLElement
  28885. ))
  28886. } else {
  28887. return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
  28888. }
  28889. }
  28890. /* */
  28891. /**
  28892. * Query an element selector if it's not an element already.
  28893. */
  28894. function query (el) {
  28895. if (typeof el === 'string') {
  28896. var selector = el;
  28897. el = document.querySelector(el);
  28898. if (!el) {
  28899. process.env.NODE_ENV !== 'production' && warn(
  28900. 'Cannot find element: ' + selector
  28901. );
  28902. return document.createElement('div')
  28903. }
  28904. }
  28905. return el
  28906. }
  28907. /* */
  28908. function createElement$1 (tagName, vnode) {
  28909. var elm = document.createElement(tagName);
  28910. if (tagName !== 'select') {
  28911. return elm
  28912. }
  28913. if (vnode.data && vnode.data.attrs && 'multiple' in vnode.data.attrs) {
  28914. elm.setAttribute('multiple', 'multiple');
  28915. }
  28916. return elm
  28917. }
  28918. function createElementNS (namespace, tagName) {
  28919. return document.createElementNS(namespaceMap[namespace], tagName)
  28920. }
  28921. function createTextNode (text) {
  28922. return document.createTextNode(text)
  28923. }
  28924. function createComment (text) {
  28925. return document.createComment(text)
  28926. }
  28927. function insertBefore (parentNode, newNode, referenceNode) {
  28928. parentNode.insertBefore(newNode, referenceNode);
  28929. }
  28930. function removeChild (node, child) {
  28931. node.removeChild(child);
  28932. }
  28933. function appendChild (node, child) {
  28934. node.appendChild(child);
  28935. }
  28936. function parentNode (node) {
  28937. return node.parentNode
  28938. }
  28939. function nextSibling (node) {
  28940. return node.nextSibling
  28941. }
  28942. function tagName (node) {
  28943. return node.tagName
  28944. }
  28945. function setTextContent (node, text) {
  28946. node.textContent = text;
  28947. }
  28948. function setAttribute (node, key, val) {
  28949. node.setAttribute(key, val);
  28950. }
  28951. var nodeOps = Object.freeze({
  28952. createElement: createElement$1,
  28953. createElementNS: createElementNS,
  28954. createTextNode: createTextNode,
  28955. createComment: createComment,
  28956. insertBefore: insertBefore,
  28957. removeChild: removeChild,
  28958. appendChild: appendChild,
  28959. parentNode: parentNode,
  28960. nextSibling: nextSibling,
  28961. tagName: tagName,
  28962. setTextContent: setTextContent,
  28963. setAttribute: setAttribute
  28964. });
  28965. /* */
  28966. var ref = {
  28967. create: function create (_, vnode) {
  28968. registerRef(vnode);
  28969. },
  28970. update: function update (oldVnode, vnode) {
  28971. if (oldVnode.data.ref !== vnode.data.ref) {
  28972. registerRef(oldVnode, true);
  28973. registerRef(vnode);
  28974. }
  28975. },
  28976. destroy: function destroy (vnode) {
  28977. registerRef(vnode, true);
  28978. }
  28979. };
  28980. function registerRef (vnode, isRemoval) {
  28981. var key = vnode.data.ref;
  28982. if (!key) { return }
  28983. var vm = vnode.context;
  28984. var ref = vnode.componentInstance || vnode.elm;
  28985. var refs = vm.$refs;
  28986. if (isRemoval) {
  28987. if (Array.isArray(refs[key])) {
  28988. remove$1(refs[key], ref);
  28989. } else if (refs[key] === ref) {
  28990. refs[key] = undefined;
  28991. }
  28992. } else {
  28993. if (vnode.data.refInFor) {
  28994. if (Array.isArray(refs[key]) && refs[key].indexOf(ref) < 0) {
  28995. refs[key].push(ref);
  28996. } else {
  28997. refs[key] = [ref];
  28998. }
  28999. } else {
  29000. refs[key] = ref;
  29001. }
  29002. }
  29003. }
  29004. /**
  29005. * Virtual DOM patching algorithm based on Snabbdom by
  29006. * Simon Friis Vindum (@paldepind)
  29007. * Licensed under the MIT License
  29008. * https://github.com/paldepind/snabbdom/blob/master/LICENSE
  29009. *
  29010. * modified by Evan You (@yyx990803)
  29011. *
  29012. /*
  29013. * Not type-checking this because this file is perf-critical and the cost
  29014. * of making flow understand it is not worth it.
  29015. */
  29016. var emptyNode = new VNode('', {}, []);
  29017. var hooks$1 = ['create', 'activate', 'update', 'remove', 'destroy'];
  29018. function isUndef (s) {
  29019. return s == null
  29020. }
  29021. function isDef (s) {
  29022. return s != null
  29023. }
  29024. function sameVnode (vnode1, vnode2) {
  29025. return (
  29026. vnode1.key === vnode2.key &&
  29027. vnode1.tag === vnode2.tag &&
  29028. vnode1.isComment === vnode2.isComment &&
  29029. !vnode1.data === !vnode2.data
  29030. )
  29031. }
  29032. function createKeyToOldIdx (children, beginIdx, endIdx) {
  29033. var i, key;
  29034. var map = {};
  29035. for (i = beginIdx; i <= endIdx; ++i) {
  29036. key = children[i].key;
  29037. if (isDef(key)) { map[key] = i; }
  29038. }
  29039. return map
  29040. }
  29041. function createPatchFunction (backend) {
  29042. var i, j;
  29043. var cbs = {};
  29044. var modules = backend.modules;
  29045. var nodeOps = backend.nodeOps;
  29046. for (i = 0; i < hooks$1.length; ++i) {
  29047. cbs[hooks$1[i]] = [];
  29048. for (j = 0; j < modules.length; ++j) {
  29049. if (modules[j][hooks$1[i]] !== undefined) { cbs[hooks$1[i]].push(modules[j][hooks$1[i]]); }
  29050. }
  29051. }
  29052. function emptyNodeAt (elm) {
  29053. return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
  29054. }
  29055. function createRmCb (childElm, listeners) {
  29056. function remove$$1 () {
  29057. if (--remove$$1.listeners === 0) {
  29058. removeNode(childElm);
  29059. }
  29060. }
  29061. remove$$1.listeners = listeners;
  29062. return remove$$1
  29063. }
  29064. function removeNode (el) {
  29065. var parent = nodeOps.parentNode(el);
  29066. // element may have already been removed due to v-html / v-text
  29067. if (parent) {
  29068. nodeOps.removeChild(parent, el);
  29069. }
  29070. }
  29071. var inPre = 0;
  29072. function createElm (vnode, insertedVnodeQueue, parentElm, refElm, nested) {
  29073. vnode.isRootInsert = !nested; // for transition enter check
  29074. if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
  29075. return
  29076. }
  29077. var data = vnode.data;
  29078. var children = vnode.children;
  29079. var tag = vnode.tag;
  29080. if (isDef(tag)) {
  29081. if (process.env.NODE_ENV !== 'production') {
  29082. if (data && data.pre) {
  29083. inPre++;
  29084. }
  29085. if (
  29086. !inPre &&
  29087. !vnode.ns &&
  29088. !(config.ignoredElements.length && config.ignoredElements.indexOf(tag) > -1) &&
  29089. config.isUnknownElement(tag)
  29090. ) {
  29091. warn(
  29092. 'Unknown custom element: <' + tag + '> - did you ' +
  29093. 'register the component correctly? For recursive components, ' +
  29094. 'make sure to provide the "name" option.',
  29095. vnode.context
  29096. );
  29097. }
  29098. }
  29099. vnode.elm = vnode.ns
  29100. ? nodeOps.createElementNS(vnode.ns, tag)
  29101. : nodeOps.createElement(tag, vnode);
  29102. setScope(vnode);
  29103. /* istanbul ignore if */
  29104. {
  29105. createChildren(vnode, children, insertedVnodeQueue);
  29106. if (isDef(data)) {
  29107. invokeCreateHooks(vnode, insertedVnodeQueue);
  29108. }
  29109. insert(parentElm, vnode.elm, refElm);
  29110. }
  29111. if (process.env.NODE_ENV !== 'production' && data && data.pre) {
  29112. inPre--;
  29113. }
  29114. } else if (vnode.isComment) {
  29115. vnode.elm = nodeOps.createComment(vnode.text);
  29116. insert(parentElm, vnode.elm, refElm);
  29117. } else {
  29118. vnode.elm = nodeOps.createTextNode(vnode.text);
  29119. insert(parentElm, vnode.elm, refElm);
  29120. }
  29121. }
  29122. function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
  29123. var i = vnode.data;
  29124. if (isDef(i)) {
  29125. var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
  29126. if (isDef(i = i.hook) && isDef(i = i.init)) {
  29127. i(vnode, false /* hydrating */, parentElm, refElm);
  29128. }
  29129. // after calling the init hook, if the vnode is a child component
  29130. // it should've created a child instance and mounted it. the child
  29131. // component also has set the placeholder vnode's elm.
  29132. // in that case we can just return the element and be done.
  29133. if (isDef(vnode.componentInstance)) {
  29134. initComponent(vnode, insertedVnodeQueue);
  29135. if (isReactivated) {
  29136. reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
  29137. }
  29138. return true
  29139. }
  29140. }
  29141. }
  29142. function initComponent (vnode, insertedVnodeQueue) {
  29143. if (vnode.data.pendingInsert) {
  29144. insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
  29145. }
  29146. vnode.elm = vnode.componentInstance.$el;
  29147. if (isPatchable(vnode)) {
  29148. invokeCreateHooks(vnode, insertedVnodeQueue);
  29149. setScope(vnode);
  29150. } else {
  29151. // empty component root.
  29152. // skip all element-related modules except for ref (#3455)
  29153. registerRef(vnode);
  29154. // make sure to invoke the insert hook
  29155. insertedVnodeQueue.push(vnode);
  29156. }
  29157. }
  29158. function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
  29159. var i;
  29160. // hack for #4339: a reactivated component with inner transition
  29161. // does not trigger because the inner node's created hooks are not called
  29162. // again. It's not ideal to involve module-specific logic in here but
  29163. // there doesn't seem to be a better way to do it.
  29164. var innerNode = vnode;
  29165. while (innerNode.componentInstance) {
  29166. innerNode = innerNode.componentInstance._vnode;
  29167. if (isDef(i = innerNode.data) && isDef(i = i.transition)) {
  29168. for (i = 0; i < cbs.activate.length; ++i) {
  29169. cbs.activate[i](emptyNode, innerNode);
  29170. }
  29171. insertedVnodeQueue.push(innerNode);
  29172. break
  29173. }
  29174. }
  29175. // unlike a newly created component,
  29176. // a reactivated keep-alive component doesn't insert itself
  29177. insert(parentElm, vnode.elm, refElm);
  29178. }
  29179. function insert (parent, elm, ref) {
  29180. if (parent) {
  29181. if (ref) {
  29182. nodeOps.insertBefore(parent, elm, ref);
  29183. } else {
  29184. nodeOps.appendChild(parent, elm);
  29185. }
  29186. }
  29187. }
  29188. function createChildren (vnode, children, insertedVnodeQueue) {
  29189. if (Array.isArray(children)) {
  29190. for (var i = 0; i < children.length; ++i) {
  29191. createElm(children[i], insertedVnodeQueue, vnode.elm, null, true);
  29192. }
  29193. } else if (isPrimitive(vnode.text)) {
  29194. nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(vnode.text));
  29195. }
  29196. }
  29197. function isPatchable (vnode) {
  29198. while (vnode.componentInstance) {
  29199. vnode = vnode.componentInstance._vnode;
  29200. }
  29201. return isDef(vnode.tag)
  29202. }
  29203. function invokeCreateHooks (vnode, insertedVnodeQueue) {
  29204. for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
  29205. cbs.create[i$1](emptyNode, vnode);
  29206. }
  29207. i = vnode.data.hook; // Reuse variable
  29208. if (isDef(i)) {
  29209. if (i.create) { i.create(emptyNode, vnode); }
  29210. if (i.insert) { insertedVnodeQueue.push(vnode); }
  29211. }
  29212. }
  29213. // set scope id attribute for scoped CSS.
  29214. // this is implemented as a special case to avoid the overhead
  29215. // of going through the normal attribute patching process.
  29216. function setScope (vnode) {
  29217. var i;
  29218. if (isDef(i = vnode.context) && isDef(i = i.$options._scopeId)) {
  29219. nodeOps.setAttribute(vnode.elm, i, '');
  29220. }
  29221. if (isDef(i = activeInstance) &&
  29222. i !== vnode.context &&
  29223. isDef(i = i.$options._scopeId)) {
  29224. nodeOps.setAttribute(vnode.elm, i, '');
  29225. }
  29226. }
  29227. function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
  29228. for (; startIdx <= endIdx; ++startIdx) {
  29229. createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm);
  29230. }
  29231. }
  29232. function invokeDestroyHook (vnode) {
  29233. var i, j;
  29234. var data = vnode.data;
  29235. if (isDef(data)) {
  29236. if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }
  29237. for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }
  29238. }
  29239. if (isDef(i = vnode.children)) {
  29240. for (j = 0; j < vnode.children.length; ++j) {
  29241. invokeDestroyHook(vnode.children[j]);
  29242. }
  29243. }
  29244. }
  29245. function removeVnodes (parentElm, vnodes, startIdx, endIdx) {
  29246. for (; startIdx <= endIdx; ++startIdx) {
  29247. var ch = vnodes[startIdx];
  29248. if (isDef(ch)) {
  29249. if (isDef(ch.tag)) {
  29250. removeAndInvokeRemoveHook(ch);
  29251. invokeDestroyHook(ch);
  29252. } else { // Text node
  29253. removeNode(ch.elm);
  29254. }
  29255. }
  29256. }
  29257. }
  29258. function removeAndInvokeRemoveHook (vnode, rm) {
  29259. if (rm || isDef(vnode.data)) {
  29260. var listeners = cbs.remove.length + 1;
  29261. if (!rm) {
  29262. // directly removing
  29263. rm = createRmCb(vnode.elm, listeners);
  29264. } else {
  29265. // we have a recursively passed down rm callback
  29266. // increase the listeners count
  29267. rm.listeners += listeners;
  29268. }
  29269. // recursively invoke hooks on child component root node
  29270. if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
  29271. removeAndInvokeRemoveHook(i, rm);
  29272. }
  29273. for (i = 0; i < cbs.remove.length; ++i) {
  29274. cbs.remove[i](vnode, rm);
  29275. }
  29276. if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
  29277. i(vnode, rm);
  29278. } else {
  29279. rm();
  29280. }
  29281. } else {
  29282. removeNode(vnode.elm);
  29283. }
  29284. }
  29285. function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
  29286. var oldStartIdx = 0;
  29287. var newStartIdx = 0;
  29288. var oldEndIdx = oldCh.length - 1;
  29289. var oldStartVnode = oldCh[0];
  29290. var oldEndVnode = oldCh[oldEndIdx];
  29291. var newEndIdx = newCh.length - 1;
  29292. var newStartVnode = newCh[0];
  29293. var newEndVnode = newCh[newEndIdx];
  29294. var oldKeyToIdx, idxInOld, elmToMove, refElm;
  29295. // removeOnly is a special flag used only by <transition-group>
  29296. // to ensure removed elements stay in correct relative positions
  29297. // during leaving transitions
  29298. var canMove = !removeOnly;
  29299. while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
  29300. if (isUndef(oldStartVnode)) {
  29301. oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
  29302. } else if (isUndef(oldEndVnode)) {
  29303. oldEndVnode = oldCh[--oldEndIdx];
  29304. } else if (sameVnode(oldStartVnode, newStartVnode)) {
  29305. patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue);
  29306. oldStartVnode = oldCh[++oldStartIdx];
  29307. newStartVnode = newCh[++newStartIdx];
  29308. } else if (sameVnode(oldEndVnode, newEndVnode)) {
  29309. patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue);
  29310. oldEndVnode = oldCh[--oldEndIdx];
  29311. newEndVnode = newCh[--newEndIdx];
  29312. } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right
  29313. patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue);
  29314. canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
  29315. oldStartVnode = oldCh[++oldStartIdx];
  29316. newEndVnode = newCh[--newEndIdx];
  29317. } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left
  29318. patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue);
  29319. canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
  29320. oldEndVnode = oldCh[--oldEndIdx];
  29321. newStartVnode = newCh[++newStartIdx];
  29322. } else {
  29323. if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }
  29324. idxInOld = isDef(newStartVnode.key) ? oldKeyToIdx[newStartVnode.key] : null;
  29325. if (isUndef(idxInOld)) { // New element
  29326. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);
  29327. newStartVnode = newCh[++newStartIdx];
  29328. } else {
  29329. elmToMove = oldCh[idxInOld];
  29330. /* istanbul ignore if */
  29331. if (process.env.NODE_ENV !== 'production' && !elmToMove) {
  29332. warn(
  29333. 'It seems there are duplicate keys that is causing an update error. ' +
  29334. 'Make sure each v-for item has a unique key.'
  29335. );
  29336. }
  29337. if (sameVnode(elmToMove, newStartVnode)) {
  29338. patchVnode(elmToMove, newStartVnode, insertedVnodeQueue);
  29339. oldCh[idxInOld] = undefined;
  29340. canMove && nodeOps.insertBefore(parentElm, newStartVnode.elm, oldStartVnode.elm);
  29341. newStartVnode = newCh[++newStartIdx];
  29342. } else {
  29343. // same key but different element. treat as new element
  29344. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);
  29345. newStartVnode = newCh[++newStartIdx];
  29346. }
  29347. }
  29348. }
  29349. }
  29350. if (oldStartIdx > oldEndIdx) {
  29351. refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
  29352. addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
  29353. } else if (newStartIdx > newEndIdx) {
  29354. removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);
  29355. }
  29356. }
  29357. function patchVnode (oldVnode, vnode, insertedVnodeQueue, removeOnly) {
  29358. if (oldVnode === vnode) {
  29359. return
  29360. }
  29361. // reuse element for static trees.
  29362. // note we only do this if the vnode is cloned -
  29363. // if the new node is not cloned it means the render functions have been
  29364. // reset by the hot-reload-api and we need to do a proper re-render.
  29365. if (vnode.isStatic &&
  29366. oldVnode.isStatic &&
  29367. vnode.key === oldVnode.key &&
  29368. (vnode.isCloned || vnode.isOnce)) {
  29369. vnode.elm = oldVnode.elm;
  29370. vnode.componentInstance = oldVnode.componentInstance;
  29371. return
  29372. }
  29373. var i;
  29374. var data = vnode.data;
  29375. var hasData = isDef(data);
  29376. if (hasData && isDef(i = data.hook) && isDef(i = i.prepatch)) {
  29377. i(oldVnode, vnode);
  29378. }
  29379. var elm = vnode.elm = oldVnode.elm;
  29380. var oldCh = oldVnode.children;
  29381. var ch = vnode.children;
  29382. if (hasData && isPatchable(vnode)) {
  29383. for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }
  29384. if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }
  29385. }
  29386. if (isUndef(vnode.text)) {
  29387. if (isDef(oldCh) && isDef(ch)) {
  29388. if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }
  29389. } else if (isDef(ch)) {
  29390. if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
  29391. addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
  29392. } else if (isDef(oldCh)) {
  29393. removeVnodes(elm, oldCh, 0, oldCh.length - 1);
  29394. } else if (isDef(oldVnode.text)) {
  29395. nodeOps.setTextContent(elm, '');
  29396. }
  29397. } else if (oldVnode.text !== vnode.text) {
  29398. nodeOps.setTextContent(elm, vnode.text);
  29399. }
  29400. if (hasData) {
  29401. if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }
  29402. }
  29403. }
  29404. function invokeInsertHook (vnode, queue, initial) {
  29405. // delay insert hooks for component root nodes, invoke them after the
  29406. // element is really inserted
  29407. if (initial && vnode.parent) {
  29408. vnode.parent.data.pendingInsert = queue;
  29409. } else {
  29410. for (var i = 0; i < queue.length; ++i) {
  29411. queue[i].data.hook.insert(queue[i]);
  29412. }
  29413. }
  29414. }
  29415. var bailed = false;
  29416. // list of modules that can skip create hook during hydration because they
  29417. // are already rendered on the client or has no need for initialization
  29418. var isRenderedModule = makeMap('attrs,style,class,staticClass,staticStyle,key');
  29419. // Note: this is a browser-only function so we can assume elms are DOM nodes.
  29420. function hydrate (elm, vnode, insertedVnodeQueue) {
  29421. if (process.env.NODE_ENV !== 'production') {
  29422. if (!assertNodeMatch(elm, vnode)) {
  29423. return false
  29424. }
  29425. }
  29426. vnode.elm = elm;
  29427. var tag = vnode.tag;
  29428. var data = vnode.data;
  29429. var children = vnode.children;
  29430. if (isDef(data)) {
  29431. if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }
  29432. if (isDef(i = vnode.componentInstance)) {
  29433. // child component. it should have hydrated its own tree.
  29434. initComponent(vnode, insertedVnodeQueue);
  29435. return true
  29436. }
  29437. }
  29438. if (isDef(tag)) {
  29439. if (isDef(children)) {
  29440. // empty element, allow client to pick up and populate children
  29441. if (!elm.hasChildNodes()) {
  29442. createChildren(vnode, children, insertedVnodeQueue);
  29443. } else {
  29444. var childrenMatch = true;
  29445. var childNode = elm.firstChild;
  29446. for (var i$1 = 0; i$1 < children.length; i$1++) {
  29447. if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue)) {
  29448. childrenMatch = false;
  29449. break
  29450. }
  29451. childNode = childNode.nextSibling;
  29452. }
  29453. // if childNode is not null, it means the actual childNodes list is
  29454. // longer than the virtual children list.
  29455. if (!childrenMatch || childNode) {
  29456. if (process.env.NODE_ENV !== 'production' &&
  29457. typeof console !== 'undefined' &&
  29458. !bailed) {
  29459. bailed = true;
  29460. console.warn('Parent: ', elm);
  29461. console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
  29462. }
  29463. return false
  29464. }
  29465. }
  29466. }
  29467. if (isDef(data)) {
  29468. for (var key in data) {
  29469. if (!isRenderedModule(key)) {
  29470. invokeCreateHooks(vnode, insertedVnodeQueue);
  29471. break
  29472. }
  29473. }
  29474. }
  29475. } else if (elm.data !== vnode.text) {
  29476. elm.data = vnode.text;
  29477. }
  29478. return true
  29479. }
  29480. function assertNodeMatch (node, vnode) {
  29481. if (vnode.tag) {
  29482. return (
  29483. vnode.tag.indexOf('vue-component') === 0 ||
  29484. vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())
  29485. )
  29486. } else {
  29487. return node.nodeType === (vnode.isComment ? 8 : 3)
  29488. }
  29489. }
  29490. return function patch (oldVnode, vnode, hydrating, removeOnly, parentElm, refElm) {
  29491. if (!vnode) {
  29492. if (oldVnode) { invokeDestroyHook(oldVnode); }
  29493. return
  29494. }
  29495. var isInitialPatch = false;
  29496. var insertedVnodeQueue = [];
  29497. if (!oldVnode) {
  29498. // empty mount (likely as component), create new root element
  29499. isInitialPatch = true;
  29500. createElm(vnode, insertedVnodeQueue, parentElm, refElm);
  29501. } else {
  29502. var isRealElement = isDef(oldVnode.nodeType);
  29503. if (!isRealElement && sameVnode(oldVnode, vnode)) {
  29504. // patch existing root node
  29505. patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly);
  29506. } else {
  29507. if (isRealElement) {
  29508. // mounting to a real element
  29509. // check if this is server-rendered content and if we can perform
  29510. // a successful hydration.
  29511. if (oldVnode.nodeType === 1 && oldVnode.hasAttribute('server-rendered')) {
  29512. oldVnode.removeAttribute('server-rendered');
  29513. hydrating = true;
  29514. }
  29515. if (hydrating) {
  29516. if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
  29517. invokeInsertHook(vnode, insertedVnodeQueue, true);
  29518. return oldVnode
  29519. } else if (process.env.NODE_ENV !== 'production') {
  29520. warn(
  29521. 'The client-side rendered virtual DOM tree is not matching ' +
  29522. 'server-rendered content. This is likely caused by incorrect ' +
  29523. 'HTML markup, for example nesting block-level elements inside ' +
  29524. '<p>, or missing <tbody>. Bailing hydration and performing ' +
  29525. 'full client-side render.'
  29526. );
  29527. }
  29528. }
  29529. // either not server-rendered, or hydration failed.
  29530. // create an empty node and replace it
  29531. oldVnode = emptyNodeAt(oldVnode);
  29532. }
  29533. // replacing existing element
  29534. var oldElm = oldVnode.elm;
  29535. var parentElm$1 = nodeOps.parentNode(oldElm);
  29536. createElm(
  29537. vnode,
  29538. insertedVnodeQueue,
  29539. // extremely rare edge case: do not insert if old element is in a
  29540. // leaving transition. Only happens when combining transition +
  29541. // keep-alive + HOCs. (#4590)
  29542. oldElm._leaveCb ? null : parentElm$1,
  29543. nodeOps.nextSibling(oldElm)
  29544. );
  29545. if (vnode.parent) {
  29546. // component root element replaced.
  29547. // update parent placeholder node element, recursively
  29548. var ancestor = vnode.parent;
  29549. while (ancestor) {
  29550. ancestor.elm = vnode.elm;
  29551. ancestor = ancestor.parent;
  29552. }
  29553. if (isPatchable(vnode)) {
  29554. for (var i = 0; i < cbs.create.length; ++i) {
  29555. cbs.create[i](emptyNode, vnode.parent);
  29556. }
  29557. }
  29558. }
  29559. if (parentElm$1 !== null) {
  29560. removeVnodes(parentElm$1, [oldVnode], 0, 0);
  29561. } else if (isDef(oldVnode.tag)) {
  29562. invokeDestroyHook(oldVnode);
  29563. }
  29564. }
  29565. }
  29566. invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
  29567. return vnode.elm
  29568. }
  29569. }
  29570. /* */
  29571. var directives = {
  29572. create: updateDirectives,
  29573. update: updateDirectives,
  29574. destroy: function unbindDirectives (vnode) {
  29575. updateDirectives(vnode, emptyNode);
  29576. }
  29577. };
  29578. function updateDirectives (oldVnode, vnode) {
  29579. if (oldVnode.data.directives || vnode.data.directives) {
  29580. _update(oldVnode, vnode);
  29581. }
  29582. }
  29583. function _update (oldVnode, vnode) {
  29584. var isCreate = oldVnode === emptyNode;
  29585. var isDestroy = vnode === emptyNode;
  29586. var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
  29587. var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
  29588. var dirsWithInsert = [];
  29589. var dirsWithPostpatch = [];
  29590. var key, oldDir, dir;
  29591. for (key in newDirs) {
  29592. oldDir = oldDirs[key];
  29593. dir = newDirs[key];
  29594. if (!oldDir) {
  29595. // new directive, bind
  29596. callHook$1(dir, 'bind', vnode, oldVnode);
  29597. if (dir.def && dir.def.inserted) {
  29598. dirsWithInsert.push(dir);
  29599. }
  29600. } else {
  29601. // existing directive, update
  29602. dir.oldValue = oldDir.value;
  29603. callHook$1(dir, 'update', vnode, oldVnode);
  29604. if (dir.def && dir.def.componentUpdated) {
  29605. dirsWithPostpatch.push(dir);
  29606. }
  29607. }
  29608. }
  29609. if (dirsWithInsert.length) {
  29610. var callInsert = function () {
  29611. for (var i = 0; i < dirsWithInsert.length; i++) {
  29612. callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);
  29613. }
  29614. };
  29615. if (isCreate) {
  29616. mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', callInsert, 'dir-insert');
  29617. } else {
  29618. callInsert();
  29619. }
  29620. }
  29621. if (dirsWithPostpatch.length) {
  29622. mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'postpatch', function () {
  29623. for (var i = 0; i < dirsWithPostpatch.length; i++) {
  29624. callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
  29625. }
  29626. }, 'dir-postpatch');
  29627. }
  29628. if (!isCreate) {
  29629. for (key in oldDirs) {
  29630. if (!newDirs[key]) {
  29631. // no longer present, unbind
  29632. callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
  29633. }
  29634. }
  29635. }
  29636. }
  29637. var emptyModifiers = Object.create(null);
  29638. function normalizeDirectives$1 (
  29639. dirs,
  29640. vm
  29641. ) {
  29642. var res = Object.create(null);
  29643. if (!dirs) {
  29644. return res
  29645. }
  29646. var i, dir;
  29647. for (i = 0; i < dirs.length; i++) {
  29648. dir = dirs[i];
  29649. if (!dir.modifiers) {
  29650. dir.modifiers = emptyModifiers;
  29651. }
  29652. res[getRawDirName(dir)] = dir;
  29653. dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
  29654. }
  29655. return res
  29656. }
  29657. function getRawDirName (dir) {
  29658. return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.')))
  29659. }
  29660. function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) {
  29661. var fn = dir.def && dir.def[hook];
  29662. if (fn) {
  29663. fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
  29664. }
  29665. }
  29666. var baseModules = [
  29667. ref,
  29668. directives
  29669. ];
  29670. /* */
  29671. function updateAttrs (oldVnode, vnode) {
  29672. if (!oldVnode.data.attrs && !vnode.data.attrs) {
  29673. return
  29674. }
  29675. var key, cur, old;
  29676. var elm = vnode.elm;
  29677. var oldAttrs = oldVnode.data.attrs || {};
  29678. var attrs = vnode.data.attrs || {};
  29679. // clone observed objects, as the user probably wants to mutate it
  29680. if (attrs.__ob__) {
  29681. attrs = vnode.data.attrs = extend({}, attrs);
  29682. }
  29683. for (key in attrs) {
  29684. cur = attrs[key];
  29685. old = oldAttrs[key];
  29686. if (old !== cur) {
  29687. setAttr(elm, key, cur);
  29688. }
  29689. }
  29690. // #4391: in IE9, setting type can reset value for input[type=radio]
  29691. /* istanbul ignore if */
  29692. if (isIE9 && attrs.value !== oldAttrs.value) {
  29693. setAttr(elm, 'value', attrs.value);
  29694. }
  29695. for (key in oldAttrs) {
  29696. if (attrs[key] == null) {
  29697. if (isXlink(key)) {
  29698. elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
  29699. } else if (!isEnumeratedAttr(key)) {
  29700. elm.removeAttribute(key);
  29701. }
  29702. }
  29703. }
  29704. }
  29705. function setAttr (el, key, value) {
  29706. if (isBooleanAttr(key)) {
  29707. // set attribute for blank value
  29708. // e.g. <option disabled>Select one</option>
  29709. if (isFalsyAttrValue(value)) {
  29710. el.removeAttribute(key);
  29711. } else {
  29712. el.setAttribute(key, key);
  29713. }
  29714. } else if (isEnumeratedAttr(key)) {
  29715. el.setAttribute(key, isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true');
  29716. } else if (isXlink(key)) {
  29717. if (isFalsyAttrValue(value)) {
  29718. el.removeAttributeNS(xlinkNS, getXlinkProp(key));
  29719. } else {
  29720. el.setAttributeNS(xlinkNS, key, value);
  29721. }
  29722. } else {
  29723. if (isFalsyAttrValue(value)) {
  29724. el.removeAttribute(key);
  29725. } else {
  29726. el.setAttribute(key, value);
  29727. }
  29728. }
  29729. }
  29730. var attrs = {
  29731. create: updateAttrs,
  29732. update: updateAttrs
  29733. };
  29734. /* */
  29735. function updateClass (oldVnode, vnode) {
  29736. var el = vnode.elm;
  29737. var data = vnode.data;
  29738. var oldData = oldVnode.data;
  29739. if (!data.staticClass && !data.class &&
  29740. (!oldData || (!oldData.staticClass && !oldData.class))) {
  29741. return
  29742. }
  29743. var cls = genClassForVnode(vnode);
  29744. // handle transition classes
  29745. var transitionClass = el._transitionClasses;
  29746. if (transitionClass) {
  29747. cls = concat(cls, stringifyClass(transitionClass));
  29748. }
  29749. // set the class
  29750. if (cls !== el._prevClass) {
  29751. el.setAttribute('class', cls);
  29752. el._prevClass = cls;
  29753. }
  29754. }
  29755. var klass = {
  29756. create: updateClass,
  29757. update: updateClass
  29758. };
  29759. /* */
  29760. var target$1;
  29761. function add$2 (
  29762. event,
  29763. handler,
  29764. once,
  29765. capture
  29766. ) {
  29767. if (once) {
  29768. var oldHandler = handler;
  29769. var _target = target$1; // save current target element in closure
  29770. handler = function (ev) {
  29771. remove$3(event, handler, capture, _target);
  29772. arguments.length === 1
  29773. ? oldHandler(ev)
  29774. : oldHandler.apply(null, arguments);
  29775. };
  29776. }
  29777. target$1.addEventListener(event, handler, capture);
  29778. }
  29779. function remove$3 (
  29780. event,
  29781. handler,
  29782. capture,
  29783. _target
  29784. ) {
  29785. (_target || target$1).removeEventListener(event, handler, capture);
  29786. }
  29787. function updateDOMListeners (oldVnode, vnode) {
  29788. if (!oldVnode.data.on && !vnode.data.on) {
  29789. return
  29790. }
  29791. var on = vnode.data.on || {};
  29792. var oldOn = oldVnode.data.on || {};
  29793. target$1 = vnode.elm;
  29794. updateListeners(on, oldOn, add$2, remove$3, vnode.context);
  29795. }
  29796. var events = {
  29797. create: updateDOMListeners,
  29798. update: updateDOMListeners
  29799. };
  29800. /* */
  29801. function updateDOMProps (oldVnode, vnode) {
  29802. if (!oldVnode.data.domProps && !vnode.data.domProps) {
  29803. return
  29804. }
  29805. var key, cur;
  29806. var elm = vnode.elm;
  29807. var oldProps = oldVnode.data.domProps || {};
  29808. var props = vnode.data.domProps || {};
  29809. // clone observed objects, as the user probably wants to mutate it
  29810. if (props.__ob__) {
  29811. props = vnode.data.domProps = extend({}, props);
  29812. }
  29813. for (key in oldProps) {
  29814. if (props[key] == null) {
  29815. elm[key] = '';
  29816. }
  29817. }
  29818. for (key in props) {
  29819. cur = props[key];
  29820. // ignore children if the node has textContent or innerHTML,
  29821. // as these will throw away existing DOM nodes and cause removal errors
  29822. // on subsequent patches (#3360)
  29823. if (key === 'textContent' || key === 'innerHTML') {
  29824. if (vnode.children) { vnode.children.length = 0; }
  29825. if (cur === oldProps[key]) { continue }
  29826. }
  29827. if (key === 'value') {
  29828. // store value as _value as well since
  29829. // non-string values will be stringified
  29830. elm._value = cur;
  29831. // avoid resetting cursor position when value is the same
  29832. var strCur = cur == null ? '' : String(cur);
  29833. if (shouldUpdateValue(elm, vnode, strCur)) {
  29834. elm.value = strCur;
  29835. }
  29836. } else {
  29837. elm[key] = cur;
  29838. }
  29839. }
  29840. }
  29841. // check platforms/web/util/attrs.js acceptValue
  29842. function shouldUpdateValue (
  29843. elm,
  29844. vnode,
  29845. checkVal
  29846. ) {
  29847. return (!elm.composing && (
  29848. vnode.tag === 'option' ||
  29849. isDirty(elm, checkVal) ||
  29850. isInputChanged(vnode, checkVal)
  29851. ))
  29852. }
  29853. function isDirty (elm, checkVal) {
  29854. // return true when textbox (.number and .trim) loses focus and its value is not equal to the updated value
  29855. return document.activeElement !== elm && elm.value !== checkVal
  29856. }
  29857. function isInputChanged (vnode, newVal) {
  29858. var value = vnode.elm.value;
  29859. var modifiers = vnode.elm._vModifiers; // injected by v-model runtime
  29860. if ((modifiers && modifiers.number) || vnode.elm.type === 'number') {
  29861. return toNumber(value) !== toNumber(newVal)
  29862. }
  29863. if (modifiers && modifiers.trim) {
  29864. return value.trim() !== newVal.trim()
  29865. }
  29866. return value !== newVal
  29867. }
  29868. var domProps = {
  29869. create: updateDOMProps,
  29870. update: updateDOMProps
  29871. };
  29872. /* */
  29873. var parseStyleText = cached(function (cssText) {
  29874. var res = {};
  29875. var listDelimiter = /;(?![^(]*\))/g;
  29876. var propertyDelimiter = /:(.+)/;
  29877. cssText.split(listDelimiter).forEach(function (item) {
  29878. if (item) {
  29879. var tmp = item.split(propertyDelimiter);
  29880. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  29881. }
  29882. });
  29883. return res
  29884. });
  29885. // merge static and dynamic style data on the same vnode
  29886. function normalizeStyleData (data) {
  29887. var style = normalizeStyleBinding(data.style);
  29888. // static style is pre-processed into an object during compilation
  29889. // and is always a fresh object, so it's safe to merge into it
  29890. return data.staticStyle
  29891. ? extend(data.staticStyle, style)
  29892. : style
  29893. }
  29894. // normalize possible array / string values into Object
  29895. function normalizeStyleBinding (bindingStyle) {
  29896. if (Array.isArray(bindingStyle)) {
  29897. return toObject(bindingStyle)
  29898. }
  29899. if (typeof bindingStyle === 'string') {
  29900. return parseStyleText(bindingStyle)
  29901. }
  29902. return bindingStyle
  29903. }
  29904. /**
  29905. * parent component style should be after child's
  29906. * so that parent component's style could override it
  29907. */
  29908. function getStyle (vnode, checkChild) {
  29909. var res = {};
  29910. var styleData;
  29911. if (checkChild) {
  29912. var childNode = vnode;
  29913. while (childNode.componentInstance) {
  29914. childNode = childNode.componentInstance._vnode;
  29915. if (childNode.data && (styleData = normalizeStyleData(childNode.data))) {
  29916. extend(res, styleData);
  29917. }
  29918. }
  29919. }
  29920. if ((styleData = normalizeStyleData(vnode.data))) {
  29921. extend(res, styleData);
  29922. }
  29923. var parentNode = vnode;
  29924. while ((parentNode = parentNode.parent)) {
  29925. if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
  29926. extend(res, styleData);
  29927. }
  29928. }
  29929. return res
  29930. }
  29931. /* */
  29932. var cssVarRE = /^--/;
  29933. var importantRE = /\s*!important$/;
  29934. var setProp = function (el, name, val) {
  29935. /* istanbul ignore if */
  29936. if (cssVarRE.test(name)) {
  29937. el.style.setProperty(name, val);
  29938. } else if (importantRE.test(val)) {
  29939. el.style.setProperty(name, val.replace(importantRE, ''), 'important');
  29940. } else {
  29941. el.style[normalize(name)] = val;
  29942. }
  29943. };
  29944. var prefixes = ['Webkit', 'Moz', 'ms'];
  29945. var testEl;
  29946. var normalize = cached(function (prop) {
  29947. testEl = testEl || document.createElement('div');
  29948. prop = camelize(prop);
  29949. if (prop !== 'filter' && (prop in testEl.style)) {
  29950. return prop
  29951. }
  29952. var upper = prop.charAt(0).toUpperCase() + prop.slice(1);
  29953. for (var i = 0; i < prefixes.length; i++) {
  29954. var prefixed = prefixes[i] + upper;
  29955. if (prefixed in testEl.style) {
  29956. return prefixed
  29957. }
  29958. }
  29959. });
  29960. function updateStyle (oldVnode, vnode) {
  29961. var data = vnode.data;
  29962. var oldData = oldVnode.data;
  29963. if (!data.staticStyle && !data.style &&
  29964. !oldData.staticStyle && !oldData.style) {
  29965. return
  29966. }
  29967. var cur, name;
  29968. var el = vnode.elm;
  29969. var oldStaticStyle = oldVnode.data.staticStyle;
  29970. var oldStyleBinding = oldVnode.data.style || {};
  29971. // if static style exists, stylebinding already merged into it when doing normalizeStyleData
  29972. var oldStyle = oldStaticStyle || oldStyleBinding;
  29973. var style = normalizeStyleBinding(vnode.data.style) || {};
  29974. vnode.data.style = style.__ob__ ? extend({}, style) : style;
  29975. var newStyle = getStyle(vnode, true);
  29976. for (name in oldStyle) {
  29977. if (newStyle[name] == null) {
  29978. setProp(el, name, '');
  29979. }
  29980. }
  29981. for (name in newStyle) {
  29982. cur = newStyle[name];
  29983. if (cur !== oldStyle[name]) {
  29984. // ie9 setting to null has no effect, must use empty string
  29985. setProp(el, name, cur == null ? '' : cur);
  29986. }
  29987. }
  29988. }
  29989. var style = {
  29990. create: updateStyle,
  29991. update: updateStyle
  29992. };
  29993. /* */
  29994. /**
  29995. * Add class with compatibility for SVG since classList is not supported on
  29996. * SVG elements in IE
  29997. */
  29998. function addClass (el, cls) {
  29999. /* istanbul ignore if */
  30000. if (!cls || !cls.trim()) {
  30001. return
  30002. }
  30003. /* istanbul ignore else */
  30004. if (el.classList) {
  30005. if (cls.indexOf(' ') > -1) {
  30006. cls.split(/\s+/).forEach(function (c) { return el.classList.add(c); });
  30007. } else {
  30008. el.classList.add(cls);
  30009. }
  30010. } else {
  30011. var cur = ' ' + el.getAttribute('class') + ' ';
  30012. if (cur.indexOf(' ' + cls + ' ') < 0) {
  30013. el.setAttribute('class', (cur + cls).trim());
  30014. }
  30015. }
  30016. }
  30017. /**
  30018. * Remove class with compatibility for SVG since classList is not supported on
  30019. * SVG elements in IE
  30020. */
  30021. function removeClass (el, cls) {
  30022. /* istanbul ignore if */
  30023. if (!cls || !cls.trim()) {
  30024. return
  30025. }
  30026. /* istanbul ignore else */
  30027. if (el.classList) {
  30028. if (cls.indexOf(' ') > -1) {
  30029. cls.split(/\s+/).forEach(function (c) { return el.classList.remove(c); });
  30030. } else {
  30031. el.classList.remove(cls);
  30032. }
  30033. } else {
  30034. var cur = ' ' + el.getAttribute('class') + ' ';
  30035. var tar = ' ' + cls + ' ';
  30036. while (cur.indexOf(tar) >= 0) {
  30037. cur = cur.replace(tar, ' ');
  30038. }
  30039. el.setAttribute('class', cur.trim());
  30040. }
  30041. }
  30042. /* */
  30043. var hasTransition = inBrowser && !isIE9;
  30044. var TRANSITION = 'transition';
  30045. var ANIMATION = 'animation';
  30046. // Transition property/event sniffing
  30047. var transitionProp = 'transition';
  30048. var transitionEndEvent = 'transitionend';
  30049. var animationProp = 'animation';
  30050. var animationEndEvent = 'animationend';
  30051. if (hasTransition) {
  30052. /* istanbul ignore if */
  30053. if (window.ontransitionend === undefined &&
  30054. window.onwebkittransitionend !== undefined) {
  30055. transitionProp = 'WebkitTransition';
  30056. transitionEndEvent = 'webkitTransitionEnd';
  30057. }
  30058. if (window.onanimationend === undefined &&
  30059. window.onwebkitanimationend !== undefined) {
  30060. animationProp = 'WebkitAnimation';
  30061. animationEndEvent = 'webkitAnimationEnd';
  30062. }
  30063. }
  30064. // binding to window is necessary to make hot reload work in IE in strict mode
  30065. var raf = inBrowser && window.requestAnimationFrame
  30066. ? window.requestAnimationFrame.bind(window)
  30067. : setTimeout;
  30068. function nextFrame (fn) {
  30069. raf(function () {
  30070. raf(fn);
  30071. });
  30072. }
  30073. function addTransitionClass (el, cls) {
  30074. (el._transitionClasses || (el._transitionClasses = [])).push(cls);
  30075. addClass(el, cls);
  30076. }
  30077. function removeTransitionClass (el, cls) {
  30078. if (el._transitionClasses) {
  30079. remove$1(el._transitionClasses, cls);
  30080. }
  30081. removeClass(el, cls);
  30082. }
  30083. function whenTransitionEnds (
  30084. el,
  30085. expectedType,
  30086. cb
  30087. ) {
  30088. var ref = getTransitionInfo(el, expectedType);
  30089. var type = ref.type;
  30090. var timeout = ref.timeout;
  30091. var propCount = ref.propCount;
  30092. if (!type) { return cb() }
  30093. var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
  30094. var ended = 0;
  30095. var end = function () {
  30096. el.removeEventListener(event, onEnd);
  30097. cb();
  30098. };
  30099. var onEnd = function (e) {
  30100. if (e.target === el) {
  30101. if (++ended >= propCount) {
  30102. end();
  30103. }
  30104. }
  30105. };
  30106. setTimeout(function () {
  30107. if (ended < propCount) {
  30108. end();
  30109. }
  30110. }, timeout + 1);
  30111. el.addEventListener(event, onEnd);
  30112. }
  30113. var transformRE = /\b(transform|all)(,|$)/;
  30114. function getTransitionInfo (el, expectedType) {
  30115. var styles = window.getComputedStyle(el);
  30116. var transitioneDelays = styles[transitionProp + 'Delay'].split(', ');
  30117. var transitionDurations = styles[transitionProp + 'Duration'].split(', ');
  30118. var transitionTimeout = getTimeout(transitioneDelays, transitionDurations);
  30119. var animationDelays = styles[animationProp + 'Delay'].split(', ');
  30120. var animationDurations = styles[animationProp + 'Duration'].split(', ');
  30121. var animationTimeout = getTimeout(animationDelays, animationDurations);
  30122. var type;
  30123. var timeout = 0;
  30124. var propCount = 0;
  30125. /* istanbul ignore if */
  30126. if (expectedType === TRANSITION) {
  30127. if (transitionTimeout > 0) {
  30128. type = TRANSITION;
  30129. timeout = transitionTimeout;
  30130. propCount = transitionDurations.length;
  30131. }
  30132. } else if (expectedType === ANIMATION) {
  30133. if (animationTimeout > 0) {
  30134. type = ANIMATION;
  30135. timeout = animationTimeout;
  30136. propCount = animationDurations.length;
  30137. }
  30138. } else {
  30139. timeout = Math.max(transitionTimeout, animationTimeout);
  30140. type = timeout > 0
  30141. ? transitionTimeout > animationTimeout
  30142. ? TRANSITION
  30143. : ANIMATION
  30144. : null;
  30145. propCount = type
  30146. ? type === TRANSITION
  30147. ? transitionDurations.length
  30148. : animationDurations.length
  30149. : 0;
  30150. }
  30151. var hasTransform =
  30152. type === TRANSITION &&
  30153. transformRE.test(styles[transitionProp + 'Property']);
  30154. return {
  30155. type: type,
  30156. timeout: timeout,
  30157. propCount: propCount,
  30158. hasTransform: hasTransform
  30159. }
  30160. }
  30161. function getTimeout (delays, durations) {
  30162. /* istanbul ignore next */
  30163. while (delays.length < durations.length) {
  30164. delays = delays.concat(delays);
  30165. }
  30166. return Math.max.apply(null, durations.map(function (d, i) {
  30167. return toMs(d) + toMs(delays[i])
  30168. }))
  30169. }
  30170. function toMs (s) {
  30171. return Number(s.slice(0, -1)) * 1000
  30172. }
  30173. /* */
  30174. function enter (vnode, toggleDisplay) {
  30175. var el = vnode.elm;
  30176. // call leave callback now
  30177. if (el._leaveCb) {
  30178. el._leaveCb.cancelled = true;
  30179. el._leaveCb();
  30180. }
  30181. var data = resolveTransition(vnode.data.transition);
  30182. if (!data) {
  30183. return
  30184. }
  30185. /* istanbul ignore if */
  30186. if (el._enterCb || el.nodeType !== 1) {
  30187. return
  30188. }
  30189. var css = data.css;
  30190. var type = data.type;
  30191. var enterClass = data.enterClass;
  30192. var enterToClass = data.enterToClass;
  30193. var enterActiveClass = data.enterActiveClass;
  30194. var appearClass = data.appearClass;
  30195. var appearToClass = data.appearToClass;
  30196. var appearActiveClass = data.appearActiveClass;
  30197. var beforeEnter = data.beforeEnter;
  30198. var enter = data.enter;
  30199. var afterEnter = data.afterEnter;
  30200. var enterCancelled = data.enterCancelled;
  30201. var beforeAppear = data.beforeAppear;
  30202. var appear = data.appear;
  30203. var afterAppear = data.afterAppear;
  30204. var appearCancelled = data.appearCancelled;
  30205. // activeInstance will always be the <transition> component managing this
  30206. // transition. One edge case to check is when the <transition> is placed
  30207. // as the root node of a child component. In that case we need to check
  30208. // <transition>'s parent for appear check.
  30209. var context = activeInstance;
  30210. var transitionNode = activeInstance.$vnode;
  30211. while (transitionNode && transitionNode.parent) {
  30212. transitionNode = transitionNode.parent;
  30213. context = transitionNode.context;
  30214. }
  30215. var isAppear = !context._isMounted || !vnode.isRootInsert;
  30216. if (isAppear && !appear && appear !== '') {
  30217. return
  30218. }
  30219. var startClass = isAppear ? appearClass : enterClass;
  30220. var activeClass = isAppear ? appearActiveClass : enterActiveClass;
  30221. var toClass = isAppear ? appearToClass : enterToClass;
  30222. var beforeEnterHook = isAppear ? (beforeAppear || beforeEnter) : beforeEnter;
  30223. var enterHook = isAppear ? (typeof appear === 'function' ? appear : enter) : enter;
  30224. var afterEnterHook = isAppear ? (afterAppear || afterEnter) : afterEnter;
  30225. var enterCancelledHook = isAppear ? (appearCancelled || enterCancelled) : enterCancelled;
  30226. var expectsCSS = css !== false && !isIE9;
  30227. var userWantsControl =
  30228. enterHook &&
  30229. // enterHook may be a bound method which exposes
  30230. // the length of original fn as _length
  30231. (enterHook._length || enterHook.length) > 1;
  30232. var cb = el._enterCb = once(function () {
  30233. if (expectsCSS) {
  30234. removeTransitionClass(el, toClass);
  30235. removeTransitionClass(el, activeClass);
  30236. }
  30237. if (cb.cancelled) {
  30238. if (expectsCSS) {
  30239. removeTransitionClass(el, startClass);
  30240. }
  30241. enterCancelledHook && enterCancelledHook(el);
  30242. } else {
  30243. afterEnterHook && afterEnterHook(el);
  30244. }
  30245. el._enterCb = null;
  30246. });
  30247. if (!vnode.data.show) {
  30248. // remove pending leave element on enter by injecting an insert hook
  30249. mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', function () {
  30250. var parent = el.parentNode;
  30251. var pendingNode = parent && parent._pending && parent._pending[vnode.key];
  30252. if (pendingNode &&
  30253. pendingNode.tag === vnode.tag &&
  30254. pendingNode.elm._leaveCb) {
  30255. pendingNode.elm._leaveCb();
  30256. }
  30257. enterHook && enterHook(el, cb);
  30258. }, 'transition-insert');
  30259. }
  30260. // start enter transition
  30261. beforeEnterHook && beforeEnterHook(el);
  30262. if (expectsCSS) {
  30263. addTransitionClass(el, startClass);
  30264. addTransitionClass(el, activeClass);
  30265. nextFrame(function () {
  30266. addTransitionClass(el, toClass);
  30267. removeTransitionClass(el, startClass);
  30268. if (!cb.cancelled && !userWantsControl) {
  30269. whenTransitionEnds(el, type, cb);
  30270. }
  30271. });
  30272. }
  30273. if (vnode.data.show) {
  30274. toggleDisplay && toggleDisplay();
  30275. enterHook && enterHook(el, cb);
  30276. }
  30277. if (!expectsCSS && !userWantsControl) {
  30278. cb();
  30279. }
  30280. }
  30281. function leave (vnode, rm) {
  30282. var el = vnode.elm;
  30283. // call enter callback now
  30284. if (el._enterCb) {
  30285. el._enterCb.cancelled = true;
  30286. el._enterCb();
  30287. }
  30288. var data = resolveTransition(vnode.data.transition);
  30289. if (!data) {
  30290. return rm()
  30291. }
  30292. /* istanbul ignore if */
  30293. if (el._leaveCb || el.nodeType !== 1) {
  30294. return
  30295. }
  30296. var css = data.css;
  30297. var type = data.type;
  30298. var leaveClass = data.leaveClass;
  30299. var leaveToClass = data.leaveToClass;
  30300. var leaveActiveClass = data.leaveActiveClass;
  30301. var beforeLeave = data.beforeLeave;
  30302. var leave = data.leave;
  30303. var afterLeave = data.afterLeave;
  30304. var leaveCancelled = data.leaveCancelled;
  30305. var delayLeave = data.delayLeave;
  30306. var expectsCSS = css !== false && !isIE9;
  30307. var userWantsControl =
  30308. leave &&
  30309. // leave hook may be a bound method which exposes
  30310. // the length of original fn as _length
  30311. (leave._length || leave.length) > 1;
  30312. var cb = el._leaveCb = once(function () {
  30313. if (el.parentNode && el.parentNode._pending) {
  30314. el.parentNode._pending[vnode.key] = null;
  30315. }
  30316. if (expectsCSS) {
  30317. removeTransitionClass(el, leaveToClass);
  30318. removeTransitionClass(el, leaveActiveClass);
  30319. }
  30320. if (cb.cancelled) {
  30321. if (expectsCSS) {
  30322. removeTransitionClass(el, leaveClass);
  30323. }
  30324. leaveCancelled && leaveCancelled(el);
  30325. } else {
  30326. rm();
  30327. afterLeave && afterLeave(el);
  30328. }
  30329. el._leaveCb = null;
  30330. });
  30331. if (delayLeave) {
  30332. delayLeave(performLeave);
  30333. } else {
  30334. performLeave();
  30335. }
  30336. function performLeave () {
  30337. // the delayed leave may have already been cancelled
  30338. if (cb.cancelled) {
  30339. return
  30340. }
  30341. // record leaving element
  30342. if (!vnode.data.show) {
  30343. (el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] = vnode;
  30344. }
  30345. beforeLeave && beforeLeave(el);
  30346. if (expectsCSS) {
  30347. addTransitionClass(el, leaveClass);
  30348. addTransitionClass(el, leaveActiveClass);
  30349. nextFrame(function () {
  30350. addTransitionClass(el, leaveToClass);
  30351. removeTransitionClass(el, leaveClass);
  30352. if (!cb.cancelled && !userWantsControl) {
  30353. whenTransitionEnds(el, type, cb);
  30354. }
  30355. });
  30356. }
  30357. leave && leave(el, cb);
  30358. if (!expectsCSS && !userWantsControl) {
  30359. cb();
  30360. }
  30361. }
  30362. }
  30363. function resolveTransition (def$$1) {
  30364. if (!def$$1) {
  30365. return
  30366. }
  30367. /* istanbul ignore else */
  30368. if (typeof def$$1 === 'object') {
  30369. var res = {};
  30370. if (def$$1.css !== false) {
  30371. extend(res, autoCssTransition(def$$1.name || 'v'));
  30372. }
  30373. extend(res, def$$1);
  30374. return res
  30375. } else if (typeof def$$1 === 'string') {
  30376. return autoCssTransition(def$$1)
  30377. }
  30378. }
  30379. var autoCssTransition = cached(function (name) {
  30380. return {
  30381. enterClass: (name + "-enter"),
  30382. leaveClass: (name + "-leave"),
  30383. appearClass: (name + "-enter"),
  30384. enterToClass: (name + "-enter-to"),
  30385. leaveToClass: (name + "-leave-to"),
  30386. appearToClass: (name + "-enter-to"),
  30387. enterActiveClass: (name + "-enter-active"),
  30388. leaveActiveClass: (name + "-leave-active"),
  30389. appearActiveClass: (name + "-enter-active")
  30390. }
  30391. });
  30392. function once (fn) {
  30393. var called = false;
  30394. return function () {
  30395. if (!called) {
  30396. called = true;
  30397. fn();
  30398. }
  30399. }
  30400. }
  30401. function _enter (_, vnode) {
  30402. if (!vnode.data.show) {
  30403. enter(vnode);
  30404. }
  30405. }
  30406. var transition = inBrowser ? {
  30407. create: _enter,
  30408. activate: _enter,
  30409. remove: function remove (vnode, rm) {
  30410. /* istanbul ignore else */
  30411. if (!vnode.data.show) {
  30412. leave(vnode, rm);
  30413. } else {
  30414. rm();
  30415. }
  30416. }
  30417. } : {};
  30418. var platformModules = [
  30419. attrs,
  30420. klass,
  30421. events,
  30422. domProps,
  30423. style,
  30424. transition
  30425. ];
  30426. /* */
  30427. // the directive module should be applied last, after all
  30428. // built-in modules have been applied.
  30429. var modules = platformModules.concat(baseModules);
  30430. var patch$1 = createPatchFunction({ nodeOps: nodeOps, modules: modules });
  30431. /**
  30432. * Not type checking this file because flow doesn't like attaching
  30433. * properties to Elements.
  30434. */
  30435. var modelableTagRE = /^input|select|textarea|vue-component-[0-9]+(-[0-9a-zA-Z_-]*)?$/;
  30436. /* istanbul ignore if */
  30437. if (isIE9) {
  30438. // http://www.matts411.com/post/internet-explorer-9-oninput/
  30439. document.addEventListener('selectionchange', function () {
  30440. var el = document.activeElement;
  30441. if (el && el.vmodel) {
  30442. trigger(el, 'input');
  30443. }
  30444. });
  30445. }
  30446. var model = {
  30447. inserted: function inserted (el, binding, vnode) {
  30448. if (process.env.NODE_ENV !== 'production') {
  30449. if (!modelableTagRE.test(vnode.tag)) {
  30450. warn(
  30451. "v-model is not supported on element type: <" + (vnode.tag) + ">. " +
  30452. 'If you are working with contenteditable, it\'s recommended to ' +
  30453. 'wrap a library dedicated for that purpose inside a custom component.',
  30454. vnode.context
  30455. );
  30456. }
  30457. }
  30458. if (vnode.tag === 'select') {
  30459. var cb = function () {
  30460. setSelected(el, binding, vnode.context);
  30461. };
  30462. cb();
  30463. /* istanbul ignore if */
  30464. if (isIE || isEdge) {
  30465. setTimeout(cb, 0);
  30466. }
  30467. } else if (vnode.tag === 'textarea' || el.type === 'text') {
  30468. el._vModifiers = binding.modifiers;
  30469. if (!binding.modifiers.lazy) {
  30470. if (!isAndroid) {
  30471. el.addEventListener('compositionstart', onCompositionStart);
  30472. el.addEventListener('compositionend', onCompositionEnd);
  30473. }
  30474. /* istanbul ignore if */
  30475. if (isIE9) {
  30476. el.vmodel = true;
  30477. }
  30478. }
  30479. }
  30480. },
  30481. componentUpdated: function componentUpdated (el, binding, vnode) {
  30482. if (vnode.tag === 'select') {
  30483. setSelected(el, binding, vnode.context);
  30484. // in case the options rendered by v-for have changed,
  30485. // it's possible that the value is out-of-sync with the rendered options.
  30486. // detect such cases and filter out values that no longer has a matching
  30487. // option in the DOM.
  30488. var needReset = el.multiple
  30489. ? binding.value.some(function (v) { return hasNoMatchingOption(v, el.options); })
  30490. : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, el.options);
  30491. if (needReset) {
  30492. trigger(el, 'change');
  30493. }
  30494. }
  30495. }
  30496. };
  30497. function setSelected (el, binding, vm) {
  30498. var value = binding.value;
  30499. var isMultiple = el.multiple;
  30500. if (isMultiple && !Array.isArray(value)) {
  30501. process.env.NODE_ENV !== 'production' && warn(
  30502. "<select multiple v-model=\"" + (binding.expression) + "\"> " +
  30503. "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)),
  30504. vm
  30505. );
  30506. return
  30507. }
  30508. var selected, option;
  30509. for (var i = 0, l = el.options.length; i < l; i++) {
  30510. option = el.options[i];
  30511. if (isMultiple) {
  30512. selected = looseIndexOf(value, getValue(option)) > -1;
  30513. if (option.selected !== selected) {
  30514. option.selected = selected;
  30515. }
  30516. } else {
  30517. if (looseEqual(getValue(option), value)) {
  30518. if (el.selectedIndex !== i) {
  30519. el.selectedIndex = i;
  30520. }
  30521. return
  30522. }
  30523. }
  30524. }
  30525. if (!isMultiple) {
  30526. el.selectedIndex = -1;
  30527. }
  30528. }
  30529. function hasNoMatchingOption (value, options) {
  30530. for (var i = 0, l = options.length; i < l; i++) {
  30531. if (looseEqual(getValue(options[i]), value)) {
  30532. return false
  30533. }
  30534. }
  30535. return true
  30536. }
  30537. function getValue (option) {
  30538. return '_value' in option
  30539. ? option._value
  30540. : option.value
  30541. }
  30542. function onCompositionStart (e) {
  30543. e.target.composing = true;
  30544. }
  30545. function onCompositionEnd (e) {
  30546. e.target.composing = false;
  30547. trigger(e.target, 'input');
  30548. }
  30549. function trigger (el, type) {
  30550. var e = document.createEvent('HTMLEvents');
  30551. e.initEvent(type, true, true);
  30552. el.dispatchEvent(e);
  30553. }
  30554. /* */
  30555. // recursively search for possible transition defined inside the component root
  30556. function locateNode (vnode) {
  30557. return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
  30558. ? locateNode(vnode.componentInstance._vnode)
  30559. : vnode
  30560. }
  30561. var show = {
  30562. bind: function bind (el, ref, vnode) {
  30563. var value = ref.value;
  30564. vnode = locateNode(vnode);
  30565. var transition = vnode.data && vnode.data.transition;
  30566. var originalDisplay = el.__vOriginalDisplay =
  30567. el.style.display === 'none' ? '' : el.style.display;
  30568. if (value && transition && !isIE9) {
  30569. vnode.data.show = true;
  30570. enter(vnode, function () {
  30571. el.style.display = originalDisplay;
  30572. });
  30573. } else {
  30574. el.style.display = value ? originalDisplay : 'none';
  30575. }
  30576. },
  30577. update: function update (el, ref, vnode) {
  30578. var value = ref.value;
  30579. var oldValue = ref.oldValue;
  30580. /* istanbul ignore if */
  30581. if (value === oldValue) { return }
  30582. vnode = locateNode(vnode);
  30583. var transition = vnode.data && vnode.data.transition;
  30584. if (transition && !isIE9) {
  30585. vnode.data.show = true;
  30586. if (value) {
  30587. enter(vnode, function () {
  30588. el.style.display = el.__vOriginalDisplay;
  30589. });
  30590. } else {
  30591. leave(vnode, function () {
  30592. el.style.display = 'none';
  30593. });
  30594. }
  30595. } else {
  30596. el.style.display = value ? el.__vOriginalDisplay : 'none';
  30597. }
  30598. },
  30599. unbind: function unbind (
  30600. el,
  30601. binding,
  30602. vnode,
  30603. oldVnode,
  30604. isDestroy
  30605. ) {
  30606. if (!isDestroy) {
  30607. el.style.display = el.__vOriginalDisplay;
  30608. }
  30609. }
  30610. };
  30611. var platformDirectives = {
  30612. model: model,
  30613. show: show
  30614. };
  30615. /* */
  30616. // Provides transition support for a single element/component.
  30617. // supports transition mode (out-in / in-out)
  30618. var transitionProps = {
  30619. name: String,
  30620. appear: Boolean,
  30621. css: Boolean,
  30622. mode: String,
  30623. type: String,
  30624. enterClass: String,
  30625. leaveClass: String,
  30626. enterToClass: String,
  30627. leaveToClass: String,
  30628. enterActiveClass: String,
  30629. leaveActiveClass: String,
  30630. appearClass: String,
  30631. appearActiveClass: String,
  30632. appearToClass: String
  30633. };
  30634. // in case the child is also an abstract component, e.g. <keep-alive>
  30635. // we want to recursively retrieve the real component to be rendered
  30636. function getRealChild (vnode) {
  30637. var compOptions = vnode && vnode.componentOptions;
  30638. if (compOptions && compOptions.Ctor.options.abstract) {
  30639. return getRealChild(getFirstComponentChild(compOptions.children))
  30640. } else {
  30641. return vnode
  30642. }
  30643. }
  30644. function extractTransitionData (comp) {
  30645. var data = {};
  30646. var options = comp.$options;
  30647. // props
  30648. for (var key in options.propsData) {
  30649. data[key] = comp[key];
  30650. }
  30651. // events.
  30652. // extract listeners and pass them directly to the transition methods
  30653. var listeners = options._parentListeners;
  30654. for (var key$1 in listeners) {
  30655. data[camelize(key$1)] = listeners[key$1].fn;
  30656. }
  30657. return data
  30658. }
  30659. function placeholder (h, rawChild) {
  30660. return /\d-keep-alive$/.test(rawChild.tag)
  30661. ? h('keep-alive')
  30662. : null
  30663. }
  30664. function hasParentTransition (vnode) {
  30665. while ((vnode = vnode.parent)) {
  30666. if (vnode.data.transition) {
  30667. return true
  30668. }
  30669. }
  30670. }
  30671. function isSameChild (child, oldChild) {
  30672. return oldChild.key === child.key && oldChild.tag === child.tag
  30673. }
  30674. var Transition = {
  30675. name: 'transition',
  30676. props: transitionProps,
  30677. abstract: true,
  30678. render: function render (h) {
  30679. var this$1 = this;
  30680. var children = this.$slots.default;
  30681. if (!children) {
  30682. return
  30683. }
  30684. // filter out text nodes (possible whitespaces)
  30685. children = children.filter(function (c) { return c.tag; });
  30686. /* istanbul ignore if */
  30687. if (!children.length) {
  30688. return
  30689. }
  30690. // warn multiple elements
  30691. if (process.env.NODE_ENV !== 'production' && children.length > 1) {
  30692. warn(
  30693. '<transition> can only be used on a single element. Use ' +
  30694. '<transition-group> for lists.',
  30695. this.$parent
  30696. );
  30697. }
  30698. var mode = this.mode;
  30699. // warn invalid mode
  30700. if (process.env.NODE_ENV !== 'production' &&
  30701. mode && mode !== 'in-out' && mode !== 'out-in') {
  30702. warn(
  30703. 'invalid <transition> mode: ' + mode,
  30704. this.$parent
  30705. );
  30706. }
  30707. var rawChild = children[0];
  30708. // if this is a component root node and the component's
  30709. // parent container node also has transition, skip.
  30710. if (hasParentTransition(this.$vnode)) {
  30711. return rawChild
  30712. }
  30713. // apply transition data to child
  30714. // use getRealChild() to ignore abstract components e.g. keep-alive
  30715. var child = getRealChild(rawChild);
  30716. /* istanbul ignore if */
  30717. if (!child) {
  30718. return rawChild
  30719. }
  30720. if (this._leaving) {
  30721. return placeholder(h, rawChild)
  30722. }
  30723. // ensure a key that is unique to the vnode type and to this transition
  30724. // component instance. This key will be used to remove pending leaving nodes
  30725. // during entering.
  30726. var id = "__transition-" + (this._uid) + "-";
  30727. var key = child.key = child.key == null
  30728. ? id + child.tag
  30729. : isPrimitive(child.key)
  30730. ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key)
  30731. : child.key;
  30732. var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
  30733. var oldRawChild = this._vnode;
  30734. var oldChild = getRealChild(oldRawChild);
  30735. // mark v-show
  30736. // so that the transition module can hand over the control to the directive
  30737. if (child.data.directives && child.data.directives.some(function (d) { return d.name === 'show'; })) {
  30738. child.data.show = true;
  30739. }
  30740. if (oldChild && oldChild.data && !isSameChild(child, oldChild)) {
  30741. // replace old child transition data with fresh one
  30742. // important for dynamic transitions!
  30743. var oldData = oldChild && (oldChild.data.transition = extend({}, data));
  30744. // handle transition mode
  30745. if (mode === 'out-in') {
  30746. // return placeholder node and queue update when leave finishes
  30747. this._leaving = true;
  30748. mergeVNodeHook(oldData, 'afterLeave', function () {
  30749. this$1._leaving = false;
  30750. this$1.$forceUpdate();
  30751. }, key);
  30752. return placeholder(h, rawChild)
  30753. } else if (mode === 'in-out') {
  30754. var delayedLeave;
  30755. var performLeave = function () { delayedLeave(); };
  30756. mergeVNodeHook(data, 'afterEnter', performLeave, key);
  30757. mergeVNodeHook(data, 'enterCancelled', performLeave, key);
  30758. mergeVNodeHook(oldData, 'delayLeave', function (leave) {
  30759. delayedLeave = leave;
  30760. }, key);
  30761. }
  30762. }
  30763. return rawChild
  30764. }
  30765. };
  30766. /* */
  30767. // Provides transition support for list items.
  30768. // supports move transitions using the FLIP technique.
  30769. // Because the vdom's children update algorithm is "unstable" - i.e.
  30770. // it doesn't guarantee the relative positioning of removed elements,
  30771. // we force transition-group to update its children into two passes:
  30772. // in the first pass, we remove all nodes that need to be removed,
  30773. // triggering their leaving transition; in the second pass, we insert/move
  30774. // into the final disired state. This way in the second pass removed
  30775. // nodes will remain where they should be.
  30776. var props = extend({
  30777. tag: String,
  30778. moveClass: String
  30779. }, transitionProps);
  30780. delete props.mode;
  30781. var TransitionGroup = {
  30782. props: props,
  30783. render: function render (h) {
  30784. var tag = this.tag || this.$vnode.data.tag || 'span';
  30785. var map = Object.create(null);
  30786. var prevChildren = this.prevChildren = this.children;
  30787. var rawChildren = this.$slots.default || [];
  30788. var children = this.children = [];
  30789. var transitionData = extractTransitionData(this);
  30790. for (var i = 0; i < rawChildren.length; i++) {
  30791. var c = rawChildren[i];
  30792. if (c.tag) {
  30793. if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
  30794. children.push(c);
  30795. map[c.key] = c
  30796. ;(c.data || (c.data = {})).transition = transitionData;
  30797. } else if (process.env.NODE_ENV !== 'production') {
  30798. var opts = c.componentOptions;
  30799. var name = opts
  30800. ? (opts.Ctor.options.name || opts.tag)
  30801. : c.tag;
  30802. warn(("<transition-group> children must be keyed: <" + name + ">"));
  30803. }
  30804. }
  30805. }
  30806. if (prevChildren) {
  30807. var kept = [];
  30808. var removed = [];
  30809. for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {
  30810. var c$1 = prevChildren[i$1];
  30811. c$1.data.transition = transitionData;
  30812. c$1.data.pos = c$1.elm.getBoundingClientRect();
  30813. if (map[c$1.key]) {
  30814. kept.push(c$1);
  30815. } else {
  30816. removed.push(c$1);
  30817. }
  30818. }
  30819. this.kept = h(tag, null, kept);
  30820. this.removed = removed;
  30821. }
  30822. return h(tag, null, children)
  30823. },
  30824. beforeUpdate: function beforeUpdate () {
  30825. // force removing pass
  30826. this.__patch__(
  30827. this._vnode,
  30828. this.kept,
  30829. false, // hydrating
  30830. true // removeOnly (!important, avoids unnecessary moves)
  30831. );
  30832. this._vnode = this.kept;
  30833. },
  30834. updated: function updated () {
  30835. var children = this.prevChildren;
  30836. var moveClass = this.moveClass || ((this.name || 'v') + '-move');
  30837. if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
  30838. return
  30839. }
  30840. // we divide the work into three loops to avoid mixing DOM reads and writes
  30841. // in each iteration - which helps prevent layout thrashing.
  30842. children.forEach(callPendingCbs);
  30843. children.forEach(recordPosition);
  30844. children.forEach(applyTranslation);
  30845. // force reflow to put everything in position
  30846. var f = document.body.offsetHeight; // eslint-disable-line
  30847. children.forEach(function (c) {
  30848. if (c.data.moved) {
  30849. var el = c.elm;
  30850. var s = el.style;
  30851. addTransitionClass(el, moveClass);
  30852. s.transform = s.WebkitTransform = s.transitionDuration = '';
  30853. el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {
  30854. if (!e || /transform$/.test(e.propertyName)) {
  30855. el.removeEventListener(transitionEndEvent, cb);
  30856. el._moveCb = null;
  30857. removeTransitionClass(el, moveClass);
  30858. }
  30859. });
  30860. }
  30861. });
  30862. },
  30863. methods: {
  30864. hasMove: function hasMove (el, moveClass) {
  30865. /* istanbul ignore if */
  30866. if (!hasTransition) {
  30867. return false
  30868. }
  30869. if (this._hasMove != null) {
  30870. return this._hasMove
  30871. }
  30872. addTransitionClass(el, moveClass);
  30873. var info = getTransitionInfo(el);
  30874. removeTransitionClass(el, moveClass);
  30875. return (this._hasMove = info.hasTransform)
  30876. }
  30877. }
  30878. };
  30879. function callPendingCbs (c) {
  30880. /* istanbul ignore if */
  30881. if (c.elm._moveCb) {
  30882. c.elm._moveCb();
  30883. }
  30884. /* istanbul ignore if */
  30885. if (c.elm._enterCb) {
  30886. c.elm._enterCb();
  30887. }
  30888. }
  30889. function recordPosition (c) {
  30890. c.data.newPos = c.elm.getBoundingClientRect();
  30891. }
  30892. function applyTranslation (c) {
  30893. var oldPos = c.data.pos;
  30894. var newPos = c.data.newPos;
  30895. var dx = oldPos.left - newPos.left;
  30896. var dy = oldPos.top - newPos.top;
  30897. if (dx || dy) {
  30898. c.data.moved = true;
  30899. var s = c.elm.style;
  30900. s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
  30901. s.transitionDuration = '0s';
  30902. }
  30903. }
  30904. var platformComponents = {
  30905. Transition: Transition,
  30906. TransitionGroup: TransitionGroup
  30907. };
  30908. /* */
  30909. // install platform specific utils
  30910. Vue$3.config.isUnknownElement = isUnknownElement;
  30911. Vue$3.config.isReservedTag = isReservedTag;
  30912. Vue$3.config.getTagNamespace = getTagNamespace;
  30913. Vue$3.config.mustUseProp = mustUseProp;
  30914. // install platform runtime directives & components
  30915. extend(Vue$3.options.directives, platformDirectives);
  30916. extend(Vue$3.options.components, platformComponents);
  30917. // install platform patch function
  30918. Vue$3.prototype.__patch__ = inBrowser ? patch$1 : noop;
  30919. // wrap mount
  30920. Vue$3.prototype.$mount = function (
  30921. el,
  30922. hydrating
  30923. ) {
  30924. el = el && inBrowser ? query(el) : undefined;
  30925. return this._mount(el, hydrating)
  30926. };
  30927. if (process.env.NODE_ENV !== 'production' &&
  30928. inBrowser && typeof console !== 'undefined') {
  30929. console[console.info ? 'info' : 'log'](
  30930. "You are running Vue in development mode.\n" +
  30931. "Make sure to turn on production mode when deploying for production.\n" +
  30932. "See more tips at https://vuejs.org/guide/deployment.html"
  30933. );
  30934. }
  30935. // devtools global hook
  30936. /* istanbul ignore next */
  30937. setTimeout(function () {
  30938. if (config.devtools) {
  30939. if (devtools) {
  30940. devtools.emit('init', Vue$3);
  30941. } else if (
  30942. process.env.NODE_ENV !== 'production' &&
  30943. inBrowser && !isEdge && /Chrome\/\d+/.test(window.navigator.userAgent)
  30944. ) {
  30945. console[console.info ? 'info' : 'log'](
  30946. 'Download the Vue Devtools extension for a better development experience:\n' +
  30947. 'https://github.com/vuejs/vue-devtools'
  30948. );
  30949. }
  30950. }
  30951. }, 0);
  30952. /* */
  30953. // check whether current browser encodes a char inside attribute values
  30954. function shouldDecode (content, encoded) {
  30955. var div = document.createElement('div');
  30956. div.innerHTML = "<div a=\"" + content + "\">";
  30957. return div.innerHTML.indexOf(encoded) > 0
  30958. }
  30959. // #3663
  30960. // IE encodes newlines inside attribute values while other browsers don't
  30961. var shouldDecodeNewlines = inBrowser ? shouldDecode('\n', '&#10;') : false;
  30962. /* */
  30963. var decoder;
  30964. function decode (html) {
  30965. decoder = decoder || document.createElement('div');
  30966. decoder.innerHTML = html;
  30967. return decoder.textContent
  30968. }
  30969. /* */
  30970. var isUnaryTag = makeMap(
  30971. 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
  30972. 'link,meta,param,source,track,wbr',
  30973. true
  30974. );
  30975. // Elements that you can, intentionally, leave open
  30976. // (and which close themselves)
  30977. var canBeLeftOpenTag = makeMap(
  30978. 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source',
  30979. true
  30980. );
  30981. // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
  30982. // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
  30983. var isNonPhrasingTag = makeMap(
  30984. 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
  30985. 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
  30986. 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
  30987. 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
  30988. 'title,tr,track',
  30989. true
  30990. );
  30991. /**
  30992. * Not type-checking this file because it's mostly vendor code.
  30993. */
  30994. /*!
  30995. * HTML Parser By John Resig (ejohn.org)
  30996. * Modified by Juriy "kangax" Zaytsev
  30997. * Original code by Erik Arvidsson, Mozilla Public License
  30998. * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
  30999. */
  31000. // Regular Expressions for parsing tags and attributes
  31001. var singleAttrIdentifier = /([^\s"'<>/=]+)/;
  31002. var singleAttrAssign = /(?:=)/;
  31003. var singleAttrValues = [
  31004. // attr value double quotes
  31005. /"([^"]*)"+/.source,
  31006. // attr value, single quotes
  31007. /'([^']*)'+/.source,
  31008. // attr value, no quotes
  31009. /([^\s"'=<>`]+)/.source
  31010. ];
  31011. var attribute = new RegExp(
  31012. '^\\s*' + singleAttrIdentifier.source +
  31013. '(?:\\s*(' + singleAttrAssign.source + ')' +
  31014. '\\s*(?:' + singleAttrValues.join('|') + '))?'
  31015. );
  31016. // could use https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-QName
  31017. // but for Vue templates we can enforce a simple charset
  31018. var ncname = '[a-zA-Z_][\\w\\-\\.]*';
  31019. var qnameCapture = '((?:' + ncname + '\\:)?' + ncname + ')';
  31020. var startTagOpen = new RegExp('^<' + qnameCapture);
  31021. var startTagClose = /^\s*(\/?)>/;
  31022. var endTag = new RegExp('^<\\/' + qnameCapture + '[^>]*>');
  31023. var doctype = /^<!DOCTYPE [^>]+>/i;
  31024. var comment = /^<!--/;
  31025. var conditionalComment = /^<!\[/;
  31026. var IS_REGEX_CAPTURING_BROKEN = false;
  31027. 'x'.replace(/x(.)?/g, function (m, g) {
  31028. IS_REGEX_CAPTURING_BROKEN = g === '';
  31029. });
  31030. // Special Elements (can contain anything)
  31031. var isScriptOrStyle = makeMap('script,style', true);
  31032. var reCache = {};
  31033. var ltRE = /&lt;/g;
  31034. var gtRE = /&gt;/g;
  31035. var nlRE = /&#10;/g;
  31036. var ampRE = /&amp;/g;
  31037. var quoteRE = /&quot;/g;
  31038. function decodeAttr (value, shouldDecodeNewlines) {
  31039. if (shouldDecodeNewlines) {
  31040. value = value.replace(nlRE, '\n');
  31041. }
  31042. return value
  31043. .replace(ltRE, '<')
  31044. .replace(gtRE, '>')
  31045. .replace(ampRE, '&')
  31046. .replace(quoteRE, '"')
  31047. }
  31048. function parseHTML (html, options) {
  31049. var stack = [];
  31050. var expectHTML = options.expectHTML;
  31051. var isUnaryTag$$1 = options.isUnaryTag || no;
  31052. var index = 0;
  31053. var last, lastTag;
  31054. while (html) {
  31055. last = html;
  31056. // Make sure we're not in a script or style element
  31057. if (!lastTag || !isScriptOrStyle(lastTag)) {
  31058. var textEnd = html.indexOf('<');
  31059. if (textEnd === 0) {
  31060. // Comment:
  31061. if (comment.test(html)) {
  31062. var commentEnd = html.indexOf('-->');
  31063. if (commentEnd >= 0) {
  31064. advance(commentEnd + 3);
  31065. continue
  31066. }
  31067. }
  31068. // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
  31069. if (conditionalComment.test(html)) {
  31070. var conditionalEnd = html.indexOf(']>');
  31071. if (conditionalEnd >= 0) {
  31072. advance(conditionalEnd + 2);
  31073. continue
  31074. }
  31075. }
  31076. // Doctype:
  31077. var doctypeMatch = html.match(doctype);
  31078. if (doctypeMatch) {
  31079. advance(doctypeMatch[0].length);
  31080. continue
  31081. }
  31082. // End tag:
  31083. var endTagMatch = html.match(endTag);
  31084. if (endTagMatch) {
  31085. var curIndex = index;
  31086. advance(endTagMatch[0].length);
  31087. parseEndTag(endTagMatch[1], curIndex, index);
  31088. continue
  31089. }
  31090. // Start tag:
  31091. var startTagMatch = parseStartTag();
  31092. if (startTagMatch) {
  31093. handleStartTag(startTagMatch);
  31094. continue
  31095. }
  31096. }
  31097. var text = (void 0), rest$1 = (void 0), next = (void 0);
  31098. if (textEnd > 0) {
  31099. rest$1 = html.slice(textEnd);
  31100. while (
  31101. !endTag.test(rest$1) &&
  31102. !startTagOpen.test(rest$1) &&
  31103. !comment.test(rest$1) &&
  31104. !conditionalComment.test(rest$1)
  31105. ) {
  31106. // < in plain text, be forgiving and treat it as text
  31107. next = rest$1.indexOf('<', 1);
  31108. if (next < 0) { break }
  31109. textEnd += next;
  31110. rest$1 = html.slice(textEnd);
  31111. }
  31112. text = html.substring(0, textEnd);
  31113. advance(textEnd);
  31114. }
  31115. if (textEnd < 0) {
  31116. text = html;
  31117. html = '';
  31118. }
  31119. if (options.chars && text) {
  31120. options.chars(text);
  31121. }
  31122. } else {
  31123. var stackedTag = lastTag.toLowerCase();
  31124. var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));
  31125. var endTagLength = 0;
  31126. var rest = html.replace(reStackedTag, function (all, text, endTag) {
  31127. endTagLength = endTag.length;
  31128. if (stackedTag !== 'script' && stackedTag !== 'style' && stackedTag !== 'noscript') {
  31129. text = text
  31130. .replace(/<!--([\s\S]*?)-->/g, '$1')
  31131. .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1');
  31132. }
  31133. if (options.chars) {
  31134. options.chars(text);
  31135. }
  31136. return ''
  31137. });
  31138. index += html.length - rest.length;
  31139. html = rest;
  31140. parseEndTag(stackedTag, index - endTagLength, index);
  31141. }
  31142. if (html === last && options.chars) {
  31143. options.chars(html);
  31144. break
  31145. }
  31146. }
  31147. // Clean up any remaining tags
  31148. parseEndTag();
  31149. function advance (n) {
  31150. index += n;
  31151. html = html.substring(n);
  31152. }
  31153. function parseStartTag () {
  31154. var start = html.match(startTagOpen);
  31155. if (start) {
  31156. var match = {
  31157. tagName: start[1],
  31158. attrs: [],
  31159. start: index
  31160. };
  31161. advance(start[0].length);
  31162. var end, attr;
  31163. while (!(end = html.match(startTagClose)) && (attr = html.match(attribute))) {
  31164. advance(attr[0].length);
  31165. match.attrs.push(attr);
  31166. }
  31167. if (end) {
  31168. match.unarySlash = end[1];
  31169. advance(end[0].length);
  31170. match.end = index;
  31171. return match
  31172. }
  31173. }
  31174. }
  31175. function handleStartTag (match) {
  31176. var tagName = match.tagName;
  31177. var unarySlash = match.unarySlash;
  31178. if (expectHTML) {
  31179. if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
  31180. parseEndTag(lastTag);
  31181. }
  31182. if (canBeLeftOpenTag(tagName) && lastTag === tagName) {
  31183. parseEndTag(tagName);
  31184. }
  31185. }
  31186. var unary = isUnaryTag$$1(tagName) || tagName === 'html' && lastTag === 'head' || !!unarySlash;
  31187. var l = match.attrs.length;
  31188. var attrs = new Array(l);
  31189. for (var i = 0; i < l; i++) {
  31190. var args = match.attrs[i];
  31191. // hackish work around FF bug https://bugzilla.mozilla.org/show_bug.cgi?id=369778
  31192. if (IS_REGEX_CAPTURING_BROKEN && args[0].indexOf('""') === -1) {
  31193. if (args[3] === '') { delete args[3]; }
  31194. if (args[4] === '') { delete args[4]; }
  31195. if (args[5] === '') { delete args[5]; }
  31196. }
  31197. var value = args[3] || args[4] || args[5] || '';
  31198. attrs[i] = {
  31199. name: args[1],
  31200. value: decodeAttr(
  31201. value,
  31202. options.shouldDecodeNewlines
  31203. )
  31204. };
  31205. }
  31206. if (!unary) {
  31207. stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs });
  31208. lastTag = tagName;
  31209. unarySlash = '';
  31210. }
  31211. if (options.start) {
  31212. options.start(tagName, attrs, unary, match.start, match.end);
  31213. }
  31214. }
  31215. function parseEndTag (tagName, start, end) {
  31216. var pos, lowerCasedTagName;
  31217. if (start == null) { start = index; }
  31218. if (end == null) { end = index; }
  31219. if (tagName) {
  31220. lowerCasedTagName = tagName.toLowerCase();
  31221. }
  31222. // Find the closest opened tag of the same type
  31223. if (tagName) {
  31224. for (pos = stack.length - 1; pos >= 0; pos--) {
  31225. if (stack[pos].lowerCasedTag === lowerCasedTagName) {
  31226. break
  31227. }
  31228. }
  31229. } else {
  31230. // If no tag name is provided, clean shop
  31231. pos = 0;
  31232. }
  31233. if (pos >= 0) {
  31234. // Close all the open elements, up the stack
  31235. for (var i = stack.length - 1; i >= pos; i--) {
  31236. if (options.end) {
  31237. options.end(stack[i].tag, start, end);
  31238. }
  31239. }
  31240. // Remove the open elements from the stack
  31241. stack.length = pos;
  31242. lastTag = pos && stack[pos - 1].tag;
  31243. } else if (lowerCasedTagName === 'br') {
  31244. if (options.start) {
  31245. options.start(tagName, [], true, start, end);
  31246. }
  31247. } else if (lowerCasedTagName === 'p') {
  31248. if (options.start) {
  31249. options.start(tagName, [], false, start, end);
  31250. }
  31251. if (options.end) {
  31252. options.end(tagName, start, end);
  31253. }
  31254. }
  31255. }
  31256. }
  31257. /* */
  31258. function parseFilters (exp) {
  31259. var inSingle = false;
  31260. var inDouble = false;
  31261. var inTemplateString = false;
  31262. var inRegex = false;
  31263. var curly = 0;
  31264. var square = 0;
  31265. var paren = 0;
  31266. var lastFilterIndex = 0;
  31267. var c, prev, i, expression, filters;
  31268. for (i = 0; i < exp.length; i++) {
  31269. prev = c;
  31270. c = exp.charCodeAt(i);
  31271. if (inSingle) {
  31272. if (c === 0x27 && prev !== 0x5C) { inSingle = false; }
  31273. } else if (inDouble) {
  31274. if (c === 0x22 && prev !== 0x5C) { inDouble = false; }
  31275. } else if (inTemplateString) {
  31276. if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }
  31277. } else if (inRegex) {
  31278. if (c === 0x2f && prev !== 0x5C) { inRegex = false; }
  31279. } else if (
  31280. c === 0x7C && // pipe
  31281. exp.charCodeAt(i + 1) !== 0x7C &&
  31282. exp.charCodeAt(i - 1) !== 0x7C &&
  31283. !curly && !square && !paren
  31284. ) {
  31285. if (expression === undefined) {
  31286. // first filter, end of expression
  31287. lastFilterIndex = i + 1;
  31288. expression = exp.slice(0, i).trim();
  31289. } else {
  31290. pushFilter();
  31291. }
  31292. } else {
  31293. switch (c) {
  31294. case 0x22: inDouble = true; break // "
  31295. case 0x27: inSingle = true; break // '
  31296. case 0x60: inTemplateString = true; break // `
  31297. case 0x28: paren++; break // (
  31298. case 0x29: paren--; break // )
  31299. case 0x5B: square++; break // [
  31300. case 0x5D: square--; break // ]
  31301. case 0x7B: curly++; break // {
  31302. case 0x7D: curly--; break // }
  31303. }
  31304. if (c === 0x2f) { // /
  31305. var j = i - 1;
  31306. var p = (void 0);
  31307. // find first non-whitespace prev char
  31308. for (; j >= 0; j--) {
  31309. p = exp.charAt(j);
  31310. if (p !== ' ') { break }
  31311. }
  31312. if (!p || !/[\w$]/.test(p)) {
  31313. inRegex = true;
  31314. }
  31315. }
  31316. }
  31317. }
  31318. if (expression === undefined) {
  31319. expression = exp.slice(0, i).trim();
  31320. } else if (lastFilterIndex !== 0) {
  31321. pushFilter();
  31322. }
  31323. function pushFilter () {
  31324. (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());
  31325. lastFilterIndex = i + 1;
  31326. }
  31327. if (filters) {
  31328. for (i = 0; i < filters.length; i++) {
  31329. expression = wrapFilter(expression, filters[i]);
  31330. }
  31331. }
  31332. return expression
  31333. }
  31334. function wrapFilter (exp, filter) {
  31335. var i = filter.indexOf('(');
  31336. if (i < 0) {
  31337. // _f: resolveFilter
  31338. return ("_f(\"" + filter + "\")(" + exp + ")")
  31339. } else {
  31340. var name = filter.slice(0, i);
  31341. var args = filter.slice(i + 1);
  31342. return ("_f(\"" + name + "\")(" + exp + "," + args)
  31343. }
  31344. }
  31345. /* */
  31346. var defaultTagRE = /\{\{((?:.|\n)+?)\}\}/g;
  31347. var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
  31348. var buildRegex = cached(function (delimiters) {
  31349. var open = delimiters[0].replace(regexEscapeRE, '\\$&');
  31350. var close = delimiters[1].replace(regexEscapeRE, '\\$&');
  31351. return new RegExp(open + '((?:.|\\n)+?)' + close, 'g')
  31352. });
  31353. function parseText (
  31354. text,
  31355. delimiters
  31356. ) {
  31357. var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;
  31358. if (!tagRE.test(text)) {
  31359. return
  31360. }
  31361. var tokens = [];
  31362. var lastIndex = tagRE.lastIndex = 0;
  31363. var match, index;
  31364. while ((match = tagRE.exec(text))) {
  31365. index = match.index;
  31366. // push text token
  31367. if (index > lastIndex) {
  31368. tokens.push(JSON.stringify(text.slice(lastIndex, index)));
  31369. }
  31370. // tag token
  31371. var exp = parseFilters(match[1].trim());
  31372. tokens.push(("_s(" + exp + ")"));
  31373. lastIndex = index + match[0].length;
  31374. }
  31375. if (lastIndex < text.length) {
  31376. tokens.push(JSON.stringify(text.slice(lastIndex)));
  31377. }
  31378. return tokens.join('+')
  31379. }
  31380. /* */
  31381. function baseWarn (msg) {
  31382. console.error(("[Vue parser]: " + msg));
  31383. }
  31384. function pluckModuleFunction (
  31385. modules,
  31386. key
  31387. ) {
  31388. return modules
  31389. ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })
  31390. : []
  31391. }
  31392. function addProp (el, name, value) {
  31393. (el.props || (el.props = [])).push({ name: name, value: value });
  31394. }
  31395. function addAttr (el, name, value) {
  31396. (el.attrs || (el.attrs = [])).push({ name: name, value: value });
  31397. }
  31398. function addDirective (
  31399. el,
  31400. name,
  31401. rawName,
  31402. value,
  31403. arg,
  31404. modifiers
  31405. ) {
  31406. (el.directives || (el.directives = [])).push({ name: name, rawName: rawName, value: value, arg: arg, modifiers: modifiers });
  31407. }
  31408. function addHandler (
  31409. el,
  31410. name,
  31411. value,
  31412. modifiers,
  31413. important
  31414. ) {
  31415. // check capture modifier
  31416. if (modifiers && modifiers.capture) {
  31417. delete modifiers.capture;
  31418. name = '!' + name; // mark the event as captured
  31419. }
  31420. if (modifiers && modifiers.once) {
  31421. delete modifiers.once;
  31422. name = '~' + name; // mark the event as once
  31423. }
  31424. var events;
  31425. if (modifiers && modifiers.native) {
  31426. delete modifiers.native;
  31427. events = el.nativeEvents || (el.nativeEvents = {});
  31428. } else {
  31429. events = el.events || (el.events = {});
  31430. }
  31431. var newHandler = { value: value, modifiers: modifiers };
  31432. var handlers = events[name];
  31433. /* istanbul ignore if */
  31434. if (Array.isArray(handlers)) {
  31435. important ? handlers.unshift(newHandler) : handlers.push(newHandler);
  31436. } else if (handlers) {
  31437. events[name] = important ? [newHandler, handlers] : [handlers, newHandler];
  31438. } else {
  31439. events[name] = newHandler;
  31440. }
  31441. }
  31442. function getBindingAttr (
  31443. el,
  31444. name,
  31445. getStatic
  31446. ) {
  31447. var dynamicValue =
  31448. getAndRemoveAttr(el, ':' + name) ||
  31449. getAndRemoveAttr(el, 'v-bind:' + name);
  31450. if (dynamicValue != null) {
  31451. return parseFilters(dynamicValue)
  31452. } else if (getStatic !== false) {
  31453. var staticValue = getAndRemoveAttr(el, name);
  31454. if (staticValue != null) {
  31455. return JSON.stringify(staticValue)
  31456. }
  31457. }
  31458. }
  31459. function getAndRemoveAttr (el, name) {
  31460. var val;
  31461. if ((val = el.attrsMap[name]) != null) {
  31462. var list = el.attrsList;
  31463. for (var i = 0, l = list.length; i < l; i++) {
  31464. if (list[i].name === name) {
  31465. list.splice(i, 1);
  31466. break
  31467. }
  31468. }
  31469. }
  31470. return val
  31471. }
  31472. var len;
  31473. var str;
  31474. var chr;
  31475. var index$1;
  31476. var expressionPos;
  31477. var expressionEndPos;
  31478. /**
  31479. * parse directive model to do the array update transform. a[idx] = val => $$a.splice($$idx, 1, val)
  31480. *
  31481. * for loop possible cases:
  31482. *
  31483. * - test
  31484. * - test[idx]
  31485. * - test[test1[idx]]
  31486. * - test["a"][idx]
  31487. * - xxx.test[a[a].test1[idx]]
  31488. * - test.xxx.a["asa"][test1[idx]]
  31489. *
  31490. */
  31491. function parseModel (val) {
  31492. str = val;
  31493. len = str.length;
  31494. index$1 = expressionPos = expressionEndPos = 0;
  31495. if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
  31496. return {
  31497. exp: val,
  31498. idx: null
  31499. }
  31500. }
  31501. while (!eof()) {
  31502. chr = next();
  31503. /* istanbul ignore if */
  31504. if (isStringStart(chr)) {
  31505. parseString(chr);
  31506. } else if (chr === 0x5B) {
  31507. parseBracket(chr);
  31508. }
  31509. }
  31510. return {
  31511. exp: val.substring(0, expressionPos),
  31512. idx: val.substring(expressionPos + 1, expressionEndPos)
  31513. }
  31514. }
  31515. function next () {
  31516. return str.charCodeAt(++index$1)
  31517. }
  31518. function eof () {
  31519. return index$1 >= len
  31520. }
  31521. function isStringStart (chr) {
  31522. return chr === 0x22 || chr === 0x27
  31523. }
  31524. function parseBracket (chr) {
  31525. var inBracket = 1;
  31526. expressionPos = index$1;
  31527. while (!eof()) {
  31528. chr = next();
  31529. if (isStringStart(chr)) {
  31530. parseString(chr);
  31531. continue
  31532. }
  31533. if (chr === 0x5B) { inBracket++; }
  31534. if (chr === 0x5D) { inBracket--; }
  31535. if (inBracket === 0) {
  31536. expressionEndPos = index$1;
  31537. break
  31538. }
  31539. }
  31540. }
  31541. function parseString (chr) {
  31542. var stringQuote = chr;
  31543. while (!eof()) {
  31544. chr = next();
  31545. if (chr === stringQuote) {
  31546. break
  31547. }
  31548. }
  31549. }
  31550. /* */
  31551. var dirRE = /^v-|^@|^:/;
  31552. var forAliasRE = /(.*?)\s+(?:in|of)\s+(.*)/;
  31553. var forIteratorRE = /\((\{[^}]*\}|[^,]*),([^,]*)(?:,([^,]*))?\)/;
  31554. var bindRE = /^:|^v-bind:/;
  31555. var onRE = /^@|^v-on:/;
  31556. var argRE = /:(.*)$/;
  31557. var modifierRE = /\.[^.]+/g;
  31558. var decodeHTMLCached = cached(decode);
  31559. // configurable state
  31560. var warn$1;
  31561. var platformGetTagNamespace;
  31562. var platformMustUseProp;
  31563. var platformIsPreTag;
  31564. var preTransforms;
  31565. var transforms;
  31566. var postTransforms;
  31567. var delimiters;
  31568. /**
  31569. * Convert HTML string to AST.
  31570. */
  31571. function parse (
  31572. template,
  31573. options
  31574. ) {
  31575. warn$1 = options.warn || baseWarn;
  31576. platformGetTagNamespace = options.getTagNamespace || no;
  31577. platformMustUseProp = options.mustUseProp || no;
  31578. platformIsPreTag = options.isPreTag || no;
  31579. preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
  31580. transforms = pluckModuleFunction(options.modules, 'transformNode');
  31581. postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
  31582. delimiters = options.delimiters;
  31583. var stack = [];
  31584. var preserveWhitespace = options.preserveWhitespace !== false;
  31585. var root;
  31586. var currentParent;
  31587. var inVPre = false;
  31588. var inPre = false;
  31589. var warned = false;
  31590. parseHTML(template, {
  31591. expectHTML: options.expectHTML,
  31592. isUnaryTag: options.isUnaryTag,
  31593. shouldDecodeNewlines: options.shouldDecodeNewlines,
  31594. start: function start (tag, attrs, unary) {
  31595. // check namespace.
  31596. // inherit parent ns if there is one
  31597. var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);
  31598. // handle IE svg bug
  31599. /* istanbul ignore if */
  31600. if (isIE && ns === 'svg') {
  31601. attrs = guardIESVGBug(attrs);
  31602. }
  31603. var element = {
  31604. type: 1,
  31605. tag: tag,
  31606. attrsList: attrs,
  31607. attrsMap: makeAttrsMap(attrs),
  31608. parent: currentParent,
  31609. children: []
  31610. };
  31611. if (ns) {
  31612. element.ns = ns;
  31613. }
  31614. if (isForbiddenTag(element) && !isServerRendering()) {
  31615. element.forbidden = true;
  31616. process.env.NODE_ENV !== 'production' && warn$1(
  31617. 'Templates should only be responsible for mapping the state to the ' +
  31618. 'UI. Avoid placing tags with side-effects in your templates, such as ' +
  31619. "<" + tag + ">" + ', as they will not be parsed.'
  31620. );
  31621. }
  31622. // apply pre-transforms
  31623. for (var i = 0; i < preTransforms.length; i++) {
  31624. preTransforms[i](element, options);
  31625. }
  31626. if (!inVPre) {
  31627. processPre(element);
  31628. if (element.pre) {
  31629. inVPre = true;
  31630. }
  31631. }
  31632. if (platformIsPreTag(element.tag)) {
  31633. inPre = true;
  31634. }
  31635. if (inVPre) {
  31636. processRawAttrs(element);
  31637. } else {
  31638. processFor(element);
  31639. processIf(element);
  31640. processOnce(element);
  31641. processKey(element);
  31642. // determine whether this is a plain element after
  31643. // removing structural attributes
  31644. element.plain = !element.key && !attrs.length;
  31645. processRef(element);
  31646. processSlot(element);
  31647. processComponent(element);
  31648. for (var i$1 = 0; i$1 < transforms.length; i$1++) {
  31649. transforms[i$1](element, options);
  31650. }
  31651. processAttrs(element);
  31652. }
  31653. function checkRootConstraints (el) {
  31654. if (process.env.NODE_ENV !== 'production' && !warned) {
  31655. if (el.tag === 'slot' || el.tag === 'template') {
  31656. warned = true;
  31657. warn$1(
  31658. "Cannot use <" + (el.tag) + "> as component root element because it may " +
  31659. 'contain multiple nodes:\n' + template
  31660. );
  31661. }
  31662. if (el.attrsMap.hasOwnProperty('v-for')) {
  31663. warned = true;
  31664. warn$1(
  31665. 'Cannot use v-for on stateful component root element because ' +
  31666. 'it renders multiple elements:\n' + template
  31667. );
  31668. }
  31669. }
  31670. }
  31671. // tree management
  31672. if (!root) {
  31673. root = element;
  31674. checkRootConstraints(root);
  31675. } else if (!stack.length) {
  31676. // allow root elements with v-if, v-else-if and v-else
  31677. if (root.if && (element.elseif || element.else)) {
  31678. checkRootConstraints(element);
  31679. addIfCondition(root, {
  31680. exp: element.elseif,
  31681. block: element
  31682. });
  31683. } else if (process.env.NODE_ENV !== 'production' && !warned) {
  31684. warned = true;
  31685. warn$1(
  31686. "Component template should contain exactly one root element:" +
  31687. "\n\n" + template + "\n\n" +
  31688. "If you are using v-if on multiple elements, " +
  31689. "use v-else-if to chain them instead."
  31690. );
  31691. }
  31692. }
  31693. if (currentParent && !element.forbidden) {
  31694. if (element.elseif || element.else) {
  31695. processIfConditions(element, currentParent);
  31696. } else if (element.slotScope) { // scoped slot
  31697. currentParent.plain = false;
  31698. var name = element.slotTarget || 'default';(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;
  31699. } else {
  31700. currentParent.children.push(element);
  31701. element.parent = currentParent;
  31702. }
  31703. }
  31704. if (!unary) {
  31705. currentParent = element;
  31706. stack.push(element);
  31707. }
  31708. // apply post-transforms
  31709. for (var i$2 = 0; i$2 < postTransforms.length; i$2++) {
  31710. postTransforms[i$2](element, options);
  31711. }
  31712. },
  31713. end: function end () {
  31714. // remove trailing whitespace
  31715. var element = stack[stack.length - 1];
  31716. var lastNode = element.children[element.children.length - 1];
  31717. if (lastNode && lastNode.type === 3 && lastNode.text === ' ') {
  31718. element.children.pop();
  31719. }
  31720. // pop stack
  31721. stack.length -= 1;
  31722. currentParent = stack[stack.length - 1];
  31723. // check pre state
  31724. if (element.pre) {
  31725. inVPre = false;
  31726. }
  31727. if (platformIsPreTag(element.tag)) {
  31728. inPre = false;
  31729. }
  31730. },
  31731. chars: function chars (text) {
  31732. if (!currentParent) {
  31733. if (process.env.NODE_ENV !== 'production' && !warned && text === template) {
  31734. warned = true;
  31735. warn$1(
  31736. 'Component template requires a root element, rather than just text:\n\n' + template
  31737. );
  31738. }
  31739. return
  31740. }
  31741. // IE textarea placeholder bug
  31742. /* istanbul ignore if */
  31743. if (isIE &&
  31744. currentParent.tag === 'textarea' &&
  31745. currentParent.attrsMap.placeholder === text) {
  31746. return
  31747. }
  31748. var children = currentParent.children;
  31749. text = inPre || text.trim()
  31750. ? decodeHTMLCached(text)
  31751. // only preserve whitespace if its not right after a starting tag
  31752. : preserveWhitespace && children.length ? ' ' : '';
  31753. if (text) {
  31754. var expression;
  31755. if (!inVPre && text !== ' ' && (expression = parseText(text, delimiters))) {
  31756. children.push({
  31757. type: 2,
  31758. expression: expression,
  31759. text: text
  31760. });
  31761. } else if (text !== ' ' || children[children.length - 1].text !== ' ') {
  31762. currentParent.children.push({
  31763. type: 3,
  31764. text: text
  31765. });
  31766. }
  31767. }
  31768. }
  31769. });
  31770. return root
  31771. }
  31772. function processPre (el) {
  31773. if (getAndRemoveAttr(el, 'v-pre') != null) {
  31774. el.pre = true;
  31775. }
  31776. }
  31777. function processRawAttrs (el) {
  31778. var l = el.attrsList.length;
  31779. if (l) {
  31780. var attrs = el.attrs = new Array(l);
  31781. for (var i = 0; i < l; i++) {
  31782. attrs[i] = {
  31783. name: el.attrsList[i].name,
  31784. value: JSON.stringify(el.attrsList[i].value)
  31785. };
  31786. }
  31787. } else if (!el.pre) {
  31788. // non root node in pre blocks with no attributes
  31789. el.plain = true;
  31790. }
  31791. }
  31792. function processKey (el) {
  31793. var exp = getBindingAttr(el, 'key');
  31794. if (exp) {
  31795. if (process.env.NODE_ENV !== 'production' && el.tag === 'template') {
  31796. warn$1("<template> cannot be keyed. Place the key on real elements instead.");
  31797. }
  31798. el.key = exp;
  31799. }
  31800. }
  31801. function processRef (el) {
  31802. var ref = getBindingAttr(el, 'ref');
  31803. if (ref) {
  31804. el.ref = ref;
  31805. el.refInFor = checkInFor(el);
  31806. }
  31807. }
  31808. function processFor (el) {
  31809. var exp;
  31810. if ((exp = getAndRemoveAttr(el, 'v-for'))) {
  31811. var inMatch = exp.match(forAliasRE);
  31812. if (!inMatch) {
  31813. process.env.NODE_ENV !== 'production' && warn$1(
  31814. ("Invalid v-for expression: " + exp)
  31815. );
  31816. return
  31817. }
  31818. el.for = inMatch[2].trim();
  31819. var alias = inMatch[1].trim();
  31820. var iteratorMatch = alias.match(forIteratorRE);
  31821. if (iteratorMatch) {
  31822. el.alias = iteratorMatch[1].trim();
  31823. el.iterator1 = iteratorMatch[2].trim();
  31824. if (iteratorMatch[3]) {
  31825. el.iterator2 = iteratorMatch[3].trim();
  31826. }
  31827. } else {
  31828. el.alias = alias;
  31829. }
  31830. }
  31831. }
  31832. function processIf (el) {
  31833. var exp = getAndRemoveAttr(el, 'v-if');
  31834. if (exp) {
  31835. el.if = exp;
  31836. addIfCondition(el, {
  31837. exp: exp,
  31838. block: el
  31839. });
  31840. } else {
  31841. if (getAndRemoveAttr(el, 'v-else') != null) {
  31842. el.else = true;
  31843. }
  31844. var elseif = getAndRemoveAttr(el, 'v-else-if');
  31845. if (elseif) {
  31846. el.elseif = elseif;
  31847. }
  31848. }
  31849. }
  31850. function processIfConditions (el, parent) {
  31851. var prev = findPrevElement(parent.children);
  31852. if (prev && prev.if) {
  31853. addIfCondition(prev, {
  31854. exp: el.elseif,
  31855. block: el
  31856. });
  31857. } else if (process.env.NODE_ENV !== 'production') {
  31858. warn$1(
  31859. "v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " +
  31860. "used on element <" + (el.tag) + "> without corresponding v-if."
  31861. );
  31862. }
  31863. }
  31864. function findPrevElement (children) {
  31865. var i = children.length;
  31866. while (i--) {
  31867. if (children[i].type === 1) {
  31868. return children[i]
  31869. } else {
  31870. if (process.env.NODE_ENV !== 'production' && children[i].text !== ' ') {
  31871. warn$1(
  31872. "text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " +
  31873. "will be ignored."
  31874. );
  31875. }
  31876. children.pop();
  31877. }
  31878. }
  31879. }
  31880. function addIfCondition (el, condition) {
  31881. if (!el.ifConditions) {
  31882. el.ifConditions = [];
  31883. }
  31884. el.ifConditions.push(condition);
  31885. }
  31886. function processOnce (el) {
  31887. var once = getAndRemoveAttr(el, 'v-once');
  31888. if (once != null) {
  31889. el.once = true;
  31890. }
  31891. }
  31892. function processSlot (el) {
  31893. if (el.tag === 'slot') {
  31894. el.slotName = getBindingAttr(el, 'name');
  31895. if (process.env.NODE_ENV !== 'production' && el.key) {
  31896. warn$1(
  31897. "`key` does not work on <slot> because slots are abstract outlets " +
  31898. "and can possibly expand into multiple elements. " +
  31899. "Use the key on a wrapping element instead."
  31900. );
  31901. }
  31902. } else {
  31903. var slotTarget = getBindingAttr(el, 'slot');
  31904. if (slotTarget) {
  31905. el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget;
  31906. }
  31907. if (el.tag === 'template') {
  31908. el.slotScope = getAndRemoveAttr(el, 'scope');
  31909. }
  31910. }
  31911. }
  31912. function processComponent (el) {
  31913. var binding;
  31914. if ((binding = getBindingAttr(el, 'is'))) {
  31915. el.component = binding;
  31916. }
  31917. if (getAndRemoveAttr(el, 'inline-template') != null) {
  31918. el.inlineTemplate = true;
  31919. }
  31920. }
  31921. function processAttrs (el) {
  31922. var list = el.attrsList;
  31923. var i, l, name, rawName, value, arg, modifiers, isProp;
  31924. for (i = 0, l = list.length; i < l; i++) {
  31925. name = rawName = list[i].name;
  31926. value = list[i].value;
  31927. if (dirRE.test(name)) {
  31928. // mark element as dynamic
  31929. el.hasBindings = true;
  31930. // modifiers
  31931. modifiers = parseModifiers(name);
  31932. if (modifiers) {
  31933. name = name.replace(modifierRE, '');
  31934. }
  31935. if (bindRE.test(name)) { // v-bind
  31936. name = name.replace(bindRE, '');
  31937. value = parseFilters(value);
  31938. isProp = false;
  31939. if (modifiers) {
  31940. if (modifiers.prop) {
  31941. isProp = true;
  31942. name = camelize(name);
  31943. if (name === 'innerHtml') { name = 'innerHTML'; }
  31944. }
  31945. if (modifiers.camel) {
  31946. name = camelize(name);
  31947. }
  31948. }
  31949. if (isProp || platformMustUseProp(el.tag, el.attrsMap.type, name)) {
  31950. addProp(el, name, value);
  31951. } else {
  31952. addAttr(el, name, value);
  31953. }
  31954. } else if (onRE.test(name)) { // v-on
  31955. name = name.replace(onRE, '');
  31956. addHandler(el, name, value, modifiers);
  31957. } else { // normal directives
  31958. name = name.replace(dirRE, '');
  31959. // parse arg
  31960. var argMatch = name.match(argRE);
  31961. if (argMatch && (arg = argMatch[1])) {
  31962. name = name.slice(0, -(arg.length + 1));
  31963. }
  31964. addDirective(el, name, rawName, value, arg, modifiers);
  31965. if (process.env.NODE_ENV !== 'production' && name === 'model') {
  31966. checkForAliasModel(el, value);
  31967. }
  31968. }
  31969. } else {
  31970. // literal attribute
  31971. if (process.env.NODE_ENV !== 'production') {
  31972. var expression = parseText(value, delimiters);
  31973. if (expression) {
  31974. warn$1(
  31975. name + "=\"" + value + "\": " +
  31976. 'Interpolation inside attributes has been removed. ' +
  31977. 'Use v-bind or the colon shorthand instead. For example, ' +
  31978. 'instead of <div id="{{ val }}">, use <div :id="val">.'
  31979. );
  31980. }
  31981. }
  31982. addAttr(el, name, JSON.stringify(value));
  31983. }
  31984. }
  31985. }
  31986. function checkInFor (el) {
  31987. var parent = el;
  31988. while (parent) {
  31989. if (parent.for !== undefined) {
  31990. return true
  31991. }
  31992. parent = parent.parent;
  31993. }
  31994. return false
  31995. }
  31996. function parseModifiers (name) {
  31997. var match = name.match(modifierRE);
  31998. if (match) {
  31999. var ret = {};
  32000. match.forEach(function (m) { ret[m.slice(1)] = true; });
  32001. return ret
  32002. }
  32003. }
  32004. function makeAttrsMap (attrs) {
  32005. var map = {};
  32006. for (var i = 0, l = attrs.length; i < l; i++) {
  32007. if (process.env.NODE_ENV !== 'production' && map[attrs[i].name] && !isIE) {
  32008. warn$1('duplicate attribute: ' + attrs[i].name);
  32009. }
  32010. map[attrs[i].name] = attrs[i].value;
  32011. }
  32012. return map
  32013. }
  32014. function isForbiddenTag (el) {
  32015. return (
  32016. el.tag === 'style' ||
  32017. (el.tag === 'script' && (
  32018. !el.attrsMap.type ||
  32019. el.attrsMap.type === 'text/javascript'
  32020. ))
  32021. )
  32022. }
  32023. var ieNSBug = /^xmlns:NS\d+/;
  32024. var ieNSPrefix = /^NS\d+:/;
  32025. /* istanbul ignore next */
  32026. function guardIESVGBug (attrs) {
  32027. var res = [];
  32028. for (var i = 0; i < attrs.length; i++) {
  32029. var attr = attrs[i];
  32030. if (!ieNSBug.test(attr.name)) {
  32031. attr.name = attr.name.replace(ieNSPrefix, '');
  32032. res.push(attr);
  32033. }
  32034. }
  32035. return res
  32036. }
  32037. function checkForAliasModel (el, value) {
  32038. var _el = el;
  32039. while (_el) {
  32040. if (_el.for && _el.alias === value) {
  32041. warn$1(
  32042. "<" + (el.tag) + " v-model=\"" + value + "\">: " +
  32043. "You are binding v-model directly to a v-for iteration alias. " +
  32044. "This will not be able to modify the v-for source array because " +
  32045. "writing to the alias is like modifying a function local variable. " +
  32046. "Consider using an array of objects and use v-model on an object property instead."
  32047. );
  32048. }
  32049. _el = _el.parent;
  32050. }
  32051. }
  32052. /* */
  32053. var isStaticKey;
  32054. var isPlatformReservedTag;
  32055. var genStaticKeysCached = cached(genStaticKeys$1);
  32056. /**
  32057. * Goal of the optimizer: walk the generated template AST tree
  32058. * and detect sub-trees that are purely static, i.e. parts of
  32059. * the DOM that never needs to change.
  32060. *
  32061. * Once we detect these sub-trees, we can:
  32062. *
  32063. * 1. Hoist them into constants, so that we no longer need to
  32064. * create fresh nodes for them on each re-render;
  32065. * 2. Completely skip them in the patching process.
  32066. */
  32067. function optimize (root, options) {
  32068. if (!root) { return }
  32069. isStaticKey = genStaticKeysCached(options.staticKeys || '');
  32070. isPlatformReservedTag = options.isReservedTag || no;
  32071. // first pass: mark all non-static nodes.
  32072. markStatic(root);
  32073. // second pass: mark static roots.
  32074. markStaticRoots(root, false);
  32075. }
  32076. function genStaticKeys$1 (keys) {
  32077. return makeMap(
  32078. 'type,tag,attrsList,attrsMap,plain,parent,children,attrs' +
  32079. (keys ? ',' + keys : '')
  32080. )
  32081. }
  32082. function markStatic (node) {
  32083. node.static = isStatic(node);
  32084. if (node.type === 1) {
  32085. // do not make component slot content static. this avoids
  32086. // 1. components not able to mutate slot nodes
  32087. // 2. static slot content fails for hot-reloading
  32088. if (
  32089. !isPlatformReservedTag(node.tag) &&
  32090. node.tag !== 'slot' &&
  32091. node.attrsMap['inline-template'] == null
  32092. ) {
  32093. return
  32094. }
  32095. for (var i = 0, l = node.children.length; i < l; i++) {
  32096. var child = node.children[i];
  32097. markStatic(child);
  32098. if (!child.static) {
  32099. node.static = false;
  32100. }
  32101. }
  32102. }
  32103. }
  32104. function markStaticRoots (node, isInFor) {
  32105. if (node.type === 1) {
  32106. if (node.static || node.once) {
  32107. node.staticInFor = isInFor;
  32108. }
  32109. // For a node to qualify as a static root, it should have children that
  32110. // are not just static text. Otherwise the cost of hoisting out will
  32111. // outweigh the benefits and it's better off to just always render it fresh.
  32112. if (node.static && node.children.length && !(
  32113. node.children.length === 1 &&
  32114. node.children[0].type === 3
  32115. )) {
  32116. node.staticRoot = true;
  32117. return
  32118. } else {
  32119. node.staticRoot = false;
  32120. }
  32121. if (node.children) {
  32122. for (var i = 0, l = node.children.length; i < l; i++) {
  32123. markStaticRoots(node.children[i], isInFor || !!node.for);
  32124. }
  32125. }
  32126. if (node.ifConditions) {
  32127. walkThroughConditionsBlocks(node.ifConditions, isInFor);
  32128. }
  32129. }
  32130. }
  32131. function walkThroughConditionsBlocks (conditionBlocks, isInFor) {
  32132. for (var i = 1, len = conditionBlocks.length; i < len; i++) {
  32133. markStaticRoots(conditionBlocks[i].block, isInFor);
  32134. }
  32135. }
  32136. function isStatic (node) {
  32137. if (node.type === 2) { // expression
  32138. return false
  32139. }
  32140. if (node.type === 3) { // text
  32141. return true
  32142. }
  32143. return !!(node.pre || (
  32144. !node.hasBindings && // no dynamic bindings
  32145. !node.if && !node.for && // not v-if or v-for or v-else
  32146. !isBuiltInTag(node.tag) && // not a built-in
  32147. isPlatformReservedTag(node.tag) && // not a component
  32148. !isDirectChildOfTemplateFor(node) &&
  32149. Object.keys(node).every(isStaticKey)
  32150. ))
  32151. }
  32152. function isDirectChildOfTemplateFor (node) {
  32153. while (node.parent) {
  32154. node = node.parent;
  32155. if (node.tag !== 'template') {
  32156. return false
  32157. }
  32158. if (node.for) {
  32159. return true
  32160. }
  32161. }
  32162. return false
  32163. }
  32164. /* */
  32165. var fnExpRE = /^\s*([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/;
  32166. var simplePathRE = /^\s*[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?']|\[".*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*\s*$/;
  32167. // keyCode aliases
  32168. var keyCodes = {
  32169. esc: 27,
  32170. tab: 9,
  32171. enter: 13,
  32172. space: 32,
  32173. up: 38,
  32174. left: 37,
  32175. right: 39,
  32176. down: 40,
  32177. 'delete': [8, 46]
  32178. };
  32179. var modifierCode = {
  32180. stop: '$event.stopPropagation();',
  32181. prevent: '$event.preventDefault();',
  32182. self: 'if($event.target !== $event.currentTarget)return;',
  32183. ctrl: 'if(!$event.ctrlKey)return;',
  32184. shift: 'if(!$event.shiftKey)return;',
  32185. alt: 'if(!$event.altKey)return;',
  32186. meta: 'if(!$event.metaKey)return;'
  32187. };
  32188. function genHandlers (events, native) {
  32189. var res = native ? 'nativeOn:{' : 'on:{';
  32190. for (var name in events) {
  32191. res += "\"" + name + "\":" + (genHandler(name, events[name])) + ",";
  32192. }
  32193. return res.slice(0, -1) + '}'
  32194. }
  32195. function genHandler (
  32196. name,
  32197. handler
  32198. ) {
  32199. if (!handler) {
  32200. return 'function(){}'
  32201. } else if (Array.isArray(handler)) {
  32202. return ("[" + (handler.map(function (handler) { return genHandler(name, handler); }).join(',')) + "]")
  32203. } else if (!handler.modifiers) {
  32204. return fnExpRE.test(handler.value) || simplePathRE.test(handler.value)
  32205. ? handler.value
  32206. : ("function($event){" + (handler.value) + "}")
  32207. } else {
  32208. var code = '';
  32209. var keys = [];
  32210. for (var key in handler.modifiers) {
  32211. if (modifierCode[key]) {
  32212. code += modifierCode[key];
  32213. } else {
  32214. keys.push(key);
  32215. }
  32216. }
  32217. if (keys.length) {
  32218. code = genKeyFilter(keys) + code;
  32219. }
  32220. var handlerCode = simplePathRE.test(handler.value)
  32221. ? handler.value + '($event)'
  32222. : handler.value;
  32223. return 'function($event){' + code + handlerCode + '}'
  32224. }
  32225. }
  32226. function genKeyFilter (keys) {
  32227. return ("if(" + (keys.map(genFilterCode).join('&&')) + ")return;")
  32228. }
  32229. function genFilterCode (key) {
  32230. var keyVal = parseInt(key, 10);
  32231. if (keyVal) {
  32232. return ("$event.keyCode!==" + keyVal)
  32233. }
  32234. var alias = keyCodes[key];
  32235. return ("_k($event.keyCode," + (JSON.stringify(key)) + (alias ? ',' + JSON.stringify(alias) : '') + ")")
  32236. }
  32237. /* */
  32238. function bind$2 (el, dir) {
  32239. el.wrapData = function (code) {
  32240. return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + (dir.modifiers && dir.modifiers.prop ? ',true' : '') + ")")
  32241. };
  32242. }
  32243. /* */
  32244. var baseDirectives = {
  32245. bind: bind$2,
  32246. cloak: noop
  32247. };
  32248. /* */
  32249. // configurable state
  32250. var warn$2;
  32251. var transforms$1;
  32252. var dataGenFns;
  32253. var platformDirectives$1;
  32254. var isPlatformReservedTag$1;
  32255. var staticRenderFns;
  32256. var onceCount;
  32257. var currentOptions;
  32258. function generate (
  32259. ast,
  32260. options
  32261. ) {
  32262. // save previous staticRenderFns so generate calls can be nested
  32263. var prevStaticRenderFns = staticRenderFns;
  32264. var currentStaticRenderFns = staticRenderFns = [];
  32265. var prevOnceCount = onceCount;
  32266. onceCount = 0;
  32267. currentOptions = options;
  32268. warn$2 = options.warn || baseWarn;
  32269. transforms$1 = pluckModuleFunction(options.modules, 'transformCode');
  32270. dataGenFns = pluckModuleFunction(options.modules, 'genData');
  32271. platformDirectives$1 = options.directives || {};
  32272. isPlatformReservedTag$1 = options.isReservedTag || no;
  32273. var code = ast ? genElement(ast) : '_c("div")';
  32274. staticRenderFns = prevStaticRenderFns;
  32275. onceCount = prevOnceCount;
  32276. return {
  32277. render: ("with(this){return " + code + "}"),
  32278. staticRenderFns: currentStaticRenderFns
  32279. }
  32280. }
  32281. function genElement (el) {
  32282. if (el.staticRoot && !el.staticProcessed) {
  32283. return genStatic(el)
  32284. } else if (el.once && !el.onceProcessed) {
  32285. return genOnce(el)
  32286. } else if (el.for && !el.forProcessed) {
  32287. return genFor(el)
  32288. } else if (el.if && !el.ifProcessed) {
  32289. return genIf(el)
  32290. } else if (el.tag === 'template' && !el.slotTarget) {
  32291. return genChildren(el) || 'void 0'
  32292. } else if (el.tag === 'slot') {
  32293. return genSlot(el)
  32294. } else {
  32295. // component or element
  32296. var code;
  32297. if (el.component) {
  32298. code = genComponent(el.component, el);
  32299. } else {
  32300. var data = el.plain ? undefined : genData(el);
  32301. var children = el.inlineTemplate ? null : genChildren(el, true);
  32302. code = "_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")";
  32303. }
  32304. // module transforms
  32305. for (var i = 0; i < transforms$1.length; i++) {
  32306. code = transforms$1[i](el, code);
  32307. }
  32308. return code
  32309. }
  32310. }
  32311. // hoist static sub-trees out
  32312. function genStatic (el) {
  32313. el.staticProcessed = true;
  32314. staticRenderFns.push(("with(this){return " + (genElement(el)) + "}"));
  32315. return ("_m(" + (staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")")
  32316. }
  32317. // v-once
  32318. function genOnce (el) {
  32319. el.onceProcessed = true;
  32320. if (el.if && !el.ifProcessed) {
  32321. return genIf(el)
  32322. } else if (el.staticInFor) {
  32323. var key = '';
  32324. var parent = el.parent;
  32325. while (parent) {
  32326. if (parent.for) {
  32327. key = parent.key;
  32328. break
  32329. }
  32330. parent = parent.parent;
  32331. }
  32332. if (!key) {
  32333. process.env.NODE_ENV !== 'production' && warn$2(
  32334. "v-once can only be used inside v-for that is keyed. "
  32335. );
  32336. return genElement(el)
  32337. }
  32338. return ("_o(" + (genElement(el)) + "," + (onceCount++) + (key ? ("," + key) : "") + ")")
  32339. } else {
  32340. return genStatic(el)
  32341. }
  32342. }
  32343. function genIf (el) {
  32344. el.ifProcessed = true; // avoid recursion
  32345. return genIfConditions(el.ifConditions.slice())
  32346. }
  32347. function genIfConditions (conditions) {
  32348. if (!conditions.length) {
  32349. return '_e()'
  32350. }
  32351. var condition = conditions.shift();
  32352. if (condition.exp) {
  32353. return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions)))
  32354. } else {
  32355. return ("" + (genTernaryExp(condition.block)))
  32356. }
  32357. // v-if with v-once should generate code like (a)?_m(0):_m(1)
  32358. function genTernaryExp (el) {
  32359. return el.once ? genOnce(el) : genElement(el)
  32360. }
  32361. }
  32362. function genFor (el) {
  32363. var exp = el.for;
  32364. var alias = el.alias;
  32365. var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
  32366. var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
  32367. el.forProcessed = true; // avoid recursion
  32368. return "_l((" + exp + ")," +
  32369. "function(" + alias + iterator1 + iterator2 + "){" +
  32370. "return " + (genElement(el)) +
  32371. '})'
  32372. }
  32373. function genData (el) {
  32374. var data = '{';
  32375. // directives first.
  32376. // directives may mutate the el's other properties before they are generated.
  32377. var dirs = genDirectives(el);
  32378. if (dirs) { data += dirs + ','; }
  32379. // key
  32380. if (el.key) {
  32381. data += "key:" + (el.key) + ",";
  32382. }
  32383. // ref
  32384. if (el.ref) {
  32385. data += "ref:" + (el.ref) + ",";
  32386. }
  32387. if (el.refInFor) {
  32388. data += "refInFor:true,";
  32389. }
  32390. // pre
  32391. if (el.pre) {
  32392. data += "pre:true,";
  32393. }
  32394. // record original tag name for components using "is" attribute
  32395. if (el.component) {
  32396. data += "tag:\"" + (el.tag) + "\",";
  32397. }
  32398. // module data generation functions
  32399. for (var i = 0; i < dataGenFns.length; i++) {
  32400. data += dataGenFns[i](el);
  32401. }
  32402. // attributes
  32403. if (el.attrs) {
  32404. data += "attrs:{" + (genProps(el.attrs)) + "},";
  32405. }
  32406. // DOM props
  32407. if (el.props) {
  32408. data += "domProps:{" + (genProps(el.props)) + "},";
  32409. }
  32410. // event handlers
  32411. if (el.events) {
  32412. data += (genHandlers(el.events)) + ",";
  32413. }
  32414. if (el.nativeEvents) {
  32415. data += (genHandlers(el.nativeEvents, true)) + ",";
  32416. }
  32417. // slot target
  32418. if (el.slotTarget) {
  32419. data += "slot:" + (el.slotTarget) + ",";
  32420. }
  32421. // scoped slots
  32422. if (el.scopedSlots) {
  32423. data += (genScopedSlots(el.scopedSlots)) + ",";
  32424. }
  32425. // inline-template
  32426. if (el.inlineTemplate) {
  32427. var inlineTemplate = genInlineTemplate(el);
  32428. if (inlineTemplate) {
  32429. data += inlineTemplate + ",";
  32430. }
  32431. }
  32432. data = data.replace(/,$/, '') + '}';
  32433. // v-bind data wrap
  32434. if (el.wrapData) {
  32435. data = el.wrapData(data);
  32436. }
  32437. return data
  32438. }
  32439. function genDirectives (el) {
  32440. var dirs = el.directives;
  32441. if (!dirs) { return }
  32442. var res = 'directives:[';
  32443. var hasRuntime = false;
  32444. var i, l, dir, needRuntime;
  32445. for (i = 0, l = dirs.length; i < l; i++) {
  32446. dir = dirs[i];
  32447. needRuntime = true;
  32448. var gen = platformDirectives$1[dir.name] || baseDirectives[dir.name];
  32449. if (gen) {
  32450. // compile-time directive that manipulates AST.
  32451. // returns true if it also needs a runtime counterpart.
  32452. needRuntime = !!gen(el, dir, warn$2);
  32453. }
  32454. if (needRuntime) {
  32455. hasRuntime = true;
  32456. res += "{name:\"" + (dir.name) + "\",rawName:\"" + (dir.rawName) + "\"" + (dir.value ? (",value:(" + (dir.value) + "),expression:" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (",arg:\"" + (dir.arg) + "\"") : '') + (dir.modifiers ? (",modifiers:" + (JSON.stringify(dir.modifiers))) : '') + "},";
  32457. }
  32458. }
  32459. if (hasRuntime) {
  32460. return res.slice(0, -1) + ']'
  32461. }
  32462. }
  32463. function genInlineTemplate (el) {
  32464. var ast = el.children[0];
  32465. if (process.env.NODE_ENV !== 'production' && (
  32466. el.children.length > 1 || ast.type !== 1
  32467. )) {
  32468. warn$2('Inline-template components must have exactly one child element.');
  32469. }
  32470. if (ast.type === 1) {
  32471. var inlineRenderFns = generate(ast, currentOptions);
  32472. return ("inlineTemplate:{render:function(){" + (inlineRenderFns.render) + "},staticRenderFns:[" + (inlineRenderFns.staticRenderFns.map(function (code) { return ("function(){" + code + "}"); }).join(',')) + "]}")
  32473. }
  32474. }
  32475. function genScopedSlots (slots) {
  32476. return ("scopedSlots:{" + (Object.keys(slots).map(function (key) { return genScopedSlot(key, slots[key]); }).join(',')) + "}")
  32477. }
  32478. function genScopedSlot (key, el) {
  32479. return key + ":function(" + (String(el.attrsMap.scope)) + "){" +
  32480. "return " + (el.tag === 'template'
  32481. ? genChildren(el) || 'void 0'
  32482. : genElement(el)) + "}"
  32483. }
  32484. function genChildren (el, checkSkip) {
  32485. var children = el.children;
  32486. if (children.length) {
  32487. var el$1 = children[0];
  32488. // optimize single v-for
  32489. if (children.length === 1 &&
  32490. el$1.for &&
  32491. el$1.tag !== 'template' &&
  32492. el$1.tag !== 'slot') {
  32493. return genElement(el$1)
  32494. }
  32495. var normalizationType = getNormalizationType(children);
  32496. return ("[" + (children.map(genNode).join(',')) + "]" + (checkSkip
  32497. ? normalizationType ? ("," + normalizationType) : ''
  32498. : ''))
  32499. }
  32500. }
  32501. // determine the normalization needed for the children array.
  32502. // 0: no normalization needed
  32503. // 1: simple normalization needed (possible 1-level deep nested array)
  32504. // 2: full normalization needed
  32505. function getNormalizationType (children) {
  32506. var res = 0;
  32507. for (var i = 0; i < children.length; i++) {
  32508. var el = children[i];
  32509. if (el.type !== 1) {
  32510. continue
  32511. }
  32512. if (needsNormalization(el) ||
  32513. (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {
  32514. res = 2;
  32515. break
  32516. }
  32517. if (maybeComponent(el) ||
  32518. (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {
  32519. res = 1;
  32520. }
  32521. }
  32522. return res
  32523. }
  32524. function needsNormalization (el) {
  32525. return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'
  32526. }
  32527. function maybeComponent (el) {
  32528. return !isPlatformReservedTag$1(el.tag)
  32529. }
  32530. function genNode (node) {
  32531. if (node.type === 1) {
  32532. return genElement(node)
  32533. } else {
  32534. return genText(node)
  32535. }
  32536. }
  32537. function genText (text) {
  32538. return ("_v(" + (text.type === 2
  32539. ? text.expression // no need for () because already wrapped in _s()
  32540. : transformSpecialNewlines(JSON.stringify(text.text))) + ")")
  32541. }
  32542. function genSlot (el) {
  32543. var slotName = el.slotName || '"default"';
  32544. var children = genChildren(el);
  32545. var res = "_t(" + slotName + (children ? ("," + children) : '');
  32546. var attrs = el.attrs && ("{" + (el.attrs.map(function (a) { return ((camelize(a.name)) + ":" + (a.value)); }).join(',')) + "}");
  32547. var bind$$1 = el.attrsMap['v-bind'];
  32548. if ((attrs || bind$$1) && !children) {
  32549. res += ",null";
  32550. }
  32551. if (attrs) {
  32552. res += "," + attrs;
  32553. }
  32554. if (bind$$1) {
  32555. res += (attrs ? '' : ',null') + "," + bind$$1;
  32556. }
  32557. return res + ')'
  32558. }
  32559. // componentName is el.component, take it as argument to shun flow's pessimistic refinement
  32560. function genComponent (componentName, el) {
  32561. var children = el.inlineTemplate ? null : genChildren(el, true);
  32562. return ("_c(" + componentName + "," + (genData(el)) + (children ? ("," + children) : '') + ")")
  32563. }
  32564. function genProps (props) {
  32565. var res = '';
  32566. for (var i = 0; i < props.length; i++) {
  32567. var prop = props[i];
  32568. res += "\"" + (prop.name) + "\":" + (transformSpecialNewlines(prop.value)) + ",";
  32569. }
  32570. return res.slice(0, -1)
  32571. }
  32572. // #3895, #4268
  32573. function transformSpecialNewlines (text) {
  32574. return text
  32575. .replace(/\u2028/g, '\\u2028')
  32576. .replace(/\u2029/g, '\\u2029')
  32577. }
  32578. /* */
  32579. /**
  32580. * Compile a template.
  32581. */
  32582. function compile$1 (
  32583. template,
  32584. options
  32585. ) {
  32586. var ast = parse(template.trim(), options);
  32587. optimize(ast, options);
  32588. var code = generate(ast, options);
  32589. return {
  32590. ast: ast,
  32591. render: code.render,
  32592. staticRenderFns: code.staticRenderFns
  32593. }
  32594. }
  32595. /* */
  32596. // operators like typeof, instanceof and in are allowed
  32597. var prohibitedKeywordRE = new RegExp('\\b' + (
  32598. 'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
  32599. 'super,throw,while,yield,delete,export,import,return,switch,default,' +
  32600. 'extends,finally,continue,debugger,function,arguments'
  32601. ).split(',').join('\\b|\\b') + '\\b');
  32602. // check valid identifier for v-for
  32603. var identRE = /[A-Za-z_$][\w$]*/;
  32604. // strip strings in expressions
  32605. var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
  32606. // detect problematic expressions in a template
  32607. function detectErrors (ast) {
  32608. var errors = [];
  32609. if (ast) {
  32610. checkNode(ast, errors);
  32611. }
  32612. return errors
  32613. }
  32614. function checkNode (node, errors) {
  32615. if (node.type === 1) {
  32616. for (var name in node.attrsMap) {
  32617. if (dirRE.test(name)) {
  32618. var value = node.attrsMap[name];
  32619. if (value) {
  32620. if (name === 'v-for') {
  32621. checkFor(node, ("v-for=\"" + value + "\""), errors);
  32622. } else {
  32623. checkExpression(value, (name + "=\"" + value + "\""), errors);
  32624. }
  32625. }
  32626. }
  32627. }
  32628. if (node.children) {
  32629. for (var i = 0; i < node.children.length; i++) {
  32630. checkNode(node.children[i], errors);
  32631. }
  32632. }
  32633. } else if (node.type === 2) {
  32634. checkExpression(node.expression, node.text, errors);
  32635. }
  32636. }
  32637. function checkFor (node, text, errors) {
  32638. checkExpression(node.for || '', text, errors);
  32639. checkIdentifier(node.alias, 'v-for alias', text, errors);
  32640. checkIdentifier(node.iterator1, 'v-for iterator', text, errors);
  32641. checkIdentifier(node.iterator2, 'v-for iterator', text, errors);
  32642. }
  32643. function checkIdentifier (ident, type, text, errors) {
  32644. if (typeof ident === 'string' && !identRE.test(ident)) {
  32645. errors.push(("- invalid " + type + " \"" + ident + "\" in expression: " + text));
  32646. }
  32647. }
  32648. function checkExpression (exp, text, errors) {
  32649. try {
  32650. new Function(("return " + exp));
  32651. } catch (e) {
  32652. var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);
  32653. if (keywordMatch) {
  32654. errors.push(
  32655. "- avoid using JavaScript keyword as property name: " +
  32656. "\"" + (keywordMatch[0]) + "\" in expression " + text
  32657. );
  32658. } else {
  32659. errors.push(("- invalid expression: " + text));
  32660. }
  32661. }
  32662. }
  32663. /* */
  32664. function transformNode (el, options) {
  32665. var warn = options.warn || baseWarn;
  32666. var staticClass = getAndRemoveAttr(el, 'class');
  32667. if (process.env.NODE_ENV !== 'production' && staticClass) {
  32668. var expression = parseText(staticClass, options.delimiters);
  32669. if (expression) {
  32670. warn(
  32671. "class=\"" + staticClass + "\": " +
  32672. 'Interpolation inside attributes has been removed. ' +
  32673. 'Use v-bind or the colon shorthand instead. For example, ' +
  32674. 'instead of <div class="{{ val }}">, use <div :class="val">.'
  32675. );
  32676. }
  32677. }
  32678. if (staticClass) {
  32679. el.staticClass = JSON.stringify(staticClass);
  32680. }
  32681. var classBinding = getBindingAttr(el, 'class', false /* getStatic */);
  32682. if (classBinding) {
  32683. el.classBinding = classBinding;
  32684. }
  32685. }
  32686. function genData$1 (el) {
  32687. var data = '';
  32688. if (el.staticClass) {
  32689. data += "staticClass:" + (el.staticClass) + ",";
  32690. }
  32691. if (el.classBinding) {
  32692. data += "class:" + (el.classBinding) + ",";
  32693. }
  32694. return data
  32695. }
  32696. var klass$1 = {
  32697. staticKeys: ['staticClass'],
  32698. transformNode: transformNode,
  32699. genData: genData$1
  32700. };
  32701. /* */
  32702. function transformNode$1 (el, options) {
  32703. var warn = options.warn || baseWarn;
  32704. var staticStyle = getAndRemoveAttr(el, 'style');
  32705. if (staticStyle) {
  32706. /* istanbul ignore if */
  32707. if (process.env.NODE_ENV !== 'production') {
  32708. var expression = parseText(staticStyle, options.delimiters);
  32709. if (expression) {
  32710. warn(
  32711. "style=\"" + staticStyle + "\": " +
  32712. 'Interpolation inside attributes has been removed. ' +
  32713. 'Use v-bind or the colon shorthand instead. For example, ' +
  32714. 'instead of <div style="{{ val }}">, use <div :style="val">.'
  32715. );
  32716. }
  32717. }
  32718. el.staticStyle = JSON.stringify(parseStyleText(staticStyle));
  32719. }
  32720. var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);
  32721. if (styleBinding) {
  32722. el.styleBinding = styleBinding;
  32723. }
  32724. }
  32725. function genData$2 (el) {
  32726. var data = '';
  32727. if (el.staticStyle) {
  32728. data += "staticStyle:" + (el.staticStyle) + ",";
  32729. }
  32730. if (el.styleBinding) {
  32731. data += "style:(" + (el.styleBinding) + "),";
  32732. }
  32733. return data
  32734. }
  32735. var style$1 = {
  32736. staticKeys: ['staticStyle'],
  32737. transformNode: transformNode$1,
  32738. genData: genData$2
  32739. };
  32740. var modules$1 = [
  32741. klass$1,
  32742. style$1
  32743. ];
  32744. /* */
  32745. var warn$3;
  32746. function model$1 (
  32747. el,
  32748. dir,
  32749. _warn
  32750. ) {
  32751. warn$3 = _warn;
  32752. var value = dir.value;
  32753. var modifiers = dir.modifiers;
  32754. var tag = el.tag;
  32755. var type = el.attrsMap.type;
  32756. if (process.env.NODE_ENV !== 'production') {
  32757. var dynamicType = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];
  32758. if (tag === 'input' && dynamicType) {
  32759. warn$3(
  32760. "<input :type=\"" + dynamicType + "\" v-model=\"" + value + "\">:\n" +
  32761. "v-model does not support dynamic input types. Use v-if branches instead."
  32762. );
  32763. }
  32764. }
  32765. if (tag === 'select') {
  32766. genSelect(el, value, modifiers);
  32767. } else if (tag === 'input' && type === 'checkbox') {
  32768. genCheckboxModel(el, value, modifiers);
  32769. } else if (tag === 'input' && type === 'radio') {
  32770. genRadioModel(el, value, modifiers);
  32771. } else {
  32772. genDefaultModel(el, value, modifiers);
  32773. }
  32774. // ensure runtime directive metadata
  32775. return true
  32776. }
  32777. function genCheckboxModel (
  32778. el,
  32779. value,
  32780. modifiers
  32781. ) {
  32782. if (process.env.NODE_ENV !== 'production' &&
  32783. el.attrsMap.checked != null) {
  32784. warn$3(
  32785. "<" + (el.tag) + " v-model=\"" + value + "\" checked>:\n" +
  32786. "inline checked attributes will be ignored when using v-model. " +
  32787. 'Declare initial values in the component\'s data option instead.'
  32788. );
  32789. }
  32790. var number = modifiers && modifiers.number;
  32791. var valueBinding = getBindingAttr(el, 'value') || 'null';
  32792. var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';
  32793. var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';
  32794. addProp(el, 'checked',
  32795. "Array.isArray(" + value + ")" +
  32796. "?_i(" + value + "," + valueBinding + ")>-1" + (
  32797. trueValueBinding === 'true'
  32798. ? (":(" + value + ")")
  32799. : (":_q(" + value + "," + trueValueBinding + ")")
  32800. )
  32801. );
  32802. addHandler(el, 'click',
  32803. "var $$a=" + value + "," +
  32804. '$$el=$event.target,' +
  32805. "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" +
  32806. 'if(Array.isArray($$a)){' +
  32807. "var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," +
  32808. '$$i=_i($$a,$$v);' +
  32809. "if($$c){$$i<0&&(" + value + "=$$a.concat($$v))}" +
  32810. "else{$$i>-1&&(" + value + "=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}" +
  32811. "}else{" + value + "=$$c}",
  32812. null, true
  32813. );
  32814. }
  32815. function genRadioModel (
  32816. el,
  32817. value,
  32818. modifiers
  32819. ) {
  32820. if (process.env.NODE_ENV !== 'production' &&
  32821. el.attrsMap.checked != null) {
  32822. warn$3(
  32823. "<" + (el.tag) + " v-model=\"" + value + "\" checked>:\n" +
  32824. "inline checked attributes will be ignored when using v-model. " +
  32825. 'Declare initial values in the component\'s data option instead.'
  32826. );
  32827. }
  32828. var number = modifiers && modifiers.number;
  32829. var valueBinding = getBindingAttr(el, 'value') || 'null';
  32830. valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding;
  32831. addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")"));
  32832. addHandler(el, 'click', genAssignmentCode(value, valueBinding), null, true);
  32833. }
  32834. function genDefaultModel (
  32835. el,
  32836. value,
  32837. modifiers
  32838. ) {
  32839. if (process.env.NODE_ENV !== 'production') {
  32840. if (el.tag === 'input' && el.attrsMap.value) {
  32841. warn$3(
  32842. "<" + (el.tag) + " v-model=\"" + value + "\" value=\"" + (el.attrsMap.value) + "\">:\n" +
  32843. 'inline value attributes will be ignored when using v-model. ' +
  32844. 'Declare initial values in the component\'s data option instead.'
  32845. );
  32846. }
  32847. if (el.tag === 'textarea' && el.children.length) {
  32848. warn$3(
  32849. "<textarea v-model=\"" + value + "\">:\n" +
  32850. 'inline content inside <textarea> will be ignored when using v-model. ' +
  32851. 'Declare initial values in the component\'s data option instead.'
  32852. );
  32853. }
  32854. }
  32855. var type = el.attrsMap.type;
  32856. var ref = modifiers || {};
  32857. var lazy = ref.lazy;
  32858. var number = ref.number;
  32859. var trim = ref.trim;
  32860. var event = lazy || (isIE && type === 'range') ? 'change' : 'input';
  32861. var needCompositionGuard = !lazy && type !== 'range';
  32862. var isNative = el.tag === 'input' || el.tag === 'textarea';
  32863. var valueExpression = isNative
  32864. ? ("$event.target.value" + (trim ? '.trim()' : ''))
  32865. : trim ? "(typeof $event === 'string' ? $event.trim() : $event)" : "$event";
  32866. valueExpression = number || type === 'number'
  32867. ? ("_n(" + valueExpression + ")")
  32868. : valueExpression;
  32869. var code = genAssignmentCode(value, valueExpression);
  32870. if (isNative && needCompositionGuard) {
  32871. code = "if($event.target.composing)return;" + code;
  32872. }
  32873. // inputs with type="file" are read only and setting the input's
  32874. // value will throw an error.
  32875. if (process.env.NODE_ENV !== 'production' &&
  32876. type === 'file') {
  32877. warn$3(
  32878. "<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" +
  32879. "File inputs are read only. Use a v-on:change listener instead."
  32880. );
  32881. }
  32882. addProp(el, 'value', isNative ? ("_s(" + value + ")") : ("(" + value + ")"));
  32883. addHandler(el, event, code, null, true);
  32884. if (trim || number || type === 'number') {
  32885. addHandler(el, 'blur', '$forceUpdate()');
  32886. }
  32887. }
  32888. function genSelect (
  32889. el,
  32890. value,
  32891. modifiers
  32892. ) {
  32893. if (process.env.NODE_ENV !== 'production') {
  32894. el.children.some(checkOptionWarning);
  32895. }
  32896. var number = modifiers && modifiers.number;
  32897. var assignment = "Array.prototype.filter" +
  32898. ".call($event.target.options,function(o){return o.selected})" +
  32899. ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" +
  32900. "return " + (number ? '_n(val)' : 'val') + "})" +
  32901. (el.attrsMap.multiple == null ? '[0]' : '');
  32902. var code = genAssignmentCode(value, assignment);
  32903. addHandler(el, 'change', code, null, true);
  32904. }
  32905. function checkOptionWarning (option) {
  32906. if (option.type === 1 &&
  32907. option.tag === 'option' &&
  32908. option.attrsMap.selected != null) {
  32909. warn$3(
  32910. "<select v-model=\"" + (option.parent.attrsMap['v-model']) + "\">:\n" +
  32911. 'inline selected attributes on <option> will be ignored when using v-model. ' +
  32912. 'Declare initial values in the component\'s data option instead.'
  32913. );
  32914. return true
  32915. }
  32916. return false
  32917. }
  32918. function genAssignmentCode (value, assignment) {
  32919. var modelRs = parseModel(value);
  32920. if (modelRs.idx === null) {
  32921. return (value + "=" + assignment)
  32922. } else {
  32923. return "var $$exp = " + (modelRs.exp) + ", $$idx = " + (modelRs.idx) + ";" +
  32924. "if (!Array.isArray($$exp)){" +
  32925. value + "=" + assignment + "}" +
  32926. "else{$$exp.splice($$idx, 1, " + assignment + ")}"
  32927. }
  32928. }
  32929. /* */
  32930. function text (el, dir) {
  32931. if (dir.value) {
  32932. addProp(el, 'textContent', ("_s(" + (dir.value) + ")"));
  32933. }
  32934. }
  32935. /* */
  32936. function html (el, dir) {
  32937. if (dir.value) {
  32938. addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")"));
  32939. }
  32940. }
  32941. var directives$1 = {
  32942. model: model$1,
  32943. text: text,
  32944. html: html
  32945. };
  32946. /* */
  32947. var cache = Object.create(null);
  32948. var baseOptions = {
  32949. expectHTML: true,
  32950. modules: modules$1,
  32951. staticKeys: genStaticKeys(modules$1),
  32952. directives: directives$1,
  32953. isReservedTag: isReservedTag,
  32954. isUnaryTag: isUnaryTag,
  32955. mustUseProp: mustUseProp,
  32956. getTagNamespace: getTagNamespace,
  32957. isPreTag: isPreTag
  32958. };
  32959. function compile$$1 (
  32960. template,
  32961. options
  32962. ) {
  32963. options = options
  32964. ? extend(extend({}, baseOptions), options)
  32965. : baseOptions;
  32966. return compile$1(template, options)
  32967. }
  32968. function compileToFunctions (
  32969. template,
  32970. options,
  32971. vm
  32972. ) {
  32973. var _warn = (options && options.warn) || warn;
  32974. // detect possible CSP restriction
  32975. /* istanbul ignore if */
  32976. if (process.env.NODE_ENV !== 'production') {
  32977. try {
  32978. new Function('return 1');
  32979. } catch (e) {
  32980. if (e.toString().match(/unsafe-eval|CSP/)) {
  32981. _warn(
  32982. 'It seems you are using the standalone build of Vue.js in an ' +
  32983. 'environment with Content Security Policy that prohibits unsafe-eval. ' +
  32984. 'The template compiler cannot work in this environment. Consider ' +
  32985. 'relaxing the policy to allow unsafe-eval or pre-compiling your ' +
  32986. 'templates into render functions.'
  32987. );
  32988. }
  32989. }
  32990. }
  32991. var key = options && options.delimiters
  32992. ? String(options.delimiters) + template
  32993. : template;
  32994. if (cache[key]) {
  32995. return cache[key]
  32996. }
  32997. var res = {};
  32998. var compiled = compile$$1(template, options);
  32999. res.render = makeFunction(compiled.render);
  33000. var l = compiled.staticRenderFns.length;
  33001. res.staticRenderFns = new Array(l);
  33002. for (var i = 0; i < l; i++) {
  33003. res.staticRenderFns[i] = makeFunction(compiled.staticRenderFns[i]);
  33004. }
  33005. if (process.env.NODE_ENV !== 'production') {
  33006. if (res.render === noop || res.staticRenderFns.some(function (fn) { return fn === noop; })) {
  33007. _warn(
  33008. "failed to compile template:\n\n" + template + "\n\n" +
  33009. detectErrors(compiled.ast).join('\n') +
  33010. '\n\n',
  33011. vm
  33012. );
  33013. }
  33014. }
  33015. return (cache[key] = res)
  33016. }
  33017. function makeFunction (code) {
  33018. try {
  33019. return new Function(code)
  33020. } catch (e) {
  33021. return noop
  33022. }
  33023. }
  33024. /* */
  33025. var idToTemplate = cached(function (id) {
  33026. var el = query(id);
  33027. return el && el.innerHTML
  33028. });
  33029. var mount = Vue$3.prototype.$mount;
  33030. Vue$3.prototype.$mount = function (
  33031. el,
  33032. hydrating
  33033. ) {
  33034. el = el && query(el);
  33035. /* istanbul ignore if */
  33036. if (el === document.body || el === document.documentElement) {
  33037. process.env.NODE_ENV !== 'production' && warn(
  33038. "Do not mount Vue to <html> or <body> - mount to normal elements instead."
  33039. );
  33040. return this
  33041. }
  33042. var options = this.$options;
  33043. // resolve template/el and convert to render function
  33044. if (!options.render) {
  33045. var template = options.template;
  33046. if (template) {
  33047. if (typeof template === 'string') {
  33048. if (template.charAt(0) === '#') {
  33049. template = idToTemplate(template);
  33050. /* istanbul ignore if */
  33051. if (process.env.NODE_ENV !== 'production' && !template) {
  33052. warn(
  33053. ("Template element not found or is empty: " + (options.template)),
  33054. this
  33055. );
  33056. }
  33057. }
  33058. } else if (template.nodeType) {
  33059. template = template.innerHTML;
  33060. } else {
  33061. if (process.env.NODE_ENV !== 'production') {
  33062. warn('invalid template option:' + template, this);
  33063. }
  33064. return this
  33065. }
  33066. } else if (el) {
  33067. template = getOuterHTML(el);
  33068. }
  33069. if (template) {
  33070. var ref = compileToFunctions(template, {
  33071. warn: warn,
  33072. shouldDecodeNewlines: shouldDecodeNewlines,
  33073. delimiters: options.delimiters
  33074. }, this);
  33075. var render = ref.render;
  33076. var staticRenderFns = ref.staticRenderFns;
  33077. options.render = render;
  33078. options.staticRenderFns = staticRenderFns;
  33079. }
  33080. }
  33081. return mount.call(this, el, hydrating)
  33082. };
  33083. /**
  33084. * Get outerHTML of elements, taking care
  33085. * of SVG elements in IE as well.
  33086. */
  33087. function getOuterHTML (el) {
  33088. if (el.outerHTML) {
  33089. return el.outerHTML
  33090. } else {
  33091. var container = document.createElement('div');
  33092. container.appendChild(el.cloneNode(true));
  33093. return container.innerHTML
  33094. }
  33095. }
  33096. Vue$3.compile = compileToFunctions;
  33097. module.exports = Vue$3;
  33098. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(113), __webpack_require__(190)))
  33099. /***/ }),
  33100. /* 125 */
  33101. /***/ (function(module, exports, __webpack_require__) {
  33102. var map = {
  33103. "./af": 4,
  33104. "./af.js": 4,
  33105. "./ar": 10,
  33106. "./ar-dz": 5,
  33107. "./ar-dz.js": 5,
  33108. "./ar-ly": 6,
  33109. "./ar-ly.js": 6,
  33110. "./ar-ma": 7,
  33111. "./ar-ma.js": 7,
  33112. "./ar-sa": 8,
  33113. "./ar-sa.js": 8,
  33114. "./ar-tn": 9,
  33115. "./ar-tn.js": 9,
  33116. "./ar.js": 10,
  33117. "./az": 11,
  33118. "./az.js": 11,
  33119. "./be": 12,
  33120. "./be.js": 12,
  33121. "./bg": 13,
  33122. "./bg.js": 13,
  33123. "./bn": 14,
  33124. "./bn.js": 14,
  33125. "./bo": 15,
  33126. "./bo.js": 15,
  33127. "./br": 16,
  33128. "./br.js": 16,
  33129. "./bs": 17,
  33130. "./bs.js": 17,
  33131. "./ca": 18,
  33132. "./ca.js": 18,
  33133. "./cs": 19,
  33134. "./cs.js": 19,
  33135. "./cv": 20,
  33136. "./cv.js": 20,
  33137. "./cy": 21,
  33138. "./cy.js": 21,
  33139. "./da": 22,
  33140. "./da.js": 22,
  33141. "./de": 24,
  33142. "./de-at": 23,
  33143. "./de-at.js": 23,
  33144. "./de.js": 24,
  33145. "./dv": 25,
  33146. "./dv.js": 25,
  33147. "./el": 26,
  33148. "./el.js": 26,
  33149. "./en-au": 27,
  33150. "./en-au.js": 27,
  33151. "./en-ca": 28,
  33152. "./en-ca.js": 28,
  33153. "./en-gb": 29,
  33154. "./en-gb.js": 29,
  33155. "./en-ie": 30,
  33156. "./en-ie.js": 30,
  33157. "./en-nz": 31,
  33158. "./en-nz.js": 31,
  33159. "./eo": 32,
  33160. "./eo.js": 32,
  33161. "./es": 34,
  33162. "./es-do": 33,
  33163. "./es-do.js": 33,
  33164. "./es.js": 34,
  33165. "./et": 35,
  33166. "./et.js": 35,
  33167. "./eu": 36,
  33168. "./eu.js": 36,
  33169. "./fa": 37,
  33170. "./fa.js": 37,
  33171. "./fi": 38,
  33172. "./fi.js": 38,
  33173. "./fo": 39,
  33174. "./fo.js": 39,
  33175. "./fr": 42,
  33176. "./fr-ca": 40,
  33177. "./fr-ca.js": 40,
  33178. "./fr-ch": 41,
  33179. "./fr-ch.js": 41,
  33180. "./fr.js": 42,
  33181. "./fy": 43,
  33182. "./fy.js": 43,
  33183. "./gd": 44,
  33184. "./gd.js": 44,
  33185. "./gl": 45,
  33186. "./gl.js": 45,
  33187. "./he": 46,
  33188. "./he.js": 46,
  33189. "./hi": 47,
  33190. "./hi.js": 47,
  33191. "./hr": 48,
  33192. "./hr.js": 48,
  33193. "./hu": 49,
  33194. "./hu.js": 49,
  33195. "./hy-am": 50,
  33196. "./hy-am.js": 50,
  33197. "./id": 51,
  33198. "./id.js": 51,
  33199. "./is": 52,
  33200. "./is.js": 52,
  33201. "./it": 53,
  33202. "./it.js": 53,
  33203. "./ja": 54,
  33204. "./ja.js": 54,
  33205. "./jv": 55,
  33206. "./jv.js": 55,
  33207. "./ka": 56,
  33208. "./ka.js": 56,
  33209. "./kk": 57,
  33210. "./kk.js": 57,
  33211. "./km": 58,
  33212. "./km.js": 58,
  33213. "./ko": 59,
  33214. "./ko.js": 59,
  33215. "./ky": 60,
  33216. "./ky.js": 60,
  33217. "./lb": 61,
  33218. "./lb.js": 61,
  33219. "./lo": 62,
  33220. "./lo.js": 62,
  33221. "./lt": 63,
  33222. "./lt.js": 63,
  33223. "./lv": 64,
  33224. "./lv.js": 64,
  33225. "./me": 65,
  33226. "./me.js": 65,
  33227. "./mi": 66,
  33228. "./mi.js": 66,
  33229. "./mk": 67,
  33230. "./mk.js": 67,
  33231. "./ml": 68,
  33232. "./ml.js": 68,
  33233. "./mr": 69,
  33234. "./mr.js": 69,
  33235. "./ms": 71,
  33236. "./ms-my": 70,
  33237. "./ms-my.js": 70,
  33238. "./ms.js": 71,
  33239. "./my": 72,
  33240. "./my.js": 72,
  33241. "./nb": 73,
  33242. "./nb.js": 73,
  33243. "./ne": 74,
  33244. "./ne.js": 74,
  33245. "./nl": 76,
  33246. "./nl-be": 75,
  33247. "./nl-be.js": 75,
  33248. "./nl.js": 76,
  33249. "./nn": 77,
  33250. "./nn.js": 77,
  33251. "./pa-in": 78,
  33252. "./pa-in.js": 78,
  33253. "./pl": 79,
  33254. "./pl.js": 79,
  33255. "./pt": 81,
  33256. "./pt-br": 80,
  33257. "./pt-br.js": 80,
  33258. "./pt.js": 81,
  33259. "./ro": 82,
  33260. "./ro.js": 82,
  33261. "./ru": 83,
  33262. "./ru.js": 83,
  33263. "./se": 84,
  33264. "./se.js": 84,
  33265. "./si": 85,
  33266. "./si.js": 85,
  33267. "./sk": 86,
  33268. "./sk.js": 86,
  33269. "./sl": 87,
  33270. "./sl.js": 87,
  33271. "./sq": 88,
  33272. "./sq.js": 88,
  33273. "./sr": 90,
  33274. "./sr-cyrl": 89,
  33275. "./sr-cyrl.js": 89,
  33276. "./sr.js": 90,
  33277. "./ss": 91,
  33278. "./ss.js": 91,
  33279. "./sv": 92,
  33280. "./sv.js": 92,
  33281. "./sw": 93,
  33282. "./sw.js": 93,
  33283. "./ta": 94,
  33284. "./ta.js": 94,
  33285. "./te": 95,
  33286. "./te.js": 95,
  33287. "./tet": 96,
  33288. "./tet.js": 96,
  33289. "./th": 97,
  33290. "./th.js": 97,
  33291. "./tl-ph": 98,
  33292. "./tl-ph.js": 98,
  33293. "./tlh": 99,
  33294. "./tlh.js": 99,
  33295. "./tr": 100,
  33296. "./tr.js": 100,
  33297. "./tzl": 101,
  33298. "./tzl.js": 101,
  33299. "./tzm": 103,
  33300. "./tzm-latn": 102,
  33301. "./tzm-latn.js": 102,
  33302. "./tzm.js": 103,
  33303. "./uk": 104,
  33304. "./uk.js": 104,
  33305. "./uz": 105,
  33306. "./uz.js": 105,
  33307. "./vi": 106,
  33308. "./vi.js": 106,
  33309. "./x-pseudo": 107,
  33310. "./x-pseudo.js": 107,
  33311. "./yo": 108,
  33312. "./yo.js": 108,
  33313. "./zh-cn": 109,
  33314. "./zh-cn.js": 109,
  33315. "./zh-hk": 110,
  33316. "./zh-hk.js": 110,
  33317. "./zh-tw": 111,
  33318. "./zh-tw.js": 111
  33319. };
  33320. function webpackContext(req) {
  33321. return __webpack_require__(webpackContextResolve(req));
  33322. };
  33323. function webpackContextResolve(req) {
  33324. var id = map[req];
  33325. if(!(id + 1)) // check for number
  33326. throw new Error("Cannot find module '" + req + "'.");
  33327. return id;
  33328. };
  33329. webpackContext.keys = function webpackContextKeys() {
  33330. return Object.keys(map);
  33331. };
  33332. webpackContext.resolve = webpackContextResolve;
  33333. module.exports = webpackContext;
  33334. webpackContext.id = 125;
  33335. /***/ }),
  33336. /* 126 */
  33337. /***/ (function(module, exports, __webpack_require__) {
  33338. /**
  33339. * @namespace Chart
  33340. */
  33341. var Chart = __webpack_require__(147)();
  33342. __webpack_require__(145)(Chart);
  33343. __webpack_require__(161)(Chart);
  33344. __webpack_require__(141)(Chart);
  33345. __webpack_require__(150)(Chart);
  33346. __webpack_require__(144)(Chart);
  33347. __webpack_require__(140)(Chart);
  33348. __webpack_require__(142)(Chart);
  33349. __webpack_require__(143)(Chart);
  33350. __webpack_require__(148)(Chart);
  33351. __webpack_require__(152)(Chart);
  33352. __webpack_require__(153)(Chart);
  33353. __webpack_require__(151)(Chart);
  33354. __webpack_require__(154)(Chart);
  33355. __webpack_require__(149)(Chart);
  33356. __webpack_require__(146)(Chart);
  33357. __webpack_require__(155)(Chart);
  33358. __webpack_require__(156)(Chart);
  33359. __webpack_require__(157)(Chart);
  33360. __webpack_require__(158)(Chart);
  33361. __webpack_require__(159)(Chart);
  33362. __webpack_require__(164)(Chart);
  33363. __webpack_require__(162)(Chart);
  33364. __webpack_require__(163)(Chart);
  33365. __webpack_require__(165)(Chart);
  33366. __webpack_require__(166)(Chart);
  33367. __webpack_require__(167)(Chart);
  33368. // Controllers must be loaded after elements
  33369. // See Chart.core.datasetController.dataElementType
  33370. __webpack_require__(134)(Chart);
  33371. __webpack_require__(135)(Chart);
  33372. __webpack_require__(136)(Chart);
  33373. __webpack_require__(137)(Chart);
  33374. __webpack_require__(138)(Chart);
  33375. __webpack_require__(139)(Chart);
  33376. __webpack_require__(127)(Chart);
  33377. __webpack_require__(128)(Chart);
  33378. __webpack_require__(129)(Chart);
  33379. __webpack_require__(130)(Chart);
  33380. __webpack_require__(131)(Chart);
  33381. __webpack_require__(132)(Chart);
  33382. __webpack_require__(133)(Chart);
  33383. window.Chart = module.exports = Chart;
  33384. /***/ }),
  33385. /* 127 */
  33386. /***/ (function(module, exports, __webpack_require__) {
  33387. "use strict";
  33388. module.exports = function(Chart) {
  33389. Chart.Bar = function(context, config) {
  33390. config.type = 'bar';
  33391. return new Chart(context, config);
  33392. };
  33393. };
  33394. /***/ }),
  33395. /* 128 */
  33396. /***/ (function(module, exports, __webpack_require__) {
  33397. "use strict";
  33398. module.exports = function(Chart) {
  33399. Chart.Bubble = function(context, config) {
  33400. config.type = 'bubble';
  33401. return new Chart(context, config);
  33402. };
  33403. };
  33404. /***/ }),
  33405. /* 129 */
  33406. /***/ (function(module, exports, __webpack_require__) {
  33407. "use strict";
  33408. module.exports = function(Chart) {
  33409. Chart.Doughnut = function(context, config) {
  33410. config.type = 'doughnut';
  33411. return new Chart(context, config);
  33412. };
  33413. };
  33414. /***/ }),
  33415. /* 130 */
  33416. /***/ (function(module, exports, __webpack_require__) {
  33417. "use strict";
  33418. module.exports = function(Chart) {
  33419. Chart.Line = function(context, config) {
  33420. config.type = 'line';
  33421. return new Chart(context, config);
  33422. };
  33423. };
  33424. /***/ }),
  33425. /* 131 */
  33426. /***/ (function(module, exports, __webpack_require__) {
  33427. "use strict";
  33428. module.exports = function(Chart) {
  33429. Chart.PolarArea = function(context, config) {
  33430. config.type = 'polarArea';
  33431. return new Chart(context, config);
  33432. };
  33433. };
  33434. /***/ }),
  33435. /* 132 */
  33436. /***/ (function(module, exports, __webpack_require__) {
  33437. "use strict";
  33438. module.exports = function(Chart) {
  33439. Chart.Radar = function(context, config) {
  33440. config.type = 'radar';
  33441. return new Chart(context, config);
  33442. };
  33443. };
  33444. /***/ }),
  33445. /* 133 */
  33446. /***/ (function(module, exports, __webpack_require__) {
  33447. "use strict";
  33448. module.exports = function(Chart) {
  33449. var defaultConfig = {
  33450. hover: {
  33451. mode: 'single'
  33452. },
  33453. scales: {
  33454. xAxes: [{
  33455. type: 'linear', // scatter should not use a category axis
  33456. position: 'bottom',
  33457. id: 'x-axis-1' // need an ID so datasets can reference the scale
  33458. }],
  33459. yAxes: [{
  33460. type: 'linear',
  33461. position: 'left',
  33462. id: 'y-axis-1'
  33463. }]
  33464. },
  33465. tooltips: {
  33466. callbacks: {
  33467. title: function() {
  33468. // Title doesn't make sense for scatter since we format the data as a point
  33469. return '';
  33470. },
  33471. label: function(tooltipItem) {
  33472. return '(' + tooltipItem.xLabel + ', ' + tooltipItem.yLabel + ')';
  33473. }
  33474. }
  33475. }
  33476. };
  33477. // Register the default config for this type
  33478. Chart.defaults.scatter = defaultConfig;
  33479. // Scatter charts use line controllers
  33480. Chart.controllers.scatter = Chart.controllers.line;
  33481. Chart.Scatter = function(context, config) {
  33482. config.type = 'scatter';
  33483. return new Chart(context, config);
  33484. };
  33485. };
  33486. /***/ }),
  33487. /* 134 */
  33488. /***/ (function(module, exports, __webpack_require__) {
  33489. "use strict";
  33490. module.exports = function(Chart) {
  33491. var helpers = Chart.helpers;
  33492. Chart.defaults.bar = {
  33493. hover: {
  33494. mode: 'label'
  33495. },
  33496. scales: {
  33497. xAxes: [{
  33498. type: 'category',
  33499. // Specific to Bar Controller
  33500. categoryPercentage: 0.8,
  33501. barPercentage: 0.9,
  33502. // grid line settings
  33503. gridLines: {
  33504. offsetGridLines: true
  33505. }
  33506. }],
  33507. yAxes: [{
  33508. type: 'linear'
  33509. }]
  33510. }
  33511. };
  33512. Chart.controllers.bar = Chart.DatasetController.extend({
  33513. dataElementType: Chart.elements.Rectangle,
  33514. initialize: function(chart, datasetIndex) {
  33515. Chart.DatasetController.prototype.initialize.call(this, chart, datasetIndex);
  33516. var me = this;
  33517. var meta = me.getMeta();
  33518. var dataset = me.getDataset();
  33519. meta.stack = dataset.stack;
  33520. // Use this to indicate that this is a bar dataset.
  33521. meta.bar = true;
  33522. },
  33523. // Correctly calculate the bar width accounting for stacks and the fact that not all bars are visible
  33524. getStackCount: function() {
  33525. var me = this;
  33526. var meta = me.getMeta();
  33527. var yScale = me.getScaleForId(meta.yAxisID);
  33528. var stacks = [];
  33529. helpers.each(me.chart.data.datasets, function(dataset, datasetIndex) {
  33530. var dsMeta = me.chart.getDatasetMeta(datasetIndex);
  33531. if (dsMeta.bar && me.chart.isDatasetVisible(datasetIndex) &&
  33532. (yScale.options.stacked === false ||
  33533. (yScale.options.stacked === true && stacks.indexOf(dsMeta.stack) === -1) ||
  33534. (yScale.options.stacked === undefined && (dsMeta.stack === undefined || stacks.indexOf(dsMeta.stack) === -1)))) {
  33535. stacks.push(dsMeta.stack);
  33536. }
  33537. }, me);
  33538. return stacks.length;
  33539. },
  33540. update: function(reset) {
  33541. var me = this;
  33542. helpers.each(me.getMeta().data, function(rectangle, index) {
  33543. me.updateElement(rectangle, index, reset);
  33544. }, me);
  33545. },
  33546. updateElement: function(rectangle, index, reset) {
  33547. var me = this;
  33548. var meta = me.getMeta();
  33549. var xScale = me.getScaleForId(meta.xAxisID);
  33550. var yScale = me.getScaleForId(meta.yAxisID);
  33551. var scaleBase = yScale.getBasePixel();
  33552. var rectangleElementOptions = me.chart.options.elements.rectangle;
  33553. var custom = rectangle.custom || {};
  33554. var dataset = me.getDataset();
  33555. rectangle._xScale = xScale;
  33556. rectangle._yScale = yScale;
  33557. rectangle._datasetIndex = me.index;
  33558. rectangle._index = index;
  33559. var ruler = me.getRuler(index); // The index argument for compatible
  33560. rectangle._model = {
  33561. x: me.calculateBarX(index, me.index, ruler),
  33562. y: reset ? scaleBase : me.calculateBarY(index, me.index),
  33563. // Tooltip
  33564. label: me.chart.data.labels[index],
  33565. datasetLabel: dataset.label,
  33566. // Appearance
  33567. horizontal: false,
  33568. base: reset ? scaleBase : me.calculateBarBase(me.index, index),
  33569. width: me.calculateBarWidth(ruler),
  33570. backgroundColor: custom.backgroundColor ? custom.backgroundColor : helpers.getValueAtIndexOrDefault(dataset.backgroundColor, index, rectangleElementOptions.backgroundColor),
  33571. borderSkipped: custom.borderSkipped ? custom.borderSkipped : rectangleElementOptions.borderSkipped,
  33572. borderColor: custom.borderColor ? custom.borderColor : helpers.getValueAtIndexOrDefault(dataset.borderColor, index, rectangleElementOptions.borderColor),
  33573. borderWidth: custom.borderWidth ? custom.borderWidth : helpers.getValueAtIndexOrDefault(dataset.borderWidth, index, rectangleElementOptions.borderWidth)
  33574. };
  33575. rectangle.pivot();
  33576. },
  33577. calculateBarBase: function(datasetIndex, index) {
  33578. var me = this;
  33579. var meta = me.getMeta();
  33580. var yScale = me.getScaleForId(meta.yAxisID);
  33581. var base = yScale.getBaseValue();
  33582. var original = base;
  33583. if ((yScale.options.stacked === true) ||
  33584. (yScale.options.stacked === undefined && meta.stack !== undefined)) {
  33585. var chart = me.chart;
  33586. var datasets = chart.data.datasets;
  33587. var value = Number(datasets[datasetIndex].data[index]);
  33588. for (var i = 0; i < datasetIndex; i++) {
  33589. var currentDs = datasets[i];
  33590. var currentDsMeta = chart.getDatasetMeta(i);
  33591. if (currentDsMeta.bar && currentDsMeta.yAxisID === yScale.id && chart.isDatasetVisible(i) &&
  33592. meta.stack === currentDsMeta.stack) {
  33593. var currentVal = Number(currentDs.data[index]);
  33594. base += value < 0 ? Math.min(currentVal, original) : Math.max(currentVal, original);
  33595. }
  33596. }
  33597. return yScale.getPixelForValue(base);
  33598. }
  33599. return yScale.getBasePixel();
  33600. },
  33601. getRuler: function() {
  33602. var me = this;
  33603. var meta = me.getMeta();
  33604. var xScale = me.getScaleForId(meta.xAxisID);
  33605. var stackCount = me.getStackCount();
  33606. var tickWidth = xScale.width / xScale.ticks.length;
  33607. var categoryWidth = tickWidth * xScale.options.categoryPercentage;
  33608. var categorySpacing = (tickWidth - (tickWidth * xScale.options.categoryPercentage)) / 2;
  33609. var fullBarWidth = categoryWidth / stackCount;
  33610. var barWidth = fullBarWidth * xScale.options.barPercentage;
  33611. var barSpacing = fullBarWidth - (fullBarWidth * xScale.options.barPercentage);
  33612. return {
  33613. stackCount: stackCount,
  33614. tickWidth: tickWidth,
  33615. categoryWidth: categoryWidth,
  33616. categorySpacing: categorySpacing,
  33617. fullBarWidth: fullBarWidth,
  33618. barWidth: barWidth,
  33619. barSpacing: barSpacing
  33620. };
  33621. },
  33622. calculateBarWidth: function(ruler) {
  33623. var me = this;
  33624. var meta = me.getMeta();
  33625. var xScale = me.getScaleForId(meta.xAxisID);
  33626. if (xScale.options.barThickness) {
  33627. return xScale.options.barThickness;
  33628. }
  33629. return ruler.barWidth;
  33630. },
  33631. // Get stack index from the given dataset index accounting for stacks and the fact that not all bars are visible
  33632. getStackIndex: function(datasetIndex) {
  33633. var me = this;
  33634. var meta = me.chart.getDatasetMeta(datasetIndex);
  33635. var yScale = me.getScaleForId(meta.yAxisID);
  33636. var dsMeta, j;
  33637. var stacks = [meta.stack];
  33638. for (j = 0; j < datasetIndex; ++j) {
  33639. dsMeta = this.chart.getDatasetMeta(j);
  33640. if (dsMeta.bar && this.chart.isDatasetVisible(j) &&
  33641. (yScale.options.stacked === false ||
  33642. (yScale.options.stacked === true && stacks.indexOf(dsMeta.stack) === -1) ||
  33643. (yScale.options.stacked === undefined && (dsMeta.stack === undefined || stacks.indexOf(dsMeta.stack) === -1)))) {
  33644. stacks.push(dsMeta.stack);
  33645. }
  33646. }
  33647. return stacks.length - 1;
  33648. },
  33649. calculateBarX: function(index, datasetIndex, ruler) {
  33650. var me = this;
  33651. var meta = me.getMeta();
  33652. var xScale = me.getScaleForId(meta.xAxisID);
  33653. var stackIndex = me.getStackIndex(datasetIndex);
  33654. var leftTick = xScale.getPixelForValue(null, index, datasetIndex, me.chart.isCombo);
  33655. leftTick -= me.chart.isCombo ? (ruler.tickWidth / 2) : 0;
  33656. return leftTick +
  33657. (ruler.barWidth / 2) +
  33658. ruler.categorySpacing +
  33659. (ruler.barWidth * stackIndex) +
  33660. (ruler.barSpacing / 2) +
  33661. (ruler.barSpacing * stackIndex);
  33662. },
  33663. calculateBarY: function(index, datasetIndex) {
  33664. var me = this;
  33665. var meta = me.getMeta();
  33666. var yScale = me.getScaleForId(meta.yAxisID);
  33667. var value = Number(me.getDataset().data[index]);
  33668. if (yScale.options.stacked ||
  33669. (yScale.options.stacked === undefined && meta.stack !== undefined)) {
  33670. var base = yScale.getBaseValue();
  33671. var sumPos = base,
  33672. sumNeg = base;
  33673. for (var i = 0; i < datasetIndex; i++) {
  33674. var ds = me.chart.data.datasets[i];
  33675. var dsMeta = me.chart.getDatasetMeta(i);
  33676. if (dsMeta.bar && dsMeta.yAxisID === yScale.id && me.chart.isDatasetVisible(i) &&
  33677. meta.stack === dsMeta.stack) {
  33678. var stackedVal = Number(ds.data[index]);
  33679. if (stackedVal < 0) {
  33680. sumNeg += stackedVal || 0;
  33681. } else {
  33682. sumPos += stackedVal || 0;
  33683. }
  33684. }
  33685. }
  33686. if (value < 0) {
  33687. return yScale.getPixelForValue(sumNeg + value);
  33688. }
  33689. return yScale.getPixelForValue(sumPos + value);
  33690. }
  33691. return yScale.getPixelForValue(value);
  33692. },
  33693. draw: function(ease) {
  33694. var me = this;
  33695. var easingDecimal = ease || 1;
  33696. var metaData = me.getMeta().data;
  33697. var dataset = me.getDataset();
  33698. var i, len;
  33699. Chart.canvasHelpers.clipArea(me.chart.chart.ctx, me.chart.chartArea);
  33700. for (i = 0, len = metaData.length; i < len; ++i) {
  33701. var d = dataset.data[i];
  33702. if (d !== null && d !== undefined && !isNaN(d)) {
  33703. metaData[i].transition(easingDecimal).draw();
  33704. }
  33705. }
  33706. Chart.canvasHelpers.unclipArea(me.chart.chart.ctx);
  33707. },
  33708. setHoverStyle: function(rectangle) {
  33709. var dataset = this.chart.data.datasets[rectangle._datasetIndex];
  33710. var index = rectangle._index;
  33711. var custom = rectangle.custom || {};
  33712. var model = rectangle._model;
  33713. model.backgroundColor = custom.hoverBackgroundColor ? custom.hoverBackgroundColor : helpers.getValueAtIndexOrDefault(dataset.hoverBackgroundColor, index, helpers.getHoverColor(model.backgroundColor));
  33714. model.borderColor = custom.hoverBorderColor ? custom.hoverBorderColor : helpers.getValueAtIndexOrDefault(dataset.hoverBorderColor, index, helpers.getHoverColor(model.borderColor));
  33715. model.borderWidth = custom.hoverBorderWidth ? custom.hoverBorderWidth : helpers.getValueAtIndexOrDefault(dataset.hoverBorderWidth, index, model.borderWidth);
  33716. },
  33717. removeHoverStyle: function(rectangle) {
  33718. var dataset = this.chart.data.datasets[rectangle._datasetIndex];
  33719. var index = rectangle._index;
  33720. var custom = rectangle.custom || {};
  33721. var model = rectangle._model;
  33722. var rectangleElementOptions = this.chart.options.elements.rectangle;
  33723. model.backgroundColor = custom.backgroundColor ? custom.backgroundColor : helpers.getValueAtIndexOrDefault(dataset.backgroundColor, index, rectangleElementOptions.backgroundColor);
  33724. model.borderColor = custom.borderColor ? custom.borderColor : helpers.getValueAtIndexOrDefault(dataset.borderColor, index, rectangleElementOptions.borderColor);
  33725. model.borderWidth = custom.borderWidth ? custom.borderWidth : helpers.getValueAtIndexOrDefault(dataset.borderWidth, index, rectangleElementOptions.borderWidth);
  33726. }
  33727. });
  33728. // including horizontalBar in the bar file, instead of a file of its own
  33729. // it extends bar (like pie extends doughnut)
  33730. Chart.defaults.horizontalBar = {
  33731. hover: {
  33732. mode: 'label'
  33733. },
  33734. scales: {
  33735. xAxes: [{
  33736. type: 'linear',
  33737. position: 'bottom'
  33738. }],
  33739. yAxes: [{
  33740. position: 'left',
  33741. type: 'category',
  33742. // Specific to Horizontal Bar Controller
  33743. categoryPercentage: 0.8,
  33744. barPercentage: 0.9,
  33745. // grid line settings
  33746. gridLines: {
  33747. offsetGridLines: true
  33748. }
  33749. }]
  33750. },
  33751. elements: {
  33752. rectangle: {
  33753. borderSkipped: 'left'
  33754. }
  33755. },
  33756. tooltips: {
  33757. callbacks: {
  33758. title: function(tooltipItems, data) {
  33759. // Pick first xLabel for now
  33760. var title = '';
  33761. if (tooltipItems.length > 0) {
  33762. if (tooltipItems[0].yLabel) {
  33763. title = tooltipItems[0].yLabel;
  33764. } else if (data.labels.length > 0 && tooltipItems[0].index < data.labels.length) {
  33765. title = data.labels[tooltipItems[0].index];
  33766. }
  33767. }
  33768. return title;
  33769. },
  33770. label: function(tooltipItem, data) {
  33771. var datasetLabel = data.datasets[tooltipItem.datasetIndex].label || '';
  33772. return datasetLabel + ': ' + tooltipItem.xLabel;
  33773. }
  33774. }
  33775. }
  33776. };
  33777. Chart.controllers.horizontalBar = Chart.controllers.bar.extend({
  33778. // Correctly calculate the bar width accounting for stacks and the fact that not all bars are visible
  33779. getStackCount: function() {
  33780. var me = this;
  33781. var meta = me.getMeta();
  33782. var xScale = me.getScaleForId(meta.xAxisID);
  33783. var stacks = [];
  33784. helpers.each(me.chart.data.datasets, function(dataset, datasetIndex) {
  33785. var dsMeta = me.chart.getDatasetMeta(datasetIndex);
  33786. if (dsMeta.bar && me.chart.isDatasetVisible(datasetIndex) &&
  33787. (xScale.options.stacked === false ||
  33788. (xScale.options.stacked === true && stacks.indexOf(dsMeta.stack) === -1) ||
  33789. (xScale.options.stacked === undefined && (dsMeta.stack === undefined || stacks.indexOf(dsMeta.stack) === -1)))) {
  33790. stacks.push(dsMeta.stack);
  33791. }
  33792. }, me);
  33793. return stacks.length;
  33794. },
  33795. updateElement: function(rectangle, index, reset) {
  33796. var me = this;
  33797. var meta = me.getMeta();
  33798. var xScale = me.getScaleForId(meta.xAxisID);
  33799. var yScale = me.getScaleForId(meta.yAxisID);
  33800. var scaleBase = xScale.getBasePixel();
  33801. var custom = rectangle.custom || {};
  33802. var dataset = me.getDataset();
  33803. var rectangleElementOptions = me.chart.options.elements.rectangle;
  33804. rectangle._xScale = xScale;
  33805. rectangle._yScale = yScale;
  33806. rectangle._datasetIndex = me.index;
  33807. rectangle._index = index;
  33808. var ruler = me.getRuler(index); // The index argument for compatible
  33809. rectangle._model = {
  33810. x: reset ? scaleBase : me.calculateBarX(index, me.index),
  33811. y: me.calculateBarY(index, me.index, ruler),
  33812. // Tooltip
  33813. label: me.chart.data.labels[index],
  33814. datasetLabel: dataset.label,
  33815. // Appearance
  33816. horizontal: true,
  33817. base: reset ? scaleBase : me.calculateBarBase(me.index, index),
  33818. height: me.calculateBarHeight(ruler),
  33819. backgroundColor: custom.backgroundColor ? custom.backgroundColor : helpers.getValueAtIndexOrDefault(dataset.backgroundColor, index, rectangleElementOptions.backgroundColor),
  33820. borderSkipped: custom.borderSkipped ? custom.borderSkipped : rectangleElementOptions.borderSkipped,
  33821. borderColor: custom.borderColor ? custom.borderColor : helpers.getValueAtIndexOrDefault(dataset.borderColor, index, rectangleElementOptions.borderColor),
  33822. borderWidth: custom.borderWidth ? custom.borderWidth : helpers.getValueAtIndexOrDefault(dataset.borderWidth, index, rectangleElementOptions.borderWidth)
  33823. };
  33824. rectangle.pivot();
  33825. },
  33826. calculateBarBase: function(datasetIndex, index) {
  33827. var me = this;
  33828. var meta = me.getMeta();
  33829. var xScale = me.getScaleForId(meta.xAxisID);
  33830. var base = xScale.getBaseValue();
  33831. var originalBase = base;
  33832. if (xScale.options.stacked ||
  33833. (xScale.options.stacked === undefined && meta.stack !== undefined)) {
  33834. var chart = me.chart;
  33835. var datasets = chart.data.datasets;
  33836. var value = Number(datasets[datasetIndex].data[index]);
  33837. for (var i = 0; i < datasetIndex; i++) {
  33838. var currentDs = datasets[i];
  33839. var currentDsMeta = chart.getDatasetMeta(i);
  33840. if (currentDsMeta.bar && currentDsMeta.xAxisID === xScale.id && chart.isDatasetVisible(i) &&
  33841. meta.stack === currentDsMeta.stack) {
  33842. var currentVal = Number(currentDs.data[index]);
  33843. base += value < 0 ? Math.min(currentVal, originalBase) : Math.max(currentVal, originalBase);
  33844. }
  33845. }
  33846. return xScale.getPixelForValue(base);
  33847. }
  33848. return xScale.getBasePixel();
  33849. },
  33850. getRuler: function() {
  33851. var me = this;
  33852. var meta = me.getMeta();
  33853. var yScale = me.getScaleForId(meta.yAxisID);
  33854. var stackCount = me.getStackCount();
  33855. var tickHeight = yScale.height / yScale.ticks.length;
  33856. var categoryHeight = tickHeight * yScale.options.categoryPercentage;
  33857. var categorySpacing = (tickHeight - (tickHeight * yScale.options.categoryPercentage)) / 2;
  33858. var fullBarHeight = categoryHeight / stackCount;
  33859. var barHeight = fullBarHeight * yScale.options.barPercentage;
  33860. var barSpacing = fullBarHeight - (fullBarHeight * yScale.options.barPercentage);
  33861. return {
  33862. stackCount: stackCount,
  33863. tickHeight: tickHeight,
  33864. categoryHeight: categoryHeight,
  33865. categorySpacing: categorySpacing,
  33866. fullBarHeight: fullBarHeight,
  33867. barHeight: barHeight,
  33868. barSpacing: barSpacing
  33869. };
  33870. },
  33871. calculateBarHeight: function(ruler) {
  33872. var me = this;
  33873. var meta = me.getMeta();
  33874. var yScale = me.getScaleForId(meta.yAxisID);
  33875. if (yScale.options.barThickness) {
  33876. return yScale.options.barThickness;
  33877. }
  33878. return ruler.barHeight;
  33879. },
  33880. // Get stack index from the given dataset index accounting for stacks and the fact that not all bars are visible
  33881. getStackIndex: function(datasetIndex) {
  33882. var me = this;
  33883. var meta = me.chart.getDatasetMeta(datasetIndex);
  33884. var xScale = me.getScaleForId(meta.xAxisID);
  33885. var dsMeta, j;
  33886. var stacks = [meta.stack];
  33887. for (j = 0; j < datasetIndex; ++j) {
  33888. dsMeta = this.chart.getDatasetMeta(j);
  33889. if (dsMeta.bar && this.chart.isDatasetVisible(j) &&
  33890. (xScale.options.stacked === false ||
  33891. (xScale.options.stacked === true && stacks.indexOf(dsMeta.stack) === -1) ||
  33892. (xScale.options.stacked === undefined && (dsMeta.stack === undefined || stacks.indexOf(dsMeta.stack) === -1)))) {
  33893. stacks.push(dsMeta.stack);
  33894. }
  33895. }
  33896. return stacks.length - 1;
  33897. },
  33898. calculateBarX: function(index, datasetIndex) {
  33899. var me = this;
  33900. var meta = me.getMeta();
  33901. var xScale = me.getScaleForId(meta.xAxisID);
  33902. var value = Number(me.getDataset().data[index]);
  33903. if (xScale.options.stacked ||
  33904. (xScale.options.stacked === undefined && meta.stack !== undefined)) {
  33905. var base = xScale.getBaseValue();
  33906. var sumPos = base,
  33907. sumNeg = base;
  33908. for (var i = 0; i < datasetIndex; i++) {
  33909. var ds = me.chart.data.datasets[i];
  33910. var dsMeta = me.chart.getDatasetMeta(i);
  33911. if (dsMeta.bar && dsMeta.xAxisID === xScale.id && me.chart.isDatasetVisible(i) &&
  33912. meta.stack === dsMeta.stack) {
  33913. var stackedVal = Number(ds.data[index]);
  33914. if (stackedVal < 0) {
  33915. sumNeg += stackedVal || 0;
  33916. } else {
  33917. sumPos += stackedVal || 0;
  33918. }
  33919. }
  33920. }
  33921. if (value < 0) {
  33922. return xScale.getPixelForValue(sumNeg + value);
  33923. }
  33924. return xScale.getPixelForValue(sumPos + value);
  33925. }
  33926. return xScale.getPixelForValue(value);
  33927. },
  33928. calculateBarY: function(index, datasetIndex, ruler) {
  33929. var me = this;
  33930. var meta = me.getMeta();
  33931. var yScale = me.getScaleForId(meta.yAxisID);
  33932. var stackIndex = me.getStackIndex(datasetIndex);
  33933. var topTick = yScale.getPixelForValue(null, index, datasetIndex, me.chart.isCombo);
  33934. topTick -= me.chart.isCombo ? (ruler.tickHeight / 2) : 0;
  33935. return topTick +
  33936. (ruler.barHeight / 2) +
  33937. ruler.categorySpacing +
  33938. (ruler.barHeight * stackIndex) +
  33939. (ruler.barSpacing / 2) +
  33940. (ruler.barSpacing * stackIndex);
  33941. }
  33942. });
  33943. };
  33944. /***/ }),
  33945. /* 135 */
  33946. /***/ (function(module, exports, __webpack_require__) {
  33947. "use strict";
  33948. module.exports = function(Chart) {
  33949. var helpers = Chart.helpers;
  33950. Chart.defaults.bubble = {
  33951. hover: {
  33952. mode: 'single'
  33953. },
  33954. scales: {
  33955. xAxes: [{
  33956. type: 'linear', // bubble should probably use a linear scale by default
  33957. position: 'bottom',
  33958. id: 'x-axis-0' // need an ID so datasets can reference the scale
  33959. }],
  33960. yAxes: [{
  33961. type: 'linear',
  33962. position: 'left',
  33963. id: 'y-axis-0'
  33964. }]
  33965. },
  33966. tooltips: {
  33967. callbacks: {
  33968. title: function() {
  33969. // Title doesn't make sense for scatter since we format the data as a point
  33970. return '';
  33971. },
  33972. label: function(tooltipItem, data) {
  33973. var datasetLabel = data.datasets[tooltipItem.datasetIndex].label || '';
  33974. var dataPoint = data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];
  33975. return datasetLabel + ': (' + tooltipItem.xLabel + ', ' + tooltipItem.yLabel + ', ' + dataPoint.r + ')';
  33976. }
  33977. }
  33978. }
  33979. };
  33980. Chart.controllers.bubble = Chart.DatasetController.extend({
  33981. dataElementType: Chart.elements.Point,
  33982. update: function(reset) {
  33983. var me = this;
  33984. var meta = me.getMeta();
  33985. var points = meta.data;
  33986. // Update Points
  33987. helpers.each(points, function(point, index) {
  33988. me.updateElement(point, index, reset);
  33989. });
  33990. },
  33991. updateElement: function(point, index, reset) {
  33992. var me = this;
  33993. var meta = me.getMeta();
  33994. var xScale = me.getScaleForId(meta.xAxisID);
  33995. var yScale = me.getScaleForId(meta.yAxisID);
  33996. var custom = point.custom || {};
  33997. var dataset = me.getDataset();
  33998. var data = dataset.data[index];
  33999. var pointElementOptions = me.chart.options.elements.point;
  34000. var dsIndex = me.index;
  34001. helpers.extend(point, {
  34002. // Utility
  34003. _xScale: xScale,
  34004. _yScale: yScale,
  34005. _datasetIndex: dsIndex,
  34006. _index: index,
  34007. // Desired view properties
  34008. _model: {
  34009. x: reset ? xScale.getPixelForDecimal(0.5) : xScale.getPixelForValue(typeof data === 'object' ? data : NaN, index, dsIndex, me.chart.isCombo),
  34010. y: reset ? yScale.getBasePixel() : yScale.getPixelForValue(data, index, dsIndex),
  34011. // Appearance
  34012. radius: reset ? 0 : custom.radius ? custom.radius : me.getRadius(data),
  34013. // Tooltip
  34014. hitRadius: custom.hitRadius ? custom.hitRadius : helpers.getValueAtIndexOrDefault(dataset.hitRadius, index, pointElementOptions.hitRadius)
  34015. }
  34016. });
  34017. // Trick to reset the styles of the point
  34018. Chart.DatasetController.prototype.removeHoverStyle.call(me, point, pointElementOptions);
  34019. var model = point._model;
  34020. model.skip = custom.skip ? custom.skip : (isNaN(model.x) || isNaN(model.y));
  34021. point.pivot();
  34022. },
  34023. getRadius: function(value) {
  34024. return value.r || this.chart.options.elements.point.radius;
  34025. },
  34026. setHoverStyle: function(point) {
  34027. var me = this;
  34028. Chart.DatasetController.prototype.setHoverStyle.call(me, point);
  34029. // Radius
  34030. var dataset = me.chart.data.datasets[point._datasetIndex];
  34031. var index = point._index;
  34032. var custom = point.custom || {};
  34033. var model = point._model;
  34034. model.radius = custom.hoverRadius ? custom.hoverRadius : (helpers.getValueAtIndexOrDefault(dataset.hoverRadius, index, me.chart.options.elements.point.hoverRadius)) + me.getRadius(dataset.data[index]);
  34035. },
  34036. removeHoverStyle: function(point) {
  34037. var me = this;
  34038. Chart.DatasetController.prototype.removeHoverStyle.call(me, point, me.chart.options.elements.point);
  34039. var dataVal = me.chart.data.datasets[point._datasetIndex].data[point._index];
  34040. var custom = point.custom || {};
  34041. var model = point._model;
  34042. model.radius = custom.radius ? custom.radius : me.getRadius(dataVal);
  34043. }
  34044. });
  34045. };
  34046. /***/ }),
  34047. /* 136 */
  34048. /***/ (function(module, exports, __webpack_require__) {
  34049. "use strict";
  34050. module.exports = function(Chart) {
  34051. var helpers = Chart.helpers,
  34052. defaults = Chart.defaults;
  34053. defaults.doughnut = {
  34054. animation: {
  34055. // Boolean - Whether we animate the rotation of the Doughnut
  34056. animateRotate: true,
  34057. // Boolean - Whether we animate scaling the Doughnut from the centre
  34058. animateScale: false
  34059. },
  34060. aspectRatio: 1,
  34061. hover: {
  34062. mode: 'single'
  34063. },
  34064. legendCallback: function(chart) {
  34065. var text = [];
  34066. text.push('<ul class="' + chart.id + '-legend">');
  34067. var data = chart.data;
  34068. var datasets = data.datasets;
  34069. var labels = data.labels;
  34070. if (datasets.length) {
  34071. for (var i = 0; i < datasets[0].data.length; ++i) {
  34072. text.push('<li><span style="background-color:' + datasets[0].backgroundColor[i] + '"></span>');
  34073. if (labels[i]) {
  34074. text.push(labels[i]);
  34075. }
  34076. text.push('</li>');
  34077. }
  34078. }
  34079. text.push('</ul>');
  34080. return text.join('');
  34081. },
  34082. legend: {
  34083. labels: {
  34084. generateLabels: function(chart) {
  34085. var data = chart.data;
  34086. if (data.labels.length && data.datasets.length) {
  34087. return data.labels.map(function(label, i) {
  34088. var meta = chart.getDatasetMeta(0);
  34089. var ds = data.datasets[0];
  34090. var arc = meta.data[i];
  34091. var custom = arc && arc.custom || {};
  34092. var getValueAtIndexOrDefault = helpers.getValueAtIndexOrDefault;
  34093. var arcOpts = chart.options.elements.arc;
  34094. var fill = custom.backgroundColor ? custom.backgroundColor : getValueAtIndexOrDefault(ds.backgroundColor, i, arcOpts.backgroundColor);
  34095. var stroke = custom.borderColor ? custom.borderColor : getValueAtIndexOrDefault(ds.borderColor, i, arcOpts.borderColor);
  34096. var bw = custom.borderWidth ? custom.borderWidth : getValueAtIndexOrDefault(ds.borderWidth, i, arcOpts.borderWidth);
  34097. return {
  34098. text: label,
  34099. fillStyle: fill,
  34100. strokeStyle: stroke,
  34101. lineWidth: bw,
  34102. hidden: isNaN(ds.data[i]) || meta.data[i].hidden,
  34103. // Extra data used for toggling the correct item
  34104. index: i
  34105. };
  34106. });
  34107. }
  34108. return [];
  34109. }
  34110. },
  34111. onClick: function(e, legendItem) {
  34112. var index = legendItem.index;
  34113. var chart = this.chart;
  34114. var i, ilen, meta;
  34115. for (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {
  34116. meta = chart.getDatasetMeta(i);
  34117. // toggle visibility of index if exists
  34118. if (meta.data[index]) {
  34119. meta.data[index].hidden = !meta.data[index].hidden;
  34120. }
  34121. }
  34122. chart.update();
  34123. }
  34124. },
  34125. // The percentage of the chart that we cut out of the middle.
  34126. cutoutPercentage: 50,
  34127. // The rotation of the chart, where the first data arc begins.
  34128. rotation: Math.PI * -0.5,
  34129. // The total circumference of the chart.
  34130. circumference: Math.PI * 2.0,
  34131. // Need to override these to give a nice default
  34132. tooltips: {
  34133. callbacks: {
  34134. title: function() {
  34135. return '';
  34136. },
  34137. label: function(tooltipItem, data) {
  34138. var dataLabel = data.labels[tooltipItem.index];
  34139. var value = ': ' + data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];
  34140. if (helpers.isArray(dataLabel)) {
  34141. // show value on first line of multiline label
  34142. // need to clone because we are changing the value
  34143. dataLabel = dataLabel.slice();
  34144. dataLabel[0] += value;
  34145. } else {
  34146. dataLabel += value;
  34147. }
  34148. return dataLabel;
  34149. }
  34150. }
  34151. }
  34152. };
  34153. defaults.pie = helpers.clone(defaults.doughnut);
  34154. helpers.extend(defaults.pie, {
  34155. cutoutPercentage: 0
  34156. });
  34157. Chart.controllers.doughnut = Chart.controllers.pie = Chart.DatasetController.extend({
  34158. dataElementType: Chart.elements.Arc,
  34159. linkScales: helpers.noop,
  34160. // Get index of the dataset in relation to the visible datasets. This allows determining the inner and outer radius correctly
  34161. getRingIndex: function(datasetIndex) {
  34162. var ringIndex = 0;
  34163. for (var j = 0; j < datasetIndex; ++j) {
  34164. if (this.chart.isDatasetVisible(j)) {
  34165. ++ringIndex;
  34166. }
  34167. }
  34168. return ringIndex;
  34169. },
  34170. update: function(reset) {
  34171. var me = this;
  34172. var chart = me.chart,
  34173. chartArea = chart.chartArea,
  34174. opts = chart.options,
  34175. arcOpts = opts.elements.arc,
  34176. availableWidth = chartArea.right - chartArea.left - arcOpts.borderWidth,
  34177. availableHeight = chartArea.bottom - chartArea.top - arcOpts.borderWidth,
  34178. minSize = Math.min(availableWidth, availableHeight),
  34179. offset = {
  34180. x: 0,
  34181. y: 0
  34182. },
  34183. meta = me.getMeta(),
  34184. cutoutPercentage = opts.cutoutPercentage,
  34185. circumference = opts.circumference;
  34186. // If the chart's circumference isn't a full circle, calculate minSize as a ratio of the width/height of the arc
  34187. if (circumference < Math.PI * 2.0) {
  34188. var startAngle = opts.rotation % (Math.PI * 2.0);
  34189. startAngle += Math.PI * 2.0 * (startAngle >= Math.PI ? -1 : startAngle < -Math.PI ? 1 : 0);
  34190. var endAngle = startAngle + circumference;
  34191. var start = {x: Math.cos(startAngle), y: Math.sin(startAngle)};
  34192. var end = {x: Math.cos(endAngle), y: Math.sin(endAngle)};
  34193. var contains0 = (startAngle <= 0 && 0 <= endAngle) || (startAngle <= Math.PI * 2.0 && Math.PI * 2.0 <= endAngle);
  34194. var contains90 = (startAngle <= Math.PI * 0.5 && Math.PI * 0.5 <= endAngle) || (startAngle <= Math.PI * 2.5 && Math.PI * 2.5 <= endAngle);
  34195. var contains180 = (startAngle <= -Math.PI && -Math.PI <= endAngle) || (startAngle <= Math.PI && Math.PI <= endAngle);
  34196. var contains270 = (startAngle <= -Math.PI * 0.5 && -Math.PI * 0.5 <= endAngle) || (startAngle <= Math.PI * 1.5 && Math.PI * 1.5 <= endAngle);
  34197. var cutout = cutoutPercentage / 100.0;
  34198. var min = {x: contains180 ? -1 : Math.min(start.x * (start.x < 0 ? 1 : cutout), end.x * (end.x < 0 ? 1 : cutout)), y: contains270 ? -1 : Math.min(start.y * (start.y < 0 ? 1 : cutout), end.y * (end.y < 0 ? 1 : cutout))};
  34199. var max = {x: contains0 ? 1 : Math.max(start.x * (start.x > 0 ? 1 : cutout), end.x * (end.x > 0 ? 1 : cutout)), y: contains90 ? 1 : Math.max(start.y * (start.y > 0 ? 1 : cutout), end.y * (end.y > 0 ? 1 : cutout))};
  34200. var size = {width: (max.x - min.x) * 0.5, height: (max.y - min.y) * 0.5};
  34201. minSize = Math.min(availableWidth / size.width, availableHeight / size.height);
  34202. offset = {x: (max.x + min.x) * -0.5, y: (max.y + min.y) * -0.5};
  34203. }
  34204. chart.borderWidth = me.getMaxBorderWidth(meta.data);
  34205. chart.outerRadius = Math.max((minSize - chart.borderWidth) / 2, 0);
  34206. chart.innerRadius = Math.max(cutoutPercentage ? (chart.outerRadius / 100) * (cutoutPercentage) : 0, 0);
  34207. chart.radiusLength = (chart.outerRadius - chart.innerRadius) / chart.getVisibleDatasetCount();
  34208. chart.offsetX = offset.x * chart.outerRadius;
  34209. chart.offsetY = offset.y * chart.outerRadius;
  34210. meta.total = me.calculateTotal();
  34211. me.outerRadius = chart.outerRadius - (chart.radiusLength * me.getRingIndex(me.index));
  34212. me.innerRadius = Math.max(me.outerRadius - chart.radiusLength, 0);
  34213. helpers.each(meta.data, function(arc, index) {
  34214. me.updateElement(arc, index, reset);
  34215. });
  34216. },
  34217. updateElement: function(arc, index, reset) {
  34218. var me = this;
  34219. var chart = me.chart,
  34220. chartArea = chart.chartArea,
  34221. opts = chart.options,
  34222. animationOpts = opts.animation,
  34223. centerX = (chartArea.left + chartArea.right) / 2,
  34224. centerY = (chartArea.top + chartArea.bottom) / 2,
  34225. startAngle = opts.rotation, // non reset case handled later
  34226. endAngle = opts.rotation, // non reset case handled later
  34227. dataset = me.getDataset(),
  34228. circumference = reset && animationOpts.animateRotate ? 0 : arc.hidden ? 0 : me.calculateCircumference(dataset.data[index]) * (opts.circumference / (2.0 * Math.PI)),
  34229. innerRadius = reset && animationOpts.animateScale ? 0 : me.innerRadius,
  34230. outerRadius = reset && animationOpts.animateScale ? 0 : me.outerRadius,
  34231. valueAtIndexOrDefault = helpers.getValueAtIndexOrDefault;
  34232. helpers.extend(arc, {
  34233. // Utility
  34234. _datasetIndex: me.index,
  34235. _index: index,
  34236. // Desired view properties
  34237. _model: {
  34238. x: centerX + chart.offsetX,
  34239. y: centerY + chart.offsetY,
  34240. startAngle: startAngle,
  34241. endAngle: endAngle,
  34242. circumference: circumference,
  34243. outerRadius: outerRadius,
  34244. innerRadius: innerRadius,
  34245. label: valueAtIndexOrDefault(dataset.label, index, chart.data.labels[index])
  34246. }
  34247. });
  34248. var model = arc._model;
  34249. // Resets the visual styles
  34250. this.removeHoverStyle(arc);
  34251. // Set correct angles if not resetting
  34252. if (!reset || !animationOpts.animateRotate) {
  34253. if (index === 0) {
  34254. model.startAngle = opts.rotation;
  34255. } else {
  34256. model.startAngle = me.getMeta().data[index - 1]._model.endAngle;
  34257. }
  34258. model.endAngle = model.startAngle + model.circumference;
  34259. }
  34260. arc.pivot();
  34261. },
  34262. removeHoverStyle: function(arc) {
  34263. Chart.DatasetController.prototype.removeHoverStyle.call(this, arc, this.chart.options.elements.arc);
  34264. },
  34265. calculateTotal: function() {
  34266. var dataset = this.getDataset();
  34267. var meta = this.getMeta();
  34268. var total = 0;
  34269. var value;
  34270. helpers.each(meta.data, function(element, index) {
  34271. value = dataset.data[index];
  34272. if (!isNaN(value) && !element.hidden) {
  34273. total += Math.abs(value);
  34274. }
  34275. });
  34276. /* if (total === 0) {
  34277. total = NaN;
  34278. }*/
  34279. return total;
  34280. },
  34281. calculateCircumference: function(value) {
  34282. var total = this.getMeta().total;
  34283. if (total > 0 && !isNaN(value)) {
  34284. return (Math.PI * 2.0) * (value / total);
  34285. }
  34286. return 0;
  34287. },
  34288. // gets the max border or hover width to properly scale pie charts
  34289. getMaxBorderWidth: function(elements) {
  34290. var max = 0,
  34291. index = this.index,
  34292. length = elements.length,
  34293. borderWidth,
  34294. hoverWidth;
  34295. for (var i = 0; i < length; i++) {
  34296. borderWidth = elements[i]._model ? elements[i]._model.borderWidth : 0;
  34297. hoverWidth = elements[i]._chart ? elements[i]._chart.config.data.datasets[index].hoverBorderWidth : 0;
  34298. max = borderWidth > max ? borderWidth : max;
  34299. max = hoverWidth > max ? hoverWidth : max;
  34300. }
  34301. return max;
  34302. }
  34303. });
  34304. };
  34305. /***/ }),
  34306. /* 137 */
  34307. /***/ (function(module, exports, __webpack_require__) {
  34308. "use strict";
  34309. module.exports = function(Chart) {
  34310. var helpers = Chart.helpers;
  34311. Chart.defaults.line = {
  34312. showLines: true,
  34313. spanGaps: false,
  34314. hover: {
  34315. mode: 'label'
  34316. },
  34317. scales: {
  34318. xAxes: [{
  34319. type: 'category',
  34320. id: 'x-axis-0'
  34321. }],
  34322. yAxes: [{
  34323. type: 'linear',
  34324. id: 'y-axis-0'
  34325. }]
  34326. }
  34327. };
  34328. function lineEnabled(dataset, options) {
  34329. return helpers.getValueOrDefault(dataset.showLine, options.showLines);
  34330. }
  34331. Chart.controllers.line = Chart.DatasetController.extend({
  34332. datasetElementType: Chart.elements.Line,
  34333. dataElementType: Chart.elements.Point,
  34334. update: function(reset) {
  34335. var me = this;
  34336. var meta = me.getMeta();
  34337. var line = meta.dataset;
  34338. var points = meta.data || [];
  34339. var options = me.chart.options;
  34340. var lineElementOptions = options.elements.line;
  34341. var scale = me.getScaleForId(meta.yAxisID);
  34342. var i, ilen, custom;
  34343. var dataset = me.getDataset();
  34344. var showLine = lineEnabled(dataset, options);
  34345. // Update Line
  34346. if (showLine) {
  34347. custom = line.custom || {};
  34348. // Compatibility: If the properties are defined with only the old name, use those values
  34349. if ((dataset.tension !== undefined) && (dataset.lineTension === undefined)) {
  34350. dataset.lineTension = dataset.tension;
  34351. }
  34352. // Utility
  34353. line._scale = scale;
  34354. line._datasetIndex = me.index;
  34355. // Data
  34356. line._children = points;
  34357. // Model
  34358. line._model = {
  34359. // Appearance
  34360. // The default behavior of lines is to break at null values, according
  34361. // to https://github.com/chartjs/Chart.js/issues/2435#issuecomment-216718158
  34362. // This option gives lines the ability to span gaps
  34363. spanGaps: dataset.spanGaps ? dataset.spanGaps : options.spanGaps,
  34364. tension: custom.tension ? custom.tension : helpers.getValueOrDefault(dataset.lineTension, lineElementOptions.tension),
  34365. backgroundColor: custom.backgroundColor ? custom.backgroundColor : (dataset.backgroundColor || lineElementOptions.backgroundColor),
  34366. borderWidth: custom.borderWidth ? custom.borderWidth : (dataset.borderWidth || lineElementOptions.borderWidth),
  34367. borderColor: custom.borderColor ? custom.borderColor : (dataset.borderColor || lineElementOptions.borderColor),
  34368. borderCapStyle: custom.borderCapStyle ? custom.borderCapStyle : (dataset.borderCapStyle || lineElementOptions.borderCapStyle),
  34369. borderDash: custom.borderDash ? custom.borderDash : (dataset.borderDash || lineElementOptions.borderDash),
  34370. borderDashOffset: custom.borderDashOffset ? custom.borderDashOffset : (dataset.borderDashOffset || lineElementOptions.borderDashOffset),
  34371. borderJoinStyle: custom.borderJoinStyle ? custom.borderJoinStyle : (dataset.borderJoinStyle || lineElementOptions.borderJoinStyle),
  34372. fill: custom.fill ? custom.fill : (dataset.fill !== undefined ? dataset.fill : lineElementOptions.fill),
  34373. steppedLine: custom.steppedLine ? custom.steppedLine : helpers.getValueOrDefault(dataset.steppedLine, lineElementOptions.stepped),
  34374. cubicInterpolationMode: custom.cubicInterpolationMode ? custom.cubicInterpolationMode : helpers.getValueOrDefault(dataset.cubicInterpolationMode, lineElementOptions.cubicInterpolationMode),
  34375. // Scale
  34376. scaleTop: scale.top,
  34377. scaleBottom: scale.bottom,
  34378. scaleZero: scale.getBasePixel()
  34379. };
  34380. line.pivot();
  34381. }
  34382. // Update Points
  34383. for (i=0, ilen=points.length; i<ilen; ++i) {
  34384. me.updateElement(points[i], i, reset);
  34385. }
  34386. if (showLine && line._model.tension !== 0) {
  34387. me.updateBezierControlPoints();
  34388. }
  34389. // Now pivot the point for animation
  34390. for (i=0, ilen=points.length; i<ilen; ++i) {
  34391. points[i].pivot();
  34392. }
  34393. },
  34394. getPointBackgroundColor: function(point, index) {
  34395. var backgroundColor = this.chart.options.elements.point.backgroundColor;
  34396. var dataset = this.getDataset();
  34397. var custom = point.custom || {};
  34398. if (custom.backgroundColor) {
  34399. backgroundColor = custom.backgroundColor;
  34400. } else if (dataset.pointBackgroundColor) {
  34401. backgroundColor = helpers.getValueAtIndexOrDefault(dataset.pointBackgroundColor, index, backgroundColor);
  34402. } else if (dataset.backgroundColor) {
  34403. backgroundColor = dataset.backgroundColor;
  34404. }
  34405. return backgroundColor;
  34406. },
  34407. getPointBorderColor: function(point, index) {
  34408. var borderColor = this.chart.options.elements.point.borderColor;
  34409. var dataset = this.getDataset();
  34410. var custom = point.custom || {};
  34411. if (custom.borderColor) {
  34412. borderColor = custom.borderColor;
  34413. } else if (dataset.pointBorderColor) {
  34414. borderColor = helpers.getValueAtIndexOrDefault(dataset.pointBorderColor, index, borderColor);
  34415. } else if (dataset.borderColor) {
  34416. borderColor = dataset.borderColor;
  34417. }
  34418. return borderColor;
  34419. },
  34420. getPointBorderWidth: function(point, index) {
  34421. var borderWidth = this.chart.options.elements.point.borderWidth;
  34422. var dataset = this.getDataset();
  34423. var custom = point.custom || {};
  34424. if (!isNaN(custom.borderWidth)) {
  34425. borderWidth = custom.borderWidth;
  34426. } else if (!isNaN(dataset.pointBorderWidth)) {
  34427. borderWidth = helpers.getValueAtIndexOrDefault(dataset.pointBorderWidth, index, borderWidth);
  34428. } else if (!isNaN(dataset.borderWidth)) {
  34429. borderWidth = dataset.borderWidth;
  34430. }
  34431. return borderWidth;
  34432. },
  34433. updateElement: function(point, index, reset) {
  34434. var me = this;
  34435. var meta = me.getMeta();
  34436. var custom = point.custom || {};
  34437. var dataset = me.getDataset();
  34438. var datasetIndex = me.index;
  34439. var value = dataset.data[index];
  34440. var yScale = me.getScaleForId(meta.yAxisID);
  34441. var xScale = me.getScaleForId(meta.xAxisID);
  34442. var pointOptions = me.chart.options.elements.point;
  34443. var x, y;
  34444. var labels = me.chart.data.labels || [];
  34445. var includeOffset = (labels.length === 1 || dataset.data.length === 1) || me.chart.isCombo;
  34446. // Compatibility: If the properties are defined with only the old name, use those values
  34447. if ((dataset.radius !== undefined) && (dataset.pointRadius === undefined)) {
  34448. dataset.pointRadius = dataset.radius;
  34449. }
  34450. if ((dataset.hitRadius !== undefined) && (dataset.pointHitRadius === undefined)) {
  34451. dataset.pointHitRadius = dataset.hitRadius;
  34452. }
  34453. x = xScale.getPixelForValue(typeof value === 'object' ? value : NaN, index, datasetIndex, includeOffset);
  34454. y = reset ? yScale.getBasePixel() : me.calculatePointY(value, index, datasetIndex);
  34455. // Utility
  34456. point._xScale = xScale;
  34457. point._yScale = yScale;
  34458. point._datasetIndex = datasetIndex;
  34459. point._index = index;
  34460. // Desired view properties
  34461. point._model = {
  34462. x: x,
  34463. y: y,
  34464. skip: custom.skip || isNaN(x) || isNaN(y),
  34465. // Appearance
  34466. radius: custom.radius || helpers.getValueAtIndexOrDefault(dataset.pointRadius, index, pointOptions.radius),
  34467. pointStyle: custom.pointStyle || helpers.getValueAtIndexOrDefault(dataset.pointStyle, index, pointOptions.pointStyle),
  34468. backgroundColor: me.getPointBackgroundColor(point, index),
  34469. borderColor: me.getPointBorderColor(point, index),
  34470. borderWidth: me.getPointBorderWidth(point, index),
  34471. tension: meta.dataset._model ? meta.dataset._model.tension : 0,
  34472. steppedLine: meta.dataset._model ? meta.dataset._model.steppedLine : false,
  34473. // Tooltip
  34474. hitRadius: custom.hitRadius || helpers.getValueAtIndexOrDefault(dataset.pointHitRadius, index, pointOptions.hitRadius)
  34475. };
  34476. },
  34477. calculatePointY: function(value, index, datasetIndex) {
  34478. var me = this;
  34479. var chart = me.chart;
  34480. var meta = me.getMeta();
  34481. var yScale = me.getScaleForId(meta.yAxisID);
  34482. var sumPos = 0;
  34483. var sumNeg = 0;
  34484. var i, ds, dsMeta;
  34485. if (yScale.options.stacked) {
  34486. for (i = 0; i < datasetIndex; i++) {
  34487. ds = chart.data.datasets[i];
  34488. dsMeta = chart.getDatasetMeta(i);
  34489. if (dsMeta.type === 'line' && dsMeta.yAxisID === yScale.id && chart.isDatasetVisible(i)) {
  34490. var stackedRightValue = Number(yScale.getRightValue(ds.data[index]));
  34491. if (stackedRightValue < 0) {
  34492. sumNeg += stackedRightValue || 0;
  34493. } else {
  34494. sumPos += stackedRightValue || 0;
  34495. }
  34496. }
  34497. }
  34498. var rightValue = Number(yScale.getRightValue(value));
  34499. if (rightValue < 0) {
  34500. return yScale.getPixelForValue(sumNeg + rightValue);
  34501. }
  34502. return yScale.getPixelForValue(sumPos + rightValue);
  34503. }
  34504. return yScale.getPixelForValue(value);
  34505. },
  34506. updateBezierControlPoints: function() {
  34507. var me = this;
  34508. var meta = me.getMeta();
  34509. var area = me.chart.chartArea;
  34510. var points = (meta.data || []);
  34511. var i, ilen, point, model, controlPoints;
  34512. // Only consider points that are drawn in case the spanGaps option is used
  34513. if (meta.dataset._model.spanGaps) {
  34514. points = points.filter(function(pt) {
  34515. return !pt._model.skip;
  34516. });
  34517. }
  34518. function capControlPoint(pt, min, max) {
  34519. return Math.max(Math.min(pt, max), min);
  34520. }
  34521. if (meta.dataset._model.cubicInterpolationMode === 'monotone') {
  34522. helpers.splineCurveMonotone(points);
  34523. } else {
  34524. for (i = 0, ilen = points.length; i < ilen; ++i) {
  34525. point = points[i];
  34526. model = point._model;
  34527. controlPoints = helpers.splineCurve(
  34528. helpers.previousItem(points, i)._model,
  34529. model,
  34530. helpers.nextItem(points, i)._model,
  34531. meta.dataset._model.tension
  34532. );
  34533. model.controlPointPreviousX = controlPoints.previous.x;
  34534. model.controlPointPreviousY = controlPoints.previous.y;
  34535. model.controlPointNextX = controlPoints.next.x;
  34536. model.controlPointNextY = controlPoints.next.y;
  34537. }
  34538. }
  34539. if (me.chart.options.elements.line.capBezierPoints) {
  34540. for (i = 0, ilen = points.length; i < ilen; ++i) {
  34541. model = points[i]._model;
  34542. model.controlPointPreviousX = capControlPoint(model.controlPointPreviousX, area.left, area.right);
  34543. model.controlPointPreviousY = capControlPoint(model.controlPointPreviousY, area.top, area.bottom);
  34544. model.controlPointNextX = capControlPoint(model.controlPointNextX, area.left, area.right);
  34545. model.controlPointNextY = capControlPoint(model.controlPointNextY, area.top, area.bottom);
  34546. }
  34547. }
  34548. },
  34549. draw: function(ease) {
  34550. var me = this;
  34551. var meta = me.getMeta();
  34552. var points = meta.data || [];
  34553. var easingDecimal = ease || 1;
  34554. var i, ilen;
  34555. // Transition Point Locations
  34556. for (i=0, ilen=points.length; i<ilen; ++i) {
  34557. points[i].transition(easingDecimal);
  34558. }
  34559. Chart.canvasHelpers.clipArea(me.chart.chart.ctx, me.chart.chartArea);
  34560. // Transition and Draw the line
  34561. if (lineEnabled(me.getDataset(), me.chart.options)) {
  34562. meta.dataset.transition(easingDecimal).draw();
  34563. }
  34564. Chart.canvasHelpers.unclipArea(me.chart.chart.ctx);
  34565. // Draw the points
  34566. for (i=0, ilen=points.length; i<ilen; ++i) {
  34567. points[i].draw(me.chart.chartArea);
  34568. }
  34569. },
  34570. setHoverStyle: function(point) {
  34571. // Point
  34572. var dataset = this.chart.data.datasets[point._datasetIndex];
  34573. var index = point._index;
  34574. var custom = point.custom || {};
  34575. var model = point._model;
  34576. model.radius = custom.hoverRadius || helpers.getValueAtIndexOrDefault(dataset.pointHoverRadius, index, this.chart.options.elements.point.hoverRadius);
  34577. model.backgroundColor = custom.hoverBackgroundColor || helpers.getValueAtIndexOrDefault(dataset.pointHoverBackgroundColor, index, helpers.getHoverColor(model.backgroundColor));
  34578. model.borderColor = custom.hoverBorderColor || helpers.getValueAtIndexOrDefault(dataset.pointHoverBorderColor, index, helpers.getHoverColor(model.borderColor));
  34579. model.borderWidth = custom.hoverBorderWidth || helpers.getValueAtIndexOrDefault(dataset.pointHoverBorderWidth, index, model.borderWidth);
  34580. },
  34581. removeHoverStyle: function(point) {
  34582. var me = this;
  34583. var dataset = me.chart.data.datasets[point._datasetIndex];
  34584. var index = point._index;
  34585. var custom = point.custom || {};
  34586. var model = point._model;
  34587. // Compatibility: If the properties are defined with only the old name, use those values
  34588. if ((dataset.radius !== undefined) && (dataset.pointRadius === undefined)) {
  34589. dataset.pointRadius = dataset.radius;
  34590. }
  34591. model.radius = custom.radius || helpers.getValueAtIndexOrDefault(dataset.pointRadius, index, me.chart.options.elements.point.radius);
  34592. model.backgroundColor = me.getPointBackgroundColor(point, index);
  34593. model.borderColor = me.getPointBorderColor(point, index);
  34594. model.borderWidth = me.getPointBorderWidth(point, index);
  34595. }
  34596. });
  34597. };
  34598. /***/ }),
  34599. /* 138 */
  34600. /***/ (function(module, exports, __webpack_require__) {
  34601. "use strict";
  34602. module.exports = function(Chart) {
  34603. var helpers = Chart.helpers;
  34604. Chart.defaults.polarArea = {
  34605. scale: {
  34606. type: 'radialLinear',
  34607. lineArc: true, // so that lines are circular
  34608. ticks: {
  34609. beginAtZero: true
  34610. }
  34611. },
  34612. // Boolean - Whether to animate the rotation of the chart
  34613. animation: {
  34614. animateRotate: true,
  34615. animateScale: true
  34616. },
  34617. startAngle: -0.5 * Math.PI,
  34618. aspectRatio: 1,
  34619. legendCallback: function(chart) {
  34620. var text = [];
  34621. text.push('<ul class="' + chart.id + '-legend">');
  34622. var data = chart.data;
  34623. var datasets = data.datasets;
  34624. var labels = data.labels;
  34625. if (datasets.length) {
  34626. for (var i = 0; i < datasets[0].data.length; ++i) {
  34627. text.push('<li><span style="background-color:' + datasets[0].backgroundColor[i] + '"></span>');
  34628. if (labels[i]) {
  34629. text.push(labels[i]);
  34630. }
  34631. text.push('</li>');
  34632. }
  34633. }
  34634. text.push('</ul>');
  34635. return text.join('');
  34636. },
  34637. legend: {
  34638. labels: {
  34639. generateLabels: function(chart) {
  34640. var data = chart.data;
  34641. if (data.labels.length && data.datasets.length) {
  34642. return data.labels.map(function(label, i) {
  34643. var meta = chart.getDatasetMeta(0);
  34644. var ds = data.datasets[0];
  34645. var arc = meta.data[i];
  34646. var custom = arc.custom || {};
  34647. var getValueAtIndexOrDefault = helpers.getValueAtIndexOrDefault;
  34648. var arcOpts = chart.options.elements.arc;
  34649. var fill = custom.backgroundColor ? custom.backgroundColor : getValueAtIndexOrDefault(ds.backgroundColor, i, arcOpts.backgroundColor);
  34650. var stroke = custom.borderColor ? custom.borderColor : getValueAtIndexOrDefault(ds.borderColor, i, arcOpts.borderColor);
  34651. var bw = custom.borderWidth ? custom.borderWidth : getValueAtIndexOrDefault(ds.borderWidth, i, arcOpts.borderWidth);
  34652. return {
  34653. text: label,
  34654. fillStyle: fill,
  34655. strokeStyle: stroke,
  34656. lineWidth: bw,
  34657. hidden: isNaN(ds.data[i]) || meta.data[i].hidden,
  34658. // Extra data used for toggling the correct item
  34659. index: i
  34660. };
  34661. });
  34662. }
  34663. return [];
  34664. }
  34665. },
  34666. onClick: function(e, legendItem) {
  34667. var index = legendItem.index;
  34668. var chart = this.chart;
  34669. var i, ilen, meta;
  34670. for (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {
  34671. meta = chart.getDatasetMeta(i);
  34672. meta.data[index].hidden = !meta.data[index].hidden;
  34673. }
  34674. chart.update();
  34675. }
  34676. },
  34677. // Need to override these to give a nice default
  34678. tooltips: {
  34679. callbacks: {
  34680. title: function() {
  34681. return '';
  34682. },
  34683. label: function(tooltipItem, data) {
  34684. return data.labels[tooltipItem.index] + ': ' + tooltipItem.yLabel;
  34685. }
  34686. }
  34687. }
  34688. };
  34689. Chart.controllers.polarArea = Chart.DatasetController.extend({
  34690. dataElementType: Chart.elements.Arc,
  34691. linkScales: helpers.noop,
  34692. update: function(reset) {
  34693. var me = this;
  34694. var chart = me.chart;
  34695. var chartArea = chart.chartArea;
  34696. var meta = me.getMeta();
  34697. var opts = chart.options;
  34698. var arcOpts = opts.elements.arc;
  34699. var minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);
  34700. chart.outerRadius = Math.max((minSize - arcOpts.borderWidth / 2) / 2, 0);
  34701. chart.innerRadius = Math.max(opts.cutoutPercentage ? (chart.outerRadius / 100) * (opts.cutoutPercentage) : 1, 0);
  34702. chart.radiusLength = (chart.outerRadius - chart.innerRadius) / chart.getVisibleDatasetCount();
  34703. me.outerRadius = chart.outerRadius - (chart.radiusLength * me.index);
  34704. me.innerRadius = me.outerRadius - chart.radiusLength;
  34705. meta.count = me.countVisibleElements();
  34706. helpers.each(meta.data, function(arc, index) {
  34707. me.updateElement(arc, index, reset);
  34708. });
  34709. },
  34710. updateElement: function(arc, index, reset) {
  34711. var me = this;
  34712. var chart = me.chart;
  34713. var dataset = me.getDataset();
  34714. var opts = chart.options;
  34715. var animationOpts = opts.animation;
  34716. var scale = chart.scale;
  34717. var getValueAtIndexOrDefault = helpers.getValueAtIndexOrDefault;
  34718. var labels = chart.data.labels;
  34719. var circumference = me.calculateCircumference(dataset.data[index]);
  34720. var centerX = scale.xCenter;
  34721. var centerY = scale.yCenter;
  34722. // If there is NaN data before us, we need to calculate the starting angle correctly.
  34723. // We could be way more efficient here, but its unlikely that the polar area chart will have a lot of data
  34724. var visibleCount = 0;
  34725. var meta = me.getMeta();
  34726. for (var i = 0; i < index; ++i) {
  34727. if (!isNaN(dataset.data[i]) && !meta.data[i].hidden) {
  34728. ++visibleCount;
  34729. }
  34730. }
  34731. // var negHalfPI = -0.5 * Math.PI;
  34732. var datasetStartAngle = opts.startAngle;
  34733. var distance = arc.hidden ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]);
  34734. var startAngle = datasetStartAngle + (circumference * visibleCount);
  34735. var endAngle = startAngle + (arc.hidden ? 0 : circumference);
  34736. var resetRadius = animationOpts.animateScale ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]);
  34737. helpers.extend(arc, {
  34738. // Utility
  34739. _datasetIndex: me.index,
  34740. _index: index,
  34741. _scale: scale,
  34742. // Desired view properties
  34743. _model: {
  34744. x: centerX,
  34745. y: centerY,
  34746. innerRadius: 0,
  34747. outerRadius: reset ? resetRadius : distance,
  34748. startAngle: reset && animationOpts.animateRotate ? datasetStartAngle : startAngle,
  34749. endAngle: reset && animationOpts.animateRotate ? datasetStartAngle : endAngle,
  34750. label: getValueAtIndexOrDefault(labels, index, labels[index])
  34751. }
  34752. });
  34753. // Apply border and fill style
  34754. me.removeHoverStyle(arc);
  34755. arc.pivot();
  34756. },
  34757. removeHoverStyle: function(arc) {
  34758. Chart.DatasetController.prototype.removeHoverStyle.call(this, arc, this.chart.options.elements.arc);
  34759. },
  34760. countVisibleElements: function() {
  34761. var dataset = this.getDataset();
  34762. var meta = this.getMeta();
  34763. var count = 0;
  34764. helpers.each(meta.data, function(element, index) {
  34765. if (!isNaN(dataset.data[index]) && !element.hidden) {
  34766. count++;
  34767. }
  34768. });
  34769. return count;
  34770. },
  34771. calculateCircumference: function(value) {
  34772. var count = this.getMeta().count;
  34773. if (count > 0 && !isNaN(value)) {
  34774. return (2 * Math.PI) / count;
  34775. }
  34776. return 0;
  34777. }
  34778. });
  34779. };
  34780. /***/ }),
  34781. /* 139 */
  34782. /***/ (function(module, exports, __webpack_require__) {
  34783. "use strict";
  34784. module.exports = function(Chart) {
  34785. var helpers = Chart.helpers;
  34786. Chart.defaults.radar = {
  34787. aspectRatio: 1,
  34788. scale: {
  34789. type: 'radialLinear'
  34790. },
  34791. elements: {
  34792. line: {
  34793. tension: 0 // no bezier in radar
  34794. }
  34795. }
  34796. };
  34797. Chart.controllers.radar = Chart.DatasetController.extend({
  34798. datasetElementType: Chart.elements.Line,
  34799. dataElementType: Chart.elements.Point,
  34800. linkScales: helpers.noop,
  34801. update: function(reset) {
  34802. var me = this;
  34803. var meta = me.getMeta();
  34804. var line = meta.dataset;
  34805. var points = meta.data;
  34806. var custom = line.custom || {};
  34807. var dataset = me.getDataset();
  34808. var lineElementOptions = me.chart.options.elements.line;
  34809. var scale = me.chart.scale;
  34810. // Compatibility: If the properties are defined with only the old name, use those values
  34811. if ((dataset.tension !== undefined) && (dataset.lineTension === undefined)) {
  34812. dataset.lineTension = dataset.tension;
  34813. }
  34814. helpers.extend(meta.dataset, {
  34815. // Utility
  34816. _datasetIndex: me.index,
  34817. // Data
  34818. _children: points,
  34819. _loop: true,
  34820. // Model
  34821. _model: {
  34822. // Appearance
  34823. tension: custom.tension ? custom.tension : helpers.getValueOrDefault(dataset.lineTension, lineElementOptions.tension),
  34824. backgroundColor: custom.backgroundColor ? custom.backgroundColor : (dataset.backgroundColor || lineElementOptions.backgroundColor),
  34825. borderWidth: custom.borderWidth ? custom.borderWidth : (dataset.borderWidth || lineElementOptions.borderWidth),
  34826. borderColor: custom.borderColor ? custom.borderColor : (dataset.borderColor || lineElementOptions.borderColor),
  34827. fill: custom.fill ? custom.fill : (dataset.fill !== undefined ? dataset.fill : lineElementOptions.fill),
  34828. borderCapStyle: custom.borderCapStyle ? custom.borderCapStyle : (dataset.borderCapStyle || lineElementOptions.borderCapStyle),
  34829. borderDash: custom.borderDash ? custom.borderDash : (dataset.borderDash || lineElementOptions.borderDash),
  34830. borderDashOffset: custom.borderDashOffset ? custom.borderDashOffset : (dataset.borderDashOffset || lineElementOptions.borderDashOffset),
  34831. borderJoinStyle: custom.borderJoinStyle ? custom.borderJoinStyle : (dataset.borderJoinStyle || lineElementOptions.borderJoinStyle),
  34832. // Scale
  34833. scaleTop: scale.top,
  34834. scaleBottom: scale.bottom,
  34835. scaleZero: scale.getBasePosition()
  34836. }
  34837. });
  34838. meta.dataset.pivot();
  34839. // Update Points
  34840. helpers.each(points, function(point, index) {
  34841. me.updateElement(point, index, reset);
  34842. }, me);
  34843. // Update bezier control points
  34844. me.updateBezierControlPoints();
  34845. },
  34846. updateElement: function(point, index, reset) {
  34847. var me = this;
  34848. var custom = point.custom || {};
  34849. var dataset = me.getDataset();
  34850. var scale = me.chart.scale;
  34851. var pointElementOptions = me.chart.options.elements.point;
  34852. var pointPosition = scale.getPointPositionForValue(index, dataset.data[index]);
  34853. helpers.extend(point, {
  34854. // Utility
  34855. _datasetIndex: me.index,
  34856. _index: index,
  34857. _scale: scale,
  34858. // Desired view properties
  34859. _model: {
  34860. x: reset ? scale.xCenter : pointPosition.x, // value not used in dataset scale, but we want a consistent API between scales
  34861. y: reset ? scale.yCenter : pointPosition.y,
  34862. // Appearance
  34863. tension: custom.tension ? custom.tension : helpers.getValueOrDefault(dataset.lineTension, me.chart.options.elements.line.tension),
  34864. radius: custom.radius ? custom.radius : helpers.getValueAtIndexOrDefault(dataset.pointRadius, index, pointElementOptions.radius),
  34865. backgroundColor: custom.backgroundColor ? custom.backgroundColor : helpers.getValueAtIndexOrDefault(dataset.pointBackgroundColor, index, pointElementOptions.backgroundColor),
  34866. borderColor: custom.borderColor ? custom.borderColor : helpers.getValueAtIndexOrDefault(dataset.pointBorderColor, index, pointElementOptions.borderColor),
  34867. borderWidth: custom.borderWidth ? custom.borderWidth : helpers.getValueAtIndexOrDefault(dataset.pointBorderWidth, index, pointElementOptions.borderWidth),
  34868. pointStyle: custom.pointStyle ? custom.pointStyle : helpers.getValueAtIndexOrDefault(dataset.pointStyle, index, pointElementOptions.pointStyle),
  34869. // Tooltip
  34870. hitRadius: custom.hitRadius ? custom.hitRadius : helpers.getValueAtIndexOrDefault(dataset.hitRadius, index, pointElementOptions.hitRadius)
  34871. }
  34872. });
  34873. point._model.skip = custom.skip ? custom.skip : (isNaN(point._model.x) || isNaN(point._model.y));
  34874. },
  34875. updateBezierControlPoints: function() {
  34876. var chartArea = this.chart.chartArea;
  34877. var meta = this.getMeta();
  34878. helpers.each(meta.data, function(point, index) {
  34879. var model = point._model;
  34880. var controlPoints = helpers.splineCurve(
  34881. helpers.previousItem(meta.data, index, true)._model,
  34882. model,
  34883. helpers.nextItem(meta.data, index, true)._model,
  34884. model.tension
  34885. );
  34886. // Prevent the bezier going outside of the bounds of the graph
  34887. model.controlPointPreviousX = Math.max(Math.min(controlPoints.previous.x, chartArea.right), chartArea.left);
  34888. model.controlPointPreviousY = Math.max(Math.min(controlPoints.previous.y, chartArea.bottom), chartArea.top);
  34889. model.controlPointNextX = Math.max(Math.min(controlPoints.next.x, chartArea.right), chartArea.left);
  34890. model.controlPointNextY = Math.max(Math.min(controlPoints.next.y, chartArea.bottom), chartArea.top);
  34891. // Now pivot the point for animation
  34892. point.pivot();
  34893. });
  34894. },
  34895. draw: function(ease) {
  34896. var meta = this.getMeta();
  34897. var easingDecimal = ease || 1;
  34898. // Transition Point Locations
  34899. helpers.each(meta.data, function(point) {
  34900. point.transition(easingDecimal);
  34901. });
  34902. // Transition and Draw the line
  34903. meta.dataset.transition(easingDecimal).draw();
  34904. // Draw the points
  34905. helpers.each(meta.data, function(point) {
  34906. point.draw();
  34907. });
  34908. },
  34909. setHoverStyle: function(point) {
  34910. // Point
  34911. var dataset = this.chart.data.datasets[point._datasetIndex];
  34912. var custom = point.custom || {};
  34913. var index = point._index;
  34914. var model = point._model;
  34915. model.radius = custom.hoverRadius ? custom.hoverRadius : helpers.getValueAtIndexOrDefault(dataset.pointHoverRadius, index, this.chart.options.elements.point.hoverRadius);
  34916. model.backgroundColor = custom.hoverBackgroundColor ? custom.hoverBackgroundColor : helpers.getValueAtIndexOrDefault(dataset.pointHoverBackgroundColor, index, helpers.getHoverColor(model.backgroundColor));
  34917. model.borderColor = custom.hoverBorderColor ? custom.hoverBorderColor : helpers.getValueAtIndexOrDefault(dataset.pointHoverBorderColor, index, helpers.getHoverColor(model.borderColor));
  34918. model.borderWidth = custom.hoverBorderWidth ? custom.hoverBorderWidth : helpers.getValueAtIndexOrDefault(dataset.pointHoverBorderWidth, index, model.borderWidth);
  34919. },
  34920. removeHoverStyle: function(point) {
  34921. var dataset = this.chart.data.datasets[point._datasetIndex];
  34922. var custom = point.custom || {};
  34923. var index = point._index;
  34924. var model = point._model;
  34925. var pointElementOptions = this.chart.options.elements.point;
  34926. model.radius = custom.radius ? custom.radius : helpers.getValueAtIndexOrDefault(dataset.radius, index, pointElementOptions.radius);
  34927. model.backgroundColor = custom.backgroundColor ? custom.backgroundColor : helpers.getValueAtIndexOrDefault(dataset.pointBackgroundColor, index, pointElementOptions.backgroundColor);
  34928. model.borderColor = custom.borderColor ? custom.borderColor : helpers.getValueAtIndexOrDefault(dataset.pointBorderColor, index, pointElementOptions.borderColor);
  34929. model.borderWidth = custom.borderWidth ? custom.borderWidth : helpers.getValueAtIndexOrDefault(dataset.pointBorderWidth, index, pointElementOptions.borderWidth);
  34930. }
  34931. });
  34932. };
  34933. /***/ }),
  34934. /* 140 */
  34935. /***/ (function(module, exports, __webpack_require__) {
  34936. "use strict";
  34937. /* global window: false */
  34938. module.exports = function(Chart) {
  34939. var helpers = Chart.helpers;
  34940. Chart.defaults.global.animation = {
  34941. duration: 1000,
  34942. easing: 'easeOutQuart',
  34943. onProgress: helpers.noop,
  34944. onComplete: helpers.noop
  34945. };
  34946. Chart.Animation = Chart.Element.extend({
  34947. currentStep: null, // the current animation step
  34948. numSteps: 60, // default number of steps
  34949. easing: '', // the easing to use for this animation
  34950. render: null, // render function used by the animation service
  34951. onAnimationProgress: null, // user specified callback to fire on each step of the animation
  34952. onAnimationComplete: null // user specified callback to fire when the animation finishes
  34953. });
  34954. Chart.animationService = {
  34955. frameDuration: 17,
  34956. animations: [],
  34957. dropFrames: 0,
  34958. request: null,
  34959. /**
  34960. * @function Chart.animationService.addAnimation
  34961. * @param chartInstance {ChartController} the chart to animate
  34962. * @param animationObject {IAnimation} the animation that we will animate
  34963. * @param duration {Number} length of animation in ms
  34964. * @param lazy {Boolean} if true, the chart is not marked as animating to enable more responsive interactions
  34965. */
  34966. addAnimation: function(chartInstance, animationObject, duration, lazy) {
  34967. var me = this;
  34968. if (!lazy) {
  34969. chartInstance.animating = true;
  34970. }
  34971. for (var index = 0; index < me.animations.length; ++index) {
  34972. if (me.animations[index].chartInstance === chartInstance) {
  34973. // replacing an in progress animation
  34974. me.animations[index].animationObject = animationObject;
  34975. return;
  34976. }
  34977. }
  34978. me.animations.push({
  34979. chartInstance: chartInstance,
  34980. animationObject: animationObject
  34981. });
  34982. // If there are no animations queued, manually kickstart a digest, for lack of a better word
  34983. if (me.animations.length === 1) {
  34984. me.requestAnimationFrame();
  34985. }
  34986. },
  34987. // Cancel the animation for a given chart instance
  34988. cancelAnimation: function(chartInstance) {
  34989. var index = helpers.findIndex(this.animations, function(animationWrapper) {
  34990. return animationWrapper.chartInstance === chartInstance;
  34991. });
  34992. if (index !== -1) {
  34993. this.animations.splice(index, 1);
  34994. chartInstance.animating = false;
  34995. }
  34996. },
  34997. requestAnimationFrame: function() {
  34998. var me = this;
  34999. if (me.request === null) {
  35000. // Skip animation frame requests until the active one is executed.
  35001. // This can happen when processing mouse events, e.g. 'mousemove'
  35002. // and 'mouseout' events will trigger multiple renders.
  35003. me.request = helpers.requestAnimFrame.call(window, function() {
  35004. me.request = null;
  35005. me.startDigest();
  35006. });
  35007. }
  35008. },
  35009. startDigest: function() {
  35010. var me = this;
  35011. var startTime = Date.now();
  35012. var framesToDrop = 0;
  35013. if (me.dropFrames > 1) {
  35014. framesToDrop = Math.floor(me.dropFrames);
  35015. me.dropFrames = me.dropFrames % 1;
  35016. }
  35017. var i = 0;
  35018. while (i < me.animations.length) {
  35019. if (me.animations[i].animationObject.currentStep === null) {
  35020. me.animations[i].animationObject.currentStep = 0;
  35021. }
  35022. me.animations[i].animationObject.currentStep += 1 + framesToDrop;
  35023. if (me.animations[i].animationObject.currentStep > me.animations[i].animationObject.numSteps) {
  35024. me.animations[i].animationObject.currentStep = me.animations[i].animationObject.numSteps;
  35025. }
  35026. me.animations[i].animationObject.render(me.animations[i].chartInstance, me.animations[i].animationObject);
  35027. if (me.animations[i].animationObject.onAnimationProgress && me.animations[i].animationObject.onAnimationProgress.call) {
  35028. me.animations[i].animationObject.onAnimationProgress.call(me.animations[i].chartInstance, me.animations[i]);
  35029. }
  35030. if (me.animations[i].animationObject.currentStep === me.animations[i].animationObject.numSteps) {
  35031. if (me.animations[i].animationObject.onAnimationComplete && me.animations[i].animationObject.onAnimationComplete.call) {
  35032. me.animations[i].animationObject.onAnimationComplete.call(me.animations[i].chartInstance, me.animations[i]);
  35033. }
  35034. // executed the last frame. Remove the animation.
  35035. me.animations[i].chartInstance.animating = false;
  35036. me.animations.splice(i, 1);
  35037. } else {
  35038. ++i;
  35039. }
  35040. }
  35041. var endTime = Date.now();
  35042. var dropFrames = (endTime - startTime) / me.frameDuration;
  35043. me.dropFrames += dropFrames;
  35044. // Do we have more stuff to animate?
  35045. if (me.animations.length > 0) {
  35046. me.requestAnimationFrame();
  35047. }
  35048. }
  35049. };
  35050. };
  35051. /***/ }),
  35052. /* 141 */
  35053. /***/ (function(module, exports, __webpack_require__) {
  35054. "use strict";
  35055. module.exports = function(Chart) {
  35056. // Global Chart canvas helpers object for drawing items to canvas
  35057. var helpers = Chart.canvasHelpers = {};
  35058. helpers.drawPoint = function(ctx, pointStyle, radius, x, y) {
  35059. var type, edgeLength, xOffset, yOffset, height, size;
  35060. if (typeof pointStyle === 'object') {
  35061. type = pointStyle.toString();
  35062. if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {
  35063. ctx.drawImage(pointStyle, x - pointStyle.width / 2, y - pointStyle.height / 2);
  35064. return;
  35065. }
  35066. }
  35067. if (isNaN(radius) || radius <= 0) {
  35068. return;
  35069. }
  35070. switch (pointStyle) {
  35071. // Default includes circle
  35072. default:
  35073. ctx.beginPath();
  35074. ctx.arc(x, y, radius, 0, Math.PI * 2);
  35075. ctx.closePath();
  35076. ctx.fill();
  35077. break;
  35078. case 'triangle':
  35079. ctx.beginPath();
  35080. edgeLength = 3 * radius / Math.sqrt(3);
  35081. height = edgeLength * Math.sqrt(3) / 2;
  35082. ctx.moveTo(x - edgeLength / 2, y + height / 3);
  35083. ctx.lineTo(x + edgeLength / 2, y + height / 3);
  35084. ctx.lineTo(x, y - 2 * height / 3);
  35085. ctx.closePath();
  35086. ctx.fill();
  35087. break;
  35088. case 'rect':
  35089. size = 1 / Math.SQRT2 * radius;
  35090. ctx.beginPath();
  35091. ctx.fillRect(x - size, y - size, 2 * size, 2 * size);
  35092. ctx.strokeRect(x - size, y - size, 2 * size, 2 * size);
  35093. break;
  35094. case 'rectRounded':
  35095. var offset = radius / Math.SQRT2;
  35096. var leftX = x - offset;
  35097. var topY = y - offset;
  35098. var sideSize = Math.SQRT2 * radius;
  35099. Chart.helpers.drawRoundedRectangle(ctx, leftX, topY, sideSize, sideSize, radius / 2);
  35100. ctx.fill();
  35101. break;
  35102. case 'rectRot':
  35103. size = 1 / Math.SQRT2 * radius;
  35104. ctx.beginPath();
  35105. ctx.moveTo(x - size, y);
  35106. ctx.lineTo(x, y + size);
  35107. ctx.lineTo(x + size, y);
  35108. ctx.lineTo(x, y - size);
  35109. ctx.closePath();
  35110. ctx.fill();
  35111. break;
  35112. case 'cross':
  35113. ctx.beginPath();
  35114. ctx.moveTo(x, y + radius);
  35115. ctx.lineTo(x, y - radius);
  35116. ctx.moveTo(x - radius, y);
  35117. ctx.lineTo(x + radius, y);
  35118. ctx.closePath();
  35119. break;
  35120. case 'crossRot':
  35121. ctx.beginPath();
  35122. xOffset = Math.cos(Math.PI / 4) * radius;
  35123. yOffset = Math.sin(Math.PI / 4) * radius;
  35124. ctx.moveTo(x - xOffset, y - yOffset);
  35125. ctx.lineTo(x + xOffset, y + yOffset);
  35126. ctx.moveTo(x - xOffset, y + yOffset);
  35127. ctx.lineTo(x + xOffset, y - yOffset);
  35128. ctx.closePath();
  35129. break;
  35130. case 'star':
  35131. ctx.beginPath();
  35132. ctx.moveTo(x, y + radius);
  35133. ctx.lineTo(x, y - radius);
  35134. ctx.moveTo(x - radius, y);
  35135. ctx.lineTo(x + radius, y);
  35136. xOffset = Math.cos(Math.PI / 4) * radius;
  35137. yOffset = Math.sin(Math.PI / 4) * radius;
  35138. ctx.moveTo(x - xOffset, y - yOffset);
  35139. ctx.lineTo(x + xOffset, y + yOffset);
  35140. ctx.moveTo(x - xOffset, y + yOffset);
  35141. ctx.lineTo(x + xOffset, y - yOffset);
  35142. ctx.closePath();
  35143. break;
  35144. case 'line':
  35145. ctx.beginPath();
  35146. ctx.moveTo(x - radius, y);
  35147. ctx.lineTo(x + radius, y);
  35148. ctx.closePath();
  35149. break;
  35150. case 'dash':
  35151. ctx.beginPath();
  35152. ctx.moveTo(x, y);
  35153. ctx.lineTo(x + radius, y);
  35154. ctx.closePath();
  35155. break;
  35156. }
  35157. ctx.stroke();
  35158. };
  35159. helpers.clipArea = function(ctx, clipArea) {
  35160. ctx.save();
  35161. ctx.beginPath();
  35162. ctx.rect(clipArea.left, clipArea.top, clipArea.right - clipArea.left, clipArea.bottom - clipArea.top);
  35163. ctx.clip();
  35164. };
  35165. helpers.unclipArea = function(ctx) {
  35166. ctx.restore();
  35167. };
  35168. };
  35169. /***/ }),
  35170. /* 142 */
  35171. /***/ (function(module, exports, __webpack_require__) {
  35172. "use strict";
  35173. module.exports = function(Chart) {
  35174. var helpers = Chart.helpers;
  35175. var plugins = Chart.plugins;
  35176. var platform = Chart.platform;
  35177. // Create a dictionary of chart types, to allow for extension of existing types
  35178. Chart.types = {};
  35179. // Store a reference to each instance - allowing us to globally resize chart instances on window resize.
  35180. // Destroy method on the chart will remove the instance of the chart from this reference.
  35181. Chart.instances = {};
  35182. // Controllers available for dataset visualization eg. bar, line, slice, etc.
  35183. Chart.controllers = {};
  35184. /**
  35185. * Initializes the given config with global and chart default values.
  35186. */
  35187. function initConfig(config) {
  35188. config = config || {};
  35189. // Do NOT use configMerge() for the data object because this method merges arrays
  35190. // and so would change references to labels and datasets, preventing data updates.
  35191. var data = config.data = config.data || {};
  35192. data.datasets = data.datasets || [];
  35193. data.labels = data.labels || [];
  35194. config.options = helpers.configMerge(
  35195. Chart.defaults.global,
  35196. Chart.defaults[config.type],
  35197. config.options || {});
  35198. return config;
  35199. }
  35200. /**
  35201. * Updates the config of the chart
  35202. * @param chart {Chart.Controller} chart to update the options for
  35203. */
  35204. function updateConfig(chart) {
  35205. var newOptions = chart.options;
  35206. // Update Scale(s) with options
  35207. if (newOptions.scale) {
  35208. chart.scale.options = newOptions.scale;
  35209. } else if (newOptions.scales) {
  35210. newOptions.scales.xAxes.concat(newOptions.scales.yAxes).forEach(function(scaleOptions) {
  35211. chart.scales[scaleOptions.id].options = scaleOptions;
  35212. });
  35213. }
  35214. // Tooltip
  35215. chart.tooltip._options = newOptions.tooltips;
  35216. }
  35217. /**
  35218. * @class Chart.Controller
  35219. * The main controller of a chart.
  35220. */
  35221. Chart.Controller = function(item, config, instance) {
  35222. var me = this;
  35223. config = initConfig(config);
  35224. var context = platform.acquireContext(item, config);
  35225. var canvas = context && context.canvas;
  35226. var height = canvas && canvas.height;
  35227. var width = canvas && canvas.width;
  35228. instance.ctx = context;
  35229. instance.canvas = canvas;
  35230. instance.config = config;
  35231. instance.width = width;
  35232. instance.height = height;
  35233. instance.aspectRatio = height? width / height : null;
  35234. me.id = helpers.uid();
  35235. me.chart = instance;
  35236. me.config = config;
  35237. me.options = config.options;
  35238. me._bufferedRender = false;
  35239. // Add the chart instance to the global namespace
  35240. Chart.instances[me.id] = me;
  35241. Object.defineProperty(me, 'data', {
  35242. get: function() {
  35243. return me.config.data;
  35244. }
  35245. });
  35246. if (!context || !canvas) {
  35247. // The given item is not a compatible context2d element, let's return before finalizing
  35248. // the chart initialization but after setting basic chart / controller properties that
  35249. // can help to figure out that the chart is not valid (e.g chart.canvas !== null);
  35250. // https://github.com/chartjs/Chart.js/issues/2807
  35251. console.error("Failed to create chart: can't acquire context from the given item");
  35252. return me;
  35253. }
  35254. me.initialize();
  35255. me.update();
  35256. return me;
  35257. };
  35258. helpers.extend(Chart.Controller.prototype, /** @lends Chart.Controller.prototype */ {
  35259. initialize: function() {
  35260. var me = this;
  35261. // Before init plugin notification
  35262. plugins.notify(me, 'beforeInit');
  35263. helpers.retinaScale(me.chart);
  35264. me.bindEvents();
  35265. if (me.options.responsive) {
  35266. // Initial resize before chart draws (must be silent to preserve initial animations).
  35267. me.resize(true);
  35268. }
  35269. // Make sure scales have IDs and are built before we build any controllers.
  35270. me.ensureScalesHaveIDs();
  35271. me.buildScales();
  35272. me.initToolTip();
  35273. // After init plugin notification
  35274. plugins.notify(me, 'afterInit');
  35275. return me;
  35276. },
  35277. clear: function() {
  35278. helpers.clear(this.chart);
  35279. return this;
  35280. },
  35281. stop: function() {
  35282. // Stops any current animation loop occurring
  35283. Chart.animationService.cancelAnimation(this);
  35284. return this;
  35285. },
  35286. resize: function(silent) {
  35287. var me = this;
  35288. var chart = me.chart;
  35289. var options = me.options;
  35290. var canvas = chart.canvas;
  35291. var aspectRatio = (options.maintainAspectRatio && chart.aspectRatio) || null;
  35292. // the canvas render width and height will be casted to integers so make sure that
  35293. // the canvas display style uses the same integer values to avoid blurring effect.
  35294. var newWidth = Math.floor(helpers.getMaximumWidth(canvas));
  35295. var newHeight = Math.floor(aspectRatio? newWidth / aspectRatio : helpers.getMaximumHeight(canvas));
  35296. if (chart.width === newWidth && chart.height === newHeight) {
  35297. return;
  35298. }
  35299. canvas.width = chart.width = newWidth;
  35300. canvas.height = chart.height = newHeight;
  35301. canvas.style.width = newWidth + 'px';
  35302. canvas.style.height = newHeight + 'px';
  35303. helpers.retinaScale(chart);
  35304. if (!silent) {
  35305. // Notify any plugins about the resize
  35306. var newSize = {width: newWidth, height: newHeight};
  35307. plugins.notify(me, 'resize', [newSize]);
  35308. // Notify of resize
  35309. if (me.options.onResize) {
  35310. me.options.onResize(me, newSize);
  35311. }
  35312. me.stop();
  35313. me.update(me.options.responsiveAnimationDuration);
  35314. }
  35315. },
  35316. ensureScalesHaveIDs: function() {
  35317. var options = this.options;
  35318. var scalesOptions = options.scales || {};
  35319. var scaleOptions = options.scale;
  35320. helpers.each(scalesOptions.xAxes, function(xAxisOptions, index) {
  35321. xAxisOptions.id = xAxisOptions.id || ('x-axis-' + index);
  35322. });
  35323. helpers.each(scalesOptions.yAxes, function(yAxisOptions, index) {
  35324. yAxisOptions.id = yAxisOptions.id || ('y-axis-' + index);
  35325. });
  35326. if (scaleOptions) {
  35327. scaleOptions.id = scaleOptions.id || 'scale';
  35328. }
  35329. },
  35330. /**
  35331. * Builds a map of scale ID to scale object for future lookup.
  35332. */
  35333. buildScales: function() {
  35334. var me = this;
  35335. var options = me.options;
  35336. var scales = me.scales = {};
  35337. var items = [];
  35338. if (options.scales) {
  35339. items = items.concat(
  35340. (options.scales.xAxes || []).map(function(xAxisOptions) {
  35341. return {options: xAxisOptions, dtype: 'category'};
  35342. }),
  35343. (options.scales.yAxes || []).map(function(yAxisOptions) {
  35344. return {options: yAxisOptions, dtype: 'linear'};
  35345. })
  35346. );
  35347. }
  35348. if (options.scale) {
  35349. items.push({options: options.scale, dtype: 'radialLinear', isDefault: true});
  35350. }
  35351. helpers.each(items, function(item) {
  35352. var scaleOptions = item.options;
  35353. var scaleType = helpers.getValueOrDefault(scaleOptions.type, item.dtype);
  35354. var scaleClass = Chart.scaleService.getScaleConstructor(scaleType);
  35355. if (!scaleClass) {
  35356. return;
  35357. }
  35358. var scale = new scaleClass({
  35359. id: scaleOptions.id,
  35360. options: scaleOptions,
  35361. ctx: me.chart.ctx,
  35362. chart: me
  35363. });
  35364. scales[scale.id] = scale;
  35365. // TODO(SB): I think we should be able to remove this custom case (options.scale)
  35366. // and consider it as a regular scale part of the "scales"" map only! This would
  35367. // make the logic easier and remove some useless? custom code.
  35368. if (item.isDefault) {
  35369. me.scale = scale;
  35370. }
  35371. });
  35372. Chart.scaleService.addScalesToLayout(this);
  35373. },
  35374. buildOrUpdateControllers: function() {
  35375. var me = this;
  35376. var types = [];
  35377. var newControllers = [];
  35378. helpers.each(me.data.datasets, function(dataset, datasetIndex) {
  35379. var meta = me.getDatasetMeta(datasetIndex);
  35380. if (!meta.type) {
  35381. meta.type = dataset.type || me.config.type;
  35382. }
  35383. types.push(meta.type);
  35384. if (meta.controller) {
  35385. meta.controller.updateIndex(datasetIndex);
  35386. } else {
  35387. meta.controller = new Chart.controllers[meta.type](me, datasetIndex);
  35388. newControllers.push(meta.controller);
  35389. }
  35390. }, me);
  35391. if (types.length > 1) {
  35392. for (var i = 1; i < types.length; i++) {
  35393. if (types[i] !== types[i - 1]) {
  35394. me.isCombo = true;
  35395. break;
  35396. }
  35397. }
  35398. }
  35399. return newControllers;
  35400. },
  35401. /**
  35402. * Reset the elements of all datasets
  35403. * @private
  35404. */
  35405. resetElements: function() {
  35406. var me = this;
  35407. helpers.each(me.data.datasets, function(dataset, datasetIndex) {
  35408. me.getDatasetMeta(datasetIndex).controller.reset();
  35409. }, me);
  35410. },
  35411. /**
  35412. * Resets the chart back to it's state before the initial animation
  35413. */
  35414. reset: function() {
  35415. this.resetElements();
  35416. this.tooltip.initialize();
  35417. },
  35418. update: function(animationDuration, lazy) {
  35419. var me = this;
  35420. updateConfig(me);
  35421. if (plugins.notify(me, 'beforeUpdate') === false) {
  35422. return;
  35423. }
  35424. // In case the entire data object changed
  35425. me.tooltip._data = me.data;
  35426. // Make sure dataset controllers are updated and new controllers are reset
  35427. var newControllers = me.buildOrUpdateControllers();
  35428. // Make sure all dataset controllers have correct meta data counts
  35429. helpers.each(me.data.datasets, function(dataset, datasetIndex) {
  35430. me.getDatasetMeta(datasetIndex).controller.buildOrUpdateElements();
  35431. }, me);
  35432. me.updateLayout();
  35433. // Can only reset the new controllers after the scales have been updated
  35434. helpers.each(newControllers, function(controller) {
  35435. controller.reset();
  35436. });
  35437. me.updateDatasets();
  35438. // Do this before render so that any plugins that need final scale updates can use it
  35439. plugins.notify(me, 'afterUpdate');
  35440. if (me._bufferedRender) {
  35441. me._bufferedRequest = {
  35442. lazy: lazy,
  35443. duration: animationDuration
  35444. };
  35445. } else {
  35446. me.render(animationDuration, lazy);
  35447. }
  35448. },
  35449. /**
  35450. * Updates the chart layout unless a plugin returns `false` to the `beforeLayout`
  35451. * hook, in which case, plugins will not be called on `afterLayout`.
  35452. * @private
  35453. */
  35454. updateLayout: function() {
  35455. var me = this;
  35456. if (plugins.notify(me, 'beforeLayout') === false) {
  35457. return;
  35458. }
  35459. Chart.layoutService.update(this, this.chart.width, this.chart.height);
  35460. /**
  35461. * Provided for backward compatibility, use `afterLayout` instead.
  35462. * @method IPlugin#afterScaleUpdate
  35463. * @deprecated since version 2.5.0
  35464. * @todo remove at version 3
  35465. */
  35466. plugins.notify(me, 'afterScaleUpdate');
  35467. plugins.notify(me, 'afterLayout');
  35468. },
  35469. /**
  35470. * Updates all datasets unless a plugin returns `false` to the `beforeDatasetsUpdate`
  35471. * hook, in which case, plugins will not be called on `afterDatasetsUpdate`.
  35472. * @private
  35473. */
  35474. updateDatasets: function() {
  35475. var me = this;
  35476. if (plugins.notify(me, 'beforeDatasetsUpdate') === false) {
  35477. return;
  35478. }
  35479. for (var i = 0, ilen = me.data.datasets.length; i < ilen; ++i) {
  35480. me.getDatasetMeta(i).controller.update();
  35481. }
  35482. plugins.notify(me, 'afterDatasetsUpdate');
  35483. },
  35484. render: function(duration, lazy) {
  35485. var me = this;
  35486. if (plugins.notify(me, 'beforeRender') === false) {
  35487. return;
  35488. }
  35489. var animationOptions = me.options.animation;
  35490. var onComplete = function() {
  35491. plugins.notify(me, 'afterRender');
  35492. var callback = animationOptions && animationOptions.onComplete;
  35493. if (callback && callback.call) {
  35494. callback.call(me);
  35495. }
  35496. };
  35497. if (animationOptions && ((typeof duration !== 'undefined' && duration !== 0) || (typeof duration === 'undefined' && animationOptions.duration !== 0))) {
  35498. var animation = new Chart.Animation();
  35499. animation.numSteps = (duration || animationOptions.duration) / 16.66; // 60 fps
  35500. animation.easing = animationOptions.easing;
  35501. // render function
  35502. animation.render = function(chartInstance, animationObject) {
  35503. var easingFunction = helpers.easingEffects[animationObject.easing];
  35504. var stepDecimal = animationObject.currentStep / animationObject.numSteps;
  35505. var easeDecimal = easingFunction(stepDecimal);
  35506. chartInstance.draw(easeDecimal, stepDecimal, animationObject.currentStep);
  35507. };
  35508. // user events
  35509. animation.onAnimationProgress = animationOptions.onProgress;
  35510. animation.onAnimationComplete = onComplete;
  35511. Chart.animationService.addAnimation(me, animation, duration, lazy);
  35512. } else {
  35513. me.draw();
  35514. onComplete();
  35515. }
  35516. return me;
  35517. },
  35518. draw: function(easingValue) {
  35519. var me = this;
  35520. me.clear();
  35521. if (easingValue === undefined || easingValue === null) {
  35522. easingValue = 1;
  35523. }
  35524. if (plugins.notify(me, 'beforeDraw', [easingValue]) === false) {
  35525. return;
  35526. }
  35527. // Draw all the scales
  35528. helpers.each(me.boxes, function(box) {
  35529. box.draw(me.chartArea);
  35530. }, me);
  35531. if (me.scale) {
  35532. me.scale.draw();
  35533. }
  35534. me.drawDatasets(easingValue);
  35535. // Finally draw the tooltip
  35536. me.tooltip.transition(easingValue).draw();
  35537. plugins.notify(me, 'afterDraw', [easingValue]);
  35538. },
  35539. /**
  35540. * Draws all datasets unless a plugin returns `false` to the `beforeDatasetsDraw`
  35541. * hook, in which case, plugins will not be called on `afterDatasetsDraw`.
  35542. * @private
  35543. */
  35544. drawDatasets: function(easingValue) {
  35545. var me = this;
  35546. if (plugins.notify(me, 'beforeDatasetsDraw', [easingValue]) === false) {
  35547. return;
  35548. }
  35549. // Draw each dataset via its respective controller (reversed to support proper line stacking)
  35550. helpers.each(me.data.datasets, function(dataset, datasetIndex) {
  35551. if (me.isDatasetVisible(datasetIndex)) {
  35552. me.getDatasetMeta(datasetIndex).controller.draw(easingValue);
  35553. }
  35554. }, me, true);
  35555. plugins.notify(me, 'afterDatasetsDraw', [easingValue]);
  35556. },
  35557. // Get the single element that was clicked on
  35558. // @return : An object containing the dataset index and element index of the matching element. Also contains the rectangle that was draw
  35559. getElementAtEvent: function(e) {
  35560. return Chart.Interaction.modes.single(this, e);
  35561. },
  35562. getElementsAtEvent: function(e) {
  35563. return Chart.Interaction.modes.label(this, e, {intersect: true});
  35564. },
  35565. getElementsAtXAxis: function(e) {
  35566. return Chart.Interaction.modes['x-axis'](this, e, {intersect: true});
  35567. },
  35568. getElementsAtEventForMode: function(e, mode, options) {
  35569. var method = Chart.Interaction.modes[mode];
  35570. if (typeof method === 'function') {
  35571. return method(this, e, options);
  35572. }
  35573. return [];
  35574. },
  35575. getDatasetAtEvent: function(e) {
  35576. return Chart.Interaction.modes.dataset(this, e, {intersect: true});
  35577. },
  35578. getDatasetMeta: function(datasetIndex) {
  35579. var me = this;
  35580. var dataset = me.data.datasets[datasetIndex];
  35581. if (!dataset._meta) {
  35582. dataset._meta = {};
  35583. }
  35584. var meta = dataset._meta[me.id];
  35585. if (!meta) {
  35586. meta = dataset._meta[me.id] = {
  35587. type: null,
  35588. data: [],
  35589. dataset: null,
  35590. controller: null,
  35591. hidden: null, // See isDatasetVisible() comment
  35592. xAxisID: null,
  35593. yAxisID: null
  35594. };
  35595. }
  35596. return meta;
  35597. },
  35598. getVisibleDatasetCount: function() {
  35599. var count = 0;
  35600. for (var i = 0, ilen = this.data.datasets.length; i<ilen; ++i) {
  35601. if (this.isDatasetVisible(i)) {
  35602. count++;
  35603. }
  35604. }
  35605. return count;
  35606. },
  35607. isDatasetVisible: function(datasetIndex) {
  35608. var meta = this.getDatasetMeta(datasetIndex);
  35609. // meta.hidden is a per chart dataset hidden flag override with 3 states: if true or false,
  35610. // the dataset.hidden value is ignored, else if null, the dataset hidden state is returned.
  35611. return typeof meta.hidden === 'boolean'? !meta.hidden : !this.data.datasets[datasetIndex].hidden;
  35612. },
  35613. generateLegend: function() {
  35614. return this.options.legendCallback(this);
  35615. },
  35616. destroy: function() {
  35617. var me = this;
  35618. var canvas = me.chart.canvas;
  35619. var meta, i, ilen;
  35620. me.stop();
  35621. // dataset controllers need to cleanup associated data
  35622. for (i = 0, ilen = me.data.datasets.length; i < ilen; ++i) {
  35623. meta = me.getDatasetMeta(i);
  35624. if (meta.controller) {
  35625. meta.controller.destroy();
  35626. meta.controller = null;
  35627. }
  35628. }
  35629. if (canvas) {
  35630. me.unbindEvents();
  35631. helpers.clear(me.chart);
  35632. platform.releaseContext(me.chart.ctx);
  35633. me.chart.canvas = null;
  35634. me.chart.ctx = null;
  35635. }
  35636. plugins.notify(me, 'destroy');
  35637. delete Chart.instances[me.id];
  35638. },
  35639. toBase64Image: function() {
  35640. return this.chart.canvas.toDataURL.apply(this.chart.canvas, arguments);
  35641. },
  35642. initToolTip: function() {
  35643. var me = this;
  35644. me.tooltip = new Chart.Tooltip({
  35645. _chart: me.chart,
  35646. _chartInstance: me,
  35647. _data: me.data,
  35648. _options: me.options.tooltips
  35649. }, me);
  35650. me.tooltip.initialize();
  35651. },
  35652. /**
  35653. * @private
  35654. */
  35655. bindEvents: function() {
  35656. var me = this;
  35657. var listeners = me._listeners = {};
  35658. var listener = function() {
  35659. me.eventHandler.apply(me, arguments);
  35660. };
  35661. helpers.each(me.options.events, function(type) {
  35662. platform.addEventListener(me, type, listener);
  35663. listeners[type] = listener;
  35664. });
  35665. // Responsiveness is currently based on the use of an iframe, however this method causes
  35666. // performance issues and could be troublesome when used with ad blockers. So make sure
  35667. // that the user is still able to create a chart without iframe when responsive is false.
  35668. // See https://github.com/chartjs/Chart.js/issues/2210
  35669. if (me.options.responsive) {
  35670. listener = function() {
  35671. me.resize();
  35672. };
  35673. platform.addEventListener(me, 'resize', listener);
  35674. listeners.resize = listener;
  35675. }
  35676. },
  35677. /**
  35678. * @private
  35679. */
  35680. unbindEvents: function() {
  35681. var me = this;
  35682. var listeners = me._listeners;
  35683. if (!listeners) {
  35684. return;
  35685. }
  35686. delete me._listeners;
  35687. helpers.each(listeners, function(listener, type) {
  35688. platform.removeEventListener(me, type, listener);
  35689. });
  35690. },
  35691. updateHoverStyle: function(elements, mode, enabled) {
  35692. var method = enabled? 'setHoverStyle' : 'removeHoverStyle';
  35693. var element, i, ilen;
  35694. for (i=0, ilen=elements.length; i<ilen; ++i) {
  35695. element = elements[i];
  35696. if (element) {
  35697. this.getDatasetMeta(element._datasetIndex).controller[method](element);
  35698. }
  35699. }
  35700. },
  35701. /**
  35702. * @private
  35703. */
  35704. eventHandler: function(e) {
  35705. var me = this;
  35706. var tooltip = me.tooltip;
  35707. if (plugins.notify(me, 'beforeEvent', [e]) === false) {
  35708. return;
  35709. }
  35710. // Buffer any update calls so that renders do not occur
  35711. me._bufferedRender = true;
  35712. me._bufferedRequest = null;
  35713. var changed = me.handleEvent(e);
  35714. changed |= tooltip && tooltip.handleEvent(e);
  35715. plugins.notify(me, 'afterEvent', [e]);
  35716. var bufferedRequest = me._bufferedRequest;
  35717. if (bufferedRequest) {
  35718. // If we have an update that was triggered, we need to do a normal render
  35719. me.render(bufferedRequest.duration, bufferedRequest.lazy);
  35720. } else if (changed && !me.animating) {
  35721. // If entering, leaving, or changing elements, animate the change via pivot
  35722. me.stop();
  35723. // We only need to render at this point. Updating will cause scales to be
  35724. // recomputed generating flicker & using more memory than necessary.
  35725. me.render(me.options.hover.animationDuration, true);
  35726. }
  35727. me._bufferedRender = false;
  35728. me._bufferedRequest = null;
  35729. return me;
  35730. },
  35731. /**
  35732. * Handle an event
  35733. * @private
  35734. * @param {IEvent} event the event to handle
  35735. * @return {Boolean} true if the chart needs to re-render
  35736. */
  35737. handleEvent: function(e) {
  35738. var me = this;
  35739. var options = me.options || {};
  35740. var hoverOptions = options.hover;
  35741. var changed = false;
  35742. me.lastActive = me.lastActive || [];
  35743. // Find Active Elements for hover and tooltips
  35744. if (e.type === 'mouseout') {
  35745. me.active = [];
  35746. } else {
  35747. me.active = me.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions);
  35748. }
  35749. // On Hover hook
  35750. if (hoverOptions.onHover) {
  35751. // Need to call with native event here to not break backwards compatibility
  35752. hoverOptions.onHover.call(me, e.native, me.active);
  35753. }
  35754. if (e.type === 'mouseup' || e.type === 'click') {
  35755. if (options.onClick) {
  35756. // Use e.native here for backwards compatibility
  35757. options.onClick.call(me, e.native, me.active);
  35758. }
  35759. }
  35760. // Remove styling for last active (even if it may still be active)
  35761. if (me.lastActive.length) {
  35762. me.updateHoverStyle(me.lastActive, hoverOptions.mode, false);
  35763. }
  35764. // Built in hover styling
  35765. if (me.active.length && hoverOptions.mode) {
  35766. me.updateHoverStyle(me.active, hoverOptions.mode, true);
  35767. }
  35768. changed = !helpers.arrayEquals(me.active, me.lastActive);
  35769. // Remember Last Actives
  35770. me.lastActive = me.active;
  35771. return changed;
  35772. }
  35773. });
  35774. };
  35775. /***/ }),
  35776. /* 143 */
  35777. /***/ (function(module, exports, __webpack_require__) {
  35778. "use strict";
  35779. module.exports = function(Chart) {
  35780. var helpers = Chart.helpers;
  35781. var arrayEvents = ['push', 'pop', 'shift', 'splice', 'unshift'];
  35782. /**
  35783. * Hooks the array methods that add or remove values ('push', pop', 'shift', 'splice',
  35784. * 'unshift') and notify the listener AFTER the array has been altered. Listeners are
  35785. * called on the 'onData*' callbacks (e.g. onDataPush, etc.) with same arguments.
  35786. */
  35787. function listenArrayEvents(array, listener) {
  35788. if (array._chartjs) {
  35789. array._chartjs.listeners.push(listener);
  35790. return;
  35791. }
  35792. Object.defineProperty(array, '_chartjs', {
  35793. configurable: true,
  35794. enumerable: false,
  35795. value: {
  35796. listeners: [listener]
  35797. }
  35798. });
  35799. arrayEvents.forEach(function(key) {
  35800. var method = 'onData' + key.charAt(0).toUpperCase() + key.slice(1);
  35801. var base = array[key];
  35802. Object.defineProperty(array, key, {
  35803. configurable: true,
  35804. enumerable: false,
  35805. value: function() {
  35806. var args = Array.prototype.slice.call(arguments);
  35807. var res = base.apply(this, args);
  35808. helpers.each(array._chartjs.listeners, function(object) {
  35809. if (typeof object[method] === 'function') {
  35810. object[method].apply(object, args);
  35811. }
  35812. });
  35813. return res;
  35814. }
  35815. });
  35816. });
  35817. }
  35818. /**
  35819. * Removes the given array event listener and cleanup extra attached properties (such as
  35820. * the _chartjs stub and overridden methods) if array doesn't have any more listeners.
  35821. */
  35822. function unlistenArrayEvents(array, listener) {
  35823. var stub = array._chartjs;
  35824. if (!stub) {
  35825. return;
  35826. }
  35827. var listeners = stub.listeners;
  35828. var index = listeners.indexOf(listener);
  35829. if (index !== -1) {
  35830. listeners.splice(index, 1);
  35831. }
  35832. if (listeners.length > 0) {
  35833. return;
  35834. }
  35835. arrayEvents.forEach(function(key) {
  35836. delete array[key];
  35837. });
  35838. delete array._chartjs;
  35839. }
  35840. // Base class for all dataset controllers (line, bar, etc)
  35841. Chart.DatasetController = function(chart, datasetIndex) {
  35842. this.initialize(chart, datasetIndex);
  35843. };
  35844. helpers.extend(Chart.DatasetController.prototype, {
  35845. /**
  35846. * Element type used to generate a meta dataset (e.g. Chart.element.Line).
  35847. * @type {Chart.core.element}
  35848. */
  35849. datasetElementType: null,
  35850. /**
  35851. * Element type used to generate a meta data (e.g. Chart.element.Point).
  35852. * @type {Chart.core.element}
  35853. */
  35854. dataElementType: null,
  35855. initialize: function(chart, datasetIndex) {
  35856. var me = this;
  35857. me.chart = chart;
  35858. me.index = datasetIndex;
  35859. me.linkScales();
  35860. me.addElements();
  35861. },
  35862. updateIndex: function(datasetIndex) {
  35863. this.index = datasetIndex;
  35864. },
  35865. linkScales: function() {
  35866. var me = this;
  35867. var meta = me.getMeta();
  35868. var dataset = me.getDataset();
  35869. if (meta.xAxisID === null) {
  35870. meta.xAxisID = dataset.xAxisID || me.chart.options.scales.xAxes[0].id;
  35871. }
  35872. if (meta.yAxisID === null) {
  35873. meta.yAxisID = dataset.yAxisID || me.chart.options.scales.yAxes[0].id;
  35874. }
  35875. },
  35876. getDataset: function() {
  35877. return this.chart.data.datasets[this.index];
  35878. },
  35879. getMeta: function() {
  35880. return this.chart.getDatasetMeta(this.index);
  35881. },
  35882. getScaleForId: function(scaleID) {
  35883. return this.chart.scales[scaleID];
  35884. },
  35885. reset: function() {
  35886. this.update(true);
  35887. },
  35888. /**
  35889. * @private
  35890. */
  35891. destroy: function() {
  35892. if (this._data) {
  35893. unlistenArrayEvents(this._data, this);
  35894. }
  35895. },
  35896. createMetaDataset: function() {
  35897. var me = this;
  35898. var type = me.datasetElementType;
  35899. return type && new type({
  35900. _chart: me.chart.chart,
  35901. _datasetIndex: me.index
  35902. });
  35903. },
  35904. createMetaData: function(index) {
  35905. var me = this;
  35906. var type = me.dataElementType;
  35907. return type && new type({
  35908. _chart: me.chart.chart,
  35909. _datasetIndex: me.index,
  35910. _index: index
  35911. });
  35912. },
  35913. addElements: function() {
  35914. var me = this;
  35915. var meta = me.getMeta();
  35916. var data = me.getDataset().data || [];
  35917. var metaData = meta.data;
  35918. var i, ilen;
  35919. for (i=0, ilen=data.length; i<ilen; ++i) {
  35920. metaData[i] = metaData[i] || me.createMetaData(i);
  35921. }
  35922. meta.dataset = meta.dataset || me.createMetaDataset();
  35923. },
  35924. addElementAndReset: function(index) {
  35925. var element = this.createMetaData(index);
  35926. this.getMeta().data.splice(index, 0, element);
  35927. this.updateElement(element, index, true);
  35928. },
  35929. buildOrUpdateElements: function() {
  35930. var me = this;
  35931. var dataset = me.getDataset();
  35932. var data = dataset.data || (dataset.data = []);
  35933. // In order to correctly handle data addition/deletion animation (an thus simulate
  35934. // real-time charts), we need to monitor these data modifications and synchronize
  35935. // the internal meta data accordingly.
  35936. if (me._data !== data) {
  35937. if (me._data) {
  35938. // This case happens when the user replaced the data array instance.
  35939. unlistenArrayEvents(me._data, me);
  35940. }
  35941. listenArrayEvents(data, me);
  35942. me._data = data;
  35943. }
  35944. // Re-sync meta data in case the user replaced the data array or if we missed
  35945. // any updates and so make sure that we handle number of datapoints changing.
  35946. me.resyncElements();
  35947. },
  35948. update: helpers.noop,
  35949. draw: function(ease) {
  35950. var easingDecimal = ease || 1;
  35951. var i, len;
  35952. var metaData = this.getMeta().data;
  35953. for (i = 0, len = metaData.length; i < len; ++i) {
  35954. metaData[i].transition(easingDecimal).draw();
  35955. }
  35956. },
  35957. removeHoverStyle: function(element, elementOpts) {
  35958. var dataset = this.chart.data.datasets[element._datasetIndex],
  35959. index = element._index,
  35960. custom = element.custom || {},
  35961. valueOrDefault = helpers.getValueAtIndexOrDefault,
  35962. model = element._model;
  35963. model.backgroundColor = custom.backgroundColor ? custom.backgroundColor : valueOrDefault(dataset.backgroundColor, index, elementOpts.backgroundColor);
  35964. model.borderColor = custom.borderColor ? custom.borderColor : valueOrDefault(dataset.borderColor, index, elementOpts.borderColor);
  35965. model.borderWidth = custom.borderWidth ? custom.borderWidth : valueOrDefault(dataset.borderWidth, index, elementOpts.borderWidth);
  35966. },
  35967. setHoverStyle: function(element) {
  35968. var dataset = this.chart.data.datasets[element._datasetIndex],
  35969. index = element._index,
  35970. custom = element.custom || {},
  35971. valueOrDefault = helpers.getValueAtIndexOrDefault,
  35972. getHoverColor = helpers.getHoverColor,
  35973. model = element._model;
  35974. model.backgroundColor = custom.hoverBackgroundColor ? custom.hoverBackgroundColor : valueOrDefault(dataset.hoverBackgroundColor, index, getHoverColor(model.backgroundColor));
  35975. model.borderColor = custom.hoverBorderColor ? custom.hoverBorderColor : valueOrDefault(dataset.hoverBorderColor, index, getHoverColor(model.borderColor));
  35976. model.borderWidth = custom.hoverBorderWidth ? custom.hoverBorderWidth : valueOrDefault(dataset.hoverBorderWidth, index, model.borderWidth);
  35977. },
  35978. /**
  35979. * @private
  35980. */
  35981. resyncElements: function() {
  35982. var me = this;
  35983. var meta = me.getMeta();
  35984. var data = me.getDataset().data;
  35985. var numMeta = meta.data.length;
  35986. var numData = data.length;
  35987. if (numData < numMeta) {
  35988. meta.data.splice(numData, numMeta - numData);
  35989. } else if (numData > numMeta) {
  35990. me.insertElements(numMeta, numData - numMeta);
  35991. }
  35992. },
  35993. /**
  35994. * @private
  35995. */
  35996. insertElements: function(start, count) {
  35997. for (var i=0; i<count; ++i) {
  35998. this.addElementAndReset(start + i);
  35999. }
  36000. },
  36001. /**
  36002. * @private
  36003. */
  36004. onDataPush: function() {
  36005. this.insertElements(this.getDataset().data.length-1, arguments.length);
  36006. },
  36007. /**
  36008. * @private
  36009. */
  36010. onDataPop: function() {
  36011. this.getMeta().data.pop();
  36012. },
  36013. /**
  36014. * @private
  36015. */
  36016. onDataShift: function() {
  36017. this.getMeta().data.shift();
  36018. },
  36019. /**
  36020. * @private
  36021. */
  36022. onDataSplice: function(start, count) {
  36023. this.getMeta().data.splice(start, count);
  36024. this.insertElements(start, arguments.length - 2);
  36025. },
  36026. /**
  36027. * @private
  36028. */
  36029. onDataUnshift: function() {
  36030. this.insertElements(0, arguments.length);
  36031. }
  36032. });
  36033. Chart.DatasetController.extend = helpers.inherits;
  36034. };
  36035. /***/ }),
  36036. /* 144 */
  36037. /***/ (function(module, exports, __webpack_require__) {
  36038. "use strict";
  36039. module.exports = function(Chart) {
  36040. var helpers = Chart.helpers;
  36041. Chart.elements = {};
  36042. Chart.Element = function(configuration) {
  36043. helpers.extend(this, configuration);
  36044. this.initialize.apply(this, arguments);
  36045. };
  36046. helpers.extend(Chart.Element.prototype, {
  36047. initialize: function() {
  36048. this.hidden = false;
  36049. },
  36050. pivot: function() {
  36051. var me = this;
  36052. if (!me._view) {
  36053. me._view = helpers.clone(me._model);
  36054. }
  36055. me._start = helpers.clone(me._view);
  36056. return me;
  36057. },
  36058. transition: function(ease) {
  36059. var me = this;
  36060. if (!me._view) {
  36061. me._view = helpers.clone(me._model);
  36062. }
  36063. // No animation -> No Transition
  36064. if (ease === 1) {
  36065. me._view = me._model;
  36066. me._start = null;
  36067. return me;
  36068. }
  36069. if (!me._start) {
  36070. me.pivot();
  36071. }
  36072. helpers.each(me._model, function(value, key) {
  36073. if (key[0] === '_') {
  36074. // Only non-underscored properties
  36075. // Init if doesn't exist
  36076. } else if (!me._view.hasOwnProperty(key)) {
  36077. if (typeof value === 'number' && !isNaN(me._view[key])) {
  36078. me._view[key] = value * ease;
  36079. } else {
  36080. me._view[key] = value;
  36081. }
  36082. // No unnecessary computations
  36083. } else if (value === me._view[key]) {
  36084. // It's the same! Woohoo!
  36085. // Color transitions if possible
  36086. } else if (typeof value === 'string') {
  36087. try {
  36088. var color = helpers.color(me._model[key]).mix(helpers.color(me._start[key]), ease);
  36089. me._view[key] = color.rgbString();
  36090. } catch (err) {
  36091. me._view[key] = value;
  36092. }
  36093. // Number transitions
  36094. } else if (typeof value === 'number') {
  36095. var startVal = me._start[key] !== undefined && isNaN(me._start[key]) === false ? me._start[key] : 0;
  36096. me._view[key] = ((me._model[key] - startVal) * ease) + startVal;
  36097. // Everything else
  36098. } else {
  36099. me._view[key] = value;
  36100. }
  36101. }, me);
  36102. return me;
  36103. },
  36104. tooltipPosition: function() {
  36105. return {
  36106. x: this._model.x,
  36107. y: this._model.y
  36108. };
  36109. },
  36110. hasValue: function() {
  36111. return helpers.isNumber(this._model.x) && helpers.isNumber(this._model.y);
  36112. }
  36113. });
  36114. Chart.Element.extend = helpers.inherits;
  36115. };
  36116. /***/ }),
  36117. /* 145 */
  36118. /***/ (function(module, exports, __webpack_require__) {
  36119. "use strict";
  36120. /* global window: false */
  36121. /* global document: false */
  36122. var color = __webpack_require__(169);
  36123. module.exports = function(Chart) {
  36124. // Global Chart helpers object for utility methods and classes
  36125. var helpers = Chart.helpers = {};
  36126. // -- Basic js utility methods
  36127. helpers.each = function(loopable, callback, self, reverse) {
  36128. // Check to see if null or undefined firstly.
  36129. var i, len;
  36130. if (helpers.isArray(loopable)) {
  36131. len = loopable.length;
  36132. if (reverse) {
  36133. for (i = len - 1; i >= 0; i--) {
  36134. callback.call(self, loopable[i], i);
  36135. }
  36136. } else {
  36137. for (i = 0; i < len; i++) {
  36138. callback.call(self, loopable[i], i);
  36139. }
  36140. }
  36141. } else if (typeof loopable === 'object') {
  36142. var keys = Object.keys(loopable);
  36143. len = keys.length;
  36144. for (i = 0; i < len; i++) {
  36145. callback.call(self, loopable[keys[i]], keys[i]);
  36146. }
  36147. }
  36148. };
  36149. helpers.clone = function(obj) {
  36150. var objClone = {};
  36151. helpers.each(obj, function(value, key) {
  36152. if (helpers.isArray(value)) {
  36153. objClone[key] = value.slice(0);
  36154. } else if (typeof value === 'object' && value !== null) {
  36155. objClone[key] = helpers.clone(value);
  36156. } else {
  36157. objClone[key] = value;
  36158. }
  36159. });
  36160. return objClone;
  36161. };
  36162. helpers.extend = function(base) {
  36163. var setFn = function(value, key) {
  36164. base[key] = value;
  36165. };
  36166. for (var i = 1, ilen = arguments.length; i < ilen; i++) {
  36167. helpers.each(arguments[i], setFn);
  36168. }
  36169. return base;
  36170. };
  36171. // Need a special merge function to chart configs since they are now grouped
  36172. helpers.configMerge = function(_base) {
  36173. var base = helpers.clone(_base);
  36174. helpers.each(Array.prototype.slice.call(arguments, 1), function(extension) {
  36175. helpers.each(extension, function(value, key) {
  36176. var baseHasProperty = base.hasOwnProperty(key);
  36177. var baseVal = baseHasProperty ? base[key] : {};
  36178. if (key === 'scales') {
  36179. // Scale config merging is complex. Add our own function here for that
  36180. base[key] = helpers.scaleMerge(baseVal, value);
  36181. } else if (key === 'scale') {
  36182. // Used in polar area & radar charts since there is only one scale
  36183. base[key] = helpers.configMerge(baseVal, Chart.scaleService.getScaleDefaults(value.type), value);
  36184. } else if (baseHasProperty
  36185. && typeof baseVal === 'object'
  36186. && !helpers.isArray(baseVal)
  36187. && baseVal !== null
  36188. && typeof value === 'object'
  36189. && !helpers.isArray(value)) {
  36190. // If we are overwriting an object with an object, do a merge of the properties.
  36191. base[key] = helpers.configMerge(baseVal, value);
  36192. } else {
  36193. // can just overwrite the value in this case
  36194. base[key] = value;
  36195. }
  36196. });
  36197. });
  36198. return base;
  36199. };
  36200. helpers.scaleMerge = function(_base, extension) {
  36201. var base = helpers.clone(_base);
  36202. helpers.each(extension, function(value, key) {
  36203. if (key === 'xAxes' || key === 'yAxes') {
  36204. // These properties are arrays of items
  36205. if (base.hasOwnProperty(key)) {
  36206. helpers.each(value, function(valueObj, index) {
  36207. var axisType = helpers.getValueOrDefault(valueObj.type, key === 'xAxes' ? 'category' : 'linear');
  36208. var axisDefaults = Chart.scaleService.getScaleDefaults(axisType);
  36209. if (index >= base[key].length || !base[key][index].type) {
  36210. base[key].push(helpers.configMerge(axisDefaults, valueObj));
  36211. } else if (valueObj.type && valueObj.type !== base[key][index].type) {
  36212. // Type changed. Bring in the new defaults before we bring in valueObj so that valueObj can override the correct scale defaults
  36213. base[key][index] = helpers.configMerge(base[key][index], axisDefaults, valueObj);
  36214. } else {
  36215. // Type is the same
  36216. base[key][index] = helpers.configMerge(base[key][index], valueObj);
  36217. }
  36218. });
  36219. } else {
  36220. base[key] = [];
  36221. helpers.each(value, function(valueObj) {
  36222. var axisType = helpers.getValueOrDefault(valueObj.type, key === 'xAxes' ? 'category' : 'linear');
  36223. base[key].push(helpers.configMerge(Chart.scaleService.getScaleDefaults(axisType), valueObj));
  36224. });
  36225. }
  36226. } else if (base.hasOwnProperty(key) && typeof base[key] === 'object' && base[key] !== null && typeof value === 'object') {
  36227. // If we are overwriting an object with an object, do a merge of the properties.
  36228. base[key] = helpers.configMerge(base[key], value);
  36229. } else {
  36230. // can just overwrite the value in this case
  36231. base[key] = value;
  36232. }
  36233. });
  36234. return base;
  36235. };
  36236. helpers.getValueAtIndexOrDefault = function(value, index, defaultValue) {
  36237. if (value === undefined || value === null) {
  36238. return defaultValue;
  36239. }
  36240. if (helpers.isArray(value)) {
  36241. return index < value.length ? value[index] : defaultValue;
  36242. }
  36243. return value;
  36244. };
  36245. helpers.getValueOrDefault = function(value, defaultValue) {
  36246. return value === undefined ? defaultValue : value;
  36247. };
  36248. helpers.indexOf = Array.prototype.indexOf?
  36249. function(array, item) {
  36250. return array.indexOf(item);
  36251. }:
  36252. function(array, item) {
  36253. for (var i = 0, ilen = array.length; i < ilen; ++i) {
  36254. if (array[i] === item) {
  36255. return i;
  36256. }
  36257. }
  36258. return -1;
  36259. };
  36260. helpers.where = function(collection, filterCallback) {
  36261. if (helpers.isArray(collection) && Array.prototype.filter) {
  36262. return collection.filter(filterCallback);
  36263. }
  36264. var filtered = [];
  36265. helpers.each(collection, function(item) {
  36266. if (filterCallback(item)) {
  36267. filtered.push(item);
  36268. }
  36269. });
  36270. return filtered;
  36271. };
  36272. helpers.findIndex = Array.prototype.findIndex?
  36273. function(array, callback, scope) {
  36274. return array.findIndex(callback, scope);
  36275. } :
  36276. function(array, callback, scope) {
  36277. scope = scope === undefined? array : scope;
  36278. for (var i = 0, ilen = array.length; i < ilen; ++i) {
  36279. if (callback.call(scope, array[i], i, array)) {
  36280. return i;
  36281. }
  36282. }
  36283. return -1;
  36284. };
  36285. helpers.findNextWhere = function(arrayToSearch, filterCallback, startIndex) {
  36286. // Default to start of the array
  36287. if (startIndex === undefined || startIndex === null) {
  36288. startIndex = -1;
  36289. }
  36290. for (var i = startIndex + 1; i < arrayToSearch.length; i++) {
  36291. var currentItem = arrayToSearch[i];
  36292. if (filterCallback(currentItem)) {
  36293. return currentItem;
  36294. }
  36295. }
  36296. };
  36297. helpers.findPreviousWhere = function(arrayToSearch, filterCallback, startIndex) {
  36298. // Default to end of the array
  36299. if (startIndex === undefined || startIndex === null) {
  36300. startIndex = arrayToSearch.length;
  36301. }
  36302. for (var i = startIndex - 1; i >= 0; i--) {
  36303. var currentItem = arrayToSearch[i];
  36304. if (filterCallback(currentItem)) {
  36305. return currentItem;
  36306. }
  36307. }
  36308. };
  36309. helpers.inherits = function(extensions) {
  36310. // Basic javascript inheritance based on the model created in Backbone.js
  36311. var me = this;
  36312. var ChartElement = (extensions && extensions.hasOwnProperty('constructor')) ? extensions.constructor : function() {
  36313. return me.apply(this, arguments);
  36314. };
  36315. var Surrogate = function() {
  36316. this.constructor = ChartElement;
  36317. };
  36318. Surrogate.prototype = me.prototype;
  36319. ChartElement.prototype = new Surrogate();
  36320. ChartElement.extend = helpers.inherits;
  36321. if (extensions) {
  36322. helpers.extend(ChartElement.prototype, extensions);
  36323. }
  36324. ChartElement.__super__ = me.prototype;
  36325. return ChartElement;
  36326. };
  36327. helpers.noop = function() {};
  36328. helpers.uid = (function() {
  36329. var id = 0;
  36330. return function() {
  36331. return id++;
  36332. };
  36333. }());
  36334. // -- Math methods
  36335. helpers.isNumber = function(n) {
  36336. return !isNaN(parseFloat(n)) && isFinite(n);
  36337. };
  36338. helpers.almostEquals = function(x, y, epsilon) {
  36339. return Math.abs(x - y) < epsilon;
  36340. };
  36341. helpers.almostWhole = function(x, epsilon) {
  36342. var rounded = Math.round(x);
  36343. return (((rounded - epsilon) < x) && ((rounded + epsilon) > x));
  36344. };
  36345. helpers.max = function(array) {
  36346. return array.reduce(function(max, value) {
  36347. if (!isNaN(value)) {
  36348. return Math.max(max, value);
  36349. }
  36350. return max;
  36351. }, Number.NEGATIVE_INFINITY);
  36352. };
  36353. helpers.min = function(array) {
  36354. return array.reduce(function(min, value) {
  36355. if (!isNaN(value)) {
  36356. return Math.min(min, value);
  36357. }
  36358. return min;
  36359. }, Number.POSITIVE_INFINITY);
  36360. };
  36361. helpers.sign = Math.sign?
  36362. function(x) {
  36363. return Math.sign(x);
  36364. } :
  36365. function(x) {
  36366. x = +x; // convert to a number
  36367. if (x === 0 || isNaN(x)) {
  36368. return x;
  36369. }
  36370. return x > 0 ? 1 : -1;
  36371. };
  36372. helpers.log10 = Math.log10?
  36373. function(x) {
  36374. return Math.log10(x);
  36375. } :
  36376. function(x) {
  36377. return Math.log(x) / Math.LN10;
  36378. };
  36379. helpers.toRadians = function(degrees) {
  36380. return degrees * (Math.PI / 180);
  36381. };
  36382. helpers.toDegrees = function(radians) {
  36383. return radians * (180 / Math.PI);
  36384. };
  36385. // Gets the angle from vertical upright to the point about a centre.
  36386. helpers.getAngleFromPoint = function(centrePoint, anglePoint) {
  36387. var distanceFromXCenter = anglePoint.x - centrePoint.x,
  36388. distanceFromYCenter = anglePoint.y - centrePoint.y,
  36389. radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);
  36390. var angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);
  36391. if (angle < (-0.5 * Math.PI)) {
  36392. angle += 2.0 * Math.PI; // make sure the returned angle is in the range of (-PI/2, 3PI/2]
  36393. }
  36394. return {
  36395. angle: angle,
  36396. distance: radialDistanceFromCenter
  36397. };
  36398. };
  36399. helpers.distanceBetweenPoints = function(pt1, pt2) {
  36400. return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));
  36401. };
  36402. helpers.aliasPixel = function(pixelWidth) {
  36403. return (pixelWidth % 2 === 0) ? 0 : 0.5;
  36404. };
  36405. helpers.splineCurve = function(firstPoint, middlePoint, afterPoint, t) {
  36406. // Props to Rob Spencer at scaled innovation for his post on splining between points
  36407. // http://scaledinnovation.com/analytics/splines/aboutSplines.html
  36408. // This function must also respect "skipped" points
  36409. var previous = firstPoint.skip ? middlePoint : firstPoint,
  36410. current = middlePoint,
  36411. next = afterPoint.skip ? middlePoint : afterPoint;
  36412. var d01 = Math.sqrt(Math.pow(current.x - previous.x, 2) + Math.pow(current.y - previous.y, 2));
  36413. var d12 = Math.sqrt(Math.pow(next.x - current.x, 2) + Math.pow(next.y - current.y, 2));
  36414. var s01 = d01 / (d01 + d12);
  36415. var s12 = d12 / (d01 + d12);
  36416. // If all points are the same, s01 & s02 will be inf
  36417. s01 = isNaN(s01) ? 0 : s01;
  36418. s12 = isNaN(s12) ? 0 : s12;
  36419. var fa = t * s01; // scaling factor for triangle Ta
  36420. var fb = t * s12;
  36421. return {
  36422. previous: {
  36423. x: current.x - fa * (next.x - previous.x),
  36424. y: current.y - fa * (next.y - previous.y)
  36425. },
  36426. next: {
  36427. x: current.x + fb * (next.x - previous.x),
  36428. y: current.y + fb * (next.y - previous.y)
  36429. }
  36430. };
  36431. };
  36432. helpers.EPSILON = Number.EPSILON || 1e-14;
  36433. helpers.splineCurveMonotone = function(points) {
  36434. // This function calculates Bézier control points in a similar way than |splineCurve|,
  36435. // but preserves monotonicity of the provided data and ensures no local extremums are added
  36436. // between the dataset discrete points due to the interpolation.
  36437. // See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation
  36438. var pointsWithTangents = (points || []).map(function(point) {
  36439. return {
  36440. model: point._model,
  36441. deltaK: 0,
  36442. mK: 0
  36443. };
  36444. });
  36445. // Calculate slopes (deltaK) and initialize tangents (mK)
  36446. var pointsLen = pointsWithTangents.length;
  36447. var i, pointBefore, pointCurrent, pointAfter;
  36448. for (i = 0; i < pointsLen; ++i) {
  36449. pointCurrent = pointsWithTangents[i];
  36450. if (pointCurrent.model.skip) {
  36451. continue;
  36452. }
  36453. pointBefore = i > 0 ? pointsWithTangents[i - 1] : null;
  36454. pointAfter = i < pointsLen - 1 ? pointsWithTangents[i + 1] : null;
  36455. if (pointAfter && !pointAfter.model.skip) {
  36456. var slopeDeltaX = (pointAfter.model.x - pointCurrent.model.x);
  36457. // In the case of two points that appear at the same x pixel, slopeDeltaX is 0
  36458. pointCurrent.deltaK = slopeDeltaX !== 0 ? (pointAfter.model.y - pointCurrent.model.y) / slopeDeltaX : 0;
  36459. }
  36460. if (!pointBefore || pointBefore.model.skip) {
  36461. pointCurrent.mK = pointCurrent.deltaK;
  36462. } else if (!pointAfter || pointAfter.model.skip) {
  36463. pointCurrent.mK = pointBefore.deltaK;
  36464. } else if (this.sign(pointBefore.deltaK) !== this.sign(pointCurrent.deltaK)) {
  36465. pointCurrent.mK = 0;
  36466. } else {
  36467. pointCurrent.mK = (pointBefore.deltaK + pointCurrent.deltaK) / 2;
  36468. }
  36469. }
  36470. // Adjust tangents to ensure monotonic properties
  36471. var alphaK, betaK, tauK, squaredMagnitude;
  36472. for (i = 0; i < pointsLen - 1; ++i) {
  36473. pointCurrent = pointsWithTangents[i];
  36474. pointAfter = pointsWithTangents[i + 1];
  36475. if (pointCurrent.model.skip || pointAfter.model.skip) {
  36476. continue;
  36477. }
  36478. if (helpers.almostEquals(pointCurrent.deltaK, 0, this.EPSILON)) {
  36479. pointCurrent.mK = pointAfter.mK = 0;
  36480. continue;
  36481. }
  36482. alphaK = pointCurrent.mK / pointCurrent.deltaK;
  36483. betaK = pointAfter.mK / pointCurrent.deltaK;
  36484. squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);
  36485. if (squaredMagnitude <= 9) {
  36486. continue;
  36487. }
  36488. tauK = 3 / Math.sqrt(squaredMagnitude);
  36489. pointCurrent.mK = alphaK * tauK * pointCurrent.deltaK;
  36490. pointAfter.mK = betaK * tauK * pointCurrent.deltaK;
  36491. }
  36492. // Compute control points
  36493. var deltaX;
  36494. for (i = 0; i < pointsLen; ++i) {
  36495. pointCurrent = pointsWithTangents[i];
  36496. if (pointCurrent.model.skip) {
  36497. continue;
  36498. }
  36499. pointBefore = i > 0 ? pointsWithTangents[i - 1] : null;
  36500. pointAfter = i < pointsLen - 1 ? pointsWithTangents[i + 1] : null;
  36501. if (pointBefore && !pointBefore.model.skip) {
  36502. deltaX = (pointCurrent.model.x - pointBefore.model.x) / 3;
  36503. pointCurrent.model.controlPointPreviousX = pointCurrent.model.x - deltaX;
  36504. pointCurrent.model.controlPointPreviousY = pointCurrent.model.y - deltaX * pointCurrent.mK;
  36505. }
  36506. if (pointAfter && !pointAfter.model.skip) {
  36507. deltaX = (pointAfter.model.x - pointCurrent.model.x) / 3;
  36508. pointCurrent.model.controlPointNextX = pointCurrent.model.x + deltaX;
  36509. pointCurrent.model.controlPointNextY = pointCurrent.model.y + deltaX * pointCurrent.mK;
  36510. }
  36511. }
  36512. };
  36513. helpers.nextItem = function(collection, index, loop) {
  36514. if (loop) {
  36515. return index >= collection.length - 1 ? collection[0] : collection[index + 1];
  36516. }
  36517. return index >= collection.length - 1 ? collection[collection.length - 1] : collection[index + 1];
  36518. };
  36519. helpers.previousItem = function(collection, index, loop) {
  36520. if (loop) {
  36521. return index <= 0 ? collection[collection.length - 1] : collection[index - 1];
  36522. }
  36523. return index <= 0 ? collection[0] : collection[index - 1];
  36524. };
  36525. // Implementation of the nice number algorithm used in determining where axis labels will go
  36526. helpers.niceNum = function(range, round) {
  36527. var exponent = Math.floor(helpers.log10(range));
  36528. var fraction = range / Math.pow(10, exponent);
  36529. var niceFraction;
  36530. if (round) {
  36531. if (fraction < 1.5) {
  36532. niceFraction = 1;
  36533. } else if (fraction < 3) {
  36534. niceFraction = 2;
  36535. } else if (fraction < 7) {
  36536. niceFraction = 5;
  36537. } else {
  36538. niceFraction = 10;
  36539. }
  36540. } else if (fraction <= 1.0) {
  36541. niceFraction = 1;
  36542. } else if (fraction <= 2) {
  36543. niceFraction = 2;
  36544. } else if (fraction <= 5) {
  36545. niceFraction = 5;
  36546. } else {
  36547. niceFraction = 10;
  36548. }
  36549. return niceFraction * Math.pow(10, exponent);
  36550. };
  36551. // Easing functions adapted from Robert Penner's easing equations
  36552. // http://www.robertpenner.com/easing/
  36553. var easingEffects = helpers.easingEffects = {
  36554. linear: function(t) {
  36555. return t;
  36556. },
  36557. easeInQuad: function(t) {
  36558. return t * t;
  36559. },
  36560. easeOutQuad: function(t) {
  36561. return -1 * t * (t - 2);
  36562. },
  36563. easeInOutQuad: function(t) {
  36564. if ((t /= 1 / 2) < 1) {
  36565. return 1 / 2 * t * t;
  36566. }
  36567. return -1 / 2 * ((--t) * (t - 2) - 1);
  36568. },
  36569. easeInCubic: function(t) {
  36570. return t * t * t;
  36571. },
  36572. easeOutCubic: function(t) {
  36573. return 1 * ((t = t / 1 - 1) * t * t + 1);
  36574. },
  36575. easeInOutCubic: function(t) {
  36576. if ((t /= 1 / 2) < 1) {
  36577. return 1 / 2 * t * t * t;
  36578. }
  36579. return 1 / 2 * ((t -= 2) * t * t + 2);
  36580. },
  36581. easeInQuart: function(t) {
  36582. return t * t * t * t;
  36583. },
  36584. easeOutQuart: function(t) {
  36585. return -1 * ((t = t / 1 - 1) * t * t * t - 1);
  36586. },
  36587. easeInOutQuart: function(t) {
  36588. if ((t /= 1 / 2) < 1) {
  36589. return 1 / 2 * t * t * t * t;
  36590. }
  36591. return -1 / 2 * ((t -= 2) * t * t * t - 2);
  36592. },
  36593. easeInQuint: function(t) {
  36594. return 1 * (t /= 1) * t * t * t * t;
  36595. },
  36596. easeOutQuint: function(t) {
  36597. return 1 * ((t = t / 1 - 1) * t * t * t * t + 1);
  36598. },
  36599. easeInOutQuint: function(t) {
  36600. if ((t /= 1 / 2) < 1) {
  36601. return 1 / 2 * t * t * t * t * t;
  36602. }
  36603. return 1 / 2 * ((t -= 2) * t * t * t * t + 2);
  36604. },
  36605. easeInSine: function(t) {
  36606. return -1 * Math.cos(t / 1 * (Math.PI / 2)) + 1;
  36607. },
  36608. easeOutSine: function(t) {
  36609. return 1 * Math.sin(t / 1 * (Math.PI / 2));
  36610. },
  36611. easeInOutSine: function(t) {
  36612. return -1 / 2 * (Math.cos(Math.PI * t / 1) - 1);
  36613. },
  36614. easeInExpo: function(t) {
  36615. return (t === 0) ? 1 : 1 * Math.pow(2, 10 * (t / 1 - 1));
  36616. },
  36617. easeOutExpo: function(t) {
  36618. return (t === 1) ? 1 : 1 * (-Math.pow(2, -10 * t / 1) + 1);
  36619. },
  36620. easeInOutExpo: function(t) {
  36621. if (t === 0) {
  36622. return 0;
  36623. }
  36624. if (t === 1) {
  36625. return 1;
  36626. }
  36627. if ((t /= 1 / 2) < 1) {
  36628. return 1 / 2 * Math.pow(2, 10 * (t - 1));
  36629. }
  36630. return 1 / 2 * (-Math.pow(2, -10 * --t) + 2);
  36631. },
  36632. easeInCirc: function(t) {
  36633. if (t >= 1) {
  36634. return t;
  36635. }
  36636. return -1 * (Math.sqrt(1 - (t /= 1) * t) - 1);
  36637. },
  36638. easeOutCirc: function(t) {
  36639. return 1 * Math.sqrt(1 - (t = t / 1 - 1) * t);
  36640. },
  36641. easeInOutCirc: function(t) {
  36642. if ((t /= 1 / 2) < 1) {
  36643. return -1 / 2 * (Math.sqrt(1 - t * t) - 1);
  36644. }
  36645. return 1 / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1);
  36646. },
  36647. easeInElastic: function(t) {
  36648. var s = 1.70158;
  36649. var p = 0;
  36650. var a = 1;
  36651. if (t === 0) {
  36652. return 0;
  36653. }
  36654. if ((t /= 1) === 1) {
  36655. return 1;
  36656. }
  36657. if (!p) {
  36658. p = 1 * 0.3;
  36659. }
  36660. if (a < Math.abs(1)) {
  36661. a = 1;
  36662. s = p / 4;
  36663. } else {
  36664. s = p / (2 * Math.PI) * Math.asin(1 / a);
  36665. }
  36666. return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * 1 - s) * (2 * Math.PI) / p));
  36667. },
  36668. easeOutElastic: function(t) {
  36669. var s = 1.70158;
  36670. var p = 0;
  36671. var a = 1;
  36672. if (t === 0) {
  36673. return 0;
  36674. }
  36675. if ((t /= 1) === 1) {
  36676. return 1;
  36677. }
  36678. if (!p) {
  36679. p = 1 * 0.3;
  36680. }
  36681. if (a < Math.abs(1)) {
  36682. a = 1;
  36683. s = p / 4;
  36684. } else {
  36685. s = p / (2 * Math.PI) * Math.asin(1 / a);
  36686. }
  36687. return a * Math.pow(2, -10 * t) * Math.sin((t * 1 - s) * (2 * Math.PI) / p) + 1;
  36688. },
  36689. easeInOutElastic: function(t) {
  36690. var s = 1.70158;
  36691. var p = 0;
  36692. var a = 1;
  36693. if (t === 0) {
  36694. return 0;
  36695. }
  36696. if ((t /= 1 / 2) === 2) {
  36697. return 1;
  36698. }
  36699. if (!p) {
  36700. p = 1 * (0.3 * 1.5);
  36701. }
  36702. if (a < Math.abs(1)) {
  36703. a = 1;
  36704. s = p / 4;
  36705. } else {
  36706. s = p / (2 * Math.PI) * Math.asin(1 / a);
  36707. }
  36708. if (t < 1) {
  36709. return -0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * 1 - s) * (2 * Math.PI) / p));
  36710. }
  36711. return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * 1 - s) * (2 * Math.PI) / p) * 0.5 + 1;
  36712. },
  36713. easeInBack: function(t) {
  36714. var s = 1.70158;
  36715. return 1 * (t /= 1) * t * ((s + 1) * t - s);
  36716. },
  36717. easeOutBack: function(t) {
  36718. var s = 1.70158;
  36719. return 1 * ((t = t / 1 - 1) * t * ((s + 1) * t + s) + 1);
  36720. },
  36721. easeInOutBack: function(t) {
  36722. var s = 1.70158;
  36723. if ((t /= 1 / 2) < 1) {
  36724. return 1 / 2 * (t * t * (((s *= (1.525)) + 1) * t - s));
  36725. }
  36726. return 1 / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2);
  36727. },
  36728. easeInBounce: function(t) {
  36729. return 1 - easingEffects.easeOutBounce(1 - t);
  36730. },
  36731. easeOutBounce: function(t) {
  36732. if ((t /= 1) < (1 / 2.75)) {
  36733. return 1 * (7.5625 * t * t);
  36734. } else if (t < (2 / 2.75)) {
  36735. return 1 * (7.5625 * (t -= (1.5 / 2.75)) * t + 0.75);
  36736. } else if (t < (2.5 / 2.75)) {
  36737. return 1 * (7.5625 * (t -= (2.25 / 2.75)) * t + 0.9375);
  36738. }
  36739. return 1 * (7.5625 * (t -= (2.625 / 2.75)) * t + 0.984375);
  36740. },
  36741. easeInOutBounce: function(t) {
  36742. if (t < 1 / 2) {
  36743. return easingEffects.easeInBounce(t * 2) * 0.5;
  36744. }
  36745. return easingEffects.easeOutBounce(t * 2 - 1) * 0.5 + 1 * 0.5;
  36746. }
  36747. };
  36748. // Request animation polyfill - http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/
  36749. helpers.requestAnimFrame = (function() {
  36750. return window.requestAnimationFrame ||
  36751. window.webkitRequestAnimationFrame ||
  36752. window.mozRequestAnimationFrame ||
  36753. window.oRequestAnimationFrame ||
  36754. window.msRequestAnimationFrame ||
  36755. function(callback) {
  36756. return window.setTimeout(callback, 1000 / 60);
  36757. };
  36758. }());
  36759. // -- DOM methods
  36760. helpers.getRelativePosition = function(evt, chart) {
  36761. var mouseX, mouseY;
  36762. var e = evt.originalEvent || evt,
  36763. canvas = evt.currentTarget || evt.srcElement,
  36764. boundingRect = canvas.getBoundingClientRect();
  36765. var touches = e.touches;
  36766. if (touches && touches.length > 0) {
  36767. mouseX = touches[0].clientX;
  36768. mouseY = touches[0].clientY;
  36769. } else {
  36770. mouseX = e.clientX;
  36771. mouseY = e.clientY;
  36772. }
  36773. // Scale mouse coordinates into canvas coordinates
  36774. // by following the pattern laid out by 'jerryj' in the comments of
  36775. // http://www.html5canvastutorials.com/advanced/html5-canvas-mouse-coordinates/
  36776. var paddingLeft = parseFloat(helpers.getStyle(canvas, 'padding-left'));
  36777. var paddingTop = parseFloat(helpers.getStyle(canvas, 'padding-top'));
  36778. var paddingRight = parseFloat(helpers.getStyle(canvas, 'padding-right'));
  36779. var paddingBottom = parseFloat(helpers.getStyle(canvas, 'padding-bottom'));
  36780. var width = boundingRect.right - boundingRect.left - paddingLeft - paddingRight;
  36781. var height = boundingRect.bottom - boundingRect.top - paddingTop - paddingBottom;
  36782. // We divide by the current device pixel ratio, because the canvas is scaled up by that amount in each direction. However
  36783. // the backend model is in unscaled coordinates. Since we are going to deal with our model coordinates, we go back here
  36784. mouseX = Math.round((mouseX - boundingRect.left - paddingLeft) / (width) * canvas.width / chart.currentDevicePixelRatio);
  36785. mouseY = Math.round((mouseY - boundingRect.top - paddingTop) / (height) * canvas.height / chart.currentDevicePixelRatio);
  36786. return {
  36787. x: mouseX,
  36788. y: mouseY
  36789. };
  36790. };
  36791. helpers.addEvent = function(node, eventType, method) {
  36792. if (node.addEventListener) {
  36793. node.addEventListener(eventType, method);
  36794. } else if (node.attachEvent) {
  36795. node.attachEvent('on' + eventType, method);
  36796. } else {
  36797. node['on' + eventType] = method;
  36798. }
  36799. };
  36800. helpers.removeEvent = function(node, eventType, handler) {
  36801. if (node.removeEventListener) {
  36802. node.removeEventListener(eventType, handler, false);
  36803. } else if (node.detachEvent) {
  36804. node.detachEvent('on' + eventType, handler);
  36805. } else {
  36806. node['on' + eventType] = helpers.noop;
  36807. }
  36808. };
  36809. // Private helper function to convert max-width/max-height values that may be percentages into a number
  36810. function parseMaxStyle(styleValue, node, parentProperty) {
  36811. var valueInPixels;
  36812. if (typeof(styleValue) === 'string') {
  36813. valueInPixels = parseInt(styleValue, 10);
  36814. if (styleValue.indexOf('%') !== -1) {
  36815. // percentage * size in dimension
  36816. valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];
  36817. }
  36818. } else {
  36819. valueInPixels = styleValue;
  36820. }
  36821. return valueInPixels;
  36822. }
  36823. /**
  36824. * Returns if the given value contains an effective constraint.
  36825. * @private
  36826. */
  36827. function isConstrainedValue(value) {
  36828. return value !== undefined && value !== null && value !== 'none';
  36829. }
  36830. // Private helper to get a constraint dimension
  36831. // @param domNode : the node to check the constraint on
  36832. // @param maxStyle : the style that defines the maximum for the direction we are using (maxWidth / maxHeight)
  36833. // @param percentageProperty : property of parent to use when calculating width as a percentage
  36834. // @see http://www.nathanaeljones.com/blog/2013/reading-max-width-cross-browser
  36835. function getConstraintDimension(domNode, maxStyle, percentageProperty) {
  36836. var view = document.defaultView;
  36837. var parentNode = domNode.parentNode;
  36838. var constrainedNode = view.getComputedStyle(domNode)[maxStyle];
  36839. var constrainedContainer = view.getComputedStyle(parentNode)[maxStyle];
  36840. var hasCNode = isConstrainedValue(constrainedNode);
  36841. var hasCContainer = isConstrainedValue(constrainedContainer);
  36842. var infinity = Number.POSITIVE_INFINITY;
  36843. if (hasCNode || hasCContainer) {
  36844. return Math.min(
  36845. hasCNode? parseMaxStyle(constrainedNode, domNode, percentageProperty) : infinity,
  36846. hasCContainer? parseMaxStyle(constrainedContainer, parentNode, percentageProperty) : infinity);
  36847. }
  36848. return 'none';
  36849. }
  36850. // returns Number or undefined if no constraint
  36851. helpers.getConstraintWidth = function(domNode) {
  36852. return getConstraintDimension(domNode, 'max-width', 'clientWidth');
  36853. };
  36854. // returns Number or undefined if no constraint
  36855. helpers.getConstraintHeight = function(domNode) {
  36856. return getConstraintDimension(domNode, 'max-height', 'clientHeight');
  36857. };
  36858. helpers.getMaximumWidth = function(domNode) {
  36859. var container = domNode.parentNode;
  36860. var paddingLeft = parseInt(helpers.getStyle(container, 'padding-left'), 10);
  36861. var paddingRight = parseInt(helpers.getStyle(container, 'padding-right'), 10);
  36862. var w = container.clientWidth - paddingLeft - paddingRight;
  36863. var cw = helpers.getConstraintWidth(domNode);
  36864. return isNaN(cw)? w : Math.min(w, cw);
  36865. };
  36866. helpers.getMaximumHeight = function(domNode) {
  36867. var container = domNode.parentNode;
  36868. var paddingTop = parseInt(helpers.getStyle(container, 'padding-top'), 10);
  36869. var paddingBottom = parseInt(helpers.getStyle(container, 'padding-bottom'), 10);
  36870. var h = container.clientHeight - paddingTop - paddingBottom;
  36871. var ch = helpers.getConstraintHeight(domNode);
  36872. return isNaN(ch)? h : Math.min(h, ch);
  36873. };
  36874. helpers.getStyle = function(el, property) {
  36875. return el.currentStyle ?
  36876. el.currentStyle[property] :
  36877. document.defaultView.getComputedStyle(el, null).getPropertyValue(property);
  36878. };
  36879. helpers.retinaScale = function(chart) {
  36880. var pixelRatio = chart.currentDevicePixelRatio = window.devicePixelRatio || 1;
  36881. if (pixelRatio === 1) {
  36882. return;
  36883. }
  36884. var canvas = chart.canvas;
  36885. var height = chart.height;
  36886. var width = chart.width;
  36887. canvas.height = height * pixelRatio;
  36888. canvas.width = width * pixelRatio;
  36889. chart.ctx.scale(pixelRatio, pixelRatio);
  36890. // If no style has been set on the canvas, the render size is used as display size,
  36891. // making the chart visually bigger, so let's enforce it to the "correct" values.
  36892. // See https://github.com/chartjs/Chart.js/issues/3575
  36893. canvas.style.height = height + 'px';
  36894. canvas.style.width = width + 'px';
  36895. };
  36896. // -- Canvas methods
  36897. helpers.clear = function(chart) {
  36898. chart.ctx.clearRect(0, 0, chart.width, chart.height);
  36899. };
  36900. helpers.fontString = function(pixelSize, fontStyle, fontFamily) {
  36901. return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;
  36902. };
  36903. helpers.longestText = function(ctx, font, arrayOfThings, cache) {
  36904. cache = cache || {};
  36905. var data = cache.data = cache.data || {};
  36906. var gc = cache.garbageCollect = cache.garbageCollect || [];
  36907. if (cache.font !== font) {
  36908. data = cache.data = {};
  36909. gc = cache.garbageCollect = [];
  36910. cache.font = font;
  36911. }
  36912. ctx.font = font;
  36913. var longest = 0;
  36914. helpers.each(arrayOfThings, function(thing) {
  36915. // Undefined strings and arrays should not be measured
  36916. if (thing !== undefined && thing !== null && helpers.isArray(thing) !== true) {
  36917. longest = helpers.measureText(ctx, data, gc, longest, thing);
  36918. } else if (helpers.isArray(thing)) {
  36919. // if it is an array lets measure each element
  36920. // to do maybe simplify this function a bit so we can do this more recursively?
  36921. helpers.each(thing, function(nestedThing) {
  36922. // Undefined strings and arrays should not be measured
  36923. if (nestedThing !== undefined && nestedThing !== null && !helpers.isArray(nestedThing)) {
  36924. longest = helpers.measureText(ctx, data, gc, longest, nestedThing);
  36925. }
  36926. });
  36927. }
  36928. });
  36929. var gcLen = gc.length / 2;
  36930. if (gcLen > arrayOfThings.length) {
  36931. for (var i = 0; i < gcLen; i++) {
  36932. delete data[gc[i]];
  36933. }
  36934. gc.splice(0, gcLen);
  36935. }
  36936. return longest;
  36937. };
  36938. helpers.measureText = function(ctx, data, gc, longest, string) {
  36939. var textWidth = data[string];
  36940. if (!textWidth) {
  36941. textWidth = data[string] = ctx.measureText(string).width;
  36942. gc.push(string);
  36943. }
  36944. if (textWidth > longest) {
  36945. longest = textWidth;
  36946. }
  36947. return longest;
  36948. };
  36949. helpers.numberOfLabelLines = function(arrayOfThings) {
  36950. var numberOfLines = 1;
  36951. helpers.each(arrayOfThings, function(thing) {
  36952. if (helpers.isArray(thing)) {
  36953. if (thing.length > numberOfLines) {
  36954. numberOfLines = thing.length;
  36955. }
  36956. }
  36957. });
  36958. return numberOfLines;
  36959. };
  36960. helpers.drawRoundedRectangle = function(ctx, x, y, width, height, radius) {
  36961. ctx.beginPath();
  36962. ctx.moveTo(x + radius, y);
  36963. ctx.lineTo(x + width - radius, y);
  36964. ctx.quadraticCurveTo(x + width, y, x + width, y + radius);
  36965. ctx.lineTo(x + width, y + height - radius);
  36966. ctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);
  36967. ctx.lineTo(x + radius, y + height);
  36968. ctx.quadraticCurveTo(x, y + height, x, y + height - radius);
  36969. ctx.lineTo(x, y + radius);
  36970. ctx.quadraticCurveTo(x, y, x + radius, y);
  36971. ctx.closePath();
  36972. };
  36973. helpers.color = function(c) {
  36974. if (!color) {
  36975. console.error('Color.js not found!');
  36976. return c;
  36977. }
  36978. /* global CanvasGradient */
  36979. if (c instanceof CanvasGradient) {
  36980. return color(Chart.defaults.global.defaultColor);
  36981. }
  36982. return color(c);
  36983. };
  36984. helpers.isArray = Array.isArray?
  36985. function(obj) {
  36986. return Array.isArray(obj);
  36987. } :
  36988. function(obj) {
  36989. return Object.prototype.toString.call(obj) === '[object Array]';
  36990. };
  36991. // ! @see http://stackoverflow.com/a/14853974
  36992. helpers.arrayEquals = function(a0, a1) {
  36993. var i, ilen, v0, v1;
  36994. if (!a0 || !a1 || a0.length !== a1.length) {
  36995. return false;
  36996. }
  36997. for (i = 0, ilen=a0.length; i < ilen; ++i) {
  36998. v0 = a0[i];
  36999. v1 = a1[i];
  37000. if (v0 instanceof Array && v1 instanceof Array) {
  37001. if (!helpers.arrayEquals(v0, v1)) {
  37002. return false;
  37003. }
  37004. } else if (v0 !== v1) {
  37005. // NOTE: two different object instances will never be equal: {x:20} != {x:20}
  37006. return false;
  37007. }
  37008. }
  37009. return true;
  37010. };
  37011. helpers.callCallback = function(fn, args, _tArg) {
  37012. if (fn && typeof fn.call === 'function') {
  37013. fn.apply(_tArg, args);
  37014. }
  37015. };
  37016. helpers.getHoverColor = function(colorValue) {
  37017. /* global CanvasPattern */
  37018. return (colorValue instanceof CanvasPattern) ?
  37019. colorValue :
  37020. helpers.color(colorValue).saturate(0.5).darken(0.1).rgbString();
  37021. };
  37022. };
  37023. /***/ }),
  37024. /* 146 */
  37025. /***/ (function(module, exports, __webpack_require__) {
  37026. "use strict";
  37027. module.exports = function(Chart) {
  37028. var helpers = Chart.helpers;
  37029. /**
  37030. * Helper function to get relative position for an event
  37031. * @param {Event|IEvent} event - The event to get the position for
  37032. * @param {Chart} chart - The chart
  37033. * @returns {Point} the event position
  37034. */
  37035. function getRelativePosition(e, chart) {
  37036. if (e.native) {
  37037. return {
  37038. x: e.x,
  37039. y: e.y
  37040. };
  37041. }
  37042. return helpers.getRelativePosition(e, chart);
  37043. }
  37044. /**
  37045. * Helper function to traverse all of the visible elements in the chart
  37046. * @param chart {chart} the chart
  37047. * @param handler {Function} the callback to execute for each visible item
  37048. */
  37049. function parseVisibleItems(chart, handler) {
  37050. var datasets = chart.data.datasets;
  37051. var meta, i, j, ilen, jlen;
  37052. for (i = 0, ilen = datasets.length; i < ilen; ++i) {
  37053. if (!chart.isDatasetVisible(i)) {
  37054. continue;
  37055. }
  37056. meta = chart.getDatasetMeta(i);
  37057. for (j = 0, jlen = meta.data.length; j < jlen; ++j) {
  37058. var element = meta.data[j];
  37059. if (!element._view.skip) {
  37060. handler(element);
  37061. }
  37062. }
  37063. }
  37064. }
  37065. /**
  37066. * Helper function to get the items that intersect the event position
  37067. * @param items {ChartElement[]} elements to filter
  37068. * @param position {Point} the point to be nearest to
  37069. * @return {ChartElement[]} the nearest items
  37070. */
  37071. function getIntersectItems(chart, position) {
  37072. var elements = [];
  37073. parseVisibleItems(chart, function(element) {
  37074. if (element.inRange(position.x, position.y)) {
  37075. elements.push(element);
  37076. }
  37077. });
  37078. return elements;
  37079. }
  37080. /**
  37081. * Helper function to get the items nearest to the event position considering all visible items in teh chart
  37082. * @param chart {Chart} the chart to look at elements from
  37083. * @param position {Point} the point to be nearest to
  37084. * @param intersect {Boolean} if true, only consider items that intersect the position
  37085. * @param distanceMetric {Function} Optional function to provide the distance between
  37086. * @return {ChartElement[]} the nearest items
  37087. */
  37088. function getNearestItems(chart, position, intersect, distanceMetric) {
  37089. var minDistance = Number.POSITIVE_INFINITY;
  37090. var nearestItems = [];
  37091. if (!distanceMetric) {
  37092. distanceMetric = helpers.distanceBetweenPoints;
  37093. }
  37094. parseVisibleItems(chart, function(element) {
  37095. if (intersect && !element.inRange(position.x, position.y)) {
  37096. return;
  37097. }
  37098. var center = element.getCenterPoint();
  37099. var distance = distanceMetric(position, center);
  37100. if (distance < minDistance) {
  37101. nearestItems = [element];
  37102. minDistance = distance;
  37103. } else if (distance === minDistance) {
  37104. // Can have multiple items at the same distance in which case we sort by size
  37105. nearestItems.push(element);
  37106. }
  37107. });
  37108. return nearestItems;
  37109. }
  37110. function indexMode(chart, e, options) {
  37111. var position = getRelativePosition(e, chart.chart);
  37112. var distanceMetric = function(pt1, pt2) {
  37113. return Math.abs(pt1.x - pt2.x);
  37114. };
  37115. var items = options.intersect ? getIntersectItems(chart, position) : getNearestItems(chart, position, false, distanceMetric);
  37116. var elements = [];
  37117. if (!items.length) {
  37118. return [];
  37119. }
  37120. chart.data.datasets.forEach(function(dataset, datasetIndex) {
  37121. if (chart.isDatasetVisible(datasetIndex)) {
  37122. var meta = chart.getDatasetMeta(datasetIndex),
  37123. element = meta.data[items[0]._index];
  37124. // don't count items that are skipped (null data)
  37125. if (element && !element._view.skip) {
  37126. elements.push(element);
  37127. }
  37128. }
  37129. });
  37130. return elements;
  37131. }
  37132. /**
  37133. * @interface IInteractionOptions
  37134. */
  37135. /**
  37136. * If true, only consider items that intersect the point
  37137. * @name IInterfaceOptions#boolean
  37138. * @type Boolean
  37139. */
  37140. /**
  37141. * Contains interaction related functions
  37142. * @namespace Chart.Interaction
  37143. */
  37144. Chart.Interaction = {
  37145. // Helper function for different modes
  37146. modes: {
  37147. single: function(chart, e) {
  37148. var position = getRelativePosition(e, chart.chart);
  37149. var elements = [];
  37150. parseVisibleItems(chart, function(element) {
  37151. if (element.inRange(position.x, position.y)) {
  37152. elements.push(element);
  37153. return elements;
  37154. }
  37155. });
  37156. return elements.slice(0, 1);
  37157. },
  37158. /**
  37159. * @function Chart.Interaction.modes.label
  37160. * @deprecated since version 2.4.0
  37161. */
  37162. label: indexMode,
  37163. /**
  37164. * Returns items at the same index. If the options.intersect parameter is true, we only return items if we intersect something
  37165. * If the options.intersect mode is false, we find the nearest item and return the items at the same index as that item
  37166. * @function Chart.Interaction.modes.index
  37167. * @since v2.4.0
  37168. * @param chart {chart} the chart we are returning items from
  37169. * @param e {Event} the event we are find things at
  37170. * @param options {IInteractionOptions} options to use during interaction
  37171. * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned
  37172. */
  37173. index: indexMode,
  37174. /**
  37175. * Returns items in the same dataset. If the options.intersect parameter is true, we only return items if we intersect something
  37176. * If the options.intersect is false, we find the nearest item and return the items in that dataset
  37177. * @function Chart.Interaction.modes.dataset
  37178. * @param chart {chart} the chart we are returning items from
  37179. * @param e {Event} the event we are find things at
  37180. * @param options {IInteractionOptions} options to use during interaction
  37181. * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned
  37182. */
  37183. dataset: function(chart, e, options) {
  37184. var position = getRelativePosition(e, chart.chart);
  37185. var items = options.intersect ? getIntersectItems(chart, position) : getNearestItems(chart, position, false);
  37186. if (items.length > 0) {
  37187. items = chart.getDatasetMeta(items[0]._datasetIndex).data;
  37188. }
  37189. return items;
  37190. },
  37191. /**
  37192. * @function Chart.Interaction.modes.x-axis
  37193. * @deprecated since version 2.4.0. Use index mode and intersect == true
  37194. */
  37195. 'x-axis': function(chart, e) {
  37196. return indexMode(chart, e, true);
  37197. },
  37198. /**
  37199. * Point mode returns all elements that hit test based on the event position
  37200. * of the event
  37201. * @function Chart.Interaction.modes.intersect
  37202. * @param chart {chart} the chart we are returning items from
  37203. * @param e {Event} the event we are find things at
  37204. * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned
  37205. */
  37206. point: function(chart, e) {
  37207. var position = getRelativePosition(e, chart.chart);
  37208. return getIntersectItems(chart, position);
  37209. },
  37210. /**
  37211. * nearest mode returns the element closest to the point
  37212. * @function Chart.Interaction.modes.intersect
  37213. * @param chart {chart} the chart we are returning items from
  37214. * @param e {Event} the event we are find things at
  37215. * @param options {IInteractionOptions} options to use
  37216. * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned
  37217. */
  37218. nearest: function(chart, e, options) {
  37219. var position = getRelativePosition(e, chart.chart);
  37220. var nearestItems = getNearestItems(chart, position, options.intersect);
  37221. // We have multiple items at the same distance from the event. Now sort by smallest
  37222. if (nearestItems.length > 1) {
  37223. nearestItems.sort(function(a, b) {
  37224. var sizeA = a.getArea();
  37225. var sizeB = b.getArea();
  37226. var ret = sizeA - sizeB;
  37227. if (ret === 0) {
  37228. // if equal sort by dataset index
  37229. ret = a._datasetIndex - b._datasetIndex;
  37230. }
  37231. return ret;
  37232. });
  37233. }
  37234. // Return only 1 item
  37235. return nearestItems.slice(0, 1);
  37236. },
  37237. /**
  37238. * x mode returns the elements that hit-test at the current x coordinate
  37239. * @function Chart.Interaction.modes.x
  37240. * @param chart {chart} the chart we are returning items from
  37241. * @param e {Event} the event we are find things at
  37242. * @param options {IInteractionOptions} options to use
  37243. * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned
  37244. */
  37245. x: function(chart, e, options) {
  37246. var position = getRelativePosition(e, chart.chart);
  37247. var items = [];
  37248. var intersectsItem = false;
  37249. parseVisibleItems(chart, function(element) {
  37250. if (element.inXRange(position.x)) {
  37251. items.push(element);
  37252. }
  37253. if (element.inRange(position.x, position.y)) {
  37254. intersectsItem = true;
  37255. }
  37256. });
  37257. // If we want to trigger on an intersect and we don't have any items
  37258. // that intersect the position, return nothing
  37259. if (options.intersect && !intersectsItem) {
  37260. items = [];
  37261. }
  37262. return items;
  37263. },
  37264. /**
  37265. * y mode returns the elements that hit-test at the current y coordinate
  37266. * @function Chart.Interaction.modes.y
  37267. * @param chart {chart} the chart we are returning items from
  37268. * @param e {Event} the event we are find things at
  37269. * @param options {IInteractionOptions} options to use
  37270. * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned
  37271. */
  37272. y: function(chart, e, options) {
  37273. var position = getRelativePosition(e, chart.chart);
  37274. var items = [];
  37275. var intersectsItem = false;
  37276. parseVisibleItems(chart, function(element) {
  37277. if (element.inYRange(position.y)) {
  37278. items.push(element);
  37279. }
  37280. if (element.inRange(position.x, position.y)) {
  37281. intersectsItem = true;
  37282. }
  37283. });
  37284. // If we want to trigger on an intersect and we don't have any items
  37285. // that intersect the position, return nothing
  37286. if (options.intersect && !intersectsItem) {
  37287. items = [];
  37288. }
  37289. return items;
  37290. }
  37291. }
  37292. };
  37293. };
  37294. /***/ }),
  37295. /* 147 */
  37296. /***/ (function(module, exports, __webpack_require__) {
  37297. "use strict";
  37298. module.exports = function() {
  37299. // Occupy the global variable of Chart, and create a simple base class
  37300. var Chart = function(item, config) {
  37301. this.controller = new Chart.Controller(item, config, this);
  37302. return this.controller;
  37303. };
  37304. // Globally expose the defaults to allow for user updating/changing
  37305. Chart.defaults = {
  37306. global: {
  37307. responsive: true,
  37308. responsiveAnimationDuration: 0,
  37309. maintainAspectRatio: true,
  37310. events: ['mousemove', 'mouseout', 'click', 'touchstart', 'touchmove'],
  37311. hover: {
  37312. onHover: null,
  37313. mode: 'nearest',
  37314. intersect: true,
  37315. animationDuration: 400
  37316. },
  37317. onClick: null,
  37318. defaultColor: 'rgba(0,0,0,0.1)',
  37319. defaultFontColor: '#666',
  37320. defaultFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
  37321. defaultFontSize: 12,
  37322. defaultFontStyle: 'normal',
  37323. showLines: true,
  37324. // Element defaults defined in element extensions
  37325. elements: {},
  37326. // Legend callback string
  37327. legendCallback: function(chart) {
  37328. var text = [];
  37329. text.push('<ul class="' + chart.id + '-legend">');
  37330. for (var i = 0; i < chart.data.datasets.length; i++) {
  37331. text.push('<li><span style="background-color:' + chart.data.datasets[i].backgroundColor + '"></span>');
  37332. if (chart.data.datasets[i].label) {
  37333. text.push(chart.data.datasets[i].label);
  37334. }
  37335. text.push('</li>');
  37336. }
  37337. text.push('</ul>');
  37338. return text.join('');
  37339. }
  37340. }
  37341. };
  37342. Chart.Chart = Chart;
  37343. return Chart;
  37344. };
  37345. /***/ }),
  37346. /* 148 */
  37347. /***/ (function(module, exports, __webpack_require__) {
  37348. "use strict";
  37349. module.exports = function(Chart) {
  37350. var helpers = Chart.helpers;
  37351. // The layout service is very self explanatory. It's responsible for the layout within a chart.
  37352. // Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need
  37353. // It is this service's responsibility of carrying out that layout.
  37354. Chart.layoutService = {
  37355. defaults: {},
  37356. // Register a box to a chartInstance. A box is simply a reference to an object that requires layout. eg. Scales, Legend, Plugins.
  37357. addBox: function(chartInstance, box) {
  37358. if (!chartInstance.boxes) {
  37359. chartInstance.boxes = [];
  37360. }
  37361. chartInstance.boxes.push(box);
  37362. },
  37363. removeBox: function(chartInstance, box) {
  37364. if (!chartInstance.boxes) {
  37365. return;
  37366. }
  37367. chartInstance.boxes.splice(chartInstance.boxes.indexOf(box), 1);
  37368. },
  37369. // The most important function
  37370. update: function(chartInstance, width, height) {
  37371. if (!chartInstance) {
  37372. return;
  37373. }
  37374. var layoutOptions = chartInstance.options.layout;
  37375. var padding = layoutOptions ? layoutOptions.padding : null;
  37376. var leftPadding = 0;
  37377. var rightPadding = 0;
  37378. var topPadding = 0;
  37379. var bottomPadding = 0;
  37380. if (!isNaN(padding)) {
  37381. // options.layout.padding is a number. assign to all
  37382. leftPadding = padding;
  37383. rightPadding = padding;
  37384. topPadding = padding;
  37385. bottomPadding = padding;
  37386. } else {
  37387. leftPadding = padding.left || 0;
  37388. rightPadding = padding.right || 0;
  37389. topPadding = padding.top || 0;
  37390. bottomPadding = padding.bottom || 0;
  37391. }
  37392. var leftBoxes = helpers.where(chartInstance.boxes, function(box) {
  37393. return box.options.position === 'left';
  37394. });
  37395. var rightBoxes = helpers.where(chartInstance.boxes, function(box) {
  37396. return box.options.position === 'right';
  37397. });
  37398. var topBoxes = helpers.where(chartInstance.boxes, function(box) {
  37399. return box.options.position === 'top';
  37400. });
  37401. var bottomBoxes = helpers.where(chartInstance.boxes, function(box) {
  37402. return box.options.position === 'bottom';
  37403. });
  37404. // Boxes that overlay the chartarea such as the radialLinear scale
  37405. var chartAreaBoxes = helpers.where(chartInstance.boxes, function(box) {
  37406. return box.options.position === 'chartArea';
  37407. });
  37408. // Ensure that full width boxes are at the very top / bottom
  37409. topBoxes.sort(function(a, b) {
  37410. return (b.options.fullWidth ? 1 : 0) - (a.options.fullWidth ? 1 : 0);
  37411. });
  37412. bottomBoxes.sort(function(a, b) {
  37413. return (a.options.fullWidth ? 1 : 0) - (b.options.fullWidth ? 1 : 0);
  37414. });
  37415. // Essentially we now have any number of boxes on each of the 4 sides.
  37416. // Our canvas looks like the following.
  37417. // The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and
  37418. // B1 is the bottom axis
  37419. // There are also 4 quadrant-like locations (left to right instead of clockwise) reserved for chart overlays
  37420. // These locations are single-box locations only, when trying to register a chartArea location that is already taken,
  37421. // an error will be thrown.
  37422. //
  37423. // |----------------------------------------------------|
  37424. // | T1 (Full Width) |
  37425. // |----------------------------------------------------|
  37426. // | | | T2 | |
  37427. // | |----|-------------------------------------|----|
  37428. // | | | C1 | | C2 | |
  37429. // | | |----| |----| |
  37430. // | | | | |
  37431. // | L1 | L2 | ChartArea (C0) | R1 |
  37432. // | | | | |
  37433. // | | |----| |----| |
  37434. // | | | C3 | | C4 | |
  37435. // | |----|-------------------------------------|----|
  37436. // | | | B1 | |
  37437. // |----------------------------------------------------|
  37438. // | B2 (Full Width) |
  37439. // |----------------------------------------------------|
  37440. //
  37441. // What we do to find the best sizing, we do the following
  37442. // 1. Determine the minimum size of the chart area.
  37443. // 2. Split the remaining width equally between each vertical axis
  37444. // 3. Split the remaining height equally between each horizontal axis
  37445. // 4. Give each layout the maximum size it can be. The layout will return it's minimum size
  37446. // 5. Adjust the sizes of each axis based on it's minimum reported size.
  37447. // 6. Refit each axis
  37448. // 7. Position each axis in the final location
  37449. // 8. Tell the chart the final location of the chart area
  37450. // 9. Tell any axes that overlay the chart area the positions of the chart area
  37451. // Step 1
  37452. var chartWidth = width - leftPadding - rightPadding;
  37453. var chartHeight = height - topPadding - bottomPadding;
  37454. var chartAreaWidth = chartWidth / 2; // min 50%
  37455. var chartAreaHeight = chartHeight / 2; // min 50%
  37456. // Step 2
  37457. var verticalBoxWidth = (width - chartAreaWidth) / (leftBoxes.length + rightBoxes.length);
  37458. // Step 3
  37459. var horizontalBoxHeight = (height - chartAreaHeight) / (topBoxes.length + bottomBoxes.length);
  37460. // Step 4
  37461. var maxChartAreaWidth = chartWidth;
  37462. var maxChartAreaHeight = chartHeight;
  37463. var minBoxSizes = [];
  37464. function getMinimumBoxSize(box) {
  37465. var minSize;
  37466. var isHorizontal = box.isHorizontal();
  37467. if (isHorizontal) {
  37468. minSize = box.update(box.options.fullWidth ? chartWidth : maxChartAreaWidth, horizontalBoxHeight);
  37469. maxChartAreaHeight -= minSize.height;
  37470. } else {
  37471. minSize = box.update(verticalBoxWidth, chartAreaHeight);
  37472. maxChartAreaWidth -= minSize.width;
  37473. }
  37474. minBoxSizes.push({
  37475. horizontal: isHorizontal,
  37476. minSize: minSize,
  37477. box: box,
  37478. });
  37479. }
  37480. helpers.each(leftBoxes.concat(rightBoxes, topBoxes, bottomBoxes), getMinimumBoxSize);
  37481. // If a horizontal box has padding, we move the left boxes over to avoid ugly charts (see issue #2478)
  37482. var maxHorizontalLeftPadding = 0;
  37483. var maxHorizontalRightPadding = 0;
  37484. var maxVerticalTopPadding = 0;
  37485. var maxVerticalBottomPadding = 0;
  37486. helpers.each(topBoxes.concat(bottomBoxes), function(horizontalBox) {
  37487. if (horizontalBox.getPadding) {
  37488. var boxPadding = horizontalBox.getPadding();
  37489. maxHorizontalLeftPadding = Math.max(maxHorizontalLeftPadding, boxPadding.left);
  37490. maxHorizontalRightPadding = Math.max(maxHorizontalRightPadding, boxPadding.right);
  37491. }
  37492. });
  37493. helpers.each(leftBoxes.concat(rightBoxes), function(verticalBox) {
  37494. if (verticalBox.getPadding) {
  37495. var boxPadding = verticalBox.getPadding();
  37496. maxVerticalTopPadding = Math.max(maxVerticalTopPadding, boxPadding.top);
  37497. maxVerticalBottomPadding = Math.max(maxVerticalBottomPadding, boxPadding.bottom);
  37498. }
  37499. });
  37500. // At this point, maxChartAreaHeight and maxChartAreaWidth are the size the chart area could
  37501. // be if the axes are drawn at their minimum sizes.
  37502. // Steps 5 & 6
  37503. var totalLeftBoxesWidth = leftPadding;
  37504. var totalRightBoxesWidth = rightPadding;
  37505. var totalTopBoxesHeight = topPadding;
  37506. var totalBottomBoxesHeight = bottomPadding;
  37507. // Function to fit a box
  37508. function fitBox(box) {
  37509. var minBoxSize = helpers.findNextWhere(minBoxSizes, function(minBox) {
  37510. return minBox.box === box;
  37511. });
  37512. if (minBoxSize) {
  37513. if (box.isHorizontal()) {
  37514. var scaleMargin = {
  37515. left: Math.max(totalLeftBoxesWidth, maxHorizontalLeftPadding),
  37516. right: Math.max(totalRightBoxesWidth, maxHorizontalRightPadding),
  37517. top: 0,
  37518. bottom: 0
  37519. };
  37520. // Don't use min size here because of label rotation. When the labels are rotated, their rotation highly depends
  37521. // on the margin. Sometimes they need to increase in size slightly
  37522. box.update(box.options.fullWidth ? chartWidth : maxChartAreaWidth, chartHeight / 2, scaleMargin);
  37523. } else {
  37524. box.update(minBoxSize.minSize.width, maxChartAreaHeight);
  37525. }
  37526. }
  37527. }
  37528. // Update, and calculate the left and right margins for the horizontal boxes
  37529. helpers.each(leftBoxes.concat(rightBoxes), fitBox);
  37530. helpers.each(leftBoxes, function(box) {
  37531. totalLeftBoxesWidth += box.width;
  37532. });
  37533. helpers.each(rightBoxes, function(box) {
  37534. totalRightBoxesWidth += box.width;
  37535. });
  37536. // Set the Left and Right margins for the horizontal boxes
  37537. helpers.each(topBoxes.concat(bottomBoxes), fitBox);
  37538. // Figure out how much margin is on the top and bottom of the vertical boxes
  37539. helpers.each(topBoxes, function(box) {
  37540. totalTopBoxesHeight += box.height;
  37541. });
  37542. helpers.each(bottomBoxes, function(box) {
  37543. totalBottomBoxesHeight += box.height;
  37544. });
  37545. function finalFitVerticalBox(box) {
  37546. var minBoxSize = helpers.findNextWhere(minBoxSizes, function(minSize) {
  37547. return minSize.box === box;
  37548. });
  37549. var scaleMargin = {
  37550. left: 0,
  37551. right: 0,
  37552. top: totalTopBoxesHeight,
  37553. bottom: totalBottomBoxesHeight
  37554. };
  37555. if (minBoxSize) {
  37556. box.update(minBoxSize.minSize.width, maxChartAreaHeight, scaleMargin);
  37557. }
  37558. }
  37559. // Let the left layout know the final margin
  37560. helpers.each(leftBoxes.concat(rightBoxes), finalFitVerticalBox);
  37561. // Recalculate because the size of each layout might have changed slightly due to the margins (label rotation for instance)
  37562. totalLeftBoxesWidth = leftPadding;
  37563. totalRightBoxesWidth = rightPadding;
  37564. totalTopBoxesHeight = topPadding;
  37565. totalBottomBoxesHeight = bottomPadding;
  37566. helpers.each(leftBoxes, function(box) {
  37567. totalLeftBoxesWidth += box.width;
  37568. });
  37569. helpers.each(rightBoxes, function(box) {
  37570. totalRightBoxesWidth += box.width;
  37571. });
  37572. helpers.each(topBoxes, function(box) {
  37573. totalTopBoxesHeight += box.height;
  37574. });
  37575. helpers.each(bottomBoxes, function(box) {
  37576. totalBottomBoxesHeight += box.height;
  37577. });
  37578. // We may be adding some padding to account for rotated x axis labels
  37579. var leftPaddingAddition = Math.max(maxHorizontalLeftPadding - totalLeftBoxesWidth, 0);
  37580. totalLeftBoxesWidth += leftPaddingAddition;
  37581. totalRightBoxesWidth += Math.max(maxHorizontalRightPadding - totalRightBoxesWidth, 0);
  37582. var topPaddingAddition = Math.max(maxVerticalTopPadding - totalTopBoxesHeight, 0);
  37583. totalTopBoxesHeight += topPaddingAddition;
  37584. totalBottomBoxesHeight += Math.max(maxVerticalBottomPadding - totalBottomBoxesHeight, 0);
  37585. // Figure out if our chart area changed. This would occur if the dataset layout label rotation
  37586. // changed due to the application of the margins in step 6. Since we can only get bigger, this is safe to do
  37587. // without calling `fit` again
  37588. var newMaxChartAreaHeight = height - totalTopBoxesHeight - totalBottomBoxesHeight;
  37589. var newMaxChartAreaWidth = width - totalLeftBoxesWidth - totalRightBoxesWidth;
  37590. if (newMaxChartAreaWidth !== maxChartAreaWidth || newMaxChartAreaHeight !== maxChartAreaHeight) {
  37591. helpers.each(leftBoxes, function(box) {
  37592. box.height = newMaxChartAreaHeight;
  37593. });
  37594. helpers.each(rightBoxes, function(box) {
  37595. box.height = newMaxChartAreaHeight;
  37596. });
  37597. helpers.each(topBoxes, function(box) {
  37598. if (!box.options.fullWidth) {
  37599. box.width = newMaxChartAreaWidth;
  37600. }
  37601. });
  37602. helpers.each(bottomBoxes, function(box) {
  37603. if (!box.options.fullWidth) {
  37604. box.width = newMaxChartAreaWidth;
  37605. }
  37606. });
  37607. maxChartAreaHeight = newMaxChartAreaHeight;
  37608. maxChartAreaWidth = newMaxChartAreaWidth;
  37609. }
  37610. // Step 7 - Position the boxes
  37611. var left = leftPadding + leftPaddingAddition;
  37612. var top = topPadding + topPaddingAddition;
  37613. function placeBox(box) {
  37614. if (box.isHorizontal()) {
  37615. box.left = box.options.fullWidth ? leftPadding : totalLeftBoxesWidth;
  37616. box.right = box.options.fullWidth ? width - rightPadding : totalLeftBoxesWidth + maxChartAreaWidth;
  37617. box.top = top;
  37618. box.bottom = top + box.height;
  37619. // Move to next point
  37620. top = box.bottom;
  37621. } else {
  37622. box.left = left;
  37623. box.right = left + box.width;
  37624. box.top = totalTopBoxesHeight;
  37625. box.bottom = totalTopBoxesHeight + maxChartAreaHeight;
  37626. // Move to next point
  37627. left = box.right;
  37628. }
  37629. }
  37630. helpers.each(leftBoxes.concat(topBoxes), placeBox);
  37631. // Account for chart width and height
  37632. left += maxChartAreaWidth;
  37633. top += maxChartAreaHeight;
  37634. helpers.each(rightBoxes, placeBox);
  37635. helpers.each(bottomBoxes, placeBox);
  37636. // Step 8
  37637. chartInstance.chartArea = {
  37638. left: totalLeftBoxesWidth,
  37639. top: totalTopBoxesHeight,
  37640. right: totalLeftBoxesWidth + maxChartAreaWidth,
  37641. bottom: totalTopBoxesHeight + maxChartAreaHeight
  37642. };
  37643. // Step 9
  37644. helpers.each(chartAreaBoxes, function(box) {
  37645. box.left = chartInstance.chartArea.left;
  37646. box.top = chartInstance.chartArea.top;
  37647. box.right = chartInstance.chartArea.right;
  37648. box.bottom = chartInstance.chartArea.bottom;
  37649. box.update(maxChartAreaWidth, maxChartAreaHeight);
  37650. });
  37651. }
  37652. };
  37653. };
  37654. /***/ }),
  37655. /* 149 */
  37656. /***/ (function(module, exports, __webpack_require__) {
  37657. "use strict";
  37658. module.exports = function(Chart) {
  37659. var helpers = Chart.helpers;
  37660. var noop = helpers.noop;
  37661. Chart.defaults.global.legend = {
  37662. display: true,
  37663. position: 'top',
  37664. fullWidth: true, // marks that this box should take the full width of the canvas (pushing down other boxes)
  37665. reverse: false,
  37666. // a callback that will handle
  37667. onClick: function(e, legendItem) {
  37668. var index = legendItem.datasetIndex;
  37669. var ci = this.chart;
  37670. var meta = ci.getDatasetMeta(index);
  37671. // See controller.isDatasetVisible comment
  37672. meta.hidden = meta.hidden === null? !ci.data.datasets[index].hidden : null;
  37673. // We hid a dataset ... rerender the chart
  37674. ci.update();
  37675. },
  37676. onHover: null,
  37677. labels: {
  37678. boxWidth: 40,
  37679. padding: 10,
  37680. // Generates labels shown in the legend
  37681. // Valid properties to return:
  37682. // text : text to display
  37683. // fillStyle : fill of coloured box
  37684. // strokeStyle: stroke of coloured box
  37685. // hidden : if this legend item refers to a hidden item
  37686. // lineCap : cap style for line
  37687. // lineDash
  37688. // lineDashOffset :
  37689. // lineJoin :
  37690. // lineWidth :
  37691. generateLabels: function(chart) {
  37692. var data = chart.data;
  37693. return helpers.isArray(data.datasets) ? data.datasets.map(function(dataset, i) {
  37694. return {
  37695. text: dataset.label,
  37696. fillStyle: (!helpers.isArray(dataset.backgroundColor) ? dataset.backgroundColor : dataset.backgroundColor[0]),
  37697. hidden: !chart.isDatasetVisible(i),
  37698. lineCap: dataset.borderCapStyle,
  37699. lineDash: dataset.borderDash,
  37700. lineDashOffset: dataset.borderDashOffset,
  37701. lineJoin: dataset.borderJoinStyle,
  37702. lineWidth: dataset.borderWidth,
  37703. strokeStyle: dataset.borderColor,
  37704. pointStyle: dataset.pointStyle,
  37705. // Below is extra data used for toggling the datasets
  37706. datasetIndex: i
  37707. };
  37708. }, this) : [];
  37709. }
  37710. }
  37711. };
  37712. /**
  37713. * Helper function to get the box width based on the usePointStyle option
  37714. * @param labelopts {Object} the label options on the legend
  37715. * @param fontSize {Number} the label font size
  37716. * @return {Number} width of the color box area
  37717. */
  37718. function getBoxWidth(labelOpts, fontSize) {
  37719. return labelOpts.usePointStyle ?
  37720. fontSize * Math.SQRT2 :
  37721. labelOpts.boxWidth;
  37722. }
  37723. Chart.Legend = Chart.Element.extend({
  37724. initialize: function(config) {
  37725. helpers.extend(this, config);
  37726. // Contains hit boxes for each dataset (in dataset order)
  37727. this.legendHitBoxes = [];
  37728. // Are we in doughnut mode which has a different data type
  37729. this.doughnutMode = false;
  37730. },
  37731. // These methods are ordered by lifecycle. Utilities then follow.
  37732. // Any function defined here is inherited by all legend types.
  37733. // Any function can be extended by the legend type
  37734. beforeUpdate: noop,
  37735. update: function(maxWidth, maxHeight, margins) {
  37736. var me = this;
  37737. // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)
  37738. me.beforeUpdate();
  37739. // Absorb the master measurements
  37740. me.maxWidth = maxWidth;
  37741. me.maxHeight = maxHeight;
  37742. me.margins = margins;
  37743. // Dimensions
  37744. me.beforeSetDimensions();
  37745. me.setDimensions();
  37746. me.afterSetDimensions();
  37747. // Labels
  37748. me.beforeBuildLabels();
  37749. me.buildLabels();
  37750. me.afterBuildLabels();
  37751. // Fit
  37752. me.beforeFit();
  37753. me.fit();
  37754. me.afterFit();
  37755. //
  37756. me.afterUpdate();
  37757. return me.minSize;
  37758. },
  37759. afterUpdate: noop,
  37760. //
  37761. beforeSetDimensions: noop,
  37762. setDimensions: function() {
  37763. var me = this;
  37764. // Set the unconstrained dimension before label rotation
  37765. if (me.isHorizontal()) {
  37766. // Reset position before calculating rotation
  37767. me.width = me.maxWidth;
  37768. me.left = 0;
  37769. me.right = me.width;
  37770. } else {
  37771. me.height = me.maxHeight;
  37772. // Reset position before calculating rotation
  37773. me.top = 0;
  37774. me.bottom = me.height;
  37775. }
  37776. // Reset padding
  37777. me.paddingLeft = 0;
  37778. me.paddingTop = 0;
  37779. me.paddingRight = 0;
  37780. me.paddingBottom = 0;
  37781. // Reset minSize
  37782. me.minSize = {
  37783. width: 0,
  37784. height: 0
  37785. };
  37786. },
  37787. afterSetDimensions: noop,
  37788. //
  37789. beforeBuildLabels: noop,
  37790. buildLabels: function() {
  37791. var me = this;
  37792. var labelOpts = me.options.labels;
  37793. var legendItems = labelOpts.generateLabels.call(me, me.chart);
  37794. if (labelOpts.filter) {
  37795. legendItems = legendItems.filter(function(item) {
  37796. return labelOpts.filter(item, me.chart.data);
  37797. });
  37798. }
  37799. if (me.options.reverse) {
  37800. legendItems.reverse();
  37801. }
  37802. me.legendItems = legendItems;
  37803. },
  37804. afterBuildLabels: noop,
  37805. //
  37806. beforeFit: noop,
  37807. fit: function() {
  37808. var me = this;
  37809. var opts = me.options;
  37810. var labelOpts = opts.labels;
  37811. var display = opts.display;
  37812. var ctx = me.ctx;
  37813. var globalDefault = Chart.defaults.global,
  37814. itemOrDefault = helpers.getValueOrDefault,
  37815. fontSize = itemOrDefault(labelOpts.fontSize, globalDefault.defaultFontSize),
  37816. fontStyle = itemOrDefault(labelOpts.fontStyle, globalDefault.defaultFontStyle),
  37817. fontFamily = itemOrDefault(labelOpts.fontFamily, globalDefault.defaultFontFamily),
  37818. labelFont = helpers.fontString(fontSize, fontStyle, fontFamily);
  37819. // Reset hit boxes
  37820. var hitboxes = me.legendHitBoxes = [];
  37821. var minSize = me.minSize;
  37822. var isHorizontal = me.isHorizontal();
  37823. if (isHorizontal) {
  37824. minSize.width = me.maxWidth; // fill all the width
  37825. minSize.height = display ? 10 : 0;
  37826. } else {
  37827. minSize.width = display ? 10 : 0;
  37828. minSize.height = me.maxHeight; // fill all the height
  37829. }
  37830. // Increase sizes here
  37831. if (display) {
  37832. ctx.font = labelFont;
  37833. if (isHorizontal) {
  37834. // Labels
  37835. // Width of each line of legend boxes. Labels wrap onto multiple lines when there are too many to fit on one
  37836. var lineWidths = me.lineWidths = [0];
  37837. var totalHeight = me.legendItems.length ? fontSize + (labelOpts.padding) : 0;
  37838. ctx.textAlign = 'left';
  37839. ctx.textBaseline = 'top';
  37840. helpers.each(me.legendItems, function(legendItem, i) {
  37841. var boxWidth = getBoxWidth(labelOpts, fontSize);
  37842. var width = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;
  37843. if (lineWidths[lineWidths.length - 1] + width + labelOpts.padding >= me.width) {
  37844. totalHeight += fontSize + (labelOpts.padding);
  37845. lineWidths[lineWidths.length] = me.left;
  37846. }
  37847. // Store the hitbox width and height here. Final position will be updated in `draw`
  37848. hitboxes[i] = {
  37849. left: 0,
  37850. top: 0,
  37851. width: width,
  37852. height: fontSize
  37853. };
  37854. lineWidths[lineWidths.length - 1] += width + labelOpts.padding;
  37855. });
  37856. minSize.height += totalHeight;
  37857. } else {
  37858. var vPadding = labelOpts.padding;
  37859. var columnWidths = me.columnWidths = [];
  37860. var totalWidth = labelOpts.padding;
  37861. var currentColWidth = 0;
  37862. var currentColHeight = 0;
  37863. var itemHeight = fontSize + vPadding;
  37864. helpers.each(me.legendItems, function(legendItem, i) {
  37865. var boxWidth = getBoxWidth(labelOpts, fontSize);
  37866. var itemWidth = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;
  37867. // If too tall, go to new column
  37868. if (currentColHeight + itemHeight > minSize.height) {
  37869. totalWidth += currentColWidth + labelOpts.padding;
  37870. columnWidths.push(currentColWidth); // previous column width
  37871. currentColWidth = 0;
  37872. currentColHeight = 0;
  37873. }
  37874. // Get max width
  37875. currentColWidth = Math.max(currentColWidth, itemWidth);
  37876. currentColHeight += itemHeight;
  37877. // Store the hitbox width and height here. Final position will be updated in `draw`
  37878. hitboxes[i] = {
  37879. left: 0,
  37880. top: 0,
  37881. width: itemWidth,
  37882. height: fontSize
  37883. };
  37884. });
  37885. totalWidth += currentColWidth;
  37886. columnWidths.push(currentColWidth);
  37887. minSize.width += totalWidth;
  37888. }
  37889. }
  37890. me.width = minSize.width;
  37891. me.height = minSize.height;
  37892. },
  37893. afterFit: noop,
  37894. // Shared Methods
  37895. isHorizontal: function() {
  37896. return this.options.position === 'top' || this.options.position === 'bottom';
  37897. },
  37898. // Actually draw the legend on the canvas
  37899. draw: function() {
  37900. var me = this;
  37901. var opts = me.options;
  37902. var labelOpts = opts.labels;
  37903. var globalDefault = Chart.defaults.global,
  37904. lineDefault = globalDefault.elements.line,
  37905. legendWidth = me.width,
  37906. lineWidths = me.lineWidths;
  37907. if (opts.display) {
  37908. var ctx = me.ctx,
  37909. cursor,
  37910. itemOrDefault = helpers.getValueOrDefault,
  37911. fontColor = itemOrDefault(labelOpts.fontColor, globalDefault.defaultFontColor),
  37912. fontSize = itemOrDefault(labelOpts.fontSize, globalDefault.defaultFontSize),
  37913. fontStyle = itemOrDefault(labelOpts.fontStyle, globalDefault.defaultFontStyle),
  37914. fontFamily = itemOrDefault(labelOpts.fontFamily, globalDefault.defaultFontFamily),
  37915. labelFont = helpers.fontString(fontSize, fontStyle, fontFamily);
  37916. // Canvas setup
  37917. ctx.textAlign = 'left';
  37918. ctx.textBaseline = 'top';
  37919. ctx.lineWidth = 0.5;
  37920. ctx.strokeStyle = fontColor; // for strikethrough effect
  37921. ctx.fillStyle = fontColor; // render in correct colour
  37922. ctx.font = labelFont;
  37923. var boxWidth = getBoxWidth(labelOpts, fontSize),
  37924. hitboxes = me.legendHitBoxes;
  37925. // current position
  37926. var drawLegendBox = function(x, y, legendItem) {
  37927. if (isNaN(boxWidth) || boxWidth <= 0) {
  37928. return;
  37929. }
  37930. // Set the ctx for the box
  37931. ctx.save();
  37932. ctx.fillStyle = itemOrDefault(legendItem.fillStyle, globalDefault.defaultColor);
  37933. ctx.lineCap = itemOrDefault(legendItem.lineCap, lineDefault.borderCapStyle);
  37934. ctx.lineDashOffset = itemOrDefault(legendItem.lineDashOffset, lineDefault.borderDashOffset);
  37935. ctx.lineJoin = itemOrDefault(legendItem.lineJoin, lineDefault.borderJoinStyle);
  37936. ctx.lineWidth = itemOrDefault(legendItem.lineWidth, lineDefault.borderWidth);
  37937. ctx.strokeStyle = itemOrDefault(legendItem.strokeStyle, globalDefault.defaultColor);
  37938. var isLineWidthZero = (itemOrDefault(legendItem.lineWidth, lineDefault.borderWidth) === 0);
  37939. if (ctx.setLineDash) {
  37940. // IE 9 and 10 do not support line dash
  37941. ctx.setLineDash(itemOrDefault(legendItem.lineDash, lineDefault.borderDash));
  37942. }
  37943. if (opts.labels && opts.labels.usePointStyle) {
  37944. // Recalculate x and y for drawPoint() because its expecting
  37945. // x and y to be center of figure (instead of top left)
  37946. var radius = fontSize * Math.SQRT2 / 2;
  37947. var offSet = radius / Math.SQRT2;
  37948. var centerX = x + offSet;
  37949. var centerY = y + offSet;
  37950. // Draw pointStyle as legend symbol
  37951. Chart.canvasHelpers.drawPoint(ctx, legendItem.pointStyle, radius, centerX, centerY);
  37952. } else {
  37953. // Draw box as legend symbol
  37954. if (!isLineWidthZero) {
  37955. ctx.strokeRect(x, y, boxWidth, fontSize);
  37956. }
  37957. ctx.fillRect(x, y, boxWidth, fontSize);
  37958. }
  37959. ctx.restore();
  37960. };
  37961. var fillText = function(x, y, legendItem, textWidth) {
  37962. ctx.fillText(legendItem.text, boxWidth + (fontSize / 2) + x, y);
  37963. if (legendItem.hidden) {
  37964. // Strikethrough the text if hidden
  37965. ctx.beginPath();
  37966. ctx.lineWidth = 2;
  37967. ctx.moveTo(boxWidth + (fontSize / 2) + x, y + (fontSize / 2));
  37968. ctx.lineTo(boxWidth + (fontSize / 2) + x + textWidth, y + (fontSize / 2));
  37969. ctx.stroke();
  37970. }
  37971. };
  37972. // Horizontal
  37973. var isHorizontal = me.isHorizontal();
  37974. if (isHorizontal) {
  37975. cursor = {
  37976. x: me.left + ((legendWidth - lineWidths[0]) / 2),
  37977. y: me.top + labelOpts.padding,
  37978. line: 0
  37979. };
  37980. } else {
  37981. cursor = {
  37982. x: me.left + labelOpts.padding,
  37983. y: me.top + labelOpts.padding,
  37984. line: 0
  37985. };
  37986. }
  37987. var itemHeight = fontSize + labelOpts.padding;
  37988. helpers.each(me.legendItems, function(legendItem, i) {
  37989. var textWidth = ctx.measureText(legendItem.text).width,
  37990. width = boxWidth + (fontSize / 2) + textWidth,
  37991. x = cursor.x,
  37992. y = cursor.y;
  37993. if (isHorizontal) {
  37994. if (x + width >= legendWidth) {
  37995. y = cursor.y += itemHeight;
  37996. cursor.line++;
  37997. x = cursor.x = me.left + ((legendWidth - lineWidths[cursor.line]) / 2);
  37998. }
  37999. } else if (y + itemHeight > me.bottom) {
  38000. x = cursor.x = x + me.columnWidths[cursor.line] + labelOpts.padding;
  38001. y = cursor.y = me.top + labelOpts.padding;
  38002. cursor.line++;
  38003. }
  38004. drawLegendBox(x, y, legendItem);
  38005. hitboxes[i].left = x;
  38006. hitboxes[i].top = y;
  38007. // Fill the actual label
  38008. fillText(x, y, legendItem, textWidth);
  38009. if (isHorizontal) {
  38010. cursor.x += width + (labelOpts.padding);
  38011. } else {
  38012. cursor.y += itemHeight;
  38013. }
  38014. });
  38015. }
  38016. },
  38017. /**
  38018. * Handle an event
  38019. * @private
  38020. * @param {IEvent} event - The event to handle
  38021. * @return {Boolean} true if a change occured
  38022. */
  38023. handleEvent: function(e) {
  38024. var me = this;
  38025. var opts = me.options;
  38026. var type = e.type === 'mouseup' ? 'click' : e.type;
  38027. var changed = false;
  38028. if (type === 'mousemove') {
  38029. if (!opts.onHover) {
  38030. return;
  38031. }
  38032. } else if (type === 'click') {
  38033. if (!opts.onClick) {
  38034. return;
  38035. }
  38036. } else {
  38037. return;
  38038. }
  38039. // Chart event already has relative position in it
  38040. var x = e.x,
  38041. y = e.y;
  38042. if (x >= me.left && x <= me.right && y >= me.top && y <= me.bottom) {
  38043. // See if we are touching one of the dataset boxes
  38044. var lh = me.legendHitBoxes;
  38045. for (var i = 0; i < lh.length; ++i) {
  38046. var hitBox = lh[i];
  38047. if (x >= hitBox.left && x <= hitBox.left + hitBox.width && y >= hitBox.top && y <= hitBox.top + hitBox.height) {
  38048. // Touching an element
  38049. if (type === 'click') {
  38050. // use e.native for backwards compatibility
  38051. opts.onClick.call(me, e.native, me.legendItems[i]);
  38052. changed = true;
  38053. break;
  38054. } else if (type === 'mousemove') {
  38055. // use e.native for backwards compatibility
  38056. opts.onHover.call(me, e.native, me.legendItems[i]);
  38057. changed = true;
  38058. break;
  38059. }
  38060. }
  38061. }
  38062. }
  38063. return changed;
  38064. }
  38065. });
  38066. function createNewLegendAndAttach(chartInstance, legendOpts) {
  38067. var legend = new Chart.Legend({
  38068. ctx: chartInstance.chart.ctx,
  38069. options: legendOpts,
  38070. chart: chartInstance
  38071. });
  38072. chartInstance.legend = legend;
  38073. Chart.layoutService.addBox(chartInstance, legend);
  38074. }
  38075. // Register the legend plugin
  38076. Chart.plugins.register({
  38077. beforeInit: function(chartInstance) {
  38078. var legendOpts = chartInstance.options.legend;
  38079. if (legendOpts) {
  38080. createNewLegendAndAttach(chartInstance, legendOpts);
  38081. }
  38082. },
  38083. beforeUpdate: function(chartInstance) {
  38084. var legendOpts = chartInstance.options.legend;
  38085. if (legendOpts) {
  38086. legendOpts = helpers.configMerge(Chart.defaults.global.legend, legendOpts);
  38087. if (chartInstance.legend) {
  38088. chartInstance.legend.options = legendOpts;
  38089. } else {
  38090. createNewLegendAndAttach(chartInstance, legendOpts);
  38091. }
  38092. } else {
  38093. Chart.layoutService.removeBox(chartInstance, chartInstance.legend);
  38094. delete chartInstance.legend;
  38095. }
  38096. },
  38097. afterEvent: function(chartInstance, e) {
  38098. var legend = chartInstance.legend;
  38099. if (legend) {
  38100. legend.handleEvent(e);
  38101. }
  38102. }
  38103. });
  38104. };
  38105. /***/ }),
  38106. /* 150 */
  38107. /***/ (function(module, exports, __webpack_require__) {
  38108. "use strict";
  38109. module.exports = function(Chart) {
  38110. var helpers = Chart.helpers;
  38111. Chart.defaults.global.plugins = {};
  38112. /**
  38113. * The plugin service singleton
  38114. * @namespace Chart.plugins
  38115. * @since 2.1.0
  38116. */
  38117. Chart.plugins = {
  38118. /**
  38119. * Globally registered plugins.
  38120. * @private
  38121. */
  38122. _plugins: [],
  38123. /**
  38124. * This identifier is used to invalidate the descriptors cache attached to each chart
  38125. * when a global plugin is registered or unregistered. In this case, the cache ID is
  38126. * incremented and descriptors are regenerated during following API calls.
  38127. * @private
  38128. */
  38129. _cacheId: 0,
  38130. /**
  38131. * Registers the given plugin(s) if not already registered.
  38132. * @param {Array|Object} plugins plugin instance(s).
  38133. */
  38134. register: function(plugins) {
  38135. var p = this._plugins;
  38136. ([]).concat(plugins).forEach(function(plugin) {
  38137. if (p.indexOf(plugin) === -1) {
  38138. p.push(plugin);
  38139. }
  38140. });
  38141. this._cacheId++;
  38142. },
  38143. /**
  38144. * Unregisters the given plugin(s) only if registered.
  38145. * @param {Array|Object} plugins plugin instance(s).
  38146. */
  38147. unregister: function(plugins) {
  38148. var p = this._plugins;
  38149. ([]).concat(plugins).forEach(function(plugin) {
  38150. var idx = p.indexOf(plugin);
  38151. if (idx !== -1) {
  38152. p.splice(idx, 1);
  38153. }
  38154. });
  38155. this._cacheId++;
  38156. },
  38157. /**
  38158. * Remove all registered plugins.
  38159. * @since 2.1.5
  38160. */
  38161. clear: function() {
  38162. this._plugins = [];
  38163. this._cacheId++;
  38164. },
  38165. /**
  38166. * Returns the number of registered plugins?
  38167. * @returns {Number}
  38168. * @since 2.1.5
  38169. */
  38170. count: function() {
  38171. return this._plugins.length;
  38172. },
  38173. /**
  38174. * Returns all registered plugin instances.
  38175. * @returns {Array} array of plugin objects.
  38176. * @since 2.1.5
  38177. */
  38178. getAll: function() {
  38179. return this._plugins;
  38180. },
  38181. /**
  38182. * Calls enabled plugins for `chart` on the specified hook and with the given args.
  38183. * This method immediately returns as soon as a plugin explicitly returns false. The
  38184. * returned value can be used, for instance, to interrupt the current action.
  38185. * @param {Object} chart - The chart instance for which plugins should be called.
  38186. * @param {String} hook - The name of the plugin method to call (e.g. 'beforeUpdate').
  38187. * @param {Array} [args] - Extra arguments to apply to the hook call.
  38188. * @returns {Boolean} false if any of the plugins return false, else returns true.
  38189. */
  38190. notify: function(chart, hook, args) {
  38191. var descriptors = this.descriptors(chart);
  38192. var ilen = descriptors.length;
  38193. var i, descriptor, plugin, params, method;
  38194. for (i=0; i<ilen; ++i) {
  38195. descriptor = descriptors[i];
  38196. plugin = descriptor.plugin;
  38197. method = plugin[hook];
  38198. if (typeof method === 'function') {
  38199. params = [chart].concat(args || []);
  38200. params.push(descriptor.options);
  38201. if (method.apply(plugin, params) === false) {
  38202. return false;
  38203. }
  38204. }
  38205. }
  38206. return true;
  38207. },
  38208. /**
  38209. * Returns descriptors of enabled plugins for the given chart.
  38210. * @returns {Array} [{ plugin, options }]
  38211. * @private
  38212. */
  38213. descriptors: function(chart) {
  38214. var cache = chart._plugins || (chart._plugins = {});
  38215. if (cache.id === this._cacheId) {
  38216. return cache.descriptors;
  38217. }
  38218. var plugins = [];
  38219. var descriptors = [];
  38220. var config = (chart && chart.config) || {};
  38221. var defaults = Chart.defaults.global.plugins;
  38222. var options = (config.options && config.options.plugins) || {};
  38223. this._plugins.concat(config.plugins || []).forEach(function(plugin) {
  38224. var idx = plugins.indexOf(plugin);
  38225. if (idx !== -1) {
  38226. return;
  38227. }
  38228. var id = plugin.id;
  38229. var opts = options[id];
  38230. if (opts === false) {
  38231. return;
  38232. }
  38233. if (opts === true) {
  38234. opts = helpers.clone(defaults[id]);
  38235. }
  38236. plugins.push(plugin);
  38237. descriptors.push({
  38238. plugin: plugin,
  38239. options: opts || {}
  38240. });
  38241. });
  38242. cache.descriptors = descriptors;
  38243. cache.id = this._cacheId;
  38244. return descriptors;
  38245. }
  38246. };
  38247. /**
  38248. * Plugin extension hooks.
  38249. * @interface IPlugin
  38250. * @since 2.1.0
  38251. */
  38252. /**
  38253. * @method IPlugin#beforeInit
  38254. * @desc Called before initializing `chart`.
  38255. * @param {Chart.Controller} chart - The chart instance.
  38256. * @param {Object} options - The plugin options.
  38257. */
  38258. /**
  38259. * @method IPlugin#afterInit
  38260. * @desc Called after `chart` has been initialized and before the first update.
  38261. * @param {Chart.Controller} chart - The chart instance.
  38262. * @param {Object} options - The plugin options.
  38263. */
  38264. /**
  38265. * @method IPlugin#beforeUpdate
  38266. * @desc Called before updating `chart`. If any plugin returns `false`, the update
  38267. * is cancelled (and thus subsequent render(s)) until another `update` is triggered.
  38268. * @param {Chart.Controller} chart - The chart instance.
  38269. * @param {Object} options - The plugin options.
  38270. * @returns {Boolean} `false` to cancel the chart update.
  38271. */
  38272. /**
  38273. * @method IPlugin#afterUpdate
  38274. * @desc Called after `chart` has been updated and before rendering. Note that this
  38275. * hook will not be called if the chart update has been previously cancelled.
  38276. * @param {Chart.Controller} chart - The chart instance.
  38277. * @param {Object} options - The plugin options.
  38278. */
  38279. /**
  38280. * @method IPlugin#beforeDatasetsUpdate
  38281. * @desc Called before updating the `chart` datasets. If any plugin returns `false`,
  38282. * the datasets update is cancelled until another `update` is triggered.
  38283. * @param {Chart.Controller} chart - The chart instance.
  38284. * @param {Object} options - The plugin options.
  38285. * @returns {Boolean} false to cancel the datasets update.
  38286. * @since version 2.1.5
  38287. */
  38288. /**
  38289. * @method IPlugin#afterDatasetsUpdate
  38290. * @desc Called after the `chart` datasets have been updated. Note that this hook
  38291. * will not be called if the datasets update has been previously cancelled.
  38292. * @param {Chart.Controller} chart - The chart instance.
  38293. * @param {Object} options - The plugin options.
  38294. * @since version 2.1.5
  38295. */
  38296. /**
  38297. * @method IPlugin#beforeLayout
  38298. * @desc Called before laying out `chart`. If any plugin returns `false`,
  38299. * the layout update is cancelled until another `update` is triggered.
  38300. * @param {Chart.Controller} chart - The chart instance.
  38301. * @param {Object} options - The plugin options.
  38302. * @returns {Boolean} `false` to cancel the chart layout.
  38303. */
  38304. /**
  38305. * @method IPlugin#afterLayout
  38306. * @desc Called after the `chart` has been layed out. Note that this hook will not
  38307. * be called if the layout update has been previously cancelled.
  38308. * @param {Chart.Controller} chart - The chart instance.
  38309. * @param {Object} options - The plugin options.
  38310. */
  38311. /**
  38312. * @method IPlugin#beforeRender
  38313. * @desc Called before rendering `chart`. If any plugin returns `false`,
  38314. * the rendering is cancelled until another `render` is triggered.
  38315. * @param {Chart.Controller} chart - The chart instance.
  38316. * @param {Object} options - The plugin options.
  38317. * @returns {Boolean} `false` to cancel the chart rendering.
  38318. */
  38319. /**
  38320. * @method IPlugin#afterRender
  38321. * @desc Called after the `chart` has been fully rendered (and animation completed). Note
  38322. * that this hook will not be called if the rendering has been previously cancelled.
  38323. * @param {Chart.Controller} chart - The chart instance.
  38324. * @param {Object} options - The plugin options.
  38325. */
  38326. /**
  38327. * @method IPlugin#beforeDraw
  38328. * @desc Called before drawing `chart` at every animation frame specified by the given
  38329. * easing value. If any plugin returns `false`, the frame drawing is cancelled until
  38330. * another `render` is triggered.
  38331. * @param {Chart.Controller} chart - The chart instance.
  38332. * @param {Number} easingValue - The current animation value, between 0.0 and 1.0.
  38333. * @param {Object} options - The plugin options.
  38334. * @returns {Boolean} `false` to cancel the chart drawing.
  38335. */
  38336. /**
  38337. * @method IPlugin#afterDraw
  38338. * @desc Called after the `chart` has been drawn for the specific easing value. Note
  38339. * that this hook will not be called if the drawing has been previously cancelled.
  38340. * @param {Chart.Controller} chart - The chart instance.
  38341. * @param {Number} easingValue - The current animation value, between 0.0 and 1.0.
  38342. * @param {Object} options - The plugin options.
  38343. */
  38344. /**
  38345. * @method IPlugin#beforeDatasetsDraw
  38346. * @desc Called before drawing the `chart` datasets. If any plugin returns `false`,
  38347. * the datasets drawing is cancelled until another `render` is triggered.
  38348. * @param {Chart.Controller} chart - The chart instance.
  38349. * @param {Number} easingValue - The current animation value, between 0.0 and 1.0.
  38350. * @param {Object} options - The plugin options.
  38351. * @returns {Boolean} `false` to cancel the chart datasets drawing.
  38352. */
  38353. /**
  38354. * @method IPlugin#afterDatasetsDraw
  38355. * @desc Called after the `chart` datasets have been drawn. Note that this hook
  38356. * will not be called if the datasets drawing has been previously cancelled.
  38357. * @param {Chart.Controller} chart - The chart instance.
  38358. * @param {Number} easingValue - The current animation value, between 0.0 and 1.0.
  38359. * @param {Object} options - The plugin options.
  38360. */
  38361. /**
  38362. * @method IPlugin#beforeEvent
  38363. * @desc Called before processing the specified `event`. If any plugin returns `false`,
  38364. * the event will be discarded.
  38365. * @param {Chart.Controller} chart - The chart instance.
  38366. * @param {IEvent} event - The event object.
  38367. * @param {Object} options - The plugin options.
  38368. */
  38369. /**
  38370. * @method IPlugin#afterEvent
  38371. * @desc Called after the `event` has been consumed. Note that this hook
  38372. * will not be called if the `event` has been previously discarded.
  38373. * @param {Chart.Controller} chart - The chart instance.
  38374. * @param {IEvent} event - The event object.
  38375. * @param {Object} options - The plugin options.
  38376. */
  38377. /**
  38378. * @method IPlugin#resize
  38379. * @desc Called after the chart as been resized.
  38380. * @param {Chart.Controller} chart - The chart instance.
  38381. * @param {Number} size - The new canvas display size (eq. canvas.style width & height).
  38382. * @param {Object} options - The plugin options.
  38383. */
  38384. /**
  38385. * @method IPlugin#destroy
  38386. * @desc Called after the chart as been destroyed.
  38387. * @param {Chart.Controller} chart - The chart instance.
  38388. * @param {Object} options - The plugin options.
  38389. */
  38390. /**
  38391. * Provided for backward compatibility, use Chart.plugins instead
  38392. * @namespace Chart.pluginService
  38393. * @deprecated since version 2.1.5
  38394. * @todo remove at version 3
  38395. * @private
  38396. */
  38397. Chart.pluginService = Chart.plugins;
  38398. /**
  38399. * Provided for backward compatibility, inheriting from Chart.PlugingBase has no
  38400. * effect, instead simply create/register plugins via plain JavaScript objects.
  38401. * @interface Chart.PluginBase
  38402. * @deprecated since version 2.5.0
  38403. * @todo remove at version 3
  38404. * @private
  38405. */
  38406. Chart.PluginBase = helpers.inherits({});
  38407. };
  38408. /***/ }),
  38409. /* 151 */
  38410. /***/ (function(module, exports, __webpack_require__) {
  38411. "use strict";
  38412. module.exports = function(Chart) {
  38413. var helpers = Chart.helpers;
  38414. Chart.defaults.scale = {
  38415. display: true,
  38416. position: 'left',
  38417. // grid line settings
  38418. gridLines: {
  38419. display: true,
  38420. color: 'rgba(0, 0, 0, 0.1)',
  38421. lineWidth: 1,
  38422. drawBorder: true,
  38423. drawOnChartArea: true,
  38424. drawTicks: true,
  38425. tickMarkLength: 10,
  38426. zeroLineWidth: 1,
  38427. zeroLineColor: 'rgba(0,0,0,0.25)',
  38428. offsetGridLines: false,
  38429. borderDash: [],
  38430. borderDashOffset: 0.0
  38431. },
  38432. // scale label
  38433. scaleLabel: {
  38434. // actual label
  38435. labelString: '',
  38436. // display property
  38437. display: false
  38438. },
  38439. // label settings
  38440. ticks: {
  38441. beginAtZero: false,
  38442. minRotation: 0,
  38443. maxRotation: 50,
  38444. mirror: false,
  38445. padding: 0,
  38446. reverse: false,
  38447. display: true,
  38448. autoSkip: true,
  38449. autoSkipPadding: 0,
  38450. labelOffset: 0,
  38451. // We pass through arrays to be rendered as multiline labels, we convert Others to strings here.
  38452. callback: Chart.Ticks.formatters.values
  38453. }
  38454. };
  38455. function computeTextSize(context, tick, font) {
  38456. return helpers.isArray(tick) ?
  38457. helpers.longestText(context, font, tick) :
  38458. context.measureText(tick).width;
  38459. }
  38460. function parseFontOptions(options) {
  38461. var getValueOrDefault = helpers.getValueOrDefault;
  38462. var globalDefaults = Chart.defaults.global;
  38463. var size = getValueOrDefault(options.fontSize, globalDefaults.defaultFontSize);
  38464. var style = getValueOrDefault(options.fontStyle, globalDefaults.defaultFontStyle);
  38465. var family = getValueOrDefault(options.fontFamily, globalDefaults.defaultFontFamily);
  38466. return {
  38467. size: size,
  38468. style: style,
  38469. family: family,
  38470. font: helpers.fontString(size, style, family)
  38471. };
  38472. }
  38473. Chart.Scale = Chart.Element.extend({
  38474. /**
  38475. * Get the padding needed for the scale
  38476. * @method getPadding
  38477. * @private
  38478. * @returns {Padding} the necessary padding
  38479. */
  38480. getPadding: function() {
  38481. var me = this;
  38482. return {
  38483. left: me.paddingLeft || 0,
  38484. top: me.paddingTop || 0,
  38485. right: me.paddingRight || 0,
  38486. bottom: me.paddingBottom || 0
  38487. };
  38488. },
  38489. // These methods are ordered by lifecyle. Utilities then follow.
  38490. // Any function defined here is inherited by all scale types.
  38491. // Any function can be extended by the scale type
  38492. beforeUpdate: function() {
  38493. helpers.callCallback(this.options.beforeUpdate, [this]);
  38494. },
  38495. update: function(maxWidth, maxHeight, margins) {
  38496. var me = this;
  38497. // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)
  38498. me.beforeUpdate();
  38499. // Absorb the master measurements
  38500. me.maxWidth = maxWidth;
  38501. me.maxHeight = maxHeight;
  38502. me.margins = helpers.extend({
  38503. left: 0,
  38504. right: 0,
  38505. top: 0,
  38506. bottom: 0
  38507. }, margins);
  38508. me.longestTextCache = me.longestTextCache || {};
  38509. // Dimensions
  38510. me.beforeSetDimensions();
  38511. me.setDimensions();
  38512. me.afterSetDimensions();
  38513. // Data min/max
  38514. me.beforeDataLimits();
  38515. me.determineDataLimits();
  38516. me.afterDataLimits();
  38517. // Ticks
  38518. me.beforeBuildTicks();
  38519. me.buildTicks();
  38520. me.afterBuildTicks();
  38521. me.beforeTickToLabelConversion();
  38522. me.convertTicksToLabels();
  38523. me.afterTickToLabelConversion();
  38524. // Tick Rotation
  38525. me.beforeCalculateTickRotation();
  38526. me.calculateTickRotation();
  38527. me.afterCalculateTickRotation();
  38528. // Fit
  38529. me.beforeFit();
  38530. me.fit();
  38531. me.afterFit();
  38532. //
  38533. me.afterUpdate();
  38534. return me.minSize;
  38535. },
  38536. afterUpdate: function() {
  38537. helpers.callCallback(this.options.afterUpdate, [this]);
  38538. },
  38539. //
  38540. beforeSetDimensions: function() {
  38541. helpers.callCallback(this.options.beforeSetDimensions, [this]);
  38542. },
  38543. setDimensions: function() {
  38544. var me = this;
  38545. // Set the unconstrained dimension before label rotation
  38546. if (me.isHorizontal()) {
  38547. // Reset position before calculating rotation
  38548. me.width = me.maxWidth;
  38549. me.left = 0;
  38550. me.right = me.width;
  38551. } else {
  38552. me.height = me.maxHeight;
  38553. // Reset position before calculating rotation
  38554. me.top = 0;
  38555. me.bottom = me.height;
  38556. }
  38557. // Reset padding
  38558. me.paddingLeft = 0;
  38559. me.paddingTop = 0;
  38560. me.paddingRight = 0;
  38561. me.paddingBottom = 0;
  38562. },
  38563. afterSetDimensions: function() {
  38564. helpers.callCallback(this.options.afterSetDimensions, [this]);
  38565. },
  38566. // Data limits
  38567. beforeDataLimits: function() {
  38568. helpers.callCallback(this.options.beforeDataLimits, [this]);
  38569. },
  38570. determineDataLimits: helpers.noop,
  38571. afterDataLimits: function() {
  38572. helpers.callCallback(this.options.afterDataLimits, [this]);
  38573. },
  38574. //
  38575. beforeBuildTicks: function() {
  38576. helpers.callCallback(this.options.beforeBuildTicks, [this]);
  38577. },
  38578. buildTicks: helpers.noop,
  38579. afterBuildTicks: function() {
  38580. helpers.callCallback(this.options.afterBuildTicks, [this]);
  38581. },
  38582. beforeTickToLabelConversion: function() {
  38583. helpers.callCallback(this.options.beforeTickToLabelConversion, [this]);
  38584. },
  38585. convertTicksToLabels: function() {
  38586. var me = this;
  38587. // Convert ticks to strings
  38588. var tickOpts = me.options.ticks;
  38589. me.ticks = me.ticks.map(tickOpts.userCallback || tickOpts.callback);
  38590. },
  38591. afterTickToLabelConversion: function() {
  38592. helpers.callCallback(this.options.afterTickToLabelConversion, [this]);
  38593. },
  38594. //
  38595. beforeCalculateTickRotation: function() {
  38596. helpers.callCallback(this.options.beforeCalculateTickRotation, [this]);
  38597. },
  38598. calculateTickRotation: function() {
  38599. var me = this;
  38600. var context = me.ctx;
  38601. var tickOpts = me.options.ticks;
  38602. // Get the width of each grid by calculating the difference
  38603. // between x offsets between 0 and 1.
  38604. var tickFont = parseFontOptions(tickOpts);
  38605. context.font = tickFont.font;
  38606. var labelRotation = tickOpts.minRotation || 0;
  38607. if (me.options.display && me.isHorizontal()) {
  38608. var originalLabelWidth = helpers.longestText(context, tickFont.font, me.ticks, me.longestTextCache);
  38609. var labelWidth = originalLabelWidth;
  38610. var cosRotation;
  38611. var sinRotation;
  38612. // Allow 3 pixels x2 padding either side for label readability
  38613. var tickWidth = me.getPixelForTick(1) - me.getPixelForTick(0) - 6;
  38614. // Max label rotation can be set or default to 90 - also act as a loop counter
  38615. while (labelWidth > tickWidth && labelRotation < tickOpts.maxRotation) {
  38616. var angleRadians = helpers.toRadians(labelRotation);
  38617. cosRotation = Math.cos(angleRadians);
  38618. sinRotation = Math.sin(angleRadians);
  38619. if (sinRotation * originalLabelWidth > me.maxHeight) {
  38620. // go back one step
  38621. labelRotation--;
  38622. break;
  38623. }
  38624. labelRotation++;
  38625. labelWidth = cosRotation * originalLabelWidth;
  38626. }
  38627. }
  38628. me.labelRotation = labelRotation;
  38629. },
  38630. afterCalculateTickRotation: function() {
  38631. helpers.callCallback(this.options.afterCalculateTickRotation, [this]);
  38632. },
  38633. //
  38634. beforeFit: function() {
  38635. helpers.callCallback(this.options.beforeFit, [this]);
  38636. },
  38637. fit: function() {
  38638. var me = this;
  38639. // Reset
  38640. var minSize = me.minSize = {
  38641. width: 0,
  38642. height: 0
  38643. };
  38644. var opts = me.options;
  38645. var tickOpts = opts.ticks;
  38646. var scaleLabelOpts = opts.scaleLabel;
  38647. var gridLineOpts = opts.gridLines;
  38648. var display = opts.display;
  38649. var isHorizontal = me.isHorizontal();
  38650. var tickFont = parseFontOptions(tickOpts);
  38651. var scaleLabelFontSize = parseFontOptions(scaleLabelOpts).size * 1.5;
  38652. var tickMarkLength = opts.gridLines.tickMarkLength;
  38653. // Width
  38654. if (isHorizontal) {
  38655. // subtract the margins to line up with the chartArea if we are a full width scale
  38656. minSize.width = me.isFullWidth() ? me.maxWidth - me.margins.left - me.margins.right : me.maxWidth;
  38657. } else {
  38658. minSize.width = display && gridLineOpts.drawTicks ? tickMarkLength : 0;
  38659. }
  38660. // height
  38661. if (isHorizontal) {
  38662. minSize.height = display && gridLineOpts.drawTicks ? tickMarkLength : 0;
  38663. } else {
  38664. minSize.height = me.maxHeight; // fill all the height
  38665. }
  38666. // Are we showing a title for the scale?
  38667. if (scaleLabelOpts.display && display) {
  38668. if (isHorizontal) {
  38669. minSize.height += scaleLabelFontSize;
  38670. } else {
  38671. minSize.width += scaleLabelFontSize;
  38672. }
  38673. }
  38674. // Don't bother fitting the ticks if we are not showing them
  38675. if (tickOpts.display && display) {
  38676. var largestTextWidth = helpers.longestText(me.ctx, tickFont.font, me.ticks, me.longestTextCache);
  38677. var tallestLabelHeightInLines = helpers.numberOfLabelLines(me.ticks);
  38678. var lineSpace = tickFont.size * 0.5;
  38679. if (isHorizontal) {
  38680. // A horizontal axis is more constrained by the height.
  38681. me.longestLabelWidth = largestTextWidth;
  38682. var angleRadians = helpers.toRadians(me.labelRotation);
  38683. var cosRotation = Math.cos(angleRadians);
  38684. var sinRotation = Math.sin(angleRadians);
  38685. // TODO - improve this calculation
  38686. var labelHeight = (sinRotation * largestTextWidth)
  38687. + (tickFont.size * tallestLabelHeightInLines)
  38688. + (lineSpace * tallestLabelHeightInLines);
  38689. minSize.height = Math.min(me.maxHeight, minSize.height + labelHeight);
  38690. me.ctx.font = tickFont.font;
  38691. var firstTick = me.ticks[0];
  38692. var firstLabelWidth = computeTextSize(me.ctx, firstTick, tickFont.font);
  38693. var lastTick = me.ticks[me.ticks.length - 1];
  38694. var lastLabelWidth = computeTextSize(me.ctx, lastTick, tickFont.font);
  38695. // Ensure that our ticks are always inside the canvas. When rotated, ticks are right aligned which means that the right padding is dominated
  38696. // by the font height
  38697. if (me.labelRotation !== 0) {
  38698. me.paddingLeft = opts.position === 'bottom'? (cosRotation * firstLabelWidth) + 3: (cosRotation * lineSpace) + 3; // add 3 px to move away from canvas edges
  38699. me.paddingRight = opts.position === 'bottom'? (cosRotation * lineSpace) + 3: (cosRotation * lastLabelWidth) + 3;
  38700. } else {
  38701. me.paddingLeft = firstLabelWidth / 2 + 3; // add 3 px to move away from canvas edges
  38702. me.paddingRight = lastLabelWidth / 2 + 3;
  38703. }
  38704. } else {
  38705. // A vertical axis is more constrained by the width. Labels are the dominant factor here, so get that length first
  38706. // Account for padding
  38707. if (tickOpts.mirror) {
  38708. largestTextWidth = 0;
  38709. } else {
  38710. largestTextWidth += me.options.ticks.padding;
  38711. }
  38712. minSize.width += largestTextWidth;
  38713. me.paddingTop = tickFont.size / 2;
  38714. me.paddingBottom = tickFont.size / 2;
  38715. }
  38716. }
  38717. me.handleMargins();
  38718. me.width = minSize.width;
  38719. me.height = minSize.height;
  38720. },
  38721. /**
  38722. * Handle margins and padding interactions
  38723. * @private
  38724. */
  38725. handleMargins: function() {
  38726. var me = this;
  38727. if (me.margins) {
  38728. me.paddingLeft = Math.max(me.paddingLeft - me.margins.left, 0);
  38729. me.paddingTop = Math.max(me.paddingTop - me.margins.top, 0);
  38730. me.paddingRight = Math.max(me.paddingRight - me.margins.right, 0);
  38731. me.paddingBottom = Math.max(me.paddingBottom - me.margins.bottom, 0);
  38732. }
  38733. },
  38734. afterFit: function() {
  38735. helpers.callCallback(this.options.afterFit, [this]);
  38736. },
  38737. // Shared Methods
  38738. isHorizontal: function() {
  38739. return this.options.position === 'top' || this.options.position === 'bottom';
  38740. },
  38741. isFullWidth: function() {
  38742. return (this.options.fullWidth);
  38743. },
  38744. // Get the correct value. NaN bad inputs, If the value type is object get the x or y based on whether we are horizontal or not
  38745. getRightValue: function(rawValue) {
  38746. // Null and undefined values first
  38747. if (rawValue === null || typeof(rawValue) === 'undefined') {
  38748. return NaN;
  38749. }
  38750. // isNaN(object) returns true, so make sure NaN is checking for a number; Discard Infinite values
  38751. if (typeof(rawValue) === 'number' && !isFinite(rawValue)) {
  38752. return NaN;
  38753. }
  38754. // If it is in fact an object, dive in one more level
  38755. if (typeof(rawValue) === 'object') {
  38756. if ((rawValue instanceof Date) || (rawValue.isValid)) {
  38757. return rawValue;
  38758. }
  38759. return this.getRightValue(this.isHorizontal() ? rawValue.x : rawValue.y);
  38760. }
  38761. // Value is good, return it
  38762. return rawValue;
  38763. },
  38764. // Used to get the value to display in the tooltip for the data at the given index
  38765. // function getLabelForIndex(index, datasetIndex)
  38766. getLabelForIndex: helpers.noop,
  38767. // Used to get data value locations. Value can either be an index or a numerical value
  38768. getPixelForValue: helpers.noop,
  38769. // Used to get the data value from a given pixel. This is the inverse of getPixelForValue
  38770. getValueForPixel: helpers.noop,
  38771. // Used for tick location, should
  38772. getPixelForTick: function(index, includeOffset) {
  38773. var me = this;
  38774. if (me.isHorizontal()) {
  38775. var innerWidth = me.width - (me.paddingLeft + me.paddingRight);
  38776. var tickWidth = innerWidth / Math.max((me.ticks.length - ((me.options.gridLines.offsetGridLines) ? 0 : 1)), 1);
  38777. var pixel = (tickWidth * index) + me.paddingLeft;
  38778. if (includeOffset) {
  38779. pixel += tickWidth / 2;
  38780. }
  38781. var finalVal = me.left + Math.round(pixel);
  38782. finalVal += me.isFullWidth() ? me.margins.left : 0;
  38783. return finalVal;
  38784. }
  38785. var innerHeight = me.height - (me.paddingTop + me.paddingBottom);
  38786. return me.top + (index * (innerHeight / (me.ticks.length - 1)));
  38787. },
  38788. // Utility for getting the pixel location of a percentage of scale
  38789. getPixelForDecimal: function(decimal /* , includeOffset*/) {
  38790. var me = this;
  38791. if (me.isHorizontal()) {
  38792. var innerWidth = me.width - (me.paddingLeft + me.paddingRight);
  38793. var valueOffset = (innerWidth * decimal) + me.paddingLeft;
  38794. var finalVal = me.left + Math.round(valueOffset);
  38795. finalVal += me.isFullWidth() ? me.margins.left : 0;
  38796. return finalVal;
  38797. }
  38798. return me.top + (decimal * me.height);
  38799. },
  38800. getBasePixel: function() {
  38801. return this.getPixelForValue(this.getBaseValue());
  38802. },
  38803. getBaseValue: function() {
  38804. var me = this;
  38805. var min = me.min;
  38806. var max = me.max;
  38807. return me.beginAtZero ? 0:
  38808. min < 0 && max < 0? max :
  38809. min > 0 && max > 0? min :
  38810. 0;
  38811. },
  38812. // Actually draw the scale on the canvas
  38813. // @param {rectangle} chartArea : the area of the chart to draw full grid lines on
  38814. draw: function(chartArea) {
  38815. var me = this;
  38816. var options = me.options;
  38817. if (!options.display) {
  38818. return;
  38819. }
  38820. var context = me.ctx;
  38821. var globalDefaults = Chart.defaults.global;
  38822. var optionTicks = options.ticks;
  38823. var gridLines = options.gridLines;
  38824. var scaleLabel = options.scaleLabel;
  38825. var isRotated = me.labelRotation !== 0;
  38826. var skipRatio;
  38827. var useAutoskipper = optionTicks.autoSkip;
  38828. var isHorizontal = me.isHorizontal();
  38829. // figure out the maximum number of gridlines to show
  38830. var maxTicks;
  38831. if (optionTicks.maxTicksLimit) {
  38832. maxTicks = optionTicks.maxTicksLimit;
  38833. }
  38834. var tickFontColor = helpers.getValueOrDefault(optionTicks.fontColor, globalDefaults.defaultFontColor);
  38835. var tickFont = parseFontOptions(optionTicks);
  38836. var tl = gridLines.drawTicks ? gridLines.tickMarkLength : 0;
  38837. var borderDash = helpers.getValueOrDefault(gridLines.borderDash, globalDefaults.borderDash);
  38838. var borderDashOffset = helpers.getValueOrDefault(gridLines.borderDashOffset, globalDefaults.borderDashOffset);
  38839. var scaleLabelFontColor = helpers.getValueOrDefault(scaleLabel.fontColor, globalDefaults.defaultFontColor);
  38840. var scaleLabelFont = parseFontOptions(scaleLabel);
  38841. var labelRotationRadians = helpers.toRadians(me.labelRotation);
  38842. var cosRotation = Math.cos(labelRotationRadians);
  38843. var longestRotatedLabel = me.longestLabelWidth * cosRotation;
  38844. // Make sure we draw text in the correct color and font
  38845. context.fillStyle = tickFontColor;
  38846. var itemsToDraw = [];
  38847. if (isHorizontal) {
  38848. skipRatio = false;
  38849. // Only calculate the skip ratio with the half width of longestRotateLabel if we got an actual rotation
  38850. // See #2584
  38851. if (isRotated) {
  38852. longestRotatedLabel /= 2;
  38853. }
  38854. if ((longestRotatedLabel + optionTicks.autoSkipPadding) * me.ticks.length > (me.width - (me.paddingLeft + me.paddingRight))) {
  38855. skipRatio = 1 + Math.floor(((longestRotatedLabel + optionTicks.autoSkipPadding) * me.ticks.length) / (me.width - (me.paddingLeft + me.paddingRight)));
  38856. }
  38857. // if they defined a max number of optionTicks,
  38858. // increase skipRatio until that number is met
  38859. if (maxTicks && me.ticks.length > maxTicks) {
  38860. while (!skipRatio || me.ticks.length / (skipRatio || 1) > maxTicks) {
  38861. if (!skipRatio) {
  38862. skipRatio = 1;
  38863. }
  38864. skipRatio += 1;
  38865. }
  38866. }
  38867. if (!useAutoskipper) {
  38868. skipRatio = false;
  38869. }
  38870. }
  38871. var xTickStart = options.position === 'right' ? me.left : me.right - tl;
  38872. var xTickEnd = options.position === 'right' ? me.left + tl : me.right;
  38873. var yTickStart = options.position === 'bottom' ? me.top : me.bottom - tl;
  38874. var yTickEnd = options.position === 'bottom' ? me.top + tl : me.bottom;
  38875. helpers.each(me.ticks, function(label, index) {
  38876. // If the callback returned a null or undefined value, do not draw this line
  38877. if (label === undefined || label === null) {
  38878. return;
  38879. }
  38880. var isLastTick = me.ticks.length === index + 1;
  38881. // Since we always show the last tick,we need may need to hide the last shown one before
  38882. var shouldSkip = (skipRatio > 1 && index % skipRatio > 0) || (index % skipRatio === 0 && index + skipRatio >= me.ticks.length);
  38883. if (shouldSkip && !isLastTick || (label === undefined || label === null)) {
  38884. return;
  38885. }
  38886. var lineWidth, lineColor;
  38887. if (index === (typeof me.zeroLineIndex !== 'undefined' ? me.zeroLineIndex : 0)) {
  38888. // Draw the first index specially
  38889. lineWidth = gridLines.zeroLineWidth;
  38890. lineColor = gridLines.zeroLineColor;
  38891. } else {
  38892. lineWidth = helpers.getValueAtIndexOrDefault(gridLines.lineWidth, index);
  38893. lineColor = helpers.getValueAtIndexOrDefault(gridLines.color, index);
  38894. }
  38895. // Common properties
  38896. var tx1, ty1, tx2, ty2, x1, y1, x2, y2, labelX, labelY;
  38897. var textAlign = 'middle';
  38898. var textBaseline = 'middle';
  38899. if (isHorizontal) {
  38900. if (options.position === 'bottom') {
  38901. // bottom
  38902. textBaseline = !isRotated? 'top':'middle';
  38903. textAlign = !isRotated? 'center': 'right';
  38904. labelY = me.top + tl;
  38905. } else {
  38906. // top
  38907. textBaseline = !isRotated? 'bottom':'middle';
  38908. textAlign = !isRotated? 'center': 'left';
  38909. labelY = me.bottom - tl;
  38910. }
  38911. var xLineValue = me.getPixelForTick(index) + helpers.aliasPixel(lineWidth); // xvalues for grid lines
  38912. labelX = me.getPixelForTick(index, gridLines.offsetGridLines) + optionTicks.labelOffset; // x values for optionTicks (need to consider offsetLabel option)
  38913. tx1 = tx2 = x1 = x2 = xLineValue;
  38914. ty1 = yTickStart;
  38915. ty2 = yTickEnd;
  38916. y1 = chartArea.top;
  38917. y2 = chartArea.bottom;
  38918. } else {
  38919. var isLeft = options.position === 'left';
  38920. var tickPadding = optionTicks.padding;
  38921. var labelXOffset;
  38922. if (optionTicks.mirror) {
  38923. textAlign = isLeft ? 'left' : 'right';
  38924. labelXOffset = tickPadding;
  38925. } else {
  38926. textAlign = isLeft ? 'right' : 'left';
  38927. labelXOffset = tl + tickPadding;
  38928. }
  38929. labelX = isLeft ? me.right - labelXOffset : me.left + labelXOffset;
  38930. var yLineValue = me.getPixelForTick(index); // xvalues for grid lines
  38931. yLineValue += helpers.aliasPixel(lineWidth);
  38932. labelY = me.getPixelForTick(index, gridLines.offsetGridLines);
  38933. tx1 = xTickStart;
  38934. tx2 = xTickEnd;
  38935. x1 = chartArea.left;
  38936. x2 = chartArea.right;
  38937. ty1 = ty2 = y1 = y2 = yLineValue;
  38938. }
  38939. itemsToDraw.push({
  38940. tx1: tx1,
  38941. ty1: ty1,
  38942. tx2: tx2,
  38943. ty2: ty2,
  38944. x1: x1,
  38945. y1: y1,
  38946. x2: x2,
  38947. y2: y2,
  38948. labelX: labelX,
  38949. labelY: labelY,
  38950. glWidth: lineWidth,
  38951. glColor: lineColor,
  38952. glBorderDash: borderDash,
  38953. glBorderDashOffset: borderDashOffset,
  38954. rotation: -1 * labelRotationRadians,
  38955. label: label,
  38956. textBaseline: textBaseline,
  38957. textAlign: textAlign
  38958. });
  38959. });
  38960. // Draw all of the tick labels, tick marks, and grid lines at the correct places
  38961. helpers.each(itemsToDraw, function(itemToDraw) {
  38962. if (gridLines.display) {
  38963. context.save();
  38964. context.lineWidth = itemToDraw.glWidth;
  38965. context.strokeStyle = itemToDraw.glColor;
  38966. if (context.setLineDash) {
  38967. context.setLineDash(itemToDraw.glBorderDash);
  38968. context.lineDashOffset = itemToDraw.glBorderDashOffset;
  38969. }
  38970. context.beginPath();
  38971. if (gridLines.drawTicks) {
  38972. context.moveTo(itemToDraw.tx1, itemToDraw.ty1);
  38973. context.lineTo(itemToDraw.tx2, itemToDraw.ty2);
  38974. }
  38975. if (gridLines.drawOnChartArea) {
  38976. context.moveTo(itemToDraw.x1, itemToDraw.y1);
  38977. context.lineTo(itemToDraw.x2, itemToDraw.y2);
  38978. }
  38979. context.stroke();
  38980. context.restore();
  38981. }
  38982. if (optionTicks.display) {
  38983. context.save();
  38984. context.translate(itemToDraw.labelX, itemToDraw.labelY);
  38985. context.rotate(itemToDraw.rotation);
  38986. context.font = tickFont.font;
  38987. context.textBaseline = itemToDraw.textBaseline;
  38988. context.textAlign = itemToDraw.textAlign;
  38989. var label = itemToDraw.label;
  38990. if (helpers.isArray(label)) {
  38991. for (var i = 0, y = 0; i < label.length; ++i) {
  38992. // We just make sure the multiline element is a string here..
  38993. context.fillText('' + label[i], 0, y);
  38994. // apply same lineSpacing as calculated @ L#320
  38995. y += (tickFont.size * 1.5);
  38996. }
  38997. } else {
  38998. context.fillText(label, 0, 0);
  38999. }
  39000. context.restore();
  39001. }
  39002. });
  39003. if (scaleLabel.display) {
  39004. // Draw the scale label
  39005. var scaleLabelX;
  39006. var scaleLabelY;
  39007. var rotation = 0;
  39008. if (isHorizontal) {
  39009. scaleLabelX = me.left + ((me.right - me.left) / 2); // midpoint of the width
  39010. scaleLabelY = options.position === 'bottom' ? me.bottom - (scaleLabelFont.size / 2) : me.top + (scaleLabelFont.size / 2);
  39011. } else {
  39012. var isLeft = options.position === 'left';
  39013. scaleLabelX = isLeft ? me.left + (scaleLabelFont.size / 2) : me.right - (scaleLabelFont.size / 2);
  39014. scaleLabelY = me.top + ((me.bottom - me.top) / 2);
  39015. rotation = isLeft ? -0.5 * Math.PI : 0.5 * Math.PI;
  39016. }
  39017. context.save();
  39018. context.translate(scaleLabelX, scaleLabelY);
  39019. context.rotate(rotation);
  39020. context.textAlign = 'center';
  39021. context.textBaseline = 'middle';
  39022. context.fillStyle = scaleLabelFontColor; // render in correct colour
  39023. context.font = scaleLabelFont.font;
  39024. context.fillText(scaleLabel.labelString, 0, 0);
  39025. context.restore();
  39026. }
  39027. if (gridLines.drawBorder) {
  39028. // Draw the line at the edge of the axis
  39029. context.lineWidth = helpers.getValueAtIndexOrDefault(gridLines.lineWidth, 0);
  39030. context.strokeStyle = helpers.getValueAtIndexOrDefault(gridLines.color, 0);
  39031. var x1 = me.left,
  39032. x2 = me.right,
  39033. y1 = me.top,
  39034. y2 = me.bottom;
  39035. var aliasPixel = helpers.aliasPixel(context.lineWidth);
  39036. if (isHorizontal) {
  39037. y1 = y2 = options.position === 'top' ? me.bottom : me.top;
  39038. y1 += aliasPixel;
  39039. y2 += aliasPixel;
  39040. } else {
  39041. x1 = x2 = options.position === 'left' ? me.right : me.left;
  39042. x1 += aliasPixel;
  39043. x2 += aliasPixel;
  39044. }
  39045. context.beginPath();
  39046. context.moveTo(x1, y1);
  39047. context.lineTo(x2, y2);
  39048. context.stroke();
  39049. }
  39050. }
  39051. });
  39052. };
  39053. /***/ }),
  39054. /* 152 */
  39055. /***/ (function(module, exports, __webpack_require__) {
  39056. "use strict";
  39057. module.exports = function(Chart) {
  39058. var helpers = Chart.helpers;
  39059. Chart.scaleService = {
  39060. // Scale registration object. Extensions can register new scale types (such as log or DB scales) and then
  39061. // use the new chart options to grab the correct scale
  39062. constructors: {},
  39063. // Use a registration function so that we can move to an ES6 map when we no longer need to support
  39064. // old browsers
  39065. // Scale config defaults
  39066. defaults: {},
  39067. registerScaleType: function(type, scaleConstructor, defaults) {
  39068. this.constructors[type] = scaleConstructor;
  39069. this.defaults[type] = helpers.clone(defaults);
  39070. },
  39071. getScaleConstructor: function(type) {
  39072. return this.constructors.hasOwnProperty(type) ? this.constructors[type] : undefined;
  39073. },
  39074. getScaleDefaults: function(type) {
  39075. // Return the scale defaults merged with the global settings so that we always use the latest ones
  39076. return this.defaults.hasOwnProperty(type) ? helpers.scaleMerge(Chart.defaults.scale, this.defaults[type]) : {};
  39077. },
  39078. updateScaleDefaults: function(type, additions) {
  39079. var defaults = this.defaults;
  39080. if (defaults.hasOwnProperty(type)) {
  39081. defaults[type] = helpers.extend(defaults[type], additions);
  39082. }
  39083. },
  39084. addScalesToLayout: function(chartInstance) {
  39085. // Adds each scale to the chart.boxes array to be sized accordingly
  39086. helpers.each(chartInstance.scales, function(scale) {
  39087. Chart.layoutService.addBox(chartInstance, scale);
  39088. });
  39089. }
  39090. };
  39091. };
  39092. /***/ }),
  39093. /* 153 */
  39094. /***/ (function(module, exports, __webpack_require__) {
  39095. "use strict";
  39096. module.exports = function(Chart) {
  39097. var helpers = Chart.helpers;
  39098. /**
  39099. * Namespace to hold static tick generation functions
  39100. * @namespace Chart.Ticks
  39101. */
  39102. Chart.Ticks = {
  39103. /**
  39104. * Namespace to hold generators for different types of ticks
  39105. * @namespace Chart.Ticks.generators
  39106. */
  39107. generators: {
  39108. /**
  39109. * Interface for the options provided to the numeric tick generator
  39110. * @interface INumericTickGenerationOptions
  39111. */
  39112. /**
  39113. * The maximum number of ticks to display
  39114. * @name INumericTickGenerationOptions#maxTicks
  39115. * @type Number
  39116. */
  39117. /**
  39118. * The distance between each tick.
  39119. * @name INumericTickGenerationOptions#stepSize
  39120. * @type Number
  39121. * @optional
  39122. */
  39123. /**
  39124. * Forced minimum for the ticks. If not specified, the minimum of the data range is used to calculate the tick minimum
  39125. * @name INumericTickGenerationOptions#min
  39126. * @type Number
  39127. * @optional
  39128. */
  39129. /**
  39130. * The maximum value of the ticks. If not specified, the maximum of the data range is used to calculate the tick maximum
  39131. * @name INumericTickGenerationOptions#max
  39132. * @type Number
  39133. * @optional
  39134. */
  39135. /**
  39136. * Generate a set of linear ticks
  39137. * @method Chart.Ticks.generators.linear
  39138. * @param generationOptions {INumericTickGenerationOptions} the options used to generate the ticks
  39139. * @param dataRange {IRange} the range of the data
  39140. * @returns {Array<Number>} array of tick values
  39141. */
  39142. linear: function(generationOptions, dataRange) {
  39143. var ticks = [];
  39144. // To get a "nice" value for the tick spacing, we will use the appropriately named
  39145. // "nice number" algorithm. See http://stackoverflow.com/questions/8506881/nice-label-algorithm-for-charts-with-minimum-ticks
  39146. // for details.
  39147. var spacing;
  39148. if (generationOptions.stepSize && generationOptions.stepSize > 0) {
  39149. spacing = generationOptions.stepSize;
  39150. } else {
  39151. var niceRange = helpers.niceNum(dataRange.max - dataRange.min, false);
  39152. spacing = helpers.niceNum(niceRange / (generationOptions.maxTicks - 1), true);
  39153. }
  39154. var niceMin = Math.floor(dataRange.min / spacing) * spacing;
  39155. var niceMax = Math.ceil(dataRange.max / spacing) * spacing;
  39156. // If min, max and stepSize is set and they make an evenly spaced scale use it.
  39157. if (generationOptions.min && generationOptions.max && generationOptions.stepSize) {
  39158. // If very close to our whole number, use it.
  39159. if (helpers.almostWhole((generationOptions.max - generationOptions.min) / generationOptions.stepSize, spacing / 1000)) {
  39160. niceMin = generationOptions.min;
  39161. niceMax = generationOptions.max;
  39162. }
  39163. }
  39164. var numSpaces = (niceMax - niceMin) / spacing;
  39165. // If very close to our rounded value, use it.
  39166. if (helpers.almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {
  39167. numSpaces = Math.round(numSpaces);
  39168. } else {
  39169. numSpaces = Math.ceil(numSpaces);
  39170. }
  39171. // Put the values into the ticks array
  39172. ticks.push(generationOptions.min !== undefined ? generationOptions.min : niceMin);
  39173. for (var j = 1; j < numSpaces; ++j) {
  39174. ticks.push(niceMin + (j * spacing));
  39175. }
  39176. ticks.push(generationOptions.max !== undefined ? generationOptions.max : niceMax);
  39177. return ticks;
  39178. },
  39179. /**
  39180. * Generate a set of logarithmic ticks
  39181. * @method Chart.Ticks.generators.logarithmic
  39182. * @param generationOptions {INumericTickGenerationOptions} the options used to generate the ticks
  39183. * @param dataRange {IRange} the range of the data
  39184. * @returns {Array<Number>} array of tick values
  39185. */
  39186. logarithmic: function(generationOptions, dataRange) {
  39187. var ticks = [];
  39188. var getValueOrDefault = helpers.getValueOrDefault;
  39189. // Figure out what the max number of ticks we can support it is based on the size of
  39190. // the axis area. For now, we say that the minimum tick spacing in pixels must be 50
  39191. // We also limit the maximum number of ticks to 11 which gives a nice 10 squares on
  39192. // the graph
  39193. var tickVal = getValueOrDefault(generationOptions.min, Math.pow(10, Math.floor(helpers.log10(dataRange.min))));
  39194. var endExp = Math.floor(helpers.log10(dataRange.max));
  39195. var endSignificand = Math.ceil(dataRange.max / Math.pow(10, endExp));
  39196. var exp;
  39197. var significand;
  39198. if (tickVal === 0) {
  39199. exp = Math.floor(helpers.log10(dataRange.minNotZero));
  39200. significand = Math.floor(dataRange.minNotZero / Math.pow(10, exp));
  39201. ticks.push(tickVal);
  39202. tickVal = significand * Math.pow(10, exp);
  39203. } else {
  39204. exp = Math.floor(helpers.log10(tickVal));
  39205. significand = Math.floor(tickVal / Math.pow(10, exp));
  39206. }
  39207. do {
  39208. ticks.push(tickVal);
  39209. ++significand;
  39210. if (significand === 10) {
  39211. significand = 1;
  39212. ++exp;
  39213. }
  39214. tickVal = significand * Math.pow(10, exp);
  39215. } while (exp < endExp || (exp === endExp && significand < endSignificand));
  39216. var lastTick = getValueOrDefault(generationOptions.max, tickVal);
  39217. ticks.push(lastTick);
  39218. return ticks;
  39219. }
  39220. },
  39221. /**
  39222. * Namespace to hold formatters for different types of ticks
  39223. * @namespace Chart.Ticks.formatters
  39224. */
  39225. formatters: {
  39226. /**
  39227. * Formatter for value labels
  39228. * @method Chart.Ticks.formatters.values
  39229. * @param value the value to display
  39230. * @return {String|Array} the label to display
  39231. */
  39232. values: function(value) {
  39233. return helpers.isArray(value) ? value : '' + value;
  39234. },
  39235. /**
  39236. * Formatter for linear numeric ticks
  39237. * @method Chart.Ticks.formatters.linear
  39238. * @param tickValue {Number} the value to be formatted
  39239. * @param index {Number} the position of the tickValue parameter in the ticks array
  39240. * @param ticks {Array<Number>} the list of ticks being converted
  39241. * @return {String} string representation of the tickValue parameter
  39242. */
  39243. linear: function(tickValue, index, ticks) {
  39244. // If we have lots of ticks, don't use the ones
  39245. var delta = ticks.length > 3 ? ticks[2] - ticks[1] : ticks[1] - ticks[0];
  39246. // If we have a number like 2.5 as the delta, figure out how many decimal places we need
  39247. if (Math.abs(delta) > 1) {
  39248. if (tickValue !== Math.floor(tickValue)) {
  39249. // not an integer
  39250. delta = tickValue - Math.floor(tickValue);
  39251. }
  39252. }
  39253. var logDelta = helpers.log10(Math.abs(delta));
  39254. var tickString = '';
  39255. if (tickValue !== 0) {
  39256. var numDecimal = -1 * Math.floor(logDelta);
  39257. numDecimal = Math.max(Math.min(numDecimal, 20), 0); // toFixed has a max of 20 decimal places
  39258. tickString = tickValue.toFixed(numDecimal);
  39259. } else {
  39260. tickString = '0'; // never show decimal places for 0
  39261. }
  39262. return tickString;
  39263. },
  39264. logarithmic: function(tickValue, index, ticks) {
  39265. var remain = tickValue / (Math.pow(10, Math.floor(helpers.log10(tickValue))));
  39266. if (tickValue === 0) {
  39267. return '0';
  39268. } else if (remain === 1 || remain === 2 || remain === 5 || index === 0 || index === ticks.length - 1) {
  39269. return tickValue.toExponential();
  39270. }
  39271. return '';
  39272. }
  39273. }
  39274. };
  39275. };
  39276. /***/ }),
  39277. /* 154 */
  39278. /***/ (function(module, exports, __webpack_require__) {
  39279. "use strict";
  39280. module.exports = function(Chart) {
  39281. var helpers = Chart.helpers;
  39282. Chart.defaults.global.title = {
  39283. display: false,
  39284. position: 'top',
  39285. fullWidth: true, // marks that this box should take the full width of the canvas (pushing down other boxes)
  39286. fontStyle: 'bold',
  39287. padding: 10,
  39288. // actual title
  39289. text: ''
  39290. };
  39291. var noop = helpers.noop;
  39292. Chart.Title = Chart.Element.extend({
  39293. initialize: function(config) {
  39294. var me = this;
  39295. helpers.extend(me, config);
  39296. // Contains hit boxes for each dataset (in dataset order)
  39297. me.legendHitBoxes = [];
  39298. },
  39299. // These methods are ordered by lifecycle. Utilities then follow.
  39300. beforeUpdate: noop,
  39301. update: function(maxWidth, maxHeight, margins) {
  39302. var me = this;
  39303. // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)
  39304. me.beforeUpdate();
  39305. // Absorb the master measurements
  39306. me.maxWidth = maxWidth;
  39307. me.maxHeight = maxHeight;
  39308. me.margins = margins;
  39309. // Dimensions
  39310. me.beforeSetDimensions();
  39311. me.setDimensions();
  39312. me.afterSetDimensions();
  39313. // Labels
  39314. me.beforeBuildLabels();
  39315. me.buildLabels();
  39316. me.afterBuildLabels();
  39317. // Fit
  39318. me.beforeFit();
  39319. me.fit();
  39320. me.afterFit();
  39321. //
  39322. me.afterUpdate();
  39323. return me.minSize;
  39324. },
  39325. afterUpdate: noop,
  39326. //
  39327. beforeSetDimensions: noop,
  39328. setDimensions: function() {
  39329. var me = this;
  39330. // Set the unconstrained dimension before label rotation
  39331. if (me.isHorizontal()) {
  39332. // Reset position before calculating rotation
  39333. me.width = me.maxWidth;
  39334. me.left = 0;
  39335. me.right = me.width;
  39336. } else {
  39337. me.height = me.maxHeight;
  39338. // Reset position before calculating rotation
  39339. me.top = 0;
  39340. me.bottom = me.height;
  39341. }
  39342. // Reset padding
  39343. me.paddingLeft = 0;
  39344. me.paddingTop = 0;
  39345. me.paddingRight = 0;
  39346. me.paddingBottom = 0;
  39347. // Reset minSize
  39348. me.minSize = {
  39349. width: 0,
  39350. height: 0
  39351. };
  39352. },
  39353. afterSetDimensions: noop,
  39354. //
  39355. beforeBuildLabels: noop,
  39356. buildLabels: noop,
  39357. afterBuildLabels: noop,
  39358. //
  39359. beforeFit: noop,
  39360. fit: function() {
  39361. var me = this,
  39362. valueOrDefault = helpers.getValueOrDefault,
  39363. opts = me.options,
  39364. globalDefaults = Chart.defaults.global,
  39365. display = opts.display,
  39366. fontSize = valueOrDefault(opts.fontSize, globalDefaults.defaultFontSize),
  39367. minSize = me.minSize;
  39368. if (me.isHorizontal()) {
  39369. minSize.width = me.maxWidth; // fill all the width
  39370. minSize.height = display ? fontSize + (opts.padding * 2) : 0;
  39371. } else {
  39372. minSize.width = display ? fontSize + (opts.padding * 2) : 0;
  39373. minSize.height = me.maxHeight; // fill all the height
  39374. }
  39375. me.width = minSize.width;
  39376. me.height = minSize.height;
  39377. },
  39378. afterFit: noop,
  39379. // Shared Methods
  39380. isHorizontal: function() {
  39381. var pos = this.options.position;
  39382. return pos === 'top' || pos === 'bottom';
  39383. },
  39384. // Actually draw the title block on the canvas
  39385. draw: function() {
  39386. var me = this,
  39387. ctx = me.ctx,
  39388. valueOrDefault = helpers.getValueOrDefault,
  39389. opts = me.options,
  39390. globalDefaults = Chart.defaults.global;
  39391. if (opts.display) {
  39392. var fontSize = valueOrDefault(opts.fontSize, globalDefaults.defaultFontSize),
  39393. fontStyle = valueOrDefault(opts.fontStyle, globalDefaults.defaultFontStyle),
  39394. fontFamily = valueOrDefault(opts.fontFamily, globalDefaults.defaultFontFamily),
  39395. titleFont = helpers.fontString(fontSize, fontStyle, fontFamily),
  39396. rotation = 0,
  39397. titleX,
  39398. titleY,
  39399. top = me.top,
  39400. left = me.left,
  39401. bottom = me.bottom,
  39402. right = me.right,
  39403. maxWidth;
  39404. ctx.fillStyle = valueOrDefault(opts.fontColor, globalDefaults.defaultFontColor); // render in correct colour
  39405. ctx.font = titleFont;
  39406. // Horizontal
  39407. if (me.isHorizontal()) {
  39408. titleX = left + ((right - left) / 2); // midpoint of the width
  39409. titleY = top + ((bottom - top) / 2); // midpoint of the height
  39410. maxWidth = right - left;
  39411. } else {
  39412. titleX = opts.position === 'left' ? left + (fontSize / 2) : right - (fontSize / 2);
  39413. titleY = top + ((bottom - top) / 2);
  39414. maxWidth = bottom - top;
  39415. rotation = Math.PI * (opts.position === 'left' ? -0.5 : 0.5);
  39416. }
  39417. ctx.save();
  39418. ctx.translate(titleX, titleY);
  39419. ctx.rotate(rotation);
  39420. ctx.textAlign = 'center';
  39421. ctx.textBaseline = 'middle';
  39422. ctx.fillText(opts.text, 0, 0, maxWidth);
  39423. ctx.restore();
  39424. }
  39425. }
  39426. });
  39427. function createNewTitleBlockAndAttach(chartInstance, titleOpts) {
  39428. var title = new Chart.Title({
  39429. ctx: chartInstance.chart.ctx,
  39430. options: titleOpts,
  39431. chart: chartInstance
  39432. });
  39433. chartInstance.titleBlock = title;
  39434. Chart.layoutService.addBox(chartInstance, title);
  39435. }
  39436. // Register the title plugin
  39437. Chart.plugins.register({
  39438. beforeInit: function(chartInstance) {
  39439. var titleOpts = chartInstance.options.title;
  39440. if (titleOpts) {
  39441. createNewTitleBlockAndAttach(chartInstance, titleOpts);
  39442. }
  39443. },
  39444. beforeUpdate: function(chartInstance) {
  39445. var titleOpts = chartInstance.options.title;
  39446. if (titleOpts) {
  39447. titleOpts = helpers.configMerge(Chart.defaults.global.title, titleOpts);
  39448. if (chartInstance.titleBlock) {
  39449. chartInstance.titleBlock.options = titleOpts;
  39450. } else {
  39451. createNewTitleBlockAndAttach(chartInstance, titleOpts);
  39452. }
  39453. } else {
  39454. Chart.layoutService.removeBox(chartInstance, chartInstance.titleBlock);
  39455. delete chartInstance.titleBlock;
  39456. }
  39457. }
  39458. });
  39459. };
  39460. /***/ }),
  39461. /* 155 */
  39462. /***/ (function(module, exports, __webpack_require__) {
  39463. "use strict";
  39464. module.exports = function(Chart) {
  39465. var helpers = Chart.helpers;
  39466. /**
  39467. * Helper method to merge the opacity into a color
  39468. */
  39469. function mergeOpacity(colorString, opacity) {
  39470. var color = helpers.color(colorString);
  39471. return color.alpha(opacity * color.alpha()).rgbaString();
  39472. }
  39473. Chart.defaults.global.tooltips = {
  39474. enabled: true,
  39475. custom: null,
  39476. mode: 'nearest',
  39477. position: 'average',
  39478. intersect: true,
  39479. backgroundColor: 'rgba(0,0,0,0.8)',
  39480. titleFontStyle: 'bold',
  39481. titleSpacing: 2,
  39482. titleMarginBottom: 6,
  39483. titleFontColor: '#fff',
  39484. titleAlign: 'left',
  39485. bodySpacing: 2,
  39486. bodyFontColor: '#fff',
  39487. bodyAlign: 'left',
  39488. footerFontStyle: 'bold',
  39489. footerSpacing: 2,
  39490. footerMarginTop: 6,
  39491. footerFontColor: '#fff',
  39492. footerAlign: 'left',
  39493. yPadding: 6,
  39494. xPadding: 6,
  39495. caretSize: 5,
  39496. cornerRadius: 6,
  39497. multiKeyBackground: '#fff',
  39498. displayColors: true,
  39499. callbacks: {
  39500. // Args are: (tooltipItems, data)
  39501. beforeTitle: helpers.noop,
  39502. title: function(tooltipItems, data) {
  39503. // Pick first xLabel for now
  39504. var title = '';
  39505. var labels = data.labels;
  39506. var labelCount = labels ? labels.length : 0;
  39507. if (tooltipItems.length > 0) {
  39508. var item = tooltipItems[0];
  39509. if (item.xLabel) {
  39510. title = item.xLabel;
  39511. } else if (labelCount > 0 && item.index < labelCount) {
  39512. title = labels[item.index];
  39513. }
  39514. }
  39515. return title;
  39516. },
  39517. afterTitle: helpers.noop,
  39518. // Args are: (tooltipItems, data)
  39519. beforeBody: helpers.noop,
  39520. // Args are: (tooltipItem, data)
  39521. beforeLabel: helpers.noop,
  39522. label: function(tooltipItem, data) {
  39523. var datasetLabel = data.datasets[tooltipItem.datasetIndex].label || '';
  39524. return datasetLabel + ': ' + tooltipItem.yLabel;
  39525. },
  39526. labelColor: function(tooltipItem, chartInstance) {
  39527. var meta = chartInstance.getDatasetMeta(tooltipItem.datasetIndex);
  39528. var activeElement = meta.data[tooltipItem.index];
  39529. var view = activeElement._view;
  39530. return {
  39531. borderColor: view.borderColor,
  39532. backgroundColor: view.backgroundColor
  39533. };
  39534. },
  39535. afterLabel: helpers.noop,
  39536. // Args are: (tooltipItems, data)
  39537. afterBody: helpers.noop,
  39538. // Args are: (tooltipItems, data)
  39539. beforeFooter: helpers.noop,
  39540. footer: helpers.noop,
  39541. afterFooter: helpers.noop
  39542. }
  39543. };
  39544. // Helper to push or concat based on if the 2nd parameter is an array or not
  39545. function pushOrConcat(base, toPush) {
  39546. if (toPush) {
  39547. if (helpers.isArray(toPush)) {
  39548. // base = base.concat(toPush);
  39549. Array.prototype.push.apply(base, toPush);
  39550. } else {
  39551. base.push(toPush);
  39552. }
  39553. }
  39554. return base;
  39555. }
  39556. // Private helper to create a tooltip item model
  39557. // @param element : the chart element (point, arc, bar) to create the tooltip item for
  39558. // @return : new tooltip item
  39559. function createTooltipItem(element) {
  39560. var xScale = element._xScale;
  39561. var yScale = element._yScale || element._scale; // handle radar || polarArea charts
  39562. var index = element._index,
  39563. datasetIndex = element._datasetIndex;
  39564. return {
  39565. xLabel: xScale ? xScale.getLabelForIndex(index, datasetIndex) : '',
  39566. yLabel: yScale ? yScale.getLabelForIndex(index, datasetIndex) : '',
  39567. index: index,
  39568. datasetIndex: datasetIndex,
  39569. x: element._model.x,
  39570. y: element._model.y
  39571. };
  39572. }
  39573. /**
  39574. * Helper to get the reset model for the tooltip
  39575. * @param tooltipOpts {Object} the tooltip options
  39576. */
  39577. function getBaseModel(tooltipOpts) {
  39578. var globalDefaults = Chart.defaults.global;
  39579. var getValueOrDefault = helpers.getValueOrDefault;
  39580. return {
  39581. // Positioning
  39582. xPadding: tooltipOpts.xPadding,
  39583. yPadding: tooltipOpts.yPadding,
  39584. xAlign: tooltipOpts.xAlign,
  39585. yAlign: tooltipOpts.yAlign,
  39586. // Body
  39587. bodyFontColor: tooltipOpts.bodyFontColor,
  39588. _bodyFontFamily: getValueOrDefault(tooltipOpts.bodyFontFamily, globalDefaults.defaultFontFamily),
  39589. _bodyFontStyle: getValueOrDefault(tooltipOpts.bodyFontStyle, globalDefaults.defaultFontStyle),
  39590. _bodyAlign: tooltipOpts.bodyAlign,
  39591. bodyFontSize: getValueOrDefault(tooltipOpts.bodyFontSize, globalDefaults.defaultFontSize),
  39592. bodySpacing: tooltipOpts.bodySpacing,
  39593. // Title
  39594. titleFontColor: tooltipOpts.titleFontColor,
  39595. _titleFontFamily: getValueOrDefault(tooltipOpts.titleFontFamily, globalDefaults.defaultFontFamily),
  39596. _titleFontStyle: getValueOrDefault(tooltipOpts.titleFontStyle, globalDefaults.defaultFontStyle),
  39597. titleFontSize: getValueOrDefault(tooltipOpts.titleFontSize, globalDefaults.defaultFontSize),
  39598. _titleAlign: tooltipOpts.titleAlign,
  39599. titleSpacing: tooltipOpts.titleSpacing,
  39600. titleMarginBottom: tooltipOpts.titleMarginBottom,
  39601. // Footer
  39602. footerFontColor: tooltipOpts.footerFontColor,
  39603. _footerFontFamily: getValueOrDefault(tooltipOpts.footerFontFamily, globalDefaults.defaultFontFamily),
  39604. _footerFontStyle: getValueOrDefault(tooltipOpts.footerFontStyle, globalDefaults.defaultFontStyle),
  39605. footerFontSize: getValueOrDefault(tooltipOpts.footerFontSize, globalDefaults.defaultFontSize),
  39606. _footerAlign: tooltipOpts.footerAlign,
  39607. footerSpacing: tooltipOpts.footerSpacing,
  39608. footerMarginTop: tooltipOpts.footerMarginTop,
  39609. // Appearance
  39610. caretSize: tooltipOpts.caretSize,
  39611. cornerRadius: tooltipOpts.cornerRadius,
  39612. backgroundColor: tooltipOpts.backgroundColor,
  39613. opacity: 0,
  39614. legendColorBackground: tooltipOpts.multiKeyBackground,
  39615. displayColors: tooltipOpts.displayColors
  39616. };
  39617. }
  39618. /**
  39619. * Get the size of the tooltip
  39620. */
  39621. function getTooltipSize(tooltip, model) {
  39622. var ctx = tooltip._chart.ctx;
  39623. var height = model.yPadding * 2; // Tooltip Padding
  39624. var width = 0;
  39625. // Count of all lines in the body
  39626. var body = model.body;
  39627. var combinedBodyLength = body.reduce(function(count, bodyItem) {
  39628. return count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length;
  39629. }, 0);
  39630. combinedBodyLength += model.beforeBody.length + model.afterBody.length;
  39631. var titleLineCount = model.title.length;
  39632. var footerLineCount = model.footer.length;
  39633. var titleFontSize = model.titleFontSize,
  39634. bodyFontSize = model.bodyFontSize,
  39635. footerFontSize = model.footerFontSize;
  39636. height += titleLineCount * titleFontSize; // Title Lines
  39637. height += titleLineCount ? (titleLineCount - 1) * model.titleSpacing : 0; // Title Line Spacing
  39638. height += titleLineCount ? model.titleMarginBottom : 0; // Title's bottom Margin
  39639. height += combinedBodyLength * bodyFontSize; // Body Lines
  39640. height += combinedBodyLength ? (combinedBodyLength - 1) * model.bodySpacing : 0; // Body Line Spacing
  39641. height += footerLineCount ? model.footerMarginTop : 0; // Footer Margin
  39642. height += footerLineCount * (footerFontSize); // Footer Lines
  39643. height += footerLineCount ? (footerLineCount - 1) * model.footerSpacing : 0; // Footer Line Spacing
  39644. // Title width
  39645. var widthPadding = 0;
  39646. var maxLineWidth = function(line) {
  39647. width = Math.max(width, ctx.measureText(line).width + widthPadding);
  39648. };
  39649. ctx.font = helpers.fontString(titleFontSize, model._titleFontStyle, model._titleFontFamily);
  39650. helpers.each(model.title, maxLineWidth);
  39651. // Body width
  39652. ctx.font = helpers.fontString(bodyFontSize, model._bodyFontStyle, model._bodyFontFamily);
  39653. helpers.each(model.beforeBody.concat(model.afterBody), maxLineWidth);
  39654. // Body lines may include some extra width due to the color box
  39655. widthPadding = model.displayColors ? (bodyFontSize + 2) : 0;
  39656. helpers.each(body, function(bodyItem) {
  39657. helpers.each(bodyItem.before, maxLineWidth);
  39658. helpers.each(bodyItem.lines, maxLineWidth);
  39659. helpers.each(bodyItem.after, maxLineWidth);
  39660. });
  39661. // Reset back to 0
  39662. widthPadding = 0;
  39663. // Footer width
  39664. ctx.font = helpers.fontString(footerFontSize, model._footerFontStyle, model._footerFontFamily);
  39665. helpers.each(model.footer, maxLineWidth);
  39666. // Add padding
  39667. width += 2 * model.xPadding;
  39668. return {
  39669. width: width,
  39670. height: height
  39671. };
  39672. }
  39673. /**
  39674. * Helper to get the alignment of a tooltip given the size
  39675. */
  39676. function determineAlignment(tooltip, size) {
  39677. var model = tooltip._model;
  39678. var chart = tooltip._chart;
  39679. var chartArea = tooltip._chartInstance.chartArea;
  39680. var xAlign = 'center';
  39681. var yAlign = 'center';
  39682. if (model.y < size.height) {
  39683. yAlign = 'top';
  39684. } else if (model.y > (chart.height - size.height)) {
  39685. yAlign = 'bottom';
  39686. }
  39687. var lf, rf; // functions to determine left, right alignment
  39688. var olf, orf; // functions to determine if left/right alignment causes tooltip to go outside chart
  39689. var yf; // function to get the y alignment if the tooltip goes outside of the left or right edges
  39690. var midX = (chartArea.left + chartArea.right) / 2;
  39691. var midY = (chartArea.top + chartArea.bottom) / 2;
  39692. if (yAlign === 'center') {
  39693. lf = function(x) {
  39694. return x <= midX;
  39695. };
  39696. rf = function(x) {
  39697. return x > midX;
  39698. };
  39699. } else {
  39700. lf = function(x) {
  39701. return x <= (size.width / 2);
  39702. };
  39703. rf = function(x) {
  39704. return x >= (chart.width - (size.width / 2));
  39705. };
  39706. }
  39707. olf = function(x) {
  39708. return x + size.width > chart.width;
  39709. };
  39710. orf = function(x) {
  39711. return x - size.width < 0;
  39712. };
  39713. yf = function(y) {
  39714. return y <= midY ? 'top' : 'bottom';
  39715. };
  39716. if (lf(model.x)) {
  39717. xAlign = 'left';
  39718. // Is tooltip too wide and goes over the right side of the chart.?
  39719. if (olf(model.x)) {
  39720. xAlign = 'center';
  39721. yAlign = yf(model.y);
  39722. }
  39723. } else if (rf(model.x)) {
  39724. xAlign = 'right';
  39725. // Is tooltip too wide and goes outside left edge of canvas?
  39726. if (orf(model.x)) {
  39727. xAlign = 'center';
  39728. yAlign = yf(model.y);
  39729. }
  39730. }
  39731. var opts = tooltip._options;
  39732. return {
  39733. xAlign: opts.xAlign ? opts.xAlign : xAlign,
  39734. yAlign: opts.yAlign ? opts.yAlign : yAlign
  39735. };
  39736. }
  39737. /**
  39738. * @Helper to get the location a tooltip needs to be placed at given the initial position (via the vm) and the size and alignment
  39739. */
  39740. function getBackgroundPoint(vm, size, alignment) {
  39741. // Background Position
  39742. var x = vm.x;
  39743. var y = vm.y;
  39744. var caretSize = vm.caretSize,
  39745. caretPadding = vm.caretPadding,
  39746. cornerRadius = vm.cornerRadius,
  39747. xAlign = alignment.xAlign,
  39748. yAlign = alignment.yAlign,
  39749. paddingAndSize = caretSize + caretPadding,
  39750. radiusAndPadding = cornerRadius + caretPadding;
  39751. if (xAlign === 'right') {
  39752. x -= size.width;
  39753. } else if (xAlign === 'center') {
  39754. x -= (size.width / 2);
  39755. }
  39756. if (yAlign === 'top') {
  39757. y += paddingAndSize;
  39758. } else if (yAlign === 'bottom') {
  39759. y -= size.height + paddingAndSize;
  39760. } else {
  39761. y -= (size.height / 2);
  39762. }
  39763. if (yAlign === 'center') {
  39764. if (xAlign === 'left') {
  39765. x += paddingAndSize;
  39766. } else if (xAlign === 'right') {
  39767. x -= paddingAndSize;
  39768. }
  39769. } else if (xAlign === 'left') {
  39770. x -= radiusAndPadding;
  39771. } else if (xAlign === 'right') {
  39772. x += radiusAndPadding;
  39773. }
  39774. return {
  39775. x: x,
  39776. y: y
  39777. };
  39778. }
  39779. Chart.Tooltip = Chart.Element.extend({
  39780. initialize: function() {
  39781. this._model = getBaseModel(this._options);
  39782. },
  39783. // Get the title
  39784. // Args are: (tooltipItem, data)
  39785. getTitle: function() {
  39786. var me = this;
  39787. var opts = me._options;
  39788. var callbacks = opts.callbacks;
  39789. var beforeTitle = callbacks.beforeTitle.apply(me, arguments),
  39790. title = callbacks.title.apply(me, arguments),
  39791. afterTitle = callbacks.afterTitle.apply(me, arguments);
  39792. var lines = [];
  39793. lines = pushOrConcat(lines, beforeTitle);
  39794. lines = pushOrConcat(lines, title);
  39795. lines = pushOrConcat(lines, afterTitle);
  39796. return lines;
  39797. },
  39798. // Args are: (tooltipItem, data)
  39799. getBeforeBody: function() {
  39800. var lines = this._options.callbacks.beforeBody.apply(this, arguments);
  39801. return helpers.isArray(lines) ? lines : lines !== undefined ? [lines] : [];
  39802. },
  39803. // Args are: (tooltipItem, data)
  39804. getBody: function(tooltipItems, data) {
  39805. var me = this;
  39806. var callbacks = me._options.callbacks;
  39807. var bodyItems = [];
  39808. helpers.each(tooltipItems, function(tooltipItem) {
  39809. var bodyItem = {
  39810. before: [],
  39811. lines: [],
  39812. after: []
  39813. };
  39814. pushOrConcat(bodyItem.before, callbacks.beforeLabel.call(me, tooltipItem, data));
  39815. pushOrConcat(bodyItem.lines, callbacks.label.call(me, tooltipItem, data));
  39816. pushOrConcat(bodyItem.after, callbacks.afterLabel.call(me, tooltipItem, data));
  39817. bodyItems.push(bodyItem);
  39818. });
  39819. return bodyItems;
  39820. },
  39821. // Args are: (tooltipItem, data)
  39822. getAfterBody: function() {
  39823. var lines = this._options.callbacks.afterBody.apply(this, arguments);
  39824. return helpers.isArray(lines) ? lines : lines !== undefined ? [lines] : [];
  39825. },
  39826. // Get the footer and beforeFooter and afterFooter lines
  39827. // Args are: (tooltipItem, data)
  39828. getFooter: function() {
  39829. var me = this;
  39830. var callbacks = me._options.callbacks;
  39831. var beforeFooter = callbacks.beforeFooter.apply(me, arguments);
  39832. var footer = callbacks.footer.apply(me, arguments);
  39833. var afterFooter = callbacks.afterFooter.apply(me, arguments);
  39834. var lines = [];
  39835. lines = pushOrConcat(lines, beforeFooter);
  39836. lines = pushOrConcat(lines, footer);
  39837. lines = pushOrConcat(lines, afterFooter);
  39838. return lines;
  39839. },
  39840. update: function(changed) {
  39841. var me = this;
  39842. var opts = me._options;
  39843. // Need to regenerate the model because its faster than using extend and it is necessary due to the optimization in Chart.Element.transition
  39844. // that does _view = _model if ease === 1. This causes the 2nd tooltip update to set properties in both the view and model at the same time
  39845. // which breaks any animations.
  39846. var existingModel = me._model;
  39847. var model = me._model = getBaseModel(opts);
  39848. var active = me._active;
  39849. var data = me._data;
  39850. var chartInstance = me._chartInstance;
  39851. // In the case where active.length === 0 we need to keep these at existing values for good animations
  39852. var alignment = {
  39853. xAlign: existingModel.xAlign,
  39854. yAlign: existingModel.yAlign
  39855. };
  39856. var backgroundPoint = {
  39857. x: existingModel.x,
  39858. y: existingModel.y
  39859. };
  39860. var tooltipSize = {
  39861. width: existingModel.width,
  39862. height: existingModel.height
  39863. };
  39864. var tooltipPosition = {
  39865. x: existingModel.caretX,
  39866. y: existingModel.caretY
  39867. };
  39868. var i, len;
  39869. if (active.length) {
  39870. model.opacity = 1;
  39871. var labelColors = [];
  39872. tooltipPosition = Chart.Tooltip.positioners[opts.position](active, me._eventPosition);
  39873. var tooltipItems = [];
  39874. for (i = 0, len = active.length; i < len; ++i) {
  39875. tooltipItems.push(createTooltipItem(active[i]));
  39876. }
  39877. // If the user provided a filter function, use it to modify the tooltip items
  39878. if (opts.filter) {
  39879. tooltipItems = tooltipItems.filter(function(a) {
  39880. return opts.filter(a, data);
  39881. });
  39882. }
  39883. // If the user provided a sorting function, use it to modify the tooltip items
  39884. if (opts.itemSort) {
  39885. tooltipItems = tooltipItems.sort(function(a, b) {
  39886. return opts.itemSort(a, b, data);
  39887. });
  39888. }
  39889. // Determine colors for boxes
  39890. helpers.each(tooltipItems, function(tooltipItem) {
  39891. labelColors.push(opts.callbacks.labelColor.call(me, tooltipItem, chartInstance));
  39892. });
  39893. // Build the Text Lines
  39894. model.title = me.getTitle(tooltipItems, data);
  39895. model.beforeBody = me.getBeforeBody(tooltipItems, data);
  39896. model.body = me.getBody(tooltipItems, data);
  39897. model.afterBody = me.getAfterBody(tooltipItems, data);
  39898. model.footer = me.getFooter(tooltipItems, data);
  39899. // Initial positioning and colors
  39900. model.x = Math.round(tooltipPosition.x);
  39901. model.y = Math.round(tooltipPosition.y);
  39902. model.caretPadding = helpers.getValueOrDefault(tooltipPosition.padding, 2);
  39903. model.labelColors = labelColors;
  39904. // data points
  39905. model.dataPoints = tooltipItems;
  39906. // We need to determine alignment of the tooltip
  39907. tooltipSize = getTooltipSize(this, model);
  39908. alignment = determineAlignment(this, tooltipSize);
  39909. // Final Size and Position
  39910. backgroundPoint = getBackgroundPoint(model, tooltipSize, alignment);
  39911. } else {
  39912. model.opacity = 0;
  39913. }
  39914. model.xAlign = alignment.xAlign;
  39915. model.yAlign = alignment.yAlign;
  39916. model.x = backgroundPoint.x;
  39917. model.y = backgroundPoint.y;
  39918. model.width = tooltipSize.width;
  39919. model.height = tooltipSize.height;
  39920. // Point where the caret on the tooltip points to
  39921. model.caretX = tooltipPosition.x;
  39922. model.caretY = tooltipPosition.y;
  39923. me._model = model;
  39924. if (changed && opts.custom) {
  39925. opts.custom.call(me, model);
  39926. }
  39927. return me;
  39928. },
  39929. drawCaret: function(tooltipPoint, size, opacity) {
  39930. var vm = this._view;
  39931. var ctx = this._chart.ctx;
  39932. var x1, x2, x3;
  39933. var y1, y2, y3;
  39934. var caretSize = vm.caretSize;
  39935. var cornerRadius = vm.cornerRadius;
  39936. var xAlign = vm.xAlign,
  39937. yAlign = vm.yAlign;
  39938. var ptX = tooltipPoint.x,
  39939. ptY = tooltipPoint.y;
  39940. var width = size.width,
  39941. height = size.height;
  39942. if (yAlign === 'center') {
  39943. // Left or right side
  39944. if (xAlign === 'left') {
  39945. x1 = ptX;
  39946. x2 = x1 - caretSize;
  39947. x3 = x1;
  39948. } else {
  39949. x1 = ptX + width;
  39950. x2 = x1 + caretSize;
  39951. x3 = x1;
  39952. }
  39953. y2 = ptY + (height / 2);
  39954. y1 = y2 - caretSize;
  39955. y3 = y2 + caretSize;
  39956. } else {
  39957. if (xAlign === 'left') {
  39958. x1 = ptX + cornerRadius;
  39959. x2 = x1 + caretSize;
  39960. x3 = x2 + caretSize;
  39961. } else if (xAlign === 'right') {
  39962. x1 = ptX + width - cornerRadius;
  39963. x2 = x1 - caretSize;
  39964. x3 = x2 - caretSize;
  39965. } else {
  39966. x2 = ptX + (width / 2);
  39967. x1 = x2 - caretSize;
  39968. x3 = x2 + caretSize;
  39969. }
  39970. if (yAlign === 'top') {
  39971. y1 = ptY;
  39972. y2 = y1 - caretSize;
  39973. y3 = y1;
  39974. } else {
  39975. y1 = ptY + height;
  39976. y2 = y1 + caretSize;
  39977. y3 = y1;
  39978. }
  39979. }
  39980. ctx.fillStyle = mergeOpacity(vm.backgroundColor, opacity);
  39981. ctx.beginPath();
  39982. ctx.moveTo(x1, y1);
  39983. ctx.lineTo(x2, y2);
  39984. ctx.lineTo(x3, y3);
  39985. ctx.closePath();
  39986. ctx.fill();
  39987. },
  39988. drawTitle: function(pt, vm, ctx, opacity) {
  39989. var title = vm.title;
  39990. if (title.length) {
  39991. ctx.textAlign = vm._titleAlign;
  39992. ctx.textBaseline = 'top';
  39993. var titleFontSize = vm.titleFontSize,
  39994. titleSpacing = vm.titleSpacing;
  39995. ctx.fillStyle = mergeOpacity(vm.titleFontColor, opacity);
  39996. ctx.font = helpers.fontString(titleFontSize, vm._titleFontStyle, vm._titleFontFamily);
  39997. var i, len;
  39998. for (i = 0, len = title.length; i < len; ++i) {
  39999. ctx.fillText(title[i], pt.x, pt.y);
  40000. pt.y += titleFontSize + titleSpacing; // Line Height and spacing
  40001. if (i + 1 === title.length) {
  40002. pt.y += vm.titleMarginBottom - titleSpacing; // If Last, add margin, remove spacing
  40003. }
  40004. }
  40005. }
  40006. },
  40007. drawBody: function(pt, vm, ctx, opacity) {
  40008. var bodyFontSize = vm.bodyFontSize;
  40009. var bodySpacing = vm.bodySpacing;
  40010. var body = vm.body;
  40011. ctx.textAlign = vm._bodyAlign;
  40012. ctx.textBaseline = 'top';
  40013. var textColor = mergeOpacity(vm.bodyFontColor, opacity);
  40014. ctx.fillStyle = textColor;
  40015. ctx.font = helpers.fontString(bodyFontSize, vm._bodyFontStyle, vm._bodyFontFamily);
  40016. // Before Body
  40017. var xLinePadding = 0;
  40018. var fillLineOfText = function(line) {
  40019. ctx.fillText(line, pt.x + xLinePadding, pt.y);
  40020. pt.y += bodyFontSize + bodySpacing;
  40021. };
  40022. // Before body lines
  40023. helpers.each(vm.beforeBody, fillLineOfText);
  40024. var drawColorBoxes = vm.displayColors;
  40025. xLinePadding = drawColorBoxes ? (bodyFontSize + 2) : 0;
  40026. // Draw body lines now
  40027. helpers.each(body, function(bodyItem, i) {
  40028. helpers.each(bodyItem.before, fillLineOfText);
  40029. helpers.each(bodyItem.lines, function(line) {
  40030. // Draw Legend-like boxes if needed
  40031. if (drawColorBoxes) {
  40032. // Fill a white rect so that colours merge nicely if the opacity is < 1
  40033. ctx.fillStyle = mergeOpacity(vm.legendColorBackground, opacity);
  40034. ctx.fillRect(pt.x, pt.y, bodyFontSize, bodyFontSize);
  40035. // Border
  40036. ctx.strokeStyle = mergeOpacity(vm.labelColors[i].borderColor, opacity);
  40037. ctx.strokeRect(pt.x, pt.y, bodyFontSize, bodyFontSize);
  40038. // Inner square
  40039. ctx.fillStyle = mergeOpacity(vm.labelColors[i].backgroundColor, opacity);
  40040. ctx.fillRect(pt.x + 1, pt.y + 1, bodyFontSize - 2, bodyFontSize - 2);
  40041. ctx.fillStyle = textColor;
  40042. }
  40043. fillLineOfText(line);
  40044. });
  40045. helpers.each(bodyItem.after, fillLineOfText);
  40046. });
  40047. // Reset back to 0 for after body
  40048. xLinePadding = 0;
  40049. // After body lines
  40050. helpers.each(vm.afterBody, fillLineOfText);
  40051. pt.y -= bodySpacing; // Remove last body spacing
  40052. },
  40053. drawFooter: function(pt, vm, ctx, opacity) {
  40054. var footer = vm.footer;
  40055. if (footer.length) {
  40056. pt.y += vm.footerMarginTop;
  40057. ctx.textAlign = vm._footerAlign;
  40058. ctx.textBaseline = 'top';
  40059. ctx.fillStyle = mergeOpacity(vm.footerFontColor, opacity);
  40060. ctx.font = helpers.fontString(vm.footerFontSize, vm._footerFontStyle, vm._footerFontFamily);
  40061. helpers.each(footer, function(line) {
  40062. ctx.fillText(line, pt.x, pt.y);
  40063. pt.y += vm.footerFontSize + vm.footerSpacing;
  40064. });
  40065. }
  40066. },
  40067. drawBackground: function(pt, vm, ctx, tooltipSize, opacity) {
  40068. ctx.fillStyle = mergeOpacity(vm.backgroundColor, opacity);
  40069. helpers.drawRoundedRectangle(ctx, pt.x, pt.y, tooltipSize.width, tooltipSize.height, vm.cornerRadius);
  40070. ctx.fill();
  40071. },
  40072. draw: function() {
  40073. var ctx = this._chart.ctx;
  40074. var vm = this._view;
  40075. if (vm.opacity === 0) {
  40076. return;
  40077. }
  40078. var tooltipSize = {
  40079. width: vm.width,
  40080. height: vm.height
  40081. };
  40082. var pt = {
  40083. x: vm.x,
  40084. y: vm.y
  40085. };
  40086. // IE11/Edge does not like very small opacities, so snap to 0
  40087. var opacity = Math.abs(vm.opacity < 1e-3) ? 0 : vm.opacity;
  40088. if (this._options.enabled) {
  40089. // Draw Background
  40090. this.drawBackground(pt, vm, ctx, tooltipSize, opacity);
  40091. // Draw Caret
  40092. this.drawCaret(pt, tooltipSize, opacity);
  40093. // Draw Title, Body, and Footer
  40094. pt.x += vm.xPadding;
  40095. pt.y += vm.yPadding;
  40096. // Titles
  40097. this.drawTitle(pt, vm, ctx, opacity);
  40098. // Body
  40099. this.drawBody(pt, vm, ctx, opacity);
  40100. // Footer
  40101. this.drawFooter(pt, vm, ctx, opacity);
  40102. }
  40103. },
  40104. /**
  40105. * Handle an event
  40106. * @private
  40107. * @param {IEvent} event - The event to handle
  40108. * @returns {Boolean} true if the tooltip changed
  40109. */
  40110. handleEvent: function(e) {
  40111. var me = this;
  40112. var options = me._options;
  40113. var changed = false;
  40114. me._lastActive = me._lastActive || [];
  40115. // Find Active Elements for tooltips
  40116. if (e.type === 'mouseout') {
  40117. me._active = [];
  40118. } else {
  40119. me._active = me._chartInstance.getElementsAtEventForMode(e, options.mode, options);
  40120. }
  40121. // Remember Last Actives
  40122. changed = !helpers.arrayEquals(me._active, me._lastActive);
  40123. me._lastActive = me._active;
  40124. if (options.enabled || options.custom) {
  40125. me._eventPosition = {
  40126. x: e.x,
  40127. y: e.y
  40128. };
  40129. var model = me._model;
  40130. me.update(true);
  40131. me.pivot();
  40132. // See if our tooltip position changed
  40133. changed |= (model.x !== me._model.x) || (model.y !== me._model.y);
  40134. }
  40135. return changed;
  40136. }
  40137. });
  40138. /**
  40139. * @namespace Chart.Tooltip.positioners
  40140. */
  40141. Chart.Tooltip.positioners = {
  40142. /**
  40143. * Average mode places the tooltip at the average position of the elements shown
  40144. * @function Chart.Tooltip.positioners.average
  40145. * @param elements {ChartElement[]} the elements being displayed in the tooltip
  40146. * @returns {Point} tooltip position
  40147. */
  40148. average: function(elements) {
  40149. if (!elements.length) {
  40150. return false;
  40151. }
  40152. var i, len;
  40153. var x = 0;
  40154. var y = 0;
  40155. var count = 0;
  40156. for (i = 0, len = elements.length; i < len; ++i) {
  40157. var el = elements[i];
  40158. if (el && el.hasValue()) {
  40159. var pos = el.tooltipPosition();
  40160. x += pos.x;
  40161. y += pos.y;
  40162. ++count;
  40163. }
  40164. }
  40165. return {
  40166. x: Math.round(x / count),
  40167. y: Math.round(y / count)
  40168. };
  40169. },
  40170. /**
  40171. * Gets the tooltip position nearest of the item nearest to the event position
  40172. * @function Chart.Tooltip.positioners.nearest
  40173. * @param elements {Chart.Element[]} the tooltip elements
  40174. * @param eventPosition {Point} the position of the event in canvas coordinates
  40175. * @returns {Point} the tooltip position
  40176. */
  40177. nearest: function(elements, eventPosition) {
  40178. var x = eventPosition.x;
  40179. var y = eventPosition.y;
  40180. var nearestElement;
  40181. var minDistance = Number.POSITIVE_INFINITY;
  40182. var i, len;
  40183. for (i = 0, len = elements.length; i < len; ++i) {
  40184. var el = elements[i];
  40185. if (el && el.hasValue()) {
  40186. var center = el.getCenterPoint();
  40187. var d = helpers.distanceBetweenPoints(eventPosition, center);
  40188. if (d < minDistance) {
  40189. minDistance = d;
  40190. nearestElement = el;
  40191. }
  40192. }
  40193. }
  40194. if (nearestElement) {
  40195. var tp = nearestElement.tooltipPosition();
  40196. x = tp.x;
  40197. y = tp.y;
  40198. }
  40199. return {
  40200. x: x,
  40201. y: y
  40202. };
  40203. }
  40204. };
  40205. };
  40206. /***/ }),
  40207. /* 156 */
  40208. /***/ (function(module, exports, __webpack_require__) {
  40209. "use strict";
  40210. module.exports = function(Chart) {
  40211. var helpers = Chart.helpers,
  40212. globalOpts = Chart.defaults.global;
  40213. globalOpts.elements.arc = {
  40214. backgroundColor: globalOpts.defaultColor,
  40215. borderColor: '#fff',
  40216. borderWidth: 2
  40217. };
  40218. Chart.elements.Arc = Chart.Element.extend({
  40219. inLabelRange: function(mouseX) {
  40220. var vm = this._view;
  40221. if (vm) {
  40222. return (Math.pow(mouseX - vm.x, 2) < Math.pow(vm.radius + vm.hoverRadius, 2));
  40223. }
  40224. return false;
  40225. },
  40226. inRange: function(chartX, chartY) {
  40227. var vm = this._view;
  40228. if (vm) {
  40229. var pointRelativePosition = helpers.getAngleFromPoint(vm, {
  40230. x: chartX,
  40231. y: chartY
  40232. }),
  40233. angle = pointRelativePosition.angle,
  40234. distance = pointRelativePosition.distance;
  40235. // Sanitise angle range
  40236. var startAngle = vm.startAngle;
  40237. var endAngle = vm.endAngle;
  40238. while (endAngle < startAngle) {
  40239. endAngle += 2.0 * Math.PI;
  40240. }
  40241. while (angle > endAngle) {
  40242. angle -= 2.0 * Math.PI;
  40243. }
  40244. while (angle < startAngle) {
  40245. angle += 2.0 * Math.PI;
  40246. }
  40247. // Check if within the range of the open/close angle
  40248. var betweenAngles = (angle >= startAngle && angle <= endAngle),
  40249. withinRadius = (distance >= vm.innerRadius && distance <= vm.outerRadius);
  40250. return (betweenAngles && withinRadius);
  40251. }
  40252. return false;
  40253. },
  40254. getCenterPoint: function() {
  40255. var vm = this._view;
  40256. var halfAngle = (vm.startAngle + vm.endAngle) / 2;
  40257. var halfRadius = (vm.innerRadius + vm.outerRadius) / 2;
  40258. return {
  40259. x: vm.x + Math.cos(halfAngle) * halfRadius,
  40260. y: vm.y + Math.sin(halfAngle) * halfRadius
  40261. };
  40262. },
  40263. getArea: function() {
  40264. var vm = this._view;
  40265. return Math.PI * ((vm.endAngle - vm.startAngle) / (2 * Math.PI)) * (Math.pow(vm.outerRadius, 2) - Math.pow(vm.innerRadius, 2));
  40266. },
  40267. tooltipPosition: function() {
  40268. var vm = this._view;
  40269. var centreAngle = vm.startAngle + ((vm.endAngle - vm.startAngle) / 2),
  40270. rangeFromCentre = (vm.outerRadius - vm.innerRadius) / 2 + vm.innerRadius;
  40271. return {
  40272. x: vm.x + (Math.cos(centreAngle) * rangeFromCentre),
  40273. y: vm.y + (Math.sin(centreAngle) * rangeFromCentre)
  40274. };
  40275. },
  40276. draw: function() {
  40277. var ctx = this._chart.ctx,
  40278. vm = this._view,
  40279. sA = vm.startAngle,
  40280. eA = vm.endAngle;
  40281. ctx.beginPath();
  40282. ctx.arc(vm.x, vm.y, vm.outerRadius, sA, eA);
  40283. ctx.arc(vm.x, vm.y, vm.innerRadius, eA, sA, true);
  40284. ctx.closePath();
  40285. ctx.strokeStyle = vm.borderColor;
  40286. ctx.lineWidth = vm.borderWidth;
  40287. ctx.fillStyle = vm.backgroundColor;
  40288. ctx.fill();
  40289. ctx.lineJoin = 'bevel';
  40290. if (vm.borderWidth) {
  40291. ctx.stroke();
  40292. }
  40293. }
  40294. });
  40295. };
  40296. /***/ }),
  40297. /* 157 */
  40298. /***/ (function(module, exports, __webpack_require__) {
  40299. "use strict";
  40300. module.exports = function(Chart) {
  40301. var helpers = Chart.helpers;
  40302. var globalDefaults = Chart.defaults.global;
  40303. Chart.defaults.global.elements.line = {
  40304. tension: 0.4,
  40305. backgroundColor: globalDefaults.defaultColor,
  40306. borderWidth: 3,
  40307. borderColor: globalDefaults.defaultColor,
  40308. borderCapStyle: 'butt',
  40309. borderDash: [],
  40310. borderDashOffset: 0.0,
  40311. borderJoinStyle: 'miter',
  40312. capBezierPoints: true,
  40313. fill: true, // do we fill in the area between the line and its base axis
  40314. };
  40315. Chart.elements.Line = Chart.Element.extend({
  40316. draw: function() {
  40317. var me = this;
  40318. var vm = me._view;
  40319. var spanGaps = vm.spanGaps;
  40320. var fillPoint = vm.scaleZero;
  40321. var loop = me._loop;
  40322. // Handle different fill modes for cartesian lines
  40323. if (!loop) {
  40324. if (vm.fill === 'top') {
  40325. fillPoint = vm.scaleTop;
  40326. } else if (vm.fill === 'bottom') {
  40327. fillPoint = vm.scaleBottom;
  40328. }
  40329. }
  40330. var ctx = me._chart.ctx;
  40331. ctx.save();
  40332. // Helper function to draw a line to a point
  40333. function lineToPoint(previousPoint, point) {
  40334. var pointVM = point._view;
  40335. if (point._view.steppedLine === true) {
  40336. ctx.lineTo(pointVM.x, previousPoint._view.y);
  40337. ctx.lineTo(pointVM.x, pointVM.y);
  40338. } else if (point._view.tension === 0) {
  40339. ctx.lineTo(pointVM.x, pointVM.y);
  40340. } else {
  40341. ctx.bezierCurveTo(
  40342. previousPoint._view.controlPointNextX,
  40343. previousPoint._view.controlPointNextY,
  40344. pointVM.controlPointPreviousX,
  40345. pointVM.controlPointPreviousY,
  40346. pointVM.x,
  40347. pointVM.y
  40348. );
  40349. }
  40350. }
  40351. var points = me._children.slice(); // clone array
  40352. var lastDrawnIndex = -1;
  40353. // If we are looping, adding the first point again
  40354. if (loop && points.length) {
  40355. points.push(points[0]);
  40356. }
  40357. var index, current, previous, currentVM;
  40358. // Fill Line
  40359. if (points.length && vm.fill) {
  40360. ctx.beginPath();
  40361. for (index = 0; index < points.length; ++index) {
  40362. current = points[index];
  40363. previous = helpers.previousItem(points, index);
  40364. currentVM = current._view;
  40365. // First point moves to it's starting position no matter what
  40366. if (index === 0) {
  40367. if (loop) {
  40368. ctx.moveTo(fillPoint.x, fillPoint.y);
  40369. } else {
  40370. ctx.moveTo(currentVM.x, fillPoint);
  40371. }
  40372. if (!currentVM.skip) {
  40373. lastDrawnIndex = index;
  40374. ctx.lineTo(currentVM.x, currentVM.y);
  40375. }
  40376. } else {
  40377. previous = lastDrawnIndex === -1 ? previous : points[lastDrawnIndex];
  40378. if (currentVM.skip) {
  40379. // Only do this if this is the first point that is skipped
  40380. if (!spanGaps && lastDrawnIndex === (index - 1)) {
  40381. if (loop) {
  40382. ctx.lineTo(fillPoint.x, fillPoint.y);
  40383. } else {
  40384. ctx.lineTo(previous._view.x, fillPoint);
  40385. }
  40386. }
  40387. } else {
  40388. if (lastDrawnIndex !== (index - 1)) {
  40389. // There was a gap and this is the first point after the gap. If we've never drawn a point, this is a special case.
  40390. // If the first data point is NaN, then there is no real gap to skip
  40391. if (spanGaps && lastDrawnIndex !== -1) {
  40392. // We are spanning the gap, so simple draw a line to this point
  40393. lineToPoint(previous, current);
  40394. } else if (loop) {
  40395. ctx.lineTo(currentVM.x, currentVM.y);
  40396. } else {
  40397. ctx.lineTo(currentVM.x, fillPoint);
  40398. ctx.lineTo(currentVM.x, currentVM.y);
  40399. }
  40400. } else {
  40401. // Line to next point
  40402. lineToPoint(previous, current);
  40403. }
  40404. lastDrawnIndex = index;
  40405. }
  40406. }
  40407. }
  40408. if (!loop && lastDrawnIndex !== -1) {
  40409. ctx.lineTo(points[lastDrawnIndex]._view.x, fillPoint);
  40410. }
  40411. ctx.fillStyle = vm.backgroundColor || globalDefaults.defaultColor;
  40412. ctx.closePath();
  40413. ctx.fill();
  40414. }
  40415. // Stroke Line Options
  40416. var globalOptionLineElements = globalDefaults.elements.line;
  40417. ctx.lineCap = vm.borderCapStyle || globalOptionLineElements.borderCapStyle;
  40418. // IE 9 and 10 do not support line dash
  40419. if (ctx.setLineDash) {
  40420. ctx.setLineDash(vm.borderDash || globalOptionLineElements.borderDash);
  40421. }
  40422. ctx.lineDashOffset = vm.borderDashOffset || globalOptionLineElements.borderDashOffset;
  40423. ctx.lineJoin = vm.borderJoinStyle || globalOptionLineElements.borderJoinStyle;
  40424. ctx.lineWidth = vm.borderWidth || globalOptionLineElements.borderWidth;
  40425. ctx.strokeStyle = vm.borderColor || globalDefaults.defaultColor;
  40426. // Stroke Line
  40427. ctx.beginPath();
  40428. lastDrawnIndex = -1;
  40429. for (index = 0; index < points.length; ++index) {
  40430. current = points[index];
  40431. previous = helpers.previousItem(points, index);
  40432. currentVM = current._view;
  40433. // First point moves to it's starting position no matter what
  40434. if (index === 0) {
  40435. if (!currentVM.skip) {
  40436. ctx.moveTo(currentVM.x, currentVM.y);
  40437. lastDrawnIndex = index;
  40438. }
  40439. } else {
  40440. previous = lastDrawnIndex === -1 ? previous : points[lastDrawnIndex];
  40441. if (!currentVM.skip) {
  40442. if ((lastDrawnIndex !== (index - 1) && !spanGaps) || lastDrawnIndex === -1) {
  40443. // There was a gap and this is the first point after the gap
  40444. ctx.moveTo(currentVM.x, currentVM.y);
  40445. } else {
  40446. // Line to next point
  40447. lineToPoint(previous, current);
  40448. }
  40449. lastDrawnIndex = index;
  40450. }
  40451. }
  40452. }
  40453. ctx.stroke();
  40454. ctx.restore();
  40455. }
  40456. });
  40457. };
  40458. /***/ }),
  40459. /* 158 */
  40460. /***/ (function(module, exports, __webpack_require__) {
  40461. "use strict";
  40462. module.exports = function(Chart) {
  40463. var helpers = Chart.helpers,
  40464. globalOpts = Chart.defaults.global,
  40465. defaultColor = globalOpts.defaultColor;
  40466. globalOpts.elements.point = {
  40467. radius: 3,
  40468. pointStyle: 'circle',
  40469. backgroundColor: defaultColor,
  40470. borderWidth: 1,
  40471. borderColor: defaultColor,
  40472. // Hover
  40473. hitRadius: 1,
  40474. hoverRadius: 4,
  40475. hoverBorderWidth: 1
  40476. };
  40477. function xRange(mouseX) {
  40478. var vm = this._view;
  40479. return vm ? (Math.pow(mouseX - vm.x, 2) < Math.pow(vm.radius + vm.hitRadius, 2)) : false;
  40480. }
  40481. function yRange(mouseY) {
  40482. var vm = this._view;
  40483. return vm ? (Math.pow(mouseY - vm.y, 2) < Math.pow(vm.radius + vm.hitRadius, 2)) : false;
  40484. }
  40485. Chart.elements.Point = Chart.Element.extend({
  40486. inRange: function(mouseX, mouseY) {
  40487. var vm = this._view;
  40488. return vm ? ((Math.pow(mouseX - vm.x, 2) + Math.pow(mouseY - vm.y, 2)) < Math.pow(vm.hitRadius + vm.radius, 2)) : false;
  40489. },
  40490. inLabelRange: xRange,
  40491. inXRange: xRange,
  40492. inYRange: yRange,
  40493. getCenterPoint: function() {
  40494. var vm = this._view;
  40495. return {
  40496. x: vm.x,
  40497. y: vm.y
  40498. };
  40499. },
  40500. getArea: function() {
  40501. return Math.PI * Math.pow(this._view.radius, 2);
  40502. },
  40503. tooltipPosition: function() {
  40504. var vm = this._view;
  40505. return {
  40506. x: vm.x,
  40507. y: vm.y,
  40508. padding: vm.radius + vm.borderWidth
  40509. };
  40510. },
  40511. draw: function(chartArea) {
  40512. var vm = this._view;
  40513. var model = this._model;
  40514. var ctx = this._chart.ctx;
  40515. var pointStyle = vm.pointStyle;
  40516. var radius = vm.radius;
  40517. var x = vm.x;
  40518. var y = vm.y;
  40519. var color = Chart.helpers.color;
  40520. var errMargin = 1.01; // 1.01 is margin for Accumulated error. (Especially Edge, IE.)
  40521. var ratio = 0;
  40522. if (vm.skip) {
  40523. return;
  40524. }
  40525. ctx.strokeStyle = vm.borderColor || defaultColor;
  40526. ctx.lineWidth = helpers.getValueOrDefault(vm.borderWidth, globalOpts.elements.point.borderWidth);
  40527. ctx.fillStyle = vm.backgroundColor || defaultColor;
  40528. // Cliping for Points.
  40529. // going out from inner charArea?
  40530. if ((chartArea !== undefined) && ((model.x < chartArea.left) || (chartArea.right*errMargin < model.x) || (model.y < chartArea.top) || (chartArea.bottom*errMargin < model.y))) {
  40531. // Point fade out
  40532. if (model.x < chartArea.left) {
  40533. ratio = (x - model.x) / (chartArea.left - model.x);
  40534. } else if (chartArea.right*errMargin < model.x) {
  40535. ratio = (model.x - x) / (model.x - chartArea.right);
  40536. } else if (model.y < chartArea.top) {
  40537. ratio = (y - model.y) / (chartArea.top - model.y);
  40538. } else if (chartArea.bottom*errMargin < model.y) {
  40539. ratio = (model.y - y) / (model.y - chartArea.bottom);
  40540. }
  40541. ratio = Math.round(ratio*100) / 100;
  40542. ctx.strokeStyle = color(ctx.strokeStyle).alpha(ratio).rgbString();
  40543. ctx.fillStyle = color(ctx.fillStyle).alpha(ratio).rgbString();
  40544. }
  40545. Chart.canvasHelpers.drawPoint(ctx, pointStyle, radius, x, y);
  40546. }
  40547. });
  40548. };
  40549. /***/ }),
  40550. /* 159 */
  40551. /***/ (function(module, exports, __webpack_require__) {
  40552. "use strict";
  40553. module.exports = function(Chart) {
  40554. var globalOpts = Chart.defaults.global;
  40555. globalOpts.elements.rectangle = {
  40556. backgroundColor: globalOpts.defaultColor,
  40557. borderWidth: 0,
  40558. borderColor: globalOpts.defaultColor,
  40559. borderSkipped: 'bottom'
  40560. };
  40561. function isVertical(bar) {
  40562. return bar._view.width !== undefined;
  40563. }
  40564. /**
  40565. * Helper function to get the bounds of the bar regardless of the orientation
  40566. * @private
  40567. * @param bar {Chart.Element.Rectangle} the bar
  40568. * @return {Bounds} bounds of the bar
  40569. */
  40570. function getBarBounds(bar) {
  40571. var vm = bar._view;
  40572. var x1, x2, y1, y2;
  40573. if (isVertical(bar)) {
  40574. // vertical
  40575. var halfWidth = vm.width / 2;
  40576. x1 = vm.x - halfWidth;
  40577. x2 = vm.x + halfWidth;
  40578. y1 = Math.min(vm.y, vm.base);
  40579. y2 = Math.max(vm.y, vm.base);
  40580. } else {
  40581. // horizontal bar
  40582. var halfHeight = vm.height / 2;
  40583. x1 = Math.min(vm.x, vm.base);
  40584. x2 = Math.max(vm.x, vm.base);
  40585. y1 = vm.y - halfHeight;
  40586. y2 = vm.y + halfHeight;
  40587. }
  40588. return {
  40589. left: x1,
  40590. top: y1,
  40591. right: x2,
  40592. bottom: y2
  40593. };
  40594. }
  40595. Chart.elements.Rectangle = Chart.Element.extend({
  40596. draw: function() {
  40597. var ctx = this._chart.ctx;
  40598. var vm = this._view;
  40599. var left, right, top, bottom, signX, signY, borderSkipped;
  40600. var borderWidth = vm.borderWidth;
  40601. if (!vm.horizontal) {
  40602. // bar
  40603. left = vm.x - vm.width / 2;
  40604. right = vm.x + vm.width / 2;
  40605. top = vm.y;
  40606. bottom = vm.base;
  40607. signX = 1;
  40608. signY = bottom > top? 1: -1;
  40609. borderSkipped = vm.borderSkipped || 'bottom';
  40610. } else {
  40611. // horizontal bar
  40612. left = vm.base;
  40613. right = vm.x;
  40614. top = vm.y - vm.height / 2;
  40615. bottom = vm.y + vm.height / 2;
  40616. signX = right > left? 1: -1;
  40617. signY = 1;
  40618. borderSkipped = vm.borderSkipped || 'left';
  40619. }
  40620. // Canvas doesn't allow us to stroke inside the width so we can
  40621. // adjust the sizes to fit if we're setting a stroke on the line
  40622. if (borderWidth) {
  40623. // borderWidth shold be less than bar width and bar height.
  40624. var barSize = Math.min(Math.abs(left - right), Math.abs(top - bottom));
  40625. borderWidth = borderWidth > barSize? barSize: borderWidth;
  40626. var halfStroke = borderWidth / 2;
  40627. // Adjust borderWidth when bar top position is near vm.base(zero).
  40628. var borderLeft = left + (borderSkipped !== 'left'? halfStroke * signX: 0);
  40629. var borderRight = right + (borderSkipped !== 'right'? -halfStroke * signX: 0);
  40630. var borderTop = top + (borderSkipped !== 'top'? halfStroke * signY: 0);
  40631. var borderBottom = bottom + (borderSkipped !== 'bottom'? -halfStroke * signY: 0);
  40632. // not become a vertical line?
  40633. if (borderLeft !== borderRight) {
  40634. top = borderTop;
  40635. bottom = borderBottom;
  40636. }
  40637. // not become a horizontal line?
  40638. if (borderTop !== borderBottom) {
  40639. left = borderLeft;
  40640. right = borderRight;
  40641. }
  40642. }
  40643. ctx.beginPath();
  40644. ctx.fillStyle = vm.backgroundColor;
  40645. ctx.strokeStyle = vm.borderColor;
  40646. ctx.lineWidth = borderWidth;
  40647. // Corner points, from bottom-left to bottom-right clockwise
  40648. // | 1 2 |
  40649. // | 0 3 |
  40650. var corners = [
  40651. [left, bottom],
  40652. [left, top],
  40653. [right, top],
  40654. [right, bottom]
  40655. ];
  40656. // Find first (starting) corner with fallback to 'bottom'
  40657. var borders = ['bottom', 'left', 'top', 'right'];
  40658. var startCorner = borders.indexOf(borderSkipped, 0);
  40659. if (startCorner === -1) {
  40660. startCorner = 0;
  40661. }
  40662. function cornerAt(index) {
  40663. return corners[(startCorner + index) % 4];
  40664. }
  40665. // Draw rectangle from 'startCorner'
  40666. var corner = cornerAt(0);
  40667. ctx.moveTo(corner[0], corner[1]);
  40668. for (var i = 1; i < 4; i++) {
  40669. corner = cornerAt(i);
  40670. ctx.lineTo(corner[0], corner[1]);
  40671. }
  40672. ctx.fill();
  40673. if (borderWidth) {
  40674. ctx.stroke();
  40675. }
  40676. },
  40677. height: function() {
  40678. var vm = this._view;
  40679. return vm.base - vm.y;
  40680. },
  40681. inRange: function(mouseX, mouseY) {
  40682. var inRange = false;
  40683. if (this._view) {
  40684. var bounds = getBarBounds(this);
  40685. inRange = mouseX >= bounds.left && mouseX <= bounds.right && mouseY >= bounds.top && mouseY <= bounds.bottom;
  40686. }
  40687. return inRange;
  40688. },
  40689. inLabelRange: function(mouseX, mouseY) {
  40690. var me = this;
  40691. if (!me._view) {
  40692. return false;
  40693. }
  40694. var inRange = false;
  40695. var bounds = getBarBounds(me);
  40696. if (isVertical(me)) {
  40697. inRange = mouseX >= bounds.left && mouseX <= bounds.right;
  40698. } else {
  40699. inRange = mouseY >= bounds.top && mouseY <= bounds.bottom;
  40700. }
  40701. return inRange;
  40702. },
  40703. inXRange: function(mouseX) {
  40704. var bounds = getBarBounds(this);
  40705. return mouseX >= bounds.left && mouseX <= bounds.right;
  40706. },
  40707. inYRange: function(mouseY) {
  40708. var bounds = getBarBounds(this);
  40709. return mouseY >= bounds.top && mouseY <= bounds.bottom;
  40710. },
  40711. getCenterPoint: function() {
  40712. var vm = this._view;
  40713. var x, y;
  40714. if (isVertical(this)) {
  40715. x = vm.x;
  40716. y = (vm.y + vm.base) / 2;
  40717. } else {
  40718. x = (vm.x + vm.base) / 2;
  40719. y = vm.y;
  40720. }
  40721. return {x: x, y: y};
  40722. },
  40723. getArea: function() {
  40724. var vm = this._view;
  40725. return vm.width * Math.abs(vm.y - vm.base);
  40726. },
  40727. tooltipPosition: function() {
  40728. var vm = this._view;
  40729. return {
  40730. x: vm.x,
  40731. y: vm.y
  40732. };
  40733. }
  40734. });
  40735. };
  40736. /***/ }),
  40737. /* 160 */
  40738. /***/ (function(module, exports, __webpack_require__) {
  40739. "use strict";
  40740. // Chart.Platform implementation for targeting a web browser
  40741. module.exports = function(Chart) {
  40742. var helpers = Chart.helpers;
  40743. // DOM event types -> Chart.js event types.
  40744. // Note: only events with different types are mapped.
  40745. // https://developer.mozilla.org/en-US/docs/Web/Events
  40746. var eventTypeMap = {
  40747. // Touch events
  40748. touchstart: 'mousedown',
  40749. touchmove: 'mousemove',
  40750. touchend: 'mouseup',
  40751. // Pointer events
  40752. pointerenter: 'mouseenter',
  40753. pointerdown: 'mousedown',
  40754. pointermove: 'mousemove',
  40755. pointerup: 'mouseup',
  40756. pointerleave: 'mouseout',
  40757. pointerout: 'mouseout'
  40758. };
  40759. /**
  40760. * The "used" size is the final value of a dimension property after all calculations have
  40761. * been performed. This method uses the computed style of `element` but returns undefined
  40762. * if the computed style is not expressed in pixels. That can happen in some cases where
  40763. * `element` has a size relative to its parent and this last one is not yet displayed,
  40764. * for example because of `display: none` on a parent node.
  40765. * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value
  40766. * @returns {Number} Size in pixels or undefined if unknown.
  40767. */
  40768. function readUsedSize(element, property) {
  40769. var value = helpers.getStyle(element, property);
  40770. var matches = value && value.match(/(\d+)px/);
  40771. return matches? Number(matches[1]) : undefined;
  40772. }
  40773. /**
  40774. * Initializes the canvas style and render size without modifying the canvas display size,
  40775. * since responsiveness is handled by the controller.resize() method. The config is used
  40776. * to determine the aspect ratio to apply in case no explicit height has been specified.
  40777. */
  40778. function initCanvas(canvas, config) {
  40779. var style = canvas.style;
  40780. // NOTE(SB) canvas.getAttribute('width') !== canvas.width: in the first case it
  40781. // returns null or '' if no explicit value has been set to the canvas attribute.
  40782. var renderHeight = canvas.getAttribute('height');
  40783. var renderWidth = canvas.getAttribute('width');
  40784. // Chart.js modifies some canvas values that we want to restore on destroy
  40785. canvas._chartjs = {
  40786. initial: {
  40787. height: renderHeight,
  40788. width: renderWidth,
  40789. style: {
  40790. display: style.display,
  40791. height: style.height,
  40792. width: style.width
  40793. }
  40794. }
  40795. };
  40796. // Force canvas to display as block to avoid extra space caused by inline
  40797. // elements, which would interfere with the responsive resize process.
  40798. // https://github.com/chartjs/Chart.js/issues/2538
  40799. style.display = style.display || 'block';
  40800. if (renderWidth === null || renderWidth === '') {
  40801. var displayWidth = readUsedSize(canvas, 'width');
  40802. if (displayWidth !== undefined) {
  40803. canvas.width = displayWidth;
  40804. }
  40805. }
  40806. if (renderHeight === null || renderHeight === '') {
  40807. if (canvas.style.height === '') {
  40808. // If no explicit render height and style height, let's apply the aspect ratio,
  40809. // which one can be specified by the user but also by charts as default option
  40810. // (i.e. options.aspectRatio). If not specified, use canvas aspect ratio of 2.
  40811. canvas.height = canvas.width / (config.options.aspectRatio || 2);
  40812. } else {
  40813. var displayHeight = readUsedSize(canvas, 'height');
  40814. if (displayWidth !== undefined) {
  40815. canvas.height = displayHeight;
  40816. }
  40817. }
  40818. }
  40819. return canvas;
  40820. }
  40821. function createEvent(type, chart, x, y, native) {
  40822. return {
  40823. type: type,
  40824. chart: chart,
  40825. native: native || null,
  40826. x: x !== undefined? x : null,
  40827. y: y !== undefined? y : null,
  40828. };
  40829. }
  40830. function fromNativeEvent(event, chart) {
  40831. var type = eventTypeMap[event.type] || event.type;
  40832. var pos = helpers.getRelativePosition(event, chart);
  40833. return createEvent(type, chart, pos.x, pos.y, event);
  40834. }
  40835. function createResizer(handler) {
  40836. var iframe = document.createElement('iframe');
  40837. iframe.className = 'chartjs-hidden-iframe';
  40838. iframe.style.cssText =
  40839. 'display:block;'+
  40840. 'overflow:hidden;'+
  40841. 'border:0;'+
  40842. 'margin:0;'+
  40843. 'top:0;'+
  40844. 'left:0;'+
  40845. 'bottom:0;'+
  40846. 'right:0;'+
  40847. 'height:100%;'+
  40848. 'width:100%;'+
  40849. 'position:absolute;'+
  40850. 'pointer-events:none;'+
  40851. 'z-index:-1;';
  40852. // Prevent the iframe to gain focus on tab.
  40853. // https://github.com/chartjs/Chart.js/issues/3090
  40854. iframe.tabIndex = -1;
  40855. // If the iframe is re-attached to the DOM, the resize listener is removed because the
  40856. // content is reloaded, so make sure to install the handler after the iframe is loaded.
  40857. // https://github.com/chartjs/Chart.js/issues/3521
  40858. helpers.addEvent(iframe, 'load', function() {
  40859. helpers.addEvent(iframe.contentWindow || iframe, 'resize', handler);
  40860. // The iframe size might have changed while loading, which can also
  40861. // happen if the size has been changed while detached from the DOM.
  40862. handler();
  40863. });
  40864. return iframe;
  40865. }
  40866. function addResizeListener(node, listener, chart) {
  40867. var stub = node._chartjs = {
  40868. ticking: false
  40869. };
  40870. // Throttle the callback notification until the next animation frame.
  40871. var notify = function() {
  40872. if (!stub.ticking) {
  40873. stub.ticking = true;
  40874. helpers.requestAnimFrame.call(window, function() {
  40875. if (stub.resizer) {
  40876. stub.ticking = false;
  40877. return listener(createEvent('resize', chart));
  40878. }
  40879. });
  40880. }
  40881. };
  40882. // Let's keep track of this added iframe and thus avoid DOM query when removing it.
  40883. stub.resizer = createResizer(notify);
  40884. node.insertBefore(stub.resizer, node.firstChild);
  40885. }
  40886. function removeResizeListener(node) {
  40887. if (!node || !node._chartjs) {
  40888. return;
  40889. }
  40890. var resizer = node._chartjs.resizer;
  40891. if (resizer) {
  40892. resizer.parentNode.removeChild(resizer);
  40893. node._chartjs.resizer = null;
  40894. }
  40895. delete node._chartjs;
  40896. }
  40897. return {
  40898. acquireContext: function(item, config) {
  40899. if (typeof item === 'string') {
  40900. item = document.getElementById(item);
  40901. } else if (item.length) {
  40902. // Support for array based queries (such as jQuery)
  40903. item = item[0];
  40904. }
  40905. if (item && item.canvas) {
  40906. // Support for any object associated to a canvas (including a context2d)
  40907. item = item.canvas;
  40908. }
  40909. if (item instanceof HTMLCanvasElement) {
  40910. // To prevent canvas fingerprinting, some add-ons undefine the getContext
  40911. // method, for example: https://github.com/kkapsner/CanvasBlocker
  40912. // https://github.com/chartjs/Chart.js/issues/2807
  40913. var context = item.getContext && item.getContext('2d');
  40914. if (context instanceof CanvasRenderingContext2D) {
  40915. initCanvas(item, config);
  40916. return context;
  40917. }
  40918. }
  40919. return null;
  40920. },
  40921. releaseContext: function(context) {
  40922. var canvas = context.canvas;
  40923. if (!canvas._chartjs) {
  40924. return;
  40925. }
  40926. var initial = canvas._chartjs.initial;
  40927. ['height', 'width'].forEach(function(prop) {
  40928. var value = initial[prop];
  40929. if (value === undefined || value === null) {
  40930. canvas.removeAttribute(prop);
  40931. } else {
  40932. canvas.setAttribute(prop, value);
  40933. }
  40934. });
  40935. helpers.each(initial.style || {}, function(value, key) {
  40936. canvas.style[key] = value;
  40937. });
  40938. // The canvas render size might have been changed (and thus the state stack discarded),
  40939. // we can't use save() and restore() to restore the initial state. So make sure that at
  40940. // least the canvas context is reset to the default state by setting the canvas width.
  40941. // https://www.w3.org/TR/2011/WD-html5-20110525/the-canvas-element.html
  40942. canvas.width = canvas.width;
  40943. delete canvas._chartjs;
  40944. },
  40945. addEventListener: function(chart, type, listener) {
  40946. var canvas = chart.chart.canvas;
  40947. if (type === 'resize') {
  40948. // Note: the resize event is not supported on all browsers.
  40949. addResizeListener(canvas.parentNode, listener, chart.chart);
  40950. return;
  40951. }
  40952. var stub = listener._chartjs || (listener._chartjs = {});
  40953. var proxies = stub.proxies || (stub.proxies = {});
  40954. var proxy = proxies[chart.id + '_' + type] = function(event) {
  40955. listener(fromNativeEvent(event, chart.chart));
  40956. };
  40957. helpers.addEvent(canvas, type, proxy);
  40958. },
  40959. removeEventListener: function(chart, type, listener) {
  40960. var canvas = chart.chart.canvas;
  40961. if (type === 'resize') {
  40962. // Note: the resize event is not supported on all browsers.
  40963. removeResizeListener(canvas.parentNode, listener);
  40964. return;
  40965. }
  40966. var stub = listener._chartjs || {};
  40967. var proxies = stub.proxies || {};
  40968. var proxy = proxies[chart.id + '_' + type];
  40969. if (!proxy) {
  40970. return;
  40971. }
  40972. helpers.removeEvent(canvas, type, proxy);
  40973. }
  40974. };
  40975. };
  40976. /***/ }),
  40977. /* 161 */
  40978. /***/ (function(module, exports, __webpack_require__) {
  40979. "use strict";
  40980. // By default, select the browser (DOM) platform.
  40981. // @TODO Make possible to select another platform at build time.
  40982. var implementation = __webpack_require__(160);
  40983. module.exports = function(Chart) {
  40984. /**
  40985. * @namespace Chart.platform
  40986. * @see https://chartjs.gitbooks.io/proposals/content/Platform.html
  40987. * @since 2.4.0
  40988. */
  40989. Chart.platform = {
  40990. /**
  40991. * Called at chart construction time, returns a context2d instance implementing
  40992. * the [W3C Canvas 2D Context API standard]{@link https://www.w3.org/TR/2dcontext/}.
  40993. * @param {*} item - The native item from which to acquire context (platform specific)
  40994. * @param {Object} options - The chart options
  40995. * @returns {CanvasRenderingContext2D} context2d instance
  40996. */
  40997. acquireContext: function() {},
  40998. /**
  40999. * Called at chart destruction time, releases any resources associated to the context
  41000. * previously returned by the acquireContext() method.
  41001. * @param {CanvasRenderingContext2D} context - The context2d instance
  41002. * @returns {Boolean} true if the method succeeded, else false
  41003. */
  41004. releaseContext: function() {},
  41005. /**
  41006. * Registers the specified listener on the given chart.
  41007. * @param {Chart} chart - Chart from which to listen for event
  41008. * @param {String} type - The ({@link IEvent}) type to listen for
  41009. * @param {Function} listener - Receives a notification (an object that implements
  41010. * the {@link IEvent} interface) when an event of the specified type occurs.
  41011. */
  41012. addEventListener: function() {},
  41013. /**
  41014. * Removes the specified listener previously registered with addEventListener.
  41015. * @param {Chart} chart -Chart from which to remove the listener
  41016. * @param {String} type - The ({@link IEvent}) type to remove
  41017. * @param {Function} listener - The listener function to remove from the event target.
  41018. */
  41019. removeEventListener: function() {}
  41020. };
  41021. /**
  41022. * @interface IPlatform
  41023. * Allows abstracting platform dependencies away from the chart
  41024. * @borrows Chart.platform.acquireContext as acquireContext
  41025. * @borrows Chart.platform.releaseContext as releaseContext
  41026. * @borrows Chart.platform.addEventListener as addEventListener
  41027. * @borrows Chart.platform.removeEventListener as removeEventListener
  41028. */
  41029. /**
  41030. * @interface IEvent
  41031. * @prop {String} type - The event type name, possible values are:
  41032. * 'contextmenu', 'mouseenter', 'mousedown', 'mousemove', 'mouseup', 'mouseout',
  41033. * 'click', 'dblclick', 'keydown', 'keypress', 'keyup' and 'resize'
  41034. * @prop {*} native - The original native event (null for emulated events, e.g. 'resize')
  41035. * @prop {Number} x - The mouse x position, relative to the canvas (null for incompatible events)
  41036. * @prop {Number} y - The mouse y position, relative to the canvas (null for incompatible events)
  41037. */
  41038. Chart.helpers.extend(Chart.platform, implementation(Chart));
  41039. };
  41040. /***/ }),
  41041. /* 162 */
  41042. /***/ (function(module, exports, __webpack_require__) {
  41043. "use strict";
  41044. module.exports = function(Chart) {
  41045. var helpers = Chart.helpers;
  41046. // Default config for a category scale
  41047. var defaultConfig = {
  41048. position: 'bottom'
  41049. };
  41050. var DatasetScale = Chart.Scale.extend({
  41051. /**
  41052. * Internal function to get the correct labels. If data.xLabels or data.yLabels are defined, use those
  41053. * else fall back to data.labels
  41054. * @private
  41055. */
  41056. getLabels: function() {
  41057. var data = this.chart.data;
  41058. return (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels;
  41059. },
  41060. // Implement this so that
  41061. determineDataLimits: function() {
  41062. var me = this;
  41063. var labels = me.getLabels();
  41064. me.minIndex = 0;
  41065. me.maxIndex = labels.length - 1;
  41066. var findIndex;
  41067. if (me.options.ticks.min !== undefined) {
  41068. // user specified min value
  41069. findIndex = helpers.indexOf(labels, me.options.ticks.min);
  41070. me.minIndex = findIndex !== -1 ? findIndex : me.minIndex;
  41071. }
  41072. if (me.options.ticks.max !== undefined) {
  41073. // user specified max value
  41074. findIndex = helpers.indexOf(labels, me.options.ticks.max);
  41075. me.maxIndex = findIndex !== -1 ? findIndex : me.maxIndex;
  41076. }
  41077. me.min = labels[me.minIndex];
  41078. me.max = labels[me.maxIndex];
  41079. },
  41080. buildTicks: function() {
  41081. var me = this;
  41082. var labels = me.getLabels();
  41083. // If we are viewing some subset of labels, slice the original array
  41084. me.ticks = (me.minIndex === 0 && me.maxIndex === labels.length - 1) ? labels : labels.slice(me.minIndex, me.maxIndex + 1);
  41085. },
  41086. getLabelForIndex: function(index, datasetIndex) {
  41087. var me = this;
  41088. var data = me.chart.data;
  41089. var isHorizontal = me.isHorizontal();
  41090. if (data.yLabels && !isHorizontal) {
  41091. return me.getRightValue(data.datasets[datasetIndex].data[index]);
  41092. }
  41093. return me.ticks[index - me.minIndex];
  41094. },
  41095. // Used to get data value locations. Value can either be an index or a numerical value
  41096. getPixelForValue: function(value, index, datasetIndex, includeOffset) {
  41097. var me = this;
  41098. // 1 is added because we need the length but we have the indexes
  41099. var offsetAmt = Math.max((me.maxIndex + 1 - me.minIndex - ((me.options.gridLines.offsetGridLines) ? 0 : 1)), 1);
  41100. if (value !== undefined && isNaN(index)) {
  41101. var labels = me.getLabels();
  41102. var idx = labels.indexOf(value);
  41103. index = idx !== -1 ? idx : index;
  41104. }
  41105. if (me.isHorizontal()) {
  41106. var valueWidth = me.width / offsetAmt;
  41107. var widthOffset = (valueWidth * (index - me.minIndex));
  41108. if (me.options.gridLines.offsetGridLines && includeOffset || me.maxIndex === me.minIndex && includeOffset) {
  41109. widthOffset += (valueWidth / 2);
  41110. }
  41111. return me.left + Math.round(widthOffset);
  41112. }
  41113. var valueHeight = me.height / offsetAmt;
  41114. var heightOffset = (valueHeight * (index - me.minIndex));
  41115. if (me.options.gridLines.offsetGridLines && includeOffset) {
  41116. heightOffset += (valueHeight / 2);
  41117. }
  41118. return me.top + Math.round(heightOffset);
  41119. },
  41120. getPixelForTick: function(index, includeOffset) {
  41121. return this.getPixelForValue(this.ticks[index], index + this.minIndex, null, includeOffset);
  41122. },
  41123. getValueForPixel: function(pixel) {
  41124. var me = this;
  41125. var value;
  41126. var offsetAmt = Math.max((me.ticks.length - ((me.options.gridLines.offsetGridLines) ? 0 : 1)), 1);
  41127. var horz = me.isHorizontal();
  41128. var valueDimension = (horz ? me.width : me.height) / offsetAmt;
  41129. pixel -= horz ? me.left : me.top;
  41130. if (me.options.gridLines.offsetGridLines) {
  41131. pixel -= (valueDimension / 2);
  41132. }
  41133. if (pixel <= 0) {
  41134. value = 0;
  41135. } else {
  41136. value = Math.round(pixel / valueDimension);
  41137. }
  41138. return value;
  41139. },
  41140. getBasePixel: function() {
  41141. return this.bottom;
  41142. }
  41143. });
  41144. Chart.scaleService.registerScaleType('category', DatasetScale, defaultConfig);
  41145. };
  41146. /***/ }),
  41147. /* 163 */
  41148. /***/ (function(module, exports, __webpack_require__) {
  41149. "use strict";
  41150. module.exports = function(Chart) {
  41151. var helpers = Chart.helpers;
  41152. var defaultConfig = {
  41153. position: 'left',
  41154. ticks: {
  41155. callback: Chart.Ticks.formatters.linear
  41156. }
  41157. };
  41158. var LinearScale = Chart.LinearScaleBase.extend({
  41159. determineDataLimits: function() {
  41160. var me = this;
  41161. var opts = me.options;
  41162. var chart = me.chart;
  41163. var data = chart.data;
  41164. var datasets = data.datasets;
  41165. var isHorizontal = me.isHorizontal();
  41166. function IDMatches(meta) {
  41167. return isHorizontal ? meta.xAxisID === me.id : meta.yAxisID === me.id;
  41168. }
  41169. // First Calculate the range
  41170. me.min = null;
  41171. me.max = null;
  41172. var hasStacks = opts.stacked;
  41173. if (hasStacks === undefined) {
  41174. helpers.each(datasets, function(dataset, datasetIndex) {
  41175. if (hasStacks) {
  41176. return;
  41177. }
  41178. var meta = chart.getDatasetMeta(datasetIndex);
  41179. if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta) &&
  41180. meta.stack !== undefined) {
  41181. hasStacks = true;
  41182. }
  41183. });
  41184. }
  41185. if (opts.stacked || hasStacks) {
  41186. var valuesPerStack = {};
  41187. helpers.each(datasets, function(dataset, datasetIndex) {
  41188. var meta = chart.getDatasetMeta(datasetIndex);
  41189. var key = [
  41190. meta.type,
  41191. // we have a separate stack for stack=undefined datasets when the opts.stacked is undefined
  41192. ((opts.stacked === undefined && meta.stack === undefined) ? datasetIndex : ''),
  41193. meta.stack
  41194. ].join('.');
  41195. if (valuesPerStack[key] === undefined) {
  41196. valuesPerStack[key] = {
  41197. positiveValues: [],
  41198. negativeValues: []
  41199. };
  41200. }
  41201. // Store these per type
  41202. var positiveValues = valuesPerStack[key].positiveValues;
  41203. var negativeValues = valuesPerStack[key].negativeValues;
  41204. if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {
  41205. helpers.each(dataset.data, function(rawValue, index) {
  41206. var value = +me.getRightValue(rawValue);
  41207. if (isNaN(value) || meta.data[index].hidden) {
  41208. return;
  41209. }
  41210. positiveValues[index] = positiveValues[index] || 0;
  41211. negativeValues[index] = negativeValues[index] || 0;
  41212. if (opts.relativePoints) {
  41213. positiveValues[index] = 100;
  41214. } else if (value < 0) {
  41215. negativeValues[index] += value;
  41216. } else {
  41217. positiveValues[index] += value;
  41218. }
  41219. });
  41220. }
  41221. });
  41222. helpers.each(valuesPerStack, function(valuesForType) {
  41223. var values = valuesForType.positiveValues.concat(valuesForType.negativeValues);
  41224. var minVal = helpers.min(values);
  41225. var maxVal = helpers.max(values);
  41226. me.min = me.min === null ? minVal : Math.min(me.min, minVal);
  41227. me.max = me.max === null ? maxVal : Math.max(me.max, maxVal);
  41228. });
  41229. } else {
  41230. helpers.each(datasets, function(dataset, datasetIndex) {
  41231. var meta = chart.getDatasetMeta(datasetIndex);
  41232. if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {
  41233. helpers.each(dataset.data, function(rawValue, index) {
  41234. var value = +me.getRightValue(rawValue);
  41235. if (isNaN(value) || meta.data[index].hidden) {
  41236. return;
  41237. }
  41238. if (me.min === null) {
  41239. me.min = value;
  41240. } else if (value < me.min) {
  41241. me.min = value;
  41242. }
  41243. if (me.max === null) {
  41244. me.max = value;
  41245. } else if (value > me.max) {
  41246. me.max = value;
  41247. }
  41248. });
  41249. }
  41250. });
  41251. }
  41252. // Common base implementation to handle ticks.min, ticks.max, ticks.beginAtZero
  41253. this.handleTickRangeOptions();
  41254. },
  41255. getTickLimit: function() {
  41256. var maxTicks;
  41257. var me = this;
  41258. var tickOpts = me.options.ticks;
  41259. if (me.isHorizontal()) {
  41260. maxTicks = Math.min(tickOpts.maxTicksLimit ? tickOpts.maxTicksLimit : 11, Math.ceil(me.width / 50));
  41261. } else {
  41262. // The factor of 2 used to scale the font size has been experimentally determined.
  41263. var tickFontSize = helpers.getValueOrDefault(tickOpts.fontSize, Chart.defaults.global.defaultFontSize);
  41264. maxTicks = Math.min(tickOpts.maxTicksLimit ? tickOpts.maxTicksLimit : 11, Math.ceil(me.height / (2 * tickFontSize)));
  41265. }
  41266. return maxTicks;
  41267. },
  41268. // Called after the ticks are built. We need
  41269. handleDirectionalChanges: function() {
  41270. if (!this.isHorizontal()) {
  41271. // We are in a vertical orientation. The top value is the highest. So reverse the array
  41272. this.ticks.reverse();
  41273. }
  41274. },
  41275. getLabelForIndex: function(index, datasetIndex) {
  41276. return +this.getRightValue(this.chart.data.datasets[datasetIndex].data[index]);
  41277. },
  41278. // Utils
  41279. getPixelForValue: function(value) {
  41280. // This must be called after fit has been run so that
  41281. // this.left, this.top, this.right, and this.bottom have been defined
  41282. var me = this;
  41283. var start = me.start;
  41284. var rightValue = +me.getRightValue(value);
  41285. var pixel;
  41286. var range = me.end - start;
  41287. if (me.isHorizontal()) {
  41288. pixel = me.left + (me.width / range * (rightValue - start));
  41289. return Math.round(pixel);
  41290. }
  41291. pixel = me.bottom - (me.height / range * (rightValue - start));
  41292. return Math.round(pixel);
  41293. },
  41294. getValueForPixel: function(pixel) {
  41295. var me = this;
  41296. var isHorizontal = me.isHorizontal();
  41297. var innerDimension = isHorizontal ? me.width : me.height;
  41298. var offset = (isHorizontal ? pixel - me.left : me.bottom - pixel) / innerDimension;
  41299. return me.start + ((me.end - me.start) * offset);
  41300. },
  41301. getPixelForTick: function(index) {
  41302. return this.getPixelForValue(this.ticksAsNumbers[index]);
  41303. }
  41304. });
  41305. Chart.scaleService.registerScaleType('linear', LinearScale, defaultConfig);
  41306. };
  41307. /***/ }),
  41308. /* 164 */
  41309. /***/ (function(module, exports, __webpack_require__) {
  41310. "use strict";
  41311. module.exports = function(Chart) {
  41312. var helpers = Chart.helpers,
  41313. noop = helpers.noop;
  41314. Chart.LinearScaleBase = Chart.Scale.extend({
  41315. handleTickRangeOptions: function() {
  41316. var me = this;
  41317. var opts = me.options;
  41318. var tickOpts = opts.ticks;
  41319. // If we are forcing it to begin at 0, but 0 will already be rendered on the chart,
  41320. // do nothing since that would make the chart weird. If the user really wants a weird chart
  41321. // axis, they can manually override it
  41322. if (tickOpts.beginAtZero) {
  41323. var minSign = helpers.sign(me.min);
  41324. var maxSign = helpers.sign(me.max);
  41325. if (minSign < 0 && maxSign < 0) {
  41326. // move the top up to 0
  41327. me.max = 0;
  41328. } else if (minSign > 0 && maxSign > 0) {
  41329. // move the bottom down to 0
  41330. me.min = 0;
  41331. }
  41332. }
  41333. if (tickOpts.min !== undefined) {
  41334. me.min = tickOpts.min;
  41335. } else if (tickOpts.suggestedMin !== undefined) {
  41336. me.min = Math.min(me.min, tickOpts.suggestedMin);
  41337. }
  41338. if (tickOpts.max !== undefined) {
  41339. me.max = tickOpts.max;
  41340. } else if (tickOpts.suggestedMax !== undefined) {
  41341. me.max = Math.max(me.max, tickOpts.suggestedMax);
  41342. }
  41343. if (me.min === me.max) {
  41344. me.max++;
  41345. if (!tickOpts.beginAtZero) {
  41346. me.min--;
  41347. }
  41348. }
  41349. },
  41350. getTickLimit: noop,
  41351. handleDirectionalChanges: noop,
  41352. buildTicks: function() {
  41353. var me = this;
  41354. var opts = me.options;
  41355. var tickOpts = opts.ticks;
  41356. // Figure out what the max number of ticks we can support it is based on the size of
  41357. // the axis area. For now, we say that the minimum tick spacing in pixels must be 50
  41358. // We also limit the maximum number of ticks to 11 which gives a nice 10 squares on
  41359. // the graph. Make sure we always have at least 2 ticks
  41360. var maxTicks = me.getTickLimit();
  41361. maxTicks = Math.max(2, maxTicks);
  41362. var numericGeneratorOptions = {
  41363. maxTicks: maxTicks,
  41364. min: tickOpts.min,
  41365. max: tickOpts.max,
  41366. stepSize: helpers.getValueOrDefault(tickOpts.fixedStepSize, tickOpts.stepSize)
  41367. };
  41368. var ticks = me.ticks = Chart.Ticks.generators.linear(numericGeneratorOptions, me);
  41369. me.handleDirectionalChanges();
  41370. // At this point, we need to update our max and min given the tick values since we have expanded the
  41371. // range of the scale
  41372. me.max = helpers.max(ticks);
  41373. me.min = helpers.min(ticks);
  41374. if (tickOpts.reverse) {
  41375. ticks.reverse();
  41376. me.start = me.max;
  41377. me.end = me.min;
  41378. } else {
  41379. me.start = me.min;
  41380. me.end = me.max;
  41381. }
  41382. },
  41383. convertTicksToLabels: function() {
  41384. var me = this;
  41385. me.ticksAsNumbers = me.ticks.slice();
  41386. me.zeroLineIndex = me.ticks.indexOf(0);
  41387. Chart.Scale.prototype.convertTicksToLabels.call(me);
  41388. }
  41389. });
  41390. };
  41391. /***/ }),
  41392. /* 165 */
  41393. /***/ (function(module, exports, __webpack_require__) {
  41394. "use strict";
  41395. module.exports = function(Chart) {
  41396. var helpers = Chart.helpers;
  41397. var defaultConfig = {
  41398. position: 'left',
  41399. // label settings
  41400. ticks: {
  41401. callback: Chart.Ticks.formatters.logarithmic
  41402. }
  41403. };
  41404. var LogarithmicScale = Chart.Scale.extend({
  41405. determineDataLimits: function() {
  41406. var me = this;
  41407. var opts = me.options;
  41408. var tickOpts = opts.ticks;
  41409. var chart = me.chart;
  41410. var data = chart.data;
  41411. var datasets = data.datasets;
  41412. var getValueOrDefault = helpers.getValueOrDefault;
  41413. var isHorizontal = me.isHorizontal();
  41414. function IDMatches(meta) {
  41415. return isHorizontal ? meta.xAxisID === me.id : meta.yAxisID === me.id;
  41416. }
  41417. // Calculate Range
  41418. me.min = null;
  41419. me.max = null;
  41420. me.minNotZero = null;
  41421. var hasStacks = opts.stacked;
  41422. if (hasStacks === undefined) {
  41423. helpers.each(datasets, function(dataset, datasetIndex) {
  41424. if (hasStacks) {
  41425. return;
  41426. }
  41427. var meta = chart.getDatasetMeta(datasetIndex);
  41428. if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta) &&
  41429. meta.stack !== undefined) {
  41430. hasStacks = true;
  41431. }
  41432. });
  41433. }
  41434. if (opts.stacked || hasStacks) {
  41435. var valuesPerStack = {};
  41436. helpers.each(datasets, function(dataset, datasetIndex) {
  41437. var meta = chart.getDatasetMeta(datasetIndex);
  41438. var key = [
  41439. meta.type,
  41440. // we have a separate stack for stack=undefined datasets when the opts.stacked is undefined
  41441. ((opts.stacked === undefined && meta.stack === undefined) ? datasetIndex : ''),
  41442. meta.stack
  41443. ].join('.');
  41444. if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {
  41445. if (valuesPerStack[key] === undefined) {
  41446. valuesPerStack[key] = [];
  41447. }
  41448. helpers.each(dataset.data, function(rawValue, index) {
  41449. var values = valuesPerStack[key];
  41450. var value = +me.getRightValue(rawValue);
  41451. if (isNaN(value) || meta.data[index].hidden) {
  41452. return;
  41453. }
  41454. values[index] = values[index] || 0;
  41455. if (opts.relativePoints) {
  41456. values[index] = 100;
  41457. } else {
  41458. // Don't need to split positive and negative since the log scale can't handle a 0 crossing
  41459. values[index] += value;
  41460. }
  41461. });
  41462. }
  41463. });
  41464. helpers.each(valuesPerStack, function(valuesForType) {
  41465. var minVal = helpers.min(valuesForType);
  41466. var maxVal = helpers.max(valuesForType);
  41467. me.min = me.min === null ? minVal : Math.min(me.min, minVal);
  41468. me.max = me.max === null ? maxVal : Math.max(me.max, maxVal);
  41469. });
  41470. } else {
  41471. helpers.each(datasets, function(dataset, datasetIndex) {
  41472. var meta = chart.getDatasetMeta(datasetIndex);
  41473. if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {
  41474. helpers.each(dataset.data, function(rawValue, index) {
  41475. var value = +me.getRightValue(rawValue);
  41476. if (isNaN(value) || meta.data[index].hidden) {
  41477. return;
  41478. }
  41479. if (me.min === null) {
  41480. me.min = value;
  41481. } else if (value < me.min) {
  41482. me.min = value;
  41483. }
  41484. if (me.max === null) {
  41485. me.max = value;
  41486. } else if (value > me.max) {
  41487. me.max = value;
  41488. }
  41489. if (value !== 0 && (me.minNotZero === null || value < me.minNotZero)) {
  41490. me.minNotZero = value;
  41491. }
  41492. });
  41493. }
  41494. });
  41495. }
  41496. me.min = getValueOrDefault(tickOpts.min, me.min);
  41497. me.max = getValueOrDefault(tickOpts.max, me.max);
  41498. if (me.min === me.max) {
  41499. if (me.min !== 0 && me.min !== null) {
  41500. me.min = Math.pow(10, Math.floor(helpers.log10(me.min)) - 1);
  41501. me.max = Math.pow(10, Math.floor(helpers.log10(me.max)) + 1);
  41502. } else {
  41503. me.min = 1;
  41504. me.max = 10;
  41505. }
  41506. }
  41507. },
  41508. buildTicks: function() {
  41509. var me = this;
  41510. var opts = me.options;
  41511. var tickOpts = opts.ticks;
  41512. var generationOptions = {
  41513. min: tickOpts.min,
  41514. max: tickOpts.max
  41515. };
  41516. var ticks = me.ticks = Chart.Ticks.generators.logarithmic(generationOptions, me);
  41517. if (!me.isHorizontal()) {
  41518. // We are in a vertical orientation. The top value is the highest. So reverse the array
  41519. ticks.reverse();
  41520. }
  41521. // At this point, we need to update our max and min given the tick values since we have expanded the
  41522. // range of the scale
  41523. me.max = helpers.max(ticks);
  41524. me.min = helpers.min(ticks);
  41525. if (tickOpts.reverse) {
  41526. ticks.reverse();
  41527. me.start = me.max;
  41528. me.end = me.min;
  41529. } else {
  41530. me.start = me.min;
  41531. me.end = me.max;
  41532. }
  41533. },
  41534. convertTicksToLabels: function() {
  41535. this.tickValues = this.ticks.slice();
  41536. Chart.Scale.prototype.convertTicksToLabels.call(this);
  41537. },
  41538. // Get the correct tooltip label
  41539. getLabelForIndex: function(index, datasetIndex) {
  41540. return +this.getRightValue(this.chart.data.datasets[datasetIndex].data[index]);
  41541. },
  41542. getPixelForTick: function(index) {
  41543. return this.getPixelForValue(this.tickValues[index]);
  41544. },
  41545. getPixelForValue: function(value) {
  41546. var me = this;
  41547. var innerDimension;
  41548. var pixel;
  41549. var start = me.start;
  41550. var newVal = +me.getRightValue(value);
  41551. var range;
  41552. var opts = me.options;
  41553. var tickOpts = opts.ticks;
  41554. if (me.isHorizontal()) {
  41555. range = helpers.log10(me.end) - helpers.log10(start); // todo: if start === 0
  41556. if (newVal === 0) {
  41557. pixel = me.left;
  41558. } else {
  41559. innerDimension = me.width;
  41560. pixel = me.left + (innerDimension / range * (helpers.log10(newVal) - helpers.log10(start)));
  41561. }
  41562. } else {
  41563. // Bottom - top since pixels increase downward on a screen
  41564. innerDimension = me.height;
  41565. if (start === 0 && !tickOpts.reverse) {
  41566. range = helpers.log10(me.end) - helpers.log10(me.minNotZero);
  41567. if (newVal === start) {
  41568. pixel = me.bottom;
  41569. } else if (newVal === me.minNotZero) {
  41570. pixel = me.bottom - innerDimension * 0.02;
  41571. } else {
  41572. pixel = me.bottom - innerDimension * 0.02 - (innerDimension * 0.98/ range * (helpers.log10(newVal)-helpers.log10(me.minNotZero)));
  41573. }
  41574. } else if (me.end === 0 && tickOpts.reverse) {
  41575. range = helpers.log10(me.start) - helpers.log10(me.minNotZero);
  41576. if (newVal === me.end) {
  41577. pixel = me.top;
  41578. } else if (newVal === me.minNotZero) {
  41579. pixel = me.top + innerDimension * 0.02;
  41580. } else {
  41581. pixel = me.top + innerDimension * 0.02 + (innerDimension * 0.98/ range * (helpers.log10(newVal)-helpers.log10(me.minNotZero)));
  41582. }
  41583. } else {
  41584. range = helpers.log10(me.end) - helpers.log10(start);
  41585. innerDimension = me.height;
  41586. pixel = me.bottom - (innerDimension / range * (helpers.log10(newVal) - helpers.log10(start)));
  41587. }
  41588. }
  41589. return pixel;
  41590. },
  41591. getValueForPixel: function(pixel) {
  41592. var me = this;
  41593. var range = helpers.log10(me.end) - helpers.log10(me.start);
  41594. var value, innerDimension;
  41595. if (me.isHorizontal()) {
  41596. innerDimension = me.width;
  41597. value = me.start * Math.pow(10, (pixel - me.left) * range / innerDimension);
  41598. } else { // todo: if start === 0
  41599. innerDimension = me.height;
  41600. value = Math.pow(10, (me.bottom - pixel) * range / innerDimension) / me.start;
  41601. }
  41602. return value;
  41603. }
  41604. });
  41605. Chart.scaleService.registerScaleType('logarithmic', LogarithmicScale, defaultConfig);
  41606. };
  41607. /***/ }),
  41608. /* 166 */
  41609. /***/ (function(module, exports, __webpack_require__) {
  41610. "use strict";
  41611. module.exports = function(Chart) {
  41612. var helpers = Chart.helpers;
  41613. var globalDefaults = Chart.defaults.global;
  41614. var defaultConfig = {
  41615. display: true,
  41616. // Boolean - Whether to animate scaling the chart from the centre
  41617. animate: true,
  41618. lineArc: false,
  41619. position: 'chartArea',
  41620. angleLines: {
  41621. display: true,
  41622. color: 'rgba(0, 0, 0, 0.1)',
  41623. lineWidth: 1
  41624. },
  41625. // label settings
  41626. ticks: {
  41627. // Boolean - Show a backdrop to the scale label
  41628. showLabelBackdrop: true,
  41629. // String - The colour of the label backdrop
  41630. backdropColor: 'rgba(255,255,255,0.75)',
  41631. // Number - The backdrop padding above & below the label in pixels
  41632. backdropPaddingY: 2,
  41633. // Number - The backdrop padding to the side of the label in pixels
  41634. backdropPaddingX: 2,
  41635. callback: Chart.Ticks.formatters.linear
  41636. },
  41637. pointLabels: {
  41638. // Number - Point label font size in pixels
  41639. fontSize: 10,
  41640. // Function - Used to convert point labels
  41641. callback: function(label) {
  41642. return label;
  41643. }
  41644. }
  41645. };
  41646. function getValueCount(scale) {
  41647. return !scale.options.lineArc ? scale.chart.data.labels.length : 0;
  41648. }
  41649. function getPointLabelFontOptions(scale) {
  41650. var pointLabelOptions = scale.options.pointLabels;
  41651. var fontSize = helpers.getValueOrDefault(pointLabelOptions.fontSize, globalDefaults.defaultFontSize);
  41652. var fontStyle = helpers.getValueOrDefault(pointLabelOptions.fontStyle, globalDefaults.defaultFontStyle);
  41653. var fontFamily = helpers.getValueOrDefault(pointLabelOptions.fontFamily, globalDefaults.defaultFontFamily);
  41654. var font = helpers.fontString(fontSize, fontStyle, fontFamily);
  41655. return {
  41656. size: fontSize,
  41657. style: fontStyle,
  41658. family: fontFamily,
  41659. font: font
  41660. };
  41661. }
  41662. function measureLabelSize(ctx, fontSize, label) {
  41663. if (helpers.isArray(label)) {
  41664. return {
  41665. w: helpers.longestText(ctx, ctx.font, label),
  41666. h: (label.length * fontSize) + ((label.length - 1) * 1.5 * fontSize)
  41667. };
  41668. }
  41669. return {
  41670. w: ctx.measureText(label).width,
  41671. h: fontSize
  41672. };
  41673. }
  41674. function determineLimits(angle, pos, size, min, max) {
  41675. if (angle === min || angle === max) {
  41676. return {
  41677. start: pos - (size / 2),
  41678. end: pos + (size / 2)
  41679. };
  41680. } else if (angle < min || angle > max) {
  41681. return {
  41682. start: pos - size - 5,
  41683. end: pos
  41684. };
  41685. }
  41686. return {
  41687. start: pos,
  41688. end: pos + size + 5
  41689. };
  41690. }
  41691. /**
  41692. * Helper function to fit a radial linear scale with point labels
  41693. */
  41694. function fitWithPointLabels(scale) {
  41695. /*
  41696. * Right, this is really confusing and there is a lot of maths going on here
  41697. * The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9
  41698. *
  41699. * Reaction: https://dl.dropboxusercontent.com/u/34601363/toomuchscience.gif
  41700. *
  41701. * Solution:
  41702. *
  41703. * We assume the radius of the polygon is half the size of the canvas at first
  41704. * at each index we check if the text overlaps.
  41705. *
  41706. * Where it does, we store that angle and that index.
  41707. *
  41708. * After finding the largest index and angle we calculate how much we need to remove
  41709. * from the shape radius to move the point inwards by that x.
  41710. *
  41711. * We average the left and right distances to get the maximum shape radius that can fit in the box
  41712. * along with labels.
  41713. *
  41714. * Once we have that, we can find the centre point for the chart, by taking the x text protrusion
  41715. * on each side, removing that from the size, halving it and adding the left x protrusion width.
  41716. *
  41717. * This will mean we have a shape fitted to the canvas, as large as it can be with the labels
  41718. * and position it in the most space efficient manner
  41719. *
  41720. * https://dl.dropboxusercontent.com/u/34601363/yeahscience.gif
  41721. */
  41722. var plFont = getPointLabelFontOptions(scale);
  41723. // Get maximum radius of the polygon. Either half the height (minus the text width) or half the width.
  41724. // Use this to calculate the offset + change. - Make sure L/R protrusion is at least 0 to stop issues with centre points
  41725. var largestPossibleRadius = Math.min(scale.height / 2, scale.width / 2);
  41726. var furthestLimits = {
  41727. l: scale.width,
  41728. r: 0,
  41729. t: scale.height,
  41730. b: 0
  41731. };
  41732. var furthestAngles = {};
  41733. var i;
  41734. var textSize;
  41735. var pointPosition;
  41736. scale.ctx.font = plFont.font;
  41737. scale._pointLabelSizes = [];
  41738. var valueCount = getValueCount(scale);
  41739. for (i = 0; i < valueCount; i++) {
  41740. pointPosition = scale.getPointPosition(i, largestPossibleRadius);
  41741. textSize = measureLabelSize(scale.ctx, plFont.size, scale.pointLabels[i] || '');
  41742. scale._pointLabelSizes[i] = textSize;
  41743. // Add quarter circle to make degree 0 mean top of circle
  41744. var angleRadians = scale.getIndexAngle(i);
  41745. var angle = helpers.toDegrees(angleRadians) % 360;
  41746. var hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);
  41747. var vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);
  41748. if (hLimits.start < furthestLimits.l) {
  41749. furthestLimits.l = hLimits.start;
  41750. furthestAngles.l = angleRadians;
  41751. }
  41752. if (hLimits.end > furthestLimits.r) {
  41753. furthestLimits.r = hLimits.end;
  41754. furthestAngles.r = angleRadians;
  41755. }
  41756. if (vLimits.start < furthestLimits.t) {
  41757. furthestLimits.t = vLimits.start;
  41758. furthestAngles.t = angleRadians;
  41759. }
  41760. if (vLimits.end > furthestLimits.b) {
  41761. furthestLimits.b = vLimits.end;
  41762. furthestAngles.b = angleRadians;
  41763. }
  41764. }
  41765. scale.setReductions(largestPossibleRadius, furthestLimits, furthestAngles);
  41766. }
  41767. /**
  41768. * Helper function to fit a radial linear scale with no point labels
  41769. */
  41770. function fit(scale) {
  41771. var largestPossibleRadius = Math.min(scale.height / 2, scale.width / 2);
  41772. scale.drawingArea = Math.round(largestPossibleRadius);
  41773. scale.setCenterPoint(0, 0, 0, 0);
  41774. }
  41775. function getTextAlignForAngle(angle) {
  41776. if (angle === 0 || angle === 180) {
  41777. return 'center';
  41778. } else if (angle < 180) {
  41779. return 'left';
  41780. }
  41781. return 'right';
  41782. }
  41783. function fillText(ctx, text, position, fontSize) {
  41784. if (helpers.isArray(text)) {
  41785. var y = position.y;
  41786. var spacing = 1.5 * fontSize;
  41787. for (var i = 0; i < text.length; ++i) {
  41788. ctx.fillText(text[i], position.x, y);
  41789. y+= spacing;
  41790. }
  41791. } else {
  41792. ctx.fillText(text, position.x, position.y);
  41793. }
  41794. }
  41795. function adjustPointPositionForLabelHeight(angle, textSize, position) {
  41796. if (angle === 90 || angle === 270) {
  41797. position.y -= (textSize.h / 2);
  41798. } else if (angle > 270 || angle < 90) {
  41799. position.y -= textSize.h;
  41800. }
  41801. }
  41802. function drawPointLabels(scale) {
  41803. var ctx = scale.ctx;
  41804. var getValueOrDefault = helpers.getValueOrDefault;
  41805. var opts = scale.options;
  41806. var angleLineOpts = opts.angleLines;
  41807. var pointLabelOpts = opts.pointLabels;
  41808. ctx.lineWidth = angleLineOpts.lineWidth;
  41809. ctx.strokeStyle = angleLineOpts.color;
  41810. var outerDistance = scale.getDistanceFromCenterForValue(opts.reverse ? scale.min : scale.max);
  41811. // Point Label Font
  41812. var plFont = getPointLabelFontOptions(scale);
  41813. ctx.textBaseline = 'top';
  41814. for (var i = getValueCount(scale) - 1; i >= 0; i--) {
  41815. if (angleLineOpts.display) {
  41816. var outerPosition = scale.getPointPosition(i, outerDistance);
  41817. ctx.beginPath();
  41818. ctx.moveTo(scale.xCenter, scale.yCenter);
  41819. ctx.lineTo(outerPosition.x, outerPosition.y);
  41820. ctx.stroke();
  41821. ctx.closePath();
  41822. }
  41823. // Extra 3px out for some label spacing
  41824. var pointLabelPosition = scale.getPointPosition(i, outerDistance + 5);
  41825. // Keep this in loop since we may support array properties here
  41826. var pointLabelFontColor = getValueOrDefault(pointLabelOpts.fontColor, globalDefaults.defaultFontColor);
  41827. ctx.font = plFont.font;
  41828. ctx.fillStyle = pointLabelFontColor;
  41829. var angleRadians = scale.getIndexAngle(i);
  41830. var angle = helpers.toDegrees(angleRadians);
  41831. ctx.textAlign = getTextAlignForAngle(angle);
  41832. adjustPointPositionForLabelHeight(angle, scale._pointLabelSizes[i], pointLabelPosition);
  41833. fillText(ctx, scale.pointLabels[i] || '', pointLabelPosition, plFont.size);
  41834. }
  41835. }
  41836. function drawRadiusLine(scale, gridLineOpts, radius, index) {
  41837. var ctx = scale.ctx;
  41838. ctx.strokeStyle = helpers.getValueAtIndexOrDefault(gridLineOpts.color, index - 1);
  41839. ctx.lineWidth = helpers.getValueAtIndexOrDefault(gridLineOpts.lineWidth, index - 1);
  41840. if (scale.options.lineArc) {
  41841. // Draw circular arcs between the points
  41842. ctx.beginPath();
  41843. ctx.arc(scale.xCenter, scale.yCenter, radius, 0, Math.PI * 2);
  41844. ctx.closePath();
  41845. ctx.stroke();
  41846. } else {
  41847. // Draw straight lines connecting each index
  41848. var valueCount = getValueCount(scale);
  41849. if (valueCount === 0) {
  41850. return;
  41851. }
  41852. ctx.beginPath();
  41853. var pointPosition = scale.getPointPosition(0, radius);
  41854. ctx.moveTo(pointPosition.x, pointPosition.y);
  41855. for (var i = 1; i < valueCount; i++) {
  41856. pointPosition = scale.getPointPosition(i, radius);
  41857. ctx.lineTo(pointPosition.x, pointPosition.y);
  41858. }
  41859. ctx.closePath();
  41860. ctx.stroke();
  41861. }
  41862. }
  41863. function numberOrZero(param) {
  41864. return helpers.isNumber(param) ? param : 0;
  41865. }
  41866. var LinearRadialScale = Chart.LinearScaleBase.extend({
  41867. setDimensions: function() {
  41868. var me = this;
  41869. var opts = me.options;
  41870. var tickOpts = opts.ticks;
  41871. // Set the unconstrained dimension before label rotation
  41872. me.width = me.maxWidth;
  41873. me.height = me.maxHeight;
  41874. me.xCenter = Math.round(me.width / 2);
  41875. me.yCenter = Math.round(me.height / 2);
  41876. var minSize = helpers.min([me.height, me.width]);
  41877. var tickFontSize = helpers.getValueOrDefault(tickOpts.fontSize, globalDefaults.defaultFontSize);
  41878. me.drawingArea = opts.display ? (minSize / 2) - (tickFontSize / 2 + tickOpts.backdropPaddingY) : (minSize / 2);
  41879. },
  41880. determineDataLimits: function() {
  41881. var me = this;
  41882. var chart = me.chart;
  41883. var min = Number.POSITIVE_INFINITY;
  41884. var max = Number.NEGATIVE_INFINITY;
  41885. helpers.each(chart.data.datasets, function(dataset, datasetIndex) {
  41886. if (chart.isDatasetVisible(datasetIndex)) {
  41887. var meta = chart.getDatasetMeta(datasetIndex);
  41888. helpers.each(dataset.data, function(rawValue, index) {
  41889. var value = +me.getRightValue(rawValue);
  41890. if (isNaN(value) || meta.data[index].hidden) {
  41891. return;
  41892. }
  41893. min = Math.min(value, min);
  41894. max = Math.max(value, max);
  41895. });
  41896. }
  41897. });
  41898. me.min = (min === Number.POSITIVE_INFINITY ? 0 : min);
  41899. me.max = (max === Number.NEGATIVE_INFINITY ? 0 : max);
  41900. // Common base implementation to handle ticks.min, ticks.max, ticks.beginAtZero
  41901. me.handleTickRangeOptions();
  41902. },
  41903. getTickLimit: function() {
  41904. var tickOpts = this.options.ticks;
  41905. var tickFontSize = helpers.getValueOrDefault(tickOpts.fontSize, globalDefaults.defaultFontSize);
  41906. return Math.min(tickOpts.maxTicksLimit ? tickOpts.maxTicksLimit : 11, Math.ceil(this.drawingArea / (1.5 * tickFontSize)));
  41907. },
  41908. convertTicksToLabels: function() {
  41909. var me = this;
  41910. Chart.LinearScaleBase.prototype.convertTicksToLabels.call(me);
  41911. // Point labels
  41912. me.pointLabels = me.chart.data.labels.map(me.options.pointLabels.callback, me);
  41913. },
  41914. getLabelForIndex: function(index, datasetIndex) {
  41915. return +this.getRightValue(this.chart.data.datasets[datasetIndex].data[index]);
  41916. },
  41917. fit: function() {
  41918. if (this.options.lineArc) {
  41919. fit(this);
  41920. } else {
  41921. fitWithPointLabels(this);
  41922. }
  41923. },
  41924. /**
  41925. * Set radius reductions and determine new radius and center point
  41926. * @private
  41927. */
  41928. setReductions: function(largestPossibleRadius, furthestLimits, furthestAngles) {
  41929. var me = this;
  41930. var radiusReductionLeft = furthestLimits.l / Math.sin(furthestAngles.l);
  41931. var radiusReductionRight = Math.max(furthestLimits.r - me.width, 0) / Math.sin(furthestAngles.r);
  41932. var radiusReductionTop = -furthestLimits.t / Math.cos(furthestAngles.t);
  41933. var radiusReductionBottom = -Math.max(furthestLimits.b - me.height, 0) / Math.cos(furthestAngles.b);
  41934. radiusReductionLeft = numberOrZero(radiusReductionLeft);
  41935. radiusReductionRight = numberOrZero(radiusReductionRight);
  41936. radiusReductionTop = numberOrZero(radiusReductionTop);
  41937. radiusReductionBottom = numberOrZero(radiusReductionBottom);
  41938. me.drawingArea = Math.min(
  41939. Math.round(largestPossibleRadius - (radiusReductionLeft + radiusReductionRight) / 2),
  41940. Math.round(largestPossibleRadius - (radiusReductionTop + radiusReductionBottom) / 2));
  41941. me.setCenterPoint(radiusReductionLeft, radiusReductionRight, radiusReductionTop, radiusReductionBottom);
  41942. },
  41943. setCenterPoint: function(leftMovement, rightMovement, topMovement, bottomMovement) {
  41944. var me = this;
  41945. var maxRight = me.width - rightMovement - me.drawingArea,
  41946. maxLeft = leftMovement + me.drawingArea,
  41947. maxTop = topMovement + me.drawingArea,
  41948. maxBottom = me.height - bottomMovement - me.drawingArea;
  41949. me.xCenter = Math.round(((maxLeft + maxRight) / 2) + me.left);
  41950. me.yCenter = Math.round(((maxTop + maxBottom) / 2) + me.top);
  41951. },
  41952. getIndexAngle: function(index) {
  41953. var angleMultiplier = (Math.PI * 2) / getValueCount(this);
  41954. var startAngle = this.chart.options && this.chart.options.startAngle ?
  41955. this.chart.options.startAngle :
  41956. 0;
  41957. var startAngleRadians = startAngle * Math.PI * 2 / 360;
  41958. // Start from the top instead of right, so remove a quarter of the circle
  41959. return index * angleMultiplier + startAngleRadians;
  41960. },
  41961. getDistanceFromCenterForValue: function(value) {
  41962. var me = this;
  41963. if (value === null) {
  41964. return 0; // null always in center
  41965. }
  41966. // Take into account half font size + the yPadding of the top value
  41967. var scalingFactor = me.drawingArea / (me.max - me.min);
  41968. if (me.options.reverse) {
  41969. return (me.max - value) * scalingFactor;
  41970. }
  41971. return (value - me.min) * scalingFactor;
  41972. },
  41973. getPointPosition: function(index, distanceFromCenter) {
  41974. var me = this;
  41975. var thisAngle = me.getIndexAngle(index) - (Math.PI / 2);
  41976. return {
  41977. x: Math.round(Math.cos(thisAngle) * distanceFromCenter) + me.xCenter,
  41978. y: Math.round(Math.sin(thisAngle) * distanceFromCenter) + me.yCenter
  41979. };
  41980. },
  41981. getPointPositionForValue: function(index, value) {
  41982. return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));
  41983. },
  41984. getBasePosition: function() {
  41985. var me = this;
  41986. var min = me.min;
  41987. var max = me.max;
  41988. return me.getPointPositionForValue(0,
  41989. me.beginAtZero? 0:
  41990. min < 0 && max < 0? max :
  41991. min > 0 && max > 0? min :
  41992. 0);
  41993. },
  41994. draw: function() {
  41995. var me = this;
  41996. var opts = me.options;
  41997. var gridLineOpts = opts.gridLines;
  41998. var tickOpts = opts.ticks;
  41999. var getValueOrDefault = helpers.getValueOrDefault;
  42000. if (opts.display) {
  42001. var ctx = me.ctx;
  42002. // Tick Font
  42003. var tickFontSize = getValueOrDefault(tickOpts.fontSize, globalDefaults.defaultFontSize);
  42004. var tickFontStyle = getValueOrDefault(tickOpts.fontStyle, globalDefaults.defaultFontStyle);
  42005. var tickFontFamily = getValueOrDefault(tickOpts.fontFamily, globalDefaults.defaultFontFamily);
  42006. var tickLabelFont = helpers.fontString(tickFontSize, tickFontStyle, tickFontFamily);
  42007. helpers.each(me.ticks, function(label, index) {
  42008. // Don't draw a centre value (if it is minimum)
  42009. if (index > 0 || opts.reverse) {
  42010. var yCenterOffset = me.getDistanceFromCenterForValue(me.ticksAsNumbers[index]);
  42011. var yHeight = me.yCenter - yCenterOffset;
  42012. // Draw circular lines around the scale
  42013. if (gridLineOpts.display && index !== 0) {
  42014. drawRadiusLine(me, gridLineOpts, yCenterOffset, index);
  42015. }
  42016. if (tickOpts.display) {
  42017. var tickFontColor = getValueOrDefault(tickOpts.fontColor, globalDefaults.defaultFontColor);
  42018. ctx.font = tickLabelFont;
  42019. if (tickOpts.showLabelBackdrop) {
  42020. var labelWidth = ctx.measureText(label).width;
  42021. ctx.fillStyle = tickOpts.backdropColor;
  42022. ctx.fillRect(
  42023. me.xCenter - labelWidth / 2 - tickOpts.backdropPaddingX,
  42024. yHeight - tickFontSize / 2 - tickOpts.backdropPaddingY,
  42025. labelWidth + tickOpts.backdropPaddingX * 2,
  42026. tickFontSize + tickOpts.backdropPaddingY * 2
  42027. );
  42028. }
  42029. ctx.textAlign = 'center';
  42030. ctx.textBaseline = 'middle';
  42031. ctx.fillStyle = tickFontColor;
  42032. ctx.fillText(label, me.xCenter, yHeight);
  42033. }
  42034. }
  42035. });
  42036. if (!opts.lineArc) {
  42037. drawPointLabels(me);
  42038. }
  42039. }
  42040. }
  42041. });
  42042. Chart.scaleService.registerScaleType('radialLinear', LinearRadialScale, defaultConfig);
  42043. };
  42044. /***/ }),
  42045. /* 167 */
  42046. /***/ (function(module, exports, __webpack_require__) {
  42047. "use strict";
  42048. /* global window: false */
  42049. var moment = __webpack_require__(0);
  42050. moment = typeof(moment) === 'function' ? moment : window.moment;
  42051. module.exports = function(Chart) {
  42052. var helpers = Chart.helpers;
  42053. var time = {
  42054. units: [{
  42055. name: 'millisecond',
  42056. steps: [1, 2, 5, 10, 20, 50, 100, 250, 500]
  42057. }, {
  42058. name: 'second',
  42059. steps: [1, 2, 5, 10, 30]
  42060. }, {
  42061. name: 'minute',
  42062. steps: [1, 2, 5, 10, 30]
  42063. }, {
  42064. name: 'hour',
  42065. steps: [1, 2, 3, 6, 12]
  42066. }, {
  42067. name: 'day',
  42068. steps: [1, 2, 5]
  42069. }, {
  42070. name: 'week',
  42071. maxStep: 4
  42072. }, {
  42073. name: 'month',
  42074. maxStep: 3
  42075. }, {
  42076. name: 'quarter',
  42077. maxStep: 4
  42078. }, {
  42079. name: 'year',
  42080. maxStep: false
  42081. }]
  42082. };
  42083. var defaultConfig = {
  42084. position: 'bottom',
  42085. time: {
  42086. parser: false, // false == a pattern string from http://momentjs.com/docs/#/parsing/string-format/ or a custom callback that converts its argument to a moment
  42087. format: false, // DEPRECATED false == date objects, moment object, callback or a pattern string from http://momentjs.com/docs/#/parsing/string-format/
  42088. unit: false, // false == automatic or override with week, month, year, etc.
  42089. round: false, // none, or override with week, month, year, etc.
  42090. displayFormat: false, // DEPRECATED
  42091. isoWeekday: false, // override week start day - see http://momentjs.com/docs/#/get-set/iso-weekday/
  42092. minUnit: 'millisecond',
  42093. // defaults to unit's corresponding unitFormat below or override using pattern string from http://momentjs.com/docs/#/displaying/format/
  42094. displayFormats: {
  42095. millisecond: 'h:mm:ss.SSS a', // 11:20:01.123 AM,
  42096. second: 'h:mm:ss a', // 11:20:01 AM
  42097. minute: 'h:mm:ss a', // 11:20:01 AM
  42098. hour: 'MMM D, hA', // Sept 4, 5PM
  42099. day: 'll', // Sep 4 2015
  42100. week: 'll', // Week 46, or maybe "[W]WW - YYYY" ?
  42101. month: 'MMM YYYY', // Sept 2015
  42102. quarter: '[Q]Q - YYYY', // Q3
  42103. year: 'YYYY' // 2015
  42104. }
  42105. },
  42106. ticks: {
  42107. autoSkip: false
  42108. }
  42109. };
  42110. var TimeScale = Chart.Scale.extend({
  42111. initialize: function() {
  42112. if (!moment) {
  42113. throw new Error('Chart.js - Moment.js could not be found! You must include it before Chart.js to use the time scale. Download at https://momentjs.com');
  42114. }
  42115. Chart.Scale.prototype.initialize.call(this);
  42116. },
  42117. getLabelMoment: function(datasetIndex, index) {
  42118. if (datasetIndex === null || index === null) {
  42119. return null;
  42120. }
  42121. if (typeof this.labelMoments[datasetIndex] !== 'undefined') {
  42122. return this.labelMoments[datasetIndex][index];
  42123. }
  42124. return null;
  42125. },
  42126. getLabelDiff: function(datasetIndex, index) {
  42127. var me = this;
  42128. if (datasetIndex === null || index === null) {
  42129. return null;
  42130. }
  42131. if (me.labelDiffs === undefined) {
  42132. me.buildLabelDiffs();
  42133. }
  42134. if (typeof me.labelDiffs[datasetIndex] !== 'undefined') {
  42135. return me.labelDiffs[datasetIndex][index];
  42136. }
  42137. return null;
  42138. },
  42139. getMomentStartOf: function(tick) {
  42140. var me = this;
  42141. if (me.options.time.unit === 'week' && me.options.time.isoWeekday !== false) {
  42142. return tick.clone().startOf('isoWeek').isoWeekday(me.options.time.isoWeekday);
  42143. }
  42144. return tick.clone().startOf(me.tickUnit);
  42145. },
  42146. determineDataLimits: function() {
  42147. var me = this;
  42148. me.labelMoments = [];
  42149. // Only parse these once. If the dataset does not have data as x,y pairs, we will use
  42150. // these
  42151. var scaleLabelMoments = [];
  42152. if (me.chart.data.labels && me.chart.data.labels.length > 0) {
  42153. helpers.each(me.chart.data.labels, function(label) {
  42154. var labelMoment = me.parseTime(label);
  42155. if (labelMoment.isValid()) {
  42156. if (me.options.time.round) {
  42157. labelMoment.startOf(me.options.time.round);
  42158. }
  42159. scaleLabelMoments.push(labelMoment);
  42160. }
  42161. }, me);
  42162. me.firstTick = moment.min.call(me, scaleLabelMoments);
  42163. me.lastTick = moment.max.call(me, scaleLabelMoments);
  42164. } else {
  42165. me.firstTick = null;
  42166. me.lastTick = null;
  42167. }
  42168. helpers.each(me.chart.data.datasets, function(dataset, datasetIndex) {
  42169. var momentsForDataset = [];
  42170. var datasetVisible = me.chart.isDatasetVisible(datasetIndex);
  42171. if (typeof dataset.data[0] === 'object' && dataset.data[0] !== null) {
  42172. helpers.each(dataset.data, function(value) {
  42173. var labelMoment = me.parseTime(me.getRightValue(value));
  42174. if (labelMoment.isValid()) {
  42175. if (me.options.time.round) {
  42176. labelMoment.startOf(me.options.time.round);
  42177. }
  42178. momentsForDataset.push(labelMoment);
  42179. if (datasetVisible) {
  42180. // May have gone outside the scale ranges, make sure we keep the first and last ticks updated
  42181. me.firstTick = me.firstTick !== null ? moment.min(me.firstTick, labelMoment) : labelMoment;
  42182. me.lastTick = me.lastTick !== null ? moment.max(me.lastTick, labelMoment) : labelMoment;
  42183. }
  42184. }
  42185. }, me);
  42186. } else {
  42187. // We have no labels. Use the ones from the scale
  42188. momentsForDataset = scaleLabelMoments;
  42189. }
  42190. me.labelMoments.push(momentsForDataset);
  42191. }, me);
  42192. // Set these after we've done all the data
  42193. if (me.options.time.min) {
  42194. me.firstTick = me.parseTime(me.options.time.min);
  42195. }
  42196. if (me.options.time.max) {
  42197. me.lastTick = me.parseTime(me.options.time.max);
  42198. }
  42199. // We will modify these, so clone for later
  42200. me.firstTick = (me.firstTick || moment()).clone();
  42201. me.lastTick = (me.lastTick || moment()).clone();
  42202. },
  42203. buildLabelDiffs: function() {
  42204. var me = this;
  42205. me.labelDiffs = [];
  42206. var scaleLabelDiffs = [];
  42207. // Parse common labels once
  42208. if (me.chart.data.labels && me.chart.data.labels.length > 0) {
  42209. helpers.each(me.chart.data.labels, function(label) {
  42210. var labelMoment = me.parseTime(label);
  42211. if (labelMoment.isValid()) {
  42212. if (me.options.time.round) {
  42213. labelMoment.startOf(me.options.time.round);
  42214. }
  42215. scaleLabelDiffs.push(labelMoment.diff(me.firstTick, me.tickUnit, true));
  42216. }
  42217. }, me);
  42218. }
  42219. helpers.each(me.chart.data.datasets, function(dataset) {
  42220. var diffsForDataset = [];
  42221. if (typeof dataset.data[0] === 'object' && dataset.data[0] !== null) {
  42222. helpers.each(dataset.data, function(value) {
  42223. var labelMoment = me.parseTime(me.getRightValue(value));
  42224. if (labelMoment.isValid()) {
  42225. if (me.options.time.round) {
  42226. labelMoment.startOf(me.options.time.round);
  42227. }
  42228. diffsForDataset.push(labelMoment.diff(me.firstTick, me.tickUnit, true));
  42229. }
  42230. }, me);
  42231. } else {
  42232. // We have no labels. Use common ones
  42233. diffsForDataset = scaleLabelDiffs;
  42234. }
  42235. me.labelDiffs.push(diffsForDataset);
  42236. }, me);
  42237. },
  42238. buildTicks: function() {
  42239. var me = this;
  42240. me.ctx.save();
  42241. var tickFontSize = helpers.getValueOrDefault(me.options.ticks.fontSize, Chart.defaults.global.defaultFontSize);
  42242. var tickFontStyle = helpers.getValueOrDefault(me.options.ticks.fontStyle, Chart.defaults.global.defaultFontStyle);
  42243. var tickFontFamily = helpers.getValueOrDefault(me.options.ticks.fontFamily, Chart.defaults.global.defaultFontFamily);
  42244. var tickLabelFont = helpers.fontString(tickFontSize, tickFontStyle, tickFontFamily);
  42245. me.ctx.font = tickLabelFont;
  42246. me.ticks = [];
  42247. me.unitScale = 1; // How much we scale the unit by, ie 2 means 2x unit per step
  42248. me.scaleSizeInUnits = 0; // How large the scale is in the base unit (seconds, minutes, etc)
  42249. // Set unit override if applicable
  42250. if (me.options.time.unit) {
  42251. me.tickUnit = me.options.time.unit || 'day';
  42252. me.displayFormat = me.options.time.displayFormats[me.tickUnit];
  42253. me.scaleSizeInUnits = me.lastTick.diff(me.firstTick, me.tickUnit, true);
  42254. me.unitScale = helpers.getValueOrDefault(me.options.time.unitStepSize, 1);
  42255. } else {
  42256. // Determine the smallest needed unit of the time
  42257. var innerWidth = me.isHorizontal() ? me.width : me.height;
  42258. // Crude approximation of what the label length might be
  42259. var tempFirstLabel = me.tickFormatFunction(me.firstTick, 0, []);
  42260. var tickLabelWidth = me.ctx.measureText(tempFirstLabel).width;
  42261. var cosRotation = Math.cos(helpers.toRadians(me.options.ticks.maxRotation));
  42262. var sinRotation = Math.sin(helpers.toRadians(me.options.ticks.maxRotation));
  42263. tickLabelWidth = (tickLabelWidth * cosRotation) + (tickFontSize * sinRotation);
  42264. var labelCapacity = innerWidth / (tickLabelWidth);
  42265. // Start as small as possible
  42266. me.tickUnit = me.options.time.minUnit;
  42267. me.scaleSizeInUnits = me.lastTick.diff(me.firstTick, me.tickUnit, true);
  42268. me.displayFormat = me.options.time.displayFormats[me.tickUnit];
  42269. var unitDefinitionIndex = 0;
  42270. var unitDefinition = time.units[unitDefinitionIndex];
  42271. // While we aren't ideal and we don't have units left
  42272. while (unitDefinitionIndex < time.units.length) {
  42273. // Can we scale this unit. If `false` we can scale infinitely
  42274. me.unitScale = 1;
  42275. if (helpers.isArray(unitDefinition.steps) && Math.ceil(me.scaleSizeInUnits / labelCapacity) < helpers.max(unitDefinition.steps)) {
  42276. // Use one of the predefined steps
  42277. for (var idx = 0; idx < unitDefinition.steps.length; ++idx) {
  42278. if (unitDefinition.steps[idx] >= Math.ceil(me.scaleSizeInUnits / labelCapacity)) {
  42279. me.unitScale = helpers.getValueOrDefault(me.options.time.unitStepSize, unitDefinition.steps[idx]);
  42280. break;
  42281. }
  42282. }
  42283. break;
  42284. } else if ((unitDefinition.maxStep === false) || (Math.ceil(me.scaleSizeInUnits / labelCapacity) < unitDefinition.maxStep)) {
  42285. // We have a max step. Scale this unit
  42286. me.unitScale = helpers.getValueOrDefault(me.options.time.unitStepSize, Math.ceil(me.scaleSizeInUnits / labelCapacity));
  42287. break;
  42288. } else {
  42289. // Move to the next unit up
  42290. ++unitDefinitionIndex;
  42291. unitDefinition = time.units[unitDefinitionIndex];
  42292. me.tickUnit = unitDefinition.name;
  42293. var leadingUnitBuffer = me.firstTick.diff(me.getMomentStartOf(me.firstTick), me.tickUnit, true);
  42294. var trailingUnitBuffer = me.getMomentStartOf(me.lastTick.clone().add(1, me.tickUnit)).diff(me.lastTick, me.tickUnit, true);
  42295. me.scaleSizeInUnits = me.lastTick.diff(me.firstTick, me.tickUnit, true) + leadingUnitBuffer + trailingUnitBuffer;
  42296. me.displayFormat = me.options.time.displayFormats[unitDefinition.name];
  42297. }
  42298. }
  42299. }
  42300. var roundedStart;
  42301. // Only round the first tick if we have no hard minimum
  42302. if (!me.options.time.min) {
  42303. me.firstTick = me.getMomentStartOf(me.firstTick);
  42304. roundedStart = me.firstTick;
  42305. } else {
  42306. roundedStart = me.getMomentStartOf(me.firstTick);
  42307. }
  42308. // Only round the last tick if we have no hard maximum
  42309. if (!me.options.time.max) {
  42310. var roundedEnd = me.getMomentStartOf(me.lastTick);
  42311. var delta = roundedEnd.diff(me.lastTick, me.tickUnit, true);
  42312. if (delta < 0) {
  42313. // Do not use end of because we need me to be in the next time unit
  42314. me.lastTick = me.getMomentStartOf(me.lastTick.add(1, me.tickUnit));
  42315. } else if (delta >= 0) {
  42316. me.lastTick = roundedEnd;
  42317. }
  42318. me.scaleSizeInUnits = me.lastTick.diff(me.firstTick, me.tickUnit, true);
  42319. }
  42320. // Tick displayFormat override
  42321. if (me.options.time.displayFormat) {
  42322. me.displayFormat = me.options.time.displayFormat;
  42323. }
  42324. // first tick. will have been rounded correctly if options.time.min is not specified
  42325. me.ticks.push(me.firstTick.clone());
  42326. // For every unit in between the first and last moment, create a moment and add it to the ticks tick
  42327. for (var i = me.unitScale; i <= me.scaleSizeInUnits; i += me.unitScale) {
  42328. var newTick = roundedStart.clone().add(i, me.tickUnit);
  42329. // Are we greater than the max time
  42330. if (me.options.time.max && newTick.diff(me.lastTick, me.tickUnit, true) >= 0) {
  42331. break;
  42332. }
  42333. me.ticks.push(newTick);
  42334. }
  42335. // Always show the right tick
  42336. var diff = me.ticks[me.ticks.length - 1].diff(me.lastTick, me.tickUnit);
  42337. if (diff !== 0 || me.scaleSizeInUnits === 0) {
  42338. // this is a weird case. If the <max> option is the same as the end option, we can't just diff the times because the tick was created from the roundedStart
  42339. // but the last tick was not rounded.
  42340. if (me.options.time.max) {
  42341. me.ticks.push(me.lastTick.clone());
  42342. me.scaleSizeInUnits = me.lastTick.diff(me.ticks[0], me.tickUnit, true);
  42343. } else {
  42344. me.ticks.push(me.lastTick.clone());
  42345. me.scaleSizeInUnits = me.lastTick.diff(me.firstTick, me.tickUnit, true);
  42346. }
  42347. }
  42348. me.ctx.restore();
  42349. // Invalidate label diffs cache
  42350. me.labelDiffs = undefined;
  42351. },
  42352. // Get tooltip label
  42353. getLabelForIndex: function(index, datasetIndex) {
  42354. var me = this;
  42355. var label = me.chart.data.labels && index < me.chart.data.labels.length ? me.chart.data.labels[index] : '';
  42356. var value = me.chart.data.datasets[datasetIndex].data[index];
  42357. if (value !== null && typeof value === 'object') {
  42358. label = me.getRightValue(value);
  42359. }
  42360. // Format nicely
  42361. if (me.options.time.tooltipFormat) {
  42362. label = me.parseTime(label).format(me.options.time.tooltipFormat);
  42363. }
  42364. return label;
  42365. },
  42366. // Function to format an individual tick mark
  42367. tickFormatFunction: function(tick, index, ticks) {
  42368. var formattedTick = tick.format(this.displayFormat);
  42369. var tickOpts = this.options.ticks;
  42370. var callback = helpers.getValueOrDefault(tickOpts.callback, tickOpts.userCallback);
  42371. if (callback) {
  42372. return callback(formattedTick, index, ticks);
  42373. }
  42374. return formattedTick;
  42375. },
  42376. convertTicksToLabels: function() {
  42377. var me = this;
  42378. me.tickMoments = me.ticks;
  42379. me.ticks = me.ticks.map(me.tickFormatFunction, me);
  42380. },
  42381. getPixelForValue: function(value, index, datasetIndex) {
  42382. var me = this;
  42383. var offset = null;
  42384. if (index !== undefined && datasetIndex !== undefined) {
  42385. offset = me.getLabelDiff(datasetIndex, index);
  42386. }
  42387. if (offset === null) {
  42388. if (!value || !value.isValid) {
  42389. // not already a moment object
  42390. value = me.parseTime(me.getRightValue(value));
  42391. }
  42392. if (value && value.isValid && value.isValid()) {
  42393. offset = value.diff(me.firstTick, me.tickUnit, true);
  42394. }
  42395. }
  42396. if (offset !== null) {
  42397. var decimal = offset !== 0 ? offset / me.scaleSizeInUnits : offset;
  42398. if (me.isHorizontal()) {
  42399. var valueOffset = (me.width * decimal);
  42400. return me.left + Math.round(valueOffset);
  42401. }
  42402. var heightOffset = (me.height * decimal);
  42403. return me.top + Math.round(heightOffset);
  42404. }
  42405. },
  42406. getPixelForTick: function(index) {
  42407. return this.getPixelForValue(this.tickMoments[index], null, null);
  42408. },
  42409. getValueForPixel: function(pixel) {
  42410. var me = this;
  42411. var innerDimension = me.isHorizontal() ? me.width : me.height;
  42412. var offset = (pixel - (me.isHorizontal() ? me.left : me.top)) / innerDimension;
  42413. offset *= me.scaleSizeInUnits;
  42414. return me.firstTick.clone().add(moment.duration(offset, me.tickUnit).asSeconds(), 'seconds');
  42415. },
  42416. parseTime: function(label) {
  42417. var me = this;
  42418. if (typeof me.options.time.parser === 'string') {
  42419. return moment(label, me.options.time.parser);
  42420. }
  42421. if (typeof me.options.time.parser === 'function') {
  42422. return me.options.time.parser(label);
  42423. }
  42424. // Date objects
  42425. if (typeof label.getMonth === 'function' || typeof label === 'number') {
  42426. return moment(label);
  42427. }
  42428. // Moment support
  42429. if (label.isValid && label.isValid()) {
  42430. return label;
  42431. }
  42432. // Custom parsing (return an instance of moment)
  42433. if (typeof me.options.time.format !== 'string' && me.options.time.format.call) {
  42434. console.warn('options.time.format is deprecated and replaced by options.time.parser. See http://nnnick.github.io/Chart.js/docs-v2/#scales-time-scale');
  42435. return me.options.time.format(label);
  42436. }
  42437. // Moment format parsing
  42438. return moment(label, me.options.time.format);
  42439. }
  42440. });
  42441. Chart.scaleService.registerScaleType('time', TimeScale, defaultConfig);
  42442. };
  42443. /***/ }),
  42444. /* 168 */
  42445. /***/ (function(module, exports, __webpack_require__) {
  42446. /* MIT license */
  42447. var colorNames = __webpack_require__(172);
  42448. module.exports = {
  42449. getRgba: getRgba,
  42450. getHsla: getHsla,
  42451. getRgb: getRgb,
  42452. getHsl: getHsl,
  42453. getHwb: getHwb,
  42454. getAlpha: getAlpha,
  42455. hexString: hexString,
  42456. rgbString: rgbString,
  42457. rgbaString: rgbaString,
  42458. percentString: percentString,
  42459. percentaString: percentaString,
  42460. hslString: hslString,
  42461. hslaString: hslaString,
  42462. hwbString: hwbString,
  42463. keyword: keyword
  42464. }
  42465. function getRgba(string) {
  42466. if (!string) {
  42467. return;
  42468. }
  42469. var abbr = /^#([a-fA-F0-9]{3})$/,
  42470. hex = /^#([a-fA-F0-9]{6})$/,
  42471. rgba = /^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,
  42472. per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,
  42473. keyword = /(\w+)/;
  42474. var rgb = [0, 0, 0],
  42475. a = 1,
  42476. match = string.match(abbr);
  42477. if (match) {
  42478. match = match[1];
  42479. for (var i = 0; i < rgb.length; i++) {
  42480. rgb[i] = parseInt(match[i] + match[i], 16);
  42481. }
  42482. }
  42483. else if (match = string.match(hex)) {
  42484. match = match[1];
  42485. for (var i = 0; i < rgb.length; i++) {
  42486. rgb[i] = parseInt(match.slice(i * 2, i * 2 + 2), 16);
  42487. }
  42488. }
  42489. else if (match = string.match(rgba)) {
  42490. for (var i = 0; i < rgb.length; i++) {
  42491. rgb[i] = parseInt(match[i + 1]);
  42492. }
  42493. a = parseFloat(match[4]);
  42494. }
  42495. else if (match = string.match(per)) {
  42496. for (var i = 0; i < rgb.length; i++) {
  42497. rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);
  42498. }
  42499. a = parseFloat(match[4]);
  42500. }
  42501. else if (match = string.match(keyword)) {
  42502. if (match[1] == "transparent") {
  42503. return [0, 0, 0, 0];
  42504. }
  42505. rgb = colorNames[match[1]];
  42506. if (!rgb) {
  42507. return;
  42508. }
  42509. }
  42510. for (var i = 0; i < rgb.length; i++) {
  42511. rgb[i] = scale(rgb[i], 0, 255);
  42512. }
  42513. if (!a && a != 0) {
  42514. a = 1;
  42515. }
  42516. else {
  42517. a = scale(a, 0, 1);
  42518. }
  42519. rgb[3] = a;
  42520. return rgb;
  42521. }
  42522. function getHsla(string) {
  42523. if (!string) {
  42524. return;
  42525. }
  42526. var hsl = /^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/;
  42527. var match = string.match(hsl);
  42528. if (match) {
  42529. var alpha = parseFloat(match[4]);
  42530. var h = scale(parseInt(match[1]), 0, 360),
  42531. s = scale(parseFloat(match[2]), 0, 100),
  42532. l = scale(parseFloat(match[3]), 0, 100),
  42533. a = scale(isNaN(alpha) ? 1 : alpha, 0, 1);
  42534. return [h, s, l, a];
  42535. }
  42536. }
  42537. function getHwb(string) {
  42538. if (!string) {
  42539. return;
  42540. }
  42541. var hwb = /^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/;
  42542. var match = string.match(hwb);
  42543. if (match) {
  42544. var alpha = parseFloat(match[4]);
  42545. var h = scale(parseInt(match[1]), 0, 360),
  42546. w = scale(parseFloat(match[2]), 0, 100),
  42547. b = scale(parseFloat(match[3]), 0, 100),
  42548. a = scale(isNaN(alpha) ? 1 : alpha, 0, 1);
  42549. return [h, w, b, a];
  42550. }
  42551. }
  42552. function getRgb(string) {
  42553. var rgba = getRgba(string);
  42554. return rgba && rgba.slice(0, 3);
  42555. }
  42556. function getHsl(string) {
  42557. var hsla = getHsla(string);
  42558. return hsla && hsla.slice(0, 3);
  42559. }
  42560. function getAlpha(string) {
  42561. var vals = getRgba(string);
  42562. if (vals) {
  42563. return vals[3];
  42564. }
  42565. else if (vals = getHsla(string)) {
  42566. return vals[3];
  42567. }
  42568. else if (vals = getHwb(string)) {
  42569. return vals[3];
  42570. }
  42571. }
  42572. // generators
  42573. function hexString(rgb) {
  42574. return "#" + hexDouble(rgb[0]) + hexDouble(rgb[1])
  42575. + hexDouble(rgb[2]);
  42576. }
  42577. function rgbString(rgba, alpha) {
  42578. if (alpha < 1 || (rgba[3] && rgba[3] < 1)) {
  42579. return rgbaString(rgba, alpha);
  42580. }
  42581. return "rgb(" + rgba[0] + ", " + rgba[1] + ", " + rgba[2] + ")";
  42582. }
  42583. function rgbaString(rgba, alpha) {
  42584. if (alpha === undefined) {
  42585. alpha = (rgba[3] !== undefined ? rgba[3] : 1);
  42586. }
  42587. return "rgba(" + rgba[0] + ", " + rgba[1] + ", " + rgba[2]
  42588. + ", " + alpha + ")";
  42589. }
  42590. function percentString(rgba, alpha) {
  42591. if (alpha < 1 || (rgba[3] && rgba[3] < 1)) {
  42592. return percentaString(rgba, alpha);
  42593. }
  42594. var r = Math.round(rgba[0]/255 * 100),
  42595. g = Math.round(rgba[1]/255 * 100),
  42596. b = Math.round(rgba[2]/255 * 100);
  42597. return "rgb(" + r + "%, " + g + "%, " + b + "%)";
  42598. }
  42599. function percentaString(rgba, alpha) {
  42600. var r = Math.round(rgba[0]/255 * 100),
  42601. g = Math.round(rgba[1]/255 * 100),
  42602. b = Math.round(rgba[2]/255 * 100);
  42603. return "rgba(" + r + "%, " + g + "%, " + b + "%, " + (alpha || rgba[3] || 1) + ")";
  42604. }
  42605. function hslString(hsla, alpha) {
  42606. if (alpha < 1 || (hsla[3] && hsla[3] < 1)) {
  42607. return hslaString(hsla, alpha);
  42608. }
  42609. return "hsl(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%)";
  42610. }
  42611. function hslaString(hsla, alpha) {
  42612. if (alpha === undefined) {
  42613. alpha = (hsla[3] !== undefined ? hsla[3] : 1);
  42614. }
  42615. return "hsla(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%, "
  42616. + alpha + ")";
  42617. }
  42618. // hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax
  42619. // (hwb have alpha optional & 1 is default value)
  42620. function hwbString(hwb, alpha) {
  42621. if (alpha === undefined) {
  42622. alpha = (hwb[3] !== undefined ? hwb[3] : 1);
  42623. }
  42624. return "hwb(" + hwb[0] + ", " + hwb[1] + "%, " + hwb[2] + "%"
  42625. + (alpha !== undefined && alpha !== 1 ? ", " + alpha : "") + ")";
  42626. }
  42627. function keyword(rgb) {
  42628. return reverseNames[rgb.slice(0, 3)];
  42629. }
  42630. // helpers
  42631. function scale(num, min, max) {
  42632. return Math.min(Math.max(min, num), max);
  42633. }
  42634. function hexDouble(num) {
  42635. var str = num.toString(16).toUpperCase();
  42636. return (str.length < 2) ? "0" + str : str;
  42637. }
  42638. //create a list of reverse color names
  42639. var reverseNames = {};
  42640. for (var name in colorNames) {
  42641. reverseNames[colorNames[name]] = name;
  42642. }
  42643. /***/ }),
  42644. /* 169 */
  42645. /***/ (function(module, exports, __webpack_require__) {
  42646. /* MIT license */
  42647. var convert = __webpack_require__(171);
  42648. var string = __webpack_require__(168);
  42649. var Color = function (obj) {
  42650. if (obj instanceof Color) {
  42651. return obj;
  42652. }
  42653. if (!(this instanceof Color)) {
  42654. return new Color(obj);
  42655. }
  42656. this.valid = false;
  42657. this.values = {
  42658. rgb: [0, 0, 0],
  42659. hsl: [0, 0, 0],
  42660. hsv: [0, 0, 0],
  42661. hwb: [0, 0, 0],
  42662. cmyk: [0, 0, 0, 0],
  42663. alpha: 1
  42664. };
  42665. // parse Color() argument
  42666. var vals;
  42667. if (typeof obj === 'string') {
  42668. vals = string.getRgba(obj);
  42669. if (vals) {
  42670. this.setValues('rgb', vals);
  42671. } else if (vals = string.getHsla(obj)) {
  42672. this.setValues('hsl', vals);
  42673. } else if (vals = string.getHwb(obj)) {
  42674. this.setValues('hwb', vals);
  42675. }
  42676. } else if (typeof obj === 'object') {
  42677. vals = obj;
  42678. if (vals.r !== undefined || vals.red !== undefined) {
  42679. this.setValues('rgb', vals);
  42680. } else if (vals.l !== undefined || vals.lightness !== undefined) {
  42681. this.setValues('hsl', vals);
  42682. } else if (vals.v !== undefined || vals.value !== undefined) {
  42683. this.setValues('hsv', vals);
  42684. } else if (vals.w !== undefined || vals.whiteness !== undefined) {
  42685. this.setValues('hwb', vals);
  42686. } else if (vals.c !== undefined || vals.cyan !== undefined) {
  42687. this.setValues('cmyk', vals);
  42688. }
  42689. }
  42690. };
  42691. Color.prototype = {
  42692. isValid: function () {
  42693. return this.valid;
  42694. },
  42695. rgb: function () {
  42696. return this.setSpace('rgb', arguments);
  42697. },
  42698. hsl: function () {
  42699. return this.setSpace('hsl', arguments);
  42700. },
  42701. hsv: function () {
  42702. return this.setSpace('hsv', arguments);
  42703. },
  42704. hwb: function () {
  42705. return this.setSpace('hwb', arguments);
  42706. },
  42707. cmyk: function () {
  42708. return this.setSpace('cmyk', arguments);
  42709. },
  42710. rgbArray: function () {
  42711. return this.values.rgb;
  42712. },
  42713. hslArray: function () {
  42714. return this.values.hsl;
  42715. },
  42716. hsvArray: function () {
  42717. return this.values.hsv;
  42718. },
  42719. hwbArray: function () {
  42720. var values = this.values;
  42721. if (values.alpha !== 1) {
  42722. return values.hwb.concat([values.alpha]);
  42723. }
  42724. return values.hwb;
  42725. },
  42726. cmykArray: function () {
  42727. return this.values.cmyk;
  42728. },
  42729. rgbaArray: function () {
  42730. var values = this.values;
  42731. return values.rgb.concat([values.alpha]);
  42732. },
  42733. hslaArray: function () {
  42734. var values = this.values;
  42735. return values.hsl.concat([values.alpha]);
  42736. },
  42737. alpha: function (val) {
  42738. if (val === undefined) {
  42739. return this.values.alpha;
  42740. }
  42741. this.setValues('alpha', val);
  42742. return this;
  42743. },
  42744. red: function (val) {
  42745. return this.setChannel('rgb', 0, val);
  42746. },
  42747. green: function (val) {
  42748. return this.setChannel('rgb', 1, val);
  42749. },
  42750. blue: function (val) {
  42751. return this.setChannel('rgb', 2, val);
  42752. },
  42753. hue: function (val) {
  42754. if (val) {
  42755. val %= 360;
  42756. val = val < 0 ? 360 + val : val;
  42757. }
  42758. return this.setChannel('hsl', 0, val);
  42759. },
  42760. saturation: function (val) {
  42761. return this.setChannel('hsl', 1, val);
  42762. },
  42763. lightness: function (val) {
  42764. return this.setChannel('hsl', 2, val);
  42765. },
  42766. saturationv: function (val) {
  42767. return this.setChannel('hsv', 1, val);
  42768. },
  42769. whiteness: function (val) {
  42770. return this.setChannel('hwb', 1, val);
  42771. },
  42772. blackness: function (val) {
  42773. return this.setChannel('hwb', 2, val);
  42774. },
  42775. value: function (val) {
  42776. return this.setChannel('hsv', 2, val);
  42777. },
  42778. cyan: function (val) {
  42779. return this.setChannel('cmyk', 0, val);
  42780. },
  42781. magenta: function (val) {
  42782. return this.setChannel('cmyk', 1, val);
  42783. },
  42784. yellow: function (val) {
  42785. return this.setChannel('cmyk', 2, val);
  42786. },
  42787. black: function (val) {
  42788. return this.setChannel('cmyk', 3, val);
  42789. },
  42790. hexString: function () {
  42791. return string.hexString(this.values.rgb);
  42792. },
  42793. rgbString: function () {
  42794. return string.rgbString(this.values.rgb, this.values.alpha);
  42795. },
  42796. rgbaString: function () {
  42797. return string.rgbaString(this.values.rgb, this.values.alpha);
  42798. },
  42799. percentString: function () {
  42800. return string.percentString(this.values.rgb, this.values.alpha);
  42801. },
  42802. hslString: function () {
  42803. return string.hslString(this.values.hsl, this.values.alpha);
  42804. },
  42805. hslaString: function () {
  42806. return string.hslaString(this.values.hsl, this.values.alpha);
  42807. },
  42808. hwbString: function () {
  42809. return string.hwbString(this.values.hwb, this.values.alpha);
  42810. },
  42811. keyword: function () {
  42812. return string.keyword(this.values.rgb, this.values.alpha);
  42813. },
  42814. rgbNumber: function () {
  42815. var rgb = this.values.rgb;
  42816. return (rgb[0] << 16) | (rgb[1] << 8) | rgb[2];
  42817. },
  42818. luminosity: function () {
  42819. // http://www.w3.org/TR/WCAG20/#relativeluminancedef
  42820. var rgb = this.values.rgb;
  42821. var lum = [];
  42822. for (var i = 0; i < rgb.length; i++) {
  42823. var chan = rgb[i] / 255;
  42824. lum[i] = (chan <= 0.03928) ? chan / 12.92 : Math.pow(((chan + 0.055) / 1.055), 2.4);
  42825. }
  42826. return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
  42827. },
  42828. contrast: function (color2) {
  42829. // http://www.w3.org/TR/WCAG20/#contrast-ratiodef
  42830. var lum1 = this.luminosity();
  42831. var lum2 = color2.luminosity();
  42832. if (lum1 > lum2) {
  42833. return (lum1 + 0.05) / (lum2 + 0.05);
  42834. }
  42835. return (lum2 + 0.05) / (lum1 + 0.05);
  42836. },
  42837. level: function (color2) {
  42838. var contrastRatio = this.contrast(color2);
  42839. if (contrastRatio >= 7.1) {
  42840. return 'AAA';
  42841. }
  42842. return (contrastRatio >= 4.5) ? 'AA' : '';
  42843. },
  42844. dark: function () {
  42845. // YIQ equation from http://24ways.org/2010/calculating-color-contrast
  42846. var rgb = this.values.rgb;
  42847. var yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000;
  42848. return yiq < 128;
  42849. },
  42850. light: function () {
  42851. return !this.dark();
  42852. },
  42853. negate: function () {
  42854. var rgb = [];
  42855. for (var i = 0; i < 3; i++) {
  42856. rgb[i] = 255 - this.values.rgb[i];
  42857. }
  42858. this.setValues('rgb', rgb);
  42859. return this;
  42860. },
  42861. lighten: function (ratio) {
  42862. var hsl = this.values.hsl;
  42863. hsl[2] += hsl[2] * ratio;
  42864. this.setValues('hsl', hsl);
  42865. return this;
  42866. },
  42867. darken: function (ratio) {
  42868. var hsl = this.values.hsl;
  42869. hsl[2] -= hsl[2] * ratio;
  42870. this.setValues('hsl', hsl);
  42871. return this;
  42872. },
  42873. saturate: function (ratio) {
  42874. var hsl = this.values.hsl;
  42875. hsl[1] += hsl[1] * ratio;
  42876. this.setValues('hsl', hsl);
  42877. return this;
  42878. },
  42879. desaturate: function (ratio) {
  42880. var hsl = this.values.hsl;
  42881. hsl[1] -= hsl[1] * ratio;
  42882. this.setValues('hsl', hsl);
  42883. return this;
  42884. },
  42885. whiten: function (ratio) {
  42886. var hwb = this.values.hwb;
  42887. hwb[1] += hwb[1] * ratio;
  42888. this.setValues('hwb', hwb);
  42889. return this;
  42890. },
  42891. blacken: function (ratio) {
  42892. var hwb = this.values.hwb;
  42893. hwb[2] += hwb[2] * ratio;
  42894. this.setValues('hwb', hwb);
  42895. return this;
  42896. },
  42897. greyscale: function () {
  42898. var rgb = this.values.rgb;
  42899. // http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale
  42900. var val = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
  42901. this.setValues('rgb', [val, val, val]);
  42902. return this;
  42903. },
  42904. clearer: function (ratio) {
  42905. var alpha = this.values.alpha;
  42906. this.setValues('alpha', alpha - (alpha * ratio));
  42907. return this;
  42908. },
  42909. opaquer: function (ratio) {
  42910. var alpha = this.values.alpha;
  42911. this.setValues('alpha', alpha + (alpha * ratio));
  42912. return this;
  42913. },
  42914. rotate: function (degrees) {
  42915. var hsl = this.values.hsl;
  42916. var hue = (hsl[0] + degrees) % 360;
  42917. hsl[0] = hue < 0 ? 360 + hue : hue;
  42918. this.setValues('hsl', hsl);
  42919. return this;
  42920. },
  42921. /**
  42922. * Ported from sass implementation in C
  42923. * https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209
  42924. */
  42925. mix: function (mixinColor, weight) {
  42926. var color1 = this;
  42927. var color2 = mixinColor;
  42928. var p = weight === undefined ? 0.5 : weight;
  42929. var w = 2 * p - 1;
  42930. var a = color1.alpha() - color2.alpha();
  42931. var w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
  42932. var w2 = 1 - w1;
  42933. return this
  42934. .rgb(
  42935. w1 * color1.red() + w2 * color2.red(),
  42936. w1 * color1.green() + w2 * color2.green(),
  42937. w1 * color1.blue() + w2 * color2.blue()
  42938. )
  42939. .alpha(color1.alpha() * p + color2.alpha() * (1 - p));
  42940. },
  42941. toJSON: function () {
  42942. return this.rgb();
  42943. },
  42944. clone: function () {
  42945. // NOTE(SB): using node-clone creates a dependency to Buffer when using browserify,
  42946. // making the final build way to big to embed in Chart.js. So let's do it manually,
  42947. // assuming that values to clone are 1 dimension arrays containing only numbers,
  42948. // except 'alpha' which is a number.
  42949. var result = new Color();
  42950. var source = this.values;
  42951. var target = result.values;
  42952. var value, type;
  42953. for (var prop in source) {
  42954. if (source.hasOwnProperty(prop)) {
  42955. value = source[prop];
  42956. type = ({}).toString.call(value);
  42957. if (type === '[object Array]') {
  42958. target[prop] = value.slice(0);
  42959. } else if (type === '[object Number]') {
  42960. target[prop] = value;
  42961. } else {
  42962. console.error('unexpected color value:', value);
  42963. }
  42964. }
  42965. }
  42966. return result;
  42967. }
  42968. };
  42969. Color.prototype.spaces = {
  42970. rgb: ['red', 'green', 'blue'],
  42971. hsl: ['hue', 'saturation', 'lightness'],
  42972. hsv: ['hue', 'saturation', 'value'],
  42973. hwb: ['hue', 'whiteness', 'blackness'],
  42974. cmyk: ['cyan', 'magenta', 'yellow', 'black']
  42975. };
  42976. Color.prototype.maxes = {
  42977. rgb: [255, 255, 255],
  42978. hsl: [360, 100, 100],
  42979. hsv: [360, 100, 100],
  42980. hwb: [360, 100, 100],
  42981. cmyk: [100, 100, 100, 100]
  42982. };
  42983. Color.prototype.getValues = function (space) {
  42984. var values = this.values;
  42985. var vals = {};
  42986. for (var i = 0; i < space.length; i++) {
  42987. vals[space.charAt(i)] = values[space][i];
  42988. }
  42989. if (values.alpha !== 1) {
  42990. vals.a = values.alpha;
  42991. }
  42992. // {r: 255, g: 255, b: 255, a: 0.4}
  42993. return vals;
  42994. };
  42995. Color.prototype.setValues = function (space, vals) {
  42996. var values = this.values;
  42997. var spaces = this.spaces;
  42998. var maxes = this.maxes;
  42999. var alpha = 1;
  43000. var i;
  43001. this.valid = true;
  43002. if (space === 'alpha') {
  43003. alpha = vals;
  43004. } else if (vals.length) {
  43005. // [10, 10, 10]
  43006. values[space] = vals.slice(0, space.length);
  43007. alpha = vals[space.length];
  43008. } else if (vals[space.charAt(0)] !== undefined) {
  43009. // {r: 10, g: 10, b: 10}
  43010. for (i = 0; i < space.length; i++) {
  43011. values[space][i] = vals[space.charAt(i)];
  43012. }
  43013. alpha = vals.a;
  43014. } else if (vals[spaces[space][0]] !== undefined) {
  43015. // {red: 10, green: 10, blue: 10}
  43016. var chans = spaces[space];
  43017. for (i = 0; i < space.length; i++) {
  43018. values[space][i] = vals[chans[i]];
  43019. }
  43020. alpha = vals.alpha;
  43021. }
  43022. values.alpha = Math.max(0, Math.min(1, (alpha === undefined ? values.alpha : alpha)));
  43023. if (space === 'alpha') {
  43024. return false;
  43025. }
  43026. var capped;
  43027. // cap values of the space prior converting all values
  43028. for (i = 0; i < space.length; i++) {
  43029. capped = Math.max(0, Math.min(maxes[space][i], values[space][i]));
  43030. values[space][i] = Math.round(capped);
  43031. }
  43032. // convert to all the other color spaces
  43033. for (var sname in spaces) {
  43034. if (sname !== space) {
  43035. values[sname] = convert[space][sname](values[space]);
  43036. }
  43037. }
  43038. return true;
  43039. };
  43040. Color.prototype.setSpace = function (space, args) {
  43041. var vals = args[0];
  43042. if (vals === undefined) {
  43043. // color.rgb()
  43044. return this.getValues(space);
  43045. }
  43046. // color.rgb(10, 10, 10)
  43047. if (typeof vals === 'number') {
  43048. vals = Array.prototype.slice.call(args);
  43049. }
  43050. this.setValues(space, vals);
  43051. return this;
  43052. };
  43053. Color.prototype.setChannel = function (space, index, val) {
  43054. var svalues = this.values[space];
  43055. if (val === undefined) {
  43056. // color.red()
  43057. return svalues[index];
  43058. } else if (val === svalues[index]) {
  43059. // color.red(color.red())
  43060. return this;
  43061. }
  43062. // color.red(100)
  43063. svalues[index] = val;
  43064. this.setValues(space, svalues);
  43065. return this;
  43066. };
  43067. if (typeof window !== 'undefined') {
  43068. window.Color = Color;
  43069. }
  43070. module.exports = Color;
  43071. /***/ }),
  43072. /* 170 */
  43073. /***/ (function(module, exports) {
  43074. /* MIT license */
  43075. module.exports = {
  43076. rgb2hsl: rgb2hsl,
  43077. rgb2hsv: rgb2hsv,
  43078. rgb2hwb: rgb2hwb,
  43079. rgb2cmyk: rgb2cmyk,
  43080. rgb2keyword: rgb2keyword,
  43081. rgb2xyz: rgb2xyz,
  43082. rgb2lab: rgb2lab,
  43083. rgb2lch: rgb2lch,
  43084. hsl2rgb: hsl2rgb,
  43085. hsl2hsv: hsl2hsv,
  43086. hsl2hwb: hsl2hwb,
  43087. hsl2cmyk: hsl2cmyk,
  43088. hsl2keyword: hsl2keyword,
  43089. hsv2rgb: hsv2rgb,
  43090. hsv2hsl: hsv2hsl,
  43091. hsv2hwb: hsv2hwb,
  43092. hsv2cmyk: hsv2cmyk,
  43093. hsv2keyword: hsv2keyword,
  43094. hwb2rgb: hwb2rgb,
  43095. hwb2hsl: hwb2hsl,
  43096. hwb2hsv: hwb2hsv,
  43097. hwb2cmyk: hwb2cmyk,
  43098. hwb2keyword: hwb2keyword,
  43099. cmyk2rgb: cmyk2rgb,
  43100. cmyk2hsl: cmyk2hsl,
  43101. cmyk2hsv: cmyk2hsv,
  43102. cmyk2hwb: cmyk2hwb,
  43103. cmyk2keyword: cmyk2keyword,
  43104. keyword2rgb: keyword2rgb,
  43105. keyword2hsl: keyword2hsl,
  43106. keyword2hsv: keyword2hsv,
  43107. keyword2hwb: keyword2hwb,
  43108. keyword2cmyk: keyword2cmyk,
  43109. keyword2lab: keyword2lab,
  43110. keyword2xyz: keyword2xyz,
  43111. xyz2rgb: xyz2rgb,
  43112. xyz2lab: xyz2lab,
  43113. xyz2lch: xyz2lch,
  43114. lab2xyz: lab2xyz,
  43115. lab2rgb: lab2rgb,
  43116. lab2lch: lab2lch,
  43117. lch2lab: lch2lab,
  43118. lch2xyz: lch2xyz,
  43119. lch2rgb: lch2rgb
  43120. }
  43121. function rgb2hsl(rgb) {
  43122. var r = rgb[0]/255,
  43123. g = rgb[1]/255,
  43124. b = rgb[2]/255,
  43125. min = Math.min(r, g, b),
  43126. max = Math.max(r, g, b),
  43127. delta = max - min,
  43128. h, s, l;
  43129. if (max == min)
  43130. h = 0;
  43131. else if (r == max)
  43132. h = (g - b) / delta;
  43133. else if (g == max)
  43134. h = 2 + (b - r) / delta;
  43135. else if (b == max)
  43136. h = 4 + (r - g)/ delta;
  43137. h = Math.min(h * 60, 360);
  43138. if (h < 0)
  43139. h += 360;
  43140. l = (min + max) / 2;
  43141. if (max == min)
  43142. s = 0;
  43143. else if (l <= 0.5)
  43144. s = delta / (max + min);
  43145. else
  43146. s = delta / (2 - max - min);
  43147. return [h, s * 100, l * 100];
  43148. }
  43149. function rgb2hsv(rgb) {
  43150. var r = rgb[0],
  43151. g = rgb[1],
  43152. b = rgb[2],
  43153. min = Math.min(r, g, b),
  43154. max = Math.max(r, g, b),
  43155. delta = max - min,
  43156. h, s, v;
  43157. if (max == 0)
  43158. s = 0;
  43159. else
  43160. s = (delta/max * 1000)/10;
  43161. if (max == min)
  43162. h = 0;
  43163. else if (r == max)
  43164. h = (g - b) / delta;
  43165. else if (g == max)
  43166. h = 2 + (b - r) / delta;
  43167. else if (b == max)
  43168. h = 4 + (r - g) / delta;
  43169. h = Math.min(h * 60, 360);
  43170. if (h < 0)
  43171. h += 360;
  43172. v = ((max / 255) * 1000) / 10;
  43173. return [h, s, v];
  43174. }
  43175. function rgb2hwb(rgb) {
  43176. var r = rgb[0],
  43177. g = rgb[1],
  43178. b = rgb[2],
  43179. h = rgb2hsl(rgb)[0],
  43180. w = 1/255 * Math.min(r, Math.min(g, b)),
  43181. b = 1 - 1/255 * Math.max(r, Math.max(g, b));
  43182. return [h, w * 100, b * 100];
  43183. }
  43184. function rgb2cmyk(rgb) {
  43185. var r = rgb[0] / 255,
  43186. g = rgb[1] / 255,
  43187. b = rgb[2] / 255,
  43188. c, m, y, k;
  43189. k = Math.min(1 - r, 1 - g, 1 - b);
  43190. c = (1 - r - k) / (1 - k) || 0;
  43191. m = (1 - g - k) / (1 - k) || 0;
  43192. y = (1 - b - k) / (1 - k) || 0;
  43193. return [c * 100, m * 100, y * 100, k * 100];
  43194. }
  43195. function rgb2keyword(rgb) {
  43196. return reverseKeywords[JSON.stringify(rgb)];
  43197. }
  43198. function rgb2xyz(rgb) {
  43199. var r = rgb[0] / 255,
  43200. g = rgb[1] / 255,
  43201. b = rgb[2] / 255;
  43202. // assume sRGB
  43203. r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);
  43204. g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);
  43205. b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);
  43206. var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);
  43207. var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);
  43208. var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);
  43209. return [x * 100, y *100, z * 100];
  43210. }
  43211. function rgb2lab(rgb) {
  43212. var xyz = rgb2xyz(rgb),
  43213. x = xyz[0],
  43214. y = xyz[1],
  43215. z = xyz[2],
  43216. l, a, b;
  43217. x /= 95.047;
  43218. y /= 100;
  43219. z /= 108.883;
  43220. x = x > 0.008856 ? Math.pow(x, 1/3) : (7.787 * x) + (16 / 116);
  43221. y = y > 0.008856 ? Math.pow(y, 1/3) : (7.787 * y) + (16 / 116);
  43222. z = z > 0.008856 ? Math.pow(z, 1/3) : (7.787 * z) + (16 / 116);
  43223. l = (116 * y) - 16;
  43224. a = 500 * (x - y);
  43225. b = 200 * (y - z);
  43226. return [l, a, b];
  43227. }
  43228. function rgb2lch(args) {
  43229. return lab2lch(rgb2lab(args));
  43230. }
  43231. function hsl2rgb(hsl) {
  43232. var h = hsl[0] / 360,
  43233. s = hsl[1] / 100,
  43234. l = hsl[2] / 100,
  43235. t1, t2, t3, rgb, val;
  43236. if (s == 0) {
  43237. val = l * 255;
  43238. return [val, val, val];
  43239. }
  43240. if (l < 0.5)
  43241. t2 = l * (1 + s);
  43242. else
  43243. t2 = l + s - l * s;
  43244. t1 = 2 * l - t2;
  43245. rgb = [0, 0, 0];
  43246. for (var i = 0; i < 3; i++) {
  43247. t3 = h + 1 / 3 * - (i - 1);
  43248. t3 < 0 && t3++;
  43249. t3 > 1 && t3--;
  43250. if (6 * t3 < 1)
  43251. val = t1 + (t2 - t1) * 6 * t3;
  43252. else if (2 * t3 < 1)
  43253. val = t2;
  43254. else if (3 * t3 < 2)
  43255. val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
  43256. else
  43257. val = t1;
  43258. rgb[i] = val * 255;
  43259. }
  43260. return rgb;
  43261. }
  43262. function hsl2hsv(hsl) {
  43263. var h = hsl[0],
  43264. s = hsl[1] / 100,
  43265. l = hsl[2] / 100,
  43266. sv, v;
  43267. if(l === 0) {
  43268. // no need to do calc on black
  43269. // also avoids divide by 0 error
  43270. return [0, 0, 0];
  43271. }
  43272. l *= 2;
  43273. s *= (l <= 1) ? l : 2 - l;
  43274. v = (l + s) / 2;
  43275. sv = (2 * s) / (l + s);
  43276. return [h, sv * 100, v * 100];
  43277. }
  43278. function hsl2hwb(args) {
  43279. return rgb2hwb(hsl2rgb(args));
  43280. }
  43281. function hsl2cmyk(args) {
  43282. return rgb2cmyk(hsl2rgb(args));
  43283. }
  43284. function hsl2keyword(args) {
  43285. return rgb2keyword(hsl2rgb(args));
  43286. }
  43287. function hsv2rgb(hsv) {
  43288. var h = hsv[0] / 60,
  43289. s = hsv[1] / 100,
  43290. v = hsv[2] / 100,
  43291. hi = Math.floor(h) % 6;
  43292. var f = h - Math.floor(h),
  43293. p = 255 * v * (1 - s),
  43294. q = 255 * v * (1 - (s * f)),
  43295. t = 255 * v * (1 - (s * (1 - f))),
  43296. v = 255 * v;
  43297. switch(hi) {
  43298. case 0:
  43299. return [v, t, p];
  43300. case 1:
  43301. return [q, v, p];
  43302. case 2:
  43303. return [p, v, t];
  43304. case 3:
  43305. return [p, q, v];
  43306. case 4:
  43307. return [t, p, v];
  43308. case 5:
  43309. return [v, p, q];
  43310. }
  43311. }
  43312. function hsv2hsl(hsv) {
  43313. var h = hsv[0],
  43314. s = hsv[1] / 100,
  43315. v = hsv[2] / 100,
  43316. sl, l;
  43317. l = (2 - s) * v;
  43318. sl = s * v;
  43319. sl /= (l <= 1) ? l : 2 - l;
  43320. sl = sl || 0;
  43321. l /= 2;
  43322. return [h, sl * 100, l * 100];
  43323. }
  43324. function hsv2hwb(args) {
  43325. return rgb2hwb(hsv2rgb(args))
  43326. }
  43327. function hsv2cmyk(args) {
  43328. return rgb2cmyk(hsv2rgb(args));
  43329. }
  43330. function hsv2keyword(args) {
  43331. return rgb2keyword(hsv2rgb(args));
  43332. }
  43333. // http://dev.w3.org/csswg/css-color/#hwb-to-rgb
  43334. function hwb2rgb(hwb) {
  43335. var h = hwb[0] / 360,
  43336. wh = hwb[1] / 100,
  43337. bl = hwb[2] / 100,
  43338. ratio = wh + bl,
  43339. i, v, f, n;
  43340. // wh + bl cant be > 1
  43341. if (ratio > 1) {
  43342. wh /= ratio;
  43343. bl /= ratio;
  43344. }
  43345. i = Math.floor(6 * h);
  43346. v = 1 - bl;
  43347. f = 6 * h - i;
  43348. if ((i & 0x01) != 0) {
  43349. f = 1 - f;
  43350. }
  43351. n = wh + f * (v - wh); // linear interpolation
  43352. switch (i) {
  43353. default:
  43354. case 6:
  43355. case 0: r = v; g = n; b = wh; break;
  43356. case 1: r = n; g = v; b = wh; break;
  43357. case 2: r = wh; g = v; b = n; break;
  43358. case 3: r = wh; g = n; b = v; break;
  43359. case 4: r = n; g = wh; b = v; break;
  43360. case 5: r = v; g = wh; b = n; break;
  43361. }
  43362. return [r * 255, g * 255, b * 255];
  43363. }
  43364. function hwb2hsl(args) {
  43365. return rgb2hsl(hwb2rgb(args));
  43366. }
  43367. function hwb2hsv(args) {
  43368. return rgb2hsv(hwb2rgb(args));
  43369. }
  43370. function hwb2cmyk(args) {
  43371. return rgb2cmyk(hwb2rgb(args));
  43372. }
  43373. function hwb2keyword(args) {
  43374. return rgb2keyword(hwb2rgb(args));
  43375. }
  43376. function cmyk2rgb(cmyk) {
  43377. var c = cmyk[0] / 100,
  43378. m = cmyk[1] / 100,
  43379. y = cmyk[2] / 100,
  43380. k = cmyk[3] / 100,
  43381. r, g, b;
  43382. r = 1 - Math.min(1, c * (1 - k) + k);
  43383. g = 1 - Math.min(1, m * (1 - k) + k);
  43384. b = 1 - Math.min(1, y * (1 - k) + k);
  43385. return [r * 255, g * 255, b * 255];
  43386. }
  43387. function cmyk2hsl(args) {
  43388. return rgb2hsl(cmyk2rgb(args));
  43389. }
  43390. function cmyk2hsv(args) {
  43391. return rgb2hsv(cmyk2rgb(args));
  43392. }
  43393. function cmyk2hwb(args) {
  43394. return rgb2hwb(cmyk2rgb(args));
  43395. }
  43396. function cmyk2keyword(args) {
  43397. return rgb2keyword(cmyk2rgb(args));
  43398. }
  43399. function xyz2rgb(xyz) {
  43400. var x = xyz[0] / 100,
  43401. y = xyz[1] / 100,
  43402. z = xyz[2] / 100,
  43403. r, g, b;
  43404. r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);
  43405. g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);
  43406. b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);
  43407. // assume sRGB
  43408. r = r > 0.0031308 ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)
  43409. : r = (r * 12.92);
  43410. g = g > 0.0031308 ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)
  43411. : g = (g * 12.92);
  43412. b = b > 0.0031308 ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)
  43413. : b = (b * 12.92);
  43414. r = Math.min(Math.max(0, r), 1);
  43415. g = Math.min(Math.max(0, g), 1);
  43416. b = Math.min(Math.max(0, b), 1);
  43417. return [r * 255, g * 255, b * 255];
  43418. }
  43419. function xyz2lab(xyz) {
  43420. var x = xyz[0],
  43421. y = xyz[1],
  43422. z = xyz[2],
  43423. l, a, b;
  43424. x /= 95.047;
  43425. y /= 100;
  43426. z /= 108.883;
  43427. x = x > 0.008856 ? Math.pow(x, 1/3) : (7.787 * x) + (16 / 116);
  43428. y = y > 0.008856 ? Math.pow(y, 1/3) : (7.787 * y) + (16 / 116);
  43429. z = z > 0.008856 ? Math.pow(z, 1/3) : (7.787 * z) + (16 / 116);
  43430. l = (116 * y) - 16;
  43431. a = 500 * (x - y);
  43432. b = 200 * (y - z);
  43433. return [l, a, b];
  43434. }
  43435. function xyz2lch(args) {
  43436. return lab2lch(xyz2lab(args));
  43437. }
  43438. function lab2xyz(lab) {
  43439. var l = lab[0],
  43440. a = lab[1],
  43441. b = lab[2],
  43442. x, y, z, y2;
  43443. if (l <= 8) {
  43444. y = (l * 100) / 903.3;
  43445. y2 = (7.787 * (y / 100)) + (16 / 116);
  43446. } else {
  43447. y = 100 * Math.pow((l + 16) / 116, 3);
  43448. y2 = Math.pow(y / 100, 1/3);
  43449. }
  43450. x = x / 95.047 <= 0.008856 ? x = (95.047 * ((a / 500) + y2 - (16 / 116))) / 7.787 : 95.047 * Math.pow((a / 500) + y2, 3);
  43451. z = z / 108.883 <= 0.008859 ? z = (108.883 * (y2 - (b / 200) - (16 / 116))) / 7.787 : 108.883 * Math.pow(y2 - (b / 200), 3);
  43452. return [x, y, z];
  43453. }
  43454. function lab2lch(lab) {
  43455. var l = lab[0],
  43456. a = lab[1],
  43457. b = lab[2],
  43458. hr, h, c;
  43459. hr = Math.atan2(b, a);
  43460. h = hr * 360 / 2 / Math.PI;
  43461. if (h < 0) {
  43462. h += 360;
  43463. }
  43464. c = Math.sqrt(a * a + b * b);
  43465. return [l, c, h];
  43466. }
  43467. function lab2rgb(args) {
  43468. return xyz2rgb(lab2xyz(args));
  43469. }
  43470. function lch2lab(lch) {
  43471. var l = lch[0],
  43472. c = lch[1],
  43473. h = lch[2],
  43474. a, b, hr;
  43475. hr = h / 360 * 2 * Math.PI;
  43476. a = c * Math.cos(hr);
  43477. b = c * Math.sin(hr);
  43478. return [l, a, b];
  43479. }
  43480. function lch2xyz(args) {
  43481. return lab2xyz(lch2lab(args));
  43482. }
  43483. function lch2rgb(args) {
  43484. return lab2rgb(lch2lab(args));
  43485. }
  43486. function keyword2rgb(keyword) {
  43487. return cssKeywords[keyword];
  43488. }
  43489. function keyword2hsl(args) {
  43490. return rgb2hsl(keyword2rgb(args));
  43491. }
  43492. function keyword2hsv(args) {
  43493. return rgb2hsv(keyword2rgb(args));
  43494. }
  43495. function keyword2hwb(args) {
  43496. return rgb2hwb(keyword2rgb(args));
  43497. }
  43498. function keyword2cmyk(args) {
  43499. return rgb2cmyk(keyword2rgb(args));
  43500. }
  43501. function keyword2lab(args) {
  43502. return rgb2lab(keyword2rgb(args));
  43503. }
  43504. function keyword2xyz(args) {
  43505. return rgb2xyz(keyword2rgb(args));
  43506. }
  43507. var cssKeywords = {
  43508. aliceblue: [240,248,255],
  43509. antiquewhite: [250,235,215],
  43510. aqua: [0,255,255],
  43511. aquamarine: [127,255,212],
  43512. azure: [240,255,255],
  43513. beige: [245,245,220],
  43514. bisque: [255,228,196],
  43515. black: [0,0,0],
  43516. blanchedalmond: [255,235,205],
  43517. blue: [0,0,255],
  43518. blueviolet: [138,43,226],
  43519. brown: [165,42,42],
  43520. burlywood: [222,184,135],
  43521. cadetblue: [95,158,160],
  43522. chartreuse: [127,255,0],
  43523. chocolate: [210,105,30],
  43524. coral: [255,127,80],
  43525. cornflowerblue: [100,149,237],
  43526. cornsilk: [255,248,220],
  43527. crimson: [220,20,60],
  43528. cyan: [0,255,255],
  43529. darkblue: [0,0,139],
  43530. darkcyan: [0,139,139],
  43531. darkgoldenrod: [184,134,11],
  43532. darkgray: [169,169,169],
  43533. darkgreen: [0,100,0],
  43534. darkgrey: [169,169,169],
  43535. darkkhaki: [189,183,107],
  43536. darkmagenta: [139,0,139],
  43537. darkolivegreen: [85,107,47],
  43538. darkorange: [255,140,0],
  43539. darkorchid: [153,50,204],
  43540. darkred: [139,0,0],
  43541. darksalmon: [233,150,122],
  43542. darkseagreen: [143,188,143],
  43543. darkslateblue: [72,61,139],
  43544. darkslategray: [47,79,79],
  43545. darkslategrey: [47,79,79],
  43546. darkturquoise: [0,206,209],
  43547. darkviolet: [148,0,211],
  43548. deeppink: [255,20,147],
  43549. deepskyblue: [0,191,255],
  43550. dimgray: [105,105,105],
  43551. dimgrey: [105,105,105],
  43552. dodgerblue: [30,144,255],
  43553. firebrick: [178,34,34],
  43554. floralwhite: [255,250,240],
  43555. forestgreen: [34,139,34],
  43556. fuchsia: [255,0,255],
  43557. gainsboro: [220,220,220],
  43558. ghostwhite: [248,248,255],
  43559. gold: [255,215,0],
  43560. goldenrod: [218,165,32],
  43561. gray: [128,128,128],
  43562. green: [0,128,0],
  43563. greenyellow: [173,255,47],
  43564. grey: [128,128,128],
  43565. honeydew: [240,255,240],
  43566. hotpink: [255,105,180],
  43567. indianred: [205,92,92],
  43568. indigo: [75,0,130],
  43569. ivory: [255,255,240],
  43570. khaki: [240,230,140],
  43571. lavender: [230,230,250],
  43572. lavenderblush: [255,240,245],
  43573. lawngreen: [124,252,0],
  43574. lemonchiffon: [255,250,205],
  43575. lightblue: [173,216,230],
  43576. lightcoral: [240,128,128],
  43577. lightcyan: [224,255,255],
  43578. lightgoldenrodyellow: [250,250,210],
  43579. lightgray: [211,211,211],
  43580. lightgreen: [144,238,144],
  43581. lightgrey: [211,211,211],
  43582. lightpink: [255,182,193],
  43583. lightsalmon: [255,160,122],
  43584. lightseagreen: [32,178,170],
  43585. lightskyblue: [135,206,250],
  43586. lightslategray: [119,136,153],
  43587. lightslategrey: [119,136,153],
  43588. lightsteelblue: [176,196,222],
  43589. lightyellow: [255,255,224],
  43590. lime: [0,255,0],
  43591. limegreen: [50,205,50],
  43592. linen: [250,240,230],
  43593. magenta: [255,0,255],
  43594. maroon: [128,0,0],
  43595. mediumaquamarine: [102,205,170],
  43596. mediumblue: [0,0,205],
  43597. mediumorchid: [186,85,211],
  43598. mediumpurple: [147,112,219],
  43599. mediumseagreen: [60,179,113],
  43600. mediumslateblue: [123,104,238],
  43601. mediumspringgreen: [0,250,154],
  43602. mediumturquoise: [72,209,204],
  43603. mediumvioletred: [199,21,133],
  43604. midnightblue: [25,25,112],
  43605. mintcream: [245,255,250],
  43606. mistyrose: [255,228,225],
  43607. moccasin: [255,228,181],
  43608. navajowhite: [255,222,173],
  43609. navy: [0,0,128],
  43610. oldlace: [253,245,230],
  43611. olive: [128,128,0],
  43612. olivedrab: [107,142,35],
  43613. orange: [255,165,0],
  43614. orangered: [255,69,0],
  43615. orchid: [218,112,214],
  43616. palegoldenrod: [238,232,170],
  43617. palegreen: [152,251,152],
  43618. paleturquoise: [175,238,238],
  43619. palevioletred: [219,112,147],
  43620. papayawhip: [255,239,213],
  43621. peachpuff: [255,218,185],
  43622. peru: [205,133,63],
  43623. pink: [255,192,203],
  43624. plum: [221,160,221],
  43625. powderblue: [176,224,230],
  43626. purple: [128,0,128],
  43627. rebeccapurple: [102, 51, 153],
  43628. red: [255,0,0],
  43629. rosybrown: [188,143,143],
  43630. royalblue: [65,105,225],
  43631. saddlebrown: [139,69,19],
  43632. salmon: [250,128,114],
  43633. sandybrown: [244,164,96],
  43634. seagreen: [46,139,87],
  43635. seashell: [255,245,238],
  43636. sienna: [160,82,45],
  43637. silver: [192,192,192],
  43638. skyblue: [135,206,235],
  43639. slateblue: [106,90,205],
  43640. slategray: [112,128,144],
  43641. slategrey: [112,128,144],
  43642. snow: [255,250,250],
  43643. springgreen: [0,255,127],
  43644. steelblue: [70,130,180],
  43645. tan: [210,180,140],
  43646. teal: [0,128,128],
  43647. thistle: [216,191,216],
  43648. tomato: [255,99,71],
  43649. turquoise: [64,224,208],
  43650. violet: [238,130,238],
  43651. wheat: [245,222,179],
  43652. white: [255,255,255],
  43653. whitesmoke: [245,245,245],
  43654. yellow: [255,255,0],
  43655. yellowgreen: [154,205,50]
  43656. };
  43657. var reverseKeywords = {};
  43658. for (var key in cssKeywords) {
  43659. reverseKeywords[JSON.stringify(cssKeywords[key])] = key;
  43660. }
  43661. /***/ }),
  43662. /* 171 */
  43663. /***/ (function(module, exports, __webpack_require__) {
  43664. var conversions = __webpack_require__(170);
  43665. var convert = function() {
  43666. return new Converter();
  43667. }
  43668. for (var func in conversions) {
  43669. // export Raw versions
  43670. convert[func + "Raw"] = (function(func) {
  43671. // accept array or plain args
  43672. return function(arg) {
  43673. if (typeof arg == "number")
  43674. arg = Array.prototype.slice.call(arguments);
  43675. return conversions[func](arg);
  43676. }
  43677. })(func);
  43678. var pair = /(\w+)2(\w+)/.exec(func),
  43679. from = pair[1],
  43680. to = pair[2];
  43681. // export rgb2hsl and ["rgb"]["hsl"]
  43682. convert[from] = convert[from] || {};
  43683. convert[from][to] = convert[func] = (function(func) {
  43684. return function(arg) {
  43685. if (typeof arg == "number")
  43686. arg = Array.prototype.slice.call(arguments);
  43687. var val = conversions[func](arg);
  43688. if (typeof val == "string" || val === undefined)
  43689. return val; // keyword
  43690. for (var i = 0; i < val.length; i++)
  43691. val[i] = Math.round(val[i]);
  43692. return val;
  43693. }
  43694. })(func);
  43695. }
  43696. /* Converter does lazy conversion and caching */
  43697. var Converter = function() {
  43698. this.convs = {};
  43699. };
  43700. /* Either get the values for a space or
  43701. set the values for a space, depending on args */
  43702. Converter.prototype.routeSpace = function(space, args) {
  43703. var values = args[0];
  43704. if (values === undefined) {
  43705. // color.rgb()
  43706. return this.getValues(space);
  43707. }
  43708. // color.rgb(10, 10, 10)
  43709. if (typeof values == "number") {
  43710. values = Array.prototype.slice.call(args);
  43711. }
  43712. return this.setValues(space, values);
  43713. };
  43714. /* Set the values for a space, invalidating cache */
  43715. Converter.prototype.setValues = function(space, values) {
  43716. this.space = space;
  43717. this.convs = {};
  43718. this.convs[space] = values;
  43719. return this;
  43720. };
  43721. /* Get the values for a space. If there's already
  43722. a conversion for the space, fetch it, otherwise
  43723. compute it */
  43724. Converter.prototype.getValues = function(space) {
  43725. var vals = this.convs[space];
  43726. if (!vals) {
  43727. var fspace = this.space,
  43728. from = this.convs[fspace];
  43729. vals = convert[fspace][space](from);
  43730. this.convs[space] = vals;
  43731. }
  43732. return vals;
  43733. };
  43734. ["rgb", "hsl", "hsv", "cmyk", "keyword"].forEach(function(space) {
  43735. Converter.prototype[space] = function(vals) {
  43736. return this.routeSpace(space, arguments);
  43737. }
  43738. });
  43739. module.exports = convert;
  43740. /***/ }),
  43741. /* 172 */
  43742. /***/ (function(module, exports) {
  43743. module.exports = {
  43744. "aliceblue": [240, 248, 255],
  43745. "antiquewhite": [250, 235, 215],
  43746. "aqua": [0, 255, 255],
  43747. "aquamarine": [127, 255, 212],
  43748. "azure": [240, 255, 255],
  43749. "beige": [245, 245, 220],
  43750. "bisque": [255, 228, 196],
  43751. "black": [0, 0, 0],
  43752. "blanchedalmond": [255, 235, 205],
  43753. "blue": [0, 0, 255],
  43754. "blueviolet": [138, 43, 226],
  43755. "brown": [165, 42, 42],
  43756. "burlywood": [222, 184, 135],
  43757. "cadetblue": [95, 158, 160],
  43758. "chartreuse": [127, 255, 0],
  43759. "chocolate": [210, 105, 30],
  43760. "coral": [255, 127, 80],
  43761. "cornflowerblue": [100, 149, 237],
  43762. "cornsilk": [255, 248, 220],
  43763. "crimson": [220, 20, 60],
  43764. "cyan": [0, 255, 255],
  43765. "darkblue": [0, 0, 139],
  43766. "darkcyan": [0, 139, 139],
  43767. "darkgoldenrod": [184, 134, 11],
  43768. "darkgray": [169, 169, 169],
  43769. "darkgreen": [0, 100, 0],
  43770. "darkgrey": [169, 169, 169],
  43771. "darkkhaki": [189, 183, 107],
  43772. "darkmagenta": [139, 0, 139],
  43773. "darkolivegreen": [85, 107, 47],
  43774. "darkorange": [255, 140, 0],
  43775. "darkorchid": [153, 50, 204],
  43776. "darkred": [139, 0, 0],
  43777. "darksalmon": [233, 150, 122],
  43778. "darkseagreen": [143, 188, 143],
  43779. "darkslateblue": [72, 61, 139],
  43780. "darkslategray": [47, 79, 79],
  43781. "darkslategrey": [47, 79, 79],
  43782. "darkturquoise": [0, 206, 209],
  43783. "darkviolet": [148, 0, 211],
  43784. "deeppink": [255, 20, 147],
  43785. "deepskyblue": [0, 191, 255],
  43786. "dimgray": [105, 105, 105],
  43787. "dimgrey": [105, 105, 105],
  43788. "dodgerblue": [30, 144, 255],
  43789. "firebrick": [178, 34, 34],
  43790. "floralwhite": [255, 250, 240],
  43791. "forestgreen": [34, 139, 34],
  43792. "fuchsia": [255, 0, 255],
  43793. "gainsboro": [220, 220, 220],
  43794. "ghostwhite": [248, 248, 255],
  43795. "gold": [255, 215, 0],
  43796. "goldenrod": [218, 165, 32],
  43797. "gray": [128, 128, 128],
  43798. "green": [0, 128, 0],
  43799. "greenyellow": [173, 255, 47],
  43800. "grey": [128, 128, 128],
  43801. "honeydew": [240, 255, 240],
  43802. "hotpink": [255, 105, 180],
  43803. "indianred": [205, 92, 92],
  43804. "indigo": [75, 0, 130],
  43805. "ivory": [255, 255, 240],
  43806. "khaki": [240, 230, 140],
  43807. "lavender": [230, 230, 250],
  43808. "lavenderblush": [255, 240, 245],
  43809. "lawngreen": [124, 252, 0],
  43810. "lemonchiffon": [255, 250, 205],
  43811. "lightblue": [173, 216, 230],
  43812. "lightcoral": [240, 128, 128],
  43813. "lightcyan": [224, 255, 255],
  43814. "lightgoldenrodyellow": [250, 250, 210],
  43815. "lightgray": [211, 211, 211],
  43816. "lightgreen": [144, 238, 144],
  43817. "lightgrey": [211, 211, 211],
  43818. "lightpink": [255, 182, 193],
  43819. "lightsalmon": [255, 160, 122],
  43820. "lightseagreen": [32, 178, 170],
  43821. "lightskyblue": [135, 206, 250],
  43822. "lightslategray": [119, 136, 153],
  43823. "lightslategrey": [119, 136, 153],
  43824. "lightsteelblue": [176, 196, 222],
  43825. "lightyellow": [255, 255, 224],
  43826. "lime": [0, 255, 0],
  43827. "limegreen": [50, 205, 50],
  43828. "linen": [250, 240, 230],
  43829. "magenta": [255, 0, 255],
  43830. "maroon": [128, 0, 0],
  43831. "mediumaquamarine": [102, 205, 170],
  43832. "mediumblue": [0, 0, 205],
  43833. "mediumorchid": [186, 85, 211],
  43834. "mediumpurple": [147, 112, 219],
  43835. "mediumseagreen": [60, 179, 113],
  43836. "mediumslateblue": [123, 104, 238],
  43837. "mediumspringgreen": [0, 250, 154],
  43838. "mediumturquoise": [72, 209, 204],
  43839. "mediumvioletred": [199, 21, 133],
  43840. "midnightblue": [25, 25, 112],
  43841. "mintcream": [245, 255, 250],
  43842. "mistyrose": [255, 228, 225],
  43843. "moccasin": [255, 228, 181],
  43844. "navajowhite": [255, 222, 173],
  43845. "navy": [0, 0, 128],
  43846. "oldlace": [253, 245, 230],
  43847. "olive": [128, 128, 0],
  43848. "olivedrab": [107, 142, 35],
  43849. "orange": [255, 165, 0],
  43850. "orangered": [255, 69, 0],
  43851. "orchid": [218, 112, 214],
  43852. "palegoldenrod": [238, 232, 170],
  43853. "palegreen": [152, 251, 152],
  43854. "paleturquoise": [175, 238, 238],
  43855. "palevioletred": [219, 112, 147],
  43856. "papayawhip": [255, 239, 213],
  43857. "peachpuff": [255, 218, 185],
  43858. "peru": [205, 133, 63],
  43859. "pink": [255, 192, 203],
  43860. "plum": [221, 160, 221],
  43861. "powderblue": [176, 224, 230],
  43862. "purple": [128, 0, 128],
  43863. "rebeccapurple": [102, 51, 153],
  43864. "red": [255, 0, 0],
  43865. "rosybrown": [188, 143, 143],
  43866. "royalblue": [65, 105, 225],
  43867. "saddlebrown": [139, 69, 19],
  43868. "salmon": [250, 128, 114],
  43869. "sandybrown": [244, 164, 96],
  43870. "seagreen": [46, 139, 87],
  43871. "seashell": [255, 245, 238],
  43872. "sienna": [160, 82, 45],
  43873. "silver": [192, 192, 192],
  43874. "skyblue": [135, 206, 235],
  43875. "slateblue": [106, 90, 205],
  43876. "slategray": [112, 128, 144],
  43877. "slategrey": [112, 128, 144],
  43878. "snow": [255, 250, 250],
  43879. "springgreen": [0, 255, 127],
  43880. "steelblue": [70, 130, 180],
  43881. "tan": [210, 180, 140],
  43882. "teal": [0, 128, 128],
  43883. "thistle": [216, 191, 216],
  43884. "tomato": [255, 99, 71],
  43885. "turquoise": [64, 224, 208],
  43886. "violet": [238, 130, 238],
  43887. "wheat": [245, 222, 179],
  43888. "white": [255, 255, 255],
  43889. "whitesmoke": [245, 245, 245],
  43890. "yellow": [255, 255, 0],
  43891. "yellowgreen": [154, 205, 50]
  43892. };
  43893. /***/ }),
  43894. /* 173 */
  43895. /***/ (function(module, exports, __webpack_require__) {
  43896. exports = module.exports = __webpack_require__(112)();
  43897. // imports
  43898. // module
  43899. exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", ""]);
  43900. // exports
  43901. /***/ }),
  43902. /* 174 */
  43903. /***/ (function(module, exports, __webpack_require__) {
  43904. exports = module.exports = __webpack_require__(112)();
  43905. // imports
  43906. // module
  43907. exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", ""]);
  43908. // exports
  43909. /***/ }),
  43910. /* 175 */
  43911. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43912. "use strict";
  43913. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  43914. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(2);
  43915. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
  43916. //
  43917. //
  43918. //
  43919. //
  43920. //
  43921. //
  43922. //
  43923. //
  43924. //
  43925. //
  43926. //
  43927. //
  43928. //
  43929. //
  43930. //
  43931. //
  43932. //
  43933. //
  43934. //
  43935. //
  43936. //
  43937. //
  43938. //
  43939. //
  43940. //
  43941. //
  43942. //
  43943. //
  43944. //
  43945. //
  43946. /* harmony default export */ __webpack_exports__["default"] = {
  43947. data: function () {
  43948. return {
  43949. options: {
  43950. updateInterval: null,
  43951. port: null,
  43952. updateState: null
  43953. }
  43954. }
  43955. },
  43956. created: function () {
  43957. var config = new XMLHttpRequest();
  43958. var form = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this.$el);
  43959. var self = this;
  43960. config.open('GET', '/api/config');
  43961. config.onreadystatechange = function () {
  43962. if (config.readyState == XMLHttpRequest.DONE &&
  43963. config.status === 200) {
  43964. self.options = JSON.parse(config.response);
  43965. }
  43966. };
  43967. config.send(form.serialize());
  43968. },
  43969. methods: {
  43970. send(){
  43971. var self = this;
  43972. var config = new XMLHttpRequest();
  43973. config.open('POST', '/api/config');
  43974. config.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  43975. config.onreadystatechange = function () {
  43976. if (config.readyState == XMLHttpRequest.DONE &&
  43977. config.status === 200) {
  43978. // self.$router.push("/");
  43979. console.log(JSON.parse(config.response));
  43980. }
  43981. };
  43982. config.send(__WEBPACK_IMPORTED_MODULE_0_jquery___default.a.param(self.options));
  43983. }
  43984. }
  43985. };
  43986. /***/ }),
  43987. /* 176 */
  43988. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43989. "use strict";
  43990. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  43991. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sweetalert2__ = __webpack_require__(3);
  43992. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_sweetalert2__);
  43993. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery__ = __webpack_require__(2);
  43994. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_jquery__);
  43995. //
  43996. //
  43997. //
  43998. //
  43999. //
  44000. //
  44001. //
  44002. //
  44003. //
  44004. //
  44005. //
  44006. //
  44007. //
  44008. //
  44009. //
  44010. //
  44011. //
  44012. //
  44013. //
  44014. //
  44015. //
  44016. //
  44017. /* harmony default export */ __webpack_exports__["default"] = {
  44018. props: {
  44019. server: {
  44020. type: Object,
  44021. default:function () {
  44022. return {
  44023. id:0,
  44024. name: "Name",
  44025. address: "Address",
  44026. players: 0,
  44027. maxPlayers: 0,
  44028. isPassword: false
  44029. };
  44030. }
  44031. },
  44032. update: {
  44033. type: Function
  44034. }
  44035. },
  44036. data: function () {
  44037. return {};
  44038. },
  44039. methods: {
  44040. remove: function (id) {
  44041. var self = this;
  44042. __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default()({
  44043. title: 'Are you sure?',
  44044. text: "You won't be able to revert this!",
  44045. type: 'warning',
  44046. showCancelButton: true,
  44047. confirmButtonColor: '#3085d6',
  44048. cancelButtonColor: '#d33',
  44049. confirmButtonText: 'Yes, delete it!'
  44050. }).then(function () {
  44051. var req = new XMLHttpRequest();
  44052. req.open('GET', '/api/servers/remove/'+ id);
  44053. req.send(null);
  44054. req.onreadystatechange = function () {
  44055. if (req.readyState == XMLHttpRequest.DONE &&
  44056. req.status === 200) {
  44057. self.update();
  44058. var el = __WEBPACK_IMPORTED_MODULE_1_jquery___default()(self.$el);
  44059. el.css("opacity", 0.5);
  44060. var actions = el.find("#actions");
  44061. actions.children().hide();
  44062. actions.append('<img src="svg/loading.svg"></img>');
  44063. }
  44064. };
  44065. }, function () {
  44066. }).catch(console.log);
  44067. }
  44068. }
  44069. };
  44070. /***/ }),
  44071. /* 177 */
  44072. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44073. "use strict";
  44074. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  44075. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sweetalert2__ = __webpack_require__(3);
  44076. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_sweetalert2__);
  44077. //
  44078. //
  44079. //
  44080. //
  44081. //
  44082. //
  44083. //
  44084. //
  44085. //
  44086. //
  44087. //
  44088. //
  44089. //
  44090. //
  44091. //
  44092. //
  44093. //
  44094. //
  44095. //
  44096. //
  44097. //
  44098. //
  44099. //
  44100. //
  44101. //
  44102. //
  44103. //
  44104. //
  44105. //
  44106. //
  44107. //
  44108. //
  44109. //
  44110. //
  44111. //
  44112. //
  44113. //
  44114. //
  44115. //
  44116. /* harmony default export */ __webpack_exports__["default"] = {
  44117. created: function () {
  44118. this.update();
  44119. },
  44120. data: function () {
  44121. return {
  44122. details: {
  44123. traffic: {
  44124. }
  44125. },
  44126. server: {}
  44127. }
  44128. },
  44129. watch: {
  44130. "$root.servers": function () {
  44131. this.server = this.$root.servers[parseInt(this.$root.serversId[this.$route.params.id])];
  44132. }
  44133. },
  44134. methods: {
  44135. update: function () {
  44136. if(this.$root.servers.length !== 0 && this.$root.serversId){
  44137. this.server = this.$root.servers[parseInt(this.$root.serversId[this.$route.params.id])];
  44138. }
  44139. var self = this;
  44140. var req = new XMLHttpRequest();
  44141. req.open('GET', '/api/servers/get/'+this.$route.params.id);
  44142. req.send(null);
  44143. req.onreadystatechange = function () {
  44144. if (req.readyState == XMLHttpRequest.DONE &&
  44145. req.status === 200) {
  44146. self.details = JSON.parse(req.response);
  44147. }
  44148. };
  44149. },
  44150. remove: function (id) {
  44151. var self = this;
  44152. __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default()({
  44153. title: 'Are you sure?',
  44154. text: "You won't be able to revert this!",
  44155. type: 'warning',
  44156. showCancelButton: true,
  44157. confirmButtonColor: '#3085d6',
  44158. cancelButtonColor: '#d33',
  44159. confirmButtonText: 'Yes, delete it!'
  44160. }).then(function () {
  44161. var req = new XMLHttpRequest();
  44162. req.open('GET', '/api/servers/remove/'+ id);
  44163. req.send(null);
  44164. req.onreadystatechange = function () {
  44165. if (req.readyState == XMLHttpRequest.DONE &&
  44166. req.status === 200) {
  44167. }
  44168. };
  44169. self.$router.push("/");
  44170. }, function () {
  44171. }).catch(console.log);
  44172. }
  44173. }
  44174. };
  44175. /***/ }),
  44176. /* 178 */
  44177. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44178. "use strict";
  44179. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  44180. //
  44181. //
  44182. //
  44183. //
  44184. //
  44185. //
  44186. //
  44187. //
  44188. //
  44189. //
  44190. //
  44191. //
  44192. //
  44193. //
  44194. //
  44195. //
  44196. //
  44197. //
  44198. //
  44199. //
  44200. //
  44201. /* harmony default export */ __webpack_exports__["default"] = {
  44202. created: function () {
  44203. this.servers = this.$root.servers;
  44204. this.update();
  44205. },
  44206. watch: {
  44207. "$root.servers": function (val, old) {
  44208. this.servers = val;
  44209. }
  44210. },
  44211. data: function () {
  44212. return {
  44213. servers: [],
  44214. serversId: {}
  44215. }
  44216. },
  44217. methods: {
  44218. update: function () {
  44219. var self = this;
  44220. var req = new XMLHttpRequest();
  44221. req.open('GET', '/api/details');
  44222. req.send(null);
  44223. req.onreadystatechange = function () {
  44224. if (req.readyState == XMLHttpRequest.DONE &&
  44225. req.status === 200) {
  44226. self.servers = JSON.parse(req.response);
  44227. var a;
  44228. self.$root.servers = self.servers;
  44229. self.$root.serversId = {};
  44230. for (a in self.servers) {
  44231. if (!self.servers.hasOwnProperty(a)) {
  44232. continue;
  44233. }
  44234. var obj = self.servers[a];
  44235. self.$root.serversId[obj.id] = a;
  44236. }
  44237. }
  44238. };
  44239. }
  44240. }
  44241. };
  44242. /***/ }),
  44243. /* 179 */
  44244. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44245. "use strict";
  44246. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  44247. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sweetalert2__ = __webpack_require__(3);
  44248. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_sweetalert2__);
  44249. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery__ = __webpack_require__(2);
  44250. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_jquery__);
  44251. //
  44252. //
  44253. //
  44254. //
  44255. //
  44256. //
  44257. //
  44258. //
  44259. //
  44260. //
  44261. //
  44262. //
  44263. //
  44264. //
  44265. //
  44266. //
  44267. //
  44268. //
  44269. //
  44270. //
  44271. //
  44272. //
  44273. //
  44274. //
  44275. //
  44276. /* harmony default export */ __webpack_exports__["default"] = {
  44277. mounted: function () {
  44278. this.request();
  44279. },
  44280. props: {
  44281. server: {
  44282. type: Object,
  44283. default:function () {
  44284. return {
  44285. id:0,
  44286. name: "Name",
  44287. address: "Address",
  44288. players: 0,
  44289. maxPlayers: 0,
  44290. isPassword: false
  44291. };
  44292. }
  44293. },
  44294. update: {
  44295. type: Function
  44296. },
  44297. onSubmit: {
  44298. type: Function,
  44299. default: function () {
  44300. }
  44301. },
  44302. buttonText: {
  44303. type: String,
  44304. default: function () {
  44305. return "Add";
  44306. }
  44307. }
  44308. },
  44309. data: function () {
  44310. return {};
  44311. },
  44312. methods: {
  44313. request: function () {
  44314. var self = this;
  44315. var form = __WEBPACK_IMPORTED_MODULE_1_jquery___default()(this.$el);
  44316. form.submit(function(e){
  44317. e.preventDefault();
  44318. // Validation
  44319. var ar = form.serializeArray();
  44320. var flags = {
  44321. name: 0,
  44322. type: 0,
  44323. address: 0
  44324. }
  44325. ar.forEach(function (obj) {
  44326. if(!obj.value){
  44327. flags[obj.name] = 1;
  44328. }
  44329. });
  44330. var wrong = false;
  44331. for (var name in flags) {
  44332. var el = __WEBPACK_IMPORTED_MODULE_1_jquery___default()('[name="'+name+'"]')
  44333. if (!flags.hasOwnProperty(name)) {
  44334. continue;
  44335. }
  44336. if(flags[name]){
  44337. wrong = true;
  44338. el.addClass("form-control-danger");
  44339. el.parent().addClass("has-danger");
  44340. }else{
  44341. el.removeClass("form-control-danger");
  44342. el.parent().removeClass("has-danger")
  44343. }
  44344. }
  44345. if(wrong){
  44346. __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default()({
  44347. titleText: "Wrong input",
  44348. text:"Provide all data about server",
  44349. type:"error"
  44350. });
  44351. return;
  44352. }
  44353. // Request
  44354. var req_add = new XMLHttpRequest();
  44355. req_add.open('POST', '/api/servers/add');
  44356. req_add.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  44357. req_add.onreadystatechange = function () {
  44358. if (req_add.readyState == XMLHttpRequest.DONE &&
  44359. req_add.status === 200) {
  44360. self.$router.push("/");
  44361. form.find("input, select").val("");
  44362. self.onSubmit();
  44363. }
  44364. };
  44365. req_add.send(form.serialize());
  44366. });
  44367. }
  44368. }
  44369. };
  44370. /***/ }),
  44371. /* 180 */
  44372. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44373. "use strict";
  44374. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  44375. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_chart_js__ = __webpack_require__(126);
  44376. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_chart_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_chart_js__);
  44377. //
  44378. //
  44379. //
  44380. var generateTemplate = function(){
  44381. var rand = function(){
  44382. return Math.floor(Math.random()*256);
  44383. }
  44384. var color = "rgba("+rand()+","+rand()+","+rand()+",0.1)";
  44385. // console.log(color);
  44386. return {
  44387. label: "Traffic",
  44388. fill: true,
  44389. lineTension: 0.1,
  44390. backgroundColor: "rgba(75,192,192,0.4)",
  44391. borderColor: color,
  44392. borderCapStyle: 'butt',
  44393. borderDash: [],
  44394. borderDashOffset: 0.0,
  44395. borderJoinStyle: 'miter',
  44396. pointBorderColor: color, //"rgba(75,192,192,1)",
  44397. pointBackgroundColor: "#fff",
  44398. // pointBorderWidth: 1,
  44399. // pointHoverRadius: 5,
  44400. // pointHoverBackgroundColor: "rgba(75,192,192,1)",
  44401. // pointHoverBorderColor: "rgba(220,220,220,1)",
  44402. // pointHoverBorderWidth: 2,
  44403. pointRadius: 1,
  44404. pointHitRadius: 10,
  44405. data: [],
  44406. spanGaps: true,
  44407. };
  44408. };
  44409. /* harmony default export */ __webpack_exports__["default"] = {
  44410. created: function () {
  44411. this.updateData();
  44412. },
  44413. mounted: function () {
  44414. //this.update();
  44415. },
  44416. props: {
  44417. server: {
  44418. type: Number,
  44419. default:-1
  44420. },
  44421. maxplayers: {
  44422. type: Number,
  44423. default:-1
  44424. }
  44425. },
  44426. data: function () {
  44427. return {
  44428. // datasetTempalte:{
  44429. // label: "Traffic",
  44430. // fill: true,
  44431. // // lineTension: 0.1,
  44432. // // backgroundColor: "rgba(75,192,192,0.4)",
  44433. // // borderColor: "rgba(75,192,192,1)",
  44434. // // borderCapStyle: 'butt',
  44435. // // borderDash: [],
  44436. // // borderDashOffset: 0.0,
  44437. // // borderJoinStyle: 'miter',
  44438. // // pointBorderColor: "rgba(75,192,192,1)",
  44439. // // pointBackgroundColor: "#fff",
  44440. // // pointBorderWidth: 1,
  44441. // // pointHoverRadius: 5,
  44442. // // pointHoverBackgroundColor: "rgba(75,192,192,1)",
  44443. // // pointHoverBorderColor: "rgba(220,220,220,1)",
  44444. // // pointHoverBorderWidth: 2,
  44445. // // pointRadius: 1,
  44446. // // pointHitRadius: 10,
  44447. // data: [],
  44448. // // spanGaps: false,
  44449. // },
  44450. }
  44451. },
  44452. methods: {
  44453. update: function () {
  44454. this.params = {
  44455. type: 'line',
  44456. data: this.graphdata,
  44457. options: {
  44458. responsive: true,
  44459. legend:{
  44460. display: false
  44461. },
  44462. scales: {
  44463. yAxes: [{
  44464. ticks: {
  44465. beginAtZero:true
  44466. }
  44467. }],
  44468. xAxes: [{
  44469. display: true,
  44470. type: 'linear',
  44471. position: 'bottom'
  44472. }]
  44473. }
  44474. }
  44475. };
  44476. if(this.maxplayers > 0){
  44477. this.params.options.scales.yAxes[0].ticks.max = parseInt(this.maxplayers);
  44478. }else if(this.$root.servers[parseInt(this.$root.serversId[this.$route.params.id])].maxPlayers){
  44479. this.params.options.scales.yAxes[0].ticks.max = this.$root.servers[parseInt(this.$root.serversId[this.$route.params.id])].maxPlayers;
  44480. }
  44481. // console.log(this.$root.servers[parseInt(this.$root.serversId[this.$route.params.id])]);
  44482. // console.log(this.$root);
  44483. // console.log("Params ", this.params);
  44484. // console.log(JSON.stringify(this.params));
  44485. this.chart = new __WEBPACK_IMPORTED_MODULE_0_chart_js___default.a(this.$el, this.params);
  44486. },
  44487. updateData: function () {
  44488. this.graphdata = {
  44489. labels: [],
  44490. datasets: [
  44491. {
  44492. label: "Traffic",
  44493. data: null
  44494. }
  44495. ]
  44496. };
  44497. if(this.server === -1){
  44498. return -1;
  44499. }
  44500. var self = this;
  44501. var req = new XMLHttpRequest();
  44502. var date = new Date();
  44503. var year = date.getUTCFullYear();
  44504. var month = date.getUTCMonth() + 1;
  44505. var day = date.getUTCDate();
  44506. var url = '/api/trafic/';
  44507. url += this.server;
  44508. url += "/";
  44509. url += day;
  44510. url += "/";
  44511. url += month;
  44512. url += "/";
  44513. url += year;
  44514. url += "/day";
  44515. // console.log(url);
  44516. req.open('GET', url);
  44517. req.onreadystatechange = function () {
  44518. if (req.readyState == XMLHttpRequest.DONE &&
  44519. req.status === 200) {
  44520. var obj = JSON.parse(req.response);
  44521. if(obj.length <= 0){
  44522. return -1;
  44523. }
  44524. self.graphdata.datasets[0].data = [];
  44525. self.graphdata.datasets = [];
  44526. var firstStamp = new Date(obj[0].createdAt);
  44527. var dataset = {
  44528. label: "Traffic",
  44529. data: []
  44530. };
  44531. // console.log(dataset);
  44532. dataset = Object.assign({}, generateTemplate(), dataset)
  44533. var lastStamp = firstStamp/1000;
  44534. var gap = firstStamp/1000 - new Date(obj[1].createdAt)/1000;
  44535. gap = Math.abs(Math.floor(gap));
  44536. obj.forEach(function (el) {
  44537. var stamp = new Date(el.createdAt) - firstStamp;
  44538. stamp /= 1000;
  44539. // console.log("Gap: ", gap);
  44540. // console.log("Stamp: ", stamp);
  44541. // console.log("lastStamp: ", lastStamp);
  44542. // console.log(stamp-lastStamp);
  44543. if(stamp-lastStamp > 2*gap){
  44544. // console.log("Dataset ", dataset);
  44545. self.graphdata.datasets.push(dataset);
  44546. dataset = {
  44547. label: "Traffic",
  44548. data: []
  44549. };
  44550. dataset = Object.assign({}, generateTemplate(), dataset)
  44551. }
  44552. lastStamp = stamp;
  44553. stamp /= 60;
  44554. stamp = Math.floor(stamp);
  44555. dataset.data.push({
  44556. x: stamp,
  44557. y: el.players
  44558. });
  44559. // self.graphdata.datasets[0].data.push({
  44560. // x: stamp,
  44561. // y: el.players
  44562. // });
  44563. self.graphdata.labels.push(new Date(el.createdAt).toLocaleTimeString());
  44564. });
  44565. // console.log("Dataset ", dataset);
  44566. // self.graphdata.datasets.push(dataset);
  44567. self.graphdata.datasets.push(dataset);
  44568. self.graphdata = JSON.parse(JSON.stringify(self.graphdata));
  44569. // console.log("Graphdata ", self.graphdata);
  44570. self.update();
  44571. }
  44572. };
  44573. req.send(null);
  44574. }
  44575. }
  44576. };
  44577. /***/ }),
  44578. /* 181 */
  44579. /***/ (function(module, exports, __webpack_require__) {
  44580. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44581. return _c('form', [_c('div', {
  44582. staticClass: "container",
  44583. attrs: {
  44584. "id": "config"
  44585. }
  44586. }, [_c('div', {
  44587. staticClass: "form-group row"
  44588. }, [_c('label', {
  44589. staticClass: "col-2 col-form-label"
  44590. }, [_vm._v("Update Interval")]), _vm._v(" "), _c('div', {
  44591. staticClass: "col-10"
  44592. }, [_c('input', {
  44593. directives: [{
  44594. name: "model",
  44595. rawName: "v-model",
  44596. value: (_vm.options.updateInterval),
  44597. expression: "options.updateInterval"
  44598. }],
  44599. staticClass: "form-control",
  44600. attrs: {
  44601. "type": "Number"
  44602. },
  44603. domProps: {
  44604. "value": _vm._s(_vm.options.updateInterval)
  44605. },
  44606. on: {
  44607. "input": function($event) {
  44608. if ($event.target.composing) { return; }
  44609. _vm.options.updateInterval = $event.target.value
  44610. }
  44611. }
  44612. })])]), _vm._v(" "), _c('div', {
  44613. staticClass: "form-group row"
  44614. }, [_c('label', {
  44615. staticClass: "col-2 col-form-label"
  44616. }, [_vm._v("Port")]), _vm._v(" "), _c('div', {
  44617. staticClass: "col-10"
  44618. }, [_c('input', {
  44619. directives: [{
  44620. name: "model",
  44621. rawName: "v-model",
  44622. value: (_vm.options.port),
  44623. expression: "options.port"
  44624. }],
  44625. staticClass: "form-control",
  44626. attrs: {
  44627. "type": "number"
  44628. },
  44629. domProps: {
  44630. "value": _vm._s(_vm.options.port)
  44631. },
  44632. on: {
  44633. "input": function($event) {
  44634. if ($event.target.composing) { return; }
  44635. _vm.options.port = _vm._n($event.target.value)
  44636. },
  44637. "blur": function($event) {
  44638. _vm.$forceUpdate()
  44639. }
  44640. }
  44641. })])]), _vm._v(" "), _c('div', {
  44642. staticClass: "form-group row"
  44643. }, [_c('label', {
  44644. staticClass: "col-2 col-form-label"
  44645. }, [_vm._v("Start data collector on start?")]), _vm._v(" "), _c('div', {
  44646. staticClass: "col-10"
  44647. }, [_c('select', {
  44648. directives: [{
  44649. name: "model",
  44650. rawName: "v-model",
  44651. value: (_vm.options.updateState),
  44652. expression: "options.updateState"
  44653. }],
  44654. staticClass: "form-control",
  44655. on: {
  44656. "change": function($event) {
  44657. _vm.options.updateState = Array.prototype.filter.call($event.target.options, function(o) {
  44658. return o.selected
  44659. }).map(function(o) {
  44660. var val = "_value" in o ? o._value : o.value;
  44661. return val
  44662. })[0]
  44663. }
  44664. }
  44665. }, [_c('option', {
  44666. attrs: {
  44667. "value": "true"
  44668. }
  44669. }, [_vm._v("Yes")]), _vm._v(" "), _c('option', {
  44670. attrs: {
  44671. "value": "false"
  44672. }
  44673. }, [_vm._v("No")])])])]), _vm._v(" "), _c('div', {
  44674. staticClass: "row"
  44675. }, [_c('button', {
  44676. staticClass: "btn btn-primary",
  44677. on: {
  44678. "click": _vm.send
  44679. }
  44680. }, [_vm._v("Save")])])])])
  44681. },staticRenderFns: []}
  44682. module.exports.render._withStripped = true
  44683. if (false) {
  44684. module.hot.accept()
  44685. if (module.hot.data) {
  44686. require("vue-hot-reload-api").rerender("data-v-32332a9d", module.exports)
  44687. }
  44688. }
  44689. /***/ }),
  44690. /* 182 */
  44691. /***/ (function(module, exports, __webpack_require__) {
  44692. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44693. return _c('div', {
  44694. staticClass: "container no-gutters"
  44695. }, [_c('div', {
  44696. staticClass: "row"
  44697. }, [_c('h1', [_vm._v(_vm._s(_vm.server.name) + " "), _c('small', {
  44698. staticClass: "text-muted"
  44699. }, [_vm._v(_vm._s(_vm.details.name))])])]), _vm._v(" "), _c('div', {
  44700. staticClass: "row"
  44701. }, [_c('div', {
  44702. staticClass: "col-5"
  44703. }, [_c('ul', {
  44704. staticClass: "list-unstyled"
  44705. }, [(_vm.server && _vm.server.address !== undefined) ? _c('li', [_vm._v("\n Address: " + _vm._s(_vm.server.address) + "\n ")]) : _vm._e(), _vm._v(" "), (_vm.details && _vm.details.map !== undefined) ? _c('li', [_vm._v("\n Map: " + _vm._s(_vm.details.map) + "\n ")]) : _vm._e(), _vm._v(" "), (_vm.details && _vm.details.password !== undefined) ? _c('li', [_vm._v("\n Password: " + _vm._s(_vm.details.password ? "true" : "false") + "\n ")]) : _vm._e(), _vm._v(" "), (_vm.details && _vm.details.traffic !== undefined) ? _c('li', [_vm._v("\n Actual: " + _vm._s(_vm.details.traffic.players) + "/" + _vm._s(_vm.details.traffic.maxplayers) + "\n ")]) : _vm._e()])]), _vm._v(" "), _c('div', {
  44706. staticClass: "col-5"
  44707. }, [(_vm.details.players !== undefined && _vm.details.traffic) ? _c('div', [_vm._v("\n Players:"), _c('span', [_vm._v(_vm._s(_vm.details.players.length) + "/" + _vm._s(_vm.details.traffic.maxplayers))])]) : _vm._e(), _vm._v(" "), (_vm.details.players !== undefined) ? _c('ul', {
  44708. staticClass: "list-group"
  44709. }, _vm._l((_vm.details.players), function(player) {
  44710. return _c('li', {
  44711. staticClass: "list-group-item"
  44712. }, [_vm._v(_vm._s(player.name))])
  44713. })) : _vm._e()]), _vm._v(" "), _c('div', {
  44714. staticClass: "col-2"
  44715. }, [_c('button', {
  44716. staticClass: "btn btn-danger",
  44717. attrs: {
  44718. "type": "button"
  44719. },
  44720. on: {
  44721. "click": function($event) {
  44722. _vm.remove(_vm.$route.params.id)
  44723. }
  44724. }
  44725. }, [_vm._v("Remove")])])]), _vm._v(" "), _c('div', {
  44726. staticClass: "row"
  44727. }, [_c('servergraph', {
  44728. attrs: {
  44729. "server": parseInt(_vm.$route.params.id),
  44730. "maxplayers": _vm.server.maxPlayers
  44731. }
  44732. })], 1)])
  44733. },staticRenderFns: []}
  44734. module.exports.render._withStripped = true
  44735. if (false) {
  44736. module.hot.accept()
  44737. if (module.hot.data) {
  44738. require("vue-hot-reload-api").rerender("data-v-4fd03d74", module.exports)
  44739. }
  44740. }
  44741. /***/ }),
  44742. /* 183 */
  44743. /***/ (function(module, exports, __webpack_require__) {
  44744. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44745. return _c('canvas', {
  44746. attrs: {
  44747. "id": "graph"
  44748. }
  44749. })
  44750. },staticRenderFns: []}
  44751. module.exports.render._withStripped = true
  44752. if (false) {
  44753. module.hot.accept()
  44754. if (module.hot.data) {
  44755. require("vue-hot-reload-api").rerender("data-v-73392520", module.exports)
  44756. }
  44757. }
  44758. /***/ }),
  44759. /* 184 */
  44760. /***/ (function(module, exports, __webpack_require__) {
  44761. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44762. return _c('div', {
  44763. staticClass: "container no-gutters",
  44764. attrs: {
  44765. "id": "serverList"
  44766. }
  44767. }, [_vm._m(0), _vm._v(" "), _vm._l((_vm.servers), function(server) {
  44768. return _c('server', {
  44769. attrs: {
  44770. "server": server,
  44771. "update": _vm.update
  44772. }
  44773. })
  44774. }), _vm._v(" "), _c('serveredit', {
  44775. attrs: {
  44776. "update": _vm.update,
  44777. "onSubmit": _vm.update
  44778. }
  44779. })], 2)
  44780. },staticRenderFns: [function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44781. return _c('div', {
  44782. staticClass: "row",
  44783. attrs: {
  44784. "id": "titles"
  44785. }
  44786. }, [_c('div', {
  44787. staticClass: "col-4"
  44788. }, [_vm._v("\n Server name\n ")]), _vm._v(" "), _c('div', {
  44789. staticClass: "col-3"
  44790. }, [_vm._v("\n Server Type\n ")]), _vm._v(" "), _c('div', {
  44791. staticClass: "col-3"
  44792. }, [_vm._v("\n Address\n ")]), _vm._v(" "), _c('div', {
  44793. staticClass: "col-2"
  44794. }, [_vm._v("\n Players\n ")])])
  44795. }]}
  44796. module.exports.render._withStripped = true
  44797. if (false) {
  44798. module.hot.accept()
  44799. if (module.hot.data) {
  44800. require("vue-hot-reload-api").rerender("data-v-7b0050dc", module.exports)
  44801. }
  44802. }
  44803. /***/ }),
  44804. /* 185 */
  44805. /***/ (function(module, exports, __webpack_require__) {
  44806. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44807. return _c('div', {
  44808. staticClass: "row"
  44809. }, [_c('div', {
  44810. staticClass: "col-4"
  44811. }, [_c('div', {
  44812. attrs: {
  44813. "id": "actions"
  44814. }
  44815. }, [_c('a', {
  44816. on: {
  44817. "click": function($event) {
  44818. _vm.remove(_vm.server.id)
  44819. }
  44820. }
  44821. }, [_c('img', {
  44822. attrs: {
  44823. "src": "svg/x.svg"
  44824. }
  44825. })]), _vm._v(" "), _vm._m(0)]), _vm._v(" "), _c('router-link', {
  44826. attrs: {
  44827. "server": _vm.server,
  44828. "to": {
  44829. path: '/server/' + _vm.server.id
  44830. }
  44831. }
  44832. }, [_vm._v("\n " + _vm._s(_vm.server.name) + " "), _c('img', {
  44833. directives: [{
  44834. name: "show",
  44835. rawName: "v-show",
  44836. value: (_vm.server.isPassword),
  44837. expression: "server.isPassword"
  44838. }],
  44839. staticClass: "icon",
  44840. attrs: {
  44841. "src": "svg/lock.svg"
  44842. }
  44843. })])], 1), _vm._v(" "), _c('div', {
  44844. staticClass: "col-3"
  44845. }, [_vm._v("\n " + _vm._s(_vm.server.fullType) + "\n ")]), _vm._v(" "), _c('div', {
  44846. staticClass: "col-3"
  44847. }, [_vm._v("\n " + _vm._s(_vm.server.address) + "\n ")]), _vm._v(" "), _c('div', {
  44848. staticClass: "col-2"
  44849. }, [_vm._v("\n " + _vm._s(_vm.server.players) + "/" + _vm._s(_vm.server.maxPlayers) + "\n ")])])
  44850. },staticRenderFns: [function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44851. return _c('a', [_c('img', {
  44852. attrs: {
  44853. "src": "svg/pencil.svg"
  44854. }
  44855. })])
  44856. }]}
  44857. module.exports.render._withStripped = true
  44858. if (false) {
  44859. module.hot.accept()
  44860. if (module.hot.data) {
  44861. require("vue-hot-reload-api").rerender("data-v-d86423c4", module.exports)
  44862. }
  44863. }
  44864. /***/ }),
  44865. /* 186 */
  44866. /***/ (function(module, exports, __webpack_require__) {
  44867. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44868. return _c('form', {
  44869. attrs: {
  44870. "action": "/api/servers/add",
  44871. "method": "post"
  44872. }
  44873. }, [_c('div', {
  44874. staticClass: "row editor form-group"
  44875. }, [_vm._m(0), _vm._v(" "), _c('div', {
  44876. staticClass: "col-3"
  44877. }, [_c('select', {
  44878. staticClass: "form-control",
  44879. attrs: {
  44880. "name": "type"
  44881. }
  44882. }, [_c('option', {
  44883. attrs: {
  44884. "value": ""
  44885. }
  44886. }, [_vm._v("Server type")]), _vm._v(" "), _vm._l((_vm.$root.types), function(option, key) {
  44887. return _c('option', {
  44888. domProps: {
  44889. "value": option
  44890. }
  44891. }, [_vm._v("\n " + _vm._s(key) + "\n ")])
  44892. })], 2)]), _vm._v(" "), _vm._m(1), _vm._v(" "), _c('div', {
  44893. staticClass: "col-2"
  44894. }, [_c('button', {
  44895. staticClass: "btn btn-primary",
  44896. attrs: {
  44897. "type": "submit"
  44898. }
  44899. }, [_vm._v(_vm._s(_vm.buttonText))])])])])
  44900. },staticRenderFns: [function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44901. return _c('div', {
  44902. staticClass: "col-4"
  44903. }, [_c('input', {
  44904. staticClass: "form-control",
  44905. attrs: {
  44906. "placeholder": "Name",
  44907. "name": "name"
  44908. }
  44909. })])
  44910. },function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44911. return _c('div', {
  44912. staticClass: "col-3"
  44913. }, [_c('input', {
  44914. staticClass: "form-control",
  44915. attrs: {
  44916. "placeholder": "Address",
  44917. "name": "address"
  44918. }
  44919. })])
  44920. }]}
  44921. module.exports.render._withStripped = true
  44922. if (false) {
  44923. module.hot.accept()
  44924. if (module.hot.data) {
  44925. require("vue-hot-reload-api").rerender("data-v-f323d7b0", module.exports)
  44926. }
  44927. }
  44928. /***/ }),
  44929. /* 187 */
  44930. /***/ (function(module, exports, __webpack_require__) {
  44931. // style-loader: Adds some css to the DOM by adding a <style> tag
  44932. // load the styles
  44933. var content = __webpack_require__(173);
  44934. if(typeof content === 'string') content = [[module.i, content, '']];
  44935. if(content.locals) module.exports = content.locals;
  44936. // add the styles to the DOM
  44937. var update = __webpack_require__(114)("029e6e0d", content, false);
  44938. // Hot Module Replacement
  44939. if(false) {
  44940. // When the styles change, update the <style> tags
  44941. if(!content.locals) {
  44942. module.hot.accept("!!../node_modules/css-loader/index.js!../node_modules/vue-loader/lib/style-rewriter.js?{\"id\":\"data-v-32332a9d\",\"scoped\":false,\"hasInlineConfig\":false}!../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./config.vue", function() {
  44943. var newContent = require("!!../node_modules/css-loader/index.js!../node_modules/vue-loader/lib/style-rewriter.js?{\"id\":\"data-v-32332a9d\",\"scoped\":false,\"hasInlineConfig\":false}!../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./config.vue");
  44944. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  44945. update(newContent);
  44946. });
  44947. }
  44948. // When the module is disposed, remove the <style> tags
  44949. module.hot.dispose(function() { update(); });
  44950. }
  44951. /***/ }),
  44952. /* 188 */
  44953. /***/ (function(module, exports, __webpack_require__) {
  44954. // style-loader: Adds some css to the DOM by adding a <style> tag
  44955. // load the styles
  44956. var content = __webpack_require__(174);
  44957. if(typeof content === 'string') content = [[module.i, content, '']];
  44958. if(content.locals) module.exports = content.locals;
  44959. // add the styles to the DOM
  44960. var update = __webpack_require__(114)("9a02e6fc", content, false);
  44961. // Hot Module Replacement
  44962. if(false) {
  44963. // When the styles change, update the <style> tags
  44964. if(!content.locals) {
  44965. module.hot.accept("!!../node_modules/css-loader/index.js!../node_modules/vue-loader/lib/style-rewriter.js?{\"id\":\"data-v-7b0050dc\",\"scoped\":false,\"hasInlineConfig\":false}!../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./serverList.vue", function() {
  44966. var newContent = require("!!../node_modules/css-loader/index.js!../node_modules/vue-loader/lib/style-rewriter.js?{\"id\":\"data-v-7b0050dc\",\"scoped\":false,\"hasInlineConfig\":false}!../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./serverList.vue");
  44967. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  44968. update(newContent);
  44969. });
  44970. }
  44971. // When the module is disposed, remove the <style> tags
  44972. module.hot.dispose(function() { update(); });
  44973. }
  44974. /***/ }),
  44975. /* 189 */
  44976. /***/ (function(module, exports) {
  44977. /**
  44978. * Translates the list format produced by css-loader into something
  44979. * easier to manipulate.
  44980. */
  44981. module.exports = function listToStyles (parentId, list) {
  44982. var styles = []
  44983. var newStyles = {}
  44984. for (var i = 0; i < list.length; i++) {
  44985. var item = list[i]
  44986. var id = item[0]
  44987. var css = item[1]
  44988. var media = item[2]
  44989. var sourceMap = item[3]
  44990. var part = {
  44991. id: parentId + ':' + i,
  44992. css: css,
  44993. media: media,
  44994. sourceMap: sourceMap
  44995. }
  44996. if (!newStyles[id]) {
  44997. styles.push(newStyles[id] = { id: id, parts: [part] })
  44998. } else {
  44999. newStyles[id].parts.push(part)
  45000. }
  45001. }
  45002. return styles
  45003. }
  45004. /***/ }),
  45005. /* 190 */
  45006. /***/ (function(module, exports) {
  45007. var g;
  45008. // This works in non-strict mode
  45009. g = (function() {
  45010. return this;
  45011. })();
  45012. try {
  45013. // This works if eval is allowed (see CSP)
  45014. g = g || Function("return this")() || (1,eval)("this");
  45015. } catch(e) {
  45016. // This works if the window reference is available
  45017. if(typeof window === "object")
  45018. g = window;
  45019. }
  45020. // g can still be undefined, but nothing to do about it...
  45021. // We return undefined, instead of nothing here, so it's
  45022. // easier to handle this case. if(!global) { ...}
  45023. module.exports = g;
  45024. /***/ }),
  45025. /* 191 */
  45026. /***/ (function(module, exports) {
  45027. module.exports = function(module) {
  45028. if(!module.webpackPolyfill) {
  45029. module.deprecate = function() {};
  45030. module.paths = [];
  45031. // module.parent = undefined by default
  45032. if(!module.children) module.children = [];
  45033. Object.defineProperty(module, "loaded", {
  45034. enumerable: true,
  45035. get: function() {
  45036. return module.l;
  45037. }
  45038. });
  45039. Object.defineProperty(module, "id", {
  45040. enumerable: true,
  45041. get: function() {
  45042. return module.i;
  45043. }
  45044. });
  45045. module.webpackPolyfill = 1;
  45046. }
  45047. return module;
  45048. };
  45049. /***/ }),
  45050. /* 192 */
  45051. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45052. "use strict";
  45053. /* WEBPACK VAR INJECTION */(function($) {Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  45054. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_bootstrap_dist_css_bootstrap_css__ = __webpack_require__(115);
  45055. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_bootstrap_dist_css_bootstrap_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_bootstrap_dist_css_bootstrap_css__);
  45056. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert2_dist_sweetalert2_css__ = __webpack_require__(116);
  45057. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert2_dist_sweetalert2_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert2_dist_sweetalert2_css__);
  45058. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue__ = __webpack_require__(124);
  45059. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_vue__);
  45060. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_vue_router__ = __webpack_require__(123);
  45061. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_vue_router___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_vue_router__);
  45062. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__config_vue__ = __webpack_require__(117);
  45063. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__config_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__config_vue__);
  45064. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__serverList_vue__ = __webpack_require__(120);
  45065. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__serverList_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__serverList_vue__);
  45066. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__serverDetails_vue__ = __webpack_require__(119);
  45067. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__serverDetails_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6__serverDetails_vue__);
  45068. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__server_vue__ = __webpack_require__(118);
  45069. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__server_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7__server_vue__);
  45070. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__serveredit_vue__ = __webpack_require__(121);
  45071. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__serveredit_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8__serveredit_vue__);
  45072. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__servergraph_vue__ = __webpack_require__(122);
  45073. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__servergraph_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9__servergraph_vue__);
  45074. // import $ from "jquery";
  45075. // import "bootstrap/dist/js/bootstrap.js";
  45076. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.use(__WEBPACK_IMPORTED_MODULE_3_vue_router___default.a);
  45077. // Debug mode
  45078. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.config.debug = true;
  45079. // Devtools enabled
  45080. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.config.devtools = true;
  45081. // Silence logs and warnings
  45082. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.config.silent = false;
  45083. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.component('server', __WEBPACK_IMPORTED_MODULE_7__server_vue___default.a);
  45084. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.component('serveredit', __WEBPACK_IMPORTED_MODULE_8__serveredit_vue___default.a);
  45085. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.component('servergraph', __WEBPACK_IMPORTED_MODULE_9__servergraph_vue___default.a);
  45086. var routes = [
  45087. { path: "/", component: __WEBPACK_IMPORTED_MODULE_5__serverList_vue___default.a },
  45088. { path: "/server/:id", component: __WEBPACK_IMPORTED_MODULE_6__serverDetails_vue___default.a },
  45089. { path: "/config", component: __WEBPACK_IMPORTED_MODULE_4__config_vue___default.a }
  45090. ];
  45091. const router = new __WEBPACK_IMPORTED_MODULE_3_vue_router___default.a({
  45092. routes: routes,
  45093. mode: 'history'
  45094. });
  45095. $(function () {
  45096. var app = new __WEBPACK_IMPORTED_MODULE_2_vue___default.a({
  45097. router: router,
  45098. el: "#statsApp",
  45099. data: {
  45100. servers: [],
  45101. serversId: {},
  45102. types: []
  45103. },
  45104. created: function(){
  45105. var self = this;
  45106. var types = new XMLHttpRequest();
  45107. types.open('GET', '/api/types');
  45108. types.send(null);
  45109. types.onreadystatechange = function () {
  45110. if (types.readyState == XMLHttpRequest.DONE &&
  45111. types.status === 200) {
  45112. self.types = JSON.parse(types.response);
  45113. }
  45114. };
  45115. var serverCache = new XMLHttpRequest();
  45116. serverCache.open('GET', '/api/details/cached');
  45117. serverCache.send(null);
  45118. serverCache.onreadystatechange = function () {
  45119. if (serverCache.readyState == XMLHttpRequest.DONE &&
  45120. serverCache.status === 200) {
  45121. self.$root.servers = JSON.parse(serverCache.response);
  45122. self.$root.serversId = {};
  45123. for (var a in self.servers) {
  45124. if (!self.servers.hasOwnProperty(a)) {
  45125. continue;
  45126. }
  45127. var obj = self.servers[a];
  45128. self.$root.serversId[obj.id] = a;
  45129. }
  45130. }
  45131. };
  45132. if(this.$route.path !== "/"){
  45133. var server = new XMLHttpRequest();
  45134. server.open('GET', '/api/details');
  45135. server.send(null);
  45136. server.onreadystatechange = function () {
  45137. if (server.readyState == XMLHttpRequest.DONE &&
  45138. server.status === 200) {
  45139. self.$root.servers = JSON.parse(server.response);
  45140. self.$root.serversId = {};
  45141. for (var a in self.servers) {
  45142. if (!self.servers.hasOwnProperty(a)) {
  45143. continue;
  45144. }
  45145. var obj = self.servers[a];
  45146. self.$root.serversId[obj.id] = a;
  45147. }
  45148. }
  45149. };
  45150. }
  45151. }
  45152. });//.$mount("#statsApp");
  45153. });
  45154. /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(2)))
  45155. /***/ })
  45156. /******/ ]);