text: // scrollbar.js v1.4.0 | ISC | https://github.com/desto-git/scrollbar.js
  "use strict";var scrollbarjs=function(){var l="scrollbarjs",h=60,u=.9,o=200,c=50,e=document,n=e.head,d=e.body,v=e.createElement.bind(e),f=getComputedStyle,p=function(e,t){e.appendChild(t)},g=function(e,t,i){e.addEventListener(t,i)},L=function(e,t){e.classList.add(t)},x=function(e,t){e.classList.remove(t)},b=function(e){return 1!=(1&e.buttons)},m=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(e=e.filter(function(e){return void 0!==e})).map(function(e){return l+"-"+e}).join(" ")},w=!1,s=0,a=0,H=!1,y=!1,T=!1;!function(){var e="scrollbarjs-sb-size",t=v("style");p(n,t),t.innerHTML="#"+e+"{width:100%;height:100%;overflow:scroll;position:absolute;top:100%;}";var i=v("div");i.id=e,p(d,i),s=i.offsetWidth-i.clientWidth,a=i.offsetHeight-i.clientHeight,t.innerHTML+="#"+e+"::-webkit-scrollbar{display:none}#"+e+"{-ms-overflow-style:none;scrollbar-width:none;}";try{H="none"===f(i,"::-webkit-scrollbar").display}catch(e){}var r=f(i);y="none"===r.msOverflowStyle,T="none"===r.scrollbarWidth,t.parentElement.removeChild(t),i.parentElement.removeChild(i)}();var W,t,k=0;(t=W||(W={}))[t.none=0]="none",t[t.ver=1]="ver",t[t.hor=2]="hor",t[t.both=3]="both";var M,E=W.none,i=function(){clearInterval(S),clearTimeout(C),k=0,x(d,m("drag")),M&&(x(M.parentElement,m("active")),M=null)};g(d,"mouseup",i),g(d,"mouseenter",function(e){b(e)&&i()});var z,r,j=0,D=0,N=0,A=0;g(d,"mousemove",function(e){if(1===k)E===W.ver?(A+=N*(e.clientY-D),B(M,void 0,Math.round(A),!0)):(A+=N*(e.clientX-j),B(M,Math.round(A),void 0,!0));else if(2===k&&E!==W.none){var t=e.clientX-j,i=e.clientY-D;if(E!==W.hor){var r=M.clientHeight;M.style.height=r+i+"px",M.style.height=f(M).height}if(E!==W.ver){var n=M.clientWidth;M.style.width=n+t+"px",M.style.width=f(M).width}}j=e.clientX,D=e.clientY}),(r=z||(z={}))[r.up=0]="up",r[r.right=1]="right",r[r.down=2]="down",r[r.left=3]="left";var C,S,X=function(e,t,i,r){if(!b(e))switch(i){case z.up:B(t,0,-r);break;case z.right:B(t,r,0);break;case z.down:B(t,0,r);break;case z.left:B(t,-r,0)}},Y=m("scroll-none"),q=m("scroll-ver"),F=m("scroll-hor"),I=m("scroll-both"),O=function(e,t){e.classList.contains(t)||(x(e,Y),x(e,q),x(e,F),x(e,I),L(e,t))},B=function(e,t,i,r,n){r?(void 0!==t&&(e.scrollLeft=t),void 0!==i&&(e.scrollTop=i)):(e.scrollLeft+=t%1==0?t:e.clientWidth*t,e.scrollTop+=i%1==0?i:e.clientHeight*i),n||r||(C=setTimeout(function(){S=setInterval(function(){B(e,t,i,r,!0)},c)},o-c))},R=[],G=m("button-inactive"),J=function(e,t){var i=t.clientHeight/t.scrollHeight,r=t.clientWidth/t.scrollWidth;1===i&&1===r?O(e,Y):1!==i&&1===r?O(e,q):1===i&&1!==r?O(e,F):1!==i&&1!==r&&O(e,I);var n=function(e,t,i){var r=e.children[t];return void 0!==i&&(r=r.children[i]),r},o=n(e,1,0),l=n(e,1,2),c=n(e,2,0),s=n(e,2,2);0===t.scrollTop?L(o,G):x(o,G),0===t.scrollLeft?L(c,G):x(c,G),t.scrollTop+t.clientHeight===t.scrollHeight?L(l,G):x(l,G),t.scrollLeft+t.clientWidth===t.scrollWidth?L(s,G):x(s,G);var a=n(e,1,1),h=n(a,0),u=n(a,1),d=n(a,2),v=n(e,2,1),f=n(v,0),p=n(v,1),g=n(v,2),b=a.clientHeight,m=v.clientWidth,w=Math.floor(b*(t.scrollTop/t.scrollHeight)),H=Math.floor(m*(t.scrollLeft/t.scrollWidth));h.style.height=w+"px",f.style.width=H+"px";var y=Math.ceil(b*i),T=Math.ceil(m*r);u.style.height=y+"px",p.style.width=T+"px";var W=b-w-y,k=m-H-T;d.style.height=W+"px",g.style.width=k+"px"},K=function(e){var t=e.children[0],i=e.clientHeight+","+e.clientWidth+"-"+t.scrollHeight+","+t.scrollWidth,r=t.scrollTop+","+t.scrollLeft,n=t.dataset.scrollbarjs.split(" ");if(n[0]!==i)!function(e,t){if(e.clientHeight<t.scrollHeight){var i=t.scrollTop;t.style.height="",e.clientHeight<t.scrollHeight?t.style.height=e.clientHeight+a+1+"px":t.style.height=e.clientHeight+a+"px",t.scrollTop=i}else t.style.height=e.clientHeight+a+"px"}(e,t),J(e,t);else{if(n[1]===r)return;J(e,t)}t.dataset.scrollbarjs=i+" "+r};return requestAnimationFrame(function e(){R.forEach(K),requestAnimationFrame(e)}),{add:function(n){if(!w)throw new Error("scrollbarjs has not been initialized yet");var e;e="BODY"===n.tagName?"div":"TEXTAREA"===n.tagName?"div":n.tagName;var s=function(e,t,i){void 0===i&&(i="div");var r=v(i);return r.className=m(e,t),r},a=s("viewport",void 0,e);a.dataset.scrollbarjs=" ",a.innerHTML=n.innerHTML,n.innerHTML="",p(n,a);var t=function(t,e,i){var r=function(t){var e=s("button",t);return g(e,"mousedown",function(e){return X(e,a,z[t],h)}),e},n=function(t){var e=s("track-piece","track-"+t);return g(e,"mousedown",function(e){return X(e,a,z[t],u)}),e},o=s("track","track-"+t),l=s("thumb","thumb-"+t);g(l,"mousedown",function(e){return function(e,t,i){if(!b(e)){L(d,m("drag")),L(t.parentElement,m("active"));var r=e.target.parentElement;k=1,M=t,N=(E=i)===W.ver?(A=t.scrollTop,t.scrollHeight/r.clientHeight):(A=t.scrollLeft,t.scrollWidth/r.clientWidth)}}(e,a,W[t])}),p(o,n(e)),p(o,l),p(o,n(i));var c=s("scrollbar",t,"aside");return p(c,r(e)),p(c,o),p(c,r(i)),c};p(n,t("ver","up","down")),p(n,t("hor","left","right"));var i=s("corner"),r=f(n).resize;if("both"===r||"horizontal"===r||"vertical"===r){var o;switch(L(n,m("resizable")),r){case"vertical":o="ver";break;case"horizontal":o="hor";break;case"both":o="both"}L(i,m("resize-"+o)),g(i,"mousedown",function(e){return t=e,i=n,r=W[o],void(b(t)||(L(d,m("drag")),k=2,E=r,M=i));var t,i,r})}p(n,i),L(n,l),R.push(n)},init:function(e){if(w)throw new Error("scrollbarjs cannot be initialized more than once");void 0!==e&&(e.prefix&&(l=e.prefix),e.buttonDistance&&(h=e.buttonDistance),e.trackDistance&&(u=e.trackDistance),e.delay&&(o=e.delay),e.repeat&&(c=e.repeat));var t=v("style");return t.innerHTML="body."+l+"{height:100vh;}."+m("drag")+"{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}."+l+"{overflow:hidden;position:relative;}."+m("viewport")+"{overflow:scroll;margin-right:"+-s+"px;margin-bottom:"+-a+"px;}."+m("resizable")+"{resize:none!important;}",p(n,t),w=!0,{nativeHeight:a,nativeWidth:s,nativeDisplaces:0<a||0<s,supportsWebkitStyling:H,supportsMsHiding:y,supportsScrollbarWidth:T,supportsNativeHiding:H||y||T}}}}();