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,QAAQ+M,MAAM,gIAEtB1D,IAAgC,EAChCC,GAAQjH,iBAAiBD,EAAWjO,QACpCmV,GAAQnH,UAAUC,EAClB,EAQDkH,GAAQnH,UAAY,SAASC,GAC5BiG,GAAcjG,GACd4H,EAAAA,UAAqC5H,EACrC,EAQDkH,GAAQnV,OAASmV,GAAQnH,UAQzBmH,GAAQ0D,UAAY,SAAC7Y,EAAQ8Y,EAAM5I,GAClC,IAAIjC,EAAagG,GAAcjU,GAC1BiO,IACJiG,GAAc,CACblU,OAAAA,IAEDiO,EAAagG,GAAcjU,IAG5BiO,EAAW6K,GAAQ5I,CACnB,C","sources":["../node_modules/relative-time-format/source/LocaleDataStore.js","../node_modules/relative-time-format/source/resolveLocale.js","../node_modules/relative-time-format/source/PluralRuleFunctions.js","../node_modules/relative-time-format/source/getPluralRulesLocale.js","../node_modules/relative-time-format/source/PluralRules.js","../node_modules/relative-time-format/source/RelativeTimeFormat.js","../node_modules/javascript-time-ago/source/cache.js","../node_modules/javascript-time-ago/source/locale.js","../node_modules/javascript-time-ago/source/isStyleObject.js","../node_modules/javascript-time-ago/source/steps/units.js","../node_modules/javascript-time-ago/source/steps/getStepDenominator.js","../node_modules/javascript-time-ago/source/round.js","../node_modules/javascript-time-ago/source/steps/getStepMinTime.js","../node_modules/javascript-time-ago/source/steps/getStep.js","../node_modules/javascript-time-ago/source/steps/getTimeToNextUpdateForUnit.js","../node_modules/javascript-time-ago/source/steps/getTimeToNextUpdate.js","../node_modules/javascript-time-ago/source/LocaleDataStore.js","../node_modules/javascript-time-ago/source/steps/round.js","../node_modules/javascript-time-ago/source/style/round.js","../node_modules/javascript-time-ago/source/style/roundMinute.js","../node_modules/javascript-time-ago/source/steps/approximate.js","../node_modules/javascript-time-ago/source/style/approximate.js","../node_modules/javascript-time-ago/source/style/approximateTime.js","../node_modules/javascript-time-ago/source/steps/helpers.js","../node_modules/javascript-time-ago/source/style/twitter.js","../node_modules/javascript-time-ago/source/style/twitterNow.js","../node_modules/javascript-time-ago/source/style/twitterMinute.js","../node_modules/javascript-time-ago/source/style/twitterMinuteNow.js","../node_modules/javascript-time-ago/source/style/twitterFirstMinute.js","../node_modules/javascript-time-ago/source/style/mini.js","../node_modules/javascript-time-ago/source/style/miniNow.js","../node_modules/javascript-time-ago/source/style/miniMinute.js","../node_modules/javascript-time-ago/source/style/miniMinuteNow.js","../node_modules/javascript-time-ago/source/TimeAgo.js","../node_modules/javascript-time-ago/source/style/getStyleByName.js"],"sourcesContent":["// Fallback locale.\r\n// (when not a single one of the supplied \"preferred\" locales is available)\r\nlet defaultLocale = 'en'\r\n\r\n// For all locales added\r\n// their relative time formatter messages will be stored here.\r\nconst localesData = {}\r\n\r\n// According to the spec BCP 47 language tags are case-insensitive.\r\n// https://tools.ietf.org/html/rfc5646\r\nconst lowercaseLocaleLookup = {}\r\n\r\nexport function getDefaultLocale() {\r\n return defaultLocale\r\n}\r\n\r\nexport function setDefaultLocale(locale) {\r\n defaultLocale = locale\r\n}\r\n\r\n/**\r\n * Gets locale data previously added by `addLocaleData()`.\r\n * @return {object} [localeData]\r\n */\r\nexport function getLocaleData(locale) {\r\n\treturn localesData[locale]\r\n}\r\n\r\n/**\r\n * Adds locale data.\r\n * Is called by `RelativeTimeFormat.addLocale(...)`.\r\n * @param {object} localeData\r\n */\r\nexport function addLocaleData(localeData) {\r\n if (!localeData) {\r\n throw new Error('No locale data passed')\r\n }\r\n // This locale data is stored in a global variable\r\n // and later used when calling `.format(time)`.\r\n localesData[localeData.locale] = localeData\r\n lowercaseLocaleLookup[localeData.locale.toLowerCase()] = localeData.locale\r\n}\r\n\r\n/**\r\n * Returns a locale for which locale data has been added\r\n * via `RelativeTimeFormat.addLocale(...)`.\r\n * @param {string} locale\r\n * @return {string} [locale]\r\n */\r\nexport function resolveLocale(locale) {\r\n\tif (localesData[locale]) {\r\n\t\treturn locale\r\n\t}\r\n\tif (lowercaseLocaleLookup[locale.toLowerCase()]) {\r\n\t\treturn lowercaseLocaleLookup[locale.toLowerCase()]\r\n\t}\r\n}","import {\r\n resolveLocale as resolveLocaleForData\r\n} from './LocaleDataStore.js'\r\n\r\n/**\r\n * Resolves a locale to a supported one (if any).\r\n * @param {string} locale\r\n * @param {Object} [options] - An object that may have the following property:\r\n * @param {string} [options.localeMatcher=\"lookup\"] - The locale matching algorithm to use. Possible values are \"lookup\" and \"best fit\". Currently only \"lookup\" is supported.\r\n * @return {string} [locale]\r\n * @example\r\n * // Returns \"sr\"\r\n * resolveLocale(\"sr-Cyrl-BA\")\r\n * // Returns `undefined`\r\n * resolveLocale(\"xx-Latn\")\r\n */\r\nexport default function resolveLocale(locale, options = {}) {\r\n const localeMatcher = options.localeMatcher || 'lookup'\r\n switch (localeMatcher) {\r\n case 'lookup':\r\n return resolveLocaleLookup(locale)\r\n // \"best fit\" locale matching is not supported.\r\n // https://github.com/catamphetamine/relative-time-format/issues/2\r\n case 'best fit':\r\n // return resolveLocaleBestFit(locale)\r\n return resolveLocaleLookup(locale)\r\n default:\r\n throw new RangeError(`Invalid \"localeMatcher\" option: ${localeMatcher}`)\r\n }\r\n}\r\n\r\n/**\r\n * Resolves a locale to a supported one (if any).\r\n * Starts from the most specific locale and gradually\r\n * falls back to less specific ones.\r\n * This is a basic implementation of the \"lookup\" algorithm.\r\n * https://tools.ietf.org/html/rfc4647#section-3.4\r\n * @param {string} locale\r\n * @return {string} [locale]\r\n * @example\r\n * // Returns \"sr\"\r\n * resolveLocaleLookup(\"sr-Cyrl-BA\")\r\n * // Returns `undefined`\r\n * resolveLocaleLookup(\"xx-Latn\")\r\n */\r\nexport function resolveLocaleLookup(locale) {\r\n const resolvedLocale = resolveLocaleForData(locale)\r\n if (resolvedLocale) {\r\n return resolvedLocale\r\n }\r\n // `sr-Cyrl-BA` -> `sr-Cyrl` -> `sr`.\r\n const parts = locale.split('-')\r\n while (locale.length > 1) {\r\n parts.pop()\r\n locale = parts.join('-')\r\n const resolvedLocale = resolveLocaleForData(locale)\r\n if (resolvedLocale) {\r\n return resolvedLocale\r\n }\r\n }\r\n}\r\n","// (this file was autogenerated by `generate-locales`)\n// \"plural rules\" functions are not stored in locale JSON files because they're not strings.\n// This file isn't big — it's about 5 kilobytes in size (minified).\n// Alternatively, the pluralization rules for each locale could be stored\n// in their JSON files in a non-parsed form and later parsed via `make-plural` library.\n// But `make-plural` library itself is relatively big in size:\n// `make-plural.min.js` is about 6 kilobytes (https://unpkg.com/make-plural/).\n// So, it's more practical to bypass runtime `make-plural` pluralization rules compilation\n// and just include the already compiled pluarlization rules for all locales in the library code.\n\nvar $ = {\n\taf: (n) => n == 1 ? 'one' : 'other',\n\tam: (n) => n >= 0 && n <= 1 ? 'one' : 'other',\n\tar: (n) => {\n\t\tconst s = String(n).split('.'), t0 = Number(s[0]) == n, n100 = t0 && s[0].slice(-2);\n\t\treturn n == 0 ? 'zero'\n\t\t\t: n == 1 ? 'one'\n\t\t\t: n == 2 ? 'two'\n\t\t\t: (n100 >= 3 && n100 <= 10) ? 'few'\n\t\t\t: (n100 >= 11 && n100 <= 99) ? 'many'\n\t\t\t: 'other';\n\t},\n\tast: (n) => {\n\t\tconst s = String(n).split('.'), v0 = !s[1];\n\t\treturn n == 1 && v0 ? 'one' : 'other';\n\t},\n\tbe: (n) => {\n\t\tconst s = String(n).split('.'), t0 = Number(s[0]) == n, n10 = t0 && s[0].slice(-1), n100 = t0 && s[0].slice(-2);\n\t\treturn n10 == 1 && n100 != 11 ? 'one'\n\t\t\t: (n10 >= 2 && n10 <= 4) && (n100 < 12 || n100 > 14) ? 'few'\n\t\t\t: t0 && n10 == 0 || (n10 >= 5 && n10 <= 9) || (n100 >= 11 && n100 <= 14) ? 'many'\n\t\t\t: 'other';\n\t},\n\tbr: (n) => {\n\t\tconst s = String(n).split('.'), t0 = Number(s[0]) == n, n10 = t0 && s[0].slice(-1), n100 = t0 && s[0].slice(-2), n1000000 = t0 && s[0].slice(-6);\n\t\treturn n10 == 1 && n100 != 11 && n100 != 71 && n100 != 91 ? 'one'\n\t\t\t: n10 == 2 && n100 != 12 && n100 != 72 && n100 != 92 ? 'two'\n\t\t\t: ((n10 == 3 || n10 == 4) || n10 == 9) && (n100 < 10 || n100 > 19) && (n100 < 70 || n100 > 79) && (n100 < 90 || n100 > 99) ? 'few'\n\t\t\t: n != 0 && t0 && n1000000 == 0 ? 'many'\n\t\t\t: 'other';\n\t},\n\tbs: (n) => {\n\t\tconst s = String(n).split('.'), i = s[0], f = s[1] || '', v0 = !s[1], i10 = i.slice(-1), i100 = i.slice(-2), f10 = f.slice(-1), f100 = f.slice(-2);\n\t\treturn v0 && i10 == 1 && i100 != 11 || f10 == 1 && f100 != 11 ? 'one'\n\t\t\t: v0 && (i10 >= 2 && i10 <= 4) && (i100 < 12 || i100 > 14) || (f10 >= 2 && f10 <= 4) && (f100 < 12 || f100 > 14) ? 'few'\n\t\t\t: 'other';\n\t},\n\tca: (n) => {\n\t\tconst s = String(n).split('.'), i = s[0], v0 = !s[1], i1000000 = i.slice(-6);\n\t\treturn n == 1 && v0 ? 'one'\n\t\t\t: i != 0 && i1000000 == 0 && v0 ? 'many'\n\t\t\t: 'other';\n\t},\n\tceb: (n) => {\n\t\tconst s = String(n).split('.'), i = s[0], f = s[1] || '', v0 = !s[1], i10 = i.slice(-1), f10 = f.slice(-1);\n\t\treturn v0 && (i == 1 || i == 2 || i == 3) || v0 && i10 != 4 && i10 != 6 && i10 != 9 || !v0 && f10 != 4 && f10 != 6 && f10 != 9 ? 'one' : 'other';\n\t},\n\tcs: (n) => {\n\t\tconst s = String(n).split('.'), i = s[0], v0 = !s[1];\n\t\treturn n == 1 && v0 ? 'one'\n\t\t\t: (i >= 2 && i <= 4) && v0 ? 'few'\n\t\t\t: !v0 ? 'many'\n\t\t\t: 'other';\n\t},\n\tcy: (n) => n == 0 ? 'zero'\n\t\t\t: n == 1 ? 'one'\n\t\t\t: n == 2 ? 'two'\n\t\t\t: n == 3 ? 'few'\n\t\t\t: n == 6 ? 'many'\n\t\t\t: 'other',\n\tda: (n) => {\n\t\tconst s = String(n).split('.'), i = s[0], t0 = Number(s[0]) == n;\n\t\treturn n == 1 || !t0 && (i == 0 || i == 1) ? 'one' : 'other';\n\t},\n\tdsb: (n) => {\n\t\tconst s = String(n).split('.'), i = s[0], f = s[1] || '', v0 = !s[1], i100 = i.slice(-2), f100 = f.slice(-2);\n\t\treturn v0 && i100 == 1 || f100 == 1 ? 'one'\n\t\t\t: v0 && i100 == 2 || f100 == 2 ? 'two'\n\t\t\t: v0 && (i100 == 3 || i100 == 4) || (f100 == 3 || f100 == 4) ? 'few'\n\t\t\t: 'other';\n\t},\n\tdz: (n) => 'other',\n\tes: (n) => {\n\t\tconst s = String(n).split('.'), i = s[0], v0 = !s[1], i1000000 = i.slice(-6);\n\t\treturn n == 1 ? 'one'\n\t\t\t: i != 0 && i1000000 == 0 && v0 ? 'many'\n\t\t\t: 'other';\n\t},\n\tff: (n) => n >= 0 && n < 2 ? 'one' : 'other',\n\tfr: (n) => {\n\t\tconst s = String(n).split('.'), i = s[0], v0 = !s[1], i1000000 = i.slice(-6);\n\t\treturn n >= 0 && n < 2 ? 'one'\n\t\t\t: i != 0 && i1000000 == 0 && v0 ? 'many'\n\t\t\t: 'other';\n\t},\n\tga: (n) => {\n\t\tconst s = String(n).split('.'), t0 = Number(s[0]) == n;\n\t\treturn n == 1 ? 'one'\n\t\t\t: n == 2 ? 'two'\n\t\t\t: (t0 && n >= 3 && n <= 6) ? 'few'\n\t\t\t: (t0 && n >= 7 && n <= 10) ? 'many'\n\t\t\t: 'other';\n\t},\n\tgd: (n) => {\n\t\tconst s = String(n).split('.'), t0 = Number(s[0]) == n;\n\t\treturn (n == 1 || n == 11) ? 'one'\n\t\t\t: (n == 2 || n == 12) ? 'two'\n\t\t\t: ((t0 && n >= 3 && n <= 10) || (t0 && n >= 13 && n <= 19)) ? 'few'\n\t\t\t: 'other';\n\t},\n\the: (n) => {\n\t\tconst s = String(n).split('.'), i = s[0], v0 = !s[1];\n\t\treturn i == 1 && v0 || i == 0 && !v0 ? 'one'\n\t\t\t: i == 2 && v0 ? 'two'\n\t\t\t: 'other';\n\t},\n\tis: (n) => {\n\t\tconst s = String(n).split('.'), i = s[0], t = (s[1] || '').replace(/0+$/, ''), t0 = Number(s[0]) == n, i10 = i.slice(-1), i100 = i.slice(-2);\n\t\treturn t0 && i10 == 1 && i100 != 11 || t % 10 == 1 && t % 100 != 11 ? 'one' : 'other';\n\t},\n\tksh: (n) => n == 0 ? 'zero'\n\t\t\t: n == 1 ? 'one'\n\t\t\t: 'other',\n\tlt: (n) => {\n\t\tconst s = String(n).split('.'), f = s[1] || '', t0 = Number(s[0]) == n, n10 = t0 && s[0].slice(-1), n100 = t0 && s[0].slice(-2);\n\t\treturn n10 == 1 && (n100 < 11 || n100 > 19) ? 'one'\n\t\t\t: (n10 >= 2 && n10 <= 9) && (n100 < 11 || n100 > 19) ? 'few'\n\t\t\t: f != 0 ? 'many'\n\t\t\t: 'other';\n\t},\n\tlv: (n) => {\n\t\tconst s = String(n).split('.'), f = s[1] || '', v = f.length, t0 = Number(s[0]) == n, n10 = t0 && s[0].slice(-1), n100 = t0 && s[0].slice(-2), f100 = f.slice(-2), f10 = f.slice(-1);\n\t\treturn t0 && n10 == 0 || (n100 >= 11 && n100 <= 19) || v == 2 && (f100 >= 11 && f100 <= 19) ? 'zero'\n\t\t\t: n10 == 1 && n100 != 11 || v == 2 && f10 == 1 && f100 != 11 || v != 2 && f10 == 1 ? 'one'\n\t\t\t: 'other';\n\t},\n\tmk: (n) => {\n\t\tconst s = String(n).split('.'), i = s[0], f = s[1] || '', v0 = !s[1], i10 = i.slice(-1), i100 = i.slice(-2), f10 = f.slice(-1), f100 = f.slice(-2);\n\t\treturn v0 && i10 == 1 && i100 != 11 || f10 == 1 && f100 != 11 ? 'one' : 'other';\n\t},\n\tmt: (n) => {\n\t\tconst s = String(n).split('.'), t0 = Number(s[0]) == n, n100 = t0 && s[0].slice(-2);\n\t\treturn n == 1 ? 'one'\n\t\t\t: n == 2 ? 'two'\n\t\t\t: n == 0 || (n100 >= 3 && n100 <= 10) ? 'few'\n\t\t\t: (n100 >= 11 && n100 <= 19) ? 'many'\n\t\t\t: 'other';\n\t},\n\tpa: (n) => (n == 0 || n == 1) ? 'one' : 'other',\n\tpl: (n) => {\n\t\tconst s = String(n).split('.'), i = s[0], v0 = !s[1], i10 = i.slice(-1), i100 = i.slice(-2);\n\t\treturn n == 1 && v0 ? 'one'\n\t\t\t: v0 && (i10 >= 2 && i10 <= 4) && (i100 < 12 || i100 > 14) ? 'few'\n\t\t\t: v0 && i != 1 && (i10 == 0 || i10 == 1) || v0 && (i10 >= 5 && i10 <= 9) || v0 && (i100 >= 12 && i100 <= 14) ? 'many'\n\t\t\t: 'other';\n\t},\n\tpt: (n) => {\n\t\tconst s = String(n).split('.'), i = s[0], v0 = !s[1], i1000000 = i.slice(-6);\n\t\treturn (i == 0 || i == 1) ? 'one'\n\t\t\t: i != 0 && i1000000 == 0 && v0 ? 'many'\n\t\t\t: 'other';\n\t},\n\tro: (n) => {\n\t\tconst s = String(n).split('.'), v0 = !s[1], t0 = Number(s[0]) == n, n100 = t0 && s[0].slice(-2);\n\t\treturn n == 1 && v0 ? 'one'\n\t\t\t: !v0 || n == 0 || n != 1 && (n100 >= 1 && n100 <= 19) ? 'few'\n\t\t\t: 'other';\n\t},\n\tru: (n) => {\n\t\tconst s = String(n).split('.'), i = s[0], v0 = !s[1], i10 = i.slice(-1), i100 = i.slice(-2);\n\t\treturn v0 && i10 == 1 && i100 != 11 ? 'one'\n\t\t\t: v0 && (i10 >= 2 && i10 <= 4) && (i100 < 12 || i100 > 14) ? 'few'\n\t\t\t: v0 && i10 == 0 || v0 && (i10 >= 5 && i10 <= 9) || v0 && (i100 >= 11 && i100 <= 14) ? 'many'\n\t\t\t: 'other';\n\t},\n\tse: (n) => n == 1 ? 'one'\n\t\t\t: n == 2 ? 'two'\n\t\t\t: 'other',\n\tsi: (n) => {\n\t\tconst s = String(n).split('.'), i = s[0], f = s[1] || '';\n\t\treturn (n == 0 || n == 1) || i == 0 && f == 1 ? 'one' : 'other';\n\t},\n\tsl: (n) => {\n\t\tconst s = String(n).split('.'), i = s[0], v0 = !s[1], i100 = i.slice(-2);\n\t\treturn v0 && i100 == 1 ? 'one'\n\t\t\t: v0 && i100 == 2 ? 'two'\n\t\t\t: v0 && (i100 == 3 || i100 == 4) || !v0 ? 'few'\n\t\t\t: 'other';\n\t}\n}\n\n$.as = $.am\n$.az = $.af\n$.bg = $.af\n$.bn = $.am\n$.brx = $.af\n$.ce = $.af\n$.chr = $.af\n$.de = $.ast\n$.ee = $.af\n$.el = $.af\n$.en = $.ast\n$.et = $.ast\n$.eu = $.af\n$.fa = $.am\n$.fi = $.ast\n$.fil = $.ceb\n$.fo = $.af\n$.fur = $.af\n$.fy = $.ast\n$.gl = $.ast\n$.gu = $.am\n$.ha = $.af\n$.hi = $.am\n$.hr = $.bs\n$.hsb = $.dsb\n$.hu = $.af\n$.hy = $.ff\n$.ia = $.ast\n$.id = $.dz\n$.ig = $.dz\n$.it = $.ca\n$.ja = $.dz\n$.jgo = $.af\n$.jv = $.dz\n$.ka = $.af\n$.kea = $.dz\n$.kk = $.af\n$.kl = $.af\n$.km = $.dz\n$.kn = $.am\n$.ko = $.dz\n$.ks = $.af\n$.ku = $.af\n$.ky = $.af\n$.lb = $.af\n$.lkt = $.dz\n$.lo = $.dz\n$.ml = $.af\n$.mn = $.af\n$.mr = $.af\n$.ms = $.dz\n$.my = $.dz\n$.nb = $.af\n$.ne = $.af\n$.nl = $.ast\n$.nn = $.af\n$.no = $.af\n$.or = $.af\n$.pcm = $.am\n$.ps = $.af\n$.rm = $.af\n$.sah = $.dz\n$.sc = $.ast\n$.sd = $.af\n$.sk = $.cs\n$.so = $.af\n$.sq = $.af\n$.sr = $.bs\n$.su = $.dz\n$.sv = $.ast\n$.sw = $.ast\n$.ta = $.af\n$.te = $.af\n$.th = $.dz\n$.ti = $.pa\n$.tk = $.af\n$.to = $.dz\n$.tr = $.af\n$.ug = $.af\n$.uk = $.ru\n$.ur = $.ast\n$.uz = $.af\n$.vi = $.dz\n$.wae = $.af\n$.wo = $.dz\n$.xh = $.af\n$.yi = $.ast\n$.yo = $.dz\n$.yue = $.dz\n$.zh = $.dz\n$.zu = $.am\n\nexport default $","/**\r\n * Returns a `locale` for which a function exists in `./PluralRuleFunctions.js`.\r\n * @param {string} locale\r\n * @return {string}\r\n * @example\r\n * getPluralRulesLocale(\"ru-RU-Cyrl\") // Returns \"ru\".\r\n */\r\nexport default function getPluralRulesLocale(locale) {\r\n\t// \"pt\" language is the only one having different pluralization rules\r\n\t// for the one (\"pt\") (Portuguese) locale and the other (\"pt-PT\") (European Portuguese).\r\n\t// http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html\r\n\t// (see the entries for \"pt\" and \"pt_PT\" there)\r\n\tif (locale === 'pt-PT') {\r\n\t\treturn locale\r\n\t}\r\n\treturn getLanguageFromLanguageTag(locale)\r\n}\r\n\r\n/**\r\n * Extracts language from an IETF BCP 47 language tag.\r\n * @param {string} languageTag - IETF BCP 47 language tag.\r\n * @return {string}\r\n * @example\r\n * // Returns \"he\"\r\n * getLanguageFromLanguageTag(\"he-IL-u-ca-hebrew-tz-jeruslm\")\r\n * // Returns \"ar\"\r\n * getLanguageFromLanguageTag(\"ar-u-nu-latn\")\r\n */\r\nconst LANGUAGE_REG_EXP = /^([a-z0-9]+)/i\r\nfunction getLanguageFromLanguageTag(languageTag) {\r\n\tconst match = languageTag.match(LANGUAGE_REG_EXP)\r\n\tif (!match) {\r\n\t\tthrow new TypeError(`Invalid locale: ${languageTag}`)\r\n\t}\r\n\treturn match[1]\r\n}\r\n","// Importing `PluralRule` polyfill from a separate package\r\n// results in a bundle that is larger by 1kB for some reason.\r\n// export { default as default } from 'intl-plural-rules-polyfill/cardinal'\r\n\r\nimport PluralRuleFunctions from \"./PluralRuleFunctions.js\"\r\nimport getPluralRulesLocale from \"./getPluralRulesLocale.js\"\r\n\r\n/**\r\n * `Intl.PluralRules` polyfill.\r\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/PluralRules\r\n */\r\nexport default class PluralRules {\r\n\tconstructor(locale, options) {\r\n\t\tconst locales = PluralRules.supportedLocalesOf(locale)\r\n\t\tif (locales.length === 0) {\r\n\t\t\tthrow new RangeError(\"Unsupported locale: \" + locale)\r\n\t\t}\r\n\t\tif (options && options.type !== \"cardinal\") {\r\n\t\t\tthrow new RangeError(\"Only \\\"cardinal\\\" \\\"type\\\" is supported\")\r\n\t\t}\r\n\t\tthis.$ = PluralRuleFunctions[getPluralRulesLocale(locales[0])]\r\n\t}\r\n\tselect(number) {\r\n\t\treturn this.$(number)\r\n\t}\r\n\tstatic supportedLocalesOf(locales) {\r\n\t\tif (typeof locales === \"string\") {\r\n\t\t\tlocales = [locales]\r\n\t\t}\r\n\t\treturn locales.filter(locale => PluralRuleFunctions[getPluralRulesLocale(locale)])\r\n\t}\r\n}","import {\r\n getDefaultLocale,\r\n setDefaultLocale,\r\n getLocaleData,\r\n addLocaleData\r\n} from './LocaleDataStore.js'\r\n\r\nimport resolveLocale from './resolveLocale.js'\r\nimport PluralRules from './PluralRules.js'\r\n// Importing `PluralRule` polyfill from a separate package\r\n// results in a bundle that is larger by 1kB for some reason.\r\n// import PluralRules from 'intl-plural-rules-polyfill/cardinal'\r\n\r\n// Valid time units.\r\nexport const UNITS = [\r\n \"second\",\r\n \"minute\",\r\n \"hour\",\r\n \"day\",\r\n \"week\",\r\n \"month\",\r\n \"quarter\",\r\n \"year\"\r\n]\r\n\r\n// Valid values for the `numeric` option.\r\nconst NUMERIC_VALUES = [\r\n \"auto\",\r\n \"always\"\r\n]\r\n\r\n// Valid values for the `style` option.\r\nconst STYLE_VALUES = [\r\n \"long\",\r\n \"short\",\r\n \"narrow\"\r\n]\r\n\r\n// Valid values for the `localeMatcher` option.\r\nconst LOCALE_MATCHER_VALUES = [\r\n \"lookup\",\r\n \"best fit\"\r\n]\r\n\r\n/**\r\n * Polyfill for `Intl.RelativeTimeFormat` proposal.\r\n * https://github.com/tc39/proposal-intl-relative-time\r\n * https://github.com/tc39/proposal-intl-relative-time/issues/55\r\n */\r\nexport default class RelativeTimeFormat {\r\n /**\r\n * @param {(string|string[])} [locales] - Preferred locales (or locale).\r\n * @param {Object} [options] - Formatting options.\r\n * @param {string} [options.style=\"long\"] - One of: \"long\", \"short\", \"narrow\".\r\n * @param {string} [options.numeric=\"always\"] - (Version >= 2) One of: \"always\", \"auto\".\r\n * @param {string} [options.localeMatcher=\"lookup\"] - One of: \"lookup\", \"best fit\". Currently only \"lookup\" is supported.\r\n */\r\n constructor(locales = [], options = {}) {\r\n const {\r\n numeric,\r\n style,\r\n localeMatcher\r\n } = options\r\n\r\n this.numeric = \"always\"\r\n this.style = \"long\"\r\n this.localeMatcher = \"lookup\"\r\n\r\n // Set `numeric` option.\r\n if (numeric !== undefined) {\r\n if (NUMERIC_VALUES.indexOf(numeric) < 0) {\r\n throw new RangeError(`Invalid \"numeric\" option: ${numeric}`)\r\n }\r\n this.numeric = numeric\r\n }\r\n\r\n // Set `style` option.\r\n if (style !== undefined) {\r\n if (STYLE_VALUES.indexOf(style) < 0) {\r\n throw new RangeError(`Invalid \"style\" option: ${style}`)\r\n }\r\n this.style = style\r\n }\r\n\r\n // Set `localeMatcher` option.\r\n if (localeMatcher !== undefined) {\r\n if (LOCALE_MATCHER_VALUES.indexOf(localeMatcher) < 0) {\r\n throw new RangeError(`Invalid \"localeMatcher\" option: ${localeMatcher}`)\r\n }\r\n this.localeMatcher = localeMatcher\r\n }\r\n\r\n // Set `locale`.\r\n // Convert `locales` to an array.\r\n if (typeof locales === 'string') {\r\n locales = [locales]\r\n }\r\n // Add default locale.\r\n locales.push(getDefaultLocale())\r\n // Choose the most appropriate locale.\r\n this.locale = RelativeTimeFormat.supportedLocalesOf(locales, {\r\n localeMatcher: this.localeMatcher\r\n })[0]\r\n if (!this.locale) {\r\n throw new Error(\"No supported locale was found\")\r\n }\r\n\r\n // Construct an `Intl.PluralRules` instance (polyfill).\r\n if (PluralRules.supportedLocalesOf(this.locale).length > 0) {\r\n this.pluralRules = new PluralRules(this.locale)\r\n } else {\r\n console.warn(`\"${this.locale}\" locale is not supported`)\r\n }\r\n\r\n // Use `Intl.NumberFormat` for formatting numbers (when available).\r\n if (typeof Intl !== 'undefined' && Intl.NumberFormat) {\r\n this.numberFormat = new Intl.NumberFormat(this.locale)\r\n this.numberingSystem = this.numberFormat.resolvedOptions().numberingSystem\r\n } else {\r\n this.numberingSystem = 'latn'\r\n }\r\n\r\n this.locale = resolveLocale(this.locale, {\r\n localeMatcher: this.localeMatcher\r\n })\r\n }\r\n\r\n /**\r\n * Formats time `number` in `units` (either in past or in future).\r\n * @param {number} number - Time interval value.\r\n * @param {string} unit - Time interval measurement unit.\r\n * @return {string}\r\n * @throws {RangeError} If unit is not one of \"second\", \"minute\", \"hour\", \"day\", \"week\", \"month\", \"quarter\".\r\n * @example\r\n * // Returns \"2 days ago\"\r\n * rtf.format(-2, \"day\")\r\n * // Returns \"in 5 minutes\"\r\n * rtf.format(5, \"minute\")\r\n */\r\n format() {\r\n const [number, unit] = parseFormatArgs(arguments)\r\n return this.getRule(number, unit).replace('{0}', this.formatNumber(Math.abs(number)))\r\n }\r\n\r\n /**\r\n * Formats time `number` in `units` (either in past or in future).\r\n * @param {number} number - Time interval value.\r\n * @param {string} unit - Time interval measurement unit.\r\n * @return {Object[]} The parts (`{ type, value, unit? }`).\r\n * @throws {RangeError} If unit is not one of \"second\", \"minute\", \"hour\", \"day\", \"week\", \"month\", \"quarter\".\r\n * @example\r\n * // Version 1 (deprecated).\r\n * // Returns [\r\n * // { type: \"literal\", value: \"in \" },\r\n * // { type: \"day\", value: \"100\" },\r\n * // { type: \"literal\", value: \" days\" }\r\n * // ]\r\n * rtf.formatToParts(100, \"day\")\r\n * //\r\n * // Version 2.\r\n * // Returns [\r\n * // { type: \"literal\", value: \"in \" },\r\n * // { type: \"integer\", value: \"100\", unit: \"day\" },\r\n * // { type: \"literal\", value: \" days\" }\r\n * // ]\r\n * rtf.formatToParts(100, \"day\")\r\n */\r\n formatToParts() {\r\n const [number, unit] = parseFormatArgs(arguments)\r\n const rule = this.getRule(number, unit)\r\n const valueIndex = rule.indexOf(\"{0}\")\r\n // \"yesterday\"/\"today\"/\"tomorrow\".\r\n if (valueIndex < 0) {\r\n return [{\r\n type: \"literal\",\r\n value: rule\r\n }]\r\n }\r\n let parts = []\r\n if (valueIndex > 0) {\r\n parts.push({\r\n type: \"literal\",\r\n value: rule.slice(0, valueIndex)\r\n })\r\n }\r\n parts = parts.concat(\r\n this.formatNumberToParts(Math.abs(number))\r\n .map(part => ({ ...part, unit }))\r\n )\r\n if (valueIndex + \"{0}\".length < rule.length - 1) {\r\n parts.push({\r\n type: \"literal\",\r\n value: rule.slice(valueIndex + \"{0}\".length)\r\n })\r\n }\r\n return parts\r\n }\r\n\r\n /**\r\n * Returns formatting rule for `value` in `units` (either in past or in future).\r\n * @param {number} value - Time interval value.\r\n * @param {string} unit - Time interval measurement unit.\r\n * @return {string}\r\n * @throws {RangeError} If unit is not one of \"second\", \"minute\", \"hour\", \"day\", \"week\", \"month\", \"quarter\".\r\n * @example\r\n * // Returns \"{0} days ago\"\r\n * getRule(-2, \"day\")\r\n */\r\n getRule(value, unit) {\r\n // Get locale-specific time interval formatting rules\r\n // of a given `style` for the given value of measurement `unit`.\r\n //\r\n // E.g.:\r\n //\r\n // ```json\r\n // {\r\n // \"past\": {\r\n // \"one\": \"a second ago\",\r\n // \"other\": \"{0} seconds ago\"\r\n // },\r\n // \"future\": {\r\n // \"one\": \"in a second\",\r\n // \"other\": \"in {0} seconds\"\r\n // }\r\n // }\r\n // ```\r\n //\r\n const unitMessages = getLocaleData(this.locale)[this.style][unit]\r\n // Bundle size optimization technique for styles like\r\n // \"tiny\" in `javascript-time-ago`: \"1m\", \"2h\", \"3d\"...\r\n if (typeof unitMessages === 'string') {\r\n return unitMessages\r\n }\r\n // Special case for \"yesterday\"/\"today\"/\"tomorrow\".\r\n if (this.numeric === \"auto\") {\r\n // \"yesterday\", \"the day before yesterday\", etc.\r\n if (value === -2 || value === -1) {\r\n const message = unitMessages[`previous${value === -1 ? '' : '-' + Math.abs(value)}`]\r\n if (message) {\r\n return message\r\n }\r\n }\r\n // \"tomorrow\", \"the day after tomorrow\", etc.\r\n else if (value === 1 || value === 2) {\r\n const message = unitMessages[`next${value === 1 ? '' : '-' + Math.abs(value)}`]\r\n if (message) {\r\n return message\r\n }\r\n }\r\n // \"today\"\r\n else if (value === 0) {\r\n if (unitMessages.current) {\r\n return unitMessages.current\r\n }\r\n }\r\n }\r\n // Choose either \"past\" or \"future\" based on time `value` sign.\r\n // If there's only \"other\" then it's being collapsed.\r\n // (the resulting bundle size optimization technique)\r\n const pluralizedMessages = unitMessages[isNegative(value) ? \"past\" : \"future\"]\r\n // Bundle size optimization technique for styles like \"narrow\"\r\n // having messages like \"in {0} d.\" or \"{0} d. ago\".\r\n if (typeof pluralizedMessages === \"string\") {\r\n return pluralizedMessages\r\n }\r\n // Quantify `value`.\r\n // There seems to be no such locale in CLDR\r\n // for which \"plural rules\" function is missing.\r\n const quantifier = this.pluralRules && this.pluralRules.select(Math.abs(value)) || 'other'\r\n // \"other\" rule is supposed to be always present.\r\n // If only \"other\" rule is present then \"rules\" is not an object and is a string.\r\n return pluralizedMessages[quantifier] || pluralizedMessages.other\r\n }\r\n\r\n /**\r\n * Formats a number into a string.\r\n * Uses `Intl.NumberFormat` when available.\r\n * @param {number} number\r\n * @return {string}\r\n */\r\n formatNumber(number) {\r\n return this.numberFormat ? this.numberFormat.format(number) : String(number)\r\n }\r\n\r\n /**\r\n * Formats a number into a list of parts.\r\n * Uses `Intl.NumberFormat` when available.\r\n * @param {number} number\r\n * @return {object[]}\r\n */\r\n formatNumberToParts(number) {\r\n // `Intl.NumberFormat.formatToParts()` is not present, for example,\r\n // in Node.js 8.x while `Intl.NumberFormat` itself is present.\r\n return this.numberFormat && this.numberFormat.formatToParts ?\r\n this.numberFormat.formatToParts(number) :\r\n [{\r\n type: \"integer\",\r\n value: this.formatNumber(number)\r\n }]\r\n }\r\n\r\n /**\r\n * Returns a new object with properties reflecting the locale and date and time formatting options computed during initialization of this DateTimeFormat object.\r\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/resolvedOptions\r\n * @return {Object}\r\n */\r\n resolvedOptions() {\r\n return {\r\n locale: this.locale,\r\n style: this.style,\r\n numeric: this.numeric,\r\n numberingSystem: this.numberingSystem\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Returns an array containing those of the provided locales\r\n * that are supported in collation without having to fall back\r\n * to the runtime's default locale.\r\n * @param {(string|string[])} locale - A string with a BCP 47 language tag, or an array of such strings. For the general form of the locales argument, see the Intl page.\r\n * @param {Object} [options] - An object that may have the following property:\r\n * @param {string} [options.localeMatcher=\"lookup\"] - The locale matching algorithm to use. Possible values are \"lookup\" and \"best fit\". Currently only \"lookup\" is supported.\r\n * @return {string[]} An array of strings representing a subset of the given locale tags that are supported in collation without having to fall back to the runtime's default locale.\r\n * @example\r\n * var locales = ['ban', 'id-u-co-pinyin', 'es-PY']\r\n * var options = { localeMatcher: 'lookup' }\r\n * // Returns [\"id\", \"es-PY\"]\r\n * Intl.RelativeTimeFormat.supportedLocalesOf(locales, options)\r\n */\r\nRelativeTimeFormat.supportedLocalesOf = function(locales, options = {}) {\r\n // Convert `locales` to an array.\r\n if (typeof locales === 'string') {\r\n locales = [locales]\r\n } else if (!Array.isArray(locales)) {\r\n throw new TypeError('Invalid \"locales\" argument')\r\n }\r\n return locales.filter(locale => resolveLocale(locale, options))\r\n}\r\n\r\n/**\r\n * Adds locale data for a specific locale.\r\n * @param {Object} localeData\r\n */\r\nRelativeTimeFormat.addLocale = addLocaleData\r\n\r\n/**\r\n * Sets default locale.\r\n * @param {string} locale\r\n */\r\nRelativeTimeFormat.setDefaultLocale = setDefaultLocale\r\n\r\n/**\r\n * Gets default locale.\r\n * @return {string} locale\r\n */\r\nRelativeTimeFormat.getDefaultLocale = getDefaultLocale\r\n\r\n/**\r\n * Export `Intl.PluralRules` just in case it's used somewhere else.\r\n */\r\nRelativeTimeFormat.PluralRules = PluralRules\r\n\r\n// The specification allows units to be in plural form.\r\n// Convert plural to singular.\r\n// Example: \"seconds\" -> \"second\".\r\nconst UNIT_ERROR = 'Invalid \"unit\" argument'\r\nfunction parseUnit(unit) {\r\n if (typeof unit === 'symbol') {\r\n throw new TypeError(UNIT_ERROR)\r\n }\r\n if (typeof unit !== 'string') {\r\n throw new RangeError(`${UNIT_ERROR}: ${unit}`)\r\n }\r\n if (unit[unit.length - 1] === 's') {\r\n unit = unit.slice(0, unit.length - 1)\r\n }\r\n if (UNITS.indexOf(unit) < 0) {\r\n throw new RangeError(`${UNIT_ERROR}: ${unit}`)\r\n }\r\n return unit\r\n}\r\n\r\n// Converts `value` to a `Number`.\r\n// The specification allows value to be a non-number.\r\n// For example, \"-0\" is supposed to be treated as `-0`.\r\n// Also checks if `value` is a finite number.\r\nconst NUMBER_ERROR = 'Invalid \"number\" argument'\r\nfunction parseNumber(value) {\r\n value = Number(value)\r\n if (Number.isFinite) {\r\n if (!Number.isFinite(value)) {\r\n throw new RangeError(`${NUMBER_ERROR}: ${value}`)\r\n }\r\n }\r\n return value\r\n}\r\n\r\n/**\r\n * Tells `0` from `-0`.\r\n * https://stackoverflow.com/questions/7223359/are-0-and-0-the-same\r\n * @param {number} number\r\n * @return {Boolean}\r\n * @example\r\n * isNegativeZero(0); // false\r\n * isNegativeZero(-0); // true\r\n */\r\nfunction isNegativeZero(number) {\r\n return 1 / number === -Infinity\r\n}\r\n\r\nfunction isNegative(number) {\r\n return number < 0 || number === 0 && isNegativeZero(number)\r\n}\r\n\r\nfunction parseFormatArgs(args) {\r\n if (args.length < 2) {\r\n throw new TypeError(`\"unit\" argument is required`)\r\n }\r\n return [\r\n parseNumber(args[0]),\r\n parseUnit(args[1])\r\n ]\r\n}","/**\r\n * A basic in-memory cache.\r\n *\r\n * import Cache from 'javascript-time-ago/Cache'\r\n * const cache = new Cache()\r\n * const object = cache.get('key1', 'key2', ...) || cache.put('key1', 'key2', ..., createObject())\r\n */\r\nexport default class Cache {\r\n\tconstructor() {\r\n\t\tthis.cache = {}\r\n\t}\r\n\r\n\tget(...keys) {\r\n\t\tlet cache = this.cache\r\n\t\tfor (const key of keys) {\r\n\t\t\tif (typeof cache !== 'object') {\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t\tcache = cache[key]\r\n\t\t}\r\n\t\treturn cache\r\n\t}\r\n\r\n\tput(...keys) {\r\n\t\tconst value = keys.pop()\r\n\t\tconst lastKey = keys.pop()\r\n\t\tlet cache = this.cache\r\n\t\tfor (const key of keys) {\r\n\t\t\tif (typeof cache[key] !== 'object') {\r\n\t\t\t\tcache[key] = {}\r\n\t\t\t}\r\n\t\t\tcache = cache[key]\r\n\t\t}\r\n\t\treturn cache[lastKey] = value\r\n\t}\r\n}","/**\r\n * Chooses the most appropriate locale\r\n * (one of the registered ones)\r\n * based on the list of preferred `locales` supplied by the user.\r\n *\r\n * @param {string[]} locales - the list of preferable locales (in [IETF format](https://en.wikipedia.org/wiki/IETF_language_tag)).\r\n * @param {Function} isLocaleDataAvailable - tests if a locale is available.\r\n *\r\n * @returns {string} The most suitable locale.\r\n *\r\n * @example\r\n * // Returns 'en'\r\n * chooseLocale(['en-US'], undefined, (locale) => locale === 'ru' || locale === 'en')\r\n */\r\nexport default function chooseLocale(locales, isLocaleDataAvailable) {\r\n\t// This is not an intelligent algorithm,\r\n\t// but it will do for this library's case.\r\n\t// `sr-Cyrl-BA` -> `sr-Cyrl` -> `sr`.\r\n\tfor (let locale of locales) {\r\n\t\tif (isLocaleDataAvailable(locale)) {\r\n\t\t\treturn locale\r\n\t\t}\r\n\t\tconst parts = locale.split('-')\r\n\t\twhile (parts.length > 1) {\r\n\t\t\tparts.pop()\r\n\t\t\tlocale = parts.join('-')\r\n\t\t\tif (isLocaleDataAvailable(locale)) {\r\n\t\t\t\treturn locale\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tthrow new Error(`No locale data has been registered for any of the locales: ${locales.join(', ')}`)\r\n}\r\n\r\n/**\r\n * Whether can use `Intl.DateTimeFormat` for these `locales`.\r\n * Returns the first suitable one.\r\n * @param {(string|string[])} locales\r\n * @return {?string} The first locale that can be used.\r\n */\r\nexport function intlDateTimeFormatSupportedLocale(locales) {\r\n\t/* istanbul ignore else */\r\n\tif (intlDateTimeFormatSupported()) {\r\n\t\treturn Intl.DateTimeFormat.supportedLocalesOf(locales)[0]\r\n\t}\r\n}\r\n\r\n/**\r\n * Whether can use `Intl.DateTimeFormat`.\r\n * @return {boolean}\r\n */\r\nexport function intlDateTimeFormatSupported() {\r\n\t// Babel transforms `typeof` into some \"branches\"\r\n\t// so istanbul will show this as \"branch not covered\".\r\n\t/* istanbul ignore next */\r\n\tconst isIntlAvailable = typeof Intl === 'object'\r\n\treturn isIntlAvailable && typeof Intl.DateTimeFormat === 'function'\r\n}\r\n","export default function isStyleObject(object) {\r\n\treturn isObject(object) && (\r\n\t\tArray.isArray(object.steps) ||\r\n\t\t// `gradation` property is deprecated: it has been renamed to `steps`.\r\n\t\tArray.isArray(object.gradation) ||\r\n\t\t// `flavour` property is deprecated: it has been renamed to `labels`.\r\n\t\tArray.isArray(object.flavour) ||\r\n\t\ttypeof object.flavour === 'string' ||\r\n\t\tArray.isArray(object.labels) ||\r\n\t\ttypeof object.labels === 'string' ||\r\n\t\t// `units` property is deprecated.\r\n\t\tArray.isArray(object.units) ||\r\n\t\t// `custom` property is deprecated.\r\n\t\ttypeof object.custom === 'function'\r\n\t)\r\n}\r\n\r\nconst OBJECT_CONSTRUCTOR = {}.constructor\r\nfunction isObject(object) {\r\n\treturn typeof object !== undefined && object !== null && object.constructor === OBJECT_CONSTRUCTOR\r\n}","export const minute = 60 // in seconds\r\n\r\nexport const hour = 60 * minute // in seconds\r\n\r\nexport const day = 24 * hour // in seconds\r\n\r\nexport const week = 7 * day // in seconds\r\n\r\n// https://www.quora.com/What-is-the-average-number-of-days-in-a-month\r\nexport const month = 30.44 * day // in seconds\r\n\r\n// \"400 years have 146097 days (taking into account leap year rules)\"\r\nexport const year = (146097 / 400) * day // in seconds\r\n\r\nexport function getSecondsInUnit(unit) {\r\n\tswitch (unit) {\r\n\t\tcase 'second':\r\n\t\t\treturn 1\r\n\t\tcase 'minute':\r\n\t\t\treturn minute\r\n\t\tcase 'hour':\r\n\t\t\treturn hour\r\n\t\tcase 'day':\r\n\t\t\treturn day\r\n\t\tcase 'week':\r\n\t\t\treturn week\r\n\t\tcase 'month':\r\n\t\t\treturn month\r\n\t\tcase 'year':\r\n\t\t\treturn year\r\n\t}\r\n}\r\n\r\n// export function getPreviousUnitFor(unit) {\r\n// \tswitch (unit) {\r\n// \t\tcase 'second':\r\n// \t\t\treturn 'now'\r\n// \t\tcase 'minute':\r\n// \t\t\treturn 'second'\r\n// \t\tcase 'hour':\r\n// \t\t\treturn 'minute'\r\n// \t\tcase 'day':\r\n// \t\t\treturn 'hour'\r\n// \t\tcase 'week':\r\n// \t\t\treturn 'day'\r\n// \t\tcase 'month':\r\n// \t\t\treturn 'week'\r\n// \t\tcase 'year':\r\n// \t\t\treturn 'month'\r\n// \t}\r\n// }","import { getSecondsInUnit } from './units.js'\r\n\r\nexport default function getStepDenominator(step) {\r\n\t// `factor` is a legacy property.\r\n\tif (step.factor !== undefined) {\r\n\t\treturn step.factor\r\n\t}\r\n\t// \"unit\" is now called \"formatAs\".\r\n\treturn getSecondsInUnit(step.unit || step.formatAs) || 1\r\n}","export function getRoundFunction(round) {\r\n\tswitch (round) {\r\n\t\tcase 'floor':\r\n\t\t\treturn Math.floor\r\n\t\tdefault:\r\n\t\t\treturn Math.round\r\n\t}\r\n}\r\n\r\n// For non-negative numbers.\r\nexport function getDiffRatioToNextRoundedNumber(round) {\r\n\tswitch (round) {\r\n\t\tcase 'floor':\r\n\t\t\t// Math.floor(x) = x\r\n\t\t\t// Math.floor(x + 1) = x + 1\r\n\t\t\treturn 1\r\n\t\tdefault:\r\n\t\t\t// Math.round(x) = x\r\n\t\t\t// Math.round(x + 0.5) = x + 1\r\n\t\t\treturn 0.5\r\n\t}\r\n}","import { getSecondsInUnit } from './units.js'\r\nimport { getDiffRatioToNextRoundedNumber } from '../round.js'\r\n\r\nexport default function getStepMinTime(step, {\r\n\tprevStep,\r\n\ttimestamp,\r\n\t// `now` argument is used in a deprecated `step.test()` function.\r\n\tnow,\r\n\tfuture,\r\n\tround\r\n}) {\r\n\tlet minTime\r\n\t// \"threshold_for_xxx\" is a legacy property.\r\n\tif (prevStep) {\r\n\t\tif (prevStep.id || prevStep.unit) {\r\n\t\t\tminTime = step[`threshold_for_${prevStep.id || prevStep.unit}`]\r\n\t\t}\r\n\t}\r\n\tif (minTime === undefined) {\r\n\t\t// \"threshold\" is a legacy property.\r\n\t\tif (step.threshold !== undefined) {\r\n\t\t\t// \"threshold\" is a legacy name for \"minTime\".\r\n\t\t\tminTime = step.threshold\r\n\t\t\t// \"threshold\" function is deprecated.\r\n\t\t\tif (typeof minTime === 'function') {\r\n\t\t\t\tminTime = minTime(now, future)\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (minTime === undefined) {\r\n\t\tminTime = step.minTime\r\n\t}\r\n\t// A deprecated way of specifying a different threshold\r\n\t// depending on the previous step's unit.\r\n\tif (typeof minTime === 'object') {\r\n\t\tif (prevStep && prevStep.id && minTime[prevStep.id] !== undefined) {\r\n\t\t\tminTime = minTime[prevStep.id]\r\n\t\t} else {\r\n\t\t\tminTime = minTime.default\r\n\t\t}\r\n\t}\r\n\tif (typeof minTime === 'function') {\r\n\t\tminTime = minTime(timestamp, {\r\n\t\t\tfuture,\r\n\t\t\tgetMinTimeForUnit(toUnit, fromUnit) {\r\n\t\t\t\treturn getMinTimeForUnit(\r\n\t\t\t\t\ttoUnit,\r\n\t\t\t\t\tfromUnit || prevStep && prevStep.formatAs,\r\n\t\t\t\t\t{ round }\r\n\t\t\t\t)\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\t// Evaluate the `test()` function.\r\n\t// `test()` function is deprecated.\r\n\tif (minTime === undefined) {\r\n\t\tif (step.test) {\r\n\t\t\tif (step.test(timestamp, {\r\n\t\t\t\tnow,\r\n\t\t\t\tfuture\r\n\t\t\t})) {\r\n\t\t\t\t// `0` threshold always passes.\r\n\t\t\t\tminTime = 0\r\n\t\t\t} else {\r\n\t\t\t\t// `MAX_SAFE_INTEGER` threshold won't ever pass in real life.\r\n\t\t\t\tminTime = 9007199254740991 // Number.MAX_SAFE_INTEGER\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (minTime === undefined) {\r\n\t\tif (prevStep) {\r\n\t\t\tif (step.formatAs && prevStep.formatAs) {\r\n\t\t\t\tminTime = getMinTimeForUnit(step.formatAs, prevStep.formatAs, { round })\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// The first step's `minTime` is `0` by default.\r\n\t\t\tminTime = 0\r\n\t\t}\r\n\t}\r\n\t// Warn if no `minTime` was defined or could be deduced.\r\n\tif (minTime === undefined) {\r\n\t\tconsole.warn('[javascript-time-ago] A step should specify `minTime`:\\n' + JSON.stringify(step, null, 2))\r\n\t}\r\n\treturn minTime\r\n}\r\n\r\nfunction getMinTimeForUnit(toUnit, fromUnit, { round }) {\r\n\tconst toUnitAmount = getSecondsInUnit(toUnit)\r\n\t// if (!fromUnit) {\r\n\t// \treturn toUnitAmount;\r\n\t// }\r\n\t// if (!fromUnit) {\r\n\t// \tfromUnit = getPreviousUnitFor(toUnit)\r\n\t// }\r\n\tlet fromUnitAmount\r\n\tif (fromUnit === 'now') {\r\n\t\tfromUnitAmount = getSecondsInUnit(toUnit)\r\n\t} else {\r\n\t\tfromUnitAmount = getSecondsInUnit(fromUnit)\r\n\t}\r\n\tif (toUnitAmount !== undefined && fromUnitAmount !== undefined) {\r\n\t\treturn toUnitAmount - fromUnitAmount * (1 - getDiffRatioToNextRoundedNumber(round))\r\n\t}\r\n}","import getStepDenominator from './getStepDenominator.js'\r\nimport getStepMinTime from './getStepMinTime.js'\r\nimport { getRoundFunction } from '../round.js'\r\n\r\n/**\r\n * Finds an appropriate `step` of `steps` for the time interval (in seconds).\r\n *\r\n * @param {Object[]} steps - Time formatting steps.\r\n *\r\n * @param {number} secondsPassed - Time interval (in seconds).\r\n * `< 0` for past dates and `> 0` for future dates.\r\n *\r\n * @param {number} options.now - Current timestamp.\r\n *\r\n * @param {boolean} [options.future] - Whether the date should be formatted as a future one\r\n * instead of a past one.\r\n *\r\n * @param {string} [options.round] - (undocumented) Rounding mechanism.\r\n *\r\n * @param {string[]} [options.units] - A list of allowed time units.\r\n * (Example: ['second', 'minute', 'hour', …])\r\n *\r\n * @param {boolean} [options.getNextStep] - Pass true to return `[step, nextStep]` instead of just `step`.\r\n *\r\n * @return {Object|Object[]} [step] — Either a `step` or `[prevStep, step, nextStep]`.\r\n */\r\nexport default function getStep(steps, secondsPassed, { now, future, round, units, getNextStep }) {\r\n\t// Ignore steps having not-supported time units in `formatAs`.\r\n\tsteps = filterStepsByUnits(steps, units)\r\n\tconst step = _getStep(steps, secondsPassed, { now, future, round })\r\n\tif (getNextStep) {\r\n\t\tif (step) {\r\n\t\t\tconst prevStep = steps[steps.indexOf(step) - 1]\r\n\t\t\tconst nextStep = steps[steps.indexOf(step) + 1]\r\n\t\t\treturn [prevStep, step, nextStep]\r\n\t\t}\r\n\t\treturn [undefined, undefined, steps[0]]\r\n\t}\r\n\treturn step\r\n}\r\n\r\nfunction _getStep(steps, secondsPassed, { now, future, round }) {\r\n\t// If no steps fit the conditions then return nothing.\r\n\tif (steps.length === 0) {\r\n\t\treturn\r\n\t}\r\n\r\n\t// Find the most appropriate step.\r\n\tconst i = getStepIndex(steps, secondsPassed, {\r\n\t\tnow,\r\n\t\tfuture: future || secondsPassed < 0,\r\n\t\tround\r\n\t})\r\n\r\n\t// If no step is applicable the return nothing.\r\n\tif (i === -1) {\r\n\t\treturn\r\n\t}\r\n\r\n\tconst step = steps[i]\r\n\r\n\t// Apply granularity to the time amount\r\n\t// (and fall back to the previous step\r\n\t// if the first level of granularity\r\n\t// isn't met by this amount)\r\n\tif (step.granularity) {\r\n\t\t// Recalculate the amount of seconds passed based on `granularity`.\r\n\t\tconst secondsPassedGranular = getRoundFunction(round)((Math.abs(secondsPassed) / getStepDenominator(step)) / step.granularity) * step.granularity\r\n\t\t// If the granularity for this step is too high,\r\n\t\t// then fall back to the previous step.\r\n\t\t// (if there is any previous step)\r\n\t\tif (secondsPassedGranular === 0 && i > 0) {\r\n\t\t\treturn steps[i - 1]\r\n\t\t}\r\n\t}\r\n\r\n\treturn step\r\n}\r\n\r\n/**\r\n * Iterates through steps until it finds the maximum one satisfying the `minTime` threshold.\r\n * @param {Object} steps - Steps.\r\n * @param {number} secondsPassed - How much seconds have passed since the date till `now`.\r\n * @param {number} options.now - Current timestamp.\r\n * @param {boolean} options.future - Whether the time interval should be formatted as a future one.\r\n * @param {number} [i] - Gradation step currently being tested.\r\n * @return {number} Gradation step index.\r\n */\r\nfunction getStepIndex(steps, secondsPassed, options, i = 0) {\r\n\tconst minTime = getStepMinTime(steps[i], {\r\n\t\tprevStep: steps[i - 1],\r\n\t\ttimestamp: options.now - secondsPassed * 1000,\r\n\t\t...options\r\n\t})\r\n\t// If `minTime` isn't defined or deduceable for this step, then stop.\r\n\tif (minTime === undefined) {\r\n\t\treturn i - 1\r\n\t}\r\n\t// If the `minTime` threshold for moving from previous step\r\n\t// to this step is too high then return the previous step.\r\n\tif (Math.abs(secondsPassed) < minTime) {\r\n\t\treturn i - 1\r\n\t}\r\n\t// If it's the last step then return it.\r\n\tif (i === steps.length - 1) {\r\n\t\treturn i\r\n\t}\r\n\t// Move to the next step.\r\n\treturn getStepIndex(steps, secondsPassed, options, i + 1)\r\n}\r\n\r\n/**\r\n * Leaves only allowed steps.\r\n * @param {Object[]} steps\r\n * @param {string[]} units - Allowed time units.\r\n * @return {Object[]}\r\n */\r\nfunction filterStepsByUnits(steps, units) {\r\n\treturn steps.filter(({ unit, formatAs }) => {\r\n\t\t// \"unit\" is now called \"formatAs\".\r\n\t\tunit = unit || formatAs\r\n\t\t// If this step has a `unit` defined\r\n\t\t// then this `unit` must be in the list of allowed `units`.\r\n\t\tif (unit) {\r\n\t\t\treturn units.indexOf(unit) >= 0\r\n\t\t}\r\n\t\t// A step is not required to specify a `unit`:\r\n\t\t// alternatively, it could specify `format()`.\r\n\t\t// (see \"twitter\" style for an example)\r\n\t\treturn true\r\n\t})\r\n}","import { getSecondsInUnit } from './units.js'\r\nimport { getRoundFunction, getDiffRatioToNextRoundedNumber } from '../round.js'\r\n\r\n/**\r\n * Gets the time to next update for a step with a time unit defined.\r\n * @param {string} unit\r\n * @param {number} date — The date passed to `.format()`, converted to a timestamp.\r\n * @param {number} options.now\r\n * @param {string} [options.round] — (undocumented) Rounding mechanism.\r\n * @return {number} [timeToNextUpdate]\r\n */\r\nexport default function getTimeToNextUpdateForUnit(unit, timestamp, { now, round }) {\r\n\t// For some units, like \"now\", there's no defined amount of seconds in them.\r\n\tif (!getSecondsInUnit(unit)) {\r\n\t\t// If there's no amount of seconds defined for this unit\r\n\t\t// then the update interval can't be determined reliably.\r\n\t\treturn\r\n\t}\r\n\tconst unitDenominator = getSecondsInUnit(unit) * 1000\r\n\tconst future = timestamp > now\r\n\tconst preciseAmount = Math.abs(timestamp - now)\r\n\tconst roundedAmount = getRoundFunction(round)(preciseAmount / unitDenominator) * unitDenominator\r\n\tif (future) {\r\n\t\tif (roundedAmount > 0) {\r\n\t\t\t// Amount decreases with time.\r\n\t\t\treturn (preciseAmount - roundedAmount) +\r\n\t\t\t\tgetDiffToPreviousRoundedNumber(round, unitDenominator)\r\n\t\t} else {\r\n\t\t\t// Refresh right after the zero point,\r\n\t\t\t// when \"future\" changes to \"past\".\r\n\t\t\treturn (preciseAmount - roundedAmount) + 1\r\n\t\t}\r\n\t}\r\n \t// Amount increases with time.\r\n\treturn -(preciseAmount - roundedAmount) + getDiffToNextRoundedNumber(round, unitDenominator)\r\n}\r\n\r\nfunction getDiffToNextRoundedNumber(round, unitDenominator) {\r\n\treturn getDiffRatioToNextRoundedNumber(round) * unitDenominator\r\n}\r\n\r\nfunction getDiffToPreviousRoundedNumber(round, unitDenominator) {\r\n\treturn (1 - getDiffRatioToNextRoundedNumber(round)) * unitDenominator + 1\r\n}","import _getTimeToNextUpdateForUnit from './getTimeToNextUpdateForUnit.js'\r\nimport getStepMinTime from './getStepMinTime.js'\r\nimport { getRoundFunction } from '../round.js'\r\n\r\n// A thousand years is practically a metaphor for \"infinity\".\r\nconst YEAR = 365 * 24 * 60 * 60 * 1000\r\nexport const INFINITY = 1000 * YEAR\r\n\r\n/**\r\n * Gets the time to next update for a date and a step.\r\n * @param {number} date — The date passed to `.format()`, converted to a timestamp.\r\n * @param {object} step\r\n * @param {object} [options.previousStep]\r\n * @param {object} [options.nextStep]\r\n * @param {number} options.now\r\n * @param {boolean} options.future\r\n * @param {string} [options.round] - (undocumented) Rounding mechanism.\r\n * @return {number} [timeToNextUpdate]\r\n */\r\nexport default function getTimeToNextUpdate(date, step, { prevStep, nextStep, now, future, round }) {\r\n\tconst timestamp = date.getTime ? date.getTime() : date\r\n\r\n\tconst getTimeToNextUpdateForUnit = (unit) => _getTimeToNextUpdateForUnit(unit, timestamp, { now, round })\r\n\r\n\t// For future dates, steps move from the last one to the first one,\r\n\t// while for past dates, steps move from the first one to the last one,\r\n\t// due to the fact that time flows in one direction,\r\n\t// and future dates' interval naturally becomes smaller\r\n\t// while past dates' interval naturally grows larger.\r\n\t//\r\n\t// For future dates, it's the transition\r\n\t// from the current step to the previous step,\r\n\t// therefore check the `minTime` of the current step.\r\n\t//\r\n\t// For past dates, it's the transition\r\n\t// from the current step to the next step,\r\n\t// therefore check the `minTime` of the next step.\r\n\t//\r\n\tconst timeToStepChange = getTimeToStepChange(future ? step : nextStep, timestamp, {\r\n\t\tfuture,\r\n\t\tnow,\r\n\t\tround,\r\n\t\tprevStep: future ? prevStep : step,\r\n\t\t// isFirstStep: future && isFirstStep\r\n\t})\r\n\r\n\tif (timeToStepChange === undefined) {\r\n\t\t// Can't reliably determine \"time to next update\"\r\n\t\t// if not all of the steps provide `minTime`.\r\n\t\treturn\r\n\t}\r\n\r\n\tlet timeToNextUpdate\r\n\r\n\tif (step) {\r\n\t\tif (step.getTimeToNextUpdate) {\r\n\t\t\ttimeToNextUpdate = step.getTimeToNextUpdate(timestamp, {\r\n\t\t\t\tgetTimeToNextUpdateForUnit,\r\n\t\t\t\tgetRoundFunction,\r\n\t\t\t\tnow,\r\n\t\t\t\tfuture,\r\n\t\t\t\tround\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\tif (timeToNextUpdate === undefined) {\r\n\t\t\t// \"unit\" is now called \"formatAs\".\r\n\t\t\tconst unit = step.unit || step.formatAs\r\n\t\t\tif (unit) {\r\n\t\t\t\t// For some units, like \"now\", there's no defined amount of seconds in them.\r\n\t\t\t\t// In such cases, `getTimeToNextUpdateForUnit()` returns `undefined`,\r\n\t\t\t\t// and the next step's `minTime` could be used to calculate the update interval:\r\n\t\t\t\t// it will just assume that the label never changes for this step.\r\n\t\t\t\ttimeToNextUpdate = getTimeToNextUpdateForUnit(unit)\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif (timeToNextUpdate === undefined) {\r\n\t\treturn timeToStepChange\r\n\t}\r\n\r\n\treturn Math.min(timeToNextUpdate, timeToStepChange)\r\n}\r\n\r\nexport function getStepChangesAt(currentOrNextStep, timestamp, { now, future, round, prevStep }) {\r\n\t// The first step's `minTime` is `0` by default.\r\n\t// It doesn't \"change\" steps at zero point\r\n\t// but it does change the wording when switching\r\n\t// from \"future\" to \"past\": \"in ...\" -> \"... ago\".\r\n\t// Therefore, the label should be updated at zero-point too.\r\n\tconst minTime = getStepMinTime(currentOrNextStep, { timestamp, now, future, round, prevStep })\r\n\tif (minTime === undefined) {\r\n\t\treturn\r\n\t}\r\n\tif (future) {\r\n\t\t// The step changes to the previous step\r\n\t\t// as soon as `timestamp - now` becomes\r\n\t\t// less than the `minTime` of the current step:\r\n\t\t// `timestamp - now === minTime - 1`\r\n\t\t// => `now === timestamp - minTime + 1`.\r\n\t\treturn timestamp - minTime * 1000 + 1\r\n\t} else {\r\n\t\t// The step changes to the next step\r\n\t\t// as soon as `now - timestamp` becomes\r\n\t\t// equal to `minTime` of the next step:\r\n\t\t// `now - timestamp === minTime`\r\n\t\t// => `now === timestamp + minTime`.\r\n\r\n\t\t// This is a special case when double-update could be skipped.\r\n\t\tif (minTime === 0 && timestamp === now) {\r\n\t\t\treturn INFINITY\r\n\t\t}\r\n\r\n\t\treturn timestamp + minTime * 1000\r\n\t}\r\n}\r\n\r\nexport function getTimeToStepChange(step, timestamp, {\r\n\tnow,\r\n\tfuture,\r\n\tround,\r\n\tprevStep\r\n}) {\r\n\tif (step) {\r\n\t\tconst stepChangesAt = getStepChangesAt(step, timestamp, {\r\n\t\t\tnow,\r\n\t\t\tfuture,\r\n\t\t\tround,\r\n\t\t\tprevStep\r\n\t\t})\r\n\t\tif (stepChangesAt === undefined) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\treturn stepChangesAt - now\r\n\t} else {\r\n\t\tif (future) {\r\n\t\t\t// No step.\r\n\t\t\t// Update right after zero point, when it changes from \"future\" to \"past\".\r\n\t\t\treturn timestamp - now + 1\r\n\t\t} else {\r\n\t\t\t// The last step doesn't ever change when `date` is in the past.\r\n\t\t\treturn INFINITY\r\n\t\t}\r\n\t}\r\n}","// For all locales added\r\n// their relative time formatter messages will be stored here.\r\nconst localesData = {}\r\n\r\nexport function getLocaleData(locale) {\r\n\treturn localesData[locale]\r\n}\r\n\r\nexport function addLocaleData(localeData) {\r\n\tif (!localeData) {\r\n\t\tthrow new Error('[javascript-time-ago] No locale data passed.')\r\n\t}\r\n\t// This locale data is stored in a global variable\r\n\t// and later used when calling `.format(time)`.\r\n\tlocalesData[localeData.locale] = localeData\r\n}","// just now\r\n// 1 second ago\r\n// 2 seconds ago\r\n// …\r\n// 59 seconds ago\r\n// 1 minute ago\r\n// 2 minutes ago\r\n// …\r\n// 59 minutes ago\r\n// 1 hour ago\r\n// 2 hours ago\r\n// …\r\n// 24 hours ago\r\n// 1 day ago\r\n// 2 days ago\r\n// …\r\n// 6 days ago\r\n// 1 week ago\r\n// 2 weeks ago\r\n// …\r\n// 3 weeks ago\r\n// 1 month ago\r\n// 2 months ago\r\n// …\r\n// 11 months ago\r\n// 1 year ago\r\n// 2 years ago\r\n// …\r\nexport default [\r\n\t{\r\n\t\tformatAs: 'now'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'second'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'minute'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'hour'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'day'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'week'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'month'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'year'\r\n\t}\r\n]","import round from '../steps/round.js'\r\n\r\n// just now\r\n// 1 second ago\r\n// 2 seconds ago\r\n// …\r\n// 59 seconds ago\r\n// 1 minute ago\r\n// 2 minutes ago\r\n// …\r\n// 59 minutes ago\r\n// 1 minute ago\r\n// 2 minutes ago\r\n// …\r\n// 59 minutes ago\r\n// 1 hour ago\r\n// 2 hours ago\r\n// …\r\n// 24 hours ago\r\n// 1 day ago\r\n// 2 days ago\r\n// …\r\n// 6 days ago\r\n// 1 week ago\r\n// 2 weeks ago\r\n// 3 weeks ago\r\n// 4 weeks ago\r\n// 1 month ago\r\n// 2 months ago\r\n// …\r\n// 11 months ago\r\n// 1 year ago\r\n// 2 years ago\r\n// …\r\n//\r\nexport default {\r\n\tsteps: round,\r\n\tlabels: 'long'\r\n}","import round from './round.js'\r\n\r\n// just now\r\n// 1 minute ago\r\n// 2 minutes ago\r\n// …\r\n// 59 minutes ago\r\n// 1 minute ago\r\n// 2 minutes ago\r\n// …\r\n// 59 minutes ago\r\n// 1 hour ago\r\n// 2 hours ago\r\n// …\r\n// 24 hours ago\r\n// 1 day ago\r\n// 2 days ago\r\n// …\r\n// 6 days ago\r\n// 1 week ago\r\n// 2 weeks ago\r\n// 3 weeks ago\r\n// 4 weeks ago\r\n// 1 month ago\r\n// 2 months ago\r\n// …\r\n// 11 months ago\r\n// 1 year ago\r\n// 2 years ago\r\n// …\r\n//\r\nexport default {\r\n\t...round,\r\n\t// Skip \"seconds\".\r\n\tsteps: round.steps.filter(step => step.formatAs !== 'second')\r\n}","import { minute, hour, day, week, month, year } from './units.js'\r\n\r\n// \"factor\" is a legacy property.\r\n// Developers shouldn't need to use it in their custom steps.\r\n\r\n// \"threshold\" is a legacy name of \"min\".\r\n// Developers should use \"min\" property name instead of \"threshold\".\r\n\r\n// \"threshold_for_idOrUnit: value\" is a legacy way of specifying \"min: { id: value }\".\r\n// Developers should use \"min\" property instead of \"threshold\".\r\n\r\n// just now\r\n// 1 minute ago\r\n// 2 minutes ago\r\n// 5 minutes ago\r\n// 10 minutes ago\r\n// 15 minutes ago\r\n// 20 minutes ago\r\n// …\r\n// 50 minutes ago\r\n// an hour ago\r\n// 2 hours ago\r\n// …\r\n// 20 hours ago\r\n// a day ago\r\n// 2 days ago\r\n// 5 days ago\r\n// a week ago\r\n// 2 weeks ago\r\n// 3 weeks ago\r\n// a month ago\r\n// 2 months ago\r\n// 4 months ago\r\n// a year ago\r\n// 2 years ago\r\n// …\r\nexport default [\r\n\t{\r\n\t\t// This step returns the amount of seconds\r\n\t\t// by dividing the amount of seconds by `1`.\r\n\t\tfactor: 1,\r\n \t// \"now\" labels are used for formatting the output.\r\n\t\tunit: 'now'\r\n\t},\r\n\t{\r\n\t\t// When the language doesn't support `now` unit,\r\n\t\t// the first step is ignored, and it uses this `second` unit.\r\n\t\tthreshold: 1,\r\n\t\t// `threshold_for_now` should be the same as `threshold` on minutes.\r\n\t\tthreshold_for_now: 45.5,\r\n\t\t// This step returns the amount of seconds\r\n\t\t// by dividing the amount of seconds by `1`.\r\n\t\tfactor: 1,\r\n \t// \"second\" labels are used for formatting the output.\r\n\t\tunit: 'second'\r\n\t},\r\n\t{\r\n\t\t// `threshold` should be the same as `threshold_for_now` on seconds.\r\n\t\tthreshold: 45.5,\r\n\t\t// Return the amount of minutes by dividing the amount\r\n\t\t// of seconds by the amount of seconds in a minute.\r\n\t\tfactor: minute,\r\n \t// \"minute\" labels are used for formatting the output.\r\n\t\tunit: 'minute'\r\n\t},\r\n\t{\r\n\t\t// This step is effective starting from 2.5 minutes.\r\n\t\tthreshold: 2.5 * minute,\r\n\t\t// Allow only 5-minute increments of minutes starting from 2.5 minutes.\r\n\t\t// `granularity` — (advanced) Time interval value \"granularity\".\r\n\t\t// For example, it could be set to `5` for minutes to allow only 5-minute increments\r\n\t\t// when formatting time intervals: `0 minutes`, `5 minutes`, `10 minutes`, etc.\r\n\t\t// Perhaps this feature will be removed because there seem to be no use cases\r\n\t\t// of it in the real world.\r\n\t\tgranularity: 5,\r\n\t\t// Return the amount of minutes by dividing the amount\r\n\t\t// of seconds by the amount of seconds in a minute.\r\n\t\tfactor: minute,\r\n\t\t// \"minute\" labels are used for formatting the output.\r\n\t\tunit: 'minute'\r\n\t},\r\n\t{\r\n\t\t// This step is effective starting from 22.5 minutes.\r\n\t\tthreshold: 22.5 * minute,\r\n\t\t// Return the amount of minutes by dividing the amount\r\n\t\t// of seconds by the amount of seconds in half-an-hour.\r\n\t\tfactor: 0.5 * hour,\r\n\t\t// \"half-hour\" labels are used for formatting the output.\r\n\t\t// (if available, which is no longer the case)\r\n\t\tunit: 'half-hour'\r\n\t},\r\n\t{\r\n\t\t// This step is effective starting from 42.5 minutes.\r\n\t\tthreshold: 42.5 * minute,\r\n\t\tthreshold_for_minute: 52.5 * minute,\r\n\t\t// Return the amount of minutes by dividing the amount\r\n\t\t// of seconds by the amount of seconds in an hour.\r\n\t\tfactor: hour,\r\n\t\t// \"hour\" labels are used for formatting the output.\r\n\t\tunit: 'hour'\r\n\t},\r\n\t{\r\n\t\t// This step is effective starting from 20.5 hours.\r\n\t\tthreshold: (20.5 / 24) * day,\r\n\t\t// Return the amount of minutes by dividing the amount\r\n\t\t// of seconds by the amount of seconds in a day.\r\n\t\tfactor: day,\r\n\t\t// \"day\" labels are used for formatting the output.\r\n\t\tunit: 'day'\r\n\t},\r\n\t{\r\n\t\t// This step is effective starting from 5.5 days.\r\n\t\tthreshold: 5.5 * day,\r\n\t\t// Return the amount of minutes by dividing the amount\r\n\t\t// of seconds by the amount of seconds in a week.\r\n\t\tfactor: week,\r\n\t\t// \"week\" labels are used for formatting the output.\r\n\t\tunit: 'week'\r\n\t},\r\n\t{\r\n\t\t// This step is effective starting from 3.5 weeks.\r\n\t\tthreshold: 3.5 * week,\r\n\t\t// Return the amount of minutes by dividing the amount\r\n\t\t// of seconds by the amount of seconds in a month.\r\n\t\tfactor: month,\r\n\t\t// \"month\" labels are used for formatting the output.\r\n\t\tunit: 'month'\r\n\t},\r\n\t{\r\n\t\t// This step is effective starting from 10.5 months.\r\n\t\tthreshold: 10.5 * month,\r\n\t\t// Return the amount of minutes by dividing the amount\r\n\t\t// of seconds by the amount of seconds in a year.\r\n\t\tfactor: year,\r\n\t\t// \"year\" labels are used for formatting the output.\r\n\t\tunit: 'year'\r\n\t}\r\n]","import approximate from '../steps/approximate.js'\r\n\r\n// \"gradation\" is a legacy name for \"steps\".\r\n// It's here just for legacy compatibility.\r\n// Use \"steps\" name instead.\r\n\r\n// \"flavour\" is a legacy name for \"labels\".\r\n// It's here just for legacy compatibility.\r\n// Use \"labels\" name instead.\r\n\r\n// \"units\" is a legacy property.\r\n// It's here just for legacy compatibility.\r\n// Developers shouldn't need to use it in their custom styles.\r\n\r\nexport default {\r\n\tgradation: approximate,\r\n\tflavour: 'long',\r\n\tunits: [\r\n\t\t'now',\r\n\t\t'minute',\r\n\t\t'hour',\r\n\t\t'day',\r\n\t\t'week',\r\n\t\t'month',\r\n\t\t'year'\r\n\t]\r\n}","import approximate from '../steps/approximate.js'\r\n\r\n// \"gradation\" is a legacy name for \"steps\".\r\n// It's here just for legacy compatibility.\r\n// Use \"steps\" name instead.\r\n\r\n// \"flavour\" is a legacy name for \"labels\".\r\n// It's here just for legacy compatibility.\r\n// Use \"labels\" name instead.\r\n\r\n// \"units\" is a legacy property.\r\n// It's here just for legacy compatibility.\r\n// Developers shouldn't need to use it in their custom styles.\r\n\r\n// Similar to the default style but with \"ago\" omitted.\r\n//\r\n// just now\r\n// 5 minutes\r\n// 10 minutes\r\n// 15 minutes\r\n// 20 minutes\r\n// an hour\r\n// 2 hours\r\n// …\r\n// 20 hours\r\n// 1 day\r\n// 2 days\r\n// a week\r\n// 2 weeks\r\n// 3 weeks\r\n// a month\r\n// 2 months\r\n// 3 months\r\n// 4 months\r\n// a year\r\n// 2 years\r\n//\r\nexport default {\r\n\tgradation: approximate,\r\n\tflavour: 'long-time',\r\n\tunits: [\r\n\t\t'now',\r\n\t\t'minute',\r\n\t\t'hour',\r\n\t\t'day',\r\n\t\t'week',\r\n\t\t'month',\r\n\t\t'year'\r\n\t]\r\n}","// Looks like this one's deprecated.\r\n// /**\r\n// * Returns a step corresponding to the unit.\r\n// * @param {Object[]} steps\r\n// * @param {string} unit\r\n// * @return {?Object}\r\n// */\r\n// export function getStepForUnit(steps, unit) {\r\n// \tfor (const step of steps) {\r\n// \t\tif (step.unit === unit) {\r\n// \t\t\treturn step\r\n// \t\t}\r\n// \t}\r\n// }\r\n\r\n// Looks like this one won't be used in the next major version.\r\n/**\r\n * Converts value to a `Date`\r\n * @param {(number|Date)} value\r\n * @return {Date}\r\n */\r\nexport function getDate(value) {\r\n\treturn value instanceof Date ? value : new Date(value)\r\n}","import { day, getDate } from '../steps/index.js'\r\nimport { intlDateTimeFormatSupported } from '../locale.js'\r\n\r\n// For compatibility with the old versions of this library.\r\nimport renameLegacyProperties from './renameLegacyProperties.js'\r\n\r\n// Twitter-style relative date/time formatting.\r\n// (\"1m\", \"2h\", \"Mar 3\", \"Apr 4, 2012\").\r\n//\r\n// Seconds, minutes or hours are shown for shorter intervals,\r\n// and longer intervals are formatted using full date format.\r\n\r\nconst steps = [\r\n\t{\r\n\t\tformatAs: 'second'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'minute'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'hour'\r\n\t}\r\n]\r\n\r\n// A cache for `Intl.DateTimeFormat` formatters\r\n// for various locales (is a global variable).\r\nconst formatters = {}\r\n\r\n// Starting from day intervals, output month and day.\r\nconst monthAndDay = {\r\n\tminTime(timestamp, { future, getMinTimeForUnit }) {\r\n\t\t// Returns `23.5 * 60 * 60` when `round` is \"round\",\r\n\t\t// and `24 * 60 * 60` when `round` is \"floor\".\r\n\t\treturn getMinTimeForUnit('day')\r\n\t},\r\n\tformat(value, locale) {\r\n\t\t/* istanbul ignore else */\r\n\t\tif (!formatters[locale]) {\r\n\t\t\tformatters[locale] = {}\r\n\t\t}\r\n\t\t/* istanbul ignore else */\r\n\t\tif (!formatters[locale].dayMonth) {\r\n\t\t\t// \"Apr 11\" (MMMd)\r\n\t\t\tformatters[locale].dayMonth = new Intl.DateTimeFormat(locale, {\r\n\t\t\t\tmonth: 'short',\r\n\t\t\t\tday: 'numeric'\r\n\t\t\t})\r\n\t\t}\r\n\t\t// Output month and day.\r\n\t\treturn formatters[locale].dayMonth.format(getDate(value))\r\n\t}\r\n}\r\n\r\n// If the `date` happened/happens outside of current year,\r\n// then output day, month and year.\r\n// The interval should be such that the `date` lies outside of the current year.\r\nconst yearMonthAndDay = {\r\n\tminTime(timestamp, { future }) {\r\n\t\tif (future) {\r\n\t\t\t// January 1, 00:00, of the `date`'s year is right after\r\n\t\t\t// the maximum `now` for formatting a future date:\r\n\t\t\t// When `now` is before that date, the `date` is formatted as \"day/month/year\" (this step),\r\n\t\t\t// When `now` is equal to or after that date, the `date` is formatted as \"day/month\" (another step).\r\n\t\t\t// After that, it's hours, minutes, seconds, and after that it's no longer `future`.\r\n\t\t\t// The date is right after the maximum `now` for formatting a future date,\r\n\t\t\t// so subtract 1 millisecond from it.\r\n\t\t\tconst maxFittingNow = new Date(new Date(timestamp).getFullYear(), 0).getTime() - 1\r\n\t\t\t// Return `minTime` (in seconds).\r\n\t\t\treturn (timestamp - maxFittingNow) / 1000\r\n\t\t} else {\r\n\t\t\t// January 1, 00:00, of the year following the `date`'s year\r\n\t\t\t// is the minimum `now` for formatting a past date:\r\n\t\t\t// When `now` is before that date, the `date` is formatted as \"day/month\" (another step),\r\n\t\t\t// When `now` is equal to or after that date, the `date` is formatted as \"day/month/year\" (this step).\r\n\t\t\t// After that, it's hours, minutes, seconds, and after that it's no longer `future`.\r\n\t\t\tconst minFittingNow = new Date(new Date(timestamp).getFullYear() + 1, 0).getTime()\r\n\t\t\t// Return `minTime` (in seconds).\r\n\t\t\treturn (minFittingNow - timestamp) / 1000\r\n\t\t}\r\n\t},\r\n\tformat(value, locale) {\r\n\t\t/* istanbul ignore if */\r\n\t\tif (!formatters[locale]) {\r\n\t\t\tformatters[locale] = {}\r\n\t\t}\r\n\t\t/* istanbul ignore else */\r\n\t\tif (!formatters[locale].dayMonthYear) {\r\n\t\t\t// \"Apr 11, 2017\" (yMMMd)\r\n\t\t\tformatters[locale].dayMonthYear = new Intl.DateTimeFormat(locale, {\r\n\t\t\t\tyear: 'numeric',\r\n\t\t\t\tmonth: 'short',\r\n\t\t\t\tday: 'numeric'\r\n\t\t\t})\r\n\t\t}\r\n\t\t// Output day, month and year.\r\n\t\treturn formatters[locale].dayMonthYear.format(getDate(value))\r\n\t}\r\n}\r\n\r\n// If `Intl.DateTimeFormat` is supported,\r\n// then longer time intervals will be formatted as dates.\r\n/* istanbul ignore else */\r\nif (intlDateTimeFormatSupported()) {\r\n\tsteps.push(monthAndDay, yearMonthAndDay)\r\n}\r\n// Otherwise, if `Intl.DateTimeFormat` is not supported,\r\n// which could be the case when using Internet Explorer,\r\n// then simply mimick \"round\" steps.\r\nelse {\r\n\tsteps.push(\r\n\t\t{\r\n\t\t\tformatAs: 'day'\r\n\t\t},\r\n\t\t{\r\n\t\t\tformatAs: 'week'\r\n\t\t},\r\n\t\t{\r\n\t\t\tformatAs: 'month'\r\n\t\t},\r\n\t\t{\r\n\t\t\tformatAs: 'year'\r\n\t\t}\r\n\t)\r\n}\r\n\r\nexport default {\r\n\tsteps,\r\n\tlabels: [\r\n\t\t// \"mini\" labels are only defined for a few languages.\r\n\t\t'mini',\r\n\t\t// \"short-time\" labels are only defined for a few languages.\r\n\t\t'short-time',\r\n\t\t// \"narrow\" and \"short\" labels are defined for all languages.\r\n\t\t// \"narrow\" labels can sometimes be weird (like \"+5d.\"),\r\n\t\t// but \"short\" labels have the \" ago\" part, so \"narrow\" seem\r\n\t\t// more appropriate.\r\n\t\t// \"short\" labels would have been more appropriate if they\r\n\t\t// didn't have the \" ago\" part, hence the \"short-time\" above.\r\n\t\t'narrow',\r\n\t\t// Since \"narrow\" labels are always present, \"short\" element\r\n\t\t// of this array can be removed.\r\n\t\t'short'\r\n\t]\r\n}","import twitter from './twitter.js'\r\n\r\nexport default {\r\n\t...twitter,\r\n\t// Add \"now\".\r\n\tsteps: [{ formatAs: 'now' }].concat(twitter.steps)\r\n}","import twitter from './twitter.js'\r\n\r\nexport default {\r\n\t...twitter,\r\n\t// Skip \"seconds\".\r\n\tsteps: twitter.steps.filter(step => step.formatAs !== 'second')\r\n}","import twitterMinute from './twitterMinute.js'\r\n\r\nexport default {\r\n\t...twitterMinute,\r\n\t// Add \"now\".\r\n\tsteps: [{ formatAs: 'now' }].concat(twitterMinute.steps)\r\n}","import { minute } from '../steps/units.js'\r\nimport twitter from './twitter.js'\r\n\r\nexport default {\r\n\t...twitter,\r\n\t// Skip \"seconds\".\r\n\tsteps: twitter.steps.filter(step => step.formatAs !== 'second')\r\n\t\t// Start showing `1m` from the first minute.\r\n\t\t.map(step => step.formatAs === 'minute' ? { ...step, minTime: minute } : step)\r\n}","export default {\r\n\tsteps: [\r\n\t\t{\r\n\t\t\tformatAs: 'second'\r\n\t\t},\r\n\t\t{\r\n\t\t\tformatAs: 'minute'\r\n\t\t},\r\n\t\t{\r\n\t\t\tformatAs: 'hour'\r\n\t\t},\r\n\t\t{\r\n\t\t\tformatAs: 'day'\r\n\t\t},\r\n\t\t{\r\n\t\t\tformatAs: 'month'\r\n\t\t},\r\n\t\t{\r\n\t\t\tformatAs: 'year'\r\n\t\t}\r\n\t],\r\n\tlabels: [\r\n\t\t// \"mini\" labels are only defined for a few languages.\r\n\t\t'mini',\r\n\t\t// \"short-time\" labels are only defined for a few languages.\r\n\t\t'short-time',\r\n\t\t// \"narrow\" and \"short\" labels are defined for all languages.\r\n\t\t// \"narrow\" labels can sometimes be weird (like \"+5d.\"),\r\n\t\t// but \"short\" labels have the \" ago\" part, so \"narrow\" seem\r\n\t\t// more appropriate.\r\n\t\t// \"short\" labels would have been more appropriate if they\r\n\t\t// didn't have the \" ago\" part, hence the \"short-time\" above.\r\n\t\t'narrow',\r\n\t\t// Since \"narrow\" labels are always present, \"short\" element\r\n\t\t// of this array can be removed.\r\n\t\t'short'\r\n\t]\r\n}","import mini from './mini.js'\r\n\r\nexport default {\r\n\t...mini,\r\n\t// Add \"now\".\r\n\tsteps: [{ formatAs: 'now' }].concat(mini.steps)\r\n}","import mini from './mini.js'\r\n\r\nexport default {\r\n\t...mini,\r\n\t// Skip \"seconds\".\r\n\tsteps: mini.steps.filter(step => step.formatAs !== 'second')\r\n}","import miniMinute from './miniMinute.js'\r\n\r\nexport default {\r\n\t...miniMinute,\r\n\t// Add \"now\".\r\n\tsteps: [{ formatAs: 'now' }].concat(miniMinute.steps)\r\n}","import RelativeTimeFormatPolyfill from 'relative-time-format'\r\n\r\nimport Cache from './cache.js'\r\nimport chooseLocale from './locale.js'\r\nimport isStyleObject from './isStyleObject.js'\r\n\r\nimport getStep from './steps/getStep.js'\r\nimport getStepDenominator from './steps/getStepDenominator.js'\r\nimport getTimeToNextUpdate from './steps/getTimeToNextUpdate.js'\r\n\r\nimport {\r\n\taddLocaleData,\r\n\tgetLocaleData\r\n} from './LocaleDataStore.js'\r\n\r\nimport defaultStyle from './style/roundMinute.js'\r\nimport getStyleByName from './style/getStyleByName.js'\r\n\r\nimport { getRoundFunction } from './round.js'\r\n\r\n// Valid time units.\r\nconst UNITS = [\r\n\t'now',\r\n\t// The rest are the same as in `Intl.RelativeTimeFormat`.\r\n\t'second',\r\n\t'minute',\r\n\t'hour',\r\n\t'day',\r\n\t'week',\r\n\t'month',\r\n\t'quarter',\r\n\t'year'\r\n]\r\n\r\nexport default class TimeAgo {\r\n\t/**\r\n\t * @param {(string|string[])} locales=[] - Preferred locales (or locale).\r\n\t * @param {boolean} [polyfill] — Pass `false` to use native `Intl.RelativeTimeFormat` and `Intl.PluralRules` instead of the polyfills.\r\n\t */\r\n\tconstructor(locales = [], { polyfill } = {}) {\r\n\t\t// Convert `locales` to an array.\r\n\t\tif (typeof locales === 'string') {\r\n\t\t\tlocales = [locales]\r\n\t\t}\r\n\r\n\t\t// Choose the most appropriate locale\r\n\t\t// from the list of `locales` added by the user.\r\n\t\t// For example, new TimeAgo(\"en-US\") -> \"en\".\r\n\t\tthis.locale = chooseLocale(\r\n\t\t\tlocales.concat(TimeAgo.getDefaultLocale()),\r\n\t\t\tgetLocaleData\r\n\t\t)\r\n\r\n\t\tif (typeof Intl !== 'undefined') {\r\n\t\t\t// Use `Intl.NumberFormat` for formatting numbers (when available).\r\n\t\t\tif (Intl.NumberFormat) {\r\n\t\t\t\tthis.numberFormat = new Intl.NumberFormat(this.locale)\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Some people have requested the ability to use native\r\n\t\t// `Intl.RelativeTimeFormat` and `Intl.PluralRules`\r\n\t\t// instead of the polyfills.\r\n\t\t// https://github.com/catamphetamine/javascript-time-ago/issues/21\r\n\t\tif (polyfill === false) {\r\n\t\t\tthis.IntlRelativeTimeFormat = Intl.RelativeTimeFormat\r\n\t\t\tthis.IntlPluralRules = Intl.PluralRules\r\n\t\t} else {\r\n\t\t\tthis.IntlRelativeTimeFormat = RelativeTimeFormatPolyfill\r\n\t\t\tthis.IntlPluralRules = RelativeTimeFormatPolyfill.PluralRules\r\n\t\t}\r\n\r\n\t\t// Cache `Intl.RelativeTimeFormat` instance.\r\n\t\tthis.relativeTimeFormatCache = new Cache()\r\n\r\n\t\t// Cache `Intl.PluralRules` instance.\r\n\t\tthis.pluralRulesCache = new Cache()\r\n\t}\r\n\r\n\t/**\r\n\t * Formats relative date/time.\r\n\t *\r\n\t * @param {(number|Date)} input — A `Date` or a javascript timestamp.\r\n\t *\r\n\t * @param {(string|object)} style — Date/time formatting style. Either one of the built-in style names or a \"custom\" style definition object having `steps: object[]` and `labels: string[]`.\r\n\t *\r\n\t * @param {number} [options.now] - Sets the current date timestamp.\r\n\t *\r\n\t * @param {boolean} [options.future] — Tells how to format value `0`:\r\n\t * as \"future\" (`true`) or \"past\" (`false`).\r\n\t * Is `false` by default, but should have been `true` actually,\r\n\t * in order to correspond to `Intl.RelativeTimeFormat`\r\n\t * that uses `future` formatting for `0` unless `-0` is passed.\r\n\t *\r\n\t * @param {string} [options.round] — Rounding method. Overrides the style's one.\r\n\t *\r\n\t * @param {boolean} [options.getTimeToNextUpdate] — Pass `true` to return `[formattedDate, timeToNextUpdate]` instead of just `formattedDate`.\r\n\t *\r\n\t * @return {string} The formatted relative date/time. If no eligible `step` is found, then an empty string is returned.\r\n\t */\r\n\tformat(input, style, options) {\r\n\t\tif (!options) {\r\n\t\t\tif (style && !isStyle(style)) {\r\n\t\t\t\toptions = style\r\n\t\t\t\tstyle = undefined\r\n\t\t\t} else {\r\n\t\t\t\toptions = {}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!style) {\r\n\t\t\tstyle = defaultStyle\r\n\t\t}\r\n\r\n\t\tif (typeof style === 'string') {\r\n\t\t\tstyle = getStyleByName(style)\r\n\t\t}\r\n\r\n\t\tconst timestamp = getTimestamp(input)\r\n\r\n\t\t// Get locale messages for this type of labels.\r\n\t\t// \"flavour\" is a legacy name for \"labels\".\r\n\t\tconst { labels, labelsType } = this.getLabels(style.flavour || style.labels)\r\n\r\n\t\tlet now\r\n\t\t// Can pass a custom `now`, e.g. for testing purposes.\r\n\t\t//\r\n\t\t// Legacy way was passing `now` in `style`.\r\n\t\t// That way is deprecated.\r\n\t\tif (style.now !== undefined) {\r\n\t\t\tnow = style.now\r\n\t\t}\r\n\t\t// The new way is passing `now` option to `.format()`.\r\n\t\tif (now === undefined && options.now !== undefined) {\r\n\t\t\tnow = options.now\r\n\t\t}\r\n\t\tif (now === undefined) {\r\n\t\t\tnow = Date.now()\r\n\t\t}\r\n\r\n\t\t// how much time has passed (in seconds)\r\n\t\tconst secondsPassed = (now - timestamp) / 1000 // in seconds\r\n\r\n\t\tconst future = options.future || secondsPassed < 0\r\n\r\n\t\tconst nowLabel = getNowLabel(\r\n\t\t\tlabels,\r\n\t\t\tgetLocaleData(this.locale).now,\r\n\t\t\tgetLocaleData(this.locale).long,\r\n\t\t\tfuture\r\n\t\t)\r\n\r\n\t\t// `custom` – A function of `{ elapsed, time, date, now, locale }`.\r\n\t\t//\r\n\t\t// Looks like `custom` function is deprecated and will be removed\r\n\t\t// in the next major version.\r\n\t\t//\r\n\t\t// If this function returns a value, then the `.format()` call will return that value.\r\n\t\t// Otherwise the relative date/time is formatted as usual.\r\n\t\t// This feature is currently not used anywhere and is here\r\n\t\t// just for providing the ultimate customization point\r\n\t\t// in case anyone would ever need that. Prefer using\r\n\t\t// `steps[step].format(value, locale)` instead.\r\n\t\t//\r\n\t\tif (style.custom) {\r\n\t\t\tconst custom = style.custom({\r\n\t\t\t\tnow,\r\n\t\t\t\tdate: new Date(timestamp),\r\n\t\t\t\ttime: timestamp,\r\n\t\t\t\telapsed: secondsPassed,\r\n\t\t\t\tlocale: this.locale\r\n\t\t\t})\r\n\t\t\tif (custom !== undefined) {\r\n\t\t\t\t// Won't return `timeToNextUpdate` here\r\n\t\t\t\t// because `custom()` seems deprecated.\r\n\t\t\t\treturn custom\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Get the list of available time interval units.\r\n\t\tconst units = getTimeIntervalMeasurementUnits(\r\n\t\t\t// Controlling `style.steps` through `style.units` seems to be deprecated:\r\n\t\t\t// create a new custom `style` instead.\r\n\t\t\tstyle.units,\r\n\t\t\tlabels,\r\n\t\t\tnowLabel\r\n\t\t)\r\n\r\n\t\t// // If no available time unit is suitable, just output an empty string.\r\n\t\t// if (units.length === 0) {\r\n\t\t// \tconsole.error(`None of the \"${units.join(', ')}\" time units have been found in \"${labelsType}\" labels for \"${this.locale}\" locale.`)\r\n\t\t// \treturn ''\r\n\t\t// }\r\n\r\n\t\tconst round = options.round || style.round\r\n\r\n\t\t// Choose the appropriate time measurement unit\r\n\t\t// and get the corresponding rounded time amount.\r\n\t\tconst [prevStep, step, nextStep] = getStep(\r\n\t\t\t// \"gradation\" is a legacy name for \"steps\".\r\n\t\t\t// For historical reasons, \"approximate\" steps are used by default.\r\n\t\t\t// In the next major version, there'll be no default for `steps`.\r\n\t\t\tstyle.gradation || style.steps || defaultStyle.steps,\r\n\t\t\tsecondsPassed,\r\n\t\t\t{ now, units, round, future, getNextStep: true }\r\n\t\t)\r\n\r\n\t\tconst formattedDate = this.formatDateForStep(timestamp, step, secondsPassed, {\r\n\t\t\tlabels,\r\n\t\t\tlabelsType,\r\n\t\t\tnowLabel,\r\n\t\t\tnow,\r\n\t\t\tfuture,\r\n\t\t\tround\r\n\t\t}) || ''\r\n\r\n\t\tif (options.getTimeToNextUpdate) {\r\n\t\t\tconst timeToNextUpdate = getTimeToNextUpdate(timestamp, step, {\r\n\t\t\t\tnextStep,\r\n\t\t\t\tprevStep,\r\n\t\t\t\tnow,\r\n\t\t\t\tfuture,\r\n\t\t\t\tround\r\n\t\t\t})\r\n\t\t\treturn [formattedDate, timeToNextUpdate]\r\n\t\t}\r\n\r\n\t\treturn formattedDate\r\n\t}\r\n\r\n\tformatDateForStep(timestamp, step, secondsPassed, {\r\n\t\tlabels,\r\n\t\tlabelsType,\r\n\t\tnowLabel,\r\n\t\tnow,\r\n\t\tfuture,\r\n\t\tround\r\n\t}) {\r\n\t\t// If no step matches, then output an empty string.\r\n\t\tif (!step) {\r\n\t\t\treturn\r\n\t\t}\r\n\r\n\t\tif (step.format) {\r\n\t\t\treturn step.format(timestamp, this.locale, {\r\n\t\t\t\tformatAs: (unit, value) => {\r\n\t\t\t\t\t// Mimicks `Intl.RelativeTimeFormat.format()`.\r\n\t\t\t\t\treturn this.formatValue(value, unit, {\r\n\t\t\t\t\t\tlabels,\r\n\t\t\t\t\t\tfuture\r\n\t\t\t\t\t})\r\n\t\t\t\t},\r\n\t\t\t\tnow,\r\n\t\t\t\tfuture\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\t// \"unit\" is now called \"formatAs\".\r\n\t\tconst unit = step.unit || step.formatAs\r\n\r\n\t\tif (!unit) {\r\n\t\t\tthrow new Error(`[javascript-time-ago] Each step must define either \\`formatAs\\` or \\`format()\\`. Step: ${JSON.stringify(step)}`)\r\n\t\t}\r\n\r\n\t\t// `Intl.RelativeTimeFormat` doesn't operate in \"now\" units.\r\n\t\t// Therefore, threat \"now\" as a special case.\r\n\t\tif (unit === 'now') {\r\n\t\t\treturn nowLabel\r\n\t\t}\r\n\r\n\t\t// Amount in units.\r\n\t\tlet amount = Math.abs(secondsPassed) / getStepDenominator(step)\r\n\r\n\t\t// Apply granularity to the time amount\r\n\t\t// (and fallback to the previous step\r\n\t\t// if the first level of granularity\r\n\t\t// isn't met by this amount)\r\n\t\t//\r\n\t\t// `granularity` — (advanced) Time interval value \"granularity\".\r\n\t\t// For example, it could be set to `5` for minutes to allow only 5-minute increments\r\n\t\t// when formatting time intervals: `0 minutes`, `5 minutes`, `10 minutes`, etc.\r\n\t\t// Perhaps this feature will be removed because there seem to be no use cases\r\n\t\t// of it in the real world.\r\n\t\t//\r\n\t\tif (step.granularity) {\r\n\t\t\t// Recalculate the amount of seconds passed based on granularity\r\n\t\t\tamount = getRoundFunction(round)(amount / step.granularity) * step.granularity\r\n\t\t}\r\n\r\n\t\tlet valueForFormatting = -1 * Math.sign(secondsPassed) * getRoundFunction(round)(amount)\r\n\r\n\t\t// By default, this library formats a `0` in \"past\" mode,\r\n\t\t// unless `future: true` option is passed.\r\n\t\t// This is different to `relative-time-format`'s behavior\r\n\t\t// which formats a `0` in \"future\" mode by default, unless it's a `-0`.\r\n\t\t// So, convert `0` to `-0` if `future: true` option wasn't passed.\r\n\t\t// `=== 0` matches both `0` and `-0`.\r\n\t\tif (valueForFormatting === 0) {\r\n\t\t\tif (future) {\r\n\t\t\t\tvalueForFormatting = 0\r\n\t\t\t} else {\r\n\t\t\t\tvalueForFormatting = -0\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tswitch (labelsType) {\r\n\t\t\tcase 'long':\r\n\t\t\tcase 'short':\r\n\t\t\tcase 'narrow':\r\n\t\t\t\t// Format the amount using `Intl.RelativeTimeFormat`.\r\n\t\t\t\treturn this.getFormatter(labelsType).format(valueForFormatting, unit)\r\n\t\t\tdefault:\r\n\t\t\t\t// Format the amount.\r\n\t\t\t\t// (mimicks `Intl.RelativeTimeFormat` behavior for other time label styles)\r\n\t\t\t\treturn this.formatValue(valueForFormatting, unit, {\r\n\t\t\t\t\tlabels,\r\n\t\t\t\t\tfuture\r\n\t\t\t\t})\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Mimicks what `Intl.RelativeTimeFormat` does for additional locale styles.\r\n\t * @param {number} value\r\n\t * @param {string} unit\r\n\t * @param {object} options.labels — Relative time labels.\r\n\t * @param {boolean} [options.future] — Tells how to format value `0`: as \"future\" (`true`) or \"past\" (`false`). Is `false` by default, but should have been `true` actually.\r\n\t * @return {string}\r\n\t */\r\n\tformatValue(value, unit, { labels, future }) {\r\n\t\treturn this.getFormattingRule(labels, unit, value, { future })\r\n\t\t\t.replace('{0}', this.formatNumber(Math.abs(value)))\r\n\t}\r\n\r\n\t/**\r\n\t * Returns formatting rule for `value` in `units` (either in past or in future).\r\n\t * @param {object} formattingRules — Relative time labels for different units.\r\n\t * @param {string} unit - Time interval measurement unit.\r\n\t * @param {number} value - Time interval value.\r\n\t * @param {boolean} [options.future] — Tells how to format value `0`: as \"future\" (`true`) or \"past\" (`false`). Is `false` by default.\r\n\t * @return {string}\r\n\t * @example\r\n\t * // Returns \"{0} days ago\"\r\n\t * getFormattingRule(en.long, \"day\", -2, 'en')\r\n\t */\r\n\tgetFormattingRule(formattingRules, unit, value, { future }) {\r\n\t\t// Passing the language is required in order to\r\n\t\t// be able to correctly classify the `value` as a number.\r\n\t\tconst locale = this.locale\r\n\t\tformattingRules = formattingRules[unit]\r\n\t\t// Check for a special \"compacted\" rules case:\r\n\t\t// if formatting rules are the same for \"past\" and \"future\",\r\n\t\t// and also for all possible `value`s, then those rules are\r\n\t\t// stored as a single string.\r\n\t\tif (typeof formattingRules === 'string') {\r\n\t\t\treturn formattingRules\r\n\t\t}\r\n\t\t// Choose either \"past\" or \"future\" based on time `value` sign.\r\n\t\t// If \"past\" is same as \"future\" then they're stored as \"other\".\r\n\t\t// If there's only \"other\" then it's being collapsed.\r\n\t\tconst pastOrFuture = value === 0 ? (future ? 'future' : 'past') : (value < 0 ? 'past' : 'future')\r\n\t\tconst quantifierRules = formattingRules[pastOrFuture] || formattingRules\r\n\t\t// Bundle size optimization technique.\r\n\t\tif (typeof quantifierRules === 'string') {\r\n\t\t\treturn quantifierRules\r\n\t\t}\r\n\t\t// Quantify `value`.\r\n\t\tconst quantifier = this.getPluralRules().select(Math.abs(value))\r\n\t\t// \"other\" rule is supposed to always be present.\r\n\t\t// If only \"other\" rule is present then \"rules\" is not an object and is a string.\r\n\t\treturn quantifierRules[quantifier] || quantifierRules.other\r\n\t}\r\n\r\n\t/**\r\n\t * Formats a number into a string.\r\n\t * Uses `Intl.NumberFormat` when available.\r\n\t * @param {number} number\r\n\t * @return {string}\r\n\t */\r\n\tformatNumber(number) {\r\n\t\treturn this.numberFormat ? this.numberFormat.format(number) : String(number)\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an `Intl.RelativeTimeFormat` for a given `labelsType`.\r\n\t * @param {string} labelsType\r\n\t * @return {object} `Intl.RelativeTimeFormat` instance\r\n\t */\r\n\tgetFormatter(labelsType) {\r\n\t\t// `Intl.RelativeTimeFormat` instance creation is (hypothetically) assumed\r\n\t\t// a lengthy operation so the instances are cached and reused.\r\n\t\treturn this.relativeTimeFormatCache.get(this.locale, labelsType) ||\r\n\t\t\tthis.relativeTimeFormatCache.put(this.locale, labelsType, new this.IntlRelativeTimeFormat(this.locale, { style: labelsType }))\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an `Intl.PluralRules` instance.\r\n\t * @return {object} `Intl.PluralRules` instance\r\n\t */\r\n\tgetPluralRules() {\r\n\t\t// `Intl.PluralRules` instance creation is (hypothetically) assumed\r\n\t\t// a lengthy operation so the instances are cached and reused.\r\n\t\treturn this.pluralRulesCache.get(this.locale) ||\r\n\t\t\tthis.pluralRulesCache.put(this.locale, new this.IntlPluralRules(this.locale))\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Gets localized labels for this type of labels.\r\n\t *\r\n\t * @param {(string|string[])} labelsType - Relative date/time labels type.\r\n\t * If it's an array then all label types are tried\r\n\t * until a suitable one is found.\r\n\t *\r\n\t * @returns {Object} Returns an object of shape { labelsType, labels }\r\n\t */\r\n\tgetLabels(labelsType = []) {\r\n\t\t// Convert `labels` to an array.\r\n\t\tif (typeof labelsType === 'string') {\r\n\t\t\tlabelsType = [labelsType]\r\n\t\t}\r\n\r\n\t\t// Supports legacy \"tiny\" and \"mini-time\" label styles.\r\n\t\tlabelsType = labelsType.map((labelsType) => {\r\n\t\t\tswitch (labelsType) {\r\n\t\t\t\tcase 'tiny':\r\n\t\t\t\tcase 'mini-time':\r\n\t\t\t\t\treturn 'mini'\r\n\t\t\t\tdefault:\r\n\t\t\t\t\treturn labelsType\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\t// \"long\" labels type is the default one.\r\n\t\t// (it's always present for all languages)\r\n\t\tlabelsType = labelsType.concat('long')\r\n\r\n\t\t// Find a suitable labels type.\r\n\t\tconst localeData = getLocaleData(this.locale)\r\n\t\tfor (const _labelsType of labelsType) {\r\n\t\t\tif (localeData[_labelsType]) {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tlabelsType: _labelsType,\r\n\t\t\t\t\tlabels: localeData[_labelsType]\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Default locale global variable.\r\n */\r\nlet defaultLocale = 'en'\r\n\r\n/**\r\n * Gets default locale.\r\n * @return {string} locale\r\n */\r\nTimeAgo.getDefaultLocale = () => defaultLocale\r\n\r\n/**\r\n * Sets default locale.\r\n * @param {string} locale\r\n */\r\nTimeAgo.setDefaultLocale = (locale) => defaultLocale = locale\r\n\r\n/**\r\n * Adds locale data for a specific locale and marks the locale as default.\r\n * @param {Object} localeData\r\n */\r\nTimeAgo.addDefaultLocale = function(localeData) {\r\n\tif (defaultLocaleHasBeenSpecified) {\r\n\t\treturn console.error('[javascript-time-ago] `TimeAgo.addDefaultLocale()` can only be called once. To add other locales, use `TimeAgo.addLocale()`.')\r\n\t}\r\n\tdefaultLocaleHasBeenSpecified = true\r\n\tTimeAgo.setDefaultLocale(localeData.locale)\r\n\tTimeAgo.addLocale(localeData)\r\n}\r\n\r\nlet defaultLocaleHasBeenSpecified\r\n\r\n/**\r\n * Adds locale data for a specific locale.\r\n * @param {Object} localeData\r\n */\r\nTimeAgo.addLocale = function(localeData) {\r\n\taddLocaleData(localeData)\r\n\tRelativeTimeFormatPolyfill.addLocale(localeData)\r\n}\r\n\r\n/**\r\n * (legacy alias)\r\n * Adds locale data for a specific locale.\r\n * @param {Object} localeData\r\n * @deprecated\r\n */\r\nTimeAgo.locale = TimeAgo.addLocale\r\n\r\n/**\r\n * Adds custom labels to locale data.\r\n * @param {string} locale\r\n * @param {string} name\r\n * @param {object} labels\r\n */\r\nTimeAgo.addLabels = (locale, name, labels) => {\r\n\tlet localeData = getLocaleData(locale)\r\n\tif (!localeData) {\r\n\t\taddLocaleData({\r\n\t\t\tlocale\r\n\t\t})\r\n\t\tlocaleData = getLocaleData(locale)\r\n\t\t// throw new Error(`[javascript-time-ago] No data for locale \"${locale}\"`)\r\n\t}\r\n\tlocaleData[name] = labels\r\n}\r\n\r\n// Normalizes `.format()` `time` argument.\r\nfunction getTimestamp(input) {\r\n\tif (input.constructor === Date || isMockedDate(input)) {\r\n\t\treturn input.getTime()\r\n\t}\r\n\r\n\tif (typeof input === 'number') {\r\n\t\treturn input\r\n\t}\r\n\r\n\t// For some weird reason istanbul doesn't see this `throw` covered.\r\n\t/* istanbul ignore next */\r\n\tthrow new Error(`Unsupported relative time formatter input: ${typeof input}, ${input}`)\r\n}\r\n\r\n// During testing via some testing libraries `Date`s aren't actually `Date`s.\r\n// https://github.com/catamphetamine/javascript-time-ago/issues/22\r\nfunction isMockedDate(object) {\r\n\treturn typeof object === 'object' && typeof object.getTime === 'function'\r\n}\r\n\r\n// Get available time interval measurement units.\r\nfunction getTimeIntervalMeasurementUnits(allowedUnits, labels, nowLabel) {\r\n\t// Get all time interval measurement units that're available\r\n\t// in locale data for a given time labels style.\r\n\tlet units = Object.keys(labels)\r\n\r\n\t// `now` unit is handled separately and is shipped in its own `now.json` file.\r\n\t// `now.json` isn't present for all locales, so it could be substituted with\r\n\t// \".second.current\".\r\n\t// Add `now` unit if it's available in locale data.\r\n\tif (nowLabel) {\r\n\t\tunits.push('now')\r\n\t}\r\n\r\n\t// If only a specific set of available time measurement units can be used\r\n\t// then only those units are allowed (if they're present in locale data).\r\n\tif (allowedUnits) {\r\n\t\tunits = allowedUnits.filter(unit => unit === 'now' || units.indexOf(unit) >= 0)\r\n\t}\r\n\r\n\treturn units\r\n}\r\n\r\nfunction getNowLabel(labels, nowLabels, longLabels, future) {\r\n\tconst nowLabel = labels.now || (nowLabels && nowLabels.now)\r\n\t// Specific \"now\" message form extended locale data (if present).\r\n\tif (nowLabel) {\r\n\t\t// Bundle size optimization technique.\r\n\t\tif (typeof nowLabel === 'string') {\r\n\t\t\treturn nowLabel\r\n\t\t}\r\n\t\t// Not handling `value === 0` as `localeData.now.current` here\r\n\t\t// because it wouldn't make sense: \"now\" is a moment,\r\n\t\t// so one can't possibly differentiate between a\r\n\t\t// \"previous\" moment, a \"current\" moment and a \"next moment\".\r\n\t\t// It can only be differentiated between \"past\" and \"future\".\r\n\t\tif (future) {\r\n\t\t\treturn nowLabel.future\r\n\t\t} else {\r\n\t\t\treturn nowLabel.past\r\n\t\t}\r\n\t}\r\n\t// Use \".second.current\" as \"now\" message.\r\n\tif (longLabels && longLabels.second && longLabels.second.current) {\r\n\t\treturn longLabels.second.current\r\n\t}\r\n}\r\n\r\nfunction isStyle(variable) {\r\n\treturn typeof variable === 'string' || isStyleObject(variable)\r\n}","import round from './round.js'\r\nimport roundMinute from './roundMinute.js'\r\n// `approximate` style is deprecated.\r\nimport approximate from './approximate.js'\r\n// `approximateTime` style is deprecated.\r\nimport approximateTime from './approximateTime.js'\r\nimport twitter from './twitter.js'\r\nimport twitterNow from './twitterNow.js'\r\nimport twitterMinute from './twitterMinute.js'\r\nimport twitterMinuteNow from './twitterMinuteNow.js'\r\nimport twitterFirstMinute from './twitterFirstMinute.js'\r\nimport mini from './mini.js'\r\nimport miniNow from './miniNow.js'\r\nimport miniMinute from './miniMinute.js'\r\nimport miniMinuteNow from './miniMinuteNow.js'\r\n\r\nexport default function getStyleByName(style) {\r\n\tswitch (style) {\r\n\t\t// \"default\" style name is deprecated.\r\n\t\tcase 'default':\r\n\t\tcase 'round':\r\n\t\t\treturn round\r\n\t\tcase 'round-minute':\r\n\t\t\treturn roundMinute\r\n\t\tcase 'approximate':\r\n\t\t\treturn approximate\r\n\t\t// \"time\" style name is deprecated.\r\n\t\tcase 'time':\r\n\t\tcase 'approximate-time':\r\n\t\t\treturn approximateTime\r\n\t\tcase 'mini':\r\n\t\t\treturn mini\r\n\t\tcase 'mini-now':\r\n\t\t\treturn miniNow\r\n\t\tcase 'mini-minute':\r\n\t\t\treturn miniMinute\r\n\t\tcase 'mini-minute-now':\r\n\t\t\treturn miniMinuteNow\r\n\t\tcase 'twitter':\r\n\t\t\treturn twitter\r\n\t\tcase 'twitter-now':\r\n\t\t\treturn twitterNow\r\n\t\tcase 'twitter-minute':\r\n\t\t\treturn twitterMinute\r\n\t\tcase 'twitter-minute-now':\r\n\t\t\treturn twitterMinuteNow\r\n\t\tcase 'twitter-first-minute':\r\n\t\t\treturn twitterFirstMinute\r\n\t\tdefault:\r\n\t\t\t// For historical reasons, the default style is \"approximate\".\r\n\t\t\treturn approximate\r\n\t}\r\n}"],"names":["defaultLocale","localesData","lowercaseLocaleLookup","getDefaultLocale","resolveLocale","locale","toLowerCase","localeMatcher","arguments","length","undefined","resolveLocaleLookup","RangeError","concat","resolvedLocale","resolveLocaleForData","parts","split","pop","_resolvedLocale","join","$","af","n","am","ar","s","String","n100","Number","slice","ast","v0","be","t0","n10","br","n1000000","bs","i","f","i10","i100","f10","f100","ca","i1000000","ceb","cs","cy","da","dsb","dz","es","ff","fr","ga","gd","he","is","t","replace","ksh","lt","lv","v","mk","mt","pa","pl","pt","ro","ru","se","si","sl","as","az","bg","bn","brx","ce","chr","de","ee","el","en","et","eu","fa","fi","fil","fo","fur","fy","gl","gu","ha","hi","hr","hsb","hu","hy","ia","id","ig","it","ja","jgo","jv","ka","kea","kk","kl","km","kn","ko","ks","ku","ky","lb","lkt","lo","ml","mn","mr","ms","my","nb","ne","nl","nn","no","or","pcm","ps","rm","sah","sc","sd","sk","so","sq","sr","su","sv","sw","ta","te","th","ti","tk","to","tr","ug","uk","ur","uz","vi","wae","wo","xh","yi","yo","yue","zh","zu","getPluralRulesLocale","languageTag","match","LANGUAGE_REG_EXP","TypeError","getLanguageFromLanguageTag","PluralRules","options","_classCallCheck","locales","supportedLocalesOf","type","this","PluralRuleFunctions","filter","number","UNITS","NUMERIC_VALUES","STYLE_VALUES","LOCALE_MATCHER_VALUES","RelativeTimeFormat","numeric","style","indexOf","push","Error","pluralRules","console","warn","Intl","NumberFormat","numberFormat","numberingSystem","resolvedOptions","_parseFormatArgs2","_slicedToArray","parseFormatArgs","unit","getRule","formatNumber","Math","abs","_parseFormatArgs4","rule","valueIndex","value","formatNumberToParts","map","part","_objectSpread","unitMessages","message","_message","current","pluralizedMessages","isNegativeZero","select","other","format","formatToParts","Array","isArray","addLocale","localeData","setDefaultLocale","UNIT_ERROR","parseUnit","_typeof","NUMBER_ERROR","parseNumber","isFinite","args","Cache","cache","_len","keys","_key","_i","_keys","key","_len2","_key2","lastKey","_i2","_keys2","intlDateTimeFormatSupportedLocale","intlDateTimeFormatSupported","DateTimeFormat","isStyleObject","object","constructor","OBJECT_CONSTRUCTOR","isObject","steps","gradation","flavour","labels","units","custom","minute","hour","day","week","month","year","getSecondsInUnit","getStepDenominator","step","factor","formatAs","getRoundFunction","round","floor","getDiffRatioToNextRoundedNumber","getStepMinTime","_ref","minTime","prevStep","timestamp","now","future","threshold","getMinTimeForUnit","toUnit","fromUnit","_getMinTimeForUnit","test","JSON","stringify","_ref2","fromUnitAmount","toUnitAmount","getStep","secondsPassed","getNextStep","_ref3","filterStepsByUnits","getStepIndex","granularity","_getStep","getTimeToNextUpdateForUnit","unitDenominator","preciseAmount","roundedAmount","getDiffToPreviousRoundedNumber","getDiffToNextRoundedNumber","INFINITY","getTimeToNextUpdate","date","nextStep","getTime","_getTimeToNextUpdateForUnit","timeToStepChange","stepChangesAt","currentOrNextStep","getStepChangesAt","getTimeToStepChange","timeToNextUpdate","min","getLocaleData","addLocaleData","threshold_for_now","threshold_for_minute","approximate","getDate","Date","formatters","monthAndDay","dayMonth","yearMonthAndDay","getFullYear","dayMonthYear","twitter","twitterMinute","mini","miniMinute","defaultLocaleHasBeenSpecified","TimeAgo","polyfill","isLocaleDataAvailable","_step","_iterator","_createForOfIteratorHelperLoose","done","chooseLocale","IntlRelativeTimeFormat","IntlPluralRules","RelativeTimeFormatPolyfill","relativeTimeFormatCache","pluralRulesCache","input","variable","defaultStyle","roundMinute","approximateTime","miniNow","miniMinuteNow","twitterNow","twitterMinuteNow","twitterFirstMinute","getStyleByName","getTimestamp","_this$getLabels","getLabels","labelsType","nowLabel","nowLabels","longLabels","past","second","getNowLabel","time","elapsed","allowedUnits","Object","getTimeIntervalMeasurementUnits","_getStep2","formattedDate","formatDateForStep","_this","formatValue","amount","valueForFormatting","sign","getFormatter","getFormattingRule","formattingRules","_ref4","quantifierRules","getPluralRules","get","put","_labelsType","addDefaultLocale","error","addLabels","name"],"sourceRoot":""}