forked from KingSora/OverlayScrollbars
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjquery.overlayScrollbars.min.js
11 lines (11 loc) · 41.1 KB
/
jquery.overlayScrollbars.min.js
1
2
3
4
5
6
7
8
9
10
11
/*!
* OverlayScrollbars
* https://github.com/KingSora/OverlayScrollbars
*
* Copyright KingSora.
* https://github.com/KingSora
*
* Released under the MIT license.
* Date: 09.09.2017
*/
"use-strict";!function(e,t,n){function r(e,t){(e=e[0])[b]=t,m.push(e)}function o(t){t=t[0];var n=e.inArray(t,m);n>-1&&(delete t[b],m.splice(n,1))}function i(e){return a(e)!==n}function a(t){t=t[0];var n;return e.each(m,function(){if(t===this)return n=this[b],!1}),n}function s(){p===n&&(p=new h(g)),y===n&&(y=new v)}function l(){return t.MutationObserver||t.WebKitMutationObserver||t.WebkitMutationObserver||t.MozMutationObserver||n}function c(){return t.ResizeObserver||t.WebKitResizeObserver||t.WebkitResizeObserver||t.MozResizeObserver||n}function f(){var e=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame;return e===n&&(e=function(e){return t.setTimeout(e,1e3/60)}),e}function u(){var e=t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||t.msCancelAnimationFrame;return e===n&&(e=function(e){return t.clearTimeout(e)}),e}function h(r){function o(e){var t=!1,r="Webkit Moz ms O".split(" "),o=document.createElement("div"),i=null;if(e=e.toLowerCase(),o.style[e]!==n&&(t=!0),!1===t){i=e.charAt(0).toUpperCase()+e.substr(1);for(var a=0;a<r.length;a++)if(o.style[r[a]+i]!==n){t=!0;break}}return t}var i=this;i.defaultOptions=r,i.autoUpdateLoop=!1,i.autoUpdateRecommended=l()===n;var a=e("body"),s=e('<div id="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%;"></div></div>'),f=function(){a.append(s);var t=s[0],n=e(s.children("div").first());0===t.offsetHeight&&s.hide().show();var r={x:t.offsetHeight-t.clientHeight,y:t.offsetWidth-t.clientWidth};s.addClass("os-viewport-native-scrollbars-invisible"),s.css("overflow","hidden").hide().css("overflow","scroll").show(),i.nativeScrollbarStyling=t.offsetHeight-t.clientHeight==0&&t.offsetWidth-t.clientWidth==0,s.css({"overflow-y":"hidden",direction:"rtl"}).scrollLeft(0);var o=s.offset(),l=n.offset();s.scrollLeft(999);var c=n.offset();return i.rtlScrollBehavior={i:o.left===l.left,n:l.left-c.left==0},s.removeAttr("style").remove(),r}(),u={x:0===f.x,y:0===f.y};i.nativeScrollbarSize=f,i.nativeScrollbarIsOverlaid=u,i.overlayScrollbarDummySize={x:30,y:30},i.msie=function(){var e=t.navigator.userAgent,n=e.indexOf("MSIE ");if(n>0)return parseInt(e.substring(n+5,e.indexOf(".",n)),10);if(e.indexOf("Trident/")>0){var r=e.indexOf("rv:");return parseInt(e.substring(r+3,e.indexOf(".",r)),10)}var o=e.indexOf("Edge/");return o>0&&parseInt(e.substring(o+5,e.indexOf(".",o)),10)}(),i.cssCalc=function(){for(var e=document.createElement("div"),t=["calc","-webkit-calc","-moz-calc","-o-calc"],n=0;n<t.length;++n){var r=t[n];if(e.style.cssText="width:"+r+"(1px);",e.style.length)return r}return null}(),i.supportTransform=o("transform"),i.supportTransition=o("transition"),Function.prototype.bind||(Function.prototype.bind=function(e){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var t=Array.prototype.slice.call(arguments,1),n=this,r=function(){},o=function(){return n.apply(this instanceof r?this:e,t.concat(Array.prototype.slice.call(arguments)))};return this.prototype&&(r.prototype=this.prototype),o.prototype=new r,o});var h=!1;try{var v=Object.defineProperty({},"passive",{get:function(){h=!0}});t.addEventListener("test",null,v)}catch(e){}i.supportPassiveEvents=h,i.supportResizeObserver=c()!==n,i.supportMutationObserver=l()!==n,function(){function n(e,t){var n=Math.abs(e),r=Math.abs(t);return!(n===r||n+1===r||n-1===r)}function r(){var e=screen.deviceXDPI||0,n=screen.logicalXDPI||1;return t.devicePixelRatio||e/n}if(!u.x||!u.y){var o=e(t).width(),l=e(t).height(),c=r();e(t).on("resize",function(){if(m.length>0){var f=e(t).width(),u=e(t).height(),h=f-o,v=u-l;if(0===h&&0===v)return;var d=Math.round(f/(o/100)),p=Math.round(u/(l/100)),y=Math.abs(h),g=Math.abs(v),w=Math.abs(d),x=Math.abs(p),C=r(),S=y>2&&g>2,k=!n(w,x),z=C!==c&&c>0;if(!!(S&&k&&z)){a.append(s);var O=s[0];i.nativeScrollbarSize={x:O.offsetHeight-O.clientHeight,y:O.offsetWidth-O.clientWidth},s.remove(),e.each(m,function(){this[b].update("zoom")})}o=f,l=u,c=C}})}}(),Date.now=Date.now||function(){return(new Date).getTime()}}function v(){var t,r=this,o=[],i=[],a=!1,s=33,l=Date.now(),c=function(){if(o.length>0&&a){t=f()(function(){c()});var e=Date.now(),r=e-l;if(r>s){l=e-r%s;for(var u=33,h=0;h<o.length;h++){var v=o[h];if(v!==n){var d=v.options(),p=d.autoUpdate,y=Math.max(1,d.autoUpdateInterval),m=Date.now();(!0===p||null===p)&&m-i[h]>y&&(v.update("auto"),i[h]=new Date(m+=y)),u=Math.max(1,Math.min(u,y))}}s=u}}else s=33};r.add=function(t){-1===e.inArray(t,o)&&(o.push(t),i.push(Date.now()),o.length>0&&!a&&(a=!0,p.autoUpdateLoop=a,c()))},r.remove=function(r){var s=e.inArray(r,o);s>-1&&(i.splice(s,1),o.splice(s,1),0===o.length&&a&&(a=!1,p.autoUpdateLoop=a,t!==n&&(u()(t),t=-1)))}}function d(h,v){function d(){if(!Ve){var e=ot[0],t={w:e.scrollWidth,h:e.scrollHeight};if(Tn){var n=z(t,Qt);Qt=t,n&&Se(!0,!1)}else Qt=t}}function m(e,t,n){e=e[0];for(var r=t.split(ir),o=0;o<r.length;o++)e.addEventListener(r[o],n,{passive:!0})}function b(e,t,n){e=e[0];for(var r=t.split(ir),o=0;o<r.length;o++)e.removeEventListener(r[o],n,{passive:!0})}function w(e){if(e!==n&&Ie){var t=e.contents()[0];t[mr].unobserve(t)}}function x(e){if(e!==n&&Ie){var t=e.contents()[0];t[mr].observe(t)}}function C(t,n){var r=function(e){t.scrollTop(3333333),t.scrollLeft(Xe?ke.n?-3333333:ke.i?0:3333333:3333333),n()};if(Ie){var o=c(),i=t.append(nr+Dr+" observed"+rr).contents()[0];(i[mr]=new o(r)).observe(i)}else{var a="animationstart mozAnimationStart webkitAnimationStart MSAnimationStart";if(Oe>9||!ze){var s=nr+Dr+'">';s+=nr+Er+'" dir="ltr">',s+=nr+Er+'">',s+=nr+Lr+rr,s+="</div>",s+=nr+Er+'">',s+=nr+Lr+'" style="width: 200%; height: 200%'+rr,s+="</div>",s+="</div>",s+="</div>",t.prepend(s);var l,h,v,d,y=(t=t[0]).childNodes[0].childNodes[0],m=e(y.childNodes[1]),b=e(y.childNodes[0]),g=e(b[0].childNodes[0]),w=y.offsetWidth,x=y.offsetHeight,C=p.nativeScrollbarSize,S=function(){b[lr](3333333)[cr](3333333),m[lr](3333333)[cr](3333333)},k=function(){h=0,l&&(w=v,x=d,r())},z=function(e){return v=y.offsetWidth,d=y.offsetHeight,l=v!=w||d!=x,e&&l&&!h?(u()(h),h=f()(k)):e||k(),S(),e&&(e.preventDefault(),e.stopPropagation()),!1},O={};O[Fn]=-2*(C.y+1),O[Bn]=-2*C.x,O[_n]=-2*C.y,O[Xn]=-2*(C.x+1),e(y).css(O),b.on(Zn,z),m.on(Zn,z),e(t).on(a,function(){z(!1)});var M={};M[qn]=3333333,M[Jn]=3333333,g.css(M),S()}else{var T=Ze[0],A=t;t=t[0];var H=T.attachEvent,W="undefined"==typeof navigator||(navigator.userAgent.match(/Trident/)||navigator.userAgent.match(/Edge/));if(H)A.prepend(nr+Dr+rr),A.find(or+Dr).first()[0].attachEvent("onresize",r);else{var D=T.createElement("object");D.setAttribute("tabindex","-1"),D.setAttribute("class",Dr),D.onload=function(){var e=this.contentDocument.defaultView;e.addEventListener("resize",r),e.document.documentElement.style.display="none"},D.type="text/html",W&&A.prepend(D),D.data="about:blank",W||A.prepend(D),A.on(a,r)}}}if((t=e(t))[0]===ot[0]){var E=function(){var e=nt.css("direction");if(e!==Wt){var n={},r=0;return"ltr"===e?(n[Xn]=0,n[Bn]=Gn,r=3333333):(n[Xn]=Gn,n[Bn]=0,r=ke.n?-3333333:ke.i?0:3333333),ot.children().first().css(n),t.scrollLeft(r),t.scrollTop(3333333),Wt=e,!0}return!1};E(),t.on(Zn,function(e){return E()&&Se(),e.preventDefault(),e.stopPropagation(),!1})}}function S(e){if(Ie){var t=e.contents()[0];t[mr].disconnect(),delete t[mr]}else e.children(or+Dr).first().remove()}function k(e,t,r){return!0===r?r:t===n||e!==t}function z(e,t,r,o,i){if(!0===i)return i;if(o===n&&i===n){if(!0===r)return r;r=n}return r=r===n?"w":r,o=o===n?"h":o,t===n||(e[r]!==t[r]||e[o]!==t[o])}function O(e,t){return t===n||(e.t!==t.t||e.r!==t.r||e.b!==t.b||e.l!==t.l)}function M(t){return"function"===e.type(t)}function T(e,t){e.call(Mn,t)}function A(e,t,r){r===n&&(r=[Qn,Qn,Qn,Qn]),e[t+Fn]=r[0],e[t+Bn]=r[1],e[t+_n]=r[2],e[t+Xn]=r[3]}function H(){hn&&!un&&(cn.observe(nt[0],{attributes:!0,attributeOldValue:!0,attributeFilter:["id","class","style"]}),fn.observe(Hn?tt[0]:ct[0],{attributes:!0,attributeOldValue:!0,subtree:!Hn,childList:!Hn,attributeFilter:Hn?["wrap","cols","rows"]:["id","class","style"]}),un=!0)}function W(){hn&&un&&(cn.disconnect(),fn.disconnect(),un=!1)}function D(e){if(!Ve){var t=e.originalEvent||e,r=t.touches!==n,o=r?t.touches[0]:e;(1===e.buttons||1===e.which||r)&&(un&&(Cn=!0,W()),to.x=o.pageX,to.y=o.pageY,no.w=nt[0].offsetWidth-(Ne?0:Pe),no.h=nt[0].offsetHeight-(Ne?0:Ue),Ze.on(pr,V),Ze.on(hr,E),Ze.on(ur,L),et.addClass(Kr),ut.setCapture&&ut.setCapture(),e.preventDefault(),e.stopPropagation())}}function E(e){var t=e.originalEvent||e,r=t.touches!==n?t.touches[0]:e,o={};(zn||kn)&&(o[qn]=no.w+r.pageX-to.x),(On||kn)&&(o[Jn]=no.h+r.pageY-to.y),nt.css(o),e.stopPropagation()}function L(e){var t=e!==n;Ze.off(pr,V),Ze.off(hr,E),Ze.off(ur,L),et.removeClass(Kr),ut.releaseCapture&&ut.releaseCapture(),t&&(Cn&&H(),Mn.update(Gn)),Cn=!1}function R(){if(!Ve){var e=!jt,t=In.w-(Ne||Dt||!St?0:Ue+Fe),n=In.h-(Ne||Dt||!kt?0:Ue+Fe),r={},o=St||e,i=tt[0];r[Vn+qn]=Qn,r[Vn+Jn]=Qn,r[qn]=Gn,tt.css(r);var a=i.offsetWidth,s=o?Math.max(a,i.scrollWidth-1):1;s+=St?Be+(Ne?0:e?0:Pe+je):0,r[qn]=St?s:$n,r[Jn]=Gn,tt.css(r);var l=i.offsetHeight,c=Math.max(l,i.scrollHeight-1);return r[qn]=s,r[Jn]=c,ft.css(r),r[Vn+qn]=t+(!Ne&&St?Pe+je:0),r[Vn+Jn]=n+(!Ne&&kt?Ue+Fe:0),tt.css(r),{ow:a,oh:l,dw:s,dh:c}}}function I(){var e=tt.prop("selectionStart");if(e!==n){for(var t=tt.val(),r=t.length,o=t.split("\n"),i=o.length,a=t.substr(0,e).split("\n"),s=0,l=0,c=a.length,f=a[a.length-1].length,u=0;u<o.length;u++){var h=o[u].length;h>l&&(s=u+1,l=h)}return{cursorRow:c,cursorCol:f,rows:i,cols:l,wRow:s,pos:e,max:r}}}function N(e){for(var t=0;t<$r.length;t++)if(e===$r[t])return!0;return!1}function P(){R(),Mn.update(Gn)}function U(t){var n=t.keyCode;if(!N(n)){if(0===eo.length){var r=function(){R(),Mn.update(Gn)};r(),vn=setInterval(r,1e3/60)}-1===e.inArray(n,eo)&&eo.push(n)}}function j(t){var n=t.keyCode;if(!N(n)){var r=e.inArray(n,eo);r>-1&&eo.splice(r,1),0===eo.length&&(R(),Mn.update(Gn),clearInterval(vn))}}function F(){setTimeout(function(){R(),Mn.update(Gn)},50)}function B(){dn=!0}function _(){dn=!1,clearInterval(vn),eo=[],R(),Mn.update(Gn)}function X(e){return tt[lr](ke.i&&nn?9999999:0),tt[cr](0),e.preventDefault(),e.stopPropagation(),!1}function V(e){return e.preventDefault(),!1}function Y(){return Nt&&We.x&&We.y}function q(e,t,n){var r=e?wr:xr,o=e?ht:pt;t?nt.removeClass(r):nt.addClass(r),n?o.removeClass(jr):o.addClass(jr)}function J(e,t){if(clearTimeout(pn),e)ht.removeClass(Fr),pt.removeClass(Fr);else{var n=function(){if(!xn){var e=dt.hasClass("active")||mt.hasClass("active");e||!bn&&!gn||ht.addClass(Fr),e||!bn&&!gn||pt.addClass(Fr)}};yn>0&&!0!==t?pn=setTimeout(n,yn):n()}}function K(e){var t={},n=ee(e),r=Math.min(1,(bt[n._wh]-(Dt?e?Pe:Ue:0))/gt[n._wh]);t[n.wh]=Math.floor(100*r*100)/100+"%",Y()||n.h.css(t),n.i.hl=n.h[0]["offset"+n.WH],n.i.hlr=r}function Q(e,t){var n=Xe&&e,r={},o=ee(e),i=st[0][Zn+o.WH]-st[0]["client"+o.WH];ke.n&&n&&(i*=-1);var a=t/i;a=isNaN(a)?0:Math.min(1,a),o.i.ms=i,o.i.cs=t,o.i.csr=a;var s=o.i.hl,l=o.t[0]["offset"+o.WH],c=(l-s)*a;if(c=isNaN(c)?0:c,n&&(ke.n||!ke.n&&!ke.i)&&(c=l-s-c),c=Math.max(0,c),Le){n&&(c=-(l-s-c));var f;f=e?"translate("+c+"px, 0px)":"translate(0px, "+c+"px)",r["-webkit-transform"]=f,r["-moz-transform"]=f,r["-ms-transform"]=f,r["-o-transform"]=f,r.transform=f}else r[o.lt]=c;Y()||o.h.css(r),o.i.ho=c,o.i.tl=l}function G(e,t){var n=t?"removeClass":"addClass",r=e?vt:dt,o=e?yt:mt,i=e?Nr:Ur;r[n](i),o[n](i)}function Z(){ht=e(nr+Rr+ir+qr+rr),vt=e(nr+Ir+rr),dt=e(nr+Pr+rr),pt=e(nr+Rr+ir+Jr+rr),yt=e(nr+Ir+rr),mt=e(nr+Pr+rr),ht.append(vt),vt.append(dt),pt.append(yt),yt.append(mt),ut.before(ht),ut.before(pt),Ee&&(ht.on(yr,function(e){e.target===ht[0]&&(K(!0),Q(!0,st[lr]()))}),pt.on(yr,function(e){e.target===pt[0]&&(K(!1),Q(!1,st[cr]()))})),$(!0),$(!1)}function $(e){var t,r,o,i=ee(e),a="page"+i.XY,s=Zn+i.LT,l=1,c=function(){l=.5},f=function(){l=1},u=function(o){var l=o.originalEvent||o,c=l.touches!==n?l.touches[0]:o,f=i.i.tl,u=i.i.hl,h=i.i.ms*((u/2+c[a]-r-u/2)/(f-u));h=isFinite(h)?h:0,Xe&&e&&(ke.n||!ke.n&&!ke.i)&&(h*=-1),st[s](t+h),Re||o.preventDefault()},h=function(e){e=e||e.originalEvent,et.removeClass(Kr),i.h.removeClass("active"),i.t.removeClass("active"),i.s.removeClass("active"),Re?(b(Ze,hr,u),b(Ze,ur,h),b(Ze,vr,v),b(Ze,dr,d),b(Ze,pr,V)):(Ze.off(hr,u),Ze.off(ur,h),Ze.off(vr,v),Ze.off(dr,d),Ze.off(pr,V)),f(),t=n,r=n,o!==n&&(Mn.scrollStop(),clearTimeout(o),o=n);var a=nt[0].getBoundingClientRect();e.clientX>=a.left&&e.clientX<=a.right&&e.clientY>=a.top&&e.clientY<=a.bottom||ne(),bn&&J(!1)},v=function(e){16==e.keyCode&&c()},d=function(e){16==e.keyCode&&f()};i.h.on(fr,function(o){if(!Ve){var l=o.originalEvent||o,c=l.touches!==n;if(!Y()&&en&&(!c||wn)&&(1===o.buttons||1===o.which||c)){var f=c?l.touches[0]:o;t=st[s](),t=t===n?0:t,(Xe&&e&&!ke.n||!Xe)&&(t=t<0?0:t),r=f[a],et.addClass(Kr),i.h.addClass("active"),i.s.addClass("active"),Re?(m(Ze,pr,V),m(Ze,hr,u),m(Ze,ur,h)):(Ze.on(pr,V),Ze.on(hr,u),Ze.on(ur,h)),o.preventDefault()}}}),i.t.on(fr,function(t){if(!Ve){var s=t.originalEvent||t,f=s.touches!==n;if(!Y()&&$t&&(!f||wn)&&(1===t.buttons||1===t.which||f)){var u,p=f?s.touches[0]:t,y=In[i._wh],b=i.t.offset()[i.lt],g=!0;t.shiftKey&&c();var w=function(){var t=i.i.ho,a=i.i.hl,s=r-b,c=200*l,f=g?Math.max(333,c):c,h={},v=Xe&&e&&(!ke.i&&!ke.n||nn),d=t>s;v&&(d=t<s),d?(u===n&&(u=!0),h[i.xy]="-="+y):(u===n&&(u=!1),h[i.xy]="+="+y),Mn.scrollStop(),Mn.scroll(h,c,"linear");var p=u?t<=s:t+a>=s;v&&(p=u?t+a>=s:t<=s),p?(clearTimeout(o),Mn.scrollStop(),o=n):o=setTimeout(w,f),g=!1};r=p[a],et.addClass(Kr),i.t.addClass("active"),i.s.addClass("active"),Re?(m(Ze,pr,V),m(Ze,ur,h),m(Ze,vr,v),m(Ze,dr,d)):(Ze.on(pr,V),Ze.on(ur,h),Ze.on(vr,v),Ze.on(dr,d)),w(),t.preventDefault()}}}).hover(function(){bn&&(xn=!0,J(!0))},function(){bn&&(xn=!1,J(!1))}),i.s.on(fr,function(e){e.stopPropagation()})}function ee(e){return{wh:e?qn:Jn,WH:e?"Width":"Height",lt:e?Xn:Fn,LT:e?"Left":"Top",xy:e?er:tr,XY:e?"X":"Y",_wh:e?"w":"h",_lt:e?"l":"t",t:e?vt:yt,h:e?dt:mt,s:e?ht:pt,i:e?Ln:Rn}}function te(){gn&&J(!0)}function ne(){gn&&!et.hasClass(Kr)&&J(!1)}function re(e){if(!Ve){var t=Je.callbacks,r=t.onScrollStart,o=t.onScroll,i=t.onScrollStop;Ye!==n?clearTimeout(Ye):(bn&&J(!0),Y()||nt.addClass(zr),M(r)&&T(r,e)),Q(!0,st[lr]()),Q(!1,st[cr]()),M(o)&&T(o,e),Ye=setTimeout(function(){oe(e),M(i)&&T(i,e)},Nn)}}function oe(e){clearTimeout(Ye),Ye=n,bn&&J(!1),Y()||nt.removeClass(zr)}function ie(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}function ae(t,r,o,i,a){var s=!1;if(o=o===n?Qn:o,typeof r!==sr)return s;if(0===r.length)return s;if(""===o){for(var l=r.split("."),c=t,f="",u=!1,h=0;h<l.length;h++){var v=l[h];if(c=c[v],f+=v+or,"object"!==e.type(c)&&h+1!==l.length){u=!0;break}}if(u)return f.slice(0,-1)}for(var d in t)if(t.hasOwnProperty(d)){var p=o+d===r;if("object"!==e.type(t[d])||p){if(p){"function"==typeof i&&i(t,d),s=!0;break}}else if(s=ae(t[d],r,o+d+or,i,a),"function"==typeof a&&a(t,d),s)break}return s}function se(e,t){return ae(e,t)}function le(e,t){var n;return ae(e,t,Qn,function(e,t){n=e[t]}),n}function ce(t,n,r,o){var i=!1;if(ae(t,n,Qn,function(e,t){e[t]=r,i=!0}),!i&&o){for(var a=n.split("."),s={},l=s,c=0;c<a.length;c++){var f=c===a.length-1?r:{};l=l[a[c]]=f}e.extend(!0,t,s),i=!0}return i}function fe(t,n,r){var o=!1;return ae(t,n,Qn,function(e,t){delete e[t],o=!0},function(t,n){r&&e.isEmptyObject(t[n])&&delete t[n]}),o}function ue(t,r,o,i){var a,s,l,c,f,u={n:r,s:!1,v:n,p:n},h="undefined",v=se(t,r),d=le(t,r),p=!1,y=!0!==v,m=sr,b=!1;for("array"!==e.type(o)&&(o=[o]),f=o.length,s=0;s<f;s++){var w=o[s];if("*"===w)if(f>1){var x=0;for(c=0;c<f;c++){var C=o[c];if(e.type(C)===m&&++x>1)break}1===x&&(b=!0)}else b=!0;w===n&&(p=!0)}if(y&&!1===v&&p&&(y=!1),!y){a=d,h=e.type(a);var S=function(t){var n=e.type(t);return n===h&&(n!==m||(!!b||a===t))&&(u.s=!0,u.v=a,u.p=a,!0)};for(s=0;s<f;s++){var k=o[s];if(e.type(k)===m){var z=k.split(":"),O=z[0],M=!1;for(l=0;l<z.length;l++)if(S(z[l])){b||(u.p=O),M=!0;break}if(M)break}else if(S(k))break}}if(!u.s){var T='The option "'+r+"\" wasn't set, because";if(y&&!1!==v){var A=se(g,r);!0===A?console.warn(T+' "'+v+'" is not from type [ OBJECT ].'):(T='The option "'+r+'" is not a default option',!1===A?console.warn(T+or):console.warn(T+" and couldn't be resolved, because \""+A+'" is not from type [ OBJECT ].'))}else{var H=[],W=Qn,D=!1,E=Qn;for(s=0;s<f;s++){var L=o[s],R=e.type(L);if(R===m){D=!b;var I=L.split(":");for(l=0;l<I.length;l++)E+='"'+I[l]+'", '}-1===e.inArray(R,H)&&(H.push(R),W=W+R.toUpperCase()+", ")}W=W.slice(0,-2),D&&(E=E.slice(0,-2)),console.warn(T+" it doesn't accept the type [ "+h.toUpperCase()+' ] with the value of "'+a+'".\r\nAccepted types are: [ '+W+" ]."+(D?"\r\nValid strings are: [ "+E+" ].":Qn))}}return(i=i===n||i)&&fe(t,r),u}function he(){var e={};return Wn&<&&(e.w=we(lt.css(Vn+qn)),e.h=we(lt.css(Vn+Jn)),e.c=z(e,ln),e.f=!0),ln=e,e.c}function ve(t,n){var r,o,i={};for(r=0;r<t.length;r++){var a=t[r],s=[];if(a.s){var l=a.n.split(".");for(o=0;o<l.length;o++)s[o]={},s[o][l[o]]={};for(o=0;o<s.length;o++){var c=!1,f=s[o];o+1===s.length&&(c=!0);for(var u in f)f.hasOwnProperty(u)&&(f[u]=s[o+1],c&&(f[u]=n?a.p:a.v))}e.extend(!0,i,s[0])}}return i}function de(e,t){var n,r=[],o=[];for(n=0;n<e.length;n++)r[e[n]]=!0;for(n=0;n<t.length;n++)r[t[n]]?delete r[t[n]]:r[t[n]]=!0;for(var i in r)o.push(i);return o}function pe(t,r){var o=r!==n&&null!==r?r.split(ir):Qn,i=t!==n&&null!==t?t.split(ir):Qn;if(o===Qn&&i===Qn)return!1;var a=de(i,o),s=!1,l=on!==n&&null!==on?on.split(ir):[Qn],c=rn!==n&&null!==rn?rn.split(ir):[Qn],f=e.inArray(Qr,a);f>-1&&a.splice(f,1);for(var u=0;u<a.length;u++){var h=a[u];if(0!==h.indexOf(br)){var v,d=!0,p=!0;for(v=0;v<l.length;v++)if(h===l[v]){d=!1;break}for(v=0;v<c.length;v++)if(h===c[v]){p=!1;break}if(d&&p){s=!0;break}}}return s}function ye(e){var t=e.attributeName,n=e.target;if(n===ct[0])return!1;if("attributes"===e.type&&("class"===t||"style"===t)&&!Hn){if("function"!=typeof n.closest)return!0;if(null!==n.closest(or+Dr)||null!==n.closest(or+Rr)||null!==n.closest(or+Br))return!1}return!0}function me(t){t=e.extend(!0,{},qe,t);var n=["*",null],r=["v-h:visible-hidden","v-s:visible-scroll","s:scroll","h:hidden"],o=["v:visible","h:hidden","a:auto"],i=["n:never","s:scroll","l:leave"],a=["n:none","b:both","h:horizontal","v:vertical"],s=ar+"s.",l=[!0,null],c=[new Function,null],f=[];f.push(ue(t,"nativeScrollbarsOverlaid.showNativeScrollbars",!0)),f.push(ue(t,"nativeScrollbarsOverlaid.initialize",!0)),f.push(ue(t,"overflowBehavior."+er,r)),f.push(ue(t,"overflowBehavior."+tr,r)),f.push(ue(t,s+"visibility",o)),f.push(ue(t,s+"autoHide",i)),f.push(ue(t,s+"autoHideDelay",0)),f.push(ue(t,s+"clickScrolling",!0)),f.push(ue(t,s+"dragScrolling",!0)),f.push(ue(t,s+"touchSupport",!0)),f.push(ue(t,"textarea.dynWidth",!0)),f.push(ue(t,"textarea.dynHeight",!0)),f.push(ue(t,"className",n)),f.push(ue(t,"resize",a)),f.push(ue(t,"sizeAutoCapable",!0)),f.push(ue(t,"paddingAbsolute",!0)),f.push(ue(t,"clipAlways",!0)),f.push(ue(t,"normalizeRTL",!0)),f.push(ue(t,"autoUpdate",l)),f.push(ue(t,"autoUpdateInterval",0)),f.push(ue(t,"callbacks.onInitialized",c)),f.push(ue(t,"callbacks.onInitializationWithdrawn",c)),f.push(ue(t,"callbacks.onDestroyed",c)),f.push(ue(t,"callbacks.onScrollStart",c)),f.push(ue(t,"callbacks.onScroll",c)),f.push(ue(t,"callbacks.onScrollStop",c)),f.push(ue(t,"callbacks.onDirectionChanged",c)),f.push(ue(t,"callbacks.onContentSizeChanged",c)),f.push(ue(t,"callbacks.onHostSizeChanged",c)),f.push(ue(t,"callbacks.onOverflowChanged",c)),f.push(ue(t,"callbacks.onOverflowAmountChanged",c)),f.push(ue(t,"callbacks.onUpdated",c));for(var u in t)t.hasOwnProperty(u)&&se(g,u)&&e.isEmptyObject(t[u])&&delete t[u];if(!e.isEmptyObject(t)){var h=function(t){e.each(t,function(n,r){e.isPlainObject(r)?h(r):"function"===e.type(r)&&(t[n]=e.type(r))})};h(t),console.warn("The following options are discarded due to invalidity:\r\n"+JSON.stringify(t,null,2))}qe=e.extend(!0,{},qe,ve(f,!1)),Je=e.extend(!0,{},Je,ve(f,!0))}function be(){if(Ve)return!1;var e,t=Hn&&St&&!jt?tt.val().length:0,n=!un&&St&&!Hn,r={};n&&(e=ct.css(Kn),r[Kn]=Xe?Bn:Xn,r[qn]=Gn,ct.css(r));var o={w:Ce().scrollWidth+t,h:Ce().scrollHeight+t};n&&(r[Kn]=e,r[qn]=$n,ct.css(r));var i=he(),a=z(o,Kt)||i;return Kt=o,a}function ge(){if(Ve||un)return!1;var e=nt.attr("id")||Qn,t=k(e,Bt),n=nt.attr("class")||Qn,r=k(n,_t),o=nt.attr("style")||Qn,i=k(o,Xt),a=nt.is(":visible")||Qn,s=k(a,Vt),l=Hn?tt.attr("rows")||Qn:Qn,c=k(l,Yt),f=Hn?tt.attr("cols")||Qn:Qn,u=k(f,qt),h=Hn?tt.attr("wrap")||Qn:Qn,v=k(h,Jt);return Bt=e,r&&(r=pe(_t,n)),_t=n,Xt=o,Vt=a,Yt=l,qt=f,Jt=h,t||r||i||s||c||u||v}function we(e){var t=parseInt(e);return isNaN(t)?0:t}function xe(e){if(!Tn)return!0;var t=[qn,Vn+qn,Yn+qn,Pn+Xn,Pn+Bn,Xn,Bn,"font-weight","word-spacing"],n=[Un+Xn,Un+Bn,jn+Xn+qn,jn+Bn+qn],r=[Jn,Vn+Jn,Yn+Jn,Pn+Fn,Pn+_n,Fn,_n,"line-height"],o=[Un+Fn,Un+_n,jn+Fn+qn,jn+_n+qn],i="s"===Rt.x||"v-s"===Rt.x,a=!1,s=function(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return!0;return!1};return("s"===Rt.y||"v-s"===Rt.y)&&((a=s(r,e))||Ne||(a=s(o,e))),i&&!a&&((a=s(t,e))||Ne||(a=s(n,e))),a}function Ce(){return Hn?ft[0]:ct[0]}function Se(t,r,o){var i=Date.now(),a=Zr>0&&Tn&&i-Ke<Zr&&!kt&&!St;if(clearTimeout(Qe),a&&(Gr.h=t,Gr.c=r,Gr.f=o,Qe=setTimeout(Se,Zr)),!(a||Ve||Tn&&!o&&nt.is(":hidden")||"inline"===nt.css("display"))){Ke=i,t=t||Gr.h,r=r||Gr.c,o=o||Gr.f,Gr={},t=t!==n&&t,r=r!==n&&r,o=o!==n&&o,!Me||We.x&&We.y?Ae=e.extend(!0,{},p.nativeScrollbarSize):(Ae.x=0,Ae.y=0),He={x:3*(Ae.x+(We.x?0:3)),y:3*(Ae.y+(We.y?0:3))},w(ot),w(rt);var s={l:st[lr](),t:st[cr]()},l=Je.callbacks,c=Je.scrollbars,f=Je.textarea,u=l.onUpdated,h=l.onOverflowChanged,v=l.onOverflowAmountChanged,d=l.onDirectionChanged,g=l.onContentSizeChanged,S=l.onHostSizeChanged,E=c.visibility,L=k(E,Gt,o),N=c.autoHide,P=k(N,Zt,o),U=c.clickScrolling,j=k(U,$t,o),F=c.dragScrolling,B=k(F,en,o),_=Je.className,X=k(_,rn,o),V=Je.resize,Y=k(V,tn,o)&&!Wn,Z=!!Hn&&"off"!==tt.attr("wrap"),$=k(Z,jt,o),ee=Je.paddingAbsolute,re=k(ee,Dt,o),oe=Je.clipAlways,ie=k(oe,Et,o),ae=Je.sizeAutoCapable&&!Wn,se=k(ae,Ut,o),le=Je.nativeScrollbarsOverlaid.showNativeScrollbars,ce=k(le,Nt),fe=Je.autoUpdate,ue=k(fe,Pt),ve=Je.overflowBehavior,de=z(ve,Rt,er,tr,o),pe=f.dynWidth,ye=k(sn,me),me=f.dynHeight,be=k(an,me);if(mn="n"===N,bn="s"===N,gn="l"===N,yn=c.autoHideDelay,wn=c.touchSupport,on=rn,Sn="n"===V,kn="b"===V,zn="h"===V,On="v"===V,nn=Je.normalizeRTL,le=le&&We.x&&We.y,Gt=E,Zt=N,$t=U,en=F,rn=_,tn=V,jt=Z,Dt=ee,Et=oe,Ut=ae,Nt=le,Pt=fe,Rt=e.extend(!0,{},ve),sn=pe,an=me,X&&(nt.removeClass(on).removeClass(Qr),_!==n&&null!==_&&_.length>0?nt.addClass(_):nt.addClass(Qr)),ue&&(!0===fe?(W(),y.add(Mn)):null===fe&&ze?(W(),y.add(Mn)):(y.remove(Mn),H())),se)if(ae)if(it===n&&(it=e(nr+Hr+rr),at.before(it)),Dn)rt.show();else{rt=e(nr+Wr+rr),it.before(rt);var ge={w:-1,h:-1};C(rt,function(){var e={w:rt[0].offsetWidth,h:rt[0].offsetHeight};z(e,ge)&&(Tn&&kt&&e.h>0||St&&e.w>0?Se():(Tn&&!kt&&0===e.h||!St&&0===e.w)&&Se()),ge=e}),Dn=!0,null!==Te&&rt.css(Jn,Te+"(100% + 1px)")}else Dn&&rt.hide();o&&(ot.find("*").trigger(Zn),Dn&&rt.find("*").trigger(Zn));var xe,Oe=nt.css("direction"),Ee=k(Oe,Ht,o),Le=nt.css("box-sizing"),Ie=k(Le,Ot,o),Ye={c:o,t:we(nt.css(Un+Fn)),r:we(nt.css(Un+Bn)),b:we(nt.css(Un+_n)),l:we(nt.css(Un+Xn))};try{xe=Dn?rt[0].getBoundingClientRect():null}catch(e){return}Ne="border-box"===Le;var qe=(Xe="rtl"===Oe)?Xn:Bn,Ge=Xe?Bn:Xn,Ze=!1,$e=!(!Dn||"none"===nt.css(Kn))&&(0===Math.round(xe.right-xe.left)&&(!!ee||nt[0].clientWidth-Pe>0));if(ae&&!$e){var et=nt[0].offsetWidth,ht=it.css(qn);it.css(qn,Gn);var vt=nt[0].offsetWidth;it.css(qn,ht),(Ze=et!==vt)||(it.css(qn,et+1),vt=nt[0].offsetWidth,it.css(qn,ht),Ze=et!==vt)}var dt=($e||Ze)&&ae,pt=k(dt,St,o),yt=!dt&&St,mt=!!Dn&&0===Math.round(xe.bottom-xe.top),Wt=k(mt,kt,o),Bt=!mt&&kt,_t="-"+qn,Xt=dt&&Ne||!Ne,Vt=mt&&Ne||!Ne,Yt={c:o,t:Vt?we(nt.css(jn+Fn+_t)):0,r:Xt?we(nt.css(jn+Bn+_t)):0,b:Vt?we(nt.css(jn+_n+_t)):0,l:Xt?we(nt.css(jn+Xn+_t)):0},qt={c:o,t:we(nt.css(Pn+Fn)),r:we(nt.css(Pn+Bn)),b:we(nt.css(Pn+_n)),l:we(nt.css(Pn+Xn))},Jt={h:String(nt.css(Yn+Jn)),w:String(nt.css(Yn+qn))},Kt={},Qt={};if(Pe=Ye.l+Ye.r,Ue=Ye.t+Ye.b,Ye.c=O(Ye,Mt),je=Yt.l+Yt.r,Fe=Yt.t+Yt.b,Yt.c=O(Yt,Tt),Be=qt.l+qt.r,_e=qt.t+qt.b,qt.c=O(qt,At),Jt.ih=parseInt(Jt.h),Jt.iw=parseInt(Jt.w),Jt.ch=Jt.h.indexOf("px")>-1,Jt.cw=Jt.w.indexOf("px")>-1,Jt.c=z(Jt,zt,o),Ht=Oe,Ot=Le,St=dt,kt=mt,Mt=Ye,Tt=Yt,At=qt,zt=Jt,Ee&&Dn&&rt.css(Kn,Ge),Ye.c||Ee||re||pt||Wt||Ie||se){var cn={},fn={};A(Qt,Pn,[-Ye.t,-Ye.r,-Ye.b,-Ye.l]),ee?(A(cn,Qn,[Ye.t,Ye.r,Ye.b,Ye.l]),Hn?A(fn,Un):A(Kt,Un)):(A(cn,Qn),Hn?A(fn,Un,[Ye.t,Ye.r,Ye.b,Ye.l]):A(Kt,Un,[Ye.t,Ye.r,Ye.b,Ye.l])),at.css(cn),tt.css(fn)}In={w:at[0].offsetWidth,h:at[0].offsetHeight};var hn=!!Hn&&R();if(mt&&(Wt||re||Ie||Jt.c||Ye.c||Yt.c)?(Jt.cw&&(Kt[Yn+Jn]=Jt.ch?Jt.ih-(ee?Ue:0)+(Ne?-Fe:Ue):Qn),Kt[Jn]=Gn):(Wt||re)&&(Kt[Yn+Jn]=Qn,Kt[Jn]=$n),dt&&(pt||re||Ie||Jt.c||Ye.c||Yt.c||Ee)?(Jt.cw&&(Kt[Yn+qn]=Jt.cw?Jt.iw-(ee?Pe:0)+(Ne?-je:Pe)+(En!==n?En.w:0):Qn),Kt[qn]=Gn,Qt[Yn+qn]=$n):(pt||re)&&(Kt[Yn+qn]=Qn,Kt[qn]=$n,Kt[Kn]=Qn,Qt[Yn+qn]=Qn),dt&&(Jt.cw||(Kt[Yn+qn]=Qn),Qt[qn]=Hn&&pe?hn.dw:Gn,Kt[qn]=Gn,Kt[Kn]=Ge),mt&&(Jt.ch||(Kt[Yn+Jn]=Qn),Qt[Jn]=Hn&&me?hn.dh:Gn),ae&&it.css(Qt),ct.css(Kt),Kt={},Qt={},xt=xt||{x:!1,y:!1},t||r||Ee||Ie||re||pt||dt||Wt||mt||Jt.c||ce||de||ie||Y||L||ye||be||$||re||ye||be||o){var vn={},pn=xt.y&&Ct.ys&&!le?We.y?st.css(qe):-Ae.y:0,xn=xt.x&&Ct.xs&&!le?We.x?st.css(_n):-Ae.x:0;A(vn,Qn),st.css(vn),mt&&!Hn&&(ct.css("overflow","hidden"),Kt.overflow=Qn);var Cn=Ce(),An={w:Cn.clientWidth,h:Cn.clientHeight},Ln={w:Cn.scrollWidth,h:Cn.scrollHeight},Rn={w:Hn&&hn&&!pe?hn.ow:dt?An.w:Ln.w,h:Hn&&hn&&!me?hn.oh:mt?An.h:Ln.h};vn[_n]=Bt?Qn:xn,vn[qe]=yt?Qn:pn,st.css(vn);var Nn=nt[0],or={w:Nn.clientWidth,h:Nn.clientHeight},ir={w:Math.max(Rn.w+(ee?Pe:0),or.w-Pe)-(pe&&Hn&&dt?Be+(Ne?0:Pe+je):0),h:Math.max(Rn.h+(ee?Ue:0),or.h-Ue)};if(ir.c=z(ir,Lt,o),Lt=ir,ae){(ir.c||mt||dt)&&(Qt[qn]=ir.w,Qt[Jn]=ir.h);var ar=Qt[qn]+(Ne?je:-Pe),sr=Qt[Jn]+(Ne?Fe:-Pe),ur={};(!dt||!dt&&Yt.c)&&(Qt[qn]=or.w-(Ne?0:Pe+je)-1-Be),(!mt||!mt&&Yt.c)&&(Qt[Jn]=or.h-(Ne?0:Ue+Fe)-1-_e),Jt.cw&&Jt.iw===ar&&(Qt[qn]=ar+(Ne?0:Pe)+1),Jt.ch&&Jt.ih===sr&&(Qt[Jn]=sr+(Ne?0:Ue)+1),dt&&(An.w<In.w||Hn&&!Z)&&0===Pe&&(Hn&&(ur[qn]=we(ft.css(qn))-1),Qt[qn]-=1),mt&&(An.h<In.h||Hn)&&0===Ue&&(Hn&&(ur[Jn]=we(ft.css(Jn))-1),Qt[Jn]-=1),Rn.h>0&&(Qt[qn]=Math.max(1,Qt[qn]),Qt[Jn]=Math.max(1,Qt[Jn])),Hn&&ft.css(ur),it.css(Qt)}dt&&(Kt[qn]=$n),!dt||Ne||un||(Kt[Kn]="none"),ct.css(Kt),Kt={};var hr=Cn.getBoundingClientRect(),vr={w:Cn.scrollWidth,h:Cn.scrollHeight};if(hr.width!==n){var dr=hr.width,pr=hr.height;vr.w+=we(dr+.001)-dr,vr.h+=we(pr+.001)-pr}vr.c=r=z(vr,gt,o),gt=vr,t=z(or={w:Nn.clientWidth,h:Nn.clientHeight},bt),bt=or;var yr={x:"v-s"===ve.x,y:"v-s"===ve.y},mr={x:"v-h"===ve.x,y:"v-h"===ve.y},br={x:"s"===ve.x,y:"s"===ve.y},gr={x:Math.max(0,vr.w-or.w+(ee?Pe:0)),y:Math.max(0,vr.h-or.h+(ee?Ue:0))},wr=Hn&&(0===In.w||0===In.h);wr&&(gr.x=0,gr.y=0);var xr={x:gr.x>0,y:gr.y>0},Cr={x:xr.x,y:xr.y};(yr.x||mr.x)&&(Cr.x=xr.y&&!yr.y&&!mr.y),(yr.y||mr.y)&&(Cr.y=xr.x&&!yr.x&&!mr.x),Cr.xs=!!Cr.x&&(br.x||yr.x),Cr.ys=!!Cr.y&&(br.y||yr.y);var Dr={x:xr.x&&Cr.xs,y:xr.y&&Cr.ys},Er=It;if(gr.c=z(gr,It,er,tr,o),It=gr,xr.c=z(xr,xt,er,tr,o),xt=xr,Cr.c=z(Cr,Ct,er,tr,o),Ct=Cr,We.x||We.y){var Lr=o,Rr={};if((xr.x||xr.y)&&(Rr.w=We.y&&xr.y?vr.w+De.y:Qn,Rr.h=We.x&&xr.x?vr.h+De.x:Qn,Lr=k(Rr,wt,o),wt=Rr),xr.c||Cr.c||vr.c||Ee||pt||Wt||dt||mt||ce){Kt[jn+Ge]=Qn,Kt[Pn+Ge]=Qn,We.x&&xr.x&&Cr.xs?(mt&&(Kt[Pn+_n]=le?Qn:De.x),Kt[jn+_n]=mt||le?Qn:De.x+"px solid transparent"):(Rr.h=Qn,Lr=!0,Kt[jn+_n]=Qn,Kt[Pn+_n]=Qn),We.y&&xr.y&&Cr.ys?(dt&&(Kt[Pn+qe]=le?Qn:De.y),Kt[jn+qe]=le?Qn:De.y+"px solid transparent"):(Rr.w=Qn,Lr=!0,Kt[jn+qe]=Qn,Kt[Pn+qe]=Qn)}if(le&&(Rr.w=Qn,Rr.h=Qn,Lr=!0),Lr){var Ir={};Ir[qn]=Cr.y?Rr.w:Qn,Ir[Jn]=Cr.x?Rr.h:Qn,lt===n&&(lt=e(nr+Ar+rr),st.prepend(lt)),lt.css(Ir)}ct.css(Kt)}var Nr={},cn={};if(t||xr.c||Cr.c||vr.c||de||Ie||ce||Ee||ie||Wt){Nr[Ge]=Qn;var Pr=function(){Nr[_n]=Qn,En.h=0},Ur=function(){Nr[qe]=Qn,En.w=0};if(xr.x&&Cr.xs?(Nr["overflow-x"]=Zn,le?Pr():(Nr[_n]=-(We.x?De.x:Ae.x),En.h=We.x?De.y:0)):(Nr["overflow-x"]=Qn,Pr()),xr.y&&Cr.ys?(Nr["overflow-y"]=Zn,le?Ur():(Nr[qe]=-(We.y?De.y:Ae.y),En.w=We.y?De.x:0)):(Nr["overflow-y"]=Qn,Ur()),(In.h<He.x||In.w<He.y)&&(xr.x&&Cr.x&&!We.x||xr.y&&Cr.y&&!We.y)?(Nr[Un+Fn]=He.x,Nr[Pn+Fn]=-He.x,Nr[Un+Ge]=He.y,Nr[Pn+Ge]=-He.y):(Nr[Un+Fn]=Qn,Nr[Pn+Fn]=Qn,Nr[Un+Ge]=Qn,Nr[Pn+Ge]=Qn),Nr[Un+qe]=Qn,Nr[Pn+qe]=Qn,xr.x&&Cr.x||xr.y&&Cr.y||wr?Hn&&wr&&(cn["overflow-x"]="hidden",cn["overflow-y"]="hidden"):(!oe||mr.x||yr.x||mr.y||yr.y)&&(Hn&&(cn["overflow-x"]=Qn,cn["overflow-y"]=Qn),Nr["overflow-x"]="visible",Nr["overflow-y"]="visible"),at.css(cn),st.css(Nr),Nr={},(xr.c||Ie||pt||Wt)&&(!We.x||!We.y)){var jr=ct[0],Fr=jr.style;Fr.webkitTransform="scale(1)",Fr.display="run-in";jr.offsetHeight;Fr.display=Qn,Fr.webkitTransform=Qn}if(ce&&le){nt.hide();nt[0].offsetHeight;nt.show()}}if(Kt={},Ee||pt||Wt)if(Xe&&dt){var Br=ct.css(Kn),qr=Math.round(ct.css(Kn,Qn).css(Xn,Qn).position().left);ct.css(Kn,Br),qr!==Math.round(ct.position().left)&&(Kt[Xn]=qr)}else Kt[Xn]=Qn;ct.css(Kt);var Jr="v"===E,Kr="h"===E,$r="a"===E,eo=q.bind(0,!0,!0,Dr.x),to=q.bind(0,!1,!0,Dr.y),no=q.bind(0,!0,!1,Dr.x),ro=q.bind(0,!1,!1,Dr.y);if(Ee&&(Xe?nt.addClass(Sr):nt.removeClass(Sr)),Wn&&nt.addClass(kr),Y){var oo=function(){ut.off(fr,D)};Sn?(nt.addClass(kr),ut.removeClass(_r).removeClass(Xr).removeClass(Vr).removeClass(Yr),oo()):(nt.removeClass(kr),ut.addClass(_r),kn?ut.addClass(Xr):zn?ut.addClass(Vr):On&&ut.addClass(Yr),oo(),ut.on(fr,D))}if((L||de||Cr.c||xr.c||ce)&&(le?ce&&(nt.removeClass(zr),le&&(no(),ro())):$r?(Dr.x?eo():no(),Dr.y?to():ro()):Jr?(eo(),to()):Kr&&(no(),ro())),P||ce){var io=function(){Re?(b(nt,"mouseenter",te),b(nt,"mouseleave",ne)):(nt.off("mouseenter",te),nt.off("mouseleave",ne))};gn?(io(),Re?(m(nt,"mouseenter",te),m(nt,"mouseleave",ne)):(nt.on("mouseenter",te),nt.on("mouseleave",ne))):io(),mn?J(!0):J(!1,!0)}if((t||gr.c||Wt||pt||Y||Ie||re||ce||Ee)&&(K(!0),Q(!0,s.l),K(!1),Q(!1,s.t)),j&&G(!0,U),B&&G(!1,F),Cr.x||Cr.y?nt.addClass(Or):nt.removeClass(Or),Cr.x?nt.addClass(Mr):nt.removeClass(Mr),Cr.y?nt.addClass(Tr):nt.removeClass(Tr),Hn&&r){var ao=I();if(ao!==n){var so=Ft===n||ao.rows!==Ft.rows,lo=ao.wRow,co=ao.cursorRow,fo=ao.cursorCol,uo=ao.rows,ho=ao.cols,vo=ao.pos,po=ao.max===vo&&dn,yo={x:Z||fo!==ho||co!==lo?-1:It.x,y:(Z?po||so&&Er!==n&&s.t===Er.y:(po||so)&&co===uo)?It.y:-1},mo=yo.x>-1,bo=yo.y>-1;(mo||bo)&&(bo&&st[cr](yo.y),mo&&(Xe&&nn&&ke.i?st[lr](0):st[lr](yo.x)))}Ft=ao}else Hn||(Xe&&ke.i&&We.y&&xr.x&&nn&&(s.l+=En.w),st[lr](s.l),st[cr](s.t));Ee&&M(d)&&T(d,{isRTL:Xe,dir:Oe}),t&&M(S)&&T(S,{width:bt.w,height:bt.h}),r&&M(g)&&T(g,{width:gt.w,height:gt.h}),(xr.c||Cr.c)&&M(h)&&T(h,{x:xr.x,y:xr.y,xScrollable:Cr.xs,yScrollable:Cr.ys,clipped:Cr.x||Cr.y}),gr.c&&M(v)&&T(v,{x:gr.x,y:gr.y})}Wn&&(xr.c||ln.c)&&(ln.f||he(),We.y&&xr.x&&ct.css(Vn+qn,ln.w+De.y),We.x&&xr.y&&ct.css(Vn+Jn,ln.h+De.x),ln.c=!1),x(ot),x(rt),M(u)&&T(u,{forced:o})}}if(0!==h.length)if(i(h))a(h).options(v);else{var ke,ze,Oe,Me,Te,Ae,He,We,De,Ee,Le,Re,Ie,Ne,Pe,Ue,je,Fe,Be,_e,Xe,Ve,Ye,qe,Je,Ke,Qe,Ge,Ze,$e,et,tt,nt,rt,ot,it,at,st,lt,ct,ft,ut,ht,vt,dt,pt,yt,mt,bt,gt,wt,xt,Ct,St,kt,zt,Ot,Mt,Tt,At,Ht,Wt,Dt,Et,Lt,Rt,It,Nt,Pt,Ut,jt,Ft,Bt,_t,Xt,Vt,Yt,qt,Jt,Kt,Qt,Gt,Zt,$t,en,tn,nn,rn,on,an,sn,ln,cn,fn,un,hn,vn,dn,pn,yn,mn,bn,gn,wn,xn,Cn,Sn,kn,zn,On,Mn=this,Tn=!1,An=!1,Hn=!1,Wn=!1,Dn=!1,En={w:0,h:0},Ln={},Rn={},In={},Nn=175,Pn="margin-",Un="padding-",jn="border-",Fn="top",Bn="right",_n="bottom",Xn="left",Vn="min-",Yn="max-",qn="width",Jn="height",Kn="float",Qn="",Gn="auto",Zn="scroll",$n="100%",er="x",tr="y",nr='<div class="',rr='"></div>',or=".",ir=" ",ar="scrollbar",sr="string",lr=Zn+"Left",cr=Zn+"Top",fr="mousedown touchstart",ur="mouseup touchend",hr="mousemove touchmove",vr="keydown",dr="keyup",pr="selectstart",yr="transitionend webkitTransitionEnd oTransitionEnd",mr="~_overlayScrollbarsRO_~",br="os-host",gr=br+"-textarea",wr=br+"-"+ar+"-horizontal-hidden",xr=br+"-"+ar+"-vertical-hidden",Cr=br+"-transition",Sr=br+"-rtl",kr=br+"-resize-disabled",zr=br+"-scrolling",Or=br+"-overflow",Mr=Or+"-x",Tr=Or+"-y",Ar="os-content-arrange",Hr="os-content-glue",Wr="os-size-auto-observer",Dr="os-resize-observer",Er="os-resize-observer-item",Lr=Er+"-final",Rr="os-"+ar,Ir=Rr+"-track",Nr=Ir+"-off",Pr=Rr+"-handle",Ur=Pr+"-off",jr=Rr+"-unusable",Fr=Rr+"-"+Gn+"-hidden",Br=Rr+"-corner",_r=Br+"-resize",Xr=_r+"-both",Vr=_r+"-horizontal",Yr=_r+"-vertical",qr=Rr+"-horizontal",Jr=Rr+"-vertical",Kr="os-dragging",Qr="os-theme-none",Gr={},Zr=33,$r=[112,113,114,115,116,117,118,119,120,121,123,33,34,37,38,39,40,16,17,18,19,20,144],eo=[],to={x:0,y:0},no={w:0,h:0};Mn.sleep=function(){Ve=!0},Mn.update=function(e){if(e===Gn){var t=ge(),n=be();(t||n)&&Se(!1,n)}else"zoom"===e?Se(!0,!0):(e=Ve||e,Ve=!1,Se(!1,!1,e))},Mn.options=function(t,n){if(e.isEmptyObject(t)||!e.isPlainObject(t)){if("string"===e.type(t)){if(arguments.length>=2){var r={};return ce(r,t,n,!0),me(r),void Se()}return le(qe,t)}return qe}me(t);var o=Ve||!1;Ve=!1,Se(),Ve=o},Mn.destroy=function(){An=!0,y.remove(Mn),W(),S(ot),Dn&&S(rt),ot.remove(),it!==n&&it.remove(),lt!==n&<.remove(),Dn&&rt.remove(),Re?(b(nt,"mouseenter",te),b(nt,"mouseleave",ne)):(nt.off("mouseenter",te),nt.off("mouseleave",ne)),ht.remove(),pt.remove(),ut.remove(),Sn||L(),ct.contents().unwrap().unwrap().unwrap(),Wn&&$e.removeClass("os-html"),Hn?(tt.off(Zn,X),tt.off("drop",F),tt.off("focus",B),tt.off("focusout",_),Oe>9||!ze?tt.off("input",P):(tt.off(vr,U),tt.off(dr,j)),ft.remove(),tt.removeClass("os-textarea").removeClass("os-text-inherit"),tt.unwrap().removeAttr("style"),nt.remove()):(tt.removeClass(br),nt.removeClass(br).removeClass(kr).removeClass(Sr).removeClass(wr).removeClass(xr).removeClass(Cr).removeClass(zr).removeClass(Or).removeClass(Mr).removeClass(Tr).removeClass(Qr).removeClass(rn)),o(h);var e=Je.callbacks.onDestroyed;M(e)&&T(e);for(var t in Mn)delete Mn[t];Mn=n},Mn.scroll=function(r,o,i,a){if(0===arguments.length||r===n){var s=Ln,l=Rn,c=nn&&Xe&&ke.i,f=nn&&Xe&&ke.n,u=s.cs,h=s.csr,v=s.ms;return h=c?1-h:h,u=c?v-u:u,u*=f?-1:1,v*=f?-1:1,{x:{position:u,ratio:h,max:v,handleOffset:s.ho,handleLength:s.hl,handleLengthRatio:s.hlr,trackLength:s.tl,isRTL:Xe,isRTLNormalized:nn},y:{position:l.cs,ratio:l.csr,max:l.ms,handleOffset:l.ho,handleLength:l.hl,handleLengthRatio:l.hlr,trackLength:l.tl}}}var d,p=[er,Xn,"l"],y=[tr,Fn,"t"],m=["+=","-=","*=","/="],b={},g="object"===e.type(o),w={axis:"xy",block:["begin","begin"],margin:[0,0,0,0]},x=[er,tr,"xy","yx"],C=["begin","end"],S=r.hasOwnProperty("el"),k=S?r.el:r,z=k instanceof jQuery,O=!z&&ie(k),M=function(e,t){for(d=0;d<t.length;d++)if(e===t[d])return!0;return!1},T=function(t){var n={};if("array"===e.type(t)&&t.length>0)n.x=t[0],n.y=t[1];else if(e.type(t)===sr||"number"===e.type(t))n.x=t,n.y=t;else if("object"===e.type(t)){t=e.extend({},t),d=0;for(var r in t)t.hasOwnProperty(r)&&(d>2&&delete t[r],d++);var o=function(e){var n=e?p:y;for(d=0;d<n.length;d++)if(n[d]in t)return t[n[d]]};n.x=o(!0),n.y=o(!1)}return n},A=function(r,o){var i,a,s,l=r?Ln:Rn,c=l.cs,f=l.ms,u=Xe&&r,h=u&&ke.n&&!nn;if(e.type(o)===sr){if(o.length>2){var v=o.substr(0,2);for(d=0;d<m.length;d++)if(v===m[d]){i=m[d];break}}o=(o=(o=(o=(o=(o=(o=(o=(o=i!==n?o.substr(2):o).replace(/min/g,0)).replace(/</g,0)).replace(/max/g,(h?"-":Qn)+$n)).replace(/>/g,(h?"-":Qn)+$n)).replace(/px/g,Qn)).replace(/%/g," * "+f*(u&&ke.n?-1:1)/100)).replace(/vw/g," * "+In.w)).replace(/vh/g," * "+In.h),a=t.eval(o)}else"number"===e.type(o)&&(a=o);if(!isNaN(a)&&a!==n&&"number"===e.type(a)){var p=nn&&u,y=c*(p&&ke.n?-1:1),b=p&&ke.i,g=p&&ke.n;switch(y=b?f-y:y,i){case"+=":s=y+a;break;case"-=":s=y-a;break;case"*=":s=y*a;break;case"/=":s=y/a;break;default:s=a}b&&(s=f-s),g&&(s*=-1),u&&ke.n?(s=Math.max(f,s),s=Math.min(0,s)):(s=Math.min(f,s),s=Math.max(0,s)),s===c&&(s=n)}return s};if(z||O){var H=z?k:e(k);if(0===H.length)return;if(S){var W,D,E,L=r.axis,R=r.block,I=e.type(R),N=r.margin,P=e.type(N);if(I===sr)R=[R,R];else if("array"===I)if((D=R.length)>2||D<1)R=n;else{for(W=!0,1===D&&(R[1]="begin"),d=0;d<D;d++){var U=R[d];if(e.type(U)!==sr||!M(U,C)){W=!1;break}}W||(R=n)}else R=n;if("number"===P)N=[N,N,N,N];else if("boolean"===P)N=N?[we(H.css(Pn+Fn)),we(H.css(Pn+Bn)),we(H.css(Pn+_n)),we(H.css(Pn+Xn))]:[0,0,0,0];else if("array"===P)if(2!==(E=N.length)&&4!==E)N=n;else{for(W=!0,d=0;d<E;d++)if("number"!==e.type(N[d])){W=!1;break}W?2===E&&(N=[N[0],N[1],N[0],N[1]]):N=n}else N=n;w.axis=M(L,x)?L:w.axis,w.block=R||w.block,w.margin=N||w.margin}var j=H.offset(),F=at.offset(),B=In,_={l:Ln.cs,t:Rn.cs},X=w.axis,V=w.block,Y=w.margin,q=V[0]===(Xe?"begin":"end"),J="end"===V[1],K=q||J;j.top-=Y[0],j.left-=Y[3];var Q={x:Math.round(j.left-F.left+_.l),y:Math.round(j.top-F.top+_.t)};if(Xe&&(ke.n||ke.i||(Q.x=Math.round(F.left-j.left+_.l)),ke.n&&nn&&(Q.x*=-1),ke.i&&nn&&(Q.x=Math.round(F.left-j.left+(Ln.ms-_.l)))),K){var G,Z={},$={w:(Z=Le?{w:(G=H[0].getBoundingClientRect())[qn],h:G[Jn]}:{w:H[0].offsetWidth,h:H[0].offsetHeight}).w+Y[3]+Y[1],h:Z.h+Y[0]+Y[2]};q&&(Q.x-=(B.w-$.w)*(Xe&&nn?-1:1)),J&&(Q.y-=B.h-$.h)}X===er&&delete Q.y,X===tr&&delete Q.x,r=Q}b.x=A(!0,T(r).x),b.y=A(!1,T(r).y);var ee=b.x!==n,te=b.y!==n;if(o>0||g){var ne={};ee&&(ne[lr]=b.x),te&&(ne[cr]=b.y),g?st.animate(ne,o):st.animate(ne,o,i,a)}else ee&&st[lr](b.x),te&&st[cr](b.y)},Mn.scrollStop=function(e,t,n){st.stop(e,t,n)},Mn.getElements=function(){return{target:tt,host:nt,padding:at,viewport:st,content:ct,scrollbarHorizontal:{scrollbar:ht,track:vt,handle:dt},scrollbarVertical:{scrollbar:pt,track:yt,handle:mt},scrollbarCorner:ut}},Mn.getState=function(t){var n=function(t){if(!e.isPlainObject(t))return t;var n=e.extend(!0,{},t);fe(n,"c");var r=function(e,t){n.hasOwnProperty(e)&&(n[t]=n[e],delete n[e])};return r("w",qn),r("h",Jn),n},r={sleeping:n(Ve)||!1,autoUpdate:n(!un),widthAuto:n(St),heightAuto:n(kt),padding:n(Mt),overflowAmount:n(It),hideOverflow:n(Ct),hasOverflow:n(xt),contentScrollSize:n(gt),viewportSize:n(In),hostSize:n(bt)};return e.type(t)===sr?le(r,t):r};!function(t,n){s(),Me=p.nativeScrollbarStyling,Ae=e.extend(!0,{},p.nativeScrollbarSize),We=e.extend(!0,{},p.nativeScrollbarIsOverlaid),De=e.extend(!0,{},p.overlayScrollbarDummySize),ke=e.extend(!0,{},p.rtlScrollBehavior),me(e.extend(!0,{},g,n));var r=Je.callbacks;if(We.x&&We.x&&!Je.nativeScrollbarsOverlaid.initialize){var o=r.onInitializationWithdrawn;return M(o)&&T(o),!1}Te=p.cssCalc,Oe=p.msie,ze=p.autoUpdateRecommended,Ee=p.supportTransition,Le=p.supportTransform,Re=p.supportPassiveEvents,Ie=p.supportResizeObserver,hn=p.supportMutationObserver,Ze=e(t[0].ownerDocument),Ge=e(Ze[0].defaultView||Ze[0].parentWindow),$e=Ze.find("html").first(),et=$e.find("body").first(),tt=t,Hn=t.is("textarea");var i;if((Wn=t.is("body"))&&((i={}).l=Math.max(tt[lr](),$e[lr](),Ge[lr]()),i.t=Math.max(tt[cr](),$e[cr](),Ge[cr]())),Hn){tt.wrap(nr+gr+rr),tt.addClass("os-textarea").addClass("os-text-inherit"),nt=t.parent();var a={};Je.sizeAutoCapable||(a[qn]=t.css(qn),a[Jn]=t.css(Jn)),nt.css(a),nt.wrapInner(nr+"os-content"+ir+"os-text-inherit"+rr).wrapInner(nr+"os-viewport"+ir+"os-text-inherit"+rr).wrapInner(nr+"os-padding"+ir+"os-text-inherit"+rr),ct=nt.find(or+"os-content").first(),st=nt.find(or+"os-viewport").first(),at=nt.find(or+"os-padding").first(),ft=e(nr+"os-textarea-cover"+rr),ct.prepend(ft),tt.on(Zn,X),tt.on("drop",F),tt.on("focus",B),tt.on("focusout",_),Oe>9||!ze?tt.on("input",P):(tt.on(vr,U),tt.on(dr,j))}else tt.addClass(br),(nt=t).wrapInner(nr+"os-content"+rr).wrapInner(nr+"os-viewport"+rr).wrapInner(nr+"os-padding"+rr),ct=nt.find(or+"os-content").first(),st=nt.find(or+"os-viewport").first(),at=nt.find(or+"os-padding").first(),ct.on(yr,function(e){!0!==Pt&&xe((e=e.originalEvent||e).propertyName)&&Se(Gn)});if(ut=e(nr+ir+Br+rr),nt.append(ut),Z(),Re?m(st,Zn,re):st.on(Zn,re),Me&&(We.x&&We.y?st.addClass("os-viewport-native-scrollbars-overlaid"):st.addClass("os-viewport-native-scrollbars-invisible")),hn){var c,f=l(),u=Date.now();cn=new f(function(t){if(Tn&&!Ve){var n=!1;e.each(t,function(){var e=this,t=this.target,r=e.attributeName;if(n="class"===r?pe(e.oldValue,t.className):"style"!==r||e.oldValue!==t.style.cssText)return!1}),n&&Mn.update(Gn)}}),fn=new f(function(e){if(Tn&&!Ve){for(var t=!1,n=0;n<e.length;n++)if(ye(e[n])){t=!0;break}if(t){var r=Date.now(),o=kt||St,i=function(){u=r,Hn&&R(),o?Mn.update():Mn.update(Gn)};clearTimeout(c),r-u>11||!o?i():c=setTimeout(i,11)}}})}Wn&&($e.addClass("os-html"),st[lr](i.l),st[cr](i.t)),ot=e(nr+"os-resize-observer-host"+rr),nt.prepend(ot),C(ot,d),d(),Mn.update(Gn),setTimeout(function(){Ee&&!An&&nt.addClass(Cr)},333),Tn=!0;var h=r.onInitialized;return M(h)&&T(h),Tn}(h,v)?Mn=n:r(h,Mn)}}var p,y,m=[],b="__overlayScrollbars__",g={className:"os-theme-dark",resize:"none",sizeAutoCapable:!0,clipAlways:!0,normalizeRTL:!0,paddingAbsolute:!1,autoUpdate:null,autoUpdateInterval:33,nativeScrollbarsOverlaid:{showNativeScrollbars:!1,initialize:!0},overflowBehavior:{x:"scroll",y:"scroll"},scrollbars:{visibility:"auto",autoHide:"never",autoHideDelay:800,dragScrolling:!0,clickScrolling:!1,touchSupport:!0},textarea:{dynWidth:!1,dynHeight:!1},callbacks:{onInitialized:null,onInitializationWithdrawn:null,onDestroyed:null,onScrollStart:null,onScroll:null,onScrollStop:null,onOverflowChanged:null,onOverflowAmountChanged:null,onDirectionChanged:null,onContentSizeChanged:null,onHostSizeChanged:null,onUpdated:null}};e.fn.overlayScrollbars=function(t){var r=this;if(e.isPlainObject(t))return e.each(r,function(){new d(e(this),t)}),r;if(0===r.length)return n;if(1===r.length)return a(e(r[0]));var o=[];return e.each(r,function(){var r=a(e(this));"!"===t?r!==n&&o.push(r):o.push(r)}),o},t.overlayScrollbarsGlobals=function(){s();var t=e.extend(!0,{},p);return delete t.msie,t},t.overlayScrollbarsDefaultOptions=function(t){if(t===n)return e.extend(!0,{},g);g=e.extend(!0,{},g,t),p!==n&&(p.defaultOptions=g)}}(jQuery,window,void 0);