!function(l,e){"function"==typeof define&&define.amd?define(["jquery"],e):e(l.jQuery)}(this,function(m){"use strict";var a={data:{index:0,name:"scrollbar"},macosx:/mac/i.test(navigator.platform),mobile:/android|webos|iphone|ipad|ipod|blackberry/i.test(navigator.userAgent),overlay:null,scroll:null,scrolls:[],webkit:/webkit/i.test(navigator.userAgent)&&!/edge\/\d+/i.test(navigator.userAgent)};a.scrolls.add=function(l){this.remove(l).push(l)};function l(l){var e;a.scroll||(a.overlay=!((e=t(!0)).height||e.width),a.scroll=t(),d(),m(window).resize(function(){var l,e=!1;a.scroll&&(a.scroll.height||a.scroll.width)&&((l=t()).height===a.scroll.height&&l.width===a.scroll.width||(a.scroll=l,e=!0)),d(e)})),this.container=l,this.namespace=".scrollbar_"+a.data.index++,this.options=m.extend({},o,window.jQueryScrollbarOptions||{}),this.scrollTo=null,this.scrollx={},this.scrolly={},l.data(a.data.name,this),a.scrolls.add(this)}var o={autoScrollSize:!0,autoUpdate:!0,debug:!(a.scrolls.remove=function(l){for(;0<=m.inArray(l,this);)this.splice(m.inArray(l,this),1);return this}),disableBodyScroll:!1,duration:200,ignoreMobile:!1,ignoreOverlay:!1,scrollStep:30,showArrows:!1,stepScrolling:!0,scrollx:null,scrolly:null,onDestroy:null,onInit:null,onScroll:null,onUpdate:null};l.prototype={destroy:function(){var l,e;this.wrapper&&(this.container.removeData(a.data.name),a.scrolls.remove(this),l=this.container.scrollLeft(),e=this.container.scrollTop(),this.container.insertBefore(this.wrapper).css({height:"",margin:"","max-height":""}).removeClass("scroll-content scroll-scrollx_visible scroll-scrolly_visible").off(this.namespace).scrollLeft(l).scrollTop(e),this.scrollx.scroll.removeClass("scroll-scrollx_visible").find("div").andSelf().off(this.namespace),this.scrolly.scroll.removeClass("scroll-scrolly_visible").find("div").andSelf().off(this.namespace),this.wrapper.remove(),m(document).add("body").off(this.namespace),m.isFunction(this.options.onDestroy)&&this.options.onDestroy.apply(this,[this.container]))},init:function(l){var p=this,u=this.container,s=this.containerWrapper||u,f=this.namespace,v=m.extend(this.options,l||{}),b={x:this.scrollx,y:this.scrolly},o=this.wrapper,e={scrollLeft:u.scrollLeft(),scrollTop:u.scrollTop()};if(a.mobile&&v.ignoreMobile||a.overlay&&v.ignoreOverlay||a.macosx&&!a.webkit)return!1;o?s.css({height:"auto","margin-bottom":-1*a.scroll.height+"px","margin-right":-1*a.scroll.width+"px","max-height":""}):(this.wrapper=o=m("
").addClass("scroll-wrapper").addClass(u.attr("class")).css("position","absolute"==u.css("position")?"absolute":"relative").insertBefore(u).append(u),u.is("textarea")&&(this.containerWrapper=s=m("
").insertBefore(u).append(u),o.addClass("scroll-textarea")),s.addClass("scroll-content").css({height:"auto","margin-bottom":-1*a.scroll.height+"px","margin-right":-1*a.scroll.width+"px","max-height":""}),u.on("scroll"+f,function(l){m.isFunction(v.onScroll)&&v.onScroll.call(p,{maxScroll:b.y.maxScrollOffset,scroll:u.scrollTop(),size:b.y.size,visible:b.y.visible},{maxScroll:b.x.maxScrollOffset,scroll:u.scrollLeft(),size:b.x.size,visible:b.x.visible}),b.x.isVisible&&b.x.scroll.bar.css("left",u.scrollLeft()*b.x.kx+"px"),b.y.isVisible&&b.y.scroll.bar.css("top",u.scrollTop()*b.y.kx+"px")}),o.on("scroll"+f,function(){o.scrollTop(0).scrollLeft(0)}),v.disableBodyScroll&&(l=function(l){g(l)?b.y.isVisible&&b.y.mousewheel(l):b.x.isVisible&&b.x.mousewheel(l)},o.on("MozMousePixelScroll"+f,l),o.on("mousewheel"+f,l),a.mobile&&o.on("touchstart"+f,function(l){var l=l.originalEvent.touches&&l.originalEvent.touches[0]||l,o=l.pageX,s=l.pageY,r=u.scrollLeft(),t=u.scrollTop();m(document).on("touchmove"+f,function(l){var e=l.originalEvent.targetTouches&&l.originalEvent.targetTouches[0]||l;u.scrollLeft(r+o-e.pageX),u.scrollTop(t+s-e.pageY),l.preventDefault()}),m(document).on("touchend"+f,function(){m(document).off(f)})})),m.isFunction(v.onInit)&&v.onInit.apply(this,[u])),m.each(b,function(r,t){function i(){var l=u[a]();u[a](l+d),1==c&&h<=l+d&&(l=u[a]()),-1==c&&l+d<=h&&(l=u[a]()),u[a]()==l&&n&&n()}var n=null,c=1,a="x"===r?"scrollLeft":"scrollTop",d=v.scrollStep,h=0;t.scroll||(t.scroll=p._getScroll(v["scroll"+r]).addClass("scroll-"+r),v.showArrows&&t.scroll.addClass("scroll-element_arrows_visible"),t.mousewheel=function(l){if(!t.isVisible||"x"===r&&g(l))return!0;if("y"===r&&!g(l))return b.x.mousewheel(l),!0;var e=-1*l.originalEvent.wheelDelta||l.originalEvent.detail,o=t.size-t.visible-t.offset;return(0
','','','','",""].join(""),simple:['
"].join("")};return l="string"==typeof(l=(l=e[l]?e[l]:l)||e.simple)?m(l).appendTo(this.wrapper):m(l),m.extend(l,{bar:l.find(".scroll-bar"),size:l.find(".scroll-element_size"),track:l.find(".scroll-element_track")}),l},_handleMouseDown:function(l,e){var o=this.namespace;return m(document).on("blur"+o,function(){m(document).add("body").off(o),l&&l()}),m(document).on("dragstart"+o,function(l){return l.preventDefault(),!1}),m(document).on("mouseup"+o,function(){m(document).add("body").off(o),l&&l()}),m("body").on("selectstart"+o,function(l){return l.preventDefault(),!1}),e&&e.preventDefault(),!1},_updateScroll:function(l,e){var o=this.container,s=this.containerWrapper||o,r="scroll-scroll"+l+"_visible",t="x"===l?this.scrolly:this.scrollx,i=parseInt(this.container.css("x"===l?"left":"top"),10)||0,n=this.wrapper,c=e.size,i=e.visible+i;e.isVisible=1
").css(m.extend({},l)),a.data.outer=m("").css(m.extend({left:"-1000px",overflow:"scroll",position:"absolute",top:"-1000px"},l)).append(a.data.inner).appendTo("body")),a.data.outer.scrollLeft(1e3).scrollTop(1e3),{height:Math.ceil(a.data.outer.offset().top-a.data.inner.offset().top||0),width:Math.ceil(a.data.outer.offset().left-a.data.inner.offset().left||0)})}function g(l){l=l.originalEvent;return(!l.axis||l.axis!==l.HORIZONTAL_AXIS)&&!l.wheelDeltaX}window.angular&&(s=window.angular).module("jQueryScrollbar",[]).provider("jQueryScrollbar",function(){var e=o;return{setOptions:function(l){s.extend(e,l)},$get:function(){return{options:s.copy(e)}}}}).directive("jqueryScrollbar",function(s,r){return{restrict:"AC",link:function(l,e,o){l=r(o.jqueryScrollbar)(l);e.scrollbar(l||s.options).on("$destroy",function(){e.scrollbar("destroy")})}}})});