@nice2dev/ui 1.3.16 → 1.3.18

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