@declarion/react 0.44.0 → 0.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/{DraggableChildrenTable-G4Sw1XAD.js → DraggableChildrenTable-B6KjWkwD.js} +39 -39
- package/dist-lib/{DynamicIcon-DeRpAaXm.js → DynamicIcon-Dc2j-rg_.js} +19 -17
- package/dist-lib/{Grid-CXn-IK3H.js → Grid-OdquWJNX.js} +2 -2
- package/dist-lib/{LayoutRenderer-DX8pFS5A.js → LayoutRenderer-CzAdhjNT.js} +794 -787
- package/dist-lib/{MarkdownRenderer-CreI9x2m.js → MarkdownRenderer-C6bhrAIe.js} +10 -10
- package/dist-lib/{RefreshControl-DFh0-gCb.js → RefreshControl-F9Ib9asP.js} +179 -179
- package/dist-lib/{SmartDetailPage.impl-K6Jj1-9z.js → SmartDetailPage.impl-DdSu3kmW.js} +631 -593
- package/dist-lib/{SmartRecordListPage.impl-DQW_uVfL.js → SmartRecordListPage.impl-SkIp0_Rd.js} +220 -209
- package/dist-lib/api/agents.d.ts +39 -7
- package/dist-lib/components/agents/AgentChatPanel.d.ts +6 -1
- package/dist-lib/components/agents/transcript-runs.d.ts +29 -0
- package/dist-lib/components/file-widgets/host.d.ts +1 -0
- package/dist-lib/components/list/QuickPeek.d.ts +1 -1
- package/dist-lib/components/pages/exportRequest.d.ts +3 -3
- package/dist-lib/components/pages/list/ListFloatbar.d.ts +4 -2
- package/dist-lib/components/pages/list/cardProjection.d.ts +2 -1
- package/dist-lib/components/pages/list/filter-meta.d.ts +22 -8
- package/dist-lib/components/shared/RowActionsKebab.d.ts +3 -2
- package/dist-lib/components/views/ViewSwitcher.d.ts +2 -1
- package/dist-lib/hooks/useAgentConversation.d.ts +7 -19
- package/dist-lib/hooks/useCursorEntityData.d.ts +3 -2
- package/dist-lib/hooks/useFilters.d.ts +1 -0
- package/dist-lib/icons.js +1 -1
- package/dist-lib/index.d.ts +8 -1
- package/dist-lib/index.js +3246 -2984
- package/dist-lib/lib/actions.d.ts +1 -1
- package/dist-lib/lib/anchor.d.ts +37 -0
- package/dist-lib/lib/filter-evaluator.d.ts +16 -0
- package/dist-lib/lib/filters.d.ts +10 -4
- package/dist-lib/lib/messages.d.ts +1 -0
- package/dist-lib/lib/variants.d.ts +7 -0
- package/dist-lib/{registry-r4hiflwC.js → registry-C2VD-5MD.js} +1103 -879
- package/dist-lib/testing.js +10 -10
- package/dist-lib/types/api.d.ts +3 -10
- package/dist-lib/types/schema.d.ts +51 -13
- package/dist-lib/{useCurrentScreen-CpQjVmrT.js → useCurrentScreen-ow4r-nWa.js} +1130 -1054
- package/dist-lib/{useProperties-CULxrNT4.js → useProperties-lEKfzm2X.js} +114 -83
- package/dist-lib/{value-fUHxMV4r.js → value-CXohNH6a.js} +1 -1
- package/dist-lib/vite/index.js +23 -22
- package/package.json +12 -12
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as e, s as t, t as n } from "./DynamicIcon-
|
|
1
|
+
import { c as e, s as t, t as n } from "./DynamicIcon-Dc2j-rg_.js";
|
|
2
2
|
import { Suspense as r, createContext as i, forwardRef as a, lazy as o, useCallback as s, useContext as c, useEffect as l, useLayoutEffect as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
3
3
|
import { useLocation as m, useNavigate as h } from "react-router";
|
|
4
4
|
import { useQuery as g, useQueryClient as _ } from "@tanstack/react-query";
|
|
@@ -199,7 +199,7 @@ function j({ open: e, onClose: t, anchor: n, anchorPoint: r, children: i, align:
|
|
|
199
199
|
n,
|
|
200
200
|
t
|
|
201
201
|
]), !e || !d) return null;
|
|
202
|
-
let _ = d.placement === "below" ? `calc(var(--app-height) - ${d.top}px - 8px)` : `${Math.max(120, d.top - 8)}px`, v =
|
|
202
|
+
let _ = d.placement === "below" ? `calc(var(--app-height) - ${d.top}px - 8px)` : `${Math.max(120, d.top - 8)}px`, v = ee(s?.maxHeight), y = v ? `min(${_}, ${v})` : _;
|
|
203
203
|
return S(/* @__PURE__ */ b("div", {
|
|
204
204
|
ref: c,
|
|
205
205
|
style: {
|
|
@@ -232,17 +232,17 @@ function M() {
|
|
|
232
232
|
let t = window.visualViewport?.height;
|
|
233
233
|
return Number.isFinite(t) && t && t > 0 ? t : window.innerHeight;
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function ee(e) {
|
|
236
236
|
if (e != null) return typeof e == "number" ? `${e}px` : String(e);
|
|
237
237
|
}
|
|
238
238
|
//#endregion
|
|
239
239
|
//#region src/components/primitives/HoverCard.tsx
|
|
240
|
-
var
|
|
240
|
+
var N = 400, te = 150, ne = 320, re = 240, ie = 4, ae = 4;
|
|
241
241
|
function oe({ content: e, children: t, width: n = ne, align: r = "center", style: i }) {
|
|
242
242
|
let a = f(null), o = f(null), c = f(null), u = f(null), [d, m] = p(!1), [h, g] = p(null), [_, v] = p(!1), C = s(() => {
|
|
243
243
|
let e = a.current;
|
|
244
244
|
if (!e) return;
|
|
245
|
-
let t = e.getBoundingClientRect(), i = typeof window < "u" ? window.visualViewport : void 0, s = i?.width ?? (typeof window < "u" ? window.innerWidth : 0), c = i?.height ?? (typeof window < "u" ? window.innerHeight : 0), l = i?.offsetLeft ?? 0, u = i?.offsetTop ?? 0, d = Math.min(n, Math.max(160, s -
|
|
245
|
+
let t = e.getBoundingClientRect(), i = typeof window < "u" ? window.visualViewport : void 0, s = i?.width ?? (typeof window < "u" ? window.innerWidth : 0), c = i?.height ?? (typeof window < "u" ? window.innerHeight : 0), l = i?.offsetLeft ?? 0, u = i?.offsetTop ?? 0, d = Math.min(n, Math.max(160, s - 8)), f = o.current?.offsetHeight ?? re, p = u + c - t.bottom < f + 8 && t.top > f + 8 ? "above" : "below", m = p === "below" ? t.bottom + ae : t.top - ae - f, h;
|
|
246
246
|
h = r === "start" ? t.left : r === "end" ? t.right - d : t.left + t.width / 2 - d / 2;
|
|
247
247
|
let _ = l + ie, v = l + s - ie;
|
|
248
248
|
h + d > v && (h = Math.max(_, t.right - d)), h < _ && (h = _), g((e) => e && e.top === m && e.left === h && e.width === d && e.placement === p ? e : {
|
|
@@ -252,18 +252,20 @@ function oe({ content: e, children: t, width: n = ne, align: r = "center", style
|
|
|
252
252
|
placement: p
|
|
253
253
|
});
|
|
254
254
|
}, [r, n]), w = f(null), T = s((e) => {
|
|
255
|
-
if (o.current = e, w.current &&= (w.current.disconnect(), null), e)
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
255
|
+
if (o.current = e, w.current &&= (w.current.disconnect(), null), e) {
|
|
256
|
+
if (typeof ResizeObserver < "u") {
|
|
257
|
+
let t = new ResizeObserver(() => {
|
|
258
|
+
C(), v(!0);
|
|
259
|
+
});
|
|
260
|
+
t.observe(e), w.current = t;
|
|
261
|
+
} else v(!0);
|
|
262
|
+
}
|
|
261
263
|
}, [C]), E = s(() => {
|
|
262
264
|
c.current !== null && (window.clearTimeout(c.current), c.current = null), u.current !== null && (window.clearTimeout(u.current), u.current = null);
|
|
263
265
|
}, []), D = () => {
|
|
264
266
|
u.current !== null && (window.clearTimeout(u.current), u.current = null), !(d || c.current !== null) && (c.current = window.setTimeout(() => {
|
|
265
267
|
c.current = null, m(!0);
|
|
266
|
-
},
|
|
268
|
+
}, N));
|
|
267
269
|
}, O = s(() => {
|
|
268
270
|
E(), m(!0);
|
|
269
271
|
}, [E]), k = s(() => {
|
|
@@ -334,7 +336,7 @@ function oe({ content: e, children: t, width: n = ne, align: r = "center", style
|
|
|
334
336
|
}, 0);
|
|
335
337
|
},
|
|
336
338
|
onPointerDown: (e) => {
|
|
337
|
-
e.pointerType
|
|
339
|
+
(e.pointerType === "touch" || e.pointerType === "pen") && (e.preventDefault(), d ? k() : O());
|
|
338
340
|
},
|
|
339
341
|
onKeyDown: (e) => {
|
|
340
342
|
e.key === "Escape" && (e.stopPropagation(), k());
|
|
@@ -1323,7 +1325,7 @@ function Re({ value: e, onChange: n, type: r = "text", options: i }) {
|
|
|
1323
1325
|
}
|
|
1324
1326
|
//#endregion
|
|
1325
1327
|
//#region src/types/ordmap.ts
|
|
1326
|
-
var
|
|
1328
|
+
var L = class e {
|
|
1327
1329
|
#e;
|
|
1328
1330
|
#t;
|
|
1329
1331
|
constructor(e) {
|
|
@@ -1366,7 +1368,7 @@ var ze = class e {
|
|
|
1366
1368
|
};
|
|
1367
1369
|
//#endregion
|
|
1368
1370
|
//#region src/lib/display-value.ts
|
|
1369
|
-
function
|
|
1371
|
+
function R(e) {
|
|
1370
1372
|
if (e == null) return "";
|
|
1371
1373
|
switch (typeof e) {
|
|
1372
1374
|
case "string": return e;
|
|
@@ -1384,10 +1386,10 @@ function L(e) {
|
|
|
1384
1386
|
}
|
|
1385
1387
|
//#endregion
|
|
1386
1388
|
//#region src/lib/timestamp.ts
|
|
1387
|
-
function
|
|
1389
|
+
function ze(e = /* @__PURE__ */ new Date()) {
|
|
1388
1390
|
return T(e);
|
|
1389
1391
|
}
|
|
1390
|
-
function
|
|
1392
|
+
function Be(e, t) {
|
|
1391
1393
|
let n = e.match(/([+-]\d{2}:\d{2})$/), r = e.endsWith("Z"), i = new Date(e);
|
|
1392
1394
|
if (isNaN(i.getTime())) return e;
|
|
1393
1395
|
if (n || r) {
|
|
@@ -1413,13 +1415,13 @@ function Ve(e, t) {
|
|
|
1413
1415
|
}
|
|
1414
1416
|
return new Intl.DateTimeFormat(void 0, t).format(i);
|
|
1415
1417
|
}
|
|
1416
|
-
function
|
|
1417
|
-
return
|
|
1418
|
+
function Ve(e) {
|
|
1419
|
+
return Be(e, {
|
|
1418
1420
|
dateStyle: "medium",
|
|
1419
1421
|
timeStyle: "short"
|
|
1420
1422
|
});
|
|
1421
1423
|
}
|
|
1422
|
-
function
|
|
1424
|
+
function He(e, t = /* @__PURE__ */ new Date()) {
|
|
1423
1425
|
if (e == null || e === "") return {
|
|
1424
1426
|
text: "—",
|
|
1425
1427
|
absolute: ""
|
|
@@ -1432,8 +1434,8 @@ function Ue(e, t = /* @__PURE__ */ new Date()) {
|
|
|
1432
1434
|
absolute: t
|
|
1433
1435
|
};
|
|
1434
1436
|
}
|
|
1435
|
-
let r =
|
|
1436
|
-
return Math.abs(i) >
|
|
1437
|
+
let r = Ve(typeof e == "string" ? e : n.toISOString()), i = t.getTime() - n.getTime();
|
|
1438
|
+
return Math.abs(i) > 2592e6 ? {
|
|
1437
1439
|
text: T(n, { representation: "date" }),
|
|
1438
1440
|
absolute: r
|
|
1439
1441
|
} : {
|
|
@@ -1441,34 +1443,34 @@ function Ue(e, t = /* @__PURE__ */ new Date()) {
|
|
|
1441
1443
|
absolute: r
|
|
1442
1444
|
};
|
|
1443
1445
|
}
|
|
1444
|
-
function
|
|
1446
|
+
function z(e, t = "en") {
|
|
1445
1447
|
return e ? e[t] ?? Object.values(e)[0] ?? "" : "";
|
|
1446
1448
|
}
|
|
1447
|
-
var
|
|
1448
|
-
function
|
|
1449
|
+
var Ue = "$display";
|
|
1450
|
+
function We(e, t) {
|
|
1449
1451
|
if (!e) return;
|
|
1450
|
-
let n = e[
|
|
1452
|
+
let n = e[Ue];
|
|
1451
1453
|
if (typeof n == "string" && n !== "") return n;
|
|
1452
1454
|
let r = t?.display?.display_field;
|
|
1453
1455
|
if (!r) return;
|
|
1454
1456
|
let i = e[r];
|
|
1455
1457
|
if (i == null) return;
|
|
1456
1458
|
let a = t?.fields?.get(r);
|
|
1457
|
-
if (a?.type === "timestamp" && typeof i == "string" && i !== "") return
|
|
1459
|
+
if (a?.type === "timestamp" && typeof i == "string" && i !== "") return Ve(i);
|
|
1458
1460
|
let o = a?.values;
|
|
1459
1461
|
if (o && (typeof i == "string" || typeof i == "number")) {
|
|
1460
1462
|
let e = o.find((e) => e.code === String(i));
|
|
1461
1463
|
if (e) {
|
|
1462
|
-
let t =
|
|
1464
|
+
let t = z(e.name);
|
|
1463
1465
|
if (t) return t;
|
|
1464
1466
|
}
|
|
1465
1467
|
}
|
|
1466
|
-
return typeof i == "object" && !Array.isArray(i) ?
|
|
1468
|
+
return typeof i == "object" && !Array.isArray(i) ? z(i) || void 0 : R(i);
|
|
1467
1469
|
}
|
|
1468
|
-
function
|
|
1470
|
+
function Ge(e, t, n) {
|
|
1469
1471
|
if (!t) return n;
|
|
1470
1472
|
let r = e[t];
|
|
1471
|
-
return r == null ? n : typeof r == "object" && !Array.isArray(r) ?
|
|
1473
|
+
return r == null ? n : typeof r == "object" && !Array.isArray(r) ? z(r) || n : R(r);
|
|
1472
1474
|
}
|
|
1473
1475
|
function Ke(e) {
|
|
1474
1476
|
let t = e.replace(/\/+$/, "").split("/").map((e) => e.startsWith(":") ? "[^/]+" : e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
@@ -1489,9 +1491,9 @@ function Je(e, t, n) {
|
|
|
1489
1491
|
let r = e.replace(/\/+$/, "") || "/", i;
|
|
1490
1492
|
for (let e of Object.values(t)) {
|
|
1491
1493
|
if (!e.route || !Ke(e.route).test(r)) continue;
|
|
1492
|
-
let t = e.route.includes("/:"), a =
|
|
1494
|
+
let t = e.route.includes("/:"), a = z(e.display?.name);
|
|
1493
1495
|
if (!a && t && n && e.entity) {
|
|
1494
|
-
let t =
|
|
1496
|
+
let t = z(n[e.entity]?.display?.name);
|
|
1495
1497
|
if (t) {
|
|
1496
1498
|
let e = r.slice(r.lastIndexOf("/") + 1);
|
|
1497
1499
|
a = e ? `${t} ${qe(e)}` : t;
|
|
@@ -1508,12 +1510,12 @@ function Je(e, t, n) {
|
|
|
1508
1510
|
return i;
|
|
1509
1511
|
}
|
|
1510
1512
|
function Ye(e, t, n) {
|
|
1511
|
-
let r =
|
|
1513
|
+
let r = z(e.display?.name);
|
|
1512
1514
|
if (r) return r;
|
|
1513
1515
|
if (e.type === "ref" && e.ref?.entity && n) {
|
|
1514
1516
|
let t = n[e.ref.entity];
|
|
1515
1517
|
if (t) {
|
|
1516
|
-
let e =
|
|
1518
|
+
let e = z(t.display?.name);
|
|
1517
1519
|
if (e) return e;
|
|
1518
1520
|
}
|
|
1519
1521
|
}
|
|
@@ -1547,30 +1549,33 @@ function Qe(e) {
|
|
|
1547
1549
|
function $e(e, t) {
|
|
1548
1550
|
return !e || e.readonly ? !1 : e.mutations?.[t] ?? !0;
|
|
1549
1551
|
}
|
|
1552
|
+
function et(e) {
|
|
1553
|
+
return !e?.disable_defaults?.includes("__new");
|
|
1554
|
+
}
|
|
1550
1555
|
function B(e) {
|
|
1551
1556
|
if (e.primary_key && e.primary_key.length > 0) return e.primary_key;
|
|
1552
1557
|
for (let [t, n] of e.fields) if (n.primary) return [t];
|
|
1553
1558
|
return ["id"];
|
|
1554
1559
|
}
|
|
1555
|
-
function
|
|
1560
|
+
function tt(e, t) {
|
|
1556
1561
|
let n = B(e), r = {};
|
|
1557
|
-
for (let e of n) r[e] =
|
|
1562
|
+
for (let e of n) r[e] = R(t[e]);
|
|
1558
1563
|
return r;
|
|
1559
1564
|
}
|
|
1560
|
-
function tt(e) {
|
|
1561
|
-
return e.length === 1 ? e[0] : JSON.stringify(e);
|
|
1562
|
-
}
|
|
1563
1565
|
function nt(e) {
|
|
1564
|
-
return
|
|
1566
|
+
return e.length === 1 ? e[0] : JSON.stringify(e);
|
|
1565
1567
|
}
|
|
1566
|
-
function rt(e
|
|
1567
|
-
return
|
|
1568
|
+
function rt(e) {
|
|
1569
|
+
return nt(Object.values(e));
|
|
1568
1570
|
}
|
|
1569
1571
|
function it(e, t) {
|
|
1572
|
+
return nt(B(e).map((e) => t[e] ?? ""));
|
|
1573
|
+
}
|
|
1574
|
+
function at(e, t) {
|
|
1570
1575
|
let n = B(e);
|
|
1571
1576
|
if (n.length === 1) return { [n[0]]: t };
|
|
1572
1577
|
}
|
|
1573
|
-
function
|
|
1578
|
+
function ot(e, t) {
|
|
1574
1579
|
if (t <= 1) return [e];
|
|
1575
1580
|
try {
|
|
1576
1581
|
let n = JSON.parse(e);
|
|
@@ -1580,23 +1585,23 @@ function at(e, t) {
|
|
|
1580
1585
|
}
|
|
1581
1586
|
return null;
|
|
1582
1587
|
}
|
|
1583
|
-
function
|
|
1588
|
+
function st(e, t, n) {
|
|
1584
1589
|
if (e?.detail_screen === "none") return null;
|
|
1585
1590
|
let r = e?.detail_screen ?? t?.detail_screen;
|
|
1586
1591
|
return r ? n?.[r]?.route ?? null : null;
|
|
1587
1592
|
}
|
|
1588
|
-
function
|
|
1593
|
+
function ct(e, t, n, r) {
|
|
1589
1594
|
if (!t) return null;
|
|
1590
|
-
let i =
|
|
1595
|
+
let i = st(e, n, r);
|
|
1591
1596
|
return i ? i.replace(":id", encodeURIComponent(t)) : null;
|
|
1592
1597
|
}
|
|
1593
|
-
function ct(e, t, n, r) {
|
|
1594
|
-
return !t || B(t).some((e) => !r[e]) ? null : st(e, rt(t, r), t, n);
|
|
1595
|
-
}
|
|
1596
1598
|
function lt(e, t, n, r) {
|
|
1597
|
-
return t ? ct(e, t,
|
|
1599
|
+
return !t || B(t).some((e) => !r[e]) ? null : ct(e, it(t, r), t, n);
|
|
1600
|
+
}
|
|
1601
|
+
function ut(e, t, n, r) {
|
|
1602
|
+
return t ? lt(e, t, n, tt(t, r)) : null;
|
|
1598
1603
|
}
|
|
1599
|
-
function
|
|
1604
|
+
function dt(e) {
|
|
1600
1605
|
return B(e).length > 1;
|
|
1601
1606
|
}
|
|
1602
1607
|
//#endregion
|
|
@@ -1609,42 +1614,42 @@ var V = class extends Error {
|
|
|
1609
1614
|
constructor(e, t, n, r, i) {
|
|
1610
1615
|
super(t), this.name = "ApiError", this.status = e, this.code = n, this.index = r, this.raw = i;
|
|
1611
1616
|
}
|
|
1612
|
-
},
|
|
1613
|
-
function
|
|
1617
|
+
}, ft = "cursor_semantics_mismatch", pt = "cursor_locale_changed";
|
|
1618
|
+
function mt(e) {
|
|
1614
1619
|
return e instanceof V && (e.code === "cursor_semantics_mismatch" || e.code === "cursor_locale_changed" || e.code === "archive_cursor_invalid");
|
|
1615
1620
|
}
|
|
1616
1621
|
//#endregion
|
|
1617
1622
|
//#region src/api/auth-redirect.ts
|
|
1618
|
-
var H = "/",
|
|
1619
|
-
function
|
|
1623
|
+
var H = "/", ht = "/login", gt = "/signup", _t = "https://declarion.local";
|
|
1624
|
+
function vt(e) {
|
|
1620
1625
|
let t = e.split(/[?#]/, 1)[0];
|
|
1621
|
-
return t ===
|
|
1626
|
+
return t === ht || t.startsWith(`${ht}/`) || t === gt || t.startsWith(`${gt}/`);
|
|
1622
1627
|
}
|
|
1623
|
-
function
|
|
1628
|
+
function yt(e) {
|
|
1624
1629
|
if (!e) return H;
|
|
1625
1630
|
let t = e.toLowerCase();
|
|
1626
1631
|
if (!e.startsWith("/") || e.startsWith("//") || e.includes("\\") || t.includes("%5c")) return H;
|
|
1627
1632
|
try {
|
|
1628
|
-
let t = new URL(e,
|
|
1629
|
-
if (t.origin !==
|
|
1633
|
+
let t = new URL(e, _t);
|
|
1634
|
+
if (t.origin !== _t) return H;
|
|
1630
1635
|
let n = `${t.pathname}${t.search}${t.hash}`;
|
|
1631
1636
|
return !n.startsWith("/") || n.startsWith("//") || n.includes("\\") ? H : n || H;
|
|
1632
1637
|
} catch {
|
|
1633
1638
|
return H;
|
|
1634
1639
|
}
|
|
1635
1640
|
}
|
|
1636
|
-
function
|
|
1637
|
-
let t =
|
|
1638
|
-
return t === H ||
|
|
1641
|
+
function bt(e) {
|
|
1642
|
+
let t = yt(e);
|
|
1643
|
+
return t === H || vt(t) ? ht : `${ht}?next=${encodeURIComponent(t)}`;
|
|
1639
1644
|
}
|
|
1640
|
-
function
|
|
1641
|
-
if (typeof window > "u") return
|
|
1645
|
+
function xt() {
|
|
1646
|
+
if (typeof window > "u") return ht;
|
|
1642
1647
|
let { pathname: e, search: t, hash: n } = window.location;
|
|
1643
|
-
return
|
|
1648
|
+
return bt(`${e}${t}${n}`);
|
|
1644
1649
|
}
|
|
1645
1650
|
//#endregion
|
|
1646
1651
|
//#region src/embed/protocol.ts
|
|
1647
|
-
var
|
|
1652
|
+
var St = "declarion-embed", Ct = {
|
|
1648
1653
|
ready: "ready",
|
|
1649
1654
|
setToken: "set-token",
|
|
1650
1655
|
tokenExpired: "token-expired",
|
|
@@ -1657,10 +1662,10 @@ var xt = "declarion-embed", St = {
|
|
|
1657
1662
|
navigate: "navigate",
|
|
1658
1663
|
setTheme: "set-theme"
|
|
1659
1664
|
};
|
|
1660
|
-
function
|
|
1665
|
+
function wt(e, t, n) {
|
|
1661
1666
|
if (!e || typeof window > "u" || window.parent === window) return !1;
|
|
1662
1667
|
let r = {
|
|
1663
|
-
source:
|
|
1668
|
+
source: St,
|
|
1664
1669
|
protocol: 1,
|
|
1665
1670
|
type: t,
|
|
1666
1671
|
payload: n
|
|
@@ -1669,28 +1674,28 @@ function Ct(e, t, n) {
|
|
|
1669
1674
|
}
|
|
1670
1675
|
//#endregion
|
|
1671
1676
|
//#region src/embed/token.ts
|
|
1672
|
-
var
|
|
1677
|
+
var Tt = 15e3, Et = 5e3, U = {
|
|
1673
1678
|
active: !1,
|
|
1674
1679
|
parentOrigin: null,
|
|
1675
1680
|
current: null,
|
|
1676
1681
|
pending: null
|
|
1677
1682
|
};
|
|
1678
|
-
function
|
|
1683
|
+
function Dt(e) {
|
|
1679
1684
|
U.active = !0, U.parentOrigin = e;
|
|
1680
1685
|
}
|
|
1681
|
-
function
|
|
1686
|
+
function Ot() {
|
|
1682
1687
|
return U.active;
|
|
1683
1688
|
}
|
|
1684
|
-
function
|
|
1689
|
+
function kt() {
|
|
1685
1690
|
return U.current?.token ?? null;
|
|
1686
1691
|
}
|
|
1687
|
-
function
|
|
1692
|
+
function At() {
|
|
1688
1693
|
return U.parentOrigin;
|
|
1689
1694
|
}
|
|
1690
|
-
function
|
|
1691
|
-
return !U.current || Date.now() >= U.current.expiresAt -
|
|
1695
|
+
function jt() {
|
|
1696
|
+
return !U.current || Date.now() >= U.current.expiresAt - Et;
|
|
1692
1697
|
}
|
|
1693
|
-
function
|
|
1698
|
+
function Mt(e) {
|
|
1694
1699
|
if (!e.token || typeof e.token != "string") return;
|
|
1695
1700
|
let t = Date.parse(e.expires_at);
|
|
1696
1701
|
if (!Number.isNaN(t) && (U.current = {
|
|
@@ -1701,31 +1706,31 @@ function jt(e) {
|
|
|
1701
1706
|
U.pending = null, clearTimeout(t.timer), t.resolve(e.token);
|
|
1702
1707
|
}
|
|
1703
1708
|
}
|
|
1704
|
-
function
|
|
1709
|
+
function Nt() {
|
|
1705
1710
|
U.current = null;
|
|
1706
1711
|
}
|
|
1707
|
-
function
|
|
1708
|
-
if (!
|
|
1712
|
+
function Pt() {
|
|
1713
|
+
if (!jt() && U.current) return Promise.resolve(U.current.token);
|
|
1709
1714
|
if (U.pending) return U.pending.promise;
|
|
1710
1715
|
let e, t, n = new Promise((n, r) => {
|
|
1711
1716
|
e = n, t = r;
|
|
1712
1717
|
}), r = setTimeout(() => {
|
|
1713
|
-
U.pending && U.pending.promise === n && (U.pending = null), t(/* @__PURE__ */ Error(`embed token wait timed out after ${
|
|
1714
|
-
},
|
|
1718
|
+
U.pending && U.pending.promise === n && (U.pending = null), t(/* @__PURE__ */ Error(`embed token wait timed out after ${Tt}ms`));
|
|
1719
|
+
}, Tt);
|
|
1715
1720
|
return U.pending = {
|
|
1716
1721
|
promise: n,
|
|
1717
1722
|
resolve: e,
|
|
1718
1723
|
reject: t,
|
|
1719
1724
|
timer: r
|
|
1720
|
-
},
|
|
1725
|
+
}, wt(U.parentOrigin, Ct.tokenExpired, {}), n;
|
|
1721
1726
|
}
|
|
1722
1727
|
//#endregion
|
|
1723
1728
|
//#region src/lib/versionTracker.ts
|
|
1724
|
-
var
|
|
1725
|
-
function
|
|
1729
|
+
var Ft = "X-Declarion-Version", It = "declarion-version";
|
|
1730
|
+
function Lt() {
|
|
1726
1731
|
if (typeof BroadcastChannel > "u") return null;
|
|
1727
1732
|
try {
|
|
1728
|
-
return new BroadcastChannel(
|
|
1733
|
+
return new BroadcastChannel(It);
|
|
1729
1734
|
} catch {
|
|
1730
1735
|
return null;
|
|
1731
1736
|
}
|
|
@@ -1738,8 +1743,8 @@ var W = {
|
|
|
1738
1743
|
listeners: /* @__PURE__ */ new Set(),
|
|
1739
1744
|
channel: null
|
|
1740
1745
|
};
|
|
1741
|
-
function
|
|
1742
|
-
W.channel || typeof BroadcastChannel > "u" || (W.channel =
|
|
1746
|
+
function Rt() {
|
|
1747
|
+
W.channel || typeof BroadcastChannel > "u" || (W.channel = Lt(), W.channel && W.channel.addEventListener("message", (e) => {
|
|
1743
1748
|
let t = e.data;
|
|
1744
1749
|
if (!(!t || t.type !== "drift" || !t.delta) && !W.hasReportedDrift) {
|
|
1745
1750
|
W.hasReportedDrift = !0;
|
|
@@ -1747,30 +1752,30 @@ function Lt() {
|
|
|
1747
1752
|
}
|
|
1748
1753
|
}));
|
|
1749
1754
|
}
|
|
1750
|
-
function
|
|
1751
|
-
if (
|
|
1752
|
-
let t = e.get(
|
|
1755
|
+
function zt(e) {
|
|
1756
|
+
if (Rt(), !e) return;
|
|
1757
|
+
let t = e.get(Ft);
|
|
1753
1758
|
if (t) {
|
|
1754
1759
|
if (!W.firstSeen) {
|
|
1755
1760
|
W.firstSeen = t;
|
|
1756
1761
|
return;
|
|
1757
1762
|
}
|
|
1758
|
-
t !== W.firstSeen && (W.hasReportedDrift ||
|
|
1759
|
-
|
|
1763
|
+
t !== W.firstSeen && (W.hasReportedDrift || Bt().catch(() => {
|
|
1764
|
+
Ht({
|
|
1760
1765
|
kind: "unknown",
|
|
1761
1766
|
observed: t
|
|
1762
1767
|
});
|
|
1763
1768
|
}));
|
|
1764
1769
|
}
|
|
1765
1770
|
}
|
|
1766
|
-
async function
|
|
1767
|
-
|
|
1771
|
+
async function Bt() {
|
|
1772
|
+
Rt();
|
|
1768
1773
|
let e;
|
|
1769
1774
|
try {
|
|
1770
1775
|
let t = {};
|
|
1771
1776
|
W.firstSeen && (t["If-None-Match"] = `"${W.firstSeen}"`), e = await fetch("/api/version", {
|
|
1772
1777
|
method: "GET",
|
|
1773
|
-
credentials:
|
|
1778
|
+
credentials: Ot() ? "omit" : "include",
|
|
1774
1779
|
headers: t
|
|
1775
1780
|
});
|
|
1776
1781
|
} catch {
|
|
@@ -1791,18 +1796,18 @@ async function zt() {
|
|
|
1791
1796
|
asset: t.asset_fingerprint,
|
|
1792
1797
|
binary: t.binary_fingerprint
|
|
1793
1798
|
} : void 0;
|
|
1794
|
-
W.firstSeen ||= n, !W.firstComponents && r && n === W.firstSeen && (W.firstComponents = r), n !== W.firstSeen &&
|
|
1795
|
-
kind:
|
|
1799
|
+
W.firstSeen ||= n, !W.firstComponents && r && n === W.firstSeen && (W.firstComponents = r), n !== W.firstSeen && Ht({
|
|
1800
|
+
kind: Vt(W.firstComponents, r),
|
|
1796
1801
|
observed: n,
|
|
1797
1802
|
components: r
|
|
1798
1803
|
});
|
|
1799
1804
|
}
|
|
1800
|
-
function
|
|
1805
|
+
function Vt(e, t) {
|
|
1801
1806
|
if (!e || !t) return "unknown";
|
|
1802
1807
|
let n = e.schema !== t.schema, r = e.asset !== t.asset, i = e.binary !== t.binary;
|
|
1803
1808
|
return n && !r && !i ? "schema-only" : r || i ? "asset-or-binary" : "unknown";
|
|
1804
1809
|
}
|
|
1805
|
-
function
|
|
1810
|
+
function Ht(e) {
|
|
1806
1811
|
if (!W.hasReportedDrift) {
|
|
1807
1812
|
W.hasReportedDrift = !0, e.kind !== "schema-only" && (W.pendingReload = e);
|
|
1808
1813
|
for (let t of W.listeners) t(e);
|
|
@@ -1812,21 +1817,21 @@ function Vt(e) {
|
|
|
1812
1817
|
delta: e
|
|
1813
1818
|
});
|
|
1814
1819
|
} catch {}
|
|
1815
|
-
|
|
1820
|
+
Ot() && e.kind !== "schema-only" && wt(At(), Ct.reloadRequired, { reason: `version drift: ${e.kind}` });
|
|
1816
1821
|
}
|
|
1817
1822
|
}
|
|
1818
|
-
function
|
|
1823
|
+
function Ut() {
|
|
1819
1824
|
return W.pendingReload;
|
|
1820
1825
|
}
|
|
1821
|
-
function
|
|
1826
|
+
function Wt(e) {
|
|
1822
1827
|
return W.listeners.add(e), () => {
|
|
1823
1828
|
W.listeners.delete(e);
|
|
1824
1829
|
};
|
|
1825
1830
|
}
|
|
1826
1831
|
//#endregion
|
|
1827
1832
|
//#region src/api/client.ts
|
|
1828
|
-
var
|
|
1829
|
-
function
|
|
1833
|
+
var Gt = (e) => JSON.stringify(e ?? {}), Kt = null, G = "declarion.auth.refresh.lock", qt = "declarion.auth.refresh.result", Jt = "declarion.auth.refresh", Yt = 3e4, Xt = 100, Zt = typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
1834
|
+
function Qt() {
|
|
1830
1835
|
if (typeof window > "u") return !1;
|
|
1831
1836
|
try {
|
|
1832
1837
|
let e = window.localStorage, t = `${G}.probe`;
|
|
@@ -1835,10 +1840,10 @@ function Zt() {
|
|
|
1835
1840
|
return !1;
|
|
1836
1841
|
}
|
|
1837
1842
|
}
|
|
1838
|
-
function
|
|
1843
|
+
function $t() {
|
|
1839
1844
|
return typeof navigator > "u" ? null : navigator.locks ?? null;
|
|
1840
1845
|
}
|
|
1841
|
-
function
|
|
1846
|
+
function en(e) {
|
|
1842
1847
|
if (!e) return null;
|
|
1843
1848
|
try {
|
|
1844
1849
|
let t = JSON.parse(e);
|
|
@@ -1850,7 +1855,7 @@ function $t(e) {
|
|
|
1850
1855
|
return null;
|
|
1851
1856
|
}
|
|
1852
1857
|
}
|
|
1853
|
-
function
|
|
1858
|
+
function tn(e) {
|
|
1854
1859
|
if (!e) return null;
|
|
1855
1860
|
try {
|
|
1856
1861
|
let t = JSON.parse(e);
|
|
@@ -1864,47 +1869,47 @@ function en(e) {
|
|
|
1864
1869
|
return null;
|
|
1865
1870
|
}
|
|
1866
1871
|
}
|
|
1867
|
-
function
|
|
1868
|
-
if (!
|
|
1869
|
-
let t =
|
|
1872
|
+
function nn(e) {
|
|
1873
|
+
if (!Qt()) return null;
|
|
1874
|
+
let t = tn(window.localStorage.getItem(qt));
|
|
1870
1875
|
return !t || t.updated_at < e ? null : t;
|
|
1871
1876
|
}
|
|
1872
|
-
function
|
|
1877
|
+
function rn(e) {
|
|
1873
1878
|
if (!e.ok) throw new K(e.status ?? 401);
|
|
1874
1879
|
}
|
|
1875
|
-
function
|
|
1876
|
-
let t =
|
|
1877
|
-
if (t && t.expires_at > e && t.owner !==
|
|
1880
|
+
function an(e = Date.now()) {
|
|
1881
|
+
let t = en(window.localStorage.getItem(G));
|
|
1882
|
+
if (t && t.expires_at > e && t.owner !== Zt) return !1;
|
|
1878
1883
|
let n = {
|
|
1879
|
-
owner:
|
|
1880
|
-
expires_at: e +
|
|
1884
|
+
owner: Zt,
|
|
1885
|
+
expires_at: e + Yt
|
|
1881
1886
|
};
|
|
1882
|
-
return window.localStorage.setItem(G, JSON.stringify(n)),
|
|
1887
|
+
return window.localStorage.setItem(G, JSON.stringify(n)), en(window.localStorage.getItem(G))?.owner === Zt;
|
|
1883
1888
|
}
|
|
1884
|
-
function
|
|
1885
|
-
|
|
1889
|
+
function on() {
|
|
1890
|
+
en(window.localStorage.getItem(G))?.owner === Zt && window.localStorage.removeItem(G);
|
|
1886
1891
|
}
|
|
1887
|
-
function
|
|
1892
|
+
function sn(e) {
|
|
1888
1893
|
let t = {
|
|
1889
|
-
owner:
|
|
1894
|
+
owner: Zt,
|
|
1890
1895
|
updated_at: Date.now(),
|
|
1891
1896
|
...e
|
|
1892
1897
|
};
|
|
1893
|
-
window.localStorage.setItem(
|
|
1898
|
+
window.localStorage.setItem(qt, JSON.stringify(t));
|
|
1894
1899
|
}
|
|
1895
|
-
async function
|
|
1900
|
+
async function cn(e) {
|
|
1896
1901
|
return new Promise((t, n) => {
|
|
1897
1902
|
let r = !1, i = null, a = (e) => {
|
|
1898
1903
|
r || (r = !0, i && clearTimeout(i), window.removeEventListener("storage", c), t(e));
|
|
1899
1904
|
}, o = (e) => {
|
|
1900
1905
|
r || (r = !0, i && clearTimeout(i), window.removeEventListener("storage", c), n(new K(e)));
|
|
1901
1906
|
}, s = () => {
|
|
1902
|
-
let t =
|
|
1907
|
+
let t = tn(window.localStorage.getItem(qt));
|
|
1903
1908
|
if (t && t.updated_at >= e) {
|
|
1904
1909
|
t.ok ? a("complete") : o(t.status ?? 401);
|
|
1905
1910
|
return;
|
|
1906
1911
|
}
|
|
1907
|
-
let n =
|
|
1912
|
+
let n = en(window.localStorage.getItem(G));
|
|
1908
1913
|
if (!n) {
|
|
1909
1914
|
a("complete");
|
|
1910
1915
|
return;
|
|
@@ -1913,50 +1918,50 @@ async function sn(e) {
|
|
|
1913
1918
|
a("expired");
|
|
1914
1919
|
return;
|
|
1915
1920
|
}
|
|
1916
|
-
i = setTimeout(s,
|
|
1921
|
+
i = setTimeout(s, Xt);
|
|
1917
1922
|
}, c = (e) => {
|
|
1918
|
-
(e.key === G || e.key ===
|
|
1923
|
+
(e.key === G || e.key === qt) && (i && clearTimeout(i), s());
|
|
1919
1924
|
};
|
|
1920
1925
|
window.addEventListener("storage", c), s();
|
|
1921
1926
|
});
|
|
1922
1927
|
}
|
|
1923
|
-
async function
|
|
1924
|
-
let t =
|
|
1925
|
-
return t ? (await t.request(
|
|
1926
|
-
let t =
|
|
1928
|
+
async function ln(e) {
|
|
1929
|
+
let t = $t();
|
|
1930
|
+
return t ? (await t.request(Jt, { mode: "exclusive" }, async () => {
|
|
1931
|
+
let t = nn(e);
|
|
1927
1932
|
if (t) {
|
|
1928
|
-
|
|
1933
|
+
rn(t);
|
|
1929
1934
|
return;
|
|
1930
1935
|
}
|
|
1931
1936
|
try {
|
|
1932
|
-
await
|
|
1937
|
+
await yn(), Qt() && sn({ ok: !0 });
|
|
1933
1938
|
} catch (e) {
|
|
1934
|
-
throw e instanceof K &&
|
|
1939
|
+
throw e instanceof K && Qt() && sn({
|
|
1935
1940
|
ok: !1,
|
|
1936
1941
|
status: e.status
|
|
1937
1942
|
}), e;
|
|
1938
1943
|
}
|
|
1939
1944
|
}), !0) : !1;
|
|
1940
1945
|
}
|
|
1941
|
-
async function
|
|
1946
|
+
async function un() {
|
|
1942
1947
|
let e = Date.now();
|
|
1943
|
-
if (!await
|
|
1944
|
-
if (!
|
|
1945
|
-
await
|
|
1948
|
+
if (!await ln(e)) {
|
|
1949
|
+
if (!Qt()) {
|
|
1950
|
+
await yn();
|
|
1946
1951
|
return;
|
|
1947
1952
|
}
|
|
1948
|
-
if (
|
|
1949
|
-
await
|
|
1953
|
+
if (an(e)) try {
|
|
1954
|
+
await yn(), sn({ ok: !0 });
|
|
1950
1955
|
return;
|
|
1951
1956
|
} catch (e) {
|
|
1952
|
-
throw e instanceof K &&
|
|
1957
|
+
throw e instanceof K && sn({
|
|
1953
1958
|
ok: !1,
|
|
1954
1959
|
status: e.status
|
|
1955
1960
|
}), e;
|
|
1956
1961
|
} finally {
|
|
1957
|
-
|
|
1962
|
+
on();
|
|
1958
1963
|
}
|
|
1959
|
-
await
|
|
1964
|
+
await cn(e) === "expired" && await un();
|
|
1960
1965
|
}
|
|
1961
1966
|
}
|
|
1962
1967
|
var K = class extends Error {
|
|
@@ -1964,83 +1969,83 @@ var K = class extends Error {
|
|
|
1964
1969
|
constructor(e) {
|
|
1965
1970
|
super(`refresh failed terminally (${e})`), this.status = e, this.name = "RefreshDeadError";
|
|
1966
1971
|
}
|
|
1967
|
-
},
|
|
1968
|
-
function
|
|
1969
|
-
|
|
1972
|
+
}, dn = null, fn = null, pn = 3e4, mn = 5e3;
|
|
1973
|
+
function hn() {
|
|
1974
|
+
bn().catch((e) => {
|
|
1970
1975
|
e instanceof K && q();
|
|
1971
1976
|
});
|
|
1972
1977
|
}
|
|
1973
|
-
function
|
|
1974
|
-
if (
|
|
1978
|
+
function gn(e) {
|
|
1979
|
+
if (dn &&= (clearTimeout(dn), null), fn = null, !e || typeof window > "u") return;
|
|
1975
1980
|
let t = Date.parse(e);
|
|
1976
1981
|
if (Number.isNaN(t)) return;
|
|
1977
|
-
|
|
1978
|
-
let n = Math.max(t - Date.now() -
|
|
1979
|
-
|
|
1980
|
-
|
|
1982
|
+
fn = t;
|
|
1983
|
+
let n = Math.max(t - Date.now() - pn, mn);
|
|
1984
|
+
dn = setTimeout(() => {
|
|
1985
|
+
dn = null, hn();
|
|
1981
1986
|
}, n);
|
|
1982
1987
|
}
|
|
1983
|
-
function
|
|
1984
|
-
|
|
1988
|
+
function _n() {
|
|
1989
|
+
dn &&= (clearTimeout(dn), null), fn = null;
|
|
1985
1990
|
}
|
|
1986
1991
|
typeof document < "u" && document.addEventListener("visibilitychange", () => {
|
|
1987
|
-
document.visibilityState === "visible" &&
|
|
1992
|
+
document.visibilityState === "visible" && fn !== null && Date.now() >= fn - pn && hn();
|
|
1988
1993
|
});
|
|
1989
|
-
async function
|
|
1994
|
+
async function vn(e) {
|
|
1990
1995
|
try {
|
|
1991
1996
|
let t = await e.json();
|
|
1992
|
-
|
|
1997
|
+
gn(t?.result?.expires_at ?? t?.expires_at);
|
|
1993
1998
|
} catch {}
|
|
1994
1999
|
}
|
|
1995
|
-
async function
|
|
2000
|
+
async function yn() {
|
|
1996
2001
|
let e = {
|
|
1997
2002
|
method: "POST",
|
|
1998
2003
|
credentials: "include",
|
|
1999
2004
|
headers: { "Content-Type": "application/json" },
|
|
2000
|
-
body:
|
|
2005
|
+
body: Gt({})
|
|
2001
2006
|
}, t = await fetch("/api/actions/auth.refresh", e);
|
|
2002
2007
|
if (t.status === 429) {
|
|
2003
2008
|
let n = parseInt(t.headers.get("Retry-After") || "1", 10);
|
|
2004
2009
|
await new Promise((e) => setTimeout(e, n * 1e3));
|
|
2005
2010
|
let r = await fetch("/api/actions/auth.refresh", e);
|
|
2006
2011
|
if (!r.ok) throw new K(r.status);
|
|
2007
|
-
await
|
|
2012
|
+
await vn(r);
|
|
2008
2013
|
return;
|
|
2009
2014
|
}
|
|
2010
2015
|
if (!t.ok) throw new K(t.status);
|
|
2011
|
-
await
|
|
2016
|
+
await vn(t);
|
|
2012
2017
|
}
|
|
2013
|
-
async function
|
|
2014
|
-
return
|
|
2015
|
-
|
|
2016
|
-
}),
|
|
2018
|
+
async function bn() {
|
|
2019
|
+
return Kt || (Kt = un().finally(() => {
|
|
2020
|
+
Kt = null;
|
|
2021
|
+
}), Kt);
|
|
2017
2022
|
}
|
|
2018
2023
|
var q = () => {
|
|
2019
2024
|
if (typeof window > "u") return;
|
|
2020
2025
|
let { pathname: e } = window.location;
|
|
2021
|
-
e.startsWith("/login") || e.startsWith("/signup") || e === "/reset" || e === "/forgot" || e === "/2fa" || (window.location.href =
|
|
2026
|
+
e.startsWith("/login") || e.startsWith("/signup") || e === "/reset" || e === "/forgot" || e === "/2fa" || (window.location.href = xt());
|
|
2022
2027
|
};
|
|
2023
|
-
function
|
|
2028
|
+
function xn(e) {
|
|
2024
2029
|
let t = q;
|
|
2025
2030
|
return q = e, t;
|
|
2026
2031
|
}
|
|
2027
|
-
function
|
|
2032
|
+
function Sn() {
|
|
2028
2033
|
return q;
|
|
2029
2034
|
}
|
|
2030
|
-
var
|
|
2035
|
+
var Cn = ({ status: e, code: t, message: n }) => {
|
|
2031
2036
|
console.error(`[API ${e}] ${t}: ${n}`);
|
|
2032
2037
|
};
|
|
2033
|
-
function
|
|
2038
|
+
function wn(e, t, n, r) {
|
|
2034
2039
|
let i = new Headers(e);
|
|
2035
2040
|
return !i.has("Content-Type") && t && i.set("Content-Type", "application/json"), n.setAccept && !i.has("Accept") && i.set("Accept", "*/*"), r && i.set("Authorization", `Bearer ${r}`), i;
|
|
2036
2041
|
}
|
|
2037
|
-
async function
|
|
2038
|
-
let i =
|
|
2042
|
+
async function Tn(e, t, n, r) {
|
|
2043
|
+
let i = Ot(), a = i ? "omit" : "include", o = wn(t.headers, !!t.body, n, i ? kt() : null), s = await fetch(e, {
|
|
2039
2044
|
...t,
|
|
2040
2045
|
headers: o,
|
|
2041
2046
|
credentials: a
|
|
2042
2047
|
});
|
|
2043
|
-
if (
|
|
2048
|
+
if (zt(s.headers), !s.ok) {
|
|
2044
2049
|
let o = "Request failed", c = "UNKNOWN", l, u;
|
|
2045
2050
|
try {
|
|
2046
2051
|
u = await s.json();
|
|
@@ -2049,8 +2054,8 @@ async function wn(e, t, n, r) {
|
|
|
2049
2054
|
} catch {}
|
|
2050
2055
|
if (s.status === 401 && (c === "TOKEN_REFRESH_NEEDED" || c === "UNAUTHORIZED")) try {
|
|
2051
2056
|
let o = null;
|
|
2052
|
-
i ? (
|
|
2053
|
-
let s =
|
|
2057
|
+
i ? (Nt(), o = await Pt()) : await bn();
|
|
2058
|
+
let s = wn(t.headers, !!t.body, n, o), c = await fetch(e, {
|
|
2054
2059
|
...t,
|
|
2055
2060
|
headers: s,
|
|
2056
2061
|
credentials: a
|
|
@@ -2067,7 +2072,7 @@ async function wn(e, t, n, r) {
|
|
|
2067
2072
|
} catch (e) {
|
|
2068
2073
|
throw e instanceof V ? e : (q(), new V(401, o, c, l));
|
|
2069
2074
|
}
|
|
2070
|
-
throw s.status === 401 && q(),
|
|
2075
|
+
throw s.status === 401 && q(), Cn({
|
|
2071
2076
|
status: s.status,
|
|
2072
2077
|
code: c,
|
|
2073
2078
|
message: o
|
|
@@ -2075,23 +2080,23 @@ async function wn(e, t, n, r) {
|
|
|
2075
2080
|
}
|
|
2076
2081
|
return r(s);
|
|
2077
2082
|
}
|
|
2078
|
-
function
|
|
2083
|
+
function En(e) {
|
|
2079
2084
|
return e.status === 204 ? Promise.resolve(void 0) : e.json();
|
|
2080
2085
|
}
|
|
2081
2086
|
async function J(e, t = {}) {
|
|
2082
|
-
return
|
|
2087
|
+
return Tn(e, t, { setAccept: !1 }, En);
|
|
2083
2088
|
}
|
|
2084
|
-
async function
|
|
2089
|
+
async function Dn(e) {
|
|
2085
2090
|
return {
|
|
2086
2091
|
blob: await e.blob(),
|
|
2087
|
-
filename:
|
|
2092
|
+
filename: kn(e.headers),
|
|
2088
2093
|
headers: e.headers
|
|
2089
2094
|
};
|
|
2090
2095
|
}
|
|
2091
|
-
async function
|
|
2092
|
-
return
|
|
2096
|
+
async function On(e, t = {}) {
|
|
2097
|
+
return Tn(e, t, { setAccept: !0 }, Dn);
|
|
2093
2098
|
}
|
|
2094
|
-
function
|
|
2099
|
+
function kn(e) {
|
|
2095
2100
|
let t = e.get("Content-Disposition");
|
|
2096
2101
|
if (!t) return "";
|
|
2097
2102
|
let n = t.match(/filename\*\s*=\s*([^']*)'([^']*)'([^;]+)/i);
|
|
@@ -2104,116 +2109,126 @@ function On(e) {
|
|
|
2104
2109
|
async function Y(e, t = {}) {
|
|
2105
2110
|
return (await J(`/api/actions/${encodeURIComponent(e)}`, {
|
|
2106
2111
|
method: "POST",
|
|
2107
|
-
body:
|
|
2112
|
+
body: Gt(t)
|
|
2108
2113
|
})).result;
|
|
2109
2114
|
}
|
|
2110
2115
|
//#endregion
|
|
2111
2116
|
//#region src/api/schema.ts
|
|
2112
|
-
function
|
|
2117
|
+
function An(e) {
|
|
2113
2118
|
return {
|
|
2114
2119
|
...e,
|
|
2115
|
-
params: e.params ?
|
|
2120
|
+
params: e.params ? L.fromObject(e.params) : void 0
|
|
2116
2121
|
};
|
|
2117
2122
|
}
|
|
2118
|
-
function
|
|
2123
|
+
function jn(e) {
|
|
2119
2124
|
return {
|
|
2120
2125
|
...e,
|
|
2121
|
-
resolved_params: e.resolved_params ?
|
|
2126
|
+
resolved_params: e.resolved_params ? L.fromObject(e.resolved_params) : void 0
|
|
2122
2127
|
};
|
|
2123
2128
|
}
|
|
2124
|
-
function
|
|
2129
|
+
function Mn(e) {
|
|
2125
2130
|
let t = {};
|
|
2126
|
-
if (e.handlers) for (let [n, r] of Object.entries(e.handlers)) t[n] =
|
|
2131
|
+
if (e.handlers) for (let [n, r] of Object.entries(e.handlers)) t[n] = An(r);
|
|
2127
2132
|
let n = {};
|
|
2128
|
-
if (e.actions) for (let [t, r] of Object.entries(e.actions)) n[t] =
|
|
2133
|
+
if (e.actions) for (let [t, r] of Object.entries(e.actions)) n[t] = jn(r);
|
|
2129
2134
|
return {
|
|
2130
2135
|
...e,
|
|
2131
|
-
fields:
|
|
2132
|
-
files: e.files ?
|
|
2136
|
+
fields: L.fromObject(e.fields),
|
|
2137
|
+
files: e.files ? L.fromObject(e.files) : void 0,
|
|
2138
|
+
variants: e.variants ? L.fromObject(e.variants) : void 0,
|
|
2133
2139
|
handlers: e.handlers ? t : void 0,
|
|
2134
2140
|
actions: e.actions ? n : void 0
|
|
2135
2141
|
};
|
|
2136
2142
|
}
|
|
2137
|
-
function
|
|
2143
|
+
function Nn(e) {
|
|
2138
2144
|
let t = {};
|
|
2139
|
-
if (e.entities) for (let [n, r] of Object.entries(e.entities)) t[n] =
|
|
2145
|
+
if (e.entities) for (let [n, r] of Object.entries(e.entities)) t[n] = Mn(r);
|
|
2140
2146
|
let n = {};
|
|
2141
2147
|
if (e.structures) for (let [t, r] of Object.entries(e.structures)) n[t] = {
|
|
2142
2148
|
...r,
|
|
2143
|
-
fields:
|
|
2149
|
+
fields: L.fromObject(r.fields)
|
|
2144
2150
|
};
|
|
2145
2151
|
let r = {};
|
|
2146
|
-
if (e.handlers) for (let [t, n] of Object.entries(e.handlers)) r[t] =
|
|
2152
|
+
if (e.handlers) for (let [t, n] of Object.entries(e.handlers)) r[t] = An(n);
|
|
2147
2153
|
let i = {};
|
|
2148
|
-
if (e.actions) for (let [t, n] of Object.entries(e.actions)) i[t] =
|
|
2154
|
+
if (e.actions) for (let [t, n] of Object.entries(e.actions)) i[t] = jn(n);
|
|
2155
|
+
let a = { ...e.screens };
|
|
2156
|
+
for (let [e, t] of Object.entries(a)) {
|
|
2157
|
+
let n = t;
|
|
2158
|
+
a[e] = {
|
|
2159
|
+
...t,
|
|
2160
|
+
variants: n.variants ? L.fromObject(n.variants) : void 0
|
|
2161
|
+
};
|
|
2162
|
+
}
|
|
2149
2163
|
return {
|
|
2150
2164
|
...e,
|
|
2151
2165
|
entities: t,
|
|
2152
2166
|
structures: n,
|
|
2153
2167
|
handlers: r,
|
|
2154
|
-
actions: i
|
|
2168
|
+
actions: i,
|
|
2169
|
+
screens: a
|
|
2155
2170
|
};
|
|
2156
2171
|
}
|
|
2157
|
-
async function
|
|
2158
|
-
return
|
|
2172
|
+
async function Pn() {
|
|
2173
|
+
return Nn(await J("/api/schema"));
|
|
2159
2174
|
}
|
|
2160
2175
|
//#endregion
|
|
2161
2176
|
//#region src/api/auth.ts
|
|
2162
|
-
async function
|
|
2177
|
+
async function Fn() {
|
|
2163
2178
|
return Y("auth.check_setup");
|
|
2164
2179
|
}
|
|
2165
|
-
async function
|
|
2180
|
+
async function In(e, t, n = !0) {
|
|
2166
2181
|
let r = await Y("auth.login", {
|
|
2167
2182
|
email: e,
|
|
2168
2183
|
password: t,
|
|
2169
2184
|
remember: n
|
|
2170
2185
|
});
|
|
2171
|
-
return
|
|
2186
|
+
return gn(r.expires_at), r;
|
|
2172
2187
|
}
|
|
2173
|
-
async function
|
|
2188
|
+
async function Ln(e, t, n) {
|
|
2174
2189
|
let r = await Y("auth.signup", {
|
|
2175
2190
|
email: e,
|
|
2176
2191
|
password: t,
|
|
2177
2192
|
display_name: n
|
|
2178
2193
|
});
|
|
2179
|
-
return
|
|
2194
|
+
return gn(r.expires_at), r;
|
|
2180
2195
|
}
|
|
2181
|
-
async function
|
|
2196
|
+
async function Rn() {
|
|
2182
2197
|
return Y("auth.me");
|
|
2183
2198
|
}
|
|
2184
|
-
async function
|
|
2199
|
+
async function zn() {
|
|
2185
2200
|
return (await Y("auth.list_tenants")).tenants;
|
|
2186
2201
|
}
|
|
2187
|
-
async function
|
|
2202
|
+
async function Bn(e) {
|
|
2188
2203
|
let t = await Y("auth.switch_tenant", { tenant_id: e });
|
|
2189
|
-
return
|
|
2204
|
+
return gn(t.expires_at), t;
|
|
2190
2205
|
}
|
|
2191
|
-
async function
|
|
2206
|
+
async function Vn() {
|
|
2192
2207
|
await Y("auth.logout");
|
|
2193
2208
|
}
|
|
2194
|
-
async function
|
|
2209
|
+
async function Hn(e) {
|
|
2195
2210
|
return (await Y("sso_provider.list", e ? { tenant_code: e } : {})).providers;
|
|
2196
2211
|
}
|
|
2197
|
-
function
|
|
2212
|
+
function Un(e, t, n) {
|
|
2198
2213
|
let r = new URLSearchParams();
|
|
2199
2214
|
t && r.set("tenant", t), n && r.set("redirect", n);
|
|
2200
2215
|
let i = r.toString();
|
|
2201
2216
|
return `/api/auth/sso/authorize/${encodeURIComponent(e)}${i ? `?${i}` : ""}`;
|
|
2202
2217
|
}
|
|
2203
|
-
async function
|
|
2218
|
+
async function Wn(e, t, n) {
|
|
2204
2219
|
let r = {
|
|
2205
2220
|
target_user_id: e,
|
|
2206
2221
|
reason: t
|
|
2207
2222
|
};
|
|
2208
2223
|
return n != null && (r.duration_minutes = n), Y("impersonation.start", r);
|
|
2209
2224
|
}
|
|
2210
|
-
async function
|
|
2225
|
+
async function Gn() {
|
|
2211
2226
|
return Y("impersonation.stop");
|
|
2212
2227
|
}
|
|
2213
|
-
async function
|
|
2228
|
+
async function Kn(e) {
|
|
2214
2229
|
await Y("impersonation.revoke", { session_id: e });
|
|
2215
2230
|
}
|
|
2216
|
-
async function
|
|
2231
|
+
async function qn(e, t) {
|
|
2217
2232
|
await Y("auth.change_password", {
|
|
2218
2233
|
current_password: e,
|
|
2219
2234
|
new_password: t
|
|
@@ -2221,7 +2236,7 @@ async function Kn(e, t) {
|
|
|
2221
2236
|
}
|
|
2222
2237
|
//#endregion
|
|
2223
2238
|
//#region src/stores/auth.ts
|
|
2224
|
-
var
|
|
2239
|
+
var Jn = E((e) => ({
|
|
2225
2240
|
user: null,
|
|
2226
2241
|
isAuthenticated: !1,
|
|
2227
2242
|
isLoading: !0,
|
|
@@ -2229,9 +2244,9 @@ var qn = E((e) => ({
|
|
|
2229
2244
|
tenants: [],
|
|
2230
2245
|
initialize: async () => {
|
|
2231
2246
|
try {
|
|
2232
|
-
let t = await
|
|
2247
|
+
let t = await Rn(), n = t.tenant ?? null, r = [];
|
|
2233
2248
|
try {
|
|
2234
|
-
r = await
|
|
2249
|
+
r = await zn();
|
|
2235
2250
|
} catch {}
|
|
2236
2251
|
e({
|
|
2237
2252
|
user: t,
|
|
@@ -2250,7 +2265,7 @@ var qn = E((e) => ({
|
|
|
2250
2265
|
},
|
|
2251
2266
|
refreshMe: async () => {
|
|
2252
2267
|
try {
|
|
2253
|
-
let t = await
|
|
2268
|
+
let t = await Rn();
|
|
2254
2269
|
e({
|
|
2255
2270
|
user: t,
|
|
2256
2271
|
activeTenant: t.tenant ?? null
|
|
@@ -2272,9 +2287,9 @@ var qn = E((e) => ({
|
|
|
2272
2287
|
e({ activeTenant: t });
|
|
2273
2288
|
},
|
|
2274
2289
|
logout: async () => {
|
|
2275
|
-
|
|
2290
|
+
_n();
|
|
2276
2291
|
try {
|
|
2277
|
-
await
|
|
2292
|
+
await Vn();
|
|
2278
2293
|
} catch {}
|
|
2279
2294
|
e({
|
|
2280
2295
|
user: null,
|
|
@@ -2287,31 +2302,31 @@ var qn = E((e) => ({
|
|
|
2287
2302
|
//#endregion
|
|
2288
2303
|
//#region src/hooks/useSchema.ts
|
|
2289
2304
|
function X() {
|
|
2290
|
-
let e =
|
|
2305
|
+
let e = Jn((e) => e.isAuthenticated);
|
|
2291
2306
|
return g({
|
|
2292
2307
|
queryKey: ["schema", e],
|
|
2293
|
-
queryFn:
|
|
2308
|
+
queryFn: Pn,
|
|
2294
2309
|
staleTime: Infinity,
|
|
2295
2310
|
enabled: e
|
|
2296
2311
|
});
|
|
2297
2312
|
}
|
|
2298
2313
|
//#endregion
|
|
2299
2314
|
//#region src/api/data.ts
|
|
2300
|
-
function
|
|
2315
|
+
function Yn(e, t) {
|
|
2301
2316
|
let n = new URL(`/api/data/${e}`, window.location.origin);
|
|
2302
2317
|
if (t.page && n.searchParams.set("page", String(t.page)), t.per_page && n.searchParams.set("per_page", String(t.per_page)), t.sort && n.searchParams.set("sort", t.sort), t.search && n.searchParams.set("search", t.search), t.filters && t.filters.length > 0 && n.searchParams.set("filters", JSON.stringify(t.filters)), t.include_deleted && n.searchParams.set("include_deleted", "true"), t.expand) for (let e of t.expand) n.searchParams.append("expand", e);
|
|
2303
2318
|
return t.select && t.select.length > 0 && n.searchParams.set("select", t.select.join(",")), t.screen && n.searchParams.set("screen", t.screen), t.preview && n.searchParams.set("preview", "true"), t.count && n.searchParams.set("count", t.count), n.pathname + n.search;
|
|
2304
2319
|
}
|
|
2305
|
-
async function
|
|
2306
|
-
if (
|
|
2307
|
-
let n =
|
|
2320
|
+
async function Xn(e, t = {}, n = {}) {
|
|
2321
|
+
if (lr) {
|
|
2322
|
+
let n = lr(e, t);
|
|
2308
2323
|
if (n !== void 0) return n;
|
|
2309
2324
|
}
|
|
2310
|
-
return J(
|
|
2325
|
+
return J(Yn(e, t), { signal: n.signal });
|
|
2311
2326
|
}
|
|
2312
|
-
async function
|
|
2313
|
-
if (
|
|
2314
|
-
let n =
|
|
2327
|
+
async function Zn(e, t) {
|
|
2328
|
+
if (ur) {
|
|
2329
|
+
let n = ur(e, t);
|
|
2315
2330
|
if (n !== void 0) return n;
|
|
2316
2331
|
}
|
|
2317
2332
|
let n = new URLSearchParams();
|
|
@@ -2319,40 +2334,40 @@ async function Xn(e, t) {
|
|
|
2319
2334
|
else for (let [e, r] of Object.entries(t)) n.set(e, r);
|
|
2320
2335
|
return J(`/api/data/${e}?${n.toString()}`);
|
|
2321
2336
|
}
|
|
2322
|
-
async function
|
|
2323
|
-
return { data: ((await
|
|
2337
|
+
async function Qn(e, t) {
|
|
2338
|
+
return { data: ((await pr(`${e}.__create`, {
|
|
2324
2339
|
entity: e,
|
|
2325
2340
|
fields: t
|
|
2326
2341
|
})).result?.rows ?? [])[0] };
|
|
2327
2342
|
}
|
|
2328
|
-
async function
|
|
2329
|
-
let r = typeof t == "string" ? t :
|
|
2330
|
-
return { data: ((await
|
|
2343
|
+
async function $n(e, t, n) {
|
|
2344
|
+
let r = typeof t == "string" ? t : tr(t);
|
|
2345
|
+
return { data: ((await pr(`${e}.__update`, {
|
|
2331
2346
|
object_ids: [r],
|
|
2332
2347
|
entity: e,
|
|
2333
2348
|
fields: n
|
|
2334
2349
|
})).result?.rows ?? [])[0] };
|
|
2335
2350
|
}
|
|
2336
|
-
async function
|
|
2337
|
-
let n = typeof t == "string" ? t :
|
|
2338
|
-
await
|
|
2351
|
+
async function er(e, t) {
|
|
2352
|
+
let n = typeof t == "string" ? t : tr(t);
|
|
2353
|
+
await pr(`${e}.__delete`, {
|
|
2339
2354
|
object_ids: [n],
|
|
2340
2355
|
entity: e
|
|
2341
2356
|
});
|
|
2342
2357
|
}
|
|
2343
|
-
function
|
|
2358
|
+
function tr(e) {
|
|
2344
2359
|
let t = Object.values(e);
|
|
2345
2360
|
return t.length === 1 ? t[0] : t.join("");
|
|
2346
2361
|
}
|
|
2347
|
-
async function
|
|
2348
|
-
let n = typeof t == "string" ? t :
|
|
2349
|
-
await
|
|
2362
|
+
async function nr(e, t) {
|
|
2363
|
+
let n = typeof t == "string" ? t : tr(t);
|
|
2364
|
+
await pr(`${e}.__restore`, {
|
|
2350
2365
|
object_ids: [n],
|
|
2351
2366
|
entity: e
|
|
2352
2367
|
});
|
|
2353
2368
|
}
|
|
2354
|
-
async function
|
|
2355
|
-
let n = await
|
|
2369
|
+
async function rr(e, t) {
|
|
2370
|
+
let n = await On(`/api/data/${e}/export`, {
|
|
2356
2371
|
method: "POST",
|
|
2357
2372
|
body: JSON.stringify(t)
|
|
2358
2373
|
});
|
|
@@ -2361,7 +2376,7 @@ async function nr(e, t) {
|
|
|
2361
2376
|
filename: n.filename
|
|
2362
2377
|
};
|
|
2363
2378
|
}
|
|
2364
|
-
var
|
|
2379
|
+
var ir = class extends Error {
|
|
2365
2380
|
status;
|
|
2366
2381
|
response;
|
|
2367
2382
|
constructor(e, t) {
|
|
@@ -2369,55 +2384,55 @@ var rr = class extends Error {
|
|
|
2369
2384
|
super(n || "Action failed"), this.name = "ActionBatchError", this.status = e, this.response = t;
|
|
2370
2385
|
}
|
|
2371
2386
|
};
|
|
2372
|
-
function
|
|
2387
|
+
function ar(e) {
|
|
2373
2388
|
if (!e || typeof e != "object") return !1;
|
|
2374
2389
|
let t = e;
|
|
2375
2390
|
return typeof t.status == "string" && Array.isArray(t.errors);
|
|
2376
2391
|
}
|
|
2377
|
-
function
|
|
2392
|
+
function or(e, t) {
|
|
2378
2393
|
let n = { ...e ?? {} };
|
|
2379
2394
|
if ("object_ids" in n) throw Error("handler param \"object_ids\" collides with reserved key");
|
|
2380
2395
|
if ("_ids" in n) throw Error("handler param \"_ids\" is a removed legacy key; use object_ids");
|
|
2381
2396
|
return t !== void 0 && (n.object_ids = t), n;
|
|
2382
2397
|
}
|
|
2383
|
-
var
|
|
2384
|
-
function
|
|
2385
|
-
let t =
|
|
2386
|
-
return
|
|
2387
|
-
}
|
|
2388
|
-
var cr = null, lr = null;
|
|
2389
|
-
function ur(e) {
|
|
2390
|
-
let t = cr;
|
|
2391
|
-
return cr = e, t;
|
|
2398
|
+
var sr = null;
|
|
2399
|
+
function cr(e) {
|
|
2400
|
+
let t = sr;
|
|
2401
|
+
return sr = e, t;
|
|
2392
2402
|
}
|
|
2403
|
+
var lr = null, ur = null;
|
|
2393
2404
|
function dr(e) {
|
|
2394
2405
|
let t = lr;
|
|
2395
2406
|
return lr = e, t;
|
|
2396
2407
|
}
|
|
2397
|
-
|
|
2398
|
-
|
|
2408
|
+
function fr(e) {
|
|
2409
|
+
let t = ur;
|
|
2410
|
+
return ur = e, t;
|
|
2411
|
+
}
|
|
2412
|
+
async function pr(e, t) {
|
|
2413
|
+
if (sr) return sr(e, t);
|
|
2399
2414
|
try {
|
|
2400
2415
|
return await J(`/api/actions/${e}`, {
|
|
2401
2416
|
method: "POST",
|
|
2402
2417
|
body: JSON.stringify(t)
|
|
2403
2418
|
});
|
|
2404
2419
|
} catch (e) {
|
|
2405
|
-
throw e instanceof V &&
|
|
2420
|
+
throw e instanceof V && ar(e.raw) ? new ir(e.status, e.raw) : e;
|
|
2406
2421
|
}
|
|
2407
2422
|
}
|
|
2408
|
-
async function
|
|
2423
|
+
async function mr(e, t) {
|
|
2409
2424
|
let n = new URLSearchParams();
|
|
2410
2425
|
return n.set("ids", t.join(",")), J(`/api/associations/${e}?${n.toString()}`);
|
|
2411
2426
|
}
|
|
2412
2427
|
//#endregion
|
|
2413
2428
|
//#region src/embed/params.ts
|
|
2414
|
-
var
|
|
2415
|
-
hr,
|
|
2429
|
+
var hr = "self", gr = "embed", _r = "parent_origin", vr = "theme", yr = [
|
|
2416
2430
|
gr,
|
|
2417
2431
|
_r,
|
|
2432
|
+
vr,
|
|
2418
2433
|
"nav"
|
|
2419
2434
|
];
|
|
2420
|
-
function
|
|
2435
|
+
function br(e) {
|
|
2421
2436
|
if (!e) return null;
|
|
2422
2437
|
let t;
|
|
2423
2438
|
try {
|
|
@@ -2427,22 +2442,22 @@ function yr(e) {
|
|
|
2427
2442
|
}
|
|
2428
2443
|
return t.origin === "null" ? null : e === t.origin ? t.origin : null;
|
|
2429
2444
|
}
|
|
2430
|
-
function br(e) {
|
|
2431
|
-
return e === "light" || e === "dark" ? e : null;
|
|
2432
|
-
}
|
|
2433
2445
|
function xr(e) {
|
|
2434
|
-
return e === "
|
|
2446
|
+
return e === "light" || e === "dark" ? e : null;
|
|
2435
2447
|
}
|
|
2436
2448
|
function Sr(e) {
|
|
2449
|
+
return e === "delegated" ? "delegated" : hr;
|
|
2450
|
+
}
|
|
2451
|
+
function Cr(e) {
|
|
2437
2452
|
let t = typeof e == "string" ? new URLSearchParams(e) : e;
|
|
2438
2453
|
return {
|
|
2439
|
-
enabled: t.get(
|
|
2440
|
-
parentOrigin:
|
|
2441
|
-
theme:
|
|
2442
|
-
navigationMode:
|
|
2454
|
+
enabled: t.get(gr) === "1",
|
|
2455
|
+
parentOrigin: br(t.get(_r)),
|
|
2456
|
+
theme: xr(t.get(vr)),
|
|
2457
|
+
navigationMode: Sr(t.get("nav"))
|
|
2443
2458
|
};
|
|
2444
2459
|
}
|
|
2445
|
-
function
|
|
2460
|
+
function wr(e, t) {
|
|
2446
2461
|
if (!t.enabled) return e;
|
|
2447
2462
|
let n = /^[a-z][a-z0-9+.-]*:/i.test(e), r;
|
|
2448
2463
|
try {
|
|
@@ -2451,46 +2466,46 @@ function Cr(e, t) {
|
|
|
2451
2466
|
return e;
|
|
2452
2467
|
}
|
|
2453
2468
|
let i = r.searchParams;
|
|
2454
|
-
return t.enabled && i.set(
|
|
2469
|
+
return t.enabled && i.set(gr, "1"), t.parentOrigin && i.set(_r, t.parentOrigin), t.theme && i.set(vr, t.theme), i.set("nav", t.navigationMode), n ? r.toString() : `${r.pathname}${r.search}${r.hash}`;
|
|
2455
2470
|
}
|
|
2456
2471
|
//#endregion
|
|
2457
2472
|
//#region src/embed/EmbedContext.tsx
|
|
2458
|
-
var
|
|
2473
|
+
var Tr = i({
|
|
2459
2474
|
enabled: !1,
|
|
2460
2475
|
parentOrigin: null,
|
|
2461
2476
|
theme: null,
|
|
2462
2477
|
navigationMode: "self",
|
|
2463
2478
|
appendEmbedParams: (e) => e
|
|
2464
2479
|
});
|
|
2465
|
-
function
|
|
2480
|
+
function Er(e) {
|
|
2466
2481
|
return {
|
|
2467
2482
|
enabled: e.enabled,
|
|
2468
2483
|
parentOrigin: e.parentOrigin,
|
|
2469
2484
|
theme: e.theme,
|
|
2470
2485
|
navigationMode: e.navigationMode,
|
|
2471
|
-
appendEmbedParams: (t) =>
|
|
2486
|
+
appendEmbedParams: (t) => wr(t, e)
|
|
2472
2487
|
};
|
|
2473
2488
|
}
|
|
2474
|
-
function
|
|
2475
|
-
let n = d(() =>
|
|
2489
|
+
function Dr({ children: e, query: t }) {
|
|
2490
|
+
let n = d(() => Er(Cr(t ?? (typeof window < "u" ? window.location.search : ""))), [t]);
|
|
2476
2491
|
return l(() => {
|
|
2477
2492
|
ce(n.enabled);
|
|
2478
|
-
}, [n.enabled]), /* @__PURE__ */ b(
|
|
2493
|
+
}, [n.enabled]), /* @__PURE__ */ b(Tr.Provider, {
|
|
2479
2494
|
value: n,
|
|
2480
2495
|
children: e
|
|
2481
2496
|
});
|
|
2482
2497
|
}
|
|
2483
|
-
function
|
|
2484
|
-
return c(
|
|
2498
|
+
function Or() {
|
|
2499
|
+
return c(Tr);
|
|
2485
2500
|
}
|
|
2486
2501
|
//#endregion
|
|
2487
2502
|
//#region src/embed/embed-dirty.ts
|
|
2488
|
-
var
|
|
2503
|
+
var kr = E((e) => ({
|
|
2489
2504
|
isDirty: !1,
|
|
2490
2505
|
setDirty: (t) => e((e) => e.isDirty === t ? e : { isDirty: t })
|
|
2491
2506
|
}));
|
|
2492
|
-
function
|
|
2493
|
-
let n =
|
|
2507
|
+
function Ar(e, t) {
|
|
2508
|
+
let n = kr((e) => e.setDirty);
|
|
2494
2509
|
l(() => {
|
|
2495
2510
|
t && n(e);
|
|
2496
2511
|
}, [
|
|
@@ -2503,7 +2518,7 @@ function kr(e, t) {
|
|
|
2503
2518
|
}
|
|
2504
2519
|
//#endregion
|
|
2505
2520
|
//#region src/embed/embed-nav-guard.ts
|
|
2506
|
-
var
|
|
2521
|
+
var jr = E((e, t) => ({
|
|
2507
2522
|
pendingNavigation: null,
|
|
2508
2523
|
requestNavigation: (t) => e({ pendingNavigation: t }),
|
|
2509
2524
|
confirmNavigation: () => {
|
|
@@ -2514,21 +2529,23 @@ var Ar = E((e, t) => ({
|
|
|
2514
2529
|
}));
|
|
2515
2530
|
//#endregion
|
|
2516
2531
|
//#region src/embed/screen-location.ts
|
|
2517
|
-
function
|
|
2532
|
+
function Mr(e) {
|
|
2518
2533
|
let t = e.replace(/\/+$/, "").split("/").map((e) => e.startsWith(":") ? "[^/]+" : e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
2519
2534
|
return RegExp("^" + t.join("/") + "$");
|
|
2520
2535
|
}
|
|
2521
|
-
function
|
|
2536
|
+
function Nr(e, t) {
|
|
2522
2537
|
let n = e.replace(/\/+$/, "") || "/";
|
|
2523
2538
|
if (!t) return {
|
|
2524
2539
|
matched: !1,
|
|
2525
2540
|
payload: { route: e }
|
|
2526
2541
|
};
|
|
2527
2542
|
let r, i, a, o;
|
|
2528
|
-
for (let [e, s] of Object.entries(t)) if (s.route &&
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2543
|
+
for (let [e, s] of Object.entries(t)) if (s.route && Mr(s.route).test(n)) {
|
|
2544
|
+
if (s.route.includes("/:")) a || (a = s, o = e);
|
|
2545
|
+
else {
|
|
2546
|
+
r = s, i = e;
|
|
2547
|
+
break;
|
|
2548
|
+
}
|
|
2532
2549
|
}
|
|
2533
2550
|
let s = r ?? a, c = r ? i : o;
|
|
2534
2551
|
if (!s || !c) return {
|
|
@@ -2550,34 +2567,34 @@ function Mr(e, t) {
|
|
|
2550
2567
|
payload: l
|
|
2551
2568
|
};
|
|
2552
2569
|
}
|
|
2553
|
-
function
|
|
2554
|
-
return
|
|
2570
|
+
function Pr(e, t) {
|
|
2571
|
+
return Nr(e, t).payload;
|
|
2555
2572
|
}
|
|
2556
2573
|
//#endregion
|
|
2557
2574
|
//#region src/embed/useEmbedNavigate.ts
|
|
2558
|
-
function
|
|
2575
|
+
function Fr(e) {
|
|
2559
2576
|
let t = e.search(/[?#]/);
|
|
2560
2577
|
return t === -1 ? e : e.slice(0, t);
|
|
2561
2578
|
}
|
|
2562
|
-
function
|
|
2563
|
-
let e = h(), t = m(), n =
|
|
2579
|
+
function Ir() {
|
|
2580
|
+
let e = h(), t = m(), n = Or(), { data: r } = X();
|
|
2564
2581
|
return s((i, a) => {
|
|
2565
2582
|
if (!n.enabled) return e(i, a), !0;
|
|
2566
|
-
let o = r?.screens, s =
|
|
2567
|
-
if (o && !s.matched) return
|
|
2568
|
-
route:
|
|
2583
|
+
let o = r?.screens, s = Nr(Fr(i), o), c = kr.getState().isDirty && Fr(i) !== t.pathname;
|
|
2584
|
+
if (o && !s.matched) return wt(n.parentOrigin, Ct.navigationFailed, {
|
|
2585
|
+
route: Fr(i),
|
|
2569
2586
|
reason: "unresolved"
|
|
2570
2587
|
}), !1;
|
|
2571
2588
|
if (n.navigationMode === "delegated") {
|
|
2572
2589
|
let e = () => {
|
|
2573
|
-
|
|
2590
|
+
wt(n.parentOrigin, Ct.navigationRequested, s.payload);
|
|
2574
2591
|
};
|
|
2575
|
-
return c ? (
|
|
2592
|
+
return c ? (jr.getState().requestNavigation(e), !1) : (e(), !1);
|
|
2576
2593
|
}
|
|
2577
2594
|
let l = () => {
|
|
2578
2595
|
e(n.appendEmbedParams(i), a);
|
|
2579
2596
|
};
|
|
2580
|
-
return c ? (
|
|
2597
|
+
return c ? (jr.getState().requestNavigation(l), !1) : (l(), !0);
|
|
2581
2598
|
}, [
|
|
2582
2599
|
e,
|
|
2583
2600
|
t.pathname,
|
|
@@ -2585,29 +2602,29 @@ function Fr() {
|
|
|
2585
2602
|
r?.screens
|
|
2586
2603
|
]);
|
|
2587
2604
|
}
|
|
2588
|
-
function
|
|
2589
|
-
let e =
|
|
2605
|
+
function Lr() {
|
|
2606
|
+
let e = Ir();
|
|
2590
2607
|
return s((t, n) => {
|
|
2591
2608
|
e(t, n);
|
|
2592
2609
|
}, [e]);
|
|
2593
2610
|
}
|
|
2594
|
-
function
|
|
2611
|
+
function Rr() {
|
|
2595
2612
|
let e = h();
|
|
2596
2613
|
return s(() => {
|
|
2597
2614
|
let t = () => {
|
|
2598
2615
|
e(-1);
|
|
2599
2616
|
};
|
|
2600
|
-
if (
|
|
2601
|
-
|
|
2617
|
+
if (kr.getState().isDirty) {
|
|
2618
|
+
jr.getState().requestNavigation(t);
|
|
2602
2619
|
return;
|
|
2603
2620
|
}
|
|
2604
2621
|
t();
|
|
2605
2622
|
}, [e]);
|
|
2606
2623
|
}
|
|
2607
|
-
function
|
|
2608
|
-
let e =
|
|
2624
|
+
function zr() {
|
|
2625
|
+
let e = Or();
|
|
2609
2626
|
return s((t, n) => {
|
|
2610
|
-
e.enabled &&
|
|
2627
|
+
e.enabled && wt(e.parentOrigin, Ct.navigationFailed, {
|
|
2611
2628
|
route: t,
|
|
2612
2629
|
reason: n
|
|
2613
2630
|
});
|
|
@@ -2615,7 +2632,7 @@ function Rr() {
|
|
|
2615
2632
|
}
|
|
2616
2633
|
//#endregion
|
|
2617
2634
|
//#region src/components/shared/toast/DeclarionToast.tsx
|
|
2618
|
-
var
|
|
2635
|
+
var Br = {
|
|
2619
2636
|
success: {
|
|
2620
2637
|
tone: "success",
|
|
2621
2638
|
defaultTitle: "Success"
|
|
@@ -2636,23 +2653,25 @@ var zr = {
|
|
|
2636
2653
|
tone: "info",
|
|
2637
2654
|
defaultTitle: "Working…"
|
|
2638
2655
|
}
|
|
2639
|
-
},
|
|
2640
|
-
function
|
|
2656
|
+
}, Vr = 200;
|
|
2657
|
+
function Hr({ type: e }) {
|
|
2641
2658
|
let n = { display: "flex" };
|
|
2642
|
-
|
|
2659
|
+
if (e === "loading") return /* @__PURE__ */ b("span", {
|
|
2643
2660
|
style: {
|
|
2644
2661
|
...n,
|
|
2645
2662
|
animation: "dz-toast-spin 0.9s linear infinite"
|
|
2646
2663
|
},
|
|
2647
2664
|
children: /* @__PURE__ */ b(t.loader, { size: 11 })
|
|
2648
|
-
})
|
|
2665
|
+
});
|
|
2666
|
+
let r = e === "success" ? t.check : e === "error" ? t.x : e === "warning" ? t.warning : t.info;
|
|
2667
|
+
return /* @__PURE__ */ b("span", {
|
|
2649
2668
|
style: n,
|
|
2650
|
-
children: /* @__PURE__ */ b(
|
|
2669
|
+
children: /* @__PURE__ */ b(r, { size: 11 })
|
|
2651
2670
|
});
|
|
2652
2671
|
}
|
|
2653
|
-
function
|
|
2654
|
-
let r =
|
|
2655
|
-
S.current || (S.current = !0, g(!0), window.setTimeout(n,
|
|
2672
|
+
function Ur({ model: e, onClose: n }) {
|
|
2673
|
+
let r = Br[e.type] ?? Br.info, i = r.tone, [a, o] = p(!1), [c, u] = p(!1), [d, m] = p(!1), [h, g] = p(!1), [_, v] = p(1), y = f(e.duration), S = f(!1), C = !e.sticky && e.duration > 0, w = s(() => {
|
|
2674
|
+
S.current || (S.current = !0, g(!0), window.setTimeout(n, Vr));
|
|
2656
2675
|
}, [n]);
|
|
2657
2676
|
l(() => {
|
|
2658
2677
|
y.current = e.duration, v(1);
|
|
@@ -2701,7 +2720,7 @@ function Hr({ model: e, onClose: n }) {
|
|
|
2701
2720
|
boxShadow: "var(--shadow-toast)",
|
|
2702
2721
|
overflow: "hidden",
|
|
2703
2722
|
position: "relative",
|
|
2704
|
-
animation: h ? `dz-toast-out ${
|
|
2723
|
+
animation: h ? `dz-toast-out ${Vr}ms ease-in forwards` : "dz-toast-in 0.24s cubic-bezier(0.16, 1, 0.3, 1)"
|
|
2705
2724
|
},
|
|
2706
2725
|
children: [/* @__PURE__ */ x("div", {
|
|
2707
2726
|
style: {
|
|
@@ -2723,7 +2742,7 @@ function Hr({ model: e, onClose: n }) {
|
|
|
2723
2742
|
justifyContent: "center",
|
|
2724
2743
|
color: E("")
|
|
2725
2744
|
},
|
|
2726
|
-
children: /* @__PURE__ */ b(
|
|
2745
|
+
children: /* @__PURE__ */ b(Hr, { type: e.type })
|
|
2727
2746
|
}),
|
|
2728
2747
|
/* @__PURE__ */ x("div", {
|
|
2729
2748
|
style: {
|
|
@@ -2916,40 +2935,40 @@ function Hr({ model: e, onClose: n }) {
|
|
|
2916
2935
|
}
|
|
2917
2936
|
//#endregion
|
|
2918
2937
|
//#region src/lib/toast.tsx
|
|
2919
|
-
var
|
|
2938
|
+
var Wr = {
|
|
2920
2939
|
success: 4e3,
|
|
2921
2940
|
info: 6e3,
|
|
2922
2941
|
warning: 8e3,
|
|
2923
2942
|
error: 0,
|
|
2924
2943
|
loading: 0
|
|
2925
|
-
},
|
|
2926
|
-
function
|
|
2927
|
-
v.custom(() => /* @__PURE__ */ b(
|
|
2944
|
+
}, Gr = /* @__PURE__ */ new Map(), Kr = /* @__PURE__ */ new Map(), qr = 0, Jr = () => `dz-${++qr}`;
|
|
2945
|
+
function Yr(e) {
|
|
2946
|
+
v.custom(() => /* @__PURE__ */ b(Ur, {
|
|
2928
2947
|
model: e,
|
|
2929
2948
|
onClose: () => v.dismiss(e.id)
|
|
2930
2949
|
}), {
|
|
2931
2950
|
id: e.id,
|
|
2932
2951
|
duration: Infinity,
|
|
2933
2952
|
onDismiss: () => {
|
|
2934
|
-
|
|
2953
|
+
Gr.delete(String(e.id)), e.group && Kr.get(e.group) === e.id && Kr.delete(e.group);
|
|
2935
2954
|
}
|
|
2936
2955
|
});
|
|
2937
2956
|
}
|
|
2938
|
-
function
|
|
2957
|
+
function Xr(e, t, n, r = {}) {
|
|
2939
2958
|
if (r.group) {
|
|
2940
|
-
let e =
|
|
2941
|
-
if (e &&
|
|
2942
|
-
let r =
|
|
2959
|
+
let e = Kr.get(r.group);
|
|
2960
|
+
if (e && Gr.has(e)) {
|
|
2961
|
+
let r = Gr.get(e), i = {
|
|
2943
2962
|
...r,
|
|
2944
2963
|
title: t,
|
|
2945
2964
|
message: n,
|
|
2946
2965
|
count: (r.count ?? 1) + 1,
|
|
2947
2966
|
createdAt: Date.now()
|
|
2948
2967
|
};
|
|
2949
|
-
return
|
|
2968
|
+
return Gr.set(e, i), Yr(i), e;
|
|
2950
2969
|
}
|
|
2951
2970
|
}
|
|
2952
|
-
let i = r.id ??
|
|
2971
|
+
let i = r.id ?? Jr(), a = r.duration ?? Wr[e], o = {
|
|
2953
2972
|
id: i,
|
|
2954
2973
|
type: e,
|
|
2955
2974
|
title: t,
|
|
@@ -2963,12 +2982,12 @@ function Yr(e, t, n, r = {}) {
|
|
|
2963
2982
|
createdAt: Date.now(),
|
|
2964
2983
|
group: r.group
|
|
2965
2984
|
};
|
|
2966
|
-
return
|
|
2985
|
+
return Gr.set(i, o), r.group && Kr.set(r.group, i), Yr(o), i;
|
|
2967
2986
|
}
|
|
2968
|
-
function
|
|
2969
|
-
let n =
|
|
2987
|
+
function Zr(e, t) {
|
|
2988
|
+
let n = Gr.get(e);
|
|
2970
2989
|
if (!n) return;
|
|
2971
|
-
let r = t.type ?? n.type, i = t.duration ?? (t.type ?
|
|
2990
|
+
let r = t.type ?? n.type, i = t.duration ?? (t.type ? Wr[r] : n.duration), a = {
|
|
2972
2991
|
...n,
|
|
2973
2992
|
...t,
|
|
2974
2993
|
type: r,
|
|
@@ -2976,48 +2995,48 @@ function Xr(e, t) {
|
|
|
2976
2995
|
sticky: t.sticky ?? i === 0,
|
|
2977
2996
|
createdAt: Date.now()
|
|
2978
2997
|
};
|
|
2979
|
-
|
|
2998
|
+
Gr.set(e, a), Yr(a);
|
|
2980
2999
|
}
|
|
2981
3000
|
var Z = {
|
|
2982
|
-
success: (e, t, n) =>
|
|
2983
|
-
info: (e, t, n) =>
|
|
2984
|
-
warning: (e, t, n) =>
|
|
2985
|
-
error: (e, t, n) =>
|
|
2986
|
-
loading: (e, t, n) =>
|
|
2987
|
-
update:
|
|
3001
|
+
success: (e, t, n) => Xr("success", e, t, n),
|
|
3002
|
+
info: (e, t, n) => Xr("info", e, t, n),
|
|
3003
|
+
warning: (e, t, n) => Xr("warning", e, t, n),
|
|
3004
|
+
error: (e, t, n) => Xr("error", e, t, n),
|
|
3005
|
+
loading: (e, t, n) => Xr("loading", e, t, n),
|
|
3006
|
+
update: Zr,
|
|
2988
3007
|
dismiss: (e) => v.dismiss(e),
|
|
2989
3008
|
dismissAll: () => v.dismiss()
|
|
2990
|
-
},
|
|
2991
|
-
function
|
|
3009
|
+
}, Qr = o(() => import("./MarkdownRenderer-C6bhrAIe.js").then((e) => ({ default: e.MarkdownRenderer })));
|
|
3010
|
+
function $r() {
|
|
2992
3011
|
return /* @__PURE__ */ b("div", { className: "h-4 w-2/3 rounded bg-muted animate-pulse" });
|
|
2993
3012
|
}
|
|
2994
|
-
function
|
|
3013
|
+
function ei(e) {
|
|
2995
3014
|
return /* @__PURE__ */ b(r, {
|
|
2996
|
-
fallback: /* @__PURE__ */ b(
|
|
2997
|
-
children: /* @__PURE__ */ b(
|
|
3015
|
+
fallback: /* @__PURE__ */ b($r, {}),
|
|
3016
|
+
children: /* @__PURE__ */ b(Qr, { ...e })
|
|
2998
3017
|
});
|
|
2999
3018
|
}
|
|
3000
3019
|
//#endregion
|
|
3001
3020
|
//#region src/lib/safe-url.ts
|
|
3002
|
-
var
|
|
3021
|
+
var ti = [
|
|
3003
3022
|
"http:",
|
|
3004
3023
|
"https:",
|
|
3005
3024
|
"mailto:"
|
|
3006
|
-
],
|
|
3007
|
-
function
|
|
3025
|
+
], ni = /[\u0000-\u001f\u007f]/g;
|
|
3026
|
+
function ri(e) {
|
|
3008
3027
|
if (!e) return;
|
|
3009
3028
|
let t = e.trim();
|
|
3010
3029
|
if (!t) return;
|
|
3011
|
-
let n = t.replace(
|
|
3030
|
+
let n = t.replace(ni, "");
|
|
3012
3031
|
if (!n || n.startsWith("//")) return;
|
|
3013
3032
|
let r = n.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):/);
|
|
3014
3033
|
if (r) {
|
|
3015
3034
|
let e = r[1].toLowerCase() + ":";
|
|
3016
|
-
if (!
|
|
3035
|
+
if (!ti.includes(e)) return;
|
|
3017
3036
|
}
|
|
3018
3037
|
return n;
|
|
3019
3038
|
}
|
|
3020
|
-
function
|
|
3039
|
+
function ii(e) {
|
|
3021
3040
|
if (!e) return !1;
|
|
3022
3041
|
if (e.startsWith("//")) return !0;
|
|
3023
3042
|
let t = typeof window < "u" ? window.location.href : "http://localhost/", n;
|
|
@@ -3032,27 +3051,27 @@ function ri(e) {
|
|
|
3032
3051
|
}
|
|
3033
3052
|
//#endregion
|
|
3034
3053
|
//#region src/lib/download.ts
|
|
3035
|
-
var
|
|
3054
|
+
var ai = class extends Error {
|
|
3036
3055
|
code;
|
|
3037
3056
|
constructor(e, t) {
|
|
3038
3057
|
super(e), this.code = t, this.name = "DownloadError";
|
|
3039
3058
|
}
|
|
3040
3059
|
};
|
|
3041
|
-
function
|
|
3042
|
-
return e instanceof
|
|
3060
|
+
function oi(e) {
|
|
3061
|
+
return e instanceof ai && e.code === "FILE_NOT_FOUND";
|
|
3043
3062
|
}
|
|
3044
|
-
async function
|
|
3045
|
-
let n =
|
|
3046
|
-
if (!n) throw new
|
|
3063
|
+
async function si(e, t) {
|
|
3064
|
+
let n = ri(e);
|
|
3065
|
+
if (!n) throw new ai(`Refused to download from an unsafe URL: ${e}`);
|
|
3047
3066
|
let r = await fetch(n, { credentials: "same-origin" });
|
|
3048
3067
|
if (!r.ok) {
|
|
3049
|
-
let e = await
|
|
3050
|
-
throw new
|
|
3068
|
+
let e = await ci(r);
|
|
3069
|
+
throw new ai(e.message || `Download failed (${r.status})`, e.code);
|
|
3051
3070
|
}
|
|
3052
3071
|
let i = await r.blob(), a = URL.createObjectURL(i), o = document.createElement("a");
|
|
3053
3072
|
o.href = a, t && (o.download = t), document.body.appendChild(o), o.click(), o.remove(), URL.revokeObjectURL(a);
|
|
3054
3073
|
}
|
|
3055
|
-
async function
|
|
3074
|
+
async function ci(e) {
|
|
3056
3075
|
let t = await e.text();
|
|
3057
3076
|
if (!t) return {};
|
|
3058
3077
|
try {
|
|
@@ -3070,10 +3089,10 @@ async function si(e) {
|
|
|
3070
3089
|
}
|
|
3071
3090
|
//#endregion
|
|
3072
3091
|
//#region src/types/fieldType.ts
|
|
3073
|
-
var
|
|
3092
|
+
var li = /* @__PURE__ */ "bool.bytes.date.decimal.email.enum.float.int.int_array.json.multilang.multilang_text.password.phone.ref.rich_text.secret.string.string_array.structure.tags.text.time.timestamp.url.uuid.uuid_array".split(".");
|
|
3074
3093
|
//#endregion
|
|
3075
3094
|
//#region src/components/shared/CopyButton.tsx
|
|
3076
|
-
function
|
|
3095
|
+
function ui({ value: e, title: n, size: r = "icon" }) {
|
|
3077
3096
|
let [i, a] = p(!1), o = s(async (t) => {
|
|
3078
3097
|
t.stopPropagation(), t.preventDefault();
|
|
3079
3098
|
try {
|
|
@@ -3092,9 +3111,9 @@ function li({ value: e, title: n, size: r = "icon" }) {
|
|
|
3092
3111
|
}
|
|
3093
3112
|
//#endregion
|
|
3094
3113
|
//#region src/components/fields/StringField.tsx
|
|
3095
|
-
function
|
|
3114
|
+
function di({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
|
|
3096
3115
|
if (r === "display") {
|
|
3097
|
-
let t =
|
|
3116
|
+
let t = R(n);
|
|
3098
3117
|
return e.copyable && t ? /* @__PURE__ */ x("span", {
|
|
3099
3118
|
style: {
|
|
3100
3119
|
display: "inline-flex",
|
|
@@ -3104,7 +3123,7 @@ function ui({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3104
3123
|
children: [/* @__PURE__ */ b("span", {
|
|
3105
3124
|
style: { fontSize: 12.5 },
|
|
3106
3125
|
children: t
|
|
3107
|
-
}), /* @__PURE__ */ b(
|
|
3126
|
+
}), /* @__PURE__ */ b(ui, {
|
|
3108
3127
|
value: t,
|
|
3109
3128
|
size: "sm"
|
|
3110
3129
|
})]
|
|
@@ -3120,16 +3139,16 @@ function ui({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3120
3139
|
id: a,
|
|
3121
3140
|
name: t,
|
|
3122
3141
|
"aria-required": e.required || void 0,
|
|
3123
|
-
value:
|
|
3142
|
+
value: R(n),
|
|
3124
3143
|
onChange: (e) => i?.(e)
|
|
3125
3144
|
});
|
|
3126
3145
|
}
|
|
3127
3146
|
//#endregion
|
|
3128
3147
|
//#region src/components/fields/TextField.tsx
|
|
3129
|
-
function
|
|
3148
|
+
function fi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, compact: o, fieldId: s }) {
|
|
3130
3149
|
let c = e.display?.widget;
|
|
3131
3150
|
if (r === "display") {
|
|
3132
|
-
let t =
|
|
3151
|
+
let t = R(n);
|
|
3133
3152
|
if (!t) return /* @__PURE__ */ b("span", {
|
|
3134
3153
|
style: {
|
|
3135
3154
|
fontSize: 12.5,
|
|
@@ -3137,7 +3156,7 @@ function di({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
|
|
|
3137
3156
|
},
|
|
3138
3157
|
children: "—"
|
|
3139
3158
|
});
|
|
3140
|
-
let r = c === "markdown" ? /* @__PURE__ */ b(
|
|
3159
|
+
let r = c === "markdown" ? /* @__PURE__ */ b(ei, { content: t }) : c === "code" ? /* @__PURE__ */ b("pre", {
|
|
3141
3160
|
className: "mono",
|
|
3142
3161
|
style: {
|
|
3143
3162
|
fontSize: 12,
|
|
@@ -3169,7 +3188,7 @@ function di({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
|
|
|
3169
3188
|
top: 0,
|
|
3170
3189
|
right: 0
|
|
3171
3190
|
},
|
|
3172
|
-
children: /* @__PURE__ */ b(
|
|
3191
|
+
children: /* @__PURE__ */ b(ui, {
|
|
3173
3192
|
value: t,
|
|
3174
3193
|
size: "sm"
|
|
3175
3194
|
})
|
|
@@ -3180,7 +3199,7 @@ function di({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
|
|
|
3180
3199
|
id: s,
|
|
3181
3200
|
name: t,
|
|
3182
3201
|
"aria-required": e.required || void 0,
|
|
3183
|
-
value:
|
|
3202
|
+
value: R(n),
|
|
3184
3203
|
onChange: (e) => i?.(e)
|
|
3185
3204
|
});
|
|
3186
3205
|
let l = c === "markdown" || c === "code" ? 10 : 4;
|
|
@@ -3188,7 +3207,7 @@ function di({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
|
|
|
3188
3207
|
id: s,
|
|
3189
3208
|
name: t,
|
|
3190
3209
|
ariaRequired: e.required,
|
|
3191
|
-
value:
|
|
3210
|
+
value: R(n),
|
|
3192
3211
|
onChange: (e) => i?.(e),
|
|
3193
3212
|
rows: l,
|
|
3194
3213
|
fill: a
|
|
@@ -3196,13 +3215,13 @@ function di({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
|
|
|
3196
3215
|
}
|
|
3197
3216
|
//#endregion
|
|
3198
3217
|
//#region src/components/fields/EnumField.tsx
|
|
3199
|
-
var
|
|
3200
|
-
function
|
|
3218
|
+
var pi = "__declarion_enum_null__";
|
|
3219
|
+
function mi({ field: e, value: t, mode: n, onChange: r, fieldId: i, labelId: a }) {
|
|
3201
3220
|
let o = e.values ?? [], s = o.find((e) => e.code === t);
|
|
3202
3221
|
if (n === "display") return s ? /* @__PURE__ */ b(k, {
|
|
3203
3222
|
tone: s.color ?? "slate",
|
|
3204
3223
|
size: "xs",
|
|
3205
|
-
children:
|
|
3224
|
+
children: z(s.name)
|
|
3206
3225
|
}) : /* @__PURE__ */ b("span", {
|
|
3207
3226
|
style: {
|
|
3208
3227
|
fontSize: 12.5,
|
|
@@ -3210,12 +3229,12 @@ function pi({ field: e, value: t, mode: n, onChange: r, fieldId: i, labelId: a }
|
|
|
3210
3229
|
},
|
|
3211
3230
|
children: "—"
|
|
3212
3231
|
});
|
|
3213
|
-
let c = !e.required, l = t != null && t !== "" ?
|
|
3214
|
-
value:
|
|
3232
|
+
let c = !e.required, l = t != null && t !== "" ? R(t) : pi, u = [...c ? [{
|
|
3233
|
+
value: pi,
|
|
3215
3234
|
label: "— None —"
|
|
3216
3235
|
}] : [], ...o.map((e) => ({
|
|
3217
3236
|
value: e.code,
|
|
3218
|
-
label:
|
|
3237
|
+
label: z(e.name) || e.code
|
|
3219
3238
|
}))];
|
|
3220
3239
|
return /* @__PURE__ */ b(I, {
|
|
3221
3240
|
id: i,
|
|
@@ -3223,67 +3242,67 @@ function pi({ field: e, value: t, mode: n, onChange: r, fieldId: i, labelId: a }
|
|
|
3223
3242
|
"aria-required": e.required || void 0,
|
|
3224
3243
|
value: l,
|
|
3225
3244
|
options: u,
|
|
3226
|
-
onChange: (e) => r?.(e ===
|
|
3245
|
+
onChange: (e) => r?.(e === pi ? null : e),
|
|
3227
3246
|
placeholder: "Select…"
|
|
3228
3247
|
});
|
|
3229
3248
|
}
|
|
3230
3249
|
//#endregion
|
|
3231
3250
|
//#region src/components/fields/EmailField.tsx
|
|
3232
|
-
function
|
|
3251
|
+
function hi({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
|
|
3233
3252
|
return /* @__PURE__ */ b(F, {
|
|
3234
3253
|
id: i,
|
|
3235
3254
|
name: t,
|
|
3236
3255
|
"aria-required": e.required || void 0,
|
|
3237
3256
|
type: "email",
|
|
3238
|
-
value:
|
|
3257
|
+
value: R(n),
|
|
3239
3258
|
onChange: (e) => r?.(e)
|
|
3240
3259
|
});
|
|
3241
3260
|
}
|
|
3242
3261
|
//#endregion
|
|
3243
3262
|
//#region src/components/fields/UrlField.tsx
|
|
3244
|
-
function
|
|
3263
|
+
function gi({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
|
|
3245
3264
|
return /* @__PURE__ */ b(F, {
|
|
3246
3265
|
id: i,
|
|
3247
3266
|
name: t,
|
|
3248
3267
|
"aria-required": e.required || void 0,
|
|
3249
3268
|
type: "url",
|
|
3250
|
-
value:
|
|
3269
|
+
value: R(n),
|
|
3251
3270
|
onChange: (e) => r?.(e),
|
|
3252
3271
|
placeholder: "https://"
|
|
3253
3272
|
});
|
|
3254
3273
|
}
|
|
3255
3274
|
//#endregion
|
|
3256
3275
|
//#region src/components/fields/PhoneField.tsx
|
|
3257
|
-
function
|
|
3276
|
+
function _i({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
|
|
3258
3277
|
return /* @__PURE__ */ b(F, {
|
|
3259
3278
|
id: i,
|
|
3260
3279
|
name: t,
|
|
3261
3280
|
"aria-required": e.required || void 0,
|
|
3262
3281
|
type: "tel",
|
|
3263
|
-
value:
|
|
3282
|
+
value: R(n),
|
|
3264
3283
|
onChange: (e) => r?.(e),
|
|
3265
3284
|
placeholder: "+1 555 555 5555"
|
|
3266
3285
|
});
|
|
3267
3286
|
}
|
|
3268
3287
|
//#endregion
|
|
3269
3288
|
//#region src/components/fields/TimestampField.tsx
|
|
3270
|
-
var
|
|
3289
|
+
var vi = {
|
|
3271
3290
|
year: "numeric",
|
|
3272
3291
|
month: "short",
|
|
3273
3292
|
day: "numeric"
|
|
3274
|
-
},
|
|
3275
|
-
...
|
|
3293
|
+
}, yi = {
|
|
3294
|
+
...vi,
|
|
3276
3295
|
hour: "2-digit",
|
|
3277
3296
|
minute: "2-digit"
|
|
3278
3297
|
};
|
|
3279
|
-
function
|
|
3298
|
+
function bi(e, t) {
|
|
3280
3299
|
if (t) {
|
|
3281
3300
|
let t = /* @__PURE__ */ new Date(e + "T00:00:00");
|
|
3282
|
-
return isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(void 0,
|
|
3301
|
+
return isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(void 0, vi).format(t);
|
|
3283
3302
|
}
|
|
3284
|
-
return
|
|
3303
|
+
return Be(e, yi);
|
|
3285
3304
|
}
|
|
3286
|
-
function
|
|
3305
|
+
function xi(e, t) {
|
|
3287
3306
|
if (t) {
|
|
3288
3307
|
let t = /* @__PURE__ */ new Date(e + "T00:00:00");
|
|
3289
3308
|
return isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(void 0, {
|
|
@@ -3301,14 +3320,14 @@ function bi(e, t) {
|
|
|
3301
3320
|
minute: "2-digit"
|
|
3302
3321
|
}).format(n);
|
|
3303
3322
|
}
|
|
3304
|
-
function
|
|
3323
|
+
function Si(e) {
|
|
3305
3324
|
if (e.endsWith("Z")) return "UTC";
|
|
3306
3325
|
let t = e.match(/([+-]\d{2}:\d{2})$/);
|
|
3307
3326
|
if (!t) return null;
|
|
3308
3327
|
let n = t[1].charAt(0), r = parseInt(t[1].substring(1, 3), 10), i = parseInt(t[1].substring(4, 6), 10);
|
|
3309
3328
|
return r === 0 && i === 0 ? "UTC" : `UTC${n}${r}${i > 0 ? `:${String(i).padStart(2, "0")}` : ""}`;
|
|
3310
3329
|
}
|
|
3311
|
-
function
|
|
3330
|
+
function Ci(e, t) {
|
|
3312
3331
|
let n = e.match(/([+-]\d{2}:\d{2})$/), r = e.endsWith("Z"), i = new Date(e);
|
|
3313
3332
|
if (isNaN(i.getTime())) return "";
|
|
3314
3333
|
if (r) {
|
|
@@ -3321,13 +3340,13 @@ function Si(e, t) {
|
|
|
3321
3340
|
}
|
|
3322
3341
|
return t ? e.slice(0, 10) : e.slice(0, 16);
|
|
3323
3342
|
}
|
|
3324
|
-
function
|
|
3343
|
+
function wi(e, t) {
|
|
3325
3344
|
let n = new Date(e);
|
|
3326
3345
|
if (isNaN(n.getTime())) return "";
|
|
3327
3346
|
let r = n.getFullYear(), i = String(n.getMonth() + 1).padStart(2, "0"), a = String(n.getDate()).padStart(2, "0");
|
|
3328
3347
|
return t ? `${r}-${i}-${a}` : `${r}-${i}-${a}T${String(n.getHours()).padStart(2, "0")}:${String(n.getMinutes()).padStart(2, "0")}`;
|
|
3329
3348
|
}
|
|
3330
|
-
function
|
|
3349
|
+
function Ti({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
|
|
3331
3350
|
let o = e.type === "date", s = !!e.timezone;
|
|
3332
3351
|
if (r === "display") {
|
|
3333
3352
|
if (!n) return /* @__PURE__ */ b("span", {
|
|
@@ -3337,7 +3356,7 @@ function wi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3337
3356
|
},
|
|
3338
3357
|
children: "—"
|
|
3339
3358
|
});
|
|
3340
|
-
let e =
|
|
3359
|
+
let e = R(n), t = s ? bi(e, o) : xi(e, o), r = s && !o ? Si(e) : null;
|
|
3341
3360
|
return /* @__PURE__ */ x("span", {
|
|
3342
3361
|
style: { fontSize: 12.5 },
|
|
3343
3362
|
children: [t, r && /* @__PURE__ */ b("span", {
|
|
@@ -3349,7 +3368,7 @@ function wi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3349
3368
|
})]
|
|
3350
3369
|
});
|
|
3351
3370
|
}
|
|
3352
|
-
let c = n ? s ?
|
|
3371
|
+
let c = n ? s ? Ci(R(n), o) : wi(R(n), o) : "";
|
|
3353
3372
|
return /* @__PURE__ */ b(F, {
|
|
3354
3373
|
id: a,
|
|
3355
3374
|
name: t,
|
|
@@ -3370,13 +3389,13 @@ function wi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3370
3389
|
i?.(e);
|
|
3371
3390
|
return;
|
|
3372
3391
|
}
|
|
3373
|
-
i?.(
|
|
3392
|
+
i?.(ze(t));
|
|
3374
3393
|
}
|
|
3375
3394
|
});
|
|
3376
3395
|
}
|
|
3377
3396
|
//#endregion
|
|
3378
3397
|
//#region src/components/fields/BoolField.tsx
|
|
3379
|
-
function
|
|
3398
|
+
function Ei({ value: e, mode: t, onChange: n, fieldId: r, labelId: i }) {
|
|
3380
3399
|
let a = !!e;
|
|
3381
3400
|
return t === "display" ? /* @__PURE__ */ x("span", {
|
|
3382
3401
|
style: {
|
|
@@ -3401,7 +3420,7 @@ function Ti({ value: e, mode: t, onChange: n, fieldId: r, labelId: i }) {
|
|
|
3401
3420
|
}
|
|
3402
3421
|
//#endregion
|
|
3403
3422
|
//#region src/components/fields/NumberField.tsx
|
|
3404
|
-
function
|
|
3423
|
+
function Di(e) {
|
|
3405
3424
|
let t = e.trim();
|
|
3406
3425
|
if (t === "" || t === "-") return t;
|
|
3407
3426
|
let n = t.startsWith("-"), [r, i] = (n ? t.slice(1) : t).split("."), a;
|
|
@@ -3413,8 +3432,8 @@ function Ei(e) {
|
|
|
3413
3432
|
let o = n ? `-${a}` : a;
|
|
3414
3433
|
return i !== void 0 && (o += `.${i}`), o;
|
|
3415
3434
|
}
|
|
3416
|
-
var
|
|
3417
|
-
function
|
|
3435
|
+
var Oi = new Intl.NumberFormat();
|
|
3436
|
+
function ki({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
|
|
3418
3437
|
let s = e.display?.widget === "money", c = e.type === "decimal" || s, l = a?.$units?.[t], u = !l && e.unit ? e.unit.display || e.unit.storage : void 0, d = l || (u && !u.startsWith("$") ? u : void 0);
|
|
3419
3438
|
if (r === "display") {
|
|
3420
3439
|
if (n == null) return /* @__PURE__ */ b("span", {
|
|
@@ -3425,10 +3444,10 @@ function Oi({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
|
|
|
3425
3444
|
children: "—"
|
|
3426
3445
|
});
|
|
3427
3446
|
let e;
|
|
3428
|
-
if (c && typeof n == "string") e =
|
|
3447
|
+
if (c && typeof n == "string") e = Di(n);
|
|
3429
3448
|
else {
|
|
3430
3449
|
let t = Number(n);
|
|
3431
|
-
e = isNaN(t) ? null :
|
|
3450
|
+
e = isNaN(t) ? null : Oi.format(t);
|
|
3432
3451
|
}
|
|
3433
3452
|
return e == null ? /* @__PURE__ */ b("span", {
|
|
3434
3453
|
style: { fontSize: 12.5 },
|
|
@@ -3455,7 +3474,7 @@ function Oi({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
|
|
|
3455
3474
|
type: "text",
|
|
3456
3475
|
inputMode: "decimal",
|
|
3457
3476
|
pattern: "-?\\d*\\.?\\d*",
|
|
3458
|
-
value: n == null ? "" :
|
|
3477
|
+
value: n == null ? "" : R(n),
|
|
3459
3478
|
onChange: (e) => {
|
|
3460
3479
|
e === "" ? i?.(null) : i?.(e);
|
|
3461
3480
|
}
|
|
@@ -3465,7 +3484,7 @@ function Oi({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
|
|
|
3465
3484
|
"aria-required": e.required || void 0,
|
|
3466
3485
|
type: "number",
|
|
3467
3486
|
step: e.type === "float" ? "0.01" : "1",
|
|
3468
|
-
value: n == null ? "" :
|
|
3487
|
+
value: n == null ? "" : R(n),
|
|
3469
3488
|
onChange: (t) => {
|
|
3470
3489
|
t === "" ? i?.(null) : i?.(e.type === "int" ? parseInt(t, 10) : parseFloat(t));
|
|
3471
3490
|
}
|
|
@@ -3473,7 +3492,7 @@ function Oi({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
|
|
|
3473
3492
|
}
|
|
3474
3493
|
//#endregion
|
|
3475
3494
|
//#region src/hooks/useEntityData.ts
|
|
3476
|
-
function
|
|
3495
|
+
function Ai(e, t) {
|
|
3477
3496
|
return [
|
|
3478
3497
|
"entity-data",
|
|
3479
3498
|
e,
|
|
@@ -3483,16 +3502,16 @@ function ki(e, t) {
|
|
|
3483
3502
|
}
|
|
3484
3503
|
];
|
|
3485
3504
|
}
|
|
3486
|
-
function
|
|
3487
|
-
let r =
|
|
3505
|
+
function ji(e, t, n = !0) {
|
|
3506
|
+
let r = Ai(e, t), i = r[2];
|
|
3488
3507
|
return g({
|
|
3489
3508
|
queryKey: r,
|
|
3490
|
-
queryFn: ({ signal: t }) =>
|
|
3509
|
+
queryFn: ({ signal: t }) => Xn(e, i, { signal: t }),
|
|
3491
3510
|
enabled: !!e && n,
|
|
3492
3511
|
placeholderData: (t, n) => n?.queryKey?.[1] === e ? t : void 0
|
|
3493
3512
|
});
|
|
3494
3513
|
}
|
|
3495
|
-
function
|
|
3514
|
+
function Mi(e, t, n = !0) {
|
|
3496
3515
|
let r = {
|
|
3497
3516
|
...t,
|
|
3498
3517
|
count: "only",
|
|
@@ -3508,7 +3527,7 @@ function ji(e, t, n = !0) {
|
|
|
3508
3527
|
e,
|
|
3509
3528
|
r
|
|
3510
3529
|
],
|
|
3511
|
-
queryFn: ({ signal: t }) =>
|
|
3530
|
+
queryFn: ({ signal: t }) => Xn(e, r, { signal: t }),
|
|
3512
3531
|
enabled: !!e && n,
|
|
3513
3532
|
retry: 1,
|
|
3514
3533
|
staleTime: 3e4,
|
|
@@ -3517,7 +3536,7 @@ function ji(e, t, n = !0) {
|
|
|
3517
3536
|
}
|
|
3518
3537
|
//#endregion
|
|
3519
3538
|
//#region src/hooks/useDebounce.ts
|
|
3520
|
-
function
|
|
3539
|
+
function Ni(e, t) {
|
|
3521
3540
|
let [n, r] = p(e);
|
|
3522
3541
|
return l(() => {
|
|
3523
3542
|
let n = setTimeout(() => r(e), t);
|
|
@@ -3526,24 +3545,24 @@ function Mi(e, t) {
|
|
|
3526
3545
|
}
|
|
3527
3546
|
//#endregion
|
|
3528
3547
|
//#region src/hooks/useEntity.ts
|
|
3529
|
-
function
|
|
3548
|
+
function Pi(e) {
|
|
3530
3549
|
let { data: t } = X();
|
|
3531
3550
|
if (!(!t || !e)) return t.entities[e];
|
|
3532
3551
|
}
|
|
3533
3552
|
//#endregion
|
|
3534
3553
|
//#region src/components/fields/RefCombobox.tsx
|
|
3535
|
-
var
|
|
3536
|
-
function
|
|
3537
|
-
let m = e?.entity, h =
|
|
3538
|
-
per_page:
|
|
3554
|
+
var Fi = 200;
|
|
3555
|
+
function Ii({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, id: a, labelId: o, ariaLabel: s, required: c, placeholder: l = "Select…", specialValues: u }) {
|
|
3556
|
+
let m = e?.entity, h = Pi(m), g = i ?? e?.display?.field ?? h?.display?.display_field ?? "$display", _ = d(() => h ? B(h)[0] ?? "id" : "id", [h]), v = e?.field || _, [y, x] = p(""), S = Ni(y, 300), { data: C, isLoading: w } = ji(m, {
|
|
3557
|
+
per_page: Fi,
|
|
3539
3558
|
sort: g ? `${g}:asc` : void 0,
|
|
3540
3559
|
search: S || void 0,
|
|
3541
3560
|
filters: e?.options_filter
|
|
3542
|
-
}), T = d(() => C?.data ?? [], [C?.data]), E = t == null ? "" :
|
|
3561
|
+
}), T = d(() => C?.data ?? [], [C?.data]), E = t == null ? "" : R(t), D = d(() => T.some((e) => String(e[v]) === E), [
|
|
3543
3562
|
T,
|
|
3544
3563
|
v,
|
|
3545
3564
|
E
|
|
3546
|
-
]), O = r && m ? r[m]?.[E] : void 0, k = !!u?.some((e) => e.code === E), { data: A } =
|
|
3565
|
+
]), O = r && m ? r[m]?.[E] : void 0, k = !!u?.some((e) => e.code === E), { data: A } = ji(E && !D && !k && !O && !w ? m : void 0, {
|
|
3547
3566
|
per_page: 1,
|
|
3548
3567
|
filters: [{
|
|
3549
3568
|
field: v,
|
|
@@ -3553,13 +3572,13 @@ function Fi({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, i
|
|
|
3553
3572
|
}), j = f(null), M = d(() => {
|
|
3554
3573
|
if (!E) return "";
|
|
3555
3574
|
let e;
|
|
3556
|
-
if (O) e =
|
|
3575
|
+
if (O) e = Ge(O, g, E);
|
|
3557
3576
|
else {
|
|
3558
3577
|
let t = T.find((e) => String(e[v]) === E);
|
|
3559
|
-
if (t) e =
|
|
3578
|
+
if (t) e = Ge(t, g, E);
|
|
3560
3579
|
else {
|
|
3561
3580
|
let t = A?.data?.find((e) => String(e[v]) === E);
|
|
3562
|
-
t && (e =
|
|
3581
|
+
t && (e = Ge(t, g, E));
|
|
3563
3582
|
}
|
|
3564
3583
|
}
|
|
3565
3584
|
return e === void 0 ? j.current?.value === E ? j.current.label : E : (j.current = {
|
|
@@ -3573,15 +3592,15 @@ function Fi({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, i
|
|
|
3573
3592
|
v,
|
|
3574
3593
|
g,
|
|
3575
3594
|
A
|
|
3576
|
-
]),
|
|
3595
|
+
]), ee = d(() => {
|
|
3577
3596
|
let e = (u ?? []).map((e) => ({
|
|
3578
3597
|
value: e.code,
|
|
3579
|
-
label:
|
|
3598
|
+
label: z(e.label) || e.code
|
|
3580
3599
|
})), t = T.map((e) => {
|
|
3581
|
-
let t =
|
|
3600
|
+
let t = R(e[v]);
|
|
3582
3601
|
return {
|
|
3583
3602
|
value: t,
|
|
3584
|
-
label:
|
|
3603
|
+
label: Ge(e, g, t)
|
|
3585
3604
|
};
|
|
3586
3605
|
}), n = E && !D && !k ? [{
|
|
3587
3606
|
value: E,
|
|
@@ -3622,7 +3641,7 @@ function Fi({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, i
|
|
|
3622
3641
|
"aria-labelledby": o,
|
|
3623
3642
|
"aria-required": c || void 0,
|
|
3624
3643
|
value: E,
|
|
3625
|
-
options:
|
|
3644
|
+
options: ee,
|
|
3626
3645
|
onChange: (e) => n(e || null),
|
|
3627
3646
|
onSearchChange: x,
|
|
3628
3647
|
placeholder: l
|
|
@@ -3630,13 +3649,13 @@ function Fi({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, i
|
|
|
3630
3649
|
}
|
|
3631
3650
|
//#endregion
|
|
3632
3651
|
//#region src/components/fields/RefField.tsx
|
|
3633
|
-
function
|
|
3652
|
+
function Li({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, labelId: o }) {
|
|
3634
3653
|
let s = e.ref?.entity, c = e.display?.ref_display_field || "$display", l = d(() => {
|
|
3635
3654
|
if (t == null) return "—";
|
|
3636
|
-
let e =
|
|
3655
|
+
let e = R(t);
|
|
3637
3656
|
if (i && s) {
|
|
3638
3657
|
let t = i[s]?.[e];
|
|
3639
|
-
if (t) return
|
|
3658
|
+
if (t) return Ge(t, c, e);
|
|
3640
3659
|
}
|
|
3641
3660
|
return e;
|
|
3642
3661
|
}, [
|
|
@@ -3648,7 +3667,7 @@ function Ii({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, lab
|
|
|
3648
3667
|
return n === "display" ? /* @__PURE__ */ b("span", {
|
|
3649
3668
|
style: { fontSize: 12.5 },
|
|
3650
3669
|
children: l
|
|
3651
|
-
}) : /* @__PURE__ */ b(
|
|
3670
|
+
}) : /* @__PURE__ */ b(Ii, {
|
|
3652
3671
|
ref: e.ref,
|
|
3653
3672
|
value: t,
|
|
3654
3673
|
onChange: (e) => r?.(e),
|
|
@@ -3661,29 +3680,29 @@ function Ii({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, lab
|
|
|
3661
3680
|
}
|
|
3662
3681
|
//#endregion
|
|
3663
3682
|
//#region src/components/fields/JsonField.tsx
|
|
3664
|
-
var
|
|
3665
|
-
function
|
|
3683
|
+
var Ri = o(() => import("./JsonEditor-DoNmyrYd.js").then((e) => ({ default: e.JsonEditor })));
|
|
3684
|
+
function zi() {
|
|
3666
3685
|
return /* @__PURE__ */ b("div", { className: "h-20 rounded-md border border-border bg-muted animate-pulse" });
|
|
3667
3686
|
}
|
|
3668
|
-
function
|
|
3687
|
+
function Bi(e) {
|
|
3669
3688
|
return e == null ? !0 : typeof e == "string" ? e.trim() === "" : Array.isArray(e) ? e.length === 0 : typeof e == "object" && Object.keys(e).length === 0;
|
|
3670
3689
|
}
|
|
3671
|
-
function
|
|
3672
|
-
return t === "display" ?
|
|
3690
|
+
function Vi({ value: e, mode: t, onChange: n, fieldId: i }) {
|
|
3691
|
+
return t === "display" ? Bi(e) ? /* @__PURE__ */ b("span", {
|
|
3673
3692
|
style: {
|
|
3674
3693
|
fontSize: 12.5,
|
|
3675
3694
|
color: "var(--text-4)"
|
|
3676
3695
|
},
|
|
3677
3696
|
children: "—"
|
|
3678
3697
|
}) : /* @__PURE__ */ b(r, {
|
|
3679
|
-
fallback: /* @__PURE__ */ b(
|
|
3680
|
-
children: /* @__PURE__ */ b(
|
|
3698
|
+
fallback: /* @__PURE__ */ b(zi, {}),
|
|
3699
|
+
children: /* @__PURE__ */ b(Ri, {
|
|
3681
3700
|
value: e,
|
|
3682
3701
|
readOnly: !0
|
|
3683
3702
|
})
|
|
3684
3703
|
}) : /* @__PURE__ */ b(r, {
|
|
3685
|
-
fallback: /* @__PURE__ */ b(
|
|
3686
|
-
children: /* @__PURE__ */ b(
|
|
3704
|
+
fallback: /* @__PURE__ */ b(zi, {}),
|
|
3705
|
+
children: /* @__PURE__ */ b(Ri, {
|
|
3687
3706
|
value: e,
|
|
3688
3707
|
onChange: n,
|
|
3689
3708
|
id: i
|
|
@@ -3692,18 +3711,21 @@ function Bi({ value: e, mode: t, onChange: n, fieldId: i }) {
|
|
|
3692
3711
|
}
|
|
3693
3712
|
//#endregion
|
|
3694
3713
|
//#region src/components/fields/MultilangField.tsx
|
|
3695
|
-
function
|
|
3714
|
+
function Hi(e) {
|
|
3696
3715
|
return e == null ? {} : typeof e == "object" && !Array.isArray(e) ? e : typeof e == "string" ? { en: e } : {};
|
|
3697
3716
|
}
|
|
3698
|
-
function
|
|
3717
|
+
function Ui({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
|
|
3699
3718
|
let { data: o } = X(), s = o?.languages?.length ? o.languages : [{
|
|
3700
3719
|
code: "en",
|
|
3701
3720
|
name: { en: "English" }
|
|
3702
|
-
}], c =
|
|
3703
|
-
if (r === "display")
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3721
|
+
}], c = Hi(n);
|
|
3722
|
+
if (r === "display") {
|
|
3723
|
+
let e = Object.values(c)[0] ?? "—";
|
|
3724
|
+
return /* @__PURE__ */ b("span", {
|
|
3725
|
+
style: { fontSize: 12.5 },
|
|
3726
|
+
children: e
|
|
3727
|
+
});
|
|
3728
|
+
}
|
|
3707
3729
|
let l = (e, t) => {
|
|
3708
3730
|
let n = {
|
|
3709
3731
|
...c,
|
|
@@ -3755,22 +3777,25 @@ function Hi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3755
3777
|
}
|
|
3756
3778
|
//#endregion
|
|
3757
3779
|
//#region src/components/fields/MultilangTextField.tsx
|
|
3758
|
-
function
|
|
3780
|
+
function Wi(e) {
|
|
3759
3781
|
return e == null ? {} : typeof e == "object" && !Array.isArray(e) ? e : typeof e == "string" ? { en: e } : {};
|
|
3760
3782
|
}
|
|
3761
|
-
function
|
|
3783
|
+
function Gi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
|
|
3762
3784
|
let { data: o } = X(), s = o?.languages?.length ? o.languages : [{
|
|
3763
3785
|
code: "en",
|
|
3764
3786
|
name: { en: "English" }
|
|
3765
|
-
}], c =
|
|
3766
|
-
if (r === "display")
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3787
|
+
}], c = Wi(n);
|
|
3788
|
+
if (r === "display") {
|
|
3789
|
+
let e = Object.values(c)[0] ?? "—";
|
|
3790
|
+
return /* @__PURE__ */ b("p", {
|
|
3791
|
+
style: {
|
|
3792
|
+
fontSize: 12.5,
|
|
3793
|
+
whiteSpace: "pre-wrap",
|
|
3794
|
+
margin: 0
|
|
3795
|
+
},
|
|
3796
|
+
children: e
|
|
3797
|
+
});
|
|
3798
|
+
}
|
|
3774
3799
|
let l = (e, t) => {
|
|
3775
3800
|
let n = {
|
|
3776
3801
|
...c,
|
|
@@ -3818,25 +3843,25 @@ function Wi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3818
3843
|
}
|
|
3819
3844
|
//#endregion
|
|
3820
3845
|
//#region src/components/fields/StructureField.tsx
|
|
3821
|
-
function
|
|
3846
|
+
function Ki(e) {
|
|
3822
3847
|
let { field: t, value: n, mode: r, onChange: i, locale: a, fieldId: o } = e, { data: s } = X(), c = t.structure ? s?.structures?.[t.structure] : void 0;
|
|
3823
|
-
return c ? t.array ? /* @__PURE__ */ b(
|
|
3848
|
+
return c ? t.array ? /* @__PURE__ */ b(Ji, {
|
|
3824
3849
|
structDef: c,
|
|
3825
3850
|
value: n,
|
|
3826
3851
|
mode: r,
|
|
3827
3852
|
onChange: i,
|
|
3828
3853
|
locale: a,
|
|
3829
3854
|
fieldId: o
|
|
3830
|
-
}) : /* @__PURE__ */ b(
|
|
3855
|
+
}) : /* @__PURE__ */ b(qi, {
|
|
3831
3856
|
structDef: c,
|
|
3832
3857
|
value: n,
|
|
3833
3858
|
mode: r,
|
|
3834
3859
|
onChange: i,
|
|
3835
3860
|
locale: a,
|
|
3836
3861
|
fieldId: o
|
|
3837
|
-
}) : /* @__PURE__ */ b(
|
|
3862
|
+
}) : /* @__PURE__ */ b(Vi, { ...e });
|
|
3838
3863
|
}
|
|
3839
|
-
function
|
|
3864
|
+
function qi({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId: a }) {
|
|
3840
3865
|
let o = typeof t == "object" && t && !Array.isArray(t) ? t : {}, s = e.fields.names(), c = {
|
|
3841
3866
|
display: "flex",
|
|
3842
3867
|
flexDirection: "column",
|
|
@@ -3866,19 +3891,19 @@ function Ki({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
|
|
|
3866
3891
|
minWidth: 100,
|
|
3867
3892
|
flexShrink: 0
|
|
3868
3893
|
},
|
|
3869
|
-
children: n.display ?
|
|
3894
|
+
children: n.display ? z(n.display.name) : t
|
|
3870
3895
|
}), /* @__PURE__ */ b("div", {
|
|
3871
3896
|
style: {
|
|
3872
3897
|
minWidth: 0,
|
|
3873
3898
|
flex: 1
|
|
3874
3899
|
},
|
|
3875
|
-
children: n.type === "structure" && n.structure ? /* @__PURE__ */ b(
|
|
3900
|
+
children: n.type === "structure" && n.structure ? /* @__PURE__ */ b(Ki, {
|
|
3876
3901
|
field: n,
|
|
3877
3902
|
fieldName: t,
|
|
3878
3903
|
value: r,
|
|
3879
3904
|
mode: "display",
|
|
3880
3905
|
locale: i
|
|
3881
|
-
}) :
|
|
3906
|
+
}) : gs({
|
|
3882
3907
|
field: n,
|
|
3883
3908
|
fieldName: t,
|
|
3884
3909
|
value: r,
|
|
@@ -3915,15 +3940,15 @@ function Ki({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
|
|
|
3915
3940
|
},
|
|
3916
3941
|
children: [/* @__PURE__ */ b(Se, {
|
|
3917
3942
|
required: n.required,
|
|
3918
|
-
children: n.display ?
|
|
3919
|
-
}), n.type === "structure" && n.structure ? /* @__PURE__ */ b(
|
|
3943
|
+
children: n.display ? z(n.display.name) : t
|
|
3944
|
+
}), n.type === "structure" && n.structure ? /* @__PURE__ */ b(Ki, {
|
|
3920
3945
|
field: n,
|
|
3921
3946
|
fieldName: t,
|
|
3922
3947
|
value: o[t],
|
|
3923
3948
|
mode: "edit",
|
|
3924
3949
|
onChange: l(t),
|
|
3925
3950
|
locale: i
|
|
3926
|
-
}) :
|
|
3951
|
+
}) : gs({
|
|
3927
3952
|
field: n,
|
|
3928
3953
|
fieldName: t,
|
|
3929
3954
|
value: o[t],
|
|
@@ -3935,7 +3960,7 @@ function Ki({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
|
|
|
3935
3960
|
})
|
|
3936
3961
|
});
|
|
3937
3962
|
}
|
|
3938
|
-
function
|
|
3963
|
+
function Ji({ structDef: e, value: n, mode: r, onChange: i, locale: a, fieldId: o }) {
|
|
3939
3964
|
let s = Array.isArray(n) ? n : [];
|
|
3940
3965
|
if (r === "display") return s.length === 0 ? /* @__PURE__ */ b("span", {
|
|
3941
3966
|
style: {
|
|
@@ -3949,7 +3974,7 @@ function qi({ structDef: e, value: n, mode: r, onChange: i, locale: a, fieldId:
|
|
|
3949
3974
|
flexDirection: "column",
|
|
3950
3975
|
gap: 8
|
|
3951
3976
|
},
|
|
3952
|
-
children: s.map((t, n) => /* @__PURE__ */ b(
|
|
3977
|
+
children: s.map((t, n) => /* @__PURE__ */ b(qi, {
|
|
3953
3978
|
structDef: e,
|
|
3954
3979
|
value: t,
|
|
3955
3980
|
mode: "display",
|
|
@@ -3975,7 +4000,7 @@ function qi({ structDef: e, value: n, mode: r, onChange: i, locale: a, fieldId:
|
|
|
3975
4000
|
role: "group",
|
|
3976
4001
|
children: [s.map((n, r) => /* @__PURE__ */ x("div", {
|
|
3977
4002
|
style: { position: "relative" },
|
|
3978
|
-
children: [/* @__PURE__ */ b(
|
|
4003
|
+
children: [/* @__PURE__ */ b(qi, {
|
|
3979
4004
|
structDef: e,
|
|
3980
4005
|
value: n,
|
|
3981
4006
|
mode: "edit",
|
|
@@ -4003,16 +4028,16 @@ function qi({ structDef: e, value: n, mode: r, onChange: i, locale: a, fieldId:
|
|
|
4003
4028
|
}
|
|
4004
4029
|
//#endregion
|
|
4005
4030
|
//#region src/components/fields/SecretField.tsx
|
|
4006
|
-
var
|
|
4007
|
-
function
|
|
4008
|
-
let [s, c] = p(""), l = a !== void 0, u = n ===
|
|
4031
|
+
var Yi = "[SET]";
|
|
4032
|
+
function Xi({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
|
|
4033
|
+
let [s, c] = p(""), l = a !== void 0, u = n === Yi || typeof n == "string" && n !== "";
|
|
4009
4034
|
return r === "display" ? u ? /* @__PURE__ */ b("span", {
|
|
4010
4035
|
className: "mono",
|
|
4011
4036
|
style: {
|
|
4012
4037
|
fontSize: 12.5,
|
|
4013
4038
|
color: "var(--text-3)"
|
|
4014
4039
|
},
|
|
4015
|
-
children:
|
|
4040
|
+
children: Yi
|
|
4016
4041
|
}) : /* @__PURE__ */ b("span", {
|
|
4017
4042
|
style: {
|
|
4018
4043
|
fontSize: 12.5,
|
|
@@ -4026,23 +4051,23 @@ function Yi({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
|
|
|
4026
4051
|
ariaRequired: e.required,
|
|
4027
4052
|
value: s,
|
|
4028
4053
|
onChange: (e) => {
|
|
4029
|
-
c(e), l && e === "" ? i?.(u ?
|
|
4054
|
+
c(e), l && e === "" ? i?.(u ? Yi : "") : i?.(e);
|
|
4030
4055
|
},
|
|
4031
4056
|
placeholder: l ? "Leave blank to keep existing value" : "Enter value"
|
|
4032
4057
|
});
|
|
4033
4058
|
}
|
|
4034
4059
|
//#endregion
|
|
4035
4060
|
//#region src/components/fields/PasswordField.tsx
|
|
4036
|
-
var
|
|
4037
|
-
function
|
|
4038
|
-
let [s, c] = p(""), l = a !== void 0, u = n ===
|
|
4061
|
+
var Zi = "[SET]";
|
|
4062
|
+
function Qi({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
|
|
4063
|
+
let [s, c] = p(""), l = a !== void 0, u = n === Zi || typeof n == "string" && n !== "";
|
|
4039
4064
|
return r === "display" ? u ? /* @__PURE__ */ b("span", {
|
|
4040
4065
|
className: "mono",
|
|
4041
4066
|
style: {
|
|
4042
4067
|
fontSize: 12.5,
|
|
4043
4068
|
color: "var(--text-3)"
|
|
4044
4069
|
},
|
|
4045
|
-
children:
|
|
4070
|
+
children: Zi
|
|
4046
4071
|
}) : /* @__PURE__ */ b("span", {
|
|
4047
4072
|
style: {
|
|
4048
4073
|
fontSize: 12.5,
|
|
@@ -4056,25 +4081,25 @@ function Zi({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
|
|
|
4056
4081
|
ariaRequired: e.required,
|
|
4057
4082
|
value: s,
|
|
4058
4083
|
onChange: (e) => {
|
|
4059
|
-
c(e), l && e === "" ? i?.(u ?
|
|
4084
|
+
c(e), l && e === "" ? i?.(u ? Zi : "") : i?.(e);
|
|
4060
4085
|
},
|
|
4061
4086
|
placeholder: l ? "Leave blank to keep existing value" : "Enter password"
|
|
4062
4087
|
});
|
|
4063
4088
|
}
|
|
4064
4089
|
//#endregion
|
|
4065
4090
|
//#region src/components/fields/StringArrayField.tsx
|
|
4066
|
-
function
|
|
4091
|
+
function $i(e) {
|
|
4067
4092
|
return Array.isArray(e) ? e.filter((e) => e != null).map(String) : [];
|
|
4068
4093
|
}
|
|
4069
|
-
function
|
|
4070
|
-
let o =
|
|
4071
|
-
return s.length > 0 ? /* @__PURE__ */ b(
|
|
4094
|
+
function ea({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
|
|
4095
|
+
let o = $i(n), s = e.values ?? [];
|
|
4096
|
+
return s.length > 0 ? /* @__PURE__ */ b(ta, {
|
|
4072
4097
|
values: s,
|
|
4073
4098
|
selected: o,
|
|
4074
4099
|
mode: r,
|
|
4075
4100
|
required: e.required,
|
|
4076
4101
|
onChange: i
|
|
4077
|
-
}) : /* @__PURE__ */ b(
|
|
4102
|
+
}) : /* @__PURE__ */ b(na, {
|
|
4078
4103
|
items: o,
|
|
4079
4104
|
fieldName: t,
|
|
4080
4105
|
required: e.required,
|
|
@@ -4083,10 +4108,10 @@ function $i({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
4083
4108
|
fieldId: a
|
|
4084
4109
|
});
|
|
4085
4110
|
}
|
|
4086
|
-
function
|
|
4111
|
+
function ta({ values: e, selected: n, mode: r, required: i, onChange: a }) {
|
|
4087
4112
|
let o = new Set(n), s = (t) => {
|
|
4088
4113
|
let n = e.find((e) => e.code === t);
|
|
4089
|
-
return n &&
|
|
4114
|
+
return n && z(n.name) || t;
|
|
4090
4115
|
}, c = n.filter((t) => !e.some((e) => e.code === t));
|
|
4091
4116
|
if (r === "display") return n.length === 0 ? /* @__PURE__ */ b("span", {
|
|
4092
4117
|
style: {
|
|
@@ -4102,7 +4127,7 @@ function ea({ values: e, selected: n, mode: r, required: i, onChange: a }) {
|
|
|
4102
4127
|
},
|
|
4103
4128
|
children: [e.filter((e) => o.has(e.code)).map((e) => /* @__PURE__ */ b(P, {
|
|
4104
4129
|
tone: "slate",
|
|
4105
|
-
children:
|
|
4130
|
+
children: z(e.name) || e.code
|
|
4106
4131
|
}, e.code)), c.map((e) => /* @__PURE__ */ b(P, {
|
|
4107
4132
|
tone: "slate",
|
|
4108
4133
|
children: s(e)
|
|
@@ -4149,7 +4174,7 @@ function ea({ values: e, selected: n, mode: r, required: i, onChange: a }) {
|
|
|
4149
4174
|
}, e))]
|
|
4150
4175
|
});
|
|
4151
4176
|
}
|
|
4152
|
-
function
|
|
4177
|
+
function na({ items: e, fieldName: n, required: r, mode: i, onChange: a, fieldId: o }) {
|
|
4153
4178
|
let [s, c] = p("");
|
|
4154
4179
|
if (i === "display") return e.length === 0 ? /* @__PURE__ */ b("span", {
|
|
4155
4180
|
style: {
|
|
@@ -4219,11 +4244,11 @@ function ta({ items: e, fieldName: n, required: r, mode: i, onChange: a, fieldId
|
|
|
4219
4244
|
}
|
|
4220
4245
|
//#endregion
|
|
4221
4246
|
//#region src/components/fields/IntArrayField.tsx
|
|
4222
|
-
function
|
|
4247
|
+
function ra(e) {
|
|
4223
4248
|
return Array.isArray(e) ? e.filter((e) => e != null).map(Number).filter((e) => !isNaN(e)) : [];
|
|
4224
4249
|
}
|
|
4225
|
-
function
|
|
4226
|
-
let s =
|
|
4250
|
+
function ia({ field: e, fieldName: n, value: r, mode: i, onChange: a, fieldId: o }) {
|
|
4251
|
+
let s = ra(r), [c, l] = p("");
|
|
4227
4252
|
if (i === "display") return s.length === 0 ? /* @__PURE__ */ b("span", {
|
|
4228
4253
|
style: {
|
|
4229
4254
|
fontSize: 12.5,
|
|
@@ -4295,47 +4320,47 @@ function ra({ field: e, fieldName: n, value: r, mode: i, onChange: a, fieldId: o
|
|
|
4295
4320
|
}
|
|
4296
4321
|
//#endregion
|
|
4297
4322
|
//#region src/lib/rich-text.ts
|
|
4298
|
-
var
|
|
4299
|
-
function
|
|
4300
|
-
return typeof e == "string" ? e :
|
|
4323
|
+
var aa = /declarion:\/\/file\/([0-9a-fA-F-]{36})/g;
|
|
4324
|
+
function oa(e) {
|
|
4325
|
+
return typeof e == "string" ? e : ma(e) && typeof e.markdown == "string" ? e.markdown : "";
|
|
4301
4326
|
}
|
|
4302
|
-
function
|
|
4327
|
+
function sa(e, t) {
|
|
4303
4328
|
return {
|
|
4304
|
-
markdown:
|
|
4305
|
-
files:
|
|
4329
|
+
markdown: oa(e),
|
|
4330
|
+
files: ua(t)
|
|
4306
4331
|
};
|
|
4307
4332
|
}
|
|
4308
|
-
function
|
|
4309
|
-
let n =
|
|
4333
|
+
function ca(e, t) {
|
|
4334
|
+
let n = sa(e, null);
|
|
4310
4335
|
return n.files[t.id] = t, n;
|
|
4311
4336
|
}
|
|
4312
|
-
function
|
|
4313
|
-
let n =
|
|
4337
|
+
function la(e, t) {
|
|
4338
|
+
let n = sa(e, null);
|
|
4314
4339
|
for (let e of t) delete n.files[e];
|
|
4315
4340
|
return n;
|
|
4316
4341
|
}
|
|
4317
|
-
function
|
|
4342
|
+
function ua(e) {
|
|
4318
4343
|
if (!Array.isArray(e)) return {};
|
|
4319
4344
|
let t = {};
|
|
4320
|
-
for (let n of e)
|
|
4345
|
+
for (let n of e) ma(n) && typeof n.id == "string" && (t[n.id] = n);
|
|
4321
4346
|
return t;
|
|
4322
4347
|
}
|
|
4323
|
-
function
|
|
4348
|
+
function da(e) {
|
|
4324
4349
|
let t = /* @__PURE__ */ new Set(), n = [], r;
|
|
4325
|
-
for (
|
|
4350
|
+
for (aa.lastIndex = 0; (r = aa.exec(e)) !== null;) {
|
|
4326
4351
|
let e = r[1];
|
|
4327
4352
|
t.has(e) || (t.add(e), n.push(e));
|
|
4328
4353
|
}
|
|
4329
4354
|
return n;
|
|
4330
4355
|
}
|
|
4331
|
-
function
|
|
4356
|
+
function fa(e) {
|
|
4332
4357
|
return e ? /^declarion:\/\/file\/([0-9a-fA-F-]{36})$/.exec(e)?.[1] ?? null : null;
|
|
4333
4358
|
}
|
|
4334
|
-
function
|
|
4359
|
+
function pa(e) {
|
|
4335
4360
|
let t = `declarion://file/${e.id}`;
|
|
4336
4361
|
return e.content_type.startsWith("image/") ? `` : `[${e.filename || e.id}](${t})`;
|
|
4337
4362
|
}
|
|
4338
|
-
function
|
|
4363
|
+
function ma(e) {
|
|
4339
4364
|
return typeof e == "object" && !!e;
|
|
4340
4365
|
}
|
|
4341
4366
|
//#endregion
|
|
@@ -4347,30 +4372,30 @@ var Q = class extends Error {
|
|
|
4347
4372
|
super(n), this.code = t, this.status = e;
|
|
4348
4373
|
}
|
|
4349
4374
|
};
|
|
4350
|
-
async function
|
|
4351
|
-
let t =
|
|
4375
|
+
async function ha(e) {
|
|
4376
|
+
let t = Ot();
|
|
4352
4377
|
try {
|
|
4353
|
-
return await
|
|
4378
|
+
return await ga(e, t ? await Pt() : null);
|
|
4354
4379
|
} catch (n) {
|
|
4355
4380
|
if (!(n instanceof Q && n.status === 401 && (n.code === "TOKEN_REFRESH_NEEDED" || n.code === "UNAUTHORIZED"))) throw n;
|
|
4356
4381
|
let r = null;
|
|
4357
4382
|
try {
|
|
4358
|
-
t ? (
|
|
4383
|
+
t ? (Nt(), r = await Pt()) : await bn();
|
|
4359
4384
|
} catch {
|
|
4360
|
-
throw
|
|
4385
|
+
throw Sn()(), n;
|
|
4361
4386
|
}
|
|
4362
4387
|
try {
|
|
4363
|
-
return await
|
|
4388
|
+
return await ga(e, r);
|
|
4364
4389
|
} catch (e) {
|
|
4365
|
-
throw e instanceof Q && e.status === 401 &&
|
|
4390
|
+
throw e instanceof Q && e.status === 401 && Sn()(), e;
|
|
4366
4391
|
}
|
|
4367
4392
|
}
|
|
4368
4393
|
}
|
|
4369
|
-
function
|
|
4394
|
+
function ga(e, t) {
|
|
4370
4395
|
let { file: n, entityCode: r, fieldCode: i, slotCode: a, onProgress: o, signal: s } = e;
|
|
4371
4396
|
return new Promise((e, c) => {
|
|
4372
4397
|
let l = new XMLHttpRequest();
|
|
4373
|
-
if (l.open("POST",
|
|
4398
|
+
if (l.open("POST", _a(r, i, a)), l.withCredentials = t === null, t && l.setRequestHeader("Authorization", `Bearer ${t}`), l.upload.onprogress = (e) => {
|
|
4374
4399
|
if (!o) return;
|
|
4375
4400
|
let t = e.lengthComputable ? e.total : n.size, r = t > 0 ? Math.min(100, Math.round(e.loaded / t * 100)) : 0;
|
|
4376
4401
|
o({
|
|
@@ -4384,7 +4409,7 @@ function ha(e, t) {
|
|
|
4384
4409
|
n = t ? JSON.parse(t) : null;
|
|
4385
4410
|
} catch {}
|
|
4386
4411
|
if (l.status >= 200 && l.status < 300) {
|
|
4387
|
-
let t =
|
|
4412
|
+
let t = va(n);
|
|
4388
4413
|
if (!t || !t.id) {
|
|
4389
4414
|
c(new Q(l.status, "BAD_RESPONSE", "Upload returned no file id"));
|
|
4390
4415
|
return;
|
|
@@ -4409,56 +4434,56 @@ function ha(e, t) {
|
|
|
4409
4434
|
u.append("file", n, n.name), l.send(u);
|
|
4410
4435
|
});
|
|
4411
4436
|
}
|
|
4412
|
-
function
|
|
4437
|
+
function _a(e, t, n) {
|
|
4413
4438
|
let r = new URLSearchParams();
|
|
4414
4439
|
e && t && (r.set("entity_code", e), r.set("field_code", t), n && r.set("slot_code", n));
|
|
4415
4440
|
let i = r.toString();
|
|
4416
4441
|
return i ? `/api/files/upload?${i}` : "/api/files/upload";
|
|
4417
4442
|
}
|
|
4418
|
-
function _a(e) {
|
|
4419
|
-
return ya(e) ? ya(e.result) ? _a(e.result) : ya(e.file) ? va(e.file) : typeof e.id == "string" ? e : null : null;
|
|
4420
|
-
}
|
|
4421
4443
|
function va(e) {
|
|
4422
|
-
|
|
4444
|
+
return ba(e) ? ba(e.result) ? va(e.result) : ba(e.file) ? ya(e.file) : typeof e.id == "string" ? e : null : null;
|
|
4445
|
+
}
|
|
4446
|
+
function ya(e) {
|
|
4447
|
+
let t = xa(e.file_id);
|
|
4423
4448
|
return t ? {
|
|
4424
4449
|
id: t,
|
|
4425
|
-
filename:
|
|
4426
|
-
content_type:
|
|
4427
|
-
size_bytes:
|
|
4428
|
-
sha256:
|
|
4429
|
-
dedup:
|
|
4450
|
+
filename: xa(e.filename_original) ?? xa(e.filename_normalized) ?? t,
|
|
4451
|
+
content_type: xa(e.content_type) ?? "application/octet-stream",
|
|
4452
|
+
size_bytes: Sa(e.size_bytes) ?? 0,
|
|
4453
|
+
sha256: xa(e.sha256) ?? "",
|
|
4454
|
+
dedup: Ca(e.dedup)
|
|
4430
4455
|
} : null;
|
|
4431
4456
|
}
|
|
4432
|
-
function
|
|
4457
|
+
function ba(e) {
|
|
4433
4458
|
return typeof e == "object" && !!e;
|
|
4434
4459
|
}
|
|
4435
|
-
function
|
|
4460
|
+
function xa(e) {
|
|
4436
4461
|
return typeof e == "string" ? e : void 0;
|
|
4437
4462
|
}
|
|
4438
|
-
function
|
|
4463
|
+
function Sa(e) {
|
|
4439
4464
|
return typeof e == "number" ? e : void 0;
|
|
4440
4465
|
}
|
|
4441
|
-
function
|
|
4466
|
+
function Ca(e) {
|
|
4442
4467
|
return typeof e == "boolean" ? e : void 0;
|
|
4443
4468
|
}
|
|
4444
|
-
async function
|
|
4469
|
+
async function wa(e) {
|
|
4445
4470
|
await Y("files.discard", { file_id: e });
|
|
4446
4471
|
}
|
|
4447
|
-
function
|
|
4472
|
+
function Ta(e, t, n) {
|
|
4448
4473
|
if (n && e.size > n) return {
|
|
4449
4474
|
code: "FILE_TOO_LARGE",
|
|
4450
|
-
message: `File is ${
|
|
4475
|
+
message: `File is ${Da(e.size)}, max ${Da(n)}`
|
|
4451
4476
|
};
|
|
4452
4477
|
if (t && t.length > 0) {
|
|
4453
4478
|
let n = e.type || "application/octet-stream";
|
|
4454
|
-
if (!t.some((e) =>
|
|
4479
|
+
if (!t.some((e) => Ea(e, n))) return {
|
|
4455
4480
|
code: "MIME_NOT_ACCEPTED",
|
|
4456
4481
|
message: `File type ${n} is not accepted`
|
|
4457
4482
|
};
|
|
4458
4483
|
}
|
|
4459
4484
|
return null;
|
|
4460
4485
|
}
|
|
4461
|
-
function
|
|
4486
|
+
function Ea(e, t) {
|
|
4462
4487
|
if (e === "*/*" || e === "*") return !0;
|
|
4463
4488
|
if (e.endsWith("/*")) {
|
|
4464
4489
|
let n = e.slice(0, e.length - 1);
|
|
@@ -4466,7 +4491,7 @@ function Ta(e, t) {
|
|
|
4466
4491
|
}
|
|
4467
4492
|
return e === t;
|
|
4468
4493
|
}
|
|
4469
|
-
function
|
|
4494
|
+
function Da(e) {
|
|
4470
4495
|
if (e < 1024) return `${e} B`;
|
|
4471
4496
|
let t = [
|
|
4472
4497
|
"KB",
|
|
@@ -4478,7 +4503,7 @@ function Ea(e) {
|
|
|
4478
4503
|
}
|
|
4479
4504
|
//#endregion
|
|
4480
4505
|
//#region src/components/file-widgets/draft-scope.tsx
|
|
4481
|
-
var
|
|
4506
|
+
var Oa = i({
|
|
4482
4507
|
registerDraft() {},
|
|
4483
4508
|
unregisterDraft() {},
|
|
4484
4509
|
hasDraft() {
|
|
@@ -4487,7 +4512,7 @@ var Da = i({
|
|
|
4487
4512
|
flushAllDrafts: async () => {},
|
|
4488
4513
|
markCommitted() {}
|
|
4489
4514
|
});
|
|
4490
|
-
function
|
|
4515
|
+
function ka({ children: e }) {
|
|
4491
4516
|
let t = f(/* @__PURE__ */ new Map()), n = d(() => ({
|
|
4492
4517
|
registerDraft(e) {
|
|
4493
4518
|
t.current.set(e.fileId, e);
|
|
@@ -4506,16 +4531,16 @@ function Oa({ children: e }) {
|
|
|
4506
4531
|
t.current.clear(), await Promise.allSettled(e.map((e) => Promise.resolve(e.discard())));
|
|
4507
4532
|
}
|
|
4508
4533
|
}), []);
|
|
4509
|
-
return /* @__PURE__ */ b(
|
|
4534
|
+
return /* @__PURE__ */ b(Oa.Provider, {
|
|
4510
4535
|
value: n,
|
|
4511
4536
|
children: e
|
|
4512
4537
|
});
|
|
4513
4538
|
}
|
|
4514
|
-
function ka() {
|
|
4515
|
-
return c(Da);
|
|
4516
|
-
}
|
|
4517
4539
|
function Aa() {
|
|
4518
|
-
|
|
4540
|
+
return c(Oa);
|
|
4541
|
+
}
|
|
4542
|
+
function ja() {
|
|
4543
|
+
let e = Aa();
|
|
4519
4544
|
return {
|
|
4520
4545
|
register: s((t, n) => {
|
|
4521
4546
|
e.registerDraft({
|
|
@@ -4534,17 +4559,17 @@ function Aa() {
|
|
|
4534
4559
|
}
|
|
4535
4560
|
//#endregion
|
|
4536
4561
|
//#region src/components/fields/RichTextField.tsx
|
|
4537
|
-
function
|
|
4538
|
-
let { field: n, entityCode: r, fieldName: i, value: a, mode: o, onChange: s, record: c, compact: l, fieldId: u } = e, m = f(null), h = f(null), g = f(/* @__PURE__ */ new Map()), _ = f(/* @__PURE__ */ new Set()), [v, y] = p(0), [S, C] = p(null), { register: w, unregister: T } =
|
|
4539
|
-
let n = new Set(
|
|
4562
|
+
function Ma(e) {
|
|
4563
|
+
let { field: n, entityCode: r, fieldName: i, value: a, mode: o, onChange: s, record: c, compact: l, fieldId: u } = e, m = f(null), h = f(null), g = f(/* @__PURE__ */ new Map()), _ = f(/* @__PURE__ */ new Set()), [v, y] = p(0), [S, C] = p(null), { register: w, unregister: T } = ja(), E = c?.$files?.[i], O = d(() => sa(a, E), [E, a]), k = O.markdown, A = n.files?.accepts, j = n.files?.max_size_bytes, M = (e, t = O.files) => {
|
|
4564
|
+
let n = new Set(da(e)), r = [];
|
|
4540
4565
|
for (let e of _.current) n.has(e) || r.push(e);
|
|
4541
4566
|
if (r.length > 0) {
|
|
4542
4567
|
for (let e of r) {
|
|
4543
|
-
_.current.delete(e), T(e),
|
|
4568
|
+
_.current.delete(e), T(e), wa(e).catch(() => {});
|
|
4544
4569
|
let t = g.current.get(e);
|
|
4545
4570
|
t && (URL.revokeObjectURL(t), g.current.delete(e));
|
|
4546
4571
|
}
|
|
4547
|
-
s?.(
|
|
4572
|
+
s?.(la({
|
|
4548
4573
|
markdown: e,
|
|
4549
4574
|
files: t
|
|
4550
4575
|
}, r));
|
|
@@ -4554,14 +4579,14 @@ function ja(e) {
|
|
|
4554
4579
|
markdown: e,
|
|
4555
4580
|
files: t
|
|
4556
4581
|
});
|
|
4557
|
-
},
|
|
4558
|
-
let r = m.current, i = r?.selectionStart ?? e.markdown.length, a = r?.selectionEnd ?? e.markdown.length, o = `${e.markdown.slice(0, i)}${t}${e.markdown.slice(a)}`, s = n ?
|
|
4582
|
+
}, ee = (e, t, n) => {
|
|
4583
|
+
let r = m.current, i = r?.selectionStart ?? e.markdown.length, a = r?.selectionEnd ?? e.markdown.length, o = `${e.markdown.slice(0, i)}${t}${e.markdown.slice(a)}`, s = n ? ca(e, n).files : e.files;
|
|
4559
4584
|
M(o, s), requestAnimationFrame(() => {
|
|
4560
4585
|
if (!r) return;
|
|
4561
4586
|
let e = i + t.length;
|
|
4562
4587
|
r.focus(), r.setSelectionRange(e, e);
|
|
4563
4588
|
});
|
|
4564
|
-
},
|
|
4589
|
+
}, N = async (e) => {
|
|
4565
4590
|
if (!r || !n.files) return;
|
|
4566
4591
|
let t = Array.from(e);
|
|
4567
4592
|
if (t.length === 0) return;
|
|
@@ -4571,28 +4596,28 @@ function ja(e) {
|
|
|
4571
4596
|
files: O.files
|
|
4572
4597
|
};
|
|
4573
4598
|
for (let e of t) {
|
|
4574
|
-
let n =
|
|
4599
|
+
let n = Ta(e, A, j);
|
|
4575
4600
|
if (n) {
|
|
4576
4601
|
C(n.message), y((e) => e - 1);
|
|
4577
4602
|
continue;
|
|
4578
4603
|
}
|
|
4579
4604
|
try {
|
|
4580
|
-
let n = await
|
|
4605
|
+
let n = await ha({
|
|
4581
4606
|
file: e,
|
|
4582
4607
|
entityCode: r,
|
|
4583
4608
|
fieldCode: i
|
|
4584
4609
|
}), o = e.type.startsWith("image/") ? URL.createObjectURL(e) : void 0;
|
|
4585
4610
|
o && g.current.set(n.id, o);
|
|
4586
|
-
let s =
|
|
4587
|
-
if (w(n.id, () =>
|
|
4588
|
-
let e =
|
|
4589
|
-
|
|
4611
|
+
let s = Pa(n, o);
|
|
4612
|
+
if (w(n.id, () => wa(n.id)), _.current.add(n.id), t.length === 1) {
|
|
4613
|
+
let e = Na(a.markdown, pa(s));
|
|
4614
|
+
ee(a, e, s), a = ca({
|
|
4590
4615
|
markdown: `${a.markdown}${e}`,
|
|
4591
4616
|
files: a.files
|
|
4592
4617
|
}, s);
|
|
4593
4618
|
} else {
|
|
4594
|
-
let e =
|
|
4595
|
-
a =
|
|
4619
|
+
let e = Na(a.markdown, pa(s));
|
|
4620
|
+
a = ca({
|
|
4596
4621
|
markdown: `${a.markdown}${e}`,
|
|
4597
4622
|
files: a.files
|
|
4598
4623
|
}, s), M(a.markdown, a.files);
|
|
@@ -4604,7 +4629,7 @@ function ja(e) {
|
|
|
4604
4629
|
}
|
|
4605
4630
|
}
|
|
4606
4631
|
};
|
|
4607
|
-
return o === "display" ? k ? /* @__PURE__ */ b(
|
|
4632
|
+
return o === "display" ? k ? /* @__PURE__ */ b(ei, {
|
|
4608
4633
|
content: k,
|
|
4609
4634
|
files: O.files
|
|
4610
4635
|
}) : /* @__PURE__ */ b("span", {
|
|
@@ -4665,7 +4690,7 @@ function ja(e) {
|
|
|
4665
4690
|
accept: A?.join(","),
|
|
4666
4691
|
multiple: !0,
|
|
4667
4692
|
onChange: (e) => {
|
|
4668
|
-
e.target.files &&
|
|
4693
|
+
e.target.files && N(e.target.files), e.target.value = "";
|
|
4669
4694
|
}
|
|
4670
4695
|
}),
|
|
4671
4696
|
/* @__PURE__ */ b("textarea", {
|
|
@@ -4677,11 +4702,11 @@ function ja(e) {
|
|
|
4677
4702
|
onChange: (e) => M(e.target.value),
|
|
4678
4703
|
onPaste: (e) => {
|
|
4679
4704
|
let t = Array.from(e.clipboardData.files ?? []).filter((e) => e.size > 0);
|
|
4680
|
-
t.length !== 0 && (e.preventDefault(),
|
|
4705
|
+
t.length !== 0 && (e.preventDefault(), N(t));
|
|
4681
4706
|
},
|
|
4682
4707
|
onDrop: (e) => {
|
|
4683
4708
|
let t = Array.from(e.dataTransfer.files ?? []).filter((e) => e.size > 0);
|
|
4684
|
-
t.length !== 0 && (e.preventDefault(),
|
|
4709
|
+
t.length !== 0 && (e.preventDefault(), N(t));
|
|
4685
4710
|
},
|
|
4686
4711
|
onDragOver: (e) => e.preventDefault(),
|
|
4687
4712
|
rows: 12,
|
|
@@ -4720,7 +4745,7 @@ function ja(e) {
|
|
|
4720
4745
|
marginBottom: 8
|
|
4721
4746
|
},
|
|
4722
4747
|
children: "Preview"
|
|
4723
|
-
}), k ? /* @__PURE__ */ b(
|
|
4748
|
+
}), k ? /* @__PURE__ */ b(ei, {
|
|
4724
4749
|
content: k,
|
|
4725
4750
|
files: O.files
|
|
4726
4751
|
}) : /* @__PURE__ */ b("span", {
|
|
@@ -4734,10 +4759,10 @@ function ja(e) {
|
|
|
4734
4759
|
]
|
|
4735
4760
|
});
|
|
4736
4761
|
}
|
|
4737
|
-
function
|
|
4762
|
+
function Na(e, t) {
|
|
4738
4763
|
return e ? e.endsWith("\n\n") ? t : e.endsWith("\n") ? `\n${t}` : `\n\n${t}` : `${t}\n`;
|
|
4739
4764
|
}
|
|
4740
|
-
function
|
|
4765
|
+
function Pa(e, t) {
|
|
4741
4766
|
return {
|
|
4742
4767
|
id: e.id,
|
|
4743
4768
|
filename: e.filename,
|
|
@@ -4752,8 +4777,8 @@ function Na(e, t) {
|
|
|
4752
4777
|
}
|
|
4753
4778
|
//#endregion
|
|
4754
4779
|
//#region src/components/fields/cells/factories/text.ts
|
|
4755
|
-
var
|
|
4756
|
-
let { field: t, fieldName: n, locale: r = "en" } = e, i =
|
|
4780
|
+
var Fa = () => (e) => e == null || e === "" ? "—" : R(e), Ia = (e) => {
|
|
4781
|
+
let { field: t, fieldName: n, locale: r = "en" } = e, i = La(t, n, r);
|
|
4757
4782
|
return (e) => {
|
|
4758
4783
|
if (e == null) return "—";
|
|
4759
4784
|
let t = !!e;
|
|
@@ -4764,12 +4789,12 @@ var Pa = () => (e) => e == null || e === "" ? "—" : L(e), Fa = (e) => {
|
|
|
4764
4789
|
});
|
|
4765
4790
|
};
|
|
4766
4791
|
};
|
|
4767
|
-
function
|
|
4792
|
+
function La(e, t, n) {
|
|
4768
4793
|
if (e.display?.bool_labels) return {
|
|
4769
|
-
trueLabel:
|
|
4770
|
-
falseLabel:
|
|
4794
|
+
trueLabel: z(e.display.bool_labels.true, n) || "Yes",
|
|
4795
|
+
falseLabel: z(e.display.bool_labels.false, n) || "No"
|
|
4771
4796
|
};
|
|
4772
|
-
let r = e.display?.name ?
|
|
4797
|
+
let r = e.display?.name ? z(e.display.name, n) : "";
|
|
4773
4798
|
if (r.startsWith("Is ")) {
|
|
4774
4799
|
let e = r.slice(3).trim();
|
|
4775
4800
|
return {
|
|
@@ -4785,14 +4810,14 @@ function Ia(e, t, n) {
|
|
|
4785
4810
|
};
|
|
4786
4811
|
}
|
|
4787
4812
|
if (t.startsWith("is_")) {
|
|
4788
|
-
let e =
|
|
4813
|
+
let e = Ra(t.slice(3));
|
|
4789
4814
|
return {
|
|
4790
4815
|
trueLabel: e,
|
|
4791
4816
|
falseLabel: `Not ${e}`
|
|
4792
4817
|
};
|
|
4793
4818
|
}
|
|
4794
4819
|
if (t.startsWith("has_")) {
|
|
4795
|
-
let e =
|
|
4820
|
+
let e = Ra(t.slice(4));
|
|
4796
4821
|
return {
|
|
4797
4822
|
trueLabel: e,
|
|
4798
4823
|
falseLabel: `No ${e}`
|
|
@@ -4803,12 +4828,12 @@ function Ia(e, t, n) {
|
|
|
4803
4828
|
falseLabel: "No"
|
|
4804
4829
|
};
|
|
4805
4830
|
}
|
|
4806
|
-
function
|
|
4831
|
+
function Ra(e) {
|
|
4807
4832
|
return e.split("_").map((e) => e && e[0].toUpperCase() + e.slice(1)).join(" ");
|
|
4808
4833
|
}
|
|
4809
4834
|
//#endregion
|
|
4810
4835
|
//#region src/components/fields/cells/factories/badge.tsx
|
|
4811
|
-
var
|
|
4836
|
+
var za = /* @__PURE__ */ new Set([
|
|
4812
4837
|
"indigo",
|
|
4813
4838
|
"emerald",
|
|
4814
4839
|
"amber",
|
|
@@ -4818,17 +4843,17 @@ var Ra = /* @__PURE__ */ new Set([
|
|
|
4818
4843
|
"slate",
|
|
4819
4844
|
"teal"
|
|
4820
4845
|
]);
|
|
4821
|
-
function
|
|
4822
|
-
return e &&
|
|
4846
|
+
function Ba(e) {
|
|
4847
|
+
return e && za.has(e) ? e : "slate";
|
|
4823
4848
|
}
|
|
4824
|
-
var
|
|
4849
|
+
var Va = (e) => {
|
|
4825
4850
|
let { field: t, locale: n = "en" } = e, r = /* @__PURE__ */ new Map();
|
|
4826
4851
|
if (t.values) for (let e of t.values) r.set(e.code, {
|
|
4827
|
-
tone:
|
|
4828
|
-
label:
|
|
4852
|
+
tone: Ba(e.color),
|
|
4853
|
+
label: z(e.name, n) || e.code
|
|
4829
4854
|
});
|
|
4830
4855
|
if (t.display?.value_map) for (let [e, i] of Object.entries(t.display.value_map)) {
|
|
4831
|
-
let t = r.get(e), a = i.color ?
|
|
4856
|
+
let t = r.get(e), a = i.color ? Ba(i.color) : t?.tone ?? "slate", o = (i.label ? z(i.label, n) : "") || t?.label || e;
|
|
4832
4857
|
r.set(e, {
|
|
4833
4858
|
tone: a,
|
|
4834
4859
|
label: o
|
|
@@ -4836,14 +4861,14 @@ var Ba = (e) => {
|
|
|
4836
4861
|
}
|
|
4837
4862
|
return (e) => {
|
|
4838
4863
|
if (e == null || e === "") return "—";
|
|
4839
|
-
let t =
|
|
4864
|
+
let t = R(e), n = r.get(t);
|
|
4840
4865
|
return /* @__PURE__ */ b(k, {
|
|
4841
4866
|
tone: n?.tone ?? "slate",
|
|
4842
4867
|
size: "xs",
|
|
4843
4868
|
children: n?.label ?? t
|
|
4844
4869
|
});
|
|
4845
4870
|
};
|
|
4846
|
-
},
|
|
4871
|
+
}, Ha = /* @__PURE__ */ new Set([
|
|
4847
4872
|
"indigo",
|
|
4848
4873
|
"emerald",
|
|
4849
4874
|
"amber",
|
|
@@ -4853,25 +4878,25 @@ var Ba = (e) => {
|
|
|
4853
4878
|
"slate",
|
|
4854
4879
|
"teal"
|
|
4855
4880
|
]);
|
|
4856
|
-
function
|
|
4857
|
-
return e &&
|
|
4881
|
+
function Ua(e) {
|
|
4882
|
+
return e && Ha.has(e) ? e : "slate";
|
|
4858
4883
|
}
|
|
4859
|
-
var
|
|
4884
|
+
var Wa = (e) => {
|
|
4860
4885
|
let { entity: t, locale: n = "en" } = e, r = /* @__PURE__ */ new Map();
|
|
4861
4886
|
if (t?.status_groups) for (let e of Object.values(t.status_groups)) for (let t of e.statuses) r.set(t.code, {
|
|
4862
|
-
tone:
|
|
4863
|
-
label:
|
|
4887
|
+
tone: Ua(t.color),
|
|
4888
|
+
label: z(t.name, n) || t.code
|
|
4864
4889
|
});
|
|
4865
4890
|
return (e) => {
|
|
4866
4891
|
if (e == null || e === "") return "—";
|
|
4867
|
-
let t =
|
|
4892
|
+
let t = R(e), n = r.get(t);
|
|
4868
4893
|
return /* @__PURE__ */ b(k, {
|
|
4869
4894
|
tone: n?.tone ?? "slate",
|
|
4870
4895
|
size: "xs",
|
|
4871
4896
|
children: n?.label ?? t
|
|
4872
4897
|
});
|
|
4873
4898
|
};
|
|
4874
|
-
},
|
|
4899
|
+
}, Ga = /* @__PURE__ */ new Set([
|
|
4875
4900
|
"indigo",
|
|
4876
4901
|
"emerald",
|
|
4877
4902
|
"amber",
|
|
@@ -4881,14 +4906,14 @@ var Ua = (e) => {
|
|
|
4881
4906
|
"slate",
|
|
4882
4907
|
"teal"
|
|
4883
4908
|
]);
|
|
4884
|
-
function
|
|
4885
|
-
return e &&
|
|
4909
|
+
function Ka(e) {
|
|
4910
|
+
return e && Ga.has(e) ? e : null;
|
|
4886
4911
|
}
|
|
4887
|
-
var
|
|
4912
|
+
var qa = (e) => {
|
|
4888
4913
|
let { field: t, locale: n = "en" } = e, r = /* @__PURE__ */ new Map();
|
|
4889
4914
|
if (t.display?.value_map) for (let [e, i] of Object.entries(t.display.value_map)) r.set(e, {
|
|
4890
|
-
label: i.label &&
|
|
4891
|
-
tone:
|
|
4915
|
+
label: i.label && z(i.label, n) || e,
|
|
4916
|
+
tone: Ka(i.color)
|
|
4892
4917
|
});
|
|
4893
4918
|
return (e) => !Array.isArray(e) || e.length === 0 ? "—" : /* @__PURE__ */ b("span", {
|
|
4894
4919
|
style: {
|
|
@@ -4905,23 +4930,26 @@ var Ka = (e) => {
|
|
|
4905
4930
|
}, `${n}-${t}`) : /* @__PURE__ */ b(P, { children: i?.label ?? n }, `${n}-${t}`);
|
|
4906
4931
|
})
|
|
4907
4932
|
});
|
|
4908
|
-
},
|
|
4933
|
+
}, Ja = () => (e) => {
|
|
4909
4934
|
if (e == null || e === "") return "—";
|
|
4910
|
-
let { text: t, absolute: n } =
|
|
4935
|
+
let { text: t, absolute: n } = He(typeof e == "string" ? e : R(e));
|
|
4911
4936
|
return /* @__PURE__ */ b("span", {
|
|
4912
4937
|
title: n,
|
|
4913
4938
|
children: t
|
|
4914
4939
|
});
|
|
4915
|
-
},
|
|
4940
|
+
}, Ya = () => (e) => e == null || e === "" ? "—" : Ve(typeof e == "string" ? e : R(e)), Xa = 6e4, Za = 3e5, Qa = () => (e) => {
|
|
4916
4941
|
if (e == null || e === "") return "—";
|
|
4917
|
-
let t = typeof e == "string" ? e :
|
|
4942
|
+
let t = typeof e == "string" ? e : R(e), n = new Date(t);
|
|
4918
4943
|
if (isNaN(n.getTime())) return t;
|
|
4919
|
-
let r =
|
|
4920
|
-
if (i <= 0)
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4944
|
+
let r = Ve(t), i = Date.now() - n.getTime();
|
|
4945
|
+
if (i <= 0) {
|
|
4946
|
+
let e = C(n, /* @__PURE__ */ new Date(), { addSuffix: !1 });
|
|
4947
|
+
return /* @__PURE__ */ x("span", {
|
|
4948
|
+
title: r,
|
|
4949
|
+
children: ["in ", e]
|
|
4950
|
+
});
|
|
4951
|
+
}
|
|
4952
|
+
if (i <= Xa) return /* @__PURE__ */ b("span", {
|
|
4925
4953
|
title: r,
|
|
4926
4954
|
children: /* @__PURE__ */ b(k, {
|
|
4927
4955
|
tone: "slate",
|
|
@@ -4933,17 +4961,17 @@ var Ka = (e) => {
|
|
|
4933
4961
|
return /* @__PURE__ */ b("span", {
|
|
4934
4962
|
title: r,
|
|
4935
4963
|
children: /* @__PURE__ */ x(k, {
|
|
4936
|
-
tone: i <=
|
|
4964
|
+
tone: i <= Za ? "amber" : "rose",
|
|
4937
4965
|
size: "xs",
|
|
4938
4966
|
children: ["overdue ", a]
|
|
4939
4967
|
})
|
|
4940
4968
|
});
|
|
4941
|
-
},
|
|
4942
|
-
let { field: t, locale: n = "en" } = e, r = t.display?.currency || "USD", i = t.display?.currency_field, a =
|
|
4969
|
+
}, $a = (e) => {
|
|
4970
|
+
let { field: t, locale: n = "en" } = e, r = t.display?.currency || "USD", i = t.display?.currency_field, a = eo(t.display?.currency_display), o = to(typeof t.scale == "number" ? t.scale : 2, 0, 6), s = /* @__PURE__ */ new Map();
|
|
4943
4971
|
return (e, t = {}) => {
|
|
4944
4972
|
if (e == null || e === "") return "—";
|
|
4945
4973
|
let c = typeof e == "number" ? e : Number(e);
|
|
4946
|
-
if (!Number.isFinite(c)) return
|
|
4974
|
+
if (!Number.isFinite(c)) return R(e);
|
|
4947
4975
|
let l = i ? t[i] : void 0, u = typeof l == "string" && l !== "" ? l : r, d = `${n}:${u}:${a}:${o}`, f = s.get(d);
|
|
4948
4976
|
return f || (f = new Intl.NumberFormat(n, {
|
|
4949
4977
|
style: "currency",
|
|
@@ -4954,7 +4982,7 @@ var Ka = (e) => {
|
|
|
4954
4982
|
}), s.set(d, f)), f.format(c);
|
|
4955
4983
|
};
|
|
4956
4984
|
};
|
|
4957
|
-
function
|
|
4985
|
+
function eo(e) {
|
|
4958
4986
|
switch (e) {
|
|
4959
4987
|
case "narrow_symbol": return "narrowSymbol";
|
|
4960
4988
|
case "code":
|
|
@@ -4963,16 +4991,16 @@ function $a(e) {
|
|
|
4963
4991
|
default: return "symbol";
|
|
4964
4992
|
}
|
|
4965
4993
|
}
|
|
4966
|
-
function
|
|
4994
|
+
function to(e, t, n) {
|
|
4967
4995
|
return e < t ? t : e > n ? n : e;
|
|
4968
4996
|
}
|
|
4969
4997
|
//#endregion
|
|
4970
4998
|
//#region src/components/fields/cells/factories/refLink.tsx
|
|
4971
|
-
var
|
|
4999
|
+
var no = (e) => {
|
|
4972
5000
|
let { field: t, entities: r, screens: i, refs: a, surface: o } = e, s = t.ref?.entity, c = s ? r?.[s] : void 0, l = typeof a == "function" ? a : () => a, u = o === "detail", d = c?.display?.icon, f = t.display?.ref_display_field || "$display", p = c?.detail_screen, m = (p ? i?.[p] : void 0)?.route;
|
|
4973
5001
|
return (e, t) => {
|
|
4974
5002
|
if (e == null || e === "") return "—";
|
|
4975
|
-
let r =
|
|
5003
|
+
let r = R(e), i = ro(r, s, l(), f), a = m ? m.replace(":id", encodeURIComponent(r)) : void 0;
|
|
4976
5004
|
if (u) {
|
|
4977
5005
|
let e = /* @__PURE__ */ x(y, { children: [d && /* @__PURE__ */ b("span", {
|
|
4978
5006
|
style: {
|
|
@@ -5014,29 +5042,29 @@ var to = (e) => {
|
|
|
5014
5042
|
}) : i;
|
|
5015
5043
|
};
|
|
5016
5044
|
};
|
|
5017
|
-
function
|
|
5045
|
+
function ro(e, t, n, r) {
|
|
5018
5046
|
let i = t && n ? n[t]?.[e] : void 0;
|
|
5019
|
-
return i ?
|
|
5047
|
+
return i ? Ge(i, r, e) : e;
|
|
5020
5048
|
}
|
|
5021
5049
|
//#endregion
|
|
5022
5050
|
//#region src/components/fields/cells/factories/url-helpers.ts
|
|
5023
|
-
var
|
|
5024
|
-
function ao(e) {
|
|
5025
|
-
return /^[a-z]{2,3}$/i.test(e) || io.test(e);
|
|
5026
|
-
}
|
|
5051
|
+
var io = /^(https?|ftps?|ssh|mailto|tel):/i, ao = /^(info|name|tech|site|cloud|online|store|shop|blog|space|world|link|live|page|zone|life|team|work|host|land|news|wiki|mobi|coop|aero|asia)$/i;
|
|
5027
5052
|
function oo(e) {
|
|
5053
|
+
return /^[a-z]{2,3}$/i.test(e) || ao.test(e);
|
|
5054
|
+
}
|
|
5055
|
+
function so(e) {
|
|
5028
5056
|
if (!e.includes(".")) return !1;
|
|
5029
5057
|
let t = e.split(".");
|
|
5030
5058
|
if (t.length < 3) return !0;
|
|
5031
5059
|
let n = t[0].toLowerCase();
|
|
5032
|
-
return /^(com|org|net|edu|gov)$/.test(n) ? !1 : !/^(io|app|dev)$/.test(n) ||
|
|
5060
|
+
return /^(com|org|net|edu|gov)$/.test(n) ? !1 : !/^(io|app|dev)$/.test(n) || oo(t[t.length - 1]);
|
|
5033
5061
|
}
|
|
5034
|
-
function
|
|
5035
|
-
if (
|
|
5062
|
+
function co(e) {
|
|
5063
|
+
if (io.test(e)) return e;
|
|
5036
5064
|
let t = e.match(/^([a-z][a-z0-9+.-]*):/i);
|
|
5037
5065
|
if (t) {
|
|
5038
5066
|
let n = t[1], r = e.slice(t[0].length);
|
|
5039
|
-
if (/^\d+([/?#]|$)/.test(r) &&
|
|
5067
|
+
if (/^\d+([/?#]|$)/.test(r) && so(n)) {
|
|
5040
5068
|
let t = parseInt(r, 10);
|
|
5041
5069
|
if (t >= 1 && t <= 65535) return `https://${e}`;
|
|
5042
5070
|
}
|
|
@@ -5044,14 +5072,14 @@ function so(e) {
|
|
|
5044
5072
|
}
|
|
5045
5073
|
return `https://${e}`;
|
|
5046
5074
|
}
|
|
5047
|
-
function
|
|
5075
|
+
function lo(e) {
|
|
5048
5076
|
try {
|
|
5049
5077
|
return new URL(e).hostname.replace(/^www\./i, "") || null;
|
|
5050
5078
|
} catch {
|
|
5051
5079
|
return null;
|
|
5052
5080
|
}
|
|
5053
5081
|
}
|
|
5054
|
-
function
|
|
5082
|
+
function uo(e, t) {
|
|
5055
5083
|
if (t !== "linkedin.com") return null;
|
|
5056
5084
|
try {
|
|
5057
5085
|
let t = new URL(e).pathname.match(/^\/(in|company|school)\/([^/]+)/i);
|
|
@@ -5059,7 +5087,7 @@ function lo(e, t) {
|
|
|
5059
5087
|
} catch {}
|
|
5060
5088
|
return null;
|
|
5061
5089
|
}
|
|
5062
|
-
function
|
|
5090
|
+
function fo(e) {
|
|
5063
5091
|
try {
|
|
5064
5092
|
return new URL(e), !0;
|
|
5065
5093
|
} catch {
|
|
@@ -5068,7 +5096,7 @@ function uo(e) {
|
|
|
5068
5096
|
}
|
|
5069
5097
|
//#endregion
|
|
5070
5098
|
//#region src/components/fields/cells/factories/host-icons.tsx
|
|
5071
|
-
function
|
|
5099
|
+
function po(e, t = "0 0 24 24") {
|
|
5072
5100
|
return (n) => /* @__PURE__ */ b("svg", {
|
|
5073
5101
|
width: 16,
|
|
5074
5102
|
height: 16,
|
|
@@ -5084,17 +5112,17 @@ function fo(e, t = "0 0 24 24") {
|
|
|
5084
5112
|
children: e
|
|
5085
5113
|
});
|
|
5086
5114
|
}
|
|
5087
|
-
var
|
|
5115
|
+
var mo = po(/* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("circle", {
|
|
5088
5116
|
cx: "12",
|
|
5089
5117
|
cy: "12",
|
|
5090
5118
|
r: "9"
|
|
5091
|
-
}), /* @__PURE__ */ b("path", { d: "M3 12h18M12 3c3 3 3 15 0 18-3-3-3-15 0-18" })] })),
|
|
5119
|
+
}), /* @__PURE__ */ b("path", { d: "M3 12h18M12 3c3 3 3 15 0 18-3-3-3-15 0-18" })] })), ho = () => /* @__PURE__ */ b(e, {
|
|
5092
5120
|
size: 16,
|
|
5093
5121
|
style: {
|
|
5094
5122
|
flexShrink: 0,
|
|
5095
5123
|
color: "#0A66C2"
|
|
5096
5124
|
}
|
|
5097
|
-
}),
|
|
5125
|
+
}), go = (e) => /* @__PURE__ */ b("svg", {
|
|
5098
5126
|
width: 16,
|
|
5099
5127
|
height: 16,
|
|
5100
5128
|
viewBox: "0 0 24 24",
|
|
@@ -5103,7 +5131,7 @@ var po = fo(/* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("circle", {
|
|
|
5103
5131
|
style: { flexShrink: 0 },
|
|
5104
5132
|
...e,
|
|
5105
5133
|
children: /* @__PURE__ */ b("path", { d: "M12 .5a11.5 11.5 0 0 0-3.64 22.41c.58.1.79-.25.79-.56 0-.27-.01-1-.02-1.96-3.21.7-3.89-1.55-3.89-1.55-.52-1.34-1.28-1.7-1.28-1.7-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.2 1.77 1.2 1.03 1.77 2.71 1.26 3.37.96.1-.75.4-1.26.73-1.55-2.56-.29-5.26-1.28-5.26-5.71 0-1.26.45-2.3 1.19-3.11-.12-.29-.52-1.46.11-3.05 0 0 .97-.31 3.18 1.19a11.05 11.05 0 0 1 5.79 0c2.21-1.5 3.18-1.19 3.18-1.19.63 1.59.23 2.76.11 3.05.74.81 1.19 1.85 1.19 3.11 0 4.44-2.71 5.42-5.29 5.7.41.36.78 1.07.78 2.16 0 1.56-.01 2.81-.01 3.19 0 .31.21.68.8.56A11.5 11.5 0 0 0 12 .5z" })
|
|
5106
|
-
}),
|
|
5134
|
+
}), _o = (e) => /* @__PURE__ */ b("svg", {
|
|
5107
5135
|
width: 16,
|
|
5108
5136
|
height: 16,
|
|
5109
5137
|
viewBox: "0 0 24 24",
|
|
@@ -5112,7 +5140,7 @@ var po = fo(/* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("circle", {
|
|
|
5112
5140
|
style: { flexShrink: 0 },
|
|
5113
5141
|
...e,
|
|
5114
5142
|
children: /* @__PURE__ */ b("path", { d: "M18.244 2H21.5l-7.62 8.71L23 22h-7.05l-5.52-7.21L4.07 22H.81l8.18-9.34L1 2h7.22l5 6.59L18.244 2zm-2.47 18h1.95L7.32 4h-2.1l10.55 16z" })
|
|
5115
|
-
}),
|
|
5143
|
+
}), vo = (e) => /* @__PURE__ */ b("svg", {
|
|
5116
5144
|
width: 16,
|
|
5117
5145
|
height: 16,
|
|
5118
5146
|
viewBox: "0 0 24 24",
|
|
@@ -5121,7 +5149,7 @@ var po = fo(/* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("circle", {
|
|
|
5121
5149
|
style: { flexShrink: 0 },
|
|
5122
5150
|
...e,
|
|
5123
5151
|
children: /* @__PURE__ */ b("path", { d: "M23.5 6.2a3 3 0 0 0-2.1-2.1C19.5 3.6 12 3.6 12 3.6s-7.5 0-9.4.5A3 3 0 0 0 .5 6.2C0 8.1 0 12 0 12s0 3.9.5 5.8a3 3 0 0 0 2.1 2.1c1.9.5 9.4.5 9.4.5s7.5 0 9.4-.5a3 3 0 0 0 2.1-2.1c.5-1.9.5-5.8.5-5.8s0-3.9-.5-5.8zM9.6 15.6V8.4l6.2 3.6-6.2 3.6z" })
|
|
5124
|
-
}),
|
|
5152
|
+
}), yo = (e) => /* @__PURE__ */ b("svg", {
|
|
5125
5153
|
width: 16,
|
|
5126
5154
|
height: 16,
|
|
5127
5155
|
viewBox: "0 0 24 24",
|
|
@@ -5130,7 +5158,7 @@ var po = fo(/* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("circle", {
|
|
|
5130
5158
|
style: { flexShrink: 0 },
|
|
5131
5159
|
...e,
|
|
5132
5160
|
children: /* @__PURE__ */ b("path", { d: "M24 5.45v13.1A1.45 1.45 0 0 1 22.55 20H19.5V9.27L12 14.7 4.5 9.27V20H1.45A1.45 1.45 0 0 1 0 18.55V5.45A1.45 1.45 0 0 1 1.45 4h.5l10.05 7.27L22.05 4h.5A1.45 1.45 0 0 1 24 5.45z" })
|
|
5133
|
-
}),
|
|
5161
|
+
}), bo = (e) => /* @__PURE__ */ x("svg", {
|
|
5134
5162
|
width: 16,
|
|
5135
5163
|
height: 16,
|
|
5136
5164
|
viewBox: "0 0 24 24",
|
|
@@ -5155,7 +5183,7 @@ var po = fo(/* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("circle", {
|
|
|
5155
5183
|
d: "M15.17 18.96a2.52 2.52 0 1 1-2.52 2.52v-2.52h2.52zm0-1.27a2.52 2.52 0 1 1 0-5.04h6.31a2.52 2.52 0 1 1 0 5.04h-6.31z"
|
|
5156
5184
|
})
|
|
5157
5185
|
]
|
|
5158
|
-
}),
|
|
5186
|
+
}), xo = (e) => /* @__PURE__ */ b("svg", {
|
|
5159
5187
|
width: 16,
|
|
5160
5188
|
height: 16,
|
|
5161
5189
|
viewBox: "0 0 24 24",
|
|
@@ -5164,39 +5192,39 @@ var po = fo(/* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("circle", {
|
|
|
5164
5192
|
style: { flexShrink: 0 },
|
|
5165
5193
|
...e,
|
|
5166
5194
|
children: /* @__PURE__ */ b("path", { d: "M4.46 3.83 14.94 3a3.7 3.7 0 0 1 2.5.62l3 2.16a1.4 1.4 0 0 1 .56 1.31v13.06a1.7 1.7 0 0 1-1.66 1.7l-12.5.78a2.4 2.4 0 0 1-1.85-.62L2.5 19.7a1.7 1.7 0 0 1-.5-1.2V5.16c0-.74.6-1.27 1.46-1.33l1-.01zm.46 1.86c-.31 0-.46.16-.46.47v12.25c0 .31.16.47.46.47l11.62-.7c.31 0 .46-.16.46-.47V6c0-.32-.16-.47-.46-.47L4.92 5.7zm5.57 2.32c.16 0 .31.16.31.31v.46l3.7.23c.31 0 .46.16.46.47v8.32c0 .31-.16.47-.46.47l-3.7.23c-.31 0-.46-.16-.46-.47V8.78c0-.16.15-.32.15-.46l-.04-.31z" })
|
|
5167
|
-
}),
|
|
5168
|
-
"linkedin.com":
|
|
5169
|
-
"github.com":
|
|
5170
|
-
"x.com":
|
|
5171
|
-
"twitter.com":
|
|
5172
|
-
"youtube.com":
|
|
5173
|
-
"youtu.be":
|
|
5174
|
-
"gmail.com":
|
|
5175
|
-
"mail.google.com":
|
|
5176
|
-
"slack.com":
|
|
5177
|
-
"notion.so":
|
|
5178
|
-
"notion.com":
|
|
5195
|
+
}), So = {
|
|
5196
|
+
"linkedin.com": ho,
|
|
5197
|
+
"github.com": go,
|
|
5198
|
+
"x.com": _o,
|
|
5199
|
+
"twitter.com": _o,
|
|
5200
|
+
"youtube.com": vo,
|
|
5201
|
+
"youtu.be": vo,
|
|
5202
|
+
"gmail.com": yo,
|
|
5203
|
+
"mail.google.com": yo,
|
|
5204
|
+
"slack.com": bo,
|
|
5205
|
+
"notion.so": xo,
|
|
5206
|
+
"notion.com": xo
|
|
5179
5207
|
};
|
|
5180
|
-
function
|
|
5208
|
+
function Co(e, t) {
|
|
5181
5209
|
return !e || t === "none" ? null : t === "google" ? `https://www.google.com/s2/favicons?domain=${encodeURIComponent(e)}&sz=32` : `https://${e}/favicon.ico`;
|
|
5182
5210
|
}
|
|
5183
|
-
var
|
|
5211
|
+
var wo = {
|
|
5184
5212
|
width: 16,
|
|
5185
5213
|
height: 16,
|
|
5186
5214
|
flexShrink: 0,
|
|
5187
5215
|
objectFit: "contain"
|
|
5188
5216
|
};
|
|
5189
|
-
function
|
|
5190
|
-
let n = e ? e.toLowerCase() : "", r = n ?
|
|
5217
|
+
function To({ domain: e, source: t }) {
|
|
5218
|
+
let n = e ? e.toLowerCase() : "", r = n ? So[n] : void 0;
|
|
5191
5219
|
if (r) return /* @__PURE__ */ b(r, {});
|
|
5192
|
-
let i =
|
|
5193
|
-
return i ? /* @__PURE__ */ b(
|
|
5220
|
+
let i = Co(n, t);
|
|
5221
|
+
return i ? /* @__PURE__ */ b(Eo, { src: i }) : /* @__PURE__ */ b(mo, {});
|
|
5194
5222
|
}
|
|
5195
|
-
function
|
|
5223
|
+
function Eo({ src: e }) {
|
|
5196
5224
|
let [t, n] = p(!1);
|
|
5197
5225
|
return l(() => {
|
|
5198
5226
|
n(!1);
|
|
5199
|
-
}, [e]), t ? /* @__PURE__ */ b(
|
|
5227
|
+
}, [e]), t ? /* @__PURE__ */ b(mo, {}) : /* @__PURE__ */ b("img", {
|
|
5200
5228
|
src: e,
|
|
5201
5229
|
alt: "",
|
|
5202
5230
|
width: 16,
|
|
@@ -5204,7 +5232,7 @@ function To({ src: e }) {
|
|
|
5204
5232
|
loading: "lazy",
|
|
5205
5233
|
decoding: "async",
|
|
5206
5234
|
referrerPolicy: "no-referrer",
|
|
5207
|
-
style:
|
|
5235
|
+
style: wo,
|
|
5208
5236
|
onError: () => n(!0)
|
|
5209
5237
|
});
|
|
5210
5238
|
}
|
|
@@ -5214,33 +5242,33 @@ var $ = /* @__PURE__ */ b("span", {
|
|
|
5214
5242
|
color: "var(--text-4)"
|
|
5215
5243
|
},
|
|
5216
5244
|
children: "—"
|
|
5217
|
-
}),
|
|
5245
|
+
}), Do = {
|
|
5218
5246
|
display: "inline-flex",
|
|
5219
5247
|
alignItems: "center",
|
|
5220
5248
|
gap: 4,
|
|
5221
5249
|
fontSize: 12.5,
|
|
5222
5250
|
color: "var(--accent)",
|
|
5223
5251
|
textDecoration: "none"
|
|
5224
|
-
},
|
|
5252
|
+
}, Oo = { fontSize: 12.5 }, ko = (e) => {
|
|
5225
5253
|
let n = e.field.display?.favicon_source ?? "google";
|
|
5226
5254
|
return (e) => {
|
|
5227
|
-
let r = e == null ? "" :
|
|
5255
|
+
let r = e == null ? "" : R(e);
|
|
5228
5256
|
if (!r) return $;
|
|
5229
|
-
let i =
|
|
5230
|
-
if (i == null || !
|
|
5231
|
-
style:
|
|
5257
|
+
let i = co(r);
|
|
5258
|
+
if (i == null || !fo(i)) return /* @__PURE__ */ b("span", {
|
|
5259
|
+
style: Oo,
|
|
5232
5260
|
children: r
|
|
5233
5261
|
});
|
|
5234
|
-
let a =
|
|
5262
|
+
let a = lo(i), o = uo(i, a ?? "") ?? a ?? r;
|
|
5235
5263
|
return /* @__PURE__ */ x("a", {
|
|
5236
5264
|
href: i,
|
|
5237
5265
|
target: "_blank",
|
|
5238
5266
|
rel: "noopener noreferrer",
|
|
5239
5267
|
title: r,
|
|
5240
5268
|
className: "mono",
|
|
5241
|
-
style:
|
|
5269
|
+
style: Do,
|
|
5242
5270
|
children: [
|
|
5243
|
-
/* @__PURE__ */ b(
|
|
5271
|
+
/* @__PURE__ */ b(To, {
|
|
5244
5272
|
domain: a,
|
|
5245
5273
|
source: n
|
|
5246
5274
|
}),
|
|
@@ -5249,43 +5277,45 @@ var $ = /* @__PURE__ */ b("span", {
|
|
|
5249
5277
|
]
|
|
5250
5278
|
});
|
|
5251
5279
|
};
|
|
5252
|
-
},
|
|
5280
|
+
}, Ao = {
|
|
5253
5281
|
fontSize: 12.5,
|
|
5254
5282
|
color: "var(--accent)",
|
|
5255
5283
|
textDecoration: "none"
|
|
5256
|
-
},
|
|
5257
|
-
let t = e == null ? "" :
|
|
5284
|
+
}, jo = () => (e) => {
|
|
5285
|
+
let t = e == null ? "" : R(e);
|
|
5258
5286
|
return t ? /* @__PURE__ */ b("a", {
|
|
5259
5287
|
href: `mailto:${t}`,
|
|
5260
5288
|
className: "mono",
|
|
5261
|
-
style:
|
|
5289
|
+
style: Ao,
|
|
5262
5290
|
children: t
|
|
5263
5291
|
}) : $;
|
|
5264
|
-
},
|
|
5292
|
+
}, Mo = {
|
|
5265
5293
|
fontSize: 12.5,
|
|
5266
5294
|
color: "var(--accent)",
|
|
5267
5295
|
textDecoration: "none"
|
|
5268
|
-
},
|
|
5269
|
-
let t = e == null ? "" :
|
|
5296
|
+
}, No = { fontSize: 12.5 }, Po = /^[+()\-.\s\d]+$/, Fo = () => (e) => {
|
|
5297
|
+
let t = e == null ? "" : R(e);
|
|
5270
5298
|
if (!t) return $;
|
|
5271
5299
|
let n = t.trim();
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
className: "mono",
|
|
5275
|
-
style: jo,
|
|
5300
|
+
if (!Po.test(n)) return /* @__PURE__ */ b("span", {
|
|
5301
|
+
style: No,
|
|
5276
5302
|
children: t
|
|
5277
|
-
})
|
|
5303
|
+
});
|
|
5304
|
+
let r = n.replace(/\s+/g, "");
|
|
5305
|
+
return /* @__PURE__ */ b("a", {
|
|
5306
|
+
href: `tel:${r}`,
|
|
5307
|
+
className: "mono",
|
|
5278
5308
|
style: Mo,
|
|
5279
5309
|
children: t
|
|
5280
5310
|
});
|
|
5281
|
-
},
|
|
5311
|
+
}, Io = {
|
|
5282
5312
|
fontSize: 12.5,
|
|
5283
5313
|
fontVariantNumeric: "tabular-nums"
|
|
5284
|
-
},
|
|
5314
|
+
}, Lo = {
|
|
5285
5315
|
color: "var(--text-3)",
|
|
5286
5316
|
marginLeft: 4
|
|
5287
|
-
},
|
|
5288
|
-
function
|
|
5317
|
+
}, Ro = { fontSize: 12.5 };
|
|
5318
|
+
function zo(e, t) {
|
|
5289
5319
|
let n = e.trim();
|
|
5290
5320
|
if (n === "" || n === "-") return n;
|
|
5291
5321
|
let r = n.startsWith("-"), [i, a] = (r ? n.slice(1) : n).split("."), o;
|
|
@@ -5297,45 +5327,45 @@ function Ro(e, t) {
|
|
|
5297
5327
|
let s = r ? `-${o}` : o;
|
|
5298
5328
|
return a !== void 0 && (s += `.${a}`), s;
|
|
5299
5329
|
}
|
|
5300
|
-
var
|
|
5330
|
+
var Bo = (e) => {
|
|
5301
5331
|
let { field: t, fieldName: n, locale: r = "en" } = e, i = new Intl.NumberFormat(r), a = t.type === "decimal", o = t.unit ? t.unit.display || t.unit.storage : void 0;
|
|
5302
5332
|
return (e, t) => {
|
|
5303
5333
|
if (e == null) return $;
|
|
5304
5334
|
let r = t.$units?.[n] || (o && !o.startsWith("$") ? o : void 0), s;
|
|
5305
|
-
if (a && typeof e == "string") s =
|
|
5335
|
+
if (a && typeof e == "string") s = zo(e, i);
|
|
5306
5336
|
else {
|
|
5307
5337
|
let t = typeof e == "number" ? e : Number(e);
|
|
5308
5338
|
s = Number.isFinite(t) ? i.format(t) : null;
|
|
5309
5339
|
}
|
|
5310
5340
|
return s == null ? /* @__PURE__ */ b("span", {
|
|
5311
|
-
style:
|
|
5341
|
+
style: Ro,
|
|
5312
5342
|
children: "—"
|
|
5313
5343
|
}) : /* @__PURE__ */ x("span", {
|
|
5314
5344
|
className: "num",
|
|
5315
|
-
style:
|
|
5345
|
+
style: Io,
|
|
5316
5346
|
children: [s, r && /* @__PURE__ */ b("span", {
|
|
5317
|
-
style:
|
|
5347
|
+
style: Lo,
|
|
5318
5348
|
children: r
|
|
5319
5349
|
})]
|
|
5320
5350
|
});
|
|
5321
5351
|
};
|
|
5322
|
-
},
|
|
5352
|
+
}, Vo = { fontSize: 12.5 }, Ho = () => (e) => e == null || e === "" ? $ : /* @__PURE__ */ b("code", {
|
|
5323
5353
|
className: "mono",
|
|
5324
|
-
style:
|
|
5325
|
-
children:
|
|
5326
|
-
}),
|
|
5354
|
+
style: Vo,
|
|
5355
|
+
children: R(e)
|
|
5356
|
+
}), Uo = {
|
|
5327
5357
|
display: "inline-flex",
|
|
5328
5358
|
alignItems: "center",
|
|
5329
5359
|
gap: 4,
|
|
5330
5360
|
fontSize: 12.5,
|
|
5331
5361
|
color: "var(--accent)",
|
|
5332
5362
|
textDecoration: "none"
|
|
5333
|
-
},
|
|
5334
|
-
let n = e == null ? "" :
|
|
5363
|
+
}, Wo = { fontSize: 12.5 }, Go = () => (e) => {
|
|
5364
|
+
let n = e == null ? "" : R(e);
|
|
5335
5365
|
if (!n) return $;
|
|
5336
|
-
let r =
|
|
5337
|
-
return r == null || !
|
|
5338
|
-
style:
|
|
5366
|
+
let r = co(n);
|
|
5367
|
+
return r == null || !fo(r) ? /* @__PURE__ */ b("span", {
|
|
5368
|
+
style: Wo,
|
|
5339
5369
|
children: n
|
|
5340
5370
|
}) : /* @__PURE__ */ x("a", {
|
|
5341
5371
|
href: r,
|
|
@@ -5343,21 +5373,21 @@ var zo = (e) => {
|
|
|
5343
5373
|
rel: "noopener noreferrer",
|
|
5344
5374
|
title: n,
|
|
5345
5375
|
className: "mono",
|
|
5346
|
-
style:
|
|
5376
|
+
style: Uo,
|
|
5347
5377
|
children: [n, /* @__PURE__ */ b(t.external, { size: 11 })]
|
|
5348
5378
|
});
|
|
5349
|
-
},
|
|
5350
|
-
function
|
|
5351
|
-
return Math.max(1, Math.min(typeof e == "number" && Number.isFinite(e) ? Math.floor(e) :
|
|
5379
|
+
}, Ko = 400, qo = 2e3;
|
|
5380
|
+
function Jo(e) {
|
|
5381
|
+
return Math.max(1, Math.min(typeof e == "number" && Number.isFinite(e) ? Math.floor(e) : Ko, qo));
|
|
5352
5382
|
}
|
|
5353
|
-
function
|
|
5383
|
+
function Yo(e, t) {
|
|
5354
5384
|
return e.length <= t ? e : `${e.slice(0, t)}...`;
|
|
5355
5385
|
}
|
|
5356
|
-
function
|
|
5386
|
+
function Xo(e, t, n, r = 0) {
|
|
5357
5387
|
if (e == null || e === "") return "";
|
|
5358
|
-
if (typeof e == "string") return
|
|
5388
|
+
if (typeof e == "string") return Yo(e, t);
|
|
5359
5389
|
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
5360
|
-
if (typeof e != "object") return
|
|
5390
|
+
if (typeof e != "object") return Yo(R(e), t);
|
|
5361
5391
|
if (n.has(e)) return "[Circular]";
|
|
5362
5392
|
if (r >= 3) return Array.isArray(e) ? "[...]" : "{...}";
|
|
5363
5393
|
n.add(e);
|
|
@@ -5368,30 +5398,30 @@ function Yo(e, t, n, r = 0) {
|
|
|
5368
5398
|
a.push(a.length > 1 ? ",..." : "...");
|
|
5369
5399
|
break;
|
|
5370
5400
|
}
|
|
5371
|
-
let f =
|
|
5401
|
+
let f = Xo(c, d, n, r + 1);
|
|
5372
5402
|
if (a.push(u, f), a.join("").length >= t) {
|
|
5373
5403
|
a.push(",...");
|
|
5374
5404
|
break;
|
|
5375
5405
|
}
|
|
5376
5406
|
}
|
|
5377
|
-
return a.push(i), n.delete(e),
|
|
5407
|
+
return a.push(i), n.delete(e), Yo(a.join(""), t);
|
|
5378
5408
|
}
|
|
5379
|
-
function
|
|
5380
|
-
return
|
|
5409
|
+
function Zo(e, t) {
|
|
5410
|
+
return Xo(e, t, /* @__PURE__ */ new WeakSet());
|
|
5381
5411
|
}
|
|
5382
|
-
var
|
|
5383
|
-
let t = e.surface ?? "detail", n =
|
|
5412
|
+
var Qo = (e) => {
|
|
5413
|
+
let t = e.surface ?? "detail", n = Jo(e.field.display?.list_preview?.max_chars);
|
|
5384
5414
|
return (r) => {
|
|
5385
|
-
if (
|
|
5415
|
+
if (Bi(r)) return $;
|
|
5386
5416
|
if (t === "list") {
|
|
5387
|
-
let e =
|
|
5417
|
+
let e = Zo(r, n);
|
|
5388
5418
|
return /* @__PURE__ */ b("span", {
|
|
5389
5419
|
className: "font-mono text-xs text-muted-foreground",
|
|
5390
5420
|
title: e,
|
|
5391
5421
|
children: e
|
|
5392
5422
|
});
|
|
5393
5423
|
}
|
|
5394
|
-
return /* @__PURE__ */ b(
|
|
5424
|
+
return /* @__PURE__ */ b(Vi, {
|
|
5395
5425
|
field: e.field,
|
|
5396
5426
|
fieldName: e.fieldName,
|
|
5397
5427
|
value: r,
|
|
@@ -5399,7 +5429,7 @@ var Zo = (e) => {
|
|
|
5399
5429
|
locale: e.locale
|
|
5400
5430
|
});
|
|
5401
5431
|
};
|
|
5402
|
-
},
|
|
5432
|
+
}, $o = [
|
|
5403
5433
|
{
|
|
5404
5434
|
pattern: /```[^\n]*\n?([\s\S]*?)```/g,
|
|
5405
5435
|
replacement: "$1"
|
|
@@ -5462,13 +5492,13 @@ var Zo = (e) => {
|
|
|
5462
5492
|
replacement: ""
|
|
5463
5493
|
}
|
|
5464
5494
|
];
|
|
5465
|
-
function
|
|
5495
|
+
function es(e) {
|
|
5466
5496
|
if (!e) return {
|
|
5467
5497
|
text: "",
|
|
5468
5498
|
isPlain: !0
|
|
5469
5499
|
};
|
|
5470
5500
|
let t = e, n = !1;
|
|
5471
|
-
for (let e of
|
|
5501
|
+
for (let e of $o) {
|
|
5472
5502
|
let r = t.replace(e.pattern, e.replacement);
|
|
5473
5503
|
r !== t && e.structural !== !1 && (n = !0), t = r;
|
|
5474
5504
|
}
|
|
@@ -5479,123 +5509,123 @@ function $o(e) {
|
|
|
5479
5509
|
}
|
|
5480
5510
|
//#endregion
|
|
5481
5511
|
//#region src/components/fields/cells/factories/markdown.tsx
|
|
5482
|
-
function
|
|
5483
|
-
return /* @__PURE__ */ b(
|
|
5512
|
+
function ts(e) {
|
|
5513
|
+
return /* @__PURE__ */ b(ei, { content: e });
|
|
5484
5514
|
}
|
|
5485
|
-
var
|
|
5515
|
+
var ns = (e) => {
|
|
5486
5516
|
let t = e.surface === "list";
|
|
5487
5517
|
return (e) => {
|
|
5488
|
-
let n = e == null ? "" :
|
|
5518
|
+
let n = e == null ? "" : R(e);
|
|
5489
5519
|
if (!n) return $;
|
|
5490
|
-
if (!t) return
|
|
5491
|
-
let { text: r, isPlain: i } =
|
|
5520
|
+
if (!t) return ts(n);
|
|
5521
|
+
let { text: r, isPlain: i } = es(n);
|
|
5492
5522
|
return i ? /* @__PURE__ */ b("span", {
|
|
5493
5523
|
title: r,
|
|
5494
5524
|
children: r
|
|
5495
5525
|
}) : /* @__PURE__ */ b(oe, {
|
|
5496
|
-
content:
|
|
5526
|
+
content: ts(n),
|
|
5497
5527
|
children: /* @__PURE__ */ b("span", {
|
|
5498
5528
|
title: r,
|
|
5499
5529
|
children: r
|
|
5500
5530
|
})
|
|
5501
5531
|
});
|
|
5502
5532
|
};
|
|
5503
|
-
},
|
|
5533
|
+
}, rs = "[SET]", is = {
|
|
5504
5534
|
fontSize: 12.5,
|
|
5505
5535
|
color: "var(--text-3)"
|
|
5506
|
-
},
|
|
5536
|
+
}, as = {
|
|
5507
5537
|
fontSize: 12.5,
|
|
5508
5538
|
color: "var(--text-4)",
|
|
5509
5539
|
fontStyle: "italic"
|
|
5510
|
-
},
|
|
5540
|
+
}, os = () => (e) => e === rs || typeof e == "string" && e !== "" ? /* @__PURE__ */ b("span", {
|
|
5511
5541
|
className: "mono",
|
|
5512
|
-
style: rs,
|
|
5513
|
-
children: ns
|
|
5514
|
-
}) : /* @__PURE__ */ b("span", {
|
|
5515
5542
|
style: is,
|
|
5543
|
+
children: rs
|
|
5544
|
+
}) : /* @__PURE__ */ b("span", {
|
|
5545
|
+
style: as,
|
|
5516
5546
|
children: "Not set"
|
|
5517
5547
|
});
|
|
5518
5548
|
//#endregion
|
|
5519
5549
|
//#region src/components/fields/cells/factories/richTextPreview.tsx
|
|
5520
|
-
function
|
|
5521
|
-
return /* @__PURE__ */ b(
|
|
5550
|
+
function ss(e, t) {
|
|
5551
|
+
return /* @__PURE__ */ b(ei, {
|
|
5522
5552
|
content: e,
|
|
5523
5553
|
files: t
|
|
5524
5554
|
});
|
|
5525
5555
|
}
|
|
5526
|
-
var
|
|
5556
|
+
var cs = (e) => {
|
|
5527
5557
|
let { fieldName: t } = e, n = e.surface === "list";
|
|
5528
5558
|
return (e, r) => {
|
|
5529
|
-
let i = r?.$files?.[t], a =
|
|
5559
|
+
let i = r?.$files?.[t], a = sa(e, i);
|
|
5530
5560
|
if (!a.markdown) return $;
|
|
5531
|
-
if (!n) return
|
|
5532
|
-
let { text: o, isPlain: s } =
|
|
5561
|
+
if (!n) return ss(a.markdown, a.files);
|
|
5562
|
+
let { text: o, isPlain: s } = es(a.markdown);
|
|
5533
5563
|
return s ? /* @__PURE__ */ b("span", {
|
|
5534
5564
|
title: o,
|
|
5535
5565
|
children: o
|
|
5536
5566
|
}) : /* @__PURE__ */ b(oe, {
|
|
5537
|
-
content:
|
|
5567
|
+
content: ss(a.markdown, a.files),
|
|
5538
5568
|
children: /* @__PURE__ */ b("span", {
|
|
5539
5569
|
title: o,
|
|
5540
5570
|
children: o
|
|
5541
5571
|
})
|
|
5542
5572
|
});
|
|
5543
5573
|
};
|
|
5544
|
-
},
|
|
5574
|
+
}, ls = { fontSize: 12.5 }, us = {
|
|
5545
5575
|
fontSize: 12.5,
|
|
5546
5576
|
whiteSpace: "pre-wrap",
|
|
5547
5577
|
margin: 0
|
|
5548
5578
|
};
|
|
5549
|
-
function
|
|
5579
|
+
function ds(e) {
|
|
5550
5580
|
return e == null ? {} : typeof e == "object" && !Array.isArray(e) ? e : typeof e == "string" ? { en: e } : {};
|
|
5551
5581
|
}
|
|
5552
|
-
function
|
|
5582
|
+
function fs(e, t) {
|
|
5553
5583
|
if (t && typeof e[t] == "string" && e[t] !== "") return [t, e[t]];
|
|
5554
5584
|
for (let [t, n] of Object.entries(e)) if (typeof n == "string" && n !== "") return [t, n];
|
|
5555
5585
|
return null;
|
|
5556
5586
|
}
|
|
5557
5587
|
//#endregion
|
|
5558
5588
|
//#region src/components/fields/cells/registry.ts
|
|
5559
|
-
var
|
|
5560
|
-
text:
|
|
5561
|
-
bool_pill:
|
|
5562
|
-
badge:
|
|
5563
|
-
status_pill:
|
|
5564
|
-
tag_list:
|
|
5565
|
-
time_ago:
|
|
5566
|
-
timestamp_full:
|
|
5567
|
-
next_run:
|
|
5568
|
-
money:
|
|
5569
|
-
ref_link:
|
|
5570
|
-
url:
|
|
5571
|
-
email:
|
|
5572
|
-
phone:
|
|
5573
|
-
number:
|
|
5574
|
-
code:
|
|
5575
|
-
link:
|
|
5576
|
-
json:
|
|
5577
|
-
markdown:
|
|
5578
|
-
password_mask:
|
|
5579
|
-
rich_text_preview:
|
|
5589
|
+
var ps = {
|
|
5590
|
+
text: Fa,
|
|
5591
|
+
bool_pill: Ia,
|
|
5592
|
+
badge: Va,
|
|
5593
|
+
status_pill: Wa,
|
|
5594
|
+
tag_list: qa,
|
|
5595
|
+
time_ago: Ja,
|
|
5596
|
+
timestamp_full: Ya,
|
|
5597
|
+
next_run: Qa,
|
|
5598
|
+
money: $a,
|
|
5599
|
+
ref_link: no,
|
|
5600
|
+
url: ko,
|
|
5601
|
+
email: jo,
|
|
5602
|
+
phone: Fo,
|
|
5603
|
+
number: Bo,
|
|
5604
|
+
code: Ho,
|
|
5605
|
+
link: Go,
|
|
5606
|
+
json: Qo,
|
|
5607
|
+
markdown: ns,
|
|
5608
|
+
password_mask: os,
|
|
5609
|
+
rich_text_preview: cs,
|
|
5580
5610
|
multilang_inline: (e) => {
|
|
5581
5611
|
let { field: t, locale: n } = e, r = t.type === "multilang_text";
|
|
5582
5612
|
return (e) => {
|
|
5583
|
-
let t = ds(
|
|
5613
|
+
let t = fs(ds(e), n);
|
|
5584
5614
|
if (!t) return r ? /* @__PURE__ */ b("p", {
|
|
5585
|
-
style:
|
|
5615
|
+
style: us,
|
|
5586
5616
|
children: "—"
|
|
5587
5617
|
}) : /* @__PURE__ */ b("span", {
|
|
5588
|
-
style:
|
|
5618
|
+
style: ls,
|
|
5589
5619
|
children: "—"
|
|
5590
5620
|
});
|
|
5591
5621
|
let [i, a] = t;
|
|
5592
5622
|
return r ? /* @__PURE__ */ b("p", {
|
|
5593
|
-
style:
|
|
5623
|
+
style: us,
|
|
5594
5624
|
lang: i,
|
|
5595
5625
|
dir: "auto",
|
|
5596
5626
|
children: a
|
|
5597
5627
|
}) : /* @__PURE__ */ b("span", {
|
|
5598
|
-
style:
|
|
5628
|
+
style: ls,
|
|
5599
5629
|
lang: i,
|
|
5600
5630
|
dir: "auto",
|
|
5601
5631
|
children: a
|
|
@@ -5603,53 +5633,53 @@ var fs = {
|
|
|
5603
5633
|
};
|
|
5604
5634
|
}
|
|
5605
5635
|
};
|
|
5606
|
-
Object.keys(
|
|
5607
|
-
function
|
|
5608
|
-
let t = e.field.display?.widget ?? "text", n =
|
|
5636
|
+
Object.keys(ps).sort();
|
|
5637
|
+
function ms(e) {
|
|
5638
|
+
let t = e.field.display?.widget ?? "text", n = ps[t];
|
|
5609
5639
|
if (!n) throw Error(`resolveCellRenderer: no factory registered for widget "${t}" (field "${e.fieldName}"). The engine must stamp a smart default at YAML-load time; an unknown widget here indicates an out-of-sync allow-list.`);
|
|
5610
5640
|
return n(e);
|
|
5611
5641
|
}
|
|
5612
5642
|
//#endregion
|
|
5613
5643
|
//#region src/components/fields/index.tsx
|
|
5614
|
-
var
|
|
5615
|
-
string:
|
|
5616
|
-
text:
|
|
5617
|
-
rich_text:
|
|
5618
|
-
int:
|
|
5619
|
-
float:
|
|
5620
|
-
decimal:
|
|
5621
|
-
bool:
|
|
5622
|
-
timestamp:
|
|
5623
|
-
date:
|
|
5624
|
-
time:
|
|
5625
|
-
enum:
|
|
5626
|
-
email:
|
|
5627
|
-
url:
|
|
5628
|
-
phone:
|
|
5629
|
-
uuid:
|
|
5630
|
-
bytes:
|
|
5631
|
-
ref:
|
|
5632
|
-
json:
|
|
5633
|
-
tags:
|
|
5634
|
-
string_array:
|
|
5635
|
-
int_array:
|
|
5636
|
-
uuid_array:
|
|
5637
|
-
multilang:
|
|
5638
|
-
multilang_text:
|
|
5639
|
-
structure:
|
|
5640
|
-
secret:
|
|
5641
|
-
password:
|
|
5644
|
+
var hs = {
|
|
5645
|
+
string: di,
|
|
5646
|
+
text: fi,
|
|
5647
|
+
rich_text: Ma,
|
|
5648
|
+
int: ki,
|
|
5649
|
+
float: ki,
|
|
5650
|
+
decimal: ki,
|
|
5651
|
+
bool: Ei,
|
|
5652
|
+
timestamp: Ti,
|
|
5653
|
+
date: Ti,
|
|
5654
|
+
time: Ti,
|
|
5655
|
+
enum: mi,
|
|
5656
|
+
email: hi,
|
|
5657
|
+
url: gi,
|
|
5658
|
+
phone: _i,
|
|
5659
|
+
uuid: di,
|
|
5660
|
+
bytes: di,
|
|
5661
|
+
ref: Li,
|
|
5662
|
+
json: Vi,
|
|
5663
|
+
tags: di,
|
|
5664
|
+
string_array: ea,
|
|
5665
|
+
int_array: ia,
|
|
5666
|
+
uuid_array: ea,
|
|
5667
|
+
multilang: Ui,
|
|
5668
|
+
multilang_text: Gi,
|
|
5669
|
+
structure: Ki,
|
|
5670
|
+
secret: Xi,
|
|
5671
|
+
password: Qi
|
|
5642
5672
|
};
|
|
5643
|
-
for (let e of
|
|
5644
|
-
function
|
|
5645
|
-
if (e.field.type === "json" && e.field.structure) return /* @__PURE__ */ b(
|
|
5673
|
+
for (let e of li) if (!hs[e]) throw Error(`editRegistry: missing entry for FieldType "${e}". The TS union (types/fieldType.ts) and editRegistry must stay in sync with golang/internal/engine/types.go.`);
|
|
5674
|
+
function gs(e) {
|
|
5675
|
+
if (e.field.type === "json" && e.field.structure) return /* @__PURE__ */ b(Ki, { ...e });
|
|
5646
5676
|
if (e.mode === "edit") {
|
|
5647
|
-
let t =
|
|
5677
|
+
let t = hs[e.field.type];
|
|
5648
5678
|
if (!t) throw Error(`renderField: no edit-mode renderer for FieldType "${e.field.type}" (field "${e.fieldName}"). editRegistry must be total over FieldType; check types/fieldType.ts and components/fields/index.tsx.`);
|
|
5649
5679
|
return /* @__PURE__ */ b(t, { ...e });
|
|
5650
5680
|
}
|
|
5651
5681
|
if (!e.field.display?.widget) throw Error(`renderField: display mode requires a non-empty field.display.widget (field "${e.fieldName}", type "${e.field.type}"). The engine must stamp a smart default; an empty widget here means the field bypassed ResolveDefaultWidgets.`);
|
|
5652
|
-
return
|
|
5682
|
+
return ms({
|
|
5653
5683
|
field: e.field,
|
|
5654
5684
|
fieldName: e.fieldName,
|
|
5655
5685
|
surface: e.surface ?? "detail",
|
|
@@ -5662,57 +5692,57 @@ function hs(e) {
|
|
|
5662
5692
|
}
|
|
5663
5693
|
//#endregion
|
|
5664
5694
|
//#region src/hooks/useUserLocale.ts
|
|
5665
|
-
var
|
|
5666
|
-
function
|
|
5695
|
+
var _s = "en";
|
|
5696
|
+
function vs() {
|
|
5667
5697
|
if (typeof navigator > "u") return;
|
|
5668
5698
|
let e = navigator.language;
|
|
5669
5699
|
if (e) return e.split("-")[0] || void 0;
|
|
5670
5700
|
}
|
|
5671
|
-
function
|
|
5672
|
-
let e =
|
|
5701
|
+
function ys() {
|
|
5702
|
+
let e = Jn((e) => e.user), { data: t } = X(), n = e?.language;
|
|
5673
5703
|
if (n && n.trim()) return n;
|
|
5674
5704
|
let r = t?.languages?.[0]?.code;
|
|
5675
|
-
return r && r.trim() ? r :
|
|
5705
|
+
return r && r.trim() ? r : vs() || _s;
|
|
5676
5706
|
}
|
|
5677
5707
|
//#endregion
|
|
5678
5708
|
//#region src/lib/actions.ts
|
|
5679
|
-
var
|
|
5709
|
+
var bs = {
|
|
5680
5710
|
__create: "create",
|
|
5681
5711
|
__edit: "update",
|
|
5682
5712
|
__delete: "delete",
|
|
5683
5713
|
__restore: "restore"
|
|
5684
|
-
},
|
|
5685
|
-
function
|
|
5714
|
+
}, xs = "__peek", Ss = "__open";
|
|
5715
|
+
function Cs(e) {
|
|
5686
5716
|
return e === "__peek" || e === "__open";
|
|
5687
5717
|
}
|
|
5688
|
-
function
|
|
5718
|
+
function ws(e, t) {
|
|
5689
5719
|
if (!e) return "";
|
|
5690
5720
|
if (t) try {
|
|
5691
|
-
return
|
|
5721
|
+
return it(t, tt(t, e));
|
|
5692
5722
|
} catch {}
|
|
5693
5723
|
let n = e.id;
|
|
5694
|
-
return typeof n == "string" ? n : n == null ? "" :
|
|
5724
|
+
return typeof n == "string" ? n : n == null ? "" : R(n);
|
|
5695
5725
|
}
|
|
5696
|
-
function
|
|
5726
|
+
function Ts(e, t) {
|
|
5697
5727
|
if (!e || e.length === 0) return !0;
|
|
5698
5728
|
for (let n of e) {
|
|
5699
5729
|
if (n.status && n.status.length > 0) {
|
|
5700
5730
|
let e = t.status;
|
|
5701
5731
|
if (typeof e != "string" || !n.status.includes(e)) return !1;
|
|
5702
5732
|
}
|
|
5703
|
-
if (n.field && !
|
|
5733
|
+
if (n.field && !Es(n, t)) return !1;
|
|
5704
5734
|
}
|
|
5705
5735
|
return !0;
|
|
5706
5736
|
}
|
|
5707
|
-
function
|
|
5708
|
-
let n =
|
|
5737
|
+
function Es(e, t) {
|
|
5738
|
+
let n = Ds(t, e.field), r = e.op || "eq";
|
|
5709
5739
|
if (r === "in" || r === "not_in") {
|
|
5710
|
-
let t = Array.isArray(e.value) ? e.value : [e.value], i =
|
|
5740
|
+
let t = Array.isArray(e.value) ? e.value : [e.value], i = R(n), a = t.some((e) => R(e) === i);
|
|
5711
5741
|
return r === "in" ? a : !a;
|
|
5712
5742
|
}
|
|
5713
|
-
return typeof e.value == "boolean" && r === "eq" ?
|
|
5743
|
+
return typeof e.value == "boolean" && r === "eq" ? ks(n) === e.value : typeof n == "number" && typeof e.value == "number" ? As(n, e.value, r) : As(R(n), R(e.value), r);
|
|
5714
5744
|
}
|
|
5715
|
-
function
|
|
5745
|
+
function Ds(e, t) {
|
|
5716
5746
|
if (Object.prototype.hasOwnProperty.call(e, t)) return e[t];
|
|
5717
5747
|
if (t.startsWith("$status.")) {
|
|
5718
5748
|
let n = t.slice(8), r = e.$statuses;
|
|
@@ -5723,27 +5753,27 @@ function Es(e, t) {
|
|
|
5723
5753
|
return Array.isArray(r) ? r.find((e) => !e || typeof e != "object" ? !1 : e.property_code === n)?.value : void 0;
|
|
5724
5754
|
}
|
|
5725
5755
|
}
|
|
5726
|
-
function
|
|
5756
|
+
function Os(e) {
|
|
5727
5757
|
let t = null, n = (n, r) => {
|
|
5728
5758
|
Object.prototype.hasOwnProperty.call(e, n) || (t === null && (t = { ...e }), t[n] = r);
|
|
5729
5759
|
}, r = e.$statuses;
|
|
5730
5760
|
if (Array.isArray(r)) for (let t of r) {
|
|
5731
5761
|
if (!t || typeof t != "object") continue;
|
|
5732
5762
|
let r = t.group_code;
|
|
5733
|
-
typeof r == "string" && n(`$status.${r}`,
|
|
5763
|
+
typeof r == "string" && n(`$status.${r}`, Ds(e, `$status.${r}`));
|
|
5734
5764
|
}
|
|
5735
5765
|
let i = e.$properties;
|
|
5736
5766
|
if (Array.isArray(i)) for (let t of i) {
|
|
5737
5767
|
if (!t || typeof t != "object") continue;
|
|
5738
5768
|
let r = t.property_code;
|
|
5739
|
-
typeof r == "string" && n(`$property.${r}`,
|
|
5769
|
+
typeof r == "string" && n(`$property.${r}`, Ds(e, `$property.${r}`));
|
|
5740
5770
|
}
|
|
5741
5771
|
return t ?? e;
|
|
5742
5772
|
}
|
|
5743
|
-
function
|
|
5773
|
+
function ks(e) {
|
|
5744
5774
|
return e == null ? !1 : typeof e == "boolean" ? e : typeof e == "string" ? e !== "" : typeof e != "number" || e !== 0;
|
|
5745
5775
|
}
|
|
5746
|
-
function
|
|
5776
|
+
function As(e, t, n) {
|
|
5747
5777
|
switch (n) {
|
|
5748
5778
|
case "eq": return e === t;
|
|
5749
5779
|
case "ne": return e !== t;
|
|
@@ -5756,14 +5786,14 @@ function ks(e, t, n) {
|
|
|
5756
5786
|
default: return !1;
|
|
5757
5787
|
}
|
|
5758
5788
|
}
|
|
5759
|
-
function
|
|
5789
|
+
function js(e, t) {
|
|
5760
5790
|
return e ? Object.entries(e).filter(([, e]) => e.visibility?.includes(t)).map(([e, t]) => ({
|
|
5761
5791
|
code: e,
|
|
5762
5792
|
action: t
|
|
5763
5793
|
})) : [];
|
|
5764
5794
|
}
|
|
5765
|
-
function
|
|
5766
|
-
return !e && !r ? [] : t === void 0 ?
|
|
5795
|
+
function Ms(e, t, n, r) {
|
|
5796
|
+
return !e && !r ? [] : t === void 0 ? js(e, n) : t.map((t) => {
|
|
5767
5797
|
let n = e?.[t] ?? r?.[t];
|
|
5768
5798
|
return n ? {
|
|
5769
5799
|
code: t,
|
|
@@ -5771,34 +5801,34 @@ function js(e, t, n, r) {
|
|
|
5771
5801
|
} : null;
|
|
5772
5802
|
}).filter((e) => e !== null);
|
|
5773
5803
|
}
|
|
5774
|
-
function
|
|
5804
|
+
function Ns(e, t) {
|
|
5775
5805
|
return e.filter(({ code: e }) => {
|
|
5776
|
-
let n =
|
|
5806
|
+
let n = bs[e];
|
|
5777
5807
|
return !n || $e(t, n);
|
|
5778
5808
|
});
|
|
5779
5809
|
}
|
|
5780
|
-
var
|
|
5810
|
+
var Ps = {
|
|
5781
5811
|
en: "This action cannot be undone.",
|
|
5782
5812
|
ru: "Это действие нельзя отменить."
|
|
5783
5813
|
};
|
|
5784
|
-
function
|
|
5814
|
+
function Fs(e) {
|
|
5785
5815
|
return !!e?.confirmation && Object.keys(e.confirmation).length > 0;
|
|
5786
5816
|
}
|
|
5787
|
-
function
|
|
5788
|
-
return
|
|
5817
|
+
function Is(e, t) {
|
|
5818
|
+
return Fs(e) ? z(e.confirmation, t) : e?.destructive ? z(Ps, t) : null;
|
|
5789
5819
|
}
|
|
5790
|
-
function
|
|
5791
|
-
return
|
|
5820
|
+
function Ls(e) {
|
|
5821
|
+
return Fs(e) || !!e?.destructive;
|
|
5792
5822
|
}
|
|
5793
|
-
function
|
|
5823
|
+
function Rs(e, t, n, r) {
|
|
5794
5824
|
if (n && r) return r;
|
|
5795
|
-
let i =
|
|
5825
|
+
let i = z(e?.display?.description);
|
|
5796
5826
|
return i ? e?.display?.icon_only === !0 ? `${t} - ${i}` : i : t;
|
|
5797
5827
|
}
|
|
5798
|
-
function
|
|
5828
|
+
function zs(e) {
|
|
5799
5829
|
return !!e.association;
|
|
5800
5830
|
}
|
|
5801
|
-
function
|
|
5831
|
+
function Bs(e, t) {
|
|
5802
5832
|
if (e) {
|
|
5803
5833
|
for (let n of Object.values(e.screens)) if (n.entity === t && n.type === "list") {
|
|
5804
5834
|
let r = e.entities[t];
|
|
@@ -5809,53 +5839,54 @@ function zs(e, t) {
|
|
|
5809
5839
|
}
|
|
5810
5840
|
}
|
|
5811
5841
|
}
|
|
5812
|
-
function
|
|
5813
|
-
let
|
|
5814
|
-
for (let
|
|
5815
|
-
let e =
|
|
5816
|
-
e !== null &&
|
|
5842
|
+
function Vs(e, t, n, r, i, a) {
|
|
5843
|
+
let o = [];
|
|
5844
|
+
for (let s of e) {
|
|
5845
|
+
let e = Hs(s, t, n, r, i, a);
|
|
5846
|
+
e !== null && o.push(e);
|
|
5817
5847
|
}
|
|
5818
|
-
return
|
|
5848
|
+
return o;
|
|
5819
5849
|
}
|
|
5820
|
-
function
|
|
5821
|
-
return e.kind === "group" ?
|
|
5850
|
+
function Hs(e, t, n, r, i, a) {
|
|
5851
|
+
return e.kind === "group" ? Us(e, t, n, r, i, a) : Ws(e, t, n, r, i, a);
|
|
5822
5852
|
}
|
|
5823
|
-
function
|
|
5824
|
-
let
|
|
5825
|
-
for (let
|
|
5826
|
-
let e =
|
|
5827
|
-
e !== null &&
|
|
5853
|
+
function Us(e, t, n, r, i, a) {
|
|
5854
|
+
let o = [];
|
|
5855
|
+
for (let s of e.items) {
|
|
5856
|
+
let e = Hs(s, t, n, r, i, a);
|
|
5857
|
+
e !== null && o.push(e);
|
|
5828
5858
|
}
|
|
5829
|
-
return
|
|
5859
|
+
return o.length === 0 ? null : {
|
|
5830
5860
|
...e,
|
|
5831
|
-
items:
|
|
5861
|
+
items: o
|
|
5832
5862
|
};
|
|
5833
5863
|
}
|
|
5834
|
-
function
|
|
5835
|
-
|
|
5836
|
-
|
|
5864
|
+
function Ws(e, t, n, r, i, a) {
|
|
5865
|
+
if (a && !e.code.startsWith("__") && !a.has(e.code)) return null;
|
|
5866
|
+
let o = qs(e.code, t, n);
|
|
5867
|
+
if (!o) return null;
|
|
5837
5868
|
if (i.length > 0) {
|
|
5838
|
-
let t =
|
|
5869
|
+
let t = Gs(o, i);
|
|
5839
5870
|
return t.visible ? {
|
|
5840
5871
|
...e,
|
|
5841
5872
|
enabled: t.enabled,
|
|
5842
5873
|
reason: t.reason
|
|
5843
5874
|
} : null;
|
|
5844
5875
|
}
|
|
5845
|
-
if (!
|
|
5846
|
-
let { enabled:
|
|
5876
|
+
if (!Ts(o.conditions, r) || !Ts(Js(o.visible_if), r)) return null;
|
|
5877
|
+
let { enabled: s, reason: c } = Ks(o, r);
|
|
5847
5878
|
return {
|
|
5848
5879
|
...e,
|
|
5849
|
-
enabled:
|
|
5850
|
-
reason:
|
|
5880
|
+
enabled: s,
|
|
5881
|
+
reason: c
|
|
5851
5882
|
};
|
|
5852
5883
|
}
|
|
5853
|
-
function
|
|
5854
|
-
let n =
|
|
5884
|
+
function Gs(e, t) {
|
|
5885
|
+
let n = Js(e.visible_if), r = Js(e.enabled_if), i = e.conditions, a = Ys(e.enabled_if_reason), o = 0, s = 0;
|
|
5855
5886
|
for (let e of t) {
|
|
5856
|
-
let t =
|
|
5887
|
+
let t = Ts(n, e) && Ts(i, e);
|
|
5857
5888
|
t && o++;
|
|
5858
|
-
let a =
|
|
5889
|
+
let a = Ts(r, e);
|
|
5859
5890
|
(!t || !a) && s++;
|
|
5860
5891
|
}
|
|
5861
5892
|
if (o === 0) return {
|
|
@@ -5875,14 +5906,14 @@ function Ws(e, t) {
|
|
|
5875
5906
|
reason: a ? `${a} ${c}` : c
|
|
5876
5907
|
};
|
|
5877
5908
|
}
|
|
5878
|
-
function
|
|
5879
|
-
let n =
|
|
5909
|
+
function Ks(e, t) {
|
|
5910
|
+
let n = Js(e.enabled_if);
|
|
5880
5911
|
if (!n || n.length === 0) return {
|
|
5881
5912
|
enabled: !0,
|
|
5882
5913
|
reason: null
|
|
5883
5914
|
};
|
|
5884
|
-
let r =
|
|
5885
|
-
return
|
|
5915
|
+
let r = Ys(e.enabled_if_reason);
|
|
5916
|
+
return Ts(n, t) ? {
|
|
5886
5917
|
enabled: !0,
|
|
5887
5918
|
reason: null
|
|
5888
5919
|
} : {
|
|
@@ -5890,52 +5921,52 @@ function Gs(e, t) {
|
|
|
5890
5921
|
reason: r
|
|
5891
5922
|
};
|
|
5892
5923
|
}
|
|
5893
|
-
function
|
|
5924
|
+
function qs(e, t, n) {
|
|
5894
5925
|
if (t && e in t) return t[e];
|
|
5895
5926
|
if (n && e in n) return n[e];
|
|
5896
5927
|
}
|
|
5897
|
-
function
|
|
5928
|
+
function Js(e) {
|
|
5898
5929
|
return e;
|
|
5899
5930
|
}
|
|
5900
|
-
function
|
|
5931
|
+
function Ys(e) {
|
|
5901
5932
|
if (!e) return null;
|
|
5902
5933
|
if (e.en) return e.en;
|
|
5903
5934
|
let t = Object.values(e);
|
|
5904
5935
|
return t.length > 0 ? t[0] : null;
|
|
5905
5936
|
}
|
|
5906
|
-
function
|
|
5937
|
+
function Xs(e, t, n, r, i) {
|
|
5907
5938
|
let a = [];
|
|
5908
5939
|
for (let o of e) {
|
|
5909
5940
|
if (o.kind === "group") {
|
|
5910
|
-
let e =
|
|
5941
|
+
let e = Xs(o.items, t, n, r, i);
|
|
5911
5942
|
e.length > 0 && a.push({
|
|
5912
5943
|
...o,
|
|
5913
5944
|
items: e
|
|
5914
5945
|
});
|
|
5915
5946
|
continue;
|
|
5916
5947
|
}
|
|
5917
|
-
let e =
|
|
5918
|
-
e && e.visibility?.includes(r) && (i?.bulkRequired
|
|
5948
|
+
let e = qs(o.code, t, n);
|
|
5949
|
+
e && e.visibility?.includes(r) && (i?.bulkRequired === void 0 || (i.bulkRequiredPredicate ? i.bulkRequiredPredicate(e) : !1) === i.bulkRequired) && (i?.excludeIf && i.excludeIf(e) || a.push(o));
|
|
5919
5950
|
}
|
|
5920
5951
|
return a;
|
|
5921
5952
|
}
|
|
5922
|
-
function
|
|
5953
|
+
function Zs(e, t, n, r, i, a) {
|
|
5923
5954
|
let o = e ?? t;
|
|
5924
|
-
return o ?
|
|
5925
|
-
}
|
|
5926
|
-
function Zs(e) {
|
|
5927
|
-
return e.requires_selection === void 0 ? Qs(e) : e.requires_selection;
|
|
5955
|
+
return o ? Xs(o, n, r, i, a) : tc(n, i);
|
|
5928
5956
|
}
|
|
5929
5957
|
function Qs(e) {
|
|
5958
|
+
return e.requires_selection === void 0 ? $s(e) : e.requires_selection;
|
|
5959
|
+
}
|
|
5960
|
+
function $s(e) {
|
|
5930
5961
|
return e.visibility?.includes("list_floatbar") ?? !1;
|
|
5931
5962
|
}
|
|
5932
|
-
function
|
|
5963
|
+
function ec(e, t, n, r, i) {
|
|
5933
5964
|
return e.map((e) => {
|
|
5934
5965
|
if (e.kind === "group") return {
|
|
5935
5966
|
...e,
|
|
5936
|
-
items:
|
|
5967
|
+
items: ec(e.items, t, n, r, i)
|
|
5937
5968
|
};
|
|
5938
|
-
let a =
|
|
5969
|
+
let a = qs(e.code, t, n);
|
|
5939
5970
|
return a && r(a) ? {
|
|
5940
5971
|
...e,
|
|
5941
5972
|
enabled: !1,
|
|
@@ -5943,7 +5974,7 @@ function $s(e, t, n, r, i) {
|
|
|
5943
5974
|
} : e;
|
|
5944
5975
|
});
|
|
5945
5976
|
}
|
|
5946
|
-
function
|
|
5977
|
+
function tc(e, t) {
|
|
5947
5978
|
return e ? Object.entries(e).filter(([, e]) => e.visibility?.includes(t)).sort(([e, t], [n, r]) => {
|
|
5948
5979
|
let i = t.position ?? 0, a = r.position ?? 0;
|
|
5949
5980
|
return i === a ? e < n ? -1 : +(e > n) : i - a;
|
|
@@ -5956,84 +5987,129 @@ function ec(e, t) {
|
|
|
5956
5987
|
}
|
|
5957
5988
|
//#endregion
|
|
5958
5989
|
//#region src/lib/field-regions.ts
|
|
5959
|
-
var
|
|
5960
|
-
function
|
|
5961
|
-
return
|
|
5962
|
-
|
|
5990
|
+
var nc = /* @__PURE__ */ new Map();
|
|
5991
|
+
function rc(e, t) {
|
|
5992
|
+
return nc.set(e, t), () => {
|
|
5993
|
+
nc.get(e) === t && nc.delete(e);
|
|
5963
5994
|
};
|
|
5964
5995
|
}
|
|
5965
|
-
function
|
|
5966
|
-
return
|
|
5996
|
+
function ic(e) {
|
|
5997
|
+
return nc.get(e);
|
|
5998
|
+
}
|
|
5999
|
+
//#endregion
|
|
6000
|
+
//#region src/lib/anchor.ts
|
|
6001
|
+
var ac = 1, oc = 1e3 * ac, sc = 60 * oc, cc = 60 * sc, lc = 24 * cc, uc = 7 * lc;
|
|
6002
|
+
36500 * lc;
|
|
6003
|
+
var dc = {
|
|
6004
|
+
ns: 1e-6,
|
|
6005
|
+
us: .001,
|
|
6006
|
+
µs: .001,
|
|
6007
|
+
ms: ac,
|
|
6008
|
+
s: oc,
|
|
6009
|
+
m: sc,
|
|
6010
|
+
h: cc,
|
|
6011
|
+
d: lc,
|
|
6012
|
+
w: uc
|
|
6013
|
+
}, fc = /^(\d+(?:\.\d+)?|\.\d+)(ns|us|µs|ms|s|m|h|d|w)/i, pc = /\d(?:mo|y)(?:[^a-zA-Z]|$)/i;
|
|
6014
|
+
function mc(e) {
|
|
6015
|
+
if (!e || e.trim() !== e || e[0] === "+" || e[0] === "-" || pc.test(e)) return null;
|
|
6016
|
+
let t = 0, n = e;
|
|
6017
|
+
for (; n.length > 0;) {
|
|
6018
|
+
let e = fc.exec(n);
|
|
6019
|
+
if (!e) return null;
|
|
6020
|
+
let r = Number(e[1]), i = dc[e[2].toLowerCase()];
|
|
6021
|
+
if (!Number.isFinite(r) || i === void 0 || (t += r * i, t > 31536e8)) return null;
|
|
6022
|
+
n = n.slice(e[0].length);
|
|
6023
|
+
}
|
|
6024
|
+
return t;
|
|
6025
|
+
}
|
|
6026
|
+
function hc(e) {
|
|
6027
|
+
if (!e.startsWith("now")) return null;
|
|
6028
|
+
let t = e.slice(3), n = 0;
|
|
6029
|
+
for (let e = 0; t.length > 0; e++) {
|
|
6030
|
+
if (e >= 8) return null;
|
|
6031
|
+
let r = t[0] === "+" ? 1 : t[0] === "-" ? -1 : 0;
|
|
6032
|
+
if (r === 0) return null;
|
|
6033
|
+
t = t.slice(1);
|
|
6034
|
+
let i = t, a = t.search(/[+-]/);
|
|
6035
|
+
a >= 0 ? (i = t.slice(0, a), t = t.slice(a)) : t = "";
|
|
6036
|
+
let o = mc(i);
|
|
6037
|
+
if (o === null || (n += r * o, Math.abs(n) > 31536e8)) return null;
|
|
6038
|
+
}
|
|
6039
|
+
return n;
|
|
5967
6040
|
}
|
|
5968
6041
|
//#endregion
|
|
5969
6042
|
//#region src/lib/ui-actions.ts
|
|
5970
|
-
var
|
|
5971
|
-
function
|
|
5972
|
-
let n = e.match(
|
|
6043
|
+
var gc = /\$\{\s*([^}]+?)\s*\}/g, _c = /^\s*\$\{\s*([^}]+?)\s*\}\s*$/, vc = Symbol("unresolved");
|
|
6044
|
+
function yc(e, t) {
|
|
6045
|
+
let n = e.match(_c);
|
|
5973
6046
|
if (n) {
|
|
5974
|
-
let r =
|
|
5975
|
-
return r ===
|
|
6047
|
+
let r = bc(n[1], t);
|
|
6048
|
+
return r === vc ? e : r;
|
|
5976
6049
|
}
|
|
5977
|
-
return e.replace(
|
|
5978
|
-
let r =
|
|
5979
|
-
return r ===
|
|
6050
|
+
return e.replace(gc, (e, n) => {
|
|
6051
|
+
let r = bc(n, t);
|
|
6052
|
+
return r === vc ? e : R(r);
|
|
5980
6053
|
});
|
|
5981
6054
|
}
|
|
5982
|
-
function
|
|
5983
|
-
if (e
|
|
6055
|
+
function bc(e, t) {
|
|
6056
|
+
if (e.startsWith("now")) {
|
|
6057
|
+
let t = hc(e);
|
|
6058
|
+
return t === null ? vc : ze(new Date(Date.now() + t));
|
|
6059
|
+
}
|
|
5984
6060
|
let [n, ...r] = e.split(".");
|
|
5985
|
-
if (n === "row") return !t.row || r.length === 0 ?
|
|
6061
|
+
if (n === "row") return !t.row || r.length === 0 ? vc : xc(t.row, r);
|
|
5986
6062
|
if (n === "field" && r.length >= 2) {
|
|
5987
|
-
let [e, t] = r, n =
|
|
5988
|
-
return n ? n.getField(t) :
|
|
6063
|
+
let [e, t] = r, n = ic(e);
|
|
6064
|
+
return n ? n.getField(t) : vc;
|
|
5989
6065
|
}
|
|
5990
|
-
return n === "params" ? !t.params || r.length === 0 ?
|
|
6066
|
+
return n === "params" ? !t.params || r.length === 0 ? vc : xc(t.params, r) : vc;
|
|
5991
6067
|
}
|
|
5992
|
-
function
|
|
6068
|
+
function xc(e, t) {
|
|
5993
6069
|
return t.reduce((e, t) => {
|
|
5994
6070
|
if (e && typeof e == "object") return e[t];
|
|
5995
6071
|
}, e);
|
|
5996
6072
|
}
|
|
5997
|
-
async function
|
|
6073
|
+
async function Sc(e, t) {
|
|
5998
6074
|
for (let n of e) try {
|
|
5999
|
-
await
|
|
6075
|
+
await Cc(n, t);
|
|
6000
6076
|
} catch (e) {
|
|
6001
6077
|
let t = e instanceof Error ? e.message : String(e);
|
|
6002
6078
|
Z.error(`ui_step failed: ${t}`);
|
|
6003
6079
|
return;
|
|
6004
6080
|
}
|
|
6005
6081
|
}
|
|
6006
|
-
async function
|
|
6082
|
+
async function Cc(e, t) {
|
|
6007
6083
|
if (e.copy_to_clipboard != null) {
|
|
6008
|
-
let n =
|
|
6084
|
+
let n = Tc(e.copy_to_clipboard, t);
|
|
6009
6085
|
await navigator.clipboard.writeText(n);
|
|
6010
6086
|
return;
|
|
6011
6087
|
}
|
|
6012
6088
|
if (e.set_field) {
|
|
6013
|
-
let { target: n, value: r } = e.set_field, { region: i, field: a } =
|
|
6089
|
+
let { target: n, value: r } = e.set_field, { region: i, field: a } = Ec(n), o = ic(i);
|
|
6014
6090
|
if (!o) throw Error(`region "${i}" not registered`);
|
|
6015
|
-
o.setField(a,
|
|
6091
|
+
o.setField(a, wc(r, t));
|
|
6016
6092
|
return;
|
|
6017
6093
|
}
|
|
6018
6094
|
if (e.focus_field) {
|
|
6019
|
-
let { region: t, field: n } =
|
|
6095
|
+
let { region: t, field: n } = Ec(e.focus_field), r = ic(t);
|
|
6020
6096
|
if (!r) throw Error(`region "${t}" not registered`);
|
|
6021
6097
|
r.focusField(n);
|
|
6022
6098
|
return;
|
|
6023
6099
|
}
|
|
6024
6100
|
if (e.show_toast) {
|
|
6025
|
-
let n =
|
|
6101
|
+
let n = Tc(e.show_toast.message, t), r = e.show_toast.kind ?? "info";
|
|
6026
6102
|
r === "success" ? Z.success(n) : r === "error" ? Z.error(n) : Z.info(n);
|
|
6027
6103
|
return;
|
|
6028
6104
|
}
|
|
6029
6105
|
}
|
|
6030
|
-
function
|
|
6031
|
-
return typeof e == "string" ?
|
|
6106
|
+
function wc(e, t) {
|
|
6107
|
+
return typeof e == "string" ? yc(e, t) : e;
|
|
6032
6108
|
}
|
|
6033
|
-
function
|
|
6034
|
-
return
|
|
6109
|
+
function Tc(e, t) {
|
|
6110
|
+
return R(yc(e, t));
|
|
6035
6111
|
}
|
|
6036
|
-
function
|
|
6112
|
+
function Ec(e) {
|
|
6037
6113
|
let t = e.indexOf(".");
|
|
6038
6114
|
if (t <= 0) throw Error(`invalid path "${e}" (expected "region.field")`);
|
|
6039
6115
|
return {
|
|
@@ -6041,12 +6117,12 @@ function mc(e) {
|
|
|
6041
6117
|
field: e.slice(t + 1)
|
|
6042
6118
|
};
|
|
6043
6119
|
}
|
|
6044
|
-
function
|
|
6120
|
+
function Dc(e) {
|
|
6045
6121
|
return !e.handler && !!e.ui_steps && e.ui_steps.length > 0;
|
|
6046
6122
|
}
|
|
6047
6123
|
//#endregion
|
|
6048
6124
|
//#region src/lib/mass-edit.ts
|
|
6049
|
-
function
|
|
6125
|
+
function Oc(e) {
|
|
6050
6126
|
if (!e) return [];
|
|
6051
6127
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
6052
6128
|
for (let r of e.split(",")) {
|
|
@@ -6055,17 +6131,17 @@ function gc(e) {
|
|
|
6055
6131
|
}
|
|
6056
6132
|
return n;
|
|
6057
6133
|
}
|
|
6058
|
-
function
|
|
6134
|
+
function kc(e, t) {
|
|
6059
6135
|
if (!e || !$e(e, "update")) return [];
|
|
6060
|
-
let n = Array.isArray(t) ? t :
|
|
6136
|
+
let n = Array.isArray(t) ? t : Oc(t), r = n.length > 0 ? new Set(n) : null, i = dt(e), a = new Set(B(e)), o = r ? n : Ac(e, i, a), s = [];
|
|
6061
6137
|
for (let t of o) {
|
|
6062
6138
|
if (r && !r.has(t)) continue;
|
|
6063
|
-
let n =
|
|
6139
|
+
let n = jc(e, t, i, a);
|
|
6064
6140
|
n && s.push(n);
|
|
6065
6141
|
}
|
|
6066
6142
|
return s;
|
|
6067
6143
|
}
|
|
6068
|
-
function
|
|
6144
|
+
function Ac(e, t, n) {
|
|
6069
6145
|
let r = [];
|
|
6070
6146
|
for (let [t, i] of e.fields) n.has(t) || i.auto || r.push(t);
|
|
6071
6147
|
if (!t) {
|
|
@@ -6074,7 +6150,7 @@ function vc(e, t, n) {
|
|
|
6074
6150
|
}
|
|
6075
6151
|
return r;
|
|
6076
6152
|
}
|
|
6077
|
-
function
|
|
6153
|
+
function jc(e, t, n, r) {
|
|
6078
6154
|
if (t.startsWith("$status.")) {
|
|
6079
6155
|
if (n) return null;
|
|
6080
6156
|
let r = t.slice(8), i = e.status_groups?.[r];
|
|
@@ -6082,7 +6158,7 @@ function yc(e, t, n, r) {
|
|
|
6082
6158
|
code: t,
|
|
6083
6159
|
bare: r,
|
|
6084
6160
|
kind: "status",
|
|
6085
|
-
label:
|
|
6161
|
+
label: Mc(i.name, r),
|
|
6086
6162
|
statusGroup: i
|
|
6087
6163
|
} : null;
|
|
6088
6164
|
}
|
|
@@ -6093,7 +6169,7 @@ function yc(e, t, n, r) {
|
|
|
6093
6169
|
code: t,
|
|
6094
6170
|
bare: r,
|
|
6095
6171
|
kind: "property",
|
|
6096
|
-
label:
|
|
6172
|
+
label: Mc(i.name, r),
|
|
6097
6173
|
property: i
|
|
6098
6174
|
} : null;
|
|
6099
6175
|
}
|
|
@@ -6103,18 +6179,18 @@ function yc(e, t, n, r) {
|
|
|
6103
6179
|
code: t,
|
|
6104
6180
|
bare: t,
|
|
6105
6181
|
kind: "field",
|
|
6106
|
-
label:
|
|
6182
|
+
label: Mc(i.display?.name, t),
|
|
6107
6183
|
field: i
|
|
6108
6184
|
};
|
|
6109
6185
|
}
|
|
6110
|
-
function
|
|
6111
|
-
return e &&
|
|
6186
|
+
function Mc(e, t) {
|
|
6187
|
+
return e && z(e) || t;
|
|
6112
6188
|
}
|
|
6113
6189
|
//#endregion
|
|
6114
6190
|
//#region src/components/mass-edit/PropertyGridEditor.tsx
|
|
6115
|
-
var
|
|
6116
|
-
function
|
|
6117
|
-
let a = d(() =>
|
|
6191
|
+
var Nc = Symbol.for("declarion.mass-edit.multiple");
|
|
6192
|
+
function Pc({ entity: e, filterTargets: t, selectedRows: n, value: r, onChange: i }) {
|
|
6193
|
+
let a = d(() => kc(e, t), [e, t]), o = d(() => Object.keys(r).map((e) => {
|
|
6118
6194
|
let t = a.find((t) => t.code === e);
|
|
6119
6195
|
return t ? {
|
|
6120
6196
|
target: t,
|
|
@@ -6124,8 +6200,8 @@ function Sc({ entity: e, filterTargets: t, selectedRows: n, value: r, onChange:
|
|
|
6124
6200
|
let e = new Set(o.map((e) => e.target.code));
|
|
6125
6201
|
return a.filter((t) => !e.has(t.code));
|
|
6126
6202
|
}, [o, a]), l = s((e) => {
|
|
6127
|
-
let t =
|
|
6128
|
-
a[e.code] = t ===
|
|
6203
|
+
let t = zc(e, n), a = { ...r };
|
|
6204
|
+
a[e.code] = t === Nc ? void 0 : t, i(a);
|
|
6129
6205
|
}, [
|
|
6130
6206
|
r,
|
|
6131
6207
|
n,
|
|
@@ -6153,12 +6229,12 @@ function Sc({ entity: e, filterTargets: t, selectedRows: n, value: r, onChange:
|
|
|
6153
6229
|
},
|
|
6154
6230
|
children: "No targets selected. Add a field, status, or property to edit across all selected rows."
|
|
6155
6231
|
}),
|
|
6156
|
-
o.map((e) => /* @__PURE__ */ b(
|
|
6232
|
+
o.map((e) => /* @__PURE__ */ b(Fc, {
|
|
6157
6233
|
row: e,
|
|
6158
6234
|
onChange: (t) => u(e.target.code, t),
|
|
6159
6235
|
onRemove: () => f(e.target.code)
|
|
6160
6236
|
}, e.target.code)),
|
|
6161
|
-
/* @__PURE__ */ b(
|
|
6237
|
+
/* @__PURE__ */ b(Rc, {
|
|
6162
6238
|
targets: c,
|
|
6163
6239
|
onPick: l
|
|
6164
6240
|
})
|
|
@@ -6171,7 +6247,7 @@ function Sc({ entity: e, filterTargets: t, selectedRows: n, value: r, onChange:
|
|
|
6171
6247
|
children: "Entity schema unavailable. Mass edit requires an entity-bound action."
|
|
6172
6248
|
});
|
|
6173
6249
|
}
|
|
6174
|
-
function
|
|
6250
|
+
function Fc({ row: e, onChange: n, onRemove: r }) {
|
|
6175
6251
|
let { target: i } = e;
|
|
6176
6252
|
return /* @__PURE__ */ x("div", {
|
|
6177
6253
|
"data-testid": "mass-edit-row",
|
|
@@ -6190,7 +6266,7 @@ function Cc({ row: e, onChange: n, onRemove: r }) {
|
|
|
6190
6266
|
title: i.code,
|
|
6191
6267
|
children: i.label
|
|
6192
6268
|
}),
|
|
6193
|
-
/* @__PURE__ */ b(
|
|
6269
|
+
/* @__PURE__ */ b(Ic, {
|
|
6194
6270
|
row: e,
|
|
6195
6271
|
onChange: n
|
|
6196
6272
|
}),
|
|
@@ -6202,12 +6278,12 @@ function Cc({ row: e, onChange: n, onRemove: r }) {
|
|
|
6202
6278
|
]
|
|
6203
6279
|
});
|
|
6204
6280
|
}
|
|
6205
|
-
function
|
|
6206
|
-
let { target: n } = e, r =
|
|
6281
|
+
function Ic({ row: e, onChange: t }) {
|
|
6282
|
+
let { target: n } = e, r = ys(), i = e.value === Nc, a = i ? "<multiple values>" : void 0, o = i ? "" : e.value;
|
|
6207
6283
|
if (n.kind === "status" && n.statusGroup) {
|
|
6208
6284
|
let e = n.statusGroup.statuses.map((e) => ({
|
|
6209
6285
|
value: e.code,
|
|
6210
|
-
label:
|
|
6286
|
+
label: z(e.name) || e.code
|
|
6211
6287
|
}));
|
|
6212
6288
|
return /* @__PURE__ */ b("div", {
|
|
6213
6289
|
"data-testid": `value-${n.code}`,
|
|
@@ -6219,11 +6295,11 @@ function wc({ row: e, onChange: t }) {
|
|
|
6219
6295
|
})
|
|
6220
6296
|
});
|
|
6221
6297
|
}
|
|
6222
|
-
let s =
|
|
6298
|
+
let s = Lc(n);
|
|
6223
6299
|
return /* @__PURE__ */ x("div", {
|
|
6224
6300
|
"data-testid": `value-${n.code}`,
|
|
6225
6301
|
style: { position: "relative" },
|
|
6226
|
-
children: [
|
|
6302
|
+
children: [gs({
|
|
6227
6303
|
field: s,
|
|
6228
6304
|
fieldName: n.bare,
|
|
6229
6305
|
value: o ?? "",
|
|
@@ -6242,7 +6318,7 @@ function wc({ row: e, onChange: t }) {
|
|
|
6242
6318
|
})]
|
|
6243
6319
|
});
|
|
6244
6320
|
}
|
|
6245
|
-
function
|
|
6321
|
+
function Lc(e) {
|
|
6246
6322
|
if (e.kind === "field" && e.field) return e.field;
|
|
6247
6323
|
if (e.kind === "property" && e.property) {
|
|
6248
6324
|
let t = e.property;
|
|
@@ -6257,7 +6333,7 @@ function Tc(e) {
|
|
|
6257
6333
|
}
|
|
6258
6334
|
return { type: "string" };
|
|
6259
6335
|
}
|
|
6260
|
-
function
|
|
6336
|
+
function Rc({ targets: e, onPick: n }) {
|
|
6261
6337
|
let [r, i] = p(!1);
|
|
6262
6338
|
return e.length === 0 ? null : r ? /* @__PURE__ */ b("div", {
|
|
6263
6339
|
"data-testid": "mass-edit-target-picker",
|
|
@@ -6284,7 +6360,7 @@ function Ec({ targets: e, onPick: n }) {
|
|
|
6284
6360
|
children: [/* @__PURE__ */ b(t.plus, { size: 12 }), " Add target"]
|
|
6285
6361
|
});
|
|
6286
6362
|
}
|
|
6287
|
-
function
|
|
6363
|
+
function zc(e, t) {
|
|
6288
6364
|
if (!t || t.length === 0 || e.kind !== "field") return;
|
|
6289
6365
|
let n, r = !1;
|
|
6290
6366
|
for (let i of t) {
|
|
@@ -6293,16 +6369,16 @@ function Dc(e, t) {
|
|
|
6293
6369
|
n = t, r = !0;
|
|
6294
6370
|
continue;
|
|
6295
6371
|
}
|
|
6296
|
-
if (n !== t) return
|
|
6372
|
+
if (n !== t) return Nc;
|
|
6297
6373
|
}
|
|
6298
6374
|
return n;
|
|
6299
6375
|
}
|
|
6300
6376
|
//#endregion
|
|
6301
6377
|
//#region src/components/shared/ActionDialog.tsx
|
|
6302
|
-
var
|
|
6303
|
-
function
|
|
6378
|
+
var Bc = /^\$row\.([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)$/;
|
|
6379
|
+
function Vc(e, t) {
|
|
6304
6380
|
if (typeof e != "string") return e ?? "";
|
|
6305
|
-
let n = e.match(
|
|
6381
|
+
let n = e.match(Bc);
|
|
6306
6382
|
if (n) {
|
|
6307
6383
|
let r = n[1].split("."), i = t;
|
|
6308
6384
|
for (let e of r) {
|
|
@@ -6314,9 +6390,9 @@ function kc(e, t) {
|
|
|
6314
6390
|
}
|
|
6315
6391
|
return i === void 0 ? ((t == null || !(r[0] in t)) && typeof console < "u" && console.warn && console.warn(`ActionDialog: prefill template ${e} could not be resolved; row is missing field '${r[0]}'`), "") : i ?? "";
|
|
6316
6392
|
}
|
|
6317
|
-
return
|
|
6393
|
+
return yc(e, { row: t });
|
|
6318
6394
|
}
|
|
6319
|
-
function
|
|
6395
|
+
function Hc(e) {
|
|
6320
6396
|
return {
|
|
6321
6397
|
type: e.type ?? "string",
|
|
6322
6398
|
required: e.required,
|
|
@@ -6330,18 +6406,18 @@ function Ac(e) {
|
|
|
6330
6406
|
ref: Xe(e.ref)
|
|
6331
6407
|
};
|
|
6332
6408
|
}
|
|
6333
|
-
function
|
|
6409
|
+
function Uc(e, t) {
|
|
6334
6410
|
if (!e.includes("${")) return e;
|
|
6335
|
-
let n =
|
|
6336
|
-
return n == null ? "" :
|
|
6411
|
+
let n = yc(e, { params: t });
|
|
6412
|
+
return n == null ? "" : R(n);
|
|
6337
6413
|
}
|
|
6338
|
-
var
|
|
6339
|
-
function
|
|
6414
|
+
var Wc = /\$\{\s*([^}]+?)\s*\}/g;
|
|
6415
|
+
function Gc(e, t) {
|
|
6340
6416
|
let n = `params.${t}`;
|
|
6341
|
-
for (let t of e.matchAll(
|
|
6417
|
+
for (let t of e.matchAll(Wc)) if (t[1] === n) return !0;
|
|
6342
6418
|
return !1;
|
|
6343
6419
|
}
|
|
6344
|
-
function
|
|
6420
|
+
function Kc({ param: e, value: t, onChange: n, statusGroups: r }) {
|
|
6345
6421
|
let i = d(() => {
|
|
6346
6422
|
let t = r ? Object.entries(r) : [];
|
|
6347
6423
|
return [{
|
|
@@ -6349,7 +6425,7 @@ function Pc({ param: e, value: t, onChange: n, statusGroups: r }) {
|
|
|
6349
6425
|
label: e.required ? "Select status group…" : "—"
|
|
6350
6426
|
}, ...t.map(([e, t]) => ({
|
|
6351
6427
|
value: e,
|
|
6352
|
-
label:
|
|
6428
|
+
label: z(t.name) || e
|
|
6353
6429
|
}))];
|
|
6354
6430
|
}, [r, e.required]);
|
|
6355
6431
|
return /* @__PURE__ */ b(I, {
|
|
@@ -6359,12 +6435,12 @@ function Pc({ param: e, value: t, onChange: n, statusGroups: r }) {
|
|
|
6359
6435
|
placeholder: "Select status group…"
|
|
6360
6436
|
});
|
|
6361
6437
|
}
|
|
6362
|
-
function
|
|
6438
|
+
function qc({ param: e, value: t, onChange: n, statusGroups: r, formData: i }) {
|
|
6363
6439
|
let a = d(() => {
|
|
6364
6440
|
if (!r) return [];
|
|
6365
6441
|
let t = e.filter?.status_group;
|
|
6366
6442
|
if (t) {
|
|
6367
|
-
let e =
|
|
6443
|
+
let e = Uc(t, i);
|
|
6368
6444
|
return e && r[e] ? r[e].statuses : [];
|
|
6369
6445
|
}
|
|
6370
6446
|
return Object.values(r).flatMap((e) => e.statuses);
|
|
@@ -6377,7 +6453,7 @@ function Fc({ param: e, value: t, onChange: n, statusGroups: r, formData: i }) {
|
|
|
6377
6453
|
label: a.length === 0 ? "Select status group first" : "Select status…"
|
|
6378
6454
|
}, ...a.map((e) => ({
|
|
6379
6455
|
value: e.code,
|
|
6380
|
-
label:
|
|
6456
|
+
label: z(e.name) || e.code
|
|
6381
6457
|
}))], [a]);
|
|
6382
6458
|
return /* @__PURE__ */ b(I, {
|
|
6383
6459
|
value: typeof t == "string" ? t : "",
|
|
@@ -6386,8 +6462,8 @@ function Fc({ param: e, value: t, onChange: n, statusGroups: r, formData: i }) {
|
|
|
6386
6462
|
placeholder: "Select status…"
|
|
6387
6463
|
});
|
|
6388
6464
|
}
|
|
6389
|
-
function
|
|
6390
|
-
let { data: m } = X(), h =
|
|
6465
|
+
function Jc({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, isPending: o, row: c, bulkSelection: u }) {
|
|
6466
|
+
let { data: m } = X(), h = ys(), g = r.resolved_params, _ = r.resolved_hidden_defaults ?? {}, v = !!r.destructive, S = Is(r, h), C = s(() => {
|
|
6391
6467
|
o || n(!1);
|
|
6392
6468
|
}, [o, n]), w = f(null);
|
|
6393
6469
|
l(() => {
|
|
@@ -6402,11 +6478,11 @@ function Ic({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
6402
6478
|
for (let [e, t] of k.fields) if (t.primary) return e;
|
|
6403
6479
|
return k.primary_key?.[0];
|
|
6404
6480
|
}
|
|
6405
|
-
}, [k]),
|
|
6481
|
+
}, [k]), j = s(() => {
|
|
6406
6482
|
let e = { ..._ };
|
|
6407
6483
|
for (let [t, n] of T) {
|
|
6408
6484
|
if (n.type === "id_array") {
|
|
6409
|
-
u && A ?
|
|
6485
|
+
e[t] = u && A ? u.map((e) => e[A]).filter((e) => e != null) : [];
|
|
6410
6486
|
continue;
|
|
6411
6487
|
}
|
|
6412
6488
|
if (n.type === "entity_patch") {
|
|
@@ -6414,11 +6490,11 @@ function Ic({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
6414
6490
|
continue;
|
|
6415
6491
|
}
|
|
6416
6492
|
if (n.type === "bool") {
|
|
6417
|
-
let r =
|
|
6493
|
+
let r = Vc(n.default, c);
|
|
6418
6494
|
e[t] = r === !0 || r === "true";
|
|
6419
6495
|
continue;
|
|
6420
6496
|
}
|
|
6421
|
-
e[t] =
|
|
6497
|
+
e[t] = Vc(n.default, c);
|
|
6422
6498
|
}
|
|
6423
6499
|
return e;
|
|
6424
6500
|
}, [
|
|
@@ -6426,8 +6502,8 @@ function Ic({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
6426
6502
|
c,
|
|
6427
6503
|
u,
|
|
6428
6504
|
A
|
|
6429
|
-
])), N = s((e, t) => {
|
|
6430
|
-
|
|
6505
|
+
]), [M, ee] = p(j), N = s((e, t) => {
|
|
6506
|
+
ee((n) => {
|
|
6431
6507
|
let r = {
|
|
6432
6508
|
...n,
|
|
6433
6509
|
[e]: t
|
|
@@ -6436,20 +6512,20 @@ function Ic({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
6436
6512
|
for (let [t, n] of g) {
|
|
6437
6513
|
if (n.type !== "status") continue;
|
|
6438
6514
|
let i = n.filter?.status_group;
|
|
6439
|
-
i &&
|
|
6515
|
+
i && Gc(i, e) && (r[t] = "");
|
|
6440
6516
|
}
|
|
6441
6517
|
return r;
|
|
6442
6518
|
});
|
|
6443
|
-
}, [g]),
|
|
6444
|
-
let e = { ...
|
|
6519
|
+
}, [g]), te = s(() => {
|
|
6520
|
+
let e = { ...M };
|
|
6445
6521
|
for (let [t, n] of T) {
|
|
6446
|
-
let r =
|
|
6522
|
+
let r = M[t], i = r == null || r === "";
|
|
6447
6523
|
if (n.required && i) return;
|
|
6448
6524
|
i && delete e[t];
|
|
6449
6525
|
}
|
|
6450
6526
|
a(e);
|
|
6451
6527
|
}, [
|
|
6452
|
-
|
|
6528
|
+
M,
|
|
6453
6529
|
T,
|
|
6454
6530
|
a
|
|
6455
6531
|
]);
|
|
@@ -6533,7 +6609,7 @@ function Ic({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
6533
6609
|
color: "var(--text-3)",
|
|
6534
6610
|
marginTop: 2
|
|
6535
6611
|
},
|
|
6536
|
-
children:
|
|
6612
|
+
children: z(r.display?.description) || (T.length > 0 ? "Fill in the parameters below to execute this action." : "")
|
|
6537
6613
|
})]
|
|
6538
6614
|
}),
|
|
6539
6615
|
/* @__PURE__ */ b(O, {
|
|
@@ -6577,34 +6653,34 @@ function Ic({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
6577
6653
|
opacity: o ? .6 : 1
|
|
6578
6654
|
},
|
|
6579
6655
|
children: T.map(([e, t]) => {
|
|
6580
|
-
let n =
|
|
6656
|
+
let n = z(t.display?.name) || e;
|
|
6581
6657
|
if (t.type === "id_array") return null;
|
|
6582
6658
|
let r;
|
|
6583
6659
|
if (t.type === "entity_patch") {
|
|
6584
6660
|
let n = typeof t.filter?.targets == "string" ? t.filter.targets : void 0;
|
|
6585
|
-
r = /* @__PURE__ */ b(
|
|
6661
|
+
r = /* @__PURE__ */ b(Pc, {
|
|
6586
6662
|
entity: k,
|
|
6587
6663
|
filterTargets: n,
|
|
6588
6664
|
selectedRows: u,
|
|
6589
|
-
value:
|
|
6665
|
+
value: M[e] ?? {},
|
|
6590
6666
|
onChange: (t) => N(e, t)
|
|
6591
6667
|
});
|
|
6592
|
-
} else r = t.type === "status_group" ? /* @__PURE__ */ b(
|
|
6668
|
+
} else r = t.type === "status_group" ? /* @__PURE__ */ b(Kc, {
|
|
6593
6669
|
param: t,
|
|
6594
|
-
value:
|
|
6670
|
+
value: M[e],
|
|
6595
6671
|
onChange: (t) => N(e, t),
|
|
6596
6672
|
statusGroups: E,
|
|
6597
|
-
formData:
|
|
6598
|
-
}) : t.type === "status" ? /* @__PURE__ */ b(
|
|
6673
|
+
formData: M
|
|
6674
|
+
}) : t.type === "status" ? /* @__PURE__ */ b(qc, {
|
|
6599
6675
|
param: t,
|
|
6600
|
-
value:
|
|
6676
|
+
value: M[e],
|
|
6601
6677
|
onChange: (t) => N(e, t),
|
|
6602
6678
|
statusGroups: E,
|
|
6603
|
-
formData:
|
|
6604
|
-
}) :
|
|
6605
|
-
field:
|
|
6679
|
+
formData: M
|
|
6680
|
+
}) : gs({
|
|
6681
|
+
field: Hc(t),
|
|
6606
6682
|
fieldName: e,
|
|
6607
|
-
value:
|
|
6683
|
+
value: M[e],
|
|
6608
6684
|
mode: "edit",
|
|
6609
6685
|
onChange: (t) => N(e, t),
|
|
6610
6686
|
locale: h
|
|
@@ -6624,7 +6700,7 @@ function Ic({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
6624
6700
|
marginTop: 4,
|
|
6625
6701
|
marginBottom: 0
|
|
6626
6702
|
},
|
|
6627
|
-
children:
|
|
6703
|
+
children: z(t.display.description)
|
|
6628
6704
|
})
|
|
6629
6705
|
]
|
|
6630
6706
|
}, e);
|
|
@@ -6654,7 +6730,7 @@ function Ic({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
6654
6730
|
kind: "primary",
|
|
6655
6731
|
danger: v,
|
|
6656
6732
|
icon: b(o ? xe : v ? t.trash : t.bolt, { size: 13 }),
|
|
6657
|
-
onClick:
|
|
6733
|
+
onClick: te,
|
|
6658
6734
|
disabled: o,
|
|
6659
6735
|
children: o ? "Executing…" : T.length > 0 ? "Execute" : "Confirm"
|
|
6660
6736
|
})
|
|
@@ -6665,7 +6741,7 @@ function Ic({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
6665
6741
|
}
|
|
6666
6742
|
//#endregion
|
|
6667
6743
|
//#region src/components/shared/ActionResultDialog.tsx
|
|
6668
|
-
function
|
|
6744
|
+
function Yc({ open: e, onClose: n, display: r }) {
|
|
6669
6745
|
let i = f(null);
|
|
6670
6746
|
return l(() => {
|
|
6671
6747
|
e && i.current?.focus();
|
|
@@ -6760,7 +6836,7 @@ function Lc({ open: e, onClose: n, display: r }) {
|
|
|
6760
6836
|
gap: 12,
|
|
6761
6837
|
overflowY: "auto"
|
|
6762
6838
|
},
|
|
6763
|
-
children: r.fields.map((e, t) => /* @__PURE__ */ b(
|
|
6839
|
+
children: r.fields.map((e, t) => /* @__PURE__ */ b(Xc, {
|
|
6764
6840
|
field: e,
|
|
6765
6841
|
onNavigate: n
|
|
6766
6842
|
}, t))
|
|
@@ -6786,13 +6862,13 @@ function Lc({ open: e, onClose: n, display: r }) {
|
|
|
6786
6862
|
]
|
|
6787
6863
|
})] }) : null;
|
|
6788
6864
|
}
|
|
6789
|
-
function
|
|
6790
|
-
let r = e.href ?? e.download_url ?? e.value, i = e.type === "download", a = i || e.type === "link", o = r ?
|
|
6865
|
+
function Xc({ field: e, onNavigate: n }) {
|
|
6866
|
+
let r = e.href ?? e.download_url ?? e.value, i = e.type === "download", a = i || e.type === "link", o = r ? ri(r) : void 0, [s, c] = p(!1), [l, u] = p(null);
|
|
6791
6867
|
async function d() {
|
|
6792
6868
|
if (o) {
|
|
6793
6869
|
c(!0), u(null);
|
|
6794
6870
|
try {
|
|
6795
|
-
await
|
|
6871
|
+
await si(o, e.filename);
|
|
6796
6872
|
} catch (e) {
|
|
6797
6873
|
u(e instanceof Error ? e.message : String(e));
|
|
6798
6874
|
} finally {
|
|
@@ -6817,7 +6893,7 @@ function Rc({ field: e, onNavigate: n }) {
|
|
|
6817
6893
|
fontWeight: 500,
|
|
6818
6894
|
textDecoration: "none",
|
|
6819
6895
|
whiteSpace: "nowrap"
|
|
6820
|
-
}, m = a && !i, h =
|
|
6896
|
+
}, m = a && !i, h = ii(o), g = {
|
|
6821
6897
|
flex: 1,
|
|
6822
6898
|
minWidth: 0,
|
|
6823
6899
|
display: "inline-flex",
|
|
@@ -6900,7 +6976,7 @@ function Rc({ field: e, onNavigate: n }) {
|
|
|
6900
6976
|
},
|
|
6901
6977
|
children: e.value
|
|
6902
6978
|
})]
|
|
6903
|
-
}), e.copyable && /* @__PURE__ */ b(
|
|
6979
|
+
}), e.copyable && /* @__PURE__ */ b(ui, { value: e.value })]
|
|
6904
6980
|
}) : /* @__PURE__ */ x("div", {
|
|
6905
6981
|
style: {
|
|
6906
6982
|
position: "relative",
|
|
@@ -6924,7 +7000,7 @@ function Rc({ field: e, onNavigate: n }) {
|
|
|
6924
7000
|
top: 4,
|
|
6925
7001
|
right: 4
|
|
6926
7002
|
},
|
|
6927
|
-
children: /* @__PURE__ */ b(
|
|
7003
|
+
children: /* @__PURE__ */ b(ui, { value: e.value })
|
|
6928
7004
|
})]
|
|
6929
7005
|
})
|
|
6930
7006
|
]
|
|
@@ -6932,7 +7008,7 @@ function Rc({ field: e, onNavigate: n }) {
|
|
|
6932
7008
|
}
|
|
6933
7009
|
//#endregion
|
|
6934
7010
|
//#region src/components/shared/ActionRunner.tsx
|
|
6935
|
-
function
|
|
7011
|
+
function Zc(e) {
|
|
6936
7012
|
if (!e || typeof e != "object") return { kind: "success" };
|
|
6937
7013
|
let t = e, n = t.status, r = t.success?.length ?? 0, i = t.errors?.length ?? 0, a = t.skipped?.length ?? 0, o = t.errors?.[0]?.error;
|
|
6938
7014
|
if (n === "partial") {
|
|
@@ -6947,33 +7023,33 @@ function zc(e) {
|
|
|
6947
7023
|
detail: "No items matched"
|
|
6948
7024
|
} : n === "accepted" ? { kind: "accepted" } : { kind: "success" };
|
|
6949
7025
|
}
|
|
6950
|
-
function
|
|
7026
|
+
function Qc(e) {
|
|
6951
7027
|
if (!e || typeof e != "object") return null;
|
|
6952
7028
|
let t = e.result;
|
|
6953
7029
|
if (!t || typeof t != "object") return null;
|
|
6954
7030
|
let n = t.$display;
|
|
6955
7031
|
return !n || typeof n != "object" ? null : n;
|
|
6956
7032
|
}
|
|
6957
|
-
function
|
|
6958
|
-
let t =
|
|
7033
|
+
function $c(e) {
|
|
7034
|
+
let t = Qc(e)?.fields;
|
|
6959
7035
|
if (!Array.isArray(t)) return null;
|
|
6960
7036
|
for (let e of t) {
|
|
6961
7037
|
if (e?.type !== "download") continue;
|
|
6962
7038
|
let t = e.href ?? e.download_url ?? e.value;
|
|
6963
|
-
if (typeof t == "string" && t !== "" &&
|
|
7039
|
+
if (typeof t == "string" && t !== "" && ri(t)) return {
|
|
6964
7040
|
url: t,
|
|
6965
7041
|
filename: typeof e.filename == "string" ? e.filename : void 0
|
|
6966
7042
|
};
|
|
6967
7043
|
}
|
|
6968
7044
|
return null;
|
|
6969
7045
|
}
|
|
6970
|
-
function
|
|
7046
|
+
function el(e) {
|
|
6971
7047
|
if (!e || typeof e != "object") return;
|
|
6972
7048
|
let t = e.result;
|
|
6973
7049
|
!t || typeof t != "object" || "impersonation_session_id" in t && window.location.assign("/");
|
|
6974
7050
|
}
|
|
6975
|
-
function
|
|
6976
|
-
if (e instanceof
|
|
7051
|
+
function tl(e) {
|
|
7052
|
+
if (e instanceof ir) {
|
|
6977
7053
|
let t = e.response.errors ?? [];
|
|
6978
7054
|
if (t.length === 1) return {
|
|
6979
7055
|
kind: "error",
|
|
@@ -6993,23 +7069,23 @@ function Uc(e) {
|
|
|
6993
7069
|
detail: e instanceof Error ? e.message : String(e)
|
|
6994
7070
|
};
|
|
6995
7071
|
}
|
|
6996
|
-
var
|
|
6997
|
-
function
|
|
6998
|
-
let e = c(
|
|
7072
|
+
var nl = i(null);
|
|
7073
|
+
function rl() {
|
|
7074
|
+
let e = c(nl);
|
|
6999
7075
|
if (!e) throw Error("useActionRunner must be used within <ActionRunnerProvider>");
|
|
7000
7076
|
return e;
|
|
7001
7077
|
}
|
|
7002
|
-
function
|
|
7078
|
+
function il(e) {
|
|
7003
7079
|
let t = {}, n = e.action?.resolved_hidden_defaults;
|
|
7004
7080
|
if (n) for (let [e, r] of Object.entries(n)) r !== void 0 && (t[e] = r);
|
|
7005
7081
|
return t;
|
|
7006
7082
|
}
|
|
7007
|
-
function
|
|
7008
|
-
let t =
|
|
7083
|
+
function al({ children: e }) {
|
|
7084
|
+
let t = Lr(), { data: n } = X(), [r, i] = p(null), [a, o] = p(0), [c, l] = p(null), u = s((e) => {
|
|
7009
7085
|
if (e?.progress_screen) return n?.screens[e.progress_screen]?.route;
|
|
7010
7086
|
}, [n?.screens]), f = s((e, n, r, i, a) => {
|
|
7011
7087
|
let o = () => {
|
|
7012
|
-
let n =
|
|
7088
|
+
let n = ol(a), i = u(r), o = n ? `Job ${n} queued` : "Running in background";
|
|
7013
7089
|
Z.success(`${e} started`, o, i ? { action: {
|
|
7014
7090
|
label: "View",
|
|
7015
7091
|
onClick: () => t(i)
|
|
@@ -7017,10 +7093,10 @@ function qc({ children: e }) {
|
|
|
7017
7093
|
};
|
|
7018
7094
|
switch (i.kind) {
|
|
7019
7095
|
case "success": {
|
|
7020
|
-
let t =
|
|
7096
|
+
let t = $c(a), r = t ? { action: {
|
|
7021
7097
|
label: "Download",
|
|
7022
7098
|
onClick: () => {
|
|
7023
|
-
|
|
7099
|
+
si(t.url, t.filename).catch((e) => {
|
|
7024
7100
|
Z.error("Download failed", e instanceof Error ? e.message : String(e));
|
|
7025
7101
|
});
|
|
7026
7102
|
}
|
|
@@ -7052,16 +7128,16 @@ function qc({ children: e }) {
|
|
|
7052
7128
|
}
|
|
7053
7129
|
if (t.kind !== "success" && t.kind !== "accepted") return;
|
|
7054
7130
|
e.onSuccess?.(n);
|
|
7055
|
-
let r =
|
|
7056
|
-
r && l(r),
|
|
7131
|
+
let r = Qc(n);
|
|
7132
|
+
r && l(r), el(n);
|
|
7057
7133
|
}, [m]), g = s((e) => {
|
|
7058
|
-
let t = e.action, n = e.longRunning ?? t?.long_running ?? !1, r = e.title ||
|
|
7134
|
+
let t = e.action, n = e.longRunning ?? t?.long_running ?? !1, r = e.title || z(t?.display?.name) || "Action", a = async (i) => {
|
|
7059
7135
|
o((e) => e + 1);
|
|
7060
7136
|
try {
|
|
7061
|
-
let a = await e.execute(i), o =
|
|
7137
|
+
let a = await e.execute(i), o = Zc(a);
|
|
7062
7138
|
f(r, n, t, o, a), h(e, o, a);
|
|
7063
7139
|
} catch (e) {
|
|
7064
|
-
f(r, n, t,
|
|
7140
|
+
f(r, n, t, tl(e));
|
|
7065
7141
|
} finally {
|
|
7066
7142
|
o((e) => Math.max(0, e - 1));
|
|
7067
7143
|
}
|
|
@@ -7071,14 +7147,14 @@ function qc({ children: e }) {
|
|
|
7071
7147
|
icon: ""
|
|
7072
7148
|
},
|
|
7073
7149
|
destructive: !0
|
|
7074
|
-
} : void 0), c = !!(t?.resolved_params && t.resolved_params.length > 0), l =
|
|
7150
|
+
} : void 0), c = !!(t?.resolved_params && t.resolved_params.length > 0), l = Ls(s);
|
|
7075
7151
|
return s && (c || l) ? (i({
|
|
7076
7152
|
id: Symbol(),
|
|
7077
7153
|
opts: e,
|
|
7078
7154
|
title: r,
|
|
7079
7155
|
action: s,
|
|
7080
7156
|
pending: !1
|
|
7081
|
-
}), Promise.resolve()) : a(
|
|
7157
|
+
}), Promise.resolve()) : a(il(e));
|
|
7082
7158
|
}, [f, h]), v = a > 0 || !!r?.pending, y = d(() => ({
|
|
7083
7159
|
run: g,
|
|
7084
7160
|
isRunning: v
|
|
@@ -7090,10 +7166,10 @@ function qc({ children: e }) {
|
|
|
7090
7166
|
pending: !0
|
|
7091
7167
|
} : e), o((e) => e + 1);
|
|
7092
7168
|
try {
|
|
7093
|
-
let r = await n.opts.execute(e), o =
|
|
7169
|
+
let r = await n.opts.execute(e), o = Zc(r);
|
|
7094
7170
|
f(n.title, s, a, o, r), h(n.opts, o, r), o.kind !== "partial" && i((e) => e?.id === t ? null : e);
|
|
7095
7171
|
} catch (e) {
|
|
7096
|
-
f(n.title, s, a,
|
|
7172
|
+
f(n.title, s, a, tl(e));
|
|
7097
7173
|
} finally {
|
|
7098
7174
|
o((e) => Math.max(0, e - 1)), i((e) => e?.id === t ? {
|
|
7099
7175
|
...e,
|
|
@@ -7105,16 +7181,16 @@ function qc({ children: e }) {
|
|
|
7105
7181
|
f,
|
|
7106
7182
|
h
|
|
7107
7183
|
]);
|
|
7108
|
-
return /* @__PURE__ */ x(
|
|
7184
|
+
return /* @__PURE__ */ x(nl.Provider, {
|
|
7109
7185
|
value: y,
|
|
7110
7186
|
children: [
|
|
7111
7187
|
e,
|
|
7112
|
-
c && /* @__PURE__ */ b(
|
|
7188
|
+
c && /* @__PURE__ */ b(Yc, {
|
|
7113
7189
|
open: !0,
|
|
7114
7190
|
onClose: () => l(null),
|
|
7115
7191
|
display: c
|
|
7116
7192
|
}),
|
|
7117
|
-
r && S && /* @__PURE__ */ b(
|
|
7193
|
+
r && S && /* @__PURE__ */ b(Jc, {
|
|
7118
7194
|
open: !0,
|
|
7119
7195
|
onOpenChange: (e) => {
|
|
7120
7196
|
e || i(null);
|
|
@@ -7129,29 +7205,29 @@ function qc({ children: e }) {
|
|
|
7129
7205
|
]
|
|
7130
7206
|
});
|
|
7131
7207
|
}
|
|
7132
|
-
function
|
|
7133
|
-
return
|
|
7208
|
+
function ol(e) {
|
|
7209
|
+
return sl(e) ?? sl(e?.result);
|
|
7134
7210
|
}
|
|
7135
|
-
function
|
|
7211
|
+
function sl(e) {
|
|
7136
7212
|
if (!e || typeof e != "object") return;
|
|
7137
7213
|
let t = e, n = t.job_id ?? t.id;
|
|
7138
7214
|
return typeof n == "string" ? n : void 0;
|
|
7139
7215
|
}
|
|
7140
7216
|
//#endregion
|
|
7141
7217
|
//#region src/hooks/useCurrentScreen.tsx
|
|
7142
|
-
var
|
|
7143
|
-
function
|
|
7218
|
+
var cl = i(void 0);
|
|
7219
|
+
function ll({ code: e, children: t }) {
|
|
7144
7220
|
let { data: n } = X(), r = d(() => ({
|
|
7145
7221
|
code: e,
|
|
7146
7222
|
screen: n?.screens[e]
|
|
7147
7223
|
}), [e, n]);
|
|
7148
|
-
return /* @__PURE__ */ b(
|
|
7224
|
+
return /* @__PURE__ */ b(cl.Provider, {
|
|
7149
7225
|
value: r,
|
|
7150
7226
|
children: t
|
|
7151
7227
|
});
|
|
7152
7228
|
}
|
|
7153
|
-
function
|
|
7154
|
-
return c(
|
|
7229
|
+
function ul() {
|
|
7230
|
+
return c(cl);
|
|
7155
7231
|
}
|
|
7156
7232
|
//#endregion
|
|
7157
|
-
export {
|
|
7233
|
+
export { oi as $, ye as $n, Pt as $t, ys as A, Qe as An, X as At, Ta as B, Se as Bn, In as Bt, Bs as C, We as Cn, Xn as Ct, Zs as D, ot as Dn, fr as Dt, Cs as E, nt as En, cr as Et, Aa as F, Ve as Fn, Kn as Ft, Ii as G, Ie as Gn, J as Gt, fa as H, Oe as Hn, Un as Ht, Q as I, ze as In, Wn as It, Ai as J, we as Jn, Sn as Jt, Pi as K, I as Kn, Y as Kt, wa as L, R as Ln, Gn as Lt, ms as M, Ge as Mn, qn as Mt, ka as N, Je as Nn, Fn as Nt, ws as O, it as On, dr as Ot, ja as P, at as Pn, Rn as Pt, si as Q, be as Qn, Wt as Qt, Da as R, L as Rn, Hn as Rt, Ns as S, Ye as Sn, Zn as St, zs as T, z as Tn, nr as Tt, da as U, Ne as Un, Bn as Ut, sa as V, Fe as Vn, Ln as Vt, oa as W, Re as Wn, K as Wt, ji as X, Le as Xn, Bt as Xt, Mi as Y, F as Yn, xn as Yt, ui as Z, xe as Zn, Ut as Zt, Vs as _, ut as _n, Qn as _t, Nc as a, St as an, oe as ar, zr as at, Ts as b, $e as bn, pr as bt, kc as c, bt as cn, k as cr, Pr as ct, Dc as d, pt as dn, Ar as dt, Nt as en, le as er, ii as et, rc as f, ft as fn, Dr as ft, Rs as g, lt as gn, or as gt, Qs as h, ct as hn, ir as ht, rl as i, Mt as in, P as ir, Lr as it, gs as j, st as jn, Jn as jt, Os as k, rt as kn, $n as kt, Oc as l, yt as ln, O as lr, jr as lt, xs as m, Ue as mn, yr as mt, ul as n, Dt as nn, fe as nr, ei as nt, Pc as o, Ct as on, j as or, Rr as ot, Ss as p, mt as pn, Or as pt, Ni as q, Pe as qn, bn as qt, al as r, Ot as rn, ve as rr, Z as rt, zc as s, wt as sn, A as sr, Ir as st, ll as t, kt as tn, _e as tr, ri as tt, Sc as u, V as un, D as ur, kr as ut, tc as v, Ze as vn, er as vt, Ms as w, B as wn, mr as wt, Xs as x, tt as xn, rr as xt, ec as y, et as yn, tr as yt, ha as z, ke as zn, zn as zt };
|