this.primereact=this.primereact||{},this.primereact.slider=function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=r(t);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(t=n+Math.floor(t/this.props.step-n/this.props.step)*this.props.step)}else t=Math.floor(t);return this.updateValue(e,t)}},{key:"updateValue",value:function(e,t){var n,r=parseFloat(t.toFixed(10)),i=r;return this.props.range?(0===this.handleIndex?rthis.value[1]&&(r=this.value[1]):r>this.props.max?r=this.props.max:rthis.props.max&&(r=this.props.max),i=r,this.props.onChange&&this.props.onChange({originalEvent:e,value:i})),i}},{key:"componentWillUnmount",value:function(){this.unbindDragListeners(),this.unbindTouchListeners()}},{key:"renderHandle",value:function(e,t,r){var s=this,o=n.classNames("p-slider-handle",{"p-slider-handle-start":0===r,"p-slider-handle-end":1===r,"p-slider-handle-active":this.handleIndex===r});return i.default.createElement("span",{onMouseDown:function(e){return s.onMouseDown(e,r)},onTouchStart:function(e){return s.onTouchStart(e,r)},onKeyDown:function(e){return s.onKeyDown(e,r)},tabIndex:this.props.tabIndex,className:o,style:{transition:this.dragging?"none":null,left:null!==e&&e+"%",bottom:t&&t+"%"},role:"slider","aria-valuemin":this.props.min,"aria-valuemax":this.props.max,"aria-valuenow":e||t,"aria-labelledby":this.props.ariaLabelledBy})}},{key:"renderRangeSlider",value:function(){var e=this.value,t="horizontal"===this.props.orientation,n=100*(e[0]this.props.max?100:e[1]-this.props.min)/(this.props.max-this.props.min),s=t?this.renderHandle(n,null,0):this.renderHandle(null,n,0),o=t?this.renderHandle(r,null,1):this.renderHandle(null,r,1);return i.default.createElement(i.default.Fragment,null,i.default.createElement("span",{className:"p-slider-range",style:t?{left:n+"%",width:r-n+"%"}:{bottom:n+"%",height:r-n+"%"}}),s,o)}},{key:"renderSingleSlider",value:function(){var e,t=this.value;e=tthis.props.max?100:100*(t-this.props.min)/(this.props.max-this.props.min);var n="horizontal"===this.props.orientation?{width:e+"%"}:{height:e+"%"},r="horizontal"===this.props.orientation?this.renderHandle(e,null,null):this.renderHandle(null,e,null);return i.default.createElement(i.default.Fragment,null,i.default.createElement("span",{className:"p-slider-range",style:n}),r)}},{key:"render",value:function(){var e=this,t=n.classNames("p-slider p-component",this.props.className,{"p-disabled":this.props.disabled,"p-slider-horizontal":"horizontal"===this.props.orientation,"p-slider-vertical":"vertical"===this.props.orientation}),r=this.props.range?this.renderRangeSlider():this.renderSingleSlider();return i.default.createElement("div",{id:this.props.id,ref:function(t){return e.el=t},style:this.props.style,className:t,onClick:this.onBarClick},r)}}])&&p(s.prototype,c),m&&p(s,m),Object.defineProperty(s,"prototype",{writable:!1}),L}(t.Component);return E={id:null,value:null,min:0,max:100,orientation:"horizontal",step:null,range:!1,style:null,className:null,disabled:!1,tabIndex:0,ariaLabelledBy:null,onChange:null,onSlideEnd:null},(L="defaultProps")in(b=w)?Object.defineProperty(b,L,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[L]=E,e.Slider=w,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.utils);