UNPKG

refreshable

Version:

a pull to refresh component for vue

25 lines (23 loc) 112 kB
function t(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,i)}return o}function e(e){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?t(Object(i),!0).forEach((function(t){r(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e,o,i,n,r,s){try{var a=t[r](s),l=a.value}catch(t){return void o(t)}a.done?e(l):Promise.resolve(l).then(i,n)}function n(t){return function(){var e=this,o=arguments;return new Promise((function(n,r){var s=t.apply(e,o);function a(t){i(s,n,r,a,l,"next",t)}function l(t){i(s,n,r,a,l,"throw",t)}a(void 0)}))}}function r(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t} /*! * better-scroll / core * (c) 2016-2021 ustbhuangyi * Released under the MIT License. */ /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var s=function(t,e){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)};function a(t,e){function o(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}var l=function(){return(l=Object.assign||function(t){for(var e,o=1,i=arguments.length;o<i;o++)for(var n in e=arguments[o])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};function h(){for(var t=0,e=0,o=arguments.length;e<o;e++)t+=arguments[e].length;var i=Array(t),n=0;for(e=0;e<o;e++)for(var r=arguments[e],s=0,a=r.length;s<a;s++,n++)i[n]=r[s];return i}var c=[{sourceKey:"scroller.scrollBehaviorX.currentPos",key:"x"},{sourceKey:"scroller.scrollBehaviorY.currentPos",key:"y"},{sourceKey:"scroller.scrollBehaviorX.hasScroll",key:"hasHorizontalScroll"},{sourceKey:"scroller.scrollBehaviorY.hasScroll",key:"hasVerticalScroll"},{sourceKey:"scroller.scrollBehaviorX.contentSize",key:"scrollerWidth"},{sourceKey:"scroller.scrollBehaviorY.contentSize",key:"scrollerHeight"},{sourceKey:"scroller.scrollBehaviorX.maxScrollPos",key:"maxScrollX"},{sourceKey:"scroller.scrollBehaviorY.maxScrollPos",key:"maxScrollY"},{sourceKey:"scroller.scrollBehaviorX.minScrollPos",key:"minScrollX"},{sourceKey:"scroller.scrollBehaviorY.minScrollPos",key:"minScrollY"},{sourceKey:"scroller.scrollBehaviorX.movingDirection",key:"movingDirectionX"},{sourceKey:"scroller.scrollBehaviorY.movingDirection",key:"movingDirectionY"},{sourceKey:"scroller.scrollBehaviorX.direction",key:"directionX"},{sourceKey:"scroller.scrollBehaviorY.direction",key:"directionY"},{sourceKey:"scroller.actions.enabled",key:"enabled"},{sourceKey:"scroller.animater.pending",key:"pending"},{sourceKey:"scroller.animater.stop",key:"stop"},{sourceKey:"scroller.scrollTo",key:"scrollTo"},{sourceKey:"scroller.scrollBy",key:"scrollBy"},{sourceKey:"scroller.scrollToElement",key:"scrollToElement"},{sourceKey:"scroller.resetPosition",key:"resetPosition"}];function u(t){console.error("[BScroll warn]: "+t)}var p="undefined"!=typeof window,d=p&&navigator.userAgent.toLowerCase(),f=!(!d||!/wechatdevtools/.test(d)),v=d&&d.indexOf("android")>0,y=function(){if("string"==typeof d){var t=/os (\d\d?_\d(_\d)?)/.exec(d);if(!t)return!1;var e=t[1].split("_").map((function(t){return parseInt(t,10)}));return!!(13===e[0]&&e[1]>=4)}return!1}(),m=!1;if(p){try{var g={};Object.defineProperty(g,"passive",{get:function(){m=!0}}),window.addEventListener("test-passive",(function(){}),g)}catch(Ue){}}function w(){return window.performance&&window.performance.now&&window.performance.timing?window.performance.now()+window.performance.timing.navigationStart:+new Date}var k=function(t,e){for(var o in e)t[o]=e[o];return t};function T(t){return null==t}function b(t,e,o){return t<e?e:t>o?o:t}var S=p&&document.createElement("div").style,P=function(){if(!p)return!1;for(var t=0,e=[{key:"standard",value:"transform"},{key:"webkit",value:"webkitTransform"},{key:"Moz",value:"MozTransform"},{key:"O",value:"OTransform"},{key:"ms",value:"msTransform"}];t<e.length;t++){var o=e[t];if(void 0!==S[o.value])return o.key}return!1}();function x(t){return!1===P?t:"standard"===P?"transitionEnd"===t?"transitionend":t:P+t.charAt(0).toUpperCase()+t.substr(1)}function _(t){return"string"==typeof t?document.querySelector(t):t}function E(t,e,o,i){var n=m?{passive:!1,capture:!!i}:!!i;t.addEventListener(e,o,n)}function C(t,e,o,i){t.removeEventListener(e,o,{capture:!!i})}function D(t){for(var e=0,o=0;t;)e-=t.offsetLeft,o-=t.offsetTop,t=t.offsetParent;return{left:e,top:o}}P&&"standard"!==P&&P.toLowerCase();var M=x("transform"),B=x("transition"),O=p&&x("perspective")in S,L=p&&("ontouchstart"in window||f),Y=p&&B in S,H={transform:M,transition:B,transitionTimingFunction:x("transitionTimingFunction"),transitionDuration:x("transitionDuration"),transitionDelay:x("transitionDelay"),transformOrigin:x("transformOrigin"),transitionEnd:x("transitionEnd"),transitionProperty:x("transitionProperty")},X={touchstart:1,touchmove:1,touchend:1,touchcancel:1,mousedown:2,mousemove:2,mouseup:2};function z(t){if(t instanceof window.SVGElement){var e=t.getBoundingClientRect();return{top:e.top,left:e.left,width:e.width,height:e.height}}return{top:t.offsetTop,left:t.offsetLeft,width:t.offsetWidth,height:t.offsetHeight}}function A(t,e){for(var o in e)if(e[o].test(t[o]))return!0;return!1}var N=A;function R(t,e){var o;void 0===e&&(e="click"),"mouseup"===t.type?o=t:"touchend"!==t.type&&"touchcancel"!==t.type||(o=t.changedTouches[0]);var i,n={};o&&(n.screenX=o.screenX||0,n.screenY=o.screenY||0,n.clientX=o.clientX||0,n.clientY=o.clientY||0);var r={ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey};if("undefined"!=typeof MouseEvent)try{i=new MouseEvent(e,k(l({bubbles:true,cancelable:true},r),n))}catch(t){s()}else s();function s(){(i=document.createEvent("Event")).initEvent(e,true,true),k(i,n)}i.forwardedTouchEvent=!0,i._constructed=!0,t.target.dispatchEvent(i)}var F={swipe:{style:"cubic-bezier(0.23, 1, 0.32, 1)",fn:function(t){return 1+--t*t*t*t*t}},swipeBounce:{style:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",fn:function(t){return t*(2-t)}},bounce:{style:"cubic-bezier(0.165, 0.84, 0.44, 1)",fn:function(t){return 1- --t*t*t*t}}},I=p&&window;function j(){}var U=p?I.requestAnimationFrame||I.webkitRequestAnimationFrame||I.mozRequestAnimationFrame||I.oRequestAnimationFrame||function(t){return window.setTimeout(t,t.interval||16.666666666666668)}:j,$=p?I.cancelAnimationFrame||I.webkitCancelAnimationFrame||I.mozCancelAnimationFrame||I.oCancelAnimationFrame||function(t){window.clearTimeout(t)}:j,W=function(t){},K={enumerable:!0,configurable:!0,get:W,set:W};function V(t,e,i){K.get=function(){return function(t,e){for(var i=e.split("."),n=0;n<i.length-1;n++)if("object"!==o(t=t[i[n]])||!t)return;var r=i.pop();return"function"==typeof t[r]?function(){return t[r].apply(t,arguments)}:t[r]}(this,e)},K.set=function(t){!function(t,e,o){for(var i,n=e.split("."),r=0;r<n.length-1;r++)t[i=n[r]]||(t[i]={}),t=t[i];t[n.pop()]=o}(this,e,t)},Object.defineProperty(t,i,K)}var q=function(){function t(t){this.events={},this.eventTypes={},this.registerType(t)}return t.prototype.on=function(t,e,o){return void 0===o&&(o=this),this.hasType(t),this.events[t]||(this.events[t]=[]),this.events[t].push([e,o]),this},t.prototype.once=function(t,e,o){var i=this;void 0===o&&(o=this),this.hasType(t);var n=function n(){for(var r=[],s=0;s<arguments.length;s++)r[s]=arguments[s];i.off(t,n);var a=e.apply(o,r);if(!0===a)return a};return n.fn=e,this.on(t,n),this},t.prototype.off=function(t,e){if(!t&&!e)return this.events={},this;if(t){if(this.hasType(t),!e)return this.events[t]=[],this;var o=this.events[t];if(!o)return this;for(var i=o.length;i--;)(o[i][0]===e||o[i][0]&&o[i][0].fn===e)&&o.splice(i,1);return this}},t.prototype.trigger=function(t){for(var e=[],o=1;o<arguments.length;o++)e[o-1]=arguments[o];this.hasType(t);var i=this.events[t];if(i)for(var n,r=i.length,s=h(i),a=0;a<r;a++){var l=s[a],c=l[0],u=l[1];if(c&&!0===(n=c.apply(u,e)))return n}},t.prototype.registerType=function(t){var e=this;t.forEach((function(t){e.eventTypes[t]=t}))},t.prototype.destroy=function(){this.events={},this.eventTypes={}},t.prototype.hasType=function(t){var e=this.eventTypes;e[t]===t||u('EventEmitter has used unknown event type: "'+t+'", should be oneof ['+Object.keys(e).map((function(t){return JSON.stringify(t)}))+"]")},t}(),J=function(){function t(t,e){this.wrapper=t,this.events=e,this.addDOMEvents()}return t.prototype.destroy=function(){this.removeDOMEvents(),this.events=[]},t.prototype.addDOMEvents=function(){this.handleDOMEvents(E)},t.prototype.removeDOMEvents=function(){this.handleDOMEvents(C)},t.prototype.handleDOMEvents=function(t){var e=this,o=this.wrapper;this.events.forEach((function(i){t(o,i.name,e,!!i.capture)}))},t.prototype.handleEvent=function(t){var e=t.type;this.events.some((function(o){return o.name===e&&(o.handler(t),!0)}))},t}(),G=function(t){function e(){var e=t.call(this)||this;return e.startX=0,e.startY=0,e.scrollX=!1,e.scrollY=!0,e.freeScroll=!1,e.directionLockThreshold=0,e.eventPassthrough="",e.click=!1,e.dblclick=!1,e.tap="",e.bounce={top:!0,bottom:!0,left:!0,right:!0},e.bounceTime=800,e.momentum=!0,e.momentumLimitTime=300,e.momentumLimitDistance=15,e.swipeTime=2500,e.swipeBounceTime=500,e.deceleration=.0015,e.flickLimitTime=200,e.flickLimitDistance=100,e.resizePolling=60,e.probeType=0,e.stopPropagation=!1,e.preventDefault=!0,e.preventDefaultException={tagName:/^(INPUT|TEXTAREA|BUTTON|SELECT|AUDIO)$/},e.tagException={tagName:/^TEXTAREA$/},e.HWCompositing=!0,e.useTransition=!0,e.bindToWrapper=!1,e.bindToTarget=!1,e.disableMouse=L,e.disableTouch=!L,e.autoBlur=!0,e.autoEndDistance=5,e.outOfBoundaryDampingFactor=1/3,e.specifiedIndexAsContent=0,e.quadrant=1,e}return a(e,t),e.prototype.merge=function(t){if(!t)return this;for(var e in t)"bounce"!==e?this[e]=t[e]:this.bounce=this.resolveBounce(t[e]);return this},e.prototype.process=function(){return this.translateZ=this.HWCompositing&&O?" translateZ(1px)":"",this.useTransition=this.useTransition&&Y,this.preventDefault=!this.eventPassthrough&&this.preventDefault,this.scrollX="horizontal"!==this.eventPassthrough&&this.scrollX,this.scrollY="vertical"!==this.eventPassthrough&&this.scrollY,this.freeScroll=this.freeScroll&&!this.eventPassthrough,this.scrollX=!!this.freeScroll||this.scrollX,this.scrollY=!!this.freeScroll||this.scrollY,this.directionLockThreshold=this.eventPassthrough?0:this.directionLockThreshold,this},e.prototype.resolveBounce=function(t){var e={top:!0,right:!0,bottom:!0,left:!0};return"object"===o(t)?k(e,t):t?e:{top:!1,right:!1,bottom:!1,left:!1}},e}((function(){})),Z=function(){function t(t,e){this.wrapper=t,this.options=e,this.hooks=new q(["beforeStart","start","move","end","click"]),this.handleDOMEvents()}return t.prototype.handleDOMEvents=function(){var t=this.options,e=t.bindToWrapper,o=t.disableMouse,i=t.disableTouch,n=t.click,r=this.wrapper,s=e?r:window,a=[],l=[],h=!i,c=!o;n&&a.push({name:"click",handler:this.click.bind(this),capture:!0}),h&&(a.push({name:"touchstart",handler:this.start.bind(this)}),l.push({name:"touchmove",handler:this.move.bind(this)},{name:"touchend",handler:this.end.bind(this)},{name:"touchcancel",handler:this.end.bind(this)})),c&&(a.push({name:"mousedown",handler:this.start.bind(this)}),l.push({name:"mousemove",handler:this.move.bind(this)},{name:"mouseup",handler:this.end.bind(this)})),this.wrapperEventRegister=new J(r,a),this.targetEventRegister=new J(s,l)},t.prototype.beforeHandler=function(t,e){var o=this.options,i=o.preventDefault,n=o.stopPropagation,r=o.preventDefaultException;({start:function(){return i&&!A(t.target,r)},end:function(){return i&&!A(t.target,r)},move:function(){return i}})[e]()&&t.preventDefault(),n&&t.stopPropagation()},t.prototype.setInitiated=function(t){void 0===t&&(t=0),this.initiated=t},t.prototype.start=function(t){var e=X[t.type];if(!this.initiated||this.initiated===e)if(this.setInitiated(e),N(t.target,this.options.tagException))this.setInitiated();else if((2!==e||0===t.button)&&!this.hooks.trigger(this.hooks.eventTypes.beforeStart,t)){this.beforeHandler(t,"start");var o=t.touches?t.touches[0]:t;this.pointX=o.pageX,this.pointY=o.pageY,this.hooks.trigger(this.hooks.eventTypes.start,t)}},t.prototype.move=function(t){if(X[t.type]===this.initiated){this.beforeHandler(t,"move");var e=t.touches?t.touches[0]:t,o=e.pageX-this.pointX,i=e.pageY-this.pointY;if(this.pointX=e.pageX,this.pointY=e.pageY,!this.hooks.trigger(this.hooks.eventTypes.move,{deltaX:o,deltaY:i,e:t})){var n=document.documentElement.scrollLeft||window.pageXOffset||document.body.scrollLeft,r=document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop,s=this.pointX-n,a=this.pointY-r,l=this.options.autoEndDistance;(s>document.documentElement.clientWidth-l||a>document.documentElement.clientHeight-l||s<l||a<l)&&this.end(t)}}},t.prototype.end=function(t){X[t.type]===this.initiated&&(this.setInitiated(),this.beforeHandler(t,"end"),this.hooks.trigger(this.hooks.eventTypes.end,t))},t.prototype.click=function(t){this.hooks.trigger(this.hooks.eventTypes.click,t)},t.prototype.setContent=function(t){t!==this.wrapper&&(this.wrapper=t,this.rebindDOMEvents())},t.prototype.rebindDOMEvents=function(){this.wrapperEventRegister.destroy(),this.targetEventRegister.destroy(),this.handleDOMEvents()},t.prototype.destroy=function(){this.wrapperEventRegister.destroy(),this.targetEventRegister.destroy(),this.hooks.destroy()},t}(),Q={x:["translateX","px"],y:["translateY","px"]},tt=function(){function t(t){this.setContent(t),this.hooks=new q(["beforeTranslate","translate"])}return t.prototype.getComputedPosition=function(){var t=window.getComputedStyle(this.content,null)[H.transform].split(")")[0].split(", ");return{x:+(t[12]||t[4])||0,y:+(t[13]||t[5])||0}},t.prototype.translate=function(t){var e=[];Object.keys(t).forEach((function(o){if(Q[o]){var i=Q[o][0];if(i){var n=Q[o][1],r=t[o];e.push(i+"("+r+n+")")}}})),this.hooks.trigger(this.hooks.eventTypes.beforeTranslate,e,t),this.style[H.transform]=e.join(" "),this.hooks.trigger(this.hooks.eventTypes.translate,t)},t.prototype.setContent=function(t){this.content!==t&&(this.content=t,this.style=t.style)},t.prototype.destroy=function(){this.hooks.destroy()},t}(),et=function(){function t(t,e,o){this.translater=e,this.options=o,this.timer=0,this.hooks=new q(["move","end","beforeForceStop","forceStop","callStop","time","timeFunction"]),this.setContent(t)}return t.prototype.translate=function(t){this.translater.translate(t)},t.prototype.setPending=function(t){this.pending=t},t.prototype.setForceStopped=function(t){this.forceStopped=t},t.prototype.setCallStop=function(t){this.callStopWhenPending=t},t.prototype.setContent=function(t){this.content!==t&&(this.content=t,this.style=t.style,this.stop())},t.prototype.clearTimer=function(){this.timer&&($(this.timer),this.timer=0)},t.prototype.destroy=function(){this.hooks.destroy(),$(this.timer)},t}(),ot=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.startProbe=function(t,e){var o=this,i=t;this.callStopWhenPending&&this.setCallStop(!1),$(this.timer),function n(){var r=o.translater.getComputedPosition();(function(t,e,o,i){var n=function(t,e){var o=t-e;return o>0?-1:o<0?1:0},r=n(e.x,t.x),s=n(e.y,t.y),a=o.x-i.x,l=o.y-i.y;return r*a<=0&&s*l<=0})(t,e,r,i)&&o.hooks.trigger(o.hooks.eventTypes.move,r),o.pending||(o.callStopWhenPending?o.callStopWhenPending=!1:o.hooks.trigger(o.hooks.eventTypes.end,r)),i=r,o.pending&&(o.timer=U(n))}()},e.prototype.transitionTime=function(t){void 0===t&&(t=0),this.style[H.transitionDuration]=t+"ms",this.hooks.trigger(this.hooks.eventTypes.time,t)},e.prototype.transitionTimingFunction=function(t){this.style[H.transitionTimingFunction]=t,this.hooks.trigger(this.hooks.eventTypes.timeFunction,t)},e.prototype.transitionProperty=function(){this.style[H.transitionProperty]=H.transform},e.prototype.move=function(t,e,o,i){this.setPending(o>0),this.transitionTimingFunction(i),this.transitionProperty(),this.transitionTime(o),this.translate(e);var n=3===this.options.probeType;o&&n&&this.startProbe(t,e),o||(this._reflow=this.content.offsetHeight,n&&this.hooks.trigger(this.hooks.eventTypes.move,e),this.hooks.trigger(this.hooks.eventTypes.end,e))},e.prototype.doStop=function(){var t=this.pending;if(this.setForceStopped(!1),this.setCallStop(!1),t){this.setPending(!1),$(this.timer);var e=this.translater.getComputedPosition(),o=e.x,i=e.y;this.transitionTime(),this.translate({x:o,y:i}),this.setForceStopped(!0),this.setCallStop(!0),this.hooks.trigger(this.hooks.eventTypes.forceStop,{x:o,y:i})}return t},e.prototype.stop=function(){this.doStop()&&this.hooks.trigger(this.hooks.eventTypes.callStop)},e}(et),it=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.move=function(t,e,o,i){if(!o)return this.translate(e),3===this.options.probeType&&this.hooks.trigger(this.hooks.eventTypes.move,e),void this.hooks.trigger(this.hooks.eventTypes.end,e);this.animate(t,e,o,i)},e.prototype.animate=function(t,e,o,i){var n=this,r=w(),s=r+o,a=3===this.options.probeType;this.setPending(!0),this.callStopWhenPending&&this.setCallStop(!1),$(this.timer),function l(){var h=w();if(h>=s)return n.translate(e),a&&n.hooks.trigger(n.hooks.eventTypes.move,e),void n.hooks.trigger(n.hooks.eventTypes.end,e);var c=i(h=(h-r)/o),u={};Object.keys(e).forEach((function(o){var i=t[o],n=e[o];u[o]=(n-i)*c+i})),n.translate(u),a&&n.hooks.trigger(n.hooks.eventTypes.move,u),n.pending&&(n.timer=U(l)),n.pending||(n.callStopWhenPending?n.callStopWhenPending=!1:n.hooks.trigger(n.hooks.eventTypes.end,e))}()},e.prototype.doStop=function(){var t=this.pending;if(this.setForceStopped(!1),this.setCallStop(!1),t){this.setPending(!1),$(this.timer);var e=this.translater.getComputedPosition();this.setForceStopped(!0),this.setCallStop(!0),this.hooks.trigger(this.hooks.eventTypes.forceStop,e)}return t},e.prototype.stop=function(){this.doStop()&&this.hooks.trigger(this.hooks.eventTypes.callStop)},e}(et);var nt,rt,st,at,lt=function(){function t(t,e,o){this.wrapper=t,this.options=o,this.hooks=new q(["beforeComputeBoundary","computeBoundary","momentum","end","ignoreHasScroll"]),this.refresh(e)}return t.prototype.start=function(){this.dist=0,this.setMovingDirection(0),this.setDirection(0)},t.prototype.move=function(t){return t=this.hasScroll?t:0,this.setMovingDirection(t),this.performDampingAlgorithm(t,this.options.outOfBoundaryDampingFactor)},t.prototype.setMovingDirection=function(t){this.movingDirection=t>0?-1:t<0?1:0},t.prototype.setDirection=function(t){this.direction=t>0?-1:t<0?1:0},t.prototype.performDampingAlgorithm=function(t,e){var o=this.currentPos+t;return(o>this.minScrollPos||o<this.maxScrollPos)&&(o=o>this.minScrollPos&&this.options.bounces[0]||o<this.maxScrollPos&&this.options.bounces[1]?this.currentPos+t*e:o>this.minScrollPos?this.minScrollPos:this.maxScrollPos),o},t.prototype.end=function(t){var e={duration:0},o=Math.abs(this.currentPos-this.startPos);if(this.options.momentum&&t<this.options.momentumLimitTime&&o>this.options.momentumLimitDistance){var i=-1===this.direction&&this.options.bounces[0]||1===this.direction&&this.options.bounces[1]?this.wrapperSize:0;e=this.hasScroll?this.momentum(this.currentPos,this.startPos,t,this.maxScrollPos,this.minScrollPos,i,this.options):{destination:this.currentPos,duration:0}}else this.hooks.trigger(this.hooks.eventTypes.end,e);return e},t.prototype.momentum=function(t,e,o,i,n,r,s){void 0===s&&(s=this.options);var a=t-e,l=Math.abs(a)/o,h=s.deceleration,c=s.swipeBounceTime,u=s.swipeTime,p={destination:t+l*l/h*(a<0?-1:1),duration:Math.min(u,2*l/h),rate:15};return this.hooks.trigger(this.hooks.eventTypes.momentum,p,a),p.destination<i?(p.destination=r?Math.max(i-r/4,i-r/p.rate*l):i,p.duration=c):p.destination>n&&(p.destination=r?Math.min(n+r/4,n+r/p.rate*l):n,p.duration=c),p.destination=Math.round(p.destination),p},t.prototype.updateDirection=function(){var t=this.currentPos-this.absStartPos;this.setDirection(t)},t.prototype.refresh=function(t){var e=this.options.rect,o=e.size,i=e.position,n="static"===window.getComputedStyle(this.wrapper,null).position,r=z(this.wrapper);this.wrapperSize=this.wrapper["width"===o?"clientWidth":"clientHeight"],this.setContent(t);var s=z(this.content);this.contentSize=s[o],this.relativeOffset=s[i],n&&(this.relativeOffset-=r[i]),this.computeBoundary(),this.setDirection(0)},t.prototype.setContent=function(t){t!==this.content&&(this.content=t,this.resetState())},t.prototype.resetState=function(){this.currentPos=0,this.startPos=0,this.dist=0,this.setDirection(0),this.setMovingDirection(0),this.resetStartPos()},t.prototype.computeBoundary=function(){this.hooks.trigger(this.hooks.eventTypes.beforeComputeBoundary);var t={minScrollPos:0,maxScrollPos:this.wrapperSize-this.contentSize};t.maxScrollPos<0&&(t.maxScrollPos-=this.relativeOffset,0===this.options.specifiedIndexAsContent&&(t.minScrollPos=-this.relativeOffset)),this.hooks.trigger(this.hooks.eventTypes.computeBoundary,t),this.minScrollPos=t.minScrollPos,this.maxScrollPos=t.maxScrollPos,this.hasScroll=this.options.scrollable&&this.maxScrollPos<this.minScrollPos,!this.hasScroll&&this.minScrollPos<this.maxScrollPos&&(this.maxScrollPos=this.minScrollPos,this.contentSize=this.wrapperSize)},t.prototype.updatePosition=function(t){this.currentPos=t},t.prototype.getCurrentPos=function(){return this.currentPos},t.prototype.checkInBoundary=function(){var t=this.adjustPosition(this.currentPos);return{position:t,inBoundary:t===this.getCurrentPos()}},t.prototype.adjustPosition=function(t){return this.hasScroll||this.hooks.trigger(this.hooks.eventTypes.ignoreHasScroll)?t>this.minScrollPos?t=this.minScrollPos:t<this.maxScrollPos&&(t=this.maxScrollPos):t=this.minScrollPos,t},t.prototype.updateStartPos=function(){this.startPos=this.currentPos},t.prototype.updateAbsStartPos=function(){this.absStartPos=this.currentPos},t.prototype.resetStartPos=function(){this.updateStartPos(),this.updateAbsStartPos()},t.prototype.getAbsDist=function(t){return this.dist+=t,Math.abs(this.dist)},t.prototype.destroy=function(){this.hooks.destroy()},t}(),ht=((nt={}).yes=function(t){return!0},nt.no=function(t){return t.preventDefault(),!1},nt),ct=((rt={}).horizontal=((st={}).yes="horizontal",st.no="vertical",st),rt.vertical=((at={}).yes="vertical",at.no="horizontal",at),rt),ut=function(){function t(t,e,o){this.directionLockThreshold=t,this.freeScroll=e,this.eventPassthrough=o,this.reset()}return t.prototype.reset=function(){this.directionLocked=""},t.prototype.checkMovingDirection=function(t,e,o){return this.computeDirectionLock(t,e),this.handleEventPassthrough(o)},t.prototype.adjustDelta=function(t,e){return"horizontal"===this.directionLocked?e=0:"vertical"===this.directionLocked&&(t=0),{deltaX:t,deltaY:e}},t.prototype.computeDirectionLock=function(t,e){""!==this.directionLocked||this.freeScroll||(t>e+this.directionLockThreshold?this.directionLocked="horizontal":e>=t+this.directionLockThreshold?this.directionLocked="vertical":this.directionLocked="none")},t.prototype.handleEventPassthrough=function(t){var e=ct[this.directionLocked];if(e){if(this.eventPassthrough===e.yes)return ht.yes(t);if(this.eventPassthrough===e.no)return ht.no(t)}return!1},t}(),pt=function(){function t(t,e,o,i,n){this.hooks=new q(["start","beforeMove","scrollStart","scroll","beforeEnd","end","scrollEnd","contentNotMoved","detectMovingDirection","coordinateTransformation"]),this.scrollBehaviorX=t,this.scrollBehaviorY=e,this.actionsHandler=o,this.animater=i,this.options=n,this.directionLockAction=new ut(n.directionLockThreshold,n.freeScroll,n.eventPassthrough),this.enabled=!0,this.bindActionsHandler()}return t.prototype.bindActionsHandler=function(){var t=this;this.actionsHandler.hooks.on(this.actionsHandler.hooks.eventTypes.start,(function(e){return!t.enabled||t.handleStart(e)})),this.actionsHandler.hooks.on(this.actionsHandler.hooks.eventTypes.move,(function(e){var o=e.deltaX,i=e.deltaY,n=e.e;if(!t.enabled)return!0;var r=function(t,e,o){return 2===o?[e,-t]:3===o?[-t,-e]:4===o?[-e,t]:[t,e]}(o,i,t.options.quadrant),s={deltaX:r[0],deltaY:r[1]};return t.hooks.trigger(t.hooks.eventTypes.coordinateTransformation,s),t.handleMove(s.deltaX,s.deltaY,n)})),this.actionsHandler.hooks.on(this.actionsHandler.hooks.eventTypes.end,(function(e){return!t.enabled||t.handleEnd(e)})),this.actionsHandler.hooks.on(this.actionsHandler.hooks.eventTypes.click,(function(e){t.enabled&&!e._constructed&&t.handleClick(e)}))},t.prototype.handleStart=function(t){var e=w();this.fingerMoved=!1,this.contentMoved=!1,this.startTime=e,this.directionLockAction.reset(),this.scrollBehaviorX.start(),this.scrollBehaviorY.start(),this.animater.doStop(),this.scrollBehaviorX.resetStartPos(),this.scrollBehaviorY.resetStartPos(),this.hooks.trigger(this.hooks.eventTypes.start,t)},t.prototype.handleMove=function(t,e,o){if(!this.hooks.trigger(this.hooks.eventTypes.beforeMove,o)){var i=this.scrollBehaviorX.getAbsDist(t),n=this.scrollBehaviorY.getAbsDist(e),r=w();if(this.checkMomentum(i,n,r))return!0;if(this.directionLockAction.checkMovingDirection(i,n,o))return this.actionsHandler.setInitiated(),!0;var s=this.directionLockAction.adjustDelta(t,e),a=this.scrollBehaviorX.getCurrentPos(),l=this.scrollBehaviorX.move(s.deltaX),h=this.scrollBehaviorY.getCurrentPos(),c=this.scrollBehaviorY.move(s.deltaY);if(!this.hooks.trigger(this.hooks.eventTypes.detectMovingDirection)){this.fingerMoved||(this.fingerMoved=!0);var u=l!==a||c!==h;this.contentMoved||u||this.hooks.trigger(this.hooks.eventTypes.contentNotMoved),!this.contentMoved&&u&&(this.contentMoved=!0,this.hooks.trigger(this.hooks.eventTypes.scrollStart)),this.contentMoved&&u&&(this.animater.translate({x:l,y:c}),this.dispatchScroll(r))}}},t.prototype.dispatchScroll=function(t){t-this.startTime>this.options.momentumLimitTime&&(this.startTime=t,this.scrollBehaviorX.updateStartPos(),this.scrollBehaviorY.updateStartPos(),1===this.options.probeType&&this.hooks.trigger(this.hooks.eventTypes.scroll,this.getCurrentPos())),this.options.probeType>1&&this.hooks.trigger(this.hooks.eventTypes.scroll,this.getCurrentPos())},t.prototype.checkMomentum=function(t,e,o){return o-this.endTime>this.options.momentumLimitTime&&e<this.options.momentumLimitDistance&&t<this.options.momentumLimitDistance},t.prototype.handleEnd=function(t){if(!this.hooks.trigger(this.hooks.eventTypes.beforeEnd,t)){var e=this.getCurrentPos();if(this.scrollBehaviorX.updateDirection(),this.scrollBehaviorY.updateDirection(),this.hooks.trigger(this.hooks.eventTypes.end,t,e))return!0;e=this.ensureIntegerPos(e),this.animater.translate(e),this.endTime=w();var o=this.endTime-this.startTime;this.hooks.trigger(this.hooks.eventTypes.scrollEnd,e,o)}},t.prototype.ensureIntegerPos=function(t){this.ensuringInteger=!0;var e=t.x,o=t.y,i=this.scrollBehaviorX,n=i.minScrollPos,r=i.maxScrollPos,s=this.scrollBehaviorY,a=s.minScrollPos,l=s.maxScrollPos;return e=e>0?Math.ceil(e):Math.floor(e),o=o>0?Math.ceil(o):Math.floor(o),{x:e=b(e,r,n),y:o=b(o,l,a)}},t.prototype.handleClick=function(t){A(t.target,this.options.preventDefaultException)||(t.preventDefault(),t.stopPropagation())},t.prototype.getCurrentPos=function(){return{x:this.scrollBehaviorX.getCurrentPos(),y:this.scrollBehaviorY.getCurrentPos()}},t.prototype.refresh=function(){this.endTime=0},t.prototype.destroy=function(){this.hooks.destroy()},t}();function dt(t,e,o,i){var n=["momentum","momentumLimitTime","momentumLimitDistance","deceleration","swipeBounceTime","swipeTime","outOfBoundaryDampingFactor","specifiedIndexAsContent"].reduce((function(e,o){return e[o]=t[o],e}),{});return n.scrollable=!!t[e],n.bounces=o,n.rect=i,n}function ft(t,e,o){o.forEach((function(o){var i,n;"string"==typeof o?i=n=o:(i=o.source,n=o.target),t.on(i,(function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];return e.trigger.apply(e,h([n],t))}))}))}var vt=function(){function t(t,e,o){this.wrapper=t,this.content=e,this.resizeTimeout=0,this.hooks=new q(["beforeStart","beforeMove","beforeScrollStart","scrollStart","scroll","beforeEnd","scrollEnd","resize","touchEnd","end","flick","scrollCancel","momentum","scrollTo","minDistanceScroll","scrollToElement","beforeRefresh"]),this.options=o;var i,n=this.options.bounce,r=n.left,s=n.right,a=n.top,l=n.bottom;this.scrollBehaviorX=new lt(t,e,dt(o,"scrollX",[r,s],{size:"width",position:"left"})),this.scrollBehaviorY=new lt(t,e,dt(o,"scrollY",[a,l],{size:"height",position:"top"})),this.translater=new tt(this.content),this.animater=function(t,e,o){var i=o.useTransition,n={};return Object.defineProperty(n,"probeType",{enumerable:!0,configurable:!1,get:function(){return o.probeType}}),i?new ot(t,e,n):new it(t,e,n)}(this.content,this.translater,this.options),this.actionsHandler=new Z(this.options.bindToTarget?this.content:t,(i=this.options,["click","bindToWrapper","disableMouse","disableTouch","preventDefault","stopPropagation","tagException","preventDefaultException","autoEndDistance"].reduce((function(t,e){return t[e]=i[e],t}),{}))),this.actions=new pt(this.scrollBehaviorX,this.scrollBehaviorY,this.actionsHandler,this.animater,this.options);var h=this.resize.bind(this);this.resizeRegister=new J(window,[{name:"orientationchange",handler:h},{name:"resize",handler:h}]),this.registerTransitionEnd(),this.init()}return t.prototype.init=function(){var t=this;this.bindTranslater(),this.bindAnimater(),this.bindActions(),this.hooks.on(this.hooks.eventTypes.scrollEnd,(function(){t.togglePointerEvents(!0)}))},t.prototype.registerTransitionEnd=function(){this.transitionEndRegister=new J(this.content,[{name:H.transitionEnd,handler:this.transitionEnd.bind(this)}])},t.prototype.bindTranslater=function(){var t=this,e=this.translater.hooks;e.on(e.eventTypes.beforeTranslate,(function(e){t.options.translateZ&&e.push(t.options.translateZ)})),e.on(e.eventTypes.translate,(function(e){var o=t.getCurrentPos();t.updatePositions(e),!0!==t.actions.ensuringInteger?e.x===o.x&&e.y===o.y||t.togglePointerEvents(!1):t.actions.ensuringInteger=!1}))},t.prototype.bindAnimater=function(){var t=this;this.animater.hooks.on(this.animater.hooks.eventTypes.end,(function(e){t.resetPosition(t.options.bounceTime)||(t.animater.setPending(!1),t.hooks.trigger(t.hooks.eventTypes.scrollEnd,e))})),ft(this.animater.hooks,this.hooks,[{source:this.animater.hooks.eventTypes.move,target:this.hooks.eventTypes.scroll},{source:this.animater.hooks.eventTypes.forceStop,target:this.hooks.eventTypes.scrollEnd}])},t.prototype.bindActions=function(){var t=this,e=this.actions;ft(e.hooks,this.hooks,[{source:e.hooks.eventTypes.start,target:this.hooks.eventTypes.beforeStart},{source:e.hooks.eventTypes.start,target:this.hooks.eventTypes.beforeScrollStart},{source:e.hooks.eventTypes.beforeMove,target:this.hooks.eventTypes.beforeMove},{source:e.hooks.eventTypes.scrollStart,target:this.hooks.eventTypes.scrollStart},{source:e.hooks.eventTypes.scroll,target:this.hooks.eventTypes.scroll},{source:e.hooks.eventTypes.beforeEnd,target:this.hooks.eventTypes.beforeEnd}]),e.hooks.on(e.hooks.eventTypes.end,(function(o,i){return t.hooks.trigger(t.hooks.eventTypes.touchEnd,i),!!t.hooks.trigger(t.hooks.eventTypes.end,i)||(!(e.fingerMoved||(t.hooks.trigger(t.hooks.eventTypes.scrollCancel),!t.checkClick(o)))||(t.resetPosition(t.options.bounceTime,F.bounce)?(t.animater.setForceStopped(!1),!0):void 0))})),e.hooks.on(e.hooks.eventTypes.scrollEnd,(function(o,i){var n=Math.abs(o.x-t.scrollBehaviorX.startPos),r=Math.abs(o.y-t.scrollBehaviorY.startPos);if(t.checkFlick(i,n,r))return t.animater.setForceStopped(!1),void t.hooks.trigger(t.hooks.eventTypes.flick);t.momentum(o,i)?t.animater.setForceStopped(!1):(e.contentMoved&&t.hooks.trigger(t.hooks.eventTypes.scrollEnd,o),t.animater.forceStopped&&t.animater.setForceStopped(!1))}))},t.prototype.checkFlick=function(t,e,o){if(this.hooks.events.flick.length>1&&t<this.options.flickLimitTime&&e<this.options.flickLimitDistance&&o<this.options.flickLimitDistance&&(o>1||e>1))return!0},t.prototype.momentum=function(t,e){var o={time:0,easing:F.swiper,newX:t.x,newY:t.y},i=this.scrollBehaviorX.end(e),n=this.scrollBehaviorY.end(e);if(o.newX=T(i.destination)?o.newX:i.destination,o.newY=T(n.destination)?o.newY:n.destination,o.time=Math.max(i.duration,n.duration),this.hooks.trigger(this.hooks.eventTypes.momentum,o,this),o.newX!==t.x||o.newY!==t.y)return(o.newX>this.scrollBehaviorX.minScrollPos||o.newX<this.scrollBehaviorX.maxScrollPos||o.newY>this.scrollBehaviorY.minScrollPos||o.newY<this.scrollBehaviorY.maxScrollPos)&&(o.easing=F.swipeBounce),this.scrollTo(o.newX,o.newY,o.time,o.easing),!0},t.prototype.checkClick=function(t){var e=this.animater.forceStopped;if(this.hooks.trigger(this.hooks.eventTypes.checkClick))return this.animater.setForceStopped(!1),!0;if(!e){var o=this.options.dblclick,i=!1;if(o&&this.lastClickTime){var n=o.delay,r=void 0===n?300:n;w()-this.lastClickTime<r&&(i=!0,function(t){R(t,"dblclick")}(t))}return this.options.tap&&function(t,e){var o=document.createEvent("Event");o.initEvent(e,!0,!0),o.pageX=t.pageX,o.pageY=t.pageY,t.target.dispatchEvent(o)}(t,this.options.tap),this.options.click&&!A(t.target,this.options.preventDefaultException)&&R(t),this.lastClickTime=i?null:w(),!0}return!1},t.prototype.resize=function(){var t=this;this.actions.enabled&&(v&&(this.wrapper.scrollTop=0),clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout((function(){t.hooks.trigger(t.hooks.eventTypes.resize)}),this.options.resizePolling))},t.prototype.transitionEnd=function(t){t.target===this.content&&this.animater.pending&&(this.animater.transitionTime(),this.resetPosition(this.options.bounceTime,F.bounce)||(this.animater.setPending(!1),3!==this.options.probeType&&this.hooks.trigger(this.hooks.eventTypes.scrollEnd,this.getCurrentPos())))},t.prototype.togglePointerEvents=function(t){void 0===t&&(t=!0);for(var e=this.content.children.length?this.content.children:[this.content],o=t?"auto":"none",i=0;i<e.length;i++){var n=e[i];n.isBScrollContainer||(n.style.pointerEvents=o)}},t.prototype.refresh=function(t){var e=this.setContent(t);this.hooks.trigger(this.hooks.eventTypes.beforeRefresh),this.scrollBehaviorX.refresh(t),this.scrollBehaviorY.refresh(t),e&&(this.translater.setContent(t),this.animater.setContent(t),this.transitionEndRegister.destroy(),this.registerTransitionEnd(),this.options.bindToTarget&&this.actionsHandler.setContent(t)),this.actions.refresh(),this.wrapperOffset=D(this.wrapper)},t.prototype.setContent=function(t){var e=t!==this.content;return e&&(this.content=t),e},t.prototype.scrollBy=function(t,e,o,i){void 0===o&&(o=0);var n=this.getCurrentPos(),r=n.x,s=n.y;i=i||F.bounce,t+=r,e+=s,this.scrollTo(t,e,o,i)},t.prototype.scrollTo=function(t,e,o,i,n){void 0===o&&(o=0),void 0===i&&(i=F.bounce),void 0===n&&(n={start:{},end:{}});var r=this.options.useTransition?i.style:i.fn,s=this.getCurrentPos(),a=l({x:s.x,y:s.y},n.start),h=l({x:t,y:e},n.end);if(this.hooks.trigger(this.hooks.eventTypes.scrollTo,h),!function(t,e){for(var o=0,i=Object.keys(t);o<i.length;o++){var n=i[o];if(t[n]!==e[n])return!1}return!0}(a,h)){var c=Math.abs(h.x-a.x),u=Math.abs(h.y-a.y);c<1&&u<1&&(o=0,this.hooks.trigger(this.hooks.eventTypes.minDistanceScroll)),this.animater.move(a,h,o,r)}},t.prototype.scrollToElement=function(t,e,o,i,n){var r=_(t),s=D(r),a=function(t,e,o){return"number"==typeof t?t:t?Math.round(e/2-o/2):0};o=a(o,r.offsetWidth,this.wrapper.offsetWidth),i=a(i,r.offsetHeight,this.wrapper.offsetHeight);var l=function(t,e,o,i){return t-=e,t=i.adjustPosition(t-o)};s.left=l(s.left,this.wrapperOffset.left,o,this.scrollBehaviorX),s.top=l(s.top,this.wrapperOffset.top,i,this.scrollBehaviorY),this.hooks.trigger(this.hooks.eventTypes.scrollToElement,r,s)||this.scrollTo(s.left,s.top,e,n)},t.prototype.resetPosition=function(t,e){void 0===t&&(t=0),void 0===e&&(e=F.bounce);var o=this.scrollBehaviorX.checkInBoundary(),i=o.position,n=o.inBoundary,r=this.scrollBehaviorY.checkInBoundary(),s=r.position,a=r.inBoundary;return(!n||!a)&&(y&&this.reflow(),this.scrollTo(i,s,t,e),!0)},t.prototype.reflow=function(){this._reflow=this.content.offsetHeight},t.prototype.updatePositions=function(t){this.scrollBehaviorX.updatePosition(t.x),this.scrollBehaviorY.updatePosition(t.y)},t.prototype.getCurrentPos=function(){return this.actions.getCurrentPos()},t.prototype.enable=function(){this.actions.enabled=!0},t.prototype.disable=function(){$(this.animater.timer),this.actions.enabled=!1},t.prototype.destroy=function(){var t=this;["resizeRegister","transitionEndRegister","actionsHandler","actions","hooks","animater","translater","scrollBehaviorX","scrollBehaviorY"].forEach((function(e){return t[e].destroy()}))},t}(),yt=function(t){function e(e,o){var i=t.call(this,["refresh","contentChanged","enable","disable","beforeScrollStart","scrollStart","scroll","scrollEnd","scrollCancel","touchEnd","flick","destroy"])||this,n=_(e);return n?(i.plugins={},i.options=(new G).merge(o).process(),i.setContent(n).valid?(i.hooks=new q(["refresh","enable","disable","destroy","beforeInitialScrollTo","contentChanged"]),i.init(n),i):i):(u("Can not resolve the wrapper DOM."),i)}return a(e,t),e.use=function(t){var o=t.pluginName;return e.plugins.some((function(e){return t===e.ctor}))?e:T(o)?(u("Plugin Class must specify plugin's name in static property by 'pluginName' field."),e):(e.pluginsMap[o]=!0,e.plugins.push({name:o,applyOrder:t.applyOrder,ctor:t}),e)},e.prototype.setContent=function(t){var e=!1,o=!0,i=t.children[this.options.specifiedIndexAsContent];return i?(e=this.content!==i)&&(this.content=i):(u("The wrapper need at least one child element to be content element to scroll."),o=!1),{valid:o,contentChanged:e}},e.prototype.init=function(t){var e=this;this.wrapper=t,t.isBScrollContainer=!0,this.scroller=new vt(t,this.content,this.options),this.scroller.hooks.on(this.scroller.hooks.eventTypes.resize,(function(){e.refresh()})),this.eventBubbling(),this.handleAutoBlur(),this.enable(),this.proxy(c),this.applyPlugins(),this.refreshWithoutReset(this.content);var o=this.options,i={x:o.startX,y:o.startY};this.hooks.trigger(this.hooks.eventTypes.beforeInitialScrollTo,i)||this.scroller.scrollTo(i.x,i.y)},e.prototype.applyPlugins=function(){var t=this,o=this.options;e.plugins.sort((function(t,e){var o,i=((o={}).pre=-1,o.post=1,o);return(t.applyOrder?i[t.applyOrder]:0)-(e.applyOrder?i[e.applyOrder]:0)})).forEach((function(e){var i=e.ctor;o[e.name]&&"function"==typeof i&&(t.plugins[e.name]=new i(t))}))},e.prototype.handleAutoBlur=function(){this.options.autoBlur&&this.on(this.eventTypes.beforeScrollStart,(function(){var t=document.activeElement;!t||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName||t.blur()}))},e.prototype.eventBubbling=function(){ft(this.scroller.hooks,this,[this.eventTypes.beforeScrollStart,this.eventTypes.scrollStart,this.eventTypes.scroll,this.eventTypes.scrollEnd,this.eventTypes.scrollCancel,this.eventTypes.touchEnd,this.eventTypes.flick])},e.prototype.refreshWithoutReset=function(t){this.scroller.refresh(t),this.hooks.trigger(this.hooks.eventTypes.refresh,t),this.trigger(this.eventTypes.refresh,t)},e.prototype.proxy=function(t){var e=this;t.forEach((function(t){var o=t.key,i=t.sourceKey;V(e,i,o)}))},e.prototype.refresh=function(){var t=this.setContent(this.wrapper),e=t.contentChanged;if(t.valid){var o=this.content;this.refreshWithoutReset(o),e&&(this.hooks.trigger(this.hooks.eventTypes.contentChanged,o),this.trigger(this.eventTypes.contentChanged,o)),this.scroller.resetPosition()}},e.prototype.enable=function(){this.scroller.enable(),this.hooks.trigger(this.hooks.eventTypes.enable),this.trigger(this.eventTypes.enable)},e.prototype.disable=function(){this.scroller.disable(),this.hooks.trigger(this.hooks.eventTypes.disable),this.trigger(this.eventTypes.disable)},e.prototype.destroy=function(){this.hooks.trigger(this.hooks.eventTypes.destroy),this.trigger(this.eventTypes.destroy),this.scroller.destroy()},e.prototype.eventRegister=function(t){this.registerType(t)},e.plugins=[],e.pluginsMap={},e}(q);function mt(t,e){return new yt(t,e)}mt.use=yt.use,mt.plugins=yt.plugins,mt.pluginsMap=yt.pluginsMap;var gt=mt,wt="undefined"!=typeof window,kt=wt&&navigator.userAgent.toLowerCase(); /*! * better-scroll / pull-down * (c) 2016-2021 ustbhuangyi * Released under the MIT License. */kt&&/wechatdevtools/.test(kt),kt&&kt.indexOf("android"),function(){if("string"==typeof kt){var t=/os (\d\d?_\d(_\d)?)/.exec(kt);if(!t)return!1;var e=t[1].split("_").map((function(t){return parseInt(t,10)}));return!!(13===e[0]&&e[1]>=4)}}();if(wt){try{var Tt={};Object.defineProperty(Tt,"passive",{get:function(){!0}}),window.addEventListener("test-passive",(function(){}),Tt)}catch(Ue){}}var bt=wt&&document.createElement("div").style,St=function(){if(!wt)return!1;for(var t=0,e=[{key:"standard",value:"transform"},{key:"webkit",value:"webkitTransform"},{key:"Moz",value:"MozTransform"},{key:"O",value:"OTransform"},{key:"ms",value:"msTransform"}];t<e.length;t++){var o=e[t];if(void 0!==bt[o.value])return o.key}return!1}();function Pt(t){return!1===St?t:"standard"===St?"transitionEnd"===t?"transitionend":t:St+t.charAt(0).toUpperCase()+t.substr(1)}St&&"standard"!==St&&St.toLowerCase();Pt("transform"),Pt("transition");wt&&Pt("perspective"),Pt("transitionTimingFunction"),Pt("transitionDuration"),Pt("transitionDelay"),Pt("transformOrigin"),Pt("transitionEnd"),Pt("transitionProperty");var xt={style:"cubic-bezier(0.165, 0.84, 0.44, 1)",fn:function(t){return 1- --t*t*t*t}},_t=[{key:"finishPullDown",name:"finishPullDown"},{key:"openPullDown",name:"openPullDown"},{key:"closePullDown",name:"closePullDown"},{key:"autoPullDownRefresh",name:"autoPullDownRefresh"}].map((function(t){return{key:t.key,sourceKey:"plugins.pullDownRefresh."+t.name}})),Et=function(){function t(t){this.scroll=t,this.pulling=0,this.thresholdBoundary=0,this.init()}return t.prototype.setPulling=function(t){this.pulling=t},t.prototype.setThresholdBoundary=function(t){this.thresholdBoundary=t},t.prototype.init=function(){this.handleBScroll(),this.handleOptions(this.scroll.options.pullDownRefresh),this.handleHooks(),this.watch()},t.prototype.handleBScroll=function(){this.scroll.registerType(["pullingDown","enterThreshold","leaveThreshold"]),this.scroll.proxy(_t)},t.prototype.handleOptions=function(t){void 0===t&&(t={}),t=!0===t?{}:t;this.options=function(t,e){for(var o in e)t[o]=e[o];return t}({threshold:90,stop:40},t),this.scroll.options.probeType=3},t.prototype.handleHooks=function(){var t=this;this.hooksFn=[];var e=this.scroll.scroller,o=e.scrollBehaviorY;this.currentMinScrollY=this.cachedOriginanMinScrollY=o.minScrollPos,this.registerHooks(this.scroll.hooks,this.scroll.hooks.eventTypes.contentChanged,(function(){t.finishPullDown()})),this.registerHooks(o.hooks,o.hooks.eventTypes.computeBoundary,(function(e){e.maxScrollPos>0&&(e.maxScrollPos=-1),e.minScrollPos=t.currentMinScrollY})),this.hasMouseWheelPlugin()&&(this.registerHooks(this.scroll,this.scroll.eventTypes.alterOptions,(function(t){t.discreteTime=300,t.easeTime=350})),this.registerHooks(this.scroll,this.scroll.eventTypes.mousewheelEnd,(function(){e.hooks.trigger(e.hooks.eventTypes.end)})))},t.prototype.registerHooks=function(t,e,o){t.on(e,o,this),this.hooksFn.push([t,e,o])},t.prototype.hasMouseWheelPlugin=function(){return!!this.scroll.eventTypes.alterOptions},t.prototype.watch=function(){var t=this.scroll.scroller;this.watching=!0,this.registerHooks(t.hooks,t.hooks.eventTypes.end,this.checkPullDown),this.registerHooks(this.scroll,this.scroll.eventTypes.scrollStart,this.resetStateBeforeScrollStart),this.registerHooks(this.scroll,this.scroll.eventTypes.scroll,this.checkLocationOfThresholdBoundary),this.hasMouseWheelPlugin()&&this.registerHooks(this.scroll,this.scroll.eventTypes.mousewheelStart,this.resetStateBeforeScrollStart)},t.prototype.resetStateBeforeScrollStart=function(){this.isFetchingStatus()||(this.setPulling(1),this.setThresholdBoundary(0))},t.prototype.checkLocationOfThresholdBoundary=function(){if(1===this.pulling){var t=this.scroll,e=1!==this.thresholdBoundary&&this.locateInsideThresholdBoundary(),o=2!==this.thresholdBoundary&&!this.locateInsideThresholdBoundary();e&&(this.setThresholdBoundary(1),t.trigger("enterThreshold")),o&&(this.setThresholdBoundary(2),t.trigger("leaveThreshold"))}},t.prototype.locateInsideThresholdBoundary=function(){return this.scroll.y<=this.options.threshold},t.prototype.unwatch=function(){var t=this.scroll,e=t.scroller;this.watching=!1,e.hooks.off(e.hooks.eventTypes.end,this.checkPullDown),t.off(t.eventTypes.scrollStart,this.resetStateBeforeScrollStart),t.off(t.eventTypes.scroll,this.checkLocationOfThresholdBoundary),this.hasMouseWheelPlugin()&&t.off(t.eventTypes.mousewheelStart,this.resetStateBeforeScrollStart)},t.prototype.checkPullDown=function(){var t=this.options,e=t.threshold,o=t.stop;return!(this.scroll.y<e)&&(1===this.pulling&&(this.modifyBehaviorYBoundary(o),this.setPulling(2),this.scroll.trigger("pullingDown")),this.scroll.scrollTo(this.scroll.x,o,this.scroll.options.bounceTime,xt),this.isFetchingStatus())},t.prototype.isFetchingStatus=function(){return 2===this.pulling},t.prototype.modifyBehaviorYBoundary=function(t){var e=this.scroll.scroller.scrollBehaviorY;this.cachedOriginanMinScrollY=e.minScrollPos,this.currentMinScrollY=t,e.computeBoundary()},t.prototype.finishPullDown=function(){if(this.isFetchingStatus()){var t=this.scroll.scroller.scrollBehaviorY;this.currentMinScrollY=this.cachedOriginanMinScrollY,t.computeBoundary(),this.setPulling(0),this.scroll.resetPosition(this.scroll.options.bounceTime,xt)}},t.prototype.openPullDown=function(t){void 0===t&&(t={}),this.handleOptions(t),this.watching||this.watch()},t.prototype.closePullDown=function(){this.unwatch()},t.prototype.autoPullDownRefresh=function(){var t=this.options,e=t.threshold,o=t.stop;!this.isFetchingStatus()&&this.watching&&(this.modifyBehaviorYBoundary(o),this.scroll.trigger(this.scroll.eventTypes.scrollStart),this.scroll.scrollTo(this.scroll.x,e),this.setPulling(2),this.scroll.trigger("pullingDown"),this.scroll.scrollTo(this.scroll.x,o,this.scroll.options.bounceTime,xt))},t.pluginName="pullDownRefresh",t}(),Ct="undefined"!=typeof window,Dt=Ct&&navigator.userAgent.toLowerCase();Dt&&/wechatdevtools/.test(Dt),Dt&&Dt.indexOf("android"),function(){if("string"==typeof Dt){var t=/os (\d\d?_\d(_\d)?)/.exec(Dt);if(!t)return!1;var e=t[1].split("_").map((function(t){return parseInt(t,10)}));return!!(13===e[0]&&e[1]>=4)}}();if(Ct){try{var Mt={};Object.defineProperty(Mt,"passive",{get:function(){!0}}),window.addEventListener("test-passive",(function(){}),Mt)}catch(Ue){}}var Bt=Ct&&document.createElement("div").style,Ot=function(){if(!Ct)return!1;for(var t=0,e=[{key:"standard",value:"transform"},{key:"webkit",value:"webkitTransform"},{key:"Moz",value:"MozTransform"},{key:"O",value:"OTransform"},{key:"ms",value:"msTransform"}];t<e.length;t++){var o=e[t];if(void 0!==Bt[o.value])return o.key}return!1}();function Lt(t){return!1===Ot?t:"standard"===Ot?"transitionEnd"===t?"transitionend":t:Ot+t.charAt(0).toUpperCase()+t.substr(1)}Ot&&"standard"!==Ot&&Ot.toLowerCase();Lt("transform"),Lt("transition");Ct&&Lt("perspective"),Lt("transitionTimingFunction"),Lt("transitionDuration"),Lt("transitionDelay"),Lt("transformOrigin"),Lt("transitionEnd"),Lt("transitionProperty");var Yt=[{key:"finishPullUp",name:"finishPullUp"},{key:"openPullUp",name:"openPullUp"},{key:"closePullUp",name:"closePullUp"},{key:"autoPullUpLoad",name:"autoPullUpLoad"}].map((function(t){return{key:t.key,sourceKey:"plugins.pullUpLoad."+t.name}})),Ht=function(){function t(t){this.scroll=t,this.pulling=!1,this.watching=!1,this.init()}return t.prototype.init=function(){this.handleBScroll(),this.handleOptions(this.scroll.options.pullUpLoad),this.handleHooks(),this.watch()},t.prototype.handleBScroll=function(){this.scroll.registerType(["pullingUp"]),this.scroll.proxy(Yt)},t.prototype.handleOptions=function(t){void 0===t&&(t={}),t=!0===t?{}:t;this.options=function(t,e){for(var o in e)t[o]=e[o];return t}({threshold:0},t),this.scroll.options.probeType=3},t.prototype.handleHooks=function(){var t=this;this.hooksFn=[];var e=this.scroll.scroller.scrollBehaviorY;this.registerHooks(this.scroll.hooks,this.scroll.hooks.eventTypes.contentChanged,(function(){t.finishPullUp()})),this.registerHooks(e.hooks,e.hooks.eventTypes.computeBoundary,(function(t){t.maxScrollPos>0&&(t.maxScrollPos=-1)}))},t.prototype.registerHooks=function(t,e,o){t.on(e,o,this),this.hooksFn.push([t,e,o])},t.prototype.watch=function(){this.watching||(this.watching=!0,this.registerHooks(this.scroll,this.scroll.eventTypes.scroll,this.checkPullUp))},t.prototype.unwatch=function(){this.watching=!1,this.scroll.off(this.scroll.eventTypes.scroll,this.checkPullUp)},t.prototype.checkPull