diff --git a/local/config/src/playwright.js b/local/config/src/playwright.js
index 9355ec6..29b8f81 100644
--- a/local/config/src/playwright.js
+++ b/local/config/src/playwright.js
@@ -6,7 +6,7 @@ module.exports = {
actionTimeout: 300,
navigationTimeout: 1000,
retries: 0,
- workers: 1,
+ workers: 4,
projects: [
{
name: 'Chromium',
diff --git a/local/config/src/resolve.json b/local/config/src/resolve.json
index deec30c..75bc653 100644
--- a/local/config/src/resolve.json
+++ b/local/config/src/resolve.json
@@ -1,4 +1,5 @@
{
"extensions": [".json", ".js", "jsx", ".mjs", ".ts", ".tsx"],
- "directories": ["node_modules", "src"]
+ "directories": ["node_modules", "src"],
+ "styleExtensions": [".scss", ".sass", ".css"]
}
diff --git a/local/rollup/src/pipeline.build.js b/local/rollup/src/pipeline.build.js
index 89e26e8..635bd66 100644
--- a/local/rollup/src/pipeline.build.js
+++ b/local/rollup/src/pipeline.build.js
@@ -69,7 +69,7 @@ module.exports = (resolve, options) => {
plugins: [
rollupLicense(banner, sourcemap),
rollupAlias(alias),
- rollupScss(banner, sourcemap, extractStyles, false),
+ rollupScss(resolve, sourcemap, extractStyles, false),
rollupTs(input),
rollupResolve(resolve),
rollupCommonjs(sourcemap, resolve),
diff --git a/local/rollup/src/pipeline.common.plugins.js b/local/rollup/src/pipeline.common.plugins.js
index f6ad5af..2b44c65 100644
--- a/local/rollup/src/pipeline.common.plugins.js
+++ b/local/rollup/src/pipeline.common.plugins.js
@@ -1,6 +1,7 @@
const path = require('path');
const sass = require('sass');
const postcss = require('postcss');
+const cssnano = require('cssnano');
const autoprefixer = require('autoprefixer');
const { nodeResolve: rollupPluginResolve } = require('@rollup/plugin-node-resolve');
const { babel: rollupBabelInputPlugin } = require('@rollup/plugin-babel');
@@ -27,15 +28,16 @@ module.exports = {
sourceMap: sourcemap,
extensions: resolve.extensions,
}),
- rollupResolve: (resolve) =>
+ rollupResolve: (resolve, resolveOnly) =>
rollupPluginResolve({
mainFields: ['browser', 'umd:main', 'module', 'main'],
moduleDirectories: resolve.directories,
extensions: resolve.extensions,
ignoreSideEffectsForRoot: true,
+ ...(resolveOnly ? { resolveOnly } : {}),
}),
- rollupScss: (banner, sourceMap, extractStyleOption, output) => {
- if (extractStyleOption) {
+ rollupScss: (resolve, sourceMap, extract, output, banner, minified) => {
+ if (extract) {
return output
? rollupPluginScss({
output,
@@ -49,10 +51,10 @@ module.exports = {
.map((line) => ` * ${line}\r\n`)
.join('')} */`
: undefined,
- processor: () => postcss([autoprefixer()]),
+ processor: () => postcss([autoprefixer()].concat(minified ? cssnano() : [])),
})
: rollupPluginIgnoreImport({
- extensions: ['.scss', '.sass', '.css'],
+ extensions: resolve.styleExtensions,
body: 'export default undefined;',
});
}
@@ -61,7 +63,6 @@ module.exports = {
rollupPluginEsBuild({
include: /\.[jt]sx?$/,
target: 'es6',
- tsconfig: './tsconfig.json',
}),
rollupBabel: (resolve, es6) =>
rollupBabelInputPlugin({
diff --git a/local/rollup/src/pipeline.dev.js b/local/rollup/src/pipeline.dev.js
index e244d8c..1d01f15 100644
--- a/local/rollup/src/pipeline.dev.js
+++ b/local/rollup/src/pipeline.dev.js
@@ -8,7 +8,7 @@ const {
} = require('./pipeline.common.plugins');
module.exports = (resolve, options) => {
- const { rollup, paths, alias, extractStyles, banner } = options;
+ const { rollup, paths, alias, extractStyles } = options;
const { output: rollupOutput, input, plugins = [], ...rollupOptions } = rollup;
const { file, sourcemap: rawSourcemap, ...outputConfig } = rollupOutput;
const { dist: distPath } = paths;
@@ -28,7 +28,7 @@ module.exports = (resolve, options) => {
...rollupOptions,
plugins: [
rollupAlias(alias),
- rollupScss(banner, sourcemap, extractStyles, false),
+ rollupScss(resolve, sourcemap, extractStyles, false),
rollupEsBuild(),
rollupCommonjs(sourcemap, resolve),
rollupResolve(resolve),
diff --git a/local/rollup/src/pipeline.styles.js b/local/rollup/src/pipeline.styles.js
index f9f3f61..3fcba34 100644
--- a/local/rollup/src/pipeline.styles.js
+++ b/local/rollup/src/pipeline.styles.js
@@ -2,26 +2,33 @@ const path = require('path');
const {
rollupAlias,
rollupResolve,
- rollupCommonjs,
rollupScss,
- rollupTs,
+ rollupEsBuild,
} = require('./pipeline.common.plugins');
module.exports = (resolve, options) => {
- const { rollup, alias, paths, banner } = options;
+ const { rollup, alias, paths, banner, extractStyles } = options;
const { output: rollupOutput, input } = rollup;
const { file, sourcemap } = rollupOutput;
const { styles: stylesPath } = paths;
const ogWrite = process.stdout.write;
- return {
+ const pipeline = (cssFilename, minified) => ({
input,
plugins: [
rollupAlias(alias),
- rollupScss(banner, sourcemap, true, path.resolve(stylesPath, `${file}.css`)),
- rollupTs(input),
- rollupResolve(resolve),
- rollupCommonjs(sourcemap, resolve),
+ rollupScss(
+ resolve,
+ sourcemap && !minified,
+ extractStyles,
+ path.resolve(stylesPath, cssFilename),
+ banner,
+ minified
+ ),
+ rollupEsBuild(),
+ rollupResolve(resolve, (module) =>
+ resolve.styleExtensions.some((ext) => module.endsWith(ext))
+ ),
{
generateBundle() {
process.stdout.write = () => {
@@ -33,5 +40,7 @@ module.exports = (resolve, options) => {
},
},
],
- };
+ });
+
+ return [pipeline(`${file}.css`), pipeline(`${file}.min.css`, true)];
};
diff --git a/package-lock.json b/package-lock.json
index 306d6de..17b4ca1 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -31,6 +31,7 @@
"@typescript-eslint/parser": "^5.31.0",
"autoprefixer": "^10.4.7",
"babel-jest": "^28.1.1",
+ "cssnano": "^5.1.12",
"esbuild": "^0.14.42",
"eslint": "^8.20.0",
"eslint-config-airbnb": "^19.0.4",
@@ -3856,8 +3857,9 @@
},
"node_modules/cssnano": {
"version": "5.1.12",
+ "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-5.1.12.tgz",
+ "integrity": "sha512-TgvArbEZu0lk/dvg2ja+B7kYoD7BBCmn3+k58xD0qjrGHsFzXY/wKTo9M5egcUCabPol05e/PVoIu79s2JN4WQ==",
"dev": true,
- "license": "MIT",
"dependencies": {
"cssnano-preset-default": "^5.2.12",
"lilconfig": "^2.0.3",
@@ -13058,6 +13060,8 @@
},
"cssnano": {
"version": "5.1.12",
+ "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-5.1.12.tgz",
+ "integrity": "sha512-TgvArbEZu0lk/dvg2ja+B7kYoD7BBCmn3+k58xD0qjrGHsFzXY/wKTo9M5egcUCabPol05e/PVoIu79s2JN4WQ==",
"dev": true,
"requires": {
"cssnano-preset-default": "^5.2.12",
diff --git a/package.json b/package.json
index 6f3b7a0..b8c676e 100644
--- a/package.json
+++ b/package.json
@@ -27,6 +27,7 @@
"@typescript-eslint/parser": "^5.31.0",
"autoprefixer": "^10.4.7",
"babel-jest": "^28.1.1",
+ "cssnano": "^5.1.12",
"esbuild": "^0.14.42",
"eslint": "^8.20.0",
"eslint-config-airbnb": "^19.0.4",
diff --git a/packages/overlayscrollbars/dist/browser/overlayscrollbars.browser.es5.js b/packages/overlayscrollbars/dist/browser/overlayscrollbars.browser.es5.js
new file mode 100644
index 0000000..b8d4078
--- /dev/null
+++ b/packages/overlayscrollbars/dist/browser/overlayscrollbars.browser.es5.js
@@ -0,0 +1,2817 @@
+/*!
+ * OverlayScrollbars
+ * Version: 2.0.0-beta.0
+ *
+ * Copyright (c) Rene Haas | KingSora.
+ * https://github.com/KingSora
+ *
+ * Released under the MIT license.
+ */
+
+var OverlayScrollbars = function(r) {
+ "use strict";
+ function each(r, a) {
+ if (h(r)) {
+ for (var n = 0; n < r.length; n++) {
+ if (false === a(r[n], n, r)) {
+ break;
+ }
+ }
+ } else if (r) {
+ each(Object.keys(r), (function(n) {
+ return a(r[n], n, r);
+ }));
+ }
+ return r;
+ }
+ function style(r, a) {
+ var n = l(a);
+ var e = d(a) || n;
+ if (e) {
+ var t = n ? "" : {};
+ if (r) {
+ var i = window.getComputedStyle(r, null);
+ t = n ? Ar(r, i, a) : a.reduce((function(a, n) {
+ a[n] = Ar(r, i, n);
+ return a;
+ }), t);
+ }
+ return t;
+ }
+ r && each(E(a), (function(n) {
+ return Pr(r, n, a[n]);
+ }));
+ }
+ function getDefaultExportFromCjs(r) {
+ return r && r.v && Object.prototype.hasOwnProperty.call(r, "default") ? r["default"] : r;
+ }
+ var a = function createCache(r, a) {
+ var n = r.o, e = r.u, t = r.g;
+ var i = n;
+ var v;
+ var o = function cacheUpdateContextual(r, a) {
+ var n = i;
+ var o = r;
+ var u = a || (e ? !e(n, o) : n !== o);
+ if (u || t) {
+ i = o;
+ v = n;
+ }
+ return [ i, u, v ];
+ };
+ var u = function cacheUpdateIsolated(r) {
+ return o(a(i, v), r);
+ };
+ var f = function getCurrentCache(r) {
+ return [ i, !!r, v ];
+ };
+ return [ a ? u : o, f ];
+ };
+ var n = Node.ELEMENT_NODE;
+ var e = Object.prototype, t = e.toString, i = e.hasOwnProperty;
+ var v = function isUndefined(r) {
+ return void 0 === r;
+ };
+ var o = function isNull(r) {
+ return null === r;
+ };
+ var u = function type(r) {
+ return v(r) || o(r) ? "" + r : t.call(r).replace(/^\[object (.+)\]$/, "$1").toLowerCase();
+ };
+ var f = function isNumber(r) {
+ return "number" === typeof r;
+ };
+ var l = function isString(r) {
+ return "string" === typeof r;
+ };
+ var c = function isBoolean(r) {
+ return "boolean" === typeof r;
+ };
+ var s = function isFunction(r) {
+ return "function" === typeof r;
+ };
+ var d = function isArray(r) {
+ return Array.isArray(r);
+ };
+ var g = function isObject(r) {
+ return "object" === typeof r && !d(r) && !o(r);
+ };
+ var h = function isArrayLike(r) {
+ var a = !!r && r.length;
+ var n = f(a) && a > -1 && a % 1 == 0;
+ return d(r) || !s(r) && n ? a > 0 && g(r) ? a - 1 in r : true : false;
+ };
+ var p = function isPlainObject(r) {
+ if (!r || !g(r) || "object" !== u(r)) {
+ return false;
+ }
+ var a;
+ var n = "constructor";
+ var e = r[n];
+ var t = e && e.prototype;
+ var o = i.call(r, n);
+ var f = t && i.call(t, "isPrototypeOf");
+ if (e && !o && !f) {
+ return false;
+ }
+ for (a in r) {}
+ return v(a) || i.call(r, a);
+ };
+ var b = function isHTMLElement(r) {
+ var a = HTMLElement;
+ return r ? a ? r instanceof a : r.nodeType === n : false;
+ };
+ var w = function isElement(r) {
+ var a = Element;
+ return r ? a ? r instanceof a : r.nodeType === n : false;
+ };
+ var m = function indexOf(r, a, n) {
+ return r.indexOf(a, n);
+ };
+ var y = function push(r, a, n) {
+ !n && !l(a) && h(a) ? Array.prototype.push.apply(r, a) : r.push(a);
+ return r;
+ };
+ var S = function from(r) {
+ var a = Array.from;
+ var n = [];
+ if (a && r) {
+ return a(r);
+ }
+ if (r instanceof Set) {
+ r.forEach((function(r) {
+ y(n, r);
+ }));
+ } else {
+ each(r, (function(r) {
+ y(n, r);
+ }));
+ }
+ return n;
+ };
+ var C = function isEmptyArray(r) {
+ return !!r && 0 === r.length;
+ };
+ var O = function runEachAndClear(r, a, n) {
+ var e = function runFn(r) {
+ return r && r.apply(void 0, a || []);
+ };
+ each(r, e);
+ !n && (r.length = 0);
+ };
+ var x = function hasOwnProperty(r, a) {
+ return Object.prototype.hasOwnProperty.call(r, a);
+ };
+ var E = function keys(r) {
+ return r ? Object.keys(r) : [];
+ };
+ var A = function assignDeep(r, a, n, e, t, i, v) {
+ var u = [ a, n, e, t, i, v ];
+ if (("object" !== typeof r || o(r)) && !s(r)) {
+ r = {};
+ }
+ each(u, (function(a) {
+ each(E(a), (function(n) {
+ var e = a[n];
+ if (r === e) {
+ return true;
+ }
+ var t = d(e);
+ if (e && (p(e) || t)) {
+ var i = r[n];
+ var v = i;
+ if (t && !d(i)) {
+ v = [];
+ } else if (!t && !p(i)) {
+ v = {};
+ }
+ r[n] = assignDeep(v, e);
+ } else {
+ r[n] = e;
+ }
+ }));
+ }));
+ return r;
+ };
+ var P = function isEmptyObject(r) {
+ for (var a in r) {
+ return false;
+ }
+ return true;
+ };
+ var z = function getSetProp(r, a, n, e) {
+ if (v(e)) {
+ return n ? n[r] : a;
+ }
+ n && (l(e) || f(e)) && (n[r] = e);
+ };
+ var L = function attr(r, a, n) {
+ if (v(n)) {
+ return r ? r.getAttribute(a) : null;
+ }
+ r && r.setAttribute(a, n);
+ };
+ var T = function attrClass(r, a, n, e) {
+ if (n) {
+ var t = L(r, a) || "";
+ var i = new Set(t.split(" "));
+ i[e ? "add" : "delete"](n);
+ L(r, a, S(i).join(" ").trim());
+ }
+ };
+ var H = function hasAttrClass(r, a, n) {
+ var e = L(r, a) || "";
+ var t = new Set(e.split(" "));
+ return t.has(n);
+ };
+ var D = function removeAttr(r, a) {
+ r && r.removeAttribute(a);
+ };
+ var M = function scrollLeft(r, a) {
+ return z("scrollLeft", 0, r, a);
+ };
+ var R = function scrollTop(r, a) {
+ return z("scrollTop", 0, r, a);
+ };
+ var I = Element.prototype;
+ var V = function find(r, a) {
+ var n = [];
+ var e = a ? w(a) ? a : null : document;
+ return e ? y(n, e.querySelectorAll(r)) : n;
+ };
+ var k = function findFirst(r, a) {
+ var n = a ? w(a) ? a : null : document;
+ return n ? n.querySelector(r) : null;
+ };
+ var j = function is(r, a) {
+ if (w(r)) {
+ var n = I.matches || I.msMatchesSelector;
+ return n.call(r, a);
+ }
+ return false;
+ };
+ var B = function contents(r) {
+ return r ? S(r.childNodes) : [];
+ };
+ var F = function parent(r) {
+ return r ? r.parentElement : null;
+ };
+ var q = function closest(r, a) {
+ if (w(r)) {
+ var n = I.closest;
+ if (n) {
+ return n.call(r, a);
+ }
+ do {
+ if (j(r, a)) {
+ return r;
+ }
+ r = F(r);
+ } while (r);
+ }
+ return null;
+ };
+ var U = function liesBetween(r, a, n) {
+ var e = r && q(r, a);
+ var t = r && k(n, e);
+ var i = q(t, a) === e;
+ return e && t ? e === r || t === r || i && q(q(r, n), a) !== e : false;
+ };
+ var N = function before(r, a, n) {
+ if (n && r) {
+ var e = a;
+ var t;
+ if (h(n)) {
+ t = document.createDocumentFragment();
+ each(n, (function(r) {
+ if (r === e) {
+ e = r.previousSibling;
+ }
+ t.appendChild(r);
+ }));
+ } else {
+ t = n;
+ }
+ if (a) {
+ if (!e) {
+ e = r.firstChild;
+ } else if (e !== a) {
+ e = e.nextSibling;
+ }
+ }
+ r.insertBefore(t, e || null);
+ }
+ };
+ var Y = function appendChildren(r, a) {
+ N(r, null, a);
+ };
+ var W = function insertBefore(r, a) {
+ N(F(r), r, a);
+ };
+ var G = function insertAfter(r, a) {
+ N(F(r), r && r.nextSibling, a);
+ };
+ var X = function removeElements(r) {
+ if (h(r)) {
+ each(S(r), (function(r) {
+ return removeElements(r);
+ }));
+ } else if (r) {
+ var a = F(r);
+ if (a) {
+ a.removeChild(r);
+ }
+ }
+ };
+ var Z = function createDiv(r) {
+ var a = document.createElement("div");
+ if (r) {
+ L(a, "class", r);
+ }
+ return a;
+ };
+ var $ = function createDOM(r) {
+ var a = Z();
+ a.innerHTML = r.trim();
+ return each(B(a), (function(r) {
+ return X(r);
+ }));
+ };
+ var J = function firstLetterToUpper(r) {
+ return r.charAt(0).toUpperCase() + r.slice(1);
+ };
+ var K = function getDummyStyle() {
+ return Z().style;
+ };
+ var Q = [ "-webkit-", "-moz-", "-o-", "-ms-" ];
+ var rr = [ "WebKit", "Moz", "O", "MS", "webkit", "moz", "o", "ms" ];
+ var ar = {};
+ var nr = {};
+ var er = function cssProperty(r) {
+ var a = nr[r];
+ if (x(nr, r)) {
+ return a;
+ }
+ var n = J(r);
+ var e = K();
+ each(Q, (function(t) {
+ var i = t.replace(/-/g, "");
+ var v = [ r, t + r, i + n, J(i) + n ];
+ return !(a = v.find((function(r) {
+ return void 0 !== e[r];
+ })));
+ }));
+ return nr[r] = a || "";
+ };
+ var tr = function jsAPI(r) {
+ var a = ar[r] || window[r];
+ if (x(ar, r)) {
+ return a;
+ }
+ each(rr, (function(n) {
+ a = a || window[n + J(r)];
+ return !a;
+ }));
+ ar[r] = a;
+ return a;
+ };
+ var ir = tr("MutationObserver");
+ var vr = tr("IntersectionObserver");
+ var or = tr("ResizeObserver");
+ var ur = tr("cancelAnimationFrame");
+ var fr = tr("requestAnimationFrame");
+ var lr = window.setTimeout;
+ var cr = window.clearTimeout;
+ var sr = /[^\x20\t\r\n\f]+/g;
+ var dr = function classListAction(r, a, n) {
+ var e = r && r.classList;
+ var t;
+ var i = 0;
+ var v = false;
+ if (e && a && l(a)) {
+ var o = a.match(sr) || [];
+ v = o.length > 0;
+ while (t = o[i++]) {
+ v = !!n(e, t) && v;
+ }
+ }
+ return v;
+ };
+ var gr = function hasClass(r, a) {
+ return dr(r, a, (function(r, a) {
+ return r.contains(a);
+ }));
+ };
+ var hr = function removeClass(r, a) {
+ dr(r, a, (function(r, a) {
+ return r.remove(a);
+ }));
+ };
+ var pr = function addClass(r, a) {
+ dr(r, a, (function(r, a) {
+ return r.add(a);
+ }));
+ return hr.bind(0, r, a);
+ };
+ var _r = function equal(r, a, n, e) {
+ if (r && a) {
+ var t = true;
+ each(n, (function(n) {
+ var i = e ? e(r[n]) : r[n];
+ var v = e ? e(a[n]) : a[n];
+ if (i !== v) {
+ t = false;
+ }
+ }));
+ return t;
+ }
+ return false;
+ };
+ var br = function equalWH(r, a) {
+ return _r(r, a, [ "w", "h" ]);
+ };
+ var wr = function equalXY(r, a) {
+ return _r(r, a, [ "x", "y" ]);
+ };
+ var mr = function equalTRBL(r, a) {
+ return _r(r, a, [ "t", "r", "b", "l" ]);
+ };
+ var yr = function equalBCRWH(r, a, n) {
+ return _r(r, a, [ "width", "height" ], n && function(r) {
+ return Math.round(r);
+ });
+ };
+ var Sr = function noop() {};
+ var Cr = function debounce(r, a) {
+ var n;
+ var e;
+ var t;
+ var i = Sr;
+ var v = a || {}, o = v.p, u = v._, l = v.m;
+ var c = function invokeFunctionToDebounce(a) {
+ i();
+ cr(n);
+ n = e = void 0;
+ i = Sr;
+ r.apply(this, a);
+ };
+ var d = function mergeParms(r) {
+ return l && e ? l(e, r) : r;
+ };
+ var g = function flush() {
+ if (i !== Sr) {
+ c(d(t) || t);
+ }
+ };
+ var h = function debouncedFn() {
+ var r = S(arguments);
+ var a = s(o) ? o() : o;
+ var v = f(a) && a >= 0;
+ if (v) {
+ var l = s(u) ? u() : u;
+ var h = f(l) && l >= 0;
+ var p = a > 0 ? lr : fr;
+ var b = a > 0 ? cr : ur;
+ var w = d(r);
+ var m = w || r;
+ var y = c.bind(0, m);
+ i();
+ var C = p(y, a);
+ i = function clear() {
+ return b(C);
+ };
+ if (h && !n) {
+ n = lr(g, l);
+ }
+ e = t = m;
+ } else {
+ c(r);
+ }
+ };
+ h.S = g;
+ return h;
+ };
+ var Or = {
+ opacity: 1,
+ zindex: 1
+ };
+ var xr = function parseToZeroOrNumber(r, a) {
+ var n = a ? parseFloat(r) : parseInt(r, 10);
+ return n === n ? n : 0;
+ };
+ var Er = function adaptCSSVal(r, a) {
+ return !Or[r.toLowerCase()] && f(a) ? a + "px" : a;
+ };
+ var Ar = function getCSSVal(r, a, n) {
+ return null != a ? a[n] || a.getPropertyValue(n) : r.style[n];
+ };
+ var Pr = function setCSSVal(r, a, n) {
+ try {
+ var e = r.style;
+ if (!v(e[a])) {
+ e[a] = Er(a, n);
+ } else {
+ e.setProperty(a, n);
+ }
+ } catch (t) {}
+ };
+ var zr = function directionIsRTL(r) {
+ return "rtl" === style(r, "direction");
+ };
+ var Lr = function topRightBottomLeft(r, a, n) {
+ var e = a ? a + "-" : "";
+ var t = n ? "-" + n : "";
+ var i = e + "top" + t;
+ var v = e + "right" + t;
+ var o = e + "bottom" + t;
+ var u = e + "left" + t;
+ var f = style(r, [ i, v, o, u ]);
+ return {
+ t: xr(f[i]),
+ r: xr(f[v]),
+ b: xr(f[o]),
+ l: xr(f[u])
+ };
+ };
+ var Tr = Math.round;
+ var Hr = {
+ w: 0,
+ h: 0
+ };
+ var Dr = function windowSize() {
+ return {
+ w: window.innerWidth,
+ h: window.innerHeight
+ };
+ };
+ var Mr = function offsetSize(r) {
+ return r ? {
+ w: r.offsetWidth,
+ h: r.offsetHeight
+ } : Hr;
+ };
+ var Rr = function clientSize(r) {
+ return r ? {
+ w: r.clientWidth,
+ h: r.clientHeight
+ } : Hr;
+ };
+ var Ir = function scrollSize(r) {
+ return r ? {
+ w: r.scrollWidth,
+ h: r.scrollHeight
+ } : Hr;
+ };
+ var Vr = function fractionalSize(r) {
+ var a = parseFloat(style(r, "height")) || 0;
+ var n = parseFloat(style(r, "width")) || 0;
+ return {
+ w: n - Tr(n),
+ h: a - Tr(a)
+ };
+ };
+ var kr = function getBoundingClientRect(r) {
+ return r.getBoundingClientRect();
+ };
+ var jr;
+ var Br = function supportPassiveEvents() {
+ if (v(jr)) {
+ jr = false;
+ try {
+ window.addEventListener("test", null, Object.defineProperty({}, "passive", {
+ get: function get() {
+ jr = true;
+ }
+ }));
+ } catch (r) {}
+ }
+ return jr;
+ };
+ var Fr = function splitEventNames(r) {
+ return r.split(" ");
+ };
+ var qr = function off(r, a, n, e) {
+ each(Fr(a), (function(a) {
+ r.removeEventListener(a, n, e);
+ }));
+ };
+ var Ur = function on(r, a, n, e) {
+ var t;
+ var i = Br();
+ var v = null != (t = i && e && e.C) ? t : i;
+ var o = e && e.O || false;
+ var u = e && e.A || false;
+ var f = [];
+ var l = i ? {
+ passive: v,
+ capture: o
+ } : o;
+ each(Fr(a), (function(a) {
+ var e = u ? function(t) {
+ r.removeEventListener(a, e, o);
+ n && n(t);
+ } : n;
+ y(f, qr.bind(null, r, a, e, o));
+ r.addEventListener(a, e, l);
+ }));
+ return O.bind(0, f);
+ };
+ var Nr = function stopPropagation(r) {
+ return r.stopPropagation();
+ };
+ var Yr = function preventDefault(r) {
+ return r.preventDefault();
+ };
+ var Wr = {
+ x: 0,
+ y: 0
+ };
+ var Gr = function absoluteCoordinates(r) {
+ var a = r ? kr(r) : 0;
+ return a ? {
+ x: a.left + window.pageYOffset,
+ y: a.top + window.pageXOffset
+ } : Wr;
+ };
+ var Xr = function manageListener(r, a) {
+ each(d(a) ? a : [ a ], r);
+ };
+ var Zr = function createEventListenerHub(r) {
+ var a = new Map;
+ var n = function removeEvent(r, n) {
+ if (r) {
+ var e = a.get(r);
+ Xr((function(r) {
+ if (e) {
+ e[r ? "delete" : "clear"](r);
+ }
+ }), n);
+ } else {
+ a.forEach((function(r) {
+ r.clear();
+ }));
+ a.clear();
+ }
+ };
+ var e = function addEvent(r, e) {
+ var t = a.get(r) || new Set;
+ a.set(r, t);
+ Xr((function(r) {
+ r && t.add(r);
+ }), e);
+ return n.bind(0, r, e);
+ };
+ var t = function triggerEvent(r, n) {
+ var e = a.get(r);
+ each(S(e), (function(r) {
+ if (n && !C(n)) {
+ r.apply(0, n);
+ } else {
+ r();
+ }
+ }));
+ };
+ var i = E(r);
+ each(i, (function(a) {
+ e(a, r[a]);
+ }));
+ return [ e, n, t ];
+ };
+ var $r = function opsStringify(r) {
+ return JSON.stringify(r, (function(r, a) {
+ if (s(a)) {
+ throw new Error;
+ }
+ return a;
+ }));
+ };
+ var Jr = {
+ paddingAbsolute: false,
+ showNativeOverlaidScrollbars: false,
+ updating: {
+ elementEvents: [ [ "img", "load" ] ],
+ debounce: [ 0, 33 ],
+ attributes: null,
+ ignoreMutation: null
+ },
+ overflow: {
+ x: "scroll",
+ y: "scroll"
+ },
+ scrollbars: {
+ theme: "os-theme-dark",
+ visibility: "auto",
+ autoHide: "never",
+ autoHideDelay: 1300,
+ dragScroll: true,
+ clickScroll: false,
+ pointers: [ "mouse", "touch", "pen" ]
+ }
+ };
+ var Kr = function getOptionsDiff(r, a) {
+ var n = {};
+ var e = E(a).concat(E(r));
+ each(e, (function(e) {
+ var t = r[e];
+ var i = a[e];
+ if (g(t) && g(i)) {
+ A(n[e] = {}, getOptionsDiff(t, i));
+ } else if (x(a, e) && i !== t) {
+ var v = true;
+ if (d(t) || d(i)) {
+ try {
+ if ($r(t) === $r(i)) {
+ v = false;
+ }
+ } catch (o) {}
+ }
+ if (v) {
+ n[e] = i;
+ }
+ }
+ }));
+ return n;
+ };
+ var Qr = "os-environment";
+ var ra = Qr + "-flexbox-glue";
+ var aa = ra + "-max";
+ var na = "data-overlayscrollbars";
+ var ea = na + "-overflow-x";
+ var ta = na + "-overflow-y";
+ var ia = "overflowVisible";
+ var va = "scrollbarHidden";
+ var oa = "updating";
+ var ua = "os-padding";
+ var fa = "os-viewport";
+ var la = fa + "-arrange";
+ var ca = "os-content";
+ var sa = fa + "-scrollbar-hidden";
+ var da = "os-overflow-visible";
+ var ga = "os-size-observer";
+ var ha = ga + "-appear";
+ var pa = ga + "-listener";
+ var _a = pa + "-scroll";
+ var ba = pa + "-item";
+ var wa = ba + "-final";
+ var ma = "os-trinsic-observer";
+ var ya = "os-scrollbar";
+ var Sa = ya + "-rtl";
+ var Ca = ya + "-horizontal";
+ var Oa = ya + "-vertical";
+ var xa = ya + "-track";
+ var Ea = ya + "-handle";
+ var Aa = ya + "-visible";
+ var Pa = ya + "-cornerless";
+ var za = ya + "-transitionless";
+ var La = ya + "-interaction";
+ var Ta = ya + "-unusable";
+ var Ha = ya + "-auto-hidden";
+ var Da = xa + "-interactive";
+ var Ma = Ea + "-interactive";
+ var Ra = {};
+ var Ia = function getPlugins() {
+ return Ra;
+ };
+ var Va = function addPlugin(r) {
+ each(d(r) ? r : [ r ], (function(r) {
+ var a = E(r)[0];
+ Ra[a] = r[a];
+ }));
+ };
+ var ka = {
+ exports: {}
+ };
+ (function(r) {
+ function _extends() {
+ r.exports = _extends = Object.assign ? Object.assign.bind() : function(r) {
+ for (var a = 1; a < arguments.length; a++) {
+ var n = arguments[a];
+ for (var e in n) {
+ if (Object.prototype.hasOwnProperty.call(n, e)) {
+ r[e] = n[e];
+ }
+ }
+ }
+ return r;
+ }, r.exports.v = true, r.exports["default"] = r.exports;
+ return _extends.apply(this, arguments);
+ }
+ r.exports = _extends, r.exports.v = true, r.exports["default"] = r.exports;
+ })(ka);
+ var ja = getDefaultExportFromCjs(ka.exports);
+ var Ba = {
+ boolean: "__TPL_boolean_TYPE__",
+ number: "__TPL_number_TYPE__",
+ string: "__TPL_string_TYPE__",
+ array: "__TPL_array_TYPE__",
+ object: "__TPL_object_TYPE__",
+ function: "__TPL_function_TYPE__",
+ null: "__TPL_null_TYPE__"
+ };
+ var Fa = function validateRecursive(r, a, n, e) {
+ var t = {};
+ var i = ja({}, a);
+ var o = E(r).filter((function(r) {
+ return x(a, r);
+ }));
+ each(o, (function(o) {
+ var f = a[o];
+ var c = r[o];
+ var s = p(c);
+ var g = e ? e + "." : "";
+ if (s && p(f)) {
+ var h = validateRecursive(c, f, n, g + o), b = h[0], w = h[1];
+ t[o] = b;
+ i[o] = w;
+ each([ i, t ], (function(r) {
+ if (P(r[o])) {
+ delete r[o];
+ }
+ }));
+ } else if (!s) {
+ var m = false;
+ var S = [];
+ var C = [];
+ var O = u(f);
+ var x = !d(c) ? [ c ] : c;
+ each(x, (function(r) {
+ var a;
+ each(Ba, (function(n, e) {
+ if (n === r) {
+ a = e;
+ }
+ }));
+ var n = v(a);
+ if (n && l(f)) {
+ var e = r.split(" ");
+ m = !!e.find((function(r) {
+ return r === f;
+ }));
+ y(S, e);
+ } else {
+ m = Ba[O] === r;
+ }
+ y(C, n ? Ba.string : a);
+ return !m;
+ }));
+ if (m) {
+ t[o] = f;
+ } else if (n) {
+ console.warn('The option "' + g + 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 i[o];
+ }
+ }));
+ return [ t, i ];
+ };
+ var qa = function validateOptions(r, a, n) {
+ return Fa(r, a, n);
+ };
+ var Ua;
+ var Na = Ba.number;
+ var Ya = Ba.boolean;
+ var Wa = [ Ba.array, Ba.null ];
+ var Ga = "hidden scroll visible visible-hidden";
+ var Xa = "visible hidden auto";
+ var Za = "never scroll leavemove";
+ var $a = {
+ paddingAbsolute: Ya,
+ showNativeOverlaidScrollbars: Ya,
+ updating: {
+ elementEvents: Wa,
+ attributes: Wa,
+ debounce: [ Ba.number, Ba.array, Ba.null ],
+ ignoreMutation: [ Ba.function, Ba.null ]
+ },
+ overflow: {
+ x: Ga,
+ y: Ga
+ },
+ scrollbars: {
+ theme: [ Ba.string, Ba.null ],
+ visibility: Xa,
+ autoHide: Za,
+ autoHideDelay: Na,
+ dragScroll: Ya,
+ clickScroll: Ya,
+ pointers: [ Ba.array, Ba.null ]
+ }
+ };
+ var Ja = "__osOptionsValidationPlugin";
+ Ua = {}, Ua[Ja] = {
+ P: function _(r, a) {
+ var n = qa($a, r, a), e = n[0], t = n[1];
+ return ja({}, t, e);
+ }
+ }, Ua;
+ var Ka;
+ var Qa = 3333333;
+ var rn = "scroll";
+ var an = "__osSizeObserverPlugin";
+ var nn = (Ka = {}, Ka[an] = {
+ P: function _(r, a, n) {
+ var e = $('
');
+ Y(r, e);
+ pr(r, _a);
+ var t = e[0];
+ var i = t.lastChild;
+ var v = t.firstChild;
+ var o = null == v ? void 0 : v.firstChild;
+ var u = Mr(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);
+ }
+ };
+ var g = function onScroll(r) {
+ f = Mr(t);
+ l = !r || !br(f, u);
+ if (r) {
+ Nr(r);
+ if (l && !c) {
+ ur(c);
+ c = fr(d);
+ }
+ } else {
+ d(false === r);
+ }
+ s();
+ };
+ var h = y([], [ Ur(v, rn, g), Ur(i, rn, g) ]);
+ style(o, {
+ width: Qa,
+ height: Qa
+ });
+ fr(s);
+ return [ n ? g.bind(0, false) : s, h ];
+ }
+ }, Ka);
+ var en;
+ var tn = 0;
+ var vn = Math.round, un = Math.abs;
+ var fn = function getWindowDPR() {
+ var r = window.screen.deviceXDPI || 0;
+ var a = window.screen.logicalXDPI || 1;
+ return window.devicePixelRatio || r / a;
+ };
+ var ln = function diffBiggerThanOne(r, a) {
+ var n = un(r);
+ var e = un(a);
+ return !(n === e || n + 1 === e || n - 1 === e);
+ };
+ var cn = "__osScrollbarsHidingPlugin";
+ var sn = (en = {}, en[cn] = {
+ L: function _createUniqueViewportArrangeElement(r) {
+ var a = r.T, n = r.H, e = r.D;
+ var t = !e && !a && (n.x || n.y);
+ var i = t ? document.createElement("style") : false;
+ if (i) {
+ L(i, "id", la + "-" + tn);
+ tn++;
+ }
+ return i;
+ },
+ M: function _overflowUpdateSegment(r, a, n, e, 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 g = l.x, h = l.y;
+ var p = o ? "paddingRight" : "paddingLeft";
+ var b = f[p];
+ var w = f.paddingTop;
+ var m = i.w + v.w;
+ var y = i.h + v.h;
+ var S = {
+ w: h && d ? h + m - b + "px" : "",
+ h: g && s ? g + y - w + "px" : ""
+ };
+ if (e) {
+ var C = e.sheet;
+ if (C) {
+ var O = C.cssRules;
+ if (O) {
+ if (!O.length) {
+ C.insertRule("#" + L(e, "id") + " + ." + la + "::before {}", 0);
+ }
+ var x = O[0].style;
+ x.width = S.w;
+ x.height = S.h;
+ }
+ }
+ } else {
+ style(n, {
+ "--os-vaw": S.w,
+ "--os-vah": S.h
+ });
+ }
+ }
+ return r;
+ };
+ var u = function undoViewportArrange(e, o, u) {
+ if (r) {
+ var f = u || i(e);
+ var l = t(), c = l.R;
+ var s = f.V;
+ var d = s.x, g = s.y;
+ var h = {};
+ var p = function assignProps(r) {
+ return each(r.split(" "), (function(r) {
+ h[r] = c[r];
+ }));
+ };
+ if (d) {
+ p("marginBottom paddingTop paddingBottom");
+ }
+ if (g) {
+ p("marginLeft marginRight paddingLeft paddingRight");
+ }
+ var b = style(n, E(h));
+ hr(n, la);
+ if (!a) {
+ h.height = "";
+ }
+ style(n, h);
+ return [ function() {
+ v(f, o, r, b);
+ style(n, b);
+ pr(n, la);
+ }, f ];
+ }
+ return [ Sr ];
+ };
+ return [ o, u ];
+ },
+ k: function _envWindowZoom() {
+ var r = {
+ w: 0,
+ h: 0
+ };
+ var a = 0;
+ return function(n, e, t) {
+ var i = Dr();
+ var v = {
+ w: i.w - r.w,
+ h: i.h - r.h
+ };
+ if (0 === v.w && 0 === v.h) {
+ return;
+ }
+ var o = {
+ w: un(v.w),
+ h: un(v.h)
+ };
+ var u = {
+ w: un(vn(i.w / (r.w / 100))),
+ h: un(vn(i.h / (r.h / 100)))
+ };
+ var f = fn();
+ var l = o.w > 2 && o.h > 2;
+ var c = !ln(u.w, u.h);
+ var s = f !== a && f > 0;
+ var d = l && c && s;
+ if (d) {
+ var g = e(), h = g[0], p = g[1];
+ A(n.j, h);
+ if (p) {
+ t();
+ }
+ }
+ r = i;
+ a = f;
+ };
+ }
+ }, en);
+ var dn;
+ var gn = function getNativeScrollbarSize(r, a, n, e) {
+ Y(r, a);
+ var t = Rr(a);
+ var i = Mr(a);
+ var v = Vr(n);
+ e && X(a);
+ return {
+ x: i.h - t.h + v.h,
+ y: i.w - t.w + v.w
+ };
+ };
+ var hn = function getNativeScrollbarsHiding(r) {
+ var a = false;
+ var n = pr(r, sa);
+ try {
+ a = "none" === style(r, er("scrollbar-width")) || "none" === window.getComputedStyle(r, "::-webkit-scrollbar").getPropertyValue("display");
+ } catch (e) {}
+ n();
+ return a;
+ };
+ var pn = function getRtlScrollBehavior(r, a) {
+ var n = "hidden";
+ style(r, {
+ overflowX: n,
+ overflowY: n,
+ direction: "rtl"
+ });
+ M(r, 0);
+ var e = Gr(r);
+ var t = Gr(a);
+ M(r, -999);
+ var i = Gr(a);
+ return {
+ i: e.x === t.x,
+ n: t.x !== i.x
+ };
+ };
+ var _n = function getFlexboxGlue(r, a) {
+ var n = pr(r, ra);
+ var e = kr(r);
+ var t = kr(a);
+ var i = yr(t, e, true);
+ var v = pr(r, aa);
+ var o = kr(r);
+ var u = kr(a);
+ var f = yr(u, o, true);
+ n();
+ v();
+ return i && f;
+ };
+ var bn = function createEnvironment() {
+ var r = document, n = r.body;
+ var e = $('');
+ var t = e[0];
+ var i = t.firstChild;
+ var v = Zr(), o = v[0], u = v[2];
+ var f = a({
+ o: gn(n, t, i),
+ u: wr
+ }, gn.bind(0, n, t, i, true)), l = f[0], c = f[1];
+ var s = c(), d = s[0];
+ var g = hn(t);
+ var h = {
+ x: 0 === d.x,
+ y: 0 === d.y
+ };
+ var p = {
+ host: null,
+ padding: !g,
+ viewport: function viewport(r) {
+ return g && r === r.ownerDocument.body && r;
+ },
+ content: false,
+ scrollbarsSlot: true,
+ cancel: {
+ nativeScrollbarsOverlaid: false,
+ body: null
+ }
+ };
+ var b = A({}, Jr);
+ var w = {
+ j: d,
+ H: h,
+ T: g,
+ D: "-1" === style(t, "zIndex"),
+ B: pn(t, i),
+ F: _n(t, i),
+ q: function _addListener(r) {
+ return o("_", r);
+ },
+ U: A.bind(0, {}, p),
+ N: function _setDefaultInitialization(r) {
+ A(p, r);
+ },
+ Y: A.bind(0, {}, b),
+ W: function _setDefaultOptions(r) {
+ A(b, r);
+ },
+ G: A({}, p),
+ X: A({}, b)
+ };
+ D(t, "style");
+ X(t);
+ if (!g && (!h.x || !h.y)) {
+ var m;
+ window.addEventListener("resize", (function() {
+ var r = Ia()[cn];
+ m = m || r && r.k();
+ m && m(w, l, u.bind(0, "_"));
+ }));
+ }
+ return w;
+ };
+ var wn = function getEnvironment() {
+ if (!dn) {
+ dn = bn();
+ }
+ return dn;
+ };
+ var mn = function resolveInitialization(r, a) {
+ return s(r) ? r.apply(0, a) : r;
+ };
+ var yn = function staticInitializationElement(r, a, n, e) {
+ var t = v(e) ? n : e;
+ var i = mn(t, r);
+ return i || a();
+ };
+ var Sn = function dynamicInitializationElement(r, a, n, e) {
+ var t = v(e) ? n : e;
+ var i = mn(t, r);
+ return !!i && (b(i) ? i : a());
+ };
+ var Cn = function cancelInitialization(r, a) {
+ var n = r || {}, e = n.nativeScrollbarsOverlaid, t = n.body;
+ var i = a.Z;
+ var u = wn(), f = u.U, l = u.H, c = u.T;
+ var s = f().cancel, d = s.nativeScrollbarsOverlaid, g = s.body;
+ var h = null != e ? e : d;
+ var p = v(t) ? g : t;
+ var b = (l.x || l.y) && h;
+ var w = i && (o(p) ? !c : p);
+ return !!b || !!w;
+ };
+ var On = new WeakMap;
+ var xn = function addInstance(r, a) {
+ On.set(r, a);
+ };
+ var En = function removeInstance(r) {
+ On.delete(r);
+ };
+ var An = function getInstance(r) {
+ return On.get(r);
+ };
+ var Pn = 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 zn = function createOptionCheck(r, a, n) {
+ return function(e) {
+ return [ Pn(r, e), n || void 0 !== Pn(a, e) ];
+ };
+ };
+ var Ln = function createState(r) {
+ var a = r;
+ return [ function() {
+ return a;
+ }, function(r) {
+ a = A({}, a, r);
+ } ];
+ };
+ var Tn = "tabindex";
+ var Hn = Z.bind(0, "");
+ var Dn = function unwrap(r) {
+ Y(F(r), B(r));
+ X(r);
+ };
+ var Mn = function addDataAttrHost(r, a) {
+ L(r, na, a);
+ return D.bind(0, r, na);
+ };
+ var Rn = function createStructureSetupElements(r) {
+ var a = wn();
+ var n = a.U, e = a.T;
+ var t = Ia()[cn];
+ var i = t && t.L;
+ var v = n(), o = v.host, u = v.viewport, f = v.padding, l = v.content;
+ var c = b(r);
+ var s = c ? {} : r;
+ var d = s.host, g = s.padding, h = s.viewport, p = s.content;
+ var w = c ? r : s.target;
+ var S = j(w, "textarea");
+ var C = w.ownerDocument;
+ var x = w === C.body;
+ var A = C.defaultView;
+ var P = yn.bind(0, [ w ]);
+ var z = Sn.bind(0, [ w ]);
+ var M = P(Hn, u, h);
+ var R = M === w;
+ var I = R && x;
+ var V = !R && A.top === A && C.activeElement === w;
+ var k = {
+ $: w,
+ J: S ? P(Hn, o, d) : w,
+ K: M,
+ rr: !R && z(Hn, f, g),
+ ar: !R && z(Hn, l, p),
+ nr: !R && !e && i && i(a),
+ er: I ? C.documentElement : M,
+ tr: I ? C : M,
+ ir: A,
+ vr: C,
+ ur: S,
+ Z: x,
+ lr: c,
+ cr: R,
+ sr: function _viewportHasClass(r, a) {
+ return R ? H(M, na, a) : gr(M, r);
+ },
+ dr: function _viewportAddRemoveClass(r, a, n) {
+ return R ? T(M, na, a, n) : (n ? pr : hr)(M, r);
+ }
+ };
+ var q = E(k).reduce((function(r, a) {
+ var n = k[a];
+ return y(r, n && !F(n) ? n : false);
+ }), []);
+ var U = function elementIsGenerated(r) {
+ return r ? m(q, r) > -1 : null;
+ };
+ var N = k.$, Z = k.J, $ = k.rr, J = k.K, K = k.ar, Q = k.nr;
+ var rr = [];
+ var ar = S && U(Z);
+ var nr = S ? N : B([ K, J, $, Z, N ].find((function(r) {
+ return false === U(r);
+ })));
+ var er = K || J;
+ var tr = function appendElements() {
+ var r = Mn(Z, R ? "viewport" : "host");
+ var a = pr($, ua);
+ var n = pr(J, !R && fa);
+ var t = pr(K, ca);
+ var i = x ? pr(F(w), sa) : Sr;
+ if (ar) {
+ G(N, Z);
+ y(rr, (function() {
+ G(Z, N);
+ X(Z);
+ }));
+ }
+ Y(er, nr);
+ Y(Z, $);
+ Y($ || Z, !R && J);
+ Y(J, K);
+ y(rr, (function() {
+ i();
+ r();
+ D(J, ea);
+ D(J, ta);
+ if (U(K)) {
+ Dn(K);
+ }
+ if (U(J)) {
+ Dn(J);
+ }
+ if (U($)) {
+ Dn($);
+ }
+ a();
+ n();
+ t();
+ }));
+ if (e && !R) {
+ y(rr, hr.bind(0, J, sa));
+ }
+ if (Q) {
+ W(J, Q);
+ y(rr, X.bind(0, Q));
+ }
+ if (V) {
+ var v = L(J, Tn);
+ L(J, Tn, "-1");
+ J.focus();
+ var o = Ur(C, "pointerdown keydown", (function() {
+ v ? L(J, Tn, v) : D(J, Tn);
+ o();
+ }));
+ }
+ nr = 0;
+ };
+ return [ k, tr, O.bind(0, rr) ];
+ };
+ var In = function createTrinsicUpdateSegment(r, a) {
+ var n = r.ar;
+ var e = a[0];
+ return function(r) {
+ var a = wn(), t = a.F;
+ var i = e(), v = i.gr;
+ var o = r.hr;
+ var u = (n || !t) && o;
+ if (u) {
+ style(n, {
+ height: v ? "" : "100%"
+ });
+ }
+ return {
+ pr: u,
+ _r: u
+ };
+ };
+ };
+ var Vn = function createPaddingUpdateSegment(r, n) {
+ var e = n[0], t = n[1];
+ var i = r.J, v = r.rr, o = r.K, u = r.cr;
+ var f = a({
+ u: mr,
+ o: Lr()
+ }, Lr.bind(0, i, "padding", "")), l = f[0], c = f[1];
+ return function(r, a, n) {
+ var i = c(n), f = i[0], s = i[1];
+ var d = wn(), g = d.T, h = d.F;
+ var p = e(), b = p.br;
+ var w = r.pr, m = r._r, y = r.wr;
+ var S = a("paddingAbsolute"), C = S[0], O = S[1];
+ var x = !h && m;
+ if (w || s || x) {
+ var E = l(n);
+ f = E[0];
+ s = E[1];
+ }
+ var P = !u && (O || y || s);
+ if (P) {
+ var z = !C || !v && !g;
+ var L = f.r + f.l;
+ var T = f.t + f.b;
+ var H = {
+ marginRight: z && !b ? -L : 0,
+ marginBottom: z ? -T : 0,
+ marginLeft: z && b ? -L : 0,
+ top: z ? -f.t : 0,
+ right: z ? b ? -f.r : "auto" : 0,
+ left: z ? b ? "auto" : -f.l : 0,
+ width: z ? "calc(100% + " + L + "px)" : ""
+ };
+ var D = {
+ paddingTop: z ? f.t : 0,
+ paddingRight: z ? f.r : 0,
+ paddingBottom: z ? f.b : 0,
+ paddingLeft: z ? f.l : 0
+ };
+ style(v || o, H);
+ style(o, D);
+ t({
+ rr: f,
+ mr: !z,
+ R: v ? D : A({}, H, D)
+ });
+ }
+ return {
+ yr: P
+ };
+ };
+ };
+ var kn = Math.max;
+ var jn = kn.bind(0, 0);
+ var Bn = "visible";
+ var Fn = "hidden";
+ var qn = 42;
+ var Un = {
+ u: br,
+ o: {
+ w: 0,
+ h: 0
+ }
+ };
+ var Nn = {
+ u: wr,
+ o: {
+ x: Fn,
+ y: Fn
+ }
+ };
+ var Yn = function getOverflowAmount(r, a) {
+ var n = window.devicePixelRatio % 1 !== 0 ? 1 : 0;
+ var e = {
+ w: jn(r.w - a.w),
+ h: jn(r.h - a.h)
+ };
+ return {
+ w: e.w > n ? e.w : 0,
+ h: e.h > n ? e.h : 0
+ };
+ };
+ var Wn = function conditionalClass(r, a, n) {
+ return n ? pr(r, a) : hr(r, a);
+ };
+ var Gn = function overflowIsVisible(r) {
+ return 0 === r.indexOf(Bn);
+ };
+ var Xn = function createOverflowUpdateSegment(r, n) {
+ var e = n[0], t = n[1];
+ var i = r.J, v = r.rr, o = r.K, u = r.nr, f = r.cr, l = r.dr, c = r.Z, s = r.ir;
+ var d = wn(), g = d.j, h = d.F, p = d.T, b = d.H;
+ var w = Ia()[cn];
+ var m = !f && !p && (b.x || b.y);
+ var y = c && f;
+ var S = a(Un, Vr.bind(0, o)), C = S[0], O = S[1];
+ var x = a(Un, Ir.bind(0, o)), E = x[0], A = x[1];
+ var P = a(Un), z = P[0], H = P[1];
+ var D = a(Un), M = D[0], R = D[1];
+ var I = a(Nn), V = I[0];
+ var k = function fixFlexboxGlue(r, a) {
+ style(o, {
+ height: ""
+ });
+ if (a) {
+ var n = e(), t = n.mr, v = n.rr;
+ var u = r.Sr, f = r.I;
+ var l = Vr(i);
+ var c = Rr(i);
+ var s = "content-box" === style(o, "boxSizing");
+ var d = t || s ? v.b + v.t : 0;
+ var g = !(b.x && s);
+ style(o, {
+ height: c.h + l.h + (u.x && g ? f.x : 0) - d
+ });
+ }
+ };
+ var j = function getViewportOverflowState(r, a) {
+ var n = !p && !r ? qn : 0;
+ var e = function getStatePerAxis(r, e, t) {
+ var i = style(o, r);
+ var v = a ? a[r] : i;
+ var u = "scroll" === v;
+ var f = e ? n : t;
+ var l = u && !p ? f : 0;
+ var c = e && !!n;
+ return [ i, u, l, c ];
+ };
+ var t = e("overflowX", b.x, g.x), i = t[0], v = t[1], u = t[2], f = t[3];
+ var l = e("overflowY", b.y, g.y), c = l[0], s = l[1], d = l[2], h = l[3];
+ return {
+ Cr: {
+ x: i,
+ y: c
+ },
+ Sr: {
+ x: v,
+ y: s
+ },
+ I: {
+ x: u,
+ y: d
+ },
+ V: {
+ x: f,
+ y: h
+ }
+ };
+ };
+ var B = function setViewportOverflowState(r, a, n, e) {
+ var t = function setAxisOverflowStyle(r, a) {
+ var n = Gn(r);
+ var e = a && n && r.replace(Bn + "-", "") || "";
+ return [ a && !n ? r : "", Gn(e) ? "hidden" : e ];
+ };
+ var i = t(n.x, a.x), v = i[0], o = i[1];
+ var u = t(n.y, a.y), f = u[0], l = u[1];
+ e.overflowX = o && f ? o : v;
+ e.overflowY = l && v ? l : f;
+ return j(r, e);
+ };
+ var F = function hideNativeScrollbars(r, a, n, t) {
+ var i = r.I, v = r.V;
+ var o = v.x, u = v.y;
+ var f = i.x, l = i.y;
+ var c = e(), s = c.R;
+ var d = a ? "marginLeft" : "marginRight";
+ var g = a ? "paddingLeft" : "paddingRight";
+ var h = s[d];
+ var p = s.marginBottom;
+ var b = s[g];
+ var w = s.paddingBottom;
+ t.width = "calc(100% + " + (l + -1 * h) + "px)";
+ t[d] = -l + h;
+ t.marginBottom = -f + p;
+ if (n) {
+ t[g] = b + (u ? l : 0);
+ t.paddingBottom = w + (o ? f : 0);
+ }
+ };
+ var q = w ? w.M(m, h, o, u, e, j, F) : [ function() {
+ return m;
+ }, function() {
+ return [ Sr ];
+ } ], U = q[0], N = q[1];
+ return function(r, a, n) {
+ var u = r.pr, c = r.Or, d = r._r, g = r.yr, w = r.hr, m = r.wr;
+ var S = e(), x = S.gr, P = S.br;
+ var D = a("showNativeOverlaidScrollbars"), I = D[0], q = D[1];
+ var Y = a("overflow"), W = Y[0], G = Y[1];
+ var X = I && b.x && b.y;
+ var Z = !f && !h && (u || d || c || q || w);
+ var $ = Gn(W.x);
+ var J = Gn(W.y);
+ var K = $ || J;
+ var Q = O(n);
+ var rr = A(n);
+ var ar = H(n);
+ var nr = R(n);
+ var er;
+ if (q && p) {
+ l(sa, va, !X);
+ }
+ if (Z) {
+ er = j(X);
+ k(er, x);
+ }
+ if (u || g || d || m || q) {
+ if (K) {
+ l(da, ia, false);
+ }
+ var tr = N(X, P, er), ir = tr[0], vr = tr[1];
+ var or = Q = C(n), ur = or[0], fr = or[1];
+ var lr = rr = E(n), cr = lr[0], sr = lr[1];
+ var dr = Rr(o);
+ var gr = cr;
+ var hr = dr;
+ ir();
+ if ((sr || fr || q) && vr && !X && U(vr, cr, ur, P)) {
+ hr = Rr(o);
+ gr = Ir(o);
+ }
+ var pr = {
+ w: jn(kn(cr.w, gr.w) + ur.w),
+ h: jn(kn(cr.h, gr.h) + ur.h)
+ };
+ var _r = {
+ w: jn(y ? s.innerWidth : hr.w + jn(dr.w - cr.w) + ur.w),
+ h: jn(y ? s.innerHeight : hr.h + jn(dr.h - cr.h) + ur.h)
+ };
+ nr = M(_r);
+ ar = z(Yn(pr, _r), n);
+ }
+ var br = nr, wr = br[0], mr = br[1];
+ var yr = ar, Sr = yr[0], Cr = yr[1];
+ var Or = rr, xr = Or[0], Er = Or[1];
+ var Ar = Q, Pr = Ar[0], zr = Ar[1];
+ var Lr = {
+ x: Sr.w > 0,
+ y: Sr.h > 0
+ };
+ var Tr = $ && J && (Lr.x || Lr.y) || $ && Lr.x && !Lr.y || J && Lr.y && !Lr.x;
+ if (g || m || zr || Er || mr || Cr || G || q || Z) {
+ var Hr = {
+ marginRight: 0,
+ marginBottom: 0,
+ marginLeft: 0,
+ width: "",
+ overflowY: "",
+ overflowX: ""
+ };
+ var Dr = B(X, Lr, W, Hr);
+ var Mr = U(Dr, xr, Pr, P);
+ if (!f) {
+ F(Dr, P, Mr, Hr);
+ }
+ if (Z) {
+ k(Dr, x);
+ }
+ if (f) {
+ L(i, ea, Hr.overflowX);
+ L(i, ta, Hr.overflowY);
+ } else {
+ style(o, Hr);
+ }
+ }
+ T(i, na, ia, Tr);
+ Wn(v, da, Tr);
+ !f && Wn(o, da, K);
+ var Vr = V(j(X).Cr), kr = Vr[0], jr = Vr[1];
+ t({
+ Cr: kr,
+ Er: {
+ x: wr.w,
+ y: wr.h
+ },
+ Ar: {
+ x: Sr.w,
+ y: Sr.h
+ },
+ Pr: Lr
+ });
+ return {
+ zr: jr,
+ Lr: mr,
+ Tr: Cr
+ };
+ };
+ };
+ var Zn = function prepareUpdateHints(r, a, n) {
+ var e = {};
+ var t = a || {};
+ var i = E(r).concat(E(t));
+ each(i, (function(a) {
+ var i = r[a];
+ var v = t[a];
+ e[a] = !!(n || i || v);
+ }));
+ return e;
+ };
+ var $n = function createStructureSetupUpdate(r, a) {
+ var n = r.$, e = r.K, t = r.dr, i = r.cr;
+ var v = wn(), o = v.T, u = v.H, f = v.F;
+ var l = !o && (u.x || u.y);
+ var c = [ In(r, a), Vn(r, a), Xn(r, a) ];
+ return function(r, a, v) {
+ var o = Zn(A({
+ pr: false,
+ yr: false,
+ wr: false,
+ hr: false,
+ Lr: false,
+ Tr: false,
+ zr: false,
+ Or: false,
+ _r: false
+ }, a), {}, v);
+ var u = l || !f;
+ var s = u && M(e);
+ var d = u && R(e);
+ t("", oa, true);
+ var g = o;
+ each(c, (function(a) {
+ g = Zn(g, a(g, r, !!v) || {}, v);
+ }));
+ M(e, s);
+ R(e, d);
+ t("", oa);
+ if (!i) {
+ M(n, 0);
+ R(n, 0);
+ }
+ return g;
+ };
+ };
+ var Jn = 3333333;
+ var Kn = function domRectHasDimensions(r) {
+ return r && (r.height || r.width);
+ };
+ var Qn = function createSizeObserver(r, n, e) {
+ var t = e || {}, i = t.Hr, v = void 0 === i ? false : i, o = t.Dr, u = void 0 === o ? false : o;
+ var f = Ia()[an];
+ var l = wn(), s = l.B;
+ var h = $('');
+ var p = h[0];
+ var b = p.firstChild;
+ var w = zr.bind(0, r);
+ var m = a({
+ o: void 0,
+ g: true,
+ u: function _equal(r, a) {
+ return !(!r || !Kn(r) && Kn(a));
+ }
+ }), S = m[0];
+ var C = function onSizeChangedCallbackProxy(r) {
+ var a = d(r) && r.length > 0 && g(r[0]);
+ var e = !a && c(r[0]);
+ var t = false;
+ var i = false;
+ var o = true;
+ if (a) {
+ var u = S(r.pop().contentRect), f = u[0], l = u[2];
+ var h = Kn(f);
+ var b = Kn(l);
+ t = !l || !h;
+ i = !b && h;
+ o = !t;
+ } else if (e) {
+ o = r[1];
+ } else {
+ i = true === r;
+ }
+ if (v && o) {
+ var w = e ? r[0] : zr(p);
+ M(p, w ? s.n ? -Jn : s.i ? 0 : Jn : Jn);
+ R(p, Jn);
+ }
+ if (!t) {
+ n({
+ pr: !e,
+ Mr: e ? r : void 0,
+ Dr: !!i
+ });
+ }
+ };
+ var x = [];
+ var E = u ? C : false;
+ return [ function() {
+ O(x);
+ X(p);
+ }, function() {
+ if (or) {
+ var n = new or(C);
+ n.observe(b);
+ y(x, (function() {
+ n.disconnect();
+ }));
+ } else if (f) {
+ var e = f.P(b, C, u), t = e[0], i = e[1];
+ E = t;
+ y(x, i);
+ }
+ if (v) {
+ var o = a({
+ o: !w()
+ }, w), l = o[0];
+ y(x, Ur(p, "scroll", (function(r) {
+ var a = l();
+ var n = a[0], e = a[1];
+ if (e) {
+ hr(b, "ltr rtl");
+ if (n) {
+ pr(b, "rtl");
+ } else {
+ pr(b, "ltr");
+ }
+ C(a);
+ }
+ Nr(r);
+ })));
+ }
+ if (E) {
+ pr(p, ha);
+ y(x, Ur(p, "animationstart", E, {
+ A: !!or
+ }));
+ }
+ Y(r, p);
+ } ];
+ };
+ var re = function isHeightIntrinsic(r) {
+ return 0 === r.h || r.isIntersecting || r.intersectionRatio > 0;
+ };
+ var ae = function createTrinsicObserver(r, n) {
+ var e;
+ var t = Z(ma);
+ var i = [];
+ var v = a({
+ o: false
+ }), o = v[0];
+ var u = function triggerOnTrinsicChangedCallback(r, a) {
+ if (r) {
+ var e = o(re(r));
+ var t = e[1];
+ if (t) {
+ !a && n(e);
+ return [ e ];
+ }
+ }
+ };
+ var f = function intersectionObserverCallback(r, a) {
+ if (r && r.length > 0) {
+ return u(r.pop(), a);
+ }
+ };
+ return [ function() {
+ O(i);
+ X(t);
+ }, function() {
+ if (vr) {
+ e = new vr((function(r) {
+ return f(r);
+ }), {
+ root: r
+ });
+ e.observe(t);
+ y(i, (function() {
+ e.disconnect();
+ }));
+ } else {
+ var a = function onSizeChanged() {
+ var r = Mr(t);
+ u(r);
+ };
+ var n = Qn(t, a), v = n[0], o = n[1];
+ y(i, v);
+ o();
+ a();
+ }
+ Y(r, t);
+ }, function() {
+ if (e) {
+ return f(e.takeRecords(), true);
+ }
+ } ];
+ };
+ var ne = function createEventContentChange(r, a, n) {
+ var e;
+ var t = false;
+ var i = function destroy() {
+ t = true;
+ };
+ var v = function updateElements(i) {
+ if (n) {
+ var v = n.reduce((function(a, n) {
+ if (n) {
+ var e = n[0];
+ var t = n[1];
+ var v = t && e && (i ? i(e) : V(e, r));
+ if (v && v.length && t && l(t)) {
+ y(a, [ v, t.trim() ], true);
+ }
+ }
+ return a;
+ }), []);
+ each(v, (function(r) {
+ return each(r[0], (function(n) {
+ var i = r[1];
+ var v = e.get(n);
+ if (v) {
+ var o = v[0];
+ var u = v[1];
+ if (o === i) {
+ u();
+ }
+ }
+ var f = Ur(n, i, (function(r) {
+ if (t) {
+ f();
+ e.delete(n);
+ } else {
+ a(r);
+ }
+ }));
+ e.set(n, [ i, f ]);
+ }));
+ }));
+ }
+ };
+ if (n) {
+ e = new WeakMap;
+ v();
+ }
+ return [ i, v ];
+ };
+ var ee = function createDOMObserver(r, a, n, e) {
+ var t = false;
+ var i = e || {}, v = i.Rr, o = i.Ir, u = i.Vr, f = i.kr, c = i.jr, s = i.Br;
+ var d = Cr((function() {
+ if (t) {
+ n(true);
+ }
+ }), {
+ p: 33,
+ _: 99
+ });
+ var g = ne(r, d, u), h = g[0], p = g[1];
+ var b = v || [];
+ var w = o || [];
+ var S = b.concat(w);
+ var O = function observerCallback(t, i) {
+ var v = c || Sr;
+ var o = s || Sr;
+ var u = [];
+ var d = [];
+ var g = false;
+ var h = false;
+ var b = false;
+ each(t, (function(n) {
+ var t = n.attributeName, i = n.target, c = n.type, s = n.oldValue, p = n.addedNodes;
+ var S = "attributes" === c;
+ var C = "childList" === c;
+ var O = r === i;
+ var x = S && l(t) ? L(i, t) : 0;
+ var E = 0 !== x && s !== x;
+ var A = m(w, t) > -1 && E;
+ if (a && !O) {
+ var P = !S;
+ var z = S && A;
+ var T = z && f && j(i, f);
+ var H = T ? !v(i, t, s, x) : P || z;
+ var D = H && !o(n, !!T, r, e);
+ y(d, p);
+ h = h || D;
+ b = b || C;
+ }
+ if (!a && O && E && !v(i, t, s, x)) {
+ y(u, t);
+ g = g || A;
+ }
+ }));
+ if (b && !C(d)) {
+ p((function(r) {
+ return d.reduce((function(a, n) {
+ y(a, V(r, n));
+ return j(n, r) ? y(a, n) : a;
+ }), []);
+ }));
+ }
+ if (a) {
+ !i && h && n(false);
+ return [ false ];
+ }
+ if (!C(u) || g) {
+ !i && n(u, g);
+ return [ u, g ];
+ }
+ };
+ var x = new ir((function(r) {
+ return O(r);
+ }));
+ x.observe(r, {
+ attributes: true,
+ attributeOldValue: true,
+ attributeFilter: S,
+ subtree: a,
+ childList: a,
+ characterData: a
+ });
+ t = true;
+ return [ function() {
+ if (t) {
+ h();
+ x.disconnect();
+ t = false;
+ }
+ }, function() {
+ if (t) {
+ d.S();
+ var r = x.takeRecords();
+ return !C(r) && O(r, true);
+ }
+ } ];
+ };
+ var te = "[" + na + "]";
+ var ie = "." + fa;
+ var ve = [ "tabindex" ];
+ var oe = [ "wrap", "cols", "rows" ];
+ var ue = [ "id", "class", "style", "open" ];
+ var fe = function createStructureSetupObservers(r, n, e) {
+ var t;
+ var i;
+ var v;
+ var o = n[1];
+ var u = r.J, c = r.K, g = r.ar, h = r.ur, p = r.cr, b = r.sr, w = r.dr;
+ var S = wn(), C = S.F;
+ var O = a({
+ u: br,
+ o: {
+ w: 0,
+ h: 0
+ }
+ }, (function() {
+ var r = b(da, ia);
+ var a = b(la, "");
+ var n = a && M(c);
+ var e = a && R(c);
+ w(da, ia);
+ w(la, "");
+ w("", oa, true);
+ var t = Ir(g);
+ var i = Ir(c);
+ var v = Vr(c);
+ w(da, ia, r);
+ w(la, "", a);
+ w("", oa);
+ M(c, n);
+ R(c, e);
+ return {
+ w: i.w + t.w + v.w,
+ h: i.h + t.h + v.h
+ };
+ })), x = O[0];
+ var P = h ? oe : ue.concat(oe);
+ var z = Cr(e, {
+ p: function _timeout() {
+ return t;
+ },
+ _: function _maxDelay() {
+ return i;
+ },
+ m: function _mergeParams(r, a) {
+ var n = r[0];
+ var e = a[0];
+ return [ E(n).concat(E(e)).reduce((function(r, a) {
+ r[a] = n[a] || e[a];
+ return r;
+ }), {}) ];
+ }
+ });
+ var T = function updateViewportAttrsFromHost(r) {
+ each(r || ve, (function(r) {
+ if (m(ve, r) > -1) {
+ var a = L(u, r);
+ if (l(a)) {
+ L(c, r, a);
+ } else {
+ D(c, r);
+ }
+ }
+ }));
+ };
+ var H = function onTrinsicChanged(r, a) {
+ var n = r[0], t = r[1];
+ var i = {
+ hr: t
+ };
+ o({
+ gr: n
+ });
+ !a && e(i);
+ return i;
+ };
+ var I = function onSizeChanged(r) {
+ var a = r.pr, n = r.Mr, t = r.Dr;
+ var i = !a || t ? e : z;
+ var v = false;
+ if (n) {
+ var u = n[0], f = n[1];
+ v = f;
+ o({
+ br: u
+ });
+ }
+ i({
+ pr: a,
+ wr: v
+ });
+ };
+ var V = function onContentMutation(r, a) {
+ var n = x(), t = n[1];
+ var i = {
+ _r: t
+ };
+ var v = r ? e : z;
+ if (t) {
+ !a && v(i);
+ }
+ return i;
+ };
+ var k = function onHostMutation(r, a, n) {
+ var e = {
+ Or: a
+ };
+ if (a) {
+ !n && z(e);
+ } else if (!p) {
+ T(r);
+ }
+ return e;
+ };
+ var j = g || !C ? ae(u, H) : [ Sr, Sr, Sr ], B = j[0], F = j[1], N = j[2];
+ var Y = !p ? Qn(u, I, {
+ Dr: true,
+ Hr: true
+ }) : [ Sr, Sr ], W = Y[0], G = Y[1];
+ var X = ee(u, false, k, {
+ Ir: ue,
+ Rr: ue.concat(ve)
+ }), Z = X[0], $ = X[1];
+ var J = p && or && new or(I.bind(0, {
+ pr: true
+ }));
+ J && J.observe(u);
+ T();
+ return [ function() {
+ B();
+ W();
+ v && v[0]();
+ J && J.disconnect();
+ Z();
+ }, function() {
+ G();
+ F();
+ }, function() {
+ var r = {};
+ var a = $();
+ var n = N();
+ var e = v && v[1]();
+ if (a) {
+ A(r, k.apply(0, y(a, true)));
+ }
+ if (n) {
+ A(r, H.apply(0, y(n, true)));
+ }
+ if (e) {
+ A(r, V.apply(0, y(e, true)));
+ }
+ return r;
+ }, function(r) {
+ var a = r("updating.ignoreMutation"), n = a[0];
+ var e = r("updating.attributes"), o = e[0], u = e[1];
+ var l = r("updating.elementEvents"), h = l[0], b = l[1];
+ var w = r("updating.debounce"), m = w[0], y = w[1];
+ var S = b || u;
+ var C = function ignoreMutationFromOptions(r) {
+ return s(n) && n(r);
+ };
+ if (S) {
+ if (v) {
+ v[1]();
+ v[0]();
+ }
+ v = ee(g || c, true, V, {
+ Ir: P.concat(o || []),
+ Rr: P.concat(o || []),
+ Vr: h,
+ kr: te,
+ Br: function _ignoreContentChange(r, a) {
+ var n = r.target, e = r.attributeName;
+ var t = !a && e && !p ? U(n, te, ie) : false;
+ return t || !!q(n, "." + ya) || !!C(r);
+ }
+ });
+ }
+ if (y) {
+ z.S();
+ if (d(m)) {
+ var O = m[0];
+ var x = m[1];
+ t = f(O) ? O : false;
+ i = f(x) ? x : false;
+ } else if (f(m)) {
+ t = m;
+ i = false;
+ } else {
+ t = false;
+ i = false;
+ }
+ }
+ } ];
+ };
+ var le = {
+ x: 0,
+ y: 0
+ };
+ var ce = {
+ rr: {
+ t: 0,
+ r: 0,
+ b: 0,
+ l: 0
+ },
+ mr: false,
+ R: {
+ marginRight: 0,
+ marginBottom: 0,
+ marginLeft: 0,
+ paddingTop: 0,
+ paddingRight: 0,
+ paddingBottom: 0,
+ paddingLeft: 0
+ },
+ Er: le,
+ Ar: le,
+ Cr: {
+ x: "hidden",
+ y: "hidden"
+ },
+ Pr: {
+ x: false,
+ y: false
+ },
+ gr: false,
+ br: false
+ };
+ var se = function createStructureSetup(r, a) {
+ var n = zn(a, {});
+ var e = Ln(ce);
+ var t = Zr(), i = t[0], v = t[1], o = t[2];
+ var u = e[0];
+ var f = Rn(r), l = f[0], c = f[1], s = f[2];
+ var d = $n(l, e);
+ var g = function triggerUpdateEvent(r, a, n) {
+ var e = E(r).some((function(a) {
+ return r[a];
+ }));
+ if (e || !P(a) || n) {
+ o("u", [ r, a, n ]);
+ }
+ };
+ var h = fe(l, e, (function(r) {
+ g(d(n, r), {}, false);
+ })), p = h[0], b = h[1], w = h[2], m = h[3];
+ var y = u.bind(0);
+ y.Fr = function(r) {
+ i("u", r);
+ };
+ y.qr = function() {
+ var r = l.$, a = l.K;
+ var n = M(r);
+ var e = R(r);
+ b();
+ c();
+ M(a, n);
+ R(a, e);
+ };
+ y.Ur = l;
+ return [ function(r, n) {
+ var e = zn(a, r, n);
+ m(e);
+ g(d(e, w(), n), r, !!n);
+ }, y, function() {
+ v();
+ p();
+ s();
+ } ];
+ };
+ var de = Math.round;
+ var ge = function getClientOffset(r) {
+ return {
+ x: r.clientX,
+ y: r.clientY
+ };
+ };
+ var he = function getScale(r) {
+ var a = kr(r), n = a.width, e = a.height;
+ var t = Mr(r), i = t.w, v = t.h;
+ return {
+ x: de(n) / i || 1,
+ y: de(e) / v || 1
+ };
+ };
+ var pe = function continuePointerDown(r, a, n) {
+ var e = a.scrollbars;
+ var t = r.button, i = r.isPrimary, v = r.pointerType;
+ var o = e.pointers;
+ return 0 === t && i && e[n] && (o || []).includes(v);
+ };
+ var _e = function createRootClickStopPropagationEvents(r, a) {
+ return Ur(r, "mousedown", Ur.bind(0, a, "click", Nr, {
+ A: true,
+ O: true
+ }), {
+ O: true
+ });
+ };
+ var be = function createDragScrollingEvents(r, a, n, e, t, i) {
+ var v = wn(), o = v.B;
+ var u = n.Nr, f = n.Yr, l = n.Wr;
+ var c = "scroll" + (i ? "Left" : "Top");
+ var s = i ? "x" : "y";
+ var d = i ? "w" : "h";
+ var g = function createOnPointerMoveHandler(r, a, n) {
+ return function(v) {
+ var g = t(), h = g.Ar;
+ var p = (ge(v)[s] - a) * n;
+ var b = Mr(f)[d] - Mr(u)[d];
+ var w = p / b;
+ var m = w * h[s];
+ var y = zr(l);
+ var S = y && i ? o.n || o.i ? 1 : -1 : 1;
+ e[c] = r + m * S;
+ };
+ };
+ return Ur(u, "pointerdown", (function(n) {
+ if (pe(n, r, "dragScroll")) {
+ var t = Ur(a, "selectstart", (function(r) {
+ return Yr(r);
+ }), {
+ C: false
+ });
+ var i = Ur(u, "pointermove", g(e[c] || 0, ge(n)[s], 1 / he(e)[s]));
+ Ur(u, "pointerup", (function(r) {
+ t();
+ i();
+ u.releasePointerCapture(r.pointerId);
+ }), {
+ A: true
+ });
+ u.setPointerCapture(n.pointerId);
+ }
+ }));
+ };
+ var we = function createScrollbarsSetupEvents(r, a) {
+ return function(n, e, t, i, v) {
+ var o = n.Wr;
+ return O.bind(0, [ Ur(o, "pointerenter", (function() {
+ e(La, true);
+ })), Ur(o, "pointerleave pointercancel", (function() {
+ e(La);
+ })), _e(o, t), be(r, t, n, i, a, v) ]);
+ };
+ };
+ var me = Math.min, ye = Math.max, Se = Math.abs, Ce = Math.round;
+ var Oe = function getScrollbarHandleLengthRatio(r, a, n, e) {
+ if (e) {
+ var t = n ? "x" : "y";
+ var i = e.Ar, v = e.Er;
+ var o = v[t];
+ var u = i[t];
+ return ye(0, me(1, o / (o + u)));
+ }
+ var f = n ? "w" : "h";
+ var l = Mr(r)[f];
+ var c = Mr(a)[f];
+ return ye(0, me(1, l / c));
+ };
+ var xe = function getScrollbarHandleOffsetRatio(r, a, n, e, t, i) {
+ var v = wn(), o = v.B;
+ var u = i ? "x" : "y";
+ var f = i ? "Left" : "Top";
+ var l = e.Ar;
+ var c = Ce(l[u]);
+ var s = Se(n["scroll" + f]);
+ var d = i && t;
+ var g = o.i ? s : c - s;
+ var h = d ? g : s;
+ var p = me(1, h / c);
+ var b = Oe(r, a, i);
+ return 1 / b * (1 - b) * p;
+ };
+ var Ee = function createScrollbarsSetupElements(r, a, n) {
+ var e = wn(), t = e.U;
+ var i = t(), v = i.scrollbarsSlot;
+ var o = a.vr, u = a.$, f = a.J, l = a.K, s = a.lr, d = a.er;
+ var g = s ? {} : r, h = g.scrollbarsSlot;
+ var p = Sn([ u, f, l ], (function() {
+ return f;
+ }), v, h);
+ var b = function scrollbarStructureAddRemoveClass(r, a, n) {
+ var e = n ? pr : hr;
+ each(r, (function(r) {
+ e(r.Wr, a);
+ }));
+ };
+ var w = function scrollbarsHandleStyle(r, a) {
+ each(r, (function(r) {
+ var n = a(r), e = n[0], t = n[1];
+ style(e, t);
+ }));
+ };
+ var m = function scrollbarStructureRefreshHandleLength(r, a, n) {
+ w(r, (function(r) {
+ var e;
+ var t = r.Nr, i = r.Yr;
+ return [ t, (e = {}, e[n ? "width" : "height"] = (100 * Oe(t, i, n, a)).toFixed(3) + "%",
+ e) ];
+ }));
+ };
+ var S = function scrollbarStructureRefreshHandleOffset(r, a, n) {
+ var e = n ? "X" : "Y";
+ w(r, (function(r) {
+ var t = r.Nr, i = r.Yr, v = r.Wr;
+ var o = xe(t, i, d, a, zr(v), n);
+ var u = o === o;
+ return [ t, {
+ transform: u ? "translate" + e + "(" + (100 * o).toFixed(3) + "%)" : ""
+ } ];
+ }));
+ };
+ var x = [];
+ var E = [];
+ var A = [];
+ var P = function scrollbarsAddRemoveClass(r, a, n) {
+ var e = c(n);
+ var t = e ? n : true;
+ var i = e ? !n : true;
+ t && b(E, r, a);
+ i && b(A, r, a);
+ };
+ var z = function refreshScrollbarsHandleLength(r) {
+ m(E, r, true);
+ m(A, r);
+ };
+ var L = function refreshScrollbarsHandleOffset(r) {
+ S(E, r, true);
+ S(A, r);
+ };
+ var T = function generateScrollbarDOM(r) {
+ var a = r ? Ca : Oa;
+ var e = r ? E : A;
+ var t = C(e) ? za : "";
+ var i = Z(ya + " " + a + " " + t);
+ var v = Z(xa);
+ var u = Z(Ea);
+ var f = {
+ Wr: i,
+ Yr: v,
+ Nr: u
+ };
+ Y(i, v);
+ Y(v, u);
+ y(e, f);
+ y(x, [ X.bind(0, i), n(f, P, o, d, r) ]);
+ return f;
+ };
+ var H = T.bind(0, true);
+ var D = T.bind(0, false);
+ var M = function appendElements() {
+ Y(p, E[0].Wr);
+ Y(p, A[0].Wr);
+ lr((function() {
+ P(za);
+ }), 300);
+ };
+ H();
+ D();
+ return [ {
+ Gr: z,
+ Xr: L,
+ Zr: P,
+ $r: {
+ Jr: E,
+ Kr: H,
+ Qr: w.bind(0, E)
+ },
+ ra: {
+ Jr: A,
+ Kr: D,
+ Qr: w.bind(0, A)
+ }
+ }, M, O.bind(0, x) ];
+ };
+ var Ae = function createSelfCancelTimeout(r) {
+ var a;
+ var n = r ? lr : fr;
+ var e = r ? cr : ur;
+ return [ function(t) {
+ e(a);
+ a = n(t, s(r) ? r() : r);
+ }, function() {
+ return e(a);
+ } ];
+ };
+ var Pe = function createScrollbarsSetup(r, a, n) {
+ var e;
+ var t;
+ var i;
+ var v;
+ var o;
+ var u = 0;
+ var f = Ln({});
+ var l = f[0];
+ var c = Ae(), s = c[0], d = c[1];
+ var g = Ae(), h = g[0], p = g[1];
+ var b = Ae(100), w = b[0], m = b[1];
+ var y = Ae(100), S = y[0], C = y[1];
+ var x = Ae((function() {
+ return u;
+ })), E = x[0], A = x[1];
+ var P = Ee(r, n.Ur, we(a, n)), z = P[0], L = P[1], T = P[2];
+ var H = n.Ur, D = H.J, I = H.K, V = H.er, 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;
+ var X = U.Qr;
+ var Z = function styleScrollbarPosition(r) {
+ var a = r.Wr;
+ var n = j && !B && F(a) === I && a;
+ return [ n, {
+ transform: n ? "translate(" + M(V) + "px, " + R(V) + "px)" : ""
+ } ];
+ };
+ var $ = function manageScrollbarsAutoHide(r, a) {
+ A();
+ if (r) {
+ N(Ha);
+ } else {
+ var n = function hide() {
+ return N(Ha, true);
+ };
+ if (u > 0 && !a) {
+ E(n);
+ } else {
+ n();
+ }
+ }
+ };
+ var J = function onHostMouseEnter() {
+ v = t;
+ v && $(true);
+ };
+ var K = [ m, A, C, p, d, T, Ur(D, "pointerover", J, {
+ A: true
+ }), Ur(D, "pointerenter", J), Ur(D, "pointerleave", (function() {
+ v = false;
+ t && $(false);
+ })), Ur(D, "pointermove", (function() {
+ e && s((function() {
+ m();
+ $(true);
+ S((function() {
+ e && $(false);
+ }));
+ }));
+ })), Ur(k, "scroll", (function() {
+ h((function() {
+ W(n());
+ i && $(true);
+ w((function() {
+ i && !v && $(false);
+ }));
+ }));
+ j && G(Z);
+ j && X(Z);
+ })) ];
+ var Q = l.bind(0);
+ Q.Ur = z;
+ Q.qr = L;
+ return [ function(r, v, f) {
+ var l = f.Lr, c = f.Tr, s = f.zr, d = f.wr;
+ var g = zn(a, r, v);
+ var h = n();
+ var p = h.Ar, b = h.Cr, w = h.br;
+ var m = g("scrollbars.theme"), y = m[0], S = m[1];
+ var C = g("scrollbars.visibility"), O = C[0], x = C[1];
+ var E = g("scrollbars.autoHide"), A = E[0], P = E[1];
+ var z = g("scrollbars.autoHideDelay"), L = z[0];
+ var T = g("scrollbars.dragScroll"), H = T[0], D = T[1];
+ var M = g("scrollbars.clickScroll"), R = M[0], I = M[1];
+ var V = l || c || d || v;
+ var k = s || x || v;
+ var j = function setScrollbarVisibility(r, a) {
+ var n = "visible" === O || "auto" === O && "scroll" === r;
+ N(Aa, n, a);
+ return n;
+ };
+ u = L;
+ if (S) {
+ N(o);
+ N(y, true);
+ o = y;
+ }
+ if (P) {
+ e = "move" === A;
+ t = "leave" === A;
+ i = "never" !== A;
+ $(!i, true);
+ }
+ if (D) {
+ N(Ma, H);
+ }
+ if (I) {
+ N(Da, R);
+ }
+ if (k) {
+ var F = j(b.x, true);
+ var q = j(b.y, false);
+ var U = F && q;
+ N(Pa, !U);
+ }
+ if (V) {
+ Y(h);
+ W(h);
+ N(Ta, !p.x, true);
+ N(Ta, !p.y, false);
+ N(Sa, w && !B);
+ }
+ }, Q, O.bind(0, K) ];
+ };
+ var ze = function OverlayScrollbars(r, a, n) {
+ var e = wn(), t = e.Y, i = e.q;
+ var v = Ia();
+ var o = b(r);
+ var u = o ? r : r.target;
+ var f = An(u);
+ if (a && !f) {
+ var l = false;
+ var c = v[Ja];
+ var d = function validateOptions(r) {
+ var a = r || {};
+ var n = c && c.P;
+ return n ? n(a, true) : a;
+ };
+ var g = A({}, t(), d(a));
+ var h = Zr(n), p = h[0], w = h[1], m = h[2];
+ var y = se(r, g), S = y[0], C = y[1], O = y[2];
+ var x = Pe(r, g, C), z = x[0], L = x[1], T = x[2];
+ var H = function update(r, a) {
+ S(r, !!a);
+ };
+ var D = i(H.bind(0, {}, true));
+ var M = function destroy(r) {
+ En(u);
+ D();
+ T();
+ O();
+ l = true;
+ m("destroyed", [ R, !!r ]);
+ w();
+ };
+ var R = {
+ options: function options(r) {
+ if (r) {
+ var a = Kr(g, d(r));
+ if (!P(a)) {
+ A(g, a);
+ H(a);
+ }
+ }
+ return A({}, g);
+ },
+ on: p,
+ off: function off(r, a) {
+ r && a && w(r, a);
+ },
+ state: function state() {
+ var r = C(), a = r.Er, n = r.Ar, e = r.Cr, t = r.Pr, i = r.rr, v = r.mr, o = r.br;
+ return A({}, {
+ overflowEdge: a,
+ overflowAmount: n,
+ overflowStyle: e,
+ hasOverflow: t,
+ padding: i,
+ paddingAbsolute: v,
+ directionRTL: o,
+ destroyed: l
+ });
+ },
+ elements: function elements() {
+ var r = C.Ur, a = r.$, n = r.J, e = r.rr, t = r.K, i = r.ar, v = r.er, o = r.tr;
+ var u = L.Ur, f = u.$r, l = u.ra;
+ var c = function translateScrollbarStructure(r) {
+ var a = r.Nr, n = r.Yr, e = r.Wr;
+ return {
+ scrollbar: e,
+ track: n,
+ handle: a
+ };
+ };
+ var s = function translateScrollbarsSetupElement(r) {
+ var a = r.Jr, n = r.Kr;
+ var e = c(a[0]);
+ return A({}, e, {
+ clone: function clone() {
+ var r = c(n());
+ z({}, true, {});
+ return r;
+ }
+ });
+ };
+ return A({}, {
+ target: a,
+ host: n,
+ padding: e || t,
+ viewport: t,
+ content: i || t,
+ scrollOffsetElement: v,
+ scrollEventElement: o,
+ scrollbarHorizontal: s(f),
+ scrollbarVertical: s(l)
+ });
+ },
+ update: function update(r) {
+ H({}, r);
+ return R;
+ },
+ destroy: M.bind(0)
+ };
+ C.Fr((function(r, a, n) {
+ z(a, n, r);
+ }));
+ each(E(v), (function(r) {
+ var a = v[r];
+ if (s(a)) {
+ a(OverlayScrollbars, R);
+ }
+ }));
+ if (Cn(!o && r.cancel, C.Ur)) {
+ M(true);
+ return R;
+ }
+ C.qr();
+ L.qr();
+ xn(u, R);
+ m("initialized", [ R ]);
+ C.Fr((function(r, a, n) {
+ var e = r.pr, t = r.wr, i = r.hr, v = r.Lr, o = r.Tr, u = r.zr, f = r._r, l = r.Or;
+ m("updated", [ R, {
+ updateHints: {
+ sizeChanged: e,
+ directionChanged: t,
+ heightIntrinsicChanged: i,
+ overflowEdgeChanged: v,
+ overflowAmountChanged: o,
+ overflowStyleChanged: u,
+ contentMutation: f,
+ hostMutation: l
+ },
+ changedOptions: a,
+ force: n
+ } ]);
+ }));
+ return R.update(true);
+ }
+ return f;
+ };
+ ze.plugin = Va;
+ ze.valid = function(r) {
+ var a = r && r.elements;
+ var n = s(a) && a();
+ return p(n) && !!An(n.target);
+ };
+ ze.env = function() {
+ var r = wn(), a = r.j, n = r.H, e = 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: n,
+ scrollbarsHiding: e,
+ rtlScrollBehavior: t,
+ flexboxGlue: i,
+ cssCustomProperties: v,
+ staticDefaultInitialization: o,
+ staticDefaultOptions: u,
+ getDefaultInitialization: f,
+ setDefaultInitialization: l,
+ getDefaultOptions: c,
+ setDefaultOptions: s
+ });
+ };
+ r.OverlayScrollbars = ze;
+ r.scrollbarsHidingPlugin = sn;
+ r.sizeObserverPlugin = nn;
+ Object.defineProperty(r, "v", {
+ value: true
+ });
+ return r;
+}({});
+//# sourceMappingURL=overlayscrollbars.browser.es5.js.map
diff --git a/packages/overlayscrollbars/dist/browser/overlayscrollbars.browser.es5.js.map b/packages/overlayscrollbars/dist/browser/overlayscrollbars.browser.es5.js.map
new file mode 100644
index 0000000..db69653
--- /dev/null
+++ b/packages/overlayscrollbars/dist/browser/overlayscrollbars.browser.es5.js.map
@@ -0,0 +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\n/**\r\n * Hides the passed element (display: none).\r\n * @param elm The element which shall be hidden.\r\n */\r\nexport const hide = (elm: HTMLElement | false | null | undefined): void => {\r\n style(elm, { display: 'none' });\r\n};\r\n\r\n/**\r\n * Shows the passed element (display: block).\r\n * @param elm The element which shall be shown.\r\n */\r\nexport const show = (elm: HTMLElement | false | null | undefined): void => {\r\n style(elm, { display: 'block' });\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\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 updating: {\r\n elementEvents: Array<[elementSelector: string, eventNames: string]> | null;\r\n attributes: 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 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 // resize: 'none', // none || both || horizontal || vertical || n || b || h || v\r\n paddingAbsolute: false, // true || false\r\n showNativeOverlaidScrollbars: false, // true || false\r\n updating: {\r\n elementEvents: [['img', 'load']], // array of tuples || null\r\n debounce: [0, 33], // number || number array || null\r\n attributes: null, // string array || null\r\n ignoreMutation: null, // () => any || null\r\n },\r\n overflow: {\r\n x: 'scroll', // visible-hidden || visible-scroll || hidden || scroll || v-h || v-s || h || s\r\n y: 'scroll', // visible-hidden || visible-scroll || hidden || scroll || v-h || v-s || h || s\r\n },\r\n scrollbars: {\r\n theme: 'os-theme-dark',\r\n visibility: 'auto', // visible || hidden || auto || v || h || a\r\n autoHide: 'never', // never || scroll || leave || move || n || s || l || m\r\n autoHideDelay: 1300, // number\r\n dragScroll: true, // true || false\r\n clickScroll: false, // true || false\r\n pointers: ['mouse', 'touch', 'pen'], // null || array of supported pointers: https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType\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 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 updating: {\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