@nice2dev/ui 1.4.1 → 1.4.3

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/NiceCodeEditor-DhdjnDLV.cjs +289 -0
  3. package/dist/{NiceDataGrid-BT6iCUgP.cjs → NiceDataGrid-CrKDzMM1.cjs} +1 -1
  4. package/dist/{NiceForm-Bysp66Ef.cjs → NiceForm-CT9hEXpc.cjs} +1 -1
  5. package/dist/NiceLoginForm-C2-WgRn0.cjs +1 -0
  6. package/dist/NiceMention-BZEHqPrf.cjs +432 -0
  7. package/dist/NiceModuleLifecyclePanel-DKlqKPy2.cjs +1 -0
  8. package/dist/{NiceSavedQueryPanel-BbznsXFd.cjs → NiceSavedQueryPanel-C5Ab_NWx.cjs} +1 -1
  9. package/dist/NiceScheduler-BZQAKEVF.cjs +5 -0
  10. package/dist/{NiceWindow-pgR4c-kQ.cjs → NiceWindow-BklnkBpu.cjs} +1 -1
  11. package/dist/charts/NiceLinearGauge.mjs +96 -83
  12. package/dist/charts/NicePolarChart.mjs +47 -47
  13. package/dist/charts-BzlvCCg9.cjs +768 -0
  14. package/dist/charts.cjs +1 -1
  15. package/dist/{core-lazy-CL4ZIxF-.cjs → core-lazy-VTd5zfoZ.cjs} +1 -1
  16. package/dist/data.cjs +1 -1
  17. package/dist/display/NiceAvatar.mjs +40 -24
  18. package/dist/editors/pickers/NiceDateRangeBox.mjs +92 -92
  19. package/dist/editors/pickers/NiceDateTimePicker.mjs +173 -173
  20. package/dist/editors/rich/NiceCodeEditor.mjs +645 -584
  21. package/dist/editors/rich/NiceDocumentEditor.mjs +277 -254
  22. package/dist/editors.cjs +1 -1
  23. package/dist/feedback/NiceDrawer.mjs +15 -15
  24. package/dist/feedback.cjs +1 -1
  25. package/dist/index.cjs +202 -202
  26. package/dist/index.d.ts +18 -0
  27. package/dist/lazy.cjs +1 -1
  28. package/dist/navigation/NiceNavShell.mjs +646 -593
  29. package/dist/navigation/NiceSidebarNav.mjs +844 -823
  30. package/dist/navigation.cjs +1 -1
  31. package/dist/overlays/NiceWindow.mjs +91 -91
  32. package/dist/overlays.cjs +1 -1
  33. package/dist/planning/NiceScheduler.mjs +170 -169
  34. package/dist/planning/NiceSchedulerViews.mjs +242 -233
  35. package/dist/style.css +2 -2
  36. package/dist/utility/intlNames.mjs +26 -16
  37. package/package.json +4 -4
  38. package/dist/NiceCodeEditor-D0QZW88r.cjs +0 -268
  39. package/dist/NiceLoginForm-FGf32sro.cjs +0 -1
  40. package/dist/NiceMention-sc8W-DwH.cjs +0 -430
  41. package/dist/NiceModuleLifecyclePanel-DBQPCa_V.cjs +0 -1
  42. package/dist/NiceScheduler-3Ez0zSQJ.cjs +0 -5
  43. package/dist/charts-B0tHOpJ7.cjs +0 -768
@@ -1,267 +1,267 @@
1
- import { jsx as i, jsxs as I, Fragment as tn } from "react/jsx-runtime";
2
- import { useNiceTranslation as Ne, NiceThemeContext as it, useControllableState as nt, NiceIcon as ne, useRovingFocus as Yi } from "@nice2dev/ui-core";
3
- import { forwardRef as rn, useState as ye, useRef as se, useEffect as ni, useCallback as ee, useMemo as B, useContext as ue, isValidElement as Ii, createContext as Re } from "react";
4
- import { createPortal as tt } from "react-dom";
5
- import { useTreeDragSession as xi, TreeDragSessionProvider as rt, startTreeDrag as an } from "../data/treeDragSession.mjs";
1
+ import { jsx as i, jsxs as I, Fragment as rn } from "react/jsx-runtime";
2
+ import { useNiceTranslation as Ne, NiceThemeContext as nt, useControllableState as tt, NiceIcon as ne, useRovingFocus as Qi } from "@nice2dev/ui-core";
3
+ import { forwardRef as on, useState as ye, useRef as re, useEffect as Ge, useCallback as ee, useMemo as T, useContext as ue, isValidElement as xi, createContext as $e } from "react";
4
+ import { createPortal as rt } from "react-dom";
5
+ import { useTreeDragSession as Li, TreeDragSessionProvider as ot, startTreeDrag as an } from "../data/treeDragSession.mjs";
6
6
  import { NiceTooltip as Y } from "../display/NiceTooltip.mjs";
7
- import { useNavItemDrop as ti, navItemDrag as on, useNavItemDragActive as at } from "./navItemDrag.mjs";
8
- import { NiceContextMenu as sn } from "./NiceContextMenu.mjs";
9
- import { NiceIconRail as Qi } from "./NiceIconRail.mjs";
10
- import { rootColorScope as ot, levelColorVars as st, colorsOf as ct, branchColorScope as cn, rowColors as ii, shadeRowVars as lt, shadeSourceHeadVars as dt, colorLevel as ut } from "./sidebarColors.mjs";
11
- import { storableFavorite as qe, sidebarFavoriteItems as wi, sidebarFavoriteLists as vt, activeSidebarFavoriteList as bt, sidebarFavoriteListsOf as Li, storablePath as ln, sidebarFavoriteTree as ht } from "./sidebarFavorites.mjs";
12
- import { walkSidebarNav as Ci, findSidebarItemByRoute as pt } from "./sidebarNavTree.mjs";
13
- import { SIDEBAR_DEFAULT_FAVORITE_LIST as $e, DEFAULT_SIDEBAR_PREFS as dn, SIDEBAR_MODE_META as yi, sidebarModeLabel as ei } from "./sidebarNavTypes.mjs";
14
- import { PREFS_CATEGORIES as ft } from "./sidebarPrefs/prefsCategories.mjs";
15
- import { SidebarScopeSpinner as Xi, ScopeEditActions as mt, ScopePickerPanel as _t } from "./sidebarScopePicker.mjs";
16
- import { normalizeSidebarSearch as Nt, filterSidebarItems as un, sidebarItemMatches as Zi } from "./sidebarSearch.mjs";
7
+ import { useNavItemDrop as ri, navItemDrag as sn, useNavItemDragActive as at } from "./navItemDrag.mjs";
8
+ import { NiceContextMenu as cn } from "./NiceContextMenu.mjs";
9
+ import { NiceIconRail as Xi } from "./NiceIconRail.mjs";
10
+ import { rootColorScope as st, levelColorVars as ct, colorsOf as lt, branchColorScope as ln, rowColors as ti, shadeRowVars as dt, shadeSourceHeadVars as ut, colorLevel as bt } from "./sidebarColors.mjs";
11
+ import { storableFavorite as Ke, sidebarFavoriteItems as Ci, sidebarFavoriteLists as vt, activeSidebarFavoriteList as ht, sidebarFavoriteListsOf as Mi, storablePath as dn, sidebarFavoriteTree as pt } from "./sidebarFavorites.mjs";
12
+ import { walkSidebarNav as yi, findSidebarItemByRoute as ft } from "./sidebarNavTree.mjs";
13
+ import { SIDEBAR_DEFAULT_FAVORITE_LIST as ze, DEFAULT_SIDEBAR_PREFS as un, SIDEBAR_MODE_META as ki, sidebarModeLabel as ni } from "./sidebarNavTypes.mjs";
14
+ import { PREFS_CATEGORIES as mt } from "./sidebarPrefs/prefsCategories.mjs";
15
+ import { SidebarScopeSpinner as Zi, ScopeEditActions as _t, ScopePickerPanel as Nt } from "./sidebarScopePicker.mjs";
16
+ import { normalizeSidebarSearch as gt, filterSidebarItems as bn, sidebarItemMatches as Wi } from "./sidebarSearch.mjs";
17
17
  /* empty css */
18
- function Oe(e) {
18
+ function Fe(e) {
19
19
  return typeof e == "string" ? /* @__PURE__ */ i(ne, { name: e }) : e;
20
20
  }
21
- const gt = [], St = [], Ge = /* @__PURE__ */ Re("theme"), vn = /* @__PURE__ */ Re(!0), bn = /* @__PURE__ */ Re(null), hn = /* @__PURE__ */ Re(null), pn = /* @__PURE__ */ Re(!1), mi = "__nice-shortcuts__";
22
- function Wi(e, r) {
21
+ const St = [], wt = [], Ue = /* @__PURE__ */ $e("theme"), vn = /* @__PURE__ */ $e(!0), hn = /* @__PURE__ */ $e(null), pn = /* @__PURE__ */ $e(null), fn = /* @__PURE__ */ $e(!1), _i = "__nice-shortcuts__";
22
+ function en(e, r) {
23
23
  const u = new Set(r.map((d) => d.toLowerCase()));
24
- let s = e;
25
- for (let d = 2; u.has(s.toLowerCase()); d++)
26
- s = `${e} ${d}`;
27
- return s;
24
+ let a = e;
25
+ for (let d = 2; u.has(a.toLowerCase()); d++)
26
+ a = `${e} ${d}`;
27
+ return a;
28
28
  }
29
- function fn(e) {
29
+ function mn(e) {
30
30
  return `nice_sidebar_nav_${e ?? "_default"}`;
31
31
  }
32
- const _i = "nice-sidebar-prefs-change";
33
- function wt(e, r) {
32
+ const Ni = "nice-sidebar-prefs-change";
33
+ function Ct(e, r) {
34
34
  return e != null && (r != null || e.activeMode !== void 0);
35
35
  }
36
- function en(e, r, u = r?.activeMode !== void 0) {
37
- const s = {
38
- ...dn,
36
+ function nn(e, r, u = r?.activeMode !== void 0) {
37
+ const a = {
38
+ ...un,
39
39
  userId: e ?? "_default"
40
40
  };
41
- if (r && Object.assign(s, r), u)
42
- return s;
41
+ if (r && Object.assign(a, r), u)
42
+ return a;
43
43
  try {
44
- const d = localStorage.getItem(fn(e));
44
+ const d = localStorage.getItem(mn(e));
45
45
  if (d) {
46
46
  const l = JSON.parse(d);
47
47
  return Array.isArray(l.favorites) && (l.favorites = l.favorites.map(
48
- (b) => b && typeof b == "object" ? {
49
- ...b,
50
- icon: typeof b.icon == "string" || Ii(b.icon) ? b.icon : void 0
51
- } : b
52
- )), { ...s, ...l, userId: e ?? "_default" };
48
+ (v) => v && typeof v == "object" ? {
49
+ ...v,
50
+ icon: typeof v.icon == "string" || xi(v.icon) ? v.icon : void 0
51
+ } : v
52
+ )), { ...a, ...l, userId: e ?? "_default" };
53
53
  }
54
54
  } catch {
55
55
  }
56
- return s;
56
+ return a;
57
57
  }
58
- function Ni(e, r, u, s) {
59
- if (r === $e) {
60
- const _ = e.favorites.some((k) => k.id === u.id);
61
- return s === _ ? e : {
58
+ function gi(e, r, u, a) {
59
+ if (r === ze) {
60
+ const N = e.favorites.some((k) => k.id === u.id);
61
+ return a === N ? e : {
62
62
  ...e,
63
- favorites: s ? [...e.favorites, { ...u, addedAt: Date.now() }] : e.favorites.filter((k) => k.id !== u.id)
63
+ favorites: a ? [...e.favorites, { ...u, addedAt: Date.now() }] : e.favorites.filter((k) => k.id !== u.id)
64
64
  };
65
65
  }
66
- const d = e.favoriteLists ?? [], l = d.find((_) => _.id === r);
67
- if (!l || s === l.items.some((_) => _.id === u.id))
66
+ const d = e.favoriteLists ?? [], l = d.find((N) => N.id === r);
67
+ if (!l || a === l.items.some((N) => N.id === u.id))
68
68
  return e;
69
- const b = s ? [...l.items, { ...qe(u), addedAt: Date.now() }] : l.items.filter((_) => _.id !== u.id);
70
- return { ...e, favoriteLists: d.map((_) => _.id === r ? { ..._, items: b } : _) };
69
+ const v = a ? [...l.items, { ...Ke(u), addedAt: Date.now() }] : l.items.filter((N) => N.id !== u.id);
70
+ return { ...e, favoriteLists: d.map((N) => N.id === r ? { ...N, items: v } : N) };
71
71
  }
72
- function Ct(e, r, u, s, d) {
73
- const l = d?.controlled ?? wt(u, s), [b, _] = ye(() => {
74
- const a = en(e, u, l);
75
- return r !== void 0 && (a.enableModeIcons = r), a;
76
- }), k = se(u);
77
- ni(() => {
78
- !u || k.current === u || (k.current = u, _((a) => ({ ...a, ...u })));
72
+ function yt(e, r, u, a, d) {
73
+ const l = d?.controlled ?? Ct(u, a), [v, N] = ye(() => {
74
+ const o = nn(e, u, l);
75
+ return r !== void 0 && (o.enableModeIcons = r), o;
76
+ }), k = re(u);
77
+ Ge(() => {
78
+ !u || k.current === u || (k.current = u, N((o) => ({ ...o, ...u })));
79
79
  }, [u]);
80
- const C = se(b);
81
- C.current = b;
82
- const v = ee(
83
- (a) => {
84
- const n = C.current, o = a(n);
85
- if (o !== n) {
86
- if (C.current = o, _(o), !l)
80
+ const C = re(v);
81
+ C.current = v;
82
+ const b = ee(
83
+ (o) => {
84
+ const n = C.current, s = o(n);
85
+ if (s !== n) {
86
+ if (C.current = s, N(s), !l)
87
87
  try {
88
88
  const f = {
89
- ...o,
90
- favorites: o.favorites.map((g) => ({ ...g, icon: void 0 })),
91
- favoriteLists: (o.favoriteLists ?? []).map((g) => ({
92
- ...g,
93
- items: g.items.map(qe)
89
+ ...s,
90
+ favorites: s.favorites.map((S) => ({ ...S, icon: void 0 })),
91
+ favoriteLists: (s.favoriteLists ?? []).map((S) => ({
92
+ ...S,
93
+ items: S.items.map(Ke)
94
94
  })),
95
- shortcuts: (o.shortcuts ?? []).map(qe)
95
+ shortcuts: (s.shortcuts ?? []).map(Ke)
96
96
  };
97
- localStorage.setItem(fn(e), JSON.stringify(f)), typeof window < "u" && window.dispatchEvent(
98
- new CustomEvent(_i, {
97
+ localStorage.setItem(mn(e), JSON.stringify(f)), typeof window < "u" && window.dispatchEvent(
98
+ new CustomEvent(Ni, {
99
99
  detail: { userId: e ?? "_default" }
100
100
  })
101
101
  );
102
102
  } catch {
103
103
  }
104
- if (s) {
104
+ if (a) {
105
105
  const f = {};
106
- for (const g of Object.keys(o))
107
- o[g] !== n[g] && (f[g] = o[g]);
108
- s(o, f);
106
+ for (const S of Object.keys(s))
107
+ s[S] !== n[S] && (f[S] = s[S]);
108
+ a(s, f);
109
109
  }
110
110
  }
111
111
  },
112
- [e, l, s]
112
+ [e, l, a]
113
113
  );
114
- ni(() => {
114
+ Ge(() => {
115
115
  if (typeof window > "u" || l)
116
116
  return;
117
- const a = (n) => {
118
- n.detail?.userId === (e ?? "_default") && _((f) => {
119
- const g = en(e, u, !1);
120
- return r !== void 0 && (g.enableModeIcons = r), JSON.stringify(f) === JSON.stringify(g) ? f : g;
117
+ const o = (n) => {
118
+ n.detail?.userId === (e ?? "_default") && N((f) => {
119
+ const S = nn(e, u, !1);
120
+ return r !== void 0 && (S.enableModeIcons = r), JSON.stringify(f) === JSON.stringify(S) ? f : S;
121
121
  });
122
122
  };
123
- return window.addEventListener(_i, a), () => window.removeEventListener(_i, a);
123
+ return window.addEventListener(Ni, o), () => window.removeEventListener(Ni, o);
124
124
  }, [e, u, r, l]);
125
- const L = B(
125
+ const M = T(
126
126
  () => ({
127
- setMode: (a) => v((n) => ({ ...n, activeMode: a })),
128
- setEnableModeIcons: (a) => v((n) => ({ ...n, enableModeIcons: a })),
129
- toggleMode: (a) => v((n) => {
130
- if (a === "preferences")
127
+ setMode: (o) => b((n) => ({ ...n, activeMode: o })),
128
+ setEnableModeIcons: (o) => b((n) => ({ ...n, enableModeIcons: o })),
129
+ toggleMode: (o) => b((n) => {
130
+ if (o === "preferences")
131
131
  return n;
132
- const o = n.enabledModes.includes(a);
132
+ const s = n.enabledModes.includes(o);
133
133
  return {
134
134
  ...n,
135
- enabledModes: o ? n.enabledModes.filter((f) => f !== a) : [...n.enabledModes, a],
135
+ enabledModes: s ? n.enabledModes.filter((f) => f !== o) : [...n.enabledModes, o],
136
136
  // If we're hiding the active mode, fall back to 'all'
137
- activeMode: !o || n.activeMode !== a ? n.activeMode : "all"
137
+ activeMode: !s || n.activeMode !== o ? n.activeMode : "all"
138
138
  };
139
139
  }),
140
- pinSource: (a, n) => v((o) => ({
141
- ...o,
140
+ pinSource: (o, n) => b((s) => ({
141
+ ...s,
142
142
  pinnedSources: {
143
- ...o.pinnedSources,
144
- [a]: [...o.pinnedSources[a] ?? [], n]
143
+ ...s.pinnedSources,
144
+ [o]: [...s.pinnedSources[o] ?? [], n]
145
145
  }
146
146
  })),
147
- unpinSource: (a, n) => v((o) => ({
148
- ...o,
147
+ unpinSource: (o, n) => b((s) => ({
148
+ ...s,
149
149
  pinnedSources: {
150
- ...o.pinnedSources,
151
- [a]: (o.pinnedSources[a] ?? []).filter((f) => f !== n)
150
+ ...s.pinnedSources,
151
+ [o]: (s.pinnedSources[o] ?? []).filter((f) => f !== n)
152
152
  }
153
153
  })),
154
- hideItem: (a) => v((n) => ({
154
+ hideItem: (o) => b((n) => ({
155
155
  ...n,
156
- hiddenItems: n.hiddenItems.some((o) => o.id === a.id) ? n.hiddenItems : [...n.hiddenItems, a]
156
+ hiddenItems: n.hiddenItems.some((s) => s.id === o.id) ? n.hiddenItems : [...n.hiddenItems, o]
157
157
  })),
158
- restoreItem: (a) => v((n) => ({
158
+ restoreItem: (o) => b((n) => ({
159
159
  ...n,
160
- hiddenItems: n.hiddenItems.filter((o) => o.id !== a)
160
+ hiddenItems: n.hiddenItems.filter((s) => s.id !== o)
161
161
  })),
162
- addFavorite: (a, n = $e) => v((o) => Ni(o, n, a, !0)),
163
- removeFavorite: (a, n = $e) => v((o) => Ni(o, n, { id: a, label: a, addedAt: 0 }, !1)),
164
- toggleFavoriteInList: (a, n) => v(
165
- (o) => Ni(
166
- o,
162
+ addFavorite: (o, n = ze) => b((s) => gi(s, n, o, !0)),
163
+ removeFavorite: (o, n = ze) => b((s) => gi(s, n, { id: o, label: o, addedAt: 0 }, !1)),
164
+ toggleFavoriteInList: (o, n) => b(
165
+ (s) => gi(
166
+ s,
167
167
  n,
168
- a,
169
- !wi(o, n).some((f) => f.id === a.id)
168
+ o,
169
+ !Ci(s, n).some((f) => f.id === o.id)
170
170
  )
171
171
  ),
172
- createFavoriteList: (a, n) => {
173
- const o = `list-${Date.now().toString(36)}${Math.random().toString(36).slice(2, 6)}`;
174
- return v(
175
- (f) => (f.favoriteLists ?? []).some((g) => g.id === o) ? f : {
172
+ createFavoriteList: (o, n) => {
173
+ const s = `list-${Date.now().toString(36)}${Math.random().toString(36).slice(2, 6)}`;
174
+ return b(
175
+ (f) => (f.favoriteLists ?? []).some((S) => S.id === s) ? f : {
176
176
  ...f,
177
177
  favoriteLists: [
178
178
  ...f.favoriteLists ?? [],
179
179
  {
180
- id: o,
181
- label: a,
182
- items: n ? [{ ...qe(n), addedAt: Date.now() }] : [],
180
+ id: s,
181
+ label: o,
182
+ items: n ? [{ ...Ke(n), addedAt: Date.now() }] : [],
183
183
  createdAt: Date.now()
184
184
  }
185
185
  ]
186
186
  }
187
- ), o;
187
+ ), s;
188
188
  },
189
- renameFavoriteList: (a, n) => v((o) => ({
190
- ...o,
191
- favoriteLists: (o.favoriteLists ?? []).map((f) => f.id === a ? { ...f, label: n } : f)
189
+ renameFavoriteList: (o, n) => b((s) => ({
190
+ ...s,
191
+ favoriteLists: (s.favoriteLists ?? []).map((f) => f.id === o ? { ...f, label: n } : f)
192
192
  })),
193
- removeFavoriteList: (a) => v(
194
- (n) => a === $e ? n : {
193
+ removeFavoriteList: (o) => b(
194
+ (n) => o === ze ? n : {
195
195
  ...n,
196
- favoriteLists: (n.favoriteLists ?? []).filter((o) => o.id !== a),
197
- activeFavoriteListId: n.activeFavoriteListId === a ? $e : n.activeFavoriteListId
196
+ favoriteLists: (n.favoriteLists ?? []).filter((s) => s.id !== o),
197
+ activeFavoriteListId: n.activeFavoriteListId === o ? ze : n.activeFavoriteListId
198
198
  }
199
199
  ),
200
- setActiveFavoriteList: (a) => v((n) => ({ ...n, activeFavoriteListId: a })),
201
- addShortcut: (a, n) => v((o) => {
202
- const f = o.shortcuts ?? [];
203
- if (f.some((E) => E.id === a.id))
204
- return o;
205
- const g = Math.max(0, Math.min(f.length, n ?? f.length)), A = { ...qe(a), addedAt: Date.now() };
206
- return { ...o, shortcuts: [...f.slice(0, g), A, ...f.slice(g)] };
200
+ setActiveFavoriteList: (o) => b((n) => ({ ...n, activeFavoriteListId: o })),
201
+ addShortcut: (o, n) => b((s) => {
202
+ const f = s.shortcuts ?? [];
203
+ if (f.some((D) => D.id === o.id))
204
+ return s;
205
+ const S = Math.max(0, Math.min(f.length, n ?? f.length)), A = { ...Ke(o), addedAt: Date.now() };
206
+ return { ...s, shortcuts: [...f.slice(0, S), A, ...f.slice(S)] };
207
207
  }),
208
- removeShortcut: (a) => v(
209
- (n) => (n.shortcuts ?? []).some((o) => o.id === a) ? { ...n, shortcuts: (n.shortcuts ?? []).filter((o) => o.id !== a) } : n
208
+ removeShortcut: (o) => b(
209
+ (n) => (n.shortcuts ?? []).some((s) => s.id === o) ? { ...n, shortcuts: (n.shortcuts ?? []).filter((s) => s.id !== o) } : n
210
210
  ),
211
- moveShortcut: (a, n) => v((o) => {
212
- const f = o.shortcuts ?? [], g = f.findIndex((z) => z.id === a), A = Math.max(0, Math.min(f.length - 1, n));
213
- if (g < 0 || g === A)
214
- return o;
215
- const E = f.filter((z) => z.id !== a);
216
- return E.splice(A, 0, f[g]), { ...o, shortcuts: E };
211
+ moveShortcut: (o, n) => b((s) => {
212
+ const f = s.shortcuts ?? [], S = f.findIndex((R) => R.id === o), A = Math.max(0, Math.min(f.length - 1, n));
213
+ if (S < 0 || S === A)
214
+ return s;
215
+ const D = f.filter((R) => R.id !== o);
216
+ return D.splice(A, 0, f[S]), { ...s, shortcuts: D };
217
217
  }),
218
- setActiveGroup: (a, n) => v((o) => ({ ...o, activeGroupId: { ...o.activeGroupId, [a]: n } })),
219
- setMaxDepth: (a, n) => v((o) => ({
220
- ...o,
221
- maxDepth: { ...o.maxDepth, [a]: Math.min(10, Math.max(1, n)) }
218
+ setActiveGroup: (o, n) => b((s) => ({ ...s, activeGroupId: { ...s.activeGroupId, [o]: n } })),
219
+ setMaxDepth: (o, n) => b((s) => ({
220
+ ...s,
221
+ maxDepth: { ...s.maxDepth, [o]: Math.min(10, Math.max(1, n)) }
222
222
  })),
223
- toggleCollapse: (a) => v((n) => ({
223
+ toggleCollapse: (o) => b((n) => ({
224
224
  ...n,
225
- collapsedIds: n.collapsedIds.includes(a) ? n.collapsedIds.filter((o) => o !== a) : [...n.collapsedIds, a]
225
+ collapsedIds: n.collapsedIds.includes(o) ? n.collapsedIds.filter((s) => s !== o) : [...n.collapsedIds, o]
226
226
  })),
227
- setCollapsed: (a, n) => v((o) => ({
228
- ...o,
229
- collapsedIds: n ? Array.from(/* @__PURE__ */ new Set([...o.collapsedIds, ...a])) : o.collapsedIds.filter((f) => !a.includes(f))
227
+ setCollapsed: (o, n) => b((s) => ({
228
+ ...s,
229
+ collapsedIds: n ? Array.from(/* @__PURE__ */ new Set([...s.collapsedIds, ...o])) : s.collapsedIds.filter((f) => !o.includes(f))
230
230
  })),
231
- setAutoExpand: (a) => v((n) => ({ ...n, autoExpand: a })),
232
- setLeftClickBehavior: (a) => v((n) => ({ ...n, leftClickBehavior: a })),
233
- reorderItems: (a, n) => v((o) => {
234
- const f = { ...o.itemOrder };
235
- return n == null ? delete f[a] : f[a] = n, { ...o, itemOrder: f };
231
+ setAutoExpand: (o) => b((n) => ({ ...n, autoExpand: o })),
232
+ setLeftClickBehavior: (o) => b((n) => ({ ...n, leftClickBehavior: o })),
233
+ reorderItems: (o, n) => b((s) => {
234
+ const f = { ...s.itemOrder };
235
+ return n == null ? delete f[o] : f[o] = n, { ...s, itemOrder: f };
236
236
  }),
237
- setColorStyle: (a) => v((n) => ({ ...n, colorStyle: a })),
238
- setIndent: (a) => v((n) => ({ ...n, indent: a })),
239
- setStickyHeaders: (a) => v((n) => ({ ...n, stickyHeaders: a })),
240
- setPageMode: (a) => v((n) => ({ ...n, pageMode: a })),
241
- setFirstRun: (a, n) => v((o) => {
242
- const f = { ...o, firstRun: a };
237
+ setColorStyle: (o) => b((n) => ({ ...n, colorStyle: o })),
238
+ setIndent: (o) => b((n) => ({ ...n, indent: o })),
239
+ setStickyHeaders: (o) => b((n) => ({ ...n, stickyHeaders: o })),
240
+ setPageMode: (o) => b((n) => ({ ...n, pageMode: o })),
241
+ setFirstRun: (o, n) => b((s) => {
242
+ const f = { ...s, firstRun: o };
243
243
  return n?.pageMode !== void 0 && (f.pageMode = n.pageMode), n?.colorStyle !== void 0 && (f.colorStyle = n.colorStyle), f;
244
244
  }),
245
- resetAll: () => v(() => ({
246
- ...dn,
245
+ resetAll: () => b(() => ({
246
+ ...un,
247
247
  userId: e ?? "_default"
248
248
  }))
249
249
  }),
250
- [v, e]
250
+ [b, e]
251
251
  );
252
- return [b, L];
252
+ return [v, M];
253
253
  }
254
- function yt({ enabledModes: e, activeMode: r, onSelect: u, collapsed: s = !1 }) {
255
- const d = se(null);
256
- Yi(d, { orientation: "horizontal", wrap: !0, activateOnMove: !0 });
257
- const l = se(null);
258
- Yi(l, { orientation: "horizontal", wrap: !0, activateOnMove: !0 });
259
- const { t: b } = Ne(), _ = [
254
+ function kt({ enabledModes: e, activeMode: r, onSelect: u, collapsed: a = !1 }) {
255
+ const d = re(null);
256
+ Qi(d, { orientation: "horizontal", wrap: !0, activateOnMove: !0 });
257
+ const l = re(null);
258
+ Qi(l, { orientation: "horizontal", wrap: !0, activateOnMove: !0 });
259
+ const { t: v } = Ne(), N = [
260
260
  ...e.filter((C) => C !== "preferences"),
261
261
  "preferences"
262
- ], k = b("sidebarNav.modeBar.label", "Navigation mode");
263
- if (s) {
264
- const C = Math.max(0, _.indexOf(r)), v = _[(C - 1 + _.length) % _.length], L = _[(C + 1) % _.length], a = yi[r], n = ei(b, r);
262
+ ], k = v("sidebarNav.modeBar.label", "Navigation mode");
263
+ if (a) {
264
+ const C = Math.max(0, N.indexOf(r)), b = N[(C - 1 + N.length) % N.length], M = N[(C + 1) % N.length], o = ki[r], n = ni(v, r);
265
265
  return /* @__PURE__ */ I(
266
266
  "div",
267
267
  {
@@ -273,7 +273,7 @@ function yt({ enabledModes: e, activeMode: r, onSelect: u, collapsed: s = !1 })
273
273
  /* @__PURE__ */ i(
274
274
  Y,
275
275
  {
276
- content: `${b("sidebarNav.modeBar.previous", "Previous mode")}: ${ei(b, v)}`,
276
+ content: `${v("sidebarNav.modeBar.previous", "Previous mode")}: ${ni(v, b)}`,
277
277
  position: "bottom",
278
278
  size: "sm",
279
279
  children: /* @__PURE__ */ i(
@@ -281,8 +281,8 @@ function yt({ enabledModes: e, activeMode: r, onSelect: u, collapsed: s = !1 })
281
281
  {
282
282
  type: "button",
283
283
  className: "nice-sidebar-nav__mode-arrow",
284
- "aria-label": b("sidebarNav.modeBar.previous", "Previous mode"),
285
- onClick: () => u(v),
284
+ "aria-label": v("sidebarNav.modeBar.previous", "Previous mode"),
285
+ onClick: () => u(b),
286
286
  children: /* @__PURE__ */ i("span", { "aria-hidden": "true", children: "‹" })
287
287
  }
288
288
  )
@@ -297,13 +297,13 @@ function yt({ enabledModes: e, activeMode: r, onSelect: u, collapsed: s = !1 })
297
297
  "aria-label": n,
298
298
  className: "nice-sidebar-nav__mode-pill nice-sidebar-nav__mode-pill--active nice-sidebar-nav__mode-pill--carousel",
299
299
  onClick: () => u(r),
300
- children: /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__mode-pill-icon", "aria-hidden": "true", children: a.icon })
300
+ children: /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__mode-pill-icon", "aria-hidden": "true", children: o.icon })
301
301
  }
302
302
  ) }),
303
303
  /* @__PURE__ */ i(
304
304
  Y,
305
305
  {
306
- content: `${b("sidebarNav.modeBar.next", "Next mode")}: ${ei(b, L)}`,
306
+ content: `${v("sidebarNav.modeBar.next", "Next mode")}: ${ni(v, M)}`,
307
307
  position: "bottom",
308
308
  size: "sm",
309
309
  children: /* @__PURE__ */ i(
@@ -311,8 +311,8 @@ function yt({ enabledModes: e, activeMode: r, onSelect: u, collapsed: s = !1 })
311
311
  {
312
312
  type: "button",
313
313
  className: "nice-sidebar-nav__mode-arrow",
314
- "aria-label": b("sidebarNav.modeBar.next", "Next mode"),
315
- onClick: () => u(L),
314
+ "aria-label": v("sidebarNav.modeBar.next", "Next mode"),
315
+ onClick: () => u(M),
316
316
  children: /* @__PURE__ */ i("span", { "aria-hidden": "true", children: "›" })
317
317
  }
318
318
  )
@@ -329,22 +329,22 @@ function yt({ enabledModes: e, activeMode: r, onSelect: u, collapsed: s = !1 })
329
329
  ref: l,
330
330
  role: "tablist",
331
331
  "aria-label": k,
332
- children: _.map((C) => {
333
- const v = yi[C], L = ei(b, C), a = r === C;
334
- return /* @__PURE__ */ i(Y, { content: L, position: "bottom", size: "sm", children: /* @__PURE__ */ I(
332
+ children: N.map((C) => {
333
+ const b = ki[C], M = ni(v, C), o = r === C;
334
+ return /* @__PURE__ */ i(Y, { content: M, position: "bottom", size: "sm", children: /* @__PURE__ */ I(
335
335
  "button",
336
336
  {
337
337
  role: "tab",
338
- "aria-selected": a,
339
- "aria-label": L,
338
+ "aria-selected": o,
339
+ "aria-label": M,
340
340
  className: [
341
341
  "nice-sidebar-nav__mode-pill",
342
- a ? "nice-sidebar-nav__mode-pill--active" : ""
342
+ o ? "nice-sidebar-nav__mode-pill--active" : ""
343
343
  ].filter(Boolean).join(" "),
344
344
  onClick: () => u(C),
345
345
  children: [
346
- /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__mode-pill-icon", "aria-hidden": "true", children: v.icon }),
347
- /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__mode-pill-label", children: L })
346
+ /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__mode-pill-icon", "aria-hidden": "true", children: b.icon }),
347
+ /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__mode-pill-label", children: M })
348
348
  ]
349
349
  }
350
350
  ) }, C);
@@ -352,7 +352,7 @@ function yt({ enabledModes: e, activeMode: r, onSelect: u, collapsed: s = !1 })
352
352
  }
353
353
  );
354
354
  }
355
- function Mi({ open: e, size: r = 16 }) {
355
+ function Fi({ open: e, size: r = 16 }) {
356
356
  return /* @__PURE__ */ i(
357
357
  ne,
358
358
  {
@@ -365,16 +365,16 @@ function Mi({ open: e, size: r = 16 }) {
365
365
  }
366
366
  );
367
367
  }
368
- function mn({ size: e = 14 }) {
368
+ function _n({ size: e = 14 }) {
369
369
  return /* @__PURE__ */ i(ne, { name: "star", size: e });
370
370
  }
371
- function _n({ size: e = 14 }) {
371
+ function Nn({ size: e = 14 }) {
372
372
  return /* @__PURE__ */ i(ne, { name: "star", size: e, style: { fill: "currentColor" } });
373
373
  }
374
- function Nn({ size: e = 14 }) {
374
+ function gn({ size: e = 14 }) {
375
375
  return /* @__PURE__ */ i(ne, { name: "eye-off", size: e });
376
376
  }
377
- function kt({
377
+ function It({
378
378
  size: e = 14,
379
379
  filled: r = !1
380
380
  }) {
@@ -383,52 +383,52 @@ function kt({
383
383
  function Oi({ size: e = 12 }) {
384
384
  return /* @__PURE__ */ i(ne, { name: "close", size: e });
385
385
  }
386
- const gn = /* @__PURE__ */ Re(null);
387
- function Fi({
386
+ const Sn = /* @__PURE__ */ $e(null);
387
+ function Ei({
388
388
  item: e,
389
389
  depth: r,
390
390
  maxDepth: u,
391
- activeRoute: s,
391
+ activeRoute: a,
392
392
  collapsedIds: d,
393
393
  hiddenIds: l,
394
- autoExpand: b,
395
- sidebarCollapsed: _ = !1,
394
+ autoExpand: v,
395
+ sidebarCollapsed: N = !1,
396
396
  expandableWhenCollapsed: k = !1,
397
397
  onNavigate: C,
398
- onHide: v,
399
- onToggleCollapse: L,
400
- onAddFavorite: a,
398
+ onHide: b,
399
+ onToggleCollapse: M,
400
+ onAddFavorite: o,
401
401
  onRemoveFavorite: n,
402
- isFavorite: o,
402
+ isFavorite: s,
403
403
  leftClickBehavior: f = "focus-existing",
404
- routeToUrl: g,
404
+ routeToUrl: S,
405
405
  contextMenu: A = !0,
406
- disabledActions: E,
407
- colorScope: z,
406
+ disabledActions: D,
407
+ colorScope: R,
408
408
  shading: V,
409
409
  path: te,
410
- onRemoveFromList: K
410
+ onRemoveFromList: q
411
411
  }) {
412
- const { t: y } = Ne(), q = ue(Ge), ve = ue(vn), w = ue(bn), x = ue(hn), Z = xi(), be = ue(pn), [he, G] = ye(!1), ie = se(null), $ = (e.children?.length ?? 0) > 0 && r < u, ke = d.includes(e.id), U = ue(gn)?.has(e.id) === !0 || (b ? !ke : ke), re = ee(() => {
412
+ const { t: y } = Ne(), K = ue(Ue), be = ue(vn), w = ue(hn), L = ue(pn), Z = Li(), ve = ue(fn), [he, G] = ye(!1), ie = re(null), z = (e.children?.length ?? 0) > 0 && r < u, ke = d.includes(e.id), U = ue(Sn)?.has(e.id) === !0 || (v ? !ke : ke), oe = ee(() => {
413
413
  const h = ie.current, P = h?.parentElement, Se = h && P && U && h.getBoundingClientRect().top - P.getBoundingClientRect().top > 1 ? h.getBoundingClientRect().top : null;
414
- L(e.id), Se !== null && P && requestAnimationFrame(() => {
414
+ M(e.id), Se !== null && P && requestAnimationFrame(() => {
415
415
  const Le = P.closest(".nice-sidebar-nav__body");
416
416
  Le && (Le.scrollTop += P.getBoundingClientRect().top - Se);
417
417
  });
418
- }, [U, L, e.id]), xe = !!(e.route && s && e.route === s), j = !!e.route, W = j && o(e.id), ce = j && x ? x.stateOf(e.id) : "predefined", le = ce !== "predefined", { scope: Q, vars: pe } = B(
419
- () => cn(z, e, r, V),
420
- [z, e, r, V]
421
- ), M = B(
418
+ }, [U, M, e.id]), xe = !!(e.route && a && e.route === a), j = !!e.route, W = j && s(e.id), ce = j && L ? L.stateOf(e.id) : "predefined", le = ce !== "predefined", { scope: Q, vars: pe } = T(
419
+ () => ln(R, e, r, V),
420
+ [R, e, r, V]
421
+ ), F = T(
422
422
  () => [...te, { id: e.id, label: e.label, icon: e.icon }],
423
423
  [te, e.id, e.label, e.icon]
424
424
  ), O = ee(
425
425
  (h) => ({
426
426
  forceNew: h,
427
- color: ii(Q, r)?.bg,
427
+ color: ti(Q, r)?.bg,
428
428
  branchColor: Q.branchColor,
429
- path: M
429
+ path: F
430
430
  }),
431
- [Q, r, M]
431
+ [Q, r, F]
432
432
  ), J = ee(
433
433
  () => ({
434
434
  id: e.id,
@@ -437,13 +437,13 @@ function Fi({
437
437
  route: e.route,
438
438
  sourceId: e.sourceId,
439
439
  moduleId: e.moduleId,
440
- color: Q.branchColor ?? ii(Q, r)?.bg,
440
+ color: Q.branchColor ?? ti(Q, r)?.bg,
441
441
  // where it was added from, for the favourites tree
442
- path: ln(te),
442
+ path: dn(te),
443
443
  addedAt: Date.now()
444
444
  }),
445
445
  [e, Q, r, te]
446
- ), Fe = B(() => {
446
+ ), Oe = T(() => {
447
447
  if (!A || !j || !e.route)
448
448
  return [];
449
449
  const h = e.route, P = [
@@ -453,20 +453,20 @@ function Fi({
453
453
  onClick: () => C?.(h, e, O(!1))
454
454
  }
455
455
  ];
456
- return ve && P.push({
456
+ return be && P.push({
457
457
  id: "openNewTab",
458
458
  label: y("sidebar.menu.openNewTab", "Open in new tab"),
459
459
  onClick: () => C?.(h, e, O(!0))
460
- }), g && P.push({
460
+ }), S && P.push({
461
461
  id: "openBrowserTab",
462
462
  label: y("sidebar.menu.openBrowserTab", "Open in new browser tab"),
463
463
  onClick: () => {
464
- typeof window < "u" && window.open(g(h), "_blank", "noopener,noreferrer");
464
+ typeof window < "u" && window.open(S(h), "_blank", "noopener,noreferrer");
465
465
  }
466
- }), P.push({ id: "sep-1", divider: !0 }), K ? P.push({
466
+ }), P.push({ id: "sep-1", divider: !0 }), q ? P.push({
467
467
  id: "removeFromList",
468
468
  label: y("sidebarNav.removeFavourite", "Remove from favourites"),
469
- onClick: () => K(e.id)
469
+ onClick: () => q(e.id)
470
470
  }) : W ? P.push({
471
471
  id: "unpinFavorite",
472
472
  label: y("sidebar.menu.unpinFavorite", "Remove from favorites"),
@@ -474,62 +474,62 @@ function Fi({
474
474
  }) : P.push({
475
475
  id: "pinFavorite",
476
476
  label: y("sidebar.menu.pinFavorite", "Add to favorites"),
477
- onClick: () => a(J())
477
+ onClick: () => o(J())
478
478
  }), w && P.push({
479
479
  id: "favoriteLists",
480
480
  label: y("sidebarNav.favLists.addTo", "Add to a list…"),
481
481
  onClick: () => G(!0)
482
- }), x && le && P.push({
482
+ }), L && le && P.push({
483
483
  id: ce === "user" ? "removeShortcut" : "addShortcut",
484
484
  label: ce === "user" ? y("sidebarNav.removeShortcut", "Remove from shortcuts") : y("sidebarNav.addShortcut", "Add to shortcuts"),
485
- onClick: () => x.toggle(J())
486
- }), K || P.push({
485
+ onClick: () => L.toggle(J())
486
+ }), q || P.push({
487
487
  id: "hide",
488
488
  label: y("sidebar.menu.hide", "Hide"),
489
- disabled: !!E?.has("hide"),
490
- onClick: () => v({ id: e.id, kind: e.kind, label: e.label })
491
- }), g && (P.push({ id: "sep-2", divider: !0 }), P.push({
489
+ disabled: !!D?.has("hide"),
490
+ onClick: () => b({ id: e.id, kind: e.kind, label: e.label })
491
+ }), S && (P.push({ id: "sep-2", divider: !0 }), P.push({
492
492
  id: "copyLink",
493
493
  label: y("sidebar.menu.copyLink", "Copy link"),
494
494
  onClick: () => {
495
- typeof navigator < "u" && navigator.clipboard && navigator.clipboard.writeText(g(h));
495
+ typeof navigator < "u" && navigator.clipboard && navigator.clipboard.writeText(S(h));
496
496
  }
497
497
  })), P;
498
498
  }, [
499
499
  A,
500
- ve,
501
- E,
500
+ be,
501
+ D,
502
502
  j,
503
503
  e,
504
504
  W,
505
- g,
505
+ S,
506
506
  C,
507
- a,
507
+ o,
508
508
  n,
509
- v,
509
+ b,
510
510
  O,
511
511
  J,
512
512
  w,
513
- x,
513
+ L,
514
514
  ce,
515
515
  le,
516
- K,
516
+ q,
517
517
  y
518
518
  ]);
519
519
  if (l.has(e.id))
520
520
  return null;
521
521
  function Pe() {
522
- if ($ && !j) {
523
- E?.has("collapseToggle") || re();
522
+ if (z && !j) {
523
+ D?.has("collapseToggle") || oe();
524
524
  return;
525
525
  }
526
526
  j && e.route && (C?.(
527
527
  e.route,
528
528
  e,
529
529
  O(f === "open-new")
530
- ), $ && !U && !E?.has("collapseToggle") && L(e.id));
530
+ ), z && !U && !D?.has("collapseToggle") && M(e.id));
531
531
  }
532
- const ae = ut(r), ge = ii(Q, r), Ee = q === "fill", Ue = q === "bar" && !!ge, ri = _ ? M.map((h) => h.label).join(" › ") : e.tooltip ?? e.label;
532
+ const ae = bt(r), ge = ti(Q, r), Ee = K === "fill", Je = K === "bar" && !!ge, oi = N ? F.map((h) => h.label).join(" › ") : e.tooltip ?? e.label;
533
533
  return /* @__PURE__ */ I(
534
534
  "li",
535
535
  {
@@ -538,9 +538,9 @@ function Fi({
538
538
  `nice-sidebar-nav__node--depth-${r}`,
539
539
  r > 4 ? "nice-sidebar-nav__node--deep" : "",
540
540
  Ee ? ge ? "nice-sidebar-nav__node--colored" : "" : "nice-sidebar-nav__node--shaded",
541
- Ue ? "nice-sidebar-nav__node--marked" : "",
541
+ Je ? "nice-sidebar-nav__node--marked" : "",
542
542
  xe ? "nice-sidebar-nav__node--active" : "",
543
- $ ? "nice-sidebar-nav__node--branch" : "nice-sidebar-nav__node--leaf"
543
+ z ? "nice-sidebar-nav__node--branch" : "nice-sidebar-nav__node--leaf"
544
544
  ].filter(Boolean).join(" "),
545
545
  "data-nice-depth": r,
546
546
  style: {
@@ -559,14 +559,14 @@ function Fi({
559
559
  "--nice-row-label": `var(--nice-sidebar-level-${ae}-text, var(--nice-text-primary))`,
560
560
  "--nice-row-muted": `var(--nice-sidebar-level-${ae}-text, var(--nice-text-muted))`
561
561
  } : {
562
- ...lt(r, $),
562
+ ...dt(r, z),
563
563
  // 'bar': the branch's colour (e.g. its database) on the left edge
564
- ...Ue && ge ? { "--nice-row-mark": ge.bg } : void 0
564
+ ...Je && ge ? { "--nice-row-mark": ge.bg } : void 0
565
565
  }
566
566
  },
567
567
  children: [
568
568
  /* @__PURE__ */ I("div", { className: "nice-sidebar-nav__node-row", ref: ie, children: [
569
- $ && /* @__PURE__ */ i(
569
+ z && /* @__PURE__ */ i(
570
570
  Y,
571
571
  {
572
572
  content: U ? y("sidebarNav.collapse", "Collapse") : y("sidebarNav.expand", "Expand"),
@@ -578,15 +578,15 @@ function Fi({
578
578
  className: "nice-sidebar-nav__collapse-btn",
579
579
  "aria-label": U ? y("sidebarNav.collapse", "Collapse") : y("sidebarNav.expand", "Expand"),
580
580
  "aria-expanded": U,
581
- disabled: E?.has("collapseToggle"),
582
- onClick: re,
583
- children: /* @__PURE__ */ i(Mi, { open: U, size: 20 })
581
+ disabled: D?.has("collapseToggle"),
582
+ onClick: oe,
583
+ children: /* @__PURE__ */ i(Fi, { open: U, size: 20 })
584
584
  }
585
585
  )
586
586
  }
587
587
  ),
588
- !$ && /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__collapse-spacer" }),
589
- /* @__PURE__ */ i(Y, { content: ri, position: "right", size: "sm", children: /* @__PURE__ */ I(
588
+ !z && /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__collapse-spacer" }),
589
+ /* @__PURE__ */ i(Y, { content: oi, position: "right", size: "sm", children: /* @__PURE__ */ I(
590
590
  "span",
591
591
  {
592
592
  role: j ? "link" : void 0,
@@ -594,17 +594,17 @@ function Fi({
594
594
  className: [
595
595
  "nice-sidebar-nav__node-content",
596
596
  j ? "nice-sidebar-nav__node-content--link" : "",
597
- !j && $ ? "nice-sidebar-nav__node-content--toggle" : ""
597
+ !j && z ? "nice-sidebar-nav__node-content--toggle" : ""
598
598
  ].filter(Boolean).join(" "),
599
599
  onClick: Pe,
600
600
  onKeyDown: (h) => (h.key === "Enter" || h.key === " ") && Pe(),
601
- onPointerDown: be && Z && j ? (h) => {
602
- h.pointerType !== "touch" && an(Z, h, on(J()), e.label, {
601
+ onPointerDown: ve && Z && j ? (h) => {
602
+ h.pointerType !== "touch" && an(Z, h, sn(J()), e.label, {
603
603
  captureOnStart: !0
604
604
  });
605
605
  } : void 0,
606
606
  children: [
607
- e.icon && /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__node-icon", "aria-hidden": "true", children: Oe(e.icon) }),
607
+ e.icon && /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__node-icon", "aria-hidden": "true", children: Fe(e.icon) }),
608
608
  /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__node-label", children: e.label }),
609
609
  e.badge !== void 0 && /* @__PURE__ */ i(
610
610
  "span",
@@ -634,14 +634,14 @@ function Fi({
634
634
  "aria-haspopup": w ? "listbox" : void 0,
635
635
  "aria-expanded": w ? he : void 0,
636
636
  onClick: (h) => {
637
- h.stopPropagation(), w ? G((P) => !P) : W || a(J());
637
+ h.stopPropagation(), w ? G((P) => !P) : W || o(J());
638
638
  },
639
- children: W ? /* @__PURE__ */ i(_n, { size: 14 }) : /* @__PURE__ */ i(mn, { size: 14 })
639
+ children: W ? /* @__PURE__ */ i(Nn, { size: 14 }) : /* @__PURE__ */ i(_n, { size: 14 })
640
640
  }
641
641
  )
642
642
  }
643
643
  ),
644
- K ? j && /* @__PURE__ */ i(
644
+ q ? j && /* @__PURE__ */ i(
645
645
  Y,
646
646
  {
647
647
  content: y("sidebarNav.removeFavourite", "Remove from favourites"),
@@ -654,7 +654,7 @@ function Fi({
654
654
  className: "nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--remove",
655
655
  "aria-label": y("sidebarNav.removeFavourite", "Remove from favourites"),
656
656
  onClick: (h) => {
657
- h.stopPropagation(), K(e.id);
657
+ h.stopPropagation(), q(e.id);
658
658
  },
659
659
  children: /* @__PURE__ */ i(Oi, { size: 12 })
660
660
  }
@@ -666,60 +666,60 @@ function Fi({
666
666
  className: "nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--hide",
667
667
  "aria-label": y("sidebarNav.hideItem", "Hide item"),
668
668
  onClick: (h) => {
669
- h.stopPropagation(), v({ id: e.id, kind: e.kind, label: e.label });
669
+ h.stopPropagation(), b({ id: e.id, kind: e.kind, label: e.label });
670
670
  },
671
- children: /* @__PURE__ */ i(Nn, { size: 14 })
671
+ children: /* @__PURE__ */ i(gn, { size: 14 })
672
672
  }
673
673
  ) })
674
674
  ] })
675
675
  ] }),
676
- Fe.length > 0 && /* @__PURE__ */ i(sn, { target: ie, items: Fe, size: "sm" }),
676
+ Oe.length > 0 && /* @__PURE__ */ i(cn, { target: ie, items: Oe, size: "sm" }),
677
677
  he && w && /* @__PURE__ */ i(
678
- _t,
678
+ Nt,
679
679
  {
680
680
  anchorRef: ie,
681
681
  onClose: () => G(!1),
682
682
  multiple: !0,
683
- options: x && le ? [
683
+ options: L && le ? [
684
684
  ...w.lists,
685
685
  {
686
- id: mi,
686
+ id: _i,
687
687
  label: y("sidebarNav.shortcuts", "Shortcuts"),
688
- count: x.count
688
+ count: L.count
689
689
  }
690
690
  ] : w.lists,
691
- selected: ce === "user" ? [...w.listsOf(e.id), mi] : w.listsOf(e.id),
692
- onPick: (h) => h === mi && x ? x.toggle(J()) : w.toggle(J(), h),
691
+ selected: ce === "user" ? [...w.listsOf(e.id), _i] : w.listsOf(e.id),
692
+ onPick: (h) => h === _i && L ? L.toggle(J()) : w.toggle(J(), h),
693
693
  onCreate: (h) => w.create(h, J()),
694
694
  "aria-label": y("sidebarNav.favLists.title", "Favourites lists")
695
695
  }
696
696
  ),
697
- $ && U && /* @__PURE__ */ i("ul", { className: "nice-sidebar-nav__children", children: e.children.map((h) => /* @__PURE__ */ i(
698
- Fi,
697
+ z && U && /* @__PURE__ */ i("ul", { className: "nice-sidebar-nav__children", children: e.children.map((h) => /* @__PURE__ */ i(
698
+ Ei,
699
699
  {
700
700
  item: h,
701
701
  depth: r + 1,
702
702
  maxDepth: u,
703
- activeRoute: s,
703
+ activeRoute: a,
704
704
  collapsedIds: d,
705
705
  hiddenIds: l,
706
- autoExpand: b,
707
- sidebarCollapsed: _,
706
+ autoExpand: v,
707
+ sidebarCollapsed: N,
708
708
  expandableWhenCollapsed: k,
709
709
  onNavigate: C,
710
- onHide: v,
711
- onToggleCollapse: L,
712
- onAddFavorite: a,
710
+ onHide: b,
711
+ onToggleCollapse: M,
712
+ onAddFavorite: o,
713
713
  onRemoveFavorite: n,
714
- isFavorite: o,
714
+ isFavorite: s,
715
715
  leftClickBehavior: f,
716
- routeToUrl: g,
716
+ routeToUrl: S,
717
717
  contextMenu: A,
718
- disabledActions: E,
718
+ disabledActions: D,
719
719
  colorScope: Q,
720
720
  shading: V,
721
- path: M,
722
- onRemoveFromList: K
721
+ path: F,
722
+ onRemoveFromList: q
723
723
  },
724
724
  h.id
725
725
  )) })
@@ -727,32 +727,32 @@ function Fi({
727
727
  }
728
728
  );
729
729
  }
730
- function nn(e, r) {
730
+ function tn(e, r) {
731
731
  if (!r || r.length === 0)
732
732
  return e;
733
- const u = new Map(r.map((d, l) => [d, l])), s = r.length;
733
+ const u = new Map(r.map((d, l) => [d, l])), a = r.length;
734
734
  return [...e].sort((d, l) => {
735
- const b = u.has(d.id) ? u.get(d.id) : s + e.indexOf(d), _ = u.has(l.id) ? u.get(l.id) : s + e.indexOf(l);
736
- return b - _;
735
+ const v = u.has(d.id) ? u.get(d.id) : a + e.indexOf(d), N = u.has(l.id) ? u.get(l.id) : a + e.indexOf(l);
736
+ return v - N;
737
737
  });
738
738
  }
739
- function Sn(e, r, u) {
740
- return e.map((s) => ({
741
- id: s.id,
742
- label: s.label,
743
- tooltip: s.tooltip,
744
- icon: s.icon,
745
- route: s.route,
746
- badge: s.badge,
739
+ function wn(e, r, u) {
740
+ return e.map((a) => ({
741
+ id: a.id,
742
+ label: a.label,
743
+ tooltip: a.tooltip,
744
+ icon: a.icon,
745
+ route: a.route,
746
+ badge: a.badge,
747
747
  kind: "view",
748
748
  sourceId: r,
749
749
  moduleId: u,
750
- color: s.color,
751
- levelColors: s.levelColors,
752
- children: s.children?.length ? Sn(s.children, r, u) : []
750
+ color: a.color,
751
+ levelColors: a.levelColors,
752
+ children: a.children?.length ? wn(a.children, r, u) : []
753
753
  }));
754
754
  }
755
- function wn(e, r, u = e.id) {
755
+ function Cn(e, r, u = e.id) {
756
756
  return {
757
757
  id: u,
758
758
  label: e.label,
@@ -762,166 +762,166 @@ function wn(e, r, u = e.id) {
762
762
  sourceId: r,
763
763
  color: e.color,
764
764
  levelColors: e.levelColors,
765
- children: Sn(e.views, r, e.id)
765
+ children: wn(e.views, r, e.id)
766
766
  };
767
767
  }
768
- function It(e, r) {
769
- return e.map((u) => wn(u, r));
768
+ function xt(e, r) {
769
+ return e.map((u) => Cn(u, r));
770
770
  }
771
- function Ei(e, r, u) {
772
- return e.map((s) => ({
773
- id: s.id,
774
- label: s.label,
775
- tooltip: s.tooltip,
776
- icon: s.icon,
771
+ function Di(e, r, u) {
772
+ return e.map((a) => ({
773
+ id: a.id,
774
+ label: a.label,
775
+ tooltip: a.tooltip,
776
+ icon: a.icon,
777
777
  kind: r,
778
778
  sourceId: u,
779
- color: s.color,
780
- levelColors: s.levelColors,
781
- children: s.modules.map((d) => wn(d, u, `${s.id}:${d.id}`))
779
+ color: a.color,
780
+ levelColors: a.levelColors,
781
+ children: a.modules.map((d) => Cn(d, u, `${a.id}:${d.id}`))
782
782
  }));
783
783
  }
784
- function xt(e, r) {
785
- return Ei(e, "role", r);
786
- }
787
784
  function Lt(e, r) {
788
- return Ei(e, "unit", r);
785
+ return Di(e, "role", r);
786
+ }
787
+ function Mt(e, r) {
788
+ return Di(e, "unit", r);
789
789
  }
790
- function Cn(e, r, u, s) {
790
+ function yn(e, r, u, a) {
791
791
  if (r === "all")
792
- return nn(It(e.modules, e.source.id), s);
792
+ return tn(xt(e.modules, e.source.id), a);
793
793
  if (u !== void 0) {
794
794
  const d = (r === "by-role" ? e.roles : e.units).filter(
795
795
  (l) => l.id === u
796
796
  );
797
- return Ei(d, r === "by-role" ? "role" : "unit", e.source.id).flatMap(
797
+ return Di(d, r === "by-role" ? "role" : "unit", e.source.id).flatMap(
798
798
  (l) => l.children ?? []
799
799
  );
800
800
  }
801
- return nn(
802
- r === "by-role" ? xt(e.roles, e.source.id) : Lt(e.units, e.source.id),
803
- s
801
+ return tn(
802
+ r === "by-role" ? Lt(e.roles, e.source.id) : Mt(e.units, e.source.id),
803
+ a
804
804
  );
805
805
  }
806
- const gi = dt();
807
- function yn(e, r, u, s) {
808
- const { scope: d, vars: l } = cn(e, r, 1, u), b = ii(d, 1);
809
- return s === "theme" ? { scope: d, style: gi, marked: !1 } : s === "bar" ? b ? {
806
+ const Si = ut();
807
+ function kn(e, r, u, a) {
808
+ const { scope: d, vars: l } = ln(e, r, 1, u), v = ti(d, 1);
809
+ return a === "theme" ? { scope: d, style: Si, marked: !1 } : a === "bar" ? v ? {
810
810
  scope: d,
811
811
  style: {
812
- ...gi,
813
- "--nice-source-mark": b.bg
812
+ ...Si,
813
+ "--nice-source-mark": v.bg
814
814
  },
815
815
  marked: !0
816
- } : { scope: d, style: gi, marked: !1 } : b ? {
816
+ } : { scope: d, style: Si, marked: !1 } : v ? {
817
817
  scope: d,
818
818
  style: {
819
819
  ...l,
820
- "--nice-source-head-bg": b.bg,
821
- "--nice-source-head-color": b.text,
822
- "--nice-source-head-bg-active": b.activeBg,
823
- "--nice-source-head-accent": b.text
820
+ "--nice-source-head-bg": v.bg,
821
+ "--nice-source-head-color": v.text,
822
+ "--nice-source-head-bg-active": v.activeBg,
823
+ "--nice-source-head-accent": v.text
824
824
  },
825
825
  marked: !1
826
826
  } : { scope: d, style: l, marked: !1 };
827
827
  }
828
- function ki(e, r) {
828
+ function Ii(e, r) {
829
829
  for (const u of e) {
830
830
  if (u.route === r)
831
831
  return [];
832
832
  if (u.children?.length) {
833
- const s = ki(u.children, r);
834
- if (s)
835
- return [u.id, ...s];
833
+ const a = Ii(u.children, r);
834
+ if (a)
835
+ return [u.id, ...a];
836
836
  }
837
837
  }
838
838
  }
839
- function Mt({
839
+ function Ft({
840
840
  node: e,
841
841
  mode: r,
842
842
  maxDepth: u,
843
- isPinned: s,
843
+ isPinned: a,
844
844
  prefs: d,
845
845
  helpers: l,
846
- activeRoute: b,
847
- onNavigate: _,
846
+ activeRoute: v,
847
+ onNavigate: N,
848
848
  sidebarCollapsed: k = !1,
849
849
  expandableWhenCollapsed: C = !1,
850
- routeToUrl: v,
851
- contextMenu: L = !0,
852
- disabledActions: a,
850
+ routeToUrl: b,
851
+ contextMenu: M = !0,
852
+ disabledActions: o,
853
853
  showHeader: n = !0,
854
- colorScope: o,
854
+ colorScope: s,
855
855
  shading: f,
856
- groupFilter: g,
856
+ groupFilter: S,
857
857
  pin: A,
858
- query: E = ""
858
+ query: D = ""
859
859
  }) {
860
- const { t: z } = Ne(), V = se(null), te = B(() => new Set(d.hiddenItems.map((M) => M.id)), [d.hiddenItems]), K = ue(Ge), {
860
+ const { t: R } = Ne(), V = re(null), te = T(() => new Set(d.hiddenItems.map((F) => F.id)), [d.hiddenItems]), q = ue(Ue), {
861
861
  scope: y,
862
- style: q,
863
- marked: ve
864
- } = B(
865
- () => yn(o, e.source, f, K),
866
- [o, e.source, f, K]
867
- ), w = B(() => {
868
- const M = [{ id: e.source.id, label: e.source.label, icon: e.source.icon }], O = g === void 0 || r === "all" ? void 0 : (r === "by-role" ? e.roles : e.units).find((J) => J.id === g);
869
- return O ? [...M, { id: O.id, label: O.label, icon: O.icon }] : M;
870
- }, [e, r, g]), { children: x, searchOpen: Z } = B(() => {
871
- const M = Cn(
862
+ style: K,
863
+ marked: be
864
+ } = T(
865
+ () => kn(s, e.source, f, q),
866
+ [s, e.source, f, q]
867
+ ), w = T(() => {
868
+ const F = [{ id: e.source.id, label: e.source.label, icon: e.source.icon }], O = S === void 0 || r === "all" ? void 0 : (r === "by-role" ? e.roles : e.units).find((J) => J.id === S);
869
+ return O ? [...F, { id: O.id, label: O.label, icon: O.icon }] : F;
870
+ }, [e, r, S]), { children: L, searchOpen: Z } = T(() => {
871
+ const F = yn(
872
872
  e,
873
873
  r,
874
- g,
874
+ S,
875
875
  d.itemOrder[r]
876
876
  );
877
- if (!E)
878
- return { children: M, searchOpen: null };
877
+ if (!D)
878
+ return { children: F, searchOpen: null };
879
879
  const O = /* @__PURE__ */ new Set();
880
- return { children: un(M, E, O), searchOpen: O };
881
- }, [r, e, d.itemOrder, g, E]), be = ee(
882
- (M) => Li({ favorites: d.favorites, favoriteLists: d.favoriteLists }, M).length > 0,
880
+ return { children: bn(F, D, O), searchOpen: O };
881
+ }, [r, e, d.itemOrder, S, D]), ve = ee(
882
+ (F) => Mi({ favorites: d.favorites, favoriteLists: d.favoriteLists }, F).length > 0,
883
883
  [d.favorites, d.favoriteLists]
884
- ), he = se(void 0);
885
- ni(() => {
886
- if (!b || he.current === b)
884
+ ), he = re(void 0);
885
+ Ge(() => {
886
+ if (!v || he.current === v)
887
887
  return;
888
- const M = ki(x, b);
889
- if (!M)
888
+ const F = Ii(L, v);
889
+ if (!F)
890
890
  return;
891
- he.current = b;
892
- const O = M.filter(
891
+ he.current = v;
892
+ const O = F.filter(
893
893
  (J) => d.autoExpand ? d.collapsedIds.includes(J) : !d.collapsedIds.includes(J)
894
894
  );
895
895
  O.length > 0 && l.setCollapsed(O, !d.autoExpand);
896
- }, [b, x, d.autoExpand, d.collapsedIds, l]);
897
- const G = B(() => L ? [
896
+ }, [v, L, d.autoExpand, d.collapsedIds, l]);
897
+ const G = T(() => M ? [
898
898
  {
899
- id: s ? "unpinSource" : "pinSource",
900
- label: s ? z("sidebar.menu.unpinSource", "Unpin source") : z("sidebar.menu.pinSource", "Pin source"),
901
- onClick: () => s ? l.unpinSource(r, e.source.id) : l.pinSource(r, e.source.id)
899
+ id: a ? "unpinSource" : "pinSource",
900
+ label: a ? R("sidebar.menu.unpinSource", "Unpin source") : R("sidebar.menu.pinSource", "Pin source"),
901
+ onClick: () => a ? l.unpinSource(r, e.source.id) : l.pinSource(r, e.source.id)
902
902
  },
903
903
  {
904
904
  id: "hideSource",
905
- label: z("sidebar.menu.hideSource", "Hide source"),
906
- disabled: !!a?.has("hide"),
905
+ label: R("sidebar.menu.hideSource", "Hide source"),
906
+ disabled: !!o?.has("hide"),
907
907
  onClick: () => l.hideItem({
908
908
  id: e.source.id,
909
909
  kind: "source",
910
910
  label: e.source.label
911
911
  })
912
912
  }
913
- ] : [], [L, a, s, l, r, e.source, z]), ie = B(
914
- () => !!b && ki(x, b) !== void 0,
915
- [b, x]
913
+ ] : [], [M, o, a, l, r, e.source, R]), ie = T(
914
+ () => !!v && Ii(L, v) !== void 0,
915
+ [v, L]
916
916
  );
917
917
  if (te.has(e.source.id))
918
918
  return null;
919
- const $ = d.collapsedIds.includes(e.source.id), ke = d.autoExpand ? !$ : $, Ie = x.filter((M) => (M.children?.length ?? 0) > 0).map((M) => M.id), U = Ie.length > 0, re = U && Ie.every((M) => d.collapsedIds.includes(M)), xe = U ? !re : ke, j = !n || U ? !0 : ke, W = () => {
920
- a?.has("collapseToggle") || (U ? l.setCollapsed(Ie, !re) : l.toggleCollapse(e.source.id));
921
- }, ce = ve ? "nice-sidebar-nav__source-section nice-sidebar-nav__source-section--marked" : "nice-sidebar-nav__source-section", le = (M) => /* @__PURE__ */ i(Y, { content: e.source.tooltip ?? e.source.label, position: "right", size: "sm", children: /* @__PURE__ */ I(
919
+ const z = d.collapsedIds.includes(e.source.id), ke = d.autoExpand ? !z : z, Ie = L.filter((F) => (F.children?.length ?? 0) > 0).map((F) => F.id), U = Ie.length > 0, oe = U && Ie.every((F) => d.collapsedIds.includes(F)), xe = U ? !oe : ke, j = !n || U ? !0 : ke, W = () => {
920
+ o?.has("collapseToggle") || (U ? l.setCollapsed(Ie, !oe) : l.toggleCollapse(e.source.id));
921
+ }, ce = be ? "nice-sidebar-nav__source-section nice-sidebar-nav__source-section--marked" : "nice-sidebar-nav__source-section", le = (F) => /* @__PURE__ */ i(Y, { content: e.source.tooltip ?? e.source.label, position: "right", size: "sm", children: /* @__PURE__ */ I(
922
922
  "div",
923
923
  {
924
- ref: M ? V : void 0,
924
+ ref: F ? V : void 0,
925
925
  className: "nice-sidebar-nav__source-header",
926
926
  onClick: (O) => {
927
927
  O.target.closest(".nice-sidebar-nav__source-actions") || W();
@@ -933,8 +933,8 @@ function Mt({
933
933
  (O.key === "Enter" || O.key === " ") && (O.preventDefault(), W());
934
934
  },
935
935
  children: [
936
- /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__source-chevron", "aria-hidden": "true", children: /* @__PURE__ */ i(Mi, { open: xe, size: 16 }) }),
937
- e.source.icon && /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__source-icon", "aria-hidden": "true", children: Oe(e.source.icon) }),
936
+ /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__source-chevron", "aria-hidden": "true", children: /* @__PURE__ */ i(Fi, { open: xe, size: 16 }) }),
937
+ e.source.icon && /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__source-icon", "aria-hidden": "true", children: Fe(e.source.icon) }),
938
938
  /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__source-label", children: e.source.label }),
939
939
  /* @__PURE__ */ I(
940
940
  "div",
@@ -948,7 +948,7 @@ function Mt({
948
948
  /* @__PURE__ */ i(
949
949
  Y,
950
950
  {
951
- content: s ? z("sidebarNav.unpinSource", "Unpin source") : z("sidebarNav.pinSource", "Pin source"),
951
+ content: a ? R("sidebarNav.unpinSource", "Unpin source") : R("sidebarNav.pinSource", "Pin source"),
952
952
  position: "top",
953
953
  size: "sm",
954
954
  children: /* @__PURE__ */ i(
@@ -956,26 +956,26 @@ function Mt({
956
956
  {
957
957
  className: [
958
958
  "nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--pin",
959
- s ? "nice-sidebar-nav__action-btn--pin-active" : ""
959
+ a ? "nice-sidebar-nav__action-btn--pin-active" : ""
960
960
  ].filter(Boolean).join(" "),
961
- "aria-label": s ? z("sidebarNav.unpinSource", "Unpin source") : z("sidebarNav.pinSource", "Pin source"),
962
- onClick: () => s ? l.unpinSource(r, e.source.id) : l.pinSource(r, e.source.id),
963
- children: /* @__PURE__ */ i(kt, { size: 14, filled: s })
961
+ "aria-label": a ? R("sidebarNav.unpinSource", "Unpin source") : R("sidebarNav.pinSource", "Pin source"),
962
+ onClick: () => a ? l.unpinSource(r, e.source.id) : l.pinSource(r, e.source.id),
963
+ children: /* @__PURE__ */ i(It, { size: 14, filled: a })
964
964
  }
965
965
  )
966
966
  }
967
967
  ),
968
- /* @__PURE__ */ i(Y, { content: z("sidebarNav.hideSource", "Hide source"), position: "top", size: "sm", children: /* @__PURE__ */ i(
968
+ /* @__PURE__ */ i(Y, { content: R("sidebarNav.hideSource", "Hide source"), position: "top", size: "sm", children: /* @__PURE__ */ i(
969
969
  "button",
970
970
  {
971
971
  className: "nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--hide",
972
- "aria-label": z("sidebarNav.hideSource", "Hide source"),
972
+ "aria-label": R("sidebarNav.hideSource", "Hide source"),
973
973
  onClick: () => l.hideItem({
974
974
  id: e.source.id,
975
975
  kind: "source",
976
976
  label: e.source.label
977
977
  }),
978
- children: /* @__PURE__ */ i(Nn, { size: 14 })
978
+ children: /* @__PURE__ */ i(gn, { size: 14 })
979
979
  }
980
980
  ) })
981
981
  ]
@@ -983,9 +983,9 @@ function Mt({
983
983
  )
984
984
  ]
985
985
  }
986
- ) }), Q = G.length > 0 ? /* @__PURE__ */ i(sn, { target: V, items: G, size: "sm" }) : null, pe = !!A?.current;
987
- return /* @__PURE__ */ I("section", { className: ce, style: q, "data-source-index": A?.index, children: [
988
- n && !A && /* @__PURE__ */ I(tn, { children: [
986
+ ) }), Q = G.length > 0 ? /* @__PURE__ */ i(cn, { target: V, items: G, size: "sm" }) : null, pe = !!A?.current;
987
+ return /* @__PURE__ */ I("section", { className: ce, style: K, "data-source-index": A?.index, children: [
988
+ n && !A && /* @__PURE__ */ I(rn, { children: [
989
989
  le(!0),
990
990
  Q
991
991
  ] }),
@@ -1001,7 +1001,7 @@ function Mt({
1001
1001
  ]
1002
1002
  }
1003
1003
  ),
1004
- n && pe && A?.slot && tt(
1004
+ n && pe && A?.slot && rt(
1005
1005
  /* @__PURE__ */ I(
1006
1006
  "section",
1007
1007
  {
@@ -1010,7 +1010,7 @@ function Mt({
1010
1010
  "nice-sidebar-nav__source-section--pinned",
1011
1011
  ie ? "nice-sidebar-nav__source-section--has-active" : ""
1012
1012
  ].filter(Boolean).join(" "),
1013
- style: q,
1013
+ style: K,
1014
1014
  children: [
1015
1015
  le(!0),
1016
1016
  Q
@@ -1019,33 +1019,33 @@ function Mt({
1019
1019
  ),
1020
1020
  A.slot
1021
1021
  ),
1022
- u > 1 && j && /* @__PURE__ */ i(gn.Provider, { value: Z, children: /* @__PURE__ */ i("ul", { className: "nice-sidebar-nav__tree", children: x.map((M) => /* @__PURE__ */ i(
1023
- Fi,
1022
+ u > 1 && j && /* @__PURE__ */ i(Sn.Provider, { value: Z, children: /* @__PURE__ */ i("ul", { className: "nice-sidebar-nav__tree", children: L.map((F) => /* @__PURE__ */ i(
1023
+ Ei,
1024
1024
  {
1025
- item: M,
1025
+ item: F,
1026
1026
  depth: 2,
1027
1027
  maxDepth: u,
1028
- activeRoute: b,
1028
+ activeRoute: v,
1029
1029
  collapsedIds: d.collapsedIds,
1030
1030
  hiddenIds: te,
1031
1031
  autoExpand: d.autoExpand,
1032
1032
  sidebarCollapsed: k,
1033
1033
  expandableWhenCollapsed: C,
1034
- onNavigate: _,
1034
+ onNavigate: N,
1035
1035
  onHide: l.hideItem,
1036
1036
  onToggleCollapse: l.toggleCollapse,
1037
1037
  onAddFavorite: l.addFavorite,
1038
1038
  onRemoveFavorite: l.removeFavorite,
1039
- isFavorite: be,
1039
+ isFavorite: ve,
1040
1040
  leftClickBehavior: d.leftClickBehavior,
1041
- routeToUrl: v,
1042
- contextMenu: L,
1043
- disabledActions: a,
1041
+ routeToUrl: b,
1042
+ contextMenu: M,
1043
+ disabledActions: o,
1044
1044
  colorScope: y,
1045
1045
  shading: f,
1046
1046
  path: w
1047
1047
  },
1048
- M.id
1048
+ F.id
1049
1049
  )) }) })
1050
1050
  ] });
1051
1051
  }
@@ -1053,26 +1053,26 @@ function Ot({
1053
1053
  favorites: e,
1054
1054
  activeRoute: r,
1055
1055
  onNavigate: u,
1056
- onRemove: s,
1056
+ onRemove: a,
1057
1057
  collapsed: d = !1,
1058
1058
  leftClickBehavior: l = "focus-existing"
1059
1059
  }) {
1060
- const { t: b } = Ne(), _ = ue(Ge), k = _ === "fill", C = l === "open-new";
1061
- return e.length === 0 ? /* @__PURE__ */ i("p", { className: "nice-sidebar-nav__empty", children: b(
1060
+ const { t: v } = Ne(), N = ue(Ue), k = N === "fill", C = l === "open-new";
1061
+ return e.length === 0 ? /* @__PURE__ */ i("p", { className: "nice-sidebar-nav__empty", children: v(
1062
1062
  "sidebarNav.noFavourites",
1063
1063
  "No favourites yet. Hover an item and click the star to add it."
1064
- ) }) : /* @__PURE__ */ i("ul", { className: "nice-sidebar-nav__favorites-list", children: e.map((v) => {
1065
- const L = !!(v.route && v.route === r), a = {
1064
+ ) }) : /* @__PURE__ */ i("ul", { className: "nice-sidebar-nav__favorites-list", children: e.map((b) => {
1065
+ const M = !!(b.route && b.route === r), o = {
1066
1066
  forceNew: C,
1067
- color: v.color,
1068
- branchColor: v.color
1069
- }, n = v.color && _ !== "theme" ? ct(v.color) : void 0;
1067
+ color: b.color,
1068
+ branchColor: b.color
1069
+ }, n = b.color && N !== "theme" ? lt(b.color) : void 0;
1070
1070
  return /* @__PURE__ */ I(
1071
1071
  "li",
1072
1072
  {
1073
1073
  className: [
1074
1074
  "nice-sidebar-nav__fav-item",
1075
- L ? "nice-sidebar-nav__fav-item--active" : "",
1075
+ M ? "nice-sidebar-nav__fav-item--active" : "",
1076
1076
  n ? k ? "nice-sidebar-nav__fav-item--colored" : "nice-sidebar-nav__fav-item--marked" : ""
1077
1077
  ].filter(Boolean).join(" "),
1078
1078
  style: n ? k ? {
@@ -1081,36 +1081,36 @@ function Ot({
1081
1081
  "--nice-fav-hover-bg": n.hoverBg
1082
1082
  } : { "--nice-fav-mark": n.bg } : void 0,
1083
1083
  children: [
1084
- /* @__PURE__ */ i(Y, { content: v.tooltip ?? v.label, position: "right", size: "sm", children: /* @__PURE__ */ I(
1084
+ /* @__PURE__ */ i(Y, { content: b.tooltip ?? b.label, position: "right", size: "sm", children: /* @__PURE__ */ I(
1085
1085
  "span",
1086
1086
  {
1087
1087
  role: "link",
1088
1088
  tabIndex: 0,
1089
1089
  className: "nice-sidebar-nav__fav-content",
1090
1090
  onClick: () => {
1091
- v.route && u?.(v.route, v, a);
1091
+ b.route && u?.(b.route, b, o);
1092
1092
  },
1093
- onKeyDown: (o) => {
1094
- (o.key === "Enter" || o.key === " ") && v.route && u?.(v.route, v, a);
1093
+ onKeyDown: (s) => {
1094
+ (s.key === "Enter" || s.key === " ") && b.route && u?.(b.route, b, o);
1095
1095
  },
1096
1096
  children: [
1097
- (typeof v.icon == "string" || Ii(v.icon)) && /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__fav-icon", "aria-hidden": "true", children: Oe(v.icon) }),
1098
- /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__fav-label", children: v.label })
1097
+ (typeof b.icon == "string" || xi(b.icon)) && /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__fav-icon", "aria-hidden": "true", children: Fe(b.icon) }),
1098
+ /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__fav-label", children: b.label })
1099
1099
  ]
1100
1100
  }
1101
1101
  ) }),
1102
1102
  !d && /* @__PURE__ */ i(
1103
1103
  Y,
1104
1104
  {
1105
- content: b("sidebarNav.removeFavourite", "Remove from favourites"),
1105
+ content: v("sidebarNav.removeFavourite", "Remove from favourites"),
1106
1106
  position: "top",
1107
1107
  size: "sm",
1108
1108
  children: /* @__PURE__ */ i(
1109
1109
  "button",
1110
1110
  {
1111
1111
  className: "nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--remove",
1112
- "aria-label": b("sidebarNav.removeFavourite", "Remove from favourites"),
1113
- onClick: () => s(v.id),
1112
+ "aria-label": v("sidebarNav.removeFavourite", "Remove from favourites"),
1113
+ onClick: () => a(b.id),
1114
1114
  children: /* @__PURE__ */ i(Oi, { size: 12 })
1115
1115
  }
1116
1116
  )
@@ -1118,12 +1118,12 @@ function Ot({
1118
1118
  )
1119
1119
  ]
1120
1120
  },
1121
- v.id
1121
+ b.id
1122
1122
  );
1123
1123
  }) });
1124
1124
  }
1125
- const Si = "fav:", Ft = /* @__PURE__ */ new Set();
1126
- function kn(e) {
1125
+ const wi = "fav:", Et = /* @__PURE__ */ new Set();
1126
+ function In(e) {
1127
1127
  const r = e.favorite;
1128
1128
  return {
1129
1129
  id: e.id,
@@ -1134,101 +1134,101 @@ function kn(e) {
1134
1134
  kind: r ? "view" : "module",
1135
1135
  sourceId: r?.sourceId,
1136
1136
  moduleId: r?.moduleId,
1137
- children: e.children.map(kn)
1137
+ children: e.children.map(In)
1138
1138
  };
1139
1139
  }
1140
- function Et({
1140
+ function Dt({
1141
1141
  favorites: e,
1142
1142
  pathOf: r,
1143
1143
  sources: u,
1144
- rank: s,
1144
+ rank: a,
1145
1145
  showSources: d,
1146
1146
  prefs: l,
1147
- helpers: b,
1148
- activeRoute: _,
1147
+ helpers: v,
1148
+ activeRoute: N,
1149
1149
  onNavigate: k,
1150
1150
  onRemove: C,
1151
- collapsed: v,
1152
- routeToUrl: L,
1153
- contextMenu: a,
1151
+ collapsed: b,
1152
+ routeToUrl: M,
1153
+ contextMenu: o,
1154
1154
  disabledActions: n,
1155
- colorScope: o,
1155
+ colorScope: s,
1156
1156
  shading: f
1157
1157
  }) {
1158
- const { t: g } = Ne(), A = ue(Ge), E = B(
1159
- () => ht(e, r, (w) => s.get(w)),
1160
- [e, r, s]
1161
- ), z = B(
1162
- () => l.collapsedIds.filter((w) => w.startsWith(Si)).map((w) => w.slice(Si.length)),
1158
+ const { t: S } = Ne(), A = ue(Ue), D = T(
1159
+ () => pt(e, r, (w) => a.get(w)),
1160
+ [e, r, a]
1161
+ ), R = T(
1162
+ () => l.collapsedIds.filter((w) => w.startsWith(wi)).map((w) => w.slice(wi.length)),
1163
1163
  [l.collapsedIds]
1164
1164
  ), V = ee(
1165
- (w) => b.toggleCollapse(Si + w),
1166
- [b]
1165
+ (w) => v.toggleCollapse(wi + w),
1166
+ [v]
1167
1167
  ), te = ee(
1168
- (w) => Li({ favorites: l.favorites, favoriteLists: l.favoriteLists }, w).length > 0,
1168
+ (w) => Mi({ favorites: l.favorites, favoriteLists: l.favoriteLists }, w).length > 0,
1169
1169
  [l.favorites, l.favoriteLists]
1170
1170
  );
1171
1171
  if (e.length === 0)
1172
- return /* @__PURE__ */ i("p", { className: "nice-sidebar-nav__empty", children: g(
1172
+ return /* @__PURE__ */ i("p", { className: "nice-sidebar-nav__empty", children: S(
1173
1173
  "sidebarNav.noFavourites",
1174
1174
  "No favourites yet. Hover an item and click the star to add it."
1175
1175
  ) });
1176
- const K = (w, x, Z, be) => /* @__PURE__ */ i(
1177
- Fi,
1176
+ const q = (w, L, Z, ve) => /* @__PURE__ */ i(
1177
+ Ei,
1178
1178
  {
1179
- item: kn(w),
1179
+ item: In(w),
1180
1180
  depth: 2,
1181
1181
  maxDepth: Number.POSITIVE_INFINITY,
1182
- activeRoute: _,
1183
- collapsedIds: z,
1184
- hiddenIds: Ft,
1182
+ activeRoute: N,
1183
+ collapsedIds: R,
1184
+ hiddenIds: Et,
1185
1185
  autoExpand: !0,
1186
- sidebarCollapsed: v,
1186
+ sidebarCollapsed: b,
1187
1187
  onNavigate: k,
1188
- onHide: b.hideItem,
1188
+ onHide: v.hideItem,
1189
1189
  onToggleCollapse: V,
1190
- onAddFavorite: b.addFavorite,
1191
- onRemoveFavorite: b.removeFavorite,
1190
+ onAddFavorite: v.addFavorite,
1191
+ onRemoveFavorite: v.removeFavorite,
1192
1192
  isFavorite: te,
1193
1193
  leftClickBehavior: l.leftClickBehavior,
1194
- routeToUrl: L,
1195
- contextMenu: a,
1194
+ routeToUrl: M,
1195
+ contextMenu: o,
1196
1196
  disabledActions: n,
1197
- colorScope: x,
1197
+ colorScope: L,
1198
1198
  shading: f,
1199
1199
  path: Z,
1200
1200
  onRemoveFromList: C
1201
1201
  },
1202
- be
1202
+ ve
1203
1203
  ), y = [];
1204
- let q = [];
1205
- const ve = () => {
1206
- q.length > 0 && (y.push(
1207
- /* @__PURE__ */ i("ul", { className: "nice-sidebar-nav__tree", children: q }, `rows-${y.length}`)
1208
- ), q = []);
1204
+ let K = [];
1205
+ const be = () => {
1206
+ K.length > 0 && (y.push(
1207
+ /* @__PURE__ */ i("ul", { className: "nice-sidebar-nav__tree", children: K }, `rows-${y.length}`)
1208
+ ), K = []);
1209
1209
  };
1210
- for (const w of E) {
1211
- const x = u.get(w.id);
1212
- if (!x) {
1213
- q.push(K(w, o, [], w.id));
1210
+ for (const w of D) {
1211
+ const L = u.get(w.id);
1212
+ if (!L) {
1213
+ K.push(q(w, s, [], w.id));
1214
1214
  continue;
1215
1215
  }
1216
- const { scope: Z, style: be, marked: he } = yn(o, x, f, A), G = [{ id: x.id, label: x.label, icon: x.icon }];
1216
+ const { scope: Z, style: ve, marked: he } = kn(s, L, f, A), G = [{ id: L.id, label: L.label, icon: L.icon }];
1217
1217
  if (!d) {
1218
- for (const $ of w.children)
1219
- q.push(K($, Z, G, `${w.id}/${$.id}`));
1218
+ for (const z of w.children)
1219
+ K.push(q(z, Z, G, `${w.id}/${z.id}`));
1220
1220
  continue;
1221
1221
  }
1222
- ve();
1223
- const ie = !z.includes(w.id);
1222
+ be();
1223
+ const ie = !R.includes(w.id);
1224
1224
  y.push(
1225
1225
  /* @__PURE__ */ I(
1226
1226
  "section",
1227
1227
  {
1228
1228
  className: he ? "nice-sidebar-nav__source-section nice-sidebar-nav__source-section--marked" : "nice-sidebar-nav__source-section",
1229
- style: be,
1229
+ style: ve,
1230
1230
  children: [
1231
- /* @__PURE__ */ i(Y, { content: x.tooltip ?? x.label, position: "right", size: "sm", children: /* @__PURE__ */ I(
1231
+ /* @__PURE__ */ i(Y, { content: L.tooltip ?? L.label, position: "right", size: "sm", children: /* @__PURE__ */ I(
1232
1232
  "div",
1233
1233
  {
1234
1234
  className: "nice-sidebar-nav__source-header",
@@ -1236,57 +1236,57 @@ function Et({
1236
1236
  tabIndex: 0,
1237
1237
  "aria-expanded": ie,
1238
1238
  onClick: () => V(w.id),
1239
- onKeyDown: ($) => {
1240
- ($.key === "Enter" || $.key === " ") && ($.preventDefault(), V(w.id));
1239
+ onKeyDown: (z) => {
1240
+ (z.key === "Enter" || z.key === " ") && (z.preventDefault(), V(w.id));
1241
1241
  },
1242
1242
  children: [
1243
- /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__source-chevron", "aria-hidden": "true", children: /* @__PURE__ */ i(Mi, { open: ie, size: 16 }) }),
1244
- x.icon && /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__source-icon", "aria-hidden": "true", children: Oe(x.icon) }),
1245
- /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__source-label", children: x.label })
1243
+ /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__source-chevron", "aria-hidden": "true", children: /* @__PURE__ */ i(Fi, { open: ie, size: 16 }) }),
1244
+ L.icon && /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__source-icon", "aria-hidden": "true", children: Fe(L.icon) }),
1245
+ /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__source-label", children: L.label })
1246
1246
  ]
1247
1247
  }
1248
1248
  ) }),
1249
- ie && /* @__PURE__ */ i("ul", { className: "nice-sidebar-nav__tree", children: w.children.map(($) => K($, Z, G, $.id)) })
1249
+ ie && /* @__PURE__ */ i("ul", { className: "nice-sidebar-nav__tree", children: w.children.map((z) => q(z, Z, G, z.id)) })
1250
1250
  ]
1251
1251
  },
1252
1252
  w.id
1253
1253
  )
1254
1254
  );
1255
1255
  }
1256
- return ve(), /* @__PURE__ */ i(tn, { children: y });
1256
+ return be(), /* @__PURE__ */ i(rn, { children: y });
1257
1257
  }
1258
- function Dt(e, r, u) {
1259
- const s = [], d = /* @__PURE__ */ new Set();
1260
- return Ci(
1258
+ function At(e, r, u) {
1259
+ const a = [], d = /* @__PURE__ */ new Set();
1260
+ return yi(
1261
1261
  e,
1262
1262
  (l) => {
1263
1263
  if (l.kind !== "view")
1264
1264
  return;
1265
- const b = l.item;
1266
- if (b.children?.length && !b.route)
1265
+ const v = l.item;
1266
+ if (v.children?.length && !v.route)
1267
1267
  return;
1268
- const _ = `${l.sourceId}::${b.id}`;
1269
- d.has(_) || (d.add(_), s.push({ view: b, breadcrumb: l.ancestors, color: l.color, branchColor: l.branchColor }));
1268
+ const N = `${l.sourceId}::${v.id}`;
1269
+ d.has(N) || (d.add(N), a.push({ view: v, breadcrumb: l.ancestors, color: l.color, branchColor: l.branchColor }));
1270
1270
  },
1271
1271
  { trees: ["modules", "roles", "units"], levelColors: r, shading: u }
1272
- ), s;
1272
+ ), a;
1273
1273
  }
1274
- function At({
1274
+ function Bt({
1275
1275
  data: e,
1276
1276
  activeRoute: r,
1277
1277
  onNavigate: u,
1278
- hiddenIds: s,
1278
+ hiddenIds: a,
1279
1279
  leftClickBehavior: d = "focus-existing",
1280
1280
  levelColors: l,
1281
- shading: b
1281
+ shading: v
1282
1282
  }) {
1283
- const { t: _ } = Ne(), [k, C] = ye(""), v = d === "open-new", L = B(
1284
- () => Dt(e, l, b),
1285
- [e, l, b]
1286
- ), a = B(() => {
1283
+ const { t: N } = Ne(), [k, C] = ye(""), b = d === "open-new", M = T(
1284
+ () => At(e, l, v),
1285
+ [e, l, v]
1286
+ ), o = T(() => {
1287
1287
  const n = k.trim().toLowerCase();
1288
- return n ? L.filter((o) => s.has(o.view.id) || o.breadcrumb.some((f) => s.has(f.id)) ? !1 : o.view.label.toLowerCase().includes(n) ? !0 : o.breadcrumb.some((f) => f.label.toLowerCase().includes(n))) : [];
1289
- }, [L, k, s]);
1288
+ return n ? M.filter((s) => a.has(s.view.id) || s.breadcrumb.some((f) => a.has(f.id)) ? !1 : s.view.label.toLowerCase().includes(n) ? !0 : s.breadcrumb.some((f) => f.label.toLowerCase().includes(n))) : [];
1289
+ }, [M, k, a]);
1290
1290
  return /* @__PURE__ */ I("div", { className: "nice-sidebar-nav__search", children: [
1291
1291
  /* @__PURE__ */ I("div", { className: "nice-sidebar-nav__search-inputWrap", children: [
1292
1292
  /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__search-icon", "aria-hidden": "true", children: /* @__PURE__ */ i(ne, { name: "search", size: 14 }) }),
@@ -1295,11 +1295,11 @@ function At({
1295
1295
  {
1296
1296
  type: "text",
1297
1297
  className: "nice-sidebar-nav__search-input",
1298
- placeholder: _("sidebarNav.search.placeholder", "Search views…"),
1298
+ placeholder: N("sidebarNav.search.placeholder", "Search views…"),
1299
1299
  value: k,
1300
1300
  onChange: (n) => C(n.target.value),
1301
1301
  autoFocus: !0,
1302
- "aria-label": _("sidebarNav.search.label", "Search views")
1302
+ "aria-label": N("sidebarNav.search.label", "Search views")
1303
1303
  }
1304
1304
  ),
1305
1305
  k && /* @__PURE__ */ i(
@@ -1307,21 +1307,21 @@ function At({
1307
1307
  {
1308
1308
  type: "button",
1309
1309
  className: "nice-sidebar-nav__search-clear",
1310
- "aria-label": _("common.clear", "Clear"),
1310
+ "aria-label": N("common.clear", "Clear"),
1311
1311
  onClick: () => C(""),
1312
1312
  children: /* @__PURE__ */ i(Oi, { size: 12 })
1313
1313
  }
1314
1314
  )
1315
1315
  ] }),
1316
- !k.trim() && /* @__PURE__ */ i("p", { className: "nice-sidebar-nav__empty", children: _("sidebarNav.searchHint", "Type to search every view available in the panel.") }),
1317
- k.trim() && a.length === 0 && /* @__PURE__ */ I("p", { className: "nice-sidebar-nav__empty", children: [
1318
- _("sidebarNav.noResults", "No results for"),
1316
+ !k.trim() && /* @__PURE__ */ i("p", { className: "nice-sidebar-nav__empty", children: N("sidebarNav.searchHint", "Type to search every view available in the panel.") }),
1317
+ k.trim() && o.length === 0 && /* @__PURE__ */ I("p", { className: "nice-sidebar-nav__empty", children: [
1318
+ N("sidebarNav.noResults", "No results for"),
1319
1319
  " “",
1320
1320
  k,
1321
1321
  "”."
1322
1322
  ] }),
1323
- a.length > 0 && /* @__PURE__ */ i("ul", { className: "nice-sidebar-nav__search-results", children: a.map((n, o) => {
1324
- const f = !!(n.view.route && n.view.route === r), g = !!n.view.route;
1323
+ o.length > 0 && /* @__PURE__ */ i("ul", { className: "nice-sidebar-nav__search-results", children: o.map((n, s) => {
1324
+ const f = !!(n.view.route && n.view.route === r), S = !!n.view.route;
1325
1325
  return /* @__PURE__ */ i(
1326
1326
  "li",
1327
1327
  {
@@ -1334,23 +1334,23 @@ function At({
1334
1334
  {
1335
1335
  type: "button",
1336
1336
  className: "nice-sidebar-nav__search-result-btn",
1337
- disabled: !g,
1337
+ disabled: !S,
1338
1338
  onClick: () => {
1339
- g && n.view.route && u?.(n.view.route, n.view, {
1340
- forceNew: v,
1339
+ S && n.view.route && u?.(n.view.route, n.view, {
1340
+ forceNew: b,
1341
1341
  color: n.color,
1342
1342
  branchColor: n.branchColor,
1343
1343
  path: [...n.breadcrumb, { id: n.view.id, label: n.view.label }]
1344
1344
  });
1345
1345
  },
1346
1346
  children: [
1347
- /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__search-result-breadcrumb", children: n.breadcrumb.map((A, E) => /* @__PURE__ */ I("span", { className: "nice-sidebar-nav__search-crumb", children: [
1348
- A.icon && /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__search-crumb-icon", "aria-hidden": "true", children: Oe(A.icon) }),
1347
+ /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__search-result-breadcrumb", children: n.breadcrumb.map((A, D) => /* @__PURE__ */ I("span", { className: "nice-sidebar-nav__search-crumb", children: [
1348
+ A.icon && /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__search-crumb-icon", "aria-hidden": "true", children: Fe(A.icon) }),
1349
1349
  /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__search-crumb-label", children: A.label }),
1350
1350
  /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__search-crumb-sep", "aria-hidden": "true", children: "›" })
1351
- ] }, `${A.id}-${E}`)) }),
1351
+ ] }, `${A.id}-${D}`)) }),
1352
1352
  /* @__PURE__ */ I("span", { className: "nice-sidebar-nav__search-result-view", children: [
1353
- n.view.icon && /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__node-icon", "aria-hidden": "true", children: Oe(n.view.icon) }),
1353
+ n.view.icon && /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__node-icon", "aria-hidden": "true", children: Fe(n.view.icon) }),
1354
1354
  /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__node-label", children: n.view.label }),
1355
1355
  n.view.badge !== void 0 && /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__node-badge", children: n.view.badge })
1356
1356
  ] })
@@ -1358,7 +1358,7 @@ function At({
1358
1358
  }
1359
1359
  )
1360
1360
  },
1361
- `${n.view.id}-${o}`
1361
+ `${n.view.id}-${s}`
1362
1362
  );
1363
1363
  }) })
1364
1364
  ] });
@@ -1368,19 +1368,19 @@ function Tt({
1368
1368
  onNavigate: r,
1369
1369
  leftClickBehavior: u = "focus-existing"
1370
1370
  }) {
1371
- const { t: s } = Ne(), d = u === "open-new";
1372
- return /* @__PURE__ */ i("ul", { className: "nice-sidebar-nav__prefs-categories", role: "list", children: ft.map((l) => {
1373
- const b = s(l.labelKey, l.labelDefault), _ = e === l.route, k = { id: l.id, label: b, icon: l.icon, route: l.route };
1371
+ const { t: a } = Ne(), d = u === "open-new";
1372
+ return /* @__PURE__ */ i("ul", { className: "nice-sidebar-nav__prefs-categories", role: "list", children: mt.map((l) => {
1373
+ const v = a(l.labelKey, l.labelDefault), N = e === l.route, k = { id: l.id, label: v, icon: l.icon, route: l.route };
1374
1374
  return /* @__PURE__ */ i(
1375
1375
  "li",
1376
1376
  {
1377
1377
  className: [
1378
1378
  "nice-sidebar-nav__node nice-sidebar-nav__node--leaf",
1379
- _ ? "nice-sidebar-nav__node--active" : ""
1379
+ N ? "nice-sidebar-nav__node--active" : ""
1380
1380
  ].filter(Boolean).join(" "),
1381
1381
  children: /* @__PURE__ */ I("div", { className: "nice-sidebar-nav__node-row", children: [
1382
1382
  /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__collapse-spacer" }),
1383
- /* @__PURE__ */ i(Y, { content: b, position: "right", size: "sm", children: /* @__PURE__ */ I(
1383
+ /* @__PURE__ */ i(Y, { content: v, position: "right", size: "sm", children: /* @__PURE__ */ I(
1384
1384
  "span",
1385
1385
  {
1386
1386
  role: "link",
@@ -1392,7 +1392,7 @@ function Tt({
1392
1392
  },
1393
1393
  children: [
1394
1394
  /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__node-icon", "aria-hidden": "true", children: l.icon }),
1395
- /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__node-label", children: b })
1395
+ /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__node-label", children: v })
1396
1396
  ]
1397
1397
  }
1398
1398
  ) })
@@ -1402,12 +1402,12 @@ function Tt({
1402
1402
  );
1403
1403
  }) });
1404
1404
  }
1405
- function Bt({
1405
+ function Rt({
1406
1406
  onFavorite: e,
1407
1407
  onShortcut: r
1408
1408
  }) {
1409
- const { t: u } = Ne(), s = at(), d = se(null), l = se(null), b = ti(d, e), _ = ti(l, r);
1410
- if (!s || !e && !r)
1409
+ const { t: u } = Ne(), a = at(), d = re(null), l = re(null), v = ri(d, e), N = ri(l, r);
1410
+ if (!a || !e && !r)
1411
1411
  return null;
1412
1412
  const k = (C) => `nice-sidebar-nav__drop-zone${C ? " nice-sidebar-nav__drop-zone--over" : ""}`;
1413
1413
  return /* @__PURE__ */ I("div", { className: "nice-sidebar-nav__drop-bar", "aria-hidden": "true", "data-testid": "sidebar-drop-bar", children: [
@@ -1415,11 +1415,11 @@ function Bt({
1415
1415
  "div",
1416
1416
  {
1417
1417
  ref: d,
1418
- className: k(b),
1418
+ className: k(v),
1419
1419
  title: u("sidebarNav.dropFavorites", "Add to favourites"),
1420
1420
  "data-testid": "sidebar-drop-favorites",
1421
1421
  children: [
1422
- /* @__PURE__ */ i(mn, { size: 16 }),
1422
+ /* @__PURE__ */ i(_n, { size: 16 }),
1423
1423
  /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__drop-label", children: u("sidebarNav.favLists.default", "Favourites") })
1424
1424
  ]
1425
1425
  }
@@ -1428,7 +1428,7 @@ function Bt({
1428
1428
  "div",
1429
1429
  {
1430
1430
  ref: l,
1431
- className: k(_),
1431
+ className: k(N),
1432
1432
  title: u("sidebarNav.addShortcut", "Add to shortcuts"),
1433
1433
  "data-testid": "sidebar-drop-shortcuts",
1434
1434
  children: [
@@ -1439,45 +1439,45 @@ function Bt({
1439
1439
  )
1440
1440
  ] });
1441
1441
  }
1442
- const zt = /* @__PURE__ */ rn(
1442
+ const zt = /* @__PURE__ */ on(
1443
1443
  function({
1444
- data: r = gt,
1444
+ data: r = St,
1445
1445
  userId: u,
1446
- activeRoute: s,
1446
+ activeRoute: a,
1447
1447
  onNavigate: d,
1448
1448
  enableModeIcons: l,
1449
- preferences: b,
1450
- onPreferencesChange: _,
1449
+ preferences: v,
1450
+ onPreferencesChange: N,
1451
1451
  width: k = 264,
1452
1452
  collapsedWidth: C = 56,
1453
- position: v = "left",
1454
- minimal: L = !1,
1455
- showModeStrip: a,
1453
+ position: b = "left",
1454
+ minimal: M = !1,
1455
+ showModeStrip: o,
1456
1456
  showSources: n,
1457
- showFavorites: o,
1457
+ showFavorites: s,
1458
1458
  showFooterPreferences: f,
1459
- sticky: g = !0,
1459
+ sticky: S = !0,
1460
1460
  surfaceOpacity: A,
1461
- embedded: E = !1,
1462
- header: z,
1461
+ embedded: D = !1,
1462
+ header: R,
1463
1463
  footerExtra: V,
1464
1464
  collapsed: te,
1465
- onCollapsedChange: K,
1465
+ onCollapsedChange: q,
1466
1466
  expandableWhenCollapsed: y = !1,
1467
- railItems: q,
1468
- railOpen: ve,
1467
+ railItems: K,
1468
+ railOpen: be,
1469
1469
  defaultRailOpen: w,
1470
- onRailOpenChange: x,
1470
+ onRailOpenChange: L,
1471
1471
  railWidth: Z = 76,
1472
- railActiveId: be,
1472
+ railActiveId: ve,
1473
1473
  shortcutsRail: he = !1,
1474
1474
  predefinedShortcuts: G,
1475
1475
  allowUserShortcuts: ie = !0,
1476
- collapseLevel: $,
1476
+ collapseLevel: z,
1477
1477
  defaultCollapseLevel: ke = "expanded",
1478
1478
  onCollapseLevelChange: Ie,
1479
1479
  groupPicker: U = !0,
1480
- favoritesLayout: re = "list",
1480
+ favoritesLayout: oe = "list",
1481
1481
  getFavoritePath: xe,
1482
1482
  inlineSearch: j = !1,
1483
1483
  searchText: W,
@@ -1485,156 +1485,156 @@ const zt = /* @__PURE__ */ rn(
1485
1485
  onSearchChange: le,
1486
1486
  searchPlaceholder: Q,
1487
1487
  size: pe = "md",
1488
- className: M,
1488
+ className: F,
1489
1489
  routeToUrl: O,
1490
1490
  contextMenu: J = !0,
1491
- openInNewTab: Fe = !0,
1491
+ openInNewTab: Oe = !0,
1492
1492
  disabledContextMenuActions: Pe,
1493
1493
  readonly: ae = !1,
1494
1494
  levelColors: ge,
1495
1495
  levelShading: Ee = "auto",
1496
- "data-testid": Ue
1497
- }, ri) {
1498
- const { t: h } = Ne(), P = ue(it), Se = Ee === "auto" ? P?.theme.darkMode === "dark" ? "shade" : "tint" : Ee, Le = B(() => ot(ge, Se), [ge, Se]), Di = B(() => {
1496
+ "data-testid": Je
1497
+ }, oi) {
1498
+ const { t: h } = Ne(), P = ue(nt), Se = Ee === "auto" ? P?.theme.darkMode === "dark" ? "shade" : "tint" : Ee, Le = T(() => st(ge, Se), [ge, Se]), Ai = T(() => {
1499
1499
  const t = new Set(Pe ?? []);
1500
1500
  return ae && ["hide", "reorder", "rename", "newGroup"].forEach((c) => t.add(c)), t;
1501
- }, [Pe, ae]), ai = a ?? !L, oi = n ?? !L, He = o ?? !L, In = f ?? !L, De = !E && he, [si, xn] = ye(ke), Ai = $ ?? (te === void 0 ? si : te ? si === "expanded" ? "icons" : si : "expanded"), H = E ? "expanded" : Ai === "rail" && !De ? "icons" : Ai, R = H !== "expanded", Ae = ee(
1501
+ }, [Pe, ae]), ai = o ?? !M, si = n ?? !M, He = s ?? !M, xn = f ?? !M, De = !D && he, [ci, Ln] = ye(ke), Bi = z ?? (te === void 0 ? ci : te ? ci === "expanded" ? "icons" : ci : "expanded"), H = D ? "expanded" : Bi === "rail" && !De ? "icons" : Bi, $ = H !== "expanded", Ae = ee(
1502
1502
  (t) => {
1503
1503
  if (t === H)
1504
1504
  return;
1505
- xn(t), Ie?.(t);
1505
+ Ln(t), Ie?.(t);
1506
1506
  const c = t !== "expanded";
1507
- c !== R && K?.(c);
1507
+ c !== $ && q?.(c);
1508
1508
  },
1509
- [H, R, Ie, K]
1510
- ), Ln = ee(
1511
- () => Ae(R ? "expanded" : "icons"),
1512
- [R, Ae]
1513
- ), Te = !E && !!q && q.length > 0, [Mn, On] = nt({
1514
- value: ve,
1509
+ [H, $, Ie, q]
1510
+ ), Mn = ee(
1511
+ () => Ae($ ? "expanded" : "icons"),
1512
+ [$, Ae]
1513
+ ), Be = !D && !!K && K.length > 0, [Fn, On] = tt({
1514
+ value: be,
1515
1515
  defaultValue: w,
1516
1516
  fallbackValue: !1,
1517
1517
  componentName: "NiceSidebarNav"
1518
- }), we = Te && Mn && !R, Ti = (t) => {
1519
- On(t), x?.(t);
1520
- }, Fn = we || H === "expanded" || H === "icons" && De, En = () => {
1518
+ }), we = Be && Fn && !$, Ti = (t) => {
1519
+ On(t), L?.(t);
1520
+ }, En = we || H === "expanded" || H === "icons" && De, Dn = () => {
1521
1521
  we ? Ti(!1) : H === "expanded" ? Ae("icons") : H === "icons" && De && Ae("rail");
1522
- }, Dn = R || Te && !we, An = () => {
1523
- H === "rail" ? Ae("icons") : H === "icons" ? Ae("expanded") : Te && !we && Ti(!0);
1524
- }, Tn = be ?? q?.find((t) => t.route && t.route === s)?.id, Bn = (t) => {
1522
+ }, An = $ || Be && !we, Bn = () => {
1523
+ H === "rail" ? Ae("icons") : H === "icons" ? Ae("expanded") : Be && !we && Ti(!0);
1524
+ }, Tn = ve ?? K?.find((t) => t.route && t.route === a)?.id, Rn = (t) => {
1525
1525
  !t.onClick && t.route && d?.(t.route, {
1526
1526
  id: t.id,
1527
1527
  label: t.label,
1528
1528
  icon: t.icon,
1529
1529
  route: t.route
1530
1530
  });
1531
- }, [p, T] = Ct(
1531
+ }, [p, B] = yt(
1532
1532
  u,
1533
1533
  l,
1534
- b,
1535
- _
1536
- ), [zn, $n] = ye(ce), Je = W ?? zn, Ce = j ? Nt(Je) : "", Bi = ee(
1534
+ v,
1535
+ N
1536
+ ), [zn, $n] = ye(ce), Ye = W ?? zn, Ce = j ? gt(Ye) : "", Ri = ee(
1537
1537
  (t) => {
1538
1538
  W === void 0 && $n(t), le?.(t);
1539
1539
  },
1540
1540
  [W, le]
1541
- ), Be = B(() => {
1541
+ ), Te = T(() => {
1542
1542
  const t = p.activeMode;
1543
1543
  if (t === "favorites" || t === "preferences" || t === "search")
1544
1544
  return r;
1545
1545
  const c = p.pinnedSources[t];
1546
- return !c || c.length === 0 ? r : r.filter((N) => c.includes(N.source.id));
1547
- }, [r, p.activeMode, p.pinnedSources]), ci = p.maxDepth[p.activeMode], Rn = ci == null || ci >= 10 ? Number.POSITIVE_INFINITY : ci, zi = h("sidebarNav.favLists.default", "Favourites"), je = B(
1546
+ return !c || c.length === 0 ? r : r.filter((_) => c.includes(_.source.id));
1547
+ }, [r, p.activeMode, p.pinnedSources]), li = p.maxDepth[p.activeMode], Pn = li == null || li >= 10 ? Number.POSITIVE_INFINITY : li, zi = h("sidebarNav.favLists.default", "Favourites"), je = T(
1548
1548
  () => vt(
1549
1549
  { favorites: p.favorites, favoriteLists: p.favoriteLists },
1550
1550
  zi
1551
1551
  ),
1552
1552
  [p.favorites, p.favoriteLists, zi]
1553
- ), fe = bt(p), $i = B(
1553
+ ), fe = ht(p), $i = T(
1554
1554
  () => ({
1555
1555
  lists: je.map((t) => ({ id: t.id, label: t.label, count: t.items.length })),
1556
- listsOf: (t) => Li(
1556
+ listsOf: (t) => Mi(
1557
1557
  { favorites: p.favorites, favoriteLists: p.favoriteLists },
1558
1558
  t
1559
1559
  ),
1560
- toggle: T.toggleFavoriteInList,
1560
+ toggle: B.toggleFavoriteInList,
1561
1561
  create: (t, c) => {
1562
- T.createFavoriteList(
1563
- Wi(
1562
+ B.createFavoriteList(
1563
+ en(
1564
1564
  t,
1565
- je.map((N) => N.label)
1565
+ je.map((_) => _.label)
1566
1566
  ),
1567
1567
  c
1568
1568
  );
1569
1569
  }
1570
1570
  }),
1571
- [je, p.favorites, p.favoriteLists, T]
1572
- ), me = ie && p.shortcuts || St, ze = De && ie, Pn = B(() => {
1573
- if (!ze)
1571
+ [je, p.favorites, p.favoriteLists, B]
1572
+ ), me = ie && p.shortcuts || wt, Re = De && ie, Hn = T(() => {
1573
+ if (!Re)
1574
1574
  return null;
1575
- const t = new Set((G ?? []).map((N) => N.id)), c = new Set(me.map((N) => N.id));
1575
+ const t = new Set((G ?? []).map((_) => _.id)), c = new Set(me.map((_) => _.id));
1576
1576
  return {
1577
- stateOf: (N) => t.has(N) ? "predefined" : c.has(N) ? "user" : null,
1578
- toggle: (N) => c.has(N.id) ? T.removeShortcut(N.id) : T.addShortcut(N),
1577
+ stateOf: (_) => t.has(_) ? "predefined" : c.has(_) ? "user" : null,
1578
+ toggle: (_) => c.has(_.id) ? B.removeShortcut(_.id) : B.addShortcut(_),
1579
1579
  count: me.length
1580
1580
  };
1581
- }, [ze, G, me, T]), li = B(() => {
1581
+ }, [Re, G, me, B]), di = re(null), ui = T(() => {
1582
1582
  if (H !== "rail")
1583
1583
  return { buttons: [], entries: [] };
1584
1584
  const t = /* @__PURE__ */ new Map();
1585
- Ci(
1585
+ yi(
1586
1586
  r,
1587
- (S) => {
1588
- const X = S.item.icon ?? [...S.ancestors.slice(1)].reverse().find((de) => de.icon != null)?.icon ?? null;
1589
- X != null && !t.has(S.item.id) && t.set(S.item.id, X);
1587
+ (g) => {
1588
+ const X = g.item.icon ?? [...g.ancestors.slice(1)].reverse().find((de) => de.icon != null)?.icon ?? null;
1589
+ X != null && !t.has(g.item.id) && t.set(g.item.id, X);
1590
1590
  },
1591
1591
  { trees: ["modules", "roles", "units"] }
1592
1592
  );
1593
- const c = p.leftClickBehavior === "open-new", N = /* @__PURE__ */ new Set(), D = [], m = [], F = (S, X) => {
1594
- if (N.has(S.id))
1593
+ const c = p.leftClickBehavior === "open-new", _ = /* @__PURE__ */ new Set(), E = [], m = [], x = (g, X) => {
1594
+ if (_.has(g.id))
1595
1595
  return;
1596
- N.add(S.id), m.push({ fav: S, own: X });
1597
- const de = S.icon ?? t.get(S.id) ?? [...S.path ?? []].reverse().find((Ke) => Ke.icon != null)?.icon ?? "circle", Ve = (Ke) => {
1598
- S.route && d?.(S.route, S, {
1599
- forceNew: Ke,
1600
- color: S.color,
1601
- branchColor: S.color,
1602
- path: S.path
1603
- });
1604
- }, We = me.findIndex((Ke) => Ke.id === S.id), fi = [];
1605
- Fe && S.route && fi.push({
1596
+ _.add(g.id), m.push({ fav: g, own: X });
1597
+ const de = g.icon ?? t.get(g.id) ?? [...g.path ?? []].reverse().find((qe) => qe.icon != null)?.icon ?? "circle", Ve = (qe) => {
1598
+ g.route && (di.current = g.route, d?.(g.route, g, {
1599
+ forceNew: qe,
1600
+ color: g.color,
1601
+ branchColor: g.color,
1602
+ path: g.path
1603
+ }));
1604
+ }, ii = me.findIndex((qe) => qe.id === g.id), mi = [];
1605
+ Oe && g.route && mi.push({
1606
1606
  id: "openNewTab",
1607
1607
  label: h("sidebar.menu.openNewTab", "Open in new tab"),
1608
1608
  onClick: () => Ve(!0)
1609
- }), X && fi.push(
1609
+ }), X && mi.push(
1610
1610
  {
1611
1611
  id: "moveUp",
1612
1612
  label: h("sidebarNav.moveShortcutUp", "Move up"),
1613
- disabled: We <= 0,
1614
- onClick: () => T.moveShortcut(S.id, We - 1)
1613
+ disabled: ii <= 0,
1614
+ onClick: () => B.moveShortcut(g.id, ii - 1)
1615
1615
  },
1616
1616
  {
1617
1617
  id: "moveDown",
1618
1618
  label: h("sidebarNav.moveShortcutDown", "Move down"),
1619
- disabled: We >= me.length - 1,
1620
- onClick: () => T.moveShortcut(S.id, We + 1)
1619
+ disabled: ii >= me.length - 1,
1620
+ onClick: () => B.moveShortcut(g.id, ii + 1)
1621
1621
  },
1622
1622
  {
1623
1623
  id: "removeShortcut",
1624
1624
  label: h("sidebarNav.removeShortcut", "Remove from shortcuts"),
1625
- onClick: () => T.removeShortcut(S.id)
1625
+ onClick: () => B.removeShortcut(g.id)
1626
1626
  }
1627
- ), D.push({
1628
- id: S.id,
1629
- label: S.label,
1630
- icon: Oe(de),
1631
- title: typeof S.tooltip == "string" ? S.tooltip : S.label,
1632
- route: S.route,
1627
+ ), E.push({
1628
+ id: g.id,
1629
+ label: g.label,
1630
+ icon: Fe(de),
1631
+ title: typeof g.tooltip == "string" ? g.tooltip : g.label,
1632
+ route: g.route,
1633
1633
  onClick: () => Ve(c),
1634
- menu: fi
1634
+ menu: mi
1635
1635
  });
1636
1636
  };
1637
- return (G ?? []).forEach((S) => F(S, !1)), me.forEach((S) => F(S, !0)), { buttons: D, entries: m };
1637
+ return (G ?? []).forEach((g) => x(g, !1)), me.forEach((g) => x(g, !0)), { buttons: E, entries: m };
1638
1638
  }, [
1639
1639
  H,
1640
1640
  r,
@@ -1642,14 +1642,14 @@ const zt = /* @__PURE__ */ rn(
1642
1642
  me,
1643
1643
  p.leftClickBehavior,
1644
1644
  d,
1645
- Fe,
1646
- T,
1645
+ Oe,
1646
+ B,
1647
1647
  h
1648
- ]), di = li.buttons, ui = xi(), Ye = ee(
1648
+ ]), bi = ui.buttons, vi = Li(), Qe = ee(
1649
1649
  (t) => {
1650
1650
  if (t.id)
1651
1651
  return { ...t, addedAt: Date.now() };
1652
- const c = t.route ? pt(r, t.route) : void 0;
1652
+ const c = t.route ? ft(r, t.route) : void 0;
1653
1653
  return c ? {
1654
1654
  id: c.item.id,
1655
1655
  label: c.item.label,
@@ -1658,175 +1658,196 @@ const zt = /* @__PURE__ */ rn(
1658
1658
  sourceId: c.sourceId,
1659
1659
  moduleId: c.moduleId,
1660
1660
  color: c.branchColor ?? c.color,
1661
- path: ln(c.ancestors),
1661
+ path: dn(c.ancestors),
1662
1662
  addedAt: Date.now()
1663
1663
  } : { ...t, id: `route:${t.route ?? t.label}`, addedAt: Date.now() };
1664
1664
  },
1665
1665
  [r]
1666
- ), Ri = ee(
1667
- (t) => T.addFavorite(Ye(t), fe),
1668
- [T, Ye, fe]
1669
1666
  ), Pi = ee(
1667
+ (t) => B.addFavorite(Qe(t), fe),
1668
+ [B, Qe, fe]
1669
+ ), Hi = ee(
1670
1670
  (t, c) => {
1671
- const N = Ye(t);
1672
- if ((G ?? []).some((m) => m.id === N.id))
1671
+ const _ = Qe(t);
1672
+ if ((G ?? []).some((m) => m.id === _.id))
1673
1673
  return;
1674
- const D = me.findIndex((m) => m.id === N.id);
1675
- D < 0 ? T.addShortcut(N, c) : c !== void 0 && T.moveShortcut(N.id, D < c ? c - 1 : c);
1674
+ const E = me.findIndex((m) => m.id === _.id);
1675
+ E < 0 ? B.addShortcut(_, c) : c !== void 0 && B.moveShortcut(_.id, E < c ? c - 1 : c);
1676
1676
  },
1677
- [Ye, G, me, T]
1678
- ), vi = se(null), [Hi, Hn] = ye(null), ji = (t) => {
1679
- const c = vi.current, N = c?.getBoundingClientRect().top ?? 0, D = c ? Array.from(c.querySelectorAll(".nice-icon-rail__item")) : [], m = li.entries.flatMap(
1680
- (de, Ve) => de.own && D[Ve] ? [D[Ve].getBoundingClientRect()] : []
1681
- ), F = m.filter((de) => de.top + de.height / 2 < t).length, S = D[D.length - 1]?.getBoundingClientRect(), X = F < m.length ? m[F].top : m.length > 0 ? m[m.length - 1].bottom : S?.bottom ?? N;
1682
- return { index: F, line: X - N };
1683
- }, Vi = ti(
1684
- vi,
1685
- H === "rail" && ze ? (t, c) => Pi(t, ji(c.y).index) : null,
1686
- (t) => Hn(t ? ji(t.y).line : null)
1687
- ), jn = (t) => {
1677
+ [Qe, G, me, B]
1678
+ ), hi = re(null), [ji, jn] = ye(null), Vi = (t) => {
1679
+ const c = hi.current, _ = c?.getBoundingClientRect().top ?? 0, E = c ? Array.from(c.querySelectorAll(".nice-icon-rail__item")) : [], m = ui.entries.flatMap(
1680
+ (de, Ve) => de.own && E[Ve] ? [E[Ve].getBoundingClientRect()] : []
1681
+ ), x = m.filter((de) => de.top + de.height / 2 < t).length, g = E[E.length - 1]?.getBoundingClientRect(), X = x < m.length ? m[x].top : m.length > 0 ? m[m.length - 1].bottom : g?.bottom ?? _;
1682
+ return { index: x, line: X - _ };
1683
+ }, qi = ri(
1684
+ hi,
1685
+ H === "rail" && Re ? (t, c) => Hi(t, Vi(c.y).index) : null,
1686
+ (t) => jn(t ? Vi(t.y).line : null)
1687
+ ), Vn = (t) => {
1688
1688
  const c = t.target.closest(".nice-icon-rail__item");
1689
- if (!ui || !c || t.pointerType === "touch")
1689
+ if (!vi || !c || t.pointerType === "touch")
1690
1690
  return;
1691
- const N = Array.from(t.currentTarget.querySelectorAll(".nice-icon-rail__item")).indexOf(
1691
+ const _ = Array.from(t.currentTarget.querySelectorAll(".nice-icon-rail__item")).indexOf(
1692
1692
  c
1693
- ), D = li.entries[N];
1694
- D?.own && an(ui, t, on(D.fav), D.fav.label, {
1693
+ ), E = ui.entries[_];
1694
+ E?.own && an(vi, t, sn(E.fav), E.fav.label, {
1695
1695
  captureOnStart: !0
1696
1696
  });
1697
- }, Me = B(() => {
1698
- const t = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), N = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Map();
1699
- return re !== "tree" ? { parentsOf: t, items: c, sources: N, rank: D } : (Ci(
1697
+ }, Me = T(() => {
1698
+ const t = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map();
1699
+ return oe !== "tree" ? { parentsOf: t, items: c, sources: _, rank: E } : (yi(
1700
1700
  r,
1701
1701
  (m) => {
1702
- const F = { id: m.item.id, label: m.item.label, icon: m.item.icon };
1703
- m.kind === "source" && N.set(m.item.id, m.item);
1704
- const S = m.tree === "roles" || m.tree === "units";
1705
- S && m.kind === "module" ? c.set(`${m.ancestors[1].id}:${m.item.id}`, F) : c.has(m.item.id) || c.set(m.item.id, F), m.kind === "view" && !t.has(m.item.id) && t.set(
1702
+ const x = { id: m.item.id, label: m.item.label, icon: m.item.icon };
1703
+ m.kind === "source" && _.set(m.item.id, m.item);
1704
+ const g = m.tree === "roles" || m.tree === "units";
1705
+ g && m.kind === "module" ? c.set(`${m.ancestors[1].id}:${m.item.id}`, x) : c.has(m.item.id) || c.set(m.item.id, x), m.kind === "view" && !t.has(m.item.id) && t.set(
1706
1706
  m.item.id,
1707
- S ? m.ancestors.map(
1707
+ g ? m.ancestors.map(
1708
1708
  (X, de) => de === 2 ? { ...X, id: `${m.ancestors[1].id}:${X.id}` } : X
1709
1709
  ) : m.ancestors
1710
1710
  );
1711
1711
  },
1712
1712
  { trees: ["modules", "roles", "units"] }
1713
- ), [...c.keys()].forEach((m, F) => D.set(m, F)), { parentsOf: t, items: c, sources: N, rank: D });
1714
- }, [r, re]), Vn = ee(
1713
+ ), [...c.keys()].forEach((m, x) => E.set(m, x)), { parentsOf: t, items: c, sources: _, rank: E });
1714
+ }, [r, oe]), qn = ee(
1715
1715
  (t) => (xe?.(t) ?? t.path ?? Me.parentsOf.get(t.id) ?? []).map((c) => {
1716
- const N = Me.items.get(c.id);
1717
- return N ? { id: c.id, label: N.label, icon: N.icon ?? c.icon } : c;
1716
+ const _ = Me.items.get(c.id);
1717
+ return _ ? { id: c.id, label: _.label, icon: _.icon ?? c.icon } : c;
1718
1718
  }),
1719
1719
  [xe, Me]
1720
- ), Ki = B(
1721
- () => re !== "tree" ? [] : wi(
1720
+ ), Ki = T(
1721
+ () => oe !== "tree" ? [] : Ci(
1722
1722
  { favorites: p.favorites, favoriteLists: p.favoriteLists },
1723
1723
  fe
1724
1724
  ).map(
1725
- (t) => typeof t.icon == "string" || Ii(t.icon) ? t : { ...t, icon: Me.items.get(t.id)?.icon }
1725
+ (t) => typeof t.icon == "string" || xi(t.icon) ? t : { ...t, icon: Me.items.get(t.id)?.icon }
1726
1726
  ),
1727
- [re, p.favorites, p.favoriteLists, fe, Me]
1728
- ), oe = p.activeMode === "by-role" || p.activeMode === "by-unit" ? p.activeMode : null, Qe = B(() => {
1729
- if (!oe || U === !1)
1727
+ [oe, p.favorites, p.favoriteLists, fe, Me]
1728
+ ), se = p.activeMode === "by-role" || p.activeMode === "by-unit" ? p.activeMode : null, Xe = T(() => {
1729
+ if (!se || U === !1)
1730
1730
  return [];
1731
1731
  const t = new Set(p.hiddenItems.map((m) => m.id)), c = /* @__PURE__ */ new Map();
1732
- for (const m of Be)
1733
- for (const F of oe === "by-role" ? m.roles : m.units)
1734
- !t.has(F.id) && !c.has(F.id) && c.set(F.id, { id: F.id, label: F.label });
1735
- const N = p.itemOrder[oe] ?? [], D = (m) => {
1736
- const F = N.indexOf(m);
1737
- return F < 0 ? N.length : F;
1732
+ for (const m of Te)
1733
+ for (const x of se === "by-role" ? m.roles : m.units)
1734
+ !t.has(x.id) && !c.has(x.id) && c.set(x.id, { id: x.id, label: x.label });
1735
+ const _ = p.itemOrder[se] ?? [], E = (m) => {
1736
+ const x = _.indexOf(m);
1737
+ return x < 0 ? _.length : x;
1738
1738
  };
1739
- return [...c.values()].map((m, F) => ({ o: m, i: F })).sort((m, F) => D(m.o.id) - D(F.o.id) || m.i - F.i).map(({ o: m }) => m);
1740
- }, [oe, U, Be, p.hiddenItems, p.itemOrder]), _e = oe && Qe.length > 1 ? Qe.find((t) => t.id === p.activeGroupId?.[oe])?.id ?? Qe[0].id : void 0, Kn = p.activeMode === "all" || p.activeMode === "by-role" || p.activeMode === "by-unit", qn = new Set(p.hiddenItems.map((t) => t.id)), bi = B(() => {
1739
+ return [...c.values()].map((m, x) => ({ o: m, i: x })).sort((m, x) => E(m.o.id) - E(x.o.id) || m.i - x.i).map(({ o: m }) => m);
1740
+ }, [se, U, Te, p.hiddenItems, p.itemOrder]), _e = se && Xe.length > 1 ? Xe.find((t) => t.id === p.activeGroupId?.[se])?.id ?? Xe[0].id : void 0, Kn = p.activeMode === "all" || p.activeMode === "by-role" || p.activeMode === "by-unit", Gn = new Set(p.hiddenItems.map((t) => t.id)), pi = T(() => {
1741
1741
  const t = p.activeMode;
1742
- return !Ce || t === "favorites" || t === "preferences" || t === "search" ? Be : Be.filter(
1743
- (c) => un(
1744
- Cn(c, t, _e, p.itemOrder[t]),
1742
+ return !Ce || t === "favorites" || t === "preferences" || t === "search" ? Te : Te.filter(
1743
+ (c) => bn(
1744
+ yn(c, t, _e, p.itemOrder[t]),
1745
1745
  Ce,
1746
1746
  /* @__PURE__ */ new Set()
1747
1747
  ).length > 0
1748
1748
  );
1749
- }, [Ce, Be, p.activeMode, p.itemOrder, _e]), Xe = Kn ? bi.filter(
1750
- (t) => !qn.has(t.source.id) && (_e === void 0 || (p.activeMode === "by-role" ? t.roles : t.units).some(
1749
+ }, [Ce, Te, p.activeMode, p.itemOrder, _e]), Ze = Kn ? pi.filter(
1750
+ (t) => !Gn.has(t.source.id) && (_e === void 0 || (p.activeMode === "by-role" ? t.roles : t.units).some(
1751
1751
  (c) => c.id === _e
1752
1752
  ))
1753
- ) : [], Ze = p.stickyHeaders !== "none" && oi && Xe.length > 0, [Gn, Un] = ye(null), [qi, Jn] = ye(0), hi = se(null), Yn = ti(
1754
- hi,
1755
- H !== "rail" && He && p.activeMode === "favorites" ? Ri : null
1756
- ), Qn = Xe.map((t) => t.source.id).join("|");
1757
- ni(() => {
1758
- const t = hi.current;
1759
- if (!Ze || !t)
1753
+ ) : [], We = p.stickyHeaders !== "none" && si && Ze.length > 0, [Un, Jn] = ye(null), [Gi, Yn] = ye(0), ei = re(null), Qn = ri(
1754
+ ei,
1755
+ H !== "rail" && He && p.activeMode === "favorites" ? Pi : null
1756
+ );
1757
+ Ge(() => {
1758
+ const t = di.current;
1759
+ if (!t || t !== a)
1760
+ return;
1761
+ const c = requestAnimationFrame(() => {
1762
+ const _ = ei.current, m = _?.querySelector(".nice-sidebar-nav__node--active > *")?.getBoundingClientRect();
1763
+ if (!_ || !m || m.height === 0)
1764
+ return;
1765
+ di.current = null;
1766
+ const x = _.getBoundingClientRect();
1767
+ if (m.top >= x.top && m.bottom <= x.bottom)
1768
+ return;
1769
+ const g = typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
1770
+ _.scrollBy({
1771
+ top: m.top - x.top - (x.height - m.height) / 2,
1772
+ behavior: g ? "auto" : "smooth"
1773
+ });
1774
+ });
1775
+ return () => cancelAnimationFrame(c);
1776
+ });
1777
+ const Xn = Ze.map((t) => t.source.id).join("|");
1778
+ Ge(() => {
1779
+ const t = ei.current;
1780
+ if (!We || !t)
1760
1781
  return;
1761
1782
  let c = 0;
1762
- const N = () => {
1783
+ const _ = () => {
1763
1784
  c = 0;
1764
1785
  const m = t.getBoundingClientRect().top;
1765
- let F = 0;
1766
- t.querySelectorAll("[data-source-index] > .nice-sidebar-nav__source-flow").forEach((S) => {
1767
- const X = S.querySelector(".nice-sidebar-nav__source-header")?.getBoundingClientRect();
1768
- X && X.height > 0 && X.bottom <= m && (F = Math.max(F, Number(S.parentElement?.dataset.sourceIndex ?? 0)));
1769
- }), Jn(F);
1770
- }, D = () => {
1771
- c || (c = requestAnimationFrame(N));
1786
+ let x = 0;
1787
+ t.querySelectorAll("[data-source-index] > .nice-sidebar-nav__source-flow").forEach((g) => {
1788
+ const X = g.querySelector(".nice-sidebar-nav__source-header")?.getBoundingClientRect();
1789
+ X && X.height > 0 && X.bottom <= m && (x = Math.max(x, Number(g.parentElement?.dataset.sourceIndex ?? 0)));
1790
+ }), Yn(x);
1791
+ }, E = () => {
1792
+ c || (c = requestAnimationFrame(_));
1772
1793
  };
1773
- return N(), t.addEventListener("scroll", D, { passive: !0 }), () => {
1774
- t.removeEventListener("scroll", D), c && cancelAnimationFrame(c);
1794
+ return _(), t.addEventListener("scroll", E, { passive: !0 }), () => {
1795
+ t.removeEventListener("scroll", E), c && cancelAnimationFrame(c);
1775
1796
  };
1776
- }, [Ze, Qn, p.activeMode]);
1777
- const Xn = qi < Xe.length ? qi : 0;
1778
- function Zn() {
1797
+ }, [We, Xn, p.activeMode]);
1798
+ const Zn = Gi < Ze.length ? Gi : 0;
1799
+ function Wn() {
1779
1800
  const t = p.activeMode;
1780
1801
  if (He && t === "favorites")
1781
- return re === "tree" ? /* @__PURE__ */ i(
1782
- Et,
1802
+ return oe === "tree" ? /* @__PURE__ */ i(
1803
+ Dt,
1783
1804
  {
1784
- favorites: Ce ? Ki.filter((c) => Zi(c, Ce)) : Ki,
1785
- pathOf: Vn,
1805
+ favorites: Ce ? Ki.filter((c) => Wi(c, Ce)) : Ki,
1806
+ pathOf: qn,
1786
1807
  sources: Me.sources,
1787
1808
  rank: Me.rank,
1788
- showSources: oi,
1809
+ showSources: si,
1789
1810
  prefs: p,
1790
- helpers: T,
1791
- activeRoute: s,
1811
+ helpers: B,
1812
+ activeRoute: a,
1792
1813
  onNavigate: d,
1793
- onRemove: (c) => T.removeFavorite(c, fe),
1794
- collapsed: R,
1814
+ onRemove: (c) => B.removeFavorite(c, fe),
1815
+ collapsed: $,
1795
1816
  routeToUrl: O,
1796
1817
  contextMenu: J,
1797
- disabledActions: Di,
1818
+ disabledActions: Ai,
1798
1819
  colorScope: Le,
1799
1820
  shading: Se
1800
1821
  }
1801
1822
  ) : /* @__PURE__ */ i(
1802
1823
  Ot,
1803
1824
  {
1804
- favorites: wi(p, fe).filter(
1805
- (c) => !Ce || Zi(c, Ce)
1825
+ favorites: Ci(p, fe).filter(
1826
+ (c) => !Ce || Wi(c, Ce)
1806
1827
  ),
1807
- activeRoute: s,
1828
+ activeRoute: a,
1808
1829
  onNavigate: d,
1809
- onRemove: (c) => T.removeFavorite(c, fe),
1810
- collapsed: R,
1830
+ onRemove: (c) => B.removeFavorite(c, fe),
1831
+ collapsed: $,
1811
1832
  leftClickBehavior: p.leftClickBehavior
1812
1833
  }
1813
1834
  );
1814
- if (In && t === "preferences")
1835
+ if (xn && t === "preferences")
1815
1836
  return /* @__PURE__ */ i(
1816
1837
  Tt,
1817
1838
  {
1818
- activeRoute: s,
1839
+ activeRoute: a,
1819
1840
  onNavigate: d,
1820
1841
  leftClickBehavior: p.leftClickBehavior
1821
1842
  }
1822
1843
  );
1823
1844
  if (ai && t === "search") {
1824
- const c = new Set(p.hiddenItems.map((N) => N.id));
1845
+ const c = new Set(p.hiddenItems.map((_) => _.id));
1825
1846
  return /* @__PURE__ */ i(
1826
- At,
1847
+ Bt,
1827
1848
  {
1828
1849
  data: r,
1829
- activeRoute: s,
1850
+ activeRoute: a,
1830
1851
  onNavigate: d,
1831
1852
  hiddenIds: c,
1832
1853
  leftClickBehavior: p.leftClickBehavior,
@@ -1835,157 +1856,157 @@ const zt = /* @__PURE__ */ rn(
1835
1856
  }
1836
1857
  );
1837
1858
  }
1838
- return Be.length === 0 ? /* @__PURE__ */ i("p", { className: "nice-sidebar-nav__empty", children: h("sidebarNav.noSources", "No data sources are visible in this mode.") }) : bi.length === 0 ? /* @__PURE__ */ i("p", { className: "nice-sidebar-nav__empty", children: h("sidebarNav.noMatches", "Nothing matches “{query}”.").replace(
1859
+ return Te.length === 0 ? /* @__PURE__ */ i("p", { className: "nice-sidebar-nav__empty", children: h("sidebarNav.noSources", "No data sources are visible in this mode.") }) : pi.length === 0 ? /* @__PURE__ */ i("p", { className: "nice-sidebar-nav__empty", children: h("sidebarNav.noMatches", "Nothing matches “{query}”.").replace(
1839
1860
  "{query}",
1840
- Je
1841
- ) }) : bi.map((c) => {
1842
- const N = (p.pinnedSources[t] ?? []).includes(c.source.id);
1861
+ Ye
1862
+ ) }) : pi.map((c) => {
1863
+ const _ = (p.pinnedSources[t] ?? []).includes(c.source.id);
1843
1864
  if (_e !== void 0 && !(t === "by-role" ? c.roles : c.units).some((m) => m.id === _e))
1844
1865
  return null;
1845
- const D = Xe.indexOf(c);
1866
+ const E = Ze.indexOf(c);
1846
1867
  return /* @__PURE__ */ i(
1847
- Mt,
1868
+ Ft,
1848
1869
  {
1849
1870
  node: c,
1850
1871
  mode: t,
1851
- maxDepth: Rn,
1852
- isPinned: N,
1872
+ maxDepth: Pn,
1873
+ isPinned: _,
1853
1874
  prefs: p,
1854
- helpers: T,
1855
- activeRoute: s,
1875
+ helpers: B,
1876
+ activeRoute: a,
1856
1877
  onNavigate: d,
1857
- sidebarCollapsed: R,
1878
+ sidebarCollapsed: $,
1858
1879
  expandableWhenCollapsed: y,
1859
1880
  routeToUrl: O,
1860
1881
  contextMenu: J,
1861
- disabledActions: Di,
1862
- showHeader: oi,
1882
+ disabledActions: Ai,
1883
+ showHeader: si,
1863
1884
  colorScope: Le,
1864
1885
  shading: Se,
1865
1886
  groupFilter: _e,
1866
1887
  query: Ce,
1867
- pin: Ze && D >= 0 ? { slot: Gn, index: D, current: D === Xn } : void 0
1888
+ pin: We && E >= 0 ? { slot: Un, index: E, current: E === Zn } : void 0
1868
1889
  },
1869
1890
  c.source.id
1870
1891
  );
1871
1892
  });
1872
1893
  }
1873
- let pi = null;
1894
+ let fi = null;
1874
1895
  if (He && p.activeMode === "favorites") {
1875
1896
  const t = je.find((c) => c.id === fe);
1876
- pi = /* @__PURE__ */ i(
1877
- Xi,
1897
+ fi = /* @__PURE__ */ i(
1898
+ Zi,
1878
1899
  {
1879
1900
  options: $i.lists,
1880
1901
  value: fe,
1881
- onChange: T.setActiveFavoriteList,
1882
- collapsed: R,
1883
- icon: /* @__PURE__ */ i(_n, { size: 16 }),
1902
+ onChange: B.setActiveFavoriteList,
1903
+ collapsed: $,
1904
+ icon: /* @__PURE__ */ i(Nn, { size: 16 }),
1884
1905
  "aria-label": h("sidebarNav.favLists.title", "Favourites lists"),
1885
- onCreate: (c) => T.setActiveFavoriteList(
1886
- T.createFavoriteList(
1887
- Wi(
1906
+ onCreate: (c) => B.setActiveFavoriteList(
1907
+ B.createFavoriteList(
1908
+ en(
1888
1909
  c,
1889
- je.map((N) => N.label)
1910
+ je.map((_) => _.label)
1890
1911
  )
1891
1912
  )
1892
1913
  ),
1893
- renderFooter: t && t.id !== $e ? (c) => /* @__PURE__ */ i(
1894
- mt,
1914
+ renderFooter: t && t.id !== ze ? (c) => /* @__PURE__ */ i(
1915
+ _t,
1895
1916
  {
1896
1917
  label: t.label,
1897
- onRename: (N) => T.renameFavoriteList(t.id, N),
1918
+ onRename: (_) => B.renameFavoriteList(t.id, _),
1898
1919
  onRemove: () => {
1899
- T.removeFavoriteList(t.id), c();
1920
+ B.removeFavoriteList(t.id), c();
1900
1921
  }
1901
1922
  }
1902
1923
  ) : void 0
1903
1924
  },
1904
1925
  "favorites"
1905
1926
  );
1906
- } else oe && _e !== void 0 && (pi = /* @__PURE__ */ i(
1907
- Xi,
1927
+ } else se && _e !== void 0 && (fi = /* @__PURE__ */ i(
1928
+ Zi,
1908
1929
  {
1909
- options: Qe,
1930
+ options: Xe,
1910
1931
  value: _e,
1911
- onChange: (t) => T.setActiveGroup(oe, t),
1912
- collapsed: R,
1913
- icon: yi[oe].icon,
1914
- "aria-label": oe === "by-role" ? h("sidebarNav.scope.role", "Role") : h("sidebarNav.scope.unit", "Organizational unit")
1932
+ onChange: (t) => B.setActiveGroup(se, t),
1933
+ collapsed: $,
1934
+ icon: ki[se].icon,
1935
+ "aria-label": se === "by-role" ? h("sidebarNav.scope.role", "Role") : h("sidebarNav.scope.unit", "Organizational unit")
1915
1936
  },
1916
- oe
1937
+ se
1917
1938
  ));
1918
- const Gi = we ? h("sidebarNav.railHide", "Hide the bar") : H === "expanded" ? h("sidebarNav.collapseToIcons", "Collapse to icons") : h("sidebarNav.collapseToShortcuts", "Fold to the shortcuts"), Ui = H === "rail" ? h("sidebarNav.shortcutsToIcons", "Show the icons") : R ? h("sidebarNav.expand", "Expand the sidebar") : h("sidebarNav.railShow", "Show the bar"), Wn = [
1939
+ const Ui = we ? h("sidebarNav.railHide", "Hide the bar") : H === "expanded" ? h("sidebarNav.collapseToIcons", "Collapse to icons") : h("sidebarNav.collapseToShortcuts", "Fold to the shortcuts"), Ji = H === "rail" ? h("sidebarNav.shortcutsToIcons", "Show the icons") : $ ? h("sidebarNav.expand", "Expand the sidebar") : h("sidebarNav.railShow", "Show the bar"), et = [
1919
1940
  "nice-sidebar-nav",
1920
1941
  `nice-sidebar-nav--${pe}`,
1921
- `nice-sidebar-nav--${v}`,
1922
- L ? "nice-sidebar-nav--minimal" : "",
1923
- E ? "nice-sidebar-nav--embedded" : "",
1924
- g && !E ? "nice-sidebar-nav--sticky" : "",
1942
+ `nice-sidebar-nav--${b}`,
1943
+ M ? "nice-sidebar-nav--minimal" : "",
1944
+ D ? "nice-sidebar-nav--embedded" : "",
1945
+ S && !D ? "nice-sidebar-nav--sticky" : "",
1925
1946
  p.enableModeIcons && ai ? "nice-sidebar-nav--with-strip" : "",
1926
- R ? "nice-sidebar-nav--collapsed" : "",
1927
- R && y ? "nice-sidebar-nav--expandable-collapsed" : "",
1947
+ $ ? "nice-sidebar-nav--collapsed" : "",
1948
+ $ && y ? "nice-sidebar-nav--expandable-collapsed" : "",
1928
1949
  we ? "nice-sidebar-nav--with-rail" : "",
1929
1950
  H === "rail" ? "nice-sidebar-nav--shortcuts-rail" : "",
1930
1951
  // 1.3.16: the theme's shades ('theme', 'bar'), no indentation, the sticky path
1931
1952
  p.colorStyle !== "fill" ? "nice-sidebar-nav--shaded" : "",
1932
1953
  p.indent === "none" ? "nice-sidebar-nav--flat" : "",
1933
- p.stickyHeaders === "path" && !R ? "nice-sidebar-nav--sticky-path" : "",
1934
- M
1935
- ].filter(Boolean).join(" "), Ji = {
1954
+ p.stickyHeaders === "path" && !$ ? "nice-sidebar-nav--sticky-path" : "",
1955
+ F
1956
+ ].filter(Boolean).join(" "), Yi = {
1936
1957
  ...A != null ? { "--nice-sidebar-surface-alpha": String(A) } : {},
1937
1958
  // The whole tree's colours per level (1.3.2) — branches with their own repaint below.
1938
- ...Le.colors ? st(Le.colors, 1) : {}
1939
- }, et = E ? { width: "100%", ...Ji } : {
1959
+ ...Le.colors ? ct(Le.colors, 1) : {}
1960
+ }, it = D ? { width: "100%", ...Yi } : {
1940
1961
  "--nice-sidebar-w": `${k}px`,
1941
1962
  // the shortcuts rail (1.3.18) is the bar's width
1942
1963
  "--nice-sidebar-w-collapsed": `${H === "rail" ? Z : C}px`,
1943
- ...Te ? { "--nice-sidebar-rail-w": `${Z}px` } : {},
1964
+ ...Be ? { "--nice-sidebar-rail-w": `${Z}px` } : {},
1944
1965
  // the bar widens the sidebar by its own width
1945
- width: H === "rail" ? Z : R ? C : we ? k + Z : k,
1946
- ...Ji
1966
+ width: H === "rail" ? Z : $ ? C : we ? k + Z : k,
1967
+ ...Yi
1947
1968
  };
1948
1969
  return /* @__PURE__ */ I(
1949
1970
  "div",
1950
1971
  {
1951
- ref: ri,
1952
- className: Wn,
1953
- style: et,
1954
- "data-testid": Ue,
1972
+ ref: oi,
1973
+ className: et,
1974
+ style: it,
1975
+ "data-testid": Je,
1955
1976
  "data-mode": p.activeMode,
1956
1977
  children: [
1957
1978
  we && /* @__PURE__ */ i(
1958
- Qi,
1979
+ Xi,
1959
1980
  {
1960
1981
  className: "nice-sidebar-nav__rail",
1961
- items: q,
1982
+ items: K,
1962
1983
  activeId: Tn,
1963
- onSelect: Bn,
1984
+ onSelect: Rn,
1964
1985
  "aria-label": h("sidebarNav.rail", "Shortcuts")
1965
1986
  }
1966
1987
  ),
1967
- z != null && /* @__PURE__ */ i("div", { className: "nice-sidebar-nav__header", children: z }),
1988
+ R != null && /* @__PURE__ */ i("div", { className: "nice-sidebar-nav__header", children: R }),
1968
1989
  p.enableModeIcons && ai && H !== "rail" && /* @__PURE__ */ i(
1969
- yt,
1990
+ kt,
1970
1991
  {
1971
1992
  enabledModes: j ? p.enabledModes.filter((t) => t !== "search") : p.enabledModes,
1972
1993
  activeMode: p.activeMode,
1973
- onSelect: T.setMode,
1974
- collapsed: R
1994
+ onSelect: B.setMode,
1995
+ collapsed: $
1975
1996
  }
1976
1997
  ),
1977
- H !== "rail" && pi,
1978
- j && !R && /* @__PURE__ */ I("div", { className: "nice-sidebar-nav__search-box", role: "search", children: [
1998
+ H !== "rail" && fi,
1999
+ j && !$ && /* @__PURE__ */ I("div", { className: "nice-sidebar-nav__search-box", role: "search", children: [
1979
2000
  /* @__PURE__ */ i(ne, { name: "search", size: 14 }),
1980
2001
  /* @__PURE__ */ i(
1981
2002
  "input",
1982
2003
  {
1983
2004
  type: "search",
1984
2005
  className: "nice-sidebar-nav__search-box-input",
1985
- value: Je,
1986
- onChange: (t) => Bi(t.target.value),
2006
+ value: Ye,
2007
+ onChange: (t) => Ri(t.target.value),
1987
2008
  onKeyDown: (t) => {
1988
- t.key === "Escape" && Je && (t.stopPropagation(), Bi(""));
2009
+ t.key === "Escape" && Ye && (t.stopPropagation(), Ri(""));
1989
2010
  },
1990
2011
  placeholder: Q ?? h("sidebarNav.searchPlaceholder", "Search the menu"),
1991
2012
  "aria-label": Q ?? h("sidebarNav.searchPlaceholder", "Search the menu"),
@@ -1998,76 +2019,76 @@ const zt = /* @__PURE__ */ rn(
1998
2019
  /* @__PURE__ */ I(
1999
2020
  "div",
2000
2021
  {
2001
- ref: vi,
2022
+ ref: hi,
2002
2023
  className: [
2003
2024
  "nice-sidebar-nav__content",
2004
2025
  "nice-sidebar-nav__shortcuts",
2005
- Vi ? "nice-sidebar-nav__shortcuts--drop" : ""
2026
+ qi ? "nice-sidebar-nav__shortcuts--drop" : ""
2006
2027
  ].filter(Boolean).join(" "),
2007
- onPointerDown: jn,
2028
+ onPointerDown: Vn,
2008
2029
  children: [
2009
- Vi && Hi !== null && /* @__PURE__ */ i(
2030
+ qi && ji !== null && /* @__PURE__ */ i(
2010
2031
  "div",
2011
2032
  {
2012
2033
  className: "nice-sidebar-nav__drop-line",
2013
- style: { top: Hi },
2034
+ style: { top: ji },
2014
2035
  "aria-hidden": "true"
2015
2036
  }
2016
2037
  ),
2017
- di.length > 0 ? /* @__PURE__ */ i(
2018
- Qi,
2038
+ bi.length > 0 ? /* @__PURE__ */ i(
2039
+ Xi,
2019
2040
  {
2020
2041
  className: "nice-sidebar-nav__shortcuts-rail",
2021
- items: di,
2022
- activeId: di.find((t) => t.route && t.route === s)?.id ?? void 0,
2042
+ items: bi,
2043
+ activeId: bi.find((t) => t.route && t.route === a)?.id ?? void 0,
2023
2044
  "aria-label": h("sidebarNav.shortcuts", "Shortcuts"),
2024
2045
  "data-testid": "sidebar-shortcuts-rail"
2025
2046
  }
2026
- ) : ze && /* @__PURE__ */ i("p", { className: "nice-sidebar-nav__shortcuts-empty", children: h(
2047
+ ) : Re && /* @__PURE__ */ i("p", { className: "nice-sidebar-nav__shortcuts-empty", children: h(
2027
2048
  "sidebarNav.shortcutsEmpty",
2028
2049
  "No shortcuts yet — add them from an item’s star."
2029
2050
  ) })
2030
2051
  ]
2031
2052
  }
2032
2053
  )
2033
- ) : /* @__PURE__ */ i("div", { className: "nice-sidebar-nav__content", children: /* @__PURE__ */ i(Ge.Provider, { value: p.colorStyle, children: /* @__PURE__ */ i(vn.Provider, { value: Fe, children: /* @__PURE__ */ i(bn.Provider, { value: $i, children: /* @__PURE__ */ i(hn.Provider, { value: Pn, children: /* @__PURE__ */ I(
2034
- pn.Provider,
2054
+ ) : /* @__PURE__ */ i("div", { className: "nice-sidebar-nav__content", children: /* @__PURE__ */ i(Ue.Provider, { value: p.colorStyle, children: /* @__PURE__ */ i(vn.Provider, { value: Oe, children: /* @__PURE__ */ i(hn.Provider, { value: $i, children: /* @__PURE__ */ i(pn.Provider, { value: Hn, children: /* @__PURE__ */ I(
2055
+ fn.Provider,
2035
2056
  {
2036
- value: !!ui && (He || ze),
2057
+ value: !!vi && (He || Re),
2037
2058
  children: [
2038
- Ze && /* @__PURE__ */ i("div", { className: "nice-sidebar-nav__pinned", ref: Un }),
2059
+ We && /* @__PURE__ */ i("div", { className: "nice-sidebar-nav__pinned", ref: Jn }),
2039
2060
  /* @__PURE__ */ i(
2040
2061
  "div",
2041
2062
  {
2042
- className: `nice-sidebar-nav__body${Yn ? " nice-sidebar-nav__body--drop" : ""}`,
2043
- ref: hi,
2044
- children: Zn()
2063
+ className: `nice-sidebar-nav__body${Qn ? " nice-sidebar-nav__body--drop" : ""}`,
2064
+ ref: ei,
2065
+ children: Wn()
2045
2066
  }
2046
2067
  )
2047
2068
  ]
2048
2069
  }
2049
2070
  ) }) }) }) }) }),
2050
2071
  H !== "rail" && /* @__PURE__ */ i(
2051
- Bt,
2072
+ Rt,
2052
2073
  {
2053
- onFavorite: He ? Ri : null,
2054
- onShortcut: ze ? Pi : null
2074
+ onFavorite: He ? Pi : null,
2075
+ onShortcut: Re ? Hi : null
2055
2076
  }
2056
2077
  ),
2057
- (Te || De) && /* @__PURE__ */ I("div", { className: "nice-sidebar-nav__footer nice-sidebar-nav__footer--levels", children: [
2058
- Fn && /* @__PURE__ */ I(
2078
+ (Be || De) && /* @__PURE__ */ I("div", { className: "nice-sidebar-nav__footer nice-sidebar-nav__footer--levels", children: [
2079
+ En && /* @__PURE__ */ I(
2059
2080
  "button",
2060
2081
  {
2061
2082
  type: "button",
2062
2083
  className: "nice-sidebar-nav__footer-toggle nice-sidebar-nav__footer-toggle--down",
2063
- onClick: En,
2064
- "aria-label": Gi,
2065
- title: Gi,
2084
+ onClick: Dn,
2085
+ "aria-label": Ui,
2086
+ title: Ui,
2066
2087
  children: [
2067
2088
  /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__footer-toggle-icon", "aria-hidden": "true", children: /* @__PURE__ */ i(
2068
2089
  ne,
2069
2090
  {
2070
- name: v === "right" ? "chevron-right" : "chevron-left",
2091
+ name: b === "right" ? "chevron-right" : "chevron-left",
2071
2092
  size: 18
2072
2093
  }
2073
2094
  ) }),
@@ -2080,16 +2101,16 @@ const zt = /* @__PURE__ */ rn(
2080
2101
  {
2081
2102
  type: "button",
2082
2103
  className: "nice-sidebar-nav__footer-toggle nice-sidebar-nav__footer-toggle--up",
2083
- onClick: An,
2084
- disabled: !Dn,
2085
- "aria-label": Ui,
2086
- title: Ui,
2104
+ onClick: Bn,
2105
+ disabled: !An,
2106
+ "aria-label": Ji,
2107
+ title: Ji,
2087
2108
  children: [
2088
2109
  /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__footer-toggle-label", children: h("sidebarNav.expandShort", "Expand") }),
2089
2110
  /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__footer-toggle-icon", "aria-hidden": "true", children: /* @__PURE__ */ i(
2090
2111
  ne,
2091
2112
  {
2092
- name: v === "right" ? "chevron-left" : "chevron-right",
2113
+ name: b === "right" ? "chevron-left" : "chevron-right",
2093
2114
  size: 18
2094
2115
  }
2095
2116
  ) })
@@ -2098,15 +2119,15 @@ const zt = /* @__PURE__ */ rn(
2098
2119
  ),
2099
2120
  V != null && /* @__PURE__ */ i("div", { className: "nice-sidebar-nav__footer-extra", children: V })
2100
2121
  ] }),
2101
- !E && !Te && !De && /* @__PURE__ */ I("div", { className: "nice-sidebar-nav__footer", children: [
2122
+ !D && !Be && !De && /* @__PURE__ */ I("div", { className: "nice-sidebar-nav__footer", children: [
2102
2123
  /* @__PURE__ */ I(
2103
2124
  "button",
2104
2125
  {
2105
2126
  type: "button",
2106
2127
  className: "nice-sidebar-nav__footer-toggle",
2107
- onClick: Ln,
2108
- "aria-label": R ? h("sidebarNav.expand", "Expand the sidebar") : h("sidebarNav.collapseToIcons", "Collapse to icons"),
2109
- title: R ? h("sidebarNav.expand", "Expand the sidebar") : h("sidebarNav.collapseToIcons", "Collapse to icons"),
2128
+ onClick: Mn,
2129
+ "aria-label": $ ? h("sidebarNav.expand", "Expand the sidebar") : h("sidebarNav.collapseToIcons", "Collapse to icons"),
2130
+ title: $ ? h("sidebarNav.expand", "Expand the sidebar") : h("sidebarNav.collapseToIcons", "Collapse to icons"),
2110
2131
  children: [
2111
2132
  /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__footer-toggle-icon", "aria-hidden": "true", children: /* @__PURE__ */ i(
2112
2133
  ne,
@@ -2115,29 +2136,29 @@ const zt = /* @__PURE__ */ rn(
2115
2136
  size: 18,
2116
2137
  style: {
2117
2138
  transition: "transform 160ms ease",
2118
- transform: (v === "right" ? !R : R) ? "rotate(180deg)" : "rotate(0deg)"
2139
+ transform: (b === "right" ? !$ : $) ? "rotate(180deg)" : "rotate(0deg)"
2119
2140
  }
2120
2141
  }
2121
2142
  ) }),
2122
- /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__footer-toggle-label", children: R ? h("sidebarNav.expandShort", "Expand") : h("sidebarNav.collapseToIcons", "Collapse to icons") })
2143
+ /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__footer-toggle-label", children: $ ? h("sidebarNav.expandShort", "Expand") : h("sidebarNav.collapseToIcons", "Collapse to icons") })
2123
2144
  ]
2124
2145
  }
2125
2146
  ),
2126
2147
  V != null && /* @__PURE__ */ i("div", { className: "nice-sidebar-nav__footer-extra", children: V })
2127
2148
  ] }),
2128
- E && V != null && /* @__PURE__ */ i("div", { className: "nice-sidebar-nav__footer nice-sidebar-nav__footer--embedded", children: /* @__PURE__ */ i("div", { className: "nice-sidebar-nav__footer-extra", children: V }) })
2149
+ D && V != null && /* @__PURE__ */ i("div", { className: "nice-sidebar-nav__footer nice-sidebar-nav__footer--embedded", children: /* @__PURE__ */ i("div", { className: "nice-sidebar-nav__footer-extra", children: V }) })
2129
2150
  ]
2130
2151
  }
2131
2152
  );
2132
2153
  }
2133
- ), ir = /* @__PURE__ */ rn(
2154
+ ), nr = /* @__PURE__ */ on(
2134
2155
  function(r, u) {
2135
- const s = xi(), d = /* @__PURE__ */ i(zt, { ...r, ref: u });
2136
- return s ? d : /* @__PURE__ */ i(rt, { children: d });
2156
+ const a = Li(), d = /* @__PURE__ */ i(zt, { ...r, ref: u });
2157
+ return a ? d : /* @__PURE__ */ i(ot, { children: d });
2137
2158
  }
2138
2159
  );
2139
2160
  export {
2140
- ir as NiceSidebarNav,
2141
- wt as sidebarPrefsHostControlled,
2142
- Ct as useSidebarNavPrefs
2161
+ nr as NiceSidebarNav,
2162
+ Ct as sidebarPrefsHostControlled,
2163
+ yt as useSidebarNavPrefs
2143
2164
  };