@nice2dev/ui 1.3.15 → 1.3.17

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