text: !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],n):e.reactPickerWheel=n(e.React,e.ReactDOM)}(this,function(e,t){"use strict";var p="default"in e?e.default:e;function r(n,t){if(n===t)return!0;var e=Object.keys(n),i=Object.keys(t);return e.length===i.length&&e.every(function(e){return n.hasOwnProperty(e)&&n[e]===t[e]})}function i(e){e.prototype.shouldComponentUpdate=function(e,n){return i.shouldComponentUpdate(e,n,this.props,this.state)}}function o(e){var n=["-webkit-","-moz-","-ms-"],t={},i=/transform|transition/;for(var r in e)if(e.hasOwnProperty(r)){var o=e[r];if(i.test(r))for(var a=0;a<n.length;a++){t[(n[a]+r).replace(/-([a-z])/g,function(e,n){return n.toUpperCase()}).replace("-","")]=o.replace(i,n[a]+"$&")}t[r]=o}return t}function c(e,n){var t=o(n);for(var i in t)t.hasOwnProperty(i)&&(e.style[i]=t[i])}t=t&&t.hasOwnProperty("default")?t.default:t,function(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===t&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}(".picker-wheel-modal {\n    position: fixed;\n    right: 0;\n    bottom: 0;\n    width: 100%;\n    height: 100%;\n    background-color: rgba(0, 0, 0, .6);\n    z-index: 999;\n    display: -webkit-box;\n    display: -ms-flexbox;\n    display: flex;\n    -webkit-box-align: center;\n        -ms-flex-align: center;\n            align-items: center;\n    -webkit-box-pack: center;\n        -ms-flex-pack: center;\n            justify-content: center;\n}\n\n.picker-wheel {\n    position: absolute;\n    left: 0;\n    bottom: 0;\n    width: 100%;\n    z-index: 1;\n    font-size: 16px;\n    text-align: center;\n    font-family: arial,verdana,sans-serif;\n    -webkit-box-sizing: content-box;\n            box-sizing: content-box;\n    -webkit-font-smoothing: antialiased;\n    -webkit-user-select: none;\n       -moz-user-select: none;\n        -ms-user-select: none;\n            user-select: none;\n}\n\n.picker-wheel .picker-wheel-header {\n        padding: 0 .5em;\n        min-height: 2em;\n        line-height: 2em;\n        font-size: 1.125em;\n    }\n\n.picker-wheel .picker-wheel-navbar {\n        padding: 0 .5em .5em .5em;\n        overflow: hidden;\n    }\n\n.picker-wheel .picker-wheel-navbar-btn {\n        height: 2.5em;\n        line-height: 2.5em;\n        float: right;\n        padding: 0 1em;\n        cursor: pointer;\n    }\n\n.picker-wheel .picker-wheel-content {\n        display: -webkit-box;\n        display: -ms-flexbox;\n        display: flex;\n        padding: .5em .25em;\n    }\n\n.picker-wheel .picker-wheel-col-1 {\n        -webkit-box-flex: 1;\n            -ms-flex: 1;\n                flex: 1;\n        margin: 0 .25em;\n    }\n\n.picker-wheel .picker-wheel-viewport {\n        height: 200px;\n        position: relative;\n        overflow: hidden\n    }\n\n.picker-wheel .picker-wheel-viewport::after {\n    content: '';\n    position: absolute;\n    z-index: 2;\n    top: 0;\n    right: 0;\n    bottom: 0;\n    left: 0;\n    pointer-events: none;\n}\n\n.picker-wheel .picker-wheel-wheel {\n        position: absolute;\n        height: 40px;\n        top: 50%;\n        margin-top: -20px;\n        width: 100%;\n    }\n\n.picker-wheel .picker-wheel-scroll {\n        list-style-type: none;\n        padding: 0;\n        -webkit-margin-before: 0;\n        -webkit-margin-after: 0\n    }\n\n.picker-wheel .picker-wheel-scroll>li {\n    height: 40px;\n    line-height: 40px;\n    font-size: 1.375em;\n    cursor: pointer;\n}\n\n.picker-wheel {\n\n    /* default */\n}\n\n.picker-wheel.default {\n    background-color: #f7f7f7;\n}\n\n.picker-wheel.default .picker-wheel-header {\n            color: #4eccc4;\n}\n\n.picker-wheel.default .picker-wheel-wheel {\n            border-top: 1px solid #4eccc4;\n            border-bottom: 1px solid #4eccc4;\n}\n\n.picker-wheel.default .picker-wheel-scroll li {\n                color: rgb(59, 59, 59);\n            }\n\n.picker-wheel.default .picker-wheel-scroll li.disabled {\n                color: rgb(191, 191, 191);\n            }\n\n.picker-wheel.default .picker-wheel-navbar-btn {\n            color: #4eccc4;\n}\n\n.picker-wheel {\n\n    /* dark */\n}\n\n.picker-wheel.dark {\n    background-color: #263238;\n}\n\n.picker-wheel.dark .picker-wheel-header {\n            color: #50ccc4;\n}\n\n.picker-wheel.dark .picker-wheel-wheel {\n            border-top: 1px solid #50ccc4;\n            border-bottom: 1px solid #50ccc4;\n}\n\n.picker-wheel.dark .picker-wheel-scroll li {\n                color: rgb(201, 203, 204);\n            }\n\n.picker-wheel.dark .picker-wheel-scroll li.disabled {\n                color: rgb(87, 96, 100);\n            }\n\n.picker-wheel.dark .picker-wheel-navbar-btn {\n            color: #50ccc4;\n}\n\n.picker-wheel {\n\n    /* ios */\n}\n\n.picker-wheel.ios {\n    background-color: #f7f7f7;\n}\n\n.picker-wheel.ios .picker-wheel-col-1 {margin: 0;\n}\n\n.picker-wheel.ios .picker-wheel-header {\n            color: rgb(59, 59, 59);\n            padding: 0 3.5em;\n}\n\n.picker-wheel.ios .picker-wheel-viewport::after {\n    background: -webkit-gradient(linear,left top, left bottom,from(#f7f7f7),color-stop(52%, rgba(245, 245, 245, 0)),color-stop(48%, rgba(245, 245, 245, 0)),to(#f7f7f7));\n    background: linear-gradient(#f7f7f7,rgba(245, 245, 245, 0)52%,rgba(245, 245, 245, 0)48%,#f7f7f7);\n}\n\n.picker-wheel.ios .picker-wheel-wheel {\n            border-top: 1px solid #dbdbdb;\n            border-bottom: 1px solid #dbdbdb;\n}\n\n.picker-wheel.ios .picker-wheel-scroll li {\n                color: rgb(59, 59, 59);\n            }\n\n.picker-wheel.ios .picker-wheel-scroll li.disabled {\n                color: rgb(191, 191, 191);\n            }\n\n.picker-wheel.ios .picker-wheel-navbar {\n            position: absolute;\n            z-index: 2;\n            top: 0;\n            left: 0;\n            width: 100%;\n            padding: 0;\n            border-bottom: 1px solid #acacac;\n}\n\n.picker-wheel.ios .picker-wheel-navbar-btn {\n            color: #007aff;\n}\n\n.picker-wheel.ios .picker-wheel-navbar-btn:nth-child(2) {\n    float: left;\n}\n\n.picker-wheel.ios .picker-wheel-content {\n            padding-top: 48px;\n}\n\n.picker-wheel.ios .picker-wheel-header + .picker-wheel-content {\n          padding-top: 0;\n}\n\n.picker-wheel {\n\n    /* assurance */\n}\n\n.picker-wheel.assurance {\n    position: relative;\n}\n\n.picker-wheel.assurance .picker-wheel-col-1 {\n            margin: 0;\n}\n\n.picker-wheel.assurance .picker-wheel-header {\n            color: rgb(59, 59, 59);\n            padding: 0 3.5em;\n}\n\n.picker-wheel.assurance .picker-wheel-viewport::after {\n    background: -webkit-gradient(linear,left top, left bottom,from(#fff),color-stop(52%, rgba(245, 245, 245, 0)),color-stop(48%, rgba(245, 245, 245, 0)),to(#fff));\n    background: linear-gradient(#fff,rgba(245, 245, 245, 0)52%,rgba(245, 245, 245, 0)48%,#fff);\n}\n\n.picker-wheel.assurance .picker-wheel-wheel {\n            border-top: 1px solid #dbdbdb;\n            border-bottom: 1px solid #dbdbdb;\n}\n\n.picker-wheel.assurance .picker-wheel-scroll li {\n                color: rgb(59, 59, 59);\n            }\n\n.picker-wheel.assurance .picker-wheel-scroll li.disabled {\n                color: rgb(191, 191, 191);\n            }\n\n.picker-wheel.assurance .picker-wheel-navbar {\n            display: none;\n}\n\n.picker-wheel.assurance .picker-wheel-navbar-btn {\n            color: #007aff;\n}\n\n.picker-wheel.assurance .picker-wheel-navbar-btn:nth-child(2) {\n    float: left;\n}\n\n.picker-wheel.assurance .picker-wheel-content {\n            padding: 0;\n}\n\n.picker-wheel.assurance .picker-wheel-header + .picker-wheel-content {\n          padding-top: 0;\n}\n\n.picker-wheel {\n\n    /* android */\n}\n\n.picker-wheel.android, .picker-wheel.android-dark {\n    background-color: #f5f5f5;\n}\n\n.picker-wheel.android .picker-wheel-header, .picker-wheel.android-dark .picker-wheel-header {\n            color: #31b6e7;\n            border-bottom: 2px solid #31b6e7;\n}\n\n.picker-wheel.android .picker-wheel-col-1, .picker-wheel.android-dark .picker-wheel-col-1 {margin: 0 .625em;\n}\n\n.picker-wheel.android .picker-wheel-viewport::after, .picker-wheel.android-dark .picker-wheel-viewport::after {\n    background-image: -webkit-gradient(linear,left top, left bottom,from(#f5f5f5),color-stop(52%, rgba(245, 245, 245, 0)),color-stop(48%, rgba(245, 245, 245, 0)),to(#f5f5f5));\n    background-image: linear-gradient(#f5f5f5,rgba(245, 245, 245, 0)52%,rgba(245, 245, 245, 0)48%,#f5f5f5);\n}\n\n.picker-wheel.android .picker-wheel-wheel, .picker-wheel.android-dark .picker-wheel-wheel {\n            border-top: 2px solid #31b6e7;\n            border-bottom: 2px solid #31b6e7;\n}\n\n.picker-wheel.android .picker-wheel-scroll li, .picker-wheel.android-dark .picker-wheel-scroll li {\n                font-size: 1.125em;\n                color: rgb(56, 56, 56);\n            }\n\n.picker-wheel.android .picker-wheel-scroll li.disabled, .picker-wheel.android-dark .picker-wheel-scroll li.disabled {\n                color: rgb(188, 188, 188);\n            }\n\n.picker-wheel.android .picker-wheel-navbar, .picker-wheel.android-dark .picker-wheel-navbar {\n            display: -webkit-box;\n            display: -ms-flexbox;\n            display: flex;\n            border-top: 1px solid #d9d4d4;\n            padding: 0;\n}\n\n.picker-wheel.android .picker-wheel-navbar-btn, .picker-wheel.android-dark .picker-wheel-navbar-btn {\n            padding: 0;\n            color: #000;\n            -webkit-box-flex: 1;\n                -ms-flex: 1;\n                    flex: 1;\n}\n\n.picker-wheel.android .picker-wheel-navbar-btn:nth-child(2), .picker-wheel.android-dark .picker-wheel-navbar-btn:nth-child(2) {\n    border-left: 1px solid #d9d4d4;\n}\n\n.picker-wheel {\n\n    /* android-dark */\n}\n\n.picker-wheel.android-dark {\n    background-color: #292829;\n}\n\n.picker-wheel.android-dark .picker-wheel-viewport::after {\n    background-image: -webkit-gradient(linear,left top, left bottom,from(#282828),color-stop(52%, rgba(40, 40, 40, 0)),color-stop(48%, rgba(40, 40, 40, 0)),to(#282828));\n    background-image: linear-gradient(#282828,rgba(40, 40, 40, 0)52%,rgba(40, 40, 40, 0)48%,#282828);\n}\n\n.picker-wheel.android-dark .picker-wheel-scroll li {\n                color: rgb(199, 199, 199);\n            }\n\n.picker-wheel.android-dark .picker-wheel-scroll li.disabled {\n                color: rgb(88, 88, 88);\n            }\n\n.picker-wheel.android-dark .picker-wheel-navbar { border-color: #424542;\n}\n\n.picker-wheel.android-dark .picker-wheel-navbar-btn {\n            color: #fff;\n}\n\n.picker-wheel.android-dark .picker-wheel-navbar-btn:nth-child(2) {\n    border-color: #424542;\n}\n",{}),i.shouldComponentUpdate=function(e,n,t,i){return!r(t,e)||!r(i,n)};!function(){function c(e){this.value=e}function e(r){var o,a;function l(e,n){try{var t=r[e](n),i=t.value;i instanceof c?Promise.resolve(i.value).then(function(e){l("next",e)},function(e){l("throw",e)}):s(t.done?"return":"normal",t.value)}catch(e){s("throw",e)}}function s(e,n){switch(e){case"return":o.resolve({value:n,done:!0});break;case"throw":o.reject(n);break;default:o.resolve({value:n,done:!1})}(o=o.next)?l(o.key,o.arg):a=null}this._invoke=function(i,r){return new Promise(function(e,n){var t={key:i,arg:r,resolve:e,reject:n,next:null};a?a=a.next=t:(o=a=t,l(i,r))})},"function"!=typeof r.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(e.prototype[Symbol.asyncIterator]=function(){return this}),e.prototype.next=function(e){return this._invoke("next",e)},e.prototype.throw=function(e){return this._invoke("throw",e)},e.prototype.return=function(e){return this._invoke("return",e)}}();var a=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},l=function(){function i(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,n,t){return n&&i(e.prototype,n),t&&i(e,t),e}}(),s=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},h=function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)},d=function(e,n){var t={};for(var i in e)0<=n.indexOf(i)||Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},u=function(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n},m=function(e){if(Array.isArray(e)){for(var n=0,t=Array(e.length);n<e.length;n++)t[n]=e[n];return t}return Array.from(e)},f=function(e){return void 0===e},k=80,v=80,w=function(e){function t(e){a(this,t);var n=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.animating=!1,n.touchY=0,n.translateY=0,n.lastEventTime=Date.now(),n.lastTouchY=0,n.velocity=0,n.moveItemCount=0,n.itemHeight=e.itemHeight,n.spinTimeout=null,n.accelerationRate=0,n.estimatedAccelerationRate=0,n.remainderDistTravelled=0,n.remainderFragment=0,n.middleIndex=Math.floor(e.items.length/2),n.middleY=-n.itemHeight*n.middleIndex,n.currentIndex=n.middleIndex,n.maxItemSpinCount=Math.min(e.items.length/2,7),n.state={translateY:n.middleY,marginTop:(n.currentIndex-n.middleIndex)*n.itemHeight,items:e.items},n.renderPickerWheelItem=n.renderPickerWheelItem.bind(n),n.handleContentTouch=n.handleContentTouch.bind(n),n.handleContentMouseDown=n.handleContentMouseDown.bind(n),n.handleContentMouseMove=n.handleContentMouseMove.bind(n),n.handleContentMouseUp=n.handleContentMouseUp.bind(n),n}return h(t,e),l(t,[{key:"componentDidMount",value:function(){var e=this.viewport;e.addEventListener("touchstart",this.handleContentTouch,!1),e.addEventListener("touchmove",this.handleContentTouch,!1),e.addEventListener("touchend",this.handleContentTouch,!1),e.addEventListener("mousedown",this.handleContentMouseDown,!1)}},{key:"componentWillMount",value:function(){this._iniItems(this.props.value)}},{key:"componentWillReceiveProps",value:function(e){e.value!==this.props.value&&(this._iniItems(e.value),this.currentIndex=this.middleIndex,this.setState({translateY:this.middleY,marginTop:(this.currentIndex-this.middleIndex)*this.itemHeight}))}},{key:"shouldComponentUpdate",value:function(e,n){return e.value!==this.props.value||!r(n,this.state)}},{key:"componentWillUnmount",value:function(){var e=this.viewport;e.removeEventListener("touchstart",this.handleContentTouch,!1),e.removeEventListener("touchmove",this.handleContentTouch,!1),e.removeEventListener("touchend",this.handleContentTouch,!1),e.removeEventListener("mousedown",this.handleContentMouseDown,!1)}},{key:"_iniItems",value:function(e){for(var n=this.state.items,t=0;t<n.length;t++){if(n[this.middleIndex].value===e)return this.setState({items:n}),!0;var i=n[0];n=[].concat(m(n.slice(1)),[i])}}},{key:"_updateItemsAndMargin",value:function(e){var n=this.state.items;if(0<e){var t=n.slice(0,e);this.currentIndex+=e,this.setState({items:n.slice(e).concat(t),marginTop:(this.currentIndex-this.middleIndex)*this.itemHeight})}else if(e<0){var i=n.slice(n.length+e,n.length);this.currentIndex+=e,this.setState({items:i.concat(n.slice(0,n.length+e)),marginTop:(this.currentIndex-this.middleIndex)*this.itemHeight})}}},{key:"_checkIsUpdateItems",value:function(e,n){return 1===e?this.currentIndex*this.itemHeight+this.itemHeight/2<-n:this.currentIndex*this.itemHeight-this.itemHeight/2>-n}},{key:"_clearTransition",value:function(e){this.animating=!1,c(e,{transition:""}),clearTimeout(this.spinTimeout)}},{key:"_moveToNext",value:function(e){var n=this.state.items[this.middleIndex].value,t=this.props,i=t.max,r=t.min;-1===e&&n<r&&this.moveItemCount?this._updateItemsAndMargin(1):1===e&&i<n&&this.moveItemCount&&this._updateItemsAndMargin(-1),Math.abs(this.velocity)<40?this._snappySpinTo(e):this._scrollWithVelocity(e)}},{key:"_scrollWithVelocity",value:function(e){var n=this;if(this.animating=!0,this.estimatedAccelerationRate!==this.accelerationRate){for(var t=0,i=this.velocity,r=0;r<37.5;r++)t+=i,i+=this.estimatedAccelerationRate;var o=-this.state.translateY+t,a=o-o%this.itemHeight+this.itemHeight+this.state.translateY;this.remainderDistTravelled=a-t,this.remainderFragment=this.remainderDistTravelled/37.5,this.accelerationRate=this.estimatedAccelerationRate}c(this.refs.scroll,{transition:"transform 80ms linear"});var l=this.velocity+this.remainderFragment;this.setState(function(e,n){return{translateY:e.translateY-l}}),this.velocity+=this.accelerationRate,this.spinTimeout=setTimeout(function(){n.syncSpinAndItems(),n.velocity<=0&&0<=e||0<=n.velocity&&e<=0||0<=n.accelerationRate*e?(n.setState({translateY:-n.currentIndex*n.itemHeight}),n.props.onSelect(n.state.items[n.middleIndex].value),n._clearTransition(n.refs.scroll)):n.animating&&n._scrollWithVelocity(e)},k)}},{key:"syncSpinAndItems",value:function(){var e=-Math.round(this.state.translateY/this.itemHeight);e!==this.currentIndex&&this._updateItemsAndMargin(e-this.currentIndex)}},{key:"_snappySpinTo",value:function(e){var n=this;this.animating=!0,this.velocity=this.velocity/k;for(var t=-this.velocity/300,i=0,r=0;r<300;r++)i+=this.velocity,this.velocity+=t;var o=Math.abs(i),a=[-this.maxItemSpinCount,Math.floor(o/this.itemHeight)*e,this.maxItemSpinCount].sort(function(e,n){return e-n})[1],l=a+this.currentIndex,s=function(e){switch(Math.abs(e)){case 0:return 50;case 1:return 100;default:return 300}}(a);c(this.refs.scroll,{transition:"transform "+s+"ms ease-out"}),this.setState({translateY:-l*this.itemHeight}),setTimeout(function(){n._updateItemsAndMargin(a),n.props.onSelect(n.state.items[n.middleIndex].value),n._clearTransition(n.refs.scroll)},s)}},{key:"handleStart",value:function(e){this.touchY=f(e.targetTouches)||f(e.targetTouches[0])?e.pageY:e.targetTouches[0].pageY,this._clearTransition(this.refs.scroll),this.translateY=this.state.translateY,this.moveItemCount=0,this.syncSpinAndItems(),this.velocity=0,this.lastEventTime=Date.now(),this.lastTouchY=this.touchY}},{key:"handleMove",value:function(e){var n=f(e.targetTouches)||f(e.targetTouches[0])?e.pageY:e.targetTouches[0].pageY,t=n-this.touchY,i=this.translateY+t,r=0<t?-1:1,o=this.lastTouchY-n,a=Date.now()-this.lastEventTime;this.velocity=[-v,Math.round(o/a*k),v].sort(function(e,n){return e-n})[1],this.estimatedAccelerationRate=-this.velocity/37.5,this.lastEventTime=Date.now(),this.lastTouchY=n;var l=this.state.items[this.middleIndex].value,s=this.props,c=s.max;l<s.min||c<l||(this._checkIsUpdateItems(r,i)&&(this.moveItemCount=0<r?this.moveItemCount+1:this.moveItemCount-1,this._updateItemsAndMargin(r)),this.setState({translateY:i}))}},{key:"handleEnd",value:function(e){var n=0<(e.pageY||e.changedTouches[0].pageY)-this.touchY?-1:1;this._moveToNext(n)}},{key:"handleContentTouch",value:function(e){e.preventDefault(),"touchstart"===e.type?this.handleStart(e):"touchmove"===e.type?this.handleMove(e):"touchend"===e.type&&this.handleEnd(e)}},{key:"handleContentMouseDown",value:function(e){this.handleStart(e),document.addEventListener("mousemove",this.handleContentMouseMove),document.addEventListener("mouseup",this.handleContentMouseUp)}},{key:"handleContentMouseMove",value:function(e){this.handleMove(e)}},{key:"handleContentMouseUp",value:function(e){this.handleEnd(e),document.removeEventListener("mousemove",this.handleContentMouseMove),document.removeEventListener("mouseup",this.handleContentMouseUp)}},{key:"renderPickerWheelItem",value:function(e,n){var t=e.value<this.props.min||e.value>this.props.max?"disabled":"";return p.createElement("li",{key:n,className:t,style:{height:this.itemHeight,lineHeight:this.itemHeight+"px"}},e.text)}},{key:"render",value:function(){var n=this,e=o({transform:"translateY("+this.state.translateY+"px)",marginTop:this.state.marginTop});return p.createElement("div",{className:"picker-wheel-col-1"},p.createElement("div",{ref:function(e){return n.viewport=e},className:"picker-wheel-viewport",style:{height:5*this.itemHeight}},p.createElement("div",{className:"picker-wheel-wheel",style:{height:this.itemHeight,marginTop:-this.itemHeight/2}},p.createElement("ul",{ref:"scroll",className:"picker-wheel-scroll",style:e},this.state.items.map(this.renderPickerWheelItem)))))}}]),t}(e.Component),b=function(e){function t(e){a(this,t);var n=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={value:n.props.value},n.handleFinishBtnClick=n.handleFinishBtnClick.bind(n),n.handleItemSelect=n.handleItemSelect.bind(n),n}return h(t,e),l(t,[{key:"componentWillReceiveProps",value:function(e){e.value!==this.state.value&&this.setState({value:e.value})}},{key:"componentDidUpdate",value:function(){var e=this.state.value,n=this.props,t=n.min,i=n.max;i<e&&this.setState({value:i}),e<t&&this.setState({value:t})}},{key:"shouldComponentUpdate",value:function(e,n){return e.value!==this.state.value||i.shouldComponentUpdate(e,n,this.props,this.state)}},{key:"handleFinishBtnClick",value:function(){this.props.onSelect(this.state.value)}},{key:"handleItemSelect",value:function(e){this.setState({value:e}),this.props.onChange&&this.props.onChange(e)}},{key:"render",value:function(){var e=this.props,n=e.min,t=e.max,i=e.items,r=e.theme,o=e.confirmText,a=e.cancelText,l=e.showHeader,s=e.customHeader,c=e.itemHeight,h=this.state.value,d=-1===["default","dark","ios","android","android-dark","assurance"].indexOf(r)?"default":r;return p.createElement("div",{className:"picker-wheel "+d},l&&p.createElement("div",{className:"picker-wheel-header"},s||h),p.createElement("div",{className:"picker-wheel-content"},p.createElement(w,{step:1,value:h,min:n,max:t,items:i,onSelect:this.handleItemSelect,itemHeight:c})),p.createElement("div",{className:"picker-wheel-navbar"},p.createElement("a",{className:"picker-wheel-navbar-btn",onClick:this.handleFinishBtnClick},o),p.createElement("a",{className:"picker-wheel-navbar-btn",onClick:this.props.onCancel},a)))}}]),t}(e.Component),g=t.unstable_renderSubtreeIntoContainer,y=function(e){function n(){return a(this,n),u(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return h(n,e),l(n,[{key:"componentDidMount",value:function(){this._div=document.createElement("div"),this._div.classList.add("Modal-Portal"),document.body.appendChild(this._div),this.renderPortal(this.props)}},{key:"componentWillReceiveProps",value:function(e){this.renderPortal(e)}},{key:"componentWillUnmount",value:function(){t.unmountComponentAtNode(this._div),this._div.parentNode.removeChild(this._div)}},{key:"renderPortal",value:function(e){var n=p.cloneElement(this.props.children,s({},e,{key:"portal"}),null);this.portal=g(this,n,this._div)}},{key:"render",value:function(){return p.createElement("noscript",null)}}]),n}(e.Component);function x(e){var n=e.isOpen,t=d(e,["isOpen"]);return p.createElement("div",{style:{display:n?"":"none"},onClick:function(e){e.target===e.currentTarget&&t.onCancel()},className:"picker-wheel-modal"},p.createElement(b,t))}function n(e){var n=e.isPopup,t=d(e,["isPopup"]);return n?p.createElement(y,t,p.createElement(x,null)):p.createElement(b,t)}return y.defaultProps={isOpen:!1},n.defaultProps={isPopup:!0,isOpen:!1,theme:"default",value:"",items:[],showHeader:!0,confirmText:"完成",cancelText:"取消",onSelect:function(){},onCancel:function(){},itemHeight:40},n});
  //# sourceMappingURL=dist/react-picker-wheel.min.js.map