!function(){var a,b,c,d,e,f,g,h,i,j=TouchEvent.prototype.preventDefault,k=!1;TouchEvent.prototype.preventDefault=function(a){"string"!=typeof a&&(k=!0),j.call(this)},window.addEventListener("touchstart",function(){k=!1},!0),a='
',"function"!=typeof Object.assign&&(Object.assign=function(a){"use strict";var b,c,d,e;if(null==a)throw new TypeError("Cannot convert undefined or null to object");for(b=Object(a),c=1;cb;b++)d[a[b]]=!0;return d}var b=Array.prototype.forEach,c=Object.prototype.hasOwnProperty,d={},e=function(a){return"object"==typeof a&&a instanceof Array},f=function(a){return"function"==typeof a},g=[].slice,h={},i=function(a,e,f){var g,h,i;if(a)if(b&&a.forEach===b)a.forEach(e,f);else if(a.length===+a.length){for(h=0,i=a.length;i>h;h++)if(h in a&&e.call(f,a[h],h,a)===d)return}else for(g in a)if(c.call(a,g)&&e.call(f,a[g],g,a)===d)return},j=function(b){b=b?h[b]||a(b):{};var c,d,g,i,j,k=[],l=[],m=function(a){var c,d,g;for(c=0,d=a.length;d>c;c++)g=a[c],e(g)?m(g):f(g)&&(b.unique&&o.has(g)||k.push(g))},n=function(a,e){for(e=e||[],c=!b.memory||[a,e],d=!0,j=g||0,g=0,i=k.length;k&&i>j;j++)if(k[j].apply(a,e)===!1&&b.stopOnFalse){c=!0;break}d=!1,k&&(b.once?c===!0?o.disable():k=[]:l&&l.length&&(c=l.shift(),o.fireWith(c[0],c[1])))},o={add:function(){if(k){var a=k.length;m(arguments),d?i=k.length:c&&c!==!0&&(g=a,n(c[0],c[1]))}return this},remove:function(){var a,c,e,f;if(k)for(a=arguments,c=0,e=a.length;e>c;c++)for(f=0;f=f&&(i--,j>=f&&j--),k.splice(f--,1),!b.unique));f++);return this},has:function(a){if(k)for(var b=0,c=k.length;c>b;b++)if(a===k[b])return!0;return!1},empty:function(){return k=[],this},disable:function(){return k=l=c=void 0,this},disabled:function(){return!k},lock:function(){return l=void 0,c&&c!==!0||o.disable(),this},locked:function(){return!l},fireWith:function(a,e){return l&&(d?b.once||l.push([a,e]):b.once&&c||n(a,e)),this},fire:function(){return o.fireWith(this,arguments),this},fired:function(){return!!c}};return o},k=function(a){var b,c=j("once memory"),d=j("once memory"),e=j("memory"),g="pending",h={resolve:c,reject:d,notify:e},l={done:c.add,fail:d.add,progress:e.add,state:function(){return g},isResolved:c.fired,isRejected:d.fired,then:function(a,b,c){return m.done(a).fail(b).progress(c),this},always:function(){return m.done.apply(m,arguments).fail.apply(m,arguments),this},pipe:function(a,b,c){return k(function(d){i({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c,e=a[0],g=a[1];f(e)?m[b](function(){c=e.apply(this,arguments),c&&f(c.promise)?c.promise().then(d.resolve,d.reject,d.notify):d[g+"With"](this===m?d:this,[c])}):m[b](d[g])})}).promise()},promise:function(a){if(a)for(var b in l)a[b]=l[b];else a=l;return a}},m=l.promise({});for(b in h)m[b]=h[b].fire,m[b+"With"]=h[b].fireWith;return m.done(function(){g="resolved"},d.disable,e.lock).fail(function(){g="rejected"},c.disable,e.lock),a&&a.call(m,m),m},l=function(a){function b(a){return function(b){d[a]=arguments.length>1?g.call(arguments,0):b,--j||l.resolveWith(l,d)}}function c(a){return function(b){i[a]=arguments.length>1?g.call(arguments,0):b,l.notifyWith(m,i)}}var d=g.call(arguments,0),e=0,h=d.length,i=new Array(h),j=h,l=1>=h&&a&&f(a.promise)?a:k(),m=l.promise();if(h>1){for(;h>e;e++)d[e]&&d[e].promise&&f(d[e].promise)?d[e].promise().then(b(e),l.reject,c(e)):--j;j||l.resolveWith(l,d)}else l!==a&&l.resolveWith(l,h?[a]:[]);return m};return k.when=l,k.Callbacks=j,k}(),c=function(){var a=window,b=a.document,c={NONE:0,NOOP:1,UP:2,RIGHT:3,DOWN:4,LEFT:5,LEFT_RIGHT:6},d={con:"",minDistance:4,onPullStart:function(){},onMove:function(){},onPullEnd:function(){}},e=function(a){"string"==typeof a.con&&(a.con=b.querySelector(a.con)),this.options=Object.assign({},d,a),this.hasTouch=!1,this.direction=c.NONE,this.distanceX=this.startY=this.startX=0,this.isPull=!1,this.initEvent()};return e.prototype={initEvent:function(){var a,b=this;this._touchStart=function(a){b.__start(a)},this._touchMove=function(a){b.__move(a)},this._touchEnd=function(a){b.__end(a)},a=b.options.useCapture,window.addEventListener("touchstart",this._touchStart,a),window.addEventListener("touchmove",this._touchMove,a),window.addEventListener("touchend",this._touchEnd,a)},detachEvent:function(){var a=this.options.useCapture;window.removeEventListener("touchstart",this._touchStart,a),window.removeEventListener("touchmove",this._touchMove,a),window.removeEventListener("touchend",this._touchEnd,a)},__start:function(b){var d=b.touches;b=b.targetTouches,1===b.length&&1===d.length&&(this.startX=b[0].pageX,this.startY=b[0].pageY,this.direction=c.NONE,this.distanceX=0,this.hasTouch=!0,this.startScrollY=a.scrollY)},__move:function(a){var b,d,e;if(k&&(this.hasTouch=!1),this.hasTouch){if(this.direction===c.UP)return;b=a.targetTouches[0],this.direction===c.NONE&&(this.distanceX=b.pageX-this.startX,this.distanceY=b.pageY-this.startY,d=Math.abs(this.distanceY),e=Math.abs(this.distanceX),e+d>this.options.minDistance&&(this.direction=e>1.73*d?c.LEFT_RIGHT:d>1.73*e?this.distanceY<0?c.UP:c.DOWN:c.NOOP,this.startScrollY<10&&this.distanceY>0&&(this.direction=c.DOWN)),this.startScrollY<10&&this.direction===c.DOWN&&this.distanceY>this.options.minDistance&&(this.isPull=!0,this.options.onPullStart(a,this.distanceY))),this.isPull&&this.direction===c.DOWN&&(this.distanceY=b.pageY-this.startY,this.refreshY=parseInt(this.distanceY*this.options.pullRatio),this.options.onMove(a,this.distanceY))}},__end:function(a){!this.hasTouch||c.LEFT_RIGHT!==this.direction&&c.DOWN!==this.direction||(this.direction===c.LEFT_RIGHT&&(a.preventDefault("end"),a.stopPropagation(),this.options.onPullEnd(a,this.distanceX,c.LEFT_RIGHT)),this.direction===c.DOWN&&this.isPull&&(a.preventDefault("end"),a.stopPropagation(),this.options.onPullEnd(a,this.distanceY,c.DOWN))),this.hasTouch=!1,this.isPull=!1}},{init:function(a){return new e(a)},DIRECTION:c}}(),d=function(){var a=function(a,b,c,d,e,f,g,h,i){var j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;switch("string"==typeof b&&(b=parseFloat(b)),"string"==typeof c&&(c=parseFloat(c)),"string"==typeof d&&(d=parseFloat(d)),"string"==typeof e&&(e=parseFloat(e)),"string"==typeof f&&(f=parseFloat(f)),"string"==typeof g&&(g=parseFloat(g)),2*Math.PI,a.save(),h){case 0:j=Math.sqrt((f-b)*(f-b)+(g-c)*(g-c)),a.arcTo(d,e,b,c,.55*j),a.fill();break;case 1:i>.5&&(a.save(),a.beginPath(),a.moveTo(b,c),a.lineTo(d,e),a.lineTo(f,g),a.lineTo(b,c),a.fill());break;case 2:a.stroke();break;case 3:k=(b+d+f)/3,l=(c+e+g)/3,a.quadraticCurveTo(k,l,b,c),a.fill();break;case 4:q=5,f==b?(j=g-c,m=(d+b)/2,o=(d+b)/2,n=e+j/q,p=e-j/q):(j=Math.sqrt((f-b)*(f-b)+(g-c)*(g-c)),r=(b+f)/2,s=(c+g)/2,t=(r+d)/2,u=(s+e)/2,v=(g-c)/(f-b),w=j/(2*Math.sqrt(v*v+1))/q,x=v*w,m=t-w,n=u-x,o=t+w,p=u+x),a.bezierCurveTo(m,n,o,p,b,c),a.fill()}a.restore()},b=function(a,b,d,e,f,g,h,i,j,k,l,m,n,o){i="undefined"!=typeof i?i:3,j="undefined"!=typeof j?j:1,k="undefined"!=typeof k?k:Math.PI/8,l="undefined"!=typeof l?l:10,m="undefined"!=typeof m?m:1,a.save(),a.beginPath(),a.globalAlpha=1,a.restore(),a.lineWidth=m,a.beginPath(),a.arc(b,d,e,f,g,h),a.stroke();var p,q,r,s,t;1&j&&(p=Math.cos(f)*e+b,q=Math.sin(f)*e+d,r=Math.atan2(b-p,q-d),h?(s=p+10*Math.cos(r),t=q+10*Math.sin(r)):(s=p-10*Math.cos(r),t=q-10*Math.sin(r)),c(a,p,q,s,t,i,2,k,l,o)),2&j&&(p=Math.cos(g)*e+b,q=Math.sin(g)*e+d,r=Math.atan2(b-p,q-d),h?(s=p-10*Math.cos(r),t=q-10*Math.sin(r)):(s=p+10*Math.cos(r),t=q+10*Math.sin(r)),c(a,p-n*Math.sin(g),q+n*Math.cos(g),s-n*Math.sin(g),t+n*Math.cos(g),i,2,k,l,o)),a.restore()},c=function(b,c,d,e,f,g,h,i,j,k){var l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;"string"==typeof c&&(c=parseFloat(c)),"string"==typeof d&&(d=parseFloat(d)),"string"==typeof e&&(e=parseFloat(e)),"string"==typeof f&&(f=parseFloat(f)),g="undefined"!=typeof g?g:3,h="undefined"!=typeof h?h:1,i="undefined"!=typeof i?i:Math.PI/8,j="undefined"!=typeof j?j:10,p="function"!=typeof g?a:g,q=Math.sqrt((e-c)*(e-c)+(f-d)*(f-d)),r=(q-j/3)/q,1&h?(l=Math.round(c+(e-c)*r),m=Math.round(d+(f-d)*r)):(l=e,m=f),2&h?(n=c+(e-c)*(1-r),o=d+(f-d)*(1-r)):(n=c,o=d),b.beginPath(),b.moveTo(n,o),b.lineTo(l,m),b.stroke(),s=Math.atan2(f-d,e-c),t=Math.abs(j/Math.cos(i)),1&h&&(u=s+Math.PI+i,v=e+Math.cos(u)*t,w=f+Math.sin(u)*t,x=s+Math.PI-i,y=e+Math.cos(x)*t,z=f+Math.sin(x)*t,p(b,v,w,e,f,y,z,g,k)),2&h&&(u=s+i,v=c+Math.cos(u)*t,w=d+Math.sin(u)*t,x=s-i,y=c+Math.cos(x)*t,z=d+Math.sin(x)*t,p(b,v,w,c,d,y,z,g,k))};return{drawArrow:c,drawArcedArrow:b}}(),e=function(){var e,f=window,g=(f.document,window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}),h={con:"",minDistance:4},i=["onPullStart","onMove","onRelease","needRefresh","doRefresh","noop"],j=25,k=300,l=10,m=function(a){var b=5*a/12;return b},n=function(){var a=document.createElement("canvas"),b=!(!a.getContext||!a.getContext("2d")),c=navigator.userAgent.toLowerCase(),d=(c.match(/chrome\/([\d.]+)/),c.match(/version\/([\d.]+).*safari/)),e=(c.match(/firefox\/([\d.]+)/),c.match(/mx[\d.]+/)),f=!1;return e&&d&&(f=!0),!b&&f}(),o=(function(){return!0}(),function(a){var b,d,e;for(a.con=document.body,b={},d=this,e=0;e=this.minRefreshDistance&&(this.shouldRefresh=!0),this.shouldRefresh},pullTipExist:function(){return this.$pullTip},reset:function(){var a=this.isRefreshing;this.isRefreshing=!1,this.shouldRefresh=!1,this.removePullTip(a)},canvasObj:function(){function a(){var a=(L+1)%J.length;return L=a,a}function c(a){return 360+a-S}function e(){x.clearRect(0,0,2*z,2*A)}function f(a){if(!n){var b=a.start,c=a.end,d=a.lineWidth,f=a.color,g=a.counterClockwise,h=a.co,i=a.clearRect;i&&e(),x.save(),x.globalCompositeOperation=h,x.beginPath(),x.arc(z,A,B,t(b),t(c),g),x.lineWidth=d,x.strokeStyle=f,x.stroke(),x.restore()}}function h(){var b,d,e,g,h,i,j,k,l,m;n||(b=Q.speed,d=Q.startAngle,e=O,g=Q.color,h=Q.lineWidth,i=Q.counterClockwise,j=Q.globalCompositeOperation,k=U||+new Date,e=+new Date,b=360/I*(e-k),U=e,O+=b,e=Math.min(T,O),l="draw"===R,!y&&(f({start:d,end:e,color:g,lineWidth:h,counterClockwise:i,co:j,clearRect:l}),O>=T)&&(x.closePath(),Q="erase"!==R?N:M,R="erase"!==R?"erase":"draw","draw"===R?(K=Q.color,m=a(K),Q.color=J[m],Q.startAngle=(Q.startAngle-S)%360,O=Q.startAngle,T=c(O)):O=Q.startAngle=M.startAngle))}function i(a){var b,c,d,e,f,g,h;n||(b=a,c=M.speed,d=M.startAngle,e=M.startAngle,f=J[0],isNaN(a)||(a=Math.min(v.minRefreshDistance-j,a),g=a/(v.minRefreshDistance-j),h=(T-l)*g-M.startAngle,c=h),e+=c,P=e,o({start:d,end:e,color:f,distance:a,clip:b}))}function m(){var a=v.minRefreshDistance-j,c=1.3*(a/I),d=J[0],e=a,f=+new Date,h=b(),i=function k(){var a,b,i,m;e>=0?(a=+new Date,e-=c*(a-f),f=a,b=e/(v.minRefreshDistance-j),i=(T-l)*b-M.startAngle,m=P-i,m=Math.min(m,P),o({start:m,end:P,color:d,distance:e,clip:e}),g(k)):h.resolve()};return g(i),h}function o(a){var b=a.distance,c=y?10:25,f=D,g=b/(v.minRefreshDistance-j);isNaN(b)||(c*=g,f=D*g),e(),E||(x.globalAlpha=1*a.distance/(v.minRefreshDistance+10)),x.strokeStyle=a.color,x.fillStyle=a.color,d.drawArcedArrow(x,z,A,B,t(a.start),t(a.end),!1,1,2,t(45),c,D,f,x.globalAlpha)}function p(a){var b,c=0;return a&&(a=a.replace("matrix(","").replace(")",""),a=a.replace(/\s+/gi,""),b=a.split(","),c=b[5]||0),c}function q(){var a,b,c,d,e,f=v.$pullTip.ownerDocument.defaultView.getComputedStyle(v.$pullTip,null),h=p(f["transform"]);j>h||(a=k,b=h/a,c=h,d=+new Date,e=function l(){if(c>j&&v.$pullTip){var a=+new Date,e=b*(a-d);c-=e,i(c-j),r(c-j),d=a,g(l)}},g(e))}function r(){}function s(a,b){var c=a;b||(c=Math.max(0,360*((a-j-40*v.options.ratio)/v.minRefreshDistance))),w.style.webkitTransition="none",w.style.webkitTransform="rotate("+c+"deg)"}function t(a){return a*(Math.PI/180)}function u(){}var v=null,w=null,x=null,y=!1,z=100,A=100,B=50,C=0,D=15,E=!1,F=5,G=0,H=1500,I=1e3,J=["green"],K=J[0],L=1,M={startAngle:G,speed:F,color:J[0],counterClockwise:!1,globalCompositeOperation:"source-out",lineWidth:D},N={startAngle:G,speed:F,color:"white",counterClockwise:!1,globalCompositeOperation:"destination-out",lineWidth:D+40},O=G,P=G,Q=M,R="draw",S=50,T=0,U=0,V=-1;return{init:function(a,b){this.reset(),U=0,E=!1,w=a.querySelector("canvas"),x=w.getContext?w.getContext("2d"):w,x.__ignore__=!0,y=!w.getContext,P=O=G,M.startAngle=N.startAngle=G,T=c(O),L=1,J=[b.options.color],M.color=J[L],R="draw",Q=M,v=b,y?(C=9,z=A=B=(40-2*C)/2):(z=A=100,C=0,B=50)},reset:function(){w=null,x=null},drawArrowedArcByDis:function(a){i(a)},drawArc:function(a){n?console.log("not support"):h(a)},clearCurrent:function(){n?console.log("not support"):q()},rotate:s,changeOpacity:r,autoRotate:function(){var a,b,c,d,e,f=w.style.webkitTransform;f=f.replace("rotate(","").replace("deg","").replace(")",""),a=parseFloat(f),b=360/H,c=this,d=+new Date,e=function h(){if(E){var e=+new Date,f=a+b*(e-d);d=e,c.rotate(f,!0),a=f,g(h)}},g(e)},autoDraw:function(){if(!n){var a=function c(){E&&(h(),g(c))},b=m();b.done(function(){g(a)})}},startAuto:function(){E=!0,w.parentNode.style,v.touchPull.detachEvent(),this.autoDraw(),this.autoRotate(),u()},stopAuto:function(){E=!1,w.parentNode.style,v.touchPull.initEvent(),clearTimeout(V)}}}(),initCanvas:function(){this.canvasObj.init(this.$pullTip,this)},beginPullToRefresh:function(){this.shouldRefresh=!0,this.addPullTip(document.body),this._onPullEnd(null,this.minRefreshDistance,4)},addPullTip:function(b){var c,d,e,f;this.removePullTip(),b=this.options.con,c=this.$pullTip,c||(d=document.createElement("div"),d.innerHTML=a.replace(/\{WIDTH\}/g,40*this.options.ratio+"px").replace(/\{SHADOWOFFSETY\}/g,2*this.options.ratio).replace(/\{SHADOWBLUR\}/g,5*this.options.ratio),this.$pullTip=document.body.appendChild(d.firstElementChild),c=this.$pullTip,this.$pullTipInner=c.querySelector("div"),e=c.offsetHeight,j=25*this.options.ratio,this.minRefreshDistance=70*this.options.ratio,f=c,f.querySelector("canvas"),f.style.top=this.options.offset-e+"px",f.style.webkitTransition="none",f.style.webkitTransform="translate3d(0,0,0)",this.initCanvas())},movePullTip:function(a,b,c){var d,e;this.pullTipExist()&&(d=Math.min(this.options.range+20*this.options.ratio,a),this.$pullTip.style.webkitTransition=b||"none",e=50*this.options.ratio,d=Math.max(0,d-e),this.$pullTip.style.webkitTransform="translate3d(0,"+d+"px,0)",this.$pullTip.style.height=Math.min(a,e)+"px",this.$pullTipInner.style.webkitTransform="translateY("+Math.min(0,Math.max(-e,a-e))+"px)",0===a?this.canvasObj.clearCurrent():a>j&&(this.shouldRefresh?this.isRefreshing||c===!0||this.canvasObj.rotate(a):(a<=this.options.range+20*this.options.ratio-5&&a>=40*this.options.ratio&&this.canvasObj.rotate(a),this.canvasObj.drawArrowedArcByDis(a-j),this.canvasObj.changeOpacity(a-j))))},changePullTip:function(){this.pullTipExist()},removePullTip:function(a){if(this.pullTipExist())if(a){var b=this;b.canvasObj.stopAuto(),b.$pullTip.style.webkitTransition="all 100ms linear",b.$pullTip.style.opacity=.1,b.$pullTip.style.webkitTransform+=" scale(0.1)"}else this.$pullTip.removeEventListener("webkitTransitionEnd",this.onTransitionEnd,!1),this.$pullTip.remove(),this.$pullTip=null}},e={init:function(a){return new o(a)}}}(),f=/complete|loaded|interactive/,g=function(a){f.test(document.readyState)?a():document.addEventListener("DOMContentLoaded",function(){a()},!1)},i=!1,window.__setPullToRefresh__=function(a,b){g(function(){var c,d,f,g;return!a.support&&h?(h.reset(),h.touchPull.detachEvent(),i=!0,void 0):(a.support&&(c=window.innerWidth,980===c&&(c=window.plus&&plus.screen.resolutionWidth||window.screen.width),d=c/(window.plus&&plus.screen.resolutionWidth||window.screen.width),f=parseInt(a.offset),g=parseInt(a.range)||128,useCapture=a.useCapture===!1?!1:!0,f*=d,g=g*d+f,h?(h.options.useCapture=useCapture,i&&h.touchPull.initEvent(),a.offset&&(h.options.offset=f),a.range&&(h.options.range=g),a.color&&(h.options.color=a.color),h.options.doRefresh=b):h=e.init({offset:f,range:g,ratio:d,useCapture:useCapture,color:a.color||"green",doRefresh:b})),void 0)})},window.__endPullToRefresh__=function(){h&&h.reset()},window.__beginPullToRefresh__=function(){h&&h.beginPullToRefresh()}}();