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 = 187);
  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__(171)("./" + 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__(186)(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. // shim for using process in browser
  22761. var process = module.exports = {};
  22762. // cached from whatever global is present so that test runners that stub it
  22763. // don't break things. But we need to wrap it in a try catch in case it is
  22764. // wrapped in strict mode code which doesn't define any globals. It's inside a
  22765. // function because try/catches deoptimize in certain engines.
  22766. var cachedSetTimeout;
  22767. var cachedClearTimeout;
  22768. function defaultSetTimout() {
  22769. throw new Error('setTimeout has not been defined');
  22770. }
  22771. function defaultClearTimeout () {
  22772. throw new Error('clearTimeout has not been defined');
  22773. }
  22774. (function () {
  22775. try {
  22776. if (typeof setTimeout === 'function') {
  22777. cachedSetTimeout = setTimeout;
  22778. } else {
  22779. cachedSetTimeout = defaultSetTimout;
  22780. }
  22781. } catch (e) {
  22782. cachedSetTimeout = defaultSetTimout;
  22783. }
  22784. try {
  22785. if (typeof clearTimeout === 'function') {
  22786. cachedClearTimeout = clearTimeout;
  22787. } else {
  22788. cachedClearTimeout = defaultClearTimeout;
  22789. }
  22790. } catch (e) {
  22791. cachedClearTimeout = defaultClearTimeout;
  22792. }
  22793. } ())
  22794. function runTimeout(fun) {
  22795. if (cachedSetTimeout === setTimeout) {
  22796. //normal enviroments in sane situations
  22797. return setTimeout(fun, 0);
  22798. }
  22799. // if setTimeout wasn't available but was latter defined
  22800. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  22801. cachedSetTimeout = setTimeout;
  22802. return setTimeout(fun, 0);
  22803. }
  22804. try {
  22805. // when when somebody has screwed with setTimeout but no I.E. maddness
  22806. return cachedSetTimeout(fun, 0);
  22807. } catch(e){
  22808. try {
  22809. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  22810. return cachedSetTimeout.call(null, fun, 0);
  22811. } catch(e){
  22812. // 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
  22813. return cachedSetTimeout.call(this, fun, 0);
  22814. }
  22815. }
  22816. }
  22817. function runClearTimeout(marker) {
  22818. if (cachedClearTimeout === clearTimeout) {
  22819. //normal enviroments in sane situations
  22820. return clearTimeout(marker);
  22821. }
  22822. // if clearTimeout wasn't available but was latter defined
  22823. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  22824. cachedClearTimeout = clearTimeout;
  22825. return clearTimeout(marker);
  22826. }
  22827. try {
  22828. // when when somebody has screwed with setTimeout but no I.E. maddness
  22829. return cachedClearTimeout(marker);
  22830. } catch (e){
  22831. try {
  22832. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  22833. return cachedClearTimeout.call(null, marker);
  22834. } catch (e){
  22835. // 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.
  22836. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  22837. return cachedClearTimeout.call(this, marker);
  22838. }
  22839. }
  22840. }
  22841. var queue = [];
  22842. var draining = false;
  22843. var currentQueue;
  22844. var queueIndex = -1;
  22845. function cleanUpNextTick() {
  22846. if (!draining || !currentQueue) {
  22847. return;
  22848. }
  22849. draining = false;
  22850. if (currentQueue.length) {
  22851. queue = currentQueue.concat(queue);
  22852. } else {
  22853. queueIndex = -1;
  22854. }
  22855. if (queue.length) {
  22856. drainQueue();
  22857. }
  22858. }
  22859. function drainQueue() {
  22860. if (draining) {
  22861. return;
  22862. }
  22863. var timeout = runTimeout(cleanUpNextTick);
  22864. draining = true;
  22865. var len = queue.length;
  22866. while(len) {
  22867. currentQueue = queue;
  22868. queue = [];
  22869. while (++queueIndex < len) {
  22870. if (currentQueue) {
  22871. currentQueue[queueIndex].run();
  22872. }
  22873. }
  22874. queueIndex = -1;
  22875. len = queue.length;
  22876. }
  22877. currentQueue = null;
  22878. draining = false;
  22879. runClearTimeout(timeout);
  22880. }
  22881. process.nextTick = function (fun) {
  22882. var args = new Array(arguments.length - 1);
  22883. if (arguments.length > 1) {
  22884. for (var i = 1; i < arguments.length; i++) {
  22885. args[i - 1] = arguments[i];
  22886. }
  22887. }
  22888. queue.push(new Item(fun, args));
  22889. if (queue.length === 1 && !draining) {
  22890. runTimeout(drainQueue);
  22891. }
  22892. };
  22893. // v8 likes predictible objects
  22894. function Item(fun, array) {
  22895. this.fun = fun;
  22896. this.array = array;
  22897. }
  22898. Item.prototype.run = function () {
  22899. this.fun.apply(null, this.array);
  22900. };
  22901. process.title = 'browser';
  22902. process.browser = true;
  22903. process.env = {};
  22904. process.argv = [];
  22905. process.version = ''; // empty string to avoid regexp issues
  22906. process.versions = {};
  22907. function noop() {}
  22908. process.on = noop;
  22909. process.addListener = noop;
  22910. process.once = noop;
  22911. process.off = noop;
  22912. process.removeListener = noop;
  22913. process.removeAllListeners = noop;
  22914. process.emit = noop;
  22915. process.binding = function (name) {
  22916. throw new Error('process.binding is not supported');
  22917. };
  22918. process.cwd = function () { return '/' };
  22919. process.chdir = function (dir) {
  22920. throw new Error('process.chdir is not supported');
  22921. };
  22922. process.umask = function() { return 0; };
  22923. /***/ }),
  22924. /* 113 */
  22925. /***/ (function(module, exports) {
  22926. // removed by extract-text-webpack-plugin
  22927. /***/ }),
  22928. /* 114 */
  22929. /***/ (function(module, exports) {
  22930. // removed by extract-text-webpack-plugin
  22931. /***/ }),
  22932. /* 115 */
  22933. /***/ (function(module, exports, __webpack_require__) {
  22934. var Component = __webpack_require__(1)(
  22935. /* script */
  22936. __webpack_require__(172),
  22937. /* template */
  22938. __webpack_require__(178),
  22939. /* scopeId */
  22940. null,
  22941. /* cssModules */
  22942. null
  22943. )
  22944. Component.options.__file = "G:\\Server Stats\\webSource\\server.vue"
  22945. 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.")}
  22946. if (Component.options.functional) {console.error("[vue-loader] server.vue: functional components are not supported with templates, they should use render functions.")}
  22947. /* hot reload */
  22948. if (false) {(function () {
  22949. var hotAPI = require("vue-hot-reload-api")
  22950. hotAPI.install(require("vue"), false)
  22951. if (!hotAPI.compatible) return
  22952. module.hot.accept()
  22953. if (!module.hot.data) {
  22954. hotAPI.createRecord("data-v-49b001dc", Component.options)
  22955. } else {
  22956. hotAPI.reload("data-v-49b001dc", Component.options)
  22957. }
  22958. })()}
  22959. module.exports = Component.exports
  22960. /***/ }),
  22961. /* 116 */
  22962. /***/ (function(module, exports, __webpack_require__) {
  22963. var Component = __webpack_require__(1)(
  22964. /* script */
  22965. __webpack_require__(173),
  22966. /* template */
  22967. __webpack_require__(177),
  22968. /* scopeId */
  22969. null,
  22970. /* cssModules */
  22971. null
  22972. )
  22973. Component.options.__file = "G:\\Server Stats\\webSource\\serverDetails.vue"
  22974. 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.")}
  22975. if (Component.options.functional) {console.error("[vue-loader] serverDetails.vue: functional components are not supported with templates, they should use render functions.")}
  22976. /* hot reload */
  22977. if (false) {(function () {
  22978. var hotAPI = require("vue-hot-reload-api")
  22979. hotAPI.install(require("vue"), false)
  22980. if (!hotAPI.compatible) return
  22981. module.hot.accept()
  22982. if (!module.hot.data) {
  22983. hotAPI.createRecord("data-v-04a2f200", Component.options)
  22984. } else {
  22985. hotAPI.reload("data-v-04a2f200", Component.options)
  22986. }
  22987. })()}
  22988. module.exports = Component.exports
  22989. /***/ }),
  22990. /* 117 */
  22991. /***/ (function(module, exports, __webpack_require__) {
  22992. /* styles */
  22993. __webpack_require__(182)
  22994. var Component = __webpack_require__(1)(
  22995. /* script */
  22996. __webpack_require__(174),
  22997. /* template */
  22998. __webpack_require__(179),
  22999. /* scopeId */
  23000. null,
  23001. /* cssModules */
  23002. null
  23003. )
  23004. Component.options.__file = "G:\\Server Stats\\webSource\\serverList.vue"
  23005. 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.")}
  23006. if (Component.options.functional) {console.error("[vue-loader] serverList.vue: functional components are not supported with templates, they should use render functions.")}
  23007. /* hot reload */
  23008. if (false) {(function () {
  23009. var hotAPI = require("vue-hot-reload-api")
  23010. hotAPI.install(require("vue"), false)
  23011. if (!hotAPI.compatible) return
  23012. module.hot.accept()
  23013. if (!module.hot.data) {
  23014. hotAPI.createRecord("data-v-7440c7d0", Component.options)
  23015. } else {
  23016. hotAPI.reload("data-v-7440c7d0", Component.options)
  23017. }
  23018. })()}
  23019. module.exports = Component.exports
  23020. /***/ }),
  23021. /* 118 */
  23022. /***/ (function(module, exports, __webpack_require__) {
  23023. var Component = __webpack_require__(1)(
  23024. /* script */
  23025. __webpack_require__(175),
  23026. /* template */
  23027. __webpack_require__(180),
  23028. /* scopeId */
  23029. null,
  23030. /* cssModules */
  23031. null
  23032. )
  23033. Component.options.__file = "G:\\Server Stats\\webSource\\serveredit.vue"
  23034. 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.")}
  23035. if (Component.options.functional) {console.error("[vue-loader] serveredit.vue: functional components are not supported with templates, they should use render functions.")}
  23036. /* hot reload */
  23037. if (false) {(function () {
  23038. var hotAPI = require("vue-hot-reload-api")
  23039. hotAPI.install(require("vue"), false)
  23040. if (!hotAPI.compatible) return
  23041. module.hot.accept()
  23042. if (!module.hot.data) {
  23043. hotAPI.createRecord("data-v-7fae8b1c", Component.options)
  23044. } else {
  23045. hotAPI.reload("data-v-7fae8b1c", Component.options)
  23046. }
  23047. })()}
  23048. module.exports = Component.exports
  23049. /***/ }),
  23050. /* 119 */
  23051. /***/ (function(module, exports, __webpack_require__) {
  23052. var Component = __webpack_require__(1)(
  23053. /* script */
  23054. __webpack_require__(176),
  23055. /* template */
  23056. __webpack_require__(181),
  23057. /* scopeId */
  23058. null,
  23059. /* cssModules */
  23060. null
  23061. )
  23062. Component.options.__file = "G:\\Server Stats\\webSource\\servergraph.vue"
  23063. 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.")}
  23064. if (Component.options.functional) {console.error("[vue-loader] servergraph.vue: functional components are not supported with templates, they should use render functions.")}
  23065. /* hot reload */
  23066. if (false) {(function () {
  23067. var hotAPI = require("vue-hot-reload-api")
  23068. hotAPI.install(require("vue"), false)
  23069. if (!hotAPI.compatible) return
  23070. module.hot.accept()
  23071. if (!module.hot.data) {
  23072. hotAPI.createRecord("data-v-bbf0e6a8", Component.options)
  23073. } else {
  23074. hotAPI.reload("data-v-bbf0e6a8", Component.options)
  23075. }
  23076. })()}
  23077. module.exports = Component.exports
  23078. /***/ }),
  23079. /* 120 */
  23080. /***/ (function(module, exports, __webpack_require__) {
  23081. "use strict";
  23082. /* WEBPACK VAR INJECTION */(function(process) {/**
  23083. * vue-router v2.2.1
  23084. * (c) 2017 Evan You
  23085. * @license MIT
  23086. */
  23087. /* */
  23088. function assert (condition, message) {
  23089. if (!condition) {
  23090. throw new Error(("[vue-router] " + message))
  23091. }
  23092. }
  23093. function warn (condition, message) {
  23094. if (!condition) {
  23095. typeof console !== 'undefined' && console.warn(("[vue-router] " + message));
  23096. }
  23097. }
  23098. var View = {
  23099. name: 'router-view',
  23100. functional: true,
  23101. props: {
  23102. name: {
  23103. type: String,
  23104. default: 'default'
  23105. }
  23106. },
  23107. render: function render (h, ref) {
  23108. var props = ref.props;
  23109. var children = ref.children;
  23110. var parent = ref.parent;
  23111. var data = ref.data;
  23112. data.routerView = true;
  23113. var name = props.name;
  23114. var route = parent.$route;
  23115. var cache = parent._routerViewCache || (parent._routerViewCache = {});
  23116. // determine current view depth, also check to see if the tree
  23117. // has been toggled inactive but kept-alive.
  23118. var depth = 0;
  23119. var inactive = false;
  23120. while (parent) {
  23121. if (parent.$vnode && parent.$vnode.data.routerView) {
  23122. depth++;
  23123. }
  23124. if (parent._inactive) {
  23125. inactive = true;
  23126. }
  23127. parent = parent.$parent;
  23128. }
  23129. data.routerViewDepth = depth;
  23130. // render previous view if the tree is inactive and kept-alive
  23131. if (inactive) {
  23132. return h(cache[name], data, children)
  23133. }
  23134. var matched = route.matched[depth];
  23135. // render empty node if no matched route
  23136. if (!matched) {
  23137. cache[name] = null;
  23138. return h()
  23139. }
  23140. var component = cache[name] = matched.components[name];
  23141. // inject instance registration hooks
  23142. var hooks = data.hook || (data.hook = {});
  23143. hooks.init = function (vnode) {
  23144. matched.instances[name] = vnode.child;
  23145. };
  23146. hooks.prepatch = function (oldVnode, vnode) {
  23147. matched.instances[name] = vnode.child;
  23148. };
  23149. hooks.destroy = function (vnode) {
  23150. if (matched.instances[name] === vnode.child) {
  23151. matched.instances[name] = undefined;
  23152. }
  23153. };
  23154. // resolve props
  23155. data.props = resolveProps(route, matched.props && matched.props[name]);
  23156. return h(component, data, children)
  23157. }
  23158. };
  23159. function resolveProps (route, config) {
  23160. switch (typeof config) {
  23161. case 'undefined':
  23162. return
  23163. case 'object':
  23164. return config
  23165. case 'function':
  23166. return config(route)
  23167. case 'boolean':
  23168. return config ? route.params : undefined
  23169. default:
  23170. warn(false, ("props in \"" + (route.path) + "\" is a " + (typeof config) + ", expecting an object, function or boolean."));
  23171. }
  23172. }
  23173. /* */
  23174. var encodeReserveRE = /[!'()*]/g;
  23175. var encodeReserveReplacer = function (c) { return '%' + c.charCodeAt(0).toString(16); };
  23176. var commaRE = /%2C/g;
  23177. // fixed encodeURIComponent which is more comformant to RFC3986:
  23178. // - escapes [!'()*]
  23179. // - preserve commas
  23180. var encode = function (str) { return encodeURIComponent(str)
  23181. .replace(encodeReserveRE, encodeReserveReplacer)
  23182. .replace(commaRE, ','); };
  23183. var decode = decodeURIComponent;
  23184. function resolveQuery (
  23185. query,
  23186. extraQuery
  23187. ) {
  23188. if ( extraQuery === void 0 ) extraQuery = {};
  23189. if (query) {
  23190. var parsedQuery;
  23191. try {
  23192. parsedQuery = parseQuery(query);
  23193. } catch (e) {
  23194. process.env.NODE_ENV !== 'production' && warn(false, e.message);
  23195. parsedQuery = {};
  23196. }
  23197. for (var key in extraQuery) {
  23198. parsedQuery[key] = extraQuery[key];
  23199. }
  23200. return parsedQuery
  23201. } else {
  23202. return extraQuery
  23203. }
  23204. }
  23205. function parseQuery (query) {
  23206. var res = {};
  23207. query = query.trim().replace(/^(\?|#|&)/, '');
  23208. if (!query) {
  23209. return res
  23210. }
  23211. query.split('&').forEach(function (param) {
  23212. var parts = param.replace(/\+/g, ' ').split('=');
  23213. var key = decode(parts.shift());
  23214. var val = parts.length > 0
  23215. ? decode(parts.join('='))
  23216. : null;
  23217. if (res[key] === undefined) {
  23218. res[key] = val;
  23219. } else if (Array.isArray(res[key])) {
  23220. res[key].push(val);
  23221. } else {
  23222. res[key] = [res[key], val];
  23223. }
  23224. });
  23225. return res
  23226. }
  23227. function stringifyQuery (obj) {
  23228. var res = obj ? Object.keys(obj).map(function (key) {
  23229. var val = obj[key];
  23230. if (val === undefined) {
  23231. return ''
  23232. }
  23233. if (val === null) {
  23234. return encode(key)
  23235. }
  23236. if (Array.isArray(val)) {
  23237. var result = [];
  23238. val.slice().forEach(function (val2) {
  23239. if (val2 === undefined) {
  23240. return
  23241. }
  23242. if (val2 === null) {
  23243. result.push(encode(key));
  23244. } else {
  23245. result.push(encode(key) + '=' + encode(val2));
  23246. }
  23247. });
  23248. return result.join('&')
  23249. }
  23250. return encode(key) + '=' + encode(val)
  23251. }).filter(function (x) { return x.length > 0; }).join('&') : null;
  23252. return res ? ("?" + res) : ''
  23253. }
  23254. /* */
  23255. var trailingSlashRE = /\/?$/;
  23256. function createRoute (
  23257. record,
  23258. location,
  23259. redirectedFrom
  23260. ) {
  23261. var route = {
  23262. name: location.name || (record && record.name),
  23263. meta: (record && record.meta) || {},
  23264. path: location.path || '/',
  23265. hash: location.hash || '',
  23266. query: location.query || {},
  23267. params: location.params || {},
  23268. fullPath: getFullPath(location),
  23269. matched: record ? formatMatch(record) : []
  23270. };
  23271. if (redirectedFrom) {
  23272. route.redirectedFrom = getFullPath(redirectedFrom);
  23273. }
  23274. return Object.freeze(route)
  23275. }
  23276. // the starting route that represents the initial state
  23277. var START = createRoute(null, {
  23278. path: '/'
  23279. });
  23280. function formatMatch (record) {
  23281. var res = [];
  23282. while (record) {
  23283. res.unshift(record);
  23284. record = record.parent;
  23285. }
  23286. return res
  23287. }
  23288. function getFullPath (ref) {
  23289. var path = ref.path;
  23290. var query = ref.query; if ( query === void 0 ) query = {};
  23291. var hash = ref.hash; if ( hash === void 0 ) hash = '';
  23292. return (path || '/') + stringifyQuery(query) + hash
  23293. }
  23294. function isSameRoute (a, b) {
  23295. if (b === START) {
  23296. return a === b
  23297. } else if (!b) {
  23298. return false
  23299. } else if (a.path && b.path) {
  23300. return (
  23301. a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') &&
  23302. a.hash === b.hash &&
  23303. isObjectEqual(a.query, b.query)
  23304. )
  23305. } else if (a.name && b.name) {
  23306. return (
  23307. a.name === b.name &&
  23308. a.hash === b.hash &&
  23309. isObjectEqual(a.query, b.query) &&
  23310. isObjectEqual(a.params, b.params)
  23311. )
  23312. } else {
  23313. return false
  23314. }
  23315. }
  23316. function isObjectEqual (a, b) {
  23317. if ( a === void 0 ) a = {};
  23318. if ( b === void 0 ) b = {};
  23319. var aKeys = Object.keys(a);
  23320. var bKeys = Object.keys(b);
  23321. if (aKeys.length !== bKeys.length) {
  23322. return false
  23323. }
  23324. return aKeys.every(function (key) { return String(a[key]) === String(b[key]); })
  23325. }
  23326. function isIncludedRoute (current, target) {
  23327. return (
  23328. current.path.replace(trailingSlashRE, '/').indexOf(
  23329. target.path.replace(trailingSlashRE, '/')
  23330. ) === 0 &&
  23331. (!target.hash || current.hash === target.hash) &&
  23332. queryIncludes(current.query, target.query)
  23333. )
  23334. }
  23335. function queryIncludes (current, target) {
  23336. for (var key in target) {
  23337. if (!(key in current)) {
  23338. return false
  23339. }
  23340. }
  23341. return true
  23342. }
  23343. /* */
  23344. // work around weird flow bug
  23345. var toTypes = [String, Object];
  23346. var eventTypes = [String, Array];
  23347. var Link = {
  23348. name: 'router-link',
  23349. props: {
  23350. to: {
  23351. type: toTypes,
  23352. required: true
  23353. },
  23354. tag: {
  23355. type: String,
  23356. default: 'a'
  23357. },
  23358. exact: Boolean,
  23359. append: Boolean,
  23360. replace: Boolean,
  23361. activeClass: String,
  23362. event: {
  23363. type: eventTypes,
  23364. default: 'click'
  23365. }
  23366. },
  23367. render: function render (h) {
  23368. var this$1 = this;
  23369. var router = this.$router;
  23370. var current = this.$route;
  23371. var ref = router.resolve(this.to, current, this.append);
  23372. var location = ref.location;
  23373. var route = ref.route;
  23374. var href = ref.href;
  23375. var classes = {};
  23376. var activeClass = this.activeClass || router.options.linkActiveClass || 'router-link-active';
  23377. var compareTarget = location.path ? createRoute(null, location) : route;
  23378. classes[activeClass] = this.exact
  23379. ? isSameRoute(current, compareTarget)
  23380. : isIncludedRoute(current, compareTarget);
  23381. var handler = function (e) {
  23382. if (guardEvent(e)) {
  23383. if (this$1.replace) {
  23384. router.replace(location);
  23385. } else {
  23386. router.push(location);
  23387. }
  23388. }
  23389. };
  23390. var on = { click: guardEvent };
  23391. if (Array.isArray(this.event)) {
  23392. this.event.forEach(function (e) { on[e] = handler; });
  23393. } else {
  23394. on[this.event] = handler;
  23395. }
  23396. var data = {
  23397. class: classes
  23398. };
  23399. if (this.tag === 'a') {
  23400. data.on = on;
  23401. data.attrs = { href: href };
  23402. } else {
  23403. // find the first <a> child and apply listener and href
  23404. var a = findAnchor(this.$slots.default);
  23405. if (a) {
  23406. // in case the <a> is a static node
  23407. a.isStatic = false;
  23408. var extend = _Vue.util.extend;
  23409. var aData = a.data = extend({}, a.data);
  23410. aData.on = on;
  23411. var aAttrs = a.data.attrs = extend({}, a.data.attrs);
  23412. aAttrs.href = href;
  23413. } else {
  23414. // doesn't have <a> child, apply listener to self
  23415. data.on = on;
  23416. }
  23417. }
  23418. return h(this.tag, data, this.$slots.default)
  23419. }
  23420. };
  23421. function guardEvent (e) {
  23422. // don't redirect with control keys
  23423. if (e.metaKey || e.ctrlKey || e.shiftKey) { return }
  23424. // don't redirect when preventDefault called
  23425. if (e.defaultPrevented) { return }
  23426. // don't redirect on right click
  23427. if (e.button !== undefined && e.button !== 0) { return }
  23428. // don't redirect if `target="_blank"`
  23429. if (e.target && e.target.getAttribute) {
  23430. var target = e.target.getAttribute('target');
  23431. if (/\b_blank\b/i.test(target)) { return }
  23432. }
  23433. // this may be a Weex event which doesn't have this method
  23434. if (e.preventDefault) {
  23435. e.preventDefault();
  23436. }
  23437. return true
  23438. }
  23439. function findAnchor (children) {
  23440. if (children) {
  23441. var child;
  23442. for (var i = 0; i < children.length; i++) {
  23443. child = children[i];
  23444. if (child.tag === 'a') {
  23445. return child
  23446. }
  23447. if (child.children && (child = findAnchor(child.children))) {
  23448. return child
  23449. }
  23450. }
  23451. }
  23452. }
  23453. var _Vue;
  23454. function install (Vue) {
  23455. if (install.installed) { return }
  23456. install.installed = true;
  23457. _Vue = Vue;
  23458. Object.defineProperty(Vue.prototype, '$router', {
  23459. get: function get () { return this.$root._router }
  23460. });
  23461. Object.defineProperty(Vue.prototype, '$route', {
  23462. get: function get () { return this.$root._route }
  23463. });
  23464. Vue.mixin({
  23465. beforeCreate: function beforeCreate () {
  23466. if (this.$options.router) {
  23467. this._router = this.$options.router;
  23468. this._router.init(this);
  23469. Vue.util.defineReactive(this, '_route', this._router.history.current);
  23470. }
  23471. }
  23472. });
  23473. Vue.component('router-view', View);
  23474. Vue.component('router-link', Link);
  23475. var strats = Vue.config.optionMergeStrategies;
  23476. // use the same hook merging strategy for route hooks
  23477. strats.beforeRouteEnter = strats.beforeRouteLeave = strats.created;
  23478. }
  23479. /* */
  23480. var inBrowser = typeof window !== 'undefined';
  23481. /* */
  23482. function resolvePath (
  23483. relative,
  23484. base,
  23485. append
  23486. ) {
  23487. if (relative.charAt(0) === '/') {
  23488. return relative
  23489. }
  23490. if (relative.charAt(0) === '?' || relative.charAt(0) === '#') {
  23491. return base + relative
  23492. }
  23493. var stack = base.split('/');
  23494. // remove trailing segment if:
  23495. // - not appending
  23496. // - appending to trailing slash (last segment is empty)
  23497. if (!append || !stack[stack.length - 1]) {
  23498. stack.pop();
  23499. }
  23500. // resolve relative path
  23501. var segments = relative.replace(/^\//, '').split('/');
  23502. for (var i = 0; i < segments.length; i++) {
  23503. var segment = segments[i];
  23504. if (segment === '.') {
  23505. continue
  23506. } else if (segment === '..') {
  23507. stack.pop();
  23508. } else {
  23509. stack.push(segment);
  23510. }
  23511. }
  23512. // ensure leading slash
  23513. if (stack[0] !== '') {
  23514. stack.unshift('');
  23515. }
  23516. return stack.join('/')
  23517. }
  23518. function parsePath (path) {
  23519. var hash = '';
  23520. var query = '';
  23521. var hashIndex = path.indexOf('#');
  23522. if (hashIndex >= 0) {
  23523. hash = path.slice(hashIndex);
  23524. path = path.slice(0, hashIndex);
  23525. }
  23526. var queryIndex = path.indexOf('?');
  23527. if (queryIndex >= 0) {
  23528. query = path.slice(queryIndex + 1);
  23529. path = path.slice(0, queryIndex);
  23530. }
  23531. return {
  23532. path: path,
  23533. query: query,
  23534. hash: hash
  23535. }
  23536. }
  23537. function cleanPath (path) {
  23538. return path.replace(/\/\//g, '/')
  23539. }
  23540. /* */
  23541. function createRouteMap (
  23542. routes,
  23543. oldPathMap,
  23544. oldNameMap
  23545. ) {
  23546. var pathMap = oldPathMap || Object.create(null);
  23547. var nameMap = oldNameMap || Object.create(null);
  23548. routes.forEach(function (route) {
  23549. addRouteRecord(pathMap, nameMap, route);
  23550. });
  23551. return {
  23552. pathMap: pathMap,
  23553. nameMap: nameMap
  23554. }
  23555. }
  23556. function addRouteRecord (
  23557. pathMap,
  23558. nameMap,
  23559. route,
  23560. parent,
  23561. matchAs
  23562. ) {
  23563. var path = route.path;
  23564. var name = route.name;
  23565. if (process.env.NODE_ENV !== 'production') {
  23566. assert(path != null, "\"path\" is required in a route configuration.");
  23567. assert(
  23568. typeof route.component !== 'string',
  23569. "route config \"component\" for path: " + (String(path || name)) + " cannot be a " +
  23570. "string id. Use an actual component instead."
  23571. );
  23572. }
  23573. var record = {
  23574. path: normalizePath(path, parent),
  23575. components: route.components || { default: route.component },
  23576. instances: {},
  23577. name: name,
  23578. parent: parent,
  23579. matchAs: matchAs,
  23580. redirect: route.redirect,
  23581. beforeEnter: route.beforeEnter,
  23582. meta: route.meta || {},
  23583. props: route.props == null
  23584. ? {}
  23585. : route.components
  23586. ? route.props
  23587. : { default: route.props }
  23588. };
  23589. if (route.children) {
  23590. // Warn if route is named and has a default child route.
  23591. // If users navigate to this route by name, the default child will
  23592. // not be rendered (GH Issue #629)
  23593. if (process.env.NODE_ENV !== 'production') {
  23594. if (route.name && route.children.some(function (child) { return /^\/?$/.test(child.path); })) {
  23595. warn(
  23596. false,
  23597. "Named Route '" + (route.name) + "' has a default child route. " +
  23598. "When navigating to this named route (:to=\"{name: '" + (route.name) + "'\"), " +
  23599. "the default child route will not be rendered. Remove the name from " +
  23600. "this route and use the name of the default child route for named " +
  23601. "links instead."
  23602. );
  23603. }
  23604. }
  23605. route.children.forEach(function (child) {
  23606. var childMatchAs = matchAs
  23607. ? cleanPath((matchAs + "/" + (child.path)))
  23608. : undefined;
  23609. addRouteRecord(pathMap, nameMap, child, record, childMatchAs);
  23610. });
  23611. }
  23612. if (route.alias !== undefined) {
  23613. if (Array.isArray(route.alias)) {
  23614. route.alias.forEach(function (alias) {
  23615. var aliasRoute = {
  23616. path: alias,
  23617. children: route.children
  23618. };
  23619. addRouteRecord(pathMap, nameMap, aliasRoute, parent, record.path);
  23620. });
  23621. } else {
  23622. var aliasRoute = {
  23623. path: route.alias,
  23624. children: route.children
  23625. };
  23626. addRouteRecord(pathMap, nameMap, aliasRoute, parent, record.path);
  23627. }
  23628. }
  23629. if (!pathMap[record.path]) {
  23630. pathMap[record.path] = record;
  23631. }
  23632. if (name) {
  23633. if (!nameMap[name]) {
  23634. nameMap[name] = record;
  23635. } else if (process.env.NODE_ENV !== 'production' && !matchAs) {
  23636. warn(
  23637. false,
  23638. "Duplicate named routes definition: " +
  23639. "{ name: \"" + name + "\", path: \"" + (record.path) + "\" }"
  23640. );
  23641. }
  23642. }
  23643. }
  23644. function normalizePath (path, parent) {
  23645. path = path.replace(/\/$/, '');
  23646. if (path[0] === '/') { return path }
  23647. if (parent == null) { return path }
  23648. return cleanPath(((parent.path) + "/" + path))
  23649. }
  23650. var index$1 = Array.isArray || function (arr) {
  23651. return Object.prototype.toString.call(arr) == '[object Array]';
  23652. };
  23653. var isarray = index$1;
  23654. /**
  23655. * Expose `pathToRegexp`.
  23656. */
  23657. var index = pathToRegexp;
  23658. var parse_1 = parse;
  23659. var compile_1 = compile;
  23660. var tokensToFunction_1 = tokensToFunction;
  23661. var tokensToRegExp_1 = tokensToRegExp;
  23662. /**
  23663. * The main path matching regexp utility.
  23664. *
  23665. * @type {RegExp}
  23666. */
  23667. var PATH_REGEXP = new RegExp([
  23668. // Match escaped characters that would otherwise appear in future matches.
  23669. // This allows the user to escape special characters that won't transform.
  23670. '(\\\\.)',
  23671. // Match Express-style parameters and un-named parameters with a prefix
  23672. // and optional suffixes. Matches appear as:
  23673. //
  23674. // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
  23675. // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
  23676. // "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
  23677. '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'
  23678. ].join('|'), 'g');
  23679. /**
  23680. * Parse a string for the raw tokens.
  23681. *
  23682. * @param {string} str
  23683. * @param {Object=} options
  23684. * @return {!Array}
  23685. */
  23686. function parse (str, options) {
  23687. var tokens = [];
  23688. var key = 0;
  23689. var index = 0;
  23690. var path = '';
  23691. var defaultDelimiter = options && options.delimiter || '/';
  23692. var res;
  23693. while ((res = PATH_REGEXP.exec(str)) != null) {
  23694. var m = res[0];
  23695. var escaped = res[1];
  23696. var offset = res.index;
  23697. path += str.slice(index, offset);
  23698. index = offset + m.length;
  23699. // Ignore already escaped sequences.
  23700. if (escaped) {
  23701. path += escaped[1];
  23702. continue
  23703. }
  23704. var next = str[index];
  23705. var prefix = res[2];
  23706. var name = res[3];
  23707. var capture = res[4];
  23708. var group = res[5];
  23709. var modifier = res[6];
  23710. var asterisk = res[7];
  23711. // Push the current path onto the tokens.
  23712. if (path) {
  23713. tokens.push(path);
  23714. path = '';
  23715. }
  23716. var partial = prefix != null && next != null && next !== prefix;
  23717. var repeat = modifier === '+' || modifier === '*';
  23718. var optional = modifier === '?' || modifier === '*';
  23719. var delimiter = res[2] || defaultDelimiter;
  23720. var pattern = capture || group;
  23721. tokens.push({
  23722. name: name || key++,
  23723. prefix: prefix || '',
  23724. delimiter: delimiter,
  23725. optional: optional,
  23726. repeat: repeat,
  23727. partial: partial,
  23728. asterisk: !!asterisk,
  23729. pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')
  23730. });
  23731. }
  23732. // Match any characters still remaining.
  23733. if (index < str.length) {
  23734. path += str.substr(index);
  23735. }
  23736. // If the path exists, push it onto the end.
  23737. if (path) {
  23738. tokens.push(path);
  23739. }
  23740. return tokens
  23741. }
  23742. /**
  23743. * Compile a string to a template function for the path.
  23744. *
  23745. * @param {string} str
  23746. * @param {Object=} options
  23747. * @return {!function(Object=, Object=)}
  23748. */
  23749. function compile (str, options) {
  23750. return tokensToFunction(parse(str, options))
  23751. }
  23752. /**
  23753. * Prettier encoding of URI path segments.
  23754. *
  23755. * @param {string}
  23756. * @return {string}
  23757. */
  23758. function encodeURIComponentPretty (str) {
  23759. return encodeURI(str).replace(/[\/?#]/g, function (c) {
  23760. return '%' + c.charCodeAt(0).toString(16).toUpperCase()
  23761. })
  23762. }
  23763. /**
  23764. * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.
  23765. *
  23766. * @param {string}
  23767. * @return {string}
  23768. */
  23769. function encodeAsterisk (str) {
  23770. return encodeURI(str).replace(/[?#]/g, function (c) {
  23771. return '%' + c.charCodeAt(0).toString(16).toUpperCase()
  23772. })
  23773. }
  23774. /**
  23775. * Expose a method for transforming tokens into the path function.
  23776. */
  23777. function tokensToFunction (tokens) {
  23778. // Compile all the tokens into regexps.
  23779. var matches = new Array(tokens.length);
  23780. // Compile all the patterns before compilation.
  23781. for (var i = 0; i < tokens.length; i++) {
  23782. if (typeof tokens[i] === 'object') {
  23783. matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$');
  23784. }
  23785. }
  23786. return function (obj, opts) {
  23787. var path = '';
  23788. var data = obj || {};
  23789. var options = opts || {};
  23790. var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;
  23791. for (var i = 0; i < tokens.length; i++) {
  23792. var token = tokens[i];
  23793. if (typeof token === 'string') {
  23794. path += token;
  23795. continue
  23796. }
  23797. var value = data[token.name];
  23798. var segment;
  23799. if (value == null) {
  23800. if (token.optional) {
  23801. // Prepend partial segment prefixes.
  23802. if (token.partial) {
  23803. path += token.prefix;
  23804. }
  23805. continue
  23806. } else {
  23807. throw new TypeError('Expected "' + token.name + '" to be defined')
  23808. }
  23809. }
  23810. if (isarray(value)) {
  23811. if (!token.repeat) {
  23812. throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
  23813. }
  23814. if (value.length === 0) {
  23815. if (token.optional) {
  23816. continue
  23817. } else {
  23818. throw new TypeError('Expected "' + token.name + '" to not be empty')
  23819. }
  23820. }
  23821. for (var j = 0; j < value.length; j++) {
  23822. segment = encode(value[j]);
  23823. if (!matches[i].test(segment)) {
  23824. throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`')
  23825. }
  23826. path += (j === 0 ? token.prefix : token.delimiter) + segment;
  23827. }
  23828. continue
  23829. }
  23830. segment = token.asterisk ? encodeAsterisk(value) : encode(value);
  23831. if (!matches[i].test(segment)) {
  23832. throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"')
  23833. }
  23834. path += token.prefix + segment;
  23835. }
  23836. return path
  23837. }
  23838. }
  23839. /**
  23840. * Escape a regular expression string.
  23841. *
  23842. * @param {string} str
  23843. * @return {string}
  23844. */
  23845. function escapeString (str) {
  23846. return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1')
  23847. }
  23848. /**
  23849. * Escape the capturing group by escaping special characters and meaning.
  23850. *
  23851. * @param {string} group
  23852. * @return {string}
  23853. */
  23854. function escapeGroup (group) {
  23855. return group.replace(/([=!:$\/()])/g, '\\$1')
  23856. }
  23857. /**
  23858. * Attach the keys as a property of the regexp.
  23859. *
  23860. * @param {!RegExp} re
  23861. * @param {Array} keys
  23862. * @return {!RegExp}
  23863. */
  23864. function attachKeys (re, keys) {
  23865. re.keys = keys;
  23866. return re
  23867. }
  23868. /**
  23869. * Get the flags for a regexp from the options.
  23870. *
  23871. * @param {Object} options
  23872. * @return {string}
  23873. */
  23874. function flags (options) {
  23875. return options.sensitive ? '' : 'i'
  23876. }
  23877. /**
  23878. * Pull out keys from a regexp.
  23879. *
  23880. * @param {!RegExp} path
  23881. * @param {!Array} keys
  23882. * @return {!RegExp}
  23883. */
  23884. function regexpToRegexp (path, keys) {
  23885. // Use a negative lookahead to match only capturing groups.
  23886. var groups = path.source.match(/\((?!\?)/g);
  23887. if (groups) {
  23888. for (var i = 0; i < groups.length; i++) {
  23889. keys.push({
  23890. name: i,
  23891. prefix: null,
  23892. delimiter: null,
  23893. optional: false,
  23894. repeat: false,
  23895. partial: false,
  23896. asterisk: false,
  23897. pattern: null
  23898. });
  23899. }
  23900. }
  23901. return attachKeys(path, keys)
  23902. }
  23903. /**
  23904. * Transform an array into a regexp.
  23905. *
  23906. * @param {!Array} path
  23907. * @param {Array} keys
  23908. * @param {!Object} options
  23909. * @return {!RegExp}
  23910. */
  23911. function arrayToRegexp (path, keys, options) {
  23912. var parts = [];
  23913. for (var i = 0; i < path.length; i++) {
  23914. parts.push(pathToRegexp(path[i], keys, options).source);
  23915. }
  23916. var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));
  23917. return attachKeys(regexp, keys)
  23918. }
  23919. /**
  23920. * Create a path regexp from string input.
  23921. *
  23922. * @param {string} path
  23923. * @param {!Array} keys
  23924. * @param {!Object} options
  23925. * @return {!RegExp}
  23926. */
  23927. function stringToRegexp (path, keys, options) {
  23928. return tokensToRegExp(parse(path, options), keys, options)
  23929. }
  23930. /**
  23931. * Expose a function for taking tokens and returning a RegExp.
  23932. *
  23933. * @param {!Array} tokens
  23934. * @param {(Array|Object)=} keys
  23935. * @param {Object=} options
  23936. * @return {!RegExp}
  23937. */
  23938. function tokensToRegExp (tokens, keys, options) {
  23939. if (!isarray(keys)) {
  23940. options = /** @type {!Object} */ (keys || options);
  23941. keys = [];
  23942. }
  23943. options = options || {};
  23944. var strict = options.strict;
  23945. var end = options.end !== false;
  23946. var route = '';
  23947. // Iterate over the tokens and create our regexp string.
  23948. for (var i = 0; i < tokens.length; i++) {
  23949. var token = tokens[i];
  23950. if (typeof token === 'string') {
  23951. route += escapeString(token);
  23952. } else {
  23953. var prefix = escapeString(token.prefix);
  23954. var capture = '(?:' + token.pattern + ')';
  23955. keys.push(token);
  23956. if (token.repeat) {
  23957. capture += '(?:' + prefix + capture + ')*';
  23958. }
  23959. if (token.optional) {
  23960. if (!token.partial) {
  23961. capture = '(?:' + prefix + '(' + capture + '))?';
  23962. } else {
  23963. capture = prefix + '(' + capture + ')?';
  23964. }
  23965. } else {
  23966. capture = prefix + '(' + capture + ')';
  23967. }
  23968. route += capture;
  23969. }
  23970. }
  23971. var delimiter = escapeString(options.delimiter || '/');
  23972. var endsWithDelimiter = route.slice(-delimiter.length) === delimiter;
  23973. // In non-strict mode we allow a slash at the end of match. If the path to
  23974. // match already ends with a slash, we remove it for consistency. The slash
  23975. // is valid at the end of a path match, not in the middle. This is important
  23976. // in non-ending mode, where "/test/" shouldn't match "/test//route".
  23977. if (!strict) {
  23978. route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?';
  23979. }
  23980. if (end) {
  23981. route += '$';
  23982. } else {
  23983. // In non-ending mode, we need the capturing groups to match as much as
  23984. // possible by using a positive lookahead to the end or next path segment.
  23985. route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)';
  23986. }
  23987. return attachKeys(new RegExp('^' + route, flags(options)), keys)
  23988. }
  23989. /**
  23990. * Normalize the given path string, returning a regular expression.
  23991. *
  23992. * An empty array can be passed in for the keys, which will hold the
  23993. * placeholder key descriptions. For example, using `/user/:id`, `keys` will
  23994. * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
  23995. *
  23996. * @param {(string|RegExp|Array)} path
  23997. * @param {(Array|Object)=} keys
  23998. * @param {Object=} options
  23999. * @return {!RegExp}
  24000. */
  24001. function pathToRegexp (path, keys, options) {
  24002. if (!isarray(keys)) {
  24003. options = /** @type {!Object} */ (keys || options);
  24004. keys = [];
  24005. }
  24006. options = options || {};
  24007. if (path instanceof RegExp) {
  24008. return regexpToRegexp(path, /** @type {!Array} */ (keys))
  24009. }
  24010. if (isarray(path)) {
  24011. return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
  24012. }
  24013. return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)
  24014. }
  24015. index.parse = parse_1;
  24016. index.compile = compile_1;
  24017. index.tokensToFunction = tokensToFunction_1;
  24018. index.tokensToRegExp = tokensToRegExp_1;
  24019. /* */
  24020. var regexpCache = Object.create(null);
  24021. function getRouteRegex (path) {
  24022. var hit = regexpCache[path];
  24023. var keys, regexp;
  24024. if (hit) {
  24025. keys = hit.keys;
  24026. regexp = hit.regexp;
  24027. } else {
  24028. keys = [];
  24029. regexp = index(path, keys);
  24030. regexpCache[path] = { keys: keys, regexp: regexp };
  24031. }
  24032. return { keys: keys, regexp: regexp }
  24033. }
  24034. var regexpCompileCache = Object.create(null);
  24035. function fillParams (
  24036. path,
  24037. params,
  24038. routeMsg
  24039. ) {
  24040. try {
  24041. var filler =
  24042. regexpCompileCache[path] ||
  24043. (regexpCompileCache[path] = index.compile(path));
  24044. return filler(params || {}, { pretty: true })
  24045. } catch (e) {
  24046. if (process.env.NODE_ENV !== 'production') {
  24047. warn(false, ("missing param for " + routeMsg + ": " + (e.message)));
  24048. }
  24049. return ''
  24050. }
  24051. }
  24052. /* */
  24053. function normalizeLocation (
  24054. raw,
  24055. current,
  24056. append
  24057. ) {
  24058. var next = typeof raw === 'string' ? { path: raw } : raw;
  24059. // named target
  24060. if (next.name || next._normalized) {
  24061. return next
  24062. }
  24063. // relative params
  24064. if (!next.path && next.params && current) {
  24065. next = assign({}, next);
  24066. next._normalized = true;
  24067. var params = assign(assign({}, current.params), next.params);
  24068. if (current.name) {
  24069. next.name = current.name;
  24070. next.params = params;
  24071. } else if (current.matched) {
  24072. var rawPath = current.matched[current.matched.length - 1].path;
  24073. next.path = fillParams(rawPath, params, ("path " + (current.path)));
  24074. } else if (process.env.NODE_ENV !== 'production') {
  24075. warn(false, "relative params navigation requires a current route.");
  24076. }
  24077. return next
  24078. }
  24079. var parsedPath = parsePath(next.path || '');
  24080. var basePath = (current && current.path) || '/';
  24081. var path = parsedPath.path
  24082. ? resolvePath(parsedPath.path, basePath, append || next.append)
  24083. : (current && current.path) || '/';
  24084. var query = resolveQuery(parsedPath.query, next.query);
  24085. var hash = next.hash || parsedPath.hash;
  24086. if (hash && hash.charAt(0) !== '#') {
  24087. hash = "#" + hash;
  24088. }
  24089. return {
  24090. _normalized: true,
  24091. path: path,
  24092. query: query,
  24093. hash: hash
  24094. }
  24095. }
  24096. function assign (a, b) {
  24097. for (var key in b) {
  24098. a[key] = b[key];
  24099. }
  24100. return a
  24101. }
  24102. /* */
  24103. function createMatcher (routes) {
  24104. var ref = createRouteMap(routes);
  24105. var pathMap = ref.pathMap;
  24106. var nameMap = ref.nameMap;
  24107. function addRoutes (routes) {
  24108. createRouteMap(routes, pathMap, nameMap);
  24109. }
  24110. function match (
  24111. raw,
  24112. currentRoute,
  24113. redirectedFrom
  24114. ) {
  24115. var location = normalizeLocation(raw, currentRoute);
  24116. var name = location.name;
  24117. if (name) {
  24118. var record = nameMap[name];
  24119. if (process.env.NODE_ENV !== 'production') {
  24120. warn(record, ("Route with name '" + name + "' does not exist"));
  24121. }
  24122. var paramNames = getRouteRegex(record.path).keys
  24123. .filter(function (key) { return !key.optional; })
  24124. .map(function (key) { return key.name; });
  24125. if (typeof location.params !== 'object') {
  24126. location.params = {};
  24127. }
  24128. if (currentRoute && typeof currentRoute.params === 'object') {
  24129. for (var key in currentRoute.params) {
  24130. if (!(key in location.params) && paramNames.indexOf(key) > -1) {
  24131. location.params[key] = currentRoute.params[key];
  24132. }
  24133. }
  24134. }
  24135. if (record) {
  24136. location.path = fillParams(record.path, location.params, ("named route \"" + name + "\""));
  24137. return _createRoute(record, location, redirectedFrom)
  24138. }
  24139. } else if (location.path) {
  24140. location.params = {};
  24141. for (var path in pathMap) {
  24142. if (matchRoute(path, location.params, location.path)) {
  24143. return _createRoute(pathMap[path], location, redirectedFrom)
  24144. }
  24145. }
  24146. }
  24147. // no match
  24148. return _createRoute(null, location)
  24149. }
  24150. function redirect (
  24151. record,
  24152. location
  24153. ) {
  24154. var originalRedirect = record.redirect;
  24155. var redirect = typeof originalRedirect === 'function'
  24156. ? originalRedirect(createRoute(record, location))
  24157. : originalRedirect;
  24158. if (typeof redirect === 'string') {
  24159. redirect = { path: redirect };
  24160. }
  24161. if (!redirect || typeof redirect !== 'object') {
  24162. process.env.NODE_ENV !== 'production' && warn(
  24163. false, ("invalid redirect option: " + (JSON.stringify(redirect)))
  24164. );
  24165. return _createRoute(null, location)
  24166. }
  24167. var re = redirect;
  24168. var name = re.name;
  24169. var path = re.path;
  24170. var query = location.query;
  24171. var hash = location.hash;
  24172. var params = location.params;
  24173. query = re.hasOwnProperty('query') ? re.query : query;
  24174. hash = re.hasOwnProperty('hash') ? re.hash : hash;
  24175. params = re.hasOwnProperty('params') ? re.params : params;
  24176. if (name) {
  24177. // resolved named direct
  24178. var targetRecord = nameMap[name];
  24179. if (process.env.NODE_ENV !== 'production') {
  24180. assert(targetRecord, ("redirect failed: named route \"" + name + "\" not found."));
  24181. }
  24182. return match({
  24183. _normalized: true,
  24184. name: name,
  24185. query: query,
  24186. hash: hash,
  24187. params: params
  24188. }, undefined, location)
  24189. } else if (path) {
  24190. // 1. resolve relative redirect
  24191. var rawPath = resolveRecordPath(path, record);
  24192. // 2. resolve params
  24193. var resolvedPath = fillParams(rawPath, params, ("redirect route with path \"" + rawPath + "\""));
  24194. // 3. rematch with existing query and hash
  24195. return match({
  24196. _normalized: true,
  24197. path: resolvedPath,
  24198. query: query,
  24199. hash: hash
  24200. }, undefined, location)
  24201. } else {
  24202. warn(false, ("invalid redirect option: " + (JSON.stringify(redirect))));
  24203. return _createRoute(null, location)
  24204. }
  24205. }
  24206. function alias (
  24207. record,
  24208. location,
  24209. matchAs
  24210. ) {
  24211. var aliasedPath = fillParams(matchAs, location.params, ("aliased route with path \"" + matchAs + "\""));
  24212. var aliasedMatch = match({
  24213. _normalized: true,
  24214. path: aliasedPath
  24215. });
  24216. if (aliasedMatch) {
  24217. var matched = aliasedMatch.matched;
  24218. var aliasedRecord = matched[matched.length - 1];
  24219. location.params = aliasedMatch.params;
  24220. return _createRoute(aliasedRecord, location)
  24221. }
  24222. return _createRoute(null, location)
  24223. }
  24224. function _createRoute (
  24225. record,
  24226. location,
  24227. redirectedFrom
  24228. ) {
  24229. if (record && record.redirect) {
  24230. return redirect(record, redirectedFrom || location)
  24231. }
  24232. if (record && record.matchAs) {
  24233. return alias(record, location, record.matchAs)
  24234. }
  24235. return createRoute(record, location, redirectedFrom)
  24236. }
  24237. return {
  24238. match: match,
  24239. addRoutes: addRoutes
  24240. }
  24241. }
  24242. function matchRoute (
  24243. path,
  24244. params,
  24245. pathname
  24246. ) {
  24247. var ref = getRouteRegex(path);
  24248. var regexp = ref.regexp;
  24249. var keys = ref.keys;
  24250. var m = pathname.match(regexp);
  24251. if (!m) {
  24252. return false
  24253. } else if (!params) {
  24254. return true
  24255. }
  24256. for (var i = 1, len = m.length; i < len; ++i) {
  24257. var key = keys[i - 1];
  24258. var val = typeof m[i] === 'string' ? decodeURIComponent(m[i]) : m[i];
  24259. if (key) { params[key.name] = val; }
  24260. }
  24261. return true
  24262. }
  24263. function resolveRecordPath (path, record) {
  24264. return resolvePath(path, record.parent ? record.parent.path : '/', true)
  24265. }
  24266. /* */
  24267. var positionStore = Object.create(null);
  24268. function setupScroll () {
  24269. window.addEventListener('popstate', function (e) {
  24270. saveScrollPosition();
  24271. if (e.state && e.state.key) {
  24272. setStateKey(e.state.key);
  24273. }
  24274. });
  24275. }
  24276. function handleScroll (
  24277. router,
  24278. to,
  24279. from,
  24280. isPop
  24281. ) {
  24282. if (!router.app) {
  24283. return
  24284. }
  24285. var behavior = router.options.scrollBehavior;
  24286. if (!behavior) {
  24287. return
  24288. }
  24289. if (process.env.NODE_ENV !== 'production') {
  24290. assert(typeof behavior === 'function', "scrollBehavior must be a function");
  24291. }
  24292. // wait until re-render finishes before scrolling
  24293. router.app.$nextTick(function () {
  24294. var position = getScrollPosition();
  24295. var shouldScroll = behavior(to, from, isPop ? position : null);
  24296. if (!shouldScroll) {
  24297. return
  24298. }
  24299. var isObject = typeof shouldScroll === 'object';
  24300. if (isObject && typeof shouldScroll.selector === 'string') {
  24301. var el = document.querySelector(shouldScroll.selector);
  24302. if (el) {
  24303. position = getElementPosition(el);
  24304. } else if (isValidPosition(shouldScroll)) {
  24305. position = normalizePosition(shouldScroll);
  24306. }
  24307. } else if (isObject && isValidPosition(shouldScroll)) {
  24308. position = normalizePosition(shouldScroll);
  24309. }
  24310. if (position) {
  24311. window.scrollTo(position.x, position.y);
  24312. }
  24313. });
  24314. }
  24315. function saveScrollPosition () {
  24316. var key = getStateKey();
  24317. if (key) {
  24318. positionStore[key] = {
  24319. x: window.pageXOffset,
  24320. y: window.pageYOffset
  24321. };
  24322. }
  24323. }
  24324. function getScrollPosition () {
  24325. var key = getStateKey();
  24326. if (key) {
  24327. return positionStore[key]
  24328. }
  24329. }
  24330. function getElementPosition (el) {
  24331. var docRect = document.documentElement.getBoundingClientRect();
  24332. var elRect = el.getBoundingClientRect();
  24333. return {
  24334. x: elRect.left - docRect.left,
  24335. y: elRect.top - docRect.top
  24336. }
  24337. }
  24338. function isValidPosition (obj) {
  24339. return isNumber(obj.x) || isNumber(obj.y)
  24340. }
  24341. function normalizePosition (obj) {
  24342. return {
  24343. x: isNumber(obj.x) ? obj.x : window.pageXOffset,
  24344. y: isNumber(obj.y) ? obj.y : window.pageYOffset
  24345. }
  24346. }
  24347. function isNumber (v) {
  24348. return typeof v === 'number'
  24349. }
  24350. /* */
  24351. var supportsPushState = inBrowser && (function () {
  24352. var ua = window.navigator.userAgent;
  24353. if (
  24354. (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&
  24355. ua.indexOf('Mobile Safari') !== -1 &&
  24356. ua.indexOf('Chrome') === -1 &&
  24357. ua.indexOf('Windows Phone') === -1
  24358. ) {
  24359. return false
  24360. }
  24361. return window.history && 'pushState' in window.history
  24362. })();
  24363. // use User Timing api (if present) for more accurate key precision
  24364. var Time = inBrowser && window.performance && window.performance.now
  24365. ? window.performance
  24366. : Date;
  24367. var _key = genKey();
  24368. function genKey () {
  24369. return Time.now().toFixed(3)
  24370. }
  24371. function getStateKey () {
  24372. return _key
  24373. }
  24374. function setStateKey (key) {
  24375. _key = key;
  24376. }
  24377. function pushState (url, replace) {
  24378. saveScrollPosition();
  24379. // try...catch the pushState call to get around Safari
  24380. // DOM Exception 18 where it limits to 100 pushState calls
  24381. var history = window.history;
  24382. try {
  24383. if (replace) {
  24384. history.replaceState({ key: _key }, '', url);
  24385. } else {
  24386. _key = genKey();
  24387. history.pushState({ key: _key }, '', url);
  24388. }
  24389. } catch (e) {
  24390. window.location[replace ? 'replace' : 'assign'](url);
  24391. }
  24392. }
  24393. function replaceState (url) {
  24394. pushState(url, true);
  24395. }
  24396. /* */
  24397. function runQueue (queue, fn, cb) {
  24398. var step = function (index) {
  24399. if (index >= queue.length) {
  24400. cb();
  24401. } else {
  24402. if (queue[index]) {
  24403. fn(queue[index], function () {
  24404. step(index + 1);
  24405. });
  24406. } else {
  24407. step(index + 1);
  24408. }
  24409. }
  24410. };
  24411. step(0);
  24412. }
  24413. /* */
  24414. var History = function History (router, base) {
  24415. this.router = router;
  24416. this.base = normalizeBase(base);
  24417. // start with a route object that stands for "nowhere"
  24418. this.current = START;
  24419. this.pending = null;
  24420. this.ready = false;
  24421. this.readyCbs = [];
  24422. };
  24423. History.prototype.listen = function listen (cb) {
  24424. this.cb = cb;
  24425. };
  24426. History.prototype.onReady = function onReady (cb) {
  24427. if (this.ready) {
  24428. cb();
  24429. } else {
  24430. this.readyCbs.push(cb);
  24431. }
  24432. };
  24433. History.prototype.transitionTo = function transitionTo (location, onComplete, onAbort) {
  24434. var this$1 = this;
  24435. var route = this.router.match(location, this.current);
  24436. this.confirmTransition(route, function () {
  24437. this$1.updateRoute(route);
  24438. onComplete && onComplete(route);
  24439. this$1.ensureURL();
  24440. // fire ready cbs once
  24441. if (!this$1.ready) {
  24442. this$1.ready = true;
  24443. this$1.readyCbs.forEach(function (cb) {
  24444. cb(route);
  24445. });
  24446. }
  24447. }, onAbort);
  24448. };
  24449. History.prototype.confirmTransition = function confirmTransition (route, onComplete, onAbort) {
  24450. var this$1 = this;
  24451. var current = this.current;
  24452. var abort = function () { onAbort && onAbort(); };
  24453. if (
  24454. isSameRoute(route, current) &&
  24455. // in the case the route map has been dynamically appended to
  24456. route.matched.length === current.matched.length
  24457. ) {
  24458. this.ensureURL();
  24459. return abort()
  24460. }
  24461. var ref = resolveQueue(this.current.matched, route.matched);
  24462. var updated = ref.updated;
  24463. var deactivated = ref.deactivated;
  24464. var activated = ref.activated;
  24465. var queue = [].concat(
  24466. // in-component leave guards
  24467. extractLeaveGuards(deactivated),
  24468. // global before hooks
  24469. this.router.beforeHooks,
  24470. // in-component update hooks
  24471. extractUpdateHooks(updated),
  24472. // in-config enter guards
  24473. activated.map(function (m) { return m.beforeEnter; }),
  24474. // async components
  24475. resolveAsyncComponents(activated)
  24476. );
  24477. this.pending = route;
  24478. var iterator = function (hook, next) {
  24479. if (this$1.pending !== route) {
  24480. return abort()
  24481. }
  24482. hook(route, current, function (to) {
  24483. if (to === false) {
  24484. // next(false) -> abort navigation, ensure current URL
  24485. this$1.ensureURL(true);
  24486. abort();
  24487. } else if (typeof to === 'string' || typeof to === 'object') {
  24488. // next('/') or next({ path: '/' }) -> redirect
  24489. (typeof to === 'object' && to.replace) ? this$1.replace(to) : this$1.push(to);
  24490. abort();
  24491. } else {
  24492. // confirm transition and pass on the value
  24493. next(to);
  24494. }
  24495. });
  24496. };
  24497. runQueue(queue, iterator, function () {
  24498. var postEnterCbs = [];
  24499. var isValid = function () { return this$1.current === route; };
  24500. var enterGuards = extractEnterGuards(activated, postEnterCbs, isValid);
  24501. // wait until async components are resolved before
  24502. // extracting in-component enter guards
  24503. runQueue(enterGuards, iterator, function () {
  24504. if (this$1.pending !== route) {
  24505. return abort()
  24506. }
  24507. this$1.pending = null;
  24508. onComplete(route);
  24509. if (this$1.router.app) {
  24510. this$1.router.app.$nextTick(function () {
  24511. postEnterCbs.forEach(function (cb) { return cb(); });
  24512. });
  24513. }
  24514. });
  24515. });
  24516. };
  24517. History.prototype.updateRoute = function updateRoute (route) {
  24518. var prev = this.current;
  24519. this.current = route;
  24520. this.cb && this.cb(route);
  24521. this.router.afterHooks.forEach(function (hook) {
  24522. hook && hook(route, prev);
  24523. });
  24524. };
  24525. function normalizeBase (base) {
  24526. if (!base) {
  24527. if (inBrowser) {
  24528. // respect <base> tag
  24529. var baseEl = document.querySelector('base');
  24530. base = baseEl ? baseEl.getAttribute('href') : '/';
  24531. } else {
  24532. base = '/';
  24533. }
  24534. }
  24535. // make sure there's the starting slash
  24536. if (base.charAt(0) !== '/') {
  24537. base = '/' + base;
  24538. }
  24539. // remove trailing slash
  24540. return base.replace(/\/$/, '')
  24541. }
  24542. function resolveQueue (
  24543. current,
  24544. next
  24545. ) {
  24546. var i;
  24547. var max = Math.max(current.length, next.length);
  24548. for (i = 0; i < max; i++) {
  24549. if (current[i] !== next[i]) {
  24550. break
  24551. }
  24552. }
  24553. return {
  24554. updated: next.slice(0, i),
  24555. activated: next.slice(i),
  24556. deactivated: current.slice(i)
  24557. }
  24558. }
  24559. function extractGuards (
  24560. records,
  24561. name,
  24562. bind,
  24563. reverse
  24564. ) {
  24565. var guards = flatMapComponents(records, function (def, instance, match, key) {
  24566. var guard = extractGuard(def, name);
  24567. if (guard) {
  24568. return Array.isArray(guard)
  24569. ? guard.map(function (guard) { return bind(guard, instance, match, key); })
  24570. : bind(guard, instance, match, key)
  24571. }
  24572. });
  24573. return flatten(reverse ? guards.reverse() : guards)
  24574. }
  24575. function extractGuard (
  24576. def,
  24577. key
  24578. ) {
  24579. if (typeof def !== 'function') {
  24580. // extend now so that global mixins are applied.
  24581. def = _Vue.extend(def);
  24582. }
  24583. return def.options[key]
  24584. }
  24585. function extractLeaveGuards (deactivated) {
  24586. return extractGuards(deactivated, 'beforeRouteLeave', bindGuard, true)
  24587. }
  24588. function extractUpdateHooks (updated) {
  24589. return extractGuards(updated, 'beforeRouteUpdate', bindGuard)
  24590. }
  24591. function bindGuard (guard, instance) {
  24592. return function boundRouteGuard () {
  24593. return guard.apply(instance, arguments)
  24594. }
  24595. }
  24596. function extractEnterGuards (
  24597. activated,
  24598. cbs,
  24599. isValid
  24600. ) {
  24601. return extractGuards(activated, 'beforeRouteEnter', function (guard, _, match, key) {
  24602. return bindEnterGuard(guard, match, key, cbs, isValid)
  24603. })
  24604. }
  24605. function bindEnterGuard (
  24606. guard,
  24607. match,
  24608. key,
  24609. cbs,
  24610. isValid
  24611. ) {
  24612. return function routeEnterGuard (to, from, next) {
  24613. return guard(to, from, function (cb) {
  24614. next(cb);
  24615. if (typeof cb === 'function') {
  24616. cbs.push(function () {
  24617. // #750
  24618. // if a router-view is wrapped with an out-in transition,
  24619. // the instance may not have been registered at this time.
  24620. // we will need to poll for registration until current route
  24621. // is no longer valid.
  24622. poll(cb, match.instances, key, isValid);
  24623. });
  24624. }
  24625. })
  24626. }
  24627. }
  24628. function poll (
  24629. cb, // somehow flow cannot infer this is a function
  24630. instances,
  24631. key,
  24632. isValid
  24633. ) {
  24634. if (instances[key]) {
  24635. cb(instances[key]);
  24636. } else if (isValid()) {
  24637. setTimeout(function () {
  24638. poll(cb, instances, key, isValid);
  24639. }, 16);
  24640. }
  24641. }
  24642. function resolveAsyncComponents (matched) {
  24643. return flatMapComponents(matched, function (def, _, match, key) {
  24644. // if it's a function and doesn't have Vue options attached,
  24645. // assume it's an async component resolve function.
  24646. // we are not using Vue's default async resolving mechanism because
  24647. // we want to halt the navigation until the incoming component has been
  24648. // resolved.
  24649. if (typeof def === 'function' && !def.options) {
  24650. return function (to, from, next) {
  24651. var resolve = once(function (resolvedDef) {
  24652. match.components[key] = resolvedDef;
  24653. next();
  24654. });
  24655. var reject = once(function (reason) {
  24656. warn(false, ("Failed to resolve async component " + key + ": " + reason));
  24657. next(false);
  24658. });
  24659. var res = def(resolve, reject);
  24660. if (res && typeof res.then === 'function') {
  24661. res.then(resolve, reject);
  24662. }
  24663. }
  24664. }
  24665. })
  24666. }
  24667. function flatMapComponents (
  24668. matched,
  24669. fn
  24670. ) {
  24671. return flatten(matched.map(function (m) {
  24672. return Object.keys(m.components).map(function (key) { return fn(
  24673. m.components[key],
  24674. m.instances[key],
  24675. m, key
  24676. ); })
  24677. }))
  24678. }
  24679. function flatten (arr) {
  24680. return Array.prototype.concat.apply([], arr)
  24681. }
  24682. // in Webpack 2, require.ensure now also returns a Promise
  24683. // so the resolve/reject functions may get called an extra time
  24684. // if the user uses an arrow function shorthand that happens to
  24685. // return that Promise.
  24686. function once (fn) {
  24687. var called = false;
  24688. return function () {
  24689. if (called) { return }
  24690. called = true;
  24691. return fn.apply(this, arguments)
  24692. }
  24693. }
  24694. /* */
  24695. var HTML5History = (function (History$$1) {
  24696. function HTML5History (router, base) {
  24697. var this$1 = this;
  24698. History$$1.call(this, router, base);
  24699. var expectScroll = router.options.scrollBehavior;
  24700. if (expectScroll) {
  24701. setupScroll();
  24702. }
  24703. window.addEventListener('popstate', function (e) {
  24704. this$1.transitionTo(getLocation(this$1.base), function (route) {
  24705. if (expectScroll) {
  24706. handleScroll(router, route, this$1.current, true);
  24707. }
  24708. });
  24709. });
  24710. }
  24711. if ( History$$1 ) HTML5History.__proto__ = History$$1;
  24712. HTML5History.prototype = Object.create( History$$1 && History$$1.prototype );
  24713. HTML5History.prototype.constructor = HTML5History;
  24714. HTML5History.prototype.go = function go (n) {
  24715. window.history.go(n);
  24716. };
  24717. HTML5History.prototype.push = function push (location, onComplete, onAbort) {
  24718. var this$1 = this;
  24719. this.transitionTo(location, function (route) {
  24720. pushState(cleanPath(this$1.base + route.fullPath));
  24721. handleScroll(this$1.router, route, this$1.current, false);
  24722. onComplete && onComplete(route);
  24723. }, onAbort);
  24724. };
  24725. HTML5History.prototype.replace = function replace (location, onComplete, onAbort) {
  24726. var this$1 = this;
  24727. this.transitionTo(location, function (route) {
  24728. replaceState(cleanPath(this$1.base + route.fullPath));
  24729. handleScroll(this$1.router, route, this$1.current, false);
  24730. onComplete && onComplete(route);
  24731. }, onAbort);
  24732. };
  24733. HTML5History.prototype.ensureURL = function ensureURL (push) {
  24734. if (getLocation(this.base) !== this.current.fullPath) {
  24735. var current = cleanPath(this.base + this.current.fullPath);
  24736. push ? pushState(current) : replaceState(current);
  24737. }
  24738. };
  24739. HTML5History.prototype.getCurrentLocation = function getCurrentLocation () {
  24740. return getLocation(this.base)
  24741. };
  24742. return HTML5History;
  24743. }(History));
  24744. function getLocation (base) {
  24745. var path = window.location.pathname;
  24746. if (base && path.indexOf(base) === 0) {
  24747. path = path.slice(base.length);
  24748. }
  24749. return (path || '/') + window.location.search + window.location.hash
  24750. }
  24751. /* */
  24752. var HashHistory = (function (History$$1) {
  24753. function HashHistory (router, base, fallback) {
  24754. History$$1.call(this, router, base);
  24755. // check history fallback deeplinking
  24756. if (fallback && checkFallback(this.base)) {
  24757. return
  24758. }
  24759. ensureSlash();
  24760. }
  24761. if ( History$$1 ) HashHistory.__proto__ = History$$1;
  24762. HashHistory.prototype = Object.create( History$$1 && History$$1.prototype );
  24763. HashHistory.prototype.constructor = HashHistory;
  24764. // this is delayed until the app mounts
  24765. // to avoid the hashchange listener being fired too early
  24766. HashHistory.prototype.setupListeners = function setupListeners () {
  24767. var this$1 = this;
  24768. window.addEventListener('hashchange', function () {
  24769. if (!ensureSlash()) {
  24770. return
  24771. }
  24772. this$1.transitionTo(getHash(), function (route) {
  24773. replaceHash(route.fullPath);
  24774. });
  24775. });
  24776. };
  24777. HashHistory.prototype.push = function push (location, onComplete, onAbort) {
  24778. this.transitionTo(location, function (route) {
  24779. pushHash(route.fullPath);
  24780. onComplete && onComplete(route);
  24781. }, onAbort);
  24782. };
  24783. HashHistory.prototype.replace = function replace (location, onComplete, onAbort) {
  24784. this.transitionTo(location, function (route) {
  24785. replaceHash(route.fullPath);
  24786. onComplete && onComplete(route);
  24787. }, onAbort);
  24788. };
  24789. HashHistory.prototype.go = function go (n) {
  24790. window.history.go(n);
  24791. };
  24792. HashHistory.prototype.ensureURL = function ensureURL (push) {
  24793. var current = this.current.fullPath;
  24794. if (getHash() !== current) {
  24795. push ? pushHash(current) : replaceHash(current);
  24796. }
  24797. };
  24798. HashHistory.prototype.getCurrentLocation = function getCurrentLocation () {
  24799. return getHash()
  24800. };
  24801. return HashHistory;
  24802. }(History));
  24803. function checkFallback (base) {
  24804. var location = getLocation(base);
  24805. if (!/^\/#/.test(location)) {
  24806. window.location.replace(
  24807. cleanPath(base + '/#' + location)
  24808. );
  24809. return true
  24810. }
  24811. }
  24812. function ensureSlash () {
  24813. var path = getHash();
  24814. if (path.charAt(0) === '/') {
  24815. return true
  24816. }
  24817. replaceHash('/' + path);
  24818. return false
  24819. }
  24820. function getHash () {
  24821. // We can't use window.location.hash here because it's not
  24822. // consistent across browsers - Firefox will pre-decode it!
  24823. var href = window.location.href;
  24824. var index = href.indexOf('#');
  24825. return index === -1 ? '' : href.slice(index + 1)
  24826. }
  24827. function pushHash (path) {
  24828. window.location.hash = path;
  24829. }
  24830. function replaceHash (path) {
  24831. var i = window.location.href.indexOf('#');
  24832. window.location.replace(
  24833. window.location.href.slice(0, i >= 0 ? i : 0) + '#' + path
  24834. );
  24835. }
  24836. /* */
  24837. var AbstractHistory = (function (History$$1) {
  24838. function AbstractHistory (router, base) {
  24839. History$$1.call(this, router, base);
  24840. this.stack = [];
  24841. this.index = -1;
  24842. }
  24843. if ( History$$1 ) AbstractHistory.__proto__ = History$$1;
  24844. AbstractHistory.prototype = Object.create( History$$1 && History$$1.prototype );
  24845. AbstractHistory.prototype.constructor = AbstractHistory;
  24846. AbstractHistory.prototype.push = function push (location, onComplete, onAbort) {
  24847. var this$1 = this;
  24848. this.transitionTo(location, function (route) {
  24849. this$1.stack = this$1.stack.slice(0, this$1.index + 1).concat(route);
  24850. this$1.index++;
  24851. onComplete && onComplete(route);
  24852. }, onAbort);
  24853. };
  24854. AbstractHistory.prototype.replace = function replace (location, onComplete, onAbort) {
  24855. var this$1 = this;
  24856. this.transitionTo(location, function (route) {
  24857. this$1.stack = this$1.stack.slice(0, this$1.index).concat(route);
  24858. onComplete && onComplete(route);
  24859. }, onAbort);
  24860. };
  24861. AbstractHistory.prototype.go = function go (n) {
  24862. var this$1 = this;
  24863. var targetIndex = this.index + n;
  24864. if (targetIndex < 0 || targetIndex >= this.stack.length) {
  24865. return
  24866. }
  24867. var route = this.stack[targetIndex];
  24868. this.confirmTransition(route, function () {
  24869. this$1.index = targetIndex;
  24870. this$1.updateRoute(route);
  24871. });
  24872. };
  24873. AbstractHistory.prototype.getCurrentLocation = function getCurrentLocation () {
  24874. var current = this.stack[this.stack.length - 1];
  24875. return current ? current.fullPath : '/'
  24876. };
  24877. AbstractHistory.prototype.ensureURL = function ensureURL () {
  24878. // noop
  24879. };
  24880. return AbstractHistory;
  24881. }(History));
  24882. /* */
  24883. var VueRouter = function VueRouter (options) {
  24884. if ( options === void 0 ) options = {};
  24885. this.app = null;
  24886. this.apps = [];
  24887. this.options = options;
  24888. this.beforeHooks = [];
  24889. this.afterHooks = [];
  24890. this.matcher = createMatcher(options.routes || []);
  24891. var mode = options.mode || 'hash';
  24892. this.fallback = mode === 'history' && !supportsPushState;
  24893. if (this.fallback) {
  24894. mode = 'hash';
  24895. }
  24896. if (!inBrowser) {
  24897. mode = 'abstract';
  24898. }
  24899. this.mode = mode;
  24900. switch (mode) {
  24901. case 'history':
  24902. this.history = new HTML5History(this, options.base);
  24903. break
  24904. case 'hash':
  24905. this.history = new HashHistory(this, options.base, this.fallback);
  24906. break
  24907. case 'abstract':
  24908. this.history = new AbstractHistory(this, options.base);
  24909. break
  24910. default:
  24911. if (process.env.NODE_ENV !== 'production') {
  24912. assert(false, ("invalid mode: " + mode));
  24913. }
  24914. }
  24915. };
  24916. var prototypeAccessors = { currentRoute: {} };
  24917. VueRouter.prototype.match = function match (
  24918. raw,
  24919. current,
  24920. redirectedFrom
  24921. ) {
  24922. return this.matcher.match(raw, current, redirectedFrom)
  24923. };
  24924. prototypeAccessors.currentRoute.get = function () {
  24925. return this.history && this.history.current
  24926. };
  24927. VueRouter.prototype.init = function init (app /* Vue component instance */) {
  24928. var this$1 = this;
  24929. process.env.NODE_ENV !== 'production' && assert(
  24930. install.installed,
  24931. "not installed. Make sure to call `Vue.use(VueRouter)` " +
  24932. "before creating root instance."
  24933. );
  24934. this.apps.push(app);
  24935. // main app already initialized.
  24936. if (this.app) {
  24937. return
  24938. }
  24939. this.app = app;
  24940. var history = this.history;
  24941. if (history instanceof HTML5History) {
  24942. history.transitionTo(history.getCurrentLocation());
  24943. } else if (history instanceof HashHistory) {
  24944. var setupHashListener = function () {
  24945. history.setupListeners();
  24946. };
  24947. history.transitionTo(
  24948. history.getCurrentLocation(),
  24949. setupHashListener,
  24950. setupHashListener
  24951. );
  24952. }
  24953. history.listen(function (route) {
  24954. this$1.apps.forEach(function (app) {
  24955. app._route = route;
  24956. });
  24957. });
  24958. };
  24959. VueRouter.prototype.beforeEach = function beforeEach (fn) {
  24960. this.beforeHooks.push(fn);
  24961. };
  24962. VueRouter.prototype.afterEach = function afterEach (fn) {
  24963. this.afterHooks.push(fn);
  24964. };
  24965. VueRouter.prototype.onReady = function onReady (cb) {
  24966. this.history.onReady(cb);
  24967. };
  24968. VueRouter.prototype.push = function push (location, onComplete, onAbort) {
  24969. this.history.push(location, onComplete, onAbort);
  24970. };
  24971. VueRouter.prototype.replace = function replace (location, onComplete, onAbort) {
  24972. this.history.replace(location, onComplete, onAbort);
  24973. };
  24974. VueRouter.prototype.go = function go (n) {
  24975. this.history.go(n);
  24976. };
  24977. VueRouter.prototype.back = function back () {
  24978. this.go(-1);
  24979. };
  24980. VueRouter.prototype.forward = function forward () {
  24981. this.go(1);
  24982. };
  24983. VueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {
  24984. var route = to
  24985. ? this.resolve(to).route
  24986. : this.currentRoute;
  24987. if (!route) {
  24988. return []
  24989. }
  24990. return [].concat.apply([], route.matched.map(function (m) {
  24991. return Object.keys(m.components).map(function (key) {
  24992. return m.components[key]
  24993. })
  24994. }))
  24995. };
  24996. VueRouter.prototype.resolve = function resolve (
  24997. to,
  24998. current,
  24999. append
  25000. ) {
  25001. var location = normalizeLocation(to, current || this.history.current, append);
  25002. var route = this.match(location, current);
  25003. var fullPath = route.redirectedFrom || route.fullPath;
  25004. var base = this.history.base;
  25005. var href = createHref(base, fullPath, this.mode);
  25006. return {
  25007. location: location,
  25008. route: route,
  25009. href: href,
  25010. // for backwards compat
  25011. normalizedTo: location,
  25012. resolved: route
  25013. }
  25014. };
  25015. VueRouter.prototype.addRoutes = function addRoutes (routes) {
  25016. this.matcher.addRoutes(routes);
  25017. if (this.history.current !== START) {
  25018. this.history.transitionTo(this.history.getCurrentLocation());
  25019. }
  25020. };
  25021. Object.defineProperties( VueRouter.prototype, prototypeAccessors );
  25022. function createHref (base, fullPath, mode) {
  25023. var path = mode === 'hash' ? '#' + fullPath : fullPath;
  25024. return base ? cleanPath(base + '/' + path) : path
  25025. }
  25026. VueRouter.install = install;
  25027. VueRouter.version = '2.2.1';
  25028. if (inBrowser && window.Vue) {
  25029. window.Vue.use(VueRouter);
  25030. }
  25031. module.exports = VueRouter;
  25032. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(112)))
  25033. /***/ }),
  25034. /* 121 */
  25035. /***/ (function(module, exports, __webpack_require__) {
  25036. "use strict";
  25037. /* WEBPACK VAR INJECTION */(function(process, global) {/*!
  25038. * Vue.js v2.1.10
  25039. * (c) 2014-2017 Evan You
  25040. * Released under the MIT License.
  25041. */
  25042. /* */
  25043. /**
  25044. * Convert a value to a string that is actually rendered.
  25045. */
  25046. function _toString (val) {
  25047. return val == null
  25048. ? ''
  25049. : typeof val === 'object'
  25050. ? JSON.stringify(val, null, 2)
  25051. : String(val)
  25052. }
  25053. /**
  25054. * Convert a input value to a number for persistence.
  25055. * If the conversion fails, return original string.
  25056. */
  25057. function toNumber (val) {
  25058. var n = parseFloat(val);
  25059. return isNaN(n) ? val : n
  25060. }
  25061. /**
  25062. * Make a map and return a function for checking if a key
  25063. * is in that map.
  25064. */
  25065. function makeMap (
  25066. str,
  25067. expectsLowerCase
  25068. ) {
  25069. var map = Object.create(null);
  25070. var list = str.split(',');
  25071. for (var i = 0; i < list.length; i++) {
  25072. map[list[i]] = true;
  25073. }
  25074. return expectsLowerCase
  25075. ? function (val) { return map[val.toLowerCase()]; }
  25076. : function (val) { return map[val]; }
  25077. }
  25078. /**
  25079. * Check if a tag is a built-in tag.
  25080. */
  25081. var isBuiltInTag = makeMap('slot,component', true);
  25082. /**
  25083. * Remove an item from an array
  25084. */
  25085. function remove$1 (arr, item) {
  25086. if (arr.length) {
  25087. var index = arr.indexOf(item);
  25088. if (index > -1) {
  25089. return arr.splice(index, 1)
  25090. }
  25091. }
  25092. }
  25093. /**
  25094. * Check whether the object has the property.
  25095. */
  25096. var hasOwnProperty = Object.prototype.hasOwnProperty;
  25097. function hasOwn (obj, key) {
  25098. return hasOwnProperty.call(obj, key)
  25099. }
  25100. /**
  25101. * Check if value is primitive
  25102. */
  25103. function isPrimitive (value) {
  25104. return typeof value === 'string' || typeof value === 'number'
  25105. }
  25106. /**
  25107. * Create a cached version of a pure function.
  25108. */
  25109. function cached (fn) {
  25110. var cache = Object.create(null);
  25111. return (function cachedFn (str) {
  25112. var hit = cache[str];
  25113. return hit || (cache[str] = fn(str))
  25114. })
  25115. }
  25116. /**
  25117. * Camelize a hyphen-delimited string.
  25118. */
  25119. var camelizeRE = /-(\w)/g;
  25120. var camelize = cached(function (str) {
  25121. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  25122. });
  25123. /**
  25124. * Capitalize a string.
  25125. */
  25126. var capitalize = cached(function (str) {
  25127. return str.charAt(0).toUpperCase() + str.slice(1)
  25128. });
  25129. /**
  25130. * Hyphenate a camelCase string.
  25131. */
  25132. var hyphenateRE = /([^-])([A-Z])/g;
  25133. var hyphenate = cached(function (str) {
  25134. return str
  25135. .replace(hyphenateRE, '$1-$2')
  25136. .replace(hyphenateRE, '$1-$2')
  25137. .toLowerCase()
  25138. });
  25139. /**
  25140. * Simple bind, faster than native
  25141. */
  25142. function bind$1 (fn, ctx) {
  25143. function boundFn (a) {
  25144. var l = arguments.length;
  25145. return l
  25146. ? l > 1
  25147. ? fn.apply(ctx, arguments)
  25148. : fn.call(ctx, a)
  25149. : fn.call(ctx)
  25150. }
  25151. // record original fn length
  25152. boundFn._length = fn.length;
  25153. return boundFn
  25154. }
  25155. /**
  25156. * Convert an Array-like object to a real Array.
  25157. */
  25158. function toArray (list, start) {
  25159. start = start || 0;
  25160. var i = list.length - start;
  25161. var ret = new Array(i);
  25162. while (i--) {
  25163. ret[i] = list[i + start];
  25164. }
  25165. return ret
  25166. }
  25167. /**
  25168. * Mix properties into target object.
  25169. */
  25170. function extend (to, _from) {
  25171. for (var key in _from) {
  25172. to[key] = _from[key];
  25173. }
  25174. return to
  25175. }
  25176. /**
  25177. * Quick object check - this is primarily used to tell
  25178. * Objects from primitive values when we know the value
  25179. * is a JSON-compliant type.
  25180. */
  25181. function isObject (obj) {
  25182. return obj !== null && typeof obj === 'object'
  25183. }
  25184. /**
  25185. * Strict object type check. Only returns true
  25186. * for plain JavaScript objects.
  25187. */
  25188. var toString = Object.prototype.toString;
  25189. var OBJECT_STRING = '[object Object]';
  25190. function isPlainObject (obj) {
  25191. return toString.call(obj) === OBJECT_STRING
  25192. }
  25193. /**
  25194. * Merge an Array of Objects into a single Object.
  25195. */
  25196. function toObject (arr) {
  25197. var res = {};
  25198. for (var i = 0; i < arr.length; i++) {
  25199. if (arr[i]) {
  25200. extend(res, arr[i]);
  25201. }
  25202. }
  25203. return res
  25204. }
  25205. /**
  25206. * Perform no operation.
  25207. */
  25208. function noop () {}
  25209. /**
  25210. * Always return false.
  25211. */
  25212. var no = function () { return false; };
  25213. /**
  25214. * Return same value
  25215. */
  25216. var identity = function (_) { return _; };
  25217. /**
  25218. * Generate a static keys string from compiler modules.
  25219. */
  25220. function genStaticKeys (modules) {
  25221. return modules.reduce(function (keys, m) {
  25222. return keys.concat(m.staticKeys || [])
  25223. }, []).join(',')
  25224. }
  25225. /**
  25226. * Check if two values are loosely equal - that is,
  25227. * if they are plain objects, do they have the same shape?
  25228. */
  25229. function looseEqual (a, b) {
  25230. var isObjectA = isObject(a);
  25231. var isObjectB = isObject(b);
  25232. if (isObjectA && isObjectB) {
  25233. return JSON.stringify(a) === JSON.stringify(b)
  25234. } else if (!isObjectA && !isObjectB) {
  25235. return String(a) === String(b)
  25236. } else {
  25237. return false
  25238. }
  25239. }
  25240. function looseIndexOf (arr, val) {
  25241. for (var i = 0; i < arr.length; i++) {
  25242. if (looseEqual(arr[i], val)) { return i }
  25243. }
  25244. return -1
  25245. }
  25246. /* */
  25247. var config = {
  25248. /**
  25249. * Option merge strategies (used in core/util/options)
  25250. */
  25251. optionMergeStrategies: Object.create(null),
  25252. /**
  25253. * Whether to suppress warnings.
  25254. */
  25255. silent: false,
  25256. /**
  25257. * Whether to enable devtools
  25258. */
  25259. devtools: process.env.NODE_ENV !== 'production',
  25260. /**
  25261. * Error handler for watcher errors
  25262. */
  25263. errorHandler: null,
  25264. /**
  25265. * Ignore certain custom elements
  25266. */
  25267. ignoredElements: [],
  25268. /**
  25269. * Custom user key aliases for v-on
  25270. */
  25271. keyCodes: Object.create(null),
  25272. /**
  25273. * Check if a tag is reserved so that it cannot be registered as a
  25274. * component. This is platform-dependent and may be overwritten.
  25275. */
  25276. isReservedTag: no,
  25277. /**
  25278. * Check if a tag is an unknown element.
  25279. * Platform-dependent.
  25280. */
  25281. isUnknownElement: no,
  25282. /**
  25283. * Get the namespace of an element
  25284. */
  25285. getTagNamespace: noop,
  25286. /**
  25287. * Parse the real tag name for the specific platform.
  25288. */
  25289. parsePlatformTagName: identity,
  25290. /**
  25291. * Check if an attribute must be bound using property, e.g. value
  25292. * Platform-dependent.
  25293. */
  25294. mustUseProp: no,
  25295. /**
  25296. * List of asset types that a component can own.
  25297. */
  25298. _assetTypes: [
  25299. 'component',
  25300. 'directive',
  25301. 'filter'
  25302. ],
  25303. /**
  25304. * List of lifecycle hooks.
  25305. */
  25306. _lifecycleHooks: [
  25307. 'beforeCreate',
  25308. 'created',
  25309. 'beforeMount',
  25310. 'mounted',
  25311. 'beforeUpdate',
  25312. 'updated',
  25313. 'beforeDestroy',
  25314. 'destroyed',
  25315. 'activated',
  25316. 'deactivated'
  25317. ],
  25318. /**
  25319. * Max circular updates allowed in a scheduler flush cycle.
  25320. */
  25321. _maxUpdateCount: 100
  25322. };
  25323. /* */
  25324. /**
  25325. * Check if a string starts with $ or _
  25326. */
  25327. function isReserved (str) {
  25328. var c = (str + '').charCodeAt(0);
  25329. return c === 0x24 || c === 0x5F
  25330. }
  25331. /**
  25332. * Define a property.
  25333. */
  25334. function def (obj, key, val, enumerable) {
  25335. Object.defineProperty(obj, key, {
  25336. value: val,
  25337. enumerable: !!enumerable,
  25338. writable: true,
  25339. configurable: true
  25340. });
  25341. }
  25342. /**
  25343. * Parse simple path.
  25344. */
  25345. var bailRE = /[^\w.$]/;
  25346. function parsePath (path) {
  25347. if (bailRE.test(path)) {
  25348. return
  25349. } else {
  25350. var segments = path.split('.');
  25351. return function (obj) {
  25352. for (var i = 0; i < segments.length; i++) {
  25353. if (!obj) { return }
  25354. obj = obj[segments[i]];
  25355. }
  25356. return obj
  25357. }
  25358. }
  25359. }
  25360. /* */
  25361. /* globals MutationObserver */
  25362. // can we use __proto__?
  25363. var hasProto = '__proto__' in {};
  25364. // Browser environment sniffing
  25365. var inBrowser = typeof window !== 'undefined';
  25366. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  25367. var isIE = UA && /msie|trident/.test(UA);
  25368. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  25369. var isEdge = UA && UA.indexOf('edge/') > 0;
  25370. var isAndroid = UA && UA.indexOf('android') > 0;
  25371. var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
  25372. // this needs to be lazy-evaled because vue may be required before
  25373. // vue-server-renderer can set VUE_ENV
  25374. var _isServer;
  25375. var isServerRendering = function () {
  25376. if (_isServer === undefined) {
  25377. /* istanbul ignore if */
  25378. if (!inBrowser && typeof global !== 'undefined') {
  25379. // detect presence of vue-server-renderer and avoid
  25380. // Webpack shimming the process
  25381. _isServer = global['process'].env.VUE_ENV === 'server';
  25382. } else {
  25383. _isServer = false;
  25384. }
  25385. }
  25386. return _isServer
  25387. };
  25388. // detect devtools
  25389. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  25390. /* istanbul ignore next */
  25391. function isNative (Ctor) {
  25392. return /native code/.test(Ctor.toString())
  25393. }
  25394. /**
  25395. * Defer a task to execute it asynchronously.
  25396. */
  25397. var nextTick = (function () {
  25398. var callbacks = [];
  25399. var pending = false;
  25400. var timerFunc;
  25401. function nextTickHandler () {
  25402. pending = false;
  25403. var copies = callbacks.slice(0);
  25404. callbacks.length = 0;
  25405. for (var i = 0; i < copies.length; i++) {
  25406. copies[i]();
  25407. }
  25408. }
  25409. // the nextTick behavior leverages the microtask queue, which can be accessed
  25410. // via either native Promise.then or MutationObserver.
  25411. // MutationObserver has wider support, however it is seriously bugged in
  25412. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  25413. // completely stops working after triggering a few times... so, if native
  25414. // Promise is available, we will use it:
  25415. /* istanbul ignore if */
  25416. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  25417. var p = Promise.resolve();
  25418. var logError = function (err) { console.error(err); };
  25419. timerFunc = function () {
  25420. p.then(nextTickHandler).catch(logError);
  25421. // in problematic UIWebViews, Promise.then doesn't completely break, but
  25422. // it can get stuck in a weird state where callbacks are pushed into the
  25423. // microtask queue but the queue isn't being flushed, until the browser
  25424. // needs to do some other work, e.g. handle a timer. Therefore we can
  25425. // "force" the microtask queue to be flushed by adding an empty timer.
  25426. if (isIOS) { setTimeout(noop); }
  25427. };
  25428. } else if (typeof MutationObserver !== 'undefined' && (
  25429. isNative(MutationObserver) ||
  25430. // PhantomJS and iOS 7.x
  25431. MutationObserver.toString() === '[object MutationObserverConstructor]'
  25432. )) {
  25433. // use MutationObserver where native Promise is not available,
  25434. // e.g. PhantomJS IE11, iOS7, Android 4.4
  25435. var counter = 1;
  25436. var observer = new MutationObserver(nextTickHandler);
  25437. var textNode = document.createTextNode(String(counter));
  25438. observer.observe(textNode, {
  25439. characterData: true
  25440. });
  25441. timerFunc = function () {
  25442. counter = (counter + 1) % 2;
  25443. textNode.data = String(counter);
  25444. };
  25445. } else {
  25446. // fallback to setTimeout
  25447. /* istanbul ignore next */
  25448. timerFunc = function () {
  25449. setTimeout(nextTickHandler, 0);
  25450. };
  25451. }
  25452. return function queueNextTick (cb, ctx) {
  25453. var _resolve;
  25454. callbacks.push(function () {
  25455. if (cb) { cb.call(ctx); }
  25456. if (_resolve) { _resolve(ctx); }
  25457. });
  25458. if (!pending) {
  25459. pending = true;
  25460. timerFunc();
  25461. }
  25462. if (!cb && typeof Promise !== 'undefined') {
  25463. return new Promise(function (resolve) {
  25464. _resolve = resolve;
  25465. })
  25466. }
  25467. }
  25468. })();
  25469. var _Set;
  25470. /* istanbul ignore if */
  25471. if (typeof Set !== 'undefined' && isNative(Set)) {
  25472. // use native Set when available.
  25473. _Set = Set;
  25474. } else {
  25475. // a non-standard Set polyfill that only works with primitive keys.
  25476. _Set = (function () {
  25477. function Set () {
  25478. this.set = Object.create(null);
  25479. }
  25480. Set.prototype.has = function has (key) {
  25481. return this.set[key] === true
  25482. };
  25483. Set.prototype.add = function add (key) {
  25484. this.set[key] = true;
  25485. };
  25486. Set.prototype.clear = function clear () {
  25487. this.set = Object.create(null);
  25488. };
  25489. return Set;
  25490. }());
  25491. }
  25492. var warn = noop;
  25493. var formatComponentName;
  25494. if (process.env.NODE_ENV !== 'production') {
  25495. var hasConsole = typeof console !== 'undefined';
  25496. warn = function (msg, vm) {
  25497. if (hasConsole && (!config.silent)) {
  25498. console.error("[Vue warn]: " + msg + " " + (
  25499. vm ? formatLocation(formatComponentName(vm)) : ''
  25500. ));
  25501. }
  25502. };
  25503. formatComponentName = function (vm) {
  25504. if (vm.$root === vm) {
  25505. return 'root instance'
  25506. }
  25507. var name = vm._isVue
  25508. ? vm.$options.name || vm.$options._componentTag
  25509. : vm.name;
  25510. return (
  25511. (name ? ("component <" + name + ">") : "anonymous component") +
  25512. (vm._isVue && vm.$options.__file ? (" at " + (vm.$options.__file)) : '')
  25513. )
  25514. };
  25515. var formatLocation = function (str) {
  25516. if (str === 'anonymous component') {
  25517. str += " - use the \"name\" option for better debugging messages.";
  25518. }
  25519. return ("\n(found in " + str + ")")
  25520. };
  25521. }
  25522. /* */
  25523. var uid$1 = 0;
  25524. /**
  25525. * A dep is an observable that can have multiple
  25526. * directives subscribing to it.
  25527. */
  25528. var Dep = function Dep () {
  25529. this.id = uid$1++;
  25530. this.subs = [];
  25531. };
  25532. Dep.prototype.addSub = function addSub (sub) {
  25533. this.subs.push(sub);
  25534. };
  25535. Dep.prototype.removeSub = function removeSub (sub) {
  25536. remove$1(this.subs, sub);
  25537. };
  25538. Dep.prototype.depend = function depend () {
  25539. if (Dep.target) {
  25540. Dep.target.addDep(this);
  25541. }
  25542. };
  25543. Dep.prototype.notify = function notify () {
  25544. // stablize the subscriber list first
  25545. var subs = this.subs.slice();
  25546. for (var i = 0, l = subs.length; i < l; i++) {
  25547. subs[i].update();
  25548. }
  25549. };
  25550. // the current target watcher being evaluated.
  25551. // this is globally unique because there could be only one
  25552. // watcher being evaluated at any time.
  25553. Dep.target = null;
  25554. var targetStack = [];
  25555. function pushTarget (_target) {
  25556. if (Dep.target) { targetStack.push(Dep.target); }
  25557. Dep.target = _target;
  25558. }
  25559. function popTarget () {
  25560. Dep.target = targetStack.pop();
  25561. }
  25562. /*
  25563. * not type checking this file because flow doesn't play well with
  25564. * dynamically accessing methods on Array prototype
  25565. */
  25566. var arrayProto = Array.prototype;
  25567. var arrayMethods = Object.create(arrayProto);[
  25568. 'push',
  25569. 'pop',
  25570. 'shift',
  25571. 'unshift',
  25572. 'splice',
  25573. 'sort',
  25574. 'reverse'
  25575. ]
  25576. .forEach(function (method) {
  25577. // cache original method
  25578. var original = arrayProto[method];
  25579. def(arrayMethods, method, function mutator () {
  25580. var arguments$1 = arguments;
  25581. // avoid leaking arguments:
  25582. // http://jsperf.com/closure-with-arguments
  25583. var i = arguments.length;
  25584. var args = new Array(i);
  25585. while (i--) {
  25586. args[i] = arguments$1[i];
  25587. }
  25588. var result = original.apply(this, args);
  25589. var ob = this.__ob__;
  25590. var inserted;
  25591. switch (method) {
  25592. case 'push':
  25593. inserted = args;
  25594. break
  25595. case 'unshift':
  25596. inserted = args;
  25597. break
  25598. case 'splice':
  25599. inserted = args.slice(2);
  25600. break
  25601. }
  25602. if (inserted) { ob.observeArray(inserted); }
  25603. // notify change
  25604. ob.dep.notify();
  25605. return result
  25606. });
  25607. });
  25608. /* */
  25609. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  25610. /**
  25611. * By default, when a reactive property is set, the new value is
  25612. * also converted to become reactive. However when passing down props,
  25613. * we don't want to force conversion because the value may be a nested value
  25614. * under a frozen data structure. Converting it would defeat the optimization.
  25615. */
  25616. var observerState = {
  25617. shouldConvert: true,
  25618. isSettingProps: false
  25619. };
  25620. /**
  25621. * Observer class that are attached to each observed
  25622. * object. Once attached, the observer converts target
  25623. * object's property keys into getter/setters that
  25624. * collect dependencies and dispatches updates.
  25625. */
  25626. var Observer = function Observer (value) {
  25627. this.value = value;
  25628. this.dep = new Dep();
  25629. this.vmCount = 0;
  25630. def(value, '__ob__', this);
  25631. if (Array.isArray(value)) {
  25632. var augment = hasProto
  25633. ? protoAugment
  25634. : copyAugment;
  25635. augment(value, arrayMethods, arrayKeys);
  25636. this.observeArray(value);
  25637. } else {
  25638. this.walk(value);
  25639. }
  25640. };
  25641. /**
  25642. * Walk through each property and convert them into
  25643. * getter/setters. This method should only be called when
  25644. * value type is Object.
  25645. */
  25646. Observer.prototype.walk = function walk (obj) {
  25647. var keys = Object.keys(obj);
  25648. for (var i = 0; i < keys.length; i++) {
  25649. defineReactive$$1(obj, keys[i], obj[keys[i]]);
  25650. }
  25651. };
  25652. /**
  25653. * Observe a list of Array items.
  25654. */
  25655. Observer.prototype.observeArray = function observeArray (items) {
  25656. for (var i = 0, l = items.length; i < l; i++) {
  25657. observe(items[i]);
  25658. }
  25659. };
  25660. // helpers
  25661. /**
  25662. * Augment an target Object or Array by intercepting
  25663. * the prototype chain using __proto__
  25664. */
  25665. function protoAugment (target, src) {
  25666. /* eslint-disable no-proto */
  25667. target.__proto__ = src;
  25668. /* eslint-enable no-proto */
  25669. }
  25670. /**
  25671. * Augment an target Object or Array by defining
  25672. * hidden properties.
  25673. */
  25674. /* istanbul ignore next */
  25675. function copyAugment (target, src, keys) {
  25676. for (var i = 0, l = keys.length; i < l; i++) {
  25677. var key = keys[i];
  25678. def(target, key, src[key]);
  25679. }
  25680. }
  25681. /**
  25682. * Attempt to create an observer instance for a value,
  25683. * returns the new observer if successfully observed,
  25684. * or the existing observer if the value already has one.
  25685. */
  25686. function observe (value, asRootData) {
  25687. if (!isObject(value)) {
  25688. return
  25689. }
  25690. var ob;
  25691. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  25692. ob = value.__ob__;
  25693. } else if (
  25694. observerState.shouldConvert &&
  25695. !isServerRendering() &&
  25696. (Array.isArray(value) || isPlainObject(value)) &&
  25697. Object.isExtensible(value) &&
  25698. !value._isVue
  25699. ) {
  25700. ob = new Observer(value);
  25701. }
  25702. if (asRootData && ob) {
  25703. ob.vmCount++;
  25704. }
  25705. return ob
  25706. }
  25707. /**
  25708. * Define a reactive property on an Object.
  25709. */
  25710. function defineReactive$$1 (
  25711. obj,
  25712. key,
  25713. val,
  25714. customSetter
  25715. ) {
  25716. var dep = new Dep();
  25717. var property = Object.getOwnPropertyDescriptor(obj, key);
  25718. if (property && property.configurable === false) {
  25719. return
  25720. }
  25721. // cater for pre-defined getter/setters
  25722. var getter = property && property.get;
  25723. var setter = property && property.set;
  25724. var childOb = observe(val);
  25725. Object.defineProperty(obj, key, {
  25726. enumerable: true,
  25727. configurable: true,
  25728. get: function reactiveGetter () {
  25729. var value = getter ? getter.call(obj) : val;
  25730. if (Dep.target) {
  25731. dep.depend();
  25732. if (childOb) {
  25733. childOb.dep.depend();
  25734. }
  25735. if (Array.isArray(value)) {
  25736. dependArray(value);
  25737. }
  25738. }
  25739. return value
  25740. },
  25741. set: function reactiveSetter (newVal) {
  25742. var value = getter ? getter.call(obj) : val;
  25743. /* eslint-disable no-self-compare */
  25744. if (newVal === value || (newVal !== newVal && value !== value)) {
  25745. return
  25746. }
  25747. /* eslint-enable no-self-compare */
  25748. if (process.env.NODE_ENV !== 'production' && customSetter) {
  25749. customSetter();
  25750. }
  25751. if (setter) {
  25752. setter.call(obj, newVal);
  25753. } else {
  25754. val = newVal;
  25755. }
  25756. childOb = observe(newVal);
  25757. dep.notify();
  25758. }
  25759. });
  25760. }
  25761. /**
  25762. * Set a property on an object. Adds the new property and
  25763. * triggers change notification if the property doesn't
  25764. * already exist.
  25765. */
  25766. function set$1 (obj, key, val) {
  25767. if (Array.isArray(obj)) {
  25768. obj.length = Math.max(obj.length, key);
  25769. obj.splice(key, 1, val);
  25770. return val
  25771. }
  25772. if (hasOwn(obj, key)) {
  25773. obj[key] = val;
  25774. return
  25775. }
  25776. var ob = obj.__ob__;
  25777. if (obj._isVue || (ob && ob.vmCount)) {
  25778. process.env.NODE_ENV !== 'production' && warn(
  25779. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  25780. 'at runtime - declare it upfront in the data option.'
  25781. );
  25782. return
  25783. }
  25784. if (!ob) {
  25785. obj[key] = val;
  25786. return
  25787. }
  25788. defineReactive$$1(ob.value, key, val);
  25789. ob.dep.notify();
  25790. return val
  25791. }
  25792. /**
  25793. * Delete a property and trigger change if necessary.
  25794. */
  25795. function del (obj, key) {
  25796. var ob = obj.__ob__;
  25797. if (obj._isVue || (ob && ob.vmCount)) {
  25798. process.env.NODE_ENV !== 'production' && warn(
  25799. 'Avoid deleting properties on a Vue instance or its root $data ' +
  25800. '- just set it to null.'
  25801. );
  25802. return
  25803. }
  25804. if (!hasOwn(obj, key)) {
  25805. return
  25806. }
  25807. delete obj[key];
  25808. if (!ob) {
  25809. return
  25810. }
  25811. ob.dep.notify();
  25812. }
  25813. /**
  25814. * Collect dependencies on array elements when the array is touched, since
  25815. * we cannot intercept array element access like property getters.
  25816. */
  25817. function dependArray (value) {
  25818. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  25819. e = value[i];
  25820. e && e.__ob__ && e.__ob__.dep.depend();
  25821. if (Array.isArray(e)) {
  25822. dependArray(e);
  25823. }
  25824. }
  25825. }
  25826. /* */
  25827. /**
  25828. * Option overwriting strategies are functions that handle
  25829. * how to merge a parent option value and a child option
  25830. * value into the final value.
  25831. */
  25832. var strats = config.optionMergeStrategies;
  25833. /**
  25834. * Options with restrictions
  25835. */
  25836. if (process.env.NODE_ENV !== 'production') {
  25837. strats.el = strats.propsData = function (parent, child, vm, key) {
  25838. if (!vm) {
  25839. warn(
  25840. "option \"" + key + "\" can only be used during instance " +
  25841. 'creation with the `new` keyword.'
  25842. );
  25843. }
  25844. return defaultStrat(parent, child)
  25845. };
  25846. }
  25847. /**
  25848. * Helper that recursively merges two data objects together.
  25849. */
  25850. function mergeData (to, from) {
  25851. if (!from) { return to }
  25852. var key, toVal, fromVal;
  25853. var keys = Object.keys(from);
  25854. for (var i = 0; i < keys.length; i++) {
  25855. key = keys[i];
  25856. toVal = to[key];
  25857. fromVal = from[key];
  25858. if (!hasOwn(to, key)) {
  25859. set$1(to, key, fromVal);
  25860. } else if (isPlainObject(toVal) && isPlainObject(fromVal)) {
  25861. mergeData(toVal, fromVal);
  25862. }
  25863. }
  25864. return to
  25865. }
  25866. /**
  25867. * Data
  25868. */
  25869. strats.data = function (
  25870. parentVal,
  25871. childVal,
  25872. vm
  25873. ) {
  25874. if (!vm) {
  25875. // in a Vue.extend merge, both should be functions
  25876. if (!childVal) {
  25877. return parentVal
  25878. }
  25879. if (typeof childVal !== 'function') {
  25880. process.env.NODE_ENV !== 'production' && warn(
  25881. 'The "data" option should be a function ' +
  25882. 'that returns a per-instance value in component ' +
  25883. 'definitions.',
  25884. vm
  25885. );
  25886. return parentVal
  25887. }
  25888. if (!parentVal) {
  25889. return childVal
  25890. }
  25891. // when parentVal & childVal are both present,
  25892. // we need to return a function that returns the
  25893. // merged result of both functions... no need to
  25894. // check if parentVal is a function here because
  25895. // it has to be a function to pass previous merges.
  25896. return function mergedDataFn () {
  25897. return mergeData(
  25898. childVal.call(this),
  25899. parentVal.call(this)
  25900. )
  25901. }
  25902. } else if (parentVal || childVal) {
  25903. return function mergedInstanceDataFn () {
  25904. // instance merge
  25905. var instanceData = typeof childVal === 'function'
  25906. ? childVal.call(vm)
  25907. : childVal;
  25908. var defaultData = typeof parentVal === 'function'
  25909. ? parentVal.call(vm)
  25910. : undefined;
  25911. if (instanceData) {
  25912. return mergeData(instanceData, defaultData)
  25913. } else {
  25914. return defaultData
  25915. }
  25916. }
  25917. }
  25918. };
  25919. /**
  25920. * Hooks and param attributes are merged as arrays.
  25921. */
  25922. function mergeHook (
  25923. parentVal,
  25924. childVal
  25925. ) {
  25926. return childVal
  25927. ? parentVal
  25928. ? parentVal.concat(childVal)
  25929. : Array.isArray(childVal)
  25930. ? childVal
  25931. : [childVal]
  25932. : parentVal
  25933. }
  25934. config._lifecycleHooks.forEach(function (hook) {
  25935. strats[hook] = mergeHook;
  25936. });
  25937. /**
  25938. * Assets
  25939. *
  25940. * When a vm is present (instance creation), we need to do
  25941. * a three-way merge between constructor options, instance
  25942. * options and parent options.
  25943. */
  25944. function mergeAssets (parentVal, childVal) {
  25945. var res = Object.create(parentVal || null);
  25946. return childVal
  25947. ? extend(res, childVal)
  25948. : res
  25949. }
  25950. config._assetTypes.forEach(function (type) {
  25951. strats[type + 's'] = mergeAssets;
  25952. });
  25953. /**
  25954. * Watchers.
  25955. *
  25956. * Watchers hashes should not overwrite one
  25957. * another, so we merge them as arrays.
  25958. */
  25959. strats.watch = function (parentVal, childVal) {
  25960. /* istanbul ignore if */
  25961. if (!childVal) { return parentVal }
  25962. if (!parentVal) { return childVal }
  25963. var ret = {};
  25964. extend(ret, parentVal);
  25965. for (var key in childVal) {
  25966. var parent = ret[key];
  25967. var child = childVal[key];
  25968. if (parent && !Array.isArray(parent)) {
  25969. parent = [parent];
  25970. }
  25971. ret[key] = parent
  25972. ? parent.concat(child)
  25973. : [child];
  25974. }
  25975. return ret
  25976. };
  25977. /**
  25978. * Other object hashes.
  25979. */
  25980. strats.props =
  25981. strats.methods =
  25982. strats.computed = function (parentVal, childVal) {
  25983. if (!childVal) { return parentVal }
  25984. if (!parentVal) { return childVal }
  25985. var ret = Object.create(null);
  25986. extend(ret, parentVal);
  25987. extend(ret, childVal);
  25988. return ret
  25989. };
  25990. /**
  25991. * Default strategy.
  25992. */
  25993. var defaultStrat = function (parentVal, childVal) {
  25994. return childVal === undefined
  25995. ? parentVal
  25996. : childVal
  25997. };
  25998. /**
  25999. * Validate component names
  26000. */
  26001. function checkComponents (options) {
  26002. for (var key in options.components) {
  26003. var lower = key.toLowerCase();
  26004. if (isBuiltInTag(lower) || config.isReservedTag(lower)) {
  26005. warn(
  26006. 'Do not use built-in or reserved HTML elements as component ' +
  26007. 'id: ' + key
  26008. );
  26009. }
  26010. }
  26011. }
  26012. /**
  26013. * Ensure all props option syntax are normalized into the
  26014. * Object-based format.
  26015. */
  26016. function normalizeProps (options) {
  26017. var props = options.props;
  26018. if (!props) { return }
  26019. var res = {};
  26020. var i, val, name;
  26021. if (Array.isArray(props)) {
  26022. i = props.length;
  26023. while (i--) {
  26024. val = props[i];
  26025. if (typeof val === 'string') {
  26026. name = camelize(val);
  26027. res[name] = { type: null };
  26028. } else if (process.env.NODE_ENV !== 'production') {
  26029. warn('props must be strings when using array syntax.');
  26030. }
  26031. }
  26032. } else if (isPlainObject(props)) {
  26033. for (var key in props) {
  26034. val = props[key];
  26035. name = camelize(key);
  26036. res[name] = isPlainObject(val)
  26037. ? val
  26038. : { type: val };
  26039. }
  26040. }
  26041. options.props = res;
  26042. }
  26043. /**
  26044. * Normalize raw function directives into object format.
  26045. */
  26046. function normalizeDirectives (options) {
  26047. var dirs = options.directives;
  26048. if (dirs) {
  26049. for (var key in dirs) {
  26050. var def = dirs[key];
  26051. if (typeof def === 'function') {
  26052. dirs[key] = { bind: def, update: def };
  26053. }
  26054. }
  26055. }
  26056. }
  26057. /**
  26058. * Merge two option objects into a new one.
  26059. * Core utility used in both instantiation and inheritance.
  26060. */
  26061. function mergeOptions (
  26062. parent,
  26063. child,
  26064. vm
  26065. ) {
  26066. if (process.env.NODE_ENV !== 'production') {
  26067. checkComponents(child);
  26068. }
  26069. normalizeProps(child);
  26070. normalizeDirectives(child);
  26071. var extendsFrom = child.extends;
  26072. if (extendsFrom) {
  26073. parent = typeof extendsFrom === 'function'
  26074. ? mergeOptions(parent, extendsFrom.options, vm)
  26075. : mergeOptions(parent, extendsFrom, vm);
  26076. }
  26077. if (child.mixins) {
  26078. for (var i = 0, l = child.mixins.length; i < l; i++) {
  26079. var mixin = child.mixins[i];
  26080. if (mixin.prototype instanceof Vue$3) {
  26081. mixin = mixin.options;
  26082. }
  26083. parent = mergeOptions(parent, mixin, vm);
  26084. }
  26085. }
  26086. var options = {};
  26087. var key;
  26088. for (key in parent) {
  26089. mergeField(key);
  26090. }
  26091. for (key in child) {
  26092. if (!hasOwn(parent, key)) {
  26093. mergeField(key);
  26094. }
  26095. }
  26096. function mergeField (key) {
  26097. var strat = strats[key] || defaultStrat;
  26098. options[key] = strat(parent[key], child[key], vm, key);
  26099. }
  26100. return options
  26101. }
  26102. /**
  26103. * Resolve an asset.
  26104. * This function is used because child instances need access
  26105. * to assets defined in its ancestor chain.
  26106. */
  26107. function resolveAsset (
  26108. options,
  26109. type,
  26110. id,
  26111. warnMissing
  26112. ) {
  26113. /* istanbul ignore if */
  26114. if (typeof id !== 'string') {
  26115. return
  26116. }
  26117. var assets = options[type];
  26118. // check local registration variations first
  26119. if (hasOwn(assets, id)) { return assets[id] }
  26120. var camelizedId = camelize(id);
  26121. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  26122. var PascalCaseId = capitalize(camelizedId);
  26123. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  26124. // fallback to prototype chain
  26125. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  26126. if (process.env.NODE_ENV !== 'production' && warnMissing && !res) {
  26127. warn(
  26128. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  26129. options
  26130. );
  26131. }
  26132. return res
  26133. }
  26134. /* */
  26135. function validateProp (
  26136. key,
  26137. propOptions,
  26138. propsData,
  26139. vm
  26140. ) {
  26141. var prop = propOptions[key];
  26142. var absent = !hasOwn(propsData, key);
  26143. var value = propsData[key];
  26144. // handle boolean props
  26145. if (isType(Boolean, prop.type)) {
  26146. if (absent && !hasOwn(prop, 'default')) {
  26147. value = false;
  26148. } else if (!isType(String, prop.type) && (value === '' || value === hyphenate(key))) {
  26149. value = true;
  26150. }
  26151. }
  26152. // check default value
  26153. if (value === undefined) {
  26154. value = getPropDefaultValue(vm, prop, key);
  26155. // since the default value is a fresh copy,
  26156. // make sure to observe it.
  26157. var prevShouldConvert = observerState.shouldConvert;
  26158. observerState.shouldConvert = true;
  26159. observe(value);
  26160. observerState.shouldConvert = prevShouldConvert;
  26161. }
  26162. if (process.env.NODE_ENV !== 'production') {
  26163. assertProp(prop, key, value, vm, absent);
  26164. }
  26165. return value
  26166. }
  26167. /**
  26168. * Get the default value of a prop.
  26169. */
  26170. function getPropDefaultValue (vm, prop, key) {
  26171. // no default, return undefined
  26172. if (!hasOwn(prop, 'default')) {
  26173. return undefined
  26174. }
  26175. var def = prop.default;
  26176. // warn against non-factory defaults for Object & Array
  26177. if (isObject(def)) {
  26178. process.env.NODE_ENV !== 'production' && warn(
  26179. 'Invalid default value for prop "' + key + '": ' +
  26180. 'Props with type Object/Array must use a factory function ' +
  26181. 'to return the default value.',
  26182. vm
  26183. );
  26184. }
  26185. // the raw prop value was also undefined from previous render,
  26186. // return previous default value to avoid unnecessary watcher trigger
  26187. if (vm && vm.$options.propsData &&
  26188. vm.$options.propsData[key] === undefined &&
  26189. vm[key] !== undefined) {
  26190. return vm[key]
  26191. }
  26192. // call factory function for non-Function types
  26193. return typeof def === 'function' && prop.type !== Function
  26194. ? def.call(vm)
  26195. : def
  26196. }
  26197. /**
  26198. * Assert whether a prop is valid.
  26199. */
  26200. function assertProp (
  26201. prop,
  26202. name,
  26203. value,
  26204. vm,
  26205. absent
  26206. ) {
  26207. if (prop.required && absent) {
  26208. warn(
  26209. 'Missing required prop: "' + name + '"',
  26210. vm
  26211. );
  26212. return
  26213. }
  26214. if (value == null && !prop.required) {
  26215. return
  26216. }
  26217. var type = prop.type;
  26218. var valid = !type || type === true;
  26219. var expectedTypes = [];
  26220. if (type) {
  26221. if (!Array.isArray(type)) {
  26222. type = [type];
  26223. }
  26224. for (var i = 0; i < type.length && !valid; i++) {
  26225. var assertedType = assertType(value, type[i]);
  26226. expectedTypes.push(assertedType.expectedType || '');
  26227. valid = assertedType.valid;
  26228. }
  26229. }
  26230. if (!valid) {
  26231. warn(
  26232. 'Invalid prop: type check failed for prop "' + name + '".' +
  26233. ' Expected ' + expectedTypes.map(capitalize).join(', ') +
  26234. ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',
  26235. vm
  26236. );
  26237. return
  26238. }
  26239. var validator = prop.validator;
  26240. if (validator) {
  26241. if (!validator(value)) {
  26242. warn(
  26243. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  26244. vm
  26245. );
  26246. }
  26247. }
  26248. }
  26249. /**
  26250. * Assert the type of a value
  26251. */
  26252. function assertType (value, type) {
  26253. var valid;
  26254. var expectedType = getType(type);
  26255. if (expectedType === 'String') {
  26256. valid = typeof value === (expectedType = 'string');
  26257. } else if (expectedType === 'Number') {
  26258. valid = typeof value === (expectedType = 'number');
  26259. } else if (expectedType === 'Boolean') {
  26260. valid = typeof value === (expectedType = 'boolean');
  26261. } else if (expectedType === 'Function') {
  26262. valid = typeof value === (expectedType = 'function');
  26263. } else if (expectedType === 'Object') {
  26264. valid = isPlainObject(value);
  26265. } else if (expectedType === 'Array') {
  26266. valid = Array.isArray(value);
  26267. } else {
  26268. valid = value instanceof type;
  26269. }
  26270. return {
  26271. valid: valid,
  26272. expectedType: expectedType
  26273. }
  26274. }
  26275. /**
  26276. * Use function string name to check built-in types,
  26277. * because a simple equality check will fail when running
  26278. * across different vms / iframes.
  26279. */
  26280. function getType (fn) {
  26281. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  26282. return match && match[1]
  26283. }
  26284. function isType (type, fn) {
  26285. if (!Array.isArray(fn)) {
  26286. return getType(fn) === getType(type)
  26287. }
  26288. for (var i = 0, len = fn.length; i < len; i++) {
  26289. if (getType(fn[i]) === getType(type)) {
  26290. return true
  26291. }
  26292. }
  26293. /* istanbul ignore next */
  26294. return false
  26295. }
  26296. var util = Object.freeze({
  26297. defineReactive: defineReactive$$1,
  26298. _toString: _toString,
  26299. toNumber: toNumber,
  26300. makeMap: makeMap,
  26301. isBuiltInTag: isBuiltInTag,
  26302. remove: remove$1,
  26303. hasOwn: hasOwn,
  26304. isPrimitive: isPrimitive,
  26305. cached: cached,
  26306. camelize: camelize,
  26307. capitalize: capitalize,
  26308. hyphenate: hyphenate,
  26309. bind: bind$1,
  26310. toArray: toArray,
  26311. extend: extend,
  26312. isObject: isObject,
  26313. isPlainObject: isPlainObject,
  26314. toObject: toObject,
  26315. noop: noop,
  26316. no: no,
  26317. identity: identity,
  26318. genStaticKeys: genStaticKeys,
  26319. looseEqual: looseEqual,
  26320. looseIndexOf: looseIndexOf,
  26321. isReserved: isReserved,
  26322. def: def,
  26323. parsePath: parsePath,
  26324. hasProto: hasProto,
  26325. inBrowser: inBrowser,
  26326. UA: UA,
  26327. isIE: isIE,
  26328. isIE9: isIE9,
  26329. isEdge: isEdge,
  26330. isAndroid: isAndroid,
  26331. isIOS: isIOS,
  26332. isServerRendering: isServerRendering,
  26333. devtools: devtools,
  26334. nextTick: nextTick,
  26335. get _Set () { return _Set; },
  26336. mergeOptions: mergeOptions,
  26337. resolveAsset: resolveAsset,
  26338. get warn () { return warn; },
  26339. get formatComponentName () { return formatComponentName; },
  26340. validateProp: validateProp
  26341. });
  26342. /* not type checking this file because flow doesn't play well with Proxy */
  26343. var initProxy;
  26344. if (process.env.NODE_ENV !== 'production') {
  26345. var allowedGlobals = makeMap(
  26346. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  26347. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  26348. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  26349. 'require' // for Webpack/Browserify
  26350. );
  26351. var warnNonPresent = function (target, key) {
  26352. warn(
  26353. "Property or method \"" + key + "\" is not defined on the instance but " +
  26354. "referenced during render. Make sure to declare reactive data " +
  26355. "properties in the data option.",
  26356. target
  26357. );
  26358. };
  26359. var hasProxy =
  26360. typeof Proxy !== 'undefined' &&
  26361. Proxy.toString().match(/native code/);
  26362. if (hasProxy) {
  26363. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta');
  26364. config.keyCodes = new Proxy(config.keyCodes, {
  26365. set: function set (target, key, value) {
  26366. if (isBuiltInModifier(key)) {
  26367. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  26368. return false
  26369. } else {
  26370. target[key] = value;
  26371. return true
  26372. }
  26373. }
  26374. });
  26375. }
  26376. var hasHandler = {
  26377. has: function has (target, key) {
  26378. var has = key in target;
  26379. var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';
  26380. if (!has && !isAllowed) {
  26381. warnNonPresent(target, key);
  26382. }
  26383. return has || !isAllowed
  26384. }
  26385. };
  26386. var getHandler = {
  26387. get: function get (target, key) {
  26388. if (typeof key === 'string' && !(key in target)) {
  26389. warnNonPresent(target, key);
  26390. }
  26391. return target[key]
  26392. }
  26393. };
  26394. initProxy = function initProxy (vm) {
  26395. if (hasProxy) {
  26396. // determine which proxy handler to use
  26397. var options = vm.$options;
  26398. var handlers = options.render && options.render._withStripped
  26399. ? getHandler
  26400. : hasHandler;
  26401. vm._renderProxy = new Proxy(vm, handlers);
  26402. } else {
  26403. vm._renderProxy = vm;
  26404. }
  26405. };
  26406. }
  26407. /* */
  26408. var VNode = function VNode (
  26409. tag,
  26410. data,
  26411. children,
  26412. text,
  26413. elm,
  26414. context,
  26415. componentOptions
  26416. ) {
  26417. this.tag = tag;
  26418. this.data = data;
  26419. this.children = children;
  26420. this.text = text;
  26421. this.elm = elm;
  26422. this.ns = undefined;
  26423. this.context = context;
  26424. this.functionalContext = undefined;
  26425. this.key = data && data.key;
  26426. this.componentOptions = componentOptions;
  26427. this.componentInstance = undefined;
  26428. this.parent = undefined;
  26429. this.raw = false;
  26430. this.isStatic = false;
  26431. this.isRootInsert = true;
  26432. this.isComment = false;
  26433. this.isCloned = false;
  26434. this.isOnce = false;
  26435. };
  26436. var prototypeAccessors = { child: {} };
  26437. // DEPRECATED: alias for componentInstance for backwards compat.
  26438. /* istanbul ignore next */
  26439. prototypeAccessors.child.get = function () {
  26440. return this.componentInstance
  26441. };
  26442. Object.defineProperties( VNode.prototype, prototypeAccessors );
  26443. var createEmptyVNode = function () {
  26444. var node = new VNode();
  26445. node.text = '';
  26446. node.isComment = true;
  26447. return node
  26448. };
  26449. function createTextVNode (val) {
  26450. return new VNode(undefined, undefined, undefined, String(val))
  26451. }
  26452. // optimized shallow clone
  26453. // used for static nodes and slot nodes because they may be reused across
  26454. // multiple renders, cloning them avoids errors when DOM manipulations rely
  26455. // on their elm reference.
  26456. function cloneVNode (vnode) {
  26457. var cloned = new VNode(
  26458. vnode.tag,
  26459. vnode.data,
  26460. vnode.children,
  26461. vnode.text,
  26462. vnode.elm,
  26463. vnode.context,
  26464. vnode.componentOptions
  26465. );
  26466. cloned.ns = vnode.ns;
  26467. cloned.isStatic = vnode.isStatic;
  26468. cloned.key = vnode.key;
  26469. cloned.isCloned = true;
  26470. return cloned
  26471. }
  26472. function cloneVNodes (vnodes) {
  26473. var res = new Array(vnodes.length);
  26474. for (var i = 0; i < vnodes.length; i++) {
  26475. res[i] = cloneVNode(vnodes[i]);
  26476. }
  26477. return res
  26478. }
  26479. /* */
  26480. var hooks = { init: init, prepatch: prepatch, insert: insert, destroy: destroy$1 };
  26481. var hooksToMerge = Object.keys(hooks);
  26482. function createComponent (
  26483. Ctor,
  26484. data,
  26485. context,
  26486. children,
  26487. tag
  26488. ) {
  26489. if (!Ctor) {
  26490. return
  26491. }
  26492. var baseCtor = context.$options._base;
  26493. if (isObject(Ctor)) {
  26494. Ctor = baseCtor.extend(Ctor);
  26495. }
  26496. if (typeof Ctor !== 'function') {
  26497. if (process.env.NODE_ENV !== 'production') {
  26498. warn(("Invalid Component definition: " + (String(Ctor))), context);
  26499. }
  26500. return
  26501. }
  26502. // async component
  26503. if (!Ctor.cid) {
  26504. if (Ctor.resolved) {
  26505. Ctor = Ctor.resolved;
  26506. } else {
  26507. Ctor = resolveAsyncComponent(Ctor, baseCtor, function () {
  26508. // it's ok to queue this on every render because
  26509. // $forceUpdate is buffered by the scheduler.
  26510. context.$forceUpdate();
  26511. });
  26512. if (!Ctor) {
  26513. // return nothing if this is indeed an async component
  26514. // wait for the callback to trigger parent update.
  26515. return
  26516. }
  26517. }
  26518. }
  26519. // resolve constructor options in case global mixins are applied after
  26520. // component constructor creation
  26521. resolveConstructorOptions(Ctor);
  26522. data = data || {};
  26523. // extract props
  26524. var propsData = extractProps(data, Ctor);
  26525. // functional component
  26526. if (Ctor.options.functional) {
  26527. return createFunctionalComponent(Ctor, propsData, data, context, children)
  26528. }
  26529. // extract listeners, since these needs to be treated as
  26530. // child component listeners instead of DOM listeners
  26531. var listeners = data.on;
  26532. // replace with listeners with .native modifier
  26533. data.on = data.nativeOn;
  26534. if (Ctor.options.abstract) {
  26535. // abstract components do not keep anything
  26536. // other than props & listeners
  26537. data = {};
  26538. }
  26539. // merge component management hooks onto the placeholder node
  26540. mergeHooks(data);
  26541. // return a placeholder vnode
  26542. var name = Ctor.options.name || tag;
  26543. var vnode = new VNode(
  26544. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  26545. data, undefined, undefined, undefined, context,
  26546. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }
  26547. );
  26548. return vnode
  26549. }
  26550. function createFunctionalComponent (
  26551. Ctor,
  26552. propsData,
  26553. data,
  26554. context,
  26555. children
  26556. ) {
  26557. var props = {};
  26558. var propOptions = Ctor.options.props;
  26559. if (propOptions) {
  26560. for (var key in propOptions) {
  26561. props[key] = validateProp(key, propOptions, propsData);
  26562. }
  26563. }
  26564. // ensure the createElement function in functional components
  26565. // gets a unique context - this is necessary for correct named slot check
  26566. var _context = Object.create(context);
  26567. var h = function (a, b, c, d) { return createElement(_context, a, b, c, d, true); };
  26568. var vnode = Ctor.options.render.call(null, h, {
  26569. props: props,
  26570. data: data,
  26571. parent: context,
  26572. children: children,
  26573. slots: function () { return resolveSlots(children, context); }
  26574. });
  26575. if (vnode instanceof VNode) {
  26576. vnode.functionalContext = context;
  26577. if (data.slot) {
  26578. (vnode.data || (vnode.data = {})).slot = data.slot;
  26579. }
  26580. }
  26581. return vnode
  26582. }
  26583. function createComponentInstanceForVnode (
  26584. vnode, // we know it's MountedComponentVNode but flow doesn't
  26585. parent, // activeInstance in lifecycle state
  26586. parentElm,
  26587. refElm
  26588. ) {
  26589. var vnodeComponentOptions = vnode.componentOptions;
  26590. var options = {
  26591. _isComponent: true,
  26592. parent: parent,
  26593. propsData: vnodeComponentOptions.propsData,
  26594. _componentTag: vnodeComponentOptions.tag,
  26595. _parentVnode: vnode,
  26596. _parentListeners: vnodeComponentOptions.listeners,
  26597. _renderChildren: vnodeComponentOptions.children,
  26598. _parentElm: parentElm || null,
  26599. _refElm: refElm || null
  26600. };
  26601. // check inline-template render functions
  26602. var inlineTemplate = vnode.data.inlineTemplate;
  26603. if (inlineTemplate) {
  26604. options.render = inlineTemplate.render;
  26605. options.staticRenderFns = inlineTemplate.staticRenderFns;
  26606. }
  26607. return new vnodeComponentOptions.Ctor(options)
  26608. }
  26609. function init (
  26610. vnode,
  26611. hydrating,
  26612. parentElm,
  26613. refElm
  26614. ) {
  26615. if (!vnode.componentInstance || vnode.componentInstance._isDestroyed) {
  26616. var child = vnode.componentInstance = createComponentInstanceForVnode(
  26617. vnode,
  26618. activeInstance,
  26619. parentElm,
  26620. refElm
  26621. );
  26622. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  26623. } else if (vnode.data.keepAlive) {
  26624. // kept-alive components, treat as a patch
  26625. var mountedNode = vnode; // work around flow
  26626. prepatch(mountedNode, mountedNode);
  26627. }
  26628. }
  26629. function prepatch (
  26630. oldVnode,
  26631. vnode
  26632. ) {
  26633. var options = vnode.componentOptions;
  26634. var child = vnode.componentInstance = oldVnode.componentInstance;
  26635. child._updateFromParent(
  26636. options.propsData, // updated props
  26637. options.listeners, // updated listeners
  26638. vnode, // new parent vnode
  26639. options.children // new children
  26640. );
  26641. }
  26642. function insert (vnode) {
  26643. if (!vnode.componentInstance._isMounted) {
  26644. vnode.componentInstance._isMounted = true;
  26645. callHook(vnode.componentInstance, 'mounted');
  26646. }
  26647. if (vnode.data.keepAlive) {
  26648. vnode.componentInstance._inactive = false;
  26649. callHook(vnode.componentInstance, 'activated');
  26650. }
  26651. }
  26652. function destroy$1 (vnode) {
  26653. if (!vnode.componentInstance._isDestroyed) {
  26654. if (!vnode.data.keepAlive) {
  26655. vnode.componentInstance.$destroy();
  26656. } else {
  26657. vnode.componentInstance._inactive = true;
  26658. callHook(vnode.componentInstance, 'deactivated');
  26659. }
  26660. }
  26661. }
  26662. function resolveAsyncComponent (
  26663. factory,
  26664. baseCtor,
  26665. cb
  26666. ) {
  26667. if (factory.requested) {
  26668. // pool callbacks
  26669. factory.pendingCallbacks.push(cb);
  26670. } else {
  26671. factory.requested = true;
  26672. var cbs = factory.pendingCallbacks = [cb];
  26673. var sync = true;
  26674. var resolve = function (res) {
  26675. if (isObject(res)) {
  26676. res = baseCtor.extend(res);
  26677. }
  26678. // cache resolved
  26679. factory.resolved = res;
  26680. // invoke callbacks only if this is not a synchronous resolve
  26681. // (async resolves are shimmed as synchronous during SSR)
  26682. if (!sync) {
  26683. for (var i = 0, l = cbs.length; i < l; i++) {
  26684. cbs[i](res);
  26685. }
  26686. }
  26687. };
  26688. var reject = function (reason) {
  26689. process.env.NODE_ENV !== 'production' && warn(
  26690. "Failed to resolve async component: " + (String(factory)) +
  26691. (reason ? ("\nReason: " + reason) : '')
  26692. );
  26693. };
  26694. var res = factory(resolve, reject);
  26695. // handle promise
  26696. if (res && typeof res.then === 'function' && !factory.resolved) {
  26697. res.then(resolve, reject);
  26698. }
  26699. sync = false;
  26700. // return in case resolved synchronously
  26701. return factory.resolved
  26702. }
  26703. }
  26704. function extractProps (data, Ctor) {
  26705. // we are only extracting raw values here.
  26706. // validation and default values are handled in the child
  26707. // component itself.
  26708. var propOptions = Ctor.options.props;
  26709. if (!propOptions) {
  26710. return
  26711. }
  26712. var res = {};
  26713. var attrs = data.attrs;
  26714. var props = data.props;
  26715. var domProps = data.domProps;
  26716. if (attrs || props || domProps) {
  26717. for (var key in propOptions) {
  26718. var altKey = hyphenate(key);
  26719. checkProp(res, props, key, altKey, true) ||
  26720. checkProp(res, attrs, key, altKey) ||
  26721. checkProp(res, domProps, key, altKey);
  26722. }
  26723. }
  26724. return res
  26725. }
  26726. function checkProp (
  26727. res,
  26728. hash,
  26729. key,
  26730. altKey,
  26731. preserve
  26732. ) {
  26733. if (hash) {
  26734. if (hasOwn(hash, key)) {
  26735. res[key] = hash[key];
  26736. if (!preserve) {
  26737. delete hash[key];
  26738. }
  26739. return true
  26740. } else if (hasOwn(hash, altKey)) {
  26741. res[key] = hash[altKey];
  26742. if (!preserve) {
  26743. delete hash[altKey];
  26744. }
  26745. return true
  26746. }
  26747. }
  26748. return false
  26749. }
  26750. function mergeHooks (data) {
  26751. if (!data.hook) {
  26752. data.hook = {};
  26753. }
  26754. for (var i = 0; i < hooksToMerge.length; i++) {
  26755. var key = hooksToMerge[i];
  26756. var fromParent = data.hook[key];
  26757. var ours = hooks[key];
  26758. data.hook[key] = fromParent ? mergeHook$1(ours, fromParent) : ours;
  26759. }
  26760. }
  26761. function mergeHook$1 (one, two) {
  26762. return function (a, b, c, d) {
  26763. one(a, b, c, d);
  26764. two(a, b, c, d);
  26765. }
  26766. }
  26767. /* */
  26768. function mergeVNodeHook (def, hookKey, hook, key) {
  26769. key = key + hookKey;
  26770. var injectedHash = def.__injected || (def.__injected = {});
  26771. if (!injectedHash[key]) {
  26772. injectedHash[key] = true;
  26773. var oldHook = def[hookKey];
  26774. if (oldHook) {
  26775. def[hookKey] = function () {
  26776. oldHook.apply(this, arguments);
  26777. hook.apply(this, arguments);
  26778. };
  26779. } else {
  26780. def[hookKey] = hook;
  26781. }
  26782. }
  26783. }
  26784. /* */
  26785. var normalizeEvent = cached(function (name) {
  26786. var once = name.charAt(0) === '~'; // Prefixed last, checked first
  26787. name = once ? name.slice(1) : name;
  26788. var capture = name.charAt(0) === '!';
  26789. name = capture ? name.slice(1) : name;
  26790. return {
  26791. name: name,
  26792. once: once,
  26793. capture: capture
  26794. }
  26795. });
  26796. function createEventHandle (fn) {
  26797. var handle = {
  26798. fn: fn,
  26799. invoker: function () {
  26800. var arguments$1 = arguments;
  26801. var fn = handle.fn;
  26802. if (Array.isArray(fn)) {
  26803. for (var i = 0; i < fn.length; i++) {
  26804. fn[i].apply(null, arguments$1);
  26805. }
  26806. } else {
  26807. fn.apply(null, arguments);
  26808. }
  26809. }
  26810. };
  26811. return handle
  26812. }
  26813. function updateListeners (
  26814. on,
  26815. oldOn,
  26816. add,
  26817. remove$$1,
  26818. vm
  26819. ) {
  26820. var name, cur, old, event;
  26821. for (name in on) {
  26822. cur = on[name];
  26823. old = oldOn[name];
  26824. event = normalizeEvent(name);
  26825. if (!cur) {
  26826. process.env.NODE_ENV !== 'production' && warn(
  26827. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  26828. vm
  26829. );
  26830. } else if (!old) {
  26831. if (!cur.invoker) {
  26832. cur = on[name] = createEventHandle(cur);
  26833. }
  26834. add(event.name, cur.invoker, event.once, event.capture);
  26835. } else if (cur !== old) {
  26836. old.fn = cur;
  26837. on[name] = old;
  26838. }
  26839. }
  26840. for (name in oldOn) {
  26841. if (!on[name]) {
  26842. event = normalizeEvent(name);
  26843. remove$$1(event.name, oldOn[name].invoker, event.capture);
  26844. }
  26845. }
  26846. }
  26847. /* */
  26848. // The template compiler attempts to minimize the need for normalization by
  26849. // statically analyzing the template at compile time.
  26850. //
  26851. // For plain HTML markup, normalization can be completely skipped because the
  26852. // generated render function is guaranteed to return Array<VNode>. There are
  26853. // two cases where extra normalization is needed:
  26854. // 1. When the children contains components - because a functional component
  26855. // may return an Array instead of a single root. In this case, just a simple
  26856. // nomralization is needed - if any child is an Array, we flatten the whole
  26857. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  26858. // because functional components already normalize their own children.
  26859. function simpleNormalizeChildren (children) {
  26860. for (var i = 0; i < children.length; i++) {
  26861. if (Array.isArray(children[i])) {
  26862. return Array.prototype.concat.apply([], children)
  26863. }
  26864. }
  26865. return children
  26866. }
  26867. // 2. When the children contains constrcuts that always generated nested Arrays,
  26868. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  26869. // with hand-written render functions / JSX. In such cases a full normalization
  26870. // is needed to cater to all possible types of children values.
  26871. function normalizeChildren (children) {
  26872. return isPrimitive(children)
  26873. ? [createTextVNode(children)]
  26874. : Array.isArray(children)
  26875. ? normalizeArrayChildren(children)
  26876. : undefined
  26877. }
  26878. function normalizeArrayChildren (children, nestedIndex) {
  26879. var res = [];
  26880. var i, c, last;
  26881. for (i = 0; i < children.length; i++) {
  26882. c = children[i];
  26883. if (c == null || typeof c === 'boolean') { continue }
  26884. last = res[res.length - 1];
  26885. // nested
  26886. if (Array.isArray(c)) {
  26887. res.push.apply(res, normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i)));
  26888. } else if (isPrimitive(c)) {
  26889. if (last && last.text) {
  26890. last.text += String(c);
  26891. } else if (c !== '') {
  26892. // convert primitive to vnode
  26893. res.push(createTextVNode(c));
  26894. }
  26895. } else {
  26896. if (c.text && last && last.text) {
  26897. res[res.length - 1] = createTextVNode(last.text + c.text);
  26898. } else {
  26899. // default key for nested array children (likely generated by v-for)
  26900. if (c.tag && c.key == null && nestedIndex != null) {
  26901. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  26902. }
  26903. res.push(c);
  26904. }
  26905. }
  26906. }
  26907. return res
  26908. }
  26909. /* */
  26910. function getFirstComponentChild (children) {
  26911. return children && children.filter(function (c) { return c && c.componentOptions; })[0]
  26912. }
  26913. /* */
  26914. var SIMPLE_NORMALIZE = 1;
  26915. var ALWAYS_NORMALIZE = 2;
  26916. // wrapper function for providing a more flexible interface
  26917. // without getting yelled at by flow
  26918. function createElement (
  26919. context,
  26920. tag,
  26921. data,
  26922. children,
  26923. normalizationType,
  26924. alwaysNormalize
  26925. ) {
  26926. if (Array.isArray(data) || isPrimitive(data)) {
  26927. normalizationType = children;
  26928. children = data;
  26929. data = undefined;
  26930. }
  26931. if (alwaysNormalize) { normalizationType = ALWAYS_NORMALIZE; }
  26932. return _createElement(context, tag, data, children, normalizationType)
  26933. }
  26934. function _createElement (
  26935. context,
  26936. tag,
  26937. data,
  26938. children,
  26939. normalizationType
  26940. ) {
  26941. if (data && data.__ob__) {
  26942. process.env.NODE_ENV !== 'production' && warn(
  26943. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  26944. 'Always create fresh vnode data objects in each render!',
  26945. context
  26946. );
  26947. return createEmptyVNode()
  26948. }
  26949. if (!tag) {
  26950. // in case of component :is set to falsy value
  26951. return createEmptyVNode()
  26952. }
  26953. // support single function children as default scoped slot
  26954. if (Array.isArray(children) &&
  26955. typeof children[0] === 'function') {
  26956. data = data || {};
  26957. data.scopedSlots = { default: children[0] };
  26958. children.length = 0;
  26959. }
  26960. if (normalizationType === ALWAYS_NORMALIZE) {
  26961. children = normalizeChildren(children);
  26962. } else if (normalizationType === SIMPLE_NORMALIZE) {
  26963. children = simpleNormalizeChildren(children);
  26964. }
  26965. var vnode, ns;
  26966. if (typeof tag === 'string') {
  26967. var Ctor;
  26968. ns = config.getTagNamespace(tag);
  26969. if (config.isReservedTag(tag)) {
  26970. // platform built-in elements
  26971. vnode = new VNode(
  26972. config.parsePlatformTagName(tag), data, children,
  26973. undefined, undefined, context
  26974. );
  26975. } else if ((Ctor = resolveAsset(context.$options, 'components', tag))) {
  26976. // component
  26977. vnode = createComponent(Ctor, data, context, children, tag);
  26978. } else {
  26979. // unknown or unlisted namespaced elements
  26980. // check at runtime because it may get assigned a namespace when its
  26981. // parent normalizes children
  26982. vnode = new VNode(
  26983. tag, data, children,
  26984. undefined, undefined, context
  26985. );
  26986. }
  26987. } else {
  26988. // direct component options / constructor
  26989. vnode = createComponent(tag, data, context, children);
  26990. }
  26991. if (vnode) {
  26992. if (ns) { applyNS(vnode, ns); }
  26993. return vnode
  26994. } else {
  26995. return createEmptyVNode()
  26996. }
  26997. }
  26998. function applyNS (vnode, ns) {
  26999. vnode.ns = ns;
  27000. if (vnode.tag === 'foreignObject') {
  27001. // use default namespace inside foreignObject
  27002. return
  27003. }
  27004. if (vnode.children) {
  27005. for (var i = 0, l = vnode.children.length; i < l; i++) {
  27006. var child = vnode.children[i];
  27007. if (child.tag && !child.ns) {
  27008. applyNS(child, ns);
  27009. }
  27010. }
  27011. }
  27012. }
  27013. /* */
  27014. function initRender (vm) {
  27015. vm.$vnode = null; // the placeholder node in parent tree
  27016. vm._vnode = null; // the root of the child tree
  27017. vm._staticTrees = null;
  27018. var parentVnode = vm.$options._parentVnode;
  27019. var renderContext = parentVnode && parentVnode.context;
  27020. vm.$slots = resolveSlots(vm.$options._renderChildren, renderContext);
  27021. vm.$scopedSlots = {};
  27022. // bind the createElement fn to this instance
  27023. // so that we get proper render context inside it.
  27024. // args order: tag, data, children, normalizationType, alwaysNormalize
  27025. // internal version is used by render functions compiled from templates
  27026. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  27027. // normalization is always applied for the public version, used in
  27028. // user-written render functions.
  27029. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  27030. }
  27031. function renderMixin (Vue) {
  27032. Vue.prototype.$nextTick = function (fn) {
  27033. return nextTick(fn, this)
  27034. };
  27035. Vue.prototype._render = function () {
  27036. var vm = this;
  27037. var ref = vm.$options;
  27038. var render = ref.render;
  27039. var staticRenderFns = ref.staticRenderFns;
  27040. var _parentVnode = ref._parentVnode;
  27041. if (vm._isMounted) {
  27042. // clone slot nodes on re-renders
  27043. for (var key in vm.$slots) {
  27044. vm.$slots[key] = cloneVNodes(vm.$slots[key]);
  27045. }
  27046. }
  27047. if (_parentVnode && _parentVnode.data.scopedSlots) {
  27048. vm.$scopedSlots = _parentVnode.data.scopedSlots;
  27049. }
  27050. if (staticRenderFns && !vm._staticTrees) {
  27051. vm._staticTrees = [];
  27052. }
  27053. // set parent vnode. this allows render functions to have access
  27054. // to the data on the placeholder node.
  27055. vm.$vnode = _parentVnode;
  27056. // render self
  27057. var vnode;
  27058. try {
  27059. vnode = render.call(vm._renderProxy, vm.$createElement);
  27060. } catch (e) {
  27061. /* istanbul ignore else */
  27062. if (config.errorHandler) {
  27063. config.errorHandler.call(null, e, vm);
  27064. } else {
  27065. if (process.env.NODE_ENV !== 'production') {
  27066. warn(("Error when rendering " + (formatComponentName(vm)) + ":"));
  27067. }
  27068. throw e
  27069. }
  27070. // return previous vnode to prevent render error causing blank component
  27071. vnode = vm._vnode;
  27072. }
  27073. // return empty vnode in case the render function errored out
  27074. if (!(vnode instanceof VNode)) {
  27075. if (process.env.NODE_ENV !== 'production' && Array.isArray(vnode)) {
  27076. warn(
  27077. 'Multiple root nodes returned from render function. Render function ' +
  27078. 'should return a single root node.',
  27079. vm
  27080. );
  27081. }
  27082. vnode = createEmptyVNode();
  27083. }
  27084. // set parent
  27085. vnode.parent = _parentVnode;
  27086. return vnode
  27087. };
  27088. // toString for mustaches
  27089. Vue.prototype._s = _toString;
  27090. // convert text to vnode
  27091. Vue.prototype._v = createTextVNode;
  27092. // number conversion
  27093. Vue.prototype._n = toNumber;
  27094. // empty vnode
  27095. Vue.prototype._e = createEmptyVNode;
  27096. // loose equal
  27097. Vue.prototype._q = looseEqual;
  27098. // loose indexOf
  27099. Vue.prototype._i = looseIndexOf;
  27100. // render static tree by index
  27101. Vue.prototype._m = function renderStatic (
  27102. index,
  27103. isInFor
  27104. ) {
  27105. var tree = this._staticTrees[index];
  27106. // if has already-rendered static tree and not inside v-for,
  27107. // we can reuse the same tree by doing a shallow clone.
  27108. if (tree && !isInFor) {
  27109. return Array.isArray(tree)
  27110. ? cloneVNodes(tree)
  27111. : cloneVNode(tree)
  27112. }
  27113. // otherwise, render a fresh tree.
  27114. tree = this._staticTrees[index] = this.$options.staticRenderFns[index].call(this._renderProxy);
  27115. markStatic(tree, ("__static__" + index), false);
  27116. return tree
  27117. };
  27118. // mark node as static (v-once)
  27119. Vue.prototype._o = function markOnce (
  27120. tree,
  27121. index,
  27122. key
  27123. ) {
  27124. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  27125. return tree
  27126. };
  27127. function markStatic (tree, key, isOnce) {
  27128. if (Array.isArray(tree)) {
  27129. for (var i = 0; i < tree.length; i++) {
  27130. if (tree[i] && typeof tree[i] !== 'string') {
  27131. markStaticNode(tree[i], (key + "_" + i), isOnce);
  27132. }
  27133. }
  27134. } else {
  27135. markStaticNode(tree, key, isOnce);
  27136. }
  27137. }
  27138. function markStaticNode (node, key, isOnce) {
  27139. node.isStatic = true;
  27140. node.key = key;
  27141. node.isOnce = isOnce;
  27142. }
  27143. // filter resolution helper
  27144. Vue.prototype._f = function resolveFilter (id) {
  27145. return resolveAsset(this.$options, 'filters', id, true) || identity
  27146. };
  27147. // render v-for
  27148. Vue.prototype._l = function renderList (
  27149. val,
  27150. render
  27151. ) {
  27152. var ret, i, l, keys, key;
  27153. if (Array.isArray(val) || typeof val === 'string') {
  27154. ret = new Array(val.length);
  27155. for (i = 0, l = val.length; i < l; i++) {
  27156. ret[i] = render(val[i], i);
  27157. }
  27158. } else if (typeof val === 'number') {
  27159. ret = new Array(val);
  27160. for (i = 0; i < val; i++) {
  27161. ret[i] = render(i + 1, i);
  27162. }
  27163. } else if (isObject(val)) {
  27164. keys = Object.keys(val);
  27165. ret = new Array(keys.length);
  27166. for (i = 0, l = keys.length; i < l; i++) {
  27167. key = keys[i];
  27168. ret[i] = render(val[key], key, i);
  27169. }
  27170. }
  27171. return ret
  27172. };
  27173. // renderSlot
  27174. Vue.prototype._t = function (
  27175. name,
  27176. fallback,
  27177. props,
  27178. bindObject
  27179. ) {
  27180. var scopedSlotFn = this.$scopedSlots[name];
  27181. if (scopedSlotFn) { // scoped slot
  27182. props = props || {};
  27183. if (bindObject) {
  27184. extend(props, bindObject);
  27185. }
  27186. return scopedSlotFn(props) || fallback
  27187. } else {
  27188. var slotNodes = this.$slots[name];
  27189. // warn duplicate slot usage
  27190. if (slotNodes && process.env.NODE_ENV !== 'production') {
  27191. slotNodes._rendered && warn(
  27192. "Duplicate presence of slot \"" + name + "\" found in the same render tree " +
  27193. "- this will likely cause render errors.",
  27194. this
  27195. );
  27196. slotNodes._rendered = true;
  27197. }
  27198. return slotNodes || fallback
  27199. }
  27200. };
  27201. // apply v-bind object
  27202. Vue.prototype._b = function bindProps (
  27203. data,
  27204. tag,
  27205. value,
  27206. asProp
  27207. ) {
  27208. if (value) {
  27209. if (!isObject(value)) {
  27210. process.env.NODE_ENV !== 'production' && warn(
  27211. 'v-bind without argument expects an Object or Array value',
  27212. this
  27213. );
  27214. } else {
  27215. if (Array.isArray(value)) {
  27216. value = toObject(value);
  27217. }
  27218. for (var key in value) {
  27219. if (key === 'class' || key === 'style') {
  27220. data[key] = value[key];
  27221. } else {
  27222. var type = data.attrs && data.attrs.type;
  27223. var hash = asProp || config.mustUseProp(tag, type, key)
  27224. ? data.domProps || (data.domProps = {})
  27225. : data.attrs || (data.attrs = {});
  27226. hash[key] = value[key];
  27227. }
  27228. }
  27229. }
  27230. }
  27231. return data
  27232. };
  27233. // check v-on keyCodes
  27234. Vue.prototype._k = function checkKeyCodes (
  27235. eventKeyCode,
  27236. key,
  27237. builtInAlias
  27238. ) {
  27239. var keyCodes = config.keyCodes[key] || builtInAlias;
  27240. if (Array.isArray(keyCodes)) {
  27241. return keyCodes.indexOf(eventKeyCode) === -1
  27242. } else {
  27243. return keyCodes !== eventKeyCode
  27244. }
  27245. };
  27246. }
  27247. function resolveSlots (
  27248. children,
  27249. context
  27250. ) {
  27251. var slots = {};
  27252. if (!children) {
  27253. return slots
  27254. }
  27255. var defaultSlot = [];
  27256. var name, child;
  27257. for (var i = 0, l = children.length; i < l; i++) {
  27258. child = children[i];
  27259. // named slots should only be respected if the vnode was rendered in the
  27260. // same context.
  27261. if ((child.context === context || child.functionalContext === context) &&
  27262. child.data && (name = child.data.slot)) {
  27263. var slot = (slots[name] || (slots[name] = []));
  27264. if (child.tag === 'template') {
  27265. slot.push.apply(slot, child.children);
  27266. } else {
  27267. slot.push(child);
  27268. }
  27269. } else {
  27270. defaultSlot.push(child);
  27271. }
  27272. }
  27273. // ignore single whitespace
  27274. if (defaultSlot.length && !(
  27275. defaultSlot.length === 1 &&
  27276. (defaultSlot[0].text === ' ' || defaultSlot[0].isComment)
  27277. )) {
  27278. slots.default = defaultSlot;
  27279. }
  27280. return slots
  27281. }
  27282. /* */
  27283. function initEvents (vm) {
  27284. vm._events = Object.create(null);
  27285. vm._hasHookEvent = false;
  27286. // init parent attached events
  27287. var listeners = vm.$options._parentListeners;
  27288. if (listeners) {
  27289. updateComponentListeners(vm, listeners);
  27290. }
  27291. }
  27292. var target;
  27293. function add$1 (event, fn, once) {
  27294. if (once) {
  27295. target.$once(event, fn);
  27296. } else {
  27297. target.$on(event, fn);
  27298. }
  27299. }
  27300. function remove$2 (event, fn) {
  27301. target.$off(event, fn);
  27302. }
  27303. function updateComponentListeners (
  27304. vm,
  27305. listeners,
  27306. oldListeners
  27307. ) {
  27308. target = vm;
  27309. updateListeners(listeners, oldListeners || {}, add$1, remove$2, vm);
  27310. }
  27311. function eventsMixin (Vue) {
  27312. var hookRE = /^hook:/;
  27313. Vue.prototype.$on = function (event, fn) {
  27314. var vm = this;(vm._events[event] || (vm._events[event] = [])).push(fn);
  27315. // optimize hook:event cost by using a boolean flag marked at registration
  27316. // instead of a hash lookup
  27317. if (hookRE.test(event)) {
  27318. vm._hasHookEvent = true;
  27319. }
  27320. return vm
  27321. };
  27322. Vue.prototype.$once = function (event, fn) {
  27323. var vm = this;
  27324. function on () {
  27325. vm.$off(event, on);
  27326. fn.apply(vm, arguments);
  27327. }
  27328. on.fn = fn;
  27329. vm.$on(event, on);
  27330. return vm
  27331. };
  27332. Vue.prototype.$off = function (event, fn) {
  27333. var vm = this;
  27334. // all
  27335. if (!arguments.length) {
  27336. vm._events = Object.create(null);
  27337. return vm
  27338. }
  27339. // specific event
  27340. var cbs = vm._events[event];
  27341. if (!cbs) {
  27342. return vm
  27343. }
  27344. if (arguments.length === 1) {
  27345. vm._events[event] = null;
  27346. return vm
  27347. }
  27348. // specific handler
  27349. var cb;
  27350. var i = cbs.length;
  27351. while (i--) {
  27352. cb = cbs[i];
  27353. if (cb === fn || cb.fn === fn) {
  27354. cbs.splice(i, 1);
  27355. break
  27356. }
  27357. }
  27358. return vm
  27359. };
  27360. Vue.prototype.$emit = function (event) {
  27361. var vm = this;
  27362. var cbs = vm._events[event];
  27363. if (cbs) {
  27364. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  27365. var args = toArray(arguments, 1);
  27366. for (var i = 0, l = cbs.length; i < l; i++) {
  27367. cbs[i].apply(vm, args);
  27368. }
  27369. }
  27370. return vm
  27371. };
  27372. }
  27373. /* */
  27374. var activeInstance = null;
  27375. function initLifecycle (vm) {
  27376. var options = vm.$options;
  27377. // locate first non-abstract parent
  27378. var parent = options.parent;
  27379. if (parent && !options.abstract) {
  27380. while (parent.$options.abstract && parent.$parent) {
  27381. parent = parent.$parent;
  27382. }
  27383. parent.$children.push(vm);
  27384. }
  27385. vm.$parent = parent;
  27386. vm.$root = parent ? parent.$root : vm;
  27387. vm.$children = [];
  27388. vm.$refs = {};
  27389. vm._watcher = null;
  27390. vm._inactive = false;
  27391. vm._isMounted = false;
  27392. vm._isDestroyed = false;
  27393. vm._isBeingDestroyed = false;
  27394. }
  27395. function lifecycleMixin (Vue) {
  27396. Vue.prototype._mount = function (
  27397. el,
  27398. hydrating
  27399. ) {
  27400. var vm = this;
  27401. vm.$el = el;
  27402. if (!vm.$options.render) {
  27403. vm.$options.render = createEmptyVNode;
  27404. if (process.env.NODE_ENV !== 'production') {
  27405. /* istanbul ignore if */
  27406. if (vm.$options.template && vm.$options.template.charAt(0) !== '#') {
  27407. warn(
  27408. 'You are using the runtime-only build of Vue where the template ' +
  27409. 'option is not available. Either pre-compile the templates into ' +
  27410. 'render functions, or use the compiler-included build.',
  27411. vm
  27412. );
  27413. } else {
  27414. warn(
  27415. 'Failed to mount component: template or render function not defined.',
  27416. vm
  27417. );
  27418. }
  27419. }
  27420. }
  27421. callHook(vm, 'beforeMount');
  27422. vm._watcher = new Watcher(vm, function updateComponent () {
  27423. vm._update(vm._render(), hydrating);
  27424. }, noop);
  27425. hydrating = false;
  27426. // manually mounted instance, call mounted on self
  27427. // mounted is called for render-created child components in its inserted hook
  27428. if (vm.$vnode == null) {
  27429. vm._isMounted = true;
  27430. callHook(vm, 'mounted');
  27431. }
  27432. return vm
  27433. };
  27434. Vue.prototype._update = function (vnode, hydrating) {
  27435. var vm = this;
  27436. if (vm._isMounted) {
  27437. callHook(vm, 'beforeUpdate');
  27438. }
  27439. var prevEl = vm.$el;
  27440. var prevVnode = vm._vnode;
  27441. var prevActiveInstance = activeInstance;
  27442. activeInstance = vm;
  27443. vm._vnode = vnode;
  27444. // Vue.prototype.__patch__ is injected in entry points
  27445. // based on the rendering backend used.
  27446. if (!prevVnode) {
  27447. // initial render
  27448. vm.$el = vm.__patch__(
  27449. vm.$el, vnode, hydrating, false /* removeOnly */,
  27450. vm.$options._parentElm,
  27451. vm.$options._refElm
  27452. );
  27453. } else {
  27454. // updates
  27455. vm.$el = vm.__patch__(prevVnode, vnode);
  27456. }
  27457. activeInstance = prevActiveInstance;
  27458. // update __vue__ reference
  27459. if (prevEl) {
  27460. prevEl.__vue__ = null;
  27461. }
  27462. if (vm.$el) {
  27463. vm.$el.__vue__ = vm;
  27464. }
  27465. // if parent is an HOC, update its $el as well
  27466. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  27467. vm.$parent.$el = vm.$el;
  27468. }
  27469. // updated hook is called by the scheduler to ensure that children are
  27470. // updated in a parent's updated hook.
  27471. };
  27472. Vue.prototype._updateFromParent = function (
  27473. propsData,
  27474. listeners,
  27475. parentVnode,
  27476. renderChildren
  27477. ) {
  27478. var vm = this;
  27479. var hasChildren = !!(vm.$options._renderChildren || renderChildren);
  27480. vm.$options._parentVnode = parentVnode;
  27481. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  27482. if (vm._vnode) { // update child tree's parent
  27483. vm._vnode.parent = parentVnode;
  27484. }
  27485. vm.$options._renderChildren = renderChildren;
  27486. // update props
  27487. if (propsData && vm.$options.props) {
  27488. observerState.shouldConvert = false;
  27489. if (process.env.NODE_ENV !== 'production') {
  27490. observerState.isSettingProps = true;
  27491. }
  27492. var propKeys = vm.$options._propKeys || [];
  27493. for (var i = 0; i < propKeys.length; i++) {
  27494. var key = propKeys[i];
  27495. vm[key] = validateProp(key, vm.$options.props, propsData, vm);
  27496. }
  27497. observerState.shouldConvert = true;
  27498. if (process.env.NODE_ENV !== 'production') {
  27499. observerState.isSettingProps = false;
  27500. }
  27501. vm.$options.propsData = propsData;
  27502. }
  27503. // update listeners
  27504. if (listeners) {
  27505. var oldListeners = vm.$options._parentListeners;
  27506. vm.$options._parentListeners = listeners;
  27507. updateComponentListeners(vm, listeners, oldListeners);
  27508. }
  27509. // resolve slots + force update if has children
  27510. if (hasChildren) {
  27511. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  27512. vm.$forceUpdate();
  27513. }
  27514. };
  27515. Vue.prototype.$forceUpdate = function () {
  27516. var vm = this;
  27517. if (vm._watcher) {
  27518. vm._watcher.update();
  27519. }
  27520. };
  27521. Vue.prototype.$destroy = function () {
  27522. var vm = this;
  27523. if (vm._isBeingDestroyed) {
  27524. return
  27525. }
  27526. callHook(vm, 'beforeDestroy');
  27527. vm._isBeingDestroyed = true;
  27528. // remove self from parent
  27529. var parent = vm.$parent;
  27530. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  27531. remove$1(parent.$children, vm);
  27532. }
  27533. // teardown watchers
  27534. if (vm._watcher) {
  27535. vm._watcher.teardown();
  27536. }
  27537. var i = vm._watchers.length;
  27538. while (i--) {
  27539. vm._watchers[i].teardown();
  27540. }
  27541. // remove reference from data ob
  27542. // frozen object may not have observer.
  27543. if (vm._data.__ob__) {
  27544. vm._data.__ob__.vmCount--;
  27545. }
  27546. // call the last hook...
  27547. vm._isDestroyed = true;
  27548. callHook(vm, 'destroyed');
  27549. // turn off all instance listeners.
  27550. vm.$off();
  27551. // remove __vue__ reference
  27552. if (vm.$el) {
  27553. vm.$el.__vue__ = null;
  27554. }
  27555. // invoke destroy hooks on current rendered tree
  27556. vm.__patch__(vm._vnode, null);
  27557. };
  27558. }
  27559. function callHook (vm, hook) {
  27560. var handlers = vm.$options[hook];
  27561. if (handlers) {
  27562. for (var i = 0, j = handlers.length; i < j; i++) {
  27563. handlers[i].call(vm);
  27564. }
  27565. }
  27566. if (vm._hasHookEvent) {
  27567. vm.$emit('hook:' + hook);
  27568. }
  27569. }
  27570. /* */
  27571. var queue = [];
  27572. var has$1 = {};
  27573. var circular = {};
  27574. var waiting = false;
  27575. var flushing = false;
  27576. var index = 0;
  27577. /**
  27578. * Reset the scheduler's state.
  27579. */
  27580. function resetSchedulerState () {
  27581. queue.length = 0;
  27582. has$1 = {};
  27583. if (process.env.NODE_ENV !== 'production') {
  27584. circular = {};
  27585. }
  27586. waiting = flushing = false;
  27587. }
  27588. /**
  27589. * Flush both queues and run the watchers.
  27590. */
  27591. function flushSchedulerQueue () {
  27592. flushing = true;
  27593. var watcher, id, vm;
  27594. // Sort queue before flush.
  27595. // This ensures that:
  27596. // 1. Components are updated from parent to child. (because parent is always
  27597. // created before the child)
  27598. // 2. A component's user watchers are run before its render watcher (because
  27599. // user watchers are created before the render watcher)
  27600. // 3. If a component is destroyed during a parent component's watcher run,
  27601. // its watchers can be skipped.
  27602. queue.sort(function (a, b) { return a.id - b.id; });
  27603. // do not cache length because more watchers might be pushed
  27604. // as we run existing watchers
  27605. for (index = 0; index < queue.length; index++) {
  27606. watcher = queue[index];
  27607. id = watcher.id;
  27608. has$1[id] = null;
  27609. watcher.run();
  27610. // in dev build, check and stop circular updates.
  27611. if (process.env.NODE_ENV !== 'production' && has$1[id] != null) {
  27612. circular[id] = (circular[id] || 0) + 1;
  27613. if (circular[id] > config._maxUpdateCount) {
  27614. warn(
  27615. 'You may have an infinite update loop ' + (
  27616. watcher.user
  27617. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  27618. : "in a component render function."
  27619. ),
  27620. watcher.vm
  27621. );
  27622. break
  27623. }
  27624. }
  27625. }
  27626. // call updated hooks
  27627. index = queue.length;
  27628. while (index--) {
  27629. watcher = queue[index];
  27630. vm = watcher.vm;
  27631. if (vm._watcher === watcher && vm._isMounted) {
  27632. callHook(vm, 'updated');
  27633. }
  27634. }
  27635. // devtool hook
  27636. /* istanbul ignore if */
  27637. if (devtools && config.devtools) {
  27638. devtools.emit('flush');
  27639. }
  27640. resetSchedulerState();
  27641. }
  27642. /**
  27643. * Push a watcher into the watcher queue.
  27644. * Jobs with duplicate IDs will be skipped unless it's
  27645. * pushed when the queue is being flushed.
  27646. */
  27647. function queueWatcher (watcher) {
  27648. var id = watcher.id;
  27649. if (has$1[id] == null) {
  27650. has$1[id] = true;
  27651. if (!flushing) {
  27652. queue.push(watcher);
  27653. } else {
  27654. // if already flushing, splice the watcher based on its id
  27655. // if already past its id, it will be run next immediately.
  27656. var i = queue.length - 1;
  27657. while (i >= 0 && queue[i].id > watcher.id) {
  27658. i--;
  27659. }
  27660. queue.splice(Math.max(i, index) + 1, 0, watcher);
  27661. }
  27662. // queue the flush
  27663. if (!waiting) {
  27664. waiting = true;
  27665. nextTick(flushSchedulerQueue);
  27666. }
  27667. }
  27668. }
  27669. /* */
  27670. var uid$2 = 0;
  27671. /**
  27672. * A watcher parses an expression, collects dependencies,
  27673. * and fires callback when the expression value changes.
  27674. * This is used for both the $watch() api and directives.
  27675. */
  27676. var Watcher = function Watcher (
  27677. vm,
  27678. expOrFn,
  27679. cb,
  27680. options
  27681. ) {
  27682. this.vm = vm;
  27683. vm._watchers.push(this);
  27684. // options
  27685. if (options) {
  27686. this.deep = !!options.deep;
  27687. this.user = !!options.user;
  27688. this.lazy = !!options.lazy;
  27689. this.sync = !!options.sync;
  27690. } else {
  27691. this.deep = this.user = this.lazy = this.sync = false;
  27692. }
  27693. this.cb = cb;
  27694. this.id = ++uid$2; // uid for batching
  27695. this.active = true;
  27696. this.dirty = this.lazy; // for lazy watchers
  27697. this.deps = [];
  27698. this.newDeps = [];
  27699. this.depIds = new _Set();
  27700. this.newDepIds = new _Set();
  27701. this.expression = process.env.NODE_ENV !== 'production'
  27702. ? expOrFn.toString()
  27703. : '';
  27704. // parse expression for getter
  27705. if (typeof expOrFn === 'function') {
  27706. this.getter = expOrFn;
  27707. } else {
  27708. this.getter = parsePath(expOrFn);
  27709. if (!this.getter) {
  27710. this.getter = function () {};
  27711. process.env.NODE_ENV !== 'production' && warn(
  27712. "Failed watching path: \"" + expOrFn + "\" " +
  27713. 'Watcher only accepts simple dot-delimited paths. ' +
  27714. 'For full control, use a function instead.',
  27715. vm
  27716. );
  27717. }
  27718. }
  27719. this.value = this.lazy
  27720. ? undefined
  27721. : this.get();
  27722. };
  27723. /**
  27724. * Evaluate the getter, and re-collect dependencies.
  27725. */
  27726. Watcher.prototype.get = function get () {
  27727. pushTarget(this);
  27728. var value = this.getter.call(this.vm, this.vm);
  27729. // "touch" every property so they are all tracked as
  27730. // dependencies for deep watching
  27731. if (this.deep) {
  27732. traverse(value);
  27733. }
  27734. popTarget();
  27735. this.cleanupDeps();
  27736. return value
  27737. };
  27738. /**
  27739. * Add a dependency to this directive.
  27740. */
  27741. Watcher.prototype.addDep = function addDep (dep) {
  27742. var id = dep.id;
  27743. if (!this.newDepIds.has(id)) {
  27744. this.newDepIds.add(id);
  27745. this.newDeps.push(dep);
  27746. if (!this.depIds.has(id)) {
  27747. dep.addSub(this);
  27748. }
  27749. }
  27750. };
  27751. /**
  27752. * Clean up for dependency collection.
  27753. */
  27754. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  27755. var this$1 = this;
  27756. var i = this.deps.length;
  27757. while (i--) {
  27758. var dep = this$1.deps[i];
  27759. if (!this$1.newDepIds.has(dep.id)) {
  27760. dep.removeSub(this$1);
  27761. }
  27762. }
  27763. var tmp = this.depIds;
  27764. this.depIds = this.newDepIds;
  27765. this.newDepIds = tmp;
  27766. this.newDepIds.clear();
  27767. tmp = this.deps;
  27768. this.deps = this.newDeps;
  27769. this.newDeps = tmp;
  27770. this.newDeps.length = 0;
  27771. };
  27772. /**
  27773. * Subscriber interface.
  27774. * Will be called when a dependency changes.
  27775. */
  27776. Watcher.prototype.update = function update () {
  27777. /* istanbul ignore else */
  27778. if (this.lazy) {
  27779. this.dirty = true;
  27780. } else if (this.sync) {
  27781. this.run();
  27782. } else {
  27783. queueWatcher(this);
  27784. }
  27785. };
  27786. /**
  27787. * Scheduler job interface.
  27788. * Will be called by the scheduler.
  27789. */
  27790. Watcher.prototype.run = function run () {
  27791. if (this.active) {
  27792. var value = this.get();
  27793. if (
  27794. value !== this.value ||
  27795. // Deep watchers and watchers on Object/Arrays should fire even
  27796. // when the value is the same, because the value may
  27797. // have mutated.
  27798. isObject(value) ||
  27799. this.deep
  27800. ) {
  27801. // set new value
  27802. var oldValue = this.value;
  27803. this.value = value;
  27804. if (this.user) {
  27805. try {
  27806. this.cb.call(this.vm, value, oldValue);
  27807. } catch (e) {
  27808. /* istanbul ignore else */
  27809. if (config.errorHandler) {
  27810. config.errorHandler.call(null, e, this.vm);
  27811. } else {
  27812. process.env.NODE_ENV !== 'production' && warn(
  27813. ("Error in watcher \"" + (this.expression) + "\""),
  27814. this.vm
  27815. );
  27816. throw e
  27817. }
  27818. }
  27819. } else {
  27820. this.cb.call(this.vm, value, oldValue);
  27821. }
  27822. }
  27823. }
  27824. };
  27825. /**
  27826. * Evaluate the value of the watcher.
  27827. * This only gets called for lazy watchers.
  27828. */
  27829. Watcher.prototype.evaluate = function evaluate () {
  27830. this.value = this.get();
  27831. this.dirty = false;
  27832. };
  27833. /**
  27834. * Depend on all deps collected by this watcher.
  27835. */
  27836. Watcher.prototype.depend = function depend () {
  27837. var this$1 = this;
  27838. var i = this.deps.length;
  27839. while (i--) {
  27840. this$1.deps[i].depend();
  27841. }
  27842. };
  27843. /**
  27844. * Remove self from all dependencies' subscriber list.
  27845. */
  27846. Watcher.prototype.teardown = function teardown () {
  27847. var this$1 = this;
  27848. if (this.active) {
  27849. // remove self from vm's watcher list
  27850. // this is a somewhat expensive operation so we skip it
  27851. // if the vm is being destroyed.
  27852. if (!this.vm._isBeingDestroyed) {
  27853. remove$1(this.vm._watchers, this);
  27854. }
  27855. var i = this.deps.length;
  27856. while (i--) {
  27857. this$1.deps[i].removeSub(this$1);
  27858. }
  27859. this.active = false;
  27860. }
  27861. };
  27862. /**
  27863. * Recursively traverse an object to evoke all converted
  27864. * getters, so that every nested property inside the object
  27865. * is collected as a "deep" dependency.
  27866. */
  27867. var seenObjects = new _Set();
  27868. function traverse (val) {
  27869. seenObjects.clear();
  27870. _traverse(val, seenObjects);
  27871. }
  27872. function _traverse (val, seen) {
  27873. var i, keys;
  27874. var isA = Array.isArray(val);
  27875. if ((!isA && !isObject(val)) || !Object.isExtensible(val)) {
  27876. return
  27877. }
  27878. if (val.__ob__) {
  27879. var depId = val.__ob__.dep.id;
  27880. if (seen.has(depId)) {
  27881. return
  27882. }
  27883. seen.add(depId);
  27884. }
  27885. if (isA) {
  27886. i = val.length;
  27887. while (i--) { _traverse(val[i], seen); }
  27888. } else {
  27889. keys = Object.keys(val);
  27890. i = keys.length;
  27891. while (i--) { _traverse(val[keys[i]], seen); }
  27892. }
  27893. }
  27894. /* */
  27895. function initState (vm) {
  27896. vm._watchers = [];
  27897. var opts = vm.$options;
  27898. if (opts.props) { initProps(vm, opts.props); }
  27899. if (opts.methods) { initMethods(vm, opts.methods); }
  27900. if (opts.data) {
  27901. initData(vm);
  27902. } else {
  27903. observe(vm._data = {}, true /* asRootData */);
  27904. }
  27905. if (opts.computed) { initComputed(vm, opts.computed); }
  27906. if (opts.watch) { initWatch(vm, opts.watch); }
  27907. }
  27908. var isReservedProp = { key: 1, ref: 1, slot: 1 };
  27909. function initProps (vm, props) {
  27910. var propsData = vm.$options.propsData || {};
  27911. var keys = vm.$options._propKeys = Object.keys(props);
  27912. var isRoot = !vm.$parent;
  27913. // root instance props should be converted
  27914. observerState.shouldConvert = isRoot;
  27915. var loop = function ( i ) {
  27916. var key = keys[i];
  27917. /* istanbul ignore else */
  27918. if (process.env.NODE_ENV !== 'production') {
  27919. if (isReservedProp[key]) {
  27920. warn(
  27921. ("\"" + key + "\" is a reserved attribute and cannot be used as component prop."),
  27922. vm
  27923. );
  27924. }
  27925. defineReactive$$1(vm, key, validateProp(key, props, propsData, vm), function () {
  27926. if (vm.$parent && !observerState.isSettingProps) {
  27927. warn(
  27928. "Avoid mutating a prop directly since the value will be " +
  27929. "overwritten whenever the parent component re-renders. " +
  27930. "Instead, use a data or computed property based on the prop's " +
  27931. "value. Prop being mutated: \"" + key + "\"",
  27932. vm
  27933. );
  27934. }
  27935. });
  27936. } else {
  27937. defineReactive$$1(vm, key, validateProp(key, props, propsData, vm));
  27938. }
  27939. };
  27940. for (var i = 0; i < keys.length; i++) loop( i );
  27941. observerState.shouldConvert = true;
  27942. }
  27943. function initData (vm) {
  27944. var data = vm.$options.data;
  27945. data = vm._data = typeof data === 'function'
  27946. ? data.call(vm)
  27947. : data || {};
  27948. if (!isPlainObject(data)) {
  27949. data = {};
  27950. process.env.NODE_ENV !== 'production' && warn(
  27951. 'data functions should return an object:\n' +
  27952. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  27953. vm
  27954. );
  27955. }
  27956. // proxy data on instance
  27957. var keys = Object.keys(data);
  27958. var props = vm.$options.props;
  27959. var i = keys.length;
  27960. while (i--) {
  27961. if (props && hasOwn(props, keys[i])) {
  27962. process.env.NODE_ENV !== 'production' && warn(
  27963. "The data property \"" + (keys[i]) + "\" is already declared as a prop. " +
  27964. "Use prop default value instead.",
  27965. vm
  27966. );
  27967. } else {
  27968. proxy(vm, keys[i]);
  27969. }
  27970. }
  27971. // observe data
  27972. observe(data, true /* asRootData */);
  27973. }
  27974. var computedSharedDefinition = {
  27975. enumerable: true,
  27976. configurable: true,
  27977. get: noop,
  27978. set: noop
  27979. };
  27980. function initComputed (vm, computed) {
  27981. for (var key in computed) {
  27982. /* istanbul ignore if */
  27983. if (process.env.NODE_ENV !== 'production' && key in vm) {
  27984. warn(
  27985. "existing instance property \"" + key + "\" will be " +
  27986. "overwritten by a computed property with the same name.",
  27987. vm
  27988. );
  27989. }
  27990. var userDef = computed[key];
  27991. if (typeof userDef === 'function') {
  27992. computedSharedDefinition.get = makeComputedGetter(userDef, vm);
  27993. computedSharedDefinition.set = noop;
  27994. } else {
  27995. computedSharedDefinition.get = userDef.get
  27996. ? userDef.cache !== false
  27997. ? makeComputedGetter(userDef.get, vm)
  27998. : bind$1(userDef.get, vm)
  27999. : noop;
  28000. computedSharedDefinition.set = userDef.set
  28001. ? bind$1(userDef.set, vm)
  28002. : noop;
  28003. }
  28004. Object.defineProperty(vm, key, computedSharedDefinition);
  28005. }
  28006. }
  28007. function makeComputedGetter (getter, owner) {
  28008. var watcher = new Watcher(owner, getter, noop, {
  28009. lazy: true
  28010. });
  28011. return function computedGetter () {
  28012. if (watcher.dirty) {
  28013. watcher.evaluate();
  28014. }
  28015. if (Dep.target) {
  28016. watcher.depend();
  28017. }
  28018. return watcher.value
  28019. }
  28020. }
  28021. function initMethods (vm, methods) {
  28022. for (var key in methods) {
  28023. vm[key] = methods[key] == null ? noop : bind$1(methods[key], vm);
  28024. if (process.env.NODE_ENV !== 'production' && methods[key] == null) {
  28025. warn(
  28026. "method \"" + key + "\" has an undefined value in the component definition. " +
  28027. "Did you reference the function correctly?",
  28028. vm
  28029. );
  28030. }
  28031. }
  28032. }
  28033. function initWatch (vm, watch) {
  28034. for (var key in watch) {
  28035. var handler = watch[key];
  28036. if (Array.isArray(handler)) {
  28037. for (var i = 0; i < handler.length; i++) {
  28038. createWatcher(vm, key, handler[i]);
  28039. }
  28040. } else {
  28041. createWatcher(vm, key, handler);
  28042. }
  28043. }
  28044. }
  28045. function createWatcher (vm, key, handler) {
  28046. var options;
  28047. if (isPlainObject(handler)) {
  28048. options = handler;
  28049. handler = handler.handler;
  28050. }
  28051. if (typeof handler === 'string') {
  28052. handler = vm[handler];
  28053. }
  28054. vm.$watch(key, handler, options);
  28055. }
  28056. function stateMixin (Vue) {
  28057. // flow somehow has problems with directly declared definition object
  28058. // when using Object.defineProperty, so we have to procedurally build up
  28059. // the object here.
  28060. var dataDef = {};
  28061. dataDef.get = function () {
  28062. return this._data
  28063. };
  28064. if (process.env.NODE_ENV !== 'production') {
  28065. dataDef.set = function (newData) {
  28066. warn(
  28067. 'Avoid replacing instance root $data. ' +
  28068. 'Use nested data properties instead.',
  28069. this
  28070. );
  28071. };
  28072. }
  28073. Object.defineProperty(Vue.prototype, '$data', dataDef);
  28074. Vue.prototype.$set = set$1;
  28075. Vue.prototype.$delete = del;
  28076. Vue.prototype.$watch = function (
  28077. expOrFn,
  28078. cb,
  28079. options
  28080. ) {
  28081. var vm = this;
  28082. options = options || {};
  28083. options.user = true;
  28084. var watcher = new Watcher(vm, expOrFn, cb, options);
  28085. if (options.immediate) {
  28086. cb.call(vm, watcher.value);
  28087. }
  28088. return function unwatchFn () {
  28089. watcher.teardown();
  28090. }
  28091. };
  28092. }
  28093. function proxy (vm, key) {
  28094. if (!isReserved(key)) {
  28095. Object.defineProperty(vm, key, {
  28096. configurable: true,
  28097. enumerable: true,
  28098. get: function proxyGetter () {
  28099. return vm._data[key]
  28100. },
  28101. set: function proxySetter (val) {
  28102. vm._data[key] = val;
  28103. }
  28104. });
  28105. }
  28106. }
  28107. /* */
  28108. var uid = 0;
  28109. function initMixin (Vue) {
  28110. Vue.prototype._init = function (options) {
  28111. var vm = this;
  28112. // a uid
  28113. vm._uid = uid++;
  28114. // a flag to avoid this being observed
  28115. vm._isVue = true;
  28116. // merge options
  28117. if (options && options._isComponent) {
  28118. // optimize internal component instantiation
  28119. // since dynamic options merging is pretty slow, and none of the
  28120. // internal component options needs special treatment.
  28121. initInternalComponent(vm, options);
  28122. } else {
  28123. vm.$options = mergeOptions(
  28124. resolveConstructorOptions(vm.constructor),
  28125. options || {},
  28126. vm
  28127. );
  28128. }
  28129. /* istanbul ignore else */
  28130. if (process.env.NODE_ENV !== 'production') {
  28131. initProxy(vm);
  28132. } else {
  28133. vm._renderProxy = vm;
  28134. }
  28135. // expose real self
  28136. vm._self = vm;
  28137. initLifecycle(vm);
  28138. initEvents(vm);
  28139. initRender(vm);
  28140. callHook(vm, 'beforeCreate');
  28141. initState(vm);
  28142. callHook(vm, 'created');
  28143. if (vm.$options.el) {
  28144. vm.$mount(vm.$options.el);
  28145. }
  28146. };
  28147. }
  28148. function initInternalComponent (vm, options) {
  28149. var opts = vm.$options = Object.create(vm.constructor.options);
  28150. // doing this because it's faster than dynamic enumeration.
  28151. opts.parent = options.parent;
  28152. opts.propsData = options.propsData;
  28153. opts._parentVnode = options._parentVnode;
  28154. opts._parentListeners = options._parentListeners;
  28155. opts._renderChildren = options._renderChildren;
  28156. opts._componentTag = options._componentTag;
  28157. opts._parentElm = options._parentElm;
  28158. opts._refElm = options._refElm;
  28159. if (options.render) {
  28160. opts.render = options.render;
  28161. opts.staticRenderFns = options.staticRenderFns;
  28162. }
  28163. }
  28164. function resolveConstructorOptions (Ctor) {
  28165. var options = Ctor.options;
  28166. if (Ctor.super) {
  28167. var superOptions = Ctor.super.options;
  28168. var cachedSuperOptions = Ctor.superOptions;
  28169. var extendOptions = Ctor.extendOptions;
  28170. if (superOptions !== cachedSuperOptions) {
  28171. // super option changed
  28172. Ctor.superOptions = superOptions;
  28173. extendOptions.render = options.render;
  28174. extendOptions.staticRenderFns = options.staticRenderFns;
  28175. extendOptions._scopeId = options._scopeId;
  28176. options = Ctor.options = mergeOptions(superOptions, extendOptions);
  28177. if (options.name) {
  28178. options.components[options.name] = Ctor;
  28179. }
  28180. }
  28181. }
  28182. return options
  28183. }
  28184. function Vue$3 (options) {
  28185. if (process.env.NODE_ENV !== 'production' &&
  28186. !(this instanceof Vue$3)) {
  28187. warn('Vue is a constructor and should be called with the `new` keyword');
  28188. }
  28189. this._init(options);
  28190. }
  28191. initMixin(Vue$3);
  28192. stateMixin(Vue$3);
  28193. eventsMixin(Vue$3);
  28194. lifecycleMixin(Vue$3);
  28195. renderMixin(Vue$3);
  28196. /* */
  28197. function initUse (Vue) {
  28198. Vue.use = function (plugin) {
  28199. /* istanbul ignore if */
  28200. if (plugin.installed) {
  28201. return
  28202. }
  28203. // additional parameters
  28204. var args = toArray(arguments, 1);
  28205. args.unshift(this);
  28206. if (typeof plugin.install === 'function') {
  28207. plugin.install.apply(plugin, args);
  28208. } else {
  28209. plugin.apply(null, args);
  28210. }
  28211. plugin.installed = true;
  28212. return this
  28213. };
  28214. }
  28215. /* */
  28216. function initMixin$1 (Vue) {
  28217. Vue.mixin = function (mixin) {
  28218. this.options = mergeOptions(this.options, mixin);
  28219. };
  28220. }
  28221. /* */
  28222. function initExtend (Vue) {
  28223. /**
  28224. * Each instance constructor, including Vue, has a unique
  28225. * cid. This enables us to create wrapped "child
  28226. * constructors" for prototypal inheritance and cache them.
  28227. */
  28228. Vue.cid = 0;
  28229. var cid = 1;
  28230. /**
  28231. * Class inheritance
  28232. */
  28233. Vue.extend = function (extendOptions) {
  28234. extendOptions = extendOptions || {};
  28235. var Super = this;
  28236. var SuperId = Super.cid;
  28237. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  28238. if (cachedCtors[SuperId]) {
  28239. return cachedCtors[SuperId]
  28240. }
  28241. var name = extendOptions.name || Super.options.name;
  28242. if (process.env.NODE_ENV !== 'production') {
  28243. if (!/^[a-zA-Z][\w-]*$/.test(name)) {
  28244. warn(
  28245. 'Invalid component name: "' + name + '". Component names ' +
  28246. 'can only contain alphanumeric characters and the hyphen, ' +
  28247. 'and must start with a letter.'
  28248. );
  28249. }
  28250. }
  28251. var Sub = function VueComponent (options) {
  28252. this._init(options);
  28253. };
  28254. Sub.prototype = Object.create(Super.prototype);
  28255. Sub.prototype.constructor = Sub;
  28256. Sub.cid = cid++;
  28257. Sub.options = mergeOptions(
  28258. Super.options,
  28259. extendOptions
  28260. );
  28261. Sub['super'] = Super;
  28262. // allow further extension/mixin/plugin usage
  28263. Sub.extend = Super.extend;
  28264. Sub.mixin = Super.mixin;
  28265. Sub.use = Super.use;
  28266. // create asset registers, so extended classes
  28267. // can have their private assets too.
  28268. config._assetTypes.forEach(function (type) {
  28269. Sub[type] = Super[type];
  28270. });
  28271. // enable recursive self-lookup
  28272. if (name) {
  28273. Sub.options.components[name] = Sub;
  28274. }
  28275. // keep a reference to the super options at extension time.
  28276. // later at instantiation we can check if Super's options have
  28277. // been updated.
  28278. Sub.superOptions = Super.options;
  28279. Sub.extendOptions = extendOptions;
  28280. // cache constructor
  28281. cachedCtors[SuperId] = Sub;
  28282. return Sub
  28283. };
  28284. }
  28285. /* */
  28286. function initAssetRegisters (Vue) {
  28287. /**
  28288. * Create asset registration methods.
  28289. */
  28290. config._assetTypes.forEach(function (type) {
  28291. Vue[type] = function (
  28292. id,
  28293. definition
  28294. ) {
  28295. if (!definition) {
  28296. return this.options[type + 's'][id]
  28297. } else {
  28298. /* istanbul ignore if */
  28299. if (process.env.NODE_ENV !== 'production') {
  28300. if (type === 'component' && config.isReservedTag(id)) {
  28301. warn(
  28302. 'Do not use built-in or reserved HTML elements as component ' +
  28303. 'id: ' + id
  28304. );
  28305. }
  28306. }
  28307. if (type === 'component' && isPlainObject(definition)) {
  28308. definition.name = definition.name || id;
  28309. definition = this.options._base.extend(definition);
  28310. }
  28311. if (type === 'directive' && typeof definition === 'function') {
  28312. definition = { bind: definition, update: definition };
  28313. }
  28314. this.options[type + 's'][id] = definition;
  28315. return definition
  28316. }
  28317. };
  28318. });
  28319. }
  28320. /* */
  28321. var patternTypes = [String, RegExp];
  28322. function getComponentName (opts) {
  28323. return opts && (opts.Ctor.options.name || opts.tag)
  28324. }
  28325. function matches (pattern, name) {
  28326. if (typeof pattern === 'string') {
  28327. return pattern.split(',').indexOf(name) > -1
  28328. } else {
  28329. return pattern.test(name)
  28330. }
  28331. }
  28332. function pruneCache (cache, filter) {
  28333. for (var key in cache) {
  28334. var cachedNode = cache[key];
  28335. if (cachedNode) {
  28336. var name = getComponentName(cachedNode.componentOptions);
  28337. if (name && !filter(name)) {
  28338. pruneCacheEntry(cachedNode);
  28339. cache[key] = null;
  28340. }
  28341. }
  28342. }
  28343. }
  28344. function pruneCacheEntry (vnode) {
  28345. if (vnode) {
  28346. if (!vnode.componentInstance._inactive) {
  28347. callHook(vnode.componentInstance, 'deactivated');
  28348. }
  28349. vnode.componentInstance.$destroy();
  28350. }
  28351. }
  28352. var KeepAlive = {
  28353. name: 'keep-alive',
  28354. abstract: true,
  28355. props: {
  28356. include: patternTypes,
  28357. exclude: patternTypes
  28358. },
  28359. created: function created () {
  28360. this.cache = Object.create(null);
  28361. },
  28362. destroyed: function destroyed () {
  28363. var this$1 = this;
  28364. for (var key in this.cache) {
  28365. pruneCacheEntry(this$1.cache[key]);
  28366. }
  28367. },
  28368. watch: {
  28369. include: function include (val) {
  28370. pruneCache(this.cache, function (name) { return matches(val, name); });
  28371. },
  28372. exclude: function exclude (val) {
  28373. pruneCache(this.cache, function (name) { return !matches(val, name); });
  28374. }
  28375. },
  28376. render: function render () {
  28377. var vnode = getFirstComponentChild(this.$slots.default);
  28378. var componentOptions = vnode && vnode.componentOptions;
  28379. if (componentOptions) {
  28380. // check pattern
  28381. var name = getComponentName(componentOptions);
  28382. if (name && (
  28383. (this.include && !matches(this.include, name)) ||
  28384. (this.exclude && matches(this.exclude, name))
  28385. )) {
  28386. return vnode
  28387. }
  28388. var key = vnode.key == null
  28389. // same constructor may get registered as different local components
  28390. // so cid alone is not enough (#3269)
  28391. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  28392. : vnode.key;
  28393. if (this.cache[key]) {
  28394. vnode.componentInstance = this.cache[key].componentInstance;
  28395. } else {
  28396. this.cache[key] = vnode;
  28397. }
  28398. vnode.data.keepAlive = true;
  28399. }
  28400. return vnode
  28401. }
  28402. };
  28403. var builtInComponents = {
  28404. KeepAlive: KeepAlive
  28405. };
  28406. /* */
  28407. function initGlobalAPI (Vue) {
  28408. // config
  28409. var configDef = {};
  28410. configDef.get = function () { return config; };
  28411. if (process.env.NODE_ENV !== 'production') {
  28412. configDef.set = function () {
  28413. warn(
  28414. 'Do not replace the Vue.config object, set individual fields instead.'
  28415. );
  28416. };
  28417. }
  28418. Object.defineProperty(Vue, 'config', configDef);
  28419. Vue.util = util;
  28420. Vue.set = set$1;
  28421. Vue.delete = del;
  28422. Vue.nextTick = nextTick;
  28423. Vue.options = Object.create(null);
  28424. config._assetTypes.forEach(function (type) {
  28425. Vue.options[type + 's'] = Object.create(null);
  28426. });
  28427. // this is used to identify the "base" constructor to extend all plain-object
  28428. // components with in Weex's multi-instance scenarios.
  28429. Vue.options._base = Vue;
  28430. extend(Vue.options.components, builtInComponents);
  28431. initUse(Vue);
  28432. initMixin$1(Vue);
  28433. initExtend(Vue);
  28434. initAssetRegisters(Vue);
  28435. }
  28436. initGlobalAPI(Vue$3);
  28437. Object.defineProperty(Vue$3.prototype, '$isServer', {
  28438. get: isServerRendering
  28439. });
  28440. Vue$3.version = '2.1.10';
  28441. /* */
  28442. // attributes that should be using props for binding
  28443. var acceptValue = makeMap('input,textarea,option,select');
  28444. var mustUseProp = function (tag, type, attr) {
  28445. return (
  28446. (attr === 'value' && acceptValue(tag)) && type !== 'button' ||
  28447. (attr === 'selected' && tag === 'option') ||
  28448. (attr === 'checked' && tag === 'input') ||
  28449. (attr === 'muted' && tag === 'video')
  28450. )
  28451. };
  28452. var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
  28453. var isBooleanAttr = makeMap(
  28454. 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
  28455. 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
  28456. 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
  28457. 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
  28458. 'required,reversed,scoped,seamless,selected,sortable,translate,' +
  28459. 'truespeed,typemustmatch,visible'
  28460. );
  28461. var xlinkNS = 'http://www.w3.org/1999/xlink';
  28462. var isXlink = function (name) {
  28463. return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
  28464. };
  28465. var getXlinkProp = function (name) {
  28466. return isXlink(name) ? name.slice(6, name.length) : ''
  28467. };
  28468. var isFalsyAttrValue = function (val) {
  28469. return val == null || val === false
  28470. };
  28471. /* */
  28472. function genClassForVnode (vnode) {
  28473. var data = vnode.data;
  28474. var parentNode = vnode;
  28475. var childNode = vnode;
  28476. while (childNode.componentInstance) {
  28477. childNode = childNode.componentInstance._vnode;
  28478. if (childNode.data) {
  28479. data = mergeClassData(childNode.data, data);
  28480. }
  28481. }
  28482. while ((parentNode = parentNode.parent)) {
  28483. if (parentNode.data) {
  28484. data = mergeClassData(data, parentNode.data);
  28485. }
  28486. }
  28487. return genClassFromData(data)
  28488. }
  28489. function mergeClassData (child, parent) {
  28490. return {
  28491. staticClass: concat(child.staticClass, parent.staticClass),
  28492. class: child.class
  28493. ? [child.class, parent.class]
  28494. : parent.class
  28495. }
  28496. }
  28497. function genClassFromData (data) {
  28498. var dynamicClass = data.class;
  28499. var staticClass = data.staticClass;
  28500. if (staticClass || dynamicClass) {
  28501. return concat(staticClass, stringifyClass(dynamicClass))
  28502. }
  28503. /* istanbul ignore next */
  28504. return ''
  28505. }
  28506. function concat (a, b) {
  28507. return a ? b ? (a + ' ' + b) : a : (b || '')
  28508. }
  28509. function stringifyClass (value) {
  28510. var res = '';
  28511. if (!value) {
  28512. return res
  28513. }
  28514. if (typeof value === 'string') {
  28515. return value
  28516. }
  28517. if (Array.isArray(value)) {
  28518. var stringified;
  28519. for (var i = 0, l = value.length; i < l; i++) {
  28520. if (value[i]) {
  28521. if ((stringified = stringifyClass(value[i]))) {
  28522. res += stringified + ' ';
  28523. }
  28524. }
  28525. }
  28526. return res.slice(0, -1)
  28527. }
  28528. if (isObject(value)) {
  28529. for (var key in value) {
  28530. if (value[key]) { res += key + ' '; }
  28531. }
  28532. return res.slice(0, -1)
  28533. }
  28534. /* istanbul ignore next */
  28535. return res
  28536. }
  28537. /* */
  28538. var namespaceMap = {
  28539. svg: 'http://www.w3.org/2000/svg',
  28540. math: 'http://www.w3.org/1998/Math/MathML'
  28541. };
  28542. var isHTMLTag = makeMap(
  28543. 'html,body,base,head,link,meta,style,title,' +
  28544. 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
  28545. 'div,dd,dl,dt,figcaption,figure,hr,img,li,main,ol,p,pre,ul,' +
  28546. 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
  28547. 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
  28548. 'embed,object,param,source,canvas,script,noscript,del,ins,' +
  28549. 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
  28550. 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
  28551. 'output,progress,select,textarea,' +
  28552. 'details,dialog,menu,menuitem,summary,' +
  28553. 'content,element,shadow,template'
  28554. );
  28555. // this map is intentionally selective, only covering SVG elements that may
  28556. // contain child elements.
  28557. var isSVG = makeMap(
  28558. 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,' +
  28559. 'font-face,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
  28560. 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
  28561. true
  28562. );
  28563. var isPreTag = function (tag) { return tag === 'pre'; };
  28564. var isReservedTag = function (tag) {
  28565. return isHTMLTag(tag) || isSVG(tag)
  28566. };
  28567. function getTagNamespace (tag) {
  28568. if (isSVG(tag)) {
  28569. return 'svg'
  28570. }
  28571. // basic support for MathML
  28572. // note it doesn't support other MathML elements being component roots
  28573. if (tag === 'math') {
  28574. return 'math'
  28575. }
  28576. }
  28577. var unknownElementCache = Object.create(null);
  28578. function isUnknownElement (tag) {
  28579. /* istanbul ignore if */
  28580. if (!inBrowser) {
  28581. return true
  28582. }
  28583. if (isReservedTag(tag)) {
  28584. return false
  28585. }
  28586. tag = tag.toLowerCase();
  28587. /* istanbul ignore if */
  28588. if (unknownElementCache[tag] != null) {
  28589. return unknownElementCache[tag]
  28590. }
  28591. var el = document.createElement(tag);
  28592. if (tag.indexOf('-') > -1) {
  28593. // http://stackoverflow.com/a/28210364/1070244
  28594. return (unknownElementCache[tag] = (
  28595. el.constructor === window.HTMLUnknownElement ||
  28596. el.constructor === window.HTMLElement
  28597. ))
  28598. } else {
  28599. return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
  28600. }
  28601. }
  28602. /* */
  28603. /**
  28604. * Query an element selector if it's not an element already.
  28605. */
  28606. function query (el) {
  28607. if (typeof el === 'string') {
  28608. var selector = el;
  28609. el = document.querySelector(el);
  28610. if (!el) {
  28611. process.env.NODE_ENV !== 'production' && warn(
  28612. 'Cannot find element: ' + selector
  28613. );
  28614. return document.createElement('div')
  28615. }
  28616. }
  28617. return el
  28618. }
  28619. /* */
  28620. function createElement$1 (tagName, vnode) {
  28621. var elm = document.createElement(tagName);
  28622. if (tagName !== 'select') {
  28623. return elm
  28624. }
  28625. if (vnode.data && vnode.data.attrs && 'multiple' in vnode.data.attrs) {
  28626. elm.setAttribute('multiple', 'multiple');
  28627. }
  28628. return elm
  28629. }
  28630. function createElementNS (namespace, tagName) {
  28631. return document.createElementNS(namespaceMap[namespace], tagName)
  28632. }
  28633. function createTextNode (text) {
  28634. return document.createTextNode(text)
  28635. }
  28636. function createComment (text) {
  28637. return document.createComment(text)
  28638. }
  28639. function insertBefore (parentNode, newNode, referenceNode) {
  28640. parentNode.insertBefore(newNode, referenceNode);
  28641. }
  28642. function removeChild (node, child) {
  28643. node.removeChild(child);
  28644. }
  28645. function appendChild (node, child) {
  28646. node.appendChild(child);
  28647. }
  28648. function parentNode (node) {
  28649. return node.parentNode
  28650. }
  28651. function nextSibling (node) {
  28652. return node.nextSibling
  28653. }
  28654. function tagName (node) {
  28655. return node.tagName
  28656. }
  28657. function setTextContent (node, text) {
  28658. node.textContent = text;
  28659. }
  28660. function setAttribute (node, key, val) {
  28661. node.setAttribute(key, val);
  28662. }
  28663. var nodeOps = Object.freeze({
  28664. createElement: createElement$1,
  28665. createElementNS: createElementNS,
  28666. createTextNode: createTextNode,
  28667. createComment: createComment,
  28668. insertBefore: insertBefore,
  28669. removeChild: removeChild,
  28670. appendChild: appendChild,
  28671. parentNode: parentNode,
  28672. nextSibling: nextSibling,
  28673. tagName: tagName,
  28674. setTextContent: setTextContent,
  28675. setAttribute: setAttribute
  28676. });
  28677. /* */
  28678. var ref = {
  28679. create: function create (_, vnode) {
  28680. registerRef(vnode);
  28681. },
  28682. update: function update (oldVnode, vnode) {
  28683. if (oldVnode.data.ref !== vnode.data.ref) {
  28684. registerRef(oldVnode, true);
  28685. registerRef(vnode);
  28686. }
  28687. },
  28688. destroy: function destroy (vnode) {
  28689. registerRef(vnode, true);
  28690. }
  28691. };
  28692. function registerRef (vnode, isRemoval) {
  28693. var key = vnode.data.ref;
  28694. if (!key) { return }
  28695. var vm = vnode.context;
  28696. var ref = vnode.componentInstance || vnode.elm;
  28697. var refs = vm.$refs;
  28698. if (isRemoval) {
  28699. if (Array.isArray(refs[key])) {
  28700. remove$1(refs[key], ref);
  28701. } else if (refs[key] === ref) {
  28702. refs[key] = undefined;
  28703. }
  28704. } else {
  28705. if (vnode.data.refInFor) {
  28706. if (Array.isArray(refs[key]) && refs[key].indexOf(ref) < 0) {
  28707. refs[key].push(ref);
  28708. } else {
  28709. refs[key] = [ref];
  28710. }
  28711. } else {
  28712. refs[key] = ref;
  28713. }
  28714. }
  28715. }
  28716. /**
  28717. * Virtual DOM patching algorithm based on Snabbdom by
  28718. * Simon Friis Vindum (@paldepind)
  28719. * Licensed under the MIT License
  28720. * https://github.com/paldepind/snabbdom/blob/master/LICENSE
  28721. *
  28722. * modified by Evan You (@yyx990803)
  28723. *
  28724. /*
  28725. * Not type-checking this because this file is perf-critical and the cost
  28726. * of making flow understand it is not worth it.
  28727. */
  28728. var emptyNode = new VNode('', {}, []);
  28729. var hooks$1 = ['create', 'activate', 'update', 'remove', 'destroy'];
  28730. function isUndef (s) {
  28731. return s == null
  28732. }
  28733. function isDef (s) {
  28734. return s != null
  28735. }
  28736. function sameVnode (vnode1, vnode2) {
  28737. return (
  28738. vnode1.key === vnode2.key &&
  28739. vnode1.tag === vnode2.tag &&
  28740. vnode1.isComment === vnode2.isComment &&
  28741. !vnode1.data === !vnode2.data
  28742. )
  28743. }
  28744. function createKeyToOldIdx (children, beginIdx, endIdx) {
  28745. var i, key;
  28746. var map = {};
  28747. for (i = beginIdx; i <= endIdx; ++i) {
  28748. key = children[i].key;
  28749. if (isDef(key)) { map[key] = i; }
  28750. }
  28751. return map
  28752. }
  28753. function createPatchFunction (backend) {
  28754. var i, j;
  28755. var cbs = {};
  28756. var modules = backend.modules;
  28757. var nodeOps = backend.nodeOps;
  28758. for (i = 0; i < hooks$1.length; ++i) {
  28759. cbs[hooks$1[i]] = [];
  28760. for (j = 0; j < modules.length; ++j) {
  28761. if (modules[j][hooks$1[i]] !== undefined) { cbs[hooks$1[i]].push(modules[j][hooks$1[i]]); }
  28762. }
  28763. }
  28764. function emptyNodeAt (elm) {
  28765. return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
  28766. }
  28767. function createRmCb (childElm, listeners) {
  28768. function remove$$1 () {
  28769. if (--remove$$1.listeners === 0) {
  28770. removeNode(childElm);
  28771. }
  28772. }
  28773. remove$$1.listeners = listeners;
  28774. return remove$$1
  28775. }
  28776. function removeNode (el) {
  28777. var parent = nodeOps.parentNode(el);
  28778. // element may have already been removed due to v-html / v-text
  28779. if (parent) {
  28780. nodeOps.removeChild(parent, el);
  28781. }
  28782. }
  28783. var inPre = 0;
  28784. function createElm (vnode, insertedVnodeQueue, parentElm, refElm, nested) {
  28785. vnode.isRootInsert = !nested; // for transition enter check
  28786. if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
  28787. return
  28788. }
  28789. var data = vnode.data;
  28790. var children = vnode.children;
  28791. var tag = vnode.tag;
  28792. if (isDef(tag)) {
  28793. if (process.env.NODE_ENV !== 'production') {
  28794. if (data && data.pre) {
  28795. inPre++;
  28796. }
  28797. if (
  28798. !inPre &&
  28799. !vnode.ns &&
  28800. !(config.ignoredElements.length && config.ignoredElements.indexOf(tag) > -1) &&
  28801. config.isUnknownElement(tag)
  28802. ) {
  28803. warn(
  28804. 'Unknown custom element: <' + tag + '> - did you ' +
  28805. 'register the component correctly? For recursive components, ' +
  28806. 'make sure to provide the "name" option.',
  28807. vnode.context
  28808. );
  28809. }
  28810. }
  28811. vnode.elm = vnode.ns
  28812. ? nodeOps.createElementNS(vnode.ns, tag)
  28813. : nodeOps.createElement(tag, vnode);
  28814. setScope(vnode);
  28815. /* istanbul ignore if */
  28816. {
  28817. createChildren(vnode, children, insertedVnodeQueue);
  28818. if (isDef(data)) {
  28819. invokeCreateHooks(vnode, insertedVnodeQueue);
  28820. }
  28821. insert(parentElm, vnode.elm, refElm);
  28822. }
  28823. if (process.env.NODE_ENV !== 'production' && data && data.pre) {
  28824. inPre--;
  28825. }
  28826. } else if (vnode.isComment) {
  28827. vnode.elm = nodeOps.createComment(vnode.text);
  28828. insert(parentElm, vnode.elm, refElm);
  28829. } else {
  28830. vnode.elm = nodeOps.createTextNode(vnode.text);
  28831. insert(parentElm, vnode.elm, refElm);
  28832. }
  28833. }
  28834. function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
  28835. var i = vnode.data;
  28836. if (isDef(i)) {
  28837. var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
  28838. if (isDef(i = i.hook) && isDef(i = i.init)) {
  28839. i(vnode, false /* hydrating */, parentElm, refElm);
  28840. }
  28841. // after calling the init hook, if the vnode is a child component
  28842. // it should've created a child instance and mounted it. the child
  28843. // component also has set the placeholder vnode's elm.
  28844. // in that case we can just return the element and be done.
  28845. if (isDef(vnode.componentInstance)) {
  28846. initComponent(vnode, insertedVnodeQueue);
  28847. if (isReactivated) {
  28848. reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
  28849. }
  28850. return true
  28851. }
  28852. }
  28853. }
  28854. function initComponent (vnode, insertedVnodeQueue) {
  28855. if (vnode.data.pendingInsert) {
  28856. insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
  28857. }
  28858. vnode.elm = vnode.componentInstance.$el;
  28859. if (isPatchable(vnode)) {
  28860. invokeCreateHooks(vnode, insertedVnodeQueue);
  28861. setScope(vnode);
  28862. } else {
  28863. // empty component root.
  28864. // skip all element-related modules except for ref (#3455)
  28865. registerRef(vnode);
  28866. // make sure to invoke the insert hook
  28867. insertedVnodeQueue.push(vnode);
  28868. }
  28869. }
  28870. function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
  28871. var i;
  28872. // hack for #4339: a reactivated component with inner transition
  28873. // does not trigger because the inner node's created hooks are not called
  28874. // again. It's not ideal to involve module-specific logic in here but
  28875. // there doesn't seem to be a better way to do it.
  28876. var innerNode = vnode;
  28877. while (innerNode.componentInstance) {
  28878. innerNode = innerNode.componentInstance._vnode;
  28879. if (isDef(i = innerNode.data) && isDef(i = i.transition)) {
  28880. for (i = 0; i < cbs.activate.length; ++i) {
  28881. cbs.activate[i](emptyNode, innerNode);
  28882. }
  28883. insertedVnodeQueue.push(innerNode);
  28884. break
  28885. }
  28886. }
  28887. // unlike a newly created component,
  28888. // a reactivated keep-alive component doesn't insert itself
  28889. insert(parentElm, vnode.elm, refElm);
  28890. }
  28891. function insert (parent, elm, ref) {
  28892. if (parent) {
  28893. if (ref) {
  28894. nodeOps.insertBefore(parent, elm, ref);
  28895. } else {
  28896. nodeOps.appendChild(parent, elm);
  28897. }
  28898. }
  28899. }
  28900. function createChildren (vnode, children, insertedVnodeQueue) {
  28901. if (Array.isArray(children)) {
  28902. for (var i = 0; i < children.length; ++i) {
  28903. createElm(children[i], insertedVnodeQueue, vnode.elm, null, true);
  28904. }
  28905. } else if (isPrimitive(vnode.text)) {
  28906. nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(vnode.text));
  28907. }
  28908. }
  28909. function isPatchable (vnode) {
  28910. while (vnode.componentInstance) {
  28911. vnode = vnode.componentInstance._vnode;
  28912. }
  28913. return isDef(vnode.tag)
  28914. }
  28915. function invokeCreateHooks (vnode, insertedVnodeQueue) {
  28916. for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
  28917. cbs.create[i$1](emptyNode, vnode);
  28918. }
  28919. i = vnode.data.hook; // Reuse variable
  28920. if (isDef(i)) {
  28921. if (i.create) { i.create(emptyNode, vnode); }
  28922. if (i.insert) { insertedVnodeQueue.push(vnode); }
  28923. }
  28924. }
  28925. // set scope id attribute for scoped CSS.
  28926. // this is implemented as a special case to avoid the overhead
  28927. // of going through the normal attribute patching process.
  28928. function setScope (vnode) {
  28929. var i;
  28930. if (isDef(i = vnode.context) && isDef(i = i.$options._scopeId)) {
  28931. nodeOps.setAttribute(vnode.elm, i, '');
  28932. }
  28933. if (isDef(i = activeInstance) &&
  28934. i !== vnode.context &&
  28935. isDef(i = i.$options._scopeId)) {
  28936. nodeOps.setAttribute(vnode.elm, i, '');
  28937. }
  28938. }
  28939. function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
  28940. for (; startIdx <= endIdx; ++startIdx) {
  28941. createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm);
  28942. }
  28943. }
  28944. function invokeDestroyHook (vnode) {
  28945. var i, j;
  28946. var data = vnode.data;
  28947. if (isDef(data)) {
  28948. if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }
  28949. for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }
  28950. }
  28951. if (isDef(i = vnode.children)) {
  28952. for (j = 0; j < vnode.children.length; ++j) {
  28953. invokeDestroyHook(vnode.children[j]);
  28954. }
  28955. }
  28956. }
  28957. function removeVnodes (parentElm, vnodes, startIdx, endIdx) {
  28958. for (; startIdx <= endIdx; ++startIdx) {
  28959. var ch = vnodes[startIdx];
  28960. if (isDef(ch)) {
  28961. if (isDef(ch.tag)) {
  28962. removeAndInvokeRemoveHook(ch);
  28963. invokeDestroyHook(ch);
  28964. } else { // Text node
  28965. removeNode(ch.elm);
  28966. }
  28967. }
  28968. }
  28969. }
  28970. function removeAndInvokeRemoveHook (vnode, rm) {
  28971. if (rm || isDef(vnode.data)) {
  28972. var listeners = cbs.remove.length + 1;
  28973. if (!rm) {
  28974. // directly removing
  28975. rm = createRmCb(vnode.elm, listeners);
  28976. } else {
  28977. // we have a recursively passed down rm callback
  28978. // increase the listeners count
  28979. rm.listeners += listeners;
  28980. }
  28981. // recursively invoke hooks on child component root node
  28982. if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
  28983. removeAndInvokeRemoveHook(i, rm);
  28984. }
  28985. for (i = 0; i < cbs.remove.length; ++i) {
  28986. cbs.remove[i](vnode, rm);
  28987. }
  28988. if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
  28989. i(vnode, rm);
  28990. } else {
  28991. rm();
  28992. }
  28993. } else {
  28994. removeNode(vnode.elm);
  28995. }
  28996. }
  28997. function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
  28998. var oldStartIdx = 0;
  28999. var newStartIdx = 0;
  29000. var oldEndIdx = oldCh.length - 1;
  29001. var oldStartVnode = oldCh[0];
  29002. var oldEndVnode = oldCh[oldEndIdx];
  29003. var newEndIdx = newCh.length - 1;
  29004. var newStartVnode = newCh[0];
  29005. var newEndVnode = newCh[newEndIdx];
  29006. var oldKeyToIdx, idxInOld, elmToMove, refElm;
  29007. // removeOnly is a special flag used only by <transition-group>
  29008. // to ensure removed elements stay in correct relative positions
  29009. // during leaving transitions
  29010. var canMove = !removeOnly;
  29011. while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
  29012. if (isUndef(oldStartVnode)) {
  29013. oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
  29014. } else if (isUndef(oldEndVnode)) {
  29015. oldEndVnode = oldCh[--oldEndIdx];
  29016. } else if (sameVnode(oldStartVnode, newStartVnode)) {
  29017. patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue);
  29018. oldStartVnode = oldCh[++oldStartIdx];
  29019. newStartVnode = newCh[++newStartIdx];
  29020. } else if (sameVnode(oldEndVnode, newEndVnode)) {
  29021. patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue);
  29022. oldEndVnode = oldCh[--oldEndIdx];
  29023. newEndVnode = newCh[--newEndIdx];
  29024. } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right
  29025. patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue);
  29026. canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
  29027. oldStartVnode = oldCh[++oldStartIdx];
  29028. newEndVnode = newCh[--newEndIdx];
  29029. } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left
  29030. patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue);
  29031. canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
  29032. oldEndVnode = oldCh[--oldEndIdx];
  29033. newStartVnode = newCh[++newStartIdx];
  29034. } else {
  29035. if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }
  29036. idxInOld = isDef(newStartVnode.key) ? oldKeyToIdx[newStartVnode.key] : null;
  29037. if (isUndef(idxInOld)) { // New element
  29038. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);
  29039. newStartVnode = newCh[++newStartIdx];
  29040. } else {
  29041. elmToMove = oldCh[idxInOld];
  29042. /* istanbul ignore if */
  29043. if (process.env.NODE_ENV !== 'production' && !elmToMove) {
  29044. warn(
  29045. 'It seems there are duplicate keys that is causing an update error. ' +
  29046. 'Make sure each v-for item has a unique key.'
  29047. );
  29048. }
  29049. if (sameVnode(elmToMove, newStartVnode)) {
  29050. patchVnode(elmToMove, newStartVnode, insertedVnodeQueue);
  29051. oldCh[idxInOld] = undefined;
  29052. canMove && nodeOps.insertBefore(parentElm, newStartVnode.elm, oldStartVnode.elm);
  29053. newStartVnode = newCh[++newStartIdx];
  29054. } else {
  29055. // same key but different element. treat as new element
  29056. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);
  29057. newStartVnode = newCh[++newStartIdx];
  29058. }
  29059. }
  29060. }
  29061. }
  29062. if (oldStartIdx > oldEndIdx) {
  29063. refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
  29064. addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
  29065. } else if (newStartIdx > newEndIdx) {
  29066. removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);
  29067. }
  29068. }
  29069. function patchVnode (oldVnode, vnode, insertedVnodeQueue, removeOnly) {
  29070. if (oldVnode === vnode) {
  29071. return
  29072. }
  29073. // reuse element for static trees.
  29074. // note we only do this if the vnode is cloned -
  29075. // if the new node is not cloned it means the render functions have been
  29076. // reset by the hot-reload-api and we need to do a proper re-render.
  29077. if (vnode.isStatic &&
  29078. oldVnode.isStatic &&
  29079. vnode.key === oldVnode.key &&
  29080. (vnode.isCloned || vnode.isOnce)) {
  29081. vnode.elm = oldVnode.elm;
  29082. vnode.componentInstance = oldVnode.componentInstance;
  29083. return
  29084. }
  29085. var i;
  29086. var data = vnode.data;
  29087. var hasData = isDef(data);
  29088. if (hasData && isDef(i = data.hook) && isDef(i = i.prepatch)) {
  29089. i(oldVnode, vnode);
  29090. }
  29091. var elm = vnode.elm = oldVnode.elm;
  29092. var oldCh = oldVnode.children;
  29093. var ch = vnode.children;
  29094. if (hasData && isPatchable(vnode)) {
  29095. for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }
  29096. if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }
  29097. }
  29098. if (isUndef(vnode.text)) {
  29099. if (isDef(oldCh) && isDef(ch)) {
  29100. if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }
  29101. } else if (isDef(ch)) {
  29102. if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
  29103. addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
  29104. } else if (isDef(oldCh)) {
  29105. removeVnodes(elm, oldCh, 0, oldCh.length - 1);
  29106. } else if (isDef(oldVnode.text)) {
  29107. nodeOps.setTextContent(elm, '');
  29108. }
  29109. } else if (oldVnode.text !== vnode.text) {
  29110. nodeOps.setTextContent(elm, vnode.text);
  29111. }
  29112. if (hasData) {
  29113. if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }
  29114. }
  29115. }
  29116. function invokeInsertHook (vnode, queue, initial) {
  29117. // delay insert hooks for component root nodes, invoke them after the
  29118. // element is really inserted
  29119. if (initial && vnode.parent) {
  29120. vnode.parent.data.pendingInsert = queue;
  29121. } else {
  29122. for (var i = 0; i < queue.length; ++i) {
  29123. queue[i].data.hook.insert(queue[i]);
  29124. }
  29125. }
  29126. }
  29127. var bailed = false;
  29128. // list of modules that can skip create hook during hydration because they
  29129. // are already rendered on the client or has no need for initialization
  29130. var isRenderedModule = makeMap('attrs,style,class,staticClass,staticStyle,key');
  29131. // Note: this is a browser-only function so we can assume elms are DOM nodes.
  29132. function hydrate (elm, vnode, insertedVnodeQueue) {
  29133. if (process.env.NODE_ENV !== 'production') {
  29134. if (!assertNodeMatch(elm, vnode)) {
  29135. return false
  29136. }
  29137. }
  29138. vnode.elm = elm;
  29139. var tag = vnode.tag;
  29140. var data = vnode.data;
  29141. var children = vnode.children;
  29142. if (isDef(data)) {
  29143. if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }
  29144. if (isDef(i = vnode.componentInstance)) {
  29145. // child component. it should have hydrated its own tree.
  29146. initComponent(vnode, insertedVnodeQueue);
  29147. return true
  29148. }
  29149. }
  29150. if (isDef(tag)) {
  29151. if (isDef(children)) {
  29152. // empty element, allow client to pick up and populate children
  29153. if (!elm.hasChildNodes()) {
  29154. createChildren(vnode, children, insertedVnodeQueue);
  29155. } else {
  29156. var childrenMatch = true;
  29157. var childNode = elm.firstChild;
  29158. for (var i$1 = 0; i$1 < children.length; i$1++) {
  29159. if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue)) {
  29160. childrenMatch = false;
  29161. break
  29162. }
  29163. childNode = childNode.nextSibling;
  29164. }
  29165. // if childNode is not null, it means the actual childNodes list is
  29166. // longer than the virtual children list.
  29167. if (!childrenMatch || childNode) {
  29168. if (process.env.NODE_ENV !== 'production' &&
  29169. typeof console !== 'undefined' &&
  29170. !bailed) {
  29171. bailed = true;
  29172. console.warn('Parent: ', elm);
  29173. console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
  29174. }
  29175. return false
  29176. }
  29177. }
  29178. }
  29179. if (isDef(data)) {
  29180. for (var key in data) {
  29181. if (!isRenderedModule(key)) {
  29182. invokeCreateHooks(vnode, insertedVnodeQueue);
  29183. break
  29184. }
  29185. }
  29186. }
  29187. } else if (elm.data !== vnode.text) {
  29188. elm.data = vnode.text;
  29189. }
  29190. return true
  29191. }
  29192. function assertNodeMatch (node, vnode) {
  29193. if (vnode.tag) {
  29194. return (
  29195. vnode.tag.indexOf('vue-component') === 0 ||
  29196. vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())
  29197. )
  29198. } else {
  29199. return node.nodeType === (vnode.isComment ? 8 : 3)
  29200. }
  29201. }
  29202. return function patch (oldVnode, vnode, hydrating, removeOnly, parentElm, refElm) {
  29203. if (!vnode) {
  29204. if (oldVnode) { invokeDestroyHook(oldVnode); }
  29205. return
  29206. }
  29207. var isInitialPatch = false;
  29208. var insertedVnodeQueue = [];
  29209. if (!oldVnode) {
  29210. // empty mount (likely as component), create new root element
  29211. isInitialPatch = true;
  29212. createElm(vnode, insertedVnodeQueue, parentElm, refElm);
  29213. } else {
  29214. var isRealElement = isDef(oldVnode.nodeType);
  29215. if (!isRealElement && sameVnode(oldVnode, vnode)) {
  29216. // patch existing root node
  29217. patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly);
  29218. } else {
  29219. if (isRealElement) {
  29220. // mounting to a real element
  29221. // check if this is server-rendered content and if we can perform
  29222. // a successful hydration.
  29223. if (oldVnode.nodeType === 1 && oldVnode.hasAttribute('server-rendered')) {
  29224. oldVnode.removeAttribute('server-rendered');
  29225. hydrating = true;
  29226. }
  29227. if (hydrating) {
  29228. if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
  29229. invokeInsertHook(vnode, insertedVnodeQueue, true);
  29230. return oldVnode
  29231. } else if (process.env.NODE_ENV !== 'production') {
  29232. warn(
  29233. 'The client-side rendered virtual DOM tree is not matching ' +
  29234. 'server-rendered content. This is likely caused by incorrect ' +
  29235. 'HTML markup, for example nesting block-level elements inside ' +
  29236. '<p>, or missing <tbody>. Bailing hydration and performing ' +
  29237. 'full client-side render.'
  29238. );
  29239. }
  29240. }
  29241. // either not server-rendered, or hydration failed.
  29242. // create an empty node and replace it
  29243. oldVnode = emptyNodeAt(oldVnode);
  29244. }
  29245. // replacing existing element
  29246. var oldElm = oldVnode.elm;
  29247. var parentElm$1 = nodeOps.parentNode(oldElm);
  29248. createElm(
  29249. vnode,
  29250. insertedVnodeQueue,
  29251. // extremely rare edge case: do not insert if old element is in a
  29252. // leaving transition. Only happens when combining transition +
  29253. // keep-alive + HOCs. (#4590)
  29254. oldElm._leaveCb ? null : parentElm$1,
  29255. nodeOps.nextSibling(oldElm)
  29256. );
  29257. if (vnode.parent) {
  29258. // component root element replaced.
  29259. // update parent placeholder node element, recursively
  29260. var ancestor = vnode.parent;
  29261. while (ancestor) {
  29262. ancestor.elm = vnode.elm;
  29263. ancestor = ancestor.parent;
  29264. }
  29265. if (isPatchable(vnode)) {
  29266. for (var i = 0; i < cbs.create.length; ++i) {
  29267. cbs.create[i](emptyNode, vnode.parent);
  29268. }
  29269. }
  29270. }
  29271. if (parentElm$1 !== null) {
  29272. removeVnodes(parentElm$1, [oldVnode], 0, 0);
  29273. } else if (isDef(oldVnode.tag)) {
  29274. invokeDestroyHook(oldVnode);
  29275. }
  29276. }
  29277. }
  29278. invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
  29279. return vnode.elm
  29280. }
  29281. }
  29282. /* */
  29283. var directives = {
  29284. create: updateDirectives,
  29285. update: updateDirectives,
  29286. destroy: function unbindDirectives (vnode) {
  29287. updateDirectives(vnode, emptyNode);
  29288. }
  29289. };
  29290. function updateDirectives (oldVnode, vnode) {
  29291. if (oldVnode.data.directives || vnode.data.directives) {
  29292. _update(oldVnode, vnode);
  29293. }
  29294. }
  29295. function _update (oldVnode, vnode) {
  29296. var isCreate = oldVnode === emptyNode;
  29297. var isDestroy = vnode === emptyNode;
  29298. var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
  29299. var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
  29300. var dirsWithInsert = [];
  29301. var dirsWithPostpatch = [];
  29302. var key, oldDir, dir;
  29303. for (key in newDirs) {
  29304. oldDir = oldDirs[key];
  29305. dir = newDirs[key];
  29306. if (!oldDir) {
  29307. // new directive, bind
  29308. callHook$1(dir, 'bind', vnode, oldVnode);
  29309. if (dir.def && dir.def.inserted) {
  29310. dirsWithInsert.push(dir);
  29311. }
  29312. } else {
  29313. // existing directive, update
  29314. dir.oldValue = oldDir.value;
  29315. callHook$1(dir, 'update', vnode, oldVnode);
  29316. if (dir.def && dir.def.componentUpdated) {
  29317. dirsWithPostpatch.push(dir);
  29318. }
  29319. }
  29320. }
  29321. if (dirsWithInsert.length) {
  29322. var callInsert = function () {
  29323. for (var i = 0; i < dirsWithInsert.length; i++) {
  29324. callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);
  29325. }
  29326. };
  29327. if (isCreate) {
  29328. mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', callInsert, 'dir-insert');
  29329. } else {
  29330. callInsert();
  29331. }
  29332. }
  29333. if (dirsWithPostpatch.length) {
  29334. mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'postpatch', function () {
  29335. for (var i = 0; i < dirsWithPostpatch.length; i++) {
  29336. callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
  29337. }
  29338. }, 'dir-postpatch');
  29339. }
  29340. if (!isCreate) {
  29341. for (key in oldDirs) {
  29342. if (!newDirs[key]) {
  29343. // no longer present, unbind
  29344. callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
  29345. }
  29346. }
  29347. }
  29348. }
  29349. var emptyModifiers = Object.create(null);
  29350. function normalizeDirectives$1 (
  29351. dirs,
  29352. vm
  29353. ) {
  29354. var res = Object.create(null);
  29355. if (!dirs) {
  29356. return res
  29357. }
  29358. var i, dir;
  29359. for (i = 0; i < dirs.length; i++) {
  29360. dir = dirs[i];
  29361. if (!dir.modifiers) {
  29362. dir.modifiers = emptyModifiers;
  29363. }
  29364. res[getRawDirName(dir)] = dir;
  29365. dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
  29366. }
  29367. return res
  29368. }
  29369. function getRawDirName (dir) {
  29370. return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.')))
  29371. }
  29372. function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) {
  29373. var fn = dir.def && dir.def[hook];
  29374. if (fn) {
  29375. fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
  29376. }
  29377. }
  29378. var baseModules = [
  29379. ref,
  29380. directives
  29381. ];
  29382. /* */
  29383. function updateAttrs (oldVnode, vnode) {
  29384. if (!oldVnode.data.attrs && !vnode.data.attrs) {
  29385. return
  29386. }
  29387. var key, cur, old;
  29388. var elm = vnode.elm;
  29389. var oldAttrs = oldVnode.data.attrs || {};
  29390. var attrs = vnode.data.attrs || {};
  29391. // clone observed objects, as the user probably wants to mutate it
  29392. if (attrs.__ob__) {
  29393. attrs = vnode.data.attrs = extend({}, attrs);
  29394. }
  29395. for (key in attrs) {
  29396. cur = attrs[key];
  29397. old = oldAttrs[key];
  29398. if (old !== cur) {
  29399. setAttr(elm, key, cur);
  29400. }
  29401. }
  29402. // #4391: in IE9, setting type can reset value for input[type=radio]
  29403. /* istanbul ignore if */
  29404. if (isIE9 && attrs.value !== oldAttrs.value) {
  29405. setAttr(elm, 'value', attrs.value);
  29406. }
  29407. for (key in oldAttrs) {
  29408. if (attrs[key] == null) {
  29409. if (isXlink(key)) {
  29410. elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
  29411. } else if (!isEnumeratedAttr(key)) {
  29412. elm.removeAttribute(key);
  29413. }
  29414. }
  29415. }
  29416. }
  29417. function setAttr (el, key, value) {
  29418. if (isBooleanAttr(key)) {
  29419. // set attribute for blank value
  29420. // e.g. <option disabled>Select one</option>
  29421. if (isFalsyAttrValue(value)) {
  29422. el.removeAttribute(key);
  29423. } else {
  29424. el.setAttribute(key, key);
  29425. }
  29426. } else if (isEnumeratedAttr(key)) {
  29427. el.setAttribute(key, isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true');
  29428. } else if (isXlink(key)) {
  29429. if (isFalsyAttrValue(value)) {
  29430. el.removeAttributeNS(xlinkNS, getXlinkProp(key));
  29431. } else {
  29432. el.setAttributeNS(xlinkNS, key, value);
  29433. }
  29434. } else {
  29435. if (isFalsyAttrValue(value)) {
  29436. el.removeAttribute(key);
  29437. } else {
  29438. el.setAttribute(key, value);
  29439. }
  29440. }
  29441. }
  29442. var attrs = {
  29443. create: updateAttrs,
  29444. update: updateAttrs
  29445. };
  29446. /* */
  29447. function updateClass (oldVnode, vnode) {
  29448. var el = vnode.elm;
  29449. var data = vnode.data;
  29450. var oldData = oldVnode.data;
  29451. if (!data.staticClass && !data.class &&
  29452. (!oldData || (!oldData.staticClass && !oldData.class))) {
  29453. return
  29454. }
  29455. var cls = genClassForVnode(vnode);
  29456. // handle transition classes
  29457. var transitionClass = el._transitionClasses;
  29458. if (transitionClass) {
  29459. cls = concat(cls, stringifyClass(transitionClass));
  29460. }
  29461. // set the class
  29462. if (cls !== el._prevClass) {
  29463. el.setAttribute('class', cls);
  29464. el._prevClass = cls;
  29465. }
  29466. }
  29467. var klass = {
  29468. create: updateClass,
  29469. update: updateClass
  29470. };
  29471. /* */
  29472. var target$1;
  29473. function add$2 (
  29474. event,
  29475. handler,
  29476. once,
  29477. capture
  29478. ) {
  29479. if (once) {
  29480. var oldHandler = handler;
  29481. var _target = target$1; // save current target element in closure
  29482. handler = function (ev) {
  29483. remove$3(event, handler, capture, _target);
  29484. arguments.length === 1
  29485. ? oldHandler(ev)
  29486. : oldHandler.apply(null, arguments);
  29487. };
  29488. }
  29489. target$1.addEventListener(event, handler, capture);
  29490. }
  29491. function remove$3 (
  29492. event,
  29493. handler,
  29494. capture,
  29495. _target
  29496. ) {
  29497. (_target || target$1).removeEventListener(event, handler, capture);
  29498. }
  29499. function updateDOMListeners (oldVnode, vnode) {
  29500. if (!oldVnode.data.on && !vnode.data.on) {
  29501. return
  29502. }
  29503. var on = vnode.data.on || {};
  29504. var oldOn = oldVnode.data.on || {};
  29505. target$1 = vnode.elm;
  29506. updateListeners(on, oldOn, add$2, remove$3, vnode.context);
  29507. }
  29508. var events = {
  29509. create: updateDOMListeners,
  29510. update: updateDOMListeners
  29511. };
  29512. /* */
  29513. function updateDOMProps (oldVnode, vnode) {
  29514. if (!oldVnode.data.domProps && !vnode.data.domProps) {
  29515. return
  29516. }
  29517. var key, cur;
  29518. var elm = vnode.elm;
  29519. var oldProps = oldVnode.data.domProps || {};
  29520. var props = vnode.data.domProps || {};
  29521. // clone observed objects, as the user probably wants to mutate it
  29522. if (props.__ob__) {
  29523. props = vnode.data.domProps = extend({}, props);
  29524. }
  29525. for (key in oldProps) {
  29526. if (props[key] == null) {
  29527. elm[key] = '';
  29528. }
  29529. }
  29530. for (key in props) {
  29531. cur = props[key];
  29532. // ignore children if the node has textContent or innerHTML,
  29533. // as these will throw away existing DOM nodes and cause removal errors
  29534. // on subsequent patches (#3360)
  29535. if (key === 'textContent' || key === 'innerHTML') {
  29536. if (vnode.children) { vnode.children.length = 0; }
  29537. if (cur === oldProps[key]) { continue }
  29538. }
  29539. if (key === 'value') {
  29540. // store value as _value as well since
  29541. // non-string values will be stringified
  29542. elm._value = cur;
  29543. // avoid resetting cursor position when value is the same
  29544. var strCur = cur == null ? '' : String(cur);
  29545. if (shouldUpdateValue(elm, vnode, strCur)) {
  29546. elm.value = strCur;
  29547. }
  29548. } else {
  29549. elm[key] = cur;
  29550. }
  29551. }
  29552. }
  29553. // check platforms/web/util/attrs.js acceptValue
  29554. function shouldUpdateValue (
  29555. elm,
  29556. vnode,
  29557. checkVal
  29558. ) {
  29559. return (!elm.composing && (
  29560. vnode.tag === 'option' ||
  29561. isDirty(elm, checkVal) ||
  29562. isInputChanged(vnode, checkVal)
  29563. ))
  29564. }
  29565. function isDirty (elm, checkVal) {
  29566. // return true when textbox (.number and .trim) loses focus and its value is not equal to the updated value
  29567. return document.activeElement !== elm && elm.value !== checkVal
  29568. }
  29569. function isInputChanged (vnode, newVal) {
  29570. var value = vnode.elm.value;
  29571. var modifiers = vnode.elm._vModifiers; // injected by v-model runtime
  29572. if ((modifiers && modifiers.number) || vnode.elm.type === 'number') {
  29573. return toNumber(value) !== toNumber(newVal)
  29574. }
  29575. if (modifiers && modifiers.trim) {
  29576. return value.trim() !== newVal.trim()
  29577. }
  29578. return value !== newVal
  29579. }
  29580. var domProps = {
  29581. create: updateDOMProps,
  29582. update: updateDOMProps
  29583. };
  29584. /* */
  29585. var parseStyleText = cached(function (cssText) {
  29586. var res = {};
  29587. var listDelimiter = /;(?![^(]*\))/g;
  29588. var propertyDelimiter = /:(.+)/;
  29589. cssText.split(listDelimiter).forEach(function (item) {
  29590. if (item) {
  29591. var tmp = item.split(propertyDelimiter);
  29592. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  29593. }
  29594. });
  29595. return res
  29596. });
  29597. // merge static and dynamic style data on the same vnode
  29598. function normalizeStyleData (data) {
  29599. var style = normalizeStyleBinding(data.style);
  29600. // static style is pre-processed into an object during compilation
  29601. // and is always a fresh object, so it's safe to merge into it
  29602. return data.staticStyle
  29603. ? extend(data.staticStyle, style)
  29604. : style
  29605. }
  29606. // normalize possible array / string values into Object
  29607. function normalizeStyleBinding (bindingStyle) {
  29608. if (Array.isArray(bindingStyle)) {
  29609. return toObject(bindingStyle)
  29610. }
  29611. if (typeof bindingStyle === 'string') {
  29612. return parseStyleText(bindingStyle)
  29613. }
  29614. return bindingStyle
  29615. }
  29616. /**
  29617. * parent component style should be after child's
  29618. * so that parent component's style could override it
  29619. */
  29620. function getStyle (vnode, checkChild) {
  29621. var res = {};
  29622. var styleData;
  29623. if (checkChild) {
  29624. var childNode = vnode;
  29625. while (childNode.componentInstance) {
  29626. childNode = childNode.componentInstance._vnode;
  29627. if (childNode.data && (styleData = normalizeStyleData(childNode.data))) {
  29628. extend(res, styleData);
  29629. }
  29630. }
  29631. }
  29632. if ((styleData = normalizeStyleData(vnode.data))) {
  29633. extend(res, styleData);
  29634. }
  29635. var parentNode = vnode;
  29636. while ((parentNode = parentNode.parent)) {
  29637. if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
  29638. extend(res, styleData);
  29639. }
  29640. }
  29641. return res
  29642. }
  29643. /* */
  29644. var cssVarRE = /^--/;
  29645. var importantRE = /\s*!important$/;
  29646. var setProp = function (el, name, val) {
  29647. /* istanbul ignore if */
  29648. if (cssVarRE.test(name)) {
  29649. el.style.setProperty(name, val);
  29650. } else if (importantRE.test(val)) {
  29651. el.style.setProperty(name, val.replace(importantRE, ''), 'important');
  29652. } else {
  29653. el.style[normalize(name)] = val;
  29654. }
  29655. };
  29656. var prefixes = ['Webkit', 'Moz', 'ms'];
  29657. var testEl;
  29658. var normalize = cached(function (prop) {
  29659. testEl = testEl || document.createElement('div');
  29660. prop = camelize(prop);
  29661. if (prop !== 'filter' && (prop in testEl.style)) {
  29662. return prop
  29663. }
  29664. var upper = prop.charAt(0).toUpperCase() + prop.slice(1);
  29665. for (var i = 0; i < prefixes.length; i++) {
  29666. var prefixed = prefixes[i] + upper;
  29667. if (prefixed in testEl.style) {
  29668. return prefixed
  29669. }
  29670. }
  29671. });
  29672. function updateStyle (oldVnode, vnode) {
  29673. var data = vnode.data;
  29674. var oldData = oldVnode.data;
  29675. if (!data.staticStyle && !data.style &&
  29676. !oldData.staticStyle && !oldData.style) {
  29677. return
  29678. }
  29679. var cur, name;
  29680. var el = vnode.elm;
  29681. var oldStaticStyle = oldVnode.data.staticStyle;
  29682. var oldStyleBinding = oldVnode.data.style || {};
  29683. // if static style exists, stylebinding already merged into it when doing normalizeStyleData
  29684. var oldStyle = oldStaticStyle || oldStyleBinding;
  29685. var style = normalizeStyleBinding(vnode.data.style) || {};
  29686. vnode.data.style = style.__ob__ ? extend({}, style) : style;
  29687. var newStyle = getStyle(vnode, true);
  29688. for (name in oldStyle) {
  29689. if (newStyle[name] == null) {
  29690. setProp(el, name, '');
  29691. }
  29692. }
  29693. for (name in newStyle) {
  29694. cur = newStyle[name];
  29695. if (cur !== oldStyle[name]) {
  29696. // ie9 setting to null has no effect, must use empty string
  29697. setProp(el, name, cur == null ? '' : cur);
  29698. }
  29699. }
  29700. }
  29701. var style = {
  29702. create: updateStyle,
  29703. update: updateStyle
  29704. };
  29705. /* */
  29706. /**
  29707. * Add class with compatibility for SVG since classList is not supported on
  29708. * SVG elements in IE
  29709. */
  29710. function addClass (el, cls) {
  29711. /* istanbul ignore if */
  29712. if (!cls || !cls.trim()) {
  29713. return
  29714. }
  29715. /* istanbul ignore else */
  29716. if (el.classList) {
  29717. if (cls.indexOf(' ') > -1) {
  29718. cls.split(/\s+/).forEach(function (c) { return el.classList.add(c); });
  29719. } else {
  29720. el.classList.add(cls);
  29721. }
  29722. } else {
  29723. var cur = ' ' + el.getAttribute('class') + ' ';
  29724. if (cur.indexOf(' ' + cls + ' ') < 0) {
  29725. el.setAttribute('class', (cur + cls).trim());
  29726. }
  29727. }
  29728. }
  29729. /**
  29730. * Remove class with compatibility for SVG since classList is not supported on
  29731. * SVG elements in IE
  29732. */
  29733. function removeClass (el, cls) {
  29734. /* istanbul ignore if */
  29735. if (!cls || !cls.trim()) {
  29736. return
  29737. }
  29738. /* istanbul ignore else */
  29739. if (el.classList) {
  29740. if (cls.indexOf(' ') > -1) {
  29741. cls.split(/\s+/).forEach(function (c) { return el.classList.remove(c); });
  29742. } else {
  29743. el.classList.remove(cls);
  29744. }
  29745. } else {
  29746. var cur = ' ' + el.getAttribute('class') + ' ';
  29747. var tar = ' ' + cls + ' ';
  29748. while (cur.indexOf(tar) >= 0) {
  29749. cur = cur.replace(tar, ' ');
  29750. }
  29751. el.setAttribute('class', cur.trim());
  29752. }
  29753. }
  29754. /* */
  29755. var hasTransition = inBrowser && !isIE9;
  29756. var TRANSITION = 'transition';
  29757. var ANIMATION = 'animation';
  29758. // Transition property/event sniffing
  29759. var transitionProp = 'transition';
  29760. var transitionEndEvent = 'transitionend';
  29761. var animationProp = 'animation';
  29762. var animationEndEvent = 'animationend';
  29763. if (hasTransition) {
  29764. /* istanbul ignore if */
  29765. if (window.ontransitionend === undefined &&
  29766. window.onwebkittransitionend !== undefined) {
  29767. transitionProp = 'WebkitTransition';
  29768. transitionEndEvent = 'webkitTransitionEnd';
  29769. }
  29770. if (window.onanimationend === undefined &&
  29771. window.onwebkitanimationend !== undefined) {
  29772. animationProp = 'WebkitAnimation';
  29773. animationEndEvent = 'webkitAnimationEnd';
  29774. }
  29775. }
  29776. // binding to window is necessary to make hot reload work in IE in strict mode
  29777. var raf = inBrowser && window.requestAnimationFrame
  29778. ? window.requestAnimationFrame.bind(window)
  29779. : setTimeout;
  29780. function nextFrame (fn) {
  29781. raf(function () {
  29782. raf(fn);
  29783. });
  29784. }
  29785. function addTransitionClass (el, cls) {
  29786. (el._transitionClasses || (el._transitionClasses = [])).push(cls);
  29787. addClass(el, cls);
  29788. }
  29789. function removeTransitionClass (el, cls) {
  29790. if (el._transitionClasses) {
  29791. remove$1(el._transitionClasses, cls);
  29792. }
  29793. removeClass(el, cls);
  29794. }
  29795. function whenTransitionEnds (
  29796. el,
  29797. expectedType,
  29798. cb
  29799. ) {
  29800. var ref = getTransitionInfo(el, expectedType);
  29801. var type = ref.type;
  29802. var timeout = ref.timeout;
  29803. var propCount = ref.propCount;
  29804. if (!type) { return cb() }
  29805. var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
  29806. var ended = 0;
  29807. var end = function () {
  29808. el.removeEventListener(event, onEnd);
  29809. cb();
  29810. };
  29811. var onEnd = function (e) {
  29812. if (e.target === el) {
  29813. if (++ended >= propCount) {
  29814. end();
  29815. }
  29816. }
  29817. };
  29818. setTimeout(function () {
  29819. if (ended < propCount) {
  29820. end();
  29821. }
  29822. }, timeout + 1);
  29823. el.addEventListener(event, onEnd);
  29824. }
  29825. var transformRE = /\b(transform|all)(,|$)/;
  29826. function getTransitionInfo (el, expectedType) {
  29827. var styles = window.getComputedStyle(el);
  29828. var transitioneDelays = styles[transitionProp + 'Delay'].split(', ');
  29829. var transitionDurations = styles[transitionProp + 'Duration'].split(', ');
  29830. var transitionTimeout = getTimeout(transitioneDelays, transitionDurations);
  29831. var animationDelays = styles[animationProp + 'Delay'].split(', ');
  29832. var animationDurations = styles[animationProp + 'Duration'].split(', ');
  29833. var animationTimeout = getTimeout(animationDelays, animationDurations);
  29834. var type;
  29835. var timeout = 0;
  29836. var propCount = 0;
  29837. /* istanbul ignore if */
  29838. if (expectedType === TRANSITION) {
  29839. if (transitionTimeout > 0) {
  29840. type = TRANSITION;
  29841. timeout = transitionTimeout;
  29842. propCount = transitionDurations.length;
  29843. }
  29844. } else if (expectedType === ANIMATION) {
  29845. if (animationTimeout > 0) {
  29846. type = ANIMATION;
  29847. timeout = animationTimeout;
  29848. propCount = animationDurations.length;
  29849. }
  29850. } else {
  29851. timeout = Math.max(transitionTimeout, animationTimeout);
  29852. type = timeout > 0
  29853. ? transitionTimeout > animationTimeout
  29854. ? TRANSITION
  29855. : ANIMATION
  29856. : null;
  29857. propCount = type
  29858. ? type === TRANSITION
  29859. ? transitionDurations.length
  29860. : animationDurations.length
  29861. : 0;
  29862. }
  29863. var hasTransform =
  29864. type === TRANSITION &&
  29865. transformRE.test(styles[transitionProp + 'Property']);
  29866. return {
  29867. type: type,
  29868. timeout: timeout,
  29869. propCount: propCount,
  29870. hasTransform: hasTransform
  29871. }
  29872. }
  29873. function getTimeout (delays, durations) {
  29874. /* istanbul ignore next */
  29875. while (delays.length < durations.length) {
  29876. delays = delays.concat(delays);
  29877. }
  29878. return Math.max.apply(null, durations.map(function (d, i) {
  29879. return toMs(d) + toMs(delays[i])
  29880. }))
  29881. }
  29882. function toMs (s) {
  29883. return Number(s.slice(0, -1)) * 1000
  29884. }
  29885. /* */
  29886. function enter (vnode, toggleDisplay) {
  29887. var el = vnode.elm;
  29888. // call leave callback now
  29889. if (el._leaveCb) {
  29890. el._leaveCb.cancelled = true;
  29891. el._leaveCb();
  29892. }
  29893. var data = resolveTransition(vnode.data.transition);
  29894. if (!data) {
  29895. return
  29896. }
  29897. /* istanbul ignore if */
  29898. if (el._enterCb || el.nodeType !== 1) {
  29899. return
  29900. }
  29901. var css = data.css;
  29902. var type = data.type;
  29903. var enterClass = data.enterClass;
  29904. var enterToClass = data.enterToClass;
  29905. var enterActiveClass = data.enterActiveClass;
  29906. var appearClass = data.appearClass;
  29907. var appearToClass = data.appearToClass;
  29908. var appearActiveClass = data.appearActiveClass;
  29909. var beforeEnter = data.beforeEnter;
  29910. var enter = data.enter;
  29911. var afterEnter = data.afterEnter;
  29912. var enterCancelled = data.enterCancelled;
  29913. var beforeAppear = data.beforeAppear;
  29914. var appear = data.appear;
  29915. var afterAppear = data.afterAppear;
  29916. var appearCancelled = data.appearCancelled;
  29917. // activeInstance will always be the <transition> component managing this
  29918. // transition. One edge case to check is when the <transition> is placed
  29919. // as the root node of a child component. In that case we need to check
  29920. // <transition>'s parent for appear check.
  29921. var context = activeInstance;
  29922. var transitionNode = activeInstance.$vnode;
  29923. while (transitionNode && transitionNode.parent) {
  29924. transitionNode = transitionNode.parent;
  29925. context = transitionNode.context;
  29926. }
  29927. var isAppear = !context._isMounted || !vnode.isRootInsert;
  29928. if (isAppear && !appear && appear !== '') {
  29929. return
  29930. }
  29931. var startClass = isAppear ? appearClass : enterClass;
  29932. var activeClass = isAppear ? appearActiveClass : enterActiveClass;
  29933. var toClass = isAppear ? appearToClass : enterToClass;
  29934. var beforeEnterHook = isAppear ? (beforeAppear || beforeEnter) : beforeEnter;
  29935. var enterHook = isAppear ? (typeof appear === 'function' ? appear : enter) : enter;
  29936. var afterEnterHook = isAppear ? (afterAppear || afterEnter) : afterEnter;
  29937. var enterCancelledHook = isAppear ? (appearCancelled || enterCancelled) : enterCancelled;
  29938. var expectsCSS = css !== false && !isIE9;
  29939. var userWantsControl =
  29940. enterHook &&
  29941. // enterHook may be a bound method which exposes
  29942. // the length of original fn as _length
  29943. (enterHook._length || enterHook.length) > 1;
  29944. var cb = el._enterCb = once(function () {
  29945. if (expectsCSS) {
  29946. removeTransitionClass(el, toClass);
  29947. removeTransitionClass(el, activeClass);
  29948. }
  29949. if (cb.cancelled) {
  29950. if (expectsCSS) {
  29951. removeTransitionClass(el, startClass);
  29952. }
  29953. enterCancelledHook && enterCancelledHook(el);
  29954. } else {
  29955. afterEnterHook && afterEnterHook(el);
  29956. }
  29957. el._enterCb = null;
  29958. });
  29959. if (!vnode.data.show) {
  29960. // remove pending leave element on enter by injecting an insert hook
  29961. mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', function () {
  29962. var parent = el.parentNode;
  29963. var pendingNode = parent && parent._pending && parent._pending[vnode.key];
  29964. if (pendingNode &&
  29965. pendingNode.tag === vnode.tag &&
  29966. pendingNode.elm._leaveCb) {
  29967. pendingNode.elm._leaveCb();
  29968. }
  29969. enterHook && enterHook(el, cb);
  29970. }, 'transition-insert');
  29971. }
  29972. // start enter transition
  29973. beforeEnterHook && beforeEnterHook(el);
  29974. if (expectsCSS) {
  29975. addTransitionClass(el, startClass);
  29976. addTransitionClass(el, activeClass);
  29977. nextFrame(function () {
  29978. addTransitionClass(el, toClass);
  29979. removeTransitionClass(el, startClass);
  29980. if (!cb.cancelled && !userWantsControl) {
  29981. whenTransitionEnds(el, type, cb);
  29982. }
  29983. });
  29984. }
  29985. if (vnode.data.show) {
  29986. toggleDisplay && toggleDisplay();
  29987. enterHook && enterHook(el, cb);
  29988. }
  29989. if (!expectsCSS && !userWantsControl) {
  29990. cb();
  29991. }
  29992. }
  29993. function leave (vnode, rm) {
  29994. var el = vnode.elm;
  29995. // call enter callback now
  29996. if (el._enterCb) {
  29997. el._enterCb.cancelled = true;
  29998. el._enterCb();
  29999. }
  30000. var data = resolveTransition(vnode.data.transition);
  30001. if (!data) {
  30002. return rm()
  30003. }
  30004. /* istanbul ignore if */
  30005. if (el._leaveCb || el.nodeType !== 1) {
  30006. return
  30007. }
  30008. var css = data.css;
  30009. var type = data.type;
  30010. var leaveClass = data.leaveClass;
  30011. var leaveToClass = data.leaveToClass;
  30012. var leaveActiveClass = data.leaveActiveClass;
  30013. var beforeLeave = data.beforeLeave;
  30014. var leave = data.leave;
  30015. var afterLeave = data.afterLeave;
  30016. var leaveCancelled = data.leaveCancelled;
  30017. var delayLeave = data.delayLeave;
  30018. var expectsCSS = css !== false && !isIE9;
  30019. var userWantsControl =
  30020. leave &&
  30021. // leave hook may be a bound method which exposes
  30022. // the length of original fn as _length
  30023. (leave._length || leave.length) > 1;
  30024. var cb = el._leaveCb = once(function () {
  30025. if (el.parentNode && el.parentNode._pending) {
  30026. el.parentNode._pending[vnode.key] = null;
  30027. }
  30028. if (expectsCSS) {
  30029. removeTransitionClass(el, leaveToClass);
  30030. removeTransitionClass(el, leaveActiveClass);
  30031. }
  30032. if (cb.cancelled) {
  30033. if (expectsCSS) {
  30034. removeTransitionClass(el, leaveClass);
  30035. }
  30036. leaveCancelled && leaveCancelled(el);
  30037. } else {
  30038. rm();
  30039. afterLeave && afterLeave(el);
  30040. }
  30041. el._leaveCb = null;
  30042. });
  30043. if (delayLeave) {
  30044. delayLeave(performLeave);
  30045. } else {
  30046. performLeave();
  30047. }
  30048. function performLeave () {
  30049. // the delayed leave may have already been cancelled
  30050. if (cb.cancelled) {
  30051. return
  30052. }
  30053. // record leaving element
  30054. if (!vnode.data.show) {
  30055. (el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] = vnode;
  30056. }
  30057. beforeLeave && beforeLeave(el);
  30058. if (expectsCSS) {
  30059. addTransitionClass(el, leaveClass);
  30060. addTransitionClass(el, leaveActiveClass);
  30061. nextFrame(function () {
  30062. addTransitionClass(el, leaveToClass);
  30063. removeTransitionClass(el, leaveClass);
  30064. if (!cb.cancelled && !userWantsControl) {
  30065. whenTransitionEnds(el, type, cb);
  30066. }
  30067. });
  30068. }
  30069. leave && leave(el, cb);
  30070. if (!expectsCSS && !userWantsControl) {
  30071. cb();
  30072. }
  30073. }
  30074. }
  30075. function resolveTransition (def$$1) {
  30076. if (!def$$1) {
  30077. return
  30078. }
  30079. /* istanbul ignore else */
  30080. if (typeof def$$1 === 'object') {
  30081. var res = {};
  30082. if (def$$1.css !== false) {
  30083. extend(res, autoCssTransition(def$$1.name || 'v'));
  30084. }
  30085. extend(res, def$$1);
  30086. return res
  30087. } else if (typeof def$$1 === 'string') {
  30088. return autoCssTransition(def$$1)
  30089. }
  30090. }
  30091. var autoCssTransition = cached(function (name) {
  30092. return {
  30093. enterClass: (name + "-enter"),
  30094. leaveClass: (name + "-leave"),
  30095. appearClass: (name + "-enter"),
  30096. enterToClass: (name + "-enter-to"),
  30097. leaveToClass: (name + "-leave-to"),
  30098. appearToClass: (name + "-enter-to"),
  30099. enterActiveClass: (name + "-enter-active"),
  30100. leaveActiveClass: (name + "-leave-active"),
  30101. appearActiveClass: (name + "-enter-active")
  30102. }
  30103. });
  30104. function once (fn) {
  30105. var called = false;
  30106. return function () {
  30107. if (!called) {
  30108. called = true;
  30109. fn();
  30110. }
  30111. }
  30112. }
  30113. function _enter (_, vnode) {
  30114. if (!vnode.data.show) {
  30115. enter(vnode);
  30116. }
  30117. }
  30118. var transition = inBrowser ? {
  30119. create: _enter,
  30120. activate: _enter,
  30121. remove: function remove (vnode, rm) {
  30122. /* istanbul ignore else */
  30123. if (!vnode.data.show) {
  30124. leave(vnode, rm);
  30125. } else {
  30126. rm();
  30127. }
  30128. }
  30129. } : {};
  30130. var platformModules = [
  30131. attrs,
  30132. klass,
  30133. events,
  30134. domProps,
  30135. style,
  30136. transition
  30137. ];
  30138. /* */
  30139. // the directive module should be applied last, after all
  30140. // built-in modules have been applied.
  30141. var modules = platformModules.concat(baseModules);
  30142. var patch$1 = createPatchFunction({ nodeOps: nodeOps, modules: modules });
  30143. /**
  30144. * Not type checking this file because flow doesn't like attaching
  30145. * properties to Elements.
  30146. */
  30147. var modelableTagRE = /^input|select|textarea|vue-component-[0-9]+(-[0-9a-zA-Z_-]*)?$/;
  30148. /* istanbul ignore if */
  30149. if (isIE9) {
  30150. // http://www.matts411.com/post/internet-explorer-9-oninput/
  30151. document.addEventListener('selectionchange', function () {
  30152. var el = document.activeElement;
  30153. if (el && el.vmodel) {
  30154. trigger(el, 'input');
  30155. }
  30156. });
  30157. }
  30158. var model = {
  30159. inserted: function inserted (el, binding, vnode) {
  30160. if (process.env.NODE_ENV !== 'production') {
  30161. if (!modelableTagRE.test(vnode.tag)) {
  30162. warn(
  30163. "v-model is not supported on element type: <" + (vnode.tag) + ">. " +
  30164. 'If you are working with contenteditable, it\'s recommended to ' +
  30165. 'wrap a library dedicated for that purpose inside a custom component.',
  30166. vnode.context
  30167. );
  30168. }
  30169. }
  30170. if (vnode.tag === 'select') {
  30171. var cb = function () {
  30172. setSelected(el, binding, vnode.context);
  30173. };
  30174. cb();
  30175. /* istanbul ignore if */
  30176. if (isIE || isEdge) {
  30177. setTimeout(cb, 0);
  30178. }
  30179. } else if (vnode.tag === 'textarea' || el.type === 'text') {
  30180. el._vModifiers = binding.modifiers;
  30181. if (!binding.modifiers.lazy) {
  30182. if (!isAndroid) {
  30183. el.addEventListener('compositionstart', onCompositionStart);
  30184. el.addEventListener('compositionend', onCompositionEnd);
  30185. }
  30186. /* istanbul ignore if */
  30187. if (isIE9) {
  30188. el.vmodel = true;
  30189. }
  30190. }
  30191. }
  30192. },
  30193. componentUpdated: function componentUpdated (el, binding, vnode) {
  30194. if (vnode.tag === 'select') {
  30195. setSelected(el, binding, vnode.context);
  30196. // in case the options rendered by v-for have changed,
  30197. // it's possible that the value is out-of-sync with the rendered options.
  30198. // detect such cases and filter out values that no longer has a matching
  30199. // option in the DOM.
  30200. var needReset = el.multiple
  30201. ? binding.value.some(function (v) { return hasNoMatchingOption(v, el.options); })
  30202. : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, el.options);
  30203. if (needReset) {
  30204. trigger(el, 'change');
  30205. }
  30206. }
  30207. }
  30208. };
  30209. function setSelected (el, binding, vm) {
  30210. var value = binding.value;
  30211. var isMultiple = el.multiple;
  30212. if (isMultiple && !Array.isArray(value)) {
  30213. process.env.NODE_ENV !== 'production' && warn(
  30214. "<select multiple v-model=\"" + (binding.expression) + "\"> " +
  30215. "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)),
  30216. vm
  30217. );
  30218. return
  30219. }
  30220. var selected, option;
  30221. for (var i = 0, l = el.options.length; i < l; i++) {
  30222. option = el.options[i];
  30223. if (isMultiple) {
  30224. selected = looseIndexOf(value, getValue(option)) > -1;
  30225. if (option.selected !== selected) {
  30226. option.selected = selected;
  30227. }
  30228. } else {
  30229. if (looseEqual(getValue(option), value)) {
  30230. if (el.selectedIndex !== i) {
  30231. el.selectedIndex = i;
  30232. }
  30233. return
  30234. }
  30235. }
  30236. }
  30237. if (!isMultiple) {
  30238. el.selectedIndex = -1;
  30239. }
  30240. }
  30241. function hasNoMatchingOption (value, options) {
  30242. for (var i = 0, l = options.length; i < l; i++) {
  30243. if (looseEqual(getValue(options[i]), value)) {
  30244. return false
  30245. }
  30246. }
  30247. return true
  30248. }
  30249. function getValue (option) {
  30250. return '_value' in option
  30251. ? option._value
  30252. : option.value
  30253. }
  30254. function onCompositionStart (e) {
  30255. e.target.composing = true;
  30256. }
  30257. function onCompositionEnd (e) {
  30258. e.target.composing = false;
  30259. trigger(e.target, 'input');
  30260. }
  30261. function trigger (el, type) {
  30262. var e = document.createEvent('HTMLEvents');
  30263. e.initEvent(type, true, true);
  30264. el.dispatchEvent(e);
  30265. }
  30266. /* */
  30267. // recursively search for possible transition defined inside the component root
  30268. function locateNode (vnode) {
  30269. return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
  30270. ? locateNode(vnode.componentInstance._vnode)
  30271. : vnode
  30272. }
  30273. var show = {
  30274. bind: function bind (el, ref, vnode) {
  30275. var value = ref.value;
  30276. vnode = locateNode(vnode);
  30277. var transition = vnode.data && vnode.data.transition;
  30278. var originalDisplay = el.__vOriginalDisplay =
  30279. el.style.display === 'none' ? '' : el.style.display;
  30280. if (value && transition && !isIE9) {
  30281. vnode.data.show = true;
  30282. enter(vnode, function () {
  30283. el.style.display = originalDisplay;
  30284. });
  30285. } else {
  30286. el.style.display = value ? originalDisplay : 'none';
  30287. }
  30288. },
  30289. update: function update (el, ref, vnode) {
  30290. var value = ref.value;
  30291. var oldValue = ref.oldValue;
  30292. /* istanbul ignore if */
  30293. if (value === oldValue) { return }
  30294. vnode = locateNode(vnode);
  30295. var transition = vnode.data && vnode.data.transition;
  30296. if (transition && !isIE9) {
  30297. vnode.data.show = true;
  30298. if (value) {
  30299. enter(vnode, function () {
  30300. el.style.display = el.__vOriginalDisplay;
  30301. });
  30302. } else {
  30303. leave(vnode, function () {
  30304. el.style.display = 'none';
  30305. });
  30306. }
  30307. } else {
  30308. el.style.display = value ? el.__vOriginalDisplay : 'none';
  30309. }
  30310. },
  30311. unbind: function unbind (
  30312. el,
  30313. binding,
  30314. vnode,
  30315. oldVnode,
  30316. isDestroy
  30317. ) {
  30318. if (!isDestroy) {
  30319. el.style.display = el.__vOriginalDisplay;
  30320. }
  30321. }
  30322. };
  30323. var platformDirectives = {
  30324. model: model,
  30325. show: show
  30326. };
  30327. /* */
  30328. // Provides transition support for a single element/component.
  30329. // supports transition mode (out-in / in-out)
  30330. var transitionProps = {
  30331. name: String,
  30332. appear: Boolean,
  30333. css: Boolean,
  30334. mode: String,
  30335. type: String,
  30336. enterClass: String,
  30337. leaveClass: String,
  30338. enterToClass: String,
  30339. leaveToClass: String,
  30340. enterActiveClass: String,
  30341. leaveActiveClass: String,
  30342. appearClass: String,
  30343. appearActiveClass: String,
  30344. appearToClass: String
  30345. };
  30346. // in case the child is also an abstract component, e.g. <keep-alive>
  30347. // we want to recursively retrieve the real component to be rendered
  30348. function getRealChild (vnode) {
  30349. var compOptions = vnode && vnode.componentOptions;
  30350. if (compOptions && compOptions.Ctor.options.abstract) {
  30351. return getRealChild(getFirstComponentChild(compOptions.children))
  30352. } else {
  30353. return vnode
  30354. }
  30355. }
  30356. function extractTransitionData (comp) {
  30357. var data = {};
  30358. var options = comp.$options;
  30359. // props
  30360. for (var key in options.propsData) {
  30361. data[key] = comp[key];
  30362. }
  30363. // events.
  30364. // extract listeners and pass them directly to the transition methods
  30365. var listeners = options._parentListeners;
  30366. for (var key$1 in listeners) {
  30367. data[camelize(key$1)] = listeners[key$1].fn;
  30368. }
  30369. return data
  30370. }
  30371. function placeholder (h, rawChild) {
  30372. return /\d-keep-alive$/.test(rawChild.tag)
  30373. ? h('keep-alive')
  30374. : null
  30375. }
  30376. function hasParentTransition (vnode) {
  30377. while ((vnode = vnode.parent)) {
  30378. if (vnode.data.transition) {
  30379. return true
  30380. }
  30381. }
  30382. }
  30383. function isSameChild (child, oldChild) {
  30384. return oldChild.key === child.key && oldChild.tag === child.tag
  30385. }
  30386. var Transition = {
  30387. name: 'transition',
  30388. props: transitionProps,
  30389. abstract: true,
  30390. render: function render (h) {
  30391. var this$1 = this;
  30392. var children = this.$slots.default;
  30393. if (!children) {
  30394. return
  30395. }
  30396. // filter out text nodes (possible whitespaces)
  30397. children = children.filter(function (c) { return c.tag; });
  30398. /* istanbul ignore if */
  30399. if (!children.length) {
  30400. return
  30401. }
  30402. // warn multiple elements
  30403. if (process.env.NODE_ENV !== 'production' && children.length > 1) {
  30404. warn(
  30405. '<transition> can only be used on a single element. Use ' +
  30406. '<transition-group> for lists.',
  30407. this.$parent
  30408. );
  30409. }
  30410. var mode = this.mode;
  30411. // warn invalid mode
  30412. if (process.env.NODE_ENV !== 'production' &&
  30413. mode && mode !== 'in-out' && mode !== 'out-in') {
  30414. warn(
  30415. 'invalid <transition> mode: ' + mode,
  30416. this.$parent
  30417. );
  30418. }
  30419. var rawChild = children[0];
  30420. // if this is a component root node and the component's
  30421. // parent container node also has transition, skip.
  30422. if (hasParentTransition(this.$vnode)) {
  30423. return rawChild
  30424. }
  30425. // apply transition data to child
  30426. // use getRealChild() to ignore abstract components e.g. keep-alive
  30427. var child = getRealChild(rawChild);
  30428. /* istanbul ignore if */
  30429. if (!child) {
  30430. return rawChild
  30431. }
  30432. if (this._leaving) {
  30433. return placeholder(h, rawChild)
  30434. }
  30435. // ensure a key that is unique to the vnode type and to this transition
  30436. // component instance. This key will be used to remove pending leaving nodes
  30437. // during entering.
  30438. var id = "__transition-" + (this._uid) + "-";
  30439. var key = child.key = child.key == null
  30440. ? id + child.tag
  30441. : isPrimitive(child.key)
  30442. ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key)
  30443. : child.key;
  30444. var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
  30445. var oldRawChild = this._vnode;
  30446. var oldChild = getRealChild(oldRawChild);
  30447. // mark v-show
  30448. // so that the transition module can hand over the control to the directive
  30449. if (child.data.directives && child.data.directives.some(function (d) { return d.name === 'show'; })) {
  30450. child.data.show = true;
  30451. }
  30452. if (oldChild && oldChild.data && !isSameChild(child, oldChild)) {
  30453. // replace old child transition data with fresh one
  30454. // important for dynamic transitions!
  30455. var oldData = oldChild && (oldChild.data.transition = extend({}, data));
  30456. // handle transition mode
  30457. if (mode === 'out-in') {
  30458. // return placeholder node and queue update when leave finishes
  30459. this._leaving = true;
  30460. mergeVNodeHook(oldData, 'afterLeave', function () {
  30461. this$1._leaving = false;
  30462. this$1.$forceUpdate();
  30463. }, key);
  30464. return placeholder(h, rawChild)
  30465. } else if (mode === 'in-out') {
  30466. var delayedLeave;
  30467. var performLeave = function () { delayedLeave(); };
  30468. mergeVNodeHook(data, 'afterEnter', performLeave, key);
  30469. mergeVNodeHook(data, 'enterCancelled', performLeave, key);
  30470. mergeVNodeHook(oldData, 'delayLeave', function (leave) {
  30471. delayedLeave = leave;
  30472. }, key);
  30473. }
  30474. }
  30475. return rawChild
  30476. }
  30477. };
  30478. /* */
  30479. // Provides transition support for list items.
  30480. // supports move transitions using the FLIP technique.
  30481. // Because the vdom's children update algorithm is "unstable" - i.e.
  30482. // it doesn't guarantee the relative positioning of removed elements,
  30483. // we force transition-group to update its children into two passes:
  30484. // in the first pass, we remove all nodes that need to be removed,
  30485. // triggering their leaving transition; in the second pass, we insert/move
  30486. // into the final disired state. This way in the second pass removed
  30487. // nodes will remain where they should be.
  30488. var props = extend({
  30489. tag: String,
  30490. moveClass: String
  30491. }, transitionProps);
  30492. delete props.mode;
  30493. var TransitionGroup = {
  30494. props: props,
  30495. render: function render (h) {
  30496. var tag = this.tag || this.$vnode.data.tag || 'span';
  30497. var map = Object.create(null);
  30498. var prevChildren = this.prevChildren = this.children;
  30499. var rawChildren = this.$slots.default || [];
  30500. var children = this.children = [];
  30501. var transitionData = extractTransitionData(this);
  30502. for (var i = 0; i < rawChildren.length; i++) {
  30503. var c = rawChildren[i];
  30504. if (c.tag) {
  30505. if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
  30506. children.push(c);
  30507. map[c.key] = c
  30508. ;(c.data || (c.data = {})).transition = transitionData;
  30509. } else if (process.env.NODE_ENV !== 'production') {
  30510. var opts = c.componentOptions;
  30511. var name = opts
  30512. ? (opts.Ctor.options.name || opts.tag)
  30513. : c.tag;
  30514. warn(("<transition-group> children must be keyed: <" + name + ">"));
  30515. }
  30516. }
  30517. }
  30518. if (prevChildren) {
  30519. var kept = [];
  30520. var removed = [];
  30521. for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {
  30522. var c$1 = prevChildren[i$1];
  30523. c$1.data.transition = transitionData;
  30524. c$1.data.pos = c$1.elm.getBoundingClientRect();
  30525. if (map[c$1.key]) {
  30526. kept.push(c$1);
  30527. } else {
  30528. removed.push(c$1);
  30529. }
  30530. }
  30531. this.kept = h(tag, null, kept);
  30532. this.removed = removed;
  30533. }
  30534. return h(tag, null, children)
  30535. },
  30536. beforeUpdate: function beforeUpdate () {
  30537. // force removing pass
  30538. this.__patch__(
  30539. this._vnode,
  30540. this.kept,
  30541. false, // hydrating
  30542. true // removeOnly (!important, avoids unnecessary moves)
  30543. );
  30544. this._vnode = this.kept;
  30545. },
  30546. updated: function updated () {
  30547. var children = this.prevChildren;
  30548. var moveClass = this.moveClass || ((this.name || 'v') + '-move');
  30549. if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
  30550. return
  30551. }
  30552. // we divide the work into three loops to avoid mixing DOM reads and writes
  30553. // in each iteration - which helps prevent layout thrashing.
  30554. children.forEach(callPendingCbs);
  30555. children.forEach(recordPosition);
  30556. children.forEach(applyTranslation);
  30557. // force reflow to put everything in position
  30558. var f = document.body.offsetHeight; // eslint-disable-line
  30559. children.forEach(function (c) {
  30560. if (c.data.moved) {
  30561. var el = c.elm;
  30562. var s = el.style;
  30563. addTransitionClass(el, moveClass);
  30564. s.transform = s.WebkitTransform = s.transitionDuration = '';
  30565. el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {
  30566. if (!e || /transform$/.test(e.propertyName)) {
  30567. el.removeEventListener(transitionEndEvent, cb);
  30568. el._moveCb = null;
  30569. removeTransitionClass(el, moveClass);
  30570. }
  30571. });
  30572. }
  30573. });
  30574. },
  30575. methods: {
  30576. hasMove: function hasMove (el, moveClass) {
  30577. /* istanbul ignore if */
  30578. if (!hasTransition) {
  30579. return false
  30580. }
  30581. if (this._hasMove != null) {
  30582. return this._hasMove
  30583. }
  30584. addTransitionClass(el, moveClass);
  30585. var info = getTransitionInfo(el);
  30586. removeTransitionClass(el, moveClass);
  30587. return (this._hasMove = info.hasTransform)
  30588. }
  30589. }
  30590. };
  30591. function callPendingCbs (c) {
  30592. /* istanbul ignore if */
  30593. if (c.elm._moveCb) {
  30594. c.elm._moveCb();
  30595. }
  30596. /* istanbul ignore if */
  30597. if (c.elm._enterCb) {
  30598. c.elm._enterCb();
  30599. }
  30600. }
  30601. function recordPosition (c) {
  30602. c.data.newPos = c.elm.getBoundingClientRect();
  30603. }
  30604. function applyTranslation (c) {
  30605. var oldPos = c.data.pos;
  30606. var newPos = c.data.newPos;
  30607. var dx = oldPos.left - newPos.left;
  30608. var dy = oldPos.top - newPos.top;
  30609. if (dx || dy) {
  30610. c.data.moved = true;
  30611. var s = c.elm.style;
  30612. s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
  30613. s.transitionDuration = '0s';
  30614. }
  30615. }
  30616. var platformComponents = {
  30617. Transition: Transition,
  30618. TransitionGroup: TransitionGroup
  30619. };
  30620. /* */
  30621. // install platform specific utils
  30622. Vue$3.config.isUnknownElement = isUnknownElement;
  30623. Vue$3.config.isReservedTag = isReservedTag;
  30624. Vue$3.config.getTagNamespace = getTagNamespace;
  30625. Vue$3.config.mustUseProp = mustUseProp;
  30626. // install platform runtime directives & components
  30627. extend(Vue$3.options.directives, platformDirectives);
  30628. extend(Vue$3.options.components, platformComponents);
  30629. // install platform patch function
  30630. Vue$3.prototype.__patch__ = inBrowser ? patch$1 : noop;
  30631. // wrap mount
  30632. Vue$3.prototype.$mount = function (
  30633. el,
  30634. hydrating
  30635. ) {
  30636. el = el && inBrowser ? query(el) : undefined;
  30637. return this._mount(el, hydrating)
  30638. };
  30639. if (process.env.NODE_ENV !== 'production' &&
  30640. inBrowser && typeof console !== 'undefined') {
  30641. console[console.info ? 'info' : 'log'](
  30642. "You are running Vue in development mode.\n" +
  30643. "Make sure to turn on production mode when deploying for production.\n" +
  30644. "See more tips at https://vuejs.org/guide/deployment.html"
  30645. );
  30646. }
  30647. // devtools global hook
  30648. /* istanbul ignore next */
  30649. setTimeout(function () {
  30650. if (config.devtools) {
  30651. if (devtools) {
  30652. devtools.emit('init', Vue$3);
  30653. } else if (
  30654. process.env.NODE_ENV !== 'production' &&
  30655. inBrowser && !isEdge && /Chrome\/\d+/.test(window.navigator.userAgent)
  30656. ) {
  30657. console[console.info ? 'info' : 'log'](
  30658. 'Download the Vue Devtools extension for a better development experience:\n' +
  30659. 'https://github.com/vuejs/vue-devtools'
  30660. );
  30661. }
  30662. }
  30663. }, 0);
  30664. /* */
  30665. // check whether current browser encodes a char inside attribute values
  30666. function shouldDecode (content, encoded) {
  30667. var div = document.createElement('div');
  30668. div.innerHTML = "<div a=\"" + content + "\">";
  30669. return div.innerHTML.indexOf(encoded) > 0
  30670. }
  30671. // #3663
  30672. // IE encodes newlines inside attribute values while other browsers don't
  30673. var shouldDecodeNewlines = inBrowser ? shouldDecode('\n', '&#10;') : false;
  30674. /* */
  30675. var decoder;
  30676. function decode (html) {
  30677. decoder = decoder || document.createElement('div');
  30678. decoder.innerHTML = html;
  30679. return decoder.textContent
  30680. }
  30681. /* */
  30682. var isUnaryTag = makeMap(
  30683. 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
  30684. 'link,meta,param,source,track,wbr',
  30685. true
  30686. );
  30687. // Elements that you can, intentionally, leave open
  30688. // (and which close themselves)
  30689. var canBeLeftOpenTag = makeMap(
  30690. 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source',
  30691. true
  30692. );
  30693. // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
  30694. // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
  30695. var isNonPhrasingTag = makeMap(
  30696. 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
  30697. 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
  30698. 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
  30699. 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
  30700. 'title,tr,track',
  30701. true
  30702. );
  30703. /**
  30704. * Not type-checking this file because it's mostly vendor code.
  30705. */
  30706. /*!
  30707. * HTML Parser By John Resig (ejohn.org)
  30708. * Modified by Juriy "kangax" Zaytsev
  30709. * Original code by Erik Arvidsson, Mozilla Public License
  30710. * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
  30711. */
  30712. // Regular Expressions for parsing tags and attributes
  30713. var singleAttrIdentifier = /([^\s"'<>/=]+)/;
  30714. var singleAttrAssign = /(?:=)/;
  30715. var singleAttrValues = [
  30716. // attr value double quotes
  30717. /"([^"]*)"+/.source,
  30718. // attr value, single quotes
  30719. /'([^']*)'+/.source,
  30720. // attr value, no quotes
  30721. /([^\s"'=<>`]+)/.source
  30722. ];
  30723. var attribute = new RegExp(
  30724. '^\\s*' + singleAttrIdentifier.source +
  30725. '(?:\\s*(' + singleAttrAssign.source + ')' +
  30726. '\\s*(?:' + singleAttrValues.join('|') + '))?'
  30727. );
  30728. // could use https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-QName
  30729. // but for Vue templates we can enforce a simple charset
  30730. var ncname = '[a-zA-Z_][\\w\\-\\.]*';
  30731. var qnameCapture = '((?:' + ncname + '\\:)?' + ncname + ')';
  30732. var startTagOpen = new RegExp('^<' + qnameCapture);
  30733. var startTagClose = /^\s*(\/?)>/;
  30734. var endTag = new RegExp('^<\\/' + qnameCapture + '[^>]*>');
  30735. var doctype = /^<!DOCTYPE [^>]+>/i;
  30736. var comment = /^<!--/;
  30737. var conditionalComment = /^<!\[/;
  30738. var IS_REGEX_CAPTURING_BROKEN = false;
  30739. 'x'.replace(/x(.)?/g, function (m, g) {
  30740. IS_REGEX_CAPTURING_BROKEN = g === '';
  30741. });
  30742. // Special Elements (can contain anything)
  30743. var isScriptOrStyle = makeMap('script,style', true);
  30744. var reCache = {};
  30745. var ltRE = /&lt;/g;
  30746. var gtRE = /&gt;/g;
  30747. var nlRE = /&#10;/g;
  30748. var ampRE = /&amp;/g;
  30749. var quoteRE = /&quot;/g;
  30750. function decodeAttr (value, shouldDecodeNewlines) {
  30751. if (shouldDecodeNewlines) {
  30752. value = value.replace(nlRE, '\n');
  30753. }
  30754. return value
  30755. .replace(ltRE, '<')
  30756. .replace(gtRE, '>')
  30757. .replace(ampRE, '&')
  30758. .replace(quoteRE, '"')
  30759. }
  30760. function parseHTML (html, options) {
  30761. var stack = [];
  30762. var expectHTML = options.expectHTML;
  30763. var isUnaryTag$$1 = options.isUnaryTag || no;
  30764. var index = 0;
  30765. var last, lastTag;
  30766. while (html) {
  30767. last = html;
  30768. // Make sure we're not in a script or style element
  30769. if (!lastTag || !isScriptOrStyle(lastTag)) {
  30770. var textEnd = html.indexOf('<');
  30771. if (textEnd === 0) {
  30772. // Comment:
  30773. if (comment.test(html)) {
  30774. var commentEnd = html.indexOf('-->');
  30775. if (commentEnd >= 0) {
  30776. advance(commentEnd + 3);
  30777. continue
  30778. }
  30779. }
  30780. // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
  30781. if (conditionalComment.test(html)) {
  30782. var conditionalEnd = html.indexOf(']>');
  30783. if (conditionalEnd >= 0) {
  30784. advance(conditionalEnd + 2);
  30785. continue
  30786. }
  30787. }
  30788. // Doctype:
  30789. var doctypeMatch = html.match(doctype);
  30790. if (doctypeMatch) {
  30791. advance(doctypeMatch[0].length);
  30792. continue
  30793. }
  30794. // End tag:
  30795. var endTagMatch = html.match(endTag);
  30796. if (endTagMatch) {
  30797. var curIndex = index;
  30798. advance(endTagMatch[0].length);
  30799. parseEndTag(endTagMatch[1], curIndex, index);
  30800. continue
  30801. }
  30802. // Start tag:
  30803. var startTagMatch = parseStartTag();
  30804. if (startTagMatch) {
  30805. handleStartTag(startTagMatch);
  30806. continue
  30807. }
  30808. }
  30809. var text = (void 0), rest$1 = (void 0), next = (void 0);
  30810. if (textEnd > 0) {
  30811. rest$1 = html.slice(textEnd);
  30812. while (
  30813. !endTag.test(rest$1) &&
  30814. !startTagOpen.test(rest$1) &&
  30815. !comment.test(rest$1) &&
  30816. !conditionalComment.test(rest$1)
  30817. ) {
  30818. // < in plain text, be forgiving and treat it as text
  30819. next = rest$1.indexOf('<', 1);
  30820. if (next < 0) { break }
  30821. textEnd += next;
  30822. rest$1 = html.slice(textEnd);
  30823. }
  30824. text = html.substring(0, textEnd);
  30825. advance(textEnd);
  30826. }
  30827. if (textEnd < 0) {
  30828. text = html;
  30829. html = '';
  30830. }
  30831. if (options.chars && text) {
  30832. options.chars(text);
  30833. }
  30834. } else {
  30835. var stackedTag = lastTag.toLowerCase();
  30836. var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));
  30837. var endTagLength = 0;
  30838. var rest = html.replace(reStackedTag, function (all, text, endTag) {
  30839. endTagLength = endTag.length;
  30840. if (stackedTag !== 'script' && stackedTag !== 'style' && stackedTag !== 'noscript') {
  30841. text = text
  30842. .replace(/<!--([\s\S]*?)-->/g, '$1')
  30843. .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1');
  30844. }
  30845. if (options.chars) {
  30846. options.chars(text);
  30847. }
  30848. return ''
  30849. });
  30850. index += html.length - rest.length;
  30851. html = rest;
  30852. parseEndTag(stackedTag, index - endTagLength, index);
  30853. }
  30854. if (html === last && options.chars) {
  30855. options.chars(html);
  30856. break
  30857. }
  30858. }
  30859. // Clean up any remaining tags
  30860. parseEndTag();
  30861. function advance (n) {
  30862. index += n;
  30863. html = html.substring(n);
  30864. }
  30865. function parseStartTag () {
  30866. var start = html.match(startTagOpen);
  30867. if (start) {
  30868. var match = {
  30869. tagName: start[1],
  30870. attrs: [],
  30871. start: index
  30872. };
  30873. advance(start[0].length);
  30874. var end, attr;
  30875. while (!(end = html.match(startTagClose)) && (attr = html.match(attribute))) {
  30876. advance(attr[0].length);
  30877. match.attrs.push(attr);
  30878. }
  30879. if (end) {
  30880. match.unarySlash = end[1];
  30881. advance(end[0].length);
  30882. match.end = index;
  30883. return match
  30884. }
  30885. }
  30886. }
  30887. function handleStartTag (match) {
  30888. var tagName = match.tagName;
  30889. var unarySlash = match.unarySlash;
  30890. if (expectHTML) {
  30891. if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
  30892. parseEndTag(lastTag);
  30893. }
  30894. if (canBeLeftOpenTag(tagName) && lastTag === tagName) {
  30895. parseEndTag(tagName);
  30896. }
  30897. }
  30898. var unary = isUnaryTag$$1(tagName) || tagName === 'html' && lastTag === 'head' || !!unarySlash;
  30899. var l = match.attrs.length;
  30900. var attrs = new Array(l);
  30901. for (var i = 0; i < l; i++) {
  30902. var args = match.attrs[i];
  30903. // hackish work around FF bug https://bugzilla.mozilla.org/show_bug.cgi?id=369778
  30904. if (IS_REGEX_CAPTURING_BROKEN && args[0].indexOf('""') === -1) {
  30905. if (args[3] === '') { delete args[3]; }
  30906. if (args[4] === '') { delete args[4]; }
  30907. if (args[5] === '') { delete args[5]; }
  30908. }
  30909. var value = args[3] || args[4] || args[5] || '';
  30910. attrs[i] = {
  30911. name: args[1],
  30912. value: decodeAttr(
  30913. value,
  30914. options.shouldDecodeNewlines
  30915. )
  30916. };
  30917. }
  30918. if (!unary) {
  30919. stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs });
  30920. lastTag = tagName;
  30921. unarySlash = '';
  30922. }
  30923. if (options.start) {
  30924. options.start(tagName, attrs, unary, match.start, match.end);
  30925. }
  30926. }
  30927. function parseEndTag (tagName, start, end) {
  30928. var pos, lowerCasedTagName;
  30929. if (start == null) { start = index; }
  30930. if (end == null) { end = index; }
  30931. if (tagName) {
  30932. lowerCasedTagName = tagName.toLowerCase();
  30933. }
  30934. // Find the closest opened tag of the same type
  30935. if (tagName) {
  30936. for (pos = stack.length - 1; pos >= 0; pos--) {
  30937. if (stack[pos].lowerCasedTag === lowerCasedTagName) {
  30938. break
  30939. }
  30940. }
  30941. } else {
  30942. // If no tag name is provided, clean shop
  30943. pos = 0;
  30944. }
  30945. if (pos >= 0) {
  30946. // Close all the open elements, up the stack
  30947. for (var i = stack.length - 1; i >= pos; i--) {
  30948. if (options.end) {
  30949. options.end(stack[i].tag, start, end);
  30950. }
  30951. }
  30952. // Remove the open elements from the stack
  30953. stack.length = pos;
  30954. lastTag = pos && stack[pos - 1].tag;
  30955. } else if (lowerCasedTagName === 'br') {
  30956. if (options.start) {
  30957. options.start(tagName, [], true, start, end);
  30958. }
  30959. } else if (lowerCasedTagName === 'p') {
  30960. if (options.start) {
  30961. options.start(tagName, [], false, start, end);
  30962. }
  30963. if (options.end) {
  30964. options.end(tagName, start, end);
  30965. }
  30966. }
  30967. }
  30968. }
  30969. /* */
  30970. function parseFilters (exp) {
  30971. var inSingle = false;
  30972. var inDouble = false;
  30973. var inTemplateString = false;
  30974. var inRegex = false;
  30975. var curly = 0;
  30976. var square = 0;
  30977. var paren = 0;
  30978. var lastFilterIndex = 0;
  30979. var c, prev, i, expression, filters;
  30980. for (i = 0; i < exp.length; i++) {
  30981. prev = c;
  30982. c = exp.charCodeAt(i);
  30983. if (inSingle) {
  30984. if (c === 0x27 && prev !== 0x5C) { inSingle = false; }
  30985. } else if (inDouble) {
  30986. if (c === 0x22 && prev !== 0x5C) { inDouble = false; }
  30987. } else if (inTemplateString) {
  30988. if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }
  30989. } else if (inRegex) {
  30990. if (c === 0x2f && prev !== 0x5C) { inRegex = false; }
  30991. } else if (
  30992. c === 0x7C && // pipe
  30993. exp.charCodeAt(i + 1) !== 0x7C &&
  30994. exp.charCodeAt(i - 1) !== 0x7C &&
  30995. !curly && !square && !paren
  30996. ) {
  30997. if (expression === undefined) {
  30998. // first filter, end of expression
  30999. lastFilterIndex = i + 1;
  31000. expression = exp.slice(0, i).trim();
  31001. } else {
  31002. pushFilter();
  31003. }
  31004. } else {
  31005. switch (c) {
  31006. case 0x22: inDouble = true; break // "
  31007. case 0x27: inSingle = true; break // '
  31008. case 0x60: inTemplateString = true; break // `
  31009. case 0x28: paren++; break // (
  31010. case 0x29: paren--; break // )
  31011. case 0x5B: square++; break // [
  31012. case 0x5D: square--; break // ]
  31013. case 0x7B: curly++; break // {
  31014. case 0x7D: curly--; break // }
  31015. }
  31016. if (c === 0x2f) { // /
  31017. var j = i - 1;
  31018. var p = (void 0);
  31019. // find first non-whitespace prev char
  31020. for (; j >= 0; j--) {
  31021. p = exp.charAt(j);
  31022. if (p !== ' ') { break }
  31023. }
  31024. if (!p || !/[\w$]/.test(p)) {
  31025. inRegex = true;
  31026. }
  31027. }
  31028. }
  31029. }
  31030. if (expression === undefined) {
  31031. expression = exp.slice(0, i).trim();
  31032. } else if (lastFilterIndex !== 0) {
  31033. pushFilter();
  31034. }
  31035. function pushFilter () {
  31036. (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());
  31037. lastFilterIndex = i + 1;
  31038. }
  31039. if (filters) {
  31040. for (i = 0; i < filters.length; i++) {
  31041. expression = wrapFilter(expression, filters[i]);
  31042. }
  31043. }
  31044. return expression
  31045. }
  31046. function wrapFilter (exp, filter) {
  31047. var i = filter.indexOf('(');
  31048. if (i < 0) {
  31049. // _f: resolveFilter
  31050. return ("_f(\"" + filter + "\")(" + exp + ")")
  31051. } else {
  31052. var name = filter.slice(0, i);
  31053. var args = filter.slice(i + 1);
  31054. return ("_f(\"" + name + "\")(" + exp + "," + args)
  31055. }
  31056. }
  31057. /* */
  31058. var defaultTagRE = /\{\{((?:.|\n)+?)\}\}/g;
  31059. var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
  31060. var buildRegex = cached(function (delimiters) {
  31061. var open = delimiters[0].replace(regexEscapeRE, '\\$&');
  31062. var close = delimiters[1].replace(regexEscapeRE, '\\$&');
  31063. return new RegExp(open + '((?:.|\\n)+?)' + close, 'g')
  31064. });
  31065. function parseText (
  31066. text,
  31067. delimiters
  31068. ) {
  31069. var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;
  31070. if (!tagRE.test(text)) {
  31071. return
  31072. }
  31073. var tokens = [];
  31074. var lastIndex = tagRE.lastIndex = 0;
  31075. var match, index;
  31076. while ((match = tagRE.exec(text))) {
  31077. index = match.index;
  31078. // push text token
  31079. if (index > lastIndex) {
  31080. tokens.push(JSON.stringify(text.slice(lastIndex, index)));
  31081. }
  31082. // tag token
  31083. var exp = parseFilters(match[1].trim());
  31084. tokens.push(("_s(" + exp + ")"));
  31085. lastIndex = index + match[0].length;
  31086. }
  31087. if (lastIndex < text.length) {
  31088. tokens.push(JSON.stringify(text.slice(lastIndex)));
  31089. }
  31090. return tokens.join('+')
  31091. }
  31092. /* */
  31093. function baseWarn (msg) {
  31094. console.error(("[Vue parser]: " + msg));
  31095. }
  31096. function pluckModuleFunction (
  31097. modules,
  31098. key
  31099. ) {
  31100. return modules
  31101. ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })
  31102. : []
  31103. }
  31104. function addProp (el, name, value) {
  31105. (el.props || (el.props = [])).push({ name: name, value: value });
  31106. }
  31107. function addAttr (el, name, value) {
  31108. (el.attrs || (el.attrs = [])).push({ name: name, value: value });
  31109. }
  31110. function addDirective (
  31111. el,
  31112. name,
  31113. rawName,
  31114. value,
  31115. arg,
  31116. modifiers
  31117. ) {
  31118. (el.directives || (el.directives = [])).push({ name: name, rawName: rawName, value: value, arg: arg, modifiers: modifiers });
  31119. }
  31120. function addHandler (
  31121. el,
  31122. name,
  31123. value,
  31124. modifiers,
  31125. important
  31126. ) {
  31127. // check capture modifier
  31128. if (modifiers && modifiers.capture) {
  31129. delete modifiers.capture;
  31130. name = '!' + name; // mark the event as captured
  31131. }
  31132. if (modifiers && modifiers.once) {
  31133. delete modifiers.once;
  31134. name = '~' + name; // mark the event as once
  31135. }
  31136. var events;
  31137. if (modifiers && modifiers.native) {
  31138. delete modifiers.native;
  31139. events = el.nativeEvents || (el.nativeEvents = {});
  31140. } else {
  31141. events = el.events || (el.events = {});
  31142. }
  31143. var newHandler = { value: value, modifiers: modifiers };
  31144. var handlers = events[name];
  31145. /* istanbul ignore if */
  31146. if (Array.isArray(handlers)) {
  31147. important ? handlers.unshift(newHandler) : handlers.push(newHandler);
  31148. } else if (handlers) {
  31149. events[name] = important ? [newHandler, handlers] : [handlers, newHandler];
  31150. } else {
  31151. events[name] = newHandler;
  31152. }
  31153. }
  31154. function getBindingAttr (
  31155. el,
  31156. name,
  31157. getStatic
  31158. ) {
  31159. var dynamicValue =
  31160. getAndRemoveAttr(el, ':' + name) ||
  31161. getAndRemoveAttr(el, 'v-bind:' + name);
  31162. if (dynamicValue != null) {
  31163. return parseFilters(dynamicValue)
  31164. } else if (getStatic !== false) {
  31165. var staticValue = getAndRemoveAttr(el, name);
  31166. if (staticValue != null) {
  31167. return JSON.stringify(staticValue)
  31168. }
  31169. }
  31170. }
  31171. function getAndRemoveAttr (el, name) {
  31172. var val;
  31173. if ((val = el.attrsMap[name]) != null) {
  31174. var list = el.attrsList;
  31175. for (var i = 0, l = list.length; i < l; i++) {
  31176. if (list[i].name === name) {
  31177. list.splice(i, 1);
  31178. break
  31179. }
  31180. }
  31181. }
  31182. return val
  31183. }
  31184. var len;
  31185. var str;
  31186. var chr;
  31187. var index$1;
  31188. var expressionPos;
  31189. var expressionEndPos;
  31190. /**
  31191. * parse directive model to do the array update transform. a[idx] = val => $$a.splice($$idx, 1, val)
  31192. *
  31193. * for loop possible cases:
  31194. *
  31195. * - test
  31196. * - test[idx]
  31197. * - test[test1[idx]]
  31198. * - test["a"][idx]
  31199. * - xxx.test[a[a].test1[idx]]
  31200. * - test.xxx.a["asa"][test1[idx]]
  31201. *
  31202. */
  31203. function parseModel (val) {
  31204. str = val;
  31205. len = str.length;
  31206. index$1 = expressionPos = expressionEndPos = 0;
  31207. if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
  31208. return {
  31209. exp: val,
  31210. idx: null
  31211. }
  31212. }
  31213. while (!eof()) {
  31214. chr = next();
  31215. /* istanbul ignore if */
  31216. if (isStringStart(chr)) {
  31217. parseString(chr);
  31218. } else if (chr === 0x5B) {
  31219. parseBracket(chr);
  31220. }
  31221. }
  31222. return {
  31223. exp: val.substring(0, expressionPos),
  31224. idx: val.substring(expressionPos + 1, expressionEndPos)
  31225. }
  31226. }
  31227. function next () {
  31228. return str.charCodeAt(++index$1)
  31229. }
  31230. function eof () {
  31231. return index$1 >= len
  31232. }
  31233. function isStringStart (chr) {
  31234. return chr === 0x22 || chr === 0x27
  31235. }
  31236. function parseBracket (chr) {
  31237. var inBracket = 1;
  31238. expressionPos = index$1;
  31239. while (!eof()) {
  31240. chr = next();
  31241. if (isStringStart(chr)) {
  31242. parseString(chr);
  31243. continue
  31244. }
  31245. if (chr === 0x5B) { inBracket++; }
  31246. if (chr === 0x5D) { inBracket--; }
  31247. if (inBracket === 0) {
  31248. expressionEndPos = index$1;
  31249. break
  31250. }
  31251. }
  31252. }
  31253. function parseString (chr) {
  31254. var stringQuote = chr;
  31255. while (!eof()) {
  31256. chr = next();
  31257. if (chr === stringQuote) {
  31258. break
  31259. }
  31260. }
  31261. }
  31262. /* */
  31263. var dirRE = /^v-|^@|^:/;
  31264. var forAliasRE = /(.*?)\s+(?:in|of)\s+(.*)/;
  31265. var forIteratorRE = /\((\{[^}]*\}|[^,]*),([^,]*)(?:,([^,]*))?\)/;
  31266. var bindRE = /^:|^v-bind:/;
  31267. var onRE = /^@|^v-on:/;
  31268. var argRE = /:(.*)$/;
  31269. var modifierRE = /\.[^.]+/g;
  31270. var decodeHTMLCached = cached(decode);
  31271. // configurable state
  31272. var warn$1;
  31273. var platformGetTagNamespace;
  31274. var platformMustUseProp;
  31275. var platformIsPreTag;
  31276. var preTransforms;
  31277. var transforms;
  31278. var postTransforms;
  31279. var delimiters;
  31280. /**
  31281. * Convert HTML string to AST.
  31282. */
  31283. function parse (
  31284. template,
  31285. options
  31286. ) {
  31287. warn$1 = options.warn || baseWarn;
  31288. platformGetTagNamespace = options.getTagNamespace || no;
  31289. platformMustUseProp = options.mustUseProp || no;
  31290. platformIsPreTag = options.isPreTag || no;
  31291. preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
  31292. transforms = pluckModuleFunction(options.modules, 'transformNode');
  31293. postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
  31294. delimiters = options.delimiters;
  31295. var stack = [];
  31296. var preserveWhitespace = options.preserveWhitespace !== false;
  31297. var root;
  31298. var currentParent;
  31299. var inVPre = false;
  31300. var inPre = false;
  31301. var warned = false;
  31302. parseHTML(template, {
  31303. expectHTML: options.expectHTML,
  31304. isUnaryTag: options.isUnaryTag,
  31305. shouldDecodeNewlines: options.shouldDecodeNewlines,
  31306. start: function start (tag, attrs, unary) {
  31307. // check namespace.
  31308. // inherit parent ns if there is one
  31309. var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);
  31310. // handle IE svg bug
  31311. /* istanbul ignore if */
  31312. if (isIE && ns === 'svg') {
  31313. attrs = guardIESVGBug(attrs);
  31314. }
  31315. var element = {
  31316. type: 1,
  31317. tag: tag,
  31318. attrsList: attrs,
  31319. attrsMap: makeAttrsMap(attrs),
  31320. parent: currentParent,
  31321. children: []
  31322. };
  31323. if (ns) {
  31324. element.ns = ns;
  31325. }
  31326. if (isForbiddenTag(element) && !isServerRendering()) {
  31327. element.forbidden = true;
  31328. process.env.NODE_ENV !== 'production' && warn$1(
  31329. 'Templates should only be responsible for mapping the state to the ' +
  31330. 'UI. Avoid placing tags with side-effects in your templates, such as ' +
  31331. "<" + tag + ">" + ', as they will not be parsed.'
  31332. );
  31333. }
  31334. // apply pre-transforms
  31335. for (var i = 0; i < preTransforms.length; i++) {
  31336. preTransforms[i](element, options);
  31337. }
  31338. if (!inVPre) {
  31339. processPre(element);
  31340. if (element.pre) {
  31341. inVPre = true;
  31342. }
  31343. }
  31344. if (platformIsPreTag(element.tag)) {
  31345. inPre = true;
  31346. }
  31347. if (inVPre) {
  31348. processRawAttrs(element);
  31349. } else {
  31350. processFor(element);
  31351. processIf(element);
  31352. processOnce(element);
  31353. processKey(element);
  31354. // determine whether this is a plain element after
  31355. // removing structural attributes
  31356. element.plain = !element.key && !attrs.length;
  31357. processRef(element);
  31358. processSlot(element);
  31359. processComponent(element);
  31360. for (var i$1 = 0; i$1 < transforms.length; i$1++) {
  31361. transforms[i$1](element, options);
  31362. }
  31363. processAttrs(element);
  31364. }
  31365. function checkRootConstraints (el) {
  31366. if (process.env.NODE_ENV !== 'production' && !warned) {
  31367. if (el.tag === 'slot' || el.tag === 'template') {
  31368. warned = true;
  31369. warn$1(
  31370. "Cannot use <" + (el.tag) + "> as component root element because it may " +
  31371. 'contain multiple nodes:\n' + template
  31372. );
  31373. }
  31374. if (el.attrsMap.hasOwnProperty('v-for')) {
  31375. warned = true;
  31376. warn$1(
  31377. 'Cannot use v-for on stateful component root element because ' +
  31378. 'it renders multiple elements:\n' + template
  31379. );
  31380. }
  31381. }
  31382. }
  31383. // tree management
  31384. if (!root) {
  31385. root = element;
  31386. checkRootConstraints(root);
  31387. } else if (!stack.length) {
  31388. // allow root elements with v-if, v-else-if and v-else
  31389. if (root.if && (element.elseif || element.else)) {
  31390. checkRootConstraints(element);
  31391. addIfCondition(root, {
  31392. exp: element.elseif,
  31393. block: element
  31394. });
  31395. } else if (process.env.NODE_ENV !== 'production' && !warned) {
  31396. warned = true;
  31397. warn$1(
  31398. "Component template should contain exactly one root element:" +
  31399. "\n\n" + template + "\n\n" +
  31400. "If you are using v-if on multiple elements, " +
  31401. "use v-else-if to chain them instead."
  31402. );
  31403. }
  31404. }
  31405. if (currentParent && !element.forbidden) {
  31406. if (element.elseif || element.else) {
  31407. processIfConditions(element, currentParent);
  31408. } else if (element.slotScope) { // scoped slot
  31409. currentParent.plain = false;
  31410. var name = element.slotTarget || 'default';(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;
  31411. } else {
  31412. currentParent.children.push(element);
  31413. element.parent = currentParent;
  31414. }
  31415. }
  31416. if (!unary) {
  31417. currentParent = element;
  31418. stack.push(element);
  31419. }
  31420. // apply post-transforms
  31421. for (var i$2 = 0; i$2 < postTransforms.length; i$2++) {
  31422. postTransforms[i$2](element, options);
  31423. }
  31424. },
  31425. end: function end () {
  31426. // remove trailing whitespace
  31427. var element = stack[stack.length - 1];
  31428. var lastNode = element.children[element.children.length - 1];
  31429. if (lastNode && lastNode.type === 3 && lastNode.text === ' ') {
  31430. element.children.pop();
  31431. }
  31432. // pop stack
  31433. stack.length -= 1;
  31434. currentParent = stack[stack.length - 1];
  31435. // check pre state
  31436. if (element.pre) {
  31437. inVPre = false;
  31438. }
  31439. if (platformIsPreTag(element.tag)) {
  31440. inPre = false;
  31441. }
  31442. },
  31443. chars: function chars (text) {
  31444. if (!currentParent) {
  31445. if (process.env.NODE_ENV !== 'production' && !warned && text === template) {
  31446. warned = true;
  31447. warn$1(
  31448. 'Component template requires a root element, rather than just text:\n\n' + template
  31449. );
  31450. }
  31451. return
  31452. }
  31453. // IE textarea placeholder bug
  31454. /* istanbul ignore if */
  31455. if (isIE &&
  31456. currentParent.tag === 'textarea' &&
  31457. currentParent.attrsMap.placeholder === text) {
  31458. return
  31459. }
  31460. var children = currentParent.children;
  31461. text = inPre || text.trim()
  31462. ? decodeHTMLCached(text)
  31463. // only preserve whitespace if its not right after a starting tag
  31464. : preserveWhitespace && children.length ? ' ' : '';
  31465. if (text) {
  31466. var expression;
  31467. if (!inVPre && text !== ' ' && (expression = parseText(text, delimiters))) {
  31468. children.push({
  31469. type: 2,
  31470. expression: expression,
  31471. text: text
  31472. });
  31473. } else if (text !== ' ' || children[children.length - 1].text !== ' ') {
  31474. currentParent.children.push({
  31475. type: 3,
  31476. text: text
  31477. });
  31478. }
  31479. }
  31480. }
  31481. });
  31482. return root
  31483. }
  31484. function processPre (el) {
  31485. if (getAndRemoveAttr(el, 'v-pre') != null) {
  31486. el.pre = true;
  31487. }
  31488. }
  31489. function processRawAttrs (el) {
  31490. var l = el.attrsList.length;
  31491. if (l) {
  31492. var attrs = el.attrs = new Array(l);
  31493. for (var i = 0; i < l; i++) {
  31494. attrs[i] = {
  31495. name: el.attrsList[i].name,
  31496. value: JSON.stringify(el.attrsList[i].value)
  31497. };
  31498. }
  31499. } else if (!el.pre) {
  31500. // non root node in pre blocks with no attributes
  31501. el.plain = true;
  31502. }
  31503. }
  31504. function processKey (el) {
  31505. var exp = getBindingAttr(el, 'key');
  31506. if (exp) {
  31507. if (process.env.NODE_ENV !== 'production' && el.tag === 'template') {
  31508. warn$1("<template> cannot be keyed. Place the key on real elements instead.");
  31509. }
  31510. el.key = exp;
  31511. }
  31512. }
  31513. function processRef (el) {
  31514. var ref = getBindingAttr(el, 'ref');
  31515. if (ref) {
  31516. el.ref = ref;
  31517. el.refInFor = checkInFor(el);
  31518. }
  31519. }
  31520. function processFor (el) {
  31521. var exp;
  31522. if ((exp = getAndRemoveAttr(el, 'v-for'))) {
  31523. var inMatch = exp.match(forAliasRE);
  31524. if (!inMatch) {
  31525. process.env.NODE_ENV !== 'production' && warn$1(
  31526. ("Invalid v-for expression: " + exp)
  31527. );
  31528. return
  31529. }
  31530. el.for = inMatch[2].trim();
  31531. var alias = inMatch[1].trim();
  31532. var iteratorMatch = alias.match(forIteratorRE);
  31533. if (iteratorMatch) {
  31534. el.alias = iteratorMatch[1].trim();
  31535. el.iterator1 = iteratorMatch[2].trim();
  31536. if (iteratorMatch[3]) {
  31537. el.iterator2 = iteratorMatch[3].trim();
  31538. }
  31539. } else {
  31540. el.alias = alias;
  31541. }
  31542. }
  31543. }
  31544. function processIf (el) {
  31545. var exp = getAndRemoveAttr(el, 'v-if');
  31546. if (exp) {
  31547. el.if = exp;
  31548. addIfCondition(el, {
  31549. exp: exp,
  31550. block: el
  31551. });
  31552. } else {
  31553. if (getAndRemoveAttr(el, 'v-else') != null) {
  31554. el.else = true;
  31555. }
  31556. var elseif = getAndRemoveAttr(el, 'v-else-if');
  31557. if (elseif) {
  31558. el.elseif = elseif;
  31559. }
  31560. }
  31561. }
  31562. function processIfConditions (el, parent) {
  31563. var prev = findPrevElement(parent.children);
  31564. if (prev && prev.if) {
  31565. addIfCondition(prev, {
  31566. exp: el.elseif,
  31567. block: el
  31568. });
  31569. } else if (process.env.NODE_ENV !== 'production') {
  31570. warn$1(
  31571. "v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " +
  31572. "used on element <" + (el.tag) + "> without corresponding v-if."
  31573. );
  31574. }
  31575. }
  31576. function findPrevElement (children) {
  31577. var i = children.length;
  31578. while (i--) {
  31579. if (children[i].type === 1) {
  31580. return children[i]
  31581. } else {
  31582. if (process.env.NODE_ENV !== 'production' && children[i].text !== ' ') {
  31583. warn$1(
  31584. "text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " +
  31585. "will be ignored."
  31586. );
  31587. }
  31588. children.pop();
  31589. }
  31590. }
  31591. }
  31592. function addIfCondition (el, condition) {
  31593. if (!el.ifConditions) {
  31594. el.ifConditions = [];
  31595. }
  31596. el.ifConditions.push(condition);
  31597. }
  31598. function processOnce (el) {
  31599. var once = getAndRemoveAttr(el, 'v-once');
  31600. if (once != null) {
  31601. el.once = true;
  31602. }
  31603. }
  31604. function processSlot (el) {
  31605. if (el.tag === 'slot') {
  31606. el.slotName = getBindingAttr(el, 'name');
  31607. if (process.env.NODE_ENV !== 'production' && el.key) {
  31608. warn$1(
  31609. "`key` does not work on <slot> because slots are abstract outlets " +
  31610. "and can possibly expand into multiple elements. " +
  31611. "Use the key on a wrapping element instead."
  31612. );
  31613. }
  31614. } else {
  31615. var slotTarget = getBindingAttr(el, 'slot');
  31616. if (slotTarget) {
  31617. el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget;
  31618. }
  31619. if (el.tag === 'template') {
  31620. el.slotScope = getAndRemoveAttr(el, 'scope');
  31621. }
  31622. }
  31623. }
  31624. function processComponent (el) {
  31625. var binding;
  31626. if ((binding = getBindingAttr(el, 'is'))) {
  31627. el.component = binding;
  31628. }
  31629. if (getAndRemoveAttr(el, 'inline-template') != null) {
  31630. el.inlineTemplate = true;
  31631. }
  31632. }
  31633. function processAttrs (el) {
  31634. var list = el.attrsList;
  31635. var i, l, name, rawName, value, arg, modifiers, isProp;
  31636. for (i = 0, l = list.length; i < l; i++) {
  31637. name = rawName = list[i].name;
  31638. value = list[i].value;
  31639. if (dirRE.test(name)) {
  31640. // mark element as dynamic
  31641. el.hasBindings = true;
  31642. // modifiers
  31643. modifiers = parseModifiers(name);
  31644. if (modifiers) {
  31645. name = name.replace(modifierRE, '');
  31646. }
  31647. if (bindRE.test(name)) { // v-bind
  31648. name = name.replace(bindRE, '');
  31649. value = parseFilters(value);
  31650. isProp = false;
  31651. if (modifiers) {
  31652. if (modifiers.prop) {
  31653. isProp = true;
  31654. name = camelize(name);
  31655. if (name === 'innerHtml') { name = 'innerHTML'; }
  31656. }
  31657. if (modifiers.camel) {
  31658. name = camelize(name);
  31659. }
  31660. }
  31661. if (isProp || platformMustUseProp(el.tag, el.attrsMap.type, name)) {
  31662. addProp(el, name, value);
  31663. } else {
  31664. addAttr(el, name, value);
  31665. }
  31666. } else if (onRE.test(name)) { // v-on
  31667. name = name.replace(onRE, '');
  31668. addHandler(el, name, value, modifiers);
  31669. } else { // normal directives
  31670. name = name.replace(dirRE, '');
  31671. // parse arg
  31672. var argMatch = name.match(argRE);
  31673. if (argMatch && (arg = argMatch[1])) {
  31674. name = name.slice(0, -(arg.length + 1));
  31675. }
  31676. addDirective(el, name, rawName, value, arg, modifiers);
  31677. if (process.env.NODE_ENV !== 'production' && name === 'model') {
  31678. checkForAliasModel(el, value);
  31679. }
  31680. }
  31681. } else {
  31682. // literal attribute
  31683. if (process.env.NODE_ENV !== 'production') {
  31684. var expression = parseText(value, delimiters);
  31685. if (expression) {
  31686. warn$1(
  31687. name + "=\"" + value + "\": " +
  31688. 'Interpolation inside attributes has been removed. ' +
  31689. 'Use v-bind or the colon shorthand instead. For example, ' +
  31690. 'instead of <div id="{{ val }}">, use <div :id="val">.'
  31691. );
  31692. }
  31693. }
  31694. addAttr(el, name, JSON.stringify(value));
  31695. }
  31696. }
  31697. }
  31698. function checkInFor (el) {
  31699. var parent = el;
  31700. while (parent) {
  31701. if (parent.for !== undefined) {
  31702. return true
  31703. }
  31704. parent = parent.parent;
  31705. }
  31706. return false
  31707. }
  31708. function parseModifiers (name) {
  31709. var match = name.match(modifierRE);
  31710. if (match) {
  31711. var ret = {};
  31712. match.forEach(function (m) { ret[m.slice(1)] = true; });
  31713. return ret
  31714. }
  31715. }
  31716. function makeAttrsMap (attrs) {
  31717. var map = {};
  31718. for (var i = 0, l = attrs.length; i < l; i++) {
  31719. if (process.env.NODE_ENV !== 'production' && map[attrs[i].name] && !isIE) {
  31720. warn$1('duplicate attribute: ' + attrs[i].name);
  31721. }
  31722. map[attrs[i].name] = attrs[i].value;
  31723. }
  31724. return map
  31725. }
  31726. function isForbiddenTag (el) {
  31727. return (
  31728. el.tag === 'style' ||
  31729. (el.tag === 'script' && (
  31730. !el.attrsMap.type ||
  31731. el.attrsMap.type === 'text/javascript'
  31732. ))
  31733. )
  31734. }
  31735. var ieNSBug = /^xmlns:NS\d+/;
  31736. var ieNSPrefix = /^NS\d+:/;
  31737. /* istanbul ignore next */
  31738. function guardIESVGBug (attrs) {
  31739. var res = [];
  31740. for (var i = 0; i < attrs.length; i++) {
  31741. var attr = attrs[i];
  31742. if (!ieNSBug.test(attr.name)) {
  31743. attr.name = attr.name.replace(ieNSPrefix, '');
  31744. res.push(attr);
  31745. }
  31746. }
  31747. return res
  31748. }
  31749. function checkForAliasModel (el, value) {
  31750. var _el = el;
  31751. while (_el) {
  31752. if (_el.for && _el.alias === value) {
  31753. warn$1(
  31754. "<" + (el.tag) + " v-model=\"" + value + "\">: " +
  31755. "You are binding v-model directly to a v-for iteration alias. " +
  31756. "This will not be able to modify the v-for source array because " +
  31757. "writing to the alias is like modifying a function local variable. " +
  31758. "Consider using an array of objects and use v-model on an object property instead."
  31759. );
  31760. }
  31761. _el = _el.parent;
  31762. }
  31763. }
  31764. /* */
  31765. var isStaticKey;
  31766. var isPlatformReservedTag;
  31767. var genStaticKeysCached = cached(genStaticKeys$1);
  31768. /**
  31769. * Goal of the optimizer: walk the generated template AST tree
  31770. * and detect sub-trees that are purely static, i.e. parts of
  31771. * the DOM that never needs to change.
  31772. *
  31773. * Once we detect these sub-trees, we can:
  31774. *
  31775. * 1. Hoist them into constants, so that we no longer need to
  31776. * create fresh nodes for them on each re-render;
  31777. * 2. Completely skip them in the patching process.
  31778. */
  31779. function optimize (root, options) {
  31780. if (!root) { return }
  31781. isStaticKey = genStaticKeysCached(options.staticKeys || '');
  31782. isPlatformReservedTag = options.isReservedTag || no;
  31783. // first pass: mark all non-static nodes.
  31784. markStatic(root);
  31785. // second pass: mark static roots.
  31786. markStaticRoots(root, false);
  31787. }
  31788. function genStaticKeys$1 (keys) {
  31789. return makeMap(
  31790. 'type,tag,attrsList,attrsMap,plain,parent,children,attrs' +
  31791. (keys ? ',' + keys : '')
  31792. )
  31793. }
  31794. function markStatic (node) {
  31795. node.static = isStatic(node);
  31796. if (node.type === 1) {
  31797. // do not make component slot content static. this avoids
  31798. // 1. components not able to mutate slot nodes
  31799. // 2. static slot content fails for hot-reloading
  31800. if (
  31801. !isPlatformReservedTag(node.tag) &&
  31802. node.tag !== 'slot' &&
  31803. node.attrsMap['inline-template'] == null
  31804. ) {
  31805. return
  31806. }
  31807. for (var i = 0, l = node.children.length; i < l; i++) {
  31808. var child = node.children[i];
  31809. markStatic(child);
  31810. if (!child.static) {
  31811. node.static = false;
  31812. }
  31813. }
  31814. }
  31815. }
  31816. function markStaticRoots (node, isInFor) {
  31817. if (node.type === 1) {
  31818. if (node.static || node.once) {
  31819. node.staticInFor = isInFor;
  31820. }
  31821. // For a node to qualify as a static root, it should have children that
  31822. // are not just static text. Otherwise the cost of hoisting out will
  31823. // outweigh the benefits and it's better off to just always render it fresh.
  31824. if (node.static && node.children.length && !(
  31825. node.children.length === 1 &&
  31826. node.children[0].type === 3
  31827. )) {
  31828. node.staticRoot = true;
  31829. return
  31830. } else {
  31831. node.staticRoot = false;
  31832. }
  31833. if (node.children) {
  31834. for (var i = 0, l = node.children.length; i < l; i++) {
  31835. markStaticRoots(node.children[i], isInFor || !!node.for);
  31836. }
  31837. }
  31838. if (node.ifConditions) {
  31839. walkThroughConditionsBlocks(node.ifConditions, isInFor);
  31840. }
  31841. }
  31842. }
  31843. function walkThroughConditionsBlocks (conditionBlocks, isInFor) {
  31844. for (var i = 1, len = conditionBlocks.length; i < len; i++) {
  31845. markStaticRoots(conditionBlocks[i].block, isInFor);
  31846. }
  31847. }
  31848. function isStatic (node) {
  31849. if (node.type === 2) { // expression
  31850. return false
  31851. }
  31852. if (node.type === 3) { // text
  31853. return true
  31854. }
  31855. return !!(node.pre || (
  31856. !node.hasBindings && // no dynamic bindings
  31857. !node.if && !node.for && // not v-if or v-for or v-else
  31858. !isBuiltInTag(node.tag) && // not a built-in
  31859. isPlatformReservedTag(node.tag) && // not a component
  31860. !isDirectChildOfTemplateFor(node) &&
  31861. Object.keys(node).every(isStaticKey)
  31862. ))
  31863. }
  31864. function isDirectChildOfTemplateFor (node) {
  31865. while (node.parent) {
  31866. node = node.parent;
  31867. if (node.tag !== 'template') {
  31868. return false
  31869. }
  31870. if (node.for) {
  31871. return true
  31872. }
  31873. }
  31874. return false
  31875. }
  31876. /* */
  31877. var fnExpRE = /^\s*([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/;
  31878. var simplePathRE = /^\s*[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?']|\[".*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*\s*$/;
  31879. // keyCode aliases
  31880. var keyCodes = {
  31881. esc: 27,
  31882. tab: 9,
  31883. enter: 13,
  31884. space: 32,
  31885. up: 38,
  31886. left: 37,
  31887. right: 39,
  31888. down: 40,
  31889. 'delete': [8, 46]
  31890. };
  31891. var modifierCode = {
  31892. stop: '$event.stopPropagation();',
  31893. prevent: '$event.preventDefault();',
  31894. self: 'if($event.target !== $event.currentTarget)return;',
  31895. ctrl: 'if(!$event.ctrlKey)return;',
  31896. shift: 'if(!$event.shiftKey)return;',
  31897. alt: 'if(!$event.altKey)return;',
  31898. meta: 'if(!$event.metaKey)return;'
  31899. };
  31900. function genHandlers (events, native) {
  31901. var res = native ? 'nativeOn:{' : 'on:{';
  31902. for (var name in events) {
  31903. res += "\"" + name + "\":" + (genHandler(name, events[name])) + ",";
  31904. }
  31905. return res.slice(0, -1) + '}'
  31906. }
  31907. function genHandler (
  31908. name,
  31909. handler
  31910. ) {
  31911. if (!handler) {
  31912. return 'function(){}'
  31913. } else if (Array.isArray(handler)) {
  31914. return ("[" + (handler.map(function (handler) { return genHandler(name, handler); }).join(',')) + "]")
  31915. } else if (!handler.modifiers) {
  31916. return fnExpRE.test(handler.value) || simplePathRE.test(handler.value)
  31917. ? handler.value
  31918. : ("function($event){" + (handler.value) + "}")
  31919. } else {
  31920. var code = '';
  31921. var keys = [];
  31922. for (var key in handler.modifiers) {
  31923. if (modifierCode[key]) {
  31924. code += modifierCode[key];
  31925. } else {
  31926. keys.push(key);
  31927. }
  31928. }
  31929. if (keys.length) {
  31930. code = genKeyFilter(keys) + code;
  31931. }
  31932. var handlerCode = simplePathRE.test(handler.value)
  31933. ? handler.value + '($event)'
  31934. : handler.value;
  31935. return 'function($event){' + code + handlerCode + '}'
  31936. }
  31937. }
  31938. function genKeyFilter (keys) {
  31939. return ("if(" + (keys.map(genFilterCode).join('&&')) + ")return;")
  31940. }
  31941. function genFilterCode (key) {
  31942. var keyVal = parseInt(key, 10);
  31943. if (keyVal) {
  31944. return ("$event.keyCode!==" + keyVal)
  31945. }
  31946. var alias = keyCodes[key];
  31947. return ("_k($event.keyCode," + (JSON.stringify(key)) + (alias ? ',' + JSON.stringify(alias) : '') + ")")
  31948. }
  31949. /* */
  31950. function bind$2 (el, dir) {
  31951. el.wrapData = function (code) {
  31952. return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + (dir.modifiers && dir.modifiers.prop ? ',true' : '') + ")")
  31953. };
  31954. }
  31955. /* */
  31956. var baseDirectives = {
  31957. bind: bind$2,
  31958. cloak: noop
  31959. };
  31960. /* */
  31961. // configurable state
  31962. var warn$2;
  31963. var transforms$1;
  31964. var dataGenFns;
  31965. var platformDirectives$1;
  31966. var isPlatformReservedTag$1;
  31967. var staticRenderFns;
  31968. var onceCount;
  31969. var currentOptions;
  31970. function generate (
  31971. ast,
  31972. options
  31973. ) {
  31974. // save previous staticRenderFns so generate calls can be nested
  31975. var prevStaticRenderFns = staticRenderFns;
  31976. var currentStaticRenderFns = staticRenderFns = [];
  31977. var prevOnceCount = onceCount;
  31978. onceCount = 0;
  31979. currentOptions = options;
  31980. warn$2 = options.warn || baseWarn;
  31981. transforms$1 = pluckModuleFunction(options.modules, 'transformCode');
  31982. dataGenFns = pluckModuleFunction(options.modules, 'genData');
  31983. platformDirectives$1 = options.directives || {};
  31984. isPlatformReservedTag$1 = options.isReservedTag || no;
  31985. var code = ast ? genElement(ast) : '_c("div")';
  31986. staticRenderFns = prevStaticRenderFns;
  31987. onceCount = prevOnceCount;
  31988. return {
  31989. render: ("with(this){return " + code + "}"),
  31990. staticRenderFns: currentStaticRenderFns
  31991. }
  31992. }
  31993. function genElement (el) {
  31994. if (el.staticRoot && !el.staticProcessed) {
  31995. return genStatic(el)
  31996. } else if (el.once && !el.onceProcessed) {
  31997. return genOnce(el)
  31998. } else if (el.for && !el.forProcessed) {
  31999. return genFor(el)
  32000. } else if (el.if && !el.ifProcessed) {
  32001. return genIf(el)
  32002. } else if (el.tag === 'template' && !el.slotTarget) {
  32003. return genChildren(el) || 'void 0'
  32004. } else if (el.tag === 'slot') {
  32005. return genSlot(el)
  32006. } else {
  32007. // component or element
  32008. var code;
  32009. if (el.component) {
  32010. code = genComponent(el.component, el);
  32011. } else {
  32012. var data = el.plain ? undefined : genData(el);
  32013. var children = el.inlineTemplate ? null : genChildren(el, true);
  32014. code = "_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")";
  32015. }
  32016. // module transforms
  32017. for (var i = 0; i < transforms$1.length; i++) {
  32018. code = transforms$1[i](el, code);
  32019. }
  32020. return code
  32021. }
  32022. }
  32023. // hoist static sub-trees out
  32024. function genStatic (el) {
  32025. el.staticProcessed = true;
  32026. staticRenderFns.push(("with(this){return " + (genElement(el)) + "}"));
  32027. return ("_m(" + (staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")")
  32028. }
  32029. // v-once
  32030. function genOnce (el) {
  32031. el.onceProcessed = true;
  32032. if (el.if && !el.ifProcessed) {
  32033. return genIf(el)
  32034. } else if (el.staticInFor) {
  32035. var key = '';
  32036. var parent = el.parent;
  32037. while (parent) {
  32038. if (parent.for) {
  32039. key = parent.key;
  32040. break
  32041. }
  32042. parent = parent.parent;
  32043. }
  32044. if (!key) {
  32045. process.env.NODE_ENV !== 'production' && warn$2(
  32046. "v-once can only be used inside v-for that is keyed. "
  32047. );
  32048. return genElement(el)
  32049. }
  32050. return ("_o(" + (genElement(el)) + "," + (onceCount++) + (key ? ("," + key) : "") + ")")
  32051. } else {
  32052. return genStatic(el)
  32053. }
  32054. }
  32055. function genIf (el) {
  32056. el.ifProcessed = true; // avoid recursion
  32057. return genIfConditions(el.ifConditions.slice())
  32058. }
  32059. function genIfConditions (conditions) {
  32060. if (!conditions.length) {
  32061. return '_e()'
  32062. }
  32063. var condition = conditions.shift();
  32064. if (condition.exp) {
  32065. return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions)))
  32066. } else {
  32067. return ("" + (genTernaryExp(condition.block)))
  32068. }
  32069. // v-if with v-once should generate code like (a)?_m(0):_m(1)
  32070. function genTernaryExp (el) {
  32071. return el.once ? genOnce(el) : genElement(el)
  32072. }
  32073. }
  32074. function genFor (el) {
  32075. var exp = el.for;
  32076. var alias = el.alias;
  32077. var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
  32078. var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
  32079. el.forProcessed = true; // avoid recursion
  32080. return "_l((" + exp + ")," +
  32081. "function(" + alias + iterator1 + iterator2 + "){" +
  32082. "return " + (genElement(el)) +
  32083. '})'
  32084. }
  32085. function genData (el) {
  32086. var data = '{';
  32087. // directives first.
  32088. // directives may mutate the el's other properties before they are generated.
  32089. var dirs = genDirectives(el);
  32090. if (dirs) { data += dirs + ','; }
  32091. // key
  32092. if (el.key) {
  32093. data += "key:" + (el.key) + ",";
  32094. }
  32095. // ref
  32096. if (el.ref) {
  32097. data += "ref:" + (el.ref) + ",";
  32098. }
  32099. if (el.refInFor) {
  32100. data += "refInFor:true,";
  32101. }
  32102. // pre
  32103. if (el.pre) {
  32104. data += "pre:true,";
  32105. }
  32106. // record original tag name for components using "is" attribute
  32107. if (el.component) {
  32108. data += "tag:\"" + (el.tag) + "\",";
  32109. }
  32110. // module data generation functions
  32111. for (var i = 0; i < dataGenFns.length; i++) {
  32112. data += dataGenFns[i](el);
  32113. }
  32114. // attributes
  32115. if (el.attrs) {
  32116. data += "attrs:{" + (genProps(el.attrs)) + "},";
  32117. }
  32118. // DOM props
  32119. if (el.props) {
  32120. data += "domProps:{" + (genProps(el.props)) + "},";
  32121. }
  32122. // event handlers
  32123. if (el.events) {
  32124. data += (genHandlers(el.events)) + ",";
  32125. }
  32126. if (el.nativeEvents) {
  32127. data += (genHandlers(el.nativeEvents, true)) + ",";
  32128. }
  32129. // slot target
  32130. if (el.slotTarget) {
  32131. data += "slot:" + (el.slotTarget) + ",";
  32132. }
  32133. // scoped slots
  32134. if (el.scopedSlots) {
  32135. data += (genScopedSlots(el.scopedSlots)) + ",";
  32136. }
  32137. // inline-template
  32138. if (el.inlineTemplate) {
  32139. var inlineTemplate = genInlineTemplate(el);
  32140. if (inlineTemplate) {
  32141. data += inlineTemplate + ",";
  32142. }
  32143. }
  32144. data = data.replace(/,$/, '') + '}';
  32145. // v-bind data wrap
  32146. if (el.wrapData) {
  32147. data = el.wrapData(data);
  32148. }
  32149. return data
  32150. }
  32151. function genDirectives (el) {
  32152. var dirs = el.directives;
  32153. if (!dirs) { return }
  32154. var res = 'directives:[';
  32155. var hasRuntime = false;
  32156. var i, l, dir, needRuntime;
  32157. for (i = 0, l = dirs.length; i < l; i++) {
  32158. dir = dirs[i];
  32159. needRuntime = true;
  32160. var gen = platformDirectives$1[dir.name] || baseDirectives[dir.name];
  32161. if (gen) {
  32162. // compile-time directive that manipulates AST.
  32163. // returns true if it also needs a runtime counterpart.
  32164. needRuntime = !!gen(el, dir, warn$2);
  32165. }
  32166. if (needRuntime) {
  32167. hasRuntime = true;
  32168. 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))) : '') + "},";
  32169. }
  32170. }
  32171. if (hasRuntime) {
  32172. return res.slice(0, -1) + ']'
  32173. }
  32174. }
  32175. function genInlineTemplate (el) {
  32176. var ast = el.children[0];
  32177. if (process.env.NODE_ENV !== 'production' && (
  32178. el.children.length > 1 || ast.type !== 1
  32179. )) {
  32180. warn$2('Inline-template components must have exactly one child element.');
  32181. }
  32182. if (ast.type === 1) {
  32183. var inlineRenderFns = generate(ast, currentOptions);
  32184. return ("inlineTemplate:{render:function(){" + (inlineRenderFns.render) + "},staticRenderFns:[" + (inlineRenderFns.staticRenderFns.map(function (code) { return ("function(){" + code + "}"); }).join(',')) + "]}")
  32185. }
  32186. }
  32187. function genScopedSlots (slots) {
  32188. return ("scopedSlots:{" + (Object.keys(slots).map(function (key) { return genScopedSlot(key, slots[key]); }).join(',')) + "}")
  32189. }
  32190. function genScopedSlot (key, el) {
  32191. return key + ":function(" + (String(el.attrsMap.scope)) + "){" +
  32192. "return " + (el.tag === 'template'
  32193. ? genChildren(el) || 'void 0'
  32194. : genElement(el)) + "}"
  32195. }
  32196. function genChildren (el, checkSkip) {
  32197. var children = el.children;
  32198. if (children.length) {
  32199. var el$1 = children[0];
  32200. // optimize single v-for
  32201. if (children.length === 1 &&
  32202. el$1.for &&
  32203. el$1.tag !== 'template' &&
  32204. el$1.tag !== 'slot') {
  32205. return genElement(el$1)
  32206. }
  32207. var normalizationType = getNormalizationType(children);
  32208. return ("[" + (children.map(genNode).join(',')) + "]" + (checkSkip
  32209. ? normalizationType ? ("," + normalizationType) : ''
  32210. : ''))
  32211. }
  32212. }
  32213. // determine the normalization needed for the children array.
  32214. // 0: no normalization needed
  32215. // 1: simple normalization needed (possible 1-level deep nested array)
  32216. // 2: full normalization needed
  32217. function getNormalizationType (children) {
  32218. var res = 0;
  32219. for (var i = 0; i < children.length; i++) {
  32220. var el = children[i];
  32221. if (el.type !== 1) {
  32222. continue
  32223. }
  32224. if (needsNormalization(el) ||
  32225. (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {
  32226. res = 2;
  32227. break
  32228. }
  32229. if (maybeComponent(el) ||
  32230. (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {
  32231. res = 1;
  32232. }
  32233. }
  32234. return res
  32235. }
  32236. function needsNormalization (el) {
  32237. return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'
  32238. }
  32239. function maybeComponent (el) {
  32240. return !isPlatformReservedTag$1(el.tag)
  32241. }
  32242. function genNode (node) {
  32243. if (node.type === 1) {
  32244. return genElement(node)
  32245. } else {
  32246. return genText(node)
  32247. }
  32248. }
  32249. function genText (text) {
  32250. return ("_v(" + (text.type === 2
  32251. ? text.expression // no need for () because already wrapped in _s()
  32252. : transformSpecialNewlines(JSON.stringify(text.text))) + ")")
  32253. }
  32254. function genSlot (el) {
  32255. var slotName = el.slotName || '"default"';
  32256. var children = genChildren(el);
  32257. var res = "_t(" + slotName + (children ? ("," + children) : '');
  32258. var attrs = el.attrs && ("{" + (el.attrs.map(function (a) { return ((camelize(a.name)) + ":" + (a.value)); }).join(',')) + "}");
  32259. var bind$$1 = el.attrsMap['v-bind'];
  32260. if ((attrs || bind$$1) && !children) {
  32261. res += ",null";
  32262. }
  32263. if (attrs) {
  32264. res += "," + attrs;
  32265. }
  32266. if (bind$$1) {
  32267. res += (attrs ? '' : ',null') + "," + bind$$1;
  32268. }
  32269. return res + ')'
  32270. }
  32271. // componentName is el.component, take it as argument to shun flow's pessimistic refinement
  32272. function genComponent (componentName, el) {
  32273. var children = el.inlineTemplate ? null : genChildren(el, true);
  32274. return ("_c(" + componentName + "," + (genData(el)) + (children ? ("," + children) : '') + ")")
  32275. }
  32276. function genProps (props) {
  32277. var res = '';
  32278. for (var i = 0; i < props.length; i++) {
  32279. var prop = props[i];
  32280. res += "\"" + (prop.name) + "\":" + (transformSpecialNewlines(prop.value)) + ",";
  32281. }
  32282. return res.slice(0, -1)
  32283. }
  32284. // #3895, #4268
  32285. function transformSpecialNewlines (text) {
  32286. return text
  32287. .replace(/\u2028/g, '\\u2028')
  32288. .replace(/\u2029/g, '\\u2029')
  32289. }
  32290. /* */
  32291. /**
  32292. * Compile a template.
  32293. */
  32294. function compile$1 (
  32295. template,
  32296. options
  32297. ) {
  32298. var ast = parse(template.trim(), options);
  32299. optimize(ast, options);
  32300. var code = generate(ast, options);
  32301. return {
  32302. ast: ast,
  32303. render: code.render,
  32304. staticRenderFns: code.staticRenderFns
  32305. }
  32306. }
  32307. /* */
  32308. // operators like typeof, instanceof and in are allowed
  32309. var prohibitedKeywordRE = new RegExp('\\b' + (
  32310. 'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
  32311. 'super,throw,while,yield,delete,export,import,return,switch,default,' +
  32312. 'extends,finally,continue,debugger,function,arguments'
  32313. ).split(',').join('\\b|\\b') + '\\b');
  32314. // check valid identifier for v-for
  32315. var identRE = /[A-Za-z_$][\w$]*/;
  32316. // strip strings in expressions
  32317. var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
  32318. // detect problematic expressions in a template
  32319. function detectErrors (ast) {
  32320. var errors = [];
  32321. if (ast) {
  32322. checkNode(ast, errors);
  32323. }
  32324. return errors
  32325. }
  32326. function checkNode (node, errors) {
  32327. if (node.type === 1) {
  32328. for (var name in node.attrsMap) {
  32329. if (dirRE.test(name)) {
  32330. var value = node.attrsMap[name];
  32331. if (value) {
  32332. if (name === 'v-for') {
  32333. checkFor(node, ("v-for=\"" + value + "\""), errors);
  32334. } else {
  32335. checkExpression(value, (name + "=\"" + value + "\""), errors);
  32336. }
  32337. }
  32338. }
  32339. }
  32340. if (node.children) {
  32341. for (var i = 0; i < node.children.length; i++) {
  32342. checkNode(node.children[i], errors);
  32343. }
  32344. }
  32345. } else if (node.type === 2) {
  32346. checkExpression(node.expression, node.text, errors);
  32347. }
  32348. }
  32349. function checkFor (node, text, errors) {
  32350. checkExpression(node.for || '', text, errors);
  32351. checkIdentifier(node.alias, 'v-for alias', text, errors);
  32352. checkIdentifier(node.iterator1, 'v-for iterator', text, errors);
  32353. checkIdentifier(node.iterator2, 'v-for iterator', text, errors);
  32354. }
  32355. function checkIdentifier (ident, type, text, errors) {
  32356. if (typeof ident === 'string' && !identRE.test(ident)) {
  32357. errors.push(("- invalid " + type + " \"" + ident + "\" in expression: " + text));
  32358. }
  32359. }
  32360. function checkExpression (exp, text, errors) {
  32361. try {
  32362. new Function(("return " + exp));
  32363. } catch (e) {
  32364. var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);
  32365. if (keywordMatch) {
  32366. errors.push(
  32367. "- avoid using JavaScript keyword as property name: " +
  32368. "\"" + (keywordMatch[0]) + "\" in expression " + text
  32369. );
  32370. } else {
  32371. errors.push(("- invalid expression: " + text));
  32372. }
  32373. }
  32374. }
  32375. /* */
  32376. function transformNode (el, options) {
  32377. var warn = options.warn || baseWarn;
  32378. var staticClass = getAndRemoveAttr(el, 'class');
  32379. if (process.env.NODE_ENV !== 'production' && staticClass) {
  32380. var expression = parseText(staticClass, options.delimiters);
  32381. if (expression) {
  32382. warn(
  32383. "class=\"" + staticClass + "\": " +
  32384. 'Interpolation inside attributes has been removed. ' +
  32385. 'Use v-bind or the colon shorthand instead. For example, ' +
  32386. 'instead of <div class="{{ val }}">, use <div :class="val">.'
  32387. );
  32388. }
  32389. }
  32390. if (staticClass) {
  32391. el.staticClass = JSON.stringify(staticClass);
  32392. }
  32393. var classBinding = getBindingAttr(el, 'class', false /* getStatic */);
  32394. if (classBinding) {
  32395. el.classBinding = classBinding;
  32396. }
  32397. }
  32398. function genData$1 (el) {
  32399. var data = '';
  32400. if (el.staticClass) {
  32401. data += "staticClass:" + (el.staticClass) + ",";
  32402. }
  32403. if (el.classBinding) {
  32404. data += "class:" + (el.classBinding) + ",";
  32405. }
  32406. return data
  32407. }
  32408. var klass$1 = {
  32409. staticKeys: ['staticClass'],
  32410. transformNode: transformNode,
  32411. genData: genData$1
  32412. };
  32413. /* */
  32414. function transformNode$1 (el, options) {
  32415. var warn = options.warn || baseWarn;
  32416. var staticStyle = getAndRemoveAttr(el, 'style');
  32417. if (staticStyle) {
  32418. /* istanbul ignore if */
  32419. if (process.env.NODE_ENV !== 'production') {
  32420. var expression = parseText(staticStyle, options.delimiters);
  32421. if (expression) {
  32422. warn(
  32423. "style=\"" + staticStyle + "\": " +
  32424. 'Interpolation inside attributes has been removed. ' +
  32425. 'Use v-bind or the colon shorthand instead. For example, ' +
  32426. 'instead of <div style="{{ val }}">, use <div :style="val">.'
  32427. );
  32428. }
  32429. }
  32430. el.staticStyle = JSON.stringify(parseStyleText(staticStyle));
  32431. }
  32432. var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);
  32433. if (styleBinding) {
  32434. el.styleBinding = styleBinding;
  32435. }
  32436. }
  32437. function genData$2 (el) {
  32438. var data = '';
  32439. if (el.staticStyle) {
  32440. data += "staticStyle:" + (el.staticStyle) + ",";
  32441. }
  32442. if (el.styleBinding) {
  32443. data += "style:(" + (el.styleBinding) + "),";
  32444. }
  32445. return data
  32446. }
  32447. var style$1 = {
  32448. staticKeys: ['staticStyle'],
  32449. transformNode: transformNode$1,
  32450. genData: genData$2
  32451. };
  32452. var modules$1 = [
  32453. klass$1,
  32454. style$1
  32455. ];
  32456. /* */
  32457. var warn$3;
  32458. function model$1 (
  32459. el,
  32460. dir,
  32461. _warn
  32462. ) {
  32463. warn$3 = _warn;
  32464. var value = dir.value;
  32465. var modifiers = dir.modifiers;
  32466. var tag = el.tag;
  32467. var type = el.attrsMap.type;
  32468. if (process.env.NODE_ENV !== 'production') {
  32469. var dynamicType = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];
  32470. if (tag === 'input' && dynamicType) {
  32471. warn$3(
  32472. "<input :type=\"" + dynamicType + "\" v-model=\"" + value + "\">:\n" +
  32473. "v-model does not support dynamic input types. Use v-if branches instead."
  32474. );
  32475. }
  32476. }
  32477. if (tag === 'select') {
  32478. genSelect(el, value, modifiers);
  32479. } else if (tag === 'input' && type === 'checkbox') {
  32480. genCheckboxModel(el, value, modifiers);
  32481. } else if (tag === 'input' && type === 'radio') {
  32482. genRadioModel(el, value, modifiers);
  32483. } else {
  32484. genDefaultModel(el, value, modifiers);
  32485. }
  32486. // ensure runtime directive metadata
  32487. return true
  32488. }
  32489. function genCheckboxModel (
  32490. el,
  32491. value,
  32492. modifiers
  32493. ) {
  32494. if (process.env.NODE_ENV !== 'production' &&
  32495. el.attrsMap.checked != null) {
  32496. warn$3(
  32497. "<" + (el.tag) + " v-model=\"" + value + "\" checked>:\n" +
  32498. "inline checked attributes will be ignored when using v-model. " +
  32499. 'Declare initial values in the component\'s data option instead.'
  32500. );
  32501. }
  32502. var number = modifiers && modifiers.number;
  32503. var valueBinding = getBindingAttr(el, 'value') || 'null';
  32504. var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';
  32505. var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';
  32506. addProp(el, 'checked',
  32507. "Array.isArray(" + value + ")" +
  32508. "?_i(" + value + "," + valueBinding + ")>-1" + (
  32509. trueValueBinding === 'true'
  32510. ? (":(" + value + ")")
  32511. : (":_q(" + value + "," + trueValueBinding + ")")
  32512. )
  32513. );
  32514. addHandler(el, 'click',
  32515. "var $$a=" + value + "," +
  32516. '$$el=$event.target,' +
  32517. "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" +
  32518. 'if(Array.isArray($$a)){' +
  32519. "var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," +
  32520. '$$i=_i($$a,$$v);' +
  32521. "if($$c){$$i<0&&(" + value + "=$$a.concat($$v))}" +
  32522. "else{$$i>-1&&(" + value + "=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}" +
  32523. "}else{" + value + "=$$c}",
  32524. null, true
  32525. );
  32526. }
  32527. function genRadioModel (
  32528. el,
  32529. value,
  32530. modifiers
  32531. ) {
  32532. if (process.env.NODE_ENV !== 'production' &&
  32533. el.attrsMap.checked != null) {
  32534. warn$3(
  32535. "<" + (el.tag) + " v-model=\"" + value + "\" checked>:\n" +
  32536. "inline checked attributes will be ignored when using v-model. " +
  32537. 'Declare initial values in the component\'s data option instead.'
  32538. );
  32539. }
  32540. var number = modifiers && modifiers.number;
  32541. var valueBinding = getBindingAttr(el, 'value') || 'null';
  32542. valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding;
  32543. addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")"));
  32544. addHandler(el, 'click', genAssignmentCode(value, valueBinding), null, true);
  32545. }
  32546. function genDefaultModel (
  32547. el,
  32548. value,
  32549. modifiers
  32550. ) {
  32551. if (process.env.NODE_ENV !== 'production') {
  32552. if (el.tag === 'input' && el.attrsMap.value) {
  32553. warn$3(
  32554. "<" + (el.tag) + " v-model=\"" + value + "\" value=\"" + (el.attrsMap.value) + "\">:\n" +
  32555. 'inline value attributes will be ignored when using v-model. ' +
  32556. 'Declare initial values in the component\'s data option instead.'
  32557. );
  32558. }
  32559. if (el.tag === 'textarea' && el.children.length) {
  32560. warn$3(
  32561. "<textarea v-model=\"" + value + "\">:\n" +
  32562. 'inline content inside <textarea> will be ignored when using v-model. ' +
  32563. 'Declare initial values in the component\'s data option instead.'
  32564. );
  32565. }
  32566. }
  32567. var type = el.attrsMap.type;
  32568. var ref = modifiers || {};
  32569. var lazy = ref.lazy;
  32570. var number = ref.number;
  32571. var trim = ref.trim;
  32572. var event = lazy || (isIE && type === 'range') ? 'change' : 'input';
  32573. var needCompositionGuard = !lazy && type !== 'range';
  32574. var isNative = el.tag === 'input' || el.tag === 'textarea';
  32575. var valueExpression = isNative
  32576. ? ("$event.target.value" + (trim ? '.trim()' : ''))
  32577. : trim ? "(typeof $event === 'string' ? $event.trim() : $event)" : "$event";
  32578. valueExpression = number || type === 'number'
  32579. ? ("_n(" + valueExpression + ")")
  32580. : valueExpression;
  32581. var code = genAssignmentCode(value, valueExpression);
  32582. if (isNative && needCompositionGuard) {
  32583. code = "if($event.target.composing)return;" + code;
  32584. }
  32585. // inputs with type="file" are read only and setting the input's
  32586. // value will throw an error.
  32587. if (process.env.NODE_ENV !== 'production' &&
  32588. type === 'file') {
  32589. warn$3(
  32590. "<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" +
  32591. "File inputs are read only. Use a v-on:change listener instead."
  32592. );
  32593. }
  32594. addProp(el, 'value', isNative ? ("_s(" + value + ")") : ("(" + value + ")"));
  32595. addHandler(el, event, code, null, true);
  32596. if (trim || number || type === 'number') {
  32597. addHandler(el, 'blur', '$forceUpdate()');
  32598. }
  32599. }
  32600. function genSelect (
  32601. el,
  32602. value,
  32603. modifiers
  32604. ) {
  32605. if (process.env.NODE_ENV !== 'production') {
  32606. el.children.some(checkOptionWarning);
  32607. }
  32608. var number = modifiers && modifiers.number;
  32609. var assignment = "Array.prototype.filter" +
  32610. ".call($event.target.options,function(o){return o.selected})" +
  32611. ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" +
  32612. "return " + (number ? '_n(val)' : 'val') + "})" +
  32613. (el.attrsMap.multiple == null ? '[0]' : '');
  32614. var code = genAssignmentCode(value, assignment);
  32615. addHandler(el, 'change', code, null, true);
  32616. }
  32617. function checkOptionWarning (option) {
  32618. if (option.type === 1 &&
  32619. option.tag === 'option' &&
  32620. option.attrsMap.selected != null) {
  32621. warn$3(
  32622. "<select v-model=\"" + (option.parent.attrsMap['v-model']) + "\">:\n" +
  32623. 'inline selected attributes on <option> will be ignored when using v-model. ' +
  32624. 'Declare initial values in the component\'s data option instead.'
  32625. );
  32626. return true
  32627. }
  32628. return false
  32629. }
  32630. function genAssignmentCode (value, assignment) {
  32631. var modelRs = parseModel(value);
  32632. if (modelRs.idx === null) {
  32633. return (value + "=" + assignment)
  32634. } else {
  32635. return "var $$exp = " + (modelRs.exp) + ", $$idx = " + (modelRs.idx) + ";" +
  32636. "if (!Array.isArray($$exp)){" +
  32637. value + "=" + assignment + "}" +
  32638. "else{$$exp.splice($$idx, 1, " + assignment + ")}"
  32639. }
  32640. }
  32641. /* */
  32642. function text (el, dir) {
  32643. if (dir.value) {
  32644. addProp(el, 'textContent', ("_s(" + (dir.value) + ")"));
  32645. }
  32646. }
  32647. /* */
  32648. function html (el, dir) {
  32649. if (dir.value) {
  32650. addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")"));
  32651. }
  32652. }
  32653. var directives$1 = {
  32654. model: model$1,
  32655. text: text,
  32656. html: html
  32657. };
  32658. /* */
  32659. var cache = Object.create(null);
  32660. var baseOptions = {
  32661. expectHTML: true,
  32662. modules: modules$1,
  32663. staticKeys: genStaticKeys(modules$1),
  32664. directives: directives$1,
  32665. isReservedTag: isReservedTag,
  32666. isUnaryTag: isUnaryTag,
  32667. mustUseProp: mustUseProp,
  32668. getTagNamespace: getTagNamespace,
  32669. isPreTag: isPreTag
  32670. };
  32671. function compile$$1 (
  32672. template,
  32673. options
  32674. ) {
  32675. options = options
  32676. ? extend(extend({}, baseOptions), options)
  32677. : baseOptions;
  32678. return compile$1(template, options)
  32679. }
  32680. function compileToFunctions (
  32681. template,
  32682. options,
  32683. vm
  32684. ) {
  32685. var _warn = (options && options.warn) || warn;
  32686. // detect possible CSP restriction
  32687. /* istanbul ignore if */
  32688. if (process.env.NODE_ENV !== 'production') {
  32689. try {
  32690. new Function('return 1');
  32691. } catch (e) {
  32692. if (e.toString().match(/unsafe-eval|CSP/)) {
  32693. _warn(
  32694. 'It seems you are using the standalone build of Vue.js in an ' +
  32695. 'environment with Content Security Policy that prohibits unsafe-eval. ' +
  32696. 'The template compiler cannot work in this environment. Consider ' +
  32697. 'relaxing the policy to allow unsafe-eval or pre-compiling your ' +
  32698. 'templates into render functions.'
  32699. );
  32700. }
  32701. }
  32702. }
  32703. var key = options && options.delimiters
  32704. ? String(options.delimiters) + template
  32705. : template;
  32706. if (cache[key]) {
  32707. return cache[key]
  32708. }
  32709. var res = {};
  32710. var compiled = compile$$1(template, options);
  32711. res.render = makeFunction(compiled.render);
  32712. var l = compiled.staticRenderFns.length;
  32713. res.staticRenderFns = new Array(l);
  32714. for (var i = 0; i < l; i++) {
  32715. res.staticRenderFns[i] = makeFunction(compiled.staticRenderFns[i]);
  32716. }
  32717. if (process.env.NODE_ENV !== 'production') {
  32718. if (res.render === noop || res.staticRenderFns.some(function (fn) { return fn === noop; })) {
  32719. _warn(
  32720. "failed to compile template:\n\n" + template + "\n\n" +
  32721. detectErrors(compiled.ast).join('\n') +
  32722. '\n\n',
  32723. vm
  32724. );
  32725. }
  32726. }
  32727. return (cache[key] = res)
  32728. }
  32729. function makeFunction (code) {
  32730. try {
  32731. return new Function(code)
  32732. } catch (e) {
  32733. return noop
  32734. }
  32735. }
  32736. /* */
  32737. var idToTemplate = cached(function (id) {
  32738. var el = query(id);
  32739. return el && el.innerHTML
  32740. });
  32741. var mount = Vue$3.prototype.$mount;
  32742. Vue$3.prototype.$mount = function (
  32743. el,
  32744. hydrating
  32745. ) {
  32746. el = el && query(el);
  32747. /* istanbul ignore if */
  32748. if (el === document.body || el === document.documentElement) {
  32749. process.env.NODE_ENV !== 'production' && warn(
  32750. "Do not mount Vue to <html> or <body> - mount to normal elements instead."
  32751. );
  32752. return this
  32753. }
  32754. var options = this.$options;
  32755. // resolve template/el and convert to render function
  32756. if (!options.render) {
  32757. var template = options.template;
  32758. if (template) {
  32759. if (typeof template === 'string') {
  32760. if (template.charAt(0) === '#') {
  32761. template = idToTemplate(template);
  32762. /* istanbul ignore if */
  32763. if (process.env.NODE_ENV !== 'production' && !template) {
  32764. warn(
  32765. ("Template element not found or is empty: " + (options.template)),
  32766. this
  32767. );
  32768. }
  32769. }
  32770. } else if (template.nodeType) {
  32771. template = template.innerHTML;
  32772. } else {
  32773. if (process.env.NODE_ENV !== 'production') {
  32774. warn('invalid template option:' + template, this);
  32775. }
  32776. return this
  32777. }
  32778. } else if (el) {
  32779. template = getOuterHTML(el);
  32780. }
  32781. if (template) {
  32782. var ref = compileToFunctions(template, {
  32783. warn: warn,
  32784. shouldDecodeNewlines: shouldDecodeNewlines,
  32785. delimiters: options.delimiters
  32786. }, this);
  32787. var render = ref.render;
  32788. var staticRenderFns = ref.staticRenderFns;
  32789. options.render = render;
  32790. options.staticRenderFns = staticRenderFns;
  32791. }
  32792. }
  32793. return mount.call(this, el, hydrating)
  32794. };
  32795. /**
  32796. * Get outerHTML of elements, taking care
  32797. * of SVG elements in IE as well.
  32798. */
  32799. function getOuterHTML (el) {
  32800. if (el.outerHTML) {
  32801. return el.outerHTML
  32802. } else {
  32803. var container = document.createElement('div');
  32804. container.appendChild(el.cloneNode(true));
  32805. return container.innerHTML
  32806. }
  32807. }
  32808. Vue$3.compile = compileToFunctions;
  32809. module.exports = Vue$3;
  32810. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(112), __webpack_require__(185)))
  32811. /***/ }),
  32812. /* 122 */
  32813. /***/ (function(module, exports, __webpack_require__) {
  32814. /**
  32815. * @namespace Chart
  32816. */
  32817. var Chart = __webpack_require__(143)();
  32818. __webpack_require__(141)(Chart);
  32819. __webpack_require__(157)(Chart);
  32820. __webpack_require__(137)(Chart);
  32821. __webpack_require__(146)(Chart);
  32822. __webpack_require__(140)(Chart);
  32823. __webpack_require__(136)(Chart);
  32824. __webpack_require__(138)(Chart);
  32825. __webpack_require__(139)(Chart);
  32826. __webpack_require__(144)(Chart);
  32827. __webpack_require__(148)(Chart);
  32828. __webpack_require__(149)(Chart);
  32829. __webpack_require__(147)(Chart);
  32830. __webpack_require__(150)(Chart);
  32831. __webpack_require__(145)(Chart);
  32832. __webpack_require__(142)(Chart);
  32833. __webpack_require__(151)(Chart);
  32834. __webpack_require__(152)(Chart);
  32835. __webpack_require__(153)(Chart);
  32836. __webpack_require__(154)(Chart);
  32837. __webpack_require__(155)(Chart);
  32838. __webpack_require__(160)(Chart);
  32839. __webpack_require__(158)(Chart);
  32840. __webpack_require__(159)(Chart);
  32841. __webpack_require__(161)(Chart);
  32842. __webpack_require__(162)(Chart);
  32843. __webpack_require__(163)(Chart);
  32844. // Controllers must be loaded after elements
  32845. // See Chart.core.datasetController.dataElementType
  32846. __webpack_require__(130)(Chart);
  32847. __webpack_require__(131)(Chart);
  32848. __webpack_require__(132)(Chart);
  32849. __webpack_require__(133)(Chart);
  32850. __webpack_require__(134)(Chart);
  32851. __webpack_require__(135)(Chart);
  32852. __webpack_require__(123)(Chart);
  32853. __webpack_require__(124)(Chart);
  32854. __webpack_require__(125)(Chart);
  32855. __webpack_require__(126)(Chart);
  32856. __webpack_require__(127)(Chart);
  32857. __webpack_require__(128)(Chart);
  32858. __webpack_require__(129)(Chart);
  32859. window.Chart = module.exports = Chart;
  32860. /***/ }),
  32861. /* 123 */
  32862. /***/ (function(module, exports, __webpack_require__) {
  32863. "use strict";
  32864. module.exports = function(Chart) {
  32865. Chart.Bar = function(context, config) {
  32866. config.type = 'bar';
  32867. return new Chart(context, config);
  32868. };
  32869. };
  32870. /***/ }),
  32871. /* 124 */
  32872. /***/ (function(module, exports, __webpack_require__) {
  32873. "use strict";
  32874. module.exports = function(Chart) {
  32875. Chart.Bubble = function(context, config) {
  32876. config.type = 'bubble';
  32877. return new Chart(context, config);
  32878. };
  32879. };
  32880. /***/ }),
  32881. /* 125 */
  32882. /***/ (function(module, exports, __webpack_require__) {
  32883. "use strict";
  32884. module.exports = function(Chart) {
  32885. Chart.Doughnut = function(context, config) {
  32886. config.type = 'doughnut';
  32887. return new Chart(context, config);
  32888. };
  32889. };
  32890. /***/ }),
  32891. /* 126 */
  32892. /***/ (function(module, exports, __webpack_require__) {
  32893. "use strict";
  32894. module.exports = function(Chart) {
  32895. Chart.Line = function(context, config) {
  32896. config.type = 'line';
  32897. return new Chart(context, config);
  32898. };
  32899. };
  32900. /***/ }),
  32901. /* 127 */
  32902. /***/ (function(module, exports, __webpack_require__) {
  32903. "use strict";
  32904. module.exports = function(Chart) {
  32905. Chart.PolarArea = function(context, config) {
  32906. config.type = 'polarArea';
  32907. return new Chart(context, config);
  32908. };
  32909. };
  32910. /***/ }),
  32911. /* 128 */
  32912. /***/ (function(module, exports, __webpack_require__) {
  32913. "use strict";
  32914. module.exports = function(Chart) {
  32915. Chart.Radar = function(context, config) {
  32916. config.type = 'radar';
  32917. return new Chart(context, config);
  32918. };
  32919. };
  32920. /***/ }),
  32921. /* 129 */
  32922. /***/ (function(module, exports, __webpack_require__) {
  32923. "use strict";
  32924. module.exports = function(Chart) {
  32925. var defaultConfig = {
  32926. hover: {
  32927. mode: 'single'
  32928. },
  32929. scales: {
  32930. xAxes: [{
  32931. type: 'linear', // scatter should not use a category axis
  32932. position: 'bottom',
  32933. id: 'x-axis-1' // need an ID so datasets can reference the scale
  32934. }],
  32935. yAxes: [{
  32936. type: 'linear',
  32937. position: 'left',
  32938. id: 'y-axis-1'
  32939. }]
  32940. },
  32941. tooltips: {
  32942. callbacks: {
  32943. title: function() {
  32944. // Title doesn't make sense for scatter since we format the data as a point
  32945. return '';
  32946. },
  32947. label: function(tooltipItem) {
  32948. return '(' + tooltipItem.xLabel + ', ' + tooltipItem.yLabel + ')';
  32949. }
  32950. }
  32951. }
  32952. };
  32953. // Register the default config for this type
  32954. Chart.defaults.scatter = defaultConfig;
  32955. // Scatter charts use line controllers
  32956. Chart.controllers.scatter = Chart.controllers.line;
  32957. Chart.Scatter = function(context, config) {
  32958. config.type = 'scatter';
  32959. return new Chart(context, config);
  32960. };
  32961. };
  32962. /***/ }),
  32963. /* 130 */
  32964. /***/ (function(module, exports, __webpack_require__) {
  32965. "use strict";
  32966. module.exports = function(Chart) {
  32967. var helpers = Chart.helpers;
  32968. Chart.defaults.bar = {
  32969. hover: {
  32970. mode: 'label'
  32971. },
  32972. scales: {
  32973. xAxes: [{
  32974. type: 'category',
  32975. // Specific to Bar Controller
  32976. categoryPercentage: 0.8,
  32977. barPercentage: 0.9,
  32978. // grid line settings
  32979. gridLines: {
  32980. offsetGridLines: true
  32981. }
  32982. }],
  32983. yAxes: [{
  32984. type: 'linear'
  32985. }]
  32986. }
  32987. };
  32988. Chart.controllers.bar = Chart.DatasetController.extend({
  32989. dataElementType: Chart.elements.Rectangle,
  32990. initialize: function(chart, datasetIndex) {
  32991. Chart.DatasetController.prototype.initialize.call(this, chart, datasetIndex);
  32992. var me = this;
  32993. var meta = me.getMeta();
  32994. var dataset = me.getDataset();
  32995. meta.stack = dataset.stack;
  32996. // Use this to indicate that this is a bar dataset.
  32997. meta.bar = true;
  32998. },
  32999. // Correctly calculate the bar width accounting for stacks and the fact that not all bars are visible
  33000. getStackCount: function() {
  33001. var me = this;
  33002. var meta = me.getMeta();
  33003. var yScale = me.getScaleForId(meta.yAxisID);
  33004. var stacks = [];
  33005. helpers.each(me.chart.data.datasets, function(dataset, datasetIndex) {
  33006. var dsMeta = me.chart.getDatasetMeta(datasetIndex);
  33007. if (dsMeta.bar && me.chart.isDatasetVisible(datasetIndex) &&
  33008. (yScale.options.stacked === false ||
  33009. (yScale.options.stacked === true && stacks.indexOf(dsMeta.stack) === -1) ||
  33010. (yScale.options.stacked === undefined && (dsMeta.stack === undefined || stacks.indexOf(dsMeta.stack) === -1)))) {
  33011. stacks.push(dsMeta.stack);
  33012. }
  33013. }, me);
  33014. return stacks.length;
  33015. },
  33016. update: function(reset) {
  33017. var me = this;
  33018. helpers.each(me.getMeta().data, function(rectangle, index) {
  33019. me.updateElement(rectangle, index, reset);
  33020. }, me);
  33021. },
  33022. updateElement: function(rectangle, index, reset) {
  33023. var me = this;
  33024. var meta = me.getMeta();
  33025. var xScale = me.getScaleForId(meta.xAxisID);
  33026. var yScale = me.getScaleForId(meta.yAxisID);
  33027. var scaleBase = yScale.getBasePixel();
  33028. var rectangleElementOptions = me.chart.options.elements.rectangle;
  33029. var custom = rectangle.custom || {};
  33030. var dataset = me.getDataset();
  33031. rectangle._xScale = xScale;
  33032. rectangle._yScale = yScale;
  33033. rectangle._datasetIndex = me.index;
  33034. rectangle._index = index;
  33035. var ruler = me.getRuler(index); // The index argument for compatible
  33036. rectangle._model = {
  33037. x: me.calculateBarX(index, me.index, ruler),
  33038. y: reset ? scaleBase : me.calculateBarY(index, me.index),
  33039. // Tooltip
  33040. label: me.chart.data.labels[index],
  33041. datasetLabel: dataset.label,
  33042. // Appearance
  33043. horizontal: false,
  33044. base: reset ? scaleBase : me.calculateBarBase(me.index, index),
  33045. width: me.calculateBarWidth(ruler),
  33046. backgroundColor: custom.backgroundColor ? custom.backgroundColor : helpers.getValueAtIndexOrDefault(dataset.backgroundColor, index, rectangleElementOptions.backgroundColor),
  33047. borderSkipped: custom.borderSkipped ? custom.borderSkipped : rectangleElementOptions.borderSkipped,
  33048. borderColor: custom.borderColor ? custom.borderColor : helpers.getValueAtIndexOrDefault(dataset.borderColor, index, rectangleElementOptions.borderColor),
  33049. borderWidth: custom.borderWidth ? custom.borderWidth : helpers.getValueAtIndexOrDefault(dataset.borderWidth, index, rectangleElementOptions.borderWidth)
  33050. };
  33051. rectangle.pivot();
  33052. },
  33053. calculateBarBase: function(datasetIndex, index) {
  33054. var me = this;
  33055. var meta = me.getMeta();
  33056. var yScale = me.getScaleForId(meta.yAxisID);
  33057. var base = yScale.getBaseValue();
  33058. var original = base;
  33059. if ((yScale.options.stacked === true) ||
  33060. (yScale.options.stacked === undefined && meta.stack !== undefined)) {
  33061. var chart = me.chart;
  33062. var datasets = chart.data.datasets;
  33063. var value = Number(datasets[datasetIndex].data[index]);
  33064. for (var i = 0; i < datasetIndex; i++) {
  33065. var currentDs = datasets[i];
  33066. var currentDsMeta = chart.getDatasetMeta(i);
  33067. if (currentDsMeta.bar && currentDsMeta.yAxisID === yScale.id && chart.isDatasetVisible(i) &&
  33068. meta.stack === currentDsMeta.stack) {
  33069. var currentVal = Number(currentDs.data[index]);
  33070. base += value < 0 ? Math.min(currentVal, original) : Math.max(currentVal, original);
  33071. }
  33072. }
  33073. return yScale.getPixelForValue(base);
  33074. }
  33075. return yScale.getBasePixel();
  33076. },
  33077. getRuler: function() {
  33078. var me = this;
  33079. var meta = me.getMeta();
  33080. var xScale = me.getScaleForId(meta.xAxisID);
  33081. var stackCount = me.getStackCount();
  33082. var tickWidth = xScale.width / xScale.ticks.length;
  33083. var categoryWidth = tickWidth * xScale.options.categoryPercentage;
  33084. var categorySpacing = (tickWidth - (tickWidth * xScale.options.categoryPercentage)) / 2;
  33085. var fullBarWidth = categoryWidth / stackCount;
  33086. var barWidth = fullBarWidth * xScale.options.barPercentage;
  33087. var barSpacing = fullBarWidth - (fullBarWidth * xScale.options.barPercentage);
  33088. return {
  33089. stackCount: stackCount,
  33090. tickWidth: tickWidth,
  33091. categoryWidth: categoryWidth,
  33092. categorySpacing: categorySpacing,
  33093. fullBarWidth: fullBarWidth,
  33094. barWidth: barWidth,
  33095. barSpacing: barSpacing
  33096. };
  33097. },
  33098. calculateBarWidth: function(ruler) {
  33099. var me = this;
  33100. var meta = me.getMeta();
  33101. var xScale = me.getScaleForId(meta.xAxisID);
  33102. if (xScale.options.barThickness) {
  33103. return xScale.options.barThickness;
  33104. }
  33105. return ruler.barWidth;
  33106. },
  33107. // Get stack index from the given dataset index accounting for stacks and the fact that not all bars are visible
  33108. getStackIndex: function(datasetIndex) {
  33109. var me = this;
  33110. var meta = me.chart.getDatasetMeta(datasetIndex);
  33111. var yScale = me.getScaleForId(meta.yAxisID);
  33112. var dsMeta, j;
  33113. var stacks = [meta.stack];
  33114. for (j = 0; j < datasetIndex; ++j) {
  33115. dsMeta = this.chart.getDatasetMeta(j);
  33116. if (dsMeta.bar && this.chart.isDatasetVisible(j) &&
  33117. (yScale.options.stacked === false ||
  33118. (yScale.options.stacked === true && stacks.indexOf(dsMeta.stack) === -1) ||
  33119. (yScale.options.stacked === undefined && (dsMeta.stack === undefined || stacks.indexOf(dsMeta.stack) === -1)))) {
  33120. stacks.push(dsMeta.stack);
  33121. }
  33122. }
  33123. return stacks.length - 1;
  33124. },
  33125. calculateBarX: function(index, datasetIndex, ruler) {
  33126. var me = this;
  33127. var meta = me.getMeta();
  33128. var xScale = me.getScaleForId(meta.xAxisID);
  33129. var stackIndex = me.getStackIndex(datasetIndex);
  33130. var leftTick = xScale.getPixelForValue(null, index, datasetIndex, me.chart.isCombo);
  33131. leftTick -= me.chart.isCombo ? (ruler.tickWidth / 2) : 0;
  33132. return leftTick +
  33133. (ruler.barWidth / 2) +
  33134. ruler.categorySpacing +
  33135. (ruler.barWidth * stackIndex) +
  33136. (ruler.barSpacing / 2) +
  33137. (ruler.barSpacing * stackIndex);
  33138. },
  33139. calculateBarY: function(index, datasetIndex) {
  33140. var me = this;
  33141. var meta = me.getMeta();
  33142. var yScale = me.getScaleForId(meta.yAxisID);
  33143. var value = Number(me.getDataset().data[index]);
  33144. if (yScale.options.stacked ||
  33145. (yScale.options.stacked === undefined && meta.stack !== undefined)) {
  33146. var base = yScale.getBaseValue();
  33147. var sumPos = base,
  33148. sumNeg = base;
  33149. for (var i = 0; i < datasetIndex; i++) {
  33150. var ds = me.chart.data.datasets[i];
  33151. var dsMeta = me.chart.getDatasetMeta(i);
  33152. if (dsMeta.bar && dsMeta.yAxisID === yScale.id && me.chart.isDatasetVisible(i) &&
  33153. meta.stack === dsMeta.stack) {
  33154. var stackedVal = Number(ds.data[index]);
  33155. if (stackedVal < 0) {
  33156. sumNeg += stackedVal || 0;
  33157. } else {
  33158. sumPos += stackedVal || 0;
  33159. }
  33160. }
  33161. }
  33162. if (value < 0) {
  33163. return yScale.getPixelForValue(sumNeg + value);
  33164. }
  33165. return yScale.getPixelForValue(sumPos + value);
  33166. }
  33167. return yScale.getPixelForValue(value);
  33168. },
  33169. draw: function(ease) {
  33170. var me = this;
  33171. var easingDecimal = ease || 1;
  33172. var metaData = me.getMeta().data;
  33173. var dataset = me.getDataset();
  33174. var i, len;
  33175. Chart.canvasHelpers.clipArea(me.chart.chart.ctx, me.chart.chartArea);
  33176. for (i = 0, len = metaData.length; i < len; ++i) {
  33177. var d = dataset.data[i];
  33178. if (d !== null && d !== undefined && !isNaN(d)) {
  33179. metaData[i].transition(easingDecimal).draw();
  33180. }
  33181. }
  33182. Chart.canvasHelpers.unclipArea(me.chart.chart.ctx);
  33183. },
  33184. setHoverStyle: function(rectangle) {
  33185. var dataset = this.chart.data.datasets[rectangle._datasetIndex];
  33186. var index = rectangle._index;
  33187. var custom = rectangle.custom || {};
  33188. var model = rectangle._model;
  33189. model.backgroundColor = custom.hoverBackgroundColor ? custom.hoverBackgroundColor : helpers.getValueAtIndexOrDefault(dataset.hoverBackgroundColor, index, helpers.getHoverColor(model.backgroundColor));
  33190. model.borderColor = custom.hoverBorderColor ? custom.hoverBorderColor : helpers.getValueAtIndexOrDefault(dataset.hoverBorderColor, index, helpers.getHoverColor(model.borderColor));
  33191. model.borderWidth = custom.hoverBorderWidth ? custom.hoverBorderWidth : helpers.getValueAtIndexOrDefault(dataset.hoverBorderWidth, index, model.borderWidth);
  33192. },
  33193. removeHoverStyle: function(rectangle) {
  33194. var dataset = this.chart.data.datasets[rectangle._datasetIndex];
  33195. var index = rectangle._index;
  33196. var custom = rectangle.custom || {};
  33197. var model = rectangle._model;
  33198. var rectangleElementOptions = this.chart.options.elements.rectangle;
  33199. model.backgroundColor = custom.backgroundColor ? custom.backgroundColor : helpers.getValueAtIndexOrDefault(dataset.backgroundColor, index, rectangleElementOptions.backgroundColor);
  33200. model.borderColor = custom.borderColor ? custom.borderColor : helpers.getValueAtIndexOrDefault(dataset.borderColor, index, rectangleElementOptions.borderColor);
  33201. model.borderWidth = custom.borderWidth ? custom.borderWidth : helpers.getValueAtIndexOrDefault(dataset.borderWidth, index, rectangleElementOptions.borderWidth);
  33202. }
  33203. });
  33204. // including horizontalBar in the bar file, instead of a file of its own
  33205. // it extends bar (like pie extends doughnut)
  33206. Chart.defaults.horizontalBar = {
  33207. hover: {
  33208. mode: 'label'
  33209. },
  33210. scales: {
  33211. xAxes: [{
  33212. type: 'linear',
  33213. position: 'bottom'
  33214. }],
  33215. yAxes: [{
  33216. position: 'left',
  33217. type: 'category',
  33218. // Specific to Horizontal Bar Controller
  33219. categoryPercentage: 0.8,
  33220. barPercentage: 0.9,
  33221. // grid line settings
  33222. gridLines: {
  33223. offsetGridLines: true
  33224. }
  33225. }]
  33226. },
  33227. elements: {
  33228. rectangle: {
  33229. borderSkipped: 'left'
  33230. }
  33231. },
  33232. tooltips: {
  33233. callbacks: {
  33234. title: function(tooltipItems, data) {
  33235. // Pick first xLabel for now
  33236. var title = '';
  33237. if (tooltipItems.length > 0) {
  33238. if (tooltipItems[0].yLabel) {
  33239. title = tooltipItems[0].yLabel;
  33240. } else if (data.labels.length > 0 && tooltipItems[0].index < data.labels.length) {
  33241. title = data.labels[tooltipItems[0].index];
  33242. }
  33243. }
  33244. return title;
  33245. },
  33246. label: function(tooltipItem, data) {
  33247. var datasetLabel = data.datasets[tooltipItem.datasetIndex].label || '';
  33248. return datasetLabel + ': ' + tooltipItem.xLabel;
  33249. }
  33250. }
  33251. }
  33252. };
  33253. Chart.controllers.horizontalBar = Chart.controllers.bar.extend({
  33254. // Correctly calculate the bar width accounting for stacks and the fact that not all bars are visible
  33255. getStackCount: function() {
  33256. var me = this;
  33257. var meta = me.getMeta();
  33258. var xScale = me.getScaleForId(meta.xAxisID);
  33259. var stacks = [];
  33260. helpers.each(me.chart.data.datasets, function(dataset, datasetIndex) {
  33261. var dsMeta = me.chart.getDatasetMeta(datasetIndex);
  33262. if (dsMeta.bar && me.chart.isDatasetVisible(datasetIndex) &&
  33263. (xScale.options.stacked === false ||
  33264. (xScale.options.stacked === true && stacks.indexOf(dsMeta.stack) === -1) ||
  33265. (xScale.options.stacked === undefined && (dsMeta.stack === undefined || stacks.indexOf(dsMeta.stack) === -1)))) {
  33266. stacks.push(dsMeta.stack);
  33267. }
  33268. }, me);
  33269. return stacks.length;
  33270. },
  33271. updateElement: function(rectangle, index, reset) {
  33272. var me = this;
  33273. var meta = me.getMeta();
  33274. var xScale = me.getScaleForId(meta.xAxisID);
  33275. var yScale = me.getScaleForId(meta.yAxisID);
  33276. var scaleBase = xScale.getBasePixel();
  33277. var custom = rectangle.custom || {};
  33278. var dataset = me.getDataset();
  33279. var rectangleElementOptions = me.chart.options.elements.rectangle;
  33280. rectangle._xScale = xScale;
  33281. rectangle._yScale = yScale;
  33282. rectangle._datasetIndex = me.index;
  33283. rectangle._index = index;
  33284. var ruler = me.getRuler(index); // The index argument for compatible
  33285. rectangle._model = {
  33286. x: reset ? scaleBase : me.calculateBarX(index, me.index),
  33287. y: me.calculateBarY(index, me.index, ruler),
  33288. // Tooltip
  33289. label: me.chart.data.labels[index],
  33290. datasetLabel: dataset.label,
  33291. // Appearance
  33292. horizontal: true,
  33293. base: reset ? scaleBase : me.calculateBarBase(me.index, index),
  33294. height: me.calculateBarHeight(ruler),
  33295. backgroundColor: custom.backgroundColor ? custom.backgroundColor : helpers.getValueAtIndexOrDefault(dataset.backgroundColor, index, rectangleElementOptions.backgroundColor),
  33296. borderSkipped: custom.borderSkipped ? custom.borderSkipped : rectangleElementOptions.borderSkipped,
  33297. borderColor: custom.borderColor ? custom.borderColor : helpers.getValueAtIndexOrDefault(dataset.borderColor, index, rectangleElementOptions.borderColor),
  33298. borderWidth: custom.borderWidth ? custom.borderWidth : helpers.getValueAtIndexOrDefault(dataset.borderWidth, index, rectangleElementOptions.borderWidth)
  33299. };
  33300. rectangle.pivot();
  33301. },
  33302. calculateBarBase: function(datasetIndex, index) {
  33303. var me = this;
  33304. var meta = me.getMeta();
  33305. var xScale = me.getScaleForId(meta.xAxisID);
  33306. var base = xScale.getBaseValue();
  33307. var originalBase = base;
  33308. if (xScale.options.stacked ||
  33309. (xScale.options.stacked === undefined && meta.stack !== undefined)) {
  33310. var chart = me.chart;
  33311. var datasets = chart.data.datasets;
  33312. var value = Number(datasets[datasetIndex].data[index]);
  33313. for (var i = 0; i < datasetIndex; i++) {
  33314. var currentDs = datasets[i];
  33315. var currentDsMeta = chart.getDatasetMeta(i);
  33316. if (currentDsMeta.bar && currentDsMeta.xAxisID === xScale.id && chart.isDatasetVisible(i) &&
  33317. meta.stack === currentDsMeta.stack) {
  33318. var currentVal = Number(currentDs.data[index]);
  33319. base += value < 0 ? Math.min(currentVal, originalBase) : Math.max(currentVal, originalBase);
  33320. }
  33321. }
  33322. return xScale.getPixelForValue(base);
  33323. }
  33324. return xScale.getBasePixel();
  33325. },
  33326. getRuler: function() {
  33327. var me = this;
  33328. var meta = me.getMeta();
  33329. var yScale = me.getScaleForId(meta.yAxisID);
  33330. var stackCount = me.getStackCount();
  33331. var tickHeight = yScale.height / yScale.ticks.length;
  33332. var categoryHeight = tickHeight * yScale.options.categoryPercentage;
  33333. var categorySpacing = (tickHeight - (tickHeight * yScale.options.categoryPercentage)) / 2;
  33334. var fullBarHeight = categoryHeight / stackCount;
  33335. var barHeight = fullBarHeight * yScale.options.barPercentage;
  33336. var barSpacing = fullBarHeight - (fullBarHeight * yScale.options.barPercentage);
  33337. return {
  33338. stackCount: stackCount,
  33339. tickHeight: tickHeight,
  33340. categoryHeight: categoryHeight,
  33341. categorySpacing: categorySpacing,
  33342. fullBarHeight: fullBarHeight,
  33343. barHeight: barHeight,
  33344. barSpacing: barSpacing
  33345. };
  33346. },
  33347. calculateBarHeight: function(ruler) {
  33348. var me = this;
  33349. var meta = me.getMeta();
  33350. var yScale = me.getScaleForId(meta.yAxisID);
  33351. if (yScale.options.barThickness) {
  33352. return yScale.options.barThickness;
  33353. }
  33354. return ruler.barHeight;
  33355. },
  33356. // Get stack index from the given dataset index accounting for stacks and the fact that not all bars are visible
  33357. getStackIndex: function(datasetIndex) {
  33358. var me = this;
  33359. var meta = me.chart.getDatasetMeta(datasetIndex);
  33360. var xScale = me.getScaleForId(meta.xAxisID);
  33361. var dsMeta, j;
  33362. var stacks = [meta.stack];
  33363. for (j = 0; j < datasetIndex; ++j) {
  33364. dsMeta = this.chart.getDatasetMeta(j);
  33365. if (dsMeta.bar && this.chart.isDatasetVisible(j) &&
  33366. (xScale.options.stacked === false ||
  33367. (xScale.options.stacked === true && stacks.indexOf(dsMeta.stack) === -1) ||
  33368. (xScale.options.stacked === undefined && (dsMeta.stack === undefined || stacks.indexOf(dsMeta.stack) === -1)))) {
  33369. stacks.push(dsMeta.stack);
  33370. }
  33371. }
  33372. return stacks.length - 1;
  33373. },
  33374. calculateBarX: function(index, datasetIndex) {
  33375. var me = this;
  33376. var meta = me.getMeta();
  33377. var xScale = me.getScaleForId(meta.xAxisID);
  33378. var value = Number(me.getDataset().data[index]);
  33379. if (xScale.options.stacked ||
  33380. (xScale.options.stacked === undefined && meta.stack !== undefined)) {
  33381. var base = xScale.getBaseValue();
  33382. var sumPos = base,
  33383. sumNeg = base;
  33384. for (var i = 0; i < datasetIndex; i++) {
  33385. var ds = me.chart.data.datasets[i];
  33386. var dsMeta = me.chart.getDatasetMeta(i);
  33387. if (dsMeta.bar && dsMeta.xAxisID === xScale.id && me.chart.isDatasetVisible(i) &&
  33388. meta.stack === dsMeta.stack) {
  33389. var stackedVal = Number(ds.data[index]);
  33390. if (stackedVal < 0) {
  33391. sumNeg += stackedVal || 0;
  33392. } else {
  33393. sumPos += stackedVal || 0;
  33394. }
  33395. }
  33396. }
  33397. if (value < 0) {
  33398. return xScale.getPixelForValue(sumNeg + value);
  33399. }
  33400. return xScale.getPixelForValue(sumPos + value);
  33401. }
  33402. return xScale.getPixelForValue(value);
  33403. },
  33404. calculateBarY: function(index, datasetIndex, ruler) {
  33405. var me = this;
  33406. var meta = me.getMeta();
  33407. var yScale = me.getScaleForId(meta.yAxisID);
  33408. var stackIndex = me.getStackIndex(datasetIndex);
  33409. var topTick = yScale.getPixelForValue(null, index, datasetIndex, me.chart.isCombo);
  33410. topTick -= me.chart.isCombo ? (ruler.tickHeight / 2) : 0;
  33411. return topTick +
  33412. (ruler.barHeight / 2) +
  33413. ruler.categorySpacing +
  33414. (ruler.barHeight * stackIndex) +
  33415. (ruler.barSpacing / 2) +
  33416. (ruler.barSpacing * stackIndex);
  33417. }
  33418. });
  33419. };
  33420. /***/ }),
  33421. /* 131 */
  33422. /***/ (function(module, exports, __webpack_require__) {
  33423. "use strict";
  33424. module.exports = function(Chart) {
  33425. var helpers = Chart.helpers;
  33426. Chart.defaults.bubble = {
  33427. hover: {
  33428. mode: 'single'
  33429. },
  33430. scales: {
  33431. xAxes: [{
  33432. type: 'linear', // bubble should probably use a linear scale by default
  33433. position: 'bottom',
  33434. id: 'x-axis-0' // need an ID so datasets can reference the scale
  33435. }],
  33436. yAxes: [{
  33437. type: 'linear',
  33438. position: 'left',
  33439. id: 'y-axis-0'
  33440. }]
  33441. },
  33442. tooltips: {
  33443. callbacks: {
  33444. title: function() {
  33445. // Title doesn't make sense for scatter since we format the data as a point
  33446. return '';
  33447. },
  33448. label: function(tooltipItem, data) {
  33449. var datasetLabel = data.datasets[tooltipItem.datasetIndex].label || '';
  33450. var dataPoint = data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];
  33451. return datasetLabel + ': (' + tooltipItem.xLabel + ', ' + tooltipItem.yLabel + ', ' + dataPoint.r + ')';
  33452. }
  33453. }
  33454. }
  33455. };
  33456. Chart.controllers.bubble = Chart.DatasetController.extend({
  33457. dataElementType: Chart.elements.Point,
  33458. update: function(reset) {
  33459. var me = this;
  33460. var meta = me.getMeta();
  33461. var points = meta.data;
  33462. // Update Points
  33463. helpers.each(points, function(point, index) {
  33464. me.updateElement(point, index, reset);
  33465. });
  33466. },
  33467. updateElement: function(point, index, reset) {
  33468. var me = this;
  33469. var meta = me.getMeta();
  33470. var xScale = me.getScaleForId(meta.xAxisID);
  33471. var yScale = me.getScaleForId(meta.yAxisID);
  33472. var custom = point.custom || {};
  33473. var dataset = me.getDataset();
  33474. var data = dataset.data[index];
  33475. var pointElementOptions = me.chart.options.elements.point;
  33476. var dsIndex = me.index;
  33477. helpers.extend(point, {
  33478. // Utility
  33479. _xScale: xScale,
  33480. _yScale: yScale,
  33481. _datasetIndex: dsIndex,
  33482. _index: index,
  33483. // Desired view properties
  33484. _model: {
  33485. x: reset ? xScale.getPixelForDecimal(0.5) : xScale.getPixelForValue(typeof data === 'object' ? data : NaN, index, dsIndex, me.chart.isCombo),
  33486. y: reset ? yScale.getBasePixel() : yScale.getPixelForValue(data, index, dsIndex),
  33487. // Appearance
  33488. radius: reset ? 0 : custom.radius ? custom.radius : me.getRadius(data),
  33489. // Tooltip
  33490. hitRadius: custom.hitRadius ? custom.hitRadius : helpers.getValueAtIndexOrDefault(dataset.hitRadius, index, pointElementOptions.hitRadius)
  33491. }
  33492. });
  33493. // Trick to reset the styles of the point
  33494. Chart.DatasetController.prototype.removeHoverStyle.call(me, point, pointElementOptions);
  33495. var model = point._model;
  33496. model.skip = custom.skip ? custom.skip : (isNaN(model.x) || isNaN(model.y));
  33497. point.pivot();
  33498. },
  33499. getRadius: function(value) {
  33500. return value.r || this.chart.options.elements.point.radius;
  33501. },
  33502. setHoverStyle: function(point) {
  33503. var me = this;
  33504. Chart.DatasetController.prototype.setHoverStyle.call(me, point);
  33505. // Radius
  33506. var dataset = me.chart.data.datasets[point._datasetIndex];
  33507. var index = point._index;
  33508. var custom = point.custom || {};
  33509. var model = point._model;
  33510. model.radius = custom.hoverRadius ? custom.hoverRadius : (helpers.getValueAtIndexOrDefault(dataset.hoverRadius, index, me.chart.options.elements.point.hoverRadius)) + me.getRadius(dataset.data[index]);
  33511. },
  33512. removeHoverStyle: function(point) {
  33513. var me = this;
  33514. Chart.DatasetController.prototype.removeHoverStyle.call(me, point, me.chart.options.elements.point);
  33515. var dataVal = me.chart.data.datasets[point._datasetIndex].data[point._index];
  33516. var custom = point.custom || {};
  33517. var model = point._model;
  33518. model.radius = custom.radius ? custom.radius : me.getRadius(dataVal);
  33519. }
  33520. });
  33521. };
  33522. /***/ }),
  33523. /* 132 */
  33524. /***/ (function(module, exports, __webpack_require__) {
  33525. "use strict";
  33526. module.exports = function(Chart) {
  33527. var helpers = Chart.helpers,
  33528. defaults = Chart.defaults;
  33529. defaults.doughnut = {
  33530. animation: {
  33531. // Boolean - Whether we animate the rotation of the Doughnut
  33532. animateRotate: true,
  33533. // Boolean - Whether we animate scaling the Doughnut from the centre
  33534. animateScale: false
  33535. },
  33536. aspectRatio: 1,
  33537. hover: {
  33538. mode: 'single'
  33539. },
  33540. legendCallback: function(chart) {
  33541. var text = [];
  33542. text.push('<ul class="' + chart.id + '-legend">');
  33543. var data = chart.data;
  33544. var datasets = data.datasets;
  33545. var labels = data.labels;
  33546. if (datasets.length) {
  33547. for (var i = 0; i < datasets[0].data.length; ++i) {
  33548. text.push('<li><span style="background-color:' + datasets[0].backgroundColor[i] + '"></span>');
  33549. if (labels[i]) {
  33550. text.push(labels[i]);
  33551. }
  33552. text.push('</li>');
  33553. }
  33554. }
  33555. text.push('</ul>');
  33556. return text.join('');
  33557. },
  33558. legend: {
  33559. labels: {
  33560. generateLabels: function(chart) {
  33561. var data = chart.data;
  33562. if (data.labels.length && data.datasets.length) {
  33563. return data.labels.map(function(label, i) {
  33564. var meta = chart.getDatasetMeta(0);
  33565. var ds = data.datasets[0];
  33566. var arc = meta.data[i];
  33567. var custom = arc && arc.custom || {};
  33568. var getValueAtIndexOrDefault = helpers.getValueAtIndexOrDefault;
  33569. var arcOpts = chart.options.elements.arc;
  33570. var fill = custom.backgroundColor ? custom.backgroundColor : getValueAtIndexOrDefault(ds.backgroundColor, i, arcOpts.backgroundColor);
  33571. var stroke = custom.borderColor ? custom.borderColor : getValueAtIndexOrDefault(ds.borderColor, i, arcOpts.borderColor);
  33572. var bw = custom.borderWidth ? custom.borderWidth : getValueAtIndexOrDefault(ds.borderWidth, i, arcOpts.borderWidth);
  33573. return {
  33574. text: label,
  33575. fillStyle: fill,
  33576. strokeStyle: stroke,
  33577. lineWidth: bw,
  33578. hidden: isNaN(ds.data[i]) || meta.data[i].hidden,
  33579. // Extra data used for toggling the correct item
  33580. index: i
  33581. };
  33582. });
  33583. }
  33584. return [];
  33585. }
  33586. },
  33587. onClick: function(e, legendItem) {
  33588. var index = legendItem.index;
  33589. var chart = this.chart;
  33590. var i, ilen, meta;
  33591. for (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {
  33592. meta = chart.getDatasetMeta(i);
  33593. // toggle visibility of index if exists
  33594. if (meta.data[index]) {
  33595. meta.data[index].hidden = !meta.data[index].hidden;
  33596. }
  33597. }
  33598. chart.update();
  33599. }
  33600. },
  33601. // The percentage of the chart that we cut out of the middle.
  33602. cutoutPercentage: 50,
  33603. // The rotation of the chart, where the first data arc begins.
  33604. rotation: Math.PI * -0.5,
  33605. // The total circumference of the chart.
  33606. circumference: Math.PI * 2.0,
  33607. // Need to override these to give a nice default
  33608. tooltips: {
  33609. callbacks: {
  33610. title: function() {
  33611. return '';
  33612. },
  33613. label: function(tooltipItem, data) {
  33614. var dataLabel = data.labels[tooltipItem.index];
  33615. var value = ': ' + data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];
  33616. if (helpers.isArray(dataLabel)) {
  33617. // show value on first line of multiline label
  33618. // need to clone because we are changing the value
  33619. dataLabel = dataLabel.slice();
  33620. dataLabel[0] += value;
  33621. } else {
  33622. dataLabel += value;
  33623. }
  33624. return dataLabel;
  33625. }
  33626. }
  33627. }
  33628. };
  33629. defaults.pie = helpers.clone(defaults.doughnut);
  33630. helpers.extend(defaults.pie, {
  33631. cutoutPercentage: 0
  33632. });
  33633. Chart.controllers.doughnut = Chart.controllers.pie = Chart.DatasetController.extend({
  33634. dataElementType: Chart.elements.Arc,
  33635. linkScales: helpers.noop,
  33636. // Get index of the dataset in relation to the visible datasets. This allows determining the inner and outer radius correctly
  33637. getRingIndex: function(datasetIndex) {
  33638. var ringIndex = 0;
  33639. for (var j = 0; j < datasetIndex; ++j) {
  33640. if (this.chart.isDatasetVisible(j)) {
  33641. ++ringIndex;
  33642. }
  33643. }
  33644. return ringIndex;
  33645. },
  33646. update: function(reset) {
  33647. var me = this;
  33648. var chart = me.chart,
  33649. chartArea = chart.chartArea,
  33650. opts = chart.options,
  33651. arcOpts = opts.elements.arc,
  33652. availableWidth = chartArea.right - chartArea.left - arcOpts.borderWidth,
  33653. availableHeight = chartArea.bottom - chartArea.top - arcOpts.borderWidth,
  33654. minSize = Math.min(availableWidth, availableHeight),
  33655. offset = {
  33656. x: 0,
  33657. y: 0
  33658. },
  33659. meta = me.getMeta(),
  33660. cutoutPercentage = opts.cutoutPercentage,
  33661. circumference = opts.circumference;
  33662. // If the chart's circumference isn't a full circle, calculate minSize as a ratio of the width/height of the arc
  33663. if (circumference < Math.PI * 2.0) {
  33664. var startAngle = opts.rotation % (Math.PI * 2.0);
  33665. startAngle += Math.PI * 2.0 * (startAngle >= Math.PI ? -1 : startAngle < -Math.PI ? 1 : 0);
  33666. var endAngle = startAngle + circumference;
  33667. var start = {x: Math.cos(startAngle), y: Math.sin(startAngle)};
  33668. var end = {x: Math.cos(endAngle), y: Math.sin(endAngle)};
  33669. var contains0 = (startAngle <= 0 && 0 <= endAngle) || (startAngle <= Math.PI * 2.0 && Math.PI * 2.0 <= endAngle);
  33670. var contains90 = (startAngle <= Math.PI * 0.5 && Math.PI * 0.5 <= endAngle) || (startAngle <= Math.PI * 2.5 && Math.PI * 2.5 <= endAngle);
  33671. var contains180 = (startAngle <= -Math.PI && -Math.PI <= endAngle) || (startAngle <= Math.PI && Math.PI <= endAngle);
  33672. var contains270 = (startAngle <= -Math.PI * 0.5 && -Math.PI * 0.5 <= endAngle) || (startAngle <= Math.PI * 1.5 && Math.PI * 1.5 <= endAngle);
  33673. var cutout = cutoutPercentage / 100.0;
  33674. 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))};
  33675. 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))};
  33676. var size = {width: (max.x - min.x) * 0.5, height: (max.y - min.y) * 0.5};
  33677. minSize = Math.min(availableWidth / size.width, availableHeight / size.height);
  33678. offset = {x: (max.x + min.x) * -0.5, y: (max.y + min.y) * -0.5};
  33679. }
  33680. chart.borderWidth = me.getMaxBorderWidth(meta.data);
  33681. chart.outerRadius = Math.max((minSize - chart.borderWidth) / 2, 0);
  33682. chart.innerRadius = Math.max(cutoutPercentage ? (chart.outerRadius / 100) * (cutoutPercentage) : 0, 0);
  33683. chart.radiusLength = (chart.outerRadius - chart.innerRadius) / chart.getVisibleDatasetCount();
  33684. chart.offsetX = offset.x * chart.outerRadius;
  33685. chart.offsetY = offset.y * chart.outerRadius;
  33686. meta.total = me.calculateTotal();
  33687. me.outerRadius = chart.outerRadius - (chart.radiusLength * me.getRingIndex(me.index));
  33688. me.innerRadius = Math.max(me.outerRadius - chart.radiusLength, 0);
  33689. helpers.each(meta.data, function(arc, index) {
  33690. me.updateElement(arc, index, reset);
  33691. });
  33692. },
  33693. updateElement: function(arc, index, reset) {
  33694. var me = this;
  33695. var chart = me.chart,
  33696. chartArea = chart.chartArea,
  33697. opts = chart.options,
  33698. animationOpts = opts.animation,
  33699. centerX = (chartArea.left + chartArea.right) / 2,
  33700. centerY = (chartArea.top + chartArea.bottom) / 2,
  33701. startAngle = opts.rotation, // non reset case handled later
  33702. endAngle = opts.rotation, // non reset case handled later
  33703. dataset = me.getDataset(),
  33704. circumference = reset && animationOpts.animateRotate ? 0 : arc.hidden ? 0 : me.calculateCircumference(dataset.data[index]) * (opts.circumference / (2.0 * Math.PI)),
  33705. innerRadius = reset && animationOpts.animateScale ? 0 : me.innerRadius,
  33706. outerRadius = reset && animationOpts.animateScale ? 0 : me.outerRadius,
  33707. valueAtIndexOrDefault = helpers.getValueAtIndexOrDefault;
  33708. helpers.extend(arc, {
  33709. // Utility
  33710. _datasetIndex: me.index,
  33711. _index: index,
  33712. // Desired view properties
  33713. _model: {
  33714. x: centerX + chart.offsetX,
  33715. y: centerY + chart.offsetY,
  33716. startAngle: startAngle,
  33717. endAngle: endAngle,
  33718. circumference: circumference,
  33719. outerRadius: outerRadius,
  33720. innerRadius: innerRadius,
  33721. label: valueAtIndexOrDefault(dataset.label, index, chart.data.labels[index])
  33722. }
  33723. });
  33724. var model = arc._model;
  33725. // Resets the visual styles
  33726. this.removeHoverStyle(arc);
  33727. // Set correct angles if not resetting
  33728. if (!reset || !animationOpts.animateRotate) {
  33729. if (index === 0) {
  33730. model.startAngle = opts.rotation;
  33731. } else {
  33732. model.startAngle = me.getMeta().data[index - 1]._model.endAngle;
  33733. }
  33734. model.endAngle = model.startAngle + model.circumference;
  33735. }
  33736. arc.pivot();
  33737. },
  33738. removeHoverStyle: function(arc) {
  33739. Chart.DatasetController.prototype.removeHoverStyle.call(this, arc, this.chart.options.elements.arc);
  33740. },
  33741. calculateTotal: function() {
  33742. var dataset = this.getDataset();
  33743. var meta = this.getMeta();
  33744. var total = 0;
  33745. var value;
  33746. helpers.each(meta.data, function(element, index) {
  33747. value = dataset.data[index];
  33748. if (!isNaN(value) && !element.hidden) {
  33749. total += Math.abs(value);
  33750. }
  33751. });
  33752. /* if (total === 0) {
  33753. total = NaN;
  33754. }*/
  33755. return total;
  33756. },
  33757. calculateCircumference: function(value) {
  33758. var total = this.getMeta().total;
  33759. if (total > 0 && !isNaN(value)) {
  33760. return (Math.PI * 2.0) * (value / total);
  33761. }
  33762. return 0;
  33763. },
  33764. // gets the max border or hover width to properly scale pie charts
  33765. getMaxBorderWidth: function(elements) {
  33766. var max = 0,
  33767. index = this.index,
  33768. length = elements.length,
  33769. borderWidth,
  33770. hoverWidth;
  33771. for (var i = 0; i < length; i++) {
  33772. borderWidth = elements[i]._model ? elements[i]._model.borderWidth : 0;
  33773. hoverWidth = elements[i]._chart ? elements[i]._chart.config.data.datasets[index].hoverBorderWidth : 0;
  33774. max = borderWidth > max ? borderWidth : max;
  33775. max = hoverWidth > max ? hoverWidth : max;
  33776. }
  33777. return max;
  33778. }
  33779. });
  33780. };
  33781. /***/ }),
  33782. /* 133 */
  33783. /***/ (function(module, exports, __webpack_require__) {
  33784. "use strict";
  33785. module.exports = function(Chart) {
  33786. var helpers = Chart.helpers;
  33787. Chart.defaults.line = {
  33788. showLines: true,
  33789. spanGaps: false,
  33790. hover: {
  33791. mode: 'label'
  33792. },
  33793. scales: {
  33794. xAxes: [{
  33795. type: 'category',
  33796. id: 'x-axis-0'
  33797. }],
  33798. yAxes: [{
  33799. type: 'linear',
  33800. id: 'y-axis-0'
  33801. }]
  33802. }
  33803. };
  33804. function lineEnabled(dataset, options) {
  33805. return helpers.getValueOrDefault(dataset.showLine, options.showLines);
  33806. }
  33807. Chart.controllers.line = Chart.DatasetController.extend({
  33808. datasetElementType: Chart.elements.Line,
  33809. dataElementType: Chart.elements.Point,
  33810. update: function(reset) {
  33811. var me = this;
  33812. var meta = me.getMeta();
  33813. var line = meta.dataset;
  33814. var points = meta.data || [];
  33815. var options = me.chart.options;
  33816. var lineElementOptions = options.elements.line;
  33817. var scale = me.getScaleForId(meta.yAxisID);
  33818. var i, ilen, custom;
  33819. var dataset = me.getDataset();
  33820. var showLine = lineEnabled(dataset, options);
  33821. // Update Line
  33822. if (showLine) {
  33823. custom = line.custom || {};
  33824. // Compatibility: If the properties are defined with only the old name, use those values
  33825. if ((dataset.tension !== undefined) && (dataset.lineTension === undefined)) {
  33826. dataset.lineTension = dataset.tension;
  33827. }
  33828. // Utility
  33829. line._scale = scale;
  33830. line._datasetIndex = me.index;
  33831. // Data
  33832. line._children = points;
  33833. // Model
  33834. line._model = {
  33835. // Appearance
  33836. // The default behavior of lines is to break at null values, according
  33837. // to https://github.com/chartjs/Chart.js/issues/2435#issuecomment-216718158
  33838. // This option gives lines the ability to span gaps
  33839. spanGaps: dataset.spanGaps ? dataset.spanGaps : options.spanGaps,
  33840. tension: custom.tension ? custom.tension : helpers.getValueOrDefault(dataset.lineTension, lineElementOptions.tension),
  33841. backgroundColor: custom.backgroundColor ? custom.backgroundColor : (dataset.backgroundColor || lineElementOptions.backgroundColor),
  33842. borderWidth: custom.borderWidth ? custom.borderWidth : (dataset.borderWidth || lineElementOptions.borderWidth),
  33843. borderColor: custom.borderColor ? custom.borderColor : (dataset.borderColor || lineElementOptions.borderColor),
  33844. borderCapStyle: custom.borderCapStyle ? custom.borderCapStyle : (dataset.borderCapStyle || lineElementOptions.borderCapStyle),
  33845. borderDash: custom.borderDash ? custom.borderDash : (dataset.borderDash || lineElementOptions.borderDash),
  33846. borderDashOffset: custom.borderDashOffset ? custom.borderDashOffset : (dataset.borderDashOffset || lineElementOptions.borderDashOffset),
  33847. borderJoinStyle: custom.borderJoinStyle ? custom.borderJoinStyle : (dataset.borderJoinStyle || lineElementOptions.borderJoinStyle),
  33848. fill: custom.fill ? custom.fill : (dataset.fill !== undefined ? dataset.fill : lineElementOptions.fill),
  33849. steppedLine: custom.steppedLine ? custom.steppedLine : helpers.getValueOrDefault(dataset.steppedLine, lineElementOptions.stepped),
  33850. cubicInterpolationMode: custom.cubicInterpolationMode ? custom.cubicInterpolationMode : helpers.getValueOrDefault(dataset.cubicInterpolationMode, lineElementOptions.cubicInterpolationMode),
  33851. // Scale
  33852. scaleTop: scale.top,
  33853. scaleBottom: scale.bottom,
  33854. scaleZero: scale.getBasePixel()
  33855. };
  33856. line.pivot();
  33857. }
  33858. // Update Points
  33859. for (i=0, ilen=points.length; i<ilen; ++i) {
  33860. me.updateElement(points[i], i, reset);
  33861. }
  33862. if (showLine && line._model.tension !== 0) {
  33863. me.updateBezierControlPoints();
  33864. }
  33865. // Now pivot the point for animation
  33866. for (i=0, ilen=points.length; i<ilen; ++i) {
  33867. points[i].pivot();
  33868. }
  33869. },
  33870. getPointBackgroundColor: function(point, index) {
  33871. var backgroundColor = this.chart.options.elements.point.backgroundColor;
  33872. var dataset = this.getDataset();
  33873. var custom = point.custom || {};
  33874. if (custom.backgroundColor) {
  33875. backgroundColor = custom.backgroundColor;
  33876. } else if (dataset.pointBackgroundColor) {
  33877. backgroundColor = helpers.getValueAtIndexOrDefault(dataset.pointBackgroundColor, index, backgroundColor);
  33878. } else if (dataset.backgroundColor) {
  33879. backgroundColor = dataset.backgroundColor;
  33880. }
  33881. return backgroundColor;
  33882. },
  33883. getPointBorderColor: function(point, index) {
  33884. var borderColor = this.chart.options.elements.point.borderColor;
  33885. var dataset = this.getDataset();
  33886. var custom = point.custom || {};
  33887. if (custom.borderColor) {
  33888. borderColor = custom.borderColor;
  33889. } else if (dataset.pointBorderColor) {
  33890. borderColor = helpers.getValueAtIndexOrDefault(dataset.pointBorderColor, index, borderColor);
  33891. } else if (dataset.borderColor) {
  33892. borderColor = dataset.borderColor;
  33893. }
  33894. return borderColor;
  33895. },
  33896. getPointBorderWidth: function(point, index) {
  33897. var borderWidth = this.chart.options.elements.point.borderWidth;
  33898. var dataset = this.getDataset();
  33899. var custom = point.custom || {};
  33900. if (!isNaN(custom.borderWidth)) {
  33901. borderWidth = custom.borderWidth;
  33902. } else if (!isNaN(dataset.pointBorderWidth)) {
  33903. borderWidth = helpers.getValueAtIndexOrDefault(dataset.pointBorderWidth, index, borderWidth);
  33904. } else if (!isNaN(dataset.borderWidth)) {
  33905. borderWidth = dataset.borderWidth;
  33906. }
  33907. return borderWidth;
  33908. },
  33909. updateElement: function(point, index, reset) {
  33910. var me = this;
  33911. var meta = me.getMeta();
  33912. var custom = point.custom || {};
  33913. var dataset = me.getDataset();
  33914. var datasetIndex = me.index;
  33915. var value = dataset.data[index];
  33916. var yScale = me.getScaleForId(meta.yAxisID);
  33917. var xScale = me.getScaleForId(meta.xAxisID);
  33918. var pointOptions = me.chart.options.elements.point;
  33919. var x, y;
  33920. var labels = me.chart.data.labels || [];
  33921. var includeOffset = (labels.length === 1 || dataset.data.length === 1) || me.chart.isCombo;
  33922. // Compatibility: If the properties are defined with only the old name, use those values
  33923. if ((dataset.radius !== undefined) && (dataset.pointRadius === undefined)) {
  33924. dataset.pointRadius = dataset.radius;
  33925. }
  33926. if ((dataset.hitRadius !== undefined) && (dataset.pointHitRadius === undefined)) {
  33927. dataset.pointHitRadius = dataset.hitRadius;
  33928. }
  33929. x = xScale.getPixelForValue(typeof value === 'object' ? value : NaN, index, datasetIndex, includeOffset);
  33930. y = reset ? yScale.getBasePixel() : me.calculatePointY(value, index, datasetIndex);
  33931. // Utility
  33932. point._xScale = xScale;
  33933. point._yScale = yScale;
  33934. point._datasetIndex = datasetIndex;
  33935. point._index = index;
  33936. // Desired view properties
  33937. point._model = {
  33938. x: x,
  33939. y: y,
  33940. skip: custom.skip || isNaN(x) || isNaN(y),
  33941. // Appearance
  33942. radius: custom.radius || helpers.getValueAtIndexOrDefault(dataset.pointRadius, index, pointOptions.radius),
  33943. pointStyle: custom.pointStyle || helpers.getValueAtIndexOrDefault(dataset.pointStyle, index, pointOptions.pointStyle),
  33944. backgroundColor: me.getPointBackgroundColor(point, index),
  33945. borderColor: me.getPointBorderColor(point, index),
  33946. borderWidth: me.getPointBorderWidth(point, index),
  33947. tension: meta.dataset._model ? meta.dataset._model.tension : 0,
  33948. steppedLine: meta.dataset._model ? meta.dataset._model.steppedLine : false,
  33949. // Tooltip
  33950. hitRadius: custom.hitRadius || helpers.getValueAtIndexOrDefault(dataset.pointHitRadius, index, pointOptions.hitRadius)
  33951. };
  33952. },
  33953. calculatePointY: function(value, index, datasetIndex) {
  33954. var me = this;
  33955. var chart = me.chart;
  33956. var meta = me.getMeta();
  33957. var yScale = me.getScaleForId(meta.yAxisID);
  33958. var sumPos = 0;
  33959. var sumNeg = 0;
  33960. var i, ds, dsMeta;
  33961. if (yScale.options.stacked) {
  33962. for (i = 0; i < datasetIndex; i++) {
  33963. ds = chart.data.datasets[i];
  33964. dsMeta = chart.getDatasetMeta(i);
  33965. if (dsMeta.type === 'line' && dsMeta.yAxisID === yScale.id && chart.isDatasetVisible(i)) {
  33966. var stackedRightValue = Number(yScale.getRightValue(ds.data[index]));
  33967. if (stackedRightValue < 0) {
  33968. sumNeg += stackedRightValue || 0;
  33969. } else {
  33970. sumPos += stackedRightValue || 0;
  33971. }
  33972. }
  33973. }
  33974. var rightValue = Number(yScale.getRightValue(value));
  33975. if (rightValue < 0) {
  33976. return yScale.getPixelForValue(sumNeg + rightValue);
  33977. }
  33978. return yScale.getPixelForValue(sumPos + rightValue);
  33979. }
  33980. return yScale.getPixelForValue(value);
  33981. },
  33982. updateBezierControlPoints: function() {
  33983. var me = this;
  33984. var meta = me.getMeta();
  33985. var area = me.chart.chartArea;
  33986. var points = (meta.data || []);
  33987. var i, ilen, point, model, controlPoints;
  33988. // Only consider points that are drawn in case the spanGaps option is used
  33989. if (meta.dataset._model.spanGaps) {
  33990. points = points.filter(function(pt) {
  33991. return !pt._model.skip;
  33992. });
  33993. }
  33994. function capControlPoint(pt, min, max) {
  33995. return Math.max(Math.min(pt, max), min);
  33996. }
  33997. if (meta.dataset._model.cubicInterpolationMode === 'monotone') {
  33998. helpers.splineCurveMonotone(points);
  33999. } else {
  34000. for (i = 0, ilen = points.length; i < ilen; ++i) {
  34001. point = points[i];
  34002. model = point._model;
  34003. controlPoints = helpers.splineCurve(
  34004. helpers.previousItem(points, i)._model,
  34005. model,
  34006. helpers.nextItem(points, i)._model,
  34007. meta.dataset._model.tension
  34008. );
  34009. model.controlPointPreviousX = controlPoints.previous.x;
  34010. model.controlPointPreviousY = controlPoints.previous.y;
  34011. model.controlPointNextX = controlPoints.next.x;
  34012. model.controlPointNextY = controlPoints.next.y;
  34013. }
  34014. }
  34015. if (me.chart.options.elements.line.capBezierPoints) {
  34016. for (i = 0, ilen = points.length; i < ilen; ++i) {
  34017. model = points[i]._model;
  34018. model.controlPointPreviousX = capControlPoint(model.controlPointPreviousX, area.left, area.right);
  34019. model.controlPointPreviousY = capControlPoint(model.controlPointPreviousY, area.top, area.bottom);
  34020. model.controlPointNextX = capControlPoint(model.controlPointNextX, area.left, area.right);
  34021. model.controlPointNextY = capControlPoint(model.controlPointNextY, area.top, area.bottom);
  34022. }
  34023. }
  34024. },
  34025. draw: function(ease) {
  34026. var me = this;
  34027. var meta = me.getMeta();
  34028. var points = meta.data || [];
  34029. var easingDecimal = ease || 1;
  34030. var i, ilen;
  34031. // Transition Point Locations
  34032. for (i=0, ilen=points.length; i<ilen; ++i) {
  34033. points[i].transition(easingDecimal);
  34034. }
  34035. Chart.canvasHelpers.clipArea(me.chart.chart.ctx, me.chart.chartArea);
  34036. // Transition and Draw the line
  34037. if (lineEnabled(me.getDataset(), me.chart.options)) {
  34038. meta.dataset.transition(easingDecimal).draw();
  34039. }
  34040. Chart.canvasHelpers.unclipArea(me.chart.chart.ctx);
  34041. // Draw the points
  34042. for (i=0, ilen=points.length; i<ilen; ++i) {
  34043. points[i].draw(me.chart.chartArea);
  34044. }
  34045. },
  34046. setHoverStyle: function(point) {
  34047. // Point
  34048. var dataset = this.chart.data.datasets[point._datasetIndex];
  34049. var index = point._index;
  34050. var custom = point.custom || {};
  34051. var model = point._model;
  34052. model.radius = custom.hoverRadius || helpers.getValueAtIndexOrDefault(dataset.pointHoverRadius, index, this.chart.options.elements.point.hoverRadius);
  34053. model.backgroundColor = custom.hoverBackgroundColor || helpers.getValueAtIndexOrDefault(dataset.pointHoverBackgroundColor, index, helpers.getHoverColor(model.backgroundColor));
  34054. model.borderColor = custom.hoverBorderColor || helpers.getValueAtIndexOrDefault(dataset.pointHoverBorderColor, index, helpers.getHoverColor(model.borderColor));
  34055. model.borderWidth = custom.hoverBorderWidth || helpers.getValueAtIndexOrDefault(dataset.pointHoverBorderWidth, index, model.borderWidth);
  34056. },
  34057. removeHoverStyle: function(point) {
  34058. var me = this;
  34059. var dataset = me.chart.data.datasets[point._datasetIndex];
  34060. var index = point._index;
  34061. var custom = point.custom || {};
  34062. var model = point._model;
  34063. // Compatibility: If the properties are defined with only the old name, use those values
  34064. if ((dataset.radius !== undefined) && (dataset.pointRadius === undefined)) {
  34065. dataset.pointRadius = dataset.radius;
  34066. }
  34067. model.radius = custom.radius || helpers.getValueAtIndexOrDefault(dataset.pointRadius, index, me.chart.options.elements.point.radius);
  34068. model.backgroundColor = me.getPointBackgroundColor(point, index);
  34069. model.borderColor = me.getPointBorderColor(point, index);
  34070. model.borderWidth = me.getPointBorderWidth(point, index);
  34071. }
  34072. });
  34073. };
  34074. /***/ }),
  34075. /* 134 */
  34076. /***/ (function(module, exports, __webpack_require__) {
  34077. "use strict";
  34078. module.exports = function(Chart) {
  34079. var helpers = Chart.helpers;
  34080. Chart.defaults.polarArea = {
  34081. scale: {
  34082. type: 'radialLinear',
  34083. lineArc: true, // so that lines are circular
  34084. ticks: {
  34085. beginAtZero: true
  34086. }
  34087. },
  34088. // Boolean - Whether to animate the rotation of the chart
  34089. animation: {
  34090. animateRotate: true,
  34091. animateScale: true
  34092. },
  34093. startAngle: -0.5 * Math.PI,
  34094. aspectRatio: 1,
  34095. legendCallback: function(chart) {
  34096. var text = [];
  34097. text.push('<ul class="' + chart.id + '-legend">');
  34098. var data = chart.data;
  34099. var datasets = data.datasets;
  34100. var labels = data.labels;
  34101. if (datasets.length) {
  34102. for (var i = 0; i < datasets[0].data.length; ++i) {
  34103. text.push('<li><span style="background-color:' + datasets[0].backgroundColor[i] + '"></span>');
  34104. if (labels[i]) {
  34105. text.push(labels[i]);
  34106. }
  34107. text.push('</li>');
  34108. }
  34109. }
  34110. text.push('</ul>');
  34111. return text.join('');
  34112. },
  34113. legend: {
  34114. labels: {
  34115. generateLabels: function(chart) {
  34116. var data = chart.data;
  34117. if (data.labels.length && data.datasets.length) {
  34118. return data.labels.map(function(label, i) {
  34119. var meta = chart.getDatasetMeta(0);
  34120. var ds = data.datasets[0];
  34121. var arc = meta.data[i];
  34122. var custom = arc.custom || {};
  34123. var getValueAtIndexOrDefault = helpers.getValueAtIndexOrDefault;
  34124. var arcOpts = chart.options.elements.arc;
  34125. var fill = custom.backgroundColor ? custom.backgroundColor : getValueAtIndexOrDefault(ds.backgroundColor, i, arcOpts.backgroundColor);
  34126. var stroke = custom.borderColor ? custom.borderColor : getValueAtIndexOrDefault(ds.borderColor, i, arcOpts.borderColor);
  34127. var bw = custom.borderWidth ? custom.borderWidth : getValueAtIndexOrDefault(ds.borderWidth, i, arcOpts.borderWidth);
  34128. return {
  34129. text: label,
  34130. fillStyle: fill,
  34131. strokeStyle: stroke,
  34132. lineWidth: bw,
  34133. hidden: isNaN(ds.data[i]) || meta.data[i].hidden,
  34134. // Extra data used for toggling the correct item
  34135. index: i
  34136. };
  34137. });
  34138. }
  34139. return [];
  34140. }
  34141. },
  34142. onClick: function(e, legendItem) {
  34143. var index = legendItem.index;
  34144. var chart = this.chart;
  34145. var i, ilen, meta;
  34146. for (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {
  34147. meta = chart.getDatasetMeta(i);
  34148. meta.data[index].hidden = !meta.data[index].hidden;
  34149. }
  34150. chart.update();
  34151. }
  34152. },
  34153. // Need to override these to give a nice default
  34154. tooltips: {
  34155. callbacks: {
  34156. title: function() {
  34157. return '';
  34158. },
  34159. label: function(tooltipItem, data) {
  34160. return data.labels[tooltipItem.index] + ': ' + tooltipItem.yLabel;
  34161. }
  34162. }
  34163. }
  34164. };
  34165. Chart.controllers.polarArea = Chart.DatasetController.extend({
  34166. dataElementType: Chart.elements.Arc,
  34167. linkScales: helpers.noop,
  34168. update: function(reset) {
  34169. var me = this;
  34170. var chart = me.chart;
  34171. var chartArea = chart.chartArea;
  34172. var meta = me.getMeta();
  34173. var opts = chart.options;
  34174. var arcOpts = opts.elements.arc;
  34175. var minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);
  34176. chart.outerRadius = Math.max((minSize - arcOpts.borderWidth / 2) / 2, 0);
  34177. chart.innerRadius = Math.max(opts.cutoutPercentage ? (chart.outerRadius / 100) * (opts.cutoutPercentage) : 1, 0);
  34178. chart.radiusLength = (chart.outerRadius - chart.innerRadius) / chart.getVisibleDatasetCount();
  34179. me.outerRadius = chart.outerRadius - (chart.radiusLength * me.index);
  34180. me.innerRadius = me.outerRadius - chart.radiusLength;
  34181. meta.count = me.countVisibleElements();
  34182. helpers.each(meta.data, function(arc, index) {
  34183. me.updateElement(arc, index, reset);
  34184. });
  34185. },
  34186. updateElement: function(arc, index, reset) {
  34187. var me = this;
  34188. var chart = me.chart;
  34189. var dataset = me.getDataset();
  34190. var opts = chart.options;
  34191. var animationOpts = opts.animation;
  34192. var scale = chart.scale;
  34193. var getValueAtIndexOrDefault = helpers.getValueAtIndexOrDefault;
  34194. var labels = chart.data.labels;
  34195. var circumference = me.calculateCircumference(dataset.data[index]);
  34196. var centerX = scale.xCenter;
  34197. var centerY = scale.yCenter;
  34198. // If there is NaN data before us, we need to calculate the starting angle correctly.
  34199. // We could be way more efficient here, but its unlikely that the polar area chart will have a lot of data
  34200. var visibleCount = 0;
  34201. var meta = me.getMeta();
  34202. for (var i = 0; i < index; ++i) {
  34203. if (!isNaN(dataset.data[i]) && !meta.data[i].hidden) {
  34204. ++visibleCount;
  34205. }
  34206. }
  34207. // var negHalfPI = -0.5 * Math.PI;
  34208. var datasetStartAngle = opts.startAngle;
  34209. var distance = arc.hidden ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]);
  34210. var startAngle = datasetStartAngle + (circumference * visibleCount);
  34211. var endAngle = startAngle + (arc.hidden ? 0 : circumference);
  34212. var resetRadius = animationOpts.animateScale ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]);
  34213. helpers.extend(arc, {
  34214. // Utility
  34215. _datasetIndex: me.index,
  34216. _index: index,
  34217. _scale: scale,
  34218. // Desired view properties
  34219. _model: {
  34220. x: centerX,
  34221. y: centerY,
  34222. innerRadius: 0,
  34223. outerRadius: reset ? resetRadius : distance,
  34224. startAngle: reset && animationOpts.animateRotate ? datasetStartAngle : startAngle,
  34225. endAngle: reset && animationOpts.animateRotate ? datasetStartAngle : endAngle,
  34226. label: getValueAtIndexOrDefault(labels, index, labels[index])
  34227. }
  34228. });
  34229. // Apply border and fill style
  34230. me.removeHoverStyle(arc);
  34231. arc.pivot();
  34232. },
  34233. removeHoverStyle: function(arc) {
  34234. Chart.DatasetController.prototype.removeHoverStyle.call(this, arc, this.chart.options.elements.arc);
  34235. },
  34236. countVisibleElements: function() {
  34237. var dataset = this.getDataset();
  34238. var meta = this.getMeta();
  34239. var count = 0;
  34240. helpers.each(meta.data, function(element, index) {
  34241. if (!isNaN(dataset.data[index]) && !element.hidden) {
  34242. count++;
  34243. }
  34244. });
  34245. return count;
  34246. },
  34247. calculateCircumference: function(value) {
  34248. var count = this.getMeta().count;
  34249. if (count > 0 && !isNaN(value)) {
  34250. return (2 * Math.PI) / count;
  34251. }
  34252. return 0;
  34253. }
  34254. });
  34255. };
  34256. /***/ }),
  34257. /* 135 */
  34258. /***/ (function(module, exports, __webpack_require__) {
  34259. "use strict";
  34260. module.exports = function(Chart) {
  34261. var helpers = Chart.helpers;
  34262. Chart.defaults.radar = {
  34263. aspectRatio: 1,
  34264. scale: {
  34265. type: 'radialLinear'
  34266. },
  34267. elements: {
  34268. line: {
  34269. tension: 0 // no bezier in radar
  34270. }
  34271. }
  34272. };
  34273. Chart.controllers.radar = Chart.DatasetController.extend({
  34274. datasetElementType: Chart.elements.Line,
  34275. dataElementType: Chart.elements.Point,
  34276. linkScales: helpers.noop,
  34277. update: function(reset) {
  34278. var me = this;
  34279. var meta = me.getMeta();
  34280. var line = meta.dataset;
  34281. var points = meta.data;
  34282. var custom = line.custom || {};
  34283. var dataset = me.getDataset();
  34284. var lineElementOptions = me.chart.options.elements.line;
  34285. var scale = me.chart.scale;
  34286. // Compatibility: If the properties are defined with only the old name, use those values
  34287. if ((dataset.tension !== undefined) && (dataset.lineTension === undefined)) {
  34288. dataset.lineTension = dataset.tension;
  34289. }
  34290. helpers.extend(meta.dataset, {
  34291. // Utility
  34292. _datasetIndex: me.index,
  34293. // Data
  34294. _children: points,
  34295. _loop: true,
  34296. // Model
  34297. _model: {
  34298. // Appearance
  34299. tension: custom.tension ? custom.tension : helpers.getValueOrDefault(dataset.lineTension, lineElementOptions.tension),
  34300. backgroundColor: custom.backgroundColor ? custom.backgroundColor : (dataset.backgroundColor || lineElementOptions.backgroundColor),
  34301. borderWidth: custom.borderWidth ? custom.borderWidth : (dataset.borderWidth || lineElementOptions.borderWidth),
  34302. borderColor: custom.borderColor ? custom.borderColor : (dataset.borderColor || lineElementOptions.borderColor),
  34303. fill: custom.fill ? custom.fill : (dataset.fill !== undefined ? dataset.fill : lineElementOptions.fill),
  34304. borderCapStyle: custom.borderCapStyle ? custom.borderCapStyle : (dataset.borderCapStyle || lineElementOptions.borderCapStyle),
  34305. borderDash: custom.borderDash ? custom.borderDash : (dataset.borderDash || lineElementOptions.borderDash),
  34306. borderDashOffset: custom.borderDashOffset ? custom.borderDashOffset : (dataset.borderDashOffset || lineElementOptions.borderDashOffset),
  34307. borderJoinStyle: custom.borderJoinStyle ? custom.borderJoinStyle : (dataset.borderJoinStyle || lineElementOptions.borderJoinStyle),
  34308. // Scale
  34309. scaleTop: scale.top,
  34310. scaleBottom: scale.bottom,
  34311. scaleZero: scale.getBasePosition()
  34312. }
  34313. });
  34314. meta.dataset.pivot();
  34315. // Update Points
  34316. helpers.each(points, function(point, index) {
  34317. me.updateElement(point, index, reset);
  34318. }, me);
  34319. // Update bezier control points
  34320. me.updateBezierControlPoints();
  34321. },
  34322. updateElement: function(point, index, reset) {
  34323. var me = this;
  34324. var custom = point.custom || {};
  34325. var dataset = me.getDataset();
  34326. var scale = me.chart.scale;
  34327. var pointElementOptions = me.chart.options.elements.point;
  34328. var pointPosition = scale.getPointPositionForValue(index, dataset.data[index]);
  34329. helpers.extend(point, {
  34330. // Utility
  34331. _datasetIndex: me.index,
  34332. _index: index,
  34333. _scale: scale,
  34334. // Desired view properties
  34335. _model: {
  34336. x: reset ? scale.xCenter : pointPosition.x, // value not used in dataset scale, but we want a consistent API between scales
  34337. y: reset ? scale.yCenter : pointPosition.y,
  34338. // Appearance
  34339. tension: custom.tension ? custom.tension : helpers.getValueOrDefault(dataset.lineTension, me.chart.options.elements.line.tension),
  34340. radius: custom.radius ? custom.radius : helpers.getValueAtIndexOrDefault(dataset.pointRadius, index, pointElementOptions.radius),
  34341. backgroundColor: custom.backgroundColor ? custom.backgroundColor : helpers.getValueAtIndexOrDefault(dataset.pointBackgroundColor, index, pointElementOptions.backgroundColor),
  34342. borderColor: custom.borderColor ? custom.borderColor : helpers.getValueAtIndexOrDefault(dataset.pointBorderColor, index, pointElementOptions.borderColor),
  34343. borderWidth: custom.borderWidth ? custom.borderWidth : helpers.getValueAtIndexOrDefault(dataset.pointBorderWidth, index, pointElementOptions.borderWidth),
  34344. pointStyle: custom.pointStyle ? custom.pointStyle : helpers.getValueAtIndexOrDefault(dataset.pointStyle, index, pointElementOptions.pointStyle),
  34345. // Tooltip
  34346. hitRadius: custom.hitRadius ? custom.hitRadius : helpers.getValueAtIndexOrDefault(dataset.hitRadius, index, pointElementOptions.hitRadius)
  34347. }
  34348. });
  34349. point._model.skip = custom.skip ? custom.skip : (isNaN(point._model.x) || isNaN(point._model.y));
  34350. },
  34351. updateBezierControlPoints: function() {
  34352. var chartArea = this.chart.chartArea;
  34353. var meta = this.getMeta();
  34354. helpers.each(meta.data, function(point, index) {
  34355. var model = point._model;
  34356. var controlPoints = helpers.splineCurve(
  34357. helpers.previousItem(meta.data, index, true)._model,
  34358. model,
  34359. helpers.nextItem(meta.data, index, true)._model,
  34360. model.tension
  34361. );
  34362. // Prevent the bezier going outside of the bounds of the graph
  34363. model.controlPointPreviousX = Math.max(Math.min(controlPoints.previous.x, chartArea.right), chartArea.left);
  34364. model.controlPointPreviousY = Math.max(Math.min(controlPoints.previous.y, chartArea.bottom), chartArea.top);
  34365. model.controlPointNextX = Math.max(Math.min(controlPoints.next.x, chartArea.right), chartArea.left);
  34366. model.controlPointNextY = Math.max(Math.min(controlPoints.next.y, chartArea.bottom), chartArea.top);
  34367. // Now pivot the point for animation
  34368. point.pivot();
  34369. });
  34370. },
  34371. draw: function(ease) {
  34372. var meta = this.getMeta();
  34373. var easingDecimal = ease || 1;
  34374. // Transition Point Locations
  34375. helpers.each(meta.data, function(point) {
  34376. point.transition(easingDecimal);
  34377. });
  34378. // Transition and Draw the line
  34379. meta.dataset.transition(easingDecimal).draw();
  34380. // Draw the points
  34381. helpers.each(meta.data, function(point) {
  34382. point.draw();
  34383. });
  34384. },
  34385. setHoverStyle: function(point) {
  34386. // Point
  34387. var dataset = this.chart.data.datasets[point._datasetIndex];
  34388. var custom = point.custom || {};
  34389. var index = point._index;
  34390. var model = point._model;
  34391. model.radius = custom.hoverRadius ? custom.hoverRadius : helpers.getValueAtIndexOrDefault(dataset.pointHoverRadius, index, this.chart.options.elements.point.hoverRadius);
  34392. model.backgroundColor = custom.hoverBackgroundColor ? custom.hoverBackgroundColor : helpers.getValueAtIndexOrDefault(dataset.pointHoverBackgroundColor, index, helpers.getHoverColor(model.backgroundColor));
  34393. model.borderColor = custom.hoverBorderColor ? custom.hoverBorderColor : helpers.getValueAtIndexOrDefault(dataset.pointHoverBorderColor, index, helpers.getHoverColor(model.borderColor));
  34394. model.borderWidth = custom.hoverBorderWidth ? custom.hoverBorderWidth : helpers.getValueAtIndexOrDefault(dataset.pointHoverBorderWidth, index, model.borderWidth);
  34395. },
  34396. removeHoverStyle: function(point) {
  34397. var dataset = this.chart.data.datasets[point._datasetIndex];
  34398. var custom = point.custom || {};
  34399. var index = point._index;
  34400. var model = point._model;
  34401. var pointElementOptions = this.chart.options.elements.point;
  34402. model.radius = custom.radius ? custom.radius : helpers.getValueAtIndexOrDefault(dataset.radius, index, pointElementOptions.radius);
  34403. model.backgroundColor = custom.backgroundColor ? custom.backgroundColor : helpers.getValueAtIndexOrDefault(dataset.pointBackgroundColor, index, pointElementOptions.backgroundColor);
  34404. model.borderColor = custom.borderColor ? custom.borderColor : helpers.getValueAtIndexOrDefault(dataset.pointBorderColor, index, pointElementOptions.borderColor);
  34405. model.borderWidth = custom.borderWidth ? custom.borderWidth : helpers.getValueAtIndexOrDefault(dataset.pointBorderWidth, index, pointElementOptions.borderWidth);
  34406. }
  34407. });
  34408. };
  34409. /***/ }),
  34410. /* 136 */
  34411. /***/ (function(module, exports, __webpack_require__) {
  34412. "use strict";
  34413. /* global window: false */
  34414. module.exports = function(Chart) {
  34415. var helpers = Chart.helpers;
  34416. Chart.defaults.global.animation = {
  34417. duration: 1000,
  34418. easing: 'easeOutQuart',
  34419. onProgress: helpers.noop,
  34420. onComplete: helpers.noop
  34421. };
  34422. Chart.Animation = Chart.Element.extend({
  34423. currentStep: null, // the current animation step
  34424. numSteps: 60, // default number of steps
  34425. easing: '', // the easing to use for this animation
  34426. render: null, // render function used by the animation service
  34427. onAnimationProgress: null, // user specified callback to fire on each step of the animation
  34428. onAnimationComplete: null // user specified callback to fire when the animation finishes
  34429. });
  34430. Chart.animationService = {
  34431. frameDuration: 17,
  34432. animations: [],
  34433. dropFrames: 0,
  34434. request: null,
  34435. /**
  34436. * @function Chart.animationService.addAnimation
  34437. * @param chartInstance {ChartController} the chart to animate
  34438. * @param animationObject {IAnimation} the animation that we will animate
  34439. * @param duration {Number} length of animation in ms
  34440. * @param lazy {Boolean} if true, the chart is not marked as animating to enable more responsive interactions
  34441. */
  34442. addAnimation: function(chartInstance, animationObject, duration, lazy) {
  34443. var me = this;
  34444. if (!lazy) {
  34445. chartInstance.animating = true;
  34446. }
  34447. for (var index = 0; index < me.animations.length; ++index) {
  34448. if (me.animations[index].chartInstance === chartInstance) {
  34449. // replacing an in progress animation
  34450. me.animations[index].animationObject = animationObject;
  34451. return;
  34452. }
  34453. }
  34454. me.animations.push({
  34455. chartInstance: chartInstance,
  34456. animationObject: animationObject
  34457. });
  34458. // If there are no animations queued, manually kickstart a digest, for lack of a better word
  34459. if (me.animations.length === 1) {
  34460. me.requestAnimationFrame();
  34461. }
  34462. },
  34463. // Cancel the animation for a given chart instance
  34464. cancelAnimation: function(chartInstance) {
  34465. var index = helpers.findIndex(this.animations, function(animationWrapper) {
  34466. return animationWrapper.chartInstance === chartInstance;
  34467. });
  34468. if (index !== -1) {
  34469. this.animations.splice(index, 1);
  34470. chartInstance.animating = false;
  34471. }
  34472. },
  34473. requestAnimationFrame: function() {
  34474. var me = this;
  34475. if (me.request === null) {
  34476. // Skip animation frame requests until the active one is executed.
  34477. // This can happen when processing mouse events, e.g. 'mousemove'
  34478. // and 'mouseout' events will trigger multiple renders.
  34479. me.request = helpers.requestAnimFrame.call(window, function() {
  34480. me.request = null;
  34481. me.startDigest();
  34482. });
  34483. }
  34484. },
  34485. startDigest: function() {
  34486. var me = this;
  34487. var startTime = Date.now();
  34488. var framesToDrop = 0;
  34489. if (me.dropFrames > 1) {
  34490. framesToDrop = Math.floor(me.dropFrames);
  34491. me.dropFrames = me.dropFrames % 1;
  34492. }
  34493. var i = 0;
  34494. while (i < me.animations.length) {
  34495. if (me.animations[i].animationObject.currentStep === null) {
  34496. me.animations[i].animationObject.currentStep = 0;
  34497. }
  34498. me.animations[i].animationObject.currentStep += 1 + framesToDrop;
  34499. if (me.animations[i].animationObject.currentStep > me.animations[i].animationObject.numSteps) {
  34500. me.animations[i].animationObject.currentStep = me.animations[i].animationObject.numSteps;
  34501. }
  34502. me.animations[i].animationObject.render(me.animations[i].chartInstance, me.animations[i].animationObject);
  34503. if (me.animations[i].animationObject.onAnimationProgress && me.animations[i].animationObject.onAnimationProgress.call) {
  34504. me.animations[i].animationObject.onAnimationProgress.call(me.animations[i].chartInstance, me.animations[i]);
  34505. }
  34506. if (me.animations[i].animationObject.currentStep === me.animations[i].animationObject.numSteps) {
  34507. if (me.animations[i].animationObject.onAnimationComplete && me.animations[i].animationObject.onAnimationComplete.call) {
  34508. me.animations[i].animationObject.onAnimationComplete.call(me.animations[i].chartInstance, me.animations[i]);
  34509. }
  34510. // executed the last frame. Remove the animation.
  34511. me.animations[i].chartInstance.animating = false;
  34512. me.animations.splice(i, 1);
  34513. } else {
  34514. ++i;
  34515. }
  34516. }
  34517. var endTime = Date.now();
  34518. var dropFrames = (endTime - startTime) / me.frameDuration;
  34519. me.dropFrames += dropFrames;
  34520. // Do we have more stuff to animate?
  34521. if (me.animations.length > 0) {
  34522. me.requestAnimationFrame();
  34523. }
  34524. }
  34525. };
  34526. };
  34527. /***/ }),
  34528. /* 137 */
  34529. /***/ (function(module, exports, __webpack_require__) {
  34530. "use strict";
  34531. module.exports = function(Chart) {
  34532. // Global Chart canvas helpers object for drawing items to canvas
  34533. var helpers = Chart.canvasHelpers = {};
  34534. helpers.drawPoint = function(ctx, pointStyle, radius, x, y) {
  34535. var type, edgeLength, xOffset, yOffset, height, size;
  34536. if (typeof pointStyle === 'object') {
  34537. type = pointStyle.toString();
  34538. if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {
  34539. ctx.drawImage(pointStyle, x - pointStyle.width / 2, y - pointStyle.height / 2);
  34540. return;
  34541. }
  34542. }
  34543. if (isNaN(radius) || radius <= 0) {
  34544. return;
  34545. }
  34546. switch (pointStyle) {
  34547. // Default includes circle
  34548. default:
  34549. ctx.beginPath();
  34550. ctx.arc(x, y, radius, 0, Math.PI * 2);
  34551. ctx.closePath();
  34552. ctx.fill();
  34553. break;
  34554. case 'triangle':
  34555. ctx.beginPath();
  34556. edgeLength = 3 * radius / Math.sqrt(3);
  34557. height = edgeLength * Math.sqrt(3) / 2;
  34558. ctx.moveTo(x - edgeLength / 2, y + height / 3);
  34559. ctx.lineTo(x + edgeLength / 2, y + height / 3);
  34560. ctx.lineTo(x, y - 2 * height / 3);
  34561. ctx.closePath();
  34562. ctx.fill();
  34563. break;
  34564. case 'rect':
  34565. size = 1 / Math.SQRT2 * radius;
  34566. ctx.beginPath();
  34567. ctx.fillRect(x - size, y - size, 2 * size, 2 * size);
  34568. ctx.strokeRect(x - size, y - size, 2 * size, 2 * size);
  34569. break;
  34570. case 'rectRounded':
  34571. var offset = radius / Math.SQRT2;
  34572. var leftX = x - offset;
  34573. var topY = y - offset;
  34574. var sideSize = Math.SQRT2 * radius;
  34575. Chart.helpers.drawRoundedRectangle(ctx, leftX, topY, sideSize, sideSize, radius / 2);
  34576. ctx.fill();
  34577. break;
  34578. case 'rectRot':
  34579. size = 1 / Math.SQRT2 * radius;
  34580. ctx.beginPath();
  34581. ctx.moveTo(x - size, y);
  34582. ctx.lineTo(x, y + size);
  34583. ctx.lineTo(x + size, y);
  34584. ctx.lineTo(x, y - size);
  34585. ctx.closePath();
  34586. ctx.fill();
  34587. break;
  34588. case 'cross':
  34589. ctx.beginPath();
  34590. ctx.moveTo(x, y + radius);
  34591. ctx.lineTo(x, y - radius);
  34592. ctx.moveTo(x - radius, y);
  34593. ctx.lineTo(x + radius, y);
  34594. ctx.closePath();
  34595. break;
  34596. case 'crossRot':
  34597. ctx.beginPath();
  34598. xOffset = Math.cos(Math.PI / 4) * radius;
  34599. yOffset = Math.sin(Math.PI / 4) * radius;
  34600. ctx.moveTo(x - xOffset, y - yOffset);
  34601. ctx.lineTo(x + xOffset, y + yOffset);
  34602. ctx.moveTo(x - xOffset, y + yOffset);
  34603. ctx.lineTo(x + xOffset, y - yOffset);
  34604. ctx.closePath();
  34605. break;
  34606. case 'star':
  34607. ctx.beginPath();
  34608. ctx.moveTo(x, y + radius);
  34609. ctx.lineTo(x, y - radius);
  34610. ctx.moveTo(x - radius, y);
  34611. ctx.lineTo(x + radius, y);
  34612. xOffset = Math.cos(Math.PI / 4) * radius;
  34613. yOffset = Math.sin(Math.PI / 4) * radius;
  34614. ctx.moveTo(x - xOffset, y - yOffset);
  34615. ctx.lineTo(x + xOffset, y + yOffset);
  34616. ctx.moveTo(x - xOffset, y + yOffset);
  34617. ctx.lineTo(x + xOffset, y - yOffset);
  34618. ctx.closePath();
  34619. break;
  34620. case 'line':
  34621. ctx.beginPath();
  34622. ctx.moveTo(x - radius, y);
  34623. ctx.lineTo(x + radius, y);
  34624. ctx.closePath();
  34625. break;
  34626. case 'dash':
  34627. ctx.beginPath();
  34628. ctx.moveTo(x, y);
  34629. ctx.lineTo(x + radius, y);
  34630. ctx.closePath();
  34631. break;
  34632. }
  34633. ctx.stroke();
  34634. };
  34635. helpers.clipArea = function(ctx, clipArea) {
  34636. ctx.save();
  34637. ctx.beginPath();
  34638. ctx.rect(clipArea.left, clipArea.top, clipArea.right - clipArea.left, clipArea.bottom - clipArea.top);
  34639. ctx.clip();
  34640. };
  34641. helpers.unclipArea = function(ctx) {
  34642. ctx.restore();
  34643. };
  34644. };
  34645. /***/ }),
  34646. /* 138 */
  34647. /***/ (function(module, exports, __webpack_require__) {
  34648. "use strict";
  34649. module.exports = function(Chart) {
  34650. var helpers = Chart.helpers;
  34651. var plugins = Chart.plugins;
  34652. var platform = Chart.platform;
  34653. // Create a dictionary of chart types, to allow for extension of existing types
  34654. Chart.types = {};
  34655. // Store a reference to each instance - allowing us to globally resize chart instances on window resize.
  34656. // Destroy method on the chart will remove the instance of the chart from this reference.
  34657. Chart.instances = {};
  34658. // Controllers available for dataset visualization eg. bar, line, slice, etc.
  34659. Chart.controllers = {};
  34660. /**
  34661. * Initializes the given config with global and chart default values.
  34662. */
  34663. function initConfig(config) {
  34664. config = config || {};
  34665. // Do NOT use configMerge() for the data object because this method merges arrays
  34666. // and so would change references to labels and datasets, preventing data updates.
  34667. var data = config.data = config.data || {};
  34668. data.datasets = data.datasets || [];
  34669. data.labels = data.labels || [];
  34670. config.options = helpers.configMerge(
  34671. Chart.defaults.global,
  34672. Chart.defaults[config.type],
  34673. config.options || {});
  34674. return config;
  34675. }
  34676. /**
  34677. * Updates the config of the chart
  34678. * @param chart {Chart.Controller} chart to update the options for
  34679. */
  34680. function updateConfig(chart) {
  34681. var newOptions = chart.options;
  34682. // Update Scale(s) with options
  34683. if (newOptions.scale) {
  34684. chart.scale.options = newOptions.scale;
  34685. } else if (newOptions.scales) {
  34686. newOptions.scales.xAxes.concat(newOptions.scales.yAxes).forEach(function(scaleOptions) {
  34687. chart.scales[scaleOptions.id].options = scaleOptions;
  34688. });
  34689. }
  34690. // Tooltip
  34691. chart.tooltip._options = newOptions.tooltips;
  34692. }
  34693. /**
  34694. * @class Chart.Controller
  34695. * The main controller of a chart.
  34696. */
  34697. Chart.Controller = function(item, config, instance) {
  34698. var me = this;
  34699. config = initConfig(config);
  34700. var context = platform.acquireContext(item, config);
  34701. var canvas = context && context.canvas;
  34702. var height = canvas && canvas.height;
  34703. var width = canvas && canvas.width;
  34704. instance.ctx = context;
  34705. instance.canvas = canvas;
  34706. instance.config = config;
  34707. instance.width = width;
  34708. instance.height = height;
  34709. instance.aspectRatio = height? width / height : null;
  34710. me.id = helpers.uid();
  34711. me.chart = instance;
  34712. me.config = config;
  34713. me.options = config.options;
  34714. me._bufferedRender = false;
  34715. // Add the chart instance to the global namespace
  34716. Chart.instances[me.id] = me;
  34717. Object.defineProperty(me, 'data', {
  34718. get: function() {
  34719. return me.config.data;
  34720. }
  34721. });
  34722. if (!context || !canvas) {
  34723. // The given item is not a compatible context2d element, let's return before finalizing
  34724. // the chart initialization but after setting basic chart / controller properties that
  34725. // can help to figure out that the chart is not valid (e.g chart.canvas !== null);
  34726. // https://github.com/chartjs/Chart.js/issues/2807
  34727. console.error("Failed to create chart: can't acquire context from the given item");
  34728. return me;
  34729. }
  34730. me.initialize();
  34731. me.update();
  34732. return me;
  34733. };
  34734. helpers.extend(Chart.Controller.prototype, /** @lends Chart.Controller.prototype */ {
  34735. initialize: function() {
  34736. var me = this;
  34737. // Before init plugin notification
  34738. plugins.notify(me, 'beforeInit');
  34739. helpers.retinaScale(me.chart);
  34740. me.bindEvents();
  34741. if (me.options.responsive) {
  34742. // Initial resize before chart draws (must be silent to preserve initial animations).
  34743. me.resize(true);
  34744. }
  34745. // Make sure scales have IDs and are built before we build any controllers.
  34746. me.ensureScalesHaveIDs();
  34747. me.buildScales();
  34748. me.initToolTip();
  34749. // After init plugin notification
  34750. plugins.notify(me, 'afterInit');
  34751. return me;
  34752. },
  34753. clear: function() {
  34754. helpers.clear(this.chart);
  34755. return this;
  34756. },
  34757. stop: function() {
  34758. // Stops any current animation loop occurring
  34759. Chart.animationService.cancelAnimation(this);
  34760. return this;
  34761. },
  34762. resize: function(silent) {
  34763. var me = this;
  34764. var chart = me.chart;
  34765. var options = me.options;
  34766. var canvas = chart.canvas;
  34767. var aspectRatio = (options.maintainAspectRatio && chart.aspectRatio) || null;
  34768. // the canvas render width and height will be casted to integers so make sure that
  34769. // the canvas display style uses the same integer values to avoid blurring effect.
  34770. var newWidth = Math.floor(helpers.getMaximumWidth(canvas));
  34771. var newHeight = Math.floor(aspectRatio? newWidth / aspectRatio : helpers.getMaximumHeight(canvas));
  34772. if (chart.width === newWidth && chart.height === newHeight) {
  34773. return;
  34774. }
  34775. canvas.width = chart.width = newWidth;
  34776. canvas.height = chart.height = newHeight;
  34777. canvas.style.width = newWidth + 'px';
  34778. canvas.style.height = newHeight + 'px';
  34779. helpers.retinaScale(chart);
  34780. if (!silent) {
  34781. // Notify any plugins about the resize
  34782. var newSize = {width: newWidth, height: newHeight};
  34783. plugins.notify(me, 'resize', [newSize]);
  34784. // Notify of resize
  34785. if (me.options.onResize) {
  34786. me.options.onResize(me, newSize);
  34787. }
  34788. me.stop();
  34789. me.update(me.options.responsiveAnimationDuration);
  34790. }
  34791. },
  34792. ensureScalesHaveIDs: function() {
  34793. var options = this.options;
  34794. var scalesOptions = options.scales || {};
  34795. var scaleOptions = options.scale;
  34796. helpers.each(scalesOptions.xAxes, function(xAxisOptions, index) {
  34797. xAxisOptions.id = xAxisOptions.id || ('x-axis-' + index);
  34798. });
  34799. helpers.each(scalesOptions.yAxes, function(yAxisOptions, index) {
  34800. yAxisOptions.id = yAxisOptions.id || ('y-axis-' + index);
  34801. });
  34802. if (scaleOptions) {
  34803. scaleOptions.id = scaleOptions.id || 'scale';
  34804. }
  34805. },
  34806. /**
  34807. * Builds a map of scale ID to scale object for future lookup.
  34808. */
  34809. buildScales: function() {
  34810. var me = this;
  34811. var options = me.options;
  34812. var scales = me.scales = {};
  34813. var items = [];
  34814. if (options.scales) {
  34815. items = items.concat(
  34816. (options.scales.xAxes || []).map(function(xAxisOptions) {
  34817. return {options: xAxisOptions, dtype: 'category'};
  34818. }),
  34819. (options.scales.yAxes || []).map(function(yAxisOptions) {
  34820. return {options: yAxisOptions, dtype: 'linear'};
  34821. })
  34822. );
  34823. }
  34824. if (options.scale) {
  34825. items.push({options: options.scale, dtype: 'radialLinear', isDefault: true});
  34826. }
  34827. helpers.each(items, function(item) {
  34828. var scaleOptions = item.options;
  34829. var scaleType = helpers.getValueOrDefault(scaleOptions.type, item.dtype);
  34830. var scaleClass = Chart.scaleService.getScaleConstructor(scaleType);
  34831. if (!scaleClass) {
  34832. return;
  34833. }
  34834. var scale = new scaleClass({
  34835. id: scaleOptions.id,
  34836. options: scaleOptions,
  34837. ctx: me.chart.ctx,
  34838. chart: me
  34839. });
  34840. scales[scale.id] = scale;
  34841. // TODO(SB): I think we should be able to remove this custom case (options.scale)
  34842. // and consider it as a regular scale part of the "scales"" map only! This would
  34843. // make the logic easier and remove some useless? custom code.
  34844. if (item.isDefault) {
  34845. me.scale = scale;
  34846. }
  34847. });
  34848. Chart.scaleService.addScalesToLayout(this);
  34849. },
  34850. buildOrUpdateControllers: function() {
  34851. var me = this;
  34852. var types = [];
  34853. var newControllers = [];
  34854. helpers.each(me.data.datasets, function(dataset, datasetIndex) {
  34855. var meta = me.getDatasetMeta(datasetIndex);
  34856. if (!meta.type) {
  34857. meta.type = dataset.type || me.config.type;
  34858. }
  34859. types.push(meta.type);
  34860. if (meta.controller) {
  34861. meta.controller.updateIndex(datasetIndex);
  34862. } else {
  34863. meta.controller = new Chart.controllers[meta.type](me, datasetIndex);
  34864. newControllers.push(meta.controller);
  34865. }
  34866. }, me);
  34867. if (types.length > 1) {
  34868. for (var i = 1; i < types.length; i++) {
  34869. if (types[i] !== types[i - 1]) {
  34870. me.isCombo = true;
  34871. break;
  34872. }
  34873. }
  34874. }
  34875. return newControllers;
  34876. },
  34877. /**
  34878. * Reset the elements of all datasets
  34879. * @private
  34880. */
  34881. resetElements: function() {
  34882. var me = this;
  34883. helpers.each(me.data.datasets, function(dataset, datasetIndex) {
  34884. me.getDatasetMeta(datasetIndex).controller.reset();
  34885. }, me);
  34886. },
  34887. /**
  34888. * Resets the chart back to it's state before the initial animation
  34889. */
  34890. reset: function() {
  34891. this.resetElements();
  34892. this.tooltip.initialize();
  34893. },
  34894. update: function(animationDuration, lazy) {
  34895. var me = this;
  34896. updateConfig(me);
  34897. if (plugins.notify(me, 'beforeUpdate') === false) {
  34898. return;
  34899. }
  34900. // In case the entire data object changed
  34901. me.tooltip._data = me.data;
  34902. // Make sure dataset controllers are updated and new controllers are reset
  34903. var newControllers = me.buildOrUpdateControllers();
  34904. // Make sure all dataset controllers have correct meta data counts
  34905. helpers.each(me.data.datasets, function(dataset, datasetIndex) {
  34906. me.getDatasetMeta(datasetIndex).controller.buildOrUpdateElements();
  34907. }, me);
  34908. me.updateLayout();
  34909. // Can only reset the new controllers after the scales have been updated
  34910. helpers.each(newControllers, function(controller) {
  34911. controller.reset();
  34912. });
  34913. me.updateDatasets();
  34914. // Do this before render so that any plugins that need final scale updates can use it
  34915. plugins.notify(me, 'afterUpdate');
  34916. if (me._bufferedRender) {
  34917. me._bufferedRequest = {
  34918. lazy: lazy,
  34919. duration: animationDuration
  34920. };
  34921. } else {
  34922. me.render(animationDuration, lazy);
  34923. }
  34924. },
  34925. /**
  34926. * Updates the chart layout unless a plugin returns `false` to the `beforeLayout`
  34927. * hook, in which case, plugins will not be called on `afterLayout`.
  34928. * @private
  34929. */
  34930. updateLayout: function() {
  34931. var me = this;
  34932. if (plugins.notify(me, 'beforeLayout') === false) {
  34933. return;
  34934. }
  34935. Chart.layoutService.update(this, this.chart.width, this.chart.height);
  34936. /**
  34937. * Provided for backward compatibility, use `afterLayout` instead.
  34938. * @method IPlugin#afterScaleUpdate
  34939. * @deprecated since version 2.5.0
  34940. * @todo remove at version 3
  34941. */
  34942. plugins.notify(me, 'afterScaleUpdate');
  34943. plugins.notify(me, 'afterLayout');
  34944. },
  34945. /**
  34946. * Updates all datasets unless a plugin returns `false` to the `beforeDatasetsUpdate`
  34947. * hook, in which case, plugins will not be called on `afterDatasetsUpdate`.
  34948. * @private
  34949. */
  34950. updateDatasets: function() {
  34951. var me = this;
  34952. if (plugins.notify(me, 'beforeDatasetsUpdate') === false) {
  34953. return;
  34954. }
  34955. for (var i = 0, ilen = me.data.datasets.length; i < ilen; ++i) {
  34956. me.getDatasetMeta(i).controller.update();
  34957. }
  34958. plugins.notify(me, 'afterDatasetsUpdate');
  34959. },
  34960. render: function(duration, lazy) {
  34961. var me = this;
  34962. if (plugins.notify(me, 'beforeRender') === false) {
  34963. return;
  34964. }
  34965. var animationOptions = me.options.animation;
  34966. var onComplete = function() {
  34967. plugins.notify(me, 'afterRender');
  34968. var callback = animationOptions && animationOptions.onComplete;
  34969. if (callback && callback.call) {
  34970. callback.call(me);
  34971. }
  34972. };
  34973. if (animationOptions && ((typeof duration !== 'undefined' && duration !== 0) || (typeof duration === 'undefined' && animationOptions.duration !== 0))) {
  34974. var animation = new Chart.Animation();
  34975. animation.numSteps = (duration || animationOptions.duration) / 16.66; // 60 fps
  34976. animation.easing = animationOptions.easing;
  34977. // render function
  34978. animation.render = function(chartInstance, animationObject) {
  34979. var easingFunction = helpers.easingEffects[animationObject.easing];
  34980. var stepDecimal = animationObject.currentStep / animationObject.numSteps;
  34981. var easeDecimal = easingFunction(stepDecimal);
  34982. chartInstance.draw(easeDecimal, stepDecimal, animationObject.currentStep);
  34983. };
  34984. // user events
  34985. animation.onAnimationProgress = animationOptions.onProgress;
  34986. animation.onAnimationComplete = onComplete;
  34987. Chart.animationService.addAnimation(me, animation, duration, lazy);
  34988. } else {
  34989. me.draw();
  34990. onComplete();
  34991. }
  34992. return me;
  34993. },
  34994. draw: function(easingValue) {
  34995. var me = this;
  34996. me.clear();
  34997. if (easingValue === undefined || easingValue === null) {
  34998. easingValue = 1;
  34999. }
  35000. if (plugins.notify(me, 'beforeDraw', [easingValue]) === false) {
  35001. return;
  35002. }
  35003. // Draw all the scales
  35004. helpers.each(me.boxes, function(box) {
  35005. box.draw(me.chartArea);
  35006. }, me);
  35007. if (me.scale) {
  35008. me.scale.draw();
  35009. }
  35010. me.drawDatasets(easingValue);
  35011. // Finally draw the tooltip
  35012. me.tooltip.transition(easingValue).draw();
  35013. plugins.notify(me, 'afterDraw', [easingValue]);
  35014. },
  35015. /**
  35016. * Draws all datasets unless a plugin returns `false` to the `beforeDatasetsDraw`
  35017. * hook, in which case, plugins will not be called on `afterDatasetsDraw`.
  35018. * @private
  35019. */
  35020. drawDatasets: function(easingValue) {
  35021. var me = this;
  35022. if (plugins.notify(me, 'beforeDatasetsDraw', [easingValue]) === false) {
  35023. return;
  35024. }
  35025. // Draw each dataset via its respective controller (reversed to support proper line stacking)
  35026. helpers.each(me.data.datasets, function(dataset, datasetIndex) {
  35027. if (me.isDatasetVisible(datasetIndex)) {
  35028. me.getDatasetMeta(datasetIndex).controller.draw(easingValue);
  35029. }
  35030. }, me, true);
  35031. plugins.notify(me, 'afterDatasetsDraw', [easingValue]);
  35032. },
  35033. // Get the single element that was clicked on
  35034. // @return : An object containing the dataset index and element index of the matching element. Also contains the rectangle that was draw
  35035. getElementAtEvent: function(e) {
  35036. return Chart.Interaction.modes.single(this, e);
  35037. },
  35038. getElementsAtEvent: function(e) {
  35039. return Chart.Interaction.modes.label(this, e, {intersect: true});
  35040. },
  35041. getElementsAtXAxis: function(e) {
  35042. return Chart.Interaction.modes['x-axis'](this, e, {intersect: true});
  35043. },
  35044. getElementsAtEventForMode: function(e, mode, options) {
  35045. var method = Chart.Interaction.modes[mode];
  35046. if (typeof method === 'function') {
  35047. return method(this, e, options);
  35048. }
  35049. return [];
  35050. },
  35051. getDatasetAtEvent: function(e) {
  35052. return Chart.Interaction.modes.dataset(this, e, {intersect: true});
  35053. },
  35054. getDatasetMeta: function(datasetIndex) {
  35055. var me = this;
  35056. var dataset = me.data.datasets[datasetIndex];
  35057. if (!dataset._meta) {
  35058. dataset._meta = {};
  35059. }
  35060. var meta = dataset._meta[me.id];
  35061. if (!meta) {
  35062. meta = dataset._meta[me.id] = {
  35063. type: null,
  35064. data: [],
  35065. dataset: null,
  35066. controller: null,
  35067. hidden: null, // See isDatasetVisible() comment
  35068. xAxisID: null,
  35069. yAxisID: null
  35070. };
  35071. }
  35072. return meta;
  35073. },
  35074. getVisibleDatasetCount: function() {
  35075. var count = 0;
  35076. for (var i = 0, ilen = this.data.datasets.length; i<ilen; ++i) {
  35077. if (this.isDatasetVisible(i)) {
  35078. count++;
  35079. }
  35080. }
  35081. return count;
  35082. },
  35083. isDatasetVisible: function(datasetIndex) {
  35084. var meta = this.getDatasetMeta(datasetIndex);
  35085. // meta.hidden is a per chart dataset hidden flag override with 3 states: if true or false,
  35086. // the dataset.hidden value is ignored, else if null, the dataset hidden state is returned.
  35087. return typeof meta.hidden === 'boolean'? !meta.hidden : !this.data.datasets[datasetIndex].hidden;
  35088. },
  35089. generateLegend: function() {
  35090. return this.options.legendCallback(this);
  35091. },
  35092. destroy: function() {
  35093. var me = this;
  35094. var canvas = me.chart.canvas;
  35095. var meta, i, ilen;
  35096. me.stop();
  35097. // dataset controllers need to cleanup associated data
  35098. for (i = 0, ilen = me.data.datasets.length; i < ilen; ++i) {
  35099. meta = me.getDatasetMeta(i);
  35100. if (meta.controller) {
  35101. meta.controller.destroy();
  35102. meta.controller = null;
  35103. }
  35104. }
  35105. if (canvas) {
  35106. me.unbindEvents();
  35107. helpers.clear(me.chart);
  35108. platform.releaseContext(me.chart.ctx);
  35109. me.chart.canvas = null;
  35110. me.chart.ctx = null;
  35111. }
  35112. plugins.notify(me, 'destroy');
  35113. delete Chart.instances[me.id];
  35114. },
  35115. toBase64Image: function() {
  35116. return this.chart.canvas.toDataURL.apply(this.chart.canvas, arguments);
  35117. },
  35118. initToolTip: function() {
  35119. var me = this;
  35120. me.tooltip = new Chart.Tooltip({
  35121. _chart: me.chart,
  35122. _chartInstance: me,
  35123. _data: me.data,
  35124. _options: me.options.tooltips
  35125. }, me);
  35126. me.tooltip.initialize();
  35127. },
  35128. /**
  35129. * @private
  35130. */
  35131. bindEvents: function() {
  35132. var me = this;
  35133. var listeners = me._listeners = {};
  35134. var listener = function() {
  35135. me.eventHandler.apply(me, arguments);
  35136. };
  35137. helpers.each(me.options.events, function(type) {
  35138. platform.addEventListener(me, type, listener);
  35139. listeners[type] = listener;
  35140. });
  35141. // Responsiveness is currently based on the use of an iframe, however this method causes
  35142. // performance issues and could be troublesome when used with ad blockers. So make sure
  35143. // that the user is still able to create a chart without iframe when responsive is false.
  35144. // See https://github.com/chartjs/Chart.js/issues/2210
  35145. if (me.options.responsive) {
  35146. listener = function() {
  35147. me.resize();
  35148. };
  35149. platform.addEventListener(me, 'resize', listener);
  35150. listeners.resize = listener;
  35151. }
  35152. },
  35153. /**
  35154. * @private
  35155. */
  35156. unbindEvents: function() {
  35157. var me = this;
  35158. var listeners = me._listeners;
  35159. if (!listeners) {
  35160. return;
  35161. }
  35162. delete me._listeners;
  35163. helpers.each(listeners, function(listener, type) {
  35164. platform.removeEventListener(me, type, listener);
  35165. });
  35166. },
  35167. updateHoverStyle: function(elements, mode, enabled) {
  35168. var method = enabled? 'setHoverStyle' : 'removeHoverStyle';
  35169. var element, i, ilen;
  35170. for (i=0, ilen=elements.length; i<ilen; ++i) {
  35171. element = elements[i];
  35172. if (element) {
  35173. this.getDatasetMeta(element._datasetIndex).controller[method](element);
  35174. }
  35175. }
  35176. },
  35177. /**
  35178. * @private
  35179. */
  35180. eventHandler: function(e) {
  35181. var me = this;
  35182. var tooltip = me.tooltip;
  35183. if (plugins.notify(me, 'beforeEvent', [e]) === false) {
  35184. return;
  35185. }
  35186. // Buffer any update calls so that renders do not occur
  35187. me._bufferedRender = true;
  35188. me._bufferedRequest = null;
  35189. var changed = me.handleEvent(e);
  35190. changed |= tooltip && tooltip.handleEvent(e);
  35191. plugins.notify(me, 'afterEvent', [e]);
  35192. var bufferedRequest = me._bufferedRequest;
  35193. if (bufferedRequest) {
  35194. // If we have an update that was triggered, we need to do a normal render
  35195. me.render(bufferedRequest.duration, bufferedRequest.lazy);
  35196. } else if (changed && !me.animating) {
  35197. // If entering, leaving, or changing elements, animate the change via pivot
  35198. me.stop();
  35199. // We only need to render at this point. Updating will cause scales to be
  35200. // recomputed generating flicker & using more memory than necessary.
  35201. me.render(me.options.hover.animationDuration, true);
  35202. }
  35203. me._bufferedRender = false;
  35204. me._bufferedRequest = null;
  35205. return me;
  35206. },
  35207. /**
  35208. * Handle an event
  35209. * @private
  35210. * @param {IEvent} event the event to handle
  35211. * @return {Boolean} true if the chart needs to re-render
  35212. */
  35213. handleEvent: function(e) {
  35214. var me = this;
  35215. var options = me.options || {};
  35216. var hoverOptions = options.hover;
  35217. var changed = false;
  35218. me.lastActive = me.lastActive || [];
  35219. // Find Active Elements for hover and tooltips
  35220. if (e.type === 'mouseout') {
  35221. me.active = [];
  35222. } else {
  35223. me.active = me.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions);
  35224. }
  35225. // On Hover hook
  35226. if (hoverOptions.onHover) {
  35227. // Need to call with native event here to not break backwards compatibility
  35228. hoverOptions.onHover.call(me, e.native, me.active);
  35229. }
  35230. if (e.type === 'mouseup' || e.type === 'click') {
  35231. if (options.onClick) {
  35232. // Use e.native here for backwards compatibility
  35233. options.onClick.call(me, e.native, me.active);
  35234. }
  35235. }
  35236. // Remove styling for last active (even if it may still be active)
  35237. if (me.lastActive.length) {
  35238. me.updateHoverStyle(me.lastActive, hoverOptions.mode, false);
  35239. }
  35240. // Built in hover styling
  35241. if (me.active.length && hoverOptions.mode) {
  35242. me.updateHoverStyle(me.active, hoverOptions.mode, true);
  35243. }
  35244. changed = !helpers.arrayEquals(me.active, me.lastActive);
  35245. // Remember Last Actives
  35246. me.lastActive = me.active;
  35247. return changed;
  35248. }
  35249. });
  35250. };
  35251. /***/ }),
  35252. /* 139 */
  35253. /***/ (function(module, exports, __webpack_require__) {
  35254. "use strict";
  35255. module.exports = function(Chart) {
  35256. var helpers = Chart.helpers;
  35257. var arrayEvents = ['push', 'pop', 'shift', 'splice', 'unshift'];
  35258. /**
  35259. * Hooks the array methods that add or remove values ('push', pop', 'shift', 'splice',
  35260. * 'unshift') and notify the listener AFTER the array has been altered. Listeners are
  35261. * called on the 'onData*' callbacks (e.g. onDataPush, etc.) with same arguments.
  35262. */
  35263. function listenArrayEvents(array, listener) {
  35264. if (array._chartjs) {
  35265. array._chartjs.listeners.push(listener);
  35266. return;
  35267. }
  35268. Object.defineProperty(array, '_chartjs', {
  35269. configurable: true,
  35270. enumerable: false,
  35271. value: {
  35272. listeners: [listener]
  35273. }
  35274. });
  35275. arrayEvents.forEach(function(key) {
  35276. var method = 'onData' + key.charAt(0).toUpperCase() + key.slice(1);
  35277. var base = array[key];
  35278. Object.defineProperty(array, key, {
  35279. configurable: true,
  35280. enumerable: false,
  35281. value: function() {
  35282. var args = Array.prototype.slice.call(arguments);
  35283. var res = base.apply(this, args);
  35284. helpers.each(array._chartjs.listeners, function(object) {
  35285. if (typeof object[method] === 'function') {
  35286. object[method].apply(object, args);
  35287. }
  35288. });
  35289. return res;
  35290. }
  35291. });
  35292. });
  35293. }
  35294. /**
  35295. * Removes the given array event listener and cleanup extra attached properties (such as
  35296. * the _chartjs stub and overridden methods) if array doesn't have any more listeners.
  35297. */
  35298. function unlistenArrayEvents(array, listener) {
  35299. var stub = array._chartjs;
  35300. if (!stub) {
  35301. return;
  35302. }
  35303. var listeners = stub.listeners;
  35304. var index = listeners.indexOf(listener);
  35305. if (index !== -1) {
  35306. listeners.splice(index, 1);
  35307. }
  35308. if (listeners.length > 0) {
  35309. return;
  35310. }
  35311. arrayEvents.forEach(function(key) {
  35312. delete array[key];
  35313. });
  35314. delete array._chartjs;
  35315. }
  35316. // Base class for all dataset controllers (line, bar, etc)
  35317. Chart.DatasetController = function(chart, datasetIndex) {
  35318. this.initialize(chart, datasetIndex);
  35319. };
  35320. helpers.extend(Chart.DatasetController.prototype, {
  35321. /**
  35322. * Element type used to generate a meta dataset (e.g. Chart.element.Line).
  35323. * @type {Chart.core.element}
  35324. */
  35325. datasetElementType: null,
  35326. /**
  35327. * Element type used to generate a meta data (e.g. Chart.element.Point).
  35328. * @type {Chart.core.element}
  35329. */
  35330. dataElementType: null,
  35331. initialize: function(chart, datasetIndex) {
  35332. var me = this;
  35333. me.chart = chart;
  35334. me.index = datasetIndex;
  35335. me.linkScales();
  35336. me.addElements();
  35337. },
  35338. updateIndex: function(datasetIndex) {
  35339. this.index = datasetIndex;
  35340. },
  35341. linkScales: function() {
  35342. var me = this;
  35343. var meta = me.getMeta();
  35344. var dataset = me.getDataset();
  35345. if (meta.xAxisID === null) {
  35346. meta.xAxisID = dataset.xAxisID || me.chart.options.scales.xAxes[0].id;
  35347. }
  35348. if (meta.yAxisID === null) {
  35349. meta.yAxisID = dataset.yAxisID || me.chart.options.scales.yAxes[0].id;
  35350. }
  35351. },
  35352. getDataset: function() {
  35353. return this.chart.data.datasets[this.index];
  35354. },
  35355. getMeta: function() {
  35356. return this.chart.getDatasetMeta(this.index);
  35357. },
  35358. getScaleForId: function(scaleID) {
  35359. return this.chart.scales[scaleID];
  35360. },
  35361. reset: function() {
  35362. this.update(true);
  35363. },
  35364. /**
  35365. * @private
  35366. */
  35367. destroy: function() {
  35368. if (this._data) {
  35369. unlistenArrayEvents(this._data, this);
  35370. }
  35371. },
  35372. createMetaDataset: function() {
  35373. var me = this;
  35374. var type = me.datasetElementType;
  35375. return type && new type({
  35376. _chart: me.chart.chart,
  35377. _datasetIndex: me.index
  35378. });
  35379. },
  35380. createMetaData: function(index) {
  35381. var me = this;
  35382. var type = me.dataElementType;
  35383. return type && new type({
  35384. _chart: me.chart.chart,
  35385. _datasetIndex: me.index,
  35386. _index: index
  35387. });
  35388. },
  35389. addElements: function() {
  35390. var me = this;
  35391. var meta = me.getMeta();
  35392. var data = me.getDataset().data || [];
  35393. var metaData = meta.data;
  35394. var i, ilen;
  35395. for (i=0, ilen=data.length; i<ilen; ++i) {
  35396. metaData[i] = metaData[i] || me.createMetaData(i);
  35397. }
  35398. meta.dataset = meta.dataset || me.createMetaDataset();
  35399. },
  35400. addElementAndReset: function(index) {
  35401. var element = this.createMetaData(index);
  35402. this.getMeta().data.splice(index, 0, element);
  35403. this.updateElement(element, index, true);
  35404. },
  35405. buildOrUpdateElements: function() {
  35406. var me = this;
  35407. var dataset = me.getDataset();
  35408. var data = dataset.data || (dataset.data = []);
  35409. // In order to correctly handle data addition/deletion animation (an thus simulate
  35410. // real-time charts), we need to monitor these data modifications and synchronize
  35411. // the internal meta data accordingly.
  35412. if (me._data !== data) {
  35413. if (me._data) {
  35414. // This case happens when the user replaced the data array instance.
  35415. unlistenArrayEvents(me._data, me);
  35416. }
  35417. listenArrayEvents(data, me);
  35418. me._data = data;
  35419. }
  35420. // Re-sync meta data in case the user replaced the data array or if we missed
  35421. // any updates and so make sure that we handle number of datapoints changing.
  35422. me.resyncElements();
  35423. },
  35424. update: helpers.noop,
  35425. draw: function(ease) {
  35426. var easingDecimal = ease || 1;
  35427. var i, len;
  35428. var metaData = this.getMeta().data;
  35429. for (i = 0, len = metaData.length; i < len; ++i) {
  35430. metaData[i].transition(easingDecimal).draw();
  35431. }
  35432. },
  35433. removeHoverStyle: function(element, elementOpts) {
  35434. var dataset = this.chart.data.datasets[element._datasetIndex],
  35435. index = element._index,
  35436. custom = element.custom || {},
  35437. valueOrDefault = helpers.getValueAtIndexOrDefault,
  35438. model = element._model;
  35439. model.backgroundColor = custom.backgroundColor ? custom.backgroundColor : valueOrDefault(dataset.backgroundColor, index, elementOpts.backgroundColor);
  35440. model.borderColor = custom.borderColor ? custom.borderColor : valueOrDefault(dataset.borderColor, index, elementOpts.borderColor);
  35441. model.borderWidth = custom.borderWidth ? custom.borderWidth : valueOrDefault(dataset.borderWidth, index, elementOpts.borderWidth);
  35442. },
  35443. setHoverStyle: function(element) {
  35444. var dataset = this.chart.data.datasets[element._datasetIndex],
  35445. index = element._index,
  35446. custom = element.custom || {},
  35447. valueOrDefault = helpers.getValueAtIndexOrDefault,
  35448. getHoverColor = helpers.getHoverColor,
  35449. model = element._model;
  35450. model.backgroundColor = custom.hoverBackgroundColor ? custom.hoverBackgroundColor : valueOrDefault(dataset.hoverBackgroundColor, index, getHoverColor(model.backgroundColor));
  35451. model.borderColor = custom.hoverBorderColor ? custom.hoverBorderColor : valueOrDefault(dataset.hoverBorderColor, index, getHoverColor(model.borderColor));
  35452. model.borderWidth = custom.hoverBorderWidth ? custom.hoverBorderWidth : valueOrDefault(dataset.hoverBorderWidth, index, model.borderWidth);
  35453. },
  35454. /**
  35455. * @private
  35456. */
  35457. resyncElements: function() {
  35458. var me = this;
  35459. var meta = me.getMeta();
  35460. var data = me.getDataset().data;
  35461. var numMeta = meta.data.length;
  35462. var numData = data.length;
  35463. if (numData < numMeta) {
  35464. meta.data.splice(numData, numMeta - numData);
  35465. } else if (numData > numMeta) {
  35466. me.insertElements(numMeta, numData - numMeta);
  35467. }
  35468. },
  35469. /**
  35470. * @private
  35471. */
  35472. insertElements: function(start, count) {
  35473. for (var i=0; i<count; ++i) {
  35474. this.addElementAndReset(start + i);
  35475. }
  35476. },
  35477. /**
  35478. * @private
  35479. */
  35480. onDataPush: function() {
  35481. this.insertElements(this.getDataset().data.length-1, arguments.length);
  35482. },
  35483. /**
  35484. * @private
  35485. */
  35486. onDataPop: function() {
  35487. this.getMeta().data.pop();
  35488. },
  35489. /**
  35490. * @private
  35491. */
  35492. onDataShift: function() {
  35493. this.getMeta().data.shift();
  35494. },
  35495. /**
  35496. * @private
  35497. */
  35498. onDataSplice: function(start, count) {
  35499. this.getMeta().data.splice(start, count);
  35500. this.insertElements(start, arguments.length - 2);
  35501. },
  35502. /**
  35503. * @private
  35504. */
  35505. onDataUnshift: function() {
  35506. this.insertElements(0, arguments.length);
  35507. }
  35508. });
  35509. Chart.DatasetController.extend = helpers.inherits;
  35510. };
  35511. /***/ }),
  35512. /* 140 */
  35513. /***/ (function(module, exports, __webpack_require__) {
  35514. "use strict";
  35515. module.exports = function(Chart) {
  35516. var helpers = Chart.helpers;
  35517. Chart.elements = {};
  35518. Chart.Element = function(configuration) {
  35519. helpers.extend(this, configuration);
  35520. this.initialize.apply(this, arguments);
  35521. };
  35522. helpers.extend(Chart.Element.prototype, {
  35523. initialize: function() {
  35524. this.hidden = false;
  35525. },
  35526. pivot: function() {
  35527. var me = this;
  35528. if (!me._view) {
  35529. me._view = helpers.clone(me._model);
  35530. }
  35531. me._start = helpers.clone(me._view);
  35532. return me;
  35533. },
  35534. transition: function(ease) {
  35535. var me = this;
  35536. if (!me._view) {
  35537. me._view = helpers.clone(me._model);
  35538. }
  35539. // No animation -> No Transition
  35540. if (ease === 1) {
  35541. me._view = me._model;
  35542. me._start = null;
  35543. return me;
  35544. }
  35545. if (!me._start) {
  35546. me.pivot();
  35547. }
  35548. helpers.each(me._model, function(value, key) {
  35549. if (key[0] === '_') {
  35550. // Only non-underscored properties
  35551. // Init if doesn't exist
  35552. } else if (!me._view.hasOwnProperty(key)) {
  35553. if (typeof value === 'number' && !isNaN(me._view[key])) {
  35554. me._view[key] = value * ease;
  35555. } else {
  35556. me._view[key] = value;
  35557. }
  35558. // No unnecessary computations
  35559. } else if (value === me._view[key]) {
  35560. // It's the same! Woohoo!
  35561. // Color transitions if possible
  35562. } else if (typeof value === 'string') {
  35563. try {
  35564. var color = helpers.color(me._model[key]).mix(helpers.color(me._start[key]), ease);
  35565. me._view[key] = color.rgbString();
  35566. } catch (err) {
  35567. me._view[key] = value;
  35568. }
  35569. // Number transitions
  35570. } else if (typeof value === 'number') {
  35571. var startVal = me._start[key] !== undefined && isNaN(me._start[key]) === false ? me._start[key] : 0;
  35572. me._view[key] = ((me._model[key] - startVal) * ease) + startVal;
  35573. // Everything else
  35574. } else {
  35575. me._view[key] = value;
  35576. }
  35577. }, me);
  35578. return me;
  35579. },
  35580. tooltipPosition: function() {
  35581. return {
  35582. x: this._model.x,
  35583. y: this._model.y
  35584. };
  35585. },
  35586. hasValue: function() {
  35587. return helpers.isNumber(this._model.x) && helpers.isNumber(this._model.y);
  35588. }
  35589. });
  35590. Chart.Element.extend = helpers.inherits;
  35591. };
  35592. /***/ }),
  35593. /* 141 */
  35594. /***/ (function(module, exports, __webpack_require__) {
  35595. "use strict";
  35596. /* global window: false */
  35597. /* global document: false */
  35598. var color = __webpack_require__(165);
  35599. module.exports = function(Chart) {
  35600. // Global Chart helpers object for utility methods and classes
  35601. var helpers = Chart.helpers = {};
  35602. // -- Basic js utility methods
  35603. helpers.each = function(loopable, callback, self, reverse) {
  35604. // Check to see if null or undefined firstly.
  35605. var i, len;
  35606. if (helpers.isArray(loopable)) {
  35607. len = loopable.length;
  35608. if (reverse) {
  35609. for (i = len - 1; i >= 0; i--) {
  35610. callback.call(self, loopable[i], i);
  35611. }
  35612. } else {
  35613. for (i = 0; i < len; i++) {
  35614. callback.call(self, loopable[i], i);
  35615. }
  35616. }
  35617. } else if (typeof loopable === 'object') {
  35618. var keys = Object.keys(loopable);
  35619. len = keys.length;
  35620. for (i = 0; i < len; i++) {
  35621. callback.call(self, loopable[keys[i]], keys[i]);
  35622. }
  35623. }
  35624. };
  35625. helpers.clone = function(obj) {
  35626. var objClone = {};
  35627. helpers.each(obj, function(value, key) {
  35628. if (helpers.isArray(value)) {
  35629. objClone[key] = value.slice(0);
  35630. } else if (typeof value === 'object' && value !== null) {
  35631. objClone[key] = helpers.clone(value);
  35632. } else {
  35633. objClone[key] = value;
  35634. }
  35635. });
  35636. return objClone;
  35637. };
  35638. helpers.extend = function(base) {
  35639. var setFn = function(value, key) {
  35640. base[key] = value;
  35641. };
  35642. for (var i = 1, ilen = arguments.length; i < ilen; i++) {
  35643. helpers.each(arguments[i], setFn);
  35644. }
  35645. return base;
  35646. };
  35647. // Need a special merge function to chart configs since they are now grouped
  35648. helpers.configMerge = function(_base) {
  35649. var base = helpers.clone(_base);
  35650. helpers.each(Array.prototype.slice.call(arguments, 1), function(extension) {
  35651. helpers.each(extension, function(value, key) {
  35652. var baseHasProperty = base.hasOwnProperty(key);
  35653. var baseVal = baseHasProperty ? base[key] : {};
  35654. if (key === 'scales') {
  35655. // Scale config merging is complex. Add our own function here for that
  35656. base[key] = helpers.scaleMerge(baseVal, value);
  35657. } else if (key === 'scale') {
  35658. // Used in polar area & radar charts since there is only one scale
  35659. base[key] = helpers.configMerge(baseVal, Chart.scaleService.getScaleDefaults(value.type), value);
  35660. } else if (baseHasProperty
  35661. && typeof baseVal === 'object'
  35662. && !helpers.isArray(baseVal)
  35663. && baseVal !== null
  35664. && typeof value === 'object'
  35665. && !helpers.isArray(value)) {
  35666. // If we are overwriting an object with an object, do a merge of the properties.
  35667. base[key] = helpers.configMerge(baseVal, value);
  35668. } else {
  35669. // can just overwrite the value in this case
  35670. base[key] = value;
  35671. }
  35672. });
  35673. });
  35674. return base;
  35675. };
  35676. helpers.scaleMerge = function(_base, extension) {
  35677. var base = helpers.clone(_base);
  35678. helpers.each(extension, function(value, key) {
  35679. if (key === 'xAxes' || key === 'yAxes') {
  35680. // These properties are arrays of items
  35681. if (base.hasOwnProperty(key)) {
  35682. helpers.each(value, function(valueObj, index) {
  35683. var axisType = helpers.getValueOrDefault(valueObj.type, key === 'xAxes' ? 'category' : 'linear');
  35684. var axisDefaults = Chart.scaleService.getScaleDefaults(axisType);
  35685. if (index >= base[key].length || !base[key][index].type) {
  35686. base[key].push(helpers.configMerge(axisDefaults, valueObj));
  35687. } else if (valueObj.type && valueObj.type !== base[key][index].type) {
  35688. // Type changed. Bring in the new defaults before we bring in valueObj so that valueObj can override the correct scale defaults
  35689. base[key][index] = helpers.configMerge(base[key][index], axisDefaults, valueObj);
  35690. } else {
  35691. // Type is the same
  35692. base[key][index] = helpers.configMerge(base[key][index], valueObj);
  35693. }
  35694. });
  35695. } else {
  35696. base[key] = [];
  35697. helpers.each(value, function(valueObj) {
  35698. var axisType = helpers.getValueOrDefault(valueObj.type, key === 'xAxes' ? 'category' : 'linear');
  35699. base[key].push(helpers.configMerge(Chart.scaleService.getScaleDefaults(axisType), valueObj));
  35700. });
  35701. }
  35702. } else if (base.hasOwnProperty(key) && typeof base[key] === 'object' && base[key] !== null && typeof value === 'object') {
  35703. // If we are overwriting an object with an object, do a merge of the properties.
  35704. base[key] = helpers.configMerge(base[key], value);
  35705. } else {
  35706. // can just overwrite the value in this case
  35707. base[key] = value;
  35708. }
  35709. });
  35710. return base;
  35711. };
  35712. helpers.getValueAtIndexOrDefault = function(value, index, defaultValue) {
  35713. if (value === undefined || value === null) {
  35714. return defaultValue;
  35715. }
  35716. if (helpers.isArray(value)) {
  35717. return index < value.length ? value[index] : defaultValue;
  35718. }
  35719. return value;
  35720. };
  35721. helpers.getValueOrDefault = function(value, defaultValue) {
  35722. return value === undefined ? defaultValue : value;
  35723. };
  35724. helpers.indexOf = Array.prototype.indexOf?
  35725. function(array, item) {
  35726. return array.indexOf(item);
  35727. }:
  35728. function(array, item) {
  35729. for (var i = 0, ilen = array.length; i < ilen; ++i) {
  35730. if (array[i] === item) {
  35731. return i;
  35732. }
  35733. }
  35734. return -1;
  35735. };
  35736. helpers.where = function(collection, filterCallback) {
  35737. if (helpers.isArray(collection) && Array.prototype.filter) {
  35738. return collection.filter(filterCallback);
  35739. }
  35740. var filtered = [];
  35741. helpers.each(collection, function(item) {
  35742. if (filterCallback(item)) {
  35743. filtered.push(item);
  35744. }
  35745. });
  35746. return filtered;
  35747. };
  35748. helpers.findIndex = Array.prototype.findIndex?
  35749. function(array, callback, scope) {
  35750. return array.findIndex(callback, scope);
  35751. } :
  35752. function(array, callback, scope) {
  35753. scope = scope === undefined? array : scope;
  35754. for (var i = 0, ilen = array.length; i < ilen; ++i) {
  35755. if (callback.call(scope, array[i], i, array)) {
  35756. return i;
  35757. }
  35758. }
  35759. return -1;
  35760. };
  35761. helpers.findNextWhere = function(arrayToSearch, filterCallback, startIndex) {
  35762. // Default to start of the array
  35763. if (startIndex === undefined || startIndex === null) {
  35764. startIndex = -1;
  35765. }
  35766. for (var i = startIndex + 1; i < arrayToSearch.length; i++) {
  35767. var currentItem = arrayToSearch[i];
  35768. if (filterCallback(currentItem)) {
  35769. return currentItem;
  35770. }
  35771. }
  35772. };
  35773. helpers.findPreviousWhere = function(arrayToSearch, filterCallback, startIndex) {
  35774. // Default to end of the array
  35775. if (startIndex === undefined || startIndex === null) {
  35776. startIndex = arrayToSearch.length;
  35777. }
  35778. for (var i = startIndex - 1; i >= 0; i--) {
  35779. var currentItem = arrayToSearch[i];
  35780. if (filterCallback(currentItem)) {
  35781. return currentItem;
  35782. }
  35783. }
  35784. };
  35785. helpers.inherits = function(extensions) {
  35786. // Basic javascript inheritance based on the model created in Backbone.js
  35787. var me = this;
  35788. var ChartElement = (extensions && extensions.hasOwnProperty('constructor')) ? extensions.constructor : function() {
  35789. return me.apply(this, arguments);
  35790. };
  35791. var Surrogate = function() {
  35792. this.constructor = ChartElement;
  35793. };
  35794. Surrogate.prototype = me.prototype;
  35795. ChartElement.prototype = new Surrogate();
  35796. ChartElement.extend = helpers.inherits;
  35797. if (extensions) {
  35798. helpers.extend(ChartElement.prototype, extensions);
  35799. }
  35800. ChartElement.__super__ = me.prototype;
  35801. return ChartElement;
  35802. };
  35803. helpers.noop = function() {};
  35804. helpers.uid = (function() {
  35805. var id = 0;
  35806. return function() {
  35807. return id++;
  35808. };
  35809. }());
  35810. // -- Math methods
  35811. helpers.isNumber = function(n) {
  35812. return !isNaN(parseFloat(n)) && isFinite(n);
  35813. };
  35814. helpers.almostEquals = function(x, y, epsilon) {
  35815. return Math.abs(x - y) < epsilon;
  35816. };
  35817. helpers.almostWhole = function(x, epsilon) {
  35818. var rounded = Math.round(x);
  35819. return (((rounded - epsilon) < x) && ((rounded + epsilon) > x));
  35820. };
  35821. helpers.max = function(array) {
  35822. return array.reduce(function(max, value) {
  35823. if (!isNaN(value)) {
  35824. return Math.max(max, value);
  35825. }
  35826. return max;
  35827. }, Number.NEGATIVE_INFINITY);
  35828. };
  35829. helpers.min = function(array) {
  35830. return array.reduce(function(min, value) {
  35831. if (!isNaN(value)) {
  35832. return Math.min(min, value);
  35833. }
  35834. return min;
  35835. }, Number.POSITIVE_INFINITY);
  35836. };
  35837. helpers.sign = Math.sign?
  35838. function(x) {
  35839. return Math.sign(x);
  35840. } :
  35841. function(x) {
  35842. x = +x; // convert to a number
  35843. if (x === 0 || isNaN(x)) {
  35844. return x;
  35845. }
  35846. return x > 0 ? 1 : -1;
  35847. };
  35848. helpers.log10 = Math.log10?
  35849. function(x) {
  35850. return Math.log10(x);
  35851. } :
  35852. function(x) {
  35853. return Math.log(x) / Math.LN10;
  35854. };
  35855. helpers.toRadians = function(degrees) {
  35856. return degrees * (Math.PI / 180);
  35857. };
  35858. helpers.toDegrees = function(radians) {
  35859. return radians * (180 / Math.PI);
  35860. };
  35861. // Gets the angle from vertical upright to the point about a centre.
  35862. helpers.getAngleFromPoint = function(centrePoint, anglePoint) {
  35863. var distanceFromXCenter = anglePoint.x - centrePoint.x,
  35864. distanceFromYCenter = anglePoint.y - centrePoint.y,
  35865. radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);
  35866. var angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);
  35867. if (angle < (-0.5 * Math.PI)) {
  35868. angle += 2.0 * Math.PI; // make sure the returned angle is in the range of (-PI/2, 3PI/2]
  35869. }
  35870. return {
  35871. angle: angle,
  35872. distance: radialDistanceFromCenter
  35873. };
  35874. };
  35875. helpers.distanceBetweenPoints = function(pt1, pt2) {
  35876. return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));
  35877. };
  35878. helpers.aliasPixel = function(pixelWidth) {
  35879. return (pixelWidth % 2 === 0) ? 0 : 0.5;
  35880. };
  35881. helpers.splineCurve = function(firstPoint, middlePoint, afterPoint, t) {
  35882. // Props to Rob Spencer at scaled innovation for his post on splining between points
  35883. // http://scaledinnovation.com/analytics/splines/aboutSplines.html
  35884. // This function must also respect "skipped" points
  35885. var previous = firstPoint.skip ? middlePoint : firstPoint,
  35886. current = middlePoint,
  35887. next = afterPoint.skip ? middlePoint : afterPoint;
  35888. var d01 = Math.sqrt(Math.pow(current.x - previous.x, 2) + Math.pow(current.y - previous.y, 2));
  35889. var d12 = Math.sqrt(Math.pow(next.x - current.x, 2) + Math.pow(next.y - current.y, 2));
  35890. var s01 = d01 / (d01 + d12);
  35891. var s12 = d12 / (d01 + d12);
  35892. // If all points are the same, s01 & s02 will be inf
  35893. s01 = isNaN(s01) ? 0 : s01;
  35894. s12 = isNaN(s12) ? 0 : s12;
  35895. var fa = t * s01; // scaling factor for triangle Ta
  35896. var fb = t * s12;
  35897. return {
  35898. previous: {
  35899. x: current.x - fa * (next.x - previous.x),
  35900. y: current.y - fa * (next.y - previous.y)
  35901. },
  35902. next: {
  35903. x: current.x + fb * (next.x - previous.x),
  35904. y: current.y + fb * (next.y - previous.y)
  35905. }
  35906. };
  35907. };
  35908. helpers.EPSILON = Number.EPSILON || 1e-14;
  35909. helpers.splineCurveMonotone = function(points) {
  35910. // This function calculates Bézier control points in a similar way than |splineCurve|,
  35911. // but preserves monotonicity of the provided data and ensures no local extremums are added
  35912. // between the dataset discrete points due to the interpolation.
  35913. // See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation
  35914. var pointsWithTangents = (points || []).map(function(point) {
  35915. return {
  35916. model: point._model,
  35917. deltaK: 0,
  35918. mK: 0
  35919. };
  35920. });
  35921. // Calculate slopes (deltaK) and initialize tangents (mK)
  35922. var pointsLen = pointsWithTangents.length;
  35923. var i, pointBefore, pointCurrent, pointAfter;
  35924. for (i = 0; i < pointsLen; ++i) {
  35925. pointCurrent = pointsWithTangents[i];
  35926. if (pointCurrent.model.skip) {
  35927. continue;
  35928. }
  35929. pointBefore = i > 0 ? pointsWithTangents[i - 1] : null;
  35930. pointAfter = i < pointsLen - 1 ? pointsWithTangents[i + 1] : null;
  35931. if (pointAfter && !pointAfter.model.skip) {
  35932. var slopeDeltaX = (pointAfter.model.x - pointCurrent.model.x);
  35933. // In the case of two points that appear at the same x pixel, slopeDeltaX is 0
  35934. pointCurrent.deltaK = slopeDeltaX !== 0 ? (pointAfter.model.y - pointCurrent.model.y) / slopeDeltaX : 0;
  35935. }
  35936. if (!pointBefore || pointBefore.model.skip) {
  35937. pointCurrent.mK = pointCurrent.deltaK;
  35938. } else if (!pointAfter || pointAfter.model.skip) {
  35939. pointCurrent.mK = pointBefore.deltaK;
  35940. } else if (this.sign(pointBefore.deltaK) !== this.sign(pointCurrent.deltaK)) {
  35941. pointCurrent.mK = 0;
  35942. } else {
  35943. pointCurrent.mK = (pointBefore.deltaK + pointCurrent.deltaK) / 2;
  35944. }
  35945. }
  35946. // Adjust tangents to ensure monotonic properties
  35947. var alphaK, betaK, tauK, squaredMagnitude;
  35948. for (i = 0; i < pointsLen - 1; ++i) {
  35949. pointCurrent = pointsWithTangents[i];
  35950. pointAfter = pointsWithTangents[i + 1];
  35951. if (pointCurrent.model.skip || pointAfter.model.skip) {
  35952. continue;
  35953. }
  35954. if (helpers.almostEquals(pointCurrent.deltaK, 0, this.EPSILON)) {
  35955. pointCurrent.mK = pointAfter.mK = 0;
  35956. continue;
  35957. }
  35958. alphaK = pointCurrent.mK / pointCurrent.deltaK;
  35959. betaK = pointAfter.mK / pointCurrent.deltaK;
  35960. squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);
  35961. if (squaredMagnitude <= 9) {
  35962. continue;
  35963. }
  35964. tauK = 3 / Math.sqrt(squaredMagnitude);
  35965. pointCurrent.mK = alphaK * tauK * pointCurrent.deltaK;
  35966. pointAfter.mK = betaK * tauK * pointCurrent.deltaK;
  35967. }
  35968. // Compute control points
  35969. var deltaX;
  35970. for (i = 0; i < pointsLen; ++i) {
  35971. pointCurrent = pointsWithTangents[i];
  35972. if (pointCurrent.model.skip) {
  35973. continue;
  35974. }
  35975. pointBefore = i > 0 ? pointsWithTangents[i - 1] : null;
  35976. pointAfter = i < pointsLen - 1 ? pointsWithTangents[i + 1] : null;
  35977. if (pointBefore && !pointBefore.model.skip) {
  35978. deltaX = (pointCurrent.model.x - pointBefore.model.x) / 3;
  35979. pointCurrent.model.controlPointPreviousX = pointCurrent.model.x - deltaX;
  35980. pointCurrent.model.controlPointPreviousY = pointCurrent.model.y - deltaX * pointCurrent.mK;
  35981. }
  35982. if (pointAfter && !pointAfter.model.skip) {
  35983. deltaX = (pointAfter.model.x - pointCurrent.model.x) / 3;
  35984. pointCurrent.model.controlPointNextX = pointCurrent.model.x + deltaX;
  35985. pointCurrent.model.controlPointNextY = pointCurrent.model.y + deltaX * pointCurrent.mK;
  35986. }
  35987. }
  35988. };
  35989. helpers.nextItem = function(collection, index, loop) {
  35990. if (loop) {
  35991. return index >= collection.length - 1 ? collection[0] : collection[index + 1];
  35992. }
  35993. return index >= collection.length - 1 ? collection[collection.length - 1] : collection[index + 1];
  35994. };
  35995. helpers.previousItem = function(collection, index, loop) {
  35996. if (loop) {
  35997. return index <= 0 ? collection[collection.length - 1] : collection[index - 1];
  35998. }
  35999. return index <= 0 ? collection[0] : collection[index - 1];
  36000. };
  36001. // Implementation of the nice number algorithm used in determining where axis labels will go
  36002. helpers.niceNum = function(range, round) {
  36003. var exponent = Math.floor(helpers.log10(range));
  36004. var fraction = range / Math.pow(10, exponent);
  36005. var niceFraction;
  36006. if (round) {
  36007. if (fraction < 1.5) {
  36008. niceFraction = 1;
  36009. } else if (fraction < 3) {
  36010. niceFraction = 2;
  36011. } else if (fraction < 7) {
  36012. niceFraction = 5;
  36013. } else {
  36014. niceFraction = 10;
  36015. }
  36016. } else if (fraction <= 1.0) {
  36017. niceFraction = 1;
  36018. } else if (fraction <= 2) {
  36019. niceFraction = 2;
  36020. } else if (fraction <= 5) {
  36021. niceFraction = 5;
  36022. } else {
  36023. niceFraction = 10;
  36024. }
  36025. return niceFraction * Math.pow(10, exponent);
  36026. };
  36027. // Easing functions adapted from Robert Penner's easing equations
  36028. // http://www.robertpenner.com/easing/
  36029. var easingEffects = helpers.easingEffects = {
  36030. linear: function(t) {
  36031. return t;
  36032. },
  36033. easeInQuad: function(t) {
  36034. return t * t;
  36035. },
  36036. easeOutQuad: function(t) {
  36037. return -1 * t * (t - 2);
  36038. },
  36039. easeInOutQuad: function(t) {
  36040. if ((t /= 1 / 2) < 1) {
  36041. return 1 / 2 * t * t;
  36042. }
  36043. return -1 / 2 * ((--t) * (t - 2) - 1);
  36044. },
  36045. easeInCubic: function(t) {
  36046. return t * t * t;
  36047. },
  36048. easeOutCubic: function(t) {
  36049. return 1 * ((t = t / 1 - 1) * t * t + 1);
  36050. },
  36051. easeInOutCubic: function(t) {
  36052. if ((t /= 1 / 2) < 1) {
  36053. return 1 / 2 * t * t * t;
  36054. }
  36055. return 1 / 2 * ((t -= 2) * t * t + 2);
  36056. },
  36057. easeInQuart: function(t) {
  36058. return t * t * t * t;
  36059. },
  36060. easeOutQuart: function(t) {
  36061. return -1 * ((t = t / 1 - 1) * t * t * t - 1);
  36062. },
  36063. easeInOutQuart: function(t) {
  36064. if ((t /= 1 / 2) < 1) {
  36065. return 1 / 2 * t * t * t * t;
  36066. }
  36067. return -1 / 2 * ((t -= 2) * t * t * t - 2);
  36068. },
  36069. easeInQuint: function(t) {
  36070. return 1 * (t /= 1) * t * t * t * t;
  36071. },
  36072. easeOutQuint: function(t) {
  36073. return 1 * ((t = t / 1 - 1) * t * t * t * t + 1);
  36074. },
  36075. easeInOutQuint: function(t) {
  36076. if ((t /= 1 / 2) < 1) {
  36077. return 1 / 2 * t * t * t * t * t;
  36078. }
  36079. return 1 / 2 * ((t -= 2) * t * t * t * t + 2);
  36080. },
  36081. easeInSine: function(t) {
  36082. return -1 * Math.cos(t / 1 * (Math.PI / 2)) + 1;
  36083. },
  36084. easeOutSine: function(t) {
  36085. return 1 * Math.sin(t / 1 * (Math.PI / 2));
  36086. },
  36087. easeInOutSine: function(t) {
  36088. return -1 / 2 * (Math.cos(Math.PI * t / 1) - 1);
  36089. },
  36090. easeInExpo: function(t) {
  36091. return (t === 0) ? 1 : 1 * Math.pow(2, 10 * (t / 1 - 1));
  36092. },
  36093. easeOutExpo: function(t) {
  36094. return (t === 1) ? 1 : 1 * (-Math.pow(2, -10 * t / 1) + 1);
  36095. },
  36096. easeInOutExpo: function(t) {
  36097. if (t === 0) {
  36098. return 0;
  36099. }
  36100. if (t === 1) {
  36101. return 1;
  36102. }
  36103. if ((t /= 1 / 2) < 1) {
  36104. return 1 / 2 * Math.pow(2, 10 * (t - 1));
  36105. }
  36106. return 1 / 2 * (-Math.pow(2, -10 * --t) + 2);
  36107. },
  36108. easeInCirc: function(t) {
  36109. if (t >= 1) {
  36110. return t;
  36111. }
  36112. return -1 * (Math.sqrt(1 - (t /= 1) * t) - 1);
  36113. },
  36114. easeOutCirc: function(t) {
  36115. return 1 * Math.sqrt(1 - (t = t / 1 - 1) * t);
  36116. },
  36117. easeInOutCirc: function(t) {
  36118. if ((t /= 1 / 2) < 1) {
  36119. return -1 / 2 * (Math.sqrt(1 - t * t) - 1);
  36120. }
  36121. return 1 / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1);
  36122. },
  36123. easeInElastic: function(t) {
  36124. var s = 1.70158;
  36125. var p = 0;
  36126. var a = 1;
  36127. if (t === 0) {
  36128. return 0;
  36129. }
  36130. if ((t /= 1) === 1) {
  36131. return 1;
  36132. }
  36133. if (!p) {
  36134. p = 1 * 0.3;
  36135. }
  36136. if (a < Math.abs(1)) {
  36137. a = 1;
  36138. s = p / 4;
  36139. } else {
  36140. s = p / (2 * Math.PI) * Math.asin(1 / a);
  36141. }
  36142. return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * 1 - s) * (2 * Math.PI) / p));
  36143. },
  36144. easeOutElastic: function(t) {
  36145. var s = 1.70158;
  36146. var p = 0;
  36147. var a = 1;
  36148. if (t === 0) {
  36149. return 0;
  36150. }
  36151. if ((t /= 1) === 1) {
  36152. return 1;
  36153. }
  36154. if (!p) {
  36155. p = 1 * 0.3;
  36156. }
  36157. if (a < Math.abs(1)) {
  36158. a = 1;
  36159. s = p / 4;
  36160. } else {
  36161. s = p / (2 * Math.PI) * Math.asin(1 / a);
  36162. }
  36163. return a * Math.pow(2, -10 * t) * Math.sin((t * 1 - s) * (2 * Math.PI) / p) + 1;
  36164. },
  36165. easeInOutElastic: function(t) {
  36166. var s = 1.70158;
  36167. var p = 0;
  36168. var a = 1;
  36169. if (t === 0) {
  36170. return 0;
  36171. }
  36172. if ((t /= 1 / 2) === 2) {
  36173. return 1;
  36174. }
  36175. if (!p) {
  36176. p = 1 * (0.3 * 1.5);
  36177. }
  36178. if (a < Math.abs(1)) {
  36179. a = 1;
  36180. s = p / 4;
  36181. } else {
  36182. s = p / (2 * Math.PI) * Math.asin(1 / a);
  36183. }
  36184. if (t < 1) {
  36185. return -0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * 1 - s) * (2 * Math.PI) / p));
  36186. }
  36187. return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * 1 - s) * (2 * Math.PI) / p) * 0.5 + 1;
  36188. },
  36189. easeInBack: function(t) {
  36190. var s = 1.70158;
  36191. return 1 * (t /= 1) * t * ((s + 1) * t - s);
  36192. },
  36193. easeOutBack: function(t) {
  36194. var s = 1.70158;
  36195. return 1 * ((t = t / 1 - 1) * t * ((s + 1) * t + s) + 1);
  36196. },
  36197. easeInOutBack: function(t) {
  36198. var s = 1.70158;
  36199. if ((t /= 1 / 2) < 1) {
  36200. return 1 / 2 * (t * t * (((s *= (1.525)) + 1) * t - s));
  36201. }
  36202. return 1 / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2);
  36203. },
  36204. easeInBounce: function(t) {
  36205. return 1 - easingEffects.easeOutBounce(1 - t);
  36206. },
  36207. easeOutBounce: function(t) {
  36208. if ((t /= 1) < (1 / 2.75)) {
  36209. return 1 * (7.5625 * t * t);
  36210. } else if (t < (2 / 2.75)) {
  36211. return 1 * (7.5625 * (t -= (1.5 / 2.75)) * t + 0.75);
  36212. } else if (t < (2.5 / 2.75)) {
  36213. return 1 * (7.5625 * (t -= (2.25 / 2.75)) * t + 0.9375);
  36214. }
  36215. return 1 * (7.5625 * (t -= (2.625 / 2.75)) * t + 0.984375);
  36216. },
  36217. easeInOutBounce: function(t) {
  36218. if (t < 1 / 2) {
  36219. return easingEffects.easeInBounce(t * 2) * 0.5;
  36220. }
  36221. return easingEffects.easeOutBounce(t * 2 - 1) * 0.5 + 1 * 0.5;
  36222. }
  36223. };
  36224. // Request animation polyfill - http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/
  36225. helpers.requestAnimFrame = (function() {
  36226. return window.requestAnimationFrame ||
  36227. window.webkitRequestAnimationFrame ||
  36228. window.mozRequestAnimationFrame ||
  36229. window.oRequestAnimationFrame ||
  36230. window.msRequestAnimationFrame ||
  36231. function(callback) {
  36232. return window.setTimeout(callback, 1000 / 60);
  36233. };
  36234. }());
  36235. // -- DOM methods
  36236. helpers.getRelativePosition = function(evt, chart) {
  36237. var mouseX, mouseY;
  36238. var e = evt.originalEvent || evt,
  36239. canvas = evt.currentTarget || evt.srcElement,
  36240. boundingRect = canvas.getBoundingClientRect();
  36241. var touches = e.touches;
  36242. if (touches && touches.length > 0) {
  36243. mouseX = touches[0].clientX;
  36244. mouseY = touches[0].clientY;
  36245. } else {
  36246. mouseX = e.clientX;
  36247. mouseY = e.clientY;
  36248. }
  36249. // Scale mouse coordinates into canvas coordinates
  36250. // by following the pattern laid out by 'jerryj' in the comments of
  36251. // http://www.html5canvastutorials.com/advanced/html5-canvas-mouse-coordinates/
  36252. var paddingLeft = parseFloat(helpers.getStyle(canvas, 'padding-left'));
  36253. var paddingTop = parseFloat(helpers.getStyle(canvas, 'padding-top'));
  36254. var paddingRight = parseFloat(helpers.getStyle(canvas, 'padding-right'));
  36255. var paddingBottom = parseFloat(helpers.getStyle(canvas, 'padding-bottom'));
  36256. var width = boundingRect.right - boundingRect.left - paddingLeft - paddingRight;
  36257. var height = boundingRect.bottom - boundingRect.top - paddingTop - paddingBottom;
  36258. // We divide by the current device pixel ratio, because the canvas is scaled up by that amount in each direction. However
  36259. // the backend model is in unscaled coordinates. Since we are going to deal with our model coordinates, we go back here
  36260. mouseX = Math.round((mouseX - boundingRect.left - paddingLeft) / (width) * canvas.width / chart.currentDevicePixelRatio);
  36261. mouseY = Math.round((mouseY - boundingRect.top - paddingTop) / (height) * canvas.height / chart.currentDevicePixelRatio);
  36262. return {
  36263. x: mouseX,
  36264. y: mouseY
  36265. };
  36266. };
  36267. helpers.addEvent = function(node, eventType, method) {
  36268. if (node.addEventListener) {
  36269. node.addEventListener(eventType, method);
  36270. } else if (node.attachEvent) {
  36271. node.attachEvent('on' + eventType, method);
  36272. } else {
  36273. node['on' + eventType] = method;
  36274. }
  36275. };
  36276. helpers.removeEvent = function(node, eventType, handler) {
  36277. if (node.removeEventListener) {
  36278. node.removeEventListener(eventType, handler, false);
  36279. } else if (node.detachEvent) {
  36280. node.detachEvent('on' + eventType, handler);
  36281. } else {
  36282. node['on' + eventType] = helpers.noop;
  36283. }
  36284. };
  36285. // Private helper function to convert max-width/max-height values that may be percentages into a number
  36286. function parseMaxStyle(styleValue, node, parentProperty) {
  36287. var valueInPixels;
  36288. if (typeof(styleValue) === 'string') {
  36289. valueInPixels = parseInt(styleValue, 10);
  36290. if (styleValue.indexOf('%') !== -1) {
  36291. // percentage * size in dimension
  36292. valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];
  36293. }
  36294. } else {
  36295. valueInPixels = styleValue;
  36296. }
  36297. return valueInPixels;
  36298. }
  36299. /**
  36300. * Returns if the given value contains an effective constraint.
  36301. * @private
  36302. */
  36303. function isConstrainedValue(value) {
  36304. return value !== undefined && value !== null && value !== 'none';
  36305. }
  36306. // Private helper to get a constraint dimension
  36307. // @param domNode : the node to check the constraint on
  36308. // @param maxStyle : the style that defines the maximum for the direction we are using (maxWidth / maxHeight)
  36309. // @param percentageProperty : property of parent to use when calculating width as a percentage
  36310. // @see http://www.nathanaeljones.com/blog/2013/reading-max-width-cross-browser
  36311. function getConstraintDimension(domNode, maxStyle, percentageProperty) {
  36312. var view = document.defaultView;
  36313. var parentNode = domNode.parentNode;
  36314. var constrainedNode = view.getComputedStyle(domNode)[maxStyle];
  36315. var constrainedContainer = view.getComputedStyle(parentNode)[maxStyle];
  36316. var hasCNode = isConstrainedValue(constrainedNode);
  36317. var hasCContainer = isConstrainedValue(constrainedContainer);
  36318. var infinity = Number.POSITIVE_INFINITY;
  36319. if (hasCNode || hasCContainer) {
  36320. return Math.min(
  36321. hasCNode? parseMaxStyle(constrainedNode, domNode, percentageProperty) : infinity,
  36322. hasCContainer? parseMaxStyle(constrainedContainer, parentNode, percentageProperty) : infinity);
  36323. }
  36324. return 'none';
  36325. }
  36326. // returns Number or undefined if no constraint
  36327. helpers.getConstraintWidth = function(domNode) {
  36328. return getConstraintDimension(domNode, 'max-width', 'clientWidth');
  36329. };
  36330. // returns Number or undefined if no constraint
  36331. helpers.getConstraintHeight = function(domNode) {
  36332. return getConstraintDimension(domNode, 'max-height', 'clientHeight');
  36333. };
  36334. helpers.getMaximumWidth = function(domNode) {
  36335. var container = domNode.parentNode;
  36336. var paddingLeft = parseInt(helpers.getStyle(container, 'padding-left'), 10);
  36337. var paddingRight = parseInt(helpers.getStyle(container, 'padding-right'), 10);
  36338. var w = container.clientWidth - paddingLeft - paddingRight;
  36339. var cw = helpers.getConstraintWidth(domNode);
  36340. return isNaN(cw)? w : Math.min(w, cw);
  36341. };
  36342. helpers.getMaximumHeight = function(domNode) {
  36343. var container = domNode.parentNode;
  36344. var paddingTop = parseInt(helpers.getStyle(container, 'padding-top'), 10);
  36345. var paddingBottom = parseInt(helpers.getStyle(container, 'padding-bottom'), 10);
  36346. var h = container.clientHeight - paddingTop - paddingBottom;
  36347. var ch = helpers.getConstraintHeight(domNode);
  36348. return isNaN(ch)? h : Math.min(h, ch);
  36349. };
  36350. helpers.getStyle = function(el, property) {
  36351. return el.currentStyle ?
  36352. el.currentStyle[property] :
  36353. document.defaultView.getComputedStyle(el, null).getPropertyValue(property);
  36354. };
  36355. helpers.retinaScale = function(chart) {
  36356. var pixelRatio = chart.currentDevicePixelRatio = window.devicePixelRatio || 1;
  36357. if (pixelRatio === 1) {
  36358. return;
  36359. }
  36360. var canvas = chart.canvas;
  36361. var height = chart.height;
  36362. var width = chart.width;
  36363. canvas.height = height * pixelRatio;
  36364. canvas.width = width * pixelRatio;
  36365. chart.ctx.scale(pixelRatio, pixelRatio);
  36366. // If no style has been set on the canvas, the render size is used as display size,
  36367. // making the chart visually bigger, so let's enforce it to the "correct" values.
  36368. // See https://github.com/chartjs/Chart.js/issues/3575
  36369. canvas.style.height = height + 'px';
  36370. canvas.style.width = width + 'px';
  36371. };
  36372. // -- Canvas methods
  36373. helpers.clear = function(chart) {
  36374. chart.ctx.clearRect(0, 0, chart.width, chart.height);
  36375. };
  36376. helpers.fontString = function(pixelSize, fontStyle, fontFamily) {
  36377. return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;
  36378. };
  36379. helpers.longestText = function(ctx, font, arrayOfThings, cache) {
  36380. cache = cache || {};
  36381. var data = cache.data = cache.data || {};
  36382. var gc = cache.garbageCollect = cache.garbageCollect || [];
  36383. if (cache.font !== font) {
  36384. data = cache.data = {};
  36385. gc = cache.garbageCollect = [];
  36386. cache.font = font;
  36387. }
  36388. ctx.font = font;
  36389. var longest = 0;
  36390. helpers.each(arrayOfThings, function(thing) {
  36391. // Undefined strings and arrays should not be measured
  36392. if (thing !== undefined && thing !== null && helpers.isArray(thing) !== true) {
  36393. longest = helpers.measureText(ctx, data, gc, longest, thing);
  36394. } else if (helpers.isArray(thing)) {
  36395. // if it is an array lets measure each element
  36396. // to do maybe simplify this function a bit so we can do this more recursively?
  36397. helpers.each(thing, function(nestedThing) {
  36398. // Undefined strings and arrays should not be measured
  36399. if (nestedThing !== undefined && nestedThing !== null && !helpers.isArray(nestedThing)) {
  36400. longest = helpers.measureText(ctx, data, gc, longest, nestedThing);
  36401. }
  36402. });
  36403. }
  36404. });
  36405. var gcLen = gc.length / 2;
  36406. if (gcLen > arrayOfThings.length) {
  36407. for (var i = 0; i < gcLen; i++) {
  36408. delete data[gc[i]];
  36409. }
  36410. gc.splice(0, gcLen);
  36411. }
  36412. return longest;
  36413. };
  36414. helpers.measureText = function(ctx, data, gc, longest, string) {
  36415. var textWidth = data[string];
  36416. if (!textWidth) {
  36417. textWidth = data[string] = ctx.measureText(string).width;
  36418. gc.push(string);
  36419. }
  36420. if (textWidth > longest) {
  36421. longest = textWidth;
  36422. }
  36423. return longest;
  36424. };
  36425. helpers.numberOfLabelLines = function(arrayOfThings) {
  36426. var numberOfLines = 1;
  36427. helpers.each(arrayOfThings, function(thing) {
  36428. if (helpers.isArray(thing)) {
  36429. if (thing.length > numberOfLines) {
  36430. numberOfLines = thing.length;
  36431. }
  36432. }
  36433. });
  36434. return numberOfLines;
  36435. };
  36436. helpers.drawRoundedRectangle = function(ctx, x, y, width, height, radius) {
  36437. ctx.beginPath();
  36438. ctx.moveTo(x + radius, y);
  36439. ctx.lineTo(x + width - radius, y);
  36440. ctx.quadraticCurveTo(x + width, y, x + width, y + radius);
  36441. ctx.lineTo(x + width, y + height - radius);
  36442. ctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);
  36443. ctx.lineTo(x + radius, y + height);
  36444. ctx.quadraticCurveTo(x, y + height, x, y + height - radius);
  36445. ctx.lineTo(x, y + radius);
  36446. ctx.quadraticCurveTo(x, y, x + radius, y);
  36447. ctx.closePath();
  36448. };
  36449. helpers.color = function(c) {
  36450. if (!color) {
  36451. console.error('Color.js not found!');
  36452. return c;
  36453. }
  36454. /* global CanvasGradient */
  36455. if (c instanceof CanvasGradient) {
  36456. return color(Chart.defaults.global.defaultColor);
  36457. }
  36458. return color(c);
  36459. };
  36460. helpers.isArray = Array.isArray?
  36461. function(obj) {
  36462. return Array.isArray(obj);
  36463. } :
  36464. function(obj) {
  36465. return Object.prototype.toString.call(obj) === '[object Array]';
  36466. };
  36467. // ! @see http://stackoverflow.com/a/14853974
  36468. helpers.arrayEquals = function(a0, a1) {
  36469. var i, ilen, v0, v1;
  36470. if (!a0 || !a1 || a0.length !== a1.length) {
  36471. return false;
  36472. }
  36473. for (i = 0, ilen=a0.length; i < ilen; ++i) {
  36474. v0 = a0[i];
  36475. v1 = a1[i];
  36476. if (v0 instanceof Array && v1 instanceof Array) {
  36477. if (!helpers.arrayEquals(v0, v1)) {
  36478. return false;
  36479. }
  36480. } else if (v0 !== v1) {
  36481. // NOTE: two different object instances will never be equal: {x:20} != {x:20}
  36482. return false;
  36483. }
  36484. }
  36485. return true;
  36486. };
  36487. helpers.callCallback = function(fn, args, _tArg) {
  36488. if (fn && typeof fn.call === 'function') {
  36489. fn.apply(_tArg, args);
  36490. }
  36491. };
  36492. helpers.getHoverColor = function(colorValue) {
  36493. /* global CanvasPattern */
  36494. return (colorValue instanceof CanvasPattern) ?
  36495. colorValue :
  36496. helpers.color(colorValue).saturate(0.5).darken(0.1).rgbString();
  36497. };
  36498. };
  36499. /***/ }),
  36500. /* 142 */
  36501. /***/ (function(module, exports, __webpack_require__) {
  36502. "use strict";
  36503. module.exports = function(Chart) {
  36504. var helpers = Chart.helpers;
  36505. /**
  36506. * Helper function to get relative position for an event
  36507. * @param {Event|IEvent} event - The event to get the position for
  36508. * @param {Chart} chart - The chart
  36509. * @returns {Point} the event position
  36510. */
  36511. function getRelativePosition(e, chart) {
  36512. if (e.native) {
  36513. return {
  36514. x: e.x,
  36515. y: e.y
  36516. };
  36517. }
  36518. return helpers.getRelativePosition(e, chart);
  36519. }
  36520. /**
  36521. * Helper function to traverse all of the visible elements in the chart
  36522. * @param chart {chart} the chart
  36523. * @param handler {Function} the callback to execute for each visible item
  36524. */
  36525. function parseVisibleItems(chart, handler) {
  36526. var datasets = chart.data.datasets;
  36527. var meta, i, j, ilen, jlen;
  36528. for (i = 0, ilen = datasets.length; i < ilen; ++i) {
  36529. if (!chart.isDatasetVisible(i)) {
  36530. continue;
  36531. }
  36532. meta = chart.getDatasetMeta(i);
  36533. for (j = 0, jlen = meta.data.length; j < jlen; ++j) {
  36534. var element = meta.data[j];
  36535. if (!element._view.skip) {
  36536. handler(element);
  36537. }
  36538. }
  36539. }
  36540. }
  36541. /**
  36542. * Helper function to get the items that intersect the event position
  36543. * @param items {ChartElement[]} elements to filter
  36544. * @param position {Point} the point to be nearest to
  36545. * @return {ChartElement[]} the nearest items
  36546. */
  36547. function getIntersectItems(chart, position) {
  36548. var elements = [];
  36549. parseVisibleItems(chart, function(element) {
  36550. if (element.inRange(position.x, position.y)) {
  36551. elements.push(element);
  36552. }
  36553. });
  36554. return elements;
  36555. }
  36556. /**
  36557. * Helper function to get the items nearest to the event position considering all visible items in teh chart
  36558. * @param chart {Chart} the chart to look at elements from
  36559. * @param position {Point} the point to be nearest to
  36560. * @param intersect {Boolean} if true, only consider items that intersect the position
  36561. * @param distanceMetric {Function} Optional function to provide the distance between
  36562. * @return {ChartElement[]} the nearest items
  36563. */
  36564. function getNearestItems(chart, position, intersect, distanceMetric) {
  36565. var minDistance = Number.POSITIVE_INFINITY;
  36566. var nearestItems = [];
  36567. if (!distanceMetric) {
  36568. distanceMetric = helpers.distanceBetweenPoints;
  36569. }
  36570. parseVisibleItems(chart, function(element) {
  36571. if (intersect && !element.inRange(position.x, position.y)) {
  36572. return;
  36573. }
  36574. var center = element.getCenterPoint();
  36575. var distance = distanceMetric(position, center);
  36576. if (distance < minDistance) {
  36577. nearestItems = [element];
  36578. minDistance = distance;
  36579. } else if (distance === minDistance) {
  36580. // Can have multiple items at the same distance in which case we sort by size
  36581. nearestItems.push(element);
  36582. }
  36583. });
  36584. return nearestItems;
  36585. }
  36586. function indexMode(chart, e, options) {
  36587. var position = getRelativePosition(e, chart.chart);
  36588. var distanceMetric = function(pt1, pt2) {
  36589. return Math.abs(pt1.x - pt2.x);
  36590. };
  36591. var items = options.intersect ? getIntersectItems(chart, position) : getNearestItems(chart, position, false, distanceMetric);
  36592. var elements = [];
  36593. if (!items.length) {
  36594. return [];
  36595. }
  36596. chart.data.datasets.forEach(function(dataset, datasetIndex) {
  36597. if (chart.isDatasetVisible(datasetIndex)) {
  36598. var meta = chart.getDatasetMeta(datasetIndex),
  36599. element = meta.data[items[0]._index];
  36600. // don't count items that are skipped (null data)
  36601. if (element && !element._view.skip) {
  36602. elements.push(element);
  36603. }
  36604. }
  36605. });
  36606. return elements;
  36607. }
  36608. /**
  36609. * @interface IInteractionOptions
  36610. */
  36611. /**
  36612. * If true, only consider items that intersect the point
  36613. * @name IInterfaceOptions#boolean
  36614. * @type Boolean
  36615. */
  36616. /**
  36617. * Contains interaction related functions
  36618. * @namespace Chart.Interaction
  36619. */
  36620. Chart.Interaction = {
  36621. // Helper function for different modes
  36622. modes: {
  36623. single: function(chart, e) {
  36624. var position = getRelativePosition(e, chart.chart);
  36625. var elements = [];
  36626. parseVisibleItems(chart, function(element) {
  36627. if (element.inRange(position.x, position.y)) {
  36628. elements.push(element);
  36629. return elements;
  36630. }
  36631. });
  36632. return elements.slice(0, 1);
  36633. },
  36634. /**
  36635. * @function Chart.Interaction.modes.label
  36636. * @deprecated since version 2.4.0
  36637. */
  36638. label: indexMode,
  36639. /**
  36640. * Returns items at the same index. If the options.intersect parameter is true, we only return items if we intersect something
  36641. * If the options.intersect mode is false, we find the nearest item and return the items at the same index as that item
  36642. * @function Chart.Interaction.modes.index
  36643. * @since v2.4.0
  36644. * @param chart {chart} the chart we are returning items from
  36645. * @param e {Event} the event we are find things at
  36646. * @param options {IInteractionOptions} options to use during interaction
  36647. * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned
  36648. */
  36649. index: indexMode,
  36650. /**
  36651. * Returns items in the same dataset. If the options.intersect parameter is true, we only return items if we intersect something
  36652. * If the options.intersect is false, we find the nearest item and return the items in that dataset
  36653. * @function Chart.Interaction.modes.dataset
  36654. * @param chart {chart} the chart we are returning items from
  36655. * @param e {Event} the event we are find things at
  36656. * @param options {IInteractionOptions} options to use during interaction
  36657. * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned
  36658. */
  36659. dataset: function(chart, e, options) {
  36660. var position = getRelativePosition(e, chart.chart);
  36661. var items = options.intersect ? getIntersectItems(chart, position) : getNearestItems(chart, position, false);
  36662. if (items.length > 0) {
  36663. items = chart.getDatasetMeta(items[0]._datasetIndex).data;
  36664. }
  36665. return items;
  36666. },
  36667. /**
  36668. * @function Chart.Interaction.modes.x-axis
  36669. * @deprecated since version 2.4.0. Use index mode and intersect == true
  36670. */
  36671. 'x-axis': function(chart, e) {
  36672. return indexMode(chart, e, true);
  36673. },
  36674. /**
  36675. * Point mode returns all elements that hit test based on the event position
  36676. * of the event
  36677. * @function Chart.Interaction.modes.intersect
  36678. * @param chart {chart} the chart we are returning items from
  36679. * @param e {Event} the event we are find things at
  36680. * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned
  36681. */
  36682. point: function(chart, e) {
  36683. var position = getRelativePosition(e, chart.chart);
  36684. return getIntersectItems(chart, position);
  36685. },
  36686. /**
  36687. * nearest mode returns the element closest to the point
  36688. * @function Chart.Interaction.modes.intersect
  36689. * @param chart {chart} the chart we are returning items from
  36690. * @param e {Event} the event we are find things at
  36691. * @param options {IInteractionOptions} options to use
  36692. * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned
  36693. */
  36694. nearest: function(chart, e, options) {
  36695. var position = getRelativePosition(e, chart.chart);
  36696. var nearestItems = getNearestItems(chart, position, options.intersect);
  36697. // We have multiple items at the same distance from the event. Now sort by smallest
  36698. if (nearestItems.length > 1) {
  36699. nearestItems.sort(function(a, b) {
  36700. var sizeA = a.getArea();
  36701. var sizeB = b.getArea();
  36702. var ret = sizeA - sizeB;
  36703. if (ret === 0) {
  36704. // if equal sort by dataset index
  36705. ret = a._datasetIndex - b._datasetIndex;
  36706. }
  36707. return ret;
  36708. });
  36709. }
  36710. // Return only 1 item
  36711. return nearestItems.slice(0, 1);
  36712. },
  36713. /**
  36714. * x mode returns the elements that hit-test at the current x coordinate
  36715. * @function Chart.Interaction.modes.x
  36716. * @param chart {chart} the chart we are returning items from
  36717. * @param e {Event} the event we are find things at
  36718. * @param options {IInteractionOptions} options to use
  36719. * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned
  36720. */
  36721. x: function(chart, e, options) {
  36722. var position = getRelativePosition(e, chart.chart);
  36723. var items = [];
  36724. var intersectsItem = false;
  36725. parseVisibleItems(chart, function(element) {
  36726. if (element.inXRange(position.x)) {
  36727. items.push(element);
  36728. }
  36729. if (element.inRange(position.x, position.y)) {
  36730. intersectsItem = true;
  36731. }
  36732. });
  36733. // If we want to trigger on an intersect and we don't have any items
  36734. // that intersect the position, return nothing
  36735. if (options.intersect && !intersectsItem) {
  36736. items = [];
  36737. }
  36738. return items;
  36739. },
  36740. /**
  36741. * y mode returns the elements that hit-test at the current y coordinate
  36742. * @function Chart.Interaction.modes.y
  36743. * @param chart {chart} the chart we are returning items from
  36744. * @param e {Event} the event we are find things at
  36745. * @param options {IInteractionOptions} options to use
  36746. * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned
  36747. */
  36748. y: function(chart, e, options) {
  36749. var position = getRelativePosition(e, chart.chart);
  36750. var items = [];
  36751. var intersectsItem = false;
  36752. parseVisibleItems(chart, function(element) {
  36753. if (element.inYRange(position.y)) {
  36754. items.push(element);
  36755. }
  36756. if (element.inRange(position.x, position.y)) {
  36757. intersectsItem = true;
  36758. }
  36759. });
  36760. // If we want to trigger on an intersect and we don't have any items
  36761. // that intersect the position, return nothing
  36762. if (options.intersect && !intersectsItem) {
  36763. items = [];
  36764. }
  36765. return items;
  36766. }
  36767. }
  36768. };
  36769. };
  36770. /***/ }),
  36771. /* 143 */
  36772. /***/ (function(module, exports, __webpack_require__) {
  36773. "use strict";
  36774. module.exports = function() {
  36775. // Occupy the global variable of Chart, and create a simple base class
  36776. var Chart = function(item, config) {
  36777. this.controller = new Chart.Controller(item, config, this);
  36778. return this.controller;
  36779. };
  36780. // Globally expose the defaults to allow for user updating/changing
  36781. Chart.defaults = {
  36782. global: {
  36783. responsive: true,
  36784. responsiveAnimationDuration: 0,
  36785. maintainAspectRatio: true,
  36786. events: ['mousemove', 'mouseout', 'click', 'touchstart', 'touchmove'],
  36787. hover: {
  36788. onHover: null,
  36789. mode: 'nearest',
  36790. intersect: true,
  36791. animationDuration: 400
  36792. },
  36793. onClick: null,
  36794. defaultColor: 'rgba(0,0,0,0.1)',
  36795. defaultFontColor: '#666',
  36796. defaultFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
  36797. defaultFontSize: 12,
  36798. defaultFontStyle: 'normal',
  36799. showLines: true,
  36800. // Element defaults defined in element extensions
  36801. elements: {},
  36802. // Legend callback string
  36803. legendCallback: function(chart) {
  36804. var text = [];
  36805. text.push('<ul class="' + chart.id + '-legend">');
  36806. for (var i = 0; i < chart.data.datasets.length; i++) {
  36807. text.push('<li><span style="background-color:' + chart.data.datasets[i].backgroundColor + '"></span>');
  36808. if (chart.data.datasets[i].label) {
  36809. text.push(chart.data.datasets[i].label);
  36810. }
  36811. text.push('</li>');
  36812. }
  36813. text.push('</ul>');
  36814. return text.join('');
  36815. }
  36816. }
  36817. };
  36818. Chart.Chart = Chart;
  36819. return Chart;
  36820. };
  36821. /***/ }),
  36822. /* 144 */
  36823. /***/ (function(module, exports, __webpack_require__) {
  36824. "use strict";
  36825. module.exports = function(Chart) {
  36826. var helpers = Chart.helpers;
  36827. // The layout service is very self explanatory. It's responsible for the layout within a chart.
  36828. // Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need
  36829. // It is this service's responsibility of carrying out that layout.
  36830. Chart.layoutService = {
  36831. defaults: {},
  36832. // Register a box to a chartInstance. A box is simply a reference to an object that requires layout. eg. Scales, Legend, Plugins.
  36833. addBox: function(chartInstance, box) {
  36834. if (!chartInstance.boxes) {
  36835. chartInstance.boxes = [];
  36836. }
  36837. chartInstance.boxes.push(box);
  36838. },
  36839. removeBox: function(chartInstance, box) {
  36840. if (!chartInstance.boxes) {
  36841. return;
  36842. }
  36843. chartInstance.boxes.splice(chartInstance.boxes.indexOf(box), 1);
  36844. },
  36845. // The most important function
  36846. update: function(chartInstance, width, height) {
  36847. if (!chartInstance) {
  36848. return;
  36849. }
  36850. var layoutOptions = chartInstance.options.layout;
  36851. var padding = layoutOptions ? layoutOptions.padding : null;
  36852. var leftPadding = 0;
  36853. var rightPadding = 0;
  36854. var topPadding = 0;
  36855. var bottomPadding = 0;
  36856. if (!isNaN(padding)) {
  36857. // options.layout.padding is a number. assign to all
  36858. leftPadding = padding;
  36859. rightPadding = padding;
  36860. topPadding = padding;
  36861. bottomPadding = padding;
  36862. } else {
  36863. leftPadding = padding.left || 0;
  36864. rightPadding = padding.right || 0;
  36865. topPadding = padding.top || 0;
  36866. bottomPadding = padding.bottom || 0;
  36867. }
  36868. var leftBoxes = helpers.where(chartInstance.boxes, function(box) {
  36869. return box.options.position === 'left';
  36870. });
  36871. var rightBoxes = helpers.where(chartInstance.boxes, function(box) {
  36872. return box.options.position === 'right';
  36873. });
  36874. var topBoxes = helpers.where(chartInstance.boxes, function(box) {
  36875. return box.options.position === 'top';
  36876. });
  36877. var bottomBoxes = helpers.where(chartInstance.boxes, function(box) {
  36878. return box.options.position === 'bottom';
  36879. });
  36880. // Boxes that overlay the chartarea such as the radialLinear scale
  36881. var chartAreaBoxes = helpers.where(chartInstance.boxes, function(box) {
  36882. return box.options.position === 'chartArea';
  36883. });
  36884. // Ensure that full width boxes are at the very top / bottom
  36885. topBoxes.sort(function(a, b) {
  36886. return (b.options.fullWidth ? 1 : 0) - (a.options.fullWidth ? 1 : 0);
  36887. });
  36888. bottomBoxes.sort(function(a, b) {
  36889. return (a.options.fullWidth ? 1 : 0) - (b.options.fullWidth ? 1 : 0);
  36890. });
  36891. // Essentially we now have any number of boxes on each of the 4 sides.
  36892. // Our canvas looks like the following.
  36893. // The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and
  36894. // B1 is the bottom axis
  36895. // There are also 4 quadrant-like locations (left to right instead of clockwise) reserved for chart overlays
  36896. // These locations are single-box locations only, when trying to register a chartArea location that is already taken,
  36897. // an error will be thrown.
  36898. //
  36899. // |----------------------------------------------------|
  36900. // | T1 (Full Width) |
  36901. // |----------------------------------------------------|
  36902. // | | | T2 | |
  36903. // | |----|-------------------------------------|----|
  36904. // | | | C1 | | C2 | |
  36905. // | | |----| |----| |
  36906. // | | | | |
  36907. // | L1 | L2 | ChartArea (C0) | R1 |
  36908. // | | | | |
  36909. // | | |----| |----| |
  36910. // | | | C3 | | C4 | |
  36911. // | |----|-------------------------------------|----|
  36912. // | | | B1 | |
  36913. // |----------------------------------------------------|
  36914. // | B2 (Full Width) |
  36915. // |----------------------------------------------------|
  36916. //
  36917. // What we do to find the best sizing, we do the following
  36918. // 1. Determine the minimum size of the chart area.
  36919. // 2. Split the remaining width equally between each vertical axis
  36920. // 3. Split the remaining height equally between each horizontal axis
  36921. // 4. Give each layout the maximum size it can be. The layout will return it's minimum size
  36922. // 5. Adjust the sizes of each axis based on it's minimum reported size.
  36923. // 6. Refit each axis
  36924. // 7. Position each axis in the final location
  36925. // 8. Tell the chart the final location of the chart area
  36926. // 9. Tell any axes that overlay the chart area the positions of the chart area
  36927. // Step 1
  36928. var chartWidth = width - leftPadding - rightPadding;
  36929. var chartHeight = height - topPadding - bottomPadding;
  36930. var chartAreaWidth = chartWidth / 2; // min 50%
  36931. var chartAreaHeight = chartHeight / 2; // min 50%
  36932. // Step 2
  36933. var verticalBoxWidth = (width - chartAreaWidth) / (leftBoxes.length + rightBoxes.length);
  36934. // Step 3
  36935. var horizontalBoxHeight = (height - chartAreaHeight) / (topBoxes.length + bottomBoxes.length);
  36936. // Step 4
  36937. var maxChartAreaWidth = chartWidth;
  36938. var maxChartAreaHeight = chartHeight;
  36939. var minBoxSizes = [];
  36940. function getMinimumBoxSize(box) {
  36941. var minSize;
  36942. var isHorizontal = box.isHorizontal();
  36943. if (isHorizontal) {
  36944. minSize = box.update(box.options.fullWidth ? chartWidth : maxChartAreaWidth, horizontalBoxHeight);
  36945. maxChartAreaHeight -= minSize.height;
  36946. } else {
  36947. minSize = box.update(verticalBoxWidth, chartAreaHeight);
  36948. maxChartAreaWidth -= minSize.width;
  36949. }
  36950. minBoxSizes.push({
  36951. horizontal: isHorizontal,
  36952. minSize: minSize,
  36953. box: box,
  36954. });
  36955. }
  36956. helpers.each(leftBoxes.concat(rightBoxes, topBoxes, bottomBoxes), getMinimumBoxSize);
  36957. // If a horizontal box has padding, we move the left boxes over to avoid ugly charts (see issue #2478)
  36958. var maxHorizontalLeftPadding = 0;
  36959. var maxHorizontalRightPadding = 0;
  36960. var maxVerticalTopPadding = 0;
  36961. var maxVerticalBottomPadding = 0;
  36962. helpers.each(topBoxes.concat(bottomBoxes), function(horizontalBox) {
  36963. if (horizontalBox.getPadding) {
  36964. var boxPadding = horizontalBox.getPadding();
  36965. maxHorizontalLeftPadding = Math.max(maxHorizontalLeftPadding, boxPadding.left);
  36966. maxHorizontalRightPadding = Math.max(maxHorizontalRightPadding, boxPadding.right);
  36967. }
  36968. });
  36969. helpers.each(leftBoxes.concat(rightBoxes), function(verticalBox) {
  36970. if (verticalBox.getPadding) {
  36971. var boxPadding = verticalBox.getPadding();
  36972. maxVerticalTopPadding = Math.max(maxVerticalTopPadding, boxPadding.top);
  36973. maxVerticalBottomPadding = Math.max(maxVerticalBottomPadding, boxPadding.bottom);
  36974. }
  36975. });
  36976. // At this point, maxChartAreaHeight and maxChartAreaWidth are the size the chart area could
  36977. // be if the axes are drawn at their minimum sizes.
  36978. // Steps 5 & 6
  36979. var totalLeftBoxesWidth = leftPadding;
  36980. var totalRightBoxesWidth = rightPadding;
  36981. var totalTopBoxesHeight = topPadding;
  36982. var totalBottomBoxesHeight = bottomPadding;
  36983. // Function to fit a box
  36984. function fitBox(box) {
  36985. var minBoxSize = helpers.findNextWhere(minBoxSizes, function(minBox) {
  36986. return minBox.box === box;
  36987. });
  36988. if (minBoxSize) {
  36989. if (box.isHorizontal()) {
  36990. var scaleMargin = {
  36991. left: Math.max(totalLeftBoxesWidth, maxHorizontalLeftPadding),
  36992. right: Math.max(totalRightBoxesWidth, maxHorizontalRightPadding),
  36993. top: 0,
  36994. bottom: 0
  36995. };
  36996. // Don't use min size here because of label rotation. When the labels are rotated, their rotation highly depends
  36997. // on the margin. Sometimes they need to increase in size slightly
  36998. box.update(box.options.fullWidth ? chartWidth : maxChartAreaWidth, chartHeight / 2, scaleMargin);
  36999. } else {
  37000. box.update(minBoxSize.minSize.width, maxChartAreaHeight);
  37001. }
  37002. }
  37003. }
  37004. // Update, and calculate the left and right margins for the horizontal boxes
  37005. helpers.each(leftBoxes.concat(rightBoxes), fitBox);
  37006. helpers.each(leftBoxes, function(box) {
  37007. totalLeftBoxesWidth += box.width;
  37008. });
  37009. helpers.each(rightBoxes, function(box) {
  37010. totalRightBoxesWidth += box.width;
  37011. });
  37012. // Set the Left and Right margins for the horizontal boxes
  37013. helpers.each(topBoxes.concat(bottomBoxes), fitBox);
  37014. // Figure out how much margin is on the top and bottom of the vertical boxes
  37015. helpers.each(topBoxes, function(box) {
  37016. totalTopBoxesHeight += box.height;
  37017. });
  37018. helpers.each(bottomBoxes, function(box) {
  37019. totalBottomBoxesHeight += box.height;
  37020. });
  37021. function finalFitVerticalBox(box) {
  37022. var minBoxSize = helpers.findNextWhere(minBoxSizes, function(minSize) {
  37023. return minSize.box === box;
  37024. });
  37025. var scaleMargin = {
  37026. left: 0,
  37027. right: 0,
  37028. top: totalTopBoxesHeight,
  37029. bottom: totalBottomBoxesHeight
  37030. };
  37031. if (minBoxSize) {
  37032. box.update(minBoxSize.minSize.width, maxChartAreaHeight, scaleMargin);
  37033. }
  37034. }
  37035. // Let the left layout know the final margin
  37036. helpers.each(leftBoxes.concat(rightBoxes), finalFitVerticalBox);
  37037. // Recalculate because the size of each layout might have changed slightly due to the margins (label rotation for instance)
  37038. totalLeftBoxesWidth = leftPadding;
  37039. totalRightBoxesWidth = rightPadding;
  37040. totalTopBoxesHeight = topPadding;
  37041. totalBottomBoxesHeight = bottomPadding;
  37042. helpers.each(leftBoxes, function(box) {
  37043. totalLeftBoxesWidth += box.width;
  37044. });
  37045. helpers.each(rightBoxes, function(box) {
  37046. totalRightBoxesWidth += box.width;
  37047. });
  37048. helpers.each(topBoxes, function(box) {
  37049. totalTopBoxesHeight += box.height;
  37050. });
  37051. helpers.each(bottomBoxes, function(box) {
  37052. totalBottomBoxesHeight += box.height;
  37053. });
  37054. // We may be adding some padding to account for rotated x axis labels
  37055. var leftPaddingAddition = Math.max(maxHorizontalLeftPadding - totalLeftBoxesWidth, 0);
  37056. totalLeftBoxesWidth += leftPaddingAddition;
  37057. totalRightBoxesWidth += Math.max(maxHorizontalRightPadding - totalRightBoxesWidth, 0);
  37058. var topPaddingAddition = Math.max(maxVerticalTopPadding - totalTopBoxesHeight, 0);
  37059. totalTopBoxesHeight += topPaddingAddition;
  37060. totalBottomBoxesHeight += Math.max(maxVerticalBottomPadding - totalBottomBoxesHeight, 0);
  37061. // Figure out if our chart area changed. This would occur if the dataset layout label rotation
  37062. // changed due to the application of the margins in step 6. Since we can only get bigger, this is safe to do
  37063. // without calling `fit` again
  37064. var newMaxChartAreaHeight = height - totalTopBoxesHeight - totalBottomBoxesHeight;
  37065. var newMaxChartAreaWidth = width - totalLeftBoxesWidth - totalRightBoxesWidth;
  37066. if (newMaxChartAreaWidth !== maxChartAreaWidth || newMaxChartAreaHeight !== maxChartAreaHeight) {
  37067. helpers.each(leftBoxes, function(box) {
  37068. box.height = newMaxChartAreaHeight;
  37069. });
  37070. helpers.each(rightBoxes, function(box) {
  37071. box.height = newMaxChartAreaHeight;
  37072. });
  37073. helpers.each(topBoxes, function(box) {
  37074. if (!box.options.fullWidth) {
  37075. box.width = newMaxChartAreaWidth;
  37076. }
  37077. });
  37078. helpers.each(bottomBoxes, function(box) {
  37079. if (!box.options.fullWidth) {
  37080. box.width = newMaxChartAreaWidth;
  37081. }
  37082. });
  37083. maxChartAreaHeight = newMaxChartAreaHeight;
  37084. maxChartAreaWidth = newMaxChartAreaWidth;
  37085. }
  37086. // Step 7 - Position the boxes
  37087. var left = leftPadding + leftPaddingAddition;
  37088. var top = topPadding + topPaddingAddition;
  37089. function placeBox(box) {
  37090. if (box.isHorizontal()) {
  37091. box.left = box.options.fullWidth ? leftPadding : totalLeftBoxesWidth;
  37092. box.right = box.options.fullWidth ? width - rightPadding : totalLeftBoxesWidth + maxChartAreaWidth;
  37093. box.top = top;
  37094. box.bottom = top + box.height;
  37095. // Move to next point
  37096. top = box.bottom;
  37097. } else {
  37098. box.left = left;
  37099. box.right = left + box.width;
  37100. box.top = totalTopBoxesHeight;
  37101. box.bottom = totalTopBoxesHeight + maxChartAreaHeight;
  37102. // Move to next point
  37103. left = box.right;
  37104. }
  37105. }
  37106. helpers.each(leftBoxes.concat(topBoxes), placeBox);
  37107. // Account for chart width and height
  37108. left += maxChartAreaWidth;
  37109. top += maxChartAreaHeight;
  37110. helpers.each(rightBoxes, placeBox);
  37111. helpers.each(bottomBoxes, placeBox);
  37112. // Step 8
  37113. chartInstance.chartArea = {
  37114. left: totalLeftBoxesWidth,
  37115. top: totalTopBoxesHeight,
  37116. right: totalLeftBoxesWidth + maxChartAreaWidth,
  37117. bottom: totalTopBoxesHeight + maxChartAreaHeight
  37118. };
  37119. // Step 9
  37120. helpers.each(chartAreaBoxes, function(box) {
  37121. box.left = chartInstance.chartArea.left;
  37122. box.top = chartInstance.chartArea.top;
  37123. box.right = chartInstance.chartArea.right;
  37124. box.bottom = chartInstance.chartArea.bottom;
  37125. box.update(maxChartAreaWidth, maxChartAreaHeight);
  37126. });
  37127. }
  37128. };
  37129. };
  37130. /***/ }),
  37131. /* 145 */
  37132. /***/ (function(module, exports, __webpack_require__) {
  37133. "use strict";
  37134. module.exports = function(Chart) {
  37135. var helpers = Chart.helpers;
  37136. var noop = helpers.noop;
  37137. Chart.defaults.global.legend = {
  37138. display: true,
  37139. position: 'top',
  37140. fullWidth: true, // marks that this box should take the full width of the canvas (pushing down other boxes)
  37141. reverse: false,
  37142. // a callback that will handle
  37143. onClick: function(e, legendItem) {
  37144. var index = legendItem.datasetIndex;
  37145. var ci = this.chart;
  37146. var meta = ci.getDatasetMeta(index);
  37147. // See controller.isDatasetVisible comment
  37148. meta.hidden = meta.hidden === null? !ci.data.datasets[index].hidden : null;
  37149. // We hid a dataset ... rerender the chart
  37150. ci.update();
  37151. },
  37152. onHover: null,
  37153. labels: {
  37154. boxWidth: 40,
  37155. padding: 10,
  37156. // Generates labels shown in the legend
  37157. // Valid properties to return:
  37158. // text : text to display
  37159. // fillStyle : fill of coloured box
  37160. // strokeStyle: stroke of coloured box
  37161. // hidden : if this legend item refers to a hidden item
  37162. // lineCap : cap style for line
  37163. // lineDash
  37164. // lineDashOffset :
  37165. // lineJoin :
  37166. // lineWidth :
  37167. generateLabels: function(chart) {
  37168. var data = chart.data;
  37169. return helpers.isArray(data.datasets) ? data.datasets.map(function(dataset, i) {
  37170. return {
  37171. text: dataset.label,
  37172. fillStyle: (!helpers.isArray(dataset.backgroundColor) ? dataset.backgroundColor : dataset.backgroundColor[0]),
  37173. hidden: !chart.isDatasetVisible(i),
  37174. lineCap: dataset.borderCapStyle,
  37175. lineDash: dataset.borderDash,
  37176. lineDashOffset: dataset.borderDashOffset,
  37177. lineJoin: dataset.borderJoinStyle,
  37178. lineWidth: dataset.borderWidth,
  37179. strokeStyle: dataset.borderColor,
  37180. pointStyle: dataset.pointStyle,
  37181. // Below is extra data used for toggling the datasets
  37182. datasetIndex: i
  37183. };
  37184. }, this) : [];
  37185. }
  37186. }
  37187. };
  37188. /**
  37189. * Helper function to get the box width based on the usePointStyle option
  37190. * @param labelopts {Object} the label options on the legend
  37191. * @param fontSize {Number} the label font size
  37192. * @return {Number} width of the color box area
  37193. */
  37194. function getBoxWidth(labelOpts, fontSize) {
  37195. return labelOpts.usePointStyle ?
  37196. fontSize * Math.SQRT2 :
  37197. labelOpts.boxWidth;
  37198. }
  37199. Chart.Legend = Chart.Element.extend({
  37200. initialize: function(config) {
  37201. helpers.extend(this, config);
  37202. // Contains hit boxes for each dataset (in dataset order)
  37203. this.legendHitBoxes = [];
  37204. // Are we in doughnut mode which has a different data type
  37205. this.doughnutMode = false;
  37206. },
  37207. // These methods are ordered by lifecycle. Utilities then follow.
  37208. // Any function defined here is inherited by all legend types.
  37209. // Any function can be extended by the legend type
  37210. beforeUpdate: noop,
  37211. update: function(maxWidth, maxHeight, margins) {
  37212. var me = this;
  37213. // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)
  37214. me.beforeUpdate();
  37215. // Absorb the master measurements
  37216. me.maxWidth = maxWidth;
  37217. me.maxHeight = maxHeight;
  37218. me.margins = margins;
  37219. // Dimensions
  37220. me.beforeSetDimensions();
  37221. me.setDimensions();
  37222. me.afterSetDimensions();
  37223. // Labels
  37224. me.beforeBuildLabels();
  37225. me.buildLabels();
  37226. me.afterBuildLabels();
  37227. // Fit
  37228. me.beforeFit();
  37229. me.fit();
  37230. me.afterFit();
  37231. //
  37232. me.afterUpdate();
  37233. return me.minSize;
  37234. },
  37235. afterUpdate: noop,
  37236. //
  37237. beforeSetDimensions: noop,
  37238. setDimensions: function() {
  37239. var me = this;
  37240. // Set the unconstrained dimension before label rotation
  37241. if (me.isHorizontal()) {
  37242. // Reset position before calculating rotation
  37243. me.width = me.maxWidth;
  37244. me.left = 0;
  37245. me.right = me.width;
  37246. } else {
  37247. me.height = me.maxHeight;
  37248. // Reset position before calculating rotation
  37249. me.top = 0;
  37250. me.bottom = me.height;
  37251. }
  37252. // Reset padding
  37253. me.paddingLeft = 0;
  37254. me.paddingTop = 0;
  37255. me.paddingRight = 0;
  37256. me.paddingBottom = 0;
  37257. // Reset minSize
  37258. me.minSize = {
  37259. width: 0,
  37260. height: 0
  37261. };
  37262. },
  37263. afterSetDimensions: noop,
  37264. //
  37265. beforeBuildLabels: noop,
  37266. buildLabels: function() {
  37267. var me = this;
  37268. var labelOpts = me.options.labels;
  37269. var legendItems = labelOpts.generateLabels.call(me, me.chart);
  37270. if (labelOpts.filter) {
  37271. legendItems = legendItems.filter(function(item) {
  37272. return labelOpts.filter(item, me.chart.data);
  37273. });
  37274. }
  37275. if (me.options.reverse) {
  37276. legendItems.reverse();
  37277. }
  37278. me.legendItems = legendItems;
  37279. },
  37280. afterBuildLabels: noop,
  37281. //
  37282. beforeFit: noop,
  37283. fit: function() {
  37284. var me = this;
  37285. var opts = me.options;
  37286. var labelOpts = opts.labels;
  37287. var display = opts.display;
  37288. var ctx = me.ctx;
  37289. var globalDefault = Chart.defaults.global,
  37290. itemOrDefault = helpers.getValueOrDefault,
  37291. fontSize = itemOrDefault(labelOpts.fontSize, globalDefault.defaultFontSize),
  37292. fontStyle = itemOrDefault(labelOpts.fontStyle, globalDefault.defaultFontStyle),
  37293. fontFamily = itemOrDefault(labelOpts.fontFamily, globalDefault.defaultFontFamily),
  37294. labelFont = helpers.fontString(fontSize, fontStyle, fontFamily);
  37295. // Reset hit boxes
  37296. var hitboxes = me.legendHitBoxes = [];
  37297. var minSize = me.minSize;
  37298. var isHorizontal = me.isHorizontal();
  37299. if (isHorizontal) {
  37300. minSize.width = me.maxWidth; // fill all the width
  37301. minSize.height = display ? 10 : 0;
  37302. } else {
  37303. minSize.width = display ? 10 : 0;
  37304. minSize.height = me.maxHeight; // fill all the height
  37305. }
  37306. // Increase sizes here
  37307. if (display) {
  37308. ctx.font = labelFont;
  37309. if (isHorizontal) {
  37310. // Labels
  37311. // Width of each line of legend boxes. Labels wrap onto multiple lines when there are too many to fit on one
  37312. var lineWidths = me.lineWidths = [0];
  37313. var totalHeight = me.legendItems.length ? fontSize + (labelOpts.padding) : 0;
  37314. ctx.textAlign = 'left';
  37315. ctx.textBaseline = 'top';
  37316. helpers.each(me.legendItems, function(legendItem, i) {
  37317. var boxWidth = getBoxWidth(labelOpts, fontSize);
  37318. var width = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;
  37319. if (lineWidths[lineWidths.length - 1] + width + labelOpts.padding >= me.width) {
  37320. totalHeight += fontSize + (labelOpts.padding);
  37321. lineWidths[lineWidths.length] = me.left;
  37322. }
  37323. // Store the hitbox width and height here. Final position will be updated in `draw`
  37324. hitboxes[i] = {
  37325. left: 0,
  37326. top: 0,
  37327. width: width,
  37328. height: fontSize
  37329. };
  37330. lineWidths[lineWidths.length - 1] += width + labelOpts.padding;
  37331. });
  37332. minSize.height += totalHeight;
  37333. } else {
  37334. var vPadding = labelOpts.padding;
  37335. var columnWidths = me.columnWidths = [];
  37336. var totalWidth = labelOpts.padding;
  37337. var currentColWidth = 0;
  37338. var currentColHeight = 0;
  37339. var itemHeight = fontSize + vPadding;
  37340. helpers.each(me.legendItems, function(legendItem, i) {
  37341. var boxWidth = getBoxWidth(labelOpts, fontSize);
  37342. var itemWidth = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;
  37343. // If too tall, go to new column
  37344. if (currentColHeight + itemHeight > minSize.height) {
  37345. totalWidth += currentColWidth + labelOpts.padding;
  37346. columnWidths.push(currentColWidth); // previous column width
  37347. currentColWidth = 0;
  37348. currentColHeight = 0;
  37349. }
  37350. // Get max width
  37351. currentColWidth = Math.max(currentColWidth, itemWidth);
  37352. currentColHeight += itemHeight;
  37353. // Store the hitbox width and height here. Final position will be updated in `draw`
  37354. hitboxes[i] = {
  37355. left: 0,
  37356. top: 0,
  37357. width: itemWidth,
  37358. height: fontSize
  37359. };
  37360. });
  37361. totalWidth += currentColWidth;
  37362. columnWidths.push(currentColWidth);
  37363. minSize.width += totalWidth;
  37364. }
  37365. }
  37366. me.width = minSize.width;
  37367. me.height = minSize.height;
  37368. },
  37369. afterFit: noop,
  37370. // Shared Methods
  37371. isHorizontal: function() {
  37372. return this.options.position === 'top' || this.options.position === 'bottom';
  37373. },
  37374. // Actually draw the legend on the canvas
  37375. draw: function() {
  37376. var me = this;
  37377. var opts = me.options;
  37378. var labelOpts = opts.labels;
  37379. var globalDefault = Chart.defaults.global,
  37380. lineDefault = globalDefault.elements.line,
  37381. legendWidth = me.width,
  37382. lineWidths = me.lineWidths;
  37383. if (opts.display) {
  37384. var ctx = me.ctx,
  37385. cursor,
  37386. itemOrDefault = helpers.getValueOrDefault,
  37387. fontColor = itemOrDefault(labelOpts.fontColor, globalDefault.defaultFontColor),
  37388. fontSize = itemOrDefault(labelOpts.fontSize, globalDefault.defaultFontSize),
  37389. fontStyle = itemOrDefault(labelOpts.fontStyle, globalDefault.defaultFontStyle),
  37390. fontFamily = itemOrDefault(labelOpts.fontFamily, globalDefault.defaultFontFamily),
  37391. labelFont = helpers.fontString(fontSize, fontStyle, fontFamily);
  37392. // Canvas setup
  37393. ctx.textAlign = 'left';
  37394. ctx.textBaseline = 'top';
  37395. ctx.lineWidth = 0.5;
  37396. ctx.strokeStyle = fontColor; // for strikethrough effect
  37397. ctx.fillStyle = fontColor; // render in correct colour
  37398. ctx.font = labelFont;
  37399. var boxWidth = getBoxWidth(labelOpts, fontSize),
  37400. hitboxes = me.legendHitBoxes;
  37401. // current position
  37402. var drawLegendBox = function(x, y, legendItem) {
  37403. if (isNaN(boxWidth) || boxWidth <= 0) {
  37404. return;
  37405. }
  37406. // Set the ctx for the box
  37407. ctx.save();
  37408. ctx.fillStyle = itemOrDefault(legendItem.fillStyle, globalDefault.defaultColor);
  37409. ctx.lineCap = itemOrDefault(legendItem.lineCap, lineDefault.borderCapStyle);
  37410. ctx.lineDashOffset = itemOrDefault(legendItem.lineDashOffset, lineDefault.borderDashOffset);
  37411. ctx.lineJoin = itemOrDefault(legendItem.lineJoin, lineDefault.borderJoinStyle);
  37412. ctx.lineWidth = itemOrDefault(legendItem.lineWidth, lineDefault.borderWidth);
  37413. ctx.strokeStyle = itemOrDefault(legendItem.strokeStyle, globalDefault.defaultColor);
  37414. var isLineWidthZero = (itemOrDefault(legendItem.lineWidth, lineDefault.borderWidth) === 0);
  37415. if (ctx.setLineDash) {
  37416. // IE 9 and 10 do not support line dash
  37417. ctx.setLineDash(itemOrDefault(legendItem.lineDash, lineDefault.borderDash));
  37418. }
  37419. if (opts.labels && opts.labels.usePointStyle) {
  37420. // Recalculate x and y for drawPoint() because its expecting
  37421. // x and y to be center of figure (instead of top left)
  37422. var radius = fontSize * Math.SQRT2 / 2;
  37423. var offSet = radius / Math.SQRT2;
  37424. var centerX = x + offSet;
  37425. var centerY = y + offSet;
  37426. // Draw pointStyle as legend symbol
  37427. Chart.canvasHelpers.drawPoint(ctx, legendItem.pointStyle, radius, centerX, centerY);
  37428. } else {
  37429. // Draw box as legend symbol
  37430. if (!isLineWidthZero) {
  37431. ctx.strokeRect(x, y, boxWidth, fontSize);
  37432. }
  37433. ctx.fillRect(x, y, boxWidth, fontSize);
  37434. }
  37435. ctx.restore();
  37436. };
  37437. var fillText = function(x, y, legendItem, textWidth) {
  37438. ctx.fillText(legendItem.text, boxWidth + (fontSize / 2) + x, y);
  37439. if (legendItem.hidden) {
  37440. // Strikethrough the text if hidden
  37441. ctx.beginPath();
  37442. ctx.lineWidth = 2;
  37443. ctx.moveTo(boxWidth + (fontSize / 2) + x, y + (fontSize / 2));
  37444. ctx.lineTo(boxWidth + (fontSize / 2) + x + textWidth, y + (fontSize / 2));
  37445. ctx.stroke();
  37446. }
  37447. };
  37448. // Horizontal
  37449. var isHorizontal = me.isHorizontal();
  37450. if (isHorizontal) {
  37451. cursor = {
  37452. x: me.left + ((legendWidth - lineWidths[0]) / 2),
  37453. y: me.top + labelOpts.padding,
  37454. line: 0
  37455. };
  37456. } else {
  37457. cursor = {
  37458. x: me.left + labelOpts.padding,
  37459. y: me.top + labelOpts.padding,
  37460. line: 0
  37461. };
  37462. }
  37463. var itemHeight = fontSize + labelOpts.padding;
  37464. helpers.each(me.legendItems, function(legendItem, i) {
  37465. var textWidth = ctx.measureText(legendItem.text).width,
  37466. width = boxWidth + (fontSize / 2) + textWidth,
  37467. x = cursor.x,
  37468. y = cursor.y;
  37469. if (isHorizontal) {
  37470. if (x + width >= legendWidth) {
  37471. y = cursor.y += itemHeight;
  37472. cursor.line++;
  37473. x = cursor.x = me.left + ((legendWidth - lineWidths[cursor.line]) / 2);
  37474. }
  37475. } else if (y + itemHeight > me.bottom) {
  37476. x = cursor.x = x + me.columnWidths[cursor.line] + labelOpts.padding;
  37477. y = cursor.y = me.top + labelOpts.padding;
  37478. cursor.line++;
  37479. }
  37480. drawLegendBox(x, y, legendItem);
  37481. hitboxes[i].left = x;
  37482. hitboxes[i].top = y;
  37483. // Fill the actual label
  37484. fillText(x, y, legendItem, textWidth);
  37485. if (isHorizontal) {
  37486. cursor.x += width + (labelOpts.padding);
  37487. } else {
  37488. cursor.y += itemHeight;
  37489. }
  37490. });
  37491. }
  37492. },
  37493. /**
  37494. * Handle an event
  37495. * @private
  37496. * @param {IEvent} event - The event to handle
  37497. * @return {Boolean} true if a change occured
  37498. */
  37499. handleEvent: function(e) {
  37500. var me = this;
  37501. var opts = me.options;
  37502. var type = e.type === 'mouseup' ? 'click' : e.type;
  37503. var changed = false;
  37504. if (type === 'mousemove') {
  37505. if (!opts.onHover) {
  37506. return;
  37507. }
  37508. } else if (type === 'click') {
  37509. if (!opts.onClick) {
  37510. return;
  37511. }
  37512. } else {
  37513. return;
  37514. }
  37515. // Chart event already has relative position in it
  37516. var x = e.x,
  37517. y = e.y;
  37518. if (x >= me.left && x <= me.right && y >= me.top && y <= me.bottom) {
  37519. // See if we are touching one of the dataset boxes
  37520. var lh = me.legendHitBoxes;
  37521. for (var i = 0; i < lh.length; ++i) {
  37522. var hitBox = lh[i];
  37523. if (x >= hitBox.left && x <= hitBox.left + hitBox.width && y >= hitBox.top && y <= hitBox.top + hitBox.height) {
  37524. // Touching an element
  37525. if (type === 'click') {
  37526. // use e.native for backwards compatibility
  37527. opts.onClick.call(me, e.native, me.legendItems[i]);
  37528. changed = true;
  37529. break;
  37530. } else if (type === 'mousemove') {
  37531. // use e.native for backwards compatibility
  37532. opts.onHover.call(me, e.native, me.legendItems[i]);
  37533. changed = true;
  37534. break;
  37535. }
  37536. }
  37537. }
  37538. }
  37539. return changed;
  37540. }
  37541. });
  37542. function createNewLegendAndAttach(chartInstance, legendOpts) {
  37543. var legend = new Chart.Legend({
  37544. ctx: chartInstance.chart.ctx,
  37545. options: legendOpts,
  37546. chart: chartInstance
  37547. });
  37548. chartInstance.legend = legend;
  37549. Chart.layoutService.addBox(chartInstance, legend);
  37550. }
  37551. // Register the legend plugin
  37552. Chart.plugins.register({
  37553. beforeInit: function(chartInstance) {
  37554. var legendOpts = chartInstance.options.legend;
  37555. if (legendOpts) {
  37556. createNewLegendAndAttach(chartInstance, legendOpts);
  37557. }
  37558. },
  37559. beforeUpdate: function(chartInstance) {
  37560. var legendOpts = chartInstance.options.legend;
  37561. if (legendOpts) {
  37562. legendOpts = helpers.configMerge(Chart.defaults.global.legend, legendOpts);
  37563. if (chartInstance.legend) {
  37564. chartInstance.legend.options = legendOpts;
  37565. } else {
  37566. createNewLegendAndAttach(chartInstance, legendOpts);
  37567. }
  37568. } else {
  37569. Chart.layoutService.removeBox(chartInstance, chartInstance.legend);
  37570. delete chartInstance.legend;
  37571. }
  37572. },
  37573. afterEvent: function(chartInstance, e) {
  37574. var legend = chartInstance.legend;
  37575. if (legend) {
  37576. legend.handleEvent(e);
  37577. }
  37578. }
  37579. });
  37580. };
  37581. /***/ }),
  37582. /* 146 */
  37583. /***/ (function(module, exports, __webpack_require__) {
  37584. "use strict";
  37585. module.exports = function(Chart) {
  37586. var helpers = Chart.helpers;
  37587. Chart.defaults.global.plugins = {};
  37588. /**
  37589. * The plugin service singleton
  37590. * @namespace Chart.plugins
  37591. * @since 2.1.0
  37592. */
  37593. Chart.plugins = {
  37594. /**
  37595. * Globally registered plugins.
  37596. * @private
  37597. */
  37598. _plugins: [],
  37599. /**
  37600. * This identifier is used to invalidate the descriptors cache attached to each chart
  37601. * when a global plugin is registered or unregistered. In this case, the cache ID is
  37602. * incremented and descriptors are regenerated during following API calls.
  37603. * @private
  37604. */
  37605. _cacheId: 0,
  37606. /**
  37607. * Registers the given plugin(s) if not already registered.
  37608. * @param {Array|Object} plugins plugin instance(s).
  37609. */
  37610. register: function(plugins) {
  37611. var p = this._plugins;
  37612. ([]).concat(plugins).forEach(function(plugin) {
  37613. if (p.indexOf(plugin) === -1) {
  37614. p.push(plugin);
  37615. }
  37616. });
  37617. this._cacheId++;
  37618. },
  37619. /**
  37620. * Unregisters the given plugin(s) only if registered.
  37621. * @param {Array|Object} plugins plugin instance(s).
  37622. */
  37623. unregister: function(plugins) {
  37624. var p = this._plugins;
  37625. ([]).concat(plugins).forEach(function(plugin) {
  37626. var idx = p.indexOf(plugin);
  37627. if (idx !== -1) {
  37628. p.splice(idx, 1);
  37629. }
  37630. });
  37631. this._cacheId++;
  37632. },
  37633. /**
  37634. * Remove all registered plugins.
  37635. * @since 2.1.5
  37636. */
  37637. clear: function() {
  37638. this._plugins = [];
  37639. this._cacheId++;
  37640. },
  37641. /**
  37642. * Returns the number of registered plugins?
  37643. * @returns {Number}
  37644. * @since 2.1.5
  37645. */
  37646. count: function() {
  37647. return this._plugins.length;
  37648. },
  37649. /**
  37650. * Returns all registered plugin instances.
  37651. * @returns {Array} array of plugin objects.
  37652. * @since 2.1.5
  37653. */
  37654. getAll: function() {
  37655. return this._plugins;
  37656. },
  37657. /**
  37658. * Calls enabled plugins for `chart` on the specified hook and with the given args.
  37659. * This method immediately returns as soon as a plugin explicitly returns false. The
  37660. * returned value can be used, for instance, to interrupt the current action.
  37661. * @param {Object} chart - The chart instance for which plugins should be called.
  37662. * @param {String} hook - The name of the plugin method to call (e.g. 'beforeUpdate').
  37663. * @param {Array} [args] - Extra arguments to apply to the hook call.
  37664. * @returns {Boolean} false if any of the plugins return false, else returns true.
  37665. */
  37666. notify: function(chart, hook, args) {
  37667. var descriptors = this.descriptors(chart);
  37668. var ilen = descriptors.length;
  37669. var i, descriptor, plugin, params, method;
  37670. for (i=0; i<ilen; ++i) {
  37671. descriptor = descriptors[i];
  37672. plugin = descriptor.plugin;
  37673. method = plugin[hook];
  37674. if (typeof method === 'function') {
  37675. params = [chart].concat(args || []);
  37676. params.push(descriptor.options);
  37677. if (method.apply(plugin, params) === false) {
  37678. return false;
  37679. }
  37680. }
  37681. }
  37682. return true;
  37683. },
  37684. /**
  37685. * Returns descriptors of enabled plugins for the given chart.
  37686. * @returns {Array} [{ plugin, options }]
  37687. * @private
  37688. */
  37689. descriptors: function(chart) {
  37690. var cache = chart._plugins || (chart._plugins = {});
  37691. if (cache.id === this._cacheId) {
  37692. return cache.descriptors;
  37693. }
  37694. var plugins = [];
  37695. var descriptors = [];
  37696. var config = (chart && chart.config) || {};
  37697. var defaults = Chart.defaults.global.plugins;
  37698. var options = (config.options && config.options.plugins) || {};
  37699. this._plugins.concat(config.plugins || []).forEach(function(plugin) {
  37700. var idx = plugins.indexOf(plugin);
  37701. if (idx !== -1) {
  37702. return;
  37703. }
  37704. var id = plugin.id;
  37705. var opts = options[id];
  37706. if (opts === false) {
  37707. return;
  37708. }
  37709. if (opts === true) {
  37710. opts = helpers.clone(defaults[id]);
  37711. }
  37712. plugins.push(plugin);
  37713. descriptors.push({
  37714. plugin: plugin,
  37715. options: opts || {}
  37716. });
  37717. });
  37718. cache.descriptors = descriptors;
  37719. cache.id = this._cacheId;
  37720. return descriptors;
  37721. }
  37722. };
  37723. /**
  37724. * Plugin extension hooks.
  37725. * @interface IPlugin
  37726. * @since 2.1.0
  37727. */
  37728. /**
  37729. * @method IPlugin#beforeInit
  37730. * @desc Called before initializing `chart`.
  37731. * @param {Chart.Controller} chart - The chart instance.
  37732. * @param {Object} options - The plugin options.
  37733. */
  37734. /**
  37735. * @method IPlugin#afterInit
  37736. * @desc Called after `chart` has been initialized and before the first update.
  37737. * @param {Chart.Controller} chart - The chart instance.
  37738. * @param {Object} options - The plugin options.
  37739. */
  37740. /**
  37741. * @method IPlugin#beforeUpdate
  37742. * @desc Called before updating `chart`. If any plugin returns `false`, the update
  37743. * is cancelled (and thus subsequent render(s)) until another `update` is triggered.
  37744. * @param {Chart.Controller} chart - The chart instance.
  37745. * @param {Object} options - The plugin options.
  37746. * @returns {Boolean} `false` to cancel the chart update.
  37747. */
  37748. /**
  37749. * @method IPlugin#afterUpdate
  37750. * @desc Called after `chart` has been updated and before rendering. Note that this
  37751. * hook will not be called if the chart update has been previously cancelled.
  37752. * @param {Chart.Controller} chart - The chart instance.
  37753. * @param {Object} options - The plugin options.
  37754. */
  37755. /**
  37756. * @method IPlugin#beforeDatasetsUpdate
  37757. * @desc Called before updating the `chart` datasets. If any plugin returns `false`,
  37758. * the datasets update is cancelled until another `update` is triggered.
  37759. * @param {Chart.Controller} chart - The chart instance.
  37760. * @param {Object} options - The plugin options.
  37761. * @returns {Boolean} false to cancel the datasets update.
  37762. * @since version 2.1.5
  37763. */
  37764. /**
  37765. * @method IPlugin#afterDatasetsUpdate
  37766. * @desc Called after the `chart` datasets have been updated. Note that this hook
  37767. * will not be called if the datasets update has been previously cancelled.
  37768. * @param {Chart.Controller} chart - The chart instance.
  37769. * @param {Object} options - The plugin options.
  37770. * @since version 2.1.5
  37771. */
  37772. /**
  37773. * @method IPlugin#beforeLayout
  37774. * @desc Called before laying out `chart`. If any plugin returns `false`,
  37775. * the layout update is cancelled until another `update` is triggered.
  37776. * @param {Chart.Controller} chart - The chart instance.
  37777. * @param {Object} options - The plugin options.
  37778. * @returns {Boolean} `false` to cancel the chart layout.
  37779. */
  37780. /**
  37781. * @method IPlugin#afterLayout
  37782. * @desc Called after the `chart` has been layed out. Note that this hook will not
  37783. * be called if the layout update has been previously cancelled.
  37784. * @param {Chart.Controller} chart - The chart instance.
  37785. * @param {Object} options - The plugin options.
  37786. */
  37787. /**
  37788. * @method IPlugin#beforeRender
  37789. * @desc Called before rendering `chart`. If any plugin returns `false`,
  37790. * the rendering is cancelled until another `render` is triggered.
  37791. * @param {Chart.Controller} chart - The chart instance.
  37792. * @param {Object} options - The plugin options.
  37793. * @returns {Boolean} `false` to cancel the chart rendering.
  37794. */
  37795. /**
  37796. * @method IPlugin#afterRender
  37797. * @desc Called after the `chart` has been fully rendered (and animation completed). Note
  37798. * that this hook will not be called if the rendering has been previously cancelled.
  37799. * @param {Chart.Controller} chart - The chart instance.
  37800. * @param {Object} options - The plugin options.
  37801. */
  37802. /**
  37803. * @method IPlugin#beforeDraw
  37804. * @desc Called before drawing `chart` at every animation frame specified by the given
  37805. * easing value. If any plugin returns `false`, the frame drawing is cancelled until
  37806. * another `render` is triggered.
  37807. * @param {Chart.Controller} chart - The chart instance.
  37808. * @param {Number} easingValue - The current animation value, between 0.0 and 1.0.
  37809. * @param {Object} options - The plugin options.
  37810. * @returns {Boolean} `false` to cancel the chart drawing.
  37811. */
  37812. /**
  37813. * @method IPlugin#afterDraw
  37814. * @desc Called after the `chart` has been drawn for the specific easing value. Note
  37815. * that this hook will not be called if the drawing has been previously cancelled.
  37816. * @param {Chart.Controller} chart - The chart instance.
  37817. * @param {Number} easingValue - The current animation value, between 0.0 and 1.0.
  37818. * @param {Object} options - The plugin options.
  37819. */
  37820. /**
  37821. * @method IPlugin#beforeDatasetsDraw
  37822. * @desc Called before drawing the `chart` datasets. If any plugin returns `false`,
  37823. * the datasets drawing is cancelled until another `render` is triggered.
  37824. * @param {Chart.Controller} chart - The chart instance.
  37825. * @param {Number} easingValue - The current animation value, between 0.0 and 1.0.
  37826. * @param {Object} options - The plugin options.
  37827. * @returns {Boolean} `false` to cancel the chart datasets drawing.
  37828. */
  37829. /**
  37830. * @method IPlugin#afterDatasetsDraw
  37831. * @desc Called after the `chart` datasets have been drawn. Note that this hook
  37832. * will not be called if the datasets drawing has been previously cancelled.
  37833. * @param {Chart.Controller} chart - The chart instance.
  37834. * @param {Number} easingValue - The current animation value, between 0.0 and 1.0.
  37835. * @param {Object} options - The plugin options.
  37836. */
  37837. /**
  37838. * @method IPlugin#beforeEvent
  37839. * @desc Called before processing the specified `event`. If any plugin returns `false`,
  37840. * the event will be discarded.
  37841. * @param {Chart.Controller} chart - The chart instance.
  37842. * @param {IEvent} event - The event object.
  37843. * @param {Object} options - The plugin options.
  37844. */
  37845. /**
  37846. * @method IPlugin#afterEvent
  37847. * @desc Called after the `event` has been consumed. Note that this hook
  37848. * will not be called if the `event` has been previously discarded.
  37849. * @param {Chart.Controller} chart - The chart instance.
  37850. * @param {IEvent} event - The event object.
  37851. * @param {Object} options - The plugin options.
  37852. */
  37853. /**
  37854. * @method IPlugin#resize
  37855. * @desc Called after the chart as been resized.
  37856. * @param {Chart.Controller} chart - The chart instance.
  37857. * @param {Number} size - The new canvas display size (eq. canvas.style width & height).
  37858. * @param {Object} options - The plugin options.
  37859. */
  37860. /**
  37861. * @method IPlugin#destroy
  37862. * @desc Called after the chart as been destroyed.
  37863. * @param {Chart.Controller} chart - The chart instance.
  37864. * @param {Object} options - The plugin options.
  37865. */
  37866. /**
  37867. * Provided for backward compatibility, use Chart.plugins instead
  37868. * @namespace Chart.pluginService
  37869. * @deprecated since version 2.1.5
  37870. * @todo remove at version 3
  37871. * @private
  37872. */
  37873. Chart.pluginService = Chart.plugins;
  37874. /**
  37875. * Provided for backward compatibility, inheriting from Chart.PlugingBase has no
  37876. * effect, instead simply create/register plugins via plain JavaScript objects.
  37877. * @interface Chart.PluginBase
  37878. * @deprecated since version 2.5.0
  37879. * @todo remove at version 3
  37880. * @private
  37881. */
  37882. Chart.PluginBase = helpers.inherits({});
  37883. };
  37884. /***/ }),
  37885. /* 147 */
  37886. /***/ (function(module, exports, __webpack_require__) {
  37887. "use strict";
  37888. module.exports = function(Chart) {
  37889. var helpers = Chart.helpers;
  37890. Chart.defaults.scale = {
  37891. display: true,
  37892. position: 'left',
  37893. // grid line settings
  37894. gridLines: {
  37895. display: true,
  37896. color: 'rgba(0, 0, 0, 0.1)',
  37897. lineWidth: 1,
  37898. drawBorder: true,
  37899. drawOnChartArea: true,
  37900. drawTicks: true,
  37901. tickMarkLength: 10,
  37902. zeroLineWidth: 1,
  37903. zeroLineColor: 'rgba(0,0,0,0.25)',
  37904. offsetGridLines: false,
  37905. borderDash: [],
  37906. borderDashOffset: 0.0
  37907. },
  37908. // scale label
  37909. scaleLabel: {
  37910. // actual label
  37911. labelString: '',
  37912. // display property
  37913. display: false
  37914. },
  37915. // label settings
  37916. ticks: {
  37917. beginAtZero: false,
  37918. minRotation: 0,
  37919. maxRotation: 50,
  37920. mirror: false,
  37921. padding: 0,
  37922. reverse: false,
  37923. display: true,
  37924. autoSkip: true,
  37925. autoSkipPadding: 0,
  37926. labelOffset: 0,
  37927. // We pass through arrays to be rendered as multiline labels, we convert Others to strings here.
  37928. callback: Chart.Ticks.formatters.values
  37929. }
  37930. };
  37931. function computeTextSize(context, tick, font) {
  37932. return helpers.isArray(tick) ?
  37933. helpers.longestText(context, font, tick) :
  37934. context.measureText(tick).width;
  37935. }
  37936. function parseFontOptions(options) {
  37937. var getValueOrDefault = helpers.getValueOrDefault;
  37938. var globalDefaults = Chart.defaults.global;
  37939. var size = getValueOrDefault(options.fontSize, globalDefaults.defaultFontSize);
  37940. var style = getValueOrDefault(options.fontStyle, globalDefaults.defaultFontStyle);
  37941. var family = getValueOrDefault(options.fontFamily, globalDefaults.defaultFontFamily);
  37942. return {
  37943. size: size,
  37944. style: style,
  37945. family: family,
  37946. font: helpers.fontString(size, style, family)
  37947. };
  37948. }
  37949. Chart.Scale = Chart.Element.extend({
  37950. /**
  37951. * Get the padding needed for the scale
  37952. * @method getPadding
  37953. * @private
  37954. * @returns {Padding} the necessary padding
  37955. */
  37956. getPadding: function() {
  37957. var me = this;
  37958. return {
  37959. left: me.paddingLeft || 0,
  37960. top: me.paddingTop || 0,
  37961. right: me.paddingRight || 0,
  37962. bottom: me.paddingBottom || 0
  37963. };
  37964. },
  37965. // These methods are ordered by lifecyle. Utilities then follow.
  37966. // Any function defined here is inherited by all scale types.
  37967. // Any function can be extended by the scale type
  37968. beforeUpdate: function() {
  37969. helpers.callCallback(this.options.beforeUpdate, [this]);
  37970. },
  37971. update: function(maxWidth, maxHeight, margins) {
  37972. var me = this;
  37973. // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)
  37974. me.beforeUpdate();
  37975. // Absorb the master measurements
  37976. me.maxWidth = maxWidth;
  37977. me.maxHeight = maxHeight;
  37978. me.margins = helpers.extend({
  37979. left: 0,
  37980. right: 0,
  37981. top: 0,
  37982. bottom: 0
  37983. }, margins);
  37984. me.longestTextCache = me.longestTextCache || {};
  37985. // Dimensions
  37986. me.beforeSetDimensions();
  37987. me.setDimensions();
  37988. me.afterSetDimensions();
  37989. // Data min/max
  37990. me.beforeDataLimits();
  37991. me.determineDataLimits();
  37992. me.afterDataLimits();
  37993. // Ticks
  37994. me.beforeBuildTicks();
  37995. me.buildTicks();
  37996. me.afterBuildTicks();
  37997. me.beforeTickToLabelConversion();
  37998. me.convertTicksToLabels();
  37999. me.afterTickToLabelConversion();
  38000. // Tick Rotation
  38001. me.beforeCalculateTickRotation();
  38002. me.calculateTickRotation();
  38003. me.afterCalculateTickRotation();
  38004. // Fit
  38005. me.beforeFit();
  38006. me.fit();
  38007. me.afterFit();
  38008. //
  38009. me.afterUpdate();
  38010. return me.minSize;
  38011. },
  38012. afterUpdate: function() {
  38013. helpers.callCallback(this.options.afterUpdate, [this]);
  38014. },
  38015. //
  38016. beforeSetDimensions: function() {
  38017. helpers.callCallback(this.options.beforeSetDimensions, [this]);
  38018. },
  38019. setDimensions: function() {
  38020. var me = this;
  38021. // Set the unconstrained dimension before label rotation
  38022. if (me.isHorizontal()) {
  38023. // Reset position before calculating rotation
  38024. me.width = me.maxWidth;
  38025. me.left = 0;
  38026. me.right = me.width;
  38027. } else {
  38028. me.height = me.maxHeight;
  38029. // Reset position before calculating rotation
  38030. me.top = 0;
  38031. me.bottom = me.height;
  38032. }
  38033. // Reset padding
  38034. me.paddingLeft = 0;
  38035. me.paddingTop = 0;
  38036. me.paddingRight = 0;
  38037. me.paddingBottom = 0;
  38038. },
  38039. afterSetDimensions: function() {
  38040. helpers.callCallback(this.options.afterSetDimensions, [this]);
  38041. },
  38042. // Data limits
  38043. beforeDataLimits: function() {
  38044. helpers.callCallback(this.options.beforeDataLimits, [this]);
  38045. },
  38046. determineDataLimits: helpers.noop,
  38047. afterDataLimits: function() {
  38048. helpers.callCallback(this.options.afterDataLimits, [this]);
  38049. },
  38050. //
  38051. beforeBuildTicks: function() {
  38052. helpers.callCallback(this.options.beforeBuildTicks, [this]);
  38053. },
  38054. buildTicks: helpers.noop,
  38055. afterBuildTicks: function() {
  38056. helpers.callCallback(this.options.afterBuildTicks, [this]);
  38057. },
  38058. beforeTickToLabelConversion: function() {
  38059. helpers.callCallback(this.options.beforeTickToLabelConversion, [this]);
  38060. },
  38061. convertTicksToLabels: function() {
  38062. var me = this;
  38063. // Convert ticks to strings
  38064. var tickOpts = me.options.ticks;
  38065. me.ticks = me.ticks.map(tickOpts.userCallback || tickOpts.callback);
  38066. },
  38067. afterTickToLabelConversion: function() {
  38068. helpers.callCallback(this.options.afterTickToLabelConversion, [this]);
  38069. },
  38070. //
  38071. beforeCalculateTickRotation: function() {
  38072. helpers.callCallback(this.options.beforeCalculateTickRotation, [this]);
  38073. },
  38074. calculateTickRotation: function() {
  38075. var me = this;
  38076. var context = me.ctx;
  38077. var tickOpts = me.options.ticks;
  38078. // Get the width of each grid by calculating the difference
  38079. // between x offsets between 0 and 1.
  38080. var tickFont = parseFontOptions(tickOpts);
  38081. context.font = tickFont.font;
  38082. var labelRotation = tickOpts.minRotation || 0;
  38083. if (me.options.display && me.isHorizontal()) {
  38084. var originalLabelWidth = helpers.longestText(context, tickFont.font, me.ticks, me.longestTextCache);
  38085. var labelWidth = originalLabelWidth;
  38086. var cosRotation;
  38087. var sinRotation;
  38088. // Allow 3 pixels x2 padding either side for label readability
  38089. var tickWidth = me.getPixelForTick(1) - me.getPixelForTick(0) - 6;
  38090. // Max label rotation can be set or default to 90 - also act as a loop counter
  38091. while (labelWidth > tickWidth && labelRotation < tickOpts.maxRotation) {
  38092. var angleRadians = helpers.toRadians(labelRotation);
  38093. cosRotation = Math.cos(angleRadians);
  38094. sinRotation = Math.sin(angleRadians);
  38095. if (sinRotation * originalLabelWidth > me.maxHeight) {
  38096. // go back one step
  38097. labelRotation--;
  38098. break;
  38099. }
  38100. labelRotation++;
  38101. labelWidth = cosRotation * originalLabelWidth;
  38102. }
  38103. }
  38104. me.labelRotation = labelRotation;
  38105. },
  38106. afterCalculateTickRotation: function() {
  38107. helpers.callCallback(this.options.afterCalculateTickRotation, [this]);
  38108. },
  38109. //
  38110. beforeFit: function() {
  38111. helpers.callCallback(this.options.beforeFit, [this]);
  38112. },
  38113. fit: function() {
  38114. var me = this;
  38115. // Reset
  38116. var minSize = me.minSize = {
  38117. width: 0,
  38118. height: 0
  38119. };
  38120. var opts = me.options;
  38121. var tickOpts = opts.ticks;
  38122. var scaleLabelOpts = opts.scaleLabel;
  38123. var gridLineOpts = opts.gridLines;
  38124. var display = opts.display;
  38125. var isHorizontal = me.isHorizontal();
  38126. var tickFont = parseFontOptions(tickOpts);
  38127. var scaleLabelFontSize = parseFontOptions(scaleLabelOpts).size * 1.5;
  38128. var tickMarkLength = opts.gridLines.tickMarkLength;
  38129. // Width
  38130. if (isHorizontal) {
  38131. // subtract the margins to line up with the chartArea if we are a full width scale
  38132. minSize.width = me.isFullWidth() ? me.maxWidth - me.margins.left - me.margins.right : me.maxWidth;
  38133. } else {
  38134. minSize.width = display && gridLineOpts.drawTicks ? tickMarkLength : 0;
  38135. }
  38136. // height
  38137. if (isHorizontal) {
  38138. minSize.height = display && gridLineOpts.drawTicks ? tickMarkLength : 0;
  38139. } else {
  38140. minSize.height = me.maxHeight; // fill all the height
  38141. }
  38142. // Are we showing a title for the scale?
  38143. if (scaleLabelOpts.display && display) {
  38144. if (isHorizontal) {
  38145. minSize.height += scaleLabelFontSize;
  38146. } else {
  38147. minSize.width += scaleLabelFontSize;
  38148. }
  38149. }
  38150. // Don't bother fitting the ticks if we are not showing them
  38151. if (tickOpts.display && display) {
  38152. var largestTextWidth = helpers.longestText(me.ctx, tickFont.font, me.ticks, me.longestTextCache);
  38153. var tallestLabelHeightInLines = helpers.numberOfLabelLines(me.ticks);
  38154. var lineSpace = tickFont.size * 0.5;
  38155. if (isHorizontal) {
  38156. // A horizontal axis is more constrained by the height.
  38157. me.longestLabelWidth = largestTextWidth;
  38158. var angleRadians = helpers.toRadians(me.labelRotation);
  38159. var cosRotation = Math.cos(angleRadians);
  38160. var sinRotation = Math.sin(angleRadians);
  38161. // TODO - improve this calculation
  38162. var labelHeight = (sinRotation * largestTextWidth)
  38163. + (tickFont.size * tallestLabelHeightInLines)
  38164. + (lineSpace * tallestLabelHeightInLines);
  38165. minSize.height = Math.min(me.maxHeight, minSize.height + labelHeight);
  38166. me.ctx.font = tickFont.font;
  38167. var firstTick = me.ticks[0];
  38168. var firstLabelWidth = computeTextSize(me.ctx, firstTick, tickFont.font);
  38169. var lastTick = me.ticks[me.ticks.length - 1];
  38170. var lastLabelWidth = computeTextSize(me.ctx, lastTick, tickFont.font);
  38171. // Ensure that our ticks are always inside the canvas. When rotated, ticks are right aligned which means that the right padding is dominated
  38172. // by the font height
  38173. if (me.labelRotation !== 0) {
  38174. me.paddingLeft = opts.position === 'bottom'? (cosRotation * firstLabelWidth) + 3: (cosRotation * lineSpace) + 3; // add 3 px to move away from canvas edges
  38175. me.paddingRight = opts.position === 'bottom'? (cosRotation * lineSpace) + 3: (cosRotation * lastLabelWidth) + 3;
  38176. } else {
  38177. me.paddingLeft = firstLabelWidth / 2 + 3; // add 3 px to move away from canvas edges
  38178. me.paddingRight = lastLabelWidth / 2 + 3;
  38179. }
  38180. } else {
  38181. // A vertical axis is more constrained by the width. Labels are the dominant factor here, so get that length first
  38182. // Account for padding
  38183. if (tickOpts.mirror) {
  38184. largestTextWidth = 0;
  38185. } else {
  38186. largestTextWidth += me.options.ticks.padding;
  38187. }
  38188. minSize.width += largestTextWidth;
  38189. me.paddingTop = tickFont.size / 2;
  38190. me.paddingBottom = tickFont.size / 2;
  38191. }
  38192. }
  38193. me.handleMargins();
  38194. me.width = minSize.width;
  38195. me.height = minSize.height;
  38196. },
  38197. /**
  38198. * Handle margins and padding interactions
  38199. * @private
  38200. */
  38201. handleMargins: function() {
  38202. var me = this;
  38203. if (me.margins) {
  38204. me.paddingLeft = Math.max(me.paddingLeft - me.margins.left, 0);
  38205. me.paddingTop = Math.max(me.paddingTop - me.margins.top, 0);
  38206. me.paddingRight = Math.max(me.paddingRight - me.margins.right, 0);
  38207. me.paddingBottom = Math.max(me.paddingBottom - me.margins.bottom, 0);
  38208. }
  38209. },
  38210. afterFit: function() {
  38211. helpers.callCallback(this.options.afterFit, [this]);
  38212. },
  38213. // Shared Methods
  38214. isHorizontal: function() {
  38215. return this.options.position === 'top' || this.options.position === 'bottom';
  38216. },
  38217. isFullWidth: function() {
  38218. return (this.options.fullWidth);
  38219. },
  38220. // 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
  38221. getRightValue: function(rawValue) {
  38222. // Null and undefined values first
  38223. if (rawValue === null || typeof(rawValue) === 'undefined') {
  38224. return NaN;
  38225. }
  38226. // isNaN(object) returns true, so make sure NaN is checking for a number; Discard Infinite values
  38227. if (typeof(rawValue) === 'number' && !isFinite(rawValue)) {
  38228. return NaN;
  38229. }
  38230. // If it is in fact an object, dive in one more level
  38231. if (typeof(rawValue) === 'object') {
  38232. if ((rawValue instanceof Date) || (rawValue.isValid)) {
  38233. return rawValue;
  38234. }
  38235. return this.getRightValue(this.isHorizontal() ? rawValue.x : rawValue.y);
  38236. }
  38237. // Value is good, return it
  38238. return rawValue;
  38239. },
  38240. // Used to get the value to display in the tooltip for the data at the given index
  38241. // function getLabelForIndex(index, datasetIndex)
  38242. getLabelForIndex: helpers.noop,
  38243. // Used to get data value locations. Value can either be an index or a numerical value
  38244. getPixelForValue: helpers.noop,
  38245. // Used to get the data value from a given pixel. This is the inverse of getPixelForValue
  38246. getValueForPixel: helpers.noop,
  38247. // Used for tick location, should
  38248. getPixelForTick: function(index, includeOffset) {
  38249. var me = this;
  38250. if (me.isHorizontal()) {
  38251. var innerWidth = me.width - (me.paddingLeft + me.paddingRight);
  38252. var tickWidth = innerWidth / Math.max((me.ticks.length - ((me.options.gridLines.offsetGridLines) ? 0 : 1)), 1);
  38253. var pixel = (tickWidth * index) + me.paddingLeft;
  38254. if (includeOffset) {
  38255. pixel += tickWidth / 2;
  38256. }
  38257. var finalVal = me.left + Math.round(pixel);
  38258. finalVal += me.isFullWidth() ? me.margins.left : 0;
  38259. return finalVal;
  38260. }
  38261. var innerHeight = me.height - (me.paddingTop + me.paddingBottom);
  38262. return me.top + (index * (innerHeight / (me.ticks.length - 1)));
  38263. },
  38264. // Utility for getting the pixel location of a percentage of scale
  38265. getPixelForDecimal: function(decimal /* , includeOffset*/) {
  38266. var me = this;
  38267. if (me.isHorizontal()) {
  38268. var innerWidth = me.width - (me.paddingLeft + me.paddingRight);
  38269. var valueOffset = (innerWidth * decimal) + me.paddingLeft;
  38270. var finalVal = me.left + Math.round(valueOffset);
  38271. finalVal += me.isFullWidth() ? me.margins.left : 0;
  38272. return finalVal;
  38273. }
  38274. return me.top + (decimal * me.height);
  38275. },
  38276. getBasePixel: function() {
  38277. return this.getPixelForValue(this.getBaseValue());
  38278. },
  38279. getBaseValue: function() {
  38280. var me = this;
  38281. var min = me.min;
  38282. var max = me.max;
  38283. return me.beginAtZero ? 0:
  38284. min < 0 && max < 0? max :
  38285. min > 0 && max > 0? min :
  38286. 0;
  38287. },
  38288. // Actually draw the scale on the canvas
  38289. // @param {rectangle} chartArea : the area of the chart to draw full grid lines on
  38290. draw: function(chartArea) {
  38291. var me = this;
  38292. var options = me.options;
  38293. if (!options.display) {
  38294. return;
  38295. }
  38296. var context = me.ctx;
  38297. var globalDefaults = Chart.defaults.global;
  38298. var optionTicks = options.ticks;
  38299. var gridLines = options.gridLines;
  38300. var scaleLabel = options.scaleLabel;
  38301. var isRotated = me.labelRotation !== 0;
  38302. var skipRatio;
  38303. var useAutoskipper = optionTicks.autoSkip;
  38304. var isHorizontal = me.isHorizontal();
  38305. // figure out the maximum number of gridlines to show
  38306. var maxTicks;
  38307. if (optionTicks.maxTicksLimit) {
  38308. maxTicks = optionTicks.maxTicksLimit;
  38309. }
  38310. var tickFontColor = helpers.getValueOrDefault(optionTicks.fontColor, globalDefaults.defaultFontColor);
  38311. var tickFont = parseFontOptions(optionTicks);
  38312. var tl = gridLines.drawTicks ? gridLines.tickMarkLength : 0;
  38313. var borderDash = helpers.getValueOrDefault(gridLines.borderDash, globalDefaults.borderDash);
  38314. var borderDashOffset = helpers.getValueOrDefault(gridLines.borderDashOffset, globalDefaults.borderDashOffset);
  38315. var scaleLabelFontColor = helpers.getValueOrDefault(scaleLabel.fontColor, globalDefaults.defaultFontColor);
  38316. var scaleLabelFont = parseFontOptions(scaleLabel);
  38317. var labelRotationRadians = helpers.toRadians(me.labelRotation);
  38318. var cosRotation = Math.cos(labelRotationRadians);
  38319. var longestRotatedLabel = me.longestLabelWidth * cosRotation;
  38320. // Make sure we draw text in the correct color and font
  38321. context.fillStyle = tickFontColor;
  38322. var itemsToDraw = [];
  38323. if (isHorizontal) {
  38324. skipRatio = false;
  38325. // Only calculate the skip ratio with the half width of longestRotateLabel if we got an actual rotation
  38326. // See #2584
  38327. if (isRotated) {
  38328. longestRotatedLabel /= 2;
  38329. }
  38330. if ((longestRotatedLabel + optionTicks.autoSkipPadding) * me.ticks.length > (me.width - (me.paddingLeft + me.paddingRight))) {
  38331. skipRatio = 1 + Math.floor(((longestRotatedLabel + optionTicks.autoSkipPadding) * me.ticks.length) / (me.width - (me.paddingLeft + me.paddingRight)));
  38332. }
  38333. // if they defined a max number of optionTicks,
  38334. // increase skipRatio until that number is met
  38335. if (maxTicks && me.ticks.length > maxTicks) {
  38336. while (!skipRatio || me.ticks.length / (skipRatio || 1) > maxTicks) {
  38337. if (!skipRatio) {
  38338. skipRatio = 1;
  38339. }
  38340. skipRatio += 1;
  38341. }
  38342. }
  38343. if (!useAutoskipper) {
  38344. skipRatio = false;
  38345. }
  38346. }
  38347. var xTickStart = options.position === 'right' ? me.left : me.right - tl;
  38348. var xTickEnd = options.position === 'right' ? me.left + tl : me.right;
  38349. var yTickStart = options.position === 'bottom' ? me.top : me.bottom - tl;
  38350. var yTickEnd = options.position === 'bottom' ? me.top + tl : me.bottom;
  38351. helpers.each(me.ticks, function(label, index) {
  38352. // If the callback returned a null or undefined value, do not draw this line
  38353. if (label === undefined || label === null) {
  38354. return;
  38355. }
  38356. var isLastTick = me.ticks.length === index + 1;
  38357. // Since we always show the last tick,we need may need to hide the last shown one before
  38358. var shouldSkip = (skipRatio > 1 && index % skipRatio > 0) || (index % skipRatio === 0 && index + skipRatio >= me.ticks.length);
  38359. if (shouldSkip && !isLastTick || (label === undefined || label === null)) {
  38360. return;
  38361. }
  38362. var lineWidth, lineColor;
  38363. if (index === (typeof me.zeroLineIndex !== 'undefined' ? me.zeroLineIndex : 0)) {
  38364. // Draw the first index specially
  38365. lineWidth = gridLines.zeroLineWidth;
  38366. lineColor = gridLines.zeroLineColor;
  38367. } else {
  38368. lineWidth = helpers.getValueAtIndexOrDefault(gridLines.lineWidth, index);
  38369. lineColor = helpers.getValueAtIndexOrDefault(gridLines.color, index);
  38370. }
  38371. // Common properties
  38372. var tx1, ty1, tx2, ty2, x1, y1, x2, y2, labelX, labelY;
  38373. var textAlign = 'middle';
  38374. var textBaseline = 'middle';
  38375. if (isHorizontal) {
  38376. if (options.position === 'bottom') {
  38377. // bottom
  38378. textBaseline = !isRotated? 'top':'middle';
  38379. textAlign = !isRotated? 'center': 'right';
  38380. labelY = me.top + tl;
  38381. } else {
  38382. // top
  38383. textBaseline = !isRotated? 'bottom':'middle';
  38384. textAlign = !isRotated? 'center': 'left';
  38385. labelY = me.bottom - tl;
  38386. }
  38387. var xLineValue = me.getPixelForTick(index) + helpers.aliasPixel(lineWidth); // xvalues for grid lines
  38388. labelX = me.getPixelForTick(index, gridLines.offsetGridLines) + optionTicks.labelOffset; // x values for optionTicks (need to consider offsetLabel option)
  38389. tx1 = tx2 = x1 = x2 = xLineValue;
  38390. ty1 = yTickStart;
  38391. ty2 = yTickEnd;
  38392. y1 = chartArea.top;
  38393. y2 = chartArea.bottom;
  38394. } else {
  38395. var isLeft = options.position === 'left';
  38396. var tickPadding = optionTicks.padding;
  38397. var labelXOffset;
  38398. if (optionTicks.mirror) {
  38399. textAlign = isLeft ? 'left' : 'right';
  38400. labelXOffset = tickPadding;
  38401. } else {
  38402. textAlign = isLeft ? 'right' : 'left';
  38403. labelXOffset = tl + tickPadding;
  38404. }
  38405. labelX = isLeft ? me.right - labelXOffset : me.left + labelXOffset;
  38406. var yLineValue = me.getPixelForTick(index); // xvalues for grid lines
  38407. yLineValue += helpers.aliasPixel(lineWidth);
  38408. labelY = me.getPixelForTick(index, gridLines.offsetGridLines);
  38409. tx1 = xTickStart;
  38410. tx2 = xTickEnd;
  38411. x1 = chartArea.left;
  38412. x2 = chartArea.right;
  38413. ty1 = ty2 = y1 = y2 = yLineValue;
  38414. }
  38415. itemsToDraw.push({
  38416. tx1: tx1,
  38417. ty1: ty1,
  38418. tx2: tx2,
  38419. ty2: ty2,
  38420. x1: x1,
  38421. y1: y1,
  38422. x2: x2,
  38423. y2: y2,
  38424. labelX: labelX,
  38425. labelY: labelY,
  38426. glWidth: lineWidth,
  38427. glColor: lineColor,
  38428. glBorderDash: borderDash,
  38429. glBorderDashOffset: borderDashOffset,
  38430. rotation: -1 * labelRotationRadians,
  38431. label: label,
  38432. textBaseline: textBaseline,
  38433. textAlign: textAlign
  38434. });
  38435. });
  38436. // Draw all of the tick labels, tick marks, and grid lines at the correct places
  38437. helpers.each(itemsToDraw, function(itemToDraw) {
  38438. if (gridLines.display) {
  38439. context.save();
  38440. context.lineWidth = itemToDraw.glWidth;
  38441. context.strokeStyle = itemToDraw.glColor;
  38442. if (context.setLineDash) {
  38443. context.setLineDash(itemToDraw.glBorderDash);
  38444. context.lineDashOffset = itemToDraw.glBorderDashOffset;
  38445. }
  38446. context.beginPath();
  38447. if (gridLines.drawTicks) {
  38448. context.moveTo(itemToDraw.tx1, itemToDraw.ty1);
  38449. context.lineTo(itemToDraw.tx2, itemToDraw.ty2);
  38450. }
  38451. if (gridLines.drawOnChartArea) {
  38452. context.moveTo(itemToDraw.x1, itemToDraw.y1);
  38453. context.lineTo(itemToDraw.x2, itemToDraw.y2);
  38454. }
  38455. context.stroke();
  38456. context.restore();
  38457. }
  38458. if (optionTicks.display) {
  38459. context.save();
  38460. context.translate(itemToDraw.labelX, itemToDraw.labelY);
  38461. context.rotate(itemToDraw.rotation);
  38462. context.font = tickFont.font;
  38463. context.textBaseline = itemToDraw.textBaseline;
  38464. context.textAlign = itemToDraw.textAlign;
  38465. var label = itemToDraw.label;
  38466. if (helpers.isArray(label)) {
  38467. for (var i = 0, y = 0; i < label.length; ++i) {
  38468. // We just make sure the multiline element is a string here..
  38469. context.fillText('' + label[i], 0, y);
  38470. // apply same lineSpacing as calculated @ L#320
  38471. y += (tickFont.size * 1.5);
  38472. }
  38473. } else {
  38474. context.fillText(label, 0, 0);
  38475. }
  38476. context.restore();
  38477. }
  38478. });
  38479. if (scaleLabel.display) {
  38480. // Draw the scale label
  38481. var scaleLabelX;
  38482. var scaleLabelY;
  38483. var rotation = 0;
  38484. if (isHorizontal) {
  38485. scaleLabelX = me.left + ((me.right - me.left) / 2); // midpoint of the width
  38486. scaleLabelY = options.position === 'bottom' ? me.bottom - (scaleLabelFont.size / 2) : me.top + (scaleLabelFont.size / 2);
  38487. } else {
  38488. var isLeft = options.position === 'left';
  38489. scaleLabelX = isLeft ? me.left + (scaleLabelFont.size / 2) : me.right - (scaleLabelFont.size / 2);
  38490. scaleLabelY = me.top + ((me.bottom - me.top) / 2);
  38491. rotation = isLeft ? -0.5 * Math.PI : 0.5 * Math.PI;
  38492. }
  38493. context.save();
  38494. context.translate(scaleLabelX, scaleLabelY);
  38495. context.rotate(rotation);
  38496. context.textAlign = 'center';
  38497. context.textBaseline = 'middle';
  38498. context.fillStyle = scaleLabelFontColor; // render in correct colour
  38499. context.font = scaleLabelFont.font;
  38500. context.fillText(scaleLabel.labelString, 0, 0);
  38501. context.restore();
  38502. }
  38503. if (gridLines.drawBorder) {
  38504. // Draw the line at the edge of the axis
  38505. context.lineWidth = helpers.getValueAtIndexOrDefault(gridLines.lineWidth, 0);
  38506. context.strokeStyle = helpers.getValueAtIndexOrDefault(gridLines.color, 0);
  38507. var x1 = me.left,
  38508. x2 = me.right,
  38509. y1 = me.top,
  38510. y2 = me.bottom;
  38511. var aliasPixel = helpers.aliasPixel(context.lineWidth);
  38512. if (isHorizontal) {
  38513. y1 = y2 = options.position === 'top' ? me.bottom : me.top;
  38514. y1 += aliasPixel;
  38515. y2 += aliasPixel;
  38516. } else {
  38517. x1 = x2 = options.position === 'left' ? me.right : me.left;
  38518. x1 += aliasPixel;
  38519. x2 += aliasPixel;
  38520. }
  38521. context.beginPath();
  38522. context.moveTo(x1, y1);
  38523. context.lineTo(x2, y2);
  38524. context.stroke();
  38525. }
  38526. }
  38527. });
  38528. };
  38529. /***/ }),
  38530. /* 148 */
  38531. /***/ (function(module, exports, __webpack_require__) {
  38532. "use strict";
  38533. module.exports = function(Chart) {
  38534. var helpers = Chart.helpers;
  38535. Chart.scaleService = {
  38536. // Scale registration object. Extensions can register new scale types (such as log or DB scales) and then
  38537. // use the new chart options to grab the correct scale
  38538. constructors: {},
  38539. // Use a registration function so that we can move to an ES6 map when we no longer need to support
  38540. // old browsers
  38541. // Scale config defaults
  38542. defaults: {},
  38543. registerScaleType: function(type, scaleConstructor, defaults) {
  38544. this.constructors[type] = scaleConstructor;
  38545. this.defaults[type] = helpers.clone(defaults);
  38546. },
  38547. getScaleConstructor: function(type) {
  38548. return this.constructors.hasOwnProperty(type) ? this.constructors[type] : undefined;
  38549. },
  38550. getScaleDefaults: function(type) {
  38551. // Return the scale defaults merged with the global settings so that we always use the latest ones
  38552. return this.defaults.hasOwnProperty(type) ? helpers.scaleMerge(Chart.defaults.scale, this.defaults[type]) : {};
  38553. },
  38554. updateScaleDefaults: function(type, additions) {
  38555. var defaults = this.defaults;
  38556. if (defaults.hasOwnProperty(type)) {
  38557. defaults[type] = helpers.extend(defaults[type], additions);
  38558. }
  38559. },
  38560. addScalesToLayout: function(chartInstance) {
  38561. // Adds each scale to the chart.boxes array to be sized accordingly
  38562. helpers.each(chartInstance.scales, function(scale) {
  38563. Chart.layoutService.addBox(chartInstance, scale);
  38564. });
  38565. }
  38566. };
  38567. };
  38568. /***/ }),
  38569. /* 149 */
  38570. /***/ (function(module, exports, __webpack_require__) {
  38571. "use strict";
  38572. module.exports = function(Chart) {
  38573. var helpers = Chart.helpers;
  38574. /**
  38575. * Namespace to hold static tick generation functions
  38576. * @namespace Chart.Ticks
  38577. */
  38578. Chart.Ticks = {
  38579. /**
  38580. * Namespace to hold generators for different types of ticks
  38581. * @namespace Chart.Ticks.generators
  38582. */
  38583. generators: {
  38584. /**
  38585. * Interface for the options provided to the numeric tick generator
  38586. * @interface INumericTickGenerationOptions
  38587. */
  38588. /**
  38589. * The maximum number of ticks to display
  38590. * @name INumericTickGenerationOptions#maxTicks
  38591. * @type Number
  38592. */
  38593. /**
  38594. * The distance between each tick.
  38595. * @name INumericTickGenerationOptions#stepSize
  38596. * @type Number
  38597. * @optional
  38598. */
  38599. /**
  38600. * Forced minimum for the ticks. If not specified, the minimum of the data range is used to calculate the tick minimum
  38601. * @name INumericTickGenerationOptions#min
  38602. * @type Number
  38603. * @optional
  38604. */
  38605. /**
  38606. * The maximum value of the ticks. If not specified, the maximum of the data range is used to calculate the tick maximum
  38607. * @name INumericTickGenerationOptions#max
  38608. * @type Number
  38609. * @optional
  38610. */
  38611. /**
  38612. * Generate a set of linear ticks
  38613. * @method Chart.Ticks.generators.linear
  38614. * @param generationOptions {INumericTickGenerationOptions} the options used to generate the ticks
  38615. * @param dataRange {IRange} the range of the data
  38616. * @returns {Array<Number>} array of tick values
  38617. */
  38618. linear: function(generationOptions, dataRange) {
  38619. var ticks = [];
  38620. // To get a "nice" value for the tick spacing, we will use the appropriately named
  38621. // "nice number" algorithm. See http://stackoverflow.com/questions/8506881/nice-label-algorithm-for-charts-with-minimum-ticks
  38622. // for details.
  38623. var spacing;
  38624. if (generationOptions.stepSize && generationOptions.stepSize > 0) {
  38625. spacing = generationOptions.stepSize;
  38626. } else {
  38627. var niceRange = helpers.niceNum(dataRange.max - dataRange.min, false);
  38628. spacing = helpers.niceNum(niceRange / (generationOptions.maxTicks - 1), true);
  38629. }
  38630. var niceMin = Math.floor(dataRange.min / spacing) * spacing;
  38631. var niceMax = Math.ceil(dataRange.max / spacing) * spacing;
  38632. // If min, max and stepSize is set and they make an evenly spaced scale use it.
  38633. if (generationOptions.min && generationOptions.max && generationOptions.stepSize) {
  38634. // If very close to our whole number, use it.
  38635. if (helpers.almostWhole((generationOptions.max - generationOptions.min) / generationOptions.stepSize, spacing / 1000)) {
  38636. niceMin = generationOptions.min;
  38637. niceMax = generationOptions.max;
  38638. }
  38639. }
  38640. var numSpaces = (niceMax - niceMin) / spacing;
  38641. // If very close to our rounded value, use it.
  38642. if (helpers.almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {
  38643. numSpaces = Math.round(numSpaces);
  38644. } else {
  38645. numSpaces = Math.ceil(numSpaces);
  38646. }
  38647. // Put the values into the ticks array
  38648. ticks.push(generationOptions.min !== undefined ? generationOptions.min : niceMin);
  38649. for (var j = 1; j < numSpaces; ++j) {
  38650. ticks.push(niceMin + (j * spacing));
  38651. }
  38652. ticks.push(generationOptions.max !== undefined ? generationOptions.max : niceMax);
  38653. return ticks;
  38654. },
  38655. /**
  38656. * Generate a set of logarithmic ticks
  38657. * @method Chart.Ticks.generators.logarithmic
  38658. * @param generationOptions {INumericTickGenerationOptions} the options used to generate the ticks
  38659. * @param dataRange {IRange} the range of the data
  38660. * @returns {Array<Number>} array of tick values
  38661. */
  38662. logarithmic: function(generationOptions, dataRange) {
  38663. var ticks = [];
  38664. var getValueOrDefault = helpers.getValueOrDefault;
  38665. // Figure out what the max number of ticks we can support it is based on the size of
  38666. // the axis area. For now, we say that the minimum tick spacing in pixels must be 50
  38667. // We also limit the maximum number of ticks to 11 which gives a nice 10 squares on
  38668. // the graph
  38669. var tickVal = getValueOrDefault(generationOptions.min, Math.pow(10, Math.floor(helpers.log10(dataRange.min))));
  38670. var endExp = Math.floor(helpers.log10(dataRange.max));
  38671. var endSignificand = Math.ceil(dataRange.max / Math.pow(10, endExp));
  38672. var exp;
  38673. var significand;
  38674. if (tickVal === 0) {
  38675. exp = Math.floor(helpers.log10(dataRange.minNotZero));
  38676. significand = Math.floor(dataRange.minNotZero / Math.pow(10, exp));
  38677. ticks.push(tickVal);
  38678. tickVal = significand * Math.pow(10, exp);
  38679. } else {
  38680. exp = Math.floor(helpers.log10(tickVal));
  38681. significand = Math.floor(tickVal / Math.pow(10, exp));
  38682. }
  38683. do {
  38684. ticks.push(tickVal);
  38685. ++significand;
  38686. if (significand === 10) {
  38687. significand = 1;
  38688. ++exp;
  38689. }
  38690. tickVal = significand * Math.pow(10, exp);
  38691. } while (exp < endExp || (exp === endExp && significand < endSignificand));
  38692. var lastTick = getValueOrDefault(generationOptions.max, tickVal);
  38693. ticks.push(lastTick);
  38694. return ticks;
  38695. }
  38696. },
  38697. /**
  38698. * Namespace to hold formatters for different types of ticks
  38699. * @namespace Chart.Ticks.formatters
  38700. */
  38701. formatters: {
  38702. /**
  38703. * Formatter for value labels
  38704. * @method Chart.Ticks.formatters.values
  38705. * @param value the value to display
  38706. * @return {String|Array} the label to display
  38707. */
  38708. values: function(value) {
  38709. return helpers.isArray(value) ? value : '' + value;
  38710. },
  38711. /**
  38712. * Formatter for linear numeric ticks
  38713. * @method Chart.Ticks.formatters.linear
  38714. * @param tickValue {Number} the value to be formatted
  38715. * @param index {Number} the position of the tickValue parameter in the ticks array
  38716. * @param ticks {Array<Number>} the list of ticks being converted
  38717. * @return {String} string representation of the tickValue parameter
  38718. */
  38719. linear: function(tickValue, index, ticks) {
  38720. // If we have lots of ticks, don't use the ones
  38721. var delta = ticks.length > 3 ? ticks[2] - ticks[1] : ticks[1] - ticks[0];
  38722. // If we have a number like 2.5 as the delta, figure out how many decimal places we need
  38723. if (Math.abs(delta) > 1) {
  38724. if (tickValue !== Math.floor(tickValue)) {
  38725. // not an integer
  38726. delta = tickValue - Math.floor(tickValue);
  38727. }
  38728. }
  38729. var logDelta = helpers.log10(Math.abs(delta));
  38730. var tickString = '';
  38731. if (tickValue !== 0) {
  38732. var numDecimal = -1 * Math.floor(logDelta);
  38733. numDecimal = Math.max(Math.min(numDecimal, 20), 0); // toFixed has a max of 20 decimal places
  38734. tickString = tickValue.toFixed(numDecimal);
  38735. } else {
  38736. tickString = '0'; // never show decimal places for 0
  38737. }
  38738. return tickString;
  38739. },
  38740. logarithmic: function(tickValue, index, ticks) {
  38741. var remain = tickValue / (Math.pow(10, Math.floor(helpers.log10(tickValue))));
  38742. if (tickValue === 0) {
  38743. return '0';
  38744. } else if (remain === 1 || remain === 2 || remain === 5 || index === 0 || index === ticks.length - 1) {
  38745. return tickValue.toExponential();
  38746. }
  38747. return '';
  38748. }
  38749. }
  38750. };
  38751. };
  38752. /***/ }),
  38753. /* 150 */
  38754. /***/ (function(module, exports, __webpack_require__) {
  38755. "use strict";
  38756. module.exports = function(Chart) {
  38757. var helpers = Chart.helpers;
  38758. Chart.defaults.global.title = {
  38759. display: false,
  38760. position: 'top',
  38761. fullWidth: true, // marks that this box should take the full width of the canvas (pushing down other boxes)
  38762. fontStyle: 'bold',
  38763. padding: 10,
  38764. // actual title
  38765. text: ''
  38766. };
  38767. var noop = helpers.noop;
  38768. Chart.Title = Chart.Element.extend({
  38769. initialize: function(config) {
  38770. var me = this;
  38771. helpers.extend(me, config);
  38772. // Contains hit boxes for each dataset (in dataset order)
  38773. me.legendHitBoxes = [];
  38774. },
  38775. // These methods are ordered by lifecycle. Utilities then follow.
  38776. beforeUpdate: noop,
  38777. update: function(maxWidth, maxHeight, margins) {
  38778. var me = this;
  38779. // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)
  38780. me.beforeUpdate();
  38781. // Absorb the master measurements
  38782. me.maxWidth = maxWidth;
  38783. me.maxHeight = maxHeight;
  38784. me.margins = margins;
  38785. // Dimensions
  38786. me.beforeSetDimensions();
  38787. me.setDimensions();
  38788. me.afterSetDimensions();
  38789. // Labels
  38790. me.beforeBuildLabels();
  38791. me.buildLabels();
  38792. me.afterBuildLabels();
  38793. // Fit
  38794. me.beforeFit();
  38795. me.fit();
  38796. me.afterFit();
  38797. //
  38798. me.afterUpdate();
  38799. return me.minSize;
  38800. },
  38801. afterUpdate: noop,
  38802. //
  38803. beforeSetDimensions: noop,
  38804. setDimensions: function() {
  38805. var me = this;
  38806. // Set the unconstrained dimension before label rotation
  38807. if (me.isHorizontal()) {
  38808. // Reset position before calculating rotation
  38809. me.width = me.maxWidth;
  38810. me.left = 0;
  38811. me.right = me.width;
  38812. } else {
  38813. me.height = me.maxHeight;
  38814. // Reset position before calculating rotation
  38815. me.top = 0;
  38816. me.bottom = me.height;
  38817. }
  38818. // Reset padding
  38819. me.paddingLeft = 0;
  38820. me.paddingTop = 0;
  38821. me.paddingRight = 0;
  38822. me.paddingBottom = 0;
  38823. // Reset minSize
  38824. me.minSize = {
  38825. width: 0,
  38826. height: 0
  38827. };
  38828. },
  38829. afterSetDimensions: noop,
  38830. //
  38831. beforeBuildLabels: noop,
  38832. buildLabels: noop,
  38833. afterBuildLabels: noop,
  38834. //
  38835. beforeFit: noop,
  38836. fit: function() {
  38837. var me = this,
  38838. valueOrDefault = helpers.getValueOrDefault,
  38839. opts = me.options,
  38840. globalDefaults = Chart.defaults.global,
  38841. display = opts.display,
  38842. fontSize = valueOrDefault(opts.fontSize, globalDefaults.defaultFontSize),
  38843. minSize = me.minSize;
  38844. if (me.isHorizontal()) {
  38845. minSize.width = me.maxWidth; // fill all the width
  38846. minSize.height = display ? fontSize + (opts.padding * 2) : 0;
  38847. } else {
  38848. minSize.width = display ? fontSize + (opts.padding * 2) : 0;
  38849. minSize.height = me.maxHeight; // fill all the height
  38850. }
  38851. me.width = minSize.width;
  38852. me.height = minSize.height;
  38853. },
  38854. afterFit: noop,
  38855. // Shared Methods
  38856. isHorizontal: function() {
  38857. var pos = this.options.position;
  38858. return pos === 'top' || pos === 'bottom';
  38859. },
  38860. // Actually draw the title block on the canvas
  38861. draw: function() {
  38862. var me = this,
  38863. ctx = me.ctx,
  38864. valueOrDefault = helpers.getValueOrDefault,
  38865. opts = me.options,
  38866. globalDefaults = Chart.defaults.global;
  38867. if (opts.display) {
  38868. var fontSize = valueOrDefault(opts.fontSize, globalDefaults.defaultFontSize),
  38869. fontStyle = valueOrDefault(opts.fontStyle, globalDefaults.defaultFontStyle),
  38870. fontFamily = valueOrDefault(opts.fontFamily, globalDefaults.defaultFontFamily),
  38871. titleFont = helpers.fontString(fontSize, fontStyle, fontFamily),
  38872. rotation = 0,
  38873. titleX,
  38874. titleY,
  38875. top = me.top,
  38876. left = me.left,
  38877. bottom = me.bottom,
  38878. right = me.right,
  38879. maxWidth;
  38880. ctx.fillStyle = valueOrDefault(opts.fontColor, globalDefaults.defaultFontColor); // render in correct colour
  38881. ctx.font = titleFont;
  38882. // Horizontal
  38883. if (me.isHorizontal()) {
  38884. titleX = left + ((right - left) / 2); // midpoint of the width
  38885. titleY = top + ((bottom - top) / 2); // midpoint of the height
  38886. maxWidth = right - left;
  38887. } else {
  38888. titleX = opts.position === 'left' ? left + (fontSize / 2) : right - (fontSize / 2);
  38889. titleY = top + ((bottom - top) / 2);
  38890. maxWidth = bottom - top;
  38891. rotation = Math.PI * (opts.position === 'left' ? -0.5 : 0.5);
  38892. }
  38893. ctx.save();
  38894. ctx.translate(titleX, titleY);
  38895. ctx.rotate(rotation);
  38896. ctx.textAlign = 'center';
  38897. ctx.textBaseline = 'middle';
  38898. ctx.fillText(opts.text, 0, 0, maxWidth);
  38899. ctx.restore();
  38900. }
  38901. }
  38902. });
  38903. function createNewTitleBlockAndAttach(chartInstance, titleOpts) {
  38904. var title = new Chart.Title({
  38905. ctx: chartInstance.chart.ctx,
  38906. options: titleOpts,
  38907. chart: chartInstance
  38908. });
  38909. chartInstance.titleBlock = title;
  38910. Chart.layoutService.addBox(chartInstance, title);
  38911. }
  38912. // Register the title plugin
  38913. Chart.plugins.register({
  38914. beforeInit: function(chartInstance) {
  38915. var titleOpts = chartInstance.options.title;
  38916. if (titleOpts) {
  38917. createNewTitleBlockAndAttach(chartInstance, titleOpts);
  38918. }
  38919. },
  38920. beforeUpdate: function(chartInstance) {
  38921. var titleOpts = chartInstance.options.title;
  38922. if (titleOpts) {
  38923. titleOpts = helpers.configMerge(Chart.defaults.global.title, titleOpts);
  38924. if (chartInstance.titleBlock) {
  38925. chartInstance.titleBlock.options = titleOpts;
  38926. } else {
  38927. createNewTitleBlockAndAttach(chartInstance, titleOpts);
  38928. }
  38929. } else {
  38930. Chart.layoutService.removeBox(chartInstance, chartInstance.titleBlock);
  38931. delete chartInstance.titleBlock;
  38932. }
  38933. }
  38934. });
  38935. };
  38936. /***/ }),
  38937. /* 151 */
  38938. /***/ (function(module, exports, __webpack_require__) {
  38939. "use strict";
  38940. module.exports = function(Chart) {
  38941. var helpers = Chart.helpers;
  38942. /**
  38943. * Helper method to merge the opacity into a color
  38944. */
  38945. function mergeOpacity(colorString, opacity) {
  38946. var color = helpers.color(colorString);
  38947. return color.alpha(opacity * color.alpha()).rgbaString();
  38948. }
  38949. Chart.defaults.global.tooltips = {
  38950. enabled: true,
  38951. custom: null,
  38952. mode: 'nearest',
  38953. position: 'average',
  38954. intersect: true,
  38955. backgroundColor: 'rgba(0,0,0,0.8)',
  38956. titleFontStyle: 'bold',
  38957. titleSpacing: 2,
  38958. titleMarginBottom: 6,
  38959. titleFontColor: '#fff',
  38960. titleAlign: 'left',
  38961. bodySpacing: 2,
  38962. bodyFontColor: '#fff',
  38963. bodyAlign: 'left',
  38964. footerFontStyle: 'bold',
  38965. footerSpacing: 2,
  38966. footerMarginTop: 6,
  38967. footerFontColor: '#fff',
  38968. footerAlign: 'left',
  38969. yPadding: 6,
  38970. xPadding: 6,
  38971. caretSize: 5,
  38972. cornerRadius: 6,
  38973. multiKeyBackground: '#fff',
  38974. displayColors: true,
  38975. callbacks: {
  38976. // Args are: (tooltipItems, data)
  38977. beforeTitle: helpers.noop,
  38978. title: function(tooltipItems, data) {
  38979. // Pick first xLabel for now
  38980. var title = '';
  38981. var labels = data.labels;
  38982. var labelCount = labels ? labels.length : 0;
  38983. if (tooltipItems.length > 0) {
  38984. var item = tooltipItems[0];
  38985. if (item.xLabel) {
  38986. title = item.xLabel;
  38987. } else if (labelCount > 0 && item.index < labelCount) {
  38988. title = labels[item.index];
  38989. }
  38990. }
  38991. return title;
  38992. },
  38993. afterTitle: helpers.noop,
  38994. // Args are: (tooltipItems, data)
  38995. beforeBody: helpers.noop,
  38996. // Args are: (tooltipItem, data)
  38997. beforeLabel: helpers.noop,
  38998. label: function(tooltipItem, data) {
  38999. var datasetLabel = data.datasets[tooltipItem.datasetIndex].label || '';
  39000. return datasetLabel + ': ' + tooltipItem.yLabel;
  39001. },
  39002. labelColor: function(tooltipItem, chartInstance) {
  39003. var meta = chartInstance.getDatasetMeta(tooltipItem.datasetIndex);
  39004. var activeElement = meta.data[tooltipItem.index];
  39005. var view = activeElement._view;
  39006. return {
  39007. borderColor: view.borderColor,
  39008. backgroundColor: view.backgroundColor
  39009. };
  39010. },
  39011. afterLabel: helpers.noop,
  39012. // Args are: (tooltipItems, data)
  39013. afterBody: helpers.noop,
  39014. // Args are: (tooltipItems, data)
  39015. beforeFooter: helpers.noop,
  39016. footer: helpers.noop,
  39017. afterFooter: helpers.noop
  39018. }
  39019. };
  39020. // Helper to push or concat based on if the 2nd parameter is an array or not
  39021. function pushOrConcat(base, toPush) {
  39022. if (toPush) {
  39023. if (helpers.isArray(toPush)) {
  39024. // base = base.concat(toPush);
  39025. Array.prototype.push.apply(base, toPush);
  39026. } else {
  39027. base.push(toPush);
  39028. }
  39029. }
  39030. return base;
  39031. }
  39032. // Private helper to create a tooltip item model
  39033. // @param element : the chart element (point, arc, bar) to create the tooltip item for
  39034. // @return : new tooltip item
  39035. function createTooltipItem(element) {
  39036. var xScale = element._xScale;
  39037. var yScale = element._yScale || element._scale; // handle radar || polarArea charts
  39038. var index = element._index,
  39039. datasetIndex = element._datasetIndex;
  39040. return {
  39041. xLabel: xScale ? xScale.getLabelForIndex(index, datasetIndex) : '',
  39042. yLabel: yScale ? yScale.getLabelForIndex(index, datasetIndex) : '',
  39043. index: index,
  39044. datasetIndex: datasetIndex,
  39045. x: element._model.x,
  39046. y: element._model.y
  39047. };
  39048. }
  39049. /**
  39050. * Helper to get the reset model for the tooltip
  39051. * @param tooltipOpts {Object} the tooltip options
  39052. */
  39053. function getBaseModel(tooltipOpts) {
  39054. var globalDefaults = Chart.defaults.global;
  39055. var getValueOrDefault = helpers.getValueOrDefault;
  39056. return {
  39057. // Positioning
  39058. xPadding: tooltipOpts.xPadding,
  39059. yPadding: tooltipOpts.yPadding,
  39060. xAlign: tooltipOpts.xAlign,
  39061. yAlign: tooltipOpts.yAlign,
  39062. // Body
  39063. bodyFontColor: tooltipOpts.bodyFontColor,
  39064. _bodyFontFamily: getValueOrDefault(tooltipOpts.bodyFontFamily, globalDefaults.defaultFontFamily),
  39065. _bodyFontStyle: getValueOrDefault(tooltipOpts.bodyFontStyle, globalDefaults.defaultFontStyle),
  39066. _bodyAlign: tooltipOpts.bodyAlign,
  39067. bodyFontSize: getValueOrDefault(tooltipOpts.bodyFontSize, globalDefaults.defaultFontSize),
  39068. bodySpacing: tooltipOpts.bodySpacing,
  39069. // Title
  39070. titleFontColor: tooltipOpts.titleFontColor,
  39071. _titleFontFamily: getValueOrDefault(tooltipOpts.titleFontFamily, globalDefaults.defaultFontFamily),
  39072. _titleFontStyle: getValueOrDefault(tooltipOpts.titleFontStyle, globalDefaults.defaultFontStyle),
  39073. titleFontSize: getValueOrDefault(tooltipOpts.titleFontSize, globalDefaults.defaultFontSize),
  39074. _titleAlign: tooltipOpts.titleAlign,
  39075. titleSpacing: tooltipOpts.titleSpacing,
  39076. titleMarginBottom: tooltipOpts.titleMarginBottom,
  39077. // Footer
  39078. footerFontColor: tooltipOpts.footerFontColor,
  39079. _footerFontFamily: getValueOrDefault(tooltipOpts.footerFontFamily, globalDefaults.defaultFontFamily),
  39080. _footerFontStyle: getValueOrDefault(tooltipOpts.footerFontStyle, globalDefaults.defaultFontStyle),
  39081. footerFontSize: getValueOrDefault(tooltipOpts.footerFontSize, globalDefaults.defaultFontSize),
  39082. _footerAlign: tooltipOpts.footerAlign,
  39083. footerSpacing: tooltipOpts.footerSpacing,
  39084. footerMarginTop: tooltipOpts.footerMarginTop,
  39085. // Appearance
  39086. caretSize: tooltipOpts.caretSize,
  39087. cornerRadius: tooltipOpts.cornerRadius,
  39088. backgroundColor: tooltipOpts.backgroundColor,
  39089. opacity: 0,
  39090. legendColorBackground: tooltipOpts.multiKeyBackground,
  39091. displayColors: tooltipOpts.displayColors
  39092. };
  39093. }
  39094. /**
  39095. * Get the size of the tooltip
  39096. */
  39097. function getTooltipSize(tooltip, model) {
  39098. var ctx = tooltip._chart.ctx;
  39099. var height = model.yPadding * 2; // Tooltip Padding
  39100. var width = 0;
  39101. // Count of all lines in the body
  39102. var body = model.body;
  39103. var combinedBodyLength = body.reduce(function(count, bodyItem) {
  39104. return count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length;
  39105. }, 0);
  39106. combinedBodyLength += model.beforeBody.length + model.afterBody.length;
  39107. var titleLineCount = model.title.length;
  39108. var footerLineCount = model.footer.length;
  39109. var titleFontSize = model.titleFontSize,
  39110. bodyFontSize = model.bodyFontSize,
  39111. footerFontSize = model.footerFontSize;
  39112. height += titleLineCount * titleFontSize; // Title Lines
  39113. height += titleLineCount ? (titleLineCount - 1) * model.titleSpacing : 0; // Title Line Spacing
  39114. height += titleLineCount ? model.titleMarginBottom : 0; // Title's bottom Margin
  39115. height += combinedBodyLength * bodyFontSize; // Body Lines
  39116. height += combinedBodyLength ? (combinedBodyLength - 1) * model.bodySpacing : 0; // Body Line Spacing
  39117. height += footerLineCount ? model.footerMarginTop : 0; // Footer Margin
  39118. height += footerLineCount * (footerFontSize); // Footer Lines
  39119. height += footerLineCount ? (footerLineCount - 1) * model.footerSpacing : 0; // Footer Line Spacing
  39120. // Title width
  39121. var widthPadding = 0;
  39122. var maxLineWidth = function(line) {
  39123. width = Math.max(width, ctx.measureText(line).width + widthPadding);
  39124. };
  39125. ctx.font = helpers.fontString(titleFontSize, model._titleFontStyle, model._titleFontFamily);
  39126. helpers.each(model.title, maxLineWidth);
  39127. // Body width
  39128. ctx.font = helpers.fontString(bodyFontSize, model._bodyFontStyle, model._bodyFontFamily);
  39129. helpers.each(model.beforeBody.concat(model.afterBody), maxLineWidth);
  39130. // Body lines may include some extra width due to the color box
  39131. widthPadding = model.displayColors ? (bodyFontSize + 2) : 0;
  39132. helpers.each(body, function(bodyItem) {
  39133. helpers.each(bodyItem.before, maxLineWidth);
  39134. helpers.each(bodyItem.lines, maxLineWidth);
  39135. helpers.each(bodyItem.after, maxLineWidth);
  39136. });
  39137. // Reset back to 0
  39138. widthPadding = 0;
  39139. // Footer width
  39140. ctx.font = helpers.fontString(footerFontSize, model._footerFontStyle, model._footerFontFamily);
  39141. helpers.each(model.footer, maxLineWidth);
  39142. // Add padding
  39143. width += 2 * model.xPadding;
  39144. return {
  39145. width: width,
  39146. height: height
  39147. };
  39148. }
  39149. /**
  39150. * Helper to get the alignment of a tooltip given the size
  39151. */
  39152. function determineAlignment(tooltip, size) {
  39153. var model = tooltip._model;
  39154. var chart = tooltip._chart;
  39155. var chartArea = tooltip._chartInstance.chartArea;
  39156. var xAlign = 'center';
  39157. var yAlign = 'center';
  39158. if (model.y < size.height) {
  39159. yAlign = 'top';
  39160. } else if (model.y > (chart.height - size.height)) {
  39161. yAlign = 'bottom';
  39162. }
  39163. var lf, rf; // functions to determine left, right alignment
  39164. var olf, orf; // functions to determine if left/right alignment causes tooltip to go outside chart
  39165. var yf; // function to get the y alignment if the tooltip goes outside of the left or right edges
  39166. var midX = (chartArea.left + chartArea.right) / 2;
  39167. var midY = (chartArea.top + chartArea.bottom) / 2;
  39168. if (yAlign === 'center') {
  39169. lf = function(x) {
  39170. return x <= midX;
  39171. };
  39172. rf = function(x) {
  39173. return x > midX;
  39174. };
  39175. } else {
  39176. lf = function(x) {
  39177. return x <= (size.width / 2);
  39178. };
  39179. rf = function(x) {
  39180. return x >= (chart.width - (size.width / 2));
  39181. };
  39182. }
  39183. olf = function(x) {
  39184. return x + size.width > chart.width;
  39185. };
  39186. orf = function(x) {
  39187. return x - size.width < 0;
  39188. };
  39189. yf = function(y) {
  39190. return y <= midY ? 'top' : 'bottom';
  39191. };
  39192. if (lf(model.x)) {
  39193. xAlign = 'left';
  39194. // Is tooltip too wide and goes over the right side of the chart.?
  39195. if (olf(model.x)) {
  39196. xAlign = 'center';
  39197. yAlign = yf(model.y);
  39198. }
  39199. } else if (rf(model.x)) {
  39200. xAlign = 'right';
  39201. // Is tooltip too wide and goes outside left edge of canvas?
  39202. if (orf(model.x)) {
  39203. xAlign = 'center';
  39204. yAlign = yf(model.y);
  39205. }
  39206. }
  39207. var opts = tooltip._options;
  39208. return {
  39209. xAlign: opts.xAlign ? opts.xAlign : xAlign,
  39210. yAlign: opts.yAlign ? opts.yAlign : yAlign
  39211. };
  39212. }
  39213. /**
  39214. * @Helper to get the location a tooltip needs to be placed at given the initial position (via the vm) and the size and alignment
  39215. */
  39216. function getBackgroundPoint(vm, size, alignment) {
  39217. // Background Position
  39218. var x = vm.x;
  39219. var y = vm.y;
  39220. var caretSize = vm.caretSize,
  39221. caretPadding = vm.caretPadding,
  39222. cornerRadius = vm.cornerRadius,
  39223. xAlign = alignment.xAlign,
  39224. yAlign = alignment.yAlign,
  39225. paddingAndSize = caretSize + caretPadding,
  39226. radiusAndPadding = cornerRadius + caretPadding;
  39227. if (xAlign === 'right') {
  39228. x -= size.width;
  39229. } else if (xAlign === 'center') {
  39230. x -= (size.width / 2);
  39231. }
  39232. if (yAlign === 'top') {
  39233. y += paddingAndSize;
  39234. } else if (yAlign === 'bottom') {
  39235. y -= size.height + paddingAndSize;
  39236. } else {
  39237. y -= (size.height / 2);
  39238. }
  39239. if (yAlign === 'center') {
  39240. if (xAlign === 'left') {
  39241. x += paddingAndSize;
  39242. } else if (xAlign === 'right') {
  39243. x -= paddingAndSize;
  39244. }
  39245. } else if (xAlign === 'left') {
  39246. x -= radiusAndPadding;
  39247. } else if (xAlign === 'right') {
  39248. x += radiusAndPadding;
  39249. }
  39250. return {
  39251. x: x,
  39252. y: y
  39253. };
  39254. }
  39255. Chart.Tooltip = Chart.Element.extend({
  39256. initialize: function() {
  39257. this._model = getBaseModel(this._options);
  39258. },
  39259. // Get the title
  39260. // Args are: (tooltipItem, data)
  39261. getTitle: function() {
  39262. var me = this;
  39263. var opts = me._options;
  39264. var callbacks = opts.callbacks;
  39265. var beforeTitle = callbacks.beforeTitle.apply(me, arguments),
  39266. title = callbacks.title.apply(me, arguments),
  39267. afterTitle = callbacks.afterTitle.apply(me, arguments);
  39268. var lines = [];
  39269. lines = pushOrConcat(lines, beforeTitle);
  39270. lines = pushOrConcat(lines, title);
  39271. lines = pushOrConcat(lines, afterTitle);
  39272. return lines;
  39273. },
  39274. // Args are: (tooltipItem, data)
  39275. getBeforeBody: function() {
  39276. var lines = this._options.callbacks.beforeBody.apply(this, arguments);
  39277. return helpers.isArray(lines) ? lines : lines !== undefined ? [lines] : [];
  39278. },
  39279. // Args are: (tooltipItem, data)
  39280. getBody: function(tooltipItems, data) {
  39281. var me = this;
  39282. var callbacks = me._options.callbacks;
  39283. var bodyItems = [];
  39284. helpers.each(tooltipItems, function(tooltipItem) {
  39285. var bodyItem = {
  39286. before: [],
  39287. lines: [],
  39288. after: []
  39289. };
  39290. pushOrConcat(bodyItem.before, callbacks.beforeLabel.call(me, tooltipItem, data));
  39291. pushOrConcat(bodyItem.lines, callbacks.label.call(me, tooltipItem, data));
  39292. pushOrConcat(bodyItem.after, callbacks.afterLabel.call(me, tooltipItem, data));
  39293. bodyItems.push(bodyItem);
  39294. });
  39295. return bodyItems;
  39296. },
  39297. // Args are: (tooltipItem, data)
  39298. getAfterBody: function() {
  39299. var lines = this._options.callbacks.afterBody.apply(this, arguments);
  39300. return helpers.isArray(lines) ? lines : lines !== undefined ? [lines] : [];
  39301. },
  39302. // Get the footer and beforeFooter and afterFooter lines
  39303. // Args are: (tooltipItem, data)
  39304. getFooter: function() {
  39305. var me = this;
  39306. var callbacks = me._options.callbacks;
  39307. var beforeFooter = callbacks.beforeFooter.apply(me, arguments);
  39308. var footer = callbacks.footer.apply(me, arguments);
  39309. var afterFooter = callbacks.afterFooter.apply(me, arguments);
  39310. var lines = [];
  39311. lines = pushOrConcat(lines, beforeFooter);
  39312. lines = pushOrConcat(lines, footer);
  39313. lines = pushOrConcat(lines, afterFooter);
  39314. return lines;
  39315. },
  39316. update: function(changed) {
  39317. var me = this;
  39318. var opts = me._options;
  39319. // Need to regenerate the model because its faster than using extend and it is necessary due to the optimization in Chart.Element.transition
  39320. // 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
  39321. // which breaks any animations.
  39322. var existingModel = me._model;
  39323. var model = me._model = getBaseModel(opts);
  39324. var active = me._active;
  39325. var data = me._data;
  39326. var chartInstance = me._chartInstance;
  39327. // In the case where active.length === 0 we need to keep these at existing values for good animations
  39328. var alignment = {
  39329. xAlign: existingModel.xAlign,
  39330. yAlign: existingModel.yAlign
  39331. };
  39332. var backgroundPoint = {
  39333. x: existingModel.x,
  39334. y: existingModel.y
  39335. };
  39336. var tooltipSize = {
  39337. width: existingModel.width,
  39338. height: existingModel.height
  39339. };
  39340. var tooltipPosition = {
  39341. x: existingModel.caretX,
  39342. y: existingModel.caretY
  39343. };
  39344. var i, len;
  39345. if (active.length) {
  39346. model.opacity = 1;
  39347. var labelColors = [];
  39348. tooltipPosition = Chart.Tooltip.positioners[opts.position](active, me._eventPosition);
  39349. var tooltipItems = [];
  39350. for (i = 0, len = active.length; i < len; ++i) {
  39351. tooltipItems.push(createTooltipItem(active[i]));
  39352. }
  39353. // If the user provided a filter function, use it to modify the tooltip items
  39354. if (opts.filter) {
  39355. tooltipItems = tooltipItems.filter(function(a) {
  39356. return opts.filter(a, data);
  39357. });
  39358. }
  39359. // If the user provided a sorting function, use it to modify the tooltip items
  39360. if (opts.itemSort) {
  39361. tooltipItems = tooltipItems.sort(function(a, b) {
  39362. return opts.itemSort(a, b, data);
  39363. });
  39364. }
  39365. // Determine colors for boxes
  39366. helpers.each(tooltipItems, function(tooltipItem) {
  39367. labelColors.push(opts.callbacks.labelColor.call(me, tooltipItem, chartInstance));
  39368. });
  39369. // Build the Text Lines
  39370. model.title = me.getTitle(tooltipItems, data);
  39371. model.beforeBody = me.getBeforeBody(tooltipItems, data);
  39372. model.body = me.getBody(tooltipItems, data);
  39373. model.afterBody = me.getAfterBody(tooltipItems, data);
  39374. model.footer = me.getFooter(tooltipItems, data);
  39375. // Initial positioning and colors
  39376. model.x = Math.round(tooltipPosition.x);
  39377. model.y = Math.round(tooltipPosition.y);
  39378. model.caretPadding = helpers.getValueOrDefault(tooltipPosition.padding, 2);
  39379. model.labelColors = labelColors;
  39380. // data points
  39381. model.dataPoints = tooltipItems;
  39382. // We need to determine alignment of the tooltip
  39383. tooltipSize = getTooltipSize(this, model);
  39384. alignment = determineAlignment(this, tooltipSize);
  39385. // Final Size and Position
  39386. backgroundPoint = getBackgroundPoint(model, tooltipSize, alignment);
  39387. } else {
  39388. model.opacity = 0;
  39389. }
  39390. model.xAlign = alignment.xAlign;
  39391. model.yAlign = alignment.yAlign;
  39392. model.x = backgroundPoint.x;
  39393. model.y = backgroundPoint.y;
  39394. model.width = tooltipSize.width;
  39395. model.height = tooltipSize.height;
  39396. // Point where the caret on the tooltip points to
  39397. model.caretX = tooltipPosition.x;
  39398. model.caretY = tooltipPosition.y;
  39399. me._model = model;
  39400. if (changed && opts.custom) {
  39401. opts.custom.call(me, model);
  39402. }
  39403. return me;
  39404. },
  39405. drawCaret: function(tooltipPoint, size, opacity) {
  39406. var vm = this._view;
  39407. var ctx = this._chart.ctx;
  39408. var x1, x2, x3;
  39409. var y1, y2, y3;
  39410. var caretSize = vm.caretSize;
  39411. var cornerRadius = vm.cornerRadius;
  39412. var xAlign = vm.xAlign,
  39413. yAlign = vm.yAlign;
  39414. var ptX = tooltipPoint.x,
  39415. ptY = tooltipPoint.y;
  39416. var width = size.width,
  39417. height = size.height;
  39418. if (yAlign === 'center') {
  39419. // Left or right side
  39420. if (xAlign === 'left') {
  39421. x1 = ptX;
  39422. x2 = x1 - caretSize;
  39423. x3 = x1;
  39424. } else {
  39425. x1 = ptX + width;
  39426. x2 = x1 + caretSize;
  39427. x3 = x1;
  39428. }
  39429. y2 = ptY + (height / 2);
  39430. y1 = y2 - caretSize;
  39431. y3 = y2 + caretSize;
  39432. } else {
  39433. if (xAlign === 'left') {
  39434. x1 = ptX + cornerRadius;
  39435. x2 = x1 + caretSize;
  39436. x3 = x2 + caretSize;
  39437. } else if (xAlign === 'right') {
  39438. x1 = ptX + width - cornerRadius;
  39439. x2 = x1 - caretSize;
  39440. x3 = x2 - caretSize;
  39441. } else {
  39442. x2 = ptX + (width / 2);
  39443. x1 = x2 - caretSize;
  39444. x3 = x2 + caretSize;
  39445. }
  39446. if (yAlign === 'top') {
  39447. y1 = ptY;
  39448. y2 = y1 - caretSize;
  39449. y3 = y1;
  39450. } else {
  39451. y1 = ptY + height;
  39452. y2 = y1 + caretSize;
  39453. y3 = y1;
  39454. }
  39455. }
  39456. ctx.fillStyle = mergeOpacity(vm.backgroundColor, opacity);
  39457. ctx.beginPath();
  39458. ctx.moveTo(x1, y1);
  39459. ctx.lineTo(x2, y2);
  39460. ctx.lineTo(x3, y3);
  39461. ctx.closePath();
  39462. ctx.fill();
  39463. },
  39464. drawTitle: function(pt, vm, ctx, opacity) {
  39465. var title = vm.title;
  39466. if (title.length) {
  39467. ctx.textAlign = vm._titleAlign;
  39468. ctx.textBaseline = 'top';
  39469. var titleFontSize = vm.titleFontSize,
  39470. titleSpacing = vm.titleSpacing;
  39471. ctx.fillStyle = mergeOpacity(vm.titleFontColor, opacity);
  39472. ctx.font = helpers.fontString(titleFontSize, vm._titleFontStyle, vm._titleFontFamily);
  39473. var i, len;
  39474. for (i = 0, len = title.length; i < len; ++i) {
  39475. ctx.fillText(title[i], pt.x, pt.y);
  39476. pt.y += titleFontSize + titleSpacing; // Line Height and spacing
  39477. if (i + 1 === title.length) {
  39478. pt.y += vm.titleMarginBottom - titleSpacing; // If Last, add margin, remove spacing
  39479. }
  39480. }
  39481. }
  39482. },
  39483. drawBody: function(pt, vm, ctx, opacity) {
  39484. var bodyFontSize = vm.bodyFontSize;
  39485. var bodySpacing = vm.bodySpacing;
  39486. var body = vm.body;
  39487. ctx.textAlign = vm._bodyAlign;
  39488. ctx.textBaseline = 'top';
  39489. var textColor = mergeOpacity(vm.bodyFontColor, opacity);
  39490. ctx.fillStyle = textColor;
  39491. ctx.font = helpers.fontString(bodyFontSize, vm._bodyFontStyle, vm._bodyFontFamily);
  39492. // Before Body
  39493. var xLinePadding = 0;
  39494. var fillLineOfText = function(line) {
  39495. ctx.fillText(line, pt.x + xLinePadding, pt.y);
  39496. pt.y += bodyFontSize + bodySpacing;
  39497. };
  39498. // Before body lines
  39499. helpers.each(vm.beforeBody, fillLineOfText);
  39500. var drawColorBoxes = vm.displayColors;
  39501. xLinePadding = drawColorBoxes ? (bodyFontSize + 2) : 0;
  39502. // Draw body lines now
  39503. helpers.each(body, function(bodyItem, i) {
  39504. helpers.each(bodyItem.before, fillLineOfText);
  39505. helpers.each(bodyItem.lines, function(line) {
  39506. // Draw Legend-like boxes if needed
  39507. if (drawColorBoxes) {
  39508. // Fill a white rect so that colours merge nicely if the opacity is < 1
  39509. ctx.fillStyle = mergeOpacity(vm.legendColorBackground, opacity);
  39510. ctx.fillRect(pt.x, pt.y, bodyFontSize, bodyFontSize);
  39511. // Border
  39512. ctx.strokeStyle = mergeOpacity(vm.labelColors[i].borderColor, opacity);
  39513. ctx.strokeRect(pt.x, pt.y, bodyFontSize, bodyFontSize);
  39514. // Inner square
  39515. ctx.fillStyle = mergeOpacity(vm.labelColors[i].backgroundColor, opacity);
  39516. ctx.fillRect(pt.x + 1, pt.y + 1, bodyFontSize - 2, bodyFontSize - 2);
  39517. ctx.fillStyle = textColor;
  39518. }
  39519. fillLineOfText(line);
  39520. });
  39521. helpers.each(bodyItem.after, fillLineOfText);
  39522. });
  39523. // Reset back to 0 for after body
  39524. xLinePadding = 0;
  39525. // After body lines
  39526. helpers.each(vm.afterBody, fillLineOfText);
  39527. pt.y -= bodySpacing; // Remove last body spacing
  39528. },
  39529. drawFooter: function(pt, vm, ctx, opacity) {
  39530. var footer = vm.footer;
  39531. if (footer.length) {
  39532. pt.y += vm.footerMarginTop;
  39533. ctx.textAlign = vm._footerAlign;
  39534. ctx.textBaseline = 'top';
  39535. ctx.fillStyle = mergeOpacity(vm.footerFontColor, opacity);
  39536. ctx.font = helpers.fontString(vm.footerFontSize, vm._footerFontStyle, vm._footerFontFamily);
  39537. helpers.each(footer, function(line) {
  39538. ctx.fillText(line, pt.x, pt.y);
  39539. pt.y += vm.footerFontSize + vm.footerSpacing;
  39540. });
  39541. }
  39542. },
  39543. drawBackground: function(pt, vm, ctx, tooltipSize, opacity) {
  39544. ctx.fillStyle = mergeOpacity(vm.backgroundColor, opacity);
  39545. helpers.drawRoundedRectangle(ctx, pt.x, pt.y, tooltipSize.width, tooltipSize.height, vm.cornerRadius);
  39546. ctx.fill();
  39547. },
  39548. draw: function() {
  39549. var ctx = this._chart.ctx;
  39550. var vm = this._view;
  39551. if (vm.opacity === 0) {
  39552. return;
  39553. }
  39554. var tooltipSize = {
  39555. width: vm.width,
  39556. height: vm.height
  39557. };
  39558. var pt = {
  39559. x: vm.x,
  39560. y: vm.y
  39561. };
  39562. // IE11/Edge does not like very small opacities, so snap to 0
  39563. var opacity = Math.abs(vm.opacity < 1e-3) ? 0 : vm.opacity;
  39564. if (this._options.enabled) {
  39565. // Draw Background
  39566. this.drawBackground(pt, vm, ctx, tooltipSize, opacity);
  39567. // Draw Caret
  39568. this.drawCaret(pt, tooltipSize, opacity);
  39569. // Draw Title, Body, and Footer
  39570. pt.x += vm.xPadding;
  39571. pt.y += vm.yPadding;
  39572. // Titles
  39573. this.drawTitle(pt, vm, ctx, opacity);
  39574. // Body
  39575. this.drawBody(pt, vm, ctx, opacity);
  39576. // Footer
  39577. this.drawFooter(pt, vm, ctx, opacity);
  39578. }
  39579. },
  39580. /**
  39581. * Handle an event
  39582. * @private
  39583. * @param {IEvent} event - The event to handle
  39584. * @returns {Boolean} true if the tooltip changed
  39585. */
  39586. handleEvent: function(e) {
  39587. var me = this;
  39588. var options = me._options;
  39589. var changed = false;
  39590. me._lastActive = me._lastActive || [];
  39591. // Find Active Elements for tooltips
  39592. if (e.type === 'mouseout') {
  39593. me._active = [];
  39594. } else {
  39595. me._active = me._chartInstance.getElementsAtEventForMode(e, options.mode, options);
  39596. }
  39597. // Remember Last Actives
  39598. changed = !helpers.arrayEquals(me._active, me._lastActive);
  39599. me._lastActive = me._active;
  39600. if (options.enabled || options.custom) {
  39601. me._eventPosition = {
  39602. x: e.x,
  39603. y: e.y
  39604. };
  39605. var model = me._model;
  39606. me.update(true);
  39607. me.pivot();
  39608. // See if our tooltip position changed
  39609. changed |= (model.x !== me._model.x) || (model.y !== me._model.y);
  39610. }
  39611. return changed;
  39612. }
  39613. });
  39614. /**
  39615. * @namespace Chart.Tooltip.positioners
  39616. */
  39617. Chart.Tooltip.positioners = {
  39618. /**
  39619. * Average mode places the tooltip at the average position of the elements shown
  39620. * @function Chart.Tooltip.positioners.average
  39621. * @param elements {ChartElement[]} the elements being displayed in the tooltip
  39622. * @returns {Point} tooltip position
  39623. */
  39624. average: function(elements) {
  39625. if (!elements.length) {
  39626. return false;
  39627. }
  39628. var i, len;
  39629. var x = 0;
  39630. var y = 0;
  39631. var count = 0;
  39632. for (i = 0, len = elements.length; i < len; ++i) {
  39633. var el = elements[i];
  39634. if (el && el.hasValue()) {
  39635. var pos = el.tooltipPosition();
  39636. x += pos.x;
  39637. y += pos.y;
  39638. ++count;
  39639. }
  39640. }
  39641. return {
  39642. x: Math.round(x / count),
  39643. y: Math.round(y / count)
  39644. };
  39645. },
  39646. /**
  39647. * Gets the tooltip position nearest of the item nearest to the event position
  39648. * @function Chart.Tooltip.positioners.nearest
  39649. * @param elements {Chart.Element[]} the tooltip elements
  39650. * @param eventPosition {Point} the position of the event in canvas coordinates
  39651. * @returns {Point} the tooltip position
  39652. */
  39653. nearest: function(elements, eventPosition) {
  39654. var x = eventPosition.x;
  39655. var y = eventPosition.y;
  39656. var nearestElement;
  39657. var minDistance = Number.POSITIVE_INFINITY;
  39658. var i, len;
  39659. for (i = 0, len = elements.length; i < len; ++i) {
  39660. var el = elements[i];
  39661. if (el && el.hasValue()) {
  39662. var center = el.getCenterPoint();
  39663. var d = helpers.distanceBetweenPoints(eventPosition, center);
  39664. if (d < minDistance) {
  39665. minDistance = d;
  39666. nearestElement = el;
  39667. }
  39668. }
  39669. }
  39670. if (nearestElement) {
  39671. var tp = nearestElement.tooltipPosition();
  39672. x = tp.x;
  39673. y = tp.y;
  39674. }
  39675. return {
  39676. x: x,
  39677. y: y
  39678. };
  39679. }
  39680. };
  39681. };
  39682. /***/ }),
  39683. /* 152 */
  39684. /***/ (function(module, exports, __webpack_require__) {
  39685. "use strict";
  39686. module.exports = function(Chart) {
  39687. var helpers = Chart.helpers,
  39688. globalOpts = Chart.defaults.global;
  39689. globalOpts.elements.arc = {
  39690. backgroundColor: globalOpts.defaultColor,
  39691. borderColor: '#fff',
  39692. borderWidth: 2
  39693. };
  39694. Chart.elements.Arc = Chart.Element.extend({
  39695. inLabelRange: function(mouseX) {
  39696. var vm = this._view;
  39697. if (vm) {
  39698. return (Math.pow(mouseX - vm.x, 2) < Math.pow(vm.radius + vm.hoverRadius, 2));
  39699. }
  39700. return false;
  39701. },
  39702. inRange: function(chartX, chartY) {
  39703. var vm = this._view;
  39704. if (vm) {
  39705. var pointRelativePosition = helpers.getAngleFromPoint(vm, {
  39706. x: chartX,
  39707. y: chartY
  39708. }),
  39709. angle = pointRelativePosition.angle,
  39710. distance = pointRelativePosition.distance;
  39711. // Sanitise angle range
  39712. var startAngle = vm.startAngle;
  39713. var endAngle = vm.endAngle;
  39714. while (endAngle < startAngle) {
  39715. endAngle += 2.0 * Math.PI;
  39716. }
  39717. while (angle > endAngle) {
  39718. angle -= 2.0 * Math.PI;
  39719. }
  39720. while (angle < startAngle) {
  39721. angle += 2.0 * Math.PI;
  39722. }
  39723. // Check if within the range of the open/close angle
  39724. var betweenAngles = (angle >= startAngle && angle <= endAngle),
  39725. withinRadius = (distance >= vm.innerRadius && distance <= vm.outerRadius);
  39726. return (betweenAngles && withinRadius);
  39727. }
  39728. return false;
  39729. },
  39730. getCenterPoint: function() {
  39731. var vm = this._view;
  39732. var halfAngle = (vm.startAngle + vm.endAngle) / 2;
  39733. var halfRadius = (vm.innerRadius + vm.outerRadius) / 2;
  39734. return {
  39735. x: vm.x + Math.cos(halfAngle) * halfRadius,
  39736. y: vm.y + Math.sin(halfAngle) * halfRadius
  39737. };
  39738. },
  39739. getArea: function() {
  39740. var vm = this._view;
  39741. return Math.PI * ((vm.endAngle - vm.startAngle) / (2 * Math.PI)) * (Math.pow(vm.outerRadius, 2) - Math.pow(vm.innerRadius, 2));
  39742. },
  39743. tooltipPosition: function() {
  39744. var vm = this._view;
  39745. var centreAngle = vm.startAngle + ((vm.endAngle - vm.startAngle) / 2),
  39746. rangeFromCentre = (vm.outerRadius - vm.innerRadius) / 2 + vm.innerRadius;
  39747. return {
  39748. x: vm.x + (Math.cos(centreAngle) * rangeFromCentre),
  39749. y: vm.y + (Math.sin(centreAngle) * rangeFromCentre)
  39750. };
  39751. },
  39752. draw: function() {
  39753. var ctx = this._chart.ctx,
  39754. vm = this._view,
  39755. sA = vm.startAngle,
  39756. eA = vm.endAngle;
  39757. ctx.beginPath();
  39758. ctx.arc(vm.x, vm.y, vm.outerRadius, sA, eA);
  39759. ctx.arc(vm.x, vm.y, vm.innerRadius, eA, sA, true);
  39760. ctx.closePath();
  39761. ctx.strokeStyle = vm.borderColor;
  39762. ctx.lineWidth = vm.borderWidth;
  39763. ctx.fillStyle = vm.backgroundColor;
  39764. ctx.fill();
  39765. ctx.lineJoin = 'bevel';
  39766. if (vm.borderWidth) {
  39767. ctx.stroke();
  39768. }
  39769. }
  39770. });
  39771. };
  39772. /***/ }),
  39773. /* 153 */
  39774. /***/ (function(module, exports, __webpack_require__) {
  39775. "use strict";
  39776. module.exports = function(Chart) {
  39777. var helpers = Chart.helpers;
  39778. var globalDefaults = Chart.defaults.global;
  39779. Chart.defaults.global.elements.line = {
  39780. tension: 0.4,
  39781. backgroundColor: globalDefaults.defaultColor,
  39782. borderWidth: 3,
  39783. borderColor: globalDefaults.defaultColor,
  39784. borderCapStyle: 'butt',
  39785. borderDash: [],
  39786. borderDashOffset: 0.0,
  39787. borderJoinStyle: 'miter',
  39788. capBezierPoints: true,
  39789. fill: true, // do we fill in the area between the line and its base axis
  39790. };
  39791. Chart.elements.Line = Chart.Element.extend({
  39792. draw: function() {
  39793. var me = this;
  39794. var vm = me._view;
  39795. var spanGaps = vm.spanGaps;
  39796. var fillPoint = vm.scaleZero;
  39797. var loop = me._loop;
  39798. // Handle different fill modes for cartesian lines
  39799. if (!loop) {
  39800. if (vm.fill === 'top') {
  39801. fillPoint = vm.scaleTop;
  39802. } else if (vm.fill === 'bottom') {
  39803. fillPoint = vm.scaleBottom;
  39804. }
  39805. }
  39806. var ctx = me._chart.ctx;
  39807. ctx.save();
  39808. // Helper function to draw a line to a point
  39809. function lineToPoint(previousPoint, point) {
  39810. var pointVM = point._view;
  39811. if (point._view.steppedLine === true) {
  39812. ctx.lineTo(pointVM.x, previousPoint._view.y);
  39813. ctx.lineTo(pointVM.x, pointVM.y);
  39814. } else if (point._view.tension === 0) {
  39815. ctx.lineTo(pointVM.x, pointVM.y);
  39816. } else {
  39817. ctx.bezierCurveTo(
  39818. previousPoint._view.controlPointNextX,
  39819. previousPoint._view.controlPointNextY,
  39820. pointVM.controlPointPreviousX,
  39821. pointVM.controlPointPreviousY,
  39822. pointVM.x,
  39823. pointVM.y
  39824. );
  39825. }
  39826. }
  39827. var points = me._children.slice(); // clone array
  39828. var lastDrawnIndex = -1;
  39829. // If we are looping, adding the first point again
  39830. if (loop && points.length) {
  39831. points.push(points[0]);
  39832. }
  39833. var index, current, previous, currentVM;
  39834. // Fill Line
  39835. if (points.length && vm.fill) {
  39836. ctx.beginPath();
  39837. for (index = 0; index < points.length; ++index) {
  39838. current = points[index];
  39839. previous = helpers.previousItem(points, index);
  39840. currentVM = current._view;
  39841. // First point moves to it's starting position no matter what
  39842. if (index === 0) {
  39843. if (loop) {
  39844. ctx.moveTo(fillPoint.x, fillPoint.y);
  39845. } else {
  39846. ctx.moveTo(currentVM.x, fillPoint);
  39847. }
  39848. if (!currentVM.skip) {
  39849. lastDrawnIndex = index;
  39850. ctx.lineTo(currentVM.x, currentVM.y);
  39851. }
  39852. } else {
  39853. previous = lastDrawnIndex === -1 ? previous : points[lastDrawnIndex];
  39854. if (currentVM.skip) {
  39855. // Only do this if this is the first point that is skipped
  39856. if (!spanGaps && lastDrawnIndex === (index - 1)) {
  39857. if (loop) {
  39858. ctx.lineTo(fillPoint.x, fillPoint.y);
  39859. } else {
  39860. ctx.lineTo(previous._view.x, fillPoint);
  39861. }
  39862. }
  39863. } else {
  39864. if (lastDrawnIndex !== (index - 1)) {
  39865. // 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.
  39866. // If the first data point is NaN, then there is no real gap to skip
  39867. if (spanGaps && lastDrawnIndex !== -1) {
  39868. // We are spanning the gap, so simple draw a line to this point
  39869. lineToPoint(previous, current);
  39870. } else if (loop) {
  39871. ctx.lineTo(currentVM.x, currentVM.y);
  39872. } else {
  39873. ctx.lineTo(currentVM.x, fillPoint);
  39874. ctx.lineTo(currentVM.x, currentVM.y);
  39875. }
  39876. } else {
  39877. // Line to next point
  39878. lineToPoint(previous, current);
  39879. }
  39880. lastDrawnIndex = index;
  39881. }
  39882. }
  39883. }
  39884. if (!loop && lastDrawnIndex !== -1) {
  39885. ctx.lineTo(points[lastDrawnIndex]._view.x, fillPoint);
  39886. }
  39887. ctx.fillStyle = vm.backgroundColor || globalDefaults.defaultColor;
  39888. ctx.closePath();
  39889. ctx.fill();
  39890. }
  39891. // Stroke Line Options
  39892. var globalOptionLineElements = globalDefaults.elements.line;
  39893. ctx.lineCap = vm.borderCapStyle || globalOptionLineElements.borderCapStyle;
  39894. // IE 9 and 10 do not support line dash
  39895. if (ctx.setLineDash) {
  39896. ctx.setLineDash(vm.borderDash || globalOptionLineElements.borderDash);
  39897. }
  39898. ctx.lineDashOffset = vm.borderDashOffset || globalOptionLineElements.borderDashOffset;
  39899. ctx.lineJoin = vm.borderJoinStyle || globalOptionLineElements.borderJoinStyle;
  39900. ctx.lineWidth = vm.borderWidth || globalOptionLineElements.borderWidth;
  39901. ctx.strokeStyle = vm.borderColor || globalDefaults.defaultColor;
  39902. // Stroke Line
  39903. ctx.beginPath();
  39904. lastDrawnIndex = -1;
  39905. for (index = 0; index < points.length; ++index) {
  39906. current = points[index];
  39907. previous = helpers.previousItem(points, index);
  39908. currentVM = current._view;
  39909. // First point moves to it's starting position no matter what
  39910. if (index === 0) {
  39911. if (!currentVM.skip) {
  39912. ctx.moveTo(currentVM.x, currentVM.y);
  39913. lastDrawnIndex = index;
  39914. }
  39915. } else {
  39916. previous = lastDrawnIndex === -1 ? previous : points[lastDrawnIndex];
  39917. if (!currentVM.skip) {
  39918. if ((lastDrawnIndex !== (index - 1) && !spanGaps) || lastDrawnIndex === -1) {
  39919. // There was a gap and this is the first point after the gap
  39920. ctx.moveTo(currentVM.x, currentVM.y);
  39921. } else {
  39922. // Line to next point
  39923. lineToPoint(previous, current);
  39924. }
  39925. lastDrawnIndex = index;
  39926. }
  39927. }
  39928. }
  39929. ctx.stroke();
  39930. ctx.restore();
  39931. }
  39932. });
  39933. };
  39934. /***/ }),
  39935. /* 154 */
  39936. /***/ (function(module, exports, __webpack_require__) {
  39937. "use strict";
  39938. module.exports = function(Chart) {
  39939. var helpers = Chart.helpers,
  39940. globalOpts = Chart.defaults.global,
  39941. defaultColor = globalOpts.defaultColor;
  39942. globalOpts.elements.point = {
  39943. radius: 3,
  39944. pointStyle: 'circle',
  39945. backgroundColor: defaultColor,
  39946. borderWidth: 1,
  39947. borderColor: defaultColor,
  39948. // Hover
  39949. hitRadius: 1,
  39950. hoverRadius: 4,
  39951. hoverBorderWidth: 1
  39952. };
  39953. function xRange(mouseX) {
  39954. var vm = this._view;
  39955. return vm ? (Math.pow(mouseX - vm.x, 2) < Math.pow(vm.radius + vm.hitRadius, 2)) : false;
  39956. }
  39957. function yRange(mouseY) {
  39958. var vm = this._view;
  39959. return vm ? (Math.pow(mouseY - vm.y, 2) < Math.pow(vm.radius + vm.hitRadius, 2)) : false;
  39960. }
  39961. Chart.elements.Point = Chart.Element.extend({
  39962. inRange: function(mouseX, mouseY) {
  39963. var vm = this._view;
  39964. return vm ? ((Math.pow(mouseX - vm.x, 2) + Math.pow(mouseY - vm.y, 2)) < Math.pow(vm.hitRadius + vm.radius, 2)) : false;
  39965. },
  39966. inLabelRange: xRange,
  39967. inXRange: xRange,
  39968. inYRange: yRange,
  39969. getCenterPoint: function() {
  39970. var vm = this._view;
  39971. return {
  39972. x: vm.x,
  39973. y: vm.y
  39974. };
  39975. },
  39976. getArea: function() {
  39977. return Math.PI * Math.pow(this._view.radius, 2);
  39978. },
  39979. tooltipPosition: function() {
  39980. var vm = this._view;
  39981. return {
  39982. x: vm.x,
  39983. y: vm.y,
  39984. padding: vm.radius + vm.borderWidth
  39985. };
  39986. },
  39987. draw: function(chartArea) {
  39988. var vm = this._view;
  39989. var model = this._model;
  39990. var ctx = this._chart.ctx;
  39991. var pointStyle = vm.pointStyle;
  39992. var radius = vm.radius;
  39993. var x = vm.x;
  39994. var y = vm.y;
  39995. var color = Chart.helpers.color;
  39996. var errMargin = 1.01; // 1.01 is margin for Accumulated error. (Especially Edge, IE.)
  39997. var ratio = 0;
  39998. if (vm.skip) {
  39999. return;
  40000. }
  40001. ctx.strokeStyle = vm.borderColor || defaultColor;
  40002. ctx.lineWidth = helpers.getValueOrDefault(vm.borderWidth, globalOpts.elements.point.borderWidth);
  40003. ctx.fillStyle = vm.backgroundColor || defaultColor;
  40004. // Cliping for Points.
  40005. // going out from inner charArea?
  40006. if ((chartArea !== undefined) && ((model.x < chartArea.left) || (chartArea.right*errMargin < model.x) || (model.y < chartArea.top) || (chartArea.bottom*errMargin < model.y))) {
  40007. // Point fade out
  40008. if (model.x < chartArea.left) {
  40009. ratio = (x - model.x) / (chartArea.left - model.x);
  40010. } else if (chartArea.right*errMargin < model.x) {
  40011. ratio = (model.x - x) / (model.x - chartArea.right);
  40012. } else if (model.y < chartArea.top) {
  40013. ratio = (y - model.y) / (chartArea.top - model.y);
  40014. } else if (chartArea.bottom*errMargin < model.y) {
  40015. ratio = (model.y - y) / (model.y - chartArea.bottom);
  40016. }
  40017. ratio = Math.round(ratio*100) / 100;
  40018. ctx.strokeStyle = color(ctx.strokeStyle).alpha(ratio).rgbString();
  40019. ctx.fillStyle = color(ctx.fillStyle).alpha(ratio).rgbString();
  40020. }
  40021. Chart.canvasHelpers.drawPoint(ctx, pointStyle, radius, x, y);
  40022. }
  40023. });
  40024. };
  40025. /***/ }),
  40026. /* 155 */
  40027. /***/ (function(module, exports, __webpack_require__) {
  40028. "use strict";
  40029. module.exports = function(Chart) {
  40030. var globalOpts = Chart.defaults.global;
  40031. globalOpts.elements.rectangle = {
  40032. backgroundColor: globalOpts.defaultColor,
  40033. borderWidth: 0,
  40034. borderColor: globalOpts.defaultColor,
  40035. borderSkipped: 'bottom'
  40036. };
  40037. function isVertical(bar) {
  40038. return bar._view.width !== undefined;
  40039. }
  40040. /**
  40041. * Helper function to get the bounds of the bar regardless of the orientation
  40042. * @private
  40043. * @param bar {Chart.Element.Rectangle} the bar
  40044. * @return {Bounds} bounds of the bar
  40045. */
  40046. function getBarBounds(bar) {
  40047. var vm = bar._view;
  40048. var x1, x2, y1, y2;
  40049. if (isVertical(bar)) {
  40050. // vertical
  40051. var halfWidth = vm.width / 2;
  40052. x1 = vm.x - halfWidth;
  40053. x2 = vm.x + halfWidth;
  40054. y1 = Math.min(vm.y, vm.base);
  40055. y2 = Math.max(vm.y, vm.base);
  40056. } else {
  40057. // horizontal bar
  40058. var halfHeight = vm.height / 2;
  40059. x1 = Math.min(vm.x, vm.base);
  40060. x2 = Math.max(vm.x, vm.base);
  40061. y1 = vm.y - halfHeight;
  40062. y2 = vm.y + halfHeight;
  40063. }
  40064. return {
  40065. left: x1,
  40066. top: y1,
  40067. right: x2,
  40068. bottom: y2
  40069. };
  40070. }
  40071. Chart.elements.Rectangle = Chart.Element.extend({
  40072. draw: function() {
  40073. var ctx = this._chart.ctx;
  40074. var vm = this._view;
  40075. var left, right, top, bottom, signX, signY, borderSkipped;
  40076. var borderWidth = vm.borderWidth;
  40077. if (!vm.horizontal) {
  40078. // bar
  40079. left = vm.x - vm.width / 2;
  40080. right = vm.x + vm.width / 2;
  40081. top = vm.y;
  40082. bottom = vm.base;
  40083. signX = 1;
  40084. signY = bottom > top? 1: -1;
  40085. borderSkipped = vm.borderSkipped || 'bottom';
  40086. } else {
  40087. // horizontal bar
  40088. left = vm.base;
  40089. right = vm.x;
  40090. top = vm.y - vm.height / 2;
  40091. bottom = vm.y + vm.height / 2;
  40092. signX = right > left? 1: -1;
  40093. signY = 1;
  40094. borderSkipped = vm.borderSkipped || 'left';
  40095. }
  40096. // Canvas doesn't allow us to stroke inside the width so we can
  40097. // adjust the sizes to fit if we're setting a stroke on the line
  40098. if (borderWidth) {
  40099. // borderWidth shold be less than bar width and bar height.
  40100. var barSize = Math.min(Math.abs(left - right), Math.abs(top - bottom));
  40101. borderWidth = borderWidth > barSize? barSize: borderWidth;
  40102. var halfStroke = borderWidth / 2;
  40103. // Adjust borderWidth when bar top position is near vm.base(zero).
  40104. var borderLeft = left + (borderSkipped !== 'left'? halfStroke * signX: 0);
  40105. var borderRight = right + (borderSkipped !== 'right'? -halfStroke * signX: 0);
  40106. var borderTop = top + (borderSkipped !== 'top'? halfStroke * signY: 0);
  40107. var borderBottom = bottom + (borderSkipped !== 'bottom'? -halfStroke * signY: 0);
  40108. // not become a vertical line?
  40109. if (borderLeft !== borderRight) {
  40110. top = borderTop;
  40111. bottom = borderBottom;
  40112. }
  40113. // not become a horizontal line?
  40114. if (borderTop !== borderBottom) {
  40115. left = borderLeft;
  40116. right = borderRight;
  40117. }
  40118. }
  40119. ctx.beginPath();
  40120. ctx.fillStyle = vm.backgroundColor;
  40121. ctx.strokeStyle = vm.borderColor;
  40122. ctx.lineWidth = borderWidth;
  40123. // Corner points, from bottom-left to bottom-right clockwise
  40124. // | 1 2 |
  40125. // | 0 3 |
  40126. var corners = [
  40127. [left, bottom],
  40128. [left, top],
  40129. [right, top],
  40130. [right, bottom]
  40131. ];
  40132. // Find first (starting) corner with fallback to 'bottom'
  40133. var borders = ['bottom', 'left', 'top', 'right'];
  40134. var startCorner = borders.indexOf(borderSkipped, 0);
  40135. if (startCorner === -1) {
  40136. startCorner = 0;
  40137. }
  40138. function cornerAt(index) {
  40139. return corners[(startCorner + index) % 4];
  40140. }
  40141. // Draw rectangle from 'startCorner'
  40142. var corner = cornerAt(0);
  40143. ctx.moveTo(corner[0], corner[1]);
  40144. for (var i = 1; i < 4; i++) {
  40145. corner = cornerAt(i);
  40146. ctx.lineTo(corner[0], corner[1]);
  40147. }
  40148. ctx.fill();
  40149. if (borderWidth) {
  40150. ctx.stroke();
  40151. }
  40152. },
  40153. height: function() {
  40154. var vm = this._view;
  40155. return vm.base - vm.y;
  40156. },
  40157. inRange: function(mouseX, mouseY) {
  40158. var inRange = false;
  40159. if (this._view) {
  40160. var bounds = getBarBounds(this);
  40161. inRange = mouseX >= bounds.left && mouseX <= bounds.right && mouseY >= bounds.top && mouseY <= bounds.bottom;
  40162. }
  40163. return inRange;
  40164. },
  40165. inLabelRange: function(mouseX, mouseY) {
  40166. var me = this;
  40167. if (!me._view) {
  40168. return false;
  40169. }
  40170. var inRange = false;
  40171. var bounds = getBarBounds(me);
  40172. if (isVertical(me)) {
  40173. inRange = mouseX >= bounds.left && mouseX <= bounds.right;
  40174. } else {
  40175. inRange = mouseY >= bounds.top && mouseY <= bounds.bottom;
  40176. }
  40177. return inRange;
  40178. },
  40179. inXRange: function(mouseX) {
  40180. var bounds = getBarBounds(this);
  40181. return mouseX >= bounds.left && mouseX <= bounds.right;
  40182. },
  40183. inYRange: function(mouseY) {
  40184. var bounds = getBarBounds(this);
  40185. return mouseY >= bounds.top && mouseY <= bounds.bottom;
  40186. },
  40187. getCenterPoint: function() {
  40188. var vm = this._view;
  40189. var x, y;
  40190. if (isVertical(this)) {
  40191. x = vm.x;
  40192. y = (vm.y + vm.base) / 2;
  40193. } else {
  40194. x = (vm.x + vm.base) / 2;
  40195. y = vm.y;
  40196. }
  40197. return {x: x, y: y};
  40198. },
  40199. getArea: function() {
  40200. var vm = this._view;
  40201. return vm.width * Math.abs(vm.y - vm.base);
  40202. },
  40203. tooltipPosition: function() {
  40204. var vm = this._view;
  40205. return {
  40206. x: vm.x,
  40207. y: vm.y
  40208. };
  40209. }
  40210. });
  40211. };
  40212. /***/ }),
  40213. /* 156 */
  40214. /***/ (function(module, exports, __webpack_require__) {
  40215. "use strict";
  40216. // Chart.Platform implementation for targeting a web browser
  40217. module.exports = function(Chart) {
  40218. var helpers = Chart.helpers;
  40219. // DOM event types -> Chart.js event types.
  40220. // Note: only events with different types are mapped.
  40221. // https://developer.mozilla.org/en-US/docs/Web/Events
  40222. var eventTypeMap = {
  40223. // Touch events
  40224. touchstart: 'mousedown',
  40225. touchmove: 'mousemove',
  40226. touchend: 'mouseup',
  40227. // Pointer events
  40228. pointerenter: 'mouseenter',
  40229. pointerdown: 'mousedown',
  40230. pointermove: 'mousemove',
  40231. pointerup: 'mouseup',
  40232. pointerleave: 'mouseout',
  40233. pointerout: 'mouseout'
  40234. };
  40235. /**
  40236. * The "used" size is the final value of a dimension property after all calculations have
  40237. * been performed. This method uses the computed style of `element` but returns undefined
  40238. * if the computed style is not expressed in pixels. That can happen in some cases where
  40239. * `element` has a size relative to its parent and this last one is not yet displayed,
  40240. * for example because of `display: none` on a parent node.
  40241. * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value
  40242. * @returns {Number} Size in pixels or undefined if unknown.
  40243. */
  40244. function readUsedSize(element, property) {
  40245. var value = helpers.getStyle(element, property);
  40246. var matches = value && value.match(/(\d+)px/);
  40247. return matches? Number(matches[1]) : undefined;
  40248. }
  40249. /**
  40250. * Initializes the canvas style and render size without modifying the canvas display size,
  40251. * since responsiveness is handled by the controller.resize() method. The config is used
  40252. * to determine the aspect ratio to apply in case no explicit height has been specified.
  40253. */
  40254. function initCanvas(canvas, config) {
  40255. var style = canvas.style;
  40256. // NOTE(SB) canvas.getAttribute('width') !== canvas.width: in the first case it
  40257. // returns null or '' if no explicit value has been set to the canvas attribute.
  40258. var renderHeight = canvas.getAttribute('height');
  40259. var renderWidth = canvas.getAttribute('width');
  40260. // Chart.js modifies some canvas values that we want to restore on destroy
  40261. canvas._chartjs = {
  40262. initial: {
  40263. height: renderHeight,
  40264. width: renderWidth,
  40265. style: {
  40266. display: style.display,
  40267. height: style.height,
  40268. width: style.width
  40269. }
  40270. }
  40271. };
  40272. // Force canvas to display as block to avoid extra space caused by inline
  40273. // elements, which would interfere with the responsive resize process.
  40274. // https://github.com/chartjs/Chart.js/issues/2538
  40275. style.display = style.display || 'block';
  40276. if (renderWidth === null || renderWidth === '') {
  40277. var displayWidth = readUsedSize(canvas, 'width');
  40278. if (displayWidth !== undefined) {
  40279. canvas.width = displayWidth;
  40280. }
  40281. }
  40282. if (renderHeight === null || renderHeight === '') {
  40283. if (canvas.style.height === '') {
  40284. // If no explicit render height and style height, let's apply the aspect ratio,
  40285. // which one can be specified by the user but also by charts as default option
  40286. // (i.e. options.aspectRatio). If not specified, use canvas aspect ratio of 2.
  40287. canvas.height = canvas.width / (config.options.aspectRatio || 2);
  40288. } else {
  40289. var displayHeight = readUsedSize(canvas, 'height');
  40290. if (displayWidth !== undefined) {
  40291. canvas.height = displayHeight;
  40292. }
  40293. }
  40294. }
  40295. return canvas;
  40296. }
  40297. function createEvent(type, chart, x, y, native) {
  40298. return {
  40299. type: type,
  40300. chart: chart,
  40301. native: native || null,
  40302. x: x !== undefined? x : null,
  40303. y: y !== undefined? y : null,
  40304. };
  40305. }
  40306. function fromNativeEvent(event, chart) {
  40307. var type = eventTypeMap[event.type] || event.type;
  40308. var pos = helpers.getRelativePosition(event, chart);
  40309. return createEvent(type, chart, pos.x, pos.y, event);
  40310. }
  40311. function createResizer(handler) {
  40312. var iframe = document.createElement('iframe');
  40313. iframe.className = 'chartjs-hidden-iframe';
  40314. iframe.style.cssText =
  40315. 'display:block;'+
  40316. 'overflow:hidden;'+
  40317. 'border:0;'+
  40318. 'margin:0;'+
  40319. 'top:0;'+
  40320. 'left:0;'+
  40321. 'bottom:0;'+
  40322. 'right:0;'+
  40323. 'height:100%;'+
  40324. 'width:100%;'+
  40325. 'position:absolute;'+
  40326. 'pointer-events:none;'+
  40327. 'z-index:-1;';
  40328. // Prevent the iframe to gain focus on tab.
  40329. // https://github.com/chartjs/Chart.js/issues/3090
  40330. iframe.tabIndex = -1;
  40331. // If the iframe is re-attached to the DOM, the resize listener is removed because the
  40332. // content is reloaded, so make sure to install the handler after the iframe is loaded.
  40333. // https://github.com/chartjs/Chart.js/issues/3521
  40334. helpers.addEvent(iframe, 'load', function() {
  40335. helpers.addEvent(iframe.contentWindow || iframe, 'resize', handler);
  40336. // The iframe size might have changed while loading, which can also
  40337. // happen if the size has been changed while detached from the DOM.
  40338. handler();
  40339. });
  40340. return iframe;
  40341. }
  40342. function addResizeListener(node, listener, chart) {
  40343. var stub = node._chartjs = {
  40344. ticking: false
  40345. };
  40346. // Throttle the callback notification until the next animation frame.
  40347. var notify = function() {
  40348. if (!stub.ticking) {
  40349. stub.ticking = true;
  40350. helpers.requestAnimFrame.call(window, function() {
  40351. if (stub.resizer) {
  40352. stub.ticking = false;
  40353. return listener(createEvent('resize', chart));
  40354. }
  40355. });
  40356. }
  40357. };
  40358. // Let's keep track of this added iframe and thus avoid DOM query when removing it.
  40359. stub.resizer = createResizer(notify);
  40360. node.insertBefore(stub.resizer, node.firstChild);
  40361. }
  40362. function removeResizeListener(node) {
  40363. if (!node || !node._chartjs) {
  40364. return;
  40365. }
  40366. var resizer = node._chartjs.resizer;
  40367. if (resizer) {
  40368. resizer.parentNode.removeChild(resizer);
  40369. node._chartjs.resizer = null;
  40370. }
  40371. delete node._chartjs;
  40372. }
  40373. return {
  40374. acquireContext: function(item, config) {
  40375. if (typeof item === 'string') {
  40376. item = document.getElementById(item);
  40377. } else if (item.length) {
  40378. // Support for array based queries (such as jQuery)
  40379. item = item[0];
  40380. }
  40381. if (item && item.canvas) {
  40382. // Support for any object associated to a canvas (including a context2d)
  40383. item = item.canvas;
  40384. }
  40385. if (item instanceof HTMLCanvasElement) {
  40386. // To prevent canvas fingerprinting, some add-ons undefine the getContext
  40387. // method, for example: https://github.com/kkapsner/CanvasBlocker
  40388. // https://github.com/chartjs/Chart.js/issues/2807
  40389. var context = item.getContext && item.getContext('2d');
  40390. if (context instanceof CanvasRenderingContext2D) {
  40391. initCanvas(item, config);
  40392. return context;
  40393. }
  40394. }
  40395. return null;
  40396. },
  40397. releaseContext: function(context) {
  40398. var canvas = context.canvas;
  40399. if (!canvas._chartjs) {
  40400. return;
  40401. }
  40402. var initial = canvas._chartjs.initial;
  40403. ['height', 'width'].forEach(function(prop) {
  40404. var value = initial[prop];
  40405. if (value === undefined || value === null) {
  40406. canvas.removeAttribute(prop);
  40407. } else {
  40408. canvas.setAttribute(prop, value);
  40409. }
  40410. });
  40411. helpers.each(initial.style || {}, function(value, key) {
  40412. canvas.style[key] = value;
  40413. });
  40414. // The canvas render size might have been changed (and thus the state stack discarded),
  40415. // we can't use save() and restore() to restore the initial state. So make sure that at
  40416. // least the canvas context is reset to the default state by setting the canvas width.
  40417. // https://www.w3.org/TR/2011/WD-html5-20110525/the-canvas-element.html
  40418. canvas.width = canvas.width;
  40419. delete canvas._chartjs;
  40420. },
  40421. addEventListener: function(chart, type, listener) {
  40422. var canvas = chart.chart.canvas;
  40423. if (type === 'resize') {
  40424. // Note: the resize event is not supported on all browsers.
  40425. addResizeListener(canvas.parentNode, listener, chart.chart);
  40426. return;
  40427. }
  40428. var stub = listener._chartjs || (listener._chartjs = {});
  40429. var proxies = stub.proxies || (stub.proxies = {});
  40430. var proxy = proxies[chart.id + '_' + type] = function(event) {
  40431. listener(fromNativeEvent(event, chart.chart));
  40432. };
  40433. helpers.addEvent(canvas, type, proxy);
  40434. },
  40435. removeEventListener: function(chart, type, listener) {
  40436. var canvas = chart.chart.canvas;
  40437. if (type === 'resize') {
  40438. // Note: the resize event is not supported on all browsers.
  40439. removeResizeListener(canvas.parentNode, listener);
  40440. return;
  40441. }
  40442. var stub = listener._chartjs || {};
  40443. var proxies = stub.proxies || {};
  40444. var proxy = proxies[chart.id + '_' + type];
  40445. if (!proxy) {
  40446. return;
  40447. }
  40448. helpers.removeEvent(canvas, type, proxy);
  40449. }
  40450. };
  40451. };
  40452. /***/ }),
  40453. /* 157 */
  40454. /***/ (function(module, exports, __webpack_require__) {
  40455. "use strict";
  40456. // By default, select the browser (DOM) platform.
  40457. // @TODO Make possible to select another platform at build time.
  40458. var implementation = __webpack_require__(156);
  40459. module.exports = function(Chart) {
  40460. /**
  40461. * @namespace Chart.platform
  40462. * @see https://chartjs.gitbooks.io/proposals/content/Platform.html
  40463. * @since 2.4.0
  40464. */
  40465. Chart.platform = {
  40466. /**
  40467. * Called at chart construction time, returns a context2d instance implementing
  40468. * the [W3C Canvas 2D Context API standard]{@link https://www.w3.org/TR/2dcontext/}.
  40469. * @param {*} item - The native item from which to acquire context (platform specific)
  40470. * @param {Object} options - The chart options
  40471. * @returns {CanvasRenderingContext2D} context2d instance
  40472. */
  40473. acquireContext: function() {},
  40474. /**
  40475. * Called at chart destruction time, releases any resources associated to the context
  40476. * previously returned by the acquireContext() method.
  40477. * @param {CanvasRenderingContext2D} context - The context2d instance
  40478. * @returns {Boolean} true if the method succeeded, else false
  40479. */
  40480. releaseContext: function() {},
  40481. /**
  40482. * Registers the specified listener on the given chart.
  40483. * @param {Chart} chart - Chart from which to listen for event
  40484. * @param {String} type - The ({@link IEvent}) type to listen for
  40485. * @param {Function} listener - Receives a notification (an object that implements
  40486. * the {@link IEvent} interface) when an event of the specified type occurs.
  40487. */
  40488. addEventListener: function() {},
  40489. /**
  40490. * Removes the specified listener previously registered with addEventListener.
  40491. * @param {Chart} chart -Chart from which to remove the listener
  40492. * @param {String} type - The ({@link IEvent}) type to remove
  40493. * @param {Function} listener - The listener function to remove from the event target.
  40494. */
  40495. removeEventListener: function() {}
  40496. };
  40497. /**
  40498. * @interface IPlatform
  40499. * Allows abstracting platform dependencies away from the chart
  40500. * @borrows Chart.platform.acquireContext as acquireContext
  40501. * @borrows Chart.platform.releaseContext as releaseContext
  40502. * @borrows Chart.platform.addEventListener as addEventListener
  40503. * @borrows Chart.platform.removeEventListener as removeEventListener
  40504. */
  40505. /**
  40506. * @interface IEvent
  40507. * @prop {String} type - The event type name, possible values are:
  40508. * 'contextmenu', 'mouseenter', 'mousedown', 'mousemove', 'mouseup', 'mouseout',
  40509. * 'click', 'dblclick', 'keydown', 'keypress', 'keyup' and 'resize'
  40510. * @prop {*} native - The original native event (null for emulated events, e.g. 'resize')
  40511. * @prop {Number} x - The mouse x position, relative to the canvas (null for incompatible events)
  40512. * @prop {Number} y - The mouse y position, relative to the canvas (null for incompatible events)
  40513. */
  40514. Chart.helpers.extend(Chart.platform, implementation(Chart));
  40515. };
  40516. /***/ }),
  40517. /* 158 */
  40518. /***/ (function(module, exports, __webpack_require__) {
  40519. "use strict";
  40520. module.exports = function(Chart) {
  40521. var helpers = Chart.helpers;
  40522. // Default config for a category scale
  40523. var defaultConfig = {
  40524. position: 'bottom'
  40525. };
  40526. var DatasetScale = Chart.Scale.extend({
  40527. /**
  40528. * Internal function to get the correct labels. If data.xLabels or data.yLabels are defined, use those
  40529. * else fall back to data.labels
  40530. * @private
  40531. */
  40532. getLabels: function() {
  40533. var data = this.chart.data;
  40534. return (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels;
  40535. },
  40536. // Implement this so that
  40537. determineDataLimits: function() {
  40538. var me = this;
  40539. var labels = me.getLabels();
  40540. me.minIndex = 0;
  40541. me.maxIndex = labels.length - 1;
  40542. var findIndex;
  40543. if (me.options.ticks.min !== undefined) {
  40544. // user specified min value
  40545. findIndex = helpers.indexOf(labels, me.options.ticks.min);
  40546. me.minIndex = findIndex !== -1 ? findIndex : me.minIndex;
  40547. }
  40548. if (me.options.ticks.max !== undefined) {
  40549. // user specified max value
  40550. findIndex = helpers.indexOf(labels, me.options.ticks.max);
  40551. me.maxIndex = findIndex !== -1 ? findIndex : me.maxIndex;
  40552. }
  40553. me.min = labels[me.minIndex];
  40554. me.max = labels[me.maxIndex];
  40555. },
  40556. buildTicks: function() {
  40557. var me = this;
  40558. var labels = me.getLabels();
  40559. // If we are viewing some subset of labels, slice the original array
  40560. me.ticks = (me.minIndex === 0 && me.maxIndex === labels.length - 1) ? labels : labels.slice(me.minIndex, me.maxIndex + 1);
  40561. },
  40562. getLabelForIndex: function(index, datasetIndex) {
  40563. var me = this;
  40564. var data = me.chart.data;
  40565. var isHorizontal = me.isHorizontal();
  40566. if (data.yLabels && !isHorizontal) {
  40567. return me.getRightValue(data.datasets[datasetIndex].data[index]);
  40568. }
  40569. return me.ticks[index - me.minIndex];
  40570. },
  40571. // Used to get data value locations. Value can either be an index or a numerical value
  40572. getPixelForValue: function(value, index, datasetIndex, includeOffset) {
  40573. var me = this;
  40574. // 1 is added because we need the length but we have the indexes
  40575. var offsetAmt = Math.max((me.maxIndex + 1 - me.minIndex - ((me.options.gridLines.offsetGridLines) ? 0 : 1)), 1);
  40576. if (value !== undefined && isNaN(index)) {
  40577. var labels = me.getLabels();
  40578. var idx = labels.indexOf(value);
  40579. index = idx !== -1 ? idx : index;
  40580. }
  40581. if (me.isHorizontal()) {
  40582. var valueWidth = me.width / offsetAmt;
  40583. var widthOffset = (valueWidth * (index - me.minIndex));
  40584. if (me.options.gridLines.offsetGridLines && includeOffset || me.maxIndex === me.minIndex && includeOffset) {
  40585. widthOffset += (valueWidth / 2);
  40586. }
  40587. return me.left + Math.round(widthOffset);
  40588. }
  40589. var valueHeight = me.height / offsetAmt;
  40590. var heightOffset = (valueHeight * (index - me.minIndex));
  40591. if (me.options.gridLines.offsetGridLines && includeOffset) {
  40592. heightOffset += (valueHeight / 2);
  40593. }
  40594. return me.top + Math.round(heightOffset);
  40595. },
  40596. getPixelForTick: function(index, includeOffset) {
  40597. return this.getPixelForValue(this.ticks[index], index + this.minIndex, null, includeOffset);
  40598. },
  40599. getValueForPixel: function(pixel) {
  40600. var me = this;
  40601. var value;
  40602. var offsetAmt = Math.max((me.ticks.length - ((me.options.gridLines.offsetGridLines) ? 0 : 1)), 1);
  40603. var horz = me.isHorizontal();
  40604. var valueDimension = (horz ? me.width : me.height) / offsetAmt;
  40605. pixel -= horz ? me.left : me.top;
  40606. if (me.options.gridLines.offsetGridLines) {
  40607. pixel -= (valueDimension / 2);
  40608. }
  40609. if (pixel <= 0) {
  40610. value = 0;
  40611. } else {
  40612. value = Math.round(pixel / valueDimension);
  40613. }
  40614. return value;
  40615. },
  40616. getBasePixel: function() {
  40617. return this.bottom;
  40618. }
  40619. });
  40620. Chart.scaleService.registerScaleType('category', DatasetScale, defaultConfig);
  40621. };
  40622. /***/ }),
  40623. /* 159 */
  40624. /***/ (function(module, exports, __webpack_require__) {
  40625. "use strict";
  40626. module.exports = function(Chart) {
  40627. var helpers = Chart.helpers;
  40628. var defaultConfig = {
  40629. position: 'left',
  40630. ticks: {
  40631. callback: Chart.Ticks.formatters.linear
  40632. }
  40633. };
  40634. var LinearScale = Chart.LinearScaleBase.extend({
  40635. determineDataLimits: function() {
  40636. var me = this;
  40637. var opts = me.options;
  40638. var chart = me.chart;
  40639. var data = chart.data;
  40640. var datasets = data.datasets;
  40641. var isHorizontal = me.isHorizontal();
  40642. function IDMatches(meta) {
  40643. return isHorizontal ? meta.xAxisID === me.id : meta.yAxisID === me.id;
  40644. }
  40645. // First Calculate the range
  40646. me.min = null;
  40647. me.max = null;
  40648. var hasStacks = opts.stacked;
  40649. if (hasStacks === undefined) {
  40650. helpers.each(datasets, function(dataset, datasetIndex) {
  40651. if (hasStacks) {
  40652. return;
  40653. }
  40654. var meta = chart.getDatasetMeta(datasetIndex);
  40655. if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta) &&
  40656. meta.stack !== undefined) {
  40657. hasStacks = true;
  40658. }
  40659. });
  40660. }
  40661. if (opts.stacked || hasStacks) {
  40662. var valuesPerStack = {};
  40663. helpers.each(datasets, function(dataset, datasetIndex) {
  40664. var meta = chart.getDatasetMeta(datasetIndex);
  40665. var key = [
  40666. meta.type,
  40667. // we have a separate stack for stack=undefined datasets when the opts.stacked is undefined
  40668. ((opts.stacked === undefined && meta.stack === undefined) ? datasetIndex : ''),
  40669. meta.stack
  40670. ].join('.');
  40671. if (valuesPerStack[key] === undefined) {
  40672. valuesPerStack[key] = {
  40673. positiveValues: [],
  40674. negativeValues: []
  40675. };
  40676. }
  40677. // Store these per type
  40678. var positiveValues = valuesPerStack[key].positiveValues;
  40679. var negativeValues = valuesPerStack[key].negativeValues;
  40680. if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {
  40681. helpers.each(dataset.data, function(rawValue, index) {
  40682. var value = +me.getRightValue(rawValue);
  40683. if (isNaN(value) || meta.data[index].hidden) {
  40684. return;
  40685. }
  40686. positiveValues[index] = positiveValues[index] || 0;
  40687. negativeValues[index] = negativeValues[index] || 0;
  40688. if (opts.relativePoints) {
  40689. positiveValues[index] = 100;
  40690. } else if (value < 0) {
  40691. negativeValues[index] += value;
  40692. } else {
  40693. positiveValues[index] += value;
  40694. }
  40695. });
  40696. }
  40697. });
  40698. helpers.each(valuesPerStack, function(valuesForType) {
  40699. var values = valuesForType.positiveValues.concat(valuesForType.negativeValues);
  40700. var minVal = helpers.min(values);
  40701. var maxVal = helpers.max(values);
  40702. me.min = me.min === null ? minVal : Math.min(me.min, minVal);
  40703. me.max = me.max === null ? maxVal : Math.max(me.max, maxVal);
  40704. });
  40705. } else {
  40706. helpers.each(datasets, function(dataset, datasetIndex) {
  40707. var meta = chart.getDatasetMeta(datasetIndex);
  40708. if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {
  40709. helpers.each(dataset.data, function(rawValue, index) {
  40710. var value = +me.getRightValue(rawValue);
  40711. if (isNaN(value) || meta.data[index].hidden) {
  40712. return;
  40713. }
  40714. if (me.min === null) {
  40715. me.min = value;
  40716. } else if (value < me.min) {
  40717. me.min = value;
  40718. }
  40719. if (me.max === null) {
  40720. me.max = value;
  40721. } else if (value > me.max) {
  40722. me.max = value;
  40723. }
  40724. });
  40725. }
  40726. });
  40727. }
  40728. // Common base implementation to handle ticks.min, ticks.max, ticks.beginAtZero
  40729. this.handleTickRangeOptions();
  40730. },
  40731. getTickLimit: function() {
  40732. var maxTicks;
  40733. var me = this;
  40734. var tickOpts = me.options.ticks;
  40735. if (me.isHorizontal()) {
  40736. maxTicks = Math.min(tickOpts.maxTicksLimit ? tickOpts.maxTicksLimit : 11, Math.ceil(me.width / 50));
  40737. } else {
  40738. // The factor of 2 used to scale the font size has been experimentally determined.
  40739. var tickFontSize = helpers.getValueOrDefault(tickOpts.fontSize, Chart.defaults.global.defaultFontSize);
  40740. maxTicks = Math.min(tickOpts.maxTicksLimit ? tickOpts.maxTicksLimit : 11, Math.ceil(me.height / (2 * tickFontSize)));
  40741. }
  40742. return maxTicks;
  40743. },
  40744. // Called after the ticks are built. We need
  40745. handleDirectionalChanges: function() {
  40746. if (!this.isHorizontal()) {
  40747. // We are in a vertical orientation. The top value is the highest. So reverse the array
  40748. this.ticks.reverse();
  40749. }
  40750. },
  40751. getLabelForIndex: function(index, datasetIndex) {
  40752. return +this.getRightValue(this.chart.data.datasets[datasetIndex].data[index]);
  40753. },
  40754. // Utils
  40755. getPixelForValue: function(value) {
  40756. // This must be called after fit has been run so that
  40757. // this.left, this.top, this.right, and this.bottom have been defined
  40758. var me = this;
  40759. var start = me.start;
  40760. var rightValue = +me.getRightValue(value);
  40761. var pixel;
  40762. var range = me.end - start;
  40763. if (me.isHorizontal()) {
  40764. pixel = me.left + (me.width / range * (rightValue - start));
  40765. return Math.round(pixel);
  40766. }
  40767. pixel = me.bottom - (me.height / range * (rightValue - start));
  40768. return Math.round(pixel);
  40769. },
  40770. getValueForPixel: function(pixel) {
  40771. var me = this;
  40772. var isHorizontal = me.isHorizontal();
  40773. var innerDimension = isHorizontal ? me.width : me.height;
  40774. var offset = (isHorizontal ? pixel - me.left : me.bottom - pixel) / innerDimension;
  40775. return me.start + ((me.end - me.start) * offset);
  40776. },
  40777. getPixelForTick: function(index) {
  40778. return this.getPixelForValue(this.ticksAsNumbers[index]);
  40779. }
  40780. });
  40781. Chart.scaleService.registerScaleType('linear', LinearScale, defaultConfig);
  40782. };
  40783. /***/ }),
  40784. /* 160 */
  40785. /***/ (function(module, exports, __webpack_require__) {
  40786. "use strict";
  40787. module.exports = function(Chart) {
  40788. var helpers = Chart.helpers,
  40789. noop = helpers.noop;
  40790. Chart.LinearScaleBase = Chart.Scale.extend({
  40791. handleTickRangeOptions: function() {
  40792. var me = this;
  40793. var opts = me.options;
  40794. var tickOpts = opts.ticks;
  40795. // If we are forcing it to begin at 0, but 0 will already be rendered on the chart,
  40796. // do nothing since that would make the chart weird. If the user really wants a weird chart
  40797. // axis, they can manually override it
  40798. if (tickOpts.beginAtZero) {
  40799. var minSign = helpers.sign(me.min);
  40800. var maxSign = helpers.sign(me.max);
  40801. if (minSign < 0 && maxSign < 0) {
  40802. // move the top up to 0
  40803. me.max = 0;
  40804. } else if (minSign > 0 && maxSign > 0) {
  40805. // move the bottom down to 0
  40806. me.min = 0;
  40807. }
  40808. }
  40809. if (tickOpts.min !== undefined) {
  40810. me.min = tickOpts.min;
  40811. } else if (tickOpts.suggestedMin !== undefined) {
  40812. me.min = Math.min(me.min, tickOpts.suggestedMin);
  40813. }
  40814. if (tickOpts.max !== undefined) {
  40815. me.max = tickOpts.max;
  40816. } else if (tickOpts.suggestedMax !== undefined) {
  40817. me.max = Math.max(me.max, tickOpts.suggestedMax);
  40818. }
  40819. if (me.min === me.max) {
  40820. me.max++;
  40821. if (!tickOpts.beginAtZero) {
  40822. me.min--;
  40823. }
  40824. }
  40825. },
  40826. getTickLimit: noop,
  40827. handleDirectionalChanges: noop,
  40828. buildTicks: function() {
  40829. var me = this;
  40830. var opts = me.options;
  40831. var tickOpts = opts.ticks;
  40832. // Figure out what the max number of ticks we can support it is based on the size of
  40833. // the axis area. For now, we say that the minimum tick spacing in pixels must be 50
  40834. // We also limit the maximum number of ticks to 11 which gives a nice 10 squares on
  40835. // the graph. Make sure we always have at least 2 ticks
  40836. var maxTicks = me.getTickLimit();
  40837. maxTicks = Math.max(2, maxTicks);
  40838. var numericGeneratorOptions = {
  40839. maxTicks: maxTicks,
  40840. min: tickOpts.min,
  40841. max: tickOpts.max,
  40842. stepSize: helpers.getValueOrDefault(tickOpts.fixedStepSize, tickOpts.stepSize)
  40843. };
  40844. var ticks = me.ticks = Chart.Ticks.generators.linear(numericGeneratorOptions, me);
  40845. me.handleDirectionalChanges();
  40846. // At this point, we need to update our max and min given the tick values since we have expanded the
  40847. // range of the scale
  40848. me.max = helpers.max(ticks);
  40849. me.min = helpers.min(ticks);
  40850. if (tickOpts.reverse) {
  40851. ticks.reverse();
  40852. me.start = me.max;
  40853. me.end = me.min;
  40854. } else {
  40855. me.start = me.min;
  40856. me.end = me.max;
  40857. }
  40858. },
  40859. convertTicksToLabels: function() {
  40860. var me = this;
  40861. me.ticksAsNumbers = me.ticks.slice();
  40862. me.zeroLineIndex = me.ticks.indexOf(0);
  40863. Chart.Scale.prototype.convertTicksToLabels.call(me);
  40864. }
  40865. });
  40866. };
  40867. /***/ }),
  40868. /* 161 */
  40869. /***/ (function(module, exports, __webpack_require__) {
  40870. "use strict";
  40871. module.exports = function(Chart) {
  40872. var helpers = Chart.helpers;
  40873. var defaultConfig = {
  40874. position: 'left',
  40875. // label settings
  40876. ticks: {
  40877. callback: Chart.Ticks.formatters.logarithmic
  40878. }
  40879. };
  40880. var LogarithmicScale = Chart.Scale.extend({
  40881. determineDataLimits: function() {
  40882. var me = this;
  40883. var opts = me.options;
  40884. var tickOpts = opts.ticks;
  40885. var chart = me.chart;
  40886. var data = chart.data;
  40887. var datasets = data.datasets;
  40888. var getValueOrDefault = helpers.getValueOrDefault;
  40889. var isHorizontal = me.isHorizontal();
  40890. function IDMatches(meta) {
  40891. return isHorizontal ? meta.xAxisID === me.id : meta.yAxisID === me.id;
  40892. }
  40893. // Calculate Range
  40894. me.min = null;
  40895. me.max = null;
  40896. me.minNotZero = null;
  40897. var hasStacks = opts.stacked;
  40898. if (hasStacks === undefined) {
  40899. helpers.each(datasets, function(dataset, datasetIndex) {
  40900. if (hasStacks) {
  40901. return;
  40902. }
  40903. var meta = chart.getDatasetMeta(datasetIndex);
  40904. if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta) &&
  40905. meta.stack !== undefined) {
  40906. hasStacks = true;
  40907. }
  40908. });
  40909. }
  40910. if (opts.stacked || hasStacks) {
  40911. var valuesPerStack = {};
  40912. helpers.each(datasets, function(dataset, datasetIndex) {
  40913. var meta = chart.getDatasetMeta(datasetIndex);
  40914. var key = [
  40915. meta.type,
  40916. // we have a separate stack for stack=undefined datasets when the opts.stacked is undefined
  40917. ((opts.stacked === undefined && meta.stack === undefined) ? datasetIndex : ''),
  40918. meta.stack
  40919. ].join('.');
  40920. if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {
  40921. if (valuesPerStack[key] === undefined) {
  40922. valuesPerStack[key] = [];
  40923. }
  40924. helpers.each(dataset.data, function(rawValue, index) {
  40925. var values = valuesPerStack[key];
  40926. var value = +me.getRightValue(rawValue);
  40927. if (isNaN(value) || meta.data[index].hidden) {
  40928. return;
  40929. }
  40930. values[index] = values[index] || 0;
  40931. if (opts.relativePoints) {
  40932. values[index] = 100;
  40933. } else {
  40934. // Don't need to split positive and negative since the log scale can't handle a 0 crossing
  40935. values[index] += value;
  40936. }
  40937. });
  40938. }
  40939. });
  40940. helpers.each(valuesPerStack, function(valuesForType) {
  40941. var minVal = helpers.min(valuesForType);
  40942. var maxVal = helpers.max(valuesForType);
  40943. me.min = me.min === null ? minVal : Math.min(me.min, minVal);
  40944. me.max = me.max === null ? maxVal : Math.max(me.max, maxVal);
  40945. });
  40946. } else {
  40947. helpers.each(datasets, function(dataset, datasetIndex) {
  40948. var meta = chart.getDatasetMeta(datasetIndex);
  40949. if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {
  40950. helpers.each(dataset.data, function(rawValue, index) {
  40951. var value = +me.getRightValue(rawValue);
  40952. if (isNaN(value) || meta.data[index].hidden) {
  40953. return;
  40954. }
  40955. if (me.min === null) {
  40956. me.min = value;
  40957. } else if (value < me.min) {
  40958. me.min = value;
  40959. }
  40960. if (me.max === null) {
  40961. me.max = value;
  40962. } else if (value > me.max) {
  40963. me.max = value;
  40964. }
  40965. if (value !== 0 && (me.minNotZero === null || value < me.minNotZero)) {
  40966. me.minNotZero = value;
  40967. }
  40968. });
  40969. }
  40970. });
  40971. }
  40972. me.min = getValueOrDefault(tickOpts.min, me.min);
  40973. me.max = getValueOrDefault(tickOpts.max, me.max);
  40974. if (me.min === me.max) {
  40975. if (me.min !== 0 && me.min !== null) {
  40976. me.min = Math.pow(10, Math.floor(helpers.log10(me.min)) - 1);
  40977. me.max = Math.pow(10, Math.floor(helpers.log10(me.max)) + 1);
  40978. } else {
  40979. me.min = 1;
  40980. me.max = 10;
  40981. }
  40982. }
  40983. },
  40984. buildTicks: function() {
  40985. var me = this;
  40986. var opts = me.options;
  40987. var tickOpts = opts.ticks;
  40988. var generationOptions = {
  40989. min: tickOpts.min,
  40990. max: tickOpts.max
  40991. };
  40992. var ticks = me.ticks = Chart.Ticks.generators.logarithmic(generationOptions, me);
  40993. if (!me.isHorizontal()) {
  40994. // We are in a vertical orientation. The top value is the highest. So reverse the array
  40995. ticks.reverse();
  40996. }
  40997. // At this point, we need to update our max and min given the tick values since we have expanded the
  40998. // range of the scale
  40999. me.max = helpers.max(ticks);
  41000. me.min = helpers.min(ticks);
  41001. if (tickOpts.reverse) {
  41002. ticks.reverse();
  41003. me.start = me.max;
  41004. me.end = me.min;
  41005. } else {
  41006. me.start = me.min;
  41007. me.end = me.max;
  41008. }
  41009. },
  41010. convertTicksToLabels: function() {
  41011. this.tickValues = this.ticks.slice();
  41012. Chart.Scale.prototype.convertTicksToLabels.call(this);
  41013. },
  41014. // Get the correct tooltip label
  41015. getLabelForIndex: function(index, datasetIndex) {
  41016. return +this.getRightValue(this.chart.data.datasets[datasetIndex].data[index]);
  41017. },
  41018. getPixelForTick: function(index) {
  41019. return this.getPixelForValue(this.tickValues[index]);
  41020. },
  41021. getPixelForValue: function(value) {
  41022. var me = this;
  41023. var innerDimension;
  41024. var pixel;
  41025. var start = me.start;
  41026. var newVal = +me.getRightValue(value);
  41027. var range;
  41028. var opts = me.options;
  41029. var tickOpts = opts.ticks;
  41030. if (me.isHorizontal()) {
  41031. range = helpers.log10(me.end) - helpers.log10(start); // todo: if start === 0
  41032. if (newVal === 0) {
  41033. pixel = me.left;
  41034. } else {
  41035. innerDimension = me.width;
  41036. pixel = me.left + (innerDimension / range * (helpers.log10(newVal) - helpers.log10(start)));
  41037. }
  41038. } else {
  41039. // Bottom - top since pixels increase downward on a screen
  41040. innerDimension = me.height;
  41041. if (start === 0 && !tickOpts.reverse) {
  41042. range = helpers.log10(me.end) - helpers.log10(me.minNotZero);
  41043. if (newVal === start) {
  41044. pixel = me.bottom;
  41045. } else if (newVal === me.minNotZero) {
  41046. pixel = me.bottom - innerDimension * 0.02;
  41047. } else {
  41048. pixel = me.bottom - innerDimension * 0.02 - (innerDimension * 0.98/ range * (helpers.log10(newVal)-helpers.log10(me.minNotZero)));
  41049. }
  41050. } else if (me.end === 0 && tickOpts.reverse) {
  41051. range = helpers.log10(me.start) - helpers.log10(me.minNotZero);
  41052. if (newVal === me.end) {
  41053. pixel = me.top;
  41054. } else if (newVal === me.minNotZero) {
  41055. pixel = me.top + innerDimension * 0.02;
  41056. } else {
  41057. pixel = me.top + innerDimension * 0.02 + (innerDimension * 0.98/ range * (helpers.log10(newVal)-helpers.log10(me.minNotZero)));
  41058. }
  41059. } else {
  41060. range = helpers.log10(me.end) - helpers.log10(start);
  41061. innerDimension = me.height;
  41062. pixel = me.bottom - (innerDimension / range * (helpers.log10(newVal) - helpers.log10(start)));
  41063. }
  41064. }
  41065. return pixel;
  41066. },
  41067. getValueForPixel: function(pixel) {
  41068. var me = this;
  41069. var range = helpers.log10(me.end) - helpers.log10(me.start);
  41070. var value, innerDimension;
  41071. if (me.isHorizontal()) {
  41072. innerDimension = me.width;
  41073. value = me.start * Math.pow(10, (pixel - me.left) * range / innerDimension);
  41074. } else { // todo: if start === 0
  41075. innerDimension = me.height;
  41076. value = Math.pow(10, (me.bottom - pixel) * range / innerDimension) / me.start;
  41077. }
  41078. return value;
  41079. }
  41080. });
  41081. Chart.scaleService.registerScaleType('logarithmic', LogarithmicScale, defaultConfig);
  41082. };
  41083. /***/ }),
  41084. /* 162 */
  41085. /***/ (function(module, exports, __webpack_require__) {
  41086. "use strict";
  41087. module.exports = function(Chart) {
  41088. var helpers = Chart.helpers;
  41089. var globalDefaults = Chart.defaults.global;
  41090. var defaultConfig = {
  41091. display: true,
  41092. // Boolean - Whether to animate scaling the chart from the centre
  41093. animate: true,
  41094. lineArc: false,
  41095. position: 'chartArea',
  41096. angleLines: {
  41097. display: true,
  41098. color: 'rgba(0, 0, 0, 0.1)',
  41099. lineWidth: 1
  41100. },
  41101. // label settings
  41102. ticks: {
  41103. // Boolean - Show a backdrop to the scale label
  41104. showLabelBackdrop: true,
  41105. // String - The colour of the label backdrop
  41106. backdropColor: 'rgba(255,255,255,0.75)',
  41107. // Number - The backdrop padding above & below the label in pixels
  41108. backdropPaddingY: 2,
  41109. // Number - The backdrop padding to the side of the label in pixels
  41110. backdropPaddingX: 2,
  41111. callback: Chart.Ticks.formatters.linear
  41112. },
  41113. pointLabels: {
  41114. // Number - Point label font size in pixels
  41115. fontSize: 10,
  41116. // Function - Used to convert point labels
  41117. callback: function(label) {
  41118. return label;
  41119. }
  41120. }
  41121. };
  41122. function getValueCount(scale) {
  41123. return !scale.options.lineArc ? scale.chart.data.labels.length : 0;
  41124. }
  41125. function getPointLabelFontOptions(scale) {
  41126. var pointLabelOptions = scale.options.pointLabels;
  41127. var fontSize = helpers.getValueOrDefault(pointLabelOptions.fontSize, globalDefaults.defaultFontSize);
  41128. var fontStyle = helpers.getValueOrDefault(pointLabelOptions.fontStyle, globalDefaults.defaultFontStyle);
  41129. var fontFamily = helpers.getValueOrDefault(pointLabelOptions.fontFamily, globalDefaults.defaultFontFamily);
  41130. var font = helpers.fontString(fontSize, fontStyle, fontFamily);
  41131. return {
  41132. size: fontSize,
  41133. style: fontStyle,
  41134. family: fontFamily,
  41135. font: font
  41136. };
  41137. }
  41138. function measureLabelSize(ctx, fontSize, label) {
  41139. if (helpers.isArray(label)) {
  41140. return {
  41141. w: helpers.longestText(ctx, ctx.font, label),
  41142. h: (label.length * fontSize) + ((label.length - 1) * 1.5 * fontSize)
  41143. };
  41144. }
  41145. return {
  41146. w: ctx.measureText(label).width,
  41147. h: fontSize
  41148. };
  41149. }
  41150. function determineLimits(angle, pos, size, min, max) {
  41151. if (angle === min || angle === max) {
  41152. return {
  41153. start: pos - (size / 2),
  41154. end: pos + (size / 2)
  41155. };
  41156. } else if (angle < min || angle > max) {
  41157. return {
  41158. start: pos - size - 5,
  41159. end: pos
  41160. };
  41161. }
  41162. return {
  41163. start: pos,
  41164. end: pos + size + 5
  41165. };
  41166. }
  41167. /**
  41168. * Helper function to fit a radial linear scale with point labels
  41169. */
  41170. function fitWithPointLabels(scale) {
  41171. /*
  41172. * Right, this is really confusing and there is a lot of maths going on here
  41173. * The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9
  41174. *
  41175. * Reaction: https://dl.dropboxusercontent.com/u/34601363/toomuchscience.gif
  41176. *
  41177. * Solution:
  41178. *
  41179. * We assume the radius of the polygon is half the size of the canvas at first
  41180. * at each index we check if the text overlaps.
  41181. *
  41182. * Where it does, we store that angle and that index.
  41183. *
  41184. * After finding the largest index and angle we calculate how much we need to remove
  41185. * from the shape radius to move the point inwards by that x.
  41186. *
  41187. * We average the left and right distances to get the maximum shape radius that can fit in the box
  41188. * along with labels.
  41189. *
  41190. * Once we have that, we can find the centre point for the chart, by taking the x text protrusion
  41191. * on each side, removing that from the size, halving it and adding the left x protrusion width.
  41192. *
  41193. * This will mean we have a shape fitted to the canvas, as large as it can be with the labels
  41194. * and position it in the most space efficient manner
  41195. *
  41196. * https://dl.dropboxusercontent.com/u/34601363/yeahscience.gif
  41197. */
  41198. var plFont = getPointLabelFontOptions(scale);
  41199. // Get maximum radius of the polygon. Either half the height (minus the text width) or half the width.
  41200. // Use this to calculate the offset + change. - Make sure L/R protrusion is at least 0 to stop issues with centre points
  41201. var largestPossibleRadius = Math.min(scale.height / 2, scale.width / 2);
  41202. var furthestLimits = {
  41203. l: scale.width,
  41204. r: 0,
  41205. t: scale.height,
  41206. b: 0
  41207. };
  41208. var furthestAngles = {};
  41209. var i;
  41210. var textSize;
  41211. var pointPosition;
  41212. scale.ctx.font = plFont.font;
  41213. scale._pointLabelSizes = [];
  41214. var valueCount = getValueCount(scale);
  41215. for (i = 0; i < valueCount; i++) {
  41216. pointPosition = scale.getPointPosition(i, largestPossibleRadius);
  41217. textSize = measureLabelSize(scale.ctx, plFont.size, scale.pointLabels[i] || '');
  41218. scale._pointLabelSizes[i] = textSize;
  41219. // Add quarter circle to make degree 0 mean top of circle
  41220. var angleRadians = scale.getIndexAngle(i);
  41221. var angle = helpers.toDegrees(angleRadians) % 360;
  41222. var hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);
  41223. var vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);
  41224. if (hLimits.start < furthestLimits.l) {
  41225. furthestLimits.l = hLimits.start;
  41226. furthestAngles.l = angleRadians;
  41227. }
  41228. if (hLimits.end > furthestLimits.r) {
  41229. furthestLimits.r = hLimits.end;
  41230. furthestAngles.r = angleRadians;
  41231. }
  41232. if (vLimits.start < furthestLimits.t) {
  41233. furthestLimits.t = vLimits.start;
  41234. furthestAngles.t = angleRadians;
  41235. }
  41236. if (vLimits.end > furthestLimits.b) {
  41237. furthestLimits.b = vLimits.end;
  41238. furthestAngles.b = angleRadians;
  41239. }
  41240. }
  41241. scale.setReductions(largestPossibleRadius, furthestLimits, furthestAngles);
  41242. }
  41243. /**
  41244. * Helper function to fit a radial linear scale with no point labels
  41245. */
  41246. function fit(scale) {
  41247. var largestPossibleRadius = Math.min(scale.height / 2, scale.width / 2);
  41248. scale.drawingArea = Math.round(largestPossibleRadius);
  41249. scale.setCenterPoint(0, 0, 0, 0);
  41250. }
  41251. function getTextAlignForAngle(angle) {
  41252. if (angle === 0 || angle === 180) {
  41253. return 'center';
  41254. } else if (angle < 180) {
  41255. return 'left';
  41256. }
  41257. return 'right';
  41258. }
  41259. function fillText(ctx, text, position, fontSize) {
  41260. if (helpers.isArray(text)) {
  41261. var y = position.y;
  41262. var spacing = 1.5 * fontSize;
  41263. for (var i = 0; i < text.length; ++i) {
  41264. ctx.fillText(text[i], position.x, y);
  41265. y+= spacing;
  41266. }
  41267. } else {
  41268. ctx.fillText(text, position.x, position.y);
  41269. }
  41270. }
  41271. function adjustPointPositionForLabelHeight(angle, textSize, position) {
  41272. if (angle === 90 || angle === 270) {
  41273. position.y -= (textSize.h / 2);
  41274. } else if (angle > 270 || angle < 90) {
  41275. position.y -= textSize.h;
  41276. }
  41277. }
  41278. function drawPointLabels(scale) {
  41279. var ctx = scale.ctx;
  41280. var getValueOrDefault = helpers.getValueOrDefault;
  41281. var opts = scale.options;
  41282. var angleLineOpts = opts.angleLines;
  41283. var pointLabelOpts = opts.pointLabels;
  41284. ctx.lineWidth = angleLineOpts.lineWidth;
  41285. ctx.strokeStyle = angleLineOpts.color;
  41286. var outerDistance = scale.getDistanceFromCenterForValue(opts.reverse ? scale.min : scale.max);
  41287. // Point Label Font
  41288. var plFont = getPointLabelFontOptions(scale);
  41289. ctx.textBaseline = 'top';
  41290. for (var i = getValueCount(scale) - 1; i >= 0; i--) {
  41291. if (angleLineOpts.display) {
  41292. var outerPosition = scale.getPointPosition(i, outerDistance);
  41293. ctx.beginPath();
  41294. ctx.moveTo(scale.xCenter, scale.yCenter);
  41295. ctx.lineTo(outerPosition.x, outerPosition.y);
  41296. ctx.stroke();
  41297. ctx.closePath();
  41298. }
  41299. // Extra 3px out for some label spacing
  41300. var pointLabelPosition = scale.getPointPosition(i, outerDistance + 5);
  41301. // Keep this in loop since we may support array properties here
  41302. var pointLabelFontColor = getValueOrDefault(pointLabelOpts.fontColor, globalDefaults.defaultFontColor);
  41303. ctx.font = plFont.font;
  41304. ctx.fillStyle = pointLabelFontColor;
  41305. var angleRadians = scale.getIndexAngle(i);
  41306. var angle = helpers.toDegrees(angleRadians);
  41307. ctx.textAlign = getTextAlignForAngle(angle);
  41308. adjustPointPositionForLabelHeight(angle, scale._pointLabelSizes[i], pointLabelPosition);
  41309. fillText(ctx, scale.pointLabels[i] || '', pointLabelPosition, plFont.size);
  41310. }
  41311. }
  41312. function drawRadiusLine(scale, gridLineOpts, radius, index) {
  41313. var ctx = scale.ctx;
  41314. ctx.strokeStyle = helpers.getValueAtIndexOrDefault(gridLineOpts.color, index - 1);
  41315. ctx.lineWidth = helpers.getValueAtIndexOrDefault(gridLineOpts.lineWidth, index - 1);
  41316. if (scale.options.lineArc) {
  41317. // Draw circular arcs between the points
  41318. ctx.beginPath();
  41319. ctx.arc(scale.xCenter, scale.yCenter, radius, 0, Math.PI * 2);
  41320. ctx.closePath();
  41321. ctx.stroke();
  41322. } else {
  41323. // Draw straight lines connecting each index
  41324. var valueCount = getValueCount(scale);
  41325. if (valueCount === 0) {
  41326. return;
  41327. }
  41328. ctx.beginPath();
  41329. var pointPosition = scale.getPointPosition(0, radius);
  41330. ctx.moveTo(pointPosition.x, pointPosition.y);
  41331. for (var i = 1; i < valueCount; i++) {
  41332. pointPosition = scale.getPointPosition(i, radius);
  41333. ctx.lineTo(pointPosition.x, pointPosition.y);
  41334. }
  41335. ctx.closePath();
  41336. ctx.stroke();
  41337. }
  41338. }
  41339. function numberOrZero(param) {
  41340. return helpers.isNumber(param) ? param : 0;
  41341. }
  41342. var LinearRadialScale = Chart.LinearScaleBase.extend({
  41343. setDimensions: function() {
  41344. var me = this;
  41345. var opts = me.options;
  41346. var tickOpts = opts.ticks;
  41347. // Set the unconstrained dimension before label rotation
  41348. me.width = me.maxWidth;
  41349. me.height = me.maxHeight;
  41350. me.xCenter = Math.round(me.width / 2);
  41351. me.yCenter = Math.round(me.height / 2);
  41352. var minSize = helpers.min([me.height, me.width]);
  41353. var tickFontSize = helpers.getValueOrDefault(tickOpts.fontSize, globalDefaults.defaultFontSize);
  41354. me.drawingArea = opts.display ? (minSize / 2) - (tickFontSize / 2 + tickOpts.backdropPaddingY) : (minSize / 2);
  41355. },
  41356. determineDataLimits: function() {
  41357. var me = this;
  41358. var chart = me.chart;
  41359. var min = Number.POSITIVE_INFINITY;
  41360. var max = Number.NEGATIVE_INFINITY;
  41361. helpers.each(chart.data.datasets, function(dataset, datasetIndex) {
  41362. if (chart.isDatasetVisible(datasetIndex)) {
  41363. var meta = chart.getDatasetMeta(datasetIndex);
  41364. helpers.each(dataset.data, function(rawValue, index) {
  41365. var value = +me.getRightValue(rawValue);
  41366. if (isNaN(value) || meta.data[index].hidden) {
  41367. return;
  41368. }
  41369. min = Math.min(value, min);
  41370. max = Math.max(value, max);
  41371. });
  41372. }
  41373. });
  41374. me.min = (min === Number.POSITIVE_INFINITY ? 0 : min);
  41375. me.max = (max === Number.NEGATIVE_INFINITY ? 0 : max);
  41376. // Common base implementation to handle ticks.min, ticks.max, ticks.beginAtZero
  41377. me.handleTickRangeOptions();
  41378. },
  41379. getTickLimit: function() {
  41380. var tickOpts = this.options.ticks;
  41381. var tickFontSize = helpers.getValueOrDefault(tickOpts.fontSize, globalDefaults.defaultFontSize);
  41382. return Math.min(tickOpts.maxTicksLimit ? tickOpts.maxTicksLimit : 11, Math.ceil(this.drawingArea / (1.5 * tickFontSize)));
  41383. },
  41384. convertTicksToLabels: function() {
  41385. var me = this;
  41386. Chart.LinearScaleBase.prototype.convertTicksToLabels.call(me);
  41387. // Point labels
  41388. me.pointLabels = me.chart.data.labels.map(me.options.pointLabels.callback, me);
  41389. },
  41390. getLabelForIndex: function(index, datasetIndex) {
  41391. return +this.getRightValue(this.chart.data.datasets[datasetIndex].data[index]);
  41392. },
  41393. fit: function() {
  41394. if (this.options.lineArc) {
  41395. fit(this);
  41396. } else {
  41397. fitWithPointLabels(this);
  41398. }
  41399. },
  41400. /**
  41401. * Set radius reductions and determine new radius and center point
  41402. * @private
  41403. */
  41404. setReductions: function(largestPossibleRadius, furthestLimits, furthestAngles) {
  41405. var me = this;
  41406. var radiusReductionLeft = furthestLimits.l / Math.sin(furthestAngles.l);
  41407. var radiusReductionRight = Math.max(furthestLimits.r - me.width, 0) / Math.sin(furthestAngles.r);
  41408. var radiusReductionTop = -furthestLimits.t / Math.cos(furthestAngles.t);
  41409. var radiusReductionBottom = -Math.max(furthestLimits.b - me.height, 0) / Math.cos(furthestAngles.b);
  41410. radiusReductionLeft = numberOrZero(radiusReductionLeft);
  41411. radiusReductionRight = numberOrZero(radiusReductionRight);
  41412. radiusReductionTop = numberOrZero(radiusReductionTop);
  41413. radiusReductionBottom = numberOrZero(radiusReductionBottom);
  41414. me.drawingArea = Math.min(
  41415. Math.round(largestPossibleRadius - (radiusReductionLeft + radiusReductionRight) / 2),
  41416. Math.round(largestPossibleRadius - (radiusReductionTop + radiusReductionBottom) / 2));
  41417. me.setCenterPoint(radiusReductionLeft, radiusReductionRight, radiusReductionTop, radiusReductionBottom);
  41418. },
  41419. setCenterPoint: function(leftMovement, rightMovement, topMovement, bottomMovement) {
  41420. var me = this;
  41421. var maxRight = me.width - rightMovement - me.drawingArea,
  41422. maxLeft = leftMovement + me.drawingArea,
  41423. maxTop = topMovement + me.drawingArea,
  41424. maxBottom = me.height - bottomMovement - me.drawingArea;
  41425. me.xCenter = Math.round(((maxLeft + maxRight) / 2) + me.left);
  41426. me.yCenter = Math.round(((maxTop + maxBottom) / 2) + me.top);
  41427. },
  41428. getIndexAngle: function(index) {
  41429. var angleMultiplier = (Math.PI * 2) / getValueCount(this);
  41430. var startAngle = this.chart.options && this.chart.options.startAngle ?
  41431. this.chart.options.startAngle :
  41432. 0;
  41433. var startAngleRadians = startAngle * Math.PI * 2 / 360;
  41434. // Start from the top instead of right, so remove a quarter of the circle
  41435. return index * angleMultiplier + startAngleRadians;
  41436. },
  41437. getDistanceFromCenterForValue: function(value) {
  41438. var me = this;
  41439. if (value === null) {
  41440. return 0; // null always in center
  41441. }
  41442. // Take into account half font size + the yPadding of the top value
  41443. var scalingFactor = me.drawingArea / (me.max - me.min);
  41444. if (me.options.reverse) {
  41445. return (me.max - value) * scalingFactor;
  41446. }
  41447. return (value - me.min) * scalingFactor;
  41448. },
  41449. getPointPosition: function(index, distanceFromCenter) {
  41450. var me = this;
  41451. var thisAngle = me.getIndexAngle(index) - (Math.PI / 2);
  41452. return {
  41453. x: Math.round(Math.cos(thisAngle) * distanceFromCenter) + me.xCenter,
  41454. y: Math.round(Math.sin(thisAngle) * distanceFromCenter) + me.yCenter
  41455. };
  41456. },
  41457. getPointPositionForValue: function(index, value) {
  41458. return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));
  41459. },
  41460. getBasePosition: function() {
  41461. var me = this;
  41462. var min = me.min;
  41463. var max = me.max;
  41464. return me.getPointPositionForValue(0,
  41465. me.beginAtZero? 0:
  41466. min < 0 && max < 0? max :
  41467. min > 0 && max > 0? min :
  41468. 0);
  41469. },
  41470. draw: function() {
  41471. var me = this;
  41472. var opts = me.options;
  41473. var gridLineOpts = opts.gridLines;
  41474. var tickOpts = opts.ticks;
  41475. var getValueOrDefault = helpers.getValueOrDefault;
  41476. if (opts.display) {
  41477. var ctx = me.ctx;
  41478. // Tick Font
  41479. var tickFontSize = getValueOrDefault(tickOpts.fontSize, globalDefaults.defaultFontSize);
  41480. var tickFontStyle = getValueOrDefault(tickOpts.fontStyle, globalDefaults.defaultFontStyle);
  41481. var tickFontFamily = getValueOrDefault(tickOpts.fontFamily, globalDefaults.defaultFontFamily);
  41482. var tickLabelFont = helpers.fontString(tickFontSize, tickFontStyle, tickFontFamily);
  41483. helpers.each(me.ticks, function(label, index) {
  41484. // Don't draw a centre value (if it is minimum)
  41485. if (index > 0 || opts.reverse) {
  41486. var yCenterOffset = me.getDistanceFromCenterForValue(me.ticksAsNumbers[index]);
  41487. var yHeight = me.yCenter - yCenterOffset;
  41488. // Draw circular lines around the scale
  41489. if (gridLineOpts.display && index !== 0) {
  41490. drawRadiusLine(me, gridLineOpts, yCenterOffset, index);
  41491. }
  41492. if (tickOpts.display) {
  41493. var tickFontColor = getValueOrDefault(tickOpts.fontColor, globalDefaults.defaultFontColor);
  41494. ctx.font = tickLabelFont;
  41495. if (tickOpts.showLabelBackdrop) {
  41496. var labelWidth = ctx.measureText(label).width;
  41497. ctx.fillStyle = tickOpts.backdropColor;
  41498. ctx.fillRect(
  41499. me.xCenter - labelWidth / 2 - tickOpts.backdropPaddingX,
  41500. yHeight - tickFontSize / 2 - tickOpts.backdropPaddingY,
  41501. labelWidth + tickOpts.backdropPaddingX * 2,
  41502. tickFontSize + tickOpts.backdropPaddingY * 2
  41503. );
  41504. }
  41505. ctx.textAlign = 'center';
  41506. ctx.textBaseline = 'middle';
  41507. ctx.fillStyle = tickFontColor;
  41508. ctx.fillText(label, me.xCenter, yHeight);
  41509. }
  41510. }
  41511. });
  41512. if (!opts.lineArc) {
  41513. drawPointLabels(me);
  41514. }
  41515. }
  41516. }
  41517. });
  41518. Chart.scaleService.registerScaleType('radialLinear', LinearRadialScale, defaultConfig);
  41519. };
  41520. /***/ }),
  41521. /* 163 */
  41522. /***/ (function(module, exports, __webpack_require__) {
  41523. "use strict";
  41524. /* global window: false */
  41525. var moment = __webpack_require__(0);
  41526. moment = typeof(moment) === 'function' ? moment : window.moment;
  41527. module.exports = function(Chart) {
  41528. var helpers = Chart.helpers;
  41529. var time = {
  41530. units: [{
  41531. name: 'millisecond',
  41532. steps: [1, 2, 5, 10, 20, 50, 100, 250, 500]
  41533. }, {
  41534. name: 'second',
  41535. steps: [1, 2, 5, 10, 30]
  41536. }, {
  41537. name: 'minute',
  41538. steps: [1, 2, 5, 10, 30]
  41539. }, {
  41540. name: 'hour',
  41541. steps: [1, 2, 3, 6, 12]
  41542. }, {
  41543. name: 'day',
  41544. steps: [1, 2, 5]
  41545. }, {
  41546. name: 'week',
  41547. maxStep: 4
  41548. }, {
  41549. name: 'month',
  41550. maxStep: 3
  41551. }, {
  41552. name: 'quarter',
  41553. maxStep: 4
  41554. }, {
  41555. name: 'year',
  41556. maxStep: false
  41557. }]
  41558. };
  41559. var defaultConfig = {
  41560. position: 'bottom',
  41561. time: {
  41562. 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
  41563. format: false, // DEPRECATED false == date objects, moment object, callback or a pattern string from http://momentjs.com/docs/#/parsing/string-format/
  41564. unit: false, // false == automatic or override with week, month, year, etc.
  41565. round: false, // none, or override with week, month, year, etc.
  41566. displayFormat: false, // DEPRECATED
  41567. isoWeekday: false, // override week start day - see http://momentjs.com/docs/#/get-set/iso-weekday/
  41568. minUnit: 'millisecond',
  41569. // defaults to unit's corresponding unitFormat below or override using pattern string from http://momentjs.com/docs/#/displaying/format/
  41570. displayFormats: {
  41571. millisecond: 'h:mm:ss.SSS a', // 11:20:01.123 AM,
  41572. second: 'h:mm:ss a', // 11:20:01 AM
  41573. minute: 'h:mm:ss a', // 11:20:01 AM
  41574. hour: 'MMM D, hA', // Sept 4, 5PM
  41575. day: 'll', // Sep 4 2015
  41576. week: 'll', // Week 46, or maybe "[W]WW - YYYY" ?
  41577. month: 'MMM YYYY', // Sept 2015
  41578. quarter: '[Q]Q - YYYY', // Q3
  41579. year: 'YYYY' // 2015
  41580. }
  41581. },
  41582. ticks: {
  41583. autoSkip: false
  41584. }
  41585. };
  41586. var TimeScale = Chart.Scale.extend({
  41587. initialize: function() {
  41588. if (!moment) {
  41589. 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');
  41590. }
  41591. Chart.Scale.prototype.initialize.call(this);
  41592. },
  41593. getLabelMoment: function(datasetIndex, index) {
  41594. if (datasetIndex === null || index === null) {
  41595. return null;
  41596. }
  41597. if (typeof this.labelMoments[datasetIndex] !== 'undefined') {
  41598. return this.labelMoments[datasetIndex][index];
  41599. }
  41600. return null;
  41601. },
  41602. getLabelDiff: function(datasetIndex, index) {
  41603. var me = this;
  41604. if (datasetIndex === null || index === null) {
  41605. return null;
  41606. }
  41607. if (me.labelDiffs === undefined) {
  41608. me.buildLabelDiffs();
  41609. }
  41610. if (typeof me.labelDiffs[datasetIndex] !== 'undefined') {
  41611. return me.labelDiffs[datasetIndex][index];
  41612. }
  41613. return null;
  41614. },
  41615. getMomentStartOf: function(tick) {
  41616. var me = this;
  41617. if (me.options.time.unit === 'week' && me.options.time.isoWeekday !== false) {
  41618. return tick.clone().startOf('isoWeek').isoWeekday(me.options.time.isoWeekday);
  41619. }
  41620. return tick.clone().startOf(me.tickUnit);
  41621. },
  41622. determineDataLimits: function() {
  41623. var me = this;
  41624. me.labelMoments = [];
  41625. // Only parse these once. If the dataset does not have data as x,y pairs, we will use
  41626. // these
  41627. var scaleLabelMoments = [];
  41628. if (me.chart.data.labels && me.chart.data.labels.length > 0) {
  41629. helpers.each(me.chart.data.labels, function(label) {
  41630. var labelMoment = me.parseTime(label);
  41631. if (labelMoment.isValid()) {
  41632. if (me.options.time.round) {
  41633. labelMoment.startOf(me.options.time.round);
  41634. }
  41635. scaleLabelMoments.push(labelMoment);
  41636. }
  41637. }, me);
  41638. me.firstTick = moment.min.call(me, scaleLabelMoments);
  41639. me.lastTick = moment.max.call(me, scaleLabelMoments);
  41640. } else {
  41641. me.firstTick = null;
  41642. me.lastTick = null;
  41643. }
  41644. helpers.each(me.chart.data.datasets, function(dataset, datasetIndex) {
  41645. var momentsForDataset = [];
  41646. var datasetVisible = me.chart.isDatasetVisible(datasetIndex);
  41647. if (typeof dataset.data[0] === 'object' && dataset.data[0] !== null) {
  41648. helpers.each(dataset.data, function(value) {
  41649. var labelMoment = me.parseTime(me.getRightValue(value));
  41650. if (labelMoment.isValid()) {
  41651. if (me.options.time.round) {
  41652. labelMoment.startOf(me.options.time.round);
  41653. }
  41654. momentsForDataset.push(labelMoment);
  41655. if (datasetVisible) {
  41656. // May have gone outside the scale ranges, make sure we keep the first and last ticks updated
  41657. me.firstTick = me.firstTick !== null ? moment.min(me.firstTick, labelMoment) : labelMoment;
  41658. me.lastTick = me.lastTick !== null ? moment.max(me.lastTick, labelMoment) : labelMoment;
  41659. }
  41660. }
  41661. }, me);
  41662. } else {
  41663. // We have no labels. Use the ones from the scale
  41664. momentsForDataset = scaleLabelMoments;
  41665. }
  41666. me.labelMoments.push(momentsForDataset);
  41667. }, me);
  41668. // Set these after we've done all the data
  41669. if (me.options.time.min) {
  41670. me.firstTick = me.parseTime(me.options.time.min);
  41671. }
  41672. if (me.options.time.max) {
  41673. me.lastTick = me.parseTime(me.options.time.max);
  41674. }
  41675. // We will modify these, so clone for later
  41676. me.firstTick = (me.firstTick || moment()).clone();
  41677. me.lastTick = (me.lastTick || moment()).clone();
  41678. },
  41679. buildLabelDiffs: function() {
  41680. var me = this;
  41681. me.labelDiffs = [];
  41682. var scaleLabelDiffs = [];
  41683. // Parse common labels once
  41684. if (me.chart.data.labels && me.chart.data.labels.length > 0) {
  41685. helpers.each(me.chart.data.labels, function(label) {
  41686. var labelMoment = me.parseTime(label);
  41687. if (labelMoment.isValid()) {
  41688. if (me.options.time.round) {
  41689. labelMoment.startOf(me.options.time.round);
  41690. }
  41691. scaleLabelDiffs.push(labelMoment.diff(me.firstTick, me.tickUnit, true));
  41692. }
  41693. }, me);
  41694. }
  41695. helpers.each(me.chart.data.datasets, function(dataset) {
  41696. var diffsForDataset = [];
  41697. if (typeof dataset.data[0] === 'object' && dataset.data[0] !== null) {
  41698. helpers.each(dataset.data, function(value) {
  41699. var labelMoment = me.parseTime(me.getRightValue(value));
  41700. if (labelMoment.isValid()) {
  41701. if (me.options.time.round) {
  41702. labelMoment.startOf(me.options.time.round);
  41703. }
  41704. diffsForDataset.push(labelMoment.diff(me.firstTick, me.tickUnit, true));
  41705. }
  41706. }, me);
  41707. } else {
  41708. // We have no labels. Use common ones
  41709. diffsForDataset = scaleLabelDiffs;
  41710. }
  41711. me.labelDiffs.push(diffsForDataset);
  41712. }, me);
  41713. },
  41714. buildTicks: function() {
  41715. var me = this;
  41716. me.ctx.save();
  41717. var tickFontSize = helpers.getValueOrDefault(me.options.ticks.fontSize, Chart.defaults.global.defaultFontSize);
  41718. var tickFontStyle = helpers.getValueOrDefault(me.options.ticks.fontStyle, Chart.defaults.global.defaultFontStyle);
  41719. var tickFontFamily = helpers.getValueOrDefault(me.options.ticks.fontFamily, Chart.defaults.global.defaultFontFamily);
  41720. var tickLabelFont = helpers.fontString(tickFontSize, tickFontStyle, tickFontFamily);
  41721. me.ctx.font = tickLabelFont;
  41722. me.ticks = [];
  41723. me.unitScale = 1; // How much we scale the unit by, ie 2 means 2x unit per step
  41724. me.scaleSizeInUnits = 0; // How large the scale is in the base unit (seconds, minutes, etc)
  41725. // Set unit override if applicable
  41726. if (me.options.time.unit) {
  41727. me.tickUnit = me.options.time.unit || 'day';
  41728. me.displayFormat = me.options.time.displayFormats[me.tickUnit];
  41729. me.scaleSizeInUnits = me.lastTick.diff(me.firstTick, me.tickUnit, true);
  41730. me.unitScale = helpers.getValueOrDefault(me.options.time.unitStepSize, 1);
  41731. } else {
  41732. // Determine the smallest needed unit of the time
  41733. var innerWidth = me.isHorizontal() ? me.width : me.height;
  41734. // Crude approximation of what the label length might be
  41735. var tempFirstLabel = me.tickFormatFunction(me.firstTick, 0, []);
  41736. var tickLabelWidth = me.ctx.measureText(tempFirstLabel).width;
  41737. var cosRotation = Math.cos(helpers.toRadians(me.options.ticks.maxRotation));
  41738. var sinRotation = Math.sin(helpers.toRadians(me.options.ticks.maxRotation));
  41739. tickLabelWidth = (tickLabelWidth * cosRotation) + (tickFontSize * sinRotation);
  41740. var labelCapacity = innerWidth / (tickLabelWidth);
  41741. // Start as small as possible
  41742. me.tickUnit = me.options.time.minUnit;
  41743. me.scaleSizeInUnits = me.lastTick.diff(me.firstTick, me.tickUnit, true);
  41744. me.displayFormat = me.options.time.displayFormats[me.tickUnit];
  41745. var unitDefinitionIndex = 0;
  41746. var unitDefinition = time.units[unitDefinitionIndex];
  41747. // While we aren't ideal and we don't have units left
  41748. while (unitDefinitionIndex < time.units.length) {
  41749. // Can we scale this unit. If `false` we can scale infinitely
  41750. me.unitScale = 1;
  41751. if (helpers.isArray(unitDefinition.steps) && Math.ceil(me.scaleSizeInUnits / labelCapacity) < helpers.max(unitDefinition.steps)) {
  41752. // Use one of the predefined steps
  41753. for (var idx = 0; idx < unitDefinition.steps.length; ++idx) {
  41754. if (unitDefinition.steps[idx] >= Math.ceil(me.scaleSizeInUnits / labelCapacity)) {
  41755. me.unitScale = helpers.getValueOrDefault(me.options.time.unitStepSize, unitDefinition.steps[idx]);
  41756. break;
  41757. }
  41758. }
  41759. break;
  41760. } else if ((unitDefinition.maxStep === false) || (Math.ceil(me.scaleSizeInUnits / labelCapacity) < unitDefinition.maxStep)) {
  41761. // We have a max step. Scale this unit
  41762. me.unitScale = helpers.getValueOrDefault(me.options.time.unitStepSize, Math.ceil(me.scaleSizeInUnits / labelCapacity));
  41763. break;
  41764. } else {
  41765. // Move to the next unit up
  41766. ++unitDefinitionIndex;
  41767. unitDefinition = time.units[unitDefinitionIndex];
  41768. me.tickUnit = unitDefinition.name;
  41769. var leadingUnitBuffer = me.firstTick.diff(me.getMomentStartOf(me.firstTick), me.tickUnit, true);
  41770. var trailingUnitBuffer = me.getMomentStartOf(me.lastTick.clone().add(1, me.tickUnit)).diff(me.lastTick, me.tickUnit, true);
  41771. me.scaleSizeInUnits = me.lastTick.diff(me.firstTick, me.tickUnit, true) + leadingUnitBuffer + trailingUnitBuffer;
  41772. me.displayFormat = me.options.time.displayFormats[unitDefinition.name];
  41773. }
  41774. }
  41775. }
  41776. var roundedStart;
  41777. // Only round the first tick if we have no hard minimum
  41778. if (!me.options.time.min) {
  41779. me.firstTick = me.getMomentStartOf(me.firstTick);
  41780. roundedStart = me.firstTick;
  41781. } else {
  41782. roundedStart = me.getMomentStartOf(me.firstTick);
  41783. }
  41784. // Only round the last tick if we have no hard maximum
  41785. if (!me.options.time.max) {
  41786. var roundedEnd = me.getMomentStartOf(me.lastTick);
  41787. var delta = roundedEnd.diff(me.lastTick, me.tickUnit, true);
  41788. if (delta < 0) {
  41789. // Do not use end of because we need me to be in the next time unit
  41790. me.lastTick = me.getMomentStartOf(me.lastTick.add(1, me.tickUnit));
  41791. } else if (delta >= 0) {
  41792. me.lastTick = roundedEnd;
  41793. }
  41794. me.scaleSizeInUnits = me.lastTick.diff(me.firstTick, me.tickUnit, true);
  41795. }
  41796. // Tick displayFormat override
  41797. if (me.options.time.displayFormat) {
  41798. me.displayFormat = me.options.time.displayFormat;
  41799. }
  41800. // first tick. will have been rounded correctly if options.time.min is not specified
  41801. me.ticks.push(me.firstTick.clone());
  41802. // For every unit in between the first and last moment, create a moment and add it to the ticks tick
  41803. for (var i = me.unitScale; i <= me.scaleSizeInUnits; i += me.unitScale) {
  41804. var newTick = roundedStart.clone().add(i, me.tickUnit);
  41805. // Are we greater than the max time
  41806. if (me.options.time.max && newTick.diff(me.lastTick, me.tickUnit, true) >= 0) {
  41807. break;
  41808. }
  41809. me.ticks.push(newTick);
  41810. }
  41811. // Always show the right tick
  41812. var diff = me.ticks[me.ticks.length - 1].diff(me.lastTick, me.tickUnit);
  41813. if (diff !== 0 || me.scaleSizeInUnits === 0) {
  41814. // 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
  41815. // but the last tick was not rounded.
  41816. if (me.options.time.max) {
  41817. me.ticks.push(me.lastTick.clone());
  41818. me.scaleSizeInUnits = me.lastTick.diff(me.ticks[0], me.tickUnit, true);
  41819. } else {
  41820. me.ticks.push(me.lastTick.clone());
  41821. me.scaleSizeInUnits = me.lastTick.diff(me.firstTick, me.tickUnit, true);
  41822. }
  41823. }
  41824. me.ctx.restore();
  41825. // Invalidate label diffs cache
  41826. me.labelDiffs = undefined;
  41827. },
  41828. // Get tooltip label
  41829. getLabelForIndex: function(index, datasetIndex) {
  41830. var me = this;
  41831. var label = me.chart.data.labels && index < me.chart.data.labels.length ? me.chart.data.labels[index] : '';
  41832. var value = me.chart.data.datasets[datasetIndex].data[index];
  41833. if (value !== null && typeof value === 'object') {
  41834. label = me.getRightValue(value);
  41835. }
  41836. // Format nicely
  41837. if (me.options.time.tooltipFormat) {
  41838. label = me.parseTime(label).format(me.options.time.tooltipFormat);
  41839. }
  41840. return label;
  41841. },
  41842. // Function to format an individual tick mark
  41843. tickFormatFunction: function(tick, index, ticks) {
  41844. var formattedTick = tick.format(this.displayFormat);
  41845. var tickOpts = this.options.ticks;
  41846. var callback = helpers.getValueOrDefault(tickOpts.callback, tickOpts.userCallback);
  41847. if (callback) {
  41848. return callback(formattedTick, index, ticks);
  41849. }
  41850. return formattedTick;
  41851. },
  41852. convertTicksToLabels: function() {
  41853. var me = this;
  41854. me.tickMoments = me.ticks;
  41855. me.ticks = me.ticks.map(me.tickFormatFunction, me);
  41856. },
  41857. getPixelForValue: function(value, index, datasetIndex) {
  41858. var me = this;
  41859. var offset = null;
  41860. if (index !== undefined && datasetIndex !== undefined) {
  41861. offset = me.getLabelDiff(datasetIndex, index);
  41862. }
  41863. if (offset === null) {
  41864. if (!value || !value.isValid) {
  41865. // not already a moment object
  41866. value = me.parseTime(me.getRightValue(value));
  41867. }
  41868. if (value && value.isValid && value.isValid()) {
  41869. offset = value.diff(me.firstTick, me.tickUnit, true);
  41870. }
  41871. }
  41872. if (offset !== null) {
  41873. var decimal = offset !== 0 ? offset / me.scaleSizeInUnits : offset;
  41874. if (me.isHorizontal()) {
  41875. var valueOffset = (me.width * decimal);
  41876. return me.left + Math.round(valueOffset);
  41877. }
  41878. var heightOffset = (me.height * decimal);
  41879. return me.top + Math.round(heightOffset);
  41880. }
  41881. },
  41882. getPixelForTick: function(index) {
  41883. return this.getPixelForValue(this.tickMoments[index], null, null);
  41884. },
  41885. getValueForPixel: function(pixel) {
  41886. var me = this;
  41887. var innerDimension = me.isHorizontal() ? me.width : me.height;
  41888. var offset = (pixel - (me.isHorizontal() ? me.left : me.top)) / innerDimension;
  41889. offset *= me.scaleSizeInUnits;
  41890. return me.firstTick.clone().add(moment.duration(offset, me.tickUnit).asSeconds(), 'seconds');
  41891. },
  41892. parseTime: function(label) {
  41893. var me = this;
  41894. if (typeof me.options.time.parser === 'string') {
  41895. return moment(label, me.options.time.parser);
  41896. }
  41897. if (typeof me.options.time.parser === 'function') {
  41898. return me.options.time.parser(label);
  41899. }
  41900. // Date objects
  41901. if (typeof label.getMonth === 'function' || typeof label === 'number') {
  41902. return moment(label);
  41903. }
  41904. // Moment support
  41905. if (label.isValid && label.isValid()) {
  41906. return label;
  41907. }
  41908. // Custom parsing (return an instance of moment)
  41909. if (typeof me.options.time.format !== 'string' && me.options.time.format.call) {
  41910. 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');
  41911. return me.options.time.format(label);
  41912. }
  41913. // Moment format parsing
  41914. return moment(label, me.options.time.format);
  41915. }
  41916. });
  41917. Chart.scaleService.registerScaleType('time', TimeScale, defaultConfig);
  41918. };
  41919. /***/ }),
  41920. /* 164 */
  41921. /***/ (function(module, exports, __webpack_require__) {
  41922. /* MIT license */
  41923. var colorNames = __webpack_require__(168);
  41924. module.exports = {
  41925. getRgba: getRgba,
  41926. getHsla: getHsla,
  41927. getRgb: getRgb,
  41928. getHsl: getHsl,
  41929. getHwb: getHwb,
  41930. getAlpha: getAlpha,
  41931. hexString: hexString,
  41932. rgbString: rgbString,
  41933. rgbaString: rgbaString,
  41934. percentString: percentString,
  41935. percentaString: percentaString,
  41936. hslString: hslString,
  41937. hslaString: hslaString,
  41938. hwbString: hwbString,
  41939. keyword: keyword
  41940. }
  41941. function getRgba(string) {
  41942. if (!string) {
  41943. return;
  41944. }
  41945. var abbr = /^#([a-fA-F0-9]{3})$/,
  41946. hex = /^#([a-fA-F0-9]{6})$/,
  41947. rgba = /^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,
  41948. per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,
  41949. keyword = /(\w+)/;
  41950. var rgb = [0, 0, 0],
  41951. a = 1,
  41952. match = string.match(abbr);
  41953. if (match) {
  41954. match = match[1];
  41955. for (var i = 0; i < rgb.length; i++) {
  41956. rgb[i] = parseInt(match[i] + match[i], 16);
  41957. }
  41958. }
  41959. else if (match = string.match(hex)) {
  41960. match = match[1];
  41961. for (var i = 0; i < rgb.length; i++) {
  41962. rgb[i] = parseInt(match.slice(i * 2, i * 2 + 2), 16);
  41963. }
  41964. }
  41965. else if (match = string.match(rgba)) {
  41966. for (var i = 0; i < rgb.length; i++) {
  41967. rgb[i] = parseInt(match[i + 1]);
  41968. }
  41969. a = parseFloat(match[4]);
  41970. }
  41971. else if (match = string.match(per)) {
  41972. for (var i = 0; i < rgb.length; i++) {
  41973. rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);
  41974. }
  41975. a = parseFloat(match[4]);
  41976. }
  41977. else if (match = string.match(keyword)) {
  41978. if (match[1] == "transparent") {
  41979. return [0, 0, 0, 0];
  41980. }
  41981. rgb = colorNames[match[1]];
  41982. if (!rgb) {
  41983. return;
  41984. }
  41985. }
  41986. for (var i = 0; i < rgb.length; i++) {
  41987. rgb[i] = scale(rgb[i], 0, 255);
  41988. }
  41989. if (!a && a != 0) {
  41990. a = 1;
  41991. }
  41992. else {
  41993. a = scale(a, 0, 1);
  41994. }
  41995. rgb[3] = a;
  41996. return rgb;
  41997. }
  41998. function getHsla(string) {
  41999. if (!string) {
  42000. return;
  42001. }
  42002. var hsl = /^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/;
  42003. var match = string.match(hsl);
  42004. if (match) {
  42005. var alpha = parseFloat(match[4]);
  42006. var h = scale(parseInt(match[1]), 0, 360),
  42007. s = scale(parseFloat(match[2]), 0, 100),
  42008. l = scale(parseFloat(match[3]), 0, 100),
  42009. a = scale(isNaN(alpha) ? 1 : alpha, 0, 1);
  42010. return [h, s, l, a];
  42011. }
  42012. }
  42013. function getHwb(string) {
  42014. if (!string) {
  42015. return;
  42016. }
  42017. var hwb = /^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/;
  42018. var match = string.match(hwb);
  42019. if (match) {
  42020. var alpha = parseFloat(match[4]);
  42021. var h = scale(parseInt(match[1]), 0, 360),
  42022. w = scale(parseFloat(match[2]), 0, 100),
  42023. b = scale(parseFloat(match[3]), 0, 100),
  42024. a = scale(isNaN(alpha) ? 1 : alpha, 0, 1);
  42025. return [h, w, b, a];
  42026. }
  42027. }
  42028. function getRgb(string) {
  42029. var rgba = getRgba(string);
  42030. return rgba && rgba.slice(0, 3);
  42031. }
  42032. function getHsl(string) {
  42033. var hsla = getHsla(string);
  42034. return hsla && hsla.slice(0, 3);
  42035. }
  42036. function getAlpha(string) {
  42037. var vals = getRgba(string);
  42038. if (vals) {
  42039. return vals[3];
  42040. }
  42041. else if (vals = getHsla(string)) {
  42042. return vals[3];
  42043. }
  42044. else if (vals = getHwb(string)) {
  42045. return vals[3];
  42046. }
  42047. }
  42048. // generators
  42049. function hexString(rgb) {
  42050. return "#" + hexDouble(rgb[0]) + hexDouble(rgb[1])
  42051. + hexDouble(rgb[2]);
  42052. }
  42053. function rgbString(rgba, alpha) {
  42054. if (alpha < 1 || (rgba[3] && rgba[3] < 1)) {
  42055. return rgbaString(rgba, alpha);
  42056. }
  42057. return "rgb(" + rgba[0] + ", " + rgba[1] + ", " + rgba[2] + ")";
  42058. }
  42059. function rgbaString(rgba, alpha) {
  42060. if (alpha === undefined) {
  42061. alpha = (rgba[3] !== undefined ? rgba[3] : 1);
  42062. }
  42063. return "rgba(" + rgba[0] + ", " + rgba[1] + ", " + rgba[2]
  42064. + ", " + alpha + ")";
  42065. }
  42066. function percentString(rgba, alpha) {
  42067. if (alpha < 1 || (rgba[3] && rgba[3] < 1)) {
  42068. return percentaString(rgba, alpha);
  42069. }
  42070. var r = Math.round(rgba[0]/255 * 100),
  42071. g = Math.round(rgba[1]/255 * 100),
  42072. b = Math.round(rgba[2]/255 * 100);
  42073. return "rgb(" + r + "%, " + g + "%, " + b + "%)";
  42074. }
  42075. function percentaString(rgba, alpha) {
  42076. var r = Math.round(rgba[0]/255 * 100),
  42077. g = Math.round(rgba[1]/255 * 100),
  42078. b = Math.round(rgba[2]/255 * 100);
  42079. return "rgba(" + r + "%, " + g + "%, " + b + "%, " + (alpha || rgba[3] || 1) + ")";
  42080. }
  42081. function hslString(hsla, alpha) {
  42082. if (alpha < 1 || (hsla[3] && hsla[3] < 1)) {
  42083. return hslaString(hsla, alpha);
  42084. }
  42085. return "hsl(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%)";
  42086. }
  42087. function hslaString(hsla, alpha) {
  42088. if (alpha === undefined) {
  42089. alpha = (hsla[3] !== undefined ? hsla[3] : 1);
  42090. }
  42091. return "hsla(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%, "
  42092. + alpha + ")";
  42093. }
  42094. // hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax
  42095. // (hwb have alpha optional & 1 is default value)
  42096. function hwbString(hwb, alpha) {
  42097. if (alpha === undefined) {
  42098. alpha = (hwb[3] !== undefined ? hwb[3] : 1);
  42099. }
  42100. return "hwb(" + hwb[0] + ", " + hwb[1] + "%, " + hwb[2] + "%"
  42101. + (alpha !== undefined && alpha !== 1 ? ", " + alpha : "") + ")";
  42102. }
  42103. function keyword(rgb) {
  42104. return reverseNames[rgb.slice(0, 3)];
  42105. }
  42106. // helpers
  42107. function scale(num, min, max) {
  42108. return Math.min(Math.max(min, num), max);
  42109. }
  42110. function hexDouble(num) {
  42111. var str = num.toString(16).toUpperCase();
  42112. return (str.length < 2) ? "0" + str : str;
  42113. }
  42114. //create a list of reverse color names
  42115. var reverseNames = {};
  42116. for (var name in colorNames) {
  42117. reverseNames[colorNames[name]] = name;
  42118. }
  42119. /***/ }),
  42120. /* 165 */
  42121. /***/ (function(module, exports, __webpack_require__) {
  42122. /* MIT license */
  42123. var convert = __webpack_require__(167);
  42124. var string = __webpack_require__(164);
  42125. var Color = function (obj) {
  42126. if (obj instanceof Color) {
  42127. return obj;
  42128. }
  42129. if (!(this instanceof Color)) {
  42130. return new Color(obj);
  42131. }
  42132. this.valid = false;
  42133. this.values = {
  42134. rgb: [0, 0, 0],
  42135. hsl: [0, 0, 0],
  42136. hsv: [0, 0, 0],
  42137. hwb: [0, 0, 0],
  42138. cmyk: [0, 0, 0, 0],
  42139. alpha: 1
  42140. };
  42141. // parse Color() argument
  42142. var vals;
  42143. if (typeof obj === 'string') {
  42144. vals = string.getRgba(obj);
  42145. if (vals) {
  42146. this.setValues('rgb', vals);
  42147. } else if (vals = string.getHsla(obj)) {
  42148. this.setValues('hsl', vals);
  42149. } else if (vals = string.getHwb(obj)) {
  42150. this.setValues('hwb', vals);
  42151. }
  42152. } else if (typeof obj === 'object') {
  42153. vals = obj;
  42154. if (vals.r !== undefined || vals.red !== undefined) {
  42155. this.setValues('rgb', vals);
  42156. } else if (vals.l !== undefined || vals.lightness !== undefined) {
  42157. this.setValues('hsl', vals);
  42158. } else if (vals.v !== undefined || vals.value !== undefined) {
  42159. this.setValues('hsv', vals);
  42160. } else if (vals.w !== undefined || vals.whiteness !== undefined) {
  42161. this.setValues('hwb', vals);
  42162. } else if (vals.c !== undefined || vals.cyan !== undefined) {
  42163. this.setValues('cmyk', vals);
  42164. }
  42165. }
  42166. };
  42167. Color.prototype = {
  42168. isValid: function () {
  42169. return this.valid;
  42170. },
  42171. rgb: function () {
  42172. return this.setSpace('rgb', arguments);
  42173. },
  42174. hsl: function () {
  42175. return this.setSpace('hsl', arguments);
  42176. },
  42177. hsv: function () {
  42178. return this.setSpace('hsv', arguments);
  42179. },
  42180. hwb: function () {
  42181. return this.setSpace('hwb', arguments);
  42182. },
  42183. cmyk: function () {
  42184. return this.setSpace('cmyk', arguments);
  42185. },
  42186. rgbArray: function () {
  42187. return this.values.rgb;
  42188. },
  42189. hslArray: function () {
  42190. return this.values.hsl;
  42191. },
  42192. hsvArray: function () {
  42193. return this.values.hsv;
  42194. },
  42195. hwbArray: function () {
  42196. var values = this.values;
  42197. if (values.alpha !== 1) {
  42198. return values.hwb.concat([values.alpha]);
  42199. }
  42200. return values.hwb;
  42201. },
  42202. cmykArray: function () {
  42203. return this.values.cmyk;
  42204. },
  42205. rgbaArray: function () {
  42206. var values = this.values;
  42207. return values.rgb.concat([values.alpha]);
  42208. },
  42209. hslaArray: function () {
  42210. var values = this.values;
  42211. return values.hsl.concat([values.alpha]);
  42212. },
  42213. alpha: function (val) {
  42214. if (val === undefined) {
  42215. return this.values.alpha;
  42216. }
  42217. this.setValues('alpha', val);
  42218. return this;
  42219. },
  42220. red: function (val) {
  42221. return this.setChannel('rgb', 0, val);
  42222. },
  42223. green: function (val) {
  42224. return this.setChannel('rgb', 1, val);
  42225. },
  42226. blue: function (val) {
  42227. return this.setChannel('rgb', 2, val);
  42228. },
  42229. hue: function (val) {
  42230. if (val) {
  42231. val %= 360;
  42232. val = val < 0 ? 360 + val : val;
  42233. }
  42234. return this.setChannel('hsl', 0, val);
  42235. },
  42236. saturation: function (val) {
  42237. return this.setChannel('hsl', 1, val);
  42238. },
  42239. lightness: function (val) {
  42240. return this.setChannel('hsl', 2, val);
  42241. },
  42242. saturationv: function (val) {
  42243. return this.setChannel('hsv', 1, val);
  42244. },
  42245. whiteness: function (val) {
  42246. return this.setChannel('hwb', 1, val);
  42247. },
  42248. blackness: function (val) {
  42249. return this.setChannel('hwb', 2, val);
  42250. },
  42251. value: function (val) {
  42252. return this.setChannel('hsv', 2, val);
  42253. },
  42254. cyan: function (val) {
  42255. return this.setChannel('cmyk', 0, val);
  42256. },
  42257. magenta: function (val) {
  42258. return this.setChannel('cmyk', 1, val);
  42259. },
  42260. yellow: function (val) {
  42261. return this.setChannel('cmyk', 2, val);
  42262. },
  42263. black: function (val) {
  42264. return this.setChannel('cmyk', 3, val);
  42265. },
  42266. hexString: function () {
  42267. return string.hexString(this.values.rgb);
  42268. },
  42269. rgbString: function () {
  42270. return string.rgbString(this.values.rgb, this.values.alpha);
  42271. },
  42272. rgbaString: function () {
  42273. return string.rgbaString(this.values.rgb, this.values.alpha);
  42274. },
  42275. percentString: function () {
  42276. return string.percentString(this.values.rgb, this.values.alpha);
  42277. },
  42278. hslString: function () {
  42279. return string.hslString(this.values.hsl, this.values.alpha);
  42280. },
  42281. hslaString: function () {
  42282. return string.hslaString(this.values.hsl, this.values.alpha);
  42283. },
  42284. hwbString: function () {
  42285. return string.hwbString(this.values.hwb, this.values.alpha);
  42286. },
  42287. keyword: function () {
  42288. return string.keyword(this.values.rgb, this.values.alpha);
  42289. },
  42290. rgbNumber: function () {
  42291. var rgb = this.values.rgb;
  42292. return (rgb[0] << 16) | (rgb[1] << 8) | rgb[2];
  42293. },
  42294. luminosity: function () {
  42295. // http://www.w3.org/TR/WCAG20/#relativeluminancedef
  42296. var rgb = this.values.rgb;
  42297. var lum = [];
  42298. for (var i = 0; i < rgb.length; i++) {
  42299. var chan = rgb[i] / 255;
  42300. lum[i] = (chan <= 0.03928) ? chan / 12.92 : Math.pow(((chan + 0.055) / 1.055), 2.4);
  42301. }
  42302. return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
  42303. },
  42304. contrast: function (color2) {
  42305. // http://www.w3.org/TR/WCAG20/#contrast-ratiodef
  42306. var lum1 = this.luminosity();
  42307. var lum2 = color2.luminosity();
  42308. if (lum1 > lum2) {
  42309. return (lum1 + 0.05) / (lum2 + 0.05);
  42310. }
  42311. return (lum2 + 0.05) / (lum1 + 0.05);
  42312. },
  42313. level: function (color2) {
  42314. var contrastRatio = this.contrast(color2);
  42315. if (contrastRatio >= 7.1) {
  42316. return 'AAA';
  42317. }
  42318. return (contrastRatio >= 4.5) ? 'AA' : '';
  42319. },
  42320. dark: function () {
  42321. // YIQ equation from http://24ways.org/2010/calculating-color-contrast
  42322. var rgb = this.values.rgb;
  42323. var yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000;
  42324. return yiq < 128;
  42325. },
  42326. light: function () {
  42327. return !this.dark();
  42328. },
  42329. negate: function () {
  42330. var rgb = [];
  42331. for (var i = 0; i < 3; i++) {
  42332. rgb[i] = 255 - this.values.rgb[i];
  42333. }
  42334. this.setValues('rgb', rgb);
  42335. return this;
  42336. },
  42337. lighten: function (ratio) {
  42338. var hsl = this.values.hsl;
  42339. hsl[2] += hsl[2] * ratio;
  42340. this.setValues('hsl', hsl);
  42341. return this;
  42342. },
  42343. darken: function (ratio) {
  42344. var hsl = this.values.hsl;
  42345. hsl[2] -= hsl[2] * ratio;
  42346. this.setValues('hsl', hsl);
  42347. return this;
  42348. },
  42349. saturate: function (ratio) {
  42350. var hsl = this.values.hsl;
  42351. hsl[1] += hsl[1] * ratio;
  42352. this.setValues('hsl', hsl);
  42353. return this;
  42354. },
  42355. desaturate: function (ratio) {
  42356. var hsl = this.values.hsl;
  42357. hsl[1] -= hsl[1] * ratio;
  42358. this.setValues('hsl', hsl);
  42359. return this;
  42360. },
  42361. whiten: function (ratio) {
  42362. var hwb = this.values.hwb;
  42363. hwb[1] += hwb[1] * ratio;
  42364. this.setValues('hwb', hwb);
  42365. return this;
  42366. },
  42367. blacken: function (ratio) {
  42368. var hwb = this.values.hwb;
  42369. hwb[2] += hwb[2] * ratio;
  42370. this.setValues('hwb', hwb);
  42371. return this;
  42372. },
  42373. greyscale: function () {
  42374. var rgb = this.values.rgb;
  42375. // http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale
  42376. var val = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
  42377. this.setValues('rgb', [val, val, val]);
  42378. return this;
  42379. },
  42380. clearer: function (ratio) {
  42381. var alpha = this.values.alpha;
  42382. this.setValues('alpha', alpha - (alpha * ratio));
  42383. return this;
  42384. },
  42385. opaquer: function (ratio) {
  42386. var alpha = this.values.alpha;
  42387. this.setValues('alpha', alpha + (alpha * ratio));
  42388. return this;
  42389. },
  42390. rotate: function (degrees) {
  42391. var hsl = this.values.hsl;
  42392. var hue = (hsl[0] + degrees) % 360;
  42393. hsl[0] = hue < 0 ? 360 + hue : hue;
  42394. this.setValues('hsl', hsl);
  42395. return this;
  42396. },
  42397. /**
  42398. * Ported from sass implementation in C
  42399. * https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209
  42400. */
  42401. mix: function (mixinColor, weight) {
  42402. var color1 = this;
  42403. var color2 = mixinColor;
  42404. var p = weight === undefined ? 0.5 : weight;
  42405. var w = 2 * p - 1;
  42406. var a = color1.alpha() - color2.alpha();
  42407. var w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
  42408. var w2 = 1 - w1;
  42409. return this
  42410. .rgb(
  42411. w1 * color1.red() + w2 * color2.red(),
  42412. w1 * color1.green() + w2 * color2.green(),
  42413. w1 * color1.blue() + w2 * color2.blue()
  42414. )
  42415. .alpha(color1.alpha() * p + color2.alpha() * (1 - p));
  42416. },
  42417. toJSON: function () {
  42418. return this.rgb();
  42419. },
  42420. clone: function () {
  42421. // NOTE(SB): using node-clone creates a dependency to Buffer when using browserify,
  42422. // making the final build way to big to embed in Chart.js. So let's do it manually,
  42423. // assuming that values to clone are 1 dimension arrays containing only numbers,
  42424. // except 'alpha' which is a number.
  42425. var result = new Color();
  42426. var source = this.values;
  42427. var target = result.values;
  42428. var value, type;
  42429. for (var prop in source) {
  42430. if (source.hasOwnProperty(prop)) {
  42431. value = source[prop];
  42432. type = ({}).toString.call(value);
  42433. if (type === '[object Array]') {
  42434. target[prop] = value.slice(0);
  42435. } else if (type === '[object Number]') {
  42436. target[prop] = value;
  42437. } else {
  42438. console.error('unexpected color value:', value);
  42439. }
  42440. }
  42441. }
  42442. return result;
  42443. }
  42444. };
  42445. Color.prototype.spaces = {
  42446. rgb: ['red', 'green', 'blue'],
  42447. hsl: ['hue', 'saturation', 'lightness'],
  42448. hsv: ['hue', 'saturation', 'value'],
  42449. hwb: ['hue', 'whiteness', 'blackness'],
  42450. cmyk: ['cyan', 'magenta', 'yellow', 'black']
  42451. };
  42452. Color.prototype.maxes = {
  42453. rgb: [255, 255, 255],
  42454. hsl: [360, 100, 100],
  42455. hsv: [360, 100, 100],
  42456. hwb: [360, 100, 100],
  42457. cmyk: [100, 100, 100, 100]
  42458. };
  42459. Color.prototype.getValues = function (space) {
  42460. var values = this.values;
  42461. var vals = {};
  42462. for (var i = 0; i < space.length; i++) {
  42463. vals[space.charAt(i)] = values[space][i];
  42464. }
  42465. if (values.alpha !== 1) {
  42466. vals.a = values.alpha;
  42467. }
  42468. // {r: 255, g: 255, b: 255, a: 0.4}
  42469. return vals;
  42470. };
  42471. Color.prototype.setValues = function (space, vals) {
  42472. var values = this.values;
  42473. var spaces = this.spaces;
  42474. var maxes = this.maxes;
  42475. var alpha = 1;
  42476. var i;
  42477. this.valid = true;
  42478. if (space === 'alpha') {
  42479. alpha = vals;
  42480. } else if (vals.length) {
  42481. // [10, 10, 10]
  42482. values[space] = vals.slice(0, space.length);
  42483. alpha = vals[space.length];
  42484. } else if (vals[space.charAt(0)] !== undefined) {
  42485. // {r: 10, g: 10, b: 10}
  42486. for (i = 0; i < space.length; i++) {
  42487. values[space][i] = vals[space.charAt(i)];
  42488. }
  42489. alpha = vals.a;
  42490. } else if (vals[spaces[space][0]] !== undefined) {
  42491. // {red: 10, green: 10, blue: 10}
  42492. var chans = spaces[space];
  42493. for (i = 0; i < space.length; i++) {
  42494. values[space][i] = vals[chans[i]];
  42495. }
  42496. alpha = vals.alpha;
  42497. }
  42498. values.alpha = Math.max(0, Math.min(1, (alpha === undefined ? values.alpha : alpha)));
  42499. if (space === 'alpha') {
  42500. return false;
  42501. }
  42502. var capped;
  42503. // cap values of the space prior converting all values
  42504. for (i = 0; i < space.length; i++) {
  42505. capped = Math.max(0, Math.min(maxes[space][i], values[space][i]));
  42506. values[space][i] = Math.round(capped);
  42507. }
  42508. // convert to all the other color spaces
  42509. for (var sname in spaces) {
  42510. if (sname !== space) {
  42511. values[sname] = convert[space][sname](values[space]);
  42512. }
  42513. }
  42514. return true;
  42515. };
  42516. Color.prototype.setSpace = function (space, args) {
  42517. var vals = args[0];
  42518. if (vals === undefined) {
  42519. // color.rgb()
  42520. return this.getValues(space);
  42521. }
  42522. // color.rgb(10, 10, 10)
  42523. if (typeof vals === 'number') {
  42524. vals = Array.prototype.slice.call(args);
  42525. }
  42526. this.setValues(space, vals);
  42527. return this;
  42528. };
  42529. Color.prototype.setChannel = function (space, index, val) {
  42530. var svalues = this.values[space];
  42531. if (val === undefined) {
  42532. // color.red()
  42533. return svalues[index];
  42534. } else if (val === svalues[index]) {
  42535. // color.red(color.red())
  42536. return this;
  42537. }
  42538. // color.red(100)
  42539. svalues[index] = val;
  42540. this.setValues(space, svalues);
  42541. return this;
  42542. };
  42543. if (typeof window !== 'undefined') {
  42544. window.Color = Color;
  42545. }
  42546. module.exports = Color;
  42547. /***/ }),
  42548. /* 166 */
  42549. /***/ (function(module, exports) {
  42550. /* MIT license */
  42551. module.exports = {
  42552. rgb2hsl: rgb2hsl,
  42553. rgb2hsv: rgb2hsv,
  42554. rgb2hwb: rgb2hwb,
  42555. rgb2cmyk: rgb2cmyk,
  42556. rgb2keyword: rgb2keyword,
  42557. rgb2xyz: rgb2xyz,
  42558. rgb2lab: rgb2lab,
  42559. rgb2lch: rgb2lch,
  42560. hsl2rgb: hsl2rgb,
  42561. hsl2hsv: hsl2hsv,
  42562. hsl2hwb: hsl2hwb,
  42563. hsl2cmyk: hsl2cmyk,
  42564. hsl2keyword: hsl2keyword,
  42565. hsv2rgb: hsv2rgb,
  42566. hsv2hsl: hsv2hsl,
  42567. hsv2hwb: hsv2hwb,
  42568. hsv2cmyk: hsv2cmyk,
  42569. hsv2keyword: hsv2keyword,
  42570. hwb2rgb: hwb2rgb,
  42571. hwb2hsl: hwb2hsl,
  42572. hwb2hsv: hwb2hsv,
  42573. hwb2cmyk: hwb2cmyk,
  42574. hwb2keyword: hwb2keyword,
  42575. cmyk2rgb: cmyk2rgb,
  42576. cmyk2hsl: cmyk2hsl,
  42577. cmyk2hsv: cmyk2hsv,
  42578. cmyk2hwb: cmyk2hwb,
  42579. cmyk2keyword: cmyk2keyword,
  42580. keyword2rgb: keyword2rgb,
  42581. keyword2hsl: keyword2hsl,
  42582. keyword2hsv: keyword2hsv,
  42583. keyword2hwb: keyword2hwb,
  42584. keyword2cmyk: keyword2cmyk,
  42585. keyword2lab: keyword2lab,
  42586. keyword2xyz: keyword2xyz,
  42587. xyz2rgb: xyz2rgb,
  42588. xyz2lab: xyz2lab,
  42589. xyz2lch: xyz2lch,
  42590. lab2xyz: lab2xyz,
  42591. lab2rgb: lab2rgb,
  42592. lab2lch: lab2lch,
  42593. lch2lab: lch2lab,
  42594. lch2xyz: lch2xyz,
  42595. lch2rgb: lch2rgb
  42596. }
  42597. function rgb2hsl(rgb) {
  42598. var r = rgb[0]/255,
  42599. g = rgb[1]/255,
  42600. b = rgb[2]/255,
  42601. min = Math.min(r, g, b),
  42602. max = Math.max(r, g, b),
  42603. delta = max - min,
  42604. h, s, l;
  42605. if (max == min)
  42606. h = 0;
  42607. else if (r == max)
  42608. h = (g - b) / delta;
  42609. else if (g == max)
  42610. h = 2 + (b - r) / delta;
  42611. else if (b == max)
  42612. h = 4 + (r - g)/ delta;
  42613. h = Math.min(h * 60, 360);
  42614. if (h < 0)
  42615. h += 360;
  42616. l = (min + max) / 2;
  42617. if (max == min)
  42618. s = 0;
  42619. else if (l <= 0.5)
  42620. s = delta / (max + min);
  42621. else
  42622. s = delta / (2 - max - min);
  42623. return [h, s * 100, l * 100];
  42624. }
  42625. function rgb2hsv(rgb) {
  42626. var r = rgb[0],
  42627. g = rgb[1],
  42628. b = rgb[2],
  42629. min = Math.min(r, g, b),
  42630. max = Math.max(r, g, b),
  42631. delta = max - min,
  42632. h, s, v;
  42633. if (max == 0)
  42634. s = 0;
  42635. else
  42636. s = (delta/max * 1000)/10;
  42637. if (max == min)
  42638. h = 0;
  42639. else if (r == max)
  42640. h = (g - b) / delta;
  42641. else if (g == max)
  42642. h = 2 + (b - r) / delta;
  42643. else if (b == max)
  42644. h = 4 + (r - g) / delta;
  42645. h = Math.min(h * 60, 360);
  42646. if (h < 0)
  42647. h += 360;
  42648. v = ((max / 255) * 1000) / 10;
  42649. return [h, s, v];
  42650. }
  42651. function rgb2hwb(rgb) {
  42652. var r = rgb[0],
  42653. g = rgb[1],
  42654. b = rgb[2],
  42655. h = rgb2hsl(rgb)[0],
  42656. w = 1/255 * Math.min(r, Math.min(g, b)),
  42657. b = 1 - 1/255 * Math.max(r, Math.max(g, b));
  42658. return [h, w * 100, b * 100];
  42659. }
  42660. function rgb2cmyk(rgb) {
  42661. var r = rgb[0] / 255,
  42662. g = rgb[1] / 255,
  42663. b = rgb[2] / 255,
  42664. c, m, y, k;
  42665. k = Math.min(1 - r, 1 - g, 1 - b);
  42666. c = (1 - r - k) / (1 - k) || 0;
  42667. m = (1 - g - k) / (1 - k) || 0;
  42668. y = (1 - b - k) / (1 - k) || 0;
  42669. return [c * 100, m * 100, y * 100, k * 100];
  42670. }
  42671. function rgb2keyword(rgb) {
  42672. return reverseKeywords[JSON.stringify(rgb)];
  42673. }
  42674. function rgb2xyz(rgb) {
  42675. var r = rgb[0] / 255,
  42676. g = rgb[1] / 255,
  42677. b = rgb[2] / 255;
  42678. // assume sRGB
  42679. r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);
  42680. g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);
  42681. b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);
  42682. var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);
  42683. var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);
  42684. var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);
  42685. return [x * 100, y *100, z * 100];
  42686. }
  42687. function rgb2lab(rgb) {
  42688. var xyz = rgb2xyz(rgb),
  42689. x = xyz[0],
  42690. y = xyz[1],
  42691. z = xyz[2],
  42692. l, a, b;
  42693. x /= 95.047;
  42694. y /= 100;
  42695. z /= 108.883;
  42696. x = x > 0.008856 ? Math.pow(x, 1/3) : (7.787 * x) + (16 / 116);
  42697. y = y > 0.008856 ? Math.pow(y, 1/3) : (7.787 * y) + (16 / 116);
  42698. z = z > 0.008856 ? Math.pow(z, 1/3) : (7.787 * z) + (16 / 116);
  42699. l = (116 * y) - 16;
  42700. a = 500 * (x - y);
  42701. b = 200 * (y - z);
  42702. return [l, a, b];
  42703. }
  42704. function rgb2lch(args) {
  42705. return lab2lch(rgb2lab(args));
  42706. }
  42707. function hsl2rgb(hsl) {
  42708. var h = hsl[0] / 360,
  42709. s = hsl[1] / 100,
  42710. l = hsl[2] / 100,
  42711. t1, t2, t3, rgb, val;
  42712. if (s == 0) {
  42713. val = l * 255;
  42714. return [val, val, val];
  42715. }
  42716. if (l < 0.5)
  42717. t2 = l * (1 + s);
  42718. else
  42719. t2 = l + s - l * s;
  42720. t1 = 2 * l - t2;
  42721. rgb = [0, 0, 0];
  42722. for (var i = 0; i < 3; i++) {
  42723. t3 = h + 1 / 3 * - (i - 1);
  42724. t3 < 0 && t3++;
  42725. t3 > 1 && t3--;
  42726. if (6 * t3 < 1)
  42727. val = t1 + (t2 - t1) * 6 * t3;
  42728. else if (2 * t3 < 1)
  42729. val = t2;
  42730. else if (3 * t3 < 2)
  42731. val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
  42732. else
  42733. val = t1;
  42734. rgb[i] = val * 255;
  42735. }
  42736. return rgb;
  42737. }
  42738. function hsl2hsv(hsl) {
  42739. var h = hsl[0],
  42740. s = hsl[1] / 100,
  42741. l = hsl[2] / 100,
  42742. sv, v;
  42743. if(l === 0) {
  42744. // no need to do calc on black
  42745. // also avoids divide by 0 error
  42746. return [0, 0, 0];
  42747. }
  42748. l *= 2;
  42749. s *= (l <= 1) ? l : 2 - l;
  42750. v = (l + s) / 2;
  42751. sv = (2 * s) / (l + s);
  42752. return [h, sv * 100, v * 100];
  42753. }
  42754. function hsl2hwb(args) {
  42755. return rgb2hwb(hsl2rgb(args));
  42756. }
  42757. function hsl2cmyk(args) {
  42758. return rgb2cmyk(hsl2rgb(args));
  42759. }
  42760. function hsl2keyword(args) {
  42761. return rgb2keyword(hsl2rgb(args));
  42762. }
  42763. function hsv2rgb(hsv) {
  42764. var h = hsv[0] / 60,
  42765. s = hsv[1] / 100,
  42766. v = hsv[2] / 100,
  42767. hi = Math.floor(h) % 6;
  42768. var f = h - Math.floor(h),
  42769. p = 255 * v * (1 - s),
  42770. q = 255 * v * (1 - (s * f)),
  42771. t = 255 * v * (1 - (s * (1 - f))),
  42772. v = 255 * v;
  42773. switch(hi) {
  42774. case 0:
  42775. return [v, t, p];
  42776. case 1:
  42777. return [q, v, p];
  42778. case 2:
  42779. return [p, v, t];
  42780. case 3:
  42781. return [p, q, v];
  42782. case 4:
  42783. return [t, p, v];
  42784. case 5:
  42785. return [v, p, q];
  42786. }
  42787. }
  42788. function hsv2hsl(hsv) {
  42789. var h = hsv[0],
  42790. s = hsv[1] / 100,
  42791. v = hsv[2] / 100,
  42792. sl, l;
  42793. l = (2 - s) * v;
  42794. sl = s * v;
  42795. sl /= (l <= 1) ? l : 2 - l;
  42796. sl = sl || 0;
  42797. l /= 2;
  42798. return [h, sl * 100, l * 100];
  42799. }
  42800. function hsv2hwb(args) {
  42801. return rgb2hwb(hsv2rgb(args))
  42802. }
  42803. function hsv2cmyk(args) {
  42804. return rgb2cmyk(hsv2rgb(args));
  42805. }
  42806. function hsv2keyword(args) {
  42807. return rgb2keyword(hsv2rgb(args));
  42808. }
  42809. // http://dev.w3.org/csswg/css-color/#hwb-to-rgb
  42810. function hwb2rgb(hwb) {
  42811. var h = hwb[0] / 360,
  42812. wh = hwb[1] / 100,
  42813. bl = hwb[2] / 100,
  42814. ratio = wh + bl,
  42815. i, v, f, n;
  42816. // wh + bl cant be > 1
  42817. if (ratio > 1) {
  42818. wh /= ratio;
  42819. bl /= ratio;
  42820. }
  42821. i = Math.floor(6 * h);
  42822. v = 1 - bl;
  42823. f = 6 * h - i;
  42824. if ((i & 0x01) != 0) {
  42825. f = 1 - f;
  42826. }
  42827. n = wh + f * (v - wh); // linear interpolation
  42828. switch (i) {
  42829. default:
  42830. case 6:
  42831. case 0: r = v; g = n; b = wh; break;
  42832. case 1: r = n; g = v; b = wh; break;
  42833. case 2: r = wh; g = v; b = n; break;
  42834. case 3: r = wh; g = n; b = v; break;
  42835. case 4: r = n; g = wh; b = v; break;
  42836. case 5: r = v; g = wh; b = n; break;
  42837. }
  42838. return [r * 255, g * 255, b * 255];
  42839. }
  42840. function hwb2hsl(args) {
  42841. return rgb2hsl(hwb2rgb(args));
  42842. }
  42843. function hwb2hsv(args) {
  42844. return rgb2hsv(hwb2rgb(args));
  42845. }
  42846. function hwb2cmyk(args) {
  42847. return rgb2cmyk(hwb2rgb(args));
  42848. }
  42849. function hwb2keyword(args) {
  42850. return rgb2keyword(hwb2rgb(args));
  42851. }
  42852. function cmyk2rgb(cmyk) {
  42853. var c = cmyk[0] / 100,
  42854. m = cmyk[1] / 100,
  42855. y = cmyk[2] / 100,
  42856. k = cmyk[3] / 100,
  42857. r, g, b;
  42858. r = 1 - Math.min(1, c * (1 - k) + k);
  42859. g = 1 - Math.min(1, m * (1 - k) + k);
  42860. b = 1 - Math.min(1, y * (1 - k) + k);
  42861. return [r * 255, g * 255, b * 255];
  42862. }
  42863. function cmyk2hsl(args) {
  42864. return rgb2hsl(cmyk2rgb(args));
  42865. }
  42866. function cmyk2hsv(args) {
  42867. return rgb2hsv(cmyk2rgb(args));
  42868. }
  42869. function cmyk2hwb(args) {
  42870. return rgb2hwb(cmyk2rgb(args));
  42871. }
  42872. function cmyk2keyword(args) {
  42873. return rgb2keyword(cmyk2rgb(args));
  42874. }
  42875. function xyz2rgb(xyz) {
  42876. var x = xyz[0] / 100,
  42877. y = xyz[1] / 100,
  42878. z = xyz[2] / 100,
  42879. r, g, b;
  42880. r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);
  42881. g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);
  42882. b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);
  42883. // assume sRGB
  42884. r = r > 0.0031308 ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)
  42885. : r = (r * 12.92);
  42886. g = g > 0.0031308 ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)
  42887. : g = (g * 12.92);
  42888. b = b > 0.0031308 ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)
  42889. : b = (b * 12.92);
  42890. r = Math.min(Math.max(0, r), 1);
  42891. g = Math.min(Math.max(0, g), 1);
  42892. b = Math.min(Math.max(0, b), 1);
  42893. return [r * 255, g * 255, b * 255];
  42894. }
  42895. function xyz2lab(xyz) {
  42896. var x = xyz[0],
  42897. y = xyz[1],
  42898. z = xyz[2],
  42899. l, a, b;
  42900. x /= 95.047;
  42901. y /= 100;
  42902. z /= 108.883;
  42903. x = x > 0.008856 ? Math.pow(x, 1/3) : (7.787 * x) + (16 / 116);
  42904. y = y > 0.008856 ? Math.pow(y, 1/3) : (7.787 * y) + (16 / 116);
  42905. z = z > 0.008856 ? Math.pow(z, 1/3) : (7.787 * z) + (16 / 116);
  42906. l = (116 * y) - 16;
  42907. a = 500 * (x - y);
  42908. b = 200 * (y - z);
  42909. return [l, a, b];
  42910. }
  42911. function xyz2lch(args) {
  42912. return lab2lch(xyz2lab(args));
  42913. }
  42914. function lab2xyz(lab) {
  42915. var l = lab[0],
  42916. a = lab[1],
  42917. b = lab[2],
  42918. x, y, z, y2;
  42919. if (l <= 8) {
  42920. y = (l * 100) / 903.3;
  42921. y2 = (7.787 * (y / 100)) + (16 / 116);
  42922. } else {
  42923. y = 100 * Math.pow((l + 16) / 116, 3);
  42924. y2 = Math.pow(y / 100, 1/3);
  42925. }
  42926. x = x / 95.047 <= 0.008856 ? x = (95.047 * ((a / 500) + y2 - (16 / 116))) / 7.787 : 95.047 * Math.pow((a / 500) + y2, 3);
  42927. z = z / 108.883 <= 0.008859 ? z = (108.883 * (y2 - (b / 200) - (16 / 116))) / 7.787 : 108.883 * Math.pow(y2 - (b / 200), 3);
  42928. return [x, y, z];
  42929. }
  42930. function lab2lch(lab) {
  42931. var l = lab[0],
  42932. a = lab[1],
  42933. b = lab[2],
  42934. hr, h, c;
  42935. hr = Math.atan2(b, a);
  42936. h = hr * 360 / 2 / Math.PI;
  42937. if (h < 0) {
  42938. h += 360;
  42939. }
  42940. c = Math.sqrt(a * a + b * b);
  42941. return [l, c, h];
  42942. }
  42943. function lab2rgb(args) {
  42944. return xyz2rgb(lab2xyz(args));
  42945. }
  42946. function lch2lab(lch) {
  42947. var l = lch[0],
  42948. c = lch[1],
  42949. h = lch[2],
  42950. a, b, hr;
  42951. hr = h / 360 * 2 * Math.PI;
  42952. a = c * Math.cos(hr);
  42953. b = c * Math.sin(hr);
  42954. return [l, a, b];
  42955. }
  42956. function lch2xyz(args) {
  42957. return lab2xyz(lch2lab(args));
  42958. }
  42959. function lch2rgb(args) {
  42960. return lab2rgb(lch2lab(args));
  42961. }
  42962. function keyword2rgb(keyword) {
  42963. return cssKeywords[keyword];
  42964. }
  42965. function keyword2hsl(args) {
  42966. return rgb2hsl(keyword2rgb(args));
  42967. }
  42968. function keyword2hsv(args) {
  42969. return rgb2hsv(keyword2rgb(args));
  42970. }
  42971. function keyword2hwb(args) {
  42972. return rgb2hwb(keyword2rgb(args));
  42973. }
  42974. function keyword2cmyk(args) {
  42975. return rgb2cmyk(keyword2rgb(args));
  42976. }
  42977. function keyword2lab(args) {
  42978. return rgb2lab(keyword2rgb(args));
  42979. }
  42980. function keyword2xyz(args) {
  42981. return rgb2xyz(keyword2rgb(args));
  42982. }
  42983. var cssKeywords = {
  42984. aliceblue: [240,248,255],
  42985. antiquewhite: [250,235,215],
  42986. aqua: [0,255,255],
  42987. aquamarine: [127,255,212],
  42988. azure: [240,255,255],
  42989. beige: [245,245,220],
  42990. bisque: [255,228,196],
  42991. black: [0,0,0],
  42992. blanchedalmond: [255,235,205],
  42993. blue: [0,0,255],
  42994. blueviolet: [138,43,226],
  42995. brown: [165,42,42],
  42996. burlywood: [222,184,135],
  42997. cadetblue: [95,158,160],
  42998. chartreuse: [127,255,0],
  42999. chocolate: [210,105,30],
  43000. coral: [255,127,80],
  43001. cornflowerblue: [100,149,237],
  43002. cornsilk: [255,248,220],
  43003. crimson: [220,20,60],
  43004. cyan: [0,255,255],
  43005. darkblue: [0,0,139],
  43006. darkcyan: [0,139,139],
  43007. darkgoldenrod: [184,134,11],
  43008. darkgray: [169,169,169],
  43009. darkgreen: [0,100,0],
  43010. darkgrey: [169,169,169],
  43011. darkkhaki: [189,183,107],
  43012. darkmagenta: [139,0,139],
  43013. darkolivegreen: [85,107,47],
  43014. darkorange: [255,140,0],
  43015. darkorchid: [153,50,204],
  43016. darkred: [139,0,0],
  43017. darksalmon: [233,150,122],
  43018. darkseagreen: [143,188,143],
  43019. darkslateblue: [72,61,139],
  43020. darkslategray: [47,79,79],
  43021. darkslategrey: [47,79,79],
  43022. darkturquoise: [0,206,209],
  43023. darkviolet: [148,0,211],
  43024. deeppink: [255,20,147],
  43025. deepskyblue: [0,191,255],
  43026. dimgray: [105,105,105],
  43027. dimgrey: [105,105,105],
  43028. dodgerblue: [30,144,255],
  43029. firebrick: [178,34,34],
  43030. floralwhite: [255,250,240],
  43031. forestgreen: [34,139,34],
  43032. fuchsia: [255,0,255],
  43033. gainsboro: [220,220,220],
  43034. ghostwhite: [248,248,255],
  43035. gold: [255,215,0],
  43036. goldenrod: [218,165,32],
  43037. gray: [128,128,128],
  43038. green: [0,128,0],
  43039. greenyellow: [173,255,47],
  43040. grey: [128,128,128],
  43041. honeydew: [240,255,240],
  43042. hotpink: [255,105,180],
  43043. indianred: [205,92,92],
  43044. indigo: [75,0,130],
  43045. ivory: [255,255,240],
  43046. khaki: [240,230,140],
  43047. lavender: [230,230,250],
  43048. lavenderblush: [255,240,245],
  43049. lawngreen: [124,252,0],
  43050. lemonchiffon: [255,250,205],
  43051. lightblue: [173,216,230],
  43052. lightcoral: [240,128,128],
  43053. lightcyan: [224,255,255],
  43054. lightgoldenrodyellow: [250,250,210],
  43055. lightgray: [211,211,211],
  43056. lightgreen: [144,238,144],
  43057. lightgrey: [211,211,211],
  43058. lightpink: [255,182,193],
  43059. lightsalmon: [255,160,122],
  43060. lightseagreen: [32,178,170],
  43061. lightskyblue: [135,206,250],
  43062. lightslategray: [119,136,153],
  43063. lightslategrey: [119,136,153],
  43064. lightsteelblue: [176,196,222],
  43065. lightyellow: [255,255,224],
  43066. lime: [0,255,0],
  43067. limegreen: [50,205,50],
  43068. linen: [250,240,230],
  43069. magenta: [255,0,255],
  43070. maroon: [128,0,0],
  43071. mediumaquamarine: [102,205,170],
  43072. mediumblue: [0,0,205],
  43073. mediumorchid: [186,85,211],
  43074. mediumpurple: [147,112,219],
  43075. mediumseagreen: [60,179,113],
  43076. mediumslateblue: [123,104,238],
  43077. mediumspringgreen: [0,250,154],
  43078. mediumturquoise: [72,209,204],
  43079. mediumvioletred: [199,21,133],
  43080. midnightblue: [25,25,112],
  43081. mintcream: [245,255,250],
  43082. mistyrose: [255,228,225],
  43083. moccasin: [255,228,181],
  43084. navajowhite: [255,222,173],
  43085. navy: [0,0,128],
  43086. oldlace: [253,245,230],
  43087. olive: [128,128,0],
  43088. olivedrab: [107,142,35],
  43089. orange: [255,165,0],
  43090. orangered: [255,69,0],
  43091. orchid: [218,112,214],
  43092. palegoldenrod: [238,232,170],
  43093. palegreen: [152,251,152],
  43094. paleturquoise: [175,238,238],
  43095. palevioletred: [219,112,147],
  43096. papayawhip: [255,239,213],
  43097. peachpuff: [255,218,185],
  43098. peru: [205,133,63],
  43099. pink: [255,192,203],
  43100. plum: [221,160,221],
  43101. powderblue: [176,224,230],
  43102. purple: [128,0,128],
  43103. rebeccapurple: [102, 51, 153],
  43104. red: [255,0,0],
  43105. rosybrown: [188,143,143],
  43106. royalblue: [65,105,225],
  43107. saddlebrown: [139,69,19],
  43108. salmon: [250,128,114],
  43109. sandybrown: [244,164,96],
  43110. seagreen: [46,139,87],
  43111. seashell: [255,245,238],
  43112. sienna: [160,82,45],
  43113. silver: [192,192,192],
  43114. skyblue: [135,206,235],
  43115. slateblue: [106,90,205],
  43116. slategray: [112,128,144],
  43117. slategrey: [112,128,144],
  43118. snow: [255,250,250],
  43119. springgreen: [0,255,127],
  43120. steelblue: [70,130,180],
  43121. tan: [210,180,140],
  43122. teal: [0,128,128],
  43123. thistle: [216,191,216],
  43124. tomato: [255,99,71],
  43125. turquoise: [64,224,208],
  43126. violet: [238,130,238],
  43127. wheat: [245,222,179],
  43128. white: [255,255,255],
  43129. whitesmoke: [245,245,245],
  43130. yellow: [255,255,0],
  43131. yellowgreen: [154,205,50]
  43132. };
  43133. var reverseKeywords = {};
  43134. for (var key in cssKeywords) {
  43135. reverseKeywords[JSON.stringify(cssKeywords[key])] = key;
  43136. }
  43137. /***/ }),
  43138. /* 167 */
  43139. /***/ (function(module, exports, __webpack_require__) {
  43140. var conversions = __webpack_require__(166);
  43141. var convert = function() {
  43142. return new Converter();
  43143. }
  43144. for (var func in conversions) {
  43145. // export Raw versions
  43146. convert[func + "Raw"] = (function(func) {
  43147. // accept array or plain args
  43148. return function(arg) {
  43149. if (typeof arg == "number")
  43150. arg = Array.prototype.slice.call(arguments);
  43151. return conversions[func](arg);
  43152. }
  43153. })(func);
  43154. var pair = /(\w+)2(\w+)/.exec(func),
  43155. from = pair[1],
  43156. to = pair[2];
  43157. // export rgb2hsl and ["rgb"]["hsl"]
  43158. convert[from] = convert[from] || {};
  43159. convert[from][to] = convert[func] = (function(func) {
  43160. return function(arg) {
  43161. if (typeof arg == "number")
  43162. arg = Array.prototype.slice.call(arguments);
  43163. var val = conversions[func](arg);
  43164. if (typeof val == "string" || val === undefined)
  43165. return val; // keyword
  43166. for (var i = 0; i < val.length; i++)
  43167. val[i] = Math.round(val[i]);
  43168. return val;
  43169. }
  43170. })(func);
  43171. }
  43172. /* Converter does lazy conversion and caching */
  43173. var Converter = function() {
  43174. this.convs = {};
  43175. };
  43176. /* Either get the values for a space or
  43177. set the values for a space, depending on args */
  43178. Converter.prototype.routeSpace = function(space, args) {
  43179. var values = args[0];
  43180. if (values === undefined) {
  43181. // color.rgb()
  43182. return this.getValues(space);
  43183. }
  43184. // color.rgb(10, 10, 10)
  43185. if (typeof values == "number") {
  43186. values = Array.prototype.slice.call(args);
  43187. }
  43188. return this.setValues(space, values);
  43189. };
  43190. /* Set the values for a space, invalidating cache */
  43191. Converter.prototype.setValues = function(space, values) {
  43192. this.space = space;
  43193. this.convs = {};
  43194. this.convs[space] = values;
  43195. return this;
  43196. };
  43197. /* Get the values for a space. If there's already
  43198. a conversion for the space, fetch it, otherwise
  43199. compute it */
  43200. Converter.prototype.getValues = function(space) {
  43201. var vals = this.convs[space];
  43202. if (!vals) {
  43203. var fspace = this.space,
  43204. from = this.convs[fspace];
  43205. vals = convert[fspace][space](from);
  43206. this.convs[space] = vals;
  43207. }
  43208. return vals;
  43209. };
  43210. ["rgb", "hsl", "hsv", "cmyk", "keyword"].forEach(function(space) {
  43211. Converter.prototype[space] = function(vals) {
  43212. return this.routeSpace(space, arguments);
  43213. }
  43214. });
  43215. module.exports = convert;
  43216. /***/ }),
  43217. /* 168 */
  43218. /***/ (function(module, exports) {
  43219. module.exports = {
  43220. "aliceblue": [240, 248, 255],
  43221. "antiquewhite": [250, 235, 215],
  43222. "aqua": [0, 255, 255],
  43223. "aquamarine": [127, 255, 212],
  43224. "azure": [240, 255, 255],
  43225. "beige": [245, 245, 220],
  43226. "bisque": [255, 228, 196],
  43227. "black": [0, 0, 0],
  43228. "blanchedalmond": [255, 235, 205],
  43229. "blue": [0, 0, 255],
  43230. "blueviolet": [138, 43, 226],
  43231. "brown": [165, 42, 42],
  43232. "burlywood": [222, 184, 135],
  43233. "cadetblue": [95, 158, 160],
  43234. "chartreuse": [127, 255, 0],
  43235. "chocolate": [210, 105, 30],
  43236. "coral": [255, 127, 80],
  43237. "cornflowerblue": [100, 149, 237],
  43238. "cornsilk": [255, 248, 220],
  43239. "crimson": [220, 20, 60],
  43240. "cyan": [0, 255, 255],
  43241. "darkblue": [0, 0, 139],
  43242. "darkcyan": [0, 139, 139],
  43243. "darkgoldenrod": [184, 134, 11],
  43244. "darkgray": [169, 169, 169],
  43245. "darkgreen": [0, 100, 0],
  43246. "darkgrey": [169, 169, 169],
  43247. "darkkhaki": [189, 183, 107],
  43248. "darkmagenta": [139, 0, 139],
  43249. "darkolivegreen": [85, 107, 47],
  43250. "darkorange": [255, 140, 0],
  43251. "darkorchid": [153, 50, 204],
  43252. "darkred": [139, 0, 0],
  43253. "darksalmon": [233, 150, 122],
  43254. "darkseagreen": [143, 188, 143],
  43255. "darkslateblue": [72, 61, 139],
  43256. "darkslategray": [47, 79, 79],
  43257. "darkslategrey": [47, 79, 79],
  43258. "darkturquoise": [0, 206, 209],
  43259. "darkviolet": [148, 0, 211],
  43260. "deeppink": [255, 20, 147],
  43261. "deepskyblue": [0, 191, 255],
  43262. "dimgray": [105, 105, 105],
  43263. "dimgrey": [105, 105, 105],
  43264. "dodgerblue": [30, 144, 255],
  43265. "firebrick": [178, 34, 34],
  43266. "floralwhite": [255, 250, 240],
  43267. "forestgreen": [34, 139, 34],
  43268. "fuchsia": [255, 0, 255],
  43269. "gainsboro": [220, 220, 220],
  43270. "ghostwhite": [248, 248, 255],
  43271. "gold": [255, 215, 0],
  43272. "goldenrod": [218, 165, 32],
  43273. "gray": [128, 128, 128],
  43274. "green": [0, 128, 0],
  43275. "greenyellow": [173, 255, 47],
  43276. "grey": [128, 128, 128],
  43277. "honeydew": [240, 255, 240],
  43278. "hotpink": [255, 105, 180],
  43279. "indianred": [205, 92, 92],
  43280. "indigo": [75, 0, 130],
  43281. "ivory": [255, 255, 240],
  43282. "khaki": [240, 230, 140],
  43283. "lavender": [230, 230, 250],
  43284. "lavenderblush": [255, 240, 245],
  43285. "lawngreen": [124, 252, 0],
  43286. "lemonchiffon": [255, 250, 205],
  43287. "lightblue": [173, 216, 230],
  43288. "lightcoral": [240, 128, 128],
  43289. "lightcyan": [224, 255, 255],
  43290. "lightgoldenrodyellow": [250, 250, 210],
  43291. "lightgray": [211, 211, 211],
  43292. "lightgreen": [144, 238, 144],
  43293. "lightgrey": [211, 211, 211],
  43294. "lightpink": [255, 182, 193],
  43295. "lightsalmon": [255, 160, 122],
  43296. "lightseagreen": [32, 178, 170],
  43297. "lightskyblue": [135, 206, 250],
  43298. "lightslategray": [119, 136, 153],
  43299. "lightslategrey": [119, 136, 153],
  43300. "lightsteelblue": [176, 196, 222],
  43301. "lightyellow": [255, 255, 224],
  43302. "lime": [0, 255, 0],
  43303. "limegreen": [50, 205, 50],
  43304. "linen": [250, 240, 230],
  43305. "magenta": [255, 0, 255],
  43306. "maroon": [128, 0, 0],
  43307. "mediumaquamarine": [102, 205, 170],
  43308. "mediumblue": [0, 0, 205],
  43309. "mediumorchid": [186, 85, 211],
  43310. "mediumpurple": [147, 112, 219],
  43311. "mediumseagreen": [60, 179, 113],
  43312. "mediumslateblue": [123, 104, 238],
  43313. "mediumspringgreen": [0, 250, 154],
  43314. "mediumturquoise": [72, 209, 204],
  43315. "mediumvioletred": [199, 21, 133],
  43316. "midnightblue": [25, 25, 112],
  43317. "mintcream": [245, 255, 250],
  43318. "mistyrose": [255, 228, 225],
  43319. "moccasin": [255, 228, 181],
  43320. "navajowhite": [255, 222, 173],
  43321. "navy": [0, 0, 128],
  43322. "oldlace": [253, 245, 230],
  43323. "olive": [128, 128, 0],
  43324. "olivedrab": [107, 142, 35],
  43325. "orange": [255, 165, 0],
  43326. "orangered": [255, 69, 0],
  43327. "orchid": [218, 112, 214],
  43328. "palegoldenrod": [238, 232, 170],
  43329. "palegreen": [152, 251, 152],
  43330. "paleturquoise": [175, 238, 238],
  43331. "palevioletred": [219, 112, 147],
  43332. "papayawhip": [255, 239, 213],
  43333. "peachpuff": [255, 218, 185],
  43334. "peru": [205, 133, 63],
  43335. "pink": [255, 192, 203],
  43336. "plum": [221, 160, 221],
  43337. "powderblue": [176, 224, 230],
  43338. "purple": [128, 0, 128],
  43339. "rebeccapurple": [102, 51, 153],
  43340. "red": [255, 0, 0],
  43341. "rosybrown": [188, 143, 143],
  43342. "royalblue": [65, 105, 225],
  43343. "saddlebrown": [139, 69, 19],
  43344. "salmon": [250, 128, 114],
  43345. "sandybrown": [244, 164, 96],
  43346. "seagreen": [46, 139, 87],
  43347. "seashell": [255, 245, 238],
  43348. "sienna": [160, 82, 45],
  43349. "silver": [192, 192, 192],
  43350. "skyblue": [135, 206, 235],
  43351. "slateblue": [106, 90, 205],
  43352. "slategray": [112, 128, 144],
  43353. "slategrey": [112, 128, 144],
  43354. "snow": [255, 250, 250],
  43355. "springgreen": [0, 255, 127],
  43356. "steelblue": [70, 130, 180],
  43357. "tan": [210, 180, 140],
  43358. "teal": [0, 128, 128],
  43359. "thistle": [216, 191, 216],
  43360. "tomato": [255, 99, 71],
  43361. "turquoise": [64, 224, 208],
  43362. "violet": [238, 130, 238],
  43363. "wheat": [245, 222, 179],
  43364. "white": [255, 255, 255],
  43365. "whitesmoke": [245, 245, 245],
  43366. "yellow": [255, 255, 0],
  43367. "yellowgreen": [154, 205, 50]
  43368. };
  43369. /***/ }),
  43370. /* 169 */
  43371. /***/ (function(module, exports, __webpack_require__) {
  43372. exports = module.exports = __webpack_require__(170)();
  43373. // imports
  43374. // module
  43375. 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", ""]);
  43376. // exports
  43377. /***/ }),
  43378. /* 170 */
  43379. /***/ (function(module, exports) {
  43380. /*
  43381. MIT License http://www.opensource.org/licenses/mit-license.php
  43382. Author Tobias Koppers @sokra
  43383. */
  43384. // css base code, injected by the css-loader
  43385. module.exports = function() {
  43386. var list = [];
  43387. // return the list of modules as css string
  43388. list.toString = function toString() {
  43389. var result = [];
  43390. for(var i = 0; i < this.length; i++) {
  43391. var item = this[i];
  43392. if(item[2]) {
  43393. result.push("@media " + item[2] + "{" + item[1] + "}");
  43394. } else {
  43395. result.push(item[1]);
  43396. }
  43397. }
  43398. return result.join("");
  43399. };
  43400. // import a list of modules into the list
  43401. list.i = function(modules, mediaQuery) {
  43402. if(typeof modules === "string")
  43403. modules = [[null, modules, ""]];
  43404. var alreadyImportedModules = {};
  43405. for(var i = 0; i < this.length; i++) {
  43406. var id = this[i][0];
  43407. if(typeof id === "number")
  43408. alreadyImportedModules[id] = true;
  43409. }
  43410. for(i = 0; i < modules.length; i++) {
  43411. var item = modules[i];
  43412. // skip already imported module
  43413. // this implementation is not 100% perfect for weird media query combinations
  43414. // when a module is imported multiple times with different media queries.
  43415. // I hope this will never occur (Hey this way we have smaller bundles)
  43416. if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
  43417. if(mediaQuery && !item[2]) {
  43418. item[2] = mediaQuery;
  43419. } else if(mediaQuery) {
  43420. item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
  43421. }
  43422. list.push(item);
  43423. }
  43424. }
  43425. };
  43426. return list;
  43427. };
  43428. /***/ }),
  43429. /* 171 */
  43430. /***/ (function(module, exports, __webpack_require__) {
  43431. var map = {
  43432. "./af": 4,
  43433. "./af.js": 4,
  43434. "./ar": 10,
  43435. "./ar-dz": 5,
  43436. "./ar-dz.js": 5,
  43437. "./ar-ly": 6,
  43438. "./ar-ly.js": 6,
  43439. "./ar-ma": 7,
  43440. "./ar-ma.js": 7,
  43441. "./ar-sa": 8,
  43442. "./ar-sa.js": 8,
  43443. "./ar-tn": 9,
  43444. "./ar-tn.js": 9,
  43445. "./ar.js": 10,
  43446. "./az": 11,
  43447. "./az.js": 11,
  43448. "./be": 12,
  43449. "./be.js": 12,
  43450. "./bg": 13,
  43451. "./bg.js": 13,
  43452. "./bn": 14,
  43453. "./bn.js": 14,
  43454. "./bo": 15,
  43455. "./bo.js": 15,
  43456. "./br": 16,
  43457. "./br.js": 16,
  43458. "./bs": 17,
  43459. "./bs.js": 17,
  43460. "./ca": 18,
  43461. "./ca.js": 18,
  43462. "./cs": 19,
  43463. "./cs.js": 19,
  43464. "./cv": 20,
  43465. "./cv.js": 20,
  43466. "./cy": 21,
  43467. "./cy.js": 21,
  43468. "./da": 22,
  43469. "./da.js": 22,
  43470. "./de": 24,
  43471. "./de-at": 23,
  43472. "./de-at.js": 23,
  43473. "./de.js": 24,
  43474. "./dv": 25,
  43475. "./dv.js": 25,
  43476. "./el": 26,
  43477. "./el.js": 26,
  43478. "./en-au": 27,
  43479. "./en-au.js": 27,
  43480. "./en-ca": 28,
  43481. "./en-ca.js": 28,
  43482. "./en-gb": 29,
  43483. "./en-gb.js": 29,
  43484. "./en-ie": 30,
  43485. "./en-ie.js": 30,
  43486. "./en-nz": 31,
  43487. "./en-nz.js": 31,
  43488. "./eo": 32,
  43489. "./eo.js": 32,
  43490. "./es": 34,
  43491. "./es-do": 33,
  43492. "./es-do.js": 33,
  43493. "./es.js": 34,
  43494. "./et": 35,
  43495. "./et.js": 35,
  43496. "./eu": 36,
  43497. "./eu.js": 36,
  43498. "./fa": 37,
  43499. "./fa.js": 37,
  43500. "./fi": 38,
  43501. "./fi.js": 38,
  43502. "./fo": 39,
  43503. "./fo.js": 39,
  43504. "./fr": 42,
  43505. "./fr-ca": 40,
  43506. "./fr-ca.js": 40,
  43507. "./fr-ch": 41,
  43508. "./fr-ch.js": 41,
  43509. "./fr.js": 42,
  43510. "./fy": 43,
  43511. "./fy.js": 43,
  43512. "./gd": 44,
  43513. "./gd.js": 44,
  43514. "./gl": 45,
  43515. "./gl.js": 45,
  43516. "./he": 46,
  43517. "./he.js": 46,
  43518. "./hi": 47,
  43519. "./hi.js": 47,
  43520. "./hr": 48,
  43521. "./hr.js": 48,
  43522. "./hu": 49,
  43523. "./hu.js": 49,
  43524. "./hy-am": 50,
  43525. "./hy-am.js": 50,
  43526. "./id": 51,
  43527. "./id.js": 51,
  43528. "./is": 52,
  43529. "./is.js": 52,
  43530. "./it": 53,
  43531. "./it.js": 53,
  43532. "./ja": 54,
  43533. "./ja.js": 54,
  43534. "./jv": 55,
  43535. "./jv.js": 55,
  43536. "./ka": 56,
  43537. "./ka.js": 56,
  43538. "./kk": 57,
  43539. "./kk.js": 57,
  43540. "./km": 58,
  43541. "./km.js": 58,
  43542. "./ko": 59,
  43543. "./ko.js": 59,
  43544. "./ky": 60,
  43545. "./ky.js": 60,
  43546. "./lb": 61,
  43547. "./lb.js": 61,
  43548. "./lo": 62,
  43549. "./lo.js": 62,
  43550. "./lt": 63,
  43551. "./lt.js": 63,
  43552. "./lv": 64,
  43553. "./lv.js": 64,
  43554. "./me": 65,
  43555. "./me.js": 65,
  43556. "./mi": 66,
  43557. "./mi.js": 66,
  43558. "./mk": 67,
  43559. "./mk.js": 67,
  43560. "./ml": 68,
  43561. "./ml.js": 68,
  43562. "./mr": 69,
  43563. "./mr.js": 69,
  43564. "./ms": 71,
  43565. "./ms-my": 70,
  43566. "./ms-my.js": 70,
  43567. "./ms.js": 71,
  43568. "./my": 72,
  43569. "./my.js": 72,
  43570. "./nb": 73,
  43571. "./nb.js": 73,
  43572. "./ne": 74,
  43573. "./ne.js": 74,
  43574. "./nl": 76,
  43575. "./nl-be": 75,
  43576. "./nl-be.js": 75,
  43577. "./nl.js": 76,
  43578. "./nn": 77,
  43579. "./nn.js": 77,
  43580. "./pa-in": 78,
  43581. "./pa-in.js": 78,
  43582. "./pl": 79,
  43583. "./pl.js": 79,
  43584. "./pt": 81,
  43585. "./pt-br": 80,
  43586. "./pt-br.js": 80,
  43587. "./pt.js": 81,
  43588. "./ro": 82,
  43589. "./ro.js": 82,
  43590. "./ru": 83,
  43591. "./ru.js": 83,
  43592. "./se": 84,
  43593. "./se.js": 84,
  43594. "./si": 85,
  43595. "./si.js": 85,
  43596. "./sk": 86,
  43597. "./sk.js": 86,
  43598. "./sl": 87,
  43599. "./sl.js": 87,
  43600. "./sq": 88,
  43601. "./sq.js": 88,
  43602. "./sr": 90,
  43603. "./sr-cyrl": 89,
  43604. "./sr-cyrl.js": 89,
  43605. "./sr.js": 90,
  43606. "./ss": 91,
  43607. "./ss.js": 91,
  43608. "./sv": 92,
  43609. "./sv.js": 92,
  43610. "./sw": 93,
  43611. "./sw.js": 93,
  43612. "./ta": 94,
  43613. "./ta.js": 94,
  43614. "./te": 95,
  43615. "./te.js": 95,
  43616. "./tet": 96,
  43617. "./tet.js": 96,
  43618. "./th": 97,
  43619. "./th.js": 97,
  43620. "./tl-ph": 98,
  43621. "./tl-ph.js": 98,
  43622. "./tlh": 99,
  43623. "./tlh.js": 99,
  43624. "./tr": 100,
  43625. "./tr.js": 100,
  43626. "./tzl": 101,
  43627. "./tzl.js": 101,
  43628. "./tzm": 103,
  43629. "./tzm-latn": 102,
  43630. "./tzm-latn.js": 102,
  43631. "./tzm.js": 103,
  43632. "./uk": 104,
  43633. "./uk.js": 104,
  43634. "./uz": 105,
  43635. "./uz.js": 105,
  43636. "./vi": 106,
  43637. "./vi.js": 106,
  43638. "./x-pseudo": 107,
  43639. "./x-pseudo.js": 107,
  43640. "./yo": 108,
  43641. "./yo.js": 108,
  43642. "./zh-cn": 109,
  43643. "./zh-cn.js": 109,
  43644. "./zh-hk": 110,
  43645. "./zh-hk.js": 110,
  43646. "./zh-tw": 111,
  43647. "./zh-tw.js": 111
  43648. };
  43649. function webpackContext(req) {
  43650. return __webpack_require__(webpackContextResolve(req));
  43651. };
  43652. function webpackContextResolve(req) {
  43653. var id = map[req];
  43654. if(!(id + 1)) // check for number
  43655. throw new Error("Cannot find module '" + req + "'.");
  43656. return id;
  43657. };
  43658. webpackContext.keys = function webpackContextKeys() {
  43659. return Object.keys(map);
  43660. };
  43661. webpackContext.resolve = webpackContextResolve;
  43662. module.exports = webpackContext;
  43663. webpackContext.id = 171;
  43664. /***/ }),
  43665. /* 172 */
  43666. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43667. "use strict";
  43668. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  43669. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sweetalert2__ = __webpack_require__(3);
  43670. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_sweetalert2__);
  43671. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery__ = __webpack_require__(2);
  43672. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_jquery__);
  43673. //
  43674. //
  43675. //
  43676. //
  43677. //
  43678. //
  43679. //
  43680. //
  43681. //
  43682. //
  43683. //
  43684. //
  43685. //
  43686. //
  43687. //
  43688. //
  43689. //
  43690. //
  43691. //
  43692. //
  43693. //
  43694. //
  43695. /* harmony default export */ __webpack_exports__["default"] = {
  43696. props: {
  43697. server: {
  43698. type: Object,
  43699. default:function () {
  43700. return {
  43701. id:0,
  43702. name: "Name",
  43703. address: "Address",
  43704. players: 0,
  43705. maxPlayers: 0,
  43706. isPassword: false
  43707. };
  43708. }
  43709. },
  43710. update: {
  43711. type: Function
  43712. }
  43713. },
  43714. data: function () {
  43715. return {};
  43716. },
  43717. methods: {
  43718. remove: function (id) {
  43719. var self = this;
  43720. __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default()({
  43721. title: 'Are you sure?',
  43722. text: "You won't be able to revert this!",
  43723. type: 'warning',
  43724. showCancelButton: true,
  43725. confirmButtonColor: '#3085d6',
  43726. cancelButtonColor: '#d33',
  43727. confirmButtonText: 'Yes, delete it!'
  43728. }).then(function () {
  43729. var req = new XMLHttpRequest();
  43730. req.open('GET', '/api/servers/remove/'+ id);
  43731. req.send(null);
  43732. req.onreadystatechange = function () {
  43733. if (req.readyState == XMLHttpRequest.DONE &&
  43734. req.status === 200) {
  43735. self.update();
  43736. var el = __WEBPACK_IMPORTED_MODULE_1_jquery___default()(self.$el);
  43737. el.css("opacity", 0.5);
  43738. var actions = el.find("#actions");
  43739. actions.children().hide();
  43740. actions.append('<img src="svg/loading.svg"></img>');
  43741. }
  43742. };
  43743. }, function () {
  43744. }).catch(console.log);
  43745. }
  43746. }
  43747. };
  43748. /***/ }),
  43749. /* 173 */
  43750. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43751. "use strict";
  43752. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  43753. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sweetalert2__ = __webpack_require__(3);
  43754. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_sweetalert2__);
  43755. //
  43756. //
  43757. //
  43758. //
  43759. //
  43760. //
  43761. //
  43762. //
  43763. //
  43764. //
  43765. //
  43766. //
  43767. //
  43768. //
  43769. //
  43770. //
  43771. //
  43772. //
  43773. //
  43774. //
  43775. //
  43776. //
  43777. //
  43778. //
  43779. //
  43780. //
  43781. //
  43782. //
  43783. //
  43784. //
  43785. //
  43786. //
  43787. //
  43788. //
  43789. //
  43790. //
  43791. //
  43792. //
  43793. //
  43794. /* harmony default export */ __webpack_exports__["default"] = {
  43795. created: function () {
  43796. this.update();
  43797. },
  43798. data: function () {
  43799. return {
  43800. details: {
  43801. traffic: {
  43802. }
  43803. },
  43804. server: {}
  43805. }
  43806. },
  43807. watch: {
  43808. "$root.servers": function () {
  43809. this.server = this.$root.servers[parseInt(this.$root.serversId[this.$route.params.id])];
  43810. }
  43811. },
  43812. methods: {
  43813. update: function () {
  43814. if(this.$root.servers.length !== 0 && this.$root.serversId){
  43815. this.server = this.$root.servers[parseInt(this.$root.serversId[this.$route.params.id])];
  43816. }
  43817. var self = this;
  43818. var req = new XMLHttpRequest();
  43819. req.open('GET', '/api/servers/get/'+this.$route.params.id);
  43820. req.send(null);
  43821. req.onreadystatechange = function () {
  43822. if (req.readyState == XMLHttpRequest.DONE &&
  43823. req.status === 200) {
  43824. self.details = JSON.parse(req.response);
  43825. }
  43826. };
  43827. },
  43828. remove: function (id) {
  43829. var self = this;
  43830. __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default()({
  43831. title: 'Are you sure?',
  43832. text: "You won't be able to revert this!",
  43833. type: 'warning',
  43834. showCancelButton: true,
  43835. confirmButtonColor: '#3085d6',
  43836. cancelButtonColor: '#d33',
  43837. confirmButtonText: 'Yes, delete it!'
  43838. }).then(function () {
  43839. var req = new XMLHttpRequest();
  43840. req.open('GET', '/api/servers/remove/'+ id);
  43841. req.send(null);
  43842. req.onreadystatechange = function () {
  43843. if (req.readyState == XMLHttpRequest.DONE &&
  43844. req.status === 200) {
  43845. }
  43846. };
  43847. self.$router.push("/");
  43848. }, function () {
  43849. }).catch(console.log);
  43850. }
  43851. }
  43852. };
  43853. /***/ }),
  43854. /* 174 */
  43855. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43856. "use strict";
  43857. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  43858. //
  43859. //
  43860. //
  43861. //
  43862. //
  43863. //
  43864. //
  43865. //
  43866. //
  43867. //
  43868. //
  43869. //
  43870. //
  43871. //
  43872. //
  43873. //
  43874. //
  43875. //
  43876. //
  43877. //
  43878. //
  43879. /* harmony default export */ __webpack_exports__["default"] = {
  43880. created: function () {
  43881. this.servers = this.$root.servers;
  43882. this.update();
  43883. },
  43884. watch: {
  43885. "$root.servers": function (val, old) {
  43886. this.servers = val;
  43887. }
  43888. },
  43889. data: function () {
  43890. return {
  43891. servers: [],
  43892. serversId: {}
  43893. }
  43894. },
  43895. methods: {
  43896. update: function () {
  43897. var self = this;
  43898. var req = new XMLHttpRequest();
  43899. req.open('GET', '/api/details');
  43900. req.send(null);
  43901. req.onreadystatechange = function () {
  43902. if (req.readyState == XMLHttpRequest.DONE &&
  43903. req.status === 200) {
  43904. self.servers = JSON.parse(req.response);
  43905. var a;
  43906. self.$root.servers = self.servers;
  43907. self.$root.serversId = {};
  43908. for (a in self.servers) {
  43909. if (!self.servers.hasOwnProperty(a)) {
  43910. continue;
  43911. }
  43912. var obj = self.servers[a];
  43913. self.$root.serversId[obj.id] = a;
  43914. }
  43915. }
  43916. };
  43917. }
  43918. }
  43919. };
  43920. /***/ }),
  43921. /* 175 */
  43922. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43923. "use strict";
  43924. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  43925. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sweetalert2__ = __webpack_require__(3);
  43926. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_sweetalert2__);
  43927. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery__ = __webpack_require__(2);
  43928. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_jquery__);
  43929. //
  43930. //
  43931. //
  43932. //
  43933. //
  43934. //
  43935. //
  43936. //
  43937. //
  43938. //
  43939. //
  43940. //
  43941. //
  43942. //
  43943. //
  43944. //
  43945. //
  43946. //
  43947. //
  43948. //
  43949. //
  43950. //
  43951. //
  43952. //
  43953. //
  43954. /* harmony default export */ __webpack_exports__["default"] = {
  43955. mounted: function () {
  43956. this.request();
  43957. },
  43958. props: {
  43959. server: {
  43960. type: Object,
  43961. default:function () {
  43962. return {
  43963. id:0,
  43964. name: "Name",
  43965. address: "Address",
  43966. players: 0,
  43967. maxPlayers: 0,
  43968. isPassword: false
  43969. };
  43970. }
  43971. },
  43972. update: {
  43973. type: Function
  43974. },
  43975. onSubmit: {
  43976. type: Function,
  43977. default: function () {
  43978. }
  43979. },
  43980. buttonText: {
  43981. type: String,
  43982. default: function () {
  43983. return "Add";
  43984. }
  43985. }
  43986. },
  43987. data: function () {
  43988. return {};
  43989. },
  43990. methods: {
  43991. request: function () {
  43992. var self = this;
  43993. var form = __WEBPACK_IMPORTED_MODULE_1_jquery___default()(this.$el);
  43994. form.submit(function(e){
  43995. e.preventDefault();
  43996. // Validation
  43997. var ar = form.serializeArray();
  43998. var flags = {
  43999. name: 0,
  44000. type: 0,
  44001. address: 0
  44002. }
  44003. ar.forEach(function (obj) {
  44004. if(!obj.value){
  44005. flags[obj.name] = 1;
  44006. }
  44007. });
  44008. var wrong = false;
  44009. for (var name in flags) {
  44010. var el = __WEBPACK_IMPORTED_MODULE_1_jquery___default()('[name="'+name+'"]')
  44011. if (!flags.hasOwnProperty(name)) {
  44012. continue;
  44013. }
  44014. if(flags[name]){
  44015. wrong = true;
  44016. el.addClass("form-control-danger");
  44017. el.parent().addClass("has-danger");
  44018. }else{
  44019. el.removeClass("form-control-danger");
  44020. el.parent().removeClass("has-danger")
  44021. }
  44022. }
  44023. if(wrong){
  44024. __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default()({
  44025. titleText: "Wrong input",
  44026. text:"Provide all data about server",
  44027. type:"error"
  44028. });
  44029. return;
  44030. }
  44031. // Request
  44032. var req_add = new XMLHttpRequest();
  44033. req_add.open('POST', '/api/servers/add');
  44034. req_add.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  44035. req_add.onreadystatechange = function () {
  44036. if (req_add.readyState == XMLHttpRequest.DONE &&
  44037. req_add.status === 200) {
  44038. self.$router.push("/");
  44039. form.find("input, select").val("");
  44040. self.onSubmit();
  44041. }
  44042. };
  44043. req_add.send(form.serialize());
  44044. });
  44045. }
  44046. }
  44047. };
  44048. /***/ }),
  44049. /* 176 */
  44050. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44051. "use strict";
  44052. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  44053. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_chart_js__ = __webpack_require__(122);
  44054. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_chart_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_chart_js__);
  44055. //
  44056. //
  44057. //
  44058. var generateTemplate = function(){
  44059. var rand = function(){
  44060. return Math.floor(Math.random()*256);
  44061. }
  44062. var color = "rgba("+rand()+","+rand()+","+rand()+",0.1)";
  44063. // console.log(color);
  44064. return {
  44065. label: "Traffic",
  44066. fill: true,
  44067. lineTension: 0.1,
  44068. backgroundColor: "rgba(75,192,192,0.4)",
  44069. borderColor: color,
  44070. borderCapStyle: 'butt',
  44071. borderDash: [],
  44072. borderDashOffset: 0.0,
  44073. borderJoinStyle: 'miter',
  44074. pointBorderColor: color, //"rgba(75,192,192,1)",
  44075. pointBackgroundColor: "#fff",
  44076. // pointBorderWidth: 1,
  44077. // pointHoverRadius: 5,
  44078. // pointHoverBackgroundColor: "rgba(75,192,192,1)",
  44079. // pointHoverBorderColor: "rgba(220,220,220,1)",
  44080. // pointHoverBorderWidth: 2,
  44081. pointRadius: 1,
  44082. pointHitRadius: 10,
  44083. data: [],
  44084. spanGaps: true,
  44085. };
  44086. };
  44087. /* harmony default export */ __webpack_exports__["default"] = {
  44088. created: function () {
  44089. this.updateData();
  44090. },
  44091. mounted: function () {
  44092. //this.update();
  44093. },
  44094. props: {
  44095. server: {
  44096. type: Number,
  44097. default:-1
  44098. },
  44099. maxplayers: {
  44100. type: Number,
  44101. default:-1
  44102. }
  44103. },
  44104. data: function () {
  44105. return {
  44106. // datasetTempalte:{
  44107. // label: "Traffic",
  44108. // fill: true,
  44109. // // lineTension: 0.1,
  44110. // // backgroundColor: "rgba(75,192,192,0.4)",
  44111. // // borderColor: "rgba(75,192,192,1)",
  44112. // // borderCapStyle: 'butt',
  44113. // // borderDash: [],
  44114. // // borderDashOffset: 0.0,
  44115. // // borderJoinStyle: 'miter',
  44116. // // pointBorderColor: "rgba(75,192,192,1)",
  44117. // // pointBackgroundColor: "#fff",
  44118. // // pointBorderWidth: 1,
  44119. // // pointHoverRadius: 5,
  44120. // // pointHoverBackgroundColor: "rgba(75,192,192,1)",
  44121. // // pointHoverBorderColor: "rgba(220,220,220,1)",
  44122. // // pointHoverBorderWidth: 2,
  44123. // // pointRadius: 1,
  44124. // // pointHitRadius: 10,
  44125. // data: [],
  44126. // // spanGaps: false,
  44127. // },
  44128. }
  44129. },
  44130. methods: {
  44131. update: function () {
  44132. this.params = {
  44133. type: 'line',
  44134. data: this.graphdata,
  44135. options: {
  44136. responsive: true,
  44137. legend:{
  44138. display: false
  44139. },
  44140. scales: {
  44141. yAxes: [{
  44142. ticks: {
  44143. beginAtZero:true
  44144. }
  44145. }],
  44146. xAxes: [{
  44147. display: true,
  44148. type: 'linear',
  44149. position: 'bottom'
  44150. }]
  44151. }
  44152. }
  44153. };
  44154. if(this.maxplayers > 0){
  44155. this.params.options.scales.yAxes[0].ticks.max = parseInt(this.maxplayers);
  44156. }else if(this.$root.servers[parseInt(this.$root.serversId[this.$route.params.id])].maxPlayers){
  44157. this.params.options.scales.yAxes[0].ticks.max = this.$root.servers[parseInt(this.$root.serversId[this.$route.params.id])].maxPlayers;
  44158. }
  44159. // console.log(this.$root.servers[parseInt(this.$root.serversId[this.$route.params.id])]);
  44160. // console.log(this.$root);
  44161. // console.log("Params ", this.params);
  44162. // console.log(JSON.stringify(this.params));
  44163. this.chart = new __WEBPACK_IMPORTED_MODULE_0_chart_js___default.a(this.$el, this.params);
  44164. },
  44165. updateData: function () {
  44166. this.graphdata = {
  44167. labels: [],
  44168. datasets: [
  44169. {
  44170. label: "Traffic",
  44171. data: null
  44172. }
  44173. ]
  44174. };
  44175. if(this.server === -1){
  44176. return -1;
  44177. }
  44178. var self = this;
  44179. var req = new XMLHttpRequest();
  44180. var date = new Date();
  44181. var year = date.getUTCFullYear();
  44182. var month = date.getUTCMonth() + 1;
  44183. var day = date.getUTCDate();
  44184. var url = '/api/trafic/';
  44185. url += this.server;
  44186. url += "/";
  44187. url += day;
  44188. url += "/";
  44189. url += month;
  44190. url += "/";
  44191. url += year;
  44192. url += "/day";
  44193. // console.log(url);
  44194. req.open('GET', url);
  44195. req.onreadystatechange = function () {
  44196. if (req.readyState == XMLHttpRequest.DONE &&
  44197. req.status === 200) {
  44198. var obj = JSON.parse(req.response);
  44199. self.graphdata.datasets[0].data = [];
  44200. self.graphdata.datasets = [];
  44201. var firstStamp = new Date(obj[0].createdAt);
  44202. var dataset = {
  44203. label: "Traffic",
  44204. data: []
  44205. };
  44206. // console.log(dataset);
  44207. dataset = Object.assign({}, generateTemplate(), dataset)
  44208. var lastStamp = firstStamp/1000;
  44209. var gap = firstStamp/1000 - new Date(obj[1].createdAt)/1000;
  44210. gap = Math.abs(Math.floor(gap));
  44211. obj.forEach(function (el) {
  44212. var stamp = new Date(el.createdAt) - firstStamp;
  44213. stamp /= 1000;
  44214. // console.log("Gap: ", gap);
  44215. // console.log("Stamp: ", stamp);
  44216. // console.log("lastStamp: ", lastStamp);
  44217. // console.log(stamp-lastStamp);
  44218. if(stamp-lastStamp > 2*gap){
  44219. // console.log("Dataset ", dataset);
  44220. self.graphdata.datasets.push(dataset);
  44221. dataset = {
  44222. label: "Traffic",
  44223. data: []
  44224. };
  44225. dataset = Object.assign({}, generateTemplate(), dataset)
  44226. }
  44227. lastStamp = stamp;
  44228. stamp /= 60;
  44229. stamp = Math.floor(stamp);
  44230. dataset.data.push({
  44231. x: stamp,
  44232. y: el.players
  44233. });
  44234. // self.graphdata.datasets[0].data.push({
  44235. // x: stamp,
  44236. // y: el.players
  44237. // });
  44238. self.graphdata.labels.push(new Date(el.createdAt).toLocaleTimeString());
  44239. });
  44240. // console.log("Dataset ", dataset);
  44241. // self.graphdata.datasets.push(dataset);
  44242. self.graphdata.datasets.push(dataset);
  44243. self.graphdata = JSON.parse(JSON.stringify(self.graphdata));
  44244. // console.log("Graphdata ", self.graphdata);
  44245. self.update();
  44246. }
  44247. };
  44248. req.send(null);
  44249. }
  44250. }
  44251. };
  44252. /***/ }),
  44253. /* 177 */
  44254. /***/ (function(module, exports, __webpack_require__) {
  44255. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44256. return _c('div', {
  44257. staticClass: "container no-gutters"
  44258. }, [_c('div', {
  44259. staticClass: "row"
  44260. }, [_c('h1', [_vm._v(_vm._s(_vm.server.name) + " "), _c('small', {
  44261. staticClass: "text-muted"
  44262. }, [_vm._v(_vm._s(_vm.details.name))])])]), _vm._v(" "), _c('div', {
  44263. staticClass: "row"
  44264. }, [_c('div', {
  44265. staticClass: "col-5"
  44266. }, [_c('ul', {
  44267. staticClass: "list-unstyled"
  44268. }, [(_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', {
  44269. staticClass: "col-5"
  44270. }, [(_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', {
  44271. staticClass: "list-group"
  44272. }, _vm._l((_vm.details.players), function(player) {
  44273. return _c('li', {
  44274. staticClass: "list-group-item"
  44275. }, [_vm._v(_vm._s(player.name))])
  44276. })) : _vm._e()]), _vm._v(" "), _c('div', {
  44277. staticClass: "col-2"
  44278. }, [_c('button', {
  44279. staticClass: "btn btn-danger",
  44280. attrs: {
  44281. "type": "button"
  44282. },
  44283. on: {
  44284. "click": function($event) {
  44285. _vm.remove(_vm.$route.params.id)
  44286. }
  44287. }
  44288. }, [_vm._v("Remove")])])]), _vm._v(" "), _c('div', {
  44289. staticClass: "row"
  44290. }, [_c('servergraph', {
  44291. attrs: {
  44292. "server": parseInt(_vm.$route.params.id),
  44293. "maxplayers": _vm.server.maxPlayers
  44294. }
  44295. })], 1)])
  44296. },staticRenderFns: []}
  44297. module.exports.render._withStripped = true
  44298. if (false) {
  44299. module.hot.accept()
  44300. if (module.hot.data) {
  44301. require("vue-hot-reload-api").rerender("data-v-04a2f200", module.exports)
  44302. }
  44303. }
  44304. /***/ }),
  44305. /* 178 */
  44306. /***/ (function(module, exports, __webpack_require__) {
  44307. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44308. return _c('div', {
  44309. staticClass: "row"
  44310. }, [_c('div', {
  44311. staticClass: "col-4"
  44312. }, [_c('div', {
  44313. attrs: {
  44314. "id": "actions"
  44315. }
  44316. }, [_c('a', {
  44317. on: {
  44318. "click": function($event) {
  44319. _vm.remove(_vm.server.id)
  44320. }
  44321. }
  44322. }, [_c('img', {
  44323. attrs: {
  44324. "src": "svg/x.svg"
  44325. }
  44326. })]), _vm._v(" "), _vm._m(0)]), _vm._v(" "), _c('router-link', {
  44327. attrs: {
  44328. "server": _vm.server,
  44329. "to": {
  44330. path: '/server/' + _vm.server.id
  44331. }
  44332. }
  44333. }, [_vm._v("\n " + _vm._s(_vm.server.name) + " "), _c('img', {
  44334. directives: [{
  44335. name: "show",
  44336. rawName: "v-show",
  44337. value: (_vm.server.isPassword),
  44338. expression: "server.isPassword"
  44339. }],
  44340. staticClass: "icon",
  44341. attrs: {
  44342. "src": "svg/lock.svg"
  44343. }
  44344. })])], 1), _vm._v(" "), _c('div', {
  44345. staticClass: "col-3"
  44346. }, [_vm._v("\n " + _vm._s(_vm.server.fullType) + "\n ")]), _vm._v(" "), _c('div', {
  44347. staticClass: "col-3"
  44348. }, [_vm._v("\n " + _vm._s(_vm.server.address) + "\n ")]), _vm._v(" "), _c('div', {
  44349. staticClass: "col-2"
  44350. }, [_vm._v("\n " + _vm._s(_vm.server.players) + "/" + _vm._s(_vm.server.maxPlayers) + "\n ")])])
  44351. },staticRenderFns: [function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44352. return _c('a', [_c('img', {
  44353. attrs: {
  44354. "src": "svg/pencil.svg"
  44355. }
  44356. })])
  44357. }]}
  44358. module.exports.render._withStripped = true
  44359. if (false) {
  44360. module.hot.accept()
  44361. if (module.hot.data) {
  44362. require("vue-hot-reload-api").rerender("data-v-49b001dc", module.exports)
  44363. }
  44364. }
  44365. /***/ }),
  44366. /* 179 */
  44367. /***/ (function(module, exports, __webpack_require__) {
  44368. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44369. return _c('div', {
  44370. staticClass: "container no-gutters",
  44371. attrs: {
  44372. "id": "serverList"
  44373. }
  44374. }, [_vm._m(0), _vm._v(" "), _vm._l((_vm.servers), function(server) {
  44375. return _c('server', {
  44376. attrs: {
  44377. "server": server,
  44378. "update": _vm.update
  44379. }
  44380. })
  44381. }), _vm._v(" "), _c('serveredit', {
  44382. attrs: {
  44383. "update": _vm.update,
  44384. "onSubmit": _vm.update
  44385. }
  44386. })], 2)
  44387. },staticRenderFns: [function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44388. return _c('div', {
  44389. staticClass: "row",
  44390. attrs: {
  44391. "id": "titles"
  44392. }
  44393. }, [_c('div', {
  44394. staticClass: "col-4"
  44395. }, [_vm._v("\n Server name\n ")]), _vm._v(" "), _c('div', {
  44396. staticClass: "col-3"
  44397. }, [_vm._v("\n Server Type\n ")]), _vm._v(" "), _c('div', {
  44398. staticClass: "col-3"
  44399. }, [_vm._v("\n Address\n ")]), _vm._v(" "), _c('div', {
  44400. staticClass: "col-2"
  44401. }, [_vm._v("\n Players\n ")])])
  44402. }]}
  44403. module.exports.render._withStripped = true
  44404. if (false) {
  44405. module.hot.accept()
  44406. if (module.hot.data) {
  44407. require("vue-hot-reload-api").rerender("data-v-7440c7d0", module.exports)
  44408. }
  44409. }
  44410. /***/ }),
  44411. /* 180 */
  44412. /***/ (function(module, exports, __webpack_require__) {
  44413. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44414. return _c('form', {
  44415. attrs: {
  44416. "action": "/api/servers/add",
  44417. "method": "post"
  44418. }
  44419. }, [_c('div', {
  44420. staticClass: "row editor form-group"
  44421. }, [_vm._m(0), _vm._v(" "), _c('div', {
  44422. staticClass: "col-3"
  44423. }, [_c('select', {
  44424. staticClass: "form-control",
  44425. attrs: {
  44426. "name": "type"
  44427. }
  44428. }, [_c('option', {
  44429. attrs: {
  44430. "value": ""
  44431. }
  44432. }, [_vm._v("Server type")]), _vm._v(" "), _vm._l((_vm.$root.types), function(option, key) {
  44433. return _c('option', {
  44434. domProps: {
  44435. "value": option
  44436. }
  44437. }, [_vm._v("\n " + _vm._s(key) + "\n ")])
  44438. })], 2)]), _vm._v(" "), _vm._m(1), _vm._v(" "), _c('div', {
  44439. staticClass: "col-2"
  44440. }, [_c('button', {
  44441. staticClass: "btn btn-primary",
  44442. attrs: {
  44443. "type": "submit"
  44444. }
  44445. }, [_vm._v(_vm._s(_vm.buttonText))])])])])
  44446. },staticRenderFns: [function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44447. return _c('div', {
  44448. staticClass: "col-4"
  44449. }, [_c('input', {
  44450. staticClass: "form-control",
  44451. attrs: {
  44452. "placeholder": "Name",
  44453. "name": "name"
  44454. }
  44455. })])
  44456. },function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44457. return _c('div', {
  44458. staticClass: "col-3"
  44459. }, [_c('input', {
  44460. staticClass: "form-control",
  44461. attrs: {
  44462. "placeholder": "Address",
  44463. "name": "address"
  44464. }
  44465. })])
  44466. }]}
  44467. module.exports.render._withStripped = true
  44468. if (false) {
  44469. module.hot.accept()
  44470. if (module.hot.data) {
  44471. require("vue-hot-reload-api").rerender("data-v-7fae8b1c", module.exports)
  44472. }
  44473. }
  44474. /***/ }),
  44475. /* 181 */
  44476. /***/ (function(module, exports, __webpack_require__) {
  44477. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44478. return _c('canvas', {
  44479. attrs: {
  44480. "id": "graph"
  44481. }
  44482. })
  44483. },staticRenderFns: []}
  44484. module.exports.render._withStripped = true
  44485. if (false) {
  44486. module.hot.accept()
  44487. if (module.hot.data) {
  44488. require("vue-hot-reload-api").rerender("data-v-bbf0e6a8", module.exports)
  44489. }
  44490. }
  44491. /***/ }),
  44492. /* 182 */
  44493. /***/ (function(module, exports, __webpack_require__) {
  44494. // style-loader: Adds some css to the DOM by adding a <style> tag
  44495. // load the styles
  44496. var content = __webpack_require__(169);
  44497. if(typeof content === 'string') content = [[module.i, content, '']];
  44498. if(content.locals) module.exports = content.locals;
  44499. // add the styles to the DOM
  44500. var update = __webpack_require__(183)("2b78970d", content, false);
  44501. // Hot Module Replacement
  44502. if(false) {
  44503. // When the styles change, update the <style> tags
  44504. if(!content.locals) {
  44505. module.hot.accept("!!./../node_modules/css-loader/index.js!./../node_modules/vue-loader/lib/style-rewriter.js?{\"id\":\"data-v-7440c7d0\",\"scoped\":false,\"hasInlineConfig\":false}!./../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./serverList.vue", function() {
  44506. var newContent = require("!!./../node_modules/css-loader/index.js!./../node_modules/vue-loader/lib/style-rewriter.js?{\"id\":\"data-v-7440c7d0\",\"scoped\":false,\"hasInlineConfig\":false}!./../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./serverList.vue");
  44507. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  44508. update(newContent);
  44509. });
  44510. }
  44511. // When the module is disposed, remove the <style> tags
  44512. module.hot.dispose(function() { update(); });
  44513. }
  44514. /***/ }),
  44515. /* 183 */
  44516. /***/ (function(module, exports, __webpack_require__) {
  44517. /*
  44518. MIT License http://www.opensource.org/licenses/mit-license.php
  44519. Author Tobias Koppers @sokra
  44520. Modified by Evan You @yyx990803
  44521. */
  44522. var hasDocument = typeof document !== 'undefined'
  44523. if (typeof DEBUG !== 'undefined' && DEBUG) {
  44524. if (!hasDocument) {
  44525. throw new Error(
  44526. 'vue-style-loader cannot be used in a non-browser environment. ' +
  44527. "Use { target: 'node' } in your Webpack config to indicate a server-rendering environment."
  44528. ) }
  44529. }
  44530. var listToStyles = __webpack_require__(184)
  44531. /*
  44532. type StyleObject = {
  44533. id: number;
  44534. parts: Array<StyleObjectPart>
  44535. }
  44536. type StyleObjectPart = {
  44537. css: string;
  44538. media: string;
  44539. sourceMap: ?string
  44540. }
  44541. */
  44542. var stylesInDom = {/*
  44543. [id: number]: {
  44544. id: number,
  44545. refs: number,
  44546. parts: Array<(obj?: StyleObjectPart) => void>
  44547. }
  44548. */}
  44549. var head = hasDocument && (document.head || document.getElementsByTagName('head')[0])
  44550. var singletonElement = null
  44551. var singletonCounter = 0
  44552. var isProduction = false
  44553. var noop = function () {}
  44554. // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  44555. // tags it will allow on a page
  44556. var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\b/.test(navigator.userAgent.toLowerCase())
  44557. module.exports = function (parentId, list, _isProduction) {
  44558. isProduction = _isProduction
  44559. var styles = listToStyles(parentId, list)
  44560. addStylesToDom(styles)
  44561. return function update (newList) {
  44562. var mayRemove = []
  44563. for (var i = 0; i < styles.length; i++) {
  44564. var item = styles[i]
  44565. var domStyle = stylesInDom[item.id]
  44566. domStyle.refs--
  44567. mayRemove.push(domStyle)
  44568. }
  44569. if (newList) {
  44570. styles = listToStyles(parentId, newList)
  44571. addStylesToDom(styles)
  44572. } else {
  44573. styles = []
  44574. }
  44575. for (var i = 0; i < mayRemove.length; i++) {
  44576. var domStyle = mayRemove[i]
  44577. if (domStyle.refs === 0) {
  44578. for (var j = 0; j < domStyle.parts.length; j++) {
  44579. domStyle.parts[j]()
  44580. }
  44581. delete stylesInDom[domStyle.id]
  44582. }
  44583. }
  44584. }
  44585. }
  44586. function addStylesToDom (styles /* Array<StyleObject> */) {
  44587. for (var i = 0; i < styles.length; i++) {
  44588. var item = styles[i]
  44589. var domStyle = stylesInDom[item.id]
  44590. if (domStyle) {
  44591. domStyle.refs++
  44592. for (var j = 0; j < domStyle.parts.length; j++) {
  44593. domStyle.parts[j](item.parts[j])
  44594. }
  44595. for (; j < item.parts.length; j++) {
  44596. domStyle.parts.push(addStyle(item.parts[j]))
  44597. }
  44598. if (domStyle.parts.length > item.parts.length) {
  44599. domStyle.parts.length = item.parts.length
  44600. }
  44601. } else {
  44602. var parts = []
  44603. for (var j = 0; j < item.parts.length; j++) {
  44604. parts.push(addStyle(item.parts[j]))
  44605. }
  44606. stylesInDom[item.id] = { id: item.id, refs: 1, parts: parts }
  44607. }
  44608. }
  44609. }
  44610. function listToStyles (parentId, list) {
  44611. var styles = []
  44612. var newStyles = {}
  44613. for (var i = 0; i < list.length; i++) {
  44614. var item = list[i]
  44615. var id = item[0]
  44616. var css = item[1]
  44617. var media = item[2]
  44618. var sourceMap = item[3]
  44619. var part = { css: css, media: media, sourceMap: sourceMap }
  44620. if (!newStyles[id]) {
  44621. part.id = parentId + ':0'
  44622. styles.push(newStyles[id] = { id: id, parts: [part] })
  44623. } else {
  44624. part.id = parentId + ':' + newStyles[id].parts.length
  44625. newStyles[id].parts.push(part)
  44626. }
  44627. }
  44628. return styles
  44629. }
  44630. function createStyleElement () {
  44631. var styleElement = document.createElement('style')
  44632. styleElement.type = 'text/css'
  44633. head.appendChild(styleElement)
  44634. return styleElement
  44635. }
  44636. function addStyle (obj /* StyleObjectPart */) {
  44637. var update, remove
  44638. var styleElement = document.querySelector('style[data-vue-ssr-id~="' + obj.id + '"]')
  44639. var hasSSR = styleElement != null
  44640. // if in production mode and style is already provided by SSR,
  44641. // simply do nothing.
  44642. if (hasSSR && isProduction) {
  44643. return noop
  44644. }
  44645. if (isOldIE) {
  44646. // use singleton mode for IE9.
  44647. var styleIndex = singletonCounter++
  44648. styleElement = singletonElement || (singletonElement = createStyleElement())
  44649. update = applyToSingletonTag.bind(null, styleElement, styleIndex, false)
  44650. remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true)
  44651. } else {
  44652. // use multi-style-tag mode in all other cases
  44653. styleElement = styleElement || createStyleElement()
  44654. update = applyToTag.bind(null, styleElement)
  44655. remove = function () {
  44656. styleElement.parentNode.removeChild(styleElement)
  44657. }
  44658. }
  44659. if (!hasSSR) {
  44660. update(obj)
  44661. }
  44662. return function updateStyle (newObj /* StyleObjectPart */) {
  44663. if (newObj) {
  44664. if (newObj.css === obj.css &&
  44665. newObj.media === obj.media &&
  44666. newObj.sourceMap === obj.sourceMap) {
  44667. return
  44668. }
  44669. update(obj = newObj)
  44670. } else {
  44671. remove()
  44672. }
  44673. }
  44674. }
  44675. var replaceText = (function () {
  44676. var textStore = []
  44677. return function (index, replacement) {
  44678. textStore[index] = replacement
  44679. return textStore.filter(Boolean).join('\n')
  44680. }
  44681. })()
  44682. function applyToSingletonTag (styleElement, index, remove, obj) {
  44683. var css = remove ? '' : obj.css
  44684. if (styleElement.styleSheet) {
  44685. styleElement.styleSheet.cssText = replaceText(index, css)
  44686. } else {
  44687. var cssNode = document.createTextNode(css)
  44688. var childNodes = styleElement.childNodes
  44689. if (childNodes[index]) styleElement.removeChild(childNodes[index])
  44690. if (childNodes.length) {
  44691. styleElement.insertBefore(cssNode, childNodes[index])
  44692. } else {
  44693. styleElement.appendChild(cssNode)
  44694. }
  44695. }
  44696. }
  44697. function applyToTag (styleElement, obj) {
  44698. var css = obj.css
  44699. var media = obj.media
  44700. var sourceMap = obj.sourceMap
  44701. if (media) {
  44702. styleElement.setAttribute('media', media)
  44703. }
  44704. if (sourceMap) {
  44705. // https://developer.chrome.com/devtools/docs/javascript-debugging
  44706. // this makes source maps inside style tags work properly in Chrome
  44707. css += '\n/*# sourceURL=' + sourceMap.sources[0] + ' */'
  44708. // http://stackoverflow.com/a/26603875
  44709. css += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */'
  44710. }
  44711. if (styleElement.styleSheet) {
  44712. styleElement.styleSheet.cssText = css
  44713. } else {
  44714. while (styleElement.firstChild) {
  44715. styleElement.removeChild(styleElement.firstChild)
  44716. }
  44717. styleElement.appendChild(document.createTextNode(css))
  44718. }
  44719. }
  44720. /***/ }),
  44721. /* 184 */
  44722. /***/ (function(module, exports) {
  44723. /**
  44724. * Translates the list format produced by css-loader into something
  44725. * easier to manipulate.
  44726. */
  44727. module.exports = function listToStyles (parentId, list) {
  44728. var styles = []
  44729. var newStyles = {}
  44730. for (var i = 0; i < list.length; i++) {
  44731. var item = list[i]
  44732. var id = item[0]
  44733. var css = item[1]
  44734. var media = item[2]
  44735. var sourceMap = item[3]
  44736. var part = {
  44737. id: parentId + ':' + i,
  44738. css: css,
  44739. media: media,
  44740. sourceMap: sourceMap
  44741. }
  44742. if (!newStyles[id]) {
  44743. styles.push(newStyles[id] = { id: id, parts: [part] })
  44744. } else {
  44745. newStyles[id].parts.push(part)
  44746. }
  44747. }
  44748. return styles
  44749. }
  44750. /***/ }),
  44751. /* 185 */
  44752. /***/ (function(module, exports) {
  44753. var g;
  44754. // This works in non-strict mode
  44755. g = (function() {
  44756. return this;
  44757. })();
  44758. try {
  44759. // This works if eval is allowed (see CSP)
  44760. g = g || Function("return this")() || (1,eval)("this");
  44761. } catch(e) {
  44762. // This works if the window reference is available
  44763. if(typeof window === "object")
  44764. g = window;
  44765. }
  44766. // g can still be undefined, but nothing to do about it...
  44767. // We return undefined, instead of nothing here, so it's
  44768. // easier to handle this case. if(!global) { ...}
  44769. module.exports = g;
  44770. /***/ }),
  44771. /* 186 */
  44772. /***/ (function(module, exports) {
  44773. module.exports = function(module) {
  44774. if(!module.webpackPolyfill) {
  44775. module.deprecate = function() {};
  44776. module.paths = [];
  44777. // module.parent = undefined by default
  44778. if(!module.children) module.children = [];
  44779. Object.defineProperty(module, "loaded", {
  44780. enumerable: true,
  44781. get: function() {
  44782. return module.l;
  44783. }
  44784. });
  44785. Object.defineProperty(module, "id", {
  44786. enumerable: true,
  44787. get: function() {
  44788. return module.i;
  44789. }
  44790. });
  44791. module.webpackPolyfill = 1;
  44792. }
  44793. return module;
  44794. };
  44795. /***/ }),
  44796. /* 187 */
  44797. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44798. "use strict";
  44799. /* WEBPACK VAR INJECTION */(function($) {Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  44800. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_bootstrap_dist_css_bootstrap_css__ = __webpack_require__(113);
  44801. /* 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__);
  44802. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert2_dist_sweetalert2_css__ = __webpack_require__(114);
  44803. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert2_dist_sweetalert2_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert2_dist_sweetalert2_css__);
  44804. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue__ = __webpack_require__(121);
  44805. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_vue__);
  44806. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_vue_router__ = __webpack_require__(120);
  44807. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_vue_router___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_vue_router__);
  44808. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__config_vue__ = __webpack_require__(191);
  44809. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__config_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__config_vue__);
  44810. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__serverList_vue__ = __webpack_require__(117);
  44811. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__serverList_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__serverList_vue__);
  44812. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__serverDetails_vue__ = __webpack_require__(116);
  44813. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__serverDetails_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6__serverDetails_vue__);
  44814. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__server_vue__ = __webpack_require__(115);
  44815. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__server_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7__server_vue__);
  44816. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__serveredit_vue__ = __webpack_require__(118);
  44817. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__serveredit_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8__serveredit_vue__);
  44818. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__servergraph_vue__ = __webpack_require__(119);
  44819. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__servergraph_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9__servergraph_vue__);
  44820. // import $ from "jquery";
  44821. // import "bootstrap/dist/js/bootstrap.js";
  44822. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.use(__WEBPACK_IMPORTED_MODULE_3_vue_router___default.a);
  44823. // Debug mode
  44824. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.config.debug = true;
  44825. // Devtools enabled
  44826. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.config.devtools = true;
  44827. // Silence logs and warnings
  44828. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.config.silent = false;
  44829. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.component('server', __WEBPACK_IMPORTED_MODULE_7__server_vue___default.a);
  44830. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.component('serveredit', __WEBPACK_IMPORTED_MODULE_8__serveredit_vue___default.a);
  44831. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.component('servergraph', __WEBPACK_IMPORTED_MODULE_9__servergraph_vue___default.a);
  44832. var routes = [
  44833. { path: "/", component: __WEBPACK_IMPORTED_MODULE_5__serverList_vue___default.a },
  44834. { path: "/server/:id", component: __WEBPACK_IMPORTED_MODULE_6__serverDetails_vue___default.a },
  44835. { path: "/config", component: __WEBPACK_IMPORTED_MODULE_4__config_vue___default.a }
  44836. ];
  44837. const router = new __WEBPACK_IMPORTED_MODULE_3_vue_router___default.a({
  44838. routes: routes,
  44839. mode: 'history'
  44840. });
  44841. $(function () {
  44842. var app = new __WEBPACK_IMPORTED_MODULE_2_vue___default.a({
  44843. router: router,
  44844. el: "#statsApp",
  44845. data: {
  44846. servers: [],
  44847. serversId: {},
  44848. types: []
  44849. },
  44850. created: function(){
  44851. var self = this;
  44852. var types = new XMLHttpRequest();
  44853. types.open('GET', '/api/types');
  44854. types.send(null);
  44855. types.onreadystatechange = function () {
  44856. if (types.readyState == XMLHttpRequest.DONE &&
  44857. types.status === 200) {
  44858. self.types = JSON.parse(types.response);
  44859. }
  44860. };
  44861. var serverCache = new XMLHttpRequest();
  44862. serverCache.open('GET', '/api/details/cached');
  44863. serverCache.send(null);
  44864. serverCache.onreadystatechange = function () {
  44865. if (serverCache.readyState == XMLHttpRequest.DONE &&
  44866. serverCache.status === 200) {
  44867. self.$root.servers = JSON.parse(serverCache.response);
  44868. self.$root.serversId = {};
  44869. for (var a in self.servers) {
  44870. if (!self.servers.hasOwnProperty(a)) {
  44871. continue;
  44872. }
  44873. var obj = self.servers[a];
  44874. self.$root.serversId[obj.id] = a;
  44875. }
  44876. }
  44877. };
  44878. if(this.$route.path !== "/"){
  44879. var server = new XMLHttpRequest();
  44880. server.open('GET', '/api/details');
  44881. server.send(null);
  44882. server.onreadystatechange = function () {
  44883. if (server.readyState == XMLHttpRequest.DONE &&
  44884. server.status === 200) {
  44885. self.$root.servers = JSON.parse(server.response);
  44886. self.$root.serversId = {};
  44887. for (var a in self.servers) {
  44888. if (!self.servers.hasOwnProperty(a)) {
  44889. continue;
  44890. }
  44891. var obj = self.servers[a];
  44892. self.$root.serversId[obj.id] = a;
  44893. }
  44894. }
  44895. };
  44896. }
  44897. }
  44898. });//.$mount("#statsApp");
  44899. });
  44900. /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(2)))
  44901. /***/ }),
  44902. /* 188 */,
  44903. /* 189 */,
  44904. /* 190 */,
  44905. /* 191 */
  44906. /***/ (function(module, exports, __webpack_require__) {
  44907. /* styles */
  44908. __webpack_require__(195)
  44909. var Component = __webpack_require__(1)(
  44910. /* script */
  44911. __webpack_require__(193),
  44912. /* template */
  44913. __webpack_require__(194),
  44914. /* scopeId */
  44915. null,
  44916. /* cssModules */
  44917. null
  44918. )
  44919. Component.options.__file = "G:\\Server Stats\\webSource\\config.vue"
  44920. 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.")}
  44921. if (Component.options.functional) {console.error("[vue-loader] config.vue: functional components are not supported with templates, they should use render functions.")}
  44922. /* hot reload */
  44923. if (false) {(function () {
  44924. var hotAPI = require("vue-hot-reload-api")
  44925. hotAPI.install(require("vue"), false)
  44926. if (!hotAPI.compatible) return
  44927. module.hot.accept()
  44928. if (!module.hot.data) {
  44929. hotAPI.createRecord("data-v-798d3b91", Component.options)
  44930. } else {
  44931. hotAPI.reload("data-v-798d3b91", Component.options)
  44932. }
  44933. })()}
  44934. module.exports = Component.exports
  44935. /***/ }),
  44936. /* 192 */
  44937. /***/ (function(module, exports, __webpack_require__) {
  44938. exports = module.exports = __webpack_require__(170)();
  44939. // imports
  44940. // module
  44941. 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", ""]);
  44942. // exports
  44943. /***/ }),
  44944. /* 193 */
  44945. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44946. "use strict";
  44947. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  44948. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(2);
  44949. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
  44950. //
  44951. //
  44952. //
  44953. //
  44954. //
  44955. //
  44956. //
  44957. //
  44958. //
  44959. //
  44960. //
  44961. //
  44962. //
  44963. //
  44964. //
  44965. //
  44966. //
  44967. //
  44968. //
  44969. //
  44970. //
  44971. //
  44972. //
  44973. //
  44974. //
  44975. //
  44976. //
  44977. //
  44978. //
  44979. //
  44980. /* harmony default export */ __webpack_exports__["default"] = {
  44981. data: function () {
  44982. return {
  44983. options: {
  44984. updateInterval: null,
  44985. port: null,
  44986. updateState: null
  44987. }
  44988. }
  44989. },
  44990. created: function () {
  44991. var config = new XMLHttpRequest();
  44992. var form = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this.$el);
  44993. var self = this;
  44994. config.open('GET', '/api/config');
  44995. config.onreadystatechange = function () {
  44996. if (config.readyState == XMLHttpRequest.DONE &&
  44997. config.status === 200) {
  44998. self.options = JSON.parse(config.response);
  44999. }
  45000. };
  45001. config.send(form.serialize());
  45002. },
  45003. methods: {
  45004. send(){
  45005. var self = this;
  45006. var config = new XMLHttpRequest();
  45007. config.open('POST', '/api/config');
  45008. config.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  45009. config.onreadystatechange = function () {
  45010. if (config.readyState == XMLHttpRequest.DONE &&
  45011. config.status === 200) {
  45012. // self.$router.push("/");
  45013. console.log(JSON.parse(config.response));
  45014. }
  45015. };
  45016. config.send(__WEBPACK_IMPORTED_MODULE_0_jquery___default.a.param(self.options));
  45017. }
  45018. }
  45019. };
  45020. /***/ }),
  45021. /* 194 */
  45022. /***/ (function(module, exports, __webpack_require__) {
  45023. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  45024. return _c('form', [_c('div', {
  45025. staticClass: "container",
  45026. attrs: {
  45027. "id": "config"
  45028. }
  45029. }, [_c('div', {
  45030. staticClass: "form-group row"
  45031. }, [_c('label', {
  45032. staticClass: "col-2 col-form-label"
  45033. }, [_vm._v("Update Interval")]), _vm._v(" "), _c('div', {
  45034. staticClass: "col-10"
  45035. }, [_c('input', {
  45036. directives: [{
  45037. name: "model",
  45038. rawName: "v-model",
  45039. value: (_vm.options.updateInterval),
  45040. expression: "options.updateInterval"
  45041. }],
  45042. staticClass: "form-control",
  45043. attrs: {
  45044. "type": "Number"
  45045. },
  45046. domProps: {
  45047. "value": _vm._s(_vm.options.updateInterval)
  45048. },
  45049. on: {
  45050. "input": function($event) {
  45051. if ($event.target.composing) { return; }
  45052. _vm.options.updateInterval = $event.target.value
  45053. }
  45054. }
  45055. })])]), _vm._v(" "), _c('div', {
  45056. staticClass: "form-group row"
  45057. }, [_c('label', {
  45058. staticClass: "col-2 col-form-label"
  45059. }, [_vm._v("Port")]), _vm._v(" "), _c('div', {
  45060. staticClass: "col-10"
  45061. }, [_c('input', {
  45062. directives: [{
  45063. name: "model",
  45064. rawName: "v-model",
  45065. value: (_vm.options.port),
  45066. expression: "options.port"
  45067. }],
  45068. staticClass: "form-control",
  45069. attrs: {
  45070. "type": "number"
  45071. },
  45072. domProps: {
  45073. "value": _vm._s(_vm.options.port)
  45074. },
  45075. on: {
  45076. "input": function($event) {
  45077. if ($event.target.composing) { return; }
  45078. _vm.options.port = _vm._n($event.target.value)
  45079. },
  45080. "blur": function($event) {
  45081. _vm.$forceUpdate()
  45082. }
  45083. }
  45084. })])]), _vm._v(" "), _c('div', {
  45085. staticClass: "form-group row"
  45086. }, [_c('label', {
  45087. staticClass: "col-2 col-form-label"
  45088. }, [_vm._v("Start data collector on start?")]), _vm._v(" "), _c('div', {
  45089. staticClass: "col-10"
  45090. }, [_c('select', {
  45091. directives: [{
  45092. name: "model",
  45093. rawName: "v-model",
  45094. value: (_vm.options.updateState),
  45095. expression: "options.updateState"
  45096. }],
  45097. staticClass: "form-control",
  45098. on: {
  45099. "change": function($event) {
  45100. _vm.options.updateState = Array.prototype.filter.call($event.target.options, function(o) {
  45101. return o.selected
  45102. }).map(function(o) {
  45103. var val = "_value" in o ? o._value : o.value;
  45104. return val
  45105. })[0]
  45106. }
  45107. }
  45108. }, [_c('option', {
  45109. attrs: {
  45110. "value": "true"
  45111. }
  45112. }, [_vm._v("Yes")]), _vm._v(" "), _c('option', {
  45113. attrs: {
  45114. "value": "false"
  45115. }
  45116. }, [_vm._v("No")])])])]), _vm._v(" "), _c('div', {
  45117. staticClass: "row"
  45118. }, [_c('button', {
  45119. staticClass: "btn btn-primary",
  45120. on: {
  45121. "click": _vm.send
  45122. }
  45123. }, [_vm._v("Save")])])])])
  45124. },staticRenderFns: []}
  45125. module.exports.render._withStripped = true
  45126. if (false) {
  45127. module.hot.accept()
  45128. if (module.hot.data) {
  45129. require("vue-hot-reload-api").rerender("data-v-798d3b91", module.exports)
  45130. }
  45131. }
  45132. /***/ }),
  45133. /* 195 */
  45134. /***/ (function(module, exports, __webpack_require__) {
  45135. // style-loader: Adds some css to the DOM by adding a <style> tag
  45136. // load the styles
  45137. var content = __webpack_require__(192);
  45138. if(typeof content === 'string') content = [[module.i, content, '']];
  45139. if(content.locals) module.exports = content.locals;
  45140. // add the styles to the DOM
  45141. var update = __webpack_require__(183)("717e19e0", content, false);
  45142. // Hot Module Replacement
  45143. if(false) {
  45144. // When the styles change, update the <style> tags
  45145. if(!content.locals) {
  45146. module.hot.accept("!!./../node_modules/css-loader/index.js!./../node_modules/vue-loader/lib/style-rewriter.js?{\"id\":\"data-v-798d3b91\",\"scoped\":false,\"hasInlineConfig\":false}!./../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./config.vue", function() {
  45147. var newContent = require("!!./../node_modules/css-loader/index.js!./../node_modules/vue-loader/lib/style-rewriter.js?{\"id\":\"data-v-798d3b91\",\"scoped\":false,\"hasInlineConfig\":false}!./../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./config.vue");
  45148. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  45149. update(newContent);
  45150. });
  45151. }
  45152. // When the module is disposed, remove the <style> tags
  45153. module.hot.dispose(function() { update(); });
  45154. }
  45155. /***/ })
  45156. /******/ ]);