sculp-js 1.17.3 → 1.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/cjs/array.js +3 -1
  2. package/dist/cjs/async.js +3 -1
  3. package/dist/cjs/base64.js +3 -1
  4. package/dist/cjs/clipboard.js +3 -1
  5. package/dist/cjs/cloneDeep.js +3 -1
  6. package/dist/cjs/cookie.js +3 -1
  7. package/dist/cjs/date.js +3 -1
  8. package/dist/cjs/dom.js +3 -1
  9. package/dist/cjs/download.js +3 -1
  10. package/dist/cjs/file.js +3 -1
  11. package/dist/cjs/func.js +3 -1
  12. package/dist/cjs/index.js +8 -4
  13. package/dist/cjs/isEqual.js +3 -1
  14. package/dist/cjs/math.js +3 -1
  15. package/dist/cjs/number.js +3 -1
  16. package/dist/cjs/object.js +5 -3
  17. package/dist/cjs/path.js +3 -1
  18. package/dist/cjs/qs.js +3 -1
  19. package/dist/cjs/random.js +3 -1
  20. package/dist/cjs/string.js +3 -1
  21. package/dist/cjs/tooltip.js +3 -1
  22. package/dist/cjs/tree.js +3 -1
  23. package/dist/cjs/type.js +2 -2
  24. package/dist/cjs/unicodeToolkit.js +118 -0
  25. package/dist/cjs/unique.js +3 -1
  26. package/dist/cjs/url.js +3 -1
  27. package/dist/cjs/validator.js +3 -1
  28. package/dist/cjs/variable.js +3 -1
  29. package/dist/cjs/watermark.js +3 -1
  30. package/dist/esm/array.js +1 -1
  31. package/dist/esm/async.js +1 -1
  32. package/dist/esm/base64.js +1 -1
  33. package/dist/esm/clipboard.js +1 -1
  34. package/dist/esm/cloneDeep.js +1 -1
  35. package/dist/esm/cookie.js +1 -1
  36. package/dist/esm/date.js +1 -1
  37. package/dist/esm/dom.js +2 -2
  38. package/dist/esm/download.js +2 -2
  39. package/dist/esm/file.js +1 -1
  40. package/dist/esm/func.js +1 -1
  41. package/dist/esm/index.js +5 -4
  42. package/dist/esm/isEqual.js +1 -1
  43. package/dist/esm/math.js +1 -1
  44. package/dist/esm/number.js +1 -1
  45. package/dist/esm/object.js +2 -2
  46. package/dist/esm/path.js +1 -1
  47. package/dist/esm/qs.js +1 -1
  48. package/dist/esm/random.js +1 -1
  49. package/dist/esm/string.js +1 -1
  50. package/dist/esm/tooltip.js +1 -1
  51. package/dist/esm/tree.js +1 -1
  52. package/dist/esm/type.js +1 -1
  53. package/dist/esm/unicodeToolkit.js +114 -0
  54. package/dist/esm/unique.js +1 -1
  55. package/dist/esm/url.js +1 -1
  56. package/dist/esm/validator.js +1 -1
  57. package/dist/esm/variable.js +1 -1
  58. package/dist/esm/watermark.js +1 -1
  59. package/dist/sculp-js.d.ts +44 -0
  60. package/dist/types/index.d.ts +1 -0
  61. package/dist/types/unicodeToolkit.d.ts +43 -0
  62. package/dist/umd/index.min.js +2 -2
  63. package/package.json +68 -10
package/dist/esm/dom.js CHANGED
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * sculp-js v1.17.3
2
+ * sculp-js v1.18.1
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
6
6
 
7
7
  import { objectEach } from './object.js';
8
8
  import { stringKebabCase } from './string.js';
9
- import { isObject, isString } from './type.js';
9
+ import { isString, isObject } from './type.js';
10
10
 
11
11
  /**
12
12
  * 判断元素是否包含某个样式名
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * sculp-js v1.17.3
2
+ * sculp-js v1.18.1
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
6
6
 
7
- import { isFunction, isNullOrUnDef, isString } from './type.js';
7
+ import { isNullOrUnDef, isFunction, isString } from './type.js';
8
8
  import { urlSetParams } from './url.js';
9
9
 
10
10
  /**
package/dist/esm/file.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.3
2
+ * sculp-js v1.18.1
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/esm/func.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.3
2
+ * sculp-js v1.18.1
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.3
2
+ * sculp-js v1.18.1
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -76,7 +76,7 @@ export {
76
76
  isSymbol,
77
77
  isUndefined,
78
78
  objectHas,
79
- typeIs
79
+ default as typeIs
80
80
  } from './type.js';
81
81
  export { urlDelParams, urlParse, urlSetParams, urlStringify } from './url.js';
82
82
  export { asyncMap, safeAwait, wait } from './async.js';
@@ -86,8 +86,8 @@ export { debounce, getGlobal, once, setGlobal, throttle } from './func.js';
86
86
  export { STRING_POOL, randomNumber, randomString, randomUuid } from './random.js';
87
87
  export {
88
88
  HEX_POOL,
89
- formatNumber as formatMoney,
90
- formatNumber,
89
+ formatMoney,
90
+ formatMoney as formatNumber,
91
91
  humanFileSize,
92
92
  numberAbbr,
93
93
  numberToHex
@@ -127,3 +127,4 @@ export {
127
127
  export { escapeRegExp, executeInScope, parseVarFromString, replaceVarFromString, uniqueSymbol } from './variable.js';
128
128
  export { cloneDeep } from './cloneDeep.js';
129
129
  export { isEqual } from './isEqual.js';
130
+ export { UnicodeToolkit } from './unicodeToolkit.js';
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.3
2
+ * sculp-js v1.18.1
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/esm/math.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.3
2
+ * sculp-js v1.18.1
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.3
2
+ * sculp-js v1.18.1
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * sculp-js v1.17.3
2
+ * sculp-js v1.18.1
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
6
6
 
7
- import { isObject, objectHas, isNumber, isUndefined, typeIs, isArray } from './type.js';
7
+ import typeIs, { isObject, objectHas, isNumber, isUndefined, isArray } from './type.js';
8
8
 
9
9
  /**
10
10
  * 判断对象是否为纯对象
package/dist/esm/path.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.3
2
+ * sculp-js v1.18.1
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/esm/qs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.3
2
+ * sculp-js v1.18.1
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.3
2
+ * sculp-js v1.18.1
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.3
2
+ * sculp-js v1.18.1
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.3
2
+ * sculp-js v1.18.1
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/esm/tree.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.3
2
+ * sculp-js v1.18.1
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/esm/type.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.3
2
+ * sculp-js v1.18.1
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -0,0 +1,114 @@
1
+ /*!
2
+ * sculp-js v1.18.1
3
+ * (c) 2023-present chandq
4
+ * Released under the MIT License.
5
+ */
6
+
7
+ /**
8
+ * 增强型 Unicode/HTML/UTF-8 编码解码工具
9
+ */
10
+ class UnicodeToolkit {
11
+ // 基础 HTML 实体映射
12
+ static ENTITY_MAP = {
13
+ '&': '&',
14
+ '<': '&lt;',
15
+ '>': '&gt;',
16
+ '"': '&quot;',
17
+ "'": '&#39;'
18
+ };
19
+ static NAMED_ENTITIES = {
20
+ '&quot;': '"',
21
+ '&amp;': '&',
22
+ '&lt;': '<',
23
+ '&gt;': '>',
24
+ '&nbsp;': '\u00A0',
25
+ '&copy;': '©',
26
+ '&trade;': '™',
27
+ '&reg;': '®'
28
+ };
29
+ /**
30
+ * 编码函数
31
+ * @param str 原始字符串
32
+ * @param mode 'unicode' (\uXXXX) | 'html' (&#123;) | 'entities' (命名实体)
33
+ * @param encodeAll 是否编码 ASCII 可见字符 (默认 false,仅编码非 ASCII 和特殊字符)
34
+ * * @example
35
+ * // Unicode 编码 (默认仅编码非 ASCII)
36
+ * UnicodeToolkit.encode('Hi 你好 😀')
37
+ * // => 'Hi \\u4F60\\u597D \\u{1F600}'
38
+ * * @example
39
+ * // 全部Unicode 编码
40
+ * UnicodeToolkit.encode('Hi 你好 😀','unicode', true)
41
+ * // => '\\u0048\\u0069\\u0020\\u4F60\\u597D\\u0020\\u{1F600}'
42
+ * * @example
43
+ * // HTML 实体编码
44
+ * UnicodeToolkit.encode('<script>', 'html',true)
45
+ * // => '&lt;&#115;&#99;&#114;&#105;&#112;&#116;&gt;&amp;'
46
+ */
47
+ static encode(str, mode = 'unicode', encodeAll = false) {
48
+ const result = [];
49
+ for (const char of str) {
50
+ const codePoint = char.codePointAt(0);
51
+ // 1. 处理特殊 HTML 基础字符
52
+ if (mode === 'html' && this.ENTITY_MAP[char]) {
53
+ result.push(this.ENTITY_MAP[char]);
54
+ continue;
55
+ }
56
+ // 2. ASCII 范围 (32-126) 且不强制全编码时,保持原样
57
+ if (!encodeAll && codePoint >= 32 && codePoint <= 126) {
58
+ result.push(char);
59
+ continue;
60
+ }
61
+ // 3. 根据模式转换
62
+ if (mode === 'unicode') {
63
+ if (codePoint > 0xffff) {
64
+ result.push(`\\u{${codePoint.toString(16).toUpperCase()}}`);
65
+ } else {
66
+ result.push(`\\u${codePoint.toString(16).toUpperCase().padStart(4, '0')}`);
67
+ }
68
+ } else {
69
+ result.push(`&#${codePoint};`);
70
+ }
71
+ }
72
+ return result.join('');
73
+ }
74
+ /**
75
+ * 综合解码 (支持 \uXXXX, \u{XXXX}, HTML 实体, 十六进制实体)
76
+ * @param normalizeSpace 是否将 \u00A0 (&nbsp;) 转换为普通空格 \u0020
77
+ * * @example
78
+ * // 解码 Unicode 和 Emoji
79
+ * UnicodeToolkit.decode('\\u4F60\\u597D\\u{1F680}')
80
+ * // => '你好🚀'
81
+ * * @example
82
+ * // 解码 HTML 实体 (支持十进制、十六进制和命名实体)
83
+ * UnicodeToolkit.decode('Price: &#163;10 &amp; &copy;')
84
+ * // => 'Price: £10 & ©'
85
+ * * @example
86
+ * // 空格归一化 (将 &nbsp; 转为标准空格)
87
+ * UnicodeToolkit.decode('A&nbsp;B', true)
88
+ * // => 'A B' (charCodeAt 为 32 而不是 160)
89
+ */
90
+ static decode(str, normalizeSpace = false) {
91
+ if (!str) return '';
92
+ let decoded = str
93
+ // 1. Unicode: \uXXXX 和 \u{XXXX}
94
+ .replace(/\\u(?:\{([0-9a-fA-F]+)\}|([0-9a-fA-F]{4}))/g, (_, hexLong, hexShort) => {
95
+ return String.fromCodePoint(parseInt(hexLong || hexShort, 16));
96
+ })
97
+ // 2. HTML 实体: &#123; 和 &#x7B;
98
+ .replace(/&#(x?)([0-9a-fA-F]+);/g, (_, isHex, code) => {
99
+ return String.fromCodePoint(parseInt(code, isHex ? 16 : 10));
100
+ })
101
+ // 3. 命名实体
102
+ .replace(/&[a-z0-9]+;/gi, entity => {
103
+ return this.NAMED_ENTITIES[entity] || entity;
104
+ });
105
+ // 4. 空格归一化处理
106
+ if (normalizeSpace) {
107
+ // 将 \u00A0 替换为标准半角空格 \u0020
108
+ decoded = decoded.replace(/\u00A0/g, ' ');
109
+ }
110
+ return decoded;
111
+ }
112
+ }
113
+
114
+ export { UnicodeToolkit };
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.3
2
+ * sculp-js v1.18.1
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/esm/url.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.3
2
+ * sculp-js v1.18.1
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.3
2
+ * sculp-js v1.18.1
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.3
2
+ * sculp-js v1.18.1
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.3
2
+ * sculp-js v1.18.1
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1362,6 +1362,50 @@ export declare const tooltipEvent: {
1362
1362
  */
1363
1363
  export declare function typeIs(any: unknown): 'Null' | 'Undefined' | 'Symbol' | 'Boolean' | 'Number' | 'String' | 'Function' | 'Date' | 'RegExp' | 'Map' | 'Set' | 'ArrayBuffer' | 'Object' | 'Array' | 'Error' | 'BigInt' | 'Promise' | 'AsyncFunction' | string;
1364
1364
 
1365
+ /**
1366
+ * 增强型 Unicode/HTML/UTF-8 编码解码工具
1367
+ */
1368
+ export declare class UnicodeToolkit {
1369
+ private static readonly ENTITY_MAP;
1370
+ private static readonly NAMED_ENTITIES;
1371
+ /**
1372
+ * 编码函数
1373
+ * @param str 原始字符串
1374
+ * @param mode 'unicode' (\uXXXX) | 'html' (&#123;) | 'entities' (命名实体)
1375
+ * @param encodeAll 是否编码 ASCII 可见字符 (默认 false,仅编码非 ASCII 和特殊字符)
1376
+ * * @example
1377
+ * // Unicode 编码 (默认仅编码非 ASCII)
1378
+ * UnicodeToolkit.encode('Hi 你好 😀')
1379
+ * // => 'Hi \\u4F60\\u597D \\u{1F600}'
1380
+ * * @example
1381
+ * // 全部Unicode 编码
1382
+ * UnicodeToolkit.encode('Hi 你好 😀','unicode', true)
1383
+ * // => '\\u0048\\u0069\\u0020\\u4F60\\u597D\\u0020\\u{1F600}'
1384
+ * * @example
1385
+ * // HTML 实体编码
1386
+ * UnicodeToolkit.encode('<script>', 'html',true)
1387
+ * // => '&lt;&#115;&#99;&#114;&#105;&#112;&#116;&gt;&amp;'
1388
+ */
1389
+ static encode(str: string, mode?: 'unicode' | 'html', encodeAll?: boolean): string;
1390
+ /**
1391
+ * 综合解码 (支持 \uXXXX, \u{XXXX}, HTML 实体, 十六进制实体)
1392
+ * @param normalizeSpace 是否将 \u00A0 (&nbsp;) 转换为普通空格 \u0020
1393
+ * * @example
1394
+ * // 解码 Unicode 和 Emoji
1395
+ * UnicodeToolkit.decode('\\u4F60\\u597D\\u{1F680}')
1396
+ * // => '你好🚀'
1397
+ * * @example
1398
+ * // 解码 HTML 实体 (支持十进制、十六进制和命名实体)
1399
+ * UnicodeToolkit.decode('Price: &#163;10 &amp; &copy;')
1400
+ * // => 'Price: £10 & ©'
1401
+ * * @example
1402
+ * // 空格归一化 (将 &nbsp; 转为标准空格)
1403
+ * UnicodeToolkit.decode('A&nbsp;B', true)
1404
+ * // => 'A B' (charCodeAt 为 32 而不是 160)
1405
+ */
1406
+ static decode(str: string, normalizeSpace?: boolean): string;
1407
+ }
1408
+
1365
1409
  export declare const UNIQUE_NUMBER_SAFE_LENGTH = 18;
1366
1410
 
1367
1411
  /**
@@ -25,3 +25,4 @@ export * from './validator';
25
25
  export * from './variable';
26
26
  export * from './cloneDeep';
27
27
  export * from './isEqual';
28
+ export * from './unicodeToolkit';
@@ -0,0 +1,43 @@
1
+ /**
2
+ * 增强型 Unicode/HTML/UTF-8 编码解码工具
3
+ */
4
+ export declare class UnicodeToolkit {
5
+ private static readonly ENTITY_MAP;
6
+ private static readonly NAMED_ENTITIES;
7
+ /**
8
+ * 编码函数
9
+ * @param str 原始字符串
10
+ * @param mode 'unicode' (\uXXXX) | 'html' (&#123;) | 'entities' (命名实体)
11
+ * @param encodeAll 是否编码 ASCII 可见字符 (默认 false,仅编码非 ASCII 和特殊字符)
12
+ * * @example
13
+ * // Unicode 编码 (默认仅编码非 ASCII)
14
+ * UnicodeToolkit.encode('Hi 你好 😀')
15
+ * // => 'Hi \\u4F60\\u597D \\u{1F600}'
16
+ * * @example
17
+ * // 全部Unicode 编码
18
+ * UnicodeToolkit.encode('Hi 你好 😀','unicode', true)
19
+ * // => '\\u0048\\u0069\\u0020\\u4F60\\u597D\\u0020\\u{1F600}'
20
+ * * @example
21
+ * // HTML 实体编码
22
+ * UnicodeToolkit.encode('<script>', 'html',true)
23
+ * // => '&lt;&#115;&#99;&#114;&#105;&#112;&#116;&gt;&amp;'
24
+ */
25
+ static encode(str: string, mode?: 'unicode' | 'html', encodeAll?: boolean): string;
26
+ /**
27
+ * 综合解码 (支持 \uXXXX, \u{XXXX}, HTML 实体, 十六进制实体)
28
+ * @param normalizeSpace 是否将 \u00A0 (&nbsp;) 转换为普通空格 \u0020
29
+ * * @example
30
+ * // 解码 Unicode 和 Emoji
31
+ * UnicodeToolkit.decode('\\u4F60\\u597D\\u{1F680}')
32
+ * // => '你好🚀'
33
+ * * @example
34
+ * // 解码 HTML 实体 (支持十进制、十六进制和命名实体)
35
+ * UnicodeToolkit.decode('Price: &#163;10 &amp; &copy;')
36
+ * // => 'Price: £10 & ©'
37
+ * * @example
38
+ * // 空格归一化 (将 &nbsp; 转为标准空格)
39
+ * UnicodeToolkit.decode('A&nbsp;B', true)
40
+ * // => 'A B' (charCodeAt 为 32 而不是 160)
41
+ */
42
+ static decode(str: string, normalizeSpace?: boolean): string;
43
+ }
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * sculp-js v1.17.3
2
+ * sculp-js v1.18.1
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
6
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).sculpJs={})}(this,(function(e){"use strict";function t(e,t,n=!1){if(n)for(let n=e.length-1;n>=0;n--){const r=t(e[n],n,e);if(!1===r)break}else for(let n=0,r=e.length;n<r;n++){const r=t(e[n],n,e);if(!1===r)break}e=null}const{toString:n,hasOwnProperty:r}=Object.prototype;function o(e,t){return r.call(e,t)}function i(e){return!!p(e)||(!!l(e)||!!h(e)&&o(e,"length"))}function s(e){return n.call(e).slice(8,-1)}const l=e=>"string"==typeof e,a=e=>"boolean"==typeof e,c=e=>"number"==typeof e&&!Number.isNaN(e),u=e=>void 0===e,d=e=>null===e;function f(e){return u(e)||d(e)}const h=e=>"Object"===s(e),p=e=>Array.isArray(e),g=e=>"function"==typeof e,m=e=>Number.isNaN(e),y=e=>"Date"===s(e);function b(e){return!u(NodeList)&&NodeList.prototype.isPrototypeOf(e)}const w=e=>{if(!h(e))return!1;const t=Object.getPrototypeOf(e);return!t||t===Object.prototype};function x(e,t){for(const n in e)if(o(e,n)&&!1===t(e[n],n))break;e=null}function S(e,t){const n={};return x(e,((e,r)=>{t.includes(r)||(n[r]=e)})),e=null,n}const A=(e,t,n)=>{if(u(n))return t;if(s(t)!==s(n))return p(n)?A(e,[],n):h(n)?A(e,{},n):n;if(w(n)){const r=e.get(n);return r||(e.set(n,t),x(n,((n,r)=>{t[r]=A(e,t[r],n)})),t)}if(p(n)){const r=e.get(n);return r||(e.set(n,t),n.forEach(((n,r)=>{t[r]=A(e,t[r],n)})),t)}return n};function E(e,...t){const n=new Map;for(let r=0,o=t.length;r<o;r++){const o=t[r];e=A(n,e,o)}return n.clear(),e}function v(e,t="-"){return e.replace(/^./,(e=>e.toLowerCase())).replace(/[A-Z]/g,(e=>`${t}${e.toLowerCase()}`))}const F="0123456789",C="abcdefghijklmnopqrstuvwxyz",T="ABCDEFGHIJKLMNOPQRSTUVWXYZ",R=/%[%sdo]/g;const $=/\${(.*?)}/g;const N=(e,t)=>{e.split(/\s+/g).forEach(t)};const j=(e,t,n)=>{h(t)?x(t,((t,n)=>{j(e,n,t)})):e.style.setProperty(v(t),n)};function D(e,t=14,n=!0){let r=0;if(console.assert(l(e),`${e} 不是有效的字符串`),l(e)&&e.length>0){const o="getStrWidth1494304949567";let i=document.querySelector(`#${o}`);if(!i){const n=document.createElement("span");n.id=o,n.style.fontSize=t+"px",n.style.whiteSpace="nowrap",n.style.visibility="hidden",n.style.position="absolute",n.style.top="-9999px",n.style.left="-9999px",n.textContent=e,document.body.appendChild(n),i=n}i.textContent=e,r=i.offsetWidth,n&&i.remove()}return r}function k(e){let t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){const n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();const n=window.getSelection(),r=document.createRange();r.selectNodeContents(e),n.removeAllRanges(),n.addRange(r),t=n.toString()}return t}function L(e,t){const{successCallback:n,failCallback:r,container:o=document.body}=f(t)?{}:t;let i=function(e){const t="rtl"===document.documentElement.getAttribute("dir"),n=document.createElement("textarea");n.style.fontSize="12pt",n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[t?"right":"left"]="-9999px";const r=window.pageYOffset||document.documentElement.scrollTop;return n.style.top=`${r}px`,n.setAttribute("readonly",""),n.value=e,n}(e);o.appendChild(i),k(i);try{document.execCommand("copy")&&g(n)&&n()}catch(e){g(r)&&r(e)}finally{o.removeChild(i),i=null,window.getSelection()?.removeAllRanges()}}function M(e,t,n){const r=[],o="expires";if(r.push([e,encodeURIComponent(t)]),c(n)){const e=new Date;e.setTime(e.getTime()+n),r.push([o,e.toUTCString()])}else y(n)&&r.push([o,n.toUTCString()]);r.push(["path","/"]),document.cookie=r.map((e=>{const[t,n]=e;return`${t}=${n}`})).join(";")}const O=e=>y(e)&&!m(e.getTime()),I=e=>{if(!l(e))return;const t=e.replace(/-/g,"/");return new Date(t)},P=e=>{if(!l(e))return;const t=/([+-])(\d\d)(\d\d)$/,n=t.exec(e);if(!n)return;const r=e.replace(t,"Z"),o=new Date(r);if(!O(o))return;const[,i,s,a]=n,c=parseInt(s,10),u=parseInt(a,10),d=(e,t)=>"+"===i?e-t:e+t;return o.setHours(d(o.getHours(),c)),o.setMinutes(d(o.getMinutes(),u)),o};function B(e){const t=new Date(e);if(O(t))return t;const n=I(e);if(O(n))return n;const r=P(e);if(O(r))return r;throw new SyntaxError(`${e.toString()} 不是一个合法的日期描述`)}function U(e){const t=B(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)}const H=e=>{const t=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/").replace(/\.{3,}/g,"..").replace(/\/\.\//g,"/").split("/").map((e=>e.trim())),n=e=>".."===e,r=[];let o=!1;const i=e=>{r.push(e)};return t.forEach((e=>{const t=(e=>"."===e)(e),s=n(e);return o?t?void 0:s?(()=>{if(0===r.length)return;const e=r[r.length-1];n(e)?r.push(".."):r.pop()})():void i(e):(i(e),void(o=!t&&!s))})),r.join("/")},z=(e,...t)=>H([e,...t].join("/"));function W(e){const t=new URLSearchParams(e),n={};for(const[e,r]of t.entries())u(n[e])?n[e]=r:p(n[e])||(n[e]=t.getAll(e));return n}const _=e=>l(e)?e:c(e)?String(e):a(e)?e?"true":"false":y(e)?e.toISOString():null;function q(e,t=_){const n=new URLSearchParams;return x(e,((e,r)=>{if(p(e))e.forEach((e=>{const o=t(e);null!==o&&n.append(r.toString(),o)}));else{const o=t(e);if(null===o)return;n.set(r.toString(),o)}})),n.toString()}const G=(e,t=!0)=>{let n=null;g(URL)&&t?n=new URL(e):(n=document.createElement("a"),n.href=e);const{protocol:r,username:o,password:i,host:s,port:l,hostname:a,hash:c,search:u,pathname:d}=n,f=z("/",d),h=o&&i?`${o}:${i}`:"",p=u.replace(/^\?/,"");return n=null,{protocol:r,auth:h,username:o,password:i,host:s,port:l,hostname:a,hash:c,search:u,searchParams:W(p),query:p,pathname:f,path:`${f}${u}`,href:e}},Y=e=>{const{protocol:t,auth:n,host:r,pathname:o,searchParams:i,hash:s}=e,l=n?`${n}@`:"",a=q(i),c=a?`?${a}`:"";let u=s.replace(/^#/,"");return u=u?"#"+u:"",`${t}//${l}${r}${o}${c}${u}`},V=(e,t)=>{const n=G(e);return Object.assign(n.searchParams,t),Y(n)};function X(e,t,n){let r=document.createElement("a");r.download=t,r.style.display="none",r.href=e,document.body.appendChild(r),r.click(),setTimeout((()=>{document.body.removeChild(r),r=null,g(n)&&n()}))}function K(e,t,n){const r=URL.createObjectURL(e);X(r,t),setTimeout((()=>{URL.revokeObjectURL(r),g(n)&&n()}))}function J(){return!!document.createElement("canvas").getContext}function Z({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r}){let o=n,i=r;return(n>e||r>t)&&(n/r>e/t?(o=e,i=Math.round(e*(r/n))):(i=t,o=Math.round(t*(n/r)))),{width:o,height:i}}function Q(e){return"undefined"!=typeof globalThis?globalThis[e]:"undefined"!=typeof window?window[e]:"undefined"!=typeof global?global[e]:"undefined"!=typeof self?self[e]:void 0}const ee=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),te=`${F}${T}${C}`;const ne=`${F}${T}${C}`,re="undefined"!=typeof BigInt,oe=()=>Q("JSBI"),ie=e=>re?BigInt(e):oe().BigInt(e);function se(e,t=ne){if(t.length<2)throw new Error("进制池长度不能少于 2");if(!re)throw new Error('需要安装 jsbi 模块并将 JSBI 设置为全局变量:\nimport JSBI from "jsbi"; window.JSBI = JSBI;');let n=ie(e);const r=[],{length:o}=t,i=ie(o),s=()=>{const e=Number(((e,t)=>re?e%t:oe().remainder(e,t))(n,i));n=((e,t)=>re?e/t:oe().divide(e,t))(n,i),r.unshift(t[e]),n>0&&s()};return s(),r.join("")}const le=(e,t,n={ratio:1e3,decimals:0,separator:" "})=>{const{ratio:r=1e3,decimals:o=0,separator:i=" "}=n,{length:s}=t;if(0===s)throw new Error("At least one unit is required");let l=Number(e),a=0;for(;l>=r&&a<s-1;)l/=r,a++;const c=l.toFixed(o),u=t[a];return String(c)+i+u};function ae(e,t){if(f(t))return parseInt(String(e)).toLocaleString();let n=0;return t>0&&(n=t),Number(Number(e).toFixed(n)).toLocaleString("en-US")}let ce=0,ue=0;const de=(e=18)=>{const t=Date.now();e=Math.max(e,18),t!==ue&&(ue=t,ce=0);const n=`${t}`;let r="";const o=e-5-13;if(o>0){r=`${ee(10**(o-1),10**o-1)}`}const i=((e,t=2)=>String(e).padStart(t,"0"))(ce,5);return ce++,`${n}${r}${i}`},fe=e=>e[ee(0,e.length-1)];function he(e,t,n){let r=250,o=13;const i=e.children[0];D(t,12)<230?(i.style.maxWidth=D(t,12)+20+50+"px",r=n.clientX+(D(t,12)+50)-document.body.offsetWidth):(i.style.maxWidth="250px",r=n.clientX+230-document.body.offsetWidth),i.innerHTML=t,r>0&&(o-=r),e.style.top=n.clientY+23+"px",e.style.left=n.clientX+o+"px",e.style.maxWidth="250px";const s=e.getBoundingClientRect().top+i.offsetHeight-document.body.offsetHeight;s>0&&(e.style.top=n.clientY-s+"px")}const pe={handleMouseEnter:function({rootContainer:e="#root",title:t,event:n,bgColor:r="#000",color:o="#fff"}){try{const i=l(e)?document.querySelector(e):e;if(!i)throw new Error(`${e} is not valid Html Element or element selector`);let s=null;const a="style-tooltip-inner1494304949567";if(!document.querySelector(`#${a}`)){const e=document.createElement("style");e.type="text/css",e.id=a,e.innerHTML=`\n .tooltip-inner1494304949567 {\n max-width: 250px;\n padding: 3px 8px;\n color: ${o};\n text-decoration: none;\n border-radius: 4px;\n text-align: left;\n background-color: ${r};\n }\n `,document.querySelector("head").appendChild(e)}if(s=document.querySelector("#customTitle1494304949567"),s)he(s,t,n);else{const e=document.createElement("div");e.id="customTitle1494304949567",e.style.cssText="z-index: 99999999; visibility: hidden; position: absolute;",e.innerHTML='<div class="tooltip-inner1494304949567" style="word-wrap: break-word; max-width: 44px;">皮肤</div>',i.appendChild(e),s=document.querySelector("#customTitle1494304949567"),t&&(he(s,t,n),s.style.visibility="visible")}}catch(e){console.error(e.message)}},handleMouseLeave:function(e="#root"){const t=l(e)?document.querySelector(e):e;let n=document.querySelector("#customTitle1494304949567");t&&n&&(t.removeChild(n),n=null)}},ge={keyField:"key",childField:"children",pidField:"pid"},me={childField:"children",nameField:"name",removeEmptyChild:!1,ignoreCase:!0};function ye(e,t,n={childField:"children",reverse:!1,breadthFirst:!1,isDomNode:!1}){const{childField:r="children",reverse:o=!1,breadthFirst:i=!1,isDomNode:s=!1}=h(n)?n:{};let l=!1;const a=[],c=(n,o,u=0)=>{for(let d=n.length-1;d>=0&&!l;d--){const f=n[d];if(i)a.push({item:f,index:d,array:n,tree:e,parent:o,level:u});else{const i=t(f,d,n,e,o,u);if(!1===i){l=!0;break}if(!0===i)continue;f&&(s?b(f[r]):Array.isArray(f[r]))&&c(f[r],f,u+1)}}if(i)for(;a.length>0&&!l;){const e=a.shift(),{item:n,index:o,array:i,tree:u,parent:d,level:f}=e,h=t(n,o,i,u,d,f);if(!1===h){l=!0;break}!0!==h&&(n&&(s?b(n[r]):Array.isArray(n[r]))&&c(n[r],n,f+1))}},u=(n,o,c=0)=>{for(let d=0,f=n.length;d<f&&!l;d++){const f=n[d];if(i)a.push({item:f,index:d,array:n,tree:e,parent:o,level:c});else{const i=t(f,d,n,e,o,c);if(!1===i){l=!0;break}if(!0===i)continue;f&&(s?b(f[r]):Array.isArray(f[r]))&&u(f[r],f,c+1)}}if(i)for(;a.length>0&&!l;){const e=a.shift();if(!e)break;const{item:n,index:o,array:i,tree:c,parent:d,level:f}=e,h=t(n,o,i,c,d,f);if(!1===h){l=!0;break}!0!==h&&(n&&(s?b(n[r]):Array.isArray(n[r]))&&u(n[r],n,f+1))}};o?c(e,null,0):u(e,null,0),e=null}const be=(e,t)=>{let n=0;const r=e.toString(),o=t.toString();return void 0!==r.split(".")[1]&&(n+=r.split(".")[1].length),void 0!==o.split(".")[1]&&(n+=o.split(".")[1].length),Number(r.replace(".",""))*Number(o.replace(".",""))/Math.pow(10,n)},we=(e,t)=>{let n=0,r=0,o=0;try{n=e.toString().split(".")[1].length}catch(e){n=0}try{r=t.toString().split(".")[1].length}catch(e){r=0}return o=10**Math.max(n,r),(be(e,o)+be(t,o))/o};const xe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Se=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;function Ae(e){let t,n,r,o,i="",s=0;const l=(e=String(e)).length,a=l%3;for(;s<l;){if((n=e.charCodeAt(s++))>255||(r=e.charCodeAt(s++))>255||(o=e.charCodeAt(s++))>255)throw new TypeError("Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.");t=n<<16|r<<8|o,i+=xe.charAt(t>>18&63)+xe.charAt(t>>12&63)+xe.charAt(t>>6&63)+xe.charAt(63&t)}return a?i.slice(0,a-3)+"===".substring(a):i}function Ee(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!Se.test(e))throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");let t,n,r,o="",i=0;for(const s=(e+="==".slice(2-(3&e.length))).length;i<s;)t=xe.indexOf(e.charAt(i++))<<18|xe.indexOf(e.charAt(i++))<<12|(n=xe.indexOf(e.charAt(i++)))<<6|(r=xe.indexOf(e.charAt(i++))),o+=64===n?String.fromCharCode(t>>16&255):64===r?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}const ve=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,Fe=/^(?:(?:\+|00)86)?1\d{10}$/,Ce=/^(1[1-5]|2[1-3]|3[1-7]|4[1-6]|5[0-4]|6[1-5]|7[1]|8[1-2]|9[1])\d{4}(18|19|20)\d{2}[01]\d[0123]\d{4}[\dxX]$/,Te=/^(https?|ftp):\/\/([^\s/$.?#].[^\s]*)$/i,Re=/^https?:\/\/([^\s/$.?#].[^\s]*)$/i,$e=/^(?:(?:\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])$/,Ne=/^(([\da-fA-F]{1,4}:){7}[\da-fA-F]{1,4}|([\da-fA-F]{1,4}:){1,7}:|([\da-fA-F]{1,4}:){1,6}:[\da-fA-F]{1,4}|([\da-fA-F]{1,4}:){1,5}(:[\da-fA-F]{1,4}){1,2}|([\da-fA-F]{1,4}:){1,4}(:[\da-fA-F]{1,4}){1,3}|([\da-fA-F]{1,4}:){1,3}(:[\da-fA-F]{1,4}){1,4}|([\da-fA-F]{1,4}:){1,2}(:[\da-fA-F]{1,4}){1,5}|[\da-fA-F]{1,4}:((:[\da-fA-F]{1,4}){1,6})|:((:[\da-fA-F]{1,4}){1,7}|:)|fe80:(:[\da-fA-F]{0,4}){0,4}%[\da-zA-Z]+|::(ffff(:0{1,4})?:)?((25[0-5]|(2[0-4]|1?\d)?\d)\.){3}(25[0-5]|(2[0-4]|1?\d)?\d)|([\da-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1?\d)?\d)\.){3}(25[0-5]|(2[0-4]|1?\d)?\d))$/i,je=/^(-?[1-9]\d*|0)$/,De=e=>je.test(e),ke=/^-?([1-9]\d*|0)\.\d*[1-9]$/,Le=e=>ke.test(e),Me=/^\d+$/;function Oe(e){return[...new Set(e.trim().split(""))].join("")}function Ie(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Pe(e,t){return new RegExp(`${Ie(e.trim())}\\s*([^${Ie(Oe(e))}${Ie(Oe(t))}\\s]*)\\s*${t.trim()}`,"g")}const Be={MAP:"[object Map]",SET:"[object Set]",DATE:"[object Date]",REGEXP:"[object RegExp]",SYMBOL:"[object Symbol]",ARRAY_BUFFER:"[object ArrayBuffer]",DATA_VIEW:"[object DataView]",ARGUMENTS:"[object Arguments]"},{toString:Ue,hasOwnProperty:He}=Object.prototype,ze=e=>Ue.call(e);function We(e,t,n=void 0){if(e===t)return!0;if(e!=e&&t!=t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e.constructor!==t.constructor)return!1;if(n||(n=new WeakMap),n.has(e))return n.get(e)===t;n.set(e,t);const r=ze(e);if(r!==ze(t))return!1;let o=!1;switch(r){case Be.DATE:o=+e==+t;break;case Be.REGEXP:o=""+e==""+t;break;case Be.SYMBOL:o=Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t);break;case Be.ARRAY_BUFFER:o=_e(e,t);break;case Be.DATA_VIEW:s=t,o=(i=e).byteLength===s.byteLength&&i.byteOffset===s.byteOffset&&_e(i.buffer,s.buffer);break;case Be.MAP:o=function(e,t,n){if(e.size!==t.size)return!1;for(const[r,o]of e){const e=t.get(r);if(void 0===e&&!t.has(r))return!1;if(!We(o,e,n))return!1}return!0}(e,t,n);break;case Be.SET:o=function(e,t,n){if(e.size!==t.size)return!1;for(const r of e){if(t.has(r))continue;let e=!1;for(const o of t)if(We(r,o,n)){e=!0;break}if(!e)return!1}return!0}(e,t,n);break;case Be.ARGUMENTS:default:o=Array.isArray(e)||ArrayBuffer.isView(e)?function(e,t,n){const r=e.length;if(r!==t.length)return!1;let o=r;for(;o--;)if(!We(e[o],t[o],n))return!1;return!0}(e,t,n):function(e,t,n){const r=Reflect.ownKeys(e),o=Reflect.ownKeys(t);if(r.length!==o.length)return!1;for(let o=0;o<r.length;o++){const i=r[o];if(!He.call(t,i)||!We(e[i],t[i],n))return!1}return!0}(e,t,n)}var i,s;return o}function _e(e,t){if(e.byteLength!==t.byteLength)return!1;const n=new Uint8Array(e),r=new Uint8Array(t);let o=e.byteLength;for(;o--;)if(n[o]!==r[o])return!1;return!0}e.EMAIL_REGEX=ve,e.HEX_POOL=ne,e.HTTP_URL_REGEX=Re,e.IPV4_REGEX=$e,e.IPV6_REGEX=Ne,e.PHONE_REGEX=Fe,e.STRING_ARABIC_NUMERALS=F,e.STRING_LOWERCASE_ALPHA=C,e.STRING_POOL=te,e.STRING_UPPERCASE_ALPHA=T,e.UNIQUE_NUMBER_SAFE_LENGTH=18,e.URL_REGEX=Te,e.add=we,e.addClass=function(e,t){N(t,(t=>e.classList.add(t)))},e.arrayEach=t,e.arrayEachAsync=async function(e,t,n=!1){if(n)for(let n=e.length-1;n>=0&&!1!==await t(e[n],n);n--);else for(let n=0,r=e.length;n<r&&!1!==await t(e[n],n);n++);},e.arrayInsertBefore=function(e,t,n){if(t===n||t+1===n)return;const[r]=e.splice(t,1),o=n<t?n:n-1;e.splice(o,0,r)},e.arrayLike=i,e.arrayRemove=function(e,n){const r=[],o=n;return t(e,((e,t)=>{o(e,t)&&r.push(t)})),r.forEach(((t,n)=>{e.splice(t-n,1)})),e},e.asyncMap=function(e,t,n=1/0){return new Promise(((r,o)=>{const i=e[Symbol.iterator](),s=Math.min(e.length,n),l=[];let a,c=0,u=0;const d=()=>{if(a)return o(a);const n=i.next();if(n.done)return void(c===e.length&&r(l));const s=u++;t(n.value,s,e).then((e=>{c++,l[s]=e,d()})).catch((e=>{a=e,d()}))};for(let e=0;e<s;e++)d()}))},e.b64decode=function(e){const t=f(Q("atob"))?Ee(e):Q("atob")(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return f(Q("TextDecoder"))?function(e){const t=String.fromCharCode.apply(null,e);return decodeURIComponent(t)}(r):new(Q("TextDecoder"))("utf-8").decode(r)},e.b64encode=function(e){const t=f(Q("TextEncoder"))?function(e){const t=encodeURIComponent(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}(e):(new(Q("TextEncoder"))).encode(e);let n="";const r=t.length;for(let e=0;e<r;e++)n+=String.fromCharCode(t[e]);return f(Q("btoa"))?Ae(n):Q("btoa")(n)},e.calculateDate=function(e,t,n="-"){const r=new Date(e),o=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime()+864e5*parseInt(String(t)),i=new Date(o);return i.getFullYear()+n+String(i.getMonth()+1).padStart(2,"0")+"-"+String(i.getDate()).padStart(2,"0")},e.calculateDateTime=function(e,t,n="-",r=":"){const o=new Date(e),i=n,s=r,l=new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds()).getTime()+864e5*parseInt(String(t)),a=new Date(l);return a.getFullYear()+i+String(a.getMonth()+1).padStart(2,"0")+i+String(a.getDate()).padStart(2,"0")+" "+String(a.getHours()).padStart(2,"0")+s+String(a.getMinutes()).padStart(2,"0")+s+String(a.getSeconds()).padStart(2,"0")},e.chooseLocalFile=function(e,t){let n=document.createElement("input");n.setAttribute("id",String(Date.now())),n.setAttribute("type","file"),n.setAttribute("style","visibility:hidden"),n.setAttribute("accept",e),document.body.appendChild(n),n.click(),n.onchange=e=>{t(e.target.files),setTimeout((()=>{document.body.removeChild(n),n=null}))}},e.cloneDeep=function e(t,n=new WeakMap){if(null===t||"object"!=typeof t)return t;if(n.has(t))return n.get(t);if(t instanceof ArrayBuffer){const e=new ArrayBuffer(t.byteLength);return new Uint8Array(e).set(new Uint8Array(t)),n.set(t,e),e}if(ArrayBuffer.isView(t)){return new(0,t.constructor)(e(t.buffer,n),t.byteOffset,t.length)}if(t instanceof Date){const e=new Date(t.getTime());return n.set(t,e),e}if(t instanceof RegExp){const e=new RegExp(t.source,t.flags);return e.lastIndex=t.lastIndex,n.set(t,e),e}if(t instanceof Map){const r=new Map;return n.set(t,r),t.forEach(((t,o)=>{r.set(e(o,n),e(t,n))})),r}if(t instanceof Set){const r=new Set;return n.set(t,r),t.forEach((t=>{r.add(e(t,n))})),r}if(Array.isArray(t)){const r=new Array(t.length);n.set(t,r);for(let o=0,i=t.length;o<i;o++)o in t&&(r[o]=e(t[o],n));const o=Object.getOwnPropertyDescriptors(t);for(const t of Reflect.ownKeys(o))Object.defineProperty(r,t,{...o[t],value:e(o[t].value,n)});return r}const r=Object.create(Object.getPrototypeOf(t));n.set(t,r);const o=Object.getOwnPropertyDescriptors(t);for(const t of Reflect.ownKeys(o)){const i=o[t];"value"in i?i.value=e(i.value,n):(i.get&&(i.get=e(i.get,n)),i.set&&(i.set=e(i.set,n))),Object.defineProperty(r,t,i)}return r},e.compressImg=function e(t,n={mime:"image/jpeg",minFileSizeKB:50}){if(!(t instanceof File||t instanceof FileList))throw new Error(`${t} require be File or FileList`);if(!J())throw new Error("Current runtime environment not support Canvas");const{quality:r,mime:o="image/jpeg",maxSize:i,minFileSizeKB:s=50}=h(n)?n:{};let l,a=r;if(r)a=r;else if(t instanceof File){const e=+parseInt((t.size/1024).toFixed(2));a=e<s?1:e<1024?.85:e<5120?.8:.75}return c(i)&&(l=i>=1200?i:1200),t instanceof FileList?Promise.all(Array.from(t).map((t=>e(t,{maxSize:l,mime:o,quality:a})))):t instanceof File?new Promise((e=>{const n=[...t.name.split(".").slice(0,-1),{"image/webp":"webp","image/jpeg":"jpg","image/png":"png"}[o]].join("."),r=+parseInt((t.size/1024).toFixed(2));if(r<s)e({file:t});else{const i=new FileReader;i.onload=({target:{result:i}})=>{const s=new Image;s.onload=()=>{const u=document.createElement("canvas"),d=u.getContext("2d"),f=s.width,h=s.height,{width:p,height:g}=function({sizeKB:e,maxSize:t,originWidth:n,originHeight:r}){let o=n,i=r;if(c(t)){const{width:e,height:s}=Z({maxWidth:t,maxHeight:t,originWidth:n,originHeight:r});o=e,i=s}else if(e<500){const e=1200,t=1200,{width:s,height:l}=Z({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=l}else if(e<5120){const e=1400,t=1400,{width:s,height:l}=Z({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=l}else if(e<10240){const e=1600,t=1600,{width:s,height:l}=Z({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=l}else if(10240<=e){const e=n>15e3?8192:n>1e4?4096:2048,t=r>15e3?8192:r>1e4?4096:2048,{width:s,height:l}=Z({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=l}return{width:o,height:i}}({sizeKB:r,maxSize:l,originWidth:f,originHeight:h});u.width=p,u.height=g,d.clearRect(0,0,p,g),d.drawImage(s,0,0,p,g);const m=u.toDataURL(o,a),y=atob(m.split(",")[1]);let b=y.length;const w=new Uint8Array(new ArrayBuffer(b));for(;b--;)w[b]=y.charCodeAt(b);const x=new File([w],n,{type:o});e({file:x,bufferArray:w,origin:t,beforeSrc:i,afterSrc:m,beforeKB:r,afterKB:Number((x.size/1024).toFixed(2))})},s.src=i},i.readAsDataURL(t)}})):Promise.resolve(null)},e.cookieDel=e=>M(e,"",-1),e.cookieGet=function(e){const{cookie:t}=document;if(!t)return"";const n=t.split(";");for(let t=0;t<n.length;t++){const r=n[t],[o,i=""]=r.split("=");if(o===e)return decodeURIComponent(i)}return""},e.cookieSet=M,e.copyText=function(e,t){const{successCallback:n,failCallback:r}=f(t)?{}:t;navigator.clipboard?navigator.clipboard.writeText(e).then((()=>{g(n)&&n()})).catch((n=>{L(e,t)})):L(e,t)},e.crossOriginDownload=function(e,t,n){const{successCode:r=200,successCallback:o,failCallback:i}=f(n)?{successCode:200,successCallback:void 0,failCallback:void 0}:n,s=new XMLHttpRequest;s.open("GET",e,!0),s.responseType="blob",s.onload=function(){if(s.status===r)K(s.response,t,o);else if(g(i)){const e=s.status,t=s.getResponseHeader("Content-Type");if(l(t)&&t.includes("application/json")){const t=new FileReader;t.onload=()=>{i({status:e,response:t.result})},t.readAsText(s.response)}else i(s)}},s.onerror=e=>{g(i)&&i({status:0,code:"ERROR_CONNECTION_REFUSED"})},s.send()},e.dateParse=B,e.dateToEnd=function(e){const t=U(e);return t.setDate(t.getDate()+1),B(t.getTime()-1)},e.dateToStart=U,e.debounce=(e,t)=>{let n,r=!1;const o=function(...o){r||(clearTimeout(n),n=setTimeout((()=>{e.call(this,...o)}),t))};return o.cancel=()=>{clearTimeout(n),r=!0},o},e.diffArray=function(e,t,n){const r=e=>{if(n)return n(e);if("string"==typeof e||"number"==typeof e||"symbol"==typeof e)return e;throw new Error("diffArray: getKey is required when item is not a primitive value")},o=new Map,i=new Map;for(const t of e)o.set(r(t),t);for(const e of t)i.set(r(e),e);const s=[],l=[];for(const[e,t]of i)o.has(e)||s.push(t);for(const[e,t]of o)i.has(e)||l.push(t);return{added:s,removed:l}},e.divide=(e,t)=>{let n=0,r=0,o=0,i=0;return void 0!==e.toString().split(".")[1]&&(n=e.toString().split(".")[1].length),void 0!==t.toString().split(".")[1]&&(r=t.toString().split(".")[1].length),o=Number(e.toString().replace(".","")),i=Number(t.toString().replace(".","")),o/i*Math.pow(10,r-n)},e.downloadBlob=K,e.downloadData=function(e,t,n,r){if(n=n.replace(`.${t}`,"")+`.${t}`,"json"===t){K(new Blob([JSON.stringify(e,null,4)]),n)}else{if(!r||!r.length)throw new Error("未传入表头数据");if(!Array.isArray(e))throw new Error("data error! expected array!");const o=r.join(",")+"\n";let i="";e.forEach((e=>{i+=Object.values(e).join(",\t")+",\n"}));X("data:"+{csv:"text/csv",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}[t]+";charset=utf-8,\ufeff"+encodeURIComponent(o+i),n)}},e.downloadHref=X,e.downloadURL=function(e,t){window.open(t?V(e,t):e)},e.escapeRegExp=Ie,e.executeInScope=function(e,t={}){const n=Object.keys(t),r=n.map((e=>t[e]));try{return new Function(...n,`return (() => { ${e} })()`)(...r)}catch(e){throw new Error(`代码执行失败: ${e.message}`)}},e.fallbackCopyText=L,e.filterDeep=function(e,t,n={childField:"children",reverse:!1,breadthFirst:!1,isDomNode:!1}){const r=[];return ye(e,((...e)=>{t(...e)&&r.push(e[0])}),n),r},e.findDeep=function(e,t,n={childField:"children",reverse:!1,breadthFirst:!1,isDomNode:!1}){let r=null;return ye(e,((...e)=>{if(t(...e))return r=e[0],!1}),n),r},e.flatTree=function e(t,n=ge){const{keyField:r="key",childField:i="children",pidField:s="pid"}=h(n)?n:{};let l=[];for(let a=0,c=t.length;a<c;a++){const c=t[a],u={...c,[i]:[]};if(o(u,i)&&delete u[i],l.push(u),c[i]){const t=c[i].map((e=>({...e,[s]:c[r]||e.pid})));l=l.concat(e(t,n))}}return l},e.forEachDeep=ye,e.formatDate=function(e,t="YYYY-MM-DD HH:mm:ss"){const n=B(e);let r,o=t;const i={"Y+":`${n.getFullYear()}`,"y+":`${n.getFullYear()}`,"M+":`${n.getMonth()+1}`,"D+":`${n.getDate()}`,"d+":`${n.getDate()}`,"H+":`${n.getHours()}`,"m+":`${n.getMinutes()}`,"s+":`${n.getSeconds()}`,"S+":`${n.getMilliseconds()}`,"w+":["周日","周一","周二","周三","周四","周五","周六"][n.getDay()]};for(const e in i)r=new RegExp("("+e+")").exec(o),r&&(o=o.replace(r[1],1===r[1].length?i[e]:i[e].padStart(r[1].length,"0")));return o},e.formatMoney=ae,e.formatNumber=ae,e.formatTree=function(e,t=ge){const{keyField:n="key",childField:r="children",pidField:o="pid"}=h(t)?t:{},i=[],s={};for(let t=0,r=e.length;t<r;t++){const r=e[t];s[r[n]]=r}for(let t=0,n=e.length;t<n;t++){const n=e[t],l=s[n[o]];l?(l[r]||(l[r]=[])).push(n):i.push(n)}return e=null,i},e.fuzzySearchTree=function e(t,n,r=me){if(!o(n,"filter")&&!n.keyword)return t;const i=[];for(let s=0,l=t.length;s<l;s++){const l=t[s],a=l[r.childField]&&l[r.childField].length>0?e(l[r.childField]||[],n,r):[];if((o(n,"filter")?n.filter(l):r.ignoreCase?l[r.nameField].toLowerCase().includes(n.keyword.toLowerCase()):l[r.nameField].includes(n.keyword))||a.length>0)if(l[r.childField])if(a.length>0)i.push({...l,[r.childField]:a});else if(r.removeEmptyChild){const{[r.childField]:e,...t}=l;i.push(t)}else i.push({...l,[r.childField]:[]});else{const{[r.childField]:e,...t}=l;i.push(t)}}return i},e.genCanvasWM=function e(t="请勿外传",n){const{rootContainer:r=document.body,width:o="300px",height:i="150px",textAlign:s="center",textBaseline:a="middle",font:c="20px PingFangSC-Medium,PingFang SC",fillStyle:u="rgba(189, 177, 167, .3)",rotate:d=-20,zIndex:h=2147483647,watermarkId:p="__wm"}=f(n)?{}:n,g=l(r)?document.querySelector(r):r;if(!g)throw new Error(`${r} is not valid Html Element or element selector`);const m=document.createElement("canvas");m.setAttribute("width",o),m.setAttribute("height",i);const y=m.getContext("2d");y.textAlign=s,y.textBaseline=a,y.font=c,y.fillStyle=u,y.rotate(Math.PI/180*d),y.fillText(t,parseFloat(o)/4,parseFloat(i)/2);const b=m.toDataURL(),w=document.querySelector(`#${p}`),x=w||document.createElement("div"),S=`opacity: 1 !important; display: block !important; visibility: visible !important; position:absolute; left:0; top:0; width:100%; height:100%; z-index:${h}; pointer-events:none; background-repeat:repeat; background-image:url('${b}')`;x.setAttribute("style",S),x.setAttribute("id",p),x.classList.add("nav-height"),w||(g.style.position="relative",g.appendChild(x));const A=window.MutationObserver||window.WebKitMutationObserver;if(A){let r=new A((function(){let o=document.querySelector(`#${p}`);if(o){const{opacity:i,zIndex:s,display:l,visibility:a}=(e=>{const t=getComputedStyle(e);return{opacity:t.getPropertyValue("opacity"),zIndex:t.getPropertyValue("z-index"),display:t.getPropertyValue("display"),visibility:t.getPropertyValue("visibility")}})(o);(o&&o.getAttribute("style")!==S||!o||"1"!==i||"2147483647"!==s||"block"!==l||"visible"!==a)&&(r.disconnect(),r=null,g.removeChild(o),o=null,e(t,n))}else r.disconnect(),r=null,e(t,n)}));r.observe(g,{attributes:!0,subtree:!0,childList:!0})}},e.getComputedCssVal=function(e,t,n=!0){const r=getComputedStyle(e).getPropertyValue(t)??"";return n?Number(r.replace(/([0-9]*)(.*)/g,"$1")):r},e.getGlobal=Q,e.getStrWidthPx=D,e.getStyle=function(e,t){return getComputedStyle(e).getPropertyValue(t)},e.hasClass=function(e,t){if(-1!==t.indexOf(" "))throw new Error("className should not contain space.");return e.classList.contains(t)},e.humanFileSize=function(e,t={decimals:0,si:!1,separator:" "}){const{decimals:n=0,si:r=!1,separator:o=" ",baseUnit:i,maxUnit:s}=t;let l=r?["B","kB","MB","GB","TB","PB","EB","ZB","YB"]:["Byte","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];if(!f(i)){const e=l.findIndex((e=>e===i));-1!==e&&(l=l.slice(e))}if(!f(s)){const e=l.findIndex((e=>e===s));-1!==e&&l.splice(e+1)}return le(e,l,{ratio:r?1e3:1024,decimals:n,separator:o})},e.isArray=p,e.isBigInt=e=>"bigint"==typeof e,e.isBoolean=a,e.isDate=y,e.isDigit=e=>Me.test(e),e.isEmail=e=>ve.test(e),e.isEmpty=function(e){if(f(e)||Number.isNaN(e))return!0;const t=s(e);return i(e)||"Arguments"===t?!e.length:"Set"===t||"Map"===t?!e.size:!Object.keys(e).length},e.isEqual=function(e,t){return We(e,t)},e.isError=e=>"Error"===s(e),e.isFloat=Le,e.isFunction=g,e.isIdNo=e=>{if(!Ce.test(e))return!1;const t=Number(e.slice(6,10)),n=Number(e.slice(10,12)),r=Number(e.slice(12,14)),o=new Date(t,n-1,r);if(!(o.getFullYear()===t&&o.getMonth()+1===n&&o.getDate()===r))return!1;const i=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2];let s=0;for(let t=0;t<17;t++)s+=Number(e.slice(t,t+1))*i[t];return["1","0","X","9","8","7","6","5","4","3","2"][s%11]===e.slice(-1)},e.isInteger=De,e.isIpV4=e=>$e.test(e),e.isIpV6=e=>Ne.test(e),e.isJsonString=function(e){try{const t=JSON.parse(e);return"object"==typeof t&&null!==t&&t}catch(e){return!1}},e.isNaN=m,e.isNodeList=b,e.isNull=d,e.isNullOrUnDef=f,e.isNullish=f,e.isNumber=c,e.isNumerical=e=>De(e)||Le(e),e.isObject=h,e.isPhone=e=>Fe.test(e),e.isPlainObject=w,e.isPrimitive=e=>null===e||"object"!=typeof e,e.isRegExp=e=>"RegExp"===s(e),e.isString=l,e.isSymbol=e=>"symbol"==typeof e,e.isUndefined=u,e.isUrl=(e,t=!1)=>(t?Te:Re).test(e),e.isValidDate=O,e.mapDeep=function(e,t,n={childField:"children",reverse:!1}){const{childField:r="children",reverse:o=!1}=h(n)?n:{};let i=!1;const s=[],l=(n,s,a,c=0)=>{if(o)for(let o=n.length-1;o>=0&&!i;o--){const u=n[o],d=t(u,o,n,e,s,c);if(!1===d){i=!0;break}!0!==d&&(a.push(S(d,[r])),u&&Array.isArray(u[r])?(a[a.length-1][r]=[],l(u[r],u,a[a.length-1][r],c+1)):delete d[r])}else for(let o=0;o<n.length&&!i;o++){const u=n[o],d=t(u,o,n,e,s,c);if(!1===d){i=!0;break}!0!==d&&(a.push(S(d,[r])),u&&Array.isArray(u[r])?(a[a.length-1][r]=[],l(u[r],u,a[a.length-1][r],c+1)):delete d[r])}};return l(e,null,s),e=null,s},e.multiply=be,e.numberAbbr=le,e.numberToHex=se,e.objectAssign=E,e.objectEach=x,e.objectEachAsync=async function(e,t){for(const n in e)if(o(e,n)&&!1===await t(e[n],n))break},e.objectFill=function(e,t,n){const r=n||((e,t,n)=>void 0===e[n]);return x(t,((n,o)=>{r(e,t,o)&&(e[o]=n)})),e},e.objectGet=function(e,t,n=!1){const r=(t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split(".");let i=e,s=0;for(let e=r.length;s<e-1;++s){const e=r[s];if(c(Number(e))&&Array.isArray(i))i=i[e];else{if(!h(i)||!o(i,e)){if(i=void 0,n)throw new Error("[Object] objectGet path 路径不正确");break}i=i[e]}}return{p:i,k:i?r[s]:void 0,v:i?i[r[s]]:void 0}},e.objectHas=o,e.objectMap=function(e,t){const n={};for(const r in e)o(e,r)&&(n[r]=t(e[r],r));return e=null,n},e.objectMerge=E,e.objectOmit=S,e.objectPick=function(e,t){const n={};return x(e,((e,r)=>{t.includes(r)&&(n[r]=e)})),e=null,n},e.once=e=>{let t,n=!1;return function(...r){return n||(n=!0,t=e.call(this,...r)),t}},e.parseQueryParams=function(e=location.search){const t={};return Array.from(e.matchAll(/[&?]?([^=&]+)=?([^=&]*)/g)).forEach(((e,n)=>{t[e[1]]?"string"==typeof t[e[1]]?t[e[1]]=[t[e[1]],e[2]]:t[e[1]].push(e[2]):t[e[1]]=e[2]})),t},e.parseVarFromString=function(e,t="{",n="}"){return Array.from(e.matchAll(Pe(t,n))).map((e=>f(e)?void 0:e[1]))},e.pathJoin=z,e.pathNormalize=H,e.qsParse=W,e.qsStringify=q,e.randomNumber=ee,e.randomString=(e,t)=>{let n=0,r=te;l(t)?(n=e,r=t):c(e)?n=e:l(e)&&(r=e);let o=Math.max(n,1),i="";const s=r.length-1;if(s<2)throw new Error("字符串池长度不能少于 2");for(;o--;){i+=r[ee(0,s)]}return i},e.randomUuid=function(){if("undefined"==typeof URL||!URL.createObjectURL||"undefined"==typeof Blob){const e="0123456789abcdef",t="xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx";let n="";for(let r=0;r<t.length;r++){const o=ee(0,15);n+="-"==t[r]||"4"==t[r]?t[r]:e[o]}return n}return/[^/]+$/.exec(URL.createObjectURL(new Blob).slice())[0]},e.removeClass=function(e,t){N(t,(t=>e.classList.remove(t)))},e.replaceVarFromString=function(e,t,n="{",r="}"){return e.replace(new RegExp(Pe(n,r)),(function(e,n){return o(t,n)?t[n]:e}))},e.safeAwait=function(e,t){return e.then((e=>[null,e])).catch((e=>{if(t){return[Object.assign({},e,t),void 0]}return[e,void 0]}))},e.searchTreeById=function(e,t,n={childField:"children",keyField:"id"}){const{childField:r="children",keyField:o="id"}=h(n)?n:{},i=(e,t,n)=>e.reduce(((e,s)=>{const l=s[r];return[...e,t?{...s,parentId:t,parent:n}:s,...l&&l.length?i(l,s[o],s):[]]}),[]);return(e=>{let n=e.find((e=>e[o]===t));const{parent:r,parentId:i,...s}=n;let l=[t],a=[s];for(;n&&n.parentId;)l=[n.parentId,...l],a=[n.parent,...a],n=e.find((e=>e[o]===n.parentId));return[l,a]})(i(e))},e.select=k,e.setGlobal=function(e,t){if("undefined"!=typeof globalThis)globalThis[e]=t;else if("undefined"!=typeof window)window[e]=t;else if("undefined"!=typeof global)global[e]=t;else{if("undefined"==typeof self)throw new SyntaxError("当前环境下无法设置全局属性");self[e]=t}},e.setStyle=j,e.stringAssign=(e,t)=>e.replace($,((e,n)=>((e,t)=>{try{return new Function(`with(arguments[0]){if(arguments[0].${e} === undefined)throw "";return String(arguments[0].${e})}`)(t)}catch(t){throw new SyntaxError(`无法执行表达式:${e}`)}})(n,t))),e.stringCamelCase=function(e,t){let n=e;return t&&(n=e.replace(/^./,(e=>e.toUpperCase()))),n.replace(/[\s_-](.)/g,((e,t)=>t.toUpperCase()))},e.stringEscapeHtml=e=>{const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};return e.replace(/[&<>"]/g,(e=>t[e]))},e.stringFill=(e,t=" ")=>new Array(e).fill(t).join(""),e.stringFormat=function(e,...t){let n=0;return[e.replace(R,(e=>{const r=t[n++];switch(e){case"%%":return n--,"%";default:case"%s":return String(r);case"%d":return String(Number(r));case"%o":return JSON.stringify(r)}})),...t.splice(n).map(String)].join(" ")},e.stringKebabCase=v,e.strip=function(e,t=15){return+parseFloat(Number(e).toPrecision(t))},e.subtract=(e,t)=>we(e,-t),e.supportCanvas=J,e.throttle=(e,t,n)=>{let r,o=!1,i=0;const s=function(...s){if(o)return;const l=Date.now(),a=()=>{i=l,e.call(this,...s)};if(0===i)return n?a():void(i=l);i+t-l>0?(clearTimeout(r),r=setTimeout((()=>a()),t)):a()};return s.cancel=()=>{clearTimeout(r),o=!0},s},e.tooltipEvent=pe,e.typeIs=s,e.uniqueNumber=de,e.uniqueString=(e,t)=>{let n=0,r=ne;l(t)?(n=e,r=t):c(e)?n=e:l(e)&&(r=e);let o=se(de(),r),i=n-o.length;if(i<=0)return o;for(;i--;)o+=fe(r);return o},e.uniqueSymbol=Oe,e.urlDelParams=(e,t)=>{const n=G(e);return t.forEach((e=>delete n.searchParams[e])),Y(n)},e.urlParse=G,e.urlSetParams=V,e.urlStringify=Y,e.wait=function(e=1){return new Promise((t=>setTimeout(t,e)))},e.weAtob=Ee,e.weBtoa=Ae}));
6
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).sculpJs={})}(this,(function(e){"use strict";function t(e,t,n=!1){if(n)for(let n=e.length-1;n>=0;n--){const r=t(e[n],n,e);if(!1===r)break}else for(let n=0,r=e.length;n<r;n++){const r=t(e[n],n,e);if(!1===r)break}e=null}const{toString:n,hasOwnProperty:r}=Object.prototype;function o(e,t){return r.call(e,t)}function i(e){return!!p(e)||(!!a(e)||!!h(e)&&o(e,"length"))}function s(e){return n.call(e).slice(8,-1)}const a=e=>"string"==typeof e,c=e=>"boolean"==typeof e,l=e=>"number"==typeof e&&!Number.isNaN(e),u=e=>void 0===e,d=e=>null===e;function f(e){return u(e)||d(e)}const h=e=>"Object"===s(e),p=e=>Array.isArray(e),g=e=>"function"==typeof e,m=e=>Number.isNaN(e),y=e=>"Date"===s(e);function b(e){return!u(NodeList)&&NodeList.prototype.isPrototypeOf(e)}const w=e=>{if(!h(e))return!1;const t=Object.getPrototypeOf(e);return!t||t===Object.prototype};function S(e,t){for(const n in e)if(o(e,n)&&!1===t(e[n],n))break;e=null}function x(e,t){const n={};return S(e,((e,r)=>{t.includes(r)||(n[r]=e)})),e=null,n}const A=(e,t,n)=>{if(u(n))return t;if(s(t)!==s(n))return p(n)?A(e,[],n):h(n)?A(e,{},n):n;if(w(n)){const r=e.get(n);return r||(e.set(n,t),S(n,((n,r)=>{t[r]=A(e,t[r],n)})),t)}if(p(n)){const r=e.get(n);return r||(e.set(n,t),n.forEach(((n,r)=>{t[r]=A(e,t[r],n)})),t)}return n};function E(e,...t){const n=new Map;for(let r=0,o=t.length;r<o;r++){const o=t[r];e=A(n,e,o)}return n.clear(),e}function v(e,t="-"){return e.replace(/^./,(e=>e.toLowerCase())).replace(/[A-Z]/g,(e=>`${t}${e.toLowerCase()}`))}const F="0123456789",C="abcdefghijklmnopqrstuvwxyz",T="ABCDEFGHIJKLMNOPQRSTUVWXYZ",$=/%[%sdo]/g;const R=/\${(.*?)}/g;const N=(e,t)=>{e.split(/\s+/g).forEach(t)};const I=(e,t,n)=>{h(t)?S(t,((t,n)=>{I(e,n,t)})):e.style.setProperty(v(t),n)};function D(e,t=14,n=!0){let r=0;if(console.assert(a(e),`${e} 不是有效的字符串`),a(e)&&e.length>0){const o="getStrWidth1494304949567";let i=document.querySelector(`#${o}`);if(!i){const n=document.createElement("span");n.id=o,n.style.fontSize=t+"px",n.style.whiteSpace="nowrap",n.style.visibility="hidden",n.style.position="absolute",n.style.top="-9999px",n.style.left="-9999px",n.textContent=e,document.body.appendChild(n),i=n}i.textContent=e,r=i.offsetWidth,n&&i.remove()}return r}function j(e){let t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){const n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();const n=window.getSelection(),r=document.createRange();r.selectNodeContents(e),n.removeAllRanges(),n.addRange(r),t=n.toString()}return t}function M(e,t){const{successCallback:n,failCallback:r,container:o=document.body}=f(t)?{}:t;let i=function(e){const t="rtl"===document.documentElement.getAttribute("dir"),n=document.createElement("textarea");n.style.fontSize="12pt",n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[t?"right":"left"]="-9999px";const r=window.pageYOffset||document.documentElement.scrollTop;return n.style.top=`${r}px`,n.setAttribute("readonly",""),n.value=e,n}(e);o.appendChild(i),j(i);try{document.execCommand("copy")&&g(n)&&n()}catch(e){g(r)&&r(e)}finally{o.removeChild(i),i=null,window.getSelection()?.removeAllRanges()}}function P(e,t,n){const r=[],o="expires";if(r.push([e,encodeURIComponent(t)]),l(n)){const e=new Date;e.setTime(e.getTime()+n),r.push([o,e.toUTCString()])}else y(n)&&r.push([o,n.toUTCString()]);r.push(["path","/"]),document.cookie=r.map((e=>{const[t,n]=e;return`${t}=${n}`})).join(";")}const k=e=>y(e)&&!m(e.getTime()),L=e=>{if(!a(e))return;const t=e.replace(/-/g,"/");return new Date(t)},O=e=>{if(!a(e))return;const t=/([+-])(\d\d)(\d\d)$/,n=t.exec(e);if(!n)return;const r=e.replace(t,"Z"),o=new Date(r);if(!k(o))return;const[,i,s,c]=n,l=parseInt(s,10),u=parseInt(c,10),d=(e,t)=>"+"===i?e-t:e+t;return o.setHours(d(o.getHours(),l)),o.setMinutes(d(o.getMinutes(),u)),o};function B(e){const t=new Date(e);if(k(t))return t;const n=L(e);if(k(n))return n;const r=O(e);if(k(r))return r;throw new SyntaxError(`${e.toString()} 不是一个合法的日期描述`)}function U(e){const t=B(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)}const H=e=>{const t=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/").replace(/\.{3,}/g,"..").replace(/\/\.\//g,"/").split("/").map((e=>e.trim())),n=e=>".."===e,r=[];let o=!1;const i=e=>{r.push(e)};return t.forEach((e=>{const t=(e=>"."===e)(e),s=n(e);return o?t?void 0:s?(()=>{if(0===r.length)return;const e=r[r.length-1];n(e)?r.push(".."):r.pop()})():void i(e):(i(e),void(o=!t&&!s))})),r.join("/")},z=(e,...t)=>H([e,...t].join("/"));function W(e){const t=new URLSearchParams(e),n={};for(const[e,r]of t.entries())u(n[e])?n[e]=r:p(n[e])||(n[e]=t.getAll(e));return n}const _=e=>a(e)?e:l(e)?String(e):c(e)?e?"true":"false":y(e)?e.toISOString():null;function q(e,t=_){const n=new URLSearchParams;return S(e,((e,r)=>{if(p(e))e.forEach((e=>{const o=t(e);null!==o&&n.append(r.toString(),o)}));else{const o=t(e);if(null===o)return;n.set(r.toString(),o)}})),n.toString()}const Y=(e,t=!0)=>{let n=null;g(URL)&&t?n=new URL(e):(n=document.createElement("a"),n.href=e);const{protocol:r,username:o,password:i,host:s,port:a,hostname:c,hash:l,search:u,pathname:d}=n,f=z("/",d),h=o&&i?`${o}:${i}`:"",p=u.replace(/^\?/,"");return n=null,{protocol:r,auth:h,username:o,password:i,host:s,port:a,hostname:c,hash:l,search:u,searchParams:W(p),query:p,pathname:f,path:`${f}${u}`,href:e}},G=e=>{const{protocol:t,auth:n,host:r,pathname:o,searchParams:i,hash:s}=e,a=n?`${n}@`:"",c=q(i),l=c?`?${c}`:"";let u=s.replace(/^#/,"");return u=u?"#"+u:"",`${t}//${a}${r}${o}${l}${u}`},V=(e,t)=>{const n=Y(e);return Object.assign(n.searchParams,t),G(n)};function X(e,t,n){let r=document.createElement("a");r.download=t,r.style.display="none",r.href=e,document.body.appendChild(r),r.click(),setTimeout((()=>{document.body.removeChild(r),r=null,g(n)&&n()}))}function K(e,t,n){const r=URL.createObjectURL(e);X(r,t),setTimeout((()=>{URL.revokeObjectURL(r),g(n)&&n()}))}function J(){return!!document.createElement("canvas").getContext}function Z({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r}){let o=n,i=r;return(n>e||r>t)&&(n/r>e/t?(o=e,i=Math.round(e*(r/n))):(i=t,o=Math.round(t*(n/r)))),{width:o,height:i}}function Q(e){return"undefined"!=typeof globalThis?globalThis[e]:"undefined"!=typeof window?window[e]:"undefined"!=typeof global?global[e]:"undefined"!=typeof self?self[e]:void 0}const ee=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),te=`${F}${T}${C}`;const ne=`${F}${T}${C}`,re="undefined"!=typeof BigInt,oe=()=>Q("JSBI"),ie=e=>re?BigInt(e):oe().BigInt(e);function se(e,t=ne){if(t.length<2)throw new Error("进制池长度不能少于 2");if(!re)throw new Error('需要安装 jsbi 模块并将 JSBI 设置为全局变量:\nimport JSBI from "jsbi"; window.JSBI = JSBI;');let n=ie(e);const r=[],{length:o}=t,i=ie(o),s=()=>{const e=Number(((e,t)=>re?e%t:oe().remainder(e,t))(n,i));n=((e,t)=>re?e/t:oe().divide(e,t))(n,i),r.unshift(t[e]),n>0&&s()};return s(),r.join("")}const ae=(e,t,n={ratio:1e3,decimals:0,separator:" "})=>{const{ratio:r=1e3,decimals:o=0,separator:i=" "}=n,{length:s}=t;if(0===s)throw new Error("At least one unit is required");let a=Number(e),c=0;for(;a>=r&&c<s-1;)a/=r,c++;const l=a.toFixed(o),u=t[c];return String(l)+i+u};function ce(e,t){if(f(t))return parseInt(String(e)).toLocaleString();let n=0;return t>0&&(n=t),Number(Number(e).toFixed(n)).toLocaleString("en-US")}let le=0,ue=0;const de=(e=18)=>{const t=Date.now();e=Math.max(e,18),t!==ue&&(ue=t,le=0);const n=`${t}`;let r="";const o=e-5-13;if(o>0){r=`${ee(10**(o-1),10**o-1)}`}const i=((e,t=2)=>String(e).padStart(t,"0"))(le,5);return le++,`${n}${r}${i}`},fe=e=>e[ee(0,e.length-1)];function he(e,t,n){let r=250,o=13;const i=e.children[0];D(t,12)<230?(i.style.maxWidth=D(t,12)+20+50+"px",r=n.clientX+(D(t,12)+50)-document.body.offsetWidth):(i.style.maxWidth="250px",r=n.clientX+230-document.body.offsetWidth),i.innerHTML=t,r>0&&(o-=r),e.style.top=n.clientY+23+"px",e.style.left=n.clientX+o+"px",e.style.maxWidth="250px";const s=e.getBoundingClientRect().top+i.offsetHeight-document.body.offsetHeight;s>0&&(e.style.top=n.clientY-s+"px")}const pe={handleMouseEnter:function({rootContainer:e="#root",title:t,event:n,bgColor:r="#000",color:o="#fff"}){try{const i=a(e)?document.querySelector(e):e;if(!i)throw new Error(`${e} is not valid Html Element or element selector`);let s=null;const c="style-tooltip-inner1494304949567";if(!document.querySelector(`#${c}`)){const e=document.createElement("style");e.type="text/css",e.id=c,e.innerHTML=`\n .tooltip-inner1494304949567 {\n max-width: 250px;\n padding: 3px 8px;\n color: ${o};\n text-decoration: none;\n border-radius: 4px;\n text-align: left;\n background-color: ${r};\n }\n `,document.querySelector("head").appendChild(e)}if(s=document.querySelector("#customTitle1494304949567"),s)he(s,t,n);else{const e=document.createElement("div");e.id="customTitle1494304949567",e.style.cssText="z-index: 99999999; visibility: hidden; position: absolute;",e.innerHTML='<div class="tooltip-inner1494304949567" style="word-wrap: break-word; max-width: 44px;">皮肤</div>',i.appendChild(e),s=document.querySelector("#customTitle1494304949567"),t&&(he(s,t,n),s.style.visibility="visible")}}catch(e){console.error(e.message)}},handleMouseLeave:function(e="#root"){const t=a(e)?document.querySelector(e):e;let n=document.querySelector("#customTitle1494304949567");t&&n&&(t.removeChild(n),n=null)}},ge={keyField:"key",childField:"children",pidField:"pid"},me={childField:"children",nameField:"name",removeEmptyChild:!1,ignoreCase:!0};function ye(e,t,n={childField:"children",reverse:!1,breadthFirst:!1,isDomNode:!1}){const{childField:r="children",reverse:o=!1,breadthFirst:i=!1,isDomNode:s=!1}=h(n)?n:{};let a=!1;const c=[],l=(n,o,u=0)=>{for(let d=n.length-1;d>=0&&!a;d--){const f=n[d];if(i)c.push({item:f,index:d,array:n,tree:e,parent:o,level:u});else{const i=t(f,d,n,e,o,u);if(!1===i){a=!0;break}if(!0===i)continue;f&&(s?b(f[r]):Array.isArray(f[r]))&&l(f[r],f,u+1)}}if(i)for(;c.length>0&&!a;){const e=c.shift(),{item:n,index:o,array:i,tree:u,parent:d,level:f}=e,h=t(n,o,i,u,d,f);if(!1===h){a=!0;break}!0!==h&&(n&&(s?b(n[r]):Array.isArray(n[r]))&&l(n[r],n,f+1))}},u=(n,o,l=0)=>{for(let d=0,f=n.length;d<f&&!a;d++){const f=n[d];if(i)c.push({item:f,index:d,array:n,tree:e,parent:o,level:l});else{const i=t(f,d,n,e,o,l);if(!1===i){a=!0;break}if(!0===i)continue;f&&(s?b(f[r]):Array.isArray(f[r]))&&u(f[r],f,l+1)}}if(i)for(;c.length>0&&!a;){const e=c.shift();if(!e)break;const{item:n,index:o,array:i,tree:l,parent:d,level:f}=e,h=t(n,o,i,l,d,f);if(!1===h){a=!0;break}!0!==h&&(n&&(s?b(n[r]):Array.isArray(n[r]))&&u(n[r],n,f+1))}};o?l(e,null,0):u(e,null,0),e=null}const be=(e,t)=>{let n=0;const r=e.toString(),o=t.toString();return void 0!==r.split(".")[1]&&(n+=r.split(".")[1].length),void 0!==o.split(".")[1]&&(n+=o.split(".")[1].length),Number(r.replace(".",""))*Number(o.replace(".",""))/Math.pow(10,n)},we=(e,t)=>{let n=0,r=0,o=0;try{n=e.toString().split(".")[1].length}catch(e){n=0}try{r=t.toString().split(".")[1].length}catch(e){r=0}return o=10**Math.max(n,r),(be(e,o)+be(t,o))/o};const Se="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",xe=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;function Ae(e){let t,n,r,o,i="",s=0;const a=(e=String(e)).length,c=a%3;for(;s<a;){if((n=e.charCodeAt(s++))>255||(r=e.charCodeAt(s++))>255||(o=e.charCodeAt(s++))>255)throw new TypeError("Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.");t=n<<16|r<<8|o,i+=Se.charAt(t>>18&63)+Se.charAt(t>>12&63)+Se.charAt(t>>6&63)+Se.charAt(63&t)}return c?i.slice(0,c-3)+"===".substring(c):i}function Ee(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!xe.test(e))throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");let t,n,r,o="",i=0;for(const s=(e+="==".slice(2-(3&e.length))).length;i<s;)t=Se.indexOf(e.charAt(i++))<<18|Se.indexOf(e.charAt(i++))<<12|(n=Se.indexOf(e.charAt(i++)))<<6|(r=Se.indexOf(e.charAt(i++))),o+=64===n?String.fromCharCode(t>>16&255):64===r?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}const ve=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,Fe=/^(?:(?:\+|00)86)?1\d{10}$/,Ce=/^(1[1-5]|2[1-3]|3[1-7]|4[1-6]|5[0-4]|6[1-5]|7[1]|8[1-2]|9[1])\d{4}(18|19|20)\d{2}[01]\d[0123]\d{4}[\dxX]$/,Te=/^(https?|ftp):\/\/([^\s/$.?#].[^\s]*)$/i,$e=/^https?:\/\/([^\s/$.?#].[^\s]*)$/i,Re=/^(?:(?:\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])$/,Ne=/^(([\da-fA-F]{1,4}:){7}[\da-fA-F]{1,4}|([\da-fA-F]{1,4}:){1,7}:|([\da-fA-F]{1,4}:){1,6}:[\da-fA-F]{1,4}|([\da-fA-F]{1,4}:){1,5}(:[\da-fA-F]{1,4}){1,2}|([\da-fA-F]{1,4}:){1,4}(:[\da-fA-F]{1,4}){1,3}|([\da-fA-F]{1,4}:){1,3}(:[\da-fA-F]{1,4}){1,4}|([\da-fA-F]{1,4}:){1,2}(:[\da-fA-F]{1,4}){1,5}|[\da-fA-F]{1,4}:((:[\da-fA-F]{1,4}){1,6})|:((:[\da-fA-F]{1,4}){1,7}|:)|fe80:(:[\da-fA-F]{0,4}){0,4}%[\da-zA-Z]+|::(ffff(:0{1,4})?:)?((25[0-5]|(2[0-4]|1?\d)?\d)\.){3}(25[0-5]|(2[0-4]|1?\d)?\d)|([\da-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1?\d)?\d)\.){3}(25[0-5]|(2[0-4]|1?\d)?\d))$/i,Ie=/^(-?[1-9]\d*|0)$/,De=e=>Ie.test(e),je=/^-?([1-9]\d*|0)\.\d*[1-9]$/,Me=e=>je.test(e),Pe=/^\d+$/;function ke(e){return[...new Set(e.trim().split(""))].join("")}function Le(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Oe(e,t){return new RegExp(`${Le(e.trim())}\\s*([^${Le(ke(e))}${Le(ke(t))}\\s]*)\\s*${t.trim()}`,"g")}const Be={MAP:"[object Map]",SET:"[object Set]",DATE:"[object Date]",REGEXP:"[object RegExp]",SYMBOL:"[object Symbol]",ARRAY_BUFFER:"[object ArrayBuffer]",DATA_VIEW:"[object DataView]",ARGUMENTS:"[object Arguments]"},{toString:Ue,hasOwnProperty:He}=Object.prototype,ze=e=>Ue.call(e);function We(e,t,n=void 0){if(e===t)return!0;if(e!=e&&t!=t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e.constructor!==t.constructor)return!1;if(n||(n=new WeakMap),n.has(e))return n.get(e)===t;n.set(e,t);const r=ze(e);if(r!==ze(t))return!1;let o=!1;switch(r){case Be.DATE:o=+e==+t;break;case Be.REGEXP:o=""+e==""+t;break;case Be.SYMBOL:o=Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t);break;case Be.ARRAY_BUFFER:o=_e(e,t);break;case Be.DATA_VIEW:s=t,o=(i=e).byteLength===s.byteLength&&i.byteOffset===s.byteOffset&&_e(i.buffer,s.buffer);break;case Be.MAP:o=function(e,t,n){if(e.size!==t.size)return!1;for(const[r,o]of e){const e=t.get(r);if(void 0===e&&!t.has(r))return!1;if(!We(o,e,n))return!1}return!0}(e,t,n);break;case Be.SET:o=function(e,t,n){if(e.size!==t.size)return!1;for(const r of e){if(t.has(r))continue;let e=!1;for(const o of t)if(We(r,o,n)){e=!0;break}if(!e)return!1}return!0}(e,t,n);break;case Be.ARGUMENTS:default:o=Array.isArray(e)||ArrayBuffer.isView(e)?function(e,t,n){const r=e.length;if(r!==t.length)return!1;let o=r;for(;o--;)if(!We(e[o],t[o],n))return!1;return!0}(e,t,n):function(e,t,n){const r=Reflect.ownKeys(e),o=Reflect.ownKeys(t);if(r.length!==o.length)return!1;for(let o=0;o<r.length;o++){const i=r[o];if(!He.call(t,i)||!We(e[i],t[i],n))return!1}return!0}(e,t,n)}var i,s;return o}function _e(e,t){if(e.byteLength!==t.byteLength)return!1;const n=new Uint8Array(e),r=new Uint8Array(t);let o=e.byteLength;for(;o--;)if(n[o]!==r[o])return!1;return!0}e.EMAIL_REGEX=ve,e.HEX_POOL=ne,e.HTTP_URL_REGEX=$e,e.IPV4_REGEX=Re,e.IPV6_REGEX=Ne,e.PHONE_REGEX=Fe,e.STRING_ARABIC_NUMERALS=F,e.STRING_LOWERCASE_ALPHA=C,e.STRING_POOL=te,e.STRING_UPPERCASE_ALPHA=T,e.UNIQUE_NUMBER_SAFE_LENGTH=18,e.URL_REGEX=Te,e.UnicodeToolkit=class{static ENTITY_MAP={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};static NAMED_ENTITIES={"&quot;":'"',"&amp;":"&","&lt;":"<","&gt;":">","&nbsp;":" ","&copy;":"©","&trade;":"™","&reg;":"®"};static encode(e,t="unicode",n=!1){const r=[];for(const o of e){const e=o.codePointAt(0);"html"===t&&this.ENTITY_MAP[o]?r.push(this.ENTITY_MAP[o]):!n&&e>=32&&e<=126?r.push(o):"unicode"===t?e>65535?r.push(`\\u{${e.toString(16).toUpperCase()}}`):r.push(`\\u${e.toString(16).toUpperCase().padStart(4,"0")}`):r.push(`&#${e};`)}return r.join("")}static decode(e,t=!1){if(!e)return"";let n=e.replace(/\\u(?:\{([0-9a-fA-F]+)\}|([0-9a-fA-F]{4}))/g,((e,t,n)=>String.fromCodePoint(parseInt(t||n,16)))).replace(/&#(x?)([0-9a-fA-F]+);/g,((e,t,n)=>String.fromCodePoint(parseInt(n,t?16:10)))).replace(/&[a-z0-9]+;/gi,(e=>this.NAMED_ENTITIES[e]||e));return t&&(n=n.replace(/\u00A0/g," ")),n}},e.add=we,e.addClass=function(e,t){N(t,(t=>e.classList.add(t)))},e.arrayEach=t,e.arrayEachAsync=async function(e,t,n=!1){if(n)for(let n=e.length-1;n>=0&&!1!==await t(e[n],n);n--);else for(let n=0,r=e.length;n<r&&!1!==await t(e[n],n);n++);},e.arrayInsertBefore=function(e,t,n){if(t===n||t+1===n)return;const[r]=e.splice(t,1),o=n<t?n:n-1;e.splice(o,0,r)},e.arrayLike=i,e.arrayRemove=function(e,n){const r=[],o=n;return t(e,((e,t)=>{o(e,t)&&r.push(t)})),r.forEach(((t,n)=>{e.splice(t-n,1)})),e},e.asyncMap=function(e,t,n=1/0){return new Promise(((r,o)=>{const i=e[Symbol.iterator](),s=Math.min(e.length,n),a=[];let c,l=0,u=0;const d=()=>{if(c)return o(c);const n=i.next();if(n.done)return void(l===e.length&&r(a));const s=u++;t(n.value,s,e).then((e=>{l++,a[s]=e,d()})).catch((e=>{c=e,d()}))};for(let e=0;e<s;e++)d()}))},e.b64decode=function(e){const t=f(Q("atob"))?Ee(e):Q("atob")(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return f(Q("TextDecoder"))?function(e){const t=String.fromCharCode.apply(null,e);return decodeURIComponent(t)}(r):new(Q("TextDecoder"))("utf-8").decode(r)},e.b64encode=function(e){const t=f(Q("TextEncoder"))?function(e){const t=encodeURIComponent(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}(e):(new(Q("TextEncoder"))).encode(e);let n="";const r=t.length;for(let e=0;e<r;e++)n+=String.fromCharCode(t[e]);return f(Q("btoa"))?Ae(n):Q("btoa")(n)},e.calculateDate=function(e,t,n="-"){const r=new Date(e),o=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime()+864e5*parseInt(String(t)),i=new Date(o);return i.getFullYear()+n+String(i.getMonth()+1).padStart(2,"0")+"-"+String(i.getDate()).padStart(2,"0")},e.calculateDateTime=function(e,t,n="-",r=":"){const o=new Date(e),i=n,s=r,a=new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds()).getTime()+864e5*parseInt(String(t)),c=new Date(a);return c.getFullYear()+i+String(c.getMonth()+1).padStart(2,"0")+i+String(c.getDate()).padStart(2,"0")+" "+String(c.getHours()).padStart(2,"0")+s+String(c.getMinutes()).padStart(2,"0")+s+String(c.getSeconds()).padStart(2,"0")},e.chooseLocalFile=function(e,t){let n=document.createElement("input");n.setAttribute("id",String(Date.now())),n.setAttribute("type","file"),n.setAttribute("style","visibility:hidden"),n.setAttribute("accept",e),document.body.appendChild(n),n.click(),n.onchange=e=>{t(e.target.files),setTimeout((()=>{document.body.removeChild(n),n=null}))}},e.cloneDeep=function e(t,n=new WeakMap){if(null===t||"object"!=typeof t)return t;if(n.has(t))return n.get(t);if(t instanceof ArrayBuffer){const e=new ArrayBuffer(t.byteLength);return new Uint8Array(e).set(new Uint8Array(t)),n.set(t,e),e}if(ArrayBuffer.isView(t)){return new(0,t.constructor)(e(t.buffer,n),t.byteOffset,t.length)}if(t instanceof Date){const e=new Date(t.getTime());return n.set(t,e),e}if(t instanceof RegExp){const e=new RegExp(t.source,t.flags);return e.lastIndex=t.lastIndex,n.set(t,e),e}if(t instanceof Map){const r=new Map;return n.set(t,r),t.forEach(((t,o)=>{r.set(e(o,n),e(t,n))})),r}if(t instanceof Set){const r=new Set;return n.set(t,r),t.forEach((t=>{r.add(e(t,n))})),r}if(Array.isArray(t)){const r=new Array(t.length);n.set(t,r);for(let o=0,i=t.length;o<i;o++)o in t&&(r[o]=e(t[o],n));const o=Object.getOwnPropertyDescriptors(t);for(const t of Reflect.ownKeys(o))Object.defineProperty(r,t,{...o[t],value:e(o[t].value,n)});return r}const r=Object.create(Object.getPrototypeOf(t));n.set(t,r);const o=Object.getOwnPropertyDescriptors(t);for(const t of Reflect.ownKeys(o)){const i=o[t];"value"in i?i.value=e(i.value,n):(i.get&&(i.get=e(i.get,n)),i.set&&(i.set=e(i.set,n))),Object.defineProperty(r,t,i)}return r},e.compressImg=function e(t,n={mime:"image/jpeg",minFileSizeKB:50}){if(!(t instanceof File||t instanceof FileList))throw new Error(`${t} require be File or FileList`);if(!J())throw new Error("Current runtime environment not support Canvas");const{quality:r,mime:o="image/jpeg",maxSize:i,minFileSizeKB:s=50}=h(n)?n:{};let a,c=r;if(r)c=r;else if(t instanceof File){const e=+parseInt((t.size/1024).toFixed(2));c=e<s?1:e<1024?.85:e<5120?.8:.75}return l(i)&&(a=i>=1200?i:1200),t instanceof FileList?Promise.all(Array.from(t).map((t=>e(t,{maxSize:a,mime:o,quality:c})))):t instanceof File?new Promise((e=>{const n=[...t.name.split(".").slice(0,-1),{"image/webp":"webp","image/jpeg":"jpg","image/png":"png"}[o]].join("."),r=+parseInt((t.size/1024).toFixed(2));if(r<s)e({file:t});else{const i=new FileReader;i.onload=({target:{result:i}})=>{const s=new Image;s.onload=()=>{const u=document.createElement("canvas"),d=u.getContext("2d"),f=s.width,h=s.height,{width:p,height:g}=function({sizeKB:e,maxSize:t,originWidth:n,originHeight:r}){let o=n,i=r;if(l(t)){const{width:e,height:s}=Z({maxWidth:t,maxHeight:t,originWidth:n,originHeight:r});o=e,i=s}else if(e<500){const e=1200,t=1200,{width:s,height:a}=Z({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=a}else if(e<5120){const e=1400,t=1400,{width:s,height:a}=Z({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=a}else if(e<10240){const e=1600,t=1600,{width:s,height:a}=Z({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=a}else if(10240<=e){const e=n>15e3?8192:n>1e4?4096:2048,t=r>15e3?8192:r>1e4?4096:2048,{width:s,height:a}=Z({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=a}return{width:o,height:i}}({sizeKB:r,maxSize:a,originWidth:f,originHeight:h});u.width=p,u.height=g,d.clearRect(0,0,p,g),d.drawImage(s,0,0,p,g);const m=u.toDataURL(o,c),y=atob(m.split(",")[1]);let b=y.length;const w=new Uint8Array(new ArrayBuffer(b));for(;b--;)w[b]=y.charCodeAt(b);const S=new File([w],n,{type:o});e({file:S,bufferArray:w,origin:t,beforeSrc:i,afterSrc:m,beforeKB:r,afterKB:Number((S.size/1024).toFixed(2))})},s.src=i},i.readAsDataURL(t)}})):Promise.resolve(null)},e.cookieDel=e=>P(e,"",-1),e.cookieGet=function(e){const{cookie:t}=document;if(!t)return"";const n=t.split(";");for(let t=0;t<n.length;t++){const r=n[t],[o,i=""]=r.split("=");if(o===e)return decodeURIComponent(i)}return""},e.cookieSet=P,e.copyText=function(e,t){const{successCallback:n,failCallback:r}=f(t)?{}:t;navigator.clipboard?navigator.clipboard.writeText(e).then((()=>{g(n)&&n()})).catch((n=>{M(e,t)})):M(e,t)},e.crossOriginDownload=function(e,t,n){const{successCode:r=200,successCallback:o,failCallback:i}=f(n)?{successCode:200,successCallback:void 0,failCallback:void 0}:n,s=new XMLHttpRequest;s.open("GET",e,!0),s.responseType="blob",s.onload=function(){if(s.status===r)K(s.response,t,o);else if(g(i)){const e=s.status,t=s.getResponseHeader("Content-Type");if(a(t)&&t.includes("application/json")){const t=new FileReader;t.onload=()=>{i({status:e,response:t.result})},t.readAsText(s.response)}else i(s)}},s.onerror=e=>{g(i)&&i({status:0,code:"ERROR_CONNECTION_REFUSED"})},s.send()},e.dateParse=B,e.dateToEnd=function(e){const t=U(e);return t.setDate(t.getDate()+1),B(t.getTime()-1)},e.dateToStart=U,e.debounce=(e,t)=>{let n,r=!1;const o=function(...o){r||(clearTimeout(n),n=setTimeout((()=>{e.call(this,...o)}),t))};return o.cancel=()=>{clearTimeout(n),r=!0},o},e.diffArray=function(e,t,n){const r=e=>{if(n)return n(e);if("string"==typeof e||"number"==typeof e||"symbol"==typeof e)return e;throw new Error("diffArray: getKey is required when item is not a primitive value")},o=new Map,i=new Map;for(const t of e)o.set(r(t),t);for(const e of t)i.set(r(e),e);const s=[],a=[];for(const[e,t]of i)o.has(e)||s.push(t);for(const[e,t]of o)i.has(e)||a.push(t);return{added:s,removed:a}},e.divide=(e,t)=>{let n=0,r=0,o=0,i=0;return void 0!==e.toString().split(".")[1]&&(n=e.toString().split(".")[1].length),void 0!==t.toString().split(".")[1]&&(r=t.toString().split(".")[1].length),o=Number(e.toString().replace(".","")),i=Number(t.toString().replace(".","")),o/i*Math.pow(10,r-n)},e.downloadBlob=K,e.downloadData=function(e,t,n,r){if(n=n.replace(`.${t}`,"")+`.${t}`,"json"===t){K(new Blob([JSON.stringify(e,null,4)]),n)}else{if(!r||!r.length)throw new Error("未传入表头数据");if(!Array.isArray(e))throw new Error("data error! expected array!");const o=r.join(",")+"\n";let i="";e.forEach((e=>{i+=Object.values(e).join(",\t")+",\n"}));X("data:"+{csv:"text/csv",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}[t]+";charset=utf-8,\ufeff"+encodeURIComponent(o+i),n)}},e.downloadHref=X,e.downloadURL=function(e,t){window.open(t?V(e,t):e)},e.escapeRegExp=Le,e.executeInScope=function(e,t={}){const n=Object.keys(t),r=n.map((e=>t[e]));try{return new Function(...n,`return (() => { ${e} })()`)(...r)}catch(e){throw new Error(`代码执行失败: ${e.message}`)}},e.fallbackCopyText=M,e.filterDeep=function(e,t,n={childField:"children",reverse:!1,breadthFirst:!1,isDomNode:!1}){const r=[];return ye(e,((...e)=>{t(...e)&&r.push(e[0])}),n),r},e.findDeep=function(e,t,n={childField:"children",reverse:!1,breadthFirst:!1,isDomNode:!1}){let r=null;return ye(e,((...e)=>{if(t(...e))return r=e[0],!1}),n),r},e.flatTree=function e(t,n=ge){const{keyField:r="key",childField:i="children",pidField:s="pid"}=h(n)?n:{};let a=[];for(let c=0,l=t.length;c<l;c++){const l=t[c],u={...l,[i]:[]};if(o(u,i)&&delete u[i],a.push(u),l[i]){const t=l[i].map((e=>({...e,[s]:l[r]||e.pid})));a=a.concat(e(t,n))}}return a},e.forEachDeep=ye,e.formatDate=function(e,t="YYYY-MM-DD HH:mm:ss"){const n=B(e);let r,o=t;const i={"Y+":`${n.getFullYear()}`,"y+":`${n.getFullYear()}`,"M+":`${n.getMonth()+1}`,"D+":`${n.getDate()}`,"d+":`${n.getDate()}`,"H+":`${n.getHours()}`,"m+":`${n.getMinutes()}`,"s+":`${n.getSeconds()}`,"S+":`${n.getMilliseconds()}`,"w+":["周日","周一","周二","周三","周四","周五","周六"][n.getDay()]};for(const e in i)r=new RegExp("("+e+")").exec(o),r&&(o=o.replace(r[1],1===r[1].length?i[e]:i[e].padStart(r[1].length,"0")));return o},e.formatMoney=ce,e.formatNumber=ce,e.formatTree=function(e,t=ge){const{keyField:n="key",childField:r="children",pidField:o="pid"}=h(t)?t:{},i=[],s={};for(let t=0,r=e.length;t<r;t++){const r=e[t];s[r[n]]=r}for(let t=0,n=e.length;t<n;t++){const n=e[t],a=s[n[o]];a?(a[r]||(a[r]=[])).push(n):i.push(n)}return e=null,i},e.fuzzySearchTree=function e(t,n,r=me){if(!o(n,"filter")&&!n.keyword)return t;const i=[];for(let s=0,a=t.length;s<a;s++){const a=t[s],c=a[r.childField]&&a[r.childField].length>0?e(a[r.childField]||[],n,r):[];if((o(n,"filter")?n.filter(a):r.ignoreCase?a[r.nameField].toLowerCase().includes(n.keyword.toLowerCase()):a[r.nameField].includes(n.keyword))||c.length>0)if(a[r.childField])if(c.length>0)i.push({...a,[r.childField]:c});else if(r.removeEmptyChild){const{[r.childField]:e,...t}=a;i.push(t)}else i.push({...a,[r.childField]:[]});else{const{[r.childField]:e,...t}=a;i.push(t)}}return i},e.genCanvasWM=function e(t="请勿外传",n){const{rootContainer:r=document.body,width:o="300px",height:i="150px",textAlign:s="center",textBaseline:c="middle",font:l="20px PingFangSC-Medium,PingFang SC",fillStyle:u="rgba(189, 177, 167, .3)",rotate:d=-20,zIndex:h=2147483647,watermarkId:p="__wm"}=f(n)?{}:n,g=a(r)?document.querySelector(r):r;if(!g)throw new Error(`${r} is not valid Html Element or element selector`);const m=document.createElement("canvas");m.setAttribute("width",o),m.setAttribute("height",i);const y=m.getContext("2d");y.textAlign=s,y.textBaseline=c,y.font=l,y.fillStyle=u,y.rotate(Math.PI/180*d),y.fillText(t,parseFloat(o)/4,parseFloat(i)/2);const b=m.toDataURL(),w=document.querySelector(`#${p}`),S=w||document.createElement("div"),x=`opacity: 1 !important; display: block !important; visibility: visible !important; position:absolute; left:0; top:0; width:100%; height:100%; z-index:${h}; pointer-events:none; background-repeat:repeat; background-image:url('${b}')`;S.setAttribute("style",x),S.setAttribute("id",p),S.classList.add("nav-height"),w||(g.style.position="relative",g.appendChild(S));const A=window.MutationObserver||window.WebKitMutationObserver;if(A){let r=new A((function(){let o=document.querySelector(`#${p}`);if(o){const{opacity:i,zIndex:s,display:a,visibility:c}=(e=>{const t=getComputedStyle(e);return{opacity:t.getPropertyValue("opacity"),zIndex:t.getPropertyValue("z-index"),display:t.getPropertyValue("display"),visibility:t.getPropertyValue("visibility")}})(o);(o&&o.getAttribute("style")!==x||!o||"1"!==i||"2147483647"!==s||"block"!==a||"visible"!==c)&&(r.disconnect(),r=null,g.removeChild(o),o=null,e(t,n))}else r.disconnect(),r=null,e(t,n)}));r.observe(g,{attributes:!0,subtree:!0,childList:!0})}},e.getComputedCssVal=function(e,t,n=!0){const r=getComputedStyle(e).getPropertyValue(t)??"";return n?Number(r.replace(/([0-9]*)(.*)/g,"$1")):r},e.getGlobal=Q,e.getStrWidthPx=D,e.getStyle=function(e,t){return getComputedStyle(e).getPropertyValue(t)},e.hasClass=function(e,t){if(-1!==t.indexOf(" "))throw new Error("className should not contain space.");return e.classList.contains(t)},e.humanFileSize=function(e,t={decimals:0,si:!1,separator:" "}){const{decimals:n=0,si:r=!1,separator:o=" ",baseUnit:i,maxUnit:s}=t;let a=r?["B","kB","MB","GB","TB","PB","EB","ZB","YB"]:["Byte","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];if(!f(i)){const e=a.findIndex((e=>e===i));-1!==e&&(a=a.slice(e))}if(!f(s)){const e=a.findIndex((e=>e===s));-1!==e&&a.splice(e+1)}return ae(e,a,{ratio:r?1e3:1024,decimals:n,separator:o})},e.isArray=p,e.isBigInt=e=>"bigint"==typeof e,e.isBoolean=c,e.isDate=y,e.isDigit=e=>Pe.test(e),e.isEmail=e=>ve.test(e),e.isEmpty=function(e){if(f(e)||Number.isNaN(e))return!0;const t=s(e);return i(e)||"Arguments"===t?!e.length:"Set"===t||"Map"===t?!e.size:!Object.keys(e).length},e.isEqual=function(e,t){return We(e,t)},e.isError=e=>"Error"===s(e),e.isFloat=Me,e.isFunction=g,e.isIdNo=e=>{if(!Ce.test(e))return!1;const t=Number(e.slice(6,10)),n=Number(e.slice(10,12)),r=Number(e.slice(12,14)),o=new Date(t,n-1,r);if(!(o.getFullYear()===t&&o.getMonth()+1===n&&o.getDate()===r))return!1;const i=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2];let s=0;for(let t=0;t<17;t++)s+=Number(e.slice(t,t+1))*i[t];return["1","0","X","9","8","7","6","5","4","3","2"][s%11]===e.slice(-1)},e.isInteger=De,e.isIpV4=e=>Re.test(e),e.isIpV6=e=>Ne.test(e),e.isJsonString=function(e){try{const t=JSON.parse(e);return"object"==typeof t&&null!==t&&t}catch(e){return!1}},e.isNaN=m,e.isNodeList=b,e.isNull=d,e.isNullOrUnDef=f,e.isNullish=f,e.isNumber=l,e.isNumerical=e=>De(e)||Me(e),e.isObject=h,e.isPhone=e=>Fe.test(e),e.isPlainObject=w,e.isPrimitive=e=>null===e||"object"!=typeof e,e.isRegExp=e=>"RegExp"===s(e),e.isString=a,e.isSymbol=e=>"symbol"==typeof e,e.isUndefined=u,e.isUrl=(e,t=!1)=>(t?Te:$e).test(e),e.isValidDate=k,e.mapDeep=function(e,t,n={childField:"children",reverse:!1}){const{childField:r="children",reverse:o=!1}=h(n)?n:{};let i=!1;const s=[],a=(n,s,c,l=0)=>{if(o)for(let o=n.length-1;o>=0&&!i;o--){const u=n[o],d=t(u,o,n,e,s,l);if(!1===d){i=!0;break}!0!==d&&(c.push(x(d,[r])),u&&Array.isArray(u[r])?(c[c.length-1][r]=[],a(u[r],u,c[c.length-1][r],l+1)):delete d[r])}else for(let o=0;o<n.length&&!i;o++){const u=n[o],d=t(u,o,n,e,s,l);if(!1===d){i=!0;break}!0!==d&&(c.push(x(d,[r])),u&&Array.isArray(u[r])?(c[c.length-1][r]=[],a(u[r],u,c[c.length-1][r],l+1)):delete d[r])}};return a(e,null,s),e=null,s},e.multiply=be,e.numberAbbr=ae,e.numberToHex=se,e.objectAssign=E,e.objectEach=S,e.objectEachAsync=async function(e,t){for(const n in e)if(o(e,n)&&!1===await t(e[n],n))break},e.objectFill=function(e,t,n){const r=n||((e,t,n)=>void 0===e[n]);return S(t,((n,o)=>{r(e,t,o)&&(e[o]=n)})),e},e.objectGet=function(e,t,n=!1){const r=(t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split(".");let i=e,s=0;for(let e=r.length;s<e-1;++s){const e=r[s];if(l(Number(e))&&Array.isArray(i))i=i[e];else{if(!h(i)||!o(i,e)){if(i=void 0,n)throw new Error("[Object] objectGet path 路径不正确");break}i=i[e]}}return{p:i,k:i?r[s]:void 0,v:i?i[r[s]]:void 0}},e.objectHas=o,e.objectMap=function(e,t){const n={};for(const r in e)o(e,r)&&(n[r]=t(e[r],r));return e=null,n},e.objectMerge=E,e.objectOmit=x,e.objectPick=function(e,t){const n={};return S(e,((e,r)=>{t.includes(r)&&(n[r]=e)})),e=null,n},e.once=e=>{let t,n=!1;return function(...r){return n||(n=!0,t=e.call(this,...r)),t}},e.parseQueryParams=function(e=location.search){const t={};return Array.from(e.matchAll(/[&?]?([^=&]+)=?([^=&]*)/g)).forEach(((e,n)=>{t[e[1]]?"string"==typeof t[e[1]]?t[e[1]]=[t[e[1]],e[2]]:t[e[1]].push(e[2]):t[e[1]]=e[2]})),t},e.parseVarFromString=function(e,t="{",n="}"){return Array.from(e.matchAll(Oe(t,n))).map((e=>f(e)?void 0:e[1]))},e.pathJoin=z,e.pathNormalize=H,e.qsParse=W,e.qsStringify=q,e.randomNumber=ee,e.randomString=(e,t)=>{let n=0,r=te;a(t)?(n=e,r=t):l(e)?n=e:a(e)&&(r=e);let o=Math.max(n,1),i="";const s=r.length-1;if(s<2)throw new Error("字符串池长度不能少于 2");for(;o--;){i+=r[ee(0,s)]}return i},e.randomUuid=function(){if("undefined"==typeof URL||!URL.createObjectURL||"undefined"==typeof Blob){const e="0123456789abcdef",t="xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx";let n="";for(let r=0;r<t.length;r++){const o=ee(0,15);n+="-"==t[r]||"4"==t[r]?t[r]:e[o]}return n}return/[^/]+$/.exec(URL.createObjectURL(new Blob).slice())[0]},e.removeClass=function(e,t){N(t,(t=>e.classList.remove(t)))},e.replaceVarFromString=function(e,t,n="{",r="}"){return e.replace(new RegExp(Oe(n,r)),(function(e,n){return o(t,n)?t[n]:e}))},e.safeAwait=function(e,t){return e.then((e=>[null,e])).catch((e=>{if(t){return[Object.assign({},e,t),void 0]}return[e,void 0]}))},e.searchTreeById=function(e,t,n={childField:"children",keyField:"id"}){const{childField:r="children",keyField:o="id"}=h(n)?n:{},i=(e,t,n)=>e.reduce(((e,s)=>{const a=s[r];return[...e,t?{...s,parentId:t,parent:n}:s,...a&&a.length?i(a,s[o],s):[]]}),[]);return(e=>{let n=e.find((e=>e[o]===t));const{parent:r,parentId:i,...s}=n;let a=[t],c=[s];for(;n&&n.parentId;)a=[n.parentId,...a],c=[n.parent,...c],n=e.find((e=>e[o]===n.parentId));return[a,c]})(i(e))},e.select=j,e.setGlobal=function(e,t){if("undefined"!=typeof globalThis)globalThis[e]=t;else if("undefined"!=typeof window)window[e]=t;else if("undefined"!=typeof global)global[e]=t;else{if("undefined"==typeof self)throw new SyntaxError("当前环境下无法设置全局属性");self[e]=t}},e.setStyle=I,e.stringAssign=(e,t)=>e.replace(R,((e,n)=>((e,t)=>{try{return new Function(`with(arguments[0]){if(arguments[0].${e} === undefined)throw "";return String(arguments[0].${e})}`)(t)}catch(t){throw new SyntaxError(`无法执行表达式:${e}`)}})(n,t))),e.stringCamelCase=function(e,t){let n=e;return t&&(n=e.replace(/^./,(e=>e.toUpperCase()))),n.replace(/[\s_-](.)/g,((e,t)=>t.toUpperCase()))},e.stringEscapeHtml=e=>{const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};return e.replace(/[&<>"]/g,(e=>t[e]))},e.stringFill=(e,t=" ")=>new Array(e).fill(t).join(""),e.stringFormat=function(e,...t){let n=0;return[e.replace($,(e=>{const r=t[n++];switch(e){case"%%":return n--,"%";default:case"%s":return String(r);case"%d":return String(Number(r));case"%o":return JSON.stringify(r)}})),...t.splice(n).map(String)].join(" ")},e.stringKebabCase=v,e.strip=function(e,t=15){return+parseFloat(Number(e).toPrecision(t))},e.subtract=(e,t)=>we(e,-t),e.supportCanvas=J,e.throttle=(e,t,n)=>{let r,o=!1,i=0;const s=function(...s){if(o)return;const a=Date.now(),c=()=>{i=a,e.call(this,...s)};if(0===i)return n?c():void(i=a);i+t-a>0?(clearTimeout(r),r=setTimeout((()=>c()),t)):c()};return s.cancel=()=>{clearTimeout(r),o=!0},s},e.tooltipEvent=pe,e.typeIs=s,e.uniqueNumber=de,e.uniqueString=(e,t)=>{let n=0,r=ne;a(t)?(n=e,r=t):l(e)?n=e:a(e)&&(r=e);let o=se(de(),r),i=n-o.length;if(i<=0)return o;for(;i--;)o+=fe(r);return o},e.uniqueSymbol=ke,e.urlDelParams=(e,t)=>{const n=Y(e);return t.forEach((e=>delete n.searchParams[e])),G(n)},e.urlParse=Y,e.urlSetParams=V,e.urlStringify=G,e.wait=function(e=1){return new Promise((t=>setTimeout(t,e)))},e.weAtob=Ee,e.weBtoa=Ae}));