import { jsx as e, jsxs as t } from "react/jsx-runtime";
import ce, { useState as C, useCallback as W, useMemo as F, createRef as Te, useRef as xe, useEffect as he } from "react";
import { useTranslation as ue } from "react-i18next";
import { Lock as Ne, ChevronRight as ae, ChevronDown as ne, FolderOpen as Ie, Database as Me, FileText as Ae, Box as $e, Filter as Oe, Search as Ee, Check as de, RotateCcw as Le, X as je, Loader2 as ge, AlertCircle as ie, Sparkles as _e, Info as De, ChevronLeft as be, Ban as ve, Eye as me, Star as fe, BookOpen as Be, ChevronUp as We, ShieldCheck as Ke, Pencil as ze, User as Ge } from "lucide-react";
import { o as Ue, x as Xe, y as Ze, B as qe, k as He } from "./index-CwSaRXXg.js";
import { g as Je, c as Qe, a as Ve, P as Ye, b as et } from "./PermissionPopover-CR6SD8ch.js";
function tt({
  section: r,
  resources: g,
  moduleIndex: O,
  sectionIndex: R,
  isCollapsed: E,
  collapsedSections: P,
  paginatedRoles: b,
  canEditSystemRoles: _,
  statusFilters: o,
  openPopover: x,
  onToggleCollapse: M,
  onTogglePermission: T,
  onCellClick: v,
  setOpenPopover: y,
  renderResourceRow: N
}) {
  const A = P.has(r.id), d = g.length > 0;
  return /* @__PURE__ */ t(ce.Fragment, { children: [
    N(r, O + R + 1, "section", d, A),
    d && !A && g.map(
      (L, $) => N(L, O + R + $ + 2, "resource", !1, !1)
    )
  ] }, r.id);
}
function rt({
  roles: r,
  resources: g,
  canEditSystemRoles: O = !1,
  onTogglePermission: R,
  getPermissionInheritance: E,
  rolesPerPage: P,
  rolePageIndex: b,
  modulesPerPage: _,
  modulePageIndex: o,
  collapsedApps: x,
  onToggleApp: M,
  statusFilters: T
}) {
  const { t: v } = ue("admin"), [y, N] = C(null), [A, d] = C(/* @__PURE__ */ new Set()), [L, $] = C(/* @__PURE__ */ new Set()), D = W((s, l) => {
    l((i) => {
      const p = new Set(i);
      return p.has(s) ? p.delete(s) : p.add(s), p;
    });
  }, []), j = W((s) => {
    D(s, d);
  }, [D]), U = W((s) => {
    D(s, $);
  }, [D]), X = F(() => g.filter((s) => s.level === "module").length, [g]), B = F(() => {
    const s = b * P;
    return r.slice(s, s + P);
  }, [r, b, P]), K = F(() => Je(g), [g]), a = W(() => {
    const s = o * _, l = s + _, i = { current: 0 }, p = [];
    for (const w of K) {
      const k = x.has(w.application), h = [];
      if (!k)
        for (const S of w.modules)
          i.current >= s && i.current < l && h.push(S), i.current++;
      p.push({
        application: w.application,
        modules: h
      });
    }
    return p;
  }, [K, o, _, x]), u = F(() => a(), [a]), I = W((s, l) => {
    const i = E(s, l);
    return i.isDirect || i.isInherited;
  }, [E]), J = W((s, l) => Qe(l, (i) => I(s, i)), [I]), V = (s, l) => {
    y?.roleId === s && y?.resourceId === l ? N(null) : N({ roleId: s, resourceId: l });
  };
  if (r.length === 0 || X === 0)
    return /* @__PURE__ */ e("div", { className: "text-center py-12 text-[var(--text-secondary)]", children: r.length === 0 ? v("assignments.noRoles") : v("assignments.noResources") });
  const z = (s) => {
    switch (s) {
      case "resource":
        return "pl-28";
      case "section":
        return "pl-22";
      default:
        return "pl-16";
    }
  }, G = (s) => s === "resource" ? /* @__PURE__ */ e(Me, { className: "h-3.5 w-3.5 text-[var(--text-muted)]" }) : s === "section" ? /* @__PURE__ */ e(Ae, { className: "h-3.5 w-3.5 text-[var(--text-muted)]" }) : /* @__PURE__ */ e($e, { className: "h-3.5 w-3.5 text-[var(--text-secondary)]" }), Y = (s) => s === "resource" ? "text-[var(--text-muted)] italic" : s === "section" ? "text-[var(--text-secondary)]" : "font-medium text-[var(--text-primary)]", ee = W((s, l) => {
    l === "module" ? j(s) : l === "section" && U(s);
  }, [j, U]), le = (s, l, i, p) => s ? /* @__PURE__ */ e(
    "button",
    {
      onClick: () => ee(l, i),
      className: "p-0.5 hover:bg-[var(--bg-hover)] rounded",
      children: p ? /* @__PURE__ */ e(ae, { className: "h-3 w-3 text-[var(--text-muted)]" }) : /* @__PURE__ */ e(ne, { className: "h-3 w-3 text-[var(--text-muted)]" })
    }
  ) : null, oe = (s) => B.map((l) => {
    const { status: i, grantedCount: p } = J(l.id, s), w = y?.roleId === l.id && y?.resourceId === s.id, k = Te(), h = !l.isSystem || O, S = Ve(i), f = (T?.size ?? 0) > 0 && !T?.has(i);
    return /* @__PURE__ */ t(
      "td",
      {
        className: `px-0 py-1 text-center relative ${f ? "" : S}`,
        style: { width: "44px", minWidth: "44px", maxWidth: "44px" },
        children: [
          /* @__PURE__ */ e(
            "button",
            {
              ref: k,
              type: "button",
              onClick: () => h && !f && V(l.id, s.id),
              disabled: !h || f,
              className: `w-full h-full min-h-[36px] flex items-center justify-center rounded transition-colors ${f ? "opacity-10 cursor-default" : h ? "hover:opacity-80" : "cursor-not-allowed opacity-50"} ${w ? "ring-2 ring-[var(--color-accent-500)]" : ""}`,
              title: f ? void 0 : h ? `${l.name} - ${s.moduleLabel}: ${p}/${s.permissions.length}` : `${l.name} - ${v("assignments.systemRoleReadOnly")}`,
              children: /* @__PURE__ */ e(
                Ye,
                {
                  status: i,
                  grantedCount: p,
                  totalCount: s.permissions.length
                }
              )
            }
          ),
          w && h && !f && /* @__PURE__ */ e(
            et,
            {
              mode: "editable",
              role: l,
              resource: s,
              onTogglePermission: (Q) => R(l.id, Q),
              onClose: () => N(null),
              getPermissionInheritance: E
            }
          )
        ]
      },
      `${l.id}-${s.id}`
    );
  }), te = (s, l, i, p = !1, w = !1) => {
    const k = z(i), h = l % 2 === 0 ? "item-light" : "item-medium";
    return /* @__PURE__ */ t(
      "tr",
      {
        className: `hover:bg-[var(--bg-hover)] ${h}`,
        children: [
          /* @__PURE__ */ e(
            "td",
            {
              className: `sticky left-0 z-10 ${h} px-3 py-2 ${k}`,
              style: { width: "280px", minWidth: "280px", maxWidth: "280px" },
              children: /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
                le(p, s.id, i, w),
                G(i),
                /* @__PURE__ */ e("span", { className: `text-sm ${Y(i)}`, children: s.moduleLabel }),
                /* @__PURE__ */ t("span", { className: "text-xs text-[var(--text-muted)]", children: [
                  "(",
                  s.permissions.length,
                  ")"
                ] })
              ] })
            }
          ),
          oe(s)
        ]
      },
      s.id
    );
  };
  return /* @__PURE__ */ e("div", { className: "overflow-x-auto overflow-y-visible", children: /* @__PURE__ */ t("table", { className: "border-collapse", style: { width: "auto" }, children: [
    /* @__PURE__ */ e("thead", { className: "item-medium border-b border-[var(--item-color-border)]", children: /* @__PURE__ */ t("tr", { children: [
      /* @__PURE__ */ e(
        "th",
        {
          scope: "col",
          className: "sticky left-0 z-20 item-medium px-3 text-left text-xs font-medium text-[var(--text-secondary)] uppercase tracking-wider",
          style: { width: "280px", minWidth: "280px", maxWidth: "280px", height: "180px", verticalAlign: "bottom", paddingBottom: "12px" },
          children: v("assignments.resource")
        }
      ),
      B.map((s) => /* @__PURE__ */ e(
        "th",
        {
          scope: "col",
          className: "relative overflow-visible",
          style: { width: "44px", minWidth: "44px", maxWidth: "44px", height: "180px", padding: 0, verticalAlign: "bottom" },
          children: /* @__PURE__ */ e(
            "div",
            {
              className: "absolute bottom-2 left-1/2",
              style: {
                transform: "translateX(-6px) rotate(-55deg)",
                transformOrigin: "bottom left",
                width: "160px"
              },
              children: /* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: [
                s.isSystem && /* @__PURE__ */ e(Ne, { className: "h-3 w-3 flex-shrink-0 text-[var(--warning-dot)]" }),
                /* @__PURE__ */ e(
                  "span",
                  {
                    className: "text-[10px] font-medium text-[var(--text-primary)] whitespace-nowrap",
                    title: s.name,
                    children: s.name
                  }
                )
              ] })
            }
          )
        },
        s.id
      ))
    ] }) }),
    /* @__PURE__ */ e("tbody", { className: "divide-y divide-[var(--item-color-border)]", children: u.map((s) => {
      const l = x.has(s.application), i = B.length;
      return /* @__PURE__ */ t(ce.Fragment, { children: [
        /* @__PURE__ */ t("tr", { className: "bg-[var(--color-accent-900)]/30 dark:bg-[var(--color-accent-900)]/50", children: [
          /* @__PURE__ */ e(
            "td",
            {
              className: "sticky left-0 z-10 px-3 py-3 bg-[var(--color-accent-900)]/30 dark:bg-[var(--color-accent-900)]/50",
              style: { width: "280px", minWidth: "280px", maxWidth: "280px" },
              children: /* @__PURE__ */ t(
                "button",
                {
                  onClick: () => M(s.application),
                  className: "flex items-center gap-3 w-full text-left hover:opacity-80",
                  children: [
                    l ? /* @__PURE__ */ e(ae, { className: "h-5 w-5 text-[var(--color-accent-400)]" }) : /* @__PURE__ */ e(ne, { className: "h-5 w-5 text-[var(--color-accent-400)]" }),
                    /* @__PURE__ */ e(Ie, { className: "h-5 w-5 text-[var(--color-accent-400)]" }),
                    /* @__PURE__ */ e("span", { className: "text-sm font-bold text-[var(--color-accent-300)] uppercase tracking-wider", children: s.application }),
                    /* @__PURE__ */ e("span", { className: "text-xs text-[var(--color-accent-400)] ml-auto", children: v("assignments.moduleCount", { count: s.modules.length }) })
                  ]
                }
              )
            }
          ),
          /* @__PURE__ */ e("td", { colSpan: i, className: "px-0 py-3" })
        ] }),
        !l && s.modules.map((p, w) => {
          const { module: k, sections: h } = p, S = h.length > 0, f = A.has(k.id);
          return /* @__PURE__ */ t(ce.Fragment, { children: [
            te(k, w, "module", S, f),
            S && !f && h.map((Q, Z) => {
              const { section: re, resources: q } = Q;
              return /* @__PURE__ */ e(
                tt,
                {
                  section: re,
                  resources: q,
                  moduleIndex: w,
                  sectionIndex: Z,
                  isCollapsed: f,
                  collapsedSections: L,
                  paginatedRoles: B,
                  canEditSystemRoles: O,
                  statusFilters: T,
                  openPopover: y,
                  onToggleCollapse: ee,
                  onTogglePermission: R,
                  onCellClick: V,
                  setOpenPopover: N,
                  renderResourceRow: te
                },
                re.id
              );
            })
          ] }, k.id);
        })
      ] }, s.application);
    }) })
  ] }) });
}
function st({
  filters: r,
  roles: g,
  categories: O,
  applications: R,
  modules: E,
  hasChanges: P,
  onFilterChange: b,
  onReset: _
}) {
  const { t: o } = ue("admin"), [x, M] = C(!1), [T, v] = C(""), y = xe(null), N = xe(null), A = F(() => {
    let a = g;
    if (r.categoryFilter !== "all" && (a = a.filter((u) => u.category === r.categoryFilter)), T.trim()) {
      const u = T.toLowerCase();
      a = a.filter(
        (I) => I.name.toLowerCase().includes(u) || I.shortName?.toLowerCase().includes(u)
      );
    }
    return a;
  }, [g, r.categoryFilter, T]);
  he(() => {
    x && N.current && setTimeout(() => N.current?.focus(), 50);
  }, [x]);
  const d = (a) => {
    M(a), a || v("");
  }, L = E.filter((a) => !(r.applicationFilter !== "all" && a.app !== r.applicationFilter));
  he(() => {
    function a(u) {
      y.current && !y.current.contains(u.target) && d(!1);
    }
    return document.addEventListener("mousedown", a), () => document.removeEventListener("mousedown", a);
  }, []);
  const $ = (a) => {
    const u = r.selectedRoleIds.includes(a) ? r.selectedRoleIds.filter((I) => I !== a) : [...r.selectedRoleIds, a];
    b({ selectedRoleIds: u });
  }, D = () => {
    b({ selectedRoleIds: A.map((a) => a.id) });
  }, j = () => {
    b({ selectedRoleIds: [] });
  }, U = (a) => {
    b({ applicationFilter: a, moduleFilter: "all" });
  }, X = (a) => {
    b({ categoryFilter: a, selectedRoleIds: [] });
  }, B = r.selectedRoleIds.length > 0 || r.categoryFilter !== "all" || r.applicationFilter !== "all" || r.moduleFilter !== "all", K = r.selectedRoleIds.length === 0 ? o("permissions.filters.allRoles") : r.selectedRoleIds.length === 1 ? g.find((a) => a.id === r.selectedRoleIds[0])?.name || o("assignments.oneRoleSelected") : `${r.selectedRoleIds.length} ${o("permissions.filters.rolesSelected")}`;
  return /* @__PURE__ */ t("div", { className: "bg-[var(--bg-card)] border border-[var(--item-color-border)] rounded-[var(--radius-card)] p-4 space-y-4", children: [
    /* @__PURE__ */ t("div", { className: "flex items-center gap-2 text-sm font-medium text-[var(--text-secondary)]", children: [
      /* @__PURE__ */ e(Oe, { className: "h-4 w-4" }),
      /* @__PURE__ */ e("span", { children: o("assignments.filters") })
    ] }),
    /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-4", children: [
      /* @__PURE__ */ t("div", { className: "min-w-[160px] flex-1", children: [
        /* @__PURE__ */ e("label", { htmlFor: "category-filter", className: "block text-sm font-medium text-[var(--text-secondary)] mb-1", children: o("permissions.filters.selectCategory") }),
        /* @__PURE__ */ t(
          "select",
          {
            id: "category-filter",
            value: r.categoryFilter,
            onChange: (a) => X(a.target.value),
            className: "block w-full px-3 py-2 border border-[var(--border-color)] rounded-[var(--radius-input)] leading-5 bg-[var(--bg-primary)] text-[var(--text-primary)] focus:outline-none focus:ring-2 focus:ring-[var(--color-accent-500)] focus:border-[var(--color-accent-500)] sm:text-sm",
            children: [
              /* @__PURE__ */ e("option", { value: "all", children: o("permissions.filters.allCategories") }),
              O.map((a) => /* @__PURE__ */ e("option", { value: a, children: o(`roles.categories.${a.toLowerCase()}`) }, a))
            ]
          }
        )
      ] }),
      /* @__PURE__ */ t("div", { ref: y, className: "relative min-w-[200px] flex-[2]", children: [
        /* @__PURE__ */ e("label", { className: "block text-sm font-medium text-[var(--text-secondary)] mb-1", children: o("permissions.filters.selectRoles") }),
        /* @__PURE__ */ t(
          "button",
          {
            type: "button",
            onClick: () => d(!x),
            className: "w-full flex items-center justify-between px-3 py-2 border border-[var(--border-color)] rounded-[var(--radius-input)] bg-[var(--bg-primary)] text-[var(--text-primary)] hover:bg-[var(--bg-secondary)] focus:outline-none focus:ring-2 focus:ring-[var(--color-accent-500)] focus:border-[var(--color-accent-500)] text-sm",
            children: [
              /* @__PURE__ */ e("span", { className: "truncate", children: K }),
              /* @__PURE__ */ e(ne, { className: `h-4 w-4 text-[var(--text-muted)] transition-transform ${x ? "rotate-180" : ""}` })
            ]
          }
        ),
        x && /* @__PURE__ */ t("div", { className: "absolute z-50 mt-1 w-full bg-[var(--bg-card)] border border-[var(--border-color)] rounded-[var(--radius-card)] shadow-lg", children: [
          /* @__PURE__ */ e("div", { className: "px-3 py-2 border-b border-[var(--border-color)]", children: /* @__PURE__ */ t("div", { className: "relative", children: [
            /* @__PURE__ */ e("div", { className: "absolute inset-y-0 left-0 pl-2 flex items-center pointer-events-none", children: /* @__PURE__ */ e(Ee, { className: "h-4 w-4 text-[var(--text-muted)]" }) }),
            /* @__PURE__ */ e(
              "input",
              {
                ref: N,
                type: "text",
                value: T,
                onChange: (a) => v(a.target.value),
                placeholder: o("permissions.filters.searchRoles"),
                className: "block w-full pl-8 pr-3 py-1.5 text-sm border border-[var(--border-color)] rounded-[var(--radius-input)] bg-[var(--bg-primary)] text-[var(--text-primary)] placeholder-[var(--text-muted)] focus:outline-none focus:ring-1 focus:ring-[var(--color-accent-500)] focus:border-[var(--color-accent-500)]"
              }
            )
          ] }) }),
          /* @__PURE__ */ t("div", { className: "flex items-center justify-between px-3 py-2 border-b border-[var(--border-color)] bg-[var(--bg-secondary)]", children: [
            /* @__PURE__ */ e(
              "button",
              {
                type: "button",
                onClick: D,
                className: "text-xs text-[var(--color-accent-600)] hover:text-[var(--color-accent-700)]",
                children: o("permissions.filters.selectAll")
              }
            ),
            /* @__PURE__ */ e(
              "button",
              {
                type: "button",
                onClick: j,
                className: "text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)]",
                children: o("permissions.filters.clearSelection")
              }
            )
          ] }),
          /* @__PURE__ */ e("div", { className: "max-h-64 overflow-auto", children: A.length === 0 ? /* @__PURE__ */ e("div", { className: "px-3 py-4 text-sm text-[var(--text-muted)] text-center", children: o("permissions.filters.noRolesFound") }) : A.map((a) => /* @__PURE__ */ t(
            "button",
            {
              type: "button",
              onClick: () => $(a.id),
              className: "w-full flex items-center gap-3 px-3 py-2 hover:bg-[var(--bg-secondary)] cursor-pointer text-left",
              children: [
                /* @__PURE__ */ e("div", { className: `w-4 h-4 rounded border flex items-center justify-center flex-shrink-0 ${r.selectedRoleIds.includes(a.id) ? "bg-[var(--color-accent-600)] border-[var(--color-accent-600)]" : "border-[var(--border-color)] bg-[var(--bg-primary)]"}`, children: r.selectedRoleIds.includes(a.id) && /* @__PURE__ */ e(de, { className: "h-3 w-3 text-white" }) }),
                /* @__PURE__ */ e("span", { className: "text-sm text-[var(--text-primary)] truncate", children: a.name }),
                a.isSystem && /* @__PURE__ */ e("span", { className: "text-xs px-1.5 py-0.5 rounded bg-[var(--bg-tertiary)] text-[var(--text-muted)] flex-shrink-0", children: o("assignments.systemRole") })
              ]
            },
            a.id
          )) })
        ] })
      ] }),
      /* @__PURE__ */ t("div", { className: "min-w-[160px] flex-1", children: [
        /* @__PURE__ */ e("label", { htmlFor: "application-filter", className: "block text-sm font-medium text-[var(--text-secondary)] mb-1", children: o("assignments.filterByApplication") }),
        /* @__PURE__ */ t(
          "select",
          {
            id: "application-filter",
            value: r.applicationFilter,
            onChange: (a) => U(a.target.value),
            disabled: R.length === 0,
            className: "block w-full px-3 py-2 border border-[var(--border-color)] rounded-[var(--radius-input)] leading-5 bg-[var(--bg-primary)] text-[var(--text-primary)] focus:outline-none focus:ring-2 focus:ring-[var(--color-accent-500)] focus:border-[var(--color-accent-500)] sm:text-sm disabled:opacity-50 disabled:cursor-not-allowed",
            children: [
              /* @__PURE__ */ e("option", { value: "all", children: o("assignments.allApplications") }),
              R.map((a) => /* @__PURE__ */ e("option", { value: a.app, children: a.label }, a.app))
            ]
          }
        )
      ] }),
      /* @__PURE__ */ t("div", { className: "min-w-[160px] flex-1", children: [
        /* @__PURE__ */ e("label", { htmlFor: "module-filter", className: "block text-sm font-medium text-[var(--text-secondary)] mb-1", children: o("permissions.filters.selectModule") }),
        /* @__PURE__ */ t(
          "select",
          {
            id: "module-filter",
            value: r.moduleFilter,
            onChange: (a) => b({ moduleFilter: a.target.value }),
            disabled: L.length === 0,
            className: "block w-full px-3 py-2 border border-[var(--border-color)] rounded-[var(--radius-input)] leading-5 bg-[var(--bg-primary)] text-[var(--text-primary)] focus:outline-none focus:ring-2 focus:ring-[var(--color-accent-500)] focus:border-[var(--color-accent-500)] sm:text-sm disabled:opacity-50 disabled:cursor-not-allowed",
            children: [
              /* @__PURE__ */ e("option", { value: "all", children: o("permissions.filters.allModules") }),
              L.map((a) => /* @__PURE__ */ e("option", { value: a.module, children: a.label }, `${a.app}:${a.module}`))
            ]
          }
        )
      ] }),
      /* @__PURE__ */ e("div", { className: "flex items-end flex-shrink-0", children: B && /* @__PURE__ */ t(
        "button",
        {
          type: "button",
          onClick: _,
          className: "w-full inline-flex items-center justify-center gap-2 px-3 py-2 text-sm text-[var(--text-secondary)] hover:text-[var(--text-primary)] border border-[var(--border-color)] rounded-[var(--radius-input)] hover:bg-[var(--bg-secondary)] transition-colors",
          children: [
            /* @__PURE__ */ e(Le, { className: "h-4 w-4" }),
            o("assignments.clearFilters")
          ]
        }
      ) })
    ] }),
    r.selectedRoleIds.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: r.selectedRoleIds.map((a) => {
      const u = g.find((I) => I.id === a);
      return u ? /* @__PURE__ */ t(
        "span",
        {
          className: "inline-flex items-center gap-1 px-2 py-1 text-xs rounded-full bg-[var(--color-accent-100)] text-[var(--color-accent-700)] dark:bg-[var(--color-accent-900)] dark:text-[var(--color-accent-300)]",
          children: [
            u.name,
            /* @__PURE__ */ e(
              "button",
              {
                type: "button",
                onClick: () => $(a),
                className: "hover:text-[var(--color-accent-900)] dark:hover:text-[var(--color-accent-100)]",
                children: /* @__PURE__ */ e(je, { className: "h-3 w-3" })
              }
            )
          ]
        },
        a
      ) : null;
    }) }),
    P && /* @__PURE__ */ e("div", { className: "flex items-center justify-end pt-2 border-t border-[var(--border-color)]", children: /* @__PURE__ */ e("div", { className: "text-sm text-[var(--warning-text)]", children: o("assignments.unsavedChanges") }) })
  ] });
}
const ye = {
  viewer: {
    nameKey: "assignments.templates.viewer.name",
    descriptionKey: "assignments.templates.viewer.description",
    icon: me,
    color: "blue",
    permissions: ["*.read"]
  },
  member: {
    nameKey: "assignments.templates.member.name",
    descriptionKey: "assignments.templates.member.description",
    icon: Ge,
    color: "green",
    permissions: ["*.read", "*.create"]
  },
  contributor: {
    nameKey: "assignments.templates.contributor.name",
    descriptionKey: "assignments.templates.contributor.description",
    icon: ze,
    color: "orange",
    permissions: ["*.read", "*.create", "*.update"]
  },
  admin: {
    nameKey: "assignments.templates.admin.name",
    descriptionKey: "assignments.templates.admin.description",
    icon: Ke,
    color: "red",
    permissions: ["*.*"]
  }
}, at = [10, 25, 50], nt = [10, 15, 20, 25];
function ut() {
  const { t: r } = ue("admin"), { user: g } = Ue(), [O, R] = C(!1), [E, P] = C(null), [b, _] = C(25), [o, x] = C(1), [M, T] = C(10), [v, y] = C(0), [N, A] = C(/* @__PURE__ */ new Set()), [d, L] = C(/* @__PURE__ */ new Set()), [$, D] = C(!1), j = (n) => {
    L((m) => {
      const c = new Set(m);
      return c.has(n) ? c.delete(n) : c.add(n), c;
    }), x(1), y(0);
  }, U = (n) => {
    A((m) => {
      const c = new Set(m);
      return c.has(n) ? c.delete(n) : c.add(n), c;
    });
  }, X = F(() => g ? Xe(g.permissions) : !1, [g]), {
    loading: B,
    error: K,
    saveError: a,
    saving: u,
    roles: I,
    assignments: J,
    filters: V,
    filteredRoles: z,
    filteredResources: G,
    hasChanges: Y,
    applications: ee,
    modules: le,
    categories: oe,
    togglePermission: te,
    updateFilters: s,
    reloadData: l,
    resetChanges: i,
    clearSaveError: p,
    getPermissionInheritance: w
  } = Ze({ canEditSystemRoles: X }), k = W(
    (n, m) => {
      const c = m.permissions.filter((Pe) => {
        const pe = w(n, Pe.id);
        return pe.isDirect || pe.isInherited;
      }), H = c.length, Fe = m.totalPermissions;
      return H === 0 ? "none" : H === Fe ? "all" : H === 1 && c[0]?.action === "read" ? "read-only" : "some";
    },
    [w]
  ), h = F(
    () => G.filter((n) => n.level === "module"),
    [G]
  ), S = F(() => d.size === 0 ? z : z.filter((n) => {
    for (const m of h) {
      const c = k(n.id, m);
      if (d.has(c))
        return !0;
    }
    return !1;
  }), [z, h, d, k]), f = F(() => d.size === 0 ? G : G.filter((n) => {
    if (n.level !== "module") return !0;
    for (const m of z) {
      const c = k(m.id, n);
      if (d.has(c))
        return !0;
    }
    return !1;
  }), [G, z, d, k]), Q = F(() => {
    let n = 0;
    return Object.values(J).forEach((m) => {
      n += m.size;
    }), n;
  }, [J]), Z = F(() => f.filter((n) => !(n.level !== "module" || N.has(n.applicationLabel))).length, [f, N]), re = F(() => f.filter((n) => n.level === "module").length, [f]), q = Math.ceil(Z / b), we = (n) => {
    x(1), s(n);
  }, ke = (n) => {
    _(n), x(1);
  }, se = Math.ceil(S.length / M), Ce = (n) => {
    T(n), y(0);
  }, Re = async (n) => {
    const m = ye[n];
    if (!m) return;
    const c = prompt(r("assignments.enterRoleName"), r(m.nameKey));
    if (c)
      try {
        P(null), await He.roles.create({
          name: c,
          description: r(m.descriptionKey),
          permissionIds: []
        }), R(!1), await l();
      } catch (H) {
        P(H instanceof Error ? H.message : "Failed to create role from template");
      }
  }, Se = () => {
    x(1), s({
      selectedRoleIds: [],
      resourceSearch: "",
      applicationFilter: "all",
      moduleFilter: "all"
    });
  };
  return B ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ t("div", { className: "text-center", children: [
    /* @__PURE__ */ e(ge, { className: "h-8 w-8 animate-spin text-[var(--color-accent-500)] mx-auto mb-4" }),
    /* @__PURE__ */ e("p", { className: "text-[var(--text-secondary)]", children: r("assignments.loading") })
  ] }) }) : K ? /* @__PURE__ */ e("div", { className: "p-6", children: /* @__PURE__ */ e("div", { className: "rounded-[var(--radius-card)] bg-[var(--error-bg)] border border-[var(--error-border)] p-4", children: /* @__PURE__ */ t("div", { className: "flex", children: [
    /* @__PURE__ */ e(ie, { className: "h-5 w-5 text-[var(--error-text)]" }),
    /* @__PURE__ */ t("div", { className: "ml-3", children: [
      /* @__PURE__ */ e("h3", { className: "text-sm font-medium text-[var(--error-text)]", children: r("common.error") }),
      /* @__PURE__ */ e("div", { className: "mt-2 text-sm text-[var(--error-text)] opacity-80", children: /* @__PURE__ */ e("p", { children: K }) })
    ] })
  ] }) }) }) : /* @__PURE__ */ t("div", { className: "p-6 space-y-4", children: [
    /* @__PURE__ */ e(
      qe,
      {
        items: [
          { label: r("header.title"), href: "/administration" },
          { label: r("assignments.title", "Assignments") }
        ]
      }
    ),
    /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
      /* @__PURE__ */ t("div", { children: [
        /* @__PURE__ */ e("h1", { className: "text-2xl font-bold text-[var(--text-primary)]", children: r("assignments.title") }),
        /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-[var(--text-secondary)]", children: r("assignments.subtitle") })
      ] }),
      /* @__PURE__ */ e("div", { className: "flex items-center gap-3 flex-shrink-0", children: /* @__PURE__ */ t(
        "button",
        {
          type: "button",
          onClick: () => R(!0),
          className: "inline-flex items-center px-4 py-2 border border-[var(--border-color)] text-sm font-medium rounded-[var(--radius-button)] text-[var(--text-secondary)] bg-[var(--bg-card)] hover:bg-[var(--bg-hover)] transition-colors",
          children: [
            /* @__PURE__ */ e(_e, { className: "h-4 w-4 mr-2" }),
            r("assignments.createFromTemplate")
          ]
        }
      ) })
    ] }),
    a && /* @__PURE__ */ e("div", { className: "rounded-[var(--radius-card)] bg-[var(--error-bg)] p-3 border border-[var(--error-border)]", children: /* @__PURE__ */ t("div", { className: "flex items-center", children: [
      /* @__PURE__ */ e(ie, { className: "h-4 w-4 text-[var(--error-text)]" }),
      /* @__PURE__ */ e("p", { className: "ml-2 text-sm text-[var(--error-text)]", children: a }),
      /* @__PURE__ */ e(
        "button",
        {
          type: "button",
          onClick: p,
          className: "ml-auto text-sm text-[var(--error-text)] hover:opacity-80 font-medium",
          children: r("common.dismiss")
        }
      )
    ] }) }),
    (Y || u) && /* @__PURE__ */ e("div", { className: "rounded-[var(--radius-card)] bg-[var(--warning-bg)] p-3 border border-[var(--warning-border)]", children: /* @__PURE__ */ t("div", { className: "flex items-center", children: [
      u ? /* @__PURE__ */ e(ge, { className: "h-4 w-4 text-[var(--warning-dot)] animate-spin" }) : /* @__PURE__ */ e(De, { className: "h-4 w-4 text-[var(--warning-dot)]" }),
      /* @__PURE__ */ e("p", { className: "ml-2 text-sm text-[var(--warning-text)]", children: r(u ? "assignments.saving" : "assignments.autoSaveActive") }),
      !u && /* @__PURE__ */ e(
        "button",
        {
          type: "button",
          onClick: i,
          className: "ml-auto text-sm text-[var(--warning-text)] hover:opacity-80 font-medium",
          children: r("assignments.discardChanges")
        }
      )
    ] }) }),
    /* @__PURE__ */ e(
      st,
      {
        filters: V,
        roles: I,
        categories: oe,
        applications: ee,
        modules: le,
        hasChanges: Y,
        onFilterChange: we,
        onReset: Se
      }
    ),
    /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center justify-between gap-3 py-2", children: [
      /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-4", children: [
        /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-3", children: [
          /* @__PURE__ */ t("span", { className: "px-2.5 py-1 text-xs font-semibold rounded-full bg-[var(--color-accent-100)] text-[var(--color-accent-700)] dark:bg-[var(--color-accent-900)] dark:text-[var(--color-accent-300)]", children: [
            S.length,
            " ",
            r("assignments.roles")
          ] }),
          /* @__PURE__ */ t("span", { className: "px-2.5 py-1 text-xs font-semibold rounded-full bg-[var(--bg-tertiary)] text-[var(--text-secondary)]", children: [
            Z,
            "/",
            re,
            " ",
            r("assignments.modules")
          ] }),
          /* @__PURE__ */ t("span", { className: "px-2.5 py-1 text-xs font-semibold rounded-full bg-[var(--success-bg)] text-[var(--success-text)] border border-[var(--success-border)]", children: [
            Q,
            " ",
            r("assignments.permissionsAssigned")
          ] })
        ] }),
        /* @__PURE__ */ t("div", { className: "flex items-center gap-2 text-sm text-[var(--text-secondary)] border-l border-[var(--border-color)] pl-4", children: [
          /* @__PURE__ */ t("span", { children: [
            r("assignments.rolesPerPage"),
            ":"
          ] }),
          /* @__PURE__ */ e(
            "select",
            {
              value: M,
              onChange: (n) => Ce(Number(n.target.value)),
              className: "px-2 py-1 text-sm bg-[var(--bg-secondary)] border border-[var(--border-color)] rounded text-[var(--text-primary)] focus:outline-none focus:ring-1 focus:ring-[var(--color-accent-500)]",
              children: nt.map((n) => /* @__PURE__ */ e("option", { value: n, children: n }, n))
            }
          ),
          /* @__PURE__ */ t("span", { className: "text-[var(--text-muted)]", children: [
            v * M + 1,
            "-",
            Math.min((v + 1) * M, S.length),
            " / ",
            S.length
          ] }),
          se > 1 && /* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: [
            /* @__PURE__ */ e(
              "button",
              {
                onClick: () => y((n) => Math.max(0, n - 1)),
                disabled: v === 0,
                className: "p-1 rounded border border-[var(--border-color)] bg-[var(--bg-secondary)] hover:bg-[var(--bg-hover)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",
                children: /* @__PURE__ */ e(be, { className: "h-3.5 w-3.5" })
              }
            ),
            /* @__PURE__ */ t("span", { className: "text-xs min-w-[50px] text-center", children: [
              v + 1,
              " / ",
              se
            ] }),
            /* @__PURE__ */ e(
              "button",
              {
                onClick: () => y((n) => Math.min(se - 1, n + 1)),
                disabled: v >= se - 1,
                className: "p-1 rounded border border-[var(--border-color)] bg-[var(--bg-secondary)] hover:bg-[var(--bg-hover)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",
                children: /* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5" })
              }
            )
          ] })
        ] })
      ] }),
      /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2", children: [
        /* @__PURE__ */ t(
          "button",
          {
            onClick: () => j("none"),
            className: `inline-flex items-center gap-1.5 px-2.5 py-1 text-xs rounded-full border transition-colors cursor-pointer ${d.has("none") ? "bg-red-500/30 border-red-500 text-red-700 dark:text-red-300" : "bg-red-500/10 border-red-500/30 text-red-600 dark:text-red-400 hover:bg-red-500/20 hover:border-red-500"}`,
            children: [
              /* @__PURE__ */ e(ve, { className: "h-3.5 w-3.5" }),
              r("assignments.none")
            ]
          }
        ),
        /* @__PURE__ */ t(
          "button",
          {
            onClick: () => j("read-only"),
            className: `inline-flex items-center gap-1.5 px-2.5 py-1 text-xs rounded-full border transition-colors cursor-pointer ${d.has("read-only") ? "bg-sky-500/30 border-sky-500 text-sky-700 dark:text-sky-300" : "bg-sky-500/10 border-sky-500/30 text-sky-600 dark:text-sky-400 hover:bg-sky-500/20 hover:border-sky-500"}`,
            children: [
              /* @__PURE__ */ e(me, { className: "h-3.5 w-3.5" }),
              r("assignments.readOnly")
            ]
          }
        ),
        /* @__PURE__ */ t(
          "button",
          {
            onClick: () => j("some"),
            className: `inline-flex items-center gap-1.5 px-2.5 py-1 text-xs rounded-full border transition-colors cursor-pointer ${d.has("some") ? "bg-amber-500/30 border-amber-500 text-amber-700 dark:text-amber-300" : "bg-amber-500/10 border-amber-500/30 text-amber-600 dark:text-amber-400 hover:bg-amber-500/20 hover:border-amber-500"}`,
            children: [
              /* @__PURE__ */ e(fe, { className: "h-3.5 w-3.5" }),
              r("assignments.partial")
            ]
          }
        ),
        /* @__PURE__ */ t(
          "button",
          {
            onClick: () => j("all"),
            className: `inline-flex items-center gap-1.5 px-2.5 py-1 text-xs rounded-full border transition-colors cursor-pointer ${d.has("all") ? "bg-emerald-500/30 border-emerald-500 text-emerald-700 dark:text-emerald-300" : "bg-emerald-500/10 border-emerald-500/30 text-emerald-600 dark:text-emerald-400 hover:bg-emerald-500/20 hover:border-emerald-500"}`,
            children: [
              /* @__PURE__ */ e(de, { className: "h-3.5 w-3.5" }),
              r("assignments.complete")
            ]
          }
        ),
        d.size > 0 && /* @__PURE__ */ e(
          "button",
          {
            onClick: () => L(/* @__PURE__ */ new Set()),
            className: "text-xs text-[var(--color-accent-500)] hover:text-[var(--color-accent-600)] underline ml-2",
            children: r("assignments.clearFilters")
          }
        )
      ] })
    ] }),
    /* @__PURE__ */ t("div", { className: "bg-[var(--bg-card)] border border-[var(--item-color-border)] rounded-[var(--radius-card)] overflow-hidden", children: [
      /* @__PURE__ */ t(
        "button",
        {
          type: "button",
          onClick: () => D(!$),
          className: "w-full flex items-center justify-between px-4 py-2.5 text-sm font-medium text-[var(--text-secondary)] hover:bg-[var(--bg-hover)] transition-colors",
          children: [
            /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
              /* @__PURE__ */ e(Be, { className: "h-4 w-4 text-[var(--color-accent-500)]" }),
              /* @__PURE__ */ e("span", { children: r("assignments.guide.title") })
            ] }),
            $ ? /* @__PURE__ */ e(We, { className: "h-4 w-4 text-[var(--text-muted)]" }) : /* @__PURE__ */ e(ne, { className: "h-4 w-4 text-[var(--text-muted)]" })
          ]
        }
      ),
      $ && /* @__PURE__ */ e("div", { className: "px-4 pb-4 border-t border-[var(--item-color-border)]", children: /* @__PURE__ */ t("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 pt-3", children: [
        /* @__PURE__ */ t("div", { children: [
          /* @__PURE__ */ e("h4", { className: "text-xs font-semibold text-[var(--text-primary)] uppercase tracking-wider mb-2", children: r("assignments.guide.colorLegendTitle") }),
          /* @__PURE__ */ t("div", { className: "space-y-1.5", children: [
            /* @__PURE__ */ t("div", { className: "flex items-center gap-2 text-xs", children: [
              /* @__PURE__ */ e("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-red-500/10 border border-red-500/20 text-red-600 dark:text-red-400", children: /* @__PURE__ */ e(ve, { className: "h-3 w-3" }) }),
              /* @__PURE__ */ e("span", { className: "text-[var(--text-secondary)]", children: r("assignments.guide.noneDesc") })
            ] }),
            /* @__PURE__ */ t("div", { className: "flex items-center gap-2 text-xs", children: [
              /* @__PURE__ */ e("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-sky-500/20 border border-sky-500/30 text-sky-700 dark:text-sky-300", children: /* @__PURE__ */ e(me, { className: "h-3 w-3" }) }),
              /* @__PURE__ */ e("span", { className: "text-[var(--text-secondary)]", children: r("assignments.guide.readOnlyDesc") })
            ] }),
            /* @__PURE__ */ t("div", { className: "flex items-center gap-2 text-xs", children: [
              /* @__PURE__ */ e("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-amber-500/20 border border-amber-500/30 text-amber-700 dark:text-amber-300", children: /* @__PURE__ */ e(fe, { className: "h-3 w-3" }) }),
              /* @__PURE__ */ e("span", { className: "text-[var(--text-secondary)]", children: r("assignments.guide.partialDesc") })
            ] }),
            /* @__PURE__ */ t("div", { className: "flex items-center gap-2 text-xs", children: [
              /* @__PURE__ */ e("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-emerald-500/20 border border-emerald-500/30 text-emerald-700 dark:text-emerald-300", children: /* @__PURE__ */ e(de, { className: "h-3 w-3" }) }),
              /* @__PURE__ */ e("span", { className: "text-[var(--text-secondary)]", children: r("assignments.guide.completeDesc") })
            ] })
          ] })
        ] }),
        /* @__PURE__ */ t("div", { children: [
          /* @__PURE__ */ e("h4", { className: "text-xs font-semibold text-[var(--text-primary)] uppercase tracking-wider mb-2", children: r("assignments.guide.howToUseTitle") }),
          /* @__PURE__ */ t("ul", { className: "space-y-1.5 text-xs text-[var(--text-secondary)]", children: [
            /* @__PURE__ */ t("li", { className: "flex items-start gap-2", children: [
              /* @__PURE__ */ e("span", { className: "text-[var(--color-accent-500)] mt-0.5", children: "•" }),
              r("assignments.guide.clickCell")
            ] }),
            /* @__PURE__ */ t("li", { className: "flex items-start gap-2", children: [
              /* @__PURE__ */ e(Ne, { className: "h-3 w-3 flex-shrink-0 mt-0.5 text-[var(--warning-dot)]" }),
              r("assignments.guide.systemRoles")
            ] }),
            /* @__PURE__ */ t("li", { className: "flex items-start gap-2", children: [
              /* @__PURE__ */ e("span", { className: "text-[var(--color-accent-500)] mt-0.5", children: "•" }),
              r("assignments.guide.inheritance")
            ] }),
            /* @__PURE__ */ t("li", { className: "flex items-start gap-2", children: [
              /* @__PURE__ */ e("span", { className: "text-[var(--color-accent-500)] mt-0.5", children: "•" }),
              r("assignments.guide.autoSave")
            ] }),
            /* @__PURE__ */ t("li", { className: "flex items-start gap-2", children: [
              /* @__PURE__ */ e("span", { className: "text-[var(--color-accent-500)] mt-0.5", children: "•" }),
              r("assignments.guide.filterButtons")
            ] })
          ] })
        ] })
      ] }) })
    ] }),
    /* @__PURE__ */ e("div", { className: "bg-[var(--bg-card)] shadow-[var(--shadow-md)] rounded-[var(--radius-card)] border border-[var(--item-color-border)]", children: /* @__PURE__ */ e(
      rt,
      {
        roles: S,
        resources: f,
        assignments: J,
        canEditSystemRoles: X,
        onTogglePermission: te,
        getPermissionInheritance: w,
        rolesPerPage: M,
        rolePageIndex: v,
        modulesPerPage: b,
        modulePageIndex: o - 1,
        collapsedApps: N,
        onToggleApp: U,
        statusFilters: d
      }
    ) }),
    /* @__PURE__ */ e("div", { className: "py-3 px-4 bg-[var(--bg-card)] rounded-[var(--radius-card)] border border-[var(--item-color-border)]", children: /* @__PURE__ */ t("div", { className: "flex items-center gap-3 text-sm text-[var(--text-secondary)]", children: [
      /* @__PURE__ */ t("span", { children: [
        r("assignments.itemsPerPage"),
        ":"
      ] }),
      /* @__PURE__ */ e(
        "select",
        {
          value: b,
          onChange: (n) => ke(Number(n.target.value)),
          className: "px-2 py-1 text-sm bg-[var(--bg-secondary)] border border-[var(--border-color)] rounded text-[var(--text-primary)] focus:outline-none focus:ring-1 focus:ring-[var(--color-accent-500)]",
          children: at.map((n) => /* @__PURE__ */ e("option", { value: n, children: n }, n))
        }
      ),
      /* @__PURE__ */ t("span", { className: "text-[var(--text-muted)]", children: [
        (o - 1) * b + 1,
        "-",
        Math.min(o * b, Z),
        " / ",
        Z
      ] }),
      q > 1 && /* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: [
        /* @__PURE__ */ e(
          "button",
          {
            onClick: () => x((n) => Math.max(1, n - 1)),
            disabled: o === 1,
            className: "p-1.5 rounded border border-[var(--border-color)] bg-[var(--bg-secondary)] hover:bg-[var(--bg-hover)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",
            children: /* @__PURE__ */ e(be, { className: "h-4 w-4" })
          }
        ),
        /* @__PURE__ */ t("span", { className: "text-sm min-w-[60px] text-center", children: [
          o,
          " / ",
          q
        ] }),
        /* @__PURE__ */ e(
          "button",
          {
            onClick: () => x((n) => Math.min(q, n + 1)),
            disabled: o >= q,
            className: "p-1.5 rounded border border-[var(--border-color)] bg-[var(--bg-secondary)] hover:bg-[var(--bg-hover)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",
            children: /* @__PURE__ */ e(ae, { className: "h-4 w-4" })
          }
        )
      ] })
    ] }) }),
    O && /* @__PURE__ */ e("div", { className: "fixed inset-0 z-50 overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "flex items-center justify-center min-h-screen px-4 pt-4 pb-20 text-center sm:p-0", children: [
      /* @__PURE__ */ e("button", { type: "button", className: "fixed inset-0 bg-black/50 transition-opacity", onClick: () => R(!1), "aria-label": "Close modal" }),
      /* @__PURE__ */ t("div", { className: "inline-block align-bottom bg-[var(--bg-card)] rounded-[var(--radius-modal)] px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-2xl sm:w-full sm:p-6 border border-[var(--border-color)]", children: [
        /* @__PURE__ */ t("div", { className: "mb-4", children: [
          /* @__PURE__ */ e("h3", { className: "text-lg font-medium text-[var(--text-primary)]", children: r("assignments.createFromTemplate") }),
          /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-[var(--text-secondary)]", children: r("assignments.templateDescription") })
        ] }),
        E && /* @__PURE__ */ e("div", { className: "mb-4 rounded-[var(--radius-card)] bg-[var(--error-bg)] border border-[var(--error-border)] p-3", children: /* @__PURE__ */ t("div", { className: "flex", children: [
          /* @__PURE__ */ e(ie, { className: "h-5 w-5 text-[var(--error-text)]" }),
          /* @__PURE__ */ e("div", { className: "ml-3", children: /* @__PURE__ */ e("p", { className: "text-sm text-[var(--error-text)]", children: E }) })
        ] }) }),
        /* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: Object.entries(ye).map(([n, m]) => {
          const c = m.icon;
          return /* @__PURE__ */ e(
            "button",
            {
              onClick: () => Re(n),
              className: "relative p-4 rounded-[var(--radius-card)] border-2 text-left transition-all hover:shadow-lg hover:scale-105 border-[var(--border-color)] hover:border-[var(--color-accent-500)]",
              children: /* @__PURE__ */ t("div", { className: "flex items-start gap-3", children: [
                /* @__PURE__ */ e(c, { className: "h-6 w-6 text-[var(--color-accent-500)]" }),
                /* @__PURE__ */ t("div", { className: "flex-1", children: [
                  /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-[var(--text-primary)]", children: r(m.nameKey) }),
                  /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-[var(--text-secondary)]", children: r(m.descriptionKey) })
                ] })
              ] })
            },
            n
          );
        }) }),
        /* @__PURE__ */ e("div", { className: "mt-5 sm:mt-6", children: /* @__PURE__ */ e(
          "button",
          {
            type: "button",
            onClick: () => {
              R(!1), P(null);
            },
            className: "w-full inline-flex justify-center rounded-[var(--radius-button)] border border-[var(--border-color)] shadow-sm px-4 py-2 bg-[var(--bg-secondary)] text-base font-medium text-[var(--text-secondary)] hover:bg-[var(--bg-hover)] transition-colors",
            children: r("common.cancel")
          }
        ) })
      ] })
    ] }) })
  ] });
}
export {
  ut as AssignmentsPage
};
//# sourceMappingURL=AssignmentsPage-sRCCBmRc.js.map
