sculp-js 1.10.4 → 1.10.5
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/lib/cjs/array.js +7 -9
- package/lib/cjs/async.js +1 -1
- package/lib/cjs/base64.js +1 -1
- package/lib/cjs/clipboard.js +1 -1
- package/lib/cjs/cloneDeep.js +1 -1
- package/lib/cjs/cookie.js +1 -1
- package/lib/cjs/date.js +1 -1
- package/lib/cjs/dom.js +1 -1
- package/lib/cjs/download.js +1 -1
- package/lib/cjs/easing.js +1 -1
- package/lib/cjs/file.js +1 -1
- package/lib/cjs/func.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/isEqual.js +1 -1
- package/lib/cjs/math.js +1 -1
- package/lib/cjs/number.js +1 -1
- package/lib/cjs/object.js +10 -2
- package/lib/cjs/path.js +1 -1
- package/lib/cjs/qs.js +1 -1
- package/lib/cjs/random.js +1 -1
- package/lib/cjs/string.js +1 -1
- package/lib/cjs/tooltip.js +1 -1
- package/lib/cjs/tree.js +7 -1
- package/lib/cjs/type.js +4 -3
- package/lib/cjs/unique.js +1 -1
- package/lib/cjs/url.js +1 -1
- package/lib/cjs/validator.js +1 -1
- package/lib/cjs/variable.js +1 -1
- package/lib/cjs/watermark.js +1 -1
- package/lib/cjs/we-decode.js +1 -1
- package/lib/es/array.js +7 -9
- package/lib/es/async.js +1 -1
- package/lib/es/base64.js +1 -1
- package/lib/es/clipboard.js +1 -1
- package/lib/es/cloneDeep.js +1 -1
- package/lib/es/cookie.js +1 -1
- package/lib/es/date.js +1 -1
- package/lib/es/dom.js +1 -1
- package/lib/es/download.js +1 -1
- package/lib/es/easing.js +1 -1
- package/lib/es/file.js +1 -1
- package/lib/es/func.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/es/isEqual.js +1 -1
- package/lib/es/math.js +1 -1
- package/lib/es/number.js +1 -1
- package/lib/es/object.js +10 -2
- package/lib/es/path.js +1 -1
- package/lib/es/qs.js +1 -1
- package/lib/es/random.js +1 -1
- package/lib/es/string.js +1 -1
- package/lib/es/tooltip.js +1 -1
- package/lib/es/tree.js +7 -1
- package/lib/es/type.js +4 -3
- package/lib/es/unique.js +1 -1
- package/lib/es/url.js +1 -1
- package/lib/es/validator.js +1 -1
- package/lib/es/variable.js +1 -1
- package/lib/es/watermark.js +1 -1
- package/lib/es/we-decode.js +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/umd/index.js +2 -2
- package/package.json +1 -1
package/lib/cjs/array.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.10.
|
|
2
|
+
* sculp-js v1.10.5
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
function arrayEach(array, iterator, reverse = false) {
|
|
18
18
|
if (reverse) {
|
|
19
19
|
for (let idx = array.length - 1; idx >= 0; idx--) {
|
|
20
|
-
const
|
|
21
|
-
const re = iterator(val, idx, array);
|
|
20
|
+
const re = iterator(array[idx], idx, array);
|
|
22
21
|
if (re === false)
|
|
23
22
|
break;
|
|
24
23
|
else if (re === true)
|
|
@@ -27,14 +26,15 @@ function arrayEach(array, iterator, reverse = false) {
|
|
|
27
26
|
}
|
|
28
27
|
else {
|
|
29
28
|
for (let idx = 0, len = array.length; idx < len; idx++) {
|
|
30
|
-
const
|
|
31
|
-
const re = iterator(val, idx, array);
|
|
29
|
+
const re = iterator(array[idx], idx, array);
|
|
32
30
|
if (re === false)
|
|
33
31
|
break;
|
|
34
32
|
else if (re === true)
|
|
35
33
|
continue;
|
|
36
34
|
}
|
|
37
35
|
}
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
array = null;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
40
|
* 异步遍历数组,返回 false 中断遍历
|
|
@@ -62,15 +62,13 @@ function arrayEach(array, iterator, reverse = false) {
|
|
|
62
62
|
async function arrayEachAsync(array, iterator, reverse = false) {
|
|
63
63
|
if (reverse) {
|
|
64
64
|
for (let idx = array.length - 1; idx >= 0; idx--) {
|
|
65
|
-
|
|
66
|
-
if ((await iterator(val, idx)) === false)
|
|
65
|
+
if ((await iterator(array[idx], idx)) === false)
|
|
67
66
|
break;
|
|
68
67
|
}
|
|
69
68
|
}
|
|
70
69
|
else {
|
|
71
70
|
for (let idx = 0, len = array.length; idx < len; idx++) {
|
|
72
|
-
|
|
73
|
-
if ((await iterator(val, idx)) === false)
|
|
71
|
+
if ((await iterator(array[idx], idx)) === false)
|
|
74
72
|
break;
|
|
75
73
|
}
|
|
76
74
|
}
|
package/lib/cjs/async.js
CHANGED
package/lib/cjs/base64.js
CHANGED
package/lib/cjs/clipboard.js
CHANGED
package/lib/cjs/cloneDeep.js
CHANGED
package/lib/cjs/cookie.js
CHANGED
package/lib/cjs/date.js
CHANGED
package/lib/cjs/dom.js
CHANGED
package/lib/cjs/download.js
CHANGED
package/lib/cjs/easing.js
CHANGED
package/lib/cjs/file.js
CHANGED
package/lib/cjs/func.js
CHANGED
package/lib/cjs/index.js
CHANGED
package/lib/cjs/isEqual.js
CHANGED
package/lib/cjs/math.js
CHANGED
package/lib/cjs/number.js
CHANGED
package/lib/cjs/object.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.10.
|
|
2
|
+
* sculp-js v1.10.5
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -35,6 +35,8 @@ function objectEach(obj, iterator) {
|
|
|
35
35
|
if (iterator(obj[key], key) === false)
|
|
36
36
|
break;
|
|
37
37
|
}
|
|
38
|
+
// @ts-ignore
|
|
39
|
+
obj = null;
|
|
38
40
|
}
|
|
39
41
|
/**
|
|
40
42
|
* 异步遍历对象,返回 false 中断遍历
|
|
@@ -62,6 +64,8 @@ function objectMap(obj, iterator) {
|
|
|
62
64
|
continue;
|
|
63
65
|
obj2[key] = iterator(obj[key], key);
|
|
64
66
|
}
|
|
67
|
+
// @ts-ignore
|
|
68
|
+
obj = null;
|
|
65
69
|
return obj2;
|
|
66
70
|
}
|
|
67
71
|
/**
|
|
@@ -78,6 +82,8 @@ function objectPick(obj, keys) {
|
|
|
78
82
|
obj2[k] = v;
|
|
79
83
|
}
|
|
80
84
|
});
|
|
85
|
+
// @ts-ignore
|
|
86
|
+
obj = null;
|
|
81
87
|
return obj2;
|
|
82
88
|
}
|
|
83
89
|
/**
|
|
@@ -94,6 +100,8 @@ function objectOmit(obj, keys) {
|
|
|
94
100
|
obj2[k] = v;
|
|
95
101
|
}
|
|
96
102
|
});
|
|
103
|
+
// @ts-ignore
|
|
104
|
+
obj = null;
|
|
97
105
|
return obj2;
|
|
98
106
|
}
|
|
99
107
|
const merge = (map, source, target) => {
|
|
@@ -165,7 +173,7 @@ function objectFill(source, target, fillable) {
|
|
|
165
173
|
return source;
|
|
166
174
|
}
|
|
167
175
|
/**
|
|
168
|
-
*
|
|
176
|
+
* 获取对象/数组指定层级下的属性值(现在可用ES6+的可选链?.来替代)
|
|
169
177
|
* @param {AnyObject} obj
|
|
170
178
|
* @param {string} path
|
|
171
179
|
* @param {boolean} strict
|
package/lib/cjs/path.js
CHANGED
package/lib/cjs/qs.js
CHANGED
package/lib/cjs/random.js
CHANGED
package/lib/cjs/string.js
CHANGED
package/lib/cjs/tooltip.js
CHANGED
package/lib/cjs/tree.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.10.
|
|
2
|
+
* sculp-js v1.10.5
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -70,6 +70,8 @@ function forEachDeep(tree, iterator, children = 'children', isReverse = false) {
|
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
72
|
walk(tree, null);
|
|
73
|
+
// @ts-ignore
|
|
74
|
+
tree = null;
|
|
73
75
|
}
|
|
74
76
|
/**
|
|
75
77
|
* 创建一个新数组, 深度优先遍历的Map函数(支持continue和break操作), 可用于insert tree item 和 remove tree item
|
|
@@ -139,6 +141,8 @@ function mapDeep(tree, iterator, children = 'children', isReverse = false) {
|
|
|
139
141
|
}
|
|
140
142
|
};
|
|
141
143
|
walk(tree, null, newTree);
|
|
144
|
+
// @ts-ignore
|
|
145
|
+
tree = null;
|
|
142
146
|
return newTree;
|
|
143
147
|
}
|
|
144
148
|
/**
|
|
@@ -196,6 +200,8 @@ function formatTree(list, options = defaultFieldOptions) {
|
|
|
196
200
|
treeArr.push(item);
|
|
197
201
|
}
|
|
198
202
|
});
|
|
203
|
+
// @ts-ignore
|
|
204
|
+
list = null;
|
|
199
205
|
return treeArr;
|
|
200
206
|
}
|
|
201
207
|
/**
|
package/lib/cjs/type.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.10.
|
|
2
|
+
* sculp-js v1.10.5
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
10
10
|
|
|
11
11
|
// 常用类型定义
|
|
12
|
+
const { toString, hasOwnProperty } = Object.prototype;
|
|
12
13
|
/**
|
|
13
14
|
* 判断对象内是否有该静态属性
|
|
14
15
|
* @param {object} obj
|
|
@@ -16,7 +17,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
16
17
|
* @returns {boolean}
|
|
17
18
|
*/
|
|
18
19
|
function objectHas(obj, key) {
|
|
19
|
-
return
|
|
20
|
+
return hasOwnProperty.call(obj, key);
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
23
|
* 判断一个对象是否为类数组
|
|
@@ -43,7 +44,7 @@ function arrayLike(any) {
|
|
|
43
44
|
* @returns
|
|
44
45
|
*/
|
|
45
46
|
function typeIs(any) {
|
|
46
|
-
return
|
|
47
|
+
return toString.call(any).slice(8, -1);
|
|
47
48
|
}
|
|
48
49
|
// 基本数据类型判断
|
|
49
50
|
const isString = (any) => typeof any === 'string';
|
package/lib/cjs/unique.js
CHANGED
package/lib/cjs/url.js
CHANGED
package/lib/cjs/validator.js
CHANGED
package/lib/cjs/variable.js
CHANGED
package/lib/cjs/watermark.js
CHANGED
package/lib/cjs/we-decode.js
CHANGED
package/lib/es/array.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.10.
|
|
2
|
+
* sculp-js v1.10.5
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
function arrayEach(array, iterator, reverse = false) {
|
|
16
16
|
if (reverse) {
|
|
17
17
|
for (let idx = array.length - 1; idx >= 0; idx--) {
|
|
18
|
-
const
|
|
19
|
-
const re = iterator(val, idx, array);
|
|
18
|
+
const re = iterator(array[idx], idx, array);
|
|
20
19
|
if (re === false)
|
|
21
20
|
break;
|
|
22
21
|
else if (re === true)
|
|
@@ -25,14 +24,15 @@ function arrayEach(array, iterator, reverse = false) {
|
|
|
25
24
|
}
|
|
26
25
|
else {
|
|
27
26
|
for (let idx = 0, len = array.length; idx < len; idx++) {
|
|
28
|
-
const
|
|
29
|
-
const re = iterator(val, idx, array);
|
|
27
|
+
const re = iterator(array[idx], idx, array);
|
|
30
28
|
if (re === false)
|
|
31
29
|
break;
|
|
32
30
|
else if (re === true)
|
|
33
31
|
continue;
|
|
34
32
|
}
|
|
35
33
|
}
|
|
34
|
+
// @ts-ignore
|
|
35
|
+
array = null;
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* 异步遍历数组,返回 false 中断遍历
|
|
@@ -60,15 +60,13 @@ function arrayEach(array, iterator, reverse = false) {
|
|
|
60
60
|
async function arrayEachAsync(array, iterator, reverse = false) {
|
|
61
61
|
if (reverse) {
|
|
62
62
|
for (let idx = array.length - 1; idx >= 0; idx--) {
|
|
63
|
-
|
|
64
|
-
if ((await iterator(val, idx)) === false)
|
|
63
|
+
if ((await iterator(array[idx], idx)) === false)
|
|
65
64
|
break;
|
|
66
65
|
}
|
|
67
66
|
}
|
|
68
67
|
else {
|
|
69
68
|
for (let idx = 0, len = array.length; idx < len; idx++) {
|
|
70
|
-
|
|
71
|
-
if ((await iterator(val, idx)) === false)
|
|
69
|
+
if ((await iterator(array[idx], idx)) === false)
|
|
72
70
|
break;
|
|
73
71
|
}
|
|
74
72
|
}
|
package/lib/es/async.js
CHANGED
package/lib/es/base64.js
CHANGED
package/lib/es/clipboard.js
CHANGED
package/lib/es/cloneDeep.js
CHANGED
package/lib/es/cookie.js
CHANGED
package/lib/es/date.js
CHANGED
package/lib/es/dom.js
CHANGED
package/lib/es/download.js
CHANGED
package/lib/es/easing.js
CHANGED
package/lib/es/file.js
CHANGED
package/lib/es/func.js
CHANGED
package/lib/es/index.js
CHANGED
package/lib/es/isEqual.js
CHANGED
package/lib/es/math.js
CHANGED
package/lib/es/number.js
CHANGED
package/lib/es/object.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.10.
|
|
2
|
+
* sculp-js v1.10.5
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -33,6 +33,8 @@ function objectEach(obj, iterator) {
|
|
|
33
33
|
if (iterator(obj[key], key) === false)
|
|
34
34
|
break;
|
|
35
35
|
}
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
obj = null;
|
|
36
38
|
}
|
|
37
39
|
/**
|
|
38
40
|
* 异步遍历对象,返回 false 中断遍历
|
|
@@ -60,6 +62,8 @@ function objectMap(obj, iterator) {
|
|
|
60
62
|
continue;
|
|
61
63
|
obj2[key] = iterator(obj[key], key);
|
|
62
64
|
}
|
|
65
|
+
// @ts-ignore
|
|
66
|
+
obj = null;
|
|
63
67
|
return obj2;
|
|
64
68
|
}
|
|
65
69
|
/**
|
|
@@ -76,6 +80,8 @@ function objectPick(obj, keys) {
|
|
|
76
80
|
obj2[k] = v;
|
|
77
81
|
}
|
|
78
82
|
});
|
|
83
|
+
// @ts-ignore
|
|
84
|
+
obj = null;
|
|
79
85
|
return obj2;
|
|
80
86
|
}
|
|
81
87
|
/**
|
|
@@ -92,6 +98,8 @@ function objectOmit(obj, keys) {
|
|
|
92
98
|
obj2[k] = v;
|
|
93
99
|
}
|
|
94
100
|
});
|
|
101
|
+
// @ts-ignore
|
|
102
|
+
obj = null;
|
|
95
103
|
return obj2;
|
|
96
104
|
}
|
|
97
105
|
const merge = (map, source, target) => {
|
|
@@ -163,7 +171,7 @@ function objectFill(source, target, fillable) {
|
|
|
163
171
|
return source;
|
|
164
172
|
}
|
|
165
173
|
/**
|
|
166
|
-
*
|
|
174
|
+
* 获取对象/数组指定层级下的属性值(现在可用ES6+的可选链?.来替代)
|
|
167
175
|
* @param {AnyObject} obj
|
|
168
176
|
* @param {string} path
|
|
169
177
|
* @param {boolean} strict
|
package/lib/es/path.js
CHANGED
package/lib/es/qs.js
CHANGED
package/lib/es/random.js
CHANGED
package/lib/es/string.js
CHANGED
package/lib/es/tooltip.js
CHANGED
package/lib/es/tree.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.10.
|
|
2
|
+
* sculp-js v1.10.5
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -68,6 +68,8 @@ function forEachDeep(tree, iterator, children = 'children', isReverse = false) {
|
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
walk(tree, null);
|
|
71
|
+
// @ts-ignore
|
|
72
|
+
tree = null;
|
|
71
73
|
}
|
|
72
74
|
/**
|
|
73
75
|
* 创建一个新数组, 深度优先遍历的Map函数(支持continue和break操作), 可用于insert tree item 和 remove tree item
|
|
@@ -137,6 +139,8 @@ function mapDeep(tree, iterator, children = 'children', isReverse = false) {
|
|
|
137
139
|
}
|
|
138
140
|
};
|
|
139
141
|
walk(tree, null, newTree);
|
|
142
|
+
// @ts-ignore
|
|
143
|
+
tree = null;
|
|
140
144
|
return newTree;
|
|
141
145
|
}
|
|
142
146
|
/**
|
|
@@ -194,6 +198,8 @@ function formatTree(list, options = defaultFieldOptions) {
|
|
|
194
198
|
treeArr.push(item);
|
|
195
199
|
}
|
|
196
200
|
});
|
|
201
|
+
// @ts-ignore
|
|
202
|
+
list = null;
|
|
197
203
|
return treeArr;
|
|
198
204
|
}
|
|
199
205
|
/**
|
package/lib/es/type.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.10.
|
|
2
|
+
* sculp-js v1.10.5
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
// 常用类型定义
|
|
8
|
+
const { toString, hasOwnProperty } = Object.prototype;
|
|
8
9
|
/**
|
|
9
10
|
* 判断对象内是否有该静态属性
|
|
10
11
|
* @param {object} obj
|
|
@@ -12,7 +13,7 @@
|
|
|
12
13
|
* @returns {boolean}
|
|
13
14
|
*/
|
|
14
15
|
function objectHas(obj, key) {
|
|
15
|
-
return
|
|
16
|
+
return hasOwnProperty.call(obj, key);
|
|
16
17
|
}
|
|
17
18
|
/**
|
|
18
19
|
* 判断一个对象是否为类数组
|
|
@@ -39,7 +40,7 @@ function arrayLike(any) {
|
|
|
39
40
|
* @returns
|
|
40
41
|
*/
|
|
41
42
|
function typeIs(any) {
|
|
42
|
-
return
|
|
43
|
+
return toString.call(any).slice(8, -1);
|
|
43
44
|
}
|
|
44
45
|
// 基本数据类型判断
|
|
45
46
|
const isString = (any) => typeof any === 'string';
|
package/lib/es/unique.js
CHANGED
package/lib/es/url.js
CHANGED
package/lib/es/validator.js
CHANGED
package/lib/es/variable.js
CHANGED
package/lib/es/watermark.js
CHANGED
package/lib/es/we-decode.js
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -432,13 +432,13 @@ declare function objectAssign<R = AnyObject | AnyArray>(source: ObjectAssignItem
|
|
|
432
432
|
*/
|
|
433
433
|
declare function objectFill<R extends AnyObject = AnyObject>(source: Partial<R>, target: Partial<R>, fillable?: (s: typeof source, t: typeof target, key: keyof R) => boolean): R;
|
|
434
434
|
/**
|
|
435
|
-
*
|
|
435
|
+
* 获取对象/数组指定层级下的属性值(现在可用ES6+的可选链?.来替代)
|
|
436
436
|
* @param {AnyObject} obj
|
|
437
437
|
* @param {string} path
|
|
438
438
|
* @param {boolean} strict
|
|
439
439
|
* @returns
|
|
440
440
|
*/
|
|
441
|
-
declare function objectGet(obj: AnyObject, path: string, strict?: boolean): {
|
|
441
|
+
declare function objectGet(obj: AnyObject | AnyArray | undefined, path: string, strict?: boolean): {
|
|
442
442
|
p: any | undefined;
|
|
443
443
|
k: string | undefined;
|
|
444
444
|
v: any | undefined;
|
package/lib/umd/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.10.
|
|
2
|
+
* sculp-js v1.10.5
|
|
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}}function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function r(e){return!!f(e)||(!!i(e)||!!d(e)&&n(e,"length"))}function o(e){return Object.prototype.toString.call(e).slice(8,-1)}const i=e=>"string"==typeof e,s=e=>"boolean"==typeof e,c=e=>"number"==typeof e&&!Number.isNaN(e),a=e=>void 0===e,l=e=>null===e;function u(e){return a(e)||l(e)}const d=e=>"Object"===o(e),f=e=>Array.isArray(e),p=e=>"function"==typeof e,h=e=>Number.isNaN(e),g=e=>"Date"===o(e);function m(e){return!(!u(e)&&!Number.isNaN(e))||(r(e)&&(f(e)||i(e)||p(e.splice))?!e.length:!Object.keys(e).length)}function y(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 g(n)&&r.push([o,n.toUTCString()]);r.push(["path","/"]),document.cookie=r.map((e=>{const[t,n]=e;return`${t}=${n}`})).join(";")}const b=e=>g(e)&&!h(e.getTime()),w=e=>{if(!i(e))return;const t=e.replace(/-/g,"/");return new Date(t)},x=e=>{if(!i(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(!b(o))return;const[,s,c,a]=n,l=parseInt(c,10),u=parseInt(a,10),d=(e,t)=>"+"===s?e-t:e+t;return o.setHours(d(o.getHours(),l)),o.setMinutes(d(o.getMinutes(),u)),o};function S(e){const t=new Date(e);if(b(t))return t;const n=w(e);if(b(n))return n;const r=x(e);if(b(r))return r;throw new SyntaxError(`${e.toString()} 不是一个合法的日期描述`)}function A(e){const t=S(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)}function E(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var v=.1,F="function"==typeof Float32Array;function C(e,t){return 1-3*t+3*e}function j(e,t){return 3*t-6*e}function $(e){return 3*e}function T(e,t,n){return((C(t,n)*e+j(t,n))*e+$(t))*e}function O(e,t,n){return 3*C(t,n)*e*e+2*j(t,n)*e+$(t)}function R(e){return e}var I=E((function(e,t,n,r){if(!(0<=e&&e<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===t&&n===r)return R;for(var o=F?new Float32Array(11):new Array(11),i=0;i<11;++i)o[i]=T(i*v,e,n);function s(t){for(var r=0,i=1;10!==i&&o[i]<=t;++i)r+=v;--i;var s=r+(t-o[i])/(o[i+1]-o[i])*v,c=O(s,e,n);return c>=.001?function(e,t,n,r){for(var o=0;o<4;++o){var i=O(t,n,r);if(0===i)return t;t-=(T(t,n,r)-e)/i}return t}(t,s,e,n):0===c?s:function(e,t,n,r,o){var i,s,c=0;do{(i=T(s=t+(n-t)/2,r,o)-e)>0?n=s:t=s}while(Math.abs(i)>1e-7&&++c<10);return s}(t,r,r+v,e,n)}return function(e){return 0===e?0:1===e?1:T(s(e),t,r)}}));const D={linear:[0,0,1,1],ease:[.25,.1,.25,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]};const L=e=>{if(!d(e))return!1;const t=Object.getPrototypeOf(e);return!t||t===Object.prototype};function M(e,t){for(const r in e)if(n(e,r)&&!1===t(e[r],r))break}function N(e,t){const n={};return M(e,((e,r)=>{t.includes(r)||(n[r]=e)})),n}const P=(e,t,n)=>{if(a(n))return t;if(o(t)!==o(n))return f(n)?P(e,[],n):d(n)?P(e,{},n):n;if(L(n)){const r=e.get(n);return r||(e.set(n,t),M(n,((n,r)=>{t[r]=P(e,t[r],n)})),t)}if(f(n)){const r=e.get(n);return r||(e.set(n,t),n.forEach(((n,r)=>{t[r]=P(e,t[r],n)})),t)}return n};function B(e,...t){const n=new Map;for(let r=0,o=t.length;r<o;r++){const o=t[r];e=P(n,e,o)}return n.clear(),e}function U(e,t="-"){return e.replace(/^./,(e=>e.toLowerCase())).replace(/[A-Z]/g,(e=>`${t}${e.toLowerCase()}`))}const k="0123456789",H="abcdefghijklmnopqrstuvwxyz",z="ABCDEFGHIJKLMNOPQRSTUVWXYZ",W=/%[%sdo]/g;const q=/\${(.*?)}/g;const _=(e,t)=>{e.split(/\s+/g).forEach(t)};const G=(e,t,n)=>{d(t)?M(t,((t,n)=>{G(e,n,t)})):e.style.setProperty(U(t),n)};function V(e,t=14,n=!0){let r=0;if(console.assert(i(e),`${e} 不是有效的字符串`),i(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}const Y=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("/")},K=(e,...t)=>Y([e,...t].join("/"));function X(e){const t=new URLSearchParams(e),n={};for(const[e,r]of t.entries())a(n[e])?n[e]=r:f(n[e])||(n[e]=t.getAll(e));return n}const J=e=>i(e)?e:c(e)?String(e):s(e)?e?"true":"false":g(e)?e.toISOString():null;function Z(e,t=J){const n=new URLSearchParams;return M(e,((e,r)=>{if(f(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 Q=(e,t=!0)=>{let n=null;p(URL)&&t?n=new URL(e):(n=document.createElement("a"),n.href=e);const{protocol:r,username:o,password:i,host:s,port:c,hostname:a,hash:l,search:u,pathname:d}=n,f=K("/",d),h=o&&i?`${o}:${i}`:"",g=u.replace(/^\?/,"");return n=null,{protocol:r,auth:h,username:o,password:i,host:s,port:c,hostname:a,hash:l,search:u,searchParams:X(g),query:g,pathname:f,path:`${f}${u}`,href:e}},ee=e=>{const{protocol:t,auth:n,host:r,pathname:o,searchParams:i,hash:s}=e,c=n?`${n}@`:"",a=Z(i),l=a?`?${a}`:"";let u=s.replace(/^#/,"");return u=u?"#"+u:"",`${t}//${c}${r}${o}${l}${u}`},te=(e,t)=>{const n=Q(e);return Object.assign(n.searchParams,t),ee(n)};function ne(e,t,n){const 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),p(n)&&n()}))}function re(e,t,n){const r=URL.createObjectURL(e);ne(r,t),setTimeout((()=>{URL.revokeObjectURL(r),p(n)&&n()}))}function oe(){return!!document.createElement("canvas").getContext}function ie({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 se(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 ce=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),ae=`${k}${z}${H}`;const le=`${k}${z}${H}`,ue="undefined"!=typeof BigInt,de=()=>se("JSBI"),fe=e=>ue?BigInt(e):de().BigInt(e);function pe(e,t=le){if(t.length<2)throw new Error("进制池长度不能少于 2");if(!ue)throw new Error('需要安装 jsbi 模块并将 JSBI 设置为全局变量:\nimport JSBI from "jsbi"; window.JSBI = JSBI;');let n=fe(e);const r=[],{length:o}=t,i=fe(o),s=()=>{const e=Number(((e,t)=>ue?e%t:de().remainder(e,t))(n,i));n=((e,t)=>ue?e/t:de().divide(e,t))(n,i),r.unshift(t[e]),n>0&&s()};return s(),r.join("")}const he=(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 c=Number(e),a=0;for(;c>=r&&a<s-1;)c/=r,a++;const l=c.toFixed(o),u=t[a];return String(l)+i+u};function ge(e,t){if(u(t))return parseInt(String(e)).toLocaleString();let n=0;if(!c(t))throw new Error("Decimals must be a positive number not less than zero");return t>0&&(n=t),Number(Number(e).toFixed(n)).toLocaleString("en-US")}let me=0,ye=0;const be=(e=18)=>{const t=Date.now();e=Math.max(e,18),t!==ye&&(ye=t,me=0);const n=`${t}`;let r="";const o=e-5-13;if(o>0){r=`${ce(10**(o-1),10**o-1)}`}const i=((e,t=2)=>String(e).padStart(t,"0"))(me,5);return me++,`${n}${r}${i}`},we=e=>e[ce(0,e.length-1)];function xe(e,t,n){let r=250,o=13;const i=e.children[0];V(t,12)<230?(i.style.maxWidth=V(t,12)+20+50+"px",r=n.clientX+(V(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 Se={handleMouseEnter:function({rootContainer:e="#root",title:t,event:n,bgColor:r="#000",color:o="#fff"}){try{const s=i(e)?document.querySelector(e):e;if(!s)throw new Error(`${e} is not valid Html Element or element selector`);let c=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(c=document.querySelector("#customTitle1494304949567"),c)xe(c,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>',s.appendChild(e),c=document.querySelector("#customTitle1494304949567"),t&&(xe(c,t,n),c.style.visibility="visible")}}catch(e){console.error(e.message)}},handleMouseLeave:function(e="#root"){const t=i(e)?document.querySelector(e):e,n=document.querySelector("#customTitle1494304949567");t&&n&&t.removeChild(n)}},Ae={keyField:"key",childField:"children",pidField:"pid"},Ee={childField:"children",nameField:"name",removeEmptyChild:!1,ignoreCase:!0};const ve=(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)},Fe=(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),(ve(e,o)+ve(t,o))/o};const Ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",je=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;function $e(e){let t,n,r,o,i="",s=0;const c=(e=String(e)).length,a=c%3;for(;s<c;){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+=Ce.charAt(t>>18&63)+Ce.charAt(t>>12&63)+Ce.charAt(t>>6&63)+Ce.charAt(63&t)}return a?i.slice(0,a-3)+"===".substring(a):i}function Te(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!je.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=Ce.indexOf(e.charAt(i++))<<18|Ce.indexOf(e.charAt(i++))<<12|(n=Ce.indexOf(e.charAt(i++)))<<6|(r=Ce.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 Oe=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,Re=/^(?:(?:\+|00)86)?1\d{10}$/,Ie=/^(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]$/,De=/^(https?|ftp):\/\/([^\s/$.?#].[^\s]*)$/i,Le=/^https?:\/\/([^\s/$.?#].[^\s]*)$/i,Me=/^(?:(?:\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,Pe=/^(-?[1-9]\d*|0)$/,Be=e=>Pe.test(e),Ue=/^-?([1-9]\d*|0)\.\d*[1-9]$/,ke=e=>Ue.test(e),He=/^\d+$/;function ze(e){return[...new Set(e.trim().split(""))].join("")}function We(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function qe(e,t){return new RegExp(`${We(e.trim())}\\s*([^${We(ze(e))}${We(ze(t))}\\s]*)\\s*${t.trim()}`,"g")}function _e(e,t,n=new WeakMap){if(Object.is(e,t))return!0;const r=Object.prototype.toString.call(e);if(r!==Object.prototype.toString.call(t))return!1;if(d(e)&&d(t)){if(n.has(e))return n.get(e)===t;n.set(e,t),n.set(t,e)}switch(r){case"[object Date]":return e.getTime()===t.getTime();case"[object RegExp]":return e.toString()===t.toString();case"[object Map]":return function(e,t,n){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!t.has(r)||!_e(o,t.get(r),n))return!1;return!0}(e,t,n);case"[object Set]":return function(e,t,n){if(e.size!==t.size)return!1;for(const r of e){let e=!1;for(const o of t)if(_e(r,o,n)){e=!0;break}if(!e)return!1}return!0}(e,t,n);case"[object ArrayBuffer]":return function(e,t){return e.byteLength===t.byteLength&&new DataView(e).getInt32(0)===new DataView(t).getInt32(0)}(e,t);case"[object DataView]":return function(e,t,n){return e.byteLength===t.byteLength&&_e(new Uint8Array(e.buffer),new Uint8Array(t.buffer),n)}(e,t,n);case"[object Int8Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Int16Array]":case"[object Uint16Array]":case"[object Int32Array]":case"[object Uint32Array]":case"[object Float32Array]":case"[object Float64Array]":return function(e,t,n){return e.byteLength===t.byteLength&&_e(Array.from(e),Array.from(t),n)}(e,t,n);case"[object Object]":return Ge(e,t,n);case"[object Array]":return function(e,t,n){const r=Object.keys(e).map(Number),o=Object.keys(t).map(Number);if(r.length!==o.length)return!1;for(let r=0,o=e.length;r<o;r++)if(!_e(e[r],t[r],n))return!1;return Ge(e,t,n)}(e,t,n)}return!1}function Ge(e,t,n){const r=Reflect.ownKeys(e),o=Reflect.ownKeys(t);if(r.length!==o.length)return!1;for(const i of r){if(!o.includes(i))return!1;if(!_e(e[i],t[i],n))return!1}return Object.getPrototypeOf(e)===Object.getPrototypeOf(t)}e.EMAIL_REGEX=Oe,e.HEX_POOL=le,e.HTTP_URL_REGEX=Le,e.IPV4_REGEX=Me,e.IPV6_REGEX=Ne,e.PHONE_REGEX=Re,e.STRING_ARABIC_NUMERALS=k,e.STRING_LOWERCASE_ALPHA=H,e.STRING_POOL=ae,e.STRING_UPPERCASE_ALPHA=z,e.UNIQUE_NUMBER_SAFE_LENGTH=18,e.URL_REGEX=De,e.add=Fe,e.addClass=function(e,t){_(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;n--){const r=e[n];if(!1===await t(r,n))break}else for(let n=0,r=e.length;n<r;n++){const r=e[n];if(!1===await t(r,n))break}},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=r,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),c=[];let a,l=0,u=0;const d=()=>{if(a)return o(a);const n=i.next();if(n.done)return void(l===e.length&&r(c));const s=u++;t(n.value,s,e).then((e=>{l++,c[s]=e,d()})).catch((e=>{a=e,d()}))};for(let e=0;e<s;e++)d()}))},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,c=new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds()).getTime()+864e5*parseInt(String(t)),a=new Date(c);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){const n=document.createElement("input");return 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},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(!oe())throw new Error("Current runtime environment not support Canvas");const{quality:r,mime:o="image/jpeg",maxSize:i,minFileSizeKB:s=50}=d(n)?n:{};let a,l=r;if(r)l=r;else if(t instanceof File){const e=+parseInt((t.size/1024).toFixed(2));l=e<s?1:e<1024?.85:e<5120?.8:.75}return c(i)&&(a=i>=1200?i:1200),t instanceof FileList?Promise.all(Array.from(t).map((t=>e(t,{maxSize:a,mime:o,quality:l})))):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,p=s.height,{width:h,height:g}=function({sizeKB:e,maxSize:t,originWidth:n,originHeight:r}){let o=n,i=r;if(c(t)){const{width:e,height:s}=ie({maxWidth:t,maxHeight:t,originWidth:n,originHeight:r});o=e,i=s}else if(e<500){const e=1200,t=1200,{width:s,height:c}=ie({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=c}else if(e<5120){const e=1400,t=1400,{width:s,height:c}=ie({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=c}else if(e<10240){const e=1600,t=1600,{width:s,height:c}=ie({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=c}else if(10240<=e){const e=n>15e3?8192:n>1e4?4096:2048,t=r>15e3?8192:r>1e4?4096:2048,{width:s,height:c}=ie({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=c}return{width:o,height:i}}({sizeKB:r,maxSize:a,originWidth:f,originHeight:p});u.width=h,u.height=g,d.clearRect(0,0,h,g),d.drawImage(s,0,0,h,g);const m=u.toDataURL(o,l),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=>y(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=y,e.copyText=function(e){const t=document.createElement("textarea");t.style.position="absolute",t.style.top="-9999px",t.style.left="-9999px",t.value=e,document.body.appendChild(t),t.focus({preventScroll:!0}),t.select();try{document.execCommand("copy"),t.blur(),document.body.removeChild(t)}catch(e){}},e.crossOriginDownload=function(e,t,n){const{successCode:r=200,successCallback:o,failCallback:s}=u(n)?{successCode:200,successCallback:void 0,failCallback:void 0}:n,c=new XMLHttpRequest;c.open("GET",e,!0),c.responseType="blob",c.onload=function(){if(c.status===r)re(c.response,t,o);else if(p(s)){const e=c.status,t=c.getResponseHeader("Content-Type");if(i(t)&&t.includes("application/json")){const t=new FileReader;t.onload=()=>{s({status:e,response:t.result})},t.readAsText(c.response)}else s(c)}},c.onerror=e=>{p(s)&&s({status:0,code:"ERROR_CONNECTION_REFUSED"})},c.send()},e.dateParse=S,e.dateToEnd=function(e){const t=A(e);return t.setDate(t.getDate()+1),S(t.getTime()-1)},e.dateToStart=A,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.decodeFromBase64=function(e){const t=u(se("atob"))?Te(e):se("atob")(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return u(se("TextDecoder"))?function(e){const t=String.fromCharCode.apply(null,e);return decodeURIComponent(t)}(r):new(se("TextDecoder"))("utf-8").decode(r)},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=re,e.downloadData=function(e,t,n,r){if(n=n.replace(`.${t}`,"")+`.${t}`,"json"===t){re(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"}));ne("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=ne,e.downloadURL=function(e,t){window.open(t?te(e,t):e)},e.encodeToBase64=function(e){const t=u(se("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(se("TextEncoder"))).encode(e);let n="";const r=t.length;for(let e=0;e<r;e++)n+=String.fromCharCode(t[e]);return u(se("btoa"))?$e(n):se("btoa")(n)},e.escapeRegExp=We,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.flatTree=function e(r,o=Ae){const{childField:i,keyField:s,pidField:c}=o;let a=[];return t(r,(t=>{const r={...t,[i]:[]};if(n(r,i)&&delete r[i],a.push(r),t[i]){const n=t[i].map((e=>({...e,[c]:t[s]||e.pid})));a=a.concat(e(n,o))}})),a},e.forEachDeep=function(e,t,n="children",r=!1){let o=!1;const i=(s,c,a=0)=>{if(r)for(let r=s.length-1;r>=0&&!o;r--){const l=t(s[r],r,s,e,c,a);if(!1===l){o=!0;break}!0!==l&&s[r]&&Array.isArray(s[r][n])&&i(s[r][n],s[r],a+1)}else for(let r=0,l=s.length;r<l&&!o;r++){const l=t(s[r],r,s,e,c,a);if(!1===l){o=!0;break}!0!==l&&s[r]&&Array.isArray(s[r][n])&&i(s[r][n],s[r],a+1)}};i(e,null)},e.formatDate=function(e,t="YYYY-MM-DD HH:mm:ss"){const n=S(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=ge,e.formatNumber=ge,e.formatTree=function(e,n=Ae){const{keyField:r,childField:o,pidField:i}=n,s=[],c={};return t(e,(e=>{c[e[r]]=e})),t(e,(e=>{const t=c[e[i]];t?(t[o]||(t[o]=[])).push(e):s.push(e)})),s},e.fuzzySearchTree=function e(r,o,i=Ee){if(!n(o,"filter")&&(!n(o,"keyword")||m(o.keyword)))return r;const s=[];return t(r,(t=>{const r=t[i.childField]&&t[i.childField].length>0?e(t[i.childField]||[],o,i):[];((n(o,"filter")?o.filter(t):i.ignoreCase?t[i.nameField].toLowerCase().includes(o.keyword.toLowerCase()):t[i.nameField].includes(o.keyword))||r.length>0)&&(t[i.childField]?r.length>0?s.push({...t,[i.childField]:r}):i.removeEmptyChild?(t[i.childField]&&delete t[i.childField],s.push({...t})):s.push({...t,[i.childField]:[]}):(t[i.childField]&&delete t[i.childField],s.push({...t})))})),s},e.genCanvasWM=function e(t="请勿外传",n){const{rootContainer:r=document.body,width:o="300px",height:s="150px",textAlign:c="center",textBaseline:a="middle",font:l="20px PingFangSC-Medium,PingFang SC",fillStyle:d="rgba(189, 177, 167, .3)",rotate:f=-20,zIndex:p=2147483647,watermarkId:h="__wm"}=u(n)?{}:n,g=i(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",s);const y=m.getContext("2d");y.textAlign=c,y.textBaseline=a,y.font=l,y.fillStyle=d,y.rotate(Math.PI/180*f),y.fillText(t,parseFloat(o)/4,parseFloat(s)/2);const b=m.toDataURL(),w=document.querySelector(`#${h}`),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:${p}; pointer-events:none; background-repeat:repeat; background-image:url('${b}')`;x.setAttribute("style",S),x.setAttribute("id",h),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(){const o=document.querySelector(`#${h}`);if(o){const{opacity:i,zIndex:s,display:c,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"!==c||"visible"!==a)&&(r.disconnect(),r=null,g.removeChild(o),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=se,e.getStrWidthPx=V,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 c=r?["B","kB","MB","GB","TB","PB","EB","ZB","YB"]:["Byte","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];if(!u(i)){const e=c.findIndex((e=>e===i));-1!==e&&(c=c.slice(e))}if(!u(s)){const e=c.findIndex((e=>e===s));-1!==e&&c.splice(e+1)}return he(e,c,{ratio:r?1e3:1024,decimals:n,separator:o})},e.isArray=f,e.isBigInt=e=>"bigint"==typeof e,e.isBoolean=s,e.isDate=g,e.isDigit=e=>He.test(e),e.isEmail=e=>Oe.test(e),e.isEmpty=m,e.isEqual=function(e,t){return _e(e,t)},e.isError=e=>"Error"===o(e),e.isFloat=ke,e.isFunction=p,e.isIdNo=e=>{if(!Ie.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=Be,e.isIpV4=e=>Me.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=h,e.isNull=l,e.isNullOrUnDef=u,e.isNullish=u,e.isNumber=c,e.isNumerical=e=>Be(e)||ke(e),e.isObject=d,e.isPhone=e=>Re.test(e),e.isPlainObject=L,e.isPrimitive=e=>null===e||"object"!=typeof e,e.isRegExp=e=>"RegExp"===o(e),e.isString=i,e.isSymbol=e=>"symbol"==typeof e,e.isUndefined=a,e.isUrl=(e,t=!1)=>(t?De:Le).test(e),e.isValidDate=b,e.mapDeep=function(e,t,n="children",r=!1){let o=!1;const i=[],s=(i,c,a,l=0)=>{if(r)for(let r=i.length-1;r>=0&&!o;r--){const u=t(i[r],r,i,e,c,l);if(!1===u){o=!0;break}!0!==u&&(a.push(N(u,[n])),i[r]&&Array.isArray(i[r][n])?(a[a.length-1][n]=[],s(i[r][n],i[r],a[a.length-1][n],l+1)):delete u[n])}else for(let r=0;r<i.length&&!o;r++){const u=t(i[r],r,i,e,c,l);if(!1===u){o=!0;break}!0!==u&&(a.push(N(u,[n])),i[r]&&Array.isArray(i[r][n])?(a[a.length-1][n]=[],s(i[r][n],i[r],a[a.length-1][n],l+1)):delete u[n])}};return s(e,null,i),i},e.multiply=ve,e.numberAbbr=he,e.numberToHex=pe,e.objectAssign=B,e.objectEach=M,e.objectEachAsync=async function(e,t){for(const r in e)if(n(e,r)&&!1===await t(e[r],r))break},e.objectFill=function(e,t,n){const r=n||((e,t,n)=>void 0===e[n]);return M(t,((n,o)=>{r(e,t,o)&&(e[o]=n)})),e},e.objectGet=function(e,t,r=!1){const o=(t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split(".");let i=e,s=0;for(let e=o.length;s<e-1;++s){const e=o[s];if(c(Number(e))&&Array.isArray(i))i=i[e];else{if(!d(i)||!n(i,e)){if(i=void 0,r)throw new Error("[Object] objectGet path 路径不正确");break}i=i[e]}}return{p:i,k:i?o[s]:void 0,v:i?i[o[s]]:void 0}},e.objectHas=n,e.objectMap=function(e,t){const r={};for(const o in e)n(e,o)&&(r[o]=t(e[o],o));return r},e.objectMerge=B,e.objectOmit=N,e.objectPick=function(e,t){const n={};return M(e,((e,r)=>{t.includes(r)&&(n[r]=e)})),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(qe(t,n))).map((e=>u(e)?void 0:e[1]))},e.pathJoin=K,e.pathNormalize=Y,e.qsParse=X,e.qsStringify=Z,e.randomNumber=ce,e.randomString=(e,t)=>{let n=0,r=ae;i(t)?(n=e,r=t):c(e)?n=e:i(e)&&(r=e);let o=Math.max(n,1),s="";const a=r.length-1;if(a<2)throw new Error("字符串池长度不能少于 2");for(;o--;){s+=r[ce(0,a)]}return s},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=ce(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){_(t,(t=>e.classList.remove(t)))},e.replaceVarFromString=function(e,t,r="{",o="}"){return e.replace(new RegExp(qe(r,o)),(function(e,r){return n(t,r)?t[r]:e}))},e.searchTreeById=function(e,t,n){const{children:r="children",id:o="id"}=n||{},i=(e,t,n)=>e.reduce(((e,s)=>{const c=s[r];return[...e,t?{...s,parentId:t,parent:n}:s,...c&&c.length?i(c,s[o],s):[]]}),[]);return(e=>{let n=e.find((e=>e[o]===t));const{parent:r,parentId:i,...s}=n;let c=[t],a=[s];for(;n&&n.parentId;)c=[n.parentId,...c],a=[n.parent,...a],n=e.find((e=>e[o]===n.parentId));return[c,a]})(i(e))},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=G,e.smoothScroll=function(e){return new Promise((n=>{const r={el:document,to:0,duration:567,easing:"ease"},{el:o,to:i,duration:s,easing:c}=B(r,e),a=document.documentElement,l=document.body,u=o===window||o===document||o===a||o===l?[a,l]:[o];let d;const p=(()=>{let e=0;return t(u,(t=>{if("scrollTop"in t)return e=t.scrollTop,!1})),e})(),h=i-p,g=function(e){let t;if(f(e))t=I(...e);else{const n=D[e];if(!n)throw new Error(`${e} 缓冲函数未定义`);t=I(...n)}return e=>t(Math.max(0,Math.min(e,1)))}(c),m=()=>{const e=performance.now(),t=(d?e-d:0)/s,r=g(t);var o;d||(d=e),o=p+h*r,u.forEach((e=>{"scrollTop"in e&&(e.scrollTop=o)})),t>=1?n():requestAnimationFrame(m)};m()}))},e.stringAssign=(e,t)=>e.replace(q,((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={"&":"&","<":"<",">":">",'"':"""};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(W,(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=U,e.strip=function(e,t=15){return+parseFloat(Number(e).toPrecision(t))},e.subtract=(e,t)=>Fe(e,-t),e.supportCanvas=oe,e.throttle=(e,t,n)=>{let r,o=!1,i=0;const s=function(...s){if(o)return;const c=Date.now(),a=()=>{i=c,e.call(this,...s)};if(0===i)return n?a():void(i=c);i+t-c>0?(clearTimeout(r),r=setTimeout((()=>a()),t)):a()};return s.cancel=()=>{clearTimeout(r),o=!0},s},e.tooltipEvent=Se,e.typeIs=o,e.uniqueNumber=be,e.uniqueString=(e,t)=>{let n=0,r=le;i(t)?(n=e,r=t):c(e)?n=e:i(e)&&(r=e);let o=pe(be(),r),s=n-o.length;if(s<=0)return o;for(;s--;)o+=we(r);return o},e.uniqueSymbol=ze,e.urlDelParams=(e,t)=>{const n=Q(e);return t.forEach((e=>delete n.searchParams[e])),ee(n)},e.urlParse=Q,e.urlSetParams=te,e.urlStringify=ee,e.wait=function(e=1){return new Promise((t=>setTimeout(t,e)))},e.weAtob=Te,e.weBtoa=$e}));
|
|
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)||(!!c(e)||!!h(e)&&o(e,"length"))}function s(e){return n.call(e).slice(8,-1)}const c=e=>"string"==typeof e,a=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!(!f(e)&&!Number.isNaN(e))||(i(e)&&(p(e)||c(e)||g(e.splice))?!e.length:!Object.keys(e).length)}function w(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 x=e=>y(e)&&!m(e.getTime()),S=e=>{if(!c(e))return;const t=e.replace(/-/g,"/");return new Date(t)},A=e=>{if(!c(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(!x(o))return;const[,i,s,a]=n,l=parseInt(s,10),u=parseInt(a,10),d=(e,t)=>"+"===i?e-t:e+t;return o.setHours(d(o.getHours(),l)),o.setMinutes(d(o.getMinutes(),u)),o};function E(e){const t=new Date(e);if(x(t))return t;const n=S(e);if(x(n))return n;const r=A(e);if(x(r))return r;throw new SyntaxError(`${e.toString()} 不是一个合法的日期描述`)}function v(e){const t=E(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)}function F(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var C=.1,j="function"==typeof Float32Array;function $(e,t){return 1-3*t+3*e}function T(e,t){return 3*t-6*e}function R(e){return 3*e}function I(e,t,n){return(($(t,n)*e+T(t,n))*e+R(t))*e}function O(e,t,n){return 3*$(t,n)*e*e+2*T(t,n)*e+R(t)}function D(e){return e}var L=F((function(e,t,n,r){if(!(0<=e&&e<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===t&&n===r)return D;for(var o=j?new Float32Array(11):new Array(11),i=0;i<11;++i)o[i]=I(i*C,e,n);function s(t){for(var r=0,i=1;10!==i&&o[i]<=t;++i)r+=C;--i;var s=r+(t-o[i])/(o[i+1]-o[i])*C,c=O(s,e,n);return c>=.001?function(e,t,n,r){for(var o=0;o<4;++o){var i=O(t,n,r);if(0===i)return t;t-=(I(t,n,r)-e)/i}return t}(t,s,e,n):0===c?s:function(e,t,n,r,o){var i,s,c=0;do{(i=I(s=t+(n-t)/2,r,o)-e)>0?n=s:t=s}while(Math.abs(i)>1e-7&&++c<10);return s}(t,r,r+C,e,n)}return function(e){return 0===e?0:1===e?1:I(s(e),t,r)}}));const M={linear:[0,0,1,1],ease:[.25,.1,.25,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]};const N=e=>{if(!h(e))return!1;const t=Object.getPrototypeOf(e);return!t||t===Object.prototype};function P(e,t){for(const n in e)if(o(e,n)&&!1===t(e[n],n))break;e=null}function B(e,t){const n={};return P(e,((e,r)=>{t.includes(r)||(n[r]=e)})),e=null,n}const U=(e,t,n)=>{if(u(n))return t;if(s(t)!==s(n))return p(n)?U(e,[],n):h(n)?U(e,{},n):n;if(N(n)){const r=e.get(n);return r||(e.set(n,t),P(n,((n,r)=>{t[r]=U(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]=U(e,t[r],n)})),t)}return n};function k(e,...t){const n=new Map;for(let r=0,o=t.length;r<o;r++){const o=t[r];e=U(n,e,o)}return n.clear(),e}function H(e,t="-"){return e.replace(/^./,(e=>e.toLowerCase())).replace(/[A-Z]/g,(e=>`${t}${e.toLowerCase()}`))}const z="0123456789",W="abcdefghijklmnopqrstuvwxyz",q="ABCDEFGHIJKLMNOPQRSTUVWXYZ",_=/%[%sdo]/g;const G=/\${(.*?)}/g;const V=(e,t)=>{e.split(/\s+/g).forEach(t)};const Y=(e,t,n)=>{h(t)?P(t,((t,n)=>{Y(e,n,t)})):e.style.setProperty(H(t),n)};function K(e,t=14,n=!0){let r=0;if(console.assert(c(e),`${e} 不是有效的字符串`),c(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}const X=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("/")},J=(e,...t)=>X([e,...t].join("/"));function Z(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 Q=e=>c(e)?e:l(e)?String(e):a(e)?e?"true":"false":y(e)?e.toISOString():null;function ee(e,t=Q){const n=new URLSearchParams;return P(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 te=(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:c,hostname:a,hash:l,search:u,pathname:d}=n,f=J("/",d),h=o&&i?`${o}:${i}`:"",p=u.replace(/^\?/,"");return n=null,{protocol:r,auth:h,username:o,password:i,host:s,port:c,hostname:a,hash:l,search:u,searchParams:Z(p),query:p,pathname:f,path:`${f}${u}`,href:e}},ne=e=>{const{protocol:t,auth:n,host:r,pathname:o,searchParams:i,hash:s}=e,c=n?`${n}@`:"",a=ee(i),l=a?`?${a}`:"";let u=s.replace(/^#/,"");return u=u?"#"+u:"",`${t}//${c}${r}${o}${l}${u}`},re=(e,t)=>{const n=te(e);return Object.assign(n.searchParams,t),ne(n)};function oe(e,t,n){const 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),g(n)&&n()}))}function ie(e,t,n){const r=URL.createObjectURL(e);oe(r,t),setTimeout((()=>{URL.revokeObjectURL(r),g(n)&&n()}))}function se(){return!!document.createElement("canvas").getContext}function ce({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 ae(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 le=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),ue=`${z}${q}${W}`;const de=`${z}${q}${W}`,fe="undefined"!=typeof BigInt,he=()=>ae("JSBI"),pe=e=>fe?BigInt(e):he().BigInt(e);function ge(e,t=de){if(t.length<2)throw new Error("进制池长度不能少于 2");if(!fe)throw new Error('需要安装 jsbi 模块并将 JSBI 设置为全局变量:\nimport JSBI from "jsbi"; window.JSBI = JSBI;');let n=pe(e);const r=[],{length:o}=t,i=pe(o),s=()=>{const e=Number(((e,t)=>fe?e%t:he().remainder(e,t))(n,i));n=((e,t)=>fe?e/t:he().divide(e,t))(n,i),r.unshift(t[e]),n>0&&s()};return s(),r.join("")}const me=(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 c=Number(e),a=0;for(;c>=r&&a<s-1;)c/=r,a++;const l=c.toFixed(o),u=t[a];return String(l)+i+u};function ye(e,t){if(f(t))return parseInt(String(e)).toLocaleString();let n=0;if(!l(t))throw new Error("Decimals must be a positive number not less than zero");return t>0&&(n=t),Number(Number(e).toFixed(n)).toLocaleString("en-US")}let be=0,we=0;const xe=(e=18)=>{const t=Date.now();e=Math.max(e,18),t!==we&&(we=t,be=0);const n=`${t}`;let r="";const o=e-5-13;if(o>0){r=`${le(10**(o-1),10**o-1)}`}const i=((e,t=2)=>String(e).padStart(t,"0"))(be,5);return be++,`${n}${r}${i}`},Se=e=>e[le(0,e.length-1)];function Ae(e,t,n){let r=250,o=13;const i=e.children[0];K(t,12)<230?(i.style.maxWidth=K(t,12)+20+50+"px",r=n.clientX+(K(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 Ee={handleMouseEnter:function({rootContainer:e="#root",title:t,event:n,bgColor:r="#000",color:o="#fff"}){try{const i=c(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)Ae(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&&(Ae(s,t,n),s.style.visibility="visible")}}catch(e){console.error(e.message)}},handleMouseLeave:function(e="#root"){const t=c(e)?document.querySelector(e):e,n=document.querySelector("#customTitle1494304949567");t&&n&&t.removeChild(n)}},ve={keyField:"key",childField:"children",pidField:"pid"},Fe={childField:"children",nameField:"name",removeEmptyChild:!1,ignoreCase:!0};const Ce=(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)},je=(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),(Ce(e,o)+Ce(t,o))/o};const $e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Te=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;function Re(e){let t,n,r,o,i="",s=0;const c=(e=String(e)).length,a=c%3;for(;s<c;){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+=$e.charAt(t>>18&63)+$e.charAt(t>>12&63)+$e.charAt(t>>6&63)+$e.charAt(63&t)}return a?i.slice(0,a-3)+"===".substring(a):i}function Ie(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!Te.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=$e.indexOf(e.charAt(i++))<<18|$e.indexOf(e.charAt(i++))<<12|(n=$e.indexOf(e.charAt(i++)))<<6|(r=$e.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 Oe=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,De=/^(?:(?:\+|00)86)?1\d{10}$/,Le=/^(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]$/,Me=/^(https?|ftp):\/\/([^\s/$.?#].[^\s]*)$/i,Ne=/^https?:\/\/([^\s/$.?#].[^\s]*)$/i,Pe=/^(?:(?:\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])$/,Be=/^(([\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,Ue=/^(-?[1-9]\d*|0)$/,ke=e=>Ue.test(e),He=/^-?([1-9]\d*|0)\.\d*[1-9]$/,ze=e=>He.test(e),We=/^\d+$/;function qe(e){return[...new Set(e.trim().split(""))].join("")}function _e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ge(e,t){return new RegExp(`${_e(e.trim())}\\s*([^${_e(qe(e))}${_e(qe(t))}\\s]*)\\s*${t.trim()}`,"g")}function Ve(e,t,n=new WeakMap){if(Object.is(e,t))return!0;const r=Object.prototype.toString.call(e);if(r!==Object.prototype.toString.call(t))return!1;if(h(e)&&h(t)){if(n.has(e))return n.get(e)===t;n.set(e,t),n.set(t,e)}switch(r){case"[object Date]":return e.getTime()===t.getTime();case"[object RegExp]":return e.toString()===t.toString();case"[object Map]":return function(e,t,n){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!t.has(r)||!Ve(o,t.get(r),n))return!1;return!0}(e,t,n);case"[object Set]":return function(e,t,n){if(e.size!==t.size)return!1;for(const r of e){let e=!1;for(const o of t)if(Ve(r,o,n)){e=!0;break}if(!e)return!1}return!0}(e,t,n);case"[object ArrayBuffer]":return function(e,t){return e.byteLength===t.byteLength&&new DataView(e).getInt32(0)===new DataView(t).getInt32(0)}(e,t);case"[object DataView]":return function(e,t,n){return e.byteLength===t.byteLength&&Ve(new Uint8Array(e.buffer),new Uint8Array(t.buffer),n)}(e,t,n);case"[object Int8Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Int16Array]":case"[object Uint16Array]":case"[object Int32Array]":case"[object Uint32Array]":case"[object Float32Array]":case"[object Float64Array]":return function(e,t,n){return e.byteLength===t.byteLength&&Ve(Array.from(e),Array.from(t),n)}(e,t,n);case"[object Object]":return Ye(e,t,n);case"[object Array]":return function(e,t,n){const r=Object.keys(e).map(Number),o=Object.keys(t).map(Number);if(r.length!==o.length)return!1;for(let r=0,o=e.length;r<o;r++)if(!Ve(e[r],t[r],n))return!1;return Ye(e,t,n)}(e,t,n)}return!1}function Ye(e,t,n){const r=Reflect.ownKeys(e),o=Reflect.ownKeys(t);if(r.length!==o.length)return!1;for(const i of r){if(!o.includes(i))return!1;if(!Ve(e[i],t[i],n))return!1}return Object.getPrototypeOf(e)===Object.getPrototypeOf(t)}e.EMAIL_REGEX=Oe,e.HEX_POOL=de,e.HTTP_URL_REGEX=Ne,e.IPV4_REGEX=Pe,e.IPV6_REGEX=Be,e.PHONE_REGEX=De,e.STRING_ARABIC_NUMERALS=z,e.STRING_LOWERCASE_ALPHA=W,e.STRING_POOL=ue,e.STRING_UPPERCASE_ALPHA=q,e.UNIQUE_NUMBER_SAFE_LENGTH=18,e.URL_REGEX=Me,e.add=je,e.addClass=function(e,t){V(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),c=[];let a,l=0,u=0;const d=()=>{if(a)return o(a);const n=i.next();if(n.done)return void(l===e.length&&r(c));const s=u++;t(n.value,s,e).then((e=>{l++,c[s]=e,d()})).catch((e=>{a=e,d()}))};for(let e=0;e<s;e++)d()}))},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,c=new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds()).getTime()+864e5*parseInt(String(t)),a=new Date(c);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){const n=document.createElement("input");return 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},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(!se())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 c,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 l(i)&&(c=i>=1200?i:1200),t instanceof FileList?Promise.all(Array.from(t).map((t=>e(t,{maxSize:c,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(l(t)){const{width:e,height:s}=ce({maxWidth:t,maxHeight:t,originWidth:n,originHeight:r});o=e,i=s}else if(e<500){const e=1200,t=1200,{width:s,height:c}=ce({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=c}else if(e<5120){const e=1400,t=1400,{width:s,height:c}=ce({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=c}else if(e<10240){const e=1600,t=1600,{width:s,height:c}=ce({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=c}else if(10240<=e){const e=n>15e3?8192:n>1e4?4096:2048,t=r>15e3?8192:r>1e4?4096:2048,{width:s,height:c}=ce({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=c}return{width:o,height:i}}({sizeKB:r,maxSize:c,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=>w(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=w,e.copyText=function(e){const t=document.createElement("textarea");t.style.position="absolute",t.style.top="-9999px",t.style.left="-9999px",t.value=e,document.body.appendChild(t),t.focus({preventScroll:!0}),t.select();try{document.execCommand("copy"),t.blur(),document.body.removeChild(t)}catch(e){}},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)ie(s.response,t,o);else if(g(i)){const e=s.status,t=s.getResponseHeader("Content-Type");if(c(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=E,e.dateToEnd=function(e){const t=v(e);return t.setDate(t.getDate()+1),E(t.getTime()-1)},e.dateToStart=v,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.decodeFromBase64=function(e){const t=f(ae("atob"))?Ie(e):ae("atob")(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return f(ae("TextDecoder"))?function(e){const t=String.fromCharCode.apply(null,e);return decodeURIComponent(t)}(r):new(ae("TextDecoder"))("utf-8").decode(r)},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=ie,e.downloadData=function(e,t,n,r){if(n=n.replace(`.${t}`,"")+`.${t}`,"json"===t){ie(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"}));oe("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=oe,e.downloadURL=function(e,t){window.open(t?re(e,t):e)},e.encodeToBase64=function(e){const t=f(ae("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(ae("TextEncoder"))).encode(e);let n="";const r=t.length;for(let e=0;e<r;e++)n+=String.fromCharCode(t[e]);return f(ae("btoa"))?Re(n):ae("btoa")(n)},e.escapeRegExp=_e,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.flatTree=function e(n,r=ve){const{childField:i,keyField:s,pidField:c}=r;let a=[];return t(n,(t=>{const n={...t,[i]:[]};if(o(n,i)&&delete n[i],a.push(n),t[i]){const n=t[i].map((e=>({...e,[c]:t[s]||e.pid})));a=a.concat(e(n,r))}})),a},e.forEachDeep=function(e,t,n="children",r=!1){let o=!1;const i=(s,c,a=0)=>{if(r)for(let r=s.length-1;r>=0&&!o;r--){const l=t(s[r],r,s,e,c,a);if(!1===l){o=!0;break}!0!==l&&s[r]&&Array.isArray(s[r][n])&&i(s[r][n],s[r],a+1)}else for(let r=0,l=s.length;r<l&&!o;r++){const l=t(s[r],r,s,e,c,a);if(!1===l){o=!0;break}!0!==l&&s[r]&&Array.isArray(s[r][n])&&i(s[r][n],s[r],a+1)}};i(e,null),e=null},e.formatDate=function(e,t="YYYY-MM-DD HH:mm:ss"){const n=E(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=ye,e.formatNumber=ye,e.formatTree=function(e,n=ve){const{keyField:r,childField:o,pidField:i}=n,s=[],c={};return t(e,(e=>{c[e[r]]=e})),t(e,(e=>{const t=c[e[i]];t?(t[o]||(t[o]=[])).push(e):s.push(e)})),e=null,s},e.fuzzySearchTree=function e(n,r,i=Fe){if(!o(r,"filter")&&(!o(r,"keyword")||b(r.keyword)))return n;const s=[];return t(n,(t=>{const n=t[i.childField]&&t[i.childField].length>0?e(t[i.childField]||[],r,i):[];((o(r,"filter")?r.filter(t):i.ignoreCase?t[i.nameField].toLowerCase().includes(r.keyword.toLowerCase()):t[i.nameField].includes(r.keyword))||n.length>0)&&(t[i.childField]?n.length>0?s.push({...t,[i.childField]:n}):i.removeEmptyChild?(t[i.childField]&&delete t[i.childField],s.push({...t})):s.push({...t,[i.childField]:[]}):(t[i.childField]&&delete t[i.childField],s.push({...t})))})),s},e.genCanvasWM=function e(t="请勿外传",n){const{rootContainer:r=document.body,width:o="300px",height:i="150px",textAlign:s="center",textBaseline:a="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=c(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=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}`),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(){const o=document.querySelector(`#${p}`);if(o){const{opacity:i,zIndex:s,display:c,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"!==c||"visible"!==a)&&(r.disconnect(),r=null,g.removeChild(o),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=ae,e.getStrWidthPx=K,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 c=r?["B","kB","MB","GB","TB","PB","EB","ZB","YB"]:["Byte","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];if(!f(i)){const e=c.findIndex((e=>e===i));-1!==e&&(c=c.slice(e))}if(!f(s)){const e=c.findIndex((e=>e===s));-1!==e&&c.splice(e+1)}return me(e,c,{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=>We.test(e),e.isEmail=e=>Oe.test(e),e.isEmpty=b,e.isEqual=function(e,t){return Ve(e,t)},e.isError=e=>"Error"===s(e),e.isFloat=ze,e.isFunction=g,e.isIdNo=e=>{if(!Le.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=ke,e.isIpV4=e=>Pe.test(e),e.isIpV6=e=>Be.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.isNull=d,e.isNullOrUnDef=f,e.isNullish=f,e.isNumber=l,e.isNumerical=e=>ke(e)||ze(e),e.isObject=h,e.isPhone=e=>De.test(e),e.isPlainObject=N,e.isPrimitive=e=>null===e||"object"!=typeof e,e.isRegExp=e=>"RegExp"===s(e),e.isString=c,e.isSymbol=e=>"symbol"==typeof e,e.isUndefined=u,e.isUrl=(e,t=!1)=>(t?Me:Ne).test(e),e.isValidDate=x,e.mapDeep=function(e,t,n="children",r=!1){let o=!1;const i=[],s=(i,c,a,l=0)=>{if(r)for(let r=i.length-1;r>=0&&!o;r--){const u=t(i[r],r,i,e,c,l);if(!1===u){o=!0;break}!0!==u&&(a.push(B(u,[n])),i[r]&&Array.isArray(i[r][n])?(a[a.length-1][n]=[],s(i[r][n],i[r],a[a.length-1][n],l+1)):delete u[n])}else for(let r=0;r<i.length&&!o;r++){const u=t(i[r],r,i,e,c,l);if(!1===u){o=!0;break}!0!==u&&(a.push(B(u,[n])),i[r]&&Array.isArray(i[r][n])?(a[a.length-1][n]=[],s(i[r][n],i[r],a[a.length-1][n],l+1)):delete u[n])}};return s(e,null,i),e=null,i},e.multiply=Ce,e.numberAbbr=me,e.numberToHex=ge,e.objectAssign=k,e.objectEach=P,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 P(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=k,e.objectOmit=B,e.objectPick=function(e,t){const n={};return P(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(Ge(t,n))).map((e=>f(e)?void 0:e[1]))},e.pathJoin=J,e.pathNormalize=X,e.qsParse=Z,e.qsStringify=ee,e.randomNumber=le,e.randomString=(e,t)=>{let n=0,r=ue;c(t)?(n=e,r=t):l(e)?n=e:c(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[le(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=le(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){V(t,(t=>e.classList.remove(t)))},e.replaceVarFromString=function(e,t,n="{",r="}"){return e.replace(new RegExp(Ge(n,r)),(function(e,n){return o(t,n)?t[n]:e}))},e.searchTreeById=function(e,t,n){const{children:r="children",id:o="id"}=n||{},i=(e,t,n)=>e.reduce(((e,s)=>{const c=s[r];return[...e,t?{...s,parentId:t,parent:n}:s,...c&&c.length?i(c,s[o],s):[]]}),[]);return(e=>{let n=e.find((e=>e[o]===t));const{parent:r,parentId:i,...s}=n;let c=[t],a=[s];for(;n&&n.parentId;)c=[n.parentId,...c],a=[n.parent,...a],n=e.find((e=>e[o]===n.parentId));return[c,a]})(i(e))},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=Y,e.smoothScroll=function(e){return new Promise((n=>{const r={el:document,to:0,duration:567,easing:"ease"},{el:o,to:i,duration:s,easing:c}=k(r,e),a=document.documentElement,l=document.body,u=o===window||o===document||o===a||o===l?[a,l]:[o];let d;const f=(()=>{let e=0;return t(u,(t=>{if("scrollTop"in t)return e=t.scrollTop,!1})),e})(),h=i-f,g=function(e){let t;if(p(e))t=L(...e);else{const n=M[e];if(!n)throw new Error(`${e} 缓冲函数未定义`);t=L(...n)}return e=>t(Math.max(0,Math.min(e,1)))}(c),m=()=>{const e=performance.now(),t=(d?e-d:0)/s,r=g(t);var o;d||(d=e),o=f+h*r,u.forEach((e=>{"scrollTop"in e&&(e.scrollTop=o)})),t>=1?n():requestAnimationFrame(m)};m()}))},e.stringAssign=(e,t)=>e.replace(G,((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={"&":"&","<":"<",">":">",'"':"""};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=H,e.strip=function(e,t=15){return+parseFloat(Number(e).toPrecision(t))},e.subtract=(e,t)=>je(e,-t),e.supportCanvas=se,e.throttle=(e,t,n)=>{let r,o=!1,i=0;const s=function(...s){if(o)return;const c=Date.now(),a=()=>{i=c,e.call(this,...s)};if(0===i)return n?a():void(i=c);i+t-c>0?(clearTimeout(r),r=setTimeout((()=>a()),t)):a()};return s.cancel=()=>{clearTimeout(r),o=!0},s},e.tooltipEvent=Ee,e.typeIs=s,e.uniqueNumber=xe,e.uniqueString=(e,t)=>{let n=0,r=de;c(t)?(n=e,r=t):l(e)?n=e:c(e)&&(r=e);let o=ge(xe(),r),i=n-o.length;if(i<=0)return o;for(;i--;)o+=Se(r);return o},e.uniqueSymbol=qe,e.urlDelParams=(e,t)=>{const n=te(e);return t.forEach((e=>delete n.searchParams[e])),ne(n)},e.urlParse=te,e.urlSetParams=re,e.urlStringify=ne,e.wait=function(e=1){return new Promise((t=>setTimeout(t,e)))},e.weAtob=Ie,e.weBtoa=Re}));
|