@gx-design-vue/pro-utils 0.2.0-beta.8 → 0.2.0-beta.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base64/index.d.ts +20 -0
- package/dist/cloneDeep/cloneDeepWith.d.ts +43 -0
- package/dist/cloneDeep/index.d.ts +47 -0
- package/dist/getValueFromObjectByKey/index.d.ts +3 -0
- package/dist/index.d.ts +18 -9
- package/dist/isImg/index.d.ts +2 -0
- package/dist/isNil/index.d.ts +1 -0
- package/dist/isUrl/index.d.ts +6 -0
- package/dist/merge/index.d.ts +45 -2
- package/dist/merge/mergeWith.d.ts +49 -0
- package/dist/merge/useDeepMege.d.ts +43 -0
- package/dist/nanoid/index.d.ts +6 -0
- package/dist/omitUndefined/index.d.ts +2 -5
- package/dist/omitUndefinedAndEmptyArr/index.d.ts +1 -0
- package/dist/pro-utils.js +1134 -0
- package/dist/pro-utils.umd.cjs +13 -0
- package/dist/slots/index.d.ts +67 -8
- package/dist/typings/index.d.ts +17 -16
- package/dist/utils/config.d.ts +1 -2
- package/dist/utils/getSymbols.d.ts +1 -0
- package/dist/utils/getTag.d.ts +8 -0
- package/dist/utils/index.d.ts +145 -22
- package/dist/utils/isNotNil.d.ts +1 -0
- package/dist/utils/isPlainObject.d.ts +43 -0
- package/dist/utils/isPrimitive.d.ts +29 -0
- package/dist/utils/isTypedArray.d.ts +27 -0
- package/dist/utils/isUnsafeProperty.d.ts +11 -0
- package/dist/utils/isValid.d.ts +2 -0
- package/dist/utils/raf.d.ts +5 -0
- package/dist/utils/tags.d.ts +26 -0
- package/dist/utils/validate.d.ts +11 -8
- package/package.json +26 -49
- package/dist/pro-utils.mjs +0 -562
- package/dist/pro-utils.umd.js +0 -1
- package/dist/scroll/raf.d.ts +0 -9
|
@@ -0,0 +1,1134 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Gx Design Pro
|
|
3
|
+
* Version: 0.2.0-beta.80
|
|
4
|
+
* Author: gx12358
|
|
5
|
+
* Copyright (C) 2024 gx12358
|
|
6
|
+
* License: MIT License
|
|
7
|
+
* Description: Gx Design Pro Utils
|
|
8
|
+
* Date Created: 2025-11-27
|
|
9
|
+
* Homepage:
|
|
10
|
+
* Contact: gx12358@gmail.com
|
|
11
|
+
*/
|
|
12
|
+
import { Comment as q, Fragment as v, isVNode as B } from "vue";
|
|
13
|
+
class Ht {
|
|
14
|
+
constructor() {
|
|
15
|
+
this._keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
|
16
|
+
}
|
|
17
|
+
_utf8_encode(e) {
|
|
18
|
+
e = e.replace(/\r\n/g, `
|
|
19
|
+
`);
|
|
20
|
+
let n = "";
|
|
21
|
+
for (let r = 0; r < e.length; r++) {
|
|
22
|
+
const i = e.charCodeAt(r);
|
|
23
|
+
i < 128 ? n += String.fromCharCode(i) : i > 127 && i < 2048 ? (n += String.fromCharCode(i >> 6 | 192), n += String.fromCharCode(i & 63 | 128)) : (n += String.fromCharCode(i >> 12 | 224), n += String.fromCharCode(i >> 6 & 63 | 128), n += String.fromCharCode(i & 63 | 128));
|
|
24
|
+
}
|
|
25
|
+
return n;
|
|
26
|
+
}
|
|
27
|
+
_utf8_decode(e) {
|
|
28
|
+
let n = "", r = 0, i = 0, s = 0, o = 0;
|
|
29
|
+
for (; r < e.length; )
|
|
30
|
+
i = e.charCodeAt(r), i < 128 ? (n += String.fromCharCode(i), r++) : i > 191 && i < 224 ? (s = e.charCodeAt(r + 1), n += String.fromCharCode((i & 31) << 6 | s & 63), r += 2) : (s = e.charCodeAt(r + 1), o = e.charCodeAt(r + 2), n += String.fromCharCode((i & 15) << 12 | (s & 63) << 6 | o & 63), r += 3);
|
|
31
|
+
return n;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @Author gx12358
|
|
35
|
+
* @DateTime 2024/12/21
|
|
36
|
+
* @lastTime 2024/12/21
|
|
37
|
+
* @description 加密方法
|
|
38
|
+
*/
|
|
39
|
+
encode(e) {
|
|
40
|
+
let n = "", r, i, s, o, c, f, u, a = 0;
|
|
41
|
+
for (e = this._utf8_encode(e); a < e.length; )
|
|
42
|
+
r = e.charCodeAt(a++), i = e.charCodeAt(a++), s = e.charCodeAt(a++), o = r >> 2, c = (r & 3) << 4 | i >> 4, f = (i & 15) << 2 | s >> 6, u = s & 63, Number.isNaN(i) ? f = u = 64 : Number.isNaN(s) && (u = 64), n = n + this._keyStr.charAt(o) + this._keyStr.charAt(c) + this._keyStr.charAt(f) + this._keyStr.charAt(u);
|
|
43
|
+
return n;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* @Author gx12358
|
|
47
|
+
* @DateTime 2024/12/21
|
|
48
|
+
* @lastTime 2024/12/21
|
|
49
|
+
* @description 解密
|
|
50
|
+
*/
|
|
51
|
+
decode(e) {
|
|
52
|
+
let n = "", r, i, s, o, c, f, u, a = 0;
|
|
53
|
+
for (e = e.replace(/[^A-Z0-9+/=]/gi, ""); a < e.length; )
|
|
54
|
+
o = this._keyStr.indexOf(e.charAt(a++)), c = this._keyStr.indexOf(e.charAt(a++)), f = this._keyStr.indexOf(e.charAt(a++)), u = this._keyStr.indexOf(e.charAt(a++)), r = o << 2 | c >> 4, i = (c & 15) << 4 | f >> 2, s = (f & 3) << 6 | u, n = n + String.fromCharCode(r), f !== 64 && (n = n + String.fromCharCode(i)), u !== 64 && (n = n + String.fromCharCode(s));
|
|
55
|
+
return n = this._utf8_decode(n), n;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function J(t, e) {
|
|
59
|
+
return Object.prototype.toString.call(t) === `[object ${e}]`;
|
|
60
|
+
}
|
|
61
|
+
function D(t) {
|
|
62
|
+
return typeof t == "boolean";
|
|
63
|
+
}
|
|
64
|
+
function h(t) {
|
|
65
|
+
return typeof t == "number";
|
|
66
|
+
}
|
|
67
|
+
function p(t) {
|
|
68
|
+
return typeof Array.isArray > "u" ? Object.prototype.toString.call(t) === "[object Array]" : Array.isArray(t);
|
|
69
|
+
}
|
|
70
|
+
function m(t) {
|
|
71
|
+
return t !== null && J(t, "Object");
|
|
72
|
+
}
|
|
73
|
+
function Z(t) {
|
|
74
|
+
return typeof t == "string" || t instanceof String;
|
|
75
|
+
}
|
|
76
|
+
function qt(t) {
|
|
77
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Function]";
|
|
78
|
+
}
|
|
79
|
+
function Jt(t) {
|
|
80
|
+
if (typeof t != "string")
|
|
81
|
+
return !1;
|
|
82
|
+
try {
|
|
83
|
+
const e = JSON.parse(t);
|
|
84
|
+
return typeof e == "object" && e !== null;
|
|
85
|
+
} catch {
|
|
86
|
+
return !1;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function Zt() {
|
|
90
|
+
const t = navigator.userAgent || navigator.vendor;
|
|
91
|
+
return !!(/iPhone/.test(t) || /Android/.test(t) && /Mobile/.test(t) || /Windows Phone/.test(t) || /Mobile/.test(t) && !X());
|
|
92
|
+
}
|
|
93
|
+
function X() {
|
|
94
|
+
const t = navigator.userAgent || navigator.vendor;
|
|
95
|
+
return !!(/iPad/.test(t) || /Macintosh/.test(t) && "ontouchend" in document || /Android/.test(t) && !/Mobile/.test(t));
|
|
96
|
+
}
|
|
97
|
+
function Y(...t) {
|
|
98
|
+
const e = [];
|
|
99
|
+
for (let n = 0; n < t.length; n++) {
|
|
100
|
+
const r = t[n];
|
|
101
|
+
if (r) {
|
|
102
|
+
if (Z(r))
|
|
103
|
+
e.push(r);
|
|
104
|
+
else if (p(r))
|
|
105
|
+
for (let i = 0; i < r.length; i++) {
|
|
106
|
+
const s = Y(r[i]);
|
|
107
|
+
s && e.push(s);
|
|
108
|
+
}
|
|
109
|
+
else if (m(r))
|
|
110
|
+
for (const i in r)
|
|
111
|
+
r[i] && e.push(i);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return e.filter((n) => n).join(" ");
|
|
115
|
+
}
|
|
116
|
+
function Xt(t, e) {
|
|
117
|
+
if (typeof e != "string" && !Array.isArray(e))
|
|
118
|
+
return;
|
|
119
|
+
const n = Array.isArray(e) ? e : e.split(":");
|
|
120
|
+
let r = t;
|
|
121
|
+
for (let i = 0; i < n.length; i++)
|
|
122
|
+
if (r && Object.prototype.hasOwnProperty.call(r, n[i]))
|
|
123
|
+
r = r[n[i]];
|
|
124
|
+
else
|
|
125
|
+
return;
|
|
126
|
+
return r;
|
|
127
|
+
}
|
|
128
|
+
const x = typeof window > "u";
|
|
129
|
+
function G(t) {
|
|
130
|
+
return t.replace(/[-_](.)/g, (e, n) => n.toUpperCase());
|
|
131
|
+
}
|
|
132
|
+
const O = function(t, e) {
|
|
133
|
+
if (x || !t || !e)
|
|
134
|
+
return "";
|
|
135
|
+
e = G(e), e === "float" && (e = "cssFloat");
|
|
136
|
+
try {
|
|
137
|
+
const n = t.style[e];
|
|
138
|
+
if (n)
|
|
139
|
+
return n;
|
|
140
|
+
const r = document?.defaultView?.getComputedStyle(t, "");
|
|
141
|
+
return r ? r[e] : "";
|
|
142
|
+
} catch {
|
|
143
|
+
return t.style[e];
|
|
144
|
+
}
|
|
145
|
+
}, Q = (t, e) => x ? void 0 : (e == null ? O(t, "overflow") : e ? O(t, "overflow-y") : O(t, "overflow-x")).match(/(scroll|auto|overlay)/), Yt = (t, e) => {
|
|
146
|
+
if (x)
|
|
147
|
+
return;
|
|
148
|
+
let n = t;
|
|
149
|
+
for (; n; ) {
|
|
150
|
+
if ([window, document, document.documentElement].includes(n))
|
|
151
|
+
return window;
|
|
152
|
+
if (Q(n, e))
|
|
153
|
+
return n;
|
|
154
|
+
n = n.parentNode;
|
|
155
|
+
}
|
|
156
|
+
return n;
|
|
157
|
+
}, Gt = (t, e) => {
|
|
158
|
+
if (x || !t || !e)
|
|
159
|
+
return !1;
|
|
160
|
+
const n = t.getBoundingClientRect();
|
|
161
|
+
let r;
|
|
162
|
+
return [window, document, document.documentElement, null, void 0].includes(e) ? r = {
|
|
163
|
+
top: 0,
|
|
164
|
+
right: window.innerWidth,
|
|
165
|
+
bottom: window.innerHeight,
|
|
166
|
+
left: 0
|
|
167
|
+
} : r = e.getBoundingClientRect(), n.top < r.bottom && n.bottom > r.top && n.right > r.left && n.left < r.right;
|
|
168
|
+
};
|
|
169
|
+
function I(t) {
|
|
170
|
+
return t != null && t === t.window;
|
|
171
|
+
}
|
|
172
|
+
function K(t, e) {
|
|
173
|
+
if (typeof window > "u")
|
|
174
|
+
return 0;
|
|
175
|
+
const n = e ? "scrollTop" : "scrollLeft";
|
|
176
|
+
let r = 0;
|
|
177
|
+
return I(t) ? r = t[e ? "pageYOffset" : "pageXOffset"] : t instanceof Document ? r = t.documentElement[n] : t && (r = t[n]), t && !I(t) && typeof r != "number" && (r = (t.ownerDocument || t).documentElement?.[n]), r;
|
|
178
|
+
}
|
|
179
|
+
function k(t) {
|
|
180
|
+
return Object.getOwnPropertySymbols(t).filter((e) => Object.prototype.propertyIsEnumerable.call(t, e));
|
|
181
|
+
}
|
|
182
|
+
function C(t) {
|
|
183
|
+
return t == null ? t === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(t);
|
|
184
|
+
}
|
|
185
|
+
function T(t) {
|
|
186
|
+
return t == null || typeof t != "object" && typeof t != "function";
|
|
187
|
+
}
|
|
188
|
+
function tt(t) {
|
|
189
|
+
return ArrayBuffer.isView(t) && !(t instanceof DataView);
|
|
190
|
+
}
|
|
191
|
+
const et = "[object RegExp]", rt = "[object String]", nt = "[object Number]", it = "[object Boolean]", ot = "[object Arguments]", st = "[object Symbol]", ct = "[object Date]", ft = "[object Map]", ut = "[object Set]", at = "[object Array]", lt = "[object ArrayBuffer]", dt = "[object Object]", pt = "[object DataView]", gt = "[object Uint8Array]", yt = "[object Uint8ClampedArray]", ht = "[object Uint16Array]", mt = "[object Uint32Array]", wt = "[object Int8Array]", At = "[object Int16Array]", bt = "[object Int32Array]", St = "[object Float32Array]", xt = "[object Float64Array]";
|
|
192
|
+
function Qt(t, e) {
|
|
193
|
+
return y(t, void 0, t, /* @__PURE__ */ new Map(), e);
|
|
194
|
+
}
|
|
195
|
+
function y(t, e, n, r = /* @__PURE__ */ new Map(), i = void 0) {
|
|
196
|
+
const s = i?.(t, e, n, r);
|
|
197
|
+
if (s !== void 0)
|
|
198
|
+
return s;
|
|
199
|
+
if (T(t))
|
|
200
|
+
return t;
|
|
201
|
+
if (r.has(t))
|
|
202
|
+
return r.get(t);
|
|
203
|
+
if (Array.isArray(t)) {
|
|
204
|
+
const o = Array.from({ length: t.length });
|
|
205
|
+
r.set(t, o);
|
|
206
|
+
for (let c = 0; c < t.length; c++)
|
|
207
|
+
o[c] = y(t[c], c, n, r, i);
|
|
208
|
+
return Object.hasOwn(t, "index") && (o.index = t.index), Object.hasOwn(t, "input") && (o.input = t.input), o;
|
|
209
|
+
}
|
|
210
|
+
if (t instanceof Date)
|
|
211
|
+
return new Date(t.getTime());
|
|
212
|
+
if (t instanceof RegExp) {
|
|
213
|
+
const o = new RegExp(t.source, t.flags);
|
|
214
|
+
return o.lastIndex = t.lastIndex, o;
|
|
215
|
+
}
|
|
216
|
+
if (t instanceof Map) {
|
|
217
|
+
const o = /* @__PURE__ */ new Map();
|
|
218
|
+
r.set(t, o);
|
|
219
|
+
for (const [c, f] of t)
|
|
220
|
+
o.set(c, y(f, c, n, r, i));
|
|
221
|
+
return o;
|
|
222
|
+
}
|
|
223
|
+
if (t instanceof Set) {
|
|
224
|
+
const o = /* @__PURE__ */ new Set();
|
|
225
|
+
r.set(t, o);
|
|
226
|
+
for (const c of t)
|
|
227
|
+
o.add(y(c, void 0, n, r, i));
|
|
228
|
+
return o;
|
|
229
|
+
}
|
|
230
|
+
if (typeof Buffer < "u" && Buffer.isBuffer(t))
|
|
231
|
+
return t.subarray();
|
|
232
|
+
if (tt(t)) {
|
|
233
|
+
const o = new (Object.getPrototypeOf(t)).constructor(t.length);
|
|
234
|
+
r.set(t, o);
|
|
235
|
+
for (let c = 0; c < t.length; c++)
|
|
236
|
+
o[c] = y(t[c], c, n, r, i);
|
|
237
|
+
return o;
|
|
238
|
+
}
|
|
239
|
+
if (t instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && t instanceof SharedArrayBuffer)
|
|
240
|
+
return t.slice(0);
|
|
241
|
+
if (t instanceof DataView) {
|
|
242
|
+
const o = new DataView(t.buffer.slice(0), t.byteOffset, t.byteLength);
|
|
243
|
+
return r.set(t, o), d(o, t, n, r, i), o;
|
|
244
|
+
}
|
|
245
|
+
if (typeof File < "u" && t instanceof File) {
|
|
246
|
+
const o = new File([t], t.name, {
|
|
247
|
+
type: t.type
|
|
248
|
+
});
|
|
249
|
+
return r.set(t, o), d(o, t, n, r, i), o;
|
|
250
|
+
}
|
|
251
|
+
if (typeof Blob < "u" && t instanceof Blob) {
|
|
252
|
+
const o = new Blob([t], { type: t.type });
|
|
253
|
+
return r.set(t, o), d(o, t, n, r, i), o;
|
|
254
|
+
}
|
|
255
|
+
if (t instanceof Error) {
|
|
256
|
+
const o = new t.constructor();
|
|
257
|
+
return r.set(t, o), o.message = t.message, o.name = t.name, o.stack = t.stack, o.cause = t.cause, d(o, t, n, r, i), o;
|
|
258
|
+
}
|
|
259
|
+
if (typeof t == "boolean") {
|
|
260
|
+
const o = !!t.valueOf();
|
|
261
|
+
return r.set(t, o), d(o, t, n, r, i), o;
|
|
262
|
+
}
|
|
263
|
+
if (typeof t == "number") {
|
|
264
|
+
const o = Number(t.valueOf());
|
|
265
|
+
return r.set(t, o), d(o, t, n, r, i), o;
|
|
266
|
+
}
|
|
267
|
+
if (typeof t == "string") {
|
|
268
|
+
const o = String(t.valueOf());
|
|
269
|
+
return r.set(t, o), d(o, t, n, r, i), o;
|
|
270
|
+
}
|
|
271
|
+
if (typeof t == "object" && Ot(t)) {
|
|
272
|
+
const o = Object.create(Object.getPrototypeOf(t));
|
|
273
|
+
return r.set(t, o), d(o, t, n, r, i), o;
|
|
274
|
+
}
|
|
275
|
+
return t;
|
|
276
|
+
}
|
|
277
|
+
function d(t, e, n = t, r, i) {
|
|
278
|
+
const s = [...Object.keys(e), ...k(e)];
|
|
279
|
+
for (let o = 0; o < s.length; o++) {
|
|
280
|
+
const c = s[o], f = Object.getOwnPropertyDescriptor(t, c);
|
|
281
|
+
(f == null || f.writable) && (t[c] = y(e[c], c, n, r, i));
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
function Ot(t) {
|
|
285
|
+
switch (C(t)) {
|
|
286
|
+
case ot:
|
|
287
|
+
case at:
|
|
288
|
+
case lt:
|
|
289
|
+
case pt:
|
|
290
|
+
case it:
|
|
291
|
+
case ct:
|
|
292
|
+
case St:
|
|
293
|
+
case xt:
|
|
294
|
+
case wt:
|
|
295
|
+
case At:
|
|
296
|
+
case bt:
|
|
297
|
+
case ft:
|
|
298
|
+
case nt:
|
|
299
|
+
case dt:
|
|
300
|
+
case et:
|
|
301
|
+
case ut:
|
|
302
|
+
case rt:
|
|
303
|
+
case st:
|
|
304
|
+
case gt:
|
|
305
|
+
case yt:
|
|
306
|
+
case ht:
|
|
307
|
+
case mt:
|
|
308
|
+
return !0;
|
|
309
|
+
default:
|
|
310
|
+
return !1;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
function w(t) {
|
|
314
|
+
return y(t, void 0, t, /* @__PURE__ */ new Map(), void 0);
|
|
315
|
+
}
|
|
316
|
+
const S = {
|
|
317
|
+
videoAllowType: [
|
|
318
|
+
"mp4",
|
|
319
|
+
"webm",
|
|
320
|
+
"ogg"
|
|
321
|
+
],
|
|
322
|
+
audioAllowType: [
|
|
323
|
+
"mp3",
|
|
324
|
+
// 最常见的音频格式,兼容性最广
|
|
325
|
+
"ogg",
|
|
326
|
+
// Ogg 容器,通常使用 Vorbis 或 Opus 编码
|
|
327
|
+
"wav",
|
|
328
|
+
// 无损音频格式,支持 PCM 编码
|
|
329
|
+
"aac",
|
|
330
|
+
// 广泛支持,特别是在移动设备和现代浏览器中
|
|
331
|
+
"m4a",
|
|
332
|
+
// 通常是 AAC 或 ALAC 编码,现代浏览器支持良好
|
|
333
|
+
"webm"
|
|
334
|
+
// WebM 容器,支持 Opus 编码,主要用于现代浏览器
|
|
335
|
+
],
|
|
336
|
+
imageType: [
|
|
337
|
+
// 位图格式 (Raster Graphics)
|
|
338
|
+
"jpeg",
|
|
339
|
+
"jpg",
|
|
340
|
+
"png",
|
|
341
|
+
"gif",
|
|
342
|
+
"bmp",
|
|
343
|
+
"tiff",
|
|
344
|
+
"tif",
|
|
345
|
+
"webp",
|
|
346
|
+
"heic",
|
|
347
|
+
"heif",
|
|
348
|
+
// 矢量格式 (Vector Graphics)
|
|
349
|
+
"svg",
|
|
350
|
+
// 特定场景格式
|
|
351
|
+
"ico",
|
|
352
|
+
"raw",
|
|
353
|
+
"cr2",
|
|
354
|
+
"nef",
|
|
355
|
+
"arw",
|
|
356
|
+
"dng",
|
|
357
|
+
"psd",
|
|
358
|
+
"eps"
|
|
359
|
+
],
|
|
360
|
+
videoType: [
|
|
361
|
+
// 常见视频格式
|
|
362
|
+
"mp4",
|
|
363
|
+
"avi",
|
|
364
|
+
"mov",
|
|
365
|
+
"wmv",
|
|
366
|
+
"mkv",
|
|
367
|
+
"flv",
|
|
368
|
+
"webm",
|
|
369
|
+
"mpeg",
|
|
370
|
+
"mpg",
|
|
371
|
+
"3gp",
|
|
372
|
+
"ogv",
|
|
373
|
+
// 专业或特定用途格式
|
|
374
|
+
"mxf",
|
|
375
|
+
"vob",
|
|
376
|
+
"rm",
|
|
377
|
+
"rmvb",
|
|
378
|
+
"ts",
|
|
379
|
+
"mts",
|
|
380
|
+
"m2ts",
|
|
381
|
+
// 视频编解码器封装格式
|
|
382
|
+
"divx",
|
|
383
|
+
"xvid"
|
|
384
|
+
],
|
|
385
|
+
audioType: [
|
|
386
|
+
// 常见音频格式
|
|
387
|
+
"mp3",
|
|
388
|
+
"wav",
|
|
389
|
+
"aac",
|
|
390
|
+
"flac",
|
|
391
|
+
"ogg",
|
|
392
|
+
"wma",
|
|
393
|
+
"m4a",
|
|
394
|
+
"alac",
|
|
395
|
+
"opus",
|
|
396
|
+
"amr",
|
|
397
|
+
// 专业或特定用途格式
|
|
398
|
+
"aiff",
|
|
399
|
+
"au",
|
|
400
|
+
"pcm",
|
|
401
|
+
"ape"
|
|
402
|
+
]
|
|
403
|
+
}, jt = (t) => t != null && t !== "";
|
|
404
|
+
let W = (t) => setTimeout(t, 16), z = (t) => clearTimeout(t);
|
|
405
|
+
typeof window < "u" && "requestAnimationFrame" in window && (W = (t) => window.requestAnimationFrame(t), z = (t) => window.cancelAnimationFrame(t));
|
|
406
|
+
let P = 0;
|
|
407
|
+
const N = /* @__PURE__ */ new Map();
|
|
408
|
+
function V(t) {
|
|
409
|
+
N.delete(t);
|
|
410
|
+
}
|
|
411
|
+
function U(t, e = 1) {
|
|
412
|
+
P += 1;
|
|
413
|
+
const n = P;
|
|
414
|
+
function r(i) {
|
|
415
|
+
if (i === 0)
|
|
416
|
+
V(n), t();
|
|
417
|
+
else {
|
|
418
|
+
const s = W(() => {
|
|
419
|
+
r(i - 1);
|
|
420
|
+
});
|
|
421
|
+
N.set(n, s);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
return r(e), n;
|
|
425
|
+
}
|
|
426
|
+
U.cancel = (t) => {
|
|
427
|
+
const e = N.get(t);
|
|
428
|
+
return V(e), z(e);
|
|
429
|
+
};
|
|
430
|
+
function Kt(t) {
|
|
431
|
+
return t != null;
|
|
432
|
+
}
|
|
433
|
+
function A(t) {
|
|
434
|
+
if (!t || typeof t != "object")
|
|
435
|
+
return !1;
|
|
436
|
+
const e = Object.getPrototypeOf(t);
|
|
437
|
+
return e === null || e === Object.prototype || Object.getPrototypeOf(e) === null ? Object.prototype.toString.call(t) === "[object Object]" : !1;
|
|
438
|
+
}
|
|
439
|
+
const kt = ({ suffixCls: t, customizePrefixCls: e, isPor: n, className: r }) => {
|
|
440
|
+
const i = r || (n ? "gx-pro" : "gx");
|
|
441
|
+
return e || (t ? `${i}-${t}` : i);
|
|
442
|
+
}, Ct = (t, e) => t ? p(t) ? t.join("-") : t.toString() : `${e || 0}`;
|
|
443
|
+
function Tt(t, { align: e, showIndex: n }) {
|
|
444
|
+
const r = w(t);
|
|
445
|
+
if (n && t.length && t.every((i) => i.dataIndex !== "sortIndex")) {
|
|
446
|
+
const i = t[0];
|
|
447
|
+
r.unshift({
|
|
448
|
+
title: "序号",
|
|
449
|
+
align: e,
|
|
450
|
+
fixed: i.fixed,
|
|
451
|
+
width: 60,
|
|
452
|
+
uuid: Rt().uuid(15),
|
|
453
|
+
dataIndex: "sortIndex",
|
|
454
|
+
key: "sortIndex"
|
|
455
|
+
});
|
|
456
|
+
} else
|
|
457
|
+
r.filter((i) => i.dataIndex !== "sortIndex");
|
|
458
|
+
return r;
|
|
459
|
+
}
|
|
460
|
+
function te(t, ...e) {
|
|
461
|
+
return typeof t == "function" ? t(...e) : t;
|
|
462
|
+
}
|
|
463
|
+
function ee(t) {
|
|
464
|
+
return JSON.parse(JSON.stringify(t));
|
|
465
|
+
}
|
|
466
|
+
function re(t, e) {
|
|
467
|
+
if (m(t)) {
|
|
468
|
+
const { pageSize: n = 10, total: r = 0 } = t;
|
|
469
|
+
let { current: i = 1 } = t;
|
|
470
|
+
return r - e <= n * (i - 1) && (i = i - 1), i === 0 ? 1 : i;
|
|
471
|
+
}
|
|
472
|
+
return 1;
|
|
473
|
+
}
|
|
474
|
+
function ne(t = [], e, n = "children") {
|
|
475
|
+
function r(i, s) {
|
|
476
|
+
return s.map((o, c) => {
|
|
477
|
+
const f = `${i}-${c + 1}`;
|
|
478
|
+
return o[n] && (o[n] = r(f, o[n])), o.sortIndex = f, o;
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
return w(t).map((i, s) => {
|
|
482
|
+
const o = m(e) && e.current || 1, c = m(e) && e.pageSize || 10, f = `${(o - 1) * c + (s + 1)}`;
|
|
483
|
+
return i[n] && (i[n] = r(`${f}`, i[n])), i.sortIndex = f, i;
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
function ie(t, e) {
|
|
487
|
+
return p(t) ? t?.filter((n, r) => {
|
|
488
|
+
if (h(e))
|
|
489
|
+
return r <= e - 1;
|
|
490
|
+
if (p(e) && e.length === 2) {
|
|
491
|
+
const i = e[0] - 1, s = e[1] ? e[1] - 1 : t.length - 1;
|
|
492
|
+
return r <= s && r >= i;
|
|
493
|
+
} else if (p(e) && e.length === 1) {
|
|
494
|
+
const i = e[0] - 1, s = t.length - 1;
|
|
495
|
+
return r <= s && r >= i;
|
|
496
|
+
}
|
|
497
|
+
return !0;
|
|
498
|
+
}) : [];
|
|
499
|
+
}
|
|
500
|
+
function It(t, e, n, r = 0) {
|
|
501
|
+
const i = h(r) && (r === 0 || r === 1) ? r : 0, s = t[n], o = e[n];
|
|
502
|
+
let c = 0;
|
|
503
|
+
return s < o ? c = i === 0 ? -1 : 0 : s > o && (c = i === 0 ? 0 : -1), c;
|
|
504
|
+
}
|
|
505
|
+
function Ut(t, e, n, r = 0) {
|
|
506
|
+
const i = h(r) && (r === 0 || r === 1) ? r : 0, s = new Date(t[n]), o = new Date(e[n]);
|
|
507
|
+
let c = 0;
|
|
508
|
+
return s < o ? c = i === 0 ? -1 : 0 : s > o && (c = i === 0 ? 0 : -1), c;
|
|
509
|
+
}
|
|
510
|
+
function oe(t, e, n = 0) {
|
|
511
|
+
return t.sort((r, i) => It(r, i, e, n));
|
|
512
|
+
}
|
|
513
|
+
function se(t, e, n = 0) {
|
|
514
|
+
return t.sort((r, i) => Ut(r, i, e, n));
|
|
515
|
+
}
|
|
516
|
+
function ce(t) {
|
|
517
|
+
let e = w(t);
|
|
518
|
+
const n = new Set(e);
|
|
519
|
+
return e = Array.from(n), e;
|
|
520
|
+
}
|
|
521
|
+
function fe(t, e) {
|
|
522
|
+
const n = ["null", "undefined"];
|
|
523
|
+
let r = !0;
|
|
524
|
+
return t === 0 ? r = !0 : n.includes(t) ? r = !1 : t || (r = !1), r ? {
|
|
525
|
+
value: t,
|
|
526
|
+
success: r
|
|
527
|
+
} : {
|
|
528
|
+
value: e === "" ? e : e || "-",
|
|
529
|
+
success: r
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
function ue(t) {
|
|
533
|
+
let e = "";
|
|
534
|
+
if (t > -1) {
|
|
535
|
+
const n = Math.floor(t / 3600), r = Math.floor(t / 60) % 60, i = Number.parseInt(String(t % 60));
|
|
536
|
+
n < 10 ? e = "0" + n + ":" : e = n + ":", r < 10 && (e += "0"), e += r + ":", i < 10 && (e += "0"), e += i;
|
|
537
|
+
}
|
|
538
|
+
return e.split(":")[0] === "00" ? `${e.split(":")[1]}:${e.split(":")[2]}` : e;
|
|
539
|
+
}
|
|
540
|
+
function Rt() {
|
|
541
|
+
const t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
|
|
542
|
+
return {
|
|
543
|
+
uuid(e, n) {
|
|
544
|
+
const r = t, i = [], s = n || r.length;
|
|
545
|
+
let o, c;
|
|
546
|
+
if (e)
|
|
547
|
+
for (o = 0; o < e; o += 1)
|
|
548
|
+
i[o] = r[Number.parseInt(String(Math.random() * s))];
|
|
549
|
+
else
|
|
550
|
+
for (i[8] = "-", i[13] = "-", i[18] = "-", i[23] = "-", i[14] = "4", o = 0; o < 36; o += 1)
|
|
551
|
+
i[o] || (c = Math.random() * 16, i[o] = r[o === 19 ? c && 3 || 8 : c]);
|
|
552
|
+
return i.join("");
|
|
553
|
+
},
|
|
554
|
+
uuidFast() {
|
|
555
|
+
const e = t, n = Array.from({ length: 36 });
|
|
556
|
+
let r = 0, i, s;
|
|
557
|
+
for (s = 0; s < 36; s += 1)
|
|
558
|
+
s === 8 || s === 13 || s === 18 || s === 23 ? n[s] = "-" : s === 14 ? n[s] = "4" : (r <= 2 && (r = 33554432 + Math.random() * 16777216 || 0), i = r && 15, r = r > 4, n[s] = e[s === 19 ? i && 3 || 8 : i]);
|
|
559
|
+
return n.join("");
|
|
560
|
+
},
|
|
561
|
+
uuidString() {
|
|
562
|
+
return this.uuidFast().replace(new RegExp("-", "g"), "");
|
|
563
|
+
},
|
|
564
|
+
uuidCompact() {
|
|
565
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => {
|
|
566
|
+
const n = Math.random() * 16 || 0;
|
|
567
|
+
return (e === "x" ? n : n && 3 || 8).toString(16);
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
function Et(t, e) {
|
|
573
|
+
if (!Array.isArray(t) || t.length === 0)
|
|
574
|
+
return 0;
|
|
575
|
+
const n = e || "children";
|
|
576
|
+
return Math.max(...t.map((r) => {
|
|
577
|
+
const i = r[n];
|
|
578
|
+
return 1 + (i ? Et(i, n) : 0);
|
|
579
|
+
}));
|
|
580
|
+
}
|
|
581
|
+
function Bt(t, e = "children") {
|
|
582
|
+
let n = [];
|
|
583
|
+
return t.forEach((r) => {
|
|
584
|
+
n.push(r), p(r[e]) && r[e].length > 0 && (n = n.concat(Bt(r[e], e)));
|
|
585
|
+
}), n;
|
|
586
|
+
}
|
|
587
|
+
function ae(t, e) {
|
|
588
|
+
if (!t || !p(t) || t?.length === 0)
|
|
589
|
+
return [];
|
|
590
|
+
const { id: n = "id", parentId: r = "parentId", children: i = "children", emptyChildren: s = !0 } = e || {}, o = e?.rootId ?? 0, c = w(t);
|
|
591
|
+
return c.map((f) => (!s && f[i] && f[i]?.length === 0 && delete f[i], f)).filter((f) => {
|
|
592
|
+
const u = c.filter((a) => f[n] === a[r]);
|
|
593
|
+
return u.length > 0 ? f[i] = u : s && (f[i] = []), o === !1 ? !0 : f[r] === o;
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
function Dt(t, e) {
|
|
597
|
+
return t.map((n) => {
|
|
598
|
+
const r = { ...n };
|
|
599
|
+
return r.children && (r.children = Dt(r.children, e)), e(r) || r.children && r.children.length > 0 ? r : null;
|
|
600
|
+
}).filter(Boolean);
|
|
601
|
+
}
|
|
602
|
+
function le(t, e, n) {
|
|
603
|
+
const { value: r, children: i } = n || {
|
|
604
|
+
value: "value",
|
|
605
|
+
children: "children"
|
|
606
|
+
};
|
|
607
|
+
let s = [];
|
|
608
|
+
function o(c, f) {
|
|
609
|
+
if (c[r] === e)
|
|
610
|
+
return s = [...f, c[r]], !0;
|
|
611
|
+
if (c[i]) {
|
|
612
|
+
for (const u of c[i])
|
|
613
|
+
if (o(u, [...f, c[r]]))
|
|
614
|
+
return !0;
|
|
615
|
+
}
|
|
616
|
+
return !1;
|
|
617
|
+
}
|
|
618
|
+
for (const c of t)
|
|
619
|
+
if (o(c, []))
|
|
620
|
+
break;
|
|
621
|
+
return s;
|
|
622
|
+
}
|
|
623
|
+
function de(t) {
|
|
624
|
+
return t && p(t) ? t[t.length - 1] : null;
|
|
625
|
+
}
|
|
626
|
+
function Nt(t, e, n) {
|
|
627
|
+
const r = n?.value || "id", i = n?.children || "children";
|
|
628
|
+
for (const s of t) {
|
|
629
|
+
if (s[r] === e)
|
|
630
|
+
return s;
|
|
631
|
+
const o = s[i];
|
|
632
|
+
if (o) {
|
|
633
|
+
const c = Nt(o, e, n);
|
|
634
|
+
if (c)
|
|
635
|
+
return c;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
function pe(t) {
|
|
640
|
+
return URL.createObjectURL(t);
|
|
641
|
+
}
|
|
642
|
+
function ge(t) {
|
|
643
|
+
return new Promise((e, n) => {
|
|
644
|
+
const r = new FileReader();
|
|
645
|
+
r.readAsDataURL(t), r.onload = () => e(r.result), r.onerror = (i) => n(i);
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
function ye(t) {
|
|
649
|
+
const e = t.split(","), n = e[0].match(/:(.*?);/)[1], r = atob(e[1]);
|
|
650
|
+
let i = r.length;
|
|
651
|
+
const s = new Uint8Array(i);
|
|
652
|
+
for (; i--; )
|
|
653
|
+
s[i] = r.charCodeAt(i);
|
|
654
|
+
return new Blob([s], { type: n });
|
|
655
|
+
}
|
|
656
|
+
function he(t, e) {
|
|
657
|
+
const n = t.split(","), r = n[0].match(/:(.*?);/)[1], i = atob(n[1]);
|
|
658
|
+
let s = i.length;
|
|
659
|
+
const o = new Uint8Array(s);
|
|
660
|
+
for (; s--; )
|
|
661
|
+
o[s] = i.charCodeAt(s);
|
|
662
|
+
return new File([o], e, { type: r });
|
|
663
|
+
}
|
|
664
|
+
function me(t, e, n) {
|
|
665
|
+
return new window.File([t], e, { type: n });
|
|
666
|
+
}
|
|
667
|
+
function Ft(t) {
|
|
668
|
+
if (!t || typeof t != "string")
|
|
669
|
+
return "";
|
|
670
|
+
const e = t.indexOf("?");
|
|
671
|
+
return e > 0 ? `${t.substring(0, e)}` : t;
|
|
672
|
+
}
|
|
673
|
+
function R(t) {
|
|
674
|
+
if (!t || typeof t != "string")
|
|
675
|
+
return "";
|
|
676
|
+
const e = Ft(t), n = e.lastIndexOf(".");
|
|
677
|
+
return n > 0 && `${e?.substring?.(n)?.split("?")?.[0]}`?.split(".")?.[1] || "";
|
|
678
|
+
}
|
|
679
|
+
function b(t, e) {
|
|
680
|
+
if (e)
|
|
681
|
+
return e;
|
|
682
|
+
if (!t || t === "data:")
|
|
683
|
+
return "4";
|
|
684
|
+
let n = "4";
|
|
685
|
+
return F(t) ? t.includes("data:image/") ? n = "png" : t.includes("data:video/") ? n = "mp4" : t.includes("data:audio/") && (n = "mp3") : t instanceof Blob ? (t = String(t), t.includes("image") ? n = "png" : t.includes("video") ? n = "mp4" : t.includes("audio") && (n = "mp3")) : n = R(t).toLowerCase(), S.imageType.includes(n) ? "1" : S.videoType.includes(n) ? "3" : S.audioType.includes(n) ? "2" : "4";
|
|
686
|
+
}
|
|
687
|
+
function Pt(t) {
|
|
688
|
+
const { url: e = "", fileType: n = "1" } = t || {};
|
|
689
|
+
let r = "", i = { play: !1, height: 0, size: 0, width: 0, duration: 0 };
|
|
690
|
+
function s() {
|
|
691
|
+
i = { play: !1, height: 0, size: 0, width: 0, duration: 0 };
|
|
692
|
+
}
|
|
693
|
+
return e instanceof File ? r = URL.createObjectURL(e) : F(e) ? r = e : e instanceof Blob ? r = URL.createObjectURL(e) : (e.includes("https") || e.includes("http")) && (r = e), new Promise((o) => {
|
|
694
|
+
let c;
|
|
695
|
+
if (n === "4") {
|
|
696
|
+
o(i);
|
|
697
|
+
return;
|
|
698
|
+
}
|
|
699
|
+
n === "1" ? (c = document.createElement("img"), c.src = r) : n === "2" ? (c = document.createElement("audio"), c.src = r) : n === "3" && (c = document.createElement("video"), c.src = r), n === "1" ? c.onload = function() {
|
|
700
|
+
s(), i.play = !0, i.width = c.width || 0, i.height = c.height || 0, o(i), c = null;
|
|
701
|
+
} : c.oncanplay = function() {
|
|
702
|
+
s(), i.play = !0, i.width = c?.videoWidth || 0, i.height = c?.videoHeight || 0, i.duration = c?.duration || 0, o(i), c = null;
|
|
703
|
+
}, c.onerror = function() {
|
|
704
|
+
s(), o(i), c = null;
|
|
705
|
+
};
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
async function we(t) {
|
|
709
|
+
const { url: e = "", currentTime: n, videoSuffix: r = "", videoAllowPlay: i = !1 } = t;
|
|
710
|
+
let s = "", o = r, c = "1", f;
|
|
711
|
+
return e instanceof File ? (s = URL.createObjectURL(e), o = R(e.name), c = b(e.name)) : e instanceof Blob ? (s = URL.createObjectURL(e), c = b(e)) : F(e) ? (s = e, c = b(e)) : (e.includes("https") || e.includes("http")) && (s = e, o = R(e), c = b(e)), (o ? S.videoAllowType.includes(o.toLowerCase()) : !1) ? i ? L(s, n) : (f = await Pt({
|
|
712
|
+
url: s,
|
|
713
|
+
fileType: c
|
|
714
|
+
}), f.play ? L(s, n) : new Promise((a) => {
|
|
715
|
+
a("");
|
|
716
|
+
})) : new Promise((a) => {
|
|
717
|
+
a("");
|
|
718
|
+
});
|
|
719
|
+
}
|
|
720
|
+
async function L(t, e = 0) {
|
|
721
|
+
return new Promise((n) => {
|
|
722
|
+
let r = document.createElement("video");
|
|
723
|
+
r && (r.controls = !0, r.muted = !0, r.setAttribute("src", t), r.setAttribute("muted", String(!0)), r.setAttribute("crossorigin", "anonymous"), r.setAttribute("autoplay", String(!0)), r.addEventListener("loadeddata", async () => {
|
|
724
|
+
let i;
|
|
725
|
+
for (r?.addEventListener("seeked", async () => {
|
|
726
|
+
i && i();
|
|
727
|
+
}); e < (r?.duration || 0); ) {
|
|
728
|
+
r && (r.currentTime = e), await new Promise((l) => i = l);
|
|
729
|
+
const s = document.createElement("canvas"), o = 0.8, c = s.getContext("2d"), f = r?.videoWidth || 0 * o, u = r?.videoHeight || 0 * o, a = 0;
|
|
730
|
+
s.width = r?.videoWidth || 0 * o, s.height = r?.videoHeight || 0 * o, r && c.drawImage(r, 0, 0, f + a, u + a), r = null, n(f === 0 || u === 0 ? "" : s.toDataURL("image/png", 1));
|
|
731
|
+
}
|
|
732
|
+
}));
|
|
733
|
+
});
|
|
734
|
+
}
|
|
735
|
+
function F(t = "") {
|
|
736
|
+
return !!(t && [
|
|
737
|
+
"data:image/",
|
|
738
|
+
"data:video/",
|
|
739
|
+
"data:audio/"
|
|
740
|
+
].find((n) => t.includes(n)));
|
|
741
|
+
}
|
|
742
|
+
function Ae(t) {
|
|
743
|
+
return typeof t == "string" && /^data:(?:image|video|audio)\/[A-Za-z]+;base64,[A-Za-z0-9+/=]+$/.test(t);
|
|
744
|
+
}
|
|
745
|
+
function be(t, e, n, r = !1) {
|
|
746
|
+
t && e && n && t.addEventListener(e, n, r);
|
|
747
|
+
}
|
|
748
|
+
function Se(t, e, n, r = !1) {
|
|
749
|
+
t && e && n && t.removeEventListener(e, n, r);
|
|
750
|
+
}
|
|
751
|
+
function xe() {
|
|
752
|
+
return /windows|win32/i.test(navigator.userAgent);
|
|
753
|
+
}
|
|
754
|
+
function Oe(t) {
|
|
755
|
+
return D(t) ? t : !!t;
|
|
756
|
+
}
|
|
757
|
+
function M(t, e) {
|
|
758
|
+
const n = `^\\d+(?:\\.\\d{0,${t}})?`, r = new RegExp(n), i = e.toString().match(r);
|
|
759
|
+
if (i) {
|
|
760
|
+
const s = i[0];
|
|
761
|
+
if (s.includes(".")) {
|
|
762
|
+
const [o, c] = s.split(".");
|
|
763
|
+
if (/^0*$/.test(c))
|
|
764
|
+
return o;
|
|
765
|
+
}
|
|
766
|
+
return s;
|
|
767
|
+
}
|
|
768
|
+
return e.toString();
|
|
769
|
+
}
|
|
770
|
+
function je(t, e) {
|
|
771
|
+
const { toChinese: n = !1, fixed: r = 2, min: i = 1e4 } = e || {}, s = h(i) ? i : 1e4, o = h(r) ? r : 2, c = n ? t < s ? "" : t < 1e8 ? "万" : "亿" : t < s ? "" : t < 1e8 ? "w" : "亿";
|
|
772
|
+
if (!h(t))
|
|
773
|
+
return {
|
|
774
|
+
str: `${t}`,
|
|
775
|
+
number: `${t}`
|
|
776
|
+
};
|
|
777
|
+
if (t < s)
|
|
778
|
+
return {
|
|
779
|
+
str: `${t}`,
|
|
780
|
+
number: `${t}`
|
|
781
|
+
};
|
|
782
|
+
if (o === 0) {
|
|
783
|
+
const u = (t / (t < 1e8 ? 1e4 : 1e8)).toFixed(1).split(".")[0];
|
|
784
|
+
return {
|
|
785
|
+
str: `${u}${c}`,
|
|
786
|
+
number: u,
|
|
787
|
+
unit: c
|
|
788
|
+
};
|
|
789
|
+
}
|
|
790
|
+
let f;
|
|
791
|
+
return t < 1e8 ? (f = M(o, t / 1e4), {
|
|
792
|
+
str: f + c,
|
|
793
|
+
number: f,
|
|
794
|
+
unit: c
|
|
795
|
+
}) : (f = M(o, t / 1e8), {
|
|
796
|
+
str: f + c,
|
|
797
|
+
number: f,
|
|
798
|
+
unit: c
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
function Ie(t, e) {
|
|
802
|
+
let n = 0;
|
|
803
|
+
const r = D(e.removeAfter) ? e.removeAfter : !0, i = e.id || "hiddenElement", s = {
|
|
804
|
+
opacity: 0,
|
|
805
|
+
visibility: "hidden",
|
|
806
|
+
position: "fixed",
|
|
807
|
+
zIndex: -1,
|
|
808
|
+
top: 0,
|
|
809
|
+
left: 0
|
|
810
|
+
};
|
|
811
|
+
let o = document.querySelector(`#${i}`);
|
|
812
|
+
if (!o) {
|
|
813
|
+
const f = document.createElement("div");
|
|
814
|
+
f.id = i, document.body.appendChild(f), o = document.querySelector(`#${i}`);
|
|
815
|
+
}
|
|
816
|
+
Object.assign(o.style, s);
|
|
817
|
+
const c = document.createElement(e.createName || "span");
|
|
818
|
+
return c.innerHTML = t, (e.cssObject || m(e.cssObject)) && Object.assign(c.style, e.cssObject), o.append(c), n = c.getBoundingClientRect()[e.type || "width"], r && o.removeChild(c), n;
|
|
819
|
+
}
|
|
820
|
+
function Ue(t) {
|
|
821
|
+
t = h(t) && !Number.isNaN(t) ? t : 0;
|
|
822
|
+
const e = ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"], n = ["", "十", "百", "千", "万"];
|
|
823
|
+
t = Number.parseInt(`${t}`);
|
|
824
|
+
const r = (o) => {
|
|
825
|
+
const c = o.toString().split("").reverse();
|
|
826
|
+
let f = "";
|
|
827
|
+
for (let u = 0; u < c.length; u++)
|
|
828
|
+
f = (u === 0 && c[u] === "0" || u > 0 && c[u] === "0" && c[u - 1] === "0" ? "" : (t < 20 && u > 0 ? "" : e[c[u]]) + (c[u] === "0" ? n[0] : n[u])) + f;
|
|
829
|
+
return f;
|
|
830
|
+
}, i = Math.floor(t / 1e4);
|
|
831
|
+
let s = t % 1e4;
|
|
832
|
+
return s.toString().length < 4 && (s = "0" + s), i ? r(i) + "万" + r(s) : r(t);
|
|
833
|
+
}
|
|
834
|
+
function Re(t, e) {
|
|
835
|
+
Object.keys(t).forEach((n) => {
|
|
836
|
+
e(n, t[n]);
|
|
837
|
+
});
|
|
838
|
+
}
|
|
839
|
+
function Lt(t, e, n, r) {
|
|
840
|
+
const i = n - e;
|
|
841
|
+
return t /= r / 2, t < 1 ? i / 2 * t * t * t + e : i / 2 * ((t -= 2) * t * t + 2) + e;
|
|
842
|
+
}
|
|
843
|
+
function Ee(t, e = {}) {
|
|
844
|
+
const { getContainer: n = () => window, callback: r, duration: i = 450 } = e, s = n(), o = K(s, !0), c = Date.now(), f = () => {
|
|
845
|
+
const a = Date.now() - c, l = Lt(a > i ? i : a, o, t, i);
|
|
846
|
+
I(s) ? s.scrollTo(window.pageXOffset, l) : s instanceof HTMLDocument || s.constructor.name === "HTMLDocument" ? s.documentElement.scrollTop = l : s.scrollTop = l, a < i ? U(f) : typeof r == "function" && r();
|
|
847
|
+
};
|
|
848
|
+
s && U(f);
|
|
849
|
+
}
|
|
850
|
+
function Be(t) {
|
|
851
|
+
let e;
|
|
852
|
+
const n = (i) => () => {
|
|
853
|
+
e = null, t(...i);
|
|
854
|
+
}, r = (...i) => {
|
|
855
|
+
e == null && (e = requestAnimationFrame(n(i)));
|
|
856
|
+
};
|
|
857
|
+
return r.cancel = () => cancelAnimationFrame(e), r;
|
|
858
|
+
}
|
|
859
|
+
const Mt = typeof process < "u" && process.versions != null && process.versions.node != null, De = () => process.env.NODE_ENV === "TEST" ? !0 : typeof window < "u" && typeof window.document < "u" && typeof window.matchMedia < "u" && !Mt;
|
|
860
|
+
function j(t, e, n, r) {
|
|
861
|
+
if (t === e)
|
|
862
|
+
return !0;
|
|
863
|
+
if (t && e && typeof t == "object" && typeof e == "object") {
|
|
864
|
+
if (t.constructor !== e.constructor)
|
|
865
|
+
return !1;
|
|
866
|
+
let i, s, o;
|
|
867
|
+
if (Array.isArray(t)) {
|
|
868
|
+
if (i = t.length, i != e.length)
|
|
869
|
+
return !1;
|
|
870
|
+
for (s = i; s-- !== 0; )
|
|
871
|
+
if (!j(t[s], e[s], n, r))
|
|
872
|
+
return !1;
|
|
873
|
+
return !0;
|
|
874
|
+
}
|
|
875
|
+
if (t instanceof Map && e instanceof Map) {
|
|
876
|
+
if (t.size !== e.size)
|
|
877
|
+
return !1;
|
|
878
|
+
for (s of t.entries())
|
|
879
|
+
if (!e.has(s[0]))
|
|
880
|
+
return !1;
|
|
881
|
+
for (s of t.entries())
|
|
882
|
+
if (!j(s[1], e.get(s[0]), n, r))
|
|
883
|
+
return !1;
|
|
884
|
+
return !0;
|
|
885
|
+
}
|
|
886
|
+
if (t instanceof Set && e instanceof Set) {
|
|
887
|
+
if (t.size !== e.size)
|
|
888
|
+
return !1;
|
|
889
|
+
for (s of t.entries())
|
|
890
|
+
if (!e.has(s[0]))
|
|
891
|
+
return !1;
|
|
892
|
+
return !0;
|
|
893
|
+
}
|
|
894
|
+
if (ArrayBuffer.isView(t) && ArrayBuffer.isView(e)) {
|
|
895
|
+
if (i = t.length, i != e.length)
|
|
896
|
+
return !1;
|
|
897
|
+
for (s = i; s-- !== 0; )
|
|
898
|
+
if (t[s] !== e[s])
|
|
899
|
+
return !1;
|
|
900
|
+
return !0;
|
|
901
|
+
}
|
|
902
|
+
if (t.constructor === RegExp)
|
|
903
|
+
return t.source === e.source && t.flags === e.flags;
|
|
904
|
+
if (t.valueOf !== Object.prototype.valueOf && t.valueOf)
|
|
905
|
+
return t.valueOf() === e.valueOf();
|
|
906
|
+
if (t.toString !== Object.prototype.toString && t.toString)
|
|
907
|
+
return t.toString() === e.toString();
|
|
908
|
+
if (o = Object.keys(t), i = o.length, i !== Object.keys(e).length)
|
|
909
|
+
return !1;
|
|
910
|
+
for (s = i; s-- !== 0; )
|
|
911
|
+
if (!Object.prototype.hasOwnProperty.call(e, o[s]))
|
|
912
|
+
return !1;
|
|
913
|
+
for (s = i; s-- !== 0; ) {
|
|
914
|
+
const c = o[s];
|
|
915
|
+
if (!n?.includes(c) && !(c === "_owner" && t.$$typeof) && !j(t[c], e[c], n, r))
|
|
916
|
+
return r && console.log(c), !1;
|
|
917
|
+
}
|
|
918
|
+
return !0;
|
|
919
|
+
}
|
|
920
|
+
return t !== t && e !== e;
|
|
921
|
+
}
|
|
922
|
+
function Ne(t) {
|
|
923
|
+
return /\w.(?:png|jpg|jpeg|svg|webp|gif|bmp)$/i.test(t);
|
|
924
|
+
}
|
|
925
|
+
const _t = (t) => t == null, Fe = (t) => {
|
|
926
|
+
if (!t || !t.startsWith("http"))
|
|
927
|
+
return !1;
|
|
928
|
+
try {
|
|
929
|
+
return !!new URL(t);
|
|
930
|
+
} catch (e) {
|
|
931
|
+
return console.error("isUrl error", e), !1;
|
|
932
|
+
}
|
|
933
|
+
};
|
|
934
|
+
function $t(t) {
|
|
935
|
+
return t === "__proto__";
|
|
936
|
+
}
|
|
937
|
+
function g(t, e, n) {
|
|
938
|
+
const r = Object.keys(e);
|
|
939
|
+
for (let i = 0; i < r.length; i++) {
|
|
940
|
+
const s = r[i];
|
|
941
|
+
if ($t(s))
|
|
942
|
+
continue;
|
|
943
|
+
const o = e[s], c = t[s], f = n(c, o, s, t, e);
|
|
944
|
+
f !== void 0 ? t[s] = f : A(o) ? A(c) ? t[s] = g(c, o, n) : t[s] = g({}, o, n) : _t(o) && (t[s] = o);
|
|
945
|
+
}
|
|
946
|
+
return t;
|
|
947
|
+
}
|
|
948
|
+
const Pe = (...t) => {
|
|
949
|
+
const e = {}, n = t.length;
|
|
950
|
+
let r, i = 0;
|
|
951
|
+
for (; i < n; i += 1)
|
|
952
|
+
for (r in t[i])
|
|
953
|
+
Object.prototype.hasOwnProperty.call(t[i], r) && (typeof e[r] == "object" && typeof t[i][r] == "object" && e[r] !== void 0 && e[r] !== null && !Array.isArray(e[r]) && !Array.isArray(t[i][r]) ? e[r] = {
|
|
954
|
+
...e[r],
|
|
955
|
+
...t[i][r]
|
|
956
|
+
} : e[r] = t[i][r]);
|
|
957
|
+
return e;
|
|
958
|
+
};
|
|
959
|
+
function Le(t, e) {
|
|
960
|
+
return g(w(t), e, function n(r, i) {
|
|
961
|
+
if (A(i))
|
|
962
|
+
return A(r) ? g(w(r), i, n) : g({}, i, n);
|
|
963
|
+
});
|
|
964
|
+
}
|
|
965
|
+
function Me(t, e) {
|
|
966
|
+
return g(t, e, function n(r, i) {
|
|
967
|
+
if (A(i))
|
|
968
|
+
return A(r) ? g(r, i, n) : g({}, i, n);
|
|
969
|
+
});
|
|
970
|
+
}
|
|
971
|
+
let _ = 0;
|
|
972
|
+
const $ = (t = 21) => {
|
|
973
|
+
if (typeof window > "u" || !window.crypto)
|
|
974
|
+
return (_ += 1).toFixed(0);
|
|
975
|
+
let e = "";
|
|
976
|
+
const n = crypto.getRandomValues(new Uint8Array(t));
|
|
977
|
+
for (; t--; ) {
|
|
978
|
+
const r = 63 & n[t];
|
|
979
|
+
e += r < 36 ? r.toString(36) : r < 62 ? (r - 26).toString(36).toUpperCase() : r < 63 ? "_" : "-";
|
|
980
|
+
}
|
|
981
|
+
return e;
|
|
982
|
+
}, _e = () => typeof window > "u" ? $() : window.crypto && window.crypto.randomUUID && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : $(), $e = (t) => {
|
|
983
|
+
if (t && t !== !0)
|
|
984
|
+
return t;
|
|
985
|
+
}, ve = (t) => {
|
|
986
|
+
const e = {};
|
|
987
|
+
if (Object.keys(t || {}).forEach((n) => {
|
|
988
|
+
t[n] !== void 0 && (e[n] = t[n]);
|
|
989
|
+
}), !(Object.keys(e).length < 1))
|
|
990
|
+
return e;
|
|
991
|
+
}, We = (t) => {
|
|
992
|
+
const e = {};
|
|
993
|
+
return Object.keys(t || {}).forEach((n) => {
|
|
994
|
+
Array.isArray(t[n]) && t[n]?.length === 0 || t[n] !== void 0 && (e[n] = t[n]);
|
|
995
|
+
}), e;
|
|
996
|
+
};
|
|
997
|
+
function ze(t) {
|
|
998
|
+
if (!(typeof t != "string" && !Array.isArray(t)))
|
|
999
|
+
return Array.isArray(t) ? t[t.length - 1] : t.split(":")?.slice(-1)[0];
|
|
1000
|
+
}
|
|
1001
|
+
function vt(t) {
|
|
1002
|
+
return t && (t.type === q || t.type === v && t.children.length === 0 || t.type === Text && t.children.trim() === "");
|
|
1003
|
+
}
|
|
1004
|
+
function Ve(t, e) {
|
|
1005
|
+
return E(typeof t[e] == "function" ? t[e]?.() : []);
|
|
1006
|
+
}
|
|
1007
|
+
function E(t = [], e = !0) {
|
|
1008
|
+
const n = Array.isArray(t) ? t : [t], r = [];
|
|
1009
|
+
return n.forEach((i) => {
|
|
1010
|
+
Array.isArray(i) ? r.push(...E(i, e)) : i?.type === v || i?.type === "template" ? r.push(...E(i.children, e)) : i && B(i) ? e && !vt(i) ? r.push(i) : e || r.push(i) : jt(i) && r.push(i);
|
|
1011
|
+
}), r;
|
|
1012
|
+
}
|
|
1013
|
+
function H({ vnode: t, defaultVNode: e }, ...n) {
|
|
1014
|
+
return t === !1 ? null : typeof t == "function" ? t?.(...n) : t || e;
|
|
1015
|
+
}
|
|
1016
|
+
function Wt(t, ...e) {
|
|
1017
|
+
const { slots: n, key: r = "default", render: i, props: s, defaultChildren: o } = t;
|
|
1018
|
+
let c;
|
|
1019
|
+
const f = s[r], u = n?.[r], a = typeof o == "function" ? o?.() : o;
|
|
1020
|
+
return f === !1 ? c = !1 : f === !0 ? c = u ?? a : m(f) && i ? B(f) ? c = f : c = u : c = f || u, c === !1 ? !1 : i ? H({ vnode: c, defaultVNode: a }, ...e) : c;
|
|
1021
|
+
}
|
|
1022
|
+
function zt(t, ...e) {
|
|
1023
|
+
const { slots: n, key: r = "default", props: i, defaultChildren: s } = t;
|
|
1024
|
+
let o;
|
|
1025
|
+
const c = i[r], f = n?.[r]?.(...e), u = typeof s == "function" ? s?.() : s;
|
|
1026
|
+
return c === !1 ? o = !1 : c === !0 ? o = f ?? u : m(c) ? B(c) ? o = c : o = f : o = c || f, o === !1 ? !1 : H({ vnode: o, defaultVNode: u }, ...e);
|
|
1027
|
+
}
|
|
1028
|
+
function He(t, ...e) {
|
|
1029
|
+
const { slots: n, props: r, keys: i, render: s, defaultVNodes: o } = t, c = {};
|
|
1030
|
+
return i.forEach((f, u) => {
|
|
1031
|
+
const a = o ? o[u] : null, l = s ? zt({ slots: n, props: r, key: f, defaultChildren: a }, ...e) : Wt({ slots: n, props: r, key: f, render: !1, defaultChildren: a }, ...e);
|
|
1032
|
+
(D(l) || l) && (c[f] = l);
|
|
1033
|
+
}), c;
|
|
1034
|
+
}
|
|
1035
|
+
export {
|
|
1036
|
+
Ht as Base64,
|
|
1037
|
+
ce as arrayRepeat,
|
|
1038
|
+
ie as arraySlice,
|
|
1039
|
+
me as blobToDataURL,
|
|
1040
|
+
b as checkFileType,
|
|
1041
|
+
Y as classNames,
|
|
1042
|
+
w as cloneDeep,
|
|
1043
|
+
Qt as cloneDeepWith,
|
|
1044
|
+
y as cloneDeepWithImpl,
|
|
1045
|
+
It as compareArray,
|
|
1046
|
+
oe as compareArraySort,
|
|
1047
|
+
se as compareArrayTimeSort,
|
|
1048
|
+
Ut as compareTime,
|
|
1049
|
+
Oe as convertValueBoolean,
|
|
1050
|
+
d as copyProperties,
|
|
1051
|
+
ye as dataURLtoBlob,
|
|
1052
|
+
he as dataURLtoFile,
|
|
1053
|
+
ee as deepCopy,
|
|
1054
|
+
Le as deepMerge,
|
|
1055
|
+
S as fileTypes,
|
|
1056
|
+
E as filterEmpty,
|
|
1057
|
+
Dt as filterTree,
|
|
1058
|
+
Nt as findSourceByTree,
|
|
1059
|
+
le as findValueAndAncestors,
|
|
1060
|
+
Re as forInObject,
|
|
1061
|
+
ue as formatDuration,
|
|
1062
|
+
M as formatNumber,
|
|
1063
|
+
Ct as genColumnKey,
|
|
1064
|
+
L as generateVideoPicture,
|
|
1065
|
+
de as getArrayLast,
|
|
1066
|
+
ge as getBase64,
|
|
1067
|
+
pe as getBlobUrl,
|
|
1068
|
+
R as getFileSuffix,
|
|
1069
|
+
ze as getKeys,
|
|
1070
|
+
Bt as getLevelData,
|
|
1071
|
+
Et as getMaxFloor,
|
|
1072
|
+
Pt as getMediaInfos,
|
|
1073
|
+
kt as getPrefixCls,
|
|
1074
|
+
Rt as getRandomNumber,
|
|
1075
|
+
K as getScroll,
|
|
1076
|
+
Yt as getScrollContainer,
|
|
1077
|
+
Wt as getSlot,
|
|
1078
|
+
zt as getSlotVNode,
|
|
1079
|
+
Ve as getSlotsChildren,
|
|
1080
|
+
He as getSlotsProps,
|
|
1081
|
+
ne as getSortIndex,
|
|
1082
|
+
k as getSymbols,
|
|
1083
|
+
Ie as getTextWidth,
|
|
1084
|
+
Xt as getValueFromObjectByKey,
|
|
1085
|
+
we as getVideoCoverPicture,
|
|
1086
|
+
Ft as getVideoFileUrl,
|
|
1087
|
+
re as handleCurrentPage,
|
|
1088
|
+
fe as handleEmptyField,
|
|
1089
|
+
Tt as handleShowIndex,
|
|
1090
|
+
J as is,
|
|
1091
|
+
p as isArray,
|
|
1092
|
+
F as isBase64,
|
|
1093
|
+
D as isBoolean,
|
|
1094
|
+
De as isBrowser,
|
|
1095
|
+
Ae as isDataURLBase64,
|
|
1096
|
+
j as isDeepEqualReact,
|
|
1097
|
+
vt as isEmptyElement,
|
|
1098
|
+
qt as isFunction,
|
|
1099
|
+
Ne as isImg,
|
|
1100
|
+
Gt as isInContainer,
|
|
1101
|
+
Jt as isJSONStr,
|
|
1102
|
+
Zt as isMobile,
|
|
1103
|
+
_t as isNil,
|
|
1104
|
+
Kt as isNotNil,
|
|
1105
|
+
h as isNumber,
|
|
1106
|
+
m as isObject,
|
|
1107
|
+
A as isPlainObject,
|
|
1108
|
+
T as isPrimitive,
|
|
1109
|
+
Q as isScroll,
|
|
1110
|
+
x as isServer,
|
|
1111
|
+
Z as isString,
|
|
1112
|
+
X as isTablet,
|
|
1113
|
+
tt as isTypedArray,
|
|
1114
|
+
Fe as isUrl,
|
|
1115
|
+
jt as isValid,
|
|
1116
|
+
xe as isWindowsOs,
|
|
1117
|
+
Pe as merge,
|
|
1118
|
+
g as mergeWith,
|
|
1119
|
+
_e as nanoid,
|
|
1120
|
+
Se as off,
|
|
1121
|
+
$e as omitBoolean,
|
|
1122
|
+
ve as omitUndefined,
|
|
1123
|
+
We as omitUndefinedAndEmptyArr,
|
|
1124
|
+
be as on,
|
|
1125
|
+
U as raf,
|
|
1126
|
+
te as runFunction,
|
|
1127
|
+
Ee as scrollTo,
|
|
1128
|
+
H as slotRender,
|
|
1129
|
+
Be as throttleByAnimationFrame,
|
|
1130
|
+
Ue as toChinesNum,
|
|
1131
|
+
je as toConvertNumberShow,
|
|
1132
|
+
ae as treeData,
|
|
1133
|
+
Me as useDeepMerge
|
|
1134
|
+
};
|