hlp 3.5.7 → 3.5.9

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/README.md CHANGED
@@ -1,35 +1,10 @@
1
1
  [![build status](https://github.com/vielhuber/hlp/actions/workflows/ci.yml/badge.svg)](https://github.com/vielhuber/hlp/actions)
2
2
 
3
- ## motivation
4
- tired of writing
5
-
6
- ```js
7
- if( Object.keys(obj).length === 0 && obj.constructor === Object )
8
- {
9
-
10
- }
11
- ```
12
-
13
- or
14
-
15
- ```js
16
- if (typeof arr !== 'undefined' && arr.length > 0)
17
- {
18
-
19
- }
20
- ```
3
+ # ⛏️ hlp ⛏️
21
4
 
22
- or
23
-
24
- ```js
25
- for(const [obj__key, obj__value] of Object.entries(obj))
26
- {
27
-
28
- }
29
- ```
30
-
31
- ?
5
+ ## motivation
32
6
 
7
+ hlp is a lightweight javascript utility library that provides essential helpers for everyday coding tasks. it offers intuitive methods for variable existence checks, type validation, string manipulation, date operations, and more. designed with simplicity in mind, hlp eliminates boilerplate code and makes common programming patterns more concise and readable, allowing developers to focus on building features rather than writing repetitive utility code.
33
8
 
34
9
  ## installation
35
10
 
@@ -50,81 +25,13 @@ or embed it directly:
50
25
 
51
26
  ## usage
52
27
 
53
- ### existence
54
28
  ```js
55
29
  // check existence
56
- if( hlp.x(vrbl) )
57
- {
58
-
59
- }
30
+ if( hlp.x(vrbl) ) { }
60
31
 
61
32
  // check non-existence
62
- if( hlp.nx(vrbl) )
63
- {
64
-
65
- }
66
- ```
67
-
68
- ### equality
69
- ```js
70
- // js has a lot of pitfalls, when comparing loosely
71
- if( '' == [] ) // true
72
- if( '' == [''] ) // true
73
- if( '' == 0 ) // true
74
- if( ' ' == false ) // true
75
- if( [0] == false ) // true
76
- if( [0] == '0' ) // true
77
- if( [] == false ) // true
78
- if( [''] == false ) // true
79
- if( 0 == false ) // true
80
- if( 0 == [] ) // true
81
- if( 0 == [''] ) // true
82
- if( [0] == false ) // true
83
- if( [0] == 0 ) // true
33
+ if( hlp.nx(vrbl) ) {}
84
34
 
85
- // also don't forget those delicacies
86
- 0 === -0 // true
87
- NaN === NaN // false
88
- (![]+[])[+[]]+(![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]] === 'fail' // true
89
-
90
- // this non-strict equality is symmetric, but not transitive
91
- a = ''; b = 0; c = [0];
92
- a == b; // true
93
- b == c; // true
94
- c == a; // false
95
-
96
- // to overcome this issue, we...
97
-
98
- // ...use strict comparison when possible
99
- if( vrbl === 'foo' )
100
- {
101
-
102
- }
103
-
104
- // ...use loose comparison when appropriate
105
- if( hlp.getParam('number') == 1337 )
106
- {
107
-
108
- }
109
-
110
- // ...check for truthness / falsiness with these helper methods
111
- if( hlp.true(vrbl) )
112
- {
113
-
114
- }
115
-
116
- if( hlp.false(vrbl) )
117
- {
118
-
119
- }
120
-
121
- // be aware, that hlp.true is not always the logic negation of hlp.false
122
- hlp.true(null) // false
123
- hlp.false(null) // false
124
- ```
125
-
126
- ### value
127
- ```js
128
35
  // get variable if exists, otherwise ''
129
36
  hlp.v( vrbl )
130
37
 
@@ -133,53 +40,15 @@ hlp.v( vrbl, 'default' )
133
40
 
134
41
  // get first variable that exists, otherwise ''
135
42
  hlp.v( vrbl1, vrbl2, vrbl3 )
136
- ```
137
43
 
138
- ### loop
139
- ```js
140
44
  // loop over arrays/objects only if possible
141
- hlp.loop(['foo','bar','baz'], (vrbl__value) =>
142
- {
143
-
144
- });
145
- hlp.loop(['foo','bar','baz'], (vrbl__value, vrbl__key) =>
146
- {
147
-
148
- });
149
- hlp.loop({bar: 'foo', baz: 'bar', foo: 'baz'}, (vrbl__value, vrbl__key) =>
150
- {
151
-
152
- });
45
+ hlp.loop(['foo','bar','baz'], (vrbl__value) => {});
46
+ hlp.loop(['foo','bar','baz'], (vrbl__value, vrbl__key) => {});
47
+ hlp.loop({bar: 'foo', baz: 'bar', foo: 'baz'}, (vrbl__value, vrbl__key) => {});
153
48
  hlp.loop([], (vrbl__value, vrbl__key) => { }) // does nothing
154
49
  hlp.loop({}, (vrbl__value, vrbl__key) => { }) // does nothing
155
50
  hlp.loop(null, (vrbl__value, vrbl__key) => { }) // does nothing
156
- ```
157
-
158
-
159
- ### try
160
51
 
161
- ```js
162
- // if you are unsure, if a variable is even set before checking its existence,
163
- // simply put it inside this helper function
164
- if( hlp.x(() => vrbl) )
165
- if( hlp.nx(() => vrbl) )
166
- if( hlp.true(() => vrbl) )
167
- if( hlp.false(() => vrbl) )
168
- if( hlp.v(() => vrbl) === 'foo' )
169
- if( hlp.v(() => vrbl) == 1337 )
170
- echo hlp.v(() => vrbl)
171
- hlp.loop((() => vrbl), (vrbl__value, vrbl__key) => { })
172
-
173
- ```
174
- that works because javascript only evaluates the content of the inner callback (or closure) when it is actually executed.
175
-
176
-
177
-
178
- ### helpers
179
-
180
- there are also some other neat little helpers available:
181
-
182
- ```js
183
52
  // capitalize
184
53
  hlp.capitalize('foo') // Foo
185
54
 
@@ -467,7 +336,7 @@ hlp.getProp({
467
336
  }, 'c.a.a') // 7
468
337
  ```
469
338
 
470
- check out also the following helpers for the frontend:
339
+ ### frontend
471
340
 
472
341
  ```js
473
342
  // cookies
@@ -729,12 +598,83 @@ hlp.animate(
729
598
  ).then(() => { console.log('done'); });
730
599
  ```
731
600
 
601
+ ## notes
602
+
603
+ ### alternative safe patterns
604
+
605
+ ```js
606
+ if( Object.keys(obj).length === 0 && obj.constructor === Object ) {}
607
+ if (typeof arr !== 'undefined' && arr.length > 0) {}
608
+ for(const [obj__key, obj__value] of Object.entries(obj)) {}
609
+ ```
610
+
611
+ ### equality
612
+
613
+ ```js
614
+ // js has a lot of pitfalls, when comparing loosely
615
+ if( '' == [] ) // true
616
+ if( '' == [''] ) // true
617
+ if( '' == 0 ) // true
618
+ if( ' ' == false ) // true
619
+ if( [0] == false ) // true
620
+ if( [0] == '0' ) // true
621
+ if( [] == false ) // true
622
+ if( [''] == false ) // true
623
+ if( 0 == false ) // true
624
+ if( 0 == [] ) // true
625
+ if( 0 == [''] ) // true
626
+ if( [0] == false ) // true
627
+ if( [0] == 0 ) // true
628
+
629
+ // also don't forget those delicacies
630
+ 0 === -0 // true
631
+ NaN === NaN // false
632
+ (![]+[])[+[]]+(![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]] === 'fail' // true
633
+
634
+ // this non-strict equality is symmetric, but not transitive
635
+ a = ''; b = 0; c = [0];
636
+ a == b; // true
637
+ b == c; // true
638
+ c == a; // false
639
+
640
+ // to overcome this issue, we...
641
+
642
+ // ...use strict comparison when possible
643
+ if( vrbl === 'foo' ) {}
644
+
645
+ // ...use loose comparison when appropriate
646
+ if( hlp.getParam('number') == 1337 ) {}
647
+
648
+ // ...check for truthness / falsiness with these helper methods
649
+ if( hlp.true(vrbl) ) {}
650
+
651
+ if( hlp.false(vrbl) ) {}
652
+
653
+ // be aware, that hlp.true is not always the logic negation of hlp.false
654
+ hlp.true(null) // false
655
+ hlp.false(null) // false
656
+ ```
657
+
658
+ ### try
659
+
660
+ ```js
661
+ // if you are unsure, if a variable is even set before checking its existence,
662
+ // simply put it inside this helper function
663
+ if( hlp.x(() => vrbl) )
664
+ if( hlp.nx(() => vrbl) )
665
+ if( hlp.true(() => vrbl) )
666
+ if( hlp.false(() => vrbl) )
667
+ if( hlp.v(() => vrbl) === 'foo' )
668
+ if( hlp.v(() => vrbl) == 1337 )
669
+ echo hlp.v(() => vrbl)
670
+ // that works because javascript only evaluates the content of the inner callback (or closure) when it is actually executed.
671
+ hlp.loop((() => vrbl), (vrbl__value, vrbl__key) => { })
672
+ ```
732
673
 
733
674
  ## php implementation
734
675
 
735
676
  there is also a php implemenation [stringhelper](https://github.com/vielhuber/stringhelper) with similiar functions available.
736
677
 
737
-
738
678
  ## appendix
739
679
 
740
680
  ### existence matrix
@@ -1,9 +1,12 @@
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 _templateObject;
7
10
  class hlp {
8
11
  static x(input) {
9
12
  if (typeof input === 'function') {
@@ -1131,17 +1134,7 @@ class hlp {
1131
1134
  }
1132
1135
  static async cursorPosition() {
1133
1136
  // https://stackoverflow.com/a/43326327/2068362
1134
- document.head.insertAdjacentHTML('afterbegin', `
1135
- <style type="text/css">
1136
- .find-pointer-quad {
1137
- --hit: 0;
1138
- position: fixed;
1139
- z-index:2147483647;
1140
- transform: translateZ(0);
1141
- &:hover { --hit: 1; }
1142
- }
1143
- </style>
1144
- `);
1137
+ 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 ");
1145
1138
  window.cursorPositionDelay = 50;
1146
1139
  window.cursorPositionQuads = [];
1147
1140
  let dim = 10;
@@ -1151,9 +1144,9 @@ class hlp {
1151
1144
  let {
1152
1145
  style
1153
1146
  } = a;
1154
- style.top = pos < 2 ? 0 : `${dim}%`;
1155
- style.left = pos % 2 === 0 ? 0 : `${dim}%`;
1156
- style.width = style.height = `${dim}%`;
1147
+ style.top = pos < 2 ? 0 : "".concat(dim, "%");
1148
+ style.left = pos % 2 === 0 ? 0 : "".concat(dim, "%");
1149
+ style.width = style.height = "".concat(dim, "%");
1157
1150
  document.body.appendChild(a);
1158
1151
  return a;
1159
1152
  };
@@ -1164,8 +1157,8 @@ class hlp {
1164
1157
  let hit;
1165
1158
  window.cursorPositionQuads.some(a => {
1166
1159
  let style = getComputedStyle(a);
1167
- let result = style.getPropertyValue(`--hit`);
1168
- if (result === `1`) return hit = {
1160
+ let result = style.getPropertyValue("--hit");
1161
+ if (result === "1") return hit = {
1169
1162
  style,
1170
1163
  a
1171
1164
  };
@@ -1180,14 +1173,14 @@ class hlp {
1180
1173
  style
1181
1174
  } = _ref6;
1182
1175
  if (reset) {
1183
- style.top = pos < 2 ? 0 : `${dim}%`;
1184
- style.left = pos % 2 === 0 ? 0 : `${dim}%`;
1185
- style.width = style.height = `${dim}%`;
1176
+ style.top = pos < 2 ? 0 : "".concat(dim, "%");
1177
+ style.left = pos % 2 === 0 ? 0 : "".concat(dim, "%");
1178
+ style.width = style.height = "".concat(dim, "%");
1186
1179
  } else {
1187
- style.top = pos < 2 ? `${top}%` : `${top + dim}%`;
1188
- style.left = pos % 2 === 0 ? `${left}%` : `${left + dim}%`;
1189
- style.width = `${dim}%`;
1190
- style.height = `${dim}%`;
1180
+ style.top = pos < 2 ? "".concat(top, "%") : "".concat(top + dim, "%");
1181
+ style.left = pos % 2 === 0 ? "".concat(left, "%") : "".concat(left + dim, "%");
1182
+ style.width = "".concat(dim, "%");
1183
+ style.height = "".concat(dim, "%");
1191
1184
  }
1192
1185
  });
1193
1186
  return new Promise(resolve => {
@@ -1218,10 +1211,10 @@ class hlp {
1218
1211
  let {
1219
1212
  style
1220
1213
  } = _ref7;
1221
- style.top = pos < 2 ? oy : `${nextStep + parseFloat(oy)}%`;
1222
- style.left = pos % 2 === 0 ? ox : `${nextStep + parseFloat(ox)}%`;
1223
- style.width = `${nextStep}%`;
1224
- style.height = `${nextStep}%`;
1214
+ style.top = pos < 2 ? oy : "".concat(nextStep + parseFloat(oy), "%");
1215
+ style.left = pos % 2 === 0 ? ox : "".concat(nextStep + parseFloat(ox), "%");
1216
+ style.width = "".concat(nextStep, "%");
1217
+ style.height = "".concat(nextStep, "%");
1225
1218
  });
1226
1219
  return new Promise(resolve => {
1227
1220
  setTimeout(() => resolve(this.cursorPositionBisect(nextStep)), window.cursorPositionDelay);
@@ -1414,7 +1407,7 @@ class hlp {
1414
1407
  // apply trick from https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
1415
1408
  let fn = () => {
1416
1409
  let vh = window.innerHeight * 0.01;
1417
- document.documentElement.style.setProperty('--vh', `${vh}px`);
1410
+ document.documentElement.style.setProperty('--vh', "".concat(vh, "px"));
1418
1411
  };
1419
1412
  fn();
1420
1413
  window.addEventListener('resize', () => {
@@ -2218,7 +2211,7 @@ class hlp {
2218
2211
  return new RegExp(hlp.emojiRegexPattern(), (global === true ? 'g' : '') + 'u');
2219
2212
  }
2220
2213
  static emojiRegexPattern() {
2221
- 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})?))*`;
2214
+ 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})?))*"])));
2222
2215
  }
2223
2216
  static emojiSplit(str) {
2224
2217
  if (!(typeof str === 'string' || str instanceof String)) {
@@ -2314,7 +2307,7 @@ class hlp {
2314
2307
  };
2315
2308
  cache.get = index => {
2316
2309
  if (index >= store.length) {
2317
- throw RangeError(`Can't resolve reference ${index + 1}`);
2310
+ throw RangeError("Can't resolve reference ".concat(index + 1));
2318
2311
  }
2319
2312
  return store[index];
2320
2313
  };
@@ -2345,7 +2338,7 @@ class hlp {
2345
2338
  case 'R':
2346
2339
  return expectReference(s);
2347
2340
  default:
2348
- throw SyntaxError(`Invalid or unsupported data type: ${type}`);
2341
+ throw SyntaxError("Invalid or unsupported data type: ".concat(type));
2349
2342
  }
2350
2343
  };
2351
2344
  const expectBool = s => {
@@ -2415,7 +2408,7 @@ class hlp {
2415
2408
  const reObjectLiteral = /^O:(\d+):"([^\"]+)":(\d+):\{/;
2416
2409
  const [match,, className, propCountMatch] = reObjectLiteral.exec(s) || [];
2417
2410
  if (!match) throw SyntaxError('Invalid input');
2418
- if (className !== 'stdClass') throw SyntaxError(`Unsupported object type: ${className}`);
2411
+ if (className !== 'stdClass') throw SyntaxError("Unsupported object type: ".concat(className));
2419
2412
  let obj = {};
2420
2413
  cache([obj]);
2421
2414
  s = s.substr(match.length);
@@ -2552,7 +2545,7 @@ class hlp {
2552
2545
  let file = null;
2553
2546
  try {
2554
2547
  file = new File([blob], filename);
2555
- } catch {
2548
+ } catch (_unused) {
2556
2549
  // ie 11
2557
2550
  file = new Blob([blob], filename);
2558
2551
  }
package/hlp.js CHANGED
@@ -1 +1 @@
1
- !function t(e,r,n){function i(a,s){if(!r[a]){if(!e[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[a]={exports:{}};e[a][0].call(u.exports,(function(t){return i(e[a][1][t]||t)}),u,u.exports,t,e,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a<n.length;a++)i(n[a]);return i}({1:[function(t,e,r){(function(t){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;class e{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(t){if("function"==typeof t)try{return t=t(),this.true(t)}catch(t){return!1}return void 0!==t&&(null!==t&&(!1!==t&&((!Array.isArray(t)||0!==t.length)&&((!Array.isArray(t)||""!==e.first(t))&&(("object"!=typeof t||0!==Object.keys(t).length||t.constructor!==Object)&&(0!==t&&("0"!==t&&(""!==t&&(" "!==t&&("null"!==t&&"false"!==t))))))))))}static false(t){if("function"==typeof t)try{return t=t(),this.false(t)}catch(t){return!1}return void 0!==t&&(null!==t&&(!1===t||(!Array.isArray(t)||0!==t.length)&&((!Array.isArray(t)||""!==e.first(t))&&(("object"!=typeof t||0!==Object.keys(t).length||t.constructor!==Object)&&(0===t||("0"===t||""!==t&&(" "!==t&&("null"!==t&&"false"===t))))))))}static v(){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=>{let[r,n]=t;e(n,r)}))}static map(t,e,r){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=>{let[r,n]=t;null===e&&(e=n)})),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=>{let[r,n]=t;e=n})),e}return null}static rand(t){return Array.isArray(t)?t[Math.floor(Math.random()*t.length)]:"object"==typeof t?(t=Object.values(t))[Math.floor(Math.random()*t.length)]:null}static random_string(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:99999;return!(!this.isInteger(t)||!this.isInteger(e))&&(t>e&&([t,e]=[e,t]),~~(Math.random()*(e-t+1))+t)}static capitalize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]: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){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],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){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],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){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]: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 isMac(){return"mac"===e.getOs()}static isLinux(){return"linux"===e.getOs()}static isWindows(){return"windows"===e.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){return!!t&&t.constructor===Object}static isArray(t){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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["a-z","A-Z","0-9","$!?"],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:",";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,l="";return l=(o?function(t,e){var r=Math.pow(10,e);return""+Math.round(t*r)/r}(i,o):""+Math.round(i)).split("."),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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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 p=0===l?12:l;r+=p>12?p-12:p;break;case"h":p=0===l?12:l,p=p>12?p-12:p,r+=p<10?"0"+p:p;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(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap;if(Object(t)!==t)return t;if(r.has(t))return r.get(t);const n=t instanceof Date?new Date(t):t instanceof RegExp?new RegExp(t.source,t.flags):t.constructor?new t.constructor:Object.create(null);return r.set(t,n),t instanceof Map&&Array.from(t,(t=>{let[i,o]=t;return n.set(i,e.deepCopy(o,r))})),Object.assign(n,...Object.keys(t).map((n=>({[n]:e.deepCopy(t[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{JSON.parse(t);return!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){return e.toLowerCase().indexOf(t.toLowerCase(),r)}static highlight(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]: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+" "+r)>-1;)t=this.replaceAll(t,r+" "+r,r);t=t.trim()}let i=this.findAllPositionsCaseInsensitive(e,t),o='<strong class="highlight">',a="</strong>";for(let r=0;r<i.length;r++){t=t.substring(0,i[r])+o+t.substring(i[r],i[r]+e.length)+a+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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.call("GET",t,e)}static post(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.call("POST",t,e)}static call(t,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]: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=e.baseUrl()+"/"+r);let a=new XMLHttpRequest;a.open(t,r,!0),"POST"===t&&(!("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=>{let[e,r]=t;a.setRequestHeader(e,r)})),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"===t&&a.send(null),"POST"===t&&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="ABCDEFGHIJKLMNOPQRSTUVWXYZ",i=0;for(e=0,r=(t=t.toUpperCase()).length-1;e<t.length;e+=1,r-=1)i+=Math.pow(26,r)*(n.indexOf(t[e])+1);return i}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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.intToChar(this.charToInt(t)+e)}static decChar(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;null===t&&(t=new Date),t=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate())),t.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.setYear(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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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(((e,o)=>{let{style:a}=e;r?(a.top=o<2?0:`${t}%`,a.left=o%2==0?0:`${t}%`,a.width=a.height=`${t}%`):(a.top=o<2?`${n}%`:`${n+t}%`,a.left=o%2==0?`${i}%`:`${i+t}%`,a.width=`${t}%`,a.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(((t,e)=>{let{style:r}=t;r.top=e<2?c:`${u+parseFloat(c)}%`,r.left=e%2==0?l:`${u+parseFloat(l)}%`,r.width=`${u}%`,r.height=`${u}%`})),new Promise((t=>{setTimeout((()=>t(this.cursorPositionBisect(u))),window.cursorPositionDelay)}))}static scrollTo(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return new Promise((a=>{null===n&&(n=document.scrollingElement||document.documentElement),e.isNumeric(t)||(t=n===(document.scrollingElement||documentElement)?this.offsetTopWithMargin(t):t.getBoundingClientRect().top-parseInt(getComputedStyle(t).marginTop)-(n.getBoundingClientRect().top-n.scrollTop-parseInt(getComputedStyle(n).marginTop)));let s=0;Array.isArray(i)||(i=[i]),i.forEach((t=>{e.isNumeric(t)?s+=t:null!==t&&"fixed"===window.getComputedStyle(t).position&&(s+=-1*t.offsetHeight)})),t+=s;const l=n.scrollTop,c=t-l,u=+new Date,d=function(){const e=+new Date-u;var i,o,s;n.scrollTop=parseInt((i=e,o=l,s=c,(i/=r/2)<1?-s/2*(Math.sqrt(1-i*i)-1)+o:(i-=2,s/2*(Math.sqrt(1-i*i)+1)+o))),e<r?requestAnimationFrame(d):(n.scrollTop=t,a())};!0===o&&c>0?a():d()}))}static loadJs(t){e.isArray(t)||(t=[t]);let r=[];return e.loop(t,((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(t){e.isArray(t)||(t=[t]);for(let r of t)await e.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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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"===e.getBrowser()&&"desktop"!==e.getDevice()&&e.on("touchend","a",((t,e)=>{e.click()}))}static isNumeric(t){return!isNaN(parseFloat(t))&&isFinite(t)}static animate(t,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)})),l="transition: "+l.join(", ")+" !important;";let c=null;NodeList.prototype.isPrototypeOf(t)?c=Array.from(t):null===t?(console.log("cannot animate element from "+r+" to "+n+" because it does not exist"),a()):c=[t];let u=c.length;c.forEach(((t,i)=>{let c=e.random_string(10,"abcdefghijklmnopqrstuvwxyz");t.classList.add(c),window.requestAnimationFrame((()=>{let i=[],d=t.getAttribute("style");null!==d&&d.split(";").forEach((t=>{""==t||s.includes(t.split(":")[0].trim())||i.push(t)})),i=i.length>0?i.join(";")+";"+r+";":r+";",t.setAttribute("style",i),window.requestAnimationFrame((()=>{let i=document.createElement("style");i.innerHTML="."+c+" { "+l+" }",document.head.appendChild(i),window.requestAnimationFrame((()=>{if(t.setAttribute("style",t.getAttribute("style").replace(r+";","")+n+";"),this.isVisible(t)){let r=!1;e.addEventListenerOnce(t,"transitionend",(e=>{if(r=!0,e.target!==e.currentTarget)return!1;document.head.contains(i)&&document.head.removeChild(i),t.classList.remove(c),u--,u<=0&&window.requestAnimationFrame((()=>{a()}))})),setTimeout((()=>{!1===r&&(document.head.contains(i)&&document.head.removeChild(i),t.classList.remove(c),u--,u<=0&&a())}),1.5*o)}else document.head.contains(i)&&document.head.removeChild(i),t.classList.remove(c),u--,u<=0&&a()}))}))}))}))}))}static addEventListenerOnce(t,e,r,n,i){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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/`/g,"&#96;")}static nl2br(t){if(null==t)return"";return(t+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1<br/>")}static br2nl(t){if(null==t)return"";return 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){return $els=[],null!==t.querySelector("*")&&t.querySelectorAll("*").forEach((t=>{$els.push(t),void 0!==t.shadowRoot&&null!==t.shadowRoot&&($els=$els.concat(e(t.shadowRoot)))})),$els},r=document.createDocumentFragment();return $els=e(document),$els.forEach((e=>{e.matches(t)&&r.appendChild(e.cloneNode())})),r.childNodes}static focus(t){e.unfocus();let r=null;if(r="string"==typeof t||t instanceof String?document.querySelector(t):t,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((t=>{e.remove(t)})),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(t,r,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;null===i?(i=n,n=document):n=document.querySelector(n),n.addEventListener(t,(t=>{var n=e.closest(t.target,r);n&&i(t,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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]: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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,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(t,r){e.ready().then((()=>{let n=e.pushId();null!==document.querySelector(t)&&document.querySelectorAll(t).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:t,callback:r})}))}static fmath(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,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){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){e=e?(e+"").replace(/([[\]().?/*{}+$^:])/g,"$1"):" \\s ";const r=new RegExp("^["+e+"]+","g");return(t+"").replace(r,"")}static rtrim(t,e){e=e?(e+"").replace(/([[\]().?/*{}+$^:])/g,"\\$1"):" \\s ";const r=new RegExp("["+e+"]+$","g");return(t+"").replace(r,"")}static truncate_string(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";if(this.nx(t)||!("string"==typeof t||t instanceof String))return t;if(-1===t.indexOf(" "))t.length>r&&(t=t.substring(0,r),t=e.rtrim(t),t+=" "+n);else if(t.length>r){for(t=e.rtrim(t);t.length>r&&t.lastIndexOf(" ")>-1&&" "!=t.substring(r-1,r);)t=t.substring(0,t.lastIndexOf(" ")),t=e.rtrim(t);t=t.substring(0,r),t=e.rtrim(t),t+=" "+n}return t}static emojiRegex(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return new RegExp(e.emojiRegexPattern(),(!0===t?"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?Number.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 r=null;void 0!==window&&(void 0===window.pushIdDataGlobal&&(window.pushIdDataGlobal={}),r=window.pushIdDataGlobal),void 0!==t&&(void 0===t.pushIdDataGlobal&&(t.pushIdDataGlobal={}),r=t.pushIdDataGlobal),e.objectsAreEqual(r,{})&&(r.lastPushTime=0,r.lastRandChars=[],r.PUSH_CHARS="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz");let n=(new Date).getTime(),i=n===r.lastPushTime;r.lastPushTime=n;let o=new Array(8);for(var a=7;a>=0;a--)o[a]=r.PUSH_CHARS.charAt(n%64),n=Math.floor(n/64);if(0!==n)throw new Error;let s=o.join("");if(i){for(a=11;a>=0&&63===r.lastRandChars[a];a--)r.lastRandChars[a]=0;r.lastRandChars[a]++}else for(a=0;a<12;a++)r.lastRandChars[a]=Math.floor(64*Math.random());for(a=0;a<12;a++)s+=r.PUSH_CHARS.charAt(r.lastRandChars[a]);if(20!=s.length)throw new Error;return s}static getProp(t,e){let r=e.split(".");for(;r.length&&(t=t[r.shift()]););return t}static base64toblob(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",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){return new Blob([t],{type:arguments.length>1&&void 0!==arguments[1]?arguments[1]:""})}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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"file.txt",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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"file.txt";return this.blobtofile(this.base64toblob(t,e),r)}static blobtourl(t){return URL.createObjectURL(t,{type:"text/plain"})}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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];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}}r.default=e,"undefined"!=typeof window&&(window.hlp={},Object.getOwnPropertyNames(e).forEach(((t,r)=>{"length"!==t&&"name"!==t&&"prototype"!==t&&"caller"!==t&&"arguments"!==t&&(window.hlp[t]=e[t])})))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1]);
1
+ !function t(e,r,n){function i(a,s){if(!r[a]){if(!e[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[a]={exports:{}};e[a][0].call(u.exports,function(t){return i(e[a][1][t]||t)},u,u.exports,t,e,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a<n.length;a++)i(n[a]);return i}({1:[function(t,e,r){(function(e){(function(){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,o=n(t("@babel/runtime/helpers/taggedTemplateLiteral"));class a{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(t){if("function"==typeof t)try{return t=t(),this.true(t)}catch(t){return!1}return void 0!==t&&(null!==t&&(!1!==t&&((!Array.isArray(t)||0!==t.length)&&((!Array.isArray(t)||""!==a.first(t))&&(("object"!=typeof t||0!==Object.keys(t).length||t.constructor!==Object)&&(0!==t&&("0"!==t&&(""!==t&&(" "!==t&&("null"!==t&&"false"!==t))))))))))}static false(t){if("function"==typeof t)try{return t=t(),this.false(t)}catch(t){return!1}return void 0!==t&&(null!==t&&(!1===t||(!Array.isArray(t)||0!==t.length)&&((!Array.isArray(t)||""!==a.first(t))&&(("object"!=typeof t||0!==Object.keys(t).length||t.constructor!==Object)&&(0===t||("0"===t||""!==t&&(" "!==t&&("null"!==t&&"false"===t))))))))}static v(){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=>{let[r,n]=t;e(n,r)})}static map(t,e,r){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=>{let[r,n]=t;null===e&&(e=n)}),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=>{let[r,n]=t;e=n}),e}return null}static rand(t){return Array.isArray(t)?t[Math.floor(Math.random()*t.length)]:"object"==typeof t?(t=Object.values(t))[Math.floor(Math.random()*t.length)]:null}static random_string(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:99999;return!(!this.isInteger(t)||!this.isInteger(e))&&(t>e&&([t,e]=[e,t]),~~(Math.random()*(e-t+1))+t)}static capitalize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]: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){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],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){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],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){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]: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 isMac(){return"mac"===a.getOs()}static isLinux(){return"linux"===a.getOs()}static isWindows(){return"windows"===a.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){return!!t&&t.constructor===Object}static isArray(t){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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["a-z","A-Z","0-9","$!?"],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:",";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,l="";return l=(o?function(t,e){var r=Math.pow(10,e);return""+Math.round(t*r)/r}(i,o):""+Math.round(i)).split("."),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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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 p=0===l?12:l;r+=p>12?p-12:p;break;case"h":p=0===l?12:l,p=p>12?p-12:p,r+=p<10?"0"+p:p;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(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap;if(Object(t)!==t)return t;if(e.has(t))return e.get(t);const r=t instanceof Date?new Date(t):t instanceof RegExp?new RegExp(t.source,t.flags):t.constructor?new t.constructor:Object.create(null);return e.set(t,r),t instanceof Map&&Array.from(t,t=>{let[n,i]=t;return r.set(n,a.deepCopy(i,e))}),Object.assign(r,...Object.keys(t).map(r=>({[r]:a.deepCopy(t[r],e)})))}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{JSON.parse(t);return!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){return e.toLowerCase().indexOf(t.toLowerCase(),r)}static highlight(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]: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+" "+r)>-1;)t=this.replaceAll(t,r+" "+r,r);t=t.trim()}let i=this.findAllPositionsCaseInsensitive(e,t),o='<strong class="highlight">',a="</strong>";for(let r=0;r<i.length;r++){t=t.substring(0,i[r])+o+t.substring(i[r],i[r]+e.length)+a+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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.call("GET",t,e)}static post(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.call("POST",t,e)}static call(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return null===r&&(r={}),"data"in r||(r.data={}),"headers"in r||(r.headers=null),"throttle"in r||(r.throttle=0),"allow_errors"in r||(r.allow_errors=!0),new Promise((n,i)=>{setTimeout(()=>{0!==e.indexOf("http")&&(e=a.baseUrl()+"/"+e);let o=new XMLHttpRequest;o.open(t,e,!0),"POST"===t&&(!("data"in r)||null===r.data||"object"!=typeof r.data||r.data instanceof FormData||(o.setRequestHeader("Content-Type","application/json;charset=UTF-8"),r.data=JSON.stringify(r.data)),o.setRequestHeader("X-Requested-With","XMLHttpRequest")),this.x(r.headers)&&Object.entries(r.headers).forEach(t=>{let[e,r]=t;o.setRequestHeader(e,r)}),o.onload=()=>{(4!=o.readyState||!0!==r.allow_errors&&200!=o.status&&304!=o.status)&&(this.isJsonString(o.responseText)?i(this.jsonStringToObject(o.responseText)):i(o.responseText)),this.isJsonString(o.responseText)?n(this.jsonStringToObject(o.responseText)):n(o.responseText)},o.onerror=()=>{i([o.readyState,o.status,o.statusText])},"GET"===t&&o.send(null),"POST"===t&&o.send(r.data)},r.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="ABCDEFGHIJKLMNOPQRSTUVWXYZ",i=0;for(e=0,r=(t=t.toUpperCase()).length-1;e<t.length;e+=1,r-=1)i+=Math.pow(26,r)*(n.indexOf(t[e])+1);return i}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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.intToChar(this.charToInt(t)+e)}static decChar(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;null===t&&(t=new Date),t=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate())),t.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.setYear(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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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:"".concat(10,"%"),n.left=e%2==0?0:"".concat(10,"%"),n.width=n.height="".concat(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((e,o)=>{let{style:a}=e;r?(a.top=o<2?0:"".concat(t,"%"),a.left=o%2==0?0:"".concat(t,"%"),a.width=a.height="".concat(t,"%")):(a.top="".concat(o<2?n:n+t,"%"),a.left="".concat(o%2==0?i:i+t,"%"),a.width="".concat(t,"%"),a.height="".concat(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((t,e)=>{let{style:r}=t;r.top=e<2?c:"".concat(u+parseFloat(c),"%"),r.left=e%2==0?l:"".concat(u+parseFloat(l),"%"),r.width="".concat(u,"%"),r.height="".concat(u,"%")}),new Promise(t=>{setTimeout(()=>t(this.cursorPositionBisect(u)),window.cursorPositionDelay)})}static scrollTo(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return new Promise(o=>{null===r&&(r=document.scrollingElement||document.documentElement),a.isNumeric(t)||(t=r===(document.scrollingElement||documentElement)?this.offsetTopWithMargin(t):t.getBoundingClientRect().top-parseInt(getComputedStyle(t).marginTop)-(r.getBoundingClientRect().top-r.scrollTop-parseInt(getComputedStyle(r).marginTop)));let s=0;Array.isArray(n)||(n=[n]),n.forEach(t=>{a.isNumeric(t)?s+=t:null!==t&&"fixed"===window.getComputedStyle(t).position&&(s+=-1*t.offsetHeight)}),t+=s;const l=r.scrollTop,c=t-l,u=+new Date,d=function(){const n=+new Date-u;var i,a,s;r.scrollTop=parseInt((i=n,a=l,s=c,(i/=e/2)<1?-s/2*(Math.sqrt(1-i*i)-1)+a:(i-=2,s/2*(Math.sqrt(1-i*i)+1)+a))),n<e?requestAnimationFrame(d):(r.scrollTop=t,o())};!0===i&&c>0?o():d()})}static loadJs(t){a.isArray(t)||(t=[t]);let e=[];return a.loop(t,(t,r)=>{e.push(new Promise((e,r)=>{let n=document.createElement("script");n.src=t,n.onload=()=>{e()},document.head.appendChild(n)}))}),Promise.all(e)}static async loadJsSequentially(t){a.isArray(t)||(t=[t]);for(let e of t)await a.loadJs(e)}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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;if(null===t){let t=()=>{let t=.01*window.innerHeight;document.documentElement.style.setProperty("--vh","".concat(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"===a.getBrowser()&&"desktop"!==a.getDevice()&&a.on("touchend","a",(t,e)=>{e.click()})}static isNumeric(t){return!isNaN(parseFloat(t))&&isFinite(t)}static animate(t,e,r,n,i){return new Promise(o=>{i<=50&&(i=50);let s=[];e.split(";").forEach(t=>{s.push(t.split(":")[0].trim())});let l=[];s.forEach(t=>{l.push(t+" "+Math.round(i/1e3*10)/10+"s "+n)}),l="transition: "+l.join(", ")+" !important;";let c=null;NodeList.prototype.isPrototypeOf(t)?c=Array.from(t):null===t?(console.log("cannot animate element from "+e+" to "+r+" because it does not exist"),o()):c=[t];let u=c.length;c.forEach((t,n)=>{let c=a.random_string(10,"abcdefghijklmnopqrstuvwxyz");t.classList.add(c),window.requestAnimationFrame(()=>{let n=[],d=t.getAttribute("style");null!==d&&d.split(";").forEach(t=>{""==t||s.includes(t.split(":")[0].trim())||n.push(t)}),n=n.length>0?n.join(";")+";"+e+";":e+";",t.setAttribute("style",n),window.requestAnimationFrame(()=>{let n=document.createElement("style");n.innerHTML="."+c+" { "+l+" }",document.head.appendChild(n),window.requestAnimationFrame(()=>{if(t.setAttribute("style",t.getAttribute("style").replace(e+";","")+r+";"),this.isVisible(t)){let e=!1;a.addEventListenerOnce(t,"transitionend",r=>{if(e=!0,r.target!==r.currentTarget)return!1;document.head.contains(n)&&document.head.removeChild(n),t.classList.remove(c),u--,u<=0&&window.requestAnimationFrame(()=>{o()})}),setTimeout(()=>{!1===e&&(document.head.contains(n)&&document.head.removeChild(n),t.classList.remove(c),u--,u<=0&&o())},1.5*i)}else document.head.contains(n)&&document.head.removeChild(n),t.classList.remove(c),u--,u<=0&&o()})})})})})}static addEventListenerOnce(t,e,r,n,i){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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/`/g,"&#96;")}static nl2br(t){if(null==t)return"";return(t+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1<br/>")}static br2nl(t){if(null==t)return"";return 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){return $els=[],null!==t.querySelector("*")&&t.querySelectorAll("*").forEach(t=>{$els.push(t),void 0!==t.shadowRoot&&null!==t.shadowRoot&&($els=$els.concat(e(t.shadowRoot)))}),$els},r=document.createDocumentFragment();return $els=e(document),$els.forEach(e=>{e.matches(t)&&r.appendChild(e.cloneNode())}),r.childNodes}static focus(t){a.unfocus();let e=null;if(e="string"==typeof t||t instanceof String?document.querySelector(t):t,null!==e){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,e.before(t),e.setAttribute("data-focussed",1),e.setAttribute("data-focussed-orig-z-index",e.style.zIndex),e.setAttribute("data-focussed-orig-position",e.style.position),e.setAttribute("data-focussed-orig-background-color",e.style.backgroundColor),e.setAttribute("data-focussed-orig-box-shadow",e.style.boxShadow),e.style.zIndex=2147483647,e.style.position="relative",e.style.backgroundColor="#ffffff",e.style.boxShadow="0px 0px 0px 20px #fff"}}static unfocus(){null!==document.querySelector(".hlp-focus-mask")&&document.querySelectorAll(".hlp-focus-mask").forEach(t=>{a.remove(t)}),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(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;null===n?(n=r,r=document):r=document.querySelector(r),r.addEventListener(t,t=>{var r=a.closest(t.target,e);r&&n(t,r)},!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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]: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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,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(t,e){a.ready().then(()=>{let r=a.pushId();null!==document.querySelector(t)&&document.querySelectorAll(t).forEach(t=>{void 0===t.runForEl&&(t.runForEl=[]),t.runForEl.includes(r)||(t.runForEl.push(r),e(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:r,selector:t,callback:e})})}static fmath(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,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){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){e=e?(e+"").replace(/([[\]().?/*{}+$^:])/g,"$1"):" \\s ";const r=new RegExp("^["+e+"]+","g");return(t+"").replace(r,"")}static rtrim(t,e){e=e?(e+"").replace(/([[\]().?/*{}+$^:])/g,"\\$1"):" \\s ";const r=new RegExp("["+e+"]+$","g");return(t+"").replace(r,"")}static truncate_string(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";if(this.nx(t)||!("string"==typeof t||t instanceof String))return t;if(-1===t.indexOf(" "))t.length>e&&(t=t.substring(0,e),t=a.rtrim(t),t+=" "+r);else if(t.length>e){for(t=a.rtrim(t);t.length>e&&t.lastIndexOf(" ")>-1&&" "!=t.substring(e-1,e);)t=t.substring(0,t.lastIndexOf(" ")),t=a.rtrim(t);t=t.substring(0,e),t=a.rtrim(t),t+=" "+r}return t}static emojiRegex(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return new RegExp(a.emojiRegexPattern(),(!0===t?"g":"")+"u")}static emojiRegexPattern(){return String.raw(i||(i=(0,o.default)(["p{RI}p{RI}|p{Extended_Pictographic}(p{EMod}|️⃣?|[󠀠-󠁾]+󠁿)?(‍(p{RI}p{RI}|p{Extended_Pictographic}(p{EMod}|️⃣?|[󠀠-󠁾]+󠁿)?))*"],["\\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 ".concat(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: ".concat(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?Number.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: ".concat(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 t=null;void 0!==window&&(void 0===window.pushIdDataGlobal&&(window.pushIdDataGlobal={}),t=window.pushIdDataGlobal),void 0!==e&&(void 0===e.pushIdDataGlobal&&(e.pushIdDataGlobal={}),t=e.pushIdDataGlobal),a.objectsAreEqual(t,{})&&(t.lastPushTime=0,t.lastRandChars=[],t.PUSH_CHARS="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz");let r=(new Date).getTime(),n=r===t.lastPushTime;t.lastPushTime=r;let i=new Array(8);for(var o=7;o>=0;o--)i[o]=t.PUSH_CHARS.charAt(r%64),r=Math.floor(r/64);if(0!==r)throw new Error;let s=i.join("");if(n){for(o=11;o>=0&&63===t.lastRandChars[o];o--)t.lastRandChars[o]=0;t.lastRandChars[o]++}else for(o=0;o<12;o++)t.lastRandChars[o]=Math.floor(64*Math.random());for(o=0;o<12;o++)s+=t.PUSH_CHARS.charAt(t.lastRandChars[o]);if(20!=s.length)throw new Error;return s}static getProp(t,e){let r=e.split(".");for(;r.length&&(t=t[r.shift()]););return t}static base64toblob(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",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){return new Blob([t],{type:arguments.length>1&&void 0!==arguments[1]?arguments[1]:""})}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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"file.txt",r=null;try{r=new File([t],e)}catch(n){r=new Blob([t],e)}return r}static filetoblob(t){return new Blob([t])}static base64tofile(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"file.txt";return this.blobtofile(this.base64toblob(t,e),r)}static blobtourl(t){return URL.createObjectURL(t,{type:"text/plain"})}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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];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}}r.default=a,"undefined"!=typeof window&&(window.hlp={},Object.getOwnPropertyNames(a).forEach((t,e)=>{"length"!==t&&"name"!==t&&"prototype"!==t&&"caller"!==t&&"arguments"!==t&&(window.hlp[t]=a[t])}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"@babel/runtime/helpers/interopRequireDefault":2,"@babel/runtime/helpers/taggedTemplateLiteral":3}],2:[function(t,e,r){e.exports=function(t){return t&&t.__esModule?t:{default:t}},e.exports.__esModule=!0,e.exports.default=e.exports},{}],3:[function(t,e,r){e.exports=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))},e.exports.__esModule=!0,e.exports.default=e.exports},{}]},{},[1]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hlp",
3
- "version": "3.5.7",
3
+ "version": "3.5.9",
4
4
  "main": "_js/_build/script.js",
5
5
  "files": [
6
6
  "_js/_build/*.js",
@@ -22,21 +22,21 @@
22
22
  "license": "MIT",
23
23
  "dependencies": {},
24
24
  "devDependencies": {
25
- "@babel/cli": "^7.27.2",
26
- "@babel/core": "^7.27.4",
25
+ "@babel/cli": "^7.28.3",
26
+ "@babel/core": "^7.28.5",
27
27
  "@babel/plugin-proposal-class-properties": "^7.18.6",
28
- "@babel/plugin-proposal-object-rest-spread": "^7.18.9",
29
- "@babel/plugin-proposal-optional-chaining": "^7.18.9",
28
+ "@babel/plugin-proposal-object-rest-spread": "^7.20.7",
29
+ "@babel/plugin-proposal-optional-chaining": "^7.21.0",
30
30
  "@babel/plugin-proposal-private-methods": "^7.18.6",
31
- "@babel/plugin-transform-runtime": "^7.27.4",
31
+ "@babel/plugin-transform-runtime": "^7.28.5",
32
32
  "@babel/polyfill": "^7.12.1",
33
- "@babel/preset-env": "^7.27.2",
34
- "@babel/preset-react": "^7.27.1",
35
- "@babel/runtime": "^7.27.4",
36
- "@prettier/plugin-php": "^0.21.0",
37
- "autoprefixer": "^10.4.21",
33
+ "@babel/preset-env": "^7.28.5",
34
+ "@babel/preset-react": "^7.28.5",
35
+ "@babel/runtime": "^7.28.4",
36
+ "@prettier/plugin-php": "^0.24.0",
37
+ "autoprefixer": "^10.4.22",
38
38
  "babel-core": "^7.0.0-bridge.0",
39
- "babel-jest": "^29.7.0",
39
+ "babel-jest": "^29",
40
40
  "babel-plugin-array-includes": "^2.0.3",
41
41
  "babel-plugin-transform-runtime": "^6.23.0",
42
42
  "babel-preset-env": "^1.7.0",
@@ -44,55 +44,55 @@
44
44
  "babel-preset-es2017": "^6.24.1",
45
45
  "babel-runtime": "^6.26.0",
46
46
  "babelify": "^10.0.0",
47
- "browser-sync": "^2.29.3",
47
+ "browser-sync": "^3.0.4",
48
48
  "browserify": "^17.0.1",
49
49
  "browserify-css": "^0.15.0",
50
- "caniuse-lite": "^1.0.30001720",
50
+ "caniuse-lite": "^1.0.30001757",
51
51
  "cli-error-notifier": "^3.0.2",
52
52
  "concat": "^1.0.3",
53
- "core-js": "^3.42.0",
54
- "cross-env": "^7.0.3",
53
+ "core-js": "^3.47.0",
54
+ "cross-env": "^10.1.0",
55
55
  "cross-spawn": "^7.0.6",
56
56
  "cross-var": "^1.1.0",
57
- "del-cli": "^5.1.0",
58
- "dotenv": "^16.5.0",
57
+ "del-cli": "^7.0.0",
58
+ "dotenv": "^17.2.3",
59
59
  "element-closest": "^3.0.2",
60
- "env-cmd": "^10.1.0",
61
- "eslint": "^8.57.1",
60
+ "env-cmd": "^11.0.0",
61
+ "eslint": "^9.39.1",
62
62
  "exit": "^0.1.2",
63
63
  "from-env": "^1.1.4",
64
64
  "highlight.js": "^11.11.1",
65
65
  "html-minifier": "^4.0.0",
66
66
  "ismobilejs": "^1.1.1",
67
- "jest": "^29.7.0",
68
- "jest-cli": "^29.7.0",
69
- "jest-environment-jsdom": "^29.7.0",
67
+ "jest": "^29",
68
+ "jest-cli": "^29",
69
+ "jest-environment-jsdom": "^29",
70
70
  "jest-image-snapshot": "^6.5.1",
71
- "jest-puppeteer": "^9.0.2",
71
+ "jest-puppeteer": "^11.0.0",
72
72
  "mdn-polyfills": "^5.20.0",
73
73
  "move-file-cli": "^3.0.0",
74
74
  "ncp": "^2.0.0",
75
75
  "node-sass": "^9.0.0",
76
- "npm": "^10.9.2",
77
- "npm-check-updates": "^16.14.20",
76
+ "npm": "^11.6.4",
77
+ "npm-check-updates": "^19.1.2",
78
78
  "npm-run-all": "^4.1.5",
79
79
  "onchange": "^7.1.0",
80
- "postcss": "^8.5.4",
81
- "postcss-cli": "^10.1.0",
80
+ "postcss": "^8.5.6",
81
+ "postcss-cli": "^11.0.1",
82
82
  "postcss-tailwind-data-attr": "^1.0.7",
83
83
  "postcss-url": "^10.1.3",
84
- "prettier": "^3.5.3",
85
- "puppeteer": "^21.11.0",
84
+ "prettier": "^3.6.2",
85
+ "puppeteer": "^24.31.0",
86
86
  "regenerator-runtime": "^0.14.1",
87
- "replace-in-file": "^7.2.0",
88
- "rimraf": "^5.0.10",
87
+ "replace-in-file": "^8.3.0",
88
+ "rimraf": "^6.1.2",
89
89
  "run-sequence": "^2.2.1",
90
- "sass": "^1.89.1",
91
- "tailwindcss": "^3.4.17",
92
- "terser": "^5.40.0",
90
+ "sass": "^1.94.2",
91
+ "tailwindcss": "^4.1.17",
92
+ "terser": "^5.44.1",
93
93
  "vinyl-buffer": "^1.0.1",
94
94
  "vinyl-source-stream": "^2.0.0",
95
- "vue": "^3.5.16",
95
+ "vue": "^3.5.25",
96
96
  "vue-template-compiler": "^2.7.16",
97
97
  "whatwg-fetch": "^3.6.20"
98
98
  },