simplebar-react
Advanced tools
Comparing version 0.0.1-beta.0 to 0.0.1-beta.1
/** | ||
* simplebar-react - v0.0.0 | ||
* simplebar-react - v0.0.1-beta.0 | ||
* React component for SimpleBar | ||
@@ -32,3 +32,3 @@ * https://grsmto.github.io/simplebar/ | ||
function _objectWithoutProperties(source, excluded) { | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
@@ -45,2 +45,12 @@ var target = {}; | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
@@ -47,0 +57,0 @@ var sourceSymbolKeys = Object.getOwnPropertySymbols(source); |
/** | ||
* simplebar-react - v0.0.0 | ||
* simplebar-react - v0.0.1-beta.0 | ||
* React component for SimpleBar | ||
@@ -10,2 +10,2 @@ * https://grsmto.github.io/simplebar/ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("react"),require("prop-types")):"function"==typeof define&&define.amd?define(["react","prop-types"],e):t.SimpleBar=e(t.React,t.PropTypes)}(this,function(t,e){"use strict";function n(){return(n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}t=t&&t.hasOwnProperty("default")?t.default:t,e=e&&e.hasOwnProperty("default")?e.default:e;var i=function(t){return"object"==typeof t?null!==t:"function"==typeof t},r=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t},o=function(t){try{return!!t()}catch(t){return!0}},s=!o(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),a="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function c(t,e){return t(e={exports:{}},e.exports),e.exports}var l=c(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),u=l.document,h=i(u)&&i(u.createElement),f=!s&&!o(function(){return 7!=Object.defineProperty((t="div",h?u.createElement(t):{}),"a",{get:function(){return 7}}).a;var t}),d=Object.defineProperty,v={f:s?Object.defineProperty:function(t,e,n){if(r(t),e=function(t,e){if(!i(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!i(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}(e,!0),r(n),f)try{return d(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},p=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},b=s?function(t,e,n){return v.f(t,e,p(1,n))}:function(t,e,n){return t[e]=n,t},y={}.hasOwnProperty,m=function(t,e){return y.call(t,e)},g=0,E=Math.random(),O=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++g+E).toString(36))},w=c(function(t){var e=t.exports={version:"2.5.6"};"number"==typeof __e&&(__e=e)}),_=(w.version,c(function(t){var e=O("src"),n=Function.toString,i=(""+n).split("toString");w.inspectSource=function(t){return n.call(t)},(t.exports=function(t,n,r,o){var s="function"==typeof r;s&&(m(r,"name")||b(r,"name",n)),t[n]!==r&&(s&&(m(r,e)||b(r,e,t[n]?""+t[n]:i.join(String(n)))),t===l?t[n]=r:o?t[n]?t[n]=r:b(t,n,r):(delete t[n],b(t,n,r)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[e]||n.call(this)})})),S=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t},k=c(function(t){var e=l["__core-js_shared__"]||(l["__core-js_shared__"]={});(t.exports=function(t,n){return e[t]||(e[t]=void 0!==n?n:{})})("versions",[]).push({version:w.version,mode:"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})}),x=c(function(t){var e=k("wks"),n=l.Symbol,i="function"==typeof n;(t.exports=function(t){return e[t]||(e[t]=i&&n[t]||(i?n:O)("Symbol."+t))}).store=e}),M=function(t,e,n){var i=x(t),r=n(S,i,""[t]),s=r[0],a=r[1];o(function(){var e={};return e[i]=function(){return 7},7!=""[t](e)})&&(_(String.prototype,t,s),b(RegExp.prototype,i,2==e?function(t,e){return a.call(t,this,e)}:function(t){return a.call(t,this)}))};M("replace",2,function(t,e,n){return[function(i,r){var o=t(this),s=void 0==i?void 0:i[e];return void 0!==s?s.call(i,o,r):n.call(String(o),i,r)},n]});var A=v.f,z=Function.prototype,L=/^\s*function ([^ (]*)/;"name"in z||s&&A(z,"name",{configurable:!0,get:function(){try{return(""+this).match(L)[1]}catch(t){return""}}}),M("match",1,function(t,e,n){return[function(n){var i=t(this),r=void 0==n?void 0:n[e];return void 0!==r?r.call(n,i):new RegExp(n)[e](String(i))},n]});var j=function(t,e,n){if(function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!")}(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,r){return t.call(e,n,i,r)}}return function(){return t.apply(e,arguments)}},T=function(t,e,n){var i,r,o,s,a=t&T.F,c=t&T.G,u=t&T.S,h=t&T.P,f=t&T.B,d=c?l:u?l[e]||(l[e]={}):(l[e]||{}).prototype,v=c?w:w[e]||(w[e]={}),p=v.prototype||(v.prototype={});for(i in c&&(n=e),n)o=((r=!a&&d&&void 0!==d[i])?d:n)[i],s=f&&r?j(o,l):h&&"function"==typeof o?j(Function.call,o):o,d&&_(d,i,o,t&T.U),v[i]!=o&&b(v,i,s),h&&p[i]!=o&&(p[i]=o)};l.core=w,T.F=1,T.G=2,T.S=4,T.P=8,T.B=16,T.W=32,T.U=64,T.R=128;var C=T,D=function(t){return Object(S(t))},N=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&r(o.call(t)),e}},X={},Y=x("iterator"),R=Array.prototype,W=Math.ceil,B=Math.floor,P=function(t){return isNaN(t=+t)?0:(t>0?B:W)(t)},V=Math.min,q=function(t){return t>0?V(P(t),9007199254740991):0},F=function(t,e,n){e in t?v.f(t,e,p(0,n)):t[e]=n},H={}.toString,I=function(t){return H.call(t).slice(8,-1)},G=x("toStringTag"),U="Arguments"==I(function(){return arguments}()),$=x("iterator"),J=w.getIteratorMethod=function(t){if(void 0!=t)return t[$]||t["@@iterator"]||X[function(t){var e,n,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),G))?n:U?I(e):"Object"==(i=I(e))&&"function"==typeof e.callee?"Arguments":i}(t)]},K=x("iterator"),Q=!1;try{[7][K]().return=function(){Q=!0}}catch(t){}C(C.S+C.F*!function(t,e){if(!e&&!Q)return!1;var n=!1;try{var i=[7],r=i[K]();r.next=function(){return{done:n=!0}},i[K]=function(){return r},t(i)}catch(t){}return n}(function(t){}),"Array",{from:function(t){var e,n,i,r,o,s=D(t),a="function"==typeof this?this:Array,c=arguments.length,l=c>1?arguments[1]:void 0,u=void 0!==l,h=0,f=J(s);if(u&&(l=j(l,c>2?arguments[2]:void 0,2)),void 0!=f&&(a!=Array||(void 0===(o=f)||X.Array!==o&&R[Y]!==o)))for(r=f.call(s),n=new a;!(i=r.next()).done;h++)F(n,h,u?N(r,l,[i.value,h],!0):i.value);else for(n=new a(e=q(s.length));e>h;h++)F(n,h,u?l(s[h],h):s[h]);return n.length=h,n}});var Z,tt,et=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==I(t)?t.split(""):Object(t)},nt=function(t){return et(S(t))},it=Math.max,rt=Math.min,ot=k("keys"),st=(Z=!1,function(t,e,n){var i,r=nt(t),o=q(r.length),s=function(t,e){return(t=P(t))<0?it(t+e,0):rt(t,e)}(n,o);if(Z&&e!=e){for(;o>s;)if((i=r[s++])!=i)return!0}else for(;o>s;s++)if((Z||s in r)&&r[s]===e)return Z||s||0;return!Z&&-1}),at=ot[tt="IE_PROTO"]||(ot[tt]=O(tt)),ct="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),lt=Object.keys||function(t){return function(t,e){var n,i=nt(t),r=0,o=[];for(n in i)n!=at&&m(i,n)&&o.push(n);for(;e.length>r;)m(i,n=e[r++])&&(~st(o,n)||o.push(n));return o}(t,ct)},ut={f:Object.getOwnPropertySymbols},ht={f:{}.propertyIsEnumerable},ft=Object.assign,dt=!ft||o(function(){var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach(function(t){e[t]=t}),7!=ft({},t)[n]||Object.keys(ft({},e)).join("")!=i})?function(t,e){for(var n=D(t),i=arguments.length,r=1,o=ut.f,s=ht.f;i>r;)for(var a,c=et(arguments[r++]),l=o?lt(c).concat(o(c)):lt(c),u=l.length,h=0;u>h;)s.call(c,a=l[h++])&&(n[a]=c[a]);return n}:ft;C(C.S+C.F,"Object",{assign:dt});var vt=c(function(t,e){var n;n=function(){return function(){if("undefined"==typeof document)return 0;var t,e=document.body,n=document.createElement("div"),i=n.style;return i.position="absolute",i.top=i.left="-9999px",i.width=i.height="100px",i.overflow="scroll",e.appendChild(n),t=n.offsetWidth-n.clientWidth,e.removeChild(n),t}},t.exports=n()}),pt="Expected a function",bt=NaN,yt="[object Symbol]",mt=/^\s+|\s+$/g,gt=/^[-+]0x[0-9a-f]+$/i,Et=/^0b[01]+$/i,Ot=/^0o[0-7]+$/i,wt=parseInt,_t="object"==typeof a&&a&&a.Object===Object&&a,St="object"==typeof self&&self&&self.Object===Object&&self,kt=_t||St||Function("return this")(),xt=Object.prototype.toString,Mt=Math.max,At=Math.min,zt=function(){return kt.Date.now()};function Lt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function jt(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&xt.call(t)==yt}(t))return bt;if(Lt(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Lt(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(mt,"");var n=Et.test(t);return n||Ot.test(t)?wt(t.slice(2),n?2:8):gt.test(t)?bt:+t}var Tt=function(t,e,n){var i,r,o,s,a,c,l=0,u=!1,h=!1,f=!0;if("function"!=typeof t)throw new TypeError(pt);function d(e){var n=i,o=r;return i=r=void 0,l=e,s=t.apply(o,n)}function v(t){var n=t-c;return void 0===c||n>=e||n<0||h&&t-l>=o}function p(){var t=zt();if(v(t))return b(t);a=setTimeout(p,function(t){var n=e-(t-c);return h?At(n,o-(t-l)):n}(t))}function b(t){return a=void 0,f&&i?d(t):(i=r=void 0,s)}function y(){var t=zt(),n=v(t);if(i=arguments,r=this,c=t,n){if(void 0===a)return function(t){return l=t,a=setTimeout(p,e),u?d(t):s}(c);if(h)return a=setTimeout(p,e),d(c)}return void 0===a&&(a=setTimeout(p,e)),s}return e=jt(e)||0,Lt(n)&&(u=!!n.leading,o=(h="maxWait"in n)?Mt(jt(n.maxWait)||0,e):o,f="trailing"in n?!!n.trailing:f),y.cancel=function(){void 0!==a&&clearTimeout(a),l=0,i=c=r=a=void 0},y.flush=function(){return void 0===a?s:b(zt())},y},Ct=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var n=-1;return t.some(function(t,i){return t[0]===e&&(n=i,!0)}),n}return function(){function e(){this.__entries__=[]}var n={size:{configurable:!0}};return n.size.get=function(){return this.__entries__.length},e.prototype.get=function(e){var n=t(this.__entries__,e),i=this.__entries__[n];return i&&i[1]},e.prototype.set=function(e,n){var i=t(this.__entries__,e);~i?this.__entries__[i][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,i=t(n,e);~i&&n.splice(i,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var n=0,i=this.__entries__;n<i.length;n+=1){var r=i[n];t.call(e,r[1],r[0])}},Object.defineProperties(e.prototype,n),e}()}(),Dt="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,Nt="undefined"!=typeof global&&global.Math===Math?global:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),Xt="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(Nt):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)},Yt=2,Rt=["top","right","bottom","left","width","height","size","weight"],Wt="undefined"!=typeof MutationObserver,Bt=function(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(t,e){var n=!1,i=!1,r=0;function o(){n&&(n=!1,t()),i&&a()}function s(){Xt(o)}function a(){var t=Date.now();if(n){if(t-r<Yt)return;i=!0}else n=!0,i=!1,setTimeout(s,e);r=t}return a}(this.refresh.bind(this),20)};Bt.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},Bt.prototype.removeObserver=function(t){var e=this.observers_,n=e.indexOf(t);~n&&e.splice(n,1),!e.length&&this.connected_&&this.disconnect_()},Bt.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},Bt.prototype.updateObservers_=function(){var t=this.observers_.filter(function(t){return t.gatherActive(),t.hasActive()});return t.forEach(function(t){return t.broadcastActive()}),t.length>0},Bt.prototype.connect_=function(){Dt&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Wt?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},Bt.prototype.disconnect_=function(){Dt&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},Bt.prototype.onTransitionEnd_=function(t){var e=t.propertyName;void 0===e&&(e=""),Rt.some(function(t){return!!~e.indexOf(t)})&&this.refresh()},Bt.getInstance=function(){return this.instance_||(this.instance_=new Bt),this.instance_},Bt.instance_=null;var Pt=function(t,e){for(var n=0,i=Object.keys(e);n<i.length;n+=1){var r=i[n];Object.defineProperty(t,r,{value:e[r],enumerable:!1,writable:!1,configurable:!0})}return t},Vt=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||Nt},qt=$t(0,0,0,0);function Ft(t){return parseFloat(t)||0}function Ht(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];return e.reduce(function(e,n){return e+Ft(t["border-"+n+"-width"])},0)}function It(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return qt;var i=Vt(t).getComputedStyle(t),r=function(t){for(var e={},n=0,i=["top","right","bottom","left"];n<i.length;n+=1){var r=i[n],o=t["padding-"+r];e[r]=Ft(o)}return e}(i),o=r.left+r.right,s=r.top+r.bottom,a=Ft(i.width),c=Ft(i.height);if("border-box"===i.boxSizing&&(Math.round(a+o)!==e&&(a-=Ht(i,"left","right")+o),Math.round(c+s)!==n&&(c-=Ht(i,"top","bottom")+s)),!function(t){return t===Vt(t).document.documentElement}(t)){var l=Math.round(a+o)-e,u=Math.round(c+s)-n;1!==Math.abs(l)&&(a-=l),1!==Math.abs(u)&&(c-=u)}return $t(r.left,r.top,a,c)}var Gt="undefined"!=typeof SVGGraphicsElement?function(t){return t instanceof Vt(t).SVGGraphicsElement}:function(t){return t instanceof Vt(t).SVGElement&&"function"==typeof t.getBBox};function Ut(t){return Dt?Gt(t)?function(t){var e=t.getBBox();return $t(0,0,e.width,e.height)}(t):It(t):qt}function $t(t,e,n,i){return{x:t,y:e,width:n,height:i}}var Jt=function(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=$t(0,0,0,0),this.target=t};Jt.prototype.isActive=function(){var t=Ut(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},Jt.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t};var Kt=function(t,e){var n,i,r,o,s,a,c,l=(i=(n=e).x,r=n.y,o=n.width,s=n.height,a="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,c=Object.create(a.prototype),Pt(c,{x:i,y:r,width:o,height:s,top:r,right:i+o,bottom:s+r,left:i}),c);Pt(this,{target:t,contentRect:l})},Qt=function(t,e,n){if(this.activeObservations_=[],this.observations_=new Ct,"function"!=typeof t)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=n};Qt.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof Vt(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new Jt(t)),this.controller_.addObserver(this),this.controller_.refresh())}},Qt.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof Vt(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)&&(e.delete(t),e.size||this.controller_.removeObserver(this))}},Qt.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},Qt.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(e){e.isActive()&&t.activeObservations_.push(e)})},Qt.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map(function(t){return new Kt(t.target,t.broadcastRect())});this.callback_.call(t,e,t),this.clearActive()}},Qt.prototype.clearActive=function(){this.activeObservations_.splice(0)},Qt.prototype.hasActive=function(){return this.activeObservations_.length>0};var Zt="undefined"!=typeof WeakMap?new WeakMap:new Ct,te=function(t){if(!(this instanceof te))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var e=Bt.getInstance(),n=new Qt(t,e,this);Zt.set(this,n)};["observe","unobserve","disconnect"].forEach(function(t){te.prototype[t]=function(){return(e=Zt.get(this))[t].apply(e,arguments);var e}});var ee=void 0!==Nt.ResizeObserver?Nt.ResizeObserver:te;function ne(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.el=e,this.flashTimeout,this.contentEl,this.scrollContentEl,this.dragOffset={x:0,y:0},this.isVisible={x:!0,y:!0},this.scrollOffsetAttr={x:"scrollLeft",y:"scrollTop"},this.sizeAttr={x:"offsetWidth",y:"offsetHeight"},this.scrollSizeAttr={x:"scrollWidth",y:"scrollHeight"},this.offsetAttr={x:"left",y:"top"},this.globalObserver,this.mutationObserver,this.resizeObserver,this.currentAxis,this.scrollbarWidth,this.options=Object.assign({},t.defaultOptions,n),this.isRtl="rtl"===this.options.direction,this.classNames=this.options.classNames,this.offsetSize=20,this.recalculate=Tt(this.recalculate.bind(this),1e3,{leading:!0}),this.init()}var e,n,i;return e=t,i=[{key:"initHtmlApi",value:function(){this.initDOMLoadedElements=this.initDOMLoadedElements.bind(this),"undefined"!=typeof MutationObserver&&(this.globalObserver=new MutationObserver(function(e){e.forEach(function(e){Array.from(e.addedNodes).forEach(function(e){1===e.nodeType&&(e.hasAttribute("data-simplebar")?!e.SimpleBar&&new t(e,t.getElOptions(e)):Array.from(e.querySelectorAll("[data-simplebar]")).forEach(function(e){!e.SimpleBar&&new t(e,t.getElOptions(e))}))}),Array.from(e.removedNodes).forEach(function(t){1===t.nodeType&&(t.hasAttribute("data-simplebar")?t.SimpleBar&&t.SimpleBar.unMount():Array.from(t.querySelectorAll("[data-simplebar]")).forEach(function(t){t.SimpleBar&&t.SimpleBar.unMount()}))})})}),this.globalObserver.observe(document,{childList:!0,subtree:!0})),"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?window.setTimeout(this.initDOMLoadedElements.bind(this)):(document.addEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.addEventListener("load",this.initDOMLoadedElements))}},{key:"getElOptions",value:function(t){return Array.from(t.attributes).reduce(function(t,e){var n=e.name.match(/data-simplebar-(.+)/);if(n){var i=n[1].replace(/\W+(.)/g,function(t,e){return e.toUpperCase()});switch(e.value){case"true":t[i]=!0;break;case"false":t[i]=!1;break;case void 0:t[i]=!0;break;default:t[i]=e.value}}return t},{})}},{key:"removeObserver",value:function(){this.globalObserver.disconnect()}},{key:"initDOMLoadedElements",value:function(){document.removeEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.removeEventListener("load",this.initDOMLoadedElements),Array.from(document.querySelectorAll("[data-simplebar]")).forEach(function(e){e.SimpleBar||new t(e,t.getElOptions(e))})}},{key:"defaultOptions",get:function(){return{autoHide:!0,forceVisible:!1,classNames:{content:"simplebar-content",scrollContent:"simplebar-scroll-content",scrollbar:"simplebar-scrollbar",track:"simplebar-track"},scrollbarMinSize:25,scrollbarMaxSize:0,direction:"ltr",timeout:1e3}}}],(n=[{key:"init",value:function(){this.el.SimpleBar=this,this.initDOM(),this.hideNativeScrollbar(),this.render(),this.initListeners()}},{key:"initDOM",value:function(){var t=this;if(Array.from(this.el.children).filter(function(e){return e.classList.contains(t.classNames.scrollContent)}).length)this.trackX=this.el.querySelector(".".concat(this.classNames.track,".horizontal")),this.trackY=this.el.querySelector(".".concat(this.classNames.track,".vertical")),this.scrollContentEl=this.el.querySelector(".".concat(this.classNames.scrollContent)),this.contentEl=this.el.querySelector(".".concat(this.classNames.content));else{for(this.scrollContentEl=document.createElement("div"),this.contentEl=document.createElement("div"),this.scrollContentEl.classList.add(this.classNames.scrollContent),this.contentEl.classList.add(this.classNames.content);this.el.firstChild;)this.contentEl.appendChild(this.el.firstChild);this.scrollContentEl.appendChild(this.contentEl),this.el.appendChild(this.scrollContentEl)}if(!this.trackX||!this.trackY){var e=document.createElement("div"),n=document.createElement("div");e.classList.add(this.classNames.track),n.classList.add(this.classNames.scrollbar),this.options.autoHide||n.classList.add("visible"),e.appendChild(n),this.trackX=e.cloneNode(!0),this.trackX.classList.add("horizontal"),this.trackY=e.cloneNode(!0),this.trackY.classList.add("vertical"),this.el.insertBefore(this.trackX,this.el.firstChild),this.el.insertBefore(this.trackY,this.el.firstChild)}this.scrollbarX=this.trackX.querySelector(".".concat(this.classNames.scrollbar)),this.scrollbarY=this.trackY.querySelector(".".concat(this.classNames.scrollbar)),this.el.setAttribute("data-simplebar","init")}},{key:"initListeners",value:function(){var t=this;this.options.autoHide&&this.el.addEventListener("mouseenter",this.onMouseEnter.bind(this)),this.scrollbarY.addEventListener("mousedown",this.onDragY.bind(this)),this.scrollbarX.addEventListener("mousedown",this.onDragX.bind(this)),this.contentEl.addEventListener("scroll",this.onScrollX.bind(this)),this.scrollContentEl.addEventListener("scroll",this.onScrollY.bind(this)),window.addEventListener("resize",this.onWindowResize.bind(this)),"undefined"!=typeof MutationObserver&&(this.mutationObserver=new MutationObserver(function(e){e.forEach(function(e){(t.isChildNode(e.target)||e.addedNodes.length)&&t.recalculate()})}),this.mutationObserver.observe(this.el,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),this.resizeObserver=new ee(this.recalculate),this.resizeObserver.observe(this.el)}},{key:"recalculate",value:function(){this.render()}},{key:"render",value:function(){this.contentSizeX=this.contentEl[this.scrollSizeAttr.x],this.contentSizeY=this.contentEl[this.scrollSizeAttr.y]-(this.scrollbarWidth||this.offsetSize),this.trackXSize=this.trackX[this.sizeAttr.x],this.trackYSize=this.trackY[this.sizeAttr.y],this.isVisible.x=this.trackXSize<this.contentSizeX,this.isVisible.y=this.trackYSize<this.contentSizeY,this.resizeScrollbar("x"),this.resizeScrollbar("y"),this.toggleTrackVisibility("x"),this.toggleTrackVisibility("y")}},{key:"resizeScrollbar",value:function(){var t,e,n,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"y";if(this.isVisible[i]||this.options.forceVisible){"x"===i?(t=this.scrollbarX,e=this.contentSizeX,n=this.trackXSize):(t=this.scrollbarY,e=this.contentSizeY,n=this.trackYSize);var r=n/e;this.handleSize=Math.max(~~(r*n),this.options.scrollbarMinSize),this.options.scrollbarMaxSize&&(this.handleSize=Math.min(this.handleSize,this.options.scrollbarMaxSize)),"x"===i?t.style.width="".concat(this.handleSize,"px"):t.style.height="".concat(this.handleSize,"px")}}},{key:"positionScrollbar",value:function(){var t,e,n,i,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"y";"x"===r?(t=this.scrollbarX,e=this.contentEl[this.scrollOffsetAttr[r]],n=this.contentSizeX,i=this.trackXSize):(t=this.scrollbarY,e=this.scrollContentEl[this.scrollOffsetAttr[r]],n=this.contentSizeY,i=this.trackYSize);var o=e/(n-i),s=~~((i-this.handleSize)*o);(this.isVisible[r]||this.options.forceVisible)&&("x"===r?t.style.left="".concat(s,"px"):t.style.top="".concat(s,"px"))}},{key:"toggleTrackVisibility",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"y",e="y"===t?this.trackY:this.trackX,n="y"===t?this.scrollbarY:this.scrollbarX;this.isVisible[t]||this.options.forceVisible?e.style.visibility="visible":e.style.visibility="hidden",this.options.forceVisible&&(this.isVisible[t]?n.style.visibility="visible":n.style.visibility="hidden")}},{key:"hideNativeScrollbar",value:function(){this.scrollbarWidth=vt(),this.scrollContentEl.style[this.isRtl?"paddingLeft":"paddingRight"]="".concat(this.scrollbarWidth||this.offsetSize,"px"),this.scrollContentEl.style.marginBottom="-".concat(2*this.scrollbarWidth||this.offsetSize,"px"),this.contentEl.style.paddingBottom="".concat(this.scrollbarWidth||this.offsetSize,"px"),0!==this.scrollbarWidth&&(this.contentEl.style[this.isRtl?"marginLeft":"marginRight"]="-".concat(this.scrollbarWidth,"px"))}},{key:"onScrollX",value:function(){this.showScrollbar("x"),this.positionScrollbar("x")}},{key:"onScrollY",value:function(){this.showScrollbar("y"),this.positionScrollbar("y")}},{key:"onMouseEnter",value:function(){this.showScrollbar("x"),this.showScrollbar("y")}},{key:"onWindowResize",value:function(){this.hideNativeScrollbar()}},{key:"showScrollbar",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"y";t="x"===e?this.scrollbarX:this.scrollbarY,this.isVisible[e]&&t.classList.add("visible"),this.options.autoHide&&(this.flashTimeout&&window.clearTimeout(this.flashTimeout),this.flashTimeout=window.setTimeout(this.hideScrollbar.bind(this),this.options.timeout))}},{key:"hideScrollbar",value:function(){this.scrollbarX.classList.remove("visible"),this.scrollbarY.classList.remove("visible"),this.flashTimeout&&window.clearTimeout(this.flashTimeout)}},{key:"onDragX",value:function(t){this.onDrag(t,"x")}},{key:"onDragY",value:function(t){this.onDrag(t,"y")}},{key:"onDrag",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"y";t.preventDefault();var n="y"===e?this.scrollbarY:this.scrollbarX,i="y"===e?t.pageY:t.pageX;this.dragOffset[e]=i-n.getBoundingClientRect()[this.offsetAttr[e]],this.currentAxis=e,document.addEventListener("mousemove",this.drag),document.addEventListener("mouseup",this.onEndDrag)}},{key:"drag",value:function(t){var e,n,i;t.preventDefault(),"y"===this.currentAxis?(e=t.pageY,n=this.trackY,i=this.scrollContentEl):(e=t.pageX,n=this.trackX,i=this.contentEl);var r=(e-n.getBoundingClientRect()[this.offsetAttr[this.currentAxis]]-this.dragOffset[this.currentAxis])/n[this.sizeAttr[this.currentAxis]]*this.contentEl[this.scrollSizeAttr[this.currentAxis]];i[this.scrollOffsetAttr[this.currentAxis]]=r}},{key:"onEndDrag",value:function(){document.removeEventListener("mousemove",this.drag),document.removeEventListener("mouseup",this.onEndDrag)}},{key:"getScrollElement",value:function(){return"y"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"y")?this.scrollContentEl:this.contentEl}},{key:"getContentElement",value:function(){return this.contentEl}},{key:"removeListeners",value:function(){this.options.autoHide&&this.el.removeEventListener("mouseenter",this.onMouseEnter),this.scrollbarX.removeEventListener("mousedown",this.onDragX),this.scrollbarY.removeEventListener("mousedown",this.onDragY),this.scrollContentEl.removeEventListener("scroll",this.onScrollY),this.contentEl.removeEventListener("scroll",this.onScrollX),this.mutationObserver.disconnect(),this.resizeObserver.disconnect()}},{key:"unMount",value:function(){this.removeListeners(),this.el.SimpleBar=null}},{key:"isChildNode",value:function(t){return null!==t&&(t===this.el||this.isChildNode(t.parentNode))}}])&&ne(e.prototype,n),i&&ne(e,i),t}().initHtmlApi(),function(e){var i=e.children,r=function(t,e){if(null==t)return{};var n,i,r={},o=Object.keys(t);for(i=0;i<o.length;i++)n=o[i],e.indexOf(n)>=0||(r[n]=t[n]);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(e,["children"]);return t.createElement("div",n({"data-simplebar":!0},r),t.createElement("div",{className:"simplebar-scroll-content"},t.createElement("div",{className:"simplebar-content"},i)))}}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("react"),require("prop-types")):"function"==typeof define&&define.amd?define(["react","prop-types"],e):t.SimpleBar=e(t.React,t.PropTypes)}(this,function(t,e){"use strict";function n(){return(n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function i(t,e){if(null==t)return{};var n,i,r=function(t,e){if(null==t)return{};var n,i,r={},o=Object.keys(t);for(i=0;i<o.length;i++)n=o[i],e.indexOf(n)>=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}t=t&&t.hasOwnProperty("default")?t.default:t,e=e&&e.hasOwnProperty("default")?e.default:e;var r=function(t){return"object"==typeof t?null!==t:"function"==typeof t},o=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t},s=function(t){try{return!!t()}catch(t){return!0}},c=!s(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),a="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function l(t,e){return t(e={exports:{}},e.exports),e.exports}var u=l(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),h=u.document,f=r(h)&&r(h.createElement),d=function(t){return f?h.createElement(t):{}},p=!c&&!s(function(){return 7!=Object.defineProperty(d("div"),"a",{get:function(){return 7}}).a}),v=Object.defineProperty,b={f:c?Object.defineProperty:function(t,e,n){if(o(t),e=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}(e,!0),o(n),p)try{return v(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},y=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},m=c?function(t,e,n){return b.f(t,e,y(1,n))}:function(t,e,n){return t[e]=n,t},g={}.hasOwnProperty,E=function(t,e){return g.call(t,e)},S=0,w=Math.random(),O=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++S+w).toString(36))},_=l(function(t){var e=t.exports={version:"2.5.6"};"number"==typeof __e&&(__e=e)}),k=(_.version,l(function(t){var e=O("src"),n=Function.toString,i=(""+n).split("toString");_.inspectSource=function(t){return n.call(t)},(t.exports=function(t,n,r,o){var s="function"==typeof r;s&&(E(r,"name")||m(r,"name",n)),t[n]!==r&&(s&&(E(r,e)||m(r,e,t[n]?""+t[n]:i.join(String(n)))),t===u?t[n]=r:o?t[n]?t[n]=r:m(t,n,r):(delete t[n],m(t,n,r)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[e]||n.call(this)})})),x=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t},L=l(function(t){var e=u["__core-js_shared__"]||(u["__core-js_shared__"]={});(t.exports=function(t,n){return e[t]||(e[t]=void 0!==n?n:{})})("versions",[]).push({version:_.version,mode:"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})}),M=l(function(t){var e=L("wks"),n=u.Symbol,i="function"==typeof n;(t.exports=function(t){return e[t]||(e[t]=i&&n[t]||(i?n:O)("Symbol."+t))}).store=e}),A=function(t,e,n){var i=M(t),r=n(x,i,""[t]),o=r[0],c=r[1];s(function(){var e={};return e[i]=function(){return 7},7!=""[t](e)})&&(k(String.prototype,t,o),m(RegExp.prototype,i,2==e?function(t,e){return c.call(t,this,e)}:function(t){return c.call(t,this)}))};A("replace",2,function(t,e,n){return[function(i,r){var o=t(this),s=void 0==i?void 0:i[e];return void 0!==s?s.call(i,o,r):n.call(String(o),i,r)},n]});var T=b.f,z=Function.prototype,j=/^\s*function ([^ (]*)/;"name"in z||c&&T(z,"name",{configurable:!0,get:function(){try{return(""+this).match(j)[1]}catch(t){return""}}}),A("match",1,function(t,e,n){return[function(n){var i=t(this),r=void 0==n?void 0:n[e];return void 0!==r?r.call(n,i):new RegExp(n)[e](String(i))},n]});var C=M("unscopables"),D=Array.prototype;void 0==D[C]&&m(D,C,{});var N=function(t){D[C][t]=!0},Y=function(t,e){return{value:e,done:!!t}},X={},R={}.toString,P=function(t){return R.call(t).slice(8,-1)},W=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==P(t)?t.split(""):Object(t)},B=function(t){return W(x(t))},V=function(t,e,n){if(function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!")}(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,r){return t.call(e,n,i,r)}}return function(){return t.apply(e,arguments)}},F=function(t,e,n){var i,r,o,s,c=t&F.F,a=t&F.G,l=t&F.S,h=t&F.P,f=t&F.B,d=a?u:l?u[e]||(u[e]={}):(u[e]||{}).prototype,p=a?_:_[e]||(_[e]={}),v=p.prototype||(p.prototype={});for(i in a&&(n=e),n)o=((r=!c&&d&&void 0!==d[i])?d:n)[i],s=f&&r?V(o,u):h&&"function"==typeof o?V(Function.call,o):o,d&&k(d,i,o,t&F.U),p[i]!=o&&m(p,i,s),h&&v[i]!=o&&(v[i]=o)};u.core=_,F.F=1,F.G=2,F.S=4,F.P=8,F.B=16,F.W=32,F.U=64,F.R=128;var q,H=F,I=Math.ceil,G=Math.floor,U=function(t){return isNaN(t=+t)?0:(t>0?G:I)(t)},$=Math.min,J=function(t){return t>0?$(U(t),9007199254740991):0},K=Math.max,Q=Math.min,Z=L("keys"),tt=function(t){return Z[t]||(Z[t]=O(t))},et=(q=!1,function(t,e,n){var i,r=B(t),o=J(r.length),s=function(t,e){return(t=U(t))<0?K(t+e,0):Q(t,e)}(n,o);if(q&&e!=e){for(;o>s;)if((i=r[s++])!=i)return!0}else for(;o>s;s++)if((q||s in r)&&r[s]===e)return q||s||0;return!q&&-1}),nt=tt("IE_PROTO"),it="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),rt=Object.keys||function(t){return function(t,e){var n,i=B(t),r=0,o=[];for(n in i)n!=nt&&E(i,n)&&o.push(n);for(;e.length>r;)E(i,n=e[r++])&&(~et(o,n)||o.push(n));return o}(t,it)},ot=c?Object.defineProperties:function(t,e){o(t);for(var n,i=rt(e),r=i.length,s=0;r>s;)b.f(t,n=i[s++],e[n]);return t},st=u.document,ct=st&&st.documentElement,at=tt("IE_PROTO"),lt=function(){},ut=function(){var t,e=d("iframe"),n=it.length;for(e.style.display="none",ct.appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),ut=t.F;n--;)delete ut.prototype[it[n]];return ut()},ht=Object.create||function(t,e){var n;return null!==t?(lt.prototype=o(t),n=new lt,lt.prototype=null,n[at]=t):n=ut(),void 0===e?n:ot(n,e)},ft=b.f,dt=M("toStringTag"),pt=function(t,e,n){t&&!E(t=n?t:t.prototype,dt)&&ft(t,dt,{configurable:!0,value:e})},vt={};m(vt,M("iterator"),function(){return this});var bt=function(t,e,n){t.prototype=ht(vt,{next:y(1,n)}),pt(t,e+" Iterator")},yt=function(t){return Object(x(t))},mt=tt("IE_PROTO"),gt=Object.prototype,Et=Object.getPrototypeOf||function(t){return t=yt(t),E(t,mt)?t[mt]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?gt:null},St=M("iterator"),wt=!([].keys&&"next"in[].keys()),Ot=function(){return this},_t=function(t,e,n,i,r,o,s){bt(n,e,i);var c,a,l,u=function(t){if(!wt&&t in p)return p[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},h=e+" Iterator",f="values"==r,d=!1,p=t.prototype,v=p[St]||p["@@iterator"]||r&&p[r],b=v||u(r),y=r?f?u("entries"):b:void 0,g="Array"==e&&p.entries||v;if(g&&(l=Et(g.call(new t)))!==Object.prototype&&l.next&&(pt(l,h,!0),"function"!=typeof l[St]&&m(l,St,Ot)),f&&v&&"values"!==v.name&&(d=!0,b=function(){return v.call(this)}),(wt||d||!p[St])&&m(p,St,b),X[e]=b,X[h]=Ot,r)if(c={values:f?b:u("values"),keys:o?b:u("keys"),entries:y},s)for(a in c)a in p||k(p,a,c[a]);else H(H.P+H.F*(wt||d),e,c);return c}(Array,"Array",function(t,e){this._t=B(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,Y(1)):Y(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values");X.Arguments=X.Array,N("keys"),N("values"),N("entries");for(var kt=M("iterator"),xt=M("toStringTag"),Lt=X.Array,Mt={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},At=rt(Mt),Tt=0;Tt<At.length;Tt++){var zt,jt=At[Tt],Ct=Mt[jt],Dt=u[jt],Nt=Dt&&Dt.prototype;if(Nt&&(Nt[kt]||m(Nt,kt,Lt),Nt[xt]||m(Nt,xt,jt),X[jt]=Lt,Ct))for(zt in _t)Nt[zt]||k(Nt,zt,_t[zt],!0)}var Yt=function(t,e,n,i){try{return i?e(o(n)[0],n[1]):e(n)}catch(e){var r=t.return;throw void 0!==r&&o(r.call(t)),e}},Xt=M("iterator"),Rt=Array.prototype,Pt=function(t,e,n){e in t?b.f(t,e,y(0,n)):t[e]=n},Wt=M("toStringTag"),Bt="Arguments"==P(function(){return arguments}()),Vt=M("iterator"),Ft=_.getIteratorMethod=function(t){if(void 0!=t)return t[Vt]||t["@@iterator"]||X[function(t){var e,n,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),Wt))?n:Bt?P(e):"Object"==(i=P(e))&&"function"==typeof e.callee?"Arguments":i}(t)]},qt=M("iterator"),Ht=!1;try{[7][qt]().return=function(){Ht=!0}}catch(t){}H(H.S+H.F*!function(t,e){if(!e&&!Ht)return!1;var n=!1;try{var i=[7],r=i[qt]();r.next=function(){return{done:n=!0}},i[qt]=function(){return r},t(i)}catch(t){}return n}(function(t){}),"Array",{from:function(t){var e,n,i,r,o,s=yt(t),c="function"==typeof this?this:Array,a=arguments.length,l=a>1?arguments[1]:void 0,u=void 0!==l,h=0,f=Ft(s);if(u&&(l=V(l,a>2?arguments[2]:void 0,2)),void 0!=f&&(c!=Array||(void 0===(o=f)||X.Array!==o&&Rt[Xt]!==o)))for(r=f.call(s),n=new c;!(i=r.next()).done;h++)Pt(n,h,u?Yt(r,l,[i.value,h],!0):i.value);else for(n=new c(e=J(s.length));e>h;h++)Pt(n,h,u?l(s[h],h):s[h]);return n.length=h,n}});var It={f:Object.getOwnPropertySymbols},Gt={f:{}.propertyIsEnumerable},Ut=Object.assign,$t=!Ut||s(function(){var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach(function(t){e[t]=t}),7!=Ut({},t)[n]||Object.keys(Ut({},e)).join("")!=i})?function(t,e){for(var n=yt(t),i=arguments.length,r=1,o=It.f,s=Gt.f;i>r;)for(var c,a=W(arguments[r++]),l=o?rt(a).concat(o(a)):rt(a),u=l.length,h=0;u>h;)s.call(a,c=l[h++])&&(n[c]=a[c]);return n}:Ut;H(H.S+H.F,"Object",{assign:$t});var Jt=l(function(t,e){t.exports=function(){if("undefined"==typeof document)return 0;var t,e=document.body,n=document.createElement("div"),i=n.style;return i.position="absolute",i.top=i.left="-9999px",i.width=i.height="100px",i.overflow="scroll",e.appendChild(n),t=n.offsetWidth-n.clientWidth,e.removeChild(n),t}}),Kt="Expected a function",Qt=NaN,Zt="[object Symbol]",te=/^\s+|\s+$/g,ee=/^[-+]0x[0-9a-f]+$/i,ne=/^0b[01]+$/i,ie=/^0o[0-7]+$/i,re=parseInt,oe="object"==typeof a&&a&&a.Object===Object&&a,se="object"==typeof self&&self&&self.Object===Object&&self,ce=oe||se||Function("return this")(),ae=Object.prototype.toString,le=Math.max,ue=Math.min,he=function(){return ce.Date.now()};function fe(t,e,n){var i,r,o,s,c,a,l=0,u=!1,h=!1,f=!0;if("function"!=typeof t)throw new TypeError(Kt);function d(e){var n=i,o=r;return i=r=void 0,l=e,s=t.apply(o,n)}function p(t){var n=t-a;return void 0===a||n>=e||n<0||h&&t-l>=o}function v(){var t=he();if(p(t))return b(t);c=setTimeout(v,function(t){var n=e-(t-a);return h?ue(n,o-(t-l)):n}(t))}function b(t){return c=void 0,f&&i?d(t):(i=r=void 0,s)}function y(){var t=he(),n=p(t);if(i=arguments,r=this,a=t,n){if(void 0===c)return function(t){return l=t,c=setTimeout(v,e),u?d(t):s}(a);if(h)return c=setTimeout(v,e),d(a)}return void 0===c&&(c=setTimeout(v,e)),s}return e=pe(e)||0,de(n)&&(u=!!n.leading,o=(h="maxWait"in n)?le(pe(n.maxWait)||0,e):o,f="trailing"in n?!!n.trailing:f),y.cancel=function(){void 0!==c&&clearTimeout(c),l=0,i=a=r=c=void 0},y.flush=function(){return void 0===c?s:b(he())},y}function de(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function pe(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&ae.call(t)==Zt}(t))return Qt;if(de(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=de(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(te,"");var n=ne.test(t);return n||ie.test(t)?re(t.slice(2),n?2:8):ee.test(t)?Qt:+t}var ve=function(t,e,n){var i=!0,r=!0;if("function"!=typeof t)throw new TypeError(Kt);return de(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),fe(t,e,{leading:i,maxWait:e,trailing:r})},be=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var n=-1;return t.some(function(t,i){return t[0]===e&&(n=i,!0)}),n}return function(){function e(){this.__entries__=[]}var n={size:{configurable:!0}};return n.size.get=function(){return this.__entries__.length},e.prototype.get=function(e){var n=t(this.__entries__,e),i=this.__entries__[n];return i&&i[1]},e.prototype.set=function(e,n){var i=t(this.__entries__,e);~i?this.__entries__[i][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,i=t(n,e);~i&&n.splice(i,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var n=0,i=this.__entries__;n<i.length;n+=1){var r=i[n];t.call(e,r[1],r[0])}},Object.defineProperties(e.prototype,n),e}()}(),ye="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,me="undefined"!=typeof global&&global.Math===Math?global:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),ge="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(me):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)},Ee=2,Se=["top","right","bottom","left","width","height","size","weight"],we="undefined"!=typeof MutationObserver,Oe=function(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(t,e){var n=!1,i=!1,r=0;function o(){n&&(n=!1,t()),i&&c()}function s(){ge(o)}function c(){var t=Date.now();if(n){if(t-r<Ee)return;i=!0}else n=!0,i=!1,setTimeout(s,e);r=t}return c}(this.refresh.bind(this),20)};Oe.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},Oe.prototype.removeObserver=function(t){var e=this.observers_,n=e.indexOf(t);~n&&e.splice(n,1),!e.length&&this.connected_&&this.disconnect_()},Oe.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},Oe.prototype.updateObservers_=function(){var t=this.observers_.filter(function(t){return t.gatherActive(),t.hasActive()});return t.forEach(function(t){return t.broadcastActive()}),t.length>0},Oe.prototype.connect_=function(){ye&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),we?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},Oe.prototype.disconnect_=function(){ye&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},Oe.prototype.onTransitionEnd_=function(t){var e=t.propertyName;void 0===e&&(e=""),Se.some(function(t){return!!~e.indexOf(t)})&&this.refresh()},Oe.getInstance=function(){return this.instance_||(this.instance_=new Oe),this.instance_},Oe.instance_=null;var _e=function(t,e){for(var n=0,i=Object.keys(e);n<i.length;n+=1){var r=i[n];Object.defineProperty(t,r,{value:e[r],enumerable:!1,writable:!1,configurable:!0})}return t},ke=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||me},xe=je(0,0,0,0);function Le(t){return parseFloat(t)||0}function Me(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];return e.reduce(function(e,n){return e+Le(t["border-"+n+"-width"])},0)}function Ae(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return xe;var i=ke(t).getComputedStyle(t),r=function(t){for(var e={},n=0,i=["top","right","bottom","left"];n<i.length;n+=1){var r=i[n],o=t["padding-"+r];e[r]=Le(o)}return e}(i),o=r.left+r.right,s=r.top+r.bottom,c=Le(i.width),a=Le(i.height);if("border-box"===i.boxSizing&&(Math.round(c+o)!==e&&(c-=Me(i,"left","right")+o),Math.round(a+s)!==n&&(a-=Me(i,"top","bottom")+s)),!function(t){return t===ke(t).document.documentElement}(t)){var l=Math.round(c+o)-e,u=Math.round(a+s)-n;1!==Math.abs(l)&&(c-=l),1!==Math.abs(u)&&(a-=u)}return je(r.left,r.top,c,a)}var Te="undefined"!=typeof SVGGraphicsElement?function(t){return t instanceof ke(t).SVGGraphicsElement}:function(t){return t instanceof ke(t).SVGElement&&"function"==typeof t.getBBox};function ze(t){return ye?Te(t)?function(t){var e=t.getBBox();return je(0,0,e.width,e.height)}(t):Ae(t):xe}function je(t,e,n,i){return{x:t,y:e,width:n,height:i}}var Ce=function(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=je(0,0,0,0),this.target=t};Ce.prototype.isActive=function(){var t=ze(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},Ce.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t};var De=function(t,e){var n,i,r,o,s,c,a,l=(i=(n=e).x,r=n.y,o=n.width,s=n.height,c="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,a=Object.create(c.prototype),_e(a,{x:i,y:r,width:o,height:s,top:r,right:i+o,bottom:s+r,left:i}),a);_e(this,{target:t,contentRect:l})},Ne=function(t,e,n){if(this.activeObservations_=[],this.observations_=new be,"function"!=typeof t)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=n};Ne.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof ke(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new Ce(t)),this.controller_.addObserver(this),this.controller_.refresh())}},Ne.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof ke(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)&&(e.delete(t),e.size||this.controller_.removeObserver(this))}},Ne.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},Ne.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(e){e.isActive()&&t.activeObservations_.push(e)})},Ne.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map(function(t){return new De(t.target,t.broadcastRect())});this.callback_.call(t,e,t),this.clearActive()}},Ne.prototype.clearActive=function(){this.activeObservations_.splice(0)},Ne.prototype.hasActive=function(){return this.activeObservations_.length>0};var Ye="undefined"!=typeof WeakMap?new WeakMap:new be,Xe=function(t){if(!(this instanceof Xe))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var e=Oe.getInstance(),n=new Ne(t,e,this);Ye.set(this,n)};["observe","unobserve","disconnect"].forEach(function(t){Xe.prototype[t]=function(){return(e=Ye.get(this))[t].apply(e,arguments);var e}});var Re=void 0!==me.ResizeObserver?me.ResizeObserver:Xe,Pe=!("undefined"==typeof window||!window.document||!window.document.createElement);function We(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return Pe&&function(){function t(e,n){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.onScrollX=function(){i.scrollXTicking||(window.requestAnimationFrame(i.scrollX),i.scrollXTicking=!0)},this.onScrollY=function(){i.scrollYTicking||(window.requestAnimationFrame(i.scrollY),i.scrollYTicking=!0)},this.scrollX=function(){i.showScrollbar("x"),i.positionScrollbar("x"),i.scrollXTicking=!1},this.scrollY=function(){i.showScrollbar("y"),i.positionScrollbar("y"),i.scrollYTicking=!1},this.onMouseEnter=function(){i.showScrollbar("x"),i.showScrollbar("y")},this.onWindowResize=function(){i.hideNativeScrollbar()},this.hideScrollbars=function(){i.scrollbarX.classList.remove("visible"),i.scrollbarY.classList.remove("visible"),i.isVisible.x=!1,i.isVisible.y=!1,window.clearTimeout(i.flashTimeout)},this.onMouseDown=function(t){var e=i.scrollbarY.getBoundingClientRect();t.pageX>=e.x&&t.clientX<=e.x+e.width&&t.clientY>=e.y&&t.clientY<=e.y+e.height&&(t.preventDefault(),i.onDrag(t,"y"))},this.drag=function(t){var e,n,r;t.preventDefault(),"y"===i.currentAxis?(e=t.pageY,n=i.trackY,r=i.scrollContentEl):(e=t.pageX,n=i.trackX,r=i.contentEl);var o=(e-n.getBoundingClientRect()[i.offsetAttr[i.currentAxis]]-i.dragOffset[i.currentAxis])/n[i.sizeAttr[i.currentAxis]]*i.contentEl[i.scrollSizeAttr[i.currentAxis]];r[i.scrollOffsetAttr[i.currentAxis]]=o},this.onEndDrag=function(){document.removeEventListener("mousemove",i.drag),document.removeEventListener("mouseup",i.onEndDrag)},this.el=e,this.flashTimeout,this.contentEl,this.scrollContentEl,this.dragOffset={x:0,y:0},this.isEnabled={x:!0,y:!0},this.isVisible={x:!1,y:!1},this.scrollOffsetAttr={x:"scrollLeft",y:"scrollTop"},this.sizeAttr={x:"offsetWidth",y:"offsetHeight"},this.scrollSizeAttr={x:"scrollWidth",y:"scrollHeight"},this.offsetAttr={x:"left",y:"top"},this.globalObserver,this.mutationObserver,this.resizeObserver,this.currentAxis,this.scrollbarWidth,this.options=Object.assign({},t.defaultOptions,n),this.isRtl="rtl"===this.options.direction,this.classNames=this.options.classNames,this.offsetSize=20,this.recalculate=ve(this.recalculate.bind(this),1e3),this.init()}var e,n,i;return e=t,i=[{key:"initHtmlApi",value:function(){this.initDOMLoadedElements=this.initDOMLoadedElements.bind(this),"undefined"!=typeof MutationObserver&&(this.globalObserver=new MutationObserver(function(e){e.forEach(function(e){Array.from(e.addedNodes).forEach(function(e){1===e.nodeType&&(e.hasAttribute("data-simplebar")?!e.SimpleBar&&new t(e,t.getElOptions(e)):Array.from(e.querySelectorAll("[data-simplebar]")).forEach(function(e){!e.SimpleBar&&new t(e,t.getElOptions(e))}))}),Array.from(e.removedNodes).forEach(function(t){1===t.nodeType&&(t.hasAttribute("data-simplebar")?t.SimpleBar&&t.SimpleBar.unMount():Array.from(t.querySelectorAll("[data-simplebar]")).forEach(function(t){t.SimpleBar&&t.SimpleBar.unMount()}))})})}),this.globalObserver.observe(document,{childList:!0,subtree:!0})),"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?window.setTimeout(this.initDOMLoadedElements):(document.addEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.addEventListener("load",this.initDOMLoadedElements))}},{key:"getElOptions",value:function(t){return Array.from(t.attributes).reduce(function(t,e){var n=e.name.match(/data-simplebar-(.+)/);if(n){var i=n[1].replace(/\W+(.)/g,function(t,e){return e.toUpperCase()});switch(e.value){case"true":t[i]=!0;break;case"false":t[i]=!1;break;case void 0:t[i]=!0;break;default:t[i]=e.value}}return t},{})}},{key:"removeObserver",value:function(){this.globalObserver.disconnect()}},{key:"initDOMLoadedElements",value:function(){document.removeEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.removeEventListener("load",this.initDOMLoadedElements),Array.from(document.querySelectorAll("[data-simplebar]")).forEach(function(e){e.SimpleBar||new t(e,t.getElOptions(e))})}},{key:"defaultOptions",get:function(){return{autoHide:!0,forceVisible:!1,classNames:{content:"simplebar-content",scrollContent:"simplebar-scroll-content",scrollbar:"simplebar-scrollbar",track:"simplebar-track"},scrollbarMinSize:25,scrollbarMaxSize:0,direction:"ltr",timeout:1e3}}}],(n=[{key:"init",value:function(){this.el.SimpleBar=this,this.initDOM(),Pe&&(this.hideNativeScrollbar(),this.render(),this.initListeners())}},{key:"initDOM",value:function(){var t=this;if(Array.from(this.el.children).filter(function(e){return e.classList.contains(t.classNames.scrollContent)}).length)this.trackX=this.el.querySelector(".".concat(this.classNames.track,".horizontal")),this.trackY=this.el.querySelector(".".concat(this.classNames.track,".vertical")),this.scrollContentEl=this.el.querySelector(".".concat(this.classNames.scrollContent)),this.contentEl=this.el.querySelector(".".concat(this.classNames.content));else{for(this.scrollContentEl=document.createElement("div"),this.contentEl=document.createElement("div"),this.scrollContentEl.classList.add(this.classNames.scrollContent),this.contentEl.classList.add(this.classNames.content);this.el.firstChild;)this.contentEl.appendChild(this.el.firstChild);this.scrollContentEl.appendChild(this.contentEl),this.el.appendChild(this.scrollContentEl)}if(!this.trackX||!this.trackY){var e=document.createElement("div"),n=document.createElement("div");e.classList.add(this.classNames.track),n.classList.add(this.classNames.scrollbar),this.options.autoHide||n.classList.add("visible"),e.appendChild(n),this.trackX=e.cloneNode(!0),this.trackX.classList.add("horizontal"),this.trackY=e.cloneNode(!0),this.trackY.classList.add("vertical"),this.el.insertBefore(this.trackX,this.el.firstChild),this.el.insertBefore(this.trackY,this.el.firstChild)}this.scrollbarX=this.trackX.querySelector(".".concat(this.classNames.scrollbar)),this.scrollbarY=this.trackY.querySelector(".".concat(this.classNames.scrollbar)),this.el.setAttribute("data-simplebar","init")}},{key:"initListeners",value:function(){var t=this;this.options.autoHide&&this.el.addEventListener("mouseenter",this.onMouseEnter),this.el.addEventListener("mousedown",this.onMouseDown),this.contentEl.addEventListener("scroll",this.onScrollX),this.scrollContentEl.addEventListener("scroll",this.onScrollY),window.addEventListener("resize",this.onWindowResize),"undefined"!=typeof MutationObserver&&(this.mutationObserver=new MutationObserver(function(e){e.forEach(function(e){(t.isChildNode(e.target)||e.addedNodes.length)&&t.recalculate()})}),this.mutationObserver.observe(this.el,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),this.resizeObserver=new Re(this.recalculate),this.resizeObserver.observe(this.el)}},{key:"recalculate",value:function(){this.render()}},{key:"render",value:function(){this.contentSizeX=this.contentEl[this.scrollSizeAttr.x],this.contentSizeY=this.contentEl[this.scrollSizeAttr.y]-(this.scrollbarWidth||this.offsetSize),this.trackXSize=this.trackX[this.sizeAttr.x],this.trackYSize=this.trackY[this.sizeAttr.y],this.isEnabled.x=this.trackXSize<this.contentSizeX,this.isEnabled.y=this.trackYSize<this.contentSizeY,this.resizeScrollbar("x"),this.resizeScrollbar("y"),this.positionScrollbar("x"),this.positionScrollbar("y"),this.toggleTrackVisibility("x"),this.toggleTrackVisibility("y")}},{key:"resizeScrollbar",value:function(){var t,e,n,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"y";if(this.isEnabled[i]||this.options.forceVisible){"x"===i?(t=this.scrollbarX,e=this.contentSizeX,n=this.trackXSize):(t=this.scrollbarY,e=this.contentSizeY,n=this.trackYSize);var r=n/e;this.handleSize=Math.max(~~(r*n),this.options.scrollbarMinSize),this.options.scrollbarMaxSize&&(this.handleSize=Math.min(this.handleSize,this.options.scrollbarMaxSize)),"x"===i?t.style.width="".concat(this.handleSize,"px"):t.style.height="".concat(this.handleSize,"px")}}},{key:"positionScrollbar",value:function(){var t,e,n,i,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"y";"x"===r?(t=this.scrollbarX,e=this.contentEl[this.scrollOffsetAttr[r]],n=this.contentSizeX,i=this.trackXSize):(t=this.scrollbarY,e=this.scrollContentEl[this.scrollOffsetAttr[r]],n=this.contentSizeY,i=this.trackYSize);var o=e/(n-i),s=~~((i-this.handleSize)*o);(this.isEnabled[r]||this.options.forceVisible)&&(t.style.transform="x"===r?"translate3d(".concat(s,"px, 0, 0)"):"translate3d(0, ".concat(s,"px, 0)"))}},{key:"toggleTrackVisibility",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"y",e="y"===t?this.trackY:this.trackX,n="y"===t?this.scrollbarY:this.scrollbarX;this.isEnabled[t]||this.options.forceVisible?e.style.visibility="visible":e.style.visibility="hidden",this.options.forceVisible&&(this.isEnabled[t]?n.style.visibility="visible":n.style.visibility="hidden")}},{key:"hideNativeScrollbar",value:function(){this.scrollbarWidth=Jt(),this.scrollContentEl.style[this.isRtl?"paddingLeft":"paddingRight"]="".concat(this.scrollbarWidth||this.offsetSize,"px"),this.scrollContentEl.style.marginBottom="-".concat(2*this.scrollbarWidth||this.offsetSize,"px"),this.contentEl.style.paddingBottom="".concat(this.scrollbarWidth||this.offsetSize,"px"),0!==this.scrollbarWidth&&(this.contentEl.style[this.isRtl?"marginLeft":"marginRight"]="-".concat(this.scrollbarWidth,"px"))}},{key:"showScrollbar",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"y";this.isVisible[e]||(t="x"===e?this.scrollbarX:this.scrollbarY,this.isEnabled[e]&&(t.classList.add("visible"),this.isVisible[e]=!0),this.options.autoHide&&(this.flashTimeout=window.setTimeout(this.hideScrollbars,this.options.timeout)))}},{key:"onDrag",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"y";t.preventDefault();var n="y"===e?this.scrollbarY:this.scrollbarX,i="y"===e?t.pageY:t.pageX;this.dragOffset[e]=i-n.getBoundingClientRect()[this.offsetAttr[e]],this.currentAxis=e,document.addEventListener("mousemove",this.drag),document.addEventListener("mouseup",this.onEndDrag)}},{key:"getScrollElement",value:function(){return"y"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"y")?this.scrollContentEl:this.contentEl}},{key:"getContentElement",value:function(){return this.contentEl}},{key:"removeListeners",value:function(){this.options.autoHide&&this.el.removeEventListener("mouseenter",this.onMouseEnter),this.scrollContentEl.removeEventListener("scroll",this.onScrollY),this.contentEl.removeEventListener("scroll",this.onScrollX),this.mutationObserver.disconnect(),this.resizeObserver.disconnect()}},{key:"unMount",value:function(){this.removeListeners(),this.el.SimpleBar=null}},{key:"isChildNode",value:function(t){return null!==t&&(t===this.el||this.isChildNode(t.parentNode))}}])&&We(e.prototype,n),i&&We(e,i),t}().initHtmlApi(),function(e){var r=e.children,o=i(e,["children"]);return t.createElement("div",n({"data-simplebar":!0},o),t.createElement("div",{className:"simplebar-scroll-content"},t.createElement("div",{className:"simplebar-content"},r)))}}); |
{ | ||
"name": "simplebar-react", | ||
"version": "0.0.1-beta.0", | ||
"version": "0.0.1-beta.1", | ||
"description": "React component for SimpleBar", | ||
@@ -21,3 +21,3 @@ "files": [ | ||
"prop-types": "^15.6.1", | ||
"simplebar": "^3.0.0-beta.0" | ||
"simplebar": "^3.0.0-beta.2" | ||
}, | ||
@@ -24,0 +24,0 @@ "peerDependencies": { |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
34937
195
4
Updatedsimplebar@^3.0.0-beta.2