@nice2dev/ui-iot 1.1.7 β†’ 1.1.9

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,1325 +1,403 @@
1
- import { jsxs as a, jsx as e, Fragment as E } from "react/jsx-runtime";
2
- import { useState as h, useCallback as w, useContext as ie, createContext as b, memo as ce, useEffect as ne } from "react";
3
- const F = [
4
- { type: "device-list", label: "Device List", icon: "πŸ“‹" },
5
- { type: "device-status", label: "Device Status", icon: "🟒" },
6
- { type: "telemetry-chart", label: "Telemetry Chart", icon: "πŸ“ˆ" },
7
- { type: "gauge", label: "Gauge", icon: "⏱️" },
8
- { type: "map", label: "Device Map", icon: "πŸ—ΊοΈ" },
9
- { type: "alarms", label: "Alarms", icon: "🚨" },
10
- { type: "control-panel", label: "Control Panel", icon: "πŸŽ›οΈ" },
11
- { type: "topology", label: "Network Topology", icon: "πŸ”—" },
12
- { type: "kpi", label: "KPI Card", icon: "🎯" },
13
- { type: "camera-feed", label: "Camera Feed", icon: "πŸ“Ή" }
14
- ];
15
- function Ee({
16
- devices: r = [],
17
- widgets: i = [],
18
- alarms: c = [],
19
- onDeviceSelect: n,
20
- onWidgetChange: o,
21
- onCommand: d,
22
- onAlarmAcknowledge: t,
23
- fetchTelemetry: l,
24
- className: g = ""
25
- }) {
26
- const [m, C] = h(i), [N, v] = h(null), [u, _] = h("dashboard"), [H, P] = h(!1), [x, R] = h(""), y = w(
27
- (f) => {
28
- C((S) => {
29
- const T = f(S);
30
- return o == null || o(T), T;
31
- });
32
- },
33
- [o]
34
- ), k = w(
35
- (f) => {
36
- var T;
37
- const S = {
38
- id: crypto.randomUUID(),
39
- type: f,
40
- title: ((T = F.find((B) => B.type === f)) == null ? void 0 : T.label) || f,
41
- position: { x: 0, y: oe(m), width: 4, height: 3 },
42
- config: {}
43
- };
44
- y((B) => [...B, S]);
45
- },
46
- [m, y]
47
- ), L = w(
48
- (f) => {
49
- v(f), n == null || n(f);
50
- },
51
- [n]
52
- ), $ = w(
53
- (f) => {
54
- t == null || t(f);
55
- },
56
- [t]
57
- ), M = r.filter(
58
- (f) => !x || f.name.toLowerCase().includes(x.toLowerCase()) || f.type.toLowerCase().includes(x.toLowerCase())
59
- ), I = c.filter((f) => !f.cleared), z = I.filter(
60
- (f) => f.severity === "critical" || f.severity === "high"
61
- );
62
- return /* @__PURE__ */ a("div", { className: `nice-iot-dashboard ${g}`, children: [
63
- /* @__PURE__ */ a("header", { className: "nice-iot-dashboard__header", children: [
64
- /* @__PURE__ */ e("h1", { children: "IoT Dashboard" }),
65
- /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__stats", children: [
66
- /* @__PURE__ */ a("span", { className: "nice-iot-dashboard__stat", children: [
67
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", children: "πŸ“±" }),
68
- r.length,
69
- " Devices"
70
- ] }),
71
- /* @__PURE__ */ a("span", { className: "nice-iot-dashboard__stat nice-iot-dashboard__stat--online", children: [
72
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", children: "🟒" }),
73
- r.filter((f) => f.status === "online").length,
74
- " Online"
75
- ] }),
76
- /* @__PURE__ */ a("span", { className: "nice-iot-dashboard__stat nice-iot-dashboard__stat--offline", children: [
77
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", children: "⚫" }),
78
- r.filter((f) => f.status === "offline").length,
79
- " Offline"
80
- ] }),
81
- z.length > 0 && /* @__PURE__ */ a("span", { className: "nice-iot-dashboard__stat nice-iot-dashboard__stat--alarms", children: [
82
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", children: "🚨" }),
83
- z.length,
84
- " Alarms"
85
- ] })
86
- ] }),
87
- /* @__PURE__ */ a("nav", { className: "nice-iot-dashboard__nav", children: [
88
- /* @__PURE__ */ e(
89
- "button",
90
- {
91
- className: u === "dashboard" ? "active" : "",
92
- onClick: () => _("dashboard"),
93
- children: "Dashboard"
94
- }
95
- ),
96
- /* @__PURE__ */ e("button", { className: u === "devices" ? "active" : "", onClick: () => _("devices"), children: "Devices" }),
97
- /* @__PURE__ */ a("button", { className: u === "alarms" ? "active" : "", onClick: () => _("alarms"), children: [
98
- "Alarms ",
99
- I.length > 0 && `(${I.length})`
100
- ] })
101
- ] }),
102
- /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__actions", children: u === "dashboard" && /* @__PURE__ */ e("button", { onClick: () => P(!H), children: H ? "βœ“ Done" : "✏️ Edit" }) })
103
- ] }),
104
- u === "dashboard" && /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__main", children: [
105
- H && /* @__PURE__ */ a("aside", { className: "nice-iot-dashboard__palette", children: [
106
- /* @__PURE__ */ e("h4", { children: "Add Widget" }),
107
- F.map((f) => /* @__PURE__ */ a(
108
- "button",
109
- {
110
- className: "nice-iot-dashboard__palette-item",
111
- onClick: () => k(f.type),
112
- children: [
113
- /* @__PURE__ */ e("span", { children: f.icon }),
114
- /* @__PURE__ */ e("span", { children: f.label })
115
- ]
116
- },
117
- f.type
118
- ))
119
- ] }),
120
- /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__grid", children: [
121
- m.map((f) => /* @__PURE__ */ e(
122
- de,
123
- {
124
- widget: f,
125
- devices: r,
126
- alarms: c,
127
- isEditing: H,
128
- onCommand: d,
129
- onDelete: () => y((S) => S.filter((T) => T.id !== f.id))
130
- },
131
- f.id
132
- )),
133
- m.length === 0 && /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__empty", children: H ? "Add widgets from the palette" : "No widgets configured. Click Edit to add widgets." })
134
- ] })
135
- ] }),
136
- u === "devices" && /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__devices", children: [
137
- /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__devices-toolbar", children: /* @__PURE__ */ e(
138
- "input",
139
- {
140
- type: "search",
141
- placeholder: "Search devices...",
142
- value: x,
143
- onChange: (f) => R(f.target.value)
144
- }
145
- ) }),
146
- /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__device-grid", children: M.map((f) => /* @__PURE__ */ e(
147
- se,
148
- {
149
- device: f,
150
- isSelected: (N == null ? void 0 : N.id) === f.id,
151
- onSelect: () => L(f)
152
- },
153
- f.id
154
- )) }),
155
- N && /* @__PURE__ */ e(
156
- le,
157
- {
158
- device: N,
159
- onCommand: d,
160
- onClose: () => v(null)
161
- }
162
- )
163
- ] }),
164
- u === "alarms" && /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__alarms", children: /* @__PURE__ */ a("table", { className: "nice-iot-dashboard__alarm-table", children: [
165
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ a("tr", { children: [
166
- /* @__PURE__ */ e("th", { children: "Severity" }),
167
- /* @__PURE__ */ e("th", { children: "Device" }),
168
- /* @__PURE__ */ e("th", { children: "Message" }),
169
- /* @__PURE__ */ e("th", { children: "Time" }),
170
- /* @__PURE__ */ e("th", { children: "Status" }),
171
- /* @__PURE__ */ e("th", { children: "Actions" })
172
- ] }) }),
173
- /* @__PURE__ */ e("tbody", { children: I.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: 6, className: "nice-iot-dashboard__no-alarms", children: "No active alarms" }) }) : I.map((f) => {
174
- const S = r.find((T) => T.id === f.deviceId);
175
- return /* @__PURE__ */ a(
176
- "tr",
177
- {
178
- className: `nice-iot-dashboard__alarm-row nice-iot-dashboard__alarm-row--${f.severity}`,
179
- children: [
180
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
181
- "span",
182
- {
183
- className: `nice-iot-dashboard__severity nice-iot-dashboard__severity--${f.severity}`,
184
- children: f.severity
185
- }
186
- ) }),
187
- /* @__PURE__ */ e("td", { children: (S == null ? void 0 : S.name) || f.deviceId }),
188
- /* @__PURE__ */ e("td", { children: f.message }),
189
- /* @__PURE__ */ e("td", { children: f.timestamp.toLocaleString() }),
190
- /* @__PURE__ */ e("td", { children: f.acknowledged ? "Acknowledged" : "Active" }),
191
- /* @__PURE__ */ e("td", { children: !f.acknowledged && /* @__PURE__ */ e("button", { onClick: () => $(f.id), children: "Acknowledge" }) })
192
- ]
193
- },
194
- f.id
195
- );
196
- }) })
197
- ] }) })
198
- ] });
1
+ import { jsx as e, jsxs as r, Fragment as D } from "react/jsx-runtime";
2
+ import { useContext as B, createContext as b, memo as oe, useState as y, useEffect as te, useCallback as C } from "react";
3
+ const de = (a, i) => i, se = b(de), le = b("en");
4
+ function R() {
5
+ const a = B(se), i = B(le);
6
+ return { t: a, lang: i };
199
7
  }
200
- function oe(r) {
201
- return r.length === 0 ? 0 : Math.max(...r.map((i) => i.position.y + i.position.height));
202
- }
203
- function A(r) {
204
- switch (r) {
205
- case "online":
206
- return "var(--nice-success, #28a745)";
207
- case "offline":
208
- return "var(--nice-text-secondary, #6c757d)";
209
- case "warning":
210
- return "var(--nice-warning, #ffc107)";
211
- case "error":
212
- return "var(--nice-danger, #dc3545)";
213
- case "maintenance":
214
- return "var(--nice-info, #17a2b8)";
215
- default:
216
- return "var(--nice-text-secondary, #6c757d)";
8
+ b({
9
+ dir: "ltr",
10
+ isRTL: !1,
11
+ flip: (a) => a,
12
+ value: (a) => a.ltr
13
+ });
14
+ b(null);
15
+ b(null);
16
+ const fe = {
17
+ radius: "md",
18
+ shadow: "md",
19
+ fill: "solid",
20
+ buttonStyle: "flat",
21
+ inputStyle: "bordered",
22
+ cardStyle: "elevated",
23
+ badgeStyle: "solid",
24
+ tabStyle: "underline",
25
+ toggleStyle: "default",
26
+ tooltipStyle: "dark",
27
+ modalStyle: "default",
28
+ tableStyle: "default",
29
+ menuStyle: "default",
30
+ animation: "normal",
31
+ density: "normal"
32
+ };
33
+ b({
34
+ displayStyle: "default",
35
+ variantConfig: fe,
36
+ setDisplayStyle: () => {
217
37
  }
218
- }
219
- function de({
220
- widget: r,
221
- devices: i,
222
- alarms: c,
223
- isEditing: n,
224
- onCommand: o,
225
- onDelete: d
38
+ });
39
+ const me = {
40
+ // Navigation
41
+ "chevron-down": "M6 9l6 6 6-6",
42
+ "chevron-up": "M18 15l-6-6-6 6",
43
+ "chevron-left": "M15 18l-6-6 6-6",
44
+ "chevron-right": "M9 6l6 6-6 6",
45
+ "arrow-left": "M19 12H5m0 0l7 7m-7-7l7-7",
46
+ "arrow-right": "M5 12h14m0 0l-7-7m7 7l-7 7",
47
+ "arrow-up": "M12 19V5m0 0l-7 7m7-7l7 7",
48
+ "arrow-down": "M12 5v14m0 0l7-7m-7 7l-7-7",
49
+ // Actions
50
+ close: "M18 6L6 18M6 6l12 12",
51
+ plus: "M12 5v14m-7-7h14",
52
+ minus: "M5 12h14",
53
+ check: "M5 13l4 4L19 7",
54
+ edit: "M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7M18.5 2.5a2.121 2.121 0 113 3L12 15l-4 1 1-4 9.5-9.5z",
55
+ trash: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",
56
+ copy: "M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z",
57
+ download: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4",
58
+ upload: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12",
59
+ refresh: "M4 4v5h5M20 20v-5h-5M20.49 9A9 9 0 005.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 013.51 15",
60
+ // UI
61
+ search: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",
62
+ filter: "M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z",
63
+ "sort-asc": "M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12",
64
+ "sort-desc": "M3 4h13M3 8h9m-9 4h9m5-4v12m0 0l-4-4m4 4l4-4",
65
+ // Neutral "sortable" indicator: a small up-chevron over a down-chevron.
66
+ sort: "M6 10l6-6 6 6M6 14l6 6 6-6",
67
+ menu: "M4 6h16M4 12h16M4 18h16",
68
+ "more-vertical": "M12 5v.01M12 12v.01M12 19v.01",
69
+ "more-horizontal": "M5 12h.01M12 12h.01M19 12h.01",
70
+ settings: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z",
71
+ eye: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z M15 12a3 3 0 11-6 0 3 3 0 016 0z",
72
+ "eye-off": "M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24 M1 1l22 22",
73
+ lock: "M19 11H5a2 2 0 00-2 2v7a2 2 0 002 2h14a2 2 0 002-2v-7a2 2 0 00-2-2zm-3-4a4 4 0 10-8 0v4h8V7z",
74
+ // Status
75
+ info: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",
76
+ warning: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",
77
+ error: "M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z",
78
+ success: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",
79
+ help: "M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",
80
+ // Content
81
+ calendar: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",
82
+ clock: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z",
83
+ file: "M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z",
84
+ folder: "M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",
85
+ image: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z",
86
+ link: "M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1",
87
+ mail: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z",
88
+ phone: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z",
89
+ user: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z",
90
+ users: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z",
91
+ home: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6",
92
+ star: "M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z",
93
+ heart: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z",
94
+ bell: "M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",
95
+ grip: "M4 6h2m4 0h2m4 0h2M4 12h2m4 0h2m4 0h2M4 18h2m4 0h2m4 0h2",
96
+ hash: "M4 9h16M4 15h16M10 3L8 21M16 3l-2 18",
97
+ list: "M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",
98
+ circle: "M12 21a9 9 0 100-18 9 9 0 000 18z",
99
+ // UI component / element types (palettes, builders)
100
+ box: "M21 8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16V8z M3.27 6.96L12 12.01l8.73-5.05 M12 22.08V12",
101
+ tabs: "M3 9h18v10H3z M7 9V5h6v4",
102
+ columns: "M4 4h7v16H4z M13 4h7v16h-7z",
103
+ grid: "M3 3h7v7H3z M14 3h7v7h-7z M14 14h7v7h-7z M3 14h7v7H3z",
104
+ table: "M3 5h18v14H3z M3 10h18M3 15h18M9 5v14M15 5v14",
105
+ heading: "M6 4v16M18 4v16M6 12h12",
106
+ type: "M4 7V4h16v3M9 20h6M12 4v16",
107
+ "align-left": "M3 6h18M3 12h12M3 18h15",
108
+ input: "M4 9h16a1 1 0 011 1v4a1 1 0 01-1 1H4a1 1 0 01-1-1v-4a1 1 0 011-1z M7 12h5",
109
+ button: "M5 9h14a2 2 0 012 2v2a2 2 0 01-2 2H5a2 2 0 01-2-2v-2a2 2 0 012-2z",
110
+ select: "M4 6h16a1 1 0 011 1v10a1 1 0 01-1 1H4a1 1 0 01-1-1V7a1 1 0 011-1z M15 11l-3 3-3-3",
111
+ "check-square": "M9 11l3 3L22 4 M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11",
112
+ video: "M23 7l-7 5 7 5V7z M16 5H3a2 2 0 00-2 2v10a2 2 0 002 2h13a2 2 0 002-2V7a2 2 0 00-2-2z",
113
+ card: "M3 5h18a1 1 0 011 1v12a1 1 0 01-1 1H3a1 1 0 01-1-1V6a1 1 0 011-1z M3 10h18",
114
+ // App / infra / media concepts
115
+ "bar-chart": "M6 20v-6M12 20V4M18 20v-10",
116
+ "line-chart": "M3 3v18h18 M7 15l4-4 3 3 5-6",
117
+ "area-chart": "M3 3v18h18 M7 17v-3l4-4 3 3 5-6v10z",
118
+ "pie-chart": "M21.21 15.89A10 10 0 118 2.83 M22 12A10 10 0 0012 2v10z",
119
+ "donut-chart": "M12 3a9 9 0 100 18 9 9 0 000-18z M12 8a4 4 0 100 8 4 4 0 000-8z",
120
+ "scatter-chart": "M3 3v18h18 M8 16h.01 M11 11h.01 M15 14h.01 M18 8h.01",
121
+ "bars-vertical": "M6 5v14M12 5v14M18 5v14",
122
+ globe: "M12 3a9 9 0 100 18 9 9 0 000-18z M3 12h18 M12 3a14 14 0 010 18 M12 3a14 14 0 000 18",
123
+ monitor: "M3 4h18a1 1 0 011 1v11a1 1 0 01-1 1H3a1 1 0 01-1-1V5a1 1 0 011-1z M8 21h8 M12 17v4",
124
+ camera: "M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h3l2-3h6l2 3h3a2 2 0 012 2z M12 17a4 4 0 100-8 4 4 0 000 8z",
125
+ plug: "M9 2v5 M15 2v5 M7 7h10v3a5 5 0 01-10 0V7z M12 15v7",
126
+ save: "M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z M17 21v-8H7v8 M7 3v5h8",
127
+ tag: "M20.59 13.41l-7.17 7.17a2 2 0 01-2.83 0L2 12V2h10l8.59 8.59a2 2 0 010 2.82z M7 7h.01",
128
+ palette: "M12 2a10 10 0 000 20 2 2 0 002-2c0-.5-.2-1-.5-1.3a2 2 0 01-.5-1.2 2 2 0 012-2H17a5 5 0 005-5c0-5-4.5-9-10-9z M6.5 11.5h.01 M9.5 7.5h.01 M14.5 7.5h.01",
129
+ book: "M4 19.5A2.5 2.5 0 016.5 17H20 M6.5 2H20v20H6.5A2.5 2.5 0 014 19.5v-15A2.5 2.5 0 016.5 2z",
130
+ cloud: "M18 10h-1.26A8 8 0 109 20h9a5 5 0 000-10z",
131
+ target: "M12 3a9 9 0 100 18 9 9 0 000-18z M12 7a5 5 0 100 10 5 5 0 000-10z M12 11a1 1 0 100 2 1 1 0 000-2z",
132
+ message: "M21 11.5a8.5 8.5 0 01-8.5 8.5 8.4 8.4 0 01-3.8-.9L3 21l1.9-5.7a8.4 8.4 0 01-.9-3.8A8.5 8.5 0 0112.5 3 8.5 8.5 0 0121 11.5z",
133
+ flask: "M9 2h6 M10 2v6.5L4.5 19a1 1 0 00.9 1.5h13.2a1 1 0 00.9-1.5L14 8.5V2 M7 15h10",
134
+ rocket: "M12 15l-3-3a22 22 0 012-3.95A12.88 12.88 0 0122 2c0 2.72-.78 7.5-6 11a22 22 0 01-3.95 2z M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0 M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5 M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 00-2.91-.09z",
135
+ music: "M9 18V5l12-2v13 M9 18a3 3 0 11-6 0 3 3 0 016 0z M21 16a3 3 0 11-6 0 3 3 0 016 0z",
136
+ wifi: "M5 12.55a11 11 0 0114 0 M8.5 16.11a6 6 0 017 0 M12 20h.01 M2 8.82a15 15 0 0120 0",
137
+ database: "M12 8c4.97 0 9-1.34 9-3s-4.03-3-9-3-9 1.34-9 3 4.03 3 9 3z M21 5v6c0 1.66-4.03 3-9 3s-9-1.34-9-3V5 M21 11v6c0 1.66-4.03 3-9 3s-9-1.34-9-3v-6",
138
+ slash: "M12 3a9 9 0 100 18 9 9 0 000-18z M5.6 5.6l12.8 12.8",
139
+ puzzle: "M19.4 13.6a1.6 1.6 0 10.2-3.2H19V7a2 2 0 00-2-2h-3.4v-.4a1.6 1.6 0 10-3.2 0V5H7a2 2 0 00-2 2v3.4h.4a1.6 1.6 0 100 3.2H5V17a2 2 0 002 2h3.4v.4a1.6 1.6 0 103.2 0V19H17a2 2 0 002-2v-3.4z",
140
+ dollar: "M12 1v22 M17 5H9.5a3.5 3.5 0 000 7h5a3.5 3.5 0 010 7H6",
141
+ printer: "M6 9V2h12v7 M6 18H4a2 2 0 01-2-2v-5a2 2 0 012-2h16a2 2 0 012 2v5a2 2 0 01-2 2h-2 M6 14h12v8H6z",
142
+ scale: "M12 3v18 M5 21h14 M5 7l7-2 7 2 M2 13a3 3 0 006 0L5 7zm14 0a3 3 0 006 0L19 7z",
143
+ accessibility: "M12 3a9 9 0 100 18 9 9 0 000-18z M12 9a1.5 1.5 0 100-3 1.5 1.5 0 000 3z M7.5 10.5l4.5 1 4.5-1 M12 11.5v3.5l-2 3.5 M12 15l2 3.5",
144
+ window: "M3 4h18a1 1 0 011 1v14a1 1 0 01-1 1H3a1 1 0 01-1-1V5a1 1 0 011-1z M2 9h20 M6 6.5h.01 M9 6.5h.01",
145
+ "map-pin": "M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z M12 13a3 3 0 100-6 3 3 0 000 6z",
146
+ cursor: "M5 3l14 7-6 2-2 6-6-15z",
147
+ shuffle: "M16 3h5v5 M4 20L21 3 M21 16v5h-5 M15 15l6 6 M4 4l5 5",
148
+ lightbulb: "M9 18h6 M10 22h4 M12 2a7 7 0 00-4 12.7c.6.5 1 1.3 1 2.1V18h6v-1.2c0-.8.4-1.6 1-2.1A7 7 0 0012 2z",
149
+ server: "M3 4h18a1 1 0 011 1v4a1 1 0 01-1 1H3a1 1 0 01-1-1V5a1 1 0 011-1z M3 14h18a1 1 0 011 1v4a1 1 0 01-1 1H3a1 1 0 01-1-1v-4a1 1 0 011-1z M7 7h.01 M7 17h.01",
150
+ terminal: "M4 17l6-6-6-6 M12 19h8",
151
+ "git-branch": "M6 3v12 M18 9a3 3 0 100-6 3 3 0 000 6z M6 21a3 3 0 100-6 3 3 0 000 6z M18 9a9 9 0 01-9 9",
152
+ send: "M22 2L11 13 M22 2l-7 20-4-9-9-4 20-7z",
153
+ // Media
154
+ play: "M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z M21 12a9 9 0 11-18 0 9 9 0 0118 0z",
155
+ pause: "M10 9v6m4-6v6m7-3a9 9 0 11-18 0 9 9 0 0118 0z",
156
+ stop: "M21 12a9 9 0 11-18 0 9 9 0 0118 0z M9 10a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z",
157
+ mic: "M12 1a3 3 0 00-3 3v8a3 3 0 006 0V4a3 3 0 00-3-3zM19 10v2a7 7 0 01-14 0v-2M12 19v4M8 23h8",
158
+ volume: "M11 5L6 9H2v6h4l5 4V5z M15.54 8.46a5 5 0 010 7.07 M19.07 4.93a10 10 0 010 14.14",
159
+ "volume-off": "M11 5L6 9H2v6h4l5 4V5z M23 9l-6 6 M17 9l6 6",
160
+ "skip-back": "M19 20L9 12l10-8v16z M5 19V5",
161
+ // Toggle
162
+ expand: "M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4",
163
+ collapse: "M9 9V5m0 4H5m4 0L4 4m11 5h4m-4 0V5m0 4l5-5M9 15v4m0-4H5m4 0l-5 5m15-5h-4m4 0v4m0-4l-5 5",
164
+ "external-link": "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",
165
+ // Extended set (entities, gamification, status)
166
+ briefcase: "M20 7H4a2 2 0 00-2 2v9a2 2 0 002 2h16a2 2 0 002-2V9a2 2 0 00-2-2zM16 7V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v2M2 12h20",
167
+ building: "M4 22V4a2 2 0 012-2h12a2 2 0 012 2v18M4 22h16M9 22v-4h6v4M9 6h.01M15 6h.01M9 10h.01M15 10h.01M9 14h.01M15 14h.01",
168
+ medal: "M15.477 12.89L17 22l-5-3-5 3 1.523-9.11M12 15a6 6 0 100-12 6 6 0 000 12z",
169
+ clipboard: "M9 2h6a1 1 0 011 1v1a1 1 0 01-1 1H9a1 1 0 01-1-1V3a1 1 0 011-1zM16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2",
170
+ "skip-forward": "M5 4l10 8-10 8V4zM19 5v14",
171
+ "at-sign": "M12 16a4 4 0 100-8 4 4 0 000 8zM16 12v1.5a2.5 2.5 0 005 0V12a9 9 0 10-3.5 7.14",
172
+ gift: "M20 12v10H4V12M2 7h20v5H2zM12 22V7M12 7H7.5a2.5 2.5 0 010-5C11 2 12 7 12 7zM12 7h4.5a2.5 2.5 0 000-5C13 2 12 7 12 7z",
173
+ archive: "M21 8v13H3V8M1 3h22v5H1zM10 12h4",
174
+ reply: "M9 17l-5-5 5-5M4 12h11a4 4 0 014 4v2",
175
+ forward: "M15 17l5-5-5-5M20 12H9a4 4 0 00-4 4v2",
176
+ paperclip: "M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48",
177
+ zap: "M13 2L3 14h9l-1 8 10-12h-9l1-8z",
178
+ // Graphics / drawing tools (vector / pixel / photo / game editors)
179
+ square: "M4 4h16v16H4z",
180
+ triangle: "M12 4L3 20h18z",
181
+ hexagon: "M7.5 3h9l4.5 9-4.5 9h-9L3 12z",
182
+ diamond: "M12 2l10 10-10 10L2 12z",
183
+ line: "M5 19L19 5",
184
+ pen: "M12 19l7-7 3 3-7 7-3-3z M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z M11 11a2 2 0 100-4 2 2 0 000 4z",
185
+ brush: "M9.06 11.9l8.07-8.06a2.85 2.85 0 114.03 4.03l-8.06 8.08 M7.07 14.94c-1.66 0-3 1.35-3 3.02 0 1.33-2.5 1.52-2 2.02 1.08 1.1 2.49 2.02 4 2.02 2.2 0 4-1.8 4-4.04a3.01 3.01 0 00-3-3.02z",
186
+ droplet: "M12 2.69l5.66 5.66a8 8 0 11-11.31 0z",
187
+ bucket: "M5 8h14l-1.5 11a2 2 0 01-2 1.8H8.5a2 2 0 01-2-1.8L5 8z M5 8l2-4h10l2 4",
188
+ scissors: "M6 9a3 3 0 100-6 3 3 0 000 6z M6 21a3 3 0 100-6 3 3 0 000 6z M20 4L8.12 15.88 M14.47 14.48L20 20 M8.12 8.12L12 12",
189
+ layers: "M12 2l9 5-9 5-9-5 9-5z M3 12l9 5 9-5 M3 17l9 5 9-5",
190
+ crop: "M6 2v14a2 2 0 002 2h14 M2 6h14a2 2 0 012 2v14",
191
+ eyedropper: "M2 22l1-1h3l9-9 M3 21v-3l9-9 M15 6l3.5-3.5a2.12 2.12 0 013 3L18 9l-3-3z",
192
+ ruler: "M21.3 8.7l-6-6a1 1 0 00-1.4 0L2.7 13.9a1 1 0 000 1.4l6 6a1 1 0 001.4 0L21.3 10.1a1 1 0 000-1.4z M7.5 10.5l2 2 M11 7l2 2 M14.5 3.5l2 2",
193
+ wand: "M15 4V2 M15 16v-2 M8 9h2 M20 9h2 M3 21l9-9 M12.2 6.2L11 5 M17.8 6.2L19 5 M17.8 11.8L19 13",
194
+ move: "M5 9l-3 3 3 3 M9 5l3-3 3 3 M15 19l-3 3-3-3 M19 9l3 3-3 3 M2 12h20 M12 2v20",
195
+ gamepad: "M6 12h4 M8 10v4 M15 13h.01 M18 11h.01 M2 12a4 4 0 014-4h12a4 4 0 014 4l-1.5 6a2 2 0 01-2 1.5H5.5a2 2 0 01-2-1.5L2 12z",
196
+ eraser: "M7 21l-4.3-4.3a1 1 0 010-1.4l9.6-9.6a2 2 0 012.8 0l4.6 4.6a2 2 0 010 2.8L13 21H7z M22 21H7 M5 12l5 5",
197
+ // Buildings / interior / fixtures (spatial / floor-plan / smart-home / real-estate editors)
198
+ thermometer: "M14 14.76V3.5a2.5 2.5 0 00-5 0v11.26a4.5 4.5 0 105 0z",
199
+ door: "M18 20V5a1 1 0 00-1-1H7a1 1 0 00-1 1v15 M3 20h18 M13 11.5h.01",
200
+ stairs: "M3 20h3v-3h3v-3h3v-3h3v-3h3",
201
+ elevator: "M5 3h14a1 1 0 011 1v16a1 1 0 01-1 1H5a1 1 0 01-1-1V4a1 1 0 011-1z M9.5 9L12 6.5 14.5 9 M9.5 15l2.5 2.5 2.5-2.5",
202
+ bed: "M2 4v16 M2 8h18a2 2 0 012 2v10 M22 17H2 M6 8v4 M2 12h4",
203
+ sofa: "M3 9V7a2 2 0 012-2h14a2 2 0 012 2v2 M21 9a2 2 0 00-2 2v3H5v-3a2 2 0 00-2-2 2 2 0 00-2 2v4a1 1 0 001 1h18a1 1 0 001-1v-4a2 2 0 00-2-2 M5 18v2 M19 18v2",
204
+ chair: "M6 11V5a2 2 0 012-2h8a2 2 0 012 2v6 M5 11h14 M6 11l-1 8h14l-1-8 M6 19v2 M18 19v2",
205
+ utensils: "M3 2v7a2 2 0 002 2 2 2 0 002-2V2 M5 2v20 M21 2v9c0 1-1 1.8-2 1.8h-1V20 M18 2v9",
206
+ mountain: "M8 3l4 8 5-5 5 15H2L8 3z",
207
+ tree: "M12 2L7 11h10L12 2z M9 11l3 5 3-5 M12 16v6",
208
+ sun: "M12 17a5 5 0 100-10 5 5 0 000 10z M12 1v2 M12 21v2 M4.22 4.22l1.42 1.42 M18.36 18.36l1.42 1.42 M1 12h2 M21 12h2 M4.22 19.78l1.42-1.42 M18.36 5.64l1.42-1.42",
209
+ moon: "M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z",
210
+ // Rich-text editing (NiceHtmlEditor toolbar, document editors)
211
+ "list-ordered": "M10 6h11M10 12h11M10 18h11M4 6h1v4M4 10h2M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",
212
+ unlink: "M18.84 12.25l1.72-1.71a5 5 0 0 0-7.07-7.07L11 5.78M3 3l18 18M9 15l3-3M14 11l3 3M14 21l-1.72-1.72a5 5 0 0 1-7.07-7.07L7 10.49",
213
+ code: "M16 18l6-6-6-6M8 6l-6 6 6 6",
214
+ quote: "M3 21c3-3 3-9 0-12M21 21c-3-3-3-9 0-12M9 7h6v6H9zM15 7h6v6h-6z",
215
+ indent: "M3 8l4 4-4 4M7 6h14M7 12h14M3 18h18",
216
+ outdent: "M7 8l-4 4 4 4M21 6H3M21 12H7M21 18H3",
217
+ "align-center": "M3 6h18M6 12h12M3 18h18",
218
+ "align-right": "M3 6h18M9 12h12M3 18h18",
219
+ "align-justify": "M3 6h18M3 12h18M3 18h18",
220
+ "align-top": "M4 4h16M9 8v12M15 8v7",
221
+ "align-middle": "M4 12h16M9 5v14M15 8v8",
222
+ "align-bottom": "M4 20h16M9 4v12M15 9v7",
223
+ "distribute-h": "M4 4v16M20 4v16M10 7h4v10h-4z",
224
+ "distribute-v": "M4 4h16M4 20h16M7 10h10v4H7z",
225
+ parallelogram: "M7 5h14l-4 14H3z",
226
+ barcode: "M4 5v14M6.5 5v14M10 5v14M13 5v14M15.5 5v14M19 5v14M20.5 5v14",
227
+ "qr-code": "M4 4h6v6H4z M14 4h6v6h-6z M4 14h6v6H4z M14 14h2v2h-2z M18 14h2v2h-2z M14 18h2v2h-2z M18 18h2v2h-2z",
228
+ smile: "M12 22a10 10 0 1 1 0-20 10 10 0 0 1 0 20zM8 14s1.5 2 4 2 4-2 4-2M9 9h.01M15 9h.01",
229
+ undo: "M9 14L4 9l5-5M4 9h10.5a5.5 5.5 0 010 11H11",
230
+ redo: "M15 14l5-5-5-5M20 9H9.5a5.5 5.5 0 000 11H13",
231
+ unlock: "M19 11H5a2 2 0 00-2 2v7a2 2 0 002 2h14a2 2 0 002-2v-7a2 2 0 00-2-2z M7 11V7a5 5 0 019.9-1",
232
+ keyboard: "M4 6h16a2 2 0 012 2v8a2 2 0 01-2 2H4a2 2 0 01-2-2V8a2 2 0 012-2z M6 10h.01 M10 10h.01 M14 10h.01 M18 10h.01 M8 14h8",
233
+ "page-break": "M6 3v5h12V3 M6 21v-5h12v5 M2 12h3 M8 12h3 M13 12h3 M19 12h3",
234
+ shield: "M12 2l8 3v6c0 5-3.4 9.4-8 11-4.6-1.6-8-6-8-11V5z",
235
+ repeat: "M17 2l4 4-4 4 M3 11V9a4 4 0 014-4h14 M7 22l-4-4 4-4 M21 13v2a4 4 0 01-4 4H3"
236
+ }, he = {
237
+ xs: 12,
238
+ sm: 16,
239
+ md: 20,
240
+ lg: 24,
241
+ xl: 32
242
+ }, pe = b({});
243
+ function ye({
244
+ path: a,
245
+ size: i,
246
+ className: c,
247
+ style: n,
248
+ color: o,
249
+ title: t,
250
+ onClick: d
226
251
  }) {
227
- const t = F.find((l) => l.type === r.type);
228
- return /* @__PURE__ */ a(
229
- "div",
252
+ return /* @__PURE__ */ r(
253
+ "svg",
230
254
  {
231
- className: `nice-iot-dashboard__widget nice-iot-dashboard__widget--${r.type}`,
232
- style: {
233
- gridColumn: `span ${r.position.width}`,
234
- gridRow: `span ${r.position.height}`
235
- },
255
+ xmlns: "http://www.w3.org/2000/svg",
256
+ width: i,
257
+ height: i,
258
+ viewBox: "0 0 24 24",
259
+ fill: "none",
260
+ stroke: o || "currentColor",
261
+ strokeWidth: 2,
262
+ strokeLinecap: "round",
263
+ strokeLinejoin: "round",
264
+ className: `nice-icon ${c || ""}`,
265
+ style: n,
266
+ role: t ? "img" : "presentation",
267
+ "aria-label": t,
268
+ "aria-hidden": !t,
269
+ onClick: d,
236
270
  children: [
237
- /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__widget-header", children: [
238
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__widget-icon", children: t == null ? void 0 : t.icon }),
239
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__widget-title", children: r.title }),
240
- n && /* @__PURE__ */ e("button", { className: "nice-iot-dashboard__widget-delete", onClick: d, children: "Γ—" })
241
- ] }),
242
- /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__widget-content", children: /* @__PURE__ */ e(te, { widget: r, devices: i, alarms: c, onCommand: o }) })
271
+ t && /* @__PURE__ */ e("title", { children: t }),
272
+ /* @__PURE__ */ e("path", { d: a })
243
273
  ]
244
274
  }
245
275
  );
246
276
  }
247
- function te({
248
- widget: r,
249
- devices: i,
250
- alarms: c,
251
- onCommand: n
252
- }) {
253
- switch (r.type) {
254
- case "device-list":
255
- return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__device-list", children: i.slice(0, 10).map((o) => /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__device-list-item", children: [
256
- /* @__PURE__ */ e(
257
- "span",
258
- {
259
- className: "nice-iot-dashboard__device-status",
260
- style: { background: A(o.status) }
261
- }
262
- ),
263
- /* @__PURE__ */ e("span", { children: o.name }),
264
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__device-type", children: o.type })
265
- ] }, o.id)) });
266
- case "device-status":
267
- return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__status-grid", children: ["online", "offline", "warning", "error"].map((o) => {
268
- const d = i.filter((t) => t.status === o).length;
269
- return /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__status-card", children: [
270
- /* @__PURE__ */ e(
271
- "span",
272
- {
273
- className: "nice-iot-dashboard__status-indicator",
274
- style: { background: A(o) }
275
- }
276
- ),
277
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__status-count", children: d }),
278
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__status-label", children: o })
279
- ] }, o);
280
- }) });
281
- case "telemetry-chart":
282
- return /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__chart-placeholder", children: [
283
- /* @__PURE__ */ e("span", { children: "πŸ“ˆ" }),
284
- /* @__PURE__ */ e("span", { children: "Telemetry Chart" }),
285
- /* @__PURE__ */ e("small", { children: "Configure device and capability" })
286
- ] });
287
- case "gauge":
288
- return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__gauge", children: /* @__PURE__ */ a("svg", { viewBox: "0 0 100 60", children: [
289
- /* @__PURE__ */ e(
290
- "path",
291
- {
292
- d: "M 10 55 A 40 40 0 0 1 90 55",
293
- fill: "none",
294
- stroke: "var(--nice-border, #e0e0e0)",
295
- strokeWidth: "8"
296
- }
297
- ),
298
- /* @__PURE__ */ e(
299
- "path",
300
- {
301
- d: "M 10 55 A 40 40 0 0 1 90 55",
302
- fill: "none",
303
- stroke: "var(--nice-primary, #0066cc)",
304
- strokeWidth: "8",
305
- strokeDasharray: "63 126"
306
- }
307
- ),
308
- /* @__PURE__ */ e("text", { x: "50", y: "50", textAnchor: "middle", fontSize: "14", fontWeight: "bold", children: "50%" })
309
- ] }) });
310
- case "map":
311
- return /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__map-placeholder", children: [
312
- /* @__PURE__ */ e("span", { children: "πŸ—ΊοΈ" }),
313
- /* @__PURE__ */ e("span", { children: "Device Map" }),
314
- /* @__PURE__ */ a("small", { children: [
315
- i.filter((o) => o.location).length,
316
- " devices with location"
317
- ] })
318
- ] });
319
- case "alarms": {
320
- const o = c.filter((d) => !d.cleared).slice(0, 5);
321
- return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__alarm-list", children: o.length === 0 ? /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__alarm-empty", children: "No active alarms" }) : o.map((d) => /* @__PURE__ */ a(
322
- "div",
323
- {
324
- className: `nice-iot-dashboard__alarm-item nice-iot-dashboard__alarm-item--${d.severity}`,
325
- children: [
326
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__alarm-severity", children: d.severity }),
327
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__alarm-message", children: d.message })
328
- ]
329
- },
330
- d.id
331
- )) });
332
- }
333
- case "control-panel":
334
- return /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__control-placeholder", children: [
335
- /* @__PURE__ */ e("span", { children: "πŸŽ›οΈ" }),
336
- /* @__PURE__ */ e("span", { children: "Control Panel" }),
337
- /* @__PURE__ */ e("small", { children: "Configure device controls" })
338
- ] });
339
- case "kpi":
340
- return /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__kpi", children: [
341
- /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__kpi-value", children: i.length }),
342
- /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__kpi-label", children: "Total Devices" })
343
- ] });
344
- default:
345
- return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__widget-placeholder", children: r.type });
277
+ const u = ({
278
+ name: a,
279
+ size: i = "md",
280
+ className: c,
281
+ style: n,
282
+ color: o,
283
+ title: t,
284
+ onClick: d
285
+ }) => {
286
+ const { resolver: l } = B(pe), g = typeof i == "number" ? i : he[i];
287
+ if (l) {
288
+ const _ = l(a, g);
289
+ if (_)
290
+ return /* @__PURE__ */ e("span", { className: `nice-icon-wrap ${c || ""}`, style: n, onClick: d, children: _ });
346
291
  }
347
- }
348
- function se({ device: r, isSelected: i, onSelect: c }) {
349
- return /* @__PURE__ */ a(
350
- "div",
292
+ const m = me[a];
293
+ return m ? /* @__PURE__ */ e(
294
+ ye,
351
295
  {
352
- className: `nice-iot-dashboard__device-card ${i ? "nice-iot-dashboard__device-card--selected" : ""}`,
353
- onClick: c,
354
- children: [
355
- /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__device-card-header", children: [
356
- /* @__PURE__ */ e(
357
- "span",
358
- {
359
- className: "nice-iot-dashboard__device-status",
360
- style: { background: A(r.status) }
361
- }
362
- ),
363
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__device-name", children: r.name })
364
- ] }),
365
- /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__device-card-body", children: [
366
- /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__device-info", children: [
367
- /* @__PURE__ */ a("span", { children: [
368
- "Type: ",
369
- r.type
370
- ] }),
371
- /* @__PURE__ */ a("span", { children: [
372
- "Protocol: ",
373
- r.protocol
374
- ] })
375
- ] }),
376
- r.lastSeen && /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__device-lastseen", children: [
377
- "Last seen: ",
378
- r.lastSeen.toLocaleString()
379
- ] }),
380
- /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__device-capabilities", children: [
381
- r.capabilities.slice(0, 3).map((n) => /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__capability-badge", children: n.name }, n.id)),
382
- r.capabilities.length > 3 && /* @__PURE__ */ a("span", { className: "nice-iot-dashboard__capability-more", children: [
383
- "+",
384
- r.capabilities.length - 3
385
- ] })
386
- ] })
387
- ] })
388
- ]
296
+ path: m,
297
+ size: g,
298
+ className: c,
299
+ style: n,
300
+ color: o,
301
+ title: t,
302
+ onClick: d
389
303
  }
390
- );
391
- }
392
- function le({
393
- device: r,
394
- onCommand: i,
395
- onClose: c
396
- }) {
397
- return /* @__PURE__ */ a("aside", { className: "nice-iot-dashboard__device-detail", children: [
398
- /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__device-detail-header", children: [
399
- /* @__PURE__ */ e("h3", { children: r.name }),
400
- /* @__PURE__ */ e("button", { onClick: c, children: "Γ—" })
401
- ] }),
402
- /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__device-detail-content", children: [
403
- /* @__PURE__ */ a("section", { children: [
404
- /* @__PURE__ */ e("h4", { children: "Status" }),
405
- /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__detail-row", children: [
406
- /* @__PURE__ */ e("span", { children: "Status:" }),
407
- /* @__PURE__ */ e(
408
- "span",
409
- {
410
- className: "nice-iot-dashboard__status-badge",
411
- style: { background: A(r.status) },
412
- children: r.status
413
- }
414
- )
415
- ] }),
416
- r.lastSeen && /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__detail-row", children: [
417
- /* @__PURE__ */ e("span", { children: "Last Seen:" }),
418
- /* @__PURE__ */ e("span", { children: r.lastSeen.toLocaleString() })
419
- ] })
420
- ] }),
421
- /* @__PURE__ */ a("section", { children: [
422
- /* @__PURE__ */ e("h4", { children: "Connection" }),
423
- /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__detail-row", children: [
424
- /* @__PURE__ */ e("span", { children: "Protocol:" }),
425
- /* @__PURE__ */ e("span", { children: r.protocol })
426
- ] }),
427
- r.connectionInfo.host && /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__detail-row", children: [
428
- /* @__PURE__ */ e("span", { children: "Host:" }),
429
- /* @__PURE__ */ a("span", { children: [
430
- r.connectionInfo.host,
431
- ":",
432
- r.connectionInfo.port
433
- ] })
434
- ] })
435
- ] }),
436
- r.metadata && /* @__PURE__ */ a("section", { children: [
437
- /* @__PURE__ */ e("h4", { children: "Metadata" }),
438
- r.metadata.manufacturer && /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__detail-row", children: [
439
- /* @__PURE__ */ e("span", { children: "Manufacturer:" }),
440
- /* @__PURE__ */ e("span", { children: r.metadata.manufacturer })
441
- ] }),
442
- r.metadata.model && /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__detail-row", children: [
443
- /* @__PURE__ */ e("span", { children: "Model:" }),
444
- /* @__PURE__ */ e("span", { children: r.metadata.model })
445
- ] })
446
- ] }),
447
- /* @__PURE__ */ a("section", { children: [
448
- /* @__PURE__ */ e("h4", { children: "Capabilities" }),
449
- /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__capabilities-list", children: r.capabilities.map((n) => /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__capability-item", children: [
450
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__capability-name", children: n.name }),
451
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__capability-type", children: n.type }),
452
- n.writable && i && /* @__PURE__ */ e(
453
- "button",
454
- {
455
- className: "nice-iot-dashboard__capability-control",
456
- onClick: () => i(r.id, n.id, !0),
457
- children: "Control"
458
- }
459
- )
460
- ] }, n.id)) })
461
- ] })
462
- ] })
463
- ] });
464
- }
465
- const fe = [
466
- { name: "MQTT Broker", image: "eclipse-mosquitto:latest" },
467
- { name: "Node-RED", image: "nodered/node-red:latest" },
468
- { name: "InfluxDB", image: "influxdb:latest" },
469
- { name: "Grafana", image: "grafana/grafana:latest" },
470
- { name: "Telegraf", image: "telegraf:latest" },
471
- { name: "Protocol Adapter", image: "nice2dev/protocol-adapter:latest" }
472
- ];
473
- function Ue({
474
- nodes: r = [],
475
- modules: i = [],
476
- onNodeSelect: c,
477
- onModuleDeploy: n,
478
- onModuleAction: o,
479
- onNodeSync: d,
480
- className: t = ""
481
- }) {
482
- const [l, g] = h(null), [m, C] = h("nodes"), [N, v] = h(!1), [u, _] = h({
483
- name: "",
484
- image: "",
485
- status: "pending"
486
- }), H = w(
487
- (y) => {
488
- g(y), c == null || c(y);
304
+ ) : null;
305
+ };
306
+ b({
307
+ direction: "ltr",
308
+ isRTL: !1,
309
+ flip: (a) => a,
310
+ flipStyle: (a, i) => ({ [a]: i })
311
+ });
312
+ b({
313
+ permissions: {},
314
+ getAccessMode: () => "full"
315
+ });
316
+ b(null);
317
+ b(null);
318
+ const Y = {
319
+ space1: "4px",
320
+ space2: "8px",
321
+ space3: "12px",
322
+ space4: "16px",
323
+ space5: "20px",
324
+ space6: "24px",
325
+ space8: "32px"
326
+ }, Z = {
327
+ fontFamily: "'Inter', system-ui, -apple-system, sans-serif",
328
+ fontSizeXs: "0.75rem",
329
+ fontSizeSm: "0.8125rem",
330
+ fontSizeMd: "0.875rem",
331
+ fontSizeLg: "1rem",
332
+ fontSizeXl: "1.125rem",
333
+ fontWeightNormal: 400,
334
+ fontWeightMedium: 500,
335
+ fontWeightSemibold: 600,
336
+ fontWeightBold: 700,
337
+ lineHeight: 1.5
338
+ }, ee = { fast: "120ms ease", normal: "200ms ease", slow: "300ms ease" }, ae = (a) => ({
339
+ color: a,
340
+ radiusSm: "4px",
341
+ radiusMd: "6px",
342
+ radiusLg: "8px",
343
+ radiusXl: "12px",
344
+ radiusFull: "9999px"
345
+ }), ue = {
346
+ sm: "0 1px 2px rgba(0,0,0,0.05)",
347
+ md: "0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",
348
+ lg: "0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",
349
+ xl: "0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"
350
+ }, ve = {
351
+ sm: "0 1px 2px rgba(0,0,0,0.3)",
352
+ md: "0 4px 6px -1px rgba(0,0,0,0.4)",
353
+ lg: "0 10px 15px -3px rgba(0,0,0,0.4)",
354
+ xl: "0 20px 25px -5px rgba(0,0,0,0.4)"
355
+ };
356
+ function s(a, i, c, n, o) {
357
+ return {
358
+ name: a,
359
+ darkMode: "light",
360
+ colors: {
361
+ ...i,
362
+ surface: i.surface ?? c.primary,
363
+ surfaceHover: i.surfaceHover ?? c.secondary
489
364
  },
490
- [c]
491
- ), P = w(async () => {
492
- !l || !u.name || !u.image || (await (n == null ? void 0 : n(l.id, u)), v(!1), _({ name: "", image: "", status: "pending" }));
493
- }, [l, u, n]), x = w(
494
- async (y, k) => {
495
- l && await (o == null ? void 0 : o(l.id, y, k));
365
+ backgrounds: {
366
+ ...c,
367
+ elevated: c.elevated ?? c.primary,
368
+ inset: c.inset ?? c.tertiary,
369
+ canvas: c.canvas ?? c.primary
496
370
  },
497
- [l, o]
498
- ), R = w(async () => {
499
- l && await (d == null ? void 0 : d(l.id));
500
- }, [l, d]);
501
- return /* @__PURE__ */ a("div", { className: `nice-edge-manager ${t}`, children: [
502
- /* @__PURE__ */ a("header", { className: "nice-edge-manager__header", children: [
503
- /* @__PURE__ */ e("h1", { children: "Edge Manager" }),
504
- /* @__PURE__ */ a("nav", { className: "nice-edge-manager__nav", children: [
505
- /* @__PURE__ */ a("button", { className: m === "nodes" ? "active" : "", onClick: () => C("nodes"), children: [
506
- "Nodes (",
507
- r.length,
508
- ")"
509
- ] }),
510
- /* @__PURE__ */ e("button", { className: m === "modules" ? "active" : "", onClick: () => C("modules"), children: "Modules" })
511
- ] })
512
- ] }),
513
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__main", children: [
514
- m === "nodes" && /* @__PURE__ */ e("div", { className: "nice-edge-manager__nodes", children: /* @__PURE__ */ a("div", { className: "nice-edge-manager__node-grid", children: [
515
- r.map((y) => /* @__PURE__ */ e(
516
- pe,
517
- {
518
- node: y,
519
- isSelected: (l == null ? void 0 : l.id) === y.id,
520
- onSelect: () => H(y)
521
- },
522
- y.id
523
- )),
524
- r.length === 0 && /* @__PURE__ */ e("div", { className: "nice-edge-manager__empty", children: "No edge nodes configured" })
525
- ] }) }),
526
- m === "modules" && l && /* @__PURE__ */ a("div", { className: "nice-edge-manager__modules", children: [
527
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__modules-header", children: [
528
- /* @__PURE__ */ a("h3", { children: [
529
- "Modules on ",
530
- l.name
531
- ] }),
532
- /* @__PURE__ */ e(
533
- "button",
534
- {
535
- className: "nice-edge-manager__deploy-btn",
536
- onClick: () => v(!0),
537
- children: "+ Deploy Module"
538
- }
539
- )
540
- ] }),
541
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__module-grid", children: [
542
- l.deployedModules.map((y) => /* @__PURE__ */ e(
543
- ye,
544
- {
545
- module: y,
546
- onAction: (k) => x(y.id, k)
547
- },
548
- y.id
549
- )),
550
- l.deployedModules.length === 0 && /* @__PURE__ */ e("div", { className: "nice-edge-manager__empty", children: "No modules deployed on this node" })
551
- ] })
552
- ] }),
553
- m === "modules" && !l && /* @__PURE__ */ e("div", { className: "nice-edge-manager__no-selection", children: "Select a node from the Nodes tab to manage modules" }),
554
- l && /* @__PURE__ */ e(
555
- he,
556
- {
557
- node: l,
558
- onSync: R,
559
- onClose: () => g(null)
560
- }
561
- )
562
- ] }),
563
- N && /* @__PURE__ */ e(
564
- ue,
565
- {
566
- config: u,
567
- templates: fe,
568
- onChange: _,
569
- onDeploy: P,
570
- onClose: () => v(!1)
571
- }
572
- )
573
- ] });
574
- }
575
- function J(r) {
576
- switch (r) {
577
- case "running":
578
- return "var(--nice-success, #28a745)";
579
- case "stopped":
580
- return "var(--nice-text-secondary, #6c757d)";
581
- case "updating":
582
- return "var(--nice-warning, #ffc107)";
583
- case "error":
584
- return "var(--nice-danger, #dc3545)";
585
- case "unreachable":
586
- return "var(--nice-text-secondary, #868e96)";
587
- default:
588
- return "var(--nice-text-secondary, #6c757d)";
589
- }
590
- }
591
- function W(r) {
592
- return r < 1024 ? `${r} B` : r < 1024 * 1024 ? `${(r / 1024).toFixed(1)} KB` : r < 1024 * 1024 * 1024 ? `${(r / 1024 / 1024).toFixed(1)} MB` : `${(r / 1024 / 1024 / 1024).toFixed(2)} GB`;
593
- }
594
- function me(r) {
595
- const i = Math.floor(r / 86400), c = Math.floor(r % 86400 / 3600), n = Math.floor(r % 3600 / 60);
596
- return i > 0 ? `${i}d ${c}h` : c > 0 ? `${c}h ${n}m` : `${n}m`;
371
+ text: { ...n, inverse: n.inverse ?? "#ffffff" },
372
+ borders: ae(o),
373
+ shadows: ue,
374
+ spacing: Y,
375
+ typography: Z,
376
+ transitions: ee
377
+ };
597
378
  }
598
- function pe({ node: r, isSelected: i, onSelect: c }) {
599
- return /* @__PURE__ */ a(
600
- "div",
601
- {
602
- className: `nice-edge-manager__node-card ${i ? "nice-edge-manager__node-card--selected" : ""}`,
603
- onClick: c,
604
- children: [
605
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__node-header", children: [
606
- /* @__PURE__ */ e(
607
- "span",
608
- {
609
- className: "nice-edge-manager__node-status",
610
- style: { background: J(r.status) }
611
- }
612
- ),
613
- /* @__PURE__ */ e("span", { className: "nice-edge-manager__node-name", children: r.name }),
614
- /* @__PURE__ */ e("span", { className: "nice-edge-manager__node-type", children: r.type })
615
- ] }),
616
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__node-body", children: [
617
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__node-info", children: [
618
- /* @__PURE__ */ a("span", { children: [
619
- "πŸ–₯️ ",
620
- r.hardware.cpu
621
- ] }),
622
- /* @__PURE__ */ a("span", { children: [
623
- "πŸ’Ύ ",
624
- (r.hardware.memoryMB / 1024).toFixed(1),
625
- " GB"
626
- ] })
627
- ] }),
628
- /* @__PURE__ */ e("div", { className: "nice-edge-manager__node-metrics", children: r.metrics && /* @__PURE__ */ a(E, { children: [
629
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__metric", children: [
630
- /* @__PURE__ */ e("span", { className: "nice-edge-manager__metric-label", children: "CPU" }),
631
- /* @__PURE__ */ e("div", { className: "nice-edge-manager__metric-bar", children: /* @__PURE__ */ e(
632
- "div",
633
- {
634
- className: "nice-edge-manager__metric-fill",
635
- style: { width: `${r.metrics.cpuUsage}%` }
636
- }
637
- ) }),
638
- /* @__PURE__ */ a("span", { className: "nice-edge-manager__metric-value", children: [
639
- r.metrics.cpuUsage.toFixed(0),
640
- "%"
641
- ] })
642
- ] }),
643
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__metric", children: [
644
- /* @__PURE__ */ e("span", { className: "nice-edge-manager__metric-label", children: "MEM" }),
645
- /* @__PURE__ */ e("div", { className: "nice-edge-manager__metric-bar", children: /* @__PURE__ */ e(
646
- "div",
647
- {
648
- className: "nice-edge-manager__metric-fill",
649
- style: { width: `${r.metrics.memoryUsage}%` }
650
- }
651
- ) }),
652
- /* @__PURE__ */ a("span", { className: "nice-edge-manager__metric-value", children: [
653
- r.metrics.memoryUsage.toFixed(0),
654
- "%"
655
- ] })
656
- ] })
657
- ] }) }),
658
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__node-modules", children: [
659
- r.deployedModules.length,
660
- " modules deployed"
661
- ] })
662
- ] })
663
- ]
664
- }
665
- );
666
- }
667
- function ye({ module: r, onAction: i }) {
668
- return /* @__PURE__ */ a("div", { className: "nice-edge-manager__module-card", children: [
669
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__module-header", children: [
670
- /* @__PURE__ */ e(
671
- "span",
672
- {
673
- className: "nice-edge-manager__module-status",
674
- style: {
675
- background: {
676
- running: "var(--nice-success, #28a745)",
677
- stopped: "var(--nice-text-secondary, #6c757d)",
678
- error: "var(--nice-danger, #dc3545)",
679
- pending: "var(--nice-warning, #ffc107)"
680
- }[r.status] || "var(--nice-text-secondary, #6c757d)"
681
- }
682
- }
683
- ),
684
- /* @__PURE__ */ e("span", { className: "nice-edge-manager__module-name", children: r.name }),
685
- /* @__PURE__ */ a("span", { className: "nice-edge-manager__module-version", children: [
686
- "v",
687
- r.version
688
- ] })
689
- ] }),
690
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__module-body", children: [
691
- /* @__PURE__ */ e("div", { className: "nice-edge-manager__module-image", children: r.image }),
692
- r.resources && /* @__PURE__ */ a("div", { className: "nice-edge-manager__module-resources", children: [
693
- r.resources.cpuLimit && /* @__PURE__ */ a("span", { children: [
694
- "CPU: ",
695
- r.resources.cpuLimit
696
- ] }),
697
- r.resources.memoryLimitMB && /* @__PURE__ */ a("span", { children: [
698
- "RAM: ",
699
- r.resources.memoryLimitMB,
700
- " MB"
701
- ] })
702
- ] }),
703
- r.ports && r.ports.length > 0 && /* @__PURE__ */ a("div", { className: "nice-edge-manager__module-ports", children: [
704
- "Ports: ",
705
- r.ports.map((n) => `${n.host}:${n.container}`).join(", ")
706
- ] })
707
- ] }),
708
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__module-actions", children: [
709
- r.status === "running" && /* @__PURE__ */ a(E, { children: [
710
- /* @__PURE__ */ e("button", { onClick: () => i("stop"), children: "Stop" }),
711
- /* @__PURE__ */ e("button", { onClick: () => i("restart"), children: "Restart" })
712
- ] }),
713
- r.status === "stopped" && /* @__PURE__ */ e("button", { onClick: () => i("start"), children: "Start" }),
714
- /* @__PURE__ */ e("button", { className: "nice-edge-manager__module-remove", onClick: () => i("remove"), children: "Remove" })
715
- ] })
716
- ] });
717
- }
718
- function he({ node: r, onSync: i, onClose: c }) {
719
- return /* @__PURE__ */ a("aside", { className: "nice-edge-manager__detail", children: [
720
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-header", children: [
721
- /* @__PURE__ */ e("h3", { children: r.name }),
722
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-actions", children: [
723
- /* @__PURE__ */ e("button", { onClick: i, children: "πŸ”„ Sync" }),
724
- /* @__PURE__ */ e("button", { onClick: c, children: "Γ—" })
725
- ] })
726
- ] }),
727
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-content", children: [
728
- /* @__PURE__ */ a("section", { children: [
729
- /* @__PURE__ */ e("h4", { children: "Status" }),
730
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-row", children: [
731
- /* @__PURE__ */ e("span", { children: "Status:" }),
732
- /* @__PURE__ */ e(
733
- "span",
734
- {
735
- className: "nice-edge-manager__status-badge",
736
- style: { background: J(r.status) },
737
- children: r.status
738
- }
739
- )
740
- ] }),
741
- r.metrics && /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-row", children: [
742
- /* @__PURE__ */ e("span", { children: "Uptime:" }),
743
- /* @__PURE__ */ e("span", { children: me(r.metrics.uptime) })
744
- ] })
745
- ] }),
746
- /* @__PURE__ */ a("section", { children: [
747
- /* @__PURE__ */ e("h4", { children: "Hardware" }),
748
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-row", children: [
749
- /* @__PURE__ */ e("span", { children: "CPU:" }),
750
- /* @__PURE__ */ a("span", { children: [
751
- r.hardware.cpu,
752
- " (",
753
- r.hardware.cores,
754
- " cores)"
755
- ] })
756
- ] }),
757
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-row", children: [
758
- /* @__PURE__ */ e("span", { children: "Memory:" }),
759
- /* @__PURE__ */ a("span", { children: [
760
- (r.hardware.memoryMB / 1024).toFixed(1),
761
- " GB"
762
- ] })
763
- ] }),
764
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-row", children: [
765
- /* @__PURE__ */ e("span", { children: "Storage:" }),
766
- /* @__PURE__ */ a("span", { children: [
767
- (r.hardware.storageMB / 1024).toFixed(1),
768
- " GB"
769
- ] })
770
- ] }),
771
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-row", children: [
772
- /* @__PURE__ */ e("span", { children: "Architecture:" }),
773
- /* @__PURE__ */ e("span", { children: r.hardware.architecture })
774
- ] })
775
- ] }),
776
- /* @__PURE__ */ a("section", { children: [
777
- /* @__PURE__ */ e("h4", { children: "Software" }),
778
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-row", children: [
779
- /* @__PURE__ */ e("span", { children: "OS:" }),
780
- /* @__PURE__ */ a("span", { children: [
781
- r.software.os,
782
- " ",
783
- r.software.osVersion
784
- ] })
785
- ] }),
786
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-row", children: [
787
- /* @__PURE__ */ e("span", { children: "Runtime:" }),
788
- /* @__PURE__ */ a("span", { children: [
789
- r.software.runtime,
790
- " ",
791
- r.software.runtimeVersion
792
- ] })
793
- ] }),
794
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-row", children: [
795
- /* @__PURE__ */ e("span", { children: "Agent:" }),
796
- /* @__PURE__ */ a("span", { children: [
797
- r.software.agent,
798
- " v",
799
- r.software.agentVersion
800
- ] })
801
- ] })
802
- ] }),
803
- /* @__PURE__ */ a("section", { children: [
804
- /* @__PURE__ */ e("h4", { children: "Connectivity" }),
805
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-row", children: [
806
- /* @__PURE__ */ e("span", { children: "Cloud:" }),
807
- /* @__PURE__ */ e("span", { children: r.connectivity.cloudConnected ? "βœ“ Connected" : "βœ— Disconnected" })
808
- ] }),
809
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-row", children: [
810
- /* @__PURE__ */ e("span", { children: "Network:" }),
811
- /* @__PURE__ */ e("span", { children: r.connectivity.localNetwork })
812
- ] }),
813
- r.connectivity.publicIP && /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-row", children: [
814
- /* @__PURE__ */ e("span", { children: "Public IP:" }),
815
- /* @__PURE__ */ e("span", { children: r.connectivity.publicIP })
816
- ] }),
817
- r.connectivity.lastSync && /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-row", children: [
818
- /* @__PURE__ */ e("span", { children: "Last Sync:" }),
819
- /* @__PURE__ */ e("span", { children: r.connectivity.lastSync.toLocaleString() })
820
- ] })
821
- ] }),
822
- r.metrics && /* @__PURE__ */ a("section", { children: [
823
- /* @__PURE__ */ e("h4", { children: "Resource Usage" }),
824
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__resource-chart", children: [
825
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__resource-item", children: [
826
- /* @__PURE__ */ e("span", { children: "CPU" }),
827
- /* @__PURE__ */ e("div", { className: "nice-edge-manager__resource-bar", children: /* @__PURE__ */ e(
828
- "div",
829
- {
830
- className: "nice-edge-manager__resource-fill",
831
- style: { width: `${r.metrics.cpuUsage}%` }
832
- }
833
- ) }),
834
- /* @__PURE__ */ a("span", { children: [
835
- r.metrics.cpuUsage.toFixed(1),
836
- "%"
837
- ] })
838
- ] }),
839
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__resource-item", children: [
840
- /* @__PURE__ */ e("span", { children: "Memory" }),
841
- /* @__PURE__ */ e("div", { className: "nice-edge-manager__resource-bar", children: /* @__PURE__ */ e(
842
- "div",
843
- {
844
- className: "nice-edge-manager__resource-fill",
845
- style: { width: `${r.metrics.memoryUsage}%` }
846
- }
847
- ) }),
848
- /* @__PURE__ */ a("span", { children: [
849
- r.metrics.memoryUsage.toFixed(1),
850
- "%"
851
- ] })
852
- ] }),
853
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__resource-item", children: [
854
- /* @__PURE__ */ e("span", { children: "Disk" }),
855
- /* @__PURE__ */ e("div", { className: "nice-edge-manager__resource-bar", children: /* @__PURE__ */ e(
856
- "div",
857
- {
858
- className: "nice-edge-manager__resource-fill",
859
- style: { width: `${r.metrics.diskUsage}%` }
860
- }
861
- ) }),
862
- /* @__PURE__ */ a("span", { children: [
863
- r.metrics.diskUsage.toFixed(1),
864
- "%"
865
- ] })
866
- ] })
867
- ] }),
868
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__network-stats", children: [
869
- /* @__PURE__ */ a("span", { children: [
870
- "↓ ",
871
- W(r.metrics.networkIn)
872
- ] }),
873
- /* @__PURE__ */ a("span", { children: [
874
- "↑ ",
875
- W(r.metrics.networkOut)
876
- ] })
877
- ] })
878
- ] })
879
- ] })
880
- ] });
881
- }
882
- function ue({
883
- config: r,
884
- templates: i,
885
- onChange: c,
886
- onDeploy: n,
887
- onClose: o
888
- }) {
889
- return /* @__PURE__ */ e("div", { className: "nice-edge-manager__dialog-overlay", children: /* @__PURE__ */ a("div", { className: "nice-edge-manager__dialog", children: [
890
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__dialog-header", children: [
891
- /* @__PURE__ */ e("h3", { children: "Deploy Module" }),
892
- /* @__PURE__ */ e("button", { onClick: o, children: "Γ—" })
893
- ] }),
894
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__dialog-content", children: [
895
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__field", children: [
896
- /* @__PURE__ */ e("label", { children: "Template (optional)" }),
897
- /* @__PURE__ */ a(
898
- "select",
899
- {
900
- value: "",
901
- onChange: (d) => {
902
- const t = i.find((l) => l.image === d.target.value);
903
- t && c({
904
- ...r,
905
- name: t.name,
906
- image: t.image
907
- });
908
- },
909
- children: [
910
- /* @__PURE__ */ e("option", { value: "", children: "Select a template..." }),
911
- i.map((d) => /* @__PURE__ */ e("option", { value: d.image, children: d.name }, d.image))
912
- ]
913
- }
914
- )
915
- ] }),
916
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__field", children: [
917
- /* @__PURE__ */ e("label", { children: "Module Name" }),
918
- /* @__PURE__ */ e(
919
- "input",
920
- {
921
- type: "text",
922
- value: r.name || "",
923
- onChange: (d) => c({ ...r, name: d.target.value }),
924
- placeholder: "e.g., my-module"
925
- }
926
- )
927
- ] }),
928
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__field", children: [
929
- /* @__PURE__ */ e("label", { children: "Container Image" }),
930
- /* @__PURE__ */ e(
931
- "input",
932
- {
933
- type: "text",
934
- value: r.image || "",
935
- onChange: (d) => c({ ...r, image: d.target.value }),
936
- placeholder: "e.g., nginx:latest"
937
- }
938
- )
939
- ] }),
940
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__field", children: [
941
- /* @__PURE__ */ e("label", { children: "Version" }),
942
- /* @__PURE__ */ e(
943
- "input",
944
- {
945
- type: "text",
946
- value: r.version || "1.0.0",
947
- onChange: (d) => c({ ...r, version: d.target.value })
948
- }
949
- )
950
- ] })
951
- ] }),
952
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__dialog-footer", children: [
953
- /* @__PURE__ */ e("button", { onClick: o, children: "Cancel" }),
954
- /* @__PURE__ */ e("button", { className: "nice-edge-manager__deploy-confirm", onClick: n, children: "Deploy" })
955
- ] })
956
- ] }) });
957
- }
958
- const be = (r, i) => i, ve = b(be);
959
- function U() {
960
- return { t: ie(ve) };
961
- }
962
- b({
963
- dir: "ltr",
964
- isRTL: !1,
965
- flip: (r) => r,
966
- value: (r) => r.ltr
967
- });
968
- b(null);
969
- b(null);
970
- const ge = {
971
- radius: "md",
972
- shadow: "md",
973
- fill: "solid",
974
- buttonStyle: "flat",
975
- inputStyle: "bordered",
976
- cardStyle: "elevated",
977
- badgeStyle: "solid",
978
- tabStyle: "underline",
979
- toggleStyle: "default",
980
- tooltipStyle: "dark",
981
- modalStyle: "default",
982
- tableStyle: "default",
983
- menuStyle: "default",
984
- animation: "normal",
985
- density: "normal"
986
- };
987
- b({
988
- displayStyle: "default",
989
- variantConfig: ge,
990
- setDisplayStyle: () => {
991
- }
992
- });
993
- b({});
994
- b({
995
- direction: "ltr",
996
- isRTL: !1,
997
- flip: (r) => r,
998
- flipStyle: (r, i) => ({ [r]: i })
999
- });
1000
- b({
1001
- permissions: {},
1002
- getAccessMode: () => "full"
1003
- });
1004
- b(null);
1005
- const _e = process.env.NODE_ENV === "development";
1006
- let K = {
1007
- enabled: _e,
1008
- slowRenderThreshold: 16
1009
- };
1010
- const X = [], O = /* @__PURE__ */ new Map(), Y = /* @__PURE__ */ new Map();
1011
- function Ne() {
1012
- X.length = 0, O.clear(), Y.clear();
1013
- }
1014
- function we(r) {
1015
- const i = K.slowRenderThreshold;
1016
- return X.filter((c) => c.actualDuration > i);
1017
- }
1018
- function D(r) {
1019
- return r < 1 ? `${(r * 1e3).toFixed(0)}ΞΌs` : r < 1e3 ? `${r.toFixed(2)}ms` : `${(r / 1e3).toFixed(2)}s`;
1020
- }
1021
- function Ce() {
1022
- const r = Array.from(O.values()), i = we(), c = r.reduce((d, t) => d + t.renderCount, 0), n = r.length > 0 ? r.reduce((d, t) => d + t.avgRenderTime, 0) / r.length : 0, o = Array.from(Y.values());
1023
- return { stats: r, slowRenders: i, totalRenders: c, avgRenderTime: n, marks: o };
1024
- }
1025
- function xe() {
1026
- const r = Ce();
1027
- console.group(
1028
- "%c[Nice2Dev Performance Report]",
1029
- "color: var(--nice-info, #6366f1); font-weight: bold; font-size: 14px"
1030
- ), console.log(`Total renders: ${r.totalRenders}`), console.log(`Average render time: ${D(r.avgRenderTime)}`), console.log(`Slow renders: ${r.slowRenders.length}`), console.group("Component Stats"), console.table(
1031
- r.stats.sort((i, c) => c.totalRenderTime - i.totalRenderTime).map((i) => ({
1032
- Name: i.componentName,
1033
- Renders: i.renderCount,
1034
- "Avg Time": D(i.avgRenderTime),
1035
- "Max Time": D(i.maxRenderTime),
1036
- "Total Time": D(i.totalRenderTime),
1037
- "Slow Renders": i.slowRenderCount
1038
- }))
1039
- ), console.groupEnd(), r.slowRenders.length > 0 && (console.group("Slow Renders (last 10)"), console.table(
1040
- r.slowRenders.slice(-10).map((i) => ({
1041
- Component: i.componentName,
1042
- Phase: i.phase,
1043
- Duration: D(i.actualDuration),
1044
- Time: new Date(i.timestamp).toLocaleTimeString()
1045
- }))
1046
- ), console.groupEnd()), r.marks.length > 0 && (console.group("Custom Marks"), console.table(
1047
- r.marks.filter((i) => i.duration).map((i) => ({
1048
- Name: i.name,
1049
- Duration: D(i.duration)
1050
- }))
1051
- ), console.groupEnd()), console.groupEnd();
1052
- }
1053
- const ke = ce(
1054
- ({ position: r = "bottom-right", defaultCollapsed: i = !0 }) => {
1055
- const [c, n] = h(i), [o, d] = h([]), [t, l] = h({ used: 0, total: 0 });
1056
- if (ne(() => {
1057
- const m = () => {
1058
- const N = Array.from(O.values());
1059
- d(N.sort((u, _) => _.totalRenderTime - u.totalRenderTime).slice(0, 10));
1060
- const v = window.performance;
1061
- v.memory && l({
1062
- used: v.memory.usedJSHeapSize / 1024 / 1024,
1063
- total: v.memory.totalJSHeapSize / 1024 / 1024
1064
- });
1065
- };
1066
- m();
1067
- const C = setInterval(m, 2e3);
1068
- return () => clearInterval(C);
1069
- }, []), !K.enabled)
1070
- return null;
1071
- const g = {
1072
- position: "fixed",
1073
- zIndex: 99999,
1074
- ...r.includes("top") ? { top: 8 } : { bottom: 8 },
1075
- ...r.includes("left") ? { left: 8 } : { right: 8 }
1076
- };
1077
- return /* @__PURE__ */ a(
1078
- "div",
1079
- {
1080
- style: {
1081
- ...g,
1082
- background: "var(--nice-overlay-85, rgba(0, 0, 0, 0.85))",
1083
- color: "var(--nice-bg-primary, #fff)",
1084
- borderRadius: 8,
1085
- fontSize: 11,
1086
- fontFamily: "Monaco, Consolas, monospace",
1087
- padding: c ? "4px 8px" : 8,
1088
- maxWidth: c ? "auto" : 300,
1089
- maxHeight: c ? "auto" : 400,
1090
- overflow: "auto"
1091
- },
1092
- children: [
1093
- /* @__PURE__ */ a(
1094
- "div",
1095
- {
1096
- style: { cursor: "pointer", display: "flex", alignItems: "center", gap: 8 },
1097
- onClick: () => n((m) => !m),
1098
- children: [
1099
- /* @__PURE__ */ e("span", { style: { color: "var(--nice-color-success, #22c55e)" }, children: "●" }),
1100
- /* @__PURE__ */ e("span", { children: "Profiler" }),
1101
- t.used > 0 && /* @__PURE__ */ a(
1102
- "span",
1103
- {
1104
- style: {
1105
- color: t.used > 100 ? "var(--nice-color-warning, #f59e0b)" : "var(--nice-text-muted, #64748b)"
1106
- },
1107
- children: [
1108
- t.used.toFixed(0),
1109
- "MB"
1110
- ]
1111
- }
1112
- ),
1113
- /* @__PURE__ */ e("span", { style: { marginLeft: "auto", opacity: 0.5 }, children: c ? "β–Ό" : "β–²" })
1114
- ]
1115
- }
1116
- ),
1117
- !c && /* @__PURE__ */ a("div", { style: { marginTop: 8 }, children: [
1118
- /* @__PURE__ */ e(
1119
- "div",
1120
- {
1121
- style: {
1122
- borderBottom: "1px solid var(--nice-border-color, #333)",
1123
- paddingBottom: 4,
1124
- marginBottom: 8
1125
- },
1126
- children: /* @__PURE__ */ e("strong", { children: "Top Components" })
1127
- }
1128
- ),
1129
- o.map((m) => /* @__PURE__ */ a("div", { style: { marginBottom: 4, display: "flex", gap: 8 }, children: [
1130
- /* @__PURE__ */ e("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis" }, children: m.componentName }),
1131
- /* @__PURE__ */ e(
1132
- "span",
1133
- {
1134
- style: {
1135
- color: m.avgRenderTime > 16 ? "var(--nice-color-warning, #f59e0b)" : "var(--nice-color-success, #22c55e)"
1136
- },
1137
- children: D(m.avgRenderTime)
1138
- }
1139
- ),
1140
- /* @__PURE__ */ a(
1141
- "span",
1142
- {
1143
- style: {
1144
- color: "var(--nice-text-muted, #64748b)",
1145
- minWidth: 30,
1146
- textAlign: "right"
1147
- },
1148
- children: [
1149
- "x",
1150
- m.renderCount
1151
- ]
1152
- }
1153
- )
1154
- ] }, m.componentName)),
1155
- /* @__PURE__ */ a("div", { style: { marginTop: 8, display: "flex", gap: 8 }, children: [
1156
- /* @__PURE__ */ e(
1157
- "button",
1158
- {
1159
- onClick: xe,
1160
- style: {
1161
- flex: 1,
1162
- padding: "4px 8px",
1163
- background: "var(--nice-bg-tertiary, #333)",
1164
- border: "none",
1165
- borderRadius: 4,
1166
- color: "var(--nice-bg-primary, #fff)",
1167
- cursor: "pointer",
1168
- fontSize: 10
1169
- },
1170
- children: "Print Report"
1171
- }
1172
- ),
1173
- /* @__PURE__ */ e(
1174
- "button",
1175
- {
1176
- onClick: Ne,
1177
- style: {
1178
- flex: 1,
1179
- padding: "4px 8px",
1180
- background: "var(--nice-bg-tertiary, #333)",
1181
- border: "none",
1182
- borderRadius: 4,
1183
- color: "var(--nice-bg-primary, #fff)",
1184
- cursor: "pointer",
1185
- fontSize: 10
1186
- },
1187
- children: "Clear"
1188
- }
1189
- )
1190
- ] })
1191
- ] })
1192
- ]
1193
- }
1194
- );
1195
- }
1196
- );
1197
- ke.displayName = "ProfilerOverlay";
1198
- process.env.NODE_ENV;
1199
- b(null);
1200
- b({
1201
- enabled: !0,
1202
- active: !1,
1203
- run: () => {
1204
- }
1205
- });
1206
- const q = "nice-tutorial-button-styles";
1207
- if (typeof document < "u" && !document.getElementById(q)) {
1208
- const r = document.createElement("style");
1209
- r.id = q, r.textContent = `
1210
- .nice-tutorial-button {
1211
- display: inline-flex;
1212
- align-items: center;
1213
- justify-content: center;
1214
- border: 1px solid var(--nice-border, #cbd5e1);
1215
- background: var(--nice-bg, #fff);
1216
- color: var(--nice-text-secondary, #475569);
1217
- border-radius: var(--nice-radius-full, 9999px);
1218
- cursor: help;
1219
- font-weight: 700;
1220
- line-height: 1;
1221
- padding: 0;
1222
- transition: background var(--nice-transition, 200ms ease), color var(--nice-transition, 200ms ease), border-color var(--nice-transition, 200ms ease);
1223
- }
1224
- .nice-tutorial-button:hover {
1225
- background: var(--nice-primary, #2563eb);
1226
- border-color: var(--nice-primary, #2563eb);
1227
- color: var(--nice-text-inverse, #fff);
1228
- }
1229
- .nice-tutorial-button:focus-visible {
1230
- outline: none;
1231
- box-shadow: 0 0 0 2px var(--nice-bg, #fff), 0 0 0 4px var(--nice-primary, #2563eb);
1232
- }
1233
- .nice-tutorial-button--sm { width: 16px; height: 16px; font-size: 11px; }
1234
- .nice-tutorial-button--md { width: 20px; height: 20px; font-size: 12px; }
1235
- `, document.head.appendChild(r);
1236
- }
1237
- b(null);
1238
- b(null);
1239
- b(null);
1240
- const Z = {
1241
- space1: "4px",
1242
- space2: "8px",
1243
- space3: "12px",
1244
- space4: "16px",
1245
- space5: "20px",
1246
- space6: "24px",
1247
- space8: "32px"
1248
- }, ee = {
1249
- fontFamily: "'Inter', system-ui, -apple-system, sans-serif",
1250
- fontSizeXs: "0.75rem",
1251
- fontSizeSm: "0.8125rem",
1252
- fontSizeMd: "0.875rem",
1253
- fontSizeLg: "1rem",
1254
- fontSizeXl: "1.125rem",
1255
- fontWeightNormal: 400,
1256
- fontWeightMedium: 500,
1257
- fontWeightSemibold: 600,
1258
- fontWeightBold: 700,
1259
- lineHeight: 1.5
1260
- }, re = { fast: "120ms ease", normal: "200ms ease", slow: "300ms ease" }, ae = (r) => ({
1261
- color: r,
1262
- radiusSm: "4px",
1263
- radiusMd: "6px",
1264
- radiusLg: "8px",
1265
- radiusXl: "12px",
1266
- radiusFull: "9999px"
1267
- }), He = {
1268
- sm: "0 1px 2px rgba(0,0,0,0.05)",
1269
- md: "0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",
1270
- lg: "0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",
1271
- xl: "0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"
1272
- }, Se = {
1273
- sm: "0 1px 2px rgba(0,0,0,0.3)",
1274
- md: "0 4px 6px -1px rgba(0,0,0,0.4)",
1275
- lg: "0 10px 15px -3px rgba(0,0,0,0.4)",
1276
- xl: "0 20px 25px -5px rgba(0,0,0,0.4)"
1277
- };
1278
- function s(r, i, c, n, o) {
1279
- return {
1280
- name: r,
1281
- darkMode: "light",
1282
- colors: {
1283
- ...i,
1284
- surface: i.surface ?? c.primary,
1285
- surfaceHover: i.surfaceHover ?? c.secondary
1286
- },
1287
- backgrounds: {
1288
- ...c,
1289
- elevated: c.elevated ?? c.primary,
1290
- inset: c.inset ?? c.tertiary,
1291
- canvas: c.canvas ?? c.primary
1292
- },
1293
- text: { ...n, inverse: n.inverse ?? "#ffffff" },
1294
- borders: ae(o),
1295
- shadows: He,
1296
- spacing: Z,
1297
- typography: ee,
1298
- transitions: re
1299
- };
1300
- }
1301
- function p(r, i, c, n, o) {
1302
- return {
1303
- name: r,
1304
- darkMode: "dark",
1305
- colors: {
1306
- ...i,
1307
- surface: i.surface ?? c.secondary,
1308
- surfaceHover: i.surfaceHover ?? c.tertiary
1309
- },
1310
- backgrounds: {
1311
- ...c,
1312
- elevated: c.elevated ?? c.secondary,
1313
- inset: c.inset ?? c.primary,
1314
- canvas: c.canvas ?? c.primary
1315
- },
1316
- text: { ...n, inverse: n.inverse ?? "#0f172a" },
1317
- borders: ae(o),
1318
- shadows: Se,
1319
- spacing: Z,
1320
- typography: ee,
1321
- transitions: re
1322
- };
379
+ function h(a, i, c, n, o) {
380
+ return {
381
+ name: a,
382
+ darkMode: "dark",
383
+ colors: {
384
+ ...i,
385
+ surface: i.surface ?? c.secondary,
386
+ surfaceHover: i.surfaceHover ?? c.tertiary
387
+ },
388
+ backgrounds: {
389
+ ...c,
390
+ elevated: c.elevated ?? c.secondary,
391
+ inset: c.inset ?? c.primary,
392
+ canvas: c.canvas ?? c.primary
393
+ },
394
+ text: { ...n, inverse: n.inverse ?? "#0f172a" },
395
+ borders: ae(o),
396
+ shadows: ve,
397
+ spacing: Y,
398
+ typography: Z,
399
+ transitions: ee
400
+ };
1323
401
  }
1324
402
  s(
1325
403
  "Slate",
@@ -1629,7 +707,7 @@ s(
1629
707
  { primary: "#431407", secondary: "#9a3412", muted: "#fb923c" },
1630
708
  "#fdba74"
1631
709
  );
1632
- p(
710
+ h(
1633
711
  "Midnight",
1634
712
  {
1635
713
  primary: "#818cf8",
@@ -1643,7 +721,7 @@ p(
1643
721
  { primary: "#f1f5f9", secondary: "#94a3b8", muted: "#475569" },
1644
722
  "#1e293b"
1645
723
  );
1646
- p(
724
+ h(
1647
725
  "Obsidian",
1648
726
  {
1649
727
  primary: "#a78bfa",
@@ -1657,7 +735,7 @@ p(
1657
735
  { primary: "#fafafa", secondary: "#a1a1aa", muted: "#52525b" },
1658
736
  "#3f3f46"
1659
737
  );
1660
- p(
738
+ h(
1661
739
  "Eclipse",
1662
740
  {
1663
741
  primary: "#c084fc",
@@ -1671,7 +749,7 @@ p(
1671
749
  { primary: "#f5f3ff", secondary: "#a78bfa", muted: "#6d5eac" },
1672
750
  "#3b3266"
1673
751
  );
1674
- p(
752
+ h(
1675
753
  "Onyx",
1676
754
  {
1677
755
  primary: "#60a5fa",
@@ -1685,7 +763,7 @@ p(
1685
763
  { primary: "#ffffff", secondary: "#a3a3a3", muted: "#525252" },
1686
764
  "#262626"
1687
765
  );
1688
- p(
766
+ h(
1689
767
  "Carbon",
1690
768
  {
1691
769
  primary: "#38bdf8",
@@ -1699,7 +777,7 @@ p(
1699
777
  { primary: "#f4f4f4", secondary: "#c6c6c6", muted: "#6f6f6f" },
1700
778
  "#525252"
1701
779
  );
1702
- p(
780
+ h(
1703
781
  "Cosmos",
1704
782
  {
1705
783
  primary: "#6366f1",
@@ -1713,7 +791,7 @@ p(
1713
791
  { primary: "#e5e7eb", secondary: "#9ca3af", muted: "#4b5563" },
1714
792
  "#374151"
1715
793
  );
1716
- p(
794
+ h(
1717
795
  "Nebula",
1718
796
  {
1719
797
  primary: "#e879f9",
@@ -1727,7 +805,7 @@ p(
1727
805
  { primary: "#fae8ff", secondary: "#d8b4fe", muted: "#7c3aed" },
1728
806
  "#581c87"
1729
807
  );
1730
- p(
808
+ h(
1731
809
  "Abyss",
1732
810
  {
1733
811
  primary: "#22d3ee",
@@ -1741,7 +819,7 @@ p(
1741
819
  { primary: "#e0f2fe", secondary: "#7dd3fc", muted: "#0369a1" },
1742
820
  "#075985"
1743
821
  );
1744
- p(
822
+ h(
1745
823
  "Shadow",
1746
824
  {
1747
825
  primary: "#a3a3a3",
@@ -1755,7 +833,7 @@ p(
1755
833
  { primary: "#e5e5e5", secondary: "#a3a3a3", muted: "#525252" },
1756
834
  "#404040"
1757
835
  );
1758
- p(
836
+ h(
1759
837
  "Emerald Dark",
1760
838
  {
1761
839
  primary: "#34d399",
@@ -2147,7 +1225,7 @@ s(
2147
1225
  { primary: "#2e3440", secondary: "#3b4252", muted: "#4c566a" },
2148
1226
  "#d8dee9"
2149
1227
  );
2150
- p(
1228
+ h(
2151
1229
  "Dracula",
2152
1230
  {
2153
1231
  primary: "#bd93f9",
@@ -2175,7 +1253,7 @@ s(
2175
1253
  { primary: "#073642", secondary: "#586e75", muted: "#93a1a1" },
2176
1254
  "#eee8d5"
2177
1255
  );
2178
- p(
1256
+ h(
2179
1257
  "Solarized Dark",
2180
1258
  {
2181
1259
  primary: "#268bd2",
@@ -2189,7 +1267,7 @@ p(
2189
1267
  { primary: "#eee8d5", secondary: "#93a1a1", muted: "#586e75" },
2190
1268
  "#073642"
2191
1269
  );
2192
- p(
1270
+ h(
2193
1271
  "Monokai",
2194
1272
  {
2195
1273
  primary: "#66d9ef",
@@ -2203,7 +1281,7 @@ p(
2203
1281
  { primary: "#f8f8f2", secondary: "#cfcfc2", muted: "#75715e" },
2204
1282
  "#3e3d32"
2205
1283
  );
2206
- p(
1284
+ h(
2207
1285
  "One Dark",
2208
1286
  {
2209
1287
  primary: "#61afef",
@@ -2217,7 +1295,7 @@ p(
2217
1295
  { primary: "#abb2bf", secondary: "#828997", muted: "#545862" },
2218
1296
  "#3e4452"
2219
1297
  );
2220
- p(
1298
+ h(
2221
1299
  "Synthwave",
2222
1300
  {
2223
1301
  primary: "#ff7edb",
@@ -2245,7 +1323,7 @@ s(
2245
1323
  { primary: "#4a1a4e", secondary: "#7b3f7d", muted: "#c080c0" },
2246
1324
  "#d8a8e8"
2247
1325
  );
2248
- p(
1326
+ h(
2249
1327
  "Terminal Green",
2250
1328
  {
2251
1329
  primary: "#00ff41",
@@ -2287,7 +1365,7 @@ s(
2287
1365
  { primary: "#3e2723", secondary: "#5d4037", muted: "#a1887f" },
2288
1366
  "#bcaaa4"
2289
1367
  );
2290
- p(
1368
+ h(
2291
1369
  "Cyberpunk",
2292
1370
  {
2293
1371
  primary: "#00f0ff",
@@ -2301,7 +1379,7 @@ p(
2301
1379
  { primary: "#e0fbfc", secondary: "#80d4dd", muted: "#3a6b72" },
2302
1380
  "#1c3a44"
2303
1381
  );
2304
- p(
1382
+ h(
2305
1383
  "Neon",
2306
1384
  {
2307
1385
  primary: "#ff00ff",
@@ -2315,7 +1393,7 @@ p(
2315
1393
  { primary: "#ffffff", secondary: "#cccccc", muted: "#666666" },
2316
1394
  "#333333"
2317
1395
  );
2318
- p(
1396
+ h(
2319
1397
  "Retrowave",
2320
1398
  {
2321
1399
  primary: "#f77fbe",
@@ -2343,7 +1421,7 @@ s(
2343
1421
  { primary: "#3b0a0a", secondary: "#7f1d1d", muted: "#dc6868" },
2344
1422
  "#e8a0a0"
2345
1423
  );
2346
- p(
1424
+ h(
2347
1425
  "Halloween",
2348
1426
  {
2349
1427
  primary: "#ff6600",
@@ -2553,7 +1631,7 @@ s(
2553
1631
  { primary: "#2b1a0e", secondary: "#5c3d1e", muted: "#a08060" },
2554
1632
  "#d4b896"
2555
1633
  );
2556
- p(
1634
+ h(
2557
1635
  "High Contrast Dark",
2558
1636
  {
2559
1637
  primary: "#ffff00",
@@ -2609,7 +1687,7 @@ s(
2609
1687
  { primary: "#0a0a0a", secondary: "#404040", muted: "#a3a3a3" },
2610
1688
  "#e5e5e5"
2611
1689
  );
2612
- p(
1690
+ h(
2613
1691
  "Warm Dark",
2614
1692
  {
2615
1693
  primary: "#f59e0b",
@@ -2623,7 +1701,7 @@ p(
2623
1701
  { primary: "#fafaf9", secondary: "#d6d3d1", muted: "#78716c" },
2624
1702
  "#57534e"
2625
1703
  );
2626
- p(
1704
+ h(
2627
1705
  "Soft Dark",
2628
1706
  {
2629
1707
  primary: "#a78bfa",
@@ -2665,9 +1743,1228 @@ s(
2665
1743
  { primary: "#3b0a0a", secondary: "#7f1d1d", muted: "#dc6868" },
2666
1744
  "#e8a0a0"
2667
1745
  );
1746
+ const be = process.env.NODE_ENV === "development";
1747
+ let re = {
1748
+ enabled: be,
1749
+ slowRenderThreshold: 16
1750
+ };
1751
+ const ie = [], O = /* @__PURE__ */ new Map(), ce = /* @__PURE__ */ new Map();
1752
+ function ge() {
1753
+ ie.length = 0, O.clear(), ce.clear();
1754
+ }
1755
+ function Me(a) {
1756
+ const i = re.slowRenderThreshold;
1757
+ return ie.filter((c) => c.actualDuration > i);
1758
+ }
1759
+ function V(a) {
1760
+ return a < 1 ? `${(a * 1e3).toFixed(0)}ΞΌs` : a < 1e3 ? `${a.toFixed(2)}ms` : `${(a / 1e3).toFixed(2)}s`;
1761
+ }
1762
+ function _e() {
1763
+ const a = Array.from(O.values()), i = Me(), c = a.reduce((t, d) => t + d.renderCount, 0), n = a.length > 0 ? a.reduce((t, d) => t + d.avgRenderTime, 0) / a.length : 0, o = Array.from(ce.values());
1764
+ return { stats: a, slowRenders: i, totalRenders: c, avgRenderTime: n, marks: o };
1765
+ }
1766
+ function Ne() {
1767
+ const a = _e();
1768
+ console.group(
1769
+ "%c[Nice2Dev Performance Report]",
1770
+ "color: var(--nice-info, #6366f1); font-weight: bold; font-size: 14px"
1771
+ ), console.log(`Total renders: ${a.totalRenders}`), console.log(`Average render time: ${V(a.avgRenderTime)}`), console.log(`Slow renders: ${a.slowRenders.length}`), console.group("Component Stats"), console.table(
1772
+ a.stats.sort((i, c) => c.totalRenderTime - i.totalRenderTime).map((i) => ({
1773
+ Name: i.componentName,
1774
+ Renders: i.renderCount,
1775
+ "Avg Time": V(i.avgRenderTime),
1776
+ "Max Time": V(i.maxRenderTime),
1777
+ "Total Time": V(i.totalRenderTime),
1778
+ "Slow Renders": i.slowRenderCount
1779
+ }))
1780
+ ), console.groupEnd(), a.slowRenders.length > 0 && (console.group("Slow Renders (last 10)"), console.table(
1781
+ a.slowRenders.slice(-10).map((i) => ({
1782
+ Component: i.componentName,
1783
+ Phase: i.phase,
1784
+ Duration: V(i.actualDuration),
1785
+ Time: new Date(i.timestamp).toLocaleTimeString()
1786
+ }))
1787
+ ), console.groupEnd()), a.marks.length > 0 && (console.group("Custom Marks"), console.table(
1788
+ a.marks.filter((i) => i.duration).map((i) => ({
1789
+ Name: i.name,
1790
+ Duration: V(i.duration)
1791
+ }))
1792
+ ), console.groupEnd()), console.groupEnd();
1793
+ }
1794
+ const we = oe(
1795
+ ({ position: a = "bottom-right", defaultCollapsed: i = !0 }) => {
1796
+ const [c, n] = y(i), [o, t] = y([]), [d, l] = y({ used: 0, total: 0 });
1797
+ if (te(() => {
1798
+ const m = () => {
1799
+ const w = Array.from(O.values());
1800
+ t(w.sort((v, N) => N.totalRenderTime - v.totalRenderTime).slice(0, 10));
1801
+ const M = window.performance;
1802
+ M.memory && l({
1803
+ used: M.memory.usedJSHeapSize / 1024 / 1024,
1804
+ total: M.memory.totalJSHeapSize / 1024 / 1024
1805
+ });
1806
+ };
1807
+ m();
1808
+ const _ = setInterval(m, 2e3);
1809
+ return () => clearInterval(_);
1810
+ }, []), !re.enabled)
1811
+ return null;
1812
+ const g = {
1813
+ position: "fixed",
1814
+ zIndex: 99999,
1815
+ ...a.includes("top") ? { top: 8 } : { bottom: 8 },
1816
+ ...a.includes("left") ? { left: 8 } : { right: 8 }
1817
+ };
1818
+ return /* @__PURE__ */ r(
1819
+ "div",
1820
+ {
1821
+ style: {
1822
+ ...g,
1823
+ background: "var(--nice-overlay-85, rgba(0, 0, 0, 0.85))",
1824
+ color: "var(--nice-text-on-primary, #fff)",
1825
+ borderRadius: 8,
1826
+ fontSize: 11,
1827
+ fontFamily: "Monaco, Consolas, monospace",
1828
+ padding: c ? "4px 8px" : 8,
1829
+ maxWidth: c ? "auto" : 300,
1830
+ maxHeight: c ? "auto" : 400,
1831
+ overflow: "auto"
1832
+ },
1833
+ children: [
1834
+ /* @__PURE__ */ r(
1835
+ "div",
1836
+ {
1837
+ style: { cursor: "pointer", display: "flex", alignItems: "center", gap: 8 },
1838
+ onClick: () => n((m) => !m),
1839
+ children: [
1840
+ /* @__PURE__ */ e(
1841
+ "span",
1842
+ {
1843
+ "aria-hidden": "true",
1844
+ style: {
1845
+ width: 8,
1846
+ height: 8,
1847
+ borderRadius: "50%",
1848
+ background: "var(--nice-color-success, #22c55e)"
1849
+ }
1850
+ }
1851
+ ),
1852
+ /* @__PURE__ */ e("span", { children: "Profiler" }),
1853
+ d.used > 0 && /* @__PURE__ */ r(
1854
+ "span",
1855
+ {
1856
+ style: {
1857
+ color: d.used > 100 ? "var(--nice-color-warning, #f59e0b)" : "var(--nice-text-muted, #64748b)"
1858
+ },
1859
+ children: [
1860
+ d.used.toFixed(0),
1861
+ "MB"
1862
+ ]
1863
+ }
1864
+ ),
1865
+ /* @__PURE__ */ e("span", { style: { marginLeft: "auto", opacity: 0.5, display: "inline-flex" }, children: /* @__PURE__ */ e(u, { name: c ? "chevron-down" : "chevron-up", size: 12 }) })
1866
+ ]
1867
+ }
1868
+ ),
1869
+ !c && /* @__PURE__ */ r("div", { style: { marginTop: 8 }, children: [
1870
+ /* @__PURE__ */ e(
1871
+ "div",
1872
+ {
1873
+ style: {
1874
+ borderBottom: "1px solid var(--nice-border-color, #333)",
1875
+ paddingBottom: 4,
1876
+ marginBottom: 8
1877
+ },
1878
+ children: /* @__PURE__ */ e("strong", { children: "Top Components" })
1879
+ }
1880
+ ),
1881
+ o.map((m) => /* @__PURE__ */ r("div", { style: { marginBottom: 4, display: "flex", gap: 8 }, children: [
1882
+ /* @__PURE__ */ e("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis" }, children: m.componentName }),
1883
+ /* @__PURE__ */ e(
1884
+ "span",
1885
+ {
1886
+ style: {
1887
+ color: m.avgRenderTime > 16 ? "var(--nice-color-warning, #f59e0b)" : "var(--nice-color-success, #22c55e)"
1888
+ },
1889
+ children: V(m.avgRenderTime)
1890
+ }
1891
+ ),
1892
+ /* @__PURE__ */ r(
1893
+ "span",
1894
+ {
1895
+ style: {
1896
+ color: "var(--nice-text-muted, #64748b)",
1897
+ minWidth: 30,
1898
+ textAlign: "right"
1899
+ },
1900
+ children: [
1901
+ "x",
1902
+ m.renderCount
1903
+ ]
1904
+ }
1905
+ )
1906
+ ] }, m.componentName)),
1907
+ /* @__PURE__ */ r("div", { style: { marginTop: 8, display: "flex", gap: 8 }, children: [
1908
+ /* @__PURE__ */ e(
1909
+ "button",
1910
+ {
1911
+ onClick: Ne,
1912
+ style: {
1913
+ flex: 1,
1914
+ padding: "4px 8px",
1915
+ background: "var(--nice-bg-tertiary, #333)",
1916
+ border: "none",
1917
+ borderRadius: 4,
1918
+ color: "var(--nice-text-primary, #fff)",
1919
+ cursor: "pointer",
1920
+ fontSize: 10
1921
+ },
1922
+ children: "Print Report"
1923
+ }
1924
+ ),
1925
+ /* @__PURE__ */ e(
1926
+ "button",
1927
+ {
1928
+ onClick: ge,
1929
+ style: {
1930
+ flex: 1,
1931
+ padding: "4px 8px",
1932
+ background: "var(--nice-bg-tertiary, #333)",
1933
+ border: "none",
1934
+ borderRadius: 4,
1935
+ color: "var(--nice-text-primary, #fff)",
1936
+ cursor: "pointer",
1937
+ fontSize: 10
1938
+ },
1939
+ children: "Clear"
1940
+ }
1941
+ )
1942
+ ] })
1943
+ ] })
1944
+ ]
1945
+ }
1946
+ );
1947
+ }
1948
+ );
1949
+ we.displayName = "ProfilerOverlay";
1950
+ process.env.NODE_ENV;
1951
+ b(null);
1952
+ b({
1953
+ enabled: !0,
1954
+ active: !1,
1955
+ run: () => {
1956
+ }
1957
+ });
1958
+ const W = "nice-tutorial-button-styles";
1959
+ if (typeof document < "u" && !document.getElementById(W)) {
1960
+ const a = document.createElement("style");
1961
+ a.id = W, a.textContent = `
1962
+ .nice-tutorial-button {
1963
+ display: inline-flex;
1964
+ align-items: center;
1965
+ justify-content: center;
1966
+ border: 1px solid var(--nice-border, #cbd5e1);
1967
+ background: var(--nice-bg, #fff);
1968
+ color: var(--nice-text-secondary, #475569);
1969
+ border-radius: var(--nice-radius-full, 9999px);
1970
+ cursor: help;
1971
+ font-weight: 700;
1972
+ line-height: 1;
1973
+ padding: 0;
1974
+ transition: background var(--nice-transition, 200ms ease), color var(--nice-transition, 200ms ease), border-color var(--nice-transition, 200ms ease);
1975
+ }
1976
+ .nice-tutorial-button:hover {
1977
+ background: var(--nice-primary, #2563eb);
1978
+ border-color: var(--nice-primary, #2563eb);
1979
+ color: var(--nice-text-inverse, #fff);
1980
+ }
1981
+ .nice-tutorial-button:focus-visible {
1982
+ outline: none;
1983
+ box-shadow: 0 0 0 2px var(--nice-bg, #fff), 0 0 0 4px var(--nice-primary, #2563eb);
1984
+ }
1985
+ .nice-tutorial-button--sm { width: 16px; height: 16px; font-size: 11px; }
1986
+ .nice-tutorial-button--md { width: 20px; height: 20px; font-size: 12px; }
1987
+ `, document.head.appendChild(a);
1988
+ }
1989
+ b(null);
1990
+ b(null);
2668
1991
  b(null);
2669
1992
  b(null);
2670
1993
  const G = {
1994
+ display: "inline-block",
1995
+ width: 10,
1996
+ height: 10,
1997
+ borderRadius: "50%",
1998
+ background: "currentColor"
1999
+ }, F = [
2000
+ { type: "device-list", label: "Device List", icon: "list" },
2001
+ { type: "device-status", label: "Device Status", icon: "success" },
2002
+ { type: "telemetry-chart", label: "Telemetry Chart", icon: "bar-chart" },
2003
+ { type: "gauge", label: "Gauge", icon: "clock" },
2004
+ { type: "map", label: "Device Map", icon: "map-pin" },
2005
+ { type: "alarms", label: "Alarms", icon: "bell" },
2006
+ { type: "control-panel", label: "Control Panel", icon: "settings" },
2007
+ { type: "topology", label: "Network Topology", icon: "link" },
2008
+ { type: "kpi", label: "KPI Card", icon: "target" },
2009
+ { type: "camera-feed", label: "Camera Feed", icon: "video" }
2010
+ ];
2011
+ function Be({
2012
+ devices: a = [],
2013
+ widgets: i = [],
2014
+ alarms: c = [],
2015
+ onDeviceSelect: n,
2016
+ onWidgetChange: o,
2017
+ onCommand: t,
2018
+ onAlarmAcknowledge: d,
2019
+ fetchTelemetry: l,
2020
+ className: g = ""
2021
+ }) {
2022
+ const [m, _] = y(i), [w, M] = y(null), [v, N] = y("dashboard"), [H, L] = y(!1), [z, A] = y(""), p = C(
2023
+ (f) => {
2024
+ _((x) => {
2025
+ const S = f(x);
2026
+ return o == null || o(S), S;
2027
+ });
2028
+ },
2029
+ [o]
2030
+ ), k = C(
2031
+ (f) => {
2032
+ var S;
2033
+ const x = {
2034
+ id: crypto.randomUUID(),
2035
+ type: f,
2036
+ title: ((S = F.find(($) => $.type === f)) == null ? void 0 : S.label) || f,
2037
+ position: { x: 0, y: Ce(m), width: 4, height: 3 },
2038
+ config: {}
2039
+ };
2040
+ p(($) => [...$, x]);
2041
+ },
2042
+ [m, p]
2043
+ ), E = C(
2044
+ (f) => {
2045
+ M(f), n == null || n(f);
2046
+ },
2047
+ [n]
2048
+ ), U = C(
2049
+ (f) => {
2050
+ d == null || d(f);
2051
+ },
2052
+ [d]
2053
+ ), T = a.filter(
2054
+ (f) => !z || f.name.toLowerCase().includes(z.toLowerCase()) || f.type.toLowerCase().includes(z.toLowerCase())
2055
+ ), P = c.filter((f) => !f.cleared), q = P.filter(
2056
+ (f) => f.severity === "critical" || f.severity === "high"
2057
+ );
2058
+ return /* @__PURE__ */ r("div", { className: `nice-iot-dashboard ${g}`, children: [
2059
+ /* @__PURE__ */ r("header", { className: "nice-iot-dashboard__header", children: [
2060
+ /* @__PURE__ */ e("h1", { children: "IoT Dashboard" }),
2061
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__stats", children: [
2062
+ /* @__PURE__ */ r("span", { className: "nice-iot-dashboard__stat", children: [
2063
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", children: /* @__PURE__ */ e(u, { name: "wifi", size: 14 }) }),
2064
+ a.length,
2065
+ " Devices"
2066
+ ] }),
2067
+ /* @__PURE__ */ r("span", { className: "nice-iot-dashboard__stat nice-iot-dashboard__stat--online", children: [
2068
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", style: G }),
2069
+ a.filter((f) => f.status === "online").length,
2070
+ " Online"
2071
+ ] }),
2072
+ /* @__PURE__ */ r("span", { className: "nice-iot-dashboard__stat nice-iot-dashboard__stat--offline", children: [
2073
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", style: G }),
2074
+ a.filter((f) => f.status === "offline").length,
2075
+ " Offline"
2076
+ ] }),
2077
+ q.length > 0 && /* @__PURE__ */ r("span", { className: "nice-iot-dashboard__stat nice-iot-dashboard__stat--alarms", children: [
2078
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", children: /* @__PURE__ */ e(u, { name: "bell", size: 14 }) }),
2079
+ q.length,
2080
+ " Alarms"
2081
+ ] })
2082
+ ] }),
2083
+ /* @__PURE__ */ r("nav", { className: "nice-iot-dashboard__nav", children: [
2084
+ /* @__PURE__ */ e(
2085
+ "button",
2086
+ {
2087
+ className: v === "dashboard" ? "active" : "",
2088
+ onClick: () => N("dashboard"),
2089
+ children: "Dashboard"
2090
+ }
2091
+ ),
2092
+ /* @__PURE__ */ e("button", { className: v === "devices" ? "active" : "", onClick: () => N("devices"), children: "Devices" }),
2093
+ /* @__PURE__ */ r("button", { className: v === "alarms" ? "active" : "", onClick: () => N("alarms"), children: [
2094
+ "Alarms ",
2095
+ P.length > 0 && `(${P.length})`
2096
+ ] })
2097
+ ] }),
2098
+ /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__actions", children: v === "dashboard" && /* @__PURE__ */ r("button", { onClick: () => L(!H), children: [
2099
+ /* @__PURE__ */ e(u, { name: H ? "check" : "edit", size: 14 }),
2100
+ " ",
2101
+ H ? "Done" : "Edit"
2102
+ ] }) })
2103
+ ] }),
2104
+ v === "dashboard" && /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__main", children: [
2105
+ H && /* @__PURE__ */ r("aside", { className: "nice-iot-dashboard__palette", children: [
2106
+ /* @__PURE__ */ e("h4", { children: "Add Widget" }),
2107
+ F.map((f) => /* @__PURE__ */ r(
2108
+ "button",
2109
+ {
2110
+ className: "nice-iot-dashboard__palette-item",
2111
+ onClick: () => k(f.type),
2112
+ children: [
2113
+ /* @__PURE__ */ e(u, { name: f.icon, size: 16 }),
2114
+ /* @__PURE__ */ e("span", { children: f.label })
2115
+ ]
2116
+ },
2117
+ f.type
2118
+ ))
2119
+ ] }),
2120
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__grid", children: [
2121
+ m.map((f) => /* @__PURE__ */ e(
2122
+ He,
2123
+ {
2124
+ widget: f,
2125
+ devices: a,
2126
+ alarms: c,
2127
+ isEditing: H,
2128
+ onCommand: t,
2129
+ onDelete: () => p((x) => x.filter((S) => S.id !== f.id))
2130
+ },
2131
+ f.id
2132
+ )),
2133
+ m.length === 0 && /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__empty", children: H ? "Add widgets from the palette" : "No widgets configured. Click Edit to add widgets." })
2134
+ ] })
2135
+ ] }),
2136
+ v === "devices" && /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__devices", children: [
2137
+ /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__devices-toolbar", children: /* @__PURE__ */ e(
2138
+ "input",
2139
+ {
2140
+ type: "search",
2141
+ placeholder: "Search devices...",
2142
+ value: z,
2143
+ onChange: (f) => A(f.target.value)
2144
+ }
2145
+ ) }),
2146
+ /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__device-grid", children: T.map((f) => /* @__PURE__ */ e(
2147
+ ke,
2148
+ {
2149
+ device: f,
2150
+ isSelected: (w == null ? void 0 : w.id) === f.id,
2151
+ onSelect: () => E(f)
2152
+ },
2153
+ f.id
2154
+ )) }),
2155
+ w && /* @__PURE__ */ e(
2156
+ xe,
2157
+ {
2158
+ device: w,
2159
+ onCommand: t,
2160
+ onClose: () => M(null)
2161
+ }
2162
+ )
2163
+ ] }),
2164
+ v === "alarms" && /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__alarms", children: /* @__PURE__ */ r("table", { className: "nice-iot-dashboard__alarm-table", children: [
2165
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ r("tr", { children: [
2166
+ /* @__PURE__ */ e("th", { children: "Severity" }),
2167
+ /* @__PURE__ */ e("th", { children: "Device" }),
2168
+ /* @__PURE__ */ e("th", { children: "Message" }),
2169
+ /* @__PURE__ */ e("th", { children: "Time" }),
2170
+ /* @__PURE__ */ e("th", { children: "Status" }),
2171
+ /* @__PURE__ */ e("th", { children: "Actions" })
2172
+ ] }) }),
2173
+ /* @__PURE__ */ e("tbody", { children: P.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: 6, className: "nice-iot-dashboard__no-alarms", children: "No active alarms" }) }) : P.map((f) => {
2174
+ const x = a.find((S) => S.id === f.deviceId);
2175
+ return /* @__PURE__ */ r(
2176
+ "tr",
2177
+ {
2178
+ className: `nice-iot-dashboard__alarm-row nice-iot-dashboard__alarm-row--${f.severity}`,
2179
+ children: [
2180
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
2181
+ "span",
2182
+ {
2183
+ className: `nice-iot-dashboard__severity nice-iot-dashboard__severity--${f.severity}`,
2184
+ children: f.severity
2185
+ }
2186
+ ) }),
2187
+ /* @__PURE__ */ e("td", { children: (x == null ? void 0 : x.name) || f.deviceId }),
2188
+ /* @__PURE__ */ e("td", { children: f.message }),
2189
+ /* @__PURE__ */ e("td", { children: f.timestamp.toLocaleString() }),
2190
+ /* @__PURE__ */ e("td", { children: f.acknowledged ? "Acknowledged" : "Active" }),
2191
+ /* @__PURE__ */ e("td", { children: !f.acknowledged && /* @__PURE__ */ e("button", { onClick: () => U(f.id), children: "Acknowledge" }) })
2192
+ ]
2193
+ },
2194
+ f.id
2195
+ );
2196
+ }) })
2197
+ ] }) })
2198
+ ] });
2199
+ }
2200
+ function Ce(a) {
2201
+ return a.length === 0 ? 0 : Math.max(...a.map((i) => i.position.y + i.position.height));
2202
+ }
2203
+ function I(a) {
2204
+ switch (a) {
2205
+ case "online":
2206
+ return "var(--nice-success, #28a745)";
2207
+ case "offline":
2208
+ return "var(--nice-text-secondary, #6c757d)";
2209
+ case "warning":
2210
+ return "var(--nice-warning, #ffc107)";
2211
+ case "error":
2212
+ return "var(--nice-danger, #dc3545)";
2213
+ case "maintenance":
2214
+ return "var(--nice-info, #17a2b8)";
2215
+ default:
2216
+ return "var(--nice-text-secondary, #6c757d)";
2217
+ }
2218
+ }
2219
+ function He({
2220
+ widget: a,
2221
+ devices: i,
2222
+ alarms: c,
2223
+ isEditing: n,
2224
+ onCommand: o,
2225
+ onDelete: t
2226
+ }) {
2227
+ const d = F.find((l) => l.type === a.type);
2228
+ return /* @__PURE__ */ r(
2229
+ "div",
2230
+ {
2231
+ className: `nice-iot-dashboard__widget nice-iot-dashboard__widget--${a.type}`,
2232
+ style: {
2233
+ gridColumn: `span ${a.position.width}`,
2234
+ gridRow: `span ${a.position.height}`
2235
+ },
2236
+ children: [
2237
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__widget-header", children: [
2238
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__widget-icon", children: /* @__PURE__ */ e(u, { name: (d == null ? void 0 : d.icon) ?? "box", size: 14 }) }),
2239
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__widget-title", children: a.title }),
2240
+ n && /* @__PURE__ */ e("button", { className: "nice-iot-dashboard__widget-delete", onClick: t, children: "Γ—" })
2241
+ ] }),
2242
+ /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__widget-content", children: /* @__PURE__ */ e(ze, { widget: a, devices: i, alarms: c, onCommand: o }) })
2243
+ ]
2244
+ }
2245
+ );
2246
+ }
2247
+ function ze({
2248
+ widget: a,
2249
+ devices: i,
2250
+ alarms: c,
2251
+ onCommand: n
2252
+ }) {
2253
+ switch (a.type) {
2254
+ case "device-list":
2255
+ return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__device-list", children: i.slice(0, 10).map((o) => /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__device-list-item", children: [
2256
+ /* @__PURE__ */ e(
2257
+ "span",
2258
+ {
2259
+ className: "nice-iot-dashboard__device-status",
2260
+ style: { background: I(o.status) }
2261
+ }
2262
+ ),
2263
+ /* @__PURE__ */ e("span", { children: o.name }),
2264
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__device-type", children: o.type })
2265
+ ] }, o.id)) });
2266
+ case "device-status":
2267
+ return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__status-grid", children: ["online", "offline", "warning", "error"].map((o) => {
2268
+ const t = i.filter((d) => d.status === o).length;
2269
+ return /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__status-card", children: [
2270
+ /* @__PURE__ */ e(
2271
+ "span",
2272
+ {
2273
+ className: "nice-iot-dashboard__status-indicator",
2274
+ style: { background: I(o) }
2275
+ }
2276
+ ),
2277
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__status-count", children: t }),
2278
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__status-label", children: o })
2279
+ ] }, o);
2280
+ }) });
2281
+ case "telemetry-chart":
2282
+ return /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__chart-placeholder", children: [
2283
+ /* @__PURE__ */ e(u, { name: "bar-chart", size: 32 }),
2284
+ /* @__PURE__ */ e("span", { children: "Telemetry Chart" }),
2285
+ /* @__PURE__ */ e("small", { children: "Configure device and capability" })
2286
+ ] });
2287
+ case "gauge":
2288
+ return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__gauge", children: /* @__PURE__ */ r("svg", { viewBox: "0 0 100 60", children: [
2289
+ /* @__PURE__ */ e(
2290
+ "path",
2291
+ {
2292
+ d: "M 10 55 A 40 40 0 0 1 90 55",
2293
+ fill: "none",
2294
+ stroke: "var(--nice-border, #e0e0e0)",
2295
+ strokeWidth: "8"
2296
+ }
2297
+ ),
2298
+ /* @__PURE__ */ e(
2299
+ "path",
2300
+ {
2301
+ d: "M 10 55 A 40 40 0 0 1 90 55",
2302
+ fill: "none",
2303
+ stroke: "var(--nice-primary, #0066cc)",
2304
+ strokeWidth: "8",
2305
+ strokeDasharray: "63 126"
2306
+ }
2307
+ ),
2308
+ /* @__PURE__ */ e("text", { x: "50", y: "50", textAnchor: "middle", fontSize: "14", fontWeight: "bold", children: "50%" })
2309
+ ] }) });
2310
+ case "map":
2311
+ return /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__map-placeholder", children: [
2312
+ /* @__PURE__ */ e(u, { name: "map-pin", size: 32 }),
2313
+ /* @__PURE__ */ e("span", { children: "Device Map" }),
2314
+ /* @__PURE__ */ r("small", { children: [
2315
+ i.filter((o) => o.location).length,
2316
+ " devices with location"
2317
+ ] })
2318
+ ] });
2319
+ case "alarms": {
2320
+ const o = c.filter((t) => !t.cleared).slice(0, 5);
2321
+ return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__alarm-list", children: o.length === 0 ? /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__alarm-empty", children: "No active alarms" }) : o.map((t) => /* @__PURE__ */ r(
2322
+ "div",
2323
+ {
2324
+ className: `nice-iot-dashboard__alarm-item nice-iot-dashboard__alarm-item--${t.severity}`,
2325
+ children: [
2326
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__alarm-severity", children: t.severity }),
2327
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__alarm-message", children: t.message })
2328
+ ]
2329
+ },
2330
+ t.id
2331
+ )) });
2332
+ }
2333
+ case "control-panel":
2334
+ return /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__control-placeholder", children: [
2335
+ /* @__PURE__ */ e(u, { name: "settings", size: 32 }),
2336
+ /* @__PURE__ */ e("span", { children: "Control Panel" }),
2337
+ /* @__PURE__ */ e("small", { children: "Configure device controls" })
2338
+ ] });
2339
+ case "kpi":
2340
+ return /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__kpi", children: [
2341
+ /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__kpi-value", children: i.length }),
2342
+ /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__kpi-label", children: "Total Devices" })
2343
+ ] });
2344
+ default:
2345
+ return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__widget-placeholder", children: a.type });
2346
+ }
2347
+ }
2348
+ function ke({ device: a, isSelected: i, onSelect: c }) {
2349
+ return /* @__PURE__ */ r(
2350
+ "div",
2351
+ {
2352
+ className: `nice-iot-dashboard__device-card ${i ? "nice-iot-dashboard__device-card--selected" : ""}`,
2353
+ onClick: c,
2354
+ children: [
2355
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__device-card-header", children: [
2356
+ /* @__PURE__ */ e(
2357
+ "span",
2358
+ {
2359
+ className: "nice-iot-dashboard__device-status",
2360
+ style: { background: I(a.status) }
2361
+ }
2362
+ ),
2363
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__device-name", children: a.name })
2364
+ ] }),
2365
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__device-card-body", children: [
2366
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__device-info", children: [
2367
+ /* @__PURE__ */ r("span", { children: [
2368
+ "Type: ",
2369
+ a.type
2370
+ ] }),
2371
+ /* @__PURE__ */ r("span", { children: [
2372
+ "Protocol: ",
2373
+ a.protocol
2374
+ ] })
2375
+ ] }),
2376
+ a.lastSeen && /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__device-lastseen", children: [
2377
+ "Last seen: ",
2378
+ a.lastSeen.toLocaleString()
2379
+ ] }),
2380
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__device-capabilities", children: [
2381
+ a.capabilities.slice(0, 3).map((n) => /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__capability-badge", children: n.name }, n.id)),
2382
+ a.capabilities.length > 3 && /* @__PURE__ */ r("span", { className: "nice-iot-dashboard__capability-more", children: [
2383
+ "+",
2384
+ a.capabilities.length - 3
2385
+ ] })
2386
+ ] })
2387
+ ] })
2388
+ ]
2389
+ }
2390
+ );
2391
+ }
2392
+ function xe({
2393
+ device: a,
2394
+ onCommand: i,
2395
+ onClose: c
2396
+ }) {
2397
+ return /* @__PURE__ */ r("aside", { className: "nice-iot-dashboard__device-detail", children: [
2398
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__device-detail-header", children: [
2399
+ /* @__PURE__ */ e("h3", { children: a.name }),
2400
+ /* @__PURE__ */ e("button", { onClick: c, children: "Γ—" })
2401
+ ] }),
2402
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__device-detail-content", children: [
2403
+ /* @__PURE__ */ r("section", { children: [
2404
+ /* @__PURE__ */ e("h4", { children: "Status" }),
2405
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__detail-row", children: [
2406
+ /* @__PURE__ */ e("span", { children: "Status:" }),
2407
+ /* @__PURE__ */ e(
2408
+ "span",
2409
+ {
2410
+ className: "nice-iot-dashboard__status-badge",
2411
+ style: { background: I(a.status) },
2412
+ children: a.status
2413
+ }
2414
+ )
2415
+ ] }),
2416
+ a.lastSeen && /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__detail-row", children: [
2417
+ /* @__PURE__ */ e("span", { children: "Last Seen:" }),
2418
+ /* @__PURE__ */ e("span", { children: a.lastSeen.toLocaleString() })
2419
+ ] })
2420
+ ] }),
2421
+ /* @__PURE__ */ r("section", { children: [
2422
+ /* @__PURE__ */ e("h4", { children: "Connection" }),
2423
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__detail-row", children: [
2424
+ /* @__PURE__ */ e("span", { children: "Protocol:" }),
2425
+ /* @__PURE__ */ e("span", { children: a.protocol })
2426
+ ] }),
2427
+ a.connectionInfo.host && /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__detail-row", children: [
2428
+ /* @__PURE__ */ e("span", { children: "Host:" }),
2429
+ /* @__PURE__ */ r("span", { children: [
2430
+ a.connectionInfo.host,
2431
+ ":",
2432
+ a.connectionInfo.port
2433
+ ] })
2434
+ ] })
2435
+ ] }),
2436
+ a.metadata && /* @__PURE__ */ r("section", { children: [
2437
+ /* @__PURE__ */ e("h4", { children: "Metadata" }),
2438
+ a.metadata.manufacturer && /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__detail-row", children: [
2439
+ /* @__PURE__ */ e("span", { children: "Manufacturer:" }),
2440
+ /* @__PURE__ */ e("span", { children: a.metadata.manufacturer })
2441
+ ] }),
2442
+ a.metadata.model && /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__detail-row", children: [
2443
+ /* @__PURE__ */ e("span", { children: "Model:" }),
2444
+ /* @__PURE__ */ e("span", { children: a.metadata.model })
2445
+ ] })
2446
+ ] }),
2447
+ /* @__PURE__ */ r("section", { children: [
2448
+ /* @__PURE__ */ e("h4", { children: "Capabilities" }),
2449
+ /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__capabilities-list", children: a.capabilities.map((n) => /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__capability-item", children: [
2450
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__capability-name", children: n.name }),
2451
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__capability-type", children: n.type }),
2452
+ n.writable && i && /* @__PURE__ */ e(
2453
+ "button",
2454
+ {
2455
+ className: "nice-iot-dashboard__capability-control",
2456
+ onClick: () => i(a.id, n.id, !0),
2457
+ children: "Control"
2458
+ }
2459
+ )
2460
+ ] }, n.id)) })
2461
+ ] })
2462
+ ] })
2463
+ ] });
2464
+ }
2465
+ const Se = [
2466
+ { name: "MQTT Broker", image: "eclipse-mosquitto:latest" },
2467
+ { name: "Node-RED", image: "nodered/node-red:latest" },
2468
+ { name: "InfluxDB", image: "influxdb:latest" },
2469
+ { name: "Grafana", image: "grafana/grafana:latest" },
2470
+ { name: "Telegraf", image: "telegraf:latest" },
2471
+ { name: "Protocol Adapter", image: "nice2dev/protocol-adapter:latest" }
2472
+ ];
2473
+ function Fe({
2474
+ nodes: a = [],
2475
+ modules: i = [],
2476
+ onNodeSelect: c,
2477
+ onModuleDeploy: n,
2478
+ onModuleAction: o,
2479
+ onNodeSync: t,
2480
+ className: d = ""
2481
+ }) {
2482
+ const [l, g] = y(null), [m, _] = y("nodes"), [w, M] = y(!1), [v, N] = y({
2483
+ name: "",
2484
+ image: "",
2485
+ status: "pending"
2486
+ }), H = C(
2487
+ (p) => {
2488
+ g(p), c == null || c(p);
2489
+ },
2490
+ [c]
2491
+ ), L = C(async () => {
2492
+ !l || !v.name || !v.image || (await (n == null ? void 0 : n(l.id, v)), M(!1), N({ name: "", image: "", status: "pending" }));
2493
+ }, [l, v, n]), z = C(
2494
+ async (p, k) => {
2495
+ l && await (o == null ? void 0 : o(l.id, p, k));
2496
+ },
2497
+ [l, o]
2498
+ ), A = C(async () => {
2499
+ l && await (t == null ? void 0 : t(l.id));
2500
+ }, [l, t]);
2501
+ return /* @__PURE__ */ r("div", { className: `nice-edge-manager ${d}`, children: [
2502
+ /* @__PURE__ */ r("header", { className: "nice-edge-manager__header", children: [
2503
+ /* @__PURE__ */ e("h1", { children: "Edge Manager" }),
2504
+ /* @__PURE__ */ r("nav", { className: "nice-edge-manager__nav", children: [
2505
+ /* @__PURE__ */ r("button", { className: m === "nodes" ? "active" : "", onClick: () => _("nodes"), children: [
2506
+ "Nodes (",
2507
+ a.length,
2508
+ ")"
2509
+ ] }),
2510
+ /* @__PURE__ */ e("button", { className: m === "modules" ? "active" : "", onClick: () => _("modules"), children: "Modules" })
2511
+ ] })
2512
+ ] }),
2513
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__main", children: [
2514
+ m === "nodes" && /* @__PURE__ */ e("div", { className: "nice-edge-manager__nodes", children: /* @__PURE__ */ r("div", { className: "nice-edge-manager__node-grid", children: [
2515
+ a.map((p) => /* @__PURE__ */ e(
2516
+ Te,
2517
+ {
2518
+ node: p,
2519
+ isSelected: (l == null ? void 0 : l.id) === p.id,
2520
+ onSelect: () => H(p)
2521
+ },
2522
+ p.id
2523
+ )),
2524
+ a.length === 0 && /* @__PURE__ */ e("div", { className: "nice-edge-manager__empty", children: "No edge nodes configured" })
2525
+ ] }) }),
2526
+ m === "modules" && l && /* @__PURE__ */ r("div", { className: "nice-edge-manager__modules", children: [
2527
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__modules-header", children: [
2528
+ /* @__PURE__ */ r("h3", { children: [
2529
+ "Modules on ",
2530
+ l.name
2531
+ ] }),
2532
+ /* @__PURE__ */ e(
2533
+ "button",
2534
+ {
2535
+ className: "nice-edge-manager__deploy-btn",
2536
+ onClick: () => M(!0),
2537
+ children: "+ Deploy Module"
2538
+ }
2539
+ )
2540
+ ] }),
2541
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__module-grid", children: [
2542
+ l.deployedModules.map((p) => /* @__PURE__ */ e(
2543
+ Ve,
2544
+ {
2545
+ module: p,
2546
+ onAction: (k) => z(p.id, k)
2547
+ },
2548
+ p.id
2549
+ )),
2550
+ l.deployedModules.length === 0 && /* @__PURE__ */ e("div", { className: "nice-edge-manager__empty", children: "No modules deployed on this node" })
2551
+ ] })
2552
+ ] }),
2553
+ m === "modules" && !l && /* @__PURE__ */ e("div", { className: "nice-edge-manager__no-selection", children: "Select a node from the Nodes tab to manage modules" }),
2554
+ l && /* @__PURE__ */ e(
2555
+ Ae,
2556
+ {
2557
+ node: l,
2558
+ onSync: A,
2559
+ onClose: () => g(null)
2560
+ }
2561
+ )
2562
+ ] }),
2563
+ w && /* @__PURE__ */ e(
2564
+ De,
2565
+ {
2566
+ config: v,
2567
+ templates: Se,
2568
+ onChange: N,
2569
+ onDeploy: L,
2570
+ onClose: () => M(!1)
2571
+ }
2572
+ )
2573
+ ] });
2574
+ }
2575
+ function ne(a) {
2576
+ switch (a) {
2577
+ case "running":
2578
+ return "var(--nice-success, #28a745)";
2579
+ case "stopped":
2580
+ return "var(--nice-text-secondary, #6c757d)";
2581
+ case "updating":
2582
+ return "var(--nice-warning, #ffc107)";
2583
+ case "error":
2584
+ return "var(--nice-danger, #dc3545)";
2585
+ case "unreachable":
2586
+ return "var(--nice-text-secondary, #868e96)";
2587
+ default:
2588
+ return "var(--nice-text-secondary, #6c757d)";
2589
+ }
2590
+ }
2591
+ function j(a) {
2592
+ return a < 1024 ? `${a} B` : a < 1024 * 1024 ? `${(a / 1024).toFixed(1)} KB` : a < 1024 * 1024 * 1024 ? `${(a / 1024 / 1024).toFixed(1)} MB` : `${(a / 1024 / 1024 / 1024).toFixed(2)} GB`;
2593
+ }
2594
+ function Le(a) {
2595
+ const i = Math.floor(a / 86400), c = Math.floor(a % 86400 / 3600), n = Math.floor(a % 3600 / 60);
2596
+ return i > 0 ? `${i}d ${c}h` : c > 0 ? `${c}h ${n}m` : `${n}m`;
2597
+ }
2598
+ function Te({ node: a, isSelected: i, onSelect: c }) {
2599
+ return /* @__PURE__ */ r(
2600
+ "div",
2601
+ {
2602
+ className: `nice-edge-manager__node-card ${i ? "nice-edge-manager__node-card--selected" : ""}`,
2603
+ onClick: c,
2604
+ children: [
2605
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__node-header", children: [
2606
+ /* @__PURE__ */ e(
2607
+ "span",
2608
+ {
2609
+ className: "nice-edge-manager__node-status",
2610
+ style: { background: ne(a.status) }
2611
+ }
2612
+ ),
2613
+ /* @__PURE__ */ e("span", { className: "nice-edge-manager__node-name", children: a.name }),
2614
+ /* @__PURE__ */ e("span", { className: "nice-edge-manager__node-type", children: a.type })
2615
+ ] }),
2616
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__node-body", children: [
2617
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__node-info", children: [
2618
+ /* @__PURE__ */ r("span", { children: [
2619
+ /* @__PURE__ */ e(u, { name: "server", size: 12 }),
2620
+ " ",
2621
+ a.hardware.cpu
2622
+ ] }),
2623
+ /* @__PURE__ */ r("span", { children: [
2624
+ /* @__PURE__ */ e(u, { name: "database", size: 12 }),
2625
+ " ",
2626
+ (a.hardware.memoryMB / 1024).toFixed(1),
2627
+ " GB"
2628
+ ] })
2629
+ ] }),
2630
+ /* @__PURE__ */ e("div", { className: "nice-edge-manager__node-metrics", children: a.metrics && /* @__PURE__ */ r(D, { children: [
2631
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__metric", children: [
2632
+ /* @__PURE__ */ e("span", { className: "nice-edge-manager__metric-label", children: "CPU" }),
2633
+ /* @__PURE__ */ e("div", { className: "nice-edge-manager__metric-bar", children: /* @__PURE__ */ e(
2634
+ "div",
2635
+ {
2636
+ className: "nice-edge-manager__metric-fill",
2637
+ style: { width: `${a.metrics.cpuUsage}%` }
2638
+ }
2639
+ ) }),
2640
+ /* @__PURE__ */ r("span", { className: "nice-edge-manager__metric-value", children: [
2641
+ a.metrics.cpuUsage.toFixed(0),
2642
+ "%"
2643
+ ] })
2644
+ ] }),
2645
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__metric", children: [
2646
+ /* @__PURE__ */ e("span", { className: "nice-edge-manager__metric-label", children: "MEM" }),
2647
+ /* @__PURE__ */ e("div", { className: "nice-edge-manager__metric-bar", children: /* @__PURE__ */ e(
2648
+ "div",
2649
+ {
2650
+ className: "nice-edge-manager__metric-fill",
2651
+ style: { width: `${a.metrics.memoryUsage}%` }
2652
+ }
2653
+ ) }),
2654
+ /* @__PURE__ */ r("span", { className: "nice-edge-manager__metric-value", children: [
2655
+ a.metrics.memoryUsage.toFixed(0),
2656
+ "%"
2657
+ ] })
2658
+ ] })
2659
+ ] }) }),
2660
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__node-modules", children: [
2661
+ a.deployedModules.length,
2662
+ " modules deployed"
2663
+ ] })
2664
+ ] })
2665
+ ]
2666
+ }
2667
+ );
2668
+ }
2669
+ function Ve({ module: a, onAction: i }) {
2670
+ return /* @__PURE__ */ r("div", { className: "nice-edge-manager__module-card", children: [
2671
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__module-header", children: [
2672
+ /* @__PURE__ */ e(
2673
+ "span",
2674
+ {
2675
+ className: "nice-edge-manager__module-status",
2676
+ style: {
2677
+ background: {
2678
+ running: "var(--nice-success, #28a745)",
2679
+ stopped: "var(--nice-text-secondary, #6c757d)",
2680
+ error: "var(--nice-danger, #dc3545)",
2681
+ pending: "var(--nice-warning, #ffc107)"
2682
+ }[a.status] || "var(--nice-bg-tertiary, #6c757d)"
2683
+ }
2684
+ }
2685
+ ),
2686
+ /* @__PURE__ */ e("span", { className: "nice-edge-manager__module-name", children: a.name }),
2687
+ /* @__PURE__ */ r("span", { className: "nice-edge-manager__module-version", children: [
2688
+ "v",
2689
+ a.version
2690
+ ] })
2691
+ ] }),
2692
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__module-body", children: [
2693
+ /* @__PURE__ */ e("div", { className: "nice-edge-manager__module-image", children: a.image }),
2694
+ a.resources && /* @__PURE__ */ r("div", { className: "nice-edge-manager__module-resources", children: [
2695
+ a.resources.cpuLimit && /* @__PURE__ */ r("span", { children: [
2696
+ "CPU: ",
2697
+ a.resources.cpuLimit
2698
+ ] }),
2699
+ a.resources.memoryLimitMB && /* @__PURE__ */ r("span", { children: [
2700
+ "RAM: ",
2701
+ a.resources.memoryLimitMB,
2702
+ " MB"
2703
+ ] })
2704
+ ] }),
2705
+ a.ports && a.ports.length > 0 && /* @__PURE__ */ r("div", { className: "nice-edge-manager__module-ports", children: [
2706
+ "Ports: ",
2707
+ a.ports.map((n) => `${n.host}:${n.container}`).join(", ")
2708
+ ] })
2709
+ ] }),
2710
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__module-actions", children: [
2711
+ a.status === "running" && /* @__PURE__ */ r(D, { children: [
2712
+ /* @__PURE__ */ e("button", { onClick: () => i("stop"), children: "Stop" }),
2713
+ /* @__PURE__ */ e("button", { onClick: () => i("restart"), children: "Restart" })
2714
+ ] }),
2715
+ a.status === "stopped" && /* @__PURE__ */ e("button", { onClick: () => i("start"), children: "Start" }),
2716
+ /* @__PURE__ */ e("button", { className: "nice-edge-manager__module-remove", onClick: () => i("remove"), children: "Remove" })
2717
+ ] })
2718
+ ] });
2719
+ }
2720
+ function Ae({ node: a, onSync: i, onClose: c }) {
2721
+ return /* @__PURE__ */ r("aside", { className: "nice-edge-manager__detail", children: [
2722
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-header", children: [
2723
+ /* @__PURE__ */ e("h3", { children: a.name }),
2724
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-actions", children: [
2725
+ /* @__PURE__ */ r("button", { onClick: i, children: [
2726
+ /* @__PURE__ */ e(u, { name: "refresh", size: 14 }),
2727
+ " Sync"
2728
+ ] }),
2729
+ /* @__PURE__ */ e("button", { onClick: c, "aria-label": "Close", children: /* @__PURE__ */ e(u, { name: "close", size: 14 }) })
2730
+ ] })
2731
+ ] }),
2732
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-content", children: [
2733
+ /* @__PURE__ */ r("section", { children: [
2734
+ /* @__PURE__ */ e("h4", { children: "Status" }),
2735
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2736
+ /* @__PURE__ */ e("span", { children: "Status:" }),
2737
+ /* @__PURE__ */ e(
2738
+ "span",
2739
+ {
2740
+ className: "nice-edge-manager__status-badge",
2741
+ style: { background: ne(a.status) },
2742
+ children: a.status
2743
+ }
2744
+ )
2745
+ ] }),
2746
+ a.metrics && /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2747
+ /* @__PURE__ */ e("span", { children: "Uptime:" }),
2748
+ /* @__PURE__ */ e("span", { children: Le(a.metrics.uptime) })
2749
+ ] })
2750
+ ] }),
2751
+ /* @__PURE__ */ r("section", { children: [
2752
+ /* @__PURE__ */ e("h4", { children: "Hardware" }),
2753
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2754
+ /* @__PURE__ */ e("span", { children: "CPU:" }),
2755
+ /* @__PURE__ */ r("span", { children: [
2756
+ a.hardware.cpu,
2757
+ " (",
2758
+ a.hardware.cores,
2759
+ " cores)"
2760
+ ] })
2761
+ ] }),
2762
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2763
+ /* @__PURE__ */ e("span", { children: "Memory:" }),
2764
+ /* @__PURE__ */ r("span", { children: [
2765
+ (a.hardware.memoryMB / 1024).toFixed(1),
2766
+ " GB"
2767
+ ] })
2768
+ ] }),
2769
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2770
+ /* @__PURE__ */ e("span", { children: "Storage:" }),
2771
+ /* @__PURE__ */ r("span", { children: [
2772
+ (a.hardware.storageMB / 1024).toFixed(1),
2773
+ " GB"
2774
+ ] })
2775
+ ] }),
2776
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2777
+ /* @__PURE__ */ e("span", { children: "Architecture:" }),
2778
+ /* @__PURE__ */ e("span", { children: a.hardware.architecture })
2779
+ ] })
2780
+ ] }),
2781
+ /* @__PURE__ */ r("section", { children: [
2782
+ /* @__PURE__ */ e("h4", { children: "Software" }),
2783
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2784
+ /* @__PURE__ */ e("span", { children: "OS:" }),
2785
+ /* @__PURE__ */ r("span", { children: [
2786
+ a.software.os,
2787
+ " ",
2788
+ a.software.osVersion
2789
+ ] })
2790
+ ] }),
2791
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2792
+ /* @__PURE__ */ e("span", { children: "Runtime:" }),
2793
+ /* @__PURE__ */ r("span", { children: [
2794
+ a.software.runtime,
2795
+ " ",
2796
+ a.software.runtimeVersion
2797
+ ] })
2798
+ ] }),
2799
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2800
+ /* @__PURE__ */ e("span", { children: "Agent:" }),
2801
+ /* @__PURE__ */ r("span", { children: [
2802
+ a.software.agent,
2803
+ " v",
2804
+ a.software.agentVersion
2805
+ ] })
2806
+ ] })
2807
+ ] }),
2808
+ /* @__PURE__ */ r("section", { children: [
2809
+ /* @__PURE__ */ e("h4", { children: "Connectivity" }),
2810
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2811
+ /* @__PURE__ */ e("span", { children: "Cloud:" }),
2812
+ /* @__PURE__ */ r("span", { children: [
2813
+ /* @__PURE__ */ e(u, { name: a.connectivity.cloudConnected ? "check" : "close", size: 12 }),
2814
+ " ",
2815
+ a.connectivity.cloudConnected ? "Connected" : "Disconnected"
2816
+ ] })
2817
+ ] }),
2818
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2819
+ /* @__PURE__ */ e("span", { children: "Network:" }),
2820
+ /* @__PURE__ */ e("span", { children: a.connectivity.localNetwork })
2821
+ ] }),
2822
+ a.connectivity.publicIP && /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2823
+ /* @__PURE__ */ e("span", { children: "Public IP:" }),
2824
+ /* @__PURE__ */ e("span", { children: a.connectivity.publicIP })
2825
+ ] }),
2826
+ a.connectivity.lastSync && /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2827
+ /* @__PURE__ */ e("span", { children: "Last Sync:" }),
2828
+ /* @__PURE__ */ e("span", { children: a.connectivity.lastSync.toLocaleString() })
2829
+ ] })
2830
+ ] }),
2831
+ a.metrics && /* @__PURE__ */ r("section", { children: [
2832
+ /* @__PURE__ */ e("h4", { children: "Resource Usage" }),
2833
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__resource-chart", children: [
2834
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__resource-item", children: [
2835
+ /* @__PURE__ */ e("span", { children: "CPU" }),
2836
+ /* @__PURE__ */ e("div", { className: "nice-edge-manager__resource-bar", children: /* @__PURE__ */ e(
2837
+ "div",
2838
+ {
2839
+ className: "nice-edge-manager__resource-fill",
2840
+ style: { width: `${a.metrics.cpuUsage}%` }
2841
+ }
2842
+ ) }),
2843
+ /* @__PURE__ */ r("span", { children: [
2844
+ a.metrics.cpuUsage.toFixed(1),
2845
+ "%"
2846
+ ] })
2847
+ ] }),
2848
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__resource-item", children: [
2849
+ /* @__PURE__ */ e("span", { children: "Memory" }),
2850
+ /* @__PURE__ */ e("div", { className: "nice-edge-manager__resource-bar", children: /* @__PURE__ */ e(
2851
+ "div",
2852
+ {
2853
+ className: "nice-edge-manager__resource-fill",
2854
+ style: { width: `${a.metrics.memoryUsage}%` }
2855
+ }
2856
+ ) }),
2857
+ /* @__PURE__ */ r("span", { children: [
2858
+ a.metrics.memoryUsage.toFixed(1),
2859
+ "%"
2860
+ ] })
2861
+ ] }),
2862
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__resource-item", children: [
2863
+ /* @__PURE__ */ e("span", { children: "Disk" }),
2864
+ /* @__PURE__ */ e("div", { className: "nice-edge-manager__resource-bar", children: /* @__PURE__ */ e(
2865
+ "div",
2866
+ {
2867
+ className: "nice-edge-manager__resource-fill",
2868
+ style: { width: `${a.metrics.diskUsage}%` }
2869
+ }
2870
+ ) }),
2871
+ /* @__PURE__ */ r("span", { children: [
2872
+ a.metrics.diskUsage.toFixed(1),
2873
+ "%"
2874
+ ] })
2875
+ ] })
2876
+ ] }),
2877
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__network-stats", children: [
2878
+ /* @__PURE__ */ r("span", { children: [
2879
+ "↓ ",
2880
+ j(a.metrics.networkIn)
2881
+ ] }),
2882
+ /* @__PURE__ */ r("span", { children: [
2883
+ "↑ ",
2884
+ j(a.metrics.networkOut)
2885
+ ] })
2886
+ ] })
2887
+ ] })
2888
+ ] })
2889
+ ] });
2890
+ }
2891
+ function De({
2892
+ config: a,
2893
+ templates: i,
2894
+ onChange: c,
2895
+ onDeploy: n,
2896
+ onClose: o
2897
+ }) {
2898
+ return /* @__PURE__ */ e("div", { className: "nice-edge-manager__dialog-overlay", children: /* @__PURE__ */ r("div", { className: "nice-edge-manager__dialog", children: [
2899
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__dialog-header", children: [
2900
+ /* @__PURE__ */ e("h3", { children: "Deploy Module" }),
2901
+ /* @__PURE__ */ e("button", { onClick: o, "aria-label": "Close", children: /* @__PURE__ */ e(u, { name: "close", size: 14 }) })
2902
+ ] }),
2903
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__dialog-content", children: [
2904
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__field", children: [
2905
+ /* @__PURE__ */ e("label", { children: "Template (optional)" }),
2906
+ /* @__PURE__ */ r(
2907
+ "select",
2908
+ {
2909
+ value: "",
2910
+ onChange: (t) => {
2911
+ const d = i.find((l) => l.image === t.target.value);
2912
+ d && c({
2913
+ ...a,
2914
+ name: d.name,
2915
+ image: d.image
2916
+ });
2917
+ },
2918
+ children: [
2919
+ /* @__PURE__ */ e("option", { value: "", children: "Select a template..." }),
2920
+ i.map((t) => /* @__PURE__ */ e("option", { value: t.image, children: t.name }, t.image))
2921
+ ]
2922
+ }
2923
+ )
2924
+ ] }),
2925
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__field", children: [
2926
+ /* @__PURE__ */ e("label", { children: "Module Name" }),
2927
+ /* @__PURE__ */ e(
2928
+ "input",
2929
+ {
2930
+ type: "text",
2931
+ value: a.name || "",
2932
+ onChange: (t) => c({ ...a, name: t.target.value }),
2933
+ placeholder: "e.g., my-module"
2934
+ }
2935
+ )
2936
+ ] }),
2937
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__field", children: [
2938
+ /* @__PURE__ */ e("label", { children: "Container Image" }),
2939
+ /* @__PURE__ */ e(
2940
+ "input",
2941
+ {
2942
+ type: "text",
2943
+ value: a.image || "",
2944
+ onChange: (t) => c({ ...a, image: t.target.value }),
2945
+ placeholder: "e.g., nginx:latest"
2946
+ }
2947
+ )
2948
+ ] }),
2949
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__field", children: [
2950
+ /* @__PURE__ */ e("label", { children: "Version" }),
2951
+ /* @__PURE__ */ e(
2952
+ "input",
2953
+ {
2954
+ type: "text",
2955
+ value: a.version || "1.0.0",
2956
+ onChange: (t) => c({ ...a, version: t.target.value })
2957
+ }
2958
+ )
2959
+ ] })
2960
+ ] }),
2961
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__dialog-footer", children: [
2962
+ /* @__PURE__ */ e("button", { onClick: o, children: "Cancel" }),
2963
+ /* @__PURE__ */ e("button", { className: "nice-edge-manager__deploy-confirm", onClick: n, children: "Deploy" })
2964
+ ] })
2965
+ ] }) });
2966
+ }
2967
+ const Q = {
2671
2968
  broker: "localhost",
2672
2969
  port: 1883,
2673
2970
  clientId: `nice2dev-${Date.now()}`,
@@ -2675,238 +2972,244 @@ const G = {
2675
2972
  keepAlive: 60,
2676
2973
  cleanSession: !0,
2677
2974
  topics: []
2678
- }, V = {
2975
+ }, J = {
2679
2976
  host: "localhost",
2680
2977
  port: 5683,
2681
2978
  useDTLS: !1,
2682
2979
  resources: []
2683
- }, Q = {
2980
+ }, K = {
2684
2981
  type: "tcp",
2685
2982
  host: "localhost",
2686
2983
  port: 502,
2687
2984
  slaveId: 1,
2688
2985
  timeout: 1e3,
2689
2986
  registers: []
2690
- }, j = {
2987
+ }, X = {
2691
2988
  endpointUrl: "opc.tcp://localhost:4840",
2692
2989
  securityMode: "None",
2693
2990
  authentication: "anonymous",
2694
2991
  applicationName: "Nice2Dev IoT Client",
2695
2992
  nodes: []
2696
2993
  };
2697
- function Ae({
2698
- protocol: r = "mqtt",
2994
+ function Oe({
2995
+ protocol: a = "mqtt",
2699
2996
  config: i,
2700
2997
  onSave: c,
2701
2998
  onTest: n,
2702
2999
  className: o = ""
2703
3000
  }) {
2704
- const { t: d } = U(), [t, l] = h(r), [g, m] = h(
2705
- (i == null ? void 0 : i.type) === "mqtt" ? { ...G, ...i.config } : G
2706
- ), [C, N] = h(
2707
- (i == null ? void 0 : i.type) === "coap" ? { ...V, ...i.config } : V
2708
- ), [v, u] = h(
2709
- (i == null ? void 0 : i.type) === "modbus" ? { ...Q, ...i.config } : Q
2710
- ), [_, H] = h(
2711
- (i == null ? void 0 : i.type) === "opcua" ? { ...j, ...i.config } : j
2712
- ), [P, x] = h(null), [R, y] = h(!1), k = w(() => {
2713
- switch (t) {
3001
+ const { t } = R(), [d, l] = y(a), [g, m] = y(
3002
+ (i == null ? void 0 : i.type) === "mqtt" ? { ...Q, ...i.config } : Q
3003
+ ), [_, w] = y(
3004
+ (i == null ? void 0 : i.type) === "coap" ? { ...J, ...i.config } : J
3005
+ ), [M, v] = y(
3006
+ (i == null ? void 0 : i.type) === "modbus" ? { ...K, ...i.config } : K
3007
+ ), [N, H] = y(
3008
+ (i == null ? void 0 : i.type) === "opcua" ? { ...X, ...i.config } : X
3009
+ ), [L, z] = y(null), [A, p] = y(!1), k = C(() => {
3010
+ switch (d) {
2714
3011
  case "mqtt":
2715
3012
  return g;
2716
3013
  case "coap":
2717
- return C;
3014
+ return _;
2718
3015
  case "modbus-tcp":
2719
3016
  case "modbus-rtu":
2720
- return v;
3017
+ return M;
2721
3018
  case "opcua":
2722
- return _;
3019
+ return N;
2723
3020
  default:
2724
3021
  return g;
2725
3022
  }
2726
- }, [t, g, C, v, _]), L = w(() => {
3023
+ }, [d, g, _, M, N]), E = C(() => {
2727
3024
  c == null || c(k());
2728
- }, [k, c]), $ = w(async () => {
3025
+ }, [k, c]), U = C(async () => {
2729
3026
  if (n) {
2730
- y(!0), x(null);
3027
+ p(!0), z(null);
2731
3028
  try {
2732
- const M = await n(k());
2733
- x(M);
2734
- } catch (M) {
2735
- x({ success: !1, message: String(M) });
3029
+ const T = await n(k());
3030
+ z(T);
3031
+ } catch (T) {
3032
+ z({ success: !1, message: String(T) });
2736
3033
  } finally {
2737
- y(!1);
3034
+ p(!1);
2738
3035
  }
2739
3036
  }
2740
3037
  }, [k, n]);
2741
- return /* @__PURE__ */ a("div", { className: `nice-protocol-config ${o}`, children: [
2742
- /* @__PURE__ */ a("header", { className: "nice-protocol-config__header", children: [
2743
- /* @__PURE__ */ e("h2", { children: d("protocolConfig.title", "Protocol Configuration") }),
2744
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__protocol-selector", children: [
3038
+ return /* @__PURE__ */ r("div", { className: `nice-protocol-config ${o}`, children: [
3039
+ /* @__PURE__ */ r("header", { className: "nice-protocol-config__header", children: [
3040
+ /* @__PURE__ */ e("h2", { children: t("protocolConfig.title", "Protocol Configuration") }),
3041
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__protocol-selector", children: [
2745
3042
  /* @__PURE__ */ e("label", { children: "Protocol:" }),
2746
- /* @__PURE__ */ a("select", { value: t, onChange: (M) => l(M.target.value), children: [
2747
- /* @__PURE__ */ e("option", { value: "mqtt", children: d("protocolConfig.mqtt", "MQTT") }),
2748
- /* @__PURE__ */ e("option", { value: "coap", children: d("protocolConfig.coap", "CoAP") }),
2749
- /* @__PURE__ */ e("option", { value: "modbus-tcp", children: d("protocolConfig.modbusTcp", "Modbus TCP") }),
2750
- /* @__PURE__ */ e("option", { value: "modbus-rtu", children: d("protocolConfig.modbusRtu", "Modbus RTU") }),
2751
- /* @__PURE__ */ e("option", { value: "opcua", children: d("protocolConfig.opcUa", "OPC-UA") })
3043
+ /* @__PURE__ */ r("select", { value: d, onChange: (T) => l(T.target.value), children: [
3044
+ /* @__PURE__ */ e("option", { value: "mqtt", children: t("protocolConfig.mqtt", "MQTT") }),
3045
+ /* @__PURE__ */ e("option", { value: "coap", children: t("protocolConfig.coap", "CoAP") }),
3046
+ /* @__PURE__ */ e("option", { value: "modbus-tcp", children: t("protocolConfig.modbusTcp", "Modbus TCP") }),
3047
+ /* @__PURE__ */ e("option", { value: "modbus-rtu", children: t("protocolConfig.modbusRtu", "Modbus RTU") }),
3048
+ /* @__PURE__ */ e("option", { value: "opcua", children: t("protocolConfig.opcUa", "OPC-UA") })
2752
3049
  ] })
2753
3050
  ] })
2754
3051
  ] }),
2755
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__content", children: [
2756
- t === "mqtt" && /* @__PURE__ */ e(Te, { config: g, onChange: m }),
2757
- t === "coap" && /* @__PURE__ */ e(Pe, { config: C, onChange: N }),
2758
- (t === "modbus-tcp" || t === "modbus-rtu") && /* @__PURE__ */ e(
2759
- Me,
3052
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__content", children: [
3053
+ d === "mqtt" && /* @__PURE__ */ e(Pe, { config: g, onChange: m }),
3054
+ d === "coap" && /* @__PURE__ */ e(Re, { config: _, onChange: w }),
3055
+ (d === "modbus-tcp" || d === "modbus-rtu") && /* @__PURE__ */ e(
3056
+ Ie,
2760
3057
  {
2761
- config: v,
2762
- type: t === "modbus-rtu" ? "rtu" : "tcp",
2763
- onChange: u
3058
+ config: M,
3059
+ type: d === "modbus-rtu" ? "rtu" : "tcp",
3060
+ onChange: v
2764
3061
  }
2765
3062
  ),
2766
- t === "opcua" && /* @__PURE__ */ e(De, { config: _, onChange: H })
3063
+ d === "opcua" && /* @__PURE__ */ e(Ee, { config: N, onChange: H })
2767
3064
  ] }),
2768
- P && /* @__PURE__ */ a(
3065
+ L && /* @__PURE__ */ r(
2769
3066
  "div",
2770
3067
  {
2771
- className: `nice-protocol-config__test-result nice-protocol-config__test-result--${P.success ? "success" : "error"}`,
3068
+ className: `nice-protocol-config__test-result nice-protocol-config__test-result--${L.success ? "success" : "error"}`,
2772
3069
  children: [
2773
- P.success ? "βœ“" : "βœ—",
3070
+ /* @__PURE__ */ e(u, { name: L.success ? "check" : "close", size: 14 }),
2774
3071
  " ",
2775
- P.message
3072
+ L.message
2776
3073
  ]
2777
3074
  }
2778
3075
  ),
2779
- /* @__PURE__ */ a("footer", { className: "nice-protocol-config__footer", children: [
3076
+ /* @__PURE__ */ r("footer", { className: "nice-protocol-config__footer", children: [
2780
3077
  /* @__PURE__ */ e(
2781
3078
  "button",
2782
3079
  {
2783
3080
  className: "nice-protocol-config__test-btn",
2784
- onClick: $,
2785
- disabled: R || !n,
2786
- children: R ? "Testing..." : "πŸ”Œ Test Connection"
3081
+ onClick: U,
3082
+ disabled: A || !n,
3083
+ children: A ? "Testing..." : /* @__PURE__ */ r(D, { children: [
3084
+ /* @__PURE__ */ e(u, { name: "plug", size: 14 }),
3085
+ " Test Connection"
3086
+ ] })
2787
3087
  }
2788
3088
  ),
2789
- /* @__PURE__ */ e("button", { className: "nice-protocol-config__save-btn", onClick: L, children: "πŸ’Ύ Save" })
3089
+ /* @__PURE__ */ r("button", { className: "nice-protocol-config__save-btn", onClick: E, children: [
3090
+ /* @__PURE__ */ e(u, { name: "save", size: 14 }),
3091
+ " Save"
3092
+ ] })
2790
3093
  ] })
2791
3094
  ] });
2792
3095
  }
2793
- function Te({ config: r, onChange: i }) {
2794
- const { t: c } = U();
2795
- return /* @__PURE__ */ a("div", { className: "nice-protocol-config__section", children: [
3096
+ function Pe({ config: a, onChange: i }) {
3097
+ const { t: c } = R();
3098
+ return /* @__PURE__ */ r("div", { className: "nice-protocol-config__section", children: [
2796
3099
  /* @__PURE__ */ e("h3", { children: c("protocolConfig.mqttConfiguration", "MQTT Configuration") }),
2797
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__grid", children: [
2798
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3100
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__grid", children: [
3101
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
2799
3102
  /* @__PURE__ */ e("label", { children: c("protocolConfig.broker", "Broker") }),
2800
3103
  /* @__PURE__ */ e(
2801
3104
  "input",
2802
3105
  {
2803
3106
  type: "text",
2804
- value: r.broker,
2805
- onChange: (n) => i({ ...r, broker: n.target.value }),
3107
+ value: a.broker,
3108
+ onChange: (n) => i({ ...a, broker: n.target.value }),
2806
3109
  placeholder: "localhost"
2807
3110
  }
2808
3111
  )
2809
3112
  ] }),
2810
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3113
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
2811
3114
  /* @__PURE__ */ e("label", { children: c("protocolConfig.port", "Port") }),
2812
3115
  /* @__PURE__ */ e(
2813
3116
  "input",
2814
3117
  {
2815
3118
  type: "number",
2816
- value: r.port,
2817
- onChange: (n) => i({ ...r, port: parseInt(n.target.value, 10) || 1883 })
3119
+ value: a.port,
3120
+ onChange: (n) => i({ ...a, port: parseInt(n.target.value, 10) || 1883 })
2818
3121
  }
2819
3122
  )
2820
3123
  ] }),
2821
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3124
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
2822
3125
  /* @__PURE__ */ e("label", { children: c("protocolConfig.clientId", "Client ID") }),
2823
3126
  /* @__PURE__ */ e(
2824
3127
  "input",
2825
3128
  {
2826
3129
  type: "text",
2827
- value: r.clientId,
2828
- onChange: (n) => i({ ...r, clientId: n.target.value })
3130
+ value: a.clientId,
3131
+ onChange: (n) => i({ ...a, clientId: n.target.value })
2829
3132
  }
2830
3133
  )
2831
3134
  ] }),
2832
- /* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ a("label", { children: [
3135
+ /* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ r("label", { children: [
2833
3136
  /* @__PURE__ */ e(
2834
3137
  "input",
2835
3138
  {
2836
3139
  type: "checkbox",
2837
- checked: r.useTLS,
2838
- onChange: (n) => i({ ...r, useTLS: n.target.checked })
3140
+ checked: a.useTLS,
3141
+ onChange: (n) => i({ ...a, useTLS: n.target.checked })
2839
3142
  }
2840
3143
  ),
2841
3144
  c("protocolConfig.useTls", "Use TLS")
2842
3145
  ] }) }),
2843
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3146
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
2844
3147
  /* @__PURE__ */ e("label", { children: c("protocolConfig.username", "Username") }),
2845
3148
  /* @__PURE__ */ e(
2846
3149
  "input",
2847
3150
  {
2848
3151
  type: "text",
2849
- value: r.username || "",
2850
- onChange: (n) => i({ ...r, username: n.target.value })
3152
+ value: a.username || "",
3153
+ onChange: (n) => i({ ...a, username: n.target.value })
2851
3154
  }
2852
3155
  )
2853
3156
  ] }),
2854
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3157
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
2855
3158
  /* @__PURE__ */ e("label", { children: c("protocolConfig.password", "Password") }),
2856
3159
  /* @__PURE__ */ e(
2857
3160
  "input",
2858
3161
  {
2859
3162
  type: "password",
2860
- value: r.password || "",
2861
- onChange: (n) => i({ ...r, password: n.target.value })
3163
+ value: a.password || "",
3164
+ onChange: (n) => i({ ...a, password: n.target.value })
2862
3165
  }
2863
3166
  )
2864
3167
  ] }),
2865
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3168
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
2866
3169
  /* @__PURE__ */ e("label", { children: "Keep Alive (seconds)" }),
2867
3170
  /* @__PURE__ */ e(
2868
3171
  "input",
2869
3172
  {
2870
3173
  type: "number",
2871
- value: r.keepAlive,
2872
- onChange: (n) => i({ ...r, keepAlive: parseInt(n.target.value, 10) || 60 })
3174
+ value: a.keepAlive,
3175
+ onChange: (n) => i({ ...a, keepAlive: parseInt(n.target.value, 10) || 60 })
2873
3176
  }
2874
3177
  )
2875
3178
  ] }),
2876
- /* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ a("label", { children: [
3179
+ /* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ r("label", { children: [
2877
3180
  /* @__PURE__ */ e(
2878
3181
  "input",
2879
3182
  {
2880
3183
  type: "checkbox",
2881
- checked: r.cleanSession,
2882
- onChange: (n) => i({ ...r, cleanSession: n.target.checked })
3184
+ checked: a.cleanSession,
3185
+ onChange: (n) => i({ ...a, cleanSession: n.target.checked })
2883
3186
  }
2884
3187
  ),
2885
3188
  c("protocolConfig.cleanSession", "Clean Session")
2886
3189
  ] }) })
2887
3190
  ] }),
2888
3191
  /* @__PURE__ */ e("h4", { children: c("protocolConfig.topics", "Topics") }),
2889
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__topics", children: [
2890
- r.topics.map((n, o) => /* @__PURE__ */ a("div", { className: "nice-protocol-config__topic-row", children: [
3192
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__topics", children: [
3193
+ a.topics.map((n, o) => /* @__PURE__ */ r("div", { className: "nice-protocol-config__topic-row", children: [
2891
3194
  /* @__PURE__ */ e(
2892
3195
  "input",
2893
3196
  {
2894
3197
  type: "text",
2895
3198
  value: n.pattern,
2896
- onChange: (d) => {
2897
- const t = [...r.topics];
2898
- t[o] = { ...t[o], pattern: d.target.value }, i({ ...r, topics: t });
3199
+ onChange: (t) => {
3200
+ const d = [...a.topics];
3201
+ d[o] = { ...d[o], pattern: t.target.value }, i({ ...a, topics: d });
2899
3202
  },
2900
3203
  placeholder: c("protocolConfig.topicPatternPlaceholder", "e.g., sensors/+/data")
2901
3204
  }
2902
3205
  ),
2903
- /* @__PURE__ */ a(
3206
+ /* @__PURE__ */ r(
2904
3207
  "select",
2905
3208
  {
2906
3209
  value: n.qos,
2907
- onChange: (d) => {
2908
- const t = [...r.topics];
2909
- t[o] = { ...t[o], qos: parseInt(d.target.value, 10) }, i({ ...r, topics: t });
3210
+ onChange: (t) => {
3211
+ const d = [...a.topics];
3212
+ d[o] = { ...d[o], qos: parseInt(t.target.value, 10) }, i({ ...a, topics: d });
2910
3213
  },
2911
3214
  children: [
2912
3215
  /* @__PURE__ */ e("option", { value: 0, children: c("protocolConfig.qos0", "QoS 0") }),
@@ -2915,16 +3218,16 @@ function Te({ config: r, onChange: i }) {
2915
3218
  ]
2916
3219
  }
2917
3220
  ),
2918
- /* @__PURE__ */ a(
3221
+ /* @__PURE__ */ r(
2919
3222
  "select",
2920
3223
  {
2921
3224
  value: n.direction,
2922
- onChange: (d) => {
2923
- const t = [...r.topics];
2924
- t[o] = {
2925
- ...t[o],
2926
- direction: d.target.value
2927
- }, i({ ...r, topics: t });
3225
+ onChange: (t) => {
3226
+ const d = [...a.topics];
3227
+ d[o] = {
3228
+ ...d[o],
3229
+ direction: t.target.value
3230
+ }, i({ ...a, topics: d });
2928
3231
  },
2929
3232
  children: [
2930
3233
  /* @__PURE__ */ e("option", { value: "subscribe", children: c("protocolConfig.subscribe", "Subscribe") }),
@@ -2937,8 +3240,8 @@ function Te({ config: r, onChange: i }) {
2937
3240
  "button",
2938
3241
  {
2939
3242
  onClick: () => {
2940
- const d = r.topics.filter((t, l) => l !== o);
2941
- i({ ...r, topics: d });
3243
+ const t = a.topics.filter((d, l) => l !== o);
3244
+ i({ ...a, topics: t });
2942
3245
  },
2943
3246
  children: "Γ—"
2944
3247
  }
@@ -2949,9 +3252,9 @@ function Te({ config: r, onChange: i }) {
2949
3252
  {
2950
3253
  onClick: () => {
2951
3254
  i({
2952
- ...r,
3255
+ ...a,
2953
3256
  topics: [
2954
- ...r.topics,
3257
+ ...a.topics,
2955
3258
  { pattern: "", qos: 0, direction: "subscribe", payloadFormat: "json" }
2956
3259
  ]
2957
3260
  });
@@ -2962,67 +3265,67 @@ function Te({ config: r, onChange: i }) {
2962
3265
  ] })
2963
3266
  ] });
2964
3267
  }
2965
- function Pe({ config: r, onChange: i }) {
2966
- const { t: c } = U();
2967
- return /* @__PURE__ */ a("div", { className: "nice-protocol-config__section", children: [
3268
+ function Re({ config: a, onChange: i }) {
3269
+ const { t: c } = R();
3270
+ return /* @__PURE__ */ r("div", { className: "nice-protocol-config__section", children: [
2968
3271
  /* @__PURE__ */ e("h3", { children: c("protocolConfig.coapConfiguration", "CoAP Configuration") }),
2969
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__grid", children: [
2970
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3272
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__grid", children: [
3273
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
2971
3274
  /* @__PURE__ */ e("label", { children: c("protocolConfig.host", "Host") }),
2972
3275
  /* @__PURE__ */ e(
2973
3276
  "input",
2974
3277
  {
2975
3278
  type: "text",
2976
- value: r.host,
2977
- onChange: (n) => i({ ...r, host: n.target.value })
3279
+ value: a.host,
3280
+ onChange: (n) => i({ ...a, host: n.target.value })
2978
3281
  }
2979
3282
  )
2980
3283
  ] }),
2981
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3284
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
2982
3285
  /* @__PURE__ */ e("label", { children: c("protocolConfig.port", "Port") }),
2983
3286
  /* @__PURE__ */ e(
2984
3287
  "input",
2985
3288
  {
2986
3289
  type: "number",
2987
- value: r.port,
2988
- onChange: (n) => i({ ...r, port: parseInt(n.target.value, 10) || 5683 })
3290
+ value: a.port,
3291
+ onChange: (n) => i({ ...a, port: parseInt(n.target.value, 10) || 5683 })
2989
3292
  }
2990
3293
  )
2991
3294
  ] }),
2992
- /* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ a("label", { children: [
3295
+ /* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ r("label", { children: [
2993
3296
  /* @__PURE__ */ e(
2994
3297
  "input",
2995
3298
  {
2996
3299
  type: "checkbox",
2997
- checked: r.useDTLS,
2998
- onChange: (n) => i({ ...r, useDTLS: n.target.checked })
3300
+ checked: a.useDTLS,
3301
+ onChange: (n) => i({ ...a, useDTLS: n.target.checked })
2999
3302
  }
3000
3303
  ),
3001
3304
  c("protocolConfig.useDtls", "Use DTLS")
3002
3305
  ] }) }),
3003
- /* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ a("label", { children: [
3306
+ /* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ r("label", { children: [
3004
3307
  /* @__PURE__ */ e(
3005
3308
  "input",
3006
3309
  {
3007
3310
  type: "checkbox",
3008
- checked: r.observe || !1,
3009
- onChange: (n) => i({ ...r, observe: n.target.checked })
3311
+ checked: a.observe || !1,
3312
+ onChange: (n) => i({ ...a, observe: n.target.checked })
3010
3313
  }
3011
3314
  ),
3012
3315
  c("protocolConfig.enableObserve", "Enable Observe")
3013
3316
  ] }) })
3014
3317
  ] }),
3015
3318
  /* @__PURE__ */ e("h4", { children: c("protocolConfig.resources", "Resources") }),
3016
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__resources", children: [
3017
- r.resources.map((n, o) => /* @__PURE__ */ a("div", { className: "nice-protocol-config__resource-row", children: [
3319
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__resources", children: [
3320
+ a.resources.map((n, o) => /* @__PURE__ */ r("div", { className: "nice-protocol-config__resource-row", children: [
3018
3321
  /* @__PURE__ */ e(
3019
3322
  "input",
3020
3323
  {
3021
3324
  type: "text",
3022
3325
  value: n.path,
3023
- onChange: (d) => {
3024
- const t = [...r.resources];
3025
- t[o] = { ...t[o], path: d.target.value }, i({ ...r, resources: t });
3326
+ onChange: (t) => {
3327
+ const d = [...a.resources];
3328
+ d[o] = { ...d[o], path: t.target.value }, i({ ...a, resources: d });
3026
3329
  },
3027
3330
  placeholder: "/sensors/temperature"
3028
3331
  }
@@ -3031,8 +3334,8 @@ function Pe({ config: r, onChange: i }) {
3031
3334
  "button",
3032
3335
  {
3033
3336
  onClick: () => {
3034
- const d = r.resources.filter((t, l) => l !== o);
3035
- i({ ...r, resources: d });
3337
+ const t = a.resources.filter((d, l) => l !== o);
3338
+ i({ ...a, resources: t });
3036
3339
  },
3037
3340
  children: "Γ—"
3038
3341
  }
@@ -3043,9 +3346,9 @@ function Pe({ config: r, onChange: i }) {
3043
3346
  {
3044
3347
  onClick: () => {
3045
3348
  i({
3046
- ...r,
3349
+ ...a,
3047
3350
  resources: [
3048
- ...r.resources,
3351
+ ...a.resources,
3049
3352
  { path: "", methods: ["GET"], mediaType: "application/json", observable: !1 }
3050
3353
  ]
3051
3354
  });
@@ -3056,63 +3359,63 @@ function Pe({ config: r, onChange: i }) {
3056
3359
  ] })
3057
3360
  ] });
3058
3361
  }
3059
- function Me({
3060
- config: r,
3362
+ function Ie({
3363
+ config: a,
3061
3364
  type: i,
3062
3365
  onChange: c
3063
3366
  }) {
3064
- const { t: n } = U();
3065
- return /* @__PURE__ */ a("div", { className: "nice-protocol-config__section", children: [
3066
- /* @__PURE__ */ a("h3", { children: [
3367
+ const { t: n } = R();
3368
+ return /* @__PURE__ */ r("div", { className: "nice-protocol-config__section", children: [
3369
+ /* @__PURE__ */ r("h3", { children: [
3067
3370
  "Modbus ",
3068
3371
  i.toUpperCase(),
3069
3372
  " Configuration"
3070
3373
  ] }),
3071
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__grid", children: [
3072
- i === "tcp" && /* @__PURE__ */ a(E, { children: [
3073
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3374
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__grid", children: [
3375
+ i === "tcp" && /* @__PURE__ */ r(D, { children: [
3376
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3074
3377
  /* @__PURE__ */ e("label", { children: n("protocolConfig.host", "Host") }),
3075
3378
  /* @__PURE__ */ e(
3076
3379
  "input",
3077
3380
  {
3078
3381
  type: "text",
3079
- value: r.host || "",
3080
- onChange: (o) => c({ ...r, host: o.target.value })
3382
+ value: a.host || "",
3383
+ onChange: (o) => c({ ...a, host: o.target.value })
3081
3384
  }
3082
3385
  )
3083
3386
  ] }),
3084
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3387
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3085
3388
  /* @__PURE__ */ e("label", { children: n("protocolConfig.port", "Port") }),
3086
3389
  /* @__PURE__ */ e(
3087
3390
  "input",
3088
3391
  {
3089
3392
  type: "number",
3090
- value: r.port || 502,
3091
- onChange: (o) => c({ ...r, port: parseInt(o.target.value, 10) || 502 })
3393
+ value: a.port || 502,
3394
+ onChange: (o) => c({ ...a, port: parseInt(o.target.value, 10) || 502 })
3092
3395
  }
3093
3396
  )
3094
3397
  ] })
3095
3398
  ] }),
3096
- i === "rtu" && /* @__PURE__ */ a(E, { children: [
3097
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3399
+ i === "rtu" && /* @__PURE__ */ r(D, { children: [
3400
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3098
3401
  /* @__PURE__ */ e("label", { children: n("protocolConfig.serialPort", "Serial Port") }),
3099
3402
  /* @__PURE__ */ e(
3100
3403
  "input",
3101
3404
  {
3102
3405
  type: "text",
3103
- value: r.serialPort || "",
3104
- onChange: (o) => c({ ...r, serialPort: o.target.value }),
3406
+ value: a.serialPort || "",
3407
+ onChange: (o) => c({ ...a, serialPort: o.target.value }),
3105
3408
  placeholder: n("protocolConfig.serialPortPlaceholder", "COM1 or /dev/ttyUSB0")
3106
3409
  }
3107
3410
  )
3108
3411
  ] }),
3109
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3412
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3110
3413
  /* @__PURE__ */ e("label", { children: n("protocolConfig.baudRate", "Baud Rate") }),
3111
- /* @__PURE__ */ a(
3414
+ /* @__PURE__ */ r(
3112
3415
  "select",
3113
3416
  {
3114
- value: r.baudRate || 9600,
3115
- onChange: (o) => c({ ...r, baudRate: parseInt(o.target.value, 10) }),
3417
+ value: a.baudRate || 9600,
3418
+ onChange: (o) => c({ ...a, baudRate: parseInt(o.target.value, 10) }),
3116
3419
  children: [
3117
3420
  /* @__PURE__ */ e("option", { value: 9600, children: "9600" }),
3118
3421
  /* @__PURE__ */ e("option", { value: 19200, children: "19200" }),
@@ -3123,13 +3426,13 @@ function Me({
3123
3426
  }
3124
3427
  )
3125
3428
  ] }),
3126
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3429
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3127
3430
  /* @__PURE__ */ e("label", { children: n("protocolConfig.parity", "Parity") }),
3128
- /* @__PURE__ */ a(
3431
+ /* @__PURE__ */ r(
3129
3432
  "select",
3130
3433
  {
3131
- value: r.parity || "none",
3132
- onChange: (o) => c({ ...r, parity: o.target.value }),
3434
+ value: a.parity || "none",
3435
+ onChange: (o) => c({ ...a, parity: o.target.value }),
3133
3436
  children: [
3134
3437
  /* @__PURE__ */ e("option", { value: "none", children: n("protocolConfig.none", "None") }),
3135
3438
  /* @__PURE__ */ e("option", { value: "even", children: n("protocolConfig.even", "Even") }),
@@ -3139,34 +3442,34 @@ function Me({
3139
3442
  )
3140
3443
  ] })
3141
3444
  ] }),
3142
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3445
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3143
3446
  /* @__PURE__ */ e("label", { children: n("protocolConfig.slaveId", "Slave ID") }),
3144
3447
  /* @__PURE__ */ e(
3145
3448
  "input",
3146
3449
  {
3147
3450
  type: "number",
3148
- value: r.slaveId,
3149
- onChange: (o) => c({ ...r, slaveId: parseInt(o.target.value, 10) || 1 }),
3451
+ value: a.slaveId,
3452
+ onChange: (o) => c({ ...a, slaveId: parseInt(o.target.value, 10) || 1 }),
3150
3453
  min: 1,
3151
3454
  max: 247
3152
3455
  }
3153
3456
  )
3154
3457
  ] }),
3155
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3458
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3156
3459
  /* @__PURE__ */ e("label", { children: "Timeout (ms)" }),
3157
3460
  /* @__PURE__ */ e(
3158
3461
  "input",
3159
3462
  {
3160
3463
  type: "number",
3161
- value: r.timeout,
3162
- onChange: (o) => c({ ...r, timeout: parseInt(o.target.value, 10) || 1e3 })
3464
+ value: a.timeout,
3465
+ onChange: (o) => c({ ...a, timeout: parseInt(o.target.value, 10) || 1e3 })
3163
3466
  }
3164
3467
  )
3165
3468
  ] })
3166
3469
  ] }),
3167
3470
  /* @__PURE__ */ e("h4", { children: n("protocolConfig.registers", "Registers") }),
3168
- /* @__PURE__ */ a("table", { className: "nice-protocol-config__registers-table", children: [
3169
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ a("tr", { children: [
3471
+ /* @__PURE__ */ r("table", { className: "nice-protocol-config__registers-table", children: [
3472
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ r("tr", { children: [
3170
3473
  /* @__PURE__ */ e("th", { children: n("protocolConfig.name", "Name") }),
3171
3474
  /* @__PURE__ */ e("th", { children: n("protocolConfig.address", "Address") }),
3172
3475
  /* @__PURE__ */ e("th", { children: n("protocolConfig.type", "Type") }),
@@ -3174,15 +3477,15 @@ function Me({
3174
3477
  /* @__PURE__ */ e("th", { children: "R/W" }),
3175
3478
  /* @__PURE__ */ e("th", {})
3176
3479
  ] }) }),
3177
- /* @__PURE__ */ e("tbody", { children: r.registers.map((o, d) => /* @__PURE__ */ a("tr", { children: [
3480
+ /* @__PURE__ */ e("tbody", { children: a.registers.map((o, t) => /* @__PURE__ */ r("tr", { children: [
3178
3481
  /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
3179
3482
  "input",
3180
3483
  {
3181
3484
  type: "text",
3182
3485
  value: o.name,
3183
- onChange: (t) => {
3184
- const l = [...r.registers];
3185
- l[d] = { ...l[d], name: t.target.value }, c({ ...r, registers: l });
3486
+ onChange: (d) => {
3487
+ const l = [...a.registers];
3488
+ l[t] = { ...l[t], name: d.target.value }, c({ ...a, registers: l });
3186
3489
  }
3187
3490
  }
3188
3491
  ) }),
@@ -3191,25 +3494,25 @@ function Me({
3191
3494
  {
3192
3495
  type: "number",
3193
3496
  value: o.address,
3194
- onChange: (t) => {
3195
- const l = [...r.registers];
3196
- l[d] = {
3197
- ...l[d],
3198
- address: parseInt(t.target.value, 10) || 0
3199
- }, c({ ...r, registers: l });
3497
+ onChange: (d) => {
3498
+ const l = [...a.registers];
3499
+ l[t] = {
3500
+ ...l[t],
3501
+ address: parseInt(d.target.value, 10) || 0
3502
+ }, c({ ...a, registers: l });
3200
3503
  }
3201
3504
  }
3202
3505
  ) }),
3203
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ a(
3506
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ r(
3204
3507
  "select",
3205
3508
  {
3206
3509
  value: o.type,
3207
- onChange: (t) => {
3208
- const l = [...r.registers];
3209
- l[d] = {
3210
- ...l[d],
3211
- type: t.target.value
3212
- }, c({ ...r, registers: l });
3510
+ onChange: (d) => {
3511
+ const l = [...a.registers];
3512
+ l[t] = {
3513
+ ...l[t],
3514
+ type: d.target.value
3515
+ }, c({ ...a, registers: l });
3213
3516
  },
3214
3517
  children: [
3215
3518
  /* @__PURE__ */ e("option", { value: "coil", children: n("protocolConfig.coil", "Coil") }),
@@ -3219,16 +3522,16 @@ function Me({
3219
3522
  ]
3220
3523
  }
3221
3524
  ) }),
3222
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ a(
3525
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ r(
3223
3526
  "select",
3224
3527
  {
3225
3528
  value: o.dataType,
3226
- onChange: (t) => {
3227
- const l = [...r.registers];
3228
- l[d] = {
3229
- ...l[d],
3230
- dataType: t.target.value
3231
- }, c({ ...r, registers: l });
3529
+ onChange: (d) => {
3530
+ const l = [...a.registers];
3531
+ l[t] = {
3532
+ ...l[t],
3533
+ dataType: d.target.value
3534
+ }, c({ ...a, registers: l });
3232
3535
  },
3233
3536
  children: [
3234
3537
  /* @__PURE__ */ e("option", { value: "bool", children: n("protocolConfig.bool", "Bool") }),
@@ -3240,15 +3543,15 @@ function Me({
3240
3543
  ]
3241
3544
  }
3242
3545
  ) }),
3243
- /* @__PURE__ */ a("td", { children: [
3546
+ /* @__PURE__ */ r("td", { children: [
3244
3547
  /* @__PURE__ */ e(
3245
3548
  "input",
3246
3549
  {
3247
3550
  type: "checkbox",
3248
3551
  checked: o.readable,
3249
- onChange: (t) => {
3250
- const l = [...r.registers];
3251
- l[d] = { ...l[d], readable: t.target.checked }, c({ ...r, registers: l });
3552
+ onChange: (d) => {
3553
+ const l = [...a.registers];
3554
+ l[t] = { ...l[t], readable: d.target.checked }, c({ ...a, registers: l });
3252
3555
  },
3253
3556
  title: n("protocolConfig.readable", "Readable")
3254
3557
  }
@@ -3258,9 +3561,9 @@ function Me({
3258
3561
  {
3259
3562
  type: "checkbox",
3260
3563
  checked: o.writable,
3261
- onChange: (t) => {
3262
- const l = [...r.registers];
3263
- l[d] = { ...l[d], writable: t.target.checked }, c({ ...r, registers: l });
3564
+ onChange: (d) => {
3565
+ const l = [...a.registers];
3566
+ l[t] = { ...l[t], writable: d.target.checked }, c({ ...a, registers: l });
3264
3567
  },
3265
3568
  title: n("protocolConfig.writable", "Writable")
3266
3569
  }
@@ -3270,22 +3573,22 @@ function Me({
3270
3573
  "button",
3271
3574
  {
3272
3575
  onClick: () => {
3273
- const t = r.registers.filter((l, g) => g !== d);
3274
- c({ ...r, registers: t });
3576
+ const d = a.registers.filter((l, g) => g !== t);
3577
+ c({ ...a, registers: d });
3275
3578
  },
3276
3579
  children: "Γ—"
3277
3580
  }
3278
3581
  ) })
3279
- ] }, d)) })
3582
+ ] }, t)) })
3280
3583
  ] }),
3281
3584
  /* @__PURE__ */ e(
3282
3585
  "button",
3283
3586
  {
3284
3587
  onClick: () => {
3285
3588
  c({
3286
- ...r,
3589
+ ...a,
3287
3590
  registers: [
3288
- ...r.registers,
3591
+ ...a.registers,
3289
3592
  {
3290
3593
  name: "",
3291
3594
  address: 0,
@@ -3302,31 +3605,31 @@ function Me({
3302
3605
  )
3303
3606
  ] });
3304
3607
  }
3305
- function De({ config: r, onChange: i }) {
3306
- const { t: c } = U();
3307
- return /* @__PURE__ */ a("div", { className: "nice-protocol-config__section", children: [
3608
+ function Ee({ config: a, onChange: i }) {
3609
+ const { t: c } = R();
3610
+ return /* @__PURE__ */ r("div", { className: "nice-protocol-config__section", children: [
3308
3611
  /* @__PURE__ */ e("h3", { children: c("protocolConfig.opcUaConfiguration", "OPC-UA Configuration") }),
3309
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__grid", children: [
3310
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field nice-protocol-config__field--full", children: [
3612
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__grid", children: [
3613
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field nice-protocol-config__field--full", children: [
3311
3614
  /* @__PURE__ */ e("label", { children: c("protocolConfig.endpointUrl", "Endpoint URL") }),
3312
3615
  /* @__PURE__ */ e(
3313
3616
  "input",
3314
3617
  {
3315
3618
  type: "text",
3316
- value: r.endpointUrl,
3317
- onChange: (n) => i({ ...r, endpointUrl: n.target.value }),
3619
+ value: a.endpointUrl,
3620
+ onChange: (n) => i({ ...a, endpointUrl: n.target.value }),
3318
3621
  placeholder: c("protocolConfig.endpointUrlPlaceholder", "opc.tcp://localhost:4840")
3319
3622
  }
3320
3623
  )
3321
3624
  ] }),
3322
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3625
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3323
3626
  /* @__PURE__ */ e("label", { children: c("protocolConfig.securityMode", "Security Mode") }),
3324
- /* @__PURE__ */ a(
3627
+ /* @__PURE__ */ r(
3325
3628
  "select",
3326
3629
  {
3327
- value: r.securityMode,
3630
+ value: a.securityMode,
3328
3631
  onChange: (n) => i({
3329
- ...r,
3632
+ ...a,
3330
3633
  securityMode: n.target.value
3331
3634
  }),
3332
3635
  children: [
@@ -3337,14 +3640,14 @@ function De({ config: r, onChange: i }) {
3337
3640
  }
3338
3641
  )
3339
3642
  ] }),
3340
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3643
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3341
3644
  /* @__PURE__ */ e("label", { children: c("protocolConfig.authentication", "Authentication") }),
3342
- /* @__PURE__ */ a(
3645
+ /* @__PURE__ */ r(
3343
3646
  "select",
3344
3647
  {
3345
- value: r.authentication,
3648
+ value: a.authentication,
3346
3649
  onChange: (n) => i({
3347
- ...r,
3650
+ ...a,
3348
3651
  authentication: n.target.value
3349
3652
  }),
3350
3653
  children: [
@@ -3355,53 +3658,53 @@ function De({ config: r, onChange: i }) {
3355
3658
  }
3356
3659
  )
3357
3660
  ] }),
3358
- r.authentication === "username" && /* @__PURE__ */ a(E, { children: [
3359
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3661
+ a.authentication === "username" && /* @__PURE__ */ r(D, { children: [
3662
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3360
3663
  /* @__PURE__ */ e("label", { children: c("protocolConfig.username", "Username") }),
3361
3664
  /* @__PURE__ */ e(
3362
3665
  "input",
3363
3666
  {
3364
3667
  type: "text",
3365
- value: r.username || "",
3366
- onChange: (n) => i({ ...r, username: n.target.value })
3668
+ value: a.username || "",
3669
+ onChange: (n) => i({ ...a, username: n.target.value })
3367
3670
  }
3368
3671
  )
3369
3672
  ] }),
3370
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3673
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3371
3674
  /* @__PURE__ */ e("label", { children: c("protocolConfig.password", "Password") }),
3372
3675
  /* @__PURE__ */ e(
3373
3676
  "input",
3374
3677
  {
3375
3678
  type: "password",
3376
- value: r.password || "",
3377
- onChange: (n) => i({ ...r, password: n.target.value })
3679
+ value: a.password || "",
3680
+ onChange: (n) => i({ ...a, password: n.target.value })
3378
3681
  }
3379
3682
  )
3380
3683
  ] })
3381
3684
  ] }),
3382
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field nice-protocol-config__field--full", children: [
3685
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field nice-protocol-config__field--full", children: [
3383
3686
  /* @__PURE__ */ e("label", { children: c("protocolConfig.applicationName", "Application Name") }),
3384
3687
  /* @__PURE__ */ e(
3385
3688
  "input",
3386
3689
  {
3387
3690
  type: "text",
3388
- value: r.applicationName,
3389
- onChange: (n) => i({ ...r, applicationName: n.target.value })
3691
+ value: a.applicationName,
3692
+ onChange: (n) => i({ ...a, applicationName: n.target.value })
3390
3693
  }
3391
3694
  )
3392
3695
  ] })
3393
3696
  ] }),
3394
3697
  /* @__PURE__ */ e("h4", { children: c("protocolConfig.nodes", "Nodes") }),
3395
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__nodes", children: [
3396
- r.nodes.map((n, o) => /* @__PURE__ */ a("div", { className: "nice-protocol-config__node-row", children: [
3698
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__nodes", children: [
3699
+ a.nodes.map((n, o) => /* @__PURE__ */ r("div", { className: "nice-protocol-config__node-row", children: [
3397
3700
  /* @__PURE__ */ e(
3398
3701
  "input",
3399
3702
  {
3400
3703
  type: "text",
3401
3704
  value: n.nodeId,
3402
- onChange: (d) => {
3403
- const t = [...r.nodes];
3404
- t[o] = { ...t[o], nodeId: d.target.value }, i({ ...r, nodes: t });
3705
+ onChange: (t) => {
3706
+ const d = [...a.nodes];
3707
+ d[o] = { ...d[o], nodeId: t.target.value }, i({ ...a, nodes: d });
3405
3708
  },
3406
3709
  placeholder: c("protocolConfig.nodeIdPlaceholder", "ns=2;s=Temperature")
3407
3710
  }
@@ -3411,9 +3714,9 @@ function De({ config: r, onChange: i }) {
3411
3714
  {
3412
3715
  type: "text",
3413
3716
  value: n.displayName,
3414
- onChange: (d) => {
3415
- const t = [...r.nodes];
3416
- t[o] = { ...t[o], displayName: d.target.value }, i({ ...r, nodes: t });
3717
+ onChange: (t) => {
3718
+ const d = [...a.nodes];
3719
+ d[o] = { ...d[o], displayName: t.target.value }, i({ ...a, nodes: d });
3417
3720
  },
3418
3721
  placeholder: c("protocolConfig.displayNamePlaceholder", "Display Name")
3419
3722
  }
@@ -3422,8 +3725,8 @@ function De({ config: r, onChange: i }) {
3422
3725
  "button",
3423
3726
  {
3424
3727
  onClick: () => {
3425
- const d = r.nodes.filter((t, l) => l !== o);
3426
- i({ ...r, nodes: d });
3728
+ const t = a.nodes.filter((d, l) => l !== o);
3729
+ i({ ...a, nodes: t });
3427
3730
  },
3428
3731
  children: "Γ—"
3429
3732
  }
@@ -3434,9 +3737,9 @@ function De({ config: r, onChange: i }) {
3434
3737
  {
3435
3738
  onClick: () => {
3436
3739
  i({
3437
- ...r,
3740
+ ...a,
3438
3741
  nodes: [
3439
- ...r.nodes,
3742
+ ...a.nodes,
3440
3743
  { nodeId: "", displayName: "", dataType: "Double", read: !0 }
3441
3744
  ]
3442
3745
  });
@@ -3448,7 +3751,7 @@ function De({ config: r, onChange: i }) {
3448
3751
  ] });
3449
3752
  }
3450
3753
  export {
3451
- Ue as NiceEdgeManager,
3452
- Ee as NiceIoTDashboard,
3453
- Ae as NiceProtocolConfig
3754
+ Fe as NiceEdgeManager,
3755
+ Be as NiceIoTDashboard,
3756
+ Oe as NiceProtocolConfig
3454
3757
  };