(function(n){"use strict";n.widget("ui.rangeSliderMouseTouch",n.ui.mouse,{enabled:!0,_mouseInit:function(){var t=this;n.ui.mouse.prototype._mouseInit.apply(this);this._mouseDownEvent=!1;this.element.bind("touchstart."+this.widgetName,function(n){return t._touchStart(n)})},_mouseDestroy:function(){n(document).unbind("touchmove."+this.widgetName,this._touchMoveDelegate).unbind("touchend."+this.widgetName,this._touchEndDelegate);n.ui.mouse.prototype._mouseDestroy.apply(this)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},destroy:function(){this._mouseDestroy();n.ui.mouse.prototype.destroy.apply(this);this._mouseInit=null},_touchStart:function(t){if(!this.enabled)return!1;t.which=1;t.preventDefault();this._fillTouchEvent(t);var i=this,r=this._mouseDownEvent;this._mouseDown(t);r!==this._mouseDownEvent&&(this._touchEndDelegate=function(n){i._touchEnd(n)},this._touchMoveDelegate=function(n){i._touchMove(n)},n(document).bind("touchmove."+this.widgetName,this._touchMoveDelegate).bind("touchend."+this.widgetName,this._touchEndDelegate))},_mouseDown:function(t){return this.enabled?n.ui.mouse.prototype._mouseDown.apply(this,[t]):!1},_touchEnd:function(t){this._fillTouchEvent(t);this._mouseUp(t);n(document).unbind("touchmove."+this.widgetName,this._touchMoveDelegate).unbind("touchend."+this.widgetName,this._touchEndDelegate);this._mouseDownEvent=!1;n(document).trigger("mouseup")},_touchMove:function(n){return n.preventDefault(),this._fillTouchEvent(n),this._mouseMove(n)},_fillTouchEvent:function(n){var t;t=typeof n.targetTouches=="undefined"&&typeof n.changedTouches=="undefined"?n.originalEvent.targetTouches[0]||n.originalEvent.changedTouches[0]:n.targetTouches[0]||n.changedTouches[0];n.pageX=t.pageX;n.pageY=t.pageY}})})(jQuery),function(n){"use strict";n.widget("ui.rangeSliderDraggable",n.ui.rangeSliderMouseTouch,{cache:null,options:{containment:null},_create:function(){n.ui.rangeSliderMouseTouch.prototype._create.apply(this);setTimeout(n.proxy(this._initElementIfNotDestroyed,this),10)},destroy:function(){this.cache=null;n.ui.rangeSliderMouseTouch.prototype.destroy.apply(this)},_initElementIfNotDestroyed:function(){this._mouseInit&&this._initElement()},_initElement:function(){this._mouseInit();this._cache()},_setOption:function(t,i){t==="containment"&&(this.options.containment=i===null||n(i).length===0?null:n(i))},_mouseStart:function(n){return this._cache(),this.cache.click={left:n.pageX,top:n.pageY},this.cache.initialOffset=this.element.offset(),this._triggerMouseEvent("mousestart"),!0},_mouseDrag:function(n){var t=n.pageX-this.cache.click.left;return t=this._constraintPosition(t+this.cache.initialOffset.left),this._applyPosition(t),this._triggerMouseEvent("sliderDrag"),!1},_mouseStop:function(){this._triggerMouseEvent("stop")},_constraintPosition:function(n){return this.element.parent().length!==0&&this.cache.parent.offset!==null&&(n=Math.min(n,this.cache.parent.offset.left+this.cache.parent.width-this.cache.width.outer),n=Math.max(n,this.cache.parent.offset.left)),n},_applyPosition:function(n){var t={top:this.cache.offset.top,left:n};this.element.offset({left:n});this.cache.offset=t},_cacheIfNecessary:function(){this.cache===null&&this._cache()},_cache:function(){this.cache={};this._cacheMargins();this._cacheParent();this._cacheDimensions();this.cache.offset=this.element.offset()},_cacheMargins:function(){this.cache.margin={left:this._parsePixels(this.element,"marginLeft"),right:this._parsePixels(this.element,"marginRight"),top:this._parsePixels(this.element,"marginTop"),bottom:this._parsePixels(this.element,"marginBottom")}},_cacheParent:function(){if(this.options.parent!==null){var n=this.element.parent();this.cache.parent={offset:n.offset(),width:n.width()}}else this.cache.parent=null},_cacheDimensions:function(){this.cache.width={outer:this.element.outerWidth(),inner:this.element.width()}},_parsePixels:function(n,t){return parseInt(n.css(t),10)||0},_triggerMouseEvent:function(n){var t=this._prepareEventData();this.element.trigger(n,t)},_prepareEventData:function(){return{element:this.element,offset:this.cache.offset||null}}})}(jQuery),function(n){"use strict";function t(n,t){return typeof n=="undefined"?t||!1:n}n.widget("ui.rangeSliderBar",n.ui.rangeSliderDraggable,{options:{leftHandle:null,rightHandle:null,bounds:{min:0,max:100},type:"rangeSliderHandle",range:!1,drag:function(){},stop:function(){},values:{min:0,max:20},wheelSpeed:4,wheelMode:null,handleOffset:12},_values:{min:0,max:20},_waitingToInit:2,_wheelTimeout:!1,_create:function(){n.ui.rangeSliderDraggable.prototype._create.apply(this);this.element.css("position","absolute").css("top",0).addClass("ui-rangeSlider-bar");this.options.leftHandle.bind("initialize",n.proxy(this._onInitialized,this)).bind("mousestart",n.proxy(this._cache,this)).bind("stop",n.proxy(this._onHandleStop,this));this.options.rightHandle.bind("initialize",n.proxy(this._onInitialized,this)).bind("mousestart",n.proxy(this._cache,this)).bind("stop",n.proxy(this._onHandleStop,this));this._bindHandles();this._values=this.options.values;this._setWheelModeOption(this.options.wheelMode)},destroy:function(){this.options.leftHandle.unbind(".bar");this.options.rightHandle.unbind(".bar");this.options=null;n.ui.rangeSliderDraggable.prototype.destroy.apply(this)},_setOption:function(n,t){n==="range"?this._setRangeOption(t):n==="wheelSpeed"?this._setWheelSpeedOption(t):n==="wheelMode"&&this._setWheelModeOption(t)},_setRangeOption:function(n){if((typeof n!="object"||n===null)&&(n=!1),n!==!1||this.options.range!==!1){if(n!==!1){var i=t(n.min,this.options.range.min),r=t(n.max,this.options.range.max);this.options.range={min:i,max:r}}else this.options.range=!1;this._setLeftRange();this._setRightRange()}},_setWheelSpeedOption:function(n){typeof n=="number"&&n>0&&(this.options.wheelSpeed=n)},_setWheelModeOption:function(n){(n===null||n===!1||n==="zoom"||n==="scroll")&&(this.options.wheelMode!==n&&this.element.parent().unbind("mousewheel.bar"),this._bindMouseWheel(n),this.options.wheelMode=n)},_bindMouseWheel:function(t){t==="zoom"?this.element.parent().bind("mousewheel.bar",n.proxy(this._mouseWheelZoom,this)):t==="scroll"&&this.element.parent().bind("mousewheel.bar",n.proxy(this._mouseWheelScroll,this))},_setLeftRange:function(){if(this.options.range===!1)return!1;var t=this._values.max,n={min:!1,max:!1};n.max=(this.options.range.min||!1)!==!1?this._leftHandle("substract",t,this.options.range.min):!1;n.min=(this.options.range.max||!1)!==!1?this._leftHandle("substract",t,this.options.range.max):!1;this._leftHandle("option","range",n)},_setRightRange:function(){var t=this._values.min,n={min:!1,max:!1};n.min=(this.options.range.min||!1)!==!1?this._rightHandle("add",t,this.options.range.min):!1;n.max=(this.options.range.max||!1)!==!1?this._rightHandle("add",t,this.options.range.max):!1;this._rightHandle("option","range",n)},_deactivateRange:function(){this._leftHandle("option","range",!1);this._rightHandle("option","range",!1)},_reactivateRange:function(){this._setRangeOption(this.options.range)},_onInitialized:function(){this._waitingToInit--;this._waitingToInit===0&&this._initMe()},_initMe:function(){this._cache();this.min(this._values.min);this.max(this._values.max);var n=this._leftHandle("position"),t=this._rightHandle("position")+this.options.rightHandle.width();this.element.offset({left:n+this.options.handleOffset});this.element.css("width",t-n-this.options.handleOffset*2)},_leftHandle:function(){return this._handleProxy(this.options.leftHandle,arguments)},_rightHandle:function(){return this._handleProxy(this.options.rightHandle,arguments)},_handleProxy:function(n,t){var i=Array.prototype.slice.call(t);return n[this.options.type].apply(n,i)},_cache:function(){n.ui.rangeSliderDraggable.prototype._cache.apply(this);this._cacheHandles()},_cacheHandles:function(){this.cache.rightHandle={};this.cache.rightHandle.width=this.options.rightHandle.width();this.cache.rightHandle.offset=this.options.rightHandle.offset();this.cache.leftHandle={};this.cache.leftHandle.offset=this.options.leftHandle.offset()},_mouseStart:function(t){n.ui.rangeSliderDraggable.prototype._mouseStart.apply(this,[t]);this._deactivateRange()},_mouseStop:function(t){n.ui.rangeSliderDraggable.prototype._mouseStop.apply(this,[t]);this._cacheHandles();this._values.min=this._leftHandle("value");this._values.max=this._rightHandle("value");this._reactivateRange();this._leftHandle().trigger("stop");this._rightHandle().trigger("stop")},_onDragLeftHandle:function(n,t){if(this._cacheIfNecessary(),t.element[0]===this.options.leftHandle[0]){if(this._switchedValues()){this._switchHandles();this._onDragRightHandle(n,t);return}this._values.min=t.value;this.cache.offset.left=t.offset.left;this.cache.leftHandle.offset=t.offset;this._positionBar()}},_onDragRightHandle:function(n,t){if(this._cacheIfNecessary(),t.element[0]===this.options.rightHandle[0]){if(this._switchedValues()){this._switchHandles();this._onDragLeftHandle(n,t);return}this._values.max=t.value;this.cache.rightHandle.offset=t.offset;this._positionBar()}},_positionBar:function(){var n=this.cache.rightHandle.offset.left+this.cache.rightHandle.width-this.cache.leftHandle.offset.left-this.options.handleOffset*2;this.cache.width.inner=n;this.element.css("width",n).offset({left:this.cache.leftHandle.offset.left+this.options.handleOffset})},_onHandleStop:function(){this._setLeftRange();this._setRightRange()},_switchedValues:function(){if(this.min()>this.max()){var n=this._values.min;return this._values.min=this._values.max,this._values.max=n,!0}return!1},_switchHandles:function(){var n=this.options.leftHandle;this.options.leftHandle=this.options.rightHandle;this.options.rightHandle=n;this._leftHandle("option","isLeft",!0);this._rightHandle("option","isLeft",!1);this._bindHandles();this._cacheHandles()},_bindHandles:function(){this.options.leftHandle.unbind(".bar").bind("sliderDrag.bar update.bar moving.bar",n.proxy(this._onDragLeftHandle,this));this.options.rightHandle.unbind(".bar").bind("sliderDrag.bar update.bar moving.bar",n.proxy(this._onDragRightHandle,this))},_constraintPosition:function(t){var i={},r;return i.left=n.ui.rangeSliderDraggable.prototype._constraintPosition.apply(this,[t]),i.left=this._leftHandle("position",i.left),r=this._rightHandle("position",i.left+this.cache.width.outer-this.cache.rightHandle.width),i.width=r-i.left+this.cache.rightHandle.width-this.options.handleOffset*2,i},_applyPosition:function(t){n.ui.rangeSliderDraggable.prototype._applyPosition.apply(this,[t.left+this.options.handleOffset]);this.element.width(t.width)},_mouseWheelZoom:function(t,i,r,u){if(!this.enabled)return!1;var f=this._values.min+(this._values.max-this._values.min)/2,e={},o={};return this.options.range===!1||this.options.range.min===!1?(e.max=f,o.min=f):(e.max=f-this.options.range.min/2,o.min=f+this.options.range.min/2),this.options.range!==!1&&this.options.range.max!==!1&&(e.min=f-this.options.range.max/2,o.max=f+this.options.range.max/2),this._leftHandle("option","range",e),this._rightHandle("option","range",o),clearTimeout(this._wheelTimeout),this._wheelTimeout=setTimeout(n.proxy(this._wheelStop,this),200),this.zoomOut(u*this.options.wheelSpeed),!1},_mouseWheelScroll:function(t,i,r,u){return this.enabled?(this._wheelTimeout===!1?this.startScroll():clearTimeout(this._wheelTimeout),this._wheelTimeout=setTimeout(n.proxy(this._wheelStop,this),200),this.scrollLeft(u*this.options.wheelSpeed),!1):!1},_wheelStop:function(){this.stopScroll();this._wheelTimeout=!1},min:function(n){return this._leftHandle("value",n)},max:function(n){return this._rightHandle("value",n)},startScroll:function(){this._deactivateRange()},stopScroll:function(){this._reactivateRange();this._triggerMouseEvent("stop");this._leftHandle().trigger("stop");this._rightHandle().trigger("stop")},scrollLeft:function(n){if(n=n||1,n<0)return this.scrollRight(-n);n=this._leftHandle("moveLeft",n);this._rightHandle("moveLeft",n);this.update();this._triggerMouseEvent("scroll")},scrollRight:function(n){if(n=n||1,n<0)return this.scrollLeft(-n);n=this._rightHandle("moveRight",n);this._leftHandle("moveRight",n);this.update();this._triggerMouseEvent("scroll")},zoomIn:function(n){if(n=n||1,n<0)return this.zoomOut(-n);var t=this._rightHandle("moveLeft",n);n>t&&(t=t/2,this._rightHandle("moveRight",t));this._leftHandle("moveRight",t);this.update();this._triggerMouseEvent("zoom")},zoomOut:function(n){if(n=n||1,n<0)return this.zoomIn(-n);var t=this._rightHandle("moveRight",n);n>t&&(t=t/2,this._rightHandle("moveLeft",t));this._leftHandle("moveLeft",t);this.update();this._triggerMouseEvent("zoom")},values:function(n,t){if(typeof n!="undefined"&&typeof t!="undefined"){var i=Math.min(n,t),r=Math.max(n,t);this._deactivateRange();this.options.leftHandle.unbind(".bar");this.options.rightHandle.unbind(".bar");this._values.min=this._leftHandle("value",i);this._values.max=this._rightHandle("value",r);this._bindHandles();this._reactivateRange();this.update()}return{min:this._values.min,max:this._values.max}},update:function(){this._values.min=this.min();this._values.max=this.max();this._cache();this._positionBar()}})}(jQuery),function(n){"use strict";n.widget("ui.rangeSliderHandle",n.ui.rangeSliderDraggable,{currentMove:null,margin:0,parentElement:null,options:{isLeft:!0,bounds:{min:0,max:100},range:!1,value:0,step:!1,handleOffset:12},_value:0,_left:0,_create:function(){n.ui.rangeSliderDraggable.prototype._create.apply(this);this.element.css("position","absolute").css("top",0).addClass("ui-rangeSlider-handle").toggleClass("ui-rangeSlider-leftHandle",this.options.isLeft).toggleClass("ui-rangeSlider-rightHandle",!this.options.isLeft);this.element.append("<div class='ui-rangeSlider-handle-inner' />");this._value=this._constraintValue(this.options.value)},destroy:function(){this.element.empty();n.ui.rangeSliderDraggable.prototype.destroy.apply(this)},_setOption:function(t,i){t==="isLeft"&&(i===!0||i===!1)&&i!==this.options.isLeft?(this.options.isLeft=i,this.element.toggleClass("ui-rangeSlider-leftHandle",this.options.isLeft).toggleClass("ui-rangeSlider-rightHandle",!this.options.isLeft),this._position(this._value),this.element.trigger("switch",this.options.isLeft)):t==="step"&&this._checkStep(i)?(this.options.step=i,this.update()):t==="bounds"?(this.options.bounds=i,this.update()):t==="range"&&this._checkRange(i)&&(this.options.range=i,this.update());n.ui.rangeSliderDraggable.prototype._setOption.apply(this,[t,i])},_checkRange:function(n){return n===!1||!this._isValidValue(n.min)&&!this._isValidValue(n.max)},_isValidValue:function(n){return typeof n!="undefined"&&n!==!1&&parseFloat(n)!==n},_checkStep:function(n){return n===!1||parseFloat(n)===n},_initElement:function(){n.ui.rangeSliderDraggable.prototype._initElement.apply(this);this.cache.parent.width===0||this.cache.parent.width===null?setTimeout(n.proxy(this._initElementIfNotDestroyed,this),500):(this._position(this._value),this._triggerMouseEvent("initialize"))},_bounds:function(){return this.options.bounds},_cache:function(){n.ui.rangeSliderDraggable.prototype._cache.apply(this);this._cacheParent()},_cacheParent:function(){var n=this.element.parent();this.cache.parent={element:n,offset:n.offset(),padding:{left:this._parsePixels(n,"paddingLeft")},width:n.width()}},_position:function(n){var t=this._getPositionForValue(n);this._applyPosition(t)},_constraintPosition:function(n){var t=this._getValueForPosition(n);return this._getPositionForValue(t)},_applyPosition:function(t){if(this.options.isLeft)var i=this.options.handleOffset;else i=this.options.handleOffset*-1;n.ui.rangeSliderDraggable.prototype._applyPosition.apply(this,[t-i]);this._left=t-i;this._setValue(this._getValueForPosition(t-i));this._triggerMouseEvent("moving")},_prepareEventData:function(){var t=n.ui.rangeSliderDraggable.prototype._prepareEventData.apply(this);return t.value=this._value,t},_setValue:function(n){n!==this._value&&(this._value=n)},_constraintValue:function(n){if(n=Math.min(n,this._bounds().max),n=Math.max(n,this._bounds().min),n=this._round(n),this.options.range!==!1){var t=this.options.range.min||!1,i=this.options.range.max||!1;t!==!1&&(n=Math.max(n,this._round(t)));i!==!1&&(n=Math.min(n,this._round(i)));n=Math.min(n,this._bounds().max);n=Math.max(n,this._bounds().min)}return n},_round:function(n){return this.options.step!==!1&&this.options.step>0?Math.round(n/this.options.step)*this.options.step:n},_getPositionForValue:function(n){if(!this.cache||!this.cache.parent||this.cache.parent.offset===null)return 0;n=this._constraintValue(n);var t=(n-this.options.bounds.min)/(this.options.bounds.max-this.options.bounds.min),i=this.cache.parent.width,r=this.cache.parent.offset.left,u=this.options.isLeft?0:this.cache.width.outer;return t*i+r-u},_getValueForPosition:function(n){var t=this._getRawValueForPositionAndBounds(n,this.options.bounds.min,this.options.bounds.max);return this._constraintValue(t)},_getRawValueForPositionAndBounds:function(n,t,i){n+=this.options.isLeft?0:this.cache.width.outer;var u=this.cache.parent.offset===null?0:this.cache.parent.offset.left,r=this.cache.parent.width,f=r>0?(n-u)/r:0;return f*(i-t)+t},value:function(n){return typeof n!="undefined"&&(this._cache(),n=this._constraintValue(n),this._position(n)),this._value},update:function(){this._cache();var n=this._constraintValue(this._value),t=this._getPositionForValue(n);n!==this._value?(this._triggerMouseEvent("updating"),this._position(n),this._triggerMouseEvent("update")):t!==this.cache.offset.left&&(this._triggerMouseEvent("updating"),this._position(n),this._triggerMouseEvent("update"))},position:function(n){return typeof n!="undefined"&&(this._cache(),n=this._constraintPosition(n),this._applyPosition(n)),this._left},add:function(n,t){return n+t},substract:function(n,t){return n-t},stepsBetween:function(n,t){return this.options.step===!1?t-n:(t-n)/this.options.step},multiplyStep:function(n,t){return n*t},moveRight:function(n){var t;return this.options.step===!1?(t=this._left,this.position(this._left+n),this._left-t):(t=this._value,this.value(this.add(t,this.multiplyStep(this.options.step,n))),this.stepsBetween(t,this._value))},moveLeft:function(n){return-this.moveRight(-n)},stepRatio:function(){if(this.options.step===!1)return 1;var n=(this.options.bounds.max-this.options.bounds.min)/this.options.step;return this.cache.parent.width/n}})}(jQuery),function(n){"use strict";function t(t,i,r,u){this.label1=t;this.label2=i;this.type=r;this.options=u;this.handle1=this.label1[this.type]("option","handle");this.handle2=this.label2[this.type]("option","handle");this.cache=null;this.left=t;this.right=i;this.moving=!1;this.initialized=!1;this.updating=!1;this.Init=function(){this.BindHandle(this.handle1);this.BindHandle(this.handle2);this.options.show==="show"?(setTimeout(n.proxy(this.PositionLabels,this),1),this.initialized=!0):setTimeout(n.proxy(this.AfterInit,this),1e3);this._resizeProxy=n.proxy(this.onWindowResize,this);n(window).resize(this._resizeProxy)};this.Destroy=function(){this._resizeProxy&&(n(window).unbind("resize",this._resizeProxy),this._resizeProxy=null,this.handle1.unbind(".positionner"),this.handle1=null,this.handle2.unbind(".positionner"),this.handle2=null,this.label1=null,this.label2=null,this.left=null,this.right=null);this.cache=null};this.AfterInit=function(){this.initialized=!0};this.Cache=function(){this.label1.css("display")!=="none"&&(this.cache={},this.cache.label1={},this.cache.label2={},this.cache.handle1={},this.cache.handle2={},this.cache.offsetParent={},this.CacheElement(this.label1,this.cache.label1),this.CacheElement(this.label2,this.cache.label2),this.CacheElement(this.handle1,this.cache.handle1),this.CacheElement(this.handle2,this.cache.handle2),this.CacheElement(this.label1.offsetParent(),this.cache.offsetParent))};this.CacheIfNecessary=function(){this.cache===null?this.Cache():(this.CacheWidth(this.label1,this.cache.label1),this.CacheWidth(this.label2,this.cache.label2),this.CacheHeight(this.label1,this.cache.label1),this.CacheHeight(this.label2,this.cache.label2),this.CacheWidth(this.label1.offsetParent(),this.cache.offsetParent))};this.CacheElement=function(n,t){this.CacheWidth(n,t);this.CacheHeight(n,t);t.offset=n.offset();t.margin={left:this.ParsePixels("marginLeft",n),right:this.ParsePixels("marginRight",n)};t.border={left:this.ParsePixels("borderLeftWidth",n),right:this.ParsePixels("borderRightWidth",n)}};this.CacheWidth=function(n,t){t.width=n.width();t.outerWidth=n.outerWidth()};this.CacheHeight=function(n,t){t.outerHeightMargin=n.outerHeight(!0)};this.ParsePixels=function(n,t){return parseInt(t.css(n),10)||0};this.BindHandle=function(t){t.bind("updating.positionner",n.proxy(this.onHandleUpdating,this));t.bind("update.positionner",n.proxy(this.onHandleUpdated,this));t.bind("moving.positionner",n.proxy(this.onHandleMoving,this));t.bind("stop.positionner",n.proxy(this.onHandleStop,this))};this.PositionLabels=function(){if(this.CacheIfNecessary(),this.cache!==null){var t=this.GetRawPosition(this.cache.label1,this.cache.handle1),r=this.GetRawPosition(this.cache.label2,this.cache.handle2),n=(t.left-21+r.left-21)/2;this.PositionLabel(this.label1,n,this.cache.label1);i.css("display","none");this.PositionLabel(this.label2,n,this.cache.label1)}};this.PositionLabel=function(n,t,i){var u=this.cache.offsetParent.offset.left+this.cache.offsetParent.border.left,f,e,r;u-t>=0?(n.css("right",""),n.offset({left:t+this.options.handleOffset})):(f=u+this.cache.offsetParent.width,e=t+i.margin.left+i.outerWidth+i.margin.right,r=f-e,r<0&&(r=0),n.css("left",""),n.css("right",r))};this.ConstraintPositions=function(n,t){n.center<t.center&&n.outerRight>t.outerLeft?(n=this.getLeftPosition(n,t),t=this.getRightPosition(n,t)):n.center>t.center&&t.outerRight>n.outerLeft&&(t=this.getLeftPosition(t,n),n=this.getRightPosition(t,n))};this.getLeftPosition=function(n,t){var i=(t.center+n.center)/2,r=i-n.cache.outerWidth-n.cache.margin.right+n.cache.border.left;return n.left=r,n};this.getRightPosition=function(n,t){var i=(t.center+n.center)/2;return t.left=i+t.cache.margin.left+t.cache.border.left,t};this.ShowIfNecessary=function(){this.options.show==="show"||this.moving||!this.initialized||this.updating||(this.label1.stop(!0,!0).fadeIn(this.options.durationIn||0),this.label2.stop(!0,!0).fadeIn(this.options.durationIn||0),this.moving=!0)};this.HideIfNeeded=function(){this.moving===!0&&(this.label1.stop(!0,!0).delay(this.options.delayOut||0).fadeOut(this.options.durationOut||0),this.label2.stop(!0,!0).delay(this.options.delayOut||0).fadeOut(this.options.durationOut||0),this.moving=!1)};this.onHandleMoving=function(n,t){this.ShowIfNecessary();this.CacheIfNecessary();this.UpdateHandlePosition(t);this.PositionLabels()};this.onHandleUpdating=function(){this.updating=!0};this.onHandleUpdated=function(){this.updating=!1;this.cache=null};this.onHandleStop=function(){this.HideIfNeeded()};this.onWindowResize=function(){this.cache=null};this.UpdateHandlePosition=function(n){this.cache!==null&&(n.element[0]===this.handle1[0]?this.UpdatePosition(n,this.cache.handle1):this.UpdatePosition(n,this.cache.handle2))};this.UpdatePosition=function(n,t){t.offset=n.offset};this.GetRawPosition=function(n,t){var r=t.offset.left+t.outerWidth/2,i=r-n.outerWidth/2,f=i+n.outerWidth-n.border.left-n.border.right,u=i-n.margin.left-n.border.left,e=t.offset.top-n.outerHeightMargin;return{left:i,outerLeft:u,top:e,right:f,outerRight:u+n.outerWidth+n.margin.left+n.margin.right,cache:n,center:r}};this.Init()}n.widget("ui.rangeSliderLabel",n.ui.rangeSliderMouseTouch,{options:{handle:null,formatter:!1,handleType:"rangeSliderHandle",show:"show",durationIn:0,durationOut:500,delayOut:500,isLeft:!1,handleOffset:12},cache:null,_positionner:null,_valueContainer:null,_innerElement:null,_value:null,_create:function(){this.options.isLeft=this._handle("option","isLeft");this.element.addClass("ui-rangeSlider-label").css("position","absolute").css("display","block");this._createElements();this._toggleClass();this.options.handle.bind("moving.label",n.proxy(this._onMoving,this)).bind("update.label",n.proxy(this._onUpdate,this)).bind("switch.label",n.proxy(this._onSwitch,this));this.options.show!=="show"&&this.element.hide();this._mouseInit()},destroy:function(){this.options.handle.unbind(".label");this.options.handle=null;this._valueContainer=null;this._innerElement=null;this.element.empty();this._positionner&&(this._positionner.Destroy(),this._positionner=null);n.ui.rangeSliderMouseTouch.prototype.destroy.apply(this)},_createElements:function(){this._valueContainer=n("<div class='ui-rangeSlider-label-value' />").appendTo(this.element);this._innerElement=n("<div class='ui-rangeSlider-label-inner' />").appendTo(this.element)},_handle:function(){var n=Array.prototype.slice.apply(arguments);return this.options.handle[this.options.handleType].apply(this.options.handle,n)},_setOption:function(n,t){n==="show"?this._updateShowOption(t):(n==="durationIn"||n==="durationOut"||n==="delayOut")&&this._updateDurations(n,t);this._setFormatterOption(n,t)},_setFormatterOption:function(n,t){n==="formatter"&&(typeof t=="function"||t===!1)&&(this.options.formatter=t,this._display(this._value))},_updateShowOption:function(n){this.options.show=n;this.options.show!=="show"?(this.element.hide(),this._positionner.moving=!1):(this.element.show(),this._display(this.options.handle[this.options.handleType]("value")),this._positionner.PositionLabels());this._positionner.options.show=this.options.show},_updateDurations:function(n,t){parseInt(t,10)===t&&(this._positionner.options[n]=t,this.options[n]=t)},_display:function(n){this.options.formatter===!1?this._displayText(Math.round(n)):this._displayText(this.options.formatter(n));this._value=n},_displayText:function(){},_toggleClass:function(){this.element.toggleClass("ui-rangeSlider-leftLabel",this.options.isLeft).toggleClass("ui-rangeSlider-rightLabel",!this.options.isLeft)},_mouseDown:function(n){this.options.handle.trigger(n)},_mouseUp:function(n){this.options.handle.trigger(n)},_mouseMove:function(n){this.options.handle.trigger(n)},_onMoving:function(n,t){this._display(t.value)},_onUpdate:function(){this.options.show==="show"&&this.update()},_onSwitch:function(n,t){this.options.isLeft=t;this._toggleClass();this._positionner.PositionLabels()},pair:function(n){this._positionner===null&&(this._positionner=new t(this.element,n,this.widgetName,{show:this.options.show,durationIn:this.options.durationIn,durationOut:this.options.durationOut,delayOut:this.options.delayOut}),n[this.widgetName]("positionner",this._positionner))},positionner:function(n){return typeof n!="undefined"&&(this._positionner=n),this._positionner},update:function(){this._positionner.cache=null;this._display(this._handle("value"));this.options.show==="show"&&this._positionner.PositionLabels()}})}(jQuery),function(n,t){"use strict";n.widget("ui.rangeSlider",{options:{bounds:{min:0,max:100},defaultValues:{min:20,max:50},wheelMode:null,wheelSpeed:4,arrows:!0,valueLabels:"show",formatter:null,durationIn:0,durationOut:400,delayOut:200,range:{min:!1,max:!1},step:!1,scales:!1,enabled:!0},_values:null,_valuesChanged:!1,bar:null,leftHandle:null,rightHandle:null,innerBar:null,container:null,arrows:null,labels:null,changing:{min:!1,max:!1},changed:{min:!1,max:!1},ruler:null,_create:function(){this._setDefaultValues();this.labels={left:null,right:null,leftDisplayed:!0,rightDisplayed:!0};this.arrows={left:null,right:null};this.changing={min:!1,max:!1};this.changed={min:!1,max:!1};this._createElements();this._bindResize();setTimeout(n.proxy(this.resize,this),1);setTimeout(n.proxy(this._initValues,this),1)},_setDefaultValues:function(){this._values={min:this.options.defaultValues.min,max:this.options.defaultValues.max}},_bindResize:function(){var t=this;this._resizeProxy=function(n){t.resize(n)};n(window).resize(this._resizeProxy)},_initWidth:function(){this.container.css("width",this.element.width()-this.container.outerWidth(!0)+this.container.width());this.innerBar.css("width",this.container.width()-this.innerBar.outerWidth(!0)+this.innerBar.width())},_initValues:function(){this.values(this._values.min,this._values.max)},_setOption:function(n,t){this._setWheelOption(n,t);this._setArrowsOption(n,t);this._setLabelsOption(n,t);this._setLabelsDurations(n,t);this._setFormatterOption(n,t);this._setBoundsOption(n,t);this._setRangeOption(n,t);this._setStepOption(n,t);this._setScalesOption(n,t);this._setEnabledOption(n,t)},_validProperty:function(n,t,i){return n===null||typeof n[t]=="undefined"?i:n[t]},_setStepOption:function(n,t){n==="step"&&(this.options.step=t,this._leftHandle("option","step",t),this._rightHandle("option","step",t),this._changed(!0))},_setScalesOption:function(n,t){n==="scales"&&(t===!1||t===null?(this.options.scales=!1,this._destroyRuler()):t instanceof Array&&(this.options.scales=t,this._updateRuler()))},_setRangeOption:function(n,t){n==="range"&&(this._bar("option","range",t),this.options.range=this._bar("option","range"),this._changed(!0))},_setBoundsOption:function(n,t){n==="bounds"&&typeof t.min!="undefined"&&typeof t.max!="undefined"&&this.bounds(t.min,t.max)},_setWheelOption:function(n,t){(n==="wheelMode"||n==="wheelSpeed")&&(this._bar("option",n,t),this.options[n]=this._bar("option",n))},_setLabelsOption:function(n,t){if(n==="valueLabels"){if(t!=="hide"&&t!=="show"&&t!=="change")return;this.options.valueLabels=t;t!=="hide"?(this._createLabels(),this._leftLabel("update"),this._rightLabel("update")):this._destroyLabels()}},_setFormatterOption:function(n,t){n==="formatter"&&t!==null&&typeof t=="function"&&this.options.valueLabels!=="hide"&&(this._leftLabel("option","formatter",t),this.options.formatter=this._rightLabel("option","formatter",t))},_setArrowsOption:function(n,t){n==="arrows"&&(t===!0||t===!1)&&t!==this.options.arrows&&(t===!0?(this.element.removeClass("ui-rangeSlider-noArrow").addClass("ui-rangeSlider-withArrows"),this.arrows.left.css("display","block"),this.arrows.right.css("display","block"),this.options.arrows=!0):t===!1&&(this.element.addClass("ui-rangeSlider-noArrow").removeClass("ui-rangeSlider-withArrows"),this.arrows.left.css("display","none"),this.arrows.right.css("display","none"),this.options.arrows=!1),this._initWidth())},_setLabelsDurations:function(n,t){if(n==="durationIn"||n==="durationOut"||n==="delayOut"){if(parseInt(t,10)!==t)return;this.labels.left!==null&&this._leftLabel("option",n,t);this.labels.right!==null&&this._rightLabel("option",n,t);this.options[n]=t}},_setEnabledOption:function(n,t){n==="enabled"&&this.toggle(t)},_createElements:function(){this.element.css("position")!=="absolute"&&this.element.css("position","relative");this.element.addClass("ui-rangeSlider");this.container=n("<div class='ui-rangeSlider-container' />").css("position","absolute").appendTo(this.element);this.innerBar=n("<div class='ui-rangeSlider-innerBar' />").css("position","absolute").css("top",0).css("left",0);this._createHandles();this._createBar();this.container.prepend(this.innerBar);this._createArrows();this.options.valueLabels!=="hide"?this._createLabels():this._destroyLabels();this._updateRuler();this.options.enabled||this._toggle(this.options.enabled)},_createHandle:function(t){return n("<div />")[this._handleType()](t).bind("sliderDrag",n.proxy(this._changing,this)).bind("stop",n.proxy(this._changed,this))},_createHandles:function(){this.leftHandle=this._createHandle({isLeft:!0,bounds:this.options.bounds,value:this._values.min,step:this.options.step}).appendTo(this.container);this.rightHandle=this._createHandle({isLeft:!1,bounds:this.options.bounds,value:this._values.max,step:this.options.step}).appendTo(this.container)},_createBar:function(){this.bar=n("<div />").prependTo(this.container).bind("sliderDrag scroll zoom",n.proxy(this._changing,this)).bind("stop",n.proxy(this._changed,this));this._bar({leftHandle:this.leftHandle,rightHandle:this.rightHandle,values:{min:this._values.min,max:this._values.max},type:this._handleType(),range:this.options.range,wheelMode:this.options.wheelMode,wheelSpeed:this.options.wheelSpeed});this.options.range=this._bar("option","range");this.options.wheelMode=this._bar("option","wheelMode");this.options.wheelSpeed=this._bar("option","wheelSpeed")},_createArrows:function(){this.arrows.left=this._createArrow("left");this.arrows.right=this._createArrow("right");this.options.arrows?this.element.addClass("ui-rangeSlider-withArrows"):(this.arrows.left.css("display","none"),this.arrows.right.css("display","none"),this.element.addClass("ui-rangeSlider-noArrow"))},_createArrow:function(t){var i=n("<div class='ui-rangeSlider-arrow' />").append("<div class='ui-rangeSlider-arrow-inner' />").addClass("ui-rangeSlider-"+t+"Arrow").css("position","absolute").css(t,0).appendTo(this.element),r;return r=t==="right"?n.proxy(this._scrollRightClick,this):n.proxy(this._scrollLeftClick,this),i.bind("mousedown touchstart",r),i},_proxy:function(n,t,i){var r=Array.prototype.slice.call(i);return n&&n[t]?n[t].apply(n,r):null},_handleType:function(){return"rangeSliderHandle"},_barType:function(){return"rangeSliderBar"},_bar:function(){return this._proxy(this.bar,this._barType(),arguments)},_labelType:function(){return"rangeSliderLabel"},_leftLabel:function(){return this._proxy(this.labels.left,this._labelType(),arguments)},_rightLabel:function(){return this._proxy(this.labels.right,this._labelType(),arguments)},_leftHandle:function(){return this._proxy(this.leftHandle,this._handleType(),arguments)},_rightHandle:function(){return this._proxy(this.rightHandle,this._handleType(),arguments)},_getValue:function(n,t){return t===this.rightHandle&&(n=n-t.outerWidth()),n*(this.options.bounds.max-this.options.bounds.min)/(this.container.innerWidth()-t.outerWidth(!0))+this.options.bounds.min},_trigger:function(n){var t=this;setTimeout(function(){t.element.trigger(n,{label:t.element,values:t.values()})},1)},_changing:function(){this._updateValues()&&(this._trigger("valuesChanging"),this._valuesChanged=!0)},_deactivateLabels:function(){this.options.valueLabels==="change"&&(this._leftLabel("option","show","hide"),this._rightLabel("option","show","hide"))},_reactivateLabels:function(){this.options.valueLabels==="change"&&(this._leftLabel("option","show","change"),this._rightLabel("option","show","change"))},_changed:function(n){n===!0&&this._deactivateLabels();(this._updateValues()||this._valuesChanged)&&(this._trigger("valuesChanged"),n!==!0&&this._trigger("userValuesChanged"),this._valuesChanged=!1);n===!0&&this._reactivateLabels()},_updateValues:function(){var n=this._leftHandle("value"),t=this._rightHandle("value"),i=this._min(n,t),r=this._max(n,t),u=i!==this._values.min||r!==this._values.max;return this._values.min=this._min(n,t),this._values.max=this._max(n,t),u},_min:function(n,t){return Math.min(n,t)},_max:function(n,t){return Math.max(n,t)},_createLabel:function(t,i){var r;return t===null?(r=this._getLabelConstructorParameters(t,i),t=n("<div />").appendTo(this.element)[this._labelType()](r)):(r=this._getLabelRefreshParameters(t,i),t[this._labelType()](r)),t},_getLabelConstructorParameters:function(n,t){return{handle:t,handleType:this._handleType(),formatter:this._getFormatter(),show:this.options.valueLabels,durationIn:this.options.durationIn,durationOut:this.options.durationOut,delayOut:this.options.delayOut}},_getLabelRefreshParameters:function(){return{formatter:this._getFormatter(),show:this.options.valueLabels,durationIn:this.options.durationIn,durationOut:this.options.durationOut,delayOut:this.options.delayOut}},_getFormatter:function(){return this.options.formatter===!1||this.options.formatter===null?this._defaultFormatter:this.options.formatter},_defaultFormatter:function(n){return Math.round(n)},_destroyLabel:function(n){return n!==null&&(n[this._labelType()]("destroy"),n.remove(),n=null),n},_createLabels:function(){this.labels.left=this._createLabel(this.labels.left,this.leftHandle);this.labels.right=this._createLabel(this.labels.right,this.rightHandle);this._leftLabel("pair",this.labels.right)},_destroyLabels:function(){this.labels.left=this._destroyLabel(this.labels.left);this.labels.right=this._destroyLabel(this.labels.right)},_stepRatio:function(){return this._leftHandle("stepRatio")},_scrollRightClick:function(n){if(!this.options.enabled)return!1;n.preventDefault();this._bar("startScroll");this._bindStopScroll();this._continueScrolling("scrollRight",4*this._stepRatio(),1)},_continueScrolling:function(n,t,i,r){if(!this.options.enabled)return!1;this._bar(n,i);r=r||5;r--;var f=this,u=16,e=Math.max(1,4/this._stepRatio());this._scrollTimeout=setTimeout(function(){r===0&&(t>u?t=Math.max(u,t/1.5):i=Math.min(e,i*2),r=5);f._continueScrolling(n,t,i,r)},t)},_scrollLeftClick:function(n){if(!this.options.enabled)return!1;n.preventDefault();this._bar("startScroll");this._bindStopScroll();this._continueScrolling("scrollLeft",4*this._stepRatio(),1)},_bindStopScroll:function(){var t=this;this._stopScrollHandle=function(n){n.preventDefault();t._stopScroll()};n(document).bind("mouseup touchend",this._stopScrollHandle)},_stopScroll:function(){n(document).unbind("mouseup touchend",this._stopScrollHandle);this._stopScrollHandle=null;this._bar("stopScroll");clearTimeout(this._scrollTimeout)},_createRuler:function(){this.ruler=n("<div class='ui-rangeSlider-ruler' />").appendTo(this.innerBar)},_setRulerParameters:function(){this.ruler.ruler({min:this.options.bounds.min,max:this.options.bounds.max,scales:this.options.scales})},_destroyRuler:function(){this.ruler!==null&&n.fn.ruler&&(this.ruler.ruler("destroy"),this.ruler.remove(),this.ruler=null)},_updateRuler:function(){(this._destroyRuler(),this.options.scales!==!1&&n.fn.ruler)&&(this._createRuler(),this._setRulerParameters())},values:function(n,t){var i;return typeof n!="undefined"&&typeof t!="undefined"?(this._deactivateLabels(),i=this._bar("values",n,t),this._changed(!0),this._reactivateLabels()):i=this._bar("values",n,t),i},min:function(n){return this._values.min=this.values(n,this._values.max).min,this._values.min},max:function(n){return this._values.max=this.values(this._values.min,n).max,this._values.max},bounds:function(n,t){return this._isValidValue(n)&&this._isValidValue(t)&&n<t&&(this._setBounds(n,t),this._updateRuler(),this._changed(!0)),this.options.bounds},_isValidValue:function(n){return typeof n!="undefined"&&parseFloat(n)===n},_setBounds:function(n,t){this.options.bounds={min:n,max:t};this._leftHandle("option","bounds",this.options.bounds);this._rightHandle("option","bounds",this.options.bounds);this._bar("option","bounds",this.options.bounds)},zoomIn:function(n){this._bar("zoomIn",n)},zoomOut:function(n){this._bar("zoomOut",n)},scrollLeft:function(n){this._bar("startScroll");this._bar("scrollLeft",n);this._bar("stopScroll")},scrollRight:function(n){this._bar("startScroll");this._bar("scrollRight",n);this._bar("stopScroll")},resize:function(){this._initWidth();this._leftHandle("update");this._rightHandle("update");this._bar("update")},enable:function(){this.toggle(!0)},disable:function(){this.toggle(!1)},toggle:function(n){n===t&&(n=!this.options.enabled);this.options.enabled!==n&&this._toggle(n)},_toggle:function(n){this.options.enabled=n;this.element.toggleClass("ui-rangeSlider-disabled",!n);var t=n?"enable":"disable";this._bar(t);this._leftHandle(t);this._rightHandle(t);this._leftLabel(t);this._rightLabel(t)},destroy:function(){this.element.removeClass("ui-rangeSlider-withArrows ui-rangeSlider-noArrow ui-rangeSlider-disabled");this._destroyWidgets();this._destroyElements();this.element.removeClass("ui-rangeSlider");this.options=null;n(window).unbind("resize",this._resizeProxy);this._resizeProxy=null;this._bindResize=null;n.Widget.prototype.destroy.apply(this,arguments)},_destroyWidget:function(n){this["_"+n]("destroy");this[n].remove();this[n]=null},_destroyWidgets:function(){this._destroyWidget("bar");this._destroyWidget("leftHandle");this._destroyWidget("rightHandle");this._destroyRuler();this._destroyLabels()},_destroyElements:function(){this.container.remove();this.container=null;this.innerBar.remove();this.innerBar=null;this.arrows.left.remove();this.arrows.right.remove();this.arrows=null}})}(jQuery);!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):n.moment=t()}(this,function(){"use strict";function i(){return wf.apply(null,arguments)}function ve(n){wf=n}function ui(n){return"[object Array]"===Object.prototype.toString.call(n)}function fi(n){return n instanceof Date||"[object Date]"===Object.prototype.toString.call(n)}function ye(n,t){for(var r=[],i=0;i<n.length;++i)r.push(t(n[i],i));return r}function ut(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function ei(n,t){for(var i in t)ut(t,i)&&(n[i]=t[i]);return ut(t,"toString")&&(n.toString=t.toString),ut(t,"valueOf")&&(n.valueOf=t.valueOf),n}function kt(n,t,i,r){return bu(n,t,i,r,!0).utc()}function pe(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function o(n){return null==n._pf&&(n._pf=pe()),n._pf}function gr(n){if(null==n._isValid){var t=o(n);n._isValid=!isNaN(n._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated;n._strict&&(n._isValid=n._isValid&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour)}return n._isValid}function nu(n){var t=kt(NaN);return null!=n?ei(o(t),n):o(t).userInvalidated=!0,t}function tu(n,t){var u,i,r;if("undefined"!=typeof t._isAMomentObject&&(n._isAMomentObject=t._isAMomentObject),"undefined"!=typeof t._i&&(n._i=t._i),"undefined"!=typeof t._f&&(n._f=t._f),"undefined"!=typeof t._l&&(n._l=t._l),"undefined"!=typeof t._strict&&(n._strict=t._strict),"undefined"!=typeof t._tzm&&(n._tzm=t._tzm),"undefined"!=typeof t._isUTC&&(n._isUTC=t._isUTC),"undefined"!=typeof t._offset&&(n._offset=t._offset),"undefined"!=typeof t._pf&&(n._pf=o(t)),"undefined"!=typeof t._locale&&(n._locale=t._locale),sr.length>0)for(u in sr)i=sr[u],r=t[i],"undefined"!=typeof r&&(n[i]=r);return n}function dt(n){tu(this,n);this._d=new Date(+n._d);hr===!1&&(hr=!0,i.updateOffset(this),hr=!1)}function nt(n){return n instanceof dt||null!=n&&null!=n._isAMomentObject}function s(n){var t=+n,i=0;return 0!==t&&isFinite(t)&&(i=t>=0?Math.floor(t):Math.ceil(t)),i}function iu(n,t,i){for(var f=Math.min(n.length,t.length),e=Math.abs(n.length-t.length),u=0,r=0;f>r;r++)(i&&n[r]!==t[r]||!i&&s(n[r])!==s(t[r]))&&u++;return u+e}function ru(){}function uu(n){return n?n.toLowerCase().replace("_","-"):n}function we(n){for(var i,t,f,r,u=0;u<n.length;){for(r=uu(n[u]).split("-"),i=r.length,t=uu(n[u+1]),t=t?t.split("-"):null;i>0;){if(f=fu(r.slice(0,i).join("-")))return f;if(t&&t.length>=i&&iu(r,t,!0)>=i-1)break;i--}u++}return null}function fu(n){var t=null;if(!ht[n]&&"undefined"!=typeof module&&module&&module.exports)try{t=li._abbr;require("./locale/"+n);gt(t)}catch(i){}return ht[n]}function gt(n,t){var i;return n&&(i="undefined"==typeof t?ft(n):eu(n,t),i&&(li=i)),li._abbr}function eu(n,t){return null!==t?(t.abbr=n,ht[n]||(ht[n]=new ru),ht[n].set(t),gt(n),ht[n]):(delete ht[n],null)}function ft(n){var t;if(n&&n._locale&&n._locale._abbr&&(n=n._locale._abbr),!n)return li;if(!ui(n)){if(t=fu(n))return t;n=[n]}return we(n)}function l(n,t){var i=n.toLowerCase();ii[i]=ii[i+"s"]=ii[t]=n}function y(n){if("string"==typeof n)return ii[n]||ii[n.toLowerCase()]}function ou(n){var i,t,r={};for(t in n)ut(n,t)&&(i=y(t),i&&(r[i]=n[t]));return r}function vt(n,t){return function(r){return null!=r?(su(this,n,r),i.updateOffset(this,t),this):oi(this,n)}}function oi(n,t){return n._d["get"+(n._isUTC?"UTC":"")+t]()}function su(n,t,i){return n._d["set"+(n._isUTC?"UTC":"")+t](i)}function hu(n,t){var i;if("object"==typeof n)for(i in n)this.set(i,n[i]);else if(n=y(n),"function"==typeof this[n])return this[n](t);return this}function ki(n,t,i){for(var r=""+Math.abs(n),u=n>=0;r.length<t;)r="0"+r;return(u?i?"+":"":"-")+r}function r(n,t,i,r){var u=r;"string"==typeof r&&(u=function(){return this[r]()});n&&(pt[n]=u);t&&(pt[t[0]]=function(){return ki(u.apply(this,arguments),t[1],t[2])});i&&(pt[i]=function(){return this.localeData().ordinal(u.apply(this,arguments),n)})}function be(n){return n.match(/\[[\s\S]/)?n.replace(/^\[|\]$/g,""):n.replace(/\\/g,"")}function ke(n){for(var i=n.match(bf),t=0,r=i.length;r>t;t++)i[t]=pt[i[t]]?pt[i[t]]:be(i[t]);return function(u){var f="";for(t=0;r>t;t++)f+=i[t]instanceof Function?i[t].call(u,n):i[t];return f}}function di(n,t){return n.isValid()?(t=cu(t,n.localeData()),cr[t]||(cr[t]=ke(t)),cr[t](n)):n.localeData().invalidDate()}function cu(n,t){function r(n){return t.longDateFormat(n)||n}var i=5;for(ai.lastIndex=0;i>=0&&ai.test(n);)n=n.replace(ai,r),ai.lastIndex=0,i-=1;return n}function t(n,t,i){vr[n]="function"==typeof t?t:function(n){return n&&i?i:t}}function de(n,t){return ut(vr,n)?vr[n](t._strict,t._locale):new RegExp(ge(n))}function ge(n){return n.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(n,t,i,r,u){return t||i||r||u}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function c(n,t){var i,r=t;for("string"==typeof n&&(n=[n]),"number"==typeof t&&(r=function(n,i){i[t]=s(n)}),i=0;i<n.length;i++)yr[n[i]]=r}function ni(n,t){c(n,function(n,i,r,u){r._w=r._w||{};t(n,r._w,r,u)})}function no(n,t,i){null!=t&&ut(yr,n)&&yr[n](t,i._a,i,n)}function gi(n,t){return new Date(Date.UTC(n,t+1,0)).getUTCDate()}function to(n){return this._months[n.month()]}function io(n){return this._monthsShort[n.month()]}function ro(n,t,i){var r,u,f;for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;12>r;r++)if((u=kt([2e3,r]),i&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(u,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(u,"").replace(".","")+"$","i")),i||this._monthsParse[r]||(f="^"+this.months(u,"")+"|^"+this.monthsShort(u,""),this._monthsParse[r]=new RegExp(f.replace(".",""),"i")),i&&"MMMM"===t&&this._longMonthsParse[r].test(n))||i&&"MMM"===t&&this._shortMonthsParse[r].test(n)||!i&&this._monthsParse[r].test(n))return r}function lu(n,t){var i;return"string"==typeof t&&(t=n.localeData().monthsParse(t),"number"!=typeof t)?n:(i=Math.min(n.date(),gi(n.year(),t)),n._d["set"+(n._isUTC?"UTC":"")+"Month"](t,i),n)}function au(n){return null!=n?(lu(this,n),i.updateOffset(this,!0),this):oi(this,"Month")}function uo(){return gi(this.year(),this.month())}function nr(n){var i,t=n._a;return t&&-2===o(n).overflow&&(i=t[d]<0||t[d]>11?d:t[b]<1||t[b]>gi(t[k],t[d])?b:t[a]<0||t[a]>24||24===t[a]&&(0!==t[ct]||0!==t[lt]||0!==t[at])?a:t[ct]<0||t[ct]>59?ct:t[lt]<0||t[lt]>59?lt:t[at]<0||t[at]>999?at:-1,o(n)._overflowDayOfYear&&(k>i||i>b)&&(i=b),o(n).overflow=i),n}function vu(n){i.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+n)}function p(n,t){var i=!0,r=n+"\n"+(new Error).stack;return ei(function(){return i&&(vu(r),i=!1),t.apply(this,arguments)},t)}function fo(n,t){gf[n]||(vu(t),gf[n]=!0)}function yu(n){var t,i,r=n._i,u=na.exec(r);if(u){for(o(n).iso=!0,t=0,i=pr.length;i>t;t++)if(pr[t][1].exec(r)){n._f=pr[t][0]+(u[6]||" ");break}for(t=0,i=wr.length;i>t;t++)if(wr[t][1].exec(r)){n._f+=wr[t][0];break}r.match(bi)&&(n._f+="Z");rr(n)}else n._isValid=!1}function eo(n){var t=ta.exec(n._i);return null!==t?void(n._d=new Date(+t[1])):(yu(n),void(n._isValid===!1&&(delete n._isValid,i.createFromInputFallback(n))))}function oo(n,t,i,r,u,f,e){var o=new Date(n,t,i,r,u,f,e);return 1970>n&&o.setFullYear(n),o}function tr(n){var t=new Date(Date.UTC.apply(null,arguments));return 1970>n&&t.setUTCFullYear(n),t}function pu(n){return wu(n)?366:365}function wu(n){return n%4==0&&n%100!=0||n%400==0}function so(){return wu(this.year())}function et(n,t,i){var u,f=i-t,r=i-n.day();return r>f&&(r-=7),f-7>r&&(r+=7),u=e(n).add(r,"d"),{week:Math.ceil(u.dayOfYear()/7),year:u.year()}}function ho(n){return et(n,this._week.dow,this._week.doy).week}function co(){return this._week.dow}function lo(){return this._week.doy}function ao(n){var t=this.localeData().week(this);return null==n?t:this.add(7*(n-t),"d")}function vo(n){var t=et(this,1,4).week;return null==n?t:this.add(7*(n-t),"d")}function yo(n,t,i,r,u){var o,e,f=tr(n,0,1).getUTCDay();return f=0===f?7:f,i=null!=i?i:u,o=u-f+(f>r?7:0)-(u>f?7:0),e=7*(t-1)+(i-u)+o+1,{year:e>0?n:n-1,dayOfYear:e>0?e:pu(n-1)+e}}function po(n){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==n?t:this.add(n-t,"d")}function yt(n,t,i){return null!=n?n:null!=t?t:i}function wo(n){var t=new Date;return n._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function ir(n){var t,i,r,u,f=[];if(!n._d){for(r=wo(n),n._w&&null==n._a[b]&&null==n._a[d]&&bo(n),n._dayOfYear&&(u=yt(n._a[k],r[k]),n._dayOfYear>pu(u)&&(o(n)._overflowDayOfYear=!0),i=tr(u,0,n._dayOfYear),n._a[d]=i.getUTCMonth(),n._a[b]=i.getUTCDate()),t=0;3>t&&null==n._a[t];++t)n._a[t]=f[t]=r[t];for(;7>t;t++)n._a[t]=f[t]=null==n._a[t]?2===t?1:0:n._a[t];24===n._a[a]&&0===n._a[ct]&&0===n._a[lt]&&0===n._a[at]&&(n._nextDay=!0,n._a[a]=0);n._d=(n._useUTC?tr:oo).apply(null,f);null!=n._tzm&&n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm);n._nextDay&&(n._a[a]=24)}}function bo(n){var t,o,u,r,i,f,s;t=n._w;null!=t.GG||null!=t.W||null!=t.E?(i=1,f=4,o=yt(t.GG,n._a[k],et(e(),1,4).year),u=yt(t.W,1),r=yt(t.E,1)):(i=n._locale._week.dow,f=n._locale._week.doy,o=yt(t.gg,n._a[k],et(e(),i,f).year),u=yt(t.w,1),null!=t.d?(r=t.d,i>r&&++u):r=null!=t.e?t.e+i:i);s=yo(o,u,r,f,i);n._a[k]=s.year;n._dayOfYear=s.dayOfYear}function rr(n){if(n._f===i.ISO_8601)return void yu(n);n._a=[];o(n).empty=!0;for(var t,u,s,r=""+n._i,c=r.length,h=0,e=cu(n._f,n._locale).match(bf)||[],f=0;f<e.length;f++)u=e[f],t=(r.match(de(u,n))||[])[0],t&&(s=r.substr(0,r.indexOf(t)),s.length>0&&o(n).unusedInput.push(s),r=r.slice(r.indexOf(t)+t.length),h+=t.length),pt[u]?(t?o(n).empty=!1:o(n).unusedTokens.push(u),no(u,t,n)):n._strict&&!t&&o(n).unusedTokens.push(u);o(n).charsLeftOver=c-h;r.length>0&&o(n).unusedInput.push(r);o(n).bigHour===!0&&n._a[a]<=12&&n._a[a]>0&&(o(n).bigHour=void 0);n._a[a]=ko(n._locale,n._a[a],n._meridiem);ir(n);nr(n)}function ko(n,t,i){var r;return null==i?t:null!=n.meridiemHour?n.meridiemHour(t,i):null!=n.isPM?(r=n.isPM(i),r&&12>t&&(t+=12),r||12!==t||(t=0),t):t}function go(n){var t,f,u,r,i;if(0===n._f.length)return o(n).invalidFormat=!0,void(n._d=new Date(NaN));for(r=0;r<n._f.length;r++)i=0,t=tu({},n),null!=n._useUTC&&(t._useUTC=n._useUTC),t._f=n._f[r],rr(t),gr(t)&&(i+=o(t).charsLeftOver,i+=10*o(t).unusedTokens.length,o(t).score=i,(null==u||u>i)&&(u=i,f=t));ei(n,f||t)}function ns(n){if(!n._d){var t=ou(n._i);n._a=[t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond];ir(n)}}function ts(n){var i,t=n._i,r=n._f;return n._locale=n._locale||ft(n._l),null===t||void 0===r&&""===t?nu({nullInput:!0}):("string"==typeof t&&(n._i=t=n._locale.preparse(t)),nt(t)?new dt(nr(t)):(ui(r)?go(n):r?rr(n):fi(t)?n._d=t:is(n),i=new dt(nr(n)),i._nextDay&&(i.add(1,"d"),i._nextDay=void 0),i))}function is(n){var t=n._i;void 0===t?n._d=new Date:fi(t)?n._d=new Date(+t):"string"==typeof t?eo(n):ui(t)?(n._a=ye(t.slice(0),function(n){return parseInt(n,10)}),ir(n)):"object"==typeof t?ns(n):"number"==typeof t?n._d=new Date(t):i.createFromInputFallback(n)}function bu(n,t,i,r,u){var f={};return"boolean"==typeof i&&(r=i,i=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=u,f._l=i,f._i=n,f._f=t,f._strict=r,ts(f)}function e(n,t,i,r){return bu(n,t,i,r,!1)}function ku(n,t){var r,i;if(1===t.length&&ui(t[0])&&(t=t[0]),!t.length)return e();for(r=t[0],i=1;i<t.length;++i)t[i][n](r)&&(r=t[i]);return r}function rs(){var n=[].slice.call(arguments,0);return ku("isBefore",n)}function us(){var n=[].slice.call(arguments,0);return ku("isAfter",n)}function si(n){var t=ou(n),i=t.year||0,r=t.quarter||0,u=t.month||0,f=t.week||0,e=t.day||0,o=t.hour||0,s=t.minute||0,h=t.second||0,c=t.millisecond||0;this._milliseconds=+c+1e3*h+6e4*s+36e5*o;this._days=+e+7*f;this._months=+u+3*r+12*i;this._data={};this._locale=ft();this._bubble()}function ur(n){return n instanceof si}function du(n,t){r(n,0,0,function(){var n=this.utcOffset(),i="+";return 0>n&&(n=-n,i="-"),i+ki(~~(n/60),2)+t+ki(~~n%60,2)})}function fr(n){var i=(n||"").match(bi)||[],u=i[i.length-1]||[],t=(u+"").match(re)||["-",0,0],r=+(60*t[1])+s(t[2]);return"+"===t[0]?r:-r}function er(n,t){var r,u;return t._isUTC?(r=t.clone(),u=(nt(n)||fi(n)?+n:+e(n))-+r,r._d.setTime(+r._d+u),i.updateOffset(r,!1),r):e(n).local()}function or(n){return 15*-Math.round(n._d.getTimezoneOffset()/15)}function fs(n,t){var r,u=this._offset||0;return null!=n?("string"==typeof n&&(n=fr(n)),Math.abs(n)<16&&(n=60*n),!this._isUTC&&t&&(r=or(this)),this._offset=n,this._isUTC=!0,null!=r&&this.add(r,"m"),u!==n&&(!t||this._changeInProgress?rf(this,tt(n-u,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,i.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?u:or(this)}function es(n,t){return null!=n?("string"!=typeof n&&(n=-n),this.utcOffset(n,t),this):-this.utcOffset()}function os(n){return this.utcOffset(0,n)}function ss(n){return this._isUTC&&(this.utcOffset(0,n),this._isUTC=!1,n&&this.subtract(or(this),"m")),this}function hs(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(fr(this._i)),this}function cs(n){return n=n?e(n).utcOffset():0,(this.utcOffset()-n)%60==0}function ls(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function as(){if(this._a){var n=this._isUTC?kt(this._a):e(this._a);return this.isValid()&&iu(this._a,n.toArray())>0}return!1}function vs(){return!this._isUTC}function ys(){return this._isUTC}function gu(){return this._isUTC&&0===this._offset}function tt(n,t){var u,f,o,i=n,r=null;return ur(n)?i={ms:n._milliseconds,d:n._days,M:n._months}:"number"==typeof n?(i={},t?i[t]=n:i.milliseconds=n):(r=ue.exec(n))?(u="-"===r[1]?-1:1,i={y:0,d:s(r[b])*u,h:s(r[a])*u,m:s(r[ct])*u,s:s(r[lt])*u,ms:s(r[at])*u}):(r=fe.exec(n))?(u="-"===r[1]?-1:1,i={y:ot(r[2],u),M:ot(r[3],u),d:ot(r[4],u),h:ot(r[5],u),m:ot(r[6],u),s:ot(r[7],u),w:ot(r[8],u)}):null==i?i={}:"object"==typeof i&&("from"in i||"to"in i)&&(o=ps(e(i.from),e(i.to)),i={},i.ms=o.milliseconds,i.M=o.months),f=new si(i),ur(n)&&ut(n,"_locale")&&(f._locale=n._locale),f}function ot(n,t){var i=n&&parseFloat(n.replace(",","."));return(isNaN(i)?0:i)*t}function nf(n,t){var i={milliseconds:0,months:0};return i.months=t.month()-n.month()+12*(t.year()-n.year()),n.clone().add(i.months,"M").isAfter(t)&&--i.months,i.milliseconds=+t-+n.clone().add(i.months,"M"),i}function ps(n,t){var i;return t=er(t,n),n.isBefore(t)?i=nf(n,t):(i=nf(t,n),i.milliseconds=-i.milliseconds,i.months=-i.months),i}function tf(n,t){return function(i,r){var u,f;return null===r||isNaN(+r)||(fo(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period)."),f=i,i=r,r=f),i="string"==typeof i?+i:i,u=tt(i,r),rf(this,u,n),this}}function rf(n,t,r,u){var o=t._milliseconds,f=t._days,e=t._months;u=null==u?!0:u;o&&n._d.setTime(+n._d+o*r);f&&su(n,"Date",oi(n,"Date")+f*r);e&&lu(n,oi(n,"Month")+e*r);u&&i.updateOffset(n,f||e)}function ws(n){var i=n||e(),r=er(i,this).startOf("day"),t=this.diff(r,"days",!0),u=-6>t?"sameElse":-1>t?"lastWeek":0>t?"lastDay":1>t?"sameDay":2>t?"nextDay":7>t?"nextWeek":"sameElse";return this.format(this.localeData().calendar(u,this,e(i)))}function bs(){return new dt(this)}function ks(n,t){var i;return t=y("undefined"!=typeof t?t:"millisecond"),"millisecond"===t?(n=nt(n)?n:e(n),+this>+n):(i=nt(n)?+n:+e(n),i<+this.clone().startOf(t))}function ds(n,t){var i;return t=y("undefined"!=typeof t?t:"millisecond"),"millisecond"===t?(n=nt(n)?n:e(n),+n>+this):(i=nt(n)?+n:+e(n),+this.clone().endOf(t)<i)}function gs(n,t,i){return this.isAfter(n,i)&&this.isBefore(t,i)}function nh(n,t){var i;return t=y(t||"millisecond"),"millisecond"===t?(n=nt(n)?n:e(n),+this==+n):(i=+e(n),+this.clone().startOf(t)<=i&&i<=+this.clone().endOf(t))}function w(n){return 0>n?Math.ceil(n):Math.floor(n)}function th(n,t,i){var r,u,f=er(n,this),e=6e4*(f.utcOffset()-this.utcOffset());return t=y(t),"year"===t||"month"===t||"quarter"===t?(u=ih(this,f),"quarter"===t?u/=3:"year"===t&&(u/=12)):(r=this-f,u="second"===t?r/1e3:"minute"===t?r/6e4:"hour"===t?r/36e5:"day"===t?(r-e)/864e5:"week"===t?(r-e)/6048e5:r),i?u:w(u)}function ih(n,t){var r,f,u=12*(t.year()-n.year())+(t.month()-n.month()),i=n.clone().add(u,"months");return 0>t-i?(r=n.clone().add(u-1,"months"),f=(t-i)/(i-r)):(r=n.clone().add(u+1,"months"),f=(t-i)/(r-i)),-(u+f)}function rh(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function uf(){var n=this.clone().utc();return 0<n.year()&&n.year()<=9999?"function"==typeof Date.prototype.toISOString?this.toDate().toISOString():di(n,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):di(n,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function uh(n){var t=di(this,n||i.defaultFormat);return this.localeData().postformat(t)}function fh(n,t){return this.isValid()?tt({to:this,from:n}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function eh(n){return this.from(e(),n)}function oh(n,t){return this.isValid()?tt({from:this,to:n}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function sh(n){return this.to(e(),n)}function ff(n){var t;return void 0===n?this._locale._abbr:(t=ft(n),null!=t&&(this._locale=t),this)}function ef(){return this._locale}function hh(n){switch(n=y(n)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===n&&this.weekday(0),"isoWeek"===n&&this.isoWeekday(1),"quarter"===n&&this.month(3*Math.floor(this.month()/3)),this}function ch(n){return n=y(n),void 0===n||"millisecond"===n?this:this.startOf(n).add(1,"isoWeek"===n?"week":n).subtract(1,"ms")}function lh(){return+this._d-6e4*(this._offset||0)}function ah(){return Math.floor(+this/1e3)}function vh(){return this._offset?new Date(+this):this._d}function yh(){var n=this;return[n.year(),n.month(),n.date(),n.hour(),n.minute(),n.second(),n.millisecond()]}function ph(){return gr(this)}function wh(){return ei({},o(this))}function bh(){return o(this).overflow}function hi(n,t){r(0,[n,n.length],0,t)}function of(n,t,i){return et(e([n,11,31+t-i]),t,i).week}function kh(n){var t=et(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return null==n?t:this.add(n-t,"y")}function dh(n){var t=et(this,1,4).year;return null==n?t:this.add(n-t,"y")}function gh(){return of(this.year(),1,4)}function nc(){var n=this.localeData()._week;return of(this.year(),n.dow,n.doy)}function tc(n){return null==n?Math.ceil((this.month()+1)/3):this.month(3*(n-1)+this.month()%3)}function ic(n,t){if("string"==typeof n)if(isNaN(n)){if(n=t.weekdaysParse(n),"number"!=typeof n)return null}else n=parseInt(n,10);return n}function rc(n){return this._weekdays[n.day()]}function uc(n){return this._weekdaysShort[n.day()]}function fc(n){return this._weekdaysMin[n.day()]}function ec(n){var t,i,r;for(this._weekdaysParse||(this._weekdaysParse=[]),t=0;7>t;t++)if(this._weekdaysParse[t]||(i=e([2e3,1]).day(t),r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[t]=new RegExp(r.replace(".",""),"i")),this._weekdaysParse[t].test(n))return t}function oc(n){var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=n?(n=ic(n,this.localeData()),this.add(n-t,"d")):t}function sc(n){var t=(this.day()+7-this.localeData()._week.dow)%7;return null==n?t:this.add(n-t,"d")}function hc(n){return null==n?this.day()||7:this.day(this.day()%7?n:n-7)}function sf(n,t){r(n,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function hf(n,t){return t._meridiemParse}function cc(n){return"p"===(n+"").toLowerCase().charAt(0)}function lc(n,t,i){return n>11?i?"pm":"PM":i?"am":"AM"}function cf(n){r(0,[n,3],0,"millisecond")}function ac(){return this._isUTC?"UTC":""}function vc(){return this._isUTC?"Coordinated Universal Time":""}function yc(n){return e(1e3*n)}function pc(){return e.apply(null,arguments).parseZone()}function wc(n,t,i){var r=this._calendar[n];return"function"==typeof r?r.call(t,i):r}function bc(n){var t=this._longDateFormat[n];return!t&&this._longDateFormat[n.toUpperCase()]&&(t=this._longDateFormat[n.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(n){return n.slice(1)}),this._longDateFormat[n]=t),t}function kc(){return this._invalidDate}function dc(n){return this._ordinal.replace("%d",n)}function lf(n){return n}function gc(n,t,i,r){var u=this._relativeTime[i];return"function"==typeof u?u(n,t,i,r):u.replace(/%d/i,n)}function nl(n,t){var i=this._relativeTime[n>0?"future":"past"];return"function"==typeof i?i(t):i.replace(/%s/i,t)}function tl(n){var t;for(var i in n)t=n[i],"function"==typeof t?this[i]=t:this["_"+i]=t;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function af(n,t,i,r){var u=ft(),f=kt().set(r,t);return u[i](f,n)}function ti(n,t,i,r,u){if("number"==typeof n&&(t=n,n=void 0),n=n||"",null!=t)return af(n,t,i,u);for(var e=[],f=0;r>f;f++)e[f]=af(n,f,i,u);return e}function il(n,t){return ti(n,t,"months",12,"month")}function rl(n,t){return ti(n,t,"monthsShort",12,"month")}function ul(n,t){return ti(n,t,"weekdays",7,"day")}function fl(n,t){return ti(n,t,"weekdaysShort",7,"day")}function el(n,t){return ti(n,t,"weekdaysMin",7,"day")}function ol(){var n=this._data;return this._milliseconds=g(this._milliseconds),this._days=g(this._days),this._months=g(this._months),n.milliseconds=g(n.milliseconds),n.seconds=g(n.seconds),n.minutes=g(n.minutes),n.hours=g(n.hours),n.months=g(n.months),n.years=g(n.years),this}function vf(n,t,i,r){var u=tt(t,i);return n._milliseconds+=r*u._milliseconds,n._days+=r*u._days,n._months+=r*u._months,n._bubble()}function sl(n,t){return vf(this,n,t,1)}function hl(n,t){return vf(this,n,t,-1)}function cl(){var u,f,e,o=this._milliseconds,t=this._days,i=this._months,n=this._data,r=0;return n.milliseconds=o%1e3,u=w(o/1e3),n.seconds=u%60,f=w(u/60),n.minutes=f%60,e=w(f/60),n.hours=e%24,t+=w(e/24),r=w(yf(t)),t-=w(pf(r)),i+=w(t/30),t%=30,r+=w(i/12),i%=12,n.days=t,n.months=i,n.years=r,this}function yf(n){return 400*n/146097}function pf(n){return 146097*n/400}function ll(n){var t,r,i=this._milliseconds;if(n=y(n),"month"===n||"year"===n)return t=this._days+i/864e5,r=this._months+12*yf(t),"month"===n?r:r/12;switch(t=this._days+Math.round(pf(this._months/12)),n){case"week":return t/7+i/6048e5;case"day":return t+i/864e5;case"hour":return 24*t+i/36e5;case"minute":return 1440*t+i/6e4;case"second":return 86400*t+i/1e3;case"millisecond":return Math.floor(864e5*t)+i;default:throw new Error("Unknown unit "+n);}}function al(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*s(this._months/12)}function it(n){return function(){return this.as(n)}}function vl(n){return n=y(n),this[n+"s"]()}function st(n){return function(){return this._data[n]}}function yl(){return w(this.days()/7)}function pl(n,t,i,r,u){return u.relativeTime(t||1,!!i,n,r)}function wl(n,t,i){var r=tt(n).abs(),h=wt(r.as("s")),f=wt(r.as("m")),e=wt(r.as("h")),o=wt(r.as("d")),s=wt(r.as("M")),c=wt(r.as("y")),u=h<rt.s&&["s",h]||1===f&&["m"]||f<rt.m&&["mm",f]||1===e&&["h"]||e<rt.h&&["hh",e]||1===o&&["d"]||o<rt.d&&["dd",o]||1===s&&["M"]||s<rt.M&&["MM",s]||1===c&&["y"]||["yy",c];return u[2]=t,u[3]=+n>0,u[4]=i,pl.apply(null,u)}function bl(n,t){return void 0===rt[n]?!1:void 0===t?rt[n]:(rt[n]=t,!0)}function kl(n){var t=this.localeData(),i=wl(this,!n,t);return n&&(i=t.pastFuture(+this,i)),t.postformat(i)}function ci(){var r=bt(this.years()),u=bt(this.months()),f=bt(this.days()),n=bt(this.hours()),t=bt(this.minutes()),i=bt(this.seconds()+this.milliseconds()/1e3),e=this.asSeconds();return e?(0>e?"-":"")+"P"+(r?r+"Y":"")+(u?u+"M":"")+(f?f+"D":"")+(n||t||i?"T":"")+(n?n+"H":"")+(t?t+"M":"")+(i?i+"S":""):"P0D"}var wf,li,sr=i.momentProperties=[],hr=!1,ht={},ii={},bf=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|x|X|zz?|ZZ?|.)/g,ai=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,cr={},pt={},kf=/\d/,v=/\d\d/,df=/\d{3}/,lr=/\d{4}/,vi=/[+-]?\d{6}/,h=/\d\d?/,yi=/\d{1,3}/,ar=/\d{1,4}/,pi=/[+-]?\d{1,6}/,wi=/[+-]?\d+/,bi=/Z|[+-]\d\d:?\d\d/gi,ri=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,vr={},yr={},k=0,d=1,b=2,a=3,ct=4,lt=5,at=6,br,ne,te,ie,re,ue,fe,ee,oe,kr,dr,se,he,ce,le,ae,n;r("M",["MM",2],"Mo",function(){return this.month()+1});r("MMM",0,0,function(n){return this.localeData().monthsShort(this,n)});r("MMMM",0,0,function(n){return this.localeData().months(this,n)});l("month","M");t("M",h);t("MM",h,v);t("MMM",ri);t("MMMM",ri);c(["M","MM"],function(n,t){t[d]=s(n)-1});c(["MMM","MMMM"],function(n,t,i,r){var u=i._locale.monthsParse(n,r,i._strict);null!=u?t[d]=u:o(i).invalidMonth=n});var dl="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),gl="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),gf={};i.suppressDeprecationWarnings=!1;var na=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,pr=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],wr=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],ta=/^\/?Date\((\-?\d+)/i;i.createFromInputFallback=p("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(n){n._d=new Date(n._i+(n._useUTC?" UTC":""))});r(0,["YY",2],0,function(){return this.year()%100});r(0,["YYYY",4],0,"year");r(0,["YYYYY",5],0,"year");r(0,["YYYYYY",6,!0],0,"year");l("year","y");t("Y",wi);t("YY",h,v);t("YYYY",ar,lr);t("YYYYY",pi,vi);t("YYYYYY",pi,vi);c(["YYYY","YYYYY","YYYYYY"],k);c("YY",function(n,t){t[k]=i.parseTwoDigitYear(n)});i.parseTwoDigitYear=function(n){return s(n)+(s(n)>68?1900:2e3)};br=vt("FullYear",!1);r("w",["ww",2],"wo","week");r("W",["WW",2],"Wo","isoWeek");l("week","w");l("isoWeek","W");t("w",h);t("ww",h,v);t("W",h);t("WW",h,v);ni(["w","ww","W","WW"],function(n,t,i,r){t[r.substr(0,1)]=s(n)});ne={dow:0,doy:6};r("DDD",["DDDD",3],"DDDo","dayOfYear");l("dayOfYear","DDD");t("DDD",yi);t("DDDD",df);c(["DDD","DDDD"],function(n,t,i){i._dayOfYear=s(n)});i.ISO_8601=function(){};te=p("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var n=e.apply(null,arguments);return this>n?this:n});ie=p("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var n=e.apply(null,arguments);return n>this?this:n});du("Z",":");du("ZZ","");t("Z",bi);t("ZZ",bi);c(["Z","ZZ"],function(n,t,i){i._useUTC=!0;i._tzm=fr(n)});re=/([\+\-]|\d\d)/gi;i.updateOffset=function(){};ue=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/;fe=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;tt.fn=si.prototype;ee=tf(1,"add");oe=tf(-1,"subtract");i.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";kr=p("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(n){return void 0===n?this.localeData():this.locale(n)});r(0,["gg",2],0,function(){return this.weekYear()%100});r(0,["GG",2],0,function(){return this.isoWeekYear()%100});hi("gggg","weekYear");hi("ggggg","weekYear");hi("GGGG","isoWeekYear");hi("GGGGG","isoWeekYear");l("weekYear","gg");l("isoWeekYear","GG");t("G",wi);t("g",wi);t("GG",h,v);t("gg",h,v);t("GGGG",ar,lr);t("gggg",ar,lr);t("GGGGG",pi,vi);t("ggggg",pi,vi);ni(["gggg","ggggg","GGGG","GGGGG"],function(n,t,i,r){t[r.substr(0,2)]=s(n)});ni(["gg","GG"],function(n,t,r,u){t[u]=i.parseTwoDigitYear(n)});r("Q",0,0,"quarter");l("quarter","Q");t("Q",kf);c("Q",function(n,t){t[d]=3*(s(n)-1)});r("D",["DD",2],"Do","date");l("date","D");t("D",h);t("DD",h,v);t("Do",function(n,t){return n?t._ordinalParse:t._ordinalParseLenient});c(["D","DD"],b);c("Do",function(n,t){t[b]=s(n.match(h)[0],10)});dr=vt("Date",!0);r("d",0,"do","day");r("dd",0,0,function(n){return this.localeData().weekdaysMin(this,n)});r("ddd",0,0,function(n){return this.localeData().weekdaysShort(this,n)});r("dddd",0,0,function(n){return this.localeData().weekdays(this,n)});r("e",0,0,"weekday");r("E",0,0,"isoWeekday");l("day","d");l("weekday","e");l("isoWeekday","E");t("d",h);t("e",h);t("E",h);t("dd",ri);t("ddd",ri);t("dddd",ri);ni(["dd","ddd","dddd"],function(n,t,i){var r=i._locale.weekdaysParse(n);null!=r?t.d=r:o(i).invalidWeekday=n});ni(["d","e","E"],function(n,t,i,r){t[r]=s(n)});var ia="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ra="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),ua="Su_Mo_Tu_We_Th_Fr_Sa".split("_");r("H",["HH",2],0,"hour");r("h",["hh",2],0,function(){return this.hours()%12||12});sf("a",!0);sf("A",!1);l("hour","h");t("a",hf);t("A",hf);t("H",h);t("h",h);t("HH",h,v);t("hh",h,v);c(["H","HH"],a);c(["a","A"],function(n,t,i){i._isPm=i._locale.isPM(n);i._meridiem=n});c(["h","hh"],function(n,t,i){t[a]=s(n);o(i).bigHour=!0});se=/[ap]\.?m?\.?/i;he=vt("Hours",!0);r("m",["mm",2],0,"minute");l("minute","m");t("m",h);t("mm",h,v);c(["m","mm"],ct);ce=vt("Minutes",!1);r("s",["ss",2],0,"second");l("second","s");t("s",h);t("ss",h,v);c(["s","ss"],lt);le=vt("Seconds",!1);r("S",0,0,function(){return~~(this.millisecond()/100)});r(0,["SS",2],0,function(){return~~(this.millisecond()/10)});cf("SSS");cf("SSSS");l("millisecond","ms");t("S",yi,kf);t("SS",yi,v);t("SSS",yi,df);t("SSSS",/\d+/);c(["S","SS","SSS","SSSS"],function(n,t){t[at]=s(1e3*("0."+n))});ae=vt("Milliseconds",!1);r("z",0,0,"zoneAbbr");r("zz",0,0,"zoneName");n=dt.prototype;n.add=ee;n.calendar=ws;n.clone=bs;n.diff=th;n.endOf=ch;n.format=uh;n.from=fh;n.fromNow=eh;n.to=oh;n.toNow=sh;n.get=hu;n.invalidAt=bh;n.isAfter=ks;n.isBefore=ds;n.isBetween=gs;n.isSame=nh;n.isValid=ph;n.lang=kr;n.locale=ff;n.localeData=ef;n.max=ie;n.min=te;n.parsingFlags=wh;n.set=hu;n.startOf=hh;n.subtract=oe;n.toArray=yh;n.toDate=vh;n.toISOString=uf;n.toJSON=uf;n.toString=rh;n.unix=ah;n.valueOf=lh;n.year=br;n.isLeapYear=so;n.weekYear=kh;n.isoWeekYear=dh;n.quarter=n.quarters=tc;n.month=au;n.daysInMonth=uo;n.week=n.weeks=ao;n.isoWeek=n.isoWeeks=vo;n.weeksInYear=nc;n.isoWeeksInYear=gh;n.date=dr;n.day=n.days=oc;n.weekday=sc;n.isoWeekday=hc;n.dayOfYear=po;n.hour=n.hours=he;n.minute=n.minutes=ce;n.second=n.seconds=le;n.millisecond=n.milliseconds=ae;n.utcOffset=fs;n.utc=os;n.local=ss;n.parseZone=hs;n.hasAlignedHourOffset=cs;n.isDST=ls;n.isDSTShifted=as;n.isLocal=vs;n.isUtcOffset=ys;n.isUtc=gu;n.isUTC=gu;n.zoneAbbr=ac;n.zoneName=vc;n.dates=p("dates accessor is deprecated. Use date instead.",dr);n.months=p("months accessor is deprecated. Use month instead",au);n.years=p("years accessor is deprecated. Use year instead",br);n.zone=p("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",es);var fa=n,u=ru.prototype;u._calendar={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};u.calendar=wc;u._longDateFormat={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY LT",LLLL:"dddd, MMMM D, YYYY LT"};u.longDateFormat=bc;u._invalidDate="Invalid date";u.invalidDate=kc;u._ordinal="%d";u.ordinal=dc;u._ordinalParse=/\d{1,2}/;u.preparse=lf;u.postformat=lf;u._relativeTime={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};u.relativeTime=gc;u.pastFuture=nl;u.set=tl;u.months=to;u._months=dl;u.monthsShort=io;u._monthsShort=gl;u.monthsParse=ro;u.week=ho;u._week=ne;u.firstDayOfYear=lo;u.firstDayOfWeek=co;u.weekdays=rc;u._weekdays=ia;u.weekdaysMin=fc;u._weekdaysMin=ua;u.weekdaysShort=uc;u._weekdaysShort=ra;u.weekdaysParse=ec;u.isPM=cc;u._meridiemParse=se;u.meridiem=lc;gt("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(n){var t=n%10,i=1===s(n%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return n+i}});i.lang=p("moment.lang is deprecated. Use moment.locale instead.",gt);i.langData=p("moment.langData is deprecated. Use moment.localeData instead.",ft);var g=Math.abs,ea=it("ms"),oa=it("s"),sa=it("m"),ha=it("h"),ca=it("d"),la=it("w"),aa=it("M"),va=it("y"),ya=st("milliseconds"),pa=st("seconds"),wa=st("minutes"),ba=st("hours"),ka=st("days"),da=st("months"),ga=st("years"),wt=Math.round,rt={s:45,m:45,h:22,d:26,M:11},bt=Math.abs,f=si.prototype;return f.abs=ol,f.add=sl,f.subtract=hl,f.as=ll,f.asMilliseconds=ea,f.asSeconds=oa,f.asMinutes=sa,f.asHours=ha,f.asDays=ca,f.asWeeks=la,f.asMonths=aa,f.asYears=va,f.valueOf=al,f._bubble=cl,f.get=vl,f.milliseconds=ya,f.seconds=pa,f.minutes=wa,f.hours=ba,f.days=ka,f.weeks=yl,f.months=da,f.years=ga,f.humanize=kl,f.toISOString=ci,f.toString=ci,f.toJSON=ci,f.locale=ff,f.localeData=ef,f.toIsoString=p("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ci),f.lang=kr,r("X",0,0,"unix"),r("x",0,0,"valueOf"),t("x",wi),t("X",/[+-]?\d+(\.\d{1,3})?/),c("X",function(n,t,i){i._d=new Date(1e3*parseFloat(n,10))}),c("x",function(n,t,i){i._d=new Date(s(n))}),i.version="2.10.3",ve(e),i.fn=fa,i.min=rs,i.max=us,i.utc=kt,i.unix=yc,i.months=il,i.isDate=fi,i.locale=gt,i.invalid=nu,i.duration=tt,i.isMoment=nt,i.weekdays=ul,i.parseZone=pc,i.localeData=ft,i.isDuration=ur,i.monthsShort=rl,i.weekdaysMin=el,i.defineLocale=eu,i.weekdaysShort=fl,i.normalizeUnits=y,i.relativeTimeThreshold=bl,i}),function(n,t){if(typeof define=="function"&&define.amd)define(["moment","jquery","exports"],function(i,r,u){n.daterangepicker=t(n,u,i,r)});else if(typeof exports!="undefined"){var r=require("moment"),i=typeof window!="undefined"?window.jQuery:undefined;if(!i)try{i=require("jquery");i.fn||(i.fn={})}catch(u){if(!i)throw new Error("jQuery dependency not found");}t(n,exports,r,i)}else n.daterangepicker=t(n,{},n.moment||moment,n.jQuery||n.Zepto||n.ender||n.$)}(this||{},function(n,t,i,r){var u=function(n,t,u){var a,f,e,o,h,l,s,v,p,c,y,w;if(this.parentEl="body",this.element=r(n),this.startDate=i().startOf("day"),this.endDate=i().endOf("day"),this.minDate=!1,this.maxDate=!1,this.dateLimit=!1,this.autoApply=!1,this.singleDatePicker=!1,this.showDropdowns=!1,this.showWeekNumbers=!1,this.timePicker=!1,this.timePicker24Hour=!1,this.timePickerIncrement=1,this.timePickerSeconds=!1,this.linkedCalendars=!0,this.autoUpdateInput=!0,this.ranges={},this.showSingleCalendar=!1,this.selectEndDate=!1,this.showPaddedDays=!0,this.opens="right",this.element.hasClass("pull-right")&&(this.opens="left"),this.drops="down",this.element.hasClass("dropup")&&(this.drops="up"),this.buttonClasses="btn btn-sm",this.applyClass="btn-success",this.cancelClass="btn-default",this.locale={format:"MM/DD/YYYY",separator:" - ",applyLabel:"Apply",cancelLabel:"Cancel",weekLabel:"W",customRangeLabel:"Custom Range",daysOfWeek:i.weekdaysMin(),monthNames:i.monthsShort(),firstDay:i.localeData().firstDayOfWeek()},this.callback=function(){},this.isShowing=!1,this.leftCalendar={},this.rightCalendar={},(typeof t!="object"||t===null)&&(t={}),t=r.extend(this.element.data(),t),typeof t.template!="string"&&(t.template='<div class="daterangepicker dropdown-menu"><div class="calendar left"><div class="daterangepicker_input"><input class="input-mini" type="text" name="daterangepicker_start" value="" /><i class="fa fa-calendar glyphicon glyphicon-calendar"><\/i><div class="calendar-time"><div><\/div><i class="fa fa-clock-o glyphicon glyphicon-time"><\/i><\/div><\/div><div class="calendar-table"><\/div><\/div><div class="calendar right"><div class="daterangepicker_input"><input class="input-mini" type="text" name="daterangepicker_end" value="" /><i class="fa fa-calendar glyphicon glyphicon-calendar"><\/i><div class="calendar-time"><div><\/div><i class="fa fa-clock-o glyphicon glyphicon-time"><\/i><\/div><\/div><div class="calendar-table"><\/div><\/div><div class="ranges"><div class="range_inputs"><button class="applyBtn" disabled="disabled" type="button"><\/button> <button class="cancelBtn" type="button"><\/button><\/div><\/div><\/div>'),this.parentEl=t.parentEl&&r(t.parentEl).length?r(t.parentEl):r(this.parentEl),this.container=r(t.template).appendTo(this.parentEl),typeof t.locale=="object"&&(typeof t.locale.format=="string"&&(this.locale.format=t.locale.format),typeof t.locale.separator=="string"&&(this.locale.separator=t.locale.separator),typeof t.locale.daysOfWeek=="object"&&(this.locale.daysOfWeek=t.locale.daysOfWeek.slice()),typeof t.locale.monthNames=="object"&&(this.locale.monthNames=t.locale.monthNames.slice()),typeof t.locale.firstDay=="number"&&(this.locale.firstDay=t.locale.firstDay),typeof t.locale.applyLabel=="string"&&(this.locale.applyLabel=t.locale.applyLabel),typeof t.locale.cancelLabel=="string"&&(this.locale.cancelLabel=t.locale.cancelLabel),typeof t.locale.weekLabel=="string"&&(this.locale.weekLabel=t.locale.weekLabel),typeof t.locale.customRangeLabel=="string"&&(this.locale.customRangeLabel=t.locale.customRangeLabel)),typeof t.startDate=="string"&&(this.startDate=i(t.startDate,this.locale.format)),typeof t.endDate=="string"&&(this.endDate=i(t.endDate,this.locale.format)),typeof t.minDate=="string"&&(this.minDate=i(t.minDate,this.locale.format)),typeof t.maxDate=="string"&&(this.maxDate=i(t.maxDate,this.locale.format)),typeof t.startDate=="object"&&(this.startDate=i(t.startDate)),typeof t.endDate=="object"&&(this.endDate=i(t.endDate)),typeof t.minDate=="object"&&(this.minDate=i(t.minDate)),typeof t.maxDate=="object"&&(this.maxDate=i(t.maxDate)),this.minDate&&this.startDate.isBefore(this.minDate)&&(this.startDate=this.minDate.clone()),this.maxDate&&this.endDate.isAfter(this.maxDate)&&(this.endDate=this.maxDate.clone()),typeof t.applyClass=="string"&&(this.applyClass=t.applyClass),typeof t.cancelClass=="string"&&(this.cancelClass=t.cancelClass),typeof t.dateLimit=="object"&&(this.dateLimit=t.dateLimit),typeof t.opens=="string"&&(this.opens=t.opens),typeof t.drops=="string"&&(this.drops=t.drops),typeof t.showWeekNumbers=="boolean"&&(this.showWeekNumbers=t.showWeekNumbers),typeof t.buttonClasses=="string"&&(this.buttonClasses=t.buttonClasses),typeof t.buttonClasses=="object"&&(this.buttonClasses=t.buttonClasses.join(" ")),typeof t.showDropdowns=="boolean"&&(this.showDropdowns=t.showDropdowns),typeof t.singleDatePicker=="boolean"&&(this.singleDatePicker=t.singleDatePicker,this.singleDatePicker&&(this.endDate=this.startDate.clone())),typeof t.timePicker=="boolean"&&(this.timePicker=t.timePicker),typeof t.timePickerSeconds=="boolean"&&(this.timePickerSeconds=t.timePickerSeconds),typeof t.timePickerIncrement=="number"&&(this.timePickerIncrement=t.timePickerIncrement),typeof t.timePicker24Hour=="boolean"&&(this.timePicker24Hour=t.timePicker24Hour),typeof t.autoApply=="boolean"&&(this.autoApply=t.autoApply),typeof t.autoUpdateInput=="boolean"&&(this.autoUpdateInput=t.autoUpdateInput),typeof t.linkedCalendars=="boolean"&&(this.linkedCalendars=t.linkedCalendars),typeof t.isInvalidDate=="function"&&(this.isInvalidDate=t.isInvalidDate),typeof t.showSingleCalendar=="boolean"&&(this.showSingleCalendar=t.showSingleCalendar,this.singleDatePicker&&(this.showSingleCalendar=!0)),typeof t.selectEndDate=="boolean"&&(this.selectEndDate=t.selectEndDate),typeof t.showPaddedDays=="boolean"&&(this.showPaddedDays=t.showPaddedDays),this.locale.firstDay!=0)for(a=this.locale.firstDay;a>0;)this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift()),a--;if(typeof t.startDate=="undefined"&&typeof t.endDate=="undefined"&&r(this.element).is("input[type=text]")&&(h=r(this.element).val(),l=h.split(this.locale.separator),f=e=null,l.length==2?(f=i(l[0],this.locale.format),e=i(l[1],this.locale.format)):this.singleDatePicker&&h!==""&&(f=i(h,this.locale.format),e=i(h,this.locale.format)),f!==null&&e!==null&&(this.setStartDate(f),this.setEndDate(e))),typeof t.ranges=="object"){for(o in t.ranges)(f=typeof t.ranges[o][0]=="string"?i(t.ranges[o][0],this.locale.format):i(t.ranges[o][0]),e=typeof t.ranges[o][1]=="string"?i(t.ranges[o][1],this.locale.format):i(t.ranges[o][1]),this.minDate&&f.isBefore(this.minDate)&&(f=this.minDate.clone()),s=this.maxDate,this.dateLimit&&f.clone().add(this.dateLimit).isAfter(s)&&(s=f.clone().add(this.dateLimit)),s&&e.isAfter(s)&&(e=s.clone()),this.minDate&&e.isBefore(this.minDate)||s&&f.isAfter(s))||(v=document.createElement("textarea"),v.innerHTML=o,p=v.value,this.ranges[p]=[f,e]);c="<ul>";for(o in this.ranges)c+="<li>"+o+"<\/li>";c+="<li>"+this.locale.customRangeLabel+"<\/li>";c+="<\/ul>";this.container.find(".ranges").prepend(c)}typeof u=="function"&&(this.callback=u);this.timePicker||(this.startDate=this.startDate.startOf("day"),this.endDate=this.endDate.endOf("day"),this.container.find(".calendar-time").hide());this.timePicker&&this.autoApply&&(this.autoApply=!1);this.autoApply&&typeof t.ranges!="object"?this.container.find(".ranges").hide():this.autoApply&&this.container.find(".applyBtn, .cancelBtn").addClass("hide");(this.singleDatePicker||this.showSingleCalendar)&&(this.container.addClass("single"),this.container.find(".calendar.left").addClass("single"),this.container.find(".calendar.left").show(),this.container.find(".calendar.right").hide(),this.container.find(".daterangepicker_input input, .daterangepicker_input i").hide(),this.timePicker||this.container.find(".ranges").hide());typeof t.ranges!="undefined"||this.singleDatePicker||this.container.addClass("show-calendar");this.container.addClass("opens"+this.opens);typeof t.ranges!="undefined"&&this.opens=="right"&&(y=this.container.find(".ranges"),w=y.clone(),y.remove(),this.container.find(".calendar.left").parent().prepend(w));this.container.find(".applyBtn, .cancelBtn").addClass(this.buttonClasses);this.applyClass.length&&this.container.find(".applyBtn").addClass(this.applyClass);this.cancelClass.length&&this.container.find(".cancelBtn").addClass(this.cancelClass);this.container.find(".applyBtn").html(this.locale.applyLabel);this.container.find(".cancelBtn").html(this.locale.cancelLabel);this.container.find(".calendar").on("click.daterangepicker",".prev",r.proxy(this.clickPrev,this)).on("click.daterangepicker",".next",r.proxy(this.clickNext,this)).on("click.daterangepicker","td.available",r.proxy(this.clickDate,this)).on("mouseenter.daterangepicker","td.available",r.proxy(this.hoverDate,this)).on("mouseleave.daterangepicker","td.available",r.proxy(this.updateFormInputs,this)).on("change.daterangepicker","select.yearselect",r.proxy(this.monthOrYearChanged,this)).on("change.daterangepicker","select.monthselect",r.proxy(this.monthOrYearChanged,this)).on("change.daterangepicker","select.hourselect,select.minuteselect,select.secondselect,select.ampmselect",r.proxy(this.timeChanged,this)).on("click.daterangepicker",".daterangepicker_input input",r.proxy(this.showCalendars,this)).on("change.daterangepicker",".daterangepicker_input input",r.proxy(this.formInputsChanged,this));this.container.find(".ranges").on("click.daterangepicker","button.applyBtn",r.proxy(this.clickApply,this)).on("click.daterangepicker","button.cancelBtn",r.proxy(this.clickCancel,this)).on("click.daterangepicker","li",r.proxy(this.clickRange,this)).on("mouseenter.daterangepicker","li",r.proxy(this.hoverRange,this)).on("mouseleave.daterangepicker","li",r.proxy(this.updateFormInputs,this));if(this.element.is("input"))this.element.on({"click.daterangepicker":r.proxy(this.show,this),"focus.daterangepicker":r.proxy(this.show,this),"keyup.daterangepicker":r.proxy(this.elementChanged,this),"keydown.daterangepicker":r.proxy(this.keydown,this)});else this.element.on("click.daterangepicker",r.proxy(this.toggle,this));this.element.is("input")&&!this.singleDatePicker&&this.autoUpdateInput?(this.element.val(this.startDate.format(this.locale.format)+this.locale.separator+this.endDate.format(this.locale.format)),this.element.trigger("change")):this.element.is("input")&&this.autoUpdateInput&&(this.element.val(this.startDate.format(this.locale.format)),this.element.trigger("change"))};return u.prototype={constructor:u,setStartDate:function(n){typeof n=="string"&&(this.startDate=i(n,this.locale.format));typeof n=="object"&&(this.startDate=i(n));this.timePicker||(this.startDate=this.startDate.startOf("day"));this.timePicker&&this.timePickerIncrement&&this.startDate.minute(Math.round(this.startDate.minute()/this.timePickerIncrement)*this.timePickerIncrement);this.minDate&&this.startDate.isBefore(this.minDate)&&(this.startDate=this.minDate);this.maxDate&&this.startDate.isAfter(this.maxDate)&&(this.startDate=this.maxDate);this.isShowing||this.updateElement();this.isShowing&&this.updateMonthsInView();this.element.trigger("dateChange.hhDaterangepicker",this)},setEndDate:function(n){typeof n=="string"&&(this.endDate=i(n,this.locale.format));typeof n=="object"&&(this.endDate=i(n));this.timePicker||(this.endDate=this.endDate.endOf("day"));this.timePicker&&this.timePickerIncrement&&this.endDate.minute(Math.round(this.endDate.minute()/this.timePickerIncrement)*this.timePickerIncrement);this.endDate.isBefore(this.startDate)&&(this.endDate=this.startDate.clone());this.maxDate&&this.endDate.isAfter(this.maxDate)&&(this.endDate=this.maxDate);this.dateLimit&&this.startDate.clone().add(this.dateLimit).isBefore(this.endDate)&&(this.endDate=this.startDate.clone().add(this.dateLimit));this.isShowing||this.updateElement();this.updateMonthsInView();this.element.trigger("dateChange.hhDaterangepicker",this)},isInvalidDate:function(){return!1},updateView:function(){this.element.trigger("updateView.daterangepicker",this);this.timePicker&&(this.renderTimePicker("left"),this.renderTimePicker("right"),this.endDate?this.container.find(".right .calendar-time select").removeAttr("disabled").removeClass("disabled"):this.container.find(".right .calendar-time select").attr("disabled","disabled").addClass("disabled"));this.endDate?(this.container.find('input[name="daterangepicker_end"]').removeClass("active"),this.container.find('input[name="daterangepicker_start"]').addClass("active")):(this.container.find('input[name="daterangepicker_end"]').addClass("active"),this.container.find('input[name="daterangepicker_start"]').removeClass("active"));this.updateMonthsInView();this.updateCalendars();this.updateFormInputs()},updateMonthsInView:function(){if(this.endDate){if(this.showSingleCalendar&&this.selectEndDate){this.leftCalendar.month=this.endDate.clone().date(2);return}if(!this.showSingleCalendar&&!this.singleDatePicker&&this.leftCalendar.month&&this.rightCalendar.month&&(this.startDate.format("YYYY-MM")==this.leftCalendar.month.format("YYYY-MM")||this.startDate.format("YYYY-MM")==this.rightCalendar.month.format("YYYY-MM"))&&(this.endDate.format("YYYY-MM")==this.leftCalendar.month.format("YYYY-MM")||this.endDate.format("YYYY-MM")==this.rightCalendar.month.format("YYYY-MM")))return;this.leftCalendar.month=this.startDate.clone().date(2);this.rightCalendar.month=this.linkedCalendars||this.endDate.month()==this.startDate.month()&&this.endDate.year()==this.startDate.year()?this.startDate.clone().date(2).add(1,"month"):this.endDate.clone().date(2)}else this.leftCalendar.month.format("YYYY-MM")!=this.startDate.format("YYYY-MM")&&(this.showSingleCalendar||this.rightCalendar.month.format("YYYY-MM")!=this.startDate.format("YYYY-MM"))&&(this.leftCalendar.month=this.startDate.clone().date(2),this.rightCalendar.month=this.startDate.clone().date(2).add(1,"month"))},updateCalendars:function(){var n,r,u,t,f,e,i;if(this.timePicker&&(this.endDate?(n=parseInt(this.container.find(".left .hourselect").val(),10),r=parseInt(this.container.find(".left .minuteselect").val(),10),u=this.timePickerSeconds?parseInt(this.container.find(".left .secondselect").val(),10):0,this.timePicker24Hour||(t=this.container.find(".left .ampmselect").val(),t==="PM"&&n<12&&(n+=12),t==="AM"&&n===12&&(n=0))):(n=parseInt(this.container.find(".right .hourselect").val(),10),r=parseInt(this.container.find(".right .minuteselect").val(),10),u=this.timePickerSeconds?parseInt(this.container.find(".right .secondselect").val(),10):0,this.timePicker24Hour||(t=this.container.find(".right .ampmselect").val(),t==="PM"&&n<12&&(n+=12),t==="AM"&&n===12&&(n=0))),this.leftCalendar.month.hour(n).minute(r).second(u),this.rightCalendar.month.hour(n).minute(r).second(u)),this.renderCalendar("left"),this.showSingleCalendar||this.renderCalendar("right"),this.container.find(".ranges li").removeClass("active"),this.endDate!=null){f=!0;e=0;for(i in this.ranges){if(this.timePicker){if(this.startDate.isSame(this.ranges[i][0])&&this.endDate.isSame(this.ranges[i][1])){f=!1;this.chosenLabel=this.container.find(".ranges li:eq("+e+")").addClass("active").html();break}}else if(this.startDate.format("YYYY-MM-DD")==this.ranges[i][0].format("YYYY-MM-DD")&&this.endDate.format("YYYY-MM-DD")==this.ranges[i][1].format("YYYY-MM-DD")){f=!1;this.chosenLabel=this.container.find(".ranges li:eq("+e+")").addClass("active").html();break}e++}f&&(this.chosenLabel=this.container.find(".ranges li:last").addClass("active").html(),this.showCalendars())}},renderCalendar:function(n){var t=n=="left"?this.leftCalendar:this.rightCalendar,d=t.month.month(),g=t.month.year(),vt=t.month.hour(),ft=t.month.minute(),et=t.month.second(),yt=i([g,d]).daysInMonth(),w=i([g,d,1]),pt=i([g,d,yt]),ot=i(w).subtract(1,"month").month(),st=i(w).subtract(1,"month").year(),nt=i([st,ot]).daysInMonth(),ht=w.day(),t=[],a,v,tt,h,b,l,rt,f,u,o,k,ut,s;for(t.firstDay=w,t.lastDay=pt,s=0;s<6;s++)t[s]=[];a=nt-ht+this.locale.firstDay+1;a>nt&&(a-=7);ht==this.locale.firstDay&&(a=nt-6);v=i([st,ot,a,12,ft,et]);for(var s=0,u=0,f=0;s<42;s++,u++,v=i(v).add(24,"hour"))s>0&&u%7==0&&(u=0,f++),t[f][u]=v.clone().hour(vt).minute(ft).second(et),v.hour(12),this.minDate&&t[f][u].format("YYYY-MM-DD")==this.minDate.format("YYYY-MM-DD")&&t[f][u].isBefore(this.minDate)&&n=="left"&&(t[f][u]=this.minDate.clone()),this.maxDate&&t[f][u].format("YYYY-MM-DD")==this.maxDate.format("YYYY-MM-DD")&&t[f][u].isAfter(this.maxDate)&&n=="right"&&(t[f][u]=this.maxDate.clone());n=="left"?this.leftCalendar.calendar=t:this.rightCalendar.calendar=t;var y=n=="left"?this.minDate:this.startDate,c=this.maxDate,kt=n=="left"?this.startDate:this.endDate,e='<table class="table-condensed">';if(e+="<thead>",e+="<tr>",this.showWeekNumbers&&(e+="<th><\/th>"),e+=y&&!y.isBefore(t.firstDay)||this.linkedCalendars&&n!="left"?"<th><\/th>":'<th class="prev available"><i class="fa fa-chevron-left glyphicon glyphicon-chevron-left"><\/i><\/th>',tt=this.locale.monthNames[t[1][1].month()]+t[1][1].format(" YYYY"),this.showDropdowns){var ct=t[1][1].month(),p=t[1][1].year(),lt=c&&c.year()||p+5,at=y&&y.year()||p-50,wt=p==at,bt=p==lt,it='<select class="monthselect">';for(h=0;h<12;h++)it+=(!wt||h>=y.month())&&(!bt||h<=c.month())?"<option value='"+h+"'"+(h===ct?" selected='selected'":"")+">"+this.locale.monthNames[h]+"<\/option>":"<option value='"+h+"'"+(h===ct?" selected='selected'":"")+" disabled='disabled'>"+this.locale.monthNames[h]+"<\/option>";for(it+="<\/select>",b='<select class="yearselect">',l=at;l<=lt;l++)b+='<option value="'+l+'"'+(l===p?' selected="selected"':"")+">"+l+"<\/option>";b+="<\/select>";tt=it+b}for(e+='<th colspan="5" class="month">'+tt+"<\/th>",e+=(!c||c.isAfter(t.lastDay))&&(!this.linkedCalendars||n=="right"||this.singleDatePicker||this.showSingleCalendar)?'<th class="next available"><i class="fa fa-chevron-right glyphicon glyphicon-chevron-right"><\/i><\/th>':"<th><\/th>",e+="<\/tr>",e+="<tr>",this.showWeekNumbers&&(e+='<th class="week">'+this.locale.weekLabel+"<\/th>"),r.each(this.locale.daysOfWeek,function(n,t){e+="<th>"+t+"<\/th>"}),e+="<\/tr>",e+="<\/thead>",e+="<tbody>",this.endDate==null&&this.dateLimit&&(rt=this.startDate.clone().add(this.dateLimit).endOf("day"),(!c||rt.isBefore(c))&&(c=rt)),f=0;f<6;f++){for(e+="<tr>",this.showWeekNumbers&&(e+='<td class="week">'+t[f][0].week()+"<\/td>"),u=0;u<7;u++){for(o=[],t[f][u].isSame(new Date,"day")&&o.push("today"),t[f][u].isoWeekday()>5&&o.push("weekend"),t[f][u].month()!=t[1][1].month()&&o.push("off"),this.minDate&&t[f][u].isBefore(this.minDate,"day")&&o.push("off","disabled"),c&&t[f][u].isAfter(c,"day")&&o.push("off","disabled"),this.isInvalidDate(t[f][u])&&o.push("off","disabled"),t[f][u].format("YYYY-MM-DD")==this.startDate.format("YYYY-MM-DD")&&o.push("active","start-date"),this.endDate!=null&&t[f][u].format("YYYY-MM-DD")==this.endDate.format("YYYY-MM-DD")&&o.push("active","end-date"),this.endDate!=null&&t[f][u]>this.startDate&&t[f][u]<this.endDate&&o.push("in-range"),k="",ut=!1,s=0;s<o.length;s++)k+=o[s]+" ",o[s]=="disabled"&&(ut=!0);ut||(k+="available");e+=this.showPaddedDays||t[f][u].month()==t[1][1].month()?'<td class="'+k.replace(/^\s+|\s+$/g,"")+'" data-title="r'+f+"c"+u+'">'+t[f][u].date()+"<\/td>":'<td class="blank" data-title="r'+f+"c"+u+'"><\/td>'}e+="<\/tr>"}e+="<\/tbody>";e+="<\/table>";this.container.find(".calendar."+n+" .calendar-table").html(e);r.each(this.container.find(".calendar."+n+" .calendar-table table tbody tr"),function(n,t){r(t).find(".blank").length==7&&r(t).remove()});n=="left"?this.element.trigger("renderLeftCalendar.hhDaterangepicker",this):this.element.trigger("renderRightCalendar.hhDaterangepicker",this)},renderTimePicker:function(n){var r,i,e,f=this.maxDate,h,v,y,c,o,u,t,l,a;for(this.dateLimit&&(!this.maxDate||this.startDate.clone().add(this.dateLimit).isAfter(this.maxDate))&&(f=this.startDate.clone().add(this.dateLimit)),n=="left"?(i=this.startDate.clone(),e=this.minDate):n=="right"&&(i=this.endDate?this.endDate.clone():this.startDate.clone(),e=this.startDate,h=this.container.find(".calendar.right .calendar-time div"),h.html()!=""&&(i.hour(h.find(".hourselect option:selected").val()||i.hour()),i.minute(h.find(".minuteselect option:selected").val()||i.minute()),i.second(h.find(".secondselect option:selected").val()||i.second()),i.isAfter(f)&&(i=f.clone()))),r='<select class="hourselect">',v=this.timePicker24Hour?0:1,y=this.timePicker24Hour?23:12,t=v;t<=y;t++)c=t,this.timePicker24Hour||(c=i.hour()>=12?t==12?12:t+12:t==12?0:t),o=i.clone().hour(c),u=!1,e&&o.minute(59).isBefore(e)&&(u=!0),f&&o.minute(0).isAfter(f)&&(u=!0),r+=c!=i.hour()||u?u?'<option value="'+t+'" disabled="disabled" class="disabled">'+t+"<\/option>":'<option value="'+t+'">'+t+"<\/option>":'<option value="'+t+'" selected="selected">'+t+"<\/option>";for(r+="<\/select> ",r+=': <select class="minuteselect">',t=0;t<60;t+=this.timePickerIncrement){var s=t<10?"0"+t:t,o=i.clone().minute(t),u=!1;e&&o.second(59).isBefore(e)&&(u=!0);f&&o.second(0).isAfter(f)&&(u=!0);r+=i.minute()!=t||u?u?'<option value="'+t+'" disabled="disabled" class="disabled">'+s+"<\/option>":'<option value="'+t+'">'+s+"<\/option>":'<option value="'+t+'" selected="selected">'+s+"<\/option>"}if(r+="<\/select> ",this.timePickerSeconds){for(r+=': <select class="secondselect">',t=0;t<60;t++){var s=t<10?"0"+t:t,o=i.clone().second(t),u=!1;e&&o.isBefore(e)&&(u=!0);f&&o.isAfter(f)&&(u=!0);r+=i.second()!=t||u?u?'<option value="'+t+'" disabled="disabled" class="disabled">'+s+"<\/option>":'<option value="'+t+'">'+s+"<\/option>":'<option value="'+t+'" selected="selected">'+s+"<\/option>"}r+="<\/select> "}this.timePicker24Hour||(r+='<select class="ampmselect">',l="",a="",e&&i.clone().hour(12).minute(0).second(0).isBefore(e)&&(l=' disabled="disabled" class="disabled"'),f&&i.clone().hour(0).minute(0).second(0).isAfter(f)&&(a=' disabled="disabled" class="disabled"'),r+=i.hour()>=12?'<option value="AM"'+l+'>AM<\/option><option value="PM" selected="selected"'+a+">PM<\/option>":'<option value="AM" selected="selected"'+l+'>AM<\/option><option value="PM"'+a+">PM<\/option>",r+="<\/select>");this.container.find(".calendar."+n+" .calendar-time div").html(r)},updateFormInputs:function(){this.container.find("input[name=daterangepicker_start]").is(":focus")||this.container.find("input[name=daterangepicker_end]").is(":focus")||(this.container.find("input[name=daterangepicker_start]").val(this.startDate.format(this.locale.format)),this.endDate&&this.container.find("input[name=daterangepicker_end]").val(this.endDate.format(this.locale.format)),this.singleDatePicker||this.endDate&&(this.startDate.isBefore(this.endDate)||this.startDate.isSame(this.endDate))?this.container.find("button.applyBtn").removeAttr("disabled"):this.container.find("button.applyBtn").attr("disabled","disabled"))},move:function(){var n={top:0,left:0},t,u=r(window).width(),i,f;if(this.parentEl.is("body")||(n={top:this.parentEl.offset().top-this.parentEl.scrollTop(),left:this.parentEl.offset().left-this.parentEl.scrollLeft()},u=this.parentEl[0].clientWidth+this.parentEl.offset().left),this.drops=="bottom-offset")i=r(window).height(),f=r(window).scrollTop(),t=f+i-this.container.outerHeight()-20;else{if(this.drops=="middle"){var i=r(window).height(),e=r(window).width(),o=this.container.outerHeight(!1),s=this.container.outerWidth(!1);this.container.css({top:i/2-o/2,left:e/2-s/2,right:"auto",position:"fixed"});this.container.addClass("dropoffset");return}t=this.drops=="up"?this.element.offset().top-this.container.outerHeight()-n.top:this.element.offset().top+this.element.outerHeight()-n.top}this.container[this.drops=="up"?"addClass":"removeClass"]("dropup");this.container[this.drops=="bottom-offset"||this.drops=="middle"?"addClass":"removeClass"]("dropoffset");this.container.css({position:"absolute"});this.opens=="left"?(this.container.css({top:t,right:u-this.element.offset().left-this.element.outerWidth(),left:"auto"}),this.container.offset().left<0&&this.container.css({right:"auto",left:9})):this.opens=="center"?(this.container.css({top:t,left:this.element.offset().left-n.left+this.element.outerWidth()/2-this.container.outerWidth()/2,right:"auto"}),this.container.offset().left<0&&this.container.css({right:"auto",left:9})):(this.container.css({top:t,left:this.element.offset().left-n.left,right:"auto"}),this.container.offset().left+this.container.outerWidth()>r(window).width()&&this.container.css({left:"auto",right:0}))},show:function(n){if((typeof n=="undefined"||typeof n.hhDateRangePicker=="undefined"||!n.hhDateRangePicker.cancelShow)&&!this.isShowing){this._outsideClickProxy=r.proxy(function(n){this.outsideClick(n)},this);r(document).on("mousedown.daterangepicker",this._outsideClickProxy).on("touchend.daterangepicker",this._outsideClickProxy).on("click.daterangepicker","[data-toggle=dropdown]",this._outsideClickProxy).on("focusin.daterangepicker",this._outsideClickProxy);r(window).on("resize.daterangepicker",r.proxy(function(n){this.move(n)},this));this.oldStartDate=this.startDate.clone();this.oldEndDate=this.endDate.clone();this.updateView();this.container.show();this.move();this.element.trigger("show.daterangepicker",this);this.isShowing=!0}},hide:function(){this.isShowing&&(this.endDate||(this.startDate=this.oldStartDate.clone(),this.endDate=this.oldEndDate.clone()),this.startDate.isSame(this.oldStartDate)&&this.endDate.isSame(this.oldEndDate)||this.callback(this.startDate,this.endDate,this.chosenLabel),this.updateElement(),r(document).off(".daterangepicker"),r(window).off(".daterangepicker"),this.container.hide(),this.element.trigger("hide.daterangepicker",this),this.isShowing=!1)},toggle:function(n){this.isShowing?this.hide(n):this.show(n)},outsideClick:function(n){var t=r(n.target);n.type=="focusin"||t.closest(this.element).length||t.closest(this.container).length||t.closest(".calendar-table").length||this.hide()},showCalendars:function(){this.container.addClass("show-calendar");this.move();this.element.trigger("showCalendar.daterangepicker",this)},hideCalendars:function(){this.container.removeClass("show-calendar");this.element.trigger("hideCalendar.daterangepicker",this)},hoverRange:function(n){var t,i;this.container.find("input[name=daterangepicker_start]").is(":focus")||this.container.find("input[name=daterangepicker_end]").is(":focus")||(t=n.target.innerHTML,t==this.locale.customRangeLabel?this.updateView():(i=this.ranges[t],this.container.find("input[name=daterangepicker_start]").val(i[0].format(this.locale.format)),this.container.find("input[name=daterangepicker_end]").val(i[1].format(this.locale.format))))},clickRange:function(n){var t=n.target.innerHTML,i;this.chosenLabel=t;t==this.locale.customRangeLabel?this.showCalendars():(i=this.ranges[t],this.startDate=i[0],this.endDate=i[1],this.timePicker||(this.startDate.startOf("day"),this.endDate.endOf("day")),this.hideCalendars(),this.clickApply())},clickPrev:function(n){var t=r(n.target).parents(".calendar");t.hasClass("left")?(this.leftCalendar.month.subtract(1,"month"),this.linkedCalendars&&this.rightCalendar.month.subtract(1,"month")):this.rightCalendar.month.subtract(1,"month");this.updateCalendars()},clickNext:function(n){var t=r(n.target).parents(".calendar");t.hasClass("left")?this.leftCalendar.month.add(1,"month"):(this.rightCalendar.month.add(1,"month"),this.linkedCalendars&&this.leftCalendar.month.add(1,"month"));this.updateCalendars()},hoverDate:function(n){if(!this.container.find("input[name=daterangepicker_start]").is(":focus")&&!this.container.find("input[name=daterangepicker_end]").is(":focus")&&r(n.target).hasClass("available")){var i=r(n.target).attr("data-title"),u=i.substr(1,1),f=i.substr(3,1),s=r(n.target).parents(".calendar"),t=s.hasClass("left")?this.leftCalendar.calendar[u][f]:this.rightCalendar.calendar[u][f];this.endDate&&!this.selectEndDate?this.container.find("input[name=daterangepicker_start]").val(t.format(this.locale.format)):this.container.find("input[name=daterangepicker_end]").val(t.format(this.locale.format));var e=this.leftCalendar,o=this.rightCalendar,h=this.startDate,c=this.endDate;!this.endDate||this.selectEndDate?(this.container.find(".calendar td.end-date").removeClass("end-date"),this.container.find(".calendar td").each(function(n,i){if(!r(i).hasClass("week")){var u=r(i).attr("data-title"),f=u.substr(1,1),s=u.substr(3,1),l=r(i).parents(".calendar"),c=l.hasClass("left")?e.calendar[f][s]:o.calendar[f][s];c.isAfter(h)&&c.isBefore(t)?r(i).addClass("in-range"):r(i).removeClass("in-range")}})):this.endDate&&!this.singleDatePicker?(this.container.find(".calendar td.start-date").removeClass("start-date"),this.container.find(".calendar td").each(function(n,i){if(!r(i).hasClass("week")){var u=r(i).attr("data-title"),f=u.substr(1,1),s=u.substr(3,1),l=r(i).parents(".calendar"),h=l.hasClass("left")?e.calendar[f][s]:o.calendar[f][s];h.isBefore(c)&&h.isAfter(t)?r(i).addClass("in-range"):r(i).removeClass("in-range")}})):this.container.find(".calendar td.start-date").removeClass("start-date")}},clickDate:function(n){var t,u,f,e;if(r(n.target).hasClass("available")){var o=r(n.target).attr("data-title"),s=o.substr(1,1),h=o.substr(3,1),c=r(n.target).parents(".calendar"),i=c.hasClass("left")?this.leftCalendar.calendar[s][h]:this.rightCalendar.calendar[s][h];this.endDate&&!this.selectEndDate||i.isBefore(this.startDate)?(this.timePicker&&(t=parseInt(this.container.find(".left .hourselect").val(),10),this.timePicker24Hour||(u=c.find(".ampmselect").val(),u==="PM"&&t<12&&(t+=12),u==="AM"&&t===12&&(t=0)),f=parseInt(this.container.find(".left .minuteselect").val(),10),e=this.timePickerSeconds?parseInt(this.container.find(".left .secondselect").val(),10):0,i=i.clone().hour(t).minute(f).second(e)),this.endDate=null,this.setStartDate(i.clone())):(this.timePicker&&(t=parseInt(this.container.find(".right .hourselect").val(),10),this.timePicker24Hour||(u=this.container.find(".right .ampmselect").val(),u==="PM"&&t<12&&(t+=12),u==="AM"&&t===12&&(t=0)),f=parseInt(this.container.find(".right .minuteselect").val(),10),e=this.timePickerSeconds?parseInt(this.container.find(".right .secondselect").val(),10):0,i=i.clone().hour(t).minute(f).second(e)),this.setEndDate(i.clone()),this.autoApply&&this.clickApply());this.singleDatePicker&&(this.setEndDate(this.startDate),this.timePicker||this.clickApply());this.updateView()}},clickApply:function(){this.hide();this.element.trigger("apply.daterangepicker",this)},clickCancel:function(){this.startDate=this.oldStartDate;this.endDate=this.oldEndDate;this.hide();this.element.trigger("cancel.daterangepicker",this)},monthOrYearChanged:function(n){var u=r(n.target).closest(".calendar").hasClass("left"),e=u?"left":"right",f=this.container.find(".calendar."+e),i=parseInt(f.find(".monthselect").val(),10),t=f.find(".yearselect").val();u||(t<this.startDate.year()||t==this.startDate.year()&&i<this.startDate.month())&&(i=this.startDate.month(),t=this.startDate.year());this.minDate&&(t<this.minDate.year()||t==this.minDate.year()&&i<this.minDate.month())&&(i=this.minDate.month(),t=this.minDate.year());this.maxDate&&(t>this.maxDate.year()||t==this.maxDate.year()&&i>this.maxDate.month())&&(i=this.maxDate.month(),t=this.maxDate.year());u?(this.leftCalendar.month.month(i).year(t),this.linkedCalendars&&(this.rightCalendar.month=this.leftCalendar.month.clone().add(1,"month"))):(this.rightCalendar.month.month(i).year(t),this.linkedCalendars&&(this.leftCalendar.month=this.rightCalendar.month.clone().subtract(1,"month")));this.updateCalendars()},timeChanged:function(n){var u=r(n.target).closest(".calendar"),h=u.hasClass("left"),i=parseInt(u.find(".hourselect").val(),10),o=parseInt(u.find(".minuteselect").val(),10),s=this.timePickerSeconds?parseInt(u.find(".secondselect").val(),10):0,e,t,f;this.timePicker24Hour||(e=u.find(".ampmselect").val(),e==="PM"&&i<12&&(i+=12),e==="AM"&&i===12&&(i=0));h?(t=this.startDate.clone(),t.hour(i),t.minute(o),t.second(s),this.setStartDate(t),this.singleDatePicker?this.endDate=this.startDate.clone():this.endDate&&this.endDate.format("YYYY-MM-DD")==t.format("YYYY-MM-DD")&&this.endDate.isBefore(t)&&this.setEndDate(t.clone())):this.endDate&&(f=this.endDate.clone(),f.hour(i),f.minute(o),f.second(s),this.setEndDate(f));this.updateCalendars();this.updateFormInputs();this.renderTimePicker("left");this.renderTimePicker("right")},formInputsChanged:function(n){var f=r(n.target).closest(".calendar").hasClass("right"),t=i(this.container.find('input[name="daterangepicker_start"]').val(),this.locale.format),u=i(this.container.find('input[name="daterangepicker_end"]').val(),this.locale.format);t.isValid()&&u.isValid()&&(f&&u.isBefore(t)&&(t=u.clone()),this.setStartDate(t),this.setEndDate(u),f?this.container.find('input[name="daterangepicker_start"]').val(this.startDate.format(this.locale.format)):this.container.find('input[name="daterangepicker_end"]').val(this.endDate.format(this.locale.format)));this.updateCalendars();this.timePicker&&(this.renderTimePicker("left"),this.renderTimePicker("right"))},elementChanged:function(){if(this.element.is("input")&&this.element.val().length&&!(this.element.val().length<this.locale.format.length)){var r=this.element.val().split(this.locale.separator),n=null,t=null;(r.length===2&&(n=i(r[0],this.locale.format),t=i(r[1],this.locale.format)),(this.singleDatePicker||n===null||t===null)&&(n=i(this.element.val(),this.locale.format),t=n),n.isValid()&&t.isValid())&&(this.setStartDate(n),this.setEndDate(t),this.updateView())}},keydown:function(n){(n.keyCode===9||n.keyCode===13)&&this.hide()},updateElement:function(){this.element.is("input")&&!this.singleDatePicker&&this.autoUpdateInput?(this.element.val(this.startDate.format(this.locale.format)+this.locale.separator+this.endDate.format(this.locale.format)),this.element.trigger("change")):this.element.is("input")&&this.autoUpdateInput&&(this.element.val(this.startDate.format(this.locale.format)),this.element.trigger("change"))},remove:function(){this.container.remove();this.element.off(".daterangepicker");this.element.removeData()}},r.fn.daterangepicker=function(n,t){return this.each(function(){var i=r(this);i.data("daterangepicker")&&i.data("daterangepicker").remove();i.data("daterangepicker",new u(i,n,t))}),this},u});var datePickerCustomBehaviours={setSelectedDates:function(n,t){$("input[name$=availablefrom]").val(n?n.format("YYYY-MM-DD"):"");$("input[name$=availableto]").val(t?t.format("YYYY-MM-DD"):"");var i='<span class="selectedDate-day">DD<\/span><div class="selectedDate-dateEnd"><p class="selectedDate-month">MMM<\/p><p class="selectedDate-year">YYYY<\/p><\/div>';n||t?(n?$(".js-checkinDate").html(i.replace("DD",n.format("DD")).replace("MMM",n.format("MMM")).replace("YYYY",n.format("YYYY"))):$(".js-checkinDate").html(""),$(".js-DatesTo").html("TO"),t?$(".js-checkoutDate").html(i.replace("DD",t.format("DD")).replace("MMM",t.format("MMM")).replace("YYYY",t.format("YYYY"))):$(".js-checkoutDate").html(""),$(".js-checkoutDate").show()):($(".js-checkinDate").html('<span class="placeholder">When are you going?<\/span>'),$(".js-checkoutDate").html("").hide(),$(".js-DatesTo").html(""))},setSelectedDatesAdvanced:function(n,t,i,r){$("input[name$=availablefrom]").val(n?n.format("YYYY-MM-DD"):"");$("input[name$=availableto]").val(t?t.format("YYYY-MM-DD"):"");var u='<span class="selectedDate-day">DD<\/span><div class="selectedDate-dateEnd"><p class="selectedDate-month">MMM<\/p><p class="selectedDate-year">YYYY<\/p><\/div>';n?$(".js-checkinDate").html(u.replace("DD",n.format("DD")).replace("MMM",n.format("MMM")).replace("YYYY",n.format("YYYY"))):$(".js-checkinDate").html('<span class="placeholder">'+i+"<\/span>");t?$(".js-checkoutDate").html(u.replace("DD",t.format("DD")).replace("MMM",t.format("MMM")).replace("YYYY",t.format("YYYY"))):$(".js-checkoutDate").html('<span class="placeholder">'+r+"<\/span>")},setSelectedSimpleDates:function(n,t,i,r){$("input[name$=datefrom]").val(n?n.format("YYYY-MM-DD"):"");$("input[name$=dateto]").val(t?t.format("YYYY-MM-DD"):"");$("#datefrom").val(n?n.format("YYYY-MM-DD"):"");$("#dateto").val(t?t.format("YYYY-MM-DD"):"");var u='<span class="selectedDate-day">DD<\/span><div class="selectedDate-dateEnd"><p class="selectedDate-month">MMM<\/p><p class="selectedDate-year">YYYY<\/p><\/div>';n?$(".js-startDate").html(u.replace("DD",n.format("DD")).replace("MMM",n.format("MMM")).replace("YYYY",n.format("YYYY"))):$(".js-startDate").html('<span class="placeholder">'+i+"<\/span>");t?$(".js-endDate").html(u.replace("DD",t.format("DD")).replace("MMM",t.format("MMM")).replace("YYYY",t.format("YYYY"))):$(".js-endDate").html('<span class="placeholder">'+r+"<\/span>")}};(function(){var t=$.fn.daterangepicker,n=function(n,i,r){var u=this,f={singleDatePicker:!1,showSingleCalendar:!0,showPaddedDays:!1,allowSelectSameDate:!1,showClear:!0,autoApply:!0,minDate:moment(),maxDate:moment().add(2,"year"),locale:{format:"YYYY-MM-DD",monthNames:$.map(moment.months(),function(n){return n.toUpperCase()}),daysOfWeek:["S","M","T","W","T","F","S"]},startTitle:"Check-in",endTitle:"Check-out"};i=$.extend(!0,f,i);u.originalOptions=i;i.availabilityDates&&(u.availabilityDates=!0,u.bookedDates={});u.callback=typeof r=="function"?r:function(){};u.triggerElement=$(n);n.__proto__.resetAll=function(){this.trigger("reset.hhDaterangepicker")};u.isShowing=!1;u.settingCheckout=!1;u.dateSet=!1;u.currentStartDate=null;u.currentEndDate=null;u.allowSelectSameDate=f.allowSelectSameDate;u.triggerElement.click(function(n){var o;if(!u.daterangepicker.singleDatePicker){var t=$(n.target).hasClass("js-checkinDate")||$(n.target).parents(".js-checkinDate").length>0,r=$(n.target).hasClass("js-checkoutDate")||$(n.target).parents(".js-checkoutDate").length>0,f=$(n.target).hasClass("js-startDate")||$(n.target).parents(".js-startDate").length>0,e=$(n.target).hasClass("js-endDate")||$(n.target).parents(".js-endDate").length>0;u.settingCheckout=u.currentStartDate&&!t&&!f&&(!u.currentEndDate||r||e)?!0:!1;u.triggerElement.find(".js-checkinDate").length>0&&u.triggerElement.find(".js-checkoutDate").length>0&&u.currentStartDate&&u.currentEndDate&&!t&&!r&&(n.hhDateRangePicker=n.hhDateRangePicker||{},n.hhDateRangePicker.cancelShow=!0);u.triggerElement.find(".js-startDate").length>0&&u.triggerElement.find(".js-endDate").length>0&&u.currentStartDate&&u.currentEndDate&&!f&&!e&&(n.hhDateRangePicker=n.hhDateRangePicker||{},n.hhDateRangePicker.cancelShow=!0);u.settingCheckout?(o=u.allowSelectSameDate?u.currentStartDate.clone():u.currentStartDate.clone().add(1,"d"),u.daterangepicker.startDate=u.currentStartDate,u.daterangepicker.selectEndDate=!0,u.setMinDate(o)):(u.daterangepicker.selectEndDate=!1,u.setMinDate(i.minDate));u.switchSide(u.settingCheckout?"left":"right")}});t.call(u.triggerElement,i,function(){});u.daterangepicker=u.triggerElement.data("daterangepicker");i.startDate&&(u.currentStartDate=u.daterangepicker.startDate);i.endDate&&(u.currentEndDate=u.daterangepicker.endDate);this.triggerElement.on("reset.hhDaterangepicker",function(){u.resetPlaceholders()});this.triggerElement.on("show.daterangepicker",function(){u.isShowing=!0;u.settingCheckout?(u.triggerElement.find(".js-checkinDate").removeClass("daterangepicker-active"),u.triggerElement.find(".js-checkoutDate").addClass("daterangepicker-active"),u.triggerElement.find(".js-startDate").removeClass("daterangepicker-active"),u.triggerElement.find(".js-endDate").addClass("daterangepicker-active"),u.daterangepicker.selectEndDate=!0):(u.triggerElement.find(".js-checkoutDate").removeClass("daterangepicker-active"),u.triggerElement.find(".js-checkinDate").addClass("daterangepicker-active"),u.triggerElement.find(".js-endDate").removeClass("daterangepicker-active"),u.triggerElement.find(".js-startDate").addClass("daterangepicker-active"),u.daterangepicker.selectEndDate=!1);i.showClear&&$(u.daterangepicker.container).find(".clear").length==0&&($(u.daterangepicker.container).append('<div class="clear"><p>Clear dates<\/p><\/div>'),$(u.daterangepicker.container).find(".clear").click(function(){u.reset()}));$(window).on("resize",hhLib.Debounce(function(){u.isShowing&&(u.triggerElement.is(":visible")?u.calculateDropDirection():u.daterangepicker.hide())},250));$(window).on("scroll",hhLib.Debounce(function(){u.isShowing&&(u.triggerElement.is(":visible")?u.calculateDropDirection():u.daterangepicker.hide())},250));u.dateSet&&(u.daterangepicker.startDate=u.currentStartDate,u.daterangepicker.endDate=u.currentEndDate,u.settingCheckout||u.currentEndDate||(u.daterangepicker.endDate=moment().endOf("day")),u.daterangepicker.updateMonthsInView(),u.reRender());u.setTitle(u.settingCheckout?i.endTitle:i.startTitle);u.calculateDropDirection()});u.triggerElement.on("dateChange.hhDaterangepicker",function(n,t){var f=u.currentStartDate,r=u.currentEndDate;u.currentStartDate=t.startDate&&t.startDate._isAMomentObject&&t.startDate.isValid()?t.startDate:null;u.currentEndDate=t.endDate&&t.endDate._isAMomentObject&&t.endDate.isValid()?t.endDate:null;u.dateSet=!0;u.settingCheckout=t.startDate&&!t.endDate?!0:!1;u.settingCheckout&&r&&!u.currentEndDate&&r.clone().startOf("day").isAfter(u.currentStartDate)&&(u.setEndDate(r),u.daterangepicker.hide());i.singleDatePicker||(u.allowSelectSameDate?u.setMinDate(u.currentStartDate.clone()):u.settingCheckout&&u.setMinDate(u.currentStartDate.clone().add(1,"d")),u.switchSide(u.settingCheckout?"left":"right"),u.setTitle(u.settingCheckout?i.endTitle:i.startTitle));(u.currentStartDate!=f||u.currentEndDate!=r)&&u.callback(u.currentStartDate,u.currentEndDate)});this.triggerElement.on("hide.daterangepicker",function(){u.isShowing=!1;u.showMask(!1);u.showTitle(!1);u.triggerElement.find(".js-checkinDate").removeClass("daterangepicker-active");u.triggerElement.find(".js-checkoutDate").removeClass("daterangepicker-active");u.triggerElement.find(".js-startDate").removeClass("daterangepicker-active");u.triggerElement.find(".js-endDate").removeClass("daterangepicker-active")});u.triggerElement.click(function(n){var t=$(n.target).hasClass("js-checkinDate")||$(n.target).parents(".js-checkinDate").length>0,i=$(n.target).hasClass("js-checkoutDate")||$(n.target).parents(".js-checkoutDate").length>0,r=$(n.target).hasClass("js-startDate")||$(n.target).parents(".js-startDate").length>0,f=$(n.target).hasClass("js-endDate")||$(n.target).parents(".js-endDate").length>0;!u.isShowing&&(t||i)&&$(n.target).click();!u.isShowing&&(r||f)&&$(n.target).click()});u.triggerElement.on("renderLeftCalendar.hhDaterangepicker",function(){u.dateSet||u.daterangepicker.container.find(".start-date.end-date.active").removeClass("start-date").removeClass("end-date").removeClass("active").removeClass("in-range")});if(u.availabilityDates){u.triggerElement.on("renderLeftCalendar.hhDaterangepicker",function(){$(u.daterangepicker.container).prepend('<div class="daterangepicker-loading"><div class="loading-spinner"><\/div><\/div>');u.getBookedDates($("#HouseID").val(),u.daterangepicker.leftCalendar.month,$.proxy(u.BlockedDates,u))});u.triggerElement.on("hide.daterangepicker",$.proxy(this.CheckAvailabilty,this));u.currentStartDate&&u.currentEndDate&&u.CheckAvailabilty()}};return n.prototype={constructor:n,BlockedDates:function(n,t){var s=this,i,r,u;if(this.daterangepicker.leftCalendar.month.year()==n.year()&&this.daterangepicker.leftCalendar.month.month()==n.month()){var f=$(this.daterangepicker.container),o=0,e=0;for(function(){for(var t,n=0;n<6;n++){for(t=0;t<7;t++){if(f.find('div.left *[data-title="r'+n+"c"+t+'"]').text()==1)return;e++}e=0;o++}}(),i=1,r=o;r<6;r++){for(u=e;u<7;u++)i<t.length-1&&(t[i]&&!t[i-1]?f.find('div.left *[data-title="r'+r+"c"+u+'"]').addClass("checkout-allowed"):!t[i]&&t[i-1]?f.find('div.left *[data-title="r'+r+"c"+u+'"]').addClass("checkin-allowed"):t[i]&&f.find('div.left *[data-title="r'+r+"c"+u+'"]').addClass("blocked")),i++;e=0}$(this.daterangepicker.container).find(".daterangepicker-loading").remove()}},CheckAvailabilty:function(){for(var n=this,o=function(t,i){for(var r,f,e=t.clone().startOf("month"),s=i.clone().startOf("month"),h=Math.abs(s.diff(e,"months"))+1,o=!1,u=0;u<h;u++)if(r=e.clone().add(u,"month"),f=r.year()+"-"+r.month(),$.each(n.bookedDates[f],function(u,e){var h,c,s;if(u>0&&u<n.bookedDates[f].length&&(h=u,c=e,c&&(s=r.clone().date(h).add(12,"hour"),s.isAfter(t)&&s.isBefore(i))))return o=!0,!1}),o)return!0;return!1},i=this.daterangepicker.startDate.clone().startOf("day"),r=this.daterangepicker.endDate.clone().subtract(1,"day").endOf("day"),u=i.clone().startOf("month"),s=r.clone().startOf("month"),f=Math.abs(s.diff(u,"months"))+1,e=0,t=0;t<f;t++)n.getBookedDates($("#HouseID").val(),u.clone().add(t,"month"),function(){e++;e==f&&(o(i,r)?($(".js-bookingForm-bookedDatesValidation").show(),$(".js-checkinDate, .js-checkoutDate").addClass("validation-date--fail"),$(".js-startDate, .js-endDate").addClass("validation-date--fail")):($(".js-bookingForm-bookedDatesValidation").hide(),$(".js-checkinDate, .js-checkoutDate").removeClass("validation-date--fail"),$(".js-startDate, .js-endDate").removeClass("validation-date--fail")))})},getBookedDates:function(n,t,i){var r=this,u=t.year()+"-"+t.month();typeof r.bookedDates[u]!="undefined"?i(t,r.bookedDates[u]):$.ajax({url:"/api/HouseAvailability/"+n+"/"+t.year()+"/"+(t.month()+1)+"/true",type:"GET",contentType:"application/json;charset=utf-8",success:function(n){r.bookedDates[u]=n;i(t,n)}})},calculateDropDirection:function(){var n=$(window).scrollTop(),t=$(this.daterangepicker.container).outerHeight(!1),i=this.triggerElement.offset().top,r=i+this.triggerElement.outerHeight(!1),u=$(window).height(),e=n+u,o=i-n,s=r-n,h=Math.abs(parseInt(this.daterangepicker.container.css("marginTop").replace("px",""))),f;t=t+Math.abs(h);r<n||i>e?this.daterangepicker.hide():(f=$(window).width(),f<540?(this.showTitle(!0),this.setDropDirection("middle"),this.isShowing&&this.showMask(!0)):u-s>t?(this.showTitle(!1),this.setDropDirection("down"),this.showMask(!1)):o>t?(this.showTitle(!1),this.setDropDirection("up"),this.showMask(!1)):(this.showTitle(!0),this.setDropDirection("middle"),this.isShowing&&this.showMask(!0)))},reset:function(){this.dateSet&&(this.currentStartDate=null,this.currentEndDate=null,this.setMinDate(this.originalOptions.minDate),this.daterangepicker.startDate=moment().startOf("day"),this.daterangepicker.endDate=moment().endOf("day"),this.daterangepicker.oldStartDate=this.daterangepicker.startDate.clone(),this.daterangepicker.oldEndDate=this.daterangepicker.endDate.clone(),this.daterangepicker.selectEndDate=!1,this.dateSet=!1,this.settingCheckout=!1,this.isShowing&&this.reRender(),this.triggerElement.trigger("reset.hhDaterangepicker"),this.callback(this.currentStartDate,this.currentEndDate))},resetPlaceholders:function(){this.dateSet&&(this.currentStartDate=null,this.currentEndDate=null,this.setMinDate(this.originalOptions.minDate),this.daterangepicker.oldStartDate=this.daterangepicker.startDate.clone(),this.daterangepicker.oldEndDate=this.daterangepicker.endDate.clone(),this.daterangepicker.selectEndDate=!1,this.dateSet=!1,this.settingCheckout=!1,this.isShowing&&this.reRender(),this.triggerElement.trigger("reset.hhDaterangepicker"),this.callback(this.currentStartDate,this.currentEndDate))},remove:function(){this.daterangepicker.remove()},switchSide:function(n){n&&(n=="left"||n=="right")||(n=this.daterangepicker.opens=="left"?"right":"left");n=="right"?(this.daterangepicker.opens="right",this.daterangepicker.container.removeClass("opensleft").removeClass("setting-checkout").addClass("opensright").addClass("setting-checkin"),this.daterangepicker.move()):(this.daterangepicker.opens="left",this.daterangepicker.container.removeClass("opensright").removeClass("setting-checkin").addClass("opensleft").addClass("setting-checkout"),this.daterangepicker.move());this.isShowing&&(this.settingCheckout?(this.triggerElement.find(".js-checkinDate").removeClass("daterangepicker-active"),this.triggerElement.find(".js-checkoutDate").addClass("daterangepicker-active"),this.triggerElement.find(".js-startDate").removeClass("daterangepicker-active"),this.triggerElement.find(".js-endDate").addClass("daterangepicker-active")):(this.triggerElement.find(".js-checkoutDate").removeClass("daterangepicker-active"),this.triggerElement.find(".js-checkinDate").addClass("daterangepicker-active"),this.triggerElement.find(".js-endDate").removeClass("daterangepicker-active"),this.triggerElement.find(".js-startDate").addClass("daterangepicker-active")))},setDropDirection:function(n){(n=="up"||n=="down"||n=="bottom-offset"||n=="middle")&&(this.daterangepicker.drops=n,this.daterangepicker.move())},setStartDate:function(n){n=moment(n);n._isAMomentObject&&n.isValid()&&this.currentStartDate!=n&&(this.currentStartDate=n,this.daterangepicker.startDate=n,this.dateSet=!0)},setEndDate:function(n){n=moment(n);n._isAMomentObject&&n.isValid()&&this.currentEndDate!=n&&(this.currentEndDate=n,this.daterangepicker.endDate=n,this.dateSet=!0)},setMinDate:function(n){this.daterangepicker.minDate=n},setMaxDate:function(n){this.daterangepicker.maxDate=n},reRender:function(){this.switchSide(this.settingCheckout?"left":"right");this.daterangepicker.updateCalendars();this.dateSet||(this.setTitle(this.settingCheckout?this.options.originalOptions.endTitle:this.originalOptions.startTitle),this.daterangepicker.container.find(".start-date.end-date.active").removeClass("start-date").removeClass("end-date").removeClass("active").removeClass("in-range"))},showMask:function(n){var t;n?(t=$("body").children(".daterangepicker-modal-mask"),t.length==0&&(t=$('<div class="daterangepicker-modal-mask">'),$("body").prepend(t)),t.hasClass("active")||(t.addClass("active"),t.show().css("opacity",.5))):(t=$("body").children(".daterangepicker-modal-mask.active"),t&&t.hasClass("active")&&(t.removeClass("active"),t.animate({opacity:0},200,function(){$(this).hide()})))},setTitle:function(n){var t=$(this.daterangepicker.container).find(".title");t.length==0&&(t=$('<p class="title" style="display:none">'),$(this.daterangepicker.container).prepend(t));t.text(n)},showTitle:function(n){var t=$(this.daterangepicker.container).find(".title");n&&t.text()!=""?t.show():t.hide()}},$.fn.daterangepicker=function(t,i){return this.each(function(){var r=$(this);r.data("daterangepicker")&&r.data("daterangepicker").remove();r.data("daterangepicker",new n(r,t,i))}),this},n})();$(document).ready(function(){var n;hhLib.AdvancedSearch={Hide:function(n){n.stopPropagation();n.preventDefault();$(".AdvancedSearchContainer").toggle("slide",{direction:"right"},function(){$(".js-priceSlider").rangeSlider("destroy")})},ResetForm:function(t){t.preventDefault();n&&n.data("daterangepicker").reset();$(".AdvancedSearchContainer input[id$=availablefrom]").val("Any");$(".AdvancedSearchContainer input[id$=availableto]").val("Any");$(".AdvancedSearchContainer .js-checkinDate").html("Check-in");$(".AdvancedSearchContainer .js-checkoutDate").html("Check-out");$(".AdvancedSearchContainer .js-LocationSearch").val("");$(".AdvancedSearchContainer .js-propertyTypeDropdown").select2("val","Any");$(".AdvancedSearchContainer .js-minBedsDropdown").select2("val","");$(".AdvancedSearchContainer .js-minGuestsDropdown").select2("val","");$(".AdvancedSearchContainer .js-priceSlider").rangeSlider("values",100,600);$(".AdvancedSearchContainer .nightlyRate-Amount").html("Any");$(".AdvancedSearchContainer .ui-rangeSlider-label-value").html("Any");$(".AdvancedSearchContainer input[id$=MinPrice]").val("Any");$(".AdvancedSearchContainer input[id$=MaxPrice]").val("Any");$('.AdvancedSearchContainer input[type="checkbox"]').removeAttr("checked");$(".AdvancedSearchContainer .js-keywords").val("")},AutoPopulateSearchData:function(){var n=$(".AdvancedSearchContainer input[id$=availablefrom]").val(),t=$(".AdvancedSearchContainer input[id$=availableto]").val(),i,r;n&&n!=="Any"&&(i=moment(n,"YYYY-MM-DD"),$(".AdvancedSearchContainer .js-checkinDate").html(i.format("DD MMM YYYY")));t&&t!=="Any"&&(r=moment(t,"YYYY-MM-DD"),$(".AdvancedSearchContainer .js-checkoutDate").html(r.format("DD MMM YYYY")))},Init:function(){typeof hhLib.CurrentSearch=="undefined"&&(hhLib.CurrentSearch={region:0,location:0});hhLib.AdvancedSearch.AutoPopulateSearchData();$(".js-search-resetBtn").click(hhLib.AdvancedSearch.ResetForm)},Attach:function(){$("A.RefineSearchLink, .MenuRefineSearchLink").length>=1&&jQuery.get("/AJAX/ajax_AdvancedSearch.aspx",function(t){$("#AdvancedSearchControl").html(t);$(".AdvancedSearchContainer").click(function(n){n.stopPropagation()});$(".AdvancedSearchContainer .Close").on("click",hhLib.AdvancedSearch.Hide);hhLib.AdvancedSearch.Init();$("A.RefineSearchLink, .MenuRefineSearchLink").unbind("click");$(".js-Button-refineSearch").click(function(n){n.preventDefault();$(".Options-menu").toggle(150);$(".AdvancedSearchContainer").is(":visible")||$(".MenuRefineSearchLink").click()});$("#AdvancedSearchControl .js-dropdown").select2({minimumResultsForSearch:-1});$(".touch .select2-search, .touch .select2-focusser").remove();var i=$("input[id$=availablefrom]").val()==="Any"?undefined:$("input[id$=availablefrom]").val(),r=$("input[id$=availableto]").val()==="Any"?undefined:$("input[id$=availableto]").val();n=$(".AdvancedSearchContainer #Dates").daterangepicker({startDate:i,endDate:r},function(n,t){datePickerCustomBehaviours.setSelectedDatesAdvanced(n,t,"Check-in","Check-out")})}).done(function(){$("A.RefineSearchLink, .MenuRefineSearchLink").click(function(n){n.preventDefault();$(".AdvancedSearchContainer").toggle("slide",{direction:"right"});showPriceSlider();attachAutocomplete()});setMouseHandledFlagForMenuWidget()})}};$(".AdvancedSearchContainer").length==0&&hhLib.AdvancedSearch.Attach();showPriceSlider();hhLib.AdvancedSearch.AutoPopulateSearchData()})