hlp 3.7.8 → 3.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_js/_build/script.js +104 -75
- package/hlp.esm.js +1 -1
- package/hlp.js +1 -1
- package/package.json +11 -11
package/_js/_build/script.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.default = void 0;
|
|
8
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
+
var _templateObject;
|
|
7
11
|
class hlp {
|
|
8
12
|
static x(input) {
|
|
9
13
|
if (typeof input === 'function') {
|
|
@@ -140,7 +144,9 @@ class hlp {
|
|
|
140
144
|
});
|
|
141
145
|
} else if (typeof input === 'object') {
|
|
142
146
|
Object.entries(input).forEach(_ref => {
|
|
143
|
-
let
|
|
147
|
+
let _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
148
|
+
input__key = _ref2[0],
|
|
149
|
+
input__value = _ref2[1];
|
|
144
150
|
fun(input__value, input__key);
|
|
145
151
|
});
|
|
146
152
|
}
|
|
@@ -164,8 +170,10 @@ class hlp {
|
|
|
164
170
|
}
|
|
165
171
|
if (typeof input === 'object') {
|
|
166
172
|
var ret = null;
|
|
167
|
-
Object.entries(input).forEach(
|
|
168
|
-
let
|
|
173
|
+
Object.entries(input).forEach(_ref3 => {
|
|
174
|
+
let _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
|
|
175
|
+
input__key = _ref4[0],
|
|
176
|
+
input__value = _ref4[1];
|
|
169
177
|
if (ret === null) {
|
|
170
178
|
ret = input__value;
|
|
171
179
|
}
|
|
@@ -184,8 +192,10 @@ class hlp {
|
|
|
184
192
|
}
|
|
185
193
|
if (typeof input === 'object') {
|
|
186
194
|
let ret = null;
|
|
187
|
-
Object.entries(input).forEach(
|
|
188
|
-
let
|
|
195
|
+
Object.entries(input).forEach(_ref5 => {
|
|
196
|
+
let _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
|
|
197
|
+
input__key = _ref6[0],
|
|
198
|
+
input__value = _ref6[1];
|
|
189
199
|
ret = input__value;
|
|
190
200
|
});
|
|
191
201
|
return ret;
|
|
@@ -230,7 +240,9 @@ class hlp {
|
|
|
230
240
|
return false;
|
|
231
241
|
}
|
|
232
242
|
if (min > max) {
|
|
233
|
-
|
|
243
|
+
var _ref7 = [max, min];
|
|
244
|
+
min = _ref7[0];
|
|
245
|
+
max = _ref7[1];
|
|
234
246
|
}
|
|
235
247
|
return ~~(Math.random() * (max - min + 1)) + min;
|
|
236
248
|
}
|
|
@@ -517,7 +529,9 @@ class hlp {
|
|
|
517
529
|
}
|
|
518
530
|
for (let i = passwordChars.length - 1; i > 0; i--) {
|
|
519
531
|
let j = Math.floor(Math.random() * (i + 1));
|
|
520
|
-
|
|
532
|
+
var _ref8 = [passwordChars[j], passwordChars[i]];
|
|
533
|
+
passwordChars[i] = _ref8[0];
|
|
534
|
+
passwordChars[j] = _ref8[1];
|
|
521
535
|
}
|
|
522
536
|
return passwordChars.join('');
|
|
523
537
|
}
|
|
@@ -635,8 +649,10 @@ class hlp {
|
|
|
635
649
|
if (hash.has(obj)) return hash.get(obj); // cyclic reference
|
|
636
650
|
const result = obj instanceof Date ? new Date(obj) : obj instanceof RegExp ? new RegExp(obj.source, obj.flags) : obj.constructor ? new obj.constructor() : Object.create(null);
|
|
637
651
|
hash.set(obj, result);
|
|
638
|
-
if (obj instanceof Map) Array.from(obj,
|
|
639
|
-
let
|
|
652
|
+
if (obj instanceof Map) Array.from(obj, _ref9 => {
|
|
653
|
+
let _ref0 = (0, _slicedToArray2.default)(_ref9, 2),
|
|
654
|
+
key = _ref0[0],
|
|
655
|
+
val = _ref0[1];
|
|
640
656
|
return result.set(key, hlp.deepCopy(val, hash));
|
|
641
657
|
});
|
|
642
658
|
return Object.assign(result, ...Object.keys(obj).map(key => ({
|
|
@@ -816,8 +832,10 @@ class hlp {
|
|
|
816
832
|
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
|
|
817
833
|
}
|
|
818
834
|
if (this.x(args.headers)) {
|
|
819
|
-
Object.entries(args.headers).forEach(
|
|
820
|
-
let
|
|
835
|
+
Object.entries(args.headers).forEach(_ref1 => {
|
|
836
|
+
let _ref10 = (0, _slicedToArray2.default)(_ref1, 2),
|
|
837
|
+
headers__key = _ref10[0],
|
|
838
|
+
headers__value = _ref10[1];
|
|
821
839
|
xhr.setRequestHeader(headers__key, headers__value);
|
|
822
840
|
});
|
|
823
841
|
}
|
|
@@ -1176,29 +1194,17 @@ class hlp {
|
|
|
1176
1194
|
}
|
|
1177
1195
|
static async cursorPosition() {
|
|
1178
1196
|
// https://stackoverflow.com/a/43326327/2068362
|
|
1179
|
-
document.head.insertAdjacentHTML('afterbegin',
|
|
1180
|
-
<style type="text/css">
|
|
1181
|
-
.find-pointer-quad {
|
|
1182
|
-
--hit: 0;
|
|
1183
|
-
position: fixed;
|
|
1184
|
-
z-index:2147483647;
|
|
1185
|
-
transform: translateZ(0);
|
|
1186
|
-
&:hover { --hit: 1; }
|
|
1187
|
-
}
|
|
1188
|
-
</style>
|
|
1189
|
-
`);
|
|
1197
|
+
document.head.insertAdjacentHTML('afterbegin', "\n <style type=\"text/css\">\n .find-pointer-quad {\n --hit: 0;\n position: fixed;\n\t z-index:2147483647;\n transform: translateZ(0);\n &:hover { --hit: 1; }\n }\n </style>\n ");
|
|
1190
1198
|
window.cursorPositionDelay = 50;
|
|
1191
1199
|
window.cursorPositionQuads = [];
|
|
1192
1200
|
let dim = 10;
|
|
1193
1201
|
let createQuad = (_, pos) => {
|
|
1194
1202
|
let a = document.createElement('a');
|
|
1195
1203
|
a.classList.add('find-pointer-quad');
|
|
1196
|
-
let
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
style.
|
|
1200
|
-
style.left = pos % 2 === 0 ? '0' : `${dim}%`;
|
|
1201
|
-
style.width = style.height = `${dim}%`;
|
|
1204
|
+
let style = a.style;
|
|
1205
|
+
style.top = pos < 2 ? '0' : "".concat(dim, "%");
|
|
1206
|
+
style.left = pos % 2 === 0 ? '0' : "".concat(dim, "%");
|
|
1207
|
+
style.width = style.height = "".concat(dim, "%");
|
|
1202
1208
|
document.body.appendChild(a);
|
|
1203
1209
|
return a;
|
|
1204
1210
|
};
|
|
@@ -1209,46 +1215,43 @@ class hlp {
|
|
|
1209
1215
|
let hit;
|
|
1210
1216
|
window.cursorPositionQuads.some(a => {
|
|
1211
1217
|
let style = getComputedStyle(a);
|
|
1212
|
-
let result = style.getPropertyValue(
|
|
1213
|
-
if (result ===
|
|
1218
|
+
let result = style.getPropertyValue("--hit");
|
|
1219
|
+
if (result === "1") return hit = {
|
|
1214
1220
|
style,
|
|
1215
1221
|
a
|
|
1216
1222
|
};
|
|
1217
1223
|
});
|
|
1218
1224
|
if (!hit) {
|
|
1219
|
-
let
|
|
1225
|
+
let _cursorPositionQuads = (0, _slicedToArray2.default)(window.cursorPositionQuads, 1),
|
|
1226
|
+
q1 = _cursorPositionQuads[0];
|
|
1220
1227
|
let reset = Math.abs(dim) > 10000;
|
|
1221
1228
|
let top = parseFloat(q1.style.top) - dim / 2;
|
|
1222
1229
|
let left = parseFloat(q1.style.left) - dim / 2;
|
|
1223
|
-
window.cursorPositionQuads.forEach((
|
|
1224
|
-
let
|
|
1225
|
-
style
|
|
1226
|
-
} = _ref6;
|
|
1230
|
+
window.cursorPositionQuads.forEach((_ref11, pos) => {
|
|
1231
|
+
let style = _ref11.style;
|
|
1227
1232
|
if (reset) {
|
|
1228
|
-
style.top = pos < 2 ? '0' :
|
|
1229
|
-
style.left = pos % 2 === 0 ? '0' :
|
|
1230
|
-
style.width = style.height =
|
|
1233
|
+
style.top = pos < 2 ? '0' : "".concat(dim, "%");
|
|
1234
|
+
style.left = pos % 2 === 0 ? '0' : "".concat(dim, "%");
|
|
1235
|
+
style.width = style.height = "".concat(dim, "%");
|
|
1231
1236
|
} else {
|
|
1232
|
-
style.top = pos < 2 ?
|
|
1233
|
-
style.left = pos % 2 === 0 ?
|
|
1234
|
-
style.width =
|
|
1235
|
-
style.height =
|
|
1237
|
+
style.top = pos < 2 ? "".concat(top, "%") : "".concat(top + dim, "%");
|
|
1238
|
+
style.left = pos % 2 === 0 ? "".concat(left, "%") : "".concat(left + dim, "%");
|
|
1239
|
+
style.width = "".concat(dim, "%");
|
|
1240
|
+
style.height = "".concat(dim, "%");
|
|
1236
1241
|
}
|
|
1237
1242
|
});
|
|
1238
1243
|
return new Promise(resolve => {
|
|
1239
1244
|
setTimeout(() => resolve(this.cursorPositionBisect(!reset ? 2 * dim : dim)), window.cursorPositionDelay);
|
|
1240
1245
|
});
|
|
1241
1246
|
}
|
|
1242
|
-
let
|
|
1243
|
-
style,
|
|
1244
|
-
a
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
height
|
|
1251
|
-
} = a.getBoundingClientRect();
|
|
1247
|
+
let _hit = hit,
|
|
1248
|
+
style = _hit.style,
|
|
1249
|
+
a = _hit.a;
|
|
1250
|
+
let _a$getBoundingClientR = a.getBoundingClientRect(),
|
|
1251
|
+
top = _a$getBoundingClientR.top,
|
|
1252
|
+
left = _a$getBoundingClientR.left,
|
|
1253
|
+
width = _a$getBoundingClientR.width,
|
|
1254
|
+
height = _a$getBoundingClientR.height;
|
|
1252
1255
|
if (width < 3) {
|
|
1253
1256
|
window.cursorPositionQuads.forEach(a => a.remove());
|
|
1254
1257
|
return {
|
|
@@ -1259,14 +1262,12 @@ class hlp {
|
|
|
1259
1262
|
let ox = a.style.left;
|
|
1260
1263
|
let oy = a.style.top;
|
|
1261
1264
|
let nextStep = dim / 2;
|
|
1262
|
-
window.cursorPositionQuads.forEach((
|
|
1263
|
-
let
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
style.
|
|
1267
|
-
style.
|
|
1268
|
-
style.width = `${nextStep}%`;
|
|
1269
|
-
style.height = `${nextStep}%`;
|
|
1265
|
+
window.cursorPositionQuads.forEach((_ref12, pos) => {
|
|
1266
|
+
let style = _ref12.style;
|
|
1267
|
+
style.top = pos < 2 ? oy : "".concat(nextStep + parseFloat(oy), "%");
|
|
1268
|
+
style.left = pos % 2 === 0 ? ox : "".concat(nextStep + parseFloat(ox), "%");
|
|
1269
|
+
style.width = "".concat(nextStep, "%");
|
|
1270
|
+
style.height = "".concat(nextStep, "%");
|
|
1270
1271
|
});
|
|
1271
1272
|
return new Promise(resolve => {
|
|
1272
1273
|
setTimeout(() => resolve(this.cursorPositionBisect(nextStep)), window.cursorPositionDelay);
|
|
@@ -1460,7 +1461,7 @@ class hlp {
|
|
|
1460
1461
|
// apply trick from https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
|
|
1461
1462
|
let fn = () => {
|
|
1462
1463
|
let vh = window.innerHeight * 0.01;
|
|
1463
|
-
document.documentElement.style.setProperty('--vh',
|
|
1464
|
+
document.documentElement.style.setProperty('--vh', "".concat(vh, "px"));
|
|
1464
1465
|
};
|
|
1465
1466
|
fn();
|
|
1466
1467
|
window.addEventListener('resize', () => {
|
|
@@ -2270,7 +2271,7 @@ class hlp {
|
|
|
2270
2271
|
return new RegExp(hlp.emojiRegexPattern(), (global === true ? 'g' : '') + 'u');
|
|
2271
2272
|
}
|
|
2272
2273
|
static emojiRegexPattern() {
|
|
2273
|
-
return String.raw
|
|
2274
|
+
return String.raw(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["p{RI}p{RI}|p{Extended_Pictographic}(p{EMod}|\uFE0F\u20E3?|[\uDB40\uDC20-\uDB40\uDC7E]+\uDB40\uDC7F)?(\u200D(p{RI}p{RI}|p{Extended_Pictographic}(p{EMod}|\uFE0F\u20E3?|[\uDB40\uDC20-\uDB40\uDC7E]+\uDB40\uDC7F)?))*"], ["\\p{RI}\\p{RI}|\\p{Extended_Pictographic}(\\p{EMod}|\\uFE0F\\u20E3?|[\\u{E0020}-\\u{E007E}]+\\u{E007F})?(\\u200D(\\p{RI}\\p{RI}|\\p{Extended_Pictographic}(\\p{EMod}|\\uFE0F\\u20E3?|[\\u{E0020}-\\u{E007E}]+\\u{E007F})?))*"])));
|
|
2274
2275
|
}
|
|
2275
2276
|
static emojiSplit(str) {
|
|
2276
2277
|
if (!(typeof str === 'string' || str instanceof String)) {
|
|
@@ -2366,7 +2367,7 @@ class hlp {
|
|
|
2366
2367
|
};
|
|
2367
2368
|
cache.get = index => {
|
|
2368
2369
|
if (index >= store.length) {
|
|
2369
|
-
throw RangeError(
|
|
2370
|
+
throw RangeError("Can't resolve reference ".concat(index + 1));
|
|
2370
2371
|
}
|
|
2371
2372
|
return store[index];
|
|
2372
2373
|
};
|
|
@@ -2397,30 +2398,42 @@ class hlp {
|
|
|
2397
2398
|
case 'R':
|
|
2398
2399
|
return expectReference(s);
|
|
2399
2400
|
default:
|
|
2400
|
-
throw SyntaxError(
|
|
2401
|
+
throw SyntaxError("Invalid or unsupported data type: ".concat(type));
|
|
2401
2402
|
}
|
|
2402
2403
|
};
|
|
2403
2404
|
const expectBool = s => {
|
|
2404
2405
|
const reBool = /^b:([01]);/;
|
|
2405
|
-
const
|
|
2406
|
+
const _ref13 = reBool.exec(s) || [],
|
|
2407
|
+
_ref14 = (0, _slicedToArray2.default)(_ref13, 2),
|
|
2408
|
+
match = _ref14[0],
|
|
2409
|
+
boolMatch = _ref14[1];
|
|
2406
2410
|
if (!boolMatch) throw SyntaxError('Invalid bool value, expected 0 or 1');
|
|
2407
2411
|
return [boolMatch === '1', match.length];
|
|
2408
2412
|
};
|
|
2409
2413
|
const expectInt = s => {
|
|
2410
2414
|
const reInt = /^i:([+-]?\d+);/;
|
|
2411
|
-
const
|
|
2415
|
+
const _ref15 = reInt.exec(s) || [],
|
|
2416
|
+
_ref16 = (0, _slicedToArray2.default)(_ref15, 2),
|
|
2417
|
+
match = _ref16[0],
|
|
2418
|
+
intMatch = _ref16[1];
|
|
2412
2419
|
if (!intMatch) throw SyntaxError('Expected an integer value');
|
|
2413
2420
|
return [parseInt(intMatch, 10), match.length];
|
|
2414
2421
|
};
|
|
2415
2422
|
const expectFloat = s => {
|
|
2416
2423
|
const reFloat = /^d:(NAN|-?INF|(?:\d+\.\d*|\d*\.\d+|\d+)(?:[eE][+-]\d+)?);/;
|
|
2417
|
-
const
|
|
2424
|
+
const _ref17 = reFloat.exec(s) || [],
|
|
2425
|
+
_ref18 = (0, _slicedToArray2.default)(_ref17, 2),
|
|
2426
|
+
match = _ref18[0],
|
|
2427
|
+
floatMatch = _ref18[1];
|
|
2418
2428
|
if (!floatMatch) throw SyntaxError('Expected a float value');
|
|
2419
2429
|
return [floatMatch === 'NAN' ? Number.NaN : floatMatch === '-INF' ? Number.NEGATIVE_INFINITY : floatMatch === 'INF' ? Number.POSITIVE_INFINITY : parseFloat(floatMatch), match.length];
|
|
2420
2430
|
};
|
|
2421
2431
|
const expectString = s => {
|
|
2422
2432
|
const reStrLength = /^s:(\d+):"/g;
|
|
2423
|
-
const
|
|
2433
|
+
const _ref19 = reStrLength.exec(s) || [],
|
|
2434
|
+
_ref20 = (0, _slicedToArray2.default)(_ref19, 2),
|
|
2435
|
+
match = _ref20[0],
|
|
2436
|
+
byteLenMatch = _ref20[1];
|
|
2424
2437
|
if (!match) throw SyntaxError('Expected a string value');
|
|
2425
2438
|
const len = parseInt(byteLenMatch, 10);
|
|
2426
2439
|
s = s.substr(match.length);
|
|
@@ -2431,7 +2444,10 @@ class hlp {
|
|
|
2431
2444
|
};
|
|
2432
2445
|
const expectEscapedString = s => {
|
|
2433
2446
|
const reStrLength = /^S:(\d+):"/g;
|
|
2434
|
-
const
|
|
2447
|
+
const _ref21 = reStrLength.exec(s) || [],
|
|
2448
|
+
_ref22 = (0, _slicedToArray2.default)(_ref21, 2),
|
|
2449
|
+
match = _ref22[0],
|
|
2450
|
+
strLenMatch = _ref22[1];
|
|
2435
2451
|
if (!match) throw SyntaxError('Expected an escaped string value');
|
|
2436
2452
|
const len = parseInt(strLenMatch, 10);
|
|
2437
2453
|
s = s.substr(match.length);
|
|
@@ -2442,13 +2458,19 @@ class hlp {
|
|
|
2442
2458
|
};
|
|
2443
2459
|
const expectReference = s => {
|
|
2444
2460
|
const reRef = /^[rR]:(\d+);/;
|
|
2445
|
-
const
|
|
2461
|
+
const _ref23 = reRef.exec(s) || [],
|
|
2462
|
+
_ref24 = (0, _slicedToArray2.default)(_ref23, 2),
|
|
2463
|
+
match = _ref24[0],
|
|
2464
|
+
refIndex = _ref24[1];
|
|
2446
2465
|
if (!match) throw SyntaxError('Expected reference value');
|
|
2447
2466
|
return [cache.get(parseInt(refIndex, 10) - 1), match.length];
|
|
2448
2467
|
};
|
|
2449
2468
|
const expectArray = s => {
|
|
2450
2469
|
const reArrayLength = /^a:(\d+):\{/;
|
|
2451
|
-
const
|
|
2470
|
+
const _ref25 = reArrayLength.exec(s) || [],
|
|
2471
|
+
_ref26 = (0, _slicedToArray2.default)(_ref25, 2),
|
|
2472
|
+
arrayLiteralBeginMatch = _ref26[0],
|
|
2473
|
+
arrayLengthMatch = _ref26[1];
|
|
2452
2474
|
if (!arrayLengthMatch) throw SyntaxError('Expected array length annotation');
|
|
2453
2475
|
s = s.substr(arrayLiteralBeginMatch.length);
|
|
2454
2476
|
const items = {};
|
|
@@ -2465,9 +2487,13 @@ class hlp {
|
|
|
2465
2487
|
};
|
|
2466
2488
|
const expectObject = s => {
|
|
2467
2489
|
const reObjectLiteral = /^O:(\d+):"([^\"]+)":(\d+):\{/;
|
|
2468
|
-
const
|
|
2490
|
+
const _ref27 = reObjectLiteral.exec(s) || [],
|
|
2491
|
+
_ref28 = (0, _slicedToArray2.default)(_ref27, 4),
|
|
2492
|
+
match = _ref28[0],
|
|
2493
|
+
className = _ref28[2],
|
|
2494
|
+
propCountMatch = _ref28[3];
|
|
2469
2495
|
if (!match) throw SyntaxError('Invalid input');
|
|
2470
|
-
if (className !== 'stdClass') throw SyntaxError(
|
|
2496
|
+
if (className !== 'stdClass') throw SyntaxError("Unsupported object type: ".concat(className));
|
|
2471
2497
|
let obj = {};
|
|
2472
2498
|
cache([obj]);
|
|
2473
2499
|
s = s.substr(match.length);
|
|
@@ -2604,7 +2630,7 @@ class hlp {
|
|
|
2604
2630
|
let file = null;
|
|
2605
2631
|
try {
|
|
2606
2632
|
file = new File([blob], filename);
|
|
2607
|
-
} catch {
|
|
2633
|
+
} catch (_unused) {
|
|
2608
2634
|
// ie 11
|
|
2609
2635
|
file = new Blob([blob], filename);
|
|
2610
2636
|
}
|
|
@@ -2820,7 +2846,10 @@ class hlp {
|
|
|
2820
2846
|
let path = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
|
|
2821
2847
|
let paths = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
2822
2848
|
if (object !== null && typeof object === 'object') {
|
|
2823
|
-
for (const
|
|
2849
|
+
for (const _ref29 of Object.entries(object)) {
|
|
2850
|
+
var _ref30 = (0, _slicedToArray2.default)(_ref29, 2);
|
|
2851
|
+
const object__key = _ref30[0];
|
|
2852
|
+
const object__value = _ref30[1];
|
|
2824
2853
|
if (object__value !== null && typeof object__value === 'object') {
|
|
2825
2854
|
this.findRecursiveInObject(object__value, key, value, (path === '' ? '' : path + '.') + object__key, paths);
|
|
2826
2855
|
} else if ((key === null || object__key === key) && (value === null || object__value === value)) {
|
package/hlp.esm.js
CHANGED
|
@@ -507,7 +507,7 @@ var hlp = class hlp {
|
|
|
507
507
|
i += words__value.length + 1;
|
|
508
508
|
});
|
|
509
509
|
string = words.join(" ");
|
|
510
|
-
while (string.indexOf(
|
|
510
|
+
while (string.indexOf("... ...") > -1) string = this.replaceAll(string, "... ...", dots);
|
|
511
511
|
string = string.trim();
|
|
512
512
|
}
|
|
513
513
|
let positions = this.findAllPositionsCaseInsensitive(query, string);
|
package/hlp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var hlp=function(){var t=class t{static x(t){if("function"==typeof t)try{return t=t(),this.x(t)}catch(t){return!1}return!(null===t||!1===t||"string"==typeof t&&""==t.trim()||"object"==typeof t&&0===Object.keys(t).length&&t.constructor===Object||void 0===t||Array.isArray(t)&&0===t.length||Array.isArray(t)&&1===t.length&&""===t[0])}static nx(t){return!this.x(t)}static true(e){if("function"==typeof e)try{return e=e(),this.true(e)}catch(t){return!1}return void 0!==e&&(null!==e&&(!1!==e&&((!Array.isArray(e)||0!==e.length)&&((!Array.isArray(e)||""!==t.first(e))&&(("object"!=typeof e||0!==Object.keys(e).length||e.constructor!==Object)&&(0!==e&&("0"!==e&&(""!==e&&(" "!==e&&("null"!==e&&"false"!==e))))))))))}static false(e){if("function"==typeof e)try{return e=e(),this.false(e)}catch(t){return!1}return void 0!==e&&(null!==e&&(!1===e||(!Array.isArray(e)||0!==e.length)&&((!Array.isArray(e)||""!==t.first(e))&&(("object"!=typeof e||0!==Object.keys(e).length||e.constructor!==Object)&&(0===e||("0"===e||""!==e&&(" "!==e&&("null"!==e&&"false"===e))))))))}static v(...t){if(this.nx(arguments))return"";for(let t=0;t<arguments.length;t++)if(this.x(arguments[t]))return arguments[t];return""}static loop(t,e){if(this.nx(t))return null;Array.isArray(t)?t.forEach((t,r)=>{e(t,r)}):"object"==typeof t&&Object.entries(t).forEach(([t,r])=>{e(r,t)})}static map(t,e,r=null){return Object.keys(t).reduce((n,i)=>(n[i]=e.call(r||null,i,t[i]),n),{})}static first(t){if(Array.isArray(t)){var e=null;return t.forEach((t,r)=>{null===e&&(e=t)}),e}if("object"==typeof t){e=null;return Object.entries(t).forEach(([t,r])=>{null===e&&(e=r)}),e}return null}static last(t){if(Array.isArray(t)){let e=null;return t.forEach((t,r)=>{e=t}),e}if("object"==typeof t){let e=null;return Object.entries(t).forEach(([t,r])=>{e=r}),e}return null}static rand(t){if(Array.isArray(t))return t[Math.floor(Math.random()*t.length)];if("object"==typeof t){var e=Object.values(t);return e[Math.floor(Math.random()*e.length)]}return null}static random_string(t=8,e=null){null===e&&(e="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");let r=e.length,n="";for(let i=0;i<t;i++)n+=e[0+~~(Math.random()*(r-1-0+1))];return n}static round(t=0,e=0){return Number(Math.round(t+"e"+e)+"e-"+e)}static isInteger(t){return!isNaN(t)&&parseInt(Number(t))==t&&!isNaN(parseInt(t,10))}static random_int(t=0,e=99999){return!(!this.isInteger(t)||!this.isInteger(e))&&(t>e&&([t,e]=[e,t]),~~(Math.random()*(e-t+1))+t)}static capitalize(t=null){return null===t||""===t?t:t.charAt(0).toUpperCase()+t.slice(1)}static cookieExists(t){return void 0!==document.cookie&&null!==this.cookieGet(t)}static cookieGet(t){var e=document.cookie.match(new RegExp(t+"=([^;]+)"));return e?decodeURIComponent(e[1]):null}static cookieSet(t,e,r,n=!0){let i="";window.location.protocol.indexOf("https")>-1&&(i="; SameSite=None; Secure"),document.cookie=t+"="+encodeURIComponent(e)+"; expires="+new Date((new Date).getTime()+24*r*60*60*1e3).toUTCString()+"; path=/"+i+"; domain="+(!0===n?this.urlHostTopLevel():"")}static cookieDelete(t,e=!0){let r="";window.location.protocol.indexOf("https")>-1&&(r="; SameSite=None; Secure"),document.cookie=t+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"+r+"; domain="+(!0===e?this.urlHostTopLevel():"")}static localStorageSet(t,e,r=0){r*=864e5;let n={value:e,expiry:(new Date).getTime()+r};localStorage.setItem(t,JSON.stringify(n))}static localStorageGet(t){let e=localStorage.getItem(t);if(!e)return null;let r=JSON.parse(e);return(new Date).getTime()>r.expiry?(localStorage.removeItem(t),null):r.value}static localStorageDelete(t){localStorage.removeItem(t)}static localStorageExists(t){return null!==this.localStorageGet(t)}static getParam(t){let e=window.location.search;if(this.nx(e))return null;let r=e.substring(1).split("&");for(var n=0;n<r.length;n++){var i=r[n].split("=");if(i[0]==t&&this.x(i[1]))return i[1]}return null}static getDevice(){return this.isPhone()?"phone":this.isTablet()?"tablet":"desktop"}static isPhone(){let t=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}static isTablet(){let t=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}static isDesktop(){return!this.isPhone()&&!this.isTablet()}static isMobile(){return!!(window.innerWidth<750||this.isPhone())}static isTouch(){return"ontouchstart"in window||navigator.maxTouchPoints||!1}static isPageSpeed(){const t=navigator.userAgent||"";let e=0;if(/Lighthouse|HeadlessChrome|Chrome-Lighthouse|Speed Insights|PTST|PageSpeed/i.test(t))return!0;if(navigator.webdriver)return!0;if(navigator.languages&&0!==navigator.languages.length||(e+=3),/moto g power|Moto G4/i.test(t)&&(e+=2),/Chrome\/\d{3}\.0\.0\.0/i.test(t)&&(e+=1),"undefined"!=typeof window){const t=window.innerWidth,r=window.innerHeight;(1350===t&&940===r||412===t&&(823===r||915===r)||360===t&&640===r)&&(e+=2)}return navigator.plugins&&0===navigator.plugins.length&&(e+=1),navigator.connection||navigator.deviceMemory||navigator.hardwareConcurrency||(e+=1),void 0===navigator.permissions&&(e+=1),/Chrome/i.test(t)&&void 0===window.chrome&&(e+=2),e>=4}static isMac(){return"mac"===t.getOs()}static isLinux(){return"linux"===t.getOs()}static isWindows(){return"windows"===t.getOs()}static getOs(){let t=window.navigator.userAgent,e=window.navigator.platform,r="unknown";return-1!==["Macintosh","MacIntel","MacPPC","Mac68K"].indexOf(e)||-1!==["iPhone","iPad","iPod"].indexOf(e)?r="mac":-1!==["Win32","Win64","Windows","WinCE"].indexOf(e)?r="windows":(/Android/.test(t)||/Linux/.test(e))&&(r="linux"),r}static getBrowser(){let t="",e=!document.documentMode&&!!window.StyleMedia;return t=-1!=navigator.userAgent.indexOf("Opera")||-1!=navigator.userAgent.indexOf("OPR")?"opera":-1==navigator.userAgent.indexOf("Chrome")||e?-1==navigator.userAgent.indexOf("Safari")||e?-1!=navigator.userAgent.indexOf("Firefox")?"firefox":-1!=navigator.userAgent.indexOf("MSIE")||1==!!document.documentMode?"ie":e?"edge":"unknown":"safari":"chrome",t}static isObject(t=null){return!!t&&t.constructor===Object}static isArray(t=null){return!!t&&t.constructor===Array}static isString(t){return"string"==typeof t||t instanceof String}static isDate(t){if(this.nx(t))return!1;if("[object Date]"===Object.prototype.toString.call(t))return!0;if(!this.isString(t))return!1;if(3!==t.split("-").length)return!1;let e=parseInt(t.split("-")[2]),r=parseInt(t.split("-")[1]),n=parseInt(t.split("-")[0]),i=new Date;return i.setFullYear(n,r-1,e),i.getFullYear()==n&&i.getMonth()+1==r&&i.getDate()==e}static password_generate(t=20,e=["a-z","A-Z","0-9","$!?"],r="lI"){if(null===e||!e.length||t<e.length)return null;let n=[];for(let t of e){let e=[];if(e="a-z"===t?Array.from({length:26},(t,e)=>String.fromCharCode(97+e)):"A-Z"===t?Array.from({length:26},(t,e)=>String.fromCharCode(65+e)):"0-9"===t?Array.from({length:10},(t,e)=>String.fromCharCode(48+e)):t.split(""),r&&(e=e.filter(t=>!r.includes(t))),0===e.length)return null;n.push(e)}let i=n.map(t=>t[Math.floor(Math.random()*t.length)]),o=n.flat();for(;i.length<t;){let t=Math.floor(Math.random()*o.length);i.push(o[t])}for(let t=i.length-1;t>0;t--){let e=Math.floor(Math.random()*(t+1));[i[t],i[e]]=[i[e],i[t]]}return i.join("")}static formatNumber(t,e=0,r=".",n=","){t=(t+"").replace(/[^0-9+\-Ee.]/g,"");var i=isFinite(+t)?+t:0,o=isFinite(+e)?Math.abs(e):0,a=void 0===n?",":n,s=void 0===r?".":r;let l=(o?function(t,e){var r=Math.pow(10,e);return""+Math.round(t*r)/r}(i,o):""+Math.round(i)).split(".");return l[0].length>3&&(l[0]=l[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,a)),(l[1]||"").length<o&&(l[1]=l[1]||"",l[1]+=new Array(o-l[1].length+1).join("0")),l.join(s)}static formatDate(t,e=null){!1===e||!0===e||null===e||""===e?e=new Date:"object"!=typeof e&&(e=new Date(e.replace(/-/g,"/").replace(/T|Z/g," ")));let r="",n=e.getMonth(),i=n+1,o=e.getDay(),a=e.getDate(),s=e.getFullYear(),l=e.getHours(),c=e.getMinutes(),u=e.getSeconds();for(let d=0,h=t.length;d<h;d++)switch(t[d]){case"j":r+=a;break;case"d":r+=a<10?"0"+a:a;break;case"l":let h=Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");r+=h[o];break;case"w":r+=o;break;case"D":h=Array("Sun","Mon","Tue","Wed","Thr","Fri","Sat"),r+=h[o];break;case"m":r+=i<10?"0"+i:i;break;case"n":r+=i;break;case"F":let g=Array("January","February","March","April","May","June","July","August","September","October","November","December");r+=g[n];break;case"M":g=Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"),r+=g[n];break;case"Y":r+=s;break;case"y":r+=s.toString().slice(-2);break;case"H":r+=l<10?"0"+l:l;break;case"g":let m=0===l?12:l;r+=m>12?m-12:m;break;case"h":m=0===l?12:l,m=m>12?m-12:m,r+=m<10?"0"+m:m;break;case"a":r+=l<12?"am":"pm";break;case"i":r+=c<10?"0"+c:c;break;case"s":r+=u<10?"0"+u:u;break;case"c":r+=e.toISOString();break;default:r+=t[d]}return r}static deepCopy(e,r=new WeakMap){if(Object(e)!==e)return e;if(r.has(e))return r.get(e);const n=e instanceof Date?new Date(e):e instanceof RegExp?new RegExp(e.source,e.flags):e.constructor?new e.constructor:Object.create(null);return r.set(e,n),e instanceof Map&&Array.from(e,([e,i])=>n.set(e,t.deepCopy(i,r))),Object.assign(n,...Object.keys(e).map(n=>({[n]:t.deepCopy(e[n],r)})))}static jsonStringToObject(t){if(this.nx(t)||!this.isString(t))return null;try{return JSON.parse(t)}catch(t){return null}}static isJsonString(t){if(this.nx(t)||!this.isString(t))return!1;try{return JSON.parse(t),!0}catch(t){return!1}}static jsonObjectToString(t){try{return JSON.stringify(t)}catch(t){return null}}static uuid(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()}static guid(){return this.uuid()}static replaceAll(t,e,r){return t.split(e).join(r)}static replaceLast(t,e,r){let n=t.lastIndexOf(e);return t=t.slice(0,n)+t.slice(n).replace(e,r)}static replaceFirst(t,e,r){return t.replace(e,r)}static findAllPositions(t,e){let r,n=t.length,i=0,o=[];if(0==n)return[];for(;(r=e.indexOf(t,i))>-1;)o.push(r),i=r+n;return o}static findAllPositionsCaseInsensitive(t,e){let r,n=t.length,i=0,o=[];if(0==n)return[];for(;(r=this.indexOfCaseInsensitive(t,e,i))>-1;)o.push(r),i=r+n;return o}static countAllOccurences(t,e){let r=new RegExp(t,"g");return(e.match(r)||[]).length}static countAllOccurencesCaseInsensitive(t,e){let r=new RegExp(t,"gi");return(e.match(r)||[]).length}static indexOfCaseInsensitive(t,e,r=0){return e.toLowerCase().indexOf(t.toLowerCase(),r)}static highlight(t,e,r=!1,n=500){if(this.nx(t)||this.nx(e))return t;if(!0===r){let r="...",i=this.findAllPositionsCaseInsensitive(e,t),o=t.split(" "),a=0;for(o.forEach((t,s)=>{let l=!0;i.forEach(t=>{a>=t-n&&a<=t+e.length+n-1&&(l=!1)}),!0===l&&(o[s]=r),a+=t.length+1}),t=o.join(" ");t.indexOf(r+" ...")>-1;)t=this.replaceAll(t,r+" ...",r);t=t.trim()}let i=this.findAllPositionsCaseInsensitive(e,t);for(let r=0;r<i.length;r++){t=t.substring(0,i[r])+'<strong class="highlight">'+t.substring(i[r],i[r]+e.length)+"</strong>"+t.substring(i[r]+e.length);for(let t=r+1;t<i.length;t++)i[t]=i[t]+26+9}return t}static get(t,e=null){return this.call("GET",t,e)}static post(t,e=null){return this.call("POST",t,e)}static call(e,r,n=null){return null===n&&(n={}),"data"in n||(n.data={}),"headers"in n||(n.headers=null),"throttle"in n||(n.throttle=0),"allow_errors"in n||(n.allow_errors=!0),new Promise((i,o)=>{setTimeout(()=>{0!==r.indexOf("http")&&(r=t.baseUrl()+"/"+r);let a=new XMLHttpRequest;a.open(e,r,!0),"POST"===e&&(!("data"in n)||null===n.data||"object"!=typeof n.data||n.data instanceof FormData||(a.setRequestHeader("Content-Type","application/json;charset=UTF-8"),n.data=JSON.stringify(n.data)),a.setRequestHeader("X-Requested-With","XMLHttpRequest")),this.x(n.headers)&&Object.entries(n.headers).forEach(([t,e])=>{a.setRequestHeader(t,e)}),a.onload=()=>{(4!=a.readyState||!0!==n.allow_errors&&200!=a.status&&304!=a.status)&&(this.isJsonString(a.responseText)?o(this.jsonStringToObject(a.responseText)):o(a.responseText)),this.isJsonString(a.responseText)?i(this.jsonStringToObject(a.responseText)):i(a.responseText)},a.onerror=()=>{o([a.readyState,a.status,a.statusText])},"GET"===e&&a.send(null),"POST"===e&&a.send(n.data)},n.throttle)})}static onResizeHorizontal(t){let e,r,n=window.innerWidth;window.addEventListener("resize",()=>{e=window.innerWidth,e!=n&&(n=e,r&&clearTimeout(r),r=window.setTimeout(()=>{t()},50))}),t()}static onResizeVertical(t){var e,r,n=window.innerHeight;window.addEventListener("resize",()=>{(e=window.innerHeight)!=n&&(n=e,r&&clearTimeout(r),r=window.setTimeout(()=>{t()},50))}),t()}static removeEmpty(t){return this.nx(t)||!Array.isArray(t)?t:t=t.filter(t=>this.x(t))}static uniqueArray(t){let e={},r=[];for(let n=0;n<t.length;n++)t[n]in e||(r.push(t[n]),e[t[n]]=!0);return r}static powerset(t){return Array.isArray(t)?t.reduce((t,e)=>t.concat(t.map(t=>[...t,e])),[[]]):t}static charToInt(t){let e,r,n=0;for(e=0,r=(t=t.toUpperCase()).length-1;e<t.length;e+=1,r-=1)n+=Math.pow(26,r)*("ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(t[e])+1);return n}static intToChar(t){for(var e="",r=1,n=26;(t-=r)>=0;r=n,n*=26)e=String.fromCharCode(parseInt(t%n/r)+65)+e;return e}static slugify(t){return t.toString().toLowerCase().trim().split("ä").join("ae").split("ö").join("oe").split("ü").join("ue").split("ß").join("ss").replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}static incChar(t,e=1){return this.intToChar(this.charToInt(t)+e)}static decChar(t,e=1){return this.intToChar(this.charToInt(t)-e)}static range(t,e){let r=[],n=typeof t,i=typeof e,o=1;if("undefined"==n||"undefined"==i||n!=i)return null;if(e<t&&(o=-o),"number"==n)for(;o>0?e>=t:e<=t;)r.push(t),t+=o;else{if("string"!=n)return null;if(1!=t.length||1!=e.length)return null;for(t=t.charCodeAt(0),e=e.charCodeAt(0);o>0?e>=t:e<=t;)r.push(String.fromCharCode(t)),t+=o}return r}static dateToWeek(t=null){null===t&&(t=new Date),(t=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()))).setUTCDate(t.getUTCDate()+4-(t.getUTCDay()||7));let e=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t-e)/864e5+1)/7)}static weekToDate(t,e){null==e&&(e=(new Date).getFullYear());let r=new Date;r.setFullYear(e),r.setDate(1),r.setMonth(0),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0);let n=r.getDay();n=0===n?7:n;let i=1-n;7-n+1<4&&(i+=7),r=new Date(r.getTime()+24*i*60*60*1e3);let o=6048e5*(t-1),a=r.getTime()+o;return r.setTime(a),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0),r}static addDays(t,e){var r=new Date(t);return r.setDate(r.getDate()+e),r}static diffInMonths(t,e){let r=new Date(t),n=new Date(e);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())+(n.getDate()-r.getDate())/new Date(n.getFullYear(),n.getMonth()+1,0).getDate()}static objectsAreEqual(t,e){var r=this;if(null==t||null==e)return t===e;if(t.constructor!==e.constructor)return!1;if(t instanceof Function)return t===e;if(t instanceof RegExp)return t===e;if(t===e||t.valueOf()===e.valueOf())return!0;if(Array.isArray(t)&&t.length!==e.length)return!1;if(t instanceof Date)return!1;if(!(t instanceof Object))return!1;if(!(e instanceof Object))return!1;var n=Object.keys(t);return Object.keys(e).every(function(t){return-1!==n.indexOf(t)})&&n.every(function(n){return r.objectsAreEqual(t[n],e[n])})}static containsObject(t,e){var r;for(r in e)if(e.hasOwnProperty(r)&&this.objectsAreEqual(e[r],t))return!0;return!1}static fadeOut(t,e=1e3){return e<=25&&(e=25),new Promise(r=>{t.style.opacity=1,function n(){(t.style.opacity-=25/e)<0?(t.style.display="none",r()):requestAnimationFrame(n)}()})}static fadeIn(t,e=1e3){return e<=25&&(e=25),new Promise(r=>{t.style.opacity=0,t.style.display="block",function n(){var i=parseFloat(t.style.opacity);(i+=25/e)>1?r():(t.style.opacity=i,requestAnimationFrame(n))}()})}static scrollTop(){let t=document.documentElement;return(window.pageYOffset||t.scrollTop)-(t.clientTop||0)}static scrollLeft(){let t=document.documentElement;return(window.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}static closestScrollable(t){let e=t instanceof HTMLElement&&window.getComputedStyle(t).overflowY,r=e&&!(e.includes("hidden")||e.includes("visible"));return t?r&&t.scrollHeight>=t.clientHeight?t:this.closestScrollable(t.parentNode)||document.scrollingElement||document.body:null}static offsetTop(t){return t.getBoundingClientRect().top+window.pageYOffset-document.documentElement.clientTop}static offsetLeft(t){return t.getBoundingClientRect().left+window.pageXOffset-document.documentElement.clientLeft}static offsetRight(t){return t.getBoundingClientRect().left+window.pageXOffset-document.documentElement.clientLeft+t.offsetWidth}static offsetBottom(t){return t.getBoundingClientRect().top+window.pageYOffset-document.documentElement.clientTop+t.offsetHeight}static offsetTopWithMargin(t){return this.offsetTop(t)-parseInt(getComputedStyle(t).marginTop)}static offsetLeftWithMargin(t){return this.offsetLeft(t)-parseInt(getComputedStyle(t).marginLeft)}static offsetRightWithMargin(t){return this.offsetRight(t)+parseInt(getComputedStyle(t).marginRight)}static offsetBottomWithMargin(t){return this.offsetBottom(t)+parseInt(getComputedStyle(t).marginBottom)}static documentHeight(){return Math.max(document.body.offsetHeight,document.body.scrollHeight,document.documentElement.clientHeight,document.documentElement.offsetHeight,document.documentElement.scrollHeight)}static documentWidth(){return document.documentElement.clientWidth||document.body.clientWidth}static windowWidth(){return window.innerWidth}static windowHeight(){return window.innerHeight}static windowWidthWithoutScrollbar(){return document.documentElement.clientWidth||document.body.clientWidth}static windowHeightWithoutScrollbar(){return document.documentElement.clientHeight||document.body.clientHeight}static outerWidthWithMargin(t){return t.offsetWidth+parseInt(getComputedStyle(t).marginLeft)+parseInt(getComputedStyle(t).marginRight)}static outerHeightWithMargin(t){return t.offsetHeight+parseInt(getComputedStyle(t).marginTop)+parseInt(getComputedStyle(t).marginBottom)}static async cursorPosition(){document.head.insertAdjacentHTML("afterbegin",'\n <style type="text/css">\n .find-pointer-quad {\n --hit: 0;\n position: fixed;\n\t z-index:2147483647;\n transform: translateZ(0);\n &:hover { --hit: 1; }\n }\n </style>\n '),window.cursorPositionDelay=50,window.cursorPositionQuads=[];return window.cursorPositionQuads=[1,2,3,4].map((t,e)=>{let r=document.createElement("a");r.classList.add("find-pointer-quad");let{style:n}=r;return n.top=e<2?"0":"10%",n.left=e%2==0?"0":"10%",n.width=n.height="10%",document.body.appendChild(r),r}),this.cursorPositionBisect(10)}static cursorPositionBisect(t){let e;if(window.cursorPositionQuads.some(t=>{let r=getComputedStyle(t);if("1"===r.getPropertyValue("--hit"))return e={style:r,a:t}}),!e){let[e]=window.cursorPositionQuads,r=Math.abs(t)>1e4,n=parseFloat(e.style.top)-t/2,i=parseFloat(e.style.left)-t/2;return window.cursorPositionQuads.forEach(({style:e},o)=>{r?(e.top=o<2?"0":`${t}%`,e.left=o%2==0?"0":`${t}%`,e.width=e.height=`${t}%`):(e.top=o<2?`${n}%`:`${n+t}%`,e.left=o%2==0?`${i}%`:`${i+t}%`,e.width=`${t}%`,e.height=`${t}%`)}),new Promise(e=>{setTimeout(()=>e(this.cursorPositionBisect(r?t:2*t)),window.cursorPositionDelay)})}let{style:r,a:n}=e,{top:i,left:o,width:a,height:s}=n.getBoundingClientRect();if(a<3)return window.cursorPositionQuads.forEach(t=>t.remove()),{x:Math.round(o+a/2+window.scrollX),y:Math.round(i+s/2+window.scrollY)};let l=n.style.left,c=n.style.top,u=t/2;return window.cursorPositionQuads.forEach(({style:t},e)=>{t.top=e<2?c:`${u+parseFloat(c)}%`,t.left=e%2==0?l:`${u+parseFloat(l)}%`,t.width=`${u}%`,t.height=`${u}%`}),new Promise(t=>{setTimeout(()=>t(this.cursorPositionBisect(u)),window.cursorPositionDelay)})}static scrollTo(e,r=1e3,n=null,i=0,o=!1){return new Promise(a=>{null===n&&(n=document.scrollingElement||document.documentElement),t.isNumeric(e)||(e=n===(document.scrollingElement||document.documentElement)?this.offsetTopWithMargin(e):e.getBoundingClientRect().top-parseInt(getComputedStyle(e).marginTop)-(n.getBoundingClientRect().top-n.scrollTop-parseInt(getComputedStyle(n).marginTop)));let s=0,l=i;Array.isArray(l)||(l=[l]),l.forEach(e=>{t.isNumeric(e)?s+=e:null!==e&&"fixed"===window.getComputedStyle(e).position&&(s+=-1*e.offsetHeight)}),e+=s;const c=n.scrollTop,u=e-c,d=+new Date,h=function(){const t=+new Date-d;var i,o,s;n.scrollTop=parseInt((i=t,o=c,s=u,(i/=r/2)<1?-s/2*(Math.sqrt(1-i*i)-1)+o:(i-=2,s/2*(Math.sqrt(1-i*i)+1)+o))),t<r?requestAnimationFrame(h):(n.scrollTop=e,a())};!0===o&&u>0?a():h()})}static loadJs(e){t.isArray(e)||(e=[e]);let r=[];return t.loop(e,(t,e)=>{r.push(new Promise((e,r)=>{let n=document.createElement("script");n.src=t,n.onload=()=>{e()},document.head.appendChild(n)}))}),Promise.all(r)}static async loadJsSequentially(e){t.isArray(e)||(e=[e]);for(let r of e)await t.loadJs(r)}static triggerAfterAllImagesLoaded(t,e,r){window.addEventListener("load",n=>{null!==document.querySelector(t+" "+e)&&document.querySelectorAll(t+" "+e).forEach(n=>{this.triggerAfterAllImagesLoadedBindLoadEvent(n,t,e,r)})}),document.addEventListener("DOMContentLoaded",()=>{null!==document.querySelector(t)&&new MutationObserver(n=>{n.forEach(n=>{"childList"===n.type&&n.addedNodes.length>0?n.addedNodes.forEach(n=>{this.triggerAfterAllImagesLoadedHandleEl(n,t,e,r)}):"attributes"===n.type&&"src"===n.attributeName&&n.target.classList.contains(e.replace(".",""))&&n.oldValue!==n.target.getAttribute("src")&&this.triggerAfterAllImagesLoadedHandleEl(n.target,t,e,r)})}).observe(document.querySelector(t),{attributes:!0,childList:!0,characterData:!1,subtree:!0,attributeOldValue:!0,characterDataOldValue:!1})})}static triggerAfterAllImagesLoadedHandleEl(t,e,r,n){t.nodeType===Node.ELEMENT_NODE&&(t.classList.remove("loaded-img"),t.closest(e).classList.remove("loaded-all"),t.classList.contains("binded-trigger")||(t.classList.add("binded-trigger"),t.addEventListener("load",()=>{this.triggerAfterAllImagesLoadedBindLoadEvent(t,e,r,n)})))}static triggerAfterAllImagesLoadedBindLoadEvent(t,e,r,n){t.classList.add("loaded-img"),t.closest(e).querySelectorAll(".loaded-img").length===t.closest(e).querySelectorAll(r).length&&(t.closest(e).classList.add("loaded-all"),n())}static isVisible(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}static isVisibleInViewport(t){if(!this.isVisible(t))return!1;let e=t.getBoundingClientRect();return!(e.bottom<0||e.right<0||e.left>window.innerWidth||e.top>window.innerHeight)}static textareaAutoHeight(t="textarea"){this.textareaSetHeights(t),this.onResizeHorizontal(()=>{this.textareaSetHeights(t)}),[].forEach.call(document.querySelectorAll(t),t=>{t.addEventListener("keyup",t=>{this.textareaSetHeight(t.target)})})}static textareaSetHeights(t="textarea"){[].forEach.call(document.querySelectorAll(t),t=>{this.isVisible(t)&&this.textareaSetHeight(t)})}static textareaSetHeight(t){t.style.height="5px",t.style.height=t.scrollHeight+"px"}static real100vh(t=null,e=100){if(null===t){let t=()=>{let t=.01*window.innerHeight;document.documentElement.style.setProperty("--vh",`${t}px`)};t(),window.addEventListener("resize",()=>{t()})}else{let r=()=>{console.log(t),null!==document.querySelector(t)&&document.querySelectorAll(t).forEach(t=>{t.style.height=window.innerHeight*(e/100)+"px"})};r(),window.addEventListener("resize",()=>{r()})}}static iOsRemoveHover(){"safari"===t.getBrowser()&&"desktop"!==t.getDevice()&&t.on("touchend","a",(t,e)=>{e.click()})}static isNumeric(t){return!isNaN(parseFloat(t))&&isFinite(t)}static animate(e,r,n,i,o){return new Promise(a=>{o<=50&&(o=50);let s=[];r.split(";").forEach(t=>{s.push(t.split(":")[0].trim())});let l=[];s.forEach(t=>{l.push(t+" "+Math.round(o/1e3*10)/10+"s "+i)});let c="transition: "+l.join(", ")+" !important;",u=null;NodeList.prototype.isPrototypeOf(e)?u=Array.from(e):null===e?(console.log("cannot animate element from "+r+" to "+n+" because it does not exist"),a()):u=[e];let d=u.length;u.forEach((e,i)=>{let l=t.random_string(10,"abcdefghijklmnopqrstuvwxyz");e.classList.add(l),window.requestAnimationFrame(()=>{let i=[],u="",h=e.getAttribute("style");null!==h&&h.split(";").forEach(t=>{""==t||s.includes(t.split(":")[0].trim())||i.push(t)}),u=i.length>0?i.join(";")+";"+r+";":r+";",e.setAttribute("style",u),window.requestAnimationFrame(()=>{let i=document.createElement("style");i.innerHTML="."+l+" { "+c+" }",document.head.appendChild(i),window.requestAnimationFrame(()=>{if(e.setAttribute("style",e.getAttribute("style").replace(r+";","")+n+";"),this.isVisible(e)){let r=!1;t.addEventListenerOnce(e,"transitionend",t=>{if(r=!0,t.target!==t.currentTarget)return!1;document.head.contains(i)&&document.head.removeChild(i),e.classList.remove(l),d--,d<=0&&window.requestAnimationFrame(()=>{a()})}),setTimeout(()=>{!1===r&&(document.head.contains(i)&&document.head.removeChild(i),e.classList.remove(l),d--,d<=0&&a())},1.5*o)}else document.head.contains(i)&&document.head.removeChild(i),e.classList.remove(l),d--,d<=0&&a()})})})})})}static addEventListenerOnce(t,e,r,n=void 0,i=void 0){t.addEventListener(e,function o(a){!1!==r.apply(this,arguments,n)&&t.removeEventListener(e,o,i)})}static htmlDecode(t){let e=document.createElement("textarea");return e.innerHTML=t,e.value}static htmlEncode(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/`/g,"`")}static nl2br(t){return null==t?"":(t+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1<br/>")}static br2nl(t){return null==t?"":t.replace(/<\s*\/?br\s*[\/]?>/gi,"\n")}static closest(t,e){if(!document.documentElement.contains(t))return null;do{if(this.matches(t,e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null}static matches(t,e){let r=t,n=(r.parentNode||r.document).querySelectorAll(e),i=-1;for(;n[++i]&&n[i]!=r;);return!!n[i]}static wrap(t,e){if(null===t)return;let r=(new DOMParser).parseFromString(e,"text/html").body.childNodes[0];t.parentNode.insertBefore(r,t.nextSibling),r.appendChild(t)}static wrapTextNodes(t,e){null!==t&&Array.from(t.childNodes).filter(t=>3===t.nodeType&&t.textContent.trim().length>1).forEach(t=>{const r=document.createElement(e);t.after(r),r.appendChild(t)})}static html2dom(t){let e=document.createElement("template");return t=t.trim(),e.innerHTML=t,void 0===e.content?this.html2domLegacy(t):e.content.firstChild}static html2domLegacy(t){var e,r,n,i={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]},o=document,a=o.createDocumentFragment();if(/<|&#?\w+;/.test(t)){for(e=a.appendChild(o.createElement("div")),r=i[(/<([\w:]+)/.exec(t)||["",""])[1].toLowerCase()]||i._default,e.innerHTML=r[1]+t.replace(/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,"<$1></$2>")+r[2],n=r[0];n--;)e=e.lastChild;for(a.removeChild(a.firstChild);e.firstChild;)a.appendChild(e.firstChild)}else a.appendChild(o.createTextNode(t));return a.querySelector("*")}static prev(t,e){let r=t.previousElementSibling;return null===r?null:void 0===e||this.matches(r,e)?r:null}static next(t,e){let r=t.nextElementSibling;return null===r?null:void 0===e||this.matches(r,e)?r:null}static prevAll(t,e){let r=[];for(;t=t.previousElementSibling;)(void 0===e||this.matches(t,e))&&r.push(t);return r}static nextAll(t,e){let r=[];for(;t=t.nextElementSibling;)(void 0===e||this.matches(t,e))&&r.push(t);return r}static prevUntil(t,e){let r=[];for(;(t=t.previousElementSibling)&&!this.matches(t,e);)r.push(t);return r}static nextUntil(t,e){let r=[];for(;(t=t.nextElementSibling)&&!this.matches(t,e);)r.push(t);return r}static siblings(t,e){let r=[],n=t;for(t=t.parentNode.firstChild;t=t.nextElementSibling;)(void 0===e||this.matches(t,e))&&n!==t&&r.push(t);return r}static parents(t,e){let r=[],n=void 0!==e;for(;null!==(t=t.parentElement);)t.nodeType===Node.ELEMENT_NODE&&(n&&!this.matches(t,e)||r.push(t));return r}static css(t){let e=document.styleSheets,r={};for(let n in e)try{let i=e[n].rules||e[n].cssRules;for(let e in i)this.matches(t,i[e].selectorText)&&(r=Object.assign(r,this.css2json(i[e].style),this.css2json(t.getAttribute("style"))))}catch(t){}return r}static css2json(t){let e={};if(!t)return e;if(t instanceof CSSStyleDeclaration)for(let r in t)t[r].toLowerCase&&void 0!==t[t[r]]&&(e[t[r].toLowerCase()]=t[t[r]]);else if("string"==typeof t){t=t.split(";");for(let r in t)if(t[r].indexOf(":")>-1){let n=t[r].split(":");e[n[0].toLowerCase().trim()]=n[1].trim()}}return e}static compareDates(t,e){return"string"==typeof t&&(t=t.split(" ").join("T")),"string"==typeof e&&(e=e.split(" ").join("T")),t=new Date(t),e=new Date(e),t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()?0:t<e?-1:1}static spaceship(t,e){return null===t||null===e||typeof t!=typeof e?null:"string"==typeof t?t.localeCompare(e):t>e?1:t<e?-1:0}static querySelectorAllShadowDom(t){let e=function(t){let r=[];return null!==t.querySelector("*")&&t.querySelectorAll("*").forEach(t=>{r.push(t),void 0!==t.shadowRoot&&null!==t.shadowRoot&&(r=r.concat(e(t.shadowRoot)))}),r},r=document.createDocumentFragment();return e(document).forEach(e=>{e.matches(t)&&r.appendChild(e.cloneNode())}),r.childNodes}static focus(e){t.unfocus();let r=null;if(r="string"==typeof e||e instanceof String?document.querySelector(e):e,null!==r){let t=document.createElement("div");t.classList.add("hlp-focus-mask"),t.style.position="fixed",t.style.top="0",t.style.bottom="0",t.style.left="0",t.style.right="0",t.style.backgroundColor="rgba(0,0,0,0.8)",t.style.zIndex="2147483646",r.before(t),r.setAttribute("data-focussed","1"),r.setAttribute("data-focussed-orig-z-index",r.style.zIndex),r.setAttribute("data-focussed-orig-position",r.style.position),r.setAttribute("data-focussed-orig-background-color",r.style.backgroundColor),r.setAttribute("data-focussed-orig-box-shadow",r.style.boxShadow),r.style.zIndex="2147483647",r.style.position="relative",r.style.backgroundColor="#ffffff",r.style.boxShadow="0px 0px 0px 20px #fff"}}static unfocus(){null!==document.querySelector(".hlp-focus-mask")&&document.querySelectorAll(".hlp-focus-mask").forEach(e=>{t.remove(e)}),null!==document.querySelector("[data-focussed]")&&document.querySelectorAll("[data-focussed]").forEach(t=>{t.style.zIndex=t.getAttribute("data-focussed-orig-z-index"),t.style.position=t.getAttribute("data-focussed-orig-position"),t.style.backgroundColor=t.getAttribute("data-focussed-orig-background-color"),t.style.boxShadow=t.getAttribute("data-focussed-orig-box-shadow"),t.removeAttribute("data-focussed"),t.removeAttribute("data-focussed-orig-z-index"),t.removeAttribute("data-focussed-orig-position"),t.removeAttribute("data-focussed-orig-background-color"),t.removeAttribute("data-focussed-orig-box-shadow")})}static remove(t){null!==t&&t.parentNode.removeChild(t)}static on(e,r,n,i=null){null===i?(i=n,n=document):n=document.querySelector(n),n.addEventListener(e,e=>{var n=t.closest(e.target,r);n&&i(e,n)},!1)}static url(){return window.location.protocol+"//"+window.location.host+window.location.pathname}static urlWithHash(){return window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.hash}static fullUrl(){return window.location.href}static urlWithArgs(){return window.location.href.split("#")[0]}static baseUrl(){return window.location.protocol+"//"+window.location.host}static urlProtocol(){return window.location.protocol+"//"}static urlHost(){return window.location.host}static urlHostTopLevel(){let t=window.location.host;if(t.match(/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/))return t;for(t=t.split(".");t.length>2;)t.shift();return t=t.join("."),t}static urlPath(){return window.location.pathname}static urlHash(){return window.location.hash}static urlArgs(){return window.location.search}static urlOfScript(){if(document.currentScript)return document.currentScript.src;{let t=document.getElementsByTagName("script");return t[t.length-1].src}}static pathOfScript(){let t=this.urlOfScript();return t.substring(0,t.lastIndexOf("/"))}static waitUntil(t,e=null,r=null){return new Promise((n,i)=>{let o=setInterval(()=>{null!==document.querySelector(t)&&(null===e||null===r&&void 0!==window.getComputedStyle(document.querySelector(t))[e]&&""!=window.getComputedStyle(document.querySelector(t))[e]||null!==r&&window.getComputedStyle(document.querySelector(t))[e]===r)&&(window.clearInterval(o),n())},30)})}static waitUntilEach(t,e){new MutationObserver(()=>{let r=document.querySelectorAll(t);r.length>0&&r.forEach(t=>{t.__processed||(t.__processed=!0,e(t))})}).observe(document.body,{childList:!0,subtree:!0});let r=document.querySelectorAll(t);r.length>0&&r.forEach(t=>{t.__processed||(t.__processed=!0,e(t))})}static waitUntilVar(t=null,e=null,r=null){let n=null,i=null;return null===e?(n=t,i=window):(n=e,i=t),new Promise((t,e)=>{let o=setInterval(()=>{void 0!==i[n]&&null!==i[n]&&(null!==r&&i[n]!==r||(window.clearInterval(o),t()))},30)})}static ready(){return new Promise(t=>{if("loading"!==document.readyState)return t();document.addEventListener("DOMContentLoaded",()=>t())})}static load(){return new Promise(t=>{if("complete"===document.readyState)return t();window.addEventListener("load",()=>t())})}static runForEl(e,r){t.ready().then(()=>{let n=t.pushId();null!==document.querySelector(e)&&document.querySelectorAll(e).forEach(t=>{void 0===t.runForEl&&(t.runForEl=[]),t.runForEl.includes(n)||(t.runForEl.push(n),r(t))}),void 0===window.runForEl_queue&&(window.runForEl_queue=[]),void 0===window.runForEl_observer&&(window.runForEl_observer=new MutationObserver(t=>{t.forEach(t=>{if(t.addedNodes)for(let e=0;e<t.addedNodes.length;e++){let r=t.addedNodes[e];r.nodeType===Node.ELEMENT_NODE&&window.runForEl_queue.forEach(t=>{r.matches(t.selector)&&(void 0===r.runForEl&&(r.runForEl=[]),r.runForEl.includes(t.id)||(r.runForEl.push(t.id),t.callback(r))),null!==r.querySelector(t.selector)&&r.querySelectorAll(t.selector).forEach(e=>{void 0===e.runForEl&&(e.runForEl=[]),e.runForEl.includes(t.id)||(e.runForEl.push(t.id),t.callback(e))})})}})}).observe(document.body,{attributes:!1,childList:!0,characterData:!1,subtree:!0,attributeOldValue:!1,characterDataOldValue:!1})),window.runForEl_queue.push({id:n,selector:e,callback:r})})}static fmath(t,e,r,n=8){let i={"*":e*r,"-":e-r,"+":e+r,"/":e/r}[t];return Math.round(10*i*Math.pow(10,n))/(10*Math.pow(10,n))}static trim(t,e=null){let r=[" ","\n","\r","\t","\f","\v"," "," "," "," "," "," "," "," "," "," "," "," ","","\u2028","\u2029"," "].join(""),n=0,i=0;for(t+="",e&&(r=(e+"").replace(/([[\]().?/*{}+$^:])/g,"$1")),n=t.length,i=0;i<n;i++)if(-1===r.indexOf(t.charAt(i))){t=t.substring(i);break}for(n=t.length,i=n-1;i>=0;i--)if(-1===r.indexOf(t.charAt(i))){t=t.substring(0,i+1);break}return-1===r.indexOf(t.charAt(0))?t:""}static ltrim(t,e=null){e=e?(e+"").replace(/([[\]().?/*{}+$^:])/g,"$1"):" \\s ";const r=new RegExp("^["+e+"]+","g");return(t+"").replace(r,"")}static rtrim(t,e=null){e=e?(e+"").replace(/([[\]().?/*{}+$^:])/g,"\\$1"):" \\s ";const r=new RegExp("["+e+"]+$","g");return(t+"").replace(r,"")}static truncate_string(e,r=50,n="..."){if(this.nx(e)||!("string"==typeof e||e instanceof String))return e;if(-1===e.indexOf(" "))e.length>r&&(e=e.substring(0,r),e=t.rtrim(e),e+=" "+n);else if(e.length>r){for(e=t.rtrim(e);e.length>r&&e.lastIndexOf(" ")>-1&&" "!=e.substring(r-1,r);)e=e.substring(0,e.lastIndexOf(" ")),e=t.rtrim(e);e=e.substring(0,r),e=t.rtrim(e),e+=" "+n}return e}static emojiRegex(e=!0){return new RegExp(t.emojiRegexPattern(),(!0===e?"g":"")+"u")}static emojiRegexPattern(){return String.raw`\p{RI}\p{RI}|\p{Extended_Pictographic}(\p{EMod}|\uFE0F\u20E3?|[\u{E0020}-\u{E007E}]+\u{E007F})?(\u200D(\p{RI}\p{RI}|\p{Extended_Pictographic}(\p{EMod}|\uFE0F\u20E3?|[\u{E0020}-\u{E007E}]+\u{E007F})?))*`}static emojiSplit(t){return"string"==typeof t||t instanceof String?[...(new Intl.Segmenter).segment(t)].map(t=>t.segment):t}static serialize(t){let e,r,n,i="",o="",a=0;const s=function(t){let e,r,n,i,o=typeof t;if("object"===o&&!t)return"null";if("object"===o){if(!t.constructor)return"object";for(r in n=t.constructor.toString(),e=n.match(/(\w+)\(/),e&&(n=e[1].toLowerCase()),i=["boolean","number","string","array"],i)if(n===i[r]){o=i[r];break}}return o},l=s(t);switch(l){case"function":e="";break;case"boolean":e="b:"+(t?"1":"0");break;case"number":e=(Math.round(t)===t?"i":"d")+":"+t;break;case"string":e="s:"+(~-encodeURI(t).split(/%..|./).length+':"')+t+'"';break;case"array":case"object":for(r in e="a",t)if(t.hasOwnProperty(r)){if(i=s(t[r]),"function"===i)continue;n=r.match(/^[0-9]+$/)?parseInt(r,10):r,o+=this.serialize(n)+this.serialize(t[r]),a++}e+=":"+a+":{"+o+"}";break;default:e="N"}return"object"!==l&&"array"!==l&&(e+=";"),e}static unserialize(t){try{if("string"!=typeof t)return!1;const e=[],r=t=>(e.push(t[0]),t);r.get=t=>{if(t>=e.length)throw RangeError(`Can't resolve reference ${t+1}`);return e[t]};const n=t=>{const e=(/^(?:N(?=;)|[bidsSaOCrR](?=:)|[^:]+(?=:))/g.exec(t)||[])[0];if(!e)throw SyntaxError("Invalid input: "+t);switch(e){case"N":return r([null,2]);case"b":return r(i(t));case"i":return r(o(t));case"d":return r(a(t));case"s":return r(s(t));case"S":return r(l(t));case"a":return u(t);case"O":return d(t);case"C":throw Error("Not yet implemented");case"r":case"R":return c(t);default:throw SyntaxError(`Invalid or unsupported data type: ${e}`)}},i=t=>{const[e,r]=/^b:([01]);/.exec(t)||[];if(!r)throw SyntaxError("Invalid bool value, expected 0 or 1");return["1"===r,e.length]},o=t=>{const[e,r]=/^i:([+-]?\d+);/.exec(t)||[];if(!r)throw SyntaxError("Expected an integer value");return[parseInt(r,10),e.length]},a=t=>{const[e,r]=/^d:(NAN|-?INF|(?:\d+\.\d*|\d*\.\d+|\d+)(?:[eE][+-]\d+)?);/.exec(t)||[];if(!r)throw SyntaxError("Expected a float value");return["NAN"===r?NaN:"-INF"===r?Number.NEGATIVE_INFINITY:"INF"===r?Number.POSITIVE_INFINITY:parseFloat(r),e.length]},s=t=>{const[e,r]=/^s:(\d+):"/g.exec(t)||[];if(!e)throw SyntaxError("Expected a string value");const n=parseInt(r,10),i=(t=t.substr(e.length)).substr(0,n);if(!(t=t.substr(n)).startsWith('";'))throw SyntaxError('Expected ";');return[i,e.length+n+2]},l=t=>{const[e,r]=/^S:(\d+):"/g.exec(t)||[];if(!e)throw SyntaxError("Expected an escaped string value");const n=parseInt(r,10),i=(t=t.substr(e.length)).substr(0,n);if(!(t=t.substr(n)).startsWith('";'))throw SyntaxError('Expected ";');return[i,e.length+n+2]},c=t=>{const[e,n]=/^[rR]:(\d+);/.exec(t)||[];if(!e)throw SyntaxError("Expected reference value");return[r.get(parseInt(n,10)-1),e.length]},u=t=>{const[e,i]=/^a:(\d+):\{/.exec(t)||[];if(!i)throw SyntaxError("Expected array length annotation");t=t.substr(e.length);const o={};r([o]);for(let e=0;e<parseInt(i,10);e++){const e=n(t);t=t.substr(e[1]);const r=n(t);t=t.substr(r[1]),o[e[0]]=r[0]}if("}"!==t.charAt(0))throw SyntaxError("Expected }");return[o,e.length+1]},d=t=>{const[e,,i,o]=/^O:(\d+):"([^\"]+)":(\d+):\{/.exec(t)||[];if(!e)throw SyntaxError("Invalid input");if("stdClass"!==i)throw SyntaxError(`Unsupported object type: ${i}`);let a={};r([a]),t=t.substr(e.length);for(let e=0;e<parseInt(o,10);e++){const e=n(t);t=t.substr(e[1]);const r=n(t);t=t.substr(r[1]),a[e[0]]=r[0]}if("}"!==t.charAt(0))throw SyntaxError("Expected }");return[a,e.length+1]};return n(t)[0]}catch(t){return console.error(t),!1}}static pushId(){let e=null;void 0!==window&&(void 0===window.pushIdDataGlobal&&(window.pushIdDataGlobal={}),e=window.pushIdDataGlobal),"undefined"!=typeof global&&(void 0===global.pushIdDataGlobal&&(global.pushIdDataGlobal={}),e=global.pushIdDataGlobal),t.objectsAreEqual(e,{})&&(e.lastPushTime=0,e.lastRandChars=[],e.PUSH_CHARS="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz");let r=(new Date).getTime(),n=r===e.lastPushTime;e.lastPushTime=r;let i=new Array(8);for(var o=7;o>=0;o--)i[o]=e.PUSH_CHARS.charAt(r%64),r=Math.floor(r/64);if(0!==r)throw new Error;let a=i.join("");if(n){for(o=11;o>=0&&63===e.lastRandChars[o];o--)e.lastRandChars[o]=0;e.lastRandChars[o]++}else for(o=0;o<12;o++)e.lastRandChars[o]=Math.floor(64*Math.random());for(o=0;o<12;o++)a+=e.PUSH_CHARS.charAt(e.lastRandChars[o]);if(20!=a.length)throw new Error;return a}static getProp(t,e){let r=e.split(".");for(;r.length&&(t=t[r.shift()]););return t}static base64toblob(t,e=""){let r=atob(t),n=[];for(let t=0;t<r.length;t+=512){let e=r.slice(t,t+512),i=new Array(e.length);for(let t=0;t<e.length;t++)i[t]=e.charCodeAt(t);let o=new Uint8Array(i);n.push(o)}return new Blob(n,{type:e})}static blobtobase64(t){return new Promise(e=>{let r=new FileReader;r.onload=()=>{var t=r.result.split(",")[1];e(t)},r.readAsDataURL(t)})}static stringtoblob(t,e=""){return new Blob([t],{type:e})}static blobtostring(t){return new Promise(e=>{let r=new FileReader;r.onload=()=>{e(r.result)},r.readAsText(t)})}static filetobase64(t){return new Promise((e,r)=>{const n=new FileReader;n.readAsDataURL(t),n.onload=()=>e(n.result.split(",")[1]),n.onerror=t=>r(t)})}static blobtofile(t,e="file.txt"){let r=null;try{r=new File([t],e)}catch{r=new Blob([t],e)}return r}static filetoblob(t){return new Blob([t])}static base64tofile(t,e="",r="file.txt"){return this.blobtofile(this.base64toblob(t,e),r)}static blobtourl(t){return URL.createObjectURL(t)}static stringtourl(t){return this.blobtourl(this.stringtoblob(t))}static base64tostring(t){return atob(t)}static stringtobase64(t){return btoa(t)}static base64tourl(t){return this.blobtourl(this.base64toblob(t))}static filetourl(t){return this.blobtourl(this.filetoblob(t))}static getImageOrientation(t){return new Promise((e,r)=>{t=t.replace("data:image/jpeg;base64,","");let n=this.base64tofile(t),i=new FileReader;i.onload=t=>{var r=new DataView(t.target.result);if(65496==r.getUint16(0,!1)){for(var n=r.byteLength,i=2;i<n;){if(r.getUint16(i+2,!1)<=8)return void e(-1);var o=r.getUint16(i,!1);if(i+=2,65505==o){if(1165519206!=r.getUint32(i+=2,!1))return void e(-1);var a=18761==r.getUint16(i+=6,!1);i+=r.getUint32(i+4,a);var s=r.getUint16(i,a);i+=2;for(var l=0;l<s;l++)if(274==r.getUint16(i+12*l,a))return void e(r.getUint16(i+12*l+8,a))}else{if(65280&~o)break;i+=r.getUint16(i,!1)}}e(-1)}else e(-2)},i.readAsArrayBuffer(n)})}static resetImageOrientation(t,e){return new Promise((r,n)=>{var i=new Image;i.onload=()=>{var t=i.width,n=i.height,o=document.createElement("canvas"),a=o.getContext("2d");switch(4<e&&e<9?(o.width=n,o.height=t):(o.width=t,o.height=n),e){case 2:a.transform(-1,0,0,1,t,0);break;case 3:a.transform(-1,0,0,-1,t,n);break;case 4:a.transform(1,0,0,-1,0,n);break;case 5:a.transform(0,1,1,0,0,0);break;case 6:a.transform(0,1,-1,0,n,0);break;case 7:a.transform(0,-1,-1,0,n,t);break;case 8:a.transform(0,-1,1,0,0,t)}a.drawImage(i,0,0);let s=o.toDataURL();s="data:image/jpeg;base64,"+s.split(",")[1],r(s)},i.src=t})}static fixImageOrientation(t){return new Promise((e,r)=>{-1!==t.indexOf("data:")?(0===t.indexOf("data:image/jpeg;base64,")&&(t=t.replace("data:image/jpeg;base64,","")),this.getImageOrientation(t).then(r=>{t="data:image/jpeg;base64,"+t,r<=1?e(t):this.resetImageOrientation(t,r).then(t=>{e(t)})})):e(t)})}static debounce(t,e,r){var n;return function(){var i=this,o=arguments,a=r&&!n;clearTimeout(n),n=setTimeout(function(){n=null,r||t.apply(i,o)},e),a&&t.apply(i,o)}}static throttle(t,e,r){var n,i,o,a=null,s=0;r||(r={});var l=function(){s=!1===r.leading?0:Date.now(),a=null,o=t.apply(n,i),a||(n=i=null)};return function(){var c=Date.now();s||!1!==r.leading||(s=c);var u=e-(c-s);return n=this,i=arguments,u<=0||u>e?(a&&(clearTimeout(a),a=null),s=c,o=t.apply(n,i),a||(n=i=null)):a||!1===r.trailing||(a=setTimeout(l,u)),o}}static shuffle(t){let e,r,n=t.length;for(;0!==n;)r=Math.floor(Math.random()*n),n-=1,e=t[n],t[n]=t[r],t[r]=e;return t}static findRecursiveInObject(t,e=null,r=null,n="",i=[]){if(null!==t&&"object"==typeof t)for(const[o,a]of Object.entries(t))if(null!==a&&"object"==typeof a)this.findRecursiveInObject(a,e,r,(""===n?"":n+".")+o,i);else if(!(null!==e&&o!==e||null!==r&&a!==r)){i.push(n);break}return i}};return"undefined"!=typeof window&&(window.hlp={},Object.getOwnPropertyNames(t).forEach((e,r)=>{"length"!==e&&"name"!==e&&"prototype"!==e&&"caller"!==e&&"arguments"!==e&&(window.hlp[e]=t[e])})),t}();
|
|
1
|
+
var hlp=function(){var t=class t{static x(t){if("function"==typeof t)try{return t=t(),this.x(t)}catch(t){return!1}return!(null===t||!1===t||"string"==typeof t&&""==t.trim()||"object"==typeof t&&0===Object.keys(t).length&&t.constructor===Object||void 0===t||Array.isArray(t)&&0===t.length||Array.isArray(t)&&1===t.length&&""===t[0])}static nx(t){return!this.x(t)}static true(e){if("function"==typeof e)try{return e=e(),this.true(e)}catch(t){return!1}return void 0!==e&&(null!==e&&(!1!==e&&((!Array.isArray(e)||0!==e.length)&&((!Array.isArray(e)||""!==t.first(e))&&(("object"!=typeof e||0!==Object.keys(e).length||e.constructor!==Object)&&(0!==e&&("0"!==e&&(""!==e&&(" "!==e&&("null"!==e&&"false"!==e))))))))))}static false(e){if("function"==typeof e)try{return e=e(),this.false(e)}catch(t){return!1}return void 0!==e&&(null!==e&&(!1===e||(!Array.isArray(e)||0!==e.length)&&((!Array.isArray(e)||""!==t.first(e))&&(("object"!=typeof e||0!==Object.keys(e).length||e.constructor!==Object)&&(0===e||("0"===e||""!==e&&(" "!==e&&("null"!==e&&"false"===e))))))))}static v(...t){if(this.nx(arguments))return"";for(let t=0;t<arguments.length;t++)if(this.x(arguments[t]))return arguments[t];return""}static loop(t,e){if(this.nx(t))return null;Array.isArray(t)?t.forEach((t,r)=>{e(t,r)}):"object"==typeof t&&Object.entries(t).forEach(([t,r])=>{e(r,t)})}static map(t,e,r=null){return Object.keys(t).reduce((n,i)=>(n[i]=e.call(r||null,i,t[i]),n),{})}static first(t){if(Array.isArray(t)){var e=null;return t.forEach((t,r)=>{null===e&&(e=t)}),e}if("object"==typeof t){e=null;return Object.entries(t).forEach(([t,r])=>{null===e&&(e=r)}),e}return null}static last(t){if(Array.isArray(t)){let e=null;return t.forEach((t,r)=>{e=t}),e}if("object"==typeof t){let e=null;return Object.entries(t).forEach(([t,r])=>{e=r}),e}return null}static rand(t){if(Array.isArray(t))return t[Math.floor(Math.random()*t.length)];if("object"==typeof t){var e=Object.values(t);return e[Math.floor(Math.random()*e.length)]}return null}static random_string(t=8,e=null){null===e&&(e="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");let r=e.length,n="";for(let i=0;i<t;i++)n+=e[0+~~(Math.random()*(r-1-0+1))];return n}static round(t=0,e=0){return Number(Math.round(t+"e"+e)+"e-"+e)}static isInteger(t){return!isNaN(t)&&parseInt(Number(t))==t&&!isNaN(parseInt(t,10))}static random_int(t=0,e=99999){return!(!this.isInteger(t)||!this.isInteger(e))&&(t>e&&([t,e]=[e,t]),~~(Math.random()*(e-t+1))+t)}static capitalize(t=null){return null===t||""===t?t:t.charAt(0).toUpperCase()+t.slice(1)}static cookieExists(t){return void 0!==document.cookie&&null!==this.cookieGet(t)}static cookieGet(t){var e=document.cookie.match(new RegExp(t+"=([^;]+)"));return e?decodeURIComponent(e[1]):null}static cookieSet(t,e,r,n=!0){let i="";window.location.protocol.indexOf("https")>-1&&(i="; SameSite=None; Secure"),document.cookie=t+"="+encodeURIComponent(e)+"; expires="+new Date((new Date).getTime()+24*r*60*60*1e3).toUTCString()+"; path=/"+i+"; domain="+(!0===n?this.urlHostTopLevel():"")}static cookieDelete(t,e=!0){let r="";window.location.protocol.indexOf("https")>-1&&(r="; SameSite=None; Secure"),document.cookie=t+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"+r+"; domain="+(!0===e?this.urlHostTopLevel():"")}static localStorageSet(t,e,r=0){r*=864e5;let n={value:e,expiry:(new Date).getTime()+r};localStorage.setItem(t,JSON.stringify(n))}static localStorageGet(t){let e=localStorage.getItem(t);if(!e)return null;let r=JSON.parse(e);return(new Date).getTime()>r.expiry?(localStorage.removeItem(t),null):r.value}static localStorageDelete(t){localStorage.removeItem(t)}static localStorageExists(t){return null!==this.localStorageGet(t)}static getParam(t){let e=window.location.search;if(this.nx(e))return null;let r=e.substring(1).split("&");for(var n=0;n<r.length;n++){var i=r[n].split("=");if(i[0]==t&&this.x(i[1]))return i[1]}return null}static getDevice(){return this.isPhone()?"phone":this.isTablet()?"tablet":"desktop"}static isPhone(){let t=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}static isTablet(){let t=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}static isDesktop(){return!this.isPhone()&&!this.isTablet()}static isMobile(){return!!(window.innerWidth<750||this.isPhone())}static isTouch(){return"ontouchstart"in window||navigator.maxTouchPoints||!1}static isPageSpeed(){const t=navigator.userAgent||"";let e=0;if(/Lighthouse|HeadlessChrome|Chrome-Lighthouse|Speed Insights|PTST|PageSpeed/i.test(t))return!0;if(navigator.webdriver)return!0;if(navigator.languages&&0!==navigator.languages.length||(e+=3),/moto g power|Moto G4/i.test(t)&&(e+=2),/Chrome\/\d{3}\.0\.0\.0/i.test(t)&&(e+=1),"undefined"!=typeof window){const t=window.innerWidth,r=window.innerHeight;(1350===t&&940===r||412===t&&(823===r||915===r)||360===t&&640===r)&&(e+=2)}return navigator.plugins&&0===navigator.plugins.length&&(e+=1),navigator.connection||navigator.deviceMemory||navigator.hardwareConcurrency||(e+=1),void 0===navigator.permissions&&(e+=1),/Chrome/i.test(t)&&void 0===window.chrome&&(e+=2),e>=4}static isMac(){return"mac"===t.getOs()}static isLinux(){return"linux"===t.getOs()}static isWindows(){return"windows"===t.getOs()}static getOs(){let t=window.navigator.userAgent,e=window.navigator.platform,r="unknown";return-1!==["Macintosh","MacIntel","MacPPC","Mac68K"].indexOf(e)||-1!==["iPhone","iPad","iPod"].indexOf(e)?r="mac":-1!==["Win32","Win64","Windows","WinCE"].indexOf(e)?r="windows":(/Android/.test(t)||/Linux/.test(e))&&(r="linux"),r}static getBrowser(){let t="",e=!document.documentMode&&!!window.StyleMedia;return t=-1!=navigator.userAgent.indexOf("Opera")||-1!=navigator.userAgent.indexOf("OPR")?"opera":-1==navigator.userAgent.indexOf("Chrome")||e?-1==navigator.userAgent.indexOf("Safari")||e?-1!=navigator.userAgent.indexOf("Firefox")?"firefox":-1!=navigator.userAgent.indexOf("MSIE")||1==!!document.documentMode?"ie":e?"edge":"unknown":"safari":"chrome",t}static isObject(t=null){return!!t&&t.constructor===Object}static isArray(t=null){return!!t&&t.constructor===Array}static isString(t){return"string"==typeof t||t instanceof String}static isDate(t){if(this.nx(t))return!1;if("[object Date]"===Object.prototype.toString.call(t))return!0;if(!this.isString(t))return!1;if(3!==t.split("-").length)return!1;let e=parseInt(t.split("-")[2]),r=parseInt(t.split("-")[1]),n=parseInt(t.split("-")[0]),i=new Date;return i.setFullYear(n,r-1,e),i.getFullYear()==n&&i.getMonth()+1==r&&i.getDate()==e}static password_generate(t=20,e=["a-z","A-Z","0-9","$!?"],r="lI"){if(null===e||!e.length||t<e.length)return null;let n=[];for(let t of e){let e=[];if(e="a-z"===t?Array.from({length:26},(t,e)=>String.fromCharCode(97+e)):"A-Z"===t?Array.from({length:26},(t,e)=>String.fromCharCode(65+e)):"0-9"===t?Array.from({length:10},(t,e)=>String.fromCharCode(48+e)):t.split(""),r&&(e=e.filter(t=>!r.includes(t))),0===e.length)return null;n.push(e)}let i=n.map(t=>t[Math.floor(Math.random()*t.length)]),o=n.flat();for(;i.length<t;){let t=Math.floor(Math.random()*o.length);i.push(o[t])}for(let t=i.length-1;t>0;t--){let e=Math.floor(Math.random()*(t+1));[i[t],i[e]]=[i[e],i[t]]}return i.join("")}static formatNumber(t,e=0,r=".",n=","){t=(t+"").replace(/[^0-9+\-Ee.]/g,"");var i=isFinite(+t)?+t:0,o=isFinite(+e)?Math.abs(e):0,a=void 0===n?",":n,s=void 0===r?".":r;let l=(o?function(t,e){var r=Math.pow(10,e);return""+Math.round(t*r)/r}(i,o):""+Math.round(i)).split(".");return l[0].length>3&&(l[0]=l[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,a)),(l[1]||"").length<o&&(l[1]=l[1]||"",l[1]+=new Array(o-l[1].length+1).join("0")),l.join(s)}static formatDate(t,e=null){!1===e||!0===e||null===e||""===e?e=new Date:"object"!=typeof e&&(e=new Date(e.replace(/-/g,"/").replace(/T|Z/g," ")));let r="",n=e.getMonth(),i=n+1,o=e.getDay(),a=e.getDate(),s=e.getFullYear(),l=e.getHours(),c=e.getMinutes(),u=e.getSeconds();for(let d=0,h=t.length;d<h;d++)switch(t[d]){case"j":r+=a;break;case"d":r+=a<10?"0"+a:a;break;case"l":let h=Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");r+=h[o];break;case"w":r+=o;break;case"D":h=Array("Sun","Mon","Tue","Wed","Thr","Fri","Sat"),r+=h[o];break;case"m":r+=i<10?"0"+i:i;break;case"n":r+=i;break;case"F":let g=Array("January","February","March","April","May","June","July","August","September","October","November","December");r+=g[n];break;case"M":g=Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"),r+=g[n];break;case"Y":r+=s;break;case"y":r+=s.toString().slice(-2);break;case"H":r+=l<10?"0"+l:l;break;case"g":let m=0===l?12:l;r+=m>12?m-12:m;break;case"h":m=0===l?12:l,m=m>12?m-12:m,r+=m<10?"0"+m:m;break;case"a":r+=l<12?"am":"pm";break;case"i":r+=c<10?"0"+c:c;break;case"s":r+=u<10?"0"+u:u;break;case"c":r+=e.toISOString();break;default:r+=t[d]}return r}static deepCopy(e,r=new WeakMap){if(Object(e)!==e)return e;if(r.has(e))return r.get(e);const n=e instanceof Date?new Date(e):e instanceof RegExp?new RegExp(e.source,e.flags):e.constructor?new e.constructor:Object.create(null);return r.set(e,n),e instanceof Map&&Array.from(e,([e,i])=>n.set(e,t.deepCopy(i,r))),Object.assign(n,...Object.keys(e).map(n=>({[n]:t.deepCopy(e[n],r)})))}static jsonStringToObject(t){if(this.nx(t)||!this.isString(t))return null;try{return JSON.parse(t)}catch(t){return null}}static isJsonString(t){if(this.nx(t)||!this.isString(t))return!1;try{return JSON.parse(t),!0}catch(t){return!1}}static jsonObjectToString(t){try{return JSON.stringify(t)}catch(t){return null}}static uuid(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()}static guid(){return this.uuid()}static replaceAll(t,e,r){return t.split(e).join(r)}static replaceLast(t,e,r){let n=t.lastIndexOf(e);return t=t.slice(0,n)+t.slice(n).replace(e,r)}static replaceFirst(t,e,r){return t.replace(e,r)}static findAllPositions(t,e){let r,n=t.length,i=0,o=[];if(0==n)return[];for(;(r=e.indexOf(t,i))>-1;)o.push(r),i=r+n;return o}static findAllPositionsCaseInsensitive(t,e){let r,n=t.length,i=0,o=[];if(0==n)return[];for(;(r=this.indexOfCaseInsensitive(t,e,i))>-1;)o.push(r),i=r+n;return o}static countAllOccurences(t,e){let r=new RegExp(t,"g");return(e.match(r)||[]).length}static countAllOccurencesCaseInsensitive(t,e){let r=new RegExp(t,"gi");return(e.match(r)||[]).length}static indexOfCaseInsensitive(t,e,r=0){return e.toLowerCase().indexOf(t.toLowerCase(),r)}static highlight(t,e,r=!1,n=500){if(this.nx(t)||this.nx(e))return t;if(!0===r){let r="...",i=this.findAllPositionsCaseInsensitive(e,t),o=t.split(" "),a=0;for(o.forEach((t,s)=>{let l=!0;i.forEach(t=>{a>=t-n&&a<=t+e.length+n-1&&(l=!1)}),!0===l&&(o[s]=r),a+=t.length+1}),t=o.join(" ");t.indexOf("... ...")>-1;)t=this.replaceAll(t,"... ...",r);t=t.trim()}let i=this.findAllPositionsCaseInsensitive(e,t);for(let r=0;r<i.length;r++){t=t.substring(0,i[r])+'<strong class="highlight">'+t.substring(i[r],i[r]+e.length)+"</strong>"+t.substring(i[r]+e.length);for(let t=r+1;t<i.length;t++)i[t]=i[t]+26+9}return t}static get(t,e=null){return this.call("GET",t,e)}static post(t,e=null){return this.call("POST",t,e)}static call(e,r,n=null){return null===n&&(n={}),"data"in n||(n.data={}),"headers"in n||(n.headers=null),"throttle"in n||(n.throttle=0),"allow_errors"in n||(n.allow_errors=!0),new Promise((i,o)=>{setTimeout(()=>{0!==r.indexOf("http")&&(r=t.baseUrl()+"/"+r);let a=new XMLHttpRequest;a.open(e,r,!0),"POST"===e&&(!("data"in n)||null===n.data||"object"!=typeof n.data||n.data instanceof FormData||(a.setRequestHeader("Content-Type","application/json;charset=UTF-8"),n.data=JSON.stringify(n.data)),a.setRequestHeader("X-Requested-With","XMLHttpRequest")),this.x(n.headers)&&Object.entries(n.headers).forEach(([t,e])=>{a.setRequestHeader(t,e)}),a.onload=()=>{(4!=a.readyState||!0!==n.allow_errors&&200!=a.status&&304!=a.status)&&(this.isJsonString(a.responseText)?o(this.jsonStringToObject(a.responseText)):o(a.responseText)),this.isJsonString(a.responseText)?i(this.jsonStringToObject(a.responseText)):i(a.responseText)},a.onerror=()=>{o([a.readyState,a.status,a.statusText])},"GET"===e&&a.send(null),"POST"===e&&a.send(n.data)},n.throttle)})}static onResizeHorizontal(t){let e,r,n=window.innerWidth;window.addEventListener("resize",()=>{e=window.innerWidth,e!=n&&(n=e,r&&clearTimeout(r),r=window.setTimeout(()=>{t()},50))}),t()}static onResizeVertical(t){var e,r,n=window.innerHeight;window.addEventListener("resize",()=>{(e=window.innerHeight)!=n&&(n=e,r&&clearTimeout(r),r=window.setTimeout(()=>{t()},50))}),t()}static removeEmpty(t){return this.nx(t)||!Array.isArray(t)?t:t=t.filter(t=>this.x(t))}static uniqueArray(t){let e={},r=[];for(let n=0;n<t.length;n++)t[n]in e||(r.push(t[n]),e[t[n]]=!0);return r}static powerset(t){return Array.isArray(t)?t.reduce((t,e)=>t.concat(t.map(t=>[...t,e])),[[]]):t}static charToInt(t){let e,r,n=0;for(e=0,r=(t=t.toUpperCase()).length-1;e<t.length;e+=1,r-=1)n+=Math.pow(26,r)*("ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(t[e])+1);return n}static intToChar(t){for(var e="",r=1,n=26;(t-=r)>=0;r=n,n*=26)e=String.fromCharCode(parseInt(t%n/r)+65)+e;return e}static slugify(t){return t.toString().toLowerCase().trim().split("ä").join("ae").split("ö").join("oe").split("ü").join("ue").split("ß").join("ss").replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}static incChar(t,e=1){return this.intToChar(this.charToInt(t)+e)}static decChar(t,e=1){return this.intToChar(this.charToInt(t)-e)}static range(t,e){let r=[],n=typeof t,i=typeof e,o=1;if("undefined"==n||"undefined"==i||n!=i)return null;if(e<t&&(o=-o),"number"==n)for(;o>0?e>=t:e<=t;)r.push(t),t+=o;else{if("string"!=n)return null;if(1!=t.length||1!=e.length)return null;for(t=t.charCodeAt(0),e=e.charCodeAt(0);o>0?e>=t:e<=t;)r.push(String.fromCharCode(t)),t+=o}return r}static dateToWeek(t=null){null===t&&(t=new Date),(t=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()))).setUTCDate(t.getUTCDate()+4-(t.getUTCDay()||7));let e=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t-e)/864e5+1)/7)}static weekToDate(t,e){null==e&&(e=(new Date).getFullYear());let r=new Date;r.setFullYear(e),r.setDate(1),r.setMonth(0),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0);let n=r.getDay();n=0===n?7:n;let i=1-n;7-n+1<4&&(i+=7),r=new Date(r.getTime()+24*i*60*60*1e3);let o=6048e5*(t-1),a=r.getTime()+o;return r.setTime(a),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0),r}static addDays(t,e){var r=new Date(t);return r.setDate(r.getDate()+e),r}static diffInMonths(t,e){let r=new Date(t),n=new Date(e);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())+(n.getDate()-r.getDate())/new Date(n.getFullYear(),n.getMonth()+1,0).getDate()}static objectsAreEqual(t,e){var r=this;if(null==t||null==e)return t===e;if(t.constructor!==e.constructor)return!1;if(t instanceof Function)return t===e;if(t instanceof RegExp)return t===e;if(t===e||t.valueOf()===e.valueOf())return!0;if(Array.isArray(t)&&t.length!==e.length)return!1;if(t instanceof Date)return!1;if(!(t instanceof Object))return!1;if(!(e instanceof Object))return!1;var n=Object.keys(t);return Object.keys(e).every(function(t){return-1!==n.indexOf(t)})&&n.every(function(n){return r.objectsAreEqual(t[n],e[n])})}static containsObject(t,e){var r;for(r in e)if(e.hasOwnProperty(r)&&this.objectsAreEqual(e[r],t))return!0;return!1}static fadeOut(t,e=1e3){return e<=25&&(e=25),new Promise(r=>{t.style.opacity=1,function n(){(t.style.opacity-=25/e)<0?(t.style.display="none",r()):requestAnimationFrame(n)}()})}static fadeIn(t,e=1e3){return e<=25&&(e=25),new Promise(r=>{t.style.opacity=0,t.style.display="block",function n(){var i=parseFloat(t.style.opacity);(i+=25/e)>1?r():(t.style.opacity=i,requestAnimationFrame(n))}()})}static scrollTop(){let t=document.documentElement;return(window.pageYOffset||t.scrollTop)-(t.clientTop||0)}static scrollLeft(){let t=document.documentElement;return(window.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}static closestScrollable(t){let e=t instanceof HTMLElement&&window.getComputedStyle(t).overflowY,r=e&&!(e.includes("hidden")||e.includes("visible"));return t?r&&t.scrollHeight>=t.clientHeight?t:this.closestScrollable(t.parentNode)||document.scrollingElement||document.body:null}static offsetTop(t){return t.getBoundingClientRect().top+window.pageYOffset-document.documentElement.clientTop}static offsetLeft(t){return t.getBoundingClientRect().left+window.pageXOffset-document.documentElement.clientLeft}static offsetRight(t){return t.getBoundingClientRect().left+window.pageXOffset-document.documentElement.clientLeft+t.offsetWidth}static offsetBottom(t){return t.getBoundingClientRect().top+window.pageYOffset-document.documentElement.clientTop+t.offsetHeight}static offsetTopWithMargin(t){return this.offsetTop(t)-parseInt(getComputedStyle(t).marginTop)}static offsetLeftWithMargin(t){return this.offsetLeft(t)-parseInt(getComputedStyle(t).marginLeft)}static offsetRightWithMargin(t){return this.offsetRight(t)+parseInt(getComputedStyle(t).marginRight)}static offsetBottomWithMargin(t){return this.offsetBottom(t)+parseInt(getComputedStyle(t).marginBottom)}static documentHeight(){return Math.max(document.body.offsetHeight,document.body.scrollHeight,document.documentElement.clientHeight,document.documentElement.offsetHeight,document.documentElement.scrollHeight)}static documentWidth(){return document.documentElement.clientWidth||document.body.clientWidth}static windowWidth(){return window.innerWidth}static windowHeight(){return window.innerHeight}static windowWidthWithoutScrollbar(){return document.documentElement.clientWidth||document.body.clientWidth}static windowHeightWithoutScrollbar(){return document.documentElement.clientHeight||document.body.clientHeight}static outerWidthWithMargin(t){return t.offsetWidth+parseInt(getComputedStyle(t).marginLeft)+parseInt(getComputedStyle(t).marginRight)}static outerHeightWithMargin(t){return t.offsetHeight+parseInt(getComputedStyle(t).marginTop)+parseInt(getComputedStyle(t).marginBottom)}static async cursorPosition(){document.head.insertAdjacentHTML("afterbegin",'\n <style type="text/css">\n .find-pointer-quad {\n --hit: 0;\n position: fixed;\n\t z-index:2147483647;\n transform: translateZ(0);\n &:hover { --hit: 1; }\n }\n </style>\n '),window.cursorPositionDelay=50,window.cursorPositionQuads=[];return window.cursorPositionQuads=[1,2,3,4].map((t,e)=>{let r=document.createElement("a");r.classList.add("find-pointer-quad");let{style:n}=r;return n.top=e<2?"0":"10%",n.left=e%2==0?"0":"10%",n.width=n.height="10%",document.body.appendChild(r),r}),this.cursorPositionBisect(10)}static cursorPositionBisect(t){let e;if(window.cursorPositionQuads.some(t=>{let r=getComputedStyle(t);if("1"===r.getPropertyValue("--hit"))return e={style:r,a:t}}),!e){let[e]=window.cursorPositionQuads,r=Math.abs(t)>1e4,n=parseFloat(e.style.top)-t/2,i=parseFloat(e.style.left)-t/2;return window.cursorPositionQuads.forEach(({style:e},o)=>{r?(e.top=o<2?"0":`${t}%`,e.left=o%2==0?"0":`${t}%`,e.width=e.height=`${t}%`):(e.top=o<2?`${n}%`:`${n+t}%`,e.left=o%2==0?`${i}%`:`${i+t}%`,e.width=`${t}%`,e.height=`${t}%`)}),new Promise(e=>{setTimeout(()=>e(this.cursorPositionBisect(r?t:2*t)),window.cursorPositionDelay)})}let{style:r,a:n}=e,{top:i,left:o,width:a,height:s}=n.getBoundingClientRect();if(a<3)return window.cursorPositionQuads.forEach(t=>t.remove()),{x:Math.round(o+a/2+window.scrollX),y:Math.round(i+s/2+window.scrollY)};let l=n.style.left,c=n.style.top,u=t/2;return window.cursorPositionQuads.forEach(({style:t},e)=>{t.top=e<2?c:`${u+parseFloat(c)}%`,t.left=e%2==0?l:`${u+parseFloat(l)}%`,t.width=`${u}%`,t.height=`${u}%`}),new Promise(t=>{setTimeout(()=>t(this.cursorPositionBisect(u)),window.cursorPositionDelay)})}static scrollTo(e,r=1e3,n=null,i=0,o=!1){return new Promise(a=>{null===n&&(n=document.scrollingElement||document.documentElement),t.isNumeric(e)||(e=n===(document.scrollingElement||document.documentElement)?this.offsetTopWithMargin(e):e.getBoundingClientRect().top-parseInt(getComputedStyle(e).marginTop)-(n.getBoundingClientRect().top-n.scrollTop-parseInt(getComputedStyle(n).marginTop)));let s=0,l=i;Array.isArray(l)||(l=[l]),l.forEach(e=>{t.isNumeric(e)?s+=e:null!==e&&"fixed"===window.getComputedStyle(e).position&&(s+=-1*e.offsetHeight)}),e+=s;const c=n.scrollTop,u=e-c,d=+new Date,h=function(){const t=+new Date-d;var i,o,s;n.scrollTop=parseInt((i=t,o=c,s=u,(i/=r/2)<1?-s/2*(Math.sqrt(1-i*i)-1)+o:(i-=2,s/2*(Math.sqrt(1-i*i)+1)+o))),t<r?requestAnimationFrame(h):(n.scrollTop=e,a())};!0===o&&u>0?a():h()})}static loadJs(e){t.isArray(e)||(e=[e]);let r=[];return t.loop(e,(t,e)=>{r.push(new Promise((e,r)=>{let n=document.createElement("script");n.src=t,n.onload=()=>{e()},document.head.appendChild(n)}))}),Promise.all(r)}static async loadJsSequentially(e){t.isArray(e)||(e=[e]);for(let r of e)await t.loadJs(r)}static triggerAfterAllImagesLoaded(t,e,r){window.addEventListener("load",n=>{null!==document.querySelector(t+" "+e)&&document.querySelectorAll(t+" "+e).forEach(n=>{this.triggerAfterAllImagesLoadedBindLoadEvent(n,t,e,r)})}),document.addEventListener("DOMContentLoaded",()=>{null!==document.querySelector(t)&&new MutationObserver(n=>{n.forEach(n=>{"childList"===n.type&&n.addedNodes.length>0?n.addedNodes.forEach(n=>{this.triggerAfterAllImagesLoadedHandleEl(n,t,e,r)}):"attributes"===n.type&&"src"===n.attributeName&&n.target.classList.contains(e.replace(".",""))&&n.oldValue!==n.target.getAttribute("src")&&this.triggerAfterAllImagesLoadedHandleEl(n.target,t,e,r)})}).observe(document.querySelector(t),{attributes:!0,childList:!0,characterData:!1,subtree:!0,attributeOldValue:!0,characterDataOldValue:!1})})}static triggerAfterAllImagesLoadedHandleEl(t,e,r,n){t.nodeType===Node.ELEMENT_NODE&&(t.classList.remove("loaded-img"),t.closest(e).classList.remove("loaded-all"),t.classList.contains("binded-trigger")||(t.classList.add("binded-trigger"),t.addEventListener("load",()=>{this.triggerAfterAllImagesLoadedBindLoadEvent(t,e,r,n)})))}static triggerAfterAllImagesLoadedBindLoadEvent(t,e,r,n){t.classList.add("loaded-img"),t.closest(e).querySelectorAll(".loaded-img").length===t.closest(e).querySelectorAll(r).length&&(t.closest(e).classList.add("loaded-all"),n())}static isVisible(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}static isVisibleInViewport(t){if(!this.isVisible(t))return!1;let e=t.getBoundingClientRect();return!(e.bottom<0||e.right<0||e.left>window.innerWidth||e.top>window.innerHeight)}static textareaAutoHeight(t="textarea"){this.textareaSetHeights(t),this.onResizeHorizontal(()=>{this.textareaSetHeights(t)}),[].forEach.call(document.querySelectorAll(t),t=>{t.addEventListener("keyup",t=>{this.textareaSetHeight(t.target)})})}static textareaSetHeights(t="textarea"){[].forEach.call(document.querySelectorAll(t),t=>{this.isVisible(t)&&this.textareaSetHeight(t)})}static textareaSetHeight(t){t.style.height="5px",t.style.height=t.scrollHeight+"px"}static real100vh(t=null,e=100){if(null===t){let t=()=>{let t=.01*window.innerHeight;document.documentElement.style.setProperty("--vh",`${t}px`)};t(),window.addEventListener("resize",()=>{t()})}else{let r=()=>{console.log(t),null!==document.querySelector(t)&&document.querySelectorAll(t).forEach(t=>{t.style.height=window.innerHeight*(e/100)+"px"})};r(),window.addEventListener("resize",()=>{r()})}}static iOsRemoveHover(){"safari"===t.getBrowser()&&"desktop"!==t.getDevice()&&t.on("touchend","a",(t,e)=>{e.click()})}static isNumeric(t){return!isNaN(parseFloat(t))&&isFinite(t)}static animate(e,r,n,i,o){return new Promise(a=>{o<=50&&(o=50);let s=[];r.split(";").forEach(t=>{s.push(t.split(":")[0].trim())});let l=[];s.forEach(t=>{l.push(t+" "+Math.round(o/1e3*10)/10+"s "+i)});let c="transition: "+l.join(", ")+" !important;",u=null;NodeList.prototype.isPrototypeOf(e)?u=Array.from(e):null===e?(console.log("cannot animate element from "+r+" to "+n+" because it does not exist"),a()):u=[e];let d=u.length;u.forEach((e,i)=>{let l=t.random_string(10,"abcdefghijklmnopqrstuvwxyz");e.classList.add(l),window.requestAnimationFrame(()=>{let i=[],u="",h=e.getAttribute("style");null!==h&&h.split(";").forEach(t=>{""==t||s.includes(t.split(":")[0].trim())||i.push(t)}),u=i.length>0?i.join(";")+";"+r+";":r+";",e.setAttribute("style",u),window.requestAnimationFrame(()=>{let i=document.createElement("style");i.innerHTML="."+l+" { "+c+" }",document.head.appendChild(i),window.requestAnimationFrame(()=>{if(e.setAttribute("style",e.getAttribute("style").replace(r+";","")+n+";"),this.isVisible(e)){let r=!1;t.addEventListenerOnce(e,"transitionend",t=>{if(r=!0,t.target!==t.currentTarget)return!1;document.head.contains(i)&&document.head.removeChild(i),e.classList.remove(l),d--,d<=0&&window.requestAnimationFrame(()=>{a()})}),setTimeout(()=>{!1===r&&(document.head.contains(i)&&document.head.removeChild(i),e.classList.remove(l),d--,d<=0&&a())},1.5*o)}else document.head.contains(i)&&document.head.removeChild(i),e.classList.remove(l),d--,d<=0&&a()})})})})})}static addEventListenerOnce(t,e,r,n=void 0,i=void 0){t.addEventListener(e,function o(a){!1!==r.apply(this,arguments,n)&&t.removeEventListener(e,o,i)})}static htmlDecode(t){let e=document.createElement("textarea");return e.innerHTML=t,e.value}static htmlEncode(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/`/g,"`")}static nl2br(t){return null==t?"":(t+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1<br/>")}static br2nl(t){return null==t?"":t.replace(/<\s*\/?br\s*[\/]?>/gi,"\n")}static closest(t,e){if(!document.documentElement.contains(t))return null;do{if(this.matches(t,e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null}static matches(t,e){let r=t,n=(r.parentNode||r.document).querySelectorAll(e),i=-1;for(;n[++i]&&n[i]!=r;);return!!n[i]}static wrap(t,e){if(null===t)return;let r=(new DOMParser).parseFromString(e,"text/html").body.childNodes[0];t.parentNode.insertBefore(r,t.nextSibling),r.appendChild(t)}static wrapTextNodes(t,e){null!==t&&Array.from(t.childNodes).filter(t=>3===t.nodeType&&t.textContent.trim().length>1).forEach(t=>{const r=document.createElement(e);t.after(r),r.appendChild(t)})}static html2dom(t){let e=document.createElement("template");return t=t.trim(),e.innerHTML=t,void 0===e.content?this.html2domLegacy(t):e.content.firstChild}static html2domLegacy(t){var e,r,n,i={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]},o=document,a=o.createDocumentFragment();if(/<|&#?\w+;/.test(t)){for(e=a.appendChild(o.createElement("div")),r=i[(/<([\w:]+)/.exec(t)||["",""])[1].toLowerCase()]||i._default,e.innerHTML=r[1]+t.replace(/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,"<$1></$2>")+r[2],n=r[0];n--;)e=e.lastChild;for(a.removeChild(a.firstChild);e.firstChild;)a.appendChild(e.firstChild)}else a.appendChild(o.createTextNode(t));return a.querySelector("*")}static prev(t,e){let r=t.previousElementSibling;return null===r?null:void 0===e||this.matches(r,e)?r:null}static next(t,e){let r=t.nextElementSibling;return null===r?null:void 0===e||this.matches(r,e)?r:null}static prevAll(t,e){let r=[];for(;t=t.previousElementSibling;)(void 0===e||this.matches(t,e))&&r.push(t);return r}static nextAll(t,e){let r=[];for(;t=t.nextElementSibling;)(void 0===e||this.matches(t,e))&&r.push(t);return r}static prevUntil(t,e){let r=[];for(;(t=t.previousElementSibling)&&!this.matches(t,e);)r.push(t);return r}static nextUntil(t,e){let r=[];for(;(t=t.nextElementSibling)&&!this.matches(t,e);)r.push(t);return r}static siblings(t,e){let r=[],n=t;for(t=t.parentNode.firstChild;t=t.nextElementSibling;)(void 0===e||this.matches(t,e))&&n!==t&&r.push(t);return r}static parents(t,e){let r=[],n=void 0!==e;for(;null!==(t=t.parentElement);)t.nodeType===Node.ELEMENT_NODE&&(n&&!this.matches(t,e)||r.push(t));return r}static css(t){let e=document.styleSheets,r={};for(let n in e)try{let i=e[n].rules||e[n].cssRules;for(let e in i)this.matches(t,i[e].selectorText)&&(r=Object.assign(r,this.css2json(i[e].style),this.css2json(t.getAttribute("style"))))}catch(t){}return r}static css2json(t){let e={};if(!t)return e;if(t instanceof CSSStyleDeclaration)for(let r in t)t[r].toLowerCase&&void 0!==t[t[r]]&&(e[t[r].toLowerCase()]=t[t[r]]);else if("string"==typeof t){t=t.split(";");for(let r in t)if(t[r].indexOf(":")>-1){let n=t[r].split(":");e[n[0].toLowerCase().trim()]=n[1].trim()}}return e}static compareDates(t,e){return"string"==typeof t&&(t=t.split(" ").join("T")),"string"==typeof e&&(e=e.split(" ").join("T")),t=new Date(t),e=new Date(e),t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()?0:t<e?-1:1}static spaceship(t,e){return null===t||null===e||typeof t!=typeof e?null:"string"==typeof t?t.localeCompare(e):t>e?1:t<e?-1:0}static querySelectorAllShadowDom(t){let e=function(t){let r=[];return null!==t.querySelector("*")&&t.querySelectorAll("*").forEach(t=>{r.push(t),void 0!==t.shadowRoot&&null!==t.shadowRoot&&(r=r.concat(e(t.shadowRoot)))}),r},r=document.createDocumentFragment();return e(document).forEach(e=>{e.matches(t)&&r.appendChild(e.cloneNode())}),r.childNodes}static focus(e){t.unfocus();let r=null;if(r="string"==typeof e||e instanceof String?document.querySelector(e):e,null!==r){let t=document.createElement("div");t.classList.add("hlp-focus-mask"),t.style.position="fixed",t.style.top="0",t.style.bottom="0",t.style.left="0",t.style.right="0",t.style.backgroundColor="rgba(0,0,0,0.8)",t.style.zIndex="2147483646",r.before(t),r.setAttribute("data-focussed","1"),r.setAttribute("data-focussed-orig-z-index",r.style.zIndex),r.setAttribute("data-focussed-orig-position",r.style.position),r.setAttribute("data-focussed-orig-background-color",r.style.backgroundColor),r.setAttribute("data-focussed-orig-box-shadow",r.style.boxShadow),r.style.zIndex="2147483647",r.style.position="relative",r.style.backgroundColor="#ffffff",r.style.boxShadow="0px 0px 0px 20px #fff"}}static unfocus(){null!==document.querySelector(".hlp-focus-mask")&&document.querySelectorAll(".hlp-focus-mask").forEach(e=>{t.remove(e)}),null!==document.querySelector("[data-focussed]")&&document.querySelectorAll("[data-focussed]").forEach(t=>{t.style.zIndex=t.getAttribute("data-focussed-orig-z-index"),t.style.position=t.getAttribute("data-focussed-orig-position"),t.style.backgroundColor=t.getAttribute("data-focussed-orig-background-color"),t.style.boxShadow=t.getAttribute("data-focussed-orig-box-shadow"),t.removeAttribute("data-focussed"),t.removeAttribute("data-focussed-orig-z-index"),t.removeAttribute("data-focussed-orig-position"),t.removeAttribute("data-focussed-orig-background-color"),t.removeAttribute("data-focussed-orig-box-shadow")})}static remove(t){null!==t&&t.parentNode.removeChild(t)}static on(e,r,n,i=null){null===i?(i=n,n=document):n=document.querySelector(n),n.addEventListener(e,e=>{var n=t.closest(e.target,r);n&&i(e,n)},!1)}static url(){return window.location.protocol+"//"+window.location.host+window.location.pathname}static urlWithHash(){return window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.hash}static fullUrl(){return window.location.href}static urlWithArgs(){return window.location.href.split("#")[0]}static baseUrl(){return window.location.protocol+"//"+window.location.host}static urlProtocol(){return window.location.protocol+"//"}static urlHost(){return window.location.host}static urlHostTopLevel(){let t=window.location.host;if(t.match(/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/))return t;for(t=t.split(".");t.length>2;)t.shift();return t=t.join("."),t}static urlPath(){return window.location.pathname}static urlHash(){return window.location.hash}static urlArgs(){return window.location.search}static urlOfScript(){if(document.currentScript)return document.currentScript.src;{let t=document.getElementsByTagName("script");return t[t.length-1].src}}static pathOfScript(){let t=this.urlOfScript();return t.substring(0,t.lastIndexOf("/"))}static waitUntil(t,e=null,r=null){return new Promise((n,i)=>{let o=setInterval(()=>{null!==document.querySelector(t)&&(null===e||null===r&&void 0!==window.getComputedStyle(document.querySelector(t))[e]&&""!=window.getComputedStyle(document.querySelector(t))[e]||null!==r&&window.getComputedStyle(document.querySelector(t))[e]===r)&&(window.clearInterval(o),n())},30)})}static waitUntilEach(t,e){new MutationObserver(()=>{let r=document.querySelectorAll(t);r.length>0&&r.forEach(t=>{t.__processed||(t.__processed=!0,e(t))})}).observe(document.body,{childList:!0,subtree:!0});let r=document.querySelectorAll(t);r.length>0&&r.forEach(t=>{t.__processed||(t.__processed=!0,e(t))})}static waitUntilVar(t=null,e=null,r=null){let n=null,i=null;return null===e?(n=t,i=window):(n=e,i=t),new Promise((t,e)=>{let o=setInterval(()=>{void 0!==i[n]&&null!==i[n]&&(null!==r&&i[n]!==r||(window.clearInterval(o),t()))},30)})}static ready(){return new Promise(t=>{if("loading"!==document.readyState)return t();document.addEventListener("DOMContentLoaded",()=>t())})}static load(){return new Promise(t=>{if("complete"===document.readyState)return t();window.addEventListener("load",()=>t())})}static runForEl(e,r){t.ready().then(()=>{let n=t.pushId();null!==document.querySelector(e)&&document.querySelectorAll(e).forEach(t=>{void 0===t.runForEl&&(t.runForEl=[]),t.runForEl.includes(n)||(t.runForEl.push(n),r(t))}),void 0===window.runForEl_queue&&(window.runForEl_queue=[]),void 0===window.runForEl_observer&&(window.runForEl_observer=new MutationObserver(t=>{t.forEach(t=>{if(t.addedNodes)for(let e=0;e<t.addedNodes.length;e++){let r=t.addedNodes[e];r.nodeType===Node.ELEMENT_NODE&&window.runForEl_queue.forEach(t=>{r.matches(t.selector)&&(void 0===r.runForEl&&(r.runForEl=[]),r.runForEl.includes(t.id)||(r.runForEl.push(t.id),t.callback(r))),null!==r.querySelector(t.selector)&&r.querySelectorAll(t.selector).forEach(e=>{void 0===e.runForEl&&(e.runForEl=[]),e.runForEl.includes(t.id)||(e.runForEl.push(t.id),t.callback(e))})})}})}).observe(document.body,{attributes:!1,childList:!0,characterData:!1,subtree:!0,attributeOldValue:!1,characterDataOldValue:!1})),window.runForEl_queue.push({id:n,selector:e,callback:r})})}static fmath(t,e,r,n=8){let i={"*":e*r,"-":e-r,"+":e+r,"/":e/r}[t];return Math.round(10*i*Math.pow(10,n))/(10*Math.pow(10,n))}static trim(t,e=null){let r=[" ","\n","\r","\t","\f","\v"," "," "," "," "," "," "," "," "," "," "," "," ","","\u2028","\u2029"," "].join(""),n=0,i=0;for(t+="",e&&(r=(e+"").replace(/([[\]().?/*{}+$^:])/g,"$1")),n=t.length,i=0;i<n;i++)if(-1===r.indexOf(t.charAt(i))){t=t.substring(i);break}for(n=t.length,i=n-1;i>=0;i--)if(-1===r.indexOf(t.charAt(i))){t=t.substring(0,i+1);break}return-1===r.indexOf(t.charAt(0))?t:""}static ltrim(t,e=null){e=e?(e+"").replace(/([[\]().?/*{}+$^:])/g,"$1"):" \\s ";const r=new RegExp("^["+e+"]+","g");return(t+"").replace(r,"")}static rtrim(t,e=null){e=e?(e+"").replace(/([[\]().?/*{}+$^:])/g,"\\$1"):" \\s ";const r=new RegExp("["+e+"]+$","g");return(t+"").replace(r,"")}static truncate_string(e,r=50,n="..."){if(this.nx(e)||!("string"==typeof e||e instanceof String))return e;if(-1===e.indexOf(" "))e.length>r&&(e=e.substring(0,r),e=t.rtrim(e),e+=" "+n);else if(e.length>r){for(e=t.rtrim(e);e.length>r&&e.lastIndexOf(" ")>-1&&" "!=e.substring(r-1,r);)e=e.substring(0,e.lastIndexOf(" ")),e=t.rtrim(e);e=e.substring(0,r),e=t.rtrim(e),e+=" "+n}return e}static emojiRegex(e=!0){return new RegExp(t.emojiRegexPattern(),(!0===e?"g":"")+"u")}static emojiRegexPattern(){return String.raw`\p{RI}\p{RI}|\p{Extended_Pictographic}(\p{EMod}|\uFE0F\u20E3?|[\u{E0020}-\u{E007E}]+\u{E007F})?(\u200D(\p{RI}\p{RI}|\p{Extended_Pictographic}(\p{EMod}|\uFE0F\u20E3?|[\u{E0020}-\u{E007E}]+\u{E007F})?))*`}static emojiSplit(t){return"string"==typeof t||t instanceof String?[...(new Intl.Segmenter).segment(t)].map(t=>t.segment):t}static serialize(t){let e,r,n,i="",o="",a=0;const s=function(t){let e,r,n,i,o=typeof t;if("object"===o&&!t)return"null";if("object"===o){if(!t.constructor)return"object";for(r in n=t.constructor.toString(),e=n.match(/(\w+)\(/),e&&(n=e[1].toLowerCase()),i=["boolean","number","string","array"],i)if(n===i[r]){o=i[r];break}}return o},l=s(t);switch(l){case"function":e="";break;case"boolean":e="b:"+(t?"1":"0");break;case"number":e=(Math.round(t)===t?"i":"d")+":"+t;break;case"string":e="s:"+(~-encodeURI(t).split(/%..|./).length+':"')+t+'"';break;case"array":case"object":for(r in e="a",t)if(t.hasOwnProperty(r)){if(i=s(t[r]),"function"===i)continue;n=r.match(/^[0-9]+$/)?parseInt(r,10):r,o+=this.serialize(n)+this.serialize(t[r]),a++}e+=":"+a+":{"+o+"}";break;default:e="N"}return"object"!==l&&"array"!==l&&(e+=";"),e}static unserialize(t){try{if("string"!=typeof t)return!1;const e=[],r=t=>(e.push(t[0]),t);r.get=t=>{if(t>=e.length)throw RangeError(`Can't resolve reference ${t+1}`);return e[t]};const n=t=>{const e=(/^(?:N(?=;)|[bidsSaOCrR](?=:)|[^:]+(?=:))/g.exec(t)||[])[0];if(!e)throw SyntaxError("Invalid input: "+t);switch(e){case"N":return r([null,2]);case"b":return r(i(t));case"i":return r(o(t));case"d":return r(a(t));case"s":return r(s(t));case"S":return r(l(t));case"a":return u(t);case"O":return d(t);case"C":throw Error("Not yet implemented");case"r":case"R":return c(t);default:throw SyntaxError(`Invalid or unsupported data type: ${e}`)}},i=t=>{const[e,r]=/^b:([01]);/.exec(t)||[];if(!r)throw SyntaxError("Invalid bool value, expected 0 or 1");return["1"===r,e.length]},o=t=>{const[e,r]=/^i:([+-]?\d+);/.exec(t)||[];if(!r)throw SyntaxError("Expected an integer value");return[parseInt(r,10),e.length]},a=t=>{const[e,r]=/^d:(NAN|-?INF|(?:\d+\.\d*|\d*\.\d+|\d+)(?:[eE][+-]\d+)?);/.exec(t)||[];if(!r)throw SyntaxError("Expected a float value");return["NAN"===r?NaN:"-INF"===r?Number.NEGATIVE_INFINITY:"INF"===r?Number.POSITIVE_INFINITY:parseFloat(r),e.length]},s=t=>{const[e,r]=/^s:(\d+):"/g.exec(t)||[];if(!e)throw SyntaxError("Expected a string value");const n=parseInt(r,10),i=(t=t.substr(e.length)).substr(0,n);if(!(t=t.substr(n)).startsWith('";'))throw SyntaxError('Expected ";');return[i,e.length+n+2]},l=t=>{const[e,r]=/^S:(\d+):"/g.exec(t)||[];if(!e)throw SyntaxError("Expected an escaped string value");const n=parseInt(r,10),i=(t=t.substr(e.length)).substr(0,n);if(!(t=t.substr(n)).startsWith('";'))throw SyntaxError('Expected ";');return[i,e.length+n+2]},c=t=>{const[e,n]=/^[rR]:(\d+);/.exec(t)||[];if(!e)throw SyntaxError("Expected reference value");return[r.get(parseInt(n,10)-1),e.length]},u=t=>{const[e,i]=/^a:(\d+):\{/.exec(t)||[];if(!i)throw SyntaxError("Expected array length annotation");t=t.substr(e.length);const o={};r([o]);for(let e=0;e<parseInt(i,10);e++){const e=n(t);t=t.substr(e[1]);const r=n(t);t=t.substr(r[1]),o[e[0]]=r[0]}if("}"!==t.charAt(0))throw SyntaxError("Expected }");return[o,e.length+1]},d=t=>{const[e,,i,o]=/^O:(\d+):"([^\"]+)":(\d+):\{/.exec(t)||[];if(!e)throw SyntaxError("Invalid input");if("stdClass"!==i)throw SyntaxError(`Unsupported object type: ${i}`);let a={};r([a]),t=t.substr(e.length);for(let e=0;e<parseInt(o,10);e++){const e=n(t);t=t.substr(e[1]);const r=n(t);t=t.substr(r[1]),a[e[0]]=r[0]}if("}"!==t.charAt(0))throw SyntaxError("Expected }");return[a,e.length+1]};return n(t)[0]}catch(t){return console.error(t),!1}}static pushId(){let e=null;void 0!==window&&(void 0===window.pushIdDataGlobal&&(window.pushIdDataGlobal={}),e=window.pushIdDataGlobal),"undefined"!=typeof global&&(void 0===global.pushIdDataGlobal&&(global.pushIdDataGlobal={}),e=global.pushIdDataGlobal),t.objectsAreEqual(e,{})&&(e.lastPushTime=0,e.lastRandChars=[],e.PUSH_CHARS="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz");let r=(new Date).getTime(),n=r===e.lastPushTime;e.lastPushTime=r;let i=new Array(8);for(var o=7;o>=0;o--)i[o]=e.PUSH_CHARS.charAt(r%64),r=Math.floor(r/64);if(0!==r)throw new Error;let a=i.join("");if(n){for(o=11;o>=0&&63===e.lastRandChars[o];o--)e.lastRandChars[o]=0;e.lastRandChars[o]++}else for(o=0;o<12;o++)e.lastRandChars[o]=Math.floor(64*Math.random());for(o=0;o<12;o++)a+=e.PUSH_CHARS.charAt(e.lastRandChars[o]);if(20!=a.length)throw new Error;return a}static getProp(t,e){let r=e.split(".");for(;r.length&&(t=t[r.shift()]););return t}static base64toblob(t,e=""){let r=atob(t),n=[];for(let t=0;t<r.length;t+=512){let e=r.slice(t,t+512),i=new Array(e.length);for(let t=0;t<e.length;t++)i[t]=e.charCodeAt(t);let o=new Uint8Array(i);n.push(o)}return new Blob(n,{type:e})}static blobtobase64(t){return new Promise(e=>{let r=new FileReader;r.onload=()=>{var t=r.result.split(",")[1];e(t)},r.readAsDataURL(t)})}static stringtoblob(t,e=""){return new Blob([t],{type:e})}static blobtostring(t){return new Promise(e=>{let r=new FileReader;r.onload=()=>{e(r.result)},r.readAsText(t)})}static filetobase64(t){return new Promise((e,r)=>{const n=new FileReader;n.readAsDataURL(t),n.onload=()=>e(n.result.split(",")[1]),n.onerror=t=>r(t)})}static blobtofile(t,e="file.txt"){let r=null;try{r=new File([t],e)}catch{r=new Blob([t],e)}return r}static filetoblob(t){return new Blob([t])}static base64tofile(t,e="",r="file.txt"){return this.blobtofile(this.base64toblob(t,e),r)}static blobtourl(t){return URL.createObjectURL(t)}static stringtourl(t){return this.blobtourl(this.stringtoblob(t))}static base64tostring(t){return atob(t)}static stringtobase64(t){return btoa(t)}static base64tourl(t){return this.blobtourl(this.base64toblob(t))}static filetourl(t){return this.blobtourl(this.filetoblob(t))}static getImageOrientation(t){return new Promise((e,r)=>{t=t.replace("data:image/jpeg;base64,","");let n=this.base64tofile(t),i=new FileReader;i.onload=t=>{var r=new DataView(t.target.result);if(65496==r.getUint16(0,!1)){for(var n=r.byteLength,i=2;i<n;){if(r.getUint16(i+2,!1)<=8)return void e(-1);var o=r.getUint16(i,!1);if(i+=2,65505==o){if(1165519206!=r.getUint32(i+=2,!1))return void e(-1);var a=18761==r.getUint16(i+=6,!1);i+=r.getUint32(i+4,a);var s=r.getUint16(i,a);i+=2;for(var l=0;l<s;l++)if(274==r.getUint16(i+12*l,a))return void e(r.getUint16(i+12*l+8,a))}else{if(65280&~o)break;i+=r.getUint16(i,!1)}}e(-1)}else e(-2)},i.readAsArrayBuffer(n)})}static resetImageOrientation(t,e){return new Promise((r,n)=>{var i=new Image;i.onload=()=>{var t=i.width,n=i.height,o=document.createElement("canvas"),a=o.getContext("2d");switch(4<e&&e<9?(o.width=n,o.height=t):(o.width=t,o.height=n),e){case 2:a.transform(-1,0,0,1,t,0);break;case 3:a.transform(-1,0,0,-1,t,n);break;case 4:a.transform(1,0,0,-1,0,n);break;case 5:a.transform(0,1,1,0,0,0);break;case 6:a.transform(0,1,-1,0,n,0);break;case 7:a.transform(0,-1,-1,0,n,t);break;case 8:a.transform(0,-1,1,0,0,t)}a.drawImage(i,0,0);let s=o.toDataURL();s="data:image/jpeg;base64,"+s.split(",")[1],r(s)},i.src=t})}static fixImageOrientation(t){return new Promise((e,r)=>{-1!==t.indexOf("data:")?(0===t.indexOf("data:image/jpeg;base64,")&&(t=t.replace("data:image/jpeg;base64,","")),this.getImageOrientation(t).then(r=>{t="data:image/jpeg;base64,"+t,r<=1?e(t):this.resetImageOrientation(t,r).then(t=>{e(t)})})):e(t)})}static debounce(t,e,r){var n;return function(){var i=this,o=arguments,a=r&&!n;clearTimeout(n),n=setTimeout(function(){n=null,r||t.apply(i,o)},e),a&&t.apply(i,o)}}static throttle(t,e,r){var n,i,o,a=null,s=0;r||(r={});var l=function(){s=!1===r.leading?0:Date.now(),a=null,o=t.apply(n,i),a||(n=i=null)};return function(){var c=Date.now();s||!1!==r.leading||(s=c);var u=e-(c-s);return n=this,i=arguments,u<=0||u>e?(a&&(clearTimeout(a),a=null),s=c,o=t.apply(n,i),a||(n=i=null)):a||!1===r.trailing||(a=setTimeout(l,u)),o}}static shuffle(t){let e,r,n=t.length;for(;0!==n;)r=Math.floor(Math.random()*n),n-=1,e=t[n],t[n]=t[r],t[r]=e;return t}static findRecursiveInObject(t,e=null,r=null,n="",i=[]){if(null!==t&&"object"==typeof t)for(const[o,a]of Object.entries(t))if(null!==a&&"object"==typeof a)this.findRecursiveInObject(a,e,r,(""===n?"":n+".")+o,i);else if(!(null!==e&&o!==e||null!==r&&a!==r)){i.push(n);break}return i}};return"undefined"!=typeof window&&(window.hlp={},Object.getOwnPropertyNames(t).forEach((e,r)=>{"length"!==e&&"name"!==e&&"prototype"!==e&&"caller"!==e&&"arguments"!==e&&(window.hlp[e]=t[e])})),t}();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hlp",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.1",
|
|
4
4
|
"main": "_js/_build/script.js",
|
|
5
5
|
"module": "hlp.esm.js",
|
|
6
6
|
"exports": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@babel/plugin-proposal-private-methods": "^7.18.6",
|
|
44
44
|
"@babel/plugin-transform-runtime": "^7.29.0",
|
|
45
45
|
"@babel/polyfill": "^7.12.1",
|
|
46
|
-
"@babel/preset-env": "^7.29.
|
|
46
|
+
"@babel/preset-env": "^7.29.5",
|
|
47
47
|
"@babel/preset-react": "^7.28.5",
|
|
48
48
|
"@babel/preset-typescript": "^7.28.5",
|
|
49
49
|
"@prettier/plugin-php": "^0.25.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"babel-runtime": "^6.26.0",
|
|
56
56
|
"babelify": "^10.0.0",
|
|
57
57
|
"browser-sync": "^3.0.4",
|
|
58
|
-
"caniuse-lite": "^1.0.
|
|
58
|
+
"caniuse-lite": "^1.0.30001793",
|
|
59
59
|
"cli-error-notifier": "^3.0.2",
|
|
60
60
|
"concat": "^1.0.3",
|
|
61
61
|
"core-js": "^3.49.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"dotenv": "^17.4.2",
|
|
65
65
|
"element-closest": "^3.0.2",
|
|
66
66
|
"env-cmd": "^11.0.0",
|
|
67
|
-
"eslint": "^10.
|
|
67
|
+
"eslint": "^10.4.0",
|
|
68
68
|
"exit": "^0.1.2",
|
|
69
69
|
"from-env": "^1.1.4",
|
|
70
70
|
"highlight.js": "^11.11.1",
|
|
@@ -76,25 +76,25 @@
|
|
|
76
76
|
"mdn-polyfills": "^5.20.0",
|
|
77
77
|
"move-file-cli": "^3.0.0",
|
|
78
78
|
"ncp": "^2.0.0",
|
|
79
|
-
"npm-check-updates": "^
|
|
79
|
+
"npm-check-updates": "^22.2.0",
|
|
80
80
|
"npm-run-all2": "^8.0.4",
|
|
81
81
|
"onchange": "^7.1.0",
|
|
82
|
-
"postcss": "^8.5.
|
|
82
|
+
"postcss": "^8.5.15",
|
|
83
83
|
"postcss-cli": "^11.0.1",
|
|
84
84
|
"postcss-tailwind-data-attr": "^1.0.7",
|
|
85
85
|
"prettier": "^3.8.3",
|
|
86
|
-
"puppeteer": "^24.
|
|
86
|
+
"puppeteer": "^24.43.1",
|
|
87
87
|
"regenerator-runtime": "^0.14.1",
|
|
88
88
|
"replace-in-file": "^8.4.0",
|
|
89
89
|
"rimraf": "^6.1.3",
|
|
90
90
|
"run-sequence": "^2.2.1",
|
|
91
|
-
"sass": "^1.
|
|
92
|
-
"tailwindcss": "^4.
|
|
93
|
-
"terser": "^5.
|
|
91
|
+
"sass": "^1.100.0",
|
|
92
|
+
"tailwindcss": "^4.3.0",
|
|
93
|
+
"terser": "^5.48.0",
|
|
94
94
|
"typescript": "^6.0.3",
|
|
95
95
|
"vinyl-buffer": "^1.0.1",
|
|
96
96
|
"vinyl-source-stream": "^2.0.0",
|
|
97
|
-
"vite": "^8.0.
|
|
97
|
+
"vite": "^8.0.14",
|
|
98
98
|
"whatwg-fetch": "^3.6.20"
|
|
99
99
|
},
|
|
100
100
|
"browserslist": [
|