(window["webpackJsonpstreamlit-browser"]=window["webpackJsonpstreamlit-browser"]||[]).push([[42],{2216:function(e,t,r){"use strict";r.r(t);var n=r(35),a=r(5),i=r(10),l=r(13),s=r(11),c=r(114),o=r(12),u=r(0),d=r.n(u),p=r(2173),m=r(1140),f=r(139),b=r(45);function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(r,!0).forEach(function(t){Object(n.a)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var h=function(e){function t(e){var r;return Object(a.a)(this,t),(r=Object(l.a)(this,Object(s.a)(t).call(this,e))).state=void 0,r.sliderRef=d.a.createRef(),r.setWidgetValue=void 0,r.componentDidMount=function(){if(r.sliderRef.current){r.sliderRef.current.querySelectorAll('[role="slider"]').forEach(function(e){return e.addEventListener("click",r.handleClick)})}r.setWidgetValue({fromUi:!1})},r.componentWillUnmount=function(){if(r.sliderRef.current){r.sliderRef.current.querySelectorAll('[role="slider"]').forEach(function(e){return e.removeEventListener("click",r.handleClick)})}},r.setWidgetValueRaw=function(e){var t=r.props.element.get("id");r.props.widgetMgr.setFloatArrayValue(t,r.state.value,e)},r.handleChange=function(e){var t=e.value;r.setState({value:t},function(){return r.setWidgetValue({fromUi:!0})})},r.handleClick=function(e){e.target.focus()},r.renderThumbValue=function(e){var t=r.props.element.get("format"),n=f.i.ThumbValue.style({$disabled:r.props.disabled});return d.a.createElement("div",{style:n},Object(m.sprintf)(t,e.$value[e.$thumbIndex]))},r.renderTickBar=function(){var e=r.props.element.get("format"),t=r.props.element.get("max"),n=r.props.element.get("min"),a=f.i.TickBarItem.style;return d.a.createElement("div",{className:"sliderTickBar",style:f.i.TickBar.style},d.a.createElement("div",{className:"tickBarMin",style:a},Object(m.sprintf)(e,n)),d.a.createElement("div",{className:"tickBarMax",style:a},Object(m.sprintf)(e,t)))},r.render=function(){var e={width:r.props.width},t=r.props.element.get("label"),n=r.props.element.get("min"),a=r.props.element.get("max"),i=r.props.element.get("step");return d.a.createElement("div",{ref:r.sliderRef,className:"Widget stSlider",style:e},d.a.createElement("label",null,t),d.a.createElement(p.Slider,{min:n,max:a,step:i,value:r.value,onChange:r.handleChange,disabled:r.props.disabled,overrides:v({},f.i,{ThumbValue:r.renderThumbValue,TickBar:r.renderTickBar})}))},r.setWidgetValue=Object(b.a)(200,r.setWidgetValueRaw.bind(Object(c.a)(r))),r.state={value:r.props.element.get("default").toJS()},r}return Object(o.a)(t,e),Object(i.a)(t,[{key:"value",get:function(){var e=this.props.element.get("min"),t=this.props.element.get("max"),r=this.state.value,n=r[0],a=r.length>1?r[1]:r[0];return n>a&&(n=a),n<e&&(n=e),n>t&&(n=t),a<e&&(a=e),a>t&&(a=t),r.length>1?[n,a]:[n]}}]),t}(d.a.PureComponent);r.d(t,"default",function(){return h})}}]);
//# sourceMappingURL=42.cbe5b3a7.chunk.js.map