import { D as ae, a as ie, b as ce, c as se, d as le, e as te, N as re, f as oe, g as de, h as ue, i as be, j as me, k as _e, l as he, m as pe, n as Ne, o as ve, p as ke, q as ye, r as fe, s as ge, t as $e, u as xe, v as we, w as Me, x as Ce, y as De, z as Se, A as Ee, B as Ie, C as Te, E as Ae, F as Pe, G as Be, H as Le, I as Re, J as We, K as Ke, L as Oe, M as Fe, O as He, P as je, Q as ze, S as Ue } from "./NiceModuleLifecyclePanel-BDnsr5ZW.js";
import { jsx as e, jsxs as o } from "react/jsx-runtime";
import { k as E, _ as I, $ as W } from "./core-BIA5_uSq.js";
import { forwardRef as T, useState as P, useCallback as B, useEffect as z } from "react";
import { f as qe } from "./NiceTabs-Blk0h4jY.js";
import { N as Qe } from "./NicePagination-B4U0LwZy.js";
const U = T(
  ({
    items: b,
    activeKey: m,
    collapsed: c = !1,
    width: p = 240,
    collapsedWidth: l = 52,
    onItemClick: v,
    onCollapseChange: C,
    header: k,
    footer: d,
    size: _ = "md",
    className: g,
    style: $,
    id: y,
    accessMode: x,
    ...w
  }, N) => {
    const i = E(y), r = I(x, y), [s, u] = P(/* @__PURE__ */ new Set()), t = B((n) => {
      u((D) => {
        const a = new Set(D);
        return a.has(n) ? a.delete(n) : a.add(n), a;
      });
    }, []);
    if (r === "hidden")
      return null;
    const h = (n, D = 0) => {
      const a = n.children && n.children.length > 0, A = s.has(n.key), M = n.key === m;
      return /* @__PURE__ */ o("li", { className: "nice-sidebar-menu__item", children: [
        /* @__PURE__ */ o(
          "button",
          {
            className: `nice-sidebar-menu__btn ${M ? "nice-sidebar-menu__btn--active" : ""} ${n.disabled ? "nice-sidebar-menu__btn--disabled" : ""}`,
            style: { paddingLeft: c ? void 0 : 12 + D * 16 },
            onClick: () => a ? t(n.key) : v?.(n),
            disabled: n.disabled,
            title: c ? n.text : void 0,
            type: "button",
            children: [
              n.icon && /* @__PURE__ */ e("span", { className: "nice-sidebar-menu__icon", children: n.icon }),
              !c && /* @__PURE__ */ e("span", { className: "nice-sidebar-menu__label", children: n.text }),
              !c && n.badge !== void 0 && /* @__PURE__ */ e("span", { className: "nice-sidebar-menu__badge", children: n.badge }),
              !c && a && /* @__PURE__ */ e("span", { className: "nice-sidebar-menu__chevron", children: A ? "▾" : "▸" })
            ]
          }
        ),
        a && A && !c && /* @__PURE__ */ e("ul", { className: "nice-sidebar-menu__children", children: n.children.map((S) => h(S, D + 1)) })
      ] }, n.key);
    };
    return /* @__PURE__ */ o(
      "nav",
      {
        ref: N,
        id: i,
        className: `nice-sidebar-menu nice-sidebar-menu--${_} ${c ? "nice-sidebar-menu--collapsed" : ""} ${g ?? ""}`,
        style: { ...$, width: c ? l : p },
        ...w,
        children: [
          k && /* @__PURE__ */ e("div", { className: "nice-sidebar-menu__header", children: k }),
          /* @__PURE__ */ e("ul", { className: "nice-sidebar-menu__list", role: "list", children: b.map((n) => h(n)) }),
          d && /* @__PURE__ */ e("div", { className: "nice-sidebar-menu__footer", children: d })
        ]
      }
    );
  }
);
U.displayName = "NiceSidebarMenu";
const V = T(
  ({
    items: b,
    activeKey: m,
    onItemClick: c,
    brand: p,
    actions: l,
    size: v = "md",
    className: C,
    style: k,
    id: d,
    accessMode: _,
    ...g
  }, $) => {
    const y = E(d), x = I(_, d), [w, N] = P(null);
    return x === "hidden" ? null : /* @__PURE__ */ o(
      "nav",
      {
        ref: $,
        id: y,
        className: `nice-top-menu nice-top-menu--${v} ${C ?? ""}`,
        style: k,
        ...g,
        children: [
          p && /* @__PURE__ */ e("div", { className: "nice-top-menu__brand", children: p }),
          /* @__PURE__ */ e("ul", { className: "nice-top-menu__items", role: "menubar", children: b.map((i) => {
            const r = i.children && i.children.length > 0, s = w === i.key;
            return /* @__PURE__ */ o(
              "li",
              {
                className: "nice-top-menu__item",
                onMouseEnter: () => r && N(i.key),
                onMouseLeave: () => r && N(null),
                children: [
                  /* @__PURE__ */ o(
                    "button",
                    {
                      className: `nice-top-menu__btn ${i.key === m ? "nice-top-menu__btn--active" : ""}`,
                      onClick: () => r ? N(s ? null : i.key) : c?.(i),
                      role: "menuitem",
                      "aria-haspopup": r,
                      "aria-expanded": s,
                      disabled: i.disabled,
                      type: "button",
                      children: [
                        i.icon && /* @__PURE__ */ e("span", { children: i.icon }),
                        /* @__PURE__ */ e("span", { children: i.text }),
                        r && /* @__PURE__ */ e("span", { className: "nice-top-menu__chevron", children: "▾" })
                      ]
                    }
                  ),
                  r && s && /* @__PURE__ */ e("ul", { className: "nice-top-menu__dropdown", role: "menu", children: i.children.map((u) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(
                    "button",
                    {
                      className: `nice-top-menu__dropdown-btn ${u.key === m ? "nice-top-menu__dropdown-btn--active" : ""}`,
                      onClick: () => {
                        c?.(u), N(null);
                      },
                      disabled: u.disabled,
                      role: "menuitem",
                      type: "button",
                      children: [
                        u.icon && /* @__PURE__ */ e("span", { children: u.icon }),
                        /* @__PURE__ */ e("span", { children: u.text }),
                        u.badge !== void 0 && /* @__PURE__ */ e("span", { className: "nice-top-menu__badge", children: u.badge })
                      ]
                    }
                  ) }, u.key)) })
                ]
              },
              i.key
            );
          }) }),
          l && /* @__PURE__ */ e("div", { className: "nice-top-menu__actions", children: l })
        ]
      }
    );
  }
);
V.displayName = "NiceTopMenu";
const q = T(
  ({
    tabs: b,
    activeTab: m,
    onTabChange: c,
    onItemClick: p,
    minimized: l = !1,
    onMinimizeToggle: v,
    size: C = "md",
    className: k,
    style: d,
    id: _,
    accessMode: g,
    ...$
  }, y) => {
    const x = E(_), w = I(g, _), [N, i] = P(m ?? b[0]?.key), r = m ?? N, s = b.find((t) => t.key === r), u = B(
      (t) => {
        i(t), c?.(t);
      },
      [c]
    );
    return w === "hidden" ? null : /* @__PURE__ */ o(
      "div",
      {
        ref: y,
        id: x,
        className: `nice-ribbon-menu nice-ribbon-menu--${C} ${l ? "nice-ribbon-menu--minimized" : ""} ${k ?? ""}`,
        style: d,
        ...$,
        children: [
          /* @__PURE__ */ o("div", { className: "nice-ribbon-menu__tabs", role: "tablist", children: [
            b.map((t) => /* @__PURE__ */ e(
              "button",
              {
                className: `nice-ribbon-menu__tab ${t.key === r ? "nice-ribbon-menu__tab--active" : ""}`,
                onClick: () => u(t.key),
                role: "tab",
                "aria-selected": t.key === r,
                type: "button",
                children: t.label
              },
              t.key
            )),
            /* @__PURE__ */ e(
              "button",
              {
                className: "nice-ribbon-menu__minimize",
                onClick: () => v?.(!l),
                type: "button",
                "aria-label": l ? "Expand" : "Minimize",
                children: l ? "▼" : "▲"
              }
            )
          ] }),
          !l && s && /* @__PURE__ */ e("div", { className: "nice-ribbon-menu__panel", role: "tabpanel", children: s.groups.map((t, h) => /* @__PURE__ */ o("div", { className: "nice-ribbon-menu__group", children: [
            /* @__PURE__ */ e("div", { className: "nice-ribbon-menu__group-items", children: t.items.map((n) => /* @__PURE__ */ o(
              "button",
              {
                className: "nice-ribbon-menu__item",
                onClick: () => p?.(n),
                disabled: n.disabled,
                type: "button",
                children: [
                  n.icon && /* @__PURE__ */ e("span", { className: "nice-ribbon-menu__item-icon", children: n.icon }),
                  /* @__PURE__ */ e("span", { className: "nice-ribbon-menu__item-label", children: n.text })
                ]
              },
              n.key
            )) }),
            /* @__PURE__ */ e("div", { className: "nice-ribbon-menu__group-label", children: t.label })
          ] }, h)) })
        ]
      }
    );
  }
);
q.displayName = "NiceRibbonMenu";
const J = T(
  ({
    items: b,
    activeKey: m,
    onItemClick: c,
    position: p = "bottom",
    autoHide: l = !1,
    iconSize: v = 40,
    size: C = "md",
    className: k,
    style: d,
    id: _,
    accessMode: g,
    ...$
  }, y) => {
    const x = E(_), w = I(g, _), [N, i] = P(!1), r = !l || N;
    return w === "hidden" ? null : /* @__PURE__ */ e(
      "div",
      {
        ref: y,
        id: x,
        className: `nice-dock-menu nice-dock-menu--${p} nice-dock-menu--${C} ${l && !r ? "nice-dock-menu--hidden" : ""} ${k ?? ""}`,
        style: d,
        onMouseEnter: () => i(!0),
        onMouseLeave: () => i(!1),
        ...$,
        children: /* @__PURE__ */ e("div", { className: "nice-dock-menu__items", children: b.map((s) => /* @__PURE__ */ o(
          "button",
          {
            className: `nice-dock-menu__item ${s.key === m ? "nice-dock-menu__item--active" : ""}`,
            onClick: () => c?.(s),
            disabled: s.disabled,
            title: s.text,
            type: "button",
            style: { width: v, height: v },
            children: [
              s.icon ? /* @__PURE__ */ e("span", { className: "nice-dock-menu__icon", children: s.icon }) : /* @__PURE__ */ e("span", { children: s.text[0] }),
              s.badge !== void 0 && /* @__PURE__ */ e("span", { className: "nice-dock-menu__badge", children: s.badge })
            ]
          },
          s.key
        )) })
      }
    );
  }
);
J.displayName = "NiceDockMenu";
const Q = T(
  ({
    items: b,
    activeKey: m,
    onItemClick: c,
    open: p,
    onOpenChange: l,
    position: v = "left",
    panelWidth: C = 280,
    header: k,
    footer: d,
    size: _ = "md",
    className: g,
    style: $,
    id: y,
    accessMode: x,
    ...w
  }, N) => {
    const i = E(y), r = I(x, y), { t: s } = W(), [u, t] = P(!1), h = p ?? u, n = B(() => {
      const a = !h;
      t(a), l?.(a);
    }, [h, l]), D = B(
      (a) => {
        c?.(a), t(!1), l?.(!1);
      },
      [c, l]
    );
    return r === "hidden" ? null : /* @__PURE__ */ o(
      "div",
      {
        ref: N,
        id: i,
        className: `nice-hamburger-menu nice-hamburger-menu--${_} ${g ?? ""}`,
        style: $,
        ...w,
        children: [
          /* @__PURE__ */ e(
            "button",
            {
              className: "nice-hamburger-menu__trigger",
              onClick: n,
              "aria-label": s("nav.menu", "Menu"),
              "aria-expanded": h,
              type: "button",
              children: /* @__PURE__ */ o(
                "span",
                {
                  className: `nice-hamburger-menu__icon ${h ? "nice-hamburger-menu__icon--open" : ""}`,
                  children: [
                    /* @__PURE__ */ e("span", {}),
                    /* @__PURE__ */ e("span", {}),
                    /* @__PURE__ */ e("span", {})
                  ]
                }
              )
            }
          ),
          h && /* @__PURE__ */ e("div", { className: "nice-hamburger-menu__backdrop", onClick: n, "aria-hidden": !0 }),
          /* @__PURE__ */ o(
            "div",
            {
              className: `nice-hamburger-menu__panel nice-hamburger-menu__panel--${v} ${h ? "nice-hamburger-menu__panel--open" : ""}`,
              style: { width: C },
              children: [
                k && /* @__PURE__ */ e("div", { className: "nice-hamburger-menu__header", children: k }),
                /* @__PURE__ */ e("ul", { className: "nice-hamburger-menu__list", role: "menu", children: b.map((a) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(
                  "button",
                  {
                    className: `nice-hamburger-menu__item ${a.key === m ? "nice-hamburger-menu__item--active" : ""}`,
                    onClick: () => D(a),
                    disabled: a.disabled,
                    role: "menuitem",
                    type: "button",
                    children: [
                      a.icon && /* @__PURE__ */ e("span", { className: "nice-hamburger-menu__item-icon", children: a.icon }),
                      /* @__PURE__ */ e("span", { children: a.text }),
                      a.badge !== void 0 && /* @__PURE__ */ e("span", { className: "nice-hamburger-menu__item-badge", children: a.badge })
                    ]
                  }
                ) }, a.key)) }),
                d && /* @__PURE__ */ e("div", { className: "nice-hamburger-menu__footer", children: d })
              ]
            }
          )
        ]
      }
    );
  }
);
Q.displayName = "NiceHamburgerMenu";
const X = T(
  ({
    canGoBack: b = !1,
    canGoForward: m = !1,
    onBack: c,
    onForward: p,
    onRefresh: l,
    enableShortcuts: v = !0,
    showRefresh: C = !0,
    showStop: k = !0,
    isLoading: d = !1,
    onStop: _,
    size: g = "md",
    variant: $ = "default",
    tooltipPosition: y = "bottom",
    backIcon: x,
    forwardIcon: w,
    refreshIcon: N,
    stopIcon: i,
    className: r,
    style: s,
    id: u,
    accessMode: t,
    disabled: h,
    ...n
  }, D) => {
    const a = E(u), A = I(t, u), { t: M } = W();
    if (z(() => {
      if (!v || h)
        return;
      const L = (f) => {
        const R = f.altKey, j = f.ctrlKey || f.metaKey;
        R && f.key === "ArrowLeft" ? (f.preventDefault(), b && c?.()) : R && f.key === "ArrowRight" ? (f.preventDefault(), m && p?.()) : f.key === "F5" || j && f.key === "r" ? (f.preventDefault(), d ? _?.() : l?.()) : f.key === "Escape" && d && (f.preventDefault(), _?.());
      };
      return window.addEventListener("keydown", L), () => window.removeEventListener("keydown", L);
    }, [
      v,
      h,
      b,
      m,
      d,
      c,
      p,
      l,
      _
    ]), A === "hidden")
      return null;
    const S = A === "disabled" || h, K = x ?? /* @__PURE__ */ e(
      "svg",
      {
        width: "16",
        height: "16",
        viewBox: "0 0 24 24",
        fill: "none",
        stroke: "currentColor",
        strokeWidth: "2",
        children: /* @__PURE__ */ e("polyline", { points: "15 18 9 12 15 6" })
      }
    ), O = w ?? /* @__PURE__ */ e(
      "svg",
      {
        width: "16",
        height: "16",
        viewBox: "0 0 24 24",
        fill: "none",
        stroke: "currentColor",
        strokeWidth: "2",
        children: /* @__PURE__ */ e("polyline", { points: "9 18 15 12 9 6" })
      }
    ), F = N ?? /* @__PURE__ */ o(
      "svg",
      {
        width: "16",
        height: "16",
        viewBox: "0 0 24 24",
        fill: "none",
        stroke: "currentColor",
        strokeWidth: "2",
        children: [
          /* @__PURE__ */ e("polyline", { points: "23 4 23 10 17 10" }),
          /* @__PURE__ */ e("path", { d: "M20.49 15a9 9 0 1 1-2.12-9.36L23 10" })
        ]
      }
    ), H = i ?? /* @__PURE__ */ o(
      "svg",
      {
        width: "16",
        height: "16",
        viewBox: "0 0 24 24",
        fill: "none",
        stroke: "currentColor",
        strokeWidth: "2",
        children: [
          /* @__PURE__ */ e("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
          /* @__PURE__ */ e("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
        ]
      }
    );
    return /* @__PURE__ */ o(
      "div",
      {
        ref: D,
        id: a,
        className: `nice-nav-controls nice-nav-controls--${g} nice-nav-controls--${$}${S ? " nice-nav-controls--disabled" : ""}${r ? ` ${r}` : ""}`,
        style: s,
        role: "navigation",
        "aria-label": M("nav.controls", "Navigation controls"),
        ...n,
        children: [
          /* @__PURE__ */ e(
            "button",
            {
              type: "button",
              className: `nice-nav-controls__btn nice-nav-controls__btn--back${b ? "" : " nice-nav-controls__btn--disabled"}`,
              onClick: c,
              disabled: S || !b,
              "aria-label": M("nav.back", "Back"),
              title: `${M("nav.back", "Back")} (Alt+←)`,
              children: K
            }
          ),
          /* @__PURE__ */ e(
            "button",
            {
              type: "button",
              className: `nice-nav-controls__btn nice-nav-controls__btn--forward${m ? "" : " nice-nav-controls__btn--disabled"}`,
              onClick: p,
              disabled: S || !m,
              "aria-label": M("nav.forward", "Forward"),
              title: `${M("nav.forward", "Forward")} (Alt+→)`,
              children: O
            }
          ),
          (C || k && d) && (d ? /* @__PURE__ */ e(
            "button",
            {
              type: "button",
              className: "nice-nav-controls__btn nice-nav-controls__btn--stop nice-nav-controls__btn--loading",
              onClick: _,
              disabled: S,
              "aria-label": M("nav.stop", "Stop"),
              title: `${M("nav.stop", "Stop")} (Esc)`,
              children: H
            }
          ) : /* @__PURE__ */ e(
            "button",
            {
              type: "button",
              className: "nice-nav-controls__btn nice-nav-controls__btn--refresh",
              onClick: l,
              disabled: S,
              "aria-label": M("nav.refresh", "Refresh"),
              title: `${M("nav.refresh", "Refresh")} (F5)`,
              children: F
            }
          ))
        ]
      }
    );
  }
);
X.displayName = "NiceNavigationControls";
export {
  ae as DEFAULT_SIDEBAR_PREFS,
  ie as DesktopContextMenu,
  ce as DesktopGrid,
  se as DesktopStartMenu,
  le as DesktopSystemTray,
  te as DesktopTaskbar,
  re as NiceAccordion,
  oe as NiceAppLayout,
  de as NiceAuthButtons,
  ue as NiceBottomNavigation,
  be as NiceBreadcrumb,
  me as NiceCard,
  _e as NiceClassicShell,
  he as NiceCompactShell,
  pe as NiceConsole,
  Ne as NiceContextMenu,
  ve as NiceDashboardLayout,
  ke as NiceDashboardShell,
  ye as NiceDesktop,
  fe as NiceDock,
  J as NiceDockMenu,
  ge as NiceDynamicSidebar,
  Q as NiceHamburgerMenu,
  $e as NiceHybridShell,
  xe as NiceKioskShell,
  we as NiceMdiWorkspace,
  Me as NiceMenu,
  Ce as NiceMinimalShell,
  De as NiceModeSelector,
  Se as NiceModernShell,
  Ee as NiceModuleLifecyclePanel,
  Ie as NiceMultiView,
  Te as NiceNavMenu,
  Ae as NiceNavbar,
  X as NiceNavigationControls,
  Pe as NiceOnboardingWizard,
  Be as NiceOrganizationProfileForm,
  Qe as NicePagination,
  Le as NicePwaShell,
  q as NiceRibbonMenu,
  Re as NiceSetupWizard,
  U as NiceSidebarMenu,
  We as NiceSidebarNav,
  Ke as NiceSplitter,
  Oe as NiceTabPanel,
  qe as NiceTabs,
  Fe as NiceTenantSwitcher,
  He as NiceToolbar,
  V as NiceTopMenu,
  je as NiceUserMenu,
  ze as NiceWizard,
  Ue as SIDEBAR_MODE_META
};
