(function(e){if(typeofdefine==="function"&&define.amd){define(["jquery"],e)}else{e(jQuery)}})(function(e){functionr(){varn=i(this);varr=t.settings;if(!isNaN(n.datetime)){if(r.cutoff==0||o(n.datetime)<r.cutoff){e(this).text(s(n.datetime))}}returnthis}functioni(n){n=e(n);if(!n.data("timeago")){n.data("timeago",{datetime:t.datetime(n)});varr=e.trim(n.text());if(t.settings.localeTitle){n.attr("title",n.data("timeago").datetime.toLocaleString())}elseif(r.length>0&&!(t.isTime(n)&&n.attr("title"))){n.attr("title",r)}}returnn.data("timeago")}functions(e){returnt.inWords(o(e))}functiono(e){return(newDate).getTime()-e.getTime()}e.timeago=function(t){if(tinstanceofDate){returns(t)}elseif(typeoft==="string"){returns(e.timeago.parse(t))}elseif(typeoft==="number"){returns(newDate(t))}else{returns(e.timeago.datetime(t))}};vart=e.timeago;e.extend(e.timeago,{settings:{refreshMillis:6e4,allowFuture:false,localeTitle:false,cutoff:0,strings:{prefixAgo:null,prefixFromNow:null,suffixAgo:"ago",suffixFromNow:"from now",seconds:"less than a minute",minute:"about a minute",minutes:"%d minutes",hour:"about an hour",hours:"about %d hours",day:"a day",days:"%d days",month:"about a month",months:"%d months",year:"about a year",years:"%d years",wordSeparator:" ",numbers:[]}},inWords:function(t){functionl(r,i){vars=e.isFunction(r)?r(i,t):r;varo=n.numbers&&n.numbers[i]||i;returns.replace(/%d/i,o)}varn=this.settings.strings;varr=n.prefixAgo;vari=n.suffixAgo;if(this.settings.allowFuture){if(t<0){r=n.prefixFromNow;i=n.suffixFromNow}}vars=Math.abs(t)/1e3;varo=s/60;varu=o/60;vara=u/24;varf=a/365;varc=s<45&&l(n.seconds,Math.round(s))||s<90&&l(n.minute,1)||o<45&&l(n.minutes,Math.round(o))||o<90&&l(n.hour,1)||u<24&&l(n.hours,Math.round(u))||u<42&&l(n.day,1)||a<30&&l(n.days,Math.round(a))||a<45&&l(n.month,1)||a<365&&l(n.months,Math.round(a/30))||f<1.5&&l(n.year,1)||l(n.years,Math.round(f));varh=n.wordSeparator||"";if(n.wordSeparator===undefined){h=" "}returne.trim([r,c,i].join(h))},parse:function(t){varn=e.trim(t);n=n.replace(/\.\d+/,"");n=n.replace(/-/,"/").replace(/-/,"/");n=n.replace(/T/," ").replace(/Z/," UTC");n=n.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2");returnnewDate(n)},datetime:function(n){varr=t.isTime(n)?e(n).attr("datetime"):e(n).attr("title");returnt.parse(r)},isTime:function(t){returne(t).get(0).tagName.toLowerCase()==="time"}});varn={init:function(){varn=e.proxy(r,this);n();vari=t.settings;if(i.refreshMillis>0){setInterval(n,i.refreshMillis)}},update:function(n){e(this).data("timeago",{datetime:t.parse(n)});r.apply(this)}};e.fn.timeago=function(e,t){varr=e?n[e]:n.init;if(!r){thrownewError("Unknown function name '"+e+"' for timeago")}this.each(function(){r.call(this,t)});returnthis};document.createElement("abbr");document.createElement("time")});