(function(){var t,n,r,e=[].slice,a=[].indexOf||function(t){for(var n=0,r=this.length;r>n;n++)if(n in this&&this[n]===t)return n;return-1};t="undefined"!=typeof module&&null!==module&&null!=module.exports,n="function"==typeof define,r=function(n){var r,o;if(null==n)throw"Can't find moment";return o=["en"],r=function(){function r(t,r,e){this.start=n(t),this.end=n(r),this.allDay=e||!1}return r._extend=function(){var t,n,r,a,o,i;for(n=arguments[0],a=arguments.length>=2?e.call(arguments,1):[],o=0,i=a.length;i>o;o++){r=a[o];for(t in r)r[t]!==void 0&&(n[t]=r[t])}return n},r.defaults={twentyFourHour:!1,allDaySimple:{fn:function(t){return function(){return t.allDay}},slot:0,pre:" "},dayOfWeek:{fn:function(t){return function(n){return n.format(t.weekdayFormat)}},slot:1,pre:" "},allDayMonth:{fn:function(t){return function(n){return n.format(""+t.monthFormat+" "+t.dayFormat)}},slot:2,pre:" "},month:{fn:function(t){return function(n){return n.format(t.monthFormat)}},slot:2,pre:" "},date:{fn:function(t){return function(n){return n.format(t.dayFormat)}},slot:3,pre:" "},year:{fn:function(t){return function(n){return n.format(t.yearFormat)}},slot:4,pre:", "},time:{fn:function(t){return function(n){var r;return r=0===n.minutes()&&t.implicitMinutes&&!t.twentyFourHour?n.format(t.hourFormat):n.format(""+t.hourFormat+":"+t.minuteFormat),t.groupMeridiems||t.twentyFourHour||(t.spaceBeforeMeridiem&&(r+=" "),r+=n.format(t.meridiemFormat)),r}},slot:5,pre:", "},meridiem:{fn:function(t){return function(n){return n.format(t.meridiemFormat)}},slot:6,pre:function(t){return t.spaceBeforeMeridiem?" ":""}}},r.registerLang=function(t,e){return n.lang(t,{twix:r._extend({},r.defaults,e)})},r.prototype.isSame=function(t){return this.start.isSame(this.end,t)},r.prototype.length=function(t){return this._trueEnd().add(1,"millisecond").diff(this._trueStart(),t)},r.prototype.count=function(t){var n,r;return r=this.start.clone().startOf(t),n=this.end.clone().startOf(t),n.diff(r,t)+1},r.prototype.countInner=function(t){var n,r,e;return e=this._inner(t),r=e[0],n=e[1],r>=n?0:n.diff(r,t)},r.prototype.iterate=function(t,n){var r,e,a,o=this;return a=this.start.clone().startOf(t),r=this.end.clone().startOf(t),e=function(){return r>=a&&(!n||a.valueOf()!==r.valueOf()||o.end.hours()>n||o.allDay)},this._iterateHelper(t,a,e)},r.prototype.iterateInner=function(t){var n,r,e,a;return a=this._inner(t),e=a[0],n=a[1],r=function(){return n>e},this._iterateHelper(t,e,r)},r.prototype.humanizeLength=function(){return this.allDay?this.isSame("day")?"all day":this.start.from(this.end.clone().add(1,"day"),!0):this.start.from(this.end,!0)},r.prototype.asDuration=function(){var t;return t=this.end.diff(this.start),n.duration(t)},r.prototype.isPast=function(){return this.allDay?this.end.clone().endOf("day")n():this.start>n()},r.prototype.isCurrent=function(){return!this.isPast()&&!this.isFuture()},r.prototype.contains=function(t){return t=n(t),t>=this._trueStart()&&this._trueEnd()>=t},r.prototype.overlaps=function(t){return this._trueEnd().isAfter(t._trueStart())&&this._trueStart().isBefore(t._trueEnd())},r.prototype.engulfs=function(t){return this._trueStart()<=t._trueStart()&&this._trueEnd()>=t._trueEnd()},r.prototype.union=function(t){var n,e,a;return n=this.allDay&&t.allDay,n?(a=this.startt.end?this.end:t.end):(a=this._trueStart()t._trueEnd()?this._trueEnd():t._trueEnd()),new r(a,e,n)},r.prototype.intersection=function(t){var e,a,o,i;return i=this.start>t.start?this.start:t.start,this.allDay?(a=n(this.end),a.add(1,"day"),a.subtract(1,"millisecond"),o=t.allDay?t.end>a?this.end:t.end:t.end>a?a:t.end):o=this.end0&&!this.allDay&&this.end.clone().startOf("day").valueOf()===this.start.clone().add(1,"day").startOf("day").valueOf()&&this.start.hours()>12&&this.end.hours()p;p++)i=u[p],d(i);return s=!0,o=function(t,n){var r,e,a,o,i,u;for(r=!0,a="",u=t.sort(function(t,n){return t.format.slot-n.format.slot}),o=0,i=u.length;i>o;o++)e=u[o],s||(a+=r&&n?" ":e.format.pre),a+=e.value(),s=!1,r=!1;return a},o(e)},r.prototype._trueStart=function(){return this.allDay?this.start.clone().startOf("day"):this.start},r.prototype._trueEnd=function(){return this.allDay?this.end.clone().endOf("day"):this.end},r.prototype._iterateHelper=function(t,n,r){return{next:function(){var e;return r()?(e=n.clone(),n.add(1,t),e):null},hasNext:r}},r.prototype._inner=function(t){var n,r;return r=this.start.clone(),n=this.end.clone(),this.allDay&&(r.startOf("day"),n.startOf("day").add(1,"days")),r>r.clone().startOf(t)&&r.startOf(t).add(1,t),n.clone().endOf(t)>n&&n.startOf(t),[r,n]},r.prototype._lazyLang=function(){var n,e,i,u;if(i=this.start.lang(),null!=i&&this.end.lang()._abbr!==i._abbr&&this.end.lang(i._abbr),null==this.langData||this.langData._abbr!==i._abbr){if(t&&(u=i._abbr,!(a.call(o,u)>=0))){try{e=require("./lang/"+i._abbr),e(r)}catch(s){n=s}o.push(i._abbr)}return this.langData=(null!=i?i._twix:void 0)||r.defaults}},r.prototype._formatFn=function(t,n){return this.langData[t].fn(n)},r.prototype._formatSlot=function(t){return this.langData[t].slot},r.prototype._formatPre=function(t,n){return"function"==typeof this.langData[t].pre?this.langData[t].pre(n):this.langData[t].pre},r.prototype._deprecate=function(t,n,r){return console&&console.warn&&console.warn("#"+t+" is deprecated. Use #"+n+" instead."),r.apply(this)},r.prototype.sameDay=function(){return this._deprecate("sameDay","isSame('day')",function(){return this.isSame("day")})},r.prototype.sameYear=function(){return this._deprecate("sameYear","isSame('year')",function(){return this.isSame("year")})},r.prototype.countDays=function(){return this._deprecate("countDays","countOuter('days')",function(){return this.countOuter("days")})},r.prototype.daysIn=function(t){return this._deprecate("daysIn","iterate('days' [,minHours])",function(){return this.iterate("days",t)})},r.prototype.past=function(){return this._deprecate("past","isPast()",function(){return this.isPast()})},r.prototype.duration=function(){return this._deprecate("duration","humanizeLength()",function(){return this.humanizeLength()})},r.prototype.merge=function(t){return this._deprecate("merge","union(other)",function(){return this.union(t)})},r}(),r._extend(Object.getPrototypeOf(n.fn._lang),{_twix:r.defaults}),n.twix=function(){return function(t,n,r){r.prototype=t.prototype;var e=new r,a=t.apply(e,n);return Object(a)===a?a:e}(r,arguments,function(){})},n.fn.twix=function(){return function(t,n,r){r.prototype=t.prototype;var e=new r,a=t.apply(e,n);return Object(a)===a?a:e}(r,[this].concat(e.call(arguments)),function(){})},n.fn.forDuration=function(t,n){return new r(this,this.clone().add(t),n)},n.duration.fn.afterMoment=function(t,e){return new r(t,n(t).clone().add(this),e)},n.duration.fn.beforeMoment=function(t,e){return new r(n(t).clone().subtract(this),t,e)},r},t&&(module.exports=r(require("moment"))),n&&define("twix",["moment"],function(t){return r(t)}),this.moment&&(this.Twix=r(this.moment))}).call(this);