@nice2dev/admin 0.1.0 → 1.0.2

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.mjs CHANGED
@@ -1,19 +1,19 @@
1
- import { jsxs as n, jsx as e, Fragment as M } from "react/jsx-runtime";
2
- import { forwardRef as D, useState as x, useMemo as T, useCallback as $ } from "react";
3
- const P = D(function(S, k) {
1
+ import { jsxs as t, jsx as e, Fragment as G } from "react/jsx-runtime";
2
+ import { forwardRef as I, useState as k, useMemo as $, useCallback as U, useContext as H, createContext as Y } from "react";
3
+ const z = I(function(v, g) {
4
4
  const {
5
- widgets: u,
6
- columns: v = 4,
7
- title: _ = "Dashboard",
8
- headerActions: g,
9
- onWidgetClick: h,
10
- className: b,
11
- style: f
12
- } = S;
13
- return /* @__PURE__ */ n("div", { ref: k, className: `nice-admin-dashboard ${b ?? ""}`, style: f, children: [
14
- /* @__PURE__ */ n("div", { className: "nice-admin-dashboard__header", children: [
15
- /* @__PURE__ */ e("h2", { children: _ }),
16
- g && /* @__PURE__ */ e("div", { className: "nice-admin-dashboard__actions", children: g })
5
+ widgets: m,
6
+ columns: C = 4,
7
+ title: N = "Dashboard",
8
+ headerActions: b,
9
+ onWidgetClick: p,
10
+ className: f,
11
+ style: S
12
+ } = v;
13
+ return /* @__PURE__ */ t("div", { ref: g, className: `nice-admin-dashboard ${f ?? ""}`, style: S, children: [
14
+ /* @__PURE__ */ t("div", { className: "nice-admin-dashboard__header", children: [
15
+ /* @__PURE__ */ e("h2", { children: N }),
16
+ b && /* @__PURE__ */ e("div", { className: "nice-admin-dashboard__actions", children: b })
17
17
  ] }),
18
18
  /* @__PURE__ */ e(
19
19
  "div",
@@ -21,101 +21,101 @@ const P = D(function(S, k) {
21
21
  className: "nice-admin-dashboard__grid",
22
22
  style: {
23
23
  display: "grid",
24
- gridTemplateColumns: `repeat(${v}, 1fr)`,
24
+ gridTemplateColumns: `repeat(${C}, 1fr)`,
25
25
  gap: 16
26
26
  },
27
- children: u.map((c) => /* @__PURE__ */ n(
27
+ children: m.map((r) => /* @__PURE__ */ t(
28
28
  "div",
29
29
  {
30
- className: `nice-admin-dashboard__widget nice-admin-dashboard__widget--${c.type}`,
30
+ className: `nice-admin-dashboard__widget nice-admin-dashboard__widget--${r.type}`,
31
31
  style: {
32
- gridColumn: c.colSpan ? `span ${c.colSpan}` : void 0,
33
- gridRow: c.rowSpan ? `span ${c.rowSpan}` : void 0
32
+ gridColumn: r.colSpan ? `span ${r.colSpan}` : void 0,
33
+ gridRow: r.rowSpan ? `span ${r.rowSpan}` : void 0
34
34
  },
35
- onClick: () => h == null ? void 0 : h(c),
36
- role: h ? "button" : void 0,
37
- tabIndex: h ? 0 : void 0,
35
+ onClick: () => p == null ? void 0 : p(r),
36
+ role: p ? "button" : void 0,
37
+ tabIndex: p ? 0 : void 0,
38
38
  children: [
39
- /* @__PURE__ */ n("div", { className: "nice-admin-dashboard__widget-header", children: [
40
- c.icon && /* @__PURE__ */ e("span", { className: "nice-admin-dashboard__widget-icon", children: c.icon }),
41
- /* @__PURE__ */ e("span", { className: "nice-admin-dashboard__widget-title", children: c.title })
39
+ /* @__PURE__ */ t("div", { className: "nice-admin-dashboard__widget-header", children: [
40
+ r.icon && /* @__PURE__ */ e("span", { className: "nice-admin-dashboard__widget-icon", children: r.icon }),
41
+ /* @__PURE__ */ e("span", { className: "nice-admin-dashboard__widget-title", children: r.title })
42
42
  ] }),
43
- c.type === "stat" && /* @__PURE__ */ n("div", { className: "nice-admin-dashboard__stat", children: [
44
- /* @__PURE__ */ e("span", { className: "nice-admin-dashboard__stat-value", children: c.value }),
45
- c.change && /* @__PURE__ */ e(
43
+ r.type === "stat" && /* @__PURE__ */ t("div", { className: "nice-admin-dashboard__stat", children: [
44
+ /* @__PURE__ */ e("span", { className: "nice-admin-dashboard__stat-value", children: r.value }),
45
+ r.change && /* @__PURE__ */ e(
46
46
  "span",
47
47
  {
48
- className: `nice-admin-dashboard__stat-change ${c.changePositive ? "nice-admin-dashboard__stat-change--positive" : "nice-admin-dashboard__stat-change--negative"}`,
49
- children: c.change
48
+ className: `nice-admin-dashboard__stat-change ${r.changePositive ? "nice-admin-dashboard__stat-change--positive" : "nice-admin-dashboard__stat-change--negative"}`,
49
+ children: r.change
50
50
  }
51
51
  )
52
52
  ] }),
53
- c.type === "custom" && c.render && /* @__PURE__ */ e("div", { className: "nice-admin-dashboard__custom", children: c.render() }),
54
- (c.type === "chart" || c.type === "table" || c.type === "list") && c.render && /* @__PURE__ */ e("div", { className: "nice-admin-dashboard__content", children: c.render() })
53
+ r.type === "custom" && r.render && /* @__PURE__ */ e("div", { className: "nice-admin-dashboard__custom", children: r.render() }),
54
+ (r.type === "chart" || r.type === "table" || r.type === "list") && r.render && /* @__PURE__ */ e("div", { className: "nice-admin-dashboard__content", children: r.render() })
55
55
  ]
56
56
  },
57
- c.id
57
+ r.id
58
58
  ))
59
59
  }
60
60
  )
61
61
  ] });
62
- }), q = {
62
+ }), V = {
63
63
  active: "#22c55e",
64
64
  inactive: "#9ca3af",
65
65
  suspended: "#ef4444",
66
66
  pending: "#eab308"
67
- }, V = D(function(S, k) {
67
+ }, Q = I(function(v, g) {
68
68
  const {
69
- users: u,
70
- availableRoles: v = [],
71
- onCreate: _,
72
- onEdit: g,
73
- onDelete: h,
74
- onToggleStatus: b,
75
- onChangeRoles: f,
76
- searchable: c = !0,
77
- title: w = "User Management",
78
- className: C,
79
- style: p
80
- } = S, [N, y] = x(""), [l, t] = x(""), a = T(() => {
81
- let i = u;
82
- if (l && (i = i.filter((m) => m.status === l)), N.trim()) {
83
- const m = N.toLowerCase();
84
- i = i.filter(
85
- (L) => L.name.toLowerCase().includes(m) || L.email.toLowerCase().includes(m) || L.roles.some((F) => F.toLowerCase().includes(m))
69
+ users: m,
70
+ availableRoles: C = [],
71
+ onCreate: N,
72
+ onEdit: b,
73
+ onDelete: p,
74
+ onToggleStatus: f,
75
+ onChangeRoles: S,
76
+ searchable: r = !0,
77
+ title: L = "User Management",
78
+ className: x,
79
+ style: _
80
+ } = v, [y, w] = k(""), [c, n] = k(""), l = $(() => {
81
+ let a = m;
82
+ if (c && (a = a.filter((u) => u.status === c)), y.trim()) {
83
+ const u = y.toLowerCase();
84
+ a = a.filter(
85
+ (E) => E.name.toLowerCase().includes(u) || E.email.toLowerCase().includes(u) || E.roles.some((T) => T.toLowerCase().includes(u))
86
86
  );
87
87
  }
88
- return i;
89
- }, [u, l, N]), o = $((i) => {
90
- if (!b) return;
91
- const m = i.status === "active" ? "suspended" : "active";
92
- b(i.id, m);
93
- }, [b]);
94
- return /* @__PURE__ */ n("div", { ref: k, className: `nice-admin-users ${C ?? ""}`, style: p, children: [
95
- /* @__PURE__ */ n("div", { className: "nice-admin-users__header", children: [
96
- /* @__PURE__ */ e("h3", { children: w }),
97
- /* @__PURE__ */ n("span", { className: "nice-admin-users__count", children: [
98
- u.length,
88
+ return a;
89
+ }, [m, c, y]), h = U((a) => {
90
+ if (!f) return;
91
+ const u = a.status === "active" ? "suspended" : "active";
92
+ f(a.id, u);
93
+ }, [f]);
94
+ return /* @__PURE__ */ t("div", { ref: g, className: `nice-admin-users ${x ?? ""}`, style: _, children: [
95
+ /* @__PURE__ */ t("div", { className: "nice-admin-users__header", children: [
96
+ /* @__PURE__ */ e("h3", { children: L }),
97
+ /* @__PURE__ */ t("span", { className: "nice-admin-users__count", children: [
98
+ m.length,
99
99
  " users"
100
100
  ] }),
101
- _ && /* @__PURE__ */ e("button", { className: "nice-admin-users__create-btn", onClick: _, children: "+ Add User" })
101
+ N && /* @__PURE__ */ e("button", { className: "nice-admin-users__create-btn", onClick: N, children: "+ Add User" })
102
102
  ] }),
103
- /* @__PURE__ */ n("div", { className: "nice-admin-users__toolbar", children: [
104
- c && /* @__PURE__ */ e(
103
+ /* @__PURE__ */ t("div", { className: "nice-admin-users__toolbar", children: [
104
+ r && /* @__PURE__ */ e(
105
105
  "input",
106
106
  {
107
107
  type: "text",
108
- value: N,
109
- onChange: (i) => y(i.target.value),
108
+ value: y,
109
+ onChange: (a) => w(a.target.value),
110
110
  placeholder: "Search users…",
111
111
  className: "nice-admin-users__search"
112
112
  }
113
113
  ),
114
- /* @__PURE__ */ n(
114
+ /* @__PURE__ */ t(
115
115
  "select",
116
116
  {
117
- value: l,
118
- onChange: (i) => t(i.target.value),
117
+ value: c,
118
+ onChange: (a) => n(a.target.value),
119
119
  className: "nice-admin-users__status-filter",
120
120
  children: [
121
121
  /* @__PURE__ */ e("option", { value: "", children: "All statuses" }),
@@ -127,8 +127,8 @@ const P = D(function(S, k) {
127
127
  }
128
128
  )
129
129
  ] }),
130
- a.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-admin-users__empty", children: "No users found." }) : /* @__PURE__ */ n("table", { className: "nice-admin-users__table", children: [
131
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { children: [
130
+ l.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-admin-users__empty", children: "No users found." }) : /* @__PURE__ */ t("table", { className: "nice-admin-users__table", children: [
131
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ t("tr", { children: [
132
132
  /* @__PURE__ */ e("th", { children: "User" }),
133
133
  /* @__PURE__ */ e("th", { children: "Email" }),
134
134
  /* @__PURE__ */ e("th", { children: "Roles" }),
@@ -137,177 +137,177 @@ const P = D(function(S, k) {
137
137
  /* @__PURE__ */ e("th", { children: "Last Login" }),
138
138
  /* @__PURE__ */ e("th", { children: "Actions" })
139
139
  ] }) }),
140
- /* @__PURE__ */ e("tbody", { children: a.map((i) => /* @__PURE__ */ n("tr", { children: [
141
- /* @__PURE__ */ n("td", { className: "nice-admin-users__user-cell", children: [
142
- i.avatarUrl && /* @__PURE__ */ e("img", { src: i.avatarUrl, alt: "", className: "nice-admin-users__avatar" }),
143
- /* @__PURE__ */ e("span", { children: i.name })
140
+ /* @__PURE__ */ e("tbody", { children: l.map((a) => /* @__PURE__ */ t("tr", { children: [
141
+ /* @__PURE__ */ t("td", { className: "nice-admin-users__user-cell", children: [
142
+ a.avatarUrl && /* @__PURE__ */ e("img", { src: a.avatarUrl, alt: "", className: "nice-admin-users__avatar" }),
143
+ /* @__PURE__ */ e("span", { children: a.name })
144
144
  ] }),
145
- /* @__PURE__ */ e("td", { children: i.email }),
146
- /* @__PURE__ */ e("td", { children: f ? /* @__PURE__ */ e(
145
+ /* @__PURE__ */ e("td", { children: a.email }),
146
+ /* @__PURE__ */ e("td", { children: S ? /* @__PURE__ */ e(
147
147
  "select",
148
148
  {
149
149
  multiple: !0,
150
- value: i.roles,
151
- onChange: (m) => {
152
- const L = Array.from(m.target.selectedOptions, (F) => F.value);
153
- f(i.id, L);
150
+ value: a.roles,
151
+ onChange: (u) => {
152
+ const E = Array.from(u.target.selectedOptions, (T) => T.value);
153
+ S(a.id, E);
154
154
  },
155
155
  className: "nice-admin-users__roles-select",
156
- children: v.map((m) => /* @__PURE__ */ e("option", { value: m, children: m }, m))
156
+ children: C.map((u) => /* @__PURE__ */ e("option", { value: u, children: u }, u))
157
157
  }
158
- ) : i.roles.join(", ") }),
158
+ ) : a.roles.join(", ") }),
159
159
  /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
160
160
  "span",
161
161
  {
162
162
  className: "nice-admin-users__status-badge",
163
- style: { backgroundColor: q[i.status] },
164
- onClick: () => o(i),
165
- role: b ? "button" : void 0,
166
- children: i.status
163
+ style: { backgroundColor: V[a.status] },
164
+ onClick: () => h(a),
165
+ role: f ? "button" : void 0,
166
+ children: a.status
167
167
  }
168
168
  ) }),
169
- /* @__PURE__ */ e("td", { children: i.createdAt }),
170
- /* @__PURE__ */ e("td", { children: i.lastLoginAt ?? "—" }),
171
- /* @__PURE__ */ n("td", { className: "nice-admin-users__actions", children: [
172
- g && /* @__PURE__ */ e("button", { onClick: () => g(i), children: "Edit" }),
173
- h && /* @__PURE__ */ e("button", { onClick: () => h(i.id), children: "Delete" })
169
+ /* @__PURE__ */ e("td", { children: a.createdAt }),
170
+ /* @__PURE__ */ e("td", { children: a.lastLoginAt ?? "—" }),
171
+ /* @__PURE__ */ t("td", { className: "nice-admin-users__actions", children: [
172
+ b && /* @__PURE__ */ e("button", { onClick: () => b(a), children: "Edit" }),
173
+ p && /* @__PURE__ */ e("button", { onClick: () => p(a.id), children: "Delete" })
174
174
  ] })
175
- ] }, i.id)) })
175
+ ] }, a.id)) })
176
176
  ] })
177
177
  ] });
178
- }), Y = D(function(S, k) {
179
- var d;
178
+ }), X = I(function(v, g) {
179
+ var o;
180
180
  const {
181
- roles: u,
182
- actions: v,
183
- resources: _,
184
- onPermissionChange: g,
185
- onCreate: h,
186
- onDelete: b,
187
- onRename: f,
188
- title: c = "Role Management",
189
- className: w,
190
- style: C
191
- } = S, [p, N] = x(((d = u[0]) == null ? void 0 : d.id) ?? null), [y, l] = x(!1), [t, a] = x(""), [o, i] = x(""), m = u.find((r) => r.id === p), L = $(() => {
192
- !t.trim() || !h || (h(t.trim(), o.trim()), a(""), i(""), l(!1));
193
- }, [t, o, h]), F = (r, s, A) => {
194
- var E;
195
- return ((E = r.permissions[s]) == null ? void 0 : E.includes(A)) ?? !1;
181
+ roles: m,
182
+ actions: C,
183
+ resources: N,
184
+ onPermissionChange: b,
185
+ onCreate: p,
186
+ onDelete: f,
187
+ onRename: S,
188
+ title: r = "Role Management",
189
+ className: L,
190
+ style: x
191
+ } = v, [_, y] = k(((o = m[0]) == null ? void 0 : o.id) ?? null), [w, c] = k(!1), [n, l] = k(""), [h, a] = k(""), u = m.find((s) => s.id === _), E = U(() => {
192
+ !n.trim() || !p || (p(n.trim(), h.trim()), l(""), a(""), c(!1));
193
+ }, [n, h, p]), T = (s, d, i) => {
194
+ var A;
195
+ return ((A = s.permissions[d]) == null ? void 0 : A.includes(i)) ?? !1;
196
196
  };
197
- return /* @__PURE__ */ n("div", { ref: k, className: `nice-admin-roles ${w ?? ""}`, style: C, children: [
198
- /* @__PURE__ */ n("div", { className: "nice-admin-roles__header", children: [
199
- /* @__PURE__ */ e("h3", { children: c }),
200
- h && /* @__PURE__ */ e("button", { onClick: () => l(!y), children: "+ New Role" })
197
+ return /* @__PURE__ */ t("div", { ref: g, className: `nice-admin-roles ${L ?? ""}`, style: x, children: [
198
+ /* @__PURE__ */ t("div", { className: "nice-admin-roles__header", children: [
199
+ /* @__PURE__ */ e("h3", { children: r }),
200
+ p && /* @__PURE__ */ e("button", { onClick: () => c(!w), children: "+ New Role" })
201
201
  ] }),
202
- y && /* @__PURE__ */ n("div", { className: "nice-admin-roles__create-form", children: [
203
- /* @__PURE__ */ e("input", { type: "text", value: t, onChange: (r) => a(r.target.value), placeholder: "Role name" }),
204
- /* @__PURE__ */ e("input", { type: "text", value: o, onChange: (r) => i(r.target.value), placeholder: "Description" }),
205
- /* @__PURE__ */ e("button", { onClick: L, disabled: !t.trim(), children: "Create" }),
206
- /* @__PURE__ */ e("button", { onClick: () => l(!1), children: "Cancel" })
202
+ w && /* @__PURE__ */ t("div", { className: "nice-admin-roles__create-form", children: [
203
+ /* @__PURE__ */ e("input", { type: "text", value: n, onChange: (s) => l(s.target.value), placeholder: "Role name" }),
204
+ /* @__PURE__ */ e("input", { type: "text", value: h, onChange: (s) => a(s.target.value), placeholder: "Description" }),
205
+ /* @__PURE__ */ e("button", { onClick: E, disabled: !n.trim(), children: "Create" }),
206
+ /* @__PURE__ */ e("button", { onClick: () => c(!1), children: "Cancel" })
207
207
  ] }),
208
- /* @__PURE__ */ e("div", { className: "nice-admin-roles__tabs", children: u.map((r) => /* @__PURE__ */ n(
208
+ /* @__PURE__ */ e("div", { className: "nice-admin-roles__tabs", children: m.map((s) => /* @__PURE__ */ t(
209
209
  "button",
210
210
  {
211
- className: `nice-admin-roles__tab ${r.id === p ? "nice-admin-roles__tab--active" : ""}`,
212
- onClick: () => N(r.id),
213
- style: r.color ? { borderColor: r.color } : void 0,
211
+ className: `nice-admin-roles__tab ${s.id === _ ? "nice-admin-roles__tab--active" : ""}`,
212
+ onClick: () => y(s.id),
213
+ style: s.color ? { borderColor: s.color } : void 0,
214
214
  children: [
215
- r.name,
216
- r.userCount != null && /* @__PURE__ */ n("span", { className: "nice-admin-roles__tab-count", children: [
215
+ s.name,
216
+ s.userCount != null && /* @__PURE__ */ t("span", { className: "nice-admin-roles__tab-count", children: [
217
217
  "(",
218
- r.userCount,
218
+ s.userCount,
219
219
  ")"
220
220
  ] }),
221
- r.isSystem && /* @__PURE__ */ e("span", { className: "nice-admin-roles__tab-system", children: "🔒" })
221
+ s.isSystem && /* @__PURE__ */ e("span", { className: "nice-admin-roles__tab-system", children: "🔒" })
222
222
  ]
223
223
  },
224
- r.id
224
+ s.id
225
225
  )) }),
226
- m && /* @__PURE__ */ n("div", { className: "nice-admin-roles__matrix-wrap", children: [
227
- m.description && /* @__PURE__ */ e("p", { className: "nice-admin-roles__description", children: m.description }),
228
- /* @__PURE__ */ n("table", { className: "nice-admin-roles__matrix", children: [
229
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { children: [
226
+ u && /* @__PURE__ */ t("div", { className: "nice-admin-roles__matrix-wrap", children: [
227
+ u.description && /* @__PURE__ */ e("p", { className: "nice-admin-roles__description", children: u.description }),
228
+ /* @__PURE__ */ t("table", { className: "nice-admin-roles__matrix", children: [
229
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ t("tr", { children: [
230
230
  /* @__PURE__ */ e("th", { children: "Resource" }),
231
- v.map((r) => /* @__PURE__ */ e("th", { title: r.description, children: r.label }, r.id))
231
+ C.map((s) => /* @__PURE__ */ e("th", { title: s.description, children: s.label }, s.id))
232
232
  ] }) }),
233
- /* @__PURE__ */ e("tbody", { children: _.map((r) => /* @__PURE__ */ n("tr", { children: [
234
- /* @__PURE__ */ e("td", { children: r.label }),
235
- v.map((s) => {
236
- const A = F(m, r.id, s.id);
233
+ /* @__PURE__ */ e("tbody", { children: N.map((s) => /* @__PURE__ */ t("tr", { children: [
234
+ /* @__PURE__ */ e("td", { children: s.label }),
235
+ C.map((d) => {
236
+ const i = T(u, s.id, d.id);
237
237
  return /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
238
238
  "input",
239
239
  {
240
240
  type: "checkbox",
241
- checked: A,
242
- onChange: () => g == null ? void 0 : g(m.id, r.id, s.id, !A),
243
- disabled: m.isSystem
241
+ checked: i,
242
+ onChange: () => b == null ? void 0 : b(u.id, s.id, d.id, !i),
243
+ disabled: u.isSystem
244
244
  }
245
- ) }, s.id);
245
+ ) }, d.id);
246
246
  })
247
- ] }, r.id)) })
247
+ ] }, s.id)) })
248
248
  ] }),
249
- !m.isSystem && /* @__PURE__ */ n("div", { className: "nice-admin-roles__role-actions", children: [
250
- f && /* @__PURE__ */ e("button", { onClick: () => {
251
- const r = prompt("New role name:", m.name);
252
- r && f(m.id, r);
249
+ !u.isSystem && /* @__PURE__ */ t("div", { className: "nice-admin-roles__role-actions", children: [
250
+ S && /* @__PURE__ */ e("button", { onClick: () => {
251
+ const s = prompt("New role name:", u.name);
252
+ s && S(u.id, s);
253
253
  }, children: "Rename" }),
254
- b && /* @__PURE__ */ e("button", { onClick: () => b(m.id), children: "Delete Role" })
254
+ f && /* @__PURE__ */ e("button", { onClick: () => f(u.id), children: "Delete Role" })
255
255
  ] })
256
256
  ] })
257
257
  ] });
258
- }), O = {
258
+ }), K = {
259
259
  info: { color: "#3b82f6", label: "INFO" },
260
260
  warning: { color: "#eab308", label: "WARN" },
261
261
  error: { color: "#ef4444", label: "ERROR" },
262
262
  critical: { color: "#dc2626", label: "CRIT" }
263
- }, J = D(function(S, k) {
263
+ }, Z = I(function(v, g) {
264
264
  const {
265
- entries: u,
266
- onEntryClick: v,
267
- onLoadMore: _,
268
- hasMore: g = !1,
269
- searchable: h = !0,
270
- showSeverityFilter: b = !0,
271
- title: f = "Audit Log",
272
- className: c,
273
- style: w
274
- } = S, [C, p] = x(""), [N, y] = x(""), l = T(() => {
275
- let t = u;
276
- if (N && (t = t.filter((a) => a.severity === N)), C.trim()) {
277
- const a = C.toLowerCase();
278
- t = t.filter(
279
- (o) => {
280
- var i;
281
- return o.actorName.toLowerCase().includes(a) || o.action.toLowerCase().includes(a) || o.resource.toLowerCase().includes(a) || ((i = o.details) == null ? void 0 : i.toLowerCase().includes(a));
265
+ entries: m,
266
+ onEntryClick: C,
267
+ onLoadMore: N,
268
+ hasMore: b = !1,
269
+ searchable: p = !0,
270
+ showSeverityFilter: f = !0,
271
+ title: S = "Audit Log",
272
+ className: r,
273
+ style: L
274
+ } = v, [x, _] = k(""), [y, w] = k(""), c = $(() => {
275
+ let n = m;
276
+ if (y && (n = n.filter((l) => l.severity === y)), x.trim()) {
277
+ const l = x.toLowerCase();
278
+ n = n.filter(
279
+ (h) => {
280
+ var a;
281
+ return h.actorName.toLowerCase().includes(l) || h.action.toLowerCase().includes(l) || h.resource.toLowerCase().includes(l) || ((a = h.details) == null ? void 0 : a.toLowerCase().includes(l));
282
282
  }
283
283
  );
284
284
  }
285
- return t;
286
- }, [u, N, C]);
287
- return /* @__PURE__ */ n("div", { ref: k, className: `nice-admin-audit-log ${c ?? ""}`, style: w, children: [
288
- /* @__PURE__ */ n("div", { className: "nice-admin-audit-log__header", children: [
289
- /* @__PURE__ */ e("h3", { children: f }),
290
- /* @__PURE__ */ n("span", { className: "nice-admin-audit-log__count", children: [
291
- u.length,
285
+ return n;
286
+ }, [m, y, x]);
287
+ return /* @__PURE__ */ t("div", { ref: g, className: `nice-admin-audit-log ${r ?? ""}`, style: L, children: [
288
+ /* @__PURE__ */ t("div", { className: "nice-admin-audit-log__header", children: [
289
+ /* @__PURE__ */ e("h3", { children: S }),
290
+ /* @__PURE__ */ t("span", { className: "nice-admin-audit-log__count", children: [
291
+ m.length,
292
292
  " entries"
293
293
  ] })
294
294
  ] }),
295
- /* @__PURE__ */ n("div", { className: "nice-admin-audit-log__toolbar", children: [
296
- h && /* @__PURE__ */ e(
295
+ /* @__PURE__ */ t("div", { className: "nice-admin-audit-log__toolbar", children: [
296
+ p && /* @__PURE__ */ e(
297
297
  "input",
298
298
  {
299
299
  type: "text",
300
- value: C,
301
- onChange: (t) => p(t.target.value),
300
+ value: x,
301
+ onChange: (n) => _(n.target.value),
302
302
  placeholder: "Search audit log…",
303
303
  className: "nice-admin-audit-log__search"
304
304
  }
305
305
  ),
306
- b && /* @__PURE__ */ n(
306
+ f && /* @__PURE__ */ t(
307
307
  "select",
308
308
  {
309
- value: N,
310
- onChange: (t) => y(t.target.value),
309
+ value: y,
310
+ onChange: (n) => w(n.target.value),
311
311
  className: "nice-admin-audit-log__severity-filter",
312
312
  children: [
313
313
  /* @__PURE__ */ e("option", { value: "", children: "All severities" }),
@@ -319,8 +319,8 @@ const P = D(function(S, k) {
319
319
  }
320
320
  )
321
321
  ] }),
322
- l.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-admin-audit-log__empty", children: "No audit log entries found." }) : /* @__PURE__ */ n("table", { className: "nice-admin-audit-log__table", children: [
323
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { children: [
322
+ c.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-admin-audit-log__empty", children: "No audit log entries found." }) : /* @__PURE__ */ t("table", { className: "nice-admin-audit-log__table", children: [
323
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ t("tr", { children: [
324
324
  /* @__PURE__ */ e("th", { children: "Timestamp" }),
325
325
  /* @__PURE__ */ e("th", { children: "Severity" }),
326
326
  /* @__PURE__ */ e("th", { children: "Actor" }),
@@ -329,90 +329,90 @@ const P = D(function(S, k) {
329
329
  /* @__PURE__ */ e("th", { children: "IP" }),
330
330
  /* @__PURE__ */ e("th", { children: "Details" })
331
331
  ] }) }),
332
- /* @__PURE__ */ e("tbody", { children: l.map((t) => {
333
- const a = O[t.severity];
334
- return /* @__PURE__ */ n(
332
+ /* @__PURE__ */ e("tbody", { children: c.map((n) => {
333
+ const l = K[n.severity];
334
+ return /* @__PURE__ */ t(
335
335
  "tr",
336
336
  {
337
337
  className: "nice-admin-audit-log__row",
338
- onClick: () => v == null ? void 0 : v(t),
339
- role: v ? "button" : void 0,
340
- tabIndex: v ? 0 : void 0,
338
+ onClick: () => C == null ? void 0 : C(n),
339
+ role: C ? "button" : void 0,
340
+ tabIndex: C ? 0 : void 0,
341
341
  children: [
342
- /* @__PURE__ */ e("td", { children: t.timestamp }),
343
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: "nice-admin-audit-log__severity", style: { color: a.color }, children: a.label }) }),
344
- /* @__PURE__ */ e("td", { children: t.actorName }),
345
- /* @__PURE__ */ e("td", { children: t.action }),
346
- /* @__PURE__ */ n("td", { children: [
347
- t.resource,
348
- t.resourceId ? ` #${t.resourceId}` : ""
342
+ /* @__PURE__ */ e("td", { children: n.timestamp }),
343
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: "nice-admin-audit-log__severity", style: { color: l.color }, children: l.label }) }),
344
+ /* @__PURE__ */ e("td", { children: n.actorName }),
345
+ /* @__PURE__ */ e("td", { children: n.action }),
346
+ /* @__PURE__ */ t("td", { children: [
347
+ n.resource,
348
+ n.resourceId ? ` #${n.resourceId}` : ""
349
349
  ] }),
350
- /* @__PURE__ */ e("td", { children: t.ipAddress ?? "—" }),
351
- /* @__PURE__ */ e("td", { className: "nice-admin-audit-log__details", children: t.details ?? "—" })
350
+ /* @__PURE__ */ e("td", { children: n.ipAddress ?? "—" }),
351
+ /* @__PURE__ */ e("td", { className: "nice-admin-audit-log__details", children: n.details ?? "—" })
352
352
  ]
353
353
  },
354
- t.id
354
+ n.id
355
355
  );
356
356
  }) })
357
357
  ] }),
358
- g && _ && /* @__PURE__ */ e("button", { className: "nice-admin-audit-log__load-more", onClick: _, children: "Load more" })
358
+ b && N && /* @__PURE__ */ e("button", { className: "nice-admin-audit-log__load-more", onClick: N, children: "Load more" })
359
359
  ] });
360
- }), W = D(function(S, k) {
360
+ }), j = I(function(v, g) {
361
361
  const {
362
- settings: u,
363
- onSave: v,
364
- onChange: _,
365
- onReset: g,
366
- saving: h = !1,
367
- title: b = "Settings",
368
- className: f,
369
- style: c
370
- } = S, [w, C] = x(() => {
371
- const t = {};
372
- for (const a of u) t[a.key] = a.value;
373
- return t;
374
- }), p = $((t, a) => {
375
- C((o) => ({ ...o, [t]: a })), _ == null || _(t, a);
376
- }, [_]), N = $(() => {
377
- v == null || v(w);
378
- }, [v, w]), y = /* @__PURE__ */ new Map();
379
- for (const t of u) {
380
- const a = t.section ?? "General";
381
- y.has(a) || y.set(a, []), y.get(a).push(t);
362
+ settings: m,
363
+ onSave: C,
364
+ onChange: N,
365
+ onReset: b,
366
+ saving: p = !1,
367
+ title: f = "Settings",
368
+ className: S,
369
+ style: r
370
+ } = v, [L, x] = k(() => {
371
+ const n = {};
372
+ for (const l of m) n[l.key] = l.value;
373
+ return n;
374
+ }), _ = U((n, l) => {
375
+ x((h) => ({ ...h, [n]: l })), N == null || N(n, l);
376
+ }, [N]), y = U(() => {
377
+ C == null || C(L);
378
+ }, [C, L]), w = /* @__PURE__ */ new Map();
379
+ for (const n of m) {
380
+ const l = n.section ?? "General";
381
+ w.has(l) || w.set(l, []), w.get(l).push(n);
382
382
  }
383
- const l = (t) => {
384
- var o;
385
- const a = w[t.key];
386
- switch (t.type) {
383
+ const c = (n) => {
384
+ var h;
385
+ const l = L[n.key];
386
+ switch (n.type) {
387
387
  case "boolean":
388
- return /* @__PURE__ */ n("label", { className: "nice-admin-settings__toggle", children: [
388
+ return /* @__PURE__ */ t("label", { className: "nice-admin-settings__toggle", children: [
389
389
  /* @__PURE__ */ e(
390
390
  "input",
391
391
  {
392
392
  type: "checkbox",
393
- checked: !!a,
394
- onChange: (i) => p(t.key, i.target.checked)
393
+ checked: !!l,
394
+ onChange: (a) => _(n.key, a.target.checked)
395
395
  }
396
396
  ),
397
- t.label
397
+ n.label
398
398
  ] });
399
399
  case "select":
400
400
  return /* @__PURE__ */ e(
401
401
  "select",
402
402
  {
403
- value: String(a ?? ""),
404
- onChange: (i) => p(t.key, i.target.value),
403
+ value: String(l ?? ""),
404
+ onChange: (a) => _(n.key, a.target.value),
405
405
  className: "nice-admin-settings__select",
406
- children: (o = t.options) == null ? void 0 : o.map((i) => /* @__PURE__ */ e("option", { value: i.value, children: i.label }, i.value))
406
+ children: (h = n.options) == null ? void 0 : h.map((a) => /* @__PURE__ */ e("option", { value: a.value, children: a.label }, a.value))
407
407
  }
408
408
  );
409
409
  case "textarea":
410
410
  return /* @__PURE__ */ e(
411
411
  "textarea",
412
412
  {
413
- value: String(a ?? ""),
414
- onChange: (i) => p(t.key, i.target.value),
415
- placeholder: t.placeholder,
413
+ value: String(l ?? ""),
414
+ onChange: (a) => _(n.key, a.target.value),
415
+ placeholder: n.placeholder,
416
416
  className: "nice-admin-settings__textarea",
417
417
  rows: 4
418
418
  }
@@ -422,9 +422,9 @@ const P = D(function(S, k) {
422
422
  "input",
423
423
  {
424
424
  type: "number",
425
- value: a != null ? Number(a) : "",
426
- onChange: (i) => p(t.key, parseFloat(i.target.value) || 0),
427
- placeholder: t.placeholder,
425
+ value: l != null ? Number(l) : "",
426
+ onChange: (a) => _(n.key, parseFloat(a.target.value) || 0),
427
+ placeholder: n.placeholder,
428
428
  className: "nice-admin-settings__input"
429
429
  }
430
430
  );
@@ -433,8 +433,8 @@ const P = D(function(S, k) {
433
433
  "input",
434
434
  {
435
435
  type: "color",
436
- value: String(a ?? "#000000"),
437
- onChange: (i) => p(t.key, i.target.value),
436
+ value: String(l ?? "#000000"),
437
+ onChange: (a) => _(n.key, a.target.value),
438
438
  className: "nice-admin-settings__color"
439
439
  }
440
440
  );
@@ -443,9 +443,9 @@ const P = D(function(S, k) {
443
443
  "input",
444
444
  {
445
445
  type: "password",
446
- value: String(a ?? ""),
447
- onChange: (i) => p(t.key, i.target.value),
448
- placeholder: t.placeholder,
446
+ value: String(l ?? ""),
447
+ onChange: (a) => _(n.key, a.target.value),
448
+ placeholder: n.placeholder,
449
449
  className: "nice-admin-settings__input",
450
450
  autoComplete: "new-password"
451
451
  }
@@ -455,71 +455,71 @@ const P = D(function(S, k) {
455
455
  "input",
456
456
  {
457
457
  type: "text",
458
- value: String(a ?? ""),
459
- onChange: (i) => p(t.key, i.target.value),
460
- placeholder: t.placeholder,
458
+ value: String(l ?? ""),
459
+ onChange: (a) => _(n.key, a.target.value),
460
+ placeholder: n.placeholder,
461
461
  className: "nice-admin-settings__input"
462
462
  }
463
463
  );
464
464
  }
465
465
  };
466
- return /* @__PURE__ */ n("div", { ref: k, className: `nice-admin-settings ${f ?? ""}`, style: c, children: [
467
- /* @__PURE__ */ e("div", { className: "nice-admin-settings__header", children: /* @__PURE__ */ e("h3", { children: b }) }),
468
- Array.from(y.entries()).map(([t, a]) => /* @__PURE__ */ n("fieldset", { className: "nice-admin-settings__section", children: [
469
- /* @__PURE__ */ e("legend", { children: t }),
470
- a.map((o) => /* @__PURE__ */ n("div", { className: "nice-admin-settings__field", children: [
471
- o.type !== "boolean" && /* @__PURE__ */ n("label", { className: "nice-admin-settings__label", children: [
472
- o.label,
473
- o.required && /* @__PURE__ */ e("span", { className: "nice-admin-settings__required", children: "*" })
466
+ return /* @__PURE__ */ t("div", { ref: g, className: `nice-admin-settings ${S ?? ""}`, style: r, children: [
467
+ /* @__PURE__ */ e("div", { className: "nice-admin-settings__header", children: /* @__PURE__ */ e("h3", { children: f }) }),
468
+ Array.from(w.entries()).map(([n, l]) => /* @__PURE__ */ t("fieldset", { className: "nice-admin-settings__section", children: [
469
+ /* @__PURE__ */ e("legend", { children: n }),
470
+ l.map((h) => /* @__PURE__ */ t("div", { className: "nice-admin-settings__field", children: [
471
+ h.type !== "boolean" && /* @__PURE__ */ t("label", { className: "nice-admin-settings__label", children: [
472
+ h.label,
473
+ h.required && /* @__PURE__ */ e("span", { className: "nice-admin-settings__required", children: "*" })
474
474
  ] }),
475
- o.description && /* @__PURE__ */ e("p", { className: "nice-admin-settings__description", children: o.description }),
476
- l(o)
477
- ] }, o.key))
478
- ] }, t)),
479
- /* @__PURE__ */ n("div", { className: "nice-admin-settings__actions", children: [
480
- /* @__PURE__ */ e("button", { className: "nice-admin-settings__save-btn", onClick: N, disabled: h, children: h ? "Saving…" : "Save Settings" }),
481
- g && /* @__PURE__ */ e("button", { className: "nice-admin-settings__reset-btn", onClick: g, children: "Reset to Defaults" })
475
+ h.description && /* @__PURE__ */ e("p", { className: "nice-admin-settings__description", children: h.description }),
476
+ c(h)
477
+ ] }, h.key))
478
+ ] }, n)),
479
+ /* @__PURE__ */ t("div", { className: "nice-admin-settings__actions", children: [
480
+ /* @__PURE__ */ e("button", { className: "nice-admin-settings__save-btn", onClick: y, disabled: p, children: p ? "Saving…" : "Save Settings" }),
481
+ b && /* @__PURE__ */ e("button", { className: "nice-admin-settings__reset-btn", onClick: b, children: "Reset to Defaults" })
482
482
  ] })
483
483
  ] });
484
- }), z = D(function(S, k) {
484
+ }), ee = I(function(v, g) {
485
485
  const {
486
- notifications: u,
487
- availableChannels: v = ["email", "push", "sms", "in-app", "webhook"],
488
- onToggle: _,
489
- onEdit: g,
490
- onTest: h,
491
- onCreate: b,
492
- onDelete: f,
493
- title: c = "Notification Management",
494
- className: w,
495
- style: C
496
- } = S, [p, N] = x(""), y = T(() => {
497
- if (!p.trim()) return u;
498
- const l = p.toLowerCase();
499
- return u.filter(
500
- (t) => {
501
- var a;
502
- return t.name.toLowerCase().includes(l) || t.event.toLowerCase().includes(l) || ((a = t.description) == null ? void 0 : a.toLowerCase().includes(l));
486
+ notifications: m,
487
+ availableChannels: C = ["email", "push", "sms", "in-app", "webhook"],
488
+ onToggle: N,
489
+ onEdit: b,
490
+ onTest: p,
491
+ onCreate: f,
492
+ onDelete: S,
493
+ title: r = "Notification Management",
494
+ className: L,
495
+ style: x
496
+ } = v, [_, y] = k(""), w = $(() => {
497
+ if (!_.trim()) return m;
498
+ const c = _.toLowerCase();
499
+ return m.filter(
500
+ (n) => {
501
+ var l;
502
+ return n.name.toLowerCase().includes(c) || n.event.toLowerCase().includes(c) || ((l = n.description) == null ? void 0 : l.toLowerCase().includes(c));
503
503
  }
504
504
  );
505
- }, [u, p]);
506
- return /* @__PURE__ */ n("div", { ref: k, className: `nice-admin-notifications ${w ?? ""}`, style: C, children: [
507
- /* @__PURE__ */ n("div", { className: "nice-admin-notifications__header", children: [
508
- /* @__PURE__ */ e("h3", { children: c }),
509
- b && /* @__PURE__ */ e("button", { onClick: b, children: "+ New Notification" })
505
+ }, [m, _]);
506
+ return /* @__PURE__ */ t("div", { ref: g, className: `nice-admin-notifications ${L ?? ""}`, style: x, children: [
507
+ /* @__PURE__ */ t("div", { className: "nice-admin-notifications__header", children: [
508
+ /* @__PURE__ */ e("h3", { children: r }),
509
+ f && /* @__PURE__ */ e("button", { onClick: f, children: "+ New Notification" })
510
510
  ] }),
511
511
  /* @__PURE__ */ e(
512
512
  "input",
513
513
  {
514
514
  type: "text",
515
- value: p,
516
- onChange: (l) => N(l.target.value),
515
+ value: _,
516
+ onChange: (c) => y(c.target.value),
517
517
  placeholder: "Search notifications…",
518
518
  className: "nice-admin-notifications__search"
519
519
  }
520
520
  ),
521
- y.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-admin-notifications__empty", children: "No notifications found." }) : /* @__PURE__ */ n("table", { className: "nice-admin-notifications__table", children: [
522
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { children: [
521
+ w.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-admin-notifications__empty", children: "No notifications found." }) : /* @__PURE__ */ t("table", { className: "nice-admin-notifications__table", children: [
522
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ t("tr", { children: [
523
523
  /* @__PURE__ */ e("th", { children: "Enabled" }),
524
524
  /* @__PURE__ */ e("th", { children: "Name" }),
525
525
  /* @__PURE__ */ e("th", { children: "Event" }),
@@ -528,203 +528,203 @@ const P = D(function(S, k) {
528
528
  /* @__PURE__ */ e("th", { children: "Sent" }),
529
529
  /* @__PURE__ */ e("th", { children: "Actions" })
530
530
  ] }) }),
531
- /* @__PURE__ */ e("tbody", { children: y.map((l) => /* @__PURE__ */ n("tr", { children: [
531
+ /* @__PURE__ */ e("tbody", { children: w.map((c) => /* @__PURE__ */ t("tr", { children: [
532
532
  /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
533
533
  "input",
534
534
  {
535
535
  type: "checkbox",
536
- checked: l.enabled,
537
- onChange: () => _ == null ? void 0 : _(l.id, !l.enabled)
536
+ checked: c.enabled,
537
+ onChange: () => N == null ? void 0 : N(c.id, !c.enabled)
538
538
  }
539
539
  ) }),
540
- /* @__PURE__ */ n("td", { children: [
541
- /* @__PURE__ */ e("strong", { children: l.name }),
542
- l.description && /* @__PURE__ */ e("br", {}),
543
- l.description && /* @__PURE__ */ e("small", { children: l.description })
540
+ /* @__PURE__ */ t("td", { children: [
541
+ /* @__PURE__ */ e("strong", { children: c.name }),
542
+ c.description && /* @__PURE__ */ e("br", {}),
543
+ c.description && /* @__PURE__ */ e("small", { children: c.description })
544
544
  ] }),
545
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("code", { children: l.event }) }),
546
- /* @__PURE__ */ e("td", { children: l.channels.join(", ") }),
547
- /* @__PURE__ */ e("td", { children: l.lastSentAt ?? "—" }),
548
- /* @__PURE__ */ e("td", { children: l.sentCount ?? 0 }),
549
- /* @__PURE__ */ n("td", { className: "nice-admin-notifications__actions", children: [
550
- g && /* @__PURE__ */ e("button", { onClick: () => g(l), children: "Edit" }),
551
- h && /* @__PURE__ */ e("button", { onClick: () => h(l.id), children: "Test" }),
552
- f && /* @__PURE__ */ e("button", { onClick: () => f(l.id), children: "Delete" })
545
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("code", { children: c.event }) }),
546
+ /* @__PURE__ */ e("td", { children: c.channels.join(", ") }),
547
+ /* @__PURE__ */ e("td", { children: c.lastSentAt ?? "—" }),
548
+ /* @__PURE__ */ e("td", { children: c.sentCount ?? 0 }),
549
+ /* @__PURE__ */ t("td", { className: "nice-admin-notifications__actions", children: [
550
+ b && /* @__PURE__ */ e("button", { onClick: () => b(c), children: "Edit" }),
551
+ p && /* @__PURE__ */ e("button", { onClick: () => p(c.id), children: "Test" }),
552
+ S && /* @__PURE__ */ e("button", { onClick: () => S(c.id), children: "Delete" })
553
553
  ] })
554
- ] }, l.id)) })
554
+ ] }, c.id)) })
555
555
  ] })
556
556
  ] });
557
- }), B = D(function(S, k) {
557
+ }), te = I(function(v, g) {
558
558
  const {
559
- flags: u,
560
- environmentNames: v = ["development", "staging", "production"],
561
- onToggle: _,
562
- onPercentageChange: g,
563
- onCreate: h,
564
- onDelete: b,
565
- onEdit: f,
566
- title: c = "Feature Flags",
567
- className: w,
568
- style: C
569
- } = S, [p, N] = x(""), [y, l] = x(!1), [t, a] = x(""), [o, i] = x(""), [m, L] = x(""), F = T(() => {
570
- if (!p.trim()) return u;
571
- const s = p.toLowerCase();
572
- return u.filter(
573
- (A) => {
574
- var E, R;
575
- return A.key.toLowerCase().includes(s) || A.name.toLowerCase().includes(s) || ((E = A.description) == null ? void 0 : E.toLowerCase().includes(s)) || ((R = A.tags) == null ? void 0 : R.some((U) => U.toLowerCase().includes(s)));
559
+ flags: m,
560
+ environmentNames: C = ["development", "staging", "production"],
561
+ onToggle: N,
562
+ onPercentageChange: b,
563
+ onCreate: p,
564
+ onDelete: f,
565
+ onEdit: S,
566
+ title: r = "Feature Flags",
567
+ className: L,
568
+ style: x
569
+ } = v, [_, y] = k(""), [w, c] = k(!1), [n, l] = k(""), [h, a] = k(""), [u, E] = k(""), T = $(() => {
570
+ if (!_.trim()) return m;
571
+ const d = _.toLowerCase();
572
+ return m.filter(
573
+ (i) => {
574
+ var A, F;
575
+ return i.key.toLowerCase().includes(d) || i.name.toLowerCase().includes(d) || ((A = i.description) == null ? void 0 : A.toLowerCase().includes(d)) || ((F = i.tags) == null ? void 0 : F.some((D) => D.toLowerCase().includes(d)));
576
576
  }
577
577
  );
578
- }, [u, p]), d = $(() => {
579
- !t.trim() || !o.trim() || !h || (h(t.trim(), o.trim(), m.trim()), a(""), i(""), L(""), l(!1));
580
- }, [t, o, m, h]), r = (s, A) => s.environments.find((E) => E.name === A);
581
- return /* @__PURE__ */ n("div", { ref: k, className: `nice-feature-flags ${w ?? ""}`, style: C, children: [
582
- /* @__PURE__ */ n("div", { className: "nice-feature-flags__header", children: [
583
- /* @__PURE__ */ e("h3", { children: c }),
584
- /* @__PURE__ */ n("span", { className: "nice-feature-flags__count", children: [
585
- u.length,
578
+ }, [m, _]), o = U(() => {
579
+ !n.trim() || !h.trim() || !p || (p(n.trim(), h.trim(), u.trim()), l(""), a(""), E(""), c(!1));
580
+ }, [n, h, u, p]), s = (d, i) => d.environments.find((A) => A.name === i);
581
+ return /* @__PURE__ */ t("div", { ref: g, className: `nice-feature-flags ${L ?? ""}`, style: x, children: [
582
+ /* @__PURE__ */ t("div", { className: "nice-feature-flags__header", children: [
583
+ /* @__PURE__ */ e("h3", { children: r }),
584
+ /* @__PURE__ */ t("span", { className: "nice-feature-flags__count", children: [
585
+ m.length,
586
586
  " flags"
587
587
  ] }),
588
- h && /* @__PURE__ */ e("button", { onClick: () => l(!y), children: "+ New Flag" })
588
+ p && /* @__PURE__ */ e("button", { onClick: () => c(!w), children: "+ New Flag" })
589
589
  ] }),
590
- y && /* @__PURE__ */ n("div", { className: "nice-feature-flags__create-form", children: [
591
- /* @__PURE__ */ e("input", { type: "text", value: t, onChange: (s) => a(s.target.value), placeholder: "flag_key" }),
592
- /* @__PURE__ */ e("input", { type: "text", value: o, onChange: (s) => i(s.target.value), placeholder: "Display name" }),
593
- /* @__PURE__ */ e("input", { type: "text", value: m, onChange: (s) => L(s.target.value), placeholder: "Description" }),
594
- /* @__PURE__ */ e("button", { onClick: d, disabled: !t.trim() || !o.trim(), children: "Create" }),
595
- /* @__PURE__ */ e("button", { onClick: () => l(!1), children: "Cancel" })
590
+ w && /* @__PURE__ */ t("div", { className: "nice-feature-flags__create-form", children: [
591
+ /* @__PURE__ */ e("input", { type: "text", value: n, onChange: (d) => l(d.target.value), placeholder: "flag_key" }),
592
+ /* @__PURE__ */ e("input", { type: "text", value: h, onChange: (d) => a(d.target.value), placeholder: "Display name" }),
593
+ /* @__PURE__ */ e("input", { type: "text", value: u, onChange: (d) => E(d.target.value), placeholder: "Description" }),
594
+ /* @__PURE__ */ e("button", { onClick: o, disabled: !n.trim() || !h.trim(), children: "Create" }),
595
+ /* @__PURE__ */ e("button", { onClick: () => c(!1), children: "Cancel" })
596
596
  ] }),
597
597
  /* @__PURE__ */ e(
598
598
  "input",
599
599
  {
600
600
  type: "text",
601
- value: p,
602
- onChange: (s) => N(s.target.value),
601
+ value: _,
602
+ onChange: (d) => y(d.target.value),
603
603
  placeholder: "Search flags…",
604
604
  className: "nice-feature-flags__search"
605
605
  }
606
606
  ),
607
- F.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-feature-flags__empty", children: "No feature flags found." }) : /* @__PURE__ */ n("table", { className: "nice-feature-flags__table", children: [
608
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { children: [
607
+ T.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-feature-flags__empty", children: "No feature flags found." }) : /* @__PURE__ */ t("table", { className: "nice-feature-flags__table", children: [
608
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ t("tr", { children: [
609
609
  /* @__PURE__ */ e("th", { children: "Flag" }),
610
- v.map((s) => /* @__PURE__ */ e("th", { children: s }, s)),
610
+ C.map((d) => /* @__PURE__ */ e("th", { children: d }, d)),
611
611
  /* @__PURE__ */ e("th", { children: "Tags" }),
612
612
  /* @__PURE__ */ e("th", { children: "Updated" }),
613
613
  /* @__PURE__ */ e("th", { children: "Actions" })
614
614
  ] }) }),
615
- /* @__PURE__ */ e("tbody", { children: F.map((s) => {
616
- var A;
617
- return /* @__PURE__ */ n("tr", { children: [
618
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ n("div", { className: "nice-feature-flags__flag-info", children: [
619
- /* @__PURE__ */ e("strong", { children: s.name }),
620
- /* @__PURE__ */ e("code", { className: "nice-feature-flags__key", children: s.key }),
621
- s.description && /* @__PURE__ */ e("small", { children: s.description })
615
+ /* @__PURE__ */ e("tbody", { children: T.map((d) => {
616
+ var i;
617
+ return /* @__PURE__ */ t("tr", { children: [
618
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ t("div", { className: "nice-feature-flags__flag-info", children: [
619
+ /* @__PURE__ */ e("strong", { children: d.name }),
620
+ /* @__PURE__ */ e("code", { className: "nice-feature-flags__key", children: d.key }),
621
+ d.description && /* @__PURE__ */ e("small", { children: d.description })
622
622
  ] }) }),
623
- v.map((E) => {
624
- const R = r(s, E);
625
- return /* @__PURE__ */ n("td", { className: "nice-feature-flags__env-cell", children: [
623
+ C.map((A) => {
624
+ const F = s(d, A);
625
+ return /* @__PURE__ */ t("td", { className: "nice-feature-flags__env-cell", children: [
626
626
  /* @__PURE__ */ e(
627
627
  "input",
628
628
  {
629
629
  type: "checkbox",
630
- checked: (R == null ? void 0 : R.enabled) ?? !1,
631
- onChange: () => _ == null ? void 0 : _(s.id, E, !((R == null ? void 0 : R.enabled) ?? !1))
630
+ checked: (F == null ? void 0 : F.enabled) ?? !1,
631
+ onChange: () => N == null ? void 0 : N(d.id, A, !((F == null ? void 0 : F.enabled) ?? !1))
632
632
  }
633
633
  ),
634
- (R == null ? void 0 : R.percentage) != null && /* @__PURE__ */ e(
634
+ (F == null ? void 0 : F.percentage) != null && /* @__PURE__ */ e(
635
635
  "input",
636
636
  {
637
637
  type: "number",
638
638
  min: 0,
639
639
  max: 100,
640
- value: R.percentage,
641
- onChange: (U) => g == null ? void 0 : g(s.id, E, parseInt(U.target.value, 10) || 0),
640
+ value: F.percentage,
641
+ onChange: (D) => b == null ? void 0 : b(d.id, A, parseInt(D.target.value, 10) || 0),
642
642
  className: "nice-feature-flags__percentage",
643
643
  title: "Rollout %"
644
644
  }
645
645
  )
646
- ] }, E);
646
+ ] }, A);
647
647
  }),
648
- /* @__PURE__ */ e("td", { children: ((A = s.tags) == null ? void 0 : A.join(", ")) || "—" }),
649
- /* @__PURE__ */ e("td", { children: s.updatedAt ?? s.createdAt }),
650
- /* @__PURE__ */ n("td", { className: "nice-feature-flags__actions", children: [
651
- f && /* @__PURE__ */ e("button", { onClick: () => f(s), children: "Edit" }),
652
- b && /* @__PURE__ */ e("button", { onClick: () => b(s.id), children: "Delete" })
648
+ /* @__PURE__ */ e("td", { children: ((i = d.tags) == null ? void 0 : i.join(", ")) || "—" }),
649
+ /* @__PURE__ */ e("td", { children: d.updatedAt ?? d.createdAt }),
650
+ /* @__PURE__ */ t("td", { className: "nice-feature-flags__actions", children: [
651
+ S && /* @__PURE__ */ e("button", { onClick: () => S(d), children: "Edit" }),
652
+ f && /* @__PURE__ */ e("button", { onClick: () => f(d.id), children: "Delete" })
653
653
  ] })
654
- ] }, s.id);
654
+ ] }, d.id);
655
655
  }) })
656
656
  ] })
657
657
  ] });
658
- }), H = D(function(S, k) {
659
- var F;
658
+ }), ne = I(function(v, g) {
659
+ var T;
660
660
  const {
661
- entities: u,
662
- formats: v = ["json", "csv", "xlsx"],
663
- jobs: _ = [],
664
- onImport: g,
665
- onExport: h,
666
- onDownload: b,
667
- title: f = "Import / Export",
668
- className: c,
669
- style: w
670
- } = S, [C, p] = x("export"), [N, y] = x(((F = u[0]) == null ? void 0 : F.id) ?? ""), [l, t] = x(v[0] ?? "json"), [a, o] = x(null), i = $(() => {
671
- !g || !a || !N || (g(N, l, a), o(null));
672
- }, [g, N, l, a]), m = $(() => {
673
- !h || !N || h(N, l);
674
- }, [h, N, l]), L = (d) => {
675
- var r;
676
- o(((r = d.target.files) == null ? void 0 : r[0]) ?? null);
661
+ entities: m,
662
+ formats: C = ["json", "csv", "xlsx"],
663
+ jobs: N = [],
664
+ onImport: b,
665
+ onExport: p,
666
+ onDownload: f,
667
+ title: S = "Import / Export",
668
+ className: r,
669
+ style: L
670
+ } = v, [x, _] = k("export"), [y, w] = k(((T = m[0]) == null ? void 0 : T.id) ?? ""), [c, n] = k(C[0] ?? "json"), [l, h] = k(null), a = U(() => {
671
+ !b || !l || !y || (b(y, c, l), h(null));
672
+ }, [b, y, c, l]), u = U(() => {
673
+ !p || !y || p(y, c);
674
+ }, [p, y, c]), E = (o) => {
675
+ var s;
676
+ h(((s = o.target.files) == null ? void 0 : s[0]) ?? null);
677
677
  };
678
- return /* @__PURE__ */ n("div", { ref: k, className: `nice-import-export ${c ?? ""}`, style: w, children: [
679
- /* @__PURE__ */ e("div", { className: "nice-import-export__header", children: /* @__PURE__ */ e("h3", { children: f }) }),
680
- /* @__PURE__ */ n("div", { className: "nice-import-export__tabs", children: [
678
+ return /* @__PURE__ */ t("div", { ref: g, className: `nice-import-export ${r ?? ""}`, style: L, children: [
679
+ /* @__PURE__ */ e("div", { className: "nice-import-export__header", children: /* @__PURE__ */ e("h3", { children: S }) }),
680
+ /* @__PURE__ */ t("div", { className: "nice-import-export__tabs", children: [
681
681
  /* @__PURE__ */ e(
682
682
  "button",
683
683
  {
684
- className: `nice-import-export__tab ${C === "import" ? "nice-import-export__tab--active" : ""}`,
685
- onClick: () => p("import"),
684
+ className: `nice-import-export__tab ${x === "import" ? "nice-import-export__tab--active" : ""}`,
685
+ onClick: () => _("import"),
686
686
  children: "Import"
687
687
  }
688
688
  ),
689
689
  /* @__PURE__ */ e(
690
690
  "button",
691
691
  {
692
- className: `nice-import-export__tab ${C === "export" ? "nice-import-export__tab--active" : ""}`,
693
- onClick: () => p("export"),
692
+ className: `nice-import-export__tab ${x === "export" ? "nice-import-export__tab--active" : ""}`,
693
+ onClick: () => _("export"),
694
694
  children: "Export"
695
695
  }
696
696
  )
697
697
  ] }),
698
- /* @__PURE__ */ n("div", { className: "nice-import-export__form", children: [
699
- /* @__PURE__ */ n("label", { children: [
698
+ /* @__PURE__ */ t("div", { className: "nice-import-export__form", children: [
699
+ /* @__PURE__ */ t("label", { children: [
700
700
  "Entity",
701
- /* @__PURE__ */ e("select", { value: N, onChange: (d) => y(d.target.value), children: u.map((d) => /* @__PURE__ */ e("option", { value: d.id, children: d.label }, d.id)) })
701
+ /* @__PURE__ */ e("select", { value: y, onChange: (o) => w(o.target.value), children: m.map((o) => /* @__PURE__ */ e("option", { value: o.id, children: o.label }, o.id)) })
702
702
  ] }),
703
- /* @__PURE__ */ n("label", { children: [
703
+ /* @__PURE__ */ t("label", { children: [
704
704
  "Format",
705
- /* @__PURE__ */ e("select", { value: l, onChange: (d) => t(d.target.value), children: v.map((d) => /* @__PURE__ */ e("option", { value: d, children: d.toUpperCase() }, d)) })
705
+ /* @__PURE__ */ e("select", { value: c, onChange: (o) => n(o.target.value), children: C.map((o) => /* @__PURE__ */ e("option", { value: o, children: o.toUpperCase() }, o)) })
706
706
  ] }),
707
- C === "import" && /* @__PURE__ */ n(M, { children: [
708
- /* @__PURE__ */ n("label", { children: [
707
+ x === "import" && /* @__PURE__ */ t(G, { children: [
708
+ /* @__PURE__ */ t("label", { children: [
709
709
  "File",
710
- /* @__PURE__ */ e("input", { type: "file", onChange: L, accept: `.${l}` })
710
+ /* @__PURE__ */ e("input", { type: "file", onChange: E, accept: `.${c}` })
711
711
  ] }),
712
712
  /* @__PURE__ */ e(
713
713
  "button",
714
714
  {
715
715
  className: "nice-import-export__action-btn",
716
- onClick: i,
717
- disabled: !a,
716
+ onClick: a,
717
+ disabled: !l,
718
718
  children: "Start Import"
719
719
  }
720
720
  )
721
721
  ] }),
722
- C === "export" && /* @__PURE__ */ e("button", { className: "nice-import-export__action-btn", onClick: m, children: "Start Export" })
722
+ x === "export" && /* @__PURE__ */ e("button", { className: "nice-import-export__action-btn", onClick: u, children: "Start Export" })
723
723
  ] }),
724
- _.length > 0 && /* @__PURE__ */ n("div", { className: "nice-import-export__jobs", children: [
724
+ N.length > 0 && /* @__PURE__ */ t("div", { className: "nice-import-export__jobs", children: [
725
725
  /* @__PURE__ */ e("h4", { children: "Recent Jobs" }),
726
- /* @__PURE__ */ n("table", { className: "nice-import-export__jobs-table", children: [
727
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { children: [
726
+ /* @__PURE__ */ t("table", { className: "nice-import-export__jobs-table", children: [
727
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ t("tr", { children: [
728
728
  /* @__PURE__ */ e("th", { children: "Type" }),
729
729
  /* @__PURE__ */ e("th", { children: "Format" }),
730
730
  /* @__PURE__ */ e("th", { children: "Status" }),
@@ -733,26 +733,247 @@ const P = D(function(S, k) {
733
733
  /* @__PURE__ */ e("th", { children: "Created" }),
734
734
  /* @__PURE__ */ e("th", {})
735
735
  ] }) }),
736
- /* @__PURE__ */ e("tbody", { children: _.map((d) => /* @__PURE__ */ n("tr", { children: [
737
- /* @__PURE__ */ e("td", { children: d.type }),
738
- /* @__PURE__ */ e("td", { children: d.format.toUpperCase() }),
739
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: `nice-import-export__status nice-import-export__status--${d.status}`, children: d.status }) }),
740
- /* @__PURE__ */ e("td", { children: d.processedRows != null && d.totalRows ? `${d.processedRows} / ${d.totalRows}` : "—" }),
741
- /* @__PURE__ */ e("td", { children: d.errorCount ?? 0 }),
742
- /* @__PURE__ */ e("td", { children: d.createdAt }),
743
- /* @__PURE__ */ e("td", { children: d.type === "export" && d.status === "completed" && b && /* @__PURE__ */ e("button", { onClick: () => b(d.id), children: "Download" }) })
744
- ] }, d.id)) })
736
+ /* @__PURE__ */ e("tbody", { children: N.map((o) => /* @__PURE__ */ t("tr", { children: [
737
+ /* @__PURE__ */ e("td", { children: o.type }),
738
+ /* @__PURE__ */ e("td", { children: o.format.toUpperCase() }),
739
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: `nice-import-export__status nice-import-export__status--${o.status}`, children: o.status }) }),
740
+ /* @__PURE__ */ e("td", { children: o.processedRows != null && o.totalRows ? `${o.processedRows} / ${o.totalRows}` : "—" }),
741
+ /* @__PURE__ */ e("td", { children: o.errorCount ?? 0 }),
742
+ /* @__PURE__ */ e("td", { children: o.createdAt }),
743
+ /* @__PURE__ */ e("td", { children: o.type === "export" && o.status === "completed" && f && /* @__PURE__ */ e("button", { onClick: () => f(o.id), children: "Download" }) })
744
+ ] }, o.id)) })
745
745
  ] })
746
746
  ] })
747
747
  ] });
748
- });
748
+ }), q = Y({ flags: {} });
749
+ function ie({ config: R, children: v }) {
750
+ return /* @__PURE__ */ e(q.Provider, { value: R, children: v });
751
+ }
752
+ function B(R) {
753
+ const v = H(q);
754
+ return $(() => {
755
+ const g = v.flags[R];
756
+ return g === void 0 ? { enabled: !1 } : typeof g == "boolean" ? { enabled: g } : { enabled: g > 0, percentage: g };
757
+ }, [v.flags, R]);
758
+ }
759
+ function ae({ flag: R, fallback: v = null, children: g }) {
760
+ const { enabled: m } = B(R);
761
+ return /* @__PURE__ */ e(G, { children: m ? g : v });
762
+ }
763
+ const M = {
764
+ low: "#2196f3",
765
+ medium: "#ff9800",
766
+ high: "#f44336",
767
+ critical: "#9c27b0"
768
+ }, O = {
769
+ field: "Hidden Field",
770
+ endpoint: "Decoy Endpoint",
771
+ file: "Canary File",
772
+ credential: "Fake Credential",
773
+ cookie: "Tracking Cookie"
774
+ }, ce = I(
775
+ function({
776
+ tokens: v,
777
+ events: g,
778
+ onCreate: m,
779
+ onToggle: C,
780
+ onDelete: N,
781
+ onDismissEvent: b,
782
+ title: p = "Honey Tokens",
783
+ className: f,
784
+ style: S
785
+ }, r) {
786
+ const [L, x] = k(""), [_, y] = k(!1), [w, c] = k(""), [n, l] = k("field"), [h, a] = k("medium"), [u, E] = k(""), T = $(
787
+ () => v.filter(
788
+ (i) => i.name.toLowerCase().includes(L.toLowerCase()) || i.location.toLowerCase().includes(L.toLowerCase())
789
+ ),
790
+ [v, L]
791
+ ), o = $(
792
+ () => [...g].sort((i, A) => new Date(A.timestamp).getTime() - new Date(i.timestamp).getTime()),
793
+ [g]
794
+ ), s = $(() => {
795
+ const i = v.filter((D) => D.active).length, A = v.reduce((D, P) => D + P.tripCount, 0), F = g.filter((D) => D.severity === "critical").length;
796
+ return { activeCount: i, totalCount: v.length, totalTrips: A, criticalEvents: F };
797
+ }, [v, g]), d = () => {
798
+ w.trim() && u.trim() && m && (m(w.trim(), n, h, u.trim()), c(""), E(""), y(!1));
799
+ };
800
+ return /* @__PURE__ */ t(
801
+ "div",
802
+ {
803
+ ref: r,
804
+ className: `nice-honey-token-dashboard${f ? ` ${f}` : ""}`,
805
+ style: S,
806
+ children: [
807
+ /* @__PURE__ */ t("div", { className: "nice-honey-token-dashboard__header", children: [
808
+ /* @__PURE__ */ e("h2", { children: p }),
809
+ /* @__PURE__ */ t("div", { className: "nice-honey-token-dashboard__stats", children: [
810
+ /* @__PURE__ */ t("span", { className: "nice-honey-token-dashboard__stat", children: [
811
+ "Active: ",
812
+ s.activeCount,
813
+ "/",
814
+ s.totalCount
815
+ ] }),
816
+ /* @__PURE__ */ t("span", { className: "nice-honey-token-dashboard__stat", children: [
817
+ "Trips: ",
818
+ s.totalTrips
819
+ ] }),
820
+ s.criticalEvents > 0 && /* @__PURE__ */ t("span", { className: "nice-honey-token-dashboard__stat nice-honey-token-dashboard__stat--critical", children: [
821
+ "Critical: ",
822
+ s.criticalEvents
823
+ ] })
824
+ ] })
825
+ ] }),
826
+ /* @__PURE__ */ t("div", { className: "nice-honey-token-dashboard__toolbar", children: [
827
+ /* @__PURE__ */ e(
828
+ "input",
829
+ {
830
+ type: "text",
831
+ className: "nice-honey-token-dashboard__search",
832
+ placeholder: "Search tokens...",
833
+ value: L,
834
+ onChange: (i) => x(i.target.value)
835
+ }
836
+ ),
837
+ m && /* @__PURE__ */ e(
838
+ "button",
839
+ {
840
+ className: "nice-honey-token-dashboard__btn",
841
+ onClick: () => y(!_),
842
+ children: _ ? "Cancel" : "+ New Token"
843
+ }
844
+ )
845
+ ] }),
846
+ _ && /* @__PURE__ */ t("div", { className: "nice-honey-token-dashboard__create", children: [
847
+ /* @__PURE__ */ e(
848
+ "input",
849
+ {
850
+ type: "text",
851
+ placeholder: "Token name",
852
+ value: w,
853
+ onChange: (i) => c(i.target.value)
854
+ }
855
+ ),
856
+ /* @__PURE__ */ e("select", { value: n, onChange: (i) => l(i.target.value), children: Object.entries(O).map(([i, A]) => /* @__PURE__ */ e("option", { value: i, children: A }, i)) }),
857
+ /* @__PURE__ */ t("select", { value: h, onChange: (i) => a(i.target.value), children: [
858
+ /* @__PURE__ */ e("option", { value: "low", children: "Low" }),
859
+ /* @__PURE__ */ e("option", { value: "medium", children: "Medium" }),
860
+ /* @__PURE__ */ e("option", { value: "high", children: "High" }),
861
+ /* @__PURE__ */ e("option", { value: "critical", children: "Critical" })
862
+ ] }),
863
+ /* @__PURE__ */ e(
864
+ "input",
865
+ {
866
+ type: "text",
867
+ placeholder: "Location (e.g. /api/admin/secret)",
868
+ value: u,
869
+ onChange: (i) => E(i.target.value)
870
+ }
871
+ ),
872
+ /* @__PURE__ */ e("button", { onClick: d, children: "Create" })
873
+ ] }),
874
+ /* @__PURE__ */ t("div", { className: "nice-honey-token-dashboard__tokens", children: [
875
+ /* @__PURE__ */ t("h3", { children: [
876
+ "Tokens (",
877
+ T.length,
878
+ ")"
879
+ ] }),
880
+ /* @__PURE__ */ t("table", { className: "nice-honey-token-dashboard__table", children: [
881
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ t("tr", { children: [
882
+ /* @__PURE__ */ e("th", { children: "Name" }),
883
+ /* @__PURE__ */ e("th", { children: "Type" }),
884
+ /* @__PURE__ */ e("th", { children: "Severity" }),
885
+ /* @__PURE__ */ e("th", { children: "Location" }),
886
+ /* @__PURE__ */ e("th", { children: "Trips" }),
887
+ /* @__PURE__ */ e("th", { children: "Last Tripped" }),
888
+ /* @__PURE__ */ e("th", { children: "Status" }),
889
+ /* @__PURE__ */ e("th", { children: "Actions" })
890
+ ] }) }),
891
+ /* @__PURE__ */ e("tbody", { children: T.map((i) => /* @__PURE__ */ t("tr", { className: i.tripCount > 0 ? "nice-honey-token-dashboard__row--tripped" : "", children: [
892
+ /* @__PURE__ */ e("td", { children: i.name }),
893
+ /* @__PURE__ */ e("td", { children: O[i.type] }),
894
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
895
+ "span",
896
+ {
897
+ className: "nice-honey-token-dashboard__severity",
898
+ style: { color: M[i.severity] },
899
+ children: i.severity
900
+ }
901
+ ) }),
902
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("code", { children: i.location }) }),
903
+ /* @__PURE__ */ e("td", { children: i.tripCount }),
904
+ /* @__PURE__ */ e("td", { children: i.lastTripped ?? "—" }),
905
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: `nice-honey-token-dashboard__status--${i.active ? "active" : "inactive"}`, children: i.active ? "Active" : "Inactive" }) }),
906
+ /* @__PURE__ */ t("td", { children: [
907
+ C && /* @__PURE__ */ e("button", { onClick: () => C(i.id, !i.active), children: i.active ? "Disable" : "Enable" }),
908
+ N && /* @__PURE__ */ e("button", { onClick: () => N(i.id), children: "Delete" })
909
+ ] })
910
+ ] }, i.id)) })
911
+ ] })
912
+ ] }),
913
+ o.length > 0 && /* @__PURE__ */ t("div", { className: "nice-honey-token-dashboard__events", children: [
914
+ /* @__PURE__ */ t("h3", { children: [
915
+ "Recent Events (",
916
+ o.length,
917
+ ")"
918
+ ] }),
919
+ /* @__PURE__ */ e("div", { className: "nice-honey-token-dashboard__event-list", children: o.map((i) => /* @__PURE__ */ t(
920
+ "div",
921
+ {
922
+ className: `nice-honey-token-dashboard__event nice-honey-token-dashboard__event--${i.severity}`,
923
+ children: [
924
+ /* @__PURE__ */ t("div", { className: "nice-honey-token-dashboard__event-header", children: [
925
+ /* @__PURE__ */ e("strong", { children: i.tokenName }),
926
+ /* @__PURE__ */ e(
927
+ "span",
928
+ {
929
+ className: "nice-honey-token-dashboard__severity",
930
+ style: { color: M[i.severity] },
931
+ children: i.severity
932
+ }
933
+ ),
934
+ /* @__PURE__ */ e("time", { children: i.timestamp })
935
+ ] }),
936
+ /* @__PURE__ */ t("div", { className: "nice-honey-token-dashboard__event-details", children: [
937
+ /* @__PURE__ */ t("span", { children: [
938
+ "IP: ",
939
+ i.sourceIp
940
+ ] }),
941
+ i.userId && /* @__PURE__ */ t("span", { children: [
942
+ "User: ",
943
+ i.userId
944
+ ] }),
945
+ i.details && /* @__PURE__ */ e("span", { children: i.details })
946
+ ] }),
947
+ b && /* @__PURE__ */ e(
948
+ "button",
949
+ {
950
+ className: "nice-honey-token-dashboard__dismiss",
951
+ onClick: () => b(i.id),
952
+ children: "Dismiss"
953
+ }
954
+ )
955
+ ]
956
+ },
957
+ i.id
958
+ )) })
959
+ ] })
960
+ ]
961
+ }
962
+ );
963
+ }
964
+ );
749
965
  export {
750
- J as NiceAdminAuditLog,
751
- P as NiceAdminDashboard,
752
- z as NiceAdminNotifications,
753
- Y as NiceAdminRoles,
754
- W as NiceAdminSettings,
755
- V as NiceAdminUsers,
756
- B as NiceFeatureFlags,
757
- H as NiceImportExport
966
+ ae as FeatureGate,
967
+ Z as NiceAdminAuditLog,
968
+ z as NiceAdminDashboard,
969
+ ee as NiceAdminNotifications,
970
+ X as NiceAdminRoles,
971
+ j as NiceAdminSettings,
972
+ Q as NiceAdminUsers,
973
+ te as NiceFeatureFlags,
974
+ ae as NiceFeatureGate,
975
+ ie as NiceFeatureGateProvider,
976
+ ce as NiceHoneyTokenDashboard,
977
+ ne as NiceImportExport,
978
+ B as useFeatureGate
758
979
  };