@gx-design-vue/pro-utils 0.2.0-beta.36 → 0.2.0-beta.38

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/pro-utils.js CHANGED
@@ -1,5 +1,5 @@
1
- import { Comment as N, Fragment as T } from "vue";
2
- const m = typeof window > "u";
1
+ import { Comment as z, Fragment as j, isVNode as m } from "vue";
2
+ const w = typeof window > "u";
3
3
  /**
4
4
  * @vue/shared v3.5.11
5
5
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
@@ -7,16 +7,16 @@ const m = typeof window > "u";
7
7
  **/
8
8
  process.env.NODE_ENV !== "production" && Object.freeze({});
9
9
  process.env.NODE_ENV !== "production" && Object.freeze([]);
10
- const $ = (e) => {
10
+ const H = (e) => {
11
11
  const t = /* @__PURE__ */ Object.create(null);
12
12
  return (r) => t[r] || (t[r] = e(r));
13
- }, V = /-(\w)/g, z = $(
14
- (e) => e.replace(V, (t, r) => r ? r.toUpperCase() : "")
15
- ), w = function(e, t) {
13
+ }, W = /-(\w)/g, _ = H(
14
+ (e) => e.replace(W, (t, r) => r ? r.toUpperCase() : "")
15
+ ), y = function(e, t) {
16
16
  var r;
17
- if (m || !e || !t)
17
+ if (w || !e || !t)
18
18
  return "";
19
- t = z(t), t === "float" && (t = "cssFloat");
19
+ t = _(t), t === "float" && (t = "cssFloat");
20
20
  try {
21
21
  const n = e.style[t];
22
22
  if (n)
@@ -26,20 +26,20 @@ const $ = (e) => {
26
26
  } catch {
27
27
  return e.style[t];
28
28
  }
29
- }, H = (e, t) => m ? void 0 : (t == null ? w(e, "overflow") : t ? w(e, "overflow-y") : w(e, "overflow-x")).match(/(scroll|auto|overlay)/), re = (e, t) => {
30
- if (m)
29
+ }, q = (e, t) => w ? void 0 : (t == null ? y(e, "overflow") : t ? y(e, "overflow-y") : y(e, "overflow-x")).match(/(scroll|auto|overlay)/), ue = (e, t) => {
30
+ if (w)
31
31
  return;
32
32
  let r = e;
33
33
  for (; r; ) {
34
34
  if ([window, document, document.documentElement].includes(r))
35
35
  return window;
36
- if (H(r, t))
36
+ if (q(r, t))
37
37
  return r;
38
38
  r = r.parentNode;
39
39
  }
40
40
  return r;
41
- }, ie = (e, t) => {
42
- if (m || !e || !t)
41
+ }, ce = (e, t) => {
42
+ if (w || !e || !t)
43
43
  return !1;
44
44
  const r = e.getBoundingClientRect();
45
45
  let n;
@@ -50,10 +50,10 @@ const $ = (e) => {
50
50
  left: 0
51
51
  } : n = t.getBoundingClientRect(), r.top < n.bottom && r.bottom > n.top && r.right > n.left && r.left < n.right;
52
52
  };
53
- function oe(e) {
53
+ function fe(e) {
54
54
  return /\w.(png|jpg|jpeg|svg|webp|gif|bmp)$/i.test(e);
55
55
  }
56
- const ue = (e) => e == null, ce = (e) => {
56
+ const ae = (e) => e == null, se = (e) => {
57
57
  if (!e || !e.startsWith("http"))
58
58
  return !1;
59
59
  try {
@@ -61,7 +61,7 @@ const ue = (e) => e == null, ce = (e) => {
61
61
  } catch {
62
62
  return !1;
63
63
  }
64
- }, fe = (...e) => {
64
+ }, le = (...e) => {
65
65
  const t = {}, r = e.length;
66
66
  let n, i = 0;
67
67
  for (; i < r; i += 1)
@@ -72,10 +72,10 @@ const ue = (e) => e == null, ce = (e) => {
72
72
  } : t[n] = e[i][n]);
73
73
  return t;
74
74
  };
75
- let E = 0;
76
- const R = (e = 21) => {
75
+ let R = 0;
76
+ const b = (e = 21) => {
77
77
  if (typeof window > "u" || !window.crypto)
78
- return (E += 1).toFixed(0);
78
+ return (R += 1).toFixed(0);
79
79
  let t = "";
80
80
  const r = crypto.getRandomValues(new Uint8Array(e));
81
81
  for (; e--; ) {
@@ -83,8 +83,8 @@ const R = (e = 21) => {
83
83
  t += n < 36 ? n.toString(36) : n < 62 ? (n - 26).toString(36).toUpperCase() : n < 63 ? "_" : "-";
84
84
  }
85
85
  return t;
86
- }, se = () => typeof window > "u" ? R() : window.crypto && window.crypto.randomUUID && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : R();
87
- function j(e, t) {
86
+ }, de = () => typeof window > "u" ? b() : window.crypto && window.crypto.randomUUID && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : b();
87
+ function F(e, t) {
88
88
  if (typeof t != "string" && !Array.isArray(t))
89
89
  return;
90
90
  const r = Array.isArray(t) ? t : t.split(":");
@@ -96,96 +96,96 @@ function j(e, t) {
96
96
  return;
97
97
  return n;
98
98
  }
99
- const W = Object.prototype.toString;
100
- function F(e, t) {
101
- return W.call(e) === `[object ${t}]`;
99
+ const J = Object.prototype.toString;
100
+ function L(e, t) {
101
+ return J.call(e) === `[object ${t}]`;
102
102
  }
103
- function _(e) {
104
- return F(e, "Boolean");
103
+ function D(e) {
104
+ return L(e, "Boolean");
105
105
  }
106
- function ae(e) {
106
+ function pe(e) {
107
107
  return typeof e == "number";
108
108
  }
109
- function L(e) {
109
+ function B(e) {
110
110
  return typeof Array.isArray > "u" ? Object.prototype.toString.call(e) === "[object Array]" : Array.isArray(e);
111
111
  }
112
- function g(e) {
113
- return e !== null && F(e, "Object");
112
+ function d(e) {
113
+ return e !== null && L(e, "Object");
114
114
  }
115
- function q(e) {
115
+ function X(e) {
116
116
  return typeof e == "string" || e instanceof String;
117
117
  }
118
- function le(e) {
118
+ function ge(e) {
119
119
  return typeof e == "function" || Object.prototype.toString.call(e) === "[object Function]";
120
120
  }
121
- function J(...e) {
121
+ function Y(...e) {
122
122
  const t = [];
123
123
  for (let r = 0; r < e.length; r++) {
124
124
  const n = e[r];
125
125
  if (n) {
126
- if (q(n))
126
+ if (X(n))
127
127
  t.push(n);
128
- else if (L(n))
128
+ else if (B(n))
129
129
  for (let i = 0; i < n.length; i++) {
130
- const o = J(n[i]);
130
+ const o = Y(n[i]);
131
131
  o && t.push(o);
132
132
  }
133
- else if (g(n))
133
+ else if (d(n))
134
134
  for (const i in n)
135
135
  n[i] && t.push(i);
136
136
  }
137
137
  }
138
138
  return t.filter((r) => r).join(" ");
139
139
  }
140
- let D = (e) => setTimeout(e, 16), C = (e) => clearTimeout(e);
141
- typeof window < "u" && "requestAnimationFrame" in window && (D = (e) => window.requestAnimationFrame(e), C = (e) => window.cancelAnimationFrame(e));
142
- let b = 0;
143
- const A = /* @__PURE__ */ new Map();
144
- function B(e) {
145
- A.delete(e);
140
+ let C = (e) => setTimeout(e, 16), P = (e) => clearTimeout(e);
141
+ typeof window < "u" && "requestAnimationFrame" in window && (C = (e) => window.requestAnimationFrame(e), P = (e) => window.cancelAnimationFrame(e));
142
+ let I = 0;
143
+ const S = /* @__PURE__ */ new Map();
144
+ function N(e) {
145
+ S.delete(e);
146
146
  }
147
- function h(e, t = 1) {
148
- b += 1;
149
- const r = b;
147
+ function x(e, t = 1) {
148
+ I += 1;
149
+ const r = I;
150
150
  function n(i) {
151
151
  if (i === 0)
152
- B(r), e();
152
+ N(r), e();
153
153
  else {
154
- const o = D(() => {
154
+ const o = C(() => {
155
155
  n(i - 1);
156
156
  });
157
- A.set(r, o);
157
+ S.set(r, o);
158
158
  }
159
159
  }
160
160
  return n(t), r;
161
161
  }
162
- h.cancel = (e) => {
163
- const t = A.get(e);
164
- return B(t), C(t);
162
+ x.cancel = (e) => {
163
+ const t = S.get(e);
164
+ return N(t), P(t);
165
165
  };
166
- function x(e) {
166
+ function v(e) {
167
167
  return e != null && e === e.window;
168
168
  }
169
- function X(e, t) {
169
+ function G(e, t) {
170
170
  var i;
171
171
  if (typeof window > "u")
172
172
  return 0;
173
173
  const r = t ? "scrollTop" : "scrollLeft";
174
174
  let n = 0;
175
- return x(e) ? n = e[t ? "pageYOffset" : "pageXOffset"] : e instanceof Document ? n = e.documentElement[r] : e && (n = e[r]), e && !x(e) && typeof n != "number" && (n = (i = (e.ownerDocument || e).documentElement) == null ? void 0 : i[r]), n;
175
+ return v(e) ? n = e[t ? "pageYOffset" : "pageXOffset"] : e instanceof Document ? n = e.documentElement[r] : e && (n = e[r]), e && !v(e) && typeof n != "number" && (n = (i = (e.ownerDocument || e).documentElement) == null ? void 0 : i[r]), n;
176
176
  }
177
- function Y(e, t, r, n) {
177
+ function Q(e, t, r, n) {
178
178
  const i = r - t;
179
179
  return e /= n / 2, e < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t;
180
180
  }
181
- function de(e, t = {}) {
182
- const { getContainer: r = () => window, callback: n, duration: i = 450 } = t, o = r(), u = X(o, !0), c = Date.now(), f = () => {
183
- const s = Date.now() - c, a = Y(s > i ? i : s, u, e, i);
184
- x(o) ? o.scrollTo(window.pageXOffset, a) : o instanceof HTMLDocument || o.constructor.name === "HTMLDocument" ? o.documentElement.scrollTop = a : o.scrollTop = a, s < i ? h(f) : typeof n == "function" && n();
181
+ function me(e, t = {}) {
182
+ const { getContainer: r = () => window, callback: n, duration: i = 450 } = t, o = r(), u = G(o, !0), c = Date.now(), f = () => {
183
+ const s = Date.now() - c, l = Q(s > i ? i : s, u, e, i);
184
+ v(o) ? o.scrollTo(window.pageXOffset, l) : o instanceof HTMLDocument || o.constructor.name === "HTMLDocument" ? o.documentElement.scrollTop = l : o.scrollTop = l, s < i ? x(f) : typeof n == "function" && n();
185
185
  };
186
- h(f);
186
+ x(f);
187
187
  }
188
- function pe(e) {
188
+ function we(e) {
189
189
  let t;
190
190
  const r = (i) => () => {
191
191
  t = null, e(...i);
@@ -194,7 +194,7 @@ function pe(e) {
194
194
  };
195
195
  return n.cancel = () => cancelAnimationFrame(t), n;
196
196
  }
197
- const p = {
197
+ const g = {
198
198
  videoAllowType: [
199
199
  "mp4",
200
200
  "webm",
@@ -223,7 +223,7 @@ const p = {
223
223
  ],
224
224
  audioType: ["mp3", "mpeg", "aac", "wav", "wma", "mp2", "flac", "midi", "ra", "ape", "aac", "cda"]
225
225
  };
226
- function y(e, t, r, n) {
226
+ function h(e, t, r, n) {
227
227
  if (e === t)
228
228
  return !0;
229
229
  if (e && t && typeof e == "object" && typeof t == "object") {
@@ -234,7 +234,7 @@ function y(e, t, r, n) {
234
234
  if (i = e.length, i != t.length)
235
235
  return !1;
236
236
  for (o = i; o-- !== 0; )
237
- if (!y(e[o], t[o], r, n))
237
+ if (!h(e[o], t[o], r, n))
238
238
  return !1;
239
239
  return !0;
240
240
  }
@@ -245,7 +245,7 @@ function y(e, t, r, n) {
245
245
  if (!t.has(o[0]))
246
246
  return !1;
247
247
  for (o of e.entries())
248
- if (!y(o[1], t.get(o[0]), r, n))
248
+ if (!h(o[1], t.get(o[0]), r, n))
249
249
  return !1;
250
250
  return !0;
251
251
  }
@@ -278,81 +278,83 @@ function y(e, t, r, n) {
278
278
  return !1;
279
279
  for (o = i; o-- !== 0; ) {
280
280
  const c = u[o];
281
- if (!(r != null && r.includes(c)) && !(c === "_owner" && e.$$typeof) && !y(e[c], t[c], r, n))
281
+ if (!(r != null && r.includes(c)) && !(c === "_owner" && e.$$typeof) && !h(e[c], t[c], r, n))
282
282
  return n && console.log(c), !1;
283
283
  }
284
284
  return !0;
285
285
  }
286
286
  return e !== e && t !== t;
287
287
  }
288
- const G = typeof process < "u" && process.versions != null && process.versions.node != null, ge = () => process.env.NODE_ENV === "TEST" ? !0 : typeof window < "u" && typeof window.document < "u" && typeof window.matchMedia < "u" && !G, me = (e) => {
288
+ const Z = typeof process < "u" && process.versions != null && process.versions.node != null, ye = () => process.env.NODE_ENV === "TEST" ? !0 : typeof window < "u" && typeof window.document < "u" && typeof window.matchMedia < "u" && !Z, he = (e) => {
289
289
  if (e && e !== !0)
290
290
  return e;
291
- }, we = (e) => {
291
+ }, xe = (e) => {
292
292
  const t = {};
293
293
  if (Object.keys(e || {}).forEach((r) => {
294
294
  e[r] !== void 0 && (t[r] = e[r]);
295
295
  }), !(Object.keys(t).length < 1))
296
296
  return t;
297
- }, ye = (e) => {
297
+ }, ve = (e) => {
298
298
  const t = {};
299
299
  return Object.keys(e || {}).forEach((r) => {
300
300
  var n;
301
301
  Array.isArray(e[r]) && ((n = e[r]) == null ? void 0 : n.length) === 0 || e[r] !== void 0 && (t[r] = e[r]);
302
302
  }), t;
303
303
  };
304
- function S(e) {
304
+ function O(e) {
305
305
  var t;
306
306
  if (!(typeof e != "string" && !Array.isArray(e)))
307
307
  return Array.isArray(e) ? e[e.length - 1] : (t = e.split(":")) == null ? void 0 : t.slice(-1)[0];
308
308
  }
309
- function Q(e) {
310
- return e && (e.type === N || e.type === T && e.children.length === 0 || e.type === Text && e.children.trim() === "");
309
+ function k(e) {
310
+ return e && (e.type === z || e.type === j && e.children.length === 0 || e.type === Text && e.children.trim() === "");
311
311
  }
312
- function he(e, t) {
312
+ function Ae(e, t) {
313
313
  var r;
314
- return P((r = e[t]) == null ? void 0 : r.call(e));
314
+ return M((r = e[t]) == null ? void 0 : r.call(e));
315
315
  }
316
- function P(e = []) {
316
+ function M(e = []) {
317
317
  const t = [];
318
318
  return e.forEach((r) => {
319
- Array.isArray(r) ? t.push(...r) : (r == null ? void 0 : r.type) === T ? t.push(...P(r.children)) : t.push(r);
320
- }), t.filter((r) => !Q(r));
319
+ Array.isArray(r) ? t.push(...r) : (r == null ? void 0 : r.type) === j ? t.push(...M(r.children)) : t.push(r);
320
+ }), t.filter((r) => !k(r));
321
321
  }
322
- function xe(e, ...t) {
322
+ function V(e, ...t) {
323
323
  return typeof e == "function" ? e == null ? void 0 : e(...t) : e;
324
324
  }
325
- function ve(e, t, r = "default") {
326
- const n = S(r);
327
- if (n) {
328
- const i = j(t, r);
329
- return i === !1 ? !1 : i === !0 ? (e == null ? void 0 : e[n]) || i : i || (e == null ? void 0 : e[n]);
325
+ function K(e, t, r = "default", n) {
326
+ const i = O(r);
327
+ if (i) {
328
+ let o;
329
+ const u = F(t, r);
330
+ return u === !1 ? o = !1 : u === !0 ? o = e == null ? void 0 : e[i] : d(u) ? m(u) ? o = u : o = e == null ? void 0 : e[i] : o = u || (e == null ? void 0 : e[i]), m(o) ? o : n ? V(o) : o;
330
331
  }
331
332
  }
332
- function Z(e, t, r = "default") {
333
- var i, o;
334
- const n = S(r);
335
- if (n) {
336
- const u = j(t, r);
337
- return u === !1 ? !1 : u === !0 ? ((i = e == null ? void 0 : e[n]) == null ? void 0 : i.call(e)) || u : u || ((o = e[n]) == null ? void 0 : o.call(e));
333
+ function ee(e, t, r = "default", n) {
334
+ var o, u, c;
335
+ const i = O(r);
336
+ if (i) {
337
+ let f;
338
+ const a = F(t, r);
339
+ return a === !1 ? f = !1 : a === !0 ? f = (o = e == null ? void 0 : e[i]) == null ? void 0 : o.call(e, n) : d(a) ? m(a) ? f = a : f = (u = e == null ? void 0 : e[i]) == null ? void 0 : u.call(e, n) : f = a || ((c = e == null ? void 0 : e[i]) == null ? void 0 : c.call(e, n)), m(f) ? f : V(f, n);
338
340
  }
339
341
  }
340
- function Ae(e, t, r) {
341
- const n = {};
342
- return e.forEach((i) => {
343
- const o = S(i);
344
- if (o) {
345
- const u = Z(t, r, i);
346
- (_(u) || u) && (n[o] = u);
342
+ function Se(e, t, r, n) {
343
+ const i = {};
344
+ return e.forEach((o) => {
345
+ const u = O(o);
346
+ if (u) {
347
+ const c = n != null && n.render ? ee(t, r, o, n == null ? void 0 : n.params) : K(t, r, o);
348
+ (D(c) || c) && (i[u] = c);
347
349
  }
348
- }), n;
350
+ }), i;
349
351
  }
350
- const Se = ({ suffixCls: e, customizePrefixCls: t, isPor: r, className: n }) => {
352
+ const Oe = ({ suffixCls: e, customizePrefixCls: t, isPor: r, className: n }) => {
351
353
  const i = n || (r ? "gx-pro" : "gx");
352
354
  return t || (e ? `${i}-${e}` : i);
353
- }, Oe = (e, t) => e ? Array.isArray(e) ? e.join("-") : e.toString() : `${t}`;
354
- function Ue(e, { align: t, showIndex: r }) {
355
- const n = O(e);
355
+ }, Ue = (e, t) => e ? Array.isArray(e) ? e.join("-") : e.toString() : `${t}`;
356
+ function Ee(e, { align: t, showIndex: r }) {
357
+ const n = U(e);
356
358
  if (r && e.length && e.every((i) => i.dataIndex !== "sortIndex")) {
357
359
  const i = e[0];
358
360
  n.unshift({
@@ -360,7 +362,7 @@ function Ue(e, { align: t, showIndex: r }) {
360
362
  align: t,
361
363
  fixed: i.fixed,
362
364
  width: 60,
363
- uuid: k().uuid(15),
365
+ uuid: te().uuid(15),
364
366
  dataIndex: "sortIndex",
365
367
  key: "sortIndex"
366
368
  });
@@ -368,44 +370,44 @@ function Ue(e, { align: t, showIndex: r }) {
368
370
  n.filter((i) => i.dataIndex !== "sortIndex");
369
371
  return n;
370
372
  }
371
- function Ee(e, ...t) {
373
+ function Re(e, ...t) {
372
374
  return typeof e == "function" ? e(...t) : e;
373
375
  }
374
- function O(e) {
376
+ function U(e) {
375
377
  return JSON.parse(JSON.stringify(e));
376
378
  }
377
- function Re(e, t) {
378
- if (g(e)) {
379
+ function be(e, t) {
380
+ if (d(e)) {
379
381
  const { pageSize: r = 10, total: n = 0 } = e;
380
382
  let { current: i = 1 } = e;
381
383
  return n - t <= r * (i - 1) && (i = i - 1), i === 0 ? 1 : i;
382
384
  }
383
385
  return 1;
384
386
  }
385
- function be(e = [], t, r = "children") {
387
+ function Ie(e = [], t, r = "children") {
386
388
  function n(i, o) {
387
389
  return o.map((u, c) => {
388
390
  const f = `${i}-${c + 1}`;
389
391
  return u[r] && (u[r] = n(f, u[r])), u.sortIndex = f, u;
390
392
  });
391
393
  }
392
- return O(e).map((i, o) => {
394
+ return U(e).map((i, o) => {
393
395
  let u = o;
394
- const c = g(t) && t.current || 1, f = g(t) && t.pageSize || 10;
396
+ const c = d(t) && t.current || 1, f = d(t) && t.pageSize || 10;
395
397
  return u = c ? (c - 1) * f + (o + 1) : o + 1, i[r] && (i[r] = n(`${u}`, i[r])), i.sortIndex = u, i;
396
398
  });
397
399
  }
398
- function Ie(e, t, r, n) {
400
+ function Te(e, t, r, n) {
399
401
  const i = e[r], o = t[r];
400
402
  let u = 0;
401
403
  return i < o ? u = n === 0 ? -1 : 0 : i > o && (u = n === 0 ? 0 : -1), u;
402
404
  }
403
- function Te(e) {
404
- let t = O(e);
405
+ function je(e) {
406
+ let t = U(e);
405
407
  const r = new Set(t);
406
408
  return t = Array.from(r), t;
407
409
  }
408
- function je(e, t) {
410
+ function Fe(e, t) {
409
411
  const r = ["null", "undefined"];
410
412
  let n = !0;
411
413
  return e === 0 ? n = !0 : r.includes(e) ? n = !1 : e || (n = !1), n ? {
@@ -416,7 +418,7 @@ function je(e, t) {
416
418
  success: n
417
419
  };
418
420
  }
419
- function Fe(e) {
421
+ function Le(e) {
420
422
  let t = "";
421
423
  if (e > -1) {
422
424
  const r = Math.floor(e / 3600), n = Math.floor(e / 60) % 60, i = Number.parseInt(String(e % 60));
@@ -424,7 +426,7 @@ function Fe(e) {
424
426
  }
425
427
  return t.split(":")[0] === "00" ? `${t.split(":")[1]}:${t.split(":")[2]}` : t;
426
428
  }
427
- function k() {
429
+ function te() {
428
430
  const e = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
429
431
  return {
430
432
  uuid(t, r) {
@@ -456,7 +458,7 @@ function k() {
456
458
  }
457
459
  };
458
460
  }
459
- function Le(e = []) {
461
+ function De(e = []) {
460
462
  let t = 0;
461
463
  function r(n = [], i) {
462
464
  n.forEach((o) => {
@@ -465,13 +467,13 @@ function Le(e = []) {
465
467
  }
466
468
  return r(e, 1), t;
467
469
  }
468
- function K(e, t = "children") {
470
+ function ne(e, t = "children") {
469
471
  let r = [];
470
472
  return e.forEach((n) => {
471
- r.push(n), L(n[t]) && n[t].length > 0 && (r = r.concat(K(n[t])));
473
+ r.push(n), B(n[t]) && n[t].length > 0 && (r = r.concat(ne(n[t])));
472
474
  }), r;
473
475
  }
474
- function De(e, t, r, n, i) {
476
+ function Be(e, t, r, n, i) {
475
477
  t = t || "id", r = r || "parentId", n = n || "children", i = i || 0;
476
478
  const o = JSON.parse(JSON.stringify(e));
477
479
  return o.filter((u) => {
@@ -482,13 +484,13 @@ function De(e, t, r, n, i) {
482
484
  function Ce(e) {
483
485
  return URL.createObjectURL(e);
484
486
  }
485
- function Be(e) {
487
+ function Pe(e) {
486
488
  return new Promise((t, r) => {
487
489
  const n = new FileReader();
488
490
  n.readAsDataURL(e), n.onload = () => t(n.result), n.onerror = (i) => r(i);
489
491
  });
490
492
  }
491
- function Pe(e) {
493
+ function Ne(e) {
492
494
  const t = e.split(","), r = t[0].match(/:(.*?);/)[1], n = atob(t[1]);
493
495
  let i = n.length;
494
496
  const o = new Uint8Array(i);
@@ -504,30 +506,30 @@ function Me(e, t) {
504
506
  u[o] = i.charCodeAt(o);
505
507
  return new File([u], t, { type: n });
506
508
  }
507
- function Ne(e, t, r) {
509
+ function Ve(e, t, r) {
508
510
  return new window.File([e], t, { type: r });
509
511
  }
510
- function ee(e = "") {
512
+ function re(e = "") {
511
513
  const t = e.indexOf("?");
512
514
  return t > 0 ? `${e.substring(0, t)}` : e;
513
515
  }
514
- function v(e = "") {
515
- e = ee(e);
516
+ function A(e = "") {
517
+ e = re(e);
516
518
  const t = e.lastIndexOf(".");
517
519
  return t > 0 ? `${e.substring(t).split("?")[0]}`.split(".")[1] : "";
518
520
  }
519
- function d(e, t) {
521
+ function p(e, t) {
520
522
  if (t)
521
523
  return t;
522
524
  if (!e || e === "data:")
523
525
  return "4";
524
526
  let r = "4";
525
- return U(e) ? e.includes("data:image/") ? r = "png" : e.includes("data:video/") ? r = "mp4" : e.includes("data:audio/") && (r = "mp3") : e instanceof Blob ? (e = String(e), e.includes("image") ? r = "png" : e.includes("video") ? r = "mp4" : e.includes("audio") && (r = "mp3")) : r = v(e).toLowerCase(), p.imageType.includes(r) ? "1" : p.videoType.includes(r) ? "3" : p.audioType.includes(r) ? "2" : "4";
527
+ return E(e) ? e.includes("data:image/") ? r = "png" : e.includes("data:video/") ? r = "mp4" : e.includes("data:audio/") && (r = "mp3") : e instanceof Blob ? (e = String(e), e.includes("image") ? r = "png" : e.includes("video") ? r = "mp4" : e.includes("audio") && (r = "mp3")) : r = A(e).toLowerCase(), g.imageType.includes(r) ? "1" : g.videoType.includes(r) ? "3" : g.audioType.includes(r) ? "2" : "4";
526
528
  }
527
- function te(e) {
529
+ function ie(e) {
528
530
  const { url: t = "", fileType: r = "1" } = e;
529
531
  let n = "";
530
- return t instanceof File ? n = URL.createObjectURL(t) : U(t) ? n = t : t instanceof Blob ? n = URL.createObjectURL(t) : (t.includes("https") || t.includes("http")) && (n = t), new Promise((i) => {
532
+ return t instanceof File ? n = URL.createObjectURL(t) : E(t) ? n = t : t instanceof Blob ? n = URL.createObjectURL(t) : (t.includes("https") || t.includes("http")) && (n = t), new Promise((i) => {
531
533
  let o;
532
534
  r === "1" ? (o = document.createElement("img"), o.src = n) : r === "2" ? (o = document.createElement("audio"), o.src = n) : r === "3" && (o = document.createElement("video"), o.src = n), r === "1" ? o.onload = function() {
533
535
  i({
@@ -552,16 +554,16 @@ function te(e) {
552
554
  async function $e(e) {
553
555
  const { url: t = "", currentTime: r, videoSuffix: n = "", vidoeAllowPlay: i = !1 } = e;
554
556
  let o = "", u = n, c = "1", f;
555
- return t instanceof File ? (o = URL.createObjectURL(t), u = v(t.name), c = d(t.name)) : t instanceof Blob ? (o = URL.createObjectURL(t), c = d(t)) : U(t) ? (o = t, c = d(t)) : (t.includes("https") || t.includes("http")) && (o = t, u = v(t), c = d(t)), (u ? p.videoAllowType.includes(u.toLowerCase()) : !1) ? i ? I(o, r) : (f = await te({
557
+ return t instanceof File ? (o = URL.createObjectURL(t), u = A(t.name), c = p(t.name)) : t instanceof Blob ? (o = URL.createObjectURL(t), c = p(t)) : E(t) ? (o = t, c = p(t)) : (t.includes("https") || t.includes("http")) && (o = t, u = A(t), c = p(t)), (u ? g.videoAllowType.includes(u.toLowerCase()) : !1) ? i ? T(o, r) : (f = await ie({
556
558
  url: o,
557
559
  fileType: c
558
- }), f.play ? I(o, r) : new Promise((s) => {
560
+ }), f.play ? T(o, r) : new Promise((s) => {
559
561
  s("");
560
562
  })) : new Promise((s) => {
561
563
  s("");
562
564
  });
563
565
  }
564
- async function I(e, t = 0) {
566
+ async function T(e, t = 0) {
565
567
  return new Promise((r) => {
566
568
  let n = document.createElement("video");
567
569
  n.controls = !0, n.muted = !0, n.setAttribute("src", e), n.setAttribute("muted", String(!0)), n.setAttribute("crossorigin", "anonymous"), n.setAttribute("autoplay", String(!0)), n && n.addEventListener("loadeddata", async function() {
@@ -571,92 +573,96 @@ async function I(e, t = 0) {
571
573
  });
572
574
  const o = (n == null ? void 0 : n.duration) || 0;
573
575
  for (; t < o; ) {
574
- n && (n.currentTime = t), await new Promise((M) => i = M);
575
- const u = document.createElement("canvas"), c = 0.8, f = u.getContext("2d"), l = (n == null ? void 0 : n.videoWidth) || 0 * c, s = (n == null ? void 0 : n.videoHeight) || 0 * c, a = 0;
576
- u.width = (n == null ? void 0 : n.videoWidth) || 0 * c, u.height = (n == null ? void 0 : n.videoHeight) || 0 * c, f.drawImage(n, 0, 0, l + a, s + a), n = null, r(l === 0 || s === 0 ? "" : u.toDataURL("image/png", 1));
576
+ n && (n.currentTime = t), await new Promise(($) => i = $);
577
+ const u = document.createElement("canvas"), c = 0.8, f = u.getContext("2d"), a = (n == null ? void 0 : n.videoWidth) || 0 * c, s = (n == null ? void 0 : n.videoHeight) || 0 * c, l = 0;
578
+ u.width = (n == null ? void 0 : n.videoWidth) || 0 * c, u.height = (n == null ? void 0 : n.videoHeight) || 0 * c, f.drawImage(n, 0, 0, a + l, s + l), n = null, r(a === 0 || s === 0 ? "" : u.toDataURL("image/png", 1));
577
579
  }
578
580
  });
579
581
  });
580
582
  }
581
- function U(e = "") {
583
+ function E(e = "") {
582
584
  return !!(e && [
583
585
  "data:image/",
584
586
  "data:video/",
585
587
  "data:audio/"
586
588
  ].find((r) => e.includes(r)));
587
589
  }
588
- function Ve(e, t, r, n = !1) {
590
+ function ze(e, t, r, n = !1) {
589
591
  e && t && r && e.addEventListener(t, r, n);
590
592
  }
591
- function ze(e, t, r, n = !1) {
593
+ function He(e, t, r, n = !1) {
592
594
  e && t && r && e.removeEventListener(t, r, n);
593
595
  }
594
- function He() {
596
+ function We() {
595
597
  return /windows|win32/i.test(navigator.userAgent);
596
598
  }
599
+ function _e(e) {
600
+ return D(e) ? e : !!e;
601
+ }
597
602
  export {
598
- Te as arrayRepeat,
599
- Ne as blobToDataURL,
600
- d as checkFileType,
601
- J as classNames,
602
- Ie as compareArray,
603
- Pe as dataURLtoBlob,
603
+ je as arrayRepeat,
604
+ Ve as blobToDataURL,
605
+ p as checkFileType,
606
+ Y as classNames,
607
+ Te as compareArray,
608
+ _e as convertValueBoolean,
609
+ Ne as dataURLtoBlob,
604
610
  Me as dataURLtoFile,
605
- O as deepCopy,
606
- P as filterEmpty,
607
- Fe as formatDuraton,
608
- Oe as genColumnKey,
609
- I as generateVidoePicture,
610
- Be as getBase64,
611
+ U as deepCopy,
612
+ M as filterEmpty,
613
+ Le as formatDuraton,
614
+ Ue as genColumnKey,
615
+ T as generateVidoePicture,
616
+ Pe as getBase64,
611
617
  Ce as getBlobUrl,
612
- v as getFileSuffix,
613
- K as getLevelData,
614
- Le as getMaxFloor,
615
- te as getMediaInfos,
616
- Se as getPrefixCls,
617
- k as getRandomNumber,
618
- X as getScroll,
619
- re as getScrollContainer,
620
- ve as getSlot,
621
- Z as getSlotVNode,
622
- he as getSlotsChildren,
623
- Ae as getSlotsProps,
624
- be as getSortIndex,
625
- j as getValueFromObjectByKey,
618
+ A as getFileSuffix,
619
+ ne as getLevelData,
620
+ De as getMaxFloor,
621
+ ie as getMediaInfos,
622
+ Oe as getPrefixCls,
623
+ te as getRandomNumber,
624
+ G as getScroll,
625
+ ue as getScrollContainer,
626
+ K as getSlot,
627
+ ee as getSlotVNode,
628
+ Ae as getSlotsChildren,
629
+ Se as getSlotsProps,
630
+ Ie as getSortIndex,
631
+ F as getValueFromObjectByKey,
626
632
  $e as getVideoCoverPicture,
627
- ee as getVideoFileUrl,
628
- p as globalConfig,
629
- Re as handleCurrentPage,
630
- Ue as handleShowIndex,
631
- je as hanndleField,
632
- F as is,
633
- L as isArray,
634
- U as isBase64,
635
- _ as isBoolean,
636
- ge as isBrowser,
637
- y as isDeepEqualReact,
638
- Q as isEmptyElement,
639
- le as isFunction,
640
- oe as isImg,
641
- ie as isInContainer,
642
- ue as isNil,
643
- ae as isNumber,
644
- g as isObject,
645
- H as isScroll,
646
- m as isServer,
647
- q as isString,
648
- ce as isUrl,
649
- He as isWindowsOs,
650
- fe as merge,
651
- se as nanoid,
652
- ze as off,
653
- me as omitBoolean,
654
- we as omitUndefined,
655
- ye as omitUndefinedAndEmptyArr,
656
- Ve as on,
657
- Ee as runFunction,
658
- de as scrollTo,
659
- xe as slotRender,
660
- pe as throttleByAnimationFrame,
661
- De as treeData
633
+ re as getVideoFileUrl,
634
+ g as globalConfig,
635
+ be as handleCurrentPage,
636
+ Ee as handleShowIndex,
637
+ Fe as hanndleField,
638
+ L as is,
639
+ B as isArray,
640
+ E as isBase64,
641
+ D as isBoolean,
642
+ ye as isBrowser,
643
+ h as isDeepEqualReact,
644
+ k as isEmptyElement,
645
+ ge as isFunction,
646
+ fe as isImg,
647
+ ce as isInContainer,
648
+ ae as isNil,
649
+ pe as isNumber,
650
+ d as isObject,
651
+ q as isScroll,
652
+ w as isServer,
653
+ X as isString,
654
+ se as isUrl,
655
+ We as isWindowsOs,
656
+ le as merge,
657
+ de as nanoid,
658
+ He as off,
659
+ he as omitBoolean,
660
+ xe as omitUndefined,
661
+ ve as omitUndefinedAndEmptyArr,
662
+ ze as on,
663
+ Re as runFunction,
664
+ me as scrollTo,
665
+ V as slotRender,
666
+ we as throttleByAnimationFrame,
667
+ Be as treeData
662
668
  };
@@ -1,5 +1,5 @@
1
- (function(u,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],s):(u=typeof globalThis<"u"?globalThis:u||self,s(u.PorUtils={},u.vue))})(this,function(u,s){"use strict";const g=typeof window>"u";/**
1
+ (function(u,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],l):(u=typeof globalThis<"u"?globalThis:u||self,l(u.PorUtils={},u.vue))})(this,function(u,l){"use strict";const w=typeof window>"u";/**
2
2
  * @vue/shared v3.5.11
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
- **/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const G=e=>{const n=Object.create(null);return r=>n[r]||(n[r]=e(r))},Q=/-(\w)/g,Z=G(e=>e.replace(Q,(n,r)=>r?r.toUpperCase():"")),O=function(e,n){var r;if(g||!e||!n)return"";n=Z(n),n==="float"&&(n="cssFloat");try{const t=e.style[n];if(t)return t;const i=(r=document==null?void 0:document.defaultView)==null?void 0:r.getComputedStyle(e,"");return i?i[n]:""}catch{return e.style[n]}},L=(e,n)=>g?void 0:(n==null?O(e,"overflow"):n?O(e,"overflow-y"):O(e,"overflow-x")).match(/(scroll|auto|overlay)/),k=(e,n)=>{if(g)return;let r=e;for(;r;){if([window,document,document.documentElement].includes(r))return window;if(L(r,n))return r;r=r.parentNode}return r},K=(e,n)=>{if(g||!e||!n)return!1;const r=e.getBoundingClientRect();let t;return[window,document,document.documentElement,null,void 0].includes(n)?t={top:0,right:window.innerWidth,bottom:window.innerHeight,left:0}:t=n.getBoundingClientRect(),r.top<t.bottom&&r.bottom>t.top&&r.right>t.left&&r.left<t.right};function ee(e){return/\w.(png|jpg|jpeg|svg|webp|gif|bmp)$/i.test(e)}const ne=e=>e==null,te=e=>{if(!e||!e.startsWith("http"))return!1;try{return!!new URL(e)}catch{return!1}},re=(...e)=>{const n={},r=e.length;let t,i=0;for(;i<r;i+=1)for(t in e[i])e[i].hasOwnProperty(t)&&(typeof n[t]=="object"&&typeof e[i][t]=="object"&&n[t]!==void 0&&n[t]!==null&&!Array.isArray(n[t])&&!Array.isArray(e[i][t])?n[t]={...n[t],...e[i][t]}:n[t]=e[i][t]);return n};let B=0;const C=(e=21)=>{if(typeof window>"u"||!window.crypto)return(B+=1).toFixed(0);let n="";const r=crypto.getRandomValues(new Uint8Array(e));for(;e--;){const t=63&r[e];n+=t<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t<63?"_":"-"}return n},ie=()=>typeof window>"u"?C():window.crypto&&window.crypto.randomUUID&&typeof crypto.randomUUID=="function"?crypto.randomUUID():C();function U(e,n){if(typeof n!="string"&&!Array.isArray(n))return;const r=Array.isArray(n)?n:n.split(":");let t=e;for(let i=0;i<r.length;i++)if(t&&t.hasOwnProperty(r[i]))t=t[r[i]];else return;return t}const oe=Object.prototype.toString;function R(e,n){return oe.call(e)===`[object ${n}]`}function P(e){return R(e,"Boolean")}function ue(e){return typeof e=="number"}function b(e){return typeof Array.isArray>"u"?Object.prototype.toString.call(e)==="[object Array]":Array.isArray(e)}function m(e){return e!==null&&R(e,"Object")}function N(e){return typeof e=="string"||e instanceof String}function ce(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function x(...e){const n=[];for(let r=0;r<e.length;r++){const t=e[r];if(t){if(N(t))n.push(t);else if(b(t))for(let i=0;i<t.length;i++){const o=x(t[i]);o&&n.push(o)}else if(m(t))for(const i in t)t[i]&&n.push(i)}}return n.filter(r=>r).join(" ")}let M=e=>setTimeout(e,16),V=e=>clearTimeout(e);typeof window<"u"&&"requestAnimationFrame"in window&&(M=e=>window.requestAnimationFrame(e),V=e=>window.cancelAnimationFrame(e));let $=0;const E=new Map;function z(e){E.delete(e)}function F(e,n=1){$+=1;const r=$;function t(i){if(i===0)z(r),e();else{const o=M(()=>{t(i-1)});E.set(r,o)}}return t(n),r}F.cancel=e=>{const n=E.get(e);return z(n),V(n)};function T(e){return e!=null&&e===e.window}function W(e,n){var i;if(typeof window>"u")return 0;const r=n?"scrollTop":"scrollLeft";let t=0;return T(e)?t=e[n?"pageYOffset":"pageXOffset"]:e instanceof Document?t=e.documentElement[r]:e&&(t=e[r]),e&&!T(e)&&typeof t!="number"&&(t=(i=(e.ownerDocument||e).documentElement)==null?void 0:i[r]),t}function fe(e,n,r,t){const i=r-n;return e/=t/2,e<1?i/2*e*e*e+n:i/2*((e-=2)*e*e+2)+n}function le(e,n={}){const{getContainer:r=()=>window,callback:t,duration:i=450}=n,o=r(),c=W(o,!0),f=Date.now(),l=()=>{const a=Date.now()-f,d=fe(a>i?i:a,c,e,i);T(o)?o.scrollTo(window.pageXOffset,d):o instanceof HTMLDocument||o.constructor.name==="HTMLDocument"?o.documentElement.scrollTop=d:o.scrollTop=d,a<i?F(l):typeof t=="function"&&t()};F(l)}function ae(e){let n;const r=i=>()=>{n=null,e(...i)},t=(...i)=>{n==null&&(n=requestAnimationFrame(r(i)))};return t.cancel=()=>cancelAnimationFrame(n),t}const p={videoAllowType:["mp4","webm","ogg"],audioAllowType:["mp3"],imageType:["bmp","png","gif","jpg","jpeg","psd","tif"],videoType:["mp4","swf","rmvb","avi","flv","mpg","rm","mov","asf","3gp","mkv","ts","f4v","webm","m4v","3g2","m3u8"],audioType:["mp3","mpeg","aac","wav","wma","mp2","flac","midi","ra","ape","aac","cda"]};function y(e,n,r,t){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;let i,o,c;if(Array.isArray(e)){if(i=e.length,i!=n.length)return!1;for(o=i;o--!==0;)if(!y(e[o],n[o],r,t))return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(o of e.entries())if(!n.has(o[0]))return!1;for(o of e.entries())if(!y(o[1],n.get(o[0]),r,t))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(o of e.entries())if(!n.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){if(i=e.length,i!=n.length)return!1;for(o=i;o--!==0;)if(e[o]!==n[o])return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString&&e.toString)return e.toString()===n.toString();if(c=Object.keys(e),i=c.length,i!==Object.keys(n).length)return!1;for(o=i;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,c[o]))return!1;for(o=i;o--!==0;){const f=c[o];if(!(r!=null&&r.includes(f))&&!(f==="_owner"&&e.$$typeof)&&!y(e[f],n[f],r,t))return t&&console.log(f),!1}return!0}return e!==e&&n!==n}const se=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"&&!se,ge=e=>{if(e&&e!==!0)return e},me=e=>{const n={};if(Object.keys(e||{}).forEach(r=>{e[r]!==void 0&&(n[r]=e[r])}),!(Object.keys(n).length<1))return n},pe=e=>{const n={};return Object.keys(e||{}).forEach(r=>{var t;Array.isArray(e[r])&&((t=e[r])==null?void 0:t.length)===0||e[r]!==void 0&&(n[r]=e[r])}),n};function I(e){var n;if(!(typeof e!="string"&&!Array.isArray(e)))return Array.isArray(e)?e[e.length-1]:(n=e.split(":"))==null?void 0:n.slice(-1)[0]}function q(e){return e&&(e.type===s.Comment||e.type===s.Fragment&&e.children.length===0||e.type===Text&&e.children.trim()==="")}function we(e,n){var r;return j((r=e[n])==null?void 0:r.call(e))}function j(e=[]){const n=[];return e.forEach(r=>{Array.isArray(r)?n.push(...r):(r==null?void 0:r.type)===s.Fragment?n.push(...j(r.children)):n.push(r)}),n.filter(r=>!q(r))}function ye(e,...n){return typeof e=="function"?e==null?void 0:e(...n):e}function he(e,n,r="default"){const t=I(r);if(t){const i=U(n,r);return i===!1?!1:i===!0?(e==null?void 0:e[t])||i:i||(e==null?void 0:e[t])}}function H(e,n,r="default"){var i,o;const t=I(r);if(t){const c=U(n,r);return c===!1?!1:c===!0?((i=e==null?void 0:e[t])==null?void 0:i.call(e))||c:c||((o=e[t])==null?void 0:o.call(e))}}function ve(e,n,r){const t={};return e.forEach(i=>{const o=I(i);if(o){const c=H(n,r,i);(P(c)||c)&&(t[o]=c)}}),t}const Se=({suffixCls:e,customizePrefixCls:n,isPor:r,className:t})=>{const i=t||(r?"gx-pro":"gx");return n||(e?`${i}-${e}`:i)},Ae=(e,n)=>e?Array.isArray(e)?e.join("-"):e.toString():`${n}`;function Oe(e,{align:n,showIndex:r}){const t=h(e);if(r&&e.length&&e.every(i=>i.dataIndex!=="sortIndex")){const i=e[0];t.unshift({title:"序号",align:n,fixed:i.fixed,width:60,uuid:_().uuid(15),dataIndex:"sortIndex",key:"sortIndex"})}else t.filter(i=>i.dataIndex!=="sortIndex");return t}function Ue(e,...n){return typeof e=="function"?e(...n):e}function h(e){return JSON.parse(JSON.stringify(e))}function Re(e,n){if(m(e)){const{pageSize:r=10,total:t=0}=e;let{current:i=1}=e;return t-n<=r*(i-1)&&(i=i-1),i===0?1:i}return 1}function be(e=[],n,r="children"){function t(i,o){return o.map((c,f)=>{const l=`${i}-${f+1}`;return c[r]&&(c[r]=t(l,c[r])),c.sortIndex=l,c})}return h(e).map((i,o)=>{let c=o;const f=m(n)&&n.current||1,l=m(n)&&n.pageSize||10;return c=f?(f-1)*l+(o+1):o+1,i[r]&&(i[r]=t(`${c}`,i[r])),i.sortIndex=c,i})}function Ee(e,n,r,t){const i=e[r],o=n[r];let c=0;return i<o?c=t===0?-1:0:i>o&&(c=t===0?0:-1),c}function Fe(e){let n=h(e);const r=new Set(n);return n=Array.from(r),n}function Te(e,n){const r=["null","undefined"];let t=!0;return e===0?t=!0:r.includes(e)?t=!1:e||(t=!1),t?{value:e,success:t}:{value:n===""?n:n||"-",success:t}}function Ie(e){let n="";if(e>-1){const r=Math.floor(e/3600),t=Math.floor(e/60)%60,i=Number.parseInt(String(e%60));r<10?n="0"+r+":":n=r+":",t<10&&(n+="0"),n+=t+":",i<10&&(n+="0"),n+=i}return n.split(":")[0]==="00"?`${n.split(":")[1]}:${n.split(":")[2]}`:n}function _(){const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");return{uuid(n,r){const t=e,i=[],o=r||t.length;let c,f;if(n)for(c=0;c<n;c+=1)i[c]=t[Number.parseInt(String(Math.random()*o))];else for(i[8]="-",i[13]="-",i[18]="-",i[23]="-",i[14]="4",c=0;c<36;c+=1)i[c]||(f=Math.random()*16,i[c]=t[c===19?f&&3||8:f]);return i.join("")},uuidFast(){const n=e,r=Array.from({length:36});let t=0,i,o;for(o=0;o<36;o+=1)o===8||o===13||o===18||o===23?r[o]="-":o===14?r[o]="4":(t<=2&&(t=33554432+Math.random()*16777216||0),i=t&&15,t=t>4,r[o]=n[o===19?i&&3||8:i]);return r.join("")},uuidString(){return this.uuidFast().replace(new RegExp("-","g"),"")},uuidCompact(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n=>{const r=Math.random()*16||0;return(n==="x"?r:r&&3||8).toString(16)})}}}function je(e=[]){let n=0;function r(t=[],i){t.forEach(o=>{o.floor=i,i>n&&(n=i),o.children&&o.children.length>0&&r(o.children,i+1)})}return r(e,1),n}function J(e,n="children"){let r=[];return e.forEach(t=>{r.push(t),b(t[n])&&t[n].length>0&&(r=r.concat(J(t[n])))}),r}function De(e,n,r,t,i){n=n||"id",r=r||"parentId",t=t||"children",i=i||0;const o=JSON.parse(JSON.stringify(e));return o.filter(c=>{const f=o.filter(l=>c[n]===l[r||"parentId"]);return f.length>0?c[t||"children"]=f:delete c[t||"children"],c[r||"parentId"]===i})}function Le(e){return URL.createObjectURL(e)}function Be(e){return new Promise((n,r)=>{const t=new FileReader;t.readAsDataURL(e),t.onload=()=>n(t.result),t.onerror=i=>r(i)})}function Ce(e){const n=e.split(","),r=n[0].match(/:(.*?);/)[1],t=atob(n[1]);let i=t.length;const o=new Uint8Array(i);for(;i--;)o[i]=t.charCodeAt(i);return new Blob([o],{type:r})}function Pe(e,n){const r=e.split(","),t=r[0].match(/:(.*?);/)[1],i=atob(r[1]);let o=i.length;const c=new Uint8Array(o);for(;o--;)c[o]=i.charCodeAt(o);return new File([c],n,{type:t})}function Ne(e,n,r){return new window.File([e],n,{type:r})}function X(e=""){const n=e.indexOf("?");return n>0?`${e.substring(0,n)}`:e}function v(e=""){e=X(e);const n=e.lastIndexOf(".");return n>0?`${e.substring(n).split("?")[0]}`.split(".")[1]:""}function w(e,n){if(n)return n;if(!e||e==="data:")return"4";let r="4";return S(e)?e.includes("data:image/")?r="png":e.includes("data:video/")?r="mp4":e.includes("data:audio/")&&(r="mp3"):e instanceof Blob?(e=String(e),e.includes("image")?r="png":e.includes("video")?r="mp4":e.includes("audio")&&(r="mp3")):r=v(e).toLowerCase(),p.imageType.includes(r)?"1":p.videoType.includes(r)?"3":p.audioType.includes(r)?"2":"4"}function Y(e){const{url:n="",fileType:r="1"}=e;let t="";return n instanceof File?t=URL.createObjectURL(n):S(n)?t=n:n instanceof Blob?t=URL.createObjectURL(n):(n.includes("https")||n.includes("http"))&&(t=n),new Promise(i=>{let o;r==="1"?(o=document.createElement("img"),o.src=t):r==="2"?(o=document.createElement("audio"),o.src=t):r==="3"&&(o=document.createElement("video"),o.src=t),r==="1"?o.onload=function(){i({play:!0,width:o.width||0,height:o.height||0}),o=null}:o.oncanplay=function(){i({play:!0,duration:o.duration,width:(o==null?void 0:o.videoWidth)||0,height:(o==null?void 0:o.videoHeight)||0}),o=null},o.onerror=function(){i({play:!1}),o=null}})}async function xe(e){const{url:n="",currentTime:r,videoSuffix:t="",vidoeAllowPlay:i=!1}=e;let o="",c=t,f="1",l;return n instanceof File?(o=URL.createObjectURL(n),c=v(n.name),f=w(n.name)):n instanceof Blob?(o=URL.createObjectURL(n),f=w(n)):S(n)?(o=n,f=w(n)):(n.includes("https")||n.includes("http"))&&(o=n,c=v(n),f=w(n)),(c?p.videoAllowType.includes(c.toLowerCase()):!1)?i?D(o,r):(l=await Y({url:o,fileType:f}),l.play?D(o,r):new Promise(a=>{a("")})):new Promise(a=>{a("")})}async function D(e,n=0){return new Promise(r=>{let t=document.createElement("video");t.controls=!0,t.muted=!0,t.setAttribute("src",e),t.setAttribute("muted",String(!0)),t.setAttribute("crossorigin","anonymous"),t.setAttribute("autoplay",String(!0)),t&&t.addEventListener("loadeddata",async function(){let i;t==null||t.addEventListener("seeked",async function(){i&&i()});const o=(t==null?void 0:t.duration)||0;for(;n<o;){t&&(t.currentTime=n),await new Promise(ze=>i=ze);const c=document.createElement("canvas"),f=.8,l=c.getContext("2d"),A=(t==null?void 0:t.videoWidth)||0*f,a=(t==null?void 0:t.videoHeight)||0*f,d=0;c.width=(t==null?void 0:t.videoWidth)||0*f,c.height=(t==null?void 0:t.videoHeight)||0*f,l.drawImage(t,0,0,A+d,a+d),t=null,r(A===0||a===0?"":c.toDataURL("image/png",1))}})})}function S(e=""){return!!(e&&["data:image/","data:video/","data:audio/"].find(r=>e.includes(r)))}function Me(e,n,r,t=!1){e&&n&&r&&e.addEventListener(n,r,t)}function Ve(e,n,r,t=!1){e&&n&&r&&e.removeEventListener(n,r,t)}function $e(){return/windows|win32/i.test(navigator.userAgent)}u.arrayRepeat=Fe,u.blobToDataURL=Ne,u.checkFileType=w,u.classNames=x,u.compareArray=Ee,u.dataURLtoBlob=Ce,u.dataURLtoFile=Pe,u.deepCopy=h,u.filterEmpty=j,u.formatDuraton=Ie,u.genColumnKey=Ae,u.generateVidoePicture=D,u.getBase64=Be,u.getBlobUrl=Le,u.getFileSuffix=v,u.getLevelData=J,u.getMaxFloor=je,u.getMediaInfos=Y,u.getPrefixCls=Se,u.getRandomNumber=_,u.getScroll=W,u.getScrollContainer=k,u.getSlot=he,u.getSlotVNode=H,u.getSlotsChildren=we,u.getSlotsProps=ve,u.getSortIndex=be,u.getValueFromObjectByKey=U,u.getVideoCoverPicture=xe,u.getVideoFileUrl=X,u.globalConfig=p,u.handleCurrentPage=Re,u.handleShowIndex=Oe,u.hanndleField=Te,u.is=R,u.isArray=b,u.isBase64=S,u.isBoolean=P,u.isBrowser=de,u.isDeepEqualReact=y,u.isEmptyElement=q,u.isFunction=ce,u.isImg=ee,u.isInContainer=K,u.isNil=ne,u.isNumber=ue,u.isObject=m,u.isScroll=L,u.isServer=g,u.isString=N,u.isUrl=te,u.isWindowsOs=$e,u.merge=re,u.nanoid=ie,u.off=Ve,u.omitBoolean=ge,u.omitUndefined=me,u.omitUndefinedAndEmptyArr=pe,u.on=Me,u.runFunction=Ue,u.scrollTo=le,u.slotRender=ye,u.throttleByAnimationFrame=ae,u.treeData=De,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
5
+ **/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const Z=e=>{const n=Object.create(null);return r=>n[r]||(n[r]=e(r))},k=/-(\w)/g,K=Z(e=>e.replace(k,(n,r)=>r?r.toUpperCase():"")),O=function(e,n){var r;if(w||!e||!n)return"";n=K(n),n==="float"&&(n="cssFloat");try{const t=e.style[n];if(t)return t;const i=(r=document==null?void 0:document.defaultView)==null?void 0:r.getComputedStyle(e,"");return i?i[n]:""}catch{return e.style[n]}},C=(e,n)=>w?void 0:(n==null?O(e,"overflow"):n?O(e,"overflow-y"):O(e,"overflow-x")).match(/(scroll|auto|overlay)/),ee=(e,n)=>{if(w)return;let r=e;for(;r;){if([window,document,document.documentElement].includes(r))return window;if(C(r,n))return r;r=r.parentNode}return r},ne=(e,n)=>{if(w||!e||!n)return!1;const r=e.getBoundingClientRect();let t;return[window,document,document.documentElement,null,void 0].includes(n)?t={top:0,right:window.innerWidth,bottom:window.innerHeight,left:0}:t=n.getBoundingClientRect(),r.top<t.bottom&&r.bottom>t.top&&r.right>t.left&&r.left<t.right};function te(e){return/\w.(png|jpg|jpeg|svg|webp|gif|bmp)$/i.test(e)}const re=e=>e==null,ie=e=>{if(!e||!e.startsWith("http"))return!1;try{return!!new URL(e)}catch{return!1}},oe=(...e)=>{const n={},r=e.length;let t,i=0;for(;i<r;i+=1)for(t in e[i])e[i].hasOwnProperty(t)&&(typeof n[t]=="object"&&typeof e[i][t]=="object"&&n[t]!==void 0&&n[t]!==null&&!Array.isArray(n[t])&&!Array.isArray(e[i][t])?n[t]={...n[t],...e[i][t]}:n[t]=e[i][t]);return n};let N=0;const P=(e=21)=>{if(typeof window>"u"||!window.crypto)return(N+=1).toFixed(0);let n="";const r=crypto.getRandomValues(new Uint8Array(e));for(;e--;){const t=63&r[e];n+=t<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t<63?"_":"-"}return n},ue=()=>typeof window>"u"?P():window.crypto&&window.crypto.randomUUID&&typeof crypto.randomUUID=="function"?crypto.randomUUID():P();function U(e,n){if(typeof n!="string"&&!Array.isArray(n))return;const r=Array.isArray(n)?n:n.split(":");let t=e;for(let i=0;i<r.length;i++)if(t&&t.hasOwnProperty(r[i]))t=t[r[i]];else return;return t}const ce=Object.prototype.toString;function R(e,n){return ce.call(e)===`[object ${n}]`}function b(e){return R(e,"Boolean")}function fe(e){return typeof e=="number"}function E(e){return typeof Array.isArray>"u"?Object.prototype.toString.call(e)==="[object Array]":Array.isArray(e)}function g(e){return e!==null&&R(e,"Object")}function V(e){return typeof e=="string"||e instanceof String}function ae(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function x(...e){const n=[];for(let r=0;r<e.length;r++){const t=e[r];if(t){if(V(t))n.push(t);else if(E(t))for(let i=0;i<t.length;i++){const o=x(t[i]);o&&n.push(o)}else if(g(t))for(const i in t)t[i]&&n.push(i)}}return n.filter(r=>r).join(" ")}let M=e=>setTimeout(e,16),$=e=>clearTimeout(e);typeof window<"u"&&"requestAnimationFrame"in window&&(M=e=>window.requestAnimationFrame(e),$=e=>window.cancelAnimationFrame(e));let z=0;const F=new Map;function W(e){F.delete(e)}function T(e,n=1){z+=1;const r=z;function t(i){if(i===0)W(r),e();else{const o=M(()=>{t(i-1)});F.set(r,o)}}return t(n),r}T.cancel=e=>{const n=F.get(e);return W(n),$(n)};function I(e){return e!=null&&e===e.window}function q(e,n){var i;if(typeof window>"u")return 0;const r=n?"scrollTop":"scrollLeft";let t=0;return I(e)?t=e[n?"pageYOffset":"pageXOffset"]:e instanceof Document?t=e.documentElement[r]:e&&(t=e[r]),e&&!I(e)&&typeof t!="number"&&(t=(i=(e.ownerDocument||e).documentElement)==null?void 0:i[r]),t}function le(e,n,r,t){const i=r-n;return e/=t/2,e<1?i/2*e*e*e+n:i/2*((e-=2)*e*e+2)+n}function se(e,n={}){const{getContainer:r=()=>window,callback:t,duration:i=450}=n,o=r(),c=q(o,!0),f=Date.now(),a=()=>{const d=Date.now()-f,m=le(d>i?i:d,c,e,i);I(o)?o.scrollTo(window.pageXOffset,m):o instanceof HTMLDocument||o.constructor.name==="HTMLDocument"?o.documentElement.scrollTop=m:o.scrollTop=m,d<i?T(a):typeof t=="function"&&t()};T(a)}function de(e){let n;const r=i=>()=>{n=null,e(...i)},t=(...i)=>{n==null&&(n=requestAnimationFrame(r(i)))};return t.cancel=()=>cancelAnimationFrame(n),t}const y={videoAllowType:["mp4","webm","ogg"],audioAllowType:["mp3"],imageType:["bmp","png","gif","jpg","jpeg","psd","tif"],videoType:["mp4","swf","rmvb","avi","flv","mpg","rm","mov","asf","3gp","mkv","ts","f4v","webm","m4v","3g2","m3u8"],audioType:["mp3","mpeg","aac","wav","wma","mp2","flac","midi","ra","ape","aac","cda"]};function h(e,n,r,t){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;let i,o,c;if(Array.isArray(e)){if(i=e.length,i!=n.length)return!1;for(o=i;o--!==0;)if(!h(e[o],n[o],r,t))return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(o of e.entries())if(!n.has(o[0]))return!1;for(o of e.entries())if(!h(o[1],n.get(o[0]),r,t))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(o of e.entries())if(!n.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){if(i=e.length,i!=n.length)return!1;for(o=i;o--!==0;)if(e[o]!==n[o])return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString&&e.toString)return e.toString()===n.toString();if(c=Object.keys(e),i=c.length,i!==Object.keys(n).length)return!1;for(o=i;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,c[o]))return!1;for(o=i;o--!==0;){const f=c[o];if(!(r!=null&&r.includes(f))&&!(f==="_owner"&&e.$$typeof)&&!h(e[f],n[f],r,t))return t&&console.log(f),!1}return!0}return e!==e&&n!==n}const ge=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,me=()=>process.env.NODE_ENV==="TEST"?!0:typeof window<"u"&&typeof window.document<"u"&&typeof window.matchMedia<"u"&&!ge,we=e=>{if(e&&e!==!0)return e},ye=e=>{const n={};if(Object.keys(e||{}).forEach(r=>{e[r]!==void 0&&(n[r]=e[r])}),!(Object.keys(n).length<1))return n},pe=e=>{const n={};return Object.keys(e||{}).forEach(r=>{var t;Array.isArray(e[r])&&((t=e[r])==null?void 0:t.length)===0||e[r]!==void 0&&(n[r]=e[r])}),n};function j(e){var n;if(!(typeof e!="string"&&!Array.isArray(e)))return Array.isArray(e)?e[e.length-1]:(n=e.split(":"))==null?void 0:n.slice(-1)[0]}function H(e){return e&&(e.type===l.Comment||e.type===l.Fragment&&e.children.length===0||e.type===Text&&e.children.trim()==="")}function he(e,n){var r;return B((r=e[n])==null?void 0:r.call(e))}function B(e=[]){const n=[];return e.forEach(r=>{Array.isArray(r)?n.push(...r):(r==null?void 0:r.type)===l.Fragment?n.push(...B(r.children)):n.push(r)}),n.filter(r=>!H(r))}function D(e,...n){return typeof e=="function"?e==null?void 0:e(...n):e}function _(e,n,r="default",t){const i=j(r);if(i){let o;const c=U(n,r);return c===!1?o=!1:c===!0?o=e==null?void 0:e[i]:g(c)?l.isVNode(c)?o=c:o=e==null?void 0:e[i]:o=c||(e==null?void 0:e[i]),l.isVNode(o)?o:t?D(o):o}}function J(e,n,r="default",t){var o,c,f;const i=j(r);if(i){let a;const s=U(n,r);return s===!1?a=!1:s===!0?a=(o=e==null?void 0:e[i])==null?void 0:o.call(e,t):g(s)?l.isVNode(s)?a=s:a=(c=e==null?void 0:e[i])==null?void 0:c.call(e,t):a=s||((f=e==null?void 0:e[i])==null?void 0:f.call(e,t)),l.isVNode(a)?a:D(a,t)}}function Se(e,n,r,t){const i={};return e.forEach(o=>{const c=j(o);if(c){const f=t!=null&&t.render?J(n,r,o,t==null?void 0:t.params):_(n,r,o);(b(f)||f)&&(i[c]=f)}}),i}const ve=({suffixCls:e,customizePrefixCls:n,isPor:r,className:t})=>{const i=t||(r?"gx-pro":"gx");return n||(e?`${i}-${e}`:i)},Ae=(e,n)=>e?Array.isArray(e)?e.join("-"):e.toString():`${n}`;function Oe(e,{align:n,showIndex:r}){const t=S(e);if(r&&e.length&&e.every(i=>i.dataIndex!=="sortIndex")){const i=e[0];t.unshift({title:"序号",align:n,fixed:i.fixed,width:60,uuid:X().uuid(15),dataIndex:"sortIndex",key:"sortIndex"})}else t.filter(i=>i.dataIndex!=="sortIndex");return t}function Ue(e,...n){return typeof e=="function"?e(...n):e}function S(e){return JSON.parse(JSON.stringify(e))}function Re(e,n){if(g(e)){const{pageSize:r=10,total:t=0}=e;let{current:i=1}=e;return t-n<=r*(i-1)&&(i=i-1),i===0?1:i}return 1}function be(e=[],n,r="children"){function t(i,o){return o.map((c,f)=>{const a=`${i}-${f+1}`;return c[r]&&(c[r]=t(a,c[r])),c.sortIndex=a,c})}return S(e).map((i,o)=>{let c=o;const f=g(n)&&n.current||1,a=g(n)&&n.pageSize||10;return c=f?(f-1)*a+(o+1):o+1,i[r]&&(i[r]=t(`${c}`,i[r])),i.sortIndex=c,i})}function Ee(e,n,r,t){const i=e[r],o=n[r];let c=0;return i<o?c=t===0?-1:0:i>o&&(c=t===0?0:-1),c}function Fe(e){let n=S(e);const r=new Set(n);return n=Array.from(r),n}function Te(e,n){const r=["null","undefined"];let t=!0;return e===0?t=!0:r.includes(e)?t=!1:e||(t=!1),t?{value:e,success:t}:{value:n===""?n:n||"-",success:t}}function Ie(e){let n="";if(e>-1){const r=Math.floor(e/3600),t=Math.floor(e/60)%60,i=Number.parseInt(String(e%60));r<10?n="0"+r+":":n=r+":",t<10&&(n+="0"),n+=t+":",i<10&&(n+="0"),n+=i}return n.split(":")[0]==="00"?`${n.split(":")[1]}:${n.split(":")[2]}`:n}function X(){const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");return{uuid(n,r){const t=e,i=[],o=r||t.length;let c,f;if(n)for(c=0;c<n;c+=1)i[c]=t[Number.parseInt(String(Math.random()*o))];else for(i[8]="-",i[13]="-",i[18]="-",i[23]="-",i[14]="4",c=0;c<36;c+=1)i[c]||(f=Math.random()*16,i[c]=t[c===19?f&&3||8:f]);return i.join("")},uuidFast(){const n=e,r=Array.from({length:36});let t=0,i,o;for(o=0;o<36;o+=1)o===8||o===13||o===18||o===23?r[o]="-":o===14?r[o]="4":(t<=2&&(t=33554432+Math.random()*16777216||0),i=t&&15,t=t>4,r[o]=n[o===19?i&&3||8:i]);return r.join("")},uuidString(){return this.uuidFast().replace(new RegExp("-","g"),"")},uuidCompact(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n=>{const r=Math.random()*16||0;return(n==="x"?r:r&&3||8).toString(16)})}}}function je(e=[]){let n=0;function r(t=[],i){t.forEach(o=>{o.floor=i,i>n&&(n=i),o.children&&o.children.length>0&&r(o.children,i+1)})}return r(e,1),n}function Y(e,n="children"){let r=[];return e.forEach(t=>{r.push(t),E(t[n])&&t[n].length>0&&(r=r.concat(Y(t[n])))}),r}function Be(e,n,r,t,i){n=n||"id",r=r||"parentId",t=t||"children",i=i||0;const o=JSON.parse(JSON.stringify(e));return o.filter(c=>{const f=o.filter(a=>c[n]===a[r||"parentId"]);return f.length>0?c[t||"children"]=f:delete c[t||"children"],c[r||"parentId"]===i})}function De(e){return URL.createObjectURL(e)}function Le(e){return new Promise((n,r)=>{const t=new FileReader;t.readAsDataURL(e),t.onload=()=>n(t.result),t.onerror=i=>r(i)})}function Ce(e){const n=e.split(","),r=n[0].match(/:(.*?);/)[1],t=atob(n[1]);let i=t.length;const o=new Uint8Array(i);for(;i--;)o[i]=t.charCodeAt(i);return new Blob([o],{type:r})}function Ne(e,n){const r=e.split(","),t=r[0].match(/:(.*?);/)[1],i=atob(r[1]);let o=i.length;const c=new Uint8Array(o);for(;o--;)c[o]=i.charCodeAt(o);return new File([c],n,{type:t})}function Pe(e,n,r){return new window.File([e],n,{type:r})}function G(e=""){const n=e.indexOf("?");return n>0?`${e.substring(0,n)}`:e}function v(e=""){e=G(e);const n=e.lastIndexOf(".");return n>0?`${e.substring(n).split("?")[0]}`.split(".")[1]:""}function p(e,n){if(n)return n;if(!e||e==="data:")return"4";let r="4";return A(e)?e.includes("data:image/")?r="png":e.includes("data:video/")?r="mp4":e.includes("data:audio/")&&(r="mp3"):e instanceof Blob?(e=String(e),e.includes("image")?r="png":e.includes("video")?r="mp4":e.includes("audio")&&(r="mp3")):r=v(e).toLowerCase(),y.imageType.includes(r)?"1":y.videoType.includes(r)?"3":y.audioType.includes(r)?"2":"4"}function Q(e){const{url:n="",fileType:r="1"}=e;let t="";return n instanceof File?t=URL.createObjectURL(n):A(n)?t=n:n instanceof Blob?t=URL.createObjectURL(n):(n.includes("https")||n.includes("http"))&&(t=n),new Promise(i=>{let o;r==="1"?(o=document.createElement("img"),o.src=t):r==="2"?(o=document.createElement("audio"),o.src=t):r==="3"&&(o=document.createElement("video"),o.src=t),r==="1"?o.onload=function(){i({play:!0,width:o.width||0,height:o.height||0}),o=null}:o.oncanplay=function(){i({play:!0,duration:o.duration,width:(o==null?void 0:o.videoWidth)||0,height:(o==null?void 0:o.videoHeight)||0}),o=null},o.onerror=function(){i({play:!1}),o=null}})}async function Ve(e){const{url:n="",currentTime:r,videoSuffix:t="",vidoeAllowPlay:i=!1}=e;let o="",c=t,f="1",a;return n instanceof File?(o=URL.createObjectURL(n),c=v(n.name),f=p(n.name)):n instanceof Blob?(o=URL.createObjectURL(n),f=p(n)):A(n)?(o=n,f=p(n)):(n.includes("https")||n.includes("http"))&&(o=n,c=v(n),f=p(n)),(c?y.videoAllowType.includes(c.toLowerCase()):!1)?i?L(o,r):(a=await Q({url:o,fileType:f}),a.play?L(o,r):new Promise(d=>{d("")})):new Promise(d=>{d("")})}async function L(e,n=0){return new Promise(r=>{let t=document.createElement("video");t.controls=!0,t.muted=!0,t.setAttribute("src",e),t.setAttribute("muted",String(!0)),t.setAttribute("crossorigin","anonymous"),t.setAttribute("autoplay",String(!0)),t&&t.addEventListener("loadeddata",async function(){let i;t==null||t.addEventListener("seeked",async function(){i&&i()});const o=(t==null?void 0:t.duration)||0;for(;n<o;){t&&(t.currentTime=n),await new Promise(We=>i=We);const c=document.createElement("canvas"),f=.8,a=c.getContext("2d"),s=(t==null?void 0:t.videoWidth)||0*f,d=(t==null?void 0:t.videoHeight)||0*f,m=0;c.width=(t==null?void 0:t.videoWidth)||0*f,c.height=(t==null?void 0:t.videoHeight)||0*f,a.drawImage(t,0,0,s+m,d+m),t=null,r(s===0||d===0?"":c.toDataURL("image/png",1))}})})}function A(e=""){return!!(e&&["data:image/","data:video/","data:audio/"].find(r=>e.includes(r)))}function xe(e,n,r,t=!1){e&&n&&r&&e.addEventListener(n,r,t)}function Me(e,n,r,t=!1){e&&n&&r&&e.removeEventListener(n,r,t)}function $e(){return/windows|win32/i.test(navigator.userAgent)}function ze(e){return b(e)?e:!!e}u.arrayRepeat=Fe,u.blobToDataURL=Pe,u.checkFileType=p,u.classNames=x,u.compareArray=Ee,u.convertValueBoolean=ze,u.dataURLtoBlob=Ce,u.dataURLtoFile=Ne,u.deepCopy=S,u.filterEmpty=B,u.formatDuraton=Ie,u.genColumnKey=Ae,u.generateVidoePicture=L,u.getBase64=Le,u.getBlobUrl=De,u.getFileSuffix=v,u.getLevelData=Y,u.getMaxFloor=je,u.getMediaInfos=Q,u.getPrefixCls=ve,u.getRandomNumber=X,u.getScroll=q,u.getScrollContainer=ee,u.getSlot=_,u.getSlotVNode=J,u.getSlotsChildren=he,u.getSlotsProps=Se,u.getSortIndex=be,u.getValueFromObjectByKey=U,u.getVideoCoverPicture=Ve,u.getVideoFileUrl=G,u.globalConfig=y,u.handleCurrentPage=Re,u.handleShowIndex=Oe,u.hanndleField=Te,u.is=R,u.isArray=E,u.isBase64=A,u.isBoolean=b,u.isBrowser=me,u.isDeepEqualReact=h,u.isEmptyElement=H,u.isFunction=ae,u.isImg=te,u.isInContainer=ne,u.isNil=re,u.isNumber=fe,u.isObject=g,u.isScroll=C,u.isServer=w,u.isString=V,u.isUrl=ie,u.isWindowsOs=$e,u.merge=oe,u.nanoid=ue,u.off=Me,u.omitBoolean=we,u.omitUndefined=ye,u.omitUndefinedAndEmptyArr=pe,u.on=xe,u.runFunction=Ue,u.scrollTo=se,u.slotRender=D,u.throttleByAnimationFrame=de,u.treeData=Be,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
@@ -1,7 +1,7 @@
1
1
  import { VNode } from 'vue';
2
2
  import type { CustomRender, WithFalse } from '../typings';
3
3
  export declare function isEmptyElement(c: any): any;
4
- export declare function getSlotsChildren<T extends Readonly<Record<string, any>>, K extends VNode = VNode>(slots: T, key: keyof T): K[];
4
+ export declare function getSlotsChildren<T extends Readonly<Record<string, any>>>(slots: T, key: keyof T): VNode[];
5
5
  export declare function filterEmpty(children?: VNode[]): VNode<import("vue").RendererNode, import("vue").RendererElement, {
6
6
  [key: string]: any;
7
7
  }>[];
@@ -10,14 +10,21 @@ export declare function slotRender(slot: any, ...arg: any): any;
10
10
  * @Author gx12358
11
11
  * @DateTime 2024/2/2
12
12
  * @lastTime 2024/2/2
13
- * @description () => T
13
+ * @description () => CustomRender
14
14
  */
15
- export declare function getSlot<T, K extends Record<string, unknown> = Record<string, unknown>>(slots: Readonly<Record<string, any>>, props: K, keys?: string | string[]): T;
15
+ export declare function getSlot<T = undefined, R extends boolean | undefined = undefined>(slots: Readonly<Record<string, any>>, props: Record<string, unknown>, keys?: string | string[], render?: R): R extends true ? VNode : (T extends undefined ? WithFalse<CustomRender> : T);
16
16
  /**
17
17
  * @Author gx12358
18
18
  * @DateTime 2024/2/2
19
19
  * @lastTime 2024/2/2
20
- * @description () => false | VNode | VNode[]
20
+ * @description () => WithFalse<VNode | VNode[]>
21
21
  */
22
- export declare function getSlotVNode<T, K extends Record<string, unknown> = Record<string, unknown>>(slots: Readonly<Record<string, any>>, props: K, keys?: string | string[]): T;
23
- export declare function getSlotsProps<T extends string, K = WithFalse<CustomRender>>(names: string[], slots: Readonly<Record<string, any>>, props: Record<string, unknown>): Record<T, K>;
22
+ export declare function getSlotVNode<T = undefined>(slots: Readonly<Record<string, any>>, props: Record<string, unknown>, keys: string | string[], options?: any): T extends undefined ? WithFalse<VNode | VNode[]> : T;
23
+ export declare function getSlotsProps<T extends string, K extends undefined = undefined>(names: string[], slots: Readonly<Record<string, any>>, props: Record<string, unknown>, options?: {
24
+ render?: true;
25
+ params?: any;
26
+ }): K extends undefined ? Record<T, WithFalse<VNode | VNode[]>> : K;
27
+ export declare function getSlotsProps<T extends string, K extends undefined = undefined>(names: string[], slots: Readonly<Record<string, any>>, props: Record<string, unknown>, options?: {
28
+ render?: false;
29
+ params?: any;
30
+ }): K extends undefined ? Record<T, any> : K;
@@ -4,7 +4,7 @@ export type Nullable<T> = T | null;
4
4
  export type WithFalse<T> = T | false;
5
5
  export type RecordType = Record<string, any>;
6
6
  export type VueNode = VNodeChild | JSX.Element;
7
- export type CustomRender = Slot | VNodeChild | VNode | ((...props: any[]) => Slot) | ((...props: any[]) => VNode) | ((...args: any[]) => VNode) | VNode[] | JSX.Element | string | null | undefined;
7
+ export type CustomRender = Slot | VNodeChild | VNode | ((...props: any[]) => VNode) | ((...props: any[]) => VNode[]) | VNode[] | JSX.Element | string | null | undefined;
8
8
  export type Breakpoint = 'xxl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs';
9
9
  export type SizeType = 'small' | 'middle' | 'large' | undefined;
10
10
  export type AlignType = 'left' | 'center' | 'right';
@@ -13,7 +13,7 @@ export type BasicTablePageConfig = {
13
13
  pageSize: number;
14
14
  total?: number;
15
15
  } | boolean;
16
- export type ProColumn<T = any> = {
16
+ export type ProColumn<T extends undefined> = T extends undefined ? {
17
17
  title?: string;
18
18
  align?: AlignType;
19
19
  fixed?: boolean;
@@ -21,12 +21,21 @@ export type ProColumn<T = any> = {
21
21
  key: string;
22
22
  dataIndex: string;
23
23
  width?: number;
24
- } & T;
25
- export interface MaterialInfo {
26
- play?: boolean;
24
+ } : {
25
+ title?: string;
26
+ align?: AlignType;
27
+ fixed?: boolean;
28
+ uuid?: string;
29
+ key: string;
30
+ dataIndex: string;
27
31
  width?: number;
28
- height?: number;
29
- duration?: number;
32
+ } & T;
33
+ export interface MaterialOptions {
34
+ play: boolean;
35
+ width: number;
36
+ height: number;
37
+ duration: number;
38
+ size: string;
30
39
  }
31
40
  export type OmitUndefined<T> = {
32
41
  [P in keyof T]: NonNullable<T[P]>;
@@ -215,3 +215,4 @@ export declare function off(element: HTMLElement | Document | Window | null, eve
215
215
  * @returns {boolean} 如果当前环境是Windows OS,返回true,否则返回false。
216
216
  */
217
217
  export declare function isWindowsOs(): boolean;
218
+ export declare function convertValueBoolean(value: any): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gx-design-vue/pro-utils",
3
- "version": "0.2.0-beta.36",
3
+ "version": "0.2.0-beta.38",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "vite build",