aoi-comp 1.0.6 → 1.0.8
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/{BufferResource-CVU-ZRRz.js → BufferResource-DPOGqxQ8.js} +8 -6
- package/dist/{CanvasPool-C3aVgvEX.js → CanvasPool-Btji3eOu.js} +1 -1
- package/dist/{Geometry-CN7W9DnD.js → Geometry-CmoUjYuy.js} +13 -12
- package/dist/{RenderTargetSystem-D_FiZPnb.js → RenderTargetSystem-BwBGe2Se.js} +252 -252
- package/dist/{browserAll-DqFkNC6q.js → browserAll-BIc-EcPU.js} +20 -20
- package/dist/{canvasUtils-D0KM_fKp.js → canvasUtils-BZU-qDXH.js} +1 -1
- package/dist/comps.js +20774 -3227
- package/dist/{getTextureBatchBindGroup-CLFTP_Vc.js → getTextureBatchBindGroup-B9kZnBNO.js} +1 -1
- package/dist/hooks-DVVg7e1H.js +527 -0
- package/dist/hooks.js +2 -2
- package/dist/index.js +1 -1
- package/dist/{init-DVXFVLyx.js → init-W_GeGJkn.js} +54 -47
- package/dist/{init-CIaGzij5.js → init-pj0uFHxN.js} +18 -18
- package/dist/{packages-Dd2mV9Xv.js → packages-B-izsU7O.js} +985 -718
- package/dist/style.css +1 -1
- package/dist/utils.js +2 -2
- package/dist/webworkerAll-CSNhSmU-.js +2 -0
- package/package.json +5 -4
- package/dist/CanvasRenderer-CVj7HTkL.js +0 -3460
- package/dist/WebGLRenderer-CurPxJtF.js +0 -2210
- package/dist/WebGPURenderer-CfiYFIN2.js +0 -1840
- package/dist/hooks-FYdXNEDe.js +0 -452
- package/dist/rolldown-runtime-CWhphoD1.js +0 -23
- package/dist/webworkerAll-XSXRmCFC.js +0 -2
|
@@ -1,7 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { theme as e } from "antd";
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
3
|
+
var t = Object.create, n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.getPrototypeOf, o = Object.prototype.hasOwnProperty, s = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), c = (e, t) => {
|
|
4
|
+
let r = {};
|
|
5
|
+
for (var i in e) n(r, i, {
|
|
6
|
+
get: e[i],
|
|
7
|
+
enumerable: !0
|
|
8
|
+
});
|
|
9
|
+
return t || n(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
10
|
+
}, l = (e, t, a, s) => {
|
|
11
|
+
if (t && typeof t == "object" || typeof t == "function") for (var c = i(t), l = 0, u = c.length, d; l < u; l++) d = c[l], !o.call(e, d) && d !== a && n(e, d, {
|
|
12
|
+
get: ((e) => t[e]).bind(null, d),
|
|
13
|
+
enumerable: !(s = r(t, d)) || s.enumerable
|
|
14
|
+
});
|
|
15
|
+
return e;
|
|
16
|
+
}, u = (e, r, i) => (i = e == null ? {} : t(a(e)), l(r || !e || !e.__esModule || !o.call(e, "default") ? n(i, "default", {
|
|
17
|
+
value: e,
|
|
18
|
+
enumerable: !0
|
|
19
|
+
}) : i, e)), d = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
|
|
20
|
+
if (typeof require < "u") return require.apply(this, arguments);
|
|
21
|
+
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
22
|
+
}), f = {
|
|
5
23
|
aliceblue: [
|
|
6
24
|
240,
|
|
7
25
|
248,
|
|
@@ -743,115 +761,113 @@ var r = {
|
|
|
743
761
|
50
|
|
744
762
|
]
|
|
745
763
|
};
|
|
746
|
-
for (let e in
|
|
747
|
-
var
|
|
748
|
-
for (let e in
|
|
749
|
-
var
|
|
764
|
+
for (let e in f) Object.freeze(f[e]);
|
|
765
|
+
var p = Object.freeze(f), m = Object.create(null);
|
|
766
|
+
for (let e in p) Object.hasOwn(p, e) && (m[p[e]] = e);
|
|
767
|
+
var h = {
|
|
750
768
|
to: {},
|
|
751
769
|
get: {}
|
|
752
770
|
};
|
|
753
|
-
|
|
771
|
+
h.get = function(e) {
|
|
754
772
|
let t = e.slice(0, 3).toLowerCase(), n, r;
|
|
755
773
|
switch (t) {
|
|
756
774
|
case "hsl":
|
|
757
|
-
n =
|
|
775
|
+
n = h.get.hsl(e), r = "hsl";
|
|
758
776
|
break;
|
|
759
777
|
case "hwb":
|
|
760
|
-
n =
|
|
761
|
-
break;
|
|
762
|
-
default:
|
|
763
|
-
n = o.get.rgb(e), r = "rgb";
|
|
778
|
+
n = h.get.hwb(e), r = "hwb";
|
|
764
779
|
break;
|
|
780
|
+
default: n = h.get.rgb(e), r = "rgb";
|
|
765
781
|
}
|
|
766
782
|
return n ? {
|
|
767
783
|
model: r,
|
|
768
784
|
value: n
|
|
769
785
|
} : null;
|
|
770
|
-
},
|
|
786
|
+
}, h.get.rgb = function(e) {
|
|
771
787
|
if (!e) return null;
|
|
772
|
-
let t = /^#([a-f\d]{3,4})$/i, n = /^#([a-f\d]{6})([a-f\d]{2})?$/i, r = /^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,
|
|
788
|
+
let t = /^#([a-f\d]{3,4})$/i, n = /^#([a-f\d]{6})([a-f\d]{2})?$/i, r = /^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i, i = /^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i, a = /^(\w+)$/, o = [
|
|
773
789
|
0,
|
|
774
790
|
0,
|
|
775
791
|
0,
|
|
776
792
|
1
|
|
777
|
-
],
|
|
778
|
-
if (
|
|
779
|
-
for (
|
|
780
|
-
let e =
|
|
781
|
-
c
|
|
793
|
+
], s, c, l;
|
|
794
|
+
if (s = e.match(n)) {
|
|
795
|
+
for (l = s[2], s = s[1], c = 0; c < 3; c++) {
|
|
796
|
+
let e = c * 2;
|
|
797
|
+
o[c] = Number.parseInt(s.slice(e, e + 2), 16);
|
|
782
798
|
}
|
|
783
|
-
|
|
784
|
-
} else if (
|
|
785
|
-
for (
|
|
786
|
-
|
|
787
|
-
} else if (
|
|
788
|
-
for (
|
|
789
|
-
|
|
790
|
-
} else if (
|
|
791
|
-
for (
|
|
792
|
-
|
|
793
|
-
} else if (
|
|
799
|
+
l && (o[3] = Number.parseInt(l, 16) / 255);
|
|
800
|
+
} else if (s = e.match(t)) {
|
|
801
|
+
for (s = s[1], l = s[3], c = 0; c < 3; c++) o[c] = Number.parseInt(s[c] + s[c], 16);
|
|
802
|
+
l && (o[3] = Number.parseInt(l + l, 16) / 255);
|
|
803
|
+
} else if (s = e.match(r)) {
|
|
804
|
+
for (c = 0; c < 3; c++) o[c] = Number.parseFloat(s[c + 1]);
|
|
805
|
+
s[4] && (o[3] = s[5] ? Number.parseFloat(s[4]) * .01 : Number.parseFloat(s[4]));
|
|
806
|
+
} else if (s = e.match(i)) {
|
|
807
|
+
for (c = 0; c < 3; c++) o[c] = Math.round(Number.parseFloat(s[c + 1]) * 2.55);
|
|
808
|
+
s[4] && (o[3] = s[5] ? Number.parseFloat(s[4]) * .01 : Number.parseFloat(s[4]));
|
|
809
|
+
} else if (s = e.toLowerCase().match(a)) return s[1] === "transparent" ? [
|
|
794
810
|
0,
|
|
795
811
|
0,
|
|
796
812
|
0,
|
|
797
813
|
0
|
|
798
|
-
] : Object.hasOwn(
|
|
814
|
+
] : Object.hasOwn(p, s[1]) ? (o = p[s[1]].slice(), o[3] = 1, o) : null;
|
|
799
815
|
else return null;
|
|
800
|
-
for (
|
|
801
|
-
return
|
|
802
|
-
},
|
|
816
|
+
for (c = 0; c < 3; c++) o[c] = g(o[c], 0, 255);
|
|
817
|
+
return o[3] = g(o[3], 0, 1), o;
|
|
818
|
+
}, h.get.hsl = function(e) {
|
|
803
819
|
if (!e) return null;
|
|
804
820
|
let t = e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i);
|
|
805
821
|
if (t) {
|
|
806
822
|
let e = Number.parseFloat(t[4]);
|
|
807
823
|
return [
|
|
808
824
|
(Number.parseFloat(t[1]) % 360 + 360) % 360,
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
825
|
+
g(Number.parseFloat(t[2]), 0, 100),
|
|
826
|
+
g(Number.parseFloat(t[3]), 0, 100),
|
|
827
|
+
g(Number.isNaN(e) ? 1 : e, 0, 1)
|
|
812
828
|
];
|
|
813
829
|
}
|
|
814
830
|
return null;
|
|
815
|
-
},
|
|
831
|
+
}, h.get.hwb = function(e) {
|
|
816
832
|
if (!e) return null;
|
|
817
833
|
let t = e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i);
|
|
818
834
|
if (t) {
|
|
819
835
|
let e = Number.parseFloat(t[4]);
|
|
820
836
|
return [
|
|
821
837
|
(Number.parseFloat(t[1]) % 360 + 360) % 360,
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
838
|
+
g(Number.parseFloat(t[2]), 0, 100),
|
|
839
|
+
g(Number.parseFloat(t[3]), 0, 100),
|
|
840
|
+
g(Number.isNaN(e) ? 1 : e, 0, 1)
|
|
825
841
|
];
|
|
826
842
|
}
|
|
827
843
|
return null;
|
|
828
|
-
},
|
|
829
|
-
return "#" +
|
|
830
|
-
},
|
|
844
|
+
}, h.to.hex = function(...e) {
|
|
845
|
+
return "#" + _(e[0]) + _(e[1]) + _(e[2]) + (e[3] < 1 ? _(Math.round(e[3] * 255)) : "");
|
|
846
|
+
}, h.to.rgb = function(...e) {
|
|
831
847
|
return e.length < 4 || e[3] === 1 ? "rgb(" + Math.round(e[0]) + ", " + Math.round(e[1]) + ", " + Math.round(e[2]) + ")" : "rgba(" + Math.round(e[0]) + ", " + Math.round(e[1]) + ", " + Math.round(e[2]) + ", " + e[3] + ")";
|
|
832
|
-
},
|
|
848
|
+
}, h.to.rgb.percent = function(...e) {
|
|
833
849
|
let t = Math.round(e[0] / 255 * 100), n = Math.round(e[1] / 255 * 100), r = Math.round(e[2] / 255 * 100);
|
|
834
850
|
return e.length < 4 || e[3] === 1 ? "rgb(" + t + "%, " + n + "%, " + r + "%)" : "rgba(" + t + "%, " + n + "%, " + r + "%, " + e[3] + ")";
|
|
835
|
-
},
|
|
851
|
+
}, h.to.hsl = function(...e) {
|
|
836
852
|
return e.length < 4 || e[3] === 1 ? "hsl(" + e[0] + ", " + e[1] + "%, " + e[2] + "%)" : "hsla(" + e[0] + ", " + e[1] + "%, " + e[2] + "%, " + e[3] + ")";
|
|
837
|
-
},
|
|
853
|
+
}, h.to.hwb = function(...e) {
|
|
838
854
|
let t = "";
|
|
839
855
|
return e.length >= 4 && e[3] !== 1 && (t = ", " + e[3]), "hwb(" + e[0] + ", " + e[1] + "%, " + e[2] + "%" + t + ")";
|
|
840
|
-
},
|
|
841
|
-
return
|
|
856
|
+
}, h.to.keyword = function(...e) {
|
|
857
|
+
return m[e.slice(0, 3)];
|
|
842
858
|
};
|
|
843
|
-
function
|
|
859
|
+
function g(e, t, n) {
|
|
844
860
|
return Math.min(Math.max(t, e), n);
|
|
845
861
|
}
|
|
846
|
-
function
|
|
862
|
+
function _(e) {
|
|
847
863
|
let t = Math.round(e).toString(16).toUpperCase();
|
|
848
864
|
return t.length < 2 ? "0" + t : t;
|
|
849
865
|
}
|
|
850
866
|
//#endregion
|
|
851
867
|
//#region node_modules/.pnpm/color-convert@3.1.3/node_modules/color-convert/conversions.js
|
|
852
|
-
var
|
|
853
|
-
for (let e of Object.keys(
|
|
854
|
-
var
|
|
868
|
+
var v = {};
|
|
869
|
+
for (let e of Object.keys(p)) v[p[e]] = e;
|
|
870
|
+
var y = {
|
|
855
871
|
rgb: {
|
|
856
872
|
channels: 3,
|
|
857
873
|
labels: "rgb"
|
|
@@ -936,22 +952,22 @@ var u = {
|
|
|
936
952
|
channels: 1,
|
|
937
953
|
labels: ["gray"]
|
|
938
954
|
}
|
|
939
|
-
},
|
|
940
|
-
function
|
|
955
|
+
}, b = (6 / 29) ** 3;
|
|
956
|
+
function x(e) {
|
|
941
957
|
let t = e > .0031308 ? 1.055 * e ** (1 / 2.4) - .055 : e * 12.92;
|
|
942
958
|
return Math.min(Math.max(0, t), 1);
|
|
943
959
|
}
|
|
944
|
-
function
|
|
960
|
+
function S(e) {
|
|
945
961
|
return e > .04045 ? ((e + .055) / 1.055) ** 2.4 : e / 12.92;
|
|
946
962
|
}
|
|
947
|
-
for (let e of Object.keys(
|
|
948
|
-
if (!("channels" in
|
|
949
|
-
if (!("labels" in
|
|
950
|
-
if (
|
|
951
|
-
let { channels: t, labels: n } =
|
|
952
|
-
delete
|
|
963
|
+
for (let e of Object.keys(y)) {
|
|
964
|
+
if (!("channels" in y[e])) throw Error("missing channels property: " + e);
|
|
965
|
+
if (!("labels" in y[e])) throw Error("missing channel labels property: " + e);
|
|
966
|
+
if (y[e].labels.length !== y[e].channels) throw Error("channel and label counts mismatch: " + e);
|
|
967
|
+
let { channels: t, labels: n } = y[e];
|
|
968
|
+
delete y[e].channels, delete y[e].labels, Object.defineProperty(y[e], "channels", { value: t }), Object.defineProperty(y[e], "labels", { value: n });
|
|
953
969
|
}
|
|
954
|
-
|
|
970
|
+
y.rgb.hsl = function(e) {
|
|
955
971
|
let t = e[0] / 255, n = e[1] / 255, r = e[2] / 255, i = Math.min(t, n, r), a = Math.max(t, n, r), o = a - i, s, c;
|
|
956
972
|
switch (a) {
|
|
957
973
|
case i:
|
|
@@ -963,9 +979,7 @@ u.rgb.hsl = function(e) {
|
|
|
963
979
|
case n:
|
|
964
980
|
s = 2 + (r - t) / o;
|
|
965
981
|
break;
|
|
966
|
-
case r:
|
|
967
|
-
s = 4 + (t - n) / o;
|
|
968
|
-
break;
|
|
982
|
+
case r: s = 4 + (t - n) / o;
|
|
969
983
|
}
|
|
970
984
|
s = Math.min(s * 60, 360), s < 0 && (s += 360);
|
|
971
985
|
let l = (i + a) / 2;
|
|
@@ -974,7 +988,7 @@ u.rgb.hsl = function(e) {
|
|
|
974
988
|
c * 100,
|
|
975
989
|
l * 100
|
|
976
990
|
];
|
|
977
|
-
},
|
|
991
|
+
}, y.rgb.hsv = function(e) {
|
|
978
992
|
let t, n, r, i, a, o = e[0] / 255, s = e[1] / 255, c = e[2] / 255, l = Math.max(o, s, c), u = l - Math.min(o, s, c), d = function(e) {
|
|
979
993
|
return (l - e) / 6 / u + 1 / 2;
|
|
980
994
|
};
|
|
@@ -987,9 +1001,7 @@ u.rgb.hsl = function(e) {
|
|
|
987
1001
|
case s:
|
|
988
1002
|
i = 1 / 3 + t - r;
|
|
989
1003
|
break;
|
|
990
|
-
case c:
|
|
991
|
-
i = 2 / 3 + n - t;
|
|
992
|
-
break;
|
|
1004
|
+
case c: i = 2 / 3 + n - t;
|
|
993
1005
|
}
|
|
994
1006
|
i < 0 ? i += 1 : i > 1 && --i;
|
|
995
1007
|
}
|
|
@@ -998,21 +1010,21 @@ u.rgb.hsl = function(e) {
|
|
|
998
1010
|
a * 100,
|
|
999
1011
|
l * 100
|
|
1000
1012
|
];
|
|
1001
|
-
},
|
|
1002
|
-
let t = e[0], n = e[1], r = e[2], i =
|
|
1013
|
+
}, y.rgb.hwb = function(e) {
|
|
1014
|
+
let t = e[0], n = e[1], r = e[2], i = y.rgb.hsl(e)[0], a = 1 / 255 * Math.min(t, Math.min(n, r));
|
|
1003
1015
|
return r = 1 - 1 / 255 * Math.max(t, Math.max(n, r)), [
|
|
1004
1016
|
i,
|
|
1005
1017
|
a * 100,
|
|
1006
1018
|
r * 100
|
|
1007
1019
|
];
|
|
1008
|
-
},
|
|
1009
|
-
let t =
|
|
1020
|
+
}, y.rgb.oklab = function(e) {
|
|
1021
|
+
let t = S(e[0] / 255), n = S(e[1] / 255), r = S(e[2] / 255), i = Math.cbrt(.4122214708 * t + .5363325363 * n + .0514459929 * r), a = Math.cbrt(.2119034982 * t + .6806995451 * n + .1073969566 * r), o = Math.cbrt(.0883024619 * t + .2817188376 * n + .6299787005 * r), s = .2104542553 * i + .793617785 * a - .0040720468 * o, c = 1.9779984951 * i - 2.428592205 * a + .4505937099 * o, l = .0259040371 * i + .7827717662 * a - .808675766 * o;
|
|
1010
1022
|
return [
|
|
1011
1023
|
s * 100,
|
|
1012
1024
|
c * 100,
|
|
1013
1025
|
l * 100
|
|
1014
1026
|
];
|
|
1015
|
-
},
|
|
1027
|
+
}, y.rgb.cmyk = function(e) {
|
|
1016
1028
|
let t = e[0] / 255, n = e[1] / 255, r = e[2] / 255, i = Math.min(1 - t, 1 - n, 1 - r), a = (1 - t - i) / (1 - i) || 0, o = (1 - n - i) / (1 - i) || 0, s = (1 - r - i) / (1 - i) || 0;
|
|
1017
1029
|
return [
|
|
1018
1030
|
a * 100,
|
|
@@ -1021,35 +1033,35 @@ u.rgb.hsl = function(e) {
|
|
|
1021
1033
|
i * 100
|
|
1022
1034
|
];
|
|
1023
1035
|
};
|
|
1024
|
-
function
|
|
1036
|
+
function C(e, t) {
|
|
1025
1037
|
return (e[0] - t[0]) ** 2 + (e[1] - t[1]) ** 2 + (e[2] - t[2]) ** 2;
|
|
1026
1038
|
}
|
|
1027
|
-
|
|
1028
|
-
let t =
|
|
1039
|
+
y.rgb.keyword = function(e) {
|
|
1040
|
+
let t = v[e];
|
|
1029
1041
|
if (t) return t;
|
|
1030
1042
|
let n = Infinity, r;
|
|
1031
|
-
for (let t of Object.keys(
|
|
1032
|
-
let
|
|
1033
|
-
|
|
1043
|
+
for (let t of Object.keys(p)) {
|
|
1044
|
+
let i = p[t], a = C(e, i);
|
|
1045
|
+
a < n && (n = a, r = t);
|
|
1034
1046
|
}
|
|
1035
1047
|
return r;
|
|
1036
|
-
},
|
|
1037
|
-
return [...
|
|
1038
|
-
},
|
|
1039
|
-
let t =
|
|
1048
|
+
}, y.keyword.rgb = function(e) {
|
|
1049
|
+
return [...p[e]];
|
|
1050
|
+
}, y.rgb.xyz = function(e) {
|
|
1051
|
+
let t = S(e[0] / 255), n = S(e[1] / 255), r = S(e[2] / 255), i = t * .4124564 + n * .3575761 + r * .1804375, a = t * .2126729 + n * .7151522 + r * .072175, o = t * .0193339 + n * .119192 + r * .9503041;
|
|
1040
1052
|
return [
|
|
1041
1053
|
i * 100,
|
|
1042
1054
|
a * 100,
|
|
1043
1055
|
o * 100
|
|
1044
1056
|
];
|
|
1045
|
-
},
|
|
1046
|
-
let t =
|
|
1047
|
-
return n /= 95.047, r /= 100, i /= 108.883, n = n >
|
|
1057
|
+
}, y.rgb.lab = function(e) {
|
|
1058
|
+
let t = y.rgb.xyz(e), n = t[0], r = t[1], i = t[2];
|
|
1059
|
+
return n /= 95.047, r /= 100, i /= 108.883, n = n > b ? n ** (1 / 3) : 7.787 * n + 16 / 116, r = r > b ? r ** (1 / 3) : 7.787 * r + 16 / 116, i = i > b ? i ** (1 / 3) : 7.787 * i + 16 / 116, [
|
|
1048
1060
|
116 * r - 16,
|
|
1049
1061
|
500 * (n - r),
|
|
1050
1062
|
200 * (r - i)
|
|
1051
1063
|
];
|
|
1052
|
-
},
|
|
1064
|
+
}, y.hsl.rgb = function(e) {
|
|
1053
1065
|
let t = e[0] / 360, n = e[1] / 100, r = e[2] / 100, i, a;
|
|
1054
1066
|
if (n === 0) return a = r * 255, [
|
|
1055
1067
|
a,
|
|
@@ -1063,7 +1075,7 @@ u.rgb.keyword = function(e) {
|
|
|
1063
1075
|
];
|
|
1064
1076
|
for (let e = 0; e < 3; e++) i = t + 1 / 3 * -(e - 1), i < 0 && i++, i > 1 && i--, a = 6 * i < 1 ? s + (o - s) * 6 * i : 2 * i < 1 ? o : 3 * i < 2 ? s + (o - s) * (2 / 3 - i) * 6 : s, c[e] = a * 255;
|
|
1065
1077
|
return c;
|
|
1066
|
-
},
|
|
1078
|
+
}, y.hsl.hsv = function(e) {
|
|
1067
1079
|
let t = e[0], n = e[1] / 100, r = e[2] / 100, i = n, a = Math.max(r, .01);
|
|
1068
1080
|
r *= 2, n *= r <= 1 ? r : 2 - r, i *= a <= 1 ? a : 2 - a;
|
|
1069
1081
|
let o = (r + n) / 2;
|
|
@@ -1072,7 +1084,7 @@ u.rgb.keyword = function(e) {
|
|
|
1072
1084
|
(r === 0 ? 2 * i / (a + i) : 2 * n / (r + n)) * 100,
|
|
1073
1085
|
o * 100
|
|
1074
1086
|
];
|
|
1075
|
-
},
|
|
1087
|
+
}, y.hsv.rgb = function(e) {
|
|
1076
1088
|
let t = e[0] / 60, n = e[1] / 100, r = e[2] / 100, i = Math.floor(t) % 6, a = t - Math.floor(t), o = 255 * r * (1 - n), s = 255 * r * (1 - n * a), c = 255 * r * (1 - n * (1 - a));
|
|
1077
1089
|
switch (r *= 255, i) {
|
|
1078
1090
|
case 0: return [
|
|
@@ -1106,7 +1118,7 @@ u.rgb.keyword = function(e) {
|
|
|
1106
1118
|
s
|
|
1107
1119
|
];
|
|
1108
1120
|
}
|
|
1109
|
-
},
|
|
1121
|
+
}, y.hsv.hsl = function(e) {
|
|
1110
1122
|
let t = e[0], n = e[1] / 100, r = e[2] / 100, i = Math.max(r, .01), a, o;
|
|
1111
1123
|
o = (2 - n) * r;
|
|
1112
1124
|
let s = (2 - n) * i;
|
|
@@ -1115,7 +1127,7 @@ u.rgb.keyword = function(e) {
|
|
|
1115
1127
|
a * 100,
|
|
1116
1128
|
o * 100
|
|
1117
1129
|
];
|
|
1118
|
-
},
|
|
1130
|
+
}, y.hwb.rgb = function(e) {
|
|
1119
1131
|
let t = e[0] / 360, n = e[1] / 100, r = e[2] / 100, i = n + r, a;
|
|
1120
1132
|
i > 1 && (n /= i, r /= i);
|
|
1121
1133
|
let o = Math.floor(6 * t), s = 1 - r;
|
|
@@ -1139,95 +1151,93 @@ u.rgb.keyword = function(e) {
|
|
|
1139
1151
|
case 4:
|
|
1140
1152
|
l = c, u = n, d = s;
|
|
1141
1153
|
break;
|
|
1142
|
-
case 5:
|
|
1143
|
-
l = s, u = n, d = c;
|
|
1144
|
-
break;
|
|
1154
|
+
case 5: l = s, u = n, d = c;
|
|
1145
1155
|
}
|
|
1146
1156
|
return [
|
|
1147
1157
|
l * 255,
|
|
1148
1158
|
u * 255,
|
|
1149
1159
|
d * 255
|
|
1150
1160
|
];
|
|
1151
|
-
},
|
|
1161
|
+
}, y.cmyk.rgb = function(e) {
|
|
1152
1162
|
let t = e[0] / 100, n = e[1] / 100, r = e[2] / 100, i = e[3] / 100, a = 1 - Math.min(1, t * (1 - i) + i), o = 1 - Math.min(1, n * (1 - i) + i), s = 1 - Math.min(1, r * (1 - i) + i);
|
|
1153
1163
|
return [
|
|
1154
1164
|
a * 255,
|
|
1155
1165
|
o * 255,
|
|
1156
1166
|
s * 255
|
|
1157
1167
|
];
|
|
1158
|
-
},
|
|
1168
|
+
}, y.xyz.rgb = function(e) {
|
|
1159
1169
|
let t = e[0] / 100, n = e[1] / 100, r = e[2] / 100, i, a, o;
|
|
1160
|
-
return i = t * 3.2404542 + n * -1.5371385 + r * -.4985314, a = t * -.969266 + n * 1.8760108 + r * .041556, o = t * .0556434 + n * -.2040259 + r * 1.0572252, i =
|
|
1170
|
+
return i = t * 3.2404542 + n * -1.5371385 + r * -.4985314, a = t * -.969266 + n * 1.8760108 + r * .041556, o = t * .0556434 + n * -.2040259 + r * 1.0572252, i = x(i), a = x(a), o = x(o), [
|
|
1161
1171
|
i * 255,
|
|
1162
1172
|
a * 255,
|
|
1163
1173
|
o * 255
|
|
1164
1174
|
];
|
|
1165
|
-
},
|
|
1175
|
+
}, y.xyz.lab = function(e) {
|
|
1166
1176
|
let t = e[0], n = e[1], r = e[2];
|
|
1167
|
-
return t /= 95.047, n /= 100, r /= 108.883, t = t >
|
|
1177
|
+
return t /= 95.047, n /= 100, r /= 108.883, t = t > b ? t ** (1 / 3) : 7.787 * t + 16 / 116, n = n > b ? n ** (1 / 3) : 7.787 * n + 16 / 116, r = r > b ? r ** (1 / 3) : 7.787 * r + 16 / 116, [
|
|
1168
1178
|
116 * n - 16,
|
|
1169
1179
|
500 * (t - n),
|
|
1170
1180
|
200 * (n - r)
|
|
1171
1181
|
];
|
|
1172
|
-
},
|
|
1182
|
+
}, y.xyz.oklab = function(e) {
|
|
1173
1183
|
let t = e[0] / 100, n = e[1] / 100, r = e[2] / 100, i = Math.cbrt(.8189330101 * t + .3618667424 * n - .1288597137 * r), a = Math.cbrt(.0329845436 * t + .9293118715 * n + .0361456387 * r), o = Math.cbrt(.0482003018 * t + .2643662691 * n + .633851707 * r), s = .2104542553 * i + .793617785 * a - .0040720468 * o, c = 1.9779984951 * i - 2.428592205 * a + .4505937099 * o, l = .0259040371 * i + .7827717662 * a - .808675766 * o;
|
|
1174
1184
|
return [
|
|
1175
1185
|
s * 100,
|
|
1176
1186
|
c * 100,
|
|
1177
1187
|
l * 100
|
|
1178
1188
|
];
|
|
1179
|
-
},
|
|
1180
|
-
return
|
|
1181
|
-
},
|
|
1189
|
+
}, y.oklab.oklch = function(e) {
|
|
1190
|
+
return y.lab.lch(e);
|
|
1191
|
+
}, y.oklab.xyz = function(e) {
|
|
1182
1192
|
let t = e[0] / 100, n = e[1] / 100, r = e[2] / 100, i = (.999999998 * t + .396337792 * n + .215803758 * r) ** 3, a = (1.000000008 * t - .105561342 * n - .063854175 * r) ** 3, o = (1.000000055 * t - .089484182 * n - 1.291485538 * r) ** 3, s = 1.227013851 * i - .55779998 * a + .281256149 * o, c = -.040580178 * i + 1.11225687 * a - .071676679 * o, l = -.076381285 * i - .421481978 * a + 1.58616322 * o;
|
|
1183
1193
|
return [
|
|
1184
1194
|
s * 100,
|
|
1185
1195
|
c * 100,
|
|
1186
1196
|
l * 100
|
|
1187
1197
|
];
|
|
1188
|
-
},
|
|
1189
|
-
let t = e[0] / 100, n = e[1] / 100, r = e[2] / 100, i = (t + .3963377774 * n + .2158037573 * r) ** 3, a = (t - .1055613458 * n - .0638541728 * r) ** 3, o = (t - .0894841775 * n - 1.291485548 * r) ** 3, s =
|
|
1198
|
+
}, y.oklab.rgb = function(e) {
|
|
1199
|
+
let t = e[0] / 100, n = e[1] / 100, r = e[2] / 100, i = (t + .3963377774 * n + .2158037573 * r) ** 3, a = (t - .1055613458 * n - .0638541728 * r) ** 3, o = (t - .0894841775 * n - 1.291485548 * r) ** 3, s = x(4.0767416621 * i - 3.3077115913 * a + .2309699292 * o), c = x(-1.2684380046 * i + 2.6097574011 * a - .3413193965 * o), l = x(-.0041960863 * i - .7034186147 * a + 1.707614701 * o);
|
|
1190
1200
|
return [
|
|
1191
1201
|
s * 255,
|
|
1192
1202
|
c * 255,
|
|
1193
1203
|
l * 255
|
|
1194
1204
|
];
|
|
1195
|
-
},
|
|
1196
|
-
return
|
|
1197
|
-
},
|
|
1205
|
+
}, y.oklch.oklab = function(e) {
|
|
1206
|
+
return y.lch.lab(e);
|
|
1207
|
+
}, y.lab.xyz = function(e) {
|
|
1198
1208
|
let t = e[0], n = e[1], r = e[2], i, a, o;
|
|
1199
1209
|
a = (t + 16) / 116, i = n / 500 + a, o = a - r / 200;
|
|
1200
1210
|
let s = a ** 3, c = i ** 3, l = o ** 3;
|
|
1201
|
-
return a = s >
|
|
1211
|
+
return a = s > b ? s : (a - 16 / 116) / 7.787, i = c > b ? c : (i - 16 / 116) / 7.787, o = l > b ? l : (o - 16 / 116) / 7.787, i *= 95.047, a *= 100, o *= 108.883, [
|
|
1202
1212
|
i,
|
|
1203
1213
|
a,
|
|
1204
1214
|
o
|
|
1205
1215
|
];
|
|
1206
|
-
},
|
|
1216
|
+
}, y.lab.lch = function(e) {
|
|
1207
1217
|
let t = e[0], n = e[1], r = e[2], i;
|
|
1208
1218
|
return i = Math.atan2(r, n) * 360 / 2 / Math.PI, i < 0 && (i += 360), [
|
|
1209
1219
|
t,
|
|
1210
1220
|
Math.sqrt(n * n + r * r),
|
|
1211
1221
|
i
|
|
1212
1222
|
];
|
|
1213
|
-
},
|
|
1223
|
+
}, y.lch.lab = function(e) {
|
|
1214
1224
|
let t = e[0], n = e[1], r = e[2] / 360 * 2 * Math.PI;
|
|
1215
1225
|
return [
|
|
1216
1226
|
t,
|
|
1217
1227
|
n * Math.cos(r),
|
|
1218
1228
|
n * Math.sin(r)
|
|
1219
1229
|
];
|
|
1220
|
-
},
|
|
1221
|
-
let [n, r, i] = e, a = t === null ?
|
|
1230
|
+
}, y.rgb.ansi16 = function(e, t = null) {
|
|
1231
|
+
let [n, r, i] = e, a = t === null ? y.rgb.hsv(e)[2] : t;
|
|
1222
1232
|
if (a = Math.round(a / 50), a === 0) return 30;
|
|
1223
1233
|
let o = 30 + (Math.round(i / 255) << 2 | Math.round(r / 255) << 1 | Math.round(n / 255));
|
|
1224
1234
|
return a === 2 && (o += 60), o;
|
|
1225
|
-
},
|
|
1226
|
-
return
|
|
1227
|
-
},
|
|
1235
|
+
}, y.hsv.ansi16 = function(e) {
|
|
1236
|
+
return y.rgb.ansi16(y.hsv.rgb(e), e[2]);
|
|
1237
|
+
}, y.rgb.ansi256 = function(e) {
|
|
1228
1238
|
let t = e[0], n = e[1], r = e[2];
|
|
1229
1239
|
return t >> 4 == n >> 4 && n >> 4 == r >> 4 ? t < 8 ? 16 : t > 248 ? 231 : Math.round((t - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(t / 255 * 5) + 6 * Math.round(n / 255 * 5) + Math.round(r / 255 * 5);
|
|
1230
|
-
},
|
|
1240
|
+
}, y.ansi16.rgb = function(e) {
|
|
1231
1241
|
e = e[0];
|
|
1232
1242
|
let t = e % 10;
|
|
1233
1243
|
if (t === 0 || t === 7) return e > 50 && (t += 3.5), t = t / 10.5 * 255, [
|
|
@@ -1241,7 +1251,7 @@ u.rgb.keyword = function(e) {
|
|
|
1241
1251
|
(t >> 1 & 1) * n * 255,
|
|
1242
1252
|
(t >> 2 & 1) * n * 255
|
|
1243
1253
|
];
|
|
1244
|
-
},
|
|
1254
|
+
}, y.ansi256.rgb = function(e) {
|
|
1245
1255
|
if (e = e[0], e >= 232) {
|
|
1246
1256
|
let t = (e - 232) * 10 + 8;
|
|
1247
1257
|
return [
|
|
@@ -1257,10 +1267,10 @@ u.rgb.keyword = function(e) {
|
|
|
1257
1267
|
Math.floor((t = e % 36) / 6) / 5 * 255,
|
|
1258
1268
|
t % 6 / 5 * 255
|
|
1259
1269
|
];
|
|
1260
|
-
},
|
|
1270
|
+
}, y.rgb.hex = function(e) {
|
|
1261
1271
|
let t = (((Math.round(e[0]) & 255) << 16) + ((Math.round(e[1]) & 255) << 8) + (Math.round(e[2]) & 255)).toString(16).toUpperCase();
|
|
1262
1272
|
return "000000".slice(t.length) + t;
|
|
1263
|
-
},
|
|
1273
|
+
}, y.hex.rgb = function(e) {
|
|
1264
1274
|
let t = e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);
|
|
1265
1275
|
if (!t) return [
|
|
1266
1276
|
0,
|
|
@@ -1275,28 +1285,28 @@ u.rgb.keyword = function(e) {
|
|
|
1275
1285
|
r >> 8 & 255,
|
|
1276
1286
|
r & 255
|
|
1277
1287
|
];
|
|
1278
|
-
},
|
|
1288
|
+
}, y.rgb.hcg = function(e) {
|
|
1279
1289
|
let t = e[0] / 255, n = e[1] / 255, r = e[2] / 255, i = Math.max(Math.max(t, n), r), a = Math.min(Math.min(t, n), r), o = i - a, s, c = o < 1 ? a / (1 - o) : 0;
|
|
1280
1290
|
return s = o <= 0 ? 0 : i === t ? (n - r) / o % 6 : i === n ? 2 + (r - t) / o : 4 + (t - n) / o, s /= 6, s %= 1, [
|
|
1281
1291
|
s * 360,
|
|
1282
1292
|
o * 100,
|
|
1283
1293
|
c * 100
|
|
1284
1294
|
];
|
|
1285
|
-
},
|
|
1295
|
+
}, y.hsl.hcg = function(e) {
|
|
1286
1296
|
let t = e[1] / 100, n = e[2] / 100, r = n < .5 ? 2 * t * n : 2 * t * (1 - n), i = 0;
|
|
1287
1297
|
return r < 1 && (i = (n - .5 * r) / (1 - r)), [
|
|
1288
1298
|
e[0],
|
|
1289
1299
|
r * 100,
|
|
1290
1300
|
i * 100
|
|
1291
1301
|
];
|
|
1292
|
-
},
|
|
1302
|
+
}, y.hsv.hcg = function(e) {
|
|
1293
1303
|
let t = e[1] / 100, n = e[2] / 100, r = t * n, i = 0;
|
|
1294
1304
|
return r < 1 && (i = (n - r) / (1 - r)), [
|
|
1295
1305
|
e[0],
|
|
1296
1306
|
r * 100,
|
|
1297
1307
|
i * 100
|
|
1298
1308
|
];
|
|
1299
|
-
},
|
|
1309
|
+
}, y.hcg.rgb = function(e) {
|
|
1300
1310
|
let t = e[0] / 360, n = e[1] / 100, r = e[2] / 100;
|
|
1301
1311
|
if (n === 0) return [
|
|
1302
1312
|
r * 255,
|
|
@@ -1331,97 +1341,97 @@ u.rgb.keyword = function(e) {
|
|
|
1331
1341
|
(n * i[1] + c) * 255,
|
|
1332
1342
|
(n * i[2] + c) * 255
|
|
1333
1343
|
];
|
|
1334
|
-
},
|
|
1344
|
+
}, y.hcg.hsv = function(e) {
|
|
1335
1345
|
let t = e[1] / 100, n = t + e[2] / 100 * (1 - t), r = 0;
|
|
1336
1346
|
return n > 0 && (r = t / n), [
|
|
1337
1347
|
e[0],
|
|
1338
1348
|
r * 100,
|
|
1339
1349
|
n * 100
|
|
1340
1350
|
];
|
|
1341
|
-
},
|
|
1351
|
+
}, y.hcg.hsl = function(e) {
|
|
1342
1352
|
let t = e[1] / 100, n = e[2] / 100 * (1 - t) + .5 * t, r = 0;
|
|
1343
1353
|
return n > 0 && n < .5 ? r = t / (2 * n) : n >= .5 && n < 1 && (r = t / (2 * (1 - n))), [
|
|
1344
1354
|
e[0],
|
|
1345
1355
|
r * 100,
|
|
1346
1356
|
n * 100
|
|
1347
1357
|
];
|
|
1348
|
-
},
|
|
1358
|
+
}, y.hcg.hwb = function(e) {
|
|
1349
1359
|
let t = e[1] / 100, n = t + e[2] / 100 * (1 - t);
|
|
1350
1360
|
return [
|
|
1351
1361
|
e[0],
|
|
1352
1362
|
(n - t) * 100,
|
|
1353
1363
|
(1 - n) * 100
|
|
1354
1364
|
];
|
|
1355
|
-
},
|
|
1365
|
+
}, y.hwb.hcg = function(e) {
|
|
1356
1366
|
let t = e[1] / 100, n = 1 - e[2] / 100, r = n - t, i = 0;
|
|
1357
1367
|
return r < 1 && (i = (n - r) / (1 - r)), [
|
|
1358
1368
|
e[0],
|
|
1359
1369
|
r * 100,
|
|
1360
1370
|
i * 100
|
|
1361
1371
|
];
|
|
1362
|
-
},
|
|
1372
|
+
}, y.apple.rgb = function(e) {
|
|
1363
1373
|
return [
|
|
1364
1374
|
e[0] / 65535 * 255,
|
|
1365
1375
|
e[1] / 65535 * 255,
|
|
1366
1376
|
e[2] / 65535 * 255
|
|
1367
1377
|
];
|
|
1368
|
-
},
|
|
1378
|
+
}, y.rgb.apple = function(e) {
|
|
1369
1379
|
return [
|
|
1370
1380
|
e[0] / 255 * 65535,
|
|
1371
1381
|
e[1] / 255 * 65535,
|
|
1372
1382
|
e[2] / 255 * 65535
|
|
1373
1383
|
];
|
|
1374
|
-
},
|
|
1384
|
+
}, y.gray.rgb = function(e) {
|
|
1375
1385
|
return [
|
|
1376
1386
|
e[0] / 100 * 255,
|
|
1377
1387
|
e[0] / 100 * 255,
|
|
1378
1388
|
e[0] / 100 * 255
|
|
1379
1389
|
];
|
|
1380
|
-
},
|
|
1390
|
+
}, y.gray.hsl = function(e) {
|
|
1381
1391
|
return [
|
|
1382
1392
|
0,
|
|
1383
1393
|
0,
|
|
1384
1394
|
e[0]
|
|
1385
1395
|
];
|
|
1386
|
-
},
|
|
1396
|
+
}, y.gray.hsv = y.gray.hsl, y.gray.hwb = function(e) {
|
|
1387
1397
|
return [
|
|
1388
1398
|
0,
|
|
1389
1399
|
100,
|
|
1390
1400
|
e[0]
|
|
1391
1401
|
];
|
|
1392
|
-
},
|
|
1402
|
+
}, y.gray.cmyk = function(e) {
|
|
1393
1403
|
return [
|
|
1394
1404
|
0,
|
|
1395
1405
|
0,
|
|
1396
1406
|
0,
|
|
1397
1407
|
e[0]
|
|
1398
1408
|
];
|
|
1399
|
-
},
|
|
1409
|
+
}, y.gray.lab = function(e) {
|
|
1400
1410
|
return [
|
|
1401
1411
|
e[0],
|
|
1402
1412
|
0,
|
|
1403
1413
|
0
|
|
1404
1414
|
];
|
|
1405
|
-
},
|
|
1415
|
+
}, y.gray.hex = function(e) {
|
|
1406
1416
|
let t = Math.round(e[0] / 100 * 255) & 255, n = ((t << 16) + (t << 8) + t).toString(16).toUpperCase();
|
|
1407
1417
|
return "000000".slice(n.length) + n;
|
|
1408
|
-
},
|
|
1418
|
+
}, y.rgb.gray = function(e) {
|
|
1409
1419
|
return [(e[0] + e[1] + e[2]) / 3 / 255 * 100];
|
|
1410
1420
|
};
|
|
1411
1421
|
//#endregion
|
|
1412
1422
|
//#region node_modules/.pnpm/color-convert@3.1.3/node_modules/color-convert/route.js
|
|
1413
|
-
function
|
|
1414
|
-
let e = {}, t = Object.keys(
|
|
1423
|
+
function w() {
|
|
1424
|
+
let e = {}, t = Object.keys(y);
|
|
1415
1425
|
for (let { length: n } = t, r = 0; r < n; r++) e[t[r]] = {
|
|
1416
1426
|
distance: -1,
|
|
1417
1427
|
parent: null
|
|
1418
1428
|
};
|
|
1419
1429
|
return e;
|
|
1420
1430
|
}
|
|
1421
|
-
function
|
|
1422
|
-
let t =
|
|
1431
|
+
function T(e) {
|
|
1432
|
+
let t = w(), n = [e];
|
|
1423
1433
|
for (t[e].distance = 0; n.length > 0;) {
|
|
1424
|
-
let e = n.pop(), r = Object.keys(
|
|
1434
|
+
let e = n.pop(), r = Object.keys(y[e]);
|
|
1425
1435
|
for (let { length: i } = r, a = 0; a < i; a++) {
|
|
1426
1436
|
let i = r[a], o = t[i];
|
|
1427
1437
|
o.distance === -1 && (o.distance = t[e].distance + 1, o.parent = e, n.unshift(i));
|
|
@@ -1429,35 +1439,35 @@ function g(e) {
|
|
|
1429
1439
|
}
|
|
1430
1440
|
return t;
|
|
1431
1441
|
}
|
|
1432
|
-
function
|
|
1442
|
+
function E(e, t) {
|
|
1433
1443
|
return function(n) {
|
|
1434
1444
|
return t(e(n));
|
|
1435
1445
|
};
|
|
1436
1446
|
}
|
|
1437
|
-
function
|
|
1438
|
-
let n = [t[e].parent, e], r =
|
|
1439
|
-
for (; t[i].parent;) n.unshift(t[i].parent), r =
|
|
1447
|
+
function D(e, t) {
|
|
1448
|
+
let n = [t[e].parent, e], r = y[t[e].parent][e], i = t[e].parent;
|
|
1449
|
+
for (; t[i].parent;) n.unshift(t[i].parent), r = E(y[t[i].parent][i], r), i = t[i].parent;
|
|
1440
1450
|
return r.conversion = n, r;
|
|
1441
1451
|
}
|
|
1442
|
-
function
|
|
1443
|
-
let t =
|
|
1452
|
+
function ee(e) {
|
|
1453
|
+
let t = T(e), n = {}, r = Object.keys(t);
|
|
1444
1454
|
for (let { length: e } = r, i = 0; i < e; i++) {
|
|
1445
1455
|
let e = r[i];
|
|
1446
|
-
t[e].parent !== null && (n[e] =
|
|
1456
|
+
t[e].parent !== null && (n[e] = D(e, t));
|
|
1447
1457
|
}
|
|
1448
1458
|
return n;
|
|
1449
1459
|
}
|
|
1450
1460
|
//#endregion
|
|
1451
1461
|
//#region node_modules/.pnpm/color-convert@3.1.3/node_modules/color-convert/index.js
|
|
1452
|
-
var
|
|
1453
|
-
function
|
|
1462
|
+
var O = {}, te = Object.keys(y);
|
|
1463
|
+
function ne(e) {
|
|
1454
1464
|
let t = function(...t) {
|
|
1455
1465
|
let n = t[0];
|
|
1456
1466
|
return n == null ? n : (n.length > 1 && (t = n), e(t));
|
|
1457
1467
|
};
|
|
1458
1468
|
return "conversion" in e && (t.conversion = e.conversion), t;
|
|
1459
1469
|
}
|
|
1460
|
-
function
|
|
1470
|
+
function re(e) {
|
|
1461
1471
|
let t = function(...t) {
|
|
1462
1472
|
let n = t[0];
|
|
1463
1473
|
if (n == null) return n;
|
|
@@ -1468,41 +1478,41 @@ function C(e) {
|
|
|
1468
1478
|
};
|
|
1469
1479
|
return "conversion" in e && (t.conversion = e.conversion), t;
|
|
1470
1480
|
}
|
|
1471
|
-
for (let e of
|
|
1472
|
-
|
|
1473
|
-
let t =
|
|
1481
|
+
for (let e of te) {
|
|
1482
|
+
O[e] = {}, Object.defineProperty(O[e], "channels", { value: y[e].channels }), Object.defineProperty(O[e], "labels", { value: y[e].labels });
|
|
1483
|
+
let t = ee(e), n = Object.keys(t);
|
|
1474
1484
|
for (let r of n) {
|
|
1475
1485
|
let n = t[r];
|
|
1476
|
-
|
|
1486
|
+
O[e][r] = re(n), O[e][r].raw = ne(n);
|
|
1477
1487
|
}
|
|
1478
1488
|
}
|
|
1479
1489
|
//#endregion
|
|
1480
1490
|
//#region node_modules/.pnpm/color@5.0.3/node_modules/color/index.js
|
|
1481
|
-
var
|
|
1491
|
+
var ie = [
|
|
1482
1492
|
"keyword",
|
|
1483
1493
|
"gray",
|
|
1484
1494
|
"hex"
|
|
1485
|
-
],
|
|
1486
|
-
for (let e of Object.keys(
|
|
1487
|
-
var
|
|
1488
|
-
function
|
|
1489
|
-
if (!(this instanceof
|
|
1490
|
-
if (t && t in
|
|
1495
|
+
], ae = {};
|
|
1496
|
+
for (let e of Object.keys(O)) ae[[...O[e].labels].sort().join("")] = e;
|
|
1497
|
+
var oe = {};
|
|
1498
|
+
function k(e, t) {
|
|
1499
|
+
if (!(this instanceof k)) return new k(e, t);
|
|
1500
|
+
if (t && t in ie && (t = null), t && !(t in O)) throw Error("Unknown model: " + t);
|
|
1491
1501
|
let n, r;
|
|
1492
1502
|
if (e == null) this.model = "rgb", this.color = [
|
|
1493
1503
|
0,
|
|
1494
1504
|
0,
|
|
1495
1505
|
0
|
|
1496
1506
|
], this.valpha = 1;
|
|
1497
|
-
else if (e instanceof
|
|
1507
|
+
else if (e instanceof k) this.model = e.model, this.color = [...e.color], this.valpha = e.valpha;
|
|
1498
1508
|
else if (typeof e == "string") {
|
|
1499
|
-
let t =
|
|
1509
|
+
let t = h.get(e);
|
|
1500
1510
|
if (t === null) throw Error("Unable to parse color from string: " + e);
|
|
1501
|
-
this.model = t.model, r =
|
|
1511
|
+
this.model = t.model, r = O[this.model].channels, this.color = t.value.slice(0, r), this.valpha = typeof t.value[r] == "number" ? t.value[r] : 1;
|
|
1502
1512
|
} else if (e.length > 0) {
|
|
1503
|
-
this.model = t || "rgb", r =
|
|
1513
|
+
this.model = t || "rgb", r = O[this.model].channels;
|
|
1504
1514
|
let n = Array.prototype.slice.call(e, 0, r);
|
|
1505
|
-
this.color =
|
|
1515
|
+
this.color = ue(n, r), this.valpha = typeof e[r] == "number" ? e[r] : 1;
|
|
1506
1516
|
} else if (typeof e == "number") this.model = "rgb", this.color = [
|
|
1507
1517
|
e >> 16 & 255,
|
|
1508
1518
|
e >> 8 & 255,
|
|
@@ -1513,19 +1523,19 @@ function D(e, t) {
|
|
|
1513
1523
|
let t = Object.keys(e);
|
|
1514
1524
|
"alpha" in e && (t.splice(t.indexOf("alpha"), 1), this.valpha = typeof e.alpha == "number" ? e.alpha : 0);
|
|
1515
1525
|
let r = t.sort().join("");
|
|
1516
|
-
if (!(r in
|
|
1517
|
-
this.model =
|
|
1518
|
-
let { labels: i } =
|
|
1526
|
+
if (!(r in ae)) throw Error("Unable to parse color from object: " + JSON.stringify(e));
|
|
1527
|
+
this.model = ae[r];
|
|
1528
|
+
let { labels: i } = O[this.model], a = [];
|
|
1519
1529
|
for (n = 0; n < i.length; n++) a.push(e[i[n]]);
|
|
1520
|
-
this.color =
|
|
1530
|
+
this.color = ue(a);
|
|
1521
1531
|
}
|
|
1522
|
-
if (
|
|
1523
|
-
let e =
|
|
1532
|
+
if (oe[this.model]) for (r = O[this.model].channels, n = 0; n < r; n++) {
|
|
1533
|
+
let e = oe[this.model][n];
|
|
1524
1534
|
e && (this.color[n] = e(this.color[n]));
|
|
1525
1535
|
}
|
|
1526
1536
|
this.valpha = Math.max(0, Math.min(1, this.valpha)), Object.freeze && Object.freeze(this);
|
|
1527
1537
|
}
|
|
1528
|
-
|
|
1538
|
+
k.prototype = {
|
|
1529
1539
|
toString() {
|
|
1530
1540
|
return this.string();
|
|
1531
1541
|
},
|
|
@@ -1533,20 +1543,20 @@ D.prototype = {
|
|
|
1533
1543
|
return this[this.model]();
|
|
1534
1544
|
},
|
|
1535
1545
|
string(e) {
|
|
1536
|
-
let t = this.model in
|
|
1546
|
+
let t = this.model in h.to ? this : this.rgb();
|
|
1537
1547
|
t = t.round(typeof e == "number" ? e : 1);
|
|
1538
1548
|
let n = t.valpha === 1 ? t.color : [...t.color, this.valpha];
|
|
1539
|
-
return
|
|
1549
|
+
return h.to[t.model](...n);
|
|
1540
1550
|
},
|
|
1541
1551
|
percentString(e) {
|
|
1542
1552
|
let t = this.rgb().round(typeof e == "number" ? e : 1), n = t.valpha === 1 ? t.color : [...t.color, this.valpha];
|
|
1543
|
-
return
|
|
1553
|
+
return h.to.rgb.percent(...n);
|
|
1544
1554
|
},
|
|
1545
1555
|
array() {
|
|
1546
1556
|
return this.valpha === 1 ? [...this.color] : [...this.color, this.valpha];
|
|
1547
1557
|
},
|
|
1548
1558
|
object() {
|
|
1549
|
-
let e = {}, { channels: t } =
|
|
1559
|
+
let e = {}, { channels: t } = O[this.model], { labels: n } = O[this.model];
|
|
1550
1560
|
for (let r = 0; r < t; r++) e[n[r]] = this.color[r];
|
|
1551
1561
|
return this.valpha !== 1 && (e.alpha = this.valpha), e;
|
|
1552
1562
|
},
|
|
@@ -1559,49 +1569,49 @@ D.prototype = {
|
|
|
1559
1569
|
return e.r /= 255, e.g /= 255, e.b /= 255, this.valpha !== 1 && (e.alpha = this.valpha), e;
|
|
1560
1570
|
},
|
|
1561
1571
|
round(e) {
|
|
1562
|
-
return e = Math.max(e || 0, 0), new
|
|
1572
|
+
return e = Math.max(e || 0, 0), new k([...this.color.map(ce(e)), this.valpha], this.model);
|
|
1563
1573
|
},
|
|
1564
1574
|
alpha(e) {
|
|
1565
|
-
return e === void 0 ? this.valpha : new
|
|
1575
|
+
return e === void 0 ? this.valpha : new k([...this.color, Math.max(0, Math.min(1, e))], this.model);
|
|
1566
1576
|
},
|
|
1567
|
-
red:
|
|
1568
|
-
green:
|
|
1569
|
-
blue:
|
|
1570
|
-
hue:
|
|
1577
|
+
red: A("rgb", 0, j(255)),
|
|
1578
|
+
green: A("rgb", 1, j(255)),
|
|
1579
|
+
blue: A("rgb", 2, j(255)),
|
|
1580
|
+
hue: A([
|
|
1571
1581
|
"hsl",
|
|
1572
1582
|
"hsv",
|
|
1573
1583
|
"hsl",
|
|
1574
1584
|
"hwb",
|
|
1575
1585
|
"hcg"
|
|
1576
1586
|
], 0, (e) => (e % 360 + 360) % 360),
|
|
1577
|
-
saturationl:
|
|
1578
|
-
lightness:
|
|
1579
|
-
saturationv:
|
|
1580
|
-
value:
|
|
1581
|
-
chroma:
|
|
1582
|
-
gray:
|
|
1583
|
-
white:
|
|
1584
|
-
wblack:
|
|
1585
|
-
cyan:
|
|
1586
|
-
magenta:
|
|
1587
|
-
yellow:
|
|
1588
|
-
black:
|
|
1589
|
-
x:
|
|
1590
|
-
y:
|
|
1591
|
-
z:
|
|
1592
|
-
l:
|
|
1593
|
-
a:
|
|
1594
|
-
b:
|
|
1587
|
+
saturationl: A("hsl", 1, j(100)),
|
|
1588
|
+
lightness: A("hsl", 2, j(100)),
|
|
1589
|
+
saturationv: A("hsv", 1, j(100)),
|
|
1590
|
+
value: A("hsv", 2, j(100)),
|
|
1591
|
+
chroma: A("hcg", 1, j(100)),
|
|
1592
|
+
gray: A("hcg", 2, j(100)),
|
|
1593
|
+
white: A("hwb", 1, j(100)),
|
|
1594
|
+
wblack: A("hwb", 2, j(100)),
|
|
1595
|
+
cyan: A("cmyk", 0, j(100)),
|
|
1596
|
+
magenta: A("cmyk", 1, j(100)),
|
|
1597
|
+
yellow: A("cmyk", 2, j(100)),
|
|
1598
|
+
black: A("cmyk", 3, j(100)),
|
|
1599
|
+
x: A("xyz", 0, j(95.047)),
|
|
1600
|
+
y: A("xyz", 1, j(100)),
|
|
1601
|
+
z: A("xyz", 2, j(108.833)),
|
|
1602
|
+
l: A("lab", 0, j(100)),
|
|
1603
|
+
a: A("lab", 1),
|
|
1604
|
+
b: A("lab", 2),
|
|
1595
1605
|
keyword(e) {
|
|
1596
|
-
return e === void 0 ?
|
|
1606
|
+
return e === void 0 ? O[this.model].keyword(this.color) : new k(e);
|
|
1597
1607
|
},
|
|
1598
1608
|
hex(e) {
|
|
1599
|
-
return e === void 0 ?
|
|
1609
|
+
return e === void 0 ? h.to.hex(...this.rgb().round().color) : new k(e);
|
|
1600
1610
|
},
|
|
1601
1611
|
hexa(e) {
|
|
1602
|
-
if (e !== void 0) return new
|
|
1612
|
+
if (e !== void 0) return new k(e);
|
|
1603
1613
|
let t = this.rgb().round().color, n = Math.round(this.valpha * 255).toString(16).toUpperCase();
|
|
1604
|
-
return n.length === 1 && (n = "0" + n),
|
|
1614
|
+
return n.length === 1 && (n = "0" + n), h.to.hex(...t) + n;
|
|
1605
1615
|
},
|
|
1606
1616
|
rgbNumber() {
|
|
1607
1617
|
let e = this.rgb().color;
|
|
@@ -1661,7 +1671,7 @@ D.prototype = {
|
|
|
1661
1671
|
},
|
|
1662
1672
|
grayscale() {
|
|
1663
1673
|
let e = this.rgb().color, t = e[0] * .3 + e[1] * .59 + e[2] * .11;
|
|
1664
|
-
return
|
|
1674
|
+
return k.rgb(t, t, t);
|
|
1665
1675
|
},
|
|
1666
1676
|
fade(e) {
|
|
1667
1677
|
return this.alpha(this.valpha - this.valpha * e);
|
|
@@ -1676,55 +1686,55 @@ D.prototype = {
|
|
|
1676
1686
|
mix(e, t) {
|
|
1677
1687
|
if (!e || !e.rgb) throw Error("Argument to \"mix\" was not a Color instance, but rather an instance of " + typeof e);
|
|
1678
1688
|
let n = e.rgb(), r = this.rgb(), i = t === void 0 ? .5 : t, a = 2 * i - 1, o = n.alpha() - r.alpha(), s = ((a * o === -1 ? a : (a + o) / (1 + a * o)) + 1) / 2, c = 1 - s;
|
|
1679
|
-
return
|
|
1689
|
+
return k.rgb(s * n.red() + c * r.red(), s * n.green() + c * r.green(), s * n.blue() + c * r.blue(), n.alpha() * i + r.alpha() * (1 - i));
|
|
1680
1690
|
}
|
|
1681
1691
|
};
|
|
1682
|
-
for (let e of Object.keys(
|
|
1683
|
-
if (
|
|
1684
|
-
let { channels: t } =
|
|
1685
|
-
|
|
1686
|
-
return this.model === e ? new
|
|
1687
|
-
},
|
|
1692
|
+
for (let e of Object.keys(O)) {
|
|
1693
|
+
if (ie.includes(e)) continue;
|
|
1694
|
+
let { channels: t } = O[e];
|
|
1695
|
+
k.prototype[e] = function(...t) {
|
|
1696
|
+
return this.model === e ? new k(this) : t.length > 0 ? new k(t, e) : new k([...le(O[this.model][e].raw(this.color)), this.valpha], e);
|
|
1697
|
+
}, k[e] = function(...n) {
|
|
1688
1698
|
let r = n[0];
|
|
1689
|
-
return typeof r == "number" && (r =
|
|
1699
|
+
return typeof r == "number" && (r = ue(n, t)), new k(r, e);
|
|
1690
1700
|
};
|
|
1691
1701
|
}
|
|
1692
|
-
function
|
|
1702
|
+
function se(e, t) {
|
|
1693
1703
|
return Number(e.toFixed(t));
|
|
1694
1704
|
}
|
|
1695
|
-
function
|
|
1705
|
+
function ce(e) {
|
|
1696
1706
|
return function(t) {
|
|
1697
|
-
return
|
|
1707
|
+
return se(t, e);
|
|
1698
1708
|
};
|
|
1699
1709
|
}
|
|
1700
|
-
function
|
|
1710
|
+
function A(e, t, n) {
|
|
1701
1711
|
e = Array.isArray(e) ? e : [e];
|
|
1702
|
-
for (let r of e) (
|
|
1712
|
+
for (let r of e) (oe[r] ||= [])[t] = n;
|
|
1703
1713
|
return e = e[0], function(r) {
|
|
1704
1714
|
let i;
|
|
1705
1715
|
return r === void 0 ? (i = this[e]().color[t], n && (i = n(i)), i) : (n && (r = n(r)), i = this[e](), i.color[t] = r, i);
|
|
1706
1716
|
};
|
|
1707
1717
|
}
|
|
1708
|
-
function
|
|
1718
|
+
function j(e) {
|
|
1709
1719
|
return function(t) {
|
|
1710
1720
|
return Math.max(0, Math.min(e, t));
|
|
1711
1721
|
};
|
|
1712
1722
|
}
|
|
1713
|
-
function
|
|
1723
|
+
function le(e) {
|
|
1714
1724
|
return Array.isArray(e) ? e : [e];
|
|
1715
1725
|
}
|
|
1716
|
-
function
|
|
1726
|
+
function ue(e, t) {
|
|
1717
1727
|
for (let n = 0; n < t; n++) typeof e[n] != "number" && (e[n] = 0);
|
|
1718
1728
|
return e;
|
|
1719
1729
|
}
|
|
1720
1730
|
//#endregion
|
|
1721
1731
|
//#region packages/themes/token.js
|
|
1722
|
-
var
|
|
1732
|
+
var M = {
|
|
1723
1733
|
colorPrimary: "#1677ff",
|
|
1724
1734
|
colorWarning: "#ffaa00",
|
|
1725
1735
|
colorError: "#ff4d4f",
|
|
1726
1736
|
colorText: "#ffffff"
|
|
1727
|
-
},
|
|
1737
|
+
}, N = {
|
|
1728
1738
|
viewBgc: "#383838",
|
|
1729
1739
|
compBgc: "#141414",
|
|
1730
1740
|
borderColor: "#444444",
|
|
@@ -1735,132 +1745,175 @@ var A = {
|
|
|
1735
1745
|
hoverWhite: "#ececec",
|
|
1736
1746
|
fontSize: 14,
|
|
1737
1747
|
iconSize: 18
|
|
1738
|
-
},
|
|
1748
|
+
}, de = "os-theme-light", fe = "small", pe = {
|
|
1749
|
+
ok: "#00c291",
|
|
1750
|
+
ng: "#f56c6c"
|
|
1751
|
+
}, me = k("os-theme-light".includes("light") ? "#ffffff" : "#000000").alpha(.44).string(), he = "#ffffff", ge = "#000000", _e = k(M.colorText).alpha(.45).string(), ve = k(M.colorPrimary).alpha(.3).string(), ye = k(M.colorPrimary).desaturate(.45).string(), be = k(N.borderColor).whiten(.25).string(), xe = k(N.compBgc).mix(k("white"), .1).string(), P = k(N.hoverWhite).alpha(.15).string(), Se = `linear-gradient(90deg, ${k(M.colorPrimary).alpha(.92).string()} 0%, ${k(M.colorPrimary).darken(.3).string()} 100%)`, F = {
|
|
1739
1752
|
token: {
|
|
1740
|
-
colorPrimary:
|
|
1741
|
-
colorWarning:
|
|
1742
|
-
colorError:
|
|
1743
|
-
borderRadiusLG:
|
|
1744
|
-
colorText:
|
|
1745
|
-
colorTextDescription:
|
|
1746
|
-
colorTextPlaceholder:
|
|
1747
|
-
colorBgContainer:
|
|
1748
|
-
colorBgElevated:
|
|
1749
|
-
colorIcon:
|
|
1750
|
-
colorBorder:
|
|
1751
|
-
controlItemBgActive:
|
|
1752
|
-
colorTextDisabled:
|
|
1753
|
-
colorBgContainerDisabled:
|
|
1753
|
+
colorPrimary: M.colorPrimary,
|
|
1754
|
+
colorWarning: M.colorWarning,
|
|
1755
|
+
colorError: M.colorError,
|
|
1756
|
+
borderRadiusLG: "4px",
|
|
1757
|
+
colorText: M.colorText,
|
|
1758
|
+
colorTextDescription: _e,
|
|
1759
|
+
colorTextPlaceholder: _e,
|
|
1760
|
+
colorBgContainer: N.compBgc,
|
|
1761
|
+
colorBgElevated: N.compBgc,
|
|
1762
|
+
colorIcon: N.iconColor,
|
|
1763
|
+
colorBorder: N.borderColor,
|
|
1764
|
+
controlItemBgActive: ve,
|
|
1765
|
+
colorTextDisabled: N.disabledColor,
|
|
1766
|
+
colorBgContainerDisabled: k(N.disabledColor).lighten(.8).alpha(.08).string(),
|
|
1754
1767
|
controlOutlineWidth: 0,
|
|
1755
|
-
colorBorderDisabled:
|
|
1756
|
-
colorTextQuaternary:
|
|
1768
|
+
colorBorderDisabled: be,
|
|
1769
|
+
colorTextQuaternary: _e
|
|
1757
1770
|
},
|
|
1758
1771
|
components: {
|
|
1759
|
-
|
|
1772
|
+
Layout: {
|
|
1773
|
+
bodyBg: ge,
|
|
1774
|
+
footerBg: N.compBgc,
|
|
1775
|
+
headerBg: N.compBgc,
|
|
1776
|
+
siderBg: N.compBgc,
|
|
1777
|
+
colorText: M.colorText,
|
|
1778
|
+
headerColor: M.colorText,
|
|
1779
|
+
descHintHoverColor: ye,
|
|
1780
|
+
footerPadding: "5px",
|
|
1781
|
+
layoutGap: "5px",
|
|
1782
|
+
layoutContentBg: N.compBgc
|
|
1783
|
+
},
|
|
1784
|
+
Badge: { colorBorderBg: M.colorError },
|
|
1760
1785
|
Tooltip: { colorBgSpotlight: "#424242" },
|
|
1786
|
+
Switch: { colorTextTertiary: k(N.hoverWhite).alpha(.65).string() },
|
|
1761
1787
|
Button: {
|
|
1762
|
-
borderColorDisabled:
|
|
1763
|
-
primaryShadow: "none"
|
|
1788
|
+
borderColorDisabled: be,
|
|
1789
|
+
primaryShadow: "none",
|
|
1790
|
+
colorBgSolid: he,
|
|
1791
|
+
solidTextColor: ge,
|
|
1792
|
+
colorBgSolidHover: k(he).darken(.25).string(),
|
|
1793
|
+
colorBgSolidActive: k(he).darken(.05).string()
|
|
1764
1794
|
},
|
|
1765
1795
|
Select: {
|
|
1766
|
-
controlItemBgActiveHover:
|
|
1767
|
-
optionActiveBg:
|
|
1796
|
+
controlItemBgActiveHover: ye,
|
|
1797
|
+
optionActiveBg: P
|
|
1768
1798
|
},
|
|
1769
1799
|
Modal: {
|
|
1770
1800
|
padding: "10px",
|
|
1771
1801
|
contentPadding: 0,
|
|
1772
|
-
contentBg:
|
|
1773
|
-
titleColor:
|
|
1774
|
-
colorText:
|
|
1802
|
+
contentBg: N.compBgc,
|
|
1803
|
+
titleColor: M.colorPrimary,
|
|
1804
|
+
colorText: M.colorText,
|
|
1775
1805
|
titleLineHeight: "44px",
|
|
1776
1806
|
algorithm: !0,
|
|
1777
1807
|
headerMarginBottom: 0,
|
|
1778
1808
|
footerMarginTop: 0,
|
|
1779
|
-
colorIcon:
|
|
1780
|
-
colorIconHover:
|
|
1809
|
+
colorIcon: N.iconColor,
|
|
1810
|
+
colorIconHover: N.iconColor,
|
|
1811
|
+
colorBgTextHover: M.colorError
|
|
1781
1812
|
},
|
|
1782
1813
|
Message: {
|
|
1783
1814
|
colorTextHeading: "inherit",
|
|
1784
|
-
contentBg:
|
|
1815
|
+
contentBg: N.infoColor
|
|
1785
1816
|
},
|
|
1786
1817
|
ColorPicker: {
|
|
1787
1818
|
popoverInnerPadding: "8px",
|
|
1788
1819
|
marginSm: "8px"
|
|
1789
1820
|
},
|
|
1790
1821
|
DatePicker: {
|
|
1791
|
-
colorIcon:
|
|
1792
|
-
cellActiveWithRangeBg:
|
|
1793
|
-
cellHoverBg:
|
|
1822
|
+
colorIcon: N.iconColor,
|
|
1823
|
+
cellActiveWithRangeBg: ve,
|
|
1824
|
+
cellHoverBg: P,
|
|
1825
|
+
datePickerTimeBgActiveHover: ye
|
|
1794
1826
|
},
|
|
1795
1827
|
Table: {
|
|
1796
|
-
borderColor:
|
|
1797
|
-
footerBg:
|
|
1798
|
-
headerBg:
|
|
1799
|
-
rowHoverBg:
|
|
1800
|
-
rowSelectedHoverBg:
|
|
1801
|
-
stickyScrollBarBg:
|
|
1802
|
-
colorSplit:
|
|
1828
|
+
borderColor: N.borderColor,
|
|
1829
|
+
footerBg: xe,
|
|
1830
|
+
headerBg: xe,
|
|
1831
|
+
rowHoverBg: P,
|
|
1832
|
+
rowSelectedHoverBg: ye,
|
|
1833
|
+
stickyScrollBarBg: me,
|
|
1834
|
+
colorSplit: me,
|
|
1835
|
+
tableCellPadding: "2px",
|
|
1836
|
+
tableCellHeight: "32px"
|
|
1837
|
+
},
|
|
1838
|
+
Segmented: {
|
|
1839
|
+
controlHeightLg: "24px",
|
|
1840
|
+
controlPaddingHorizontal: "13px",
|
|
1841
|
+
marginSm: "0px",
|
|
1842
|
+
trackBg: "transparent",
|
|
1843
|
+
itemColor: M.colorText,
|
|
1844
|
+
itemActiveBg: ve,
|
|
1845
|
+
itemSelectedBg: Se,
|
|
1846
|
+
itemHoverBg: P,
|
|
1847
|
+
fontSizeLg: "15px"
|
|
1848
|
+
},
|
|
1849
|
+
Tabs: {
|
|
1850
|
+
cardGutter: "6px",
|
|
1851
|
+
tabsItemHoverBg: P
|
|
1852
|
+
},
|
|
1853
|
+
Descriptions: {
|
|
1854
|
+
colorSplit: N.borderColor,
|
|
1855
|
+
colorTextSecondary: M.colorText
|
|
1803
1856
|
}
|
|
1804
1857
|
}
|
|
1805
|
-
},
|
|
1806
|
-
let t = e.split("."), n =
|
|
1858
|
+
}, Ce = (e) => {
|
|
1859
|
+
let t = e.split("."), n = F.components;
|
|
1807
1860
|
for (let e of t) n = n[e];
|
|
1808
|
-
return n ===
|
|
1809
|
-
}, { getDesignToken:
|
|
1810
|
-
...
|
|
1811
|
-
...
|
|
1812
|
-
},
|
|
1813
|
-
...
|
|
1814
|
-
...
|
|
1815
|
-
},
|
|
1861
|
+
return n === F.components ? null : n;
|
|
1862
|
+
}, { getDesignToken: we } = e, Te = we(F), Ee = {
|
|
1863
|
+
...F.token,
|
|
1864
|
+
...N
|
|
1865
|
+
}, De = {
|
|
1866
|
+
...Te,
|
|
1867
|
+
...N
|
|
1868
|
+
}, I = (e) => typeof e == "string", L = () => {
|
|
1816
1869
|
let e, t, n = new Promise((n, r) => {
|
|
1817
1870
|
e = n, t = r;
|
|
1818
1871
|
});
|
|
1819
1872
|
return n.resolve = e, n.reject = t, n;
|
|
1820
|
-
},
|
|
1873
|
+
}, Oe = (e) => e == null ? "" : String(e), ke = (e, t, n) => {
|
|
1821
1874
|
e.forEach((e) => {
|
|
1822
1875
|
t[e] && (n[e] = t[e]);
|
|
1823
1876
|
});
|
|
1824
|
-
},
|
|
1825
|
-
let r =
|
|
1877
|
+
}, Ae = /###/g, je = (e) => e && e.includes("###") ? e.replace(Ae, ".") : e, Me = (e) => !e || I(e), R = (e, t, n) => {
|
|
1878
|
+
let r = I(t) ? t.split(".") : t, i = 0;
|
|
1826
1879
|
for (; i < r.length - 1;) {
|
|
1827
|
-
if (
|
|
1828
|
-
let t =
|
|
1880
|
+
if (Me(e)) return {};
|
|
1881
|
+
let t = je(r[i]);
|
|
1829
1882
|
!e[t] && n && (e[t] = new n()), e = Object.prototype.hasOwnProperty.call(e, t) ? e[t] : {}, ++i;
|
|
1830
1883
|
}
|
|
1831
|
-
return
|
|
1884
|
+
return Me(e) ? {} : {
|
|
1832
1885
|
obj: e,
|
|
1833
|
-
k:
|
|
1886
|
+
k: je(r[i])
|
|
1834
1887
|
};
|
|
1835
|
-
},
|
|
1836
|
-
let { obj: r, k: i } =
|
|
1888
|
+
}, Ne = (e, t, n) => {
|
|
1889
|
+
let { obj: r, k: i } = R(e, t, Object);
|
|
1837
1890
|
if (r !== void 0 || t.length === 1) {
|
|
1838
1891
|
r[i] = n;
|
|
1839
1892
|
return;
|
|
1840
1893
|
}
|
|
1841
|
-
let a = t[t.length - 1], o = t.slice(0, t.length - 1), s =
|
|
1842
|
-
for (; s.obj === void 0 && o.length;) a = `${o[o.length - 1]}.${a}`, o = o.slice(0, o.length - 1), s =
|
|
1894
|
+
let a = t[t.length - 1], o = t.slice(0, t.length - 1), s = R(e, o, Object);
|
|
1895
|
+
for (; s.obj === void 0 && o.length;) a = `${o[o.length - 1]}.${a}`, o = o.slice(0, o.length - 1), s = R(e, o, Object), s?.obj && s.obj[`${s.k}.${a}`] !== void 0 && (s.obj = void 0);
|
|
1843
1896
|
s.obj[`${s.k}.${a}`] = n;
|
|
1844
|
-
},
|
|
1845
|
-
let { obj: i, k: a } =
|
|
1897
|
+
}, Pe = (e, t, n, r) => {
|
|
1898
|
+
let { obj: i, k: a } = R(e, t, Object);
|
|
1846
1899
|
i[a] = i[a] || [], i[a].push(n);
|
|
1847
|
-
},
|
|
1848
|
-
let { obj: n, k: r } =
|
|
1900
|
+
}, Fe = (e, t) => {
|
|
1901
|
+
let { obj: n, k: r } = R(e, t);
|
|
1849
1902
|
if (n && Object.prototype.hasOwnProperty.call(n, r)) return n[r];
|
|
1850
|
-
},
|
|
1851
|
-
let r =
|
|
1852
|
-
return r === void 0 ?
|
|
1853
|
-
},
|
|
1854
|
-
for (let r in t) r !== "__proto__" && r !== "constructor" && (Object.prototype.hasOwnProperty.call(e, r) ?
|
|
1903
|
+
}, Ie = (e, t, n) => {
|
|
1904
|
+
let r = Fe(e, n);
|
|
1905
|
+
return r === void 0 ? Fe(t, n) : r;
|
|
1906
|
+
}, Le = (e, t, n) => {
|
|
1907
|
+
for (let r in t) r !== "__proto__" && r !== "constructor" && (Object.prototype.hasOwnProperty.call(e, r) ? I(e[r]) || e[r] instanceof String || I(t[r]) || t[r] instanceof String ? n && (e[r] = t[r]) : Le(e[r], t[r], n) : e[r] = t[r]);
|
|
1855
1908
|
return e;
|
|
1856
|
-
},
|
|
1909
|
+
}, z = (e) => e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), Re = {
|
|
1857
1910
|
"&": "&",
|
|
1858
1911
|
"<": "<",
|
|
1859
1912
|
">": ">",
|
|
1860
1913
|
"\"": """,
|
|
1861
1914
|
"'": "'",
|
|
1862
1915
|
"/": "/"
|
|
1863
|
-
},
|
|
1916
|
+
}, ze = (e) => I(e) ? e.replace(/[&<>"'\/]/g, (e) => Re[e]) : e, Be = class {
|
|
1864
1917
|
constructor(e) {
|
|
1865
1918
|
this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
1866
1919
|
}
|
|
@@ -1870,23 +1923,23 @@ var A = {
|
|
|
1870
1923
|
let n = new RegExp(e);
|
|
1871
1924
|
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, n), this.regExpQueue.push(e), n;
|
|
1872
1925
|
}
|
|
1873
|
-
},
|
|
1926
|
+
}, Ve = [
|
|
1874
1927
|
" ",
|
|
1875
1928
|
",",
|
|
1876
1929
|
"?",
|
|
1877
1930
|
"!",
|
|
1878
1931
|
";"
|
|
1879
|
-
],
|
|
1932
|
+
], He = new Be(20), Ue = (e, t, n) => {
|
|
1880
1933
|
t ||= "", n ||= "";
|
|
1881
|
-
let r =
|
|
1934
|
+
let r = Ve.filter((e) => !t.includes(e) && !n.includes(e));
|
|
1882
1935
|
if (r.length === 0) return !0;
|
|
1883
|
-
let i =
|
|
1936
|
+
let i = He.getRegExp(`(${r.map((e) => e === "?" ? "\\?" : e).join("|")})`), a = !i.test(e);
|
|
1884
1937
|
if (!a) {
|
|
1885
1938
|
let t = e.indexOf(n);
|
|
1886
1939
|
t > 0 && !i.test(e.substring(0, t)) && (a = !0);
|
|
1887
1940
|
}
|
|
1888
1941
|
return a;
|
|
1889
|
-
},
|
|
1942
|
+
}, We = (e, t, n = ".") => {
|
|
1890
1943
|
if (!e) return;
|
|
1891
1944
|
if (e[t]) return Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
|
|
1892
1945
|
let r = t.split(n), i = e;
|
|
@@ -1905,7 +1958,7 @@ var A = {
|
|
|
1905
1958
|
i = t;
|
|
1906
1959
|
}
|
|
1907
1960
|
return i;
|
|
1908
|
-
},
|
|
1961
|
+
}, B = (e) => e?.replace(/_/g, "-"), Ge = {
|
|
1909
1962
|
type: "logger",
|
|
1910
1963
|
log(e) {
|
|
1911
1964
|
this.output("log", e);
|
|
@@ -1919,12 +1972,12 @@ var A = {
|
|
|
1919
1972
|
output(e, t) {
|
|
1920
1973
|
console?.[e]?.apply?.(console, t);
|
|
1921
1974
|
}
|
|
1922
|
-
},
|
|
1975
|
+
}, V = new class e {
|
|
1923
1976
|
constructor(e, t = {}) {
|
|
1924
1977
|
this.init(e, t);
|
|
1925
1978
|
}
|
|
1926
1979
|
init(e, t = {}) {
|
|
1927
|
-
this.prefix = t.prefix || "i18next:", this.logger = e ||
|
|
1980
|
+
this.prefix = t.prefix || "i18next:", this.logger = e || Ge, this.options = t, this.debug = t.debug;
|
|
1928
1981
|
}
|
|
1929
1982
|
log(...e) {
|
|
1930
1983
|
return this.forward(e, "log", "", !0);
|
|
@@ -1939,7 +1992,7 @@ var A = {
|
|
|
1939
1992
|
return this.forward(e, "warn", "WARNING DEPRECATED: ", !0);
|
|
1940
1993
|
}
|
|
1941
1994
|
forward(e, t, n, r) {
|
|
1942
|
-
return r && !this.debug ? null : (e = e.map((e) =>
|
|
1995
|
+
return r && !this.debug ? null : (e = e.map((e) => I(e) ? e.replace(/[\r\n\x00-\x1F\x7F]/g, " ") : e), I(e[0]) && (e[0] = `${n}${this.prefix} ${e[0]}`), this.logger[t](e));
|
|
1943
1996
|
}
|
|
1944
1997
|
create(t) {
|
|
1945
1998
|
return new e(this.logger, {
|
|
@@ -1950,7 +2003,7 @@ var A = {
|
|
|
1950
2003
|
clone(t) {
|
|
1951
2004
|
return t ||= this.options, t.prefix = t.prefix || this.prefix, new e(this.logger, t);
|
|
1952
2005
|
}
|
|
1953
|
-
}(),
|
|
2006
|
+
}(), H = class {
|
|
1954
2007
|
constructor() {
|
|
1955
2008
|
this.observers = {};
|
|
1956
2009
|
}
|
|
@@ -1983,7 +2036,7 @@ var A = {
|
|
|
1983
2036
|
for (let i = 0; i < r; i++) n(e, ...t);
|
|
1984
2037
|
});
|
|
1985
2038
|
}
|
|
1986
|
-
},
|
|
2039
|
+
}, Ke = class extends H {
|
|
1987
2040
|
constructor(e, t = {
|
|
1988
2041
|
ns: ["translation"],
|
|
1989
2042
|
defaultNS: "translation"
|
|
@@ -1999,16 +2052,16 @@ var A = {
|
|
|
1999
2052
|
}
|
|
2000
2053
|
getResource(e, t, n, r = {}) {
|
|
2001
2054
|
let i = r.keySeparator === void 0 ? this.options.keySeparator : r.keySeparator, a = r.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : r.ignoreJSONStructure, o;
|
|
2002
|
-
e.includes(".") ? o = e.split(".") : (o = [e, t], n && (Array.isArray(n) ? o.push(...n) :
|
|
2003
|
-
let s =
|
|
2004
|
-
return !s && !t && !n && e.includes(".") && (e = o[0], t = o[1], n = o.slice(2).join(".")), s || !a || !
|
|
2055
|
+
e.includes(".") ? o = e.split(".") : (o = [e, t], n && (Array.isArray(n) ? o.push(...n) : I(n) && i ? o.push(...n.split(i)) : o.push(n)));
|
|
2056
|
+
let s = Fe(this.data, o);
|
|
2057
|
+
return !s && !t && !n && e.includes(".") && (e = o[0], t = o[1], n = o.slice(2).join(".")), s || !a || !I(n) ? s : We(this.data?.[e]?.[t], n, i);
|
|
2005
2058
|
}
|
|
2006
2059
|
addResource(e, t, n, r, i = { silent: !1 }) {
|
|
2007
2060
|
let a = i.keySeparator === void 0 ? this.options.keySeparator : i.keySeparator, o = [e, t];
|
|
2008
|
-
n && (o = o.concat(a ? n.split(a) : n)), e.includes(".") && (o = e.split("."), r = t, t = o[1]), this.addNamespaces(t),
|
|
2061
|
+
n && (o = o.concat(a ? n.split(a) : n)), e.includes(".") && (o = e.split("."), r = t, t = o[1]), this.addNamespaces(t), Ne(this.data, o, r), i.silent || this.emit("added", e, t, n, r);
|
|
2009
2062
|
}
|
|
2010
2063
|
addResources(e, t, n, r = { silent: !1 }) {
|
|
2011
|
-
for (let r in n) (
|
|
2064
|
+
for (let r in n) (I(n[r]) || Array.isArray(n[r])) && this.addResource(e, t, r, n[r], { silent: !0 });
|
|
2012
2065
|
r.silent || this.emit("added", e, t, n);
|
|
2013
2066
|
}
|
|
2014
2067
|
addResourceBundle(e, t, n, r, i, a = {
|
|
@@ -2017,11 +2070,11 @@ var A = {
|
|
|
2017
2070
|
}) {
|
|
2018
2071
|
let o = [e, t];
|
|
2019
2072
|
e.includes(".") && (o = e.split("."), r = n, n = t, t = o[1]), this.addNamespaces(t);
|
|
2020
|
-
let s =
|
|
2021
|
-
a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ?
|
|
2073
|
+
let s = Fe(this.data, o) || {};
|
|
2074
|
+
a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ? Le(s, n, i) : s = {
|
|
2022
2075
|
...s,
|
|
2023
2076
|
...n
|
|
2024
|
-
},
|
|
2077
|
+
}, Ne(this.data, o, s), a.silent || this.emit("added", e, t, n);
|
|
2025
2078
|
}
|
|
2026
2079
|
removeResourceBundle(e, t) {
|
|
2027
2080
|
this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
|
|
@@ -2042,7 +2095,7 @@ var A = {
|
|
|
2042
2095
|
toJSON() {
|
|
2043
2096
|
return this.data;
|
|
2044
2097
|
}
|
|
2045
|
-
},
|
|
2098
|
+
}, qe = {
|
|
2046
2099
|
processors: {},
|
|
2047
2100
|
addPostProcessor(e) {
|
|
2048
2101
|
this.processors[e.name] = e;
|
|
@@ -2052,22 +2105,22 @@ var A = {
|
|
|
2052
2105
|
t = this.processors[e]?.process(t, n, r, i) ?? t;
|
|
2053
2106
|
}), t;
|
|
2054
2107
|
}
|
|
2055
|
-
},
|
|
2056
|
-
function
|
|
2108
|
+
}, Je = Symbol("i18next/PATH_KEY");
|
|
2109
|
+
function Ye() {
|
|
2057
2110
|
let e = [], t = Object.create(null), n;
|
|
2058
|
-
return t.get = (r, i) => (n?.revoke?.(), i ===
|
|
2111
|
+
return t.get = (r, i) => (n?.revoke?.(), i === Je ? e : (e.push(i), n = Proxy.revocable(r, t), n.proxy)), Proxy.revocable(Object.create(null), t).proxy;
|
|
2059
2112
|
}
|
|
2060
|
-
function
|
|
2061
|
-
let { [
|
|
2113
|
+
function U(e, t) {
|
|
2114
|
+
let { [Je]: n } = e(Ye()), r = t?.keySeparator ?? ".", i = t?.nsSeparator ?? ":", a = t?.enableSelector === "strict";
|
|
2062
2115
|
if (n.length > 1 && i) {
|
|
2063
2116
|
let e = t?.ns, o = a ? Array.isArray(e) ? e : e ? [e] : null : Array.isArray(e) ? e : null;
|
|
2064
2117
|
if (o && (a ? o : o.length > 1 ? o.slice(1) : []).includes(n[0])) return `${n[0]}${i}${n.slice(1).join(r)}`;
|
|
2065
2118
|
}
|
|
2066
2119
|
return n.join(r);
|
|
2067
2120
|
}
|
|
2068
|
-
var
|
|
2121
|
+
var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = class e extends H {
|
|
2069
2122
|
constructor(e, t = {}) {
|
|
2070
|
-
super(),
|
|
2123
|
+
super(), ke([
|
|
2071
2124
|
"resourceStore",
|
|
2072
2125
|
"languageUtils",
|
|
2073
2126
|
"pluralResolver",
|
|
@@ -2075,7 +2128,7 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2075
2128
|
"backendConnector",
|
|
2076
2129
|
"i18nFormat",
|
|
2077
2130
|
"utils"
|
|
2078
|
-
], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger =
|
|
2131
|
+
], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = V.create("translator"), this.checkedLoadedFor = {};
|
|
2079
2132
|
}
|
|
2080
2133
|
changeLanguage(e) {
|
|
2081
2134
|
e && (this.language = e);
|
|
@@ -2085,34 +2138,34 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2085
2138
|
if (e == null) return !1;
|
|
2086
2139
|
let r = this.resolve(e, n);
|
|
2087
2140
|
if (r?.res === void 0) return !1;
|
|
2088
|
-
let i =
|
|
2141
|
+
let i = Xe(r.res);
|
|
2089
2142
|
return !(n.returnObjects === !1 && i);
|
|
2090
2143
|
}
|
|
2091
2144
|
extractFromKey(e, t) {
|
|
2092
2145
|
let n = t.nsSeparator === void 0 ? this.options.nsSeparator : t.nsSeparator;
|
|
2093
2146
|
n === void 0 && (n = ":");
|
|
2094
|
-
let r = t.keySeparator === void 0 ? this.options.keySeparator : t.keySeparator, i = t.ns || this.options.defaultNS || [], a = n && e.includes(n), o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !
|
|
2147
|
+
let r = t.keySeparator === void 0 ? this.options.keySeparator : t.keySeparator, i = t.ns || this.options.defaultNS || [], a = n && e.includes(n), o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !Ue(e, n, r);
|
|
2095
2148
|
if (a && !o) {
|
|
2096
2149
|
let t = e.match(this.interpolator.nestingRegexp);
|
|
2097
2150
|
if (t && t.length > 0) return {
|
|
2098
2151
|
key: e,
|
|
2099
|
-
namespaces:
|
|
2152
|
+
namespaces: I(i) ? [i] : i
|
|
2100
2153
|
};
|
|
2101
2154
|
let a = e.split(n);
|
|
2102
2155
|
(n !== r || n === r && this.options.ns.includes(a[0])) && (i = a.shift()), e = a.join(r);
|
|
2103
2156
|
}
|
|
2104
2157
|
return {
|
|
2105
2158
|
key: e,
|
|
2106
|
-
namespaces:
|
|
2159
|
+
namespaces: I(i) ? [i] : i
|
|
2107
2160
|
};
|
|
2108
2161
|
}
|
|
2109
2162
|
translate(t, n, r) {
|
|
2110
2163
|
let i = typeof n == "object" ? { ...n } : n;
|
|
2111
2164
|
if (typeof i != "object" && this.options.overloadTranslationOptionHandler && (i = this.options.overloadTranslationOptionHandler(arguments)), typeof i == "object" && (i = { ...i }), i ||= {}, t == null) return "";
|
|
2112
|
-
typeof t == "function" && (t =
|
|
2165
|
+
typeof t == "function" && (t = U(t, {
|
|
2113
2166
|
...this.options,
|
|
2114
2167
|
...i
|
|
2115
|
-
})), Array.isArray(t) || (t = [String(t)]), t = t.map((e) => typeof e == "function" ?
|
|
2168
|
+
})), Array.isArray(t) || (t = [String(t)]), t = t.map((e) => typeof e == "function" ? U(e, {
|
|
2116
2169
|
...this.options,
|
|
2117
2170
|
...i
|
|
2118
2171
|
}) : String(e));
|
|
@@ -2138,10 +2191,10 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2138
2191
|
"[object Number]",
|
|
2139
2192
|
"[object Function]",
|
|
2140
2193
|
"[object RegExp]"
|
|
2141
|
-
], v = i.joinArrays === void 0 ? this.options.joinArrays : i.joinArrays, y = !this.i18nFormat || this.i18nFormat.handleAsObject, b = i.count !== void 0 && !
|
|
2194
|
+
], v = i.joinArrays === void 0 ? this.options.joinArrays : i.joinArrays, y = !this.i18nFormat || this.i18nFormat.handleAsObject, b = i.count !== void 0 && !I(i.count), x = e.hasDefaultValue(i), S = b ? this.pluralResolver.getSuffix(d, i.count, i) : "", C = i.ordinal && b ? this.pluralResolver.getSuffix(d, i.count, { ordinal: !1 }) : "", w = b && !i.ordinal && i.count === 0, T = w && i[`defaultValue${this.options.pluralSeparator}zero`] || i[`defaultValue${S}`] || i[`defaultValue${C}`] || i.defaultValue, E = m;
|
|
2142
2195
|
y && !m && x && (E = T);
|
|
2143
|
-
let D =
|
|
2144
|
-
if (y && E && D && !_.includes(ee) && !(
|
|
2196
|
+
let D = Xe(E), ee = Object.prototype.toString.apply(E);
|
|
2197
|
+
if (y && E && D && !_.includes(ee) && !(I(v) && Array.isArray(E))) {
|
|
2145
2198
|
if (!i.returnObjects && !this.options.returnObjects) {
|
|
2146
2199
|
this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
|
|
2147
2200
|
let e = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(h, E, {
|
|
@@ -2154,12 +2207,12 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2154
2207
|
let e = Array.isArray(E), t = e ? [] : {}, n = e ? g : h;
|
|
2155
2208
|
for (let e in E) if (Object.prototype.hasOwnProperty.call(E, e)) {
|
|
2156
2209
|
let r = `${n}${o}${e}`;
|
|
2157
|
-
x && !m ?
|
|
2210
|
+
t[e] = x && !m ? this.translate(r, {
|
|
2158
2211
|
...i,
|
|
2159
|
-
defaultValue:
|
|
2212
|
+
defaultValue: Xe(T) ? T[e] : void 0,
|
|
2160
2213
|
joinArrays: !1,
|
|
2161
2214
|
ns: c
|
|
2162
|
-
}) :
|
|
2215
|
+
}) : this.translate(r, {
|
|
2163
2216
|
...i,
|
|
2164
2217
|
joinArrays: !1,
|
|
2165
2218
|
ns: c
|
|
@@ -2167,7 +2220,7 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2167
2220
|
}
|
|
2168
2221
|
m = t;
|
|
2169
2222
|
}
|
|
2170
|
-
} else if (y &&
|
|
2223
|
+
} else if (y && I(v) && Array.isArray(m)) m = m.join(v), m &&= this.extendTranslation(m, t, i, r);
|
|
2171
2224
|
else {
|
|
2172
2225
|
let e = !1, n = !1;
|
|
2173
2226
|
!this.isValidLookup(m) && x && (e = !0, m = T), this.isValidLookup(m) || (n = !0, m = s);
|
|
@@ -2211,12 +2264,12 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2211
2264
|
...n.interpolation
|
|
2212
2265
|
}
|
|
2213
2266
|
});
|
|
2214
|
-
let a =
|
|
2267
|
+
let a = I(e) && (n?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : n.interpolation.skipOnVariables), o;
|
|
2215
2268
|
if (a) {
|
|
2216
2269
|
let t = e.match(this.interpolator.nestingRegexp);
|
|
2217
2270
|
o = t && t.length;
|
|
2218
2271
|
}
|
|
2219
|
-
let s = n.replace && !
|
|
2272
|
+
let s = n.replace && !I(n.replace) ? n.replace : n;
|
|
2220
2273
|
if (this.options.interpolation.defaultVariables && (s = {
|
|
2221
2274
|
...this.options.interpolation.defaultVariables,
|
|
2222
2275
|
...s
|
|
@@ -2226,8 +2279,8 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2226
2279
|
}
|
|
2227
2280
|
!n.lng && r && r.res && (n.lng = this.language || r.usedLng), n.nest !== !1 && (e = this.interpolator.nest(e, (...e) => i?.[0] === e[0] && !n.context ? (this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`), null) : this.translate(...e, t), n)), n.interpolation && this.interpolator.reset();
|
|
2228
2281
|
}
|
|
2229
|
-
let a = n.postProcess || this.options.postProcess, o =
|
|
2230
|
-
return e != null && o?.length && n.applyPostProcessor !== !1 && (e =
|
|
2282
|
+
let a = n.postProcess || this.options.postProcess, o = I(a) ? [a] : a;
|
|
2283
|
+
return e != null && o?.length && n.applyPostProcessor !== !1 && (e = qe.handle(o, e, t, this.options && this.options.postProcessPassResolved ? {
|
|
2231
2284
|
i18nResolved: {
|
|
2232
2285
|
...r,
|
|
2233
2286
|
usedParams: this.getUsedParamsDetails(n)
|
|
@@ -2237,7 +2290,7 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2237
2290
|
}
|
|
2238
2291
|
resolve(e, t = {}) {
|
|
2239
2292
|
let n, r, i, a, o;
|
|
2240
|
-
return
|
|
2293
|
+
return I(e) && (e = [e]), Array.isArray(e) && (e = e.map((e) => typeof e == "function" ? U(e, {
|
|
2241
2294
|
...this.options,
|
|
2242
2295
|
...t
|
|
2243
2296
|
}) : e)), e.forEach((e) => {
|
|
@@ -2246,7 +2299,7 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2246
2299
|
r = c;
|
|
2247
2300
|
let l = s.namespaces;
|
|
2248
2301
|
this.options.fallbackNS && (l = l.concat(this.options.fallbackNS));
|
|
2249
|
-
let u = t.count !== void 0 && !
|
|
2302
|
+
let u = t.count !== void 0 && !I(t.count), d = u && !t.ordinal && t.count === 0, f = t.context !== void 0 && (I(t.context) || typeof t.context == "number") && t.context !== "", p = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
|
|
2250
2303
|
l.forEach((e) => {
|
|
2251
2304
|
this.isValidLookup(n) || (o = e, !this.checkedLoadedFor[`${p[0]}-${e}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(o) && (this.checkedLoadedFor[`${p[0]}-${e}`] = !0, this.logger.warn(`key "${r}" for languages "${p.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), p.forEach((r) => {
|
|
2252
2305
|
if (this.isValidLookup(n)) return;
|
|
@@ -2297,7 +2350,7 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2297
2350
|
"joinArrays",
|
|
2298
2351
|
"postProcess",
|
|
2299
2352
|
"interpolation"
|
|
2300
|
-
], n = e.replace && !
|
|
2353
|
+
], n = e.replace && !I(e.replace), r = n ? e.replace : e;
|
|
2301
2354
|
if (n && e.count !== void 0 && (r = {
|
|
2302
2355
|
...r,
|
|
2303
2356
|
count: e.count
|
|
@@ -2314,22 +2367,25 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2314
2367
|
for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t) && t.startsWith("defaultValue") && e[t] !== void 0) return !0;
|
|
2315
2368
|
return !1;
|
|
2316
2369
|
}
|
|
2317
|
-
},
|
|
2370
|
+
}, Qe = class {
|
|
2318
2371
|
constructor(e) {
|
|
2319
|
-
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger =
|
|
2372
|
+
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = V.create("languageUtils"), this.resolveHierarchyCache = {};
|
|
2373
|
+
}
|
|
2374
|
+
clearCache() {
|
|
2375
|
+
this.resolveHierarchyCache = {};
|
|
2320
2376
|
}
|
|
2321
2377
|
getScriptPartFromCode(e) {
|
|
2322
|
-
if (e =
|
|
2378
|
+
if (e = B(e), !e || !e.includes("-")) return null;
|
|
2323
2379
|
let t = e.split("-");
|
|
2324
2380
|
return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
|
|
2325
2381
|
}
|
|
2326
2382
|
getLanguagePartFromCode(e) {
|
|
2327
|
-
if (e =
|
|
2383
|
+
if (e = B(e), !e || !e.includes("-")) return e;
|
|
2328
2384
|
let t = e.split("-");
|
|
2329
2385
|
return this.formatLanguageCode(t[0]);
|
|
2330
2386
|
}
|
|
2331
2387
|
formatLanguageCode(e) {
|
|
2332
|
-
if (
|
|
2388
|
+
if (I(e) && e.includes("-")) {
|
|
2333
2389
|
let t;
|
|
2334
2390
|
try {
|
|
2335
2391
|
t = Intl.getCanonicalLocales(e)[0];
|
|
@@ -2359,38 +2415,49 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2359
2415
|
}
|
|
2360
2416
|
getFallbackCodes(e, t) {
|
|
2361
2417
|
if (!e) return [];
|
|
2362
|
-
if (typeof e == "function" && (e = e(t)),
|
|
2418
|
+
if (typeof e == "function" && (e = e(t)), I(e) && (e = [e]), Array.isArray(e)) return e;
|
|
2363
2419
|
if (!t) return e.default || [];
|
|
2364
2420
|
let n = e[t];
|
|
2365
2421
|
return n ||= e[this.getScriptPartFromCode(t)], n ||= e[this.formatLanguageCode(t)], n ||= e[this.getLanguagePartFromCode(t)], n ||= e.default, n || [];
|
|
2366
2422
|
}
|
|
2367
2423
|
toResolveHierarchy(e, t) {
|
|
2368
|
-
let n = this.
|
|
2369
|
-
|
|
2424
|
+
let n = this.options.fallbackLng, r = Array.isArray(n) ? n.join("|") : n;
|
|
2425
|
+
r !== this._cachedFallbackLng && (this.resolveHierarchyCache = {}, this._cachedFallbackLng = r);
|
|
2426
|
+
let i = t === void 0 || t === !1 || I(t), a = t === void 0 && typeof this.options.fallbackLng == "function", o = I(e) && i && !a, s = null;
|
|
2427
|
+
if (o) {
|
|
2428
|
+
let n;
|
|
2429
|
+
n = t === void 0 ? "undefined" : t === !1 ? "boolean:false" : `string:${t}`, s = `${e.length}:${e}|${n}`;
|
|
2430
|
+
}
|
|
2431
|
+
if (s !== null) {
|
|
2432
|
+
let e = this.resolveHierarchyCache[s];
|
|
2433
|
+
if (e !== void 0) return e.slice();
|
|
2434
|
+
}
|
|
2435
|
+
let c = this.getFallbackCodes((t === !1 ? [] : t) || this.options.fallbackLng || [], e), l = [], u = (e) => {
|
|
2436
|
+
e && (this.isSupportedCode(e) ? l.push(e) : this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`));
|
|
2370
2437
|
};
|
|
2371
|
-
return
|
|
2372
|
-
|
|
2373
|
-
}),
|
|
2438
|
+
return I(e) && (e.includes("-") || e.includes("_")) ? (this.options.load !== "languageOnly" && u(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && u(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && u(this.getLanguagePartFromCode(e))) : I(e) && u(this.formatLanguageCode(e)), c.forEach((e) => {
|
|
2439
|
+
l.includes(e) || u(this.formatLanguageCode(e));
|
|
2440
|
+
}), s === null ? l : (this.resolveHierarchyCache[s] = l, l.slice());
|
|
2374
2441
|
}
|
|
2375
|
-
},
|
|
2442
|
+
}, $e = {
|
|
2376
2443
|
zero: 0,
|
|
2377
2444
|
one: 1,
|
|
2378
2445
|
two: 2,
|
|
2379
2446
|
few: 3,
|
|
2380
2447
|
many: 4,
|
|
2381
2448
|
other: 5
|
|
2382
|
-
},
|
|
2449
|
+
}, et = {
|
|
2383
2450
|
select: (e) => e === 1 ? "one" : "other",
|
|
2384
2451
|
resolvedOptions: () => ({ pluralCategories: ["one", "other"] })
|
|
2385
|
-
},
|
|
2452
|
+
}, tt = class {
|
|
2386
2453
|
constructor(e, t = {}) {
|
|
2387
|
-
this.languageUtils = e, this.options = t, this.logger =
|
|
2454
|
+
this.languageUtils = e, this.options = t, this.logger = V.create("pluralResolver"), this.pluralRulesCache = {};
|
|
2388
2455
|
}
|
|
2389
2456
|
clearCache() {
|
|
2390
2457
|
this.pluralRulesCache = {};
|
|
2391
2458
|
}
|
|
2392
2459
|
getRule(e, t = {}) {
|
|
2393
|
-
let n =
|
|
2460
|
+
let n = B(e === "dev" ? "en" : e), r = t.ordinal ? "ordinal" : "cardinal", i = JSON.stringify({
|
|
2394
2461
|
cleanedCode: n,
|
|
2395
2462
|
type: r
|
|
2396
2463
|
});
|
|
@@ -2399,8 +2466,8 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2399
2466
|
try {
|
|
2400
2467
|
a = new Intl.PluralRules(n, { type: r });
|
|
2401
2468
|
} catch {
|
|
2402
|
-
if (typeof Intl > "u") return this.logger.error("No Intl support, please use an Intl polyfill!"),
|
|
2403
|
-
if (!e.match(/-|_/)) return
|
|
2469
|
+
if (typeof Intl > "u") return this.logger.error("No Intl support, please use an Intl polyfill!"), et;
|
|
2470
|
+
if (!e.match(/-|_/)) return et;
|
|
2404
2471
|
let n = this.languageUtils.getLanguagePartFromCode(e);
|
|
2405
2472
|
a = this.getRule(n, t);
|
|
2406
2473
|
}
|
|
@@ -2415,23 +2482,23 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2415
2482
|
}
|
|
2416
2483
|
getSuffixes(e, t = {}) {
|
|
2417
2484
|
let n = this.getRule(e, t);
|
|
2418
|
-
return n ||= this.getRule("dev", t), n ? n.resolvedOptions().pluralCategories.sort((e, t) =>
|
|
2485
|
+
return n ||= this.getRule("dev", t), n ? n.resolvedOptions().pluralCategories.sort((e, t) => $e[e] - $e[t]).map((e) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${e}`) : [];
|
|
2419
2486
|
}
|
|
2420
2487
|
getSuffix(e, t, n = {}) {
|
|
2421
2488
|
let r = this.getRule(e, n);
|
|
2422
2489
|
return r ? `${this.options.prepend}${n.ordinal ? `ordinal${this.options.prepend}` : ""}${r.select(t)}` : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", t, n));
|
|
2423
2490
|
}
|
|
2424
|
-
},
|
|
2425
|
-
let a =
|
|
2426
|
-
return !a && i &&
|
|
2427
|
-
},
|
|
2491
|
+
}, nt = (e, t, n, r = ".", i = !0) => {
|
|
2492
|
+
let a = Ie(e, t, n);
|
|
2493
|
+
return !a && i && I(n) && (a = We(e, n, r), a === void 0 && (a = We(t, n, r))), a;
|
|
2494
|
+
}, rt = (e) => e.replace(/\$/g, "$$$$"), it = class {
|
|
2428
2495
|
constructor(e = {}) {
|
|
2429
|
-
this.logger =
|
|
2496
|
+
this.logger = V.create("interpolator"), this.options = e, this.format = e?.interpolation?.format || ((e) => e), this.init(e);
|
|
2430
2497
|
}
|
|
2431
2498
|
init(e = {}) {
|
|
2432
2499
|
e.interpolation ||= { escapeValue: !0 };
|
|
2433
2500
|
let { escape: t, escapeValue: n, useRawValueToEscape: r, prefix: i, prefixEscaped: a, suffix: o, suffixEscaped: s, formatSeparator: c, unescapeSuffix: l, unescapePrefix: u, nestingPrefix: d, nestingPrefixEscaped: f, nestingSuffix: p, nestingSuffixEscaped: m, nestingOptionsSeparator: h, maxReplaces: g, alwaysFormat: _ } = e.interpolation;
|
|
2434
|
-
this.escape = t === void 0 ?
|
|
2501
|
+
this.escape = t === void 0 ? ze : t, this.escapeValue = n === void 0 || n, this.useRawValueToEscape = r !== void 0 && r, this.prefix = i ? z(i) : a || "{{", this.suffix = o ? z(o) : s || "}}", this.formatSeparator = c || ",", this.unescapePrefix = l ? "" : u ? z(u) : "-", this.unescapeSuffix = this.unescapePrefix ? "" : l ? z(l) : "", this.nestingPrefix = d ? z(d) : f || z("$t("), this.nestingSuffix = p ? z(p) : m || z(")"), this.nestingOptionsSeparator = h || ",", this.maxReplaces = g || 1e3, this.alwaysFormat = _ !== void 0 && _, this.resetRegExp();
|
|
2435
2502
|
}
|
|
2436
2503
|
reset() {
|
|
2437
2504
|
this.options && this.init(this.options);
|
|
@@ -2443,7 +2510,7 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2443
2510
|
interpolate(e, t, n, r) {
|
|
2444
2511
|
let i, a, o, s = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, c = (e) => {
|
|
2445
2512
|
if (!e.includes(this.formatSeparator)) {
|
|
2446
|
-
let i =
|
|
2513
|
+
let i = nt(t, s, e, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
2447
2514
|
return this.alwaysFormat ? this.format(i, void 0, n, {
|
|
2448
2515
|
...r,
|
|
2449
2516
|
...t,
|
|
@@ -2451,7 +2518,7 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2451
2518
|
}) : i;
|
|
2452
2519
|
}
|
|
2453
2520
|
let i = e.split(this.formatSeparator), a = i.shift().trim(), o = i.join(this.formatSeparator).trim();
|
|
2454
|
-
return this.format(
|
|
2521
|
+
return this.format(nt(t, s, a, this.options.keySeparator, this.options.ignoreJSONStructure), o, n, {
|
|
2455
2522
|
...r,
|
|
2456
2523
|
...t,
|
|
2457
2524
|
interpolationkey: a
|
|
@@ -2468,17 +2535,18 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2468
2535
|
}].forEach((t) => {
|
|
2469
2536
|
for (o = 0; i = t.regex.exec(e);) {
|
|
2470
2537
|
let n = i[1].trim();
|
|
2471
|
-
if (a = c(n), a === void 0)
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2538
|
+
if (a = c(n), a === void 0) {
|
|
2539
|
+
if (typeof l == "function") {
|
|
2540
|
+
let t = l(e, i, r);
|
|
2541
|
+
a = I(t) ? t : "";
|
|
2542
|
+
} else if (r && Object.prototype.hasOwnProperty.call(r, n)) a = "";
|
|
2543
|
+
else if (u) {
|
|
2544
|
+
a = i[0];
|
|
2545
|
+
continue;
|
|
2546
|
+
} else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`), a = "";
|
|
2547
|
+
} else !I(a) && !this.useRawValueToEscape && (a = Oe(a));
|
|
2480
2548
|
let s = t.safeValue(a);
|
|
2481
|
-
if (e = e.replace(i[0],
|
|
2549
|
+
if (e = e.replace(i[0], rt(s)), u ? (t.regex.lastIndex += s.length, t.regex.lastIndex -= i[0].length) : t.regex.lastIndex = 0, o++, o >= this.maxReplaces) break;
|
|
2482
2550
|
}
|
|
2483
2551
|
}), e;
|
|
2484
2552
|
}
|
|
@@ -2486,7 +2554,7 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2486
2554
|
let r, i, a, o = (e, t) => {
|
|
2487
2555
|
let n = this.nestingOptionsSeparator;
|
|
2488
2556
|
if (!e.includes(n)) return e;
|
|
2489
|
-
let r = e.split(RegExp(`${
|
|
2557
|
+
let r = e.split(RegExp(`${z(n)}[ ]*{`)), i = `{${r[1]}`;
|
|
2490
2558
|
e = r[0], i = this.interpolate(i, a);
|
|
2491
2559
|
let o = i.match(/'/g), s = i.match(/"/g);
|
|
2492
2560
|
((o?.length ?? 0) % 2 == 0 && !s || (s?.length ?? 0) % 2 != 0) && (i = i.replace(/'/g, "\""));
|
|
@@ -2502,17 +2570,17 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2502
2570
|
};
|
|
2503
2571
|
for (; r = this.nestingRegexp.exec(e);) {
|
|
2504
2572
|
let s = [];
|
|
2505
|
-
a = { ...n }, a = a.replace && !
|
|
2573
|
+
a = { ...n }, a = a.replace && !I(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
|
|
2506
2574
|
let c = /{.*}/s.test(r[1]) ? r[1].lastIndexOf("}") + 1 : r[1].indexOf(this.formatSeparator);
|
|
2507
|
-
if (c !== -1 && (s = r[1].slice(c).split(this.formatSeparator).map((e) => e.trim()).filter(Boolean), r[1] = r[1].slice(0, c)), i = t(o.call(this, r[1].trim(), a), a), i && r[0] === e && !
|
|
2508
|
-
|
|
2575
|
+
if (c !== -1 && (s = r[1].slice(c).split(this.formatSeparator).map((e) => e.trim()).filter(Boolean), r[1] = r[1].slice(0, c)), i = t(o.call(this, r[1].trim(), a), a), i && r[0] === e && !I(i)) return i;
|
|
2576
|
+
I(i) || (i = Oe(i)), i ||= (this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`), ""), s.length && (i = s.reduce((e, t) => this.format(e, t, n.lng, {
|
|
2509
2577
|
...n,
|
|
2510
2578
|
interpolationkey: r[1].trim()
|
|
2511
|
-
}), i.trim())), e = e.replace(r[0], i), this.regexp.lastIndex = 0;
|
|
2579
|
+
}), i.trim())), e = e.replace(r[0], rt(Oe(i))), this.regexp.lastIndex = 0;
|
|
2512
2580
|
}
|
|
2513
2581
|
return e;
|
|
2514
2582
|
}
|
|
2515
|
-
},
|
|
2583
|
+
}, at = (e) => {
|
|
2516
2584
|
let t = e.toLowerCase().trim(), n = {};
|
|
2517
2585
|
if (e.includes("(")) {
|
|
2518
2586
|
let r = e.split("(");
|
|
@@ -2529,7 +2597,7 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2529
2597
|
formatName: t,
|
|
2530
2598
|
formatOptions: n
|
|
2531
2599
|
};
|
|
2532
|
-
},
|
|
2600
|
+
}, ot = (e) => {
|
|
2533
2601
|
let t = {};
|
|
2534
2602
|
return (n, r, i) => {
|
|
2535
2603
|
let a = i;
|
|
@@ -2538,15 +2606,15 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2538
2606
|
[i.interpolationkey]: void 0
|
|
2539
2607
|
});
|
|
2540
2608
|
let o = r + JSON.stringify(a), s = t[o];
|
|
2541
|
-
return s || (s = e(
|
|
2609
|
+
return s || (s = e(B(r), i), t[o] = s), s(n);
|
|
2542
2610
|
};
|
|
2543
|
-
},
|
|
2611
|
+
}, st = (e) => (t, n, r) => e(B(n), r)(t), ct = class {
|
|
2544
2612
|
constructor(e = {}) {
|
|
2545
|
-
this.logger =
|
|
2613
|
+
this.logger = V.create("formatter"), this.options = e, this.init(e);
|
|
2546
2614
|
}
|
|
2547
2615
|
init(e, t = { interpolation: {} }) {
|
|
2548
2616
|
this.formatSeparator = t.interpolation.formatSeparator || ",";
|
|
2549
|
-
let n = t.cacheInBuiltFormats ?
|
|
2617
|
+
let n = t.cacheInBuiltFormats ? ot : st;
|
|
2550
2618
|
this.formats = {
|
|
2551
2619
|
number: n((e, t) => {
|
|
2552
2620
|
let n = new Intl.NumberFormat(e, { ...t });
|
|
@@ -2577,7 +2645,7 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2577
2645
|
this.formats[e.toLowerCase().trim()] = t;
|
|
2578
2646
|
}
|
|
2579
2647
|
addCached(e, t) {
|
|
2580
|
-
this.formats[e.toLowerCase().trim()] =
|
|
2648
|
+
this.formats[e.toLowerCase().trim()] = ot(t);
|
|
2581
2649
|
}
|
|
2582
2650
|
format(e, t, n, r = {}) {
|
|
2583
2651
|
if (!t || e == null) return e;
|
|
@@ -2588,7 +2656,7 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2588
2656
|
a.push(t);
|
|
2589
2657
|
}
|
|
2590
2658
|
return a.reduce((e, t) => {
|
|
2591
|
-
let { formatName: i, formatOptions: a } =
|
|
2659
|
+
let { formatName: i, formatOptions: a } = at(t);
|
|
2592
2660
|
if (this.formats[i]) {
|
|
2593
2661
|
let t = e;
|
|
2594
2662
|
try {
|
|
@@ -2602,15 +2670,15 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2602
2670
|
this.logger.warn(e);
|
|
2603
2671
|
}
|
|
2604
2672
|
return t;
|
|
2605
|
-
}
|
|
2606
|
-
return e;
|
|
2673
|
+
}
|
|
2674
|
+
return this.logger.warn(`there was no format function for ${i}`), e;
|
|
2607
2675
|
}, e);
|
|
2608
2676
|
}
|
|
2609
|
-
},
|
|
2677
|
+
}, lt = (e, t) => {
|
|
2610
2678
|
e.pending[t] !== void 0 && (delete e.pending[t], e.pendingCount--);
|
|
2611
|
-
},
|
|
2679
|
+
}, ut = class extends H {
|
|
2612
2680
|
constructor(e, t, n, r = {}) {
|
|
2613
|
-
super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = r, this.logger =
|
|
2681
|
+
super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = r, this.logger = V.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = r.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = r.maxRetries >= 0 ? r.maxRetries : 5, this.retryTimeout = r.retryTimeout >= 1 ? r.retryTimeout : 350, this.state = {}, this.queue = [], this.backend?.init?.(n, r.backend, r);
|
|
2614
2682
|
}
|
|
2615
2683
|
queueLoad(e, t, n, r) {
|
|
2616
2684
|
let i = {}, a = {}, o = {}, s = {};
|
|
@@ -2638,7 +2706,7 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2638
2706
|
t && this.emit("failedLoading", i, a, t), !t && n && this.store.addResourceBundle(i, a, n, void 0, void 0, { skipCopy: !0 }), this.state[e] = t ? -1 : 2, t && n && (this.state[e] = 0);
|
|
2639
2707
|
let o = {};
|
|
2640
2708
|
this.queue.forEach((n) => {
|
|
2641
|
-
|
|
2709
|
+
Pe(n.loaded, [i], a), lt(n, e), t && n.errors.push(t), n.pendingCount === 0 && !n.done && (Object.keys(n.loaded).forEach((e) => {
|
|
2642
2710
|
o[e] || (o[e] = {});
|
|
2643
2711
|
let t = n.loaded[e];
|
|
2644
2712
|
t.length && t.forEach((t) => {
|
|
@@ -2687,7 +2755,7 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2687
2755
|
}
|
|
2688
2756
|
prepareLoading(e, t, n = {}, r) {
|
|
2689
2757
|
if (!this.backend) return this.logger.warn("No backend was added via i18next.use. Will not load resources."), r && r();
|
|
2690
|
-
|
|
2758
|
+
I(e) && (e = this.languageUtils.toResolveHierarchy(e)), I(t) && (t = [t]);
|
|
2691
2759
|
let i = this.queueLoad(e, t, n, r);
|
|
2692
2760
|
if (!i.toLoad.length) return i.pending.length || r(), null;
|
|
2693
2761
|
i.toLoad.forEach((e) => {
|
|
@@ -2711,7 +2779,7 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2711
2779
|
this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
|
|
2712
2780
|
return;
|
|
2713
2781
|
}
|
|
2714
|
-
if (
|
|
2782
|
+
if (n != null && n !== "") {
|
|
2715
2783
|
if (this.backend?.create) {
|
|
2716
2784
|
let s = {
|
|
2717
2785
|
...a,
|
|
@@ -2725,10 +2793,10 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2725
2793
|
}
|
|
2726
2794
|
else c(e, t, n, r, o, s);
|
|
2727
2795
|
}
|
|
2728
|
-
|
|
2796
|
+
e && e[0] && this.store.addResource(e[0], t, n, r);
|
|
2729
2797
|
}
|
|
2730
2798
|
}
|
|
2731
|
-
},
|
|
2799
|
+
}, dt = () => ({
|
|
2732
2800
|
debug: !1,
|
|
2733
2801
|
initAsync: !0,
|
|
2734
2802
|
ns: ["translation"],
|
|
@@ -2763,7 +2831,7 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2763
2831
|
appendNamespaceToCIMode: !1,
|
|
2764
2832
|
overloadTranslationOptionHandler: (e) => {
|
|
2765
2833
|
let t = {};
|
|
2766
|
-
if (typeof e[1] == "object" && (t = e[1]),
|
|
2834
|
+
if (typeof e[1] == "object" && (t = e[1]), I(e[1]) && (t.defaultValue = e[1]), I(e[2]) && (t.tDescription = e[2]), typeof e[2] == "object" || typeof e[3] == "object") {
|
|
2767
2835
|
let n = e[3] || e[2];
|
|
2768
2836
|
Object.keys(n).forEach((e) => {
|
|
2769
2837
|
t[e] = n[e];
|
|
@@ -2784,13 +2852,13 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2784
2852
|
skipOnVariables: !0
|
|
2785
2853
|
},
|
|
2786
2854
|
cacheInBuiltFormats: !0
|
|
2787
|
-
}),
|
|
2855
|
+
}), ft = (e) => (I(e.ns) && (e.ns = [e.ns]), I(e.fallbackLng) && (e.fallbackLng = [e.fallbackLng]), I(e.fallbackNS) && (e.fallbackNS = [e.fallbackNS]), e.supportedLngs && !e.supportedLngs.includes("cimode") && (e.supportedLngs = e.supportedLngs.concat(["cimode"])), e), pt = () => {}, mt = (e) => {
|
|
2788
2856
|
Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((t) => {
|
|
2789
2857
|
typeof e[t] == "function" && (e[t] = e[t].bind(e));
|
|
2790
2858
|
});
|
|
2791
|
-
},
|
|
2859
|
+
}, W = class e extends H {
|
|
2792
2860
|
constructor(e = {}, t) {
|
|
2793
|
-
if (super(), this.options =
|
|
2861
|
+
if (super(), this.options = ft(e), this.services = {}, this.logger = V, this.modules = { external: [] }, mt(this), t && !this.isInitialized && !e.isClone) {
|
|
2794
2862
|
if (!this.options.initAsync) return this.init(e, t), this;
|
|
2795
2863
|
setTimeout(() => {
|
|
2796
2864
|
this.init(e, t);
|
|
@@ -2798,33 +2866,33 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2798
2866
|
}
|
|
2799
2867
|
}
|
|
2800
2868
|
init(e = {}, t) {
|
|
2801
|
-
this.isInitializing = !0, typeof e == "function" && (t = e, e = {}), e.defaultNS == null && e.ns && (
|
|
2802
|
-
let n =
|
|
2869
|
+
this.isInitializing = !0, typeof e == "function" && (t = e, e = {}), e.defaultNS == null && e.ns && (I(e.ns) ? e.defaultNS = e.ns : e.ns.includes("translation") || (e.defaultNS = e.ns[0]));
|
|
2870
|
+
let n = dt();
|
|
2803
2871
|
this.options = {
|
|
2804
2872
|
...n,
|
|
2805
2873
|
...this.options,
|
|
2806
|
-
...
|
|
2874
|
+
...ft(e)
|
|
2807
2875
|
}, this.options.interpolation = {
|
|
2808
2876
|
...n.interpolation,
|
|
2809
2877
|
...this.options.interpolation
|
|
2810
2878
|
}, e.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e.keySeparator), e.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e.nsSeparator), typeof this.options.overloadTranslationOptionHandler != "function" && (this.options.overloadTranslationOptionHandler = n.overloadTranslationOptionHandler);
|
|
2811
2879
|
let r = (e) => e ? typeof e == "function" ? new e() : e : null;
|
|
2812
2880
|
if (!this.options.isClone) {
|
|
2813
|
-
this.modules.logger ?
|
|
2881
|
+
this.modules.logger ? V.init(r(this.modules.logger), this.options) : V.init(null, this.options);
|
|
2814
2882
|
let e;
|
|
2815
|
-
e = this.modules.formatter ? this.modules.formatter :
|
|
2816
|
-
let t = new
|
|
2817
|
-
this.store = new
|
|
2883
|
+
e = this.modules.formatter ? this.modules.formatter : ct;
|
|
2884
|
+
let t = new Qe(this.options);
|
|
2885
|
+
this.store = new Ke(this.options.resources, this.options);
|
|
2818
2886
|
let n = this.services;
|
|
2819
|
-
n.logger =
|
|
2887
|
+
n.logger = V, n.resourceStore = this.store, n.languageUtils = t, n.pluralResolver = new tt(t, { prepend: this.options.pluralSeparator }), e && (n.formatter = r(e), n.formatter.init && n.formatter.init(n, this.options), this.options.interpolation.format = n.formatter.format.bind(n.formatter)), n.interpolator = new it(this.options), n.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, n.backendConnector = new ut(r(this.modules.backend), n.resourceStore, n, this.options), n.backendConnector.on("*", (e, ...t) => {
|
|
2820
2888
|
this.emit(e, ...t);
|
|
2821
|
-
}), this.modules.languageDetector && (n.languageDetector = r(this.modules.languageDetector), n.languageDetector.init && n.languageDetector.init(n, this.options.detection, this.options)), this.modules.i18nFormat && (n.i18nFormat = r(this.modules.i18nFormat), n.i18nFormat.init && n.i18nFormat.init(this)), this.translator = new
|
|
2889
|
+
}), this.modules.languageDetector && (n.languageDetector = r(this.modules.languageDetector), n.languageDetector.init && n.languageDetector.init(n, this.options.detection, this.options)), this.modules.i18nFormat && (n.i18nFormat = r(this.modules.i18nFormat), n.i18nFormat.init && n.i18nFormat.init(this)), this.translator = new Ze(this.services, this.options), this.translator.on("*", (e, ...t) => {
|
|
2822
2890
|
this.emit(e, ...t);
|
|
2823
2891
|
}), this.modules.external.forEach((e) => {
|
|
2824
2892
|
e.init && e.init(this);
|
|
2825
2893
|
});
|
|
2826
2894
|
}
|
|
2827
|
-
if (this.format = this.options.interpolation.format, t ||=
|
|
2895
|
+
if (this.format = this.options.interpolation.format, t ||= pt, this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
|
2828
2896
|
let e = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
2829
2897
|
e.length > 0 && e[0] !== "dev" && (this.options.lng = e[0]);
|
|
2830
2898
|
}
|
|
@@ -2843,7 +2911,7 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2843
2911
|
].forEach((e) => {
|
|
2844
2912
|
this[e] = (...t) => (this.store[e](...t), this);
|
|
2845
2913
|
});
|
|
2846
|
-
let i =
|
|
2914
|
+
let i = L(), a = () => {
|
|
2847
2915
|
let e = (e, n) => {
|
|
2848
2916
|
this.isInitializing = !1, this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = !0, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), i.resolve(n), t(e, n);
|
|
2849
2917
|
};
|
|
@@ -2852,8 +2920,8 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2852
2920
|
};
|
|
2853
2921
|
return this.options.resources || !this.options.initAsync ? a() : setTimeout(a, 0), i;
|
|
2854
2922
|
}
|
|
2855
|
-
loadResources(e, t =
|
|
2856
|
-
let n = t, r =
|
|
2923
|
+
loadResources(e, t = pt) {
|
|
2924
|
+
let n = t, r = I(e) ? e : this.language;
|
|
2857
2925
|
if (typeof e == "function" && (n = e), !this.options.resources || this.options.partialBundledLanguages) {
|
|
2858
2926
|
if (r?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return n();
|
|
2859
2927
|
let e = [], t = (t) => {
|
|
@@ -2867,18 +2935,18 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2867
2935
|
} else n(null);
|
|
2868
2936
|
}
|
|
2869
2937
|
reloadResources(e, t, n) {
|
|
2870
|
-
let r =
|
|
2871
|
-
return typeof e == "function" && (n = e, e = void 0), typeof t == "function" && (n = t, t = void 0), e ||= this.languages, t ||= this.options.ns, n ||=
|
|
2938
|
+
let r = L();
|
|
2939
|
+
return typeof e == "function" && (n = e, e = void 0), typeof t == "function" && (n = t, t = void 0), e ||= this.languages, t ||= this.options.ns, n ||= pt, this.services.backendConnector.reload(e, t, (e) => {
|
|
2872
2940
|
r.resolve(), n(e);
|
|
2873
2941
|
}), r;
|
|
2874
2942
|
}
|
|
2875
2943
|
use(e) {
|
|
2876
2944
|
if (!e) throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
|
|
2877
2945
|
if (!e.type) throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
|
|
2878
|
-
return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" &&
|
|
2946
|
+
return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" && qe.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
|
|
2879
2947
|
}
|
|
2880
2948
|
setResolvedLanguage(e) {
|
|
2881
|
-
if (
|
|
2949
|
+
if (e && this.languages && !["cimode", "dev"].includes(e)) {
|
|
2882
2950
|
for (let e = 0; e < this.languages.length; e++) {
|
|
2883
2951
|
let t = this.languages[e];
|
|
2884
2952
|
if (!["cimode", "dev"].includes(t) && this.store.hasLanguageSomeTranslations(t)) {
|
|
@@ -2891,7 +2959,7 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2891
2959
|
}
|
|
2892
2960
|
changeLanguage(e, t) {
|
|
2893
2961
|
this.isLanguageChangingTo = e;
|
|
2894
|
-
let n =
|
|
2962
|
+
let n = L();
|
|
2895
2963
|
this.emit("languageChanging", e);
|
|
2896
2964
|
let r = (e) => {
|
|
2897
2965
|
this.language = e, this.languages = this.services.languageUtils.toResolveHierarchy(e), this.resolvedLanguage = void 0, this.setResolvedLanguage(e);
|
|
@@ -2899,7 +2967,7 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2899
2967
|
a ? this.isLanguageChangingTo === e && (r(a), this.translator.changeLanguage(a), this.isLanguageChangingTo = void 0, this.emit("languageChanged", a), this.logger.log("languageChanged", a)) : this.isLanguageChangingTo = void 0, n.resolve((...e) => this.t(...e)), t && t(i, (...e) => this.t(...e));
|
|
2900
2968
|
}, a = (t) => {
|
|
2901
2969
|
!e && !t && this.services.languageDetector && (t = []);
|
|
2902
|
-
let n =
|
|
2970
|
+
let n = I(t) ? t : t && t[0], a = this.store.hasLanguageSomeTranslations(n) ? n : this.services.languageUtils.getBestMatchFromCodes(I(t) ? [t] : t);
|
|
2903
2971
|
a && (this.language || r(a), this.translator.language || this.translator.changeLanguage(a), this.services.languageDetector?.cacheUserLanguage?.(a)), this.loadResources(a, (e) => {
|
|
2904
2972
|
i(e, a);
|
|
2905
2973
|
});
|
|
@@ -2916,11 +2984,11 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2916
2984
|
...this.options,
|
|
2917
2985
|
...o
|
|
2918
2986
|
};
|
|
2919
|
-
Array.isArray(i) && !s && (c.ns = i), typeof o.keyPrefix == "function" && (o.keyPrefix =
|
|
2987
|
+
Array.isArray(i) && !s && (c.ns = i), typeof o.keyPrefix == "function" && (o.keyPrefix = U(o.keyPrefix, c));
|
|
2920
2988
|
let l = this.options.keySeparator || ".", u;
|
|
2921
|
-
return o.keyPrefix && Array.isArray(e) ? u = e.map((e) => (typeof e == "function" && (e =
|
|
2989
|
+
return o.keyPrefix && Array.isArray(e) ? u = e.map((e) => (typeof e == "function" && (e = U(e, c)), `${o.keyPrefix}${l}${e}`)) : (typeof e == "function" && (e = U(e, c)), u = o.keyPrefix ? `${o.keyPrefix}${l}${e}` : e), this.t(u, o);
|
|
2922
2990
|
};
|
|
2923
|
-
return
|
|
2991
|
+
return I(e) ? a.lng = e : a.lngs = e, a.ns = t, a.keyPrefix = n, a;
|
|
2924
2992
|
}
|
|
2925
2993
|
t(...e) {
|
|
2926
2994
|
return this.translator?.translate(...e);
|
|
@@ -2947,16 +3015,16 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2947
3015
|
return !!(this.hasResourceBundle(n, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(n, e) && (!r || a(i, e)));
|
|
2948
3016
|
}
|
|
2949
3017
|
loadNamespaces(e, t) {
|
|
2950
|
-
let n =
|
|
2951
|
-
return this.options.ns ? (
|
|
3018
|
+
let n = L();
|
|
3019
|
+
return this.options.ns ? (I(e) && (e = [e]), e.forEach((e) => {
|
|
2952
3020
|
this.options.ns.includes(e) || this.options.ns.push(e);
|
|
2953
3021
|
}), this.loadResources((e) => {
|
|
2954
3022
|
n.resolve(), t && t(e);
|
|
2955
3023
|
}), n) : (t && t(), Promise.resolve());
|
|
2956
3024
|
}
|
|
2957
3025
|
loadLanguages(e, t) {
|
|
2958
|
-
let n =
|
|
2959
|
-
|
|
3026
|
+
let n = L();
|
|
3027
|
+
I(e) && (e = [e]);
|
|
2960
3028
|
let r = this.options.preload || [], i = e.filter((e) => !r.includes(e) && this.services.languageUtils.isSupportedCode(e));
|
|
2961
3029
|
return i.length ? (this.options.preload = r.concat(i), this.loadResources((e) => {
|
|
2962
3030
|
n.resolve(), t && t(e);
|
|
@@ -2971,14 +3039,14 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2971
3039
|
if (e && e.direction) return e.direction;
|
|
2972
3040
|
}
|
|
2973
3041
|
} catch {}
|
|
2974
|
-
let t = /* @__PURE__ */ "ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb".split("."), n = this.services?.languageUtils || new
|
|
3042
|
+
let t = /* @__PURE__ */ "ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb".split("."), n = this.services?.languageUtils || new Qe(dt());
|
|
2975
3043
|
return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.includes(n.getLanguagePartFromCode(e)) || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
|
|
2976
3044
|
}
|
|
2977
3045
|
static createInstance(t = {}, n) {
|
|
2978
3046
|
let r = new e(t, n);
|
|
2979
3047
|
return r.createInstance = e.createInstance, r;
|
|
2980
3048
|
}
|
|
2981
|
-
cloneInstance(t = {}, n =
|
|
3049
|
+
cloneInstance(t = {}, n = pt) {
|
|
2982
3050
|
let r = t.forkResourceStore;
|
|
2983
3051
|
r && delete t.forkResourceStore;
|
|
2984
3052
|
let i = {
|
|
@@ -2992,18 +3060,18 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
2992
3060
|
"language"
|
|
2993
3061
|
].forEach((e) => {
|
|
2994
3062
|
a[e] = this[e];
|
|
2995
|
-
}), a.services = { ...this.services }, a.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, r && (a.store = new
|
|
3063
|
+
}), a.services = { ...this.services }, a.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, r && (a.store = new Ke(Object.keys(this.store.data).reduce((e, t) => (e[t] = { ...this.store.data[t] }, e[t] = Object.keys(e[t]).reduce((n, r) => (n[r] = { ...e[t][r] }, n), e[t]), e), {}), i), a.services.resourceStore = a.store), t.interpolation) {
|
|
2996
3064
|
let e = {
|
|
2997
|
-
...
|
|
3065
|
+
...dt().interpolation,
|
|
2998
3066
|
...this.options.interpolation,
|
|
2999
3067
|
...t.interpolation
|
|
3000
3068
|
}, n = {
|
|
3001
3069
|
...i,
|
|
3002
3070
|
interpolation: e
|
|
3003
3071
|
};
|
|
3004
|
-
a.services.interpolator = new
|
|
3072
|
+
a.services.interpolator = new it(n);
|
|
3005
3073
|
}
|
|
3006
|
-
return a.translator = new
|
|
3074
|
+
return a.translator = new Ze(a.services, i), a.translator.on("*", (e, ...t) => {
|
|
3007
3075
|
a.emit(e, ...t);
|
|
3008
3076
|
}), a.init(i, n), a.translator.options = i, a.translator.backendConnector.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, a;
|
|
3009
3077
|
}
|
|
@@ -3017,10 +3085,10 @@ var ze = (e) => !N(e) && typeof e != "boolean" && typeof e != "number", Be = cla
|
|
|
3017
3085
|
};
|
|
3018
3086
|
}
|
|
3019
3087
|
}.createInstance();
|
|
3020
|
-
|
|
3088
|
+
W.createInstance, W.dir, W.init, W.loadResources, W.reloadResources, W.use, W.changeLanguage, W.getFixedT, W.t, W.exists, W.setDefaultNamespace, W.hasLoadedNamespace, W.loadNamespaces, W.loadLanguages;
|
|
3021
3089
|
//#endregion
|
|
3022
|
-
//#region node_modules/.pnpm/react-i18next@17.0.
|
|
3023
|
-
var
|
|
3090
|
+
//#region node_modules/.pnpm/react-i18next@17.0.13_i18ne_77b937ecedfb676debf3096b5685165d/node_modules/react-i18next/dist/es/unescape.js
|
|
3091
|
+
var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, gt = {
|
|
3024
3092
|
"&": "&",
|
|
3025
3093
|
"&": "&",
|
|
3026
3094
|
"<": "<",
|
|
@@ -3041,7 +3109,7 @@ var rt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3041
3109
|
"…": "…",
|
|
3042
3110
|
"/": "/",
|
|
3043
3111
|
"/": "/"
|
|
3044
|
-
},
|
|
3112
|
+
}, _t = (e) => gt[e], vt = (e) => e.replace(ht, _t), yt = {
|
|
3045
3113
|
bindI18n: "languageChanged",
|
|
3046
3114
|
bindI18nStore: "",
|
|
3047
3115
|
transEmptyNodeValue: "",
|
|
@@ -3054,148 +3122,21 @@ var rt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3054
3122
|
"p"
|
|
3055
3123
|
],
|
|
3056
3124
|
useSuspense: !0,
|
|
3057
|
-
unescape:
|
|
3125
|
+
unescape: vt,
|
|
3058
3126
|
transDefaultProps: void 0
|
|
3059
|
-
},
|
|
3060
|
-
|
|
3061
|
-
...
|
|
3127
|
+
}, bt = (e = {}) => {
|
|
3128
|
+
yt = {
|
|
3129
|
+
...yt,
|
|
3062
3130
|
...e
|
|
3063
3131
|
};
|
|
3064
|
-
},
|
|
3065
|
-
|
|
3066
|
-
},
|
|
3132
|
+
}, xt = () => yt, St, Ct = (e) => {
|
|
3133
|
+
St = e;
|
|
3134
|
+
}, wt = () => St, Tt = {
|
|
3067
3135
|
type: "3rdParty",
|
|
3068
3136
|
init(e) {
|
|
3069
|
-
|
|
3137
|
+
bt(e.options.react), Ct(e);
|
|
3070
3138
|
}
|
|
3071
|
-
},
|
|
3072
|
-
tool: {
|
|
3073
|
-
retry: "重试",
|
|
3074
|
-
error: "错误",
|
|
3075
|
-
warning: "警告",
|
|
3076
|
-
info: "提示",
|
|
3077
|
-
news: "消息",
|
|
3078
|
-
empty: "暂无数据",
|
|
3079
|
-
clear: "清空",
|
|
3080
|
-
close: "关闭",
|
|
3081
|
-
processing: "全部处理",
|
|
3082
|
-
expand: "展开",
|
|
3083
|
-
shrink: "收起",
|
|
3084
|
-
setOk: "设置成功"
|
|
3085
|
-
},
|
|
3086
|
-
use: {
|
|
3087
|
-
contextErr: "useAppContext 必须在 {{key}} provider 内使用",
|
|
3088
|
-
prefixErr: "usePrefixT 必须与前缀一起使用",
|
|
3089
|
-
patternErr: "useStore 不存在 {{pattern}} 模式",
|
|
3090
|
-
numberPlace: "请输入数字",
|
|
3091
|
-
inputPlace: "请输入内容",
|
|
3092
|
-
selectPlace: "请选择选项",
|
|
3093
|
-
total: "共 <bold>{{total}}</bold> 条",
|
|
3094
|
-
formatErr: "格式错误"
|
|
3095
|
-
},
|
|
3096
|
-
exe: {
|
|
3097
|
-
initErr: "exe 或 cv 未定义",
|
|
3098
|
-
canvasErr: "画布渲染失败",
|
|
3099
|
-
imgSpriteErr: "图片渲染失败"
|
|
3100
|
-
},
|
|
3101
|
-
sql: {
|
|
3102
|
-
initErr: "数据库未初始化",
|
|
3103
|
-
error: "SQL 错误",
|
|
3104
|
-
updateErr: "数据库更新失败",
|
|
3105
|
-
selectErr: "数据库查询失败",
|
|
3106
|
-
batchErr: "数据库批处理失败",
|
|
3107
|
-
execErr: "SQL 执行失败: {{error}}",
|
|
3108
|
-
tableErr: "数据表 \"{{tableName}}\" 不存在"
|
|
3109
|
-
},
|
|
3110
|
-
evt: {
|
|
3111
|
-
initErr: "事件未初始化",
|
|
3112
|
-
defectErr: "缺陷绘制容器创建失败"
|
|
3113
|
-
},
|
|
3114
|
-
lang: {
|
|
3115
|
-
initErr: "语言或 locale 未定义",
|
|
3116
|
-
dayErr: "dayjs 不支持语言 {{lang}}",
|
|
3117
|
-
i18nErr: "i18next 不支持语言 {{lang}}"
|
|
3118
|
-
},
|
|
3119
|
-
file: {
|
|
3120
|
-
readErr: "文件读取失败",
|
|
3121
|
-
writeErr: "文件写入失败",
|
|
3122
|
-
filePath: "文件路径: {{path}}"
|
|
3123
|
-
}
|
|
3124
|
-
} }, ht = { ui: {
|
|
3125
|
-
tool: {
|
|
3126
|
-
retry: "Retry",
|
|
3127
|
-
error: "Error",
|
|
3128
|
-
warning: "Warning",
|
|
3129
|
-
info: "Info",
|
|
3130
|
-
news: "News",
|
|
3131
|
-
empty: "No data",
|
|
3132
|
-
clear: "Clear",
|
|
3133
|
-
close: "Close",
|
|
3134
|
-
processing: "Processing",
|
|
3135
|
-
expand: "Expand",
|
|
3136
|
-
shrink: "Shrink",
|
|
3137
|
-
setOk: "Setting successful"
|
|
3138
|
-
},
|
|
3139
|
-
use: {
|
|
3140
|
-
contextErr: "useAppContext must be used within a {{key}} provider",
|
|
3141
|
-
prefixErr: "usePrefixT must be used with a prefix",
|
|
3142
|
-
patternErr: "useStore does not have a {{pattern}} mode",
|
|
3143
|
-
numberPlace: "Please enter a number",
|
|
3144
|
-
inputPlace: "Please enter content",
|
|
3145
|
-
selectPlace: "Please select an option",
|
|
3146
|
-
total: "Total <bold>{{total}}</bold> items",
|
|
3147
|
-
formatErr: "format error"
|
|
3148
|
-
},
|
|
3149
|
-
exe: {
|
|
3150
|
-
initErr: "exe or cv is not defined",
|
|
3151
|
-
canvasErr: "Canvas rendering failed",
|
|
3152
|
-
imgSpriteErr: "Image rendering failed"
|
|
3153
|
-
},
|
|
3154
|
-
sql: {
|
|
3155
|
-
initErr: "Database is not initialized",
|
|
3156
|
-
error: "SQL ERROR",
|
|
3157
|
-
updateErr: "Database update failed",
|
|
3158
|
-
selectErr: "Database query failed",
|
|
3159
|
-
batchErr: "Database batch failed",
|
|
3160
|
-
execErr: "SQL execution failed: {{error}}",
|
|
3161
|
-
tableErr: "The data table \"{{tableName}}\" does not exist"
|
|
3162
|
-
},
|
|
3163
|
-
evt: {
|
|
3164
|
-
initErr: "Event not initialized",
|
|
3165
|
-
defectErr: "Defect drawing container creation failed"
|
|
3166
|
-
},
|
|
3167
|
-
lang: {
|
|
3168
|
-
initErr: "Lang or locale is not defined",
|
|
3169
|
-
dayErr: "Lang {{lang}} is not supported by dayjs",
|
|
3170
|
-
i18nErr: "Lang {{lang}} is not supported by i18next"
|
|
3171
|
-
},
|
|
3172
|
-
file: {
|
|
3173
|
-
readErr: "File read failed",
|
|
3174
|
-
writeErr: "File write failed",
|
|
3175
|
-
filePath: "File path: {{path}}"
|
|
3176
|
-
}
|
|
3177
|
-
} }, gt = (e, t) => {
|
|
3178
|
-
let n = [], r = Object.assign(e, {
|
|
3179
|
-
zh: mt,
|
|
3180
|
-
en: ht
|
|
3181
|
-
}), i = Object.keys(r), a = i.reduce((e, t) => {
|
|
3182
|
-
let i = r[t];
|
|
3183
|
-
return e[t] = { translation: i }, i?.ui || n.push(t), e;
|
|
3184
|
-
}, {});
|
|
3185
|
-
return H.use(pt).init({
|
|
3186
|
-
lng: t,
|
|
3187
|
-
resources: a,
|
|
3188
|
-
interpolation: { escapeValue: !1 }
|
|
3189
|
-
}), n.length ? [] : i;
|
|
3190
|
-
}, _t = (e = "") => new Proxy((t) => H.t(e, t), { get(t, n) {
|
|
3191
|
-
return n === "toString" || typeof n == "symbol" ? void 0 : _t(e ? `${e}.${n}` : n);
|
|
3192
|
-
} }), U = _t("ui"), W = (e, t, n) => {
|
|
3193
|
-
for (let r of t) Reflect.defineProperty(e, r, {
|
|
3194
|
-
value: e[r],
|
|
3195
|
-
...n
|
|
3196
|
-
});
|
|
3197
|
-
return e;
|
|
3198
|
-
}, vt = /* @__PURE__ */ t(((e, t) => {
|
|
3139
|
+
}, Et = /* @__PURE__ */ s(((e, t) => {
|
|
3199
3140
|
(function(n, r) {
|
|
3200
3141
|
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs = r();
|
|
3201
3142
|
})(e, (function() {
|
|
@@ -3489,7 +3430,276 @@ var rt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3489
3430
|
return w(1e3 * e);
|
|
3490
3431
|
}, w.en = b[y], w.Ls = b, w.p = {}, w;
|
|
3491
3432
|
}));
|
|
3492
|
-
})),
|
|
3433
|
+
})), Dt = /* @__PURE__ */ u(Et(), 1), Ot = (e = Date.now(), t = "YYYY-MM-DD HH:mm:ss") => (0, Dt.default)(e).format(t), kt = (e) => Object.prototype.toString.call(e).slice(8, -1).toLowerCase(), At = (e, t) => kt(e).includes(t), jt = (e = {}, t = {}) => {
|
|
3434
|
+
for (let n of Object.keys(t)) {
|
|
3435
|
+
let r = t[n];
|
|
3436
|
+
At(r, "object") ? (e[n] || (e[n] = {}), jt(e[n], r)) : e[n] = r;
|
|
3437
|
+
}
|
|
3438
|
+
return e;
|
|
3439
|
+
}, G = (e, t, n) => {
|
|
3440
|
+
for (let r of t) Reflect.defineProperty(e, r, {
|
|
3441
|
+
value: e[r],
|
|
3442
|
+
...n
|
|
3443
|
+
});
|
|
3444
|
+
return e;
|
|
3445
|
+
}, Mt = { ui: {
|
|
3446
|
+
tool: {
|
|
3447
|
+
add: "添加",
|
|
3448
|
+
cancel: "取消",
|
|
3449
|
+
confirm: "确认",
|
|
3450
|
+
setting: "设置",
|
|
3451
|
+
retry: "重试",
|
|
3452
|
+
error: "错误",
|
|
3453
|
+
warning: "警告",
|
|
3454
|
+
info: "提示",
|
|
3455
|
+
news: "消息",
|
|
3456
|
+
empty: "暂无数据",
|
|
3457
|
+
clear: "清空",
|
|
3458
|
+
close: "关闭",
|
|
3459
|
+
processing: "全部处理",
|
|
3460
|
+
expand: "展开",
|
|
3461
|
+
shrink: "收起",
|
|
3462
|
+
setOk: "设置成功",
|
|
3463
|
+
start: "启动",
|
|
3464
|
+
stop: "停止",
|
|
3465
|
+
open: "开启",
|
|
3466
|
+
select: "选择",
|
|
3467
|
+
type: "类型",
|
|
3468
|
+
delete: "删除",
|
|
3469
|
+
global: "全局",
|
|
3470
|
+
scheme: "方案",
|
|
3471
|
+
count: "数量",
|
|
3472
|
+
ratio: "比例",
|
|
3473
|
+
reset: "清零",
|
|
3474
|
+
query: "查询",
|
|
3475
|
+
export: "导出",
|
|
3476
|
+
measure: "测量",
|
|
3477
|
+
return: "返回",
|
|
3478
|
+
prev: "上一张",
|
|
3479
|
+
next: "下一张"
|
|
3480
|
+
},
|
|
3481
|
+
use: {
|
|
3482
|
+
contextErr: "useAppContext 必须在 {{key}} provider 内使用",
|
|
3483
|
+
prefixErr: "usePrefixT 必须与前缀一起使用",
|
|
3484
|
+
patternErr: "useStore 不存在 {{pattern}} 模式",
|
|
3485
|
+
numberPlace: "请输入数字",
|
|
3486
|
+
inputPlace: "请输入内容",
|
|
3487
|
+
filePlace: "请输入或选择文件",
|
|
3488
|
+
pathPlace: "请输入或选择路径",
|
|
3489
|
+
selectPlace: "请选择选项",
|
|
3490
|
+
selectTool: "请选择工具",
|
|
3491
|
+
selectFile: "请选择文件",
|
|
3492
|
+
selectPath: "请选择文件夹",
|
|
3493
|
+
total: "共 <bold>{{total}}</bold> 条",
|
|
3494
|
+
formatErr: "格式错误",
|
|
3495
|
+
confirmClear: "确认清空?",
|
|
3496
|
+
statisTotal: "合计",
|
|
3497
|
+
removeRecent: "删除最近",
|
|
3498
|
+
removeAll: "删除全部",
|
|
3499
|
+
equivalent: "当量"
|
|
3500
|
+
},
|
|
3501
|
+
exe: {
|
|
3502
|
+
initErr: "exe 或 cv 未定义",
|
|
3503
|
+
canvasErr: "画布渲染失败",
|
|
3504
|
+
imgSpriteErr: "图片渲染失败"
|
|
3505
|
+
},
|
|
3506
|
+
sql: {
|
|
3507
|
+
initErr: "数据库未初始化",
|
|
3508
|
+
error: "SQL 错误",
|
|
3509
|
+
updateErr: "数据库更新失败",
|
|
3510
|
+
selectErr: "数据库查询失败",
|
|
3511
|
+
batchErr: "数据库批处理失败",
|
|
3512
|
+
execErr: "SQL 执行失败: {{error}}",
|
|
3513
|
+
tableErr: "数据表 \"{{tableName}}\" 不存在"
|
|
3514
|
+
},
|
|
3515
|
+
evt: {
|
|
3516
|
+
initErr: "事件未初始化",
|
|
3517
|
+
defectErr: "缺陷绘制容器创建失败"
|
|
3518
|
+
},
|
|
3519
|
+
lang: {
|
|
3520
|
+
initErr: "语言或 locale 未定义",
|
|
3521
|
+
dayErr: "dayjs 不支持语言 {{lang}}",
|
|
3522
|
+
i18nErr: "i18next 不支持语言 {{lang}}"
|
|
3523
|
+
},
|
|
3524
|
+
file: {
|
|
3525
|
+
readErr: "文件读取失败",
|
|
3526
|
+
writeErr: "文件写入失败",
|
|
3527
|
+
filePath: "文件路径: {{path}}"
|
|
3528
|
+
},
|
|
3529
|
+
main: {
|
|
3530
|
+
detection: "检测<newline />运行",
|
|
3531
|
+
history: "历史<newline />记录",
|
|
3532
|
+
operate: "操作<newline />记录",
|
|
3533
|
+
system: "系统设置",
|
|
3534
|
+
storage: "存储设置",
|
|
3535
|
+
defect: "缺陷配置",
|
|
3536
|
+
defectType: "缺陷类型",
|
|
3537
|
+
defectName: "缺陷名称",
|
|
3538
|
+
elseTypeMatch: "其他类型匹配",
|
|
3539
|
+
defectMode: "配置模式",
|
|
3540
|
+
statisData: "统计数据",
|
|
3541
|
+
statisInfo: "统计信息",
|
|
3542
|
+
startStatisDate: "开始统计时间: {{date}}",
|
|
3543
|
+
dayOut: "当日产量",
|
|
3544
|
+
dayYield: "当日良率",
|
|
3545
|
+
workStaff: "当班人员",
|
|
3546
|
+
productModel: "产品型号",
|
|
3547
|
+
measureTool: "测量工具",
|
|
3548
|
+
measurePoint: "点距离",
|
|
3549
|
+
measureLine: "线间距",
|
|
3550
|
+
measureCircle: "圆直径",
|
|
3551
|
+
distance: "像素距离:{{px}}px\n实际距离:{{um}}um",
|
|
3552
|
+
spacing: "像素间距:{{px}}px\n实际间距:{{um}}um",
|
|
3553
|
+
diameter: "像素直径:{{px}}px\n实际直径:{{um}}um"
|
|
3554
|
+
},
|
|
3555
|
+
config: {
|
|
3556
|
+
mesSaveTime: "MES消息保存时间",
|
|
3557
|
+
recordSaveTime: "历史记录保存时间",
|
|
3558
|
+
ngImageSaveTime: "NG图片保存时间",
|
|
3559
|
+
maxNgImageQuantity: "NG图片最大数量",
|
|
3560
|
+
ngImgSuffix: "NG图片存储格式",
|
|
3561
|
+
ngImgRatio: "NG图片缩放比例",
|
|
3562
|
+
dayOk: "当日OK",
|
|
3563
|
+
dayNg: "当日NG",
|
|
3564
|
+
clearTime: "清空时间"
|
|
3565
|
+
}
|
|
3566
|
+
} }, Nt = { ui: {
|
|
3567
|
+
tool: {
|
|
3568
|
+
add: "Add",
|
|
3569
|
+
cancel: "Cancel",
|
|
3570
|
+
confirm: "Confirm",
|
|
3571
|
+
setting: "Setting",
|
|
3572
|
+
retry: "Retry",
|
|
3573
|
+
error: "Error",
|
|
3574
|
+
warning: "Warning",
|
|
3575
|
+
info: "Info",
|
|
3576
|
+
news: "News",
|
|
3577
|
+
empty: "No data",
|
|
3578
|
+
clear: "Clear",
|
|
3579
|
+
close: "Close",
|
|
3580
|
+
processing: "Processing",
|
|
3581
|
+
expand: "Expand",
|
|
3582
|
+
shrink: "Shrink",
|
|
3583
|
+
setOk: "Setting successful",
|
|
3584
|
+
start: "Start",
|
|
3585
|
+
stop: "Stop",
|
|
3586
|
+
open: "Open",
|
|
3587
|
+
select: "Select",
|
|
3588
|
+
type: "Type",
|
|
3589
|
+
delete: "Delete",
|
|
3590
|
+
global: "Global",
|
|
3591
|
+
scheme: "Scheme",
|
|
3592
|
+
count: "Count",
|
|
3593
|
+
ratio: "Ratio",
|
|
3594
|
+
reset: "Reset",
|
|
3595
|
+
query: "Query",
|
|
3596
|
+
export: "Export",
|
|
3597
|
+
measure: "Measure",
|
|
3598
|
+
return: "Return",
|
|
3599
|
+
prev: "Prev",
|
|
3600
|
+
next: "Next"
|
|
3601
|
+
},
|
|
3602
|
+
use: {
|
|
3603
|
+
contextErr: "useAppContext must be used within a {{key}} provider",
|
|
3604
|
+
prefixErr: "usePrefixT must be used with a prefix",
|
|
3605
|
+
patternErr: "useStore does not have a {{pattern}} mode",
|
|
3606
|
+
numberPlace: "Please enter a number",
|
|
3607
|
+
inputPlace: "Please enter content",
|
|
3608
|
+
filePlace: "Please enter or select a file",
|
|
3609
|
+
pathPlace: "Please enter or select a path",
|
|
3610
|
+
selectPlace: "Please select an option",
|
|
3611
|
+
selectTool: "Please select a tool",
|
|
3612
|
+
selectFile: "Please select a file",
|
|
3613
|
+
selectPath: "Please select a folder",
|
|
3614
|
+
total: "Total <bold>{{total}}</bold> items",
|
|
3615
|
+
formatErr: "format error",
|
|
3616
|
+
confirmClear: "Confirm clear?",
|
|
3617
|
+
statisTotal: "Total",
|
|
3618
|
+
removeRecent: "Remove Recent",
|
|
3619
|
+
removeAll: "Remove All",
|
|
3620
|
+
equivalent: "EqvPx"
|
|
3621
|
+
},
|
|
3622
|
+
exe: {
|
|
3623
|
+
initErr: "exe or cv is not defined",
|
|
3624
|
+
canvasErr: "Canvas rendering failed",
|
|
3625
|
+
imgSpriteErr: "Image rendering failed"
|
|
3626
|
+
},
|
|
3627
|
+
sql: {
|
|
3628
|
+
initErr: "Database is not initialized",
|
|
3629
|
+
error: "SQL ERROR",
|
|
3630
|
+
updateErr: "Database update failed",
|
|
3631
|
+
selectErr: "Database query failed",
|
|
3632
|
+
batchErr: "Database batch failed",
|
|
3633
|
+
execErr: "SQL execution failed: {{error}}",
|
|
3634
|
+
tableErr: "The data table \"{{tableName}}\" does not exist"
|
|
3635
|
+
},
|
|
3636
|
+
evt: {
|
|
3637
|
+
initErr: "Event not initialized",
|
|
3638
|
+
defectErr: "Defect drawing container creation failed"
|
|
3639
|
+
},
|
|
3640
|
+
lang: {
|
|
3641
|
+
initErr: "Lang or locale is not defined",
|
|
3642
|
+
dayErr: "Lang {{lang}} is not supported by dayjs",
|
|
3643
|
+
i18nErr: "Lang {{lang}} is not supported by i18next"
|
|
3644
|
+
},
|
|
3645
|
+
file: {
|
|
3646
|
+
readErr: "File read failed",
|
|
3647
|
+
writeErr: "File write failed",
|
|
3648
|
+
filePath: "File path: {{path}}"
|
|
3649
|
+
},
|
|
3650
|
+
main: {
|
|
3651
|
+
detection: "Detection<newline />Run",
|
|
3652
|
+
history: "History<newline />Record",
|
|
3653
|
+
operate: "Operate<newline />Record",
|
|
3654
|
+
system: "System Setting",
|
|
3655
|
+
storage: "Storage Setting",
|
|
3656
|
+
defect: "Defect Config",
|
|
3657
|
+
defectType: "defect type",
|
|
3658
|
+
defectName: "defect name",
|
|
3659
|
+
elseTypeMatch: "Other type match",
|
|
3660
|
+
defectMode: "Defect Mode",
|
|
3661
|
+
statisData: "Statis Data",
|
|
3662
|
+
statisInfo: "Statis Info",
|
|
3663
|
+
startStatisDate: "Start Statis Date: {{date}}",
|
|
3664
|
+
dayOut: "Daily output",
|
|
3665
|
+
dayYield: "Daily yield",
|
|
3666
|
+
workStaff: "On-duty staff",
|
|
3667
|
+
productModel: "Product model",
|
|
3668
|
+
measureTool: "Measure Tool",
|
|
3669
|
+
measurePoint: "P-distance",
|
|
3670
|
+
measureLine: "L-spacing",
|
|
3671
|
+
measureCircle: "C-diameter",
|
|
3672
|
+
distance: "P-distance:{{px}}px\nA-distance:{{um}}um",
|
|
3673
|
+
spacing: "P-spacing:{{px}}px\nA-spacing:{{um}}um",
|
|
3674
|
+
diameter: "P-diameter:{{px}}px\nA-diameter:{{um}}um"
|
|
3675
|
+
},
|
|
3676
|
+
config: {
|
|
3677
|
+
mesSaveTime: "MES data save time",
|
|
3678
|
+
recordSaveTime: "History data save time",
|
|
3679
|
+
ngImageSaveTime: "NG image save time",
|
|
3680
|
+
maxNgImageQuantity: "Maximum number of NG images",
|
|
3681
|
+
ngImgSuffix: "NG image storage format",
|
|
3682
|
+
ngImgRatio: "NG image scaling ratio",
|
|
3683
|
+
dayOk: "Daily OK",
|
|
3684
|
+
dayNg: "Daily NG",
|
|
3685
|
+
clearTime: "Clear time"
|
|
3686
|
+
}
|
|
3687
|
+
} }, Pt = (e, t) => {
|
|
3688
|
+
let n = [], r = jt(e, {
|
|
3689
|
+
zh: Mt,
|
|
3690
|
+
en: Nt
|
|
3691
|
+
}), i = Object.keys(r), a = i.reduce((e, t) => {
|
|
3692
|
+
let i = r[t];
|
|
3693
|
+
return e[t] = { translation: i }, i?.ui || n.push(t), e;
|
|
3694
|
+
}, {});
|
|
3695
|
+
return W.use(Tt).init({
|
|
3696
|
+
lng: t,
|
|
3697
|
+
resources: a,
|
|
3698
|
+
interpolation: { escapeValue: !1 }
|
|
3699
|
+
}), n.length ? [] : i;
|
|
3700
|
+
}, Ft = (e = "") => new Proxy((t) => W.t(e, t), { get(t, n) {
|
|
3701
|
+
return n === "toString" || typeof n == "symbol" ? void 0 : Ft(e ? `${e}.${n}` : n);
|
|
3702
|
+
} }), K = Ft("ui"), It = class {
|
|
3493
3703
|
#e = {};
|
|
3494
3704
|
#t = new EventTarget();
|
|
3495
3705
|
emit = (e, t) => (this.#t.dispatchEvent(new CustomEvent(e, { detail: t })), this);
|
|
@@ -3512,15 +3722,69 @@ var rt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3512
3722
|
}
|
|
3513
3723
|
return this;
|
|
3514
3724
|
};
|
|
3515
|
-
},
|
|
3725
|
+
}, Lt = [
|
|
3516
3726
|
"systemError",
|
|
3517
3727
|
"messageUpdated",
|
|
3518
|
-
"defectUpdated"
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3728
|
+
"defectUpdated",
|
|
3729
|
+
"systemMode",
|
|
3730
|
+
"historyUpdated"
|
|
3731
|
+
], q = {}, Rt = (e = []) => {
|
|
3732
|
+
let t = [...Lt, ...e];
|
|
3733
|
+
for (let e of t) q[e] = e.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
3734
|
+
return t.length === Lt.length + e.length;
|
|
3735
|
+
}, { emit: zt, emitSync: Bt, on: Vt, off: Ht, once: Ut, clear: Wt } = new It(), Gt = {
|
|
3736
|
+
0: {
|
|
3737
|
+
editing: !0,
|
|
3738
|
+
visible: !0,
|
|
3739
|
+
operate: !0
|
|
3740
|
+
},
|
|
3741
|
+
1: {
|
|
3742
|
+
editing: !1,
|
|
3743
|
+
visible: !0,
|
|
3744
|
+
operate: !0
|
|
3745
|
+
},
|
|
3746
|
+
2: {
|
|
3747
|
+
editing: !1,
|
|
3748
|
+
visible: !1,
|
|
3749
|
+
operate: !1
|
|
3750
|
+
}
|
|
3751
|
+
}, Kt = G({
|
|
3752
|
+
dayOk: {
|
|
3753
|
+
type: "text",
|
|
3754
|
+
value: 0
|
|
3755
|
+
},
|
|
3756
|
+
dayNg: {
|
|
3757
|
+
type: "text",
|
|
3758
|
+
value: 0
|
|
3759
|
+
},
|
|
3760
|
+
date: {
|
|
3761
|
+
type: "text",
|
|
3762
|
+
value: Ot(Date.now(), "YYYY-MM-DD"),
|
|
3763
|
+
visible: !1
|
|
3764
|
+
},
|
|
3765
|
+
clearTime: {
|
|
3766
|
+
type: "time",
|
|
3767
|
+
value: "00:00"
|
|
3768
|
+
},
|
|
3769
|
+
toProps: () => {
|
|
3770
|
+
let e = {};
|
|
3771
|
+
for (let t in Kt) e[t] = Kt[t].value;
|
|
3772
|
+
return e;
|
|
3773
|
+
}
|
|
3774
|
+
}, ["toProps"], {
|
|
3775
|
+
enumerable: !1,
|
|
3776
|
+
writable: !1,
|
|
3777
|
+
configurable: !1
|
|
3778
|
+
}), qt = [
|
|
3779
|
+
15,
|
|
3780
|
+
25,
|
|
3781
|
+
50,
|
|
3782
|
+
100
|
|
3783
|
+
], Jt = [
|
|
3784
|
+
24,
|
|
3785
|
+
240,
|
|
3786
|
+
138
|
|
3787
|
+
], Yt = "#808080", Xt = "app-config-set", Zt = new class {
|
|
3524
3788
|
#e = !1;
|
|
3525
3789
|
#t = [];
|
|
3526
3790
|
#n = "";
|
|
@@ -3528,30 +3792,39 @@ var rt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3528
3792
|
return this.#t;
|
|
3529
3793
|
}
|
|
3530
3794
|
set value(e) {
|
|
3531
|
-
this.#t = e, this
|
|
3795
|
+
this.#t = e, this.write(), this.#r();
|
|
3532
3796
|
}
|
|
3533
3797
|
get work() {
|
|
3534
3798
|
return this.#e;
|
|
3535
3799
|
}
|
|
3800
|
+
set work(e) {
|
|
3801
|
+
this.#e = e, this.#n = e ? J.workDefectPath : J.globalDefectPath, this.read(this.#n, this.#e);
|
|
3802
|
+
}
|
|
3536
3803
|
constructor() {
|
|
3537
3804
|
this.#t.splice(0, this.#t.length);
|
|
3538
3805
|
}
|
|
3539
3806
|
#r() {
|
|
3540
|
-
|
|
3807
|
+
zt(q.defectUpdated);
|
|
3808
|
+
}
|
|
3809
|
+
setValue(e, t = null) {
|
|
3810
|
+
this.value = e, t?.(K.tool.setOk(), { key: Xt });
|
|
3541
3811
|
}
|
|
3542
3812
|
read(e, t = this.#e) {
|
|
3543
|
-
this.#n = e, this.#e = t,
|
|
3544
|
-
e ?
|
|
3813
|
+
this.#n = e, this.#e = t, Z.access(this.#n, Z.constants.F_OK, (e) => {
|
|
3814
|
+
e ? bn(this.#n, this.#t) : yn(this.#n, (e) => {
|
|
3545
3815
|
this.#t = e, this.#r();
|
|
3546
3816
|
});
|
|
3547
3817
|
});
|
|
3548
3818
|
}
|
|
3549
3819
|
write() {
|
|
3550
|
-
|
|
3820
|
+
bn(this.#n, this.#t);
|
|
3551
3821
|
}
|
|
3552
3822
|
get(e) {
|
|
3553
3823
|
return this.#t.find((t) => t.type === e);
|
|
3554
3824
|
}
|
|
3825
|
+
has(e) {
|
|
3826
|
+
return !!this.get(e);
|
|
3827
|
+
}
|
|
3555
3828
|
getName(e) {
|
|
3556
3829
|
let t = this.get(e);
|
|
3557
3830
|
if (t) return t.name;
|
|
@@ -3561,25 +3834,23 @@ var rt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3561
3834
|
}
|
|
3562
3835
|
return null;
|
|
3563
3836
|
}
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
else(e) {
|
|
3568
|
-
for (let t of this.#t) t.type === e ? t.else = !0 : t.else = !1;
|
|
3837
|
+
setElse(e, t = null) {
|
|
3838
|
+
for (let t of this.#t) t.else = t.type === e;
|
|
3839
|
+
this.setValue(this.#t, t);
|
|
3569
3840
|
}
|
|
3570
3841
|
getElse() {
|
|
3571
3842
|
for (let e of this.#t) if (e?.else === !0) return e;
|
|
3572
3843
|
return null;
|
|
3573
3844
|
}
|
|
3574
|
-
add(e) {
|
|
3575
|
-
return this.has(e.type)
|
|
3845
|
+
add(e, t = null) {
|
|
3846
|
+
return !this.has(e.type) && (this.#t.push(e), this.setValue(this.#t, t), !0);
|
|
3576
3847
|
}
|
|
3577
|
-
delete(e) {
|
|
3578
|
-
let
|
|
3579
|
-
return
|
|
3848
|
+
delete(e, t = null) {
|
|
3849
|
+
let n = this.#t.findIndex((t) => t.type === e);
|
|
3850
|
+
return n !== -1 && (this.#t.splice(n, 1), this.setValue(this.#t, t), !0);
|
|
3580
3851
|
}
|
|
3581
|
-
clear() {
|
|
3582
|
-
this.#t.splice(0, this.#t.length), this.
|
|
3852
|
+
clear(e = null) {
|
|
3853
|
+
this.#t.splice(0, this.#t.length), this.setValue(this.#t, e);
|
|
3583
3854
|
}
|
|
3584
3855
|
statis() {
|
|
3585
3856
|
return this.#t.reduce((e, t) => (e[t.type] = 0, e), {});
|
|
@@ -3591,7 +3862,7 @@ var rt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3591
3862
|
t && e[t.type]++;
|
|
3592
3863
|
}
|
|
3593
3864
|
}
|
|
3594
|
-
}(),
|
|
3865
|
+
}(), J = G({
|
|
3595
3866
|
workDir: "{workDir}",
|
|
3596
3867
|
rootDir: "{rootDir}",
|
|
3597
3868
|
dataDir: "{workDir}/Data",
|
|
@@ -3606,7 +3877,7 @@ var rt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3606
3877
|
enumerable: !1,
|
|
3607
3878
|
writable: !0,
|
|
3608
3879
|
configurable: !0
|
|
3609
|
-
}),
|
|
3880
|
+
}), Qt = {
|
|
3610
3881
|
saveDir: "",
|
|
3611
3882
|
mesSaveTime: 90,
|
|
3612
3883
|
recordSaveTime: 30,
|
|
@@ -3615,62 +3886,45 @@ var rt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3615
3886
|
ngImgSuffix: "png",
|
|
3616
3887
|
ngImgRatio: 1,
|
|
3617
3888
|
dbType: 2,
|
|
3889
|
+
defectMode: 0,
|
|
3618
3890
|
HostName: "127.0.0.1",
|
|
3619
3891
|
Port: 3306,
|
|
3620
3892
|
DatabaseName: "aoi",
|
|
3621
3893
|
UserName: "root",
|
|
3622
3894
|
Password: "123456"
|
|
3623
|
-
},
|
|
3624
|
-
let e = JSON.stringify(
|
|
3625
|
-
return
|
|
3626
|
-
},
|
|
3627
|
-
let t = await
|
|
3628
|
-
return t &&
|
|
3629
|
-
},
|
|
3630
|
-
let n = !1;
|
|
3631
|
-
for (let t of Object.keys(
|
|
3632
|
-
t && n &&
|
|
3633
|
-
},
|
|
3634
|
-
...
|
|
3635
|
-
setConfig:
|
|
3895
|
+
}, $t = () => {
|
|
3896
|
+
let e = JSON.stringify(Y, void 0, 4);
|
|
3897
|
+
return bn(J.settingPath, e), !0;
|
|
3898
|
+
}, en = async (e = !0) => {
|
|
3899
|
+
let t = await yn(J.settingPath, e);
|
|
3900
|
+
return t && tn(t, !1), Y.onChange?.(), !0;
|
|
3901
|
+
}, tn = (e = {}, t = !0) => {
|
|
3902
|
+
let n = !1, r = {};
|
|
3903
|
+
for (let t of Object.keys(Y)) e[t] === void 0 ? (e[t] = Qt[t], n = !0) : (Y[t] !== e[t] && (Y[t] = e[t], n = !0), t.endsWith("Mode") && (r[t] = e[t]));
|
|
3904
|
+
Object.keys(r).length > 0 && zt(q.systemMode, r), t && n && $t();
|
|
3905
|
+
}, nn = async (e = !0) => (rn.level = (await yn(J.userPath, e))?.UserLevel ?? 0, rn.onChange?.(), !0), Y = G({
|
|
3906
|
+
...Qt,
|
|
3907
|
+
setConfig: tn,
|
|
3636
3908
|
onChange: void 0
|
|
3637
3909
|
}, ["setConfig", "onChange"], {
|
|
3638
3910
|
enumerable: !1,
|
|
3639
3911
|
writable: !0,
|
|
3640
3912
|
configurable: !0
|
|
3641
|
-
}),
|
|
3913
|
+
}), rn = G({
|
|
3642
3914
|
level: 0,
|
|
3643
3915
|
onChange: void 0
|
|
3644
3916
|
}, ["onChange"], {
|
|
3645
3917
|
enumerable: !1,
|
|
3646
3918
|
writable: !0,
|
|
3647
3919
|
configurable: !0
|
|
3648
|
-
}),
|
|
3920
|
+
}), an = (e = {}) => {
|
|
3649
3921
|
let { exe: t } = $, n = t.getWorkDir(), r = t.getCurrentPath();
|
|
3650
|
-
|
|
3651
|
-
for (let e in
|
|
3652
|
-
|
|
3653
|
-
for (let e of ["dataDir", "ngImagesDir"])
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
Ot.read(a, i), setTimeout(() => Qt(K.settingPath, jt), 1e3), setTimeout(() => Qt(K.userPath, Nt), 1e3);
|
|
3657
|
-
}, It = {
|
|
3658
|
-
0: {
|
|
3659
|
-
editing: !0,
|
|
3660
|
-
visible: !0,
|
|
3661
|
-
operate: !0
|
|
3662
|
-
},
|
|
3663
|
-
1: {
|
|
3664
|
-
editing: !1,
|
|
3665
|
-
visible: !0,
|
|
3666
|
-
operate: !0
|
|
3667
|
-
},
|
|
3668
|
-
2: {
|
|
3669
|
-
editing: !1,
|
|
3670
|
-
visible: !1,
|
|
3671
|
-
operate: !1
|
|
3672
|
-
}
|
|
3673
|
-
}, J = new class {
|
|
3922
|
+
J.workDir = n, J.rootDir = r;
|
|
3923
|
+
for (let e in J) J[e] = J[e].replace(/\{(\w+)\}/g, (e, t) => J[t]);
|
|
3924
|
+
Y.saveDir = J.dataDir, Object.assign(Y, e), Ut(q.systemMode, ({ detail: e }) => Zt.work = !!e?.defectMode);
|
|
3925
|
+
for (let e of ["dataDir", "ngImagesDir"]) Z.mkdir(J[e], { recursive: !0 }, () => {});
|
|
3926
|
+
Z.existsSync(J.settingPath) ? en(!1) : $t(), Z.existsSync(J.userPath) && nn(!1), setTimeout(() => xn(J.settingPath, en), 1e3), setTimeout(() => xn(J.userPath, nn), 1e3);
|
|
3927
|
+
}, on = () => J.workDir.replace(/\\/g, "/").match(/[^/]+$/)?.[0], X = new class {
|
|
3674
3928
|
maxLength = 100;
|
|
3675
3929
|
#e = [];
|
|
3676
3930
|
get value() {
|
|
@@ -3683,7 +3937,7 @@ var rt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3683
3937
|
this.#e.splice(0, this.#e.length);
|
|
3684
3938
|
}
|
|
3685
3939
|
#t() {
|
|
3686
|
-
|
|
3940
|
+
zt(q.messageUpdated);
|
|
3687
3941
|
}
|
|
3688
3942
|
#n(e, t, n, r = {}) {
|
|
3689
3943
|
let i = Date.now();
|
|
@@ -3697,13 +3951,13 @@ var rt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3697
3951
|
}), this.#e.length > this.maxLength && this.#e.pop(), this.#t(), i;
|
|
3698
3952
|
}
|
|
3699
3953
|
error(e, t, n) {
|
|
3700
|
-
return this.#n("error", e, t ??
|
|
3954
|
+
return this.#n("error", e, t ?? K.tool.error(), n);
|
|
3701
3955
|
}
|
|
3702
3956
|
warning(e, t, n) {
|
|
3703
|
-
return this.#n("warning", e, t ??
|
|
3957
|
+
return this.#n("warning", e, t ?? K.tool.warning(), n);
|
|
3704
3958
|
}
|
|
3705
3959
|
info(e, t, n) {
|
|
3706
|
-
return this.#n("info", e, t ??
|
|
3960
|
+
return this.#n("info", e, t ?? K.tool.info(), n);
|
|
3707
3961
|
}
|
|
3708
3962
|
delete(e) {
|
|
3709
3963
|
let t = this.#e.findIndex((t) => t.id === e);
|
|
@@ -3720,61 +3974,73 @@ var rt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3720
3974
|
clear() {
|
|
3721
3975
|
this.#e.splice(0, this.#e.length), this.#t();
|
|
3722
3976
|
}
|
|
3723
|
-
}(),
|
|
3977
|
+
}(), Z = typeof __non_webpack_require__ == "function" ? __non_webpack_require__("fs") : typeof globalThis.require == "function" ? globalThis.require("fs") : null, sn = (e, t = 1500) => {
|
|
3724
3978
|
let n = null;
|
|
3725
3979
|
return function(...r) {
|
|
3726
3980
|
n && clearTimeout(n), n = setTimeout(e.bind(this, ...r), t);
|
|
3727
3981
|
};
|
|
3728
|
-
},
|
|
3982
|
+
}, cn = (e, t = 1500) => {
|
|
3729
3983
|
let n = null;
|
|
3730
3984
|
return function(...r) {
|
|
3731
3985
|
n ||= setTimeout(() => {
|
|
3732
3986
|
e.call(this, ...r), n = null;
|
|
3733
3987
|
}, t);
|
|
3734
3988
|
};
|
|
3735
|
-
},
|
|
3989
|
+
}, ln = (e) => {
|
|
3736
3990
|
if (!e || typeof e != "object") return e;
|
|
3737
3991
|
let t = e.constructor();
|
|
3738
|
-
for (let n in e) Object.hasOwn(e, n) && (t[n] =
|
|
3992
|
+
for (let n in e) Object.hasOwn(e, n) && (t[n] = ln(e[n]));
|
|
3739
3993
|
return t;
|
|
3740
|
-
},
|
|
3994
|
+
}, un = (e, t) => {
|
|
3741
3995
|
if (e === t) return !0;
|
|
3742
3996
|
if (typeof e != "object" || typeof t != "object" || e === null || t === null) return !1;
|
|
3743
3997
|
let n = Object.keys(e), r = Object.keys(t);
|
|
3744
3998
|
if (n.length !== r.length) return !1;
|
|
3745
|
-
for (let i of n) if (!r.includes(i) || !
|
|
3999
|
+
for (let i of n) if (!r.includes(i) || !un(e[i], t[i])) return !1;
|
|
3746
4000
|
return !0;
|
|
3747
|
-
},
|
|
4001
|
+
}, dn = (e = "_") => `${Date.now()}${e}${Math.floor(Math.random() * 1e4)}`, fn = (e) => e == null ? !1 : typeof e == "string" || Array.isArray(e) ? e.length > 0 : typeof e != "object" || Object.keys(e).length > 0, pn = (e, t = {}) => {
|
|
3748
4002
|
try {
|
|
3749
|
-
let n =
|
|
4003
|
+
let n = k(e);
|
|
3750
4004
|
for (let e in t) n = n[e]?.(t[e]);
|
|
3751
4005
|
return n.hexa();
|
|
3752
4006
|
} catch {
|
|
3753
4007
|
return !1;
|
|
3754
4008
|
}
|
|
3755
|
-
},
|
|
4009
|
+
}, mn = (e) => {
|
|
3756
4010
|
let t = $.token?.[e];
|
|
3757
|
-
return
|
|
3758
|
-
},
|
|
4011
|
+
return fn(t) ? t : getComputedStyle(document.getElementById("root")).getPropertyValue(`--aoi-${e}`).trim();
|
|
4012
|
+
}, hn = (e = fe) => {
|
|
4013
|
+
let t;
|
|
4014
|
+
switch (e) {
|
|
4015
|
+
case "small":
|
|
4016
|
+
t = $.token.controlHeightSM ?? 24;
|
|
4017
|
+
break;
|
|
4018
|
+
case "large":
|
|
4019
|
+
t = $.token.controlHeightLG ?? 40;
|
|
4020
|
+
break;
|
|
4021
|
+
default: t = $.token.controlHeight ?? 32;
|
|
4022
|
+
}
|
|
4023
|
+
return Number.parseInt(t);
|
|
4024
|
+
}, gn = (e, t = 2) => {
|
|
3759
4025
|
let n = Number(e);
|
|
3760
4026
|
return Number.isNaN(n) ? 0 : Number(n.toFixed(t));
|
|
3761
|
-
},
|
|
4027
|
+
}, _n = (e, t = {}, n = {}) => {
|
|
3762
4028
|
let r = e.constructor === String ? document.createElement(e) : e;
|
|
3763
|
-
for (let [e, n] of Object.entries(t)) n.constructor === Object ?
|
|
4029
|
+
for (let [e, n] of Object.entries(t)) n.constructor === Object ? _n(r[e], n) : e.startsWith("--") ? r.setProperty(e, n) : r[e] = n;
|
|
3764
4030
|
for (let [e, t] of Object.entries(n)) r.addEventListener(e, t);
|
|
3765
4031
|
return r;
|
|
3766
|
-
},
|
|
4032
|
+
}, vn = (e) => {
|
|
3767
4033
|
e?.stopPropagation(), e?.preventDefault(), e.cancelBubble = !0;
|
|
3768
|
-
},
|
|
3769
|
-
if (
|
|
3770
|
-
|
|
4034
|
+
}, yn = (e, t = !1) => {
|
|
4035
|
+
if (At(t, "function")) {
|
|
4036
|
+
Z.readFile(e, "utf-8", (n, r) => {
|
|
3771
4037
|
if (n || !r) {
|
|
3772
4038
|
n && $.dev && console.error(n);
|
|
3773
4039
|
return;
|
|
3774
4040
|
}
|
|
3775
4041
|
let i = Q(r);
|
|
3776
4042
|
if (!i) {
|
|
3777
|
-
|
|
4043
|
+
X.error(K.file.filePath({ path: e }), K.file.readErr());
|
|
3778
4044
|
return;
|
|
3779
4045
|
}
|
|
3780
4046
|
t(i);
|
|
@@ -3793,14 +4059,14 @@ var rt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3793
4059
|
return t ? Q(t) : null;
|
|
3794
4060
|
}
|
|
3795
4061
|
} catch (t) {
|
|
3796
|
-
return
|
|
4062
|
+
return X.error(K.file.filePath({ path: e }), K.file.readErr()), $.dev && console.error(t), null;
|
|
3797
4063
|
}
|
|
3798
|
-
},
|
|
3799
|
-
|
|
3800
|
-
t && (
|
|
4064
|
+
}, bn = (e, t, n) => {
|
|
4065
|
+
Z.writeFile(e, Sn(t), "utf-8", (t) => {
|
|
4066
|
+
n?.(t), t && (X.error(K.file.filePath({ path: e }), K.file.writeErr()), $.dev && console.error(t));
|
|
3801
4067
|
});
|
|
3802
|
-
},
|
|
3803
|
-
|
|
4068
|
+
}, xn = (e, t) => {
|
|
4069
|
+
At(t, "function") && Z.watch(e, (e) => {
|
|
3804
4070
|
e === "change" && (clearTimeout(t?.timer), t.timer = setTimeout(t, 1e3));
|
|
3805
4071
|
});
|
|
3806
4072
|
}, Q = (e, t = null) => {
|
|
@@ -3810,21 +4076,15 @@ var rt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3810
4076
|
} catch {
|
|
3811
4077
|
return t;
|
|
3812
4078
|
}
|
|
3813
|
-
},
|
|
4079
|
+
}, Sn = (e, t = "") => {
|
|
3814
4080
|
if (typeof e == "string") return e;
|
|
3815
4081
|
try {
|
|
3816
4082
|
return JSON.stringify(e);
|
|
3817
4083
|
} catch {
|
|
3818
4084
|
return t;
|
|
3819
4085
|
}
|
|
3820
|
-
},
|
|
3821
|
-
|
|
3822
|
-
let r = t[n];
|
|
3823
|
-
X(r, "object") ? (e[n] || (e[n] = {}), en(e[n], r)) : e[n] = r;
|
|
3824
|
-
}
|
|
3825
|
-
return e;
|
|
3826
|
-
}, tn = (e, t = {}) => {
|
|
3827
|
-
let { x: n = 0, y: r = 0, w: i = 0, h: a = 0, fileName: o, prefixDir: s = K.ngImagesDir, ratio: c = q.ngImgRatio } = t;
|
|
4086
|
+
}, Cn = (e, t = {}) => {
|
|
4087
|
+
let { x: n = 0, y: r = 0, w: i = 0, h: a = 0, fileName: o, prefixDir: s = J.ngImagesDir, ratio: c = Y.ngImgRatio } = t;
|
|
3828
4088
|
if (!e || n <= 0 || r <= 0 || i <= 0 || a <= 0 || !o) return {
|
|
3829
4089
|
image: e,
|
|
3830
4090
|
x: n,
|
|
@@ -3841,9 +4101,9 @@ var rt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3841
4101
|
"jpeg",
|
|
3842
4102
|
"png",
|
|
3843
4103
|
"bmp"
|
|
3844
|
-
].includes(l) || (t += `.${
|
|
4104
|
+
].includes(l) || (t += `.${Y.ngImgSuffix}`);
|
|
3845
4105
|
let u = t.substring(0, t.lastIndexOf("/"));
|
|
3846
|
-
|
|
4106
|
+
Z.existsSync(u) || Z.mkdirSync(u, { recursive: !0 });
|
|
3847
4107
|
let { cv: d } = $, f = d.cropSharedMemImage(e, n, r, n + i, r + a);
|
|
3848
4108
|
return !f || new Promise((e, n) => {
|
|
3849
4109
|
d.imwriteWithRatio(t, f, c, (t) => {
|
|
@@ -3853,8 +4113,8 @@ var rt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3853
4113
|
} catch (e) {
|
|
3854
4114
|
return $.dev && console.error(e), !0;
|
|
3855
4115
|
}
|
|
3856
|
-
},
|
|
3857
|
-
let { fileName: t, prefixDir: n =
|
|
4116
|
+
}, wn = (e = {}) => {
|
|
4117
|
+
let { fileName: t, prefixDir: n = J.ngImagesDir } = e;
|
|
3858
4118
|
if (!t) return;
|
|
3859
4119
|
let r = `${n}/${t}`, i = r.split(".").pop().toLowerCase();
|
|
3860
4120
|
[
|
|
@@ -3862,24 +4122,27 @@ var rt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3862
4122
|
"jpeg",
|
|
3863
4123
|
"png",
|
|
3864
4124
|
"bmp"
|
|
3865
|
-
].includes(i) || (r += `.${
|
|
4125
|
+
].includes(i) || (r += `.${Y.ngImgSuffix}`);
|
|
3866
4126
|
let { cv: a } = $;
|
|
3867
4127
|
return new Promise((e, t) => {
|
|
3868
4128
|
a.imread(r, (t, n) => {
|
|
3869
4129
|
t ? ($.dev && console.error("error read image: ", t), e(!1)) : e(n);
|
|
3870
4130
|
});
|
|
3871
4131
|
});
|
|
3872
|
-
},
|
|
3873
|
-
let { fileName: t, prefixDir: n =
|
|
4132
|
+
}, Tn = async (e = {}) => {
|
|
4133
|
+
let { fileName: t, prefixDir: n = J.ngImagesDir } = e;
|
|
3874
4134
|
if (!t) return;
|
|
3875
4135
|
let r = n ? `${n}/${t}` : t;
|
|
3876
|
-
if (!
|
|
4136
|
+
if (!Z.existsSync(r)) return;
|
|
3877
4137
|
let { exe: i } = $;
|
|
3878
4138
|
return await i.deletePath(r) === "delete successed";
|
|
3879
|
-
},
|
|
4139
|
+
}, En = (e, t = "", n = []) => {
|
|
4140
|
+
let { cv: r } = $, i = J.dataDir;
|
|
4141
|
+
return e ? r.getOpenFileName(t, `*${n.join(";*")}`, i) : r.getExistingDirectory(t, i);
|
|
4142
|
+
}, Dn = (e, ...t) => e.replace(/\?/g, () => {
|
|
3880
4143
|
let e = t.shift();
|
|
3881
|
-
return e instanceof Object && (e =
|
|
3882
|
-
}).replace(/[\n\r\s]+/g, " "),
|
|
4144
|
+
return e instanceof Object && (e = Sn(e, void 0)), typeof e == "string" ? e.length ? `'${e}'` : "null" : e === void 0 ? "null" : e;
|
|
4145
|
+
}).replace(/[\n\r\s]+/g, " "), On = class {
|
|
3883
4146
|
#e = [];
|
|
3884
4147
|
#t = !1;
|
|
3885
4148
|
get sqls() {
|
|
@@ -3890,25 +4153,28 @@ var rt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3890
4153
|
}
|
|
3891
4154
|
constructor(e) {
|
|
3892
4155
|
let { exe: t } = $;
|
|
3893
|
-
this.#e = e || [], this.#
|
|
4156
|
+
this.#e = e || [], this.#t = !this.#e.length || e.some((e) => t.verifyDatabase(e.tableName, Sn(e.fields)));
|
|
3894
4157
|
}
|
|
3895
4158
|
async #n({ tableName: e, sqlKey: t, typeErr: n, execFunc: r }, ...i) {
|
|
3896
|
-
let a = this
|
|
3897
|
-
if (!a) return
|
|
3898
|
-
let { exe: o } = $, s =
|
|
4159
|
+
let a = this.getTable(e);
|
|
4160
|
+
if (!a) return !1;
|
|
4161
|
+
let { exe: o } = $, s = Dn(a.sqls?.[t] ?? t, ...i);
|
|
3899
4162
|
try {
|
|
3900
4163
|
let e = await r(o, s);
|
|
3901
4164
|
if (e) return e;
|
|
3902
4165
|
throw Error();
|
|
3903
4166
|
} catch (e) {
|
|
3904
|
-
return
|
|
4167
|
+
return X.error(K.sql.execErr({ error: s }), n), $.dev && console.error(e), !1;
|
|
3905
4168
|
}
|
|
3906
4169
|
}
|
|
4170
|
+
getTable(e) {
|
|
4171
|
+
return this.#e.find((t) => t.tableName === e) || (X.error(K.sql.tableErr({ tableName: e }), K.sql.error()), !1);
|
|
4172
|
+
}
|
|
3907
4173
|
update(e, t, ...n) {
|
|
3908
4174
|
return this.#n({
|
|
3909
4175
|
tableName: e,
|
|
3910
4176
|
sqlKey: t,
|
|
3911
|
-
typeErr:
|
|
4177
|
+
typeErr: K.sql.updateErr(),
|
|
3912
4178
|
execFunc: async (e, t) => await e.writeDataBase(t) === 0
|
|
3913
4179
|
}, ...n);
|
|
3914
4180
|
}
|
|
@@ -3916,7 +4182,7 @@ var rt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3916
4182
|
return this.#n({
|
|
3917
4183
|
tableName: e,
|
|
3918
4184
|
sqlKey: t,
|
|
3919
|
-
typeErr:
|
|
4185
|
+
typeErr: K.sql.selectErr(),
|
|
3920
4186
|
execFunc: async (e, t) => {
|
|
3921
4187
|
let n = await e.findDataBaseData(t);
|
|
3922
4188
|
return n?.length ? Q(n, []) : [];
|
|
@@ -3927,7 +4193,7 @@ var rt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3927
4193
|
return this.#n({
|
|
3928
4194
|
tableName: e,
|
|
3929
4195
|
sqlKey: t,
|
|
3930
|
-
typeErr:
|
|
4196
|
+
typeErr: K.sql.selectErr(),
|
|
3931
4197
|
execFunc: async (e, t) => {
|
|
3932
4198
|
let n = await e.findSingleDataBaseData(t);
|
|
3933
4199
|
return n?.length ? Q(n) : null;
|
|
@@ -3938,24 +4204,24 @@ var rt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3938
4204
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
3939
4205
|
for (let r of e) {
|
|
3940
4206
|
let e = this.#e.find((e) => e.tableName === r.name);
|
|
3941
|
-
e ? n.push(
|
|
4207
|
+
e ? n.push(Dn(e.sqls?.[r.key] ?? r.key, ...r?.params ?? [])) : t.add(r.name);
|
|
3942
4208
|
}
|
|
3943
4209
|
if (t.size) {
|
|
3944
4210
|
let e = Array.from(t).join(", ");
|
|
3945
|
-
return
|
|
4211
|
+
return X.error(K.sql.tableErr({ tableName: e }), K.sql.error()), !1;
|
|
3946
4212
|
}
|
|
3947
4213
|
let { exe: r } = $, i = n.join("&");
|
|
3948
4214
|
try {
|
|
3949
4215
|
if (await r.batchWriteDataBase(i)) return !0;
|
|
3950
4216
|
throw Error();
|
|
3951
4217
|
} catch (e) {
|
|
3952
|
-
return
|
|
4218
|
+
return X.error(K.sql.execErr({ error: i }), K.sql.batchErr()), $.dev && console.error(e), !1;
|
|
3953
4219
|
}
|
|
3954
4220
|
}
|
|
3955
|
-
},
|
|
3956
|
-
let t = new
|
|
4221
|
+
}, kn = (e) => {
|
|
4222
|
+
let t = new On(e);
|
|
3957
4223
|
return !t.error && t;
|
|
3958
|
-
},
|
|
4224
|
+
}, An = new class {
|
|
3959
4225
|
maxLength = 3;
|
|
3960
4226
|
#e = [];
|
|
3961
4227
|
get length() {
|
|
@@ -3986,7 +4252,7 @@ var rt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3986
4252
|
this.#e.splice(0, this.#e.length);
|
|
3987
4253
|
}
|
|
3988
4254
|
}(), $ = {
|
|
3989
|
-
token:
|
|
4255
|
+
token: De,
|
|
3990
4256
|
langs: [],
|
|
3991
4257
|
exe: null,
|
|
3992
4258
|
cv: null,
|
|
@@ -3994,9 +4260,10 @@ var rt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3994
4260
|
evt: !1,
|
|
3995
4261
|
neat: !1,
|
|
3996
4262
|
dev: !1,
|
|
3997
|
-
level: null
|
|
3998
|
-
|
|
3999
|
-
|
|
4263
|
+
level: null,
|
|
4264
|
+
project: {}
|
|
4265
|
+
}, jn = ({ exe: e = null, cv: t = null, neat: n = !1, dev: r = !1, resource: i = {}, lang: a = "zh", sqls: o = [], evt: s = [], level: c = {}, config: l = {}, project: u = {}, imgQueueLen: d = 3, msgMaxLen: f = 100 } = {}) => {
|
|
4266
|
+
$.exe = e, $.cv = t, $.neat = n, $.dev = r, $.level = c, $.langs = Pt(i, a), $.db = kn(o), $.evt = Rt(s), X.maxLength = f, An.maxLength = d, an(l), $.project = Object.assign(u, Kt.toProps());
|
|
4000
4267
|
};
|
|
4001
4268
|
//#endregion
|
|
4002
|
-
export {
|
|
4269
|
+
export { kt as $, on as A, q as B, mn as C, X as D, bn as E, Xt as F, Ht as G, zt as H, Jt as I, K as J, Vt as K, Kt as L, rn as M, Zt as N, J as O, Yt as P, G as Q, qt as R, gn as S, xn as T, Bt as U, Wt as V, Rt as W, Ot as X, jt as Y, At as Z, vn as _, sn as a, U as at, pn as b, Z as c, Ce as ct, Q as d, de as dt, Et as et, yn as f, k as ft, _n as g, u as gt, Cn as h, d as ht, kn as i, W as it, Y as j, an as k, En as l, fe as lt, Tn as m, c as mt, jn as n, xt as nt, ln as o, Ee as ot, wn as p, s as pt, Ut as q, An as r, vt as rt, un as s, F as st, $ as t, wt as tt, fn as u, pe as ut, Sn as v, dn as w, hn as x, cn as y, Gt as z };
|