@tspro/ts-utils-lib 1.17.0 → 1.18.0

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/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /* TsUtilsLib v1.17.0 | (c) 2023 PahkaSoft | Licensed under the MIT License */
1
+ /* TsUtilsLib v1.18.0 | (c) 2023 PahkaSoft | Licensed under the MIT License */
2
2
  "use strict";
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -23,10 +23,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
23
23
  // src/index.ts
24
24
  var index_exports = {};
25
25
  __export(index_exports, {
26
- Assert: () => Assert,
27
- Cookies: () => Cookies,
28
- Device: () => Device,
26
+ Assert: () => assert_exports,
27
+ Cookies: () => cookies_exports,
28
+ Device: () => device_exports,
29
29
  DivRect: () => DivRect,
30
+ Guard: () => guard_exports,
30
31
  IndexArray: () => IndexArray,
31
32
  LRUCache: () => LRUCache,
32
33
  Map1: () => Map1,
@@ -43,55 +44,51 @@ __export(index_exports, {
43
44
  });
44
45
  module.exports = __toCommonJS(index_exports);
45
46
 
46
- // src/utils/index.ts
47
- var utils_exports = {};
48
- __export(utils_exports, {
49
- Arr: () => arr_exports,
50
- Dom: () => dom_exports,
51
- Enum: () => enum_exports,
52
- Is: () => is_exports,
53
- Map: () => map_exports,
54
- Math: () => math_exports,
55
- Obj: () => obj_exports,
56
- Str: () => str_exports
57
- });
58
-
59
- // src/utils/arr/index.ts
60
- var arr_exports = {};
61
- __export(arr_exports, {
62
- arrayContains: () => arrayContains,
63
- chunckArray: () => chunckArray,
64
- duplicate: () => duplicate,
65
- fillArray: () => fillArray,
66
- getRangeArray: () => getRangeArray,
67
- getSequenceArray: () => getSequenceArray,
68
- isArray: () => isArray,
69
- mapRangeArray: () => mapRangeArray,
70
- mapSequenceArray: () => mapSequenceArray,
71
- removeDuplicates: () => removeDuplicates,
72
- removeDuplicatesCmp: () => removeDuplicatesCmp,
73
- toArray: () => toArray
74
- });
75
-
76
- // src/utils/is/index.ts
77
- var is_exports = {};
78
- __export(is_exports, {
47
+ // src/assert/index.ts
48
+ var assert_exports = {};
49
+ __export(assert_exports, {
50
+ array_elem: () => array_elem,
51
+ array_id: () => array_id,
52
+ assert: () => assert,
53
+ assertEnum: () => assertEnum,
54
+ eq: () => eq,
55
+ even: () => even,
56
+ fail: () => fail,
57
+ finite: () => finite,
58
+ in_group: () => in_group,
59
+ int: () => int,
60
+ int_between: () => int_between,
61
+ int_between_exclusive: () => int_between_exclusive,
62
+ int_eq: () => int_eq,
63
+ int_gt: () => int_gt,
64
+ int_gte: () => int_gte,
65
+ int_lt: () => int_lt,
66
+ int_lte: () => int_lte,
67
+ interrupt: () => interrupt,
79
68
  isArray: () => isArray,
69
+ isArrayIndex: () => isArrayIndex,
80
70
  isArrayOrUndefined: () => isArrayOrUndefined,
81
71
  isBoolean: () => isBoolean,
82
72
  isBooleanOrUndefined: () => isBooleanOrUndefined,
73
+ isDeepEqual: () => isDeepEqual,
83
74
  isEmptyArray: () => isEmptyArray,
84
75
  isEmptyArrayOrUndefined: () => isEmptyArrayOrUndefined,
85
76
  isEmptyString: () => isEmptyString,
86
77
  isEmptyStringOrUndefined: () => isEmptyStringOrUndefined,
87
78
  isEnumValue: () => isEnumValue,
88
79
  isEnumValueOrUndefined: () => isEnumValueOrUndefined,
80
+ isEqual: () => isEqual,
81
+ isEvenNumber: () => isEvenNumber,
82
+ isFalse: () => isFalse,
83
+ isFalseOrUndefined: () => isFalseOrUndefined,
89
84
  isFinite: () => isFinite2,
90
85
  isFunction: () => isFunction,
91
86
  isFunctionOrUndefined: () => isFunctionOrUndefined,
87
+ isIncluded: () => isIncluded,
92
88
  isInfinity: () => isInfinity,
93
89
  isInteger: () => isInteger,
94
90
  isIntegerBetween: () => isIntegerBetween,
91
+ isIntegerBetweenExclusive: () => isIntegerBetweenExclusive,
95
92
  isIntegerEq: () => isIntegerEq,
96
93
  isIntegerGt: () => isIntegerGt,
97
94
  isIntegerGte: () => isIntegerGte,
@@ -107,143 +104,936 @@ __export(is_exports, {
107
104
  isNull: () => isNull,
108
105
  isNullish: () => isNullish,
109
106
  isNumber: () => isNumber,
107
+ isNumberBetween: () => isNumberBetween,
108
+ isNumberBetweenExclusive: () => isNumberBetweenExclusive,
110
109
  isNumberOrUndefined: () => isNumberOrUndefined,
111
110
  isObject: () => isObject,
112
111
  isObjectOrUndefined: () => isObjectOrUndefined,
112
+ isOddNumber: () => isOddNumber,
113
113
  isPosInfinity: () => isPosInfinity,
114
114
  isString: () => isString,
115
115
  isStringOrUndefined: () => isStringOrUndefined,
116
- isUndefined: () => isUndefined
116
+ isThrowing: () => isThrowing,
117
+ isTrue: () => isTrue,
118
+ isTrueOrUndefined: () => isTrueOrUndefined,
119
+ isTypedObject: () => isTypedObject,
120
+ isUndefined: () => isUndefined,
121
+ odd: () => odd,
122
+ require: () => require2,
123
+ requireDefined: () => requireDefined,
124
+ setErrorClass: () => setErrorClass
125
+ });
126
+ var errorConstructor = Error;
127
+ function setErrorClass(errorClass) {
128
+ errorConstructor = errorClass ?? Error;
129
+ }
130
+ function _fail(...msgs) {
131
+ let msg = msgs.join(", ");
132
+ throw new errorConstructor("Assertion Failed!" + (msg === "" ? "" : " " + msg));
133
+ }
134
+ function interrupt(msg) {
135
+ _fail("Interrupted!");
136
+ }
137
+ function assertEnum(enumVal, enumObj, name = "value") {
138
+ if (!guard_exports.isEnumValue(enumVal, enumObj))
139
+ _fail(`Invalid enum value ${enumVal}.`);
140
+ }
141
+ function int(value, msg) {
142
+ if (!guard_exports.isInteger(value))
143
+ _fail(`Expected ${value} to be integer.`, msg);
144
+ return value;
145
+ }
146
+ function eq(value1, value2, msg) {
147
+ if (value1 !== value2)
148
+ _fail(`Expected ${value1} to equal ${value2}.`, msg);
149
+ return value1;
150
+ }
151
+ function int_eq(value, compareTo, msg) {
152
+ if (!guard_exports.isIntegerEq(value, compareTo))
153
+ _fail(`Expected ${value} to be integer equal to ${compareTo}.`, msg);
154
+ return value;
155
+ }
156
+ function int_lt(value, compareTo, msg) {
157
+ if (!guard_exports.isIntegerLt(value, compareTo))
158
+ _fail(`Expected ${value} to be integer less than ${compareTo}.`, msg);
159
+ return value;
160
+ }
161
+ function int_lte(value, compareTo, msg) {
162
+ if (!guard_exports.isIntegerLte(value, compareTo))
163
+ _fail(`Expected ${value} to be integer less than or equal to ${compareTo}.`, msg);
164
+ return value;
165
+ }
166
+ function int_gt(value, compareTo, msg) {
167
+ if (!guard_exports.isIntegerGt(value, compareTo))
168
+ _fail(`Expected ${value} to be integer greater than ${compareTo}.`, msg);
169
+ return value;
170
+ }
171
+ function int_gte(value, compareTo, msg) {
172
+ if (!guard_exports.isIntegerGte(value, compareTo))
173
+ _fail(`Expected ${value} to be integer greater than or equal to ${compareTo}.`, msg);
174
+ return value;
175
+ }
176
+ function int_between(value, min, max, msg) {
177
+ if (!guard_exports.isIntegerBetween(value, min, max))
178
+ _fail(`Expected integer between ${min} <= ${value} <= ${max}.`, msg);
179
+ return value;
180
+ }
181
+ function int_between_exclusive(value, min, max, msg) {
182
+ if (!guard_exports.isIntegerBetweenExclusive(value, min, max))
183
+ _fail(`Expected integer between ${min} < ${value} < ${max}.`, msg);
184
+ return value;
185
+ }
186
+ function odd(value, msg) {
187
+ if (!guard_exports.isOddNumber(value))
188
+ _fail(`Expected ${value} to be odd number.`, msg);
189
+ return value;
190
+ }
191
+ function even(value, msg) {
192
+ if (!guard_exports.isEvenNumber(value))
193
+ _fail(`Expected ${value} to be even number.`, msg);
194
+ return value;
195
+ }
196
+ function in_group(value, group, msg) {
197
+ if (!group.some((e) => e === value))
198
+ _fail(`Expected ${value} to be in group [${group.map((v) => String(v)).join(", ")}].`, msg);
199
+ return value;
200
+ }
201
+ function finite(value, msg) {
202
+ if (!guard_exports.isFinite(value))
203
+ _fail(`Expected ${value} to be finite number.`, msg);
204
+ return value;
205
+ }
206
+ function array_id(array, index, msg) {
207
+ if (!guard_exports.isInteger(index) || !guard_exports.isArray(array) || index < 0 || index >= array.length)
208
+ _fail(`Expected ${index} to be array index in bounds [0..${array.length - 1}].`, msg);
209
+ return index;
210
+ }
211
+ function array_elem(array, index, msg) {
212
+ return array[array_id(array, index, msg)];
213
+ }
214
+ function assert(condition, msg) {
215
+ if (!condition) {
216
+ _fail(msg);
217
+ }
218
+ }
219
+ function require2(value, msg) {
220
+ if (value == null) {
221
+ _fail(`Expected ${value} not to be nullish`, msg);
222
+ }
223
+ return value;
224
+ }
225
+ function requireDefined(value, msg) {
226
+ if (value === void 0) {
227
+ _fail(`Expected ${value} not to be undefined`, msg);
228
+ }
229
+ return value;
230
+ }
231
+ function fail(msg) {
232
+ _fail(msg);
233
+ }
234
+ function isEqual(value1, value2, msg) {
235
+ if (!guard_exports.isEqual(value1, value2))
236
+ _fail(`Expected ${value1} to equal with ${value2}`, msg);
237
+ return true;
238
+ }
239
+ function isDeepEqual(value1, value2, msg) {
240
+ if (!guard_exports.isDeepEqual(value1, value2))
241
+ _fail(`Expected ${value1} to deep equal with ${value2}`, msg);
242
+ return true;
243
+ }
244
+ function isUndefined(value, msg) {
245
+ if (!guard_exports.isUndefined(value))
246
+ _fail(`Expected ${value} to be undefined`, msg);
247
+ return true;
248
+ }
249
+ function isNull(value, msg) {
250
+ if (!guard_exports.isNull(value))
251
+ _fail(`Expected ${value} to be null`, msg);
252
+ return true;
253
+ }
254
+ function isNullish(value, msg) {
255
+ if (!guard_exports.isNullish(value))
256
+ _fail(`Expected ${value} to be null or undefined`, msg);
257
+ return true;
258
+ }
259
+ function isObject(value, msg) {
260
+ if (!guard_exports.isObject(value))
261
+ _fail(`Expected ${value} to be object`, msg);
262
+ return true;
263
+ }
264
+ function isObjectOrUndefined(value, msg) {
265
+ if (!guard_exports.isObjectOrUndefined(value))
266
+ _fail(`Expected ${value} to be object or undefined`, msg);
267
+ return true;
268
+ }
269
+ function isTypedObject(obj, keys, msg) {
270
+ if (!guard_exports.isTypedObject(obj, keys))
271
+ _fail(`Expected ${obj} to be object with keys [${keys.map((key) => `'${String(key)}'`).join(", ")}]`, msg);
272
+ return true;
273
+ }
274
+ function isArray(value, msg) {
275
+ if (!guard_exports.isArray(value))
276
+ _fail(`Expected ${value} to be array`, msg);
277
+ return true;
278
+ }
279
+ function isArrayOrUndefined(value, msg) {
280
+ if (!guard_exports.isArrayOrUndefined(value))
281
+ _fail(`Expected ${value} to be array or undefined`, msg);
282
+ return true;
283
+ }
284
+ function isEmptyArray(value, msg) {
285
+ if (!guard_exports.isEmptyArray(value))
286
+ _fail(`Expected ${value} to be empty array`, msg);
287
+ return true;
288
+ }
289
+ function isNonEmptyArray(value, msg) {
290
+ if (!guard_exports.isNonEmptyArray(value))
291
+ _fail(`Expected ${value} to be non-empty array`, msg);
292
+ return true;
293
+ }
294
+ function isEmptyArrayOrUndefined(value, msg) {
295
+ if (!guard_exports.isEmptyArrayOrUndefined(value))
296
+ _fail(`Expected ${value} to be empty array or undefined`, msg);
297
+ return true;
298
+ }
299
+ function isNonEmptyArrayOrUndefined(value, msg) {
300
+ if (!guard_exports.isNonEmptyArrayOrUndefined(value))
301
+ _fail(`Expected ${value} to be non-empty array or undefined`, msg);
302
+ return true;
303
+ }
304
+ function isString(value, msg) {
305
+ if (!guard_exports.isString(value))
306
+ _fail(`Expected ${value} to be string`, msg);
307
+ return true;
308
+ }
309
+ function isEmptyString(value, msg) {
310
+ if (!guard_exports.isEmptyString(value))
311
+ _fail(`Expected ${value} to be empty string`, msg);
312
+ return true;
313
+ }
314
+ function isNonEmptyString(value, msg) {
315
+ if (!guard_exports.isNonEmptyString(value))
316
+ _fail(`Expected ${value} to be non-empty string`, msg);
317
+ return true;
318
+ }
319
+ function isStringOrUndefined(value, msg) {
320
+ if (!guard_exports.isStringOrUndefined(value))
321
+ _fail(`Expected ${value} to be string or undefined`, msg);
322
+ return true;
323
+ }
324
+ function isEmptyStringOrUndefined(value, msg) {
325
+ if (!guard_exports.isEmptyStringOrUndefined(value))
326
+ _fail(`Expected ${value} to be empty string or undefined`, msg);
327
+ return true;
328
+ }
329
+ function isNonEmptyStringOrUndefined(value, msg) {
330
+ if (!guard_exports.isNonEmptyStringOrUndefined(value))
331
+ _fail(`Expected ${value} to be non-empty string or undefined`, msg);
332
+ return true;
333
+ }
334
+ function isBoolean(value, msg) {
335
+ if (!guard_exports.isBoolean(value))
336
+ _fail(`Expected ${value} to be boolean`, msg);
337
+ return true;
338
+ }
339
+ function isBooleanOrUndefined(value, msg) {
340
+ if (!guard_exports.isBooleanOrUndefined(value))
341
+ _fail(`Expected ${value} to be boolean or undefined`, msg);
342
+ return true;
343
+ }
344
+ function isTrue(value, msg) {
345
+ if (!guard_exports.isTrue(value))
346
+ _fail(`Expected ${value} to be true`, msg);
347
+ return true;
348
+ }
349
+ function isTrueOrUndefined(value, msg) {
350
+ if (!guard_exports.isTrueOrUndefined(value))
351
+ _fail(`Expected ${value} to be true or undefined`, msg);
352
+ return true;
353
+ }
354
+ function isFalse(value, msg) {
355
+ if (!guard_exports.isFalse(value))
356
+ _fail(`Expected ${value} to be false`, msg);
357
+ return true;
358
+ }
359
+ function isFalseOrUndefined(value, msg) {
360
+ if (!guard_exports.isFalseOrUndefined(value))
361
+ _fail(`Expected ${value} to be false or undefined`, msg);
362
+ return true;
363
+ }
364
+ function isFunction(value, msg) {
365
+ if (!guard_exports.isFunction(value))
366
+ _fail(`Expected ${value} to be function`, msg);
367
+ return true;
368
+ }
369
+ function isFunctionOrUndefined(value, msg) {
370
+ if (!guard_exports.isFunctionOrUndefined(value))
371
+ _fail(`Expected ${value} to be function or undefined`, msg);
372
+ return true;
373
+ }
374
+ function isEnumValue(enumValue, enumObject, msg) {
375
+ if (!guard_exports.isEnumValue(enumValue, enumObject))
376
+ _fail(`Expected ${enumValue} to be enum value`, msg);
377
+ return true;
378
+ }
379
+ function isEnumValueOrUndefined(enumValue, enumObject, msg) {
380
+ if (!guard_exports.isEnumValueOrUndefined(enumValue, enumObject))
381
+ _fail(`Expected ${enumValue} to be enum value or undefined`, msg);
382
+ return true;
383
+ }
384
+ function isNumber(value, msg) {
385
+ if (!guard_exports.isNumber(value))
386
+ _fail(`Expected ${value} to be number`, msg);
387
+ return true;
388
+ }
389
+ function isNumberOrUndefined(value, msg) {
390
+ if (!guard_exports.isNumberOrUndefined(value))
391
+ _fail(`Expected ${value} to be number or undefined`, msg);
392
+ return true;
393
+ }
394
+ function isFinite2(value, msg) {
395
+ if (!guard_exports.isFinite(value))
396
+ _fail(`Expected ${value} to be finite`, msg);
397
+ return true;
398
+ }
399
+ function isInteger(value, msg) {
400
+ if (!guard_exports.isInteger(value))
401
+ _fail(`Expected ${value} to be integer`, msg);
402
+ return true;
403
+ }
404
+ function isIntegerOrUndefined(value, msg) {
405
+ if (!guard_exports.isIntegerOrUndefined(value))
406
+ _fail(`Expected ${value} to be integer or undefined`, msg);
407
+ return true;
408
+ }
409
+ function isIntegerEq(value, compareTo, msg) {
410
+ if (!guard_exports.isIntegerEq(value, compareTo))
411
+ _fail(`Expected ${value} to be integer equal to ${compareTo}`, msg);
412
+ return true;
413
+ }
414
+ function isIntegerGt(value, compareTo, msg) {
415
+ if (!guard_exports.isIntegerGt(value, compareTo))
416
+ _fail(`Expected ${value} to be integer > ${compareTo}`, msg);
417
+ return true;
418
+ }
419
+ function isIntegerGte(value, compareTo, msg) {
420
+ if (!guard_exports.isIntegerGte(value, compareTo))
421
+ _fail(`Expected ${value} to be integer >= ${compareTo}`, msg);
422
+ return true;
423
+ }
424
+ function isIntegerLt(value, compareTo, msg) {
425
+ if (!guard_exports.isIntegerLt(value, compareTo))
426
+ _fail(`Expected ${value} to be integer < ${compareTo}`, msg);
427
+ return true;
428
+ }
429
+ function isIntegerLte(value, compareTo, msg) {
430
+ if (!guard_exports.isIntegerLte(value, compareTo))
431
+ _fail(`Expected ${value} to be integer <= ${compareTo}`, msg);
432
+ return true;
433
+ }
434
+ function isIntegerBetween(value, min, max, msg) {
435
+ if (!guard_exports.isIntegerBetween(value, min, max))
436
+ _fail(`Expected integer ${min} <= ${value} <= ${max}.`, msg);
437
+ return true;
438
+ }
439
+ function isIntegerBetweenExclusive(value, min, max, msg) {
440
+ if (!guard_exports.isIntegerBetweenExclusive(value, min, max))
441
+ _fail(`Expected integer ${min} < ${value} < ${max}.`, msg);
442
+ return true;
443
+ }
444
+ function isNumberBetween(value, min, max, msg) {
445
+ if (!guard_exports.isNumberBetween(value, min, max))
446
+ _fail(`Expected number ${min} <= ${value} <= ${max}.`, msg);
447
+ return true;
448
+ }
449
+ function isNumberBetweenExclusive(value, min, max, msg) {
450
+ if (!guard_exports.isNumberBetweenExclusive(value, min, max))
451
+ _fail(`Expected number ${min} < ${value} < ${max}.`, msg);
452
+ return true;
453
+ }
454
+ function isNaNValue(value, msg) {
455
+ if (!guard_exports.isNaNValue(value))
456
+ _fail(`Expected ${value} to be NaN.`, msg);
457
+ return true;
458
+ }
459
+ function isInfinity(value, msg) {
460
+ if (!guard_exports.isInfinity(value))
461
+ _fail(`Expected ${value} to be +-Infinity.`, msg);
462
+ return true;
463
+ }
464
+ function isPosInfinity(value, msg) {
465
+ if (!guard_exports.isPosInfinity(value))
466
+ _fail(`Expected ${value} to be +Infinity.`, msg);
467
+ return true;
468
+ }
469
+ function isNegInfinity(value, msg) {
470
+ if (!guard_exports.isNegInfinity(value))
471
+ _fail(`Expected ${value} to be -Infinity.`, msg);
472
+ return true;
473
+ }
474
+ function isOddNumber(value, msg) {
475
+ if (!guard_exports.isOddNumber(value))
476
+ _fail(`Expected ${value} to odd number.`, msg);
477
+ return true;
478
+ }
479
+ function isEvenNumber(value, msg) {
480
+ if (!guard_exports.isEvenNumber(value))
481
+ _fail(`Expected ${value} to even number.`, msg);
482
+ return true;
483
+ }
484
+ function isIncluded(value, array, msg) {
485
+ if (!guard_exports.isIncluded(value, array))
486
+ _fail(`Expected ${value} to be included in [${array.map((v) => String(v)).join(", ")}].`, msg);
487
+ return true;
488
+ }
489
+ function isArrayIndex(index, array, msg) {
490
+ if (!guard_exports.isArrayIndex(index, array))
491
+ _fail(`Expected ${index} to be index for array [${array.map((v) => String(v)).join(", ")}]`, msg);
492
+ return true;
493
+ }
494
+ function isThrowing(throwTestFn, msg) {
495
+ if (!guard_exports.isThrowing(throwTestFn))
496
+ _fail(`Expected to throw`, msg);
497
+ return true;
498
+ }
499
+
500
+ // src/web/cookies.ts
501
+ var cookies_exports = {};
502
+ __export(cookies_exports, {
503
+ accept: () => accept,
504
+ decline: () => decline,
505
+ erase: () => erase,
506
+ eraseAll: () => eraseAll,
507
+ isConsentPending: () => isConsentPending,
508
+ read: () => read,
509
+ readBool: () => readBool,
510
+ readInt: () => readInt,
511
+ save: () => save,
512
+ setExpireDays: () => setExpireDays
117
513
  });
514
+ var ConsentCookieName = "ConsentCookie";
515
+ var _consent;
516
+ var _expires;
517
+ var str = _read(ConsentCookieName);
518
+ _consent = str === "accept" /* Accept */ || str === "decline" /* Decline */ ? str : void 0;
519
+ function setExpireDays(days) {
520
+ _expires = /* @__PURE__ */ new Date();
521
+ _expires.setDate(_expires.getDate() + days);
522
+ }
523
+ function isConsentPending() {
524
+ return _consent === void 0;
525
+ }
526
+ function accept() {
527
+ _consent = "accept" /* Accept */;
528
+ _save(ConsentCookieName, _consent);
529
+ }
530
+ function decline() {
531
+ _consent = "decline" /* Decline */;
532
+ _save(ConsentCookieName, _consent);
533
+ }
534
+ function _getList() {
535
+ let s = document.cookie;
536
+ return s.split(";").map((c) => c.trim());
537
+ }
538
+ function _save(name, value) {
539
+ let cookie = name + "=" + value.toString() + ";sameSite=Lax;";
540
+ if (_expires) {
541
+ cookie += "expires=" + _expires.toUTCString() + ";";
542
+ }
543
+ document.cookie = cookie;
544
+ return value;
545
+ }
546
+ function _read(name, defaultValue) {
547
+ let str2 = _getList().find((c) => c.startsWith(name + "="));
548
+ return str2 === void 0 ? defaultValue : str2.substring(name.length + 1);
549
+ }
550
+ function _erase(name) {
551
+ document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 UTC;";
552
+ }
553
+ function save(name, value) {
554
+ if (_consent === "accept" /* Accept */) {
555
+ _save(name, value);
556
+ }
557
+ return value;
558
+ }
559
+ function read(name, defaultValue) {
560
+ if (_consent === "accept" /* Accept */) {
561
+ return _read(name, defaultValue) || defaultValue;
562
+ } else {
563
+ return defaultValue;
564
+ }
565
+ }
566
+ function readInt(name, defaultValue) {
567
+ if (_consent === "accept" /* Accept */) {
568
+ let str2 = _read(name);
569
+ return str2 === void 0 ? defaultValue : parseInt(str2);
570
+ } else {
571
+ return defaultValue;
572
+ }
573
+ }
574
+ function readBool(name, defaultValue) {
575
+ if (_consent === "accept" /* Accept */) {
576
+ let str2 = _read(name);
577
+ return str2 === void 0 ? defaultValue : /true|1/i.test(str2);
578
+ } else {
579
+ return defaultValue;
580
+ }
581
+ }
582
+ function erase(name) {
583
+ if (_consent === "accept" /* Accept */ || name === ConsentCookieName) {
584
+ _erase(name);
585
+ }
586
+ }
587
+ function eraseAll() {
588
+ document.cookie.split(";").forEach((c) => erase(c.trim().split("=")[0]));
589
+ }
590
+
591
+ // src/web/device.ts
592
+ var device_exports = {};
593
+ __export(device_exports, {
594
+ DPI: () => DPI,
595
+ FontSize: () => FontSize,
596
+ HostAddress: () => HostAddress,
597
+ IsMobileDevice: () => IsMobileDevice,
598
+ IsTouchDevice: () => IsTouchDevice,
599
+ PxPerMm: () => PxPerMm,
600
+ ScrollbarWidth: () => ScrollbarWidth,
601
+ mmToPx: () => mmToPx,
602
+ pxToMm: () => pxToMm,
603
+ toPx: () => toPx
604
+ });
605
+ function getDPI() {
606
+ let el = document.createElement("div");
607
+ el.style.width = "1in";
608
+ document.body.appendChild(el);
609
+ let dpi = el.offsetWidth;
610
+ el.remove();
611
+ return dpi || 96;
612
+ }
613
+ function getScrollBarWidth() {
614
+ try {
615
+ let outer = document.createElement("div");
616
+ outer.style.visibility = "hidden";
617
+ outer.style.width = "100px";
618
+ document.body.appendChild(outer);
619
+ let widthNoScroll = outer.offsetWidth;
620
+ outer.style.overflow = "scroll";
621
+ let inner = document.createElement("div");
622
+ inner.style.width = "100%";
623
+ outer.appendChild(inner);
624
+ let widthWithScroll = inner.offsetWidth;
625
+ if (outer.parentNode) {
626
+ outer.parentNode.removeChild(outer);
627
+ }
628
+ return widthNoScroll - widthWithScroll;
629
+ } catch (e) {
630
+ return 0;
631
+ }
632
+ }
633
+ function getSystemFontSize() {
634
+ let tmpDiv = document.createElement("div");
635
+ tmpDiv.style.cssText = "display:inline-block; padding:0; line-height:1; position:absolute; visibility:hidden; font-size:1em";
636
+ tmpDiv.appendChild(document.createTextNode("M"));
637
+ document.body.appendChild(tmpDiv);
638
+ let fontsize = tmpDiv.offsetHeight;
639
+ document.body.removeChild(tmpDiv);
640
+ return fontsize;
641
+ }
642
+ function getIsTouchDevice() {
643
+ if ("ontouchstart" in window || "DocumentTouch" in window || "createTouch" in document && "createTouchList" in document) {
644
+ return true;
645
+ }
646
+ var prefixes = " -webkit- -moz- -o- -ms- ".split(" ");
647
+ var mq = function(query2) {
648
+ return window.matchMedia(query2).matches;
649
+ };
650
+ var query = ["(", prefixes.join("touch-enabled),("), "heartz", ")"].join("");
651
+ return mq(query);
652
+ }
653
+ function getIsMobileDevice() {
654
+ let a = navigator.userAgent || navigator.vendor || window.opera;
655
+ 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(a) || /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(a.substr(0, 4));
656
+ }
657
+ function getHostAddress() {
658
+ return location.protocol + "//" + location.host;
659
+ }
660
+ var UnitRegExp = /^(mm|cm|in|inch|px|em)$/;
661
+ var ValueUnitRegExp = /^([0-9\\.]+)(.*)$/;
662
+ var DPI = getDPI();
663
+ var PxPerMm = DPI / 25.4;
664
+ var ScrollbarWidth = getScrollBarWidth();
665
+ var FontSize = getSystemFontSize();
666
+ var IsTouchDevice = getIsTouchDevice();
667
+ var IsMobileDevice = getIsMobileDevice();
668
+ var HostAddress = getHostAddress();
669
+ function pxToMm(px) {
670
+ return px / PxPerMm;
671
+ }
672
+ function mmToPx(mm) {
673
+ return mm * PxPerMm;
674
+ }
675
+ function toPx(input) {
676
+ if (typeof input === "number") {
677
+ return input;
678
+ }
679
+ let value = NaN;
680
+ let unit = void 0;
681
+ let match = input.toString().match(ValueUnitRegExp);
682
+ if (match && match[1]) {
683
+ value = parseFloat(match[1]);
684
+ let unitStr = match[2] ? match[2].toLowerCase() : "undefined";
685
+ let unitStrOk = UnitRegExp.test(unitStr);
686
+ unit = unitStrOk ? unitStr : void 0;
687
+ if (!unit) {
688
+ console.log("Unknown unit '" + unitStr + "' => using 'px'.");
689
+ }
690
+ } else {
691
+ value = parseFloat(input);
692
+ }
693
+ assert_exports.finite(value, "value in function toPx");
694
+ switch (unit) {
695
+ case "mm":
696
+ return mmToPx(value);
697
+ case "cm":
698
+ return mmToPx(value) * 10;
699
+ case "in":
700
+ case "inch":
701
+ return mmToPx(value) * 25.4;
702
+ case "em":
703
+ return FontSize * value;
704
+ default:
705
+ case "px":
706
+ return value;
707
+ }
708
+ }
709
+
710
+ // src/guard/index.ts
711
+ var guard_exports = {};
712
+ __export(guard_exports, {
713
+ isArray: () => isArray2,
714
+ isArrayIndex: () => isArrayIndex2,
715
+ isArrayOrUndefined: () => isArrayOrUndefined2,
716
+ isBoolean: () => isBoolean2,
717
+ isBooleanOrUndefined: () => isBooleanOrUndefined2,
718
+ isDeepEqual: () => isDeepEqual2,
719
+ isEmptyArray: () => isEmptyArray2,
720
+ isEmptyArrayOrUndefined: () => isEmptyArrayOrUndefined2,
721
+ isEmptyString: () => isEmptyString2,
722
+ isEmptyStringOrUndefined: () => isEmptyStringOrUndefined2,
723
+ isEnumValue: () => isEnumValue3,
724
+ isEnumValueOrUndefined: () => isEnumValueOrUndefined2,
725
+ isEqual: () => isEqual2,
726
+ isEvenNumber: () => isEvenNumber2,
727
+ isFalse: () => isFalse2,
728
+ isFalseOrUndefined: () => isFalseOrUndefined2,
729
+ isFinite: () => isFinite3,
730
+ isFunction: () => isFunction2,
731
+ isFunctionOrUndefined: () => isFunctionOrUndefined2,
732
+ isIncluded: () => isIncluded2,
733
+ isInfinity: () => isInfinity2,
734
+ isInteger: () => isInteger2,
735
+ isIntegerBetween: () => isIntegerBetween2,
736
+ isIntegerBetweenExclusive: () => isIntegerBetweenExclusive2,
737
+ isIntegerEq: () => isIntegerEq2,
738
+ isIntegerGt: () => isIntegerGt2,
739
+ isIntegerGte: () => isIntegerGte2,
740
+ isIntegerLt: () => isIntegerLt2,
741
+ isIntegerLte: () => isIntegerLte2,
742
+ isIntegerOrUndefined: () => isIntegerOrUndefined2,
743
+ isNaNValue: () => isNaNValue2,
744
+ isNegInfinity: () => isNegInfinity2,
745
+ isNonEmptyArray: () => isNonEmptyArray2,
746
+ isNonEmptyArrayOrUndefined: () => isNonEmptyArrayOrUndefined2,
747
+ isNonEmptyString: () => isNonEmptyString2,
748
+ isNonEmptyStringOrUndefined: () => isNonEmptyStringOrUndefined2,
749
+ isNull: () => isNull2,
750
+ isNullish: () => isNullish2,
751
+ isNumber: () => isNumber2,
752
+ isNumberBetween: () => isNumberBetween2,
753
+ isNumberBetweenExclusive: () => isNumberBetweenExclusive2,
754
+ isNumberOrUndefined: () => isNumberOrUndefined2,
755
+ isObject: () => isObject2,
756
+ isObjectOrUndefined: () => isObjectOrUndefined2,
757
+ isOddNumber: () => isOddNumber2,
758
+ isPosInfinity: () => isPosInfinity2,
759
+ isString: () => isString2,
760
+ isStringOrUndefined: () => isStringOrUndefined2,
761
+ isThrowing: () => isThrowing2,
762
+ isTrue: () => isTrue2,
763
+ isTrueOrUndefined: () => isTrueOrUndefined2,
764
+ isTypedObject: () => isTypedObject2,
765
+ isUndefined: () => isUndefined2,
766
+ tryOr: () => tryOr
767
+ });
768
+
769
+ // src/utils/obj/index.ts
770
+ var obj_exports = {};
771
+ __export(obj_exports, {
772
+ deepEqual: () => deepEqual,
773
+ hasProperties: () => hasProperties,
774
+ isObject: () => isObject2
775
+ });
776
+ function hasProperties(obj, props) {
777
+ return isObject2(obj) && props.every((p) => p in obj);
778
+ }
779
+ function deepEqual(a, b) {
780
+ if (a === b) return true;
781
+ if (a === null || b === null) return false;
782
+ if (typeof a !== "object" || typeof b !== "object") return false;
783
+ if (Array.isArray(a) && Array.isArray(b)) {
784
+ if (a.length !== b.length) return false;
785
+ return a.every((val, i) => deepEqual(val, b[i]));
786
+ }
787
+ if (Array.isArray(a) !== Array.isArray(b)) return false;
788
+ const keysA = Object.keys(a);
789
+ const keysB = Object.keys(b);
790
+ if (keysA.length !== keysB.length) return false;
791
+ for (const key of keysA) {
792
+ if (!Object.prototype.hasOwnProperty.call(b, key)) return false;
793
+ if (!deepEqual(a[key], b[key])) return false;
794
+ }
795
+ return true;
796
+ }
118
797
 
119
798
  // src/utils/enum/index.ts
120
799
  var enum_exports = {};
121
800
  __export(enum_exports, {
122
- getEnumValues: () => getEnumValues
801
+ assertEnumValue: () => assertEnumValue,
802
+ forEachEnum: () => forEachEnum,
803
+ getEnumEntries: () => getEnumEntries,
804
+ getEnumKey: () => getEnumKey,
805
+ getEnumKeys: () => getEnumKeys,
806
+ getEnumValues: () => getEnumValues,
807
+ isEnumValue: () => isEnumValue2
123
808
  });
809
+ function getEnumKeys(e) {
810
+ return Object.keys(e).filter((k) => isNaN(Number(k)));
811
+ }
124
812
  function getEnumValues(e) {
125
- return Object.keys(e).filter((key) => Number.isNaN(Number(key))).map((key) => e[key]);
813
+ return getEnumKeys(e).map((k) => e[k]);
814
+ }
815
+ function getEnumEntries(e) {
816
+ return getEnumKeys(e).map((k) => [k, e[k]]);
817
+ }
818
+ function getEnumKey(e, value) {
819
+ return getEnumKeys(e).find((k) => e[k] === value);
820
+ }
821
+ function forEachEnum(e, callback) {
822
+ for (const [k, v] of getEnumEntries(e)) callback(k, v);
823
+ }
824
+ function isEnumValue2(e, value) {
825
+ return getEnumValues(e).includes(value);
826
+ }
827
+ function assertEnumValue(e, value) {
828
+ if (!isEnumValue2(e, value)) {
829
+ throw new TypeError(`Invalid enum value: ${String(value)}`);
830
+ }
126
831
  }
127
832
 
128
- // src/utils/is/index.ts
129
- function isUndefined(value) {
833
+ // src/guard/index.ts
834
+ function isEqual2(value1, value2) {
835
+ return value1 === value2;
836
+ }
837
+ function isDeepEqual2(value1, value2) {
838
+ return deepEqual(value1, value2);
839
+ }
840
+ function isUndefined2(value) {
130
841
  return value === void 0;
131
842
  }
132
- function isNull(value) {
843
+ function isNull2(value) {
133
844
  return value === null;
134
845
  }
135
- function isNullish(value) {
846
+ function isNullish2(value) {
136
847
  return value === void 0 || value === null;
137
848
  }
138
- function isObject(value) {
139
- return typeof value === "object" && value !== null && !isArray(value);
849
+ function isObject2(value) {
850
+ return typeof value === "object" && value !== null && !isArray2(value);
140
851
  }
141
- function isObjectOrUndefined(value) {
142
- return value === void 0 || isObject(value);
852
+ function isObjectOrUndefined2(value) {
853
+ return value === void 0 || isObject2(value);
143
854
  }
144
- function isArray(a) {
855
+ function isTypedObject2(obj, keys) {
856
+ return isObject2(obj) && keys.every((k) => k in obj);
857
+ }
858
+ function isArray2(a) {
145
859
  return !!a && Object.prototype.toString.call(a) === "[object Array]";
146
860
  }
147
- function isArrayOrUndefined(value) {
148
- return value === void 0 || isArray(value);
861
+ function isArrayOrUndefined2(value) {
862
+ return value === void 0 || isArray2(value);
149
863
  }
150
- function isEmptyArray(a) {
151
- return isArray(a) && a.length === 0;
864
+ function isEmptyArray2(a) {
865
+ return isArray2(a) && a.length === 0;
152
866
  }
153
- function isNonEmptyArray(a) {
154
- return isArray(a) && a.length > 0;
867
+ function isNonEmptyArray2(a) {
868
+ return isArray2(a) && a.length > 0;
155
869
  }
156
- function isEmptyArrayOrUndefined(a) {
157
- return isArray(a) && a.length === 0 || a === void 0;
870
+ function isEmptyArrayOrUndefined2(a) {
871
+ return isArray2(a) && a.length === 0 || a === void 0;
158
872
  }
159
- function isNonEmptyArrayOrUndefined(a) {
160
- return isArray(a) && a.length > 0 || a === void 0;
873
+ function isNonEmptyArrayOrUndefined2(a) {
874
+ return isArray2(a) && a.length > 0 || a === void 0;
161
875
  }
162
- function isString(value) {
876
+ function isString2(value) {
163
877
  return typeof value === "string";
164
878
  }
165
- function isEmptyString(value) {
879
+ function isEmptyString2(value) {
166
880
  return typeof value === "string" && value.length === 0;
167
881
  }
168
- function isNonEmptyString(value) {
882
+ function isNonEmptyString2(value) {
169
883
  return typeof value === "string" && value.length > 0;
170
884
  }
171
- function isStringOrUndefined(value) {
885
+ function isStringOrUndefined2(value) {
172
886
  return value === void 0 || typeof value === "string";
173
887
  }
174
- function isEmptyStringOrUndefined(value) {
888
+ function isEmptyStringOrUndefined2(value) {
175
889
  return typeof value === "string" && value.length === 0 || value === void 0;
176
890
  }
177
- function isNonEmptyStringOrUndefined(value) {
891
+ function isNonEmptyStringOrUndefined2(value) {
178
892
  return typeof value === "string" && value.length > 0 || value === void 0;
179
893
  }
180
- function isBoolean(value) {
894
+ function isBoolean2(value) {
181
895
  return typeof value === "boolean";
182
896
  }
183
- function isBooleanOrUndefined(value) {
897
+ function isBooleanOrUndefined2(value) {
184
898
  return value === void 0 || typeof value === "boolean";
185
899
  }
186
- function isFunction(value) {
900
+ function isTrue2(value) {
901
+ return value === true;
902
+ }
903
+ function isTrueOrUndefined2(value) {
904
+ return value === true || value === void 0;
905
+ }
906
+ function isFalse2(value) {
907
+ return value === false;
908
+ }
909
+ function isFalseOrUndefined2(value) {
910
+ return value === false || value === void 0;
911
+ }
912
+ function isFunction2(value) {
187
913
  return typeof value === "function";
188
914
  }
189
- function isFunctionOrUndefined(value) {
915
+ function isFunctionOrUndefined2(value) {
190
916
  return value === void 0 || typeof value === "function";
191
917
  }
192
- function isEnumValue(value, enumObj, name = "value") {
918
+ function isEnumValue3(value, enumObj, name = "value") {
193
919
  return getEnumValues(enumObj).some((v) => v === value);
194
920
  }
195
- function isEnumValueOrUndefined(value, enumObj, name = "value") {
921
+ function isEnumValueOrUndefined2(value, enumObj, name = "value") {
196
922
  return value === void 0 || getEnumValues(enumObj).some((v) => v === value);
197
923
  }
198
- function isNumber(value) {
924
+ function isNumber2(value) {
199
925
  return typeof value === "number";
200
926
  }
201
- function isNumberOrUndefined(value) {
927
+ function isNumberOrUndefined2(value) {
202
928
  return typeof value === "number" || value === void 0;
203
929
  }
204
- function isFinite2(value) {
930
+ function isFinite3(value) {
205
931
  return typeof value === "number" && Number.isFinite(value);
206
932
  }
207
- function isInteger(n) {
208
- return typeof n === "number" && isFinite2(n) && n === Math.trunc(n);
933
+ function isInteger2(n) {
934
+ return typeof n === "number" && isFinite3(n) && n === Math.trunc(n);
935
+ }
936
+ function isIntegerOrUndefined2(n) {
937
+ return typeof n === "number" && isFinite3(n) && n === Math.trunc(n) || n === void 0;
938
+ }
939
+ function isIntegerEq2(value, compareTo) {
940
+ return isInteger2(value) && value === compareTo;
941
+ }
942
+ function isIntegerGt2(value, compareTo) {
943
+ return isInteger2(value) && isNumber2(compareTo) && value > compareTo;
209
944
  }
210
- function isIntegerOrUndefined(n) {
211
- return typeof n === "number" && isFinite2(n) && n === Math.trunc(n) || n === void 0;
945
+ function isIntegerGte2(value, compareTo) {
946
+ return isInteger2(value) && isNumber2(compareTo) && value >= compareTo;
212
947
  }
213
- function isIntegerEq(value, compareTo) {
214
- return isInteger(value) && value === compareTo;
948
+ function isIntegerLt2(value, compareTo) {
949
+ return isInteger2(value) && isNumber2(compareTo) && value < compareTo;
215
950
  }
216
- function isIntegerGt(value, compareTo) {
217
- return isInteger(value) && value > compareTo;
951
+ function isIntegerLte2(value, compareTo) {
952
+ return isInteger2(value) && isNumber2(compareTo) && value <= compareTo;
218
953
  }
219
- function isIntegerGte(value, compareTo) {
220
- return isInteger(value) && value >= compareTo;
954
+ function isIntegerBetween2(value, min, max) {
955
+ return isInteger2(value) && isNumber2(min) && isNumber2(max) && value >= min && value <= max;
221
956
  }
222
- function isIntegerLt(value, compareTo) {
223
- return isInteger(value) && value < compareTo;
957
+ function isIntegerBetweenExclusive2(value, min, max) {
958
+ return isInteger2(value) && isNumber2(min) && isNumber2(max) && value > min && value < max;
224
959
  }
225
- function isIntegerLte(value, compareTo) {
226
- return isInteger(value) && value <= compareTo;
960
+ function isNumberBetween2(value, min, max) {
961
+ return isNumber2(value) && isNumber2(min) && isNumber2(max) && value >= min && value <= max;
227
962
  }
228
- function isIntegerBetween(value, min, max) {
229
- return isInteger(value) && value >= min && value <= max;
963
+ function isNumberBetweenExclusive2(value, min, max) {
964
+ return isNumber2(value) && isNumber2(min) && isNumber2(max) && value > min && value < max;
230
965
  }
231
- function isNaNValue(value) {
966
+ function isNaNValue2(value) {
232
967
  return typeof value === "number" && Number.isNaN(value);
233
968
  }
234
- function isInfinity(value) {
969
+ function isInfinity2(value) {
235
970
  return typeof value === "number" && Math.abs(value) === Infinity;
236
971
  }
237
- function isPosInfinity(value) {
972
+ function isPosInfinity2(value) {
238
973
  return typeof value === "number" && value === Infinity;
239
974
  }
240
- function isNegInfinity(value) {
975
+ function isNegInfinity2(value) {
241
976
  return typeof value === "number" && value === -Infinity;
242
977
  }
978
+ function isOddNumber2(value) {
979
+ return isInteger2(value) && value % 2 === 1;
980
+ }
981
+ function isEvenNumber2(value) {
982
+ return isInteger2(value) && value % 2 === 0;
983
+ }
984
+ function isIncluded2(value, array) {
985
+ return array.includes(value);
986
+ }
987
+ function isArrayIndex2(index, array) {
988
+ return isInteger2(index) && isArray2(array) && index >= 0 && index < array.length;
989
+ }
990
+ function isThrowing2(throwTestFn) {
991
+ try {
992
+ throwTestFn();
993
+ return false;
994
+ } catch (err) {
995
+ return true;
996
+ }
997
+ }
998
+ function tryOr(tryFn, orVal) {
999
+ try {
1000
+ return tryFn();
1001
+ } catch (err) {
1002
+ return isFunction2(orVal) ? orVal() : orVal;
1003
+ }
1004
+ }
1005
+
1006
+ // src/utils/index.ts
1007
+ var utils_exports = {};
1008
+ __export(utils_exports, {
1009
+ Arr: () => arr_exports,
1010
+ Dom: () => dom_exports,
1011
+ Enum: () => enum_exports,
1012
+ Is: () => Is,
1013
+ Map: () => map_exports,
1014
+ Math: () => math_exports,
1015
+ Obj: () => obj_exports,
1016
+ Str: () => str_exports
1017
+ });
243
1018
 
244
1019
  // src/utils/arr/index.ts
1020
+ var arr_exports = {};
1021
+ __export(arr_exports, {
1022
+ arrayContains: () => arrayContains,
1023
+ chunckArray: () => chunckArray,
1024
+ duplicate: () => duplicate,
1025
+ fillArray: () => fillArray,
1026
+ getRangeArray: () => getRangeArray,
1027
+ getSequenceArray: () => getSequenceArray,
1028
+ isArray: () => isArray2,
1029
+ mapRangeArray: () => mapRangeArray,
1030
+ mapSequenceArray: () => mapSequenceArray,
1031
+ removeDuplicates: () => removeDuplicates,
1032
+ removeDuplicatesCmp: () => removeDuplicatesCmp,
1033
+ toArray: () => toArray
1034
+ });
245
1035
  function toArray(a) {
246
- return isArray(a) ? a : [a];
1036
+ return isArray2(a) ? a : [a];
247
1037
  }
248
1038
  function duplicate(a) {
249
1039
  return a === void 0 ? a : a.slice();
@@ -255,13 +1045,13 @@ function removeDuplicatesCmp(arr, cmp2) {
255
1045
  return arr.filter((t1, index, self) => index === self.findIndex((t2) => cmp2(t1, t2)));
256
1046
  }
257
1047
  function fillArray(fillValue, fillCount) {
258
- if (!isInteger(fillCount) || fillCount < 0) {
1048
+ if (!isInteger2(fillCount) || fillCount < 0) {
259
1049
  throw new Error("fillArray: Invalid fillCount = " + fillCount);
260
1050
  }
261
1051
  return new Array(fillCount).fill(fillValue);
262
1052
  }
263
1053
  function mapSequenceArray(len, fn) {
264
- if (!isInteger(len) || len < 0) {
1054
+ if (!isInteger2(len) || len < 0) {
265
1055
  throw new Error("mapSequenceArray: Invalid len = " + len);
266
1056
  }
267
1057
  let arr = new Array(len);
@@ -274,10 +1064,10 @@ function getSequenceArray(len) {
274
1064
  return mapSequenceArray(len, (i) => i);
275
1065
  }
276
1066
  function mapRangeArray(start, end, fn) {
277
- if (!isInteger(start)) {
1067
+ if (!isInteger2(start)) {
278
1068
  throw new Error("mapRangeArray: Invalid start = " + end);
279
1069
  }
280
- if (!isInteger(end)) {
1070
+ if (!isInteger2(end)) {
281
1071
  throw new Error("mapRangeArray: Invalid end = " + end);
282
1072
  }
283
1073
  let len = Math.abs(end - start) + 1;
@@ -294,7 +1084,7 @@ function arrayContains(arg, item) {
294
1084
  return arg.indexOf(item) >= 0;
295
1085
  }
296
1086
  function chunckArray(arr, chunckSize) {
297
- if (!isInteger(chunckSize) || chunckSize < 1) {
1087
+ if (!isInteger2(chunckSize) || chunckSize < 1) {
298
1088
  throw new Error("chunckArray: Invalid chunckSize = " + chunckSize);
299
1089
  }
300
1090
  let result = [];
@@ -327,261 +1117,8 @@ __export(dom_exports, {
327
1117
  setWidth: () => setWidth,
328
1118
  styleLayoutChanged: () => styleLayoutChanged
329
1119
  });
330
-
331
- // src/modules/assert.ts
332
- var Assert;
333
- ((Assert2) => {
334
- let errorConstructor = Error;
335
- function setErrorClass(ec) {
336
- errorConstructor = ec ?? Error;
337
- }
338
- Assert2.setErrorClass = setErrorClass;
339
- function throwError(errorMsg, userMsg) {
340
- throw new errorConstructor("Assertion Error: " + errorMsg + (userMsg ? " " + userMsg : ""));
341
- }
342
- function is_int(a) {
343
- return typeof a === "number" && isFinite(a) && a === Math.trunc(a);
344
- }
345
- function is_number(a) {
346
- return typeof a === "number";
347
- }
348
- function assert(a, userMsg) {
349
- if (!a) {
350
- throwError(userMsg ?? "Assertion failed!");
351
- }
352
- }
353
- Assert2.assert = assert;
354
- function assertEnum(value, enumObj, name = "value") {
355
- if (!getEnumValues(enumObj).some((v) => v === value)) {
356
- throw new TypeError(`Invalid ${name} enum value: ${value}`);
357
- }
358
- }
359
- Assert2.assertEnum = assertEnum;
360
- function interrupt(userMsg) {
361
- throwError(userMsg ?? "Interrupted!");
362
- }
363
- Assert2.interrupt = interrupt;
364
- function int(a, userMsg) {
365
- if (!is_int(a)) {
366
- throwError(`Expected ${a} to be integer.`, userMsg);
367
- }
368
- return a;
369
- }
370
- Assert2.int = int;
371
- function eq(a, b, userMsg) {
372
- if (a !== b) {
373
- throwError(`Expected ${a} to equal ${b}.`, userMsg);
374
- }
375
- return a;
376
- }
377
- Assert2.eq = eq;
378
- function int_eq(a, b, userMsg) {
379
- if (!(is_int(a) && is_number(b) && a === b)) {
380
- throwError(`Expected ${a} to be integer equal to ${b}.`, userMsg);
381
- }
382
- return a;
383
- }
384
- Assert2.int_eq = int_eq;
385
- function int_lt(a, b, userMsg) {
386
- if (!(is_int(a) && is_number(b) && a < b)) {
387
- throwError(`Expected ${a} to be integer less than ${b}.`, userMsg);
388
- }
389
- return a;
390
- }
391
- Assert2.int_lt = int_lt;
392
- function int_lte(a, b, userMsg) {
393
- if (!(is_int(a) && is_number(b) && a <= b)) {
394
- throwError(`Expected ${a} to be integer less than or equal to ${b}.`, userMsg);
395
- }
396
- return a;
397
- }
398
- Assert2.int_lte = int_lte;
399
- function int_gt(a, b, userMsg) {
400
- if (!(is_int(a) && is_number(b) && a > b)) {
401
- throwError(`Expected ${a} to be integer greater than ${b}.`, userMsg);
402
- }
403
- return a;
404
- }
405
- Assert2.int_gt = int_gt;
406
- function int_gte(a, b, userMsg) {
407
- if (!(is_int(a) && is_number(b) && a >= b)) {
408
- throwError(`Expected ${a} to be integer greater than or equal to ${b}.`, userMsg);
409
- }
410
- return a;
411
- }
412
- Assert2.int_gte = int_gte;
413
- function int_between(a, min, max, userMsg) {
414
- if (!(is_int(a) && is_number(min) && is_number(max) && a >= min && a <= max)) {
415
- throwError(`Expected ${a} to be integer between ${min} and ${max}.`, userMsg);
416
- }
417
- return a;
418
- }
419
- Assert2.int_between = int_between;
420
- function odd(a, userMsg) {
421
- if (!(is_int(a) && a % 2 === 1)) {
422
- throwError(`Expected ${a} to be odd number.`, userMsg);
423
- }
424
- return a;
425
- }
426
- Assert2.odd = odd;
427
- function even(a, userMsg) {
428
- if (!(is_int(a) && a % 2 === 0)) {
429
- throwError(`Expected ${a} to be even number.`, userMsg);
430
- }
431
- return a;
432
- }
433
- Assert2.even = even;
434
- function in_group(a, group, userMsg) {
435
- if (!group.some((e) => e === a)) {
436
- let strGroup = group.map((v) => String(v)).join(", ");
437
- throwError(`Expected ${a} to be in group [${strGroup}].`, userMsg);
438
- }
439
- return a;
440
- }
441
- Assert2.in_group = in_group;
442
- function finite(a, userMsg) {
443
- if (!(is_number(a) && isFinite(a))) {
444
- throwError(`Expected ${a} to be finite number.`, userMsg);
445
- }
446
- return a;
447
- }
448
- Assert2.finite = finite;
449
- function array_id(arr, id, userMsg) {
450
- if (!(is_int(id) && id >= 0 && id < arr.length)) {
451
- throwError(`Expected ${id} to be array index in bounds [0..${arr.length - 1}].`, userMsg);
452
- }
453
- return id;
454
- }
455
- Assert2.array_id = array_id;
456
- function array_elem(arr, id, userMsg) {
457
- return arr[array_id(arr, id, userMsg)];
458
- }
459
- Assert2.array_elem = array_elem;
460
- function require2(arg, userMsg) {
461
- if (arg === void 0) {
462
- throwError("Required value is undefined.", userMsg);
463
- } else {
464
- return arg;
465
- }
466
- }
467
- Assert2.require = require2;
468
- })(Assert || (Assert = {}));
469
-
470
- // src/modules/device.ts
471
- var Device;
472
- ((Device2) => {
473
- function getDPI() {
474
- let el = document.createElement("div");
475
- el.style.width = "1in";
476
- document.body.appendChild(el);
477
- let dpi = el.offsetWidth;
478
- el.remove();
479
- return dpi || 96;
480
- }
481
- function getScrollBarWidth() {
482
- try {
483
- let outer = document.createElement("div");
484
- outer.style.visibility = "hidden";
485
- outer.style.width = "100px";
486
- document.body.appendChild(outer);
487
- let widthNoScroll = outer.offsetWidth;
488
- outer.style.overflow = "scroll";
489
- let inner = document.createElement("div");
490
- inner.style.width = "100%";
491
- outer.appendChild(inner);
492
- let widthWithScroll = inner.offsetWidth;
493
- if (outer.parentNode) {
494
- outer.parentNode.removeChild(outer);
495
- }
496
- return widthNoScroll - widthWithScroll;
497
- } catch (e) {
498
- return 0;
499
- }
500
- }
501
- function getSystemFontSize() {
502
- let tmpDiv = document.createElement("div");
503
- tmpDiv.style.cssText = "display:inline-block; padding:0; line-height:1; position:absolute; visibility:hidden; font-size:1em";
504
- tmpDiv.appendChild(document.createTextNode("M"));
505
- document.body.appendChild(tmpDiv);
506
- let fontsize = tmpDiv.offsetHeight;
507
- document.body.removeChild(tmpDiv);
508
- return fontsize;
509
- }
510
- function getIsTouchDevice() {
511
- if ("ontouchstart" in window || "DocumentTouch" in window || "createTouch" in document && "createTouchList" in document) {
512
- return true;
513
- }
514
- var prefixes = " -webkit- -moz- -o- -ms- ".split(" ");
515
- var mq = function(query2) {
516
- return window.matchMedia(query2).matches;
517
- };
518
- var query = ["(", prefixes.join("touch-enabled),("), "heartz", ")"].join("");
519
- return mq(query);
520
- }
521
- function getIsMobileDevice() {
522
- let a = navigator.userAgent || navigator.vendor || window.opera;
523
- 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(a) || /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(a.substr(0, 4));
524
- }
525
- function getHostAddress() {
526
- return location.protocol + "//" + location.host;
527
- }
528
- const UnitRegExp = /^(mm|cm|in|inch|px|em)$/;
529
- const ValueUnitRegExp = /^([0-9\\.]+)(.*)$/;
530
- Device2.DPI = getDPI();
531
- Device2.PxPerMm = Device2.DPI / 25.4;
532
- Device2.ScrollbarWidth = getScrollBarWidth();
533
- Device2.FontSize = getSystemFontSize();
534
- Device2.IsTouchDevice = getIsTouchDevice();
535
- Device2.IsMobileDevice = getIsMobileDevice();
536
- Device2.HostAddress = getHostAddress();
537
- function pxToMm(px) {
538
- return px / Device2.PxPerMm;
539
- }
540
- Device2.pxToMm = pxToMm;
541
- function mmToPx(mm) {
542
- return mm * Device2.PxPerMm;
543
- }
544
- Device2.mmToPx = mmToPx;
545
- function toPx2(input) {
546
- if (typeof input === "number") {
547
- return input;
548
- }
549
- let value = NaN;
550
- let unit = void 0;
551
- let match = input.toString().match(ValueUnitRegExp);
552
- if (match && match[1]) {
553
- value = parseFloat(match[1]);
554
- let unitStr = match[2] ? match[2].toLowerCase() : "undefined";
555
- let unitStrOk = UnitRegExp.test(unitStr);
556
- unit = unitStrOk ? unitStr : void 0;
557
- if (!unit) {
558
- console.log("Unknown unit '" + unitStr + "' => using 'px'.");
559
- }
560
- } else {
561
- value = parseFloat(input);
562
- }
563
- Assert.finite(value, "value in function toPx");
564
- switch (unit) {
565
- case "mm":
566
- return mmToPx(value);
567
- case "cm":
568
- return mmToPx(value) * 10;
569
- case "in":
570
- case "inch":
571
- return mmToPx(value) * 25.4;
572
- case "em":
573
- return Device2.FontSize * value;
574
- default:
575
- case "px":
576
- return value;
577
- }
578
- }
579
- Device2.toPx = toPx2;
580
- })(Device || (Device = {}));
581
-
582
- // src/utils/dom/index.ts
583
- function toPx(value) {
584
- return value === void 0 ? void 0 : Device.toPx(value);
1120
+ function toPx2(value) {
1121
+ return value === void 0 ? void 0 : device_exports.toPx(value);
585
1122
  }
586
1123
  function hasClass(el, className) {
587
1124
  if (className.length === 0) {
@@ -672,38 +1209,38 @@ function getPadding(style) {
672
1209
  if (!style) {
673
1210
  return { top: 0, right: 0, bottom: 0, left: 0 };
674
1211
  }
675
- let top = toPx(style.paddingTop);
676
- let right = toPx(style.paddingRight);
677
- let bottom = toPx(style.paddingBottom);
678
- let left = toPx(style.paddingLeft);
1212
+ let top = toPx2(style.paddingTop);
1213
+ let right = toPx2(style.paddingRight);
1214
+ let bottom = toPx2(style.paddingBottom);
1215
+ let left = toPx2(style.paddingLeft);
679
1216
  let padding = (style.padding ?? "").toString().split(" ").filter((s) => s.length > 0);
680
1217
  switch (padding.length) {
681
1218
  case 0:
682
1219
  break;
683
1220
  case 1:
684
- top ?? (top = toPx(padding[0]));
685
- right ?? (right = toPx(padding[0]));
686
- bottom ?? (bottom = toPx(padding[0]));
687
- left ?? (left = toPx(padding[0]));
1221
+ top ?? (top = toPx2(padding[0]));
1222
+ right ?? (right = toPx2(padding[0]));
1223
+ bottom ?? (bottom = toPx2(padding[0]));
1224
+ left ?? (left = toPx2(padding[0]));
688
1225
  break;
689
1226
  case 2:
690
- top ?? (top = toPx(padding[0]));
691
- right ?? (right = toPx(padding[1]));
692
- bottom ?? (bottom = toPx(padding[0]));
693
- left ?? (left = toPx(padding[1]));
1227
+ top ?? (top = toPx2(padding[0]));
1228
+ right ?? (right = toPx2(padding[1]));
1229
+ bottom ?? (bottom = toPx2(padding[0]));
1230
+ left ?? (left = toPx2(padding[1]));
694
1231
  break;
695
1232
  case 3:
696
- top ?? (top = toPx(padding[0]));
697
- right ?? (right = toPx(padding[1]));
698
- bottom ?? (bottom = toPx(padding[2]));
699
- left ?? (left = toPx(padding[1]));
1233
+ top ?? (top = toPx2(padding[0]));
1234
+ right ?? (right = toPx2(padding[1]));
1235
+ bottom ?? (bottom = toPx2(padding[2]));
1236
+ left ?? (left = toPx2(padding[1]));
700
1237
  break;
701
1238
  case 4:
702
1239
  default:
703
- top ?? (top = toPx(padding[0]));
704
- right ?? (right = toPx(padding[1]));
705
- bottom ?? (bottom = toPx(padding[2]));
706
- left ?? (left = toPx(padding[3]));
1240
+ top ?? (top = toPx2(padding[0]));
1241
+ right ?? (right = toPx2(padding[1]));
1242
+ bottom ?? (bottom = toPx2(padding[2]));
1243
+ left ?? (left = toPx2(padding[3]));
707
1244
  break;
708
1245
  }
709
1246
  top ?? (top = 0);
@@ -713,12 +1250,12 @@ function getPadding(style) {
713
1250
  return { top, right, bottom, left };
714
1251
  }
715
1252
  function getDimension(style) {
716
- let left = toPx(style?.left);
717
- let right = toPx(style?.right);
718
- let top = toPx(style?.top);
719
- let bottom = toPx(style?.bottom);
720
- let width = toPx(style?.width);
721
- let height = toPx(style?.height);
1253
+ let left = toPx2(style?.left);
1254
+ let right = toPx2(style?.right);
1255
+ let top = toPx2(style?.top);
1256
+ let bottom = toPx2(style?.bottom);
1257
+ let width = toPx2(style?.width);
1258
+ let height = toPx2(style?.height);
722
1259
  if (width === void 0 && left !== void 0 && right !== void 0) {
723
1260
  width = right - left;
724
1261
  }
@@ -753,9 +1290,7 @@ __export(map_exports, {
753
1290
  getMapKeys: () => getMapKeys
754
1291
  });
755
1292
  function getMapKeys(map) {
756
- let keys = [];
757
- map.forEach((value, key) => keys.push(key));
758
- return keys;
1293
+ return [...map.keys()];
759
1294
  }
760
1295
 
761
1296
  // src/utils/math/index.ts
@@ -767,8 +1302,8 @@ __export(math_exports, {
767
1302
  cmp: () => cmp,
768
1303
  interpolateCoord: () => interpolateCoord,
769
1304
  interpolateY: () => interpolateY,
770
- isInteger: () => isInteger,
771
- isNumber: () => isNumber,
1305
+ isInteger: () => isInteger2,
1306
+ isNumber: () => isNumber2,
772
1307
  linearToDecibels: () => linearToDecibels,
773
1308
  mod: () => mod,
774
1309
  romanize: () => romanize,
@@ -788,7 +1323,7 @@ function mod(m, n) {
788
1323
  return (m % n + n) % n;
789
1324
  }
790
1325
  function romanize(n) {
791
- if (!isInteger(n) || n < 0) {
1326
+ if (!isInteger2(n) || n < 0) {
792
1327
  throw new Error("romanize: Invalid n = " + n);
793
1328
  }
794
1329
  var digits = String(+n).split("");
@@ -829,7 +1364,7 @@ function romanize(n) {
829
1364
  return Array(+digits.join("") + 1).join("M") + roman;
830
1365
  }
831
1366
  function toOrdinalNumber(n) {
832
- if (!isInteger(n)) {
1367
+ if (!isInteger2(n)) {
833
1368
  throw new Error("toOrdinalNumber: Invalid n = " + n);
834
1369
  }
835
1370
  const nStr = n.toString();
@@ -882,87 +1417,58 @@ function cmp(a, b) {
882
1417
  return a < b ? -1 : a > b ? 1 : 0;
883
1418
  }
884
1419
 
885
- // src/utils/obj/index.ts
886
- var obj_exports = {};
887
- __export(obj_exports, {
888
- deepEqual: () => deepEqual,
889
- hasProperties: () => hasProperties,
890
- isObject: () => isObject
891
- });
892
- function hasProperties(obj, props) {
893
- return isObject(obj) && props.every((p) => p in obj);
894
- }
895
- function deepEqual(a, b) {
896
- if (a === b) return true;
897
- if (a === null || b === null) return false;
898
- if (typeof a !== "object" || typeof b !== "object") return false;
899
- if (Array.isArray(a) && Array.isArray(b)) {
900
- if (a.length !== b.length) return false;
901
- return a.every((val, i) => deepEqual(val, b[i]));
902
- }
903
- if (Array.isArray(a) !== Array.isArray(b)) return false;
904
- const keysA = Object.keys(a);
905
- const keysB = Object.keys(b);
906
- if (keysA.length !== keysB.length) return false;
907
- for (const key of keysA) {
908
- if (!Object.prototype.hasOwnProperty.call(b, key)) return false;
909
- if (!deepEqual(a[key], b[key])) return false;
910
- }
911
- return true;
912
- }
913
-
914
1420
  // src/utils/str/index.ts
915
1421
  var str_exports = {};
916
1422
  __export(str_exports, {
917
1423
  charCount: () => charCount,
918
1424
  chunkString: () => chunkString,
919
1425
  insertAt: () => insertAt,
920
- isString: () => isString,
1426
+ isString: () => isString2,
921
1427
  makeSentenceFromPascal: () => makeSentenceFromPascal,
922
1428
  removeAt: () => removeAt,
923
1429
  repeatString: () => repeatString,
924
1430
  replaceAt: () => replaceAt,
925
1431
  toCharArray: () => toCharArray
926
1432
  });
927
- function toCharArray(str) {
928
- return str.split("");
1433
+ function toCharArray(str2) {
1434
+ return str2.split("");
929
1435
  }
930
1436
  function repeatString(repeatString2, repeatCount) {
931
- if (!isInteger(repeatCount) || repeatCount < 0) {
1437
+ if (!isInteger2(repeatCount) || repeatCount < 0) {
932
1438
  throw new Error("repeatStr: Invalid repeatCount = " + repeatCount);
933
1439
  }
934
1440
  return new Array(repeatCount + 1).join(repeatString2);
935
1441
  }
936
- function chunkString(str, chunkSize) {
937
- if (!isInteger(chunkSize) || chunkSize < 1) {
1442
+ function chunkString(str2, chunkSize) {
1443
+ if (!isInteger2(chunkSize) || chunkSize < 1) {
938
1444
  throw new Error("chunckString: Invalid chuckSize = " + chunkSize);
939
1445
  }
940
1446
  let result = [];
941
- for (let i = 0; i < str.length; i += chunkSize) {
942
- result.push(str.slice(i, i + chunkSize));
1447
+ for (let i = 0; i < str2.length; i += chunkSize) {
1448
+ result.push(str2.slice(i, i + chunkSize));
943
1449
  }
944
1450
  return result;
945
1451
  }
946
- function replaceAt(str, pos, removeCount, insert) {
947
- if (!isInteger(removeCount) || removeCount < 0) {
1452
+ function replaceAt(str2, pos, removeCount, insert) {
1453
+ if (!isInteger2(removeCount) || removeCount < 0) {
948
1454
  throw new Error("replaceAt: Invalid removeCount = " + removeCount);
949
- } else if (!isInteger(pos) || pos < 0 || pos + removeCount > str.length) {
950
- throw new Error("replaceAt: Invalid pos = " + pos + ", removeCount = " + removeCount + ", str.length = " + str.length);
1455
+ } else if (!isInteger2(pos) || pos < 0 || pos + removeCount > str2.length) {
1456
+ throw new Error("replaceAt: Invalid pos = " + pos + ", removeCount = " + removeCount + ", str.length = " + str2.length);
951
1457
  } else {
952
- return str.substring(0, pos) + insert + str.substring(pos + removeCount);
1458
+ return str2.substring(0, pos) + insert + str2.substring(pos + removeCount);
953
1459
  }
954
1460
  }
955
- function insertAt(str, pos, insertStr) {
956
- return replaceAt(str, pos, 0, insertStr);
1461
+ function insertAt(str2, pos, insertStr) {
1462
+ return replaceAt(str2, pos, 0, insertStr);
957
1463
  }
958
- function removeAt(str, pos, removeCount) {
959
- return replaceAt(str, pos, removeCount, "");
1464
+ function removeAt(str2, pos, removeCount) {
1465
+ return replaceAt(str2, pos, removeCount, "");
960
1466
  }
961
- function charCount(str, ch) {
962
- if (ch.length !== 1 || str.length === 0) return 0;
1467
+ function charCount(str2, ch) {
1468
+ if (ch.length !== 1 || str2.length === 0) return 0;
963
1469
  let count = 0;
964
- for (let i = 0; i < str.length; i++) {
965
- if (str[i] === ch) count++;
1470
+ for (let i = 0; i < str2.length; i++) {
1471
+ if (str2[i] === ch) count++;
966
1472
  }
967
1473
  return count;
968
1474
  }
@@ -996,101 +1502,8 @@ function makeSentenceFromPascal(PascalString) {
996
1502
  return sentence;
997
1503
  }
998
1504
 
999
- // src/modules/cookies.ts
1000
- var Cookies;
1001
- ((Cookies2) => {
1002
- const ConsentCookieName = "ConsentCookie";
1003
- let ConsentState;
1004
- ((ConsentState2) => {
1005
- ConsentState2["Accept"] = "accept";
1006
- ConsentState2["Decline"] = "decline";
1007
- })(ConsentState || (ConsentState = {}));
1008
- let _consent;
1009
- let _expires;
1010
- let str = _read(ConsentCookieName);
1011
- _consent = str === "accept" /* Accept */ || str === "decline" /* Decline */ ? str : void 0;
1012
- function setExpireDays(days) {
1013
- _expires = /* @__PURE__ */ new Date();
1014
- _expires.setDate(_expires.getDate() + days);
1015
- }
1016
- Cookies2.setExpireDays = setExpireDays;
1017
- function isConsentPending() {
1018
- return _consent === void 0;
1019
- }
1020
- Cookies2.isConsentPending = isConsentPending;
1021
- function accept() {
1022
- _consent = "accept" /* Accept */;
1023
- _save(ConsentCookieName, _consent);
1024
- }
1025
- Cookies2.accept = accept;
1026
- function decline() {
1027
- _consent = "decline" /* Decline */;
1028
- _save(ConsentCookieName, _consent);
1029
- }
1030
- Cookies2.decline = decline;
1031
- function _getList() {
1032
- let s = document.cookie;
1033
- return s.split(";").map((c) => c.trim());
1034
- }
1035
- function _save(name, value) {
1036
- let cookie = name + "=" + value.toString() + ";sameSite=Lax;";
1037
- if (_expires) {
1038
- cookie += "expires=" + _expires.toUTCString() + ";";
1039
- }
1040
- document.cookie = cookie;
1041
- return value;
1042
- }
1043
- function _read(name, defaultValue) {
1044
- let str2 = _getList().find((c) => c.startsWith(name + "="));
1045
- return str2 === void 0 ? defaultValue : str2.substring(name.length + 1);
1046
- }
1047
- function _erase(name) {
1048
- document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 UTC;";
1049
- }
1050
- function save(name, value) {
1051
- if (_consent === "accept" /* Accept */) {
1052
- _save(name, value);
1053
- }
1054
- return value;
1055
- }
1056
- Cookies2.save = save;
1057
- function read(name, defaultValue) {
1058
- if (_consent === "accept" /* Accept */) {
1059
- return _read(name, defaultValue) || defaultValue;
1060
- } else {
1061
- return defaultValue;
1062
- }
1063
- }
1064
- Cookies2.read = read;
1065
- function readInt(name, defaultValue) {
1066
- if (_consent === "accept" /* Accept */) {
1067
- let str2 = _read(name);
1068
- return str2 === void 0 ? defaultValue : parseInt(str2);
1069
- } else {
1070
- return defaultValue;
1071
- }
1072
- }
1073
- Cookies2.readInt = readInt;
1074
- function readBool(name, defaultValue) {
1075
- if (_consent === "accept" /* Accept */) {
1076
- let str2 = _read(name);
1077
- return str2 === void 0 ? defaultValue : /true|1/i.test(str2);
1078
- } else {
1079
- return defaultValue;
1080
- }
1081
- }
1082
- Cookies2.readBool = readBool;
1083
- function erase(name) {
1084
- if (_consent === "accept" /* Accept */ || name === ConsentCookieName) {
1085
- _erase(name);
1086
- }
1087
- }
1088
- Cookies2.erase = erase;
1089
- function eraseAll() {
1090
- document.cookie.split(";").forEach((c) => erase(c.trim().split("=")[0]));
1091
- }
1092
- Cookies2.eraseAll = eraseAll;
1093
- })(Cookies || (Cookies = {}));
1505
+ // src/utils/index.ts
1506
+ var Is = guard_exports;
1094
1507
 
1095
1508
  // src/core/stack.ts
1096
1509
  var Stack = class {
@@ -1102,11 +1515,11 @@ var Stack = class {
1102
1515
  return e;
1103
1516
  }
1104
1517
  pop() {
1105
- Assert.int_gt(this.list.length, 0);
1518
+ assert_exports.int_gt(this.list.length, 0);
1106
1519
  return this.list.pop();
1107
1520
  }
1108
1521
  top() {
1109
- return Assert.array_elem(this.list, this.list.length - 1, "Stack is empty!");
1522
+ return assert_exports.array_elem(this.list, this.list.length - 1, "Stack is empty!");
1110
1523
  }
1111
1524
  toArray() {
1112
1525
  return this.list;
@@ -1140,9 +1553,15 @@ var Vec = class _Vec {
1140
1553
  }
1141
1554
  return new _Vec(...Array(dim).fill(0));
1142
1555
  }
1556
+ get dim() {
1557
+ return this.coords.length;
1558
+ }
1143
1559
  get length() {
1144
1560
  return Math.hypot(...this.coords);
1145
1561
  }
1562
+ magnitude() {
1563
+ return this.length;
1564
+ }
1146
1565
  get x() {
1147
1566
  return this.coords[0];
1148
1567
  }
@@ -1194,6 +1613,38 @@ var Vec = class _Vec {
1194
1613
  }
1195
1614
  return this.div(len);
1196
1615
  }
1616
+ static lerp(a, b, t) {
1617
+ if (a.coords.length !== b.coords.length) {
1618
+ throw new TypeError("Coordinate length mismatch!");
1619
+ }
1620
+ if (!isFinite3(t)) {
1621
+ throw new TypeError("Lerp t is not finite!");
1622
+ }
1623
+ return a.add(b.sub(a).mul(t));
1624
+ }
1625
+ toLength(len) {
1626
+ const mag = this.length;
1627
+ return mag === 0 ? this : this.mul(len / mag);
1628
+ }
1629
+ clamp(minLength, maxLength, defaultDir) {
1630
+ const mag = this.length;
1631
+ if (mag === 0) {
1632
+ if (minLength !== void 0) {
1633
+ if (defaultDir && defaultDir.coords.length !== this.coords.length)
1634
+ throw new TypeError("Coordinate length mismatch!");
1635
+ const dir = defaultDir && defaultDir.length !== 0 ? defaultDir.normalize() : new _Vec(1, ...Array(this.coords.length - 1).fill(0));
1636
+ return dir.mul(minLength);
1637
+ }
1638
+ return this;
1639
+ }
1640
+ if (maxLength !== void 0 && mag > maxLength) {
1641
+ return this.normalize().mul(maxLength);
1642
+ }
1643
+ if (minLength !== void 0 && mag < minLength) {
1644
+ return this.normalize().mul(minLength);
1645
+ }
1646
+ return this;
1647
+ }
1197
1648
  equals(other) {
1198
1649
  return this.coords.length === other.coords.length && this.coords.every((v, i) => v === other.coords[i]);
1199
1650
  }
@@ -1215,28 +1666,28 @@ var Vec = class _Vec {
1215
1666
  var DivRect = class _DivRect {
1216
1667
  constructor(...args) {
1217
1668
  __publicField(this, "left");
1218
- __publicField(this, "centerX");
1669
+ __publicField(this, "anchorX");
1219
1670
  __publicField(this, "right");
1220
1671
  __publicField(this, "top");
1221
- __publicField(this, "centerY");
1672
+ __publicField(this, "anchorY");
1222
1673
  __publicField(this, "bottom");
1223
1674
  if (args.length === 6) {
1224
1675
  this.left = args[0];
1225
- this.centerX = args[1];
1676
+ this.anchorX = args[1];
1226
1677
  this.right = args[2];
1227
1678
  this.top = args[3];
1228
- this.centerY = args[4];
1679
+ this.anchorY = args[4];
1229
1680
  this.bottom = args[5];
1230
1681
  } else if (args.length === 4) {
1231
1682
  this.left = args[0];
1232
1683
  this.right = args[1];
1233
- this.centerX = (this.left + this.right) / 2;
1684
+ this.anchorX = (this.left + this.right) / 2;
1234
1685
  this.top = args[2];
1235
1686
  this.bottom = args[3];
1236
- this.centerY = (this.top + this.bottom) / 2;
1687
+ this.anchorY = (this.top + this.bottom) / 2;
1237
1688
  } else if (args.length === 0) {
1238
- this.left = this.centerX = this.right = 0;
1239
- this.top = this.centerY = this.bottom = 0;
1689
+ this.left = this.anchorX = this.right = 0;
1690
+ this.top = this.anchorY = this.bottom = 0;
1240
1691
  } else {
1241
1692
  throw new TypeError(`Invalid DivRect args: ${args}`);
1242
1693
  }
@@ -1254,7 +1705,7 @@ var DivRect = class _DivRect {
1254
1705
  return new _DivRect(left, left + width, top, top + height);
1255
1706
  }
1256
1707
  /**
1257
- * Create rect from centerX, centerY, width, height arguments.
1708
+ * Create rect from anchorX, anchorY, width, height arguments.
1258
1709
  *
1259
1710
  * @param centerX - Center x-coordinate.
1260
1711
  * @param centerY - Center y-coordinate.
@@ -1284,6 +1735,22 @@ var DivRect = class _DivRect {
1284
1735
  static createSections(leftw, rightw, toph, bottomh) {
1285
1736
  return new _DivRect(-leftw, 0, rightw, -toph, 0, bottomh);
1286
1737
  }
1738
+ /** @deprecated - Renamed to anchorX. */
1739
+ get centerX() {
1740
+ return this.anchorX;
1741
+ }
1742
+ /** @deprecated - Renamed to anchorX. */
1743
+ set centerX(x) {
1744
+ this.anchorX = x;
1745
+ }
1746
+ /** @deprecated - Renamed to anchorY. */
1747
+ get centerY() {
1748
+ return this.anchorY;
1749
+ }
1750
+ /** @deprecated - Renamed to anchorY. */
1751
+ set centerY(y) {
1752
+ this.anchorY = y;
1753
+ }
1287
1754
  /**
1288
1755
  * Width getter.
1289
1756
  */
@@ -1300,25 +1767,25 @@ var DivRect = class _DivRect {
1300
1767
  * Left section width getter.
1301
1768
  */
1302
1769
  get leftw() {
1303
- return this.centerX - this.left;
1770
+ return this.anchorX - this.left;
1304
1771
  }
1305
1772
  /**
1306
1773
  * Right section width getter.
1307
1774
  */
1308
1775
  get rightw() {
1309
- return this.right - this.centerX;
1776
+ return this.right - this.anchorX;
1310
1777
  }
1311
1778
  /**
1312
1779
  * Top section height getter.
1313
1780
  */
1314
1781
  get toph() {
1315
- return this.centerY - this.top;
1782
+ return this.anchorY - this.top;
1316
1783
  }
1317
1784
  /**
1318
1785
  * Bottom section height getter.
1319
1786
  */
1320
1787
  get bottomh() {
1321
- return this.bottom - this.centerY;
1788
+ return this.bottom - this.anchorY;
1322
1789
  }
1323
1790
  /**
1324
1791
  * Does this Rect contain given (x, y)-point?
@@ -1362,7 +1829,7 @@ var DivRect = class _DivRect {
1362
1829
  } else if (a == null || b == null) {
1363
1830
  return false;
1364
1831
  } else {
1365
- return a === b || a.left === b.left && a.centerX === b.centerX && a.right === b.right && a.top === b.top && a.centerY === b.centerY && a.bottom === b.bottom;
1832
+ return a === b || a.left === b.left && a.anchorX === b.anchorX && a.right === b.right && a.top === b.top && a.anchorY === b.anchorY && a.bottom === b.bottom;
1366
1833
  }
1367
1834
  }
1368
1835
  /**
@@ -1374,7 +1841,7 @@ var DivRect = class _DivRect {
1374
1841
  return _DivRect.equals(this, other);
1375
1842
  }
1376
1843
  /**
1377
- * Check if edges of given rects are equal, ignoring centerX and centerY.
1844
+ * Check if edges of given rects are equal, ignoring anchorX and anchorY.
1378
1845
  *
1379
1846
  * @param a - DivRect a.
1380
1847
  * @param b - DivRect b.
@@ -1390,7 +1857,7 @@ var DivRect = class _DivRect {
1390
1857
  }
1391
1858
  }
1392
1859
  /**
1393
- * Check if edges of this Rect equals with given Rect, ignoring centerX and centerY.
1860
+ * Check if edges of this Rect equals with given Rect, ignoring anchorX and anchorY.
1394
1861
  *
1395
1862
  * @param other - The other DivRect.
1396
1863
  * @returns - True/false.
@@ -1398,13 +1865,17 @@ var DivRect = class _DivRect {
1398
1865
  equalsEdges(other) {
1399
1866
  return _DivRect.equalsEdges(this, other);
1400
1867
  }
1868
+ /** @deprecated - Use `DivRect.equalsEdges()` instead. */
1869
+ static equalsFrame(a, b) {
1870
+ return _DivRect.equalsEdges(a, b);
1871
+ }
1401
1872
  /**
1402
1873
  * Created duplicate of this Rect.
1403
1874
  *
1404
1875
  * @returns - Duplicate.
1405
1876
  */
1406
1877
  copy() {
1407
- return new _DivRect(this.left, this.centerX, this.right, this.top, this.centerY, this.bottom);
1878
+ return new _DivRect(this.left, this.anchorX, this.right, this.top, this.anchorY, this.bottom);
1408
1879
  }
1409
1880
  /**
1410
1881
  * Move this rect by (dx, dy). Modifies this Rect.
@@ -1415,10 +1886,10 @@ var DivRect = class _DivRect {
1415
1886
  */
1416
1887
  offsetInPlace(dx, dy) {
1417
1888
  this.left += dx;
1418
- this.centerX += dx;
1889
+ this.anchorX += dx;
1419
1890
  this.right += dx;
1420
1891
  this.top += dy;
1421
- this.centerY += dy;
1892
+ this.anchorY += dy;
1422
1893
  this.bottom += dy;
1423
1894
  return this;
1424
1895
  }
@@ -1463,10 +1934,10 @@ var DivRect = class _DivRect {
1463
1934
  clipInPlace(clipRect) {
1464
1935
  this.left = Math.max(this.left, clipRect.left);
1465
1936
  this.right = Math.min(this.right, clipRect.right);
1466
- this.centerX = clamp(this.centerX, this.left, this.right);
1937
+ this.anchorX = clamp(this.anchorX, this.left, this.right);
1467
1938
  this.top = Math.max(this.top, clipRect.top);
1468
1939
  this.bottom = Math.min(this.bottom, clipRect.bottom);
1469
- this.centerY = clamp(this.centerY, this.top, this.bottom);
1940
+ this.anchorY = clamp(this.anchorY, this.top, this.bottom);
1470
1941
  return this;
1471
1942
  }
1472
1943
  /**
@@ -1479,7 +1950,7 @@ var DivRect = class _DivRect {
1479
1950
  return this.copy().clipInPlace(clipRect);
1480
1951
  }
1481
1952
  /**
1482
- * Scale Rect. Anchor pos is (centerX, centerY). Modifies this Rect.
1953
+ * Scale Rect. Anchor pos is (anchorX, anchorY). Modifies this Rect.
1483
1954
  *
1484
1955
  * @param scaleX - Scale x-amount.
1485
1956
  * @param scaleY - Scale y-amount. If undefined then scale x-amount is used.
@@ -1487,14 +1958,14 @@ var DivRect = class _DivRect {
1487
1958
  */
1488
1959
  scaleInPlace(scaleX, scaleY) {
1489
1960
  scaleY = scaleY ?? scaleX;
1490
- this.left = this.centerX - this.leftw * scaleX;
1491
- this.right = this.centerX + this.rightw * scaleX;
1492
- this.top = this.centerY - this.toph * scaleY;
1493
- this.bottom = this.centerY + this.bottomh * scaleY;
1961
+ this.left = this.anchorX - this.leftw * scaleX;
1962
+ this.right = this.anchorX + this.rightw * scaleX;
1963
+ this.top = this.anchorY - this.toph * scaleY;
1964
+ this.bottom = this.anchorY + this.bottomh * scaleY;
1494
1965
  return this;
1495
1966
  }
1496
1967
  /**
1497
- * Scale Rect. Anchor pos is (centerX, centerY). Immutable, returns modified copy.
1968
+ * Scale Rect. Anchor pos is (anchorX, anchorY). Immutable, returns modified copy.
1498
1969
  *
1499
1970
  * @param scaleX - Scale x-amount.
1500
1971
  * @param scaleY - Scale y-amount. If undefined then scale x-amount is used.
@@ -1632,7 +2103,7 @@ var IndexArray = class _IndexArray {
1632
2103
  }
1633
2104
  }
1634
2105
  static validateIndex(id) {
1635
- if (!isIntegerGte(id, 0)) throw new Error(`Invalid index ${id} - must be an integer >= 0!`);
2106
+ if (!isIntegerGte2(id, 0)) throw new Error(`Invalid index ${id} - must be an integer >= 0!`);
1636
2107
  return id;
1637
2108
  }
1638
2109
  get posLen() {
@@ -1663,7 +2134,7 @@ var IndexArray = class _IndexArray {
1663
2134
  }
1664
2135
  getOrCreate(id, creatorOrValue) {
1665
2136
  if (!this.has(id)) {
1666
- const value = isFunction(creatorOrValue) ? creatorOrValue() : creatorOrValue;
2137
+ const value = isFunction2(creatorOrValue) ? creatorOrValue() : creatorOrValue;
1667
2138
  this.set(id, value);
1668
2139
  return value;
1669
2140
  }
@@ -1799,15 +2270,15 @@ var IndexArray = class _IndexArray {
1799
2270
  }
1800
2271
  return result;
1801
2272
  }
1802
- equals(other, eq) {
2273
+ equals(other, eq2) {
1803
2274
  if (this.size !== other.size) return false;
1804
- eq ?? (eq = (a, b) => a === b);
2275
+ eq2 ?? (eq2 = (a, b) => a === b);
1805
2276
  const posLen = Math.max(this.posLen, other.posLen);
1806
2277
  for (let i = 0; i < posLen; ++i) {
1807
2278
  const hasA = this.hasPos[i];
1808
2279
  const hasB = other.hasPos[i];
1809
2280
  if (hasA !== hasB) return false;
1810
- if (hasA && !eq(this.posVal[i], other.posVal[i])) return false;
2281
+ if (hasA && !eq2(this.posVal[i], other.posVal[i])) return false;
1811
2282
  }
1812
2283
  return true;
1813
2284
  }
@@ -1852,7 +2323,7 @@ var SignedIndexArray = class _SignedIndexArray {
1852
2323
  return -id - 1;
1853
2324
  }
1854
2325
  static validateIndex(id) {
1855
- if (!isInteger(id)) throw new Error(`Invalid index ${id} - must be an integer!`);
2326
+ if (!isInteger2(id)) throw new Error(`Invalid index ${id} - must be an integer!`);
1856
2327
  return id;
1857
2328
  }
1858
2329
  get size() {
@@ -1902,7 +2373,7 @@ var SignedIndexArray = class _SignedIndexArray {
1902
2373
  }
1903
2374
  getOrCreate(id, creatorOrValue) {
1904
2375
  if (!this.has(id)) {
1905
- const value = isFunction(creatorOrValue) ? creatorOrValue() : creatorOrValue;
2376
+ const value = isFunction2(creatorOrValue) ? creatorOrValue() : creatorOrValue;
1906
2377
  this.set(id, value);
1907
2378
  return value;
1908
2379
  }
@@ -2053,22 +2524,22 @@ var SignedIndexArray = class _SignedIndexArray {
2053
2524
  }
2054
2525
  return result;
2055
2526
  }
2056
- equals(other, eq) {
2527
+ equals(other, eq2) {
2057
2528
  if (this.size !== other.size) return false;
2058
- eq ?? (eq = (a, b) => a === b);
2529
+ eq2 ?? (eq2 = (a, b) => a === b);
2059
2530
  const posLen = Math.max(this.posLen, other.posLen);
2060
2531
  for (let i = 0; i < posLen; ++i) {
2061
2532
  const hasA = this.hasPos[i];
2062
2533
  const hasB = other.hasPos[i];
2063
2534
  if (hasA !== hasB) return false;
2064
- if (hasA && !eq(this.posVal[i], other.posVal[i])) return false;
2535
+ if (hasA && !eq2(this.posVal[i], other.posVal[i])) return false;
2065
2536
  }
2066
2537
  const negLen = Math.max(this.negLen, other.negLen);
2067
2538
  for (let i = 0; i < negLen; ++i) {
2068
2539
  const hasA = this.hasNeg[i];
2069
2540
  const hasB = other.hasNeg[i];
2070
2541
  if (hasA !== hasB) return false;
2071
- if (hasA && !eq(this.negVal[i], other.negVal[i])) return false;
2542
+ if (hasA && !eq2(this.negVal[i], other.negVal[i])) return false;
2072
2543
  }
2073
2544
  return true;
2074
2545
  }
@@ -2100,7 +2571,7 @@ var Map1 = class _Map1 {
2100
2571
  }
2101
2572
  getOrCreate(key1, creatorOrValue) {
2102
2573
  if (!this.has(key1)) {
2103
- const value = isFunction(creatorOrValue) ? creatorOrValue() : creatorOrValue;
2574
+ const value = isFunction2(creatorOrValue) ? creatorOrValue() : creatorOrValue;
2104
2575
  this.set(key1, value);
2105
2576
  return value;
2106
2577
  }
@@ -2267,7 +2738,7 @@ var Map2 = class _Map2 {
2267
2738
  }
2268
2739
  getOrCreate(key1, key2, creatorOrValue) {
2269
2740
  if (!this.has(key1, key2)) {
2270
- const value = isFunction(creatorOrValue) ? creatorOrValue() : creatorOrValue;
2741
+ const value = isFunction2(creatorOrValue) ? creatorOrValue() : creatorOrValue;
2271
2742
  this.set(key1, key2, value);
2272
2743
  return value;
2273
2744
  }
@@ -2470,7 +2941,7 @@ var Map3 = class _Map3 {
2470
2941
  }
2471
2942
  getOrCreate(key1, key2, key3, creatorOrValue) {
2472
2943
  if (!this.has(key1, key2, key3)) {
2473
- const value = isFunction(creatorOrValue) ? creatorOrValue() : creatorOrValue;
2944
+ const value = isFunction2(creatorOrValue) ? creatorOrValue() : creatorOrValue;
2474
2945
  this.set(key1, key2, key3, value);
2475
2946
  return value;
2476
2947
  }
@@ -2731,7 +3202,7 @@ function asMulti(base) {
2731
3202
  return new MultiContainer(base);
2732
3203
  }
2733
3204
 
2734
- // src/core/deprecated/vec2.ts
3205
+ // src/deprecated/vec2.ts
2735
3206
  var Vec2 = class _Vec2 {
2736
3207
  constructor(x, y) {
2737
3208
  __publicField(this, "x");
@@ -2756,7 +3227,7 @@ var Vec2 = class _Vec2 {
2756
3227
  }
2757
3228
  };
2758
3229
 
2759
- // src/core/deprecated/small-int-cache.ts
3230
+ // src/deprecated/small-int-cache.ts
2760
3231
  var SmallIntCache = class {
2761
3232
  // for keys < 0
2762
3233
  constructor() {
@@ -2767,7 +3238,7 @@ var SmallIntCache = class {
2767
3238
  this.neg = [];
2768
3239
  }
2769
3240
  set(key, value) {
2770
- if (!isInteger(key)) {
3241
+ if (!guard_exports.isInteger(key)) {
2771
3242
  throw new Error("Key must be an integer");
2772
3243
  } else if (key >= 0) {
2773
3244
  this.pos[key] = value;
@@ -2776,7 +3247,7 @@ var SmallIntCache = class {
2776
3247
  }
2777
3248
  }
2778
3249
  get(key) {
2779
- if (!isInteger(key)) {
3250
+ if (!guard_exports.isInteger(key)) {
2780
3251
  throw new Error("Key must be an integer");
2781
3252
  } else if (key >= 0) {
2782
3253
  return this.pos[key];
@@ -2785,7 +3256,7 @@ var SmallIntCache = class {
2785
3256
  }
2786
3257
  }
2787
3258
  has(key) {
2788
- if (!isInteger(key)) {
3259
+ if (!guard_exports.isInteger(key)) {
2789
3260
  return false;
2790
3261
  } else if (key >= 0) {
2791
3262
  return key in this.pos;
@@ -2794,7 +3265,7 @@ var SmallIntCache = class {
2794
3265
  }
2795
3266
  }
2796
3267
  delete(key) {
2797
- if (!isInteger(key)) {
3268
+ if (!guard_exports.isInteger(key)) {
2798
3269
  return;
2799
3270
  } else if (key >= 0) {
2800
3271
  delete this.pos[key];
@@ -2813,6 +3284,7 @@ var SmallIntCache = class {
2813
3284
  Cookies,
2814
3285
  Device,
2815
3286
  DivRect,
3287
+ Guard,
2816
3288
  IndexArray,
2817
3289
  LRUCache,
2818
3290
  Map1,