(function(){var hasModule,isArray,makeTwix,slice=[].slice;hasModule=typeof module!=="undefined"&&module!==null&&module.exports!=null&&typeof require==="function";isArray=function(input){return Object.prototype.toString.call(input)==="[object Array]"};makeTwix=function(moment){var Twix;if(moment==null){throw new Error("Can't find moment")}Twix=function(){function Twix(start,end,parseFormat,options){var ref;if(options==null){options={}}if(typeof parseFormat!=="string"){options=parseFormat!=null?parseFormat:{};parseFormat=null}if(typeof options==="boolean"){options={allDay:options}}this._oStart=moment(start,parseFormat,options.parseStrict);this._oEnd=moment(end,parseFormat,options.parseStrict);this.allDay=(ref=options.allDay)!=null?ref:false;this._mutated()}Twix._extend=function(){var attr,first,j,len,other,others;first=arguments[0],others=2<=arguments.length?slice.call(arguments,1):[];for(j=0,len=others.length;j=end){return 0}return end.diff(start,period)};Twix.prototype.iterate=function(intervalAmount,period,minHours){var end,hasNext,ref,start;ref=this._prepIterateInputs(intervalAmount,period,minHours),intervalAmount=ref[0],period=ref[1],minHours=ref[2];start=this.start().startOf(period);end=this.end().startOf(period);if(this.allDay){end=end.add(1,"d")}hasNext=function(_this){return function(){return!_this.allDay&&start<=end&&(!minHours||!start.isSame(end)||_this._end.hours()>minHours)||_this.allDay&&startmoment()};Twix.prototype.isCurrent=function(){return!this.isPast()&&!this.isFuture()};Twix.prototype.contains=function(mom){if(!moment.isMoment(mom)){mom=moment(mom)}return this._start<=mom&&this._lastMilli>=mom};Twix.prototype.isEmpty=function(){return this._start.isSame(this._displayEnd)};Twix.prototype.overlaps=function(other){return this._displayEnd.isAfter(other._start)&&this._start.isBefore(other._displayEnd)};Twix.prototype.engulfs=function(other){return this._start<=other._start&&this._displayEnd>=other._displayEnd};Twix.prototype.union=function(other){var allDay,newEnd,newStart;allDay=this.allDay&&other.allDay;newStart=this._startother._lastMilli?allDay?this._end:this._displayEnd:allDay?other._end:other._displayEnd;return new Twix(newStart,newEnd,allDay)};Twix.prototype.intersection=function(other){var allDay,newEnd,newStart;allDay=this.allDay&&other.allDay;newStart=this._start>other._start?this._start:other._start;newEnd=this._lastMilli=start){results1.push(mom)}}return results1}().sort(function(a,b){return a.valueOf()-b.valueOf()})}if(dur&&dur.asMilliseconds()===0||times&×.length===0){return[this]}vals=[];i=0;final=this._displayEnd;while(start0&&!this.allDay&&this.end().startOf("d").valueOf()===this.start().add(1,"d").startOf("d").valueOf()&&this._start.hours()>12&&this._end.hours()start.clone().startOf(period)){start.startOf(period).add(intervalAmount,period)}if(end