diff --git a/packages/overlayscrollbars/dist/browser/overlayscrollbars.browser.es5.js b/packages/overlayscrollbars/dist/browser/overlayscrollbars.browser.es5.js
index f882850..ba08eaf 100644
--- a/packages/overlayscrollbars/dist/browser/overlayscrollbars.browser.es5.js
+++ b/packages/overlayscrollbars/dist/browser/overlayscrollbars.browser.es5.js
@@ -30,9 +30,9 @@ var OverlayScrollbars = function(r) {
if (n) {
var t = e ? "" : {};
if (r) {
- var v = window.getComputedStyle(r, null);
- t = e ? Pr(r, v, a) : a.reduce((function(a, e) {
- a[e] = Pr(r, v, e);
+ var i = window.getComputedStyle(r, null);
+ t = e ? Pr(r, i, a) : a.reduce((function(a, e) {
+ a[e] = Pr(r, i, e);
return a;
}), t);
}
@@ -47,36 +47,36 @@ var OverlayScrollbars = function(r) {
}
var a = function createCache(r, a) {
var e = r.o, n = r.u, t = r.g;
- var v = e;
- var i;
+ var i = e;
+ var v;
var o = function cacheUpdateContextual(r, a) {
- var e = v;
+ var e = i;
var o = r;
var u = a || (n ? !n(e, o) : e !== o);
if (u || t) {
- v = o;
- i = e;
+ i = o;
+ v = e;
}
- return [ v, u, i ];
+ return [ i, u, v ];
};
var u = function cacheUpdateIsolated(r) {
- return o(a(v, i), r);
+ return o(a(i, v), r);
};
var f = function getCurrentCache(r) {
- return [ v, !!r, i ];
+ return [ i, !!r, v ];
};
return [ a ? u : o, f ];
};
var e = Node.ELEMENT_NODE;
- var n = Object.prototype, t = n.toString, v = n.hasOwnProperty;
- var i = function isUndefined(r) {
+ var n = Object.prototype, t = n.toString, i = n.hasOwnProperty;
+ var v = function isUndefined(r) {
return void 0 === r;
};
var o = function isNull(r) {
return null === r;
};
var u = function type(r) {
- return i(r) || o(r) ? "" + r : t.call(r).replace(/^\[object (.+)\]$/, "$1").toLowerCase();
+ return v(r) || o(r) ? "" + r : t.call(r).replace(/^\[object (.+)\]$/, "$1").toLowerCase();
};
var f = function isNumber(r) {
return "number" === typeof r;
@@ -109,13 +109,13 @@ var OverlayScrollbars = function(r) {
var e = "constructor";
var n = r[e];
var t = n && n.prototype;
- var o = v.call(r, e);
- var f = t && v.call(t, "isPrototypeOf");
+ var o = i.call(r, e);
+ var f = t && i.call(t, "isPrototypeOf");
if (n && !o && !f) {
return false;
}
for (a in r) {}
- return i(a) || v.call(r, a);
+ return v(a) || i.call(r, a);
};
var w = function isHTMLElement(r) {
var a = HTMLElement;
@@ -165,8 +165,8 @@ var OverlayScrollbars = function(r) {
var E = function keys(r) {
return r ? Object.keys(r) : [];
};
- var A = function assignDeep(r, a, e, n, t, v, i) {
- var u = [ a, e, n, t, v, i ];
+ var A = function assignDeep(r, a, e, n, t, i, v) {
+ var u = [ a, e, n, t, i, v ];
if (("object" !== typeof r || o(r)) && !s(r)) {
r = {};
}
@@ -178,14 +178,14 @@ var OverlayScrollbars = function(r) {
}
var t = d(n);
if (n && (p(n) || t)) {
- var v = r[e];
- var i = v;
- if (t && !d(v)) {
- i = [];
- } else if (!t && !p(v)) {
- i = {};
+ var i = r[e];
+ var v = i;
+ if (t && !d(i)) {
+ v = [];
+ } else if (!t && !p(i)) {
+ v = {};
}
- r[e] = assignDeep(i, n);
+ r[e] = assignDeep(v, n);
} else {
r[e] = n;
}
@@ -200,13 +200,13 @@ var OverlayScrollbars = function(r) {
return true;
};
var z = function getSetProp(r, a, e, n) {
- if (i(n)) {
+ if (v(n)) {
return e ? e[r] : a;
}
e && (l(n) || f(n)) && (e[r] = n);
};
var L = function attr(r, a, e) {
- if (i(e)) {
+ if (v(e)) {
return r ? r.getAttribute(a) : null;
}
r && r.setAttribute(a, e);
@@ -214,9 +214,9 @@ var OverlayScrollbars = function(r) {
var T = function attrClass(r, a, e, n) {
if (e) {
var t = L(r, a) || "";
- var v = new Set(t.split(" "));
- v[n ? "add" : "delete"](e);
- L(r, a, S(v).join(" ").trim());
+ var i = new Set(t.split(" "));
+ i[n ? "add" : "delete"](e);
+ L(r, a, S(i).join(" ").trim());
}
};
var H = function hasAttrClass(r, a, e) {
@@ -274,8 +274,8 @@ var OverlayScrollbars = function(r) {
var U = function liesBetween(r, a, e) {
var n = r && q(r, a);
var t = r && k(e, n);
- var v = q(t, a) === n;
- return n && t ? n === r || t === r || v && q(q(r, e), a) !== n : false;
+ var i = q(t, a) === n;
+ return n && t ? n === r || t === r || i && q(q(r, e), a) !== n : false;
};
var N = function before(r, a, e) {
if (e && r) {
@@ -355,9 +355,9 @@ var OverlayScrollbars = function(r) {
var e = J(r);
var n = K();
each(Q, (function(t) {
- var v = t.replace(/-/g, "");
- var i = [ r, t + r, v + e, J(v) + e ];
- return !(a = i.find((function(r) {
+ var i = t.replace(/-/g, "");
+ var v = [ r, t + r, i + e, J(i) + e ];
+ return !(a = v.find((function(r) {
return void 0 !== n[r];
})));
}));
@@ -375,8 +375,8 @@ var OverlayScrollbars = function(r) {
ar[r] = a;
return a;
};
- var vr = tr("MutationObserver");
- var ir = tr("IntersectionObserver");
+ var ir = tr("MutationObserver");
+ var vr = tr("IntersectionObserver");
var or = tr("ResizeObserver");
var ur = tr("cancelAnimationFrame");
var fr = tr("requestAnimationFrame");
@@ -386,16 +386,16 @@ var OverlayScrollbars = function(r) {
var dr = function classListAction(r, a, e) {
var n = r && r.classList;
var t;
- var v = 0;
- var i = false;
+ var i = 0;
+ var v = false;
if (n && a && l(a)) {
var o = a.match(sr) || [];
- i = o.length > 0;
- while (t = o[v++]) {
- i = !!e(n, t) && i;
+ v = o.length > 0;
+ while (t = o[i++]) {
+ v = !!e(n, t) && v;
}
}
- return i;
+ return v;
};
var hr = function hasClass(r, a) {
return dr(r, a, (function(r, a) {
@@ -417,9 +417,9 @@ var OverlayScrollbars = function(r) {
if (r && a) {
var t = true;
each(e, (function(e) {
- var v = n ? n(r[e]) : r[e];
- var i = n ? n(a[e]) : a[e];
- if (v !== i) {
+ var i = n ? n(r[e]) : r[e];
+ var v = n ? n(a[e]) : a[e];
+ if (i !== v) {
t = false;
}
}));
@@ -457,28 +457,28 @@ var OverlayScrollbars = function(r) {
var e;
var n;
var t;
- var v = Sr;
- var i = a || {}, o = i.p, u = i._, l = i.m;
+ var i = Sr;
+ var v = a || {}, o = v.p, u = v._, l = v.m;
var c = function invokeFunctionToDebounce(a) {
- v();
+ i();
cr(e);
e = n = void 0;
- v = Sr;
+ i = Sr;
r.apply(this, a);
};
var d = function mergeParms(r) {
return l && n ? l(n, r) : r;
};
var h = function flush() {
- if (v !== Sr) {
+ if (i !== Sr) {
c(d(t) || t);
}
};
var g = function debouncedFn() {
var r = S(arguments);
var a = s(o) ? o() : o;
- var i = f(a) && a >= 0;
- if (i) {
+ var v = f(a) && a >= 0;
+ if (v) {
var l = s(u) ? u() : u;
var g = f(l) && l >= 0;
var p = a > 0 ? lr : fr;
@@ -486,9 +486,9 @@ var OverlayScrollbars = function(r) {
var b = d(r);
var m = b || r;
var y = c.bind(0, m);
- v();
+ i();
var C = p(y, a);
- v = function clear() {
+ i = function clear() {
return w(C);
};
if (g && !e) {
@@ -519,7 +519,7 @@ var OverlayScrollbars = function(r) {
var zr = function setCSSVal(r, a, e) {
try {
var n = r.style;
- if (!i(n[a])) {
+ if (!v(n[a])) {
n[a] = Ar(a, e);
} else {
n.setProperty(a, e);
@@ -532,14 +532,14 @@ var OverlayScrollbars = function(r) {
var Tr = function topRightBottomLeft(r, a, e) {
var n = a ? a + "-" : "";
var t = e ? "-" + e : "";
- var v = n + "top" + t;
- var i = n + "right" + t;
+ var i = n + "top" + t;
+ var v = n + "right" + t;
var o = n + "bottom" + t;
var u = n + "left" + t;
- var f = style(r, [ v, i, o, u ]);
+ var f = style(r, [ i, v, o, u ]);
return {
- t: Er(f[v]),
- r: Er(f[i]),
+ t: Er(f[i]),
+ r: Er(f[v]),
b: Er(f[o]),
l: Er(f[u])
};
@@ -586,7 +586,7 @@ var OverlayScrollbars = function(r) {
};
var Br;
var Fr = function supportPassiveEvents() {
- if (i(Br)) {
+ if (v(Br)) {
Br = false;
try {
window.addEventListener("test", null, Object.defineProperty({}, "passive", {
@@ -608,13 +608,13 @@ var OverlayScrollbars = function(r) {
};
var Nr = function on(r, a, e, n) {
var t;
- var v = Fr();
- var i = null != (t = v && n && n.C) ? t : v;
+ var i = Fr();
+ var v = null != (t = i && n && n.C) ? t : i;
var o = n && n.O || false;
var u = n && n.A || false;
var f = [];
- var l = v ? {
- passive: i,
+ var l = i ? {
+ passive: v,
capture: o
} : o;
each(qr(a), (function(a) {
@@ -682,8 +682,8 @@ var OverlayScrollbars = function(r) {
}
}));
};
- var v = E(r);
- each(v, (function(a) {
+ var i = E(r);
+ each(i, (function(a) {
n(a, r[a]);
}));
return [ n, e, t ];
@@ -724,20 +724,20 @@ var OverlayScrollbars = function(r) {
var n = E(a).concat(E(r));
each(n, (function(n) {
var t = r[n];
- var v = a[n];
- if (h(t) && h(v)) {
- A(e[n] = {}, getOptionsDiff(t, v));
- } else if (x(a, n) && v !== t) {
- var i = true;
- if (d(t) || d(v)) {
+ var i = a[n];
+ if (h(t) && h(i)) {
+ A(e[n] = {}, getOptionsDiff(t, i));
+ } else if (x(a, n) && i !== t) {
+ var v = true;
+ if (d(t) || d(i)) {
try {
- if (Jr(t) === Jr(v)) {
- i = false;
+ if (Jr(t) === Jr(i)) {
+ v = false;
}
} catch (o) {}
}
- if (i) {
- e[n] = v;
+ if (v) {
+ e[n] = i;
}
}
}));
@@ -748,8 +748,8 @@ var OverlayScrollbars = function(r) {
var ea = aa + "-max";
var na = "data-overlayscrollbars";
var ta = na + "-overflow-x";
- var va = na + "-overflow-y";
- var ia = "overflowVisible";
+ var ia = na + "-overflow-y";
+ var va = "overflowVisible";
var oa = "scrollbarHidden";
var ua = "updating";
var fa = "os-padding";
@@ -810,7 +810,7 @@ var OverlayScrollbars = function(r) {
}
r.exports = _extends, r.exports.v = true, r.exports["default"] = r.exports;
})(Ba);
- var Fa = getDefaultExportFromCjs(Ba.exports);
+ var Fa = /*@__PURE__*/ getDefaultExportFromCjs(Ba.exports);
var qa = {
boolean: "__TPL_boolean_TYPE__",
number: "__TPL_number_TYPE__",
@@ -822,7 +822,7 @@ var OverlayScrollbars = function(r) {
};
var Ua = function validateRecursive(r, a, e, n) {
var t = {};
- var v = Fa({}, a);
+ var i = Fa({}, a);
var o = E(r).filter((function(r) {
return x(a, r);
}));
@@ -834,8 +834,8 @@ var OverlayScrollbars = function(r) {
if (s && p(f)) {
var g = validateRecursive(c, f, e, h + o), w = g[0], b = g[1];
t[o] = w;
- v[o] = b;
- each([ v, t ], (function(r) {
+ i[o] = b;
+ each([ i, t ], (function(r) {
if (P(r[o])) {
delete r[o];
}
@@ -853,7 +853,7 @@ var OverlayScrollbars = function(r) {
a = n;
}
}));
- var e = i(a);
+ var e = v(a);
if (e && l(f)) {
var n = r.split(" ");
m = !!n.find((function(r) {
@@ -871,254 +871,260 @@ var OverlayScrollbars = function(r) {
} else if (e) {
console.warn('The option "' + h + o + "\" wasn't set, because it doesn't accept the type [ " + O.toUpperCase() + ' ] with the value of "' + f + '".\r\n' + "Accepted types are: [ " + C.join(", ").toUpperCase() + " ].\r\n" + (S.length > 0 ? "\r\nValid strings are: [ " + S.join(", ") + " ]." : ""));
}
- delete v[o];
+ delete i[o];
}
}));
- return [ t, v ];
+ return [ t, i ];
};
var Na = function validateOptions(r, a, e) {
return Ua(r, a, e);
};
- var Ya;
- var Wa = qa.number;
- var Ga = qa.boolean;
- var Xa = [ qa.array, qa.null ];
- var Za = "hidden scroll visible visible-hidden";
- var $a = "visible hidden auto";
- var Ja = "never scroll leavemove";
- var Ka = {
- paddingAbsolute: Ga,
- showNativeOverlaidScrollbars: Ga,
+ var Ya = qa.number;
+ var Wa = qa.boolean;
+ var Ga = [ qa.array, qa.null ];
+ var Xa = "hidden scroll visible visible-hidden";
+ var Za = "visible hidden auto";
+ var $a = "never scroll leavemove";
+ var Ja = {
+ paddingAbsolute: Wa,
+ showNativeOverlaidScrollbars: Wa,
update: {
- elementEvents: Xa,
- attributes: Xa,
+ elementEvents: Ga,
+ attributes: Ga,
debounce: [ qa.number, qa.array, qa.null ],
ignoreMutation: [ qa.function, qa.null ]
},
overflow: {
- x: Za,
- y: Za
+ x: Xa,
+ y: Xa
},
scrollbars: {
theme: [ qa.string, qa.null ],
- visibility: $a,
- autoHide: Ja,
- autoHideDelay: Wa,
- dragScroll: Ga,
- clickScroll: Ga,
+ visibility: Za,
+ autoHide: $a,
+ autoHideDelay: Ya,
+ dragScroll: Wa,
+ clickScroll: Wa,
pointers: [ qa.array, qa.null ]
}
};
- var Qa = "__osOptionsValidationPlugin";
- Ya = {}, Ya[Qa] = {
- P: function _(r, a) {
- var e = Na(Ka, r, a), n = e[0], t = e[1];
- return Fa({}, t, n);
- }
- }, Ya;
- var re;
- var ae = 3333333;
- var ee = "scroll";
- var ne = "__osSizeObserverPlugin";
- var te = (re = {}, re[ne] = {
- P: function _(r, a, e) {
- var n = $('
');
- Y(r, n);
- pr(r, wa);
- var t = n[0];
- var v = t.lastChild;
- var i = t.firstChild;
- var o = null == i ? void 0 : i.firstChild;
- var u = Rr(t);
- var f = u;
- var l = false;
- var c;
- var s = function reset() {
- M(i, ae);
- R(i, ae);
- M(v, ae);
- R(v, ae);
- };
- var d = function onResized(r) {
- c = 0;
- if (l) {
- u = f;
- a(true === r);
- }
- };
- var h = function onScroll(r) {
- f = Rr(t);
- l = !r || !wr(f, u);
- if (r) {
- Yr(r);
- if (l && !c) {
- ur(c);
- c = fr(d);
+ var Ka = "__osOptionsValidationPlugin";
+ /* @__PURE__ */ (function() {
+ var r;
+ return r = {}, r[Ka] = {
+ P: function _(r, a) {
+ var e = Na(Ja, r, a), n = e[0], t = e[1];
+ return Fa({}, t, n);
+ }
+ }, r;
+ })();
+ var Qa = 3333333;
+ var re = "scroll";
+ var ae = "__osSizeObserverPlugin";
+ var ee = /* @__PURE__ */ function() {
+ var r;
+ return r = {}, r[ae] = {
+ P: function _(r, a, e) {
+ var n = $('');
+ Y(r, n);
+ pr(r, wa);
+ var t = n[0];
+ var i = t.lastChild;
+ var v = t.firstChild;
+ var o = null == v ? void 0 : v.firstChild;
+ var u = Rr(t);
+ var f = u;
+ var l = false;
+ var c;
+ var s = function reset() {
+ M(v, Qa);
+ R(v, Qa);
+ M(i, Qa);
+ R(i, Qa);
+ };
+ var d = function onResized(r) {
+ c = 0;
+ if (l) {
+ u = f;
+ a(true === r);
}
- } else {
- d(false === r);
- }
- s();
- };
- var g = y([], [ Nr(i, ee, h), Nr(v, ee, h) ]);
- style(o, {
- width: ae,
- height: ae
- });
- fr(s);
- return [ e ? h.bind(0, false) : s, g ];
- }
- }, re);
- var ve;
- var ie = 0;
- var oe = Math.round, ue = Math.abs;
- var fe = function getWindowDPR() {
+ };
+ var h = function onScroll(r) {
+ f = Rr(t);
+ l = !r || !wr(f, u);
+ if (r) {
+ Yr(r);
+ if (l && !c) {
+ ur(c);
+ c = fr(d);
+ }
+ } else {
+ d(false === r);
+ }
+ s();
+ };
+ var g = y([], [ Nr(v, re, h), Nr(i, re, h) ]);
+ style(o, {
+ width: Qa,
+ height: Qa
+ });
+ fr(s);
+ return [ e ? h.bind(0, false) : s, g ];
+ }
+ }, r;
+ }();
+ var ne = 0;
+ var te = Math.round, ie = Math.abs;
+ var ve = function getWindowDPR() {
var r = window.screen.deviceXDPI || 0;
var a = window.screen.logicalXDPI || 1;
return window.devicePixelRatio || r / a;
};
- var le = function diffBiggerThanOne(r, a) {
- var e = ue(r);
- var n = ue(a);
+ var oe = function diffBiggerThanOne(r, a) {
+ var e = ie(r);
+ var n = ie(a);
return !(e === n || e + 1 === n || e - 1 === n);
};
- var ce = "__osScrollbarsHidingPlugin";
- var se = (ve = {}, ve[ce] = {
- L: function _createUniqueViewportArrangeElement(r) {
- var a = r.T, e = r.H, n = r.D;
- var t = !n && !a && (e.x || e.y);
- var v = t ? document.createElement("style") : false;
- if (v) {
- L(v, "id", ca + "-" + ie);
- ie++;
- }
- return v;
- },
- M: function _overflowUpdateSegment(r, a, e, n, t, v, i) {
- var o = function arrangeViewport(a, v, i, o) {
- if (r) {
- var u = t(), f = u.R;
- var l = a.I, c = a.V;
- var s = c.x, d = c.y;
- var h = l.x, g = l.y;
- var p = o ? "paddingRight" : "paddingLeft";
- var w = f[p];
- var b = f.paddingTop;
- var m = v.w + i.w;
- var y = v.h + i.h;
- var S = {
- w: g && d ? g + m - w + "px" : "",
- h: h && s ? h + y - b + "px" : ""
- };
- if (n) {
- var C = n.sheet;
- if (C) {
- var O = C.cssRules;
- if (O) {
- if (!O.length) {
- C.insertRule("#" + L(n, "id") + " + ." + ca + "::before {}", 0);
+ var ue = "__osScrollbarsHidingPlugin";
+ var fe = /* @__PURE__ */ function() {
+ var r;
+ return r = {}, r[ue] = {
+ L: function _createUniqueViewportArrangeElement(r) {
+ var a = r.T, e = r.H, n = r.D;
+ var t = !n && !a && (e.x || e.y);
+ var i = t ? document.createElement("style") : false;
+ if (i) {
+ L(i, "id", ca + "-" + ne);
+ ne++;
+ }
+ return i;
+ },
+ M: 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 s = c.x, d = c.y;
+ var h = l.x, g = l.y;
+ var p = o ? "paddingRight" : "paddingLeft";
+ var w = f[p];
+ var b = f.paddingTop;
+ var m = i.w + v.w;
+ var y = i.h + v.h;
+ var S = {
+ w: g && d ? g + m - w + "px" : "",
+ h: h && s ? h + y - b + "px" : ""
+ };
+ if (n) {
+ var C = n.sheet;
+ if (C) {
+ var O = C.cssRules;
+ if (O) {
+ if (!O.length) {
+ C.insertRule("#" + L(n, "id") + " + ." + ca + "::before {}", 0);
+ }
+ var x = O[0].style;
+ x.width = S.w;
+ x.height = S.h;
}
- var x = O[0].style;
- x.width = S.w;
- x.height = S.h;
}
+ } else {
+ style(e, {
+ "--os-vaw": S.w,
+ "--os-vah": S.h
+ });
}
- } else {
- style(e, {
- "--os-vaw": S.w,
- "--os-vah": S.h
- });
}
- }
- return r;
- };
- var u = function undoViewportArrange(n, o, u) {
- if (r) {
- var f = u || v(n);
- var l = t(), c = l.R;
- var s = f.V;
- var d = s.x, h = s.y;
- var g = {};
- var p = function assignProps(r) {
- return each(r.split(" "), (function(r) {
- g[r] = c[r];
- }));
+ return r;
+ };
+ var u = function undoViewportArrange(n, o, u) {
+ if (r) {
+ var f = u || i(n);
+ var l = t(), c = l.R;
+ var s = f.V;
+ var d = s.x, h = s.y;
+ var g = {};
+ var p = function assignProps(r) {
+ return each(r.split(" "), (function(r) {
+ g[r] = c[r];
+ }));
+ };
+ if (d) {
+ p("marginBottom paddingTop paddingBottom");
+ }
+ if (h) {
+ p("marginLeft marginRight paddingLeft paddingRight");
+ }
+ var w = style(e, E(g));
+ gr(e, ca);
+ if (!a) {
+ g.height = "";
+ }
+ style(e, g);
+ return [ function() {
+ v(f, o, r, w);
+ style(e, w);
+ pr(e, ca);
+ }, f ];
+ }
+ return [ Sr ];
+ };
+ return [ o, u ];
+ },
+ k: function _envWindowZoom() {
+ var r = {
+ w: 0,
+ h: 0
+ };
+ var a = 0;
+ return function(e, n, t) {
+ var i = Mr();
+ var v = {
+ w: i.w - r.w,
+ h: i.h - r.h
};
+ if (0 === v.w && 0 === v.h) {
+ return;
+ }
+ var o = {
+ w: ie(v.w),
+ h: ie(v.h)
+ };
+ var u = {
+ w: ie(te(i.w / (r.w / 100))),
+ h: ie(te(i.h / (r.h / 100)))
+ };
+ var f = ve();
+ var l = o.w > 2 && o.h > 2;
+ var c = !oe(u.w, u.h);
+ var s = f !== a && f > 0;
+ var d = l && c && s;
if (d) {
- p("marginBottom paddingTop paddingBottom");
+ var h = n(), g = h[0], p = h[1];
+ A(e.j, g);
+ if (p) {
+ t();
+ }
}
- if (h) {
- p("marginLeft marginRight paddingLeft paddingRight");
- }
- var w = style(e, E(g));
- gr(e, ca);
- if (!a) {
- g.height = "";
- }
- style(e, g);
- return [ function() {
- i(f, o, r, w);
- style(e, w);
- pr(e, ca);
- }, f ];
- }
- return [ Sr ];
- };
- return [ o, u ];
- },
- k: function _envWindowZoom() {
- var r = {
- w: 0,
- h: 0
- };
- var a = 0;
- return function(e, n, t) {
- var v = Mr();
- var i = {
- w: v.w - r.w,
- h: v.h - r.h
+ r = i;
+ a = f;
};
- if (0 === i.w && 0 === i.h) {
- return;
- }
- var o = {
- w: ue(i.w),
- h: ue(i.h)
- };
- var u = {
- w: ue(oe(v.w / (r.w / 100))),
- h: ue(oe(v.h / (r.h / 100)))
- };
- var f = fe();
- var l = o.w > 2 && o.h > 2;
- var c = !le(u.w, u.h);
- var s = f !== a && f > 0;
- var d = l && c && s;
- if (d) {
- var h = n(), g = h[0], p = h[1];
- A(e.j, g);
- if (p) {
- t();
- }
- }
- r = v;
- a = f;
- };
- }
- }, ve);
- var de;
- var he = function getNativeScrollbarSize(r, a, e, n) {
+ }
+ }, r;
+ }();
+ var le;
+ var ce = function getNativeScrollbarSize(r, a, e, n) {
Y(r, a);
var t = Ir(a);
- var v = Rr(a);
- var i = kr(e);
+ var i = Rr(a);
+ var v = kr(e);
n && X(a);
return {
- x: v.h - t.h + i.h,
- y: v.w - t.w + i.w
+ x: i.h - t.h + v.h,
+ y: i.w - t.w + v.w
};
};
- var ge = function getNativeScrollbarsHiding(r) {
+ var se = function getNativeScrollbarsHiding(r) {
var a = false;
var e = pr(r, da);
try {
@@ -1127,7 +1133,7 @@ var OverlayScrollbars = function(r) {
e();
return a;
};
- var pe = function getRtlScrollBehavior(r, a) {
+ var de = function getRtlScrollBehavior(r, a) {
var e = "hidden";
style(r, {
overflowX: e,
@@ -1138,37 +1144,37 @@ var OverlayScrollbars = function(r) {
var n = Xr(r);
var t = Xr(a);
M(r, -999);
- var v = Xr(a);
+ var i = Xr(a);
return {
i: n.x === t.x,
- n: t.x !== v.x
+ n: t.x !== i.x
};
};
- var _e = function getFlexboxGlue(r, a) {
+ var he = function getFlexboxGlue(r, a) {
var e = pr(r, aa);
var n = jr(r);
var t = jr(a);
- var v = yr(t, n, true);
- var i = pr(r, ea);
+ var i = yr(t, n, true);
+ var v = pr(r, ea);
var o = jr(r);
var u = jr(a);
var f = yr(u, o, true);
e();
- i();
- return v && f;
+ v();
+ return i && f;
};
- var we = function createEnvironment() {
+ var ge = function createEnvironment() {
var r = document, e = r.body;
var n = $('');
var t = n[0];
- var v = t.firstChild;
- var i = $r(), o = i[0], u = i[2];
+ var i = t.firstChild;
+ var v = $r(), o = v[0], u = v[2];
var f = a({
- o: he(e, t, v),
+ o: ce(e, t, i),
u: br
- }, he.bind(0, e, t, v, true)), l = f[0], c = f[1];
+ }, ce.bind(0, e, t, i, true)), l = f[0], c = f[1];
var s = c(), d = s[0];
- var h = ge(t);
+ var h = se(t);
var g = {
x: 0 === d.x,
y: 0 === d.y
@@ -1196,8 +1202,8 @@ var OverlayScrollbars = function(r) {
H: g,
T: h,
D: "-1" === style(t, "zIndex"),
- B: pe(t, v),
- F: _e(t, v),
+ B: de(t, i),
+ F: he(t, i),
q: function _addListener(r) {
return o("_", r);
},
@@ -1217,64 +1223,64 @@ var OverlayScrollbars = function(r) {
if (!h && (!g.x || !g.y)) {
var m;
window.addEventListener("resize", (function() {
- var r = ka()[ce];
+ var r = ka()[ue];
m = m || r && r.k();
m && m(b, l, u.bind(0, "_"));
}));
}
return b;
};
- var be = function getEnvironment() {
- if (!de) {
- de = we();
+ var pe = function getEnvironment() {
+ if (!le) {
+ le = ge();
}
- return de;
+ return le;
};
- var me = function resolveInitialization(r, a) {
+ var _e = function resolveInitialization(r, a) {
return s(r) ? r.apply(0, a) : r;
};
- var ye = function staticInitializationElement(r, a, e, n) {
- var t = i(n) ? e : n;
- var v = me(t, r);
- return v || a();
+ var we = function staticInitializationElement(r, a, e, n) {
+ var t = v(n) ? e : n;
+ var i = _e(t, r);
+ return i || a();
};
- var Se = function dynamicInitializationElement(r, a, e, n) {
- var t = i(n) ? e : n;
- var v = me(t, r);
- return !!v && (w(v) ? v : a());
+ var be = function dynamicInitializationElement(r, a, e, n) {
+ var t = v(n) ? e : n;
+ var i = _e(t, r);
+ return !!i && (w(i) ? i : a());
};
- var Ce = function cancelInitialization(r, a) {
+ var me = function cancelInitialization(r, a) {
var e = r || {}, n = e.nativeScrollbarsOverlaid, t = e.body;
- var v = a.Z;
- var u = be(), f = u.U, l = u.H, c = u.T;
+ var i = a.Z;
+ var u = pe(), f = u.U, l = u.H, c = u.T;
var s = f().cancel, d = s.nativeScrollbarsOverlaid, h = s.body;
var g = null != n ? n : d;
- var p = i(t) ? h : t;
+ var p = v(t) ? h : t;
var w = (l.x || l.y) && g;
- var b = v && (o(p) ? !c : p);
+ var b = i && (o(p) ? !c : p);
return !!w || !!b;
};
- var Oe = new WeakMap;
- var xe = function addInstance(r, a) {
- Oe.set(r, a);
+ var ye = new WeakMap;
+ var Se = function addInstance(r, a) {
+ ye.set(r, a);
};
- var Ee = function removeInstance(r) {
- Oe.delete(r);
+ var Ce = function removeInstance(r) {
+ ye.delete(r);
};
- var Ae = function getInstance(r) {
- return Oe.get(r);
+ var Oe = function getInstance(r) {
+ return ye.get(r);
};
- var Pe = function getPropByPath(r, a) {
+ var xe = function getPropByPath(r, a) {
return r ? a.split(".").reduce((function(r, a) {
return r && x(r, a) ? r[a] : void 0;
}), r) : void 0;
};
- var ze = function createOptionCheck(r, a, e) {
+ var Ee = function createOptionCheck(r, a, e) {
return function(n) {
- return [ Pe(r, n), e || void 0 !== Pe(a, n) ];
+ return [ xe(r, n), e || void 0 !== xe(a, n) ];
};
};
- var Le = function createState(r) {
+ var Ae = function createState(r) {
var a = r;
return [ function() {
return a;
@@ -1282,22 +1288,22 @@ var OverlayScrollbars = function(r) {
a = A({}, a, r);
} ];
};
- var Te = "tabindex";
- var He = Z.bind(0, "");
- var De = function unwrap(r) {
+ var Pe = "tabindex";
+ var ze = Z.bind(0, "");
+ var Le = function unwrap(r) {
Y(F(r), B(r));
X(r);
};
- var Me = function addDataAttrHost(r, a) {
+ var Te = function addDataAttrHost(r, a) {
L(r, na, a);
return D.bind(0, r, na);
};
- var Re = function createStructureSetupElements(r) {
- var a = be();
+ var He = function createStructureSetupElements(r) {
+ var a = pe();
var e = a.U, n = a.T;
- var t = ka()[ce];
- var v = t && t.L;
- var i = e(), o = i.elements;
+ var t = ka()[ue];
+ var i = t && t.L;
+ var v = e(), o = v.elements;
var u = o.host, f = o.viewport, l = o.padding, c = o.content;
var s = w(r);
var d = s ? {} : r;
@@ -1308,24 +1314,24 @@ var OverlayScrollbars = function(r) {
var P = x.ownerDocument;
var z = x === P.body;
var M = P.defaultView;
- var R = ye.bind(0, [ x ]);
- var I = Se.bind(0, [ x ]);
- var V = R(He, f, S);
+ 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 Z = {
$: x,
- J: A ? R(He, u, p) : x,
+ J: A ? R(ze, u, p) : x,
K: V,
- rr: !k && I(He, l, b),
- ar: !k && I(He, c, C),
- er: !k && !n && v && v(a),
+ 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,
- vr: M,
- ir: P,
+ ir: M,
+ vr: P,
ur: A,
Z: z,
lr: s,
@@ -1346,41 +1352,41 @@ var OverlayScrollbars = function(r) {
};
var K = Z.$, Q = Z.J, rr = Z.rr, ar = Z.K, er = Z.ar, nr = Z.er;
var tr = [];
- var vr = A && J(Q);
- var ir = A ? K : B([ er, ar, rr, Q, K ].find((function(r) {
+ var ir = A && J(Q);
+ var vr = A ? K : B([ er, ar, rr, Q, K ].find((function(r) {
return false === J(r);
})));
var or = er || ar;
var ur = function appendElements() {
- var r = Me(Q, k ? "viewport" : "host");
+ var r = Te(Q, k ? "viewport" : "host");
var a = pr(rr, fa);
var e = pr(ar, !k && la);
var t = pr(er, sa);
- var v = z ? pr(F(x), da) : Sr;
- if (vr) {
+ var i = z ? pr(F(x), da) : Sr;
+ if (ir) {
G(K, Q);
y(tr, (function() {
G(Q, K);
X(Q);
}));
}
- Y(or, ir);
+ Y(or, vr);
Y(Q, rr);
Y(rr || Q, !k && ar);
Y(ar, er);
y(tr, (function() {
- v();
+ i();
r();
D(ar, ta);
- D(ar, va);
+ D(ar, ia);
if (J(er)) {
- De(er);
+ Le(er);
}
if (J(ar)) {
- De(ar);
+ Le(ar);
}
if (J(rr)) {
- De(rr);
+ Le(rr);
}
a();
e();
@@ -1394,31 +1400,31 @@ var OverlayScrollbars = function(r) {
y(tr, X.bind(0, nr));
}
if (N) {
- var i = L(ar, Te);
- L(ar, Te, "-1");
+ var v = L(ar, Pe);
+ L(ar, Pe, "-1");
ar.focus();
var o = Nr(P, "pointerdown keydown", (function() {
- i ? L(ar, Te, i) : D(ar, Te);
+ v ? L(ar, Pe, v) : D(ar, Pe);
o();
}));
} else if (U && U.focus) {
U.focus();
}
- ir = 0;
+ vr = 0;
};
return [ Z, ur, O.bind(0, tr) ];
};
- var Ie = function createTrinsicUpdateSegment(r, a) {
+ var De = function createTrinsicUpdateSegment(r, a) {
var e = r.ar;
var n = a[0];
return function(r) {
- var a = be(), t = a.F;
- var v = n(), i = v.hr;
+ var a = pe(), t = a.F;
+ var i = n(), v = i.hr;
var o = r.gr;
var u = (e || !t) && o;
if (u) {
style(e, {
- height: i ? "" : "100%"
+ height: v ? "" : "100%"
});
}
return {
@@ -1427,16 +1433,16 @@ var OverlayScrollbars = function(r) {
};
};
};
- var Ve = function createPaddingUpdateSegment(r, e) {
+ var Me = function createPaddingUpdateSegment(r, e) {
var n = e[0], t = e[1];
- var v = r.J, i = r.rr, o = r.K, u = r.cr;
+ var i = r.J, v = r.rr, o = r.K, u = r.cr;
var f = a({
u: mr,
o: Tr()
- }, Tr.bind(0, v, "padding", "")), l = f[0], c = f[1];
+ }, Tr.bind(0, i, "padding", "")), l = f[0], c = f[1];
return function(r, a, e) {
- var v = c(e), f = v[0], s = v[1];
- var d = be(), h = d.T, g = d.F;
+ var i = c(e), f = i[0], s = i[1];
+ var d = pe(), h = d.T, 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];
@@ -1448,7 +1454,7 @@ var OverlayScrollbars = function(r) {
}
var P = !u && (O || y || s);
if (P) {
- var z = !C || !i && !h;
+ var z = !C || !v && !h;
var L = f.r + f.l;
var T = f.t + f.b;
var H = {
@@ -1466,12 +1472,12 @@ var OverlayScrollbars = function(r) {
paddingBottom: z ? f.b : 0,
paddingLeft: z ? f.l : 0
};
- style(i || o, H);
+ style(v || o, H);
style(o, D);
t({
rr: f,
mr: !z,
- R: i ? D : A({}, H, D)
+ R: v ? D : A({}, H, D)
});
}
return {
@@ -1479,65 +1485,65 @@ var OverlayScrollbars = function(r) {
};
};
};
- var ke = Math.max;
- var je = ke.bind(0, 0);
- var Be = "visible";
- var Fe = "hidden";
- var qe = 42;
- var Ue = {
+ var Re = Math.max;
+ var Ie = Re.bind(0, 0);
+ var Ve = "visible";
+ var ke = "hidden";
+ var je = 42;
+ var Be = {
u: wr,
o: {
w: 0,
h: 0
}
};
- var Ne = {
+ var Fe = {
u: br,
o: {
- x: Fe,
- y: Fe
+ x: ke,
+ y: ke
}
};
- var Ye = function getOverflowAmount(r, a) {
+ var qe = function getOverflowAmount(r, a) {
var e = window.devicePixelRatio % 1 !== 0 ? 1 : 0;
var n = {
- w: je(r.w - a.w),
- h: je(r.h - a.h)
+ w: Ie(r.w - a.w),
+ h: Ie(r.h - a.h)
};
return {
w: n.w > e ? n.w : 0,
h: n.h > e ? n.h : 0
};
};
- var We = function conditionalClass(r, a, e) {
+ var Ue = function conditionalClass(r, a, e) {
return e ? pr(r, a) : gr(r, a);
};
- var Ge = function overflowIsVisible(r) {
- return 0 === r.indexOf(Be);
+ var Ne = function overflowIsVisible(r) {
+ return 0 === r.indexOf(Ve);
};
- var Xe = function createOverflowUpdateSegment(r, e) {
+ var Ye = function createOverflowUpdateSegment(r, e) {
var n = e[0], t = e[1];
- var v = r.J, i = r.rr, o = r.K, u = r.er, f = r.cr, l = r.dr, c = r.Z, s = r.vr;
- var d = be(), h = d.j, g = d.F, p = d.T, w = d.H;
- var b = ka()[ce];
+ 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 m = !f && !p && (w.x || w.y);
var y = c && f;
- var S = a(Ue, kr.bind(0, o)), C = S[0], O = S[1];
- var x = a(Ue, Vr.bind(0, o)), E = x[0], A = x[1];
- var P = a(Ue), z = P[0], H = P[1];
- var D = a(Ue), M = D[0], R = D[1];
- var I = a(Ne), V = I[0];
+ 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) {
style(o, {
height: ""
});
if (a) {
- var e = n(), t = e.mr, i = e.rr;
+ var e = n(), t = e.mr, v = e.rr;
var u = r.Sr, f = r.I;
- var l = kr(v);
- var c = Ir(v);
+ var l = kr(i);
+ var c = Ir(i);
var s = "content-box" === style(o, "boxSizing");
- var d = t || s ? i.b + i.t : 0;
+ var d = t || s ? v.b + v.t : 0;
var h = !(w.x && s);
style(o, {
height: c.h + l.h + (u.x && h ? f.x : 0) - d
@@ -1545,25 +1551,25 @@ var OverlayScrollbars = function(r) {
}
};
var j = function getViewportOverflowState(r, a) {
- var e = !p && !r ? qe : 0;
+ var e = !p && !r ? je : 0;
var n = function getStatePerAxis(r, n, t) {
- var v = style(o, r);
- var i = a ? a[r] : v;
- var u = "scroll" === i;
+ var i = style(o, r);
+ var v = a ? a[r] : i;
+ var u = "scroll" === v;
var f = n ? e : t;
var l = u && !p ? f : 0;
var c = n && !!e;
- return [ v, u, l, c ];
+ return [ i, u, l, c ];
};
- var t = n("overflowX", w.x, h.x), v = t[0], i = t[1], u = t[2], f = t[3];
+ var t = n("overflowX", w.x, h.x), i = t[0], v = t[1], u = t[2], f = t[3];
var l = n("overflowY", w.y, h.y), c = l[0], s = l[1], d = l[2], g = l[3];
return {
Cr: {
- x: v,
+ x: i,
y: c
},
Sr: {
- x: i,
+ x: v,
y: s
},
I: {
@@ -1578,20 +1584,20 @@ var OverlayScrollbars = function(r) {
};
var B = function setViewportOverflowState(r, a, e, n) {
var t = function setAxisOverflowStyle(r, a) {
- var e = Ge(r);
- var n = a && e && r.replace(Be + "-", "") || "";
- return [ a && !e ? r : "", Ge(n) ? "hidden" : n ];
+ var e = Ne(r);
+ var n = a && e && r.replace(Ve + "-", "") || "";
+ return [ a && !e ? r : "", Ne(n) ? "hidden" : n ];
};
- var v = t(e.x, a.x), i = v[0], o = v[1];
+ var i = t(e.x, a.x), v = i[0], o = i[1];
var u = t(e.y, a.y), f = u[0], l = u[1];
- n.overflowX = o && f ? o : i;
- n.overflowY = l && i ? l : f;
+ n.overflowX = o && f ? o : v;
+ n.overflowY = l && v ? l : f;
return j(r, n);
};
var F = function hideNativeScrollbars(r, a, e, t) {
- var v = r.I, i = r.V;
- var o = i.x, u = i.y;
- var f = v.x, l = v.y;
+ var i = r.I, v = r.V;
+ var o = v.x, u = v.y;
+ var f = i.x, l = i.y;
var c = n(), s = c.R;
var d = a ? "marginLeft" : "marginRight";
var h = a ? "paddingLeft" : "paddingRight";
@@ -1619,8 +1625,8 @@ var OverlayScrollbars = function(r) {
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);
- var $ = Ge(W.x);
- var J = Ge(W.y);
+ var $ = Ne(W.x);
+ var J = Ne(W.y);
var K = $ || J;
var Q = O(e);
var rr = A(e);
@@ -1636,29 +1642,29 @@ var OverlayScrollbars = function(r) {
}
if (u || h || d || m || q) {
if (K) {
- l(ha, ia, false);
+ l(ha, va, false);
}
- var tr = N(X, P, nr), vr = tr[0], ir = tr[1];
+ var tr = N(X, P, 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;
- vr();
- if ((sr || fr || q) && ir && !X && U(ir, cr, ur, P)) {
+ ir();
+ if ((sr || fr || q) && vr && !X && U(vr, cr, ur, P)) {
gr = Ir(o);
hr = Vr(o);
}
var pr = {
- w: je(ke(cr.w, hr.w) + ur.w),
- h: je(ke(cr.h, hr.h) + ur.h)
+ w: Ie(Re(cr.w, hr.w) + ur.w),
+ h: Ie(Re(cr.h, hr.h) + ur.h)
};
var _r = {
- w: je(y ? s.innerWidth : gr.w + je(dr.w - cr.w) + ur.w),
- h: je(y ? s.innerHeight : gr.h + je(dr.h - cr.h) + ur.h)
+ 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);
- ar = z(Ye(pr, _r), e);
+ ar = z(qe(pr, _r), e);
}
var wr = er, br = wr[0], mr = wr[1];
var yr = ar, Sr = yr[0], Cr = yr[1];
@@ -1687,15 +1693,15 @@ var OverlayScrollbars = function(r) {
k(Dr, x);
}
if (f) {
- L(v, ta, Hr.overflowX);
- L(v, va, Hr.overflowY);
+ L(i, ta, Hr.overflowX);
+ L(i, ia, Hr.overflowY);
} else {
style(o, Hr);
}
}
- T(v, na, ia, Tr);
- We(i, ha, Tr);
- !f && We(o, ha, K);
+ T(i, na, va, Tr);
+ Ue(v, ha, Tr);
+ !f && Ue(o, ha, K);
var Rr = V(j(X).Cr), kr = Rr[0], jr = Rr[1];
t({
Cr: kr,
@@ -1716,24 +1722,24 @@ var OverlayScrollbars = function(r) {
};
};
};
- var Ze = function prepareUpdateHints(r, a, e) {
+ var We = function prepareUpdateHints(r, a, e) {
var n = {};
var t = a || {};
- var v = E(r).concat(E(t));
- each(v, (function(a) {
- var v = r[a];
- var i = t[a];
- n[a] = !!(e || v || i);
+ var i = E(r).concat(E(t));
+ each(i, (function(a) {
+ var i = r[a];
+ var v = t[a];
+ n[a] = !!(e || i || v);
}));
return n;
};
- var $e = function createStructureSetupUpdate(r, a) {
- var e = r.$, n = r.K, t = r.dr, v = r.cr;
- var i = be(), o = i.T, u = i.H, f = i.F;
+ 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 l = !o && (u.x || u.y);
- var c = [ Ie(r, a), Ve(r, a), Xe(r, a) ];
- return function(r, a, i) {
- var o = Ze(A({
+ var c = [ De(r, a), Me(r, a), Ye(r, a) ];
+ return function(r, a, v) {
+ var o = We(A({
pr: false,
yr: false,
br: false,
@@ -1743,33 +1749,33 @@ var OverlayScrollbars = function(r) {
zr: false,
Or: false,
_r: false
- }, a), {}, i);
+ }, a), {}, v);
var u = l || !f;
var s = u && M(n);
var d = u && R(n);
t("", ua, true);
var h = o;
each(c, (function(a) {
- h = Ze(h, a(h, r, !!i) || {}, i);
+ h = We(h, a(h, r, !!v) || {}, v);
}));
M(n, s);
R(n, d);
t("", ua);
- if (!v) {
+ if (!i) {
M(e, 0);
R(e, 0);
}
return h;
};
};
- var Je = 3333333;
- var Ke = function domRectHasDimensions(r) {
+ var Xe = 3333333;
+ var Ze = function domRectHasDimensions(r) {
return r && (r.height || r.width);
};
- var Qe = function createSizeObserver(r, e, n) {
- var t = n || {}, v = t.Hr, i = void 0 === v ? false : v, o = t.Dr, u = void 0 === o ? false : o;
- var f = ka()[ne];
- var l = be(), s = l.B;
+ 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 l = pe(), s = l.B;
var g = $('');
var p = g[0];
var w = p.firstChild;
@@ -1778,37 +1784,37 @@ var OverlayScrollbars = function(r) {
o: void 0,
g: true,
u: function _equal(r, a) {
- return !(!r || !Ke(r) && Ke(a));
+ return !(!r || !Ze(r) && Ze(a));
}
}), S = m[0];
var C = function onSizeChangedCallbackProxy(r) {
var a = d(r) && r.length > 0 && h(r[0]);
var n = !a && c(r[0]);
var t = false;
- var v = false;
+ var i = false;
var o = true;
if (a) {
var u = S(r.pop().contentRect), f = u[0], l = u[2];
- var g = Ke(f);
- var w = Ke(l);
+ var g = Ze(f);
+ var w = Ze(l);
t = !l || !g;
- v = !w && g;
+ i = !w && g;
o = !t;
} else if (n) {
o = r[1];
} else {
- v = true === r;
+ i = true === r;
}
- if (i && o) {
+ if (v && o) {
var b = n ? r[0] : Lr(p);
- M(p, b ? s.n ? -Je : s.i ? 0 : Je : Je);
- R(p, Je);
+ M(p, b ? s.n ? -Xe : s.i ? 0 : Xe : Xe);
+ R(p, Xe);
}
if (!t) {
e({
pr: !n,
Mr: n ? r : void 0,
- Dr: !!v
+ Dr: !!i
});
}
};
@@ -1825,11 +1831,11 @@ var OverlayScrollbars = function(r) {
e.disconnect();
}));
} else if (f) {
- var n = f.P(w, C, u), t = n[0], v = n[1];
+ var n = f.P(w, C, u), t = n[0], i = n[1];
E = t;
- y(x, v);
+ y(x, i);
}
- if (i) {
+ if (v) {
var o = a({
o: !b()
}, b), l = o[0];
@@ -1857,19 +1863,19 @@ var OverlayScrollbars = function(r) {
Y(r, p);
} ];
};
- var rn = function isHeightIntrinsic(r) {
+ var Je = function isHeightIntrinsic(r) {
return 0 === r.h || r.isIntersecting || r.intersectionRatio > 0;
};
- var an = function createTrinsicObserver(r, e) {
+ var Ke = function createTrinsicObserver(r, e) {
var n;
var t = Z(ya);
- var v = [];
- var i = a({
+ var i = [];
+ var v = a({
o: false
- }), o = i[0];
+ }), o = v[0];
var u = function triggerOnTrinsicChangedCallback(r, a) {
if (r) {
- var n = o(rn(r));
+ var n = o(Je(r));
var t = n[1];
if (t) {
!a && e(n);
@@ -1883,17 +1889,17 @@ var OverlayScrollbars = function(r) {
}
};
return [ function() {
- O(v);
+ O(i);
X(t);
}, function() {
- if (ir) {
- n = new ir((function(r) {
+ if (vr) {
+ n = new vr((function(r) {
return f(r);
}), {
root: r
});
n.observe(t);
- y(v, (function() {
+ y(i, (function() {
n.disconnect();
}));
} else {
@@ -1901,8 +1907,8 @@ var OverlayScrollbars = function(r) {
var r = Rr(t);
u(r);
};
- var e = Qe(t, a), i = e[0], o = e[1];
- y(v, i);
+ var e = $e(t, a), v = e[0], o = e[1];
+ y(i, v);
o();
a();
}
@@ -1913,37 +1919,37 @@ var OverlayScrollbars = function(r) {
}
} ];
};
- var en = function createEventContentChange(r, a, e) {
+ var Qe = function createEventContentChange(r, a, e) {
var n;
var t = false;
- var v = function destroy() {
+ var i = function destroy() {
t = true;
};
- var i = function updateElements(v) {
+ var v = function updateElements(i) {
if (e) {
- var i = e.reduce((function(a, e) {
+ var v = e.reduce((function(a, e) {
if (e) {
var n = e[0];
var t = e[1];
- var i = t && n && (v ? v(n) : V(n, r));
- if (i && i.length && t && l(t)) {
- y(a, [ i, t.trim() ], true);
+ var v = t && n && (i ? i(n) : V(n, r));
+ if (v && v.length && t && l(t)) {
+ y(a, [ v, t.trim() ], true);
}
}
return a;
}), []);
- each(i, (function(r) {
+ each(v, (function(r) {
return each(r[0], (function(e) {
- var v = r[1];
- var i = n.get(e);
- if (i) {
- var o = i[0];
- var u = i[1];
- if (o === v) {
+ var i = r[1];
+ var v = n.get(e);
+ if (v) {
+ var o = v[0];
+ var u = v[1];
+ if (o === i) {
u();
}
}
- var f = Nr(e, v, (function(r) {
+ var f = Nr(e, i, (function(r) {
if (t) {
f();
n.delete(e);
@@ -1951,20 +1957,20 @@ var OverlayScrollbars = function(r) {
a(r);
}
}));
- n.set(e, [ v, f ]);
+ n.set(e, [ i, f ]);
}));
}));
}
};
if (e) {
n = new WeakMap;
- i();
+ v();
}
- return [ v, i ];
+ return [ i, v ];
};
- var nn = function createDOMObserver(r, a, e, n) {
+ var rn = function createDOMObserver(r, a, e, n) {
var t = false;
- var v = n || {}, i = v.Rr, o = v.Ir, u = v.Vr, f = v.kr, c = v.jr, s = v.Br;
+ var i = n || {}, v = i.Rr, o = i.Ir, u = i.Vr, f = i.kr, c = i.jr, s = i.Br;
var d = Or((function() {
if (t) {
e(true);
@@ -1973,12 +1979,12 @@ var OverlayScrollbars = function(r) {
p: 33,
_: 99
});
- var h = en(r, d, u), g = h[0], p = h[1];
- var w = i || [];
+ var h = Qe(r, d, u), g = h[0], p = h[1];
+ var w = v || [];
var b = o || [];
var S = w.concat(b);
- var O = function observerCallback(t, v) {
- var i = c || Sr;
+ var O = function observerCallback(t, i) {
+ var v = c || Sr;
var o = s || Sr;
var u = [];
var d = [];
@@ -1986,24 +1992,24 @@ var OverlayScrollbars = function(r) {
var g = false;
var w = false;
each(t, (function(e) {
- var t = e.attributeName, v = e.target, c = e.type, s = e.oldValue, p = e.addedNodes;
+ var t = e.attributeName, i = e.target, c = e.type, s = e.oldValue, p = e.addedNodes;
var S = "attributes" === c;
var C = "childList" === c;
- var O = r === v;
- var x = S && l(t) ? L(v, t) : 0;
+ var O = r === i;
+ var x = S && l(t) ? L(i, t) : 0;
var E = 0 !== x && s !== x;
var A = m(b, t) > -1 && E;
if (a && !O) {
var P = !S;
var z = S && A;
- var T = z && f && j(v, f);
- var H = T ? !i(v, t, s, x) : P || z;
+ 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);
y(d, p);
g = g || D;
w = w || C;
}
- if (!a && O && E && !i(v, t, s, x)) {
+ if (!a && O && E && !v(i, t, s, x)) {
y(u, t);
h = h || A;
}
@@ -2017,15 +2023,15 @@ var OverlayScrollbars = function(r) {
}));
}
if (a) {
- !v && g && e(false);
+ !i && g && e(false);
return [ false ];
}
if (!C(u) || h) {
- !v && e(u, h);
+ !i && e(u, h);
return [ u, h ];
}
};
- var x = new vr((function(r) {
+ var x = new ir((function(r) {
return O(r);
}));
x.observe(r, {
@@ -2051,18 +2057,18 @@ var OverlayScrollbars = function(r) {
}
} ];
};
- var tn = "[" + na + "]";
- var vn = "." + la;
- var un = [ "tabindex" ];
- var fn = [ "wrap", "cols", "rows" ];
- var ln = [ "id", "class", "style", "open" ];
- var cn = function createStructureSetupObservers(r, e, n) {
+ var an = "[" + na + "]";
+ var en = "." + la;
+ var nn = [ "tabindex" ];
+ var tn = [ "wrap", "cols", "rows" ];
+ var vn = [ "id", "class", "style", "open" ];
+ var un = function createStructureSetupObservers(r, e, n) {
var t;
- var v;
var i;
+ var v;
var o = e[1];
var u = r.J, c = r.K, h = r.ar, g = r.ur, p = r.cr, w = r.sr, b = r.dr;
- var S = be(), C = S.F;
+ var S = pe(), C = S.F;
var O = a({
u: wr,
o: {
@@ -2070,33 +2076,33 @@ var OverlayScrollbars = function(r) {
h: 0
}
}, (function() {
- var r = w(ha, ia);
+ var r = w(ha, va);
var a = w(ca, "");
var e = a && M(c);
var n = a && R(c);
- b(ha, ia);
+ b(ha, va);
b(ca, "");
b("", ua, true);
var t = Vr(h);
- var v = Vr(c);
- var i = kr(c);
- b(ha, ia, r);
+ var i = Vr(c);
+ var v = kr(c);
+ b(ha, va, r);
b(ca, "", a);
b("", ua);
M(c, e);
R(c, n);
return {
- w: v.w + t.w + i.w,
- h: v.h + t.h + i.h
+ w: i.w + t.w + v.w,
+ h: i.h + t.h + v.h
};
})), x = O[0];
- var P = g ? fn : ln.concat(fn);
+ var P = g ? tn : vn.concat(tn);
var z = Or(n, {
p: function _timeout() {
return t;
},
_: function _maxDelay() {
- return v;
+ return i;
},
m: function _mergeParams(r, a) {
var e = r[0];
@@ -2108,8 +2114,8 @@ var OverlayScrollbars = function(r) {
}
});
var T = function updateViewportAttrsFromHost(r) {
- each(r || un, (function(r) {
- if (m(un, r) > -1) {
+ each(r || nn, (function(r) {
+ if (m(nn, r) > -1) {
var a = L(u, r);
if (l(a)) {
L(c, r, a);
@@ -2121,41 +2127,41 @@ var OverlayScrollbars = function(r) {
};
var H = function onTrinsicChanged(r, a) {
var e = r[0], t = r[1];
- var v = {
+ var i = {
gr: t
};
o({
hr: e
});
- !a && n(v);
- return v;
+ !a && n(i);
+ return i;
};
var I = function onSizeChanged(r) {
var a = r.pr, e = r.Mr, t = r.Dr;
- var v = !a || t ? n : z;
- var i = false;
+ var i = !a || t ? n : z;
+ var v = false;
if (e) {
var u = e[0], f = e[1];
- i = f;
+ v = f;
o({
wr: u
});
}
- v({
+ i({
pr: a,
- br: i
+ br: v
});
};
var V = function onContentMutation(r, a) {
var e = x(), t = e[1];
- var v = {
+ var i = {
_r: t
};
- var i = r ? n : z;
+ var v = r ? n : z;
if (t) {
- !a && i(v);
+ !a && v(i);
}
- return v;
+ return i;
};
var k = function onHostMutation(r, a, e) {
var n = {
@@ -2168,14 +2174,14 @@ var OverlayScrollbars = function(r) {
}
return n;
};
- var j = h || !C ? an(u, H) : [ Sr, Sr, Sr ], B = j[0], F = j[1], N = j[2];
- var Y = !p ? Qe(u, I, {
+ 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,
Hr: true
}) : [ Sr, Sr ], W = Y[0], G = Y[1];
- var X = nn(u, false, k, {
- Ir: ln,
- Rr: ln.concat(un)
+ var X = rn(u, false, k, {
+ Ir: vn,
+ Rr: vn.concat(nn)
}), Z = X[0], $ = X[1];
var J = p && or && new or(I.bind(0, {
pr: true
@@ -2185,7 +2191,7 @@ var OverlayScrollbars = function(r) {
return [ function() {
B();
W();
- i && i[0]();
+ v && v[0]();
J && J.disconnect();
Z();
}, function() {
@@ -2195,7 +2201,7 @@ var OverlayScrollbars = function(r) {
var r = {};
var a = $();
var e = N();
- var n = i && i[1]();
+ var n = v && v[1]();
if (a) {
A(r, k.apply(0, y(a, true)));
}
@@ -2216,18 +2222,18 @@ var OverlayScrollbars = function(r) {
return s(e) && e(r);
};
if (S) {
- if (i) {
- i[1]();
- i[0]();
+ if (v) {
+ v[1]();
+ v[0]();
}
- i = nn(h || c, true, V, {
+ v = rn(h || c, true, V, {
Ir: P.concat(o || []),
Rr: P.concat(o || []),
Vr: g,
- kr: tn,
+ kr: an,
Br: function _ignoreContentChange(r, a) {
var e = r.target, n = r.attributeName;
- var t = !a && n && !p ? U(e, tn, vn) : false;
+ var t = !a && n && !p ? U(e, an, en) : false;
return t || !!q(e, "." + Sa) || !!C(r);
}
});
@@ -2238,22 +2244,22 @@ var OverlayScrollbars = function(r) {
var O = m[0];
var x = m[1];
t = f(O) && O;
- v = f(x) && x;
+ i = f(x) && x;
} else if (f(m)) {
t = m;
- v = false;
+ i = false;
} else {
t = false;
- v = false;
+ i = false;
}
}
} ];
};
- var sn = {
+ var fn = {
x: 0,
y: 0
};
- var dn = {
+ var ln = {
rr: {
t: 0,
r: 0,
@@ -2270,8 +2276,8 @@ var OverlayScrollbars = function(r) {
paddingBottom: 0,
paddingLeft: 0
},
- Er: sn,
- Ar: sn,
+ Er: fn,
+ Ar: fn,
Cr: {
x: "hidden",
y: "hidden"
@@ -2283,13 +2289,13 @@ var OverlayScrollbars = function(r) {
hr: false,
wr: false
};
- var hn = function createStructureSetup(r, a) {
- var e = ze(a, {});
- var n = Le(dn);
- var t = $r(), v = t[0], i = t[1], o = t[2];
+ var cn = function createStructureSetup(r, a) {
+ var e = Ee(a, {});
+ var n = Ae(ln);
+ var t = $r(), i = t[0], v = t[1], o = t[2];
var u = n[0];
- var f = Re(r), l = f[0], c = f[1], s = f[2];
- var d = $e(l, n);
+ var f = He(r), l = f[0], c = f[1], s = f[2];
+ var d = Ge(l, n);
var h = function triggerUpdateEvent(r, a, e) {
var n = E(r).some((function(a) {
return r[a];
@@ -2298,12 +2304,12 @@ var OverlayScrollbars = function(r) {
o("u", [ r, a, e ]);
}
};
- var g = cn(l, n, (function(r) {
+ var g = un(l, n, (function(r) {
h(d(e, r), {}, false);
})), p = g[0], w = g[1], b = g[2], m = g[3];
var y = u.bind(0);
y.Fr = function(r) {
- v("u", r);
+ i("u", r);
};
y.qr = function() {
var r = l.$, a = l.K;
@@ -2316,37 +2322,37 @@ var OverlayScrollbars = function(r) {
};
y.Ur = l;
return [ function(r, e) {
- var n = ze(a, r, e);
+ var n = Ee(a, r, e);
m(n);
h(d(n, b(), e), r, !!e);
}, y, function() {
- i();
+ v();
p();
s();
} ];
};
- var gn = Math.round;
- var pn = function getClientOffset(r) {
+ var sn = Math.round;
+ var dn = function getClientOffset(r) {
return {
x: r.clientX,
y: r.clientY
};
};
- var _n = function getScale(r) {
+ var hn = function getScale(r) {
var a = jr(r), e = a.width, n = a.height;
- var t = Rr(r), v = t.w, i = t.h;
+ var t = Rr(r), i = t.w, v = t.h;
return {
- x: gn(e) / v || 1,
- y: gn(n) / i || 1
+ x: sn(e) / i || 1,
+ y: sn(n) / v || 1
};
};
- var wn = function continuePointerDown(r, a, e) {
+ var gn = function continuePointerDown(r, a, e) {
var n = a.scrollbars;
- var t = r.button, v = r.isPrimary, i = r.pointerType;
+ var t = r.button, i = r.isPrimary, v = r.pointerType;
var o = n.pointers;
- return 0 === t && v && n[e] && (o || []).includes(i);
+ return 0 === t && i && n[e] && (o || []).includes(v);
};
- var bn = function createRootClickStopPropagationEvents(r, a) {
+ var pn = function createRootClickStopPropagationEvents(r, a) {
return Nr(r, "mousedown", Nr.bind(0, a, "click", Yr, {
A: true,
O: true
@@ -2354,35 +2360,35 @@ var OverlayScrollbars = function(r) {
O: true
});
};
- var mn = function createDragScrollingEvents(r, a, e, n, t, v) {
- var i = be(), o = i.B;
+ var _n = function createDragScrollingEvents(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" + (v ? "Left" : "Top");
- var s = v ? "x" : "y";
- var d = v ? "w" : "h";
+ var c = "scroll" + (i ? "Left" : "Top");
+ var s = i ? "x" : "y";
+ var d = i ? "w" : "h";
var h = function createOnPointerMoveHandler(r, a, e) {
- return function(i) {
+ return function(v) {
var h = t(), g = h.Ar;
- var p = (pn(i)[s] - a) * e;
+ 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 && v ? o.n || o.i ? 1 : -1 : 1;
+ var S = y && i ? o.n || o.i ? 1 : -1 : 1;
n[c] = r + m * S;
};
};
return Nr(u, "pointerdown", (function(e) {
- if (wn(e, r, "dragScroll")) {
+ if (gn(e, r, "dragScroll")) {
var t = Nr(a, "selectstart", (function(r) {
return Wr(r);
}), {
C: false
});
- var v = Nr(u, "pointermove", h(n[c] || 0, pn(e)[s], 1 / _n(n)[s]));
+ var i = Nr(u, "pointermove", h(n[c] || 0, dn(e)[s], 1 / hn(n)[s]));
Nr(u, "pointerup", (function(r) {
t();
- v();
+ i();
u.releasePointerCapture(r.pointerId);
}), {
A: true
@@ -2391,11 +2397,11 @@ var OverlayScrollbars = function(r) {
}
}));
};
- var yn = function createScrollbarsSetupEvents(r, a) {
- return function(e, n, t, v, i, o) {
+ var wn = 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 = !!i.scrollBy;
+ var s = !!v.scrollBy;
var d = true;
return O.bind(0, [ Nr(u, "pointerenter", (function() {
n(Ta, true);
@@ -2403,8 +2409,8 @@ var OverlayScrollbars = function(r) {
n(Ta);
})), Nr(u, "wheel", (function(r) {
var a = r.deltaX, e = r.deltaY, t = r.deltaMode;
- if (s && d && 0 === t && F(u) === v) {
- i.scrollBy({
+ if (s && d && 0 === t && F(u) === i) {
+ v.scrollBy({
left: a,
top: e,
behavior: "smooth"
@@ -2420,45 +2426,45 @@ var OverlayScrollbars = function(r) {
}), {
C: false,
O: true
- }), bn(u, t), mn(r, t, e, i, a, o), c ]);
+ }), pn(u, t), _n(r, t, e, v, a, o), c ]);
};
};
- var Sn = Math.min, Cn = Math.max, On = Math.abs, xn = Math.round;
- var En = function getScrollbarHandleLengthRatio(r, a, e, n) {
+ var bn = Math.min, mn = Math.max, yn = Math.abs, Sn = Math.round;
+ var Cn = function getScrollbarHandleLengthRatio(r, a, e, n) {
if (n) {
var t = e ? "x" : "y";
- var v = n.Ar, i = n.Er;
- var o = i[t];
- var u = v[t];
- return Cn(0, Sn(1, o / (o + u)));
+ var i = n.Ar, v = n.Er;
+ var o = v[t];
+ var u = i[t];
+ return mn(0, bn(1, o / (o + u)));
}
var f = e ? "w" : "h";
var l = Rr(r)[f];
var c = Rr(a)[f];
- return Cn(0, Sn(1, l / c));
+ return mn(0, bn(1, l / c));
};
- var An = function getScrollbarHandleOffsetRatio(r, a, e, n, t, v) {
- var i = be(), o = i.B;
- var u = v ? "x" : "y";
- var f = v ? "Left" : "Top";
+ var On = 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 = xn(l[u]);
- var s = On(e["scroll" + f]);
- var d = v && t;
+ var c = Sn(l[u]);
+ var s = yn(e["scroll" + f]);
+ var d = i && t;
var h = o.i ? s : c - s;
var g = d ? h : s;
- var p = Sn(1, g / c);
- var w = En(r, a, v);
+ var p = bn(1, g / c);
+ var w = Cn(r, a, i);
return 1 / w * (1 - w) * p;
};
- var Pn = function createScrollbarsSetupElements(r, a, e) {
- var n = be(), t = n.U;
- var v = t(), i = v.scrollbars;
- var o = i.slot;
- var u = a.ir, f = a.$, l = a.J, s = a.K, d = a.lr, h = a.nr;
+ var xn = function createScrollbarsSetupElements(r, a, e) {
+ var n = pe(), t = n.U;
+ var i = t(), v = i.scrollbars;
+ var o = v.slot;
+ var u = a.vr, f = a.$, l = a.J, s = a.K, d = a.lr, h = a.nr;
var g = d ? {} : r, p = g.scrollbars;
var w = p || {}, b = w.slot;
- var m = Se([ f, l, s ], (function() {
+ var m = be([ f, l, s ], (function() {
return l;
}), o, b);
var S = function scrollbarStructureAddRemoveClass(r, a, e) {
@@ -2476,16 +2482,16 @@ var OverlayScrollbars = function(r) {
var E = function scrollbarStructureRefreshHandleLength(r, a, e) {
x(r, (function(r) {
var n;
- var t = r.Nr, v = r.Yr;
- return [ t, (n = {}, n[e ? "width" : "height"] = (100 * En(t, v, e, a)).toFixed(3) + "%",
+ var t = r.Nr, i = r.Yr;
+ return [ t, (n = {}, n[e ? "width" : "height"] = (100 * Cn(t, i, e, a)).toFixed(3) + "%",
n) ];
}));
};
var A = function scrollbarStructureRefreshHandleOffset(r, a, e) {
var n = e ? "X" : "Y";
x(r, (function(r) {
- var t = r.Nr, v = r.Yr, i = r.Wr;
- var o = An(t, v, h, a, Lr(i), e);
+ var t = r.Nr, i = r.Yr, v = r.Wr;
+ var o = On(t, i, h, a, Lr(v), e);
var u = o === o;
return [ t, {
transform: u ? "translate" + n + "(" + (100 * o).toFixed(3) + "%)" : ""
@@ -2498,9 +2504,9 @@ var OverlayScrollbars = function(r) {
var T = function scrollbarsAddRemoveClass(r, a, e) {
var n = c(e);
var t = n ? e : true;
- var v = n ? !e : true;
+ var i = n ? !e : true;
t && S(z, r, a);
- v && S(L, r, a);
+ i && S(L, r, a);
};
var H = function refreshScrollbarsHandleLength(r) {
E(z, r, true);
@@ -2514,18 +2520,18 @@ var OverlayScrollbars = function(r) {
var a = r ? Oa : xa;
var n = r ? z : L;
var t = C(n) ? La : "";
- var v = Z(Sa + " " + a + " " + t);
- var i = Z(Ea);
+ var i = Z(Sa + " " + a + " " + t);
+ var v = Z(Ea);
var o = Z(Aa);
var f = {
- Wr: v,
- Yr: i,
+ Wr: i,
+ Yr: v,
Nr: o
};
- Y(v, i);
- Y(i, o);
+ Y(i, v);
+ Y(v, o);
y(n, f);
- y(P, [ X.bind(0, v), e(f, T, u, l, h, r) ]);
+ y(P, [ X.bind(0, i), e(f, T, u, l, h, r) ]);
return f;
};
var R = M.bind(0, true);
@@ -2555,14 +2561,14 @@ var OverlayScrollbars = function(r) {
}
}, V, O.bind(0, P) ];
};
- var zn = function createScrollbarsSetup(r, a, e) {
+ var En = function createScrollbarsSetup(r, a, e) {
var n;
var t;
- var v;
var i;
+ var v;
var o;
var u = 0;
- var f = Le({});
+ var f = Ae({});
var l = f[0];
var c = Cr(), s = c[0], d = c[1];
var h = Cr(), g = h[0], p = h[1];
@@ -2571,7 +2577,7 @@ var OverlayScrollbars = function(r) {
var x = Cr((function() {
return u;
})), E = x[0], A = x[1];
- var P = Pn(r, e.Ur, yn(a, e)), z = P[0], L = P[1], T = P[2];
+ 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 q = z.$r, U = z.ra, N = z.Zr, Y = z.Gr, W = z.Xr;
var G = q.Qr;
@@ -2599,13 +2605,13 @@ var OverlayScrollbars = function(r) {
}
};
var J = function onHostMouseEnter() {
- i = t;
- i && $(true);
+ v = t;
+ v && $(true);
};
var K = [ m, A, C, p, d, T, Nr(D, "pointerover", J, {
A: true
}), Nr(D, "pointerenter", J), Nr(D, "pointerleave", (function() {
- i = false;
+ v = false;
t && $(false);
})), Nr(D, "pointermove", (function() {
n && s((function() {
@@ -2618,9 +2624,9 @@ var OverlayScrollbars = function(r) {
})), Nr(k, "scroll", (function() {
g((function() {
W(e());
- v && $(true);
+ i && $(true);
b((function() {
- v && !i && $(false);
+ i && !v && $(false);
}));
}));
j && G(Z);
@@ -2629,9 +2635,9 @@ var OverlayScrollbars = function(r) {
var Q = l.bind(0);
Q.Ur = z;
Q.qr = L;
- return [ function(r, i, f) {
+ return [ function(r, v, f) {
var l = f.Lr, c = f.Tr, s = f.zr, d = f.br;
- var h = ze(a, r, i);
+ 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];
@@ -2640,8 +2646,8 @@ var OverlayScrollbars = function(r) {
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 || i;
- var k = s || x || i;
+ var V = l || c || d || v;
+ var k = s || x || v;
var j = function setScrollbarVisibility(r, a) {
var e = "visible" === O || "auto" === O && "scroll" === r;
N(Pa, e, a);
@@ -2656,8 +2662,8 @@ var OverlayScrollbars = function(r) {
if (P) {
n = "move" === A;
t = "leave" === A;
- v = "never" !== A;
- $(!v, true);
+ i = "never" !== A;
+ $(!i, true);
}
if (D) {
N(Ia, H);
@@ -2680,15 +2686,15 @@ var OverlayScrollbars = function(r) {
}
}, Q, O.bind(0, K) ];
};
- var Ln = function OverlayScrollbars(r, a, e) {
- var n = be(), t = n.Y, v = n.q;
- var i = ka();
+ var An = function OverlayScrollbars(r, a, e) {
+ var n = pe(), t = n.Y, i = n.q;
+ var v = ka();
var o = w(r);
var u = o ? r : r.target;
- var f = Ae(u);
+ var f = Oe(u);
if (a && !f) {
var l = false;
- var c = i[Qa];
+ var c = v[Ka];
var d = function validateOptions(r) {
var a = r || {};
var e = c && c.P;
@@ -2696,14 +2702,14 @@ var OverlayScrollbars = function(r) {
};
var h = A({}, t(), d(a));
var g = $r(e), p = g[0], b = g[1], m = g[2];
- var y = hn(r, h), S = y[0], C = y[1], O = y[2];
- var x = zn(r, h, C), z = x[0], L = x[1], T = x[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 H = function update(r, a) {
S(r, !!a);
};
- var D = v(H.bind(0, {}, true));
+ var D = i(H.bind(0, {}, true));
var M = function destroy(r) {
- Ee(u);
+ Ce(u);
D();
T();
O();
@@ -2727,20 +2733,20 @@ 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, v = r.rr, i = r.mr, o = r.wr;
+ var r = C(), a = r.Er, e = r.Ar, n = r.Cr, t = r.Pr, i = r.rr, v = r.mr, o = r.wr;
return A({}, {
overflowEdge: a,
overflowAmount: e,
overflowStyle: n,
hasOverflow: t,
- padding: v,
- paddingAbsolute: i,
+ padding: i,
+ paddingAbsolute: v,
directionRTL: o,
destroyed: l
});
},
elements: function elements() {
- var r = C.Ur, a = r.$, e = r.J, n = r.rr, t = r.K, v = r.ar, i = r.nr, o = r.tr;
+ 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 c = function translateScrollbarStructure(r) {
var a = r.Nr, e = r.Yr, n = r.Wr;
@@ -2766,8 +2772,8 @@ var OverlayScrollbars = function(r) {
host: e,
padding: n || t,
viewport: t,
- content: v || t,
- scrollOffsetElement: i,
+ content: i || t,
+ scrollOffsetElement: v,
scrollEventElement: o,
scrollbarHorizontal: s(f),
scrollbarVertical: s(l)
@@ -2782,28 +2788,28 @@ var OverlayScrollbars = function(r) {
C.Fr((function(r, a, e) {
z(a, e, r);
}));
- each(E(i), (function(r) {
- var a = i[r];
+ each(E(v), (function(r) {
+ var a = v[r];
if (s(a)) {
a(OverlayScrollbars, R);
}
}));
- if (Ce(!o && r.cancel, C.Ur)) {
+ if (me(!o && r.cancel, C.Ur)) {
M(true);
return R;
}
C.qr();
L.qr();
- xe(u, R);
+ Se(u, R);
m("initialized", [ R ]);
C.Fr((function(r, a, e) {
- var n = r.pr, t = r.br, v = r.gr, i = 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.Lr, o = r.Tr, u = r.zr, f = r._r, l = r.Or;
m("updated", [ R, {
updateHints: {
sizeChanged: n,
directionChanged: t,
- heightIntrinsicChanged: v,
- overflowEdgeChanged: i,
+ heightIntrinsicChanged: i,
+ overflowEdgeChanged: v,
overflowAmountChanged: o,
overflowStyleChanged: u,
contentMutation: f,
@@ -2817,21 +2823,21 @@ var OverlayScrollbars = function(r) {
}
return f;
};
- Ln.plugin = ja;
- Ln.valid = function(r) {
+ An.plugin = ja;
+ An.valid = function(r) {
var a = r && r.elements;
var e = s(a) && a();
- return p(e) && !!Ae(e.target);
+ return p(e) && !!Oe(e.target);
};
- Ln.env = function() {
- var r = be(), a = r.j, e = r.H, n = r.T, t = r.B, v = r.F, i = r.D, o = r.G, u = r.X, f = r.U, l = r.N, c = r.Y, s = r.W;
+ 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;
return A({}, {
scrollbarsSize: a,
scrollbarsOverlaid: e,
scrollbarsHiding: n,
rtlScrollBehavior: t,
- flexboxGlue: v,
- cssCustomProperties: i,
+ flexboxGlue: i,
+ cssCustomProperties: v,
staticDefaultInitialization: o,
staticDefaultOptions: u,
getDefaultInitialization: f,
@@ -2840,9 +2846,9 @@ var OverlayScrollbars = function(r) {
setDefaultOptions: s
});
};
- r.OverlayScrollbars = Ln;
- r.scrollbarsHidingPlugin = se;
- r.sizeObserverPlugin = te;
+ r.OverlayScrollbars = An;
+ r.scrollbarsHidingPlugin = fe;
+ r.sizeObserverPlugin = ee;
Object.defineProperty(r, "v", {
value: true
});
diff --git a/packages/overlayscrollbars/dist/browser/overlayscrollbars.browser.es5.js.map b/packages/overlayscrollbars/dist/browser/overlayscrollbars.browser.es5.js.map
index 4b6afc5..a74a663 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 [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 = {\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 [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 ? `${hideOffsetX + fractionalContenHeight - viewportArrangeVerticalPaddingValue}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