@biza-gov/layout 0.0.0-stage → 1.0.0

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.
package/dist/index.js ADDED
@@ -0,0 +1,2818 @@
1
+ 'use client';
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/index.ts
22
+ var index_exports = {};
23
+ __export(index_exports, {
24
+ AlertTriangleIcon: () => AlertTriangleIcon,
25
+ BarChartIcon: () => BarChartIcon,
26
+ BellIcon: () => BellIcon,
27
+ BottomBar: () => BottomBar,
28
+ BuildingIcon: () => BuildingIcon,
29
+ CalendarIcon: () => CalendarIcon,
30
+ CheckCircleIcon: () => CheckCircleIcon,
31
+ ClipboardIcon: () => ClipboardIcon,
32
+ DatabaseIcon: () => DatabaseIcon,
33
+ DownloadIcon: () => DownloadIcon,
34
+ EditIcon: () => EditIcon,
35
+ EyeIcon: () => EyeIcon,
36
+ FONT_SIZE_OPTIONS: () => FONT_SIZE_OPTIONS,
37
+ FileTextIcon: () => FileTextIcon,
38
+ FolderIcon: () => FolderIcon,
39
+ FontSizeSettings: () => FontSizeSettings,
40
+ GearIcon: () => GearIcon,
41
+ HeartIcon: () => HeartIcon,
42
+ HelpCircleIcon: () => HelpCircleIcon,
43
+ HistoryIcon: () => HistoryIcon,
44
+ HomeIcon: () => HomeIcon,
45
+ Icons: () => Icons,
46
+ LogOutIcon: () => LogOutIcon,
47
+ MailIcon: () => MailIcon,
48
+ MapPinIcon: () => MapPinIcon,
49
+ PhoneIcon: () => PhoneIcon,
50
+ PlusCircleIcon: () => PlusCircleIcon,
51
+ PrinterIcon: () => PrinterIcon,
52
+ SearchIcon: () => SearchIcon,
53
+ SettingsPanel: () => SettingsPanel,
54
+ SettingsProvider: () => SettingsProvider,
55
+ ShieldIcon: () => ShieldIcon,
56
+ SidebarHeader: () => SidebarHeader,
57
+ SidebarMenu: () => SidebarMenu,
58
+ SidebarUserProfile: () => SidebarUserProfile,
59
+ StaffSidebar: () => StaffSidebar,
60
+ StarIcon: () => StarIcon,
61
+ ThemeSettings: () => ThemeSettings,
62
+ TrashIcon: () => TrashIcon,
63
+ UploadIcon: () => UploadIcon,
64
+ UserHeader: () => UserHeader,
65
+ UserIcon: () => UserIcon,
66
+ UserSidebar: () => UserSidebar,
67
+ UsersIcon: () => UsersIcon,
68
+ WrenchIcon: () => WrenchIcon,
69
+ XCircleIcon: () => XCircleIcon,
70
+ startLineConnection: () => startLineConnection,
71
+ useDarkMode: () => useDarkMode,
72
+ useLineConnectCallback: () => useLineConnectCallback,
73
+ useSettings: () => useSettings
74
+ });
75
+ module.exports = __toCommonJS(index_exports);
76
+
77
+ // src/sidebar/StaffSidebar.tsx
78
+ var import_react4 = require("react");
79
+
80
+ // src/utils/useDarkMode.ts
81
+ var import_react = require("react");
82
+ function useDarkMode() {
83
+ const [isDark, setIsDark] = (0, import_react.useState)(false);
84
+ (0, import_react.useEffect)(() => {
85
+ const root = document.documentElement;
86
+ const check = () => setIsDark(root.classList.contains("dark"));
87
+ check();
88
+ const observer = new MutationObserver(check);
89
+ observer.observe(root, { attributes: true, attributeFilter: ["class"] });
90
+ return () => observer.disconnect();
91
+ }, []);
92
+ return isDark;
93
+ }
94
+
95
+ // src/sidebar/SidebarHeader.tsx
96
+ var import_jsx_runtime = require("react/jsx-runtime");
97
+ function SidebarHeader({ orgLogo, orgName, orgSubtitle, collapsed }) {
98
+ const isDark = useDarkMode();
99
+ if (collapsed) {
100
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: {
101
+ display: "flex",
102
+ alignItems: "center",
103
+ justifyContent: "center",
104
+ padding: "20px 8px"
105
+ }, children: orgLogo ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
106
+ "img",
107
+ {
108
+ src: orgLogo,
109
+ alt: orgName,
110
+ style: {
111
+ width: "36px",
112
+ height: "36px",
113
+ borderRadius: "50%",
114
+ objectFit: "cover"
115
+ }
116
+ }
117
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: {
118
+ width: "36px",
119
+ height: "36px",
120
+ borderRadius: "50%",
121
+ background: "var(--color-alias-color-brand-primary, #1e7d55)",
122
+ display: "flex",
123
+ alignItems: "center",
124
+ justifyContent: "center",
125
+ color: "#fff",
126
+ fontWeight: 700,
127
+ fontSize: "14px"
128
+ }, children: orgName.charAt(0) }) });
129
+ }
130
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: {
131
+ display: "flex",
132
+ alignItems: "center",
133
+ gap: "12px",
134
+ padding: "24px 20px"
135
+ }, children: [
136
+ orgLogo && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
137
+ "img",
138
+ {
139
+ src: orgLogo,
140
+ alt: orgName,
141
+ style: {
142
+ width: "48px",
143
+ height: "48px",
144
+ borderRadius: "50%",
145
+ objectFit: "cover",
146
+ flexShrink: 0
147
+ }
148
+ }
149
+ ),
150
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { minWidth: 0 }, children: [
151
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { style: {
152
+ fontWeight: 700,
153
+ fontSize: "16px",
154
+ lineHeight: "22px",
155
+ color: isDark ? "#ffffff" : "var(--color-alias-color-brand-text-dark, #05010e)",
156
+ margin: 0,
157
+ overflow: "hidden",
158
+ textOverflow: "ellipsis",
159
+ whiteSpace: "nowrap"
160
+ }, children: orgName }),
161
+ orgSubtitle && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { style: {
162
+ fontSize: "14px",
163
+ lineHeight: "20px",
164
+ color: isDark ? "#e2e8f0" : "var(--color-alias-text-colors-tertiary, #475272)",
165
+ margin: 0,
166
+ overflow: "hidden",
167
+ textOverflow: "ellipsis",
168
+ whiteSpace: "nowrap"
169
+ }, children: orgSubtitle })
170
+ ] })
171
+ ] });
172
+ }
173
+
174
+ // src/sidebar/SidebarMenu.tsx
175
+ var import_react2 = require("react");
176
+
177
+ // src/icons/GovIcons.tsx
178
+ var import_jsx_runtime2 = require("react/jsx-runtime");
179
+ var defaultProps = (size = 20) => ({
180
+ width: size,
181
+ height: size,
182
+ viewBox: "0 0 24 24",
183
+ fill: "none",
184
+ stroke: "currentColor",
185
+ strokeWidth: 2,
186
+ strokeLinecap: "round",
187
+ strokeLinejoin: "round"
188
+ });
189
+ function HomeIcon({ size = 20, className, style } = {}) {
190
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...defaultProps(size), className, style, children: [
191
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }),
192
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("polyline", { points: "9 22 9 12 15 12 15 22" })
193
+ ] });
194
+ }
195
+ function SearchIcon({ size = 20, className, style } = {}) {
196
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...defaultProps(size), className, style, children: [
197
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { cx: "11", cy: "11", r: "8" }),
198
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
199
+ ] });
200
+ }
201
+ function BellIcon({ size = 20, className, style } = {}) {
202
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { ...defaultProps(size), viewBox: "0 0 22 24", stroke: "none", fill: "none", className, style, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M21.2321 13.4463L19.3618 6.71712C18.8136 4.74574 17.6222 3.01418 15.9769 1.79767C14.3316 0.581165 12.3269 -0.0504751 10.2814 0.00315377C8.23593 0.0567826 6.26708 0.792603 4.6878 2.09365C3.10852 3.3947 2.00945 5.18632 1.5653 7.18371L0.11728 13.6954C-0.0426654 14.4149 -0.0389674 15.1611 0.128101 15.879C0.29517 16.5969 0.621344 17.2681 1.08254 17.8431C1.54374 18.418 2.12818 18.8821 2.79272 19.2009C3.45727 19.5198 4.18494 19.6853 4.92202 19.6853H6.01861C6.24454 20.7979 6.84817 21.7982 7.72723 22.5167C8.60629 23.2352 9.70671 23.6277 10.842 23.6277C11.9774 23.6277 13.0778 23.2352 13.9569 22.5167C14.8359 21.7982 15.4396 20.7979 15.6655 19.6853H16.4904C17.2492 19.6853 17.9977 19.5099 18.6774 19.1728C19.3572 18.8357 19.9498 18.346 20.409 17.742C20.8682 17.1379 21.1815 16.4359 21.3245 15.6907C21.4674 14.9455 21.4352 14.1774 21.2321 13.4463ZM10.842 21.654C10.2334 21.6515 9.64049 21.461 9.1443 21.1086C8.6481 20.7562 8.27291 20.2591 8.07005 19.6853H13.614C13.4112 20.2591 13.036 20.7562 12.5398 21.1086C12.0436 21.461 11.4506 21.6515 10.842 21.654ZM18.8411 16.55C18.5668 16.9139 18.2114 17.2088 17.8032 17.4113C17.3949 17.6138 16.9451 17.7183 16.4894 17.7165H4.92202C4.47982 17.7164 4.04328 17.6171 3.64463 17.4257C3.24598 17.2344 2.89539 16.9559 2.61874 16.611C2.34208 16.266 2.14643 15.8633 2.04622 15.4326C1.94602 15.0019 1.94381 14.5542 2.03977 14.1226L3.4868 7.60994C3.83561 6.04105 4.69886 4.63379 5.93932 3.61186C7.17978 2.58992 8.72625 2.01197 10.3329 1.96988C11.9395 1.92779 13.5142 2.42398 14.8064 3.37956C16.0987 4.33515 17.0344 5.69528 17.4649 7.24376L19.3352 13.9729C19.4588 14.4114 19.4785 14.8725 19.3927 15.3199C19.3069 15.7672 19.1181 16.1884 18.8411 16.55Z", fill: "currentColor" }) });
203
+ }
204
+ function FolderIcon({ size = 20, className, style } = {}) {
205
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { ...defaultProps(size), className, style, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z" }) });
206
+ }
207
+ function ClipboardIcon({ size = 20, className, style } = {}) {
208
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...defaultProps(size), className, style, children: [
209
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2" }),
210
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("rect", { x: "8", y: "2", width: "8", height: "4", rx: "1", ry: "1" })
211
+ ] });
212
+ }
213
+ function FileTextIcon({ size = 20, className, style } = {}) {
214
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...defaultProps(size), className, style, children: [
215
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
216
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("polyline", { points: "14 2 14 8 20 8" }),
217
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
218
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "16", y1: "17", x2: "8", y2: "17" }),
219
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("polyline", { points: "10 9 9 9 8 9" })
220
+ ] });
221
+ }
222
+ function CalendarIcon({ size = 20, className, style } = {}) {
223
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...defaultProps(size), className, style, children: [
224
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
225
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
226
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
227
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
228
+ ] });
229
+ }
230
+ function UserIcon({ size = 20, className, style } = {}) {
231
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...defaultProps(size), className, style, children: [
232
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }),
233
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { cx: "12", cy: "7", r: "4" })
234
+ ] });
235
+ }
236
+ function UsersIcon({ size = 20, className, style } = {}) {
237
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...defaultProps(size), className, style, children: [
238
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" }),
239
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { cx: "9", cy: "7", r: "4" }),
240
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M23 21v-2a4 4 0 0 0-3-3.87" }),
241
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M16 3.13a4 4 0 0 1 0 7.75" })
242
+ ] });
243
+ }
244
+ function GearIcon({ size = 20, className, style } = {}) {
245
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...defaultProps(size), className, style, children: [
246
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { cx: "12", cy: "12", r: "3" }),
247
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" })
248
+ ] });
249
+ }
250
+ function WrenchIcon({ size = 20, className, style } = {}) {
251
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { ...defaultProps(size), className, style, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z" }) });
252
+ }
253
+ function ShieldIcon({ size = 20, className, style } = {}) {
254
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { ...defaultProps(size), className, style, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" }) });
255
+ }
256
+ function HelpCircleIcon({ size = 20, className, style } = {}) {
257
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...defaultProps(size), className, style, children: [
258
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
259
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
260
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
261
+ ] });
262
+ }
263
+ function BarChartIcon({ size = 20, className, style } = {}) {
264
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...defaultProps(size), className, style, children: [
265
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "12", y1: "20", x2: "12", y2: "10" }),
266
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "18", y1: "20", x2: "18", y2: "4" }),
267
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "6", y1: "20", x2: "6", y2: "16" })
268
+ ] });
269
+ }
270
+ function HistoryIcon({ size = 20, className, style } = {}) {
271
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...defaultProps(size), className, style, children: [
272
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("polyline", { points: "1 4 1 10 7 10" }),
273
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M3.51 15a9 9 0 1 0 2.13-9.36L1 10" })
274
+ ] });
275
+ }
276
+ function DatabaseIcon({ size = 20, className, style } = {}) {
277
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...defaultProps(size), className, style, children: [
278
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ellipse", { cx: "12", cy: "5", rx: "9", ry: "3" }),
279
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M21 12c0 1.66-4 3-9 3s-9-1.34-9-3" }),
280
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5" })
281
+ ] });
282
+ }
283
+ function BuildingIcon({ size = 20, className, style } = {}) {
284
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...defaultProps(size), className, style, children: [
285
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("rect", { x: "4", y: "2", width: "16", height: "20", rx: "2", ry: "2" }),
286
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "9", y1: "22", x2: "9", y2: "18" }),
287
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "15", y1: "22", x2: "15", y2: "18" }),
288
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "9", y1: "6", x2: "9.01", y2: "6" }),
289
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "15", y1: "6", x2: "15.01", y2: "6" }),
290
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "9", y1: "10", x2: "9.01", y2: "10" }),
291
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "15", y1: "10", x2: "15.01", y2: "10" }),
292
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "9", y1: "14", x2: "9.01", y2: "14" }),
293
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "15", y1: "14", x2: "15.01", y2: "14" })
294
+ ] });
295
+ }
296
+ function MapPinIcon({ size = 20, className, style } = {}) {
297
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...defaultProps(size), className, style, children: [
298
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z" }),
299
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { cx: "12", cy: "10", r: "3" })
300
+ ] });
301
+ }
302
+ function PhoneIcon({ size = 20, className, style } = {}) {
303
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { ...defaultProps(size), className, style, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z" }) });
304
+ }
305
+ function MailIcon({ size = 20, className, style } = {}) {
306
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...defaultProps(size), className, style, children: [
307
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z" }),
308
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("polyline", { points: "22,6 12,13 2,6" })
309
+ ] });
310
+ }
311
+ function CheckCircleIcon({ size = 20, className, style } = {}) {
312
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...defaultProps(size), className, style, children: [
313
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
314
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("polyline", { points: "22 4 12 14.01 9 11.01" })
315
+ ] });
316
+ }
317
+ function AlertTriangleIcon({ size = 20, className, style } = {}) {
318
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...defaultProps(size), className, style, children: [
319
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
320
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
321
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
322
+ ] });
323
+ }
324
+ function XCircleIcon({ size = 20, className, style } = {}) {
325
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...defaultProps(size), className, style, children: [
326
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
327
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "15", y1: "9", x2: "9", y2: "15" }),
328
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "9", y1: "9", x2: "15", y2: "15" })
329
+ ] });
330
+ }
331
+ function PlusCircleIcon({ size = 20, className, style } = {}) {
332
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...defaultProps(size), className, style, children: [
333
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
334
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "12", y1: "8", x2: "12", y2: "16" }),
335
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "8", y1: "12", x2: "16", y2: "12" })
336
+ ] });
337
+ }
338
+ function LogOutIcon({ size = 20, className, style } = {}) {
339
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...defaultProps(size), className, style, children: [
340
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }),
341
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("polyline", { points: "16 17 21 12 16 7" }),
342
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "21", y1: "12", x2: "9", y2: "12" })
343
+ ] });
344
+ }
345
+ function DownloadIcon({ size = 20, className, style } = {}) {
346
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...defaultProps(size), className, style, children: [
347
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
348
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("polyline", { points: "7 10 12 15 17 10" }),
349
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "12", y1: "15", x2: "12", y2: "3" })
350
+ ] });
351
+ }
352
+ function UploadIcon({ size = 20, className, style } = {}) {
353
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...defaultProps(size), className, style, children: [
354
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
355
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("polyline", { points: "17 8 12 3 7 8" }),
356
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "12", y1: "3", x2: "12", y2: "15" })
357
+ ] });
358
+ }
359
+ function PrinterIcon({ size = 20, className, style } = {}) {
360
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...defaultProps(size), className, style, children: [
361
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("polyline", { points: "6 9 6 2 18 2 18 9" }),
362
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2" }),
363
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("rect", { x: "6", y: "14", width: "12", height: "8" })
364
+ ] });
365
+ }
366
+ function StarIcon({ size = 20, className, style } = {}) {
367
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { ...defaultProps(size), className, style, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" }) });
368
+ }
369
+ function HeartIcon({ size = 20, className, style } = {}) {
370
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { ...defaultProps(size), className, style, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z" }) });
371
+ }
372
+ function EyeIcon({ size = 20, className, style } = {}) {
373
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...defaultProps(size), className, style, children: [
374
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
375
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { cx: "12", cy: "12", r: "3" })
376
+ ] });
377
+ }
378
+ function EditIcon({ size = 20, className, style } = {}) {
379
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...defaultProps(size), className, style, children: [
380
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }),
381
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })
382
+ ] });
383
+ }
384
+ function TrashIcon({ size = 20, className, style } = {}) {
385
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...defaultProps(size), className, style, children: [
386
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("polyline", { points: "3 6 5 6 21 6" }),
387
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }),
388
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "10", y1: "11", x2: "10", y2: "17" }),
389
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "14", y1: "11", x2: "14", y2: "17" })
390
+ ] });
391
+ }
392
+
393
+ // src/sidebar/SidebarMenu.tsx
394
+ var import_jsx_runtime3 = require("react/jsx-runtime");
395
+ var safeCssEscape = (value) => {
396
+ if (typeof CSS !== "undefined" && CSS.escape) {
397
+ return CSS.escape(value);
398
+ }
399
+ return value.replace(/[^a-zA-Z0-9_-]/g, "_");
400
+ };
401
+ var ICON_MAP = {
402
+ home: HomeIcon,
403
+ dashboard: HomeIcon,
404
+ services: FolderIcon,
405
+ service: FolderIcon,
406
+ folder: FolderIcon,
407
+ category: FolderIcon,
408
+ users: UsersIcon,
409
+ members: UsersIcon,
410
+ user: UserIcon,
411
+ profile: UserIcon,
412
+ staff: UserIcon,
413
+ settings: GearIcon,
414
+ setting: GearIcon,
415
+ config: GearIcon,
416
+ help: HelpCircleIcon,
417
+ support: HelpCircleIcon,
418
+ faq: HelpCircleIcon,
419
+ reports: BarChartIcon,
420
+ report: BarChartIcon,
421
+ stats: BarChartIcon,
422
+ chart: BarChartIcon,
423
+ analytics: BarChartIcon,
424
+ roles: ShieldIcon,
425
+ permissions: ShieldIcon,
426
+ security: ShieldIcon,
427
+ logs: HistoryIcon,
428
+ history: HistoryIcon,
429
+ activity: HistoryIcon,
430
+ audit: HistoryIcon,
431
+ backup: DatabaseIcon,
432
+ database: DatabaseIcon,
433
+ data: DatabaseIcon,
434
+ documents: FileTextIcon,
435
+ document: FileTextIcon,
436
+ docs: FileTextIcon,
437
+ files: FileTextIcon,
438
+ file: FileTextIcon,
439
+ forms: ClipboardIcon,
440
+ form: ClipboardIcon,
441
+ request: ClipboardIcon,
442
+ requests: ClipboardIcon,
443
+ calendar: CalendarIcon,
444
+ schedule: CalendarIcon,
445
+ appointment: CalendarIcon,
446
+ notifications: BellIcon,
447
+ notification: BellIcon,
448
+ alerts: BellIcon,
449
+ search: SearchIcon,
450
+ organization: BuildingIcon,
451
+ org: BuildingIcon,
452
+ department: BuildingIcon,
453
+ agency: BuildingIcon,
454
+ location: MapPinIcon,
455
+ map: MapPinIcon,
456
+ address: MapPinIcon,
457
+ phone: PhoneIcon,
458
+ contact: PhoneIcon,
459
+ call: PhoneIcon,
460
+ email: MailIcon,
461
+ mail: MailIcon,
462
+ message: MailIcon,
463
+ messages: MailIcon,
464
+ tools: WrenchIcon,
465
+ maintenance: WrenchIcon,
466
+ favorites: StarIcon,
467
+ bookmark: StarIcon,
468
+ edit: EditIcon,
469
+ manage: EditIcon,
470
+ delete: TrashIcon,
471
+ trash: TrashIcon,
472
+ view: EyeIcon,
473
+ preview: EyeIcon,
474
+ detail: EyeIcon,
475
+ download: DownloadIcon,
476
+ export: DownloadIcon,
477
+ upload: UploadIcon,
478
+ import: UploadIcon,
479
+ print: PrinterIcon,
480
+ printer: PrinterIcon,
481
+ logout: LogOutIcon,
482
+ signout: LogOutIcon,
483
+ approve: CheckCircleIcon,
484
+ approved: CheckCircleIcon,
485
+ add: PlusCircleIcon,
486
+ create: PlusCircleIcon,
487
+ new: PlusCircleIcon
488
+ };
489
+ function DefaultIcon() {
490
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("circle", { cx: "12", cy: "12", r: "4" }) });
491
+ }
492
+ function getAutoIcon(id) {
493
+ const IconComp = ICON_MAP[id.toLowerCase()];
494
+ if (IconComp) return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(IconComp, {});
495
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(DefaultIcon, {});
496
+ }
497
+ function ChevronDownIcon({ isOpen }) {
498
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
499
+ "svg",
500
+ {
501
+ width: "16",
502
+ height: "16",
503
+ viewBox: "0 0 20 20",
504
+ fill: "none",
505
+ stroke: "currentColor",
506
+ strokeWidth: "2",
507
+ strokeLinecap: "round",
508
+ strokeLinejoin: "round",
509
+ style: {
510
+ transition: "transform 0.2s ease",
511
+ transform: isOpen ? "rotate(180deg)" : "rotate(0deg)",
512
+ flexShrink: 0
513
+ },
514
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M5 7.5L10 12.5L15 7.5" })
515
+ }
516
+ );
517
+ }
518
+ function MenuItemComponent({
519
+ item,
520
+ onItemClick,
521
+ currentPath,
522
+ depth = 0,
523
+ collapsed = false,
524
+ onExpandRequest
525
+ }) {
526
+ const isDark = useDarkMode();
527
+ const hasChildren = item.children && item.children.length > 0;
528
+ const isActive = item.path ? currentPath === item.path : false;
529
+ const resolvedIcon = item.icon || getAutoIcon(item.id);
530
+ const isChildActive = hasChildren ? item.children.some((child) => child.path === currentPath) : false;
531
+ const [userToggled, setUserToggled] = (0, import_react2.useState)(false);
532
+ const [isOpen, setIsOpen] = (0, import_react2.useState)(isChildActive);
533
+ const expanded = userToggled ? isOpen : isOpen || isChildActive;
534
+ const btnId = (0, import_react2.useId)();
535
+ const handleClick = () => {
536
+ if (hasChildren) {
537
+ if (collapsed) {
538
+ setUserToggled(true);
539
+ setIsOpen(true);
540
+ onExpandRequest?.();
541
+ } else {
542
+ setUserToggled(true);
543
+ setIsOpen(!expanded);
544
+ }
545
+ } else if (item.path) {
546
+ onItemClick(item.path);
547
+ }
548
+ };
549
+ const activeColor = "var(--color-alias-color-brand-primary, #1e7d55)";
550
+ const hoverBg = isDark ? "#334155" : "var(--color-foundations-fuji-pallet-light, #ebedf5)";
551
+ if (collapsed && depth === 0) {
552
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("li", { children: [
553
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("style", { children: `@media(hover:hover){.sidebar-btn-${safeCssEscape(btnId)}:not([data-active='true']):hover{background-color:${hoverBg}!important}}` }),
554
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
555
+ "button",
556
+ {
557
+ className: `sidebar-btn-${safeCssEscape(btnId)}`,
558
+ "data-active": isActive || isChildActive,
559
+ onClick: handleClick,
560
+ title: item.title,
561
+ style: {
562
+ width: "100%",
563
+ display: "flex",
564
+ alignItems: "center",
565
+ justifyContent: "center",
566
+ padding: "12px 0",
567
+ borderRadius: "8px",
568
+ border: "none",
569
+ background: isActive || isChildActive ? `color-mix(in srgb, ${activeColor} 10%, transparent)` : "transparent",
570
+ color: isActive || isChildActive ? activeColor : isDark ? "#ffffff" : "var(--color-alias-text-colors-tertiary, #475272)",
571
+ cursor: "pointer",
572
+ transition: "background-color 0.15s ease",
573
+ WebkitTapHighlightColor: "transparent"
574
+ },
575
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: {
576
+ width: "24px",
577
+ height: "24px",
578
+ display: "flex",
579
+ alignItems: "center",
580
+ justifyContent: "center"
581
+ }, children: resolvedIcon })
582
+ }
583
+ ),
584
+ item.dividerAfter && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("hr", { style: {
585
+ border: "none",
586
+ borderTop: `1px solid ${isDark ? "#374151" : "var(--color-border-colors-neutral, #c8cedd)"}`,
587
+ margin: "8px 4px"
588
+ } })
589
+ ] });
590
+ }
591
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
592
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("li", { children: [
593
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("style", { children: `@media(hover:hover){.sidebar-btn-${safeCssEscape(btnId)}:not([data-active='true']):hover{background-color:${hoverBg}!important}}` }),
594
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
595
+ "button",
596
+ {
597
+ className: `sidebar-btn-${safeCssEscape(btnId)}`,
598
+ "data-active": isActive,
599
+ onClick: handleClick,
600
+ style: {
601
+ width: "100%",
602
+ display: "flex",
603
+ alignItems: "center",
604
+ gap: "12px",
605
+ padding: depth > 0 ? "10px 16px 10px 52px" : "12px 16px",
606
+ borderRadius: "8px",
607
+ border: "none",
608
+ background: isActive ? `color-mix(in srgb, ${activeColor} 10%, transparent)` : "transparent",
609
+ color: isActive ? activeColor : isDark ? "#ffffff" : "var(--color-alias-text-colors-primary, #060d26)",
610
+ cursor: "pointer",
611
+ transition: "background-color 0.15s ease",
612
+ textAlign: "left",
613
+ fontSize: "15px",
614
+ fontWeight: isActive ? 600 : 400,
615
+ lineHeight: "22px",
616
+ WebkitTapHighlightColor: "transparent"
617
+ },
618
+ children: [
619
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: {
620
+ width: "24px",
621
+ height: "24px",
622
+ display: "flex",
623
+ alignItems: "center",
624
+ justifyContent: "center",
625
+ flexShrink: 0,
626
+ color: isActive ? activeColor : isDark ? "#e2e8f0" : "var(--color-alias-text-colors-tertiary, #475272)"
627
+ }, children: resolvedIcon }),
628
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: { flex: 1 }, children: item.title }),
629
+ hasChildren && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ChevronDownIcon, { isOpen: expanded })
630
+ ]
631
+ }
632
+ )
633
+ ] }),
634
+ hasChildren && expanded && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, children: item.children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
635
+ MenuItemComponent,
636
+ {
637
+ item: child,
638
+ onItemClick,
639
+ currentPath,
640
+ depth: depth + 1
641
+ },
642
+ child.id
643
+ )) }),
644
+ item.dividerAfter && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("hr", { style: {
645
+ border: "none",
646
+ borderTop: `1px solid ${isDark ? "#374151" : "var(--color-border-colors-neutral, #c8cedd)"}`,
647
+ margin: "8px 0"
648
+ } }) })
649
+ ] });
650
+ }
651
+ function SidebarMenu({ menuItems, onItemClick, currentPath, collapsed, onExpandRequest }) {
652
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("nav", { style: {
653
+ padding: collapsed ? "8px 8px" : "8px 12px"
654
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("ul", { style: {
655
+ listStyle: "none",
656
+ margin: 0,
657
+ padding: 0,
658
+ display: "flex",
659
+ flexDirection: "column",
660
+ gap: "2px"
661
+ }, children: menuItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
662
+ MenuItemComponent,
663
+ {
664
+ item,
665
+ onItemClick,
666
+ currentPath,
667
+ collapsed,
668
+ onExpandRequest
669
+ },
670
+ item.id
671
+ )) }) });
672
+ }
673
+
674
+ // src/sidebar/SidebarUserProfile.tsx
675
+ var import_react3 = require("react");
676
+ var import_jsx_runtime4 = require("react/jsx-runtime");
677
+ function LogoutIcon() {
678
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
679
+ "svg",
680
+ {
681
+ width: "20",
682
+ height: "20",
683
+ viewBox: "0 0 24 24",
684
+ fill: "none",
685
+ stroke: "currentColor",
686
+ strokeWidth: "2",
687
+ strokeLinecap: "round",
688
+ strokeLinejoin: "round",
689
+ children: [
690
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }),
691
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("polyline", { points: "16 17 21 12 16 7" }),
692
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("line", { x1: "21", y1: "12", x2: "9", y2: "12" })
693
+ ]
694
+ }
695
+ );
696
+ }
697
+ function ProfileIcon() {
698
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
699
+ "svg",
700
+ {
701
+ width: "24",
702
+ height: "24",
703
+ viewBox: "0 0 24 24",
704
+ fill: "none",
705
+ stroke: "currentColor",
706
+ strokeWidth: "2",
707
+ strokeLinecap: "round",
708
+ strokeLinejoin: "round",
709
+ children: [
710
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }),
711
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("circle", { cx: "12", cy: "7", r: "4" })
712
+ ]
713
+ }
714
+ );
715
+ }
716
+ function AvatarPlaceholder({ size = 40 }) {
717
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
718
+ "div",
719
+ {
720
+ style: {
721
+ width: `${size}px`,
722
+ height: `${size}px`,
723
+ borderRadius: "50%",
724
+ backgroundColor: "#f1f5f9",
725
+ display: "flex",
726
+ alignItems: "center",
727
+ justifyContent: "center",
728
+ flexShrink: 0,
729
+ boxShadow: "0 2px 8px rgba(0,0,0,0.05)"
730
+ },
731
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { width: size * 0.6, height: size * 0.6, viewBox: "0 0 24 24", fill: "#94a3b8", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }) })
732
+ }
733
+ );
734
+ }
735
+ function SidebarUserProfile({
736
+ user,
737
+ roleLabel,
738
+ onLogout,
739
+ collapsed,
740
+ onProfile
741
+ }) {
742
+ const isDark = useDarkMode();
743
+ const [imgError, setImgError] = (0, import_react3.useState)(false);
744
+ (0, import_react3.useEffect)(() => {
745
+ setImgError(false);
746
+ }, [user?.pictureUrl]);
747
+ if (!user) return null;
748
+ const getFullName = () => {
749
+ if (user.firstName && user.lastName) {
750
+ return `${user.firstName} ${user.lastName}`;
751
+ }
752
+ return user.firstName || user.lastName || "\u0E1C\u0E39\u0E49\u0E43\u0E0A\u0E49";
753
+ };
754
+ if (collapsed) {
755
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: {
756
+ padding: "12px 8px",
757
+ borderTop: `1px solid ${isDark ? "#374151" : "var(--color-border-colors-neutral, #c8cedd)"}`,
758
+ display: "flex",
759
+ flexDirection: "column",
760
+ alignItems: "center",
761
+ gap: "12px"
762
+ }, children: [
763
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
764
+ "div",
765
+ {
766
+ onClick: onProfile,
767
+ title: onProfile ? "\u0E14\u0E39\u0E42\u0E1B\u0E23\u0E44\u0E1F\u0E25\u0E4C" : getFullName(),
768
+ style: { cursor: onProfile ? "pointer" : "default" },
769
+ children: user.pictureUrl && !imgError ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
770
+ "img",
771
+ {
772
+ src: user.pictureUrl,
773
+ alt: getFullName(),
774
+ onError: () => setImgError(true),
775
+ style: {
776
+ width: "36px",
777
+ height: "36px",
778
+ borderRadius: "50%",
779
+ objectFit: "cover",
780
+ flexShrink: 0
781
+ }
782
+ }
783
+ ) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(AvatarPlaceholder, { size: 36 })
784
+ }
785
+ ),
786
+ onProfile && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
787
+ "button",
788
+ {
789
+ onClick: onProfile,
790
+ title: "\u0E42\u0E1B\u0E23\u0E44\u0E1F\u0E25\u0E4C\u0E02\u0E2D\u0E07\u0E09\u0E31\u0E19",
791
+ onMouseEnter: (e) => {
792
+ e.currentTarget.style.backgroundColor = isDark ? "#334155" : "var(--color-alias-color-brand-surface, #faf9e5)";
793
+ },
794
+ onMouseLeave: (e) => {
795
+ e.currentTarget.style.backgroundColor = "transparent";
796
+ },
797
+ style: {
798
+ width: "36px",
799
+ height: "36px",
800
+ borderRadius: "8px",
801
+ border: "none",
802
+ background: "transparent",
803
+ color: isDark ? "#8be9a0" : "var(--color-alias-color-brand-primary, #1e7d55)",
804
+ cursor: "pointer",
805
+ display: "flex",
806
+ alignItems: "center",
807
+ justifyContent: "center",
808
+ transition: "background-color 0.15s ease"
809
+ },
810
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ProfileIcon, {})
811
+ }
812
+ ),
813
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
814
+ "button",
815
+ {
816
+ onClick: onLogout,
817
+ title: "\u0E2D\u0E2D\u0E01\u0E08\u0E32\u0E01\u0E23\u0E30\u0E1A\u0E1A",
818
+ onMouseEnter: (e) => {
819
+ e.currentTarget.style.backgroundColor = "var(--color-foundations-fuan-pallet-light, #ffd2d2)";
820
+ },
821
+ onMouseLeave: (e) => {
822
+ e.currentTarget.style.backgroundColor = "transparent";
823
+ },
824
+ style: {
825
+ width: "36px",
826
+ height: "36px",
827
+ borderRadius: "8px",
828
+ border: "none",
829
+ background: "transparent",
830
+ color: "var(--color-alias-semantic-critical, #f21515)",
831
+ cursor: "pointer",
832
+ display: "flex",
833
+ alignItems: "center",
834
+ justifyContent: "center",
835
+ transition: "background-color 0.15s ease"
836
+ },
837
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(LogoutIcon, {})
838
+ }
839
+ )
840
+ ] });
841
+ }
842
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
843
+ "div",
844
+ {
845
+ style: {
846
+ padding: "16px 20px",
847
+ borderTop: `1px solid ${isDark ? "#374151" : "var(--color-border-colors-neutral, #c8cedd)"}`,
848
+ display: "flex",
849
+ alignItems: "center",
850
+ gap: "12px"
851
+ },
852
+ children: [
853
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
854
+ "div",
855
+ {
856
+ onClick: onProfile,
857
+ onMouseEnter: (e) => {
858
+ if (onProfile) e.currentTarget.style.opacity = "0.8";
859
+ },
860
+ onMouseLeave: (e) => {
861
+ if (onProfile) e.currentTarget.style.opacity = "1";
862
+ },
863
+ style: {
864
+ display: "flex",
865
+ alignItems: "center",
866
+ gap: "12px",
867
+ flex: 1,
868
+ minWidth: 0,
869
+ cursor: onProfile ? "pointer" : "default",
870
+ transition: "opacity 0.15s ease"
871
+ },
872
+ children: [
873
+ user.pictureUrl && !imgError ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
874
+ "img",
875
+ {
876
+ src: user.pictureUrl,
877
+ alt: getFullName(),
878
+ onError: () => setImgError(true),
879
+ style: {
880
+ width: "40px",
881
+ height: "40px",
882
+ borderRadius: "50%",
883
+ objectFit: "cover",
884
+ flexShrink: 0
885
+ }
886
+ }
887
+ ) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(AvatarPlaceholder, { size: 40 }),
888
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
889
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { style: {
890
+ fontWeight: 600,
891
+ fontSize: "14px",
892
+ lineHeight: "20px",
893
+ color: isDark ? "#ffffff" : "var(--color-alias-text-colors-primary, #060d26)",
894
+ margin: 0,
895
+ overflow: "hidden",
896
+ textOverflow: "ellipsis",
897
+ whiteSpace: "nowrap"
898
+ }, children: getFullName() }),
899
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { style: {
900
+ fontSize: "12px",
901
+ lineHeight: "16px",
902
+ color: isDark ? "#e2e8f0" : "var(--color-alias-text-colors-tertiary, #475272)",
903
+ margin: 0
904
+ }, children: roleLabel })
905
+ ] })
906
+ ]
907
+ }
908
+ ),
909
+ onProfile && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
910
+ "button",
911
+ {
912
+ onClick: onProfile,
913
+ title: "\u0E42\u0E1B\u0E23\u0E44\u0E1F\u0E25\u0E4C\u0E02\u0E2D\u0E07\u0E09\u0E31\u0E19",
914
+ onMouseEnter: (e) => {
915
+ e.currentTarget.style.backgroundColor = isDark ? "#334155" : "var(--color-alias-color-brand-surface, #faf9e5)";
916
+ },
917
+ onMouseLeave: (e) => {
918
+ e.currentTarget.style.backgroundColor = "transparent";
919
+ },
920
+ style: {
921
+ width: "36px",
922
+ height: "36px",
923
+ borderRadius: "8px",
924
+ border: "none",
925
+ background: "transparent",
926
+ color: isDark ? "#8be9a0" : "var(--color-alias-color-brand-primary, #1e7d55)",
927
+ cursor: "pointer",
928
+ display: "flex",
929
+ alignItems: "center",
930
+ justifyContent: "center",
931
+ transition: "background-color 0.15s ease",
932
+ flexShrink: 0
933
+ },
934
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ProfileIcon, {})
935
+ }
936
+ ),
937
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
938
+ "button",
939
+ {
940
+ onClick: onLogout,
941
+ title: "\u0E2D\u0E2D\u0E01\u0E08\u0E32\u0E01\u0E23\u0E30\u0E1A\u0E1A",
942
+ onMouseEnter: (e) => {
943
+ e.currentTarget.style.backgroundColor = "var(--color-foundations-fuan-pallet-light, #ffd2d2)";
944
+ e.currentTarget.style.color = "var(--color-alias-semantic-critical, #f21515)";
945
+ },
946
+ onMouseLeave: (e) => {
947
+ e.currentTarget.style.backgroundColor = "transparent";
948
+ e.currentTarget.style.color = "var(--color-alias-semantic-critical, #f21515)";
949
+ },
950
+ style: {
951
+ width: "36px",
952
+ height: "36px",
953
+ borderRadius: "8px",
954
+ border: "none",
955
+ background: "transparent",
956
+ color: "var(--color-alias-semantic-critical, #f21515)",
957
+ cursor: "pointer",
958
+ display: "flex",
959
+ alignItems: "center",
960
+ justifyContent: "center",
961
+ transition: "background-color 0.15s ease",
962
+ flexShrink: 0
963
+ },
964
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(LogoutIcon, {})
965
+ }
966
+ )
967
+ ]
968
+ }
969
+ );
970
+ }
971
+
972
+ // src/sidebar/StaffSidebar.tsx
973
+ var import_jsx_runtime5 = require("react/jsx-runtime");
974
+ function useIsMobile(breakpoint = 768) {
975
+ const [isMobile, setIsMobile] = (0, import_react4.useState)(false);
976
+ (0, import_react4.useEffect)(() => {
977
+ if (typeof window === "undefined") return;
978
+ const mql = window.matchMedia(`(max-width: ${breakpoint - 1}px)`);
979
+ setIsMobile(mql.matches);
980
+ const handler = (e) => setIsMobile(e.matches);
981
+ mql.addEventListener("change", handler);
982
+ return () => mql.removeEventListener("change", handler);
983
+ }, [breakpoint]);
984
+ return isMobile;
985
+ }
986
+ function ToggleIcon({ isOpen }) {
987
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
988
+ "svg",
989
+ {
990
+ width: "18",
991
+ height: "18",
992
+ viewBox: "0 0 24 24",
993
+ fill: "none",
994
+ stroke: "currentColor",
995
+ strokeWidth: "2",
996
+ strokeLinecap: "round",
997
+ strokeLinejoin: "round",
998
+ style: {
999
+ transition: "transform 0.2s ease",
1000
+ transform: isOpen ? "rotate(0deg)" : "rotate(180deg)"
1001
+ },
1002
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M15 18l-6-6 6-6" })
1003
+ }
1004
+ );
1005
+ }
1006
+ function HamburgerIcon() {
1007
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { width: "24", height: "18", viewBox: "0 0 27 18", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1008
+ "path",
1009
+ {
1010
+ d: "M1.1875 17.8426C0.851042 17.8426 0.569077 17.7287 0.341604 17.501C0.113868 17.2735 0 16.9914 0 16.6547C0 16.3182 0.113868 16.0363 0.341604 15.8088C0.569077 15.5816 0.851042 15.468 1.1875 15.468H25.7292C26.0656 15.468 26.3476 15.5817 26.5751 15.8092C26.8028 16.0369 26.9167 16.3192 26.9167 16.6559C26.9167 16.9923 26.8028 17.2743 26.5751 17.5018C26.3476 17.729 26.0656 17.8426 25.7292 17.8426H1.1875ZM1.1875 10.1088C0.851042 10.1088 0.569077 9.99492 0.341604 9.76719C0.113868 9.53945 0 9.25735 0 8.9209C0 8.58417 0.113868 8.30221 0.341604 8.075C0.569077 7.84753 0.851042 7.73379 1.1875 7.73379H25.7292C26.0656 7.73379 26.3476 7.84766 26.5751 8.0754C26.8028 8.30313 26.9167 8.58523 26.9167 8.92169C26.9167 9.25841 26.8028 9.54037 26.5751 9.76758C26.3476 9.99506 26.0656 10.1088 25.7292 10.1088H1.1875ZM1.1875 2.3746C0.851042 2.3746 0.569077 2.26087 0.341604 2.0334C0.113868 1.80566 0 1.52343 0 1.18671C0 0.850249 0.113868 0.568284 0.341604 0.340812C0.569077 0.113604 0.851042 0 1.1875 0H25.7292C26.0656 0 26.3476 0.113868 26.5751 0.341604C26.8028 0.569077 26.9167 0.851174 26.9167 1.1879C26.9167 1.52435 26.8028 1.80632 26.5751 2.03379C26.3476 2.261 26.0656 2.3746 25.7292 2.3746H1.1875Z",
1011
+ fill: "currentColor"
1012
+ }
1013
+ ) });
1014
+ }
1015
+ function CloseIcon() {
1016
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
1017
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
1018
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
1019
+ ] });
1020
+ }
1021
+ function HelpCircleIcon2() {
1022
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
1023
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
1024
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
1025
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
1026
+ ] });
1027
+ }
1028
+ function GearIcon2() {
1029
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
1030
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "12", cy: "12", r: "3" }),
1031
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" })
1032
+ ] });
1033
+ }
1034
+ var DEFAULT_BOTTOM_MENU = [
1035
+ { id: "settings", title: "\u0E15\u0E31\u0E49\u0E07\u0E04\u0E48\u0E32\u0E23\u0E30\u0E1A\u0E1A", icon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GearIcon2, {}), path: "/settings" },
1036
+ { id: "help", title: "\u0E0A\u0E48\u0E27\u0E22\u0E40\u0E2B\u0E25\u0E37\u0E2D", icon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(HelpCircleIcon2, {}), path: "/help" }
1037
+ ];
1038
+ function StaffSidebar({
1039
+ orgLogo,
1040
+ orgName,
1041
+ orgSubtitle,
1042
+ menuItems,
1043
+ bottomMenuItems,
1044
+ user,
1045
+ roleLabel,
1046
+ onNavigate,
1047
+ onLogout,
1048
+ onProfile,
1049
+ currentPath,
1050
+ width = "280px",
1051
+ className,
1052
+ collapsible = false,
1053
+ isOpen: controlledIsOpen,
1054
+ onToggle,
1055
+ onExpandRequest,
1056
+ topOffset = 0,
1057
+ mobileBreakpoint = 768
1058
+ }) {
1059
+ const isDark = useDarkMode();
1060
+ const isMobile = useIsMobile(mobileBreakpoint);
1061
+ const [internalOpen, setInternalOpen] = (0, import_react4.useState)(true);
1062
+ const [mobileDrawerOpen, setMobileDrawerOpen] = (0, import_react4.useState)(false);
1063
+ const sidebarOpen = controlledIsOpen !== void 0 ? controlledIsOpen : internalOpen;
1064
+ const collapsed = collapsible && !sidebarOpen;
1065
+ const collapsedWidth = "64px";
1066
+ const currentWidth = collapsed ? collapsedWidth : width;
1067
+ const resolvedBottomMenu = bottomMenuItems !== void 0 ? bottomMenuItems : DEFAULT_BOTTOM_MENU;
1068
+ const handleToggle = () => {
1069
+ if (onToggle) {
1070
+ onToggle();
1071
+ } else {
1072
+ setInternalOpen(!internalOpen);
1073
+ }
1074
+ };
1075
+ const handleExpandRequest = () => {
1076
+ if (onExpandRequest) {
1077
+ onExpandRequest();
1078
+ } else {
1079
+ if (onToggle) {
1080
+ onToggle();
1081
+ } else {
1082
+ setInternalOpen(true);
1083
+ }
1084
+ }
1085
+ };
1086
+ const openDrawer = (0, import_react4.useCallback)(() => setMobileDrawerOpen(true), []);
1087
+ const closeDrawer = (0, import_react4.useCallback)(() => setMobileDrawerOpen(false), []);
1088
+ const handleMobileNavigate = (0, import_react4.useCallback)((path) => {
1089
+ onNavigate(path);
1090
+ if (isMobile) closeDrawer();
1091
+ }, [onNavigate, isMobile, closeDrawer]);
1092
+ (0, import_react4.useEffect)(() => {
1093
+ if (isMobile && mobileDrawerOpen) {
1094
+ const originalOverflow = document.body.style.overflow;
1095
+ document.body.style.overflow = "hidden";
1096
+ return () => {
1097
+ document.body.style.overflow = originalOverflow;
1098
+ };
1099
+ }
1100
+ }, [isMobile, mobileDrawerOpen]);
1101
+ (0, import_react4.useEffect)(() => {
1102
+ if (!isMobile || !mobileDrawerOpen) return;
1103
+ const handler = (e) => {
1104
+ if (e.key === "Escape") closeDrawer();
1105
+ };
1106
+ window.addEventListener("keydown", handler);
1107
+ return () => window.removeEventListener("keydown", handler);
1108
+ }, [isMobile, mobileDrawerOpen, closeDrawer]);
1109
+ if (isMobile) {
1110
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
1111
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1112
+ "header",
1113
+ {
1114
+ style: {
1115
+ position: "sticky",
1116
+ top: 0,
1117
+ left: 0,
1118
+ right: 0,
1119
+ height: "60px",
1120
+ background: "linear-gradient(to bottom left, #3AAE7D, #346D55)",
1121
+ display: "flex",
1122
+ alignItems: "center",
1123
+ justifyContent: "space-between",
1124
+ padding: "0 16px",
1125
+ zIndex: 49,
1126
+ boxShadow: "0 2px 8px rgba(0,0,0,0.15)"
1127
+ },
1128
+ children: [
1129
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "12px", flex: 1, minWidth: 0 }, children: [
1130
+ orgLogo ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1131
+ "img",
1132
+ {
1133
+ src: orgLogo,
1134
+ alt: orgName,
1135
+ style: {
1136
+ width: "40px",
1137
+ height: "40px",
1138
+ borderRadius: "50%",
1139
+ objectFit: "cover",
1140
+ flexShrink: 0,
1141
+ border: "2px solid rgba(255,255,255,0.3)"
1142
+ }
1143
+ }
1144
+ ) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: {
1145
+ width: "40px",
1146
+ height: "40px",
1147
+ borderRadius: "50%",
1148
+ background: "rgba(255,255,255,0.2)",
1149
+ display: "flex",
1150
+ alignItems: "center",
1151
+ justifyContent: "center",
1152
+ color: "#fff",
1153
+ fontWeight: 700,
1154
+ fontSize: "16px",
1155
+ flexShrink: 0
1156
+ }, children: orgName.slice(0, 2) }),
1157
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: { minWidth: 0 }, children: [
1158
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { style: {
1159
+ color: "#fff",
1160
+ fontWeight: 700,
1161
+ fontSize: "15px",
1162
+ lineHeight: "20px",
1163
+ margin: 0,
1164
+ overflow: "hidden",
1165
+ textOverflow: "ellipsis",
1166
+ whiteSpace: "nowrap"
1167
+ }, children: orgName }),
1168
+ orgSubtitle && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { style: {
1169
+ color: "rgba(255,255,255,0.75)",
1170
+ fontSize: "12px",
1171
+ lineHeight: "16px",
1172
+ margin: 0,
1173
+ overflow: "hidden",
1174
+ textOverflow: "ellipsis",
1175
+ whiteSpace: "nowrap"
1176
+ }, children: orgSubtitle })
1177
+ ] })
1178
+ ] }),
1179
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1180
+ "button",
1181
+ {
1182
+ onClick: openDrawer,
1183
+ "aria-label": "\u0E40\u0E1B\u0E34\u0E14\u0E40\u0E21\u0E19\u0E39",
1184
+ style: {
1185
+ width: "44px",
1186
+ height: "44px",
1187
+ borderRadius: "10px",
1188
+ border: "none",
1189
+ background: "rgba(255,255,255,0.12)",
1190
+ cursor: "pointer",
1191
+ display: "flex",
1192
+ alignItems: "center",
1193
+ justifyContent: "center",
1194
+ color: "#ffffff",
1195
+ flexShrink: 0,
1196
+ transition: "background-color 0.15s ease",
1197
+ WebkitTapHighlightColor: "transparent"
1198
+ },
1199
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(HamburgerIcon, {})
1200
+ }
1201
+ )
1202
+ ]
1203
+ }
1204
+ ),
1205
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1206
+ "div",
1207
+ {
1208
+ onClick: closeDrawer,
1209
+ style: {
1210
+ position: "fixed",
1211
+ inset: 0,
1212
+ background: "rgba(0,0,0,0.45)",
1213
+ zIndex: 99,
1214
+ opacity: mobileDrawerOpen ? 1 : 0,
1215
+ pointerEvents: mobileDrawerOpen ? "auto" : "none",
1216
+ transition: "opacity 0.3s ease",
1217
+ WebkitTapHighlightColor: "transparent"
1218
+ }
1219
+ }
1220
+ ),
1221
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1222
+ "aside",
1223
+ {
1224
+ className,
1225
+ style: {
1226
+ position: "fixed",
1227
+ top: 0,
1228
+ left: 0,
1229
+ bottom: 0,
1230
+ width: "min(85vw, 320px)",
1231
+ background: isDark ? "#1e293b" : "#fff",
1232
+ zIndex: 100,
1233
+ display: "flex",
1234
+ flexDirection: "column",
1235
+ overflow: "hidden",
1236
+ boxShadow: mobileDrawerOpen ? "4px 0 24px rgba(0,0,0,0.2)" : "none",
1237
+ transform: mobileDrawerOpen ? "translateX(0)" : "translateX(-100%)",
1238
+ transition: "transform 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
1239
+ color: isDark ? "#ffffff" : void 0
1240
+ },
1241
+ children: [
1242
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: {
1243
+ display: "flex",
1244
+ alignItems: "center",
1245
+ justifyContent: "space-between",
1246
+ padding: "16px 16px 16px 20px",
1247
+ background: "linear-gradient(to bottom left, #3AAE7D, #346D55)",
1248
+ flexShrink: 0
1249
+ }, children: [
1250
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "12px", flex: 1, minWidth: 0 }, children: [
1251
+ orgLogo ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1252
+ "img",
1253
+ {
1254
+ src: orgLogo,
1255
+ alt: orgName,
1256
+ style: {
1257
+ width: "44px",
1258
+ height: "44px",
1259
+ borderRadius: "50%",
1260
+ objectFit: "cover",
1261
+ flexShrink: 0,
1262
+ border: "2px solid rgba(255,255,255,0.3)"
1263
+ }
1264
+ }
1265
+ ) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: {
1266
+ width: "44px",
1267
+ height: "44px",
1268
+ borderRadius: "50%",
1269
+ background: "rgba(255,255,255,0.2)",
1270
+ display: "flex",
1271
+ alignItems: "center",
1272
+ justifyContent: "center",
1273
+ color: "#fff",
1274
+ fontWeight: 700,
1275
+ fontSize: "16px",
1276
+ flexShrink: 0
1277
+ }, children: orgName.slice(0, 2) }),
1278
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: { minWidth: 0 }, children: [
1279
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { style: {
1280
+ color: "#fff",
1281
+ fontWeight: 700,
1282
+ fontSize: "15px",
1283
+ lineHeight: "20px",
1284
+ margin: 0,
1285
+ overflow: "hidden",
1286
+ textOverflow: "ellipsis",
1287
+ whiteSpace: "nowrap"
1288
+ }, children: orgName }),
1289
+ orgSubtitle && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { style: {
1290
+ color: "rgba(255,255,255,0.75)",
1291
+ fontSize: "12px",
1292
+ lineHeight: "16px",
1293
+ margin: 0
1294
+ }, children: orgSubtitle })
1295
+ ] })
1296
+ ] }),
1297
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1298
+ "button",
1299
+ {
1300
+ onClick: closeDrawer,
1301
+ "aria-label": "\u0E1B\u0E34\u0E14\u0E40\u0E21\u0E19\u0E39",
1302
+ style: {
1303
+ width: "40px",
1304
+ height: "40px",
1305
+ borderRadius: "10px",
1306
+ border: "none",
1307
+ background: "rgba(255,255,255,0.15)",
1308
+ cursor: "pointer",
1309
+ display: "flex",
1310
+ alignItems: "center",
1311
+ justifyContent: "center",
1312
+ color: "#ffffff",
1313
+ flexShrink: 0,
1314
+ transition: "background-color 0.15s ease",
1315
+ WebkitTapHighlightColor: "transparent"
1316
+ },
1317
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CloseIcon, {})
1318
+ }
1319
+ )
1320
+ ] }),
1321
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { flex: 1, overflowY: "auto", minHeight: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1322
+ SidebarMenu,
1323
+ {
1324
+ menuItems,
1325
+ onItemClick: handleMobileNavigate,
1326
+ currentPath,
1327
+ collapsed: false
1328
+ }
1329
+ ) }),
1330
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: { flexShrink: 0 }, children: [
1331
+ resolvedBottomMenu && resolvedBottomMenu.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
1332
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("hr", { style: {
1333
+ border: "none",
1334
+ borderTop: `1px solid ${isDark ? "#374151" : "var(--color-border-colors-neutral, #c8cedd)"}`,
1335
+ margin: "4px 12px"
1336
+ } }),
1337
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1338
+ SidebarMenu,
1339
+ {
1340
+ menuItems: resolvedBottomMenu,
1341
+ onItemClick: handleMobileNavigate,
1342
+ currentPath,
1343
+ collapsed: false
1344
+ }
1345
+ )
1346
+ ] }),
1347
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1348
+ SidebarUserProfile,
1349
+ {
1350
+ user,
1351
+ roleLabel,
1352
+ onLogout,
1353
+ onProfile,
1354
+ collapsed: false
1355
+ }
1356
+ )
1357
+ ] })
1358
+ ]
1359
+ }
1360
+ )
1361
+ ] });
1362
+ }
1363
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
1364
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1365
+ "aside",
1366
+ {
1367
+ className,
1368
+ style: {
1369
+ position: "fixed",
1370
+ top: topOffset,
1371
+ left: 0,
1372
+ height: `calc(100vh - ${typeof topOffset === "number" ? topOffset + "px" : topOffset})`,
1373
+ width: currentWidth,
1374
+ background: isDark ? "#1e293b" : "#fff",
1375
+ borderRight: `1px solid ${isDark ? "#374151" : "var(--color-border-colors-neutral, #c8cedd)"}`,
1376
+ display: "flex",
1377
+ flexDirection: "column",
1378
+ zIndex: 50,
1379
+ overflow: "hidden",
1380
+ transition: "width 0.3s ease",
1381
+ color: isDark ? "#ffffff" : void 0
1382
+ },
1383
+ children: [
1384
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1385
+ SidebarHeader,
1386
+ {
1387
+ orgLogo,
1388
+ orgName,
1389
+ orgSubtitle,
1390
+ collapsed
1391
+ }
1392
+ ),
1393
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { flex: 1, overflowY: "auto", minHeight: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1394
+ SidebarMenu,
1395
+ {
1396
+ menuItems,
1397
+ onItemClick: onNavigate,
1398
+ currentPath,
1399
+ collapsed,
1400
+ onExpandRequest: handleExpandRequest
1401
+ }
1402
+ ) }),
1403
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: { flexShrink: 0 }, children: [
1404
+ resolvedBottomMenu && resolvedBottomMenu.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
1405
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("hr", { style: {
1406
+ border: "none",
1407
+ borderTop: `1px solid ${isDark ? "#374151" : "var(--color-border-colors-neutral, #c8cedd)"}`,
1408
+ margin: "4px 12px"
1409
+ } }),
1410
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1411
+ SidebarMenu,
1412
+ {
1413
+ menuItems: resolvedBottomMenu,
1414
+ onItemClick: onNavigate,
1415
+ currentPath,
1416
+ collapsed,
1417
+ onExpandRequest: handleExpandRequest
1418
+ }
1419
+ )
1420
+ ] }),
1421
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1422
+ SidebarUserProfile,
1423
+ {
1424
+ user,
1425
+ roleLabel,
1426
+ onLogout,
1427
+ onProfile,
1428
+ collapsed
1429
+ }
1430
+ )
1431
+ ] })
1432
+ ]
1433
+ }
1434
+ ),
1435
+ collapsible && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
1436
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("style", { children: `@media(hover:hover){.sidebar-toggle-btn:hover{background-color:${isDark ? "#374151" : "#f3f4f6"}!important}}` }),
1437
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1438
+ "button",
1439
+ {
1440
+ className: "sidebar-toggle-btn",
1441
+ onClick: handleToggle,
1442
+ title: sidebarOpen ? "\u0E22\u0E48\u0E2D Sidebar" : "\u0E02\u0E22\u0E32\u0E22 Sidebar",
1443
+ style: {
1444
+ position: "fixed",
1445
+ top: `calc(${typeof topOffset === "number" ? topOffset + "px" : topOffset} + 10vh)`,
1446
+ left: currentWidth,
1447
+ zIndex: 51,
1448
+ width: "24px",
1449
+ height: "40px",
1450
+ borderRadius: "0 6px 6px 0",
1451
+ border: `1px solid ${isDark ? "#374151" : "var(--color-border-colors-neutral, #c8cedd)"}`,
1452
+ borderLeft: "none",
1453
+ background: isDark ? "#1e293b" : "#fff",
1454
+ cursor: "pointer",
1455
+ display: "flex",
1456
+ alignItems: "center",
1457
+ justifyContent: "center",
1458
+ boxShadow: isDark ? "2px 0 8px rgba(0,0,0,0.3)" : "2px 0 8px rgba(0,0,0,0.06)",
1459
+ transition: "left 0.3s ease",
1460
+ color: isDark ? "#ffffff" : "var(--color-alias-text-colors-tertiary, #475272)",
1461
+ WebkitTapHighlightColor: "transparent"
1462
+ },
1463
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ToggleIcon, { isOpen: sidebarOpen })
1464
+ }
1465
+ )
1466
+ ] })
1467
+ ] });
1468
+ }
1469
+
1470
+ // src/header/UserHeader.tsx
1471
+ var import_react5 = require("react");
1472
+ var import_jsx_runtime6 = require("react/jsx-runtime");
1473
+ function BellIcon2() {
1474
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("svg", { width: "22", height: "24", viewBox: "0 0 22 24", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1475
+ "path",
1476
+ {
1477
+ d: "M21.2321 13.4463L19.3618 6.71712C18.8136 4.74574 17.6222 3.01418 15.9769 1.79767C14.3316 0.581165 12.3269 -0.0504751 10.2814 0.00315377C8.23593 0.0567826 6.26708 0.792603 4.6878 2.09365C3.10852 3.3947 2.00945 5.18632 1.5653 7.18371L0.11728 13.6954C-0.0426654 14.4149 -0.0389674 15.1611 0.128101 15.879C0.29517 16.5969 0.621344 17.2681 1.08254 17.8431C1.54374 18.418 2.12818 18.8821 2.79272 19.2009C3.45727 19.5198 4.18494 19.6853 4.92202 19.6853H6.01861C6.24454 20.7979 6.84817 21.7982 7.72723 22.5167C8.60629 23.2352 9.70671 23.6277 10.842 23.6277C11.9774 23.6277 13.0778 23.2352 13.9569 22.5167C14.8359 21.7982 15.4396 20.7979 15.6655 19.6853H16.4904C17.2492 19.6853 17.9977 19.5099 18.6774 19.1728C19.3572 18.8357 19.9498 18.346 20.409 17.742C20.8682 17.1379 21.1815 16.4359 21.3245 15.6907C21.4674 14.9455 21.4352 14.1774 21.2321 13.4463ZM10.842 21.654C10.2334 21.6515 9.64049 21.461 9.1443 21.1086C8.6481 20.7562 8.27291 20.2591 8.07005 19.6853H13.614C13.4112 20.2591 13.036 20.7562 12.5398 21.1086C12.0436 21.461 11.4506 21.6515 10.842 21.654ZM18.8411 16.55C18.5668 16.9139 18.2114 17.2088 17.8032 17.4113C17.3949 17.6138 16.9451 17.7183 16.4894 17.7165H4.92202C4.47982 17.7164 4.04328 17.6171 3.64463 17.4257C3.24598 17.2344 2.89539 16.9559 2.61874 16.611C2.34208 16.266 2.14643 15.8633 2.04622 15.4326C1.94602 15.0019 1.94381 14.5542 2.03977 14.1226L3.4868 7.60994C3.83561 6.04105 4.69886 4.63379 5.93932 3.61186C7.17978 2.58992 8.72625 2.01197 10.3329 1.96988C11.9395 1.92779 13.5142 2.42398 14.8064 3.37956C16.0987 4.33515 17.0344 5.69528 17.4649 7.24376L19.3352 13.9729C19.4588 14.4114 19.4785 14.8725 19.3927 15.3199C19.3069 15.7672 19.1181 16.1884 18.8411 16.55Z",
1478
+ fill: "currentColor"
1479
+ }
1480
+ ) });
1481
+ }
1482
+ function HamburgerIcon2() {
1483
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("svg", { width: "24", height: "18", viewBox: "0 0 27 18", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1484
+ "path",
1485
+ {
1486
+ d: "M1.1875 17.8426C0.851042 17.8426 0.569077 17.7287 0.341604 17.501C0.113868 17.2735 0 16.9914 0 16.6547C0 16.3182 0.113868 16.0363 0.341604 15.8088C0.569077 15.5816 0.851042 15.468 1.1875 15.468H25.7292C26.0656 15.468 26.3476 15.5817 26.5751 15.8092C26.8028 16.0369 26.9167 16.3192 26.9167 16.6559C26.9167 16.9923 26.8028 17.2743 26.5751 17.5018C26.3476 17.729 26.0656 17.8426 25.7292 17.8426H1.1875ZM1.1875 10.1088C0.851042 10.1088 0.569077 9.99492 0.341604 9.76719C0.113868 9.53945 0 9.25735 0 8.9209C0 8.58417 0.113868 8.30221 0.341604 8.075C0.569077 7.84753 0.851042 7.73379 1.1875 7.73379H25.7292C26.0656 7.73379 26.3476 7.84766 26.5751 8.0754C26.8028 8.30313 26.9167 8.58523 26.9167 8.92169C26.9167 9.25841 26.8028 9.54037 26.5751 9.76758C26.3476 9.99506 26.0656 10.1088 25.7292 10.1088H1.1875ZM1.1875 2.3746C0.851042 2.3746 0.569077 2.26087 0.341604 2.0334C0.113868 1.80566 0 1.52343 0 1.18671C0 0.850249 0.113868 0.568284 0.341604 0.340812C0.569077 0.113604 0.851042 0 1.1875 0H25.7292C26.0656 0 26.3476 0.113868 26.5751 0.341604C26.8028 0.569077 26.9167 0.851174 26.9167 1.1879C26.9167 1.52435 26.8028 1.80632 26.5751 2.03379C26.3476 2.261 26.0656 2.3746 25.7292 2.3746H1.1875Z",
1487
+ fill: "currentColor"
1488
+ }
1489
+ ) });
1490
+ }
1491
+ function MessageOutlinedIcon(props) {
1492
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("svg", { focusable: "false", "aria-hidden": "true", viewBox: "0 0 24 24", fill: "currentColor", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M4 4h16v12H5.17L4 17.17zm0-2c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm2 10h12v2H6zm0-3h12v2H6zm0-3h12v2H6z" }) });
1493
+ }
1494
+ function AvatarPlaceholder2({ size = 44 }) {
1495
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1496
+ "div",
1497
+ {
1498
+ style: {
1499
+ width: `${size}px`,
1500
+ height: `${size}px`,
1501
+ borderRadius: "50%",
1502
+ backgroundColor: "#f1f5f9",
1503
+ display: "flex",
1504
+ alignItems: "center",
1505
+ justifyContent: "center",
1506
+ flexShrink: 0,
1507
+ boxShadow: "0 2px 8px rgba(0,0,0,0.05)"
1508
+ },
1509
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("svg", { width: size * 0.6, height: size * 0.6, viewBox: "0 0 24 24", fill: "#94a3b8", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }) })
1510
+ }
1511
+ );
1512
+ }
1513
+ function getNotifBg(type) {
1514
+ const map = {
1515
+ success: "#dcfce7",
1516
+ warning: "#fef9c3",
1517
+ error: "#fee2e2",
1518
+ reminder: "#f3e8ff",
1519
+ info: "#dbeafe"
1520
+ };
1521
+ return map[type] || map.info;
1522
+ }
1523
+ function getNotifIcon(type) {
1524
+ const map = {
1525
+ success: "\u2713",
1526
+ warning: "!",
1527
+ error: "\u2715",
1528
+ reminder: "\u23F0",
1529
+ info: "i"
1530
+ };
1531
+ return map[type] || map.info;
1532
+ }
1533
+ function UserHeader({
1534
+ user,
1535
+ notifications = [],
1536
+ onToggleSidebar,
1537
+ notificationBell,
1538
+ onMarkAllRead,
1539
+ onNotificationClick,
1540
+ onProfile,
1541
+ className
1542
+ }) {
1543
+ const displayName = `${user?.firstName || ""} ${user?.lastName || ""}`.trim() || "\u0E1C\u0E39\u0E49\u0E43\u0E0A\u0E49";
1544
+ const [isNotifOpen, setIsNotifOpen] = (0, import_react5.useState)(false);
1545
+ const [activeFilter, setActiveFilter] = (0, import_react5.useState)("all");
1546
+ const notifRef = (0, import_react5.useRef)(null);
1547
+ const isDark = useDarkMode();
1548
+ const [imgError, setImgError] = (0, import_react5.useState)(false);
1549
+ (0, import_react5.useEffect)(() => {
1550
+ setImgError(false);
1551
+ }, [user?.pictureUrl]);
1552
+ (0, import_react5.useEffect)(() => {
1553
+ const handleClickOutside = (e) => {
1554
+ if (notifRef.current && !notifRef.current.contains(e.target)) {
1555
+ setIsNotifOpen(false);
1556
+ }
1557
+ };
1558
+ document.addEventListener("mousedown", handleClickOutside);
1559
+ return () => document.removeEventListener("mousedown", handleClickOutside);
1560
+ }, []);
1561
+ const unreadCount = notifications.filter((n) => !n.isRead).length;
1562
+ const actionCount = notifications.filter((n) => n.category === "action").length;
1563
+ const generalCount = notifications.filter((n) => !n.category || n.category === "general").length;
1564
+ const filteredNotifications = notifications.filter((n) => {
1565
+ if (activeFilter === "all") return true;
1566
+ if (activeFilter === "action") return n.category === "action";
1567
+ return !n.category || n.category === "general";
1568
+ });
1569
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1570
+ "header",
1571
+ {
1572
+ className,
1573
+ style: {
1574
+ background: "linear-gradient(to bottom left, #3AAE7D, #346D55)",
1575
+ boxShadow: "0 2px 8px rgba(0,0,0,0.15)",
1576
+ position: "sticky",
1577
+ top: 0,
1578
+ zIndex: 40,
1579
+ color: "#ffffff"
1580
+ },
1581
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1582
+ "div",
1583
+ {
1584
+ style: {
1585
+ display: "flex",
1586
+ alignItems: "center",
1587
+ justifyContent: "space-between",
1588
+ padding: "14px 20px"
1589
+ },
1590
+ children: [
1591
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1592
+ "div",
1593
+ {
1594
+ onClick: onProfile,
1595
+ onMouseEnter: (e) => {
1596
+ if (onProfile) e.currentTarget.style.backgroundColor = "rgba(255,255,255,0.12)";
1597
+ },
1598
+ onMouseLeave: (e) => {
1599
+ if (onProfile) e.currentTarget.style.backgroundColor = "transparent";
1600
+ },
1601
+ style: {
1602
+ display: "flex",
1603
+ alignItems: "center",
1604
+ gap: "12px",
1605
+ cursor: onProfile ? "pointer" : "default",
1606
+ padding: "4px 8px",
1607
+ borderRadius: "10px",
1608
+ transition: "background-color 0.15s ease",
1609
+ flex: 1,
1610
+ minWidth: 0,
1611
+ overflow: "hidden"
1612
+ },
1613
+ children: [
1614
+ user?.pictureUrl && !imgError ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1615
+ "img",
1616
+ {
1617
+ src: user.pictureUrl,
1618
+ alt: displayName,
1619
+ onError: () => setImgError(true),
1620
+ style: {
1621
+ width: "44px",
1622
+ height: "44px",
1623
+ borderRadius: "50%",
1624
+ objectFit: "cover",
1625
+ border: "2px solid rgba(255,255,255,0.7)",
1626
+ flexShrink: 0
1627
+ }
1628
+ }
1629
+ ) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AvatarPlaceholder2, { size: 44 }),
1630
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
1631
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1632
+ "p",
1633
+ {
1634
+ style: {
1635
+ fontSize: "15px",
1636
+ fontWeight: 600,
1637
+ color: "#ffffff",
1638
+ margin: 0,
1639
+ overflow: "hidden",
1640
+ textOverflow: "ellipsis",
1641
+ whiteSpace: "nowrap"
1642
+ },
1643
+ children: [
1644
+ "\u0E2A\u0E27\u0E31\u0E2A\u0E14\u0E35,",
1645
+ " ",
1646
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1647
+ "span",
1648
+ {
1649
+ style: {
1650
+ color: "#ffffff"
1651
+ },
1652
+ children: displayName
1653
+ }
1654
+ )
1655
+ ]
1656
+ }
1657
+ ),
1658
+ user?.subtitle && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1659
+ "p",
1660
+ {
1661
+ style: {
1662
+ fontSize: "12px",
1663
+ color: "rgba(255,255,255,0.75)",
1664
+ margin: "2px 0 0",
1665
+ fontWeight: 400
1666
+ },
1667
+ children: user.subtitle
1668
+ }
1669
+ )
1670
+ ] })
1671
+ ]
1672
+ }
1673
+ ),
1674
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
1675
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { position: "relative" }, ref: notifRef, children: [
1676
+ notificationBell || /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1677
+ "button",
1678
+ {
1679
+ onClick: () => setIsNotifOpen(!isNotifOpen),
1680
+ onMouseEnter: (e) => {
1681
+ e.currentTarget.style.backgroundColor = "rgba(255,255,255,0.15)";
1682
+ },
1683
+ onMouseLeave: (e) => {
1684
+ e.currentTarget.style.backgroundColor = "transparent";
1685
+ },
1686
+ style: {
1687
+ padding: "10px",
1688
+ borderRadius: "8px",
1689
+ border: "none",
1690
+ background: "transparent",
1691
+ cursor: "pointer",
1692
+ position: "relative",
1693
+ display: "flex",
1694
+ alignItems: "center",
1695
+ justifyContent: "center",
1696
+ color: "#ffffff",
1697
+ transition: "background-color 0.15s ease"
1698
+ },
1699
+ children: [
1700
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(BellIcon2, {}),
1701
+ unreadCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1702
+ "span",
1703
+ {
1704
+ style: {
1705
+ position: "absolute",
1706
+ top: "2px",
1707
+ right: "2px",
1708
+ minWidth: "16px",
1709
+ height: "16px",
1710
+ background: "var(--color-alias-semantic-critical, #f21515)",
1711
+ borderRadius: "8px",
1712
+ display: "flex",
1713
+ alignItems: "center",
1714
+ justifyContent: "center",
1715
+ fontSize: unreadCount > 99 ? "7px" : "9px",
1716
+ fontWeight: 700,
1717
+ color: "#fff",
1718
+ padding: "0 3px",
1719
+ lineHeight: 1
1720
+ },
1721
+ children: unreadCount > 99 ? "99+" : unreadCount
1722
+ }
1723
+ )
1724
+ ]
1725
+ }
1726
+ ),
1727
+ isNotifOpen && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1728
+ "div",
1729
+ {
1730
+ className: "absolute top-full mt-2 w-[calc(100vw-32px)] max-w-[360px] left-1/2 -translate-x-1/2 md:left-auto md:right-0 md:translate-x-0",
1731
+ style: {
1732
+ background: isDark ? "#1e293b" : "#fff",
1733
+ borderRadius: "12px",
1734
+ boxShadow: isDark ? "0 10px 40px rgba(0,0,0,0.4)" : "0 10px 40px rgba(0,0,0,0.12)",
1735
+ zIndex: 999,
1736
+ overflow: "hidden",
1737
+ border: `1px solid ${isDark ? "#374151" : "#e5e7eb"}`
1738
+ },
1739
+ children: [
1740
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1741
+ "div",
1742
+ {
1743
+ style: {
1744
+ padding: "16px 16px 0",
1745
+ background: isDark ? "#1f2937" : "#fafafa"
1746
+ },
1747
+ children: [
1748
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: "12px" }, children: [
1749
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: { fontWeight: 600, fontSize: "14px", color: isDark ? "#ffffff" : "#111" }, children: "\u0E01\u0E32\u0E23\u0E41\u0E08\u0E49\u0E07\u0E40\u0E15\u0E37\u0E2D\u0E19" }),
1750
+ onMarkAllRead && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1751
+ "button",
1752
+ {
1753
+ onClick: onMarkAllRead,
1754
+ style: {
1755
+ fontSize: "12px",
1756
+ color: "var(--color-alias-color-brand-primary, #1e7d55)",
1757
+ background: "none",
1758
+ border: "none",
1759
+ cursor: "pointer",
1760
+ fontWeight: 500
1761
+ },
1762
+ children: "\u0E2D\u0E48\u0E32\u0E19\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14"
1763
+ }
1764
+ )
1765
+ ] }),
1766
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1767
+ "div",
1768
+ {
1769
+ style: {
1770
+ display: "flex",
1771
+ gap: "6px",
1772
+ paddingBottom: "12px",
1773
+ borderBottom: `1px solid ${isDark ? "#374151" : "#e5e7eb"}`
1774
+ },
1775
+ children: [
1776
+ { key: "all", label: "\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14", count: notifications.length },
1777
+ { key: "action", label: "\u0E15\u0E49\u0E2D\u0E07\u0E14\u0E33\u0E40\u0E19\u0E34\u0E19\u0E01\u0E32\u0E23", count: actionCount },
1778
+ { key: "general", label: "\u0E41\u0E08\u0E49\u0E07\u0E40\u0E15\u0E37\u0E2D\u0E19\u0E17\u0E31\u0E48\u0E27\u0E44\u0E1B", count: generalCount }
1779
+ ].map((tab) => {
1780
+ const isActive = activeFilter === tab.key;
1781
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1782
+ "button",
1783
+ {
1784
+ onClick: () => setActiveFilter(tab.key),
1785
+ style: {
1786
+ display: "inline-flex",
1787
+ alignItems: "center",
1788
+ gap: "5px",
1789
+ padding: "5px 10px",
1790
+ fontSize: "12px",
1791
+ fontWeight: isActive ? 600 : 400,
1792
+ color: isActive ? isDark ? "#ffffff" : "#1e7d55" : isDark ? "#9ca3af" : "#6b7280",
1793
+ background: isActive ? isDark ? "rgba(30,125,85,0.2)" : "rgba(30,125,85,0.08)" : "transparent",
1794
+ border: `1px solid ${isActive ? isDark ? "rgba(30,125,85,0.4)" : "rgba(30,125,85,0.25)" : isDark ? "#4b5563" : "#e5e7eb"}`,
1795
+ borderRadius: "16px",
1796
+ cursor: "pointer",
1797
+ transition: "all 0.15s ease",
1798
+ whiteSpace: "nowrap"
1799
+ },
1800
+ children: [
1801
+ tab.label,
1802
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1803
+ "span",
1804
+ {
1805
+ style: {
1806
+ minWidth: "18px",
1807
+ height: "18px",
1808
+ display: "inline-flex",
1809
+ alignItems: "center",
1810
+ justifyContent: "center",
1811
+ borderRadius: "9px",
1812
+ fontSize: "10px",
1813
+ fontWeight: 700,
1814
+ lineHeight: 1,
1815
+ padding: "0 4px",
1816
+ background: isActive ? isDark ? "#1e7d55" : "#1e7d55" : isDark ? "#4b5563" : "#e5e7eb",
1817
+ color: isActive ? "#ffffff" : isDark ? "#d1d5db" : "#6b7280"
1818
+ },
1819
+ children: tab.count
1820
+ }
1821
+ )
1822
+ ]
1823
+ },
1824
+ tab.key
1825
+ );
1826
+ })
1827
+ }
1828
+ )
1829
+ ]
1830
+ }
1831
+ ),
1832
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { maxHeight: "60vh", overflowY: "auto" }, children: filteredNotifications.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1833
+ "div",
1834
+ {
1835
+ style: {
1836
+ padding: "48px 32px",
1837
+ textAlign: "center",
1838
+ color: isDark ? "#9ca3af" : "#6b7280",
1839
+ fontSize: "14px",
1840
+ display: "flex",
1841
+ flexDirection: "column",
1842
+ alignItems: "center",
1843
+ justifyContent: "center",
1844
+ gap: "12px"
1845
+ },
1846
+ children: activeFilter === "action" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
1847
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MessageOutlinedIcon, { style: { width: "48px", height: "48px", opacity: 0.4 } }),
1848
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: { fontWeight: 500 }, children: "\u0E44\u0E21\u0E48\u0E21\u0E35\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E17\u0E35\u0E48\u0E15\u0E49\u0E2D\u0E07\u0E14\u0E33\u0E40\u0E19\u0E34\u0E19\u0E01\u0E32\u0E23" })
1849
+ ] }) : activeFilter === "all" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
1850
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(BellIcon2, {}),
1851
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: { fontWeight: 500, marginTop: "8px" }, children: "\u0E44\u0E21\u0E48\u0E21\u0E35\u0E01\u0E32\u0E23\u0E41\u0E08\u0E49\u0E07\u0E40\u0E15\u0E37\u0E2D\u0E19\u0E43\u0E2B\u0E21\u0E48" })
1852
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
1853
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { fontSize: "40px", opacity: 0.6, marginBottom: "-8px" }, children: "\u{1F4CB}" }),
1854
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: { fontWeight: 500 }, children: "\u0E44\u0E21\u0E48\u0E21\u0E35\u0E01\u0E32\u0E23\u0E41\u0E08\u0E49\u0E07\u0E40\u0E15\u0E37\u0E2D\u0E19\u0E17\u0E31\u0E48\u0E27\u0E44\u0E1B" })
1855
+ ] })
1856
+ }
1857
+ ) : filteredNotifications.map((item) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1858
+ "div",
1859
+ {
1860
+ onClick: () => onNotificationClick?.(item),
1861
+ style: {
1862
+ padding: "12px 16px",
1863
+ borderBottom: `1px solid ${isDark ? "#2d3748" : "#f3f4f6"}`,
1864
+ cursor: "pointer",
1865
+ background: !item.isRead ? isDark ? "rgba(59,130,246,0.15)" : "rgba(219,234,254,0.3)" : "transparent",
1866
+ position: "relative",
1867
+ display: "flex",
1868
+ gap: "12px",
1869
+ alignItems: "flex-start",
1870
+ transition: "background-color 0.15s ease"
1871
+ },
1872
+ onMouseEnter: (e) => {
1873
+ e.currentTarget.style.backgroundColor = isDark ? "#1f2937" : "#f9fafb";
1874
+ },
1875
+ onMouseLeave: (e) => {
1876
+ e.currentTarget.style.backgroundColor = !item.isRead ? isDark ? "rgba(59,130,246,0.15)" : "rgba(219,234,254,0.3)" : "transparent";
1877
+ },
1878
+ children: [
1879
+ !item.isRead && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1880
+ "span",
1881
+ {
1882
+ style: {
1883
+ position: "absolute",
1884
+ top: "12px",
1885
+ right: "12px",
1886
+ width: "8px",
1887
+ height: "8px",
1888
+ background: "#ef4444",
1889
+ borderRadius: "50%"
1890
+ }
1891
+ }
1892
+ ),
1893
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1894
+ "div",
1895
+ {
1896
+ style: {
1897
+ width: "32px",
1898
+ height: "32px",
1899
+ borderRadius: "50%",
1900
+ background: getNotifBg(item.type),
1901
+ display: "flex",
1902
+ alignItems: "center",
1903
+ justifyContent: "center",
1904
+ fontSize: "13px",
1905
+ flexShrink: 0,
1906
+ marginTop: "2px"
1907
+ },
1908
+ children: getNotifIcon(item.type)
1909
+ }
1910
+ ),
1911
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
1912
+ item.category === "action" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1913
+ "span",
1914
+ {
1915
+ style: {
1916
+ display: "inline-block",
1917
+ fontSize: "10px",
1918
+ fontWeight: 600,
1919
+ color: "#b45309",
1920
+ background: "#fef3c7",
1921
+ padding: "1px 6px",
1922
+ borderRadius: "4px",
1923
+ marginBottom: "4px"
1924
+ },
1925
+ children: "\u0E15\u0E49\u0E2D\u0E07\u0E14\u0E33\u0E40\u0E19\u0E34\u0E19\u0E01\u0E32\u0E23"
1926
+ }
1927
+ ),
1928
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1929
+ "p",
1930
+ {
1931
+ style: {
1932
+ fontSize: "13px",
1933
+ fontWeight: !item.isRead ? 600 : 500,
1934
+ color: isDark ? "#ffffff" : "#111",
1935
+ margin: "0 0 2px"
1936
+ },
1937
+ children: item.title
1938
+ }
1939
+ ),
1940
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1941
+ "p",
1942
+ {
1943
+ style: {
1944
+ fontSize: "12px",
1945
+ color: isDark ? "#9ca3af" : "#6b7280",
1946
+ margin: "0 0 4px",
1947
+ lineHeight: "18px"
1948
+ },
1949
+ children: item.description
1950
+ }
1951
+ ),
1952
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1953
+ "p",
1954
+ {
1955
+ style: {
1956
+ fontSize: "10px",
1957
+ color: isDark ? "#6b7280" : "#9ca3af",
1958
+ margin: 0,
1959
+ fontWeight: 500
1960
+ },
1961
+ children: item.date
1962
+ }
1963
+ )
1964
+ ] })
1965
+ ]
1966
+ },
1967
+ item.id
1968
+ )) })
1969
+ ]
1970
+ }
1971
+ )
1972
+ ] }),
1973
+ onToggleSidebar && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1974
+ "button",
1975
+ {
1976
+ onClick: onToggleSidebar,
1977
+ style: {
1978
+ padding: "10px",
1979
+ borderRadius: "8px",
1980
+ border: "none",
1981
+ background: "transparent",
1982
+ cursor: "pointer",
1983
+ display: "flex",
1984
+ alignItems: "center",
1985
+ justifyContent: "center",
1986
+ color: "#ffffff",
1987
+ transition: "background-color 0.15s ease"
1988
+ },
1989
+ onMouseEnter: (e) => {
1990
+ e.currentTarget.style.backgroundColor = "rgba(255,255,255,0.15)";
1991
+ },
1992
+ onMouseLeave: (e) => {
1993
+ e.currentTarget.style.backgroundColor = "transparent";
1994
+ },
1995
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HamburgerIcon2, {})
1996
+ }
1997
+ )
1998
+ ] })
1999
+ ]
2000
+ }
2001
+ )
2002
+ }
2003
+ );
2004
+ }
2005
+
2006
+ // src/header/UserSidebar.tsx
2007
+ var import_react6 = require("react");
2008
+ var import_jsx_runtime7 = require("react/jsx-runtime");
2009
+ function LogoutIcon2() {
2010
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2011
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }),
2012
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("polyline", { points: "16 17 21 12 16 7" }),
2013
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "21", y1: "12", x2: "9", y2: "12" })
2014
+ ] });
2015
+ }
2016
+ function ProfileIcon2() {
2017
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2018
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }),
2019
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("circle", { cx: "12", cy: "7", r: "4" })
2020
+ ] });
2021
+ }
2022
+ function AvatarPlaceholder3({ size = 56 }) {
2023
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2024
+ "div",
2025
+ {
2026
+ style: {
2027
+ width: `${size}px`,
2028
+ height: `${size}px`,
2029
+ borderRadius: "50%",
2030
+ backgroundColor: "#f1f5f9",
2031
+ display: "flex",
2032
+ alignItems: "center",
2033
+ justifyContent: "center",
2034
+ flexShrink: 0,
2035
+ boxShadow: "0 2px 8px rgba(0,0,0,0.05)"
2036
+ },
2037
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("svg", { width: size * 0.6, height: size * 0.6, viewBox: "0 0 24 24", fill: "#94a3b8", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }) })
2038
+ }
2039
+ );
2040
+ }
2041
+ function UserSidebar({
2042
+ user,
2043
+ roleLabel,
2044
+ menuItems,
2045
+ onNavigate,
2046
+ onLogout,
2047
+ isOpen,
2048
+ onClose,
2049
+ roleColor = "var(--color-alias-semantic-warning, orange)",
2050
+ onProfile
2051
+ }) {
2052
+ const isDark = useDarkMode();
2053
+ const [imgError, setImgError] = (0, import_react6.useState)(false);
2054
+ (0, import_react6.useEffect)(() => {
2055
+ setImgError(false);
2056
+ }, [user?.pictureUrl]);
2057
+ (0, import_react6.useEffect)(() => {
2058
+ if (isOpen) {
2059
+ document.body.style.overflow = "hidden";
2060
+ } else {
2061
+ document.body.style.overflow = "";
2062
+ }
2063
+ return () => {
2064
+ document.body.style.overflow = "";
2065
+ };
2066
+ }, [isOpen]);
2067
+ const getFullName = () => {
2068
+ if (!user) return "\u0E1C\u0E39\u0E49\u0E43\u0E0A\u0E49";
2069
+ if (user.firstName && user.lastName) return `${user.firstName} ${user.lastName}`;
2070
+ return user.firstName || user.lastName || "\u0E1C\u0E39\u0E49\u0E43\u0E0A\u0E49";
2071
+ };
2072
+ const handleMenuClick = (path) => {
2073
+ onNavigate(path);
2074
+ onClose();
2075
+ };
2076
+ const handleLogout = () => {
2077
+ onClose();
2078
+ onLogout();
2079
+ };
2080
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
2081
+ isOpen && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2082
+ "div",
2083
+ {
2084
+ onClick: onClose,
2085
+ style: {
2086
+ position: "fixed",
2087
+ inset: 0,
2088
+ background: "rgba(0,0,0,0.5)",
2089
+ zIndex: 45,
2090
+ transition: "opacity 0.3s ease"
2091
+ }
2092
+ }
2093
+ ),
2094
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
2095
+ "aside",
2096
+ {
2097
+ style: {
2098
+ position: "fixed",
2099
+ top: 0,
2100
+ right: 0,
2101
+ height: "100%",
2102
+ width: "80vw",
2103
+ maxWidth: "320px",
2104
+ background: isDark ? "#1e293b" : "#fff",
2105
+ boxShadow: isDark ? "-4px 0 24px rgba(0,0,0,0.4)" : "-4px 0 24px rgba(0,0,0,0.12)",
2106
+ zIndex: 50,
2107
+ transform: isOpen ? "translateX(0)" : "translateX(100%)",
2108
+ transition: "transform 0.3s ease",
2109
+ display: "flex",
2110
+ flexDirection: "column",
2111
+ color: isDark ? "#ffffff" : void 0
2112
+ },
2113
+ children: [
2114
+ user && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2115
+ "div",
2116
+ {
2117
+ style: {
2118
+ padding: "20px",
2119
+ borderBottom: `1px solid ${isDark ? "#374151" : "var(--color-border-colors-neutral, #c8cedd)"}`
2120
+ },
2121
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
2122
+ "div",
2123
+ {
2124
+ style: {
2125
+ display: "flex",
2126
+ alignItems: "center",
2127
+ gap: "12px",
2128
+ padding: "8px"
2129
+ },
2130
+ children: [
2131
+ user.pictureUrl && !imgError ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2132
+ "img",
2133
+ {
2134
+ src: user.pictureUrl,
2135
+ alt: getFullName(),
2136
+ onError: () => setImgError(true),
2137
+ style: {
2138
+ width: "56px",
2139
+ height: "56px",
2140
+ borderRadius: "50%",
2141
+ objectFit: "cover",
2142
+ flexShrink: 0,
2143
+ boxShadow: "0 2px 8px rgba(0,0,0,0.1)"
2144
+ }
2145
+ }
2146
+ ) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(AvatarPlaceholder3, { size: 56 }),
2147
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
2148
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2149
+ "p",
2150
+ {
2151
+ style: {
2152
+ fontWeight: 700,
2153
+ fontSize: "16px",
2154
+ color: isDark ? "#ffffff" : "var(--color-alias-text-colors-primary, #060d26)",
2155
+ margin: 0,
2156
+ overflow: "hidden",
2157
+ textOverflow: "ellipsis",
2158
+ whiteSpace: "nowrap"
2159
+ },
2160
+ children: getFullName()
2161
+ }
2162
+ ),
2163
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
2164
+ "p",
2165
+ {
2166
+ style: {
2167
+ fontSize: "13px",
2168
+ color: isDark ? "#e2e8f0" : "var(--color-alias-text-colors-tertiary, #475272)",
2169
+ margin: "2px 0 0",
2170
+ display: "flex",
2171
+ alignItems: "center",
2172
+ gap: "6px"
2173
+ },
2174
+ children: [
2175
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2176
+ "span",
2177
+ {
2178
+ style: {
2179
+ width: "8px",
2180
+ height: "8px",
2181
+ borderRadius: "50%",
2182
+ background: roleColor,
2183
+ display: "inline-block"
2184
+ }
2185
+ }
2186
+ ),
2187
+ roleLabel
2188
+ ]
2189
+ }
2190
+ )
2191
+ ] })
2192
+ ]
2193
+ }
2194
+ )
2195
+ }
2196
+ ),
2197
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2198
+ SidebarMenu,
2199
+ {
2200
+ menuItems: onProfile ? [{ id: "__profile__", title: "\u0E42\u0E1B\u0E23\u0E44\u0E1F\u0E25\u0E4C", icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ProfileIcon2, {}), path: "__profile__" }, ...menuItems] : menuItems,
2201
+ onItemClick: (path) => {
2202
+ if (path === "__profile__" && onProfile) {
2203
+ onProfile();
2204
+ onClose();
2205
+ } else {
2206
+ handleMenuClick(path);
2207
+ }
2208
+ }
2209
+ }
2210
+ ),
2211
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2212
+ "div",
2213
+ {
2214
+ style: {
2215
+ padding: "20px",
2216
+ borderTop: `1px solid ${isDark ? "#374151" : "var(--color-border-colors-neutral, #c8cedd)"}`
2217
+ },
2218
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
2219
+ "button",
2220
+ {
2221
+ onClick: handleLogout,
2222
+ onMouseEnter: (e) => {
2223
+ e.currentTarget.style.backgroundColor = isDark ? "#3b1c1c" : "#fef2f2";
2224
+ },
2225
+ onMouseLeave: (e) => {
2226
+ e.currentTarget.style.backgroundColor = "transparent";
2227
+ },
2228
+ style: {
2229
+ width: "100%",
2230
+ display: "flex",
2231
+ alignItems: "center",
2232
+ gap: "16px",
2233
+ padding: "14px 16px",
2234
+ borderRadius: "8px",
2235
+ border: "none",
2236
+ background: "transparent",
2237
+ color: "var(--color-alias-semantic-critical, #f21515)",
2238
+ cursor: "pointer",
2239
+ transition: "background-color 0.15s ease",
2240
+ fontSize: "15px",
2241
+ fontWeight: 500
2242
+ },
2243
+ children: [
2244
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(LogoutIcon2, {}),
2245
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: "\u0E2D\u0E2D\u0E01\u0E08\u0E32\u0E01\u0E23\u0E30\u0E1A\u0E1A" })
2246
+ ]
2247
+ }
2248
+ )
2249
+ }
2250
+ )
2251
+ ]
2252
+ }
2253
+ )
2254
+ ] });
2255
+ }
2256
+
2257
+ // src/bottombar/BottomBar.tsx
2258
+ var import_jsx_runtime8 = require("react/jsx-runtime");
2259
+ function BottomBar({
2260
+ children,
2261
+ sidebarWidth = "280px",
2262
+ height = "73px",
2263
+ className,
2264
+ style
2265
+ }) {
2266
+ const isDark = useDarkMode();
2267
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2268
+ "div",
2269
+ {
2270
+ className,
2271
+ style: {
2272
+ position: "fixed",
2273
+ bottom: 0,
2274
+ left: sidebarWidth,
2275
+ right: 0,
2276
+ height,
2277
+ background: isDark ? "#111827" : "#ffffff",
2278
+ borderTop: `1px solid ${isDark ? "#374151" : "var(--color-border-colors-neutral, #c8cedd)"}`,
2279
+ display: "flex",
2280
+ alignItems: "center",
2281
+ justifyContent: "space-between",
2282
+ padding: "16px 24px",
2283
+ zIndex: 30,
2284
+ transition: "left 0.3s ease",
2285
+ ...style
2286
+ },
2287
+ children
2288
+ }
2289
+ );
2290
+ }
2291
+
2292
+ // src/settings/SettingsContext.tsx
2293
+ var import_react7 = require("react");
2294
+ var import_jsx_runtime9 = require("react/jsx-runtime");
2295
+ var FONT_SIZE_OPTIONS = [
2296
+ { key: "xsmall", label: "\u0E40\u0E25\u0E47\u0E01\u0E21\u0E32\u0E01", scale: 0.8 },
2297
+ { key: "small", label: "\u0E40\u0E25\u0E47\u0E01", scale: 0.9 },
2298
+ { key: "medium", label: "\u0E01\u0E25\u0E32\u0E07", scale: 1 },
2299
+ { key: "large", label: "\u0E43\u0E2B\u0E0D\u0E48", scale: 1.2 },
2300
+ { key: "xlarge", label: "\u0E43\u0E2B\u0E0D\u0E48\u0E21\u0E32\u0E01", scale: 1.4 }
2301
+ ];
2302
+ var BASE_FONT_SIZES = {
2303
+ "--font-alias-mobile-body-fontsize": 16,
2304
+ "--font-alias-mobile-h1-fontsize": 28,
2305
+ "--font-alias-mobile-h2-fontsize": 24,
2306
+ "--font-alias-mobile-h3-fontsize": 20,
2307
+ "--font-alias-mobile-sub-fontsize": 14,
2308
+ "--font-alias-mobile-button-fontsize": 16
2309
+ };
2310
+ var SettingsContext = (0, import_react7.createContext)(void 0);
2311
+ function SettingsProvider({
2312
+ children,
2313
+ defaultTheme = "light",
2314
+ defaultFontSize = "medium",
2315
+ themeStorageKey = "app-theme",
2316
+ fontSizeStorageKey = "app-font-size"
2317
+ }) {
2318
+ const [theme, setThemeState] = (0, import_react7.useState)(defaultTheme);
2319
+ const [fontSize, setFontSizeState] = (0, import_react7.useState)(defaultFontSize);
2320
+ (0, import_react7.useEffect)(() => {
2321
+ try {
2322
+ const savedTheme = localStorage.getItem(themeStorageKey);
2323
+ if (savedTheme === "light" || savedTheme === "dark") {
2324
+ setThemeState(savedTheme);
2325
+ }
2326
+ const savedFontSize = localStorage.getItem(fontSizeStorageKey);
2327
+ if (savedFontSize && FONT_SIZE_OPTIONS.some((o) => o.key === savedFontSize)) {
2328
+ setFontSizeState(savedFontSize);
2329
+ }
2330
+ } catch {
2331
+ }
2332
+ }, [themeStorageKey, fontSizeStorageKey]);
2333
+ (0, import_react7.useEffect)(() => {
2334
+ const root = document.documentElement;
2335
+ if (theme === "dark") {
2336
+ root.classList.add("dark");
2337
+ } else {
2338
+ root.classList.remove("dark");
2339
+ }
2340
+ try {
2341
+ localStorage.setItem(themeStorageKey, theme);
2342
+ } catch {
2343
+ }
2344
+ }, [theme, themeStorageKey]);
2345
+ (0, import_react7.useEffect)(() => {
2346
+ const option = FONT_SIZE_OPTIONS.find((o) => o.key === fontSize) || FONT_SIZE_OPTIONS[2];
2347
+ const root = document.documentElement;
2348
+ Object.entries(BASE_FONT_SIZES).forEach(([varName, baseValue]) => {
2349
+ root.style.setProperty(varName, `${baseValue * option.scale}px`);
2350
+ });
2351
+ root.style.fontSize = `${16 * option.scale}px`;
2352
+ root.style.setProperty("--global-font-scale", option.scale.toString());
2353
+ document.body.style.zoom = option.scale.toString();
2354
+ try {
2355
+ localStorage.setItem(fontSizeStorageKey, fontSize);
2356
+ } catch {
2357
+ }
2358
+ }, [fontSize, fontSizeStorageKey]);
2359
+ const setTheme = (0, import_react7.useCallback)((t) => {
2360
+ setThemeState(t);
2361
+ }, []);
2362
+ const toggleTheme = (0, import_react7.useCallback)(() => {
2363
+ setThemeState((prev) => prev === "light" ? "dark" : "light");
2364
+ }, []);
2365
+ const setFontSize = (0, import_react7.useCallback)((s) => {
2366
+ setFontSizeState(s);
2367
+ }, []);
2368
+ const fontSizeOption = FONT_SIZE_OPTIONS.find((o) => o.key === fontSize) || FONT_SIZE_OPTIONS[2];
2369
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2370
+ SettingsContext.Provider,
2371
+ {
2372
+ value: { theme, setTheme, toggleTheme, fontSize, setFontSize, fontSizeOption },
2373
+ children
2374
+ }
2375
+ );
2376
+ }
2377
+ function useSettings() {
2378
+ const context = (0, import_react7.useContext)(SettingsContext);
2379
+ if (!context) {
2380
+ throw new Error("useSettings must be used within <SettingsProvider>");
2381
+ }
2382
+ return context;
2383
+ }
2384
+
2385
+ // src/settings/SettingsPanel.tsx
2386
+ var import_react8 = require("react");
2387
+
2388
+ // src/settings/ThemeSettings.tsx
2389
+ var import_jsx_runtime10 = require("react/jsx-runtime");
2390
+ function SunIcon() {
2391
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2392
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("circle", { cx: "12", cy: "12", r: "5" }),
2393
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("line", { x1: "12", y1: "1", x2: "12", y2: "3" }),
2394
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("line", { x1: "12", y1: "21", x2: "12", y2: "23" }),
2395
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }),
2396
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }),
2397
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("line", { x1: "1", y1: "12", x2: "3", y2: "12" }),
2398
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("line", { x1: "21", y1: "12", x2: "23", y2: "12" }),
2399
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }),
2400
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })
2401
+ ] });
2402
+ }
2403
+ function MoonIcon() {
2404
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }) });
2405
+ }
2406
+ function ThemeSettings({ onBack }) {
2407
+ const { theme, setTheme } = useSettings();
2408
+ const options = [
2409
+ { key: "light", label: "\u0E2A\u0E27\u0E48\u0E32\u0E07", icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SunIcon, {}), bg: "#fff", text: "#111" },
2410
+ { key: "dark", label: "\u0E21\u0E37\u0E14", icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MoonIcon, {}), bg: "#1f2937", text: "#f9fafb" }
2411
+ ];
2412
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
2413
+ onBack && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2414
+ "button",
2415
+ {
2416
+ onClick: onBack,
2417
+ style: {
2418
+ display: "flex",
2419
+ alignItems: "center",
2420
+ gap: 8,
2421
+ padding: "12px 16px",
2422
+ width: "100%",
2423
+ border: "none",
2424
+ background: "transparent",
2425
+ cursor: "pointer",
2426
+ fontSize: 15,
2427
+ fontWeight: 600,
2428
+ color: "var(--color-alias-text-colors-primary, #060d26)"
2429
+ },
2430
+ children: [
2431
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "M19 12H5M12 19l-7-7 7-7" }) }),
2432
+ "\u0E42\u0E2B\u0E21\u0E14\u0E2A\u0E27\u0E48\u0E32\u0E07/\u0E21\u0E37\u0E14"
2433
+ ]
2434
+ }
2435
+ ),
2436
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { padding: "12px 16px", display: "flex", gap: 12 }, children: options.map((opt) => {
2437
+ const isSelected = theme === opt.key;
2438
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2439
+ "button",
2440
+ {
2441
+ onClick: () => setTheme(opt.key),
2442
+ style: {
2443
+ flex: 1,
2444
+ padding: "20px 12px",
2445
+ borderRadius: 12,
2446
+ border: isSelected ? "2px solid var(--color-alias-color-brand-primary, #1e7d55)" : "2px solid var(--color-border-colors-neutral, #c8cedd)",
2447
+ background: opt.bg,
2448
+ cursor: "pointer",
2449
+ display: "flex",
2450
+ flexDirection: "column",
2451
+ alignItems: "center",
2452
+ gap: 8,
2453
+ transition: "all 0.2s ease"
2454
+ },
2455
+ children: [
2456
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { color: opt.text }, children: opt.icon }),
2457
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: {
2458
+ fontSize: 13,
2459
+ fontWeight: isSelected ? 700 : 500,
2460
+ color: opt.text
2461
+ }, children: opt.label }),
2462
+ isSelected && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: {
2463
+ width: 20,
2464
+ height: 20,
2465
+ borderRadius: "50%",
2466
+ background: "var(--color-alias-color-brand-primary, #1e7d55)",
2467
+ display: "flex",
2468
+ alignItems: "center",
2469
+ justifyContent: "center"
2470
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "#fff", strokeWidth: "3", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("polyline", { points: "20 6 9 17 4 12" }) }) })
2471
+ ]
2472
+ },
2473
+ opt.key
2474
+ );
2475
+ }) })
2476
+ ] });
2477
+ }
2478
+
2479
+ // src/settings/FontSizeSettings.tsx
2480
+ var import_jsx_runtime11 = require("react/jsx-runtime");
2481
+ function FontSizeSettings({ onBack }) {
2482
+ const { fontSize, setFontSize, fontSizeOption } = useSettings();
2483
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
2484
+ onBack && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2485
+ "button",
2486
+ {
2487
+ onClick: onBack,
2488
+ style: {
2489
+ display: "flex",
2490
+ alignItems: "center",
2491
+ gap: 8,
2492
+ padding: "12px 16px",
2493
+ width: "100%",
2494
+ border: "none",
2495
+ background: "transparent",
2496
+ cursor: "pointer",
2497
+ fontSize: 15,
2498
+ fontWeight: 600,
2499
+ color: "var(--color-alias-text-colors-primary, #060d26)"
2500
+ },
2501
+ children: [
2502
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { d: "M19 12H5M12 19l-7-7 7-7" }) }),
2503
+ "\u0E02\u0E19\u0E32\u0E14\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23"
2504
+ ]
2505
+ }
2506
+ ),
2507
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: {
2508
+ margin: "8px 16px",
2509
+ padding: "16px",
2510
+ borderRadius: 10,
2511
+ background: "var(--color-foundations-fuji-pallet-light, #ebedf5)",
2512
+ textAlign: "center"
2513
+ }, children: [
2514
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: {
2515
+ fontSize: `${16 * fontSizeOption.scale}px`,
2516
+ fontWeight: 500,
2517
+ color: "var(--color-alias-text-colors-primary, #060d26)",
2518
+ margin: 0
2519
+ }, children: "\u0E15\u0E31\u0E27\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" }),
2520
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { style: {
2521
+ fontSize: `${12 * fontSizeOption.scale}px`,
2522
+ color: "var(--color-alias-text-colors-tertiary, #475272)",
2523
+ margin: "4px 0 0"
2524
+ }, children: [
2525
+ "\xD7",
2526
+ fontSizeOption.scale
2527
+ ] })
2528
+ ] }),
2529
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { padding: "8px 16px", display: "flex", flexDirection: "column", gap: 4 }, children: FONT_SIZE_OPTIONS.map((opt) => {
2530
+ const isSelected = fontSize === opt.key;
2531
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2532
+ "button",
2533
+ {
2534
+ onClick: () => setFontSize(opt.key),
2535
+ onMouseEnter: (e) => {
2536
+ if (!isSelected) e.currentTarget.style.backgroundColor = "#f9fafb";
2537
+ },
2538
+ onMouseLeave: (e) => {
2539
+ if (!isSelected) e.currentTarget.style.backgroundColor = "transparent";
2540
+ },
2541
+ style: {
2542
+ display: "flex",
2543
+ alignItems: "center",
2544
+ justifyContent: "space-between",
2545
+ padding: "12px 14px",
2546
+ borderRadius: 8,
2547
+ border: isSelected ? "2px solid var(--color-alias-color-brand-primary, #1e7d55)" : "1px solid transparent",
2548
+ background: isSelected ? "color-mix(in srgb, var(--color-alias-color-brand-primary, #1e7d55) 8%, transparent)" : "transparent",
2549
+ cursor: "pointer",
2550
+ transition: "all 0.15s ease"
2551
+ },
2552
+ children: [
2553
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: {
2554
+ fontSize: `${14 * opt.scale}px`,
2555
+ fontWeight: isSelected ? 600 : 400,
2556
+ color: isSelected ? "var(--color-alias-color-brand-primary, #1e7d55)" : "var(--color-alias-text-colors-primary, #060d26)"
2557
+ }, children: opt.label }),
2558
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { style: {
2559
+ fontSize: 12,
2560
+ color: "var(--color-alias-text-colors-tertiary, #475272)"
2561
+ }, children: [
2562
+ "\xD7",
2563
+ opt.scale
2564
+ ] })
2565
+ ]
2566
+ },
2567
+ opt.key
2568
+ );
2569
+ }) })
2570
+ ] });
2571
+ }
2572
+
2573
+ // src/settings/SettingsPanel.tsx
2574
+ var import_jsx_runtime12 = require("react/jsx-runtime");
2575
+ function FontSizeIcon() {
2576
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2577
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("polyline", { points: "4 7 4 4 20 4 20 7" }),
2578
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("line", { x1: "9", y1: "20", x2: "15", y2: "20" }),
2579
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("line", { x1: "12", y1: "4", x2: "12", y2: "20" })
2580
+ ] });
2581
+ }
2582
+ function PaletteIcon() {
2583
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2584
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
2585
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("circle", { cx: "12", cy: "8", r: "1.5", fill: "currentColor" }),
2586
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("circle", { cx: "8", cy: "14", r: "1.5", fill: "currentColor" }),
2587
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("circle", { cx: "16", cy: "14", r: "1.5", fill: "currentColor" })
2588
+ ] });
2589
+ }
2590
+ function SettingsPanel({ className, showTheme = true }) {
2591
+ const [view, setView] = (0, import_react8.useState)("menu");
2592
+ if (view === "theme" && showTheme) {
2593
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ThemeSettings, { onBack: () => setView("menu") });
2594
+ }
2595
+ if (view === "fontSize") {
2596
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FontSizeSettings, { onBack: () => setView("menu") });
2597
+ }
2598
+ const allMenuItems = [
2599
+ {
2600
+ id: "fontSize",
2601
+ icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FontSizeIcon, {}),
2602
+ label: "\u0E02\u0E19\u0E32\u0E14\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",
2603
+ description: "\u0E40\u0E25\u0E47\u0E01\u0E21\u0E32\u0E01 / \u0E40\u0E25\u0E47\u0E01 / \u0E01\u0E25\u0E32\u0E07 / \u0E43\u0E2B\u0E0D\u0E48 / \u0E43\u0E2B\u0E0D\u0E48\u0E21\u0E32\u0E01",
2604
+ onClick: () => setView("fontSize")
2605
+ },
2606
+ ...showTheme ? [{
2607
+ id: "theme",
2608
+ icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(PaletteIcon, {}),
2609
+ label: "\u0E42\u0E2B\u0E21\u0E14\u0E2A\u0E27\u0E48\u0E32\u0E07/\u0E21\u0E37\u0E14",
2610
+ description: "\u0E40\u0E1B\u0E25\u0E35\u0E48\u0E22\u0E19\u0E18\u0E35\u0E21\u0E41\u0E2D\u0E1B\u0E1E\u0E25\u0E34\u0E40\u0E04\u0E0A\u0E31\u0E19",
2611
+ onClick: () => setView("theme")
2612
+ }] : []
2613
+ ];
2614
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className, children: [
2615
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: {
2616
+ padding: "16px",
2617
+ borderBottom: "1px solid var(--color-border-colors-neutral, #c8cedd)"
2618
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h3", { style: {
2619
+ fontSize: 16,
2620
+ fontWeight: 700,
2621
+ margin: 0,
2622
+ color: "var(--color-alias-text-colors-primary, #060d26)"
2623
+ }, children: "\u0E15\u0E31\u0E49\u0E07\u0E04\u0E48\u0E32\u0E23\u0E30\u0E1A\u0E1A" }) }),
2624
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { padding: "8px", display: "flex", flexDirection: "column", gap: 2 }, children: allMenuItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
2625
+ "button",
2626
+ {
2627
+ onClick: item.onClick,
2628
+ onMouseEnter: (e) => {
2629
+ e.currentTarget.style.backgroundColor = "#f9fafb";
2630
+ },
2631
+ onMouseLeave: (e) => {
2632
+ e.currentTarget.style.backgroundColor = "transparent";
2633
+ },
2634
+ style: {
2635
+ display: "flex",
2636
+ alignItems: "center",
2637
+ gap: 14,
2638
+ padding: "14px 12px",
2639
+ borderRadius: 10,
2640
+ border: "none",
2641
+ background: "transparent",
2642
+ cursor: "pointer",
2643
+ width: "100%",
2644
+ textAlign: "left",
2645
+ transition: "background-color 0.15s ease"
2646
+ },
2647
+ children: [
2648
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: {
2649
+ width: 40,
2650
+ height: 40,
2651
+ borderRadius: 10,
2652
+ background: "var(--color-foundations-fuji-pallet-light, #ebedf5)",
2653
+ display: "flex",
2654
+ alignItems: "center",
2655
+ justifyContent: "center",
2656
+ color: "var(--color-alias-color-brand-primary, #1e7d55)",
2657
+ flexShrink: 0
2658
+ }, children: item.icon }),
2659
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
2660
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { style: {
2661
+ fontSize: 15,
2662
+ fontWeight: 600,
2663
+ margin: 0,
2664
+ color: "var(--color-alias-text-colors-primary, #060d26)"
2665
+ }, children: item.label }),
2666
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { style: {
2667
+ fontSize: 12,
2668
+ margin: "2px 0 0",
2669
+ color: "var(--color-alias-text-colors-tertiary, #475272)"
2670
+ }, children: item.description })
2671
+ ] }),
2672
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M9 18l6-6-6-6" }) })
2673
+ ]
2674
+ },
2675
+ item.id
2676
+ )) })
2677
+ ] });
2678
+ }
2679
+
2680
+ // src/icons/index.ts
2681
+ var Icons = {
2682
+ Home: HomeIcon,
2683
+ Search: SearchIcon,
2684
+ Bell: BellIcon,
2685
+ Folder: FolderIcon,
2686
+ Clipboard: ClipboardIcon,
2687
+ FileText: FileTextIcon,
2688
+ Calendar: CalendarIcon,
2689
+ User: UserIcon,
2690
+ Users: UsersIcon,
2691
+ Gear: GearIcon,
2692
+ Wrench: WrenchIcon,
2693
+ Shield: ShieldIcon,
2694
+ HelpCircle: HelpCircleIcon,
2695
+ BarChart: BarChartIcon,
2696
+ History: HistoryIcon,
2697
+ Database: DatabaseIcon,
2698
+ Building: BuildingIcon,
2699
+ MapPin: MapPinIcon,
2700
+ Phone: PhoneIcon,
2701
+ Mail: MailIcon,
2702
+ CheckCircle: CheckCircleIcon,
2703
+ AlertTriangle: AlertTriangleIcon,
2704
+ XCircle: XCircleIcon,
2705
+ PlusCircle: PlusCircleIcon,
2706
+ LogOut: LogOutIcon,
2707
+ Download: DownloadIcon,
2708
+ Upload: UploadIcon,
2709
+ Printer: PrinterIcon,
2710
+ Star: StarIcon,
2711
+ Heart: HeartIcon,
2712
+ Eye: EyeIcon,
2713
+ Edit: EditIcon,
2714
+ Trash: TrashIcon
2715
+ };
2716
+
2717
+ // src/hooks/useLineConnect.ts
2718
+ var import_react9 = require("react");
2719
+ function useLineConnectCallback({ liffId, onLineConnected, onConnectError }) {
2720
+ (0, import_react9.useEffect)(() => {
2721
+ if (typeof window !== "undefined" && window.localStorage.getItem("is_linking_line") === "true") {
2722
+ window.localStorage.removeItem("is_linking_line");
2723
+ const checkLiffAndLink = async () => {
2724
+ const liff = window.liff;
2725
+ if (liff) {
2726
+ try {
2727
+ await liff.init({ liffId });
2728
+ if (liff.isLoggedIn()) {
2729
+ const profile = await liff.getProfile();
2730
+ if (profile?.userId && onLineConnected) {
2731
+ await onLineConnected(profile.userId);
2732
+ }
2733
+ }
2734
+ } catch (err) {
2735
+ console.error("LIFF linking error:", err);
2736
+ if (onConnectError) onConnectError(err);
2737
+ }
2738
+ }
2739
+ };
2740
+ const interval = setInterval(() => {
2741
+ if (window.liff) {
2742
+ clearInterval(interval);
2743
+ checkLiffAndLink();
2744
+ }
2745
+ }, 500);
2746
+ setTimeout(() => clearInterval(interval), 1e4);
2747
+ }
2748
+ }, [liffId, onLineConnected, onConnectError]);
2749
+ }
2750
+ var startLineConnection = (liffId, redirectUrl) => {
2751
+ if (typeof window === "undefined") return;
2752
+ const liff = window.liff;
2753
+ if (liff) {
2754
+ liff.init({ liffId }).then(() => {
2755
+ if (!liff.isLoggedIn()) {
2756
+ window.localStorage.setItem("is_linking_line", "true");
2757
+ liff.login({ redirectUri: redirectUrl || window.location.href });
2758
+ } else {
2759
+ window.localStorage.setItem("is_linking_line", "true");
2760
+ window.location.reload();
2761
+ }
2762
+ });
2763
+ }
2764
+ };
2765
+ // Annotate the CommonJS export names for ESM import in node:
2766
+ 0 && (module.exports = {
2767
+ AlertTriangleIcon,
2768
+ BarChartIcon,
2769
+ BellIcon,
2770
+ BottomBar,
2771
+ BuildingIcon,
2772
+ CalendarIcon,
2773
+ CheckCircleIcon,
2774
+ ClipboardIcon,
2775
+ DatabaseIcon,
2776
+ DownloadIcon,
2777
+ EditIcon,
2778
+ EyeIcon,
2779
+ FONT_SIZE_OPTIONS,
2780
+ FileTextIcon,
2781
+ FolderIcon,
2782
+ FontSizeSettings,
2783
+ GearIcon,
2784
+ HeartIcon,
2785
+ HelpCircleIcon,
2786
+ HistoryIcon,
2787
+ HomeIcon,
2788
+ Icons,
2789
+ LogOutIcon,
2790
+ MailIcon,
2791
+ MapPinIcon,
2792
+ PhoneIcon,
2793
+ PlusCircleIcon,
2794
+ PrinterIcon,
2795
+ SearchIcon,
2796
+ SettingsPanel,
2797
+ SettingsProvider,
2798
+ ShieldIcon,
2799
+ SidebarHeader,
2800
+ SidebarMenu,
2801
+ SidebarUserProfile,
2802
+ StaffSidebar,
2803
+ StarIcon,
2804
+ ThemeSettings,
2805
+ TrashIcon,
2806
+ UploadIcon,
2807
+ UserHeader,
2808
+ UserIcon,
2809
+ UserSidebar,
2810
+ UsersIcon,
2811
+ WrenchIcon,
2812
+ XCircleIcon,
2813
+ startLineConnection,
2814
+ useDarkMode,
2815
+ useLineConnectCallback,
2816
+ useSettings
2817
+ });
2818
+ //# sourceMappingURL=index.js.map