pbs/moment.js

2 lines
48 KiB
JavaScript

(function(undefined){function dfl(a,b,c){switch(arguments.length){case 2:return null!=a?a:b;case 3:return null!=a?a:null!=b?b:c;default:throw new Error("Implement me")}}function hasOwnProp(a,b){return hasOwnProperty.call(a,b)}function defaultParsingFlags(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function printMsg(msg){moment.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+msg)}function deprecate(msg,fn){var firstTime=!0;return extend(function(){return firstTime&&(printMsg(msg),firstTime=!1),fn.apply(this,arguments)},fn)}function deprecateSimple(name,msg){deprecations[name]||(printMsg(msg),deprecations[name]=!0)}function padToken(func,count){return function(a){return leftZeroFill(func.call(this,a),count)}}function ordinalizeToken(func,period){return function(a){return this.localeData().ordinal(func.call(this,a),period)}}function monthDiff(a,b){var anchor2,adjust,wholeMonthDiff=12*(b.year()-a.year())+(b.month()-a.month()),anchor=a.clone().add(wholeMonthDiff,"months");return 0>b-anchor?(anchor2=a.clone().add(wholeMonthDiff-1,"months"),adjust=(b-anchor)/(anchor-anchor2)):(anchor2=a.clone().add(wholeMonthDiff+1,"months"),adjust=(b-anchor)/(anchor2-anchor)),-(wholeMonthDiff+adjust)}function meridiemFixWrap(locale,hour,meridiem){var isPm;return null==meridiem?hour:null!=locale.meridiemHour?locale.meridiemHour(hour,meridiem):null!=locale.isPM?(isPm=locale.isPM(meridiem),isPm&&12>hour&&(hour+=12),isPm||12!==hour||(hour=0),hour):hour}function Locale(){}function Moment(config,skipOverflow){skipOverflow!==!1&&checkOverflow(config),copyConfig(this,config),this._d=new Date(+config._d),updateInProgress===!1&&(updateInProgress=!0,moment.updateOffset(this),updateInProgress=!1)}function Duration(duration){var normalizedInput=normalizeObjectUnits(duration),years=normalizedInput.year||0,quarters=normalizedInput.quarter||0,months=normalizedInput.month||0,weeks=normalizedInput.week||0,days=normalizedInput.day||0,hours=normalizedInput.hour||0,minutes=normalizedInput.minute||0,seconds=normalizedInput.second||0,milliseconds=normalizedInput.millisecond||0;this._milliseconds=+milliseconds+1e3*seconds+6e4*minutes+36e5*hours,this._days=+days+7*weeks,this._months=+months+3*quarters+12*years,this._data={},this._locale=moment.localeData(),this._bubble()}function extend(a,b){for(var i in b)hasOwnProp(b,i)&&(a[i]=b[i]);return hasOwnProp(b,"toString")&&(a.toString=b.toString),hasOwnProp(b,"valueOf")&&(a.valueOf=b.valueOf),a}function copyConfig(to,from){var i,prop,val;if("undefined"!=typeof from._isAMomentObject&&(to._isAMomentObject=from._isAMomentObject),"undefined"!=typeof from._i&&(to._i=from._i),"undefined"!=typeof from._f&&(to._f=from._f),"undefined"!=typeof from._l&&(to._l=from._l),"undefined"!=typeof from._strict&&(to._strict=from._strict),"undefined"!=typeof from._tzm&&(to._tzm=from._tzm),"undefined"!=typeof from._isUTC&&(to._isUTC=from._isUTC),"undefined"!=typeof from._offset&&(to._offset=from._offset),"undefined"!=typeof from._pf&&(to._pf=from._pf),"undefined"!=typeof from._locale&&(to._locale=from._locale),momentProperties.length>0)for(i in momentProperties)prop=momentProperties[i],val=from[prop],"undefined"!=typeof val&&(to[prop]=val);return to}function absRound(number){return 0>number?Math.ceil(number):Math.floor(number)}function leftZeroFill(number,targetLength,forceSign){for(var output=""+Math.abs(number),sign=number>=0;output.length<targetLength;)output="0"+output;return(sign?forceSign?"+":"":"-")+output}function positiveMomentsDifference(base,other){var res={milliseconds:0,months:0};return res.months=other.month()-base.month()+12*(other.year()-base.year()),base.clone().add(res.months,"M").isAfter(other)&&--res.months,res.milliseconds=+other-+base.clone().add(res.months,"M"),res}function momentsDifference(base,other){var res;return other=makeAs(other,base),base.isBefore(other)?res=positiveMomentsDifference(base,other):(res=positiveMomentsDifference(other,base),res.milliseconds=-res.milliseconds,res.months=-res.months),res}function createAdder(direction,name){return function(val,period){var dur,tmp;return null===period||isNaN(+period)||(deprecateSimple(name,"moment()."+name+"(period, number) is deprecated. Please use moment()."+name+"(number, period)."),tmp=val,val=period,period=tmp),val="string"==typeof val?+val:val,dur=moment.duration(val,period),addOrSubtractDurationFromMoment(this,dur,direction),this}}function addOrSubtractDurationFromMoment(mom,duration,isAdding,updateOffset){var milliseconds=duration._milliseconds,days=duration._days,months=duration._months;updateOffset=null==updateOffset?!0:updateOffset,milliseconds&&mom._d.setTime(+mom._d+milliseconds*isAdding),days&&rawSetter(mom,"Date",rawGetter(mom,"Date")+days*isAdding),months&&rawMonthSetter(mom,rawGetter(mom,"Month")+months*isAdding),updateOffset&&moment.updateOffset(mom,days||months)}function isArray(input){return"[object Array]"===Object.prototype.toString.call(input)}function isDate(input){return"[object Date]"===Object.prototype.toString.call(input)||input instanceof Date}function compareArrays(array1,array2,dontConvert){var i,len=Math.min(array1.length,array2.length),lengthDiff=Math.abs(array1.length-array2.length),diffs=0;for(i=0;len>i;i++)(dontConvert&&array1[i]!==array2[i]||!dontConvert&&toInt(array1[i])!==toInt(array2[i]))&&diffs++;return diffs+lengthDiff}function normalizeUnits(units){if(units){var lowered=units.toLowerCase().replace(/(.)s$/,"$1");units=unitAliases[units]||camelFunctions[lowered]||lowered}return units}function normalizeObjectUnits(inputObject){var normalizedProp,prop,normalizedInput={};for(prop in inputObject)hasOwnProp(inputObject,prop)&&(normalizedProp=normalizeUnits(prop),normalizedProp&&(normalizedInput[normalizedProp]=inputObject[prop]));return normalizedInput}function makeList(field){var count,setter;if(0===field.indexOf("week"))count=7,setter="day";else{if(0!==field.indexOf("month"))return;count=12,setter="month"}moment[field]=function(format,index){var i,getter,method=moment._locale[field],results=[];if("number"==typeof format&&(index=format,format=undefined),getter=function(i){var m=moment().utc().set(setter,i);return method.call(moment._locale,m,format||"")},null!=index)return getter(index);for(i=0;count>i;i++)results.push(getter(i));return results}}function toInt(argumentForCoercion){var coercedNumber=+argumentForCoercion,value=0;return 0!==coercedNumber&&isFinite(coercedNumber)&&(value=coercedNumber>=0?Math.floor(coercedNumber):Math.ceil(coercedNumber)),value}function daysInMonth(year,month){return new Date(Date.UTC(year,month+1,0)).getUTCDate()}function weeksInYear(year,dow,doy){return weekOfYear(moment([year,11,31+dow-doy]),dow,doy).week}function daysInYear(year){return isLeapYear(year)?366:365}function isLeapYear(year){return year%4===0&&year%100!==0||year%400===0}function checkOverflow(m){var overflow;m._a&&-2===m._pf.overflow&&(overflow=m._a[MONTH]<0||m._a[MONTH]>11?MONTH:m._a[DATE]<1||m._a[DATE]>daysInMonth(m._a[YEAR],m._a[MONTH])?DATE:m._a[HOUR]<0||m._a[HOUR]>24||24===m._a[HOUR]&&(0!==m._a[MINUTE]||0!==m._a[SECOND]||0!==m._a[MILLISECOND])?HOUR:m._a[MINUTE]<0||m._a[MINUTE]>59?MINUTE:m._a[SECOND]<0||m._a[SECOND]>59?SECOND:m._a[MILLISECOND]<0||m._a[MILLISECOND]>999?MILLISECOND:-1,m._pf._overflowDayOfYear&&(YEAR>overflow||overflow>DATE)&&(overflow=DATE),m._pf.overflow=overflow)}function isValid(m){return null==m._isValid&&(m._isValid=!isNaN(m._d.getTime())&&m._pf.overflow<0&&!m._pf.empty&&!m._pf.invalidMonth&&!m._pf.nullInput&&!m._pf.invalidFormat&&!m._pf.userInvalidated,m._strict&&(m._isValid=m._isValid&&0===m._pf.charsLeftOver&&0===m._pf.unusedTokens.length&&m._pf.bigHour===undefined)),m._isValid}function normalizeLocale(key){return key?key.toLowerCase().replace("_","-"):key}function chooseLocale(names){for(var j,next,locale,split,i=0;i<names.length;){for(split=normalizeLocale(names[i]).split("-"),j=split.length,next=normalizeLocale(names[i+1]),next=next?next.split("-"):null;j>0;){if(locale=loadLocale(split.slice(0,j).join("-")))return locale;if(next&&next.length>=j&&compareArrays(split,next,!0)>=j-1)break;j--}i++}return null}function loadLocale(name){var oldLocale=null;if(!locales[name]&&hasModule)try{oldLocale=moment.locale(),require("./locale/"+name),moment.locale(oldLocale)}catch(e){}return locales[name]}function makeAs(input,model){var res,diff;return model._isUTC?(res=model.clone(),diff=(moment.isMoment(input)||isDate(input)?+input:+moment(input))-+res,res._d.setTime(+res._d+diff),moment.updateOffset(res,!1),res):moment(input).local()}function removeFormattingTokens(input){return input.match(/\[[\s\S]/)?input.replace(/^\[|\]$/g,""):input.replace(/\\/g,"")}function makeFormatFunction(format){var i,length,array=format.match(formattingTokens);for(i=0,length=array.length;length>i;i++)formatTokenFunctions[array[i]]?array[i]=formatTokenFunctions[array[i]]:array[i]=removeFormattingTokens(array[i]);return function(mom){var output="";for(i=0;length>i;i++)output+=array[i]instanceof Function?array[i].call(mom,format):array[i];return output}}function formatMoment(m,format){return m.isValid()?(format=expandFormat(format,m.localeData()),formatFunctions[format]||(formatFunctions[format]=makeFormatFunction(format)),formatFunctions[format](m)):m.localeData().invalidDate()}function expandFormat(format,locale){function replaceLongDateFormatTokens(input){return locale.longDateFormat(input)||input}var i=5;for(localFormattingTokens.lastIndex=0;i>=0&&localFormattingTokens.test(format);)format=format.replace(localFormattingTokens,replaceLongDateFormatTokens),localFormattingTokens.lastIndex=0,i-=1;return format}function getParseRegexForToken(token,config){var a,strict=config._strict;switch(token){case"Q":return parseTokenOneDigit;case"DDDD":return parseTokenThreeDigits;case"YYYY":case"GGGG":case"gggg":return strict?parseTokenFourDigits:parseTokenOneToFourDigits;case"Y":case"G":case"g":return parseTokenSignedNumber;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return strict?parseTokenSixDigits:parseTokenOneToSixDigits;case"S":if(strict)return parseTokenOneDigit;case"SS":if(strict)return parseTokenTwoDigits;case"SSS":if(strict)return parseTokenThreeDigits;case"DDD":return parseTokenOneToThreeDigits;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return parseTokenWord;case"a":case"A":return config._locale._meridiemParse;case"x":return parseTokenOffsetMs;case"X":return parseTokenTimestampMs;case"Z":case"ZZ":return parseTokenTimezone;case"T":return parseTokenT;case"SSSS":return parseTokenDigits;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return strict?parseTokenTwoDigits:parseTokenOneOrTwoDigits;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return parseTokenOneOrTwoDigits;case"Do":return strict?config._locale._ordinalParse:config._locale._ordinalParseLenient;default:return a=new RegExp(regexpEscape(unescapeFormat(token.replace("\\","")),"i"))}}function utcOffsetFromString(string){string=string||"";var possibleTzMatches=string.match(parseTokenTimezone)||[],tzChunk=possibleTzMatches[possibleTzMatches.length-1]||[],parts=(tzChunk+"").match(parseTimezoneChunker)||["-",0,0],minutes=+(60*parts[1])+toInt(parts[2]);return"+"===parts[0]?minutes:-minutes}function addTimeToArrayFromToken(token,input,config){var a,datePartArray=config._a;switch(token){case"Q":null!=input&&(datePartArray[MONTH]=3*(toInt(input)-1));break;case"M":case"MM":null!=input&&(datePartArray[MONTH]=toInt(input)-1);break;case"MMM":case"MMMM":a=config._locale.monthsParse(input,token,config._strict),null!=a?datePartArray[MONTH]=a:config._pf.invalidMonth=input;break;case"D":case"DD":null!=input&&(datePartArray[DATE]=toInt(input));break;case"Do":null!=input&&(datePartArray[DATE]=toInt(parseInt(input.match(/\d{1,2}/)[0],10)));break;case"DDD":case"DDDD":null!=input&&(config._dayOfYear=toInt(input));break;case"YY":datePartArray[YEAR]=moment.parseTwoDigitYear(input);break;case"YYYY":case"YYYYY":case"YYYYYY":datePartArray[YEAR]=toInt(input);break;case"a":case"A":config._meridiem=input;break;case"h":case"hh":config._pf.bigHour=!0;case"H":case"HH":datePartArray[HOUR]=toInt(input);break;case"m":case"mm":datePartArray[MINUTE]=toInt(input);break;case"s":case"ss":datePartArray[SECOND]=toInt(input);break;case"S":case"SS":case"SSS":case"SSSS":datePartArray[MILLISECOND]=toInt(1e3*("0."+input));break;case"x":config._d=new Date(toInt(input));break;case"X":config._d=new Date(1e3*parseFloat(input));break;case"Z":case"ZZ":config._useUTC=!0,config._tzm=utcOffsetFromString(input);break;case"dd":case"ddd":case"dddd":a=config._locale.weekdaysParse(input),null!=a?(config._w=config._w||{},config._w.d=a):config._pf.invalidWeekday=input;break;case"w":case"ww":case"W":case"WW":case"d":case"e":case"E":token=token.substr(0,1);case"gggg":case"GGGG":case"GGGGG":token=token.substr(0,2),input&&(config._w=config._w||{},config._w[token]=toInt(input));break;case"gg":case"GG":config._w=config._w||{},config._w[token]=moment.parseTwoDigitYear(input)}}function dayOfYearFromWeekInfo(config){var w,weekYear,week,weekday,dow,doy,temp;w=config._w,null!=w.GG||null!=w.W||null!=w.E?(dow=1,doy=4,weekYear=dfl(w.GG,config._a[YEAR],weekOfYear(moment(),1,4).year),week=dfl(w.W,1),weekday=dfl(w.E,1)):(dow=config._locale._week.dow,doy=config._locale._week.doy,weekYear=dfl(w.gg,config._a[YEAR],weekOfYear(moment(),dow,doy).year),week=dfl(w.w,1),null!=w.d?(weekday=w.d,dow>weekday&&++week):weekday=null!=w.e?w.e+dow:dow),temp=dayOfYearFromWeeks(weekYear,week,weekday,doy,dow),config._a[YEAR]=temp.year,config._dayOfYear=temp.dayOfYear}function dateFromConfig(config){var i,date,currentDate,yearToUse,input=[];if(!config._d){for(currentDate=currentDateArray(config),config._w&&null==config._a[DATE]&&null==config._a[MONTH]&&dayOfYearFromWeekInfo(config),config._dayOfYear&&(yearToUse=dfl(config._a[YEAR],currentDate[YEAR]),config._dayOfYear>daysInYear(yearToUse)&&(config._pf._overflowDayOfYear=!0),date=makeUTCDate(yearToUse,0,config._dayOfYear),config._a[MONTH]=date.getUTCMonth(),config._a[DATE]=date.getUTCDate()),i=0;3>i&&null==config._a[i];++i)config._a[i]=input[i]=currentDate[i];for(;7>i;i++)config._a[i]=input[i]=null==config._a[i]?2===i?1:0:config._a[i];24===config._a[HOUR]&&0===config._a[MINUTE]&&0===config._a[SECOND]&&0===config._a[MILLISECOND]&&(config._nextDay=!0,config._a[HOUR]=0),config._d=(config._useUTC?makeUTCDate:makeDate).apply(null,input),null!=config._tzm&&config._d.setUTCMinutes(config._d.getUTCMinutes()-config._tzm),config._nextDay&&(config._a[HOUR]=24)}}function dateFromObject(config){var normalizedInput;config._d||(normalizedInput=normalizeObjectUnits(config._i),config._a=[normalizedInput.year,normalizedInput.month,normalizedInput.day||normalizedInput.date,normalizedInput.hour,normalizedInput.minute,normalizedInput.second,normalizedInput.millisecond],dateFromConfig(config))}function currentDateArray(config){var now=new Date;return config._useUTC?[now.getUTCFullYear(),now.getUTCMonth(),now.getUTCDate()]:[now.getFullYear(),now.getMonth(),now.getDate()]}function makeDateFromStringAndFormat(config){if(config._f===moment.ISO_8601)return void parseISO(config);config._a=[],config._pf.empty=!0;var i,parsedInput,tokens,token,skipped,string=""+config._i,stringLength=string.length,totalParsedInputLength=0;for(tokens=expandFormat(config._f,config._locale).match(formattingTokens)||[],i=0;i<tokens.length;i++)token=tokens[i],parsedInput=(string.match(getParseRegexForToken(token,config))||[])[0],parsedInput&&(skipped=string.substr(0,string.indexOf(parsedInput)),skipped.length>0&&config._pf.unusedInput.push(skipped),string=string.slice(string.indexOf(parsedInput)+parsedInput.length),totalParsedInputLength+=parsedInput.length),formatTokenFunctions[token]?(parsedInput?config._pf.empty=!1:config._pf.unusedTokens.push(token),addTimeToArrayFromToken(token,parsedInput,config)):config._strict&&!parsedInput&&config._pf.unusedTokens.push(token);config._pf.charsLeftOver=stringLength-totalParsedInputLength,string.length>0&&config._pf.unusedInput.push(string),config._pf.bigHour===!0&&config._a[HOUR]<=12&&(config._pf.bigHour=undefined),config._a[HOUR]=meridiemFixWrap(config._locale,config._a[HOUR],config._meridiem),dateFromConfig(config),checkOverflow(config)}function unescapeFormat(s){return s.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(matched,p1,p2,p3,p4){return p1||p2||p3||p4})}function regexpEscape(s){return s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function makeDateFromStringAndArray(config){var tempConfig,bestMoment,scoreToBeat,i,currentScore;if(0===config._f.length)return config._pf.invalidFormat=!0,void(config._d=new Date(NaN));for(i=0;i<config._f.length;i++)currentScore=0,tempConfig=copyConfig({},config),null!=config._useUTC&&(tempConfig._useUTC=config._useUTC),tempConfig._pf=defaultParsingFlags(),tempConfig._f=config._f[i],makeDateFromStringAndFormat(tempConfig),isValid(tempConfig)&&(currentScore+=tempConfig._pf.charsLeftOver,currentScore+=10*tempConfig._pf.unusedTokens.length,tempConfig._pf.score=currentScore,(null==scoreToBeat||scoreToBeat>currentScore)&&(scoreToBeat=currentScore,bestMoment=tempConfig));extend(config,bestMoment||tempConfig)}function parseISO(config){var i,l,string=config._i,match=isoRegex.exec(string);if(match){for(config._pf.iso=!0,i=0,l=isoDates.length;l>i;i++)if(isoDates[i][1].exec(string)){config._f=isoDates[i][0]+(match[6]||" ");break}for(i=0,l=isoTimes.length;l>i;i++)if(isoTimes[i][1].exec(string)){config._f+=isoTimes[i][0];break}string.match(parseTokenTimezone)&&(config._f+="Z"),makeDateFromStringAndFormat(config)}else config._isValid=!1}function makeDateFromString(config){parseISO(config),config._isValid===!1&&(delete config._isValid,moment.createFromInputFallback(config))}function map(arr,fn){var i,res=[];for(i=0;i<arr.length;++i)res.push(fn(arr[i],i));return res}function makeDateFromInput(config){var matched,input=config._i;input===undefined?config._d=new Date:isDate(input)?config._d=new Date(+input):null!==(matched=aspNetJsonRegex.exec(input))?config._d=new Date(+matched[1]):"string"==typeof input?makeDateFromString(config):isArray(input)?(config._a=map(input.slice(0),function(obj){return parseInt(obj,10)}),dateFromConfig(config)):"object"==typeof input?dateFromObject(config):"number"==typeof input?config._d=new Date(input):moment.createFromInputFallback(config)}function makeDate(y,m,d,h,M,s,ms){var date=new Date(y,m,d,h,M,s,ms);return 1970>y&&date.setFullYear(y),date}function makeUTCDate(y){var date=new Date(Date.UTC.apply(null,arguments));return 1970>y&&date.setUTCFullYear(y),date}function parseWeekday(input,locale){if("string"==typeof input)if(isNaN(input)){if(input=locale.weekdaysParse(input),"number"!=typeof input)return null}else input=parseInt(input,10);return input}function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number||1,!!withoutSuffix,string,isFuture)}function relativeTime(posNegDuration,withoutSuffix,locale){var duration=moment.duration(posNegDuration).abs(),seconds=round(duration.as("s")),minutes=round(duration.as("m")),hours=round(duration.as("h")),days=round(duration.as("d")),months=round(duration.as("M")),years=round(duration.as("y")),args=seconds<relativeTimeThresholds.s&&["s",seconds]||1===minutes&&["m"]||minutes<relativeTimeThresholds.m&&["mm",minutes]||1===hours&&["h"]||hours<relativeTimeThresholds.h&&["hh",hours]||1===days&&["d"]||days<relativeTimeThresholds.d&&["dd",days]||1===months&&["M"]||months<relativeTimeThresholds.M&&["MM",months]||1===years&&["y"]||["yy",years];return args[2]=withoutSuffix,args[3]=+posNegDuration>0,args[4]=locale,substituteTimeAgo.apply({},args)}function weekOfYear(mom,firstDayOfWeek,firstDayOfWeekOfYear){var adjustedMoment,end=firstDayOfWeekOfYear-firstDayOfWeek,daysToDayOfWeek=firstDayOfWeekOfYear-mom.day();return daysToDayOfWeek>end&&(daysToDayOfWeek-=7),end-7>daysToDayOfWeek&&(daysToDayOfWeek+=7),adjustedMoment=moment(mom).add(daysToDayOfWeek,"d"),{week:Math.ceil(adjustedMoment.dayOfYear()/7),year:adjustedMoment.year()}}function dayOfYearFromWeeks(year,week,weekday,firstDayOfWeekOfYear,firstDayOfWeek){var daysToAdd,dayOfYear,d=makeUTCDate(year,0,1).getUTCDay();return d=0===d?7:d,weekday=null!=weekday?weekday:firstDayOfWeek,daysToAdd=firstDayOfWeek-d+(d>firstDayOfWeekOfYear?7:0)-(firstDayOfWeek>d?7:0),dayOfYear=7*(week-1)+(weekday-firstDayOfWeek)+daysToAdd+1,{year:dayOfYear>0?year:year-1,dayOfYear:dayOfYear>0?dayOfYear:daysInYear(year-1)+dayOfYear}}function makeMoment(config){var res,input=config._i,format=config._f;return config._locale=config._locale||moment.localeData(config._l),null===input||format===undefined&&""===input?moment.invalid({nullInput:!0}):("string"==typeof input&&(config._i=input=config._locale.preparse(input)),moment.isMoment(input)?new Moment(input,!0):(format?isArray(format)?makeDateFromStringAndArray(config):makeDateFromStringAndFormat(config):makeDateFromInput(config),res=new Moment(config),res._nextDay&&(res.add(1,"d"),res._nextDay=undefined),res))}function pickBy(fn,moments){var res,i;if(1===moments.length&&isArray(moments[0])&&(moments=moments[0]),!moments.length)return moment();for(res=moments[0],i=1;i<moments.length;++i)moments[i][fn](res)&&(res=moments[i]);return res}function rawMonthSetter(mom,value){var dayOfMonth;return"string"==typeof value&&(value=mom.localeData().monthsParse(value),"number"!=typeof value)?mom:(dayOfMonth=Math.min(mom.date(),daysInMonth(mom.year(),value)),mom._d["set"+(mom._isUTC?"UTC":"")+"Month"](value,dayOfMonth),mom)}function rawGetter(mom,unit){return mom._d["get"+(mom._isUTC?"UTC":"")+unit]()}function rawSetter(mom,unit,value){return"Month"===unit?rawMonthSetter(mom,value):mom._d["set"+(mom._isUTC?"UTC":"")+unit](value)}function makeAccessor(unit,keepTime){return function(value){return null!=value?(rawSetter(this,unit,value),moment.updateOffset(this,keepTime),this):rawGetter(this,unit)}}function daysToYears(days){return 400*days/146097}function yearsToDays(years){return 146097*years/400}function makeDurationGetter(name){moment.duration.fn[name]=function(){return this._data[name]}}function makeGlobal(shouldDeprecate){"undefined"==typeof ender&&(oldGlobalMoment=globalScope.moment,shouldDeprecate?globalScope.moment=deprecate("Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release.",moment):globalScope.moment=moment)}for(var moment,oldGlobalMoment,i,VERSION="2.9.0",globalScope="undefined"==typeof global||"undefined"!=typeof window&&window!==global.window?this:global,round=Math.round,hasOwnProperty=Object.prototype.hasOwnProperty,YEAR=0,MONTH=1,DATE=2,HOUR=3,MINUTE=4,SECOND=5,MILLISECOND=6,locales={},momentProperties=[],hasModule="undefined"!=typeof module&&module&&module.exports,aspNetJsonRegex=/^\/?Date\((\-?\d+)/i,aspNetTimeSpanJsonRegex=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,isoDurationRegex=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,formattingTokens=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|x|X|zz?|ZZ?|.)/g,localFormattingTokens=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,parseTokenOneOrTwoDigits=/\d\d?/,parseTokenOneToThreeDigits=/\d{1,3}/,parseTokenOneToFourDigits=/\d{1,4}/,parseTokenOneToSixDigits=/[+\-]?\d{1,6}/,parseTokenDigits=/\d+/,parseTokenWord=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,parseTokenTimezone=/Z|[\+\-]\d\d:?\d\d/gi,parseTokenT=/T/i,parseTokenOffsetMs=/[\+\-]?\d+/,parseTokenTimestampMs=/[\+\-]?\d+(\.\d{1,3})?/,parseTokenOneDigit=/\d/,parseTokenTwoDigits=/\d\d/,parseTokenThreeDigits=/\d{3}/,parseTokenFourDigits=/\d{4}/,parseTokenSixDigits=/[+-]?\d{6}/,parseTokenSignedNumber=/[+-]?\d+/,isoRegex=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,isoFormat="YYYY-MM-DDTHH:mm:ssZ",isoDates=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],isoTimes=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],parseTimezoneChunker=/([\+\-]|\d\d)/gi,unitMillisecondFactors=("Date|Hours|Minutes|Seconds|Milliseconds".split("|"),{Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6}),unitAliases={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",D:"date",w:"week",W:"isoWeek",M:"month",Q:"quarter",y:"year",DDD:"dayOfYear",e:"weekday",E:"isoWeekday",gg:"weekYear",GG:"isoWeekYear"},camelFunctions={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},formatFunctions={},relativeTimeThresholds={s:45,m:45,h:22,d:26,M:11},ordinalizeTokens="DDD w W M D d".split(" "),paddedTokens="M D H h m s w W".split(" "),formatTokenFunctions={M:function(){return this.month()+1},MMM:function(format){return this.localeData().monthsShort(this,format)},MMMM:function(format){return this.localeData().months(this,format)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(format){return this.localeData().weekdaysMin(this,format)},ddd:function(format){return this.localeData().weekdaysShort(this,format)},dddd:function(format){return this.localeData().weekdays(this,format)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return leftZeroFill(this.year()%100,2)},YYYY:function(){return leftZeroFill(this.year(),4)},YYYYY:function(){return leftZeroFill(this.year(),5)},YYYYYY:function(){var y=this.year(),sign=y>=0?"+":"-";return sign+leftZeroFill(Math.abs(y),6)},gg:function(){return leftZeroFill(this.weekYear()%100,2)},gggg:function(){return leftZeroFill(this.weekYear(),4)},ggggg:function(){return leftZeroFill(this.weekYear(),5)},GG:function(){return leftZeroFill(this.isoWeekYear()%100,2)},GGGG:function(){return leftZeroFill(this.isoWeekYear(),4)},GGGGG:function(){return leftZeroFill(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return toInt(this.milliseconds()/100)},SS:function(){return leftZeroFill(toInt(this.milliseconds()/10),2)},SSS:function(){return leftZeroFill(this.milliseconds(),3)},SSSS:function(){return leftZeroFill(this.milliseconds(),3)},Z:function(){var a=this.utcOffset(),b="+";return 0>a&&(a=-a,b="-"),b+leftZeroFill(toInt(a/60),2)+":"+leftZeroFill(toInt(a)%60,2)},ZZ:function(){var a=this.utcOffset(),b="+";return 0>a&&(a=-a,b="-"),b+leftZeroFill(toInt(a/60),2)+leftZeroFill(toInt(a)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},x:function(){return this.valueOf()},X:function(){return this.unix()},Q:function(){return this.quarter()}},deprecations={},lists=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"],updateInProgress=!1;ordinalizeTokens.length;)i=ordinalizeTokens.pop(),formatTokenFunctions[i+"o"]=ordinalizeToken(formatTokenFunctions[i],i);for(;paddedTokens.length;)i=paddedTokens.pop(),formatTokenFunctions[i+i]=padToken(formatTokenFunctions[i],2);formatTokenFunctions.DDDD=padToken(formatTokenFunctions.DDD,3),extend(Locale.prototype,{set:function(config){var prop,i;for(i in config)prop=config[i],"function"==typeof prop?this[i]=prop:this["_"+i]=prop;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(m){return this._months[m.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(m){return this._monthsShort[m.month()]},monthsParse:function(monthName,format,strict){var i,mom,regex;for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;12>i;i++){if(mom=moment.utc([2e3,i]),strict&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(mom,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(mom,"").replace(".","")+"$","i")),strict||this._monthsParse[i]||(regex="^"+this.months(mom,"")+"|^"+this.monthsShort(mom,""),this._monthsParse[i]=new RegExp(regex.replace(".",""),"i")),strict&&"MMMM"===format&&this._longMonthsParse[i].test(monthName))return i;if(strict&&"MMM"===format&&this._shortMonthsParse[i].test(monthName))return i;if(!strict&&this._monthsParse[i].test(monthName))return i}},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(m){return this._weekdays[m.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(m){return this._weekdaysShort[m.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(m){return this._weekdaysMin[m.day()]},weekdaysParse:function(weekdayName){var i,mom,regex;for(this._weekdaysParse||(this._weekdaysParse=[]),i=0;7>i;i++)if(this._weekdaysParse[i]||(mom=moment([2e3,1]).day(i),regex="^"+this.weekdays(mom,"")+"|^"+this.weekdaysShort(mom,"")+"|^"+this.weekdaysMin(mom,""),this._weekdaysParse[i]=new RegExp(regex.replace(".",""),"i")),this._weekdaysParse[i].test(weekdayName))return i},_longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY LT",LLLL:"dddd, MMMM D, YYYY LT"},longDateFormat:function(key){var output=this._longDateFormat[key];return!output&&this._longDateFormat[key.toUpperCase()]&&(output=this._longDateFormat[key.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(val){return val.slice(1)}),this._longDateFormat[key]=output),output},isPM:function(input){return"p"===(input+"").toLowerCase().charAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(hours,minutes,isLower){return hours>11?isLower?"pm":"PM":isLower?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(key,mom,now){var output=this._calendar[key];return"function"==typeof output?output.apply(mom,[now]):output},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(number,withoutSuffix,string,isFuture){var output=this._relativeTime[string];return"function"==typeof output?output(number,withoutSuffix,string,isFuture):output.replace(/%d/i,number)},pastFuture:function(diff,output){var format=this._relativeTime[diff>0?"future":"past"];return"function"==typeof format?format(output):format.replace(/%s/i,output)},ordinal:function(number){return this._ordinal.replace("%d",number)},_ordinal:"%d",_ordinalParse:/\d{1,2}/,preparse:function(string){return string},postformat:function(string){return string},week:function(mom){return weekOfYear(mom,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},firstDayOfWeek:function(){return this._week.dow},firstDayOfYear:function(){return this._week.doy},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),moment=function(input,format,locale,strict){var c;return"boolean"==typeof locale&&(strict=locale,locale=undefined),c={},c._isAMomentObject=!0,c._i=input,c._f=format,c._l=locale,c._strict=strict,c._isUTC=!1,
c._pf=defaultParsingFlags(),makeMoment(c)},moment.suppressDeprecationWarnings=!1,moment.createFromInputFallback=deprecate("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(config){config._d=new Date(config._i+(config._useUTC?" UTC":""))}),moment.min=function(){var args=[].slice.call(arguments,0);return pickBy("isBefore",args)},moment.max=function(){var args=[].slice.call(arguments,0);return pickBy("isAfter",args)},moment.utc=function(input,format,locale,strict){var c;return"boolean"==typeof locale&&(strict=locale,locale=undefined),c={},c._isAMomentObject=!0,c._useUTC=!0,c._isUTC=!0,c._l=locale,c._i=input,c._f=format,c._strict=strict,c._pf=defaultParsingFlags(),makeMoment(c).utc()},moment.unix=function(input){return moment(1e3*input)},moment.duration=function(input,key){var sign,ret,parseIso,diffRes,duration=input,match=null;return moment.isDuration(input)?duration={ms:input._milliseconds,d:input._days,M:input._months}:"number"==typeof input?(duration={},key?duration[key]=input:duration.milliseconds=input):(match=aspNetTimeSpanJsonRegex.exec(input))?(sign="-"===match[1]?-1:1,duration={y:0,d:toInt(match[DATE])*sign,h:toInt(match[HOUR])*sign,m:toInt(match[MINUTE])*sign,s:toInt(match[SECOND])*sign,ms:toInt(match[MILLISECOND])*sign}):(match=isoDurationRegex.exec(input))?(sign="-"===match[1]?-1:1,parseIso=function(inp){var res=inp&&parseFloat(inp.replace(",","."));return(isNaN(res)?0:res)*sign},duration={y:parseIso(match[2]),M:parseIso(match[3]),d:parseIso(match[4]),h:parseIso(match[5]),m:parseIso(match[6]),s:parseIso(match[7]),w:parseIso(match[8])}):null==duration?duration={}:"object"==typeof duration&&("from"in duration||"to"in duration)&&(diffRes=momentsDifference(moment(duration.from),moment(duration.to)),duration={},duration.ms=diffRes.milliseconds,duration.M=diffRes.months),ret=new Duration(duration),moment.isDuration(input)&&hasOwnProp(input,"_locale")&&(ret._locale=input._locale),ret},moment.version=VERSION,moment.defaultFormat=isoFormat,moment.ISO_8601=function(){},moment.momentProperties=momentProperties,moment.updateOffset=function(){},moment.relativeTimeThreshold=function(threshold,limit){return relativeTimeThresholds[threshold]===undefined?!1:limit===undefined?relativeTimeThresholds[threshold]:(relativeTimeThresholds[threshold]=limit,!0)},moment.lang=deprecate("moment.lang is deprecated. Use moment.locale instead.",function(key,value){return moment.locale(key,value)}),moment.locale=function(key,values){var data;return key&&(data="undefined"!=typeof values?moment.defineLocale(key,values):moment.localeData(key),data&&(moment.duration._locale=moment._locale=data)),moment._locale._abbr},moment.defineLocale=function(name,values){return null!==values?(values.abbr=name,locales[name]||(locales[name]=new Locale),locales[name].set(values),moment.locale(name),locales[name]):(delete locales[name],null)},moment.langData=deprecate("moment.langData is deprecated. Use moment.localeData instead.",function(key){return moment.localeData(key)}),moment.localeData=function(key){var locale;if(key&&key._locale&&key._locale._abbr&&(key=key._locale._abbr),!key)return moment._locale;if(!isArray(key)){if(locale=loadLocale(key))return locale;key=[key]}return chooseLocale(key)},moment.isMoment=function(obj){return obj instanceof Moment||null!=obj&&hasOwnProp(obj,"_isAMomentObject")},moment.isDuration=function(obj){return obj instanceof Duration};for(i=lists.length-1;i>=0;--i)makeList(lists[i]);moment.normalizeUnits=function(units){return normalizeUnits(units)},moment.invalid=function(flags){var m=moment.utc(NaN);return null!=flags?extend(m._pf,flags):m._pf.userInvalidated=!0,m},moment.parseZone=function(){return moment.apply(null,arguments).parseZone()},moment.parseTwoDigitYear=function(input){return toInt(input)+(toInt(input)>68?1900:2e3)},moment.isDate=isDate,extend(moment.fn=Moment.prototype,{clone:function(){return moment(this)},valueOf:function(){return+this._d-6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var m=moment(this).utc();return 0<m.year()&&m.year()<=9999?"function"==typeof Date.prototype.toISOString?this.toDate().toISOString():formatMoment(m,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):formatMoment(m,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var m=this;return[m.year(),m.month(),m.date(),m.hours(),m.minutes(),m.seconds(),m.milliseconds()]},isValid:function(){return isValid(this)},isDSTShifted:function(){return this._a?this.isValid()&&compareArrays(this._a,(this._isUTC?moment.utc(this._a):moment(this._a)).toArray())>0:!1},parsingFlags:function(){return extend({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(keepLocalTime){return this.utcOffset(0,keepLocalTime)},local:function(keepLocalTime){return this._isUTC&&(this.utcOffset(0,keepLocalTime),this._isUTC=!1,keepLocalTime&&this.subtract(this._dateUtcOffset(),"m")),this},format:function(inputString){var output=formatMoment(this,inputString||moment.defaultFormat);return this.localeData().postformat(output)},add:createAdder(1,"add"),subtract:createAdder(-1,"subtract"),diff:function(input,units,asFloat){var diff,output,that=makeAs(input,this),zoneDiff=6e4*(that.utcOffset()-this.utcOffset());return units=normalizeUnits(units),"year"===units||"month"===units||"quarter"===units?(output=monthDiff(this,that),"quarter"===units?output/=3:"year"===units&&(output/=12)):(diff=this-that,output="second"===units?diff/1e3:"minute"===units?diff/6e4:"hour"===units?diff/36e5:"day"===units?(diff-zoneDiff)/864e5:"week"===units?(diff-zoneDiff)/6048e5:diff),asFloat?output:absRound(output)},from:function(time,withoutSuffix){return moment.duration({to:this,from:time}).locale(this.locale()).humanize(!withoutSuffix)},fromNow:function(withoutSuffix){return this.from(moment(),withoutSuffix)},calendar:function(time){var now=time||moment(),sod=makeAs(now,this).startOf("day"),diff=this.diff(sod,"days",!0),format=-6>diff?"sameElse":-1>diff?"lastWeek":0>diff?"lastDay":1>diff?"sameDay":2>diff?"nextDay":7>diff?"nextWeek":"sameElse";return this.format(this.localeData().calendar(format,this,moment(now)))},isLeapYear:function(){return isLeapYear(this.year())},isDST:function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},day:function(input){var day=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=input?(input=parseWeekday(input,this.localeData()),this.add(input-day,"d")):day},month:makeAccessor("Month",!0),startOf:function(units){switch(units=normalizeUnits(units)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===units?this.weekday(0):"isoWeek"===units&&this.isoWeekday(1),"quarter"===units&&this.month(3*Math.floor(this.month()/3)),this},endOf:function(units){return units=normalizeUnits(units),units===undefined||"millisecond"===units?this:this.startOf(units).add(1,"isoWeek"===units?"week":units).subtract(1,"ms")},isAfter:function(input,units){var inputMs;return units=normalizeUnits("undefined"!=typeof units?units:"millisecond"),"millisecond"===units?(input=moment.isMoment(input)?input:moment(input),+this>+input):(inputMs=moment.isMoment(input)?+input:+moment(input),inputMs<+this.clone().startOf(units))},isBefore:function(input,units){var inputMs;return units=normalizeUnits("undefined"!=typeof units?units:"millisecond"),"millisecond"===units?(input=moment.isMoment(input)?input:moment(input),+input>+this):(inputMs=moment.isMoment(input)?+input:+moment(input),+this.clone().endOf(units)<inputMs)},isBetween:function(from,to,units){return this.isAfter(from,units)&&this.isBefore(to,units)},isSame:function(input,units){var inputMs;return units=normalizeUnits(units||"millisecond"),"millisecond"===units?(input=moment.isMoment(input)?input:moment(input),+this===+input):(inputMs=+moment(input),+this.clone().startOf(units)<=inputMs&&inputMs<=+this.clone().endOf(units))},min:deprecate("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(other){return other=moment.apply(null,arguments),this>other?this:other}),max:deprecate("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(other){return other=moment.apply(null,arguments),other>this?this:other}),zone:deprecate("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",function(input,keepLocalTime){return null!=input?("string"!=typeof input&&(input=-input),this.utcOffset(input,keepLocalTime),this):-this.utcOffset()}),utcOffset:function(input,keepLocalTime){var localAdjust,offset=this._offset||0;return null!=input?("string"==typeof input&&(input=utcOffsetFromString(input)),Math.abs(input)<16&&(input=60*input),!this._isUTC&&keepLocalTime&&(localAdjust=this._dateUtcOffset()),this._offset=input,this._isUTC=!0,null!=localAdjust&&this.add(localAdjust,"m"),offset!==input&&(!keepLocalTime||this._changeInProgress?addOrSubtractDurationFromMoment(this,moment.duration(input-offset,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,moment.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?offset:this._dateUtcOffset()},isLocal:function(){return!this._isUTC},isUtcOffset:function(){return this._isUTC},isUtc:function(){return this._isUTC&&0===this._offset},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(utcOffsetFromString(this._i)),this},hasAlignedHourOffset:function(input){return input=input?moment(input).utcOffset():0,(this.utcOffset()-input)%60===0},daysInMonth:function(){return daysInMonth(this.year(),this.month())},dayOfYear:function(input){var dayOfYear=round((moment(this).startOf("day")-moment(this).startOf("year"))/864e5)+1;return null==input?dayOfYear:this.add(input-dayOfYear,"d")},quarter:function(input){return null==input?Math.ceil((this.month()+1)/3):this.month(3*(input-1)+this.month()%3)},weekYear:function(input){var year=weekOfYear(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return null==input?year:this.add(input-year,"y")},isoWeekYear:function(input){var year=weekOfYear(this,1,4).year;return null==input?year:this.add(input-year,"y")},week:function(input){var week=this.localeData().week(this);return null==input?week:this.add(7*(input-week),"d")},isoWeek:function(input){var week=weekOfYear(this,1,4).week;return null==input?week:this.add(7*(input-week),"d")},weekday:function(input){var weekday=(this.day()+7-this.localeData()._week.dow)%7;return null==input?weekday:this.add(input-weekday,"d")},isoWeekday:function(input){return null==input?this.day()||7:this.day(this.day()%7?input:input-7)},isoWeeksInYear:function(){return weeksInYear(this.year(),1,4)},weeksInYear:function(){var weekInfo=this.localeData()._week;return weeksInYear(this.year(),weekInfo.dow,weekInfo.doy)},get:function(units){return units=normalizeUnits(units),this[units]()},set:function(units,value){var unit;if("object"==typeof units)for(unit in units)this.set(unit,units[unit]);else units=normalizeUnits(units),"function"==typeof this[units]&&this[units](value);return this},locale:function(key){var newLocaleData;return key===undefined?this._locale._abbr:(newLocaleData=moment.localeData(key),null!=newLocaleData&&(this._locale=newLocaleData),this)},lang:deprecate("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(key){return key===undefined?this.localeData():this.locale(key)}),localeData:function(){return this._locale},_dateUtcOffset:function(){return 15*-Math.round(this._d.getTimezoneOffset()/15)}}),moment.fn.millisecond=moment.fn.milliseconds=makeAccessor("Milliseconds",!1),moment.fn.second=moment.fn.seconds=makeAccessor("Seconds",!1),moment.fn.minute=moment.fn.minutes=makeAccessor("Minutes",!1),moment.fn.hour=moment.fn.hours=makeAccessor("Hours",!0),moment.fn.date=makeAccessor("Date",!0),moment.fn.dates=deprecate("dates accessor is deprecated. Use date instead.",makeAccessor("Date",!0)),moment.fn.year=makeAccessor("FullYear",!0),moment.fn.years=deprecate("years accessor is deprecated. Use year instead.",makeAccessor("FullYear",!0)),moment.fn.days=moment.fn.day,moment.fn.months=moment.fn.month,moment.fn.weeks=moment.fn.week,moment.fn.isoWeeks=moment.fn.isoWeek,moment.fn.quarters=moment.fn.quarter,moment.fn.toJSON=moment.fn.toISOString,moment.fn.isUTC=moment.fn.isUtc,extend(moment.duration.fn=Duration.prototype,{_bubble:function(){var seconds,minutes,hours,milliseconds=this._milliseconds,days=this._days,months=this._months,data=this._data,years=0;data.milliseconds=milliseconds%1e3,seconds=absRound(milliseconds/1e3),data.seconds=seconds%60,minutes=absRound(seconds/60),data.minutes=minutes%60,hours=absRound(minutes/60),data.hours=hours%24,days+=absRound(hours/24),years=absRound(daysToYears(days)),days-=absRound(yearsToDays(years)),months+=absRound(days/30),days%=30,years+=absRound(months/12),months%=12,data.days=days,data.months=months,data.years=years},abs:function(){return this._milliseconds=Math.abs(this._milliseconds),this._days=Math.abs(this._days),this._months=Math.abs(this._months),this._data.milliseconds=Math.abs(this._data.milliseconds),this._data.seconds=Math.abs(this._data.seconds),this._data.minutes=Math.abs(this._data.minutes),this._data.hours=Math.abs(this._data.hours),this._data.months=Math.abs(this._data.months),this._data.years=Math.abs(this._data.years),this},weeks:function(){return absRound(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*toInt(this._months/12)},humanize:function(withSuffix){var output=relativeTime(this,!withSuffix,this.localeData());return withSuffix&&(output=this.localeData().pastFuture(+this,output)),this.localeData().postformat(output)},add:function(input,val){var dur=moment.duration(input,val);return this._milliseconds+=dur._milliseconds,this._days+=dur._days,this._months+=dur._months,this._bubble(),this},subtract:function(input,val){var dur=moment.duration(input,val);return this._milliseconds-=dur._milliseconds,this._days-=dur._days,this._months-=dur._months,this._bubble(),this},get:function(units){return units=normalizeUnits(units),this[units.toLowerCase()+"s"]()},as:function(units){var days,months;if(units=normalizeUnits(units),"month"===units||"year"===units)return days=this._days+this._milliseconds/864e5,months=this._months+12*daysToYears(days),"month"===units?months:months/12;switch(days=this._days+Math.round(yearsToDays(this._months/12)),units){case"week":return days/7+this._milliseconds/6048e5;case"day":return days+this._milliseconds/864e5;case"hour":return 24*days+this._milliseconds/36e5;case"minute":return 24*days*60+this._milliseconds/6e4;case"second":return 24*days*60*60+this._milliseconds/1e3;case"millisecond":return Math.floor(24*days*60*60*1e3)+this._milliseconds;default:throw new Error("Unknown unit "+units)}},lang:moment.fn.lang,locale:moment.fn.locale,toIsoString:deprecate("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",function(){return this.toISOString()}),toISOString:function(){var years=Math.abs(this.years()),months=Math.abs(this.months()),days=Math.abs(this.days()),hours=Math.abs(this.hours()),minutes=Math.abs(this.minutes()),seconds=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(this.asSeconds()<0?"-":"")+"P"+(years?years+"Y":"")+(months?months+"M":"")+(days?days+"D":"")+(hours||minutes||seconds?"T":"")+(hours?hours+"H":"")+(minutes?minutes+"M":"")+(seconds?seconds+"S":""):"P0D"},localeData:function(){return this._locale},toJSON:function(){return this.toISOString()}}),moment.duration.fn.toString=moment.duration.fn.toISOString;for(i in unitMillisecondFactors)hasOwnProp(unitMillisecondFactors,i)&&makeDurationGetter(i.toLowerCase());moment.duration.fn.asMilliseconds=function(){return this.as("ms")},moment.duration.fn.asSeconds=function(){return this.as("s")},moment.duration.fn.asMinutes=function(){return this.as("m")},moment.duration.fn.asHours=function(){return this.as("h")},moment.duration.fn.asDays=function(){return this.as("d")},moment.duration.fn.asWeeks=function(){return this.as("weeks")},moment.duration.fn.asMonths=function(){return this.as("M")},moment.duration.fn.asYears=function(){return this.as("y")},moment.locale("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(number){var b=number%10,output=1===toInt(number%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return number+output}}),hasModule?module.exports=moment:"function"==typeof define&&define.amd?(define(function(require,exports,module){return module.config&&module.config()&&module.config().noGlobal===!0&&(globalScope.moment=oldGlobalMoment),moment}),makeGlobal(!0)):makeGlobal()}).call(this);