501 lines
21 KiB
JavaScript
501 lines
21 KiB
JavaScript
import { jsx as o, jsxs as g, Fragment as $ } from "react/jsx-runtime";
|
|
import { Box as I, HStack as u, VStack as C, Image as B, Text as d, useDisclosure as _, Stack as AA, Tooltip as P, IconButton as f, Icon as s, Drawer as oA, DrawerOverlay as eA, DrawerContent as nA, DrawerCloseButton as rA, DrawerHeader as tA, DrawerBody as gA, SimpleGrid as lA, Link as aA } from "@chakra-ui/react";
|
|
import { forwardRef as x, useRef as iA, Children as cA, isValidElement as IA } from "react";
|
|
import { usePermission as dA, logoutKeycloakFromRuntime as sA } from "./core-runtime.js";
|
|
const CA = "data:image/webp;base64,UklGRpwQAABXRUJQVlA4WAoAAAAcAAAAKQAAOwAAQUxQSFQEAAABoHbb2rG3HtB6FdS2bQ03qW3btm3btm3btm3bbnCyP9xP3jd9T0RMABHsSorXZsvtPb3Se41jZVyvSXXa32uqP/Xxmq7fo3jNACXzmn4q7jUdNdRryuuG3bAbztgR4R9evC9hBQ2Gzk0EgVE9i5U1PLZpndFDup+IkgU9K5LDjSr6kwGqSVIu8rXwbEAaN3wfajUkGPxHo6DAYI+c2xO4QVuFBAC1xgGVZ3mU8HYcd/we6DAwbFs26LnIoxxfkrhDM6kcfaRPmdky1qOCyuWW7y3tKiVJAT6fWnqUXy3dor7CKtT5oOE0VGGPMmu9e77XtIjCw3FeDUrkUZyfH2K4RW29iwE00GE8tl1Qs3Di1BrQIZ7rhvJAjEfq5obdiv46Z7do8ELSYfqrLMzW3zRuOCd3SGik+auaRh2Z3xwVVJry0lpMu0FX/ZqRAtigm/4Q/YvFTWorTYznCs5lEdMi9efDwX/aQb7/1AWyL2nc7oHUN9G1R6yVZgE2GzEsIt9Ll3SqxsNSfUiMDVgkbXuunk2kuzEMO1EtYj5MC4U/NyXlZ21wAY1/SNLDZj/1KwvW0Szy3/IBcp2IwhDp7Ojhh2W+bPBA6tRlXhqL2BZjV2G2CCRDkMIN2lTguDRzqnQvlhHPcN0raZEoN7bL4Xz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MTwveG1wTU06SW5zdGFuY2VJRD4KICAgICAgICAgPHBob3Rvc2hvcDpJQ0NQcm9maWxlPnNSR0IgSUVDNjE5NjYtMi4xPC9waG90b3Nob3A6SUNDUHJvZmlsZT4KICAgICAgICAgPHBob3Rvc2hvcDpDb2xvck1vZGU+MzwvcGhvdG9zaG9wOkNvbG9yTW9kZT4KICAgICAgICAgPHBob3Rvc2hvcDpEb2N1bWVudEFuY2VzdG9ycz4KICAgICAgICAgICAgPHJkZjpCYWc+CiAgICAgICAgICAgICAgIDxyZGY6bGk+YWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOmEwYjgxNWMzLTkzYjMtODU0MC04NmY0LTA0OTEyZTY5Y2Y4NTwvcmRmOmxpPgogICAgICAgICAgICA8L3JkZjpCYWc+CiAgICAgICAgIDwvcGhvdG9zaG9wOkRvY3VtZW50QW5jZXN0b3JzPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4K";
|
|
function pA({ children: e, ...A }) {
|
|
return /* @__PURE__ */ o(
|
|
I,
|
|
{
|
|
as: "header",
|
|
w: "100%",
|
|
h: "110px",
|
|
borderBottom: "1px",
|
|
borderColor: "gray.200",
|
|
bg: "#4299E1",
|
|
px: "20px",
|
|
zIndex: 10,
|
|
position: "fixed",
|
|
color: "white",
|
|
...A,
|
|
children: /* @__PURE__ */ o(u, { h: "100%", alignItems: "center", justifyContent: "space-between", children: e })
|
|
}
|
|
);
|
|
}
|
|
function bA({ children: e, ...A }) {
|
|
return /* @__PURE__ */ o(u, { alignItems: "center", h: "100%", py: "10px", ...A, children: e });
|
|
}
|
|
function hA(e) {
|
|
return /* @__PURE__ */ o(B, { loading: "lazy", alt: "logo", maxW: "80px", maxH: "80px", ...e });
|
|
}
|
|
function uA({ children: e, ...A }) {
|
|
return /* @__PURE__ */ o(
|
|
C,
|
|
{
|
|
alignItems: "start",
|
|
justifyContent: "center",
|
|
h: "100%",
|
|
spacing: 1,
|
|
...A,
|
|
children: e
|
|
}
|
|
);
|
|
}
|
|
function xA({ children: e, ...A }) {
|
|
return /* @__PURE__ */ o(d, { fontWeight: "bold", fontSize: "20px", ...A, children: e });
|
|
}
|
|
function mA({ children: e, ...A }) {
|
|
return /* @__PURE__ */ o(d, { ...A, children: e });
|
|
}
|
|
function RA({ logoSrc: e = CA, ...A }) {
|
|
return /* @__PURE__ */ g(
|
|
C,
|
|
{
|
|
w: "fit-content",
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
py: "10px",
|
|
...A,
|
|
children: [
|
|
/* @__PURE__ */ o(B, { src: e, loading: "lazy", maxW: "90px" }),
|
|
/* @__PURE__ */ o(d, { fontSize: "xs", fontWeight: "bold", textAlign: "center", children: "مؤسسه تولید سیستمهای خبره و هوشمند اسلامی باقرالعلوم(ع)" })
|
|
]
|
|
}
|
|
);
|
|
}
|
|
const WA = Object.assign(pA, {
|
|
BrandSection: bA,
|
|
Logo: hA,
|
|
Brand: uA,
|
|
Title: xA,
|
|
Description: mA,
|
|
Bi: RA
|
|
}), v = x(
|
|
({ title: e, children: A, width: r = "1em", height: t = "1em", ...l }, a) => /* @__PURE__ */ g(
|
|
"svg",
|
|
{
|
|
ref: a,
|
|
xmlns: "http://www.w3.org/2000/svg",
|
|
width: r,
|
|
height: t,
|
|
viewBox: "0 0 24 24",
|
|
fill: "none",
|
|
stroke: "currentColor",
|
|
strokeWidth: "2",
|
|
strokeLinecap: "round",
|
|
strokeLinejoin: "round",
|
|
"aria-hidden": e ? void 0 : !0,
|
|
role: e ? "img" : void 0,
|
|
...l,
|
|
children: [
|
|
e && /* @__PURE__ */ o("title", { children: e }),
|
|
A
|
|
]
|
|
}
|
|
)
|
|
);
|
|
v.displayName = "SvgIcon";
|
|
const Q = x((e, A) => /* @__PURE__ */ g(v, { ref: A, strokeWidth: "3", ...e, children: [
|
|
/* @__PURE__ */ o("circle", { cx: "12", cy: "12", r: "1" }),
|
|
/* @__PURE__ */ o("circle", { cx: "19", cy: "12", r: "1" }),
|
|
/* @__PURE__ */ o("circle", { cx: "5", cy: "12", r: "1" })
|
|
] }));
|
|
Q.displayName = "MoreHorizontalIcon";
|
|
const O = x((e, A) => /* @__PURE__ */ g(v, { ref: A, strokeWidth: "3", ...e, children: [
|
|
/* @__PURE__ */ o("path", { d: "m16 17 5-5-5-5" }),
|
|
/* @__PURE__ */ o("path", { d: "M21 12H9" }),
|
|
/* @__PURE__ */ o("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" })
|
|
] }));
|
|
O.displayName = "ExitIcon";
|
|
const T = (e = "") => {
|
|
const A = String(e).split(/[?#]/)[0] || "";
|
|
return !A || A === "/" ? A || "/" : A.replace(/\/+$/, "");
|
|
}, L = (e, A) => {
|
|
const r = T(e);
|
|
return [A == null ? void 0 : A.path, ...(A == null ? void 0 : A.aliases) || []].filter(Boolean).map(T).some(
|
|
(l) => r === l || r.startsWith(`${l}/`)
|
|
);
|
|
}, MA = (e = [], A) => e.find((r) => L(A, r)), W = x(
|
|
({ linkComponent: e, href: A, children: r, ...t }, l) => /* @__PURE__ */ o(aA, { ref: l, href: A, ...e ? { as: e } : {}, ...t, children: r })
|
|
);
|
|
W.displayName = "SidebarLink";
|
|
const yA = ({
|
|
item: e,
|
|
isActive: A,
|
|
isDisabled: r,
|
|
linkComponent: t,
|
|
onNavigate: l
|
|
}) => {
|
|
const a = {
|
|
variant: A ? "solid" : "ghost",
|
|
colorScheme: A ? "blue" : void 0,
|
|
icon: /* @__PURE__ */ o(s, { as: e.icon }),
|
|
fontSize: "xl",
|
|
size: { base: "sm", lg: "lg" },
|
|
"aria-label": e.title,
|
|
"aria-current": A ? "page" : void 0
|
|
};
|
|
let p;
|
|
if (r || A)
|
|
p = /* @__PURE__ */ o(
|
|
f,
|
|
{
|
|
...a,
|
|
isDisabled: r,
|
|
cursor: A && !r ? "default" : void 0
|
|
}
|
|
);
|
|
else {
|
|
const m = t ? { as: t, href: e.path } : { as: "a", href: e.path };
|
|
p = /* @__PURE__ */ o(
|
|
f,
|
|
{
|
|
...a,
|
|
...m,
|
|
onClick: l
|
|
}
|
|
);
|
|
}
|
|
return /* @__PURE__ */ o(
|
|
P,
|
|
{
|
|
label: r ? "عدم دسترسی" : e.title,
|
|
placement: "left-start",
|
|
hasArrow: !0,
|
|
rounded: "md",
|
|
py: 2,
|
|
px: 4,
|
|
fontWeight: "bold",
|
|
closeDelay: 150,
|
|
children: /* @__PURE__ */ o(I, { as: "span", children: p })
|
|
}
|
|
);
|
|
}, wA = ({
|
|
item: e,
|
|
isActive: A,
|
|
isDisabled: r,
|
|
linkComponent: t,
|
|
onNavigate: l
|
|
}) => {
|
|
const a = /* @__PURE__ */ g(
|
|
C,
|
|
{
|
|
as: "span",
|
|
spacing: 0.5,
|
|
w: "full",
|
|
minW: 0,
|
|
py: 1,
|
|
px: 1,
|
|
borderRadius: "xl",
|
|
color: A ? "blue.600" : "gray.600",
|
|
bg: A ? "blue.50" : "transparent",
|
|
opacity: r ? 0.4 : 1,
|
|
transition: "background-color 150ms ease, color 150ms ease",
|
|
children: [
|
|
/* @__PURE__ */ o(s, { as: e.icon, boxSize: 5 }),
|
|
/* @__PURE__ */ o(
|
|
d,
|
|
{
|
|
as: "span",
|
|
w: "full",
|
|
fontSize: "10px",
|
|
fontWeight: A ? "bold" : "medium",
|
|
lineHeight: "short",
|
|
textAlign: "center",
|
|
noOfLines: 1,
|
|
children: e.mobileTitle || e.title
|
|
}
|
|
)
|
|
]
|
|
}
|
|
);
|
|
return r || A ? /* @__PURE__ */ o(
|
|
I,
|
|
{
|
|
flex: "1",
|
|
minW: 0,
|
|
display: "flex",
|
|
alignItems: "center",
|
|
"aria-disabled": r ? "true" : void 0,
|
|
"aria-current": A ? "page" : void 0,
|
|
children: a
|
|
}
|
|
) : /* @__PURE__ */ o(
|
|
W,
|
|
{
|
|
linkComponent: t,
|
|
href: e.path,
|
|
flex: "1",
|
|
minW: 0,
|
|
display: "flex",
|
|
alignItems: "center",
|
|
_hover: { textDecoration: "none" },
|
|
onClick: l,
|
|
"aria-current": A ? "page" : void 0,
|
|
children: a
|
|
}
|
|
);
|
|
}, V = () => null, DA = ({
|
|
items: e = [],
|
|
currentPath: A,
|
|
linkComponent: r,
|
|
onNavigate: t,
|
|
children: l,
|
|
primaryMobileCount: a = 4,
|
|
moreTitle: p = "بیشتر",
|
|
moreDrawerTitle: m = "سایر بخشهای سامانه",
|
|
desktopProps: U,
|
|
mobileProps: H
|
|
}) => {
|
|
var N, E;
|
|
const { isOpen: X, onOpen: F, onClose: R } = _(), M = iA(), { cannot: J } = dA(), c = cA.toArray(l).find(
|
|
(n) => IA(n) && n.type === V
|
|
), y = !!c, w = ((N = c == null ? void 0 : c.props) == null ? void 0 : N.title) || "خروج", S = ((E = c == null ? void 0 : c.props) == null ? void 0 : E.icon) || O, K = A ?? (typeof window < "u" ? `${window.location.pathname}${window.location.search}` : ""), q = e.slice(0, a), D = e.slice(a), Z = (n) => (Array.isArray(n == null ? void 0 : n.perm) ? n.perm : [n == null ? void 0 : n.perm]).filter(Boolean).some((i) => J(i)), b = (n) => L(K, n), G = D.some(b), z = D.length > 0 || y, k = (n) => {
|
|
t == null || t(n), R();
|
|
}, Y = () => {
|
|
R(), sA();
|
|
};
|
|
return /* @__PURE__ */ g($, { children: [
|
|
/* @__PURE__ */ o(
|
|
AA,
|
|
{
|
|
py: 6,
|
|
as: "nav",
|
|
flexShrink: 0,
|
|
justify: "space-between",
|
|
h: "full",
|
|
borderLeft: "1px",
|
|
borderColor: "gray.200",
|
|
overflowY: "scroll",
|
|
sx: {
|
|
"::-webkit-scrollbar": { display: "none" },
|
|
scrollbarWidth: "none",
|
|
msOverflowStyle: "none"
|
|
},
|
|
display: { base: "none", lg: "flex" },
|
|
...U,
|
|
children: /* @__PURE__ */ g(C, { spacing: 2, children: [
|
|
e.map((n) => /* @__PURE__ */ o(
|
|
yA,
|
|
{
|
|
item: n,
|
|
isDisabled: Z(n),
|
|
isActive: b(n),
|
|
linkComponent: r,
|
|
onNavigate: () => t == null ? void 0 : t(n)
|
|
},
|
|
n.path
|
|
)),
|
|
y && /* @__PURE__ */ o(
|
|
P,
|
|
{
|
|
label: w,
|
|
placement: "left-start",
|
|
hasArrow: !0,
|
|
rounded: "md",
|
|
py: 2,
|
|
px: 4,
|
|
fontWeight: "bold",
|
|
closeDelay: 150,
|
|
children: /* @__PURE__ */ o(
|
|
f,
|
|
{
|
|
variant: "ghost",
|
|
icon: /* @__PURE__ */ o(s, { as: S }),
|
|
fontSize: "xl",
|
|
size: { base: "sm", lg: "lg" },
|
|
"aria-label": w,
|
|
onClick: Y
|
|
}
|
|
)
|
|
}
|
|
)
|
|
] })
|
|
}
|
|
),
|
|
/* @__PURE__ */ o(
|
|
I,
|
|
{
|
|
as: "nav",
|
|
"aria-label": "ناوبری اصلی موبایل",
|
|
display: { base: "block", lg: "none" },
|
|
position: "fixed",
|
|
insetInline: 0,
|
|
bottom: 0,
|
|
zIndex: 1200,
|
|
bg: "white",
|
|
borderTopWidth: "1px",
|
|
borderColor: "gray.200",
|
|
boxShadow: "0 -6px 18px rgba(0, 0, 0, 0.08)",
|
|
pb: "env(safe-area-inset-bottom)",
|
|
...H,
|
|
children: /* @__PURE__ */ g(u, { h: "56px", px: 1.5, spacing: 1, align: "stretch", children: [
|
|
q.map((n) => /* @__PURE__ */ o(
|
|
wA,
|
|
{
|
|
item: n,
|
|
isDisabled: Z(n),
|
|
isActive: b(n),
|
|
linkComponent: r,
|
|
onNavigate: () => k(n)
|
|
},
|
|
n.path
|
|
)),
|
|
z && /* @__PURE__ */ o(
|
|
I,
|
|
{
|
|
as: "button",
|
|
ref: M,
|
|
type: "button",
|
|
flex: "1",
|
|
minW: 0,
|
|
h: "full",
|
|
p: 0,
|
|
border: 0,
|
|
bg: "transparent",
|
|
font: "inherit",
|
|
display: "flex",
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
cursor: "pointer",
|
|
onClick: F,
|
|
"aria-label": "نمایش سایر بخشها",
|
|
children: /* @__PURE__ */ g(
|
|
C,
|
|
{
|
|
spacing: 0.5,
|
|
w: "full",
|
|
py: 1,
|
|
px: 1,
|
|
borderRadius: "xl",
|
|
color: G ? "blue.600" : "gray.600",
|
|
bg: G ? "blue.50" : "transparent",
|
|
children: [
|
|
/* @__PURE__ */ o(s, { as: Q, boxSize: 5 }),
|
|
/* @__PURE__ */ o(
|
|
d,
|
|
{
|
|
fontSize: "10px",
|
|
fontWeight: G ? "bold" : "medium",
|
|
lineHeight: "short",
|
|
children: p
|
|
}
|
|
)
|
|
]
|
|
}
|
|
)
|
|
}
|
|
)
|
|
] })
|
|
}
|
|
),
|
|
z && /* @__PURE__ */ g(
|
|
oA,
|
|
{
|
|
isOpen: X,
|
|
placement: "bottom",
|
|
onClose: R,
|
|
finalFocusRef: M,
|
|
children: [
|
|
/* @__PURE__ */ o(eA, {}),
|
|
/* @__PURE__ */ g(
|
|
nA,
|
|
{
|
|
borderTopRadius: "2xl",
|
|
maxH: "min(78dvh, 620px)",
|
|
pb: "env(safe-area-inset-bottom)",
|
|
children: [
|
|
/* @__PURE__ */ o(rA, { insetInlineEnd: 3, insetInlineStart: "auto" }),
|
|
/* @__PURE__ */ o(tA, { borderBottomWidth: "1px", fontSize: "md", children: m }),
|
|
/* @__PURE__ */ g(gA, { py: 4, overflowY: "auto", children: [
|
|
/* @__PURE__ */ o(lA, { columns: 4, spacing: 2, children: D.map((n) => {
|
|
const h = Z(n), i = b(n), j = /* @__PURE__ */ g(
|
|
C,
|
|
{
|
|
h: "70px",
|
|
minW: 0,
|
|
justify: "center",
|
|
spacing: 1,
|
|
px: 1,
|
|
borderWidth: "1px",
|
|
borderColor: i ? "blue.300" : "gray.200",
|
|
borderRadius: "lg",
|
|
bg: i ? "blue.50" : "white",
|
|
color: i ? "blue.700" : "gray.700",
|
|
opacity: h ? 0.4 : 1,
|
|
children: [
|
|
/* @__PURE__ */ o(s, { as: n.icon, boxSize: 5, flexShrink: 0 }),
|
|
/* @__PURE__ */ o(
|
|
d,
|
|
{
|
|
w: "full",
|
|
fontSize: "10px",
|
|
lineHeight: "shorter",
|
|
fontWeight: i ? "bold" : "medium",
|
|
textAlign: "center",
|
|
noOfLines: 2,
|
|
children: n.mobileTitle || n.title
|
|
}
|
|
)
|
|
]
|
|
}
|
|
);
|
|
return h || i ? /* @__PURE__ */ o(
|
|
I,
|
|
{
|
|
"aria-disabled": h ? "true" : void 0,
|
|
"aria-current": i ? "page" : void 0,
|
|
children: j
|
|
},
|
|
n.path
|
|
) : /* @__PURE__ */ o(
|
|
W,
|
|
{
|
|
linkComponent: r,
|
|
href: n.path,
|
|
_hover: { textDecoration: "none" },
|
|
onClick: () => k(n),
|
|
"aria-current": i ? "page" : void 0,
|
|
children: j
|
|
},
|
|
n.path
|
|
);
|
|
}) }),
|
|
y && /* @__PURE__ */ o(I, { mt: 4, pt: 4, borderTopWidth: "1px", borderColor: "gray.200", children: /* @__PURE__ */ g(
|
|
u,
|
|
{
|
|
as: "button",
|
|
type: "button",
|
|
w: "full",
|
|
justify: "center",
|
|
py: 3,
|
|
borderRadius: "xl",
|
|
border: 0,
|
|
color: "red.600",
|
|
bg: "red.50",
|
|
cursor: "pointer",
|
|
onClick: Y,
|
|
children: [
|
|
/* @__PURE__ */ o(s, { as: S, boxSize: 5 }),
|
|
/* @__PURE__ */ o(d, { fontWeight: "bold", children: w })
|
|
]
|
|
}
|
|
) })
|
|
] })
|
|
]
|
|
}
|
|
)
|
|
]
|
|
}
|
|
)
|
|
] });
|
|
}, SA = Object.assign(DA, {
|
|
Exit: V
|
|
});
|
|
export {
|
|
WA as Header,
|
|
SA as Sidebar,
|
|
MA as getActiveSidebarItem,
|
|
L as isSidebarPathActive
|
|
};
|