text: !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.Picker=t(require("react")):e.Picker=t(e.React)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(8),l=r(u),p=n(4),f=r(p);n(7);var h=100,d=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return m.call(n),n.state=s({isMoving:!1,startTouchY:0,startScrollerTranslate:0},n.computeTranslate(e)),n}return a(t,e),c(t,[{key:"componentWillReceiveProps",value:function(e){this.state.isMoving||this.setState(this.computeTranslate(e))}},{key:"renderItems",value:function(){var e=this,t=this.props,n=t.options,r=t.itemHeight,o=t.value;return n.map(function(t,n){var i={height:r+"px",lineHeight:r+"px"},a="picker-item"+(t===o?" picker-item-selected":""),s=function(){return e.handleItemClick(t)};return l.default.createElement("div",{key:n,className:a,style:i,onClick:s},t)})}},{key:"render",value:function(){var e="translate3d(0, "+this.state.scrollerTranslate+"px, 0)",t={MsTransform:e,MozTransform:e,OTransform:e,WebkitTransform:e,transform:e};return this.state.isMoving&&(t.transitionDuration=(this.props.scrollTransitionDuration||0)+"ms",t.transitionTimingFunction="ease"),l.default.createElement("div",{className:"picker-column"},l.default.createElement("div",{className:"picker-scroller",style:t,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,onTouchEnd:this.handleTouchEnd,onTouchCancel:this.handleTouchCancel},this.renderItems()))}}]),t}(u.Component);d.propTypes={options:f.default.array.isRequired,name:f.default.string.isRequired,value:f.default.any.isRequired,itemHeight:f.default.number.isRequired,columnHeight:f.default.number.isRequired,onChange:f.default.func.isRequired,onClick:f.default.func.isRequired,scrollTransitionDuration:f.default.number};var m=function(){var e=this;this.computeTranslate=function(t){var n=t.options,r=t.value,o=t.itemHeight,i=t.columnHeight,a=n.indexOf(r);return a<0&&(console.warn("Warning: "+e.props.name+" doesn't contain an option of "+r+"."),e.onValueSelected(n[0]),a=0),{scrollerTranslate:i/2-o/2-a*o,minTranslate:i/2-o*n.length+o/2,maxTranslate:i/2-o/2}},this.onValueSelected=function(t){e.props.onChange(e.props.name,t)},this.handleTouchStart=function(t){e.isTouchedOffTimeout?clearTimeout(e.isTouchedOffTimeout):e.isTouchedOnTimeout=setTimeout(function(){e.isTouchedOnTimeout=null,e.isTouched=!0},h);var n=t.touches[0].clientY;e.setState(function(e){var t=e.scrollerTranslate;return{startTouchY:n,startScrollerTranslate:t}})},this.handleTouchMove=function(t){t.preventDefault();var n=t.touches[0].clientY;e.setState(function(e){var t=e.isMoving,r=e.startTouchY,o=e.startScrollerTranslate,i=e.minTranslate,a=e.maxTranslate;if(!t)return{isMoving:!0};var s=o+n-r;return s<i?s=i-Math.pow(i-s,.8):s>a&&(s=a+Math.pow(s-a,.8)),{scrollerTranslate:s}})},this.handleTouchEnd=function(t){e.isTouchedOnTimeout?clearTimeout(e.isTouchedOnTimeout):e.isTouchedOffTimeout=setTimeout(function(){e.isTouchedOffTimeout=null,e.isTouched=!1},h),e.state.isMoving&&(e.setState({isMoving:!1,startTouchY:0,startScrollerTranslate:0}),setTimeout(function(){var t=e.props,n=t.options,r=t.itemHeight,o=e.state,i=o.scrollerTranslate,a=o.minTranslate,s=o.maxTranslate,c=void 0;c=i>s?0:i<a?n.length-1:-Math.round((i-s)/r),e.onValueSelected(n[c])},e.props.scrollTransitionDuration||0))},this.handleTouchCancel=function(t){e.isTouchedOnTimeout?clearTimeout(e.isTouchedOnTimeout):e.isTouchedOffTimeout=setTimeout(function(){e.isTouchedOffTimeout=null,e.isTouched=!1},h),e.state.isMoving&&e.setState(function(e){var t=e.startScrollerTranslate;return{isMoving:!1,startTouchY:0,startScrollerTranslate:0,scrollerTranslate:t}})},this.handleItemClick=function(t){e.isTouched||(t!==e.props.value?e.onValueSelected(t):e.props.onClick(e.props.name,e.props.value))}},v=function(e){function t(){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),c(t,[{key:"renderInner",value:function(){var e=this.props,t=e.optionGroups,n=e.valueGroups,r=e.itemHeight,o=e.height,i=e.onChange,a=e.onClick,s=e.scrollTransitionDuration,c={height:r,marginTop:-(r/2)},u=[];for(var p in t)u.push(l.default.createElement(d,{key:p,name:p,options:t[p],value:n[p],itemHeight:r,columnHeight:o,onChange:i,onClick:a,scrollTransitionDuration:s}));return l.default.createElement("div",{className:"picker-inner"},u,l.default.createElement("div",{className:"picker-highlight",style:c}))}},{key:"render",value:function(){var e={height:this.props.height};return l.default.createElement("div",{className:"picker-container",style:e},this.renderInner())}}]),t}(u.Component);v.propTyps={optionGroups:f.default.object.isRequired,valueGroups:f.default.object.isRequired,onChange:f.default.func.isRequired,onClick:f.default.func,itemHeight:f.default.number,height:f.default.number,scrollTransitionDuration:f.default.number},v.defaultProps={onClick:function(){},itemHeight:36,height:216},t.default=v},function(e,t,n){t=e.exports=n(2)(),t.push([e.id,'.picker-container{z-index:10001;width:100%}.picker-container,.picker-container *,.picker-container :after,.picker-container :before{box-sizing:border-box}.picker-container .picker-inner{position:relative;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;height:100%;padding:0 20px;font-size:1.2em;-webkit-mask-box-image:linear-gradient(0deg,transparent,transparent 5%,#fff 20%,#fff 80%,transparent 95%,transparent)}.picker-container .picker-column{-ms-flex:1 1;flex:1 1;position:relative;max-height:100%;overflow:hidden;text-align:center}.picker-container .picker-column .picker-scroller{transition:.3s;transition-timing-function:ease-out}.picker-container .picker-column .picker-item{position:relative;padding:0 10px;white-space:nowrap;color:#999;overflow:hidden;text-overflow:ellipsis}.picker-container .picker-column .picker-item.picker-item-selected{color:#222}.picker-container .picker-highlight{position:absolute;top:50%;left:0;width:100%;pointer-events:none}.picker-container .picker-highlight:after,.picker-container .picker-highlight:before{content:" ";position:absolute;left:0;right:auto;display:block;width:100%;height:1px;background-color:#d9d9d9;transform:scaleY(.5)}.picker-container .picker-highlight:before{top:0;bottom:auto}.picker-container .picker-highlight:after{bottom:0;top:auto}',""])},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t];n[2]?e.push("@media "+n[2]+"{"+n[1]+"}"):e.push(n[1])}return e.join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];"number"==typeof i&&(r[i]=!0)}for(o=0;o<t.length;o++){var a=t[o];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),e.push(a))}},e}},function(e,t,n){"use strict";function r(){}function o(){}var i=n(5);o.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,o,a){if(a!==i){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:r};return n.PropTypes=n,n}},function(e,t,n){e.exports=n(3)()},function(e,t){"use strict";var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=n},function(e,t,n){function r(e,t){for(var n=0;n<e.length;n++){var r=e[n],o=h[r.id];if(o){o.refs++;for(var i=0;i<o.parts.length;i++)o.parts[i](r.parts[i]);for(;i<r.parts.length;i++)o.parts.push(u(r.parts[i],t))}else{for(var a=[],i=0;i<r.parts.length;i++)a.push(u(r.parts[i],t));h[r.id]={id:r.id,refs:1,parts:a}}}}function o(e){for(var t=[],n={},r=0;r<e.length;r++){var o=e[r],i=o[0],a=o[1],s=o[2],c=o[3],u={css:a,media:s,sourceMap:c};n[i]?n[i].parts.push(u):t.push(n[i]={id:i,parts:[u]})}return t}function i(e,t){var n=v(),r=y[y.length-1];if("top"===e.insertAt)r?r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),y.push(t);else{if("bottom"!==e.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");n.appendChild(t)}}function a(e){e.parentNode.removeChild(e);var t=y.indexOf(e);t>=0&&y.splice(t,1)}function s(e){var t=document.createElement("style");return t.type="text/css",i(e,t),t}function c(e){var t=document.createElement("link");return t.rel="stylesheet",i(e,t),t}function u(e,t){var n,r,o;if(t.singleton){var i=g++;n=T||(T=s(t)),r=l.bind(null,n,i,!1),o=l.bind(null,n,i,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=c(t),r=f.bind(null,n),o=function(){a(n),n.href&&URL.revokeObjectURL(n.href)}):(n=s(t),r=p.bind(null,n),o=function(){a(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}function l(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=b(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function p(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function f(e,t){var n=t.css,r=t.sourceMap;r&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var o=new Blob([n],{type:"text/css"}),i=e.href;e.href=URL.createObjectURL(o),i&&URL.revokeObjectURL(i)}var h={},d=function(e){var t;return function(){return"undefined"==typeof t&&(t=e.apply(this,arguments)),t}},m=d(function(){return/msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase())}),v=d(function(){return document.head||document.getElementsByTagName("head")[0]}),T=null,g=0,y=[];e.exports=function(e,t){t=t||{},"undefined"==typeof t.singleton&&(t.singleton=m()),"undefined"==typeof t.insertAt&&(t.insertAt="bottom");var n=o(e);return r(n,t),function(e){for(var i=[],a=0;a<n.length;a++){var s=n[a],c=h[s.id];c.refs--,i.push(c)}if(e){var u=o(e);r(u,t)}for(var a=0;a<i.length;a++){var c=i[a];if(0===c.refs){for(var l=0;l<c.parts.length;l++)c.parts[l]();delete h[c.id]}}}};var b=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},function(e,t,n){var r=n(1);"string"==typeof r&&(r=[[e.id,r,""]]);n(6)(r,{});r.locals&&(e.exports=r.locals)},function(t,n){t.exports=e}])});