UNPKG

vue-date-time-m

Version:
6 lines 777 kB
!function(e){function t(i){if(n[i])return n[i].exports;var a=n[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=10)}([function(e,t){function n(e,t){var n=e[1]||"",a=e[3];if(!a)return n;if(t&&"function"==typeof btoa){var r=i(a);return[n].concat(a.sources.map(function(e){return"/*# sourceURL="+a.sourceRoot+e+" */"})).concat([r]).join("\n")}return[n].join("\n")}function i(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var i=n(t,e);return t[2]?"@media "+t[2]+"{"+i+"}":i}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var i={},a=0;a<this.length;a++){var r=this[a][0];"number"==typeof r&&(i[r]=!0)}for(a=0;a<e.length;a++){var s=e[a];"number"==typeof s[0]&&i[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="("+s[2]+") and ("+n+")"),t.push(s))}},t}},function(e,t,n){function i(e){for(var t=0;t<e.length;t++){var n=e[t],i=d[n.id];if(i){i.refs++;for(var a=0;a<i.parts.length;a++)i.parts[a](n.parts[a]);for(;a<n.parts.length;a++)i.parts.push(r(n.parts[a]));i.parts.length>n.parts.length&&(i.parts.length=n.parts.length)}else{for(var s=[],a=0;a<n.parts.length;a++)s.push(r(n.parts[a]));d[n.id]={id:n.id,refs:1,parts:s}}}}function a(){var e=document.createElement("style");return e.type="text/css",u.appendChild(e),e}function r(e){var t,n,i=document.querySelector("style["+_+'~="'+e.id+'"]');if(i){if(g)return f;i.parentNode.removeChild(i)}if(b){var r=m++;i=p||(p=a()),t=s.bind(null,i,r,!1),n=s.bind(null,i,r,!0)}else i=a(),t=o.bind(null,i),n=function(){i.parentNode.removeChild(i)};return t(e),function(i){if(i){if(i.css===e.css&&i.media===e.media&&i.sourceMap===e.sourceMap)return;t(e=i)}else n()}}function s(e,t,n,i){var a=n?"":i.css;if(e.styleSheet)e.styleSheet.cssText=v(t,a);else{var r=document.createTextNode(a),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(r,s[t]):e.appendChild(r)}}function o(e,t){var n=t.css,i=t.media,a=t.sourceMap;if(i&&e.setAttribute("media",i),h.ssrId&&e.setAttribute(_,t.id),a&&(n+="\n/*# sourceURL="+a.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var l="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!l)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var c=n(18),d={},u=l&&(document.head||document.getElementsByTagName("head")[0]),p=null,m=0,g=!1,f=function(){},h=null,_="data-vue-ssr-id",b="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());e.exports=function(e,t,n,a){g=n,h=a||{};var r=c(e,t);return i(r),function(t){for(var n=[],a=0;a<r.length;a++){var s=r[a],o=d[s.id];o.refs--,n.push(o)}t?(r=c(e,t),i(r)):r=[];for(var a=0;a<n.length;a++){var o=n[a];if(0===o.refs){for(var l=0;l<o.parts.length;l++)o.parts[l]();delete d[o.id]}}}};var v=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},function(e,t){e.exports=function(e,t,n,i,a,r){var s,o=e=e||{},l=typeof e.default;"object"!==l&&"function"!==l||(s=e,o=e.default);var c="function"==typeof o?o.options:o;t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),a&&(c._scopeId=a);var d;if(r?(d=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(r)},c._ssrRegister=d):i&&(d=i),d){var u=c.functional,p=u?c.render:c.beforeCreate;u?(c._injectStyles=d,c.render=function(e,t){return d.call(t),p(e,t)}):c.beforeCreate=p?[].concat(p,d):[d]}return{esModule:s,exports:o,options:c}}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";t.a={name:"App",data:function(){return{date_demo:"",date_format:"",date_noTime:"",date_noMinute:"",date_year:"",date_month:"",date_day:"",date_limit:"",date_interval:"",date_time:"",data:"",max:(new Date).toString()}},methods:{show:function(){this.$refs.dateTime.show()},selectTime:function(e){this.data=e},show_demo:function(){this.$refs.dateTime_demo.show()},select_demo:function(e){this.date_demo=e},show_format:function(){this.$refs.dateTime_format.show()},select_format:function(e){this.date_format=e},show_noTime:function(){this.$refs.dateTime_noTime.show()},select_noTime:function(e){this.date_noTime=e},show_noMinute:function(){this.$refs.dateTime_noMinute.show()},select_noMinute:function(e){this.date_noMinute=e},show_year:function(){this.$refs.dateTime_year.show()},select_year:function(e){this.date_year=e},show_month:function(){this.$refs.dateTime_month.show()},select_month:function(e){this.date_month=e},show_day:function(){this.$refs.dateTime_day.show()},select_day:function(e){this.date_day=e},show_limit:function(){this.$refs.dateTime_limit.show()},select_limit:function(e){this.date_limit=e},show_interval:function(){this.$refs.dateTime_interval.show()},select_interval:function(e){this.date_interval=e},show_time:function(){this.$refs.dateTime_time.show()},select_time:function(e){this.date_time=e}}}},function(e,t,n){"use strict";function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var a=n(202),r=n(206),s=n(210),o=n(214),l=n(215),c=n(216);n.n(c),n(218);t.a={name:"dDateTime",data:function(){return{date:this.initDate(),weeks:this.produceArr(o.g),yearArr:[],monthArr:[],dateArr:[],hoursArr:[],minutesArr:[],status:"",isShow:!1,formatDate:"",confirmDate:"",LANG:""}},props:{type:{type:[String],default:"dateTime"},format:{type:[String]},color:{type:String,default:"#50c7a7"},min:{type:[String],default:""},max:{type:[String],default:""},value:{type:[Number,String],default:""},showTodayButton:{type:[Boolean],default:!0},textAlign:{type:[String],default:"left"},minutesInterval:{type:[Number],default:1}},watch:{date:function(){this.initArray()},dateArr:function(){this.dateTimeInit()}},computed:{showToday:function(){return!this.max||(new Date).getTime()<new Date(this.max).getTime()},showDate:function(){return l.a.format(this.date,this.formatDate)},year:function(){return this.date.getFullYear()},month:function(){return this.date.getMonth()+1},minutes:function(){if(o.c.length%this.minutesInterval==0){for(var e=[],t=0;t<o.c.length;t+=this.minutesInterval)e.push(o.c[t]);return e}return o.c}},created:function(){this.initStatus(this.type)},methods:{initDate:function(){var e=this.value?new Date(this.value):new Date;return"noMinute"!==this.type&&1===this.minutesInterval||(e=new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),0)),this.min&&e.getTime()<new Date(this.min).getTime()&&(e=new Date(new Date(this.min).getFullYear(),new Date(this.min).getMonth(),new Date(this.min).getDate(),new Date(this.min).getHours(),new Date(this.min).getMinutes())),this.max&&e.getTime()>new Date(this.max).getTime()&&(e=new Date(new Date(this.max).getFullYear(),new Date(this.max).getMonth(),new Date(this.max).getDate(),new Date(this.max).getHours(),new Date(this.max).getMinutes())),e},initStatus:function(e){switch(e){case"dateTime":case"noMinute":this.status="day",this.formatDate="yyyy/MM/dd hh:mm";break;case"date":this.status="day",this.formatDate="yyyy/MM/dd";break;case"time":this.status="time",this.formatDate="hh:mm";break;case"year":this.status="year",this.formatDate="yyyy";break;case"month":this.status="month",this.formatDate="MM";break;case"day":this.status="day",this.formatDate="dd";break;case"yearMonth":this.status="month",this.formatDate="yyyy/MM"}this.format&&(this.formatDate=this.format)},confirm:function(){this.confirmDate=this.date,this.$emit("confirm",l.a.format(this.confirmDate,this.formatDate)),this.hide()},now:function(){"noMinute"===this.type||this.minutesInterval?this.date=new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate(),(new Date).getHours(),0):this.date=new Date},show:function(){this.isShow=!0,this.confirmDate?this.date=this.confirmDate:this.date=this.initDate(),this.verifyDate()},hide:function(){this.isShow=!1,this.close()},productDateArr:function(e){var t=this.produceArr(l.a.createArray(1,l.a.getDaysInOneMonth(e)),!0),n=this.produceArr(l.a.createArray(1,l.a.getDaysInOneMonth(e,"last"))),a=this.produceArr(l.a.createArray(1,l.a.getDaysInOneMonth(e,"next"))),r=l.a.getMonthFirstDayWhatWeek(new Date(e.getFullYear(),e.getMonth(),1));return 0===r?r=7:1===r&&(r=0-o.f),n=n.slice(0-r+1),a=a.slice(0,o.f-t.length-n.length),[].concat(i(n),i(t),i(a))},chooseYear:function(e){if(this.yearArr[e].able){var t=new Date(this.yearArr[e].value,this.date.getMonth(),this.date.getDate(),this.date.getHours(),this.date.getMinutes());this.max&&t.getTime()>new Date(this.max).getTime()?this.date=new Date(this.max):this.min&&t.getTime()<new Date(this.min).getTime()?this.date=new Date(this.min):this.date=t,this.selectMonth()}},chooseDay:function(e){this.dateArr[e].isMonth&&this.dateArr[e].able&&(this.date=l.a.changeDay(this.date,this.dateArr[e].value),this.selectTime())},chooseMonth:function(e){if(this.monthArr[e].able){var t=new Date(this.date.getFullYear(),parseInt(this.monthArr[e].value,10)-1,this.date.getDate(),this.date.getHours(),this.date.getMinutes());if(this.max&&t.getTime()>new Date(this.max))this.date=new Date(this.date.getFullYear(),parseInt(this.monthArr[e].value,10)-1,1,this.date.getHours(),this.date.getMinutes());else if(this.min&&t.getTime()<new Date(this.min)){var n=l.a.getDaysInOneMonth(t);this.date=new Date(this.date.getFullYear(),parseInt(this.monthArr[e].value,10)-1,n,this.date.getHours(),this.date.getMinutes())}else this.date=t;this.dateArr=this.verifyMaxMin(this.productDateArr(this.date)),console.log(this.dateArr,32424234),this.verifyTime(),this.close()}},changeTime:function(e,t){if("hour"!==t||this.hoursArr[e].isSelect)"minute"===t&&(this.date=l.a.changeMinute(this.date,this.minutesArr[e].value));else{var n=l.a.changeHour(this.date,this.hoursArr[e].value);this.max&&new Date(this.max).getTime()<n.getTime()?(this.date=n,this.date=l.a.changeMinute(this.date,0)):this.min&&new Date(this.min).getTime()>n.getTime()?(this.date=n,this.date=l.a.changeMinute(this.date,59)):this.date=n}},selectYear:function(){"year"!==this.type&&"dateTime"!==this.type&&"date"!==this.type&&"yearMonth"!==this.type||(this.status="year",this.activeYear(this.date.getFullYear()))},selectMonth:function(){"month"!==this.type&&"dateTime"!==this.type&&"date"!==this.type&&"noMinute"!==this.type&&"yearMonth"!==this.type||(this.monthArr=this.verifyMaxMin(this.produceArr(o.e),"month"),console.log(this.monthArr,4324324),this.activeMonth(this.date.getMonth()),this.status="month")},selectTime:function(){"dateTime"!==this.type&&"time"!==this.type&&"noMinute"!==this.type||(this.status="time",this.verifyTime())},verifyTime:function(){this.max&&new Date(this.max).getTime()<this.date.getTime()&&(this.date=new Date(this.max),this.minutesInterval>1&&(this.date=new Date(new Date(this.max).getFullYear(),new Date(this.max).getMonth(),new Date(this.max).getDate(),new Date(this.max).getHours(),0))),this.min&&new Date(this.min).getTime()>this.date.getTime()&&(this.date=new Date(this.min),this.minutesInterval>1&&(this.date=new Date(new Date(this.min).getFullYear(),new Date(this.min).getMonth(),new Date(this.min).getDate(),new Date(this.min).getHours(),0)))},close:function(){"dateTime"!==this.type&&"noMinute"!==this.type&&"date"!==this.type||(this.status="day",this.dateArr=this.verifyMaxMin(this.productDateArr(this.date),"day"))},changeMonth:function(e){if("next"===e){if(this.max&&new Date(this.max).getTime()>new Date(this.date.getFullYear(),this.date.getMonth()+1,1).getTime()||!this.max){var t=l.a.changeMonth(this.date,this.date.getMonth()+1);this.max&&t.getTime()>new Date(this.max)?this.date=new Date(this.date.getFullYear(),this.date.getMonth()+1,1,this.date.getHours(),this.date.getMinutes()):this.date=t}}else if("last"===e&&(console.log(this.date.getFullYear(),this.date.getMonth(),l.a.getDaysInOneMonth(this.date)-1),this.min&&new Date(this.min).getTime()<new Date(this.date.getFullYear(),this.date.getMonth(),l.a.getDaysInOneMonth(this.date)-1).getTime()||!this.min)){var n=l.a.changeMonth(this.date,this.date.getMonth()-1);if(this.min&&n.getTime()<new Date(this.min)){var i=l.a.getDaysInOneMonth(n);this.date=new Date(this.date.getFullYear(),this.date.getMonth()-1,i,this.date.getHours(),this.date.getMinutes())}else this.date=n}this.dateArr=this.verifyMaxMin(this.productDateArr(this.date),"day"),this.verifyTime()},arrayDefault:function(e){e.forEach(function(e){e.isSelect=!1})},produceArr:function(e,t){var n=[];return e.forEach(function(e){var i={};i.value=e,i.isSelect=!1,i.able=!0,t&&(i.isMonth=t),n.push(i)}),n},dateTimeInit:function(){this.activeYear(this.date.getFullYear()),this.activeMonth(this.date.getMonth()),this.activeDay(this.date.getDate()),this.activeHour(this.date.getHours()),this.activeMinute(this.date.getMinutes())},activeMinute:function(e){this.arrayDefault(this.minutesArr);var t=e<10?"0"+e:e.toString();this.minutesArr.forEach(function(e){e.value===t&&e.able&&(e.isSelect=!0)})},activeHour:function(e){this.arrayDefault(this.hoursArr);var t=e<10?"0"+e:e.toString();this.hoursArr.forEach(function(e){e.value===t&&e.able&&(e.isSelect=!0)})},activeDay:function(e){this.arrayDefault(this.dateArr),this.dateArr.forEach(function(t){t.value===e&&t.isMonth&&t.able&&(t.isSelect=!0)})},activeMonth:function(e){this.arrayDefault(this.monthArr),this.monthArr.forEach(function(t){parseInt(t.value,10)===e+1&&(t.isSelect=!0)})},activeYear:function(e){this.arrayDefault(this.yearArr),this.yearArr.forEach(function(t){t.value===e&&(t.isSelect=!0)})},initArray:function(){this.yearArr=this.verifyMaxMin(this.produceArr(l.a.createArray(o.d,o.b)),"year"),this.monthArr=this.verifyMaxMin(this.produceArr(o.e),"month"),this.dateArr=this.verifyMaxMin(this.productDateArr(this.date),"day"),this.hoursArr=this.verifyMaxMin(this.produceArr(o.a),"hour"),this.minutesArr=this.verifyMaxMin(this.produceArr(this.minutes),"minute")},verifyMaxMin:function(e,t){if(!this.min&&!this.max)return e;if(this.min&&!this.max)return this.addMinDisable(e,t,new Date(this.min));if(!this.min&&this.max)return this.addMaxDisable(e,t,new Date(this.max));if(this.min&&this.max){var n=this.addMinDisable(e,t,new Date(this.min));return this.addMaxDisable(n,t,new Date(this.max))}},addMinDisable:function(e,t,n){var i=this,a=void 0,r=new Date(this.min).getTime();if("month"===t)a=e.findIndex(function(e,t){return r<new Date(i.date.getFullYear(),t).getTime()}),a--;else if("year"===t){var s=n.getFullYear();a=e.findIndex(function(e){return e.value===s})}else"day"===t?(a=e.findIndex(function(e){return console.log(r<=new Date(i.date.getFullYear(),i.date.getMonth(),e.value).getTime()),e.isMonth&&r<=new Date(i.date.getFullYear(),i.date.getMonth(),e.value).getTime()}),console.log(a)):"hour"===t?(a=e.findIndex(function(e){return r<new Date(i.date.getFullYear(),i.date.getMonth(),i.date.getDate(),parseInt(e.value,10)).getTime()}),a--):"minute"===t&&(new Date(this.date.getFullYear(),this.date.getMonth(),this.date.getDate(),this.date.getHours()),a=e.findIndex(function(e){return r<new Date(i.date.getFullYear(),i.date.getMonth(),i.date.getDate(),i.date.getHours(),parseInt(e.value,10)).getTime()}),a--);a<=-1&&(a=0);for(var o=0;o<a;o++)e[o].able=!1;return e},addMaxDisable:function(e,t,n){var i=this,a=void 0,r=new Date(this.max).getTime();if("month"===t)a=e.findIndex(function(e,t){return r<new Date(i.date.getFullYear(),t).getTime()}),a--;else if("year"===t){var s=n.getFullYear();a=e.findIndex(function(e){return e.value===s})}else"day"===t?(a=e.findIndex(function(e){return e.isMonth&&r<new Date(i.date.getFullYear(),i.date.getMonth(),e.value).getTime()}),a--):"hour"===t?(a=e.findIndex(function(e){return r<new Date(i.date.getFullYear(),i.date.getMonth(),i.date.getDate(),parseInt(e.value,10)).getTime()}),a--):"minute"===t&&(a=e.findIndex(function(e){return r<new Date(i.date.getFullYear(),i.date.getMonth(),i.date.getDate(),i.date.getHours(),parseInt(e.value,10)).getTime()}),a--);a<=-1&&(a=e.length);for(var o=a+1;o<e.length;o++)e[o].able=!1;return e},verifyDate:function(){new Date(this.max).getTime()<new Date(this.min).getTime()?console.error("Min than Max value. Please check"):this.max&&!this.min&&new Date(this.max).getTime()<this.date.getTime()?(this.minutesInterval>1&&(this.date=new Date(new Date(this.max).getFullYear(),new Date(this.max).getMonth(),new Date(this.max).getDate(),new Date(this.max).getHours(),0)),this.date=new Date(this.max)):this.min&&!this.max&&new Date(this.min).getTime()>this.date.getTime()?(this.date=new Date(this.min),this.minutesInterval>1&&(this.date=new Date(new Date(this.min).getFullYear(),new Date(this.min).getMonth(),new Date(this.min).getDate(),new Date(this.min).getHours(),0))):(this.min&&this.max&&new Date(this.min).getTime()>this.date.getTime()||this.min&&this.max&&new Date(this.max).getTime()<this.date.getTime())&&(this.date=new Date(this.min),this.minutesInterval>1&&(this.date=new Date(new Date(this.min).getFullYear(),new Date(this.min).getMonth(),new Date(this.min).getDate(),new Date(this.min).getHours(),0)))}},components:{DDateTimeCard:a.a,DDateTimePickYear:r.a,DDateTimePickHm:s.a}}},function(e,t,n){"use strict";t.a={name:"dDateTimeCard",props:{color:{type:String,default:"#50c7a7"},type:{type:String,default:"day"},data:{type:Object,default:function(){return{}}}},methods:{}}},function(e,t,n){"use strict";var i=n(8);t.a={props:{color:{type:String,default:"#50c7a7"},data:{type:Array}},mounted:function(){var e=this;this.scroll=new i.a(this.$refs.scroll,{mouseWheel:!0,probeType:3,click:!0}),setTimeout(function(){e.scrollYear()},200)},destroyed:function(){this.scroll&&this.scroll.destroy()},methods:{select:function(e){this.$emit("click",e)},scrollYear:function(){this.scroll.scrollTo(0,0-document.querySelector(".selected").getBoundingClientRect().top+document.documentElement.clientHeight/2)}},components:{}}},function(e,t,n){"use strict";function i(){return window.performance&&window.performance.now?window.performance.now()+window.performance.timing.navigationStart:+new Date}function a(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];for(var a=0;a<n.length;a++){var r=n[a];for(var s in r)e[s]=r[s]}return e}function r(e){return void 0===e||null===e}function s(e,t){return Math.sqrt(e*e+t*t)}function o(e){return!1!==P&&("standard"===P?"transitionEnd"===e?"transitionend":e:P+e.charAt(0).toUpperCase()+e.substr(1))}function l(e,t,n,i){e.addEventListener(t,n,{passive:!1,capture:!!i})}function c(e,t,n,i){e.removeEventListener(t,n,{passive:!1,capture:!!i})}function d(e){for(var t=0,n=0;e;)t-=e.offsetLeft,n-=e.offsetTop,e=e.offsetParent;return{left:t,top:n}}function u(e){var t=e.getBoundingClientRect();return{left:-(t.left+window.pageXOffset),top:-(t.top+window.pageYOffset)}}function p(e){if(e instanceof window.SVGElement){var t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}}return{top:e.offsetTop,left:e.offsetLeft,width:e.offsetWidth,height:e.offsetHeight}}function m(e,t){for(var n in t)if(t[n].test(e[n]))return!0;return!1}function g(e,t){var n=document.createEvent("Event");n.initEvent(t,!0,!0),n.pageX=e.pageX,n.pageY=e.pageY,e.target.dispatchEvent(n)}function f(e){function t(){s=document.createEvent("Event"),s.initEvent(n,o,l),a(s,r)}var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"click",i=void 0;"mouseup"===e.type||"mousecancel"===e.type?i=e:"touchend"!==e.type&&"touchcancel"!==e.type||(i=e.changedTouches[0]);var r={};i&&(r.screenX=i.screenX||0,r.screenY=i.screenY||0,r.clientX=i.clientX||0,r.clientY=i.clientY||0);var s=void 0,o=!0,l=!0;if("undefined"!=typeof MouseEvent)try{s=new MouseEvent(n,a({bubbles:o,cancelable:l},r))}catch(e){t()}else t();s.forwardedTouchEvent=!0,s._constructed=!0,e.target.dispatchEvent(s)}function h(e){f(e,"dblclick")}function _(e,t){t.firstChild?b(e,t.firstChild):t.appendChild(e)}function b(e,t){t.parentNode.insertBefore(e,t)}function v(e,t){e.removeChild(t)}function y(e,t,n,i,a,r,s){var o=e-t,l=Math.abs(o)/n,c=s.deceleration,d=s.itemHeight,u=s.swipeBounceTime,p=s.wheel,m=s.swipeTime,g=m,f=p?4:15,h=e+l/c*(o<0?-1:1);return p&&d&&(h=Math.round(h/d)*d),h<i?(h=r?Math.max(i-r/4,i-r/f*l):i,g=u):h>a&&(h=r?Math.min(a+r/4,a+r/f*l):a,g=u),{destination:Math.round(h),duration:g}}function E(){}function S(e){console.error("[BScroll warn]: "+e)}function x(e,t){if(!e)throw new Error("[BScroll] "+t)}function C(e){var t=document.createElement("div"),n=document.createElement("div");return t.style.cssText="position:absolute;z-index:9999;pointerEvents:none",n.style.cssText="box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px;",n.className="bscroll-indicator","horizontal"===e?(t.style.cssText+=";height:7px;left:2px;right:2px;bottom:0",n.style.height="100%",t.className="bscroll-horizontal-scrollbar"):(t.style.cssText+=";width:7px;bottom:2px;top:2px;right:1px",n.style.width="100%",t.className="bscroll-vertical-scrollbar"),t.style.cssText+=";overflow:hidden",t.appendChild(n),t}function T(e,t){this.wrapper=t.el,this.wrapperStyle=this.wrapper.style,this.indicator=this.wrapper.children[0],this.indicatorStyle=this.indicator.style,this.scroller=e,this.direction=t.direction,t.fade?(this.visible=0,this.wrapperStyle.opacity="0"):this.visible=1,this.sizeRatioX=1,this.sizeRatioY=1,this.maxPosX=0,this.maxPosY=0,this.x=0,this.y=0,t.interactive&&this._addDOMEvents()}function w(e){if(e&&e.classList)return e.classList.contains("tombstone")}function N(e,t){var n=this;this.options=t,x("function"==typeof this.options.createTombstone,"Infinite scroll need createTombstone Function to create tombstone"),x("function"==typeof this.options.fetch,"Infinite scroll need fetch Function to fetch new data."),x("function"==typeof this.options.render,"Infinite scroll need render Function to render each item."),this.firstAttachedItem=0,this.lastAttachedItem=0,this.anchorScrollTop=0,this.anchorItem={index:0,offset:0},this.tombstoneHeight=0,this.tombstoneWidth=0,this.tombstones=[],this.items=[],this.loadedItems=0,this.requestInProgress=!1,this.hasMore=!0,this.scroller=e,this.wrapperEl=this.scroller.wrapper,this.scrollerEl=this.scroller.scroller,this.scroller.on("scroll",function(){n.onScroll()}),this.scroller.on("resize",function(){n.onResize()}),this.onResize()}function M(e,t){this.wrapper="string"==typeof e?document.querySelector(e):e,this.wrapper||S("Can not resolve the wrapper DOM."),this.scroller=this.wrapper.children[0],this.scroller||S("The wrapper need at least one child element to be scroller."),this.scrollerStyle=this.scroller.style,this._init(e,t)}/*! * better-normal-scroll v1.12.5 * (c) 2016-2018 ustbhuangyi * Released under the MIT License. */ var D=function(){function e(e,t){var n=[],i=!0,a=!1,r=void 0;try{for(var s,o=e[Symbol.iterator]();!(i=(s=o.next()).done)&&(n.push(s.value),!t||n.length!==t);i=!0);}catch(e){a=!0,r=e}finally{try{!i&&o.return&&o.return()}finally{if(a)throw r}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),A=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)},O="undefined"!=typeof window,I=O&&navigator.userAgent.toLowerCase(),R=I&&/wechatdevtools/.test(I),k=I&&I.indexOf("android")>0,L=O&&document.createElement("div").style,P=function(){if(!O)return!1;var e={webkit:"webkitTransform",Moz:"MozTransform",O:"OTransform",ms:"msTransform",standard:"transform"};for(var t in e)if(void 0!==L[e[t]])return t;return!1}(),B=o("transform"),F=O&&o("perspective")in L,U=O&&("ontouchstart"in window||R),G=!1!==B,q=O&&o("transition")in L,$={transform:B,transitionTimingFunction:o("transitionTimingFunction"),transitionDuration:o("transitionDuration"),transitionDelay:o("transitionDelay"),transformOrigin:o("transformOrigin"),transitionEnd:o("transitionEnd")},z=1,H={touchstart:z,touchmove:z,touchend:z,mousedown:2,mousemove:2,mouseup:2},W={startX:0,startY:0,scrollX:!1,scrollY:!0,freeScroll:!1,directionLockThreshold:5,eventPassthrough:"",click:!1,tap:!1,bounce:!0,bounceTime:800,momentum:!0,momentumLimitTime:300,momentumLimitDistance:15,swipeTime:2500,swipeBounceTime:500,deceleration:.0015,flickLimitTime:200,flickLimitDistance:100,resizePolling:60,probeType:0,preventDefault:!0,preventDefaultException:{tagName:/^(INPUT|TEXTAREA|BUTTON|SELECT)$/},HWCompositing:!0,useTransition:!0,useTransform:!0,bindToWrapper:!1,disableMouse:U,disableTouch:!U,observeDOM:!0,autoBlur:!0,wheel:!1,snap:!1,scrollbar:!1,pullDownRefresh:!1,pullUpLoad:!1,mouseWheel:!1,stopPropagation:!1,zoom:!1,infinity:!1,dblclick:!1},V={swipe:{style:"cubic-bezier(0.23, 1, 0.32, 1)",fn:function(e){return 1+--e*e*e*e*e}},swipeBounce:{style:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",fn:function(e){return e*(2-e)}},bounce:{style:"cubic-bezier(0.165, 0.84, 0.44, 1)",fn:function(e){return 1- --e*e*e*e}}},j=function(){return O?window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||function(e){return window.setTimeout(e,(e.interval||100/60)/2)}:E}(),K=function(){return O?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||function(e){window.clearTimeout(e)}:E}(),Y=1,X=-1,Q=1,Z=-1,J=1,ee=3;T.prototype.handleEvent=function(e){switch(e.type){case"touchstart":case"mousedown":this._start(e);break;case"touchmove":case"mousemove":this._move(e);break;case"touchend":case"mouseup":case"touchcancel":case"mousecancel":this._end(e)}},T.prototype.refresh=function(){this._shouldShow()&&(this.transitionTime(),this._calculate(),this.updatePosition())},T.prototype.fade=function(e,t){var n=this;if(!t||this.visible){var i=e?250:500;e=e?"1":"0",this.wrapperStyle[$.transitionDuration]=i+"ms",clearTimeout(this.fadeTimeout),this.fadeTimeout=setTimeout(function(){n.wrapperStyle.opacity=e,n.visible=+e},0)}},T.prototype.updatePosition=function(){if("vertical"===this.direction){var e=Math.round(this.sizeRatioY*this.scroller.y);if(e<0){this.transitionTime(500);var t=Math.max(this.indicatorHeight+3*e,8);this.indicatorStyle.height=t+"px",e=0}else if(e>this.maxPosY){this.transitionTime(500);var n=Math.max(this.indicatorHeight-3*(e-this.maxPosY),8);this.indicatorStyle.height=n+"px",e=this.maxPosY+this.indicatorHeight-n}else this.indicatorStyle.height=this.indicatorHeight+"px";this.y=e,this.scroller.options.useTransform?this.indicatorStyle[$.transform]="translateY("+e+"px)"+this.scroller.translateZ:this.indicatorStyle.top=e+"px"}else{var i=Math.round(this.sizeRatioX*this.scroller.x);if(i<0){this.transitionTime(500);var a=Math.max(this.indicatorWidth+3*i,8);this.indicatorStyle.width=a+"px",i=0}else if(i>this.maxPosX){this.transitionTime(500);var r=Math.max(this.indicatorWidth-3*(i-this.maxPosX),8);this.indicatorStyle.width=r+"px",i=this.maxPosX+this.indicatorWidth-r}else this.indicatorStyle.width=this.indicatorWidth+"px";this.x=i,this.scroller.options.useTransform?this.indicatorStyle[$.transform]="translateX("+i+"px)"+this.scroller.translateZ:this.indicatorStyle.left=i+"px"}},T.prototype.transitionTime=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.indicatorStyle[$.transitionDuration]=e+"ms"},T.prototype.transitionTimingFunction=function(e){this.indicatorStyle[$.transitionTimingFunction]=e},T.prototype.destroy=function(){this._removeDOMEvents(),this.wrapper.parentNode.removeChild(this.wrapper)},T.prototype._start=function(e){var t=e.touches?e.touches[0]:e;e.preventDefault(),e.stopPropagation(),this.transitionTime(),this.initiated=!0,this.moved=!1,this.lastPointX=t.pageX,this.lastPointY=t.pageY,this.startTime=i(),this._handleMoveEvents(l),this.scroller.trigger("beforeScrollStart")},T.prototype._move=function(e){var t=e.touches?e.touches[0]:e;e.preventDefault(),e.stopPropagation(),this.moved||this.scroller.trigger("scrollStart"),this.moved=!0;var n=t.pageX-this.lastPointX;this.lastPointX=t.pageX;var i=t.pageY-this.lastPointY;this.lastPointY=t.pageY;var a=this.x+n,r=this.y+i;this._pos(a,r)},T.prototype._end=function(e){if(this.initiated){this.initiated=!1,e.preventDefault(),e.stopPropagation(),this._handleMoveEvents(c);var t=this.scroller.options.snap;if(t){var n=t.speed,i=t.easing,a=void 0===i?V.bounce:i,r=this.scroller._nearestSnap(this.scroller.x,this.scroller.y),s=n||Math.max(Math.max(Math.min(Math.abs(this.scroller.x-r.x),1e3),Math.min(Math.abs(this.scroller.y-r.y),1e3)),300);this.scroller.x===r.x&&this.scroller.y===r.y||(this.scroller.directionX=0,this.scroller.directionY=0,this.scroller.currentPage=r,this.scroller.scrollTo(r.x,r.y,s,a))}this.moved&&this.scroller.trigger("scrollEnd",{x:this.scroller.x,y:this.scroller.y})}},T.prototype._pos=function(e,t){e<0?e=0:e>this.maxPosX&&(e=this.maxPosX),t<0?t=0:t>this.maxPosY&&(t=this.maxPosY),e=Math.round(e/this.sizeRatioX),t=Math.round(t/this.sizeRatioY),this.scroller.scrollTo(e,t),this.scroller.trigger("scroll",{x:this.scroller.x,y:this.scroller.y})},T.prototype._shouldShow=function(){return"vertical"===this.direction&&this.scroller.hasVerticalScroll||"horizontal"===this.direction&&this.scroller.hasHorizontalScroll?(this.wrapper.style.display="",!0):(this.wrapper.style.display="none",!1)},T.prototype._calculate=function(){if("vertical"===this.direction){var e=this.wrapper.clientHeight;this.indicatorHeight=Math.max(Math.round(e*e/(this.scroller.scrollerHeight||e||1)),8),this.indicatorStyle.height=this.indicatorHeight+"px",this.maxPosY=e-this.indicatorHeight,this.sizeRatioY=this.maxPosY/this.scroller.maxScrollY}else{var t=this.wrapper.clientWidth;this.indicatorWidth=Math.max(Math.round(t*t/(this.scroller.scrollerWidth||t||1)),8),this.indicatorStyle.width=this.indicatorWidth+"px",this.maxPosX=t-this.indicatorWidth,this.sizeRatioX=this.maxPosX/this.scroller.maxScrollX}},T.prototype._addDOMEvents=function(){var e=l;this._handleDOMEvents(e)},T.prototype._removeDOMEvents=function(){var e=c;this._handleDOMEvents(e),this._handleMoveEvents(e)},T.prototype._handleMoveEvents=function(e){this.scroller.options.disableTouch||e(window,"touchmove",this),this.scroller.options.disableMouse||e(window,"mousemove",this)},T.prototype._handleDOMEvents=function(e){this.scroller.options.disableTouch||(e(this.indicator,"touchstart",this),e(window,"touchend",this)),this.scroller.options.disableMouse||(e(this.indicator,"mousedown",this),e(window,"mouseup",this))};var te=2e3;N.prototype.onScroll=function(){var e=-this.scroller.y,t=e-this.anchorScrollTop;this.anchorItem=0===e?{index:0,offset:0}:this._calculateAnchoredItem(this.anchorItem,t),this.anchorScrollTop=e;var n=this._calculateAnchoredItem(this.anchorItem,this.wrapperEl.offsetHeight),i=this.anchorItem.index,a=n.index;t<0?(i-=30,a+=10):(i-=10,a+=30),this.fill(i,a),this.maybeRequestContent()},N.prototype.onResize=function(){var e=this.options.createTombstone();e.style.position="absolute",this.scrollerEl.appendChild(e),e.style.display="",this.tombstoneHeight=e.offsetHeight,this.tombstoneWidth=e.offsetWidth,this.scrollerEl.removeChild(e);for(var t=0;t<this.items.length;t++)this.items[t].height=this.items[t].width=0;this.onScroll()},N.prototype.fill=function(e,t){this.firstAttachedItem=Math.max(0,e),this.hasMore||(t=Math.min(t,this.items.length)),this.lastAttachedItem=t,this.attachContent()},N.prototype.maybeRequestContent=function(){var e=this;if(!this.requestInProgress&&this.hasMore){var t=this.lastAttachedItem-this.loadedItems;t<=0||(this.requestInProgress=!0,this.options.fetch(t).then(function(t){if(t)e.addContent(t);else{e.hasMore=!1;var n=e._removeTombstones(),i=0;e.anchorItem.index<=e.items.length?(i=e._fixScrollPosition(),e._setupAnimations({},i),e.scroller.resetPosition(e.scroller.options.bounceTime)):(e.anchorItem.index-=n,i=e._fixScrollPosition(),e._setupAnimations({},i),e.scroller.stop(),e.scroller.resetPosition(),e.onScroll())}}))}},N.prototype.addContent=function(e){this.requestInProgress=!1;for(var t=0;t<e.length;t++)this.items.length<=this.loadedItems&&this._addItem(),this.items[this.loadedItems++].data=e[t];this.attachContent(),this.maybeRequestContent()},N.prototype.attachContent=function(){var e=this._collectUnusedNodes(),t=this._createDOMNodes(e);this._cleanupUnusedNodes(e),this._cacheNodeSize();var n=this._fixScrollPosition();this._setupAnimations(t,n)},N.prototype._removeTombstones=function(){for(var e=void 0,t=0,n=this.items.length,i=0;i<n;i++){var a=this.items[i].node,r=this.items[i].data;a&&!w(a)||r||(e||(e=i),a&&this.scrollerEl.removeChild(a))}return t=n-e,this.items.splice(e),this.lastAttachedItem=Math.min(this.lastAttachedItem,this.items.length),t},N.prototype._collectUnusedNodes=function(){for(var e=[],t=0;t<this.items.length;t++)if(t!==this.firstAttachedItem){var n=this.items[t].node;n&&(w(n)?(this.tombstones.push(n),this.tombstones[this.tombstones.length-1].style.display="none"):e.push(n)),this.items[t].node=null}else t=this.lastAttachedItem-1;return e},N.prototype._createDOMNodes=function(e){for(var t={},n=this.firstAttachedItem;n<this.lastAttachedItem;n++){for(;this.items.length<=n;)this._addItem();var i=this.items[n].node,a=this.items[n].data;if(i){if(!w(i)||!a)continue;i.style.zIndex=1,t[n]=[i,this.items[n].top-this.anchorScrollTop],this.items[n].node=null}var r=a?this.options.render(a,e.pop()):this._getTombStone();r.style.position="absolute",this.items[n].top=-1,this.scrollerEl.appendChild(r),this.items[n].node=r}return t},N.prototype._cleanupUnusedNodes=function(e){for(;e.length;)this.scrollerEl.removeChild(e.pop())},N.prototype._cacheNodeSize=function(){for(var e=this.firstAttachedItem;e<this.lastAttachedItem;e++)this.items[e].data&&!this.items[e].height&&(this.items[e].height=this.items[e].node.offsetHeight,this.items[e].width=this.items[e].node.offsetWidth)},N.prototype._fixScrollPosition=function(){this.anchorScrollTop=0;for(var e=0;e<this.anchorItem.index;e++)this.anchorScrollTop+=this.items[e].height||this.tombstoneHeight;this.anchorScrollTop+=this.anchorItem.offset;for(var t=this.anchorScrollTop-this.anchorItem.offset,n=this.anchorItem.index;n>this.firstAttachedItem;)t-=this.items[n-1].height||this.tombstoneHeight,n--;return t},N.prototype._setupAnimations=function(e,t){var n=this;for(var i in e){var a=e[i];this.items[i].node.style.transform="translateY("+(this.anchorScrollTop+a[1])+"px) scale("+this.tombstoneWidth/this.items[i].width+", "+this.tombstoneHeight/this.items[i].height+")",this.items[i].node.offsetTop,a[0].offsetTop,this.items[i].node.style.transition="transform 200ms"}for(var r=this.firstAttachedItem;r<this.lastAttachedItem;r++){var s=e[r];if(s){var o=s[0];o.style.transition="transform 200ms, opacity 200ms",o.style.transform="translateY("+t+"px) scale("+this.items[r].width/this.tombstoneWidth+", "+this.items[r].height/this.tombstoneHeight+")",o.style.opacity=0}t!==this.items[r].top&&(s||(this.items[r].node.style.transition=""),this.items[r].node.style.transform="translateY("+t+"px)"),this.items[r].top=t,t+=this.items[r].height||this.tombstoneHeight}this.scroller.maxScrollY=-(t-this.wrapperEl.offsetHeight+(this.hasMore?te:0)),setTimeout(function(){for(var t in e){var i=e[t];i[0].style.display="none",n.tombstones.push(i[0])}},200)},N.prototype._getTombStone=function(){var e=this.tombstones.pop();return e?(e.style.display="",e.style.opacity=1,e.style.transform="",e.style.transition="",e):this.options.createTombstone()},N.prototype._addItem=function(){this.items.push({data:null,node:null,height:0,width:0,top:0})},N.prototype._calculateAnchoredItem=function(e,t){if(0===t)return e;var n=e.index,i=0;if((t+=e.offset)<0){for(;t<0&&n>0&&this.items[n-1].height;)t+=this.items[n-1].height,n--;i=Math.max(-n,Math.ceil(Math.min(t,0)/this.tombstoneHeight))}else{for(;t>0&&n<this.items.length&&this.items[n].height&&this.items[n].height<t;)t-=this.items[n].height,n++;(n>=this.items.length||!this.items[n].height)&&(i=Math.floor(Math.max(t,0)/this.tombstoneHeight))}return n+=i,t-=i*this.tombstoneHeight,{index:n,offset:t}},function(e){e.prototype._init=function(e,t){this._handleOptions(t),this._events={},this.x=0,this.y=0,this.directionX=0,this.directionY=0,this.setScale(1),this._addDOMEvents(),this._initExtFeatures(),this._watchTransition(),this.options.observeDOM&&this._initDOMObserver(),this.options.autoBlur&&this._handleAutoBlur(),this.refresh(),this.options.snap||this.scrollTo(this.options.startX,this.options.startY),this.enable()},e.prototype.setScale=function(e){this.lastScale=r(this.scale)?e:this.scale,this.scale=e},e.prototype._handleOptions=function(e){this.options=a({},W,e),this.translateZ=this.options.HWCompositing&&F?" translateZ(0)":"",this.options.useTransition=this.options.useTransition&&q,this.options.useTransform=this.options.useTransform&&G,this.options.preventDefault=!this.options.eventPassthrough&&this.options.preventDefault,this.options.scrollX="horizontal"!==this.options.eventPassthrough&&this.options.scrollX,this.options.scrollY="vertical"!==this.options.eventPassthrough&&this.options.scrollY,this.options.freeScroll=this.options.freeScroll&&!this.options.eventPassthrough,this.options.directionLockThreshold=this.options.eventPassthrough?0:this.options.directionLockThreshold,!0===this.options.tap&&(this.options.tap="tap")},e.prototype._addDOMEvents=function(){var e=l;this._handleDOMEvents(e)},e.prototype._removeDOMEvents=function(){var e=c;this._handleDOMEvents(e)},e.prototype._handleDOMEvents=function(e){var t=this.options.bindToWrapper?this.wrapper:window;e(window,"orientationchange",this),e(window,"resize",this),this.options.click&&e(this.wrapper,"click",this,!0),this.options.disableMouse||(e(this.wrapper,"mousedown",this),e(t,"mousemove",this),e(t,"mousecancel",this),e(t,"mouseup",this)),U&&!this.options.disableTouch&&(e(this.wrapper,"touchstart",this),e(t,"touchmove",this),e(t,"touchcancel",this),e(t,"touchend",this)),e(this.scroller,$.transitionEnd,this)},e.prototype._initExtFeatures=function(){this.options.snap&&this._initSnap(),this.options.scrollbar&&this._initScrollbar(),this.options.pullUpLoad&&this._initPullUp(),this.options.pullDownRefresh&&this._initPullDown(),this.options.wheel&&this._initWheel(),this.options.mouseWheel&&this._initMouseWheel(),this.options.zoom&&this._initZoom(),this.options.infinity&&this._initInfinite()},e.prototype._watchTransition=function(){if("function"==typeof Object.defineProperty){var e=this,t=!1,n=this.useTransition?"isInTransition":"isAnimating";Object.defineProperty(this,n,{get:function(){return t},set:function(n){t=n;for(var i=e.scroller.children.length?e.scroller.children:[e.scroller],a=t&&!e.pulling?"none":"auto",r=0;r<i.length;r++)i[r].style.pointerEvents=a}})}},e.prototype._handleAutoBlur=function(){this.on("scrollStart",function(){var e=document.activeElement;!e||"INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName||e.blur()})},e.prototype._initDOMObserver=function(){var e=this;if("undefined"!=typeof MutationObserver){var t=void 0,n=new MutationObserver(function(n){if(!e._shouldNotRefresh()){for(var i=!1,a=!1,r=0;r<n.length;r++){var s=n[r];if("attributes"!==s.type){i=!0;break}if(s.target!==e.scroller){a=!0;break}}i?e.refresh():a&&(clearTimeout(t),t=setTimeout(function(){e._shouldNotRefresh()||e.refresh()},60))}}),i={attributes:!0,childList:!0,subtree:!0};n.observe(this.scroller,i),this.on("destroy",function(){n.disconnect()})}else this._checkDOMUpdate()},e.prototype._shouldNotRefresh=function(){var e=this.x>this.minScrollX||this.x<this.maxScrollX||this.y>this.minScrollY||this.y<this.maxScrollY;return this.isInTransition||this.stopFromTransition||e},e.prototype._checkDOMUpdate=function(){function e(){if(!this.destroyed){n=p(this.scroller);var e=n.width,r=n.height;i===e&&a===r||this.refresh(),i=e,a=r,t.call(this)}}function t(){var t=this;setTimeout(function(){e.call(t)},1e3)}var n=p(this.scroller),i=n.width,a=n.height;t.call(this)},e.prototype.handleEvent=function(e){switch(e.type){case"touchstart":case"mousedown":this._start(e),this.options.zoom&&e.touches&&e.touches.length>1&&this._zoomStart(e);break;case"touchmove":case"mousemove":this.options.zoom&&e.touches&&e.touches.length>1?this._zoom(e):this._move(e);break;case"touchend":case"mouseup":case"touchcancel":case"mousecancel":this.scaled?this._zoomEnd(e):this._end(e);break;case"orientationchange":case"resize":this._resize();break;case"transitionend":case"webkitTransitionEnd":case"oTransitionEnd":case"MSTransitionEnd":this._transitionEnd(e);break;case"click":this.enabled&&!e._constructed&&(m(e.target,this.options.preventDefaultException)||(e.preventDefault(),e.stopPropagation()));break;case"wheel":case"DOMMouseScroll":case"mousewheel":this._onMouseWheel(e)}},e.prototype.refresh=function(){var e="static"===window.getComputedStyle(this.wrapper,null).position,t=p(this.wrapper);this.wrapperWidth=t.width,this.wrapperHeight=t.height;var n=p(this.scroller);this.scrollerWidth=Math.round(n.width*this.scale),this.scrollerHeight=Math.round(n.height*this.scale),this.relativeX=n.left,this.relativeY=n.top,e&&(this.relativeX-=t.left,this.relativeY-=t.top),this.minScrollX=0,this.minScrollY=0;var i=this.options.wheel;i?(this.items=this.scroller.children,this.options.itemHeight=this.itemHeight=this.items.length?this.scrollerHeight/this.items.length:0,void 0===this.selectedIndex&&(this.selectedIndex=i.selectedIndex||0),this.options.startY=-this.selectedIndex*this.itemHeight,this.maxScrollX=0,this.maxScrollY=-this.itemHeight*(this.items.length-1)):(this.maxScrollX=this.wrapperWidth-this.scrollerWidth,this.options.infinity||(this.maxScrollY=this.wrapperHeight-this.scrollerHeight),this.maxScrollX<0?(this.maxScrollX-=this.relativeX,this.minScrollX=-this.relativeX):this.scale>1&&(this.maxScrollX=this.maxScrollX/2-this.relativeX,this.minScrollX=this.maxScrollX),this.maxScrollY<0?(this.maxScrollY-=this.relativeY,this.minScrollY=-this.relativeY):this.scale>1&&(this.maxScrollY=this.maxScrollY/2-this.relativeY,this.minScrollY=this.maxScrollY)),this.hasHorizontalScroll=this.options.scrollX&&this.maxScrollX<this.minScrollX,this.hasVerticalScroll=this.options.scrollY&&this.maxScrollY<this.minScrollY,this.hasHorizontalScroll||(this.maxScrollX=this.minScrollX,this.scrollerWidth=this.wrapperWidth),this.hasVerticalScroll||(this.maxScrollY=this.minScrollY,this.scrollerHeight=this.wrapperHeight),this.endTime=0,this.directionX=0,this.directionY=0,this.wrapperOffset=d(this.wrapper),this.trigger("refresh"),!this.scaled&&this.resetPosition()},e.prototype.enable=function(){this.enabled=!0},e.prototype.disable=function(){this.enabled=!1}}(M),function(e){e.prototype._start=function(e){var t=H[e.type];if((t===z||0===e.button)&&!(!this.enabled||this.destroyed||this.initiated&&this.initiated!==t)){this.initiated=t,this.options.preventDefault&&!m(e.target,this.options.preventDefaultException)&&e.preventDefault(),this.options.stopPropagation&&e.stopPropagation(),this.moved=!1,this.distX=0,this.distY=0,this.directionX=0,this.directionY=0,this.movingDirectionX=0,this.movingDirectionY=0,this.directionLocked=0,this._transitionTime(),this.startTime=i(),this.options.wheel&&(this.target=e.target),this.stop();var n=e.touches?e.touches[0]:e;this.startX=this.x,this.startY=this.y,this.absStartX=this.x,this.absStartY=this.y,this.pointX=n.pageX,this.pointY=n.pageY,this.trigger("beforeScrollStart")}},e.prototype._move=function(e){if(this.enabled&&!this.destroyed&&H[e.type]===this.initiated){this.options.preventDefault&&e.preventDefault(),this.options.stopPropagation&&e.stopPropagation();var t=e.touches?e.touches[0]:e,n=t.pageX-this.pointX,a=t.pageY-this.pointY;this.pointX=t.pageX,this.pointY=t.pageY,this.distX+=n,this.distY+=a;var r=Math.abs(this.distX),s=Math.abs(this.distY),o=i();if(!(o-this.endTime>this.options.momentumLimitTime&&s<this.options.momentumLimitDistance&&r<this.options.momentumLimitDistance)){if(this.directionLocked||this.options.freeScroll||(r>s+this.options.directionLockThreshold?this.directionLocked="h":s>=r+this.options.directionLockThreshold?this.directionLocked="v":this.directionLocked="n"),"h"===this.directionLocked){if("vertical"===this.options.eventPassthrough)e.preventDefault();else if("horizontal"===this.options.eventPassthrough)return void(this.initiated=!1);a=0}else if("v"===this.directionLocked){if("horizontal"===this.options.eventPassthrough)e.preventDefault();else if("vertical"===this.options.eventPassthrough)return void(this.initiated=!1);n=0}n=this.hasHorizontalScroll?n:0,a=this.hasVerticalScroll?a:0,this.movingDirectionX=n>0?Z:n<0?Q:0,this.movingDirectionY=a>0?X:a<0?Y:0;var l=this.x+n,c=this.y+a,d=!1,u=!1,p=!1,m=!1,g=this.options.bounce;!1!==g&&(d=void 0===g.top||g.top,u=void 0===g.bottom||g.bottom,p=void 0===g.left||g.left,m=void 0===g.right||g.right),(l>this.minScrollX||l<this.maxScrollX)&&(l=l>this.minScrollX&&p||l<this.maxScrollX&&m?this.x+n/3:l>this.minScrollX?this.minScrollX:this.maxScrollX),(c>this.minScrollY||c<this.maxScrollY)&&(c=c>this.minScrollY&&d||c<this.maxScrollY&&u?this.y+a/3:c>this.minScrollY?this.minScrollY:this.maxScrollY),this.moved||(this.moved=!0,this.trigger("scrollStart")),this._translate(l,c),o-this.startTime>this.options.momentumLimitTime&&(this.startTime=o,this.startX=this.x,this.startY=this.y,this.options.probeType===J&&this.trigger("scroll",{x:this.x,y:this.y})),this.options.probeType>J&&this.trigger("scroll",{x:this.x,y:this.y});var f=document.documentElement.scrollLeft||window.pageXOffset||document.body.scrollLeft,h=document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop,_=this.pointX-f,b=this.pointY-h;(_>document.documentElement.clientWidth-this.options.momentumLimitDistance||_<this.options.momentumLimitDistance||b<this.options.momentumLimitDistance||b>document.documentElement.clientHeight-this.options.momentumLimitDistance)&&this._end(e)}}},e.prototype._end=function(e){if(this.enabled&&!this.destroyed&&H[e.type]===this.initiated){this.initiated=!1,this.options.preventDefault&&!m(e.target,this.options.preventDefaultException)&&e.preventDefault(),this.options.stopPropagation&&e.stopPropagation(),this.trigger("touchEnd",{x:this.x,y:this.y}),this.isInTransition=!1;var t=Math.round(this.x),n=Math.round(this.y),a=t-this.absStartX,r=n-this.absStartY;if(this.directionX=a>0?Z:a<0?Q:0,this.directionY=r>0?X:r<0?Y:0,!this.options.pullDownRefresh||!this._checkPullDown()){if(this._checkClick(e))return void this.trigger("scrollCancel");if(!this.resetPosition(this.options.bounceTime,V.bounce)){this._translate(t,n),this.endTime=i();var s=this.endTime-this.startTime,o=Math.abs(t-this.startX),l=Math.abs(n-this.startY);if(this._events.flick&&s<this.options.flickLimitTime&&o<this.options.flickLimitDistance&&l<this.options.flickLimitDistance)return void this.trigger("flick");var c=0;if(this.options.momentum&&s<this.options.momentumLimitTime&&(l>this.options.momentumLimitDistance||o>this.options.momentumLimitDistance)){var d=!1,u=!1,p=!1,g=!1,f=this.options.bounce;!1!==f&&(d=void 0===f.top||f.top,u=void 0===f.bottom||f.bottom,p=void 0===f.left||f.left,g=void 0===f.right||f.right);var h=this.directionX===Z&&p||this.directionX===Q&&g?this.wrapperWidth:0,_=this.directionY===X&&d||this.directionY===Y&&u?this.wrapperHeight:0,b=this.hasHorizontalScroll?y(this.x,this.startX,s,this.maxScrollX,this.minScrollX,h,this.options):{destination:t,duration:0},v=this.hasVerticalScroll?y(this.y,this.startY,s,this.maxScrollY,this.minScrollY,_,this.options):{destination:n,duration:0};t=b.destination,n=v.destination,c=Math.max(b.duration,v.duration),this.isInTransition=!0}else this.options.wheel&&(n=Math.round(n/this.itemHeight)*this.itemHeight,c=this.options.wheel.adjustTime||400);var E=V.swipe;if(this.options.snap){var S=this._nearestSnap(t,n);this.currentPage=S,c=this.options.snapSpeed||Math.max(Math.max(Math.min(Math.abs(t-S.x),1e3),Math.min(Math.abs(n-S.y),1e3)),300),t=S.x,n=S.y,this.directionX=0,this.directionY=0,E=this.options.snap.easing||V.bounce}if(t!==this.x||n!==this.y)return(t>this.minScrollX||t<this.maxScrollX||n>this.minScrollY||n<this.maxScrollY)&&(E=V.swipeBounce),void this.scrollTo(t,n,c,E);this.options.wheel&&(this.selectedIndex=Math.round(Math.abs(this.y/this.itemHeight))),this.trigger("scrollEnd",{x:this.x,y:this.y})}}}},e.prototype._checkClick=function(e){var t=this.stopFromTransition&&!this.pulling;if(this.stopFromTransition=!1,!this.moved){if(this.options.wheel){if(this.target&&this.target.classList.contains(this.options.wheel.wheelWrapperClass)){var n=Math.abs(Math.round(this.y/this.itemHeight)),a=Math.round((this.pointY+u(this.wrapper).top-this.wrapperHeight/2)/this.itemHeight);this.target=this.items[n+a]}return this.scrollToElement(this.target,this.options.wheel.adjustTime||400,!0,!0,V.swipe),!0}if(!t){var r=this.options.dblclick,s=!1;if(r&&this.lastClickTime){var o=r.delay,l=void 0===o?300:o;i()-this.lastClickTime<l&&(s=!0,h(e))}return this.options.tap&&g(e,this.options.tap),this.options.click&&!m(e.target,this.options.preventDefaultException)&&f(e),this.lastClickTime=s?null:i(),!0}return!1}return!1},e.prototype._resize=function(){var e=this;this.enabled&&(k&&(this.wrapper.scrollTop=0),clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeou