@gx-design-vue/pro-utils 0.2.0-beta.6 → 0.2.0-beta.61

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