!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(window,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e,n){},function(t,e,n){},function(t,e,n){"use strict";n.r(e),n.d(e,"install",(function(){return m})),n.d(e,"ScrollPicker",(function(){return f})),n.d(e,"ScrollPickerGroup",(function(){return v}));n(0);function i(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n0&&(n=0),{normalizedOptions:e,innerIndex:n,innerValue:e[n]&&e[n].value||null,top:null,pivots:[],pivotMin:0,pivotMax:0,transitioning:!1,transitionTO:null,start:null,isMouseDown:!1,isDragging:!1,scrollOffsetTop:0,scrollMin:0,scrollMax:0}},mounted:function(){this.calculatePivots(),this.top=this.findScrollByIndex(this.innerIndex),this.innerValue!==this.value&&this.$emit("input",this.innerValue),this.$el.addEventListener("touchstart",this.onStart),this.$el.addEventListener("touchmove",this.onMove),this.$el.addEventListener("touchend",this.onEnd),this.$el.addEventListener("touchcancel",this.onCancel),this.$el.addEventListener("mousewheel",this.onScroll),this.$el.addEventListener("DOMMouseScroll",this.onScroll),this.$el.addEventListener("wheel",this.onScroll),this.$el.addEventListener("mousedown",this.onStart),this.$el.addEventListener("mousemove",this.onMove),this.$el.addEventListener("mouseup",this.onEnd),this.$el.addEventListener("mouseleave",this.onCancel)},destroyed:function(){this.$el.removeEventListener("touchstart",this.onStart),this.$el.removeEventListener("touchmove",this.onMove),this.$el.removeEventListener("touchend",this.onEnd),this.$el.removeEventListener("touchcancel",this.onCancel),this.$el.removeEventListener("mousewheel",this.onScroll),this.$el.removeEventListener("DOMMouseScroll",this.onScroll),this.$el.removeEventListener("wheel",this.onScroll),this.$el.removeEventListener("mousedown",this.onStart),this.$el.removeEventListener("mousemove",this.onMove),this.$el.removeEventListener("mouseup",this.onEnd),this.$el.removeEventListener("mouseleave",this.onCancel)},watch:{value:function(t){if(null==t&&this.placeholder)this.correction(-1);else{var e=this.normalizedOptions.findIndex((function(e){return e.value==t}));-1!==e?this.innerIndex!==e&&this.correction(e):this.$emit("input",this.innerValue)}},options:function(t){var e=this,n=this.normalizedOptions=s(t),i=n.findIndex((function(t){return t.value==e.value}));-1===i&&!this.placeholder&&this.options.length>0&&(i=0);var o=n[i]&&n[i].value||null;this.$nextTick((function(){e.calculatePivots(),e.top=e.findScrollByIndex(i),e.innerIndex=i,e.innerValue!==o&&e.$emit("input",e.innerValue=o)}))}},methods:{resize:function(){var t=this;this.$nextTick((function(){t.calculatePivots(),t.top=t.findScrollByIndex(t.innerIndex)}))},calculatePivots:function(){var t=this.$refs.list.getBoundingClientRect().top;this.pivots=(this.$refs.items||[]).map((function(e){return((n=e.getBoundingClientRect()).top+n.bottom)/2-t;var n})).sort((function(t,e){return t-e})),this.pivotMin=Math.min.apply(Math,i(this.pivots)),this.pivotMax=Math.max.apply(Math,i(this.pivots)),this.scrollOffsetTop=this.$refs.selection.offsetTop+this.$refs.selection.offsetHeight/2,this.scrollMin=this.scrollOffsetTop-this.pivotMin,this.scrollMax=this.scrollOffsetTop-this.pivotMax},sanitizeInternalIndex:function(t){return Math.min(Math.max(t,this.placeholder?-1:0),this.normalizedOptions.length-1)},findIndexFromScroll:function(t){var e=this,n=null,i=0;return this.pivots.forEach((function(o,r){var s=o+t-e.scrollOffsetTop;(null===n||Math.abs(n)>Math.abs(s))&&(i=r,n=s)})),this.placeholder||0===this.options.length?i-1:i},findScrollByIndex:function(t){var e=t;return(this.placeholder||0===this.options.length)&&e++,t>-1&&e in this.pivots?this.scrollOffsetTop-this.pivots[e]:t>=this.pivots.length?this.scrollOffsetTop-this.pivotMax:this.scrollOffsetTop-this.pivotMin},onScroll:function(t){if(!(this.top>=this.scrollMin&&t.deltaY<0||this.top<=this.scrollMax&&t.deltaY>0||1===this.pivots.length)){t.preventDefault();var e=this.sanitizeInternalIndex(this.innerIndex+(t.deltaY>0?1:-1)),n=t.deltaY>0?this.findScrollByIndex(e-1)-this.findScrollByIndex(e):this.findScrollByIndex(e)-this.findScrollByIndex(e+1),i=Math.max(Math.min(t.deltaY,n),-1*n);this.top=Math.min(Math.max(this.top-i*this.scrollSensitivity,this.scrollMax),this.scrollMin);var o=this.sanitizeInternalIndex(this.findIndexFromScroll(this.top)),r=this.normalizedOptions[o]&&this.normalizedOptions[o].value||null;this.innerIndex=o,this.innerValue!==r&&this.$emit("input",this.innerValue=r),this.onAfterWheel()}},onAfterWheel:(c=function(){this.correction(this.findIndexFromScroll(this.top))},u=200,h=null,function(){h&&(clearTimeout(h),h=null);var t=this,e=arguments;h=setTimeout((function(){return c.apply(t,e)}),u)}),onStart:function(t){t.cancelable&&t.preventDefault();var e=a(t).clientY;this.start=[this.top,e],l(t)||(this.isMouseDown=!0),this.isDragging=!1},onMove:function(t){if(t.cancelable&&t.preventDefault(),this.start){var e=a(t).clientY-this.start[1];Math.abs(e)>1.5&&(this.isDragging=!0),this.top=this.start[0]+e*(l(t)?this.touchSensitivity:this.dragSensitivity)}},onEnd:function(t){t.cancelable&&t.preventDefault(),this.isDragging?this.correction(this.findIndexFromScroll(this.top)):this.handleClick(t),this.start=null,this.isDragging=!1,this.isMouseDown=!1},onCancel:function(t){t.cancelable&&t.preventDefault(),this.correction(this.findIndexFromScroll(this.top)),this.start=null,this.isMouseDown=!1,this.isDragging=!1},handleClick:function(t){var e=a(t),n=e.clientX,i=e.clientY,o=this.$refs.top.getBoundingClientRect(),r=this.$refs.bottom.getBoundingClientRect();o.left<=n&&n<=o.right&&o.top<=i&&i<=o.bottom?this.correction(this.innerIndex-1):r.left<=n&&n<=r.right&&r.top<=i&&i<=r.bottom&&this.correction(this.innerIndex+1)},correction:function(t){var e=this,n=this.sanitizeInternalIndex(t),i=this.normalizedOptions[n]&&this.normalizedOptions[n].value||null;this.top=this.findScrollByIndex(n),this.transitioning=!0,this.transitionTO&&(clearTimeout(this.transitionTO),this.transitionTO=null),this.transitionTO=setTimeout((function(){e.transitioning=!1,e.transitionTO=null,e.innerIndex=n,e.innerValue!==i&&(e.innerValue=i,e.$emit("input",e.innerValue))}),100)}},render:function(t){var e=this,n=[];return this.placeholder?n.push(t("div",{class:{"vue-scroll-picker-item":!0,"-placeholder":!0,"-selected":-1==this.innerIndex},ref:"items",refInFor:!0,domProps:{innerHTML:this.placeholder}})):0===this.normalizedOptions.length&&null===this.placeholder&&n.push(t("div",{class:["vue-scroll-picker-item","-empty","-selected"],ref:"items",refInFor:!0,domProps:{innerHTML:this.empty}})),n=n.concat(this.normalizedOptions.map((function(n,i){return t("div",{class:{"vue-scroll-picker-item":!0,"-selected":e.innerIndex==i},key:n.value,ref:"items",refInFor:!0,domProps:{innerHTML:n.name}})}))),t("div",{class:["vue-scroll-picker"]},[t("div",{class:["vue-scroll-picker-list"]},[t("div",{ref:"list",class:{"vue-scroll-picker-list-rotator":!0,"-transition":this.transitioning},style:null!==this.top?{top:"".concat(this.top,"px")}:{}},n)]),t("div",{class:["vue-scroll-picker-layer"]},[t("div",{class:["top"],ref:"top"}),t("div",{class:["middle"],ref:"selection"}),t("div",{class:["bottom"],ref:"bottom"})])])}};n(1);function d(t){return function(t){if(Array.isArray(t))return p(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return p(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n