@gx-design-vue/pro-utils 0.2.0-beta.59 → 0.2.0-beta.60
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 +81 -73
- package/dist/pro-utils.umd.cjs +1 -1
- package/dist/utils/index.d.ts +2 -1
- package/package.json +1 -1
package/dist/pro-utils.js
CHANGED
|
@@ -50,10 +50,10 @@ function Z(e, t) {
|
|
|
50
50
|
function m(e) {
|
|
51
51
|
return typeof e == "boolean";
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function d(e) {
|
|
54
54
|
return typeof e == "number";
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function a(e) {
|
|
57
57
|
return typeof Array.isArray > "u" ? Object.prototype.toString.call(e) === "[object Array]" : Array.isArray(e);
|
|
58
58
|
}
|
|
59
59
|
function h(e) {
|
|
@@ -90,7 +90,7 @@ function G(...e) {
|
|
|
90
90
|
if (r) {
|
|
91
91
|
if (X(r))
|
|
92
92
|
t.push(r);
|
|
93
|
-
else if (
|
|
93
|
+
else if (a(r))
|
|
94
94
|
for (let i = 0; i < r.length; i++) {
|
|
95
95
|
const o = G(r[i]);
|
|
96
96
|
o && t.push(o);
|
|
@@ -169,14 +169,14 @@ function K(e, t) {
|
|
|
169
169
|
}
|
|
170
170
|
let W = (e) => setTimeout(e, 16), b = (e) => clearTimeout(e);
|
|
171
171
|
typeof window < "u" && "requestAnimationFrame" in window && (W = (e) => window.requestAnimationFrame(e), b = (e) => window.cancelAnimationFrame(e));
|
|
172
|
-
let
|
|
172
|
+
let N = 0;
|
|
173
173
|
const U = /* @__PURE__ */ new Map();
|
|
174
174
|
function z(e) {
|
|
175
175
|
U.delete(e);
|
|
176
176
|
}
|
|
177
177
|
function R(e, t = 1) {
|
|
178
|
-
|
|
179
|
-
const n =
|
|
178
|
+
N += 1;
|
|
179
|
+
const n = N;
|
|
180
180
|
function r(i) {
|
|
181
181
|
if (i === 0)
|
|
182
182
|
z(n), e();
|
|
@@ -372,7 +372,7 @@ const ie = (e) => e == null, Te = (e) => {
|
|
|
372
372
|
return !1;
|
|
373
373
|
}
|
|
374
374
|
};
|
|
375
|
-
function
|
|
375
|
+
function P(e) {
|
|
376
376
|
if (!e || typeof e != "object")
|
|
377
377
|
return !1;
|
|
378
378
|
const t = Object.getPrototypeOf(e);
|
|
@@ -393,14 +393,14 @@ function w(e, t, n) {
|
|
|
393
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
394
|
for (let c = 0; c < o.length; c++) {
|
|
395
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) :
|
|
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
397
|
}
|
|
398
398
|
return e;
|
|
399
399
|
}
|
|
400
|
-
let
|
|
401
|
-
const
|
|
400
|
+
let F = 0;
|
|
401
|
+
const L = (e = 21) => {
|
|
402
402
|
if (typeof window > "u" || !window.crypto)
|
|
403
|
-
return (
|
|
403
|
+
return (F += 1).toFixed(0);
|
|
404
404
|
let t = "";
|
|
405
405
|
const n = crypto.getRandomValues(new Uint8Array(e));
|
|
406
406
|
for (; e--; ) {
|
|
@@ -408,16 +408,16 @@ const N = (e = 21) => {
|
|
|
408
408
|
t += r < 36 ? r.toString(36) : r < 62 ? (r - 26).toString(36).toUpperCase() : r < 63 ? "_" : "-";
|
|
409
409
|
}
|
|
410
410
|
return t;
|
|
411
|
-
}, De = () => typeof window > "u" ?
|
|
411
|
+
}, De = () => typeof window > "u" ? L() : window.crypto && window.crypto.randomUUID && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : L(), Be = (e) => {
|
|
412
412
|
if (e && e !== !0)
|
|
413
413
|
return e;
|
|
414
|
-
},
|
|
414
|
+
}, Ne = (e) => {
|
|
415
415
|
const t = {};
|
|
416
416
|
if (Object.keys(e || {}).forEach((n) => {
|
|
417
417
|
e[n] !== void 0 && (t[n] = e[n]);
|
|
418
418
|
}), !(Object.keys(t).length < 1))
|
|
419
419
|
return t;
|
|
420
|
-
},
|
|
420
|
+
}, Pe = (e) => {
|
|
421
421
|
const t = {};
|
|
422
422
|
return Object.keys(e || {}).forEach((n) => {
|
|
423
423
|
var r;
|
|
@@ -432,7 +432,7 @@ function D(e) {
|
|
|
432
432
|
function oe(e) {
|
|
433
433
|
return e && (e.type === J || e.type === _ && e.children.length === 0 || e.type === Text && e.children.trim() === "");
|
|
434
434
|
}
|
|
435
|
-
function
|
|
435
|
+
function Fe(e, t) {
|
|
436
436
|
var n;
|
|
437
437
|
return H((n = e[t]) == null ? void 0 : n.call(e));
|
|
438
438
|
}
|
|
@@ -462,7 +462,7 @@ function ce(e, t, n = "default", r) {
|
|
|
462
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
463
|
}
|
|
464
464
|
}
|
|
465
|
-
function
|
|
465
|
+
function Le(e, t, n, r) {
|
|
466
466
|
const i = {};
|
|
467
467
|
return e.forEach((o) => {
|
|
468
468
|
const c = D(o);
|
|
@@ -566,7 +566,7 @@ function Me(e) {
|
|
|
566
566
|
const $e = ({ suffixCls: e, customizePrefixCls: t, isPor: n, className: r }) => {
|
|
567
567
|
const i = r || (n ? "gx-pro" : "gx");
|
|
568
568
|
return t || (e ? `${i}-${e}` : i);
|
|
569
|
-
}, _e = (e, t) => e ?
|
|
569
|
+
}, _e = (e, t) => e ? a(e) ? e.join("-") : e.toString() : `${t || 0}`;
|
|
570
570
|
function Ve(e, { align: t, showIndex: n }) {
|
|
571
571
|
const r = O(e);
|
|
572
572
|
if (n && e.length && e.every((i) => i.dataIndex !== "sortIndex")) {
|
|
@@ -611,13 +611,13 @@ function He(e = [], t, n = "children") {
|
|
|
611
611
|
});
|
|
612
612
|
}
|
|
613
613
|
function qe(e, t) {
|
|
614
|
-
return
|
|
615
|
-
if (
|
|
614
|
+
return a(e) ? e == null ? void 0 : e.filter((n, r) => {
|
|
615
|
+
if (d(t))
|
|
616
616
|
return r <= t - 1;
|
|
617
|
-
if (
|
|
617
|
+
if (a(t) && t.length === 2) {
|
|
618
618
|
const i = t[0] - 1, o = t[1] ? t[1] - 1 : e.length - 1;
|
|
619
619
|
return r <= o && r >= i;
|
|
620
|
-
} else if (
|
|
620
|
+
} else if (a(t) && t.length === 1) {
|
|
621
621
|
const i = t[0] - 1, o = e.length - 1;
|
|
622
622
|
return r <= o && r >= i;
|
|
623
623
|
}
|
|
@@ -625,12 +625,12 @@ function qe(e, t) {
|
|
|
625
625
|
}) : [];
|
|
626
626
|
}
|
|
627
627
|
function ue(e, t, n, r = 0) {
|
|
628
|
-
const i =
|
|
628
|
+
const i = d(r) && (r === 0 || r === 1) ? r : 0, o = e[n], c = t[n];
|
|
629
629
|
let f = 0;
|
|
630
630
|
return o < c ? f = i === 0 ? -1 : 0 : o > c && (f = i === 0 ? 0 : -1), f;
|
|
631
631
|
}
|
|
632
632
|
function le(e, t, n, r = 0) {
|
|
633
|
-
const i =
|
|
633
|
+
const i = d(r) && (r === 0 || r === 1) ? r : 0, o = new Date(e[n]), c = new Date(t[n]);
|
|
634
634
|
let f = 0;
|
|
635
635
|
return o < c ? f = i === 0 ? -1 : 0 : o > c && (f = i === 0 ? 0 : -1), f;
|
|
636
636
|
}
|
|
@@ -708,11 +708,11 @@ function ae(e, t) {
|
|
|
708
708
|
function de(e, t = "children") {
|
|
709
709
|
let n = [];
|
|
710
710
|
return e.forEach((r) => {
|
|
711
|
-
n.push(r),
|
|
711
|
+
n.push(r), a(r[t]) && r[t].length > 0 && (n = n.concat(de(r[t], t)));
|
|
712
712
|
}), n;
|
|
713
713
|
}
|
|
714
714
|
function Qe(e, t) {
|
|
715
|
-
if (!e || !
|
|
715
|
+
if (!e || !a(e) || (e == null ? void 0 : e.length) === 0)
|
|
716
716
|
return [];
|
|
717
717
|
const { id: n = "id", parentId: r = "parentId", children: i = "children", rootId: o = 0, emptyChildren: c = !0 } = t || {}, f = O(e);
|
|
718
718
|
return f.map((u) => {
|
|
@@ -730,21 +730,28 @@ function he(e, t) {
|
|
|
730
730
|
}).filter(Boolean);
|
|
731
731
|
}
|
|
732
732
|
function ke(e, t, n) {
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
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]]))
|
|
740
744
|
return !0;
|
|
741
745
|
}
|
|
742
746
|
return !1;
|
|
743
747
|
}
|
|
744
|
-
for (const
|
|
745
|
-
if (
|
|
748
|
+
for (const f of e)
|
|
749
|
+
if (c(f, []))
|
|
746
750
|
break;
|
|
747
|
-
return
|
|
751
|
+
return o;
|
|
752
|
+
}
|
|
753
|
+
function Ke(e) {
|
|
754
|
+
return e && a(e) ? e[e.length - 1] : null;
|
|
748
755
|
}
|
|
749
756
|
function pe(e, t, n) {
|
|
750
757
|
const r = (n == null ? void 0 : n.value) || "id", i = (n == null ? void 0 : n.children) || "children";
|
|
@@ -759,16 +766,16 @@ function pe(e, t, n) {
|
|
|
759
766
|
}
|
|
760
767
|
}
|
|
761
768
|
}
|
|
762
|
-
function
|
|
769
|
+
function je(e) {
|
|
763
770
|
return URL.createObjectURL(e);
|
|
764
771
|
}
|
|
765
|
-
function
|
|
772
|
+
function et(e) {
|
|
766
773
|
return new Promise((t, n) => {
|
|
767
774
|
const r = new FileReader();
|
|
768
775
|
r.readAsDataURL(e), r.onload = () => t(r.result), r.onerror = (i) => n(i);
|
|
769
776
|
});
|
|
770
777
|
}
|
|
771
|
-
function
|
|
778
|
+
function tt(e) {
|
|
772
779
|
const t = e.split(","), n = t[0].match(/:(.*?);/)[1], r = atob(t[1]);
|
|
773
780
|
let i = r.length;
|
|
774
781
|
const o = new Uint8Array(i);
|
|
@@ -776,7 +783,7 @@ function et(e) {
|
|
|
776
783
|
o[i] = r.charCodeAt(i);
|
|
777
784
|
return new Blob([o], { type: n });
|
|
778
785
|
}
|
|
779
|
-
function
|
|
786
|
+
function nt(e, t) {
|
|
780
787
|
const n = e.split(","), r = n[0].match(/:(.*?);/)[1], i = atob(n[1]);
|
|
781
788
|
let o = i.length;
|
|
782
789
|
const c = new Uint8Array(o);
|
|
@@ -784,7 +791,7 @@ function tt(e, t) {
|
|
|
784
791
|
c[o] = i.charCodeAt(o);
|
|
785
792
|
return new File([c], t, { type: r });
|
|
786
793
|
}
|
|
787
|
-
function
|
|
794
|
+
function rt(e, t, n) {
|
|
788
795
|
return new window.File([e], t, { type: n });
|
|
789
796
|
}
|
|
790
797
|
function ye(e) {
|
|
@@ -825,7 +832,7 @@ function ge(e) {
|
|
|
825
832
|
};
|
|
826
833
|
});
|
|
827
834
|
}
|
|
828
|
-
async function
|
|
835
|
+
async function it(e) {
|
|
829
836
|
const { url: t = "", currentTime: n, videoSuffix: r = "", vidoeAllowPlay: i = !1 } = e;
|
|
830
837
|
let o = "", c = r, f = "1", u;
|
|
831
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({
|
|
@@ -859,19 +866,19 @@ function B(e = "") {
|
|
|
859
866
|
"data:audio/"
|
|
860
867
|
].find((n) => e.includes(n)));
|
|
861
868
|
}
|
|
862
|
-
function
|
|
869
|
+
function ot(e) {
|
|
863
870
|
return typeof e == "string" && /^data:(?:image|video|audio)\/[A-Za-z]+;base64,[A-Za-z0-9+/=]+$/.test(e);
|
|
864
871
|
}
|
|
865
|
-
function
|
|
872
|
+
function ft(e, t, n, r = !1) {
|
|
866
873
|
e && t && n && e.addEventListener(t, n, r);
|
|
867
874
|
}
|
|
868
|
-
function
|
|
875
|
+
function ct(e, t, n, r = !1) {
|
|
869
876
|
e && t && n && e.removeEventListener(t, n, r);
|
|
870
877
|
}
|
|
871
|
-
function
|
|
878
|
+
function ut() {
|
|
872
879
|
return /windows|win32/i.test(navigator.userAgent);
|
|
873
880
|
}
|
|
874
|
-
function
|
|
881
|
+
function lt(e) {
|
|
875
882
|
return m(e) ? e : !!e;
|
|
876
883
|
}
|
|
877
884
|
function $(e, t) {
|
|
@@ -887,9 +894,9 @@ function $(e, t) {
|
|
|
887
894
|
}
|
|
888
895
|
return t.toString();
|
|
889
896
|
}
|
|
890
|
-
function
|
|
891
|
-
const { toChinese: n = !1, fixed: r = 2, min: i = 1e4 } = t || {}, o =
|
|
892
|
-
if (!
|
|
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))
|
|
893
900
|
return {
|
|
894
901
|
str: `${e}`,
|
|
895
902
|
number: `${e}`
|
|
@@ -918,7 +925,7 @@ function lt(e, t) {
|
|
|
918
925
|
unit: f
|
|
919
926
|
});
|
|
920
927
|
}
|
|
921
|
-
function
|
|
928
|
+
function at(e, t) {
|
|
922
929
|
let n = 0;
|
|
923
930
|
const r = m(t.removeAfter) ? t.removeAfter : !0, i = t.id || "hiddenElement", o = {
|
|
924
931
|
opacity: 0,
|
|
@@ -937,8 +944,8 @@ function st(e, t) {
|
|
|
937
944
|
const f = document.createElement(t.createName || "span");
|
|
938
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;
|
|
939
946
|
}
|
|
940
|
-
function
|
|
941
|
-
e =
|
|
947
|
+
function dt(e) {
|
|
948
|
+
e = d(e) && !Number.isNaN(e) ? e : 0;
|
|
942
949
|
const t = ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"], n = ["", "十", "百", "千", "万"];
|
|
943
950
|
e = Number.parseInt(`${e}`);
|
|
944
951
|
const r = (c) => {
|
|
@@ -955,7 +962,7 @@ export {
|
|
|
955
962
|
we as Base64,
|
|
956
963
|
Xe as arrayRepeat,
|
|
957
964
|
qe as arraySlice,
|
|
958
|
-
|
|
965
|
+
rt as blobToDataURL,
|
|
959
966
|
A as checkFileType,
|
|
960
967
|
G as classNames,
|
|
961
968
|
O as cloneDeep,
|
|
@@ -963,10 +970,10 @@ export {
|
|
|
963
970
|
Je as compareArraySort,
|
|
964
971
|
Ze as compareArrayTimeSort,
|
|
965
972
|
le as compareTime,
|
|
966
|
-
|
|
973
|
+
lt as convertValueBoolean,
|
|
967
974
|
g as copyProperties,
|
|
968
|
-
|
|
969
|
-
|
|
975
|
+
tt as dataURLtoBlob,
|
|
976
|
+
nt as dataURLtoFile,
|
|
970
977
|
be as deepCopy,
|
|
971
978
|
w as deepMerge,
|
|
972
979
|
x as fileTypes,
|
|
@@ -978,8 +985,9 @@ export {
|
|
|
978
985
|
$ as formatNumber,
|
|
979
986
|
_e as genColumnKey,
|
|
980
987
|
M as generateVidoePicture,
|
|
981
|
-
|
|
982
|
-
|
|
988
|
+
Ke as getArrayLast,
|
|
989
|
+
et as getBase64,
|
|
990
|
+
je as getBlobUrl,
|
|
983
991
|
T as getFileSuffix,
|
|
984
992
|
de as getLevelData,
|
|
985
993
|
ae as getMaxFloor,
|
|
@@ -990,23 +998,23 @@ export {
|
|
|
990
998
|
ve as getScrollContainer,
|
|
991
999
|
fe as getSlot,
|
|
992
1000
|
ce as getSlotVNode,
|
|
993
|
-
|
|
994
|
-
|
|
1001
|
+
Fe as getSlotsChildren,
|
|
1002
|
+
Le as getSlotsProps,
|
|
995
1003
|
He as getSortIndex,
|
|
996
1004
|
ee as getSymbols,
|
|
997
|
-
|
|
1005
|
+
at as getTextWidth,
|
|
998
1006
|
V as getValueFromObjectByKey,
|
|
999
|
-
|
|
1007
|
+
it as getVideoCoverPicture,
|
|
1000
1008
|
ye as getVideoFileUrl,
|
|
1001
1009
|
ze as handleCurrentPage,
|
|
1002
1010
|
Ve as handleShowIndex,
|
|
1003
1011
|
Ye as hanndleEmptyField,
|
|
1004
1012
|
Z as is,
|
|
1005
|
-
|
|
1013
|
+
a as isArray,
|
|
1006
1014
|
B as isBase64,
|
|
1007
1015
|
m as isBoolean,
|
|
1008
1016
|
Ie as isBrowser,
|
|
1009
|
-
|
|
1017
|
+
ot as isDataURLBase64,
|
|
1010
1018
|
E as isDeepEqualReact,
|
|
1011
1019
|
oe as isEmptyElement,
|
|
1012
1020
|
Ae as isFunction,
|
|
@@ -1016,9 +1024,9 @@ export {
|
|
|
1016
1024
|
Se as isMobile,
|
|
1017
1025
|
ie as isNil,
|
|
1018
1026
|
Me as isNotNil,
|
|
1019
|
-
|
|
1027
|
+
d as isNumber,
|
|
1020
1028
|
h as isObject,
|
|
1021
|
-
|
|
1029
|
+
P as isPlainObject,
|
|
1022
1030
|
te as isPrimitive,
|
|
1023
1031
|
k as isScroll,
|
|
1024
1032
|
v as isServer,
|
|
@@ -1026,20 +1034,20 @@ export {
|
|
|
1026
1034
|
Y as isTablet,
|
|
1027
1035
|
ne as isTypedArray,
|
|
1028
1036
|
Te as isUrl,
|
|
1029
|
-
|
|
1037
|
+
ut as isWindowsOs,
|
|
1030
1038
|
Ue as merge,
|
|
1031
1039
|
De as nanoid,
|
|
1032
|
-
|
|
1040
|
+
ct as off,
|
|
1033
1041
|
Be as omitBoolean,
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1042
|
+
Ne as omitUndefined,
|
|
1043
|
+
Pe as omitUndefinedAndEmptyArr,
|
|
1044
|
+
ft as on,
|
|
1037
1045
|
R as raf,
|
|
1038
1046
|
We as runFunction,
|
|
1039
1047
|
Ce as scrollTo,
|
|
1040
1048
|
q as slotRender,
|
|
1041
1049
|
Ee as throttleByAnimationFrame,
|
|
1042
|
-
|
|
1043
|
-
|
|
1050
|
+
dt as toChinesNum,
|
|
1051
|
+
st as toConvertNumberShow,
|
|
1044
1052
|
Qe as treeData
|
|
1045
1053
|
};
|
package/dist/pro-utils.umd.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
(function(u,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],d):(u=typeof globalThis<"u"?globalThis:u||self,d(u.PorUtils={},u.vue))})(this,function(u,d){"use strict";class he{constructor(){this._keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}_utf8_encode(t){t=t.replace(/\r\n/g,`
|
|
2
|
-
`);let n="";for(let r=0;r<t.length;r++){const i=t.charCodeAt(r);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))}return n}_utf8_decode(t){let n="",r=0,i=0,o=0,f=0;for(;r<t.length;)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),f=t.charCodeAt(r+2),n+=String.fromCharCode((i&15)<<12|(o&63)<<6|f&63),r+=3);return n}encode(t){let n="",r,i,o,f,c,l,a,s=0;for(t=this._utf8_encode(t);s<t.length;)r=t.charCodeAt(s++),i=t.charCodeAt(s++),o=t.charCodeAt(s++),f=r>>2,c=(r&3)<<4|i>>4,l=(i&15)<<2|o>>6,a=o&63,Number.isNaN(i)?l=a=64:Number.isNaN(o)&&(a=64),n=n+this._keyStr.charAt(f)+this._keyStr.charAt(c)+this._keyStr.charAt(l)+this._keyStr.charAt(a);return n}decode(t){let n="",r,i,o,f,c,l,a,s=0;for(t=t.replace(/[^A-Z0-9+/=]/gi,"");s<t.length;)f=this._keyStr.indexOf(t.charAt(s++)),c=this._keyStr.indexOf(t.charAt(s++)),l=this._keyStr.indexOf(t.charAt(s++)),a=this._keyStr.indexOf(t.charAt(s++)),r=f<<2|c>>4,i=(c&15)<<4|l>>2,o=(l&3)<<6|a,n=n+String.fromCharCode(r),l!==64&&(n=n+String.fromCharCode(i)),a!==64&&(n=n+String.fromCharCode(o));return n=this._utf8_decode(n),n}}function _(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function m(e){return typeof e=="boolean"}function h(e){return typeof e=="number"}function y(e){return typeof Array.isArray>"u"?Object.prototype.toString.call(e)==="[object Array]":Array.isArray(e)}function g(e){return e!==null&&_(e,"Object")}function W(e){return typeof e=="string"||e instanceof String}function ye(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function ge(e){if(typeof e!="string")return!1;try{const t=JSON.parse(e);return typeof t=="object"&&t!==null}catch{return!1}}function me(){const e=navigator.userAgent||navigator.vendor;return!!(/iPhone/.test(e)||/Android/.test(e)&&/Mobile/.test(e)||/Windows Phone/.test(e)||/Mobile/.test(e)&&!x())}function x(){const e=navigator.userAgent||navigator.vendor;return!!(/iPad/.test(e)||/Macintosh/.test(e)&&"ontouchend"in document||/Android/.test(e)&&!/Mobile/.test(e))}function z(...e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(r){if(W(r))t.push(r);else if(y(r))for(let i=0;i<r.length;i++){const o=z(r[i]);o&&t.push(o)}else if(g(r))for(const i in r)r[i]&&t.push(i)}}return t.filter(n=>n).join(" ")}function U(e,t){if(typeof t!="string"&&!Array.isArray(t))return;const n=Array.isArray(t)?t:t.split(":");let r=e;for(let i=0;i<n.length;i++)if(r&&Object.prototype.hasOwnProperty.call(r,n[i]))r=r[n[i]];else return;return r}const S=typeof window>"u";function we(e){return e.replace(/[-_](.)/g,(t,n)=>n.toUpperCase())}const N=function(e,t){var n;if(S||!e||!t)return"";t=we(t),t==="float"&&(t="cssFloat");try{const r=e.style[t];if(r)return r;const i=(n=document==null?void 0:document.defaultView)==null?void 0:n.getComputedStyle(e,"");return i?i[t]:""}catch{return e.style[t]}},q=(e,t)=>S?void 0:(t==null?N(e,"overflow"):t?N(e,"overflow-y"):N(e,"overflow-x")).match(/(scroll|auto|overlay)/),pe=(e,t)=>{if(S)return;let n=e;for(;n;){if([window,document,document.documentElement].includes(n))return window;if(q(n,t))return n;n=n.parentNode}return n},Se=(e,t)=>{if(S||!e||!t)return!1;const n=e.getBoundingClientRect();let r;return[window,document,document.documentElement,null,void 0].includes(t)?r={top:0,right:window.innerWidth,bottom:window.innerHeight,left:0}:r=t.getBoundingClientRect(),n.top<r.bottom&&n.bottom>r.top&&n.right>r.left&&n.left<r.right};function P(e){return e!=null&&e===e.window}function H(e,t){var i;if(typeof window>"u")return 0;const n=t?"scrollTop":"scrollLeft";let r=0;return P(e)?r=e[t?"pageYOffset":"pageXOffset"]:e instanceof Document?r=e.documentElement[n]:e&&(r=e[n]),e&&!P(e)&&typeof r!="number"&&(r=(i=(e.ownerDocument||e).documentElement)==null?void 0:i[n]),r}let J=e=>setTimeout(e,16),Z=e=>clearTimeout(e);typeof window<"u"&&"requestAnimationFrame"in window&&(J=e=>window.requestAnimationFrame(e),Z=e=>window.cancelAnimationFrame(e));let X=0;const F=new Map;function Y(e){F.delete(e)}function E(e,t=1){X+=1;const n=X;function r(i){if(i===0)Y(n),e();else{const o=J(()=>{r(i-1)});F.set(n,o)}}return r(t),n}E.cancel=e=>{const t=F.get(e);return Y(t),Z(t)};function Ae(e,t,n,r){const i=n-t;return e/=r/2,e<1?i/2*e*e*e+t:i/2*((e-=2)*e*e+2)+t}function ve(e,t={}){const{getContainer:n=()=>window,callback:r,duration:i=450}=t,o=n(),f=H(o,!0),c=Date.now(),l=()=>{const s=Date.now()-c,T=Ae(s>i?i:s,f,e,i);P(o)?o.scrollTo(window.pageXOffset,T):o instanceof HTMLDocument||o.constructor.name==="HTMLDocument"?o.documentElement.scrollTop=T:o.scrollTop=T,s<i?E(l):typeof r=="function"&&r()};o&&E(l)}function Oe(e){let t;const n=i=>()=>{t=null,e(...i)},r=(...i)=>{t==null&&(t=requestAnimationFrame(n(i)))};return r.cancel=()=>cancelAnimationFrame(t),r}function G(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Q(e){return e==null||typeof e!="object"&&typeof e!="function"}function k(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function A(e){return w(e)}function w(e,t=new Map){if(Q(e))return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){const n=Array.from({length:e.length});t.set(e,n);for(let r=0;r<e.length;r++)n[r]=w(e[r],t);return Object.prototype.hasOwnProperty.call(e,"index")&&(n.index=e.index),Object.prototype.hasOwnProperty.call(e,"input")&&(n.input=e.input),n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const n=new RegExp(e.source,e.flags);return n.lastIndex=e.lastIndex,n}if(e instanceof Map){const n=new Map;t.set(e,n);for(const[r,i]of e)n.set(r,w(i,t));return n}if(e instanceof Set){const n=new Set;t.set(e,n);for(const r of e)n.add(w(r,t));return n}if(typeof Buffer<"u"&&Buffer.isBuffer(e))return e.subarray();if(k(e)){const n=new(Object.getPrototypeOf(e)).constructor(e.length);t.set(e,n);for(let r=0;r<e.length;r++)n[r]=w(e[r],t);return n}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const n=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return t.set(e,n),p(n,e,t),n}if(typeof File<"u"&&e instanceof File){const n=new File([e],e.name,{type:e.type});return t.set(e,n),p(n,e,t),n}if(e instanceof Blob){const n=new Blob([e],{type:e.type});return t.set(e,n),p(n,e,t),n}if(e instanceof Error){const n=new e.constructor;return t.set(e,n),n.message=e.message,n.name=e.name,n.stack=e.stack,n.cause=e.cause,p(n,e,t),n}if(typeof e=="object"&&e!==null){const n={};return t.set(e,n),p(n,e,t),n}return e}function p(e,t,n){const r=[...Object.keys(t),...G(t)];for(let i=0;i<r.length;i++){const o=r[i],f=Object.getOwnPropertyDescriptor(e,o);(f==null||f.writable)&&(e[o]=w(t[o],n))}}const Ce=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,Te=()=>process.env.NODE_ENV==="TEST"?!0:typeof window<"u"&&typeof window.document<"u"&&typeof window.matchMedia<"u"&&!Ce;function R(e,t,n,r){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let i,o,f;if(Array.isArray(e)){if(i=e.length,i!=t.length)return!1;for(o=i;o--!==0;)if(!R(e[o],t[o],n,r))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;for(o of e.entries())if(!R(o[1],t.get(o[0]),n,r))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(i=e.length,i!=t.length)return!1;for(o=i;o--!==0;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString)return e.toString()===t.toString();if(f=Object.keys(e),i=f.length,i!==Object.keys(t).length)return!1;for(o=i;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,f[o]))return!1;for(o=i;o--!==0;){const c=f[o];if(!(n!=null&&n.includes(c))&&!(c==="_owner"&&e.$$typeof)&&!R(e[c],t[c],n,r))return r&&console.log(c),!1}return!0}return e!==e&&t!==t}function Ee(e){return/\w.(?:png|jpg|jpeg|svg|webp|gif|bmp)$/i.test(e)}const j=e=>e==null,Re=e=>{if(!e||!e.startsWith("http"))return!1;try{return!!new URL(e)}catch{return!1}};function D(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)==="[object Object]":!1}const Be=(...e)=>{const t={},n=e.length;let r,i=0;for(;i<n;i+=1)for(r in e[i])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]={...t[r],...e[i][r]}:t[r]=e[i][r]);return t};function v(e,t,n){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);for(let f=0;f<o.length;f++){const c=o[f],l=t[c],a=e[c];Array.isArray(l)?Array.isArray(a)?l.length===0&&!i?e[c]=l:e[c]=v(a,l,n):e[c]=v([],l,n):D(l)?D(a)?Object.keys(l).length===0&&!i?e[c]=l:e[c]=v(a,l,n):e[c]=v({},l,n):r?(a===void 0||!j(l))&&(e[c]=l):e[c]=l}return e}let K=0;const ee=(e=21)=>{if(typeof window>"u"||!window.crypto)return(K+=1).toFixed(0);let t="";const n=crypto.getRandomValues(new Uint8Array(e));for(;e--;){const r=63&n[e];t+=r<36?r.toString(36):r<62?(r-26).toString(36).toUpperCase():r<63?"_":"-"}return t},Ie=()=>typeof window>"u"?ee():window.crypto&&window.crypto.randomUUID&&typeof crypto.randomUUID=="function"?crypto.randomUUID():ee(),Ue=e=>{if(e&&e!==!0)return e},Ne=e=>{const t={};if(Object.keys(e||{}).forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),!(Object.keys(t).length<1))return t},Pe=e=>{const t={};return Object.keys(e||{}).forEach(n=>{var r;Array.isArray(e[n])&&((r=e[n])==null?void 0:r.length)===0||e[n]!==void 0&&(t[n]=e[n])}),t};function L(e){var t;if(!(typeof e!="string"&&!Array.isArray(e)))return Array.isArray(e)?e[e.length-1]:(t=e.split(":"))==null?void 0:t.slice(-1)[0]}function te(e){return e&&(e.type===d.Comment||e.type===d.Fragment&&e.children.length===0||e.type===Text&&e.children.trim()==="")}function Fe(e,t){var n;return M((n=e[t])==null?void 0:n.call(e))}function M(e=[]){const t=[];return e.forEach(n=>{Array.isArray(n)?t.push(...n):(n==null?void 0:n.type)===d.Fragment?t.push(...M(n.children)):t.push(n)}),t.filter(n=>!te(n))}function V(e,...t){return typeof e=="function"?e==null?void 0:e(...t):e}function ne(e,t,n="default",r){const i=L(n);if(i){let o;const f=U(t,n);return f===!1?o=!1:f===!0?o=e==null?void 0:e[i]:g(f)&&r?d.isVNode(f)?o=f:o=e==null?void 0:e[i]:o=f||(e==null?void 0:e[i]),r?d.isVNode(o)?o:V(o):o}}function re(e,t,n="default",r){var o,f,c;const i=L(n);if(i){let l;const a=U(t,n);return a===!1?l=!1:a===!0?l=(o=e==null?void 0:e[i])==null?void 0:o.call(e,r):g(a)?d.isVNode(a)?l=a:l=(f=e==null?void 0:e[i])==null?void 0:f.call(e,r):l=a||((c=e==null?void 0:e[i])==null?void 0:c.call(e,r)),d.isVNode(l)?l:V(l,r)}}function De(e,t,n,r){const i={};return e.forEach(o=>{const f=L(o);if(f){const c=r!=null&&r.render?re(t,n,o,r==null?void 0:r.params):ne(t,n,o);(m(c)||c)&&(i[f]=c)}}),i}const O={videoAllowType:["mp4","webm","ogg"],audioAllowType:["mp3","ogg","wav","aac","m4a","webm"],imageType:["jpeg","jpg","png","gif","bmp","tiff","tif","webp","heic","heif","svg","ico","raw","cr2","nef","arw","dng","psd","eps"],videoType:["mp4","avi","mov","wmv","mkv","flv","webm","mpeg","mpg","3gp","ogv","mxf","vob","rm","rmvb","ts","mts","m2ts","divx","xvid"],audioType:["mp3","wav","aac","flac","ogg","wma","m4a","alac","opus","amr","aiff","au","pcm","ape"]};function Le(e){return e!=null}const Me=({suffixCls:e,customizePrefixCls:t,isPor:n,className:r})=>{const i=r||(n?"gx-pro":"gx");return t||(e?`${i}-${e}`:i)},Ve=(e,t)=>e?y(e)?e.join("-"):e.toString():`${t||0}`;function be(e,{align:t,showIndex:n}){const r=A(e);if(n&&e.length&&e.every(i=>i.dataIndex!=="sortIndex")){const i=e[0];r.unshift({title:"序号",align:t,fixed:i.fixed,width:60,uuid:ce().uuid(15),dataIndex:"sortIndex",key:"sortIndex"})}else r.filter(i=>i.dataIndex!=="sortIndex");return r}function $e(e,...t){return typeof e=="function"?e(...t):e}function _e(e){return JSON.parse(JSON.stringify(e))}function We(e,t){if(g(e)){const{pageSize:n=10,total:r=0}=e;let{current:i=1}=e;return r-t<=n*(i-1)&&(i=i-1),i===0?1:i}return 1}function xe(e=[],t,n="children"){function r(i,o){return o.map((f,c)=>{const l=`${i}-${c+1}`;return f[n]&&(f[n]=r(l,f[n])),f.sortIndex=l,f})}return A(e).map((i,o)=>{const f=g(t)&&t.current||1,c=g(t)&&t.pageSize||10,l=`${f?(f-1)*c+(o+1):o+1}`;return i[n]&&(i[n]=r(`${l}`,i[n])),i.sortIndex=l,i})}function ze(e,t){return y(e)?e==null?void 0:e.filter((n,r)=>{if(h(t))return r<=t-1;if(y(t)&&t.length===2){const i=t[0]-1,o=t[1]?t[1]-1:e.length-1;return r<=o&&r>=i}else if(y(t)&&t.length===1){const i=t[0]-1,o=e.length-1;return r<=o&&r>=i}return!0}):[]}function ie(e,t,n,r=0){const i=h(r)&&(r===0||r===1)?r:0,o=e[n],f=t[n];let c=0;return o<f?c=i===0?-1:0:o>f&&(c=i===0?0:-1),c}function oe(e,t,n,r=0){const i=h(r)&&(r===0||r===1)?r:0,o=new Date(e[n]),f=new Date(t[n]);let c=0;return o<f?c=i===0?-1:0:o>f&&(c=i===0?0:-1),c}function qe(e,t,n=0){return e.sort((r,i)=>ie(r,i,t,n))}function He(e,t,n=0){return e.sort((r,i)=>oe(r,i,t,n))}function Je(e){let t=A(e);const n=new Set(t);return t=Array.from(n),t}function Ze(e,t){const n=["null","undefined"];let r=!0;return e===0?r=!0:n.includes(e)?r=!1:e||(r=!1),r?{value:e,success:r}:{value:t===""?t:t||"-",success:r}}function Xe(e){let t="";if(e>-1){const n=Math.floor(e/3600),r=Math.floor(e/60)%60,i=Number.parseInt(String(e%60));n<10?t="0"+n+":":t=n+":",r<10&&(t+="0"),t+=r+":",i<10&&(t+="0"),t+=i}return t.split(":")[0]==="00"?`${t.split(":")[1]}:${t.split(":")[2]}`:t}function ce(){const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");return{uuid(t,n){const r=e,i=[],o=n||r.length;let f,c;if(t)for(f=0;f<t;f+=1)i[f]=r[Number.parseInt(String(Math.random()*o))];else for(i[8]="-",i[13]="-",i[18]="-",i[23]="-",i[14]="4",f=0;f<36;f+=1)i[f]||(c=Math.random()*16,i[f]=r[f===19?c&&3||8:c]);return i.join("")},uuidFast(){const t=e,n=Array.from({length:36});let r=0,i,o;for(o=0;o<36;o+=1)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]);return n.join("")},uuidString(){return this.uuidFast().replace(new RegExp("-","g"),"")},uuidCompact(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=Math.random()*16||0;return(t==="x"?n:n&&3||8).toString(16)})}}}function fe(e,t){if(!Array.isArray(e)||e.length===0)return 0;const n=t||"children";return Math.max(...e.map(r=>{const i=r[n];return 1+(i?fe(i,n):0)}))}function ue(e,t="children"){let n=[];return e.forEach(r=>{n.push(r),y(r[t])&&r[t].length>0&&(n=n.concat(ue(r[t],t)))}),n}function Ye(e,t){if(!e||!y(e)||(e==null?void 0:e.length)===0)return[];const{id:n="id",parentId:r="parentId",children:i="children",rootId:o=0,emptyChildren:f=!0}=t||{},c=A(e);return c.map(l=>{var a;return!f&&l[i]&&((a=l[i])==null?void 0:a.length)===0&&delete l[i],l}).filter(l=>{const a=c.filter(s=>l[n]===s[r]);return a.length>0?l[i]=a:f&&(l[i]=[]),l[r]===o})}function le(e,t){return e.map(n=>{const r={...n};return r.children&&(r.children=le(r.children,t)),t(r)||r.children&&r.children.length>0?r:null}).filter(Boolean)}function Ge(e,t,n){let r=[];function i(o,f){if(o[n.value]===t)return r=[...f,o[n.value]],!0;if(o[n.children]){for(const c of o[n.children])if(i(c,[...f,o[n.value]]))return!0}return!1}for(const o of e)if(i(o,[]))break;return r}function ae(e,t,n){const r=(n==null?void 0:n.value)||"id",i=(n==null?void 0:n.children)||"children";for(const o of e){if(o[r]===t)return o;const f=o[i];if(f){const c=ae(f,t,n);if(c)return c}}}function Qe(e){return URL.createObjectURL(e)}function ke(e){return new Promise((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(r.result),r.onerror=i=>n(i)})}function je(e){const t=e.split(","),n=t[0].match(/:(.*?);/)[1],r=atob(t[1]);let i=r.length;const o=new Uint8Array(i);for(;i--;)o[i]=r.charCodeAt(i);return new Blob([o],{type:n})}function Ke(e,t){const n=e.split(","),r=n[0].match(/:(.*?);/)[1],i=atob(n[1]);let o=i.length;const f=new Uint8Array(o);for(;o--;)f[o]=i.charCodeAt(o);return new File([f],t,{type:r})}function et(e,t,n){return new window.File([e],t,{type:n})}function se(e){if(!e||typeof e!="string")return"";const t=e.indexOf("?");return t>0?`${e.substring(0,t)}`:e}function B(e){var r,i,o,f,c;if(!e||typeof e!="string")return"";const t=se(e),n=t.lastIndexOf(".");return n>0&&((c=(f=`${(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:f.split("."))==null?void 0:c[1])||""}function C(e,t){if(t)return t;if(!e||e==="data:")return"4";let n="4";return I(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=B(e).toLowerCase(),O.imageType.includes(n)?"1":O.videoType.includes(n)?"3":O.audioType.includes(n)?"2":"4"}function de(e){const{url:t="",fileType:n="1"}=e||{};let r="",i={play:!1,height:0,size:0,width:0,duration:0};function o(){i={play:!1,height:0,size:0,width:0,duration:0}}return t instanceof File?r=URL.createObjectURL(t):I(t)?r=t:t instanceof Blob?r=URL.createObjectURL(t):(t.includes("https")||t.includes("http"))&&(r=t),new Promise(f=>{let c;n==="1"?(c=document.createElement("img"),c.src=r):n==="2"?(c=document.createElement("audio"),c.src=r):n==="3"&&(c=document.createElement("video"),c.src=r),n==="1"?c.onload=function(){o(),i.play=!0,i.width=c.width||0,i.height=c.height||0,f(i),c=null}:c.oncanplay=function(){o(),i.play=!0,i.width=(c==null?void 0:c.videoWidth)||0,i.height=(c==null?void 0:c.videoHeight)||0,i.duration=(c==null?void 0:c.duration)||0,f(i),c=null},c.onerror=function(){o(),f(i),c=null}})}async function tt(e){const{url:t="",currentTime:n,videoSuffix:r="",vidoeAllowPlay:i=!1}=e;let o="",f=r,c="1",l;return t instanceof File?(o=URL.createObjectURL(t),f=B(t.name),c=C(t.name)):t instanceof Blob?(o=URL.createObjectURL(t),c=C(t)):I(t)?(o=t,c=C(t)):(t.includes("https")||t.includes("http"))&&(o=t,f=B(t),c=C(t)),(f?O.videoAllowType.includes(f.toLowerCase()):!1)?i?b(o,n):(l=await de({url:o,fileType:c}),l.play?b(o,n):new Promise(s=>{s("")})):new Promise(s=>{s("")})}async function b(e,t=0){return new Promise(n=>{let r=document.createElement("video");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()=>{let i;for(r==null||r.addEventListener("seeked",async()=>{i&&i()});t<((r==null?void 0:r.duration)||0);){r&&(r.currentTime=t),await new Promise(T=>i=T);const o=document.createElement("canvas"),f=.8,c=o.getContext("2d"),l=(r==null?void 0:r.videoWidth)||0*f,a=(r==null?void 0:r.videoHeight)||0*f,s=0;o.width=(r==null?void 0:r.videoWidth)||0*f,o.height=(r==null?void 0:r.videoHeight)||0*f,r&&c.drawImage(r,0,0,l+s,a+s),r=null,n(l===0||a===0?"":o.toDataURL("image/png",1))}}))})}function I(e=""){return!!(e&&["data:image/","data:video/","data:audio/"].find(n=>e.includes(n)))}function nt(e){return typeof e=="string"&&/^data:(?:image|video|audio)\/[A-Za-z]+;base64,[A-Za-z0-9+/=]+$/.test(e)}function rt(e,t,n,r=!1){e&&t&&n&&e.addEventListener(t,n,r)}function it(e,t,n,r=!1){e&&t&&n&&e.removeEventListener(t,n,r)}function ot(){return/windows|win32/i.test(navigator.userAgent)}function ct(e){return m(e)?e:!!e}function $(e,t){const n=`^\\d+(?:\\.\\d{0,${e}})?`,r=new RegExp(n),i=t.toString().match(r);if(i){const o=i[0];if(o.includes(".")){const[f,c]=o.split(".");if(/^0*$/.test(c))return f}return o}return t.toString()}function ft(e,t){const{toChinese:n=!1,fixed:r=2,min:i=1e4}=t||{},o=h(i)?i:1e4,f=h(r)?r:2,c=n?e<o?"":e<1e8?"万":"亿":e<o?"":e<1e8?"w":"亿";if(!h(e))return{str:`${e}`,number:`${e}`};if(e<o)return{str:`${e}`,number:`${e}`};if(f===0){const a=(e/(e<1e8?1e4:1e8)).toFixed(1).split(".")[0];return{str:`${a}${c}`,number:a,unit:c}}let l;return e<1e8?(l=$(f,e/1e4),{str:l+c,number:l,unit:c}):(l=$(f,e/1e8),{str:l+c,number:l,unit:c})}function ut(e,t){let n=0;const r=m(t.removeAfter)?t.removeAfter:!0,i=t.id||"hiddenElement",o={opacity:0,visibility:"hidden",position:"fixed",zIndex:-1,top:0,left:0};let f=document.querySelector(`#${i}`);if(!f){const l=document.createElement("div");l.id=i,document.body.appendChild(l),f=document.querySelector(`#${i}`)}Object.assign(f.style,o);const c=document.createElement(t.createName||"span");return c.innerHTML=e,(t.cssObject||g(t.cssObject))&&Object.assign(c.style,t.cssObject),f.append(c),n=c.getBoundingClientRect()[t.type||"width"],r&&f.removeChild(c),n}function lt(e){e=h(e)&&!Number.isNaN(e)?e:0;const t=["零","一","二","三","四","五","六","七","八","九"],n=["","十","百","千","万"];e=Number.parseInt(`${e}`);const r=f=>{const c=f.toString().split("").reverse();let l="";for(let a=0;a<c.length;a++)l=(a===0&&c[a]==="0"||a>0&&c[a]==="0"&&c[a-1]==="0"?"":(e<20&&a>0?"":t[c[a]])+(c[a]==="0"?n[0]:n[a]))+l;return l},i=Math.floor(e/1e4);let o=e%1e4;return o.toString().length<4&&(o="0"+o),i?r(i)+"万"+r(o):r(e)}u.Base64=he,u.arrayRepeat=Je,u.arraySlice=ze,u.blobToDataURL=et,u.checkFileType=C,u.classNames=z,u.cloneDeep=A,u.compareArray=ie,u.compareArraySort=qe,u.compareArrayTimeSort=He,u.compareTime=oe,u.convertValueBoolean=ct,u.copyProperties=p,u.dataURLtoBlob=je,u.dataURLtoFile=Ke,u.deepCopy=_e,u.deepMerge=v,u.fileTypes=O,u.filterEmpty=M,u.filterTree=le,u.findSourceByTree=ae,u.findValueAndAncestors=Ge,u.formatDuraton=Xe,u.formatNumber=$,u.genColumnKey=Ve,u.generateVidoePicture=b,u.getBase64=ke,u.getBlobUrl=Qe,u.getFileSuffix=B,u.getLevelData=ue,u.getMaxFloor=fe,u.getMediaInfos=de,u.getPrefixCls=Me,u.getRandomNumber=ce,u.getScroll=H,u.getScrollContainer=pe,u.getSlot=ne,u.getSlotVNode=re,u.getSlotsChildren=Fe,u.getSlotsProps=De,u.getSortIndex=xe,u.getSymbols=G,u.getTextWidth=ut,u.getValueFromObjectByKey=U,u.getVideoCoverPicture=tt,u.getVideoFileUrl=se,u.handleCurrentPage=We,u.handleShowIndex=be,u.hanndleEmptyField=Ze,u.is=_,u.isArray=y,u.isBase64=I,u.isBoolean=m,u.isBrowser=Te,u.isDataURLBase64=nt,u.isDeepEqualReact=R,u.isEmptyElement=te,u.isFunction=ye,u.isImg=Ee,u.isInContainer=Se,u.isJSONStr=ge,u.isMobile=me,u.isNil=j,u.isNotNil=Le,u.isNumber=h,u.isObject=g,u.isPlainObject=D,u.isPrimitive=Q,u.isScroll=q,u.isServer=S,u.isString=W,u.isTablet=x,u.isTypedArray=k,u.isUrl=Re,u.isWindowsOs=ot,u.merge=Be,u.nanoid=Ie,u.off=it,u.omitBoolean=Ue,u.omitUndefined=Ne,u.omitUndefinedAndEmptyArr=Pe,u.on=rt,u.raf=E,u.runFunction=$e,u.scrollTo=ve,u.slotRender=V,u.throttleByAnimationFrame=Oe,u.toChinesNum=lt,u.toConvertNumberShow=ft,u.treeData=Ye,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|
|
2
|
+
`);let n="";for(let r=0;r<t.length;r++){const i=t.charCodeAt(r);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))}return n}_utf8_decode(t){let n="",r=0,i=0,o=0,c=0;for(;r<t.length;)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);return n}encode(t){let n="",r,i,o,c,f,l,a,s=0;for(t=this._utf8_encode(t);s<t.length;)r=t.charCodeAt(s++),i=t.charCodeAt(s++),o=t.charCodeAt(s++),c=r>>2,f=(r&3)<<4|i>>4,l=(i&15)<<2|o>>6,a=o&63,Number.isNaN(i)?l=a=64:Number.isNaN(o)&&(a=64),n=n+this._keyStr.charAt(c)+this._keyStr.charAt(f)+this._keyStr.charAt(l)+this._keyStr.charAt(a);return n}decode(t){let n="",r,i,o,c,f,l,a,s=0;for(t=t.replace(/[^A-Z0-9+/=]/gi,"");s<t.length;)c=this._keyStr.indexOf(t.charAt(s++)),f=this._keyStr.indexOf(t.charAt(s++)),l=this._keyStr.indexOf(t.charAt(s++)),a=this._keyStr.indexOf(t.charAt(s++)),r=c<<2|f>>4,i=(f&15)<<4|l>>2,o=(l&3)<<6|a,n=n+String.fromCharCode(r),l!==64&&(n=n+String.fromCharCode(i)),a!==64&&(n=n+String.fromCharCode(o));return n=this._utf8_decode(n),n}}function _(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function m(e){return typeof e=="boolean"}function y(e){return typeof e=="number"}function h(e){return typeof Array.isArray>"u"?Object.prototype.toString.call(e)==="[object Array]":Array.isArray(e)}function g(e){return e!==null&&_(e,"Object")}function W(e){return typeof e=="string"||e instanceof String}function ye(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function ge(e){if(typeof e!="string")return!1;try{const t=JSON.parse(e);return typeof t=="object"&&t!==null}catch{return!1}}function me(){const e=navigator.userAgent||navigator.vendor;return!!(/iPhone/.test(e)||/Android/.test(e)&&/Mobile/.test(e)||/Windows Phone/.test(e)||/Mobile/.test(e)&&!x())}function x(){const e=navigator.userAgent||navigator.vendor;return!!(/iPad/.test(e)||/Macintosh/.test(e)&&"ontouchend"in document||/Android/.test(e)&&!/Mobile/.test(e))}function z(...e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(r){if(W(r))t.push(r);else if(h(r))for(let i=0;i<r.length;i++){const o=z(r[i]);o&&t.push(o)}else if(g(r))for(const i in r)r[i]&&t.push(i)}}return t.filter(n=>n).join(" ")}function I(e,t){if(typeof t!="string"&&!Array.isArray(t))return;const n=Array.isArray(t)?t:t.split(":");let r=e;for(let i=0;i<n.length;i++)if(r&&Object.prototype.hasOwnProperty.call(r,n[i]))r=r[n[i]];else return;return r}const S=typeof window>"u";function we(e){return e.replace(/[-_](.)/g,(t,n)=>n.toUpperCase())}const U=function(e,t){var n;if(S||!e||!t)return"";t=we(t),t==="float"&&(t="cssFloat");try{const r=e.style[t];if(r)return r;const i=(n=document==null?void 0:document.defaultView)==null?void 0:n.getComputedStyle(e,"");return i?i[t]:""}catch{return e.style[t]}},q=(e,t)=>S?void 0:(t==null?U(e,"overflow"):t?U(e,"overflow-y"):U(e,"overflow-x")).match(/(scroll|auto|overlay)/),pe=(e,t)=>{if(S)return;let n=e;for(;n;){if([window,document,document.documentElement].includes(n))return window;if(q(n,t))return n;n=n.parentNode}return n},Se=(e,t)=>{if(S||!e||!t)return!1;const n=e.getBoundingClientRect();let r;return[window,document,document.documentElement,null,void 0].includes(t)?r={top:0,right:window.innerWidth,bottom:window.innerHeight,left:0}:r=t.getBoundingClientRect(),n.top<r.bottom&&n.bottom>r.top&&n.right>r.left&&n.left<r.right};function P(e){return e!=null&&e===e.window}function H(e,t){var i;if(typeof window>"u")return 0;const n=t?"scrollTop":"scrollLeft";let r=0;return P(e)?r=e[t?"pageYOffset":"pageXOffset"]:e instanceof Document?r=e.documentElement[n]:e&&(r=e[n]),e&&!P(e)&&typeof r!="number"&&(r=(i=(e.ownerDocument||e).documentElement)==null?void 0:i[n]),r}let J=e=>setTimeout(e,16),Z=e=>clearTimeout(e);typeof window<"u"&&"requestAnimationFrame"in window&&(J=e=>window.requestAnimationFrame(e),Z=e=>window.cancelAnimationFrame(e));let X=0;const F=new Map;function Y(e){F.delete(e)}function E(e,t=1){X+=1;const n=X;function r(i){if(i===0)Y(n),e();else{const o=J(()=>{r(i-1)});F.set(n,o)}}return r(t),n}E.cancel=e=>{const t=F.get(e);return Y(t),Z(t)};function Ae(e,t,n,r){const i=n-t;return e/=r/2,e<1?i/2*e*e*e+t:i/2*((e-=2)*e*e+2)+t}function ve(e,t={}){const{getContainer:n=()=>window,callback:r,duration:i=450}=t,o=n(),c=H(o,!0),f=Date.now(),l=()=>{const s=Date.now()-f,T=Ae(s>i?i:s,c,e,i);P(o)?o.scrollTo(window.pageXOffset,T):o instanceof HTMLDocument||o.constructor.name==="HTMLDocument"?o.documentElement.scrollTop=T:o.scrollTop=T,s<i?E(l):typeof r=="function"&&r()};o&&E(l)}function Oe(e){let t;const n=i=>()=>{t=null,e(...i)},r=(...i)=>{t==null&&(t=requestAnimationFrame(n(i)))};return r.cancel=()=>cancelAnimationFrame(t),r}function G(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Q(e){return e==null||typeof e!="object"&&typeof e!="function"}function k(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function A(e){return w(e)}function w(e,t=new Map){if(Q(e))return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){const n=Array.from({length:e.length});t.set(e,n);for(let r=0;r<e.length;r++)n[r]=w(e[r],t);return Object.prototype.hasOwnProperty.call(e,"index")&&(n.index=e.index),Object.prototype.hasOwnProperty.call(e,"input")&&(n.input=e.input),n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const n=new RegExp(e.source,e.flags);return n.lastIndex=e.lastIndex,n}if(e instanceof Map){const n=new Map;t.set(e,n);for(const[r,i]of e)n.set(r,w(i,t));return n}if(e instanceof Set){const n=new Set;t.set(e,n);for(const r of e)n.add(w(r,t));return n}if(typeof Buffer<"u"&&Buffer.isBuffer(e))return e.subarray();if(k(e)){const n=new(Object.getPrototypeOf(e)).constructor(e.length);t.set(e,n);for(let r=0;r<e.length;r++)n[r]=w(e[r],t);return n}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const n=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return t.set(e,n),p(n,e,t),n}if(typeof File<"u"&&e instanceof File){const n=new File([e],e.name,{type:e.type});return t.set(e,n),p(n,e,t),n}if(e instanceof Blob){const n=new Blob([e],{type:e.type});return t.set(e,n),p(n,e,t),n}if(e instanceof Error){const n=new e.constructor;return t.set(e,n),n.message=e.message,n.name=e.name,n.stack=e.stack,n.cause=e.cause,p(n,e,t),n}if(typeof e=="object"&&e!==null){const n={};return t.set(e,n),p(n,e,t),n}return e}function p(e,t,n){const r=[...Object.keys(t),...G(t)];for(let i=0;i<r.length;i++){const o=r[i],c=Object.getOwnPropertyDescriptor(e,o);(c==null||c.writable)&&(e[o]=w(t[o],n))}}const Ce=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,Te=()=>process.env.NODE_ENV==="TEST"?!0:typeof window<"u"&&typeof window.document<"u"&&typeof window.matchMedia<"u"&&!Ce;function R(e,t,n,r){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let i,o,c;if(Array.isArray(e)){if(i=e.length,i!=t.length)return!1;for(o=i;o--!==0;)if(!R(e[o],t[o],n,r))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;for(o of e.entries())if(!R(o[1],t.get(o[0]),n,r))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(i=e.length,i!=t.length)return!1;for(o=i;o--!==0;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString)return e.toString()===t.toString();if(c=Object.keys(e),i=c.length,i!==Object.keys(t).length)return!1;for(o=i;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,c[o]))return!1;for(o=i;o--!==0;){const f=c[o];if(!(n!=null&&n.includes(f))&&!(f==="_owner"&&e.$$typeof)&&!R(e[f],t[f],n,r))return r&&console.log(f),!1}return!0}return e!==e&&t!==t}function Ee(e){return/\w.(?:png|jpg|jpeg|svg|webp|gif|bmp)$/i.test(e)}const j=e=>e==null,Re=e=>{if(!e||!e.startsWith("http"))return!1;try{return!!new URL(e)}catch{return!1}};function D(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)==="[object Object]":!1}const Ne=(...e)=>{const t={},n=e.length;let r,i=0;for(;i<n;i+=1)for(r in e[i])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]={...t[r],...e[i][r]}:t[r]=e[i][r]);return t};function v(e,t,n){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);for(let c=0;c<o.length;c++){const f=o[c],l=t[f],a=e[f];Array.isArray(l)?Array.isArray(a)?l.length===0&&!i?e[f]=l:e[f]=v(a,l,n):e[f]=v([],l,n):D(l)?D(a)?Object.keys(l).length===0&&!i?e[f]=l:e[f]=v(a,l,n):e[f]=v({},l,n):r?(a===void 0||!j(l))&&(e[f]=l):e[f]=l}return e}let K=0;const ee=(e=21)=>{if(typeof window>"u"||!window.crypto)return(K+=1).toFixed(0);let t="";const n=crypto.getRandomValues(new Uint8Array(e));for(;e--;){const r=63&n[e];t+=r<36?r.toString(36):r<62?(r-26).toString(36).toUpperCase():r<63?"_":"-"}return t},Be=()=>typeof window>"u"?ee():window.crypto&&window.crypto.randomUUID&&typeof crypto.randomUUID=="function"?crypto.randomUUID():ee(),Ie=e=>{if(e&&e!==!0)return e},Ue=e=>{const t={};if(Object.keys(e||{}).forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),!(Object.keys(t).length<1))return t},Pe=e=>{const t={};return Object.keys(e||{}).forEach(n=>{var r;Array.isArray(e[n])&&((r=e[n])==null?void 0:r.length)===0||e[n]!==void 0&&(t[n]=e[n])}),t};function L(e){var t;if(!(typeof e!="string"&&!Array.isArray(e)))return Array.isArray(e)?e[e.length-1]:(t=e.split(":"))==null?void 0:t.slice(-1)[0]}function te(e){return e&&(e.type===d.Comment||e.type===d.Fragment&&e.children.length===0||e.type===Text&&e.children.trim()==="")}function Fe(e,t){var n;return M((n=e[t])==null?void 0:n.call(e))}function M(e=[]){const t=[];return e.forEach(n=>{Array.isArray(n)?t.push(...n):(n==null?void 0:n.type)===d.Fragment?t.push(...M(n.children)):t.push(n)}),t.filter(n=>!te(n))}function V(e,...t){return typeof e=="function"?e==null?void 0:e(...t):e}function ne(e,t,n="default",r){const i=L(n);if(i){let o;const c=I(t,n);return c===!1?o=!1:c===!0?o=e==null?void 0:e[i]:g(c)&&r?d.isVNode(c)?o=c:o=e==null?void 0:e[i]:o=c||(e==null?void 0:e[i]),r?d.isVNode(o)?o:V(o):o}}function re(e,t,n="default",r){var o,c,f;const i=L(n);if(i){let l;const a=I(t,n);return a===!1?l=!1:a===!0?l=(o=e==null?void 0:e[i])==null?void 0:o.call(e,r):g(a)?d.isVNode(a)?l=a:l=(c=e==null?void 0:e[i])==null?void 0:c.call(e,r):l=a||((f=e==null?void 0:e[i])==null?void 0:f.call(e,r)),d.isVNode(l)?l:V(l,r)}}function De(e,t,n,r){const i={};return e.forEach(o=>{const c=L(o);if(c){const f=r!=null&&r.render?re(t,n,o,r==null?void 0:r.params):ne(t,n,o);(m(f)||f)&&(i[c]=f)}}),i}const O={videoAllowType:["mp4","webm","ogg"],audioAllowType:["mp3","ogg","wav","aac","m4a","webm"],imageType:["jpeg","jpg","png","gif","bmp","tiff","tif","webp","heic","heif","svg","ico","raw","cr2","nef","arw","dng","psd","eps"],videoType:["mp4","avi","mov","wmv","mkv","flv","webm","mpeg","mpg","3gp","ogv","mxf","vob","rm","rmvb","ts","mts","m2ts","divx","xvid"],audioType:["mp3","wav","aac","flac","ogg","wma","m4a","alac","opus","amr","aiff","au","pcm","ape"]};function Le(e){return e!=null}const Me=({suffixCls:e,customizePrefixCls:t,isPor:n,className:r})=>{const i=r||(n?"gx-pro":"gx");return t||(e?`${i}-${e}`:i)},Ve=(e,t)=>e?h(e)?e.join("-"):e.toString():`${t||0}`;function be(e,{align:t,showIndex:n}){const r=A(e);if(n&&e.length&&e.every(i=>i.dataIndex!=="sortIndex")){const i=e[0];r.unshift({title:"序号",align:t,fixed:i.fixed,width:60,uuid:fe().uuid(15),dataIndex:"sortIndex",key:"sortIndex"})}else r.filter(i=>i.dataIndex!=="sortIndex");return r}function $e(e,...t){return typeof e=="function"?e(...t):e}function _e(e){return JSON.parse(JSON.stringify(e))}function We(e,t){if(g(e)){const{pageSize:n=10,total:r=0}=e;let{current:i=1}=e;return r-t<=n*(i-1)&&(i=i-1),i===0?1:i}return 1}function xe(e=[],t,n="children"){function r(i,o){return o.map((c,f)=>{const l=`${i}-${f+1}`;return c[n]&&(c[n]=r(l,c[n])),c.sortIndex=l,c})}return A(e).map((i,o)=>{const c=g(t)&&t.current||1,f=g(t)&&t.pageSize||10,l=`${c?(c-1)*f+(o+1):o+1}`;return i[n]&&(i[n]=r(`${l}`,i[n])),i.sortIndex=l,i})}function ze(e,t){return h(e)?e==null?void 0:e.filter((n,r)=>{if(y(t))return r<=t-1;if(h(t)&&t.length===2){const i=t[0]-1,o=t[1]?t[1]-1:e.length-1;return r<=o&&r>=i}else if(h(t)&&t.length===1){const i=t[0]-1,o=e.length-1;return r<=o&&r>=i}return!0}):[]}function ie(e,t,n,r=0){const i=y(r)&&(r===0||r===1)?r:0,o=e[n],c=t[n];let f=0;return o<c?f=i===0?-1:0:o>c&&(f=i===0?0:-1),f}function oe(e,t,n,r=0){const i=y(r)&&(r===0||r===1)?r:0,o=new Date(e[n]),c=new Date(t[n]);let f=0;return o<c?f=i===0?-1:0:o>c&&(f=i===0?0:-1),f}function qe(e,t,n=0){return e.sort((r,i)=>ie(r,i,t,n))}function He(e,t,n=0){return e.sort((r,i)=>oe(r,i,t,n))}function Je(e){let t=A(e);const n=new Set(t);return t=Array.from(n),t}function Ze(e,t){const n=["null","undefined"];let r=!0;return e===0?r=!0:n.includes(e)?r=!1:e||(r=!1),r?{value:e,success:r}:{value:t===""?t:t||"-",success:r}}function Xe(e){let t="";if(e>-1){const n=Math.floor(e/3600),r=Math.floor(e/60)%60,i=Number.parseInt(String(e%60));n<10?t="0"+n+":":t=n+":",r<10&&(t+="0"),t+=r+":",i<10&&(t+="0"),t+=i}return t.split(":")[0]==="00"?`${t.split(":")[1]}:${t.split(":")[2]}`:t}function fe(){const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");return{uuid(t,n){const r=e,i=[],o=n||r.length;let c,f;if(t)for(c=0;c<t;c+=1)i[c]=r[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]=r[c===19?f&&3||8:f]);return i.join("")},uuidFast(){const t=e,n=Array.from({length:36});let r=0,i,o;for(o=0;o<36;o+=1)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]);return n.join("")},uuidString(){return this.uuidFast().replace(new RegExp("-","g"),"")},uuidCompact(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=Math.random()*16||0;return(t==="x"?n:n&&3||8).toString(16)})}}}function ce(e,t){if(!Array.isArray(e)||e.length===0)return 0;const n=t||"children";return Math.max(...e.map(r=>{const i=r[n];return 1+(i?ce(i,n):0)}))}function ue(e,t="children"){let n=[];return e.forEach(r=>{n.push(r),h(r[t])&&r[t].length>0&&(n=n.concat(ue(r[t],t)))}),n}function Ye(e,t){if(!e||!h(e)||(e==null?void 0:e.length)===0)return[];const{id:n="id",parentId:r="parentId",children:i="children",rootId:o=0,emptyChildren:c=!0}=t||{},f=A(e);return f.map(l=>{var a;return!c&&l[i]&&((a=l[i])==null?void 0:a.length)===0&&delete l[i],l}).filter(l=>{const a=f.filter(s=>l[n]===s[r]);return a.length>0?l[i]=a:c&&(l[i]=[]),l[r]===o})}function le(e,t){return e.map(n=>{const r={...n};return r.children&&(r.children=le(r.children,t)),t(r)||r.children&&r.children.length>0?r:null}).filter(Boolean)}function Ge(e,t,n){const{value:r,children:i}=n||{value:"value",children:"children"};let o=[];function c(f,l){if(f[r]===t)return o=[...l,f[r]],!0;if(f[i]){for(const a of f[i])if(c(a,[...l,f[r]]))return!0}return!1}for(const f of e)if(c(f,[]))break;return o}function Qe(e){return e&&h(e)?e[e.length-1]:null}function ae(e,t,n){const r=(n==null?void 0:n.value)||"id",i=(n==null?void 0:n.children)||"children";for(const o of e){if(o[r]===t)return o;const c=o[i];if(c){const f=ae(c,t,n);if(f)return f}}}function ke(e){return URL.createObjectURL(e)}function je(e){return new Promise((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(r.result),r.onerror=i=>n(i)})}function Ke(e){const t=e.split(","),n=t[0].match(/:(.*?);/)[1],r=atob(t[1]);let i=r.length;const o=new Uint8Array(i);for(;i--;)o[i]=r.charCodeAt(i);return new Blob([o],{type:n})}function et(e,t){const n=e.split(","),r=n[0].match(/:(.*?);/)[1],i=atob(n[1]);let o=i.length;const c=new Uint8Array(o);for(;o--;)c[o]=i.charCodeAt(o);return new File([c],t,{type:r})}function tt(e,t,n){return new window.File([e],t,{type:n})}function se(e){if(!e||typeof e!="string")return"";const t=e.indexOf("?");return t>0?`${e.substring(0,t)}`:e}function N(e){var r,i,o,c,f;if(!e||typeof e!="string")return"";const t=se(e),n=t.lastIndexOf(".");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])||""}function C(e,t){if(t)return t;if(!e||e==="data:")return"4";let n="4";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=N(e).toLowerCase(),O.imageType.includes(n)?"1":O.videoType.includes(n)?"3":O.audioType.includes(n)?"2":"4"}function de(e){const{url:t="",fileType:n="1"}=e||{};let r="",i={play:!1,height:0,size:0,width:0,duration:0};function o(){i={play:!1,height:0,size:0,width:0,duration:0}}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=>{let f;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(){o(),i.play=!0,i.width=f.width||0,i.height=f.height||0,c(i),f=null}:f.oncanplay=function(){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},f.onerror=function(){o(),c(i),f=null}})}async function nt(e){const{url:t="",currentTime:n,videoSuffix:r="",vidoeAllowPlay:i=!1}=e;let o="",c=r,f="1",l;return t instanceof File?(o=URL.createObjectURL(t),c=N(t.name),f=C(t.name)):t instanceof Blob?(o=URL.createObjectURL(t),f=C(t)):B(t)?(o=t,f=C(t)):(t.includes("https")||t.includes("http"))&&(o=t,c=N(t),f=C(t)),(c?O.videoAllowType.includes(c.toLowerCase()):!1)?i?b(o,n):(l=await de({url:o,fileType:f}),l.play?b(o,n):new Promise(s=>{s("")})):new Promise(s=>{s("")})}async function b(e,t=0){return new Promise(n=>{let r=document.createElement("video");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()=>{let i;for(r==null||r.addEventListener("seeked",async()=>{i&&i()});t<((r==null?void 0:r.duration)||0);){r&&(r.currentTime=t),await new Promise(T=>i=T);const o=document.createElement("canvas"),c=.8,f=o.getContext("2d"),l=(r==null?void 0:r.videoWidth)||0*c,a=(r==null?void 0:r.videoHeight)||0*c,s=0;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,l+s,a+s),r=null,n(l===0||a===0?"":o.toDataURL("image/png",1))}}))})}function B(e=""){return!!(e&&["data:image/","data:video/","data:audio/"].find(n=>e.includes(n)))}function rt(e){return typeof e=="string"&&/^data:(?:image|video|audio)\/[A-Za-z]+;base64,[A-Za-z0-9+/=]+$/.test(e)}function it(e,t,n,r=!1){e&&t&&n&&e.addEventListener(t,n,r)}function ot(e,t,n,r=!1){e&&t&&n&&e.removeEventListener(t,n,r)}function ft(){return/windows|win32/i.test(navigator.userAgent)}function ct(e){return m(e)?e:!!e}function $(e,t){const n=`^\\d+(?:\\.\\d{0,${e}})?`,r=new RegExp(n),i=t.toString().match(r);if(i){const o=i[0];if(o.includes(".")){const[c,f]=o.split(".");if(/^0*$/.test(f))return c}return o}return t.toString()}function ut(e,t){const{toChinese:n=!1,fixed:r=2,min:i=1e4}=t||{},o=y(i)?i:1e4,c=y(r)?r:2,f=n?e<o?"":e<1e8?"万":"亿":e<o?"":e<1e8?"w":"亿";if(!y(e))return{str:`${e}`,number:`${e}`};if(e<o)return{str:`${e}`,number:`${e}`};if(c===0){const a=(e/(e<1e8?1e4:1e8)).toFixed(1).split(".")[0];return{str:`${a}${f}`,number:a,unit:f}}let l;return e<1e8?(l=$(c,e/1e4),{str:l+f,number:l,unit:f}):(l=$(c,e/1e8),{str:l+f,number:l,unit:f})}function lt(e,t){let n=0;const r=m(t.removeAfter)?t.removeAfter:!0,i=t.id||"hiddenElement",o={opacity:0,visibility:"hidden",position:"fixed",zIndex:-1,top:0,left:0};let c=document.querySelector(`#${i}`);if(!c){const l=document.createElement("div");l.id=i,document.body.appendChild(l),c=document.querySelector(`#${i}`)}Object.assign(c.style,o);const f=document.createElement(t.createName||"span");return f.innerHTML=e,(t.cssObject||g(t.cssObject))&&Object.assign(f.style,t.cssObject),c.append(f),n=f.getBoundingClientRect()[t.type||"width"],r&&c.removeChild(f),n}function at(e){e=y(e)&&!Number.isNaN(e)?e:0;const t=["零","一","二","三","四","五","六","七","八","九"],n=["","十","百","千","万"];e=Number.parseInt(`${e}`);const r=c=>{const f=c.toString().split("").reverse();let l="";for(let a=0;a<f.length;a++)l=(a===0&&f[a]==="0"||a>0&&f[a]==="0"&&f[a-1]==="0"?"":(e<20&&a>0?"":t[f[a]])+(f[a]==="0"?n[0]:n[a]))+l;return l},i=Math.floor(e/1e4);let o=e%1e4;return o.toString().length<4&&(o="0"+o),i?r(i)+"万"+r(o):r(e)}u.Base64=he,u.arrayRepeat=Je,u.arraySlice=ze,u.blobToDataURL=tt,u.checkFileType=C,u.classNames=z,u.cloneDeep=A,u.compareArray=ie,u.compareArraySort=qe,u.compareArrayTimeSort=He,u.compareTime=oe,u.convertValueBoolean=ct,u.copyProperties=p,u.dataURLtoBlob=Ke,u.dataURLtoFile=et,u.deepCopy=_e,u.deepMerge=v,u.fileTypes=O,u.filterEmpty=M,u.filterTree=le,u.findSourceByTree=ae,u.findValueAndAncestors=Ge,u.formatDuraton=Xe,u.formatNumber=$,u.genColumnKey=Ve,u.generateVidoePicture=b,u.getArrayLast=Qe,u.getBase64=je,u.getBlobUrl=ke,u.getFileSuffix=N,u.getLevelData=ue,u.getMaxFloor=ce,u.getMediaInfos=de,u.getPrefixCls=Me,u.getRandomNumber=fe,u.getScroll=H,u.getScrollContainer=pe,u.getSlot=ne,u.getSlotVNode=re,u.getSlotsChildren=Fe,u.getSlotsProps=De,u.getSortIndex=xe,u.getSymbols=G,u.getTextWidth=lt,u.getValueFromObjectByKey=I,u.getVideoCoverPicture=nt,u.getVideoFileUrl=se,u.handleCurrentPage=We,u.handleShowIndex=be,u.hanndleEmptyField=Ze,u.is=_,u.isArray=h,u.isBase64=B,u.isBoolean=m,u.isBrowser=Te,u.isDataURLBase64=rt,u.isDeepEqualReact=R,u.isEmptyElement=te,u.isFunction=ye,u.isImg=Ee,u.isInContainer=Se,u.isJSONStr=ge,u.isMobile=me,u.isNil=j,u.isNotNil=Le,u.isNumber=y,u.isObject=g,u.isPlainObject=D,u.isPrimitive=Q,u.isScroll=q,u.isServer=S,u.isString=W,u.isTablet=x,u.isTypedArray=k,u.isUrl=Re,u.isWindowsOs=ft,u.merge=Ne,u.nanoid=Be,u.off=ot,u.omitBoolean=Ie,u.omitUndefined=Ue,u.omitUndefinedAndEmptyArr=Pe,u.on=it,u.raf=E,u.runFunction=$e,u.scrollTo=ve,u.slotRender=V,u.throttleByAnimationFrame=Oe,u.toChinesNum=at,u.toConvertNumberShow=ut,u.treeData=Ye,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -163,10 +163,11 @@ export declare function filterTree<T = any>(tree: T[], predicate: (val: T) => bo
|
|
|
163
163
|
* @lastTime 2024/12/21
|
|
164
164
|
* @description 给定指定的value值,找到其所有的祖先节点
|
|
165
165
|
*/
|
|
166
|
-
export declare function findValueAndAncestors<T = any>(tree: T[], targetValue: any, fieldNames
|
|
166
|
+
export declare function findValueAndAncestors<T = any>(tree: T[], targetValue: any, fieldNames?: {
|
|
167
167
|
value: 'value';
|
|
168
168
|
children: 'children';
|
|
169
169
|
}): any[];
|
|
170
|
+
export declare function getArrayLast<T = any>(data: any): T;
|
|
170
171
|
/**
|
|
171
172
|
* @Author gx12358
|
|
172
173
|
* @DateTime 2024/12/6
|