import * as e from "react";
import { b as t, e as i } from "./lodash-226cb5b1.js";
import { lR as s, lA as l } from "./ant-design-icons-a81e6d18.js";
var r = function() {
  return r = Object.assign || function(e2) {
    for (var t2, i2 = 1, s2 = arguments.length; i2 < s2; i2++)
      for (var l2 in t2 = arguments[i2])
        Object.prototype.hasOwnProperty.call(t2, l2) && (e2[l2] = t2[l2]);
    return e2;
  }, r.apply(this, arguments);
};
function o(e2) {
  return e2 && e2.ownerDocument && e2.ownerDocument.defaultView ? e2.ownerDocument.defaultView : window;
}
function n(e2) {
  return e2 && e2.ownerDocument ? e2.ownerDocument : document;
}
var a = function(e2) {
  return Array.prototype.reduce.call(e2, function(e3, t2) {
    var i2 = t2.name.match(/data-simplebar-(.+)/);
    if (i2) {
      var s2 = i2[1].replace(/\W+(.)/g, function(e4, t3) {
        return t3.toUpperCase();
      });
      switch (t2.value) {
        case "true":
          e3[s2] = true;
          break;
        case "false":
          e3[s2] = false;
          break;
        case void 0:
          e3[s2] = true;
          break;
        default:
          e3[s2] = t2.value;
      }
    }
    return e3;
  }, {});
};
function c(e2, t2) {
  var i2;
  e2 && (i2 = e2.classList).add.apply(i2, t2.split(" "));
}
function h(e2, t2) {
  e2 && t2.split(" ").forEach(function(t3) {
    e2.classList.remove(t3);
  });
}
function d(e2) {
  return ".".concat(e2.split(" ").join("."));
}
var u = !("undefined" == typeof window || !window.document || !window.document.createElement), p = Object.freeze({ __proto__: null, addClasses: c, canUseDOM: u, classNamesToQuery: d, getElementDocument: n, getElementWindow: o, getOptions: a, removeClasses: h }), v = null, f = null;
function g() {
  if (null === v) {
    if ("undefined" == typeof document)
      return v = 0;
    var e2 = document.body, t2 = document.createElement("div");
    t2.classList.add("simplebar-hide-scrollbar"), e2.appendChild(t2);
    var i2 = t2.getBoundingClientRect().right;
    e2.removeChild(t2), v = i2;
  }
  return v;
}
u && window.addEventListener("resize", function() {
  f !== window.devicePixelRatio && (f = window.devicePixelRatio, v = null);
});
var b = o, m = n, x = a, y = c, E = h, S = d, O = function() {
  function e2(s2, l2) {
    void 0 === l2 && (l2 = {});
    var o2 = this;
    if (this.removePreventClickId = null, this.minScrollbarWidth = 20, this.stopScrollDelay = 175, this.isScrolling = false, this.isMouseEntering = false, this.isDragging = false, this.scrollXTicking = false, this.scrollYTicking = false, this.wrapperEl = null, this.contentWrapperEl = null, this.contentEl = null, this.offsetEl = null, this.maskEl = null, this.placeholderEl = null, this.heightAutoObserverWrapperEl = null, this.heightAutoObserverEl = null, this.rtlHelpers = null, this.scrollbarWidth = 0, this.resizeObserver = null, this.mutationObserver = null, this.elStyles = null, this.isRtl = null, this.mouseX = 0, this.mouseY = 0, this.onMouseMove = function() {
    }, this.onWindowResize = function() {
    }, this.onStopScrolling = function() {
    }, this.onMouseEntered = function() {
    }, this.onScroll = function() {
      var e3 = b(o2.el);
      o2.scrollXTicking || (e3.requestAnimationFrame(o2.scrollX), o2.scrollXTicking = true), o2.scrollYTicking || (e3.requestAnimationFrame(o2.scrollY), o2.scrollYTicking = true), o2.isScrolling || (o2.isScrolling = true, y(o2.el, o2.classNames.scrolling)), o2.showScrollbar("x"), o2.showScrollbar("y"), o2.onStopScrolling();
    }, this.scrollX = function() {
      o2.axis.x.isOverflowing && o2.positionScrollbar("x"), o2.scrollXTicking = false;
    }, this.scrollY = function() {
      o2.axis.y.isOverflowing && o2.positionScrollbar("y"), o2.scrollYTicking = false;
    }, this._onStopScrolling = function() {
      E(o2.el, o2.classNames.scrolling), o2.options.autoHide && (o2.hideScrollbar("x"), o2.hideScrollbar("y")), o2.isScrolling = false;
    }, this.onMouseEnter = function() {
      o2.isMouseEntering || (y(o2.el, o2.classNames.mouseEntered), o2.showScrollbar("x"), o2.showScrollbar("y"), o2.isMouseEntering = true), o2.onMouseEntered();
    }, this._onMouseEntered = function() {
      E(o2.el, o2.classNames.mouseEntered), o2.options.autoHide && (o2.hideScrollbar("x"), o2.hideScrollbar("y")), o2.isMouseEntering = false;
    }, this._onMouseMove = function(e3) {
      o2.mouseX = e3.clientX, o2.mouseY = e3.clientY, (o2.axis.x.isOverflowing || o2.axis.x.forceVisible) && o2.onMouseMoveForAxis("x"), (o2.axis.y.isOverflowing || o2.axis.y.forceVisible) && o2.onMouseMoveForAxis("y");
    }, this.onMouseLeave = function() {
      o2.onMouseMove.cancel(), (o2.axis.x.isOverflowing || o2.axis.x.forceVisible) && o2.onMouseLeaveForAxis("x"), (o2.axis.y.isOverflowing || o2.axis.y.forceVisible) && o2.onMouseLeaveForAxis("y"), o2.mouseX = -1, o2.mouseY = -1;
    }, this._onWindowResize = function() {
      o2.scrollbarWidth = o2.getScrollbarWidth(), o2.hideNativeScrollbar();
    }, this.onPointerEvent = function(e3) {
      var t2, i2;
      o2.axis.x.track.el && o2.axis.y.track.el && o2.axis.x.scrollbar.el && o2.axis.y.scrollbar.el && (o2.axis.x.track.rect = o2.axis.x.track.el.getBoundingClientRect(), o2.axis.y.track.rect = o2.axis.y.track.el.getBoundingClientRect(), (o2.axis.x.isOverflowing || o2.axis.x.forceVisible) && (t2 = o2.isWithinBounds(o2.axis.x.track.rect)), (o2.axis.y.isOverflowing || o2.axis.y.forceVisible) && (i2 = o2.isWithinBounds(o2.axis.y.track.rect)), (t2 || i2) && (e3.stopPropagation(), "pointerdown" === e3.type && "touch" !== e3.pointerType && (t2 && (o2.axis.x.scrollbar.rect = o2.axis.x.scrollbar.el.getBoundingClientRect(), o2.isWithinBounds(o2.axis.x.scrollbar.rect) ? o2.onDragStart(e3, "x") : o2.onTrackClick(e3, "x")), i2 && (o2.axis.y.scrollbar.rect = o2.axis.y.scrollbar.el.getBoundingClientRect(), o2.isWithinBounds(o2.axis.y.scrollbar.rect) ? o2.onDragStart(e3, "y") : o2.onTrackClick(e3, "y")))));
    }, this.drag = function(t2) {
      var i2, s3, l3, r2, n2, a2, c2, h2, d2, u2, p2;
      if (o2.draggedAxis && o2.contentWrapperEl) {
        var v2 = o2.axis[o2.draggedAxis].track, f2 = null !== (s3 = null === (i2 = v2.rect) || void 0 === i2 ? void 0 : i2[o2.axis[o2.draggedAxis].sizeAttr]) && void 0 !== s3 ? s3 : 0, g2 = o2.axis[o2.draggedAxis].scrollbar, b2 = null !== (r2 = null === (l3 = o2.contentWrapperEl) || void 0 === l3 ? void 0 : l3[o2.axis[o2.draggedAxis].scrollSizeAttr]) && void 0 !== r2 ? r2 : 0, m2 = parseInt(null !== (a2 = null === (n2 = o2.elStyles) || void 0 === n2 ? void 0 : n2[o2.axis[o2.draggedAxis].sizeAttr]) && void 0 !== a2 ? a2 : "0px", 10);
        t2.preventDefault(), t2.stopPropagation();
        var x2 = ("y" === o2.draggedAxis ? t2.pageY : t2.pageX) - (null !== (h2 = null === (c2 = v2.rect) || void 0 === c2 ? void 0 : c2[o2.axis[o2.draggedAxis].offsetAttr]) && void 0 !== h2 ? h2 : 0) - o2.axis[o2.draggedAxis].dragOffset, y2 = (x2 = "x" === o2.draggedAxis && o2.isRtl ? (null !== (u2 = null === (d2 = v2.rect) || void 0 === d2 ? void 0 : d2[o2.axis[o2.draggedAxis].sizeAttr]) && void 0 !== u2 ? u2 : 0) - g2.size - x2 : x2) / (f2 - g2.size) * (b2 - m2);
        "x" === o2.draggedAxis && o2.isRtl && (y2 = (null === (p2 = e2.getRtlHelpers()) || void 0 === p2 ? void 0 : p2.isScrollingToNegative) ? -y2 : y2), o2.contentWrapperEl[o2.axis[o2.draggedAxis].scrollOffsetAttr] = y2;
      }
    }, this.onEndDrag = function(e3) {
      o2.isDragging = false;
      var t2 = m(o2.el), i2 = b(o2.el);
      e3.preventDefault(), e3.stopPropagation(), E(o2.el, o2.classNames.dragging), o2.onStopScrolling(), t2.removeEventListener("mousemove", o2.drag, true), t2.removeEventListener("mouseup", o2.onEndDrag, true), o2.removePreventClickId = i2.setTimeout(function() {
        t2.removeEventListener("click", o2.preventClick, true), t2.removeEventListener("dblclick", o2.preventClick, true), o2.removePreventClickId = null;
      });
    }, this.preventClick = function(e3) {
      e3.preventDefault(), e3.stopPropagation();
    }, this.el = s2, this.options = r(r({}, e2.defaultOptions), l2), this.classNames = r(r({}, e2.defaultOptions.classNames), l2.classNames), this.axis = { x: { scrollOffsetAttr: "scrollLeft", sizeAttr: "width", scrollSizeAttr: "scrollWidth", offsetSizeAttr: "offsetWidth", offsetAttr: "left", overflowAttr: "overflowX", dragOffset: 0, isOverflowing: true, forceVisible: false, track: { size: null, el: null, rect: null, isVisible: false }, scrollbar: { size: null, el: null, rect: null, isVisible: false } }, y: { scrollOffsetAttr: "scrollTop", sizeAttr: "height", scrollSizeAttr: "scrollHeight", offsetSizeAttr: "offsetHeight", offsetAttr: "top", overflowAttr: "overflowY", dragOffset: 0, isOverflowing: true, forceVisible: false, track: { size: null, el: null, rect: null, isVisible: false }, scrollbar: { size: null, el: null, rect: null, isVisible: false } } }, "object" != typeof this.el || !this.el.nodeName)
      throw new Error("Argument passed to SimpleBar must be an HTML element instead of ".concat(this.el));
    this.onMouseMove = t(this._onMouseMove, 64), this.onWindowResize = i(this._onWindowResize, 64, { leading: true }), this.onStopScrolling = i(this._onStopScrolling, this.stopScrollDelay), this.onMouseEntered = i(this._onMouseEntered, this.stopScrollDelay), this.init();
  }
  return e2.getRtlHelpers = function() {
    if (e2.rtlHelpers)
      return e2.rtlHelpers;
    var t2 = document.createElement("div");
    t2.innerHTML = '<div class="simplebar-dummy-scrollbar-size"><div></div></div>';
    var i2 = t2.firstElementChild, s2 = null == i2 ? void 0 : i2.firstElementChild;
    if (!s2)
      return null;
    document.body.appendChild(i2), i2.scrollLeft = 0;
    var l2 = e2.getOffset(i2), r2 = e2.getOffset(s2);
    i2.scrollLeft = -999;
    var o2 = e2.getOffset(s2);
    return document.body.removeChild(i2), e2.rtlHelpers = { isScrollOriginAtZero: l2.left !== r2.left, isScrollingToNegative: r2.left !== o2.left }, e2.rtlHelpers;
  }, e2.prototype.getScrollbarWidth = function() {
    try {
      return this.contentWrapperEl && "none" === getComputedStyle(this.contentWrapperEl, "::-webkit-scrollbar").display || "scrollbarWidth" in document.documentElement.style || "-ms-overflow-style" in document.documentElement.style ? 0 : g();
    } catch (e3) {
      return g();
    }
  }, e2.getOffset = function(e3) {
    var t2 = e3.getBoundingClientRect(), i2 = m(e3), s2 = b(e3);
    return { top: t2.top + (s2.pageYOffset || i2.documentElement.scrollTop), left: t2.left + (s2.pageXOffset || i2.documentElement.scrollLeft) };
  }, e2.prototype.init = function() {
    u && (this.initDOM(), this.rtlHelpers = e2.getRtlHelpers(), this.scrollbarWidth = this.getScrollbarWidth(), this.recalculate(), this.initListeners());
  }, e2.prototype.initDOM = function() {
    var e3, t2;
    this.wrapperEl = this.el.querySelector(S(this.classNames.wrapper)), this.contentWrapperEl = this.options.scrollableNode || this.el.querySelector(S(this.classNames.contentWrapper)), this.contentEl = this.options.contentNode || this.el.querySelector(S(this.classNames.contentEl)), this.offsetEl = this.el.querySelector(S(this.classNames.offset)), this.maskEl = this.el.querySelector(S(this.classNames.mask)), this.placeholderEl = this.findChild(this.wrapperEl, S(this.classNames.placeholder)), this.heightAutoObserverWrapperEl = this.el.querySelector(S(this.classNames.heightAutoObserverWrapperEl)), this.heightAutoObserverEl = this.el.querySelector(S(this.classNames.heightAutoObserverEl)), this.axis.x.track.el = this.findChild(this.el, "".concat(S(this.classNames.track)).concat(S(this.classNames.horizontal))), this.axis.y.track.el = this.findChild(this.el, "".concat(S(this.classNames.track)).concat(S(this.classNames.vertical))), this.axis.x.scrollbar.el = (null === (e3 = this.axis.x.track.el) || void 0 === e3 ? void 0 : e3.querySelector(S(this.classNames.scrollbar))) || null, this.axis.y.scrollbar.el = (null === (t2 = this.axis.y.track.el) || void 0 === t2 ? void 0 : t2.querySelector(S(this.classNames.scrollbar))) || null, this.options.autoHide || (y(this.axis.x.scrollbar.el, this.classNames.visible), y(this.axis.y.scrollbar.el, this.classNames.visible));
  }, e2.prototype.initListeners = function() {
    var e3, t2 = this, i2 = b(this.el);
    if (this.el.addEventListener("mouseenter", this.onMouseEnter), this.el.addEventListener("pointerdown", this.onPointerEvent, true), this.el.addEventListener("mousemove", this.onMouseMove), this.el.addEventListener("mouseleave", this.onMouseLeave), null === (e3 = this.contentWrapperEl) || void 0 === e3 || e3.addEventListener("scroll", this.onScroll), i2.addEventListener("resize", this.onWindowResize), this.contentEl) {
      if (window.ResizeObserver) {
        var s2 = false, l2 = i2.ResizeObserver || ResizeObserver;
        this.resizeObserver = new l2(function() {
          s2 && i2.requestAnimationFrame(function() {
            t2.recalculate();
          });
        }), this.resizeObserver.observe(this.el), this.resizeObserver.observe(this.contentEl), i2.requestAnimationFrame(function() {
          s2 = true;
        });
      }
      this.mutationObserver = new i2.MutationObserver(function() {
        i2.requestAnimationFrame(function() {
          t2.recalculate();
        });
      }), this.mutationObserver.observe(this.contentEl, { childList: true, subtree: true, characterData: true });
    }
  }, e2.prototype.recalculate = function() {
    if (this.heightAutoObserverEl && this.contentEl && this.contentWrapperEl && this.wrapperEl && this.placeholderEl) {
      var e3 = b(this.el);
      this.elStyles = e3.getComputedStyle(this.el), this.isRtl = "rtl" === this.elStyles.direction;
      var t2 = this.contentEl.offsetWidth, i2 = this.heightAutoObserverEl.offsetHeight <= 1, s2 = this.heightAutoObserverEl.offsetWidth <= 1 || t2 > 0, l2 = this.contentWrapperEl.offsetWidth, r2 = this.elStyles.overflowX, o2 = this.elStyles.overflowY;
      this.contentEl.style.padding = "".concat(this.elStyles.paddingTop, " ").concat(this.elStyles.paddingRight, " ").concat(this.elStyles.paddingBottom, " ").concat(this.elStyles.paddingLeft), this.wrapperEl.style.margin = "-".concat(this.elStyles.paddingTop, " -").concat(this.elStyles.paddingRight, " -").concat(this.elStyles.paddingBottom, " -").concat(this.elStyles.paddingLeft);
      var n2 = this.contentEl.scrollHeight, a2 = this.contentEl.scrollWidth;
      this.contentWrapperEl.style.height = i2 ? "auto" : "100%", this.placeholderEl.style.width = s2 ? "".concat(t2 || a2, "px") : "auto", this.placeholderEl.style.height = "".concat(n2, "px");
      var c2 = this.contentWrapperEl.offsetHeight;
      this.axis.x.isOverflowing = 0 !== t2 && a2 > t2, this.axis.y.isOverflowing = n2 > c2, this.axis.x.isOverflowing = "hidden" !== r2 && this.axis.x.isOverflowing, this.axis.y.isOverflowing = "hidden" !== o2 && this.axis.y.isOverflowing, this.axis.x.forceVisible = "x" === this.options.forceVisible || true === this.options.forceVisible, this.axis.y.forceVisible = "y" === this.options.forceVisible || true === this.options.forceVisible, this.hideNativeScrollbar();
      var h2 = this.axis.x.isOverflowing ? this.scrollbarWidth : 0, d2 = this.axis.y.isOverflowing ? this.scrollbarWidth : 0;
      this.axis.x.isOverflowing = this.axis.x.isOverflowing && a2 > l2 - d2, this.axis.y.isOverflowing = this.axis.y.isOverflowing && n2 > c2 - h2, this.axis.x.scrollbar.size = this.getScrollbarSize("x"), this.axis.y.scrollbar.size = this.getScrollbarSize("y"), this.axis.x.scrollbar.el && (this.axis.x.scrollbar.el.style.width = "".concat(this.axis.x.scrollbar.size, "px")), this.axis.y.scrollbar.el && (this.axis.y.scrollbar.el.style.height = "".concat(this.axis.y.scrollbar.size, "px")), this.positionScrollbar("x"), this.positionScrollbar("y"), this.toggleTrackVisibility("x"), this.toggleTrackVisibility("y");
    }
  }, e2.prototype.getScrollbarSize = function(e3) {
    var t2, i2;
    if (void 0 === e3 && (e3 = "y"), !this.axis[e3].isOverflowing || !this.contentEl)
      return 0;
    var s2, l2 = this.contentEl[this.axis[e3].scrollSizeAttr], r2 = null !== (i2 = null === (t2 = this.axis[e3].track.el) || void 0 === t2 ? void 0 : t2[this.axis[e3].offsetSizeAttr]) && void 0 !== i2 ? i2 : 0, o2 = r2 / l2;
    return s2 = Math.max(~~(o2 * r2), this.options.scrollbarMinSize), this.options.scrollbarMaxSize && (s2 = Math.min(s2, this.options.scrollbarMaxSize)), s2;
  }, e2.prototype.positionScrollbar = function(t2) {
    var i2, s2, l2;
    void 0 === t2 && (t2 = "y");
    var r2 = this.axis[t2].scrollbar;
    if (this.axis[t2].isOverflowing && this.contentWrapperEl && r2.el && this.elStyles) {
      var o2 = this.contentWrapperEl[this.axis[t2].scrollSizeAttr], n2 = (null === (i2 = this.axis[t2].track.el) || void 0 === i2 ? void 0 : i2[this.axis[t2].offsetSizeAttr]) || 0, a2 = parseInt(this.elStyles[this.axis[t2].sizeAttr], 10), c2 = this.contentWrapperEl[this.axis[t2].scrollOffsetAttr];
      c2 = "x" === t2 && this.isRtl && (null === (s2 = e2.getRtlHelpers()) || void 0 === s2 ? void 0 : s2.isScrollOriginAtZero) ? -c2 : c2, "x" === t2 && this.isRtl && (c2 = (null === (l2 = e2.getRtlHelpers()) || void 0 === l2 ? void 0 : l2.isScrollingToNegative) ? c2 : -c2);
      var h2 = c2 / (o2 - a2), d2 = ~~((n2 - r2.size) * h2);
      d2 = "x" === t2 && this.isRtl ? -d2 + (n2 - r2.size) : d2, r2.el.style.transform = "x" === t2 ? "translate3d(".concat(d2, "px, 0, 0)") : "translate3d(0, ".concat(d2, "px, 0)");
    }
  }, e2.prototype.toggleTrackVisibility = function(e3) {
    void 0 === e3 && (e3 = "y");
    var t2 = this.axis[e3].track.el, i2 = this.axis[e3].scrollbar.el;
    t2 && i2 && this.contentWrapperEl && (this.axis[e3].isOverflowing || this.axis[e3].forceVisible ? (t2.style.visibility = "visible", this.contentWrapperEl.style[this.axis[e3].overflowAttr] = "scroll", this.el.classList.add("".concat(this.classNames.scrollable, "-").concat(e3))) : (t2.style.visibility = "hidden", this.contentWrapperEl.style[this.axis[e3].overflowAttr] = "hidden", this.el.classList.remove("".concat(this.classNames.scrollable, "-").concat(e3))), this.axis[e3].isOverflowing ? i2.style.display = "block" : i2.style.display = "none");
  }, e2.prototype.showScrollbar = function(e3) {
    void 0 === e3 && (e3 = "y"), this.axis[e3].isOverflowing && !this.axis[e3].scrollbar.isVisible && (y(this.axis[e3].scrollbar.el, this.classNames.visible), this.axis[e3].scrollbar.isVisible = true);
  }, e2.prototype.hideScrollbar = function(e3) {
    void 0 === e3 && (e3 = "y"), this.isDragging || this.axis[e3].isOverflowing && this.axis[e3].scrollbar.isVisible && (E(this.axis[e3].scrollbar.el, this.classNames.visible), this.axis[e3].scrollbar.isVisible = false);
  }, e2.prototype.hideNativeScrollbar = function() {
    this.offsetEl && (this.offsetEl.style[this.isRtl ? "left" : "right"] = this.axis.y.isOverflowing || this.axis.y.forceVisible ? "-".concat(this.scrollbarWidth, "px") : "0px", this.offsetEl.style.bottom = this.axis.x.isOverflowing || this.axis.x.forceVisible ? "-".concat(this.scrollbarWidth, "px") : "0px");
  }, e2.prototype.onMouseMoveForAxis = function(e3) {
    void 0 === e3 && (e3 = "y");
    var t2 = this.axis[e3];
    t2.track.el && t2.scrollbar.el && (t2.track.rect = t2.track.el.getBoundingClientRect(), t2.scrollbar.rect = t2.scrollbar.el.getBoundingClientRect(), this.isWithinBounds(t2.track.rect) ? (this.showScrollbar(e3), y(t2.track.el, this.classNames.hover), this.isWithinBounds(t2.scrollbar.rect) ? y(t2.scrollbar.el, this.classNames.hover) : E(t2.scrollbar.el, this.classNames.hover)) : (E(t2.track.el, this.classNames.hover), this.options.autoHide && this.hideScrollbar(e3)));
  }, e2.prototype.onMouseLeaveForAxis = function(e3) {
    void 0 === e3 && (e3 = "y"), E(this.axis[e3].track.el, this.classNames.hover), E(this.axis[e3].scrollbar.el, this.classNames.hover), this.options.autoHide && this.hideScrollbar(e3);
  }, e2.prototype.onDragStart = function(e3, t2) {
    var i2;
    void 0 === t2 && (t2 = "y"), this.isDragging = true;
    var s2 = m(this.el), l2 = b(this.el), r2 = this.axis[t2].scrollbar, o2 = "y" === t2 ? e3.pageY : e3.pageX;
    this.axis[t2].dragOffset = o2 - ((null === (i2 = r2.rect) || void 0 === i2 ? void 0 : i2[this.axis[t2].offsetAttr]) || 0), this.draggedAxis = t2, y(this.el, this.classNames.dragging), s2.addEventListener("mousemove", this.drag, true), s2.addEventListener("mouseup", this.onEndDrag, true), null === this.removePreventClickId ? (s2.addEventListener("click", this.preventClick, true), s2.addEventListener("dblclick", this.preventClick, true)) : (l2.clearTimeout(this.removePreventClickId), this.removePreventClickId = null);
  }, e2.prototype.onTrackClick = function(e3, t2) {
    var i2, s2, l2, r2, o2 = this;
    void 0 === t2 && (t2 = "y");
    var n2 = this.axis[t2];
    if (this.options.clickOnTrack && n2.scrollbar.el && this.contentWrapperEl) {
      e3.preventDefault();
      var a2 = b(this.el);
      this.axis[t2].scrollbar.rect = n2.scrollbar.el.getBoundingClientRect();
      var c2 = null !== (s2 = null === (i2 = this.axis[t2].scrollbar.rect) || void 0 === i2 ? void 0 : i2[this.axis[t2].offsetAttr]) && void 0 !== s2 ? s2 : 0, h2 = parseInt(null !== (r2 = null === (l2 = this.elStyles) || void 0 === l2 ? void 0 : l2[this.axis[t2].sizeAttr]) && void 0 !== r2 ? r2 : "0px", 10), d2 = this.contentWrapperEl[this.axis[t2].scrollOffsetAttr], u2 = ("y" === t2 ? this.mouseY - c2 : this.mouseX - c2) < 0 ? -1 : 1, p2 = -1 === u2 ? d2 - h2 : d2 + h2, v2 = function() {
        o2.contentWrapperEl && (-1 === u2 ? d2 > p2 && (d2 -= 40, o2.contentWrapperEl[o2.axis[t2].scrollOffsetAttr] = d2, a2.requestAnimationFrame(v2)) : d2 < p2 && (d2 += 40, o2.contentWrapperEl[o2.axis[t2].scrollOffsetAttr] = d2, a2.requestAnimationFrame(v2)));
      };
      v2();
    }
  }, e2.prototype.getContentElement = function() {
    return this.contentEl;
  }, e2.prototype.getScrollElement = function() {
    return this.contentWrapperEl;
  }, e2.prototype.removeListeners = function() {
    var e3 = b(this.el);
    this.el.removeEventListener("mouseenter", this.onMouseEnter), this.el.removeEventListener("pointerdown", this.onPointerEvent, true), this.el.removeEventListener("mousemove", this.onMouseMove), this.el.removeEventListener("mouseleave", this.onMouseLeave), this.contentWrapperEl && this.contentWrapperEl.removeEventListener("scroll", this.onScroll), e3.removeEventListener("resize", this.onWindowResize), this.mutationObserver && this.mutationObserver.disconnect(), this.resizeObserver && this.resizeObserver.disconnect(), this.onMouseMove.cancel(), this.onWindowResize.cancel(), this.onStopScrolling.cancel(), this.onMouseEntered.cancel();
  }, e2.prototype.unMount = function() {
    this.removeListeners();
  }, e2.prototype.isWithinBounds = function(e3) {
    return this.mouseX >= e3.left && this.mouseX <= e3.left + e3.width && this.mouseY >= e3.top && this.mouseY <= e3.top + e3.height;
  }, e2.prototype.findChild = function(e3, t2) {
    var i2 = e3.matches || e3.webkitMatchesSelector || e3.mozMatchesSelector || e3.msMatchesSelector;
    return Array.prototype.filter.call(e3.children, function(e4) {
      return i2.call(e4, t2);
    })[0];
  }, e2.rtlHelpers = null, e2.defaultOptions = { forceVisible: false, clickOnTrack: true, scrollbarMinSize: 25, scrollbarMaxSize: 0, ariaLabel: "scrollable content", tabIndex: 0, classNames: { contentEl: "simplebar-content", contentWrapper: "simplebar-content-wrapper", offset: "simplebar-offset", mask: "simplebar-mask", wrapper: "simplebar-wrapper", placeholder: "simplebar-placeholder", scrollbar: "simplebar-scrollbar", track: "simplebar-track", heightAutoObserverWrapperEl: "simplebar-height-auto-observer-wrapper", heightAutoObserverEl: "simplebar-height-auto-observer", visible: "simplebar-visible", horizontal: "simplebar-horizontal", vertical: "simplebar-vertical", hover: "simplebar-hover", dragging: "simplebar-dragging", scrolling: "simplebar-scrolling", scrollable: "simplebar-scrollable", mouseEntered: "simplebar-mouse-entered" }, scrollableNode: null, contentNode: null, autoHide: true }, e2.getOptions = x, e2.helpers = p, e2;
}(), w = function() {
  return w = Object.assign || function(e2) {
    for (var t2, i2 = 1, s2 = arguments.length; i2 < s2; i2++)
      for (var l2 in t2 = arguments[i2])
        Object.prototype.hasOwnProperty.call(t2, l2) && (e2[l2] = t2[l2]);
    return e2;
  }, w.apply(this, arguments);
};
var k = e.forwardRef(function(t2, i2) {
  var r2 = t2.children, o2 = t2.scrollableNodeProps, n2 = void 0 === o2 ? {} : o2, a2 = function(e2, t3) {
    var i3 = {};
    for (var s2 in e2)
      Object.prototype.hasOwnProperty.call(e2, s2) && t3.indexOf(s2) < 0 && (i3[s2] = e2[s2]);
    if (null != e2 && "function" == typeof Object.getOwnPropertySymbols) {
      var l2 = 0;
      for (s2 = Object.getOwnPropertySymbols(e2); l2 < s2.length; l2++)
        t3.indexOf(s2[l2]) < 0 && Object.prototype.propertyIsEnumerable.call(e2, s2[l2]) && (i3[s2[l2]] = e2[s2[l2]]);
    }
    return i3;
  }(t2, ["children", "scrollableNodeProps"]), c2 = e.useRef(), h2 = e.useRef(), d2 = e.useRef(), u2 = {}, p2 = {};
  Object.keys(a2).forEach(function(e2) {
    Object.prototype.hasOwnProperty.call(O.defaultOptions, e2) ? u2[e2] = a2[e2] : p2[e2] = a2[e2];
  });
  var v2 = w(w({}, O.defaultOptions.classNames), u2.classNames), f2 = w(w({}, n2), { className: "".concat(v2.contentWrapper).concat(n2.className ? " ".concat(n2.className) : ""), tabIndex: u2.tabIndex || O.defaultOptions.tabIndex, role: "region", "aria-label": u2.ariaLabel || O.defaultOptions.ariaLabel });
  return e.useEffect(function() {
    var e2;
    return h2.current = f2.ref ? f2.ref.current : h2.current, c2.current && (e2 = new O(c2.current, w(w(w({}, u2), h2.current && { scrollableNode: h2.current }), d2.current && { contentNode: d2.current })), "function" == typeof i2 ? i2(e2) : i2 && (i2.current = e2)), function() {
      null == e2 || e2.unMount(), e2 = null, "function" == typeof i2 && i2(null);
    };
  }, []), s("div", { ...w({ "data-simplebar": "init", ref: c2 }, p2), children: [s("div", { className: v2.wrapper, children: [l("div", { className: v2.heightAutoObserverWrapperEl, children: l("div", { className: v2.heightAutoObserverEl }) }), l("div", { className: v2.mask, children: l("div", { className: v2.offset, children: "function" == typeof r2 ? r2({ scrollableNodeRef: h2, scrollableNodeProps: w(w({}, f2), { ref: h2 }), contentNodeRef: d2, contentNodeProps: { className: v2.contentEl, ref: d2 } }) : l("div", { ...w({}, f2), children: l("div", { className: v2.contentEl, children: r2 }) }) }) }), l("div", { className: v2.placeholder })] }), l("div", { className: "".concat(v2.track, " ").concat(v2.horizontal), children: l("div", { className: v2.scrollbar }) }), l("div", { className: "".concat(v2.track, " ").concat(v2.vertical), children: l("div", { className: v2.scrollbar }) })] });
});
k.displayName = "SimpleBar";
export {
  k as S
};
