@dskripchenko/laravel-admin 1.12.3 → 1.12.4
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/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +348 -348
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -19690,13 +19690,13 @@ const b2 = Ge("admin-i18n", () => {
|
|
|
19690
19690
|
o.value = !1;
|
|
19691
19691
|
}
|
|
19692
19692
|
}
|
|
19693
|
-
async function
|
|
19693
|
+
async function b() {
|
|
19694
19694
|
const _ = await Me().get(
|
|
19695
19695
|
"/notifications/unread"
|
|
19696
19696
|
);
|
|
19697
19697
|
t.value = _.count, l.value === "unread" && (a.value = _.data);
|
|
19698
19698
|
}
|
|
19699
|
-
async function
|
|
19699
|
+
async function x(k) {
|
|
19700
19700
|
await Me().post("/notifications/markAsRead", { id: k });
|
|
19701
19701
|
const Z = a.value.find((U) => U.id === k);
|
|
19702
19702
|
Z && Z.read_at === null && (Z.read_at = (/* @__PURE__ */ new Date()).toISOString(), t.value = Math.max(0, t.value - 1));
|
|
@@ -19726,8 +19726,8 @@ const b2 = Ge("admin-i18n", () => {
|
|
|
19726
19726
|
hasUnread: s,
|
|
19727
19727
|
hydrate: p,
|
|
19728
19728
|
load: f,
|
|
19729
|
-
loadUnread:
|
|
19730
|
-
markAsRead:
|
|
19729
|
+
loadUnread: b,
|
|
19730
|
+
markAsRead: x,
|
|
19731
19731
|
markAllAsRead: g,
|
|
19732
19732
|
destroy: L,
|
|
19733
19733
|
openDrawer: r,
|
|
@@ -19876,10 +19876,10 @@ const e1 = Ge("admin-auth", () => {
|
|
|
19876
19876
|
});
|
|
19877
19877
|
return a.value = k.user, o.value = null, { remaining: k.recovery_codes_remaining };
|
|
19878
19878
|
}
|
|
19879
|
-
function
|
|
19879
|
+
function b() {
|
|
19880
19880
|
o.value = null;
|
|
19881
19881
|
}
|
|
19882
|
-
async function
|
|
19882
|
+
async function x() {
|
|
19883
19883
|
const g = Me();
|
|
19884
19884
|
try {
|
|
19885
19885
|
await g.post("/auth/logout");
|
|
@@ -19903,8 +19903,8 @@ const e1 = Ge("admin-auth", () => {
|
|
|
19903
19903
|
login: m,
|
|
19904
19904
|
twoFactorChallenge: p,
|
|
19905
19905
|
twoFactorRecovery: f,
|
|
19906
|
-
cancelChallenge:
|
|
19907
|
-
logout:
|
|
19906
|
+
cancelChallenge: b,
|
|
19907
|
+
logout: x
|
|
19908
19908
|
};
|
|
19909
19909
|
}), wx = ["aria-label"], xx = /* @__PURE__ */ ne({
|
|
19910
19910
|
__name: "UserMenu",
|
|
@@ -20034,22 +20034,22 @@ const e1 = Ge("admin-auth", () => {
|
|
|
20034
20034
|
const m = e1(), p = (f) => {
|
|
20035
20035
|
if (Array.isArray(f.permissions) && f.permissions.length > 0 && !m.hasAnyPermission(f.permissions))
|
|
20036
20036
|
return null;
|
|
20037
|
-
const
|
|
20038
|
-
return { ...f, children:
|
|
20037
|
+
const b = (f.children ?? []).map(p).filter((x) => x !== null);
|
|
20038
|
+
return { ...f, children: b };
|
|
20039
20039
|
};
|
|
20040
20040
|
return a.value.map(p).filter((f) => f !== null);
|
|
20041
20041
|
}), i = M(() => {
|
|
20042
20042
|
const m = /* @__PURE__ */ new Map();
|
|
20043
20043
|
for (const f of d.value) {
|
|
20044
|
-
const
|
|
20045
|
-
m.has(
|
|
20044
|
+
const b = f.group ?? null;
|
|
20045
|
+
m.has(b) || m.set(b, []), m.get(b).push(f);
|
|
20046
20046
|
}
|
|
20047
20047
|
const p = [];
|
|
20048
|
-
for (const [f,
|
|
20049
|
-
|
|
20050
|
-
const L = (
|
|
20051
|
-
return L !== 0 ? L :
|
|
20052
|
-
}), p.push({ group: f, items:
|
|
20048
|
+
for (const [f, b] of m)
|
|
20049
|
+
b.sort((x, g) => {
|
|
20050
|
+
const L = (x.order ?? 0) - (g.order ?? 0);
|
|
20051
|
+
return L !== 0 ? L : x.label.localeCompare(g.label);
|
|
20052
|
+
}), p.push({ group: f, items: b });
|
|
20053
20053
|
return p;
|
|
20054
20054
|
});
|
|
20055
20055
|
async function s(m = !1) {
|
|
@@ -20214,11 +20214,11 @@ const Ax = ["data-depth"], zx = ["aria-expanded", "title"], Hx = { class: "uid-s
|
|
|
20214
20214
|
const g = p.value;
|
|
20215
20215
|
return g === 0 ? 0 : Math.max(0.12, 0.85 - (g - 1) * 0.18);
|
|
20216
20216
|
});
|
|
20217
|
-
function
|
|
20217
|
+
function b(g) {
|
|
20218
20218
|
const L = _9(g) ?? l2;
|
|
20219
20219
|
return () => Se(ee, { icon: L, size: 16 });
|
|
20220
20220
|
}
|
|
20221
|
-
function
|
|
20221
|
+
function x() {
|
|
20222
20222
|
d.value = !d.value;
|
|
20223
20223
|
}
|
|
20224
20224
|
return (g, L) => {
|
|
@@ -20244,10 +20244,10 @@ const Ax = ["data-depth"], zx = ["aria-expanded", "title"], Hx = { class: "uid-s
|
|
|
20244
20244
|
}]),
|
|
20245
20245
|
"aria-expanded": d.value,
|
|
20246
20246
|
title: a.collapsed ? a.item.label : void 0,
|
|
20247
|
-
onClick:
|
|
20247
|
+
onClick: x
|
|
20248
20248
|
}, [
|
|
20249
20249
|
u("span", Hx, [
|
|
20250
|
-
(c(), z(Re(
|
|
20250
|
+
(c(), z(Re(b(a.item.icon))))
|
|
20251
20251
|
]),
|
|
20252
20252
|
a.collapsed ? H("", !0) : (c(), h("span", Vx, v(a.item.label), 1)),
|
|
20253
20253
|
a.collapsed ? H("", !0) : (c(), h("span", {
|
|
@@ -20270,7 +20270,7 @@ const Ax = ["data-depth"], zx = ["aria-expanded", "title"], Hx = { class: "uid-s
|
|
|
20270
20270
|
title: a.collapsed ? a.item.label : void 0
|
|
20271
20271
|
}, {
|
|
20272
20272
|
icon: w(() => [
|
|
20273
|
-
(c(), z(Re(
|
|
20273
|
+
(c(), z(Re(b(a.item.icon))))
|
|
20274
20274
|
]),
|
|
20275
20275
|
default: w(() => [
|
|
20276
20276
|
F(" " + v(a.item.label), 1)
|
|
@@ -20315,13 +20315,13 @@ const Ax = ["data-depth"], zx = ["aria-expanded", "title"], Hx = { class: "uid-s
|
|
|
20315
20315
|
marginLeft: `${r.value}px`,
|
|
20316
20316
|
background: m.value
|
|
20317
20317
|
}));
|
|
20318
|
-
return (
|
|
20318
|
+
return (b, x) => (c(), h("span", {
|
|
20319
20319
|
role: "img",
|
|
20320
20320
|
"aria-label": a.title,
|
|
20321
20321
|
class: ve(["ladmin-logo", { "ladmin-logo--animated": a.animated }]),
|
|
20322
20322
|
style: Ve(p.value)
|
|
20323
20323
|
}, [
|
|
20324
|
-
|
|
20324
|
+
x[0] || (x[0] = u("span", { "aria-hidden": "true" }, ">_", -1)),
|
|
20325
20325
|
u("span", {
|
|
20326
20326
|
"aria-hidden": "true",
|
|
20327
20327
|
class: "ladmin-logo__cursor",
|
|
@@ -20435,7 +20435,7 @@ const Ax = ["data-depth"], zx = ["aria-expanded", "title"], Hx = { class: "uid-s
|
|
|
20435
20435
|
},
|
|
20436
20436
|
emits: ["update:modelValue"],
|
|
20437
20437
|
setup(a, { emit: t }) {
|
|
20438
|
-
const o = a, l = t, d = Oe(), i = uI(), s = b2(), r = (W, te) => s.has(W) ? s.t(W) : te, y = q(""), m = q(!1), p = q([]), f = q(0),
|
|
20438
|
+
const o = a, l = t, d = Oe(), i = uI(), s = b2(), r = (W, te) => s.has(W) ? s.t(W) : te, y = q(""), m = q(!1), p = q([]), f = q(0), b = q(null), x = M({
|
|
20439
20439
|
get: () => o.modelValue,
|
|
20440
20440
|
set: (W) => l("update:modelValue", W)
|
|
20441
20441
|
});
|
|
@@ -20489,17 +20489,17 @@ const Ax = ["data-depth"], zx = ["aria-expanded", "title"], Hx = { class: "uid-s
|
|
|
20489
20489
|
return N + W.items.indexOf(te);
|
|
20490
20490
|
}
|
|
20491
20491
|
function P(W) {
|
|
20492
|
-
W && (
|
|
20492
|
+
W && (x.value = !1, d.push(W.url));
|
|
20493
20493
|
}
|
|
20494
20494
|
function T(W) {
|
|
20495
20495
|
const te = _.value.length;
|
|
20496
20496
|
te !== 0 && (f.value = (f.value + W + te) % te);
|
|
20497
20497
|
}
|
|
20498
|
-
return we(
|
|
20499
|
-
W && (y.value = "", p.value = [], f.value = 0, i1(() =>
|
|
20498
|
+
return we(x, (W) => {
|
|
20499
|
+
W && (y.value = "", p.value = [], f.value = 0, i1(() => b.value?.focus()));
|
|
20500
20500
|
}), (W, te) => (c(), z(n($w), {
|
|
20501
|
-
modelValue:
|
|
20502
|
-
"onUpdate:modelValue": te[4] || (te[4] = (N) =>
|
|
20501
|
+
modelValue: x.value,
|
|
20502
|
+
"onUpdate:modelValue": te[4] || (te[4] = (N) => x.value = N),
|
|
20503
20503
|
size: "md"
|
|
20504
20504
|
}, {
|
|
20505
20505
|
default: w(() => [
|
|
@@ -20511,7 +20511,7 @@ const Ax = ["data-depth"], zx = ["aria-expanded", "title"], Hx = { class: "uid-s
|
|
|
20511
20511
|
}, null, 8, ["icon"]),
|
|
20512
20512
|
d1(u("input", {
|
|
20513
20513
|
ref_key: "inputRef",
|
|
20514
|
-
ref:
|
|
20514
|
+
ref: b,
|
|
20515
20515
|
"onUpdate:modelValue": te[0] || (te[0] = (N) => y.value = N),
|
|
20516
20516
|
type: "text",
|
|
20517
20517
|
autofocus: "",
|
|
@@ -20589,10 +20589,10 @@ const Ax = ["data-depth"], zx = ["aria-expanded", "title"], Hx = { class: "uid-s
|
|
|
20589
20589
|
const o = a, l = M(() => o.brand?.name || void 0), d = M(() => o.brand?.logo ?? null), i = M(() => o.brand?.mark ?? null), s = M(() => o.brand?.footer ?? null), r = M(() => o.brand?.copyright ?? null), y = t, m = q(!1), p = M(() => o.collapsed !== void 0), f = M(
|
|
20590
20590
|
() => p.value ? o.collapsed : m.value
|
|
20591
20591
|
);
|
|
20592
|
-
function
|
|
20592
|
+
function b(k) {
|
|
20593
20593
|
p.value || (m.value = k), y("update:collapsed", k);
|
|
20594
20594
|
}
|
|
20595
|
-
function
|
|
20595
|
+
function x() {
|
|
20596
20596
|
y("exit-impersonation");
|
|
20597
20597
|
}
|
|
20598
20598
|
we(
|
|
@@ -20622,13 +20622,13 @@ const Ax = ["data-depth"], zx = ["aria-expanded", "title"], Hx = { class: "uid-s
|
|
|
20622
20622
|
u("button", {
|
|
20623
20623
|
type: "button",
|
|
20624
20624
|
class: "admin-impersonation-banner__exit",
|
|
20625
|
-
onClick:
|
|
20625
|
+
onClick: x
|
|
20626
20626
|
}, " Выйти из режима ")
|
|
20627
20627
|
])) : H("", !0),
|
|
20628
20628
|
I(n(Uw), {
|
|
20629
20629
|
"model-value": f.value,
|
|
20630
20630
|
class: "admin-shell",
|
|
20631
|
-
"onUpdate:modelValue":
|
|
20631
|
+
"onUpdate:modelValue": b
|
|
20632
20632
|
}, {
|
|
20633
20633
|
sidebar: w(() => [
|
|
20634
20634
|
ze(k.$slots, "sidebar", {}, () => [
|
|
@@ -20646,7 +20646,7 @@ const Ax = ["data-depth"], zx = ["aria-expanded", "title"], Hx = { class: "uid-s
|
|
|
20646
20646
|
openSearch: () => g.value = !0
|
|
20647
20647
|
}, () => [
|
|
20648
20648
|
I(Sx, {
|
|
20649
|
-
onToggleSidebar: _[0] || (_[0] = (Z) =>
|
|
20649
|
+
onToggleSidebar: _[0] || (_[0] = (Z) => b(!f.value)),
|
|
20650
20650
|
onOpenSearch: _[1] || (_[1] = (Z) => g.value = !0)
|
|
20651
20651
|
})
|
|
20652
20652
|
])
|
|
@@ -20780,11 +20780,11 @@ const Ax = ["data-depth"], zx = ["aria-expanded", "title"], Hx = { class: "uid-s
|
|
|
20780
20780
|
const _ = (Date.now() - k) / 1e3;
|
|
20781
20781
|
return _ < 60 ? `${Math.max(1, Math.floor(_))} сек назад` : _ < 3600 ? `${Math.floor(_ / 60)} мин назад` : _ < 86400 ? `${Math.floor(_ / 3600)} ч назад` : _ < 86400 * 2 ? "вчера" : _ < 86400 * 7 ? `${Math.floor(_ / 86400)} д назад` : new Date(L).toLocaleDateString("ru-RU");
|
|
20782
20782
|
}
|
|
20783
|
-
function
|
|
20783
|
+
function b(L) {
|
|
20784
20784
|
const k = L.data, _ = typeof k.title == "string" ? k.title : typeof k.subject == "string" ? k.subject : "Уведомление", Z = typeof k.description == "string" ? k.description : typeof k.message == "string" ? k.message : typeof k.text == "string" ? k.text : "";
|
|
20785
20785
|
return { title: _, description: Z };
|
|
20786
20786
|
}
|
|
20787
|
-
const
|
|
20787
|
+
const x = M(() => {
|
|
20788
20788
|
const k = t.meta?.total ?? t.items.length, _ = t.unreadCount, Z = Math.max(0, k - _);
|
|
20789
20789
|
return { all: k, unread: _, read: Z };
|
|
20790
20790
|
});
|
|
@@ -20852,7 +20852,7 @@ const Ax = ["data-depth"], zx = ["aria-expanded", "title"], Hx = { class: "uid-s
|
|
|
20852
20852
|
onClick: (Z) => d(_.key)
|
|
20853
20853
|
}, [
|
|
20854
20854
|
F(v(_.label) + " ", 1),
|
|
20855
|
-
u("span", fb, v(
|
|
20855
|
+
u("span", fb, v(x.value[_.key]), 1)
|
|
20856
20856
|
], 10, vb)), 64))
|
|
20857
20857
|
]),
|
|
20858
20858
|
u("div", gb, [
|
|
@@ -20877,10 +20877,10 @@ const Ax = ["data-depth"], zx = ["aria-expanded", "title"], Hx = { class: "uid-s
|
|
|
20877
20877
|
], 8, bb),
|
|
20878
20878
|
u("div", Lb, [
|
|
20879
20879
|
u("div", Cb, [
|
|
20880
|
-
u("span", _b, v(
|
|
20880
|
+
u("span", _b, v(b(_).title), 1),
|
|
20881
20881
|
u("span", Sb, v(f(_.created_at)), 1)
|
|
20882
20882
|
]),
|
|
20883
|
-
|
|
20883
|
+
b(_).description ? (c(), h("div", qb, v(b(_).description), 1)) : H("", !0)
|
|
20884
20884
|
]),
|
|
20885
20885
|
_.read_at === null ? (c(), h("span", Ab)) : H("", !0),
|
|
20886
20886
|
u("button", {
|
|
@@ -20912,10 +20912,10 @@ const Ax = ["data-depth"], zx = ["aria-expanded", "title"], Hx = { class: "uid-s
|
|
|
20912
20912
|
function f(_) {
|
|
20913
20913
|
return r.value.find((Z) => Z.slug === _) ?? null;
|
|
20914
20914
|
}
|
|
20915
|
-
function
|
|
20915
|
+
function b(_) {
|
|
20916
20916
|
return y.value.find((Z) => Z.slug === _) ?? null;
|
|
20917
20917
|
}
|
|
20918
|
-
function
|
|
20918
|
+
function x() {
|
|
20919
20919
|
a.value = null;
|
|
20920
20920
|
}
|
|
20921
20921
|
function g() {
|
|
@@ -20953,9 +20953,9 @@ const Ax = ["data-depth"], zx = ["aria-expanded", "title"], Hx = { class: "uid-s
|
|
|
20953
20953
|
// actions
|
|
20954
20954
|
getResource: p,
|
|
20955
20955
|
getScreen: f,
|
|
20956
|
-
getSettings:
|
|
20956
|
+
getSettings: b,
|
|
20957
20957
|
load: L,
|
|
20958
|
-
invalidate:
|
|
20958
|
+
invalidate: x,
|
|
20959
20959
|
refresh: g,
|
|
20960
20960
|
reset: k
|
|
20961
20961
|
};
|
|
@@ -21009,7 +21009,7 @@ const Vb = { class: "admin-page-host" }, Pb = {
|
|
|
21009
21009
|
() => t.name === "admin.notFound" && !o.bootResolved
|
|
21010
21010
|
);
|
|
21011
21011
|
return (p, f) => {
|
|
21012
|
-
const
|
|
21012
|
+
const b = q9("router-view");
|
|
21013
21013
|
return c(), h(X, null, [
|
|
21014
21014
|
I(rb),
|
|
21015
21015
|
y.value ? (c(), z(lb, {
|
|
@@ -21020,11 +21020,11 @@ const Vb = { class: "admin-page-host" }, Pb = {
|
|
|
21020
21020
|
}, {
|
|
21021
21021
|
default: w(() => [
|
|
21022
21022
|
u("div", Vb, [
|
|
21023
|
-
I(
|
|
21024
|
-
default: w(({ Component:
|
|
21023
|
+
I(b, null, {
|
|
21024
|
+
default: w(({ Component: x }) => [
|
|
21025
21025
|
I(L9, { name: "admin-page" }, {
|
|
21026
21026
|
default: w(() => [
|
|
21027
|
-
m.value ? (c(), h("div", Pb)) : (c(), z(Re(
|
|
21027
|
+
m.value ? (c(), h("div", Pb)) : (c(), z(Re(x), { key: 0 }))
|
|
21028
21028
|
]),
|
|
21029
21029
|
_: 2
|
|
21030
21030
|
}, 1024)
|
|
@@ -21034,11 +21034,11 @@ const Vb = { class: "admin-page-host" }, Pb = {
|
|
|
21034
21034
|
])
|
|
21035
21035
|
]),
|
|
21036
21036
|
_: 1
|
|
21037
|
-
}, 8, ["impersonation", "brand"])) : (c(), z(
|
|
21038
|
-
default: w(({ Component:
|
|
21037
|
+
}, 8, ["impersonation", "brand"])) : (c(), z(b, { key: 1 }, {
|
|
21038
|
+
default: w(({ Component: x }) => [
|
|
21039
21039
|
I(L9, { name: "admin-page" }, {
|
|
21040
21040
|
default: w(() => [
|
|
21041
|
-
m.value ? (c(), h("div", Fb)) : (c(), z(Re(
|
|
21041
|
+
m.value ? (c(), h("div", Fb)) : (c(), z(Re(x), { key: 0 }))
|
|
21042
21042
|
]),
|
|
21043
21043
|
_: 2
|
|
21044
21044
|
}, 1024)
|
|
@@ -21079,7 +21079,7 @@ const Vb = { class: "admin-page-host" }, Pb = {
|
|
|
21079
21079
|
function f() {
|
|
21080
21080
|
o.value = l.value.map((B) => ({ ...B })), t.value = !1;
|
|
21081
21081
|
}
|
|
21082
|
-
async function
|
|
21082
|
+
async function b() {
|
|
21083
21083
|
if (a.value !== null) {
|
|
21084
21084
|
d.value = !0;
|
|
21085
21085
|
try {
|
|
@@ -21097,7 +21097,7 @@ const Vb = { class: "admin-page-host" }, Pb = {
|
|
|
21097
21097
|
}
|
|
21098
21098
|
}
|
|
21099
21099
|
}
|
|
21100
|
-
async function
|
|
21100
|
+
async function x() {
|
|
21101
21101
|
if (a.value !== null) {
|
|
21102
21102
|
d.value = !0;
|
|
21103
21103
|
try {
|
|
@@ -21158,8 +21158,8 @@ const Vb = { class: "admin-page-host" }, Pb = {
|
|
|
21158
21158
|
enterEditMode: m,
|
|
21159
21159
|
seedDraft: p,
|
|
21160
21160
|
cancelEdit: f,
|
|
21161
|
-
saveLayout:
|
|
21162
|
-
resetToDefault:
|
|
21161
|
+
saveLayout: b,
|
|
21162
|
+
resetToDefault: x,
|
|
21163
21163
|
addWidget: g,
|
|
21164
21164
|
restoreWidget: k,
|
|
21165
21165
|
removeWidget: L,
|
|
@@ -21227,11 +21227,11 @@ const L2 = F9(), Bb = L2.register, Db = L2.get, Rb = L2.has, $b = L2.list, qF =
|
|
|
21227
21227
|
kind: m,
|
|
21228
21228
|
refresh: p,
|
|
21229
21229
|
permission: f,
|
|
21230
|
-
slug:
|
|
21231
|
-
data:
|
|
21230
|
+
slug: b,
|
|
21231
|
+
data: x,
|
|
21232
21232
|
...g
|
|
21233
21233
|
} = t.node;
|
|
21234
|
-
return
|
|
21234
|
+
return x && typeof x == "object" && !Array.isArray(x) ? { ...g, ...x, data: x } : x !== void 0 ? { ...g, data: x } : g;
|
|
21235
21235
|
});
|
|
21236
21236
|
return (d, i) => o.value ? (c(), z(Re(o.value), $o(Nn({ key: 0 }, l.value)), null, 16)) : (c(), z(YI, {
|
|
21237
21237
|
key: 1,
|
|
@@ -21341,7 +21341,7 @@ const L2 = F9(), Bb = L2.register, Db = L2.get, Rb = L2.has, $b = L2.list, qF =
|
|
|
21341
21341
|
}
|
|
21342
21342
|
const i = M(() => $b()), s = q(""), r = q(""), y = q("6"), m = q(`# Новая заметка
|
|
21343
21343
|
|
|
21344
|
-
Текст…`), p = q("LABEL"), f = q("0"),
|
|
21344
|
+
Текст…`), p = q("LABEL"), f = q("0"), b = q("50"), x = q("Янв, Фев, Мар, Апр"), g = q("10, 20, 15, 30"), L = q(""), k = q("5");
|
|
21345
21345
|
we(
|
|
21346
21346
|
() => o.open,
|
|
21347
21347
|
(j) => {
|
|
@@ -21350,9 +21350,9 @@ const L2 = F9(), Bb = L2.register, Db = L2.get, Rb = L2.has, $b = L2.list, qF =
|
|
|
21350
21350
|
const P = o.item.config ?? {};
|
|
21351
21351
|
s.value = o.item.type ?? "", r.value = P.title ?? o.initialTitle, y.value = String(o.item.size ?? 6), m.value = P.content ?? m.value;
|
|
21352
21352
|
const T = P.stats?.[0];
|
|
21353
|
-
T && (p.value = String(T.label ?? ""), f.value = String(T.value ?? "")),
|
|
21353
|
+
T && (p.value = String(T.label ?? ""), f.value = String(T.value ?? "")), b.value = String(P.value ?? 50);
|
|
21354
21354
|
const W = P.labels, te = P.datasets;
|
|
21355
|
-
W && W.length > 0 && (
|
|
21355
|
+
W && W.length > 0 && (x.value = W.join(", ")), te && te[0]?.data && (g.value = te[0].data.join(", ")), L.value = P.resource ?? "", k.value = String(P.limit ?? 5);
|
|
21356
21356
|
} else
|
|
21357
21357
|
s.value = "", r.value = "", y.value = "6";
|
|
21358
21358
|
}
|
|
@@ -21385,10 +21385,10 @@ const L2 = F9(), Bb = L2.register, Db = L2.get, Rb = L2.has, $b = L2.list, qF =
|
|
|
21385
21385
|
j.stats = [{ label: p.value, value: f.value }];
|
|
21386
21386
|
break;
|
|
21387
21387
|
case "gauge":
|
|
21388
|
-
j.value = Number(
|
|
21388
|
+
j.value = Number(b.value) || 0, j.min = 0, j.max = 100;
|
|
21389
21389
|
break;
|
|
21390
21390
|
case "chart": {
|
|
21391
|
-
const P =
|
|
21391
|
+
const P = x.value.split(",").map((W) => W.trim()).filter(Boolean), T = g.value.split(",").map((W) => Number(W.trim())).filter((W) => !Number.isNaN(W));
|
|
21392
21392
|
j.labels = P, j.datasets = [{ label: r.value, data: T }], j.type = s.value === "donut-chart" ? "doughnut" : "bar";
|
|
21393
21393
|
break;
|
|
21394
21394
|
}
|
|
@@ -21525,16 +21525,16 @@ const L2 = F9(), Bb = L2.register, Db = L2.get, Rb = L2.has, $b = L2.list, qF =
|
|
|
21525
21525
|
], 64)) : U(s.value) === "gauge" ? (c(), h("div", bL, [
|
|
21526
21526
|
u("label", LL, v(n(E)("Значение (0..100)")), 1),
|
|
21527
21527
|
I(n(Le), {
|
|
21528
|
-
modelValue:
|
|
21529
|
-
"onUpdate:modelValue": P[5] || (P[5] = (T) =>
|
|
21528
|
+
modelValue: b.value,
|
|
21529
|
+
"onUpdate:modelValue": P[5] || (P[5] = (T) => b.value = T),
|
|
21530
21530
|
type: "number"
|
|
21531
21531
|
}, null, 8, ["modelValue"])
|
|
21532
21532
|
])) : U(s.value) === "chart" ? (c(), h(X, { key: 6 }, [
|
|
21533
21533
|
u("div", CL, [
|
|
21534
21534
|
u("label", _L, v(n(E)("Метки (через запятую)")), 1),
|
|
21535
21535
|
I(n(Le), {
|
|
21536
|
-
modelValue:
|
|
21537
|
-
"onUpdate:modelValue": P[6] || (P[6] = (T) =>
|
|
21536
|
+
modelValue: x.value,
|
|
21537
|
+
"onUpdate:modelValue": P[6] || (P[6] = (T) => x.value = T),
|
|
21538
21538
|
placeholder: n(E)("Янв, Фев, Мар")
|
|
21539
21539
|
}, null, 8, ["modelValue", "placeholder"])
|
|
21540
21540
|
]),
|
|
@@ -21621,13 +21621,13 @@ const L2 = F9(), Bb = L2.register, Db = L2.get, Rb = L2.has, $b = L2.list, qF =
|
|
|
21621
21621
|
}), p = (Y, ie) => s.has(Y) ? s.t(Y) : ie, f = M(() => {
|
|
21622
21622
|
const Y = m.value;
|
|
21623
21623
|
return !Y || !d.manifest ? null : d.manifest.dashboards?.find((le) => le.slug === Y) ?? null;
|
|
21624
|
-
}),
|
|
21624
|
+
}), b = M(() => o.widgets ? o.widgets : A.value !== null ? A.value : f.value?.widgets ?? []), x = M(
|
|
21625
21625
|
() => o.title ?? f.value?.label ?? "Dashboard"
|
|
21626
21626
|
), g = M(
|
|
21627
21627
|
() => o.subtitle ?? f.value?.description ?? null
|
|
21628
21628
|
), L = M(() => {
|
|
21629
21629
|
const Y = /* @__PURE__ */ new Map();
|
|
21630
|
-
for (const re of
|
|
21630
|
+
for (const re of b.value) {
|
|
21631
21631
|
const fe = String(re.slug ?? "");
|
|
21632
21632
|
fe && Y.set(fe, re);
|
|
21633
21633
|
}
|
|
@@ -21657,7 +21657,7 @@ const L2 = F9(), Bb = L2.register, Db = L2.get, Rb = L2.has, $b = L2.list, qF =
|
|
|
21657
21657
|
for (const [re, fe] of Y.entries())
|
|
21658
21658
|
le.push({ node: fe, layoutSlug: re });
|
|
21659
21659
|
} else
|
|
21660
|
-
for (const re of
|
|
21660
|
+
for (const re of b.value)
|
|
21661
21661
|
le.push({ node: re, layoutSlug: String(re.slug ?? "") });
|
|
21662
21662
|
return le;
|
|
21663
21663
|
});
|
|
@@ -21698,7 +21698,7 @@ const L2 = F9(), Bb = L2.register, Db = L2.get, Rb = L2.has, $b = L2.list, qF =
|
|
|
21698
21698
|
let j = null;
|
|
21699
21699
|
const P = M(() => {
|
|
21700
21700
|
let Y = 0;
|
|
21701
|
-
for (const ie of
|
|
21701
|
+
for (const ie of b.value) {
|
|
21702
21702
|
const le = ie.refresh;
|
|
21703
21703
|
typeof le == "number" && le > 0 && (Y === 0 || le < Y) && (Y = le);
|
|
21704
21704
|
}
|
|
@@ -21762,7 +21762,7 @@ const L2 = F9(), Bb = L2.register, Db = L2.get, Rb = L2.has, $b = L2.list, qF =
|
|
|
21762
21762
|
});
|
|
21763
21763
|
}
|
|
21764
21764
|
function me(Y) {
|
|
21765
|
-
const ie =
|
|
21765
|
+
const ie = b.value.some(
|
|
21766
21766
|
(re) => String(re.slug ?? "") === Y
|
|
21767
21767
|
), le = i.draft.some((re) => re.slug === Y);
|
|
21768
21768
|
ie ? le ? i.updateWidget(Y, { hidden: !0 }) : i.addWidget({ slug: Y, hidden: !0 }) : i.removeWidget(Y);
|
|
@@ -21782,7 +21782,7 @@ const L2 = F9(), Bb = L2.register, Db = L2.get, Rb = L2.has, $b = L2.list, qF =
|
|
|
21782
21782
|
}
|
|
21783
21783
|
const pe = M(() => {
|
|
21784
21784
|
const Y = /* @__PURE__ */ new Map();
|
|
21785
|
-
for (const ie of
|
|
21785
|
+
for (const ie of b.value) {
|
|
21786
21786
|
const le = String(ie.slug ?? "");
|
|
21787
21787
|
le && Y.set(le, ie);
|
|
21788
21788
|
}
|
|
@@ -21900,7 +21900,7 @@ const L2 = F9(), Bb = L2.register, Db = L2.get, Rb = L2.has, $b = L2.list, qF =
|
|
|
21900
21900
|
return (Y, ie) => (c(), h("section", FL, [
|
|
21901
21901
|
u("header", jL, [
|
|
21902
21902
|
u("div", BL, [
|
|
21903
|
-
u("h1", DL, v(
|
|
21903
|
+
u("h1", DL, v(x.value), 1),
|
|
21904
21904
|
g.value ? (c(), h("div", RL, v(g.value), 1)) : H("", !0)
|
|
21905
21905
|
]),
|
|
21906
21906
|
u("div", $L, [
|
|
@@ -22132,7 +22132,7 @@ const L2 = F9(), Bb = L2.register, Db = L2.get, Rb = L2.has, $b = L2.list, qF =
|
|
|
22132
22132
|
u("button", {
|
|
22133
22133
|
type: "button",
|
|
22134
22134
|
class: "admin-home__card",
|
|
22135
|
-
onClick: (
|
|
22135
|
+
onClick: (b) => n(l).push({ name: `admin.resource.${f.slug}.index` })
|
|
22136
22136
|
}, [
|
|
22137
22137
|
u("span", JL, v(f.label), 1),
|
|
22138
22138
|
u("span", YL, v(f.slug), 1)
|
|
@@ -22215,7 +22215,7 @@ const L2 = F9(), Bb = L2.register, Db = L2.get, Rb = L2.has, $b = L2.list, qF =
|
|
|
22215
22215
|
]));
|
|
22216
22216
|
}
|
|
22217
22217
|
}), hC = Ge("admin-screen", () => {
|
|
22218
|
-
const a = q(null), t = q(""), o = q(null), l = q([]), d = q([]), i = q([]), s = q(null), r = q({}), y = q({}), m = q({}), p = q(!1), f = q(!1),
|
|
22218
|
+
const a = q(null), t = q(""), o = q(null), l = q([]), d = q([]), i = q([]), s = q(null), r = q({}), y = q({}), m = q({}), p = q(!1), f = q(!1), b = q(null), x = q(null), g = M(() => b.value !== null);
|
|
22219
22219
|
function L(P, T) {
|
|
22220
22220
|
for (const W of Object.keys(P)) delete P[W];
|
|
22221
22221
|
Object.assign(P, T);
|
|
@@ -22232,17 +22232,17 @@ const L2 = F9(), Bb = L2.register, Db = L2.get, Rb = L2.has, $b = L2.list, qF =
|
|
|
22232
22232
|
)), P.props && typeof P.props == "object" && Object.assign(T, P.props), T;
|
|
22233
22233
|
}
|
|
22234
22234
|
function Z() {
|
|
22235
|
-
a.value = null, t.value = "", o.value = null, l.value = [], d.value = [], i.value = [], s.value = null, L(r.value, {}), L(y.value, {}), m.value = {}, p.value = !1, f.value = !1,
|
|
22235
|
+
a.value = null, t.value = "", o.value = null, l.value = [], d.value = [], i.value = [], s.value = null, L(r.value, {}), L(y.value, {}), m.value = {}, p.value = !1, f.value = !1, b.value = null, x.value = null;
|
|
22236
22236
|
}
|
|
22237
22237
|
async function U(P, T) {
|
|
22238
|
-
a.value = P, p.value = !0,
|
|
22238
|
+
a.value !== P && (x.value = null), a.value = P, p.value = !0, b.value = null, m.value = {};
|
|
22239
22239
|
try {
|
|
22240
22240
|
const te = await Me().get(`/${P}/state`, {
|
|
22241
22241
|
params: T
|
|
22242
22242
|
});
|
|
22243
22243
|
t.value = te.name, o.value = te.description, l.value = k(te.layout), d.value = te.command_bar, i.value = te.permissions, s.value = te.etag, L(r.value, te.state), L(y.value, te.state);
|
|
22244
22244
|
} catch (W) {
|
|
22245
|
-
throw
|
|
22245
|
+
throw b.value = W instanceof Error ? W : new Error(String(W)), W;
|
|
22246
22246
|
} finally {
|
|
22247
22247
|
p.value = !1;
|
|
22248
22248
|
}
|
|
@@ -22252,16 +22252,16 @@ const L2 = F9(), Bb = L2.register, Db = L2.get, Rb = L2.has, $b = L2.list, qF =
|
|
|
22252
22252
|
throw new Error("useScreenStore.runMethod() before slug set");
|
|
22253
22253
|
if (f.value)
|
|
22254
22254
|
throw new Error("Already running a method");
|
|
22255
|
-
f.value = !0,
|
|
22255
|
+
f.value = !0, b.value = null, m.value = {}, x.value = null;
|
|
22256
22256
|
try {
|
|
22257
22257
|
const W = Me(), te = T ?? r.value, N = await W.post(`/${a.value}/runMethod`, {
|
|
22258
22258
|
method: P,
|
|
22259
22259
|
payload: te
|
|
22260
22260
|
});
|
|
22261
|
-
return N.state && Object.keys(N.state).length > 0 && (L(r.value, N.state), L(y.value, { ...N.state })), N.message && (
|
|
22261
|
+
return N.state && Object.keys(N.state).length > 0 && (L(r.value, N.state), L(y.value, { ...N.state })), N.message && (x.value = N.message), N.refresh && await U(a.value).catch(() => {
|
|
22262
22262
|
}), N;
|
|
22263
22263
|
} catch (W) {
|
|
22264
|
-
throw W instanceof Eo ? m.value = { ...W.fields } : (W instanceof We || W instanceof Error) && (
|
|
22264
|
+
throw W instanceof Eo ? m.value = { ...W.fields } : (W instanceof We || W instanceof Error) && (b.value = W), W;
|
|
22265
22265
|
} finally {
|
|
22266
22266
|
f.value = !1;
|
|
22267
22267
|
}
|
|
@@ -22292,8 +22292,8 @@ const L2 = F9(), Bb = L2.register, Db = L2.get, Rb = L2.has, $b = L2.list, qF =
|
|
|
22292
22292
|
errors: m,
|
|
22293
22293
|
loading: p,
|
|
22294
22294
|
running: f,
|
|
22295
|
-
error:
|
|
22296
|
-
lastMessage:
|
|
22295
|
+
error: b,
|
|
22296
|
+
lastMessage: x,
|
|
22297
22297
|
// getters
|
|
22298
22298
|
hasError: g,
|
|
22299
22299
|
// actions
|
|
@@ -22460,16 +22460,16 @@ const tw = /* @__PURE__ */ ne({
|
|
|
22460
22460
|
n(l).description ? (c(), h("p", MC, v(n(l).description), 1)) : H("", !0)
|
|
22461
22461
|
]),
|
|
22462
22462
|
n(l).commandBar.length > 0 ? (c(), h("div", IC, [
|
|
22463
|
-
(c(!0), h(X, null, ae(n(l).commandBar, (
|
|
22464
|
-
key:
|
|
22465
|
-
variant: m(
|
|
22466
|
-
icon:
|
|
22463
|
+
(c(!0), h(X, null, ae(n(l).commandBar, (b) => (c(), z(n(oe), {
|
|
22464
|
+
key: b.name,
|
|
22465
|
+
variant: m(b),
|
|
22466
|
+
icon: b.icon ?? void 0,
|
|
22467
22467
|
loading: n(l).running,
|
|
22468
22468
|
disabled: n(l).running || n(l).loading,
|
|
22469
|
-
onClick: (
|
|
22469
|
+
onClick: (x) => y(b)
|
|
22470
22470
|
}, {
|
|
22471
22471
|
default: w(() => [
|
|
22472
|
-
F(v(
|
|
22472
|
+
F(v(b.label), 1)
|
|
22473
22473
|
]),
|
|
22474
22474
|
_: 2
|
|
22475
22475
|
}, 1032, ["variant", "icon", "loading", "disabled", "onClick"]))), 128))
|
|
@@ -22497,8 +22497,8 @@ const tw = /* @__PURE__ */ ne({
|
|
|
22497
22497
|
_: 1
|
|
22498
22498
|
})) : H("", !0),
|
|
22499
22499
|
n(l).loading ? (c(), h("div", wC, [
|
|
22500
|
-
(c(), h(X, null, ae(4, (
|
|
22501
|
-
key:
|
|
22500
|
+
(c(), h(X, null, ae(4, (b) => I(n(e2), {
|
|
22501
|
+
key: b,
|
|
22502
22502
|
height: "40px"
|
|
22503
22503
|
})), 64))
|
|
22504
22504
|
])) : r.value ? (c(), z(n(Ie), {
|
|
@@ -22507,9 +22507,9 @@ const tw = /* @__PURE__ */ ne({
|
|
|
22507
22507
|
class: "admin-screen-page__body"
|
|
22508
22508
|
}, {
|
|
22509
22509
|
default: w(() => [
|
|
22510
|
-
(c(!0), h(X, null, ae(s.value, (
|
|
22511
|
-
key:
|
|
22512
|
-
node:
|
|
22510
|
+
(c(!0), h(X, null, ae(s.value, (b, x) => (c(), z(I2, {
|
|
22511
|
+
key: x,
|
|
22512
|
+
node: b
|
|
22513
22513
|
}, null, 8, ["node"]))), 128))
|
|
22514
22514
|
]),
|
|
22515
22515
|
_: 1
|
|
@@ -22529,27 +22529,27 @@ const tw = /* @__PURE__ */ ne({
|
|
|
22529
22529
|
emits: ["success"],
|
|
22530
22530
|
setup(a, { emit: t }) {
|
|
22531
22531
|
const o = t, l = e1(), d = q(""), i = q(""), s = q(!1), r = q(!1), y = q(null), m = q({}), p = M(() => m.value.email?.[0]), f = M(() => m.value.password?.[0]);
|
|
22532
|
-
async function
|
|
22532
|
+
async function b() {
|
|
22533
22533
|
if (!r.value) {
|
|
22534
22534
|
r.value = !0, y.value = null, m.value = {};
|
|
22535
22535
|
try {
|
|
22536
|
-
const
|
|
22536
|
+
const x = await l.login({
|
|
22537
22537
|
email: d.value,
|
|
22538
22538
|
password: i.value,
|
|
22539
22539
|
remember: s.value
|
|
22540
22540
|
});
|
|
22541
|
-
o("success",
|
|
22542
|
-
} catch (
|
|
22543
|
-
(
|
|
22541
|
+
o("success", x);
|
|
22542
|
+
} catch (x) {
|
|
22543
|
+
(x instanceof We ? x.status : x?.response?.status) === 429 ? y.value = "Слишком много попыток входа. Подождите минуту и попробуйте снова" : x instanceof Eo ? (m.value = x.fields, y.value = x.firstFieldMessage()) : x instanceof H9 ? y.value = "Нет соединения с сервером" : x instanceof We ? y.value = x.message || "Не удалось войти" : y.value = x.message;
|
|
22544
22544
|
} finally {
|
|
22545
22545
|
r.value = !1;
|
|
22546
22546
|
}
|
|
22547
22547
|
}
|
|
22548
22548
|
}
|
|
22549
|
-
return (
|
|
22549
|
+
return (x, g) => (c(), h("form", {
|
|
22550
22550
|
class: "admin-auth-card__bd",
|
|
22551
22551
|
novalidate: "",
|
|
22552
|
-
onSubmit: ke(
|
|
22552
|
+
onSubmit: ke(b, ["prevent"])
|
|
22553
22553
|
}, [
|
|
22554
22554
|
y.value ? (c(), z(n(Qe), {
|
|
22555
22555
|
key: 0,
|
|
@@ -22626,8 +22626,8 @@ const tw = /* @__PURE__ */ ne({
|
|
|
22626
22626
|
__name: "TwoFactorForm",
|
|
22627
22627
|
emits: ["success", "cancel"],
|
|
22628
22628
|
setup(a, { emit: t }) {
|
|
22629
|
-
const o = t, l = e1(), d = q("totp"), i = q(["", "", "", "", "", ""]), s = q(""), r = q([]), y = q(!1), m = q(null), p = q(null), f = M(() => i.value.join("")),
|
|
22630
|
-
function
|
|
22629
|
+
const o = t, l = e1(), d = q("totp"), i = q(["", "", "", "", "", ""]), s = q(""), r = q([]), y = q(!1), m = q(null), p = q(null), f = M(() => i.value.join("")), b = M(() => d.value === "totp" ? f.value.length === 6 : s.value.trim().length > 0);
|
|
22630
|
+
function x(A, D) {
|
|
22631
22631
|
D instanceof HTMLInputElement && (r.value[A] = D);
|
|
22632
22632
|
}
|
|
22633
22633
|
function g(A, D) {
|
|
@@ -22649,7 +22649,7 @@ const tw = /* @__PURE__ */ ne({
|
|
|
22649
22649
|
}
|
|
22650
22650
|
}
|
|
22651
22651
|
async function _() {
|
|
22652
|
-
if (!(y.value || !
|
|
22652
|
+
if (!(y.value || !b.value)) {
|
|
22653
22653
|
y.value = !0, m.value = null;
|
|
22654
22654
|
try {
|
|
22655
22655
|
if (d.value === "totp")
|
|
@@ -22707,7 +22707,7 @@ const tw = /* @__PURE__ */ ne({
|
|
|
22707
22707
|
(c(!0), h(X, null, ae(i.value, (B, j) => (c(), h("input", {
|
|
22708
22708
|
key: j,
|
|
22709
22709
|
ref_for: !0,
|
|
22710
|
-
ref: (P) =>
|
|
22710
|
+
ref: (P) => x(j, P),
|
|
22711
22711
|
value: i.value[j],
|
|
22712
22712
|
type: "text",
|
|
22713
22713
|
inputmode: "numeric",
|
|
@@ -22733,7 +22733,7 @@ const tw = /* @__PURE__ */ ne({
|
|
|
22733
22733
|
variant: "primary",
|
|
22734
22734
|
size: "lg",
|
|
22735
22735
|
loading: y.value,
|
|
22736
|
-
disabled: y.value || !
|
|
22736
|
+
disabled: y.value || !b.value
|
|
22737
22737
|
}, {
|
|
22738
22738
|
default: w(() => [
|
|
22739
22739
|
F(v(y.value ? "Проверка…" : "Подтвердить"), 1)
|
|
@@ -22964,8 +22964,8 @@ const tw = /* @__PURE__ */ ne({
|
|
|
22964
22964
|
}
|
|
22965
22965
|
m.value = !0;
|
|
22966
22966
|
try {
|
|
22967
|
-
const { getAdminClient:
|
|
22968
|
-
await
|
|
22967
|
+
const { getAdminClient: b } = await Promise.resolve().then(() => qe);
|
|
22968
|
+
await b().post("/auth/resetPassword", {
|
|
22969
22969
|
token: i.value,
|
|
22970
22970
|
email: s.value,
|
|
22971
22971
|
password: r.value,
|
|
@@ -22977,7 +22977,7 @@ const tw = /* @__PURE__ */ ne({
|
|
|
22977
22977
|
m.value = !1;
|
|
22978
22978
|
}
|
|
22979
22979
|
}
|
|
22980
|
-
return (
|
|
22980
|
+
return (b, x) => (c(), h("div", KC, [
|
|
22981
22981
|
I(n(Ie), {
|
|
22982
22982
|
padding: "none",
|
|
22983
22983
|
class: "admin-auth-card"
|
|
@@ -23003,14 +23003,14 @@ const tw = /* @__PURE__ */ ne({
|
|
|
23003
23003
|
}, [
|
|
23004
23004
|
I(n(Le), {
|
|
23005
23005
|
modelValue: s.value,
|
|
23006
|
-
"onUpdate:modelValue":
|
|
23006
|
+
"onUpdate:modelValue": x[0] || (x[0] = (g) => s.value = g),
|
|
23007
23007
|
type: "email",
|
|
23008
23008
|
placeholder: "email",
|
|
23009
23009
|
required: ""
|
|
23010
23010
|
}, null, 8, ["modelValue"]),
|
|
23011
23011
|
I(n(Le), {
|
|
23012
23012
|
modelValue: r.value,
|
|
23013
|
-
"onUpdate:modelValue":
|
|
23013
|
+
"onUpdate:modelValue": x[1] || (x[1] = (g) => r.value = g),
|
|
23014
23014
|
type: "password",
|
|
23015
23015
|
placeholder: n(E)("Новый пароль (мин. 8)"),
|
|
23016
23016
|
autocomplete: "new-password",
|
|
@@ -23018,7 +23018,7 @@ const tw = /* @__PURE__ */ ne({
|
|
|
23018
23018
|
}, null, 8, ["modelValue", "placeholder"]),
|
|
23019
23019
|
I(n(Le), {
|
|
23020
23020
|
modelValue: y.value,
|
|
23021
|
-
"onUpdate:modelValue":
|
|
23021
|
+
"onUpdate:modelValue": x[2] || (x[2] = (g) => y.value = g),
|
|
23022
23022
|
type: "password",
|
|
23023
23023
|
placeholder: n(E)("Повторите пароль"),
|
|
23024
23024
|
autocomplete: "new-password",
|
|
@@ -23038,7 +23038,7 @@ const tw = /* @__PURE__ */ ne({
|
|
|
23038
23038
|
}, null, 8, ["icon"])
|
|
23039
23039
|
]),
|
|
23040
23040
|
default: w(() => [
|
|
23041
|
-
|
|
23041
|
+
x[3] || (x[3] = F(" Сохранить пароль ", -1))
|
|
23042
23042
|
]),
|
|
23043
23043
|
_: 1
|
|
23044
23044
|
}, 8, ["loading"])
|
|
@@ -23052,7 +23052,7 @@ const tw = /* @__PURE__ */ ne({
|
|
|
23052
23052
|
}), LI = { page: 1, per_page: 20, total: 0, last_page: 1 }, nw = Ge("admin-resource-index", () => {
|
|
23053
23053
|
const a = q(null), t = q([]), o = q({ ...LI }), l = q(!1), d = q(!1), i = q(null);
|
|
23054
23054
|
let s = null;
|
|
23055
|
-
const r = 200, y = q(""), m = q({}), p = q(null), f = q(null),
|
|
23055
|
+
const r = 200, y = q(""), m = q({}), p = q(null), f = q(null), b = q(/* @__PURE__ */ new Set()), x = M(() => !l.value && i.value === null && t.value.length === 0), g = M(() => b.value.size), L = M(() => b.value.size > 0), k = M(() => i.value !== null), _ = M(() => b.value.size === 0 || t.value.length === 0 ? "none" : t.value.every((O) => b.value.has(Z(O))) ? "all" : "mixed");
|
|
23056
23056
|
function Z(S) {
|
|
23057
23057
|
return S.id ?? S.key ?? "";
|
|
23058
23058
|
}
|
|
@@ -23060,7 +23060,7 @@ const tw = /* @__PURE__ */ ne({
|
|
|
23060
23060
|
a.value !== S && (a.value = S, A(), l.value = !0);
|
|
23061
23061
|
}
|
|
23062
23062
|
function A() {
|
|
23063
|
-
t.value = [], o.value = { ...LI }, l.value = !1, i.value = null, y.value = "", m.value = {}, p.value = null, f.value = null,
|
|
23063
|
+
t.value = [], o.value = { ...LI }, l.value = !1, i.value = null, y.value = "", m.value = {}, p.value = null, f.value = null, b.value = /* @__PURE__ */ new Set();
|
|
23064
23064
|
}
|
|
23065
23065
|
function D(S = {}) {
|
|
23066
23066
|
const O = {
|
|
@@ -23109,23 +23109,23 @@ const tw = /* @__PURE__ */ ne({
|
|
|
23109
23109
|
o.value.page = S, await B();
|
|
23110
23110
|
}
|
|
23111
23111
|
function J(S) {
|
|
23112
|
-
const O = new Set(
|
|
23113
|
-
O.has(S) ? O.delete(S) : O.add(S),
|
|
23112
|
+
const O = new Set(b.value);
|
|
23113
|
+
O.has(S) ? O.delete(S) : O.add(S), b.value = O;
|
|
23114
23114
|
}
|
|
23115
23115
|
function R() {
|
|
23116
23116
|
if (_.value === "all") {
|
|
23117
|
-
|
|
23117
|
+
b.value = /* @__PURE__ */ new Set();
|
|
23118
23118
|
return;
|
|
23119
23119
|
}
|
|
23120
|
-
const S = new Set(
|
|
23120
|
+
const S = new Set(b.value);
|
|
23121
23121
|
for (const O of t.value) S.add(Z(O));
|
|
23122
|
-
|
|
23122
|
+
b.value = S;
|
|
23123
23123
|
}
|
|
23124
23124
|
function C() {
|
|
23125
|
-
|
|
23125
|
+
b.value = /* @__PURE__ */ new Set();
|
|
23126
23126
|
}
|
|
23127
23127
|
function V(S) {
|
|
23128
|
-
return
|
|
23128
|
+
return b.value.has(S);
|
|
23129
23129
|
}
|
|
23130
23130
|
return {
|
|
23131
23131
|
// state
|
|
@@ -23139,9 +23139,9 @@ const tw = /* @__PURE__ */ ne({
|
|
|
23139
23139
|
filters: m,
|
|
23140
23140
|
sortKey: p,
|
|
23141
23141
|
sortDirection: f,
|
|
23142
|
-
selection:
|
|
23142
|
+
selection: b,
|
|
23143
23143
|
// getters
|
|
23144
|
-
isEmpty:
|
|
23144
|
+
isEmpty: x,
|
|
23145
23145
|
hasError: k,
|
|
23146
23146
|
hasSelection: L,
|
|
23147
23147
|
selectedCount: g,
|
|
@@ -23402,11 +23402,11 @@ const SI = ne({
|
|
|
23402
23402
|
(C, V) => !m.value.has(C.name) && V >= qI
|
|
23403
23403
|
)
|
|
23404
23404
|
);
|
|
23405
|
-
function
|
|
23405
|
+
function b(C) {
|
|
23406
23406
|
const V = new Set(m.value);
|
|
23407
23407
|
V.add(C), m.value = V;
|
|
23408
23408
|
}
|
|
23409
|
-
const
|
|
23409
|
+
const x = M(
|
|
23410
23410
|
() => o.search !== "" || r.value.length > 0
|
|
23411
23411
|
);
|
|
23412
23412
|
function g(C) {
|
|
@@ -23635,7 +23635,7 @@ const SI = ne({
|
|
|
23635
23635
|
type: "button",
|
|
23636
23636
|
role: "menuitem",
|
|
23637
23637
|
class: "admin-toolbar__list-item",
|
|
23638
|
-
onClick: (O) =>
|
|
23638
|
+
onClick: (O) => b(S.name)
|
|
23639
23639
|
}, [
|
|
23640
23640
|
R(S.icon) !== null ? (c(), z(n(ee), {
|
|
23641
23641
|
key: 0,
|
|
@@ -23649,7 +23649,7 @@ const SI = ne({
|
|
|
23649
23649
|
_: 1
|
|
23650
23650
|
})) : H("", !0),
|
|
23651
23651
|
V[19] || (V[19] = u("span", { class: "admin-toolbar__spacer" }, null, -1)),
|
|
23652
|
-
|
|
23652
|
+
x.value ? (c(), z(n(oe), {
|
|
23653
23653
|
key: 2,
|
|
23654
23654
|
variant: "ghost",
|
|
23655
23655
|
size: "md",
|
|
@@ -23836,10 +23836,10 @@ const SI = ne({
|
|
|
23836
23836
|
}
|
|
23837
23837
|
}
|
|
23838
23838
|
}
|
|
23839
|
-
function
|
|
23839
|
+
function b(L) {
|
|
23840
23840
|
L.key === "Enter" && o.inputType !== "textarea" ? (L.preventDefault(), f()) : L.key === "Escape" && (L.preventDefault(), p());
|
|
23841
23841
|
}
|
|
23842
|
-
function
|
|
23842
|
+
function x() {
|
|
23843
23843
|
!y.value || s.value || (i.value = o.value === !0 || o.value === 1 || o.value === "1" ? "false" : "true", d.value = !0, f());
|
|
23844
23844
|
}
|
|
23845
23845
|
const g = M(
|
|
@@ -23848,7 +23848,7 @@ const SI = ne({
|
|
|
23848
23848
|
return (L, k) => a.inputType === "switcher" ? (c(), h("span", {
|
|
23849
23849
|
key: 0,
|
|
23850
23850
|
class: ve(["admin-inline-edit", { "admin-inline-edit--editable": y.value }]),
|
|
23851
|
-
onClick: ke(
|
|
23851
|
+
onClick: ke(x, ["stop"])
|
|
23852
23852
|
}, [
|
|
23853
23853
|
ze(L.$slots, "default", {}, () => [
|
|
23854
23854
|
F(v(a.value), 1)
|
|
@@ -23862,7 +23862,7 @@ const SI = ne({
|
|
|
23862
23862
|
type: "number",
|
|
23863
23863
|
class: "admin-inline-edit__input",
|
|
23864
23864
|
disabled: s.value,
|
|
23865
|
-
onKeydown:
|
|
23865
|
+
onKeydown: b,
|
|
23866
23866
|
onBlur: f,
|
|
23867
23867
|
onClick: k[1] || (k[1] = ke(() => {
|
|
23868
23868
|
}, ["stop"]))
|
|
@@ -23876,7 +23876,7 @@ const SI = ne({
|
|
|
23876
23876
|
type: "date",
|
|
23877
23877
|
class: "admin-inline-edit__input",
|
|
23878
23878
|
disabled: s.value,
|
|
23879
|
-
onKeydown:
|
|
23879
|
+
onKeydown: b,
|
|
23880
23880
|
onBlur: f,
|
|
23881
23881
|
onClick: k[3] || (k[3] = ke(() => {
|
|
23882
23882
|
}, ["stop"]))
|
|
@@ -23889,7 +23889,7 @@ const SI = ne({
|
|
|
23889
23889
|
"onUpdate:modelValue": k[4] || (k[4] = (_) => i.value = _),
|
|
23890
23890
|
class: "admin-inline-edit__input",
|
|
23891
23891
|
disabled: s.value,
|
|
23892
|
-
onKeydown:
|
|
23892
|
+
onKeydown: b,
|
|
23893
23893
|
onChange: f,
|
|
23894
23894
|
onBlur: f,
|
|
23895
23895
|
onClick: k[5] || (k[5] = ke(() => {
|
|
@@ -23909,7 +23909,7 @@ const SI = ne({
|
|
|
23909
23909
|
class: "admin-inline-edit__input admin-inline-edit__input--textarea",
|
|
23910
23910
|
rows: "3",
|
|
23911
23911
|
disabled: s.value,
|
|
23912
|
-
onKeydown:
|
|
23912
|
+
onKeydown: b,
|
|
23913
23913
|
onBlur: f,
|
|
23914
23914
|
onClick: k[7] || (k[7] = ke(() => {
|
|
23915
23915
|
}, ["stop"]))
|
|
@@ -23923,7 +23923,7 @@ const SI = ne({
|
|
|
23923
23923
|
type: "text",
|
|
23924
23924
|
class: "admin-inline-edit__input",
|
|
23925
23925
|
disabled: s.value,
|
|
23926
|
-
onKeydown:
|
|
23926
|
+
onKeydown: b,
|
|
23927
23927
|
onBlur: f,
|
|
23928
23928
|
onClick: k[9] || (k[9] = ke(() => {
|
|
23929
23929
|
}, ["stop"]))
|
|
@@ -23955,7 +23955,7 @@ const SI = ne({
|
|
|
23955
23955
|
subtitle: { default: null }
|
|
23956
23956
|
},
|
|
23957
23957
|
setup(a) {
|
|
23958
|
-
const t = a, o = Oe(), l = Ue(), d = M(() => l.getResource(t.slug)), i = q([]), s = q(0), r = q(!1), y = q(null), m = q(""), p = q([]), f = q([]),
|
|
23958
|
+
const t = a, o = Oe(), l = Ue(), d = M(() => l.getResource(t.slug)), i = q([]), s = q(0), r = q(!1), y = q(null), m = q(""), p = q([]), f = q([]), b = M(() => t.title ?? d.value?.label ?? t.slug), x = M(() => t.subtitle ?? null), g = M(() => !!d.value?.permissions?.create), L = M(() => d.value?.label ?? t.slug);
|
|
23959
23959
|
async function k() {
|
|
23960
23960
|
r.value = !0, y.value = null;
|
|
23961
23961
|
try {
|
|
@@ -24054,10 +24054,10 @@ const SI = ne({
|
|
|
24054
24054
|
u("header", W_, [
|
|
24055
24055
|
u("div", null, [
|
|
24056
24056
|
u("h1", G_, [
|
|
24057
|
-
F(v(
|
|
24057
|
+
F(v(b.value) + " ", 1),
|
|
24058
24058
|
s.value > 0 ? (c(), h("span", N_, v(s.value), 1)) : H("", !0)
|
|
24059
24059
|
]),
|
|
24060
|
-
|
|
24060
|
+
x.value ? (c(), h("p", X_, v(x.value), 1)) : H("", !0)
|
|
24061
24061
|
]),
|
|
24062
24062
|
u("div", K_, [
|
|
24063
24063
|
g.value ? (c(), z(n(oe), {
|
|
@@ -24234,9 +24234,9 @@ const SI = ne({
|
|
|
24234
24234
|
},
|
|
24235
24235
|
emits: ["bulk-action", "row-click", "import", "header-action"],
|
|
24236
24236
|
setup(a, { emit: t }) {
|
|
24237
|
-
const o = b2(), l = ($) => o.tr($), d = ($, G, K) => o.has($) ? o.t($, K) : G, i = a, s = t, r = nw(), y = Ue(), m = yI(), p = Oe(), f = M(() => y.getResource(i.slug)),
|
|
24237
|
+
const o = b2(), l = ($) => o.tr($), d = ($, G, K) => o.has($) ? o.t($, K) : G, i = a, s = t, r = nw(), y = Ue(), m = yI(), p = Oe(), f = M(() => y.getResource(i.slug)), b = M(
|
|
24238
24238
|
() => i.title ?? f.value?.label ?? i.slug
|
|
24239
|
-
),
|
|
24239
|
+
), x = M(() => {
|
|
24240
24240
|
if (i.createRouteName !== null)
|
|
24241
24241
|
return p.hasRoute(i.createRouteName) ? i.createRouteName : null;
|
|
24242
24242
|
const $ = `admin.resource.${i.slug}.create`;
|
|
@@ -24721,7 +24721,7 @@ const SI = ne({
|
|
|
24721
24721
|
u("header", nS, [
|
|
24722
24722
|
u("div", oS, [
|
|
24723
24723
|
u("div", cS, [
|
|
24724
|
-
u("h1", iS, v(
|
|
24724
|
+
u("h1", iS, v(b.value), 1),
|
|
24725
24725
|
Ee.value ? (c(), h("span", lS, [
|
|
24726
24726
|
G[3] || (G[3] = u("span", {
|
|
24727
24727
|
class: "admin-page__live-dot",
|
|
@@ -24876,12 +24876,12 @@ const SI = ne({
|
|
|
24876
24876
|
accept: ".csv,.json,.xlsx,.xls,application/json,text/csv",
|
|
24877
24877
|
onChange: j
|
|
24878
24878
|
}, null, 544),
|
|
24879
|
-
|
|
24879
|
+
x.value && W.value ? (c(), z(n(oe), {
|
|
24880
24880
|
key: 1,
|
|
24881
24881
|
"data-testid": "resource-create",
|
|
24882
24882
|
variant: "primary",
|
|
24883
24883
|
size: "md",
|
|
24884
|
-
onClick: G[0] || (G[0] = (K) => $.$router.push({ name:
|
|
24884
|
+
onClick: G[0] || (G[0] = (K) => $.$router.push({ name: x.value }))
|
|
24885
24885
|
}, {
|
|
24886
24886
|
prepend: w(() => [
|
|
24887
24887
|
I(n(ee), {
|
|
@@ -25172,7 +25172,7 @@ const SI = ne({
|
|
|
25172
25172
|
]));
|
|
25173
25173
|
}
|
|
25174
25174
|
}), mI = Ge("admin-resource-form", () => {
|
|
25175
|
-
const a = q(null), t = q("create"), o = q(null), l = q({}), d = q({}), i = q({}), s = q(!1), r = q(!1), y = q(!1), m = q(null), p = M(() => t.value === "create"), f = M(() => t.value === "edit"),
|
|
25175
|
+
const a = q(null), t = q("create"), o = q(null), l = q({}), d = q({}), i = q({}), s = q(!1), r = q(!1), y = q(!1), m = q(null), p = M(() => t.value === "create"), f = M(() => t.value === "edit"), b = M(() => t.value === "view"), x = M(() => m.value !== null), g = M(() => {
|
|
25176
25176
|
const T = l.value, W = d.value, te = /* @__PURE__ */ new Set([...Object.keys(T), ...Object.keys(W)]);
|
|
25177
25177
|
for (const N of te)
|
|
25178
25178
|
if (!Object.is(T[N], W[N]))
|
|
@@ -25266,9 +25266,9 @@ const SI = ne({
|
|
|
25266
25266
|
// getters
|
|
25267
25267
|
isCreate: p,
|
|
25268
25268
|
isEdit: f,
|
|
25269
|
-
isView:
|
|
25269
|
+
isView: b,
|
|
25270
25270
|
isDirty: g,
|
|
25271
|
-
hasError:
|
|
25271
|
+
hasError: x,
|
|
25272
25272
|
// actions
|
|
25273
25273
|
reset: k,
|
|
25274
25274
|
prepareCreate: _,
|
|
@@ -25372,11 +25372,11 @@ const SI = ne({
|
|
|
25372
25372
|
Array.isArray(j.items) && f(j.items, D), !(j.kind !== "field" || typeof j.name != "string") && (j.defaultValue === null || j.defaultValue === void 0 || (D[j.name] = j.defaultValue));
|
|
25373
25373
|
}
|
|
25374
25374
|
}
|
|
25375
|
-
function
|
|
25375
|
+
function b() {
|
|
25376
25376
|
const A = {};
|
|
25377
25377
|
f(p.value, A), Object.keys(A).length > 0 && o.seedDefaults(A);
|
|
25378
25378
|
}
|
|
25379
|
-
const
|
|
25379
|
+
const x = M(() => o.isCreate ? `${E("Создать")}: ${y.value?.label ?? t.slug}` : `${y.value?.label ?? t.slug}: запись #${t.id}`), g = M(() => {
|
|
25380
25380
|
const A = o.state.status;
|
|
25381
25381
|
return typeof A == "string" ? A : null;
|
|
25382
25382
|
}), L = M(() => {
|
|
@@ -25395,12 +25395,12 @@ const SI = ne({
|
|
|
25395
25395
|
Ye(async () => {
|
|
25396
25396
|
l.manifest === null && await l.load().catch(() => {
|
|
25397
25397
|
}), t.id !== null && t.id !== void 0 ? await o.load(t.slug, t.id, "edit").catch(() => {
|
|
25398
|
-
}) : (o.prepareCreate(t.slug, s()),
|
|
25398
|
+
}) : (o.prepareCreate(t.slug, s()), b());
|
|
25399
25399
|
}), we(
|
|
25400
25400
|
() => [t.slug, t.id],
|
|
25401
25401
|
async ([A, D]) => {
|
|
25402
25402
|
D != null ? await o.load(A, D, "edit").catch(() => {
|
|
25403
|
-
}) : (o.prepareCreate(A, s()),
|
|
25403
|
+
}) : (o.prepareCreate(A, s()), b());
|
|
25404
25404
|
}
|
|
25405
25405
|
);
|
|
25406
25406
|
async function k() {
|
|
@@ -25435,7 +25435,7 @@ const SI = ne({
|
|
|
25435
25435
|
class: "admin-resource-form__back",
|
|
25436
25436
|
onClick: U
|
|
25437
25437
|
}, v(n(E)("← Назад")), 1),
|
|
25438
|
-
u("h1", VS, v(
|
|
25438
|
+
u("h1", VS, v(x.value), 1),
|
|
25439
25439
|
g.value ? (c(), z(n(sI), {
|
|
25440
25440
|
key: 0,
|
|
25441
25441
|
variant: L.value
|
|
@@ -25624,7 +25624,7 @@ const SI = ne({
|
|
|
25624
25624
|
const p = Q9(t.node.type);
|
|
25625
25625
|
return p ? { kind: "entry", component: p } : { kind: "unknown" };
|
|
25626
25626
|
}), d = M(() => {
|
|
25627
|
-
const { type: p, kind: f, items:
|
|
25627
|
+
const { type: p, kind: f, items: b, attributes: x, ...g } = t.node, L = x ?? {}, { preset: k, format: _, currency: Z, decimals: U, ...A } = L, D = {};
|
|
25628
25628
|
return _ !== void 0 && (D.format = _), Z !== void 0 && (D.currency = Z), U !== void 0 && (D.decimals = U), { ...g, ...A, preset: k, meta: D };
|
|
25629
25629
|
}), i = M(
|
|
25630
25630
|
() => t.node.items ?? []
|
|
@@ -25635,24 +25635,24 @@ const SI = ne({
|
|
|
25635
25635
|
return typeof p == "number" ? p : 0;
|
|
25636
25636
|
}), m = M(() => t.node.items ?? []);
|
|
25637
25637
|
return (p, f) => {
|
|
25638
|
-
const
|
|
25638
|
+
const b = q9("InfolistRenderer", !0);
|
|
25639
25639
|
return l.value.kind === "entry" && a.node.label ? (c(), h("div", TS, [
|
|
25640
25640
|
u("span", US, v(a.node.label), 1),
|
|
25641
25641
|
(c(), z(Re(l.value.component), $o(Hw(d.value)), null, 16))
|
|
25642
25642
|
])) : l.value.kind === "entry" ? (c(), z(Re(l.value.component), $o(Nn({ key: 1 }, d.value)), null, 16)) : l.value.kind === "layout" && l.value.layoutType === "rows" ? (c(), h("div", OS, [
|
|
25643
|
-
(c(!0), h(X, null, ae(i.value, (
|
|
25643
|
+
(c(!0), h(X, null, ae(i.value, (x, g) => (c(), z(b, {
|
|
25644
25644
|
key: g,
|
|
25645
|
-
node:
|
|
25645
|
+
node: x
|
|
25646
25646
|
}, null, 8, ["node"]))), 128))
|
|
25647
25647
|
])) : l.value.kind === "layout" && l.value.layoutType === "columns" ? (c(), h("div", ES, [
|
|
25648
|
-
(c(!0), h(X, null, ae(i.value, (
|
|
25648
|
+
(c(!0), h(X, null, ae(i.value, (x, g) => (c(), h("div", {
|
|
25649
25649
|
key: g,
|
|
25650
25650
|
class: "admin-infolist-cols__item",
|
|
25651
25651
|
style: Ve({
|
|
25652
|
-
gridColumn: `span ${typeof
|
|
25652
|
+
gridColumn: `span ${typeof x.span == "number" ? x.span : Math.max(1, Math.floor(12 / i.value.length))}`
|
|
25653
25653
|
})
|
|
25654
25654
|
}, [
|
|
25655
|
-
I(
|
|
25655
|
+
I(b, { node: x }, null, 8, ["node"])
|
|
25656
25656
|
], 4))), 128))
|
|
25657
25657
|
])) : l.value.kind === "layout" && (l.value.layoutType === "section" || l.value.layoutType === "block") ? (c(), h("section", ZS, [
|
|
25658
25658
|
s.value || r.value ? (c(), h("header", WS, [
|
|
@@ -25660,25 +25660,25 @@ const SI = ne({
|
|
|
25660
25660
|
r.value ? (c(), h("p", NS, v(r.value), 1)) : H("", !0)
|
|
25661
25661
|
])) : H("", !0),
|
|
25662
25662
|
u("div", XS, [
|
|
25663
|
-
(c(!0), h(X, null, ae(i.value, (
|
|
25663
|
+
(c(!0), h(X, null, ae(i.value, (x, g) => (c(), z(b, {
|
|
25664
25664
|
key: g,
|
|
25665
|
-
node:
|
|
25665
|
+
node: x
|
|
25666
25666
|
}, null, 8, ["node"]))), 128))
|
|
25667
25667
|
])
|
|
25668
25668
|
])) : l.value.kind === "layout" && l.value.layoutType === "tabs" ? (c(), h("div", KS, [
|
|
25669
25669
|
u("ul", JS, [
|
|
25670
|
-
(c(!0), h(X, null, ae(m.value, (
|
|
25671
|
-
key:
|
|
25670
|
+
(c(!0), h(X, null, ae(m.value, (x, g) => (c(), h("li", {
|
|
25671
|
+
key: x.key ?? g,
|
|
25672
25672
|
class: ve([
|
|
25673
25673
|
"admin-infolist-tabs__tab",
|
|
25674
25674
|
{ "admin-infolist-tabs__tab--active": g === y.value }
|
|
25675
25675
|
])
|
|
25676
|
-
}, v(
|
|
25676
|
+
}, v(x.label), 3))), 128))
|
|
25677
25677
|
]),
|
|
25678
25678
|
u("div", YS, [
|
|
25679
|
-
(c(!0), h(X, null, ae(m.value[y.value]?.items ?? [], (
|
|
25679
|
+
(c(!0), h(X, null, ae(m.value[y.value]?.items ?? [], (x, g) => (c(), z(b, {
|
|
25680
25680
|
key: g,
|
|
25681
|
-
node:
|
|
25681
|
+
node: x
|
|
25682
25682
|
}, null, 8, ["node"]))), 128))
|
|
25683
25683
|
])
|
|
25684
25684
|
])) : (c(), z($S, {
|
|
@@ -25764,14 +25764,14 @@ const SI = ne({
|
|
|
25764
25764
|
function f(g) {
|
|
25765
25765
|
return p(g) ? "" : g.summary ?? "";
|
|
25766
25766
|
}
|
|
25767
|
-
const
|
|
25768
|
-
function
|
|
25767
|
+
const b = /^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})(?:\.\d+)?(?:Z|[+-]\d{2}:?\d{2})?$/;
|
|
25768
|
+
function x(g) {
|
|
25769
25769
|
if (g == null) return "∅";
|
|
25770
25770
|
if (typeof g == "boolean") return g ? "Да" : "Нет";
|
|
25771
25771
|
if (g === 0) return "Нет";
|
|
25772
25772
|
if (g === 1) return "Да";
|
|
25773
25773
|
if (typeof g == "string") {
|
|
25774
|
-
const L = g.match(
|
|
25774
|
+
const L = g.match(b);
|
|
25775
25775
|
return L ? `${L[1]} ${L[2]}` : g.length > 40 ? `${g.slice(0, 40)}…` : g;
|
|
25776
25776
|
}
|
|
25777
25777
|
if (typeof g == "object")
|
|
@@ -25823,14 +25823,14 @@ const SI = ne({
|
|
|
25823
25823
|
class: "admin-audit-timeline__diff-arrow",
|
|
25824
25824
|
"aria-hidden": "true"
|
|
25825
25825
|
}, "→", -1)),
|
|
25826
|
-
u("span", kq, v(
|
|
25827
|
-
], 64)) : k.event === "deleted" || k.event === "destroyed" ? (c(), h("span", mq, v(
|
|
25828
|
-
u("span", vq, v(
|
|
25826
|
+
u("span", kq, v(x(_.after)), 1)
|
|
25827
|
+
], 64)) : k.event === "deleted" || k.event === "destroyed" ? (c(), h("span", mq, v(x(_.before)), 1)) : (c(), h(X, { key: 2 }, [
|
|
25828
|
+
u("span", vq, v(x(_.before)), 1),
|
|
25829
25829
|
L[1] || (L[1] = u("span", {
|
|
25830
25830
|
class: "admin-audit-timeline__diff-arrow",
|
|
25831
25831
|
"aria-hidden": "true"
|
|
25832
25832
|
}, "→", -1)),
|
|
25833
|
-
u("span", fq, v(
|
|
25833
|
+
u("span", fq, v(x(_.after)), 1)
|
|
25834
25834
|
], 64))
|
|
25835
25835
|
])
|
|
25836
25836
|
], 2))), 128))
|
|
@@ -25884,7 +25884,7 @@ const SI = ne({
|
|
|
25884
25884
|
return typeof j == "string" && j.length > 0 ? j : `${i.value?.label ?? t.slug}: запись #${t.id}`;
|
|
25885
25885
|
}), f = M(
|
|
25886
25886
|
() => i.value?.label ?? t.slug
|
|
25887
|
-
),
|
|
25887
|
+
), b = M(() => `${t.uidPrefix}${t.id}`), x = M(() => {
|
|
25888
25888
|
const j = o.state[t.statusField];
|
|
25889
25889
|
return typeof j == "string" && j.length > 0 ? j : null;
|
|
25890
25890
|
}), g = {
|
|
@@ -25970,19 +25970,19 @@ const SI = ne({
|
|
|
25970
25970
|
]),
|
|
25971
25971
|
u("h1", bq, v(p.value), 1),
|
|
25972
25972
|
u("div", Lq, [
|
|
25973
|
-
|
|
25973
|
+
x.value ? (c(), h("span", {
|
|
25974
25974
|
key: 0,
|
|
25975
25975
|
class: "admin-status-badge",
|
|
25976
|
-
"data-variant": L(
|
|
25977
|
-
"data-status":
|
|
25976
|
+
"data-variant": L(x.value),
|
|
25977
|
+
"data-status": x.value
|
|
25978
25978
|
}, [
|
|
25979
25979
|
j[0] || (j[0] = u("span", {
|
|
25980
25980
|
class: "admin-status-badge__dot",
|
|
25981
25981
|
"aria-hidden": "true"
|
|
25982
25982
|
}, null, -1)),
|
|
25983
|
-
F(" " + v(
|
|
25983
|
+
F(" " + v(x.value), 1)
|
|
25984
25984
|
], 8, Cq)) : H("", !0),
|
|
25985
|
-
u("span", _q, v(
|
|
25985
|
+
u("span", _q, v(b.value), 1)
|
|
25986
25986
|
])
|
|
25987
25987
|
]),
|
|
25988
25988
|
u("div", Sq, [
|
|
@@ -26159,28 +26159,28 @@ const MI = q2((a) => (t, o) => {
|
|
|
26159
26159
|
MI._ = !0;
|
|
26160
26160
|
const dw = [lw, rw, w2, fI, MI, gI], Uq = { auto: (a, { modes: t = dw } = {}) => (o, l) => {
|
|
26161
26161
|
const d = t.map((p, f) => {
|
|
26162
|
-
const
|
|
26163
|
-
return { m: p, h: 1 << f, C: p.est("", l), S: p.l ? (g, L) =>
|
|
26162
|
+
const b = /* @__PURE__ */ new Map(), x = (g, L) => (b.has(g) || b.set(g, L(g, l)), b.get(g));
|
|
26163
|
+
return { m: p, h: 1 << f, C: p.est("", l), S: p.l ? (g, L) => x(L - g, p.l) : (g, L) => x(a.slice(g, L), p.est) };
|
|
26164
26164
|
});
|
|
26165
26165
|
let i = [{ v: 0 }], s = 0, r = 0, y = -1;
|
|
26166
26166
|
for (const p of [...a, ""]) {
|
|
26167
26167
|
let f = 0;
|
|
26168
|
-
if (p) for (const
|
|
26168
|
+
if (p) for (const b of d) b.m.test(p) && (f |= b.h);
|
|
26169
26169
|
if (!p || f !== y) {
|
|
26170
26170
|
if (y !== -1) {
|
|
26171
|
-
const
|
|
26171
|
+
const b = new Set(i.map((g) => g.D)), x = [];
|
|
26172
26172
|
for (const { m: g, C: L, S: k, h: _ } of d) if (y & _) {
|
|
26173
26173
|
const Z = k(s, r);
|
|
26174
|
-
for (const U of g.eci ??
|
|
26174
|
+
for (const U of g.eci ?? b) if (!g.u || !U) {
|
|
26175
26175
|
let A;
|
|
26176
26176
|
for (const D of i) if (D.D === U || g.eci) {
|
|
26177
26177
|
const B = D.m === g && D.D === U, j = B ? D.V : D, P = g._ && B ? D.v + Z - L : j.v + 12 * (j.D !== U) + (B ? k(B ? D.$ : s, r) : Z);
|
|
26178
26178
|
(!A || P < A.v) && (A = { $: B ? D.$ : s, V: j, m: g, D: U, A: r, v: P });
|
|
26179
26179
|
}
|
|
26180
|
-
A &&
|
|
26180
|
+
A && x.push(A);
|
|
26181
26181
|
}
|
|
26182
26182
|
}
|
|
26183
|
-
i =
|
|
26183
|
+
i = x;
|
|
26184
26184
|
}
|
|
26185
26185
|
y = f, s = r;
|
|
26186
26186
|
}
|
|
@@ -26188,7 +26188,7 @@ const dw = [lw, rw, w2, fI, MI, gI], Uq = { auto: (a, { modes: t = dw } = {}) =>
|
|
|
26188
26188
|
}
|
|
26189
26189
|
i.length || V2(5);
|
|
26190
26190
|
const m = [];
|
|
26191
|
-
for (let p = i.reduce((f,
|
|
26191
|
+
for (let p = i.reduce((f, b) => b.v < f.v ? b : f); p.m; p = p.V) m.push(p.m(a.slice(p.$, p.A)));
|
|
26192
26192
|
m.reverse().forEach((p) => p(o, l));
|
|
26193
26193
|
}, multi: cw, eci: iw, bytes: vI, numeric: lw, alphaNumeric: rw, ascii: w2, iso8859_1: fI, shift_jis: MI, utf8: gI }, Oq = () => ({ F: a2(2956), I: 0, push(a, t) {
|
|
26194
26194
|
for (let o = t, l = 8 - (7 & this.I); o > 0; o -= l, l = 8) this.F[this.I >> 3] |= a << l >> o, this.I += o < l ? o : l;
|
|
@@ -26201,12 +26201,12 @@ const dw = [lw, rw, w2, fI, MI, gI], Uq = { auto: (a, { modes: t = dw } = {}) =>
|
|
|
26201
26201
|
}
|
|
26202
26202
|
return m;
|
|
26203
26203
|
}, toImageData(l, { on: d = [0, 0, 0], off: i = [0, 0, 0, 0], pad: s = 4, padX: r = s, padY: y = s } = {}) {
|
|
26204
|
-
const m = a + 2 * r, p = a + 2 * y, f = l.createImageData(m, p),
|
|
26204
|
+
const m = a + 2 * r, p = a + 2 * y, f = l.createImageData(m, p), b = new Uint32Array(f.data.buffer);
|
|
26205
26205
|
f.data.set([...d, 255]);
|
|
26206
|
-
const
|
|
26206
|
+
const x = b[0];
|
|
26207
26207
|
f.data.set([...i, 255]);
|
|
26208
|
-
const g =
|
|
26209
|
-
for (let L = 0; L < p; ++L) for (let k = 0; k < m; ++k)
|
|
26208
|
+
const g = b[0];
|
|
26209
|
+
for (let L = 0; L < p; ++L) for (let k = 0; k < m; ++k) b[L * m + k] = this.get(k - r, L - y) ? x : g;
|
|
26210
26210
|
return f;
|
|
26211
26211
|
}, toCanvas(l, d) {
|
|
26212
26212
|
const i = l.getContext("2d"), s = this.toImageData(i, d);
|
|
@@ -26301,16 +26301,16 @@ const Wq = (a, t) => {
|
|
|
26301
26301
|
p || (PI[y] = p = W9(4 * y + 17), Gq(p, y), p.p = Nq(p));
|
|
26302
26302
|
const f = $q(y, p.p.length >> 3);
|
|
26303
26303
|
if (8 * f(t).t < m) continue;
|
|
26304
|
-
const
|
|
26305
|
-
a(
|
|
26306
|
-
for (let
|
|
26307
|
-
const g = f(
|
|
26304
|
+
const b = Oq();
|
|
26305
|
+
a(b, y), m = b.I;
|
|
26306
|
+
for (let x = o; x >= t; --x) {
|
|
26307
|
+
const g = f(x);
|
|
26308
26308
|
if (8 * g.t < m) continue;
|
|
26309
|
-
for (
|
|
26309
|
+
for (b.I = m + 11 & -8; b.I < 8 * g.t; ) b.push(s, 16);
|
|
26310
26310
|
const L = W9(p.size, p.K);
|
|
26311
|
-
return Xq(L, p.p, Wq(
|
|
26311
|
+
return Xq(L, p.p, Wq(b.F, g)), (G9[i ?? -1] ? [G9[i]] : G9).map((k, _) => {
|
|
26312
26312
|
const Z = W9(L.size, L.K);
|
|
26313
|
-
return Kq(Z, k, i ?? _,
|
|
26313
|
+
return Kq(Z, k, i ?? _, x), Z.s = Jq(Z), Z;
|
|
26314
26314
|
}).reduce((k, _) => _.s < k.s ? _ : k);
|
|
26315
26315
|
}
|
|
26316
26316
|
}
|
|
@@ -26332,8 +26332,8 @@ const Yq = "http://www.w3.org/2000/svg", Qq = (a, t, o, l = []) => [`<${t}`, ...
|
|
|
26332
26332
|
}
|
|
26333
26333
|
return o.map((d) => `M${d.join("L")}Z`).join("");
|
|
26334
26334
|
}, aA = (a, { on: t = "black", off: o, pad: l = 4, padX: d = l, padY: i = l, width: s, height: r, scale: y = 1 }, m, p, f) => {
|
|
26335
|
-
const
|
|
26336
|
-
return m(p, "svg", { xmlns: Yq, version: "1.1", viewBox: `${-d} ${-i} ${
|
|
26335
|
+
const b = a.size + 2 * d, x = a.size + 2 * i;
|
|
26336
|
+
return m(p, "svg", { xmlns: Yq, version: "1.1", viewBox: `${-d} ${-i} ${b} ${x}`, width: s ?? b * y, height: r ?? x * y, "shape-rendering": "crispedges" }, [o ? m(p, "rect", { x: -d, y: -i, width: b, height: x, fill: o }) : "", m(p, "path", { d: eA(a), fill: t })], f);
|
|
26337
26337
|
}, tA = (a, t = {}) => (t.xmlDeclaration ? '<?xml version="1.0" encoding="UTF-8" ?>' : "") + aA(a, t, Qq), nA = { class: "admin-2fa" }, oA = {
|
|
26338
26338
|
key: 0,
|
|
26339
26339
|
class: "admin-2fa__panel"
|
|
@@ -26372,7 +26372,7 @@ const Yq = "http://www.w3.org/2000/svg", Qq = (a, t, o, l = []) => [`<${t}`, ...
|
|
|
26372
26372
|
emits: ["enabled", "disabled"],
|
|
26373
26373
|
setup(a, { emit: t }) {
|
|
26374
26374
|
const o = a, l = t, d = q(o.enabled ? "enabled" : "idle"), i = q(""), s = q(""), r = q(""), y = q([]), m = q(""), p = q(!1), f = q("");
|
|
26375
|
-
async function
|
|
26375
|
+
async function b() {
|
|
26376
26376
|
p.value = !0, f.value = "";
|
|
26377
26377
|
try {
|
|
26378
26378
|
const { getAdminClient: A } = await Promise.resolve().then(() => qe), B = await A().post("/profile/twoFactorEnable");
|
|
@@ -26383,7 +26383,7 @@ const Yq = "http://www.w3.org/2000/svg", Qq = (a, t, o, l = []) => [`<${t}`, ...
|
|
|
26383
26383
|
p.value = !1;
|
|
26384
26384
|
}
|
|
26385
26385
|
}
|
|
26386
|
-
async function
|
|
26386
|
+
async function x() {
|
|
26387
26387
|
if (!(r.value.length < 4)) {
|
|
26388
26388
|
p.value = !0, f.value = "";
|
|
26389
26389
|
try {
|
|
@@ -26465,7 +26465,7 @@ const Yq = "http://www.w3.org/2000/svg", Qq = (a, t, o, l = []) => [`<${t}`, ...
|
|
|
26465
26465
|
variant: "primary",
|
|
26466
26466
|
loading: p.value,
|
|
26467
26467
|
"data-testid": "2fa-enable",
|
|
26468
|
-
onClick:
|
|
26468
|
+
onClick: b
|
|
26469
26469
|
}, {
|
|
26470
26470
|
prepend: w(() => [
|
|
26471
26471
|
I(n(ee), {
|
|
@@ -26525,7 +26525,7 @@ const Yq = "http://www.w3.org/2000/svg", Qq = (a, t, o, l = []) => [`<${t}`, ...
|
|
|
26525
26525
|
loading: p.value,
|
|
26526
26526
|
disabled: r.value.length < 4,
|
|
26527
26527
|
"data-testid": "2fa-confirm",
|
|
26528
|
-
onClick:
|
|
26528
|
+
onClick: x
|
|
26529
26529
|
}, {
|
|
26530
26530
|
default: w(() => [...D[8] || (D[8] = [
|
|
26531
26531
|
F(" Подтвердить ", -1)
|
|
@@ -26649,7 +26649,7 @@ const Yq = "http://www.w3.org/2000/svg", Qq = (a, t, o, l = []) => [`<${t}`, ...
|
|
|
26649
26649
|
theme: i.current
|
|
26650
26650
|
}), f = M(
|
|
26651
26651
|
() => s.available.map((U) => ({ value: U, label: U.toUpperCase() }))
|
|
26652
|
-
),
|
|
26652
|
+
), b = M(
|
|
26653
26653
|
() => i.available.map((U) => ({ value: U, label: U === "dark" ? E("Тёмная") : U === "light" ? E("Светлая") : U }))
|
|
26654
26654
|
);
|
|
26655
26655
|
we(
|
|
@@ -26667,7 +26667,7 @@ const Yq = "http://www.w3.org/2000/svg", Qq = (a, t, o, l = []) => [`<${t}`, ...
|
|
|
26667
26667
|
});
|
|
26668
26668
|
}
|
|
26669
26669
|
);
|
|
26670
|
-
function
|
|
26670
|
+
function x() {
|
|
26671
26671
|
l("save", { ...p.value });
|
|
26672
26672
|
}
|
|
26673
26673
|
function g() {
|
|
@@ -26759,14 +26759,14 @@ const Yq = "http://www.w3.org/2000/svg", Qq = (a, t, o, l = []) => [`<${t}`, ...
|
|
|
26759
26759
|
I(n(C9), {
|
|
26760
26760
|
modelValue: p.value.theme,
|
|
26761
26761
|
"onUpdate:modelValue": A[3] || (A[3] = (D) => p.value.theme = D),
|
|
26762
|
-
options:
|
|
26762
|
+
options: b.value,
|
|
26763
26763
|
label: n(E)("Тема")
|
|
26764
26764
|
}, null, 8, ["modelValue", "options", "label"])
|
|
26765
26765
|
]),
|
|
26766
26766
|
u("footer", DA, [
|
|
26767
26767
|
I(n(oe), {
|
|
26768
26768
|
variant: "primary",
|
|
26769
|
-
onClick:
|
|
26769
|
+
onClick: x
|
|
26770
26770
|
}, {
|
|
26771
26771
|
default: w(() => [
|
|
26772
26772
|
F(v(n(E)("Сохранить")), 1)
|
|
@@ -26955,7 +26955,7 @@ const Yq = "http://www.w3.org/2000/svg", Qq = (a, t, o, l = []) => [`<${t}`, ...
|
|
|
26955
26955
|
return t.data.map((r, y) => {
|
|
26956
26956
|
const m = s / d.value * 2 * Math.PI;
|
|
26957
26957
|
s += r.value;
|
|
26958
|
-
const p = s / d.value * 2 * Math.PI, f = 50,
|
|
26958
|
+
const p = s / d.value * 2 * Math.PI, f = 50, b = 60, x = 60, g = b + f * Math.cos(m - Math.PI / 2), L = x + f * Math.sin(m - Math.PI / 2), k = b + f * Math.cos(p - Math.PI / 2), _ = x + f * Math.sin(p - Math.PI / 2), Z = p - m > Math.PI ? 1 : 0, U = t.data.length === 1 ? `M ${b - f} ${x} a ${f} ${f} 0 1 0 ${f * 2} 0 a ${f} ${f} 0 1 0 ${-f * 2} 0` : `M ${b} ${x} L ${g} ${L} A ${f} ${f} 0 ${Z} 1 ${k} ${_} Z`;
|
|
26959
26959
|
return {
|
|
26960
26960
|
...r,
|
|
26961
26961
|
path: U,
|
|
@@ -27931,14 +27931,14 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
27931
27931
|
}), d = M(() => o.errors[t.name]?.[0]), i = q(""), s = q(!1), r = q(null), y = q(null), m = q(null), { floatingStyle: p, update: f } = ex(y, m, {
|
|
27932
27932
|
placement: "bottom-start",
|
|
27933
27933
|
offset: 4
|
|
27934
|
-
}),
|
|
27935
|
-
function
|
|
27936
|
-
|
|
27934
|
+
}), b = q(0);
|
|
27935
|
+
function x() {
|
|
27936
|
+
b.value = y.value?.getBoundingClientRect().width ?? 0;
|
|
27937
27937
|
}
|
|
27938
27938
|
const g = M(() => ({
|
|
27939
27939
|
...p.value,
|
|
27940
27940
|
// Ширину dropdown'а привязываем к ширине chip-инпута — стандартный combobox-UX.
|
|
27941
|
-
minWidth:
|
|
27941
|
+
minWidth: b.value > 0 ? `${b.value}px` : "auto"
|
|
27942
27942
|
}));
|
|
27943
27943
|
function L(N) {
|
|
27944
27944
|
const J = /* @__PURE__ */ new Set(), R = [];
|
|
@@ -28011,7 +28011,7 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
28011
28011
|
return we(
|
|
28012
28012
|
() => s.value && j.value.length > 0,
|
|
28013
28013
|
async (N) => {
|
|
28014
|
-
N ? (
|
|
28014
|
+
N ? (x(), await i1(), f(), requestAnimationFrame(() => f()), window.addEventListener("resize", f), window.addEventListener("scroll", f, !0)) : (window.removeEventListener("resize", f), window.removeEventListener("scroll", f, !0));
|
|
28015
28015
|
}
|
|
28016
28016
|
), (N, J) => (c(), h("div", {
|
|
28017
28017
|
class: ve(["admin-field", { "admin-field--invalid": d.value !== void 0 }])
|
|
@@ -28148,15 +28148,15 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
28148
28148
|
return p && typeof p == "object" && !Array.isArray(p) ? p : typeof p == "string" ? { [i.value]: p } : {};
|
|
28149
28149
|
});
|
|
28150
28150
|
function r(p, f) {
|
|
28151
|
-
const
|
|
28152
|
-
|
|
28151
|
+
const b = { ...s.value };
|
|
28152
|
+
b[p] = f, o.setField(t.name, b);
|
|
28153
28153
|
}
|
|
28154
28154
|
const y = M(() => {
|
|
28155
28155
|
const p = o.errors[t.name];
|
|
28156
28156
|
if (p?.[0]) return p[0];
|
|
28157
28157
|
for (const f of d.value) {
|
|
28158
|
-
const
|
|
28159
|
-
if (
|
|
28158
|
+
const b = o.errors[`${t.name}.${f}`]?.[0];
|
|
28159
|
+
if (b) return `[${f}] ${b}`;
|
|
28160
28160
|
}
|
|
28161
28161
|
});
|
|
28162
28162
|
function m(p) {
|
|
@@ -28172,22 +28172,22 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
28172
28172
|
])) : H("", !0),
|
|
28173
28173
|
u("div", dH, [
|
|
28174
28174
|
u("div", sH, [
|
|
28175
|
-
(c(!0), h(X, null, ae(d.value, (
|
|
28176
|
-
key:
|
|
28175
|
+
(c(!0), h(X, null, ae(d.value, (b) => (c(), h("button", {
|
|
28176
|
+
key: b,
|
|
28177
28177
|
type: "button",
|
|
28178
28178
|
role: "tab",
|
|
28179
28179
|
class: ve([
|
|
28180
28180
|
"admin-translatable__tab",
|
|
28181
28181
|
{
|
|
28182
|
-
"admin-translatable__tab--active": i.value ===
|
|
28183
|
-
"admin-translatable__tab--filled": m(
|
|
28182
|
+
"admin-translatable__tab--active": i.value === b,
|
|
28183
|
+
"admin-translatable__tab--filled": m(b)
|
|
28184
28184
|
}
|
|
28185
28185
|
]),
|
|
28186
|
-
"aria-selected": i.value ===
|
|
28187
|
-
onClick: (
|
|
28186
|
+
"aria-selected": i.value === b,
|
|
28187
|
+
onClick: (x) => i.value = b
|
|
28188
28188
|
}, [
|
|
28189
|
-
F(v(
|
|
28190
|
-
m(
|
|
28189
|
+
F(v(b.toUpperCase()) + " ", 1),
|
|
28190
|
+
m(b) ? (c(), h("span", uH)) : H("", !0)
|
|
28191
28191
|
], 10, hH))), 128))
|
|
28192
28192
|
]),
|
|
28193
28193
|
u("div", yH, [
|
|
@@ -28198,13 +28198,13 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
28198
28198
|
rows: a.rows,
|
|
28199
28199
|
disabled: a.disabled,
|
|
28200
28200
|
class: "admin-translatable__textarea",
|
|
28201
|
-
onInput: f[1] || (f[1] = (
|
|
28201
|
+
onInput: f[1] || (f[1] = (b) => r(i.value, b.target.value))
|
|
28202
28202
|
}, null, 40, pH)) : (c(), z(n(Le), {
|
|
28203
28203
|
key: 0,
|
|
28204
28204
|
"model-value": s.value[i.value] ?? "",
|
|
28205
28205
|
placeholder: a.placeholder ?? "",
|
|
28206
28206
|
disabled: a.disabled,
|
|
28207
|
-
"onUpdate:modelValue": f[0] || (f[0] = (
|
|
28207
|
+
"onUpdate:modelValue": f[0] || (f[0] = (b) => r(i.value, b))
|
|
28208
28208
|
}, null, 8, ["model-value", "placeholder", "disabled"]))
|
|
28209
28209
|
])
|
|
28210
28210
|
]),
|
|
@@ -28262,22 +28262,22 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
28262
28262
|
typeof console < "u" && console.error("[admin] image upload failed:", V), ye.error("Не удалось загрузить изображение.");
|
|
28263
28263
|
}
|
|
28264
28264
|
}
|
|
28265
|
-
function
|
|
28265
|
+
function b(R) {
|
|
28266
28266
|
if (!s.value) return;
|
|
28267
28267
|
const C = window.prompt("URL ссылки (пусто — удалить ссылку):", R ?? "");
|
|
28268
28268
|
C !== null && s.value.chain().setLink(C.trim() === "" ? null : C.trim()).run();
|
|
28269
28269
|
}
|
|
28270
|
-
const
|
|
28270
|
+
const x = q(null), g = q(null), L = q(null);
|
|
28271
28271
|
let k = null, _ = [];
|
|
28272
28272
|
function Z() {
|
|
28273
28273
|
k?.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
28274
28274
|
}
|
|
28275
28275
|
function U() {
|
|
28276
|
-
if (!
|
|
28276
|
+
if (!x.value || !y.value) {
|
|
28277
28277
|
g.value = null;
|
|
28278
28278
|
return;
|
|
28279
28279
|
}
|
|
28280
|
-
const R =
|
|
28280
|
+
const R = x.value.getBoundingClientRect(), C = y.value.getBoundingClientRect();
|
|
28281
28281
|
g.value = {
|
|
28282
28282
|
x: R.left - C.left + y.value.scrollLeft,
|
|
28283
28283
|
y: R.top - C.top + y.value.scrollTop,
|
|
@@ -28286,10 +28286,10 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
28286
28286
|
};
|
|
28287
28287
|
}
|
|
28288
28288
|
function A(R) {
|
|
28289
|
-
|
|
28289
|
+
x.value !== R && (x.value && x.value.classList.remove("admin-wysiwyg-img--selected"), x.value = R, R.classList.add("admin-wysiwyg-img--selected"), R.setAttribute("draggable", "true"), U());
|
|
28290
28290
|
}
|
|
28291
28291
|
function D() {
|
|
28292
|
-
|
|
28292
|
+
x.value && (x.value.classList.remove("admin-wysiwyg-img--selected"), x.value.removeAttribute("draggable")), x.value = null, g.value = null;
|
|
28293
28293
|
}
|
|
28294
28294
|
function B(R) {
|
|
28295
28295
|
k = R;
|
|
@@ -28312,7 +28312,7 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
28312
28312
|
};
|
|
28313
28313
|
k.addEventListener("dragstart", O), _.push(() => k?.removeEventListener("dragstart", O));
|
|
28314
28314
|
const ce = (ue) => {
|
|
28315
|
-
if (!
|
|
28315
|
+
if (!x.value) return;
|
|
28316
28316
|
ue.preventDefault(), ue.dataTransfer && (ue.dataTransfer.dropEffect = "move");
|
|
28317
28317
|
const pe = j(ue.clientX, ue.clientY);
|
|
28318
28318
|
if (pe && y.value) {
|
|
@@ -28326,12 +28326,12 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
28326
28326
|
};
|
|
28327
28327
|
k.addEventListener("dragover", ce), _.push(() => k?.removeEventListener("dragover", ce));
|
|
28328
28328
|
const se = (ue) => {
|
|
28329
|
-
if (!
|
|
28329
|
+
if (!x.value || !k) return;
|
|
28330
28330
|
ue.preventDefault(), L.value = null;
|
|
28331
28331
|
const pe = j(ue.clientX, ue.clientY);
|
|
28332
|
-
if (!pe || pe.contains(
|
|
28332
|
+
if (!pe || pe.contains(x.value))
|
|
28333
28333
|
return;
|
|
28334
|
-
const he = pe.getBoundingClientRect(), Ce = ue.clientY < he.top + he.height / 2, _e =
|
|
28334
|
+
const he = pe.getBoundingClientRect(), Ce = ue.clientY < he.top + he.height / 2, _e = x.value;
|
|
28335
28335
|
_e.remove(), Ce ? pe.parentNode?.insertBefore(_e, pe) : pe.parentNode?.insertBefore(_e, pe.nextSibling), U(), Z();
|
|
28336
28336
|
};
|
|
28337
28337
|
k.addEventListener("drop", se), _.push(() => k?.removeEventListener("drop", se));
|
|
@@ -28340,16 +28340,16 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
28340
28340
|
};
|
|
28341
28341
|
k.addEventListener("dragend", me), _.push(() => k?.removeEventListener("dragend", me));
|
|
28342
28342
|
const xe = new MutationObserver(() => {
|
|
28343
|
-
|
|
28343
|
+
x.value && !k?.contains(x.value) ? D() : U();
|
|
28344
28344
|
});
|
|
28345
28345
|
xe.observe(k, { childList: !0, subtree: !0, attributes: !0, attributeFilter: ["src", "style", "width", "height"] }), _.push(() => xe.disconnect());
|
|
28346
28346
|
}
|
|
28347
28347
|
function j(R, C) {
|
|
28348
28348
|
if (!k) return null;
|
|
28349
|
-
const V =
|
|
28350
|
-
|
|
28349
|
+
const V = x.value?.style.pointerEvents ?? "";
|
|
28350
|
+
x.value && (x.value.style.pointerEvents = "none");
|
|
28351
28351
|
const S = document.elementFromPoint(R, C);
|
|
28352
|
-
if (
|
|
28352
|
+
if (x.value && (x.value.style.pointerEvents = V), !S || !k.contains(S)) return null;
|
|
28353
28353
|
let O = S;
|
|
28354
28354
|
for (; O && O.parentElement && O.parentElement !== k; ) O = O.parentElement;
|
|
28355
28355
|
return O && O.parentElement === k ? O : null;
|
|
@@ -28357,9 +28357,9 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
28357
28357
|
const P = q(null);
|
|
28358
28358
|
let T = null;
|
|
28359
28359
|
function W(R, C) {
|
|
28360
|
-
if (!
|
|
28360
|
+
if (!x.value) return;
|
|
28361
28361
|
C.preventDefault(), C.stopPropagation(), P.value = R;
|
|
28362
|
-
const S =
|
|
28362
|
+
const S = x.value.getBoundingClientRect();
|
|
28363
28363
|
T = {
|
|
28364
28364
|
mx: C.clientX,
|
|
28365
28365
|
my: C.clientY,
|
|
@@ -28369,10 +28369,10 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
28369
28369
|
}, window.addEventListener("mousemove", te), window.addEventListener("mouseup", N);
|
|
28370
28370
|
}
|
|
28371
28371
|
function te(R) {
|
|
28372
|
-
if (!P.value || !T || !
|
|
28372
|
+
if (!P.value || !T || !x.value) return;
|
|
28373
28373
|
const C = R.clientX - T.mx, V = R.clientY - T.my, S = P.value === "nw" || P.value === "sw" ? -1 : 1, O = P.value === "nw" || P.value === "ne" ? -1 : 1;
|
|
28374
28374
|
let ce = Math.max(24, T.w + C * S), se = Math.max(24, T.h + V * O);
|
|
28375
|
-
R.shiftKey || (Math.abs(C * S) >= Math.abs(V * O) ? se = ce / T.aspect : ce = se * T.aspect),
|
|
28375
|
+
R.shiftKey || (Math.abs(C * S) >= Math.abs(V * O) ? se = ce / T.aspect : ce = se * T.aspect), x.value.style.width = Math.round(ce) + "px", x.value.style.height = Math.round(se) + "px", U();
|
|
28376
28376
|
}
|
|
28377
28377
|
function N() {
|
|
28378
28378
|
P.value && (P.value = null, T = null, window.removeEventListener("mousemove", te), window.removeEventListener("mouseup", N), Z());
|
|
@@ -28384,7 +28384,7 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
28384
28384
|
return b9(() => {
|
|
28385
28385
|
_.forEach((R) => R()), _ = [], D();
|
|
28386
28386
|
}), we(l, () => {
|
|
28387
|
-
|
|
28387
|
+
x.value && k && !k.contains(x.value) && D();
|
|
28388
28388
|
}), (R, C) => (c(), h("div", {
|
|
28389
28389
|
class: ve(["admin-field", { "admin-field--invalid": d.value !== void 0 }])
|
|
28390
28390
|
}, [
|
|
@@ -28405,7 +28405,7 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
28405
28405
|
"max-height": a.maxHeight,
|
|
28406
28406
|
onReady: m,
|
|
28407
28407
|
onImageRequest: p,
|
|
28408
|
-
onLinkRequest:
|
|
28408
|
+
onLinkRequest: b,
|
|
28409
28409
|
"onUpdate:modelValue": i
|
|
28410
28410
|
}, null, 8, ["model-value", "placeholder", "readonly", "min-height", "max-height"]),
|
|
28411
28411
|
u("input", {
|
|
@@ -28463,30 +28463,30 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
28463
28463
|
},
|
|
28464
28464
|
setup(a) {
|
|
28465
28465
|
const t = a, o = Pe(), l = M(() => {
|
|
28466
|
-
const
|
|
28467
|
-
return
|
|
28466
|
+
const x = o.getField(t.name);
|
|
28467
|
+
return x && typeof x == "object" && "url" in x ? x : null;
|
|
28468
28468
|
}), d = M(() => o.errors[t.name]?.[0]), i = q(null), s = q(!1), r = q(!1);
|
|
28469
28469
|
function y() {
|
|
28470
28470
|
i.value?.click();
|
|
28471
28471
|
}
|
|
28472
|
-
async function m(
|
|
28473
|
-
const g =
|
|
28474
|
-
g && await f(g),
|
|
28472
|
+
async function m(x) {
|
|
28473
|
+
const g = x.target.files?.[0];
|
|
28474
|
+
g && await f(g), x.target.value = "";
|
|
28475
28475
|
}
|
|
28476
|
-
async function p(
|
|
28477
|
-
|
|
28478
|
-
const g =
|
|
28476
|
+
async function p(x) {
|
|
28477
|
+
x.preventDefault(), r.value = !1;
|
|
28478
|
+
const g = x.dataTransfer?.files?.[0];
|
|
28479
28479
|
g && await f(g);
|
|
28480
28480
|
}
|
|
28481
|
-
async function f(
|
|
28482
|
-
if (t.maxSize !== null &&
|
|
28481
|
+
async function f(x) {
|
|
28482
|
+
if (t.maxSize !== null && x.size > t.maxSize * 1024) {
|
|
28483
28483
|
ye.error(`Файл больше ${t.maxSize} KB.`);
|
|
28484
28484
|
return;
|
|
28485
28485
|
}
|
|
28486
28486
|
s.value = !0;
|
|
28487
28487
|
try {
|
|
28488
28488
|
const g = new FormData();
|
|
28489
|
-
g.append("file",
|
|
28489
|
+
g.append("file", x);
|
|
28490
28490
|
const L = t.image ? "/uploads/image" : "/uploads/upload", k = await Me().post(L, g, {
|
|
28491
28491
|
headers: { "Content-Type": "multipart/form-data" }
|
|
28492
28492
|
});
|
|
@@ -28497,10 +28497,10 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
28497
28497
|
s.value = !1;
|
|
28498
28498
|
}
|
|
28499
28499
|
}
|
|
28500
|
-
function
|
|
28500
|
+
function b() {
|
|
28501
28501
|
o.setField(t.name, null);
|
|
28502
28502
|
}
|
|
28503
|
-
return (
|
|
28503
|
+
return (x, g) => (c(), h("div", bH, [
|
|
28504
28504
|
a.label ? (c(), h("label", LH, [
|
|
28505
28505
|
F(v(a.label), 1),
|
|
28506
28506
|
a.required ? (c(), h("span", CH, "*")) : H("", !0)
|
|
@@ -28517,7 +28517,7 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
28517
28517
|
I(n(oe), {
|
|
28518
28518
|
variant: "ghost",
|
|
28519
28519
|
size: "sm",
|
|
28520
|
-
onClick:
|
|
28520
|
+
onClick: b
|
|
28521
28521
|
}, {
|
|
28522
28522
|
default: w(() => [
|
|
28523
28523
|
I(n(ee), { icon: n(He) }, null, 8, ["icon"]),
|
|
@@ -28593,7 +28593,7 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
28593
28593
|
const t = a, o = Pe(), l = M(() => {
|
|
28594
28594
|
const R = o.getField(t.name);
|
|
28595
28595
|
return R && typeof R == "object" && "url" in R ? R : null;
|
|
28596
|
-
}), d = M(() => o.errors[t.name]?.[0]), i = q(null), s = q(!1), r = q(!1), y = q(null), m = q(null), p = q(1), f = q({ w: 0, h: 0 }),
|
|
28596
|
+
}), d = M(() => o.errors[t.name]?.[0]), i = q(null), s = q(!1), r = q(!1), y = q(null), m = q(null), p = q(1), f = q({ w: 0, h: 0 }), b = q({ x: 0, y: 0, w: 100, h: 100 }), x = M(() => t.aspectRatio !== null ? t.aspectRatio : t.outputWidth && t.outputHeight ? t.outputWidth / t.outputHeight : null);
|
|
28597
28597
|
function g() {
|
|
28598
28598
|
i.value?.click();
|
|
28599
28599
|
}
|
|
@@ -28628,12 +28628,12 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
28628
28628
|
}
|
|
28629
28629
|
function U() {
|
|
28630
28630
|
const { w: R, h: C } = f.value;
|
|
28631
|
-
if (
|
|
28632
|
-
let V = R, S = V /
|
|
28633
|
-
S > C && (S = C, V = S *
|
|
28631
|
+
if (x.value !== null) {
|
|
28632
|
+
let V = R, S = V / x.value;
|
|
28633
|
+
S > C && (S = C, V = S * x.value), b.value = { x: (R - V) / 2, y: (C - S) / 2, w: V, h: S };
|
|
28634
28634
|
} else {
|
|
28635
28635
|
const V = Math.min(R, C) * 0.1;
|
|
28636
|
-
|
|
28636
|
+
b.value = { x: V, y: V, w: R - 2 * V, h: C - 2 * V };
|
|
28637
28637
|
}
|
|
28638
28638
|
}
|
|
28639
28639
|
const A = q(null), D = q({
|
|
@@ -28648,10 +28648,10 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
28648
28648
|
A.value = R, D.value = {
|
|
28649
28649
|
mx: C.clientX,
|
|
28650
28650
|
my: C.clientY,
|
|
28651
|
-
cx:
|
|
28652
|
-
cy:
|
|
28653
|
-
cw:
|
|
28654
|
-
ch:
|
|
28651
|
+
cx: b.value.x,
|
|
28652
|
+
cy: b.value.y,
|
|
28653
|
+
cw: b.value.w,
|
|
28654
|
+
ch: b.value.h
|
|
28655
28655
|
}, window.addEventListener("mousemove", j), window.addEventListener("mouseup", P), C.preventDefault();
|
|
28656
28656
|
}
|
|
28657
28657
|
function j(R) {
|
|
@@ -28659,24 +28659,24 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
28659
28659
|
const C = R.clientX - D.value.mx, V = R.clientY - D.value.my, S = D.value, O = f.value, ce = (t.minCropWidth ?? 32) * p.value, se = (t.minCropHeight ?? 32) * p.value;
|
|
28660
28660
|
if (A.value === "move") {
|
|
28661
28661
|
let _e = Math.max(0, Math.min(S.cx + C, O.w - S.cw)), Ne = Math.max(0, Math.min(S.cy + V, O.h - S.ch));
|
|
28662
|
-
|
|
28662
|
+
b.value = { x: _e, y: Ne, w: S.cw, h: S.ch };
|
|
28663
28663
|
return;
|
|
28664
28664
|
}
|
|
28665
28665
|
let me = S.cx, xe = S.cy, ue = S.cx + S.cw, pe = S.cy + S.ch;
|
|
28666
28666
|
A.value === "nw" && (me = S.cx + C, xe = S.cy + V), A.value === "ne" && (ue = S.cx + S.cw + C, xe = S.cy + V), A.value === "sw" && (me = S.cx + C, pe = S.cy + S.ch + V), A.value === "se" && (ue = S.cx + S.cw + C, pe = S.cy + S.ch + V), me = Math.max(0, Math.min(me, ue - ce)), xe = Math.max(0, Math.min(xe, pe - se)), ue = Math.min(O.w, Math.max(ue, me + ce)), pe = Math.min(O.h, Math.max(pe, xe + se));
|
|
28667
28667
|
let he = ue - me, Ce = pe - xe;
|
|
28668
|
-
if (
|
|
28669
|
-
const _e =
|
|
28668
|
+
if (x.value !== null) {
|
|
28669
|
+
const _e = x.value;
|
|
28670
28670
|
Math.abs(he - S.cw) >= Math.abs(Ce - S.ch) ? Ce = he / _e : he = Ce * _e, A.value === "nw" && (me = ue - he, xe = pe - Ce), A.value === "ne" && (xe = pe - Ce), A.value === "sw" && (me = ue - he), me < 0 && (he += me, me = 0, Ce = he / _e, xe = A.value === "nw" || A.value === "ne" ? pe - Ce : xe), xe < 0 && (Ce += xe, xe = 0, he = Ce * _e, me = A.value === "nw" || A.value === "sw" ? ue - he : me), me + he > O.w && (he = O.w - me, Ce = he / _e), xe + Ce > O.h && (Ce = O.h - xe, he = Ce * _e);
|
|
28671
28671
|
}
|
|
28672
|
-
|
|
28672
|
+
b.value = { x: me, y: xe, w: he, h: Ce };
|
|
28673
28673
|
}
|
|
28674
28674
|
function P() {
|
|
28675
28675
|
A.value = null, window.removeEventListener("mousemove", j), window.removeEventListener("mouseup", P);
|
|
28676
28676
|
}
|
|
28677
28677
|
async function T() {
|
|
28678
28678
|
if (!y.value) return;
|
|
28679
|
-
const R = y.value, C = 1 / p.value, V =
|
|
28679
|
+
const R = y.value, C = 1 / p.value, V = b.value.x * C, S = b.value.y * C, O = b.value.w * C, ce = b.value.h * C, se = t.outputWidth ?? Math.round(O), me = t.outputHeight ?? Math.round(ce), xe = document.createElement("canvas");
|
|
28680
28680
|
xe.width = se, xe.height = me;
|
|
28681
28681
|
const ue = xe.getContext("2d");
|
|
28682
28682
|
if (!ue) {
|
|
@@ -28759,7 +28759,7 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
28759
28759
|
}, null, 8, ZH),
|
|
28760
28760
|
u("div", {
|
|
28761
28761
|
class: "admin-image-cropper__rect",
|
|
28762
|
-
style: Ve({ left:
|
|
28762
|
+
style: Ve({ left: b.value.x + "px", top: b.value.y + "px", width: b.value.w + "px", height: b.value.h + "px" }),
|
|
28763
28763
|
onMousedown: C[6] || (C[6] = (V) => B("move", V))
|
|
28764
28764
|
}, [
|
|
28765
28765
|
u("div", {
|
|
@@ -28875,17 +28875,17 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
28875
28875
|
const t = a, o = Pe();
|
|
28876
28876
|
function l() {
|
|
28877
28877
|
const p = o.getField(t.name);
|
|
28878
|
-
return p == null || typeof p != "object" || Array.isArray(p) ? [] : Object.entries(p).map(([f,
|
|
28878
|
+
return p == null || typeof p != "object" || Array.isArray(p) ? [] : Object.entries(p).map(([f, b]) => ({
|
|
28879
28879
|
key: f,
|
|
28880
|
-
value:
|
|
28880
|
+
value: b == null ? "" : String(b)
|
|
28881
28881
|
}));
|
|
28882
28882
|
}
|
|
28883
28883
|
const d = q(l());
|
|
28884
28884
|
we(
|
|
28885
28885
|
() => o.getField(t.name),
|
|
28886
28886
|
() => {
|
|
28887
|
-
const p = l(), f = JSON.stringify(Object.fromEntries(d.value.map((
|
|
28888
|
-
JSON.stringify(Object.fromEntries(p.map((
|
|
28887
|
+
const p = l(), f = JSON.stringify(Object.fromEntries(d.value.map((b) => [b.key, b.value])));
|
|
28888
|
+
JSON.stringify(Object.fromEntries(p.map((b) => [b.key, b.value]))) !== f && (d.value = p);
|
|
28889
28889
|
}
|
|
28890
28890
|
);
|
|
28891
28891
|
function i() {
|
|
@@ -28914,20 +28914,20 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
28914
28914
|
u("span", null, v(a.valueLabel), 1),
|
|
28915
28915
|
f[0] || (f[0] = u("span", null, null, -1))
|
|
28916
28916
|
]),
|
|
28917
|
-
(c(!0), h(X, null, ae(d.value, (
|
|
28918
|
-
key:
|
|
28917
|
+
(c(!0), h(X, null, ae(d.value, (b, x) => (c(), h("div", {
|
|
28918
|
+
key: x,
|
|
28919
28919
|
class: "admin-keyvalue__row"
|
|
28920
28920
|
}, [
|
|
28921
28921
|
I(n(Le), {
|
|
28922
|
-
modelValue:
|
|
28923
|
-
"onUpdate:modelValue": (g) =>
|
|
28922
|
+
modelValue: b.key,
|
|
28923
|
+
"onUpdate:modelValue": (g) => b.key = g,
|
|
28924
28924
|
list: a.allowedKeys.length > 0 ? m.value : void 0,
|
|
28925
28925
|
placeholder: a.keyLabel,
|
|
28926
28926
|
onBlur: i
|
|
28927
28927
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "list", "placeholder"]),
|
|
28928
28928
|
I(n(Le), {
|
|
28929
|
-
modelValue:
|
|
28930
|
-
"onUpdate:modelValue": (g) =>
|
|
28929
|
+
modelValue: b.value,
|
|
28930
|
+
"onUpdate:modelValue": (g) => b.value = g,
|
|
28931
28931
|
placeholder: a.valueLabel,
|
|
28932
28932
|
onBlur: i
|
|
28933
28933
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"]),
|
|
@@ -28935,8 +28935,8 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
28935
28935
|
key: 0,
|
|
28936
28936
|
variant: "ghost",
|
|
28937
28937
|
size: "sm",
|
|
28938
|
-
"aria-label": `Удалить ${
|
|
28939
|
-
onClick: (g) => r(
|
|
28938
|
+
"aria-label": `Удалить ${b.key}`,
|
|
28939
|
+
onClick: (g) => r(x)
|
|
28940
28940
|
}, {
|
|
28941
28941
|
default: w(() => [
|
|
28942
28942
|
I(n(ee), {
|
|
@@ -28951,9 +28951,9 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
28951
28951
|
key: 0,
|
|
28952
28952
|
id: m.value
|
|
28953
28953
|
}, [
|
|
28954
|
-
(c(!0), h(X, null, ae(a.allowedKeys, (
|
|
28955
|
-
key:
|
|
28956
|
-
value:
|
|
28954
|
+
(c(!0), h(X, null, ae(a.allowedKeys, (b) => (c(), h("option", {
|
|
28955
|
+
key: b,
|
|
28956
|
+
value: b
|
|
28957
28957
|
}, null, 8, sV))), 128))
|
|
28958
28958
|
], 8, dV)) : H("", !0)
|
|
28959
28959
|
]),
|
|
@@ -29029,21 +29029,21 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
29029
29029
|
setup(a) {
|
|
29030
29030
|
const t = a, o = Pe();
|
|
29031
29031
|
function l() {
|
|
29032
|
-
const
|
|
29033
|
-
return Array.isArray(
|
|
29032
|
+
const x = o.getField(t.name);
|
|
29033
|
+
return Array.isArray(x) ? x.map((g) => ({ ...g })) : [];
|
|
29034
29034
|
}
|
|
29035
29035
|
const d = q(l());
|
|
29036
29036
|
we(
|
|
29037
29037
|
() => o.getField(t.name),
|
|
29038
|
-
(
|
|
29039
|
-
JSON.stringify(
|
|
29038
|
+
(x) => {
|
|
29039
|
+
JSON.stringify(x ?? []) !== JSON.stringify(d.value) && (d.value = l());
|
|
29040
29040
|
}
|
|
29041
29041
|
);
|
|
29042
29042
|
function i() {
|
|
29043
|
-
o.setField(t.name, d.value.map((
|
|
29043
|
+
o.setField(t.name, d.value.map((x) => ({ ...x })));
|
|
29044
29044
|
}
|
|
29045
|
-
function s(
|
|
29046
|
-
d.value[
|
|
29045
|
+
function s(x, g) {
|
|
29046
|
+
d.value[x] = g, i();
|
|
29047
29047
|
}
|
|
29048
29048
|
const r = M(
|
|
29049
29049
|
() => t.addable && (t.maxItems === null || d.value.length < t.maxItems)
|
|
@@ -29054,18 +29054,18 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
29054
29054
|
const m = M(
|
|
29055
29055
|
() => t.removable && (t.minItems === null || d.value.length > t.minItems)
|
|
29056
29056
|
);
|
|
29057
|
-
function p(
|
|
29058
|
-
d.value.splice(
|
|
29057
|
+
function p(x) {
|
|
29058
|
+
d.value.splice(x, 1), i();
|
|
29059
29059
|
}
|
|
29060
|
-
function f(
|
|
29061
|
-
const L =
|
|
29060
|
+
function f(x, g) {
|
|
29061
|
+
const L = x + g;
|
|
29062
29062
|
if (L < 0 || L >= d.value.length) return;
|
|
29063
29063
|
const k = [...d.value];
|
|
29064
|
-
[k[
|
|
29064
|
+
[k[x], k[L]] = [k[L], k[x]], d.value = k, i();
|
|
29065
29065
|
}
|
|
29066
|
-
const
|
|
29067
|
-
return (
|
|
29068
|
-
class: ve(["uid-form-field admin-repeater", { "uid-form-field--error": !!
|
|
29066
|
+
const b = M(() => o.errors[t.name]?.[0]);
|
|
29067
|
+
return (x, g) => (c(), h("div", {
|
|
29068
|
+
class: ve(["uid-form-field admin-repeater", { "uid-form-field--error": !!b.value }])
|
|
29069
29069
|
}, [
|
|
29070
29070
|
a.label ? (c(), h("label", vV, [
|
|
29071
29071
|
F(v(a.label), 1),
|
|
@@ -29155,7 +29155,7 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
29155
29155
|
]),
|
|
29156
29156
|
_: 1
|
|
29157
29157
|
})) : H("", !0),
|
|
29158
|
-
|
|
29158
|
+
b.value ? (c(), h("p", wV, v(b.value), 1)) : a.help ? (c(), h("p", xV, v(a.help), 1)) : H("", !0)
|
|
29159
29159
|
], 2));
|
|
29160
29160
|
}
|
|
29161
29161
|
}), LV = /* @__PURE__ */ a1(bV, [["__scopeId", "data-v-4c50981b"]]), CV = {
|
|
@@ -29219,12 +29219,12 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
29219
29219
|
function f(g, L) {
|
|
29220
29220
|
d.value[g] = { ...d.value[g], data: L }, i();
|
|
29221
29221
|
}
|
|
29222
|
-
function
|
|
29222
|
+
function b(g) {
|
|
29223
29223
|
return t.blocks[g] ?? null;
|
|
29224
29224
|
}
|
|
29225
|
-
const
|
|
29225
|
+
const x = M(() => o.errors[t.name]?.[0]);
|
|
29226
29226
|
return (g, L) => (c(), h("div", {
|
|
29227
|
-
class: ve(["uid-form-field admin-builder", { "uid-form-field--error": !!
|
|
29227
|
+
class: ve(["uid-form-field admin-builder", { "uid-form-field--error": !!x.value }])
|
|
29228
29228
|
}, [
|
|
29229
29229
|
a.label ? (c(), h("label", CV, [
|
|
29230
29230
|
F(v(a.label), 1),
|
|
@@ -29237,7 +29237,7 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
29237
29237
|
}, {
|
|
29238
29238
|
default: w(() => [
|
|
29239
29239
|
u("header", SV, [
|
|
29240
|
-
u("span", qV, v(
|
|
29240
|
+
u("span", qV, v(b(k.type)?.label ?? k.type), 1),
|
|
29241
29241
|
u("span", AV, [
|
|
29242
29242
|
a.reorderable ? (c(), z(n(oe), {
|
|
29243
29243
|
key: 0,
|
|
@@ -29287,9 +29287,9 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
29287
29287
|
}, 8, ["aria-label", "onClick"])
|
|
29288
29288
|
])
|
|
29289
29289
|
]),
|
|
29290
|
-
|
|
29290
|
+
b(k.type) ? (c(), z(kw, {
|
|
29291
29291
|
key: 0,
|
|
29292
|
-
fields:
|
|
29292
|
+
fields: b(k.type).fields,
|
|
29293
29293
|
"model-value": k.data,
|
|
29294
29294
|
"onUpdate:modelValue": (Z) => f(_, Z)
|
|
29295
29295
|
}, null, 8, ["fields", "model-value", "onUpdate:modelValue"])) : (c(), h("p", zV, "Неизвестный тип блока: " + v(k.type), 1))
|
|
@@ -29328,7 +29328,7 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
29328
29328
|
]),
|
|
29329
29329
|
_: 1
|
|
29330
29330
|
})) : H("", !0),
|
|
29331
|
-
|
|
29331
|
+
x.value ? (c(), h("p", HV, v(x.value), 1)) : a.help ? (c(), h("p", VV, v(a.help), 1)) : H("", !0)
|
|
29332
29332
|
], 2));
|
|
29333
29333
|
}
|
|
29334
29334
|
}), FV = /* @__PURE__ */ a1(PV, [["__scopeId", "data-v-d8d1c6e0"]]), jV = { class: "uid-form-field admin-relation-table" }, BV = {
|
|
@@ -29406,14 +29406,14 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
29406
29406
|
},
|
|
29407
29407
|
setup(a) {
|
|
29408
29408
|
const t = a, o = Pe(), l = b2(), d = M(() => o.getField(t.name) ?? ""), i = M(() => o.errors[t.name]?.[0]), s = typeof globalThis.crypto?.getRandomValues == "function";
|
|
29409
|
-
function r(f,
|
|
29410
|
-
const
|
|
29409
|
+
function r(f, b) {
|
|
29410
|
+
const x = b.length, g = Math.floor(256 / x) * x;
|
|
29411
29411
|
let L = "";
|
|
29412
29412
|
const k = new Uint8Array(f * 2);
|
|
29413
29413
|
for (; L.length < f; ) {
|
|
29414
29414
|
globalThis.crypto.getRandomValues(k);
|
|
29415
29415
|
for (const _ of k)
|
|
29416
|
-
if (_ < g && (L +=
|
|
29416
|
+
if (_ < g && (L += b[_ % x], L.length === f))
|
|
29417
29417
|
break;
|
|
29418
29418
|
}
|
|
29419
29419
|
return L;
|
|
@@ -29431,7 +29431,7 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
29431
29431
|
t.autogenerate && !t.disabled && !m.value && f === "" && y();
|
|
29432
29432
|
},
|
|
29433
29433
|
{ immediate: !0 }
|
|
29434
|
-
), (f,
|
|
29434
|
+
), (f, b) => (c(), h("div", {
|
|
29435
29435
|
class: ve(["uid-form-field admin-generated", { "uid-form-field--error": !!i.value }])
|
|
29436
29436
|
}, [
|
|
29437
29437
|
a.label ? (c(), h("label", $V, [
|
|
@@ -29568,8 +29568,8 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
29568
29568
|
value: d(m, p)
|
|
29569
29569
|
}, {
|
|
29570
29570
|
default: w(() => [
|
|
29571
|
-
(c(!0), h(X, null, ae(m.items, (f,
|
|
29572
|
-
key:
|
|
29571
|
+
(c(!0), h(X, null, ae(m.items, (f, b) => (c(), z(I2, {
|
|
29572
|
+
key: b,
|
|
29573
29573
|
node: f
|
|
29574
29574
|
}, null, 8, ["node"]))), 128))
|
|
29575
29575
|
]),
|
|
@@ -29598,7 +29598,7 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
29598
29598
|
}), f = M(() => (d.value?.columns ?? []).filter((R) => {
|
|
29599
29599
|
const C = String(R.name ?? "");
|
|
29600
29600
|
return !t.hide_columns.includes(C);
|
|
29601
|
-
})),
|
|
29601
|
+
})), b = M(
|
|
29602
29602
|
() => f.value.map((J) => ({
|
|
29603
29603
|
key: String(J.name ?? ""),
|
|
29604
29604
|
label: String(J.label ?? J.name ?? ""),
|
|
@@ -29606,7 +29606,7 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
29606
29606
|
align: J.align ?? "left",
|
|
29607
29607
|
width: J.width
|
|
29608
29608
|
}))
|
|
29609
|
-
),
|
|
29609
|
+
), x = M(() => t.features.create && !!d.value?.permissions?.create), g = M(() => t.features.delete && !!d.value?.permissions?.delete), L = M(() => t.features.bulkDelete && !!d.value?.permissions?.delete);
|
|
29610
29610
|
function k(J) {
|
|
29611
29611
|
for (const R of f.value)
|
|
29612
29612
|
if (String(R.name ?? "") === J)
|
|
@@ -29665,7 +29665,7 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
29665
29665
|
}
|
|
29666
29666
|
}
|
|
29667
29667
|
function P() {
|
|
29668
|
-
if (!
|
|
29668
|
+
if (!x.value || m.value !== null) return;
|
|
29669
29669
|
const J = {};
|
|
29670
29670
|
p.value !== null && (J[t.foreign_key] = p.value), m.value = J;
|
|
29671
29671
|
}
|
|
@@ -29689,7 +29689,7 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
29689
29689
|
}
|
|
29690
29690
|
return (J, R) => (c(), h("div", YV, [
|
|
29691
29691
|
u("div", QV, [
|
|
29692
|
-
|
|
29692
|
+
x.value ? (c(), z(n(oe), {
|
|
29693
29693
|
key: 0,
|
|
29694
29694
|
variant: "primary",
|
|
29695
29695
|
size: "sm",
|
|
@@ -29725,7 +29725,7 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
29725
29725
|
hint: n(E)("Нажмите «Добавить», чтобы создать первую запись.")
|
|
29726
29726
|
}, null, 8, ["title", "hint"])) : (c(), z(n(x2), {
|
|
29727
29727
|
key: 3,
|
|
29728
|
-
columns:
|
|
29728
|
+
columns: b.value,
|
|
29729
29729
|
data: i.value,
|
|
29730
29730
|
selectable: L.value,
|
|
29731
29731
|
selection: y.value,
|
|
@@ -29733,7 +29733,7 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
29733
29733
|
onSelectRow: A,
|
|
29734
29734
|
onSelectAll: D
|
|
29735
29735
|
}, DI({ _: 2 }, [
|
|
29736
|
-
ae(
|
|
29736
|
+
ae(b.value, (C) => ({
|
|
29737
29737
|
name: C.key,
|
|
29738
29738
|
fn: w((V) => [
|
|
29739
29739
|
U(V) && k(C.key) ? (c(), z(ow, {
|
|
@@ -29778,7 +29778,7 @@ const Ze = /* @__PURE__ */ ne({
|
|
|
29778
29778
|
]), 1032, ["columns", "data", "selectable", "selection"])),
|
|
29779
29779
|
m.value !== null ? (c(), h("div", tP, [
|
|
29780
29780
|
u("div", nP, [
|
|
29781
|
-
(c(!0), h(X, null, ae(
|
|
29781
|
+
(c(!0), h(X, null, ae(b.value, (C) => (c(), h("div", {
|
|
29782
29782
|
key: C.key,
|
|
29783
29783
|
class: "admin-embedded-table__draft-cell"
|
|
29784
29784
|
}, [
|
|
@@ -30233,15 +30233,15 @@ function TF(a, t = {}) {
|
|
|
30233
30233
|
});
|
|
30234
30234
|
i.use(y);
|
|
30235
30235
|
const m = yI();
|
|
30236
|
-
if (y.beforeEach((p, f,
|
|
30237
|
-
p.fullPath !== f.fullPath && m.start(),
|
|
30236
|
+
if (y.beforeEach((p, f, b) => {
|
|
30237
|
+
p.fullPath !== f.fullPath && m.start(), b();
|
|
30238
30238
|
}), y.afterEach(() => {
|
|
30239
30239
|
m.end();
|
|
30240
30240
|
}), y.onError(() => {
|
|
30241
30241
|
m.end();
|
|
30242
|
-
}), y.beforeResolve(async (p, f,
|
|
30243
|
-
const
|
|
30244
|
-
if (
|
|
30242
|
+
}), y.beforeResolve(async (p, f, b) => {
|
|
30243
|
+
const x = typeof p.name == "string" ? p.name : null;
|
|
30244
|
+
if (x && x.startsWith("admin.resource.") && x.endsWith(".index")) {
|
|
30245
30245
|
const g = p.params.slug ?? p.meta.slug;
|
|
30246
30246
|
if (g)
|
|
30247
30247
|
try {
|
|
@@ -30251,12 +30251,12 @@ function TF(a, t = {}) {
|
|
|
30251
30251
|
} catch {
|
|
30252
30252
|
}
|
|
30253
30253
|
}
|
|
30254
|
-
|
|
30254
|
+
b();
|
|
30255
30255
|
}), t.skipManifestLoad)
|
|
30256
30256
|
Ue().bootResolved = !0;
|
|
30257
30257
|
else {
|
|
30258
|
-
const p = Ue(), f = e1(),
|
|
30259
|
-
|
|
30258
|
+
const p = Ue(), f = e1(), b = uI(), x = async () => {
|
|
30259
|
+
b.load().catch(() => {
|
|
30260
30260
|
});
|
|
30261
30261
|
try {
|
|
30262
30262
|
const g = await p.load();
|
|
@@ -30270,10 +30270,10 @@ function TF(a, t = {}) {
|
|
|
30270
30270
|
p.bootResolved = !0;
|
|
30271
30271
|
}
|
|
30272
30272
|
};
|
|
30273
|
-
f.isAuthenticated ?
|
|
30273
|
+
f.isAuthenticated ? x() : p.bootResolved = !0, we(
|
|
30274
30274
|
() => f.user,
|
|
30275
30275
|
(g, L) => {
|
|
30276
|
-
g && !L && (p.bootResolved = !1,
|
|
30276
|
+
g && !L && (p.bootResolved = !1, x());
|
|
30277
30277
|
}
|
|
30278
30278
|
);
|
|
30279
30279
|
}
|
|
@@ -30393,10 +30393,10 @@ const FP = { class: "admin-notifs__hd" }, jP = { class: "admin-notifs__title" },
|
|
|
30393
30393
|
const k = L.data.level;
|
|
30394
30394
|
return k === "success" || k === "warning" || k === "danger" ? k : "info";
|
|
30395
30395
|
}
|
|
30396
|
-
function
|
|
30396
|
+
function b(L) {
|
|
30397
30397
|
return L.data.title ?? "—";
|
|
30398
30398
|
}
|
|
30399
|
-
function
|
|
30399
|
+
function x(L) {
|
|
30400
30400
|
return L.data.body ?? "";
|
|
30401
30401
|
}
|
|
30402
30402
|
function g(L) {
|
|
@@ -30486,10 +30486,10 @@ const FP = { class: "admin-notifs__hd" }, jP = { class: "admin-notifs__title" },
|
|
|
30486
30486
|
}, null, 8, UP),
|
|
30487
30487
|
u("div", OP, [
|
|
30488
30488
|
u("div", EP, [
|
|
30489
|
-
Z.read_at ? (c(), h("span", WP, v(
|
|
30489
|
+
Z.read_at ? (c(), h("span", WP, v(b(Z)), 1)) : (c(), h("strong", ZP, v(b(Z)), 1)),
|
|
30490
30490
|
u("span", GP, v(g(Z.created_at)), 1)
|
|
30491
30491
|
]),
|
|
30492
|
-
|
|
30492
|
+
x(Z) ? (c(), h("p", NP, v(x(Z)), 1)) : H("", !0)
|
|
30493
30493
|
]),
|
|
30494
30494
|
u("button", {
|
|
30495
30495
|
type: "button",
|
|
@@ -30554,14 +30554,14 @@ const FP = { class: "admin-notifs__hd" }, jP = { class: "admin-notifs__title" },
|
|
|
30554
30554
|
function f(U, A) {
|
|
30555
30555
|
p.value[U] = A === null || A === "" ? null : String(A);
|
|
30556
30556
|
}
|
|
30557
|
-
function
|
|
30557
|
+
function b() {
|
|
30558
30558
|
return o.headers.map((U) => ({
|
|
30559
30559
|
source: U.key,
|
|
30560
30560
|
target: p.value[U.key] ?? null
|
|
30561
30561
|
}));
|
|
30562
30562
|
}
|
|
30563
|
-
function
|
|
30564
|
-
l("mapping-submit",
|
|
30563
|
+
function x() {
|
|
30564
|
+
l("mapping-submit", b()), r(2);
|
|
30565
30565
|
}
|
|
30566
30566
|
function g() {
|
|
30567
30567
|
l("run-import"), r(3);
|
|
@@ -30745,7 +30745,7 @@ const FP = { class: "admin-notifs__hd" }, jP = { class: "admin-notifs__title" },
|
|
|
30745
30745
|
key: 2,
|
|
30746
30746
|
variant: "primary",
|
|
30747
30747
|
disabled: !k.value,
|
|
30748
|
-
onClick:
|
|
30748
|
+
onClick: x
|
|
30749
30749
|
}, {
|
|
30750
30750
|
default: w(() => [...A[6] || (A[6] = [
|
|
30751
30751
|
F(" Подтвердить mapping ", -1)
|