New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

simplebar

Package Overview
Dependencies
Maintainers
2
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simplebar - npm Package Compare versions

Comparing version 2.6.1 to 3.0.0-beta.0

dist/.DS_Store

910

dist/simplebar.esm.js

@@ -1,461 +0,486 @@

import 'core-js/fn/array/from';
/**
* SimpleBar.js - v2.6.1
* Scrollbars, simpler.
* https://grsmto.github.io/simplebar/
*
* Made by Adrien Denat from a fork by Jonathan Nicol
* Under MIT License
*/
import 'core-js/modules/es6.regexp.replace';
import 'core-js/modules/es6.function.name';
import 'core-js/modules/es6.regexp.match';
import 'core-js/modules/web.dom.iterable';
import 'core-js/modules/es6.array.from';
import 'core-js/modules/es6.object.assign';
import scrollbarWidth from 'scrollbarwidth';
import debounce from 'lodash.debounce';
import throttle from 'lodash.throttle';
import ResizeObserver from 'resize-observer-polyfill';
// Polyfills
Object.assign = require('object-assign');
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
class SimpleBar {
constructor(element, options) {
this.el = element;
this.flashTimeout;
this.contentEl;
this.scrollContentEl;
this.dragOffset = { x: 0, y: 0 };
this.isVisible = { x: true, y: true };
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.isRtl;
this.options = Object.assign({}, SimpleBar.defaultOptions, options);
this.classNames = this.options.classNames;
this.scrollbarWidth = scrollbarWidth();
this.offsetSize = 20;
this.flashScrollbar = this.flashScrollbar.bind(this);
this.onDragY = this.onDragY.bind(this);
this.onDragX = this.onDragX.bind(this);
this.onScrollY = this.onScrollY.bind(this);
this.onScrollX = this.onScrollX.bind(this);
this.drag = this.drag.bind(this);
this.onEndDrag = this.onEndDrag.bind(this);
this.onMouseEnter = this.onMouseEnter.bind(this);
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
this.recalculate = debounce(this.recalculate, 100, { leading: true });
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
this.init();
}
var SimpleBar =
/*#__PURE__*/
function () {
function SimpleBar(element, options) {
var _this = this;
static get defaultOptions() {
return {
autoHide: true,
classNames: {
content: 'simplebar-content',
scrollContent: 'simplebar-scroll-content',
scrollbar: 'simplebar-scrollbar',
track: 'simplebar-track'
},
scrollbarMinSize: 25
}
}
_classCallCheck(this, SimpleBar);
static get htmlAttributes() {
return {
autoHide: 'data-simplebar-auto-hide',
scrollbarMinSize: 'data-simplebar-scrollbar-min-size'
}
}
this.onScrollX = function () {
if (!_this.scrollXTicking) {
window.requestAnimationFrame(_this.scrollX);
_this.scrollXTicking = true;
}
};
static initHtmlApi() {
this.initDOMLoadedElements = this.initDOMLoadedElements.bind(this);
this.onScrollY = function () {
if (!_this.scrollYTicking) {
window.requestAnimationFrame(_this.scrollY);
_this.scrollYTicking = true;
}
};
// MutationObserver is IE11+
if (typeof MutationObserver !== 'undefined') {
// Mutation observer to observe dynamically added elements
this.globalObserver = new MutationObserver(mutations => {
mutations.forEach(mutation => {
Array.from(mutation.addedNodes).forEach(addedNode => {
if (addedNode.nodeType === 1) {
if (addedNode.hasAttribute('data-simplebar')) {
!addedNode.SimpleBar && new SimpleBar(addedNode, SimpleBar.getElOptions(addedNode));
} else {
Array.from(addedNode.querySelectorAll('[data-simplebar]')).forEach(el => {
!el.SimpleBar && new SimpleBar(el, SimpleBar.getElOptions(el));
});
}
}
});
this.scrollX = function () {
_this.showScrollbar('x');
Array.from(mutation.removedNodes).forEach(removedNode => {
if (removedNode.nodeType === 1) {
if (removedNode.hasAttribute('data-simplebar')) {
removedNode.SimpleBar && removedNode.SimpleBar.unMount();
} else {
Array.from(removedNode.querySelectorAll('[data-simplebar]')).forEach(el => {
el.SimpleBar && el.SimpleBar.unMount();
});
}
}
});
});
});
_this.positionScrollbar('x');
this.globalObserver.observe(document, { childList: true, subtree: true });
}
_this.scrollXTicking = false;
};
// Taken from jQuery `ready` function
// Instantiate elements already present on the page
if (document.readyState === 'complete' ||
(document.readyState !== 'loading' && !document.documentElement.doScroll)) {
// Handle it asynchronously to allow scripts the opportunity to delay init
window.setTimeout(this.initDOMLoadedElements.bind(this));
} else {
document.addEventListener('DOMContentLoaded', this.initDOMLoadedElements);
window.addEventListener('load', this.initDOMLoadedElements);
}
}
this.scrollY = function () {
_this.showScrollbar('y');
// Helper function to retrieve options from element attributes
static getElOptions(el) {
const options = Object.keys(SimpleBar.htmlAttributes).reduce((acc, obj) => {
const attribute = SimpleBar.htmlAttributes[obj];
if (el.hasAttribute(attribute)) {
acc[obj] = JSON.parse(el.getAttribute(attribute) || true);
}
return acc;
}, {});
_this.positionScrollbar('y');
return options;
}
_this.scrollYTicking = false;
};
static removeObserver() {
this.globalObserver.disconnect();
}
this.onMouseEnter = function () {
_this.showScrollbar('x');
static initDOMLoadedElements() {
document.removeEventListener('DOMContentLoaded', this.initDOMLoadedElements);
window.removeEventListener('load', this.initDOMLoadedElements);
_this.showScrollbar('y');
};
Array.from(document.querySelectorAll('[data-simplebar]')).forEach(el => {
if (!el.SimpleBar)
new SimpleBar(el, SimpleBar.getElOptions(el));
});
}
this.onWindowResize = function () {
_this.hideNativeScrollbar();
};
init() {
// Save a reference to the instance, so we know this DOM node has already been instancied
this.el.SimpleBar = this;
this.hideScrollbars = function () {
_this.scrollbarX.classList.remove('visible');
this.initDOM();
_this.scrollbarY.classList.remove('visible');
this.scrollbarX = this.trackX.querySelector(`.${this.classNames.scrollbar}`);
this.scrollbarY = this.trackY.querySelector(`.${this.classNames.scrollbar}`);
_this.isVisible.x = false;
_this.isVisible.y = false;
window.clearTimeout(_this.flashTimeout);
};
this.isRtl = getComputedStyle(this.contentEl).direction === 'rtl';
this.onMouseDown = function (e) {
var bbox = _this.scrollbarY.getBoundingClientRect();
this.scrollContentEl.style[this.isRtl ? 'paddingLeft' : 'paddingRight'] = `${this.scrollbarWidth || this.offsetSize}px`;
this.scrollContentEl.style.marginBottom = `-${this.scrollbarWidth*2 || this.offsetSize}px`;
this.contentEl.style.paddingBottom = `${this.scrollbarWidth || this.offsetSize}px`;
if (e.pageX >= bbox.x && e.clientX <= bbox.x + bbox.width && e.clientY >= bbox.y && e.clientY <= bbox.y + bbox.height) {
e.preventDefault();
if (this.scrollbarWidth !== 0) {
this.contentEl.style[this.isRtl ? 'marginLeft' : 'marginRight'] = `-${this.scrollbarWidth}px`;
}
_this.onDrag(e, 'y');
}
};
// Calculate content size
this.recalculate();
this.drag = function (e) {
var eventOffset, track, scrollEl;
e.preventDefault();
this.initListeners();
}
if (_this.currentAxis === 'y') {
eventOffset = e.pageY;
track = _this.trackY;
scrollEl = _this.scrollContentEl;
} else {
eventOffset = e.pageX;
track = _this.trackX;
scrollEl = _this.contentEl;
} // Calculate how far the user's mouse is from the top/left of the scrollbar (minus the dragOffset).
initDOM() {
// make sure this element doesn't have the elements yet
if (Array.from(this.el.children).filter(child => child.classList.contains(this.classNames.scrollContent)).length) {
// assume that element has his DOM already initiated
this.trackX = this.el.querySelector(`.${this.classNames.track}.horizontal`);
this.trackY = this.el.querySelector(`.${this.classNames.track}.vertical`);
this.scrollContentEl = this.el.querySelector(`.${this.classNames.scrollContent}`);
this.contentEl = this.el.querySelector(`.${this.classNames.content}`);
} else {
// Prepare DOM
this.scrollContentEl = document.createElement('div');
this.contentEl = document.createElement('div');
this.scrollContentEl.classList.add(this.classNames.scrollContent);
this.contentEl.classList.add(this.classNames.content);
var dragPos = eventOffset - track.getBoundingClientRect()[_this.offsetAttr[_this.currentAxis]] - _this.dragOffset[_this.currentAxis]; // Convert the mouse position into a percentage of the scrollbar height/width.
while (this.el.firstChild)
this.contentEl.appendChild(this.el.firstChild);
this.scrollContentEl.appendChild(this.contentEl);
this.el.appendChild(this.scrollContentEl);
}
var dragPerc = dragPos / track[_this.sizeAttr[_this.currentAxis]]; // Scroll the content by the same percentage.
if (!this.trackX || !this.trackY) {
const track = document.createElement('div');
const scrollbar = document.createElement('div');
var scrollPos = dragPerc * _this.contentEl[_this.scrollSizeAttr[_this.currentAxis]];
scrollEl[_this.scrollOffsetAttr[_this.currentAxis]] = scrollPos;
};
track.classList.add(this.classNames.track);
scrollbar.classList.add(this.classNames.scrollbar);
this.onEndDrag = function () {
document.removeEventListener('mousemove', _this.drag);
document.removeEventListener('mouseup', _this.onEndDrag);
};
track.appendChild(scrollbar);
this.el = element;
this.flashTimeout;
this.contentEl;
this.scrollContentEl;
this.dragOffset = {
x: 0,
y: 0
};
this.isEnabled = {
x: true,
y: true
};
this.isVisible = {
x: false,
y: false
};
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({}, SimpleBar.defaultOptions, options);
this.isRtl = this.options.direction === 'rtl';
this.classNames = this.options.classNames;
this.offsetSize = 20;
this.recalculate = throttle(this.recalculate.bind(this), 1000);
this.init();
}
this.trackX = track.cloneNode(true);
this.trackX.classList.add('horizontal');
_createClass(SimpleBar, [{
key: "init",
value: function init() {
// Save a reference to the instance, so we know this DOM node has already been instancied
this.el.SimpleBar = this;
this.initDOM(); // Calculate content size
this.trackY = track.cloneNode(true);
this.trackY.classList.add('vertical');
this.hideNativeScrollbar();
this.render();
this.initListeners();
}
}, {
key: "initDOM",
value: function initDOM() {
var _this2 = this;
this.el.insertBefore(this.trackX, this.el.firstChild);
this.el.insertBefore(this.trackY, this.el.firstChild);
}
// make sure this element doesn't have the elements yet
if (Array.from(this.el.children).filter(function (child) {
return child.classList.contains(_this2.classNames.scrollContent);
}).length) {
// assume that element has his DOM already initiated
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 {
// Prepare DOM
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.setAttribute('data-simplebar', 'init');
}
initListeners() {
// Event listeners
if (this.options.autoHide) {
this.el.addEventListener('mouseenter', this.onMouseEnter);
while (this.el.firstChild) {
this.contentEl.appendChild(this.el.firstChild);
}
this.scrollbarY.addEventListener('mousedown', this.onDragY);
this.scrollbarX.addEventListener('mousedown', this.onDragX);
this.scrollContentEl.appendChild(this.contentEl);
this.el.appendChild(this.scrollContentEl);
}
this.scrollContentEl.addEventListener('scroll', this.onScrollY);
this.contentEl.addEventListener('scroll', this.onScrollX);
if (!this.trackX || !this.trackY) {
var track = document.createElement('div');
var scrollbar = document.createElement('div');
track.classList.add(this.classNames.track);
scrollbar.classList.add(this.classNames.scrollbar);
// MutationObserver is IE11+
if (typeof MutationObserver !== 'undefined') {
// create an observer instance
this.mutationObserver = new MutationObserver(mutations => {
mutations.forEach(mutation => {
if (this.isChildNode(mutation.target) || mutation.addedNodes.length) {
this.recalculate();
}
});
});
// pass in the target node, as well as the observer options
this.mutationObserver.observe(this.el, { attributes: true, childList: true, characterData: true, subtree: true });
if (!this.options.autoHide) {
scrollbar.classList.add('visible');
}
this.resizeObserver = new ResizeObserver(this.recalculate.bind(this));
this.resizeObserver.observe(this.el);
track.appendChild(scrollbar);
this.trackX = track.cloneNode(true);
this.trackX.classList.add('horizontal');
this.trackY = track.cloneNode(true);
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 initListeners() {
var _this3 = this;
removeListeners() {
// Event listeners
if (this.options.autoHide) {
this.el.removeEventListener('mouseenter', this.onMouseEnter);
}
// Event listeners
if (this.options.autoHide) {
this.el.addEventListener('mouseenter', this.onMouseEnter);
}
this.scrollbarX.removeEventListener('mousedown', this.onDragX);
this.scrollbarY.removeEventListener('mousedown', this.onDragY);
this.el.addEventListener('mousedown', this.onMouseDown);
this.contentEl.addEventListener('scroll', this.onScrollX);
this.scrollContentEl.addEventListener('scroll', this.onScrollY); // Browser zoom triggers a window resize
this.scrollContentEl.removeEventListener('scroll', this.onScrollY);
this.contentEl.removeEventListener('scroll', this.onScrollX);
window.addEventListener('resize', this.onWindowResize); // MutationObserver is IE11+
this.mutationObserver.disconnect();
this.resizeObserver.disconnect();
}
if (typeof MutationObserver !== 'undefined') {
// create an observer instance
this.mutationObserver = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
if (_this3.isChildNode(mutation.target) || mutation.addedNodes.length) {
_this3.recalculate();
}
});
}); // pass in the target node, as well as the observer options
onDragX(e) {
this.onDrag(e, 'x');
}
this.mutationObserver.observe(this.el, {
attributes: true,
childList: true,
characterData: true,
subtree: true
});
}
onDragY(e) {
this.onDrag(e, 'y');
this.resizeObserver = new ResizeObserver(this.recalculate);
this.resizeObserver.observe(this.el);
}
/**
* on scrollbar handle drag
* Recalculate scrollbar
*/
onDrag(e, axis = 'y') {
// Preventing the event's default action stops text being
// selectable during the drag.
e.preventDefault();
const scrollbar = axis === 'y' ? this.scrollbarY : this.scrollbarX;
}, {
key: "recalculate",
value: function recalculate() {
this.render();
}
}, {
key: "render",
value: function render() {
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']]; // Set isEnabled to false if scrollbar is not necessary (content is shorter than wrapper)
// Measure how far the user's mouse is from the top of the scrollbar drag handle.
const eventOffset = axis === 'y' ? e.pageY : e.pageX;
this.dragOffset[axis] = eventOffset - scrollbar.getBoundingClientRect()[this.offsetAttr[axis]];
this.currentAxis = axis;
document.addEventListener('mousemove', this.drag);
document.addEventListener('mouseup', this.onEndDrag);
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');
}
/**
* Drag scrollbar handle
* Resize scrollbar
*/
drag(e) {
let eventOffset, track, scrollEl;
e.preventDefault();
}, {
key: "resizeScrollbar",
value: function resizeScrollbar() {
var axis = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'y';
var scrollbar;
var contentSize;
var trackSize;
if (this.currentAxis === 'y') {
eventOffset = e.pageY;
track = this.trackY;
scrollEl = this.scrollContentEl;
} else {
eventOffset = e.pageX;
track = this.trackX;
scrollEl = this.contentEl;
}
if (!this.isEnabled[axis] && !this.options.forceVisible) {
return;
}
// Calculate how far the user's mouse is from the top/left of the scrollbar (minus the dragOffset).
let dragPos = eventOffset - track.getBoundingClientRect()[this.offsetAttr[this.currentAxis]] - this.dragOffset[this.currentAxis];
if (axis === 'x') {
scrollbar = this.scrollbarX;
contentSize = this.contentSizeX;
trackSize = this.trackXSize;
} else {
// 'y'
scrollbar = this.scrollbarY;
contentSize = this.contentSizeY;
trackSize = this.trackYSize;
}
// Convert the mouse position into a percentage of the scrollbar height/width.
let dragPerc = dragPos / track[this.sizeAttr[this.currentAxis]];
var scrollbarRatio = trackSize / contentSize; // Calculate new height/position of drag handle.
// Scroll the content by the same percentage.
let scrollPos = dragPerc * this.contentEl[this.scrollSizeAttr[this.currentAxis]];
this.handleSize = Math.max(~~(scrollbarRatio * trackSize), this.options.scrollbarMinSize);
scrollEl[this.scrollOffsetAttr[this.currentAxis]] = scrollPos;
if (this.options.scrollbarMaxSize) {
this.handleSize = Math.min(this.handleSize, this.options.scrollbarMaxSize);
}
if (axis === 'x') {
scrollbar.style.width = "".concat(this.handleSize, "px");
} else {
scrollbar.style.height = "".concat(this.handleSize, "px");
}
}
}, {
key: "positionScrollbar",
value: function positionScrollbar() {
var axis = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'y';
var scrollbar;
var scrollOffset;
var contentSize;
var trackSize;
if (axis === 'x') {
scrollbar = this.scrollbarX;
scrollOffset = this.contentEl[this.scrollOffsetAttr[axis]]; // Either scrollTop() or scrollLeft().
/**
* End scroll handle drag
*/
onEndDrag() {
document.removeEventListener('mousemove', this.drag);
document.removeEventListener('mouseup', this.onEndDrag);
}
contentSize = this.contentSizeX;
trackSize = this.trackXSize;
} else {
// 'y'
scrollbar = this.scrollbarY;
scrollOffset = this.scrollContentEl[this.scrollOffsetAttr[axis]]; // Either scrollTop() or scrollLeft().
contentSize = this.contentSizeY;
trackSize = this.trackYSize;
}
/**
* Resize scrollbar
*/
resizeScrollbar(axis = 'y') {
let track;
let scrollbar;
let scrollOffset;
let contentSize;
let scrollbarSize;
var scrollPourcent = scrollOffset / (contentSize - trackSize);
var handleOffset = ~~((trackSize - this.handleSize) * scrollPourcent);
if (this.isEnabled[axis] || this.options.forceVisible) {
if (axis === 'x') {
track = this.trackX;
scrollbar = this.scrollbarX;
scrollOffset = this.contentEl[this.scrollOffsetAttr[axis]]; // Either scrollTop() or scrollLeft().
contentSize = this.contentSizeX;
scrollbarSize = this.scrollbarXSize;
} else { // 'y'
track = this.trackY;
scrollbar = this.scrollbarY;
scrollOffset = this.scrollContentEl[this.scrollOffsetAttr[axis]]; // Either scrollTop() or scrollLeft().
contentSize = this.contentSizeY;
scrollbarSize = this.scrollbarYSize;
scrollbar.style.transform = "translate3d(".concat(handleOffset, "px, 0, 0)");
} else {
scrollbar.style.transform = "translate3d(0, ".concat(handleOffset, "px, 0)");
}
}
}
}, {
key: "toggleTrackVisibility",
value: function toggleTrackVisibility() {
var axis = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'y';
var track = axis === 'y' ? this.trackY : this.trackX;
var scrollbar = axis === 'y' ? this.scrollbarY : this.scrollbarX;
let scrollbarRatio = scrollbarSize / contentSize;
let scrollPourcent = scrollOffset / (contentSize - scrollbarSize);
// Calculate new height/position of drag handle.
let handleSize = Math.max(~~(scrollbarRatio * scrollbarSize), this.options.scrollbarMinSize);
let handleOffset = ~~((scrollbarSize - handleSize) * scrollPourcent);
if (this.isEnabled[axis] || this.options.forceVisible) {
track.style.visibility = 'visible';
} else {
track.style.visibility = 'hidden';
} // Even if forceVisible is enabled, scrollbar itself should be hidden
// Set isVisible to false if scrollbar is not necessary (content is shorter than wrapper)
this.isVisible[axis] = scrollbarSize < contentSize;
if (this.isVisible[axis]) {
track.style.visibility = 'visible';
if (axis === 'x') {
scrollbar.style.left = `${handleOffset}px`;
scrollbar.style.width = `${handleSize}px`;
} else {
scrollbar.style.top = `${handleOffset}px`;
scrollbar.style.height = `${handleSize}px`;
}
if (this.options.forceVisible) {
if (this.isEnabled[axis]) {
scrollbar.style.visibility = 'visible';
} else {
track.style.visibility = 'hidden';
scrollbar.style.visibility = 'hidden';
}
}
}
}, {
key: "hideNativeScrollbar",
value: function hideNativeScrollbar() {
// Recalculate scrollbarWidth in case it's a zoom
this.scrollbarWidth = scrollbarWidth();
this.scrollContentEl.style[this.isRtl ? 'paddingLeft' : 'paddingRight'] = "".concat(this.scrollbarWidth || this.offsetSize, "px");
this.scrollContentEl.style.marginBottom = "-".concat(this.scrollbarWidth * 2 || this.offsetSize, "px");
this.contentEl.style.paddingBottom = "".concat(this.scrollbarWidth || this.offsetSize, "px");
if (this.scrollbarWidth !== 0) {
this.contentEl.style[this.isRtl ? 'marginLeft' : 'marginRight'] = "-".concat(this.scrollbarWidth, "px");
}
}
/**
* On scroll event handling
*/
onScrollX() {
this.flashScrollbar('x');
}
onScrollY() {
this.flashScrollbar('y');
}
}, {
key: "showScrollbar",
/**
* On mouseenter event handling
* Show scrollbar
*/
onMouseEnter() {
this.flashScrollbar('x');
this.flashScrollbar('y');
}
value: function showScrollbar() {
var axis = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'y';
var scrollbar; // Scrollbar already visible
if (this.isVisible[axis]) {
return;
}
/**
* Flash scrollbar visibility
*/
flashScrollbar(axis = 'y') {
this.resizeScrollbar(axis);
this.showScrollbar(axis);
}
if (axis === 'x') {
scrollbar = this.scrollbarX;
} else {
// 'y'
scrollbar = this.scrollbarY;
}
if (this.isEnabled[axis]) {
scrollbar.classList.add('visible');
this.isVisible[axis] = true;
}
/**
* Show scrollbar
*/
showScrollbar(axis = 'y') {
if (!this.isVisible[axis]) {
return
}
if (!this.options.autoHide) {
return;
}
if (axis === 'x') {
this.scrollbarX.classList.add('visible');
} else {
this.scrollbarY.classList.add('visible');
}
if (!this.options.autoHide) {
return
}
if(typeof this.flashTimeout === 'number') {
window.clearTimeout(this.flashTimeout);
}
this.flashTimeout = window.setTimeout(this.hideScrollbar.bind(this), 1000);
this.flashTimeout = window.setTimeout(this.hideScrollbars, this.options.timeout);
}
/**
* Hide Scrollbar
*/
hideScrollbar() {
this.scrollbarX.classList.remove('visible');
this.scrollbarY.classList.remove('visible');
if(typeof this.flashTimeout === 'number') {
window.clearTimeout(this.flashTimeout);
}
}
}, {
key: "onDrag",
/**
* Recalculate scrollbar
* on scrollbar handle drag
*/
recalculate() {
this.contentSizeX = this.contentEl[this.scrollSizeAttr['x']];
this.contentSizeY = this.contentEl[this.scrollSizeAttr['y']] - (this.scrollbarWidth || this.offsetSize);
this.scrollbarXSize = this.trackX[this.sizeAttr['x']];
this.scrollbarYSize = this.trackY[this.sizeAttr['y']];
value: function onDrag(e) {
var axis = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'y';
// Preventing the event's default action stops text being
// selectable during the drag.
e.preventDefault();
var scrollbar = axis === 'y' ? this.scrollbarY : this.scrollbarX; // Measure how far the user's mouse is from the top of the scrollbar drag handle.
this.resizeScrollbar('x');
this.resizeScrollbar('y');
if (!this.options.autoHide) {
this.showScrollbar('x');
this.showScrollbar('y');
}
var eventOffset = axis === 'y' ? e.pageY : e.pageX;
this.dragOffset[axis] = eventOffset - scrollbar.getBoundingClientRect()[this.offsetAttr[axis]];
this.currentAxis = axis;
document.addEventListener('mousemove', this.drag);
document.addEventListener('mouseup', this.onEndDrag);
}
/**
* Drag scrollbar handle
*/
}, {
key: "getScrollElement",

@@ -465,38 +490,171 @@ /**

*/
getScrollElement(axis = 'y') {
return axis === 'y' ? this.scrollContentEl : this.contentEl;
value: function getScrollElement() {
var axis = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'y';
return axis === 'y' ? this.scrollContentEl : this.contentEl;
}
/**
* Getter for content element
*/
getContentElement() {
return this.contentEl;
}, {
key: "getContentElement",
value: function getContentElement() {
return this.contentEl;
}
}, {
key: "removeListeners",
value: function removeListeners() {
// Event listeners
if (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();
}
/**
* UnMount mutation observer and delete SimpleBar instance from DOM element
*/
unMount() {
this.removeListeners();
this.el.SimpleBar = null;
}, {
key: "unMount",
value: function unMount() {
this.removeListeners();
this.el.SimpleBar = null;
}
/**
* Recursively walks up the parent nodes looking for this.el
*/
isChildNode(el) {
if (el === null) return false;
if (el === this.el) return true;
return this.isChildNode(el.parentNode);
}, {
key: "isChildNode",
value: function isChildNode(el) {
if (el === null) return false;
if (el === this.el) return true;
return this.isChildNode(el.parentNode);
}
}
}], [{
key: "initHtmlApi",
value: function initHtmlApi() {
this.initDOMLoadedElements = this.initDOMLoadedElements.bind(this); // MutationObserver is IE11+
/**
* HTML API
*/
if (typeof MutationObserver !== 'undefined') {
// Mutation observer to observe dynamically added elements
this.globalObserver = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
Array.from(mutation.addedNodes).forEach(function (addedNode) {
if (addedNode.nodeType === 1) {
if (addedNode.hasAttribute('data-simplebar')) {
!addedNode.SimpleBar && new SimpleBar(addedNode, SimpleBar.getElOptions(addedNode));
} else {
Array.from(addedNode.querySelectorAll('[data-simplebar]')).forEach(function (el) {
!el.SimpleBar && new SimpleBar(el, SimpleBar.getElOptions(el));
});
}
}
});
Array.from(mutation.removedNodes).forEach(function (removedNode) {
if (removedNode.nodeType === 1) {
if (removedNode.hasAttribute('data-simplebar')) {
removedNode.SimpleBar && removedNode.SimpleBar.unMount();
} else {
Array.from(removedNode.querySelectorAll('[data-simplebar]')).forEach(function (el) {
el.SimpleBar && el.SimpleBar.unMount();
});
}
}
});
});
});
this.globalObserver.observe(document, {
childList: true,
subtree: true
});
} // Taken from jQuery `ready` function
// Instantiate elements already present on the page
if (document.readyState === 'complete' || document.readyState !== 'loading' && !document.documentElement.doScroll) {
// Handle it asynchronously to allow scripts the opportunity to delay init
window.setTimeout(this.initDOMLoadedElements.bind(this));
} else {
document.addEventListener('DOMContentLoaded', this.initDOMLoadedElements);
window.addEventListener('load', this.initDOMLoadedElements);
}
} // Helper function to retrieve options from element attributes
}, {
key: "getElOptions",
value: function getElOptions(el) {
var options = Array.from(el.attributes).reduce(function (acc, attribute) {
var option = attribute.name.match(/data-simplebar-(.+)/);
if (option) {
var key = option[1].replace(/\W+(.)/g, function (x, chr) {
return chr.toUpperCase();
});
switch (attribute.value) {
case 'true':
acc[key] = true;
break;
case 'false':
acc[key] = false;
break;
case undefined:
acc[key] = true;
break;
default:
acc[key] = attribute.value;
}
}
return acc;
}, {});
return options;
}
}, {
key: "removeObserver",
value: function removeObserver() {
this.globalObserver.disconnect();
}
}, {
key: "initDOMLoadedElements",
value: function initDOMLoadedElements() {
document.removeEventListener('DOMContentLoaded', this.initDOMLoadedElements);
window.removeEventListener('load', this.initDOMLoadedElements);
Array.from(document.querySelectorAll('[data-simplebar]')).forEach(function (el) {
if (!el.SimpleBar) new SimpleBar(el, SimpleBar.getElOptions(el));
});
}
}, {
key: "defaultOptions",
get: function get() {
return {
autoHide: true,
forceVisible: false,
classNames: {
content: 'simplebar-content',
scrollContent: 'simplebar-scroll-content',
scrollbar: 'simplebar-scrollbar',
track: 'simplebar-track'
},
scrollbarMinSize: 25,
scrollbarMaxSize: 0,
direction: 'ltr',
timeout: 1000
};
}
}]);
return SimpleBar;
}();
SimpleBar.initHtmlApi();
export default SimpleBar;
//# sourceMappingURL=simplebar.esm.js.map

@@ -1,17 +0,10 @@

/*!
/**
* SimpleBar.js - v2.6.1
* Scrollbars, simpler.
* https://grsmto.github.io/simplebar/
*
* SimpleBar.js - v2.6.1
* Scrollbars, simpler.
* https://grsmto.github.io/simplebar/
*
* Made by Adrien Grsmto from a fork by Jonathan Nicol
* Under MIT License
*
* Made by Adrien Denat from a fork by Jonathan Nicol
* Under MIT License
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.SimpleBar=e():t.SimpleBar=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=27)}([function(t,e,n){var r=n(23)("wks"),i=n(12),o=n(1).Symbol,s="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=s&&o[t]||(s?o:i)("Symbol."+t))}).store=r},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){var n=t.exports={version:"2.5.1"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(5),i=n(11);t.exports=n(7)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(6),i=n(33),o=n(34),s=Object.defineProperty;e.f=n(7)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return s(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}},function(t,e,n){var r=n(10);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){t.exports=!n(16)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){t.exports={}},function(t,e,n){var r=n(23)("keys"),i=n(12);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e,n){var r=n(1),i=n(3),o=n(4),s=n(18),c=n(19),a=function(t,e,n){var u,l,f,h,d=t&a.F,p=t&a.G,v=t&a.S,b=t&a.P,y=t&a.B,m=p?r:v?r[e]||(r[e]={}):(r[e]||{}).prototype,g=p?i:i[e]||(i[e]={}),E=g.prototype||(g.prototype={});p&&(n=e);for(u in n)l=!d&&m&&void 0!==m[u],f=(l?m:n)[u],h=y&&l?c(f,r):b&&"function"==typeof f?c(Function.call,f):f,m&&s(m,u,f,t&a.U),g[u]!=f&&o(g,u,h),b&&E[u]!=f&&(E[u]=f)};r.core=i,a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var r=n(10),i=n(1).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e,n){var r=n(1),i=n(4),o=n(2),s=n(12)("src"),c=Function.toString,a=(""+c).split("toString");n(3).inspectSource=function(t){return c.call(t)},(t.exports=function(t,e,n,c){var u="function"==typeof n;u&&(o(n,"name")||i(n,"name",e)),t[e]!==n&&(u&&(o(n,s)||i(n,s,t[e]?""+t[e]:a.join(String(e)))),t===r?t[e]=n:c?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[s]||c.call(this)})},function(t,e,n){var r=n(35);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){var r=n(41),i=n(9);t.exports=function(t){return r(i(t))}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(8),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){var r=n(1),i=r["__core-js_shared__"]||(r["__core-js_shared__"]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(5).f,i=n(2),o=n(0)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){var r=n(9);t.exports=function(t){return Object(r(t))}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n(28);var c=r(n(53)),a=r(n(54)),u=r(n(56));n(57),Object.assign=n(58);var l=function(){function t(e,n){i(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.isRtl,this.options=Object.assign({},t.defaultOptions,n),this.classNames=this.options.classNames,this.scrollbarWidth=(0,c.default)(),this.offsetSize=20,this.flashScrollbar=this.flashScrollbar.bind(this),this.onDragY=this.onDragY.bind(this),this.onDragX=this.onDragX.bind(this),this.onScrollY=this.onScrollY.bind(this),this.onScrollX=this.onScrollX.bind(this),this.drag=this.drag.bind(this),this.onEndDrag=this.onEndDrag.bind(this),this.onMouseEnter=this.onMouseEnter.bind(this),this.recalculate=(0,a.default)(this.recalculate,100,{leading:!0}),this.init()}return s(t,[{key:"init",value:function(){this.el.SimpleBar=this,this.initDOM(),this.scrollbarX=this.trackX.querySelector(".".concat(this.classNames.scrollbar)),this.scrollbarY=this.trackY.querySelector(".".concat(this.classNames.scrollbar)),this.isRtl="rtl"===getComputedStyle(this.contentEl).direction,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")),this.recalculate(),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),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.el.setAttribute("data-simplebar","init")}},{key:"initListeners",value:function(){var t=this;this.options.autoHide&&this.el.addEventListener("mouseenter",this.onMouseEnter),this.scrollbarY.addEventListener("mousedown",this.onDragY),this.scrollbarX.addEventListener("mousedown",this.onDragX),this.scrollContentEl.addEventListener("scroll",this.onScrollY),this.contentEl.addEventListener("scroll",this.onScrollX),"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 u.default(this.recalculate.bind(this)),this.resizeObserver.observe(this.el)}},{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:"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,r="y"===e?t.pageY:t.pageX;this.dragOffset[e]=r-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,r;t.preventDefault(),"y"===this.currentAxis?(e=t.pageY,n=this.trackY,r=this.scrollContentEl):(e=t.pageX,n=this.trackX,r=this.contentEl);var i=e-n.getBoundingClientRect()[this.offsetAttr[this.currentAxis]]-this.dragOffset[this.currentAxis],o=i/n[this.sizeAttr[this.currentAxis]],s=o*this.contentEl[this.scrollSizeAttr[this.currentAxis]];r[this.scrollOffsetAttr[this.currentAxis]]=s}},{key:"onEndDrag",value:function(){document.removeEventListener("mousemove",this.drag),document.removeEventListener("mouseup",this.onEndDrag)}},{key:"resizeScrollbar",value:function(){var t,e,n,r,i,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"y";"x"===o?(t=this.trackX,e=this.scrollbarX,n=this.contentEl[this.scrollOffsetAttr[o]],r=this.contentSizeX,i=this.scrollbarXSize):(t=this.trackY,e=this.scrollbarY,n=this.scrollContentEl[this.scrollOffsetAttr[o]],r=this.contentSizeY,i=this.scrollbarYSize);var s=i/r,c=n/(r-i),a=Math.max(~~(s*i),this.options.scrollbarMinSize),u=~~((i-a)*c);this.isVisible[o]=i<r,this.isVisible[o]||this.options.forceVisible?(t.style.visibility="visible",this.options.forceVisible?e.style.visibility="hidden":e.style.visibility="visible","x"===o?(e.style.left="".concat(u,"px"),e.style.width="".concat(a,"px")):(e.style.top="".concat(u,"px"),e.style.height="".concat(a,"px"))):t.style.visibility="hidden"}},{key:"onScrollX",value:function(){this.flashScrollbar("x")}},{key:"onScrollY",value:function(){this.flashScrollbar("y")}},{key:"onMouseEnter",value:function(){this.flashScrollbar("x"),this.flashScrollbar("y")}},{key:"flashScrollbar",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"y";this.resizeScrollbar(t),this.showScrollbar(t)}},{key:"showScrollbar",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"y";this.isVisible[t]&&("x"===t?this.scrollbarX.classList.add("visible"):this.scrollbarY.classList.add("visible"),this.options.autoHide&&("number"==typeof this.flashTimeout&&window.clearTimeout(this.flashTimeout),this.flashTimeout=window.setTimeout(this.hideScrollbar.bind(this),1e3)))}},{key:"hideScrollbar",value:function(){this.scrollbarX.classList.remove("visible"),this.scrollbarY.classList.remove("visible"),"number"==typeof this.flashTimeout&&window.clearTimeout(this.flashTimeout)}},{key:"recalculate",value:function(){this.contentSizeX=this.contentEl[this.scrollSizeAttr.x],this.contentSizeY=this.contentEl[this.scrollSizeAttr.y]-(this.scrollbarWidth||this.offsetSize),this.scrollbarXSize=this.trackX[this.sizeAttr.x],this.scrollbarYSize=this.trackY[this.sizeAttr.y],this.resizeScrollbar("x"),this.resizeScrollbar("y"),this.options.autoHide||(this.showScrollbar("x"),this.showScrollbar("y"))}},{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:"unMount",value:function(){this.removeListeners(),this.el.SimpleBar=null}},{key:"isChildNode",value:function(t){return null!==t&&(t===this.el||this.isChildNode(t.parentNode))}}],[{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(e){return Object.keys(t.htmlAttributes).reduce(function(n,r){var i=t.htmlAttributes[r];return e.hasAttribute(i)&&(n[r]=JSON.parse(e.getAttribute(i)||!0)),n},{})}},{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}}},{key:"htmlAttributes",get:function(){return{autoHide:"data-simplebar-auto-hide",forceVisible:"data-simplebar-force-visible",scrollbarMinSize:"data-simplebar-scrollbar-min-size"}}}]),t}();e.default=l,l.initHtmlApi()},function(t,e,n){n(29),n(46),t.exports=n(3).Array.from},function(t,e,n){"use strict";var r=n(30)(!0);n(31)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){var r=n(8),i=n(9);t.exports=function(t){return function(e,n){var o,s,c=String(i(e)),a=r(n),u=c.length;return a<0||a>=u?t?"":void 0:(o=c.charCodeAt(a),o<55296||o>56319||a+1===u||(s=c.charCodeAt(a+1))<56320||s>57343?t?c.charAt(a):o:t?c.slice(a,a+2):s-56320+(o-55296<<10)+65536)}}},function(t,e,n){"use strict";var r=n(32),i=n(15),o=n(18),s=n(4),c=n(2),a=n(13),u=n(36),l=n(25),f=n(45),h=n(0)("iterator"),d=!([].keys&&"next"in[].keys()),p=function(){return this};t.exports=function(t,e,n,v,b,y,m){u(n,e,v);var g,E,O,_=function(t){if(!d&&t in A)return A[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},x=e+" Iterator",w="values"==b,S=!1,A=t.prototype,k=A[h]||A["@@iterator"]||b&&A[b],j=k||_(b),M=b?w?_("entries"):j:void 0,L="Array"==e?A.entries||k:k;if(L&&(O=f(L.call(new t)))!==Object.prototype&&O.next&&(l(O,x,!0),r||c(O,h)||s(O,h,p)),w&&k&&"values"!==k.name&&(S=!0,j=function(){return k.call(this)}),r&&!m||!d&&!S&&A[h]||s(A,h,j),a[e]=j,a[x]=p,b)if(g={values:w?j:_("values"),keys:y?j:_("keys"),entries:M},m)for(E in g)E in A||o(A,E,g[E]);else i(i.P+i.F*(d||S),e,g);return g}},function(t,e){t.exports=!1},function(t,e,n){t.exports=!n(7)&&!n(16)(function(){return 7!=Object.defineProperty(n(17)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(10);t.exports=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")}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){"use strict";var r=n(37),i=n(11),o=n(25),s={};n(4)(s,n(0)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(s,{next:i(1,n)}),o(t,e+" Iterator")}},function(t,e,n){var r=n(6),i=n(38),o=n(24),s=n(14)("IE_PROTO"),c=function(){},a=function(){var t,e=n(17)("iframe"),r=o.length;for(e.style.display="none",n(44).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("<script>document.F=Object<\/script>"),t.close(),a=t.F;r--;)delete a.prototype[o[r]];return a()};t.exports=Object.create||function(t,e){var n;return null!==t?(c.prototype=r(t),n=new c,c.prototype=null,n[s]=t):n=a(),void 0===e?n:i(n,e)}},function(t,e,n){var r=n(5),i=n(6),o=n(39);t.exports=n(7)?Object.defineProperties:function(t,e){i(t);for(var n,s=o(e),c=s.length,a=0;c>a;)r.f(t,n=s[a++],e[n]);return t}},function(t,e,n){var r=n(40),i=n(24);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e,n){var r=n(2),i=n(20),o=n(42)(!1),s=n(14)("IE_PROTO");t.exports=function(t,e){var n,c=i(t),a=0,u=[];for(n in c)n!=s&&r(c,n)&&u.push(n);for(;e.length>a;)r(c,n=e[a++])&&(~o(u,n)||u.push(n));return u}},function(t,e,n){var r=n(21);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(20),i=n(22),o=n(43);t.exports=function(t){return function(e,n,s){var c,a=r(e),u=i(a.length),l=o(s,u);if(t&&n!=n){for(;u>l;)if((c=a[l++])!=c)return!0}else for(;u>l;l++)if((t||l in a)&&a[l]===n)return t||l||0;return!t&&-1}}},function(t,e,n){var r=n(8),i=Math.max,o=Math.min;t.exports=function(t,e){return t=r(t),t<0?i(t+e,0):o(t,e)}},function(t,e,n){var r=n(1).document;t.exports=r&&r.documentElement},function(t,e,n){var r=n(2),i=n(26),o=n(14)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,e,n){"use strict";var r=n(19),i=n(15),o=n(26),s=n(47),c=n(48),a=n(22),u=n(49),l=n(50);i(i.S+i.F*!n(52)(function(t){Array.from(t)}),"Array",{from:function(t){var e,n,i,f,h=o(t),d="function"==typeof this?this:Array,p=arguments.length,v=p>1?arguments[1]:void 0,b=void 0!==v,y=0,m=l(h);if(b&&(v=r(v,p>2?arguments[2]:void 0,2)),void 0==m||d==Array&&c(m))for(e=a(h.length),n=new d(e);e>y;y++)u(n,y,b?v(h[y],y):h[y]);else for(f=m.call(h),n=new d;!(i=f.next()).done;y++)u(n,y,b?s(f,v,[i.value,y],!0):i.value);return n.length=y,n}})},function(t,e,n){var r=n(6);t.exports=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}}},function(t,e,n){var r=n(13),i=n(0)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},function(t,e,n){"use strict";var r=n(5),i=n(11);t.exports=function(t,e,n){e in t?r.f(t,e,i(0,n)):t[e]=n}},function(t,e,n){var r=n(51),i=n(0)("iterator"),o=n(13);t.exports=n(3).getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||o[r(t)]}},function(t,e,n){var r=n(21),i=n(0)("toStringTag"),o="Arguments"==r(function(){return arguments}()),s=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,n,c;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=s(e=Object(t),i))?n:o?r(e):"Object"==(c=r(e))&&"function"==typeof e.callee?"Arguments":c}},function(t,e,n){var r=n(0)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o=[7],s=o[r]();s.next=function(){return{done:n=!0}},o[r]=function(){return s},t(o)}catch(t){}return n}},function(t,e,n){var r,i,o;/*! scrollbarWidth.js v0.1.3 | felixexter | MIT | https://github.com/felixexter/scrollbarWidth */
!function(n,s){i=[],r=s,void 0!==(o="function"==typeof r?r.apply(e,i):r)&&(t.exports=o)}(0,function(){"use strict";function t(){if("undefined"==typeof document)return 0;var t,e=document.body,n=document.createElement("div"),r=n.style;return r.position="absolute",r.top=r.left="-9999px",r.width=r.height="100px",r.overflow="scroll",e.appendChild(n),t=n.offsetWidth-n.clientWidth,e.removeChild(n),t}return t})},function(t,e,n){(function(e){function n(t,e,n){function i(e){var n=v,r=b;return v=b=void 0,w=e,m=t.apply(r,n)}function o(t){return w=t,g=setTimeout(l,e),S?i(t):m}function a(t){var n=t-x,r=t-w,i=e-n;return A?O(i,y-r):i}function u(t){var n=t-x,r=t-w;return void 0===x||n>=e||n<0||A&&r>=y}function l(){var t=_();if(u(t))return f(t);g=setTimeout(l,a(t))}function f(t){return g=void 0,k&&v?i(t):(v=b=void 0,m)}function h(){void 0!==g&&clearTimeout(g),w=0,v=x=b=g=void 0}function d(){return void 0===g?m:f(_())}function p(){var t=_(),n=u(t);if(v=arguments,b=this,x=t,n){if(void 0===g)return o(x);if(A)return g=setTimeout(l,e),i(x)}return void 0===g&&(g=setTimeout(l,e)),m}var v,b,y,m,g,x,w=0,S=!1,A=!1,k=!0;if("function"!=typeof t)throw new TypeError(c);return e=s(e)||0,r(n)&&(S=!!n.leading,A="maxWait"in n,y=A?E(s(n.maxWait)||0,e):y,k="trailing"in n?!!n.trailing:k),p.cancel=h,p.flush=d,p}function r(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function i(t){return!!t&&"object"==typeof t}function o(t){return"symbol"==typeof t||i(t)&&g.call(t)==u}function s(t){if("number"==typeof t)return t;if(o(t))return a;if(r(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=r(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(l,"");var n=h.test(t);return n||d.test(t)?p(t.slice(2),n?2:8):f.test(t)?a:+t}var c="Expected a function",a=NaN,u="[object Symbol]",l=/^\s+|\s+$/g,f=/^[-+]0x[0-9a-f]+$/i,h=/^0b[01]+$/i,d=/^0o[0-7]+$/i,p=parseInt,v="object"==typeof e&&e&&e.Object===Object&&e,b="object"==typeof self&&self&&self.Object===Object&&self,y=v||b||Function("return this")(),m=Object.prototype,g=m.toString,E=Math.max,O=Math.min,_=function(){return y.Date.now()};t.exports=n}).call(e,n(55))},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";function r(t){return parseFloat(t)||0}function i(t){return Array.prototype.slice.call(arguments,1).reduce(function(e,n){return e+r(t["border-"+n+"-width"])},0)}function o(t){for(var e=["top","right","bottom","left"],n={},i=0,o=e;i<o.length;i+=1){var s=o[i],c=t["padding-"+s];n[s]=r(c)}return n}function s(t){var e=t.getBBox();return f(0,0,e.width,e.height)}function c(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return _;var s=getComputedStyle(t),c=o(s),u=c.left+c.right,l=c.top+c.bottom,h=r(s.width),d=r(s.height);if("border-box"===s.boxSizing&&(Math.round(h+u)!==e&&(h-=i(s,"left","right")+u),Math.round(d+l)!==n&&(d-=i(s,"top","bottom")+l)),!a(t)){var p=Math.round(h+u)-e,v=Math.round(d+l)-n;1!==Math.abs(p)&&(h-=p),1!==Math.abs(v)&&(d-=v)}return f(c.left,c.top,h,d)}function a(t){return t===document.documentElement}function u(t){return d?x(t)?s(t):c(t):_}function l(t){var e=t.x,n=t.y,r=t.width,i=t.height,o="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,s=Object.create(o.prototype);return O(s,{x:e,y:n,width:r,height:i,top:n,right:e+r,bottom:i+n,left:e}),s}function f(t,e,n,r){return{x:t,y:e,width:n,height:r}}Object.defineProperty(e,"__esModule",{value:!0});var h=function(){function t(t,e){var n=-1;return t.some(function(t,r){return t[0]===e&&(n=r,!0)}),n}return"undefined"!=typeof Map?Map:function(){function e(){this.__entries__=[]}var n={size:{}};return n.size.get=function(){return this.__entries__.length},e.prototype.get=function(e){var n=t(this.__entries__,e),r=this.__entries__[n];return r&&r[1]},e.prototype.set=function(e,n){var r=t(this.__entries__,e);~r?this.__entries__[r][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,r=t(n,e);~r&&n.splice(r,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,r=this.__entries__;n<r.length;n+=1){var i=r[n];t.call(e,i[1],i[0])}},Object.defineProperties(e.prototype,n),e}()}(),d="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,p=function(){return"function"==typeof requestAnimationFrame?requestAnimationFrame:function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),v=2,b=function(t,e){function n(){o&&(o=!1,t()),s&&i()}function r(){p(n)}function i(){var t=Date.now();if(o){if(t-c<v)return;s=!0}else o=!0,s=!1,setTimeout(r,e);c=t}var o=!1,s=!1,c=0;return i},y=["top","right","bottom","left","width","height","size","weight"],m="undefined"!=typeof navigator&&/Trident\/.*rv:11/.test(navigator.userAgent),g="undefined"!=typeof MutationObserver&&!m,E=function(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=b(this.refresh.bind(this),20)};E.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},E.prototype.removeObserver=function(t){var e=this.observers_,n=e.indexOf(t);~n&&e.splice(n,1),!e.length&&this.connected_&&this.disconnect_()},E.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},E.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},E.prototype.connect_=function(){d&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),g?(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)},E.prototype.disconnect_=function(){d&&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)},E.prototype.onTransitionEnd_=function(t){var e=t.propertyName;y.some(function(t){return!!~e.indexOf(t)})&&this.refresh()},E.getInstance=function(){return this.instance_||(this.instance_=new E),this.instance_},E.instance_=null;var O=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n+=1){var i=r[n];Object.defineProperty(t,i,{value:e[i],enumerable:!1,writable:!1,configurable:!0})}return t},_=f(0,0,0,0),x=function(){return"undefined"!=typeof SVGGraphicsElement?function(t){return t instanceof SVGGraphicsElement}:function(t){return t instanceof SVGElement&&"function"==typeof t.getBBox}}(),w=function(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=f(0,0,0,0),this.target=t};w.prototype.isActive=function(){var t=u(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},w.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t};var S=function(t,e){var n=l(e);O(this,{target:t,contentRect:n})},A=function(t,e,n){if("function"!=typeof t)throw new TypeError("The callback provided as parameter 1 is not a function.");this.activeObservations_=[],this.observations_=new h,this.callback_=t,this.controller_=e,this.callbackCtx_=n};A.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 Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new w(t)),this.controller_.addObserver(this),this.controller_.refresh())}},A.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 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))}},A.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},A.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(e){e.isActive()&&t.activeObservations_.push(e)})},A.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map(function(t){return new S(t.target,t.broadcastRect())});this.callback_.call(t,e,t),this.clearActive()}},A.prototype.clearActive=function(){this.activeObservations_.splice(0)},A.prototype.hasActive=function(){return this.activeObservations_.length>0};var k="undefined"!=typeof WeakMap?new WeakMap:new h,j=function(t){if(!(this instanceof j))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=E.getInstance(),n=new A(t,e,this);k.set(this,n)};["observe","unobserve","disconnect"].forEach(function(t){j.prototype[t]=function(){return(e=k.get(this))[t].apply(e,arguments);var e}});var M=function(){return"undefined"!=typeof ResizeObserver?ResizeObserver:j}();e.default=M},function(t,e){},function(t,e,n){"use strict";function r(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
var i=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,c,a=r(t),u=1;u<arguments.length;u++){n=Object(arguments[u]);for(var l in n)o.call(n,l)&&(a[l]=n[l]);if(i){c=i(n);for(var f=0;f<c.length;f++)s.call(n,c[f])&&(a[c[f]]=n[c[f]])}}return a}}]).default});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.SimpleBar=e()}(this,function(){"use strict";var t=function(t){return"object"==typeof t?null!==t:"function"==typeof t},e=function(e){if(!t(e))throw TypeError(e+" is not an object!");return e},n=function(t){try{return!!t()}catch(t){return!0}},i=!n(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(t,e){return t(e={exports:{}},e.exports),e.exports}var s=o(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)}),c=s.document,a=t(c)&&t(c.createElement),l=function(t){return a?c.createElement(t):{}},u=!i&&!n(function(){return 7!=Object.defineProperty(l("div"),"a",{get:function(){return 7}}).a}),h=Object.defineProperty,f={f:i?Object.defineProperty:function(n,i,r){if(e(n),i=function(e,n){if(!t(e))return e;var i,r;if(n&&"function"==typeof(i=e.toString)&&!t(r=i.call(e)))return r;if("function"==typeof(i=e.valueOf)&&!t(r=i.call(e)))return r;if(!n&&"function"==typeof(i=e.toString)&&!t(r=i.call(e)))return r;throw TypeError("Can't convert object to primitive value")}(i,!0),e(r),u)try{return h(n,i,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(n[i]=r.value),n}},d=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},p=i?function(t,e,n){return f.f(t,e,d(1,n))}:function(t,e,n){return t[e]=n,t},v={}.hasOwnProperty,b=function(t,e){return v.call(t,e)},y=0,m=Math.random(),g=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++y+m).toString(36))},E=o(function(t){var e=t.exports={version:"2.5.6"};"number"==typeof __e&&(__e=e)}),S=(E.version,o(function(t){var e=g("src"),n=Function.toString,i=(""+n).split("toString");E.inspectSource=function(t){return n.call(t)},(t.exports=function(t,n,r,o){var c="function"==typeof r;c&&(b(r,"name")||p(r,"name",n)),t[n]!==r&&(c&&(b(r,e)||p(r,e,t[n]?""+t[n]:i.join(String(n)))),t===s?t[n]=r:o?t[n]?t[n]=r:p(t,n,r):(delete t[n],p(t,n,r)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[e]||n.call(this)})})),_=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t},w=o(function(t){var e=s["__core-js_shared__"]||(s["__core-js_shared__"]={});(t.exports=function(t,n){return e[t]||(e[t]=void 0!==n?n:{})})("versions",[]).push({version:E.version,mode:"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})}),O=o(function(t){var e=w("wks"),n=s.Symbol,i="function"==typeof n;(t.exports=function(t){return e[t]||(e[t]=i&&n[t]||(i?n:g)("Symbol."+t))}).store=e}),k=function(t,e,i){var r=O(t),o=i(_,r,""[t]),s=o[0],c=o[1];n(function(){var e={};return e[r]=function(){return 7},7!=""[t](e)})&&(S(String.prototype,t,s),p(RegExp.prototype,r,2==e?function(t,e){return c.call(t,this,e)}:function(t){return c.call(t,this)}))};k("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 x=f.f,L=Function.prototype,M=/^\s*function ([^ (]*)/;"name"in L||i&&x(L,"name",{configurable:!0,get:function(){try{return(""+this).match(M)[1]}catch(t){return""}}}),k("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 A=O("unscopables"),T=Array.prototype;void 0==T[A]&&p(T,A,{});var z=function(t){T[A][t]=!0},C=function(t,e){return{value:e,done:!!t}},j={},D={}.toString,Y=function(t){return D.call(t).slice(8,-1)},N=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==Y(t)?t.split(""):Object(t)},X=function(t){return N(_(t))},R=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)}},W=function(t,e,n){var i,r,o,c,a=t&W.F,l=t&W.G,u=t&W.S,h=t&W.P,f=t&W.B,d=l?s:u?s[e]||(s[e]={}):(s[e]||{}).prototype,v=l?E:E[e]||(E[e]={}),b=v.prototype||(v.prototype={});for(i in l&&(n=e),n)o=((r=!a&&d&&void 0!==d[i])?d:n)[i],c=f&&r?R(o,s):h&&"function"==typeof o?R(Function.call,o):o,d&&S(d,i,o,t&W.U),v[i]!=o&&p(v,i,c),h&&b[i]!=o&&(b[i]=o)};s.core=E,W.F=1,W.G=2,W.S=4,W.P=8,W.B=16,W.W=32,W.U=64,W.R=128;var P,B=W,V=Math.ceil,F=Math.floor,q=function(t){return isNaN(t=+t)?0:(t>0?F:V)(t)},H=Math.min,G=function(t){return t>0?H(q(t),9007199254740991):0},I=Math.max,U=Math.min,$=w("keys"),J=function(t){return $[t]||($[t]=g(t))},K=(P=!1,function(t,e,n){var i,r=X(t),o=G(r.length),s=function(t,e){return(t=q(t))<0?I(t+e,0):U(t,e)}(n,o);if(P&&e!=e){for(;o>s;)if((i=r[s++])!=i)return!0}else for(;o>s;s++)if((P||s in r)&&r[s]===e)return P||s||0;return!P&&-1}),Q=J("IE_PROTO"),Z="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),tt=Object.keys||function(t){return function(t,e){var n,i=X(t),r=0,o=[];for(n in i)n!=Q&&b(i,n)&&o.push(n);for(;e.length>r;)b(i,n=e[r++])&&(~K(o,n)||o.push(n));return o}(t,Z)},et=i?Object.defineProperties:function(t,n){e(t);for(var i,r=tt(n),o=r.length,s=0;o>s;)f.f(t,i=r[s++],n[i]);return t},nt=s.document,it=nt&&nt.documentElement,rt=J("IE_PROTO"),ot=function(){},st=function(){var t,e=l("iframe"),n=Z.length;for(e.style.display="none",it.appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),st=t.F;n--;)delete st.prototype[Z[n]];return st()},ct=Object.create||function(t,n){var i;return null!==t?(ot.prototype=e(t),i=new ot,ot.prototype=null,i[rt]=t):i=st(),void 0===n?i:et(i,n)},at=f.f,lt=O("toStringTag"),ut=function(t,e,n){t&&!b(t=n?t:t.prototype,lt)&&at(t,lt,{configurable:!0,value:e})},ht={};p(ht,O("iterator"),function(){return this});var ft=function(t,e,n){t.prototype=ct(ht,{next:d(1,n)}),ut(t,e+" Iterator")},dt=function(t){return Object(_(t))},pt=J("IE_PROTO"),vt=Object.prototype,bt=Object.getPrototypeOf||function(t){return t=dt(t),b(t,pt)?t[pt]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?vt:null},yt=O("iterator"),mt=!([].keys&&"next"in[].keys()),gt=function(){return this},Et=function(t,e,n,i,r,o,s){ft(n,e,i);var c,a,l,u=function(t){if(!mt&&t in v)return v[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,v=t.prototype,b=v[yt]||v["@@iterator"]||r&&v[r],y=b||u(r),m=r?f?u("entries"):y:void 0,g="Array"==e&&v.entries||b;if(g&&(l=bt(g.call(new t)))!==Object.prototype&&l.next&&(ut(l,h,!0),"function"!=typeof l[yt]&&p(l,yt,gt)),f&&b&&"values"!==b.name&&(d=!0,y=function(){return b.call(this)}),(mt||d||!v[yt])&&p(v,yt,y),j[e]=y,j[h]=gt,r)if(c={values:f?y:u("values"),keys:o?y:u("keys"),entries:m},s)for(a in c)a in v||S(v,a,c[a]);else B(B.P+B.F*(mt||d),e,c);return c}(Array,"Array",function(t,e){this._t=X(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,C(1)):C(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values");j.Arguments=j.Array,z("keys"),z("values"),z("entries");for(var St=O("iterator"),_t=O("toStringTag"),wt=j.Array,Ot={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},kt=tt(Ot),xt=0;xt<kt.length;xt++){var Lt,Mt=kt[xt],At=Ot[Mt],Tt=s[Mt],zt=Tt&&Tt.prototype;if(zt&&(zt[St]||p(zt,St,wt),zt[_t]||p(zt,_t,Mt),j[Mt]=wt,At))for(Lt in Et)zt[Lt]||S(zt,Lt,Et[Lt],!0)}var Ct=function(t,n,i,r){try{return r?n(e(i)[0],i[1]):n(i)}catch(n){var o=t.return;throw void 0!==o&&e(o.call(t)),n}},jt=O("iterator"),Dt=Array.prototype,Yt=function(t,e,n){e in t?f.f(t,e,d(0,n)):t[e]=n},Nt=O("toStringTag"),Xt="Arguments"==Y(function(){return arguments}()),Rt=O("iterator"),Wt=E.getIteratorMethod=function(t){if(void 0!=t)return t[Rt]||t["@@iterator"]||j[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),Nt))?n:Xt?Y(e):"Object"==(i=Y(e))&&"function"==typeof e.callee?"Arguments":i}(t)]},Pt=O("iterator"),Bt=!1;try{[7][Pt]().return=function(){Bt=!0}}catch(t){}B(B.S+B.F*!function(t,e){if(!e&&!Bt)return!1;var n=!1;try{var i=[7],r=i[Pt]();r.next=function(){return{done:n=!0}},i[Pt]=function(){return r},t(i)}catch(t){}return n}(function(t){}),"Array",{from:function(t){var e,n,i,r,o,s=dt(t),c="function"==typeof this?this:Array,a=arguments.length,l=a>1?arguments[1]:void 0,u=void 0!==l,h=0,f=Wt(s);if(u&&(l=R(l,a>2?arguments[2]:void 0,2)),void 0!=f&&(c!=Array||(void 0===(o=f)||j.Array!==o&&Dt[jt]!==o)))for(r=f.call(s),n=new c;!(i=r.next()).done;h++)Yt(n,h,u?Ct(r,l,[i.value,h],!0):i.value);else for(n=new c(e=G(s.length));e>h;h++)Yt(n,h,u?l(s[h],h):s[h]);return n.length=h,n}});var Vt={f:Object.getOwnPropertySymbols},Ft={f:{}.propertyIsEnumerable},qt=Object.assign,Ht=!qt||n(function(){var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach(function(t){e[t]=t}),7!=qt({},t)[n]||Object.keys(qt({},e)).join("")!=i})?function(t,e){for(var n=dt(t),i=arguments.length,r=1,o=Vt.f,s=Ft.f;i>r;)for(var c,a=N(arguments[r++]),l=o?tt(a).concat(o(a)):tt(a),u=l.length,h=0;u>h;)s.call(a,c=l[h++])&&(n[c]=a[c]);return n}:qt;function Gt(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)}}B(B.S+B.F,"Object",{assign:Ht});var It=o(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}}),Ut="Expected a function",$t=NaN,Jt="[object Symbol]",Kt=/^\s+|\s+$/g,Qt=/^[-+]0x[0-9a-f]+$/i,Zt=/^0b[01]+$/i,te=/^0o[0-7]+$/i,ee=parseInt,ne="object"==typeof r&&r&&r.Object===Object&&r,ie="object"==typeof self&&self&&self.Object===Object&&self,re=ne||ie||Function("return this")(),oe=Object.prototype.toString,se=Math.max,ce=Math.min,ae=function(){return re.Date.now()};function le(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(Ut);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=ae();if(p(t))return b(t);c=setTimeout(v,function(t){var n=e-(t-a);return h?ce(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=ae(),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=he(e)||0,ue(n)&&(u=!!n.leading,o=(h="maxWait"in n)?se(he(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(ae())},y}function ue(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function he(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&oe.call(t)==Jt}(t))return $t;if(ue(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ue(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Kt,"");var n=Zt.test(t);return n||te.test(t)?ee(t.slice(2),n?2:8):Qt.test(t)?$t:+t}var fe=function(t,e,n){var i=!0,r=!0;if("function"!=typeof t)throw new TypeError(Ut);return ue(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),le(t,e,{leading:i,maxWait:e,trailing:r})},de=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}()}(),pe="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,ve="undefined"!=typeof global&&global.Math===Math?global:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),be="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(ve):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)},ye=2,me=["top","right","bottom","left","width","height","size","weight"],ge="undefined"!=typeof MutationObserver,Ee=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(){be(o)}function c(){var t=Date.now();if(n){if(t-r<ye)return;i=!0}else n=!0,i=!1,setTimeout(s,e);r=t}return c}(this.refresh.bind(this),20)};Ee.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},Ee.prototype.removeObserver=function(t){var e=this.observers_,n=e.indexOf(t);~n&&e.splice(n,1),!e.length&&this.connected_&&this.disconnect_()},Ee.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},Ee.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},Ee.prototype.connect_=function(){pe&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ge?(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)},Ee.prototype.disconnect_=function(){pe&&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)},Ee.prototype.onTransitionEnd_=function(t){var e=t.propertyName;void 0===e&&(e=""),me.some(function(t){return!!~e.indexOf(t)})&&this.refresh()},Ee.getInstance=function(){return this.instance_||(this.instance_=new Ee),this.instance_},Ee.instance_=null;var Se=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},_e=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||ve},we=Ae(0,0,0,0);function Oe(t){return parseFloat(t)||0}function ke(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];return e.reduce(function(e,n){return e+Oe(t["border-"+n+"-width"])},0)}function xe(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return we;var i=_e(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]=Oe(o)}return e}(i),o=r.left+r.right,s=r.top+r.bottom,c=Oe(i.width),a=Oe(i.height);if("border-box"===i.boxSizing&&(Math.round(c+o)!==e&&(c-=ke(i,"left","right")+o),Math.round(a+s)!==n&&(a-=ke(i,"top","bottom")+s)),!function(t){return t===_e(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 Ae(r.left,r.top,c,a)}var Le="undefined"!=typeof SVGGraphicsElement?function(t){return t instanceof _e(t).SVGGraphicsElement}:function(t){return t instanceof _e(t).SVGElement&&"function"==typeof t.getBBox};function Me(t){return pe?Le(t)?function(t){var e=t.getBBox();return Ae(0,0,e.width,e.height)}(t):xe(t):we}function Ae(t,e,n,i){return{x:t,y:e,width:n,height:i}}var Te=function(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Ae(0,0,0,0),this.target=t};Te.prototype.isActive=function(){var t=Me(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},Te.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t};var ze=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),Se(a,{x:i,y:r,width:o,height:s,top:r,right:i+o,bottom:s+r,left:i}),a);Se(this,{target:t,contentRect:l})},Ce=function(t,e,n){if(this.activeObservations_=[],this.observations_=new de,"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};Ce.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 _e(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new Te(t)),this.controller_.addObserver(this),this.controller_.refresh())}},Ce.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 _e(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))}},Ce.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},Ce.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(e){e.isActive()&&t.activeObservations_.push(e)})},Ce.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map(function(t){return new ze(t.target,t.broadcastRect())});this.callback_.call(t,e,t),this.clearActive()}},Ce.prototype.clearActive=function(){this.activeObservations_.splice(0)},Ce.prototype.hasActive=function(){return this.activeObservations_.length>0};var je="undefined"!=typeof WeakMap?new WeakMap:new de,De=function(t){if(!(this instanceof De))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=Ee.getInstance(),n=new Ce(t,e,this);je.set(this,n)};["observe","unobserve","disconnect"].forEach(function(t){De.prototype[t]=function(){return(e=je.get(this))[t].apply(e,arguments);var e}});var Ye=void 0!==ve.ResizeObserver?ve.ResizeObserver:De,Ne=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=fe(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.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),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 Ye(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=It(),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))}}])&&Gt(e.prototype,n),i&&Gt(e,i),t}();return Ne.initHtmlApi(),Ne});
{
"version": "3.0.0-beta.0",
"name": "simplebar",

@@ -8,66 +9,31 @@ "title": "SimpleBar.js",

],
"author": "Adrien Grsmto from a fork by Jonathan Nicol",
"repository": {
"type": "git",
"url": "http://github.com/grsmto/simplebar.git"
},
"author": "Adrien Denat from a fork by Jonathan Nicol",
"repository": "grsmto/simplebar",
"main": "dist/simplebar.js",
"module": "src/simplebar.js",
"module": "dist/simplebar.esm.js",
"style": "dist/simplebar.min.css",
"homepage": "https://grsmto.github.io/simplebar/",
"bugs": "https://github.com/grsmto/simplebar/issues",
"version": "2.6.1",
"license": "MIT",
"scripts": {
"start": "webpack-dev-server --inline",
"start:prod": "NODE_ENV=production webpack-dev-server",
"build": "NODE_ENV=production webpack",
"test": "jest"
"start": "webpack-dev-server --mode=development",
"build": "rollup -c && cp src/simplebar.css dist/simplebar.css && minify dist/simplebar.css > dist/simplebar.min.css",
"build:demo": "webpack --mode=production",
"dev": "rollup -c -w",
"test": "yarn run test:unit && yarn run test:e2e",
"test:unit": "jest -c jest-unit.config.js",
"test:e2e": "jest -c jest-e2e.config.js"
},
"license": "MIT",
"engines": {
"node": ">=0.11.0"
},
"dependencies": {
"lodash.debounce": "^4.0.8",
"object-assign": "^4.1.1",
"resize-observer-polyfill": "^1.4.2",
"lodash.throttle": "^4.1.1",
"resize-observer-polyfill": "^1.5.0",
"scrollbarwidth": "^0.1.3"
},
"devDependencies": {
"@babel/core": "^7.0.0-beta.40",
"@babel/preset-env": "7.0.0-beta.40",
"autoprefixer": "^7.1.6",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^22.4.1",
"babel-loader": "8.0.0-beta.0",
"babel-plugin-transform-runtime": "^6.15.0",
"css-loader": "^0.28.7",
"eslint": "^3.5.0",
"extract-text-webpack-plugin": "^3.0.2",
"jest": "^20.0.4",
"jest-cli": "^22.4.2",
"normalize.css": "^6.0.0",
"postcss-loader": "^2.0.8",
"regenerator-runtime": "^0.11.1",
"style-loader": "^0.19.0",
"webpack": "^3.8.1",
"webpack-dev-server": "^2.9.3"
},
"browserslist": [
"> 1%",
"last 2 versions"
],
"jest": {
"transform": {
"^.+\\.js?$": "babel-jest"
},
"transformIgnorePatterns": [
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs)$"
],
"moduleFileExtensions": [
"js"
],
"moduleNameMapper": {
"\\.(css)$": "<rootDir>/jest/cssTransform.js"
}
"babel-plugin-transform-object-assign": "^6.22.0",
"css-loader": "^0.28.11",
"minify": "^3.0.5",
"react-select": "^1.2.1",
"style-loader": "^0.21.0"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc