diff --git a/packages/overlayscrollbars/dist/browser/overlayscrollbars.browser.es5.js b/packages/overlayscrollbars/dist/browser/overlayscrollbars.browser.es5.js
index ba08eaf..0d8a4c1 100644
--- a/packages/overlayscrollbars/dist/browser/overlayscrollbars.browser.es5.js
+++ b/packages/overlayscrollbars/dist/browser/overlayscrollbars.browser.es5.js
@@ -31,8 +31,8 @@ var OverlayScrollbars = function(r) {
var t = e ? "" : {};
if (r) {
var i = window.getComputedStyle(r, null);
- t = e ? Pr(r, i, a) : a.reduce((function(a, e) {
- a[e] = Pr(r, i, e);
+ t = e ? Tr(r, i, a) : a.reduce((function(a, e) {
+ a[e] = Tr(r, i, e);
return a;
}), t);
}
@@ -193,7 +193,7 @@ var OverlayScrollbars = function(r) {
}));
return r;
};
- var P = function isEmptyObject(r) {
+ var T = function isEmptyObject(r) {
for (var a in r) {
return false;
}
@@ -205,41 +205,41 @@ var OverlayScrollbars = function(r) {
}
e && (l(n) || f(n)) && (e[r] = n);
};
- var L = function attr(r, a, e) {
+ var P = function attr(r, a, e) {
if (v(e)) {
return r ? r.getAttribute(a) : null;
}
r && r.setAttribute(a, e);
};
- var T = function attrClass(r, a, e, n) {
+ var L = function attrClass(r, a, e, n) {
if (e) {
- var t = L(r, a) || "";
+ var t = P(r, a) || "";
var i = new Set(t.split(" "));
i[n ? "add" : "delete"](e);
- L(r, a, S(i).join(" ").trim());
+ P(r, a, S(i).join(" ").trim());
}
};
var H = function hasAttrClass(r, a, e) {
- var n = L(r, a) || "";
+ var n = P(r, a) || "";
var t = new Set(n.split(" "));
return t.has(e);
};
- var D = function removeAttr(r, a) {
+ var M = function removeAttr(r, a) {
r && r.removeAttribute(a);
};
- var M = function scrollLeft(r, a) {
+ var D = function scrollLeft(r, a) {
return z("scrollLeft", 0, r, a);
};
var R = function scrollTop(r, a) {
return z("scrollTop", 0, r, a);
};
var I = Element.prototype;
- var V = function find(r, a) {
+ var k = function find(r, a) {
var e = [];
var n = a ? b(a) ? a : null : document;
return n ? y(e, n.querySelectorAll(r)) : e;
};
- var k = function findFirst(r, a) {
+ var V = function findFirst(r, a) {
var e = a ? b(a) ? a : null : document;
return e ? e.querySelector(r) : null;
};
@@ -273,7 +273,7 @@ var OverlayScrollbars = function(r) {
};
var U = function liesBetween(r, a, e) {
var n = r && q(r, a);
- var t = r && k(e, n);
+ var t = r && V(e, n);
var i = q(t, a) === n;
return n && t ? n === r || t === r || i && q(q(r, e), a) !== n : false;
};
@@ -326,7 +326,7 @@ var OverlayScrollbars = function(r) {
var Z = function createDiv(r) {
var a = document.createElement("div");
if (r) {
- L(a, "class", r);
+ P(a, "class", r);
}
return a;
};
@@ -513,7 +513,7 @@ var OverlayScrollbars = function(r) {
var Ar = function adaptCSSVal(r, a) {
return !xr[r.toLowerCase()] && f(a) ? a + "px" : a;
};
- var Pr = function getCSSVal(r, a, e) {
+ var Tr = function getCSSVal(r, a, e) {
return null != a ? a[e] || a.getPropertyValue(e) : r.style[e];
};
var zr = function setCSSVal(r, a, e) {
@@ -526,10 +526,10 @@ var OverlayScrollbars = function(r) {
}
} catch (t) {}
};
- var Lr = function directionIsRTL(r) {
+ var Pr = function directionIsRTL(r) {
return "rtl" === style(r, "direction");
};
- var Tr = function topRightBottomLeft(r, a, e) {
+ var Lr = function topRightBottomLeft(r, a, e) {
var n = a ? a + "-" : "";
var t = e ? "-" + e : "";
var i = n + "top" + t;
@@ -545,11 +545,11 @@ var OverlayScrollbars = function(r) {
};
};
var Hr = Math.round;
- var Dr = {
+ var Mr = {
w: 0,
h: 0
};
- var Mr = function windowSize() {
+ var Dr = function windowSize() {
return {
w: window.innerWidth,
h: window.innerHeight
@@ -559,21 +559,21 @@ var OverlayScrollbars = function(r) {
return r ? {
w: r.offsetWidth,
h: r.offsetHeight
- } : Dr;
+ } : Mr;
};
var Ir = function clientSize(r) {
return r ? {
w: r.clientWidth,
h: r.clientHeight
- } : Dr;
+ } : Mr;
};
- var Vr = function scrollSize(r) {
+ var kr = function scrollSize(r) {
return r ? {
w: r.scrollWidth,
h: r.scrollHeight
- } : Dr;
+ } : Mr;
};
- var kr = function fractionalSize(r) {
+ var Vr = function fractionalSize(r) {
var a = parseFloat(style(r, "height")) || 0;
var e = parseFloat(style(r, "width")) || 0;
return {
@@ -771,23 +771,23 @@ var OverlayScrollbars = function(r) {
var xa = Sa + "-vertical";
var Ea = Sa + "-track";
var Aa = Sa + "-handle";
- var Pa = Sa + "-visible";
+ var Ta = Sa + "-visible";
var za = Sa + "-cornerless";
- var La = Sa + "-transitionless";
- var Ta = Sa + "-interaction";
+ var Pa = Sa + "-transitionless";
+ var La = Sa + "-interaction";
var Ha = Sa + "-unusable";
- var Da = Sa + "-auto-hidden";
- var Ma = Sa + "-wheel";
+ var Ma = Sa + "-auto-hidden";
+ var Da = Sa + "-wheel";
var Ra = Ea + "-interactive";
var Ia = Aa + "-interactive";
- var Va = {};
- var ka = function getPlugins() {
- return Va;
+ var ka = {};
+ var Va = function getPlugins() {
+ return ka;
};
var ja = function addPlugin(r) {
each(d(r) ? r : [ r ], (function(r) {
var a = E(r)[0];
- Va[a] = r[a];
+ ka[a] = r[a];
}));
};
var Ba = {
@@ -836,7 +836,7 @@ var OverlayScrollbars = function(r) {
t[o] = w;
i[o] = b;
each([ i, t ], (function(r) {
- if (P(r[o])) {
+ if (T(r[o])) {
delete r[o];
}
}));
@@ -912,7 +912,7 @@ var OverlayScrollbars = function(r) {
/* @__PURE__ */ (function() {
var r;
return r = {}, r[Ka] = {
- P: function _(r, a) {
+ T: function _(r, a) {
var e = Na(Ja, r, a), n = e[0], t = e[1];
return Fa({}, t, n);
}
@@ -924,7 +924,7 @@ var OverlayScrollbars = function(r) {
var ee = /* @__PURE__ */ function() {
var r;
return r = {}, r[ae] = {
- P: function _(r, a, e) {
+ T: function _(r, a, e) {
var n = $('
');
Y(r, n);
pr(r, wa);
@@ -937,9 +937,9 @@ var OverlayScrollbars = function(r) {
var l = false;
var c;
var s = function reset() {
- M(v, Qa);
+ D(v, Qa);
R(v, Qa);
- M(i, Qa);
+ D(i, Qa);
R(i, Qa);
};
var d = function onResized(r) {
@@ -989,21 +989,21 @@ var OverlayScrollbars = function(r) {
var fe = /* @__PURE__ */ function() {
var r;
return r = {}, r[ue] = {
- L: function _createUniqueViewportArrangeElement(r) {
- var a = r.T, e = r.H, n = r.D;
+ P: function _createUniqueViewportArrangeElement(r) {
+ var a = r.L, e = r.H, n = r.M;
var t = !n && !a && (e.x || e.y);
var i = t ? document.createElement("style") : false;
if (i) {
- L(i, "id", ca + "-" + ne);
+ P(i, "id", ca + "-" + ne);
ne++;
}
return i;
},
- M: function _overflowUpdateSegment(r, a, e, n, t, i, v) {
+ D: function _overflowUpdateSegment(r, a, e, n, t, i, v) {
var o = function arrangeViewport(a, i, v, o) {
if (r) {
var u = t(), f = u.R;
- var l = a.I, c = a.V;
+ var l = a.I, c = a.k;
var s = c.x, d = c.y;
var h = l.x, g = l.y;
var p = o ? "paddingRight" : "paddingLeft";
@@ -1021,7 +1021,7 @@ var OverlayScrollbars = function(r) {
var O = C.cssRules;
if (O) {
if (!O.length) {
- C.insertRule("#" + L(n, "id") + " + ." + ca + "::before {}", 0);
+ C.insertRule("#" + P(n, "id") + " + ." + ca + "::before {}", 0);
}
var x = O[0].style;
x.width = S.w;
@@ -1041,7 +1041,7 @@ var OverlayScrollbars = function(r) {
if (r) {
var f = u || i(n);
var l = t(), c = l.R;
- var s = f.V;
+ var s = f.k;
var d = s.x, h = s.y;
var g = {};
var p = function assignProps(r) {
@@ -1071,14 +1071,14 @@ var OverlayScrollbars = function(r) {
};
return [ o, u ];
},
- k: function _envWindowZoom() {
+ V: function _envWindowZoom() {
var r = {
w: 0,
h: 0
};
var a = 0;
return function(e, n, t) {
- var i = Mr();
+ var i = Dr();
var v = {
w: i.w - r.w,
h: i.h - r.h
@@ -1117,7 +1117,7 @@ var OverlayScrollbars = function(r) {
Y(r, a);
var t = Ir(a);
var i = Rr(a);
- var v = kr(e);
+ var v = Vr(e);
n && X(a);
return {
x: i.h - t.h + v.h,
@@ -1140,10 +1140,10 @@ var OverlayScrollbars = function(r) {
overflowY: e,
direction: "rtl"
});
- M(r, 0);
+ D(r, 0);
var n = Xr(r);
var t = Xr(a);
- M(r, -999);
+ D(r, -999);
var i = Xr(a);
return {
i: n.x === t.x,
@@ -1200,8 +1200,8 @@ var OverlayScrollbars = function(r) {
var b = {
j: d,
H: g,
- T: h,
- D: "-1" === style(t, "zIndex"),
+ L: h,
+ M: "-1" === style(t, "zIndex"),
B: de(t, i),
F: he(t, i),
q: function _addListener(r) {
@@ -1218,13 +1218,13 @@ var OverlayScrollbars = function(r) {
G: A({}, p),
X: A({}, w)
};
- D(t, "style");
+ M(t, "style");
X(t);
if (!h && (!g.x || !g.y)) {
var m;
window.addEventListener("resize", (function() {
- var r = ka()[ue];
- m = m || r && r.k();
+ var r = Va()[ue];
+ m = m || r && r.V();
m && m(b, l, u.bind(0, "_"));
}));
}
@@ -1252,7 +1252,7 @@ var OverlayScrollbars = function(r) {
var me = function cancelInitialization(r, a) {
var e = r || {}, n = e.nativeScrollbarsOverlaid, t = e.body;
var i = a.Z;
- var u = pe(), f = u.U, l = u.H, c = u.T;
+ var u = pe(), f = u.U, l = u.H, c = u.L;
var s = f().cancel, d = s.nativeScrollbarsOverlaid, h = s.body;
var g = null != n ? n : d;
var p = v(t) ? h : t;
@@ -1288,21 +1288,21 @@ var OverlayScrollbars = function(r) {
a = A({}, a, r);
} ];
};
- var Pe = "tabindex";
+ var Te = "tabindex";
var ze = Z.bind(0, "");
- var Le = function unwrap(r) {
+ var Pe = function unwrap(r) {
Y(F(r), B(r));
X(r);
};
- var Te = function addDataAttrHost(r, a) {
- L(r, na, a);
- return D.bind(0, r, na);
+ var Le = function addDataAttrHost(r, a) {
+ P(r, na, a);
+ return M.bind(0, r, na);
};
var He = function createStructureSetupElements(r) {
var a = pe();
- var e = a.U, n = a.T;
- var t = ka()[ue];
- var i = t && t.L;
+ var e = a.U, n = a.L;
+ var t = Va()[ue];
+ var i = t && t.P;
var v = e(), o = v.elements;
var u = o.host, f = o.viewport, l = o.padding, c = o.content;
var s = w(r);
@@ -1311,36 +1311,36 @@ var OverlayScrollbars = function(r) {
var g = h || {}, p = g.host, b = g.padding, S = g.viewport, C = g.content;
var x = s ? r : d.target;
var A = j(x, "textarea");
- var P = x.ownerDocument;
- var z = x === P.body;
- var M = P.defaultView;
+ var T = x.ownerDocument;
+ var z = x === T.body;
+ var D = T.defaultView;
var R = we.bind(0, [ x ]);
var I = be.bind(0, [ x ]);
- var V = R(ze, f, S);
- var k = V === x;
- var q = k && z;
- var U = P.activeElement;
- var N = !k && M.top === M && U === x;
+ var k = R(ze, f, S);
+ var V = k === x;
+ var q = V && z;
+ var U = T.activeElement;
+ var N = !V && D.top === D && U === x;
var Z = {
$: x,
J: A ? R(ze, u, p) : x,
- K: V,
- rr: !k && I(ze, l, b),
- ar: !k && I(ze, c, C),
- er: !k && !n && i && i(a),
- nr: q ? P.documentElement : V,
- tr: q ? P : V,
- ir: M,
- vr: P,
+ K: k,
+ rr: !V && I(ze, l, b),
+ ar: !V && I(ze, c, C),
+ er: !V && !n && i && i(a),
+ nr: q ? T.documentElement : k,
+ tr: q ? T : k,
+ ir: D,
+ vr: T,
ur: A,
Z: z,
lr: s,
- cr: k,
+ cr: V,
sr: function _viewportHasClass(r, a) {
- return k ? H(V, na, a) : hr(V, r);
+ return V ? H(k, na, a) : hr(k, r);
},
dr: function _viewportAddRemoveClass(r, a, e) {
- return k ? T(V, na, a, e) : (e ? pr : gr)(V, r);
+ return V ? L(k, na, a, e) : (e ? pr : gr)(k, r);
}
};
var $ = E(Z).reduce((function(r, a) {
@@ -1358,9 +1358,9 @@ var OverlayScrollbars = function(r) {
})));
var or = er || ar;
var ur = function appendElements() {
- var r = Te(Q, k ? "viewport" : "host");
+ var r = Le(Q, V ? "viewport" : "host");
var a = pr(rr, fa);
- var e = pr(ar, !k && la);
+ var e = pr(ar, !V && la);
var t = pr(er, sa);
var i = z ? pr(F(x), da) : Sr;
if (ir) {
@@ -1372,27 +1372,27 @@ var OverlayScrollbars = function(r) {
}
Y(or, vr);
Y(Q, rr);
- Y(rr || Q, !k && ar);
+ Y(rr || Q, !V && ar);
Y(ar, er);
y(tr, (function() {
i();
r();
- D(ar, ta);
- D(ar, ia);
+ M(ar, ta);
+ M(ar, ia);
if (J(er)) {
- Le(er);
+ Pe(er);
}
if (J(ar)) {
- Le(ar);
+ Pe(ar);
}
if (J(rr)) {
- Le(rr);
+ Pe(rr);
}
a();
e();
t();
}));
- if (n && !k) {
+ if (n && !V) {
y(tr, gr.bind(0, ar, da));
}
if (nr) {
@@ -1400,11 +1400,11 @@ var OverlayScrollbars = function(r) {
y(tr, X.bind(0, nr));
}
if (N) {
- var v = L(ar, Pe);
- L(ar, Pe, "-1");
+ var v = P(ar, Te);
+ P(ar, Te, "-1");
ar.focus();
- var o = Nr(P, "pointerdown keydown", (function() {
- v ? L(ar, Pe, v) : D(ar, Pe);
+ var o = Nr(T, "pointerdown keydown", (function() {
+ v ? P(ar, Te, v) : M(ar, Te);
o();
}));
} else if (U && U.focus) {
@@ -1414,7 +1414,7 @@ var OverlayScrollbars = function(r) {
};
return [ Z, ur, O.bind(0, tr) ];
};
- var De = function createTrinsicUpdateSegment(r, a) {
+ var Me = function createTrinsicUpdateSegment(r, a) {
var e = r.ar;
var n = a[0];
return function(r) {
@@ -1433,16 +1433,16 @@ var OverlayScrollbars = function(r) {
};
};
};
- var Me = function createPaddingUpdateSegment(r, e) {
+ var De = function createPaddingUpdateSegment(r, e) {
var n = e[0], t = e[1];
var i = r.J, v = r.rr, o = r.K, u = r.cr;
var f = a({
u: mr,
- o: Tr()
- }, Tr.bind(0, i, "padding", "")), l = f[0], c = f[1];
+ o: Lr()
+ }, Lr.bind(0, i, "padding", "")), l = f[0], c = f[1];
return function(r, a, e) {
var i = c(e), f = i[0], s = i[1];
- var d = pe(), h = d.T, g = d.F;
+ var d = pe(), h = d.L, g = d.F;
var p = n(), w = p.wr;
var b = r.pr, m = r._r, y = r.br;
var S = a("paddingAbsolute"), C = S[0], O = S[1];
@@ -1452,43 +1452,43 @@ var OverlayScrollbars = function(r) {
f = E[0];
s = E[1];
}
- var P = !u && (O || y || s);
- if (P) {
+ var T = !u && (O || y || s);
+ if (T) {
var z = !C || !v && !h;
- var L = f.r + f.l;
- var T = f.t + f.b;
+ var P = f.r + f.l;
+ var L = f.t + f.b;
var H = {
- marginRight: z && !w ? -L : 0,
- marginBottom: z ? -T : 0,
- marginLeft: z && w ? -L : 0,
+ marginRight: z && !w ? -P : 0,
+ marginBottom: z ? -L : 0,
+ marginLeft: z && w ? -P : 0,
top: z ? -f.t : 0,
right: z ? w ? -f.r : "auto" : 0,
left: z ? w ? "auto" : -f.l : 0,
- width: z ? "calc(100% + " + L + "px)" : ""
+ width: z ? "calc(100% + " + P + "px)" : ""
};
- var D = {
+ var M = {
paddingTop: z ? f.t : 0,
paddingRight: z ? f.r : 0,
paddingBottom: z ? f.b : 0,
paddingLeft: z ? f.l : 0
};
style(v || o, H);
- style(o, D);
+ style(o, M);
t({
rr: f,
mr: !z,
- R: v ? D : A({}, H, D)
+ R: v ? M : A({}, H, M)
});
}
return {
- yr: P
+ yr: T
};
};
};
var Re = Math.max;
var Ie = Re.bind(0, 0);
- var Ve = "visible";
- var ke = "hidden";
+ var ke = "visible";
+ var Ve = "hidden";
var je = 42;
var Be = {
u: wr,
@@ -1500,8 +1500,8 @@ var OverlayScrollbars = function(r) {
var Fe = {
u: br,
o: {
- x: ke,
- y: ke
+ x: Ve,
+ y: Ve
}
};
var qe = function getOverflowAmount(r, a) {
@@ -1519,28 +1519,28 @@ var OverlayScrollbars = function(r) {
return e ? pr(r, a) : gr(r, a);
};
var Ne = function overflowIsVisible(r) {
- return 0 === r.indexOf(Ve);
+ return 0 === r.indexOf(ke);
};
var Ye = function createOverflowUpdateSegment(r, e) {
var n = e[0], t = e[1];
var i = r.J, v = r.rr, o = r.K, u = r.er, f = r.cr, l = r.dr, c = r.Z, s = r.ir;
- var d = pe(), h = d.j, g = d.F, p = d.T, w = d.H;
- var b = ka()[ue];
+ var d = pe(), h = d.j, g = d.F, p = d.L, w = d.H;
+ var b = Va()[ue];
var m = !f && !p && (w.x || w.y);
var y = c && f;
- var S = a(Be, kr.bind(0, o)), C = S[0], O = S[1];
- var x = a(Be, Vr.bind(0, o)), E = x[0], A = x[1];
- var P = a(Be), z = P[0], H = P[1];
- var D = a(Be), M = D[0], R = D[1];
- var I = a(Fe), V = I[0];
- var k = function fixFlexboxGlue(r, a) {
+ var S = a(Be, Vr.bind(0, o)), C = S[0], O = S[1];
+ var x = a(Be, kr.bind(0, o)), E = x[0], A = x[1];
+ var T = a(Be), z = T[0], H = T[1];
+ var M = a(Be), D = M[0], R = M[1];
+ var I = a(Fe), k = I[0];
+ var V = function fixFlexboxGlue(r, a) {
style(o, {
height: ""
});
if (a) {
var e = n(), t = e.mr, v = e.rr;
var u = r.Sr, f = r.I;
- var l = kr(i);
+ var l = Vr(i);
var c = Ir(i);
var s = "content-box" === style(o, "boxSizing");
var d = t || s ? v.b + v.t : 0;
@@ -1576,7 +1576,7 @@ var OverlayScrollbars = function(r) {
x: u,
y: d
},
- V: {
+ k: {
x: f,
y: g
}
@@ -1585,7 +1585,7 @@ var OverlayScrollbars = function(r) {
var B = function setViewportOverflowState(r, a, e, n) {
var t = function setAxisOverflowStyle(r, a) {
var e = Ne(r);
- var n = a && e && r.replace(Ve + "-", "") || "";
+ var n = a && e && r.replace(ke + "-", "") || "";
return [ a && !e ? r : "", Ne(n) ? "hidden" : n ];
};
var i = t(e.x, a.x), v = i[0], o = i[1];
@@ -1595,7 +1595,7 @@ var OverlayScrollbars = function(r) {
return j(r, n);
};
var F = function hideNativeScrollbars(r, a, e, t) {
- var i = r.I, v = r.V;
+ var i = r.I, v = r.k;
var o = v.x, u = v.y;
var f = i.x, l = i.y;
var c = n(), s = c.R;
@@ -1613,15 +1613,15 @@ var OverlayScrollbars = function(r) {
t.paddingBottom = b + (o ? f : 0);
}
};
- var q = b ? b.M(m, g, o, u, n, j, F) : [ function() {
+ var q = b ? b.D(m, g, o, u, n, j, F) : [ function() {
return m;
}, function() {
return [ Sr ];
} ], U = q[0], N = q[1];
return function(r, a, e) {
var u = r.pr, c = r.Or, d = r._r, h = r.yr, b = r.gr, m = r.br;
- var S = n(), x = S.hr, P = S.wr;
- var D = a("showNativeOverlaidScrollbars"), I = D[0], q = D[1];
+ var S = n(), x = S.hr, T = S.wr;
+ var M = a("showNativeOverlaidScrollbars"), I = M[0], q = M[1];
var Y = a("overflow"), W = Y[0], G = Y[1];
var X = I && w.x && w.y;
var Z = !f && !g && (u || d || c || q || b);
@@ -1638,22 +1638,22 @@ var OverlayScrollbars = function(r) {
}
if (Z) {
nr = j(X);
- k(nr, x);
+ V(nr, x);
}
if (u || h || d || m || q) {
if (K) {
l(ha, va, false);
}
- var tr = N(X, P, nr), ir = tr[0], vr = tr[1];
+ var tr = N(X, T, nr), ir = tr[0], vr = tr[1];
var or = Q = C(e), ur = or[0], fr = or[1];
var lr = rr = E(e), cr = lr[0], sr = lr[1];
var dr = Ir(o);
var hr = cr;
var gr = dr;
ir();
- if ((sr || fr || q) && vr && !X && U(vr, cr, ur, P)) {
+ if ((sr || fr || q) && vr && !X && U(vr, cr, ur, T)) {
gr = Ir(o);
- hr = Vr(o);
+ hr = kr(o);
}
var pr = {
w: Ie(Re(cr.w, hr.w) + ur.w),
@@ -1663,18 +1663,18 @@ var OverlayScrollbars = function(r) {
w: Ie(y ? s.innerWidth : gr.w + Ie(dr.w - cr.w) + ur.w),
h: Ie(y ? s.innerHeight : gr.h + Ie(dr.h - cr.h) + ur.h)
};
- er = M(_r);
+ er = D(_r);
ar = z(qe(pr, _r), e);
}
var wr = er, br = wr[0], mr = wr[1];
var yr = ar, Sr = yr[0], Cr = yr[1];
var Or = rr, xr = Or[0], Er = Or[1];
- var Ar = Q, Pr = Ar[0], zr = Ar[1];
- var Lr = {
+ var Ar = Q, Tr = Ar[0], zr = Ar[1];
+ var Pr = {
x: Sr.w > 0,
y: Sr.h > 0
};
- var Tr = $ && J && (Lr.x || Lr.y) || $ && Lr.x && !Lr.y || J && Lr.y && !Lr.x;
+ var Lr = $ && J && (Pr.x || Pr.y) || $ && Pr.x && !Pr.y || J && Pr.y && !Pr.x;
if (h || m || zr || Er || mr || Cr || G || q || Z) {
var Hr = {
marginRight: 0,
@@ -1684,27 +1684,27 @@ var OverlayScrollbars = function(r) {
overflowY: "",
overflowX: ""
};
- var Dr = B(X, Lr, W, Hr);
- var Mr = U(Dr, xr, Pr, P);
+ var Mr = B(X, Pr, W, Hr);
+ var Dr = U(Mr, xr, Tr, T);
if (!f) {
- F(Dr, P, Mr, Hr);
+ F(Mr, T, Dr, Hr);
}
if (Z) {
- k(Dr, x);
+ V(Mr, x);
}
if (f) {
- L(i, ta, Hr.overflowX);
- L(i, ia, Hr.overflowY);
+ P(i, ta, Hr.overflowX);
+ P(i, ia, Hr.overflowY);
} else {
style(o, Hr);
}
}
- T(i, na, va, Tr);
- Ue(v, ha, Tr);
+ L(i, na, va, Lr);
+ Ue(v, ha, Lr);
!f && Ue(o, ha, K);
- var Rr = V(j(X).Cr), kr = Rr[0], jr = Rr[1];
+ var Rr = k(j(X).Cr), Vr = Rr[0], jr = Rr[1];
t({
- Cr: kr,
+ Cr: Vr,
Er: {
x: br.w,
y: br.h
@@ -1713,12 +1713,12 @@ var OverlayScrollbars = function(r) {
x: Sr.w,
y: Sr.h
},
- Pr: Lr
+ Tr: Pr
});
return {
zr: jr,
- Lr: mr,
- Tr: Cr
+ Pr: mr,
+ Lr: Cr
};
};
};
@@ -1735,34 +1735,34 @@ var OverlayScrollbars = function(r) {
};
var Ge = function createStructureSetupUpdate(r, a) {
var e = r.$, n = r.K, t = r.dr, i = r.cr;
- var v = pe(), o = v.T, u = v.H, f = v.F;
+ var v = pe(), o = v.L, u = v.H, f = v.F;
var l = !o && (u.x || u.y);
- var c = [ De(r, a), Me(r, a), Ye(r, a) ];
+ var c = [ Me(r, a), De(r, a), Ye(r, a) ];
return function(r, a, v) {
var o = We(A({
pr: false,
yr: false,
br: false,
gr: false,
+ Pr: false,
Lr: false,
- Tr: false,
zr: false,
Or: false,
_r: false
}, a), {}, v);
var u = l || !f;
- var s = u && M(n);
+ var s = u && D(n);
var d = u && R(n);
t("", ua, true);
var h = o;
each(c, (function(a) {
h = We(h, a(h, r, !!v) || {}, v);
}));
- M(n, s);
+ D(n, s);
R(n, d);
t("", ua);
if (!i) {
- M(e, 0);
+ D(e, 0);
R(e, 0);
}
return h;
@@ -1773,13 +1773,13 @@ var OverlayScrollbars = function(r) {
return r && (r.height || r.width);
};
var $e = function createSizeObserver(r, e, n) {
- var t = n || {}, i = t.Hr, v = void 0 === i ? false : i, o = t.Dr, u = void 0 === o ? false : o;
- var f = ka()[ae];
+ var t = n || {}, i = t.Hr, v = void 0 === i ? false : i, o = t.Mr, u = void 0 === o ? false : o;
+ var f = Va()[ae];
var l = pe(), s = l.B;
var g = $('');
var p = g[0];
var w = p.firstChild;
- var b = Lr.bind(0, r);
+ var b = Pr.bind(0, r);
var m = a({
o: void 0,
g: true,
@@ -1806,15 +1806,15 @@ var OverlayScrollbars = function(r) {
i = true === r;
}
if (v && o) {
- var b = n ? r[0] : Lr(p);
- M(p, b ? s.n ? -Xe : s.i ? 0 : Xe : Xe);
+ var b = n ? r[0] : Pr(p);
+ D(p, b ? s.n ? -Xe : s.i ? 0 : Xe : Xe);
R(p, Xe);
}
if (!t) {
e({
pr: !n,
- Mr: n ? r : void 0,
- Dr: !!i
+ Dr: n ? r : void 0,
+ Mr: !!i
});
}
};
@@ -1831,7 +1831,7 @@ var OverlayScrollbars = function(r) {
e.disconnect();
}));
} else if (f) {
- var n = f.P(w, C, u), t = n[0], i = n[1];
+ var n = f.T(w, C, u), t = n[0], i = n[1];
E = t;
y(x, i);
}
@@ -1931,7 +1931,7 @@ var OverlayScrollbars = function(r) {
if (e) {
var n = e[0];
var t = e[1];
- var v = t && n && (i ? i(n) : V(n, r));
+ var v = t && n && (i ? i(n) : k(n, r));
if (v && v.length && t && l(t)) {
y(a, [ v, t.trim() ], true);
}
@@ -1970,7 +1970,7 @@ var OverlayScrollbars = function(r) {
};
var rn = function createDOMObserver(r, a, e, n) {
var t = false;
- var i = n || {}, v = i.Rr, o = i.Ir, u = i.Vr, f = i.kr, c = i.jr, s = i.Br;
+ var i = n || {}, v = i.Rr, o = i.Ir, u = i.kr, f = i.Vr, c = i.jr, s = i.Br;
var d = Or((function() {
if (t) {
e(true);
@@ -1996,17 +1996,17 @@ var OverlayScrollbars = function(r) {
var S = "attributes" === c;
var C = "childList" === c;
var O = r === i;
- var x = S && l(t) ? L(i, t) : 0;
+ var x = S && l(t) ? P(i, t) : 0;
var E = 0 !== x && s !== x;
var A = m(b, t) > -1 && E;
if (a && !O) {
- var P = !S;
+ var T = !S;
var z = S && A;
- var T = z && f && j(i, f);
- var H = T ? !v(i, t, s, x) : P || z;
- var D = H && !o(e, !!T, r, n);
+ var L = z && f && j(i, f);
+ var H = L ? !v(i, t, s, x) : T || z;
+ var M = H && !o(e, !!L, r, n);
y(d, p);
- g = g || D;
+ g = g || M;
w = w || C;
}
if (!a && O && E && !v(i, t, s, x)) {
@@ -2017,7 +2017,7 @@ var OverlayScrollbars = function(r) {
if (w && !C(d)) {
p((function(r) {
return d.reduce((function(a, e) {
- y(a, V(r, e));
+ y(a, k(r, e));
return j(e, r) ? y(a, e) : a;
}), []);
}));
@@ -2078,25 +2078,25 @@ var OverlayScrollbars = function(r) {
}, (function() {
var r = w(ha, va);
var a = w(ca, "");
- var e = a && M(c);
+ var e = a && D(c);
var n = a && R(c);
b(ha, va);
b(ca, "");
b("", ua, true);
- var t = Vr(h);
- var i = Vr(c);
- var v = kr(c);
+ var t = kr(h);
+ var i = kr(c);
+ var v = Vr(c);
b(ha, va, r);
b(ca, "", a);
b("", ua);
- M(c, e);
+ D(c, e);
R(c, n);
return {
w: i.w + t.w + v.w,
h: i.h + t.h + v.h
};
})), x = O[0];
- var P = g ? tn : vn.concat(tn);
+ var T = g ? tn : vn.concat(tn);
var z = Or(n, {
p: function _timeout() {
return t;
@@ -2113,14 +2113,14 @@ var OverlayScrollbars = function(r) {
}), {}) ];
}
});
- var T = function updateViewportAttrsFromHost(r) {
+ var L = function updateViewportAttrsFromHost(r) {
each(r || nn, (function(r) {
if (m(nn, r) > -1) {
- var a = L(u, r);
+ var a = P(u, r);
if (l(a)) {
- L(c, r, a);
+ P(c, r, a);
} else {
- D(c, r);
+ M(c, r);
}
}
}));
@@ -2137,7 +2137,7 @@ var OverlayScrollbars = function(r) {
return i;
};
var I = function onSizeChanged(r) {
- var a = r.pr, e = r.Mr, t = r.Dr;
+ var a = r.pr, e = r.Dr, t = r.Mr;
var i = !a || t ? n : z;
var v = false;
if (e) {
@@ -2152,7 +2152,7 @@ var OverlayScrollbars = function(r) {
br: v
});
};
- var V = function onContentMutation(r, a) {
+ var k = function onContentMutation(r, a) {
var e = x(), t = e[1];
var i = {
_r: t
@@ -2163,23 +2163,23 @@ var OverlayScrollbars = function(r) {
}
return i;
};
- var k = function onHostMutation(r, a, e) {
+ var V = function onHostMutation(r, a, e) {
var n = {
Or: a
};
if (a) {
!e && z(n);
} else if (!p) {
- T(r);
+ L(r);
}
return n;
};
var j = h || !C ? Ke(u, H) : [ Sr, Sr, Sr ], B = j[0], F = j[1], N = j[2];
var Y = !p ? $e(u, I, {
- Dr: true,
+ Mr: true,
Hr: true
}) : [ Sr, Sr ], W = Y[0], G = Y[1];
- var X = rn(u, false, k, {
+ var X = rn(u, false, V, {
Ir: vn,
Rr: vn.concat(nn)
}), Z = X[0], $ = X[1];
@@ -2187,7 +2187,7 @@ var OverlayScrollbars = function(r) {
pr: true
}));
J && J.observe(u);
- T();
+ L();
return [ function() {
B();
W();
@@ -2203,13 +2203,13 @@ var OverlayScrollbars = function(r) {
var e = N();
var n = v && v[1]();
if (a) {
- A(r, k.apply(0, y(a, true)));
+ A(r, V.apply(0, y(a, true)));
}
if (e) {
A(r, H.apply(0, y(e, true)));
}
if (n) {
- A(r, V.apply(0, y(n, true)));
+ A(r, k.apply(0, y(n, true)));
}
return r;
}, function(r) {
@@ -2226,11 +2226,11 @@ var OverlayScrollbars = function(r) {
v[1]();
v[0]();
}
- v = rn(h || c, true, V, {
- Ir: P.concat(o || []),
- Rr: P.concat(o || []),
- Vr: g,
- kr: an,
+ v = rn(h || c, true, k, {
+ Ir: T.concat(o || []),
+ Rr: T.concat(o || []),
+ kr: g,
+ Vr: an,
Br: function _ignoreContentChange(r, a) {
var e = r.target, n = r.attributeName;
var t = !a && n && !p ? U(e, an, en) : false;
@@ -2282,7 +2282,7 @@ var OverlayScrollbars = function(r) {
x: "hidden",
y: "hidden"
},
- Pr: {
+ Tr: {
x: false,
y: false
},
@@ -2300,7 +2300,7 @@ var OverlayScrollbars = function(r) {
var n = E(r).some((function(a) {
return r[a];
}));
- if (n || !P(a) || e) {
+ if (n || !T(a) || e) {
o("u", [ r, a, e ]);
}
};
@@ -2313,11 +2313,11 @@ var OverlayScrollbars = function(r) {
};
y.qr = function() {
var r = l.$, a = l.K;
- var e = M(r);
+ var e = D(r);
var n = R(r);
w();
c();
- M(a, e);
+ D(a, e);
R(a, n);
};
y.Ur = l;
@@ -2331,14 +2331,29 @@ var OverlayScrollbars = function(r) {
s();
} ];
};
- var sn = Math.round;
- var dn = function getClientOffset(r) {
- return {
- x: r.clientX,
- y: r.clientY
+ var sn = Math.round, dn = Math.max, hn = Math.sign;
+ var gn = function animationCurrentTime() {
+ return performance.now();
+ };
+ var pn = function animateNumber(r, a, e, n) {
+ var t = 0;
+ var i = gn();
+ var v = function frame() {
+ var v = gn();
+ var o = v - i;
+ var u = o >= e;
+ var f = 1 - (dn(0, i + e - v) / e || 0);
+ var l = (a - r) * f + r;
+ var c = u || 1 === f;
+ n(l, c);
+ t = c ? 0 : fr(frame);
+ };
+ v();
+ return function() {
+ return ur(t);
};
};
- var hn = function getScale(r) {
+ var _n = function getScale(r) {
var a = jr(r), e = a.width, n = a.height;
var t = Rr(r), i = t.w, v = t.h;
return {
@@ -2346,13 +2361,13 @@ var OverlayScrollbars = function(r) {
y: sn(n) / v || 1
};
};
- var gn = function continuePointerDown(r, a, e) {
+ var wn = function continuePointerDown(r, a, e) {
var n = a.scrollbars;
var t = r.button, i = r.isPrimary, v = r.pointerType;
var o = n.pointers;
- return 0 === t && i && n[e] && (o || []).includes(v);
+ return 0 === t && i && n[e ? "dragScroll" : "clickScroll"] && (o || []).includes(v);
};
- var pn = function createRootClickStopPropagationEvents(r, a) {
+ var bn = function createRootClickStopPropagationEvents(r, a) {
return Nr(r, "mousedown", Nr.bind(0, a, "click", Yr, {
A: true,
O: true
@@ -2360,53 +2375,100 @@ var OverlayScrollbars = function(r) {
O: true
});
};
- var _n = function createDragScrollingEvents(r, a, e, n, t, i) {
+ var mn = function createInteractiveScrollEvents(r, a, e, n, t, i) {
var v = pe(), o = v.B;
var u = e.Nr, f = e.Yr, l = e.Wr;
var c = "scroll" + (i ? "Left" : "Top");
- var s = i ? "x" : "y";
+ var s = i ? "width" : "height";
var d = i ? "w" : "h";
- var h = function createOnPointerMoveHandler(r, a, e) {
- return function(v) {
- var h = t(), g = h.Ar;
- var p = (dn(v)[s] - a) * e;
- var w = Rr(f)[d] - Rr(u)[d];
- var b = p / w;
- var m = b * g[s];
- var y = Lr(l);
- var S = y && i ? o.n || o.i ? 1 : -1 : 1;
- n[c] = r + m * S;
+ var h = i ? "x" : "y";
+ var g = function getHandleOffset(r, a) {
+ return r[h] - a[h];
+ };
+ var p = function createRelativeHandleMove(r, a) {
+ return function(e) {
+ var v = t(), s = v.Ar;
+ var g = Rr(f)[d] - Rr(u)[d];
+ var p = a * e / g;
+ var w = p * s[h];
+ var b = Pr(l);
+ var m = b && i ? o.n || o.i ? 1 : -1 : 1;
+ n[c] = r + w * m;
};
};
- return Nr(u, "pointerdown", (function(e) {
- if (gn(e, r, "dragScroll")) {
- var t = Nr(a, "selectstart", (function(r) {
+ return Nr(f, "pointerdown", (function(e) {
+ var t = q(e.target, "." + Aa) === u;
+ if (wn(e, r, t)) {
+ var i = !t && e.shiftKey;
+ var v = p(n[c] || 0, 1 / _n(n)[h]);
+ var o = e[h];
+ var l = jr(u);
+ var d = jr(f);
+ var w = l[s];
+ var b = g(l, d) + w / 2;
+ var m = o - d[h];
+ var S = t ? 0 : m - b;
+ var C = [ Nr(a, "selectstart", (function(r) {
return Wr(r);
}), {
C: false
- });
- var i = Nr(u, "pointermove", h(n[c] || 0, dn(e)[s], 1 / hn(n)[s]));
- Nr(u, "pointerup", (function(r) {
- t();
- i();
- u.releasePointerCapture(r.pointerId);
+ }), Nr(f, "pointermove", (function(r) {
+ var a = r[h] - o;
+ if (t || i) {
+ v(S + a);
+ }
+ })) ];
+ if (i) {
+ v(S);
+ } else if (!t) {
+ var x = 0;
+ var E = Sr;
+ var A = function animateClickScroll(r) {
+ E = pn(r, r + w * hn(S), 133, (function(r, a) {
+ v(r);
+ var e = g(jr(u), d);
+ var n = e + w;
+ var t = m >= e && m <= n;
+ if (a && !t) {
+ if (x) {
+ animateClickScroll(r);
+ } else {
+ var i = setTimeout((function() {
+ animateClickScroll(r);
+ }), 222);
+ E = function clear() {
+ clearTimeout(i);
+ };
+ }
+ x++;
+ }
+ }));
+ };
+ A(0);
+ y(C, (function() {
+ return E();
+ }));
+ }
+ Nr(f, "pointerup", (function(r) {
+ O(C);
+ f.releasePointerCapture(r.pointerId);
}), {
A: true
});
- u.setPointerCapture(e.pointerId);
+ f.setPointerCapture(e.pointerId);
}
}));
};
- var wn = function createScrollbarsSetupEvents(r, a) {
+ var yn = function createScrollbarsSetupEvents(r, a) {
return function(e, n, t, i, v, o) {
var u = e.Wr;
var f = Cr(333), l = f[0], c = f[1];
var s = !!v.scrollBy;
var d = true;
return O.bind(0, [ Nr(u, "pointerenter", (function() {
- n(Ta, true);
+ n(La, true);
})), Nr(u, "pointerleave pointercancel", (function() {
- n(Ta);
+ n(La);
})), Nr(u, "wheel", (function(r) {
var a = r.deltaX, e = r.deltaY, t = r.deltaMode;
if (s && d && 0 === t && F(u) === i) {
@@ -2417,47 +2479,47 @@ var OverlayScrollbars = function(r) {
});
}
d = false;
- n(Ma, true);
+ n(Da, true);
l((function() {
d = true;
- n(Ma);
+ n(Da);
}));
Wr(r);
}), {
C: false,
O: true
- }), pn(u, t), _n(r, t, e, v, a, o), c ]);
+ }), bn(u, t), mn(r, t, e, v, a, o), c ]);
};
};
- var bn = Math.min, mn = Math.max, yn = Math.abs, Sn = Math.round;
- var Cn = function getScrollbarHandleLengthRatio(r, a, e, n) {
+ var Sn = Math.min, Cn = Math.max, On = Math.abs, xn = Math.round;
+ var En = function getScrollbarHandleLengthRatio(r, a, e, n) {
if (n) {
var t = e ? "x" : "y";
var i = n.Ar, v = n.Er;
var o = v[t];
var u = i[t];
- return mn(0, bn(1, o / (o + u)));
+ return Cn(0, Sn(1, o / (o + u)));
}
var f = e ? "w" : "h";
var l = Rr(r)[f];
var c = Rr(a)[f];
- return mn(0, bn(1, l / c));
+ return Cn(0, Sn(1, l / c));
};
- var On = function getScrollbarHandleOffsetRatio(r, a, e, n, t, i) {
+ var An = function getScrollbarHandleOffsetRatio(r, a, e, n, t, i) {
var v = pe(), o = v.B;
var u = i ? "x" : "y";
var f = i ? "Left" : "Top";
var l = n.Ar;
- var c = Sn(l[u]);
- var s = yn(e["scroll" + f]);
+ var c = xn(l[u]);
+ var s = On(e["scroll" + f]);
var d = i && t;
var h = o.i ? s : c - s;
var g = d ? h : s;
- var p = bn(1, g / c);
- var w = Cn(r, a, i);
+ var p = Sn(1, g / c);
+ var w = En(r, a, i);
return 1 / w * (1 - w) * p;
};
- var xn = function createScrollbarsSetupElements(r, a, e) {
+ var Tn = function createScrollbarsSetupElements(r, a, e) {
var n = pe(), t = n.U;
var i = t(), v = i.scrollbars;
var o = v.slot;
@@ -2483,7 +2545,7 @@ var OverlayScrollbars = function(r) {
x(r, (function(r) {
var n;
var t = r.Nr, i = r.Yr;
- return [ t, (n = {}, n[e ? "width" : "height"] = (100 * Cn(t, i, e, a)).toFixed(3) + "%",
+ return [ t, (n = {}, n[e ? "width" : "height"] = (100 * En(t, i, e, a)).toFixed(3) + "%",
n) ];
}));
};
@@ -2491,35 +2553,35 @@ var OverlayScrollbars = function(r) {
var n = e ? "X" : "Y";
x(r, (function(r) {
var t = r.Nr, i = r.Yr, v = r.Wr;
- var o = On(t, i, h, a, Lr(v), e);
+ var o = An(t, i, h, a, Pr(v), e);
var u = o === o;
return [ t, {
transform: u ? "translate" + n + "(" + (100 * o).toFixed(3) + "%)" : ""
} ];
}));
};
- var P = [];
+ var T = [];
var z = [];
- var L = [];
- var T = function scrollbarsAddRemoveClass(r, a, e) {
+ var P = [];
+ var L = function scrollbarsAddRemoveClass(r, a, e) {
var n = c(e);
var t = n ? e : true;
var i = n ? !e : true;
t && S(z, r, a);
- i && S(L, r, a);
+ i && S(P, r, a);
};
var H = function refreshScrollbarsHandleLength(r) {
E(z, r, true);
- E(L, r);
+ E(P, r);
};
- var D = function refreshScrollbarsHandleOffset(r) {
+ var M = function refreshScrollbarsHandleOffset(r) {
A(z, r, true);
- A(L, r);
+ A(P, r);
};
- var M = function generateScrollbarDOM(r) {
+ var D = function generateScrollbarDOM(r) {
var a = r ? Oa : xa;
- var n = r ? z : L;
- var t = C(n) ? La : "";
+ var n = r ? z : P;
+ var t = C(n) ? Pa : "";
var i = Z(Sa + " " + a + " " + t);
var v = Z(Ea);
var o = Z(Aa);
@@ -2531,37 +2593,37 @@ var OverlayScrollbars = function(r) {
Y(i, v);
Y(v, o);
y(n, f);
- y(P, [ X.bind(0, i), e(f, T, u, l, h, r) ]);
+ y(T, [ X.bind(0, i), e(f, L, u, l, h, r) ]);
return f;
};
- var R = M.bind(0, true);
- var I = M.bind(0, false);
- var V = function appendElements() {
+ var R = D.bind(0, true);
+ var I = D.bind(0, false);
+ var k = function appendElements() {
Y(m, z[0].Wr);
- Y(m, L[0].Wr);
+ Y(m, P[0].Wr);
lr((function() {
- T(La);
+ L(Pa);
}), 300);
};
R();
I();
return [ {
Gr: H,
- Xr: D,
- Zr: T,
+ Xr: M,
+ Zr: L,
$r: {
Jr: z,
Kr: R,
Qr: x.bind(0, z)
},
ra: {
- Jr: L,
+ Jr: P,
Kr: I,
- Qr: x.bind(0, L)
+ Qr: x.bind(0, P)
}
- }, V, O.bind(0, P) ];
+ }, k, O.bind(0, T) ];
};
- var En = function createScrollbarsSetup(r, a, e) {
+ var zn = function createScrollbarsSetup(r, a, e) {
var n;
var t;
var i;
@@ -2577,8 +2639,8 @@ var OverlayScrollbars = function(r) {
var x = Cr((function() {
return u;
})), E = x[0], A = x[1];
- var P = xn(r, e.Ur, wn(a, e)), z = P[0], L = P[1], T = P[2];
- var H = e.Ur, D = H.J, I = H.K, V = H.nr, k = H.tr, j = H.cr, B = H.Z;
+ var T = Tn(r, e.Ur, yn(a, e)), z = T[0], P = T[1], L = T[2];
+ var H = e.Ur, M = H.J, I = H.K, k = H.nr, V = H.tr, j = H.cr, B = H.Z;
var q = z.$r, U = z.ra, N = z.Zr, Y = z.Gr, W = z.Xr;
var G = q.Qr;
var X = U.Qr;
@@ -2586,16 +2648,16 @@ var OverlayScrollbars = function(r) {
var a = r.Wr;
var e = j && !B && F(a) === I && a;
return [ e, {
- transform: e ? "translate(" + M(V) + "px, " + R(V) + "px)" : ""
+ transform: e ? "translate(" + D(k) + "px, " + R(k) + "px)" : ""
} ];
};
var $ = function manageScrollbarsAutoHide(r, a) {
A();
if (r) {
- N(Da);
+ N(Ma);
} else {
var e = function hide() {
- return N(Da, true);
+ return N(Ma, true);
};
if (u > 0 && !a) {
E(e);
@@ -2608,12 +2670,12 @@ var OverlayScrollbars = function(r) {
v = t;
v && $(true);
};
- var K = [ m, A, C, p, d, T, Nr(D, "pointerover", J, {
+ var K = [ m, A, C, p, d, L, Nr(M, "pointerover", J, {
A: true
- }), Nr(D, "pointerenter", J), Nr(D, "pointerleave", (function() {
+ }), Nr(M, "pointerenter", J), Nr(M, "pointerleave", (function() {
v = false;
t && $(false);
- })), Nr(D, "pointermove", (function() {
+ })), Nr(M, "pointermove", (function() {
n && s((function() {
m();
$(true);
@@ -2621,7 +2683,7 @@ var OverlayScrollbars = function(r) {
n && $(false);
}));
}));
- })), Nr(k, "scroll", (function() {
+ })), Nr(V, "scroll", (function() {
g((function() {
W(e());
i && $(true);
@@ -2634,50 +2696,50 @@ var OverlayScrollbars = function(r) {
})) ];
var Q = l.bind(0);
Q.Ur = z;
- Q.qr = L;
+ Q.qr = P;
return [ function(r, v, f) {
- var l = f.Lr, c = f.Tr, s = f.zr, d = f.br;
+ var l = f.Pr, c = f.Lr, s = f.zr, d = f.br;
var h = Ee(a, r, v);
var g = e();
var p = g.Ar, w = g.Cr, b = g.wr;
var m = h("scrollbars.theme"), y = m[0], S = m[1];
var C = h("scrollbars.visibility"), O = C[0], x = C[1];
- var E = h("scrollbars.autoHide"), A = E[0], P = E[1];
- var z = h("scrollbars.autoHideDelay"), L = z[0];
- var T = h("scrollbars.dragScroll"), H = T[0], D = T[1];
- var M = h("scrollbars.clickScroll"), R = M[0], I = M[1];
- var V = l || c || d || v;
- var k = s || x || v;
+ var E = h("scrollbars.autoHide"), A = E[0], T = E[1];
+ var z = h("scrollbars.autoHideDelay"), P = z[0];
+ var L = h("scrollbars.dragScroll"), H = L[0], M = L[1];
+ var D = h("scrollbars.clickScroll"), R = D[0], I = D[1];
+ var k = l || c || d || v;
+ var V = s || x || v;
var j = function setScrollbarVisibility(r, a) {
var e = "visible" === O || "auto" === O && "scroll" === r;
- N(Pa, e, a);
+ N(Ta, e, a);
return e;
};
- u = L;
+ u = P;
if (S) {
N(o);
N(y, true);
o = y;
}
- if (P) {
+ if (T) {
n = "move" === A;
t = "leave" === A;
i = "never" !== A;
$(!i, true);
}
- if (D) {
+ if (M) {
N(Ia, H);
}
if (I) {
N(Ra, R);
}
- if (k) {
+ if (V) {
var F = j(w.x, true);
var q = j(w.y, false);
var U = F && q;
N(za, !U);
}
- if (V) {
+ if (k) {
Y(g);
W(g);
N(Ha, !p.x, true);
@@ -2686,9 +2748,9 @@ var OverlayScrollbars = function(r) {
}
}, Q, O.bind(0, K) ];
};
- var An = function OverlayScrollbars(r, a, e) {
+ var Pn = function OverlayScrollbars(r, a, e) {
var n = pe(), t = n.Y, i = n.q;
- var v = ka();
+ var v = Va();
var o = w(r);
var u = o ? r : r.target;
var f = Oe(u);
@@ -2697,21 +2759,21 @@ var OverlayScrollbars = function(r) {
var c = v[Ka];
var d = function validateOptions(r) {
var a = r || {};
- var e = c && c.P;
+ var e = c && c.T;
return e ? e(a, true) : a;
};
var h = A({}, t(), d(a));
var g = $r(e), p = g[0], b = g[1], m = g[2];
var y = cn(r, h), S = y[0], C = y[1], O = y[2];
- var x = En(r, h, C), z = x[0], L = x[1], T = x[2];
+ var x = zn(r, h, C), z = x[0], P = x[1], L = x[2];
var H = function update(r, a) {
S(r, !!a);
};
- var D = i(H.bind(0, {}, true));
- var M = function destroy(r) {
+ var M = i(H.bind(0, {}, true));
+ var D = function destroy(r) {
Ce(u);
- D();
- T();
+ M();
+ L();
O();
l = true;
m("destroyed", [ R, !!r ]);
@@ -2721,7 +2783,7 @@ var OverlayScrollbars = function(r) {
options: function options(r) {
if (r) {
var a = Qr(h, d(r));
- if (!P(a)) {
+ if (!T(a)) {
A(h, a);
H(a);
}
@@ -2733,7 +2795,7 @@ var OverlayScrollbars = function(r) {
r && a && b(r, a);
},
state: function state() {
- var r = C(), a = r.Er, e = r.Ar, n = r.Cr, t = r.Pr, i = r.rr, v = r.mr, o = r.wr;
+ var r = C(), a = r.Er, e = r.Ar, n = r.Cr, t = r.Tr, i = r.rr, v = r.mr, o = r.wr;
return A({}, {
overflowEdge: a,
overflowAmount: e,
@@ -2747,7 +2809,7 @@ var OverlayScrollbars = function(r) {
},
elements: function elements() {
var r = C.Ur, a = r.$, e = r.J, n = r.rr, t = r.K, i = r.ar, v = r.nr, o = r.tr;
- var u = L.Ur, f = u.$r, l = u.ra;
+ var u = P.Ur, f = u.$r, l = u.ra;
var c = function translateScrollbarStructure(r) {
var a = r.Nr, e = r.Yr, n = r.Wr;
return {
@@ -2783,7 +2845,7 @@ var OverlayScrollbars = function(r) {
H({}, r);
return R;
},
- destroy: M.bind(0)
+ destroy: D.bind(0)
};
C.Fr((function(r, a, e) {
z(a, e, r);
@@ -2795,15 +2857,15 @@ var OverlayScrollbars = function(r) {
}
}));
if (me(!o && r.cancel, C.Ur)) {
- M(true);
+ D(true);
return R;
}
C.qr();
- L.qr();
+ P.qr();
Se(u, R);
m("initialized", [ R ]);
C.Fr((function(r, a, e) {
- var n = r.pr, t = r.br, i = r.gr, v = r.Lr, o = r.Tr, u = r.zr, f = r._r, l = r.Or;
+ var n = r.pr, t = r.br, i = r.gr, v = r.Pr, o = r.Lr, u = r.zr, f = r._r, l = r.Or;
m("updated", [ R, {
updateHints: {
sizeChanged: n,
@@ -2823,14 +2885,14 @@ var OverlayScrollbars = function(r) {
}
return f;
};
- An.plugin = ja;
- An.valid = function(r) {
+ Pn.plugin = ja;
+ Pn.valid = function(r) {
var a = r && r.elements;
var e = s(a) && a();
return p(e) && !!Oe(e.target);
};
- An.env = function() {
- var r = pe(), a = r.j, e = r.H, n = r.T, t = r.B, i = r.F, v = r.D, o = r.G, u = r.X, f = r.U, l = r.N, c = r.Y, s = r.W;
+ Pn.env = function() {
+ var r = pe(), a = r.j, e = r.H, n = r.L, t = r.B, i = r.F, v = r.M, o = r.G, u = r.X, f = r.U, l = r.N, c = r.Y, s = r.W;
return A({}, {
scrollbarsSize: a,
scrollbarsOverlaid: e,
@@ -2846,7 +2908,7 @@ var OverlayScrollbars = function(r) {
setDefaultOptions: s
});
};
- r.OverlayScrollbars = An;
+ r.OverlayScrollbars = Pn;
r.scrollbarsHidingPlugin = fe;
r.sizeObserverPlugin = ee;
Object.defineProperty(r, "v", {
diff --git a/packages/overlayscrollbars/dist/browser/overlayscrollbars.browser.es5.js.map b/packages/overlayscrollbars/dist/browser/overlayscrollbars.browser.es5.js.map
index a74a663..31d9a46 100644
--- a/packages/overlayscrollbars/dist/browser/overlayscrollbars.browser.es5.js.map
+++ b/packages/overlayscrollbars/dist/browser/overlayscrollbars.browser.es5.js.map
@@ -1 +1 @@
-{"version":3,"file":"overlayscrollbars.browser.es5.js","sources":["../../src/support/utils/array.ts","../../src/support/dom/style.ts","../../src/support/cache.ts","../../src/support/utils/types.ts","../../src/support/utils/object.ts","../../src/support/dom/attribute.ts","../../src/support/dom/traversal.ts","../../src/support/dom/manipulation.ts","../../src/support/dom/create.ts","../../src/support/compatibility/vendors.ts","../../src/support/compatibility/apis.ts","../../src/support/dom/class.ts","../../src/support/utils/equal.ts","../../src/support/utils/function.ts","../../src/support/dom/dimensions.ts","../../src/support/dom/events.ts","../../src/support/dom/offset.ts","../../src/support/eventListeners.ts","../../src/options.ts","../../src/classnames.ts","../../src/plugins/plugins.ts","../../../../node_modules/@babel/runtime/helpers/extends.js","../../src/plugins/optionsValidationPlugin/validation.ts","../../src/plugins/optionsValidationPlugin/optionsValidationPlugin.ts","../../src/plugins/sizeObserverPlugin/sizeObserverPlugin.ts","../../src/plugins/scrollbarsHidingPlugin/scrollbarsHidingPlugin.ts","../../src/environment.ts","../../src/initialization.ts","../../src/instances.ts","../../src/setups/setups.ts","../../src/setups/structureSetup/structureSetup.elements.ts","../../src/setups/structureSetup/updateSegments/trinsicUpdateSegment.ts","../../src/setups/structureSetup/updateSegments/paddingUpdateSegment.ts","../../src/setups/structureSetup/updateSegments/overflowUpdateSegment.ts","../../src/setups/structureSetup/structureSetup.update.ts","../../src/observers/sizeObserver.ts","../../src/observers/trinsicObserver.ts","../../src/observers/domObserver.ts","../../src/setups/structureSetup/structureSetup.observers.ts","../../src/setups/structureSetup/structureSetup.ts","../../src/setups/scrollbarsSetup/scrollbarsSetup.events.ts","../../src/setups/scrollbarsSetup/scrollbarsSetup.calculations.ts","../../src/setups/scrollbarsSetup/scrollbarsSetup.elements.ts","../../src/setups/scrollbarsSetup/scrollbarsSetup.ts","../../src/overlayscrollbars.ts"],"sourcesContent":["import { isArrayLike, isString } from 'support/utils/types';\r\nimport { PlainObject } from 'typings';\r\n\r\ntype RunEachItem = ((...args: any) => any | any[]) | null | undefined;\r\n\r\n/**\r\n * Iterates through a array or object\r\n * @param arrayLikeOrObject The array or object through which shall be iterated.\r\n * @param callback The function which is responsible for the iteration.\r\n * If the function returns true its treated like a \"continue\" statement.\r\n * If the function returns false its treated like a \"break\" statement.\r\n */\r\nexport function each(\r\n array: Array | ReadonlyArray,\r\n callback: (value: T, indexOrKey: number, source: Array) => boolean | unknown\r\n): Array | ReadonlyArray;\r\nexport function each(\r\n array: Array | ReadonlyArray | false | null | undefined,\r\n callback: (value: T, indexOrKey: number, source: Array) => boolean | unknown\r\n): Array | ReadonlyArray | false | null | undefined;\r\nexport function each(\r\n arrayLikeObject: ArrayLike,\r\n callback: (value: T, indexOrKey: number, source: ArrayLike) => boolean | unknown\r\n): ArrayLike;\r\nexport function each(\r\n arrayLikeObject: ArrayLike | false | null | undefined,\r\n callback: (value: T, indexOrKey: number, source: ArrayLike) => boolean | unknown\r\n): ArrayLike | false | null | undefined;\r\nexport function each(\r\n obj: PlainObject,\r\n callback: (value: any, indexOrKey: string, source: PlainObject) => boolean | unknown\r\n): PlainObject;\r\nexport function each(\r\n obj: PlainObject | false | null | undefined,\r\n callback: (value: any, indexOrKey: string, source: PlainObject) => boolean | unknown\r\n): PlainObject | false | null | undefined;\r\nexport function each(\r\n source: Array | ArrayLike | ReadonlyArray | PlainObject | false | null | undefined,\r\n callback: (value: T, indexOrKey: any, source: any) => boolean | unknown\r\n): Array | ArrayLike | ReadonlyArray | PlainObject | false | null | undefined {\r\n if (isArrayLike(source)) {\r\n for (let i = 0; i < source.length; i++) {\r\n if (callback(source[i], i, source) === false) {\r\n break;\r\n }\r\n }\r\n } else if (source) {\r\n // cant use support func keys here due to circular dep\r\n each(Object.keys(source), (key) => callback(source[key], key, source));\r\n }\r\n return source;\r\n}\r\n\r\n/**\r\n * Returns the index of the given inside the given array or -1 if the given item isn't part of the given array.\r\n * @param arr The array.\r\n * @param item The item.\r\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\r\n */\r\nexport const indexOf = (arr: T[], item: T, fromIndex?: number): number =>\r\n arr.indexOf(item, fromIndex);\r\n\r\n/**\r\n * Pushesh all given items into the given array and returns it.\r\n * @param array The array the items shall be pushed into.\r\n * @param items The items which shall be pushed into the array.\r\n */\r\nexport const push = (array: T[], items: T | ArrayLike, arrayIsSingleItem?: boolean): T[] => {\r\n !arrayIsSingleItem && !isString(items) && isArrayLike(items)\r\n ? Array.prototype.push.apply(array, items as T[])\r\n : array.push(items as T);\r\n return array;\r\n};\r\n\r\n/**\r\n * Creates a shallow-copied Array instance from an array-like or iterable object.\r\n * @param arr The object from which the array instance shall be created.\r\n */\r\nexport const from = (arr?: ArrayLike | Set) => {\r\n const original = Array.from;\r\n const result: T[] = [];\r\n\r\n if (original && arr) {\r\n return original(arr);\r\n }\r\n\r\n if (arr instanceof Set) {\r\n arr.forEach((value) => {\r\n push(result, value);\r\n });\r\n } else {\r\n each(arr, (elm) => {\r\n push(result, elm);\r\n });\r\n }\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Check whether the passed array is empty.\r\n * @param array The array which shall be checked.\r\n */\r\nexport const isEmptyArray = (array: any[] | null | undefined): boolean =>\r\n !!array && array.length === 0;\r\n\r\n/**\r\n * Calls all functions in the passed array/set of functions.\r\n * @param arr The array filled with function which shall be called.\r\n * @param args The args with which each function is called.\r\n * @param keep True when the Set / array should not be cleared afterwards, false otherwise.\r\n */\r\nexport const runEachAndClear = (arr: RunEachItem[], args?: any[], keep?: boolean): void => {\r\n // eslint-disable-next-line prefer-spread\r\n const runFn = (fn: RunEachItem) => fn && fn.apply(undefined, args || []);\r\n each(arr, runFn);\r\n !keep && ((arr as any[]).length = 0);\r\n};\r\n","import { each, keys } from 'support/utils';\r\nimport { isString, isNumber, isArray, isUndefined } from 'support/utils/types';\r\nimport { PlainObject, StyleObject } from 'typings';\r\n\r\nexport interface TRBL {\r\n t: number;\r\n r: number;\r\n b: number;\r\n l: number;\r\n}\r\n\r\nconst cssNumber = {\r\n // animationiterationcount: 1,\r\n // columncount: 1,\r\n // fillopacity: 1,\r\n // flexgrow: 1,\r\n // flexshrink: 1,\r\n // fontweight: 1,\r\n // lineheight: 1,\r\n // order: 1,\r\n // orphans: 1,\r\n // widows: 1,\r\n // zoom: 1,\r\n opacity: 1,\r\n zindex: 1,\r\n};\r\n\r\nconst parseToZeroOrNumber = (value: string, toFloat?: boolean): number => {\r\n /* istanbul ignore next */\r\n const num = toFloat ? parseFloat(value) : parseInt(value, 10);\r\n // num === num means num is not NaN\r\n /* istanbul ignore next */\r\n return num === num ? num : 0; // eslint-disable-line no-self-compare\r\n};\r\n\r\nconst adaptCSSVal = (prop: string, val: string | number): string | number =>\r\n !cssNumber[prop.toLowerCase()] && isNumber(val) ? `${val}px` : val;\r\n\r\nconst getCSSVal = (elm: HTMLElement, computedStyle: CSSStyleDeclaration, prop: string): string =>\r\n /* istanbul ignore next */\r\n computedStyle != null\r\n ? computedStyle[prop] || computedStyle.getPropertyValue(prop)\r\n : elm.style[prop];\r\n\r\nconst setCSSVal = (elm: HTMLElement, prop: string, val: string | number): void => {\r\n try {\r\n const { style: elmStyle } = elm;\r\n if (!isUndefined(elmStyle[prop])) {\r\n elmStyle[prop] = adaptCSSVal(prop, val);\r\n } else {\r\n elmStyle.setProperty(prop, val as string);\r\n }\r\n } catch (e) {}\r\n};\r\n\r\n/**\r\n * Gets or sets the passed styles to the passed element.\r\n * @param elm The element to which the styles shall be applied to / be read from.\r\n * @param styles The styles which shall be set or read.\r\n */\r\nexport function style(\r\n elm: HTMLElement | false | null | undefined,\r\n styles: StyleObject\r\n): void;\r\nexport function style(elm: HTMLElement | false | null | undefined, styles: string): string;\r\nexport function style(\r\n elm: HTMLElement | false | null | undefined,\r\n styles: Array | string\r\n): { [key: string]: string };\r\nexport function style(\r\n elm: HTMLElement | false | null | undefined,\r\n styles: StyleObject | Array | string\r\n): { [key: string]: string } | string | void {\r\n const getSingleStyle = isString(styles);\r\n const getStyles = isArray(styles) || getSingleStyle;\r\n\r\n if (getStyles) {\r\n let getStylesResult: string | PlainObject = getSingleStyle ? '' : {};\r\n if (elm) {\r\n const computedStyle: CSSStyleDeclaration = window.getComputedStyle(elm, null);\r\n getStylesResult = getSingleStyle\r\n ? getCSSVal(elm, computedStyle, styles as string)\r\n : (styles as Array).reduce((result, key) => {\r\n result[key] = getCSSVal(elm, computedStyle, key as string);\r\n return result;\r\n }, getStylesResult);\r\n }\r\n return getStylesResult;\r\n }\r\n elm && each(keys(styles), (key) => setCSSVal(elm, key, styles[key]));\r\n}\r\n\r\nexport const directionIsRTL = (elm: HTMLElement | false | null | undefined): boolean =>\r\n style(elm, 'direction') === 'rtl';\r\n\r\n/**\r\n * Returns the top right bottom left values of the passed css property.\r\n * @param elm The element of which the values shall be returned.\r\n * @param propertyPrefix The css property prefix. (e.g. \"border\")\r\n * @param propertySuffix The css property suffix. (e.g. \"width\")\r\n */\r\nexport const topRightBottomLeft = (\r\n elm?: HTMLElement | false | null | undefined,\r\n propertyPrefix?: string,\r\n propertySuffix?: string\r\n): TRBL => {\r\n const finalPrefix = propertyPrefix ? `${propertyPrefix}-` : '';\r\n const finalSuffix = propertySuffix ? `-${propertySuffix}` : '';\r\n const top = `${finalPrefix}top${finalSuffix}`;\r\n const right = `${finalPrefix}right${finalSuffix}`;\r\n const bottom = `${finalPrefix}bottom${finalSuffix}`;\r\n const left = `${finalPrefix}left${finalSuffix}`;\r\n const result = style(elm, [top, right, bottom, left]);\r\n return {\r\n t: parseToZeroOrNumber(result[top]),\r\n r: parseToZeroOrNumber(result[right]),\r\n b: parseToZeroOrNumber(result[bottom]),\r\n l: parseToZeroOrNumber(result[left]),\r\n };\r\n};\r\n","export interface CacheOptions {\r\n // initial value of _value.\r\n _initialValue: Value;\r\n // Custom comparison function if shallow compare isn't enough. Returns true if nothing changed.\r\n _equal?: EqualCachePropFunction;\r\n // If true always updates _value and _previous, otherwise they update only when they changed.\r\n _alwaysUpdateValues?: boolean;\r\n}\r\n\r\nexport type CacheValues = [value: T, changed: boolean, previous?: T];\r\n\r\nexport type EqualCachePropFunction = (currentVal: Value, newVal: Value) => boolean;\r\n\r\nexport type CacheUpdater = (current: Value, previous?: Value) => Value;\r\n\r\nexport type UpdateCacheContextual = (newValue: Value, force?: boolean) => CacheValues;\r\n\r\nexport type UpdateCache = (force?: boolean) => CacheValues;\r\n\r\nexport type GetCurrentCache = (force?: boolean) => CacheValues;\r\n\r\nexport type Cache = [UpdateCache, GetCurrentCache];\r\n\r\nexport type CacheContextual = [UpdateCacheContextual, GetCurrentCache];\r\n\r\ntype CreateCache = {\r\n (options: CacheOptions): CacheContextual;\r\n (options: CacheOptions, update: CacheUpdater): Cache;\r\n (options: CacheOptions, update?: CacheUpdater):\r\n | CacheContextual\r\n | Cache;\r\n};\r\n\r\nexport const createCache: CreateCache = (\r\n options: CacheOptions,\r\n update?: CacheUpdater\r\n): CacheContextual | Cache => {\r\n const { _initialValue, _equal, _alwaysUpdateValues } = options;\r\n let _value: Value = _initialValue;\r\n let _previous: Value | undefined;\r\n\r\n const cacheUpdateContextual: UpdateCacheContextual = (newValue, force?) => {\r\n const curr = _value;\r\n\r\n const newVal = newValue;\r\n const changed = force || (_equal ? !_equal(curr, newVal) : curr !== newVal);\r\n\r\n if (changed || _alwaysUpdateValues) {\r\n _value = newVal;\r\n _previous = curr;\r\n }\r\n\r\n return [_value, changed, _previous];\r\n };\r\n const cacheUpdateIsolated: UpdateCache = (force?) =>\r\n cacheUpdateContextual(update!(_value, _previous), force);\r\n\r\n const getCurrentCache: GetCurrentCache = (force?: boolean) => [\r\n _value,\r\n !!force, // changed\r\n _previous,\r\n ];\r\n\r\n return [update ? cacheUpdateIsolated : cacheUpdateContextual, getCurrentCache] as\r\n | CacheContextual\r\n | Cache;\r\n};\r\n","import { PlainObject } from 'typings';\r\n\r\nconst ElementNodeType = Node.ELEMENT_NODE;\r\nconst { toString, hasOwnProperty } = Object.prototype;\r\n\r\nexport const isUndefined = (obj: any): obj is undefined => obj === undefined;\r\n\r\nexport const isNull = (obj: any): obj is null => obj === null;\r\n\r\nexport const type = (obj: any): string =>\r\n isUndefined(obj) || isNull(obj)\r\n ? `${obj}`\r\n : toString\r\n .call(obj)\r\n .replace(/^\\[object (.+)\\]$/, '$1')\r\n .toLowerCase();\r\n\r\nexport const isNumber = (obj: any): obj is number => typeof obj === 'number';\r\n\r\nexport const isString = (obj: any): obj is string => typeof obj === 'string';\r\n\r\nexport const isBoolean = (obj: any): obj is boolean => typeof obj === 'boolean';\r\n\r\nexport const isFunction = (obj: any): obj is (...args: any[]) => any => typeof obj === 'function';\r\n\r\nexport const isArray = (obj: any): obj is Array => Array.isArray(obj);\r\n\r\nexport const isObject = (obj: any): boolean =>\r\n typeof obj === 'object' && !isArray(obj) && !isNull(obj);\r\n\r\n/**\r\n * Returns true if the given object is array like, false otherwise.\r\n * @param obj The Object\r\n */\r\nexport const isArrayLike = (obj: any): obj is ArrayLike => {\r\n const length = !!obj && obj.length;\r\n const lengthCorrectFormat = isNumber(length) && length > -1 && length % 1 == 0; // eslint-disable-line eqeqeq\r\n\r\n return isArray(obj) || (!isFunction(obj) && lengthCorrectFormat)\r\n ? length > 0 && isObject(obj)\r\n ? length - 1 in obj\r\n : true\r\n : false;\r\n};\r\n\r\n/**\r\n * Returns true if the given object is a \"plain\" (e.g. { key: value }) object, false otherwise.\r\n * @param obj The Object.\r\n */\r\nexport const isPlainObject = (obj: any): obj is PlainObject => {\r\n if (!obj || !isObject(obj) || type(obj) !== 'object') return false;\r\n\r\n let key;\r\n const cstr = 'constructor';\r\n const ctor = obj[cstr];\r\n const ctorProto = ctor && ctor.prototype;\r\n const hasOwnConstructor = hasOwnProperty.call(obj, cstr);\r\n const hasIsPrototypeOf = ctorProto && hasOwnProperty.call(ctorProto, 'isPrototypeOf');\r\n\r\n if (ctor && !hasOwnConstructor && !hasIsPrototypeOf) {\r\n return false;\r\n }\r\n\r\n /* eslint-disable no-restricted-syntax */\r\n for (key in obj) {\r\n /**/\r\n }\r\n /* eslint-enable */\r\n\r\n return isUndefined(key) || hasOwnProperty.call(obj, key);\r\n};\r\n\r\n/**\r\n * Checks whether the given object is a HTMLElement.\r\n * @param obj The object which shall be checked.\r\n */\r\nexport const isHTMLElement = (obj: any): obj is HTMLElement => {\r\n const instanceofObj = HTMLElement;\r\n return obj\r\n ? instanceofObj\r\n ? obj instanceof instanceofObj\r\n : obj.nodeType === ElementNodeType\r\n : false;\r\n};\r\n\r\n/**\r\n * Checks whether the given object is a Element.\r\n * @param obj The object which shall be checked.\r\n */\r\nexport const isElement = (obj: any): obj is Element => {\r\n const instanceofObj = Element;\r\n return obj\r\n ? instanceofObj\r\n ? obj instanceof instanceofObj\r\n : obj.nodeType === ElementNodeType\r\n : false;\r\n};\r\n","import { isArray, isFunction, isPlainObject, isNull } from 'support/utils/types';\r\nimport { each } from 'support/utils/array';\r\n\r\n/**\r\n * Determines whether the passed object has a property with the passed name.\r\n * @param obj The object.\r\n * @param prop The name of the property.\r\n */\r\nexport const hasOwnProperty = (obj: any, prop: string | number | symbol): boolean =>\r\n Object.prototype.hasOwnProperty.call(obj, prop);\r\n\r\n/**\r\n * Returns the names of the enumerable string properties and methods of an object.\r\n * @param obj The object of which the properties shall be returned.\r\n */\r\nexport const keys = (obj: any): Array => (obj ? Object.keys(obj) : []);\r\n\r\ntype AssignDeep = {\r\n (target: T, object1: U): T & U;\r\n (target: T, object1: U, object2: V): T & U & V;\r\n (target: T, object1: U, object2: V, object3: W): T & U & V & W;\r\n (target: T, object1: U, object2: V, object3: W, object4: X): T & U & V & W & X;\r\n (target: T, object1: U, object2: V, object3: W, object4: X, object5: Y): T &\r\n U &\r\n V &\r\n W &\r\n X &\r\n Y;\r\n (\r\n target: T,\r\n object1?: U,\r\n object2?: V,\r\n object3?: W,\r\n object4?: X,\r\n object5?: Y,\r\n object6?: Z\r\n ): T & U & V & W & X & Y & Z;\r\n};\r\n\r\n// https://github.com/jquery/jquery/blob/master/src/core.js#L116\r\nexport const assignDeep: AssignDeep = (\r\n target: T,\r\n object1?: U,\r\n object2?: V,\r\n object3?: W,\r\n object4?: X,\r\n object5?: Y,\r\n object6?: Z\r\n): T & U & V & W & X & Y & Z => {\r\n const sources: Array = [object1, object2, object3, object4, object5, object6];\r\n\r\n // Handle case when target is a string or something (possible in deep copy)\r\n if ((typeof target !== 'object' || isNull(target)) && !isFunction(target)) {\r\n target = {} as T;\r\n }\r\n\r\n each(sources, (source) => {\r\n // Extend the base object\r\n each(keys(source), (key) => {\r\n const copy: any = source[key];\r\n\r\n // Prevent Object.prototype pollution\r\n // Prevent never-ending loop\r\n if (target === copy) {\r\n return true;\r\n }\r\n\r\n const copyIsArray = isArray(copy);\r\n\r\n // Recurse if we're merging plain objects or arrays\r\n if (copy && (isPlainObject(copy) || copyIsArray)) {\r\n const src = target[key];\r\n let clone: any = src;\r\n\r\n // Ensure proper type for the source value\r\n if (copyIsArray && !isArray(src)) {\r\n clone = [];\r\n } else if (!copyIsArray && !isPlainObject(src)) {\r\n clone = {};\r\n }\r\n\r\n // Never move original objects, clone them\r\n target[key] = assignDeep(clone, copy) as any;\r\n } else {\r\n target[key] = copy;\r\n }\r\n });\r\n });\r\n\r\n // Return the modified object\r\n return target as any;\r\n};\r\n\r\n/**\r\n * Returns true if the given object is empty, false otherwise.\r\n * @param obj The Object.\r\n */\r\nexport const isEmptyObject = (obj: any): boolean => {\r\n // eslint-disable-next-line no-restricted-syntax, no-unreachable-loop, guard-for-in\r\n for (const name in obj) return false;\r\n return true;\r\n /* eslint-enable */\r\n};\r\n","import { from } from 'support/utils/array';\r\nimport { isNumber, isString, isUndefined } from 'support/utils/types';\r\n\r\ntype GetSetPropName = 'scrollLeft' | 'scrollTop' | 'value';\r\n\r\ntype Attr = {\r\n (elm: HTMLElement | false | null | undefined, attrName: string): string | null;\r\n (elm: HTMLElement | false | null | undefined, attrName: string, value: string): void;\r\n (elm: HTMLElement | false | null | undefined, attrName: string, value?: string):\r\n | string\r\n | null\r\n | void;\r\n};\r\n\r\ntype GetSetProp = {\r\n (elm: HTMLElement | false | null | undefined): T;\r\n (elm: HTMLElement | false | null | undefined, value: T | false | null): void;\r\n (elm: HTMLElement | false | null | undefined, value?: T | false | null): T | void;\r\n};\r\n\r\nconst getSetProp = (\r\n topLeft: GetSetPropName,\r\n fallback: number | string,\r\n elm: HTMLElement | HTMLInputElement | false | null | undefined,\r\n value?: number | string | false | null\r\n): number | string | void => {\r\n if (isUndefined(value)) {\r\n return elm ? elm[topLeft] : fallback;\r\n }\r\n elm && (isString(value) || isNumber(value)) && (elm[topLeft] = value);\r\n};\r\n\r\n/**\r\n * Gets or sets a attribute with the given attribute of the given element depending whether the value attribute is given.\r\n * Returns null if the element has no attribute with the given name.\r\n * @param elm The element of which the attribute shall be get or set.\r\n * @param attrName The attribute name which shall be get or set.\r\n * @param value The value of the attribute which shall be set.\r\n */\r\nexport const attr = ((\r\n elm: HTMLElement | false | null | undefined,\r\n attrName: string,\r\n value?: string\r\n): string | null | void => {\r\n if (isUndefined(value)) {\r\n return elm ? elm.getAttribute(attrName) : null;\r\n }\r\n elm && elm.setAttribute(attrName, value);\r\n}) as Attr;\r\n\r\n/**\r\n * Treats the given attribute like the \"class\" attribute and adds or removes the given value from it.\r\n * @param elm The element.\r\n * @param attrName The attributeName to which the value shall be added or removed.\r\n * @param value The value which shall be added or removed.\r\n * @param add True if the value shall be added, false otherwise.\r\n */\r\nexport const attrClass = (\r\n elm: HTMLElement | false | null | undefined,\r\n attrName: string,\r\n value: string,\r\n add?: boolean\r\n) => {\r\n if (value) {\r\n const currValues = attr(elm, attrName) || '';\r\n const currValuesSet = new Set(currValues.split(' '));\r\n currValuesSet[add ? 'add' : 'delete'](value);\r\n\r\n attr(elm, attrName, from(currValuesSet).join(' ').trim());\r\n }\r\n};\r\n\r\n/**\r\n * Treats the given attribute like the \"class\" attribute and checks if the given value is in it.\r\n * @param elm The element.\r\n * @param attrName The attributeName from which the content shall be checked.\r\n * @param value The value.\r\n * @returns True if the given attribute has the value in it, false otherwise.\r\n */\r\nexport const hasAttrClass = (\r\n elm: HTMLElement | false | null | undefined,\r\n attrName: string,\r\n value: string\r\n) => {\r\n const currValues = attr(elm, attrName) || '';\r\n const currValuesSet = new Set(currValues.split(' '));\r\n return currValuesSet.has(value);\r\n};\r\n\r\n/**\r\n * Removes the given attribute from the given element.\r\n * @param elm The element of which the attribute shall be removed.\r\n * @param attrName The attribute name.\r\n */\r\nexport const removeAttr = (elm: Element | false | null | undefined, attrName: string): void => {\r\n elm && elm.removeAttribute(attrName);\r\n};\r\n\r\n/**\r\n * Gets or sets the scrollLeft value of the given element depending whether the value attribute is given.\r\n * @param elm The element of which the scrollLeft value shall be get or set.\r\n * @param value The scrollLeft value which shall be set.\r\n */\r\nexport const scrollLeft = ((\r\n elm: HTMLElement | false | null | undefined,\r\n value?: number | false | null\r\n): number | void => getSetProp('scrollLeft', 0, elm, value) as number) as GetSetProp;\r\n\r\n/**\r\n * Gets or sets the scrollTop value of the given element depending whether the value attribute is given.\r\n * @param elm The element of which the scrollTop value shall be get or set.\r\n * @param value The scrollTop value which shall be set.\r\n */\r\nexport const scrollTop = ((\r\n elm: HTMLElement | false | null | undefined,\r\n value?: number | false | null\r\n): number | void => getSetProp('scrollTop', 0, elm, value) as number) as GetSetProp;\r\n\r\n/**\r\n * Gets or sets the value of the given input element depending whether the value attribute is given.\r\n * @param elm The input element of which the value shall be get or set.\r\n * @param value The value which shall be set.\r\n */\r\nexport const val = ((\r\n elm: HTMLInputElement | false | null | undefined,\r\n value?: string\r\n): string | void => getSetProp('value', '', elm, value) as string) as GetSetProp;\r\n","import { isElement } from 'support/utils/types';\r\nimport { push, from } from 'support/utils/array';\r\n\r\ntype InputElementType = Node | Element | Node | false | null | undefined;\r\ntype OutputElementType = Node | Element | null;\r\n\r\nconst elmPrototype = Element.prototype;\r\n\r\n/**\r\n * Find all elements with the passed selector, outgoing (and including) the passed element or the document if no element was provided.\r\n * @param selector The selector which has to be searched by.\r\n * @param elm The element from which the search shall be outgoing.\r\n */\r\nconst find = (selector: string, elm?: InputElementType): Element[] => {\r\n const arr: Array = [];\r\n const rootElm = elm ? (isElement(elm) ? elm : null) : document;\r\n\r\n return rootElm ? push(arr, rootElm.querySelectorAll(selector)) : arr;\r\n};\r\n\r\n/**\r\n * Find the first element with the passed selector, outgoing (and including) the passed element or the document if no element was provided.\r\n * @param selector The selector which has to be searched by.\r\n * @param elm The element from which the search shall be outgoing.\r\n */\r\nconst findFirst = (selector: string, elm?: InputElementType): OutputElementType => {\r\n const rootElm = elm ? (isElement(elm) ? elm : null) : document;\r\n\r\n return rootElm ? rootElm.querySelector(selector) : null;\r\n};\r\n\r\n/**\r\n * Determines whether the passed element is matching with the passed selector.\r\n * @param elm The element which has to be compared with the passed selector.\r\n * @param selector The selector which has to be compared with the passed element. Additional selectors: ':visible' and ':hidden'.\r\n */\r\nconst is = (elm: InputElementType, selector: string): boolean => {\r\n if (isElement(elm)) {\r\n /* istanbul ignore next */\r\n // eslint-disable-next-line\r\n // @ts-ignore\r\n const fn: (...args: any) => boolean = elmPrototype.matches || elmPrototype.msMatchesSelector;\r\n return fn.call(elm, selector);\r\n }\r\n return false;\r\n};\r\n\r\n/**\r\n * Returns the children (no text-nodes or comments) of the passed element which are matching the passed selector. An empty array is returned if the passed element is null.\r\n * @param elm The element of which the children shall be returned.\r\n * @param selector The selector which must match with the children elements.\r\n */\r\nconst children = (elm: InputElementType, selector?: string): ReadonlyArray => {\r\n const childs: Array = [];\r\n\r\n return isElement(elm)\r\n ? push(\r\n childs,\r\n from(elm.children).filter((child) => (selector ? is(child, selector) : child))\r\n )\r\n : childs;\r\n};\r\n\r\n/**\r\n * Returns the childNodes (incl. text-nodes or comments etc.) of the passed element. An empty array is returned if the passed element is null.\r\n * @param elm The element of which the childNodes shall be returned.\r\n */\r\nconst contents = (elm: InputElementType): ReadonlyArray =>\r\n elm ? from(elm.childNodes) : [];\r\n\r\n/**\r\n * Returns the parent element of the passed element, or null if the passed element is null.\r\n * @param elm The element of which the parent element shall be returned.\r\n */\r\nconst parent = (elm: InputElementType): OutputElementType => (elm ? elm.parentElement : null);\r\n\r\nconst closest = (elm: InputElementType, selector: string): OutputElementType => {\r\n if (isElement(elm)) {\r\n const closestFn = elmPrototype.closest;\r\n if (closestFn) {\r\n return closestFn.call(elm, selector);\r\n }\r\n\r\n do {\r\n if (is(elm, selector)) {\r\n return elm as Element;\r\n }\r\n elm = parent(elm);\r\n } while (elm);\r\n }\r\n\r\n return null;\r\n};\r\n\r\n/**\r\n * Determines whether the given element lies between two selectors in the DOM.\r\n * @param elm The element.\r\n * @param highBoundarySelector The high boundary selector.\r\n * @param deepBoundarySelector The deep boundary selector.\r\n */\r\nconst liesBetween = (\r\n elm: InputElementType,\r\n highBoundarySelector: string,\r\n deepBoundarySelector: string\r\n): boolean => {\r\n const closestHighBoundaryElm = elm && closest(elm, highBoundarySelector);\r\n const closestDeepBoundaryElm = elm && findFirst(deepBoundarySelector, closestHighBoundaryElm);\r\n const deepBoundaryIsValid =\r\n closest(closestDeepBoundaryElm, highBoundarySelector) === closestHighBoundaryElm;\r\n\r\n return closestHighBoundaryElm && closestDeepBoundaryElm\r\n ? closestHighBoundaryElm === elm ||\r\n closestDeepBoundaryElm === elm ||\r\n (deepBoundaryIsValid &&\r\n closest(closest(elm, deepBoundarySelector), highBoundarySelector) !==\r\n closestHighBoundaryElm)\r\n : false;\r\n};\r\n\r\nexport { find, findFirst, is, children, contents, parent, liesBetween, closest };\r\n","import { isArrayLike } from 'support/utils/types';\r\nimport { each, from } from 'support/utils/array';\r\nimport { parent } from 'support/dom/traversal';\r\n\r\ntype NodeCollection = ArrayLike | Node | false | null | undefined;\r\n\r\n/**\r\n * Inserts Nodes before the given preferredAnchor element.\r\n * @param parentElm The parent of the preferredAnchor element or the element which shall be the parent of the inserted Nodes.\r\n * @param preferredAnchor The element before which the Nodes shall be inserted or null if the elements shall be appended at the end.\r\n * @param insertedElms The Nodes which shall be inserted.\r\n */\r\nconst before = (\r\n parentElm: Node | false | null | undefined,\r\n preferredAnchor: Node | false | null | undefined,\r\n insertedElms: NodeCollection\r\n): void => {\r\n if (insertedElms && parentElm) {\r\n let anchor: Node | false | null | undefined = preferredAnchor;\r\n let fragment: DocumentFragment | Node | null | undefined;\r\n\r\n if (isArrayLike(insertedElms)) {\r\n fragment = document.createDocumentFragment();\r\n\r\n // append all insertedElms to the fragment and if one of these is the anchor, change the anchor\r\n each(insertedElms, (insertedElm) => {\r\n if (insertedElm === anchor) {\r\n anchor = insertedElm.previousSibling;\r\n }\r\n fragment!.appendChild(insertedElm);\r\n });\r\n } else {\r\n fragment = insertedElms;\r\n }\r\n\r\n // if the preferred anchor isn't null set it to a valid anchor\r\n if (preferredAnchor) {\r\n if (!anchor) {\r\n anchor = parentElm.firstChild;\r\n } else if (anchor !== preferredAnchor) {\r\n anchor = anchor.nextSibling;\r\n }\r\n }\r\n\r\n parentElm.insertBefore(fragment, anchor || null);\r\n }\r\n};\r\n\r\n/**\r\n * Appends the given children at the end of the given Node.\r\n * @param node The Node to which the children shall be appended.\r\n * @param children The Nodes which shall be appended.\r\n */\r\nexport const appendChildren = (\r\n node: Node | false | null | undefined,\r\n children: NodeCollection\r\n): void => {\r\n before(node, null, children);\r\n};\r\n\r\n/**\r\n * Prepends the given children at the start of the given Node.\r\n * @param node The Node to which the children shall be prepended.\r\n * @param children The Nodes which shall be prepended.\r\n */\r\nexport const prependChildren = (\r\n node: Node | false | null | undefined,\r\n children: NodeCollection\r\n): void => {\r\n before(node, node && node.firstChild, children);\r\n};\r\n\r\n/**\r\n * Inserts the given Nodes before the given Node.\r\n * @param node The Node before which the given Nodes shall be inserted.\r\n * @param insertedNodes The Nodes which shall be inserted.\r\n */\r\nexport const insertBefore = (\r\n node: Node | false | null | undefined,\r\n insertedNodes: NodeCollection\r\n): void => {\r\n before(parent(node), node, insertedNodes);\r\n};\r\n\r\n/**\r\n * Inserts the given Nodes after the given Node.\r\n * @param node The Node after which the given Nodes shall be inserted.\r\n * @param insertedNodes The Nodes which shall be inserted.\r\n */\r\nexport const insertAfter = (\r\n node: Node | false | null | undefined,\r\n insertedNodes: NodeCollection\r\n): void => {\r\n before(parent(node), node && node.nextSibling, insertedNodes);\r\n};\r\n\r\n/**\r\n * Removes the given Nodes from their parent.\r\n * @param nodes The Nodes which shall be removed.\r\n */\r\nexport const removeElements = (nodes: NodeCollection): void => {\r\n if (isArrayLike(nodes)) {\r\n each(from(nodes), (e) => removeElements(e));\r\n } else if (nodes) {\r\n const parentElm = parent(nodes);\r\n if (parentElm) {\r\n parentElm.removeChild(nodes);\r\n }\r\n }\r\n};\r\n","import { each } from 'support/utils/array';\r\nimport { attr } from 'support/dom/attribute';\r\nimport { contents } from 'support/dom/traversal';\r\nimport { removeElements } from 'support/dom/manipulation';\r\n\r\n/**\r\n * Creates a div DOM node.\r\n */\r\nexport const createDiv = (classNames?: string): HTMLDivElement => {\r\n const div = document.createElement('div');\r\n if (classNames) {\r\n attr(div, 'class', classNames);\r\n }\r\n return div;\r\n};\r\n\r\n/**\r\n * Creates DOM nodes modeled after the passed html string and returns the root dom nodes as a array.\r\n * @param html The html string after which the DOM nodes shall be created.\r\n */\r\nexport const createDOM = (html: string): ReadonlyArray => {\r\n const createdDiv = createDiv();\r\n createdDiv.innerHTML = html.trim();\r\n\r\n return each(contents(createdDiv), (elm) => removeElements(elm));\r\n};\r\n","import { each } from 'support/utils/array';\r\nimport { hasOwnProperty } from 'support/utils/object';\r\nimport { createDiv } from 'support/dom/create';\r\n\r\nconst firstLetterToUpper = (str: string): string => str.charAt(0).toUpperCase() + str.slice(1);\r\nconst getDummyStyle = (): CSSStyleDeclaration => createDiv().style;\r\n\r\n// https://developer.mozilla.org/en-US/docs/Glossary/Vendor_Prefix\r\n\r\nexport const cssPrefixes: ReadonlyArray = ['-webkit-', '-moz-', '-o-', '-ms-'];\r\nexport const jsPrefixes: ReadonlyArray = [\r\n 'WebKit',\r\n 'Moz',\r\n 'O',\r\n 'MS',\r\n 'webkit',\r\n 'moz',\r\n 'o',\r\n 'ms',\r\n];\r\n\r\nexport const jsCache: { [key: string]: any } = {};\r\nexport const cssCache: { [key: string]: string } = {};\r\n\r\n/**\r\n * Gets the name of the given CSS property with vendor prefix if it isn't supported without it, or and empty string if unsupported.\r\n * @param name The name of the CSS property which shall be get.\r\n */\r\nexport const cssProperty = (name: string): string => {\r\n let result: string | undefined = cssCache[name];\r\n\r\n if (hasOwnProperty(cssCache, name)) {\r\n return result;\r\n }\r\n\r\n const uppercasedName: string = firstLetterToUpper(name);\r\n const elmStyle: CSSStyleDeclaration = getDummyStyle();\r\n\r\n each(cssPrefixes, (prefix: string) => {\r\n const prefixWithoutDashes: string = prefix.replace(/-/g, '');\r\n const resultPossibilities: Array = [\r\n name, // transition\r\n prefix + name, // -webkit-transition\r\n prefixWithoutDashes + uppercasedName, // webkitTransition\r\n firstLetterToUpper(prefixWithoutDashes) + uppercasedName, // WebkitTransition\r\n ];\r\n\r\n // eslint-disable-next-line no-return-assign\r\n return !(result = resultPossibilities.find(\r\n (resultPossibility: string) => elmStyle[resultPossibility] !== undefined\r\n ));\r\n });\r\n\r\n // eslint-disable-next-line no-return-assign\r\n return (cssCache[name] = result || '');\r\n};\r\n\r\n/**\r\n * Get the name of the given CSS property value(s), with vendor prefix if it isn't supported without it, or an empty string if no value is supported.\r\n * @param property The CSS property to which the CSS property value(s) belong.\r\n * @param values The value(s) separated by spaces which shall be get.\r\n * @param suffix A suffix which is added to each value in case the value is a function or something else more advanced.\r\n */\r\nexport const cssPropertyValue = (property: string, values: string, suffix?: string): string => {\r\n const name = `${property} ${values}`;\r\n let result: string | undefined = cssCache[name];\r\n\r\n if (hasOwnProperty(cssCache, name)) {\r\n return result;\r\n }\r\n\r\n const dummyStyle: CSSStyleDeclaration = getDummyStyle();\r\n const possbleValues: Array = values.split(' ');\r\n const preparedSuffix: string = suffix || '';\r\n const cssPrefixesWithFirstEmpty = [''].concat(cssPrefixes);\r\n\r\n each(possbleValues, (possibleValue: string) => {\r\n each(cssPrefixesWithFirstEmpty, (prefix: string) => {\r\n const prop = prefix + possibleValue;\r\n dummyStyle.cssText = `${property}:${prop}${preparedSuffix}`;\r\n if (dummyStyle.length) {\r\n result = prop;\r\n return false;\r\n }\r\n });\r\n return !result;\r\n });\r\n\r\n // eslint-disable-next-line no-return-assign\r\n return (cssCache[name] = result || '');\r\n};\r\n\r\n/**\r\n * Get the requested JS function, object or constructor with vendor prefix if it isn't supported without or undefined if unsupported.\r\n * @param name The name of the JS function, object or constructor.\r\n */\r\nexport const jsAPI = (name: string): T | undefined => {\r\n let result: any = jsCache[name] || window[name];\r\n\r\n if (hasOwnProperty(jsCache, name)) {\r\n return result;\r\n }\r\n\r\n each(jsPrefixes, (prefix: string) => {\r\n result = result || window[prefix + firstLetterToUpper(name)];\r\n return !result;\r\n });\r\n\r\n jsCache[name] = result;\r\n return result;\r\n};\r\n","import { jsAPI } from 'support/compatibility/vendors';\r\n\r\nexport const MutationObserverConstructor = jsAPI('MutationObserver');\r\nexport const IntersectionObserverConstructor =\r\n jsAPI('IntersectionObserver');\r\nexport const ResizeObserverConstructor = jsAPI('ResizeObserver');\r\nexport const cAF = jsAPI('cancelAnimationFrame');\r\nexport const rAF = jsAPI('requestAnimationFrame');\r\nexport const setT = window.setTimeout as (handler: TimerHandler, timeout?: number) => number;\r\nexport const clearT = window.clearTimeout as (id?: number) => void;\r\n","import { isString } from 'support/utils/types';\r\nimport { each } from 'support/utils/array';\r\nimport { keys } from 'support/utils/object';\r\n\r\ntype ClassContainingElement = Node | Element | false | null | undefined;\r\ntype ClassName = string | false | null | undefined;\r\n\r\nconst rnothtmlwhite = /[^\\x20\\t\\r\\n\\f]+/g;\r\nconst classListAction = (\r\n elm: ClassContainingElement,\r\n className: ClassName,\r\n action: (elmClassList: DOMTokenList, clazz: string) => boolean | void\r\n): boolean => {\r\n const classList = elm && (elm as Element).classList;\r\n let clazz: string;\r\n let i = 0;\r\n let result = false;\r\n\r\n if (classList && className && isString(className)) {\r\n const classes: Array = className.match(rnothtmlwhite) || [];\r\n result = classes.length > 0;\r\n while ((clazz = classes[i++])) {\r\n result = !!action(classList, clazz) && result;\r\n }\r\n }\r\n return result;\r\n};\r\n\r\n/**\r\n * Check whether the given element has the given class name(s).\r\n * @param elm The element.\r\n * @param className The class name(s).\r\n */\r\nexport const hasClass = (elm: ClassContainingElement, className: ClassName): boolean =>\r\n classListAction(elm, className, (classList, clazz) => classList.contains(clazz));\r\n\r\n/**\r\n * Removes the given class name(s) from the given element.\r\n * @param elm The element.\r\n * @param className The class name(s) which shall be removed. (separated by spaces)\r\n */\r\nexport const removeClass = (elm: ClassContainingElement, className: ClassName): void => {\r\n classListAction(elm, className, (classList, clazz) => classList.remove(clazz));\r\n};\r\n\r\n/**\r\n * Adds the given class name(s) to the given element.\r\n * @param elm The element.\r\n * @param className The class name(s) which shall be added. (separated by spaces)\r\n * @returns A function which removes the added class name(s).\r\n */\r\nexport const addClass = (elm: ClassContainingElement, className: ClassName): (() => void) => {\r\n classListAction(elm, className, (classList, clazz) => classList.add(clazz));\r\n return removeClass.bind(0, elm, className);\r\n};\r\n\r\n/**\r\n * Takes two className strings, compares them and returns the difference as array.\r\n * @param classNameA ClassName A.\r\n * @param classNameB ClassName B.\r\n */\r\nexport const diffClass = (classNameA: ClassName, classNameB: ClassName) => {\r\n const classNameASplit = classNameA && classNameA.split(' ');\r\n const classNameBSplit = classNameB && classNameB.split(' ');\r\n const tempObj = {};\r\n\r\n each(classNameASplit, (className) => {\r\n tempObj[className] = 1;\r\n });\r\n each(classNameBSplit, (className) => {\r\n if (tempObj[className]) {\r\n delete tempObj[className];\r\n } else {\r\n tempObj[className] = 1;\r\n }\r\n });\r\n\r\n return keys(tempObj);\r\n};\r\n","import { each } from 'support/utils/array';\r\nimport { WH, XY, TRBL } from 'support/dom';\r\nimport { PlainObject } from 'typings';\r\n\r\n/**\r\n * Compares two objects and returns true if all values of the passed prop names are identical, false otherwise or if one of the two object is falsy.\r\n * @param a Object a.\r\n * @param b Object b.\r\n * @param props The props which shall be compared.\r\n */\r\nexport const equal = (\r\n a: T | undefined,\r\n b: T | undefined,\r\n props: Array,\r\n propMutation?: ((value: any) => any) | null | false\r\n): boolean => {\r\n if (a && b) {\r\n let result = true;\r\n each(props, (prop) => {\r\n const compareA = propMutation ? propMutation(a[prop]) : a[prop];\r\n const compareB = propMutation ? propMutation(b[prop]) : b[prop];\r\n if (compareA !== compareB) {\r\n result = false;\r\n }\r\n });\r\n return result;\r\n }\r\n return false;\r\n};\r\n\r\n/**\r\n * Compares object a with object b and returns true if both have the same property values, false otherwise.\r\n * Also returns false if one of the objects is undefined or null.\r\n * @param a Object a.\r\n * @param b Object b.\r\n */\r\nexport const equalWH = (a?: WH, b?: WH) => equal>(a, b, ['w', 'h']);\r\n\r\n/**\r\n * Compares object a with object b and returns true if both have the same property values, false otherwise.\r\n * Also returns false if one of the objects is undefined or null.\r\n * @param a Object a.\r\n * @param b Object b.\r\n */\r\nexport const equalXY = (a?: XY, b?: XY) => equal>(a, b, ['x', 'y']);\r\n\r\n/**\r\n * Compares object a with object b and returns true if both have the same property values, false otherwise.\r\n * Also returns false if one of the objects is undefined or null.\r\n * @param a Object a.\r\n * @param b Object b.\r\n */\r\nexport const equalTRBL = (a?: TRBL, b?: TRBL) => equal(a, b, ['t', 'r', 'b', 'l']);\r\n\r\n/**\r\n * Compares two DOM Rects for their equality of their width and height properties\r\n * Also returns false if one of the DOM Rects is undefined or null.\r\n * @param a DOM Rect a.\r\n * @param b DOM Rect b.\r\n * @param round Whether the values should be rounded.\r\n */\r\nexport const equalBCRWH = (a?: DOMRect, b?: DOMRect, round?: boolean) =>\r\n equal(a, b, ['width', 'height'], round && ((value) => Math.round(value)));\r\n","import { isNumber, isFunction } from 'support/utils/types';\r\nimport { from } from 'support/utils/array';\r\nimport { rAF, cAF, setT, clearT } from 'support/compatibility/apis';\r\n\r\ntype DebounceTiming = number | false | null | undefined;\r\n\r\nexport interface DebounceOptions any> {\r\n /**\r\n * The timeout for debouncing. If null, no debounce is applied.\r\n */\r\n _timeout?: DebounceTiming | (() => DebounceTiming);\r\n /**\r\n * A maximum amount of ms. before the function will be called even with debounce.\r\n */\r\n _maxDelay?: DebounceTiming | (() => DebounceTiming);\r\n /**\r\n * Function which merges parameters for each canceled debounce.\r\n * If parameters can't be merged the function will return null, otherwise it returns the merged parameters.\r\n */\r\n _mergeParams?: (\r\n prev: Parameters,\r\n curr: Parameters\r\n ) => Parameters | false | null | undefined;\r\n}\r\n\r\nexport interface Debounced any> {\r\n (...args: Parameters): ReturnType;\r\n _flush(): void;\r\n}\r\n\r\nexport const noop = () => {}; // eslint-disable-line\r\n\r\nexport const selfCancelTimeout = (timeout?: number | (() => number)) => {\r\n let id: number;\r\n const setTFn = timeout ? setT : rAF!;\r\n const clearTFn = timeout ? clearT : cAF!;\r\n return [\r\n (callback: () => any) => {\r\n clearTFn(id);\r\n // @ts-ignore\r\n id = setTFn(callback, isFunction(timeout) ? timeout() : timeout);\r\n },\r\n () => clearTFn(id),\r\n ] as [timeout: (callback: () => any) => void, clear: () => void];\r\n};\r\n\r\n/**\r\n * Debounces the given function either with a timeout or a animation frame.\r\n * @param functionToDebounce The function which shall be debounced.\r\n * @param options Options for debouncing.\r\n */\r\nexport const debounce = any>(\r\n functionToDebounce: FunctionToDebounce,\r\n options?: DebounceOptions\r\n): Debounced => {\r\n let maxTimeoutId: number | undefined;\r\n let prevArguments: Parameters | null | undefined;\r\n let latestArguments: Parameters | null | undefined;\r\n let clear: () => void = noop;\r\n const { _timeout, _maxDelay, _mergeParams } = options || {};\r\n\r\n const invokeFunctionToDebounce = function (args: IArguments) {\r\n clear();\r\n clearT(maxTimeoutId);\r\n maxTimeoutId = prevArguments = undefined;\r\n clear = noop;\r\n // eslint-disable-next-line\r\n // @ts-ignore\r\n functionToDebounce.apply(this, args);\r\n };\r\n\r\n const mergeParms = (\r\n curr: Parameters\r\n ): Parameters | false | null | undefined =>\r\n _mergeParams && prevArguments ? _mergeParams(prevArguments, curr) : curr;\r\n\r\n const flush = () => {\r\n /* istanbul ignore next */\r\n if (clear !== noop) {\r\n invokeFunctionToDebounce(mergeParms(latestArguments!) || latestArguments!);\r\n }\r\n };\r\n\r\n const debouncedFn = function () {\r\n // eslint-disable-next-line prefer-rest-params\r\n const args: Parameters = from(arguments) as Parameters;\r\n const finalTimeout = isFunction(_timeout) ? _timeout() : _timeout;\r\n const hasTimeout = isNumber(finalTimeout) && finalTimeout >= 0;\r\n\r\n if (hasTimeout) {\r\n const finalMaxWait = isFunction(_maxDelay) ? _maxDelay() : _maxDelay;\r\n const hasMaxWait = isNumber(finalMaxWait) && finalMaxWait >= 0;\r\n const setTimeoutFn = finalTimeout > 0 ? setT : rAF!;\r\n const clearTimeoutFn = finalTimeout > 0 ? clearT : cAF!;\r\n const mergeParamsResult = mergeParms(args);\r\n const invokedArgs = mergeParamsResult || args;\r\n const boundInvoke = invokeFunctionToDebounce.bind(0, invokedArgs);\r\n\r\n // if (!mergeParamsResult) {\r\n // invokeFunctionToDebounce(prevArguments || args);\r\n // }\r\n\r\n clear();\r\n // @ts-ignore\r\n const timeoutId = setTimeoutFn(boundInvoke, finalTimeout);\r\n clear = () => clearTimeoutFn(timeoutId);\r\n\r\n if (hasMaxWait && !maxTimeoutId) {\r\n maxTimeoutId = setT(flush, finalMaxWait as number);\r\n }\r\n\r\n prevArguments = latestArguments = invokedArgs;\r\n } else {\r\n invokeFunctionToDebounce(args);\r\n }\r\n };\r\n debouncedFn._flush = flush;\r\n\r\n return debouncedFn as Debounced;\r\n};\r\n","import { style } from 'support/dom/style';\r\n\r\nexport interface WH {\r\n w: T;\r\n h: T;\r\n}\r\n\r\nconst { round } = Math;\r\nconst elementHasDimensions = (elm: HTMLElement): boolean =>\r\n !!(elm.offsetWidth || elm.offsetHeight || elm.getClientRects().length);\r\nconst zeroObj: WH = {\r\n w: 0,\r\n h: 0,\r\n};\r\n\r\n/**\r\n * Returns the window inner- width and height.\r\n */\r\nexport const windowSize = (): WH => ({\r\n w: window.innerWidth,\r\n h: window.innerHeight,\r\n});\r\n\r\n/**\r\n * Returns the scroll- width and height of the passed element. If the element is null the width and height values are 0.\r\n * @param elm The element of which the scroll- width and height shall be returned.\r\n */\r\nexport const offsetSize = (elm: HTMLElement | null | undefined): WH =>\r\n elm\r\n ? {\r\n w: elm.offsetWidth,\r\n h: elm.offsetHeight,\r\n }\r\n : zeroObj;\r\n\r\n/**\r\n * Returns the client- width and height of the passed element. If the element is null the width and height values are 0.\r\n * @param elm The element of which the client- width and height shall be returned.\r\n */\r\nexport const clientSize = (elm: HTMLElement | false | null | undefined): WH =>\r\n elm\r\n ? {\r\n w: elm.clientWidth,\r\n h: elm.clientHeight,\r\n }\r\n : zeroObj;\r\n\r\n/**\r\n * Returns the client- width and height of the passed element. If the element is null the width and height values are 0.\r\n * @param elm The element of which the client- width and height shall be returned.\r\n */\r\nexport const scrollSize = (elm: HTMLElement | false | null | undefined): WH =>\r\n elm\r\n ? {\r\n w: elm.scrollWidth,\r\n h: elm.scrollHeight,\r\n }\r\n : zeroObj;\r\n\r\n/**\r\n * Returns the fractional- width and height of the passed element. If the element is null the width and height values are 0.\r\n * @param elm The element of which the fractional- width and height shall be returned.\r\n */\r\nexport const fractionalSize = (elm: HTMLElement | false | null | undefined): WH => {\r\n const cssHeight = parseFloat(style(elm, 'height')) || 0;\r\n const cssWidth = parseFloat(style(elm, 'width')) || 0;\r\n return {\r\n w: cssWidth - round(cssWidth),\r\n h: cssHeight - round(cssHeight),\r\n };\r\n};\r\n\r\n/**\r\n * Returns the BoundingClientRect of the passed element.\r\n * @param elm The element of which the BoundingClientRect shall be returned.\r\n */\r\nexport const getBoundingClientRect = (elm: HTMLElement): DOMRect => elm.getBoundingClientRect();\r\n\r\n/**\r\n * Determines whether the passed element has any dimensions.\r\n * @param elm The element.\r\n */\r\nexport const hasDimensions = (elm: HTMLElement | false | null | undefined): boolean =>\r\n elm ? elementHasDimensions(elm as HTMLElement) : false;\r\n","import { isUndefined } from 'support/utils/types';\r\nimport { each, push, runEachAndClear } from 'support/utils/array';\r\n\r\nlet passiveEventsSupport: boolean;\r\nconst supportPassiveEvents = (): boolean => {\r\n if (isUndefined(passiveEventsSupport)) {\r\n passiveEventsSupport = false;\r\n try {\r\n /* eslint-disable */\r\n // @ts-ignore\r\n window.addEventListener(\r\n 'test',\r\n null,\r\n Object.defineProperty({}, 'passive', {\r\n get() {\r\n passiveEventsSupport = true;\r\n },\r\n })\r\n );\r\n /* eslint-enable */\r\n } catch (e) {}\r\n }\r\n return passiveEventsSupport;\r\n};\r\nconst splitEventNames = (eventNames: string) => eventNames.split(' ');\r\n\r\nexport interface OnOptions {\r\n _capture?: boolean;\r\n _passive?: boolean;\r\n _once?: boolean;\r\n}\r\n\r\n/**\r\n * Removes the passed event listener for the passed events with the passed options.\r\n * @param target The element from which the listener shall be removed.\r\n * @param eventNames The eventsnames for which the listener shall be removed.\r\n * @param listener The listener which shall be removed.\r\n * @param capture The options of the removed listener.\r\n */\r\nexport const off = (\r\n target: EventTarget,\r\n eventNames: string,\r\n listener: (event: T) => any,\r\n capture?: boolean\r\n): void => {\r\n each(splitEventNames(eventNames), (eventName) => {\r\n target.removeEventListener(eventName, listener as EventListener, capture);\r\n });\r\n};\r\n\r\n/**\r\n * Adds the passed event listener for the passed eventnames with the passed options.\r\n * @param target The element to which the listener shall be added.\r\n * @param eventNames The eventsnames for which the listener shall be called.\r\n * @param listener The listener which is called on the eventnames.\r\n * @param options The options of the added listener.\r\n */\r\nexport const on = (\r\n target: EventTarget,\r\n eventNames: string,\r\n listener: (event: T) => any,\r\n options?: OnOptions\r\n): (() => void) => {\r\n const doSupportPassiveEvents = supportPassiveEvents();\r\n const passive = (doSupportPassiveEvents && options && options._passive) ?? doSupportPassiveEvents;\r\n const capture = (options && options._capture) || false;\r\n const once = (options && options._once) || false;\r\n const offListeners: (() => void)[] = [];\r\n const nativeOptions: AddEventListenerOptions | boolean = doSupportPassiveEvents\r\n ? {\r\n passive,\r\n capture,\r\n }\r\n : capture;\r\n\r\n each(splitEventNames(eventNames), (eventName) => {\r\n const finalListener = (\r\n once\r\n ? (evt: T) => {\r\n target.removeEventListener(eventName, finalListener, capture);\r\n listener && listener(evt);\r\n }\r\n : listener\r\n ) as EventListener;\r\n\r\n push(offListeners, off.bind(null, target, eventName, finalListener, capture));\r\n target.addEventListener(eventName, finalListener, nativeOptions);\r\n });\r\n\r\n return runEachAndClear.bind(0, offListeners);\r\n};\r\n\r\n/**\r\n * Shorthand for the stopPropagation event Method.\r\n * @param evt The event of which the stopPropagation method shall be called.\r\n */\r\nexport const stopPropagation = (evt: Event): void => evt.stopPropagation();\r\n\r\n/**\r\n * Shorthand for the preventDefault event Method.\r\n * @param evt The event of which the preventDefault method shall be called.\r\n */\r\nexport const preventDefault = (evt: Event): void => evt.preventDefault();\r\n\r\n/**\r\n * Shorthand for the stopPropagation and preventDefault event Method.\r\n * @param evt The event of which the stopPropagation and preventDefault methods shall be called.\r\n */\r\nexport const stopAndPrevent = (evt: Event): void =>\r\n (stopPropagation(evt) as undefined) || (preventDefault(evt) as undefined);\r\n","import { getBoundingClientRect } from 'support/dom/dimensions';\r\n\r\nexport interface XY {\r\n x: T;\r\n y: T;\r\n}\r\n\r\nconst zeroObj: XY = {\r\n x: 0,\r\n y: 0,\r\n};\r\n\r\n/**\r\n * Returns the offset- left and top coordinates of the passed element relative to the document. If the element is null the top and left values are 0.\r\n * @param elm The element of which the offset- top and left coordinates shall be returned.\r\n */\r\nexport const absoluteCoordinates = (elm: HTMLElement | null | undefined): XY => {\r\n const rect = elm ? getBoundingClientRect(elm) : 0;\r\n return rect\r\n ? {\r\n x: rect.left + window.pageYOffset,\r\n y: rect.top + window.pageXOffset,\r\n }\r\n : zeroObj;\r\n};\r\n\r\n/**\r\n * Returns the offset- left and top coordinates of the passed element. If the element is null the top and left values are 0.\r\n * @param elm The element of which the offset- top and left coordinates shall be returned.\r\n */\r\nexport const offsetCoordinates = (elm: HTMLElement | null | undefined): XY =>\r\n elm\r\n ? {\r\n x: elm.offsetLeft,\r\n y: elm.offsetTop,\r\n }\r\n : zeroObj;\r\n","import { isArray } from 'support/utils/types';\r\nimport { keys } from 'support/utils/object';\r\nimport { each, from, isEmptyArray } from 'support/utils/array';\r\n\r\nexport type EventListener<\r\n EventMap extends Record,\r\n N extends keyof EventMap = keyof EventMap\r\n> = (...args: EventMap[N]) => void;\r\n\r\nexport type InitialEventListeners> = {\r\n [K in keyof EventMap]?: EventListener | EventListener[];\r\n};\r\n\r\nconst manageListener = >(\r\n callback: (listener?: EventListener) => void,\r\n listener?: EventListener | EventListener[]\r\n) => {\r\n each(isArray(listener) ? listener : [listener], callback);\r\n};\r\n\r\nexport const createEventListenerHub = >(\r\n initialEventListeners?: InitialEventListeners\r\n) => {\r\n // eslint-disable-next-line @typescript-eslint/no-shadow\r\n type EventListener = (...args: EventMap[N]) => void;\r\n type RemoveEvent = {\r\n (name?: N, listener?: EventListener): void;\r\n (name?: N, listener?: EventListener[]): void;\r\n (name?: N, listener?: EventListener | EventListener[]): void;\r\n };\r\n type AddEvent = {\r\n (name: N, listener: EventListener): () => void;\r\n (name: N, listener: EventListener[]): () => void;\r\n (\r\n name: N,\r\n listener: EventListener | EventListener[]\r\n ): () => void;\r\n };\r\n type TriggerEvent = {\r\n (name: N, args?: EventMap[N]): void;\r\n };\r\n\r\n const events = new Map>();\r\n\r\n const removeEvent: RemoveEvent = (\r\n name?: N,\r\n listener?: EventListener | EventListener[]\r\n ): void => {\r\n if (name) {\r\n const eventSet = events.get(name);\r\n manageListener((currListener) => {\r\n if (eventSet) {\r\n eventSet[currListener ? 'delete' : 'clear'](currListener!);\r\n }\r\n }, listener as any);\r\n } else {\r\n events.forEach((eventSet) => {\r\n eventSet.clear();\r\n });\r\n events.clear();\r\n }\r\n };\r\n\r\n const addEvent: AddEvent = (\r\n name: N,\r\n listener: EventListener | EventListener[]\r\n ): (() => void) => {\r\n const eventSet = events.get(name) || new Set();\r\n events.set(name, eventSet);\r\n\r\n manageListener((currListener) => {\r\n currListener && eventSet.add(currListener);\r\n }, listener as any);\r\n\r\n return removeEvent.bind(0, name as any, listener as any);\r\n };\r\n\r\n const triggerEvent: TriggerEvent = (\r\n name: N,\r\n args?: EventMap[N]\r\n ): void => {\r\n const eventSet = events.get(name);\r\n\r\n each(from(eventSet), (event) => {\r\n if (args && !isEmptyArray(args)) {\r\n (event as (...eventArgs: EventMap[keyof EventMap]) => void).apply(0, args as any);\r\n } else {\r\n (event as () => void)();\r\n }\r\n });\r\n };\r\n\r\n const initialListenerKeys = keys(initialEventListeners) as Extract[];\r\n each(initialListenerKeys, (key) => {\r\n addEvent(key, initialEventListeners![key] as any);\r\n });\r\n\r\n return [addEvent, removeEvent, triggerEvent] as [AddEvent, RemoveEvent, TriggerEvent];\r\n};\r\n","import { assignDeep, each, isObject, keys, isArray, hasOwnProperty, isFunction } from 'support';\r\nimport { DeepPartial, DeepReadonly } from 'typings';\r\n\r\nconst opsStringify = (value: any) =>\r\n JSON.stringify(value, (_, val) => {\r\n if (isFunction(val)) {\r\n throw new Error();\r\n }\r\n return val;\r\n });\r\n\r\nexport type OverflowBehavior =\r\n | 'hidden'\r\n | 'scroll'\r\n | 'visible'\r\n | 'visible-hidden'\r\n | 'visible-scroll';\r\n\r\nexport type ScrollbarVisibilityBehavior = 'visible' | 'hidden' | 'auto';\r\n\r\nexport type ScrollbarAutoHideBehavior = 'never' | 'scroll' | 'leave' | 'move';\r\n\r\nexport interface Options {\r\n paddingAbsolute: boolean;\r\n showNativeOverlaidScrollbars: boolean;\r\n update: {\r\n elementEvents: Array<[elementSelector: string, eventNames: string]> | null;\r\n debounce: [timeout: number, maxWait: number] | number | null; // (if tuple: [timeout: 0, maxWait: 33], if number: [timeout: number, maxWait: false]) debounce for content Changes\r\n attributes: string[] | null;\r\n ignoreMutation: ((mutation: MutationRecord) => any) | null;\r\n };\r\n overflow: {\r\n x: OverflowBehavior;\r\n y: OverflowBehavior;\r\n };\r\n scrollbars: {\r\n theme: string | null;\r\n visibility: ScrollbarVisibilityBehavior;\r\n autoHide: ScrollbarAutoHideBehavior;\r\n autoHideDelay: number;\r\n dragScroll: boolean;\r\n clickScroll: boolean;\r\n pointers: string[] | null;\r\n };\r\n}\r\n\r\nexport type ReadonlyOptions = DeepReadonly;\r\n\r\nexport const defaultOptions: Options = {\r\n paddingAbsolute: false,\r\n showNativeOverlaidScrollbars: false,\r\n update: {\r\n elementEvents: [['img', 'load']],\r\n debounce: [0, 33],\r\n attributes: null,\r\n ignoreMutation: null,\r\n },\r\n overflow: {\r\n x: 'scroll',\r\n y: 'scroll',\r\n },\r\n scrollbars: {\r\n theme: 'os-theme-dark',\r\n visibility: 'auto',\r\n autoHide: 'never',\r\n autoHideDelay: 1300,\r\n dragScroll: true,\r\n clickScroll: false,\r\n pointers: ['mouse', 'touch', 'pen'],\r\n },\r\n};\r\n\r\nexport const getOptionsDiff = (currOptions: T, newOptions: DeepPartial): DeepPartial => {\r\n const diff: DeepPartial = {};\r\n const optionsKeys = keys(newOptions).concat(keys(currOptions));\r\n\r\n each(optionsKeys, (optionKey) => {\r\n const currOptionValue = currOptions[optionKey];\r\n const newOptionValue = newOptions[optionKey];\r\n\r\n if (isObject(currOptionValue) && isObject(newOptionValue)) {\r\n assignDeep((diff[optionKey] = {}), getOptionsDiff(currOptionValue, newOptionValue));\r\n } else if (hasOwnProperty(newOptions, optionKey) && newOptionValue !== currOptionValue) {\r\n let isDiff = true;\r\n\r\n if (isArray(currOptionValue) || isArray(newOptionValue)) {\r\n try {\r\n if (opsStringify(currOptionValue) === opsStringify(newOptionValue)) {\r\n isDiff = false;\r\n }\r\n } catch {}\r\n }\r\n\r\n if (isDiff) {\r\n diff[optionKey] = newOptionValue;\r\n }\r\n }\r\n });\r\n\r\n return diff;\r\n};\r\n","export const classNameEnvironment = 'os-environment';\r\nexport const classNameEnvironmentFlexboxGlue = `${classNameEnvironment}-flexbox-glue`;\r\nexport const classNameEnvironmentFlexboxGlueMax = `${classNameEnvironmentFlexboxGlue}-max`;\r\n\r\nexport const dataAttributeHost = 'data-overlayscrollbars';\r\nexport const dataAttributeHostOverflowX = `${dataAttributeHost}-overflow-x`;\r\nexport const dataAttributeHostOverflowY = `${dataAttributeHost}-overflow-y`;\r\nexport const dataValueHostOverflowVisible = 'overflowVisible';\r\nexport const dataValueHostScrollbarHidden = 'scrollbarHidden';\r\nexport const dataValueHostUpdating = 'updating';\r\nexport const classNamePadding = 'os-padding';\r\nexport const classNameViewport = 'os-viewport';\r\nexport const classNameViewportArrange = `${classNameViewport}-arrange`;\r\nexport const classNameContent = 'os-content';\r\nexport const classNameViewportScrollbarHidden = `${classNameViewport}-scrollbar-hidden`;\r\nexport const classNameOverflowVisible = `os-overflow-visible`;\r\n\r\nexport const classNameSizeObserver = 'os-size-observer';\r\nexport const classNameSizeObserverAppear = `${classNameSizeObserver}-appear`;\r\nexport const classNameSizeObserverListener = `${classNameSizeObserver}-listener`;\r\nexport const classNameSizeObserverListenerScroll = `${classNameSizeObserverListener}-scroll`;\r\nexport const classNameSizeObserverListenerItem = `${classNameSizeObserverListener}-item`;\r\nexport const classNameSizeObserverListenerItemFinal = `${classNameSizeObserverListenerItem}-final`;\r\n\r\nexport const classNameTrinsicObserver = 'os-trinsic-observer';\r\n\r\nexport const classNameScrollbar = 'os-scrollbar';\r\nexport const classNameScrollbarRtl = `${classNameScrollbar}-rtl`;\r\nexport const classNameScrollbarHorizontal = `${classNameScrollbar}-horizontal`;\r\nexport const classNameScrollbarVertical = `${classNameScrollbar}-vertical`;\r\nexport const classNameScrollbarTrack = `${classNameScrollbar}-track`;\r\nexport const classNameScrollbarHandle = `${classNameScrollbar}-handle`;\r\nexport const classNamesScrollbarVisible = `${classNameScrollbar}-visible`;\r\nexport const classNamesScrollbarCornerless = `${classNameScrollbar}-cornerless`;\r\nexport const classNamesScrollbarTransitionless = `${classNameScrollbar}-transitionless`;\r\nexport const classNamesScrollbarInteraction = `${classNameScrollbar}-interaction`;\r\nexport const classNamesScrollbarUnusable = `${classNameScrollbar}-unusable`;\r\nexport const classNamesScrollbarAutoHidden = `${classNameScrollbar}-auto-hidden`;\r\nexport const classNamesScrollbarWheel = `${classNameScrollbar}-wheel`;\r\nexport const classNamesScrollbarTrackInteractive = `${classNameScrollbarTrack}-interactive`;\r\nexport const classNamesScrollbarHandleInteractive = `${classNameScrollbarHandle}-interactive`;\r\n","import { each, isArray, keys } from 'support';\r\nimport { OverlayScrollbars, OverlayScrollbarsStatic } from 'overlayscrollbars';\r\n\r\nexport type PluginInstance =\r\n | Record\r\n | ((staticObj: OverlayScrollbarsStatic, instanceObj: OverlayScrollbars) => void);\r\nexport type Plugin = {\r\n [pluginName: string]: T;\r\n};\r\n\r\nconst pluginRegistry: Record = {};\r\n\r\nexport const getPlugins = () => pluginRegistry;\r\n\r\nexport const addPlugin = (addedPlugin: Plugin | Plugin[]): void => {\r\n each((isArray(addedPlugin) ? addedPlugin : [addedPlugin]) as Plugin[], (plugin) => {\r\n const pluginName = keys(plugin)[0];\r\n pluginRegistry[pluginName] = plugin[pluginName];\r\n });\r\n};\r\n","function _extends() {\n module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _extends.apply(this, arguments);\n}\n\nmodule.exports = _extends, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","import { each, hasOwnProperty, keys, push, isEmptyObject } from 'support/utils';\r\nimport { type, isArray, isUndefined, isPlainObject, isString } from 'support/utils/types';\r\nimport { PlainObject, DeepPartial } from 'typings';\r\n\r\nexport type OptionsObjectType = Record;\r\nexport type OptionsFunctionType = (this: any, ...args: any[]) => any;\r\nexport type OptionsTemplateType = ExtractPropsKey<\r\n OptionsTemplateTypeMap,\r\n T\r\n>;\r\nexport type OptionsTemplateTypes = keyof OptionsTemplateTypeMap;\r\nexport type OptionsTemplateNativeTypes = OptionsTemplateTypeMap[keyof OptionsTemplateTypeMap];\r\n\r\nexport type OptionsTemplateValue = T extends string\r\n ? string extends T\r\n ? OptionsTemplateValueNonEnum\r\n : string\r\n : OptionsTemplateValueNonEnum;\r\n\r\nexport type OptionsTemplate = {\r\n [P in keyof T]: T[P] extends OptionsObjectType\r\n ? OptionsTemplate\r\n : T[P] extends OptionsTemplateNativeTypes\r\n ? OptionsTemplateValue\r\n : never;\r\n};\r\n\r\nexport type OptionsValidationResult = [\r\n DeepPartial, // validated\r\n Record // foreign\r\n];\r\n\r\ntype OptionsTemplateTypeMap = {\r\n __TPL_boolean_TYPE__: boolean;\r\n __TPL_number_TYPE__: number;\r\n __TPL_string_TYPE__: string;\r\n __TPL_array_TYPE__: Array | ReadonlyArray;\r\n __TPL_function_TYPE__: OptionsFunctionType;\r\n __TPL_null_TYPE__: null;\r\n __TPL_object_TYPE__: OptionsObjectType;\r\n};\r\n\r\ntype OptionsTemplateValueNonEnum =\r\n | OptionsTemplateType\r\n | [OptionsTemplateType, ...Array];\r\n\r\ntype ExtractPropsKey = {\r\n [P in keyof T]: TProps extends T[P] ? P : never;\r\n}[keyof T];\r\n\r\ntype OptionsTemplateTypesDictionary = {\r\n readonly boolean: OptionsTemplateType;\r\n readonly number: OptionsTemplateType;\r\n readonly string: OptionsTemplateType;\r\n readonly array: OptionsTemplateType>;\r\n readonly object: OptionsTemplateType;\r\n readonly function: OptionsTemplateType;\r\n readonly null: OptionsTemplateType;\r\n};\r\n\r\nconst optionsTemplateTypes: OptionsTemplateTypesDictionary = {\r\n boolean: '__TPL_boolean_TYPE__',\r\n number: '__TPL_number_TYPE__',\r\n string: '__TPL_string_TYPE__',\r\n array: '__TPL_array_TYPE__',\r\n object: '__TPL_object_TYPE__',\r\n function: '__TPL_function_TYPE__',\r\n null: '__TPL_null_TYPE__',\r\n};\r\n\r\n/**\r\n * Validates the given options object according to the given template object and returns a object which looks like:\r\n * {\r\n * foreign : a object which consists of properties which aren't defined inside the template. (foreign properties)\r\n * validated : a object which consists only of valid properties. (property name is inside the template and value has a correct type)\r\n * }\r\n * @param template The template according to which the options object shall be validated.\r\n * @param options The options object which shall be validated.\r\n * @param optionsDiff When provided the returned validated object will only have properties which are different to this objects properties.\r\n * Example (assume all properties are valid to the template):\r\n * Options object : { a: 'a', b: 'b', c: 'c' }\r\n * optionsDiff object : { a: 'a', b: 'b', c: undefined }\r\n * Returned validated object : { c: 'c' }\r\n * Because the value of the properties a and b didn't change, they aren't included in the returned object.\r\n * Without the optionsDiff object the returned validated object would be: { a: 'a', b: 'b', c: 'c' }\r\n * @param doWriteErrors True if errors shall be logged into the console, false otherwise.\r\n * @param propPath The propertyPath which lead to this object. (used for error logging)\r\n */\r\nconst validateRecursive = (\r\n template: OptionsTemplate,\r\n options: DeepPartial,\r\n doWriteErrors?: boolean,\r\n propPath?: string\r\n): OptionsValidationResult => {\r\n const validatedOptions: DeepPartial = {};\r\n const optionsCopy: DeepPartial = { ...options };\r\n const props = keys(template).filter((prop) => hasOwnProperty(options, prop));\r\n\r\n each(props, (prop: Extract) => {\r\n const optionsValue: any = options[prop];\r\n const templateValue: PlainObject | string | OptionsTemplateTypes | Array =\r\n template[prop];\r\n const templateIsComplex = isPlainObject(templateValue);\r\n const propPrefix = propPath ? `${propPath}.` : '';\r\n\r\n // if the template has a object as value, it means that the options are complex (verschachtelt)\r\n if (templateIsComplex && isPlainObject(optionsValue)) {\r\n const [validated, foreign] = validateRecursive(\r\n templateValue as T,\r\n optionsValue,\r\n doWriteErrors,\r\n propPrefix + prop\r\n );\r\n validatedOptions[prop] = validated as any;\r\n optionsCopy[prop] = foreign as any;\r\n\r\n each([optionsCopy, validatedOptions], (value) => {\r\n if (isEmptyObject(value[prop])) {\r\n delete value[prop];\r\n }\r\n });\r\n } else if (!templateIsComplex) {\r\n let isValid = false;\r\n const errorEnumStrings: Array = [];\r\n const errorPossibleTypes: Array = [];\r\n const optionsValueType = type(optionsValue);\r\n const templateValueArr: Array = !isArray(templateValue)\r\n ? [templateValue as string | OptionsTemplateTypes]\r\n : (templateValue as Array);\r\n\r\n each(templateValueArr, (currTemplateType) => {\r\n // if currType value isn't inside possibleTemplateTypes we assume its a enum string value\r\n let typeString: string | undefined;\r\n each(optionsTemplateTypes, (value: string, key: string) => {\r\n if (value === currTemplateType) {\r\n typeString = key;\r\n }\r\n });\r\n const isEnumString = isUndefined(typeString);\r\n if (isEnumString && isString(optionsValue)) {\r\n // split it into a array which contains all possible values for example: [\"yes\", \"no\", \"maybe\"]\r\n const enumStringSplit = currTemplateType.split(' ');\r\n isValid = !!enumStringSplit.find((possibility) => possibility === optionsValue);\r\n\r\n // build error message\r\n push(errorEnumStrings, enumStringSplit);\r\n } else {\r\n isValid = optionsTemplateTypes[optionsValueType] === currTemplateType;\r\n }\r\n\r\n // build error message\r\n push(errorPossibleTypes, isEnumString ? optionsTemplateTypes.string : typeString!);\r\n\r\n // continue if invalid, break if valid\r\n return !isValid;\r\n });\r\n\r\n if (isValid) {\r\n validatedOptions[prop] = optionsValue;\r\n } else if (doWriteErrors) {\r\n console.warn(\r\n `${\r\n `The option \"${propPrefix}${prop}\" wasn't set, because it doesn't accept the type [ ${optionsValueType.toUpperCase()} ] with the value of \"${optionsValue}\".\\r\\n` +\r\n `Accepted types are: [ ${errorPossibleTypes.join(', ').toUpperCase()} ].\\r\\n`\r\n }${\r\n errorEnumStrings.length > 0\r\n ? `\\r\\nValid strings are: [ ${errorEnumStrings.join(', ')} ].`\r\n : ''\r\n }`\r\n );\r\n }\r\n\r\n delete optionsCopy[prop];\r\n }\r\n });\r\n\r\n return [validatedOptions, optionsCopy]; // optionsCopy equals now to foreign options\r\n};\r\n\r\n/**\r\n * Validates the given options object according to the given template object and returns a tuple which looks like:\r\n * [\r\n * validated : a object which consists only of valid properties. (property name is inside the template and value has a correct type)\r\n * foreign : a object which consists of properties which aren't defined inside the template. (foreign properties)\r\n * ]\r\n * @param template The template according to which the options object shall be validated.\r\n * @param options The options object which shall be validated.\r\n * @param doWriteErrors True if errors shall be logged into the console, false otherwise.\r\n */\r\nconst validateOptions = (\r\n template: OptionsTemplate,\r\n options: DeepPartial,\r\n doWriteErrors?: boolean\r\n): OptionsValidationResult => validateRecursive(template, options, doWriteErrors);\r\n\r\nexport { validateOptions, optionsTemplateTypes };\r\n","import {\r\n Options,\r\n OverflowBehavior,\r\n ScrollbarVisibilityBehavior,\r\n ScrollbarAutoHideBehavior,\r\n} from 'options';\r\nimport {\r\n validateOptions,\r\n OptionsTemplate,\r\n OptionsTemplateValue,\r\n optionsTemplateTypes as oTypes,\r\n} from 'plugins/optionsValidationPlugin/validation';\r\nimport type { DeepPartial } from 'typings';\r\nimport type { Plugin } from 'plugins';\r\n\r\nconst numberAllowedValues: OptionsTemplateValue = oTypes.number;\r\nconst booleanAllowedValues: OptionsTemplateValue = oTypes.boolean;\r\nconst arrayNullValues: OptionsTemplateValue | null> = [oTypes.array, oTypes.null];\r\nconst overflowAllowedValues: OptionsTemplateValue =\r\n 'hidden scroll visible visible-hidden';\r\nconst scrollbarsVisibilityAllowedValues: OptionsTemplateValue =\r\n 'visible hidden auto';\r\nconst scrollbarsAutoHideAllowedValues: OptionsTemplateValue =\r\n 'never scroll leavemove';\r\n\r\nconst optionsTemplate: OptionsTemplate = {\r\n // resize: resizeAllowedValues, // none || both || horizontal || vertical || n || b ||\r\n paddingAbsolute: booleanAllowedValues, // true || false\r\n showNativeOverlaidScrollbars: booleanAllowedValues, // true || false\r\n update: {\r\n elementEvents: arrayNullValues, // array of tuples || null\r\n attributes: arrayNullValues,\r\n debounce: [oTypes.number, oTypes.array, oTypes.null], // number || number array || null\r\n ignoreMutation: [oTypes.function, oTypes.null], // function || null\r\n },\r\n overflow: {\r\n x: overflowAllowedValues, // visible-hidden || visible-scroll || hidden || scrol\r\n y: overflowAllowedValues, // visible-hidden || visible-scroll || hidden || scrol\r\n },\r\n scrollbars: {\r\n theme: [oTypes.string, oTypes.null], // string || null\r\n visibility: scrollbarsVisibilityAllowedValues, // visible || hidden || auto || v ||\r\n autoHide: scrollbarsAutoHideAllowedValues, // never || scroll || leave || move ||\r\n autoHideDelay: numberAllowedValues, // number\r\n dragScroll: booleanAllowedValues, // true || false\r\n clickScroll: booleanAllowedValues, // true || false\r\n pointers: [oTypes.array, oTypes.null], // string array\r\n },\r\n /*\r\n textarea: {\r\n dynWidth: booleanAllowedValues, // true || false\r\n dynHeight: booleanAllowedValues, // true || false\r\n inheritedAttrs: stringArrayNullAllowedValues, // string || array || nul\r\n },\r\n */\r\n};\r\n\r\nexport type OptionsValidationPluginInstance = {\r\n _: (options: DeepPartial, doWriteErrors?: boolean) => DeepPartial;\r\n};\r\n\r\nexport const optionsValidationPluginName = '__osOptionsValidationPlugin';\r\n\r\nexport const optionsValidationPlugin: Plugin =\r\n /* @__PURE__ */ (() => ({\r\n [optionsValidationPluginName]: {\r\n _: (options: DeepPartial, doWriteErrors?: boolean) => {\r\n const [validated, foreign] = validateOptions(optionsTemplate, options, doWriteErrors);\r\n return { ...foreign, ...validated };\r\n },\r\n },\r\n }))();\r\n","import {\r\n createDOM,\r\n style,\r\n appendChildren,\r\n offsetSize,\r\n scrollLeft,\r\n scrollTop,\r\n on,\r\n addClass,\r\n equalWH,\r\n push,\r\n cAF,\r\n rAF,\r\n stopPropagation,\r\n} from 'support';\r\nimport {\r\n classNameSizeObserverListenerScroll,\r\n classNameSizeObserverListenerItem,\r\n classNameSizeObserverListenerItemFinal,\r\n} from 'classnames';\r\nimport type { Plugin } from 'plugins';\r\n\r\nexport type SizeObserverPluginInstance = {\r\n _: (\r\n listenerElement: HTMLElement,\r\n onSizeChangedCallback: (appear: boolean) => any,\r\n observeAppearChange: boolean\r\n ) => [appearCallback: () => any, offFns: (() => any)[]];\r\n};\r\n\r\nconst scrollAmount = 3333333;\r\nconst scrollEventName = 'scroll';\r\nexport const sizeObserverPluginName = '__osSizeObserverPlugin';\r\n\r\nexport const sizeObserverPlugin: Plugin = /* @__PURE__ */ (() => ({\r\n [sizeObserverPluginName]: {\r\n _: (listenerElement, onSizeChangedCallback, observeAppearChange) => {\r\n const observerElementChildren = createDOM(\r\n ``\r\n );\r\n appendChildren(listenerElement, observerElementChildren);\r\n addClass(listenerElement, classNameSizeObserverListenerScroll);\r\n const observerElementChildrenRoot = observerElementChildren[0] as HTMLElement;\r\n const shrinkElement = observerElementChildrenRoot.lastChild as HTMLElement;\r\n const expandElement = observerElementChildrenRoot.firstChild as HTMLElement;\r\n const expandElementChild = expandElement?.firstChild as HTMLElement;\r\n\r\n let cacheSize = offsetSize(observerElementChildrenRoot);\r\n let currSize = cacheSize;\r\n let isDirty = false;\r\n let rAFId: number;\r\n\r\n const reset = () => {\r\n scrollLeft(expandElement, scrollAmount);\r\n scrollTop(expandElement, scrollAmount);\r\n scrollLeft(shrinkElement, scrollAmount);\r\n scrollTop(shrinkElement, scrollAmount);\r\n };\r\n const onResized = (appear?: unknown) => {\r\n rAFId = 0;\r\n if (isDirty) {\r\n cacheSize = currSize;\r\n onSizeChangedCallback(appear === true);\r\n }\r\n };\r\n const onScroll = (scrollEvent?: Event | false) => {\r\n currSize = offsetSize(observerElementChildrenRoot);\r\n isDirty = !scrollEvent || !equalWH(currSize, cacheSize);\r\n\r\n if (scrollEvent) {\r\n stopPropagation(scrollEvent);\r\n\r\n if (isDirty && !rAFId) {\r\n cAF!(rAFId);\r\n rAFId = rAF!(onResized);\r\n }\r\n } else {\r\n onResized(scrollEvent === false);\r\n }\r\n\r\n reset();\r\n };\r\n const offListeners = push(\r\n [],\r\n [on(expandElement, scrollEventName, onScroll), on(shrinkElement, scrollEventName, onScroll)]\r\n );\r\n\r\n // lets assume that the divs will never be that large and a constant value is enough\r\n style(expandElementChild, {\r\n width: scrollAmount,\r\n height: scrollAmount,\r\n });\r\n\r\n rAF!(reset);\r\n\r\n return [observeAppearChange ? onScroll.bind(0, false) : reset, offListeners];\r\n },\r\n },\r\n}))();\r\n","import {\r\n keys,\r\n attr,\r\n WH,\r\n style,\r\n addClass,\r\n removeClass,\r\n noop,\r\n each,\r\n assignDeep,\r\n windowSize,\r\n UpdateCache,\r\n XY,\r\n} from 'support';\r\nimport { classNameViewportArrange } from 'classnames';\r\nimport type { StyleObject } from 'typings';\r\nimport type { StructureSetupState } from 'setups/structureSetup';\r\nimport type {\r\n ViewportOverflowState,\r\n GetViewportOverflowState,\r\n HideNativeScrollbars,\r\n} from 'setups/structureSetup/updateSegments/overflowUpdateSegment';\r\nimport type { InternalEnvironment } from 'environment';\r\nimport type { Plugin } from 'plugins';\r\n\r\nexport type ArrangeViewport = (\r\n viewportOverflowState: ViewportOverflowState,\r\n viewportScrollSize: WH,\r\n sizeFraction: WH,\r\n directionIsRTL: boolean\r\n) => boolean;\r\n\r\nexport type UndoViewportArrangeResult = [\r\n redoViewportArrange: () => void,\r\n overflowState?: ViewportOverflowState\r\n];\r\n\r\nexport type UndoArrangeViewport = (\r\n showNativeOverlaidScrollbars: boolean,\r\n directionIsRTL: boolean,\r\n viewportOverflowState?: ViewportOverflowState\r\n) => UndoViewportArrangeResult;\r\n\r\nexport type ScrollbarsHidingPluginInstance = {\r\n _createUniqueViewportArrangeElement(env: InternalEnvironment): HTMLStyleElement | false;\r\n _overflowUpdateSegment(\r\n doViewportArrange: boolean,\r\n flexboxGlue: boolean,\r\n viewport: HTMLElement,\r\n viewportArrange: HTMLStyleElement | false | null | undefined,\r\n getState: () => StructureSetupState,\r\n getViewportOverflowState: GetViewportOverflowState,\r\n hideNativeScrollbars: HideNativeScrollbars\r\n ): [ArrangeViewport, UndoArrangeViewport];\r\n _envWindowZoom(): (\r\n envInstance: InternalEnvironment,\r\n updateNativeScrollbarSizeCache: UpdateCache>,\r\n triggerEvent: () => void\r\n ) => void;\r\n};\r\n\r\nlet contentArrangeCounter = 0;\r\nconst { round, abs } = Math;\r\nconst getWindowDPR = (): number => {\r\n // eslint-disable-next-line\r\n // @ts-ignore\r\n const dDPI = window.screen.deviceXDPI || 0;\r\n // eslint-disable-next-line\r\n // @ts-ignore\r\n const sDPI = window.screen.logicalXDPI || 1;\r\n return window.devicePixelRatio || dDPI / sDPI;\r\n};\r\n\r\nconst diffBiggerThanOne = (valOne: number, valTwo: number): boolean => {\r\n const absValOne = abs(valOne);\r\n const absValTwo = abs(valTwo);\r\n return !(absValOne === absValTwo || absValOne + 1 === absValTwo || absValOne - 1 === absValTwo);\r\n};\r\n\r\nexport const scrollbarsHidingPluginName = '__osScrollbarsHidingPlugin';\r\n\r\nexport const scrollbarsHidingPlugin: Plugin =\r\n /* @__PURE__ */ (() => ({\r\n [scrollbarsHidingPluginName]: {\r\n _createUniqueViewportArrangeElement: (env: InternalEnvironment) => {\r\n const { _nativeScrollbarsHiding, _nativeScrollbarsOverlaid, _cssCustomProperties } = env;\r\n const create =\r\n !_cssCustomProperties &&\r\n !_nativeScrollbarsHiding &&\r\n (_nativeScrollbarsOverlaid.x || _nativeScrollbarsOverlaid.y);\r\n const result = create ? document.createElement('style') : false;\r\n\r\n if (result) {\r\n attr(result, 'id', `${classNameViewportArrange}-${contentArrangeCounter}`);\r\n contentArrangeCounter++;\r\n }\r\n\r\n return result;\r\n },\r\n _overflowUpdateSegment: (\r\n doViewportArrange,\r\n flexboxGlue,\r\n viewport,\r\n viewportArrange,\r\n getState,\r\n getViewportOverflowState,\r\n hideNativeScrollbars\r\n ) => {\r\n /**\r\n * Sets the styles of the viewport arrange element.\r\n * @param viewportOverflowState The viewport overflow state according to which the scrollbars shall be hidden.\r\n * @param viewportScrollSize The content scroll size.\r\n * @param directionIsRTL Whether the direction is RTL or not.\r\n * @returns A boolean which indicates whether the viewport arrange element was adjusted.\r\n */\r\n const arrangeViewport: ArrangeViewport = (\r\n viewportOverflowState,\r\n viewportScrollSize,\r\n sizeFraction,\r\n directionIsRTL\r\n ) => {\r\n if (doViewportArrange) {\r\n const { _viewportPaddingStyle } = getState();\r\n const { _scrollbarsHideOffset, _scrollbarsHideOffsetArrange } = viewportOverflowState;\r\n const { x: arrangeX, y: arrangeY } = _scrollbarsHideOffsetArrange;\r\n const { x: hideOffsetX, y: hideOffsetY } = _scrollbarsHideOffset;\r\n const viewportArrangeHorizontalPaddingKey: keyof StyleObject = directionIsRTL\r\n ? 'paddingRight'\r\n : 'paddingLeft';\r\n const viewportArrangeHorizontalPaddingValue = _viewportPaddingStyle[\r\n viewportArrangeHorizontalPaddingKey\r\n ] as number;\r\n const viewportArrangeVerticalPaddingValue = _viewportPaddingStyle.paddingTop as number;\r\n const fractionalContentWidth = viewportScrollSize.w + sizeFraction.w;\r\n const fractionalContenHeight = viewportScrollSize.h + sizeFraction.h;\r\n const arrangeSize = {\r\n w:\r\n hideOffsetY && arrangeY\r\n ? `${\r\n hideOffsetY + fractionalContentWidth - viewportArrangeHorizontalPaddingValue\r\n }px`\r\n : '',\r\n h:\r\n hideOffsetX && arrangeX\r\n ? `${\r\n hideOffsetX + fractionalContenHeight - viewportArrangeVerticalPaddingValue\r\n }px`\r\n : '',\r\n };\r\n\r\n // adjust content arrange / before element\r\n if (viewportArrange) {\r\n const { sheet } = viewportArrange;\r\n if (sheet) {\r\n const { cssRules } = sheet;\r\n if (cssRules) {\r\n if (!cssRules.length) {\r\n sheet.insertRule(\r\n `#${attr(viewportArrange, 'id')} + .${classNameViewportArrange}::before {}`,\r\n 0\r\n );\r\n }\r\n\r\n // @ts-ignore\r\n const ruleStyle = cssRules[0].style;\r\n\r\n ruleStyle.width = arrangeSize.w;\r\n ruleStyle.height = arrangeSize.h;\r\n }\r\n }\r\n } else {\r\n style<'--os-vaw' | '--os-vah'>(viewport, {\r\n '--os-vaw': arrangeSize.w,\r\n '--os-vah': arrangeSize.h,\r\n });\r\n }\r\n }\r\n\r\n return doViewportArrange;\r\n };\r\n\r\n /**\r\n * Removes all styles applied because of the viewport arrange strategy.\r\n * @param showNativeOverlaidScrollbars Whether native overlaid scrollbars are shown instead of hidden.\r\n * @param directionIsRTL Whether the direction is RTL or not.\r\n * @param viewportOverflowState The currentviewport overflow state or undefined if it has to be determined.\r\n * @returns A object with a function which applies all the removed styles and the determined viewport vverflow state.\r\n */\r\n const undoViewportArrange: UndoArrangeViewport = (\r\n showNativeOverlaidScrollbars,\r\n directionIsRTL,\r\n viewportOverflowState?\r\n ) => {\r\n if (doViewportArrange) {\r\n const finalViewportOverflowState =\r\n viewportOverflowState || getViewportOverflowState(showNativeOverlaidScrollbars);\r\n const { _viewportPaddingStyle: viewportPaddingStyle } = getState();\r\n const { _scrollbarsHideOffsetArrange } = finalViewportOverflowState;\r\n const { x: arrangeX, y: arrangeY } = _scrollbarsHideOffsetArrange;\r\n const finalPaddingStyle: StyleObject = {};\r\n const assignProps = (props: string) =>\r\n each(props.split(' '), (prop) => {\r\n finalPaddingStyle[prop] = viewportPaddingStyle[prop];\r\n });\r\n\r\n if (arrangeX) {\r\n assignProps('marginBottom paddingTop paddingBottom');\r\n }\r\n\r\n if (arrangeY) {\r\n assignProps('marginLeft marginRight paddingLeft paddingRight');\r\n }\r\n\r\n const prevStyle = style(viewport, keys(finalPaddingStyle));\r\n\r\n removeClass(viewport, classNameViewportArrange);\r\n\r\n if (!flexboxGlue) {\r\n finalPaddingStyle.height = '';\r\n }\r\n\r\n style(viewport, finalPaddingStyle);\r\n\r\n return [\r\n () => {\r\n hideNativeScrollbars(\r\n finalViewportOverflowState,\r\n directionIsRTL,\r\n doViewportArrange,\r\n prevStyle\r\n );\r\n style(viewport, prevStyle);\r\n addClass(viewport, classNameViewportArrange);\r\n },\r\n finalViewportOverflowState,\r\n ];\r\n }\r\n return [noop];\r\n };\r\n\r\n return [arrangeViewport, undoViewportArrange];\r\n },\r\n _envWindowZoom: () => {\r\n let size = { w: 0, h: 0 };\r\n let dpr = 0;\r\n\r\n return (envInstance, updateNativeScrollbarSizeCache, triggerEvent) => {\r\n const sizeNew = windowSize();\r\n const deltaSize = {\r\n w: sizeNew.w - size.w,\r\n h: sizeNew.h - size.h,\r\n };\r\n\r\n if (deltaSize.w === 0 && deltaSize.h === 0) {\r\n return;\r\n }\r\n\r\n const deltaAbsSize = {\r\n w: abs(deltaSize.w),\r\n h: abs(deltaSize.h),\r\n };\r\n const deltaAbsRatio = {\r\n w: abs(round(sizeNew.w / (size.w / 100.0))),\r\n h: abs(round(sizeNew.h / (size.h / 100.0))),\r\n };\r\n const dprNew = getWindowDPR();\r\n const deltaIsBigger = deltaAbsSize.w > 2 && deltaAbsSize.h > 2;\r\n const difference = !diffBiggerThanOne(deltaAbsRatio.w, deltaAbsRatio.h);\r\n const dprChanged = dprNew !== dpr && dprNew > 0;\r\n const isZoom = deltaIsBigger && difference && dprChanged;\r\n\r\n if (isZoom) {\r\n const [scrollbarSize, scrollbarSizeChanged] = updateNativeScrollbarSizeCache();\r\n\r\n assignDeep(envInstance._nativeScrollbarsSize, scrollbarSize); // keep the object same!\r\n\r\n if (scrollbarSizeChanged) {\r\n triggerEvent();\r\n }\r\n }\r\n\r\n size = sizeNew;\r\n dpr = dprNew;\r\n };\r\n },\r\n },\r\n }))();\r\n","import {\r\n createDOM,\r\n addClass,\r\n style,\r\n appendChildren,\r\n fractionalSize,\r\n clientSize,\r\n absoluteCoordinates,\r\n offsetSize,\r\n scrollLeft,\r\n XY,\r\n removeAttr,\r\n removeElements,\r\n equalBCRWH,\r\n getBoundingClientRect,\r\n assignDeep,\r\n cssProperty,\r\n createCache,\r\n equalXY,\r\n createEventListenerHub,\r\n EventListener,\r\n} from 'support';\r\nimport {\r\n classNameEnvironment,\r\n classNameEnvironmentFlexboxGlue,\r\n classNameEnvironmentFlexboxGlueMax,\r\n classNameViewportScrollbarHidden,\r\n} from 'classnames';\r\nimport { Options, defaultOptions } from 'options';\r\nimport { DeepPartial } from 'typings';\r\nimport { Initialization } from 'initialization';\r\nimport { getPlugins, ScrollbarsHidingPluginInstance, scrollbarsHidingPluginName } from 'plugins';\r\n\r\ntype EnvironmentEventMap = {\r\n _: [];\r\n};\r\n\r\nexport interface InternalEnvironment {\r\n readonly _nativeScrollbarsSize: XY;\r\n readonly _nativeScrollbarsOverlaid: XY;\r\n readonly _nativeScrollbarsHiding: boolean;\r\n readonly _rtlScrollBehavior: { n: boolean; i: boolean };\r\n readonly _flexboxGlue: boolean;\r\n readonly _cssCustomProperties: boolean;\r\n readonly _staticDefaultInitialization: Initialization;\r\n readonly _staticDefaultOptions: Options;\r\n _addListener(listener: EventListener): () => void;\r\n _getDefaultInitialization(): Initialization;\r\n _setDefaultInitialization(newInitialization: DeepPartial): void;\r\n _getDefaultOptions(): Options;\r\n _setDefaultOptions(newDefaultOptions: DeepPartial): void;\r\n}\r\n\r\nlet environmentInstance: InternalEnvironment;\r\n\r\nconst getNativeScrollbarSize = (\r\n body: HTMLElement,\r\n measureElm: HTMLElement,\r\n measureElmChild: HTMLElement,\r\n clear?: boolean\r\n): XY => {\r\n appendChildren(body, measureElm);\r\n\r\n const cSize = clientSize(measureElm);\r\n const oSize = offsetSize(measureElm);\r\n const fSize = fractionalSize(measureElmChild);\r\n\r\n clear && removeElements(measureElm);\r\n\r\n return {\r\n x: oSize.h - cSize.h + fSize.h,\r\n y: oSize.w - cSize.w + fSize.w,\r\n };\r\n};\r\n\r\nconst getNativeScrollbarsHiding = (testElm: HTMLElement): boolean => {\r\n let result = false;\r\n const revertClass = addClass(testElm, classNameViewportScrollbarHidden);\r\n try {\r\n result =\r\n style(testElm, cssProperty('scrollbar-width')) === 'none' ||\r\n window.getComputedStyle(testElm, '::-webkit-scrollbar').getPropertyValue('display') ===\r\n 'none';\r\n } catch (ex) {}\r\n revertClass();\r\n return result;\r\n};\r\n\r\nconst getRtlScrollBehavior = (\r\n parentElm: HTMLElement,\r\n childElm: HTMLElement\r\n): { i: boolean; n: boolean } => {\r\n const strHidden = 'hidden';\r\n style(parentElm, { overflowX: strHidden, overflowY: strHidden, direction: 'rtl' });\r\n scrollLeft(parentElm, 0);\r\n\r\n const parentOffset = absoluteCoordinates(parentElm);\r\n const childOffset = absoluteCoordinates(childElm);\r\n scrollLeft(parentElm, -999); // https://github.com/KingSora/OverlayScrollbars/issues/187\r\n const childOffsetAfterScroll = absoluteCoordinates(childElm);\r\n return {\r\n /**\r\n * origin direction = determines if the zero scroll position is on the left or right side\r\n * 'i' means 'invert' (i === true means that the axis must be inverted to be correct)\r\n * true = on the left side\r\n * false = on the right side\r\n */\r\n i: parentOffset.x === childOffset.x,\r\n /**\r\n * negative = determines if the maximum scroll is positive or negative\r\n * 'n' means 'negate' (n === true means that the axis must be negated to be correct)\r\n * true = negative\r\n * false = positive\r\n */\r\n n: childOffset.x !== childOffsetAfterScroll.x,\r\n };\r\n};\r\n\r\nconst getFlexboxGlue = (parentElm: HTMLElement, childElm: HTMLElement): boolean => {\r\n const revertFbxGlue = addClass(parentElm, classNameEnvironmentFlexboxGlue);\r\n const minOffsetsizeParent = getBoundingClientRect(parentElm);\r\n const minOffsetsize = getBoundingClientRect(childElm);\r\n const supportsMin = equalBCRWH(minOffsetsize, minOffsetsizeParent, true);\r\n\r\n const revertFbxGlueMax = addClass(parentElm, classNameEnvironmentFlexboxGlueMax);\r\n const maxOffsetsizeParent = getBoundingClientRect(parentElm);\r\n const maxOffsetsize = getBoundingClientRect(childElm);\r\n const supportsMax = equalBCRWH(maxOffsetsize, maxOffsetsizeParent, true);\r\n\r\n revertFbxGlue();\r\n revertFbxGlueMax();\r\n\r\n return supportsMin && supportsMax;\r\n};\r\n\r\nconst createEnvironment = (): InternalEnvironment => {\r\n const { body } = document;\r\n const envDOM = createDOM(``);\r\n const envElm = envDOM[0] as HTMLElement;\r\n const envChildElm = envElm.firstChild as HTMLElement;\r\n const [addEvent, , triggerEvent] = createEventListenerHub