@nice2dev/ui-iot 1.1.7 β†’ 1.1.10

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,395 @@
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
- ] });
199
- }
200
- function oe(r) {
201
- return r.length === 0 ? 0 : Math.max(...r.map((i) => i.position.y + i.position.height));
1
+ import { jsx as e, jsxs as r, Fragment as D } from "react/jsx-runtime";
2
+ import { useContext as B, createContext as M, memo as oe, useState as y, useEffect as te, useCallback as C } from "react";
3
+ const de = (a, i) => i, se = M(de), le = M("en");
4
+ function R() {
5
+ const a = B(se), i = B(le);
6
+ return { t: a, lang: i };
202
7
  }
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
+ const fe = {
9
+ radius: "md",
10
+ shadow: "md",
11
+ fill: "solid",
12
+ buttonStyle: "flat",
13
+ inputStyle: "bordered",
14
+ cardStyle: "elevated",
15
+ badgeStyle: "solid",
16
+ tabStyle: "underline",
17
+ toggleStyle: "default",
18
+ tooltipStyle: "dark",
19
+ modalStyle: "default",
20
+ tableStyle: "default",
21
+ menuStyle: "default",
22
+ animation: "normal",
23
+ density: "normal"
24
+ };
25
+ M({
26
+ displayStyle: "default",
27
+ variantConfig: fe,
28
+ setDisplayStyle: () => {
217
29
  }
218
- }
219
- function de({
220
- widget: r,
221
- devices: i,
222
- alarms: c,
223
- isEditing: n,
224
- onCommand: o,
225
- onDelete: d
30
+ });
31
+ const me = {
32
+ // Navigation
33
+ "chevron-down": "M6 9l6 6 6-6",
34
+ "chevron-up": "M18 15l-6-6-6 6",
35
+ "chevron-left": "M15 18l-6-6 6-6",
36
+ "chevron-right": "M9 6l6 6-6 6",
37
+ "arrow-left": "M19 12H5m0 0l7 7m-7-7l7-7",
38
+ "arrow-right": "M5 12h14m0 0l-7-7m7 7l-7 7",
39
+ "arrow-up": "M12 19V5m0 0l-7 7m7-7l7 7",
40
+ "arrow-down": "M12 5v14m0 0l7-7m-7 7l-7-7",
41
+ // Actions
42
+ close: "M18 6L6 18M6 6l12 12",
43
+ plus: "M12 5v14m-7-7h14",
44
+ minus: "M5 12h14",
45
+ check: "M5 13l4 4L19 7",
46
+ 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",
47
+ 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",
48
+ 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",
49
+ download: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4",
50
+ upload: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12",
51
+ 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",
52
+ // UI
53
+ search: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",
54
+ 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",
55
+ "sort-asc": "M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12",
56
+ "sort-desc": "M3 4h13M3 8h9m-9 4h9m5-4v12m0 0l-4-4m4 4l4-4",
57
+ // Neutral "sortable" indicator: a small up-chevron over a down-chevron.
58
+ sort: "M6 10l6-6 6 6M6 14l6 6 6-6",
59
+ menu: "M4 6h16M4 12h16M4 18h16",
60
+ "more-vertical": "M12 5v.01M12 12v.01M12 19v.01",
61
+ "more-horizontal": "M5 12h.01M12 12h.01M19 12h.01",
62
+ 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",
63
+ 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",
64
+ "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",
65
+ 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",
66
+ // Status
67
+ info: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",
68
+ 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",
69
+ error: "M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z",
70
+ success: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",
71
+ 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",
72
+ // Content
73
+ 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",
74
+ clock: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z",
75
+ 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",
76
+ folder: "M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",
77
+ 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",
78
+ 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",
79
+ 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",
80
+ 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",
81
+ user: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z",
82
+ 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",
83
+ 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",
84
+ 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",
85
+ 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",
86
+ 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",
87
+ grip: "M4 6h2m4 0h2m4 0h2M4 12h2m4 0h2m4 0h2M4 18h2m4 0h2m4 0h2",
88
+ hash: "M4 9h16M4 15h16M10 3L8 21M16 3l-2 18",
89
+ list: "M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",
90
+ circle: "M12 21a9 9 0 100-18 9 9 0 000 18z",
91
+ // UI component / element types (palettes, builders)
92
+ 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",
93
+ tabs: "M3 9h18v10H3z M7 9V5h6v4",
94
+ columns: "M4 4h7v16H4z M13 4h7v16h-7z",
95
+ grid: "M3 3h7v7H3z M14 3h7v7h-7z M14 14h7v7h-7z M3 14h7v7H3z",
96
+ table: "M3 5h18v14H3z M3 10h18M3 15h18M9 5v14M15 5v14",
97
+ heading: "M6 4v16M18 4v16M6 12h12",
98
+ type: "M4 7V4h16v3M9 20h6M12 4v16",
99
+ "align-left": "M3 6h18M3 12h12M3 18h15",
100
+ input: "M4 9h16a1 1 0 011 1v4a1 1 0 01-1 1H4a1 1 0 01-1-1v-4a1 1 0 011-1z M7 12h5",
101
+ button: "M5 9h14a2 2 0 012 2v2a2 2 0 01-2 2H5a2 2 0 01-2-2v-2a2 2 0 012-2z",
102
+ 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",
103
+ "check-square": "M9 11l3 3L22 4 M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11",
104
+ 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",
105
+ card: "M3 5h18a1 1 0 011 1v12a1 1 0 01-1 1H3a1 1 0 01-1-1V6a1 1 0 011-1z M3 10h18",
106
+ // App / infra / media concepts
107
+ "bar-chart": "M6 20v-6M12 20V4M18 20v-10",
108
+ "line-chart": "M3 3v18h18 M7 15l4-4 3 3 5-6",
109
+ "area-chart": "M3 3v18h18 M7 17v-3l4-4 3 3 5-6v10z",
110
+ "pie-chart": "M21.21 15.89A10 10 0 118 2.83 M22 12A10 10 0 0012 2v10z",
111
+ "donut-chart": "M12 3a9 9 0 100 18 9 9 0 000-18z M12 8a4 4 0 100 8 4 4 0 000-8z",
112
+ "scatter-chart": "M3 3v18h18 M8 16h.01 M11 11h.01 M15 14h.01 M18 8h.01",
113
+ "bars-vertical": "M6 5v14M12 5v14M18 5v14",
114
+ 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",
115
+ 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",
116
+ 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",
117
+ plug: "M9 2v5 M15 2v5 M7 7h10v3a5 5 0 01-10 0V7z M12 15v7",
118
+ save: "M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z M17 21v-8H7v8 M7 3v5h8",
119
+ 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",
120
+ 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",
121
+ 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",
122
+ cloud: "M18 10h-1.26A8 8 0 109 20h9a5 5 0 000-10z",
123
+ 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",
124
+ 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",
125
+ 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",
126
+ 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",
127
+ 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",
128
+ 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",
129
+ 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",
130
+ slash: "M12 3a9 9 0 100 18 9 9 0 000-18z M5.6 5.6l12.8 12.8",
131
+ 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",
132
+ dollar: "M12 1v22 M17 5H9.5a3.5 3.5 0 000 7h5a3.5 3.5 0 010 7H6",
133
+ 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",
134
+ scale: "M12 3v18 M5 21h14 M5 7l7-2 7 2 M2 13a3 3 0 006 0L5 7zm14 0a3 3 0 006 0L19 7z",
135
+ 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",
136
+ 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",
137
+ "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",
138
+ cursor: "M5 3l14 7-6 2-2 6-6-15z",
139
+ shuffle: "M16 3h5v5 M4 20L21 3 M21 16v5h-5 M15 15l6 6 M4 4l5 5",
140
+ 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",
141
+ 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",
142
+ terminal: "M4 17l6-6-6-6 M12 19h8",
143
+ "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",
144
+ send: "M22 2L11 13 M22 2l-7 20-4-9-9-4 20-7z",
145
+ // Media
146
+ 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",
147
+ pause: "M10 9v6m4-6v6m7-3a9 9 0 11-18 0 9 9 0 0118 0z",
148
+ 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",
149
+ 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",
150
+ volume: "M11 5L6 9H2v6h4l5 4V5z M15.54 8.46a5 5 0 010 7.07 M19.07 4.93a10 10 0 010 14.14",
151
+ "volume-off": "M11 5L6 9H2v6h4l5 4V5z M23 9l-6 6 M17 9l6 6",
152
+ "skip-back": "M19 20L9 12l10-8v16z M5 19V5",
153
+ // Toggle
154
+ expand: "M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4",
155
+ collapse: "M9 9V5m0 4H5m4 0L4 4m11 5h4m-4 0V5m0 4l5-5M9 15v4m0-4H5m4 0l-5 5m15-5h-4m4 0v4m0-4l-5 5",
156
+ "external-link": "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",
157
+ // Extended set (entities, gamification, status)
158
+ 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",
159
+ 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",
160
+ medal: "M15.477 12.89L17 22l-5-3-5 3 1.523-9.11M12 15a6 6 0 100-12 6 6 0 000 12z",
161
+ 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",
162
+ "skip-forward": "M5 4l10 8-10 8V4zM19 5v14",
163
+ "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",
164
+ 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",
165
+ archive: "M21 8v13H3V8M1 3h22v5H1zM10 12h4",
166
+ reply: "M9 17l-5-5 5-5M4 12h11a4 4 0 014 4v2",
167
+ forward: "M15 17l5-5-5-5M20 12H9a4 4 0 00-4 4v2",
168
+ 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",
169
+ zap: "M13 2L3 14h9l-1 8 10-12h-9l1-8z",
170
+ // Graphics / drawing tools (vector / pixel / photo / game editors)
171
+ square: "M4 4h16v16H4z",
172
+ triangle: "M12 4L3 20h18z",
173
+ hexagon: "M7.5 3h9l4.5 9-4.5 9h-9L3 12z",
174
+ diamond: "M12 2l10 10-10 10L2 12z",
175
+ line: "M5 19L19 5",
176
+ 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",
177
+ 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",
178
+ droplet: "M12 2.69l5.66 5.66a8 8 0 11-11.31 0z",
179
+ bucket: "M5 8h14l-1.5 11a2 2 0 01-2 1.8H8.5a2 2 0 01-2-1.8L5 8z M5 8l2-4h10l2 4",
180
+ 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",
181
+ layers: "M12 2l9 5-9 5-9-5 9-5z M3 12l9 5 9-5 M3 17l9 5 9-5",
182
+ crop: "M6 2v14a2 2 0 002 2h14 M2 6h14a2 2 0 012 2v14",
183
+ eyedropper: "M2 22l1-1h3l9-9 M3 21v-3l9-9 M15 6l3.5-3.5a2.12 2.12 0 013 3L18 9l-3-3z",
184
+ 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",
185
+ 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",
186
+ 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",
187
+ 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",
188
+ 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",
189
+ // Buildings / interior / fixtures (spatial / floor-plan / smart-home / real-estate editors)
190
+ thermometer: "M14 14.76V3.5a2.5 2.5 0 00-5 0v11.26a4.5 4.5 0 105 0z",
191
+ door: "M18 20V5a1 1 0 00-1-1H7a1 1 0 00-1 1v15 M3 20h18 M13 11.5h.01",
192
+ stairs: "M3 20h3v-3h3v-3h3v-3h3v-3h3",
193
+ 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",
194
+ bed: "M2 4v16 M2 8h18a2 2 0 012 2v10 M22 17H2 M6 8v4 M2 12h4",
195
+ 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",
196
+ chair: "M6 11V5a2 2 0 012-2h8a2 2 0 012 2v6 M5 11h14 M6 11l-1 8h14l-1-8 M6 19v2 M18 19v2",
197
+ 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",
198
+ mountain: "M8 3l4 8 5-5 5 15H2L8 3z",
199
+ tree: "M12 2L7 11h10L12 2z M9 11l3 5 3-5 M12 16v6",
200
+ 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",
201
+ moon: "M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z",
202
+ // Rich-text editing (NiceHtmlEditor toolbar, document editors)
203
+ "list-ordered": "M10 6h11M10 12h11M10 18h11M4 6h1v4M4 10h2M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",
204
+ 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",
205
+ code: "M16 18l6-6-6-6M8 6l-6 6 6 6",
206
+ quote: "M3 21c3-3 3-9 0-12M21 21c-3-3-3-9 0-12M9 7h6v6H9zM15 7h6v6h-6z",
207
+ indent: "M3 8l4 4-4 4M7 6h14M7 12h14M3 18h18",
208
+ outdent: "M7 8l-4 4 4 4M21 6H3M21 12H7M21 18H3",
209
+ "align-center": "M3 6h18M6 12h12M3 18h18",
210
+ "align-right": "M3 6h18M9 12h12M3 18h18",
211
+ "align-justify": "M3 6h18M3 12h18M3 18h18",
212
+ "align-top": "M4 4h16M9 8v12M15 8v7",
213
+ "align-middle": "M4 12h16M9 5v14M15 8v8",
214
+ "align-bottom": "M4 20h16M9 4v12M15 9v7",
215
+ "distribute-h": "M4 4v16M20 4v16M10 7h4v10h-4z",
216
+ "distribute-v": "M4 4h16M4 20h16M7 10h10v4H7z",
217
+ parallelogram: "M7 5h14l-4 14H3z",
218
+ barcode: "M4 5v14M6.5 5v14M10 5v14M13 5v14M15.5 5v14M19 5v14M20.5 5v14",
219
+ "qr-code": "M4 4h6v6H4z M14 4h6v6h-6z M4 14h6v6H4z M14 14h2v2h-2z M18 14h2v2h-2z M14 18h2v2h-2z M18 18h2v2h-2z",
220
+ 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",
221
+ undo: "M9 14L4 9l5-5M4 9h10.5a5.5 5.5 0 010 11H11",
222
+ redo: "M15 14l5-5-5-5M20 9H9.5a5.5 5.5 0 000 11H13",
223
+ 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",
224
+ 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",
225
+ "page-break": "M6 3v5h12V3 M6 21v-5h12v5 M2 12h3 M8 12h3 M13 12h3 M19 12h3",
226
+ shield: "M12 2l8 3v6c0 5-3.4 9.4-8 11-4.6-1.6-8-6-8-11V5z",
227
+ 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"
228
+ }, he = {
229
+ xs: 12,
230
+ sm: 16,
231
+ md: 20,
232
+ lg: 24,
233
+ xl: 32
234
+ }, pe = M({});
235
+ function ye({
236
+ path: a,
237
+ size: i,
238
+ className: c,
239
+ style: n,
240
+ color: o,
241
+ title: t,
242
+ onClick: d
226
243
  }) {
227
- const t = F.find((l) => l.type === r.type);
228
- return /* @__PURE__ */ a(
229
- "div",
244
+ return /* @__PURE__ */ r(
245
+ "svg",
230
246
  {
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
- },
247
+ xmlns: "http://www.w3.org/2000/svg",
248
+ width: i,
249
+ height: i,
250
+ viewBox: "0 0 24 24",
251
+ fill: "none",
252
+ stroke: o || "currentColor",
253
+ strokeWidth: 2,
254
+ strokeLinecap: "round",
255
+ strokeLinejoin: "round",
256
+ className: `nice-icon ${c || ""}`,
257
+ style: n,
258
+ role: t ? "img" : "presentation",
259
+ "aria-label": t,
260
+ "aria-hidden": !t,
261
+ onClick: d,
236
262
  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 }) })
263
+ t && /* @__PURE__ */ e("title", { children: t }),
264
+ /* @__PURE__ */ e("path", { d: a })
243
265
  ]
244
266
  }
245
267
  );
246
268
  }
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 });
269
+ const u = ({
270
+ name: a,
271
+ size: i = "md",
272
+ className: c,
273
+ style: n,
274
+ color: o,
275
+ title: t,
276
+ onClick: d
277
+ }) => {
278
+ const { resolver: l } = B(pe), b = typeof i == "number" ? i : he[i];
279
+ if (l) {
280
+ const _ = l(a, b);
281
+ if (_)
282
+ return /* @__PURE__ */ e("span", { className: `nice-icon-wrap ${c || ""}`, style: n, onClick: d, children: _ });
346
283
  }
347
- }
348
- function se({ device: r, isSelected: i, onSelect: c }) {
349
- return /* @__PURE__ */ a(
350
- "div",
284
+ const m = me[a];
285
+ return m ? /* @__PURE__ */ e(
286
+ ye,
351
287
  {
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
- ]
288
+ path: m,
289
+ size: b,
290
+ className: c,
291
+ style: n,
292
+ color: o,
293
+ title: t,
294
+ onClick: d
389
295
  }
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);
296
+ ) : null;
297
+ };
298
+ M({
299
+ direction: "ltr",
300
+ isRTL: !1,
301
+ flip: (a) => a,
302
+ flipStyle: (a, i) => ({ [a]: i })
303
+ });
304
+ M({
305
+ permissions: {},
306
+ getAccessMode: () => "full"
307
+ });
308
+ M(null);
309
+ M(null);
310
+ const Y = {
311
+ space1: "4px",
312
+ space2: "8px",
313
+ space3: "12px",
314
+ space4: "16px",
315
+ space5: "20px",
316
+ space6: "24px",
317
+ space8: "32px"
318
+ }, Z = {
319
+ fontFamily: "'Inter', system-ui, -apple-system, sans-serif",
320
+ fontSizeXs: "0.75rem",
321
+ fontSizeSm: "0.8125rem",
322
+ fontSizeMd: "0.875rem",
323
+ fontSizeLg: "1rem",
324
+ fontSizeXl: "1.125rem",
325
+ fontWeightNormal: 400,
326
+ fontWeightMedium: 500,
327
+ fontWeightSemibold: 600,
328
+ fontWeightBold: 700,
329
+ lineHeight: 1.5
330
+ }, ee = { fast: "120ms ease", normal: "200ms ease", slow: "300ms ease" }, ae = (a) => ({
331
+ color: a,
332
+ radiusSm: "4px",
333
+ radiusMd: "6px",
334
+ radiusLg: "8px",
335
+ radiusXl: "12px",
336
+ radiusFull: "9999px"
337
+ }), ue = {
338
+ sm: "0 1px 2px rgba(0,0,0,0.05)",
339
+ md: "0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",
340
+ lg: "0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",
341
+ xl: "0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"
342
+ }, ve = {
343
+ sm: "0 1px 2px rgba(0,0,0,0.3)",
344
+ md: "0 4px 6px -1px rgba(0,0,0,0.4)",
345
+ lg: "0 10px 15px -3px rgba(0,0,0,0.4)",
346
+ xl: "0 20px 25px -5px rgba(0,0,0,0.4)"
347
+ };
348
+ function s(a, i, c, n, o) {
349
+ return {
350
+ name: a,
351
+ darkMode: "light",
352
+ colors: {
353
+ ...i,
354
+ surface: i.surface ?? c.primary,
355
+ surfaceHover: i.surfaceHover ?? c.secondary
489
356
  },
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));
357
+ backgrounds: {
358
+ ...c,
359
+ elevated: c.elevated ?? c.primary,
360
+ inset: c.inset ?? c.tertiary,
361
+ canvas: c.canvas ?? c.primary
496
362
  },
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`;
363
+ text: { ...n, inverse: n.inverse ?? "#ffffff" },
364
+ borders: ae(o),
365
+ shadows: ue,
366
+ spacing: Y,
367
+ typography: Z,
368
+ transitions: ee
369
+ };
597
370
  }
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
- };
371
+ function h(a, i, c, n, o) {
372
+ return {
373
+ name: a,
374
+ darkMode: "dark",
375
+ colors: {
376
+ ...i,
377
+ surface: i.surface ?? c.secondary,
378
+ surfaceHover: i.surfaceHover ?? c.tertiary
379
+ },
380
+ backgrounds: {
381
+ ...c,
382
+ elevated: c.elevated ?? c.secondary,
383
+ inset: c.inset ?? c.primary,
384
+ canvas: c.canvas ?? c.primary
385
+ },
386
+ text: { ...n, inverse: n.inverse ?? "#0f172a" },
387
+ borders: ae(o),
388
+ shadows: ve,
389
+ spacing: Y,
390
+ typography: Z,
391
+ transitions: ee
392
+ };
1323
393
  }
1324
394
  s(
1325
395
  "Slate",
@@ -1629,7 +699,7 @@ s(
1629
699
  { primary: "#431407", secondary: "#9a3412", muted: "#fb923c" },
1630
700
  "#fdba74"
1631
701
  );
1632
- p(
702
+ h(
1633
703
  "Midnight",
1634
704
  {
1635
705
  primary: "#818cf8",
@@ -1643,7 +713,7 @@ p(
1643
713
  { primary: "#f1f5f9", secondary: "#94a3b8", muted: "#475569" },
1644
714
  "#1e293b"
1645
715
  );
1646
- p(
716
+ h(
1647
717
  "Obsidian",
1648
718
  {
1649
719
  primary: "#a78bfa",
@@ -1657,7 +727,7 @@ p(
1657
727
  { primary: "#fafafa", secondary: "#a1a1aa", muted: "#52525b" },
1658
728
  "#3f3f46"
1659
729
  );
1660
- p(
730
+ h(
1661
731
  "Eclipse",
1662
732
  {
1663
733
  primary: "#c084fc",
@@ -1671,7 +741,7 @@ p(
1671
741
  { primary: "#f5f3ff", secondary: "#a78bfa", muted: "#6d5eac" },
1672
742
  "#3b3266"
1673
743
  );
1674
- p(
744
+ h(
1675
745
  "Onyx",
1676
746
  {
1677
747
  primary: "#60a5fa",
@@ -1685,7 +755,7 @@ p(
1685
755
  { primary: "#ffffff", secondary: "#a3a3a3", muted: "#525252" },
1686
756
  "#262626"
1687
757
  );
1688
- p(
758
+ h(
1689
759
  "Carbon",
1690
760
  {
1691
761
  primary: "#38bdf8",
@@ -1699,7 +769,7 @@ p(
1699
769
  { primary: "#f4f4f4", secondary: "#c6c6c6", muted: "#6f6f6f" },
1700
770
  "#525252"
1701
771
  );
1702
- p(
772
+ h(
1703
773
  "Cosmos",
1704
774
  {
1705
775
  primary: "#6366f1",
@@ -1713,7 +783,7 @@ p(
1713
783
  { primary: "#e5e7eb", secondary: "#9ca3af", muted: "#4b5563" },
1714
784
  "#374151"
1715
785
  );
1716
- p(
786
+ h(
1717
787
  "Nebula",
1718
788
  {
1719
789
  primary: "#e879f9",
@@ -1727,7 +797,7 @@ p(
1727
797
  { primary: "#fae8ff", secondary: "#d8b4fe", muted: "#7c3aed" },
1728
798
  "#581c87"
1729
799
  );
1730
- p(
800
+ h(
1731
801
  "Abyss",
1732
802
  {
1733
803
  primary: "#22d3ee",
@@ -1741,7 +811,7 @@ p(
1741
811
  { primary: "#e0f2fe", secondary: "#7dd3fc", muted: "#0369a1" },
1742
812
  "#075985"
1743
813
  );
1744
- p(
814
+ h(
1745
815
  "Shadow",
1746
816
  {
1747
817
  primary: "#a3a3a3",
@@ -1755,7 +825,7 @@ p(
1755
825
  { primary: "#e5e5e5", secondary: "#a3a3a3", muted: "#525252" },
1756
826
  "#404040"
1757
827
  );
1758
- p(
828
+ h(
1759
829
  "Emerald Dark",
1760
830
  {
1761
831
  primary: "#34d399",
@@ -2147,7 +1217,7 @@ s(
2147
1217
  { primary: "#2e3440", secondary: "#3b4252", muted: "#4c566a" },
2148
1218
  "#d8dee9"
2149
1219
  );
2150
- p(
1220
+ h(
2151
1221
  "Dracula",
2152
1222
  {
2153
1223
  primary: "#bd93f9",
@@ -2175,7 +1245,7 @@ s(
2175
1245
  { primary: "#073642", secondary: "#586e75", muted: "#93a1a1" },
2176
1246
  "#eee8d5"
2177
1247
  );
2178
- p(
1248
+ h(
2179
1249
  "Solarized Dark",
2180
1250
  {
2181
1251
  primary: "#268bd2",
@@ -2189,7 +1259,7 @@ p(
2189
1259
  { primary: "#eee8d5", secondary: "#93a1a1", muted: "#586e75" },
2190
1260
  "#073642"
2191
1261
  );
2192
- p(
1262
+ h(
2193
1263
  "Monokai",
2194
1264
  {
2195
1265
  primary: "#66d9ef",
@@ -2203,7 +1273,7 @@ p(
2203
1273
  { primary: "#f8f8f2", secondary: "#cfcfc2", muted: "#75715e" },
2204
1274
  "#3e3d32"
2205
1275
  );
2206
- p(
1276
+ h(
2207
1277
  "One Dark",
2208
1278
  {
2209
1279
  primary: "#61afef",
@@ -2217,7 +1287,7 @@ p(
2217
1287
  { primary: "#abb2bf", secondary: "#828997", muted: "#545862" },
2218
1288
  "#3e4452"
2219
1289
  );
2220
- p(
1290
+ h(
2221
1291
  "Synthwave",
2222
1292
  {
2223
1293
  primary: "#ff7edb",
@@ -2245,7 +1315,7 @@ s(
2245
1315
  { primary: "#4a1a4e", secondary: "#7b3f7d", muted: "#c080c0" },
2246
1316
  "#d8a8e8"
2247
1317
  );
2248
- p(
1318
+ h(
2249
1319
  "Terminal Green",
2250
1320
  {
2251
1321
  primary: "#00ff41",
@@ -2287,7 +1357,7 @@ s(
2287
1357
  { primary: "#3e2723", secondary: "#5d4037", muted: "#a1887f" },
2288
1358
  "#bcaaa4"
2289
1359
  );
2290
- p(
1360
+ h(
2291
1361
  "Cyberpunk",
2292
1362
  {
2293
1363
  primary: "#00f0ff",
@@ -2301,7 +1371,7 @@ p(
2301
1371
  { primary: "#e0fbfc", secondary: "#80d4dd", muted: "#3a6b72" },
2302
1372
  "#1c3a44"
2303
1373
  );
2304
- p(
1374
+ h(
2305
1375
  "Neon",
2306
1376
  {
2307
1377
  primary: "#ff00ff",
@@ -2315,7 +1385,7 @@ p(
2315
1385
  { primary: "#ffffff", secondary: "#cccccc", muted: "#666666" },
2316
1386
  "#333333"
2317
1387
  );
2318
- p(
1388
+ h(
2319
1389
  "Retrowave",
2320
1390
  {
2321
1391
  primary: "#f77fbe",
@@ -2343,7 +1413,7 @@ s(
2343
1413
  { primary: "#3b0a0a", secondary: "#7f1d1d", muted: "#dc6868" },
2344
1414
  "#e8a0a0"
2345
1415
  );
2346
- p(
1416
+ h(
2347
1417
  "Halloween",
2348
1418
  {
2349
1419
  primary: "#ff6600",
@@ -2553,7 +1623,7 @@ s(
2553
1623
  { primary: "#2b1a0e", secondary: "#5c3d1e", muted: "#a08060" },
2554
1624
  "#d4b896"
2555
1625
  );
2556
- p(
1626
+ h(
2557
1627
  "High Contrast Dark",
2558
1628
  {
2559
1629
  primary: "#ffff00",
@@ -2609,7 +1679,7 @@ s(
2609
1679
  { primary: "#0a0a0a", secondary: "#404040", muted: "#a3a3a3" },
2610
1680
  "#e5e5e5"
2611
1681
  );
2612
- p(
1682
+ h(
2613
1683
  "Warm Dark",
2614
1684
  {
2615
1685
  primary: "#f59e0b",
@@ -2623,7 +1693,7 @@ p(
2623
1693
  { primary: "#fafaf9", secondary: "#d6d3d1", muted: "#78716c" },
2624
1694
  "#57534e"
2625
1695
  );
2626
- p(
1696
+ h(
2627
1697
  "Soft Dark",
2628
1698
  {
2629
1699
  primary: "#a78bfa",
@@ -2665,9 +1735,1228 @@ s(
2665
1735
  { primary: "#3b0a0a", secondary: "#7f1d1d", muted: "#dc6868" },
2666
1736
  "#e8a0a0"
2667
1737
  );
2668
- b(null);
2669
- b(null);
1738
+ const be = process.env.NODE_ENV === "development";
1739
+ let re = {
1740
+ enabled: be,
1741
+ slowRenderThreshold: 16
1742
+ };
1743
+ const ie = [], O = /* @__PURE__ */ new Map(), ce = /* @__PURE__ */ new Map();
1744
+ function ge() {
1745
+ ie.length = 0, O.clear(), ce.clear();
1746
+ }
1747
+ function Me(a) {
1748
+ const i = re.slowRenderThreshold;
1749
+ return ie.filter((c) => c.actualDuration > i);
1750
+ }
1751
+ function V(a) {
1752
+ return a < 1 ? `${(a * 1e3).toFixed(0)}ΞΌs` : a < 1e3 ? `${a.toFixed(2)}ms` : `${(a / 1e3).toFixed(2)}s`;
1753
+ }
1754
+ function _e() {
1755
+ 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());
1756
+ return { stats: a, slowRenders: i, totalRenders: c, avgRenderTime: n, marks: o };
1757
+ }
1758
+ function Ne() {
1759
+ const a = _e();
1760
+ console.group(
1761
+ "%c[Nice2Dev Performance Report]",
1762
+ "color: var(--nice-info, #6366f1); font-weight: bold; font-size: 14px"
1763
+ ), 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(
1764
+ a.stats.sort((i, c) => c.totalRenderTime - i.totalRenderTime).map((i) => ({
1765
+ Name: i.componentName,
1766
+ Renders: i.renderCount,
1767
+ "Avg Time": V(i.avgRenderTime),
1768
+ "Max Time": V(i.maxRenderTime),
1769
+ "Total Time": V(i.totalRenderTime),
1770
+ "Slow Renders": i.slowRenderCount
1771
+ }))
1772
+ ), console.groupEnd(), a.slowRenders.length > 0 && (console.group("Slow Renders (last 10)"), console.table(
1773
+ a.slowRenders.slice(-10).map((i) => ({
1774
+ Component: i.componentName,
1775
+ Phase: i.phase,
1776
+ Duration: V(i.actualDuration),
1777
+ Time: new Date(i.timestamp).toLocaleTimeString()
1778
+ }))
1779
+ ), console.groupEnd()), a.marks.length > 0 && (console.group("Custom Marks"), console.table(
1780
+ a.marks.filter((i) => i.duration).map((i) => ({
1781
+ Name: i.name,
1782
+ Duration: V(i.duration)
1783
+ }))
1784
+ ), console.groupEnd()), console.groupEnd();
1785
+ }
1786
+ const we = oe(
1787
+ ({ position: a = "bottom-right", defaultCollapsed: i = !0 }) => {
1788
+ const [c, n] = y(i), [o, t] = y([]), [d, l] = y({ used: 0, total: 0 });
1789
+ if (te(() => {
1790
+ const m = () => {
1791
+ const w = Array.from(O.values());
1792
+ t(w.sort((v, N) => N.totalRenderTime - v.totalRenderTime).slice(0, 10));
1793
+ const g = window.performance;
1794
+ g.memory && l({
1795
+ used: g.memory.usedJSHeapSize / 1024 / 1024,
1796
+ total: g.memory.totalJSHeapSize / 1024 / 1024
1797
+ });
1798
+ };
1799
+ m();
1800
+ const _ = setInterval(m, 2e3);
1801
+ return () => clearInterval(_);
1802
+ }, []), !re.enabled)
1803
+ return null;
1804
+ const b = {
1805
+ position: "fixed",
1806
+ zIndex: 99999,
1807
+ ...a.includes("top") ? { top: 8 } : { bottom: 8 },
1808
+ ...a.includes("left") ? { left: 8 } : { right: 8 }
1809
+ };
1810
+ return /* @__PURE__ */ r(
1811
+ "div",
1812
+ {
1813
+ style: {
1814
+ ...b,
1815
+ background: "var(--nice-overlay-85, rgba(0, 0, 0, 0.85))",
1816
+ color: "var(--nice-text-on-primary, #fff)",
1817
+ borderRadius: 8,
1818
+ fontSize: 11,
1819
+ fontFamily: "Monaco, Consolas, monospace",
1820
+ padding: c ? "4px 8px" : 8,
1821
+ maxWidth: c ? "auto" : 300,
1822
+ maxHeight: c ? "auto" : 400,
1823
+ overflow: "auto"
1824
+ },
1825
+ children: [
1826
+ /* @__PURE__ */ r(
1827
+ "div",
1828
+ {
1829
+ style: { cursor: "pointer", display: "flex", alignItems: "center", gap: 8 },
1830
+ onClick: () => n((m) => !m),
1831
+ children: [
1832
+ /* @__PURE__ */ e(
1833
+ "span",
1834
+ {
1835
+ "aria-hidden": "true",
1836
+ style: {
1837
+ width: 8,
1838
+ height: 8,
1839
+ borderRadius: "50%",
1840
+ background: "var(--nice-color-success, #22c55e)"
1841
+ }
1842
+ }
1843
+ ),
1844
+ /* @__PURE__ */ e("span", { children: "Profiler" }),
1845
+ d.used > 0 && /* @__PURE__ */ r(
1846
+ "span",
1847
+ {
1848
+ style: {
1849
+ color: d.used > 100 ? "var(--nice-color-warning, #f59e0b)" : "var(--nice-text-muted, #64748b)"
1850
+ },
1851
+ children: [
1852
+ d.used.toFixed(0),
1853
+ "MB"
1854
+ ]
1855
+ }
1856
+ ),
1857
+ /* @__PURE__ */ e("span", { style: { marginLeft: "auto", opacity: 0.5, display: "inline-flex" }, children: /* @__PURE__ */ e(u, { name: c ? "chevron-down" : "chevron-up", size: 12 }) })
1858
+ ]
1859
+ }
1860
+ ),
1861
+ !c && /* @__PURE__ */ r("div", { style: { marginTop: 8 }, children: [
1862
+ /* @__PURE__ */ e(
1863
+ "div",
1864
+ {
1865
+ style: {
1866
+ borderBottom: "1px solid var(--nice-border-color, #333)",
1867
+ paddingBottom: 4,
1868
+ marginBottom: 8
1869
+ },
1870
+ children: /* @__PURE__ */ e("strong", { children: "Top Components" })
1871
+ }
1872
+ ),
1873
+ o.map((m) => /* @__PURE__ */ r("div", { style: { marginBottom: 4, display: "flex", gap: 8 }, children: [
1874
+ /* @__PURE__ */ e("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis" }, children: m.componentName }),
1875
+ /* @__PURE__ */ e(
1876
+ "span",
1877
+ {
1878
+ style: {
1879
+ color: m.avgRenderTime > 16 ? "var(--nice-color-warning, #f59e0b)" : "var(--nice-color-success, #22c55e)"
1880
+ },
1881
+ children: V(m.avgRenderTime)
1882
+ }
1883
+ ),
1884
+ /* @__PURE__ */ r(
1885
+ "span",
1886
+ {
1887
+ style: {
1888
+ color: "var(--nice-text-muted, #64748b)",
1889
+ minWidth: 30,
1890
+ textAlign: "right"
1891
+ },
1892
+ children: [
1893
+ "x",
1894
+ m.renderCount
1895
+ ]
1896
+ }
1897
+ )
1898
+ ] }, m.componentName)),
1899
+ /* @__PURE__ */ r("div", { style: { marginTop: 8, display: "flex", gap: 8 }, children: [
1900
+ /* @__PURE__ */ e(
1901
+ "button",
1902
+ {
1903
+ onClick: Ne,
1904
+ style: {
1905
+ flex: 1,
1906
+ padding: "4px 8px",
1907
+ background: "var(--nice-bg-tertiary, #333)",
1908
+ border: "none",
1909
+ borderRadius: 4,
1910
+ color: "var(--nice-text-primary, #fff)",
1911
+ cursor: "pointer",
1912
+ fontSize: 10
1913
+ },
1914
+ children: "Print Report"
1915
+ }
1916
+ ),
1917
+ /* @__PURE__ */ e(
1918
+ "button",
1919
+ {
1920
+ onClick: ge,
1921
+ style: {
1922
+ flex: 1,
1923
+ padding: "4px 8px",
1924
+ background: "var(--nice-bg-tertiary, #333)",
1925
+ border: "none",
1926
+ borderRadius: 4,
1927
+ color: "var(--nice-text-primary, #fff)",
1928
+ cursor: "pointer",
1929
+ fontSize: 10
1930
+ },
1931
+ children: "Clear"
1932
+ }
1933
+ )
1934
+ ] })
1935
+ ] })
1936
+ ]
1937
+ }
1938
+ );
1939
+ }
1940
+ );
1941
+ we.displayName = "ProfilerOverlay";
1942
+ process.env.NODE_ENV;
1943
+ M(null);
1944
+ M({
1945
+ enabled: !0,
1946
+ active: !1,
1947
+ run: () => {
1948
+ }
1949
+ });
1950
+ const W = "nice-tutorial-button-styles";
1951
+ if (typeof document < "u" && !document.getElementById(W)) {
1952
+ const a = document.createElement("style");
1953
+ a.id = W, a.textContent = `
1954
+ .nice-tutorial-button {
1955
+ display: inline-flex;
1956
+ align-items: center;
1957
+ justify-content: center;
1958
+ border: 1px solid var(--nice-border, #cbd5e1);
1959
+ background: var(--nice-bg, #fff);
1960
+ color: var(--nice-text-secondary, #475569);
1961
+ border-radius: var(--nice-radius-full, 9999px);
1962
+ cursor: help;
1963
+ font-weight: 700;
1964
+ line-height: 1;
1965
+ padding: 0;
1966
+ transition: background var(--nice-transition, 200ms ease), color var(--nice-transition, 200ms ease), border-color var(--nice-transition, 200ms ease);
1967
+ }
1968
+ .nice-tutorial-button:hover {
1969
+ background: var(--nice-primary, #2563eb);
1970
+ border-color: var(--nice-primary, #2563eb);
1971
+ color: var(--nice-text-inverse, #fff);
1972
+ }
1973
+ .nice-tutorial-button:focus-visible {
1974
+ outline: none;
1975
+ box-shadow: 0 0 0 2px var(--nice-bg, #fff), 0 0 0 4px var(--nice-primary, #2563eb);
1976
+ }
1977
+ .nice-tutorial-button--sm { width: 16px; height: 16px; font-size: 11px; }
1978
+ .nice-tutorial-button--md { width: 20px; height: 20px; font-size: 12px; }
1979
+ `, document.head.appendChild(a);
1980
+ }
1981
+ M(null);
1982
+ M(null);
1983
+ M(null);
1984
+ M(null);
2670
1985
  const G = {
1986
+ display: "inline-block",
1987
+ width: 10,
1988
+ height: 10,
1989
+ borderRadius: "50%",
1990
+ background: "currentColor"
1991
+ }, F = [
1992
+ { type: "device-list", label: "Device List", icon: "list" },
1993
+ { type: "device-status", label: "Device Status", icon: "success" },
1994
+ { type: "telemetry-chart", label: "Telemetry Chart", icon: "bar-chart" },
1995
+ { type: "gauge", label: "Gauge", icon: "clock" },
1996
+ { type: "map", label: "Device Map", icon: "map-pin" },
1997
+ { type: "alarms", label: "Alarms", icon: "bell" },
1998
+ { type: "control-panel", label: "Control Panel", icon: "settings" },
1999
+ { type: "topology", label: "Network Topology", icon: "link" },
2000
+ { type: "kpi", label: "KPI Card", icon: "target" },
2001
+ { type: "camera-feed", label: "Camera Feed", icon: "video" }
2002
+ ];
2003
+ function Be({
2004
+ devices: a = [],
2005
+ widgets: i = [],
2006
+ alarms: c = [],
2007
+ onDeviceSelect: n,
2008
+ onWidgetChange: o,
2009
+ onCommand: t,
2010
+ onAlarmAcknowledge: d,
2011
+ fetchTelemetry: l,
2012
+ className: b = ""
2013
+ }) {
2014
+ const [m, _] = y(i), [w, g] = y(null), [v, N] = y("dashboard"), [H, L] = y(!1), [z, A] = y(""), p = C(
2015
+ (f) => {
2016
+ _((x) => {
2017
+ const S = f(x);
2018
+ return o == null || o(S), S;
2019
+ });
2020
+ },
2021
+ [o]
2022
+ ), k = C(
2023
+ (f) => {
2024
+ var S;
2025
+ const x = {
2026
+ id: crypto.randomUUID(),
2027
+ type: f,
2028
+ title: ((S = F.find(($) => $.type === f)) == null ? void 0 : S.label) || f,
2029
+ position: { x: 0, y: Ce(m), width: 4, height: 3 },
2030
+ config: {}
2031
+ };
2032
+ p(($) => [...$, x]);
2033
+ },
2034
+ [m, p]
2035
+ ), E = C(
2036
+ (f) => {
2037
+ g(f), n == null || n(f);
2038
+ },
2039
+ [n]
2040
+ ), U = C(
2041
+ (f) => {
2042
+ d == null || d(f);
2043
+ },
2044
+ [d]
2045
+ ), T = a.filter(
2046
+ (f) => !z || f.name.toLowerCase().includes(z.toLowerCase()) || f.type.toLowerCase().includes(z.toLowerCase())
2047
+ ), P = c.filter((f) => !f.cleared), q = P.filter(
2048
+ (f) => f.severity === "critical" || f.severity === "high"
2049
+ );
2050
+ return /* @__PURE__ */ r("div", { className: `nice-iot-dashboard ${b}`, children: [
2051
+ /* @__PURE__ */ r("header", { className: "nice-iot-dashboard__header", children: [
2052
+ /* @__PURE__ */ e("h1", { children: "IoT Dashboard" }),
2053
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__stats", children: [
2054
+ /* @__PURE__ */ r("span", { className: "nice-iot-dashboard__stat", children: [
2055
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", children: /* @__PURE__ */ e(u, { name: "wifi", size: 14 }) }),
2056
+ a.length,
2057
+ " Devices"
2058
+ ] }),
2059
+ /* @__PURE__ */ r("span", { className: "nice-iot-dashboard__stat nice-iot-dashboard__stat--online", children: [
2060
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", style: G }),
2061
+ a.filter((f) => f.status === "online").length,
2062
+ " Online"
2063
+ ] }),
2064
+ /* @__PURE__ */ r("span", { className: "nice-iot-dashboard__stat nice-iot-dashboard__stat--offline", children: [
2065
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", style: G }),
2066
+ a.filter((f) => f.status === "offline").length,
2067
+ " Offline"
2068
+ ] }),
2069
+ q.length > 0 && /* @__PURE__ */ r("span", { className: "nice-iot-dashboard__stat nice-iot-dashboard__stat--alarms", children: [
2070
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", children: /* @__PURE__ */ e(u, { name: "bell", size: 14 }) }),
2071
+ q.length,
2072
+ " Alarms"
2073
+ ] })
2074
+ ] }),
2075
+ /* @__PURE__ */ r("nav", { className: "nice-iot-dashboard__nav", children: [
2076
+ /* @__PURE__ */ e(
2077
+ "button",
2078
+ {
2079
+ className: v === "dashboard" ? "active" : "",
2080
+ onClick: () => N("dashboard"),
2081
+ children: "Dashboard"
2082
+ }
2083
+ ),
2084
+ /* @__PURE__ */ e("button", { className: v === "devices" ? "active" : "", onClick: () => N("devices"), children: "Devices" }),
2085
+ /* @__PURE__ */ r("button", { className: v === "alarms" ? "active" : "", onClick: () => N("alarms"), children: [
2086
+ "Alarms ",
2087
+ P.length > 0 && `(${P.length})`
2088
+ ] })
2089
+ ] }),
2090
+ /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__actions", children: v === "dashboard" && /* @__PURE__ */ r("button", { onClick: () => L(!H), children: [
2091
+ /* @__PURE__ */ e(u, { name: H ? "check" : "edit", size: 14 }),
2092
+ " ",
2093
+ H ? "Done" : "Edit"
2094
+ ] }) })
2095
+ ] }),
2096
+ v === "dashboard" && /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__main", children: [
2097
+ H && /* @__PURE__ */ r("aside", { className: "nice-iot-dashboard__palette", children: [
2098
+ /* @__PURE__ */ e("h4", { children: "Add Widget" }),
2099
+ F.map((f) => /* @__PURE__ */ r(
2100
+ "button",
2101
+ {
2102
+ className: "nice-iot-dashboard__palette-item",
2103
+ onClick: () => k(f.type),
2104
+ children: [
2105
+ /* @__PURE__ */ e(u, { name: f.icon, size: 16 }),
2106
+ /* @__PURE__ */ e("span", { children: f.label })
2107
+ ]
2108
+ },
2109
+ f.type
2110
+ ))
2111
+ ] }),
2112
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__grid", children: [
2113
+ m.map((f) => /* @__PURE__ */ e(
2114
+ He,
2115
+ {
2116
+ widget: f,
2117
+ devices: a,
2118
+ alarms: c,
2119
+ isEditing: H,
2120
+ onCommand: t,
2121
+ onDelete: () => p((x) => x.filter((S) => S.id !== f.id))
2122
+ },
2123
+ f.id
2124
+ )),
2125
+ 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." })
2126
+ ] })
2127
+ ] }),
2128
+ v === "devices" && /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__devices", children: [
2129
+ /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__devices-toolbar", children: /* @__PURE__ */ e(
2130
+ "input",
2131
+ {
2132
+ type: "search",
2133
+ placeholder: "Search devices...",
2134
+ value: z,
2135
+ onChange: (f) => A(f.target.value)
2136
+ }
2137
+ ) }),
2138
+ /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__device-grid", children: T.map((f) => /* @__PURE__ */ e(
2139
+ ke,
2140
+ {
2141
+ device: f,
2142
+ isSelected: (w == null ? void 0 : w.id) === f.id,
2143
+ onSelect: () => E(f)
2144
+ },
2145
+ f.id
2146
+ )) }),
2147
+ w && /* @__PURE__ */ e(
2148
+ xe,
2149
+ {
2150
+ device: w,
2151
+ onCommand: t,
2152
+ onClose: () => g(null)
2153
+ }
2154
+ )
2155
+ ] }),
2156
+ v === "alarms" && /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__alarms", children: /* @__PURE__ */ r("table", { className: "nice-iot-dashboard__alarm-table", children: [
2157
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ r("tr", { children: [
2158
+ /* @__PURE__ */ e("th", { children: "Severity" }),
2159
+ /* @__PURE__ */ e("th", { children: "Device" }),
2160
+ /* @__PURE__ */ e("th", { children: "Message" }),
2161
+ /* @__PURE__ */ e("th", { children: "Time" }),
2162
+ /* @__PURE__ */ e("th", { children: "Status" }),
2163
+ /* @__PURE__ */ e("th", { children: "Actions" })
2164
+ ] }) }),
2165
+ /* @__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) => {
2166
+ const x = a.find((S) => S.id === f.deviceId);
2167
+ return /* @__PURE__ */ r(
2168
+ "tr",
2169
+ {
2170
+ className: `nice-iot-dashboard__alarm-row nice-iot-dashboard__alarm-row--${f.severity}`,
2171
+ children: [
2172
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
2173
+ "span",
2174
+ {
2175
+ className: `nice-iot-dashboard__severity nice-iot-dashboard__severity--${f.severity}`,
2176
+ children: f.severity
2177
+ }
2178
+ ) }),
2179
+ /* @__PURE__ */ e("td", { children: (x == null ? void 0 : x.name) || f.deviceId }),
2180
+ /* @__PURE__ */ e("td", { children: f.message }),
2181
+ /* @__PURE__ */ e("td", { children: f.timestamp.toLocaleString() }),
2182
+ /* @__PURE__ */ e("td", { children: f.acknowledged ? "Acknowledged" : "Active" }),
2183
+ /* @__PURE__ */ e("td", { children: !f.acknowledged && /* @__PURE__ */ e("button", { onClick: () => U(f.id), children: "Acknowledge" }) })
2184
+ ]
2185
+ },
2186
+ f.id
2187
+ );
2188
+ }) })
2189
+ ] }) })
2190
+ ] });
2191
+ }
2192
+ function Ce(a) {
2193
+ return a.length === 0 ? 0 : Math.max(...a.map((i) => i.position.y + i.position.height));
2194
+ }
2195
+ function I(a) {
2196
+ switch (a) {
2197
+ case "online":
2198
+ return "var(--nice-success, #28a745)";
2199
+ case "offline":
2200
+ return "var(--nice-text-secondary, #6c757d)";
2201
+ case "warning":
2202
+ return "var(--nice-warning, #ffc107)";
2203
+ case "error":
2204
+ return "var(--nice-danger, #dc3545)";
2205
+ case "maintenance":
2206
+ return "var(--nice-info, #17a2b8)";
2207
+ default:
2208
+ return "var(--nice-text-secondary, #6c757d)";
2209
+ }
2210
+ }
2211
+ function He({
2212
+ widget: a,
2213
+ devices: i,
2214
+ alarms: c,
2215
+ isEditing: n,
2216
+ onCommand: o,
2217
+ onDelete: t
2218
+ }) {
2219
+ const d = F.find((l) => l.type === a.type);
2220
+ return /* @__PURE__ */ r(
2221
+ "div",
2222
+ {
2223
+ className: `nice-iot-dashboard__widget nice-iot-dashboard__widget--${a.type}`,
2224
+ style: {
2225
+ gridColumn: `span ${a.position.width}`,
2226
+ gridRow: `span ${a.position.height}`
2227
+ },
2228
+ children: [
2229
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__widget-header", children: [
2230
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__widget-icon", children: /* @__PURE__ */ e(u, { name: (d == null ? void 0 : d.icon) ?? "box", size: 14 }) }),
2231
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__widget-title", children: a.title }),
2232
+ n && /* @__PURE__ */ e("button", { className: "nice-iot-dashboard__widget-delete", onClick: t, children: "Γ—" })
2233
+ ] }),
2234
+ /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__widget-content", children: /* @__PURE__ */ e(ze, { widget: a, devices: i, alarms: c, onCommand: o }) })
2235
+ ]
2236
+ }
2237
+ );
2238
+ }
2239
+ function ze({
2240
+ widget: a,
2241
+ devices: i,
2242
+ alarms: c,
2243
+ onCommand: n
2244
+ }) {
2245
+ switch (a.type) {
2246
+ case "device-list":
2247
+ 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: [
2248
+ /* @__PURE__ */ e(
2249
+ "span",
2250
+ {
2251
+ className: "nice-iot-dashboard__device-status",
2252
+ style: { background: I(o.status) }
2253
+ }
2254
+ ),
2255
+ /* @__PURE__ */ e("span", { children: o.name }),
2256
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__device-type", children: o.type })
2257
+ ] }, o.id)) });
2258
+ case "device-status":
2259
+ return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__status-grid", children: ["online", "offline", "warning", "error"].map((o) => {
2260
+ const t = i.filter((d) => d.status === o).length;
2261
+ return /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__status-card", children: [
2262
+ /* @__PURE__ */ e(
2263
+ "span",
2264
+ {
2265
+ className: "nice-iot-dashboard__status-indicator",
2266
+ style: { background: I(o) }
2267
+ }
2268
+ ),
2269
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__status-count", children: t }),
2270
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__status-label", children: o })
2271
+ ] }, o);
2272
+ }) });
2273
+ case "telemetry-chart":
2274
+ return /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__chart-placeholder", children: [
2275
+ /* @__PURE__ */ e(u, { name: "bar-chart", size: 32 }),
2276
+ /* @__PURE__ */ e("span", { children: "Telemetry Chart" }),
2277
+ /* @__PURE__ */ e("small", { children: "Configure device and capability" })
2278
+ ] });
2279
+ case "gauge":
2280
+ return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__gauge", children: /* @__PURE__ */ r("svg", { viewBox: "0 0 100 60", children: [
2281
+ /* @__PURE__ */ e(
2282
+ "path",
2283
+ {
2284
+ d: "M 10 55 A 40 40 0 0 1 90 55",
2285
+ fill: "none",
2286
+ stroke: "var(--nice-border, #e0e0e0)",
2287
+ strokeWidth: "8"
2288
+ }
2289
+ ),
2290
+ /* @__PURE__ */ e(
2291
+ "path",
2292
+ {
2293
+ d: "M 10 55 A 40 40 0 0 1 90 55",
2294
+ fill: "none",
2295
+ stroke: "var(--nice-primary, #0066cc)",
2296
+ strokeWidth: "8",
2297
+ strokeDasharray: "63 126"
2298
+ }
2299
+ ),
2300
+ /* @__PURE__ */ e("text", { x: "50", y: "50", textAnchor: "middle", fontSize: "14", fontWeight: "bold", children: "50%" })
2301
+ ] }) });
2302
+ case "map":
2303
+ return /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__map-placeholder", children: [
2304
+ /* @__PURE__ */ e(u, { name: "map-pin", size: 32 }),
2305
+ /* @__PURE__ */ e("span", { children: "Device Map" }),
2306
+ /* @__PURE__ */ r("small", { children: [
2307
+ i.filter((o) => o.location).length,
2308
+ " devices with location"
2309
+ ] })
2310
+ ] });
2311
+ case "alarms": {
2312
+ const o = c.filter((t) => !t.cleared).slice(0, 5);
2313
+ 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(
2314
+ "div",
2315
+ {
2316
+ className: `nice-iot-dashboard__alarm-item nice-iot-dashboard__alarm-item--${t.severity}`,
2317
+ children: [
2318
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__alarm-severity", children: t.severity }),
2319
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__alarm-message", children: t.message })
2320
+ ]
2321
+ },
2322
+ t.id
2323
+ )) });
2324
+ }
2325
+ case "control-panel":
2326
+ return /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__control-placeholder", children: [
2327
+ /* @__PURE__ */ e(u, { name: "settings", size: 32 }),
2328
+ /* @__PURE__ */ e("span", { children: "Control Panel" }),
2329
+ /* @__PURE__ */ e("small", { children: "Configure device controls" })
2330
+ ] });
2331
+ case "kpi":
2332
+ return /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__kpi", children: [
2333
+ /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__kpi-value", children: i.length }),
2334
+ /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__kpi-label", children: "Total Devices" })
2335
+ ] });
2336
+ default:
2337
+ return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__widget-placeholder", children: a.type });
2338
+ }
2339
+ }
2340
+ function ke({ device: a, isSelected: i, onSelect: c }) {
2341
+ return /* @__PURE__ */ r(
2342
+ "div",
2343
+ {
2344
+ className: `nice-iot-dashboard__device-card ${i ? "nice-iot-dashboard__device-card--selected" : ""}`,
2345
+ onClick: c,
2346
+ children: [
2347
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__device-card-header", children: [
2348
+ /* @__PURE__ */ e(
2349
+ "span",
2350
+ {
2351
+ className: "nice-iot-dashboard__device-status",
2352
+ style: { background: I(a.status) }
2353
+ }
2354
+ ),
2355
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__device-name", children: a.name })
2356
+ ] }),
2357
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__device-card-body", children: [
2358
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__device-info", children: [
2359
+ /* @__PURE__ */ r("span", { children: [
2360
+ "Type: ",
2361
+ a.type
2362
+ ] }),
2363
+ /* @__PURE__ */ r("span", { children: [
2364
+ "Protocol: ",
2365
+ a.protocol
2366
+ ] })
2367
+ ] }),
2368
+ a.lastSeen && /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__device-lastseen", children: [
2369
+ "Last seen: ",
2370
+ a.lastSeen.toLocaleString()
2371
+ ] }),
2372
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__device-capabilities", children: [
2373
+ a.capabilities.slice(0, 3).map((n) => /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__capability-badge", children: n.name }, n.id)),
2374
+ a.capabilities.length > 3 && /* @__PURE__ */ r("span", { className: "nice-iot-dashboard__capability-more", children: [
2375
+ "+",
2376
+ a.capabilities.length - 3
2377
+ ] })
2378
+ ] })
2379
+ ] })
2380
+ ]
2381
+ }
2382
+ );
2383
+ }
2384
+ function xe({
2385
+ device: a,
2386
+ onCommand: i,
2387
+ onClose: c
2388
+ }) {
2389
+ return /* @__PURE__ */ r("aside", { className: "nice-iot-dashboard__device-detail", children: [
2390
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__device-detail-header", children: [
2391
+ /* @__PURE__ */ e("h3", { children: a.name }),
2392
+ /* @__PURE__ */ e("button", { onClick: c, children: "Γ—" })
2393
+ ] }),
2394
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__device-detail-content", children: [
2395
+ /* @__PURE__ */ r("section", { children: [
2396
+ /* @__PURE__ */ e("h4", { children: "Status" }),
2397
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__detail-row", children: [
2398
+ /* @__PURE__ */ e("span", { children: "Status:" }),
2399
+ /* @__PURE__ */ e(
2400
+ "span",
2401
+ {
2402
+ className: "nice-iot-dashboard__status-badge",
2403
+ style: { background: I(a.status) },
2404
+ children: a.status
2405
+ }
2406
+ )
2407
+ ] }),
2408
+ a.lastSeen && /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__detail-row", children: [
2409
+ /* @__PURE__ */ e("span", { children: "Last Seen:" }),
2410
+ /* @__PURE__ */ e("span", { children: a.lastSeen.toLocaleString() })
2411
+ ] })
2412
+ ] }),
2413
+ /* @__PURE__ */ r("section", { children: [
2414
+ /* @__PURE__ */ e("h4", { children: "Connection" }),
2415
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__detail-row", children: [
2416
+ /* @__PURE__ */ e("span", { children: "Protocol:" }),
2417
+ /* @__PURE__ */ e("span", { children: a.protocol })
2418
+ ] }),
2419
+ a.connectionInfo.host && /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__detail-row", children: [
2420
+ /* @__PURE__ */ e("span", { children: "Host:" }),
2421
+ /* @__PURE__ */ r("span", { children: [
2422
+ a.connectionInfo.host,
2423
+ ":",
2424
+ a.connectionInfo.port
2425
+ ] })
2426
+ ] })
2427
+ ] }),
2428
+ a.metadata && /* @__PURE__ */ r("section", { children: [
2429
+ /* @__PURE__ */ e("h4", { children: "Metadata" }),
2430
+ a.metadata.manufacturer && /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__detail-row", children: [
2431
+ /* @__PURE__ */ e("span", { children: "Manufacturer:" }),
2432
+ /* @__PURE__ */ e("span", { children: a.metadata.manufacturer })
2433
+ ] }),
2434
+ a.metadata.model && /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__detail-row", children: [
2435
+ /* @__PURE__ */ e("span", { children: "Model:" }),
2436
+ /* @__PURE__ */ e("span", { children: a.metadata.model })
2437
+ ] })
2438
+ ] }),
2439
+ /* @__PURE__ */ r("section", { children: [
2440
+ /* @__PURE__ */ e("h4", { children: "Capabilities" }),
2441
+ /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__capabilities-list", children: a.capabilities.map((n) => /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__capability-item", children: [
2442
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__capability-name", children: n.name }),
2443
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__capability-type", children: n.type }),
2444
+ n.writable && i && /* @__PURE__ */ e(
2445
+ "button",
2446
+ {
2447
+ className: "nice-iot-dashboard__capability-control",
2448
+ onClick: () => i(a.id, n.id, !0),
2449
+ children: "Control"
2450
+ }
2451
+ )
2452
+ ] }, n.id)) })
2453
+ ] })
2454
+ ] })
2455
+ ] });
2456
+ }
2457
+ const Se = [
2458
+ { name: "MQTT Broker", image: "eclipse-mosquitto:latest" },
2459
+ { name: "Node-RED", image: "nodered/node-red:latest" },
2460
+ { name: "InfluxDB", image: "influxdb:latest" },
2461
+ { name: "Grafana", image: "grafana/grafana:latest" },
2462
+ { name: "Telegraf", image: "telegraf:latest" },
2463
+ { name: "Protocol Adapter", image: "nice2dev/protocol-adapter:latest" }
2464
+ ];
2465
+ function Fe({
2466
+ nodes: a = [],
2467
+ modules: i = [],
2468
+ onNodeSelect: c,
2469
+ onModuleDeploy: n,
2470
+ onModuleAction: o,
2471
+ onNodeSync: t,
2472
+ className: d = ""
2473
+ }) {
2474
+ const [l, b] = y(null), [m, _] = y("nodes"), [w, g] = y(!1), [v, N] = y({
2475
+ name: "",
2476
+ image: "",
2477
+ status: "pending"
2478
+ }), H = C(
2479
+ (p) => {
2480
+ b(p), c == null || c(p);
2481
+ },
2482
+ [c]
2483
+ ), L = C(async () => {
2484
+ !l || !v.name || !v.image || (await (n == null ? void 0 : n(l.id, v)), g(!1), N({ name: "", image: "", status: "pending" }));
2485
+ }, [l, v, n]), z = C(
2486
+ async (p, k) => {
2487
+ l && await (o == null ? void 0 : o(l.id, p, k));
2488
+ },
2489
+ [l, o]
2490
+ ), A = C(async () => {
2491
+ l && await (t == null ? void 0 : t(l.id));
2492
+ }, [l, t]);
2493
+ return /* @__PURE__ */ r("div", { className: `nice-edge-manager ${d}`, children: [
2494
+ /* @__PURE__ */ r("header", { className: "nice-edge-manager__header", children: [
2495
+ /* @__PURE__ */ e("h1", { children: "Edge Manager" }),
2496
+ /* @__PURE__ */ r("nav", { className: "nice-edge-manager__nav", children: [
2497
+ /* @__PURE__ */ r("button", { className: m === "nodes" ? "active" : "", onClick: () => _("nodes"), children: [
2498
+ "Nodes (",
2499
+ a.length,
2500
+ ")"
2501
+ ] }),
2502
+ /* @__PURE__ */ e("button", { className: m === "modules" ? "active" : "", onClick: () => _("modules"), children: "Modules" })
2503
+ ] })
2504
+ ] }),
2505
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__main", children: [
2506
+ m === "nodes" && /* @__PURE__ */ e("div", { className: "nice-edge-manager__nodes", children: /* @__PURE__ */ r("div", { className: "nice-edge-manager__node-grid", children: [
2507
+ a.map((p) => /* @__PURE__ */ e(
2508
+ Te,
2509
+ {
2510
+ node: p,
2511
+ isSelected: (l == null ? void 0 : l.id) === p.id,
2512
+ onSelect: () => H(p)
2513
+ },
2514
+ p.id
2515
+ )),
2516
+ a.length === 0 && /* @__PURE__ */ e("div", { className: "nice-edge-manager__empty", children: "No edge nodes configured" })
2517
+ ] }) }),
2518
+ m === "modules" && l && /* @__PURE__ */ r("div", { className: "nice-edge-manager__modules", children: [
2519
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__modules-header", children: [
2520
+ /* @__PURE__ */ r("h3", { children: [
2521
+ "Modules on ",
2522
+ l.name
2523
+ ] }),
2524
+ /* @__PURE__ */ e(
2525
+ "button",
2526
+ {
2527
+ className: "nice-edge-manager__deploy-btn",
2528
+ onClick: () => g(!0),
2529
+ children: "+ Deploy Module"
2530
+ }
2531
+ )
2532
+ ] }),
2533
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__module-grid", children: [
2534
+ l.deployedModules.map((p) => /* @__PURE__ */ e(
2535
+ Ve,
2536
+ {
2537
+ module: p,
2538
+ onAction: (k) => z(p.id, k)
2539
+ },
2540
+ p.id
2541
+ )),
2542
+ l.deployedModules.length === 0 && /* @__PURE__ */ e("div", { className: "nice-edge-manager__empty", children: "No modules deployed on this node" })
2543
+ ] })
2544
+ ] }),
2545
+ m === "modules" && !l && /* @__PURE__ */ e("div", { className: "nice-edge-manager__no-selection", children: "Select a node from the Nodes tab to manage modules" }),
2546
+ l && /* @__PURE__ */ e(
2547
+ Ae,
2548
+ {
2549
+ node: l,
2550
+ onSync: A,
2551
+ onClose: () => b(null)
2552
+ }
2553
+ )
2554
+ ] }),
2555
+ w && /* @__PURE__ */ e(
2556
+ De,
2557
+ {
2558
+ config: v,
2559
+ templates: Se,
2560
+ onChange: N,
2561
+ onDeploy: L,
2562
+ onClose: () => g(!1)
2563
+ }
2564
+ )
2565
+ ] });
2566
+ }
2567
+ function ne(a) {
2568
+ switch (a) {
2569
+ case "running":
2570
+ return "var(--nice-success, #28a745)";
2571
+ case "stopped":
2572
+ return "var(--nice-text-secondary, #6c757d)";
2573
+ case "updating":
2574
+ return "var(--nice-warning, #ffc107)";
2575
+ case "error":
2576
+ return "var(--nice-danger, #dc3545)";
2577
+ case "unreachable":
2578
+ return "var(--nice-text-secondary, #868e96)";
2579
+ default:
2580
+ return "var(--nice-text-secondary, #6c757d)";
2581
+ }
2582
+ }
2583
+ function j(a) {
2584
+ 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`;
2585
+ }
2586
+ function Le(a) {
2587
+ const i = Math.floor(a / 86400), c = Math.floor(a % 86400 / 3600), n = Math.floor(a % 3600 / 60);
2588
+ return i > 0 ? `${i}d ${c}h` : c > 0 ? `${c}h ${n}m` : `${n}m`;
2589
+ }
2590
+ function Te({ node: a, isSelected: i, onSelect: c }) {
2591
+ return /* @__PURE__ */ r(
2592
+ "div",
2593
+ {
2594
+ className: `nice-edge-manager__node-card ${i ? "nice-edge-manager__node-card--selected" : ""}`,
2595
+ onClick: c,
2596
+ children: [
2597
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__node-header", children: [
2598
+ /* @__PURE__ */ e(
2599
+ "span",
2600
+ {
2601
+ className: "nice-edge-manager__node-status",
2602
+ style: { background: ne(a.status) }
2603
+ }
2604
+ ),
2605
+ /* @__PURE__ */ e("span", { className: "nice-edge-manager__node-name", children: a.name }),
2606
+ /* @__PURE__ */ e("span", { className: "nice-edge-manager__node-type", children: a.type })
2607
+ ] }),
2608
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__node-body", children: [
2609
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__node-info", children: [
2610
+ /* @__PURE__ */ r("span", { children: [
2611
+ /* @__PURE__ */ e(u, { name: "server", size: 12 }),
2612
+ " ",
2613
+ a.hardware.cpu
2614
+ ] }),
2615
+ /* @__PURE__ */ r("span", { children: [
2616
+ /* @__PURE__ */ e(u, { name: "database", size: 12 }),
2617
+ " ",
2618
+ (a.hardware.memoryMB / 1024).toFixed(1),
2619
+ " GB"
2620
+ ] })
2621
+ ] }),
2622
+ /* @__PURE__ */ e("div", { className: "nice-edge-manager__node-metrics", children: a.metrics && /* @__PURE__ */ r(D, { children: [
2623
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__metric", children: [
2624
+ /* @__PURE__ */ e("span", { className: "nice-edge-manager__metric-label", children: "CPU" }),
2625
+ /* @__PURE__ */ e("div", { className: "nice-edge-manager__metric-bar", children: /* @__PURE__ */ e(
2626
+ "div",
2627
+ {
2628
+ className: "nice-edge-manager__metric-fill",
2629
+ style: { width: `${a.metrics.cpuUsage}%` }
2630
+ }
2631
+ ) }),
2632
+ /* @__PURE__ */ r("span", { className: "nice-edge-manager__metric-value", children: [
2633
+ a.metrics.cpuUsage.toFixed(0),
2634
+ "%"
2635
+ ] })
2636
+ ] }),
2637
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__metric", children: [
2638
+ /* @__PURE__ */ e("span", { className: "nice-edge-manager__metric-label", children: "MEM" }),
2639
+ /* @__PURE__ */ e("div", { className: "nice-edge-manager__metric-bar", children: /* @__PURE__ */ e(
2640
+ "div",
2641
+ {
2642
+ className: "nice-edge-manager__metric-fill",
2643
+ style: { width: `${a.metrics.memoryUsage}%` }
2644
+ }
2645
+ ) }),
2646
+ /* @__PURE__ */ r("span", { className: "nice-edge-manager__metric-value", children: [
2647
+ a.metrics.memoryUsage.toFixed(0),
2648
+ "%"
2649
+ ] })
2650
+ ] })
2651
+ ] }) }),
2652
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__node-modules", children: [
2653
+ a.deployedModules.length,
2654
+ " modules deployed"
2655
+ ] })
2656
+ ] })
2657
+ ]
2658
+ }
2659
+ );
2660
+ }
2661
+ function Ve({ module: a, onAction: i }) {
2662
+ return /* @__PURE__ */ r("div", { className: "nice-edge-manager__module-card", children: [
2663
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__module-header", children: [
2664
+ /* @__PURE__ */ e(
2665
+ "span",
2666
+ {
2667
+ className: "nice-edge-manager__module-status",
2668
+ style: {
2669
+ background: {
2670
+ running: "var(--nice-success, #28a745)",
2671
+ stopped: "var(--nice-text-secondary, #6c757d)",
2672
+ error: "var(--nice-danger, #dc3545)",
2673
+ pending: "var(--nice-warning, #ffc107)"
2674
+ }[a.status] || "var(--nice-bg-tertiary, #6c757d)"
2675
+ }
2676
+ }
2677
+ ),
2678
+ /* @__PURE__ */ e("span", { className: "nice-edge-manager__module-name", children: a.name }),
2679
+ /* @__PURE__ */ r("span", { className: "nice-edge-manager__module-version", children: [
2680
+ "v",
2681
+ a.version
2682
+ ] })
2683
+ ] }),
2684
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__module-body", children: [
2685
+ /* @__PURE__ */ e("div", { className: "nice-edge-manager__module-image", children: a.image }),
2686
+ a.resources && /* @__PURE__ */ r("div", { className: "nice-edge-manager__module-resources", children: [
2687
+ a.resources.cpuLimit && /* @__PURE__ */ r("span", { children: [
2688
+ "CPU: ",
2689
+ a.resources.cpuLimit
2690
+ ] }),
2691
+ a.resources.memoryLimitMB && /* @__PURE__ */ r("span", { children: [
2692
+ "RAM: ",
2693
+ a.resources.memoryLimitMB,
2694
+ " MB"
2695
+ ] })
2696
+ ] }),
2697
+ a.ports && a.ports.length > 0 && /* @__PURE__ */ r("div", { className: "nice-edge-manager__module-ports", children: [
2698
+ "Ports: ",
2699
+ a.ports.map((n) => `${n.host}:${n.container}`).join(", ")
2700
+ ] })
2701
+ ] }),
2702
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__module-actions", children: [
2703
+ a.status === "running" && /* @__PURE__ */ r(D, { children: [
2704
+ /* @__PURE__ */ e("button", { onClick: () => i("stop"), children: "Stop" }),
2705
+ /* @__PURE__ */ e("button", { onClick: () => i("restart"), children: "Restart" })
2706
+ ] }),
2707
+ a.status === "stopped" && /* @__PURE__ */ e("button", { onClick: () => i("start"), children: "Start" }),
2708
+ /* @__PURE__ */ e("button", { className: "nice-edge-manager__module-remove", onClick: () => i("remove"), children: "Remove" })
2709
+ ] })
2710
+ ] });
2711
+ }
2712
+ function Ae({ node: a, onSync: i, onClose: c }) {
2713
+ return /* @__PURE__ */ r("aside", { className: "nice-edge-manager__detail", children: [
2714
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-header", children: [
2715
+ /* @__PURE__ */ e("h3", { children: a.name }),
2716
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-actions", children: [
2717
+ /* @__PURE__ */ r("button", { onClick: i, children: [
2718
+ /* @__PURE__ */ e(u, { name: "refresh", size: 14 }),
2719
+ " Sync"
2720
+ ] }),
2721
+ /* @__PURE__ */ e("button", { onClick: c, "aria-label": "Close", children: /* @__PURE__ */ e(u, { name: "close", size: 14 }) })
2722
+ ] })
2723
+ ] }),
2724
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-content", children: [
2725
+ /* @__PURE__ */ r("section", { children: [
2726
+ /* @__PURE__ */ e("h4", { children: "Status" }),
2727
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2728
+ /* @__PURE__ */ e("span", { children: "Status:" }),
2729
+ /* @__PURE__ */ e(
2730
+ "span",
2731
+ {
2732
+ className: "nice-edge-manager__status-badge",
2733
+ style: { background: ne(a.status) },
2734
+ children: a.status
2735
+ }
2736
+ )
2737
+ ] }),
2738
+ a.metrics && /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2739
+ /* @__PURE__ */ e("span", { children: "Uptime:" }),
2740
+ /* @__PURE__ */ e("span", { children: Le(a.metrics.uptime) })
2741
+ ] })
2742
+ ] }),
2743
+ /* @__PURE__ */ r("section", { children: [
2744
+ /* @__PURE__ */ e("h4", { children: "Hardware" }),
2745
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2746
+ /* @__PURE__ */ e("span", { children: "CPU:" }),
2747
+ /* @__PURE__ */ r("span", { children: [
2748
+ a.hardware.cpu,
2749
+ " (",
2750
+ a.hardware.cores,
2751
+ " cores)"
2752
+ ] })
2753
+ ] }),
2754
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2755
+ /* @__PURE__ */ e("span", { children: "Memory:" }),
2756
+ /* @__PURE__ */ r("span", { children: [
2757
+ (a.hardware.memoryMB / 1024).toFixed(1),
2758
+ " GB"
2759
+ ] })
2760
+ ] }),
2761
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2762
+ /* @__PURE__ */ e("span", { children: "Storage:" }),
2763
+ /* @__PURE__ */ r("span", { children: [
2764
+ (a.hardware.storageMB / 1024).toFixed(1),
2765
+ " GB"
2766
+ ] })
2767
+ ] }),
2768
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2769
+ /* @__PURE__ */ e("span", { children: "Architecture:" }),
2770
+ /* @__PURE__ */ e("span", { children: a.hardware.architecture })
2771
+ ] })
2772
+ ] }),
2773
+ /* @__PURE__ */ r("section", { children: [
2774
+ /* @__PURE__ */ e("h4", { children: "Software" }),
2775
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2776
+ /* @__PURE__ */ e("span", { children: "OS:" }),
2777
+ /* @__PURE__ */ r("span", { children: [
2778
+ a.software.os,
2779
+ " ",
2780
+ a.software.osVersion
2781
+ ] })
2782
+ ] }),
2783
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2784
+ /* @__PURE__ */ e("span", { children: "Runtime:" }),
2785
+ /* @__PURE__ */ r("span", { children: [
2786
+ a.software.runtime,
2787
+ " ",
2788
+ a.software.runtimeVersion
2789
+ ] })
2790
+ ] }),
2791
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2792
+ /* @__PURE__ */ e("span", { children: "Agent:" }),
2793
+ /* @__PURE__ */ r("span", { children: [
2794
+ a.software.agent,
2795
+ " v",
2796
+ a.software.agentVersion
2797
+ ] })
2798
+ ] })
2799
+ ] }),
2800
+ /* @__PURE__ */ r("section", { children: [
2801
+ /* @__PURE__ */ e("h4", { children: "Connectivity" }),
2802
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2803
+ /* @__PURE__ */ e("span", { children: "Cloud:" }),
2804
+ /* @__PURE__ */ r("span", { children: [
2805
+ /* @__PURE__ */ e(u, { name: a.connectivity.cloudConnected ? "check" : "close", size: 12 }),
2806
+ " ",
2807
+ a.connectivity.cloudConnected ? "Connected" : "Disconnected"
2808
+ ] })
2809
+ ] }),
2810
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2811
+ /* @__PURE__ */ e("span", { children: "Network:" }),
2812
+ /* @__PURE__ */ e("span", { children: a.connectivity.localNetwork })
2813
+ ] }),
2814
+ a.connectivity.publicIP && /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2815
+ /* @__PURE__ */ e("span", { children: "Public IP:" }),
2816
+ /* @__PURE__ */ e("span", { children: a.connectivity.publicIP })
2817
+ ] }),
2818
+ a.connectivity.lastSync && /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2819
+ /* @__PURE__ */ e("span", { children: "Last Sync:" }),
2820
+ /* @__PURE__ */ e("span", { children: a.connectivity.lastSync.toLocaleString() })
2821
+ ] })
2822
+ ] }),
2823
+ a.metrics && /* @__PURE__ */ r("section", { children: [
2824
+ /* @__PURE__ */ e("h4", { children: "Resource Usage" }),
2825
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__resource-chart", children: [
2826
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__resource-item", children: [
2827
+ /* @__PURE__ */ e("span", { children: "CPU" }),
2828
+ /* @__PURE__ */ e("div", { className: "nice-edge-manager__resource-bar", children: /* @__PURE__ */ e(
2829
+ "div",
2830
+ {
2831
+ className: "nice-edge-manager__resource-fill",
2832
+ style: { width: `${a.metrics.cpuUsage}%` }
2833
+ }
2834
+ ) }),
2835
+ /* @__PURE__ */ r("span", { children: [
2836
+ a.metrics.cpuUsage.toFixed(1),
2837
+ "%"
2838
+ ] })
2839
+ ] }),
2840
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__resource-item", children: [
2841
+ /* @__PURE__ */ e("span", { children: "Memory" }),
2842
+ /* @__PURE__ */ e("div", { className: "nice-edge-manager__resource-bar", children: /* @__PURE__ */ e(
2843
+ "div",
2844
+ {
2845
+ className: "nice-edge-manager__resource-fill",
2846
+ style: { width: `${a.metrics.memoryUsage}%` }
2847
+ }
2848
+ ) }),
2849
+ /* @__PURE__ */ r("span", { children: [
2850
+ a.metrics.memoryUsage.toFixed(1),
2851
+ "%"
2852
+ ] })
2853
+ ] }),
2854
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__resource-item", children: [
2855
+ /* @__PURE__ */ e("span", { children: "Disk" }),
2856
+ /* @__PURE__ */ e("div", { className: "nice-edge-manager__resource-bar", children: /* @__PURE__ */ e(
2857
+ "div",
2858
+ {
2859
+ className: "nice-edge-manager__resource-fill",
2860
+ style: { width: `${a.metrics.diskUsage}%` }
2861
+ }
2862
+ ) }),
2863
+ /* @__PURE__ */ r("span", { children: [
2864
+ a.metrics.diskUsage.toFixed(1),
2865
+ "%"
2866
+ ] })
2867
+ ] })
2868
+ ] }),
2869
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__network-stats", children: [
2870
+ /* @__PURE__ */ r("span", { children: [
2871
+ "↓ ",
2872
+ j(a.metrics.networkIn)
2873
+ ] }),
2874
+ /* @__PURE__ */ r("span", { children: [
2875
+ "↑ ",
2876
+ j(a.metrics.networkOut)
2877
+ ] })
2878
+ ] })
2879
+ ] })
2880
+ ] })
2881
+ ] });
2882
+ }
2883
+ function De({
2884
+ config: a,
2885
+ templates: i,
2886
+ onChange: c,
2887
+ onDeploy: n,
2888
+ onClose: o
2889
+ }) {
2890
+ return /* @__PURE__ */ e("div", { className: "nice-edge-manager__dialog-overlay", children: /* @__PURE__ */ r("div", { className: "nice-edge-manager__dialog", children: [
2891
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__dialog-header", children: [
2892
+ /* @__PURE__ */ e("h3", { children: "Deploy Module" }),
2893
+ /* @__PURE__ */ e("button", { onClick: o, "aria-label": "Close", children: /* @__PURE__ */ e(u, { name: "close", size: 14 }) })
2894
+ ] }),
2895
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__dialog-content", children: [
2896
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__field", children: [
2897
+ /* @__PURE__ */ e("label", { children: "Template (optional)" }),
2898
+ /* @__PURE__ */ r(
2899
+ "select",
2900
+ {
2901
+ value: "",
2902
+ onChange: (t) => {
2903
+ const d = i.find((l) => l.image === t.target.value);
2904
+ d && c({
2905
+ ...a,
2906
+ name: d.name,
2907
+ image: d.image
2908
+ });
2909
+ },
2910
+ children: [
2911
+ /* @__PURE__ */ e("option", { value: "", children: "Select a template..." }),
2912
+ i.map((t) => /* @__PURE__ */ e("option", { value: t.image, children: t.name }, t.image))
2913
+ ]
2914
+ }
2915
+ )
2916
+ ] }),
2917
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__field", children: [
2918
+ /* @__PURE__ */ e("label", { children: "Module Name" }),
2919
+ /* @__PURE__ */ e(
2920
+ "input",
2921
+ {
2922
+ type: "text",
2923
+ value: a.name || "",
2924
+ onChange: (t) => c({ ...a, name: t.target.value }),
2925
+ placeholder: "e.g., my-module"
2926
+ }
2927
+ )
2928
+ ] }),
2929
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__field", children: [
2930
+ /* @__PURE__ */ e("label", { children: "Container Image" }),
2931
+ /* @__PURE__ */ e(
2932
+ "input",
2933
+ {
2934
+ type: "text",
2935
+ value: a.image || "",
2936
+ onChange: (t) => c({ ...a, image: t.target.value }),
2937
+ placeholder: "e.g., nginx:latest"
2938
+ }
2939
+ )
2940
+ ] }),
2941
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__field", children: [
2942
+ /* @__PURE__ */ e("label", { children: "Version" }),
2943
+ /* @__PURE__ */ e(
2944
+ "input",
2945
+ {
2946
+ type: "text",
2947
+ value: a.version || "1.0.0",
2948
+ onChange: (t) => c({ ...a, version: t.target.value })
2949
+ }
2950
+ )
2951
+ ] })
2952
+ ] }),
2953
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__dialog-footer", children: [
2954
+ /* @__PURE__ */ e("button", { onClick: o, children: "Cancel" }),
2955
+ /* @__PURE__ */ e("button", { className: "nice-edge-manager__deploy-confirm", onClick: n, children: "Deploy" })
2956
+ ] })
2957
+ ] }) });
2958
+ }
2959
+ const Q = {
2671
2960
  broker: "localhost",
2672
2961
  port: 1883,
2673
2962
  clientId: `nice2dev-${Date.now()}`,
@@ -2675,238 +2964,244 @@ const G = {
2675
2964
  keepAlive: 60,
2676
2965
  cleanSession: !0,
2677
2966
  topics: []
2678
- }, V = {
2967
+ }, J = {
2679
2968
  host: "localhost",
2680
2969
  port: 5683,
2681
2970
  useDTLS: !1,
2682
2971
  resources: []
2683
- }, Q = {
2972
+ }, K = {
2684
2973
  type: "tcp",
2685
2974
  host: "localhost",
2686
2975
  port: 502,
2687
2976
  slaveId: 1,
2688
2977
  timeout: 1e3,
2689
2978
  registers: []
2690
- }, j = {
2979
+ }, X = {
2691
2980
  endpointUrl: "opc.tcp://localhost:4840",
2692
2981
  securityMode: "None",
2693
2982
  authentication: "anonymous",
2694
2983
  applicationName: "Nice2Dev IoT Client",
2695
2984
  nodes: []
2696
2985
  };
2697
- function Ae({
2698
- protocol: r = "mqtt",
2986
+ function Oe({
2987
+ protocol: a = "mqtt",
2699
2988
  config: i,
2700
2989
  onSave: c,
2701
2990
  onTest: n,
2702
2991
  className: o = ""
2703
2992
  }) {
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) {
2993
+ const { t } = R(), [d, l] = y(a), [b, m] = y(
2994
+ (i == null ? void 0 : i.type) === "mqtt" ? { ...Q, ...i.config } : Q
2995
+ ), [_, w] = y(
2996
+ (i == null ? void 0 : i.type) === "coap" ? { ...J, ...i.config } : J
2997
+ ), [g, v] = y(
2998
+ (i == null ? void 0 : i.type) === "modbus" ? { ...K, ...i.config } : K
2999
+ ), [N, H] = y(
3000
+ (i == null ? void 0 : i.type) === "opcua" ? { ...X, ...i.config } : X
3001
+ ), [L, z] = y(null), [A, p] = y(!1), k = C(() => {
3002
+ switch (d) {
2714
3003
  case "mqtt":
2715
- return g;
3004
+ return b;
2716
3005
  case "coap":
2717
- return C;
3006
+ return _;
2718
3007
  case "modbus-tcp":
2719
3008
  case "modbus-rtu":
2720
- return v;
3009
+ return g;
2721
3010
  case "opcua":
2722
- return _;
3011
+ return N;
2723
3012
  default:
2724
- return g;
3013
+ return b;
2725
3014
  }
2726
- }, [t, g, C, v, _]), L = w(() => {
3015
+ }, [d, b, _, g, N]), E = C(() => {
2727
3016
  c == null || c(k());
2728
- }, [k, c]), $ = w(async () => {
3017
+ }, [k, c]), U = C(async () => {
2729
3018
  if (n) {
2730
- y(!0), x(null);
3019
+ p(!0), z(null);
2731
3020
  try {
2732
- const M = await n(k());
2733
- x(M);
2734
- } catch (M) {
2735
- x({ success: !1, message: String(M) });
3021
+ const T = await n(k());
3022
+ z(T);
3023
+ } catch (T) {
3024
+ z({ success: !1, message: String(T) });
2736
3025
  } finally {
2737
- y(!1);
3026
+ p(!1);
2738
3027
  }
2739
3028
  }
2740
3029
  }, [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: [
3030
+ return /* @__PURE__ */ r("div", { className: `nice-protocol-config ${o}`, children: [
3031
+ /* @__PURE__ */ r("header", { className: "nice-protocol-config__header", children: [
3032
+ /* @__PURE__ */ e("h2", { children: t("protocolConfig.title", "Protocol Configuration") }),
3033
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__protocol-selector", children: [
2745
3034
  /* @__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") })
3035
+ /* @__PURE__ */ r("select", { value: d, onChange: (T) => l(T.target.value), children: [
3036
+ /* @__PURE__ */ e("option", { value: "mqtt", children: t("protocolConfig.mqtt", "MQTT") }),
3037
+ /* @__PURE__ */ e("option", { value: "coap", children: t("protocolConfig.coap", "CoAP") }),
3038
+ /* @__PURE__ */ e("option", { value: "modbus-tcp", children: t("protocolConfig.modbusTcp", "Modbus TCP") }),
3039
+ /* @__PURE__ */ e("option", { value: "modbus-rtu", children: t("protocolConfig.modbusRtu", "Modbus RTU") }),
3040
+ /* @__PURE__ */ e("option", { value: "opcua", children: t("protocolConfig.opcUa", "OPC-UA") })
2752
3041
  ] })
2753
3042
  ] })
2754
3043
  ] }),
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,
3044
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__content", children: [
3045
+ d === "mqtt" && /* @__PURE__ */ e(Pe, { config: b, onChange: m }),
3046
+ d === "coap" && /* @__PURE__ */ e(Re, { config: _, onChange: w }),
3047
+ (d === "modbus-tcp" || d === "modbus-rtu") && /* @__PURE__ */ e(
3048
+ Ie,
2760
3049
  {
2761
- config: v,
2762
- type: t === "modbus-rtu" ? "rtu" : "tcp",
2763
- onChange: u
3050
+ config: g,
3051
+ type: d === "modbus-rtu" ? "rtu" : "tcp",
3052
+ onChange: v
2764
3053
  }
2765
3054
  ),
2766
- t === "opcua" && /* @__PURE__ */ e(De, { config: _, onChange: H })
3055
+ d === "opcua" && /* @__PURE__ */ e(Ee, { config: N, onChange: H })
2767
3056
  ] }),
2768
- P && /* @__PURE__ */ a(
3057
+ L && /* @__PURE__ */ r(
2769
3058
  "div",
2770
3059
  {
2771
- className: `nice-protocol-config__test-result nice-protocol-config__test-result--${P.success ? "success" : "error"}`,
3060
+ className: `nice-protocol-config__test-result nice-protocol-config__test-result--${L.success ? "success" : "error"}`,
2772
3061
  children: [
2773
- P.success ? "βœ“" : "βœ—",
3062
+ /* @__PURE__ */ e(u, { name: L.success ? "check" : "close", size: 14 }),
2774
3063
  " ",
2775
- P.message
3064
+ L.message
2776
3065
  ]
2777
3066
  }
2778
3067
  ),
2779
- /* @__PURE__ */ a("footer", { className: "nice-protocol-config__footer", children: [
3068
+ /* @__PURE__ */ r("footer", { className: "nice-protocol-config__footer", children: [
2780
3069
  /* @__PURE__ */ e(
2781
3070
  "button",
2782
3071
  {
2783
3072
  className: "nice-protocol-config__test-btn",
2784
- onClick: $,
2785
- disabled: R || !n,
2786
- children: R ? "Testing..." : "πŸ”Œ Test Connection"
3073
+ onClick: U,
3074
+ disabled: A || !n,
3075
+ children: A ? "Testing..." : /* @__PURE__ */ r(D, { children: [
3076
+ /* @__PURE__ */ e(u, { name: "plug", size: 14 }),
3077
+ " Test Connection"
3078
+ ] })
2787
3079
  }
2788
3080
  ),
2789
- /* @__PURE__ */ e("button", { className: "nice-protocol-config__save-btn", onClick: L, children: "πŸ’Ύ Save" })
3081
+ /* @__PURE__ */ r("button", { className: "nice-protocol-config__save-btn", onClick: E, children: [
3082
+ /* @__PURE__ */ e(u, { name: "save", size: 14 }),
3083
+ " Save"
3084
+ ] })
2790
3085
  ] })
2791
3086
  ] });
2792
3087
  }
2793
- function Te({ config: r, onChange: i }) {
2794
- const { t: c } = U();
2795
- return /* @__PURE__ */ a("div", { className: "nice-protocol-config__section", children: [
3088
+ function Pe({ config: a, onChange: i }) {
3089
+ const { t: c } = R();
3090
+ return /* @__PURE__ */ r("div", { className: "nice-protocol-config__section", children: [
2796
3091
  /* @__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: [
3092
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__grid", children: [
3093
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
2799
3094
  /* @__PURE__ */ e("label", { children: c("protocolConfig.broker", "Broker") }),
2800
3095
  /* @__PURE__ */ e(
2801
3096
  "input",
2802
3097
  {
2803
3098
  type: "text",
2804
- value: r.broker,
2805
- onChange: (n) => i({ ...r, broker: n.target.value }),
3099
+ value: a.broker,
3100
+ onChange: (n) => i({ ...a, broker: n.target.value }),
2806
3101
  placeholder: "localhost"
2807
3102
  }
2808
3103
  )
2809
3104
  ] }),
2810
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3105
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
2811
3106
  /* @__PURE__ */ e("label", { children: c("protocolConfig.port", "Port") }),
2812
3107
  /* @__PURE__ */ e(
2813
3108
  "input",
2814
3109
  {
2815
3110
  type: "number",
2816
- value: r.port,
2817
- onChange: (n) => i({ ...r, port: parseInt(n.target.value, 10) || 1883 })
3111
+ value: a.port,
3112
+ onChange: (n) => i({ ...a, port: parseInt(n.target.value, 10) || 1883 })
2818
3113
  }
2819
3114
  )
2820
3115
  ] }),
2821
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3116
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
2822
3117
  /* @__PURE__ */ e("label", { children: c("protocolConfig.clientId", "Client ID") }),
2823
3118
  /* @__PURE__ */ e(
2824
3119
  "input",
2825
3120
  {
2826
3121
  type: "text",
2827
- value: r.clientId,
2828
- onChange: (n) => i({ ...r, clientId: n.target.value })
3122
+ value: a.clientId,
3123
+ onChange: (n) => i({ ...a, clientId: n.target.value })
2829
3124
  }
2830
3125
  )
2831
3126
  ] }),
2832
- /* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ a("label", { children: [
3127
+ /* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ r("label", { children: [
2833
3128
  /* @__PURE__ */ e(
2834
3129
  "input",
2835
3130
  {
2836
3131
  type: "checkbox",
2837
- checked: r.useTLS,
2838
- onChange: (n) => i({ ...r, useTLS: n.target.checked })
3132
+ checked: a.useTLS,
3133
+ onChange: (n) => i({ ...a, useTLS: n.target.checked })
2839
3134
  }
2840
3135
  ),
2841
3136
  c("protocolConfig.useTls", "Use TLS")
2842
3137
  ] }) }),
2843
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3138
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
2844
3139
  /* @__PURE__ */ e("label", { children: c("protocolConfig.username", "Username") }),
2845
3140
  /* @__PURE__ */ e(
2846
3141
  "input",
2847
3142
  {
2848
3143
  type: "text",
2849
- value: r.username || "",
2850
- onChange: (n) => i({ ...r, username: n.target.value })
3144
+ value: a.username || "",
3145
+ onChange: (n) => i({ ...a, username: n.target.value })
2851
3146
  }
2852
3147
  )
2853
3148
  ] }),
2854
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3149
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
2855
3150
  /* @__PURE__ */ e("label", { children: c("protocolConfig.password", "Password") }),
2856
3151
  /* @__PURE__ */ e(
2857
3152
  "input",
2858
3153
  {
2859
3154
  type: "password",
2860
- value: r.password || "",
2861
- onChange: (n) => i({ ...r, password: n.target.value })
3155
+ value: a.password || "",
3156
+ onChange: (n) => i({ ...a, password: n.target.value })
2862
3157
  }
2863
3158
  )
2864
3159
  ] }),
2865
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3160
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
2866
3161
  /* @__PURE__ */ e("label", { children: "Keep Alive (seconds)" }),
2867
3162
  /* @__PURE__ */ e(
2868
3163
  "input",
2869
3164
  {
2870
3165
  type: "number",
2871
- value: r.keepAlive,
2872
- onChange: (n) => i({ ...r, keepAlive: parseInt(n.target.value, 10) || 60 })
3166
+ value: a.keepAlive,
3167
+ onChange: (n) => i({ ...a, keepAlive: parseInt(n.target.value, 10) || 60 })
2873
3168
  }
2874
3169
  )
2875
3170
  ] }),
2876
- /* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ a("label", { children: [
3171
+ /* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ r("label", { children: [
2877
3172
  /* @__PURE__ */ e(
2878
3173
  "input",
2879
3174
  {
2880
3175
  type: "checkbox",
2881
- checked: r.cleanSession,
2882
- onChange: (n) => i({ ...r, cleanSession: n.target.checked })
3176
+ checked: a.cleanSession,
3177
+ onChange: (n) => i({ ...a, cleanSession: n.target.checked })
2883
3178
  }
2884
3179
  ),
2885
3180
  c("protocolConfig.cleanSession", "Clean Session")
2886
3181
  ] }) })
2887
3182
  ] }),
2888
3183
  /* @__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: [
3184
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__topics", children: [
3185
+ a.topics.map((n, o) => /* @__PURE__ */ r("div", { className: "nice-protocol-config__topic-row", children: [
2891
3186
  /* @__PURE__ */ e(
2892
3187
  "input",
2893
3188
  {
2894
3189
  type: "text",
2895
3190
  value: n.pattern,
2896
- onChange: (d) => {
2897
- const t = [...r.topics];
2898
- t[o] = { ...t[o], pattern: d.target.value }, i({ ...r, topics: t });
3191
+ onChange: (t) => {
3192
+ const d = [...a.topics];
3193
+ d[o] = { ...d[o], pattern: t.target.value }, i({ ...a, topics: d });
2899
3194
  },
2900
3195
  placeholder: c("protocolConfig.topicPatternPlaceholder", "e.g., sensors/+/data")
2901
3196
  }
2902
3197
  ),
2903
- /* @__PURE__ */ a(
3198
+ /* @__PURE__ */ r(
2904
3199
  "select",
2905
3200
  {
2906
3201
  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 });
3202
+ onChange: (t) => {
3203
+ const d = [...a.topics];
3204
+ d[o] = { ...d[o], qos: parseInt(t.target.value, 10) }, i({ ...a, topics: d });
2910
3205
  },
2911
3206
  children: [
2912
3207
  /* @__PURE__ */ e("option", { value: 0, children: c("protocolConfig.qos0", "QoS 0") }),
@@ -2915,16 +3210,16 @@ function Te({ config: r, onChange: i }) {
2915
3210
  ]
2916
3211
  }
2917
3212
  ),
2918
- /* @__PURE__ */ a(
3213
+ /* @__PURE__ */ r(
2919
3214
  "select",
2920
3215
  {
2921
3216
  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 });
3217
+ onChange: (t) => {
3218
+ const d = [...a.topics];
3219
+ d[o] = {
3220
+ ...d[o],
3221
+ direction: t.target.value
3222
+ }, i({ ...a, topics: d });
2928
3223
  },
2929
3224
  children: [
2930
3225
  /* @__PURE__ */ e("option", { value: "subscribe", children: c("protocolConfig.subscribe", "Subscribe") }),
@@ -2937,8 +3232,8 @@ function Te({ config: r, onChange: i }) {
2937
3232
  "button",
2938
3233
  {
2939
3234
  onClick: () => {
2940
- const d = r.topics.filter((t, l) => l !== o);
2941
- i({ ...r, topics: d });
3235
+ const t = a.topics.filter((d, l) => l !== o);
3236
+ i({ ...a, topics: t });
2942
3237
  },
2943
3238
  children: "Γ—"
2944
3239
  }
@@ -2949,9 +3244,9 @@ function Te({ config: r, onChange: i }) {
2949
3244
  {
2950
3245
  onClick: () => {
2951
3246
  i({
2952
- ...r,
3247
+ ...a,
2953
3248
  topics: [
2954
- ...r.topics,
3249
+ ...a.topics,
2955
3250
  { pattern: "", qos: 0, direction: "subscribe", payloadFormat: "json" }
2956
3251
  ]
2957
3252
  });
@@ -2962,67 +3257,67 @@ function Te({ config: r, onChange: i }) {
2962
3257
  ] })
2963
3258
  ] });
2964
3259
  }
2965
- function Pe({ config: r, onChange: i }) {
2966
- const { t: c } = U();
2967
- return /* @__PURE__ */ a("div", { className: "nice-protocol-config__section", children: [
3260
+ function Re({ config: a, onChange: i }) {
3261
+ const { t: c } = R();
3262
+ return /* @__PURE__ */ r("div", { className: "nice-protocol-config__section", children: [
2968
3263
  /* @__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: [
3264
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__grid", children: [
3265
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
2971
3266
  /* @__PURE__ */ e("label", { children: c("protocolConfig.host", "Host") }),
2972
3267
  /* @__PURE__ */ e(
2973
3268
  "input",
2974
3269
  {
2975
3270
  type: "text",
2976
- value: r.host,
2977
- onChange: (n) => i({ ...r, host: n.target.value })
3271
+ value: a.host,
3272
+ onChange: (n) => i({ ...a, host: n.target.value })
2978
3273
  }
2979
3274
  )
2980
3275
  ] }),
2981
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3276
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
2982
3277
  /* @__PURE__ */ e("label", { children: c("protocolConfig.port", "Port") }),
2983
3278
  /* @__PURE__ */ e(
2984
3279
  "input",
2985
3280
  {
2986
3281
  type: "number",
2987
- value: r.port,
2988
- onChange: (n) => i({ ...r, port: parseInt(n.target.value, 10) || 5683 })
3282
+ value: a.port,
3283
+ onChange: (n) => i({ ...a, port: parseInt(n.target.value, 10) || 5683 })
2989
3284
  }
2990
3285
  )
2991
3286
  ] }),
2992
- /* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ a("label", { children: [
3287
+ /* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ r("label", { children: [
2993
3288
  /* @__PURE__ */ e(
2994
3289
  "input",
2995
3290
  {
2996
3291
  type: "checkbox",
2997
- checked: r.useDTLS,
2998
- onChange: (n) => i({ ...r, useDTLS: n.target.checked })
3292
+ checked: a.useDTLS,
3293
+ onChange: (n) => i({ ...a, useDTLS: n.target.checked })
2999
3294
  }
3000
3295
  ),
3001
3296
  c("protocolConfig.useDtls", "Use DTLS")
3002
3297
  ] }) }),
3003
- /* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ a("label", { children: [
3298
+ /* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ r("label", { children: [
3004
3299
  /* @__PURE__ */ e(
3005
3300
  "input",
3006
3301
  {
3007
3302
  type: "checkbox",
3008
- checked: r.observe || !1,
3009
- onChange: (n) => i({ ...r, observe: n.target.checked })
3303
+ checked: a.observe || !1,
3304
+ onChange: (n) => i({ ...a, observe: n.target.checked })
3010
3305
  }
3011
3306
  ),
3012
3307
  c("protocolConfig.enableObserve", "Enable Observe")
3013
3308
  ] }) })
3014
3309
  ] }),
3015
3310
  /* @__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: [
3311
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__resources", children: [
3312
+ a.resources.map((n, o) => /* @__PURE__ */ r("div", { className: "nice-protocol-config__resource-row", children: [
3018
3313
  /* @__PURE__ */ e(
3019
3314
  "input",
3020
3315
  {
3021
3316
  type: "text",
3022
3317
  value: n.path,
3023
- onChange: (d) => {
3024
- const t = [...r.resources];
3025
- t[o] = { ...t[o], path: d.target.value }, i({ ...r, resources: t });
3318
+ onChange: (t) => {
3319
+ const d = [...a.resources];
3320
+ d[o] = { ...d[o], path: t.target.value }, i({ ...a, resources: d });
3026
3321
  },
3027
3322
  placeholder: "/sensors/temperature"
3028
3323
  }
@@ -3031,8 +3326,8 @@ function Pe({ config: r, onChange: i }) {
3031
3326
  "button",
3032
3327
  {
3033
3328
  onClick: () => {
3034
- const d = r.resources.filter((t, l) => l !== o);
3035
- i({ ...r, resources: d });
3329
+ const t = a.resources.filter((d, l) => l !== o);
3330
+ i({ ...a, resources: t });
3036
3331
  },
3037
3332
  children: "Γ—"
3038
3333
  }
@@ -3043,9 +3338,9 @@ function Pe({ config: r, onChange: i }) {
3043
3338
  {
3044
3339
  onClick: () => {
3045
3340
  i({
3046
- ...r,
3341
+ ...a,
3047
3342
  resources: [
3048
- ...r.resources,
3343
+ ...a.resources,
3049
3344
  { path: "", methods: ["GET"], mediaType: "application/json", observable: !1 }
3050
3345
  ]
3051
3346
  });
@@ -3056,63 +3351,63 @@ function Pe({ config: r, onChange: i }) {
3056
3351
  ] })
3057
3352
  ] });
3058
3353
  }
3059
- function Me({
3060
- config: r,
3354
+ function Ie({
3355
+ config: a,
3061
3356
  type: i,
3062
3357
  onChange: c
3063
3358
  }) {
3064
- const { t: n } = U();
3065
- return /* @__PURE__ */ a("div", { className: "nice-protocol-config__section", children: [
3066
- /* @__PURE__ */ a("h3", { children: [
3359
+ const { t: n } = R();
3360
+ return /* @__PURE__ */ r("div", { className: "nice-protocol-config__section", children: [
3361
+ /* @__PURE__ */ r("h3", { children: [
3067
3362
  "Modbus ",
3068
3363
  i.toUpperCase(),
3069
3364
  " Configuration"
3070
3365
  ] }),
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: [
3366
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__grid", children: [
3367
+ i === "tcp" && /* @__PURE__ */ r(D, { children: [
3368
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3074
3369
  /* @__PURE__ */ e("label", { children: n("protocolConfig.host", "Host") }),
3075
3370
  /* @__PURE__ */ e(
3076
3371
  "input",
3077
3372
  {
3078
3373
  type: "text",
3079
- value: r.host || "",
3080
- onChange: (o) => c({ ...r, host: o.target.value })
3374
+ value: a.host || "",
3375
+ onChange: (o) => c({ ...a, host: o.target.value })
3081
3376
  }
3082
3377
  )
3083
3378
  ] }),
3084
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3379
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3085
3380
  /* @__PURE__ */ e("label", { children: n("protocolConfig.port", "Port") }),
3086
3381
  /* @__PURE__ */ e(
3087
3382
  "input",
3088
3383
  {
3089
3384
  type: "number",
3090
- value: r.port || 502,
3091
- onChange: (o) => c({ ...r, port: parseInt(o.target.value, 10) || 502 })
3385
+ value: a.port || 502,
3386
+ onChange: (o) => c({ ...a, port: parseInt(o.target.value, 10) || 502 })
3092
3387
  }
3093
3388
  )
3094
3389
  ] })
3095
3390
  ] }),
3096
- i === "rtu" && /* @__PURE__ */ a(E, { children: [
3097
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3391
+ i === "rtu" && /* @__PURE__ */ r(D, { children: [
3392
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3098
3393
  /* @__PURE__ */ e("label", { children: n("protocolConfig.serialPort", "Serial Port") }),
3099
3394
  /* @__PURE__ */ e(
3100
3395
  "input",
3101
3396
  {
3102
3397
  type: "text",
3103
- value: r.serialPort || "",
3104
- onChange: (o) => c({ ...r, serialPort: o.target.value }),
3398
+ value: a.serialPort || "",
3399
+ onChange: (o) => c({ ...a, serialPort: o.target.value }),
3105
3400
  placeholder: n("protocolConfig.serialPortPlaceholder", "COM1 or /dev/ttyUSB0")
3106
3401
  }
3107
3402
  )
3108
3403
  ] }),
3109
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3404
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3110
3405
  /* @__PURE__ */ e("label", { children: n("protocolConfig.baudRate", "Baud Rate") }),
3111
- /* @__PURE__ */ a(
3406
+ /* @__PURE__ */ r(
3112
3407
  "select",
3113
3408
  {
3114
- value: r.baudRate || 9600,
3115
- onChange: (o) => c({ ...r, baudRate: parseInt(o.target.value, 10) }),
3409
+ value: a.baudRate || 9600,
3410
+ onChange: (o) => c({ ...a, baudRate: parseInt(o.target.value, 10) }),
3116
3411
  children: [
3117
3412
  /* @__PURE__ */ e("option", { value: 9600, children: "9600" }),
3118
3413
  /* @__PURE__ */ e("option", { value: 19200, children: "19200" }),
@@ -3123,13 +3418,13 @@ function Me({
3123
3418
  }
3124
3419
  )
3125
3420
  ] }),
3126
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3421
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3127
3422
  /* @__PURE__ */ e("label", { children: n("protocolConfig.parity", "Parity") }),
3128
- /* @__PURE__ */ a(
3423
+ /* @__PURE__ */ r(
3129
3424
  "select",
3130
3425
  {
3131
- value: r.parity || "none",
3132
- onChange: (o) => c({ ...r, parity: o.target.value }),
3426
+ value: a.parity || "none",
3427
+ onChange: (o) => c({ ...a, parity: o.target.value }),
3133
3428
  children: [
3134
3429
  /* @__PURE__ */ e("option", { value: "none", children: n("protocolConfig.none", "None") }),
3135
3430
  /* @__PURE__ */ e("option", { value: "even", children: n("protocolConfig.even", "Even") }),
@@ -3139,34 +3434,34 @@ function Me({
3139
3434
  )
3140
3435
  ] })
3141
3436
  ] }),
3142
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3437
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3143
3438
  /* @__PURE__ */ e("label", { children: n("protocolConfig.slaveId", "Slave ID") }),
3144
3439
  /* @__PURE__ */ e(
3145
3440
  "input",
3146
3441
  {
3147
3442
  type: "number",
3148
- value: r.slaveId,
3149
- onChange: (o) => c({ ...r, slaveId: parseInt(o.target.value, 10) || 1 }),
3443
+ value: a.slaveId,
3444
+ onChange: (o) => c({ ...a, slaveId: parseInt(o.target.value, 10) || 1 }),
3150
3445
  min: 1,
3151
3446
  max: 247
3152
3447
  }
3153
3448
  )
3154
3449
  ] }),
3155
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3450
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3156
3451
  /* @__PURE__ */ e("label", { children: "Timeout (ms)" }),
3157
3452
  /* @__PURE__ */ e(
3158
3453
  "input",
3159
3454
  {
3160
3455
  type: "number",
3161
- value: r.timeout,
3162
- onChange: (o) => c({ ...r, timeout: parseInt(o.target.value, 10) || 1e3 })
3456
+ value: a.timeout,
3457
+ onChange: (o) => c({ ...a, timeout: parseInt(o.target.value, 10) || 1e3 })
3163
3458
  }
3164
3459
  )
3165
3460
  ] })
3166
3461
  ] }),
3167
3462
  /* @__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: [
3463
+ /* @__PURE__ */ r("table", { className: "nice-protocol-config__registers-table", children: [
3464
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ r("tr", { children: [
3170
3465
  /* @__PURE__ */ e("th", { children: n("protocolConfig.name", "Name") }),
3171
3466
  /* @__PURE__ */ e("th", { children: n("protocolConfig.address", "Address") }),
3172
3467
  /* @__PURE__ */ e("th", { children: n("protocolConfig.type", "Type") }),
@@ -3174,15 +3469,15 @@ function Me({
3174
3469
  /* @__PURE__ */ e("th", { children: "R/W" }),
3175
3470
  /* @__PURE__ */ e("th", {})
3176
3471
  ] }) }),
3177
- /* @__PURE__ */ e("tbody", { children: r.registers.map((o, d) => /* @__PURE__ */ a("tr", { children: [
3472
+ /* @__PURE__ */ e("tbody", { children: a.registers.map((o, t) => /* @__PURE__ */ r("tr", { children: [
3178
3473
  /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
3179
3474
  "input",
3180
3475
  {
3181
3476
  type: "text",
3182
3477
  value: o.name,
3183
- onChange: (t) => {
3184
- const l = [...r.registers];
3185
- l[d] = { ...l[d], name: t.target.value }, c({ ...r, registers: l });
3478
+ onChange: (d) => {
3479
+ const l = [...a.registers];
3480
+ l[t] = { ...l[t], name: d.target.value }, c({ ...a, registers: l });
3186
3481
  }
3187
3482
  }
3188
3483
  ) }),
@@ -3191,25 +3486,25 @@ function Me({
3191
3486
  {
3192
3487
  type: "number",
3193
3488
  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 });
3489
+ onChange: (d) => {
3490
+ const l = [...a.registers];
3491
+ l[t] = {
3492
+ ...l[t],
3493
+ address: parseInt(d.target.value, 10) || 0
3494
+ }, c({ ...a, registers: l });
3200
3495
  }
3201
3496
  }
3202
3497
  ) }),
3203
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ a(
3498
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ r(
3204
3499
  "select",
3205
3500
  {
3206
3501
  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 });
3502
+ onChange: (d) => {
3503
+ const l = [...a.registers];
3504
+ l[t] = {
3505
+ ...l[t],
3506
+ type: d.target.value
3507
+ }, c({ ...a, registers: l });
3213
3508
  },
3214
3509
  children: [
3215
3510
  /* @__PURE__ */ e("option", { value: "coil", children: n("protocolConfig.coil", "Coil") }),
@@ -3219,16 +3514,16 @@ function Me({
3219
3514
  ]
3220
3515
  }
3221
3516
  ) }),
3222
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ a(
3517
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ r(
3223
3518
  "select",
3224
3519
  {
3225
3520
  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 });
3521
+ onChange: (d) => {
3522
+ const l = [...a.registers];
3523
+ l[t] = {
3524
+ ...l[t],
3525
+ dataType: d.target.value
3526
+ }, c({ ...a, registers: l });
3232
3527
  },
3233
3528
  children: [
3234
3529
  /* @__PURE__ */ e("option", { value: "bool", children: n("protocolConfig.bool", "Bool") }),
@@ -3240,15 +3535,15 @@ function Me({
3240
3535
  ]
3241
3536
  }
3242
3537
  ) }),
3243
- /* @__PURE__ */ a("td", { children: [
3538
+ /* @__PURE__ */ r("td", { children: [
3244
3539
  /* @__PURE__ */ e(
3245
3540
  "input",
3246
3541
  {
3247
3542
  type: "checkbox",
3248
3543
  checked: o.readable,
3249
- onChange: (t) => {
3250
- const l = [...r.registers];
3251
- l[d] = { ...l[d], readable: t.target.checked }, c({ ...r, registers: l });
3544
+ onChange: (d) => {
3545
+ const l = [...a.registers];
3546
+ l[t] = { ...l[t], readable: d.target.checked }, c({ ...a, registers: l });
3252
3547
  },
3253
3548
  title: n("protocolConfig.readable", "Readable")
3254
3549
  }
@@ -3258,9 +3553,9 @@ function Me({
3258
3553
  {
3259
3554
  type: "checkbox",
3260
3555
  checked: o.writable,
3261
- onChange: (t) => {
3262
- const l = [...r.registers];
3263
- l[d] = { ...l[d], writable: t.target.checked }, c({ ...r, registers: l });
3556
+ onChange: (d) => {
3557
+ const l = [...a.registers];
3558
+ l[t] = { ...l[t], writable: d.target.checked }, c({ ...a, registers: l });
3264
3559
  },
3265
3560
  title: n("protocolConfig.writable", "Writable")
3266
3561
  }
@@ -3270,22 +3565,22 @@ function Me({
3270
3565
  "button",
3271
3566
  {
3272
3567
  onClick: () => {
3273
- const t = r.registers.filter((l, g) => g !== d);
3274
- c({ ...r, registers: t });
3568
+ const d = a.registers.filter((l, b) => b !== t);
3569
+ c({ ...a, registers: d });
3275
3570
  },
3276
3571
  children: "Γ—"
3277
3572
  }
3278
3573
  ) })
3279
- ] }, d)) })
3574
+ ] }, t)) })
3280
3575
  ] }),
3281
3576
  /* @__PURE__ */ e(
3282
3577
  "button",
3283
3578
  {
3284
3579
  onClick: () => {
3285
3580
  c({
3286
- ...r,
3581
+ ...a,
3287
3582
  registers: [
3288
- ...r.registers,
3583
+ ...a.registers,
3289
3584
  {
3290
3585
  name: "",
3291
3586
  address: 0,
@@ -3302,31 +3597,31 @@ function Me({
3302
3597
  )
3303
3598
  ] });
3304
3599
  }
3305
- function De({ config: r, onChange: i }) {
3306
- const { t: c } = U();
3307
- return /* @__PURE__ */ a("div", { className: "nice-protocol-config__section", children: [
3600
+ function Ee({ config: a, onChange: i }) {
3601
+ const { t: c } = R();
3602
+ return /* @__PURE__ */ r("div", { className: "nice-protocol-config__section", children: [
3308
3603
  /* @__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: [
3604
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__grid", children: [
3605
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field nice-protocol-config__field--full", children: [
3311
3606
  /* @__PURE__ */ e("label", { children: c("protocolConfig.endpointUrl", "Endpoint URL") }),
3312
3607
  /* @__PURE__ */ e(
3313
3608
  "input",
3314
3609
  {
3315
3610
  type: "text",
3316
- value: r.endpointUrl,
3317
- onChange: (n) => i({ ...r, endpointUrl: n.target.value }),
3611
+ value: a.endpointUrl,
3612
+ onChange: (n) => i({ ...a, endpointUrl: n.target.value }),
3318
3613
  placeholder: c("protocolConfig.endpointUrlPlaceholder", "opc.tcp://localhost:4840")
3319
3614
  }
3320
3615
  )
3321
3616
  ] }),
3322
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3617
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3323
3618
  /* @__PURE__ */ e("label", { children: c("protocolConfig.securityMode", "Security Mode") }),
3324
- /* @__PURE__ */ a(
3619
+ /* @__PURE__ */ r(
3325
3620
  "select",
3326
3621
  {
3327
- value: r.securityMode,
3622
+ value: a.securityMode,
3328
3623
  onChange: (n) => i({
3329
- ...r,
3624
+ ...a,
3330
3625
  securityMode: n.target.value
3331
3626
  }),
3332
3627
  children: [
@@ -3337,14 +3632,14 @@ function De({ config: r, onChange: i }) {
3337
3632
  }
3338
3633
  )
3339
3634
  ] }),
3340
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3635
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3341
3636
  /* @__PURE__ */ e("label", { children: c("protocolConfig.authentication", "Authentication") }),
3342
- /* @__PURE__ */ a(
3637
+ /* @__PURE__ */ r(
3343
3638
  "select",
3344
3639
  {
3345
- value: r.authentication,
3640
+ value: a.authentication,
3346
3641
  onChange: (n) => i({
3347
- ...r,
3642
+ ...a,
3348
3643
  authentication: n.target.value
3349
3644
  }),
3350
3645
  children: [
@@ -3355,53 +3650,53 @@ function De({ config: r, onChange: i }) {
3355
3650
  }
3356
3651
  )
3357
3652
  ] }),
3358
- r.authentication === "username" && /* @__PURE__ */ a(E, { children: [
3359
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3653
+ a.authentication === "username" && /* @__PURE__ */ r(D, { children: [
3654
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3360
3655
  /* @__PURE__ */ e("label", { children: c("protocolConfig.username", "Username") }),
3361
3656
  /* @__PURE__ */ e(
3362
3657
  "input",
3363
3658
  {
3364
3659
  type: "text",
3365
- value: r.username || "",
3366
- onChange: (n) => i({ ...r, username: n.target.value })
3660
+ value: a.username || "",
3661
+ onChange: (n) => i({ ...a, username: n.target.value })
3367
3662
  }
3368
3663
  )
3369
3664
  ] }),
3370
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3665
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3371
3666
  /* @__PURE__ */ e("label", { children: c("protocolConfig.password", "Password") }),
3372
3667
  /* @__PURE__ */ e(
3373
3668
  "input",
3374
3669
  {
3375
3670
  type: "password",
3376
- value: r.password || "",
3377
- onChange: (n) => i({ ...r, password: n.target.value })
3671
+ value: a.password || "",
3672
+ onChange: (n) => i({ ...a, password: n.target.value })
3378
3673
  }
3379
3674
  )
3380
3675
  ] })
3381
3676
  ] }),
3382
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field nice-protocol-config__field--full", children: [
3677
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field nice-protocol-config__field--full", children: [
3383
3678
  /* @__PURE__ */ e("label", { children: c("protocolConfig.applicationName", "Application Name") }),
3384
3679
  /* @__PURE__ */ e(
3385
3680
  "input",
3386
3681
  {
3387
3682
  type: "text",
3388
- value: r.applicationName,
3389
- onChange: (n) => i({ ...r, applicationName: n.target.value })
3683
+ value: a.applicationName,
3684
+ onChange: (n) => i({ ...a, applicationName: n.target.value })
3390
3685
  }
3391
3686
  )
3392
3687
  ] })
3393
3688
  ] }),
3394
3689
  /* @__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: [
3690
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__nodes", children: [
3691
+ a.nodes.map((n, o) => /* @__PURE__ */ r("div", { className: "nice-protocol-config__node-row", children: [
3397
3692
  /* @__PURE__ */ e(
3398
3693
  "input",
3399
3694
  {
3400
3695
  type: "text",
3401
3696
  value: n.nodeId,
3402
- onChange: (d) => {
3403
- const t = [...r.nodes];
3404
- t[o] = { ...t[o], nodeId: d.target.value }, i({ ...r, nodes: t });
3697
+ onChange: (t) => {
3698
+ const d = [...a.nodes];
3699
+ d[o] = { ...d[o], nodeId: t.target.value }, i({ ...a, nodes: d });
3405
3700
  },
3406
3701
  placeholder: c("protocolConfig.nodeIdPlaceholder", "ns=2;s=Temperature")
3407
3702
  }
@@ -3411,9 +3706,9 @@ function De({ config: r, onChange: i }) {
3411
3706
  {
3412
3707
  type: "text",
3413
3708
  value: n.displayName,
3414
- onChange: (d) => {
3415
- const t = [...r.nodes];
3416
- t[o] = { ...t[o], displayName: d.target.value }, i({ ...r, nodes: t });
3709
+ onChange: (t) => {
3710
+ const d = [...a.nodes];
3711
+ d[o] = { ...d[o], displayName: t.target.value }, i({ ...a, nodes: d });
3417
3712
  },
3418
3713
  placeholder: c("protocolConfig.displayNamePlaceholder", "Display Name")
3419
3714
  }
@@ -3422,8 +3717,8 @@ function De({ config: r, onChange: i }) {
3422
3717
  "button",
3423
3718
  {
3424
3719
  onClick: () => {
3425
- const d = r.nodes.filter((t, l) => l !== o);
3426
- i({ ...r, nodes: d });
3720
+ const t = a.nodes.filter((d, l) => l !== o);
3721
+ i({ ...a, nodes: t });
3427
3722
  },
3428
3723
  children: "Γ—"
3429
3724
  }
@@ -3434,9 +3729,9 @@ function De({ config: r, onChange: i }) {
3434
3729
  {
3435
3730
  onClick: () => {
3436
3731
  i({
3437
- ...r,
3732
+ ...a,
3438
3733
  nodes: [
3439
- ...r.nodes,
3734
+ ...a.nodes,
3440
3735
  { nodeId: "", displayName: "", dataType: "Double", read: !0 }
3441
3736
  ]
3442
3737
  });
@@ -3448,7 +3743,7 @@ function De({ config: r, onChange: i }) {
3448
3743
  ] });
3449
3744
  }
3450
3745
  export {
3451
- Ue as NiceEdgeManager,
3452
- Ee as NiceIoTDashboard,
3453
- Ae as NiceProtocolConfig
3746
+ Fe as NiceEdgeManager,
3747
+ Be as NiceIoTDashboard,
3748
+ Oe as NiceProtocolConfig
3454
3749
  };