Socket
Socket
Sign inDemoInstall

javascript-time-ago

Package Overview
Dependencies
1
Maintainers
1
Versions
119
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.3.7 to 2.3.8

2

bundle/javascript-time-ago.js

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).TimeAgo={})}(this,(function(t){"use strict";var e="en",r={},n={};function o(){return e}function a(t){return r[t]?t:n[t.toLowerCase()]?n[t.toLowerCase()]:void 0}function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.localeMatcher||"lookup";switch(r){case"lookup":case"best fit":return u(t);default:throw new RangeError('Invalid "localeMatcher" option: '.concat(r))}}function u(t){var e=a(t);if(e)return e;for(var r=t.split("-");t.length>1;){r.pop();var n=a(t=r.join("-"));if(n)return n}}var l={af:function(t){return 1==t?"one":"other"},am:function(t){return t>=0&&t<=1?"one":"other"},ar:function(t){var e=String(t).split("."),r=Number(e[0])==t&&e[0].slice(-2);return 0==t?"zero":1==t?"one":2==t?"two":r>=3&&r<=10?"few":r>=11&&r<=99?"many":"other"},ast:function(t){var e=!String(t).split(".")[1];return 1==t&&e?"one":"other"},be:function(t){var e=String(t).split("."),r=Number(e[0])==t,n=r&&e[0].slice(-1),o=r&&e[0].slice(-2);return 1==n&&11!=o?"one":n>=2&&n<=4&&(o<12||o>14)?"few":r&&0==n||n>=5&&n<=9||o>=11&&o<=14?"many":"other"},br:function(t){var e=String(t).split("."),r=Number(e[0])==t,n=r&&e[0].slice(-1),o=r&&e[0].slice(-2),a=r&&e[0].slice(-6);return 1==n&&11!=o&&71!=o&&91!=o?"one":2==n&&12!=o&&72!=o&&92!=o?"two":(3==n||4==n||9==n)&&(o<10||o>19)&&(o<70||o>79)&&(o<90||o>99)?"few":0!=t&&r&&0==a?"many":"other"},bs:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",o=!e[1],a=r.slice(-1),i=r.slice(-2),u=n.slice(-1),l=n.slice(-2);return o&&1==a&&11!=i||1==u&&11!=l?"one":o&&a>=2&&a<=4&&(i<12||i>14)||u>=2&&u<=4&&(l<12||l>14)?"few":"other"},cs:function(t){var e=String(t).split("."),r=e[0],n=!e[1];return 1==t&&n?"one":r>=2&&r<=4&&n?"few":n?"other":"many"},cy:function(t){return 0==t?"zero":1==t?"one":2==t?"two":3==t?"few":6==t?"many":"other"},da:function(t){var e=String(t).split("."),r=e[0],n=Number(e[0])==t;return 1!=t&&(n||0!=r&&1!=r)?"other":"one"},dsb:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",o=!e[1],a=r.slice(-2),i=n.slice(-2);return o&&1==a||1==i?"one":o&&2==a||2==i?"two":o&&(3==a||4==a)||3==i||4==i?"few":"other"},dz:function(t){return"other"},fil:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",o=!e[1],a=r.slice(-1),i=n.slice(-1);return o&&(1==r||2==r||3==r)||o&&4!=a&&6!=a&&9!=a||!o&&4!=i&&6!=i&&9!=i?"one":"other"},fr:function(t){return t>=0&&t<2?"one":"other"},ga:function(t){var e=String(t).split("."),r=Number(e[0])==t;return 1==t?"one":2==t?"two":r&&t>=3&&t<=6?"few":r&&t>=7&&t<=10?"many":"other"},gd:function(t){var e=String(t).split("."),r=Number(e[0])==t;return 1==t||11==t?"one":2==t||12==t?"two":r&&t>=3&&t<=10||r&&t>=13&&t<=19?"few":"other"},he:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=Number(e[0])==t,a=o&&e[0].slice(-1);return 1==t&&n?"one":2==r&&n?"two":n&&(t<0||t>10)&&o&&0==a?"many":"other"},is:function(t){var e=String(t).split("."),r=e[0],n=Number(e[0])==t,o=r.slice(-1),a=r.slice(-2);return n&&1==o&&11!=a||!n?"one":"other"},ksh:function(t){return 0==t?"zero":1==t?"one":"other"},lt:function(t){var e=String(t).split("."),r=e[1]||"",n=Number(e[0])==t,o=n&&e[0].slice(-1),a=n&&e[0].slice(-2);return 1==o&&(a<11||a>19)?"one":o>=2&&o<=9&&(a<11||a>19)?"few":0!=r?"many":"other"},lv:function(t){var e=String(t).split("."),r=e[1]||"",n=r.length,o=Number(e[0])==t,a=o&&e[0].slice(-1),i=o&&e[0].slice(-2),u=r.slice(-2),l=r.slice(-1);return o&&0==a||i>=11&&i<=19||2==n&&u>=11&&u<=19?"zero":1==a&&11!=i||2==n&&1==l&&11!=u||2!=n&&1==l?"one":"other"},mk:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",o=!e[1],a=r.slice(-1),i=r.slice(-2),u=n.slice(-1),l=n.slice(-2);return o&&1==a&&11!=i||1==u&&11!=l?"one":"other"},mt:function(t){var e=String(t).split("."),r=Number(e[0])==t&&e[0].slice(-2);return 1==t?"one":0==t||r>=2&&r<=10?"few":r>=11&&r<=19?"many":"other"},pa:function(t){return 0==t||1==t?"one":"other"},pl:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=r.slice(-1),a=r.slice(-2);return 1==t&&n?"one":n&&o>=2&&o<=4&&(a<12||a>14)?"few":n&&1!=r&&(0==o||1==o)||n&&o>=5&&o<=9||n&&a>=12&&a<=14?"many":"other"},pt:function(t){var e=String(t).split(".")[0];return 0==e||1==e?"one":"other"},ro:function(t){var e=String(t).split("."),r=!e[1],n=Number(e[0])==t&&e[0].slice(-2);return 1==t&&r?"one":!r||0==t||1!=t&&n>=1&&n<=19?"few":"other"},ru:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=r.slice(-1),a=r.slice(-2);return n&&1==o&&11!=a?"one":n&&o>=2&&o<=4&&(a<12||a>14)?"few":n&&0==o||n&&o>=5&&o<=9||n&&a>=11&&a<=14?"many":"other"},se:function(t){return 1==t?"one":2==t?"two":"other"},si:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"";return 0==t||1==t||0==r&&1==n?"one":"other"},sl:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=r.slice(-2);return n&&1==o?"one":n&&2==o?"two":n&&(3==o||4==o)||!n?"few":"other"}};function f(t){return"pt-PT"===t?t:function(t){var e=t.match(c);if(!e)throw new TypeError("Invalid locale: ".concat(t));return e[1]}(t)}l.as=l.am,l.az=l.af,l.bg=l.af,l.bn=l.am,l.ca=l.ast,l.ce=l.af,l.chr=l.af,l.de=l.ast,l.ee=l.af,l.el=l.af,l.en=l.ast,l.es=l.af,l.et=l.ast,l.eu=l.af,l.fa=l.am,l.fi=l.ast,l.fo=l.af,l.fur=l.af,l.fy=l.ast,l.gl=l.ast,l.gu=l.am,l.hi=l.am,l.hr=l.bs,l.hsb=l.dsb,l.hu=l.af,l.hy=l.fr,l.ia=l.ast,l.id=l.dz,l.it=l.ast,l.ja=l.dz,l.jgo=l.af,l.jv=l.dz,l.ka=l.af,l.kea=l.dz,l.kk=l.af,l.kl=l.af,l.km=l.dz,l.kn=l.am,l.ko=l.dz,l.ku=l.af,l.ky=l.af,l.lb=l.af,l.lkt=l.dz,l.lo=l.dz,l.ml=l.af,l.mn=l.af,l.mr=l.am,l.ms=l.dz,l.my=l.dz,l.nb=l.af,l.ne=l.af,l.nl=l.ast,l.nn=l.af,l.or=l.af,l.ps=l.af,l["pt-PT"]=l.ast,l.sah=l.dz,l.sd=l.af,l.sk=l.cs,l.so=l.af,l.sq=l.af,l.sr=l.bs,l.sv=l.ast,l.sw=l.ast,l.ta=l.af,l.te=l.af,l.th=l.dz,l.ti=l.pa,l.tk=l.af,l.to=l.dz,l.tr=l.af,l.ug=l.af,l.uk=l.ru,l.ur=l.ast,l.uz=l.af,l.vi=l.dz,l.wae=l.af,l.yi=l.ast,l.yue=l.dz,l.zh=l.dz,l.zu=l.am;var c=/^([a-z0-9]+)/i;function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var m=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=t.supportedLocalesOf(e);if(0===n.length)throw new RangeError("Unsupported locale: "+e);if(r&&"cardinal"!==r.type)throw new RangeError('Only "cardinal" "type" is supported');this.$=l[f(n[0])]}var e,r,n;return e=t,n=[{key:"supportedLocalesOf",value:function(t){return"string"==typeof t&&(t=[t]),t.filter((function(t){return l[f(t)]}))}}],(r=[{key:"select",value:function(t){return this.$(t)}}])&&s(e.prototype,r),n&&s(e,n),t}();function h(t){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){d(t,e,r[e])}))}return t}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,o=!1,a=void 0;try{for(var i,u=t[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!e||r.length!==e);n=!0);}catch(t){o=!0,a=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw a}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function b(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function d(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var w=["second","minute","hour","day","week","month","quarter","year"],g=["auto","always"],O=["long","short","narrow"],S=["lookup","best fit"],j=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};b(this,t),d(this,"numeric","always"),d(this,"style","long"),d(this,"localeMatcher","lookup");var n=r.numeric,a=r.style,u=r.localeMatcher;if(void 0!==n){if(g.indexOf(n)<0)throw new RangeError('Invalid "numeric" option: '.concat(n));this.numeric=n}if(void 0!==a){if(O.indexOf(a)<0)throw new RangeError('Invalid "style" option: '.concat(a));this.style=a}if(void 0!==u){if(S.indexOf(u)<0)throw new RangeError('Invalid "localeMatcher" option: '.concat(u));this.localeMatcher=u}if("string"==typeof e&&(e=[e]),e.push(o()),this.locale=t.supportedLocalesOf(e,{localeMatcher:this.localeMatcher})[0],!this.locale)throw new Error("No supported locale was found");m.supportedLocalesOf(this.locale).length>0?this.pluralRules=new m(this.locale):console.warn('"'.concat(this.locale,'" locale is not supported')),"undefined"!=typeof Intl&&Intl.NumberFormat?(this.numberFormat=new Intl.NumberFormat(this.locale),this.numberingSystem=this.numberFormat.resolvedOptions().numberingSystem):this.numberingSystem="latn",this.locale=i(this.locale,{localeMatcher:this.localeMatcher})}var e,n,a;return e=t,(n=[{key:"format",value:function(){var t=T(arguments),e=p(t,2),r=e[0],n=e[1];return this.getRule(r,n).replace("{0}",this.formatNumber(Math.abs(r)))}},{key:"formatToParts",value:function(){var t=T(arguments),e=p(t,2),r=e[0],n=e[1],o=this.getRule(r,n),a=o.indexOf("{0}");if(a<0)return[{type:"literal",value:o}];var i=[];return a>0&&i.push({type:"literal",value:o.slice(0,a)}),i=i.concat(this.formatNumberToParts(Math.abs(r)).map((function(t){return y({},t,{unit:n})}))),a+"{0}".length<o.length-1&&i.push({type:"literal",value:o.slice(a+"{0}".length)}),i}},{key:"getRule",value:function(t,e){var n,o=(n=this.locale,r[n])[this.style][e];if("auto"===this.numeric)if(-2===t||-1===t){var a=o["previous".concat(-1===t?"":"-"+Math.abs(t))];if(a)return a}else if(1===t||2===t){var i=o["next".concat(1===t?"":"-"+Math.abs(t))];if(i)return i}else if(0===t&&o.current)return o.current;var u,l=o[(u=t,u<0||0===u&&function(t){return 1/t==-1/0}(u)?"past":"future")];return"string"==typeof l?l:l[this.pluralRules&&this.pluralRules.select(Math.abs(t))||"other"]||l.other}},{key:"formatNumber",value:function(t){return this.numberFormat?this.numberFormat.format(t):String(t)}},{key:"formatNumberToParts",value:function(t){return this.numberFormat&&this.numberFormat.formatToParts?this.numberFormat.formatToParts(t):[{type:"integer",value:this.formatNumber(t)}]}},{key:"resolvedOptions",value:function(){return{locale:this.locale,style:this.style,numeric:this.numeric,numberingSystem:this.numberingSystem}}}])&&v(e.prototype,n),a&&v(e,a),t}();j.supportedLocalesOf=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof t)t=[t];else if(!Array.isArray(t))throw new TypeError('Invalid "locales" argument');return t.filter((function(t){return i(t,e)}))},j.addLocale=function(t){if(!t)throw new Error("No locale data passed");r[t.locale]=t,n[t.locale.toLowerCase()]=t.locale},j.setDefaultLocale=function(t){e=t},j.getDefaultLocale=o,j.PluralRules=m;var A='Invalid "unit" argument';function k(t){if("symbol"===h(t))throw new TypeError(A);if("string"!=typeof t)throw new RangeError("".concat(A,": ").concat(t));if("s"===t[t.length-1]&&(t=t.slice(0,t.length-1)),w.indexOf(t)<0)throw new RangeError("".concat(A,": ").concat(t));return t}function P(t){if(t=Number(t),Number.isFinite&&!Number.isFinite(t))throw new RangeError("".concat('Invalid "number" argument',": ").concat(t));return t}function T(t){if(t.length<2)throw new TypeError('"unit" argument is required');return[P(t[0]),k(t[1])]}function F(t){return(F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function N(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var E=function(){function t(){var e,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n={},(r="cache")in(e=this)?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n}var e,r,n;return e=t,(r=[{key:"get",value:function(){for(var t=this.cache,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];for(var o=0;o<r.length;o++){var a=r[o];if("object"!==F(t))return;t=t[a]}return t}},{key:"put",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=e.pop(),o=e.pop(),a=this.cache,i=0;i<e.length;i++){var u=e[i];"object"!==F(a[u])&&(a[u]={}),a=a[u]}return a[o]=n}}])&&N(e.prototype,r),n&&N(e,n),t}();function M(t){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function R(t,e){var r=t,n=Array.isArray(r),o=0;for(r=n?r:r[Symbol.iterator]();;){var a;if(n){if(o>=r.length)break;a=r[o++]}else{if((o=r.next()).done)break;a=o.value}var i=a;if(e(i))return i;for(var u=i.split("-");u.length>1;)if(u.pop(),e(i=u.join("-")))return i}throw new Error("No locale data has been registered for any of the locales: ".concat(t.join(", ")))}var D=60,I=3600,x=86400,L=7*x,z=2630016,C=31556952;function U(t){switch(t){case"second":return 1;case"minute":return D;case"hour":return I;case"day":return x;case"week":return L;case"month":return z;case"year":return C}}function _(t){return void 0!==t.factor?t.factor:U(t.unit||t.formatAs)||1}function Y(t){switch(t){case"floor":return Math.floor;default:return Math.round}}function q(t){switch(t){case"floor":return 1;default:return.5}}function V(t){return(V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function J(t,e){var r,n=e.prevStep,o=e.timestamp,a=e.now,i=e.future,u=e.round;return n&&(n.id||n.unit)&&(r=t["threshold_for_".concat(n.id||n.unit)]),void 0===r&&void 0!==t.threshold&&"function"==typeof(r=t.threshold)&&(r=r(a,i)),void 0===r&&(r=t.minTime),"object"===V(r)&&(r=n&&n.id&&void 0!==r[n.id]?r[n.id]:r.default),"function"==typeof r&&(r=r(o,{future:i,getMinTimeForUnit:function(t,e){return $(t,e||n&&n.formatAs,{round:u})}})),void 0===r&&t.test&&(r=t.test(o,{now:a,future:i})?0:9007199254740991),void 0===r&&(n?t.formatAs&&n.formatAs&&(r=$(t.formatAs,n.formatAs,{round:u})):r=0),void 0===r&&console.warn("[javascript-time-ago] A step should specify `minTime`:\n"+JSON.stringify(t,null,2)),r}function $(t,e,r){var n,o=r.round,a=U(t);if(n=U("now"===e?t:e),void 0!==a&&void 0!==n)return a-n*(1-q(o))}function B(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){G(t,e,r[e])}))}return t}function G(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function H(t,e,r){var n=r.now,o=r.future,a=r.round,i=r.units,u=r.getNextStep,l=function(t,e,r){var n=r.now,o=r.future,a=r.round;if(0===t.length)return;var i=K(t,e,{now:n,future:o||e<0,round:a});if(-1===i)return;var u=t[i];if(u.granularity){if(0===Y(a)(Math.abs(e)/_(u)/u.granularity)*u.granularity&&i>0)return t[i-1]}return u}(t=function(t,e){return t.filter((function(t){var r=t.unit,n=t.formatAs;return!(r=r||n)||e.indexOf(r)>=0}))}(t,i),e,{now:n,future:o,round:a});return u?l?[t[t.indexOf(l)-1],l,t[t.indexOf(l)+1]]:[void 0,void 0,t[0]]:l}function K(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=J(t[n],B({prevStep:t[n-1],timestamp:r.now-1e3*e},r));return void 0===o||Math.abs(e)<o?n-1:n===t.length-1?n:K(t,e,r,n+1)}function Q(t,e,r){var n=r.now,o=r.round;if(U(t)){var a=1e3*U(t),i=e>n,u=Math.abs(e-n),l=Y(o)(u/a)*a;return i?l>0?u-l+function(t,e){return(1-q(t))*e+1}(o,a):u-l+1:-(u-l)+function(t,e){return q(t)*e}(o,a)}}var W=31536e9;function X(t,e,r){var n=r.prevStep,o=r.nextStep,a=r.now,i=r.future,u=r.round,l=t.getTime?t.getTime():t,f=function(t){return Q(t,l,{now:a,round:u})},c=function(t,e,r){var n=r.now,o=r.future,a=r.round,i=r.prevStep;if(t){var u=function(t,e,r){var n=r.now,o=r.future,a=r.round,i=r.prevStep,u=J(t,{timestamp:e,now:n,future:o,round:a,prevStep:i});if(void 0===u)return;return o?e-1e3*u+1:0===u&&e===n?W:e+1e3*u}(t,e,{now:n,future:o,round:a,prevStep:i});if(void 0===u)return;return u-n}return o?e-n+1:W}(i?e:o,l,{future:i,now:a,round:u,prevStep:i?n:e});if(void 0!==c){var s;if(e&&(e.getTimeToNextUpdate&&(s=e.getTimeToNextUpdate(l,{getTimeToNextUpdateForUnit:f,getRoundFunction:Y,now:a,future:i,round:u})),void 0===s)){var m=e.unit||e.formatAs;m&&(s=f(m))}return void 0===s?c:Math.min(s,c)}}var Z={};function tt(t){return Z[t]}function et(t){if(!t)throw new Error("[javascript-time-ago] No locale data passed.");Z[t.locale]=t}var rt={steps:[{formatAs:"now"},{formatAs:"second"},{formatAs:"minute"},{formatAs:"hour"},{formatAs:"day"},{formatAs:"week"},{formatAs:"month"},{formatAs:"year"}],labels:"long"};function nt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ot=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){nt(t,e,r[e])}))}return t}({},rt,{steps:rt.steps.filter((function(t){return"second"!==t.formatAs}))}),at=[{factor:1,unit:"now"},{threshold:1,threshold_for_now:45.5,factor:1,unit:"second"},{threshold:45.5,factor:D,unit:"minute"},{threshold:150,granularity:5,factor:D,unit:"minute"},{threshold:1350,factor:1800,unit:"half-hour"},{threshold:2550,threshold_for_minute:3150,factor:I,unit:"hour"},{threshold:73800,factor:x,unit:"day"},{threshold:475200,factor:L,unit:"week"},{threshold:2116800,factor:z,unit:"month"},{threshold:27615168,factor:C,unit:"year"}],it={gradation:at,flavour:"long",units:["now","minute","hour","day","week","month","year"]},ut={gradation:at,flavour:"long-time",units:["now","minute","hour","day","week","month","year"]};function lt(t){return t instanceof Date?t:new Date(t)}var ft=[{formatAs:"second"},{formatAs:"minute"},{formatAs:"hour"}],ct={},st={minTime:function(t,e){e.future;return(0,e.getMinTimeForUnit)("day")},format:function(t,e){return ct[e]||(ct[e]={}),ct[e].dayMonth||(ct[e].dayMonth=new Intl.DateTimeFormat(e,{month:"short",day:"numeric"})),ct[e].dayMonth.format(lt(t))}},mt={minTime:function(t,e){return e.future?(t-(new Date(new Date(t).getFullYear(),0).getTime()-1))/1e3:(new Date(new Date(t).getFullYear()+1,0).getTime()-t)/1e3},format:function(t,e){return ct[e]||(ct[e]={}),ct[e].dayMonthYear||(ct[e].dayMonthYear=new Intl.DateTimeFormat(e,{year:"numeric",month:"short",day:"numeric"})),ct[e].dayMonthYear.format(lt(t))}};"object"===("undefined"==typeof Intl?"undefined":M(Intl))&&"function"==typeof Intl.DateTimeFormat?ft.push(st,mt):ft.push({formatAs:"day"},{formatAs:"week"},{formatAs:"month"},{formatAs:"year"});var ht={steps:ft,labels:["mini","short-time","narrow","short"]};function yt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var pt=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){yt(t,e,r[e])}))}return t}({},ht,{steps:[{formatAs:"now"}].concat(ht.steps)});function bt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var vt=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){bt(t,e,r[e])}))}return t}({},ht,{steps:ht.steps.filter((function(t){return"second"!==t.formatAs}))});function dt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var wt=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){dt(t,e,r[e])}))}return t}({},vt,{steps:[{formatAs:"now"}].concat(vt.steps)});function gt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){Ot(t,e,r[e])}))}return t}function Ot(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var St=gt({},ht,{steps:ht.steps.filter((function(t){return"second"!==t.formatAs})).map((function(t){return"minute"===t.formatAs?gt({},t,{minTime:D}):t}))}),jt={steps:[{formatAs:"second"},{formatAs:"minute"},{formatAs:"hour"},{formatAs:"day"},{formatAs:"month"},{formatAs:"year"}],labels:["mini","short-time","narrow","short"]};function At(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var kt=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){At(t,e,r[e])}))}return t}({},jt,{steps:[{formatAs:"now"}].concat(jt.steps)});function Pt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Tt=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){Pt(t,e,r[e])}))}return t}({},jt,{steps:jt.steps.filter((function(t){return"second"!==t.formatAs}))});function Ft(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Nt=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){Ft(t,e,r[e])}))}return t}({},Tt,{steps:[{formatAs:"now"}].concat(Tt.steps)});function Et(t){return(Et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,o=!1,a=void 0;try{for(var i,u=t[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!e||r.length!==e);n=!0);}catch(t){o=!0,a=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw a}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Rt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Dt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var It,xt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.polyfill;Rt(this,t),"string"==typeof e&&(e=[e]),this.locale=R(e.concat(t.getDefaultLocale()),tt),"undefined"!=typeof Intl&&Intl.NumberFormat&&(this.numberFormat=new Intl.NumberFormat(this.locale)),!1===n?(this.IntlRelativeTimeFormat=Intl.RelativeTimeFormat,this.IntlPluralRules=Intl.PluralRules):(this.IntlRelativeTimeFormat=j,this.IntlPluralRules=j.PluralRules),this.relativeTimeFormatCache=new E,this.pluralRulesCache=new E}var e,r,n;return e=t,(r=[{key:"format",value:function(t,e,r){var n;r||(e&&"string"!=typeof(n=e)&&!Ct(n)?(r=e,e=void 0):r={}),e||(e=ot),"string"==typeof e&&(e=function(t){switch(t){case"default":case"round":return rt;case"round-minute":return ot;case"approximate":return it;case"time":case"approximate-time":return ut;case"mini":return jt;case"mini-now":return kt;case"mini-minute":return Tt;case"mini-minute-now":return Nt;case"twitter":return ht;case"twitter-now":return pt;case"twitter-minute":return vt;case"twitter-minute-now":return wt;case"twitter-first-minute":return St;default:return it}}(e));var o,a=function(t){if(t.constructor===Date||"object"===Et(e=t)&&"function"==typeof e.getTime)return t.getTime();var e;if("number"==typeof t)return t;throw new Error("Unsupported relative time formatter input: ".concat(Et(t),", ").concat(t))}(t),i=this.getLabels(e.flavour||e.labels),u=i.labels,l=i.labelsType;void 0!==e.now&&(o=e.now),void 0===o&&void 0!==r.now&&(o=r.now),void 0===o&&(o=Date.now());var f=(o-a)/1e3,c=r.future||f<0,s=function(t,e,r,n){var o=t.now||e&&e.now;return o?"string"==typeof o?o:n?o.future:o.past:r&&r.second&&r.second.current?r.second.current:void 0}(u,tt(this.locale).now,tt(this.locale).long,c);if(e.custom){var m=e.custom({now:o,date:new Date(a),time:a,elapsed:f,locale:this.locale});if(void 0!==m)return m}var h=function(t,e,r){var n=Object.keys(e);return r&&n.push("now"),t&&(n=t.filter((function(t){return"now"===t||n.indexOf(t)>=0}))),n}(e.units,u,s),y=r.round||e.round,p=Mt(H(e.gradation||e.steps||ot.steps,f,{now:o,units:h,round:y,future:c,getNextStep:!0}),3),b=p[0],v=p[1],d=p[2],w=this.formatDateForStep(a,v,f,{labels:u,labelsType:l,nowLabel:s,now:o,future:c,round:y})||"";return r.getTimeToNextUpdate?[w,X(a,v,{nextStep:d,prevStep:b,now:o,future:c,round:y})]:w}},{key:"formatDateForStep",value:function(t,e,r,n){var o=this,a=n.labels,i=n.labelsType,u=n.nowLabel,l=n.now,f=n.future,c=n.round;if(e){if(e.format)return e.format(t,this.locale,{formatAs:function(t,e){return o.formatValue(e,t,{labels:a,future:f})},now:l,future:f});var s=e.unit||e.formatAs;if(!s)throw new Error("[javascript-time-ago] Each step must define either `formatAs` or `format()`. Step: ".concat(JSON.stringify(e)));if("now"===s)return u;var m=Math.abs(r)/_(e);e.granularity&&(m=Y(c)(m/e.granularity)*e.granularity);var h=-1*Math.sign(r)*Y(c)(m);switch(0===h&&(h=f?0:-0),i){case"long":case"short":case"narrow":return this.getFormatter(i).format(h,s);default:return this.formatValue(h,s,{labels:a,future:f})}}}},{key:"formatValue",value:function(t,e,r){var n=r.labels,o=r.future;return this.getFormattingRule(n,e,t,{future:o}).replace("{0}",this.formatNumber(Math.abs(t)))}},{key:"getFormattingRule",value:function(t,e,r,n){var o=n.future;if(this.locale,"string"==typeof(t=t[e]))return t;var a=t[0===r?o?"future":"past":r<0?"past":"future"]||t;return"string"==typeof a?a:a[this.getPluralRules().select(Math.abs(r))]||a.other}},{key:"formatNumber",value:function(t){return this.numberFormat?this.numberFormat.format(t):String(t)}},{key:"getFormatter",value:function(t){return this.relativeTimeFormatCache.get(this.locale,t)||this.relativeTimeFormatCache.put(this.locale,t,new this.IntlRelativeTimeFormat(this.locale,{style:t}))}},{key:"getPluralRules",value:function(){return this.pluralRulesCache.get(this.locale)||this.pluralRulesCache.put(this.locale,new this.IntlPluralRules(this.locale))}},{key:"getLabels",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];"string"==typeof t&&(t=[t]),t=(t=t.map((function(t){switch(t){case"tiny":case"mini-time":return"mini";default:return t}}))).concat("long");var e=tt(this.locale),r=t,n=Array.isArray(r),o=0;for(r=n?r:r[Symbol.iterator]();;){var a;if(n){if(o>=r.length)break;a=r[o++]}else{if((o=r.next()).done)break;a=o.value}var i=a;if(e[i])return{labelsType:i,labels:e[i]}}}}])&&Dt(e.prototype,r),n&&Dt(e,n),t}(),Lt="en";xt.getDefaultLocale=function(){return Lt},xt.setDefaultLocale=function(t){return Lt=t},xt.addDefaultLocale=function(t){if(It)throw new Error("[javascript-time-ago] `TimeAgo.addDefaultLocale()` can only be called once. To add other locales, use `TimeAgo.addLocale()`.");It=!0,xt.setDefaultLocale(t.locale),xt.addLocale(t)},xt.addLocale=function(t){et(t),j.addLocale(t)},xt.locale=xt.addLocale,xt.addLabels=function(t,e,r){var n=tt(t);n||(et({locale:t}),n=tt(t)),n[e]=r};var zt={}.constructor;function Ct(t){return function(t){return void 0!==Et(t)&&null!==t&&t.constructor===zt}(t)&&(Array.isArray(t.steps)||Array.isArray(t.gradation)||Array.isArray(t.flavour)||"string"==typeof t.flavour||Array.isArray(t.labels)||"string"==typeof t.labels||Array.isArray(t.units)||"function"==typeof t.custom)}t.default=xt,t.isStyleObject=Ct,Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).TimeAgo={})}(this,(function(t){"use strict";var e="en",r={},n={};function o(){return e}function a(t){return r[t]?t:n[t.toLowerCase()]?n[t.toLowerCase()]:void 0}function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.localeMatcher||"lookup";switch(r){case"lookup":case"best fit":return u(t);default:throw new RangeError('Invalid "localeMatcher" option: '.concat(r))}}function u(t){var e=a(t);if(e)return e;for(var r=t.split("-");t.length>1;){r.pop();var n=a(t=r.join("-"));if(n)return n}}var l={af:function(t){return 1==t?"one":"other"},am:function(t){return t>=0&&t<=1?"one":"other"},ar:function(t){var e=String(t).split("."),r=Number(e[0])==t&&e[0].slice(-2);return 0==t?"zero":1==t?"one":2==t?"two":r>=3&&r<=10?"few":r>=11&&r<=99?"many":"other"},ast:function(t){var e=!String(t).split(".")[1];return 1==t&&e?"one":"other"},be:function(t){var e=String(t).split("."),r=Number(e[0])==t,n=r&&e[0].slice(-1),o=r&&e[0].slice(-2);return 1==n&&11!=o?"one":n>=2&&n<=4&&(o<12||o>14)?"few":r&&0==n||n>=5&&n<=9||o>=11&&o<=14?"many":"other"},br:function(t){var e=String(t).split("."),r=Number(e[0])==t,n=r&&e[0].slice(-1),o=r&&e[0].slice(-2),a=r&&e[0].slice(-6);return 1==n&&11!=o&&71!=o&&91!=o?"one":2==n&&12!=o&&72!=o&&92!=o?"two":(3==n||4==n||9==n)&&(o<10||o>19)&&(o<70||o>79)&&(o<90||o>99)?"few":0!=t&&r&&0==a?"many":"other"},bs:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",o=!e[1],a=r.slice(-1),i=r.slice(-2),u=n.slice(-1),l=n.slice(-2);return o&&1==a&&11!=i||1==u&&11!=l?"one":o&&a>=2&&a<=4&&(i<12||i>14)||u>=2&&u<=4&&(l<12||l>14)?"few":"other"},cs:function(t){var e=String(t).split("."),r=e[0],n=!e[1];return 1==t&&n?"one":r>=2&&r<=4&&n?"few":n?"other":"many"},cy:function(t){return 0==t?"zero":1==t?"one":2==t?"two":3==t?"few":6==t?"many":"other"},da:function(t){var e=String(t).split("."),r=e[0],n=Number(e[0])==t;return 1!=t&&(n||0!=r&&1!=r)?"other":"one"},dsb:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",o=!e[1],a=r.slice(-2),i=n.slice(-2);return o&&1==a||1==i?"one":o&&2==a||2==i?"two":o&&(3==a||4==a)||3==i||4==i?"few":"other"},dz:function(t){return"other"},fil:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",o=!e[1],a=r.slice(-1),i=n.slice(-1);return o&&(1==r||2==r||3==r)||o&&4!=a&&6!=a&&9!=a||!o&&4!=i&&6!=i&&9!=i?"one":"other"},fr:function(t){return t>=0&&t<2?"one":"other"},ga:function(t){var e=String(t).split("."),r=Number(e[0])==t;return 1==t?"one":2==t?"two":r&&t>=3&&t<=6?"few":r&&t>=7&&t<=10?"many":"other"},gd:function(t){var e=String(t).split("."),r=Number(e[0])==t;return 1==t||11==t?"one":2==t||12==t?"two":r&&t>=3&&t<=10||r&&t>=13&&t<=19?"few":"other"},he:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=Number(e[0])==t,a=o&&e[0].slice(-1);return 1==t&&n?"one":2==r&&n?"two":n&&(t<0||t>10)&&o&&0==a?"many":"other"},is:function(t){var e=String(t).split("."),r=e[0],n=Number(e[0])==t,o=r.slice(-1),a=r.slice(-2);return n&&1==o&&11!=a||!n?"one":"other"},ksh:function(t){return 0==t?"zero":1==t?"one":"other"},lt:function(t){var e=String(t).split("."),r=e[1]||"",n=Number(e[0])==t,o=n&&e[0].slice(-1),a=n&&e[0].slice(-2);return 1==o&&(a<11||a>19)?"one":o>=2&&o<=9&&(a<11||a>19)?"few":0!=r?"many":"other"},lv:function(t){var e=String(t).split("."),r=e[1]||"",n=r.length,o=Number(e[0])==t,a=o&&e[0].slice(-1),i=o&&e[0].slice(-2),u=r.slice(-2),l=r.slice(-1);return o&&0==a||i>=11&&i<=19||2==n&&u>=11&&u<=19?"zero":1==a&&11!=i||2==n&&1==l&&11!=u||2!=n&&1==l?"one":"other"},mk:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",o=!e[1],a=r.slice(-1),i=r.slice(-2),u=n.slice(-1),l=n.slice(-2);return o&&1==a&&11!=i||1==u&&11!=l?"one":"other"},mt:function(t){var e=String(t).split("."),r=Number(e[0])==t&&e[0].slice(-2);return 1==t?"one":0==t||r>=2&&r<=10?"few":r>=11&&r<=19?"many":"other"},pa:function(t){return 0==t||1==t?"one":"other"},pl:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=r.slice(-1),a=r.slice(-2);return 1==t&&n?"one":n&&o>=2&&o<=4&&(a<12||a>14)?"few":n&&1!=r&&(0==o||1==o)||n&&o>=5&&o<=9||n&&a>=12&&a<=14?"many":"other"},pt:function(t){var e=String(t).split(".")[0];return 0==e||1==e?"one":"other"},ro:function(t){var e=String(t).split("."),r=!e[1],n=Number(e[0])==t&&e[0].slice(-2);return 1==t&&r?"one":!r||0==t||1!=t&&n>=1&&n<=19?"few":"other"},ru:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=r.slice(-1),a=r.slice(-2);return n&&1==o&&11!=a?"one":n&&o>=2&&o<=4&&(a<12||a>14)?"few":n&&0==o||n&&o>=5&&o<=9||n&&a>=11&&a<=14?"many":"other"},se:function(t){return 1==t?"one":2==t?"two":"other"},si:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"";return 0==t||1==t||0==r&&1==n?"one":"other"},sl:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=r.slice(-2);return n&&1==o?"one":n&&2==o?"two":n&&(3==o||4==o)||!n?"few":"other"}};function f(t){return"pt-PT"===t?t:function(t){var e=t.match(c);if(!e)throw new TypeError("Invalid locale: ".concat(t));return e[1]}(t)}l.as=l.am,l.az=l.af,l.bg=l.af,l.bn=l.am,l.ca=l.ast,l.ce=l.af,l.chr=l.af,l.de=l.ast,l.ee=l.af,l.el=l.af,l.en=l.ast,l.es=l.af,l.et=l.ast,l.eu=l.af,l.fa=l.am,l.fi=l.ast,l.fo=l.af,l.fur=l.af,l.fy=l.ast,l.gl=l.ast,l.gu=l.am,l.hi=l.am,l.hr=l.bs,l.hsb=l.dsb,l.hu=l.af,l.hy=l.fr,l.ia=l.ast,l.id=l.dz,l.it=l.ast,l.ja=l.dz,l.jgo=l.af,l.jv=l.dz,l.ka=l.af,l.kea=l.dz,l.kk=l.af,l.kl=l.af,l.km=l.dz,l.kn=l.am,l.ko=l.dz,l.ku=l.af,l.ky=l.af,l.lb=l.af,l.lkt=l.dz,l.lo=l.dz,l.ml=l.af,l.mn=l.af,l.mr=l.am,l.ms=l.dz,l.my=l.dz,l.nb=l.af,l.ne=l.af,l.nl=l.ast,l.nn=l.af,l.or=l.af,l.ps=l.af,l["pt-PT"]=l.ast,l.sah=l.dz,l.sd=l.af,l.sk=l.cs,l.so=l.af,l.sq=l.af,l.sr=l.bs,l.sv=l.ast,l.sw=l.ast,l.ta=l.af,l.te=l.af,l.th=l.dz,l.ti=l.pa,l.tk=l.af,l.to=l.dz,l.tr=l.af,l.ug=l.af,l.uk=l.ru,l.ur=l.ast,l.uz=l.af,l.vi=l.dz,l.wae=l.af,l.yi=l.ast,l.yue=l.dz,l.zh=l.dz,l.zu=l.am;var c=/^([a-z0-9]+)/i;function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var m=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=t.supportedLocalesOf(e);if(0===n.length)throw new RangeError("Unsupported locale: "+e);if(r&&"cardinal"!==r.type)throw new RangeError('Only "cardinal" "type" is supported');this.$=l[f(n[0])]}var e,r,n;return e=t,n=[{key:"supportedLocalesOf",value:function(t){return"string"==typeof t&&(t=[t]),t.filter((function(t){return l[f(t)]}))}}],(r=[{key:"select",value:function(t){return this.$(t)}}])&&s(e.prototype,r),n&&s(e,n),t}();function y(t){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function h(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){d(t,e,r[e])}))}return t}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,o=!1,a=void 0;try{for(var i,u=t[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!e||r.length!==e);n=!0);}catch(t){o=!0,a=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw a}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function b(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function d(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var g=["second","minute","hour","day","week","month","quarter","year"],w=["auto","always"],O=["long","short","narrow"],S=["lookup","best fit"],j=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};b(this,t),d(this,"numeric","always"),d(this,"style","long"),d(this,"localeMatcher","lookup");var n=r.numeric,a=r.style,u=r.localeMatcher;if(void 0!==n){if(w.indexOf(n)<0)throw new RangeError('Invalid "numeric" option: '.concat(n));this.numeric=n}if(void 0!==a){if(O.indexOf(a)<0)throw new RangeError('Invalid "style" option: '.concat(a));this.style=a}if(void 0!==u){if(S.indexOf(u)<0)throw new RangeError('Invalid "localeMatcher" option: '.concat(u));this.localeMatcher=u}if("string"==typeof e&&(e=[e]),e.push(o()),this.locale=t.supportedLocalesOf(e,{localeMatcher:this.localeMatcher})[0],!this.locale)throw new Error("No supported locale was found");m.supportedLocalesOf(this.locale).length>0?this.pluralRules=new m(this.locale):console.warn('"'.concat(this.locale,'" locale is not supported')),"undefined"!=typeof Intl&&Intl.NumberFormat?(this.numberFormat=new Intl.NumberFormat(this.locale),this.numberingSystem=this.numberFormat.resolvedOptions().numberingSystem):this.numberingSystem="latn",this.locale=i(this.locale,{localeMatcher:this.localeMatcher})}var e,n,a;return e=t,(n=[{key:"format",value:function(){var t=T(arguments),e=p(t,2),r=e[0],n=e[1];return this.getRule(r,n).replace("{0}",this.formatNumber(Math.abs(r)))}},{key:"formatToParts",value:function(){var t=T(arguments),e=p(t,2),r=e[0],n=e[1],o=this.getRule(r,n),a=o.indexOf("{0}");if(a<0)return[{type:"literal",value:o}];var i=[];return a>0&&i.push({type:"literal",value:o.slice(0,a)}),i=i.concat(this.formatNumberToParts(Math.abs(r)).map((function(t){return h({},t,{unit:n})}))),a+"{0}".length<o.length-1&&i.push({type:"literal",value:o.slice(a+"{0}".length)}),i}},{key:"getRule",value:function(t,e){var n,o=(n=this.locale,r[n])[this.style][e];if("auto"===this.numeric)if(-2===t||-1===t){var a=o["previous".concat(-1===t?"":"-"+Math.abs(t))];if(a)return a}else if(1===t||2===t){var i=o["next".concat(1===t?"":"-"+Math.abs(t))];if(i)return i}else if(0===t&&o.current)return o.current;var u,l=o[(u=t,u<0||0===u&&function(t){return 1/t==-1/0}(u)?"past":"future")];return"string"==typeof l?l:l[this.pluralRules&&this.pluralRules.select(Math.abs(t))||"other"]||l.other}},{key:"formatNumber",value:function(t){return this.numberFormat?this.numberFormat.format(t):String(t)}},{key:"formatNumberToParts",value:function(t){return this.numberFormat&&this.numberFormat.formatToParts?this.numberFormat.formatToParts(t):[{type:"integer",value:this.formatNumber(t)}]}},{key:"resolvedOptions",value:function(){return{locale:this.locale,style:this.style,numeric:this.numeric,numberingSystem:this.numberingSystem}}}])&&v(e.prototype,n),a&&v(e,a),t}();j.supportedLocalesOf=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof t)t=[t];else if(!Array.isArray(t))throw new TypeError('Invalid "locales" argument');return t.filter((function(t){return i(t,e)}))},j.addLocale=function(t){if(!t)throw new Error("No locale data passed");r[t.locale]=t,n[t.locale.toLowerCase()]=t.locale},j.setDefaultLocale=function(t){e=t},j.getDefaultLocale=o,j.PluralRules=m;var A='Invalid "unit" argument';function k(t){if("symbol"===y(t))throw new TypeError(A);if("string"!=typeof t)throw new RangeError("".concat(A,": ").concat(t));if("s"===t[t.length-1]&&(t=t.slice(0,t.length-1)),g.indexOf(t)<0)throw new RangeError("".concat(A,": ").concat(t));return t}function P(t){if(t=Number(t),Number.isFinite&&!Number.isFinite(t))throw new RangeError("".concat('Invalid "number" argument',": ").concat(t));return t}function T(t){if(t.length<2)throw new TypeError('"unit" argument is required');return[P(t[0]),k(t[1])]}function F(t){return(F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function N(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var E=function(){function t(){var e,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n={},(r="cache")in(e=this)?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n}var e,r,n;return e=t,(r=[{key:"get",value:function(){for(var t=this.cache,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];for(var o=0;o<r.length;o++){var a=r[o];if("object"!==F(t))return;t=t[a]}return t}},{key:"put",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=e.pop(),o=e.pop(),a=this.cache,i=0;i<e.length;i++){var u=e[i];"object"!==F(a[u])&&(a[u]={}),a=a[u]}return a[o]=n}}])&&N(e.prototype,r),n&&N(e,n),t}();function M(t){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function R(t,e){var r=t,n=Array.isArray(r),o=0;for(r=n?r:r[Symbol.iterator]();;){var a;if(n){if(o>=r.length)break;a=r[o++]}else{if((o=r.next()).done)break;a=o.value}var i=a;if(e(i))return i;for(var u=i.split("-");u.length>1;)if(u.pop(),e(i=u.join("-")))return i}throw new Error("No locale data has been registered for any of the locales: ".concat(t.join(", ")))}var D=60,I=3600,x=86400,L=7*x,z=2630016,C=31556952;function U(t){switch(t){case"second":return 1;case"minute":return D;case"hour":return I;case"day":return x;case"week":return L;case"month":return z;case"year":return C}}function _(t){return void 0!==t.factor?t.factor:U(t.unit||t.formatAs)||1}function Y(t){switch(t){case"floor":return Math.floor;default:return Math.round}}function q(t){switch(t){case"floor":return 1;default:return.5}}function V(t){return(V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function J(t,e){var r,n=e.prevStep,o=e.timestamp,a=e.now,i=e.future,u=e.round;return n&&(n.id||n.unit)&&(r=t["threshold_for_".concat(n.id||n.unit)]),void 0===r&&void 0!==t.threshold&&"function"==typeof(r=t.threshold)&&(r=r(a,i)),void 0===r&&(r=t.minTime),"object"===V(r)&&(r=n&&n.id&&void 0!==r[n.id]?r[n.id]:r.default),"function"==typeof r&&(r=r(o,{future:i,getMinTimeForUnit:function(t,e){return $(t,e||n&&n.formatAs,{round:u})}})),void 0===r&&t.test&&(r=t.test(o,{now:a,future:i})?0:9007199254740991),void 0===r&&(n?t.formatAs&&n.formatAs&&(r=$(t.formatAs,n.formatAs,{round:u})):r=0),void 0===r&&console.warn("[javascript-time-ago] A step should specify `minTime`:\n"+JSON.stringify(t,null,2)),r}function $(t,e,r){var n,o=r.round,a=U(t);if(n=U("now"===e?t:e),void 0!==a&&void 0!==n)return a-n*(1-q(o))}function B(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){G(t,e,r[e])}))}return t}function G(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function H(t,e,r){var n=r.now,o=r.future,a=r.round,i=r.units,u=r.getNextStep,l=function(t,e,r){var n=r.now,o=r.future,a=r.round;if(0===t.length)return;var i=K(t,e,{now:n,future:o||e<0,round:a});if(-1===i)return;var u=t[i];if(u.granularity){if(0===Y(a)(Math.abs(e)/_(u)/u.granularity)*u.granularity&&i>0)return t[i-1]}return u}(t=function(t,e){return t.filter((function(t){var r=t.unit,n=t.formatAs;return!(r=r||n)||e.indexOf(r)>=0}))}(t,i),e,{now:n,future:o,round:a});return u?l?[t[t.indexOf(l)-1],l,t[t.indexOf(l)+1]]:[void 0,void 0,t[0]]:l}function K(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=J(t[n],B({prevStep:t[n-1],timestamp:r.now-1e3*e},r));return void 0===o||Math.abs(e)<o?n-1:n===t.length-1?n:K(t,e,r,n+1)}function Q(t,e,r){var n=r.now,o=r.round;if(U(t)){var a=1e3*U(t),i=e>n,u=Math.abs(e-n),l=Y(o)(u/a)*a;return i?l>0?u-l+function(t,e){return(1-q(t))*e+1}(o,a):u-l+1:-(u-l)+function(t,e){return q(t)*e}(o,a)}}var W=31536e9;function X(t,e,r){var n=r.prevStep,o=r.nextStep,a=r.now,i=r.future,u=r.round,l=t.getTime?t.getTime():t,f=function(t){return Q(t,l,{now:a,round:u})},c=function(t,e,r){var n=r.now,o=r.future,a=r.round,i=r.prevStep;if(t){var u=function(t,e,r){var n=r.now,o=r.future,a=r.round,i=r.prevStep,u=J(t,{timestamp:e,now:n,future:o,round:a,prevStep:i});if(void 0===u)return;return o?e-1e3*u+1:0===u&&e===n?W:e+1e3*u}(t,e,{now:n,future:o,round:a,prevStep:i});if(void 0===u)return;return u-n}return o?e-n+1:W}(i?e:o,l,{future:i,now:a,round:u,prevStep:i?n:e});if(void 0!==c){var s;if(e&&(e.getTimeToNextUpdate&&(s=e.getTimeToNextUpdate(l,{getTimeToNextUpdateForUnit:f,getRoundFunction:Y,now:a,future:i,round:u})),void 0===s)){var m=e.unit||e.formatAs;m&&(s=f(m))}return void 0===s?c:Math.min(s,c)}}var Z={};function tt(t){return Z[t]}function et(t){if(!t)throw new Error("[javascript-time-ago] No locale data passed.");Z[t.locale]=t}var rt={steps:[{formatAs:"now"},{formatAs:"second"},{formatAs:"minute"},{formatAs:"hour"},{formatAs:"day"},{formatAs:"week"},{formatAs:"month"},{formatAs:"year"}],labels:"long"};function nt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ot=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){nt(t,e,r[e])}))}return t}({},rt,{steps:rt.steps.filter((function(t){return"second"!==t.formatAs}))}),at=[{factor:1,unit:"now"},{threshold:1,threshold_for_now:45.5,factor:1,unit:"second"},{threshold:45.5,factor:D,unit:"minute"},{threshold:150,granularity:5,factor:D,unit:"minute"},{threshold:1350,factor:1800,unit:"half-hour"},{threshold:2550,threshold_for_minute:3150,factor:I,unit:"hour"},{threshold:73800,factor:x,unit:"day"},{threshold:475200,factor:L,unit:"week"},{threshold:2116800,factor:z,unit:"month"},{threshold:27615168,factor:C,unit:"year"}],it={gradation:at,flavour:"long",units:["now","minute","hour","day","week","month","year"]},ut={gradation:at,flavour:"long-time",units:["now","minute","hour","day","week","month","year"]};function lt(t){return t instanceof Date?t:new Date(t)}var ft=[{formatAs:"second"},{formatAs:"minute"},{formatAs:"hour"}],ct={},st={minTime:function(t,e){e.future;return(0,e.getMinTimeForUnit)("day")},format:function(t,e){return ct[e]||(ct[e]={}),ct[e].dayMonth||(ct[e].dayMonth=new Intl.DateTimeFormat(e,{month:"short",day:"numeric"})),ct[e].dayMonth.format(lt(t))}},mt={minTime:function(t,e){return e.future?(t-(new Date(new Date(t).getFullYear(),0).getTime()-1))/1e3:(new Date(new Date(t).getFullYear()+1,0).getTime()-t)/1e3},format:function(t,e){return ct[e]||(ct[e]={}),ct[e].dayMonthYear||(ct[e].dayMonthYear=new Intl.DateTimeFormat(e,{year:"numeric",month:"short",day:"numeric"})),ct[e].dayMonthYear.format(lt(t))}};"object"===("undefined"==typeof Intl?"undefined":M(Intl))&&"function"==typeof Intl.DateTimeFormat?ft.push(st,mt):ft.push({formatAs:"day"},{formatAs:"week"},{formatAs:"month"},{formatAs:"year"});var yt={steps:ft,labels:["mini","short-time","narrow","short"]};function ht(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var pt=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){ht(t,e,r[e])}))}return t}({},yt,{steps:[{formatAs:"now"}].concat(yt.steps)});function bt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var vt=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){bt(t,e,r[e])}))}return t}({},yt,{steps:yt.steps.filter((function(t){return"second"!==t.formatAs}))});function dt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var gt=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){dt(t,e,r[e])}))}return t}({},vt,{steps:[{formatAs:"now"}].concat(vt.steps)});function wt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){Ot(t,e,r[e])}))}return t}function Ot(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var St=wt({},yt,{steps:yt.steps.filter((function(t){return"second"!==t.formatAs})).map((function(t){return"minute"===t.formatAs?wt({},t,{minTime:D}):t}))}),jt={steps:[{formatAs:"second"},{formatAs:"minute"},{formatAs:"hour"},{formatAs:"day"},{formatAs:"month"},{formatAs:"year"}],labels:["mini","short-time","narrow","short"]};function At(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var kt=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){At(t,e,r[e])}))}return t}({},jt,{steps:[{formatAs:"now"}].concat(jt.steps)});function Pt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Tt=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){Pt(t,e,r[e])}))}return t}({},jt,{steps:jt.steps.filter((function(t){return"second"!==t.formatAs}))});function Ft(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Nt=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){Ft(t,e,r[e])}))}return t}({},Tt,{steps:[{formatAs:"now"}].concat(Tt.steps)});function Et(t){return(Et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,o=!1,a=void 0;try{for(var i,u=t[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!e||r.length!==e);n=!0);}catch(t){o=!0,a=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw a}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Rt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Dt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var It,xt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.polyfill;Rt(this,t),"string"==typeof e&&(e=[e]),this.locale=R(e.concat(t.getDefaultLocale()),tt),"undefined"!=typeof Intl&&Intl.NumberFormat&&(this.numberFormat=new Intl.NumberFormat(this.locale)),!1===n?(this.IntlRelativeTimeFormat=Intl.RelativeTimeFormat,this.IntlPluralRules=Intl.PluralRules):(this.IntlRelativeTimeFormat=j,this.IntlPluralRules=j.PluralRules),this.relativeTimeFormatCache=new E,this.pluralRulesCache=new E}var e,r,n;return e=t,(r=[{key:"format",value:function(t,e,r){var n;r||(e&&"string"!=typeof(n=e)&&!Ct(n)?(r=e,e=void 0):r={}),e||(e=ot),"string"==typeof e&&(e=function(t){switch(t){case"default":case"round":return rt;case"round-minute":return ot;case"approximate":return it;case"time":case"approximate-time":return ut;case"mini":return jt;case"mini-now":return kt;case"mini-minute":return Tt;case"mini-minute-now":return Nt;case"twitter":return yt;case"twitter-now":return pt;case"twitter-minute":return vt;case"twitter-minute-now":return gt;case"twitter-first-minute":return St;default:return it}}(e));var o,a=function(t){if(t.constructor===Date||"object"===Et(e=t)&&"function"==typeof e.getTime)return t.getTime();var e;if("number"==typeof t)return t;throw new Error("Unsupported relative time formatter input: ".concat(Et(t),", ").concat(t))}(t),i=this.getLabels(e.flavour||e.labels),u=i.labels,l=i.labelsType;void 0!==e.now&&(o=e.now),void 0===o&&void 0!==r.now&&(o=r.now),void 0===o&&(o=Date.now());var f=(o-a)/1e3,c=r.future||f<0,s=function(t,e,r,n){var o=t.now||e&&e.now;return o?"string"==typeof o?o:n?o.future:o.past:r&&r.second&&r.second.current?r.second.current:void 0}(u,tt(this.locale).now,tt(this.locale).long,c);if(e.custom){var m=e.custom({now:o,date:new Date(a),time:a,elapsed:f,locale:this.locale});if(void 0!==m)return m}var y=function(t,e,r){var n=Object.keys(e);return r&&n.push("now"),t&&(n=t.filter((function(t){return"now"===t||n.indexOf(t)>=0}))),n}(e.units,u,s),h=r.round||e.round,p=Mt(H(e.gradation||e.steps||ot.steps,f,{now:o,units:y,round:h,future:c,getNextStep:!0}),3),b=p[0],v=p[1],d=p[2],g=this.formatDateForStep(a,v,f,{labels:u,labelsType:l,nowLabel:s,now:o,future:c,round:h})||"";return r.getTimeToNextUpdate?[g,X(a,v,{nextStep:d,prevStep:b,now:o,future:c,round:h})]:g}},{key:"formatDateForStep",value:function(t,e,r,n){var o=this,a=n.labels,i=n.labelsType,u=n.nowLabel,l=n.now,f=n.future,c=n.round;if(e){if(e.format)return e.format(t,this.locale,{formatAs:function(t,e){return o.formatValue(e,t,{labels:a,future:f})},now:l,future:f});var s=e.unit||e.formatAs;if(!s)throw new Error("[javascript-time-ago] Each step must define either `formatAs` or `format()`. Step: ".concat(JSON.stringify(e)));if("now"===s)return u;var m=Math.abs(r)/_(e);e.granularity&&(m=Y(c)(m/e.granularity)*e.granularity);var y=-1*Math.sign(r)*Y(c)(m);switch(0===y&&(y=f?0:-0),i){case"long":case"short":case"narrow":return this.getFormatter(i).format(y,s);default:return this.formatValue(y,s,{labels:a,future:f})}}}},{key:"formatValue",value:function(t,e,r){var n=r.labels,o=r.future;return this.getFormattingRule(n,e,t,{future:o}).replace("{0}",this.formatNumber(Math.abs(t)))}},{key:"getFormattingRule",value:function(t,e,r,n){var o=n.future;if(this.locale,"string"==typeof(t=t[e]))return t;var a=t[0===r?o?"future":"past":r<0?"past":"future"]||t;return"string"==typeof a?a:a[this.getPluralRules().select(Math.abs(r))]||a.other}},{key:"formatNumber",value:function(t){return this.numberFormat?this.numberFormat.format(t):String(t)}},{key:"getFormatter",value:function(t){return this.relativeTimeFormatCache.get(this.locale,t)||this.relativeTimeFormatCache.put(this.locale,t,new this.IntlRelativeTimeFormat(this.locale,{style:t}))}},{key:"getPluralRules",value:function(){return this.pluralRulesCache.get(this.locale)||this.pluralRulesCache.put(this.locale,new this.IntlPluralRules(this.locale))}},{key:"getLabels",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];"string"==typeof t&&(t=[t]),t=(t=t.map((function(t){switch(t){case"tiny":case"mini-time":return"mini";default:return t}}))).concat("long");var e=tt(this.locale),r=t,n=Array.isArray(r),o=0;for(r=n?r:r[Symbol.iterator]();;){var a;if(n){if(o>=r.length)break;a=r[o++]}else{if((o=r.next()).done)break;a=o.value}var i=a;if(e[i])return{labelsType:i,labels:e[i]}}}}])&&Dt(e.prototype,r),n&&Dt(e,n),t}(),Lt="en";xt.getDefaultLocale=function(){return Lt},xt.setDefaultLocale=function(t){return Lt=t},xt.addDefaultLocale=function(t){if(It)return console.error("[javascript-time-ago] `TimeAgo.addDefaultLocale()` can only be called once. To add other locales, use `TimeAgo.addLocale()`.");It=!0,xt.setDefaultLocale(t.locale),xt.addLocale(t)},xt.addLocale=function(t){et(t),j.addLocale(t)},xt.locale=xt.addLocale,xt.addLabels=function(t,e,r){var n=tt(t);n||(et({locale:t}),n=tt(t)),n[e]=r};var zt={}.constructor;function Ct(t){return function(t){return void 0!==Et(t)&&null!==t&&t.constructor===zt}(t)&&(Array.isArray(t.steps)||Array.isArray(t.gradation)||Array.isArray(t.flavour)||"string"==typeof t.flavour||Array.isArray(t.labels)||"string"==typeof t.labels||Array.isArray(t.units)||"function"==typeof t.custom)}t.default=xt,t.isStyleObject=Ct,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=javascript-time-ago.js.map

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["javascript-time-ago"]={})}(this,(function(t){"use strict";var e="en",r={},n={};function o(){return e}function a(t){return r[t]?t:n[t.toLowerCase()]?n[t.toLowerCase()]:void 0}function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.localeMatcher||"lookup";switch(r){case"lookup":case"best fit":return u(t);default:throw new RangeError('Invalid "localeMatcher" option: '.concat(r))}}function u(t){var e=a(t);if(e)return e;for(var r=t.split("-");t.length>1;){r.pop();var n=a(t=r.join("-"));if(n)return n}}var l={af:function(t){return 1==t?"one":"other"},am:function(t){return t>=0&&t<=1?"one":"other"},ar:function(t){var e=String(t).split("."),r=Number(e[0])==t&&e[0].slice(-2);return 0==t?"zero":1==t?"one":2==t?"two":r>=3&&r<=10?"few":r>=11&&r<=99?"many":"other"},ast:function(t){var e=!String(t).split(".")[1];return 1==t&&e?"one":"other"},be:function(t){var e=String(t).split("."),r=Number(e[0])==t,n=r&&e[0].slice(-1),o=r&&e[0].slice(-2);return 1==n&&11!=o?"one":n>=2&&n<=4&&(o<12||o>14)?"few":r&&0==n||n>=5&&n<=9||o>=11&&o<=14?"many":"other"},br:function(t){var e=String(t).split("."),r=Number(e[0])==t,n=r&&e[0].slice(-1),o=r&&e[0].slice(-2),a=r&&e[0].slice(-6);return 1==n&&11!=o&&71!=o&&91!=o?"one":2==n&&12!=o&&72!=o&&92!=o?"two":(3==n||4==n||9==n)&&(o<10||o>19)&&(o<70||o>79)&&(o<90||o>99)?"few":0!=t&&r&&0==a?"many":"other"},bs:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",o=!e[1],a=r.slice(-1),i=r.slice(-2),u=n.slice(-1),l=n.slice(-2);return o&&1==a&&11!=i||1==u&&11!=l?"one":o&&a>=2&&a<=4&&(i<12||i>14)||u>=2&&u<=4&&(l<12||l>14)?"few":"other"},cs:function(t){var e=String(t).split("."),r=e[0],n=!e[1];return 1==t&&n?"one":r>=2&&r<=4&&n?"few":n?"other":"many"},cy:function(t){return 0==t?"zero":1==t?"one":2==t?"two":3==t?"few":6==t?"many":"other"},da:function(t){var e=String(t).split("."),r=e[0],n=Number(e[0])==t;return 1!=t&&(n||0!=r&&1!=r)?"other":"one"},dsb:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",o=!e[1],a=r.slice(-2),i=n.slice(-2);return o&&1==a||1==i?"one":o&&2==a||2==i?"two":o&&(3==a||4==a)||3==i||4==i?"few":"other"},dz:function(t){return"other"},fil:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",o=!e[1],a=r.slice(-1),i=n.slice(-1);return o&&(1==r||2==r||3==r)||o&&4!=a&&6!=a&&9!=a||!o&&4!=i&&6!=i&&9!=i?"one":"other"},fr:function(t){return t>=0&&t<2?"one":"other"},ga:function(t){var e=String(t).split("."),r=Number(e[0])==t;return 1==t?"one":2==t?"two":r&&t>=3&&t<=6?"few":r&&t>=7&&t<=10?"many":"other"},gd:function(t){var e=String(t).split("."),r=Number(e[0])==t;return 1==t||11==t?"one":2==t||12==t?"two":r&&t>=3&&t<=10||r&&t>=13&&t<=19?"few":"other"},he:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=Number(e[0])==t,a=o&&e[0].slice(-1);return 1==t&&n?"one":2==r&&n?"two":n&&(t<0||t>10)&&o&&0==a?"many":"other"},is:function(t){var e=String(t).split("."),r=e[0],n=Number(e[0])==t,o=r.slice(-1),a=r.slice(-2);return n&&1==o&&11!=a||!n?"one":"other"},ksh:function(t){return 0==t?"zero":1==t?"one":"other"},lt:function(t){var e=String(t).split("."),r=e[1]||"",n=Number(e[0])==t,o=n&&e[0].slice(-1),a=n&&e[0].slice(-2);return 1==o&&(a<11||a>19)?"one":o>=2&&o<=9&&(a<11||a>19)?"few":0!=r?"many":"other"},lv:function(t){var e=String(t).split("."),r=e[1]||"",n=r.length,o=Number(e[0])==t,a=o&&e[0].slice(-1),i=o&&e[0].slice(-2),u=r.slice(-2),l=r.slice(-1);return o&&0==a||i>=11&&i<=19||2==n&&u>=11&&u<=19?"zero":1==a&&11!=i||2==n&&1==l&&11!=u||2!=n&&1==l?"one":"other"},mk:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",o=!e[1],a=r.slice(-1),i=r.slice(-2),u=n.slice(-1),l=n.slice(-2);return o&&1==a&&11!=i||1==u&&11!=l?"one":"other"},mt:function(t){var e=String(t).split("."),r=Number(e[0])==t&&e[0].slice(-2);return 1==t?"one":0==t||r>=2&&r<=10?"few":r>=11&&r<=19?"many":"other"},pa:function(t){return 0==t||1==t?"one":"other"},pl:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=r.slice(-1),a=r.slice(-2);return 1==t&&n?"one":n&&o>=2&&o<=4&&(a<12||a>14)?"few":n&&1!=r&&(0==o||1==o)||n&&o>=5&&o<=9||n&&a>=12&&a<=14?"many":"other"},pt:function(t){var e=String(t).split(".")[0];return 0==e||1==e?"one":"other"},ro:function(t){var e=String(t).split("."),r=!e[1],n=Number(e[0])==t&&e[0].slice(-2);return 1==t&&r?"one":!r||0==t||1!=t&&n>=1&&n<=19?"few":"other"},ru:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=r.slice(-1),a=r.slice(-2);return n&&1==o&&11!=a?"one":n&&o>=2&&o<=4&&(a<12||a>14)?"few":n&&0==o||n&&o>=5&&o<=9||n&&a>=11&&a<=14?"many":"other"},se:function(t){return 1==t?"one":2==t?"two":"other"},si:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"";return 0==t||1==t||0==r&&1==n?"one":"other"},sl:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=r.slice(-2);return n&&1==o?"one":n&&2==o?"two":n&&(3==o||4==o)||!n?"few":"other"}};function f(t){return"pt-PT"===t?t:function(t){var e=t.match(c);if(!e)throw new TypeError("Invalid locale: ".concat(t));return e[1]}(t)}l.as=l.am,l.az=l.af,l.bg=l.af,l.bn=l.am,l.ca=l.ast,l.ce=l.af,l.chr=l.af,l.de=l.ast,l.ee=l.af,l.el=l.af,l.en=l.ast,l.es=l.af,l.et=l.ast,l.eu=l.af,l.fa=l.am,l.fi=l.ast,l.fo=l.af,l.fur=l.af,l.fy=l.ast,l.gl=l.ast,l.gu=l.am,l.hi=l.am,l.hr=l.bs,l.hsb=l.dsb,l.hu=l.af,l.hy=l.fr,l.ia=l.ast,l.id=l.dz,l.it=l.ast,l.ja=l.dz,l.jgo=l.af,l.jv=l.dz,l.ka=l.af,l.kea=l.dz,l.kk=l.af,l.kl=l.af,l.km=l.dz,l.kn=l.am,l.ko=l.dz,l.ku=l.af,l.ky=l.af,l.lb=l.af,l.lkt=l.dz,l.lo=l.dz,l.ml=l.af,l.mn=l.af,l.mr=l.am,l.ms=l.dz,l.my=l.dz,l.nb=l.af,l.ne=l.af,l.nl=l.ast,l.nn=l.af,l.or=l.af,l.ps=l.af,l["pt-PT"]=l.ast,l.sah=l.dz,l.sd=l.af,l.sk=l.cs,l.so=l.af,l.sq=l.af,l.sr=l.bs,l.sv=l.ast,l.sw=l.ast,l.ta=l.af,l.te=l.af,l.th=l.dz,l.ti=l.pa,l.tk=l.af,l.to=l.dz,l.tr=l.af,l.ug=l.af,l.uk=l.ru,l.ur=l.ast,l.uz=l.af,l.vi=l.dz,l.wae=l.af,l.yi=l.ast,l.yue=l.dz,l.zh=l.dz,l.zu=l.am;var c=/^([a-z0-9]+)/i;function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var m=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=t.supportedLocalesOf(e);if(0===n.length)throw new RangeError("Unsupported locale: "+e);if(r&&"cardinal"!==r.type)throw new RangeError('Only "cardinal" "type" is supported');this.$=l[f(n[0])]}var e,r,n;return e=t,n=[{key:"supportedLocalesOf",value:function(t){return"string"==typeof t&&(t=[t]),t.filter((function(t){return l[f(t)]}))}}],(r=[{key:"select",value:function(t){return this.$(t)}}])&&s(e.prototype,r),n&&s(e,n),t}();function h(t){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){d(t,e,r[e])}))}return t}function y(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,o=!1,a=void 0;try{for(var i,u=t[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!e||r.length!==e);n=!0);}catch(t){o=!0,a=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw a}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function b(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function d(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var w=["second","minute","hour","day","week","month","quarter","year"],g=["auto","always"],O=["long","short","narrow"],S=["lookup","best fit"],j=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};b(this,t),d(this,"numeric","always"),d(this,"style","long"),d(this,"localeMatcher","lookup");var n=r.numeric,a=r.style,u=r.localeMatcher;if(void 0!==n){if(g.indexOf(n)<0)throw new RangeError('Invalid "numeric" option: '.concat(n));this.numeric=n}if(void 0!==a){if(O.indexOf(a)<0)throw new RangeError('Invalid "style" option: '.concat(a));this.style=a}if(void 0!==u){if(S.indexOf(u)<0)throw new RangeError('Invalid "localeMatcher" option: '.concat(u));this.localeMatcher=u}if("string"==typeof e&&(e=[e]),e.push(o()),this.locale=t.supportedLocalesOf(e,{localeMatcher:this.localeMatcher})[0],!this.locale)throw new Error("No supported locale was found");m.supportedLocalesOf(this.locale).length>0?this.pluralRules=new m(this.locale):console.warn('"'.concat(this.locale,'" locale is not supported')),"undefined"!=typeof Intl&&Intl.NumberFormat?(this.numberFormat=new Intl.NumberFormat(this.locale),this.numberingSystem=this.numberFormat.resolvedOptions().numberingSystem):this.numberingSystem="latn",this.locale=i(this.locale,{localeMatcher:this.localeMatcher})}var e,n,a;return e=t,(n=[{key:"format",value:function(){var t=T(arguments),e=y(t,2),r=e[0],n=e[1];return this.getRule(r,n).replace("{0}",this.formatNumber(Math.abs(r)))}},{key:"formatToParts",value:function(){var t=T(arguments),e=y(t,2),r=e[0],n=e[1],o=this.getRule(r,n),a=o.indexOf("{0}");if(a<0)return[{type:"literal",value:o}];var i=[];return a>0&&i.push({type:"literal",value:o.slice(0,a)}),i=i.concat(this.formatNumberToParts(Math.abs(r)).map((function(t){return p({},t,{unit:n})}))),a+"{0}".length<o.length-1&&i.push({type:"literal",value:o.slice(a+"{0}".length)}),i}},{key:"getRule",value:function(t,e){var n,o=(n=this.locale,r[n])[this.style][e];if("auto"===this.numeric)if(-2===t||-1===t){var a=o["previous".concat(-1===t?"":"-"+Math.abs(t))];if(a)return a}else if(1===t||2===t){var i=o["next".concat(1===t?"":"-"+Math.abs(t))];if(i)return i}else if(0===t&&o.current)return o.current;var u,l=o[(u=t,u<0||0===u&&function(t){return 1/t==-1/0}(u)?"past":"future")];return"string"==typeof l?l:l[this.pluralRules&&this.pluralRules.select(Math.abs(t))||"other"]||l.other}},{key:"formatNumber",value:function(t){return this.numberFormat?this.numberFormat.format(t):String(t)}},{key:"formatNumberToParts",value:function(t){return this.numberFormat&&this.numberFormat.formatToParts?this.numberFormat.formatToParts(t):[{type:"integer",value:this.formatNumber(t)}]}},{key:"resolvedOptions",value:function(){return{locale:this.locale,style:this.style,numeric:this.numeric,numberingSystem:this.numberingSystem}}}])&&v(e.prototype,n),a&&v(e,a),t}();j.supportedLocalesOf=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof t)t=[t];else if(!Array.isArray(t))throw new TypeError('Invalid "locales" argument');return t.filter((function(t){return i(t,e)}))},j.addLocale=function(t){if(!t)throw new Error("No locale data passed");r[t.locale]=t,n[t.locale.toLowerCase()]=t.locale},j.setDefaultLocale=function(t){e=t},j.getDefaultLocale=o,j.PluralRules=m;var A='Invalid "unit" argument';function k(t){if("symbol"===h(t))throw new TypeError(A);if("string"!=typeof t)throw new RangeError("".concat(A,": ").concat(t));if("s"===t[t.length-1]&&(t=t.slice(0,t.length-1)),w.indexOf(t)<0)throw new RangeError("".concat(A,": ").concat(t));return t}function P(t){if(t=Number(t),Number.isFinite&&!Number.isFinite(t))throw new RangeError("".concat('Invalid "number" argument',": ").concat(t));return t}function T(t){if(t.length<2)throw new TypeError('"unit" argument is required');return[P(t[0]),k(t[1])]}function F(t){return(F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function N(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var E=function(){function t(){var e,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n={},(r="cache")in(e=this)?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n}var e,r,n;return e=t,(r=[{key:"get",value:function(){for(var t=this.cache,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];for(var o=0;o<r.length;o++){var a=r[o];if("object"!==F(t))return;t=t[a]}return t}},{key:"put",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=e.pop(),o=e.pop(),a=this.cache,i=0;i<e.length;i++){var u=e[i];"object"!==F(a[u])&&(a[u]={}),a=a[u]}return a[o]=n}}])&&N(e.prototype,r),n&&N(e,n),t}();function D(t){return(D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function M(t,e){var r=t,n=Array.isArray(r),o=0;for(r=n?r:r[Symbol.iterator]();;){var a;if(n){if(o>=r.length)break;a=r[o++]}else{if((o=r.next()).done)break;a=o.value}var i=a;if(e(i))return i;for(var u=i.split("-");u.length>1;)if(u.pop(),e(i=u.join("-")))return i}throw new Error("No locale data has been registered for any of the locales: ".concat(t.join(", ")))}function R(){return"object"===("undefined"==typeof Intl?"undefined":D(Intl))&&"function"==typeof Intl.DateTimeFormat}var I=60,L=3600,x=86400,z=7*x,C=2630016,U=31556952;function _(t){switch(t){case"second":return 1;case"minute":return I;case"hour":return L;case"day":return x;case"week":return z;case"month":return C;case"year":return U}}function Y(t){return void 0!==t.factor?t.factor:_(t.unit||t.formatAs)||1}function q(t){switch(t){case"floor":return Math.floor;default:return Math.round}}function V(t){switch(t){case"floor":return 1;default:return.5}}function J(t){return(J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function $(t,e){var r,n=e.prevStep,o=e.timestamp,a=e.now,i=e.future,u=e.round;return n&&(n.id||n.unit)&&(r=t["threshold_for_".concat(n.id||n.unit)]),void 0===r&&void 0!==t.threshold&&"function"==typeof(r=t.threshold)&&(r=r(a,i)),void 0===r&&(r=t.minTime),"object"===J(r)&&(r=n&&n.id&&void 0!==r[n.id]?r[n.id]:r.default),"function"==typeof r&&(r=r(o,{future:i,getMinTimeForUnit:function(t,e){return B(t,e||n&&n.formatAs,{round:u})}})),void 0===r&&t.test&&(r=t.test(o,{now:a,future:i})?0:9007199254740991),void 0===r&&(n?t.formatAs&&n.formatAs&&(r=B(t.formatAs,n.formatAs,{round:u})):r=0),void 0===r&&console.warn("[javascript-time-ago] A step should specify `minTime`:\n"+JSON.stringify(t,null,2)),r}function B(t,e,r){var n,o=r.round,a=_(t);if(n=_("now"===e?t:e),void 0!==a&&void 0!==n)return a-n*(1-V(o))}function G(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){H(t,e,r[e])}))}return t}function H(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function K(t,e,r){var n=r.now,o=r.future,a=r.round,i=r.units,u=r.getNextStep,l=function(t,e,r){var n=r.now,o=r.future,a=r.round;if(0===t.length)return;var i=Q(t,e,{now:n,future:o||e<0,round:a});if(-1===i)return;var u=t[i];if(u.granularity){if(0===q(a)(Math.abs(e)/Y(u)/u.granularity)*u.granularity&&i>0)return t[i-1]}return u}(t=function(t,e){return t.filter((function(t){var r=t.unit,n=t.formatAs;return!(r=r||n)||e.indexOf(r)>=0}))}(t,i),e,{now:n,future:o,round:a});return u?l?[t[t.indexOf(l)-1],l,t[t.indexOf(l)+1]]:[void 0,void 0,t[0]]:l}function Q(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=$(t[n],G({prevStep:t[n-1],timestamp:r.now-1e3*e},r));return void 0===o||Math.abs(e)<o?n-1:n===t.length-1?n:Q(t,e,r,n+1)}function W(t,e,r){var n=r.now,o=r.round;if(_(t)){var a=1e3*_(t),i=e>n,u=Math.abs(e-n),l=q(o)(u/a)*a;return i?l>0?u-l+function(t,e){return(1-V(t))*e+1}(o,a):u-l+1:-(u-l)+function(t,e){return V(t)*e}(o,a)}}var X=31536e9;function Z(t,e,r){var n=r.prevStep,o=r.nextStep,a=r.now,i=r.future,u=r.round,l=t.getTime?t.getTime():t,f=function(t){return W(t,l,{now:a,round:u})},c=function(t,e,r){var n=r.now,o=r.future,a=r.round,i=r.prevStep;if(t){var u=function(t,e,r){var n=r.now,o=r.future,a=r.round,i=r.prevStep,u=$(t,{timestamp:e,now:n,future:o,round:a,prevStep:i});if(void 0===u)return;return o?e-1e3*u+1:0===u&&e===n?X:e+1e3*u}(t,e,{now:n,future:o,round:a,prevStep:i});if(void 0===u)return;return u-n}return o?e-n+1:X}(i?e:o,l,{future:i,now:a,round:u,prevStep:i?n:e});if(void 0!==c){var s;if(e&&(e.getTimeToNextUpdate&&(s=e.getTimeToNextUpdate(l,{getTimeToNextUpdateForUnit:f,getRoundFunction:q,now:a,future:i,round:u})),void 0===s)){var m=e.unit||e.formatAs;m&&(s=f(m))}return void 0===s?c:Math.min(s,c)}}var tt={};function et(t){return tt[t]}function rt(t){if(!t)throw new Error("[javascript-time-ago] No locale data passed.");tt[t.locale]=t}var nt={steps:[{formatAs:"now"},{formatAs:"second"},{formatAs:"minute"},{formatAs:"hour"},{formatAs:"day"},{formatAs:"week"},{formatAs:"month"},{formatAs:"year"}],labels:"long"};function ot(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var at=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){ot(t,e,r[e])}))}return t}({},nt,{steps:nt.steps.filter((function(t){return"second"!==t.formatAs}))}),it=[{factor:1,unit:"now"},{threshold:1,threshold_for_now:45.5,factor:1,unit:"second"},{threshold:45.5,factor:I,unit:"minute"},{threshold:150,granularity:5,factor:I,unit:"minute"},{threshold:1350,factor:1800,unit:"half-hour"},{threshold:2550,threshold_for_minute:3150,factor:L,unit:"hour"},{threshold:73800,factor:x,unit:"day"},{threshold:475200,factor:z,unit:"week"},{threshold:2116800,factor:C,unit:"month"},{threshold:27615168,factor:U,unit:"year"}],ut={gradation:it,flavour:"long",units:["now","minute","hour","day","week","month","year"]},lt={gradation:it,flavour:"long-time",units:["now","minute","hour","day","week","month","year"]};function ft(t){return t instanceof Date?t:new Date(t)}var ct=[{formatAs:"second"},{formatAs:"minute"},{formatAs:"hour"}],st={},mt={minTime:function(t,e){e.future;return(0,e.getMinTimeForUnit)("day")},format:function(t,e){return st[e]||(st[e]={}),st[e].dayMonth||(st[e].dayMonth=new Intl.DateTimeFormat(e,{month:"short",day:"numeric"})),st[e].dayMonth.format(ft(t))}},ht={minTime:function(t,e){return e.future?(t-(new Date(new Date(t).getFullYear(),0).getTime()-1))/1e3:(new Date(new Date(t).getFullYear()+1,0).getTime()-t)/1e3},format:function(t,e){return st[e]||(st[e]={}),st[e].dayMonthYear||(st[e].dayMonthYear=new Intl.DateTimeFormat(e,{year:"numeric",month:"short",day:"numeric"})),st[e].dayMonthYear.format(ft(t))}};R()?ct.push(mt,ht):ct.push({formatAs:"day"},{formatAs:"week"},{formatAs:"month"},{formatAs:"year"});var pt={steps:ct,labels:["mini","short-time","narrow","short"]};function yt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var bt=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){yt(t,e,r[e])}))}return t}({},pt,{steps:[{formatAs:"now"}].concat(pt.steps)});function vt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var dt=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){vt(t,e,r[e])}))}return t}({},pt,{steps:pt.steps.filter((function(t){return"second"!==t.formatAs}))});function wt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var gt=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){wt(t,e,r[e])}))}return t}({},dt,{steps:[{formatAs:"now"}].concat(dt.steps)});function Ot(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){St(t,e,r[e])}))}return t}function St(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var jt=Ot({},pt,{steps:pt.steps.filter((function(t){return"second"!==t.formatAs})).map((function(t){return"minute"===t.formatAs?Ot({},t,{minTime:I}):t}))}),At={steps:[{formatAs:"second"},{formatAs:"minute"},{formatAs:"hour"},{formatAs:"day"},{formatAs:"month"},{formatAs:"year"}],labels:["mini","short-time","narrow","short"]};function kt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Pt=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){kt(t,e,r[e])}))}return t}({},At,{steps:[{formatAs:"now"}].concat(At.steps)});function Tt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ft=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){Tt(t,e,r[e])}))}return t}({},At,{steps:At.steps.filter((function(t){return"second"!==t.formatAs}))});function Nt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Et=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){Nt(t,e,r[e])}))}return t}({},Ft,{steps:[{formatAs:"now"}].concat(Ft.steps)});function Dt(t){return(Dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,o=!1,a=void 0;try{for(var i,u=t[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!e||r.length!==e);n=!0);}catch(t){o=!0,a=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw a}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Rt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function It(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Lt,xt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.polyfill;Rt(this,t),"string"==typeof e&&(e=[e]),this.locale=M(e.concat(t.getDefaultLocale()),et),"undefined"!=typeof Intl&&Intl.NumberFormat&&(this.numberFormat=new Intl.NumberFormat(this.locale)),!1===n?(this.IntlRelativeTimeFormat=Intl.RelativeTimeFormat,this.IntlPluralRules=Intl.PluralRules):(this.IntlRelativeTimeFormat=j,this.IntlPluralRules=j.PluralRules),this.relativeTimeFormatCache=new E,this.pluralRulesCache=new E}var e,r,n;return e=t,(r=[{key:"format",value:function(t,e,r){var n,o;r||(!e||"string"==typeof(n=e)||function(t){return void 0!==Dt(t)&&null!==t&&t.constructor===Ct}(o=n)&&(Array.isArray(o.steps)||Array.isArray(o.gradation)||Array.isArray(o.flavour)||"string"==typeof o.flavour||Array.isArray(o.labels)||"string"==typeof o.labels||Array.isArray(o.units)||"function"==typeof o.custom)?r={}:(r=e,e=void 0)),e||(e=at),"string"==typeof e&&(e=function(t){switch(t){case"default":case"round":return nt;case"round-minute":return at;case"approximate":return ut;case"time":case"approximate-time":return lt;case"mini":return At;case"mini-now":return Pt;case"mini-minute":return Ft;case"mini-minute-now":return Et;case"twitter":return pt;case"twitter-now":return bt;case"twitter-minute":return dt;case"twitter-minute-now":return gt;case"twitter-first-minute":return jt;default:return ut}}(e));var a,i=function(t){if(t.constructor===Date||function(t){return"object"===Dt(t)&&"function"==typeof t.getTime}(t))return t.getTime();if("number"==typeof t)return t;throw new Error("Unsupported relative time formatter input: ".concat(Dt(t),", ").concat(t))}(t),u=this.getLabels(e.flavour||e.labels),l=u.labels,f=u.labelsType;void 0!==e.now&&(a=e.now),void 0===a&&void 0!==r.now&&(a=r.now),void 0===a&&(a=Date.now());var c=(a-i)/1e3,s=r.future||c<0,m=function(t,e,r,n){var o=t.now||e&&e.now;return o?"string"==typeof o?o:n?o.future:o.past:r&&r.second&&r.second.current?r.second.current:void 0}(l,et(this.locale).now,et(this.locale).long,s);if(e.custom){var h=e.custom({now:a,date:new Date(i),time:i,elapsed:c,locale:this.locale});if(void 0!==h)return h}var p=function(t,e,r){var n=Object.keys(e);return r&&n.push("now"),t&&(n=t.filter((function(t){return"now"===t||n.indexOf(t)>=0}))),n}(e.units,l,m),y=r.round||e.round,b=Mt(K(e.gradation||e.steps||at.steps,c,{now:a,units:p,round:y,future:s,getNextStep:!0}),3),v=b[0],d=b[1],w=b[2],g=this.formatDateForStep(i,d,c,{labels:l,labelsType:f,nowLabel:m,now:a,future:s,round:y})||"";return r.getTimeToNextUpdate?[g,Z(i,d,{nextStep:w,prevStep:v,now:a,future:s,round:y})]:g}},{key:"formatDateForStep",value:function(t,e,r,n){var o=this,a=n.labels,i=n.labelsType,u=n.nowLabel,l=n.now,f=n.future,c=n.round;if(e){if(e.format)return e.format(t,this.locale,{formatAs:function(t,e){return o.formatValue(e,t,{labels:a,future:f})},now:l,future:f});var s=e.unit||e.formatAs;if(!s)throw new Error("[javascript-time-ago] Each step must define either `formatAs` or `format()`. Step: ".concat(JSON.stringify(e)));if("now"===s)return u;var m=Math.abs(r)/Y(e);e.granularity&&(m=q(c)(m/e.granularity)*e.granularity);var h=-1*Math.sign(r)*q(c)(m);switch(0===h&&(h=f?0:-0),i){case"long":case"short":case"narrow":return this.getFormatter(i).format(h,s);default:return this.formatValue(h,s,{labels:a,future:f})}}}},{key:"formatValue",value:function(t,e,r){var n=r.labels,o=r.future;return this.getFormattingRule(n,e,t,{future:o}).replace("{0}",this.formatNumber(Math.abs(t)))}},{key:"getFormattingRule",value:function(t,e,r,n){var o=n.future;if(this.locale,"string"==typeof(t=t[e]))return t;var a=t[0===r?o?"future":"past":r<0?"past":"future"]||t;return"string"==typeof a?a:a[this.getPluralRules().select(Math.abs(r))]||a.other}},{key:"formatNumber",value:function(t){return this.numberFormat?this.numberFormat.format(t):String(t)}},{key:"getFormatter",value:function(t){return this.relativeTimeFormatCache.get(this.locale,t)||this.relativeTimeFormatCache.put(this.locale,t,new this.IntlRelativeTimeFormat(this.locale,{style:t}))}},{key:"getPluralRules",value:function(){return this.pluralRulesCache.get(this.locale)||this.pluralRulesCache.put(this.locale,new this.IntlPluralRules(this.locale))}},{key:"getLabels",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];"string"==typeof t&&(t=[t]),t=(t=t.map((function(t){switch(t){case"tiny":case"mini-time":return"mini";default:return t}}))).concat("long");var e=et(this.locale),r=t,n=Array.isArray(r),o=0;for(r=n?r:r[Symbol.iterator]();;){var a;if(n){if(o>=r.length)break;a=r[o++]}else{if((o=r.next()).done)break;a=o.value}var i=a;if(e[i])return{labelsType:i,labels:e[i]}}}}])&&It(e.prototype,r),n&&It(e,n),t}(),zt="en";xt.getDefaultLocale=function(){return zt},xt.setDefaultLocale=function(t){return zt=t},xt.addDefaultLocale=function(t){if(Lt)throw new Error("[javascript-time-ago] `TimeAgo.addDefaultLocale()` can only be called once. To add other locales, use `TimeAgo.addLocale()`.");Lt=!0,xt.setDefaultLocale(t.locale),xt.addLocale(t)},xt.addLocale=function(t){rt(t),j.addLocale(t)},xt.locale=xt.addLocale,xt.addLabels=function(t,e,r){var n=et(t);n||(rt({locale:t}),n=et(t)),n[e]=r};var Ct={}.constructor;t.default=xt,t.intlDateTimeFormatSupported=R,t.intlDateTimeFormatSupportedLocale=function(t){if(R())return Intl.DateTimeFormat.supportedLocalesOf(t)[0]},Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["javascript-time-ago"]={})}(this,(function(t){"use strict";var e="en",r={},n={};function o(){return e}function a(t){return r[t]?t:n[t.toLowerCase()]?n[t.toLowerCase()]:void 0}function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.localeMatcher||"lookup";switch(r){case"lookup":case"best fit":return u(t);default:throw new RangeError('Invalid "localeMatcher" option: '.concat(r))}}function u(t){var e=a(t);if(e)return e;for(var r=t.split("-");t.length>1;){r.pop();var n=a(t=r.join("-"));if(n)return n}}var l={af:function(t){return 1==t?"one":"other"},am:function(t){return t>=0&&t<=1?"one":"other"},ar:function(t){var e=String(t).split("."),r=Number(e[0])==t&&e[0].slice(-2);return 0==t?"zero":1==t?"one":2==t?"two":r>=3&&r<=10?"few":r>=11&&r<=99?"many":"other"},ast:function(t){var e=!String(t).split(".")[1];return 1==t&&e?"one":"other"},be:function(t){var e=String(t).split("."),r=Number(e[0])==t,n=r&&e[0].slice(-1),o=r&&e[0].slice(-2);return 1==n&&11!=o?"one":n>=2&&n<=4&&(o<12||o>14)?"few":r&&0==n||n>=5&&n<=9||o>=11&&o<=14?"many":"other"},br:function(t){var e=String(t).split("."),r=Number(e[0])==t,n=r&&e[0].slice(-1),o=r&&e[0].slice(-2),a=r&&e[0].slice(-6);return 1==n&&11!=o&&71!=o&&91!=o?"one":2==n&&12!=o&&72!=o&&92!=o?"two":(3==n||4==n||9==n)&&(o<10||o>19)&&(o<70||o>79)&&(o<90||o>99)?"few":0!=t&&r&&0==a?"many":"other"},bs:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",o=!e[1],a=r.slice(-1),i=r.slice(-2),u=n.slice(-1),l=n.slice(-2);return o&&1==a&&11!=i||1==u&&11!=l?"one":o&&a>=2&&a<=4&&(i<12||i>14)||u>=2&&u<=4&&(l<12||l>14)?"few":"other"},cs:function(t){var e=String(t).split("."),r=e[0],n=!e[1];return 1==t&&n?"one":r>=2&&r<=4&&n?"few":n?"other":"many"},cy:function(t){return 0==t?"zero":1==t?"one":2==t?"two":3==t?"few":6==t?"many":"other"},da:function(t){var e=String(t).split("."),r=e[0],n=Number(e[0])==t;return 1!=t&&(n||0!=r&&1!=r)?"other":"one"},dsb:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",o=!e[1],a=r.slice(-2),i=n.slice(-2);return o&&1==a||1==i?"one":o&&2==a||2==i?"two":o&&(3==a||4==a)||3==i||4==i?"few":"other"},dz:function(t){return"other"},fil:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",o=!e[1],a=r.slice(-1),i=n.slice(-1);return o&&(1==r||2==r||3==r)||o&&4!=a&&6!=a&&9!=a||!o&&4!=i&&6!=i&&9!=i?"one":"other"},fr:function(t){return t>=0&&t<2?"one":"other"},ga:function(t){var e=String(t).split("."),r=Number(e[0])==t;return 1==t?"one":2==t?"two":r&&t>=3&&t<=6?"few":r&&t>=7&&t<=10?"many":"other"},gd:function(t){var e=String(t).split("."),r=Number(e[0])==t;return 1==t||11==t?"one":2==t||12==t?"two":r&&t>=3&&t<=10||r&&t>=13&&t<=19?"few":"other"},he:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=Number(e[0])==t,a=o&&e[0].slice(-1);return 1==t&&n?"one":2==r&&n?"two":n&&(t<0||t>10)&&o&&0==a?"many":"other"},is:function(t){var e=String(t).split("."),r=e[0],n=Number(e[0])==t,o=r.slice(-1),a=r.slice(-2);return n&&1==o&&11!=a||!n?"one":"other"},ksh:function(t){return 0==t?"zero":1==t?"one":"other"},lt:function(t){var e=String(t).split("."),r=e[1]||"",n=Number(e[0])==t,o=n&&e[0].slice(-1),a=n&&e[0].slice(-2);return 1==o&&(a<11||a>19)?"one":o>=2&&o<=9&&(a<11||a>19)?"few":0!=r?"many":"other"},lv:function(t){var e=String(t).split("."),r=e[1]||"",n=r.length,o=Number(e[0])==t,a=o&&e[0].slice(-1),i=o&&e[0].slice(-2),u=r.slice(-2),l=r.slice(-1);return o&&0==a||i>=11&&i<=19||2==n&&u>=11&&u<=19?"zero":1==a&&11!=i||2==n&&1==l&&11!=u||2!=n&&1==l?"one":"other"},mk:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",o=!e[1],a=r.slice(-1),i=r.slice(-2),u=n.slice(-1),l=n.slice(-2);return o&&1==a&&11!=i||1==u&&11!=l?"one":"other"},mt:function(t){var e=String(t).split("."),r=Number(e[0])==t&&e[0].slice(-2);return 1==t?"one":0==t||r>=2&&r<=10?"few":r>=11&&r<=19?"many":"other"},pa:function(t){return 0==t||1==t?"one":"other"},pl:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=r.slice(-1),a=r.slice(-2);return 1==t&&n?"one":n&&o>=2&&o<=4&&(a<12||a>14)?"few":n&&1!=r&&(0==o||1==o)||n&&o>=5&&o<=9||n&&a>=12&&a<=14?"many":"other"},pt:function(t){var e=String(t).split(".")[0];return 0==e||1==e?"one":"other"},ro:function(t){var e=String(t).split("."),r=!e[1],n=Number(e[0])==t&&e[0].slice(-2);return 1==t&&r?"one":!r||0==t||1!=t&&n>=1&&n<=19?"few":"other"},ru:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=r.slice(-1),a=r.slice(-2);return n&&1==o&&11!=a?"one":n&&o>=2&&o<=4&&(a<12||a>14)?"few":n&&0==o||n&&o>=5&&o<=9||n&&a>=11&&a<=14?"many":"other"},se:function(t){return 1==t?"one":2==t?"two":"other"},si:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"";return 0==t||1==t||0==r&&1==n?"one":"other"},sl:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=r.slice(-2);return n&&1==o?"one":n&&2==o?"two":n&&(3==o||4==o)||!n?"few":"other"}};function f(t){return"pt-PT"===t?t:function(t){var e=t.match(c);if(!e)throw new TypeError("Invalid locale: ".concat(t));return e[1]}(t)}l.as=l.am,l.az=l.af,l.bg=l.af,l.bn=l.am,l.ca=l.ast,l.ce=l.af,l.chr=l.af,l.de=l.ast,l.ee=l.af,l.el=l.af,l.en=l.ast,l.es=l.af,l.et=l.ast,l.eu=l.af,l.fa=l.am,l.fi=l.ast,l.fo=l.af,l.fur=l.af,l.fy=l.ast,l.gl=l.ast,l.gu=l.am,l.hi=l.am,l.hr=l.bs,l.hsb=l.dsb,l.hu=l.af,l.hy=l.fr,l.ia=l.ast,l.id=l.dz,l.it=l.ast,l.ja=l.dz,l.jgo=l.af,l.jv=l.dz,l.ka=l.af,l.kea=l.dz,l.kk=l.af,l.kl=l.af,l.km=l.dz,l.kn=l.am,l.ko=l.dz,l.ku=l.af,l.ky=l.af,l.lb=l.af,l.lkt=l.dz,l.lo=l.dz,l.ml=l.af,l.mn=l.af,l.mr=l.am,l.ms=l.dz,l.my=l.dz,l.nb=l.af,l.ne=l.af,l.nl=l.ast,l.nn=l.af,l.or=l.af,l.ps=l.af,l["pt-PT"]=l.ast,l.sah=l.dz,l.sd=l.af,l.sk=l.cs,l.so=l.af,l.sq=l.af,l.sr=l.bs,l.sv=l.ast,l.sw=l.ast,l.ta=l.af,l.te=l.af,l.th=l.dz,l.ti=l.pa,l.tk=l.af,l.to=l.dz,l.tr=l.af,l.ug=l.af,l.uk=l.ru,l.ur=l.ast,l.uz=l.af,l.vi=l.dz,l.wae=l.af,l.yi=l.ast,l.yue=l.dz,l.zh=l.dz,l.zu=l.am;var c=/^([a-z0-9]+)/i;function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var m=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=t.supportedLocalesOf(e);if(0===n.length)throw new RangeError("Unsupported locale: "+e);if(r&&"cardinal"!==r.type)throw new RangeError('Only "cardinal" "type" is supported');this.$=l[f(n[0])]}var e,r,n;return e=t,n=[{key:"supportedLocalesOf",value:function(t){return"string"==typeof t&&(t=[t]),t.filter((function(t){return l[f(t)]}))}}],(r=[{key:"select",value:function(t){return this.$(t)}}])&&s(e.prototype,r),n&&s(e,n),t}();function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function h(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){d(t,e,r[e])}))}return t}function y(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,o=!1,a=void 0;try{for(var i,u=t[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!e||r.length!==e);n=!0);}catch(t){o=!0,a=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw a}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function b(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function d(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var g=["second","minute","hour","day","week","month","quarter","year"],w=["auto","always"],O=["long","short","narrow"],S=["lookup","best fit"],j=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};b(this,t),d(this,"numeric","always"),d(this,"style","long"),d(this,"localeMatcher","lookup");var n=r.numeric,a=r.style,u=r.localeMatcher;if(void 0!==n){if(w.indexOf(n)<0)throw new RangeError('Invalid "numeric" option: '.concat(n));this.numeric=n}if(void 0!==a){if(O.indexOf(a)<0)throw new RangeError('Invalid "style" option: '.concat(a));this.style=a}if(void 0!==u){if(S.indexOf(u)<0)throw new RangeError('Invalid "localeMatcher" option: '.concat(u));this.localeMatcher=u}if("string"==typeof e&&(e=[e]),e.push(o()),this.locale=t.supportedLocalesOf(e,{localeMatcher:this.localeMatcher})[0],!this.locale)throw new Error("No supported locale was found");m.supportedLocalesOf(this.locale).length>0?this.pluralRules=new m(this.locale):console.warn('"'.concat(this.locale,'" locale is not supported')),"undefined"!=typeof Intl&&Intl.NumberFormat?(this.numberFormat=new Intl.NumberFormat(this.locale),this.numberingSystem=this.numberFormat.resolvedOptions().numberingSystem):this.numberingSystem="latn",this.locale=i(this.locale,{localeMatcher:this.localeMatcher})}var e,n,a;return e=t,(n=[{key:"format",value:function(){var t=T(arguments),e=y(t,2),r=e[0],n=e[1];return this.getRule(r,n).replace("{0}",this.formatNumber(Math.abs(r)))}},{key:"formatToParts",value:function(){var t=T(arguments),e=y(t,2),r=e[0],n=e[1],o=this.getRule(r,n),a=o.indexOf("{0}");if(a<0)return[{type:"literal",value:o}];var i=[];return a>0&&i.push({type:"literal",value:o.slice(0,a)}),i=i.concat(this.formatNumberToParts(Math.abs(r)).map((function(t){return h({},t,{unit:n})}))),a+"{0}".length<o.length-1&&i.push({type:"literal",value:o.slice(a+"{0}".length)}),i}},{key:"getRule",value:function(t,e){var n,o=(n=this.locale,r[n])[this.style][e];if("auto"===this.numeric)if(-2===t||-1===t){var a=o["previous".concat(-1===t?"":"-"+Math.abs(t))];if(a)return a}else if(1===t||2===t){var i=o["next".concat(1===t?"":"-"+Math.abs(t))];if(i)return i}else if(0===t&&o.current)return o.current;var u,l=o[(u=t,u<0||0===u&&function(t){return 1/t==-1/0}(u)?"past":"future")];return"string"==typeof l?l:l[this.pluralRules&&this.pluralRules.select(Math.abs(t))||"other"]||l.other}},{key:"formatNumber",value:function(t){return this.numberFormat?this.numberFormat.format(t):String(t)}},{key:"formatNumberToParts",value:function(t){return this.numberFormat&&this.numberFormat.formatToParts?this.numberFormat.formatToParts(t):[{type:"integer",value:this.formatNumber(t)}]}},{key:"resolvedOptions",value:function(){return{locale:this.locale,style:this.style,numeric:this.numeric,numberingSystem:this.numberingSystem}}}])&&v(e.prototype,n),a&&v(e,a),t}();j.supportedLocalesOf=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof t)t=[t];else if(!Array.isArray(t))throw new TypeError('Invalid "locales" argument');return t.filter((function(t){return i(t,e)}))},j.addLocale=function(t){if(!t)throw new Error("No locale data passed");r[t.locale]=t,n[t.locale.toLowerCase()]=t.locale},j.setDefaultLocale=function(t){e=t},j.getDefaultLocale=o,j.PluralRules=m;var A='Invalid "unit" argument';function k(t){if("symbol"===p(t))throw new TypeError(A);if("string"!=typeof t)throw new RangeError("".concat(A,": ").concat(t));if("s"===t[t.length-1]&&(t=t.slice(0,t.length-1)),g.indexOf(t)<0)throw new RangeError("".concat(A,": ").concat(t));return t}function P(t){if(t=Number(t),Number.isFinite&&!Number.isFinite(t))throw new RangeError("".concat('Invalid "number" argument',": ").concat(t));return t}function T(t){if(t.length<2)throw new TypeError('"unit" argument is required');return[P(t[0]),k(t[1])]}function F(t){return(F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function N(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var E=function(){function t(){var e,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n={},(r="cache")in(e=this)?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n}var e,r,n;return e=t,(r=[{key:"get",value:function(){for(var t=this.cache,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];for(var o=0;o<r.length;o++){var a=r[o];if("object"!==F(t))return;t=t[a]}return t}},{key:"put",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=e.pop(),o=e.pop(),a=this.cache,i=0;i<e.length;i++){var u=e[i];"object"!==F(a[u])&&(a[u]={}),a=a[u]}return a[o]=n}}])&&N(e.prototype,r),n&&N(e,n),t}();function D(t){return(D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function M(t,e){var r=t,n=Array.isArray(r),o=0;for(r=n?r:r[Symbol.iterator]();;){var a;if(n){if(o>=r.length)break;a=r[o++]}else{if((o=r.next()).done)break;a=o.value}var i=a;if(e(i))return i;for(var u=i.split("-");u.length>1;)if(u.pop(),e(i=u.join("-")))return i}throw new Error("No locale data has been registered for any of the locales: ".concat(t.join(", ")))}function R(){return"object"===("undefined"==typeof Intl?"undefined":D(Intl))&&"function"==typeof Intl.DateTimeFormat}var I=60,L=3600,x=86400,z=7*x,C=2630016,U=31556952;function _(t){switch(t){case"second":return 1;case"minute":return I;case"hour":return L;case"day":return x;case"week":return z;case"month":return C;case"year":return U}}function Y(t){return void 0!==t.factor?t.factor:_(t.unit||t.formatAs)||1}function q(t){switch(t){case"floor":return Math.floor;default:return Math.round}}function V(t){switch(t){case"floor":return 1;default:return.5}}function J(t){return(J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function $(t,e){var r,n=e.prevStep,o=e.timestamp,a=e.now,i=e.future,u=e.round;return n&&(n.id||n.unit)&&(r=t["threshold_for_".concat(n.id||n.unit)]),void 0===r&&void 0!==t.threshold&&"function"==typeof(r=t.threshold)&&(r=r(a,i)),void 0===r&&(r=t.minTime),"object"===J(r)&&(r=n&&n.id&&void 0!==r[n.id]?r[n.id]:r.default),"function"==typeof r&&(r=r(o,{future:i,getMinTimeForUnit:function(t,e){return B(t,e||n&&n.formatAs,{round:u})}})),void 0===r&&t.test&&(r=t.test(o,{now:a,future:i})?0:9007199254740991),void 0===r&&(n?t.formatAs&&n.formatAs&&(r=B(t.formatAs,n.formatAs,{round:u})):r=0),void 0===r&&console.warn("[javascript-time-ago] A step should specify `minTime`:\n"+JSON.stringify(t,null,2)),r}function B(t,e,r){var n,o=r.round,a=_(t);if(n=_("now"===e?t:e),void 0!==a&&void 0!==n)return a-n*(1-V(o))}function G(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){H(t,e,r[e])}))}return t}function H(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function K(t,e,r){var n=r.now,o=r.future,a=r.round,i=r.units,u=r.getNextStep,l=function(t,e,r){var n=r.now,o=r.future,a=r.round;if(0===t.length)return;var i=Q(t,e,{now:n,future:o||e<0,round:a});if(-1===i)return;var u=t[i];if(u.granularity){if(0===q(a)(Math.abs(e)/Y(u)/u.granularity)*u.granularity&&i>0)return t[i-1]}return u}(t=function(t,e){return t.filter((function(t){var r=t.unit,n=t.formatAs;return!(r=r||n)||e.indexOf(r)>=0}))}(t,i),e,{now:n,future:o,round:a});return u?l?[t[t.indexOf(l)-1],l,t[t.indexOf(l)+1]]:[void 0,void 0,t[0]]:l}function Q(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=$(t[n],G({prevStep:t[n-1],timestamp:r.now-1e3*e},r));return void 0===o||Math.abs(e)<o?n-1:n===t.length-1?n:Q(t,e,r,n+1)}function W(t,e,r){var n=r.now,o=r.round;if(_(t)){var a=1e3*_(t),i=e>n,u=Math.abs(e-n),l=q(o)(u/a)*a;return i?l>0?u-l+function(t,e){return(1-V(t))*e+1}(o,a):u-l+1:-(u-l)+function(t,e){return V(t)*e}(o,a)}}var X=31536e9;function Z(t,e,r){var n=r.prevStep,o=r.nextStep,a=r.now,i=r.future,u=r.round,l=t.getTime?t.getTime():t,f=function(t){return W(t,l,{now:a,round:u})},c=function(t,e,r){var n=r.now,o=r.future,a=r.round,i=r.prevStep;if(t){var u=function(t,e,r){var n=r.now,o=r.future,a=r.round,i=r.prevStep,u=$(t,{timestamp:e,now:n,future:o,round:a,prevStep:i});if(void 0===u)return;return o?e-1e3*u+1:0===u&&e===n?X:e+1e3*u}(t,e,{now:n,future:o,round:a,prevStep:i});if(void 0===u)return;return u-n}return o?e-n+1:X}(i?e:o,l,{future:i,now:a,round:u,prevStep:i?n:e});if(void 0!==c){var s;if(e&&(e.getTimeToNextUpdate&&(s=e.getTimeToNextUpdate(l,{getTimeToNextUpdateForUnit:f,getRoundFunction:q,now:a,future:i,round:u})),void 0===s)){var m=e.unit||e.formatAs;m&&(s=f(m))}return void 0===s?c:Math.min(s,c)}}var tt={};function et(t){return tt[t]}function rt(t){if(!t)throw new Error("[javascript-time-ago] No locale data passed.");tt[t.locale]=t}var nt={steps:[{formatAs:"now"},{formatAs:"second"},{formatAs:"minute"},{formatAs:"hour"},{formatAs:"day"},{formatAs:"week"},{formatAs:"month"},{formatAs:"year"}],labels:"long"};function ot(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var at=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){ot(t,e,r[e])}))}return t}({},nt,{steps:nt.steps.filter((function(t){return"second"!==t.formatAs}))}),it=[{factor:1,unit:"now"},{threshold:1,threshold_for_now:45.5,factor:1,unit:"second"},{threshold:45.5,factor:I,unit:"minute"},{threshold:150,granularity:5,factor:I,unit:"minute"},{threshold:1350,factor:1800,unit:"half-hour"},{threshold:2550,threshold_for_minute:3150,factor:L,unit:"hour"},{threshold:73800,factor:x,unit:"day"},{threshold:475200,factor:z,unit:"week"},{threshold:2116800,factor:C,unit:"month"},{threshold:27615168,factor:U,unit:"year"}],ut={gradation:it,flavour:"long",units:["now","minute","hour","day","week","month","year"]},lt={gradation:it,flavour:"long-time",units:["now","minute","hour","day","week","month","year"]};function ft(t){return t instanceof Date?t:new Date(t)}var ct=[{formatAs:"second"},{formatAs:"minute"},{formatAs:"hour"}],st={},mt={minTime:function(t,e){e.future;return(0,e.getMinTimeForUnit)("day")},format:function(t,e){return st[e]||(st[e]={}),st[e].dayMonth||(st[e].dayMonth=new Intl.DateTimeFormat(e,{month:"short",day:"numeric"})),st[e].dayMonth.format(ft(t))}},pt={minTime:function(t,e){return e.future?(t-(new Date(new Date(t).getFullYear(),0).getTime()-1))/1e3:(new Date(new Date(t).getFullYear()+1,0).getTime()-t)/1e3},format:function(t,e){return st[e]||(st[e]={}),st[e].dayMonthYear||(st[e].dayMonthYear=new Intl.DateTimeFormat(e,{year:"numeric",month:"short",day:"numeric"})),st[e].dayMonthYear.format(ft(t))}};R()?ct.push(mt,pt):ct.push({formatAs:"day"},{formatAs:"week"},{formatAs:"month"},{formatAs:"year"});var ht={steps:ct,labels:["mini","short-time","narrow","short"]};function yt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var bt=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){yt(t,e,r[e])}))}return t}({},ht,{steps:[{formatAs:"now"}].concat(ht.steps)});function vt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var dt=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){vt(t,e,r[e])}))}return t}({},ht,{steps:ht.steps.filter((function(t){return"second"!==t.formatAs}))});function gt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var wt=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){gt(t,e,r[e])}))}return t}({},dt,{steps:[{formatAs:"now"}].concat(dt.steps)});function Ot(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){St(t,e,r[e])}))}return t}function St(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var jt=Ot({},ht,{steps:ht.steps.filter((function(t){return"second"!==t.formatAs})).map((function(t){return"minute"===t.formatAs?Ot({},t,{minTime:I}):t}))}),At={steps:[{formatAs:"second"},{formatAs:"minute"},{formatAs:"hour"},{formatAs:"day"},{formatAs:"month"},{formatAs:"year"}],labels:["mini","short-time","narrow","short"]};function kt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Pt=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){kt(t,e,r[e])}))}return t}({},At,{steps:[{formatAs:"now"}].concat(At.steps)});function Tt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ft=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){Tt(t,e,r[e])}))}return t}({},At,{steps:At.steps.filter((function(t){return"second"!==t.formatAs}))});function Nt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Et=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){Nt(t,e,r[e])}))}return t}({},Ft,{steps:[{formatAs:"now"}].concat(Ft.steps)});function Dt(t){return(Dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,o=!1,a=void 0;try{for(var i,u=t[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!e||r.length!==e);n=!0);}catch(t){o=!0,a=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw a}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Rt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function It(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Lt,xt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.polyfill;Rt(this,t),"string"==typeof e&&(e=[e]),this.locale=M(e.concat(t.getDefaultLocale()),et),"undefined"!=typeof Intl&&Intl.NumberFormat&&(this.numberFormat=new Intl.NumberFormat(this.locale)),!1===n?(this.IntlRelativeTimeFormat=Intl.RelativeTimeFormat,this.IntlPluralRules=Intl.PluralRules):(this.IntlRelativeTimeFormat=j,this.IntlPluralRules=j.PluralRules),this.relativeTimeFormatCache=new E,this.pluralRulesCache=new E}var e,r,n;return e=t,(r=[{key:"format",value:function(t,e,r){var n,o;r||(!e||"string"==typeof(n=e)||function(t){return void 0!==Dt(t)&&null!==t&&t.constructor===Ct}(o=n)&&(Array.isArray(o.steps)||Array.isArray(o.gradation)||Array.isArray(o.flavour)||"string"==typeof o.flavour||Array.isArray(o.labels)||"string"==typeof o.labels||Array.isArray(o.units)||"function"==typeof o.custom)?r={}:(r=e,e=void 0)),e||(e=at),"string"==typeof e&&(e=function(t){switch(t){case"default":case"round":return nt;case"round-minute":return at;case"approximate":return ut;case"time":case"approximate-time":return lt;case"mini":return At;case"mini-now":return Pt;case"mini-minute":return Ft;case"mini-minute-now":return Et;case"twitter":return ht;case"twitter-now":return bt;case"twitter-minute":return dt;case"twitter-minute-now":return wt;case"twitter-first-minute":return jt;default:return ut}}(e));var a,i=function(t){if(t.constructor===Date||function(t){return"object"===Dt(t)&&"function"==typeof t.getTime}(t))return t.getTime();if("number"==typeof t)return t;throw new Error("Unsupported relative time formatter input: ".concat(Dt(t),", ").concat(t))}(t),u=this.getLabels(e.flavour||e.labels),l=u.labels,f=u.labelsType;void 0!==e.now&&(a=e.now),void 0===a&&void 0!==r.now&&(a=r.now),void 0===a&&(a=Date.now());var c=(a-i)/1e3,s=r.future||c<0,m=function(t,e,r,n){var o=t.now||e&&e.now;return o?"string"==typeof o?o:n?o.future:o.past:r&&r.second&&r.second.current?r.second.current:void 0}(l,et(this.locale).now,et(this.locale).long,s);if(e.custom){var p=e.custom({now:a,date:new Date(i),time:i,elapsed:c,locale:this.locale});if(void 0!==p)return p}var h=function(t,e,r){var n=Object.keys(e);return r&&n.push("now"),t&&(n=t.filter((function(t){return"now"===t||n.indexOf(t)>=0}))),n}(e.units,l,m),y=r.round||e.round,b=Mt(K(e.gradation||e.steps||at.steps,c,{now:a,units:h,round:y,future:s,getNextStep:!0}),3),v=b[0],d=b[1],g=b[2],w=this.formatDateForStep(i,d,c,{labels:l,labelsType:f,nowLabel:m,now:a,future:s,round:y})||"";return r.getTimeToNextUpdate?[w,Z(i,d,{nextStep:g,prevStep:v,now:a,future:s,round:y})]:w}},{key:"formatDateForStep",value:function(t,e,r,n){var o=this,a=n.labels,i=n.labelsType,u=n.nowLabel,l=n.now,f=n.future,c=n.round;if(e){if(e.format)return e.format(t,this.locale,{formatAs:function(t,e){return o.formatValue(e,t,{labels:a,future:f})},now:l,future:f});var s=e.unit||e.formatAs;if(!s)throw new Error("[javascript-time-ago] Each step must define either `formatAs` or `format()`. Step: ".concat(JSON.stringify(e)));if("now"===s)return u;var m=Math.abs(r)/Y(e);e.granularity&&(m=q(c)(m/e.granularity)*e.granularity);var p=-1*Math.sign(r)*q(c)(m);switch(0===p&&(p=f?0:-0),i){case"long":case"short":case"narrow":return this.getFormatter(i).format(p,s);default:return this.formatValue(p,s,{labels:a,future:f})}}}},{key:"formatValue",value:function(t,e,r){var n=r.labels,o=r.future;return this.getFormattingRule(n,e,t,{future:o}).replace("{0}",this.formatNumber(Math.abs(t)))}},{key:"getFormattingRule",value:function(t,e,r,n){var o=n.future;if(this.locale,"string"==typeof(t=t[e]))return t;var a=t[0===r?o?"future":"past":r<0?"past":"future"]||t;return"string"==typeof a?a:a[this.getPluralRules().select(Math.abs(r))]||a.other}},{key:"formatNumber",value:function(t){return this.numberFormat?this.numberFormat.format(t):String(t)}},{key:"getFormatter",value:function(t){return this.relativeTimeFormatCache.get(this.locale,t)||this.relativeTimeFormatCache.put(this.locale,t,new this.IntlRelativeTimeFormat(this.locale,{style:t}))}},{key:"getPluralRules",value:function(){return this.pluralRulesCache.get(this.locale)||this.pluralRulesCache.put(this.locale,new this.IntlPluralRules(this.locale))}},{key:"getLabels",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];"string"==typeof t&&(t=[t]),t=(t=t.map((function(t){switch(t){case"tiny":case"mini-time":return"mini";default:return t}}))).concat("long");var e=et(this.locale),r=t,n=Array.isArray(r),o=0;for(r=n?r:r[Symbol.iterator]();;){var a;if(n){if(o>=r.length)break;a=r[o++]}else{if((o=r.next()).done)break;a=o.value}var i=a;if(e[i])return{labelsType:i,labels:e[i]}}}}])&&It(e.prototype,r),n&&It(e,n),t}(),zt="en";xt.getDefaultLocale=function(){return zt},xt.setDefaultLocale=function(t){return zt=t},xt.addDefaultLocale=function(t){if(Lt)return console.error("[javascript-time-ago] `TimeAgo.addDefaultLocale()` can only be called once. To add other locales, use `TimeAgo.addLocale()`.");Lt=!0,xt.setDefaultLocale(t.locale),xt.addLocale(t)},xt.addLocale=function(t){rt(t),j.addLocale(t)},xt.locale=xt.addLocale,xt.addLabels=function(t,e,r){var n=et(t);n||(rt({locale:t}),n=et(t)),n[e]=r};var Ct={}.constructor;t.default=xt,t.intlDateTimeFormatSupported=R,t.intlDateTimeFormatSupportedLocale=function(t){if(R())return Intl.DateTimeFormat.supportedLocalesOf(t)[0]},Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=javascript-time-ago.min.js.map

@@ -535,3 +535,3 @@ "use strict";

if (defaultLocaleHasBeenSpecified) {
throw new Error('[javascript-time-ago] `TimeAgo.addDefaultLocale()` can only be called once. To add other locales, use `TimeAgo.addLocale()`.');
return console.error('[javascript-time-ago] `TimeAgo.addDefaultLocale()` can only be called once. To add other locales, use `TimeAgo.addLocale()`.');
}

@@ -538,0 +538,0 @@

@@ -644,10 +644,10 @@ "use strict";

_TimeAgo.default.getDefaultLocale().should.equal('el');
_TimeAgo.default.getDefaultLocale().should.equal('el'); // expect(() => {
expect(function () {
_TimeAgo.default.addDefaultLocale({
locale: 'el'
});
}).to.throw('`TimeAgo.addDefaultLocale()` can only be called once');
_TimeAgo.default.addDefaultLocale({
locale: 'el'
}); // }).to.throw('`TimeAgo.addDefaultLocale()` can only be called once')
_TimeAgo.default.setDefaultLocale('en');

@@ -654,0 +654,0 @@ });

@@ -515,3 +515,3 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

if (defaultLocaleHasBeenSpecified) {
throw new Error('[javascript-time-ago] `TimeAgo.addDefaultLocale()` can only be called once. To add other locales, use `TimeAgo.addLocale()`.');
return console.error('[javascript-time-ago] `TimeAgo.addDefaultLocale()` can only be called once. To add other locales, use `TimeAgo.addLocale()`.');
}

@@ -518,0 +518,0 @@

@@ -625,8 +625,8 @@ import TimeAgo, { isStyleObject } from '../source/TimeAgo';

});
TimeAgo.getDefaultLocale().should.equal('el');
expect(function () {
TimeAgo.addDefaultLocale({
locale: 'el'
});
}).to.throw('`TimeAgo.addDefaultLocale()` can only be called once');
TimeAgo.getDefaultLocale().should.equal('el'); // expect(() => {
TimeAgo.addDefaultLocale({
locale: 'el'
}); // }).to.throw('`TimeAgo.addDefaultLocale()` can only be called once')
TimeAgo.setDefaultLocale('en');

@@ -633,0 +633,0 @@ });

{
"name": "javascript-time-ago",
"version": "2.3.7",
"version": "2.3.8",
"description": "Localized relative date/time formatting",

@@ -5,0 +5,0 @@ "main": "index.commonjs.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc