aoi-comp 1.0.9 → 1.0.11
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/README.md +77 -49
- package/dist/{BufferResource-o2LGGq1U.js → BufferResource-KIVvy5RU.js} +2 -2
- package/dist/{CanvasPool-x1nSZDIx.js → CanvasPool-CoJ6fp2T.js} +1 -1
- package/dist/{Geometry-BM7su788.js → Geometry-yirqXUbT.js} +2 -2
- package/dist/{RenderTargetSystem-BNp9VOlY.js → RenderTargetSystem-C5FbaxB6.js} +1 -1
- package/dist/{browserAll-EL05LSIx.js → browserAll-BlXoOxdk.js} +3 -3
- package/dist/{canvasUtils-C0wKvLC1.js → canvasUtils-ByNFM8PZ.js} +1 -1
- package/dist/comps.js +5132 -4866
- package/dist/{getTextureBatchBindGroup-BFZcnSby.js → getTextureBatchBindGroup-DboMquwr.js} +1 -1
- package/dist/hooks-Ww44LelW.js +562 -0
- package/dist/hooks.js +2 -2
- package/dist/index.js +1 -1
- package/dist/{init-C4yLp8yD.js → init-5-nCmzt4.js} +3 -3
- package/dist/{init-CCTyMlTU.js → init-DPdifVJ6.js} +2 -2
- package/dist/{packages-C9qBCygN.js → packages-DtEpsTpy.js} +518 -439
- package/dist/style.css +1 -1
- package/dist/utils.js +2 -2
- package/dist/webworkerAll-BQbmOPdT.js +2 -0
- package/package.json +1 -1
- package/dist/hooks-MstF8Y3K.js +0 -527
- package/dist/webworkerAll-CytR-OcT.js +0 -2
|
@@ -1444,30 +1444,30 @@ function E(e, t) {
|
|
|
1444
1444
|
return t(e(n));
|
|
1445
1445
|
};
|
|
1446
1446
|
}
|
|
1447
|
-
function
|
|
1447
|
+
function ee(e, t) {
|
|
1448
1448
|
let n = [t[e].parent, e], r = y[t[e].parent][e], i = t[e].parent;
|
|
1449
1449
|
for (; t[i].parent;) n.unshift(t[i].parent), r = E(y[t[i].parent][i], r), i = t[i].parent;
|
|
1450
1450
|
return r.conversion = n, r;
|
|
1451
1451
|
}
|
|
1452
|
-
function
|
|
1452
|
+
function te(e) {
|
|
1453
1453
|
let t = T(e), n = {}, r = Object.keys(t);
|
|
1454
1454
|
for (let { length: e } = r, i = 0; i < e; i++) {
|
|
1455
1455
|
let e = r[i];
|
|
1456
|
-
t[e].parent !== null && (n[e] =
|
|
1456
|
+
t[e].parent !== null && (n[e] = ee(e, t));
|
|
1457
1457
|
}
|
|
1458
1458
|
return n;
|
|
1459
1459
|
}
|
|
1460
1460
|
//#endregion
|
|
1461
1461
|
//#region node_modules/.pnpm/color-convert@3.1.3/node_modules/color-convert/index.js
|
|
1462
|
-
var
|
|
1463
|
-
function
|
|
1462
|
+
var D = {}, ne = Object.keys(y);
|
|
1463
|
+
function re(e) {
|
|
1464
1464
|
let t = function(...t) {
|
|
1465
1465
|
let n = t[0];
|
|
1466
1466
|
return n == null ? n : (n.length > 1 && (t = n), e(t));
|
|
1467
1467
|
};
|
|
1468
1468
|
return "conversion" in e && (t.conversion = e.conversion), t;
|
|
1469
1469
|
}
|
|
1470
|
-
function
|
|
1470
|
+
function ie(e) {
|
|
1471
1471
|
let t = function(...t) {
|
|
1472
1472
|
let n = t[0];
|
|
1473
1473
|
if (n == null) return n;
|
|
@@ -1478,41 +1478,41 @@ function re(e) {
|
|
|
1478
1478
|
};
|
|
1479
1479
|
return "conversion" in e && (t.conversion = e.conversion), t;
|
|
1480
1480
|
}
|
|
1481
|
-
for (let e of
|
|
1482
|
-
|
|
1483
|
-
let t =
|
|
1481
|
+
for (let e of ne) {
|
|
1482
|
+
D[e] = {}, Object.defineProperty(D[e], "channels", { value: y[e].channels }), Object.defineProperty(D[e], "labels", { value: y[e].labels });
|
|
1483
|
+
let t = te(e), n = Object.keys(t);
|
|
1484
1484
|
for (let r of n) {
|
|
1485
1485
|
let n = t[r];
|
|
1486
|
-
|
|
1486
|
+
D[e][r] = ie(n), D[e][r].raw = re(n);
|
|
1487
1487
|
}
|
|
1488
1488
|
}
|
|
1489
1489
|
//#endregion
|
|
1490
1490
|
//#region node_modules/.pnpm/color@5.0.3/node_modules/color/index.js
|
|
1491
|
-
var
|
|
1491
|
+
var ae = [
|
|
1492
1492
|
"keyword",
|
|
1493
1493
|
"gray",
|
|
1494
1494
|
"hex"
|
|
1495
|
-
],
|
|
1496
|
-
for (let e of Object.keys(
|
|
1497
|
-
var
|
|
1498
|
-
function
|
|
1499
|
-
if (!(this instanceof
|
|
1500
|
-
if (t && t in
|
|
1495
|
+
], oe = {};
|
|
1496
|
+
for (let e of Object.keys(D)) oe[[...D[e].labels].sort().join("")] = e;
|
|
1497
|
+
var se = {};
|
|
1498
|
+
function O(e, t) {
|
|
1499
|
+
if (!(this instanceof O)) return new O(e, t);
|
|
1500
|
+
if (t && t in ae && (t = null), t && !(t in D)) throw Error("Unknown model: " + t);
|
|
1501
1501
|
let n, r;
|
|
1502
1502
|
if (e == null) this.model = "rgb", this.color = [
|
|
1503
1503
|
0,
|
|
1504
1504
|
0,
|
|
1505
1505
|
0
|
|
1506
1506
|
], this.valpha = 1;
|
|
1507
|
-
else if (e instanceof
|
|
1507
|
+
else if (e instanceof O) this.model = e.model, this.color = [...e.color], this.valpha = e.valpha;
|
|
1508
1508
|
else if (typeof e == "string") {
|
|
1509
1509
|
let t = h.get(e);
|
|
1510
1510
|
if (t === null) throw Error("Unable to parse color from string: " + e);
|
|
1511
|
-
this.model = t.model, r =
|
|
1511
|
+
this.model = t.model, r = D[this.model].channels, this.color = t.value.slice(0, r), this.valpha = typeof t.value[r] == "number" ? t.value[r] : 1;
|
|
1512
1512
|
} else if (e.length > 0) {
|
|
1513
|
-
this.model = t || "rgb", r =
|
|
1513
|
+
this.model = t || "rgb", r = D[this.model].channels;
|
|
1514
1514
|
let n = Array.prototype.slice.call(e, 0, r);
|
|
1515
|
-
this.color =
|
|
1515
|
+
this.color = de(n, r), this.valpha = typeof e[r] == "number" ? e[r] : 1;
|
|
1516
1516
|
} else if (typeof e == "number") this.model = "rgb", this.color = [
|
|
1517
1517
|
e >> 16 & 255,
|
|
1518
1518
|
e >> 8 & 255,
|
|
@@ -1523,19 +1523,19 @@ function k(e, t) {
|
|
|
1523
1523
|
let t = Object.keys(e);
|
|
1524
1524
|
"alpha" in e && (t.splice(t.indexOf("alpha"), 1), this.valpha = typeof e.alpha == "number" ? e.alpha : 0);
|
|
1525
1525
|
let r = t.sort().join("");
|
|
1526
|
-
if (!(r in
|
|
1527
|
-
this.model =
|
|
1528
|
-
let { labels: i } =
|
|
1526
|
+
if (!(r in oe)) throw Error("Unable to parse color from object: " + JSON.stringify(e));
|
|
1527
|
+
this.model = oe[r];
|
|
1528
|
+
let { labels: i } = D[this.model], a = [];
|
|
1529
1529
|
for (n = 0; n < i.length; n++) a.push(e[i[n]]);
|
|
1530
|
-
this.color =
|
|
1530
|
+
this.color = de(a);
|
|
1531
1531
|
}
|
|
1532
|
-
if (
|
|
1533
|
-
let e =
|
|
1532
|
+
if (se[this.model]) for (r = D[this.model].channels, n = 0; n < r; n++) {
|
|
1533
|
+
let e = se[this.model][n];
|
|
1534
1534
|
e && (this.color[n] = e(this.color[n]));
|
|
1535
1535
|
}
|
|
1536
1536
|
this.valpha = Math.max(0, Math.min(1, this.valpha)), Object.freeze && Object.freeze(this);
|
|
1537
1537
|
}
|
|
1538
|
-
|
|
1538
|
+
O.prototype = {
|
|
1539
1539
|
toString() {
|
|
1540
1540
|
return this.string();
|
|
1541
1541
|
},
|
|
@@ -1556,7 +1556,7 @@ k.prototype = {
|
|
|
1556
1556
|
return this.valpha === 1 ? [...this.color] : [...this.color, this.valpha];
|
|
1557
1557
|
},
|
|
1558
1558
|
object() {
|
|
1559
|
-
let e = {}, { channels: t } =
|
|
1559
|
+
let e = {}, { channels: t } = D[this.model], { labels: n } = D[this.model];
|
|
1560
1560
|
for (let r = 0; r < t; r++) e[n[r]] = this.color[r];
|
|
1561
1561
|
return this.valpha !== 1 && (e.alpha = this.valpha), e;
|
|
1562
1562
|
},
|
|
@@ -1569,47 +1569,47 @@ k.prototype = {
|
|
|
1569
1569
|
return e.r /= 255, e.g /= 255, e.b /= 255, this.valpha !== 1 && (e.alpha = this.valpha), e;
|
|
1570
1570
|
},
|
|
1571
1571
|
round(e) {
|
|
1572
|
-
return e = Math.max(e || 0, 0), new
|
|
1572
|
+
return e = Math.max(e || 0, 0), new O([...this.color.map(le(e)), this.valpha], this.model);
|
|
1573
1573
|
},
|
|
1574
1574
|
alpha(e) {
|
|
1575
|
-
return e === void 0 ? this.valpha : new
|
|
1575
|
+
return e === void 0 ? this.valpha : new O([...this.color, Math.max(0, Math.min(1, e))], this.model);
|
|
1576
1576
|
},
|
|
1577
|
-
red:
|
|
1578
|
-
green:
|
|
1579
|
-
blue:
|
|
1580
|
-
hue:
|
|
1577
|
+
red: k("rgb", 0, A(255)),
|
|
1578
|
+
green: k("rgb", 1, A(255)),
|
|
1579
|
+
blue: k("rgb", 2, A(255)),
|
|
1580
|
+
hue: k([
|
|
1581
1581
|
"hsl",
|
|
1582
1582
|
"hsv",
|
|
1583
1583
|
"hsl",
|
|
1584
1584
|
"hwb",
|
|
1585
1585
|
"hcg"
|
|
1586
1586
|
], 0, (e) => (e % 360 + 360) % 360),
|
|
1587
|
-
saturationl:
|
|
1588
|
-
lightness:
|
|
1589
|
-
saturationv:
|
|
1590
|
-
value:
|
|
1591
|
-
chroma:
|
|
1592
|
-
gray:
|
|
1593
|
-
white:
|
|
1594
|
-
wblack:
|
|
1595
|
-
cyan:
|
|
1596
|
-
magenta:
|
|
1597
|
-
yellow:
|
|
1598
|
-
black:
|
|
1599
|
-
x:
|
|
1600
|
-
y:
|
|
1601
|
-
z:
|
|
1602
|
-
l:
|
|
1603
|
-
a:
|
|
1604
|
-
b:
|
|
1587
|
+
saturationl: k("hsl", 1, A(100)),
|
|
1588
|
+
lightness: k("hsl", 2, A(100)),
|
|
1589
|
+
saturationv: k("hsv", 1, A(100)),
|
|
1590
|
+
value: k("hsv", 2, A(100)),
|
|
1591
|
+
chroma: k("hcg", 1, A(100)),
|
|
1592
|
+
gray: k("hcg", 2, A(100)),
|
|
1593
|
+
white: k("hwb", 1, A(100)),
|
|
1594
|
+
wblack: k("hwb", 2, A(100)),
|
|
1595
|
+
cyan: k("cmyk", 0, A(100)),
|
|
1596
|
+
magenta: k("cmyk", 1, A(100)),
|
|
1597
|
+
yellow: k("cmyk", 2, A(100)),
|
|
1598
|
+
black: k("cmyk", 3, A(100)),
|
|
1599
|
+
x: k("xyz", 0, A(95.047)),
|
|
1600
|
+
y: k("xyz", 1, A(100)),
|
|
1601
|
+
z: k("xyz", 2, A(108.833)),
|
|
1602
|
+
l: k("lab", 0, A(100)),
|
|
1603
|
+
a: k("lab", 1),
|
|
1604
|
+
b: k("lab", 2),
|
|
1605
1605
|
keyword(e) {
|
|
1606
|
-
return e === void 0 ?
|
|
1606
|
+
return e === void 0 ? D[this.model].keyword(this.color) : new O(e);
|
|
1607
1607
|
},
|
|
1608
1608
|
hex(e) {
|
|
1609
|
-
return e === void 0 ? h.to.hex(...this.rgb().round().color) : new
|
|
1609
|
+
return e === void 0 ? h.to.hex(...this.rgb().round().color) : new O(e);
|
|
1610
1610
|
},
|
|
1611
1611
|
hexa(e) {
|
|
1612
|
-
if (e !== void 0) return new
|
|
1612
|
+
if (e !== void 0) return new O(e);
|
|
1613
1613
|
let t = this.rgb().round().color, n = Math.round(this.valpha * 255).toString(16).toUpperCase();
|
|
1614
1614
|
return n.length === 1 && (n = "0" + n), h.to.hex(...t) + n;
|
|
1615
1615
|
},
|
|
@@ -1671,7 +1671,7 @@ k.prototype = {
|
|
|
1671
1671
|
},
|
|
1672
1672
|
grayscale() {
|
|
1673
1673
|
let e = this.rgb().color, t = e[0] * .3 + e[1] * .59 + e[2] * .11;
|
|
1674
|
-
return
|
|
1674
|
+
return O.rgb(t, t, t);
|
|
1675
1675
|
},
|
|
1676
1676
|
fade(e) {
|
|
1677
1677
|
return this.alpha(this.valpha - this.valpha * e);
|
|
@@ -1686,55 +1686,55 @@ k.prototype = {
|
|
|
1686
1686
|
mix(e, t) {
|
|
1687
1687
|
if (!e || !e.rgb) throw Error("Argument to \"mix\" was not a Color instance, but rather an instance of " + typeof e);
|
|
1688
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;
|
|
1689
|
-
return
|
|
1689
|
+
return O.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));
|
|
1690
1690
|
}
|
|
1691
1691
|
};
|
|
1692
|
-
for (let e of Object.keys(
|
|
1693
|
-
if (
|
|
1694
|
-
let { channels: t } =
|
|
1695
|
-
|
|
1696
|
-
return this.model === e ? new
|
|
1697
|
-
},
|
|
1692
|
+
for (let e of Object.keys(D)) {
|
|
1693
|
+
if (ae.includes(e)) continue;
|
|
1694
|
+
let { channels: t } = D[e];
|
|
1695
|
+
O.prototype[e] = function(...t) {
|
|
1696
|
+
return this.model === e ? new O(this) : t.length > 0 ? new O(t, e) : new O([...ue(D[this.model][e].raw(this.color)), this.valpha], e);
|
|
1697
|
+
}, O[e] = function(...n) {
|
|
1698
1698
|
let r = n[0];
|
|
1699
|
-
return typeof r == "number" && (r =
|
|
1699
|
+
return typeof r == "number" && (r = de(n, t)), new O(r, e);
|
|
1700
1700
|
};
|
|
1701
1701
|
}
|
|
1702
|
-
function
|
|
1702
|
+
function ce(e, t) {
|
|
1703
1703
|
return Number(e.toFixed(t));
|
|
1704
1704
|
}
|
|
1705
|
-
function
|
|
1705
|
+
function le(e) {
|
|
1706
1706
|
return function(t) {
|
|
1707
|
-
return
|
|
1707
|
+
return ce(t, e);
|
|
1708
1708
|
};
|
|
1709
1709
|
}
|
|
1710
|
-
function
|
|
1710
|
+
function k(e, t, n) {
|
|
1711
1711
|
e = Array.isArray(e) ? e : [e];
|
|
1712
|
-
for (let r of e) (
|
|
1712
|
+
for (let r of e) (se[r] ||= [])[t] = n;
|
|
1713
1713
|
return e = e[0], function(r) {
|
|
1714
1714
|
let i;
|
|
1715
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);
|
|
1716
1716
|
};
|
|
1717
1717
|
}
|
|
1718
|
-
function
|
|
1718
|
+
function A(e) {
|
|
1719
1719
|
return function(t) {
|
|
1720
1720
|
return Math.max(0, Math.min(e, t));
|
|
1721
1721
|
};
|
|
1722
1722
|
}
|
|
1723
|
-
function
|
|
1723
|
+
function ue(e) {
|
|
1724
1724
|
return Array.isArray(e) ? e : [e];
|
|
1725
1725
|
}
|
|
1726
|
-
function
|
|
1726
|
+
function de(e, t) {
|
|
1727
1727
|
for (let n = 0; n < t; n++) typeof e[n] != "number" && (e[n] = 0);
|
|
1728
1728
|
return e;
|
|
1729
1729
|
}
|
|
1730
1730
|
//#endregion
|
|
1731
1731
|
//#region packages/themes/token.js
|
|
1732
|
-
var
|
|
1732
|
+
var j = {
|
|
1733
1733
|
colorPrimary: "#1677ff",
|
|
1734
1734
|
colorWarning: "#ffaa00",
|
|
1735
1735
|
colorError: "#ff4d4f",
|
|
1736
1736
|
colorText: "#ffffff"
|
|
1737
|
-
},
|
|
1737
|
+
}, M = {
|
|
1738
1738
|
viewBgc: "#383838",
|
|
1739
1739
|
compBgc: "#141414",
|
|
1740
1740
|
borderColor: "#444444",
|
|
@@ -1745,93 +1745,93 @@ var M = {
|
|
|
1745
1745
|
hoverWhite: "#ececec",
|
|
1746
1746
|
fontSize: 14,
|
|
1747
1747
|
iconSize: 18
|
|
1748
|
-
},
|
|
1748
|
+
}, fe = "os-theme-light", pe = "small", me = {
|
|
1749
1749
|
ok: "#00c291",
|
|
1750
1750
|
ng: "#f56c6c"
|
|
1751
|
-
},
|
|
1751
|
+
}, he = O("os-theme-light".includes("light") ? "#ffffff" : "#000000").alpha(.44).string(), ge = "#ffffff", _e = "#000000", ve = O(j.colorText).alpha(.45).string(), ye = O(j.colorPrimary).alpha(.3).string(), be = O(j.colorPrimary).desaturate(.45).string(), xe = O(M.borderColor).whiten(.25).string(), Se = O(M.compBgc).mix(O("white"), .1).string(), N = O(M.hoverWhite).alpha(.15).string(), Ce = `linear-gradient(90deg, ${O(j.colorPrimary).alpha(.92).string()} 0%, ${O(j.colorPrimary).darken(.3).string()} 100%)`, P = {
|
|
1752
1752
|
token: {
|
|
1753
|
-
colorPrimary:
|
|
1754
|
-
colorWarning:
|
|
1755
|
-
colorError:
|
|
1753
|
+
colorPrimary: j.colorPrimary,
|
|
1754
|
+
colorWarning: j.colorWarning,
|
|
1755
|
+
colorError: j.colorError,
|
|
1756
1756
|
borderRadiusLG: "4px",
|
|
1757
|
-
colorText:
|
|
1758
|
-
colorTextDescription:
|
|
1759
|
-
colorTextPlaceholder:
|
|
1760
|
-
colorBgContainer:
|
|
1761
|
-
colorBgElevated:
|
|
1762
|
-
colorIcon:
|
|
1763
|
-
colorBorder:
|
|
1764
|
-
controlItemBgActive:
|
|
1765
|
-
colorTextDisabled:
|
|
1766
|
-
colorBgContainerDisabled:
|
|
1757
|
+
colorText: j.colorText,
|
|
1758
|
+
colorTextDescription: ve,
|
|
1759
|
+
colorTextPlaceholder: ve,
|
|
1760
|
+
colorBgContainer: M.compBgc,
|
|
1761
|
+
colorBgElevated: M.compBgc,
|
|
1762
|
+
colorIcon: M.iconColor,
|
|
1763
|
+
colorBorder: M.borderColor,
|
|
1764
|
+
controlItemBgActive: ye,
|
|
1765
|
+
colorTextDisabled: M.disabledColor,
|
|
1766
|
+
colorBgContainerDisabled: O(M.disabledColor).lighten(.8).alpha(.08).string(),
|
|
1767
1767
|
controlOutlineWidth: 0,
|
|
1768
|
-
colorBorderDisabled:
|
|
1769
|
-
colorTextQuaternary:
|
|
1768
|
+
colorBorderDisabled: xe,
|
|
1769
|
+
colorTextQuaternary: ve
|
|
1770
1770
|
},
|
|
1771
1771
|
components: {
|
|
1772
1772
|
Layout: {
|
|
1773
|
-
bodyBg:
|
|
1774
|
-
footerBg:
|
|
1775
|
-
headerBg:
|
|
1776
|
-
siderBg:
|
|
1777
|
-
colorText:
|
|
1778
|
-
headerColor:
|
|
1779
|
-
descHintHoverColor:
|
|
1773
|
+
bodyBg: _e,
|
|
1774
|
+
footerBg: M.compBgc,
|
|
1775
|
+
headerBg: M.compBgc,
|
|
1776
|
+
siderBg: M.compBgc,
|
|
1777
|
+
colorText: j.colorText,
|
|
1778
|
+
headerColor: j.colorText,
|
|
1779
|
+
descHintHoverColor: be,
|
|
1780
1780
|
footerPadding: "5px",
|
|
1781
1781
|
layoutGap: "5px",
|
|
1782
|
-
layoutContentBg:
|
|
1782
|
+
layoutContentBg: M.compBgc
|
|
1783
1783
|
},
|
|
1784
|
-
Badge: { colorBorderBg:
|
|
1784
|
+
Badge: { colorBorderBg: j.colorError },
|
|
1785
1785
|
Tooltip: { colorBgSpotlight: "#424242" },
|
|
1786
|
-
Switch: { colorTextTertiary:
|
|
1786
|
+
Switch: { colorTextTertiary: O(M.hoverWhite).alpha(.65).string() },
|
|
1787
1787
|
Button: {
|
|
1788
|
-
borderColorDisabled:
|
|
1788
|
+
borderColorDisabled: xe,
|
|
1789
1789
|
primaryShadow: "none",
|
|
1790
|
-
colorBgSolid:
|
|
1791
|
-
solidTextColor:
|
|
1792
|
-
colorBgSolidHover:
|
|
1793
|
-
colorBgSolidActive:
|
|
1790
|
+
colorBgSolid: ge,
|
|
1791
|
+
solidTextColor: _e,
|
|
1792
|
+
colorBgSolidHover: O(ge).darken(.25).string(),
|
|
1793
|
+
colorBgSolidActive: O(ge).darken(.05).string()
|
|
1794
1794
|
},
|
|
1795
1795
|
Select: {
|
|
1796
|
-
controlItemBgActiveHover:
|
|
1797
|
-
optionActiveBg:
|
|
1796
|
+
controlItemBgActiveHover: be,
|
|
1797
|
+
optionActiveBg: N
|
|
1798
1798
|
},
|
|
1799
1799
|
Modal: {
|
|
1800
1800
|
padding: "10px",
|
|
1801
1801
|
contentPadding: 0,
|
|
1802
|
-
contentBg:
|
|
1803
|
-
titleColor:
|
|
1804
|
-
colorText:
|
|
1802
|
+
contentBg: M.compBgc,
|
|
1803
|
+
titleColor: j.colorPrimary,
|
|
1804
|
+
colorText: j.colorText,
|
|
1805
1805
|
titleLineHeight: "44px",
|
|
1806
1806
|
algorithm: !0,
|
|
1807
1807
|
headerMarginBottom: 0,
|
|
1808
1808
|
footerMarginTop: 0,
|
|
1809
|
-
colorIcon:
|
|
1810
|
-
colorIconHover:
|
|
1811
|
-
colorBgTextHover:
|
|
1809
|
+
colorIcon: M.iconColor,
|
|
1810
|
+
colorIconHover: M.iconColor,
|
|
1811
|
+
colorBgTextHover: j.colorError
|
|
1812
1812
|
},
|
|
1813
1813
|
Message: {
|
|
1814
1814
|
colorTextHeading: "inherit",
|
|
1815
|
-
contentBg:
|
|
1815
|
+
contentBg: M.infoColor
|
|
1816
1816
|
},
|
|
1817
1817
|
ColorPicker: {
|
|
1818
1818
|
popoverInnerPadding: "8px",
|
|
1819
1819
|
marginSm: "8px"
|
|
1820
1820
|
},
|
|
1821
1821
|
DatePicker: {
|
|
1822
|
-
colorIcon:
|
|
1823
|
-
cellActiveWithRangeBg:
|
|
1824
|
-
cellHoverBg:
|
|
1825
|
-
datePickerTimeBgActiveHover:
|
|
1822
|
+
colorIcon: M.iconColor,
|
|
1823
|
+
cellActiveWithRangeBg: ye,
|
|
1824
|
+
cellHoverBg: N,
|
|
1825
|
+
datePickerTimeBgActiveHover: be
|
|
1826
1826
|
},
|
|
1827
1827
|
Table: {
|
|
1828
|
-
borderColor:
|
|
1829
|
-
footerBg:
|
|
1830
|
-
headerBg:
|
|
1831
|
-
rowHoverBg:
|
|
1832
|
-
rowSelectedHoverBg:
|
|
1833
|
-
stickyScrollBarBg:
|
|
1834
|
-
colorSplit:
|
|
1828
|
+
borderColor: M.borderColor,
|
|
1829
|
+
footerBg: Se,
|
|
1830
|
+
headerBg: Se,
|
|
1831
|
+
rowHoverBg: N,
|
|
1832
|
+
rowSelectedHoverBg: be,
|
|
1833
|
+
stickyScrollBarBg: he,
|
|
1834
|
+
colorSplit: he,
|
|
1835
1835
|
tableCellPadding: "2px",
|
|
1836
1836
|
tableCellHeight: "32px"
|
|
1837
1837
|
},
|
|
@@ -1840,80 +1840,80 @@ var M = {
|
|
|
1840
1840
|
controlPaddingHorizontal: "13px",
|
|
1841
1841
|
marginSm: "0px",
|
|
1842
1842
|
trackBg: "transparent",
|
|
1843
|
-
itemColor:
|
|
1844
|
-
itemActiveBg:
|
|
1845
|
-
itemSelectedBg:
|
|
1846
|
-
itemHoverBg:
|
|
1843
|
+
itemColor: j.colorText,
|
|
1844
|
+
itemActiveBg: ye,
|
|
1845
|
+
itemSelectedBg: Ce,
|
|
1846
|
+
itemHoverBg: N,
|
|
1847
1847
|
fontSizeLg: "15px"
|
|
1848
1848
|
},
|
|
1849
1849
|
Tabs: {
|
|
1850
1850
|
cardGutter: "6px",
|
|
1851
|
-
tabsItemHoverBg:
|
|
1851
|
+
tabsItemHoverBg: N
|
|
1852
1852
|
},
|
|
1853
1853
|
Descriptions: {
|
|
1854
|
-
colorSplit:
|
|
1855
|
-
colorTextSecondary:
|
|
1854
|
+
colorSplit: M.borderColor,
|
|
1855
|
+
colorTextSecondary: j.colorText
|
|
1856
1856
|
}
|
|
1857
1857
|
}
|
|
1858
|
-
},
|
|
1859
|
-
let t = e.split("."), n =
|
|
1858
|
+
}, we = (e) => {
|
|
1859
|
+
let t = e.split("."), n = P.components;
|
|
1860
1860
|
for (let e of t) n = n[e];
|
|
1861
|
-
return n ===
|
|
1862
|
-
}, { getDesignToken:
|
|
1863
|
-
...
|
|
1864
|
-
...
|
|
1865
|
-
},
|
|
1866
|
-
...
|
|
1867
|
-
...
|
|
1868
|
-
},
|
|
1861
|
+
return n === P.components ? null : n;
|
|
1862
|
+
}, { getDesignToken: Te } = e, Ee = Te(P), De = {
|
|
1863
|
+
...P.token,
|
|
1864
|
+
...M
|
|
1865
|
+
}, Oe = {
|
|
1866
|
+
...Ee,
|
|
1867
|
+
...M
|
|
1868
|
+
}, F = (e) => typeof e == "string", I = () => {
|
|
1869
1869
|
let e, t, n = new Promise((n, r) => {
|
|
1870
1870
|
e = n, t = r;
|
|
1871
1871
|
});
|
|
1872
1872
|
return n.resolve = e, n.reject = t, n;
|
|
1873
|
-
},
|
|
1873
|
+
}, ke = (e) => e == null ? "" : String(e), Ae = (e, t, n) => {
|
|
1874
1874
|
e.forEach((e) => {
|
|
1875
1875
|
t[e] && (n[e] = t[e]);
|
|
1876
1876
|
});
|
|
1877
|
-
},
|
|
1878
|
-
let r =
|
|
1877
|
+
}, je = /###/g, Me = (e) => e && e.includes("###") ? e.replace(je, ".") : e, Ne = (e) => !e || F(e), L = (e, t, n) => {
|
|
1878
|
+
let r = F(t) ? t.split(".") : t, i = 0;
|
|
1879
1879
|
for (; i < r.length - 1;) {
|
|
1880
|
-
if (
|
|
1881
|
-
let t =
|
|
1880
|
+
if (Ne(e)) return {};
|
|
1881
|
+
let t = Me(r[i]);
|
|
1882
1882
|
!e[t] && n && (e[t] = new n()), e = Object.prototype.hasOwnProperty.call(e, t) ? e[t] : {}, ++i;
|
|
1883
1883
|
}
|
|
1884
|
-
return
|
|
1884
|
+
return Ne(e) ? {} : {
|
|
1885
1885
|
obj: e,
|
|
1886
|
-
k:
|
|
1886
|
+
k: Me(r[i])
|
|
1887
1887
|
};
|
|
1888
|
-
},
|
|
1889
|
-
let { obj: r, k: i } =
|
|
1888
|
+
}, Pe = (e, t, n) => {
|
|
1889
|
+
let { obj: r, k: i } = L(e, t, Object);
|
|
1890
1890
|
if (r !== void 0 || t.length === 1) {
|
|
1891
1891
|
r[i] = n;
|
|
1892
1892
|
return;
|
|
1893
1893
|
}
|
|
1894
|
-
let a = t[t.length - 1], o = t.slice(0, t.length - 1), s =
|
|
1895
|
-
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 = L(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 = L(e, o, Object), s?.obj && s.obj[`${s.k}.${a}`] !== void 0 && (s.obj = void 0);
|
|
1896
1896
|
s.obj[`${s.k}.${a}`] = n;
|
|
1897
|
-
},
|
|
1898
|
-
let { obj: i, k: a } =
|
|
1897
|
+
}, Fe = (e, t, n, r) => {
|
|
1898
|
+
let { obj: i, k: a } = L(e, t, Object);
|
|
1899
1899
|
i[a] = i[a] || [], i[a].push(n);
|
|
1900
|
-
},
|
|
1901
|
-
let { obj: n, k: r } =
|
|
1900
|
+
}, Ie = (e, t) => {
|
|
1901
|
+
let { obj: n, k: r } = L(e, t);
|
|
1902
1902
|
if (n && Object.prototype.hasOwnProperty.call(n, r)) return n[r];
|
|
1903
|
-
}, Ie = (e, t, n) => {
|
|
1904
|
-
let r = Fe(e, n);
|
|
1905
|
-
return r === void 0 ? Fe(t, n) : r;
|
|
1906
1903
|
}, Le = (e, t, n) => {
|
|
1907
|
-
|
|
1904
|
+
let r = Ie(e, n);
|
|
1905
|
+
return r === void 0 ? Ie(t, n) : r;
|
|
1906
|
+
}, Re = (e, t, n) => {
|
|
1907
|
+
for (let r in t) r !== "__proto__" && r !== "constructor" && (Object.prototype.hasOwnProperty.call(e, r) ? F(e[r]) || e[r] instanceof String || F(t[r]) || t[r] instanceof String ? n && (e[r] = t[r]) : Re(e[r], t[r], n) : e[r] = t[r]);
|
|
1908
1908
|
return e;
|
|
1909
|
-
},
|
|
1909
|
+
}, R = (e) => e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), ze = {
|
|
1910
1910
|
"&": "&",
|
|
1911
1911
|
"<": "<",
|
|
1912
1912
|
">": ">",
|
|
1913
1913
|
"\"": """,
|
|
1914
1914
|
"'": "'",
|
|
1915
1915
|
"/": "/"
|
|
1916
|
-
},
|
|
1916
|
+
}, Be = (e) => F(e) ? e.replace(/[&<>"'\/]/g, (e) => ze[e]) : e, Ve = class {
|
|
1917
1917
|
constructor(e) {
|
|
1918
1918
|
this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
1919
1919
|
}
|
|
@@ -1923,23 +1923,23 @@ var M = {
|
|
|
1923
1923
|
let n = new RegExp(e);
|
|
1924
1924
|
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, n), this.regExpQueue.push(e), n;
|
|
1925
1925
|
}
|
|
1926
|
-
},
|
|
1926
|
+
}, He = [
|
|
1927
1927
|
" ",
|
|
1928
1928
|
",",
|
|
1929
1929
|
"?",
|
|
1930
1930
|
"!",
|
|
1931
1931
|
";"
|
|
1932
|
-
],
|
|
1932
|
+
], Ue = new Ve(20), We = (e, t, n) => {
|
|
1933
1933
|
t ||= "", n ||= "";
|
|
1934
|
-
let r =
|
|
1934
|
+
let r = He.filter((e) => !t.includes(e) && !n.includes(e));
|
|
1935
1935
|
if (r.length === 0) return !0;
|
|
1936
|
-
let i =
|
|
1936
|
+
let i = Ue.getRegExp(`(${r.map((e) => e === "?" ? "\\?" : e).join("|")})`), a = !i.test(e);
|
|
1937
1937
|
if (!a) {
|
|
1938
1938
|
let t = e.indexOf(n);
|
|
1939
1939
|
t > 0 && !i.test(e.substring(0, t)) && (a = !0);
|
|
1940
1940
|
}
|
|
1941
1941
|
return a;
|
|
1942
|
-
},
|
|
1942
|
+
}, Ge = (e, t, n = ".") => {
|
|
1943
1943
|
if (!e) return;
|
|
1944
1944
|
if (e[t]) return Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
|
|
1945
1945
|
let r = t.split(n), i = e;
|
|
@@ -1958,7 +1958,7 @@ var M = {
|
|
|
1958
1958
|
i = t;
|
|
1959
1959
|
}
|
|
1960
1960
|
return i;
|
|
1961
|
-
},
|
|
1961
|
+
}, z = (e) => e?.replace(/_/g, "-"), Ke = {
|
|
1962
1962
|
type: "logger",
|
|
1963
1963
|
log(e) {
|
|
1964
1964
|
this.output("log", e);
|
|
@@ -1972,12 +1972,12 @@ var M = {
|
|
|
1972
1972
|
output(e, t) {
|
|
1973
1973
|
console?.[e]?.apply?.(console, t);
|
|
1974
1974
|
}
|
|
1975
|
-
},
|
|
1975
|
+
}, B = new class e {
|
|
1976
1976
|
constructor(e, t = {}) {
|
|
1977
1977
|
this.init(e, t);
|
|
1978
1978
|
}
|
|
1979
1979
|
init(e, t = {}) {
|
|
1980
|
-
this.prefix = t.prefix || "i18next:", this.logger = e ||
|
|
1980
|
+
this.prefix = t.prefix || "i18next:", this.logger = e || Ke, this.options = t, this.debug = t.debug;
|
|
1981
1981
|
}
|
|
1982
1982
|
log(...e) {
|
|
1983
1983
|
return this.forward(e, "log", "", !0);
|
|
@@ -1992,7 +1992,7 @@ var M = {
|
|
|
1992
1992
|
return this.forward(e, "warn", "WARNING DEPRECATED: ", !0);
|
|
1993
1993
|
}
|
|
1994
1994
|
forward(e, t, n, r) {
|
|
1995
|
-
return r && !this.debug ? null : (e = e.map((e) =>
|
|
1995
|
+
return r && !this.debug ? null : (e = e.map((e) => F(e) ? e.replace(/[\r\n\x00-\x1F\x7F]/g, " ") : e), F(e[0]) && (e[0] = `${n}${this.prefix} ${e[0]}`), this.logger[t](e));
|
|
1996
1996
|
}
|
|
1997
1997
|
create(t) {
|
|
1998
1998
|
return new e(this.logger, {
|
|
@@ -2003,7 +2003,7 @@ var M = {
|
|
|
2003
2003
|
clone(t) {
|
|
2004
2004
|
return t ||= this.options, t.prefix = t.prefix || this.prefix, new e(this.logger, t);
|
|
2005
2005
|
}
|
|
2006
|
-
}(),
|
|
2006
|
+
}(), qe = class {
|
|
2007
2007
|
constructor() {
|
|
2008
2008
|
this.observers = {};
|
|
2009
2009
|
}
|
|
@@ -2036,7 +2036,7 @@ var M = {
|
|
|
2036
2036
|
for (let i = 0; i < r; i++) n(e, ...t);
|
|
2037
2037
|
});
|
|
2038
2038
|
}
|
|
2039
|
-
},
|
|
2039
|
+
}, Je = class extends qe {
|
|
2040
2040
|
constructor(e, t = {
|
|
2041
2041
|
ns: ["translation"],
|
|
2042
2042
|
defaultNS: "translation"
|
|
@@ -2052,16 +2052,16 @@ var M = {
|
|
|
2052
2052
|
}
|
|
2053
2053
|
getResource(e, t, n, r = {}) {
|
|
2054
2054
|
let i = r.keySeparator === void 0 ? this.options.keySeparator : r.keySeparator, a = r.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : r.ignoreJSONStructure, o;
|
|
2055
|
-
e.includes(".") ? o = e.split(".") : (o = [e, t], n && (Array.isArray(n) ? o.push(...n) :
|
|
2056
|
-
let s =
|
|
2057
|
-
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) : F(n) && i ? o.push(...n.split(i)) : o.push(n)));
|
|
2056
|
+
let s = Ie(this.data, o);
|
|
2057
|
+
return !s && !t && !n && e.includes(".") && (e = o[0], t = o[1], n = o.slice(2).join(".")), s || !a || !F(n) ? s : Ge(this.data?.[e]?.[t], n, i);
|
|
2058
2058
|
}
|
|
2059
2059
|
addResource(e, t, n, r, i = { silent: !1 }) {
|
|
2060
2060
|
let a = i.keySeparator === void 0 ? this.options.keySeparator : i.keySeparator, o = [e, t];
|
|
2061
|
-
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), Pe(this.data, o, r), i.silent || this.emit("added", e, t, n, r);
|
|
2062
2062
|
}
|
|
2063
2063
|
addResources(e, t, n, r = { silent: !1 }) {
|
|
2064
|
-
for (let r in n) (
|
|
2064
|
+
for (let r in n) (F(n[r]) || Array.isArray(n[r])) && this.addResource(e, t, r, n[r], { silent: !0 });
|
|
2065
2065
|
r.silent || this.emit("added", e, t, n);
|
|
2066
2066
|
}
|
|
2067
2067
|
addResourceBundle(e, t, n, r, i, a = {
|
|
@@ -2070,11 +2070,11 @@ var M = {
|
|
|
2070
2070
|
}) {
|
|
2071
2071
|
let o = [e, t];
|
|
2072
2072
|
e.includes(".") && (o = e.split("."), r = n, n = t, t = o[1]), this.addNamespaces(t);
|
|
2073
|
-
let s =
|
|
2074
|
-
a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ?
|
|
2073
|
+
let s = Ie(this.data, o) || {};
|
|
2074
|
+
a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ? Re(s, n, i) : s = {
|
|
2075
2075
|
...s,
|
|
2076
2076
|
...n
|
|
2077
|
-
},
|
|
2077
|
+
}, Pe(this.data, o, s), a.silent || this.emit("added", e, t, n);
|
|
2078
2078
|
}
|
|
2079
2079
|
removeResourceBundle(e, t) {
|
|
2080
2080
|
this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
|
|
@@ -2095,7 +2095,7 @@ var M = {
|
|
|
2095
2095
|
toJSON() {
|
|
2096
2096
|
return this.data;
|
|
2097
2097
|
}
|
|
2098
|
-
},
|
|
2098
|
+
}, Ye = {
|
|
2099
2099
|
processors: {},
|
|
2100
2100
|
addPostProcessor(e) {
|
|
2101
2101
|
this.processors[e.name] = e;
|
|
@@ -2105,22 +2105,22 @@ var M = {
|
|
|
2105
2105
|
t = this.processors[e]?.process(t, n, r, i) ?? t;
|
|
2106
2106
|
}), t;
|
|
2107
2107
|
}
|
|
2108
|
-
},
|
|
2109
|
-
function
|
|
2108
|
+
}, Xe = Symbol("i18next/PATH_KEY");
|
|
2109
|
+
function Ze() {
|
|
2110
2110
|
let e = [], t = Object.create(null), n;
|
|
2111
|
-
return t.get = (r, i) => (n?.revoke?.(), i ===
|
|
2111
|
+
return t.get = (r, i) => (n?.revoke?.(), i === Xe ? e : (e.push(i), n = Proxy.revocable(r, t), n.proxy)), Proxy.revocable(Object.create(null), t).proxy;
|
|
2112
2112
|
}
|
|
2113
|
-
function
|
|
2114
|
-
let { [
|
|
2113
|
+
function V(e, t) {
|
|
2114
|
+
let { [Xe]: n } = e(Ze()), r = t?.keySeparator ?? ".", i = t?.nsSeparator ?? ":", a = t?.enableSelector === "strict";
|
|
2115
2115
|
if (n.length > 1 && i) {
|
|
2116
2116
|
let e = t?.ns, o = a ? Array.isArray(e) ? e : e ? [e] : null : Array.isArray(e) ? e : null;
|
|
2117
2117
|
if (o && (a ? o : o.length > 1 ? o.slice(1) : []).includes(n[0])) return `${n[0]}${i}${n.slice(1).join(r)}`;
|
|
2118
2118
|
}
|
|
2119
2119
|
return n.join(r);
|
|
2120
2120
|
}
|
|
2121
|
-
var
|
|
2121
|
+
var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = class e extends qe {
|
|
2122
2122
|
constructor(e, t = {}) {
|
|
2123
|
-
super(),
|
|
2123
|
+
super(), Ae([
|
|
2124
2124
|
"resourceStore",
|
|
2125
2125
|
"languageUtils",
|
|
2126
2126
|
"pluralResolver",
|
|
@@ -2128,7 +2128,7 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2128
2128
|
"backendConnector",
|
|
2129
2129
|
"i18nFormat",
|
|
2130
2130
|
"utils"
|
|
2131
|
-
], 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 = B.create("translator"), this.checkedLoadedFor = {};
|
|
2132
2132
|
}
|
|
2133
2133
|
changeLanguage(e) {
|
|
2134
2134
|
e && (this.language = e);
|
|
@@ -2138,34 +2138,34 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2138
2138
|
if (e == null) return !1;
|
|
2139
2139
|
let r = this.resolve(e, n);
|
|
2140
2140
|
if (r?.res === void 0) return !1;
|
|
2141
|
-
let i =
|
|
2141
|
+
let i = Qe(r.res);
|
|
2142
2142
|
return !(n.returnObjects === !1 && i);
|
|
2143
2143
|
}
|
|
2144
2144
|
extractFromKey(e, t) {
|
|
2145
2145
|
let n = t.nsSeparator === void 0 ? this.options.nsSeparator : t.nsSeparator;
|
|
2146
2146
|
n === void 0 && (n = ":");
|
|
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 && !
|
|
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 && !We(e, n, r);
|
|
2148
2148
|
if (a && !o) {
|
|
2149
2149
|
let t = e.match(this.interpolator.nestingRegexp);
|
|
2150
2150
|
if (t && t.length > 0) return {
|
|
2151
2151
|
key: e,
|
|
2152
|
-
namespaces:
|
|
2152
|
+
namespaces: F(i) ? [i] : i
|
|
2153
2153
|
};
|
|
2154
2154
|
let a = e.split(n);
|
|
2155
2155
|
(n !== r || n === r && this.options.ns.includes(a[0])) && (i = a.shift()), e = a.join(r);
|
|
2156
2156
|
}
|
|
2157
2157
|
return {
|
|
2158
2158
|
key: e,
|
|
2159
|
-
namespaces:
|
|
2159
|
+
namespaces: F(i) ? [i] : i
|
|
2160
2160
|
};
|
|
2161
2161
|
}
|
|
2162
2162
|
translate(t, n, r) {
|
|
2163
2163
|
let i = typeof n == "object" ? { ...n } : n;
|
|
2164
2164
|
if (typeof i != "object" && this.options.overloadTranslationOptionHandler && (i = this.options.overloadTranslationOptionHandler(arguments)), typeof i == "object" && (i = { ...i }), i ||= {}, t == null) return "";
|
|
2165
|
-
typeof t == "function" && (t =
|
|
2165
|
+
typeof t == "function" && (t = V(t, {
|
|
2166
2166
|
...this.options,
|
|
2167
2167
|
...i
|
|
2168
|
-
})), 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" ? V(e, {
|
|
2169
2169
|
...this.options,
|
|
2170
2170
|
...i
|
|
2171
2171
|
}) : String(e));
|
|
@@ -2191,10 +2191,10 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2191
2191
|
"[object Number]",
|
|
2192
2192
|
"[object Function]",
|
|
2193
2193
|
"[object RegExp]"
|
|
2194
|
-
], 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 && !F(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;
|
|
2195
2195
|
y && !m && x && (E = T);
|
|
2196
|
-
let
|
|
2197
|
-
if (y && E &&
|
|
2196
|
+
let ee = Qe(E), te = Object.prototype.toString.apply(E);
|
|
2197
|
+
if (y && E && ee && !_.includes(te) && !(F(v) && Array.isArray(E))) {
|
|
2198
2198
|
if (!i.returnObjects && !this.options.returnObjects) {
|
|
2199
2199
|
this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
|
|
2200
2200
|
let e = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(h, E, {
|
|
@@ -2209,7 +2209,7 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2209
2209
|
let r = `${n}${o}${e}`;
|
|
2210
2210
|
t[e] = x && !m ? this.translate(r, {
|
|
2211
2211
|
...i,
|
|
2212
|
-
defaultValue:
|
|
2212
|
+
defaultValue: Qe(T) ? T[e] : void 0,
|
|
2213
2213
|
joinArrays: !1,
|
|
2214
2214
|
ns: c
|
|
2215
2215
|
}) : this.translate(r, {
|
|
@@ -2220,7 +2220,7 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2220
2220
|
}
|
|
2221
2221
|
m = t;
|
|
2222
2222
|
}
|
|
2223
|
-
} else if (y &&
|
|
2223
|
+
} else if (y && F(v) && Array.isArray(m)) m = m.join(v), m &&= this.extendTranslation(m, t, i, r);
|
|
2224
2224
|
else {
|
|
2225
2225
|
let e = !1, n = !1;
|
|
2226
2226
|
!this.isValidLookup(m) && x && (e = !0, m = T), this.isValidLookup(m) || (n = !0, m = s);
|
|
@@ -2264,12 +2264,12 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2264
2264
|
...n.interpolation
|
|
2265
2265
|
}
|
|
2266
2266
|
});
|
|
2267
|
-
let a =
|
|
2267
|
+
let a = F(e) && (n?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : n.interpolation.skipOnVariables), o;
|
|
2268
2268
|
if (a) {
|
|
2269
2269
|
let t = e.match(this.interpolator.nestingRegexp);
|
|
2270
2270
|
o = t && t.length;
|
|
2271
2271
|
}
|
|
2272
|
-
let s = n.replace && !
|
|
2272
|
+
let s = n.replace && !F(n.replace) ? n.replace : n;
|
|
2273
2273
|
if (this.options.interpolation.defaultVariables && (s = {
|
|
2274
2274
|
...this.options.interpolation.defaultVariables,
|
|
2275
2275
|
...s
|
|
@@ -2279,8 +2279,8 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2279
2279
|
}
|
|
2280
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();
|
|
2281
2281
|
}
|
|
2282
|
-
let a = n.postProcess || this.options.postProcess, o =
|
|
2283
|
-
return e != null && o?.length && n.applyPostProcessor !== !1 && (e =
|
|
2282
|
+
let a = n.postProcess || this.options.postProcess, o = F(a) ? [a] : a;
|
|
2283
|
+
return e != null && o?.length && n.applyPostProcessor !== !1 && (e = Ye.handle(o, e, t, this.options && this.options.postProcessPassResolved ? {
|
|
2284
2284
|
i18nResolved: {
|
|
2285
2285
|
...r,
|
|
2286
2286
|
usedParams: this.getUsedParamsDetails(n)
|
|
@@ -2290,7 +2290,7 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2290
2290
|
}
|
|
2291
2291
|
resolve(e, t = {}) {
|
|
2292
2292
|
let n, r, i, a, o;
|
|
2293
|
-
return
|
|
2293
|
+
return F(e) && (e = [e]), Array.isArray(e) && (e = e.map((e) => typeof e == "function" ? V(e, {
|
|
2294
2294
|
...this.options,
|
|
2295
2295
|
...t
|
|
2296
2296
|
}) : e)), e.forEach((e) => {
|
|
@@ -2299,7 +2299,7 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2299
2299
|
r = c;
|
|
2300
2300
|
let l = s.namespaces;
|
|
2301
2301
|
this.options.fallbackNS && (l = l.concat(this.options.fallbackNS));
|
|
2302
|
-
let u = t.count !== void 0 && !
|
|
2302
|
+
let u = t.count !== void 0 && !F(t.count), d = u && !t.ordinal && t.count === 0, f = t.context !== void 0 && (F(t.context) || typeof t.context == "number") && t.context !== "", p = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
|
|
2303
2303
|
l.forEach((e) => {
|
|
2304
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) => {
|
|
2305
2305
|
if (this.isValidLookup(n)) return;
|
|
@@ -2350,7 +2350,7 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2350
2350
|
"joinArrays",
|
|
2351
2351
|
"postProcess",
|
|
2352
2352
|
"interpolation"
|
|
2353
|
-
], n = e.replace && !
|
|
2353
|
+
], n = e.replace && !F(e.replace), r = n ? e.replace : e;
|
|
2354
2354
|
if (n && e.count !== void 0 && (r = {
|
|
2355
2355
|
...r,
|
|
2356
2356
|
count: e.count
|
|
@@ -2367,25 +2367,25 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2367
2367
|
for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t) && t.startsWith("defaultValue") && e[t] !== void 0) return !0;
|
|
2368
2368
|
return !1;
|
|
2369
2369
|
}
|
|
2370
|
-
},
|
|
2370
|
+
}, et = class {
|
|
2371
2371
|
constructor(e) {
|
|
2372
|
-
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger =
|
|
2372
|
+
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = B.create("languageUtils"), this.resolveHierarchyCache = {};
|
|
2373
2373
|
}
|
|
2374
2374
|
clearCache() {
|
|
2375
2375
|
this.resolveHierarchyCache = {};
|
|
2376
2376
|
}
|
|
2377
2377
|
getScriptPartFromCode(e) {
|
|
2378
|
-
if (e =
|
|
2378
|
+
if (e = z(e), !e || !e.includes("-")) return null;
|
|
2379
2379
|
let t = e.split("-");
|
|
2380
2380
|
return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
|
|
2381
2381
|
}
|
|
2382
2382
|
getLanguagePartFromCode(e) {
|
|
2383
|
-
if (e =
|
|
2383
|
+
if (e = z(e), !e || !e.includes("-")) return e;
|
|
2384
2384
|
let t = e.split("-");
|
|
2385
2385
|
return this.formatLanguageCode(t[0]);
|
|
2386
2386
|
}
|
|
2387
2387
|
formatLanguageCode(e) {
|
|
2388
|
-
if (
|
|
2388
|
+
if (F(e) && e.includes("-")) {
|
|
2389
2389
|
let t;
|
|
2390
2390
|
try {
|
|
2391
2391
|
t = Intl.getCanonicalLocales(e)[0];
|
|
@@ -2415,7 +2415,7 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2415
2415
|
}
|
|
2416
2416
|
getFallbackCodes(e, t) {
|
|
2417
2417
|
if (!e) return [];
|
|
2418
|
-
if (typeof e == "function" && (e = e(t)),
|
|
2418
|
+
if (typeof e == "function" && (e = e(t)), F(e) && (e = [e]), Array.isArray(e)) return e;
|
|
2419
2419
|
if (!t) return e.default || [];
|
|
2420
2420
|
let n = e[t];
|
|
2421
2421
|
return n ||= e[this.getScriptPartFromCode(t)], n ||= e[this.formatLanguageCode(t)], n ||= e[this.getLanguagePartFromCode(t)], n ||= e.default, n || [];
|
|
@@ -2423,7 +2423,7 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2423
2423
|
toResolveHierarchy(e, t) {
|
|
2424
2424
|
let n = this.options.fallbackLng, r = Array.isArray(n) ? n.join("|") : n;
|
|
2425
2425
|
r !== this._cachedFallbackLng && (this.resolveHierarchyCache = {}, this._cachedFallbackLng = r);
|
|
2426
|
-
let i = t === void 0 || t === !1 ||
|
|
2426
|
+
let i = t === void 0 || t === !1 || F(t), a = t === void 0 && typeof this.options.fallbackLng == "function", o = F(e) && i && !a, s = null;
|
|
2427
2427
|
if (o) {
|
|
2428
2428
|
let n;
|
|
2429
2429
|
n = t === void 0 ? "undefined" : t === !1 ? "boolean:false" : `string:${t}`, s = `${e.length}:${e}|${n}`;
|
|
@@ -2435,29 +2435,29 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2435
2435
|
let c = this.getFallbackCodes((t === !1 ? [] : t) || this.options.fallbackLng || [], e), l = [], u = (e) => {
|
|
2436
2436
|
e && (this.isSupportedCode(e) ? l.push(e) : this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`));
|
|
2437
2437
|
};
|
|
2438
|
-
return
|
|
2438
|
+
return F(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))) : F(e) && u(this.formatLanguageCode(e)), c.forEach((e) => {
|
|
2439
2439
|
l.includes(e) || u(this.formatLanguageCode(e));
|
|
2440
2440
|
}), s === null ? l : (this.resolveHierarchyCache[s] = l, l.slice());
|
|
2441
2441
|
}
|
|
2442
|
-
},
|
|
2442
|
+
}, tt = {
|
|
2443
2443
|
zero: 0,
|
|
2444
2444
|
one: 1,
|
|
2445
2445
|
two: 2,
|
|
2446
2446
|
few: 3,
|
|
2447
2447
|
many: 4,
|
|
2448
2448
|
other: 5
|
|
2449
|
-
},
|
|
2449
|
+
}, nt = {
|
|
2450
2450
|
select: (e) => e === 1 ? "one" : "other",
|
|
2451
2451
|
resolvedOptions: () => ({ pluralCategories: ["one", "other"] })
|
|
2452
|
-
},
|
|
2452
|
+
}, rt = class {
|
|
2453
2453
|
constructor(e, t = {}) {
|
|
2454
|
-
this.languageUtils = e, this.options = t, this.logger =
|
|
2454
|
+
this.languageUtils = e, this.options = t, this.logger = B.create("pluralResolver"), this.pluralRulesCache = {};
|
|
2455
2455
|
}
|
|
2456
2456
|
clearCache() {
|
|
2457
2457
|
this.pluralRulesCache = {};
|
|
2458
2458
|
}
|
|
2459
2459
|
getRule(e, t = {}) {
|
|
2460
|
-
let n =
|
|
2460
|
+
let n = z(e === "dev" ? "en" : e), r = t.ordinal ? "ordinal" : "cardinal", i = JSON.stringify({
|
|
2461
2461
|
cleanedCode: n,
|
|
2462
2462
|
type: r
|
|
2463
2463
|
});
|
|
@@ -2466,8 +2466,8 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2466
2466
|
try {
|
|
2467
2467
|
a = new Intl.PluralRules(n, { type: r });
|
|
2468
2468
|
} catch {
|
|
2469
|
-
if (typeof Intl > "u") return this.logger.error("No Intl support, please use an Intl polyfill!"),
|
|
2470
|
-
if (!e.match(/-|_/)) return
|
|
2469
|
+
if (typeof Intl > "u") return this.logger.error("No Intl support, please use an Intl polyfill!"), nt;
|
|
2470
|
+
if (!e.match(/-|_/)) return nt;
|
|
2471
2471
|
let n = this.languageUtils.getLanguagePartFromCode(e);
|
|
2472
2472
|
a = this.getRule(n, t);
|
|
2473
2473
|
}
|
|
@@ -2482,23 +2482,23 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2482
2482
|
}
|
|
2483
2483
|
getSuffixes(e, t = {}) {
|
|
2484
2484
|
let n = this.getRule(e, t);
|
|
2485
|
-
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) => tt[e] - tt[t]).map((e) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${e}`) : [];
|
|
2486
2486
|
}
|
|
2487
2487
|
getSuffix(e, t, n = {}) {
|
|
2488
2488
|
let r = this.getRule(e, n);
|
|
2489
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));
|
|
2490
2490
|
}
|
|
2491
|
-
},
|
|
2492
|
-
let a =
|
|
2493
|
-
return !a && i &&
|
|
2494
|
-
},
|
|
2491
|
+
}, it = (e, t, n, r = ".", i = !0) => {
|
|
2492
|
+
let a = Le(e, t, n);
|
|
2493
|
+
return !a && i && F(n) && (a = Ge(e, n, r), a === void 0 && (a = Ge(t, n, r))), a;
|
|
2494
|
+
}, at = (e) => e.replace(/\$/g, "$$$$"), ot = class {
|
|
2495
2495
|
constructor(e = {}) {
|
|
2496
|
-
this.logger =
|
|
2496
|
+
this.logger = B.create("interpolator"), this.options = e, this.format = e?.interpolation?.format || ((e) => e), this.init(e);
|
|
2497
2497
|
}
|
|
2498
2498
|
init(e = {}) {
|
|
2499
2499
|
e.interpolation ||= { escapeValue: !0 };
|
|
2500
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;
|
|
2501
|
-
this.escape = t === void 0 ?
|
|
2501
|
+
this.escape = t === void 0 ? Be : t, this.escapeValue = n === void 0 || n, this.useRawValueToEscape = r !== void 0 && r, this.prefix = i ? R(i) : a || "{{", this.suffix = o ? R(o) : s || "}}", this.formatSeparator = c || ",", this.unescapePrefix = l ? "" : u ? R(u) : "-", this.unescapeSuffix = this.unescapePrefix ? "" : l ? R(l) : "", this.nestingPrefix = d ? R(d) : f || R("$t("), this.nestingSuffix = p ? R(p) : m || R(")"), this.nestingOptionsSeparator = h || ",", this.maxReplaces = g || 1e3, this.alwaysFormat = _ !== void 0 && _, this.resetRegExp();
|
|
2502
2502
|
}
|
|
2503
2503
|
reset() {
|
|
2504
2504
|
this.options && this.init(this.options);
|
|
@@ -2510,7 +2510,7 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2510
2510
|
interpolate(e, t, n, r) {
|
|
2511
2511
|
let i, a, o, s = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, c = (e) => {
|
|
2512
2512
|
if (!e.includes(this.formatSeparator)) {
|
|
2513
|
-
let i =
|
|
2513
|
+
let i = it(t, s, e, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
2514
2514
|
return this.alwaysFormat ? this.format(i, void 0, n, {
|
|
2515
2515
|
...r,
|
|
2516
2516
|
...t,
|
|
@@ -2518,7 +2518,7 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2518
2518
|
}) : i;
|
|
2519
2519
|
}
|
|
2520
2520
|
let i = e.split(this.formatSeparator), a = i.shift().trim(), o = i.join(this.formatSeparator).trim();
|
|
2521
|
-
return this.format(
|
|
2521
|
+
return this.format(it(t, s, a, this.options.keySeparator, this.options.ignoreJSONStructure), o, n, {
|
|
2522
2522
|
...r,
|
|
2523
2523
|
...t,
|
|
2524
2524
|
interpolationkey: a
|
|
@@ -2538,15 +2538,15 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2538
2538
|
if (a = c(n), a === void 0) {
|
|
2539
2539
|
if (typeof l == "function") {
|
|
2540
2540
|
let t = l(e, i, r);
|
|
2541
|
-
a =
|
|
2541
|
+
a = F(t) ? t : "";
|
|
2542
2542
|
} else if (r && Object.prototype.hasOwnProperty.call(r, n)) a = "";
|
|
2543
2543
|
else if (u) {
|
|
2544
2544
|
a = i[0];
|
|
2545
2545
|
continue;
|
|
2546
2546
|
} else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`), a = "";
|
|
2547
|
-
} else !
|
|
2547
|
+
} else !F(a) && !this.useRawValueToEscape && (a = ke(a));
|
|
2548
2548
|
let s = t.safeValue(a);
|
|
2549
|
-
if (e = e.replace(i[0],
|
|
2549
|
+
if (e = e.replace(i[0], at(s)), u ? (t.regex.lastIndex += s.length, t.regex.lastIndex -= i[0].length) : t.regex.lastIndex = 0, o++, o >= this.maxReplaces) break;
|
|
2550
2550
|
}
|
|
2551
2551
|
}), e;
|
|
2552
2552
|
}
|
|
@@ -2554,7 +2554,7 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2554
2554
|
let r, i, a, o = (e, t) => {
|
|
2555
2555
|
let n = this.nestingOptionsSeparator;
|
|
2556
2556
|
if (!e.includes(n)) return e;
|
|
2557
|
-
let r = e.split(RegExp(`${
|
|
2557
|
+
let r = e.split(RegExp(`${R(n)}[ ]*{`)), i = `{${r[1]}`;
|
|
2558
2558
|
e = r[0], i = this.interpolate(i, a);
|
|
2559
2559
|
let o = i.match(/'/g), s = i.match(/"/g);
|
|
2560
2560
|
((o?.length ?? 0) % 2 == 0 && !s || (s?.length ?? 0) % 2 != 0) && (i = i.replace(/'/g, "\""));
|
|
@@ -2570,17 +2570,17 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2570
2570
|
};
|
|
2571
2571
|
for (; r = this.nestingRegexp.exec(e);) {
|
|
2572
2572
|
let s = [];
|
|
2573
|
-
a = { ...n }, a = a.replace && !
|
|
2573
|
+
a = { ...n }, a = a.replace && !F(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
|
|
2574
2574
|
let c = /{.*}/s.test(r[1]) ? r[1].lastIndexOf("}") + 1 : r[1].indexOf(this.formatSeparator);
|
|
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 && !
|
|
2576
|
-
|
|
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 && !F(i)) return i;
|
|
2576
|
+
F(i) || (i = ke(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, {
|
|
2577
2577
|
...n,
|
|
2578
2578
|
interpolationkey: r[1].trim()
|
|
2579
|
-
}), i.trim())), e = e.replace(r[0],
|
|
2579
|
+
}), i.trim())), e = e.replace(r[0], at(ke(i))), this.regexp.lastIndex = 0;
|
|
2580
2580
|
}
|
|
2581
2581
|
return e;
|
|
2582
2582
|
}
|
|
2583
|
-
},
|
|
2583
|
+
}, st = (e) => {
|
|
2584
2584
|
let t = e.toLowerCase().trim(), n = {};
|
|
2585
2585
|
if (e.includes("(")) {
|
|
2586
2586
|
let r = e.split("(");
|
|
@@ -2597,7 +2597,7 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2597
2597
|
formatName: t,
|
|
2598
2598
|
formatOptions: n
|
|
2599
2599
|
};
|
|
2600
|
-
},
|
|
2600
|
+
}, ct = (e) => {
|
|
2601
2601
|
let t = {};
|
|
2602
2602
|
return (n, r, i) => {
|
|
2603
2603
|
let a = i;
|
|
@@ -2606,15 +2606,15 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2606
2606
|
[i.interpolationkey]: void 0
|
|
2607
2607
|
});
|
|
2608
2608
|
let o = r + JSON.stringify(a), s = t[o];
|
|
2609
|
-
return s || (s = e(
|
|
2609
|
+
return s || (s = e(z(r), i), t[o] = s), s(n);
|
|
2610
2610
|
};
|
|
2611
|
-
},
|
|
2611
|
+
}, lt = (e) => (t, n, r) => e(z(n), r)(t), ut = class {
|
|
2612
2612
|
constructor(e = {}) {
|
|
2613
|
-
this.logger =
|
|
2613
|
+
this.logger = B.create("formatter"), this.options = e, this.init(e);
|
|
2614
2614
|
}
|
|
2615
2615
|
init(e, t = { interpolation: {} }) {
|
|
2616
2616
|
this.formatSeparator = t.interpolation.formatSeparator || ",";
|
|
2617
|
-
let n = t.cacheInBuiltFormats ?
|
|
2617
|
+
let n = t.cacheInBuiltFormats ? ct : lt;
|
|
2618
2618
|
this.formats = {
|
|
2619
2619
|
number: n((e, t) => {
|
|
2620
2620
|
let n = new Intl.NumberFormat(e, { ...t });
|
|
@@ -2645,7 +2645,7 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2645
2645
|
this.formats[e.toLowerCase().trim()] = t;
|
|
2646
2646
|
}
|
|
2647
2647
|
addCached(e, t) {
|
|
2648
|
-
this.formats[e.toLowerCase().trim()] =
|
|
2648
|
+
this.formats[e.toLowerCase().trim()] = ct(t);
|
|
2649
2649
|
}
|
|
2650
2650
|
format(e, t, n, r = {}) {
|
|
2651
2651
|
if (!t || e == null) return e;
|
|
@@ -2656,7 +2656,7 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2656
2656
|
a.push(t);
|
|
2657
2657
|
}
|
|
2658
2658
|
return a.reduce((e, t) => {
|
|
2659
|
-
let { formatName: i, formatOptions: a } =
|
|
2659
|
+
let { formatName: i, formatOptions: a } = st(t);
|
|
2660
2660
|
if (this.formats[i]) {
|
|
2661
2661
|
let t = e;
|
|
2662
2662
|
try {
|
|
@@ -2674,11 +2674,11 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2674
2674
|
return this.logger.warn(`there was no format function for ${i}`), e;
|
|
2675
2675
|
}, e);
|
|
2676
2676
|
}
|
|
2677
|
-
},
|
|
2677
|
+
}, dt = (e, t) => {
|
|
2678
2678
|
e.pending[t] !== void 0 && (delete e.pending[t], e.pendingCount--);
|
|
2679
|
-
},
|
|
2679
|
+
}, ft = class extends qe {
|
|
2680
2680
|
constructor(e, t, n, r = {}) {
|
|
2681
|
-
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 = B.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);
|
|
2682
2682
|
}
|
|
2683
2683
|
queueLoad(e, t, n, r) {
|
|
2684
2684
|
let i = {}, a = {}, o = {}, s = {};
|
|
@@ -2706,7 +2706,7 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2706
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);
|
|
2707
2707
|
let o = {};
|
|
2708
2708
|
this.queue.forEach((n) => {
|
|
2709
|
-
|
|
2709
|
+
Fe(n.loaded, [i], a), dt(n, e), t && n.errors.push(t), n.pendingCount === 0 && !n.done && (Object.keys(n.loaded).forEach((e) => {
|
|
2710
2710
|
o[e] || (o[e] = {});
|
|
2711
2711
|
let t = n.loaded[e];
|
|
2712
2712
|
t.length && t.forEach((t) => {
|
|
@@ -2755,7 +2755,7 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2755
2755
|
}
|
|
2756
2756
|
prepareLoading(e, t, n = {}, r) {
|
|
2757
2757
|
if (!this.backend) return this.logger.warn("No backend was added via i18next.use. Will not load resources."), r && r();
|
|
2758
|
-
|
|
2758
|
+
F(e) && (e = this.languageUtils.toResolveHierarchy(e)), F(t) && (t = [t]);
|
|
2759
2759
|
let i = this.queueLoad(e, t, n, r);
|
|
2760
2760
|
if (!i.toLoad.length) return i.pending.length || r(), null;
|
|
2761
2761
|
i.toLoad.forEach((e) => {
|
|
@@ -2796,7 +2796,7 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2796
2796
|
e && e[0] && this.store.addResource(e[0], t, n, r);
|
|
2797
2797
|
}
|
|
2798
2798
|
}
|
|
2799
|
-
},
|
|
2799
|
+
}, pt = () => ({
|
|
2800
2800
|
debug: !1,
|
|
2801
2801
|
initAsync: !0,
|
|
2802
2802
|
ns: ["translation"],
|
|
@@ -2831,7 +2831,7 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2831
2831
|
appendNamespaceToCIMode: !1,
|
|
2832
2832
|
overloadTranslationOptionHandler: (e) => {
|
|
2833
2833
|
let t = {};
|
|
2834
|
-
if (typeof e[1] == "object" && (t = e[1]),
|
|
2834
|
+
if (typeof e[1] == "object" && (t = e[1]), F(e[1]) && (t.defaultValue = e[1]), F(e[2]) && (t.tDescription = e[2]), typeof e[2] == "object" || typeof e[3] == "object") {
|
|
2835
2835
|
let n = e[3] || e[2];
|
|
2836
2836
|
Object.keys(n).forEach((e) => {
|
|
2837
2837
|
t[e] = n[e];
|
|
@@ -2852,13 +2852,13 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2852
2852
|
skipOnVariables: !0
|
|
2853
2853
|
},
|
|
2854
2854
|
cacheInBuiltFormats: !0
|
|
2855
|
-
}),
|
|
2855
|
+
}), mt = (e) => (F(e.ns) && (e.ns = [e.ns]), F(e.fallbackLng) && (e.fallbackLng = [e.fallbackLng]), F(e.fallbackNS) && (e.fallbackNS = [e.fallbackNS]), e.supportedLngs && !e.supportedLngs.includes("cimode") && (e.supportedLngs = e.supportedLngs.concat(["cimode"])), e), ht = () => {}, gt = (e) => {
|
|
2856
2856
|
Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((t) => {
|
|
2857
2857
|
typeof e[t] == "function" && (e[t] = e[t].bind(e));
|
|
2858
2858
|
});
|
|
2859
|
-
},
|
|
2859
|
+
}, H = class e extends qe {
|
|
2860
2860
|
constructor(e = {}, t) {
|
|
2861
|
-
if (super(), this.options =
|
|
2861
|
+
if (super(), this.options = mt(e), this.services = {}, this.logger = B, this.modules = { external: [] }, gt(this), t && !this.isInitialized && !e.isClone) {
|
|
2862
2862
|
if (!this.options.initAsync) return this.init(e, t), this;
|
|
2863
2863
|
setTimeout(() => {
|
|
2864
2864
|
this.init(e, t);
|
|
@@ -2866,33 +2866,33 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2866
2866
|
}
|
|
2867
2867
|
}
|
|
2868
2868
|
init(e = {}, t) {
|
|
2869
|
-
this.isInitializing = !0, typeof e == "function" && (t = e, e = {}), e.defaultNS == null && e.ns && (
|
|
2870
|
-
let n =
|
|
2869
|
+
this.isInitializing = !0, typeof e == "function" && (t = e, e = {}), e.defaultNS == null && e.ns && (F(e.ns) ? e.defaultNS = e.ns : e.ns.includes("translation") || (e.defaultNS = e.ns[0]));
|
|
2870
|
+
let n = pt();
|
|
2871
2871
|
this.options = {
|
|
2872
2872
|
...n,
|
|
2873
2873
|
...this.options,
|
|
2874
|
-
...
|
|
2874
|
+
...mt(e)
|
|
2875
2875
|
}, this.options.interpolation = {
|
|
2876
2876
|
...n.interpolation,
|
|
2877
2877
|
...this.options.interpolation
|
|
2878
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);
|
|
2879
2879
|
let r = (e) => e ? typeof e == "function" ? new e() : e : null;
|
|
2880
2880
|
if (!this.options.isClone) {
|
|
2881
|
-
this.modules.logger ?
|
|
2881
|
+
this.modules.logger ? B.init(r(this.modules.logger), this.options) : B.init(null, this.options);
|
|
2882
2882
|
let e;
|
|
2883
|
-
e = this.modules.formatter ? this.modules.formatter :
|
|
2884
|
-
let t = new
|
|
2885
|
-
this.store = new
|
|
2883
|
+
e = this.modules.formatter ? this.modules.formatter : ut;
|
|
2884
|
+
let t = new et(this.options);
|
|
2885
|
+
this.store = new Je(this.options.resources, this.options);
|
|
2886
2886
|
let n = this.services;
|
|
2887
|
-
n.logger =
|
|
2887
|
+
n.logger = B, n.resourceStore = this.store, n.languageUtils = t, n.pluralResolver = new rt(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 ot(this.options), n.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, n.backendConnector = new ft(r(this.modules.backend), n.resourceStore, n, this.options), n.backendConnector.on("*", (e, ...t) => {
|
|
2888
2888
|
this.emit(e, ...t);
|
|
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
|
|
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 $e(this.services, this.options), this.translator.on("*", (e, ...t) => {
|
|
2890
2890
|
this.emit(e, ...t);
|
|
2891
2891
|
}), this.modules.external.forEach((e) => {
|
|
2892
2892
|
e.init && e.init(this);
|
|
2893
2893
|
});
|
|
2894
2894
|
}
|
|
2895
|
-
if (this.format = this.options.interpolation.format, t ||=
|
|
2895
|
+
if (this.format = this.options.interpolation.format, t ||= ht, this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
|
2896
2896
|
let e = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
2897
2897
|
e.length > 0 && e[0] !== "dev" && (this.options.lng = e[0]);
|
|
2898
2898
|
}
|
|
@@ -2911,7 +2911,7 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2911
2911
|
].forEach((e) => {
|
|
2912
2912
|
this[e] = (...t) => (this.store[e](...t), this);
|
|
2913
2913
|
});
|
|
2914
|
-
let i =
|
|
2914
|
+
let i = I(), a = () => {
|
|
2915
2915
|
let e = (e, n) => {
|
|
2916
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);
|
|
2917
2917
|
};
|
|
@@ -2920,8 +2920,8 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2920
2920
|
};
|
|
2921
2921
|
return this.options.resources || !this.options.initAsync ? a() : setTimeout(a, 0), i;
|
|
2922
2922
|
}
|
|
2923
|
-
loadResources(e, t =
|
|
2924
|
-
let n = t, r =
|
|
2923
|
+
loadResources(e, t = ht) {
|
|
2924
|
+
let n = t, r = F(e) ? e : this.language;
|
|
2925
2925
|
if (typeof e == "function" && (n = e), !this.options.resources || this.options.partialBundledLanguages) {
|
|
2926
2926
|
if (r?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return n();
|
|
2927
2927
|
let e = [], t = (t) => {
|
|
@@ -2935,15 +2935,15 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2935
2935
|
} else n(null);
|
|
2936
2936
|
}
|
|
2937
2937
|
reloadResources(e, t, n) {
|
|
2938
|
-
let r =
|
|
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 ||=
|
|
2938
|
+
let r = I();
|
|
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 ||= ht, this.services.backendConnector.reload(e, t, (e) => {
|
|
2940
2940
|
r.resolve(), n(e);
|
|
2941
2941
|
}), r;
|
|
2942
2942
|
}
|
|
2943
2943
|
use(e) {
|
|
2944
2944
|
if (!e) throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
|
|
2945
2945
|
if (!e.type) throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
|
|
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" &&
|
|
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" && Ye.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
|
|
2947
2947
|
}
|
|
2948
2948
|
setResolvedLanguage(e) {
|
|
2949
2949
|
if (e && this.languages && !["cimode", "dev"].includes(e)) {
|
|
@@ -2959,7 +2959,7 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2959
2959
|
}
|
|
2960
2960
|
changeLanguage(e, t) {
|
|
2961
2961
|
this.isLanguageChangingTo = e;
|
|
2962
|
-
let n =
|
|
2962
|
+
let n = I();
|
|
2963
2963
|
this.emit("languageChanging", e);
|
|
2964
2964
|
let r = (e) => {
|
|
2965
2965
|
this.language = e, this.languages = this.services.languageUtils.toResolveHierarchy(e), this.resolvedLanguage = void 0, this.setResolvedLanguage(e);
|
|
@@ -2967,7 +2967,7 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2967
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));
|
|
2968
2968
|
}, a = (t) => {
|
|
2969
2969
|
!e && !t && this.services.languageDetector && (t = []);
|
|
2970
|
-
let n =
|
|
2970
|
+
let n = F(t) ? t : t && t[0], a = this.store.hasLanguageSomeTranslations(n) ? n : this.services.languageUtils.getBestMatchFromCodes(F(t) ? [t] : t);
|
|
2971
2971
|
a && (this.language || r(a), this.translator.language || this.translator.changeLanguage(a), this.services.languageDetector?.cacheUserLanguage?.(a)), this.loadResources(a, (e) => {
|
|
2972
2972
|
i(e, a);
|
|
2973
2973
|
});
|
|
@@ -2984,11 +2984,11 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
2984
2984
|
...this.options,
|
|
2985
2985
|
...o
|
|
2986
2986
|
};
|
|
2987
|
-
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 = V(o.keyPrefix, c));
|
|
2988
2988
|
let l = this.options.keySeparator || ".", u;
|
|
2989
|
-
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 = V(e, c)), `${o.keyPrefix}${l}${e}`)) : (typeof e == "function" && (e = V(e, c)), u = o.keyPrefix ? `${o.keyPrefix}${l}${e}` : e), this.t(u, o);
|
|
2990
2990
|
};
|
|
2991
|
-
return
|
|
2991
|
+
return F(e) ? a.lng = e : a.lngs = e, a.ns = t, a.keyPrefix = n, a;
|
|
2992
2992
|
}
|
|
2993
2993
|
t(...e) {
|
|
2994
2994
|
return this.translator?.translate(...e);
|
|
@@ -3015,16 +3015,16 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
3015
3015
|
return !!(this.hasResourceBundle(n, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(n, e) && (!r || a(i, e)));
|
|
3016
3016
|
}
|
|
3017
3017
|
loadNamespaces(e, t) {
|
|
3018
|
-
let n =
|
|
3019
|
-
return this.options.ns ? (
|
|
3018
|
+
let n = I();
|
|
3019
|
+
return this.options.ns ? (F(e) && (e = [e]), e.forEach((e) => {
|
|
3020
3020
|
this.options.ns.includes(e) || this.options.ns.push(e);
|
|
3021
3021
|
}), this.loadResources((e) => {
|
|
3022
3022
|
n.resolve(), t && t(e);
|
|
3023
3023
|
}), n) : (t && t(), Promise.resolve());
|
|
3024
3024
|
}
|
|
3025
3025
|
loadLanguages(e, t) {
|
|
3026
|
-
let n =
|
|
3027
|
-
|
|
3026
|
+
let n = I();
|
|
3027
|
+
F(e) && (e = [e]);
|
|
3028
3028
|
let r = this.options.preload || [], i = e.filter((e) => !r.includes(e) && this.services.languageUtils.isSupportedCode(e));
|
|
3029
3029
|
return i.length ? (this.options.preload = r.concat(i), this.loadResources((e) => {
|
|
3030
3030
|
n.resolve(), t && t(e);
|
|
@@ -3039,14 +3039,14 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
3039
3039
|
if (e && e.direction) return e.direction;
|
|
3040
3040
|
}
|
|
3041
3041
|
} catch {}
|
|
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
|
|
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 et(pt());
|
|
3043
3043
|
return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.includes(n.getLanguagePartFromCode(e)) || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
|
|
3044
3044
|
}
|
|
3045
3045
|
static createInstance(t = {}, n) {
|
|
3046
3046
|
let r = new e(t, n);
|
|
3047
3047
|
return r.createInstance = e.createInstance, r;
|
|
3048
3048
|
}
|
|
3049
|
-
cloneInstance(t = {}, n =
|
|
3049
|
+
cloneInstance(t = {}, n = ht) {
|
|
3050
3050
|
let r = t.forkResourceStore;
|
|
3051
3051
|
r && delete t.forkResourceStore;
|
|
3052
3052
|
let i = {
|
|
@@ -3060,18 +3060,18 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
3060
3060
|
"language"
|
|
3061
3061
|
].forEach((e) => {
|
|
3062
3062
|
a[e] = this[e];
|
|
3063
|
-
}), 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 Je(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) {
|
|
3064
3064
|
let e = {
|
|
3065
|
-
...
|
|
3065
|
+
...pt().interpolation,
|
|
3066
3066
|
...this.options.interpolation,
|
|
3067
3067
|
...t.interpolation
|
|
3068
3068
|
}, n = {
|
|
3069
3069
|
...i,
|
|
3070
3070
|
interpolation: e
|
|
3071
3071
|
};
|
|
3072
|
-
a.services.interpolator = new
|
|
3072
|
+
a.services.interpolator = new ot(n);
|
|
3073
3073
|
}
|
|
3074
|
-
return a.translator = new
|
|
3074
|
+
return a.translator = new $e(a.services, i), a.translator.on("*", (e, ...t) => {
|
|
3075
3075
|
a.emit(e, ...t);
|
|
3076
3076
|
}), a.init(i, n), a.translator.options = i, a.translator.backendConnector.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, a;
|
|
3077
3077
|
}
|
|
@@ -3085,10 +3085,10 @@ var Xe = (e) => !I(e) && typeof e != "boolean" && typeof e != "number", Ze = cla
|
|
|
3085
3085
|
};
|
|
3086
3086
|
}
|
|
3087
3087
|
}.createInstance();
|
|
3088
|
-
|
|
3088
|
+
H.createInstance, H.dir, H.init, H.loadResources, H.reloadResources, H.use, H.changeLanguage, H.getFixedT, H.t, H.exists, H.setDefaultNamespace, H.hasLoadedNamespace, H.loadNamespaces, H.loadLanguages;
|
|
3089
3089
|
//#endregion
|
|
3090
3090
|
//#region node_modules/.pnpm/react-i18next@17.0.13_i18ne_77b937ecedfb676debf3096b5685165d/node_modules/react-i18next/dist/es/unescape.js
|
|
3091
|
-
var
|
|
3091
|
+
var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, vt = {
|
|
3092
3092
|
"&": "&",
|
|
3093
3093
|
"&": "&",
|
|
3094
3094
|
"<": "<",
|
|
@@ -3109,7 +3109,7 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3109
3109
|
"…": "…",
|
|
3110
3110
|
"/": "/",
|
|
3111
3111
|
"/": "/"
|
|
3112
|
-
},
|
|
3112
|
+
}, yt = (e) => vt[e], bt = (e) => e.replace(_t, yt), xt = {
|
|
3113
3113
|
bindI18n: "languageChanged",
|
|
3114
3114
|
bindI18nStore: "",
|
|
3115
3115
|
transEmptyNodeValue: "",
|
|
@@ -3122,21 +3122,21 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3122
3122
|
"p"
|
|
3123
3123
|
],
|
|
3124
3124
|
useSuspense: !0,
|
|
3125
|
-
unescape:
|
|
3125
|
+
unescape: bt,
|
|
3126
3126
|
transDefaultProps: void 0
|
|
3127
|
-
},
|
|
3128
|
-
|
|
3129
|
-
...
|
|
3127
|
+
}, St = (e = {}) => {
|
|
3128
|
+
xt = {
|
|
3129
|
+
...xt,
|
|
3130
3130
|
...e
|
|
3131
3131
|
};
|
|
3132
|
-
},
|
|
3133
|
-
|
|
3134
|
-
},
|
|
3132
|
+
}, Ct = () => xt, wt, Tt = (e) => {
|
|
3133
|
+
wt = e;
|
|
3134
|
+
}, Et = () => wt, Dt = {
|
|
3135
3135
|
type: "3rdParty",
|
|
3136
3136
|
init(e) {
|
|
3137
|
-
|
|
3137
|
+
St(e.options.react), Tt(e);
|
|
3138
3138
|
}
|
|
3139
|
-
},
|
|
3139
|
+
}, Ot = /* @__PURE__ */ s(((e, t) => {
|
|
3140
3140
|
(function(n, r) {
|
|
3141
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();
|
|
3142
3142
|
})(e, (function() {
|
|
@@ -3410,8 +3410,8 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3410
3410
|
}, _.toString = function() {
|
|
3411
3411
|
return this.$d.toUTCString();
|
|
3412
3412
|
}, g;
|
|
3413
|
-
}(),
|
|
3414
|
-
return w.prototype =
|
|
3413
|
+
}(), ee = E.prototype;
|
|
3414
|
+
return w.prototype = ee, [
|
|
3415
3415
|
["$ms", r],
|
|
3416
3416
|
["$s", i],
|
|
3417
3417
|
["$m", a],
|
|
@@ -3421,7 +3421,7 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3421
3421
|
["$y", d],
|
|
3422
3422
|
["$D", f]
|
|
3423
3423
|
].forEach((function(e) {
|
|
3424
|
-
|
|
3424
|
+
ee[e[1]] = function(t) {
|
|
3425
3425
|
return this.$g(t, e[0], e[1]);
|
|
3426
3426
|
};
|
|
3427
3427
|
})), w.extend = function(e, t) {
|
|
@@ -3430,19 +3430,19 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3430
3430
|
return w(1e3 * e);
|
|
3431
3431
|
}, w.en = b[y], w.Ls = b, w.p = {}, w;
|
|
3432
3432
|
}));
|
|
3433
|
-
})),
|
|
3433
|
+
})), kt = /* @__PURE__ */ u(Ot(), 1), At = (e = Date.now(), t = "YYYY-MM-DD HH:mm:ss") => (0, kt.default)(e).format(t), jt = (e) => Object.prototype.toString.call(e).slice(8, -1).toLowerCase(), Mt = (e, t) => jt(e).includes(t), Nt = (e = {}, t = {}) => {
|
|
3434
3434
|
for (let n of Object.keys(t)) {
|
|
3435
3435
|
let r = t[n];
|
|
3436
|
-
|
|
3436
|
+
Mt(r, "object") ? (e[n] || (e[n] = {}), Nt(e[n], r)) : e[n] = r;
|
|
3437
3437
|
}
|
|
3438
3438
|
return e;
|
|
3439
|
-
},
|
|
3439
|
+
}, Pt = (e, t, n) => {
|
|
3440
3440
|
for (let r of t) Reflect.defineProperty(e, r, {
|
|
3441
3441
|
value: e[r],
|
|
3442
3442
|
...n
|
|
3443
3443
|
});
|
|
3444
3444
|
return e;
|
|
3445
|
-
},
|
|
3445
|
+
}, Ft = { ui: {
|
|
3446
3446
|
tool: {
|
|
3447
3447
|
add: "添加",
|
|
3448
3448
|
cancel: "取消",
|
|
@@ -3476,7 +3476,9 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3476
3476
|
measure: "测量",
|
|
3477
3477
|
return: "返回",
|
|
3478
3478
|
prev: "上一张",
|
|
3479
|
-
next: "下一张"
|
|
3479
|
+
next: "下一张",
|
|
3480
|
+
time: "时间",
|
|
3481
|
+
content: "内容"
|
|
3480
3482
|
},
|
|
3481
3483
|
use: {
|
|
3482
3484
|
contextErr: "useAppContext 必须在 {{key}} provider 内使用",
|
|
@@ -3501,7 +3503,8 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3501
3503
|
exe: {
|
|
3502
3504
|
initErr: "exe 或 cv 未定义",
|
|
3503
3505
|
canvasErr: "画布渲染失败",
|
|
3504
|
-
imgSpriteErr: "图片渲染失败"
|
|
3506
|
+
imgSpriteErr: "图片渲染失败",
|
|
3507
|
+
disposeErr: "数据处理错误"
|
|
3505
3508
|
},
|
|
3506
3509
|
sql: {
|
|
3507
3510
|
initErr: "数据库未初始化",
|
|
@@ -3550,10 +3553,20 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3550
3553
|
measureCircle: "圆直径",
|
|
3551
3554
|
distance: "像素距离:{{px}}px\n实际距离:{{um}}um",
|
|
3552
3555
|
spacing: "像素间距:{{px}}px\n实际间距:{{um}}um",
|
|
3553
|
-
diameter: "像素直径:{{px}}px\n实际直径:{{um}}um"
|
|
3556
|
+
diameter: "像素直径:{{px}}px\n实际直径:{{um}}um",
|
|
3557
|
+
setSystem: "系统配置修改 key: {{key}}, 旧值: {{oldValue}}, 新值: {{value}}",
|
|
3558
|
+
setProject: "方案配置修改 key: {{key}}, 旧值: {{oldValue}}, 新值: {{value}}",
|
|
3559
|
+
setDefect: "缺陷配置修改, 旧值: {{oldValue}}, 新值: {{value}}",
|
|
3560
|
+
setAutoRun: "自动运行配置修改, 旧值: {{oldValue}}, 新值: {{value}}",
|
|
3561
|
+
setRunStatis: "运行统计清空, 旧值: {{oldValue}}",
|
|
3562
|
+
message: "消息日志",
|
|
3563
|
+
operate: "操作日志",
|
|
3564
|
+
dataEmpty: "数据分发结果为空: {{data}}",
|
|
3565
|
+
dataErr: "数据分发结构异常: {{data}}",
|
|
3566
|
+
deleteHistory: "删除历史记录: id={{id}}"
|
|
3554
3567
|
},
|
|
3555
3568
|
config: {
|
|
3556
|
-
|
|
3569
|
+
logSaveTime: "日志保存时间",
|
|
3557
3570
|
recordSaveTime: "历史记录保存时间",
|
|
3558
3571
|
ngImageSaveTime: "NG图片保存时间",
|
|
3559
3572
|
maxNgImageQuantity: "NG图片最大数量",
|
|
@@ -3563,7 +3576,7 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3563
3576
|
dayNg: "当日NG",
|
|
3564
3577
|
clearTime: "清空时间"
|
|
3565
3578
|
}
|
|
3566
|
-
} },
|
|
3579
|
+
} }, It = { ui: {
|
|
3567
3580
|
tool: {
|
|
3568
3581
|
add: "Add",
|
|
3569
3582
|
cancel: "Cancel",
|
|
@@ -3597,7 +3610,9 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3597
3610
|
measure: "Measure",
|
|
3598
3611
|
return: "Return",
|
|
3599
3612
|
prev: "Prev",
|
|
3600
|
-
next: "Next"
|
|
3613
|
+
next: "Next",
|
|
3614
|
+
time: "Time",
|
|
3615
|
+
content: "Content"
|
|
3601
3616
|
},
|
|
3602
3617
|
use: {
|
|
3603
3618
|
contextErr: "useAppContext must be used within a {{key}} provider",
|
|
@@ -3622,7 +3637,8 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3622
3637
|
exe: {
|
|
3623
3638
|
initErr: "exe or cv is not defined",
|
|
3624
3639
|
canvasErr: "Canvas rendering failed",
|
|
3625
|
-
imgSpriteErr: "Image rendering failed"
|
|
3640
|
+
imgSpriteErr: "Image rendering failed",
|
|
3641
|
+
disposeErr: "DATA DISPOSE ERROR"
|
|
3626
3642
|
},
|
|
3627
3643
|
sql: {
|
|
3628
3644
|
initErr: "Database is not initialized",
|
|
@@ -3671,10 +3687,20 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3671
3687
|
measureCircle: "C-diameter",
|
|
3672
3688
|
distance: "P-distance:{{px}}px\nA-distance:{{um}}um",
|
|
3673
3689
|
spacing: "P-spacing:{{px}}px\nA-spacing:{{um}}um",
|
|
3674
|
-
diameter: "P-diameter:{{px}}px\nA-diameter:{{um}}um"
|
|
3690
|
+
diameter: "P-diameter:{{px}}px\nA-diameter:{{um}}um",
|
|
3691
|
+
setSystem: "System config modified key: {{key}}, old value: {{oldValue}}, new value: {{value}}",
|
|
3692
|
+
setProject: "Project config modified key: {{key}}, old value: {{oldValue}}, new value: {{value}}",
|
|
3693
|
+
setDefect: "Defect config modified, old value: {{oldValue}}, new value: {{value}}",
|
|
3694
|
+
setAutoRun: "Auto-run config modified, old value: {{oldValue}}, new value: {{value}}",
|
|
3695
|
+
setRunStatis: "Run statistics cleared, old value: {{oldValue}}",
|
|
3696
|
+
message: "Message log",
|
|
3697
|
+
operate: "Operate log",
|
|
3698
|
+
dataEmpty: "Data transmission result is empty: {{data}}",
|
|
3699
|
+
dataErr: "Data transmission structure is abnormal: {{data}}",
|
|
3700
|
+
deleteHistory: "Delete history record: id={{id}}"
|
|
3675
3701
|
},
|
|
3676
3702
|
config: {
|
|
3677
|
-
|
|
3703
|
+
logSaveTime: "Log save time",
|
|
3678
3704
|
recordSaveTime: "History data save time",
|
|
3679
3705
|
ngImageSaveTime: "NG image save time",
|
|
3680
3706
|
maxNgImageQuantity: "Maximum number of NG images",
|
|
@@ -3684,22 +3710,22 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3684
3710
|
dayNg: "Daily NG",
|
|
3685
3711
|
clearTime: "Clear time"
|
|
3686
3712
|
}
|
|
3687
|
-
} },
|
|
3688
|
-
let n = [], r =
|
|
3689
|
-
zh:
|
|
3690
|
-
en:
|
|
3713
|
+
} }, Lt = (e, t) => {
|
|
3714
|
+
let n = [], r = Nt(e, {
|
|
3715
|
+
zh: Ft,
|
|
3716
|
+
en: It
|
|
3691
3717
|
}), i = Object.keys(r), a = i.reduce((e, t) => {
|
|
3692
3718
|
let i = r[t];
|
|
3693
3719
|
return e[t] = { translation: i }, i?.ui || n.push(t), e;
|
|
3694
3720
|
}, {});
|
|
3695
|
-
return
|
|
3721
|
+
return H.use(Dt).init({
|
|
3696
3722
|
lng: t,
|
|
3697
3723
|
resources: a,
|
|
3698
3724
|
interpolation: { escapeValue: !1 }
|
|
3699
3725
|
}), n.length ? [] : i;
|
|
3700
|
-
},
|
|
3701
|
-
return n === "toString" || typeof n == "symbol" ? void 0 :
|
|
3702
|
-
} }),
|
|
3726
|
+
}, Rt = (e = "") => new Proxy((t) => H.t(e, t), { get(t, n) {
|
|
3727
|
+
return n === "toString" || typeof n == "symbol" ? void 0 : Rt(e ? `${e}.${n}` : n);
|
|
3728
|
+
} }), U = Rt("ui"), zt = class {
|
|
3703
3729
|
#e = {};
|
|
3704
3730
|
#t = new EventTarget();
|
|
3705
3731
|
emit = (e, t) => (this.#t.dispatchEvent(new CustomEvent(e, { detail: t })), this);
|
|
@@ -3722,17 +3748,18 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3722
3748
|
}
|
|
3723
3749
|
return this;
|
|
3724
3750
|
};
|
|
3725
|
-
},
|
|
3751
|
+
}, Bt = [
|
|
3726
3752
|
"systemError",
|
|
3727
3753
|
"messageUpdated",
|
|
3728
3754
|
"defectUpdated",
|
|
3729
3755
|
"systemMode",
|
|
3730
|
-
"historyUpdated"
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3756
|
+
"historyUpdated",
|
|
3757
|
+
"recordUpdated"
|
|
3758
|
+
], W = {}, Vt = (e = []) => {
|
|
3759
|
+
let t = [...Bt, ...e];
|
|
3760
|
+
for (let e of t) W[e] = e.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
3761
|
+
return t.length === Bt.length + e.length;
|
|
3762
|
+
}, { emit: G, emitSync: Ht, on: Ut, off: Wt, once: Gt, clear: Kt } = new zt(), qt = {
|
|
3736
3763
|
0: {
|
|
3737
3764
|
editing: !0,
|
|
3738
3765
|
visible: !0,
|
|
@@ -3748,7 +3775,7 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3748
3775
|
visible: !1,
|
|
3749
3776
|
operate: !1
|
|
3750
3777
|
}
|
|
3751
|
-
},
|
|
3778
|
+
}, Jt = Pt({
|
|
3752
3779
|
dayOk: {
|
|
3753
3780
|
type: "text",
|
|
3754
3781
|
value: 0
|
|
@@ -3759,7 +3786,7 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3759
3786
|
},
|
|
3760
3787
|
date: {
|
|
3761
3788
|
type: "text",
|
|
3762
|
-
value:
|
|
3789
|
+
value: (0, kt.default)().subtract(1, "day").format("YYYY-MM-DD"),
|
|
3763
3790
|
visible: !1
|
|
3764
3791
|
},
|
|
3765
3792
|
clearTime: {
|
|
@@ -3768,23 +3795,27 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3768
3795
|
},
|
|
3769
3796
|
toProps: () => {
|
|
3770
3797
|
let e = {};
|
|
3771
|
-
for (let t in
|
|
3798
|
+
for (let t in Jt) e[t] = Jt[t].value;
|
|
3772
3799
|
return e;
|
|
3773
3800
|
}
|
|
3774
3801
|
}, ["toProps"], {
|
|
3775
3802
|
enumerable: !1,
|
|
3776
3803
|
writable: !1,
|
|
3777
3804
|
configurable: !1
|
|
3778
|
-
}),
|
|
3805
|
+
}), Yt = [
|
|
3779
3806
|
15,
|
|
3780
3807
|
25,
|
|
3781
3808
|
50,
|
|
3782
3809
|
100
|
|
3783
|
-
],
|
|
3810
|
+
], Xt = [
|
|
3784
3811
|
24,
|
|
3785
3812
|
240,
|
|
3786
3813
|
138
|
|
3787
|
-
],
|
|
3814
|
+
], Zt = "#808080", Qt = "app-config-set", $t = {
|
|
3815
|
+
INFO: 0,
|
|
3816
|
+
WARN: 1,
|
|
3817
|
+
ERROR: 2
|
|
3818
|
+
}, en = new class {
|
|
3788
3819
|
#e = !1;
|
|
3789
3820
|
#t = [];
|
|
3790
3821
|
#n = "";
|
|
@@ -3798,26 +3829,26 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3798
3829
|
return this.#e;
|
|
3799
3830
|
}
|
|
3800
3831
|
set work(e) {
|
|
3801
|
-
this.#e = e, this.#n = e ?
|
|
3832
|
+
this.#e = e, this.#n = e ? K.workDefectPath : K.globalDefectPath, this.read(this.#n, this.#e);
|
|
3802
3833
|
}
|
|
3803
3834
|
constructor() {
|
|
3804
3835
|
this.#t.splice(0, this.#t.length);
|
|
3805
3836
|
}
|
|
3806
3837
|
#r() {
|
|
3807
|
-
|
|
3838
|
+
G(W.defectUpdated);
|
|
3808
3839
|
}
|
|
3809
3840
|
setValue(e, t = null) {
|
|
3810
|
-
this.value = e, t?.(
|
|
3841
|
+
this.value = e, t?.(U.tool.setOk(), { key: Qt });
|
|
3811
3842
|
}
|
|
3812
3843
|
read(e, t = this.#e) {
|
|
3813
|
-
this.#n = e, this.#e = t,
|
|
3814
|
-
e ?
|
|
3844
|
+
this.#n = e, this.#e = t, Y.access(this.#n, Y.constants.F_OK, (e) => {
|
|
3845
|
+
e ? Cn(this.#n, this.#t) : Sn(this.#n, (e) => {
|
|
3815
3846
|
this.#t = e, this.#r();
|
|
3816
3847
|
});
|
|
3817
3848
|
});
|
|
3818
3849
|
}
|
|
3819
3850
|
write() {
|
|
3820
|
-
|
|
3851
|
+
Cn(this.#n, this.#t);
|
|
3821
3852
|
}
|
|
3822
3853
|
get(e) {
|
|
3823
3854
|
return this.#t.find((t) => t.type === e);
|
|
@@ -3862,7 +3893,7 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3862
3893
|
t && e[t.type]++;
|
|
3863
3894
|
}
|
|
3864
3895
|
}
|
|
3865
|
-
}(),
|
|
3896
|
+
}(), K = Pt({
|
|
3866
3897
|
workDir: "{workDir}",
|
|
3867
3898
|
rootDir: "{rootDir}",
|
|
3868
3899
|
dataDir: "{workDir}/Data",
|
|
@@ -3877,11 +3908,11 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3877
3908
|
enumerable: !1,
|
|
3878
3909
|
writable: !0,
|
|
3879
3910
|
configurable: !0
|
|
3880
|
-
}),
|
|
3911
|
+
}), tn = {
|
|
3881
3912
|
saveDir: "",
|
|
3882
|
-
mesSaveTime: 90,
|
|
3883
3913
|
recordSaveTime: 30,
|
|
3884
3914
|
ngImageSaveTime: 30,
|
|
3915
|
+
logSaveTime: 90,
|
|
3885
3916
|
maxNgImageQuantity: 500,
|
|
3886
3917
|
ngImgSuffix: "png",
|
|
3887
3918
|
ngImgRatio: 1,
|
|
@@ -3892,39 +3923,43 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3892
3923
|
DatabaseName: "aoi",
|
|
3893
3924
|
UserName: "root",
|
|
3894
3925
|
Password: "123456"
|
|
3895
|
-
},
|
|
3896
|
-
let e = JSON.stringify(
|
|
3897
|
-
return
|
|
3898
|
-
},
|
|
3899
|
-
let t = await
|
|
3900
|
-
return t &&
|
|
3901
|
-
},
|
|
3926
|
+
}, nn = () => {
|
|
3927
|
+
let e = JSON.stringify(q, void 0, 4);
|
|
3928
|
+
return Cn(K.settingPath, e), !0;
|
|
3929
|
+
}, rn = async (e = !0) => {
|
|
3930
|
+
let t = await Sn(K.settingPath, e);
|
|
3931
|
+
return t && an(t, !1), q.onChange?.(), !0;
|
|
3932
|
+
}, an = (e = {}, t = !0) => {
|
|
3902
3933
|
let n = !1, r = {};
|
|
3903
|
-
for (let t of Object.keys(
|
|
3904
|
-
Object.keys(r).length > 0 &&
|
|
3905
|
-
},
|
|
3906
|
-
|
|
3907
|
-
|
|
3934
|
+
for (let t of Object.keys(q)) e[t] === void 0 ? (e[t] = tn[t], n = !0) : (q[t] !== e[t] && (q[t] = e[t], n = !0), t.endsWith("Mode") && (r[t] = e[t]));
|
|
3935
|
+
Object.keys(r).length > 0 && G(W.systemMode, r), t && n && nn();
|
|
3936
|
+
}, on = async (e = !0) => {
|
|
3937
|
+
let { exe: t } = $;
|
|
3938
|
+
return sn.level = (await Sn(K.userPath, e))?.UserLevel ?? 0, sn.userName = t.getUserName(), sn.onChange?.(), !0;
|
|
3939
|
+
}, q = Pt({
|
|
3940
|
+
...tn,
|
|
3941
|
+
setConfig: an,
|
|
3908
3942
|
onChange: void 0
|
|
3909
3943
|
}, ["setConfig", "onChange"], {
|
|
3910
3944
|
enumerable: !1,
|
|
3911
3945
|
writable: !0,
|
|
3912
3946
|
configurable: !0
|
|
3913
|
-
}),
|
|
3947
|
+
}), sn = Pt({
|
|
3914
3948
|
level: 0,
|
|
3949
|
+
userName: null,
|
|
3915
3950
|
onChange: void 0
|
|
3916
3951
|
}, ["onChange"], {
|
|
3917
3952
|
enumerable: !1,
|
|
3918
3953
|
writable: !0,
|
|
3919
3954
|
configurable: !0
|
|
3920
|
-
}),
|
|
3955
|
+
}), cn = (e = {}) => {
|
|
3921
3956
|
let { exe: t } = $, n = t.getWorkDir(), r = t.getCurrentPath();
|
|
3922
|
-
|
|
3923
|
-
for (let e in
|
|
3924
|
-
|
|
3925
|
-
for (let e of ["dataDir", "ngImagesDir"])
|
|
3926
|
-
|
|
3927
|
-
},
|
|
3957
|
+
K.workDir = n, K.rootDir = r;
|
|
3958
|
+
for (let e in K) K[e] = K[e].replace(/\{(\w+)\}/g, (e, t) => K[t]);
|
|
3959
|
+
q.saveDir = K.dataDir, Object.assign(q, e), Gt(W.systemMode, ({ detail: e }) => en.work = !!e?.defectMode);
|
|
3960
|
+
for (let e of ["dataDir", "ngImagesDir"]) Y.mkdir(K[e], { recursive: !0 }, () => {});
|
|
3961
|
+
Y.existsSync(K.settingPath) ? rn(!1) : nn(), Y.existsSync(K.userPath) && on(!1), setTimeout(() => wn(K.settingPath, rn), 1e3), setTimeout(() => wn(K.userPath, on), 1e3);
|
|
3962
|
+
}, ln = () => K.workDir.replace(/\\/g, "/").match(/[^/]+$/)?.[0], J = new class {
|
|
3928
3963
|
maxLength = 100;
|
|
3929
3964
|
#e = [];
|
|
3930
3965
|
get value() {
|
|
@@ -3937,7 +3972,7 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3937
3972
|
this.#e.splice(0, this.#e.length);
|
|
3938
3973
|
}
|
|
3939
3974
|
#t() {
|
|
3940
|
-
|
|
3975
|
+
G(W.messageUpdated);
|
|
3941
3976
|
}
|
|
3942
3977
|
#n(e, t, n, r = {}) {
|
|
3943
3978
|
let i = Date.now();
|
|
@@ -3951,13 +3986,13 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3951
3986
|
}), this.#e.length > this.maxLength && this.#e.pop(), this.#t(), i;
|
|
3952
3987
|
}
|
|
3953
3988
|
error(e, t, n) {
|
|
3954
|
-
return this.#n("error", e, t ??
|
|
3989
|
+
return this.#n("error", e, t ?? U.tool.error(), n);
|
|
3955
3990
|
}
|
|
3956
3991
|
warning(e, t, n) {
|
|
3957
|
-
return this.#n("warning", e, t ??
|
|
3992
|
+
return this.#n("warning", e, t ?? U.tool.warning(), n);
|
|
3958
3993
|
}
|
|
3959
3994
|
info(e, t, n) {
|
|
3960
|
-
return this.#n("info", e, t ??
|
|
3995
|
+
return this.#n("info", e, t ?? U.tool.info(), n);
|
|
3961
3996
|
}
|
|
3962
3997
|
delete(e) {
|
|
3963
3998
|
let t = this.#e.findIndex((t) => t.id === e);
|
|
@@ -3974,42 +4009,42 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3974
4009
|
clear() {
|
|
3975
4010
|
this.#e.splice(0, this.#e.length), this.#t();
|
|
3976
4011
|
}
|
|
3977
|
-
}(),
|
|
4012
|
+
}(), Y = typeof __non_webpack_require__ == "function" ? __non_webpack_require__("fs") : typeof globalThis.require == "function" ? globalThis.require("fs") : null, un = (e, t = 1500) => {
|
|
3978
4013
|
let n = null;
|
|
3979
4014
|
return function(...r) {
|
|
3980
4015
|
n && clearTimeout(n), n = setTimeout(e.bind(this, ...r), t);
|
|
3981
4016
|
};
|
|
3982
|
-
},
|
|
4017
|
+
}, dn = (e, t = 1500) => {
|
|
3983
4018
|
let n = null;
|
|
3984
4019
|
return function(...r) {
|
|
3985
4020
|
n ||= setTimeout(() => {
|
|
3986
4021
|
e.call(this, ...r), n = null;
|
|
3987
4022
|
}, t);
|
|
3988
4023
|
};
|
|
3989
|
-
},
|
|
4024
|
+
}, fn = (e) => {
|
|
3990
4025
|
if (!e || typeof e != "object") return e;
|
|
3991
4026
|
let t = e.constructor();
|
|
3992
|
-
for (let n in e) Object.hasOwn(e, n) && (t[n] =
|
|
4027
|
+
for (let n in e) Object.hasOwn(e, n) && (t[n] = fn(e[n]));
|
|
3993
4028
|
return t;
|
|
3994
|
-
},
|
|
4029
|
+
}, pn = (e, t) => {
|
|
3995
4030
|
if (e === t) return !0;
|
|
3996
4031
|
if (typeof e != "object" || typeof t != "object" || e === null || t === null) return !1;
|
|
3997
4032
|
let n = Object.keys(e), r = Object.keys(t);
|
|
3998
4033
|
if (n.length !== r.length) return !1;
|
|
3999
|
-
for (let i of n) if (!r.includes(i) || !
|
|
4034
|
+
for (let i of n) if (!r.includes(i) || !pn(e[i], t[i])) return !1;
|
|
4000
4035
|
return !0;
|
|
4001
|
-
},
|
|
4036
|
+
}, mn = (e = "_") => `${Date.now()}${e}${Math.floor(Math.random() * 1e4)}`, hn = (e) => e == null ? !1 : typeof e == "string" || Array.isArray(e) ? e.length > 0 : typeof e != "object" || Object.keys(e).length > 0, gn = (e, t = {}) => {
|
|
4002
4037
|
try {
|
|
4003
|
-
let n =
|
|
4038
|
+
let n = O(e);
|
|
4004
4039
|
for (let e in t) n = n[e]?.(t[e]);
|
|
4005
4040
|
return n.hexa();
|
|
4006
4041
|
} catch {
|
|
4007
4042
|
return !1;
|
|
4008
4043
|
}
|
|
4009
|
-
},
|
|
4044
|
+
}, _n = (e) => {
|
|
4010
4045
|
let t = $.token?.[e];
|
|
4011
|
-
return
|
|
4012
|
-
},
|
|
4046
|
+
return hn(t) ? t : getComputedStyle(document.getElementById("root")).getPropertyValue(`--aoi-${e}`).trim();
|
|
4047
|
+
}, vn = (e = pe) => {
|
|
4013
4048
|
let t;
|
|
4014
4049
|
switch (e) {
|
|
4015
4050
|
case "small":
|
|
@@ -4021,26 +4056,26 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4021
4056
|
default: t = $.token.controlHeight ?? 32;
|
|
4022
4057
|
}
|
|
4023
4058
|
return Number.parseInt(t);
|
|
4024
|
-
},
|
|
4059
|
+
}, yn = (e, t = 2) => {
|
|
4025
4060
|
let n = Number(e);
|
|
4026
4061
|
return Number.isNaN(n) ? 0 : Number(n.toFixed(t));
|
|
4027
|
-
},
|
|
4062
|
+
}, bn = (e, t = {}, n = {}) => {
|
|
4028
4063
|
let r = e.constructor === String ? document.createElement(e) : e;
|
|
4029
|
-
for (let [e, n] of Object.entries(t)) n.constructor === Object ?
|
|
4064
|
+
for (let [e, n] of Object.entries(t)) n.constructor === Object ? bn(r[e], n) : e.startsWith("--") ? r.setProperty(e, n) : r[e] = n;
|
|
4030
4065
|
for (let [e, t] of Object.entries(n)) r.addEventListener(e, t);
|
|
4031
4066
|
return r;
|
|
4032
|
-
},
|
|
4067
|
+
}, xn = (e) => {
|
|
4033
4068
|
e?.stopPropagation(), e?.preventDefault(), e.cancelBubble = !0;
|
|
4034
|
-
},
|
|
4035
|
-
if (
|
|
4036
|
-
|
|
4069
|
+
}, Sn = (e, t = !1) => {
|
|
4070
|
+
if (Mt(t, "function")) {
|
|
4071
|
+
Y.readFile(e, "utf-8", (n, r) => {
|
|
4037
4072
|
if (n || !r) {
|
|
4038
4073
|
n && $.dev && console.error(n);
|
|
4039
4074
|
return;
|
|
4040
4075
|
}
|
|
4041
|
-
let i =
|
|
4076
|
+
let i = X(r);
|
|
4042
4077
|
if (!i) {
|
|
4043
|
-
|
|
4078
|
+
J.error(U.file.filePath({ path: e }), U.file.readErr());
|
|
4044
4079
|
return;
|
|
4045
4080
|
}
|
|
4046
4081
|
t(i);
|
|
@@ -4051,40 +4086,40 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4051
4086
|
try {
|
|
4052
4087
|
if (t) return new Promise((t, r) => {
|
|
4053
4088
|
n.readTextFileSync(e, (e, n) => {
|
|
4054
|
-
t(n ?
|
|
4089
|
+
t(n ? X(n) : null);
|
|
4055
4090
|
});
|
|
4056
4091
|
});
|
|
4057
4092
|
{
|
|
4058
4093
|
let t = n.readTextFileSync(e);
|
|
4059
|
-
return t ?
|
|
4094
|
+
return t ? X(t) : null;
|
|
4060
4095
|
}
|
|
4061
4096
|
} catch (t) {
|
|
4062
|
-
return
|
|
4097
|
+
return J.error(U.file.filePath({ path: e }), U.file.readErr()), $.dev && console.error(t), null;
|
|
4063
4098
|
}
|
|
4064
|
-
},
|
|
4065
|
-
|
|
4066
|
-
n?.(t), t && (
|
|
4099
|
+
}, Cn = (e, t, n) => {
|
|
4100
|
+
Y.writeFile(e, Tn(t), "utf-8", (t) => {
|
|
4101
|
+
n?.(t), t && (J.error(U.file.filePath({ path: e }), U.file.writeErr()), $.dev && console.error(t));
|
|
4067
4102
|
});
|
|
4068
|
-
},
|
|
4069
|
-
|
|
4103
|
+
}, wn = (e, t) => {
|
|
4104
|
+
Mt(t, "function") && Y.watch(e, (e) => {
|
|
4070
4105
|
e === "change" && (clearTimeout(t?.timer), t.timer = setTimeout(t, 1e3));
|
|
4071
4106
|
});
|
|
4072
|
-
},
|
|
4107
|
+
}, X = (e, t = null) => {
|
|
4073
4108
|
if (typeof e == "object") return e;
|
|
4074
4109
|
try {
|
|
4075
4110
|
return JSON.parse(e);
|
|
4076
4111
|
} catch {
|
|
4077
4112
|
return t;
|
|
4078
4113
|
}
|
|
4079
|
-
},
|
|
4114
|
+
}, Tn = (e, t = "") => {
|
|
4080
4115
|
if (typeof e == "string") return e;
|
|
4081
4116
|
try {
|
|
4082
4117
|
return JSON.stringify(e);
|
|
4083
4118
|
} catch {
|
|
4084
4119
|
return t;
|
|
4085
4120
|
}
|
|
4086
|
-
},
|
|
4087
|
-
let { x: n = 0, y: r = 0, w: i = 0, h: a = 0, fileName: o, prefixDir: s =
|
|
4121
|
+
}, En = (e, t = {}) => {
|
|
4122
|
+
let { x: n = 0, y: r = 0, w: i = 0, h: a = 0, fileName: o, prefixDir: s = K.ngImagesDir, ratio: c = q.ngImgRatio } = t;
|
|
4088
4123
|
if (!e || n <= 0 || r <= 0 || i <= 0 || a <= 0 || !o) return {
|
|
4089
4124
|
image: e,
|
|
4090
4125
|
x: n,
|
|
@@ -4101,9 +4136,9 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4101
4136
|
"jpeg",
|
|
4102
4137
|
"png",
|
|
4103
4138
|
"bmp"
|
|
4104
|
-
].includes(l) || (t += `.${
|
|
4139
|
+
].includes(l) || (t += `.${q.ngImgSuffix}`);
|
|
4105
4140
|
let u = t.substring(0, t.lastIndexOf("/"));
|
|
4106
|
-
|
|
4141
|
+
Y.existsSync(u) || Y.mkdirSync(u, { recursive: !0 });
|
|
4107
4142
|
let { cv: d } = $, f = d.cropSharedMemImage(e, n, r, n + i, r + a);
|
|
4108
4143
|
return !f || new Promise((e, n) => {
|
|
4109
4144
|
d.imwriteWithRatio(t, f, c, (t) => {
|
|
@@ -4113,8 +4148,8 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4113
4148
|
} catch (e) {
|
|
4114
4149
|
return $.dev && console.error(e), !0;
|
|
4115
4150
|
}
|
|
4116
|
-
},
|
|
4117
|
-
let { fileName: t, prefixDir: n =
|
|
4151
|
+
}, Dn = (e = {}) => {
|
|
4152
|
+
let { fileName: t, prefixDir: n = K.ngImagesDir } = e;
|
|
4118
4153
|
if (!t) return;
|
|
4119
4154
|
let r = `${n}/${t}`, i = r.split(".").pop().toLowerCase();
|
|
4120
4155
|
[
|
|
@@ -4122,27 +4157,46 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4122
4157
|
"jpeg",
|
|
4123
4158
|
"png",
|
|
4124
4159
|
"bmp"
|
|
4125
|
-
].includes(i) || (r += `.${
|
|
4160
|
+
].includes(i) || (r += `.${q.ngImgSuffix}`);
|
|
4126
4161
|
let { cv: a } = $;
|
|
4127
4162
|
return new Promise((e, t) => {
|
|
4128
4163
|
a.imread(r, (t, n) => {
|
|
4129
4164
|
t ? ($.dev && console.error("error read image: ", t), e(!1)) : e(n);
|
|
4130
4165
|
});
|
|
4131
4166
|
});
|
|
4132
|
-
},
|
|
4133
|
-
let { fileName: t, prefixDir: n =
|
|
4167
|
+
}, On = async (e = {}) => {
|
|
4168
|
+
let { fileName: t, prefixDir: n = K.ngImagesDir } = e;
|
|
4134
4169
|
if (!t) return;
|
|
4135
4170
|
let r = n ? `${n}/${t}` : t;
|
|
4136
|
-
if (!
|
|
4171
|
+
if (!Y.existsSync(r)) return;
|
|
4137
4172
|
let { exe: i } = $;
|
|
4138
4173
|
return await i.deletePath(r) === "delete successed";
|
|
4139
|
-
},
|
|
4140
|
-
let { cv: r } = $, i =
|
|
4174
|
+
}, kn = (e, t = "", n = []) => {
|
|
4175
|
+
let { cv: r } = $, i = K.dataDir;
|
|
4141
4176
|
return e ? r.getOpenFileName(t, `*${n.join(";*")}`, i) : r.getExistingDirectory(t, i);
|
|
4142
|
-
},
|
|
4177
|
+
}, An = (e, ...t) => e.replace(/\?/g, () => {
|
|
4143
4178
|
let e = t.shift();
|
|
4144
|
-
return e instanceof Object && (e =
|
|
4145
|
-
}).replace(/[\n\r\s]+/g, " "),
|
|
4179
|
+
return e instanceof Object && (e = Tn(e, void 0)), typeof e == "string" ? e.length ? `'${e}'` : "null" : e === void 0 ? "null" : e;
|
|
4180
|
+
}).replace(/[\n\r\s]+/g, " "), Z = "journal", Q = {
|
|
4181
|
+
tableName: Z,
|
|
4182
|
+
fields: {
|
|
4183
|
+
id: "BIGINT PRIMARY KEY",
|
|
4184
|
+
time: "VARCHAR (30) NOT NULL",
|
|
4185
|
+
user: "VARCHAR (30) NOT NULL",
|
|
4186
|
+
type: "VARCHAR (30) NOT NULL",
|
|
4187
|
+
class: "VARCHAR (30) NOT NULL",
|
|
4188
|
+
content: "LONGTEXT"
|
|
4189
|
+
},
|
|
4190
|
+
sqls: {
|
|
4191
|
+
insertSql: `INSERT INTO ${Z} (id, time, type, class, user, content) VALUES (?, ?, ?, ?, ?, ?)`,
|
|
4192
|
+
totalSql: `SELECT COUNT(*) AS total FROM ${Z}`,
|
|
4193
|
+
selectSql: `SELECT id, time, user, class, content FROM ${Z}`,
|
|
4194
|
+
fieldValues: `SELECT DISTINCT ? FROM ${Z}`,
|
|
4195
|
+
expirationSql: `DELETE FROM ${Z} WHERE id < ?`
|
|
4196
|
+
},
|
|
4197
|
+
operate: "operate",
|
|
4198
|
+
message: "message"
|
|
4199
|
+
}, jn = class {
|
|
4146
4200
|
#e = [];
|
|
4147
4201
|
#t = !1;
|
|
4148
4202
|
get sqls() {
|
|
@@ -4151,30 +4205,30 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4151
4205
|
get error() {
|
|
4152
4206
|
return this.#t;
|
|
4153
4207
|
}
|
|
4154
|
-
constructor(e) {
|
|
4208
|
+
constructor(e = []) {
|
|
4155
4209
|
let { exe: t } = $;
|
|
4156
|
-
this.#e = e
|
|
4210
|
+
this.#e = [...e, Q], this.#t = this.#e?.length <= 1 || this.#e.some((e) => t.verifyDatabase(e.tableName, Tn(e.fields)));
|
|
4157
4211
|
}
|
|
4158
4212
|
async #n({ tableName: e, sqlKey: t, typeErr: n, execFunc: r }, ...i) {
|
|
4159
4213
|
let a = this.getTable(e);
|
|
4160
4214
|
if (!a) return !1;
|
|
4161
|
-
let { exe: o } = $, s =
|
|
4215
|
+
let { exe: o } = $, s = An(a.sqls?.[t] ?? t, ...i);
|
|
4162
4216
|
try {
|
|
4163
4217
|
let e = await r(o, s);
|
|
4164
4218
|
if (e) return e;
|
|
4165
4219
|
throw Error();
|
|
4166
4220
|
} catch (e) {
|
|
4167
|
-
return
|
|
4221
|
+
return J.error(U.sql.execErr({ error: s }), n), $.dev && console.error(e), !1;
|
|
4168
4222
|
}
|
|
4169
4223
|
}
|
|
4170
4224
|
getTable(e) {
|
|
4171
|
-
return this.#e.find((t) => t.tableName === e) || (
|
|
4225
|
+
return this.#e.find((t) => t.tableName === e) || (J.error(U.sql.tableErr({ tableName: e }), U.sql.error()), !1);
|
|
4172
4226
|
}
|
|
4173
4227
|
update(e, t, ...n) {
|
|
4174
4228
|
return this.#n({
|
|
4175
4229
|
tableName: e,
|
|
4176
4230
|
sqlKey: t,
|
|
4177
|
-
typeErr:
|
|
4231
|
+
typeErr: U.sql.updateErr(),
|
|
4178
4232
|
execFunc: async (e, t) => await e.writeDataBase(t) === 0
|
|
4179
4233
|
}, ...n);
|
|
4180
4234
|
}
|
|
@@ -4182,10 +4236,10 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4182
4236
|
return this.#n({
|
|
4183
4237
|
tableName: e,
|
|
4184
4238
|
sqlKey: t,
|
|
4185
|
-
typeErr:
|
|
4239
|
+
typeErr: U.sql.selectErr(),
|
|
4186
4240
|
execFunc: async (e, t) => {
|
|
4187
4241
|
let n = await e.findDataBaseData(t);
|
|
4188
|
-
return n?.length ?
|
|
4242
|
+
return n?.length ? X(n, []) : [];
|
|
4189
4243
|
}
|
|
4190
4244
|
}, ...n);
|
|
4191
4245
|
}
|
|
@@ -4193,10 +4247,10 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4193
4247
|
return this.#n({
|
|
4194
4248
|
tableName: e,
|
|
4195
4249
|
sqlKey: t,
|
|
4196
|
-
typeErr:
|
|
4250
|
+
typeErr: U.sql.selectErr(),
|
|
4197
4251
|
execFunc: async (e, t) => {
|
|
4198
4252
|
let n = await e.findSingleDataBaseData(t);
|
|
4199
|
-
return n?.length ?
|
|
4253
|
+
return n?.length ? X(n) : null;
|
|
4200
4254
|
}
|
|
4201
4255
|
}, ...n);
|
|
4202
4256
|
}
|
|
@@ -4204,24 +4258,49 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4204
4258
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
4205
4259
|
for (let r of e) {
|
|
4206
4260
|
let e = this.#e.find((e) => e.tableName === r.name);
|
|
4207
|
-
e ? n.push(
|
|
4261
|
+
e ? n.push(An(e.sqls?.[r.key] ?? r.key, ...r?.params ?? [])) : t.add(r.name);
|
|
4208
4262
|
}
|
|
4209
4263
|
if (t.size) {
|
|
4210
4264
|
let e = Array.from(t).join(", ");
|
|
4211
|
-
return
|
|
4265
|
+
return J.error(U.sql.tableErr({ tableName: e }), U.sql.error()), !1;
|
|
4212
4266
|
}
|
|
4213
4267
|
let { exe: r } = $, i = n.join("&");
|
|
4214
4268
|
try {
|
|
4215
4269
|
if (await r.batchWriteDataBase(i)) return !0;
|
|
4216
4270
|
throw Error();
|
|
4217
4271
|
} catch (e) {
|
|
4218
|
-
return
|
|
4272
|
+
return J.error(U.sql.execErr({ error: i }), U.sql.batchErr()), $.dev && console.error(e), !1;
|
|
4273
|
+
}
|
|
4274
|
+
}
|
|
4275
|
+
async #r({ type: e, grade: t, user: n, content: r }) {
|
|
4276
|
+
let { exe: i } = $, a = Date.now(), o = At(a), s = n ?? sn.userName;
|
|
4277
|
+
try {
|
|
4278
|
+
let n = An(Q.sqls.insertSql, a, o, e, t, s, r);
|
|
4279
|
+
await i.writeDataBase(n);
|
|
4280
|
+
} catch (e) {
|
|
4281
|
+
$.dev && console.error(e);
|
|
4219
4282
|
}
|
|
4220
4283
|
}
|
|
4221
|
-
|
|
4222
|
-
|
|
4284
|
+
async logOperate(e, t, n) {
|
|
4285
|
+
await this.#r({
|
|
4286
|
+
type: Q.operate,
|
|
4287
|
+
grade: e,
|
|
4288
|
+
user: n,
|
|
4289
|
+
content: t
|
|
4290
|
+
}), G(W.recordUpdated, Q.operate);
|
|
4291
|
+
}
|
|
4292
|
+
async logMessage(e, t, n) {
|
|
4293
|
+
await this.#r({
|
|
4294
|
+
type: Q.message,
|
|
4295
|
+
grade: e,
|
|
4296
|
+
user: n,
|
|
4297
|
+
content: t
|
|
4298
|
+
}), G(W.recordUpdated, Q.message);
|
|
4299
|
+
}
|
|
4300
|
+
}, Mn = (e) => {
|
|
4301
|
+
let t = new jn(e);
|
|
4223
4302
|
return !t.error && t;
|
|
4224
|
-
},
|
|
4303
|
+
}, Nn = new class {
|
|
4225
4304
|
maxLength = 3;
|
|
4226
4305
|
#e = [];
|
|
4227
4306
|
get length() {
|
|
@@ -4252,7 +4331,7 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4252
4331
|
this.#e.splice(0, this.#e.length);
|
|
4253
4332
|
}
|
|
4254
4333
|
}(), $ = {
|
|
4255
|
-
token:
|
|
4334
|
+
token: Oe,
|
|
4256
4335
|
langs: [],
|
|
4257
4336
|
exe: null,
|
|
4258
4337
|
cv: null,
|
|
@@ -4262,8 +4341,8 @@ var ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4262
4341
|
dev: !1,
|
|
4263
4342
|
level: null,
|
|
4264
4343
|
project: {}
|
|
4265
|
-
},
|
|
4266
|
-
$.exe = e, $.cv = t, $.neat = n, $.dev = r, $.level = c, $.langs =
|
|
4344
|
+
}, Pn = ({ 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 } = {}) => {
|
|
4345
|
+
$.exe = e, $.cv = t, $.neat = n, $.dev = r, $.level = c, $.langs = Lt(i, a), $.db = Mn(o), $.evt = Vt(s), J.maxLength = f, Nn.maxLength = d, cn(l), $.project = Object.assign(u, Jt.toProps());
|
|
4267
4346
|
};
|
|
4268
4347
|
//#endregion
|
|
4269
|
-
export {
|
|
4348
|
+
export { Mt as $, cn as A, Yt as B, yn as C, Cn as D, wn as E, Zt as F, Ht as G, W as H, Qt as I, Ut as J, Vt as K, Xt as L, q as M, sn as N, J as O, en as P, At as Q, Jt as R, vn as S, mn as T, Kt as U, qt as V, G as W, U as X, Gt as Y, Nt as Z, bn as _, d as _t, Mn as a, bt as at, dn as b, pn as c, De as ct, hn as d, pe as dt, Pt as et, X as f, me as ft, En as g, c as gt, On as h, s as ht, Q as i, Ct as it, ln as j, K as k, Y as l, P as lt, Dn as m, O as mt, Pn as n, Ot as nt, un as o, H as ot, Sn as p, fe as pt, Wt as q, Nn as r, Et as rt, fn as s, V as st, $ as t, jt as tt, kn as u, we as ut, xn as v, u as vt, _n as w, gn as x, Tn as y, $t as z };
|