text: YUI.add("scrollview-base",function(e,t){function F(){F.superclass.constructor.apply(this,arguments)}var n=e.ClassNameManager.getClassName,r=e.config.doc,i=e.UA.ie,s=e.Transition.useNative,o=e.Transition._VENDOR_PREFIX,u="scrollview",a={vertical:n(u,"vert"),horizontal:n(u,"horiz")},f="scrollEnd",l="flick",c="drag",h="mousewheel",p="ui",d="top",v="left",m="px",g="axis",y="scrollY",b="scrollX",w="bounce",E="disabled",S="deceleration",x="x",T="y",N="boundingBox",C="contentBox",k="gesturemove",L="start",A="end",O="",M="0s",_="snapDuration",D="snapEasing",P="easing",H="frameDuration",B="bounceRange",j=function(e,t,n){return Math.min(Math.max(e,t),n)};e.ScrollView=e.extend(F,e.Widget,{_forceHWTransforms:e.UA.webkit?!0:!1,_prevent:{start:!1,move:!0,end:!1},lastScrolledAmt:0,initializer:function(){var e=this;e._bb=e.get(N),e._cb=e.get(C),e._cAxis=e.get(g),e._cBounce=e.get(w),e._cBounceRange=e.get(B),e._cDeceleration=e.get(S),e._cFrameDuration=e.get(H)},bindUI:function(){var e=this;e._bindFlick(e.get(l)),e._bindDrag(e.get(c)),e._bindMousewheel(!0),e._bindAttrs(),i&&e._fixIESelect(e._bb,e._cb),F.SNAP_DURATION&&e.set(_,F.SNAP_DURATION),F.SNAP_EASING&&e.set(D,F.SNAP_EASING),F.EASING&&e.set(P,F.EASING),F.FRAME_STEP&&e.set(H,F.FRAME_STEP),F.BOUNCE_RANGE&&e.set(B,F.BOUNCE_RANGE)},_bindAttrs:function(){var e=this,t=e._afterScrollChange,n=e._afterDimChange;e.after({scrollEnd:e._afterScrollEnd,disabledChange:e._afterDisabledChange,flickChange:e._afterFlickChange,dragChange:e._afterDragChange,axisChange:e._afterAxisChange,scrollYChange:t,scrollXChange:t,heightChange:n,widthChange:n})},_bindDrag:function(t){var n=this,r=n._bb;r.detach(c+"|*"),t&&r.on(c+"|"+k+L,e.bind(n._onGestureMoveStart,n))},_bindFlick:function(t){var n=this,r=n._bb;r.detach(l+"|*"),t&&(r.on(l+"|"+l,e.bind(n._flick,n),t),n._bindDrag(n.get(c)))},_bindMousewheel:function(t){var n=this,i=n._bb;i.detach(h+"|*"),t&&e.one(r).on(h,e.bind(n._mousewheel,n))},syncUI:function(){var e=this,t=e._getScrollDims(),n=t.offsetWidth,r=t.offsetHeight,i=t.scrollWidth,s=t.scrollHeight;e._cAxis===undefined&&(e._cAxis={x:i>n,y:s>r},e._set(g,e._cAxis)),e.rtl=e._cb.getComputedStyle("direction")==="rtl",e._cDisabled=e.get(E),e._uiDimensionsChange(),e._isOutOfBounds()&&e._snapBack()},_getScrollDims:function(){var e=this,t=e._cb,n=e._bb,r=F._TRANSITION,i=e.get(b),o=e.get(y),u,a;return s&&(t.setStyle(r.DURATION,M),t.setStyle(r.PROPERTY,O)),u=e._forceHWTransforms,e._forceHWTransforms=!1,e._moveTo(t,0,0),a={offsetWidth:n.get("offsetWidth"),offsetHeight:n.get("offsetHeight"),scrollWidth:n.get("scrollWidth"),scrollHeight:n.get("scrollHeight")},e._moveTo(t,-i,-o),e._forceHWTransforms=u,a},_uiDimensionsChange:function(){var e=this,t=e._bb,n=e._getScrollDims(),r=n.offsetWidth,i=n.offsetHeight,s=n.scrollWidth,o=n.scrollHeight,u=e.rtl,f=e._cAxis;f&&f.x&&t.addClass(a.horizontal),f&&f.y&&t.addClass(a.vertical),e._minScrollX=u?Math.min(0,-(s-r)):0,e._maxScrollX=u?0:Math.max(0,s-r),e._minScrollY=0,e._maxScrollY=Math.max(0,o-i)},scrollTo:function(t,n,r,i,o){if(this._cDisabled)return;var u=this,a=u._cb,f=F._TRANSITION,l=e.bind(u._onTransEnd,u),c=0,h=0,g={},w;r=r||0,i=i||u.get(P),o=o||a,t!==null&&(u.set(b,t,{src:p}),c=-t),n!==null&&(u.set(y,n,{src:p}),h=-n),w=u._transform(c,h),s&&o.setStyle(f.DURATION,M).setStyle(f.PROPERTY,O),r===0?s?o.setStyle("transform",w):(t!==null&&o.setStyle(v,c+m),n!==null&&o.setStyle(d,h+m)):(g.easing=i,g.duration=r/1e3,s?g.transform=w:(g.left=c+m,g.top=h+m),o.transition(g,l))},_transform:function(e,t){var n="translate("+e+"px, "+t+"px)";return this._forceHWTransforms&&(n+=" translateZ(0)"),n},_moveTo:function(e,t,n){s?e.setStyle("transform",this._transform(t,n)):(e.setStyle(v,t+m),e.setStyle(d,n+m))},_onTransEnd:function(){var e=this;e.fire(f)},_onGestureMoveStart:function(t){if(this._cDisabled)return!1;var n=this,r=n._bb,i=n.get(b),s=n.get(y),o=t.clientX,u=t.clientY;n._prevent.start&&t.preventDefault(),n._flickAnim&&(n._flickAnim.cancel(),delete n._flickAnim,n._onTransEnd()),t.stopPropagation(),n.lastScrolledAmt=0,n._gesture={axis:null,startX:i,startY:s,startClientX:o,startClientY:u,endClientX:null,endClientY:null,deltaX:null,deltaY:null,flick:null,onGestureMove:r.on(c+"|"+k,e.bind(n._onGestureMove,n)),onGestureMoveEnd:r.on(c+"|"+k+A,e.bind(n._onGestureMoveEnd,n))}},_onGestureMove:function(e){var t=this,n=t._gesture,r=t._cAxis,i=r.x,s=r.y,o=n.startX,u=n.startY,a=n.startClientX,f=n.startClientY,l=e.clientX,c=e.clientY;t._prevent.move&&e.preventDefault(),n.deltaX=a-l,n.deltaY=f-c,n.axis===null&&(n.axis=Math.abs(n.deltaX)>Math.abs(n.deltaY)?x:T),n.axis===x&&i?t.set(b,o+n.deltaX):n.axis===T&&s&&t.set(y,u+n.deltaY)},_onGestureMoveEnd:function(e){var t=this,n=t._gesture,r=n.flick,i=e.clientX,s=e.clientY;t._prevent.end&&e.preventDefault(),n.endClientX=i,n.endClientY=s,n.onGestureMove.detach(),n.onGestureMoveEnd.detach(),r||n.deltaX!==null&&n.deltaY!==null&&(t._isOutOfBounds()?t._snapBack():t.pages&&!t.pages.get(g)[n.axis]&&t._onTransEnd())},_flick:function(e){if(this._cDisabled)return!1;var t=this,n=t._cAxis,r=e.flick,i=r.axis,s=r.velocity,o=i===x?b:y,u=t.get(o);t._gesture&&(t._gesture.flick=r),n[i]&&t._flickFrame(s,i,u)},_flickFrame:function(t,n,r){var i=this,s=n===x?b:y,o=i._cBounce,u=i._cBounceRange,a=i._cDeceleration,f=i._cFrameDuration,l=t*a,c=r-f*l,h=n===x?i._minScrollX:i._minScrollY,p=n===x?i._maxScrollX:i._maxScrollY,d=c<h,v=c<p,m=c>h,g=c>p,w=c<h-u,E=d&&c>h-u,S=g&&c<p+u,T=c>p+u,N;if(E||S)l*=o;N=Math.abs(l).toFixed(4)<.015,N||w||T?(i._flickAnim&&(i._flickAnim.cancel(),delete i._flickAnim),m&&v?i._onTransEnd():i._snapBack()):(i._flickAnim=e.later(f,i,"_flickFrame",[l,n,c]),i.set(s,c))},_mousewheel:function(e){var t=this,n=t.get(y),r=t._bb,i=10,s=e.wheelDelta>0,o=n-(s?1:-1)*i;o=j(o,t._minScrollY,t._maxScrollY),r.contains(e.target)&&t._cAxis[T]&&(t.lastScrolledAmt=0,t.set(y,o),t.scrollbars&&(t.scrollbars._update(),t.scrollbars.flash()),t._onTransEnd(),e.preventDefault())},_isOutOfBounds:function(e,t){var n=this,r=n._cAxis,i=r.x,s=r.y,o=e||n.get(b),u=t||n.get(y)
  ,a=n._minScrollX,f=n._minScrollY,l=n._maxScrollX,c=n._maxScrollY;return i&&(o<a||o>l)||s&&(u<f||u>c)},_snapBack:function(){var e=this,t=e.get(b),n=e.get(y),r=e._minScrollX,i=e._minScrollY,s=e._maxScrollX,o=e._maxScrollY,u=j(n,i,o),a=j(t,r,s),f=e.get(_),l=e.get(D);a!==t?e.set(b,a,{duration:f,easing:l}):u!==n?e.set(y,u,{duration:f,easing:l}):e._onTransEnd()},_afterScrollChange:function(e){if(e.src===F.UI_SRC)return!1;var t=this,n=e.duration,r=e.easing,i=e.newVal,s=[];t.lastScrolledAmt=t.lastScrolledAmt+(e.newVal-e.prevVal),e.attrName===b?(s.push(i),s.push(t.get(y))):(s.push(t.get(b)),s.push(i)),s.push(n),s.push(r),t.scrollTo.apply(t,s)},_afterFlickChange:function(e){this._bindFlick(e.newVal)},_afterDisabledChange:function(e){this._cDisabled=e.newVal},_afterAxisChange:function(e){this._cAxis=e.newVal},_afterDragChange:function(e){this._bindDrag(e.newVal)},_afterDimChange:function(){this._uiDimensionsChange()},_afterScrollEnd:function(){var e=this;e._flickAnim&&(e._flickAnim.cancel(),delete e._flickAnim),e._isOutOfBounds()&&e._snapBack()},_axisSetter:function(t){if(e.Lang.isString(t))return{x:t.match(/x/i)?!0:!1,y:t.match(/y/i)?!0:!1}},_setScroll:function(t){return this._cDisabled&&(t=e.Attribute.INVALID_VALUE),t},_setScrollX:function(e){return this._setScroll(e,x)},_setScrollY:function(e){return this._setScroll(e,T)}},{NAME:"scrollview",ATTRS:{axis:{setter:"_axisSetter",writeOnce:"initOnly"},scrollX:{value:0,setter:"_setScrollX"},scrollY:{value:0,setter:"_setScrollY"},deceleration:{value:.93},bounce:{value:.1},flick:{value:{minDistance:10,minVelocity:.3}},drag:{value:!0},snapDuration:{value:400},snapEasing:{value:"ease-out"},easing:{value:"cubic-bezier(0, 0.1, 0, 1.0)"},frameDuration:{value:15},bounceRange:{value:150}},CLASS_NAMES:a,UI_SRC:p,_TRANSITION:{DURATION:o?o+"TransitionDuration":"transitionDuration",PROPERTY:o?o+"TransitionProperty":"transitionProperty"},BOUNCE_RANGE:!1,FRAME_STEP:!1,EASING:!1,SNAP_EASING:!1,SNAP_DURATION:!1})},"@VERSION@",{requires:["widget","event-gestures","event-mousewheel","transition"],skinnable:!0});
  