@baishuyun/ui-business 5.0.2 → 5.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/BubbleChart/AutoGridEChart-uinZMdOR.js +185 -0
  2. package/dist/BubbleChart/BubbleChart-CPhXmstL.js +174 -0
  3. package/dist/BubbleChart/index.js +7 -4
  4. package/dist/ConfigProvider/ConfigProvider-CISBH3A8.js +22 -0
  5. package/dist/ConfigProvider/configContext-B0kvcW4s.js +9 -0
  6. package/dist/ConfigProvider/index.js +6 -4
  7. package/dist/DeptsMember/Department-BYVAaPYd.js +186 -0
  8. package/dist/DeptsMember/DeptsMember-D_xv-Zy7.js +801 -0
  9. package/dist/DeptsMember/DeptsUser-CQrRRJxk.js +277 -0
  10. package/dist/DeptsMember/ExtraConcactPanel-Cioew3V3.js +736 -0
  11. package/dist/DeptsMember/Member-BIBX5jKD.js +47 -0
  12. package/dist/DeptsMember/OrganizationPanel-BLIXOm6z.js +235 -0
  13. package/dist/DeptsMember/RelationShipDepts-wcYjFbhx.js +78 -0
  14. package/dist/DeptsMember/RelationShipList-CRdCr4NL.js +73 -0
  15. package/dist/DeptsMember/TabGroup-B_VIf1lS.js +98 -0
  16. package/dist/DeptsMember/index.js +18 -8
  17. package/dist/DeptsMember/subcomponents/Entity/Department/index.js +8 -166
  18. package/dist/DeptsMember/subcomponents/Entity/DeptsUser/index.js +11 -267
  19. package/dist/DeptsMember/subcomponents/Entity/Member/index.js +8 -46
  20. package/dist/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipDepts/index.js +4 -13
  21. package/dist/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipList/index.js +4 -67
  22. package/dist/DeptsMember/useDeptsMemberSelector-DP5L8bhi.js +15 -0
  23. package/dist/DeptsMember/utils/index.js +65 -77
  24. package/dist/Scatterplot/Scatterplot-DTKhmdTE.js +150 -0
  25. package/dist/Scatterplot/index.js +7 -4
  26. package/dist/components/BubbleChart/AutoGridEChart.d.ts +1 -1
  27. package/dist/index.css +2 -1
  28. package/dist/index.js +164 -200
  29. package/dist/utils/getLegendHeight.d.ts +1 -1
  30. package/dist/vendors/clsx.js +14 -14
  31. package/dist/vendors/echarts.js +41454 -44148
  32. package/dist/vendors/lodash-es.js +127 -117
  33. package/dist/vendors/rolldown-runtime.js +11 -0
  34. package/dist/vendors/services/apiService.js +15 -19
  35. package/dist/vendors/services/corp/outsider.service.js +5 -6
  36. package/dist/vendors/services/data/department.service.js +5 -6
  37. package/dist/vendors/services/data/member.service.js +5 -9
  38. package/dist/vendors/services/data/member_limit.service.js +5 -5
  39. package/dist/vendors/services/data/outsider.service.js +5 -6
  40. package/dist/vendors/services/ncorp/department.service.js +5 -6
  41. package/dist/vendors/services/ncorp/relation.service.js +5 -5
  42. package/dist/vendors/simplebar-react.js +358 -396
  43. package/dist/vendors/useLocale.js +132 -41
  44. package/package.json +5 -5
  45. package/dist/BubbleChart/AutoGridEChart-vNNqSiqF.js +0 -212
  46. package/dist/BubbleChart/BubbleChart-B0AuH-ma.js +0 -236
  47. package/dist/ConfigProvider/ConfigProvider-CAq3dN6-.js +0 -15
  48. package/dist/ConfigProvider/configContext-_BAslzM-.js +0 -9
  49. package/dist/DeptsMember/DeptsMember-BNuoQ8y4.js +0 -865
  50. package/dist/DeptsMember/ExtraConcactPanel-BoSCI3s5.js +0 -738
  51. package/dist/DeptsMember/OrganizationPanel-ByWU1PWX.js +0 -275
  52. package/dist/DeptsMember/TabGroup-DZC7i-Yr.js +0 -104
  53. package/dist/DeptsMember/index-BRIA1uOQ.js +0 -88
  54. package/dist/DeptsMember/useDeptsMemberSelector-D3rvDuVf.js +0 -13
  55. package/dist/Scatterplot/Scatterplot-D8AUUxhA.js +0 -201
@@ -1,408 +1,370 @@
1
- import * as f from "react";
2
- import { t as j, d as M } from "./lodash-es.js";
3
- var w = function() {
4
- return w = Object.assign || function(t) {
5
- for (var i, e = 1, r = arguments.length; e < r; e++) {
6
- i = arguments[e];
7
- for (var l in i) Object.prototype.hasOwnProperty.call(i, l) && (t[l] = i[l]);
8
- }
9
- return t;
10
- }, w.apply(this, arguments);
1
+ import { r as e, t } from "./lodash-es.js";
2
+ import * as n from "react";
3
+ //#region ../../node_modules/.pnpm/simplebar-core@1.3.2/node_modules/simplebar-core/dist/index.mjs
4
+ var r = function() {
5
+ return r = Object.assign || function(e) {
6
+ for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
7
+ return e;
8
+ }, r.apply(this, arguments);
11
9
  };
12
- function T(s) {
13
- return !s || !s.ownerDocument || !s.ownerDocument.defaultView ? window : s.ownerDocument.defaultView;
10
+ function i(e) {
11
+ return !e || !e.ownerDocument || !e.ownerDocument.defaultView ? window : e.ownerDocument.defaultView;
14
12
  }
15
- function P(s) {
16
- return !s || !s.ownerDocument ? document : s.ownerDocument;
13
+ function a(e) {
14
+ return !e || !e.ownerDocument ? document : e.ownerDocument;
17
15
  }
18
- var V = function(s) {
19
- var t = {}, i = Array.prototype.reduce.call(s, function(e, r) {
20
- var l = r.name.match(/data-simplebar-(.+)/);
21
- if (l) {
22
- var o = l[1].replace(/\W+(.)/g, function(a, u) {
23
- return u.toUpperCase();
24
- });
25
- switch (r.value) {
26
- case "true":
27
- e[o] = !0;
28
- break;
29
- case "false":
30
- e[o] = !1;
31
- break;
32
- case void 0:
33
- e[o] = !0;
34
- break;
35
- default:
36
- e[o] = r.value;
37
- }
38
- }
39
- return e;
40
- }, t);
41
- return i;
16
+ var o = function(e) {
17
+ return Array.prototype.reduce.call(e, function(e, t) {
18
+ var n = t.name.match(/data-simplebar-(.+)/);
19
+ if (n) {
20
+ var r = n[1].replace(/\W+(.)/g, function(e, t) {
21
+ return t.toUpperCase();
22
+ });
23
+ switch (t.value) {
24
+ case "true":
25
+ e[r] = !0;
26
+ break;
27
+ case "false":
28
+ e[r] = !1;
29
+ break;
30
+ case void 0:
31
+ e[r] = !0;
32
+ break;
33
+ default: e[r] = t.value;
34
+ }
35
+ }
36
+ return e;
37
+ }, {});
42
38
  };
43
- function H(s, t) {
44
- var i;
45
- s && (i = s.classList).add.apply(i, t.split(" "));
39
+ function s(e, t) {
40
+ var n;
41
+ e && (n = e.classList).add.apply(n, t.split(" "));
46
42
  }
47
- function B(s, t) {
48
- s && t.split(" ").forEach(function(i) {
49
- s.classList.remove(i);
50
- });
43
+ function c(e, t) {
44
+ e && t.split(" ").forEach(function(t) {
45
+ e.classList.remove(t);
46
+ });
51
47
  }
52
- function X(s) {
53
- return ".".concat(s.split(" ").join("."));
48
+ function l(e) {
49
+ return `.${e.split(" ").join(".")}`;
54
50
  }
55
- var _ = !!(typeof window < "u" && window.document && window.document.createElement), I = /* @__PURE__ */ Object.freeze({
56
- __proto__: null,
57
- addClasses: H,
58
- canUseDOM: _,
59
- classNamesToQuery: X,
60
- getElementDocument: P,
61
- getElementWindow: T,
62
- getOptions: V,
63
- removeClasses: B
64
- }), O = null, R = null;
65
- _ && window.addEventListener("resize", function() {
66
- R !== window.devicePixelRatio && (R = window.devicePixelRatio, O = null);
51
+ var u = !!(typeof window < "u" && window.document && window.document.createElement), d = /* @__PURE__ */ Object.freeze({
52
+ __proto__: null,
53
+ addClasses: s,
54
+ canUseDOM: u,
55
+ classNamesToQuery: l,
56
+ getElementDocument: a,
57
+ getElementWindow: i,
58
+ getOptions: o,
59
+ removeClasses: c
60
+ }), f = null, p = null;
61
+ u && window.addEventListener("resize", function() {
62
+ p !== window.devicePixelRatio && (p = window.devicePixelRatio, f = null);
67
63
  });
68
- function D() {
69
- if (O === null) {
70
- if (typeof document > "u")
71
- return O = 0, O;
72
- var s = document.body, t = document.createElement("div");
73
- t.classList.add("simplebar-hide-scrollbar"), s.appendChild(t);
74
- var i = t.getBoundingClientRect().right;
75
- s.removeChild(t), O = i;
76
- }
77
- return O;
64
+ function m() {
65
+ if (f === null) {
66
+ if (typeof document > "u") return f = 0, f;
67
+ var e = document.body, t = document.createElement("div");
68
+ t.classList.add("simplebar-hide-scrollbar"), e.appendChild(t);
69
+ var n = t.getBoundingClientRect().right;
70
+ e.removeChild(t), f = n;
71
+ }
72
+ return f;
78
73
  }
79
- var g = T, C = P, $ = V, b = H, y = B, d = X, k = (
80
- /** @class */
81
- (function() {
82
- function s(t, i) {
83
- i === void 0 && (i = {});
84
- var e = this;
85
- if (this.removePreventClickId = null, this.minScrollbarWidth = 20, this.stopScrollDelay = 175, this.isScrolling = !1, this.isMouseEntering = !1, this.isDragging = !1, this.scrollXTicking = !1, this.scrollYTicking = !1, 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() {
86
- }, this.onWindowResize = function() {
87
- }, this.onStopScrolling = function() {
88
- }, this.onMouseEntered = function() {
89
- }, this.onScroll = function() {
90
- var r = g(e.el);
91
- e.scrollXTicking || (r.requestAnimationFrame(e.scrollX), e.scrollXTicking = !0), e.scrollYTicking || (r.requestAnimationFrame(e.scrollY), e.scrollYTicking = !0), e.isScrolling || (e.isScrolling = !0, b(e.el, e.classNames.scrolling)), e.showScrollbar("x"), e.showScrollbar("y"), e.onStopScrolling();
92
- }, this.scrollX = function() {
93
- e.axis.x.isOverflowing && e.positionScrollbar("x"), e.scrollXTicking = !1;
94
- }, this.scrollY = function() {
95
- e.axis.y.isOverflowing && e.positionScrollbar("y"), e.scrollYTicking = !1;
96
- }, this._onStopScrolling = function() {
97
- y(e.el, e.classNames.scrolling), e.options.autoHide && (e.hideScrollbar("x"), e.hideScrollbar("y")), e.isScrolling = !1;
98
- }, this.onMouseEnter = function() {
99
- e.isMouseEntering || (b(e.el, e.classNames.mouseEntered), e.showScrollbar("x"), e.showScrollbar("y"), e.isMouseEntering = !0), e.onMouseEntered();
100
- }, this._onMouseEntered = function() {
101
- y(e.el, e.classNames.mouseEntered), e.options.autoHide && (e.hideScrollbar("x"), e.hideScrollbar("y")), e.isMouseEntering = !1;
102
- }, this._onMouseMove = function(r) {
103
- e.mouseX = r.clientX, e.mouseY = r.clientY, (e.axis.x.isOverflowing || e.axis.x.forceVisible) && e.onMouseMoveForAxis("x"), (e.axis.y.isOverflowing || e.axis.y.forceVisible) && e.onMouseMoveForAxis("y");
104
- }, this.onMouseLeave = function() {
105
- e.onMouseMove.cancel(), (e.axis.x.isOverflowing || e.axis.x.forceVisible) && e.onMouseLeaveForAxis("x"), (e.axis.y.isOverflowing || e.axis.y.forceVisible) && e.onMouseLeaveForAxis("y"), e.mouseX = -1, e.mouseY = -1;
106
- }, this._onWindowResize = function() {
107
- e.scrollbarWidth = e.getScrollbarWidth(), e.hideNativeScrollbar();
108
- }, this.onPointerEvent = function(r) {
109
- if (!(!e.axis.x.track.el || !e.axis.y.track.el || !e.axis.x.scrollbar.el || !e.axis.y.scrollbar.el)) {
110
- var l, o;
111
- e.axis.x.track.rect = e.axis.x.track.el.getBoundingClientRect(), e.axis.y.track.rect = e.axis.y.track.el.getBoundingClientRect(), (e.axis.x.isOverflowing || e.axis.x.forceVisible) && (l = e.isWithinBounds(e.axis.x.track.rect)), (e.axis.y.isOverflowing || e.axis.y.forceVisible) && (o = e.isWithinBounds(e.axis.y.track.rect)), (l || o) && (r.stopPropagation(), r.type === "pointerdown" && r.pointerType !== "touch" && (l && (e.axis.x.scrollbar.rect = e.axis.x.scrollbar.el.getBoundingClientRect(), e.isWithinBounds(e.axis.x.scrollbar.rect) ? e.onDragStart(r, "x") : e.onTrackClick(r, "x")), o && (e.axis.y.scrollbar.rect = e.axis.y.scrollbar.el.getBoundingClientRect(), e.isWithinBounds(e.axis.y.scrollbar.rect) ? e.onDragStart(r, "y") : e.onTrackClick(r, "y"))));
112
- }
113
- }, this.drag = function(r) {
114
- var l, o, a, u, h, v, n, p, c, W, E;
115
- if (!(!e.draggedAxis || !e.contentWrapperEl)) {
116
- var x, S = e.axis[e.draggedAxis].track, A = (o = (l = S.rect) === null || l === void 0 ? void 0 : l[e.axis[e.draggedAxis].sizeAttr]) !== null && o !== void 0 ? o : 0, L = e.axis[e.draggedAxis].scrollbar, Y = (u = (a = e.contentWrapperEl) === null || a === void 0 ? void 0 : a[e.axis[e.draggedAxis].scrollSizeAttr]) !== null && u !== void 0 ? u : 0, q = parseInt((v = (h = e.elStyles) === null || h === void 0 ? void 0 : h[e.axis[e.draggedAxis].sizeAttr]) !== null && v !== void 0 ? v : "0px", 10);
117
- r.preventDefault(), r.stopPropagation(), e.draggedAxis === "y" ? x = r.pageY : x = r.pageX;
118
- var N = x - ((p = (n = S.rect) === null || n === void 0 ? void 0 : n[e.axis[e.draggedAxis].offsetAttr]) !== null && p !== void 0 ? p : 0) - e.axis[e.draggedAxis].dragOffset;
119
- N = e.draggedAxis === "x" && e.isRtl ? ((W = (c = S.rect) === null || c === void 0 ? void 0 : c[e.axis[e.draggedAxis].sizeAttr]) !== null && W !== void 0 ? W : 0) - L.size - N : N;
120
- var F = N / (A - L.size), z = F * (Y - q);
121
- e.draggedAxis === "x" && e.isRtl && (z = !((E = s.getRtlHelpers()) === null || E === void 0) && E.isScrollingToNegative ? -z : z), e.contentWrapperEl[e.axis[e.draggedAxis].scrollOffsetAttr] = z;
122
- }
123
- }, this.onEndDrag = function(r) {
124
- e.isDragging = !1;
125
- var l = C(e.el), o = g(e.el);
126
- r.preventDefault(), r.stopPropagation(), y(e.el, e.classNames.dragging), e.onStopScrolling(), l.removeEventListener("mousemove", e.drag, !0), l.removeEventListener("mouseup", e.onEndDrag, !0), e.removePreventClickId = o.setTimeout(function() {
127
- l.removeEventListener("click", e.preventClick, !0), l.removeEventListener("dblclick", e.preventClick, !0), e.removePreventClickId = null;
128
- });
129
- }, this.preventClick = function(r) {
130
- r.preventDefault(), r.stopPropagation();
131
- }, this.el = t, this.options = w(w({}, s.defaultOptions), i), this.classNames = w(w({}, s.defaultOptions.classNames), i.classNames), this.axis = {
132
- x: {
133
- scrollOffsetAttr: "scrollLeft",
134
- sizeAttr: "width",
135
- scrollSizeAttr: "scrollWidth",
136
- offsetSizeAttr: "offsetWidth",
137
- offsetAttr: "left",
138
- overflowAttr: "overflowX",
139
- dragOffset: 0,
140
- isOverflowing: !0,
141
- forceVisible: !1,
142
- track: { size: null, el: null, rect: null, isVisible: !1 },
143
- scrollbar: { size: null, el: null, rect: null, isVisible: !1 }
144
- },
145
- y: {
146
- scrollOffsetAttr: "scrollTop",
147
- sizeAttr: "height",
148
- scrollSizeAttr: "scrollHeight",
149
- offsetSizeAttr: "offsetHeight",
150
- offsetAttr: "top",
151
- overflowAttr: "overflowY",
152
- dragOffset: 0,
153
- isOverflowing: !0,
154
- forceVisible: !1,
155
- track: { size: null, el: null, rect: null, isVisible: !1 },
156
- scrollbar: { size: null, el: null, rect: null, isVisible: !1 }
157
- }
158
- }, typeof this.el != "object" || !this.el.nodeName)
159
- throw new Error("Argument passed to SimpleBar must be an HTML element instead of ".concat(this.el));
160
- this.onMouseMove = j(this._onMouseMove, 64), this.onWindowResize = M(this._onWindowResize, 64, { leading: !0 }), this.onStopScrolling = M(this._onStopScrolling, this.stopScrollDelay), this.onMouseEntered = M(this._onMouseEntered, this.stopScrollDelay), this.init();
161
- }
162
- return s.getRtlHelpers = function() {
163
- if (s.rtlHelpers)
164
- return s.rtlHelpers;
165
- var t = document.createElement("div");
166
- t.innerHTML = '<div class="simplebar-dummy-scrollbar-size"><div></div></div>';
167
- var i = t.firstElementChild, e = i?.firstElementChild;
168
- if (!e)
169
- return null;
170
- document.body.appendChild(i), i.scrollLeft = 0;
171
- var r = s.getOffset(i), l = s.getOffset(e);
172
- i.scrollLeft = -999;
173
- var o = s.getOffset(e);
174
- return document.body.removeChild(i), s.rtlHelpers = {
175
- // determines if the scrolling is responding with negative values
176
- isScrollOriginAtZero: r.left !== l.left,
177
- // determines if the origin scrollbar position is inverted or not (positioned on left or right)
178
- isScrollingToNegative: l.left !== o.left
179
- }, s.rtlHelpers;
180
- }, s.prototype.getScrollbarWidth = function() {
181
- try {
182
- return this.contentWrapperEl && getComputedStyle(this.contentWrapperEl, "::-webkit-scrollbar").display === "none" || "scrollbarWidth" in document.documentElement.style || "-ms-overflow-style" in document.documentElement.style ? 0 : D();
183
- } catch {
184
- return D();
185
- }
186
- }, s.getOffset = function(t) {
187
- var i = t.getBoundingClientRect(), e = C(t), r = g(t);
188
- return {
189
- top: i.top + (r.pageYOffset || e.documentElement.scrollTop),
190
- left: i.left + (r.pageXOffset || e.documentElement.scrollLeft)
191
- };
192
- }, s.prototype.init = function() {
193
- _ && (this.initDOM(), this.rtlHelpers = s.getRtlHelpers(), this.scrollbarWidth = this.getScrollbarWidth(), this.recalculate(), this.initListeners());
194
- }, s.prototype.initDOM = function() {
195
- var t, i;
196
- this.wrapperEl = this.el.querySelector(d(this.classNames.wrapper)), this.contentWrapperEl = this.options.scrollableNode || this.el.querySelector(d(this.classNames.contentWrapper)), this.contentEl = this.options.contentNode || this.el.querySelector(d(this.classNames.contentEl)), this.offsetEl = this.el.querySelector(d(this.classNames.offset)), this.maskEl = this.el.querySelector(d(this.classNames.mask)), this.placeholderEl = this.findChild(this.wrapperEl, d(this.classNames.placeholder)), this.heightAutoObserverWrapperEl = this.el.querySelector(d(this.classNames.heightAutoObserverWrapperEl)), this.heightAutoObserverEl = this.el.querySelector(d(this.classNames.heightAutoObserverEl)), this.axis.x.track.el = this.findChild(this.el, "".concat(d(this.classNames.track)).concat(d(this.classNames.horizontal))), this.axis.y.track.el = this.findChild(this.el, "".concat(d(this.classNames.track)).concat(d(this.classNames.vertical))), this.axis.x.scrollbar.el = ((t = this.axis.x.track.el) === null || t === void 0 ? void 0 : t.querySelector(d(this.classNames.scrollbar))) || null, this.axis.y.scrollbar.el = ((i = this.axis.y.track.el) === null || i === void 0 ? void 0 : i.querySelector(d(this.classNames.scrollbar))) || null, this.options.autoHide || (b(this.axis.x.scrollbar.el, this.classNames.visible), b(this.axis.y.scrollbar.el, this.classNames.visible));
197
- }, s.prototype.initListeners = function() {
198
- var t = this, i, e = g(this.el);
199
- if (this.el.addEventListener("mouseenter", this.onMouseEnter), this.el.addEventListener("pointerdown", this.onPointerEvent, !0), this.el.addEventListener("mousemove", this.onMouseMove), this.el.addEventListener("mouseleave", this.onMouseLeave), (i = this.contentWrapperEl) === null || i === void 0 || i.addEventListener("scroll", this.onScroll), e.addEventListener("resize", this.onWindowResize), !!this.contentEl) {
200
- if (window.ResizeObserver) {
201
- var r = !1, l = e.ResizeObserver || ResizeObserver;
202
- this.resizeObserver = new l(function() {
203
- r && e.requestAnimationFrame(function() {
204
- t.recalculate();
205
- });
206
- }), this.resizeObserver.observe(this.el), this.resizeObserver.observe(this.contentEl), e.requestAnimationFrame(function() {
207
- r = !0;
208
- });
209
- }
210
- this.mutationObserver = new e.MutationObserver(function() {
211
- e.requestAnimationFrame(function() {
212
- t.recalculate();
213
- });
214
- }), this.mutationObserver.observe(this.contentEl, {
215
- childList: !0,
216
- subtree: !0,
217
- characterData: !0
218
- });
219
- }
220
- }, s.prototype.recalculate = function() {
221
- if (!(!this.heightAutoObserverEl || !this.contentEl || !this.contentWrapperEl || !this.wrapperEl || !this.placeholderEl)) {
222
- var t = g(this.el);
223
- this.elStyles = t.getComputedStyle(this.el), this.isRtl = this.elStyles.direction === "rtl";
224
- var i = this.contentEl.offsetWidth, e = this.heightAutoObserverEl.offsetHeight <= 1, r = this.heightAutoObserverEl.offsetWidth <= 1 || i > 0, l = this.contentWrapperEl.offsetWidth, o = this.elStyles.overflowX, a = this.elStyles.overflowY;
225
- 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);
226
- var u = this.contentEl.scrollHeight, h = this.contentEl.scrollWidth;
227
- this.contentWrapperEl.style.height = e ? "auto" : "100%", this.placeholderEl.style.width = r ? "".concat(i || h, "px") : "auto", this.placeholderEl.style.height = "".concat(u, "px");
228
- var v = this.contentWrapperEl.offsetHeight;
229
- this.axis.x.isOverflowing = i !== 0 && h > i, this.axis.y.isOverflowing = u > v, this.axis.x.isOverflowing = o === "hidden" ? !1 : this.axis.x.isOverflowing, this.axis.y.isOverflowing = a === "hidden" ? !1 : this.axis.y.isOverflowing, this.axis.x.forceVisible = this.options.forceVisible === "x" || this.options.forceVisible === !0, this.axis.y.forceVisible = this.options.forceVisible === "y" || this.options.forceVisible === !0, this.hideNativeScrollbar();
230
- var n = this.axis.x.isOverflowing ? this.scrollbarWidth : 0, p = this.axis.y.isOverflowing ? this.scrollbarWidth : 0;
231
- this.axis.x.isOverflowing = this.axis.x.isOverflowing && h > l - p, this.axis.y.isOverflowing = this.axis.y.isOverflowing && u > v - n, 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");
232
- }
233
- }, s.prototype.getScrollbarSize = function(t) {
234
- var i, e;
235
- if (t === void 0 && (t = "y"), !this.axis[t].isOverflowing || !this.contentEl)
236
- return 0;
237
- var r = this.contentEl[this.axis[t].scrollSizeAttr], l = (e = (i = this.axis[t].track.el) === null || i === void 0 ? void 0 : i[this.axis[t].offsetSizeAttr]) !== null && e !== void 0 ? e : 0, o = l / r, a;
238
- return a = Math.max(~~(o * l), this.options.scrollbarMinSize), this.options.scrollbarMaxSize && (a = Math.min(a, this.options.scrollbarMaxSize)), a;
239
- }, s.prototype.positionScrollbar = function(t) {
240
- var i, e, r;
241
- t === void 0 && (t = "y");
242
- var l = this.axis[t].scrollbar;
243
- if (!(!this.axis[t].isOverflowing || !this.contentWrapperEl || !l.el || !this.elStyles)) {
244
- var o = this.contentWrapperEl[this.axis[t].scrollSizeAttr], a = ((i = this.axis[t].track.el) === null || i === void 0 ? void 0 : i[this.axis[t].offsetSizeAttr]) || 0, u = parseInt(this.elStyles[this.axis[t].sizeAttr], 10), h = this.contentWrapperEl[this.axis[t].scrollOffsetAttr];
245
- h = t === "x" && this.isRtl && (!((e = s.getRtlHelpers()) === null || e === void 0) && e.isScrollOriginAtZero) ? -h : h, t === "x" && this.isRtl && (h = !((r = s.getRtlHelpers()) === null || r === void 0) && r.isScrollingToNegative ? h : -h);
246
- var v = h / (o - u), n = ~~((a - l.size) * v);
247
- n = t === "x" && this.isRtl ? -n + (a - l.size) : n, l.el.style.transform = t === "x" ? "translate3d(".concat(n, "px, 0, 0)") : "translate3d(0, ".concat(n, "px, 0)");
248
- }
249
- }, s.prototype.toggleTrackVisibility = function(t) {
250
- t === void 0 && (t = "y");
251
- var i = this.axis[t].track.el, e = this.axis[t].scrollbar.el;
252
- !i || !e || !this.contentWrapperEl || (this.axis[t].isOverflowing || this.axis[t].forceVisible ? (i.style.visibility = "visible", this.contentWrapperEl.style[this.axis[t].overflowAttr] = "scroll", this.el.classList.add("".concat(this.classNames.scrollable, "-").concat(t))) : (i.style.visibility = "hidden", this.contentWrapperEl.style[this.axis[t].overflowAttr] = "hidden", this.el.classList.remove("".concat(this.classNames.scrollable, "-").concat(t))), this.axis[t].isOverflowing ? e.style.display = "block" : e.style.display = "none");
253
- }, s.prototype.showScrollbar = function(t) {
254
- t === void 0 && (t = "y"), this.axis[t].isOverflowing && !this.axis[t].scrollbar.isVisible && (b(this.axis[t].scrollbar.el, this.classNames.visible), this.axis[t].scrollbar.isVisible = !0);
255
- }, s.prototype.hideScrollbar = function(t) {
256
- t === void 0 && (t = "y"), !this.isDragging && this.axis[t].isOverflowing && this.axis[t].scrollbar.isVisible && (y(this.axis[t].scrollbar.el, this.classNames.visible), this.axis[t].scrollbar.isVisible = !1);
257
- }, s.prototype.hideNativeScrollbar = function() {
258
- 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");
259
- }, s.prototype.onMouseMoveForAxis = function(t) {
260
- t === void 0 && (t = "y");
261
- var i = this.axis[t];
262
- !i.track.el || !i.scrollbar.el || (i.track.rect = i.track.el.getBoundingClientRect(), i.scrollbar.rect = i.scrollbar.el.getBoundingClientRect(), this.isWithinBounds(i.track.rect) ? (this.showScrollbar(t), b(i.track.el, this.classNames.hover), this.isWithinBounds(i.scrollbar.rect) ? b(i.scrollbar.el, this.classNames.hover) : y(i.scrollbar.el, this.classNames.hover)) : (y(i.track.el, this.classNames.hover), this.options.autoHide && this.hideScrollbar(t)));
263
- }, s.prototype.onMouseLeaveForAxis = function(t) {
264
- t === void 0 && (t = "y"), y(this.axis[t].track.el, this.classNames.hover), y(this.axis[t].scrollbar.el, this.classNames.hover), this.options.autoHide && this.hideScrollbar(t);
265
- }, s.prototype.onDragStart = function(t, i) {
266
- var e;
267
- i === void 0 && (i = "y"), this.isDragging = !0;
268
- var r = C(this.el), l = g(this.el), o = this.axis[i].scrollbar, a = i === "y" ? t.pageY : t.pageX;
269
- this.axis[i].dragOffset = a - (((e = o.rect) === null || e === void 0 ? void 0 : e[this.axis[i].offsetAttr]) || 0), this.draggedAxis = i, b(this.el, this.classNames.dragging), r.addEventListener("mousemove", this.drag, !0), r.addEventListener("mouseup", this.onEndDrag, !0), this.removePreventClickId === null ? (r.addEventListener("click", this.preventClick, !0), r.addEventListener("dblclick", this.preventClick, !0)) : (l.clearTimeout(this.removePreventClickId), this.removePreventClickId = null);
270
- }, s.prototype.onTrackClick = function(t, i) {
271
- var e = this, r, l, o, a;
272
- i === void 0 && (i = "y");
273
- var u = this.axis[i];
274
- if (!(!this.options.clickOnTrack || !u.scrollbar.el || !this.contentWrapperEl)) {
275
- t.preventDefault();
276
- var h = g(this.el);
277
- this.axis[i].scrollbar.rect = u.scrollbar.el.getBoundingClientRect();
278
- var v = this.axis[i].scrollbar, n = (l = (r = v.rect) === null || r === void 0 ? void 0 : r[this.axis[i].offsetAttr]) !== null && l !== void 0 ? l : 0, p = parseInt((a = (o = this.elStyles) === null || o === void 0 ? void 0 : o[this.axis[i].sizeAttr]) !== null && a !== void 0 ? a : "0px", 10), c = this.contentWrapperEl[this.axis[i].scrollOffsetAttr], W = i === "y" ? this.mouseY - n : this.mouseX - n, E = W < 0 ? -1 : 1, x = E === -1 ? c - p : c + p, S = 40, A = function() {
279
- e.contentWrapperEl && (E === -1 ? c > x && (c -= S, e.contentWrapperEl[e.axis[i].scrollOffsetAttr] = c, h.requestAnimationFrame(A)) : c < x && (c += S, e.contentWrapperEl[e.axis[i].scrollOffsetAttr] = c, h.requestAnimationFrame(A)));
280
- };
281
- A();
282
- }
283
- }, s.prototype.getContentElement = function() {
284
- return this.contentEl;
285
- }, s.prototype.getScrollElement = function() {
286
- return this.contentWrapperEl;
287
- }, s.prototype.removeListeners = function() {
288
- var t = g(this.el);
289
- this.el.removeEventListener("mouseenter", this.onMouseEnter), this.el.removeEventListener("pointerdown", this.onPointerEvent, !0), this.el.removeEventListener("mousemove", this.onMouseMove), this.el.removeEventListener("mouseleave", this.onMouseLeave), this.contentWrapperEl && this.contentWrapperEl.removeEventListener("scroll", this.onScroll), t.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();
290
- }, s.prototype.unMount = function() {
291
- this.removeListeners();
292
- }, s.prototype.isWithinBounds = function(t) {
293
- return this.mouseX >= t.left && this.mouseX <= t.left + t.width && this.mouseY >= t.top && this.mouseY <= t.top + t.height;
294
- }, s.prototype.findChild = function(t, i) {
295
- var e = t.matches || t.webkitMatchesSelector || t.mozMatchesSelector || t.msMatchesSelector;
296
- return Array.prototype.filter.call(t.children, function(r) {
297
- return e.call(r, i);
298
- })[0];
299
- }, s.rtlHelpers = null, s.defaultOptions = {
300
- forceVisible: !1,
301
- clickOnTrack: !0,
302
- scrollbarMinSize: 25,
303
- scrollbarMaxSize: 0,
304
- ariaLabel: "scrollable content",
305
- tabIndex: 0,
306
- classNames: {
307
- contentEl: "simplebar-content",
308
- contentWrapper: "simplebar-content-wrapper",
309
- offset: "simplebar-offset",
310
- mask: "simplebar-mask",
311
- wrapper: "simplebar-wrapper",
312
- placeholder: "simplebar-placeholder",
313
- scrollbar: "simplebar-scrollbar",
314
- track: "simplebar-track",
315
- heightAutoObserverWrapperEl: "simplebar-height-auto-observer-wrapper",
316
- heightAutoObserverEl: "simplebar-height-auto-observer",
317
- visible: "simplebar-visible",
318
- horizontal: "simplebar-horizontal",
319
- vertical: "simplebar-vertical",
320
- hover: "simplebar-hover",
321
- dragging: "simplebar-dragging",
322
- scrolling: "simplebar-scrolling",
323
- scrollable: "simplebar-scrollable",
324
- mouseEntered: "simplebar-mouse-entered"
325
- },
326
- scrollableNode: null,
327
- contentNode: null,
328
- autoHide: !0
329
- }, s.getOptions = $, s.helpers = I, s;
330
- })()
331
- ), m = function() {
332
- return m = Object.assign || function(t) {
333
- for (var i, e = 1, r = arguments.length; e < r; e++) {
334
- i = arguments[e];
335
- for (var l in i) Object.prototype.hasOwnProperty.call(i, l) && (t[l] = i[l]);
336
- }
337
- return t;
338
- }, m.apply(this, arguments);
74
+ var h = i, g = a, _ = o, v = s, y = c, b = l, x = function() {
75
+ function n(i, a) {
76
+ a === void 0 && (a = {});
77
+ var o = this;
78
+ if (this.removePreventClickId = null, this.minScrollbarWidth = 20, this.stopScrollDelay = 175, this.isScrolling = !1, this.isMouseEntering = !1, this.isDragging = !1, this.scrollXTicking = !1, this.scrollYTicking = !1, 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() {
79
+ var e = h(o.el);
80
+ o.scrollXTicking ||= (e.requestAnimationFrame(o.scrollX), !0), o.scrollYTicking ||= (e.requestAnimationFrame(o.scrollY), !0), o.isScrolling || (o.isScrolling = !0, v(o.el, o.classNames.scrolling)), o.showScrollbar("x"), o.showScrollbar("y"), o.onStopScrolling();
81
+ }, this.scrollX = function() {
82
+ o.axis.x.isOverflowing && o.positionScrollbar("x"), o.scrollXTicking = !1;
83
+ }, this.scrollY = function() {
84
+ o.axis.y.isOverflowing && o.positionScrollbar("y"), o.scrollYTicking = !1;
85
+ }, this._onStopScrolling = function() {
86
+ y(o.el, o.classNames.scrolling), o.options.autoHide && (o.hideScrollbar("x"), o.hideScrollbar("y")), o.isScrolling = !1;
87
+ }, this.onMouseEnter = function() {
88
+ o.isMouseEntering ||= (v(o.el, o.classNames.mouseEntered), o.showScrollbar("x"), o.showScrollbar("y"), !0), o.onMouseEntered();
89
+ }, this._onMouseEntered = function() {
90
+ y(o.el, o.classNames.mouseEntered), o.options.autoHide && (o.hideScrollbar("x"), o.hideScrollbar("y")), o.isMouseEntering = !1;
91
+ }, this._onMouseMove = function(e) {
92
+ o.mouseX = e.clientX, o.mouseY = e.clientY, (o.axis.x.isOverflowing || o.axis.x.forceVisible) && o.onMouseMoveForAxis("x"), (o.axis.y.isOverflowing || o.axis.y.forceVisible) && o.onMouseMoveForAxis("y");
93
+ }, this.onMouseLeave = function() {
94
+ o.onMouseMove.cancel(), (o.axis.x.isOverflowing || o.axis.x.forceVisible) && o.onMouseLeaveForAxis("x"), (o.axis.y.isOverflowing || o.axis.y.forceVisible) && o.onMouseLeaveForAxis("y"), o.mouseX = -1, o.mouseY = -1;
95
+ }, this._onWindowResize = function() {
96
+ o.scrollbarWidth = o.getScrollbarWidth(), o.hideNativeScrollbar();
97
+ }, this.onPointerEvent = function(e) {
98
+ if (!(!o.axis.x.track.el || !o.axis.y.track.el || !o.axis.x.scrollbar.el || !o.axis.y.scrollbar.el)) {
99
+ var t, n;
100
+ o.axis.x.track.rect = o.axis.x.track.el.getBoundingClientRect(), o.axis.y.track.rect = o.axis.y.track.el.getBoundingClientRect(), (o.axis.x.isOverflowing || o.axis.x.forceVisible) && (t = o.isWithinBounds(o.axis.x.track.rect)), (o.axis.y.isOverflowing || o.axis.y.forceVisible) && (n = o.isWithinBounds(o.axis.y.track.rect)), (t || n) && (e.stopPropagation(), e.type === "pointerdown" && e.pointerType !== "touch" && (t && (o.axis.x.scrollbar.rect = o.axis.x.scrollbar.el.getBoundingClientRect(), o.isWithinBounds(o.axis.x.scrollbar.rect) ? o.onDragStart(e, "x") : o.onTrackClick(e, "x")), n && (o.axis.y.scrollbar.rect = o.axis.y.scrollbar.el.getBoundingClientRect(), o.isWithinBounds(o.axis.y.scrollbar.rect) ? o.onDragStart(e, "y") : o.onTrackClick(e, "y"))));
101
+ }
102
+ }, this.drag = function(e) {
103
+ if (!(!o.draggedAxis || !o.contentWrapperEl)) {
104
+ var t, r = o.axis[o.draggedAxis].track, i = r.rect?.[o.axis[o.draggedAxis].sizeAttr] ?? 0, a = o.axis[o.draggedAxis].scrollbar, s = o.contentWrapperEl?.[o.axis[o.draggedAxis].scrollSizeAttr] ?? 0, c = parseInt(o.elStyles?.[o.axis[o.draggedAxis].sizeAttr] ?? "0px", 10);
105
+ e.preventDefault(), e.stopPropagation(), t = o.draggedAxis === "y" ? e.pageY : e.pageX;
106
+ var l = t - (r.rect?.[o.axis[o.draggedAxis].offsetAttr] ?? 0) - o.axis[o.draggedAxis].dragOffset;
107
+ l = o.draggedAxis === "x" && o.isRtl ? (r.rect?.[o.axis[o.draggedAxis].sizeAttr] ?? 0) - a.size - l : l;
108
+ var u = l / (i - a.size) * (s - c);
109
+ o.draggedAxis === "x" && o.isRtl && (u = n.getRtlHelpers()?.isScrollingToNegative ? -u : u), o.contentWrapperEl[o.axis[o.draggedAxis].scrollOffsetAttr] = u;
110
+ }
111
+ }, this.onEndDrag = function(e) {
112
+ o.isDragging = !1;
113
+ var t = g(o.el), n = h(o.el);
114
+ e.preventDefault(), e.stopPropagation(), y(o.el, o.classNames.dragging), o.onStopScrolling(), t.removeEventListener("mousemove", o.drag, !0), t.removeEventListener("mouseup", o.onEndDrag, !0), o.removePreventClickId = n.setTimeout(function() {
115
+ t.removeEventListener("click", o.preventClick, !0), t.removeEventListener("dblclick", o.preventClick, !0), o.removePreventClickId = null;
116
+ });
117
+ }, this.preventClick = function(e) {
118
+ e.preventDefault(), e.stopPropagation();
119
+ }, this.el = i, this.options = r(r({}, n.defaultOptions), a), this.classNames = r(r({}, n.defaultOptions.classNames), a.classNames), this.axis = {
120
+ x: {
121
+ scrollOffsetAttr: "scrollLeft",
122
+ sizeAttr: "width",
123
+ scrollSizeAttr: "scrollWidth",
124
+ offsetSizeAttr: "offsetWidth",
125
+ offsetAttr: "left",
126
+ overflowAttr: "overflowX",
127
+ dragOffset: 0,
128
+ isOverflowing: !0,
129
+ forceVisible: !1,
130
+ track: {
131
+ size: null,
132
+ el: null,
133
+ rect: null,
134
+ isVisible: !1
135
+ },
136
+ scrollbar: {
137
+ size: null,
138
+ el: null,
139
+ rect: null,
140
+ isVisible: !1
141
+ }
142
+ },
143
+ y: {
144
+ scrollOffsetAttr: "scrollTop",
145
+ sizeAttr: "height",
146
+ scrollSizeAttr: "scrollHeight",
147
+ offsetSizeAttr: "offsetHeight",
148
+ offsetAttr: "top",
149
+ overflowAttr: "overflowY",
150
+ dragOffset: 0,
151
+ isOverflowing: !0,
152
+ forceVisible: !1,
153
+ track: {
154
+ size: null,
155
+ el: null,
156
+ rect: null,
157
+ isVisible: !1
158
+ },
159
+ scrollbar: {
160
+ size: null,
161
+ el: null,
162
+ rect: null,
163
+ isVisible: !1
164
+ }
165
+ }
166
+ }, typeof this.el != "object" || !this.el.nodeName) throw Error(`Argument passed to SimpleBar must be an HTML element instead of ${this.el}`);
167
+ this.onMouseMove = t(this._onMouseMove, 64), this.onWindowResize = e(this._onWindowResize, 64, { leading: !0 }), this.onStopScrolling = e(this._onStopScrolling, this.stopScrollDelay), this.onMouseEntered = e(this._onMouseEntered, this.stopScrollDelay), this.init();
168
+ }
169
+ return n.getRtlHelpers = function() {
170
+ if (n.rtlHelpers) return n.rtlHelpers;
171
+ var e = document.createElement("div");
172
+ e.innerHTML = "<div class=\"simplebar-dummy-scrollbar-size\"><div></div></div>";
173
+ var t = e.firstElementChild, r = t?.firstElementChild;
174
+ if (!r) return null;
175
+ document.body.appendChild(t), t.scrollLeft = 0;
176
+ var i = n.getOffset(t), a = n.getOffset(r);
177
+ t.scrollLeft = -999;
178
+ var o = n.getOffset(r);
179
+ return document.body.removeChild(t), n.rtlHelpers = {
180
+ isScrollOriginAtZero: i.left !== a.left,
181
+ isScrollingToNegative: a.left !== o.left
182
+ }, n.rtlHelpers;
183
+ }, n.prototype.getScrollbarWidth = function() {
184
+ try {
185
+ return this.contentWrapperEl && getComputedStyle(this.contentWrapperEl, "::-webkit-scrollbar").display === "none" || "scrollbarWidth" in document.documentElement.style || "-ms-overflow-style" in document.documentElement.style ? 0 : m();
186
+ } catch {
187
+ return m();
188
+ }
189
+ }, n.getOffset = function(e) {
190
+ var t = e.getBoundingClientRect(), n = g(e), r = h(e);
191
+ return {
192
+ top: t.top + (r.pageYOffset || n.documentElement.scrollTop),
193
+ left: t.left + (r.pageXOffset || n.documentElement.scrollLeft)
194
+ };
195
+ }, n.prototype.init = function() {
196
+ u && (this.initDOM(), this.rtlHelpers = n.getRtlHelpers(), this.scrollbarWidth = this.getScrollbarWidth(), this.recalculate(), this.initListeners());
197
+ }, n.prototype.initDOM = function() {
198
+ this.wrapperEl = this.el.querySelector(b(this.classNames.wrapper)), this.contentWrapperEl = this.options.scrollableNode || this.el.querySelector(b(this.classNames.contentWrapper)), this.contentEl = this.options.contentNode || this.el.querySelector(b(this.classNames.contentEl)), this.offsetEl = this.el.querySelector(b(this.classNames.offset)), this.maskEl = this.el.querySelector(b(this.classNames.mask)), this.placeholderEl = this.findChild(this.wrapperEl, b(this.classNames.placeholder)), this.heightAutoObserverWrapperEl = this.el.querySelector(b(this.classNames.heightAutoObserverWrapperEl)), this.heightAutoObserverEl = this.el.querySelector(b(this.classNames.heightAutoObserverEl)), this.axis.x.track.el = this.findChild(this.el, `${b(this.classNames.track)}${b(this.classNames.horizontal)}`), this.axis.y.track.el = this.findChild(this.el, `${b(this.classNames.track)}${b(this.classNames.vertical)}`), this.axis.x.scrollbar.el = this.axis.x.track.el?.querySelector(b(this.classNames.scrollbar)) || null, this.axis.y.scrollbar.el = this.axis.y.track.el?.querySelector(b(this.classNames.scrollbar)) || null, this.options.autoHide || (v(this.axis.x.scrollbar.el, this.classNames.visible), v(this.axis.y.scrollbar.el, this.classNames.visible));
199
+ }, n.prototype.initListeners = function() {
200
+ var e = this, t, n = h(this.el);
201
+ if (this.el.addEventListener("mouseenter", this.onMouseEnter), this.el.addEventListener("pointerdown", this.onPointerEvent, !0), this.el.addEventListener("mousemove", this.onMouseMove), this.el.addEventListener("mouseleave", this.onMouseLeave), (t = this.contentWrapperEl) == null || t.addEventListener("scroll", this.onScroll), n.addEventListener("resize", this.onWindowResize), this.contentEl) {
202
+ if (window.ResizeObserver) {
203
+ var r = !1;
204
+ this.resizeObserver = new (n.ResizeObserver || ResizeObserver)(function() {
205
+ r && n.requestAnimationFrame(function() {
206
+ e.recalculate();
207
+ });
208
+ }), this.resizeObserver.observe(this.el), this.resizeObserver.observe(this.contentEl), n.requestAnimationFrame(function() {
209
+ r = !0;
210
+ });
211
+ }
212
+ this.mutationObserver = new n.MutationObserver(function() {
213
+ n.requestAnimationFrame(function() {
214
+ e.recalculate();
215
+ });
216
+ }), this.mutationObserver.observe(this.contentEl, {
217
+ childList: !0,
218
+ subtree: !0,
219
+ characterData: !0
220
+ });
221
+ }
222
+ }, n.prototype.recalculate = function() {
223
+ if (!(!this.heightAutoObserverEl || !this.contentEl || !this.contentWrapperEl || !this.wrapperEl || !this.placeholderEl)) {
224
+ this.elStyles = h(this.el).getComputedStyle(this.el), this.isRtl = this.elStyles.direction === "rtl";
225
+ var e = this.contentEl.offsetWidth, t = this.heightAutoObserverEl.offsetHeight <= 1, n = this.heightAutoObserverEl.offsetWidth <= 1 || e > 0, r = this.contentWrapperEl.offsetWidth, i = this.elStyles.overflowX, a = this.elStyles.overflowY;
226
+ this.contentEl.style.padding = `${this.elStyles.paddingTop} ${this.elStyles.paddingRight} ${this.elStyles.paddingBottom} ${this.elStyles.paddingLeft}`, this.wrapperEl.style.margin = `-${this.elStyles.paddingTop} -${this.elStyles.paddingRight} -${this.elStyles.paddingBottom} -${this.elStyles.paddingLeft}`;
227
+ var o = this.contentEl.scrollHeight, s = this.contentEl.scrollWidth;
228
+ this.contentWrapperEl.style.height = t ? "auto" : "100%", this.placeholderEl.style.width = n ? `${e || s}px` : "auto", this.placeholderEl.style.height = `${o}px`;
229
+ var c = this.contentWrapperEl.offsetHeight;
230
+ this.axis.x.isOverflowing = e !== 0 && s > e, this.axis.y.isOverflowing = o > c, this.axis.x.isOverflowing = i === "hidden" ? !1 : this.axis.x.isOverflowing, this.axis.y.isOverflowing = a === "hidden" ? !1 : this.axis.y.isOverflowing, this.axis.x.forceVisible = this.options.forceVisible === "x" || this.options.forceVisible === !0, this.axis.y.forceVisible = this.options.forceVisible === "y" || this.options.forceVisible === !0, this.hideNativeScrollbar();
231
+ var l = this.axis.x.isOverflowing ? this.scrollbarWidth : 0, u = this.axis.y.isOverflowing ? this.scrollbarWidth : 0;
232
+ this.axis.x.isOverflowing = this.axis.x.isOverflowing && s > r - u, this.axis.y.isOverflowing = this.axis.y.isOverflowing && o > c - l, 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 = `${this.axis.x.scrollbar.size}px`), this.axis.y.scrollbar.el && (this.axis.y.scrollbar.el.style.height = `${this.axis.y.scrollbar.size}px`), this.positionScrollbar("x"), this.positionScrollbar("y"), this.toggleTrackVisibility("x"), this.toggleTrackVisibility("y");
233
+ }
234
+ }, n.prototype.getScrollbarSize = function(e) {
235
+ if (e === void 0 && (e = "y"), !this.axis[e].isOverflowing || !this.contentEl) return 0;
236
+ var t = this.contentEl[this.axis[e].scrollSizeAttr], n = this.axis[e].track.el?.[this.axis[e].offsetSizeAttr] ?? 0, r = n / t, i = Math.max(~~(r * n), this.options.scrollbarMinSize);
237
+ return this.options.scrollbarMaxSize && (i = Math.min(i, this.options.scrollbarMaxSize)), i;
238
+ }, n.prototype.positionScrollbar = function(e) {
239
+ e === void 0 && (e = "y");
240
+ var t = this.axis[e].scrollbar;
241
+ if (!(!this.axis[e].isOverflowing || !this.contentWrapperEl || !t.el || !this.elStyles)) {
242
+ var r = this.contentWrapperEl[this.axis[e].scrollSizeAttr], i = this.axis[e].track.el?.[this.axis[e].offsetSizeAttr] || 0, a = parseInt(this.elStyles[this.axis[e].sizeAttr], 10), o = this.contentWrapperEl[this.axis[e].scrollOffsetAttr];
243
+ o = e === "x" && this.isRtl && n.getRtlHelpers()?.isScrollOriginAtZero ? -o : o, e === "x" && this.isRtl && (o = n.getRtlHelpers()?.isScrollingToNegative ? o : -o);
244
+ var s = o / (r - a), c = ~~((i - t.size) * s);
245
+ c = e === "x" && this.isRtl ? -c + (i - t.size) : c, t.el.style.transform = e === "x" ? `translate3d(${c}px, 0, 0)` : `translate3d(0, ${c}px, 0)`;
246
+ }
247
+ }, n.prototype.toggleTrackVisibility = function(e) {
248
+ e === void 0 && (e = "y");
249
+ var t = this.axis[e].track.el, n = this.axis[e].scrollbar.el;
250
+ !t || !n || !this.contentWrapperEl || (this.axis[e].isOverflowing || this.axis[e].forceVisible ? (t.style.visibility = "visible", this.contentWrapperEl.style[this.axis[e].overflowAttr] = "scroll", this.el.classList.add(`${this.classNames.scrollable}-${e}`)) : (t.style.visibility = "hidden", this.contentWrapperEl.style[this.axis[e].overflowAttr] = "hidden", this.el.classList.remove(`${this.classNames.scrollable}-${e}`)), this.axis[e].isOverflowing ? n.style.display = "block" : n.style.display = "none");
251
+ }, n.prototype.showScrollbar = function(e) {
252
+ e === void 0 && (e = "y"), this.axis[e].isOverflowing && !this.axis[e].scrollbar.isVisible && (v(this.axis[e].scrollbar.el, this.classNames.visible), this.axis[e].scrollbar.isVisible = !0);
253
+ }, n.prototype.hideScrollbar = function(e) {
254
+ e === void 0 && (e = "y"), !this.isDragging && this.axis[e].isOverflowing && this.axis[e].scrollbar.isVisible && (y(this.axis[e].scrollbar.el, this.classNames.visible), this.axis[e].scrollbar.isVisible = !1);
255
+ }, n.prototype.hideNativeScrollbar = function() {
256
+ this.offsetEl && (this.offsetEl.style[this.isRtl ? "left" : "right"] = this.axis.y.isOverflowing || this.axis.y.forceVisible ? `-${this.scrollbarWidth}px` : "0px", this.offsetEl.style.bottom = this.axis.x.isOverflowing || this.axis.x.forceVisible ? `-${this.scrollbarWidth}px` : "0px");
257
+ }, n.prototype.onMouseMoveForAxis = function(e) {
258
+ e === void 0 && (e = "y");
259
+ var t = this.axis[e];
260
+ !t.track.el || !t.scrollbar.el || (t.track.rect = t.track.el.getBoundingClientRect(), t.scrollbar.rect = t.scrollbar.el.getBoundingClientRect(), this.isWithinBounds(t.track.rect) ? (this.showScrollbar(e), v(t.track.el, this.classNames.hover), this.isWithinBounds(t.scrollbar.rect) ? v(t.scrollbar.el, this.classNames.hover) : y(t.scrollbar.el, this.classNames.hover)) : (y(t.track.el, this.classNames.hover), this.options.autoHide && this.hideScrollbar(e)));
261
+ }, n.prototype.onMouseLeaveForAxis = function(e) {
262
+ e === void 0 && (e = "y"), y(this.axis[e].track.el, this.classNames.hover), y(this.axis[e].scrollbar.el, this.classNames.hover), this.options.autoHide && this.hideScrollbar(e);
263
+ }, n.prototype.onDragStart = function(e, t) {
264
+ t === void 0 && (t = "y"), this.isDragging = !0;
265
+ var n = g(this.el), r = h(this.el), i = this.axis[t].scrollbar, a = t === "y" ? e.pageY : e.pageX;
266
+ this.axis[t].dragOffset = a - (i.rect?.[this.axis[t].offsetAttr] || 0), this.draggedAxis = t, v(this.el, this.classNames.dragging), n.addEventListener("mousemove", this.drag, !0), n.addEventListener("mouseup", this.onEndDrag, !0), this.removePreventClickId === null ? (n.addEventListener("click", this.preventClick, !0), n.addEventListener("dblclick", this.preventClick, !0)) : (r.clearTimeout(this.removePreventClickId), this.removePreventClickId = null);
267
+ }, n.prototype.onTrackClick = function(e, t) {
268
+ var n = this;
269
+ t === void 0 && (t = "y");
270
+ var r = this.axis[t];
271
+ if (!(!this.options.clickOnTrack || !r.scrollbar.el || !this.contentWrapperEl)) {
272
+ e.preventDefault();
273
+ var i = h(this.el);
274
+ this.axis[t].scrollbar.rect = r.scrollbar.el.getBoundingClientRect();
275
+ var a = this.axis[t].scrollbar.rect?.[this.axis[t].offsetAttr] ?? 0, o = parseInt(this.elStyles?.[this.axis[t].sizeAttr] ?? "0px", 10), s = this.contentWrapperEl[this.axis[t].scrollOffsetAttr], c = (t === "y" ? this.mouseY - a : this.mouseX - a) < 0 ? -1 : 1, l = c === -1 ? s - o : s + o, u = 40, d = function() {
276
+ n.contentWrapperEl && (c === -1 ? s > l && (s -= u, n.contentWrapperEl[n.axis[t].scrollOffsetAttr] = s, i.requestAnimationFrame(d)) : s < l && (s += u, n.contentWrapperEl[n.axis[t].scrollOffsetAttr] = s, i.requestAnimationFrame(d)));
277
+ };
278
+ d();
279
+ }
280
+ }, n.prototype.getContentElement = function() {
281
+ return this.contentEl;
282
+ }, n.prototype.getScrollElement = function() {
283
+ return this.contentWrapperEl;
284
+ }, n.prototype.removeListeners = function() {
285
+ var e = h(this.el);
286
+ this.el.removeEventListener("mouseenter", this.onMouseEnter), this.el.removeEventListener("pointerdown", this.onPointerEvent, !0), this.el.removeEventListener("mousemove", this.onMouseMove), this.el.removeEventListener("mouseleave", this.onMouseLeave), this.contentWrapperEl && this.contentWrapperEl.removeEventListener("scroll", this.onScroll), e.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();
287
+ }, n.prototype.unMount = function() {
288
+ this.removeListeners();
289
+ }, n.prototype.isWithinBounds = function(e) {
290
+ return this.mouseX >= e.left && this.mouseX <= e.left + e.width && this.mouseY >= e.top && this.mouseY <= e.top + e.height;
291
+ }, n.prototype.findChild = function(e, t) {
292
+ var n = e.matches || e.webkitMatchesSelector || e.mozMatchesSelector || e.msMatchesSelector;
293
+ return Array.prototype.filter.call(e.children, function(e) {
294
+ return n.call(e, t);
295
+ })[0];
296
+ }, n.rtlHelpers = null, n.defaultOptions = {
297
+ forceVisible: !1,
298
+ clickOnTrack: !0,
299
+ scrollbarMinSize: 25,
300
+ scrollbarMaxSize: 0,
301
+ ariaLabel: "scrollable content",
302
+ tabIndex: 0,
303
+ classNames: {
304
+ contentEl: "simplebar-content",
305
+ contentWrapper: "simplebar-content-wrapper",
306
+ offset: "simplebar-offset",
307
+ mask: "simplebar-mask",
308
+ wrapper: "simplebar-wrapper",
309
+ placeholder: "simplebar-placeholder",
310
+ scrollbar: "simplebar-scrollbar",
311
+ track: "simplebar-track",
312
+ heightAutoObserverWrapperEl: "simplebar-height-auto-observer-wrapper",
313
+ heightAutoObserverEl: "simplebar-height-auto-observer",
314
+ visible: "simplebar-visible",
315
+ horizontal: "simplebar-horizontal",
316
+ vertical: "simplebar-vertical",
317
+ hover: "simplebar-hover",
318
+ dragging: "simplebar-dragging",
319
+ scrolling: "simplebar-scrolling",
320
+ scrollable: "simplebar-scrollable",
321
+ mouseEntered: "simplebar-mouse-entered"
322
+ },
323
+ scrollableNode: null,
324
+ contentNode: null,
325
+ autoHide: !0
326
+ }, n.getOptions = _, n.helpers = d, n;
327
+ }(), S = function() {
328
+ return S = Object.assign || function(e) {
329
+ for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
330
+ return e;
331
+ }, S.apply(this, arguments);
339
332
  };
340
- function Q(s, t) {
341
- var i = {};
342
- for (var e in s) Object.prototype.hasOwnProperty.call(s, e) && t.indexOf(e) < 0 && (i[e] = s[e]);
343
- if (s != null && typeof Object.getOwnPropertySymbols == "function")
344
- for (var r = 0, e = Object.getOwnPropertySymbols(s); r < e.length; r++)
345
- t.indexOf(e[r]) < 0 && Object.prototype.propertyIsEnumerable.call(s, e[r]) && (i[e[r]] = s[e[r]]);
346
- return i;
333
+ function C(e, t) {
334
+ var n = {};
335
+ for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
336
+ if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++) t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]);
337
+ return n;
347
338
  }
348
- var U = f.forwardRef(function(s, t) {
349
- var i = s.children, e = s.scrollableNodeProps, r = e === void 0 ? {} : e, l = Q(s, ["children", "scrollableNodeProps"]), o = f.useRef(), a = f.useRef(), u = f.useRef(), h = {}, v = {};
350
- Object.keys(l).forEach(function(c) {
351
- Object.prototype.hasOwnProperty.call(k.defaultOptions, c) ? h[c] = l[c] : v[c] = l[c];
352
- });
353
- var n = m(m({}, k.defaultOptions.classNames), h.classNames), p = m(m({}, r), { className: "".concat(n.contentWrapper).concat(r.className ? " ".concat(r.className) : ""), tabIndex: h.tabIndex || k.defaultOptions.tabIndex, role: "region", "aria-label": h.ariaLabel || k.defaultOptions.ariaLabel });
354
- return f.useEffect(function() {
355
- var c;
356
- return a.current = p.ref ? p.ref.current : a.current, o.current && (c = new k(o.current, m(m(m({}, h), a.current && {
357
- scrollableNode: a.current
358
- }), u.current && {
359
- contentNode: u.current
360
- })), typeof t == "function" ? t(c) : t && (t.current = c)), function() {
361
- c?.unMount(), c = null, typeof t == "function" && t(null);
362
- };
363
- }, []), f.createElement(
364
- "div",
365
- m({ "data-simplebar": "init", ref: o }, v),
366
- f.createElement(
367
- "div",
368
- { className: n.wrapper },
369
- f.createElement(
370
- "div",
371
- { className: n.heightAutoObserverWrapperEl },
372
- f.createElement("div", { className: n.heightAutoObserverEl })
373
- ),
374
- f.createElement(
375
- "div",
376
- { className: n.mask },
377
- f.createElement("div", { className: n.offset }, typeof i == "function" ? i({
378
- scrollableNodeRef: a,
379
- scrollableNodeProps: m(m({}, p), { ref: a }),
380
- contentNodeRef: u,
381
- contentNodeProps: {
382
- className: n.contentEl,
383
- ref: u
384
- }
385
- }) : f.createElement(
386
- "div",
387
- m({}, p),
388
- f.createElement("div", { className: n.contentEl }, i)
389
- ))
390
- ),
391
- f.createElement("div", { className: n.placeholder })
392
- ),
393
- f.createElement(
394
- "div",
395
- { className: "".concat(n.track, " ").concat(n.horizontal) },
396
- f.createElement("div", { className: n.scrollbar })
397
- ),
398
- f.createElement(
399
- "div",
400
- { className: "".concat(n.track, " ").concat(n.vertical) },
401
- f.createElement("div", { className: n.scrollbar })
402
- )
403
- );
339
+ var w = n.forwardRef(function(e, t) {
340
+ var r = e.children, i = e.scrollableNodeProps, a = i === void 0 ? {} : i, o = C(e, ["children", "scrollableNodeProps"]), s = n.useRef(), c = n.useRef(), l = n.useRef(), u = {}, d = {};
341
+ Object.keys(o).forEach(function(e) {
342
+ Object.prototype.hasOwnProperty.call(x.defaultOptions, e) ? u[e] = o[e] : d[e] = o[e];
343
+ });
344
+ var f = S(S({}, x.defaultOptions.classNames), u.classNames), p = S(S({}, a), {
345
+ className: `${f.contentWrapper}${a.className ? ` ${a.className}` : ""}`,
346
+ tabIndex: u.tabIndex || x.defaultOptions.tabIndex,
347
+ role: "region",
348
+ "aria-label": u.ariaLabel || x.defaultOptions.ariaLabel
349
+ });
350
+ return n.useEffect(function() {
351
+ var e;
352
+ return c.current = p.ref ? p.ref.current : c.current, s.current && (e = new x(s.current, S(S(S({}, u), c.current && { scrollableNode: c.current }), l.current && { contentNode: l.current })), typeof t == "function" ? t(e) : t && (t.current = e)), function() {
353
+ e?.unMount(), e = null, typeof t == "function" && t(null);
354
+ };
355
+ }, []), n.createElement("div", S({
356
+ "data-simplebar": "init",
357
+ ref: s
358
+ }, d), n.createElement("div", { className: f.wrapper }, n.createElement("div", { className: f.heightAutoObserverWrapperEl }, n.createElement("div", { className: f.heightAutoObserverEl })), n.createElement("div", { className: f.mask }, n.createElement("div", { className: f.offset }, typeof r == "function" ? r({
359
+ scrollableNodeRef: c,
360
+ scrollableNodeProps: S(S({}, p), { ref: c }),
361
+ contentNodeRef: l,
362
+ contentNodeProps: {
363
+ className: f.contentEl,
364
+ ref: l
365
+ }
366
+ }) : n.createElement("div", S({}, p), n.createElement("div", { className: f.contentEl }, r)))), n.createElement("div", { className: f.placeholder })), n.createElement("div", { className: `${f.track} ${f.horizontal}` }, n.createElement("div", { className: f.scrollbar })), n.createElement("div", { className: `${f.track} ${f.vertical}` }, n.createElement("div", { className: f.scrollbar })));
404
367
  });
405
- U.displayName = "SimpleBar";
406
- export {
407
- U as S
408
- };
368
+ w.displayName = "SimpleBar";
369
+ //#endregion
370
+ export { w as t };