@esrf/daiquiri-lib 1.0.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
- import { jsxs as s, jsx as r, Fragment as v } from "react/jsx-runtime";
2
- import { map as C, each as be } from "lodash";
3
- import { Badge as F, ButtonGroup as oe, Button as y, OverlayTrigger as R, Popover as b, Container as $, Row as P, Col as E, Form as N, InputGroup as A, Alert as x, Tab as Ne, Tabs as te, Tooltip as Ce } from "react-bootstrap";
4
- import { forwardRef as Oe, useRef as T, useState as I, useEffect as j, Component as se, Fragment as q, Children as Se, isValidElement as Ee, cloneElement as xe, Suspense as ne, useMemo as Me, createElement as Ae } from "react";
5
- import H from "classnames";
6
- import ke from "debug";
7
- function Ie(e) {
1
+ import { jsxs as c, jsx as r, Fragment as v } from "react/jsx-runtime";
2
+ import { map as S, each as Ae } from "lodash";
3
+ import { Badge as A, ButtonGroup as ue, Button as y, OverlayTrigger as R, Popover as b, Container as L, Row as V, Col as O, Form as C, Tooltip as he, InputGroup as I, Alert as M, Tab as Me, Tabs as oe } from "react-bootstrap";
4
+ import { useMemo as te, forwardRef as De, useRef as F, useState as k, useEffect as P, Component as fe, Fragment as Ie, Children as ke, isValidElement as $e, cloneElement as Fe, Suspense as se } from "react";
5
+ import Y from "classnames";
6
+ import Re from "debug";
7
+ function Te(e) {
8
8
  const {
9
9
  activeMessage: t = "Online",
10
10
  inactiveMessage: n = "Offline",
@@ -18,14 +18,14 @@ function Ie(e) {
18
18
  }
19
19
  );
20
20
  }
21
- function D(e) {
21
+ function T(e) {
22
22
  const { name: t, icon: n } = e;
23
- return /* @__PURE__ */ s("div", { className: "icon", title: t, children: [
23
+ return /* @__PURE__ */ c("div", { className: "icon", title: t, children: [
24
24
  /* @__PURE__ */ r("i", { className: `fa ${n}` }),
25
- /* @__PURE__ */ r(Ie, { ...e })
25
+ /* @__PURE__ */ r(Te, { ...e })
26
26
  ] });
27
27
  }
28
- function De(e) {
28
+ function _e(e) {
29
29
  const t = {
30
30
  24: "Y",
31
31
  21: "Z",
@@ -50,35 +50,33 @@ function De(e) {
50
50
  multiplier: 10 ** -a
51
51
  };
52
52
  }
53
- function $e(e) {
53
+ function He(e) {
54
54
  return e.charAt(0).toUpperCase() + e.slice(1);
55
55
  }
56
- function le(e) {
56
+ function me(e) {
57
57
  if (e < 60)
58
58
  return `${Math.round(e)} sec`;
59
59
  const t = Math.round(e / 60), n = t % 60, i = Math.floor(t / 60);
60
60
  return i ? `${i} hr ${n} min` : `${n} min`;
61
61
  }
62
- function Fe(e) {
62
+ function Le(e) {
63
63
  return e > 0 ? (662607004e-42 * 299792458 / (e * 1e-10) / 160218e-24 * 1e-3).toFixed(4) : 0;
64
64
  }
65
- function Re(e, t) {
65
+ function Ve(e, t) {
66
66
  return Number.parseFloat(e.toFixed(t));
67
67
  }
68
- const _t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
68
+ const Ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
69
69
  __proto__: null,
70
- formatEng: De,
71
- round: Re,
72
- toEnergy: Fe,
73
- toHoursMins: le,
74
- ucfirst: $e
70
+ formatEng: _e,
71
+ round: Ve,
72
+ toEnergy: Le,
73
+ toHoursMins: me,
74
+ ucfirst: He
75
75
  }, Symbol.toStringTag, { value: "Module" }));
76
- function Te(e) {
76
+ function Pe(e) {
77
77
  const { hardware: t } = e;
78
- function n(d) {
79
- t.requestChange({
80
- function: "reset"
81
- });
78
+ function n() {
79
+ t.actions.call("reset");
82
80
  }
83
81
  const i = {
84
82
  "Front End": "feitlk",
@@ -87,50 +85,50 @@ function Te(e) {
87
85
  }, a = {
88
86
  Current: `${t.properties.current.toFixed(1)} mA`,
89
87
  Mode: t.properties.mode,
90
- Refill: le(t.properties.refill),
88
+ Refill: me(t.properties.refill),
91
89
  Message: /* @__PURE__ */ r("pre", { children: t.properties.message })
92
90
  };
93
- function o(d) {
94
- if (!(d in t.properties))
91
+ function o(l) {
92
+ if (!(l in t.properties))
95
93
  return "UNKNOWN";
96
- const l = t.properties[d];
97
- return !l || typeof l != "string" ? "UNKNOWN" : l;
94
+ const s = t.properties[l];
95
+ return !s || typeof s != "string" ? "UNKNOWN" : s;
98
96
  }
99
97
  return /* @__PURE__ */ r(
100
98
  R,
101
99
  {
102
100
  trigger: "click",
103
101
  rootClose: !0,
104
- overlay: /* @__PURE__ */ s(b, { id: "popid", children: [
105
- /* @__PURE__ */ s(b.Header, { children: [
102
+ overlay: /* @__PURE__ */ c(b, { id: "popid", children: [
103
+ /* @__PURE__ */ c(b.Header, { children: [
106
104
  t.name,
107
105
  " Details"
108
106
  ] }),
109
- /* @__PURE__ */ s(b.Body, { children: [
107
+ /* @__PURE__ */ c(b.Body, { children: [
110
108
  /* @__PURE__ */ r("h6", { children: "Status" }),
111
109
  /* @__PURE__ */ r("pre", { children: t.properties.status }),
112
110
  /* @__PURE__ */ r("h6", { children: "Interlocks" }),
113
- /* @__PURE__ */ r($, { children: C(i, (d, l) => /* @__PURE__ */ s(P, { children: [
114
- /* @__PURE__ */ s(E, { children: [
115
- l,
111
+ /* @__PURE__ */ r(L, { children: S(i, (l, s) => /* @__PURE__ */ c(V, { children: [
112
+ /* @__PURE__ */ c(O, { children: [
113
+ s,
116
114
  ":"
117
115
  ] }),
118
- /* @__PURE__ */ r(E, { children: /* @__PURE__ */ r(
119
- F,
116
+ /* @__PURE__ */ r(O, { children: /* @__PURE__ */ r(
117
+ A,
120
118
  {
121
- bg: o(d) === "ON" ? "success" : "danger",
122
- children: o(d)
119
+ bg: o(l) === "ON" ? "success" : "danger",
120
+ children: o(l)
123
121
  }
124
122
  ) })
125
- ] }, l)) }),
123
+ ] }, s)) }),
126
124
  /* @__PURE__ */ r("h6", { children: "Ring Status" }),
127
- /* @__PURE__ */ r($, { children: C(a, (d, l) => /* @__PURE__ */ s(P, { children: [
128
- /* @__PURE__ */ s(E, { children: [
129
- l,
125
+ /* @__PURE__ */ r(L, { children: S(a, (l, s) => /* @__PURE__ */ c(V, { children: [
126
+ /* @__PURE__ */ c(O, { children: [
127
+ s,
130
128
  ":"
131
129
  ] }),
132
- /* @__PURE__ */ r(E, { children: d })
133
- ] }, l)) }),
130
+ /* @__PURE__ */ r(O, { children: l })
131
+ ] }, s)) }),
134
132
  /* @__PURE__ */ r("div", { className: "d-grid gap-2", children: /* @__PURE__ */ r(y, { disabled: e.disabled, onClick: n, children: "Reset" }) })
135
133
  ] })
136
134
  ] }),
@@ -138,17 +136,17 @@ function Te(e) {
138
136
  }
139
137
  );
140
138
  }
141
- function Pt(e) {
139
+ function zt(e) {
142
140
  const { hardware: t, options: n = {} } = e;
143
- function i(a) {
144
- t.requestChange({
145
- function: t.properties.frontend === "FE open" ? "close" : "open"
146
- });
141
+ function i() {
142
+ t.actions.call(
143
+ t.properties.frontend === "FE open" ? "close" : "open"
144
+ );
147
145
  }
148
- return /* @__PURE__ */ s("div", { className: "hw-component", children: [
149
- /* @__PURE__ */ s("div", { className: "hw-head", children: [
146
+ return /* @__PURE__ */ c("div", { className: "hw-component", children: [
147
+ /* @__PURE__ */ c("div", { className: "hw-head", children: [
150
148
  /* @__PURE__ */ r(
151
- D,
149
+ T,
152
150
  {
153
151
  name: "Frontend",
154
152
  icon: "fam-hardware-frontend",
@@ -157,14 +155,14 @@ function Pt(e) {
157
155
  ),
158
156
  /* @__PURE__ */ r("div", { className: "name", children: t.name }),
159
157
  /* @__PURE__ */ r(
160
- F,
158
+ A,
161
159
  {
162
160
  bg: t.properties.state === "OPEN" || t.properties.state === "RUNNING" ? "success" : "danger",
163
161
  children: t.properties.state
164
162
  }
165
163
  )
166
164
  ] }),
167
- /* @__PURE__ */ r("div", { className: "hw-content", children: /* @__PURE__ */ s(oe, { className: "d-flex", children: [
165
+ /* @__PURE__ */ r("div", { className: "hw-content", children: /* @__PURE__ */ c(ue, { className: "d-flex", children: [
168
166
  /* @__PURE__ */ r(
169
167
  y,
170
168
  {
@@ -174,11 +172,11 @@ function Pt(e) {
174
172
  children: t.properties.frontend === "FE open" ? "Close" : "Open"
175
173
  }
176
174
  ),
177
- /* @__PURE__ */ r(Te, { ...e })
175
+ /* @__PURE__ */ r(Pe, { ...e })
178
176
  ] }) })
179
177
  ] });
180
178
  }
181
- function Vt(e) {
179
+ function Bt(e) {
182
180
  const { hardware: t, options: n = {} } = e;
183
181
  function i() {
184
182
  const a = n.property;
@@ -187,14 +185,14 @@ function Vt(e) {
187
185
  if (a === null)
188
186
  return "property is null";
189
187
  let o = t;
190
- for (const d of a.split("/"))
191
- if (o = o[d], o === void 0)
188
+ for (const l of a.split("/"))
189
+ if (o = o[l], o === void 0)
192
190
  return `property '${a}' not found`;
193
191
  return `${o}`;
194
192
  }
195
193
  return /* @__PURE__ */ r(v, { children: i() });
196
194
  }
197
- function Y(e) {
195
+ function G(e) {
198
196
  const { headerMode: t, hardware: n } = e;
199
197
  function i() {
200
198
  return n.alias ? n.alias : n.name ? n.name : n.id;
@@ -202,7 +200,7 @@ function Y(e) {
202
200
  const a = i();
203
201
  switch (t) {
204
202
  case "front":
205
- return /* @__PURE__ */ r("div", { className: "hw-component", children: /* @__PURE__ */ s("div", { className: "hw-single", children: [
203
+ return /* @__PURE__ */ r("div", { className: "hw-component", children: /* @__PURE__ */ c("div", { className: "hw-single", children: [
206
204
  e.widgetIcon,
207
205
  /* @__PURE__ */ r("div", { className: "name", children: a }),
208
206
  /* @__PURE__ */ r("div", { className: "d-inline-block", children: e.widgetContent })
@@ -212,10 +210,10 @@ function Y(e) {
212
210
  case "state":
213
211
  return e.widgetState;
214
212
  default:
215
- return /* @__PURE__ */ s("div", { className: "hw-component", children: [
216
- /* @__PURE__ */ s("div", { className: "hw-head", children: [
213
+ return /* @__PURE__ */ c("div", { className: "hw-component", children: [
214
+ /* @__PURE__ */ c("div", { className: "hw-head", children: [
217
215
  e.widgetIcon,
218
- /* @__PURE__ */ r("div", { className: "name", children: /* @__PURE__ */ r(N.Label, { htmlFor: n.id, children: a }) }),
216
+ /* @__PURE__ */ r("div", { className: "name", children: /* @__PURE__ */ r(C.Label, { htmlFor: n.id, children: a }) }),
219
217
  e.widgetState,
220
218
  e.hardware.errors && e.hardware.errors.length > 0 && /* @__PURE__ */ r(
221
219
  R,
@@ -223,14 +221,14 @@ function Y(e) {
223
221
  trigger: "click",
224
222
  placement: "bottom",
225
223
  rootClose: !0,
226
- overlay: /* @__PURE__ */ s(b, { id: e.hardware.id, style: { maxWidth: 500 }, children: [
224
+ overlay: /* @__PURE__ */ c(b, { id: e.hardware.id, style: { maxWidth: 500 }, children: [
227
225
  /* @__PURE__ */ r(b.Header, { children: "Device Errors" }),
228
- /* @__PURE__ */ s(b.Body, { children: [
226
+ /* @__PURE__ */ c(b.Body, { children: [
229
227
  "There were errors with properties on this device:",
230
- /* @__PURE__ */ r("ul", { children: e.hardware.errors.map((o) => /* @__PURE__ */ s("li", { children: [
228
+ /* @__PURE__ */ r("ul", { children: e.hardware.errors.map((o) => /* @__PURE__ */ c("li", { children: [
231
229
  o.property,
232
230
  ":",
233
- /* @__PURE__ */ s("span", { className: "stack-trace", children: [
231
+ /* @__PURE__ */ c("span", { className: "stack-trace", children: [
234
232
  o.traceback,
235
233
  /* @__PURE__ */ r("br", {}),
236
234
  o.exception
@@ -246,143 +244,270 @@ function Y(e) {
246
244
  ] });
247
245
  }
248
246
  }
249
- function J(e) {
247
+ function U(e) {
250
248
  const t = {
251
249
  display: "inline-block",
252
250
  minWidth: ""
253
251
  };
254
- return e.minWidth && (t.minWidth = `${e.minWidth}em`), /* @__PURE__ */ r("div", { style: t, children: /* @__PURE__ */ r(F, { bg: e.variant, children: e.state }) });
252
+ return e.minWidth && (t.minWidth = `${e.minWidth}em`), /* @__PURE__ */ r("div", { style: t, children: /* @__PURE__ */ r(A, { bg: e.variant, title: e.description, children: e.state }) });
255
253
  }
256
- function ce(e) {
257
- const { hardware: t } = e;
258
- function n() {
259
- if (!t.online)
260
- return "OFFLINE";
261
- let a = "UNKNOWN";
262
- return e.hardware.properties.state && ([a] = e.hardware.properties.state), a;
254
+ function pe(e) {
255
+ const { states: t, variants: n = {}, descriptions: i = {}, minWidth: a } = e, o = t[0] ?? "";
256
+ if (t.length === 0)
257
+ return /* @__PURE__ */ r(
258
+ U,
259
+ {
260
+ state: "NoState",
261
+ variant: "fatal",
262
+ description: "The device no not expose any state",
263
+ minWidth: a
264
+ }
265
+ );
266
+ if (t.length === 1)
267
+ return /* @__PURE__ */ r(
268
+ U,
269
+ {
270
+ state: o,
271
+ variant: n[o] ?? "fatal",
272
+ description: i[o],
273
+ minWidth: a
274
+ }
275
+ );
276
+ const l = {
277
+ display: "inline-block",
278
+ minWidth: a ? `${a}em` : ""
279
+ };
280
+ function s(u) {
281
+ return /* @__PURE__ */ r(he, { id: "device-state", ...u, children: t.map((h, f) => {
282
+ const d = i[h], m = h.startsWith("_") ? h.slice(1) : h;
283
+ return /* @__PURE__ */ c(V, { className: "gx-0", children: [
284
+ /* @__PURE__ */ r(O, { sm: "3", className: "text-end", children: /* @__PURE__ */ r(A, { className: "text-right", bg: n[h] ?? "fatal", children: m }) }),
285
+ /* @__PURE__ */ r(O, { sm: "9", className: "text-start lh-1 my-auto ps-1", children: d })
286
+ ] });
287
+ }) });
263
288
  }
264
- const i = n();
265
- return /* @__PURE__ */ r(
266
- J,
289
+ return /* @__PURE__ */ r("div", { style: l, children: /* @__PURE__ */ r(
290
+ R,
267
291
  {
268
- state: i,
269
- minWidth: 6,
270
- variant: i === "READY" ? "success" : "warning"
292
+ placement: "top",
293
+ delay: { show: 250, hide: 400 },
294
+ overlay: s,
295
+ children: /* @__PURE__ */ c("span", { className: "text-nowrap", children: [
296
+ /* @__PURE__ */ r(A, { className: "rounded-end-0", bg: n[o] ?? "fatal", children: o }),
297
+ /* @__PURE__ */ c(A, { className: "rounded-start-0", bg: "secondary", children: [
298
+ "+",
299
+ t.length - 1
300
+ ] })
301
+ ] })
271
302
  }
272
- );
303
+ ) });
273
304
  }
274
- function de(e) {
275
- const { hardware: t } = e;
276
- function n() {
305
+ const Gt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
306
+ __proto__: null,
307
+ HardwareMultiState: pe,
308
+ HardwareState: U
309
+ }, Symbol.toStringTag, { value: "Module" })), Z = {
310
+ description: "Unknown state is exposed",
311
+ variant: "fatal",
312
+ priority: 100
313
+ }, j = {
314
+ // Reserved by Daiquiri
315
+ OFFLINE: {
316
+ description: "Axis is offline",
317
+ variant: "secondary",
318
+ priority: 0
319
+ },
320
+ // Real hardware state
321
+ MOVING: {
322
+ description: "Axis is moving",
323
+ variant: "warning",
324
+ priority: 10
325
+ },
326
+ FAULT: {
327
+ description: "Axis is in fault",
328
+ variant: "danger",
329
+ priority: 20
330
+ },
331
+ // Reserved by Daiquiri
332
+ LOCKED: {
333
+ description: "Axis is locked",
334
+ variant: "warning",
335
+ priority: 25
336
+ },
337
+ OFF: {
338
+ description: "Power is off",
339
+ variant: "secondary",
340
+ priority: 30
341
+ },
342
+ DISABLED: {
343
+ description: "Axis is disabled",
344
+ variant: "warning",
345
+ priority: 40
346
+ },
347
+ LOWLIMIT: {
348
+ description: "Low limit is reached",
349
+ variant: "warning",
350
+ priority: 50
351
+ },
352
+ HIGHLIMIT: {
353
+ description: "High limit is reached",
354
+ variant: "warning",
355
+ priority: 51
356
+ },
357
+ HOME: {
358
+ description: "Home signal active",
359
+ variant: "info",
360
+ priority: 52
361
+ },
362
+ READY: {
363
+ description: "Ready to handle request",
364
+ variant: "success",
365
+ priority: 60
366
+ },
367
+ // Reserved by Daiquiri
368
+ NOT_READY: {
369
+ description: "Not ready",
370
+ variant: "warning",
371
+ priority: 100
372
+ },
373
+ // Reserved by Daiquiri
374
+ UNKNOWN: Z
375
+ };
376
+ function Ye(e) {
377
+ const { hardware: t } = e, { locked: n = null } = t, { state: i = ["UNKNOWN"] } = t.properties, [a, o] = te(() => {
277
378
  if (!t.online)
278
- return "OFFLINE";
279
- const o = t.properties.state;
280
- return e.useReadyState && (o === "OPEN" || o === "CLOSED") ? "READY" : o;
281
- }
282
- const i = n();
283
- function a() {
284
- switch (i) {
285
- case "READY":
286
- return "success";
287
- case "OPEN":
288
- return "success";
289
- case "CLOSED":
290
- return "danger";
291
- case "DISABLED":
292
- return "secondary";
293
- case "MOVING":
294
- case "STANDBY":
295
- case "OFFLINE":
296
- return "warning";
297
- case "FAULT":
298
- return "fatal";
299
- default:
300
- return "fatal";
379
+ return [["OFFLINE"], void 0];
380
+ function l(d, m) {
381
+ const N = j[d] ?? Z, $ = j[m] ?? Z;
382
+ return N.priority - $.priority;
301
383
  }
302
- }
303
- return /* @__PURE__ */ r(J, { state: i, minWidth: 6, variant: a() });
384
+ const s = [
385
+ ...i,
386
+ ...n !== null ? ["LOCKED"] : [],
387
+ ...i.length === 0 ? ["NOT_READY"] : []
388
+ ];
389
+ s.sort(l);
390
+ function u(d) {
391
+ const m = d.split(":", 2);
392
+ return m.length === 1 ? [d, void 0] : m;
393
+ }
394
+ const h = {};
395
+ return [s.map((d) => {
396
+ if (d.startsWith("_")) {
397
+ const m = u(d);
398
+ return m[1] !== void 0 && (h[m[0]] = m[1]), m[0];
399
+ }
400
+ return d === "LOCKED" ? h[d] = `Locked by ${n}` : h[d] = j[d].description ?? "", d;
401
+ }), h];
402
+ }, [i, t.online, n]);
403
+ return /* @__PURE__ */ r(
404
+ pe,
405
+ {
406
+ states: a,
407
+ descriptions: o,
408
+ minWidth: 6,
409
+ variants: Object.fromEntries(
410
+ Object.entries(j).map(([l, s]) => [l, s.variant])
411
+ )
412
+ }
413
+ );
304
414
  }
305
- const Lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
306
- __proto__: null,
307
- HardwareState: J,
308
- MotorState: ce,
309
- ShutterState: de
310
- }, Symbol.toStringTag, { value: "Module" })), He = Oe((e, t) => {
311
- const n = T(null), [i, a] = I(e.step), o = (w) => {
312
- const z = t;
415
+ const je = De((e, t) => {
416
+ const n = F(null), i = F(), [a, o] = k(e.step), [l, s] = k(!1), u = (p) => {
417
+ const q = t;
313
418
  if (n.current === null)
314
419
  return;
315
- let X = Number.parseFloat(z.current.value);
316
- const ee = Number.parseFloat(n.current.value);
317
- X += w ? ee : -ee, z.current.value = `${X}`, e.onStep && e.onStep({
318
- target: z.current
420
+ let _ = Number.parseFloat(q.current.value);
421
+ if (n.current.value.startsWith("*")) {
422
+ const H = Number.parseFloat(
423
+ n.current.value.replace("*", "")
424
+ );
425
+ _ = p ? _ * H : _ / H;
426
+ } else {
427
+ const H = Number.parseFloat(n.current.value);
428
+ _ += p ? H : -H;
429
+ }
430
+ q.current.value = `${_}`, e.onStep && e.onStep({
431
+ target: q.current
319
432
  });
320
433
  }, {
321
- onStep: d,
322
- step: l,
323
- overlay: h,
324
- incIcon: u,
325
- decIcon: c,
326
- swapIncDec: f,
327
- onKeyDown: m,
328
- horizontalArrows: k,
329
- largeArrows: K,
330
- ...S
331
- } = e, Q = (w) => {
332
- w.key === "ArrowUp" ? (w.preventDefault(), o(!0)) : w.key === "ArrowDown" ? (w.preventDefault(), o(!1)) : m && m(w);
434
+ onStep: h,
435
+ step: f,
436
+ overlay: d,
437
+ incIcon: m,
438
+ decIcon: N,
439
+ swapIncDec: $,
440
+ onKeyDown: x,
441
+ onBlur: ne,
442
+ horizontalArrows: Se,
443
+ largeArrows: Ee,
444
+ ...re
445
+ } = e, ie = (p) => {
446
+ p.key === "ArrowUp" ? (p.preventDefault(), s(!0), u(!0)) : p.key === "ArrowDown" ? (p.preventDefault(), s(!0), u(!1)) : x && x(p);
447
+ };
448
+ l && (i.current && clearTimeout(i.current), i.current = setTimeout(() => {
449
+ var p;
450
+ (p = t == null ? void 0 : t.current) == null || p.focus();
451
+ }, 100)), P(() => () => {
452
+ i.current && clearTimeout(i.current);
453
+ }, []);
454
+ const ae = () => {
455
+ i.current && clearTimeout(i.current), s(!1), ne && ne();
333
456
  };
334
457
  if (!e.step)
335
458
  return /* @__PURE__ */ r(
336
- N.Control,
459
+ C.Control,
337
460
  {
338
461
  ref: t,
339
462
  type: "number",
340
463
  step: "any",
341
- onKeyDown: Q,
342
- ...S
464
+ onKeyDown: ie,
465
+ onBlur: ae,
466
+ ...re
343
467
  }
344
468
  );
345
- const ve = C(e.steps || [e.step], (w) => /* @__PURE__ */ r("option", { value: w, children: w }, w));
469
+ const xe = S(e.steps || [e.step], (p) => /* @__PURE__ */ r("option", { value: p, children: p }, p));
346
470
  return /* @__PURE__ */ r(
347
471
  "div",
348
472
  {
349
- className: H("numeric-step", {
350
- "numeric-step-large": K,
351
- "numeric-step-horizontal": k
473
+ className: Y("numeric-step", {
474
+ "numeric-step-large": Ee,
475
+ "numeric-step-horizontal": Se
352
476
  }),
353
- children: /* @__PURE__ */ s(A, { children: [
477
+ children: /* @__PURE__ */ c(I, { children: [
354
478
  /* @__PURE__ */ r(
355
- N.Control,
479
+ C.Control,
356
480
  {
357
- onKeyDown: Q,
481
+ onKeyDown: ie,
482
+ onBlur: ae,
358
483
  ref: t,
359
484
  type: "number",
360
485
  step: "any",
361
- ...S
486
+ ...re
362
487
  }
363
488
  ),
364
- /* @__PURE__ */ s(v, { children: [
365
- h,
366
- !h && /* @__PURE__ */ s(A.Text, { className: "d-flex flex-column", children: [
489
+ /* @__PURE__ */ c(v, { children: [
490
+ d,
491
+ !d && /* @__PURE__ */ c(I.Text, { className: "d-flex flex-column", children: [
367
492
  /* @__PURE__ */ r(
368
- N.Control,
493
+ C.Control,
369
494
  {
370
495
  ref: n,
371
496
  as: "select",
372
497
  className: "step-size",
373
- defaultValue: i,
374
- onChange: (w) => a(Number.parseFloat(w.target.value)),
375
- children: ve
498
+ defaultValue: a,
499
+ onChange: (p) => o(Number.parseFloat(p.target.value)),
500
+ children: xe
376
501
  }
377
502
  ),
378
503
  e.unit && /* @__PURE__ */ r("div", { children: e.unit }),
379
- !u && !c && /* @__PURE__ */ s(v, { children: [
504
+ !m && !N && /* @__PURE__ */ c(v, { children: [
380
505
  /* @__PURE__ */ r(
381
506
  y,
382
507
  {
383
508
  className: "step step-up",
384
509
  disabled: e.disabled,
385
- onClick: (w) => o(!0)
510
+ onClick: (p) => u(!0)
386
511
  }
387
512
  ),
388
513
  /* @__PURE__ */ r(
@@ -390,64 +515,70 @@ const Lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
390
515
  {
391
516
  className: "step step-down",
392
517
  disabled: e.disabled,
393
- onClick: (w) => o(!1)
518
+ onClick: (p) => u(!1)
394
519
  }
395
520
  )
396
521
  ] })
397
522
  ] }),
398
- c && f && /* @__PURE__ */ r(y, { disabled: e.disabled, onClick: (w) => o(!1), children: /* @__PURE__ */ r("i", { className: `fa fa-fw fa-${c}` }) }),
399
- u && /* @__PURE__ */ r(y, { disabled: e.disabled, onClick: (w) => o(!0), children: /* @__PURE__ */ r("i", { className: `fa fa-fw fa-${u}` }) }),
400
- c && !f && /* @__PURE__ */ r(y, { disabled: e.disabled, onClick: (w) => o(!1), children: /* @__PURE__ */ r("i", { className: `fa fa-fw fa-${c}` }) })
523
+ N && $ && /* @__PURE__ */ r(y, { disabled: e.disabled, onClick: (p) => u(!1), children: /* @__PURE__ */ r("i", { className: `fa fa-fw fa-${N}` }) }),
524
+ m && /* @__PURE__ */ r(y, { disabled: e.disabled, onClick: (p) => u(!0), children: /* @__PURE__ */ r("i", { className: `fa fa-fw fa-${m}` }) }),
525
+ N && !$ && /* @__PURE__ */ r(y, { disabled: e.disabled, onClick: (p) => u(!1), children: /* @__PURE__ */ r("i", { className: `fa fa-fw fa-${N}` }) })
401
526
  ] })
402
527
  ] })
403
528
  }
404
529
  );
405
- }), _e = He;
406
- function Pe(e) {
407
- const t = T(null), [n, i] = I(!1), [a, o] = I(!1);
408
- j(() => {
409
- t.current && (e.hardwareValue === null ? t.current.value = "" : t.current.value = e.hardwareValue.toString(), i(!1));
530
+ }), Ke = je;
531
+ function Ue(e) {
532
+ const t = F(null), [n, i] = k(!1), [a, o] = k(!1);
533
+ P(() => {
534
+ t.current && (e.hardwareValue === null ? t.current.value = "" : e.precision !== void 0 ? t.current.value = e.hardwareValue.toFixed(e.precision) : t.current.value = e.hardwareValue.toString(), i(!1));
410
535
  }, [e.hardwareValue]);
411
- function d(f) {
412
- let m = f;
536
+ function l(d) {
537
+ let m = d;
413
538
  e.precision !== void 0 && (m = Number.parseFloat(m).toFixed(e.precision)), t != null && t.current && (t.current.value = m);
414
539
  }
415
- function l() {
540
+ function s() {
416
541
  n && setTimeout(() => {
417
- d(e.hardwareValue), i(!1);
542
+ l(e.hardwareValue), i(!1);
418
543
  }, 3e3);
419
544
  }
420
- function h(f) {
421
- e.hardwareValue !== null && (i(!0), t != null && t.current && (t.current.value = f.target.value), f.target.value === e.hardwareValue.toString() && i(!1));
545
+ function u(d) {
546
+ e.hardwareValue !== null && i(d.target.value !== e.hardwareValue.toString());
422
547
  }
423
- function u(f) {
424
- i(!1), e.onMoveRequested(f.target.value);
548
+ function h(d) {
549
+ i(!1);
550
+ const m = e.onMoveRequested(d.target.value);
551
+ m && m.catch(() => {
552
+ o(!0), setTimeout(() => {
553
+ l(e.hardwareValue), o(!1);
554
+ }, 2e3);
555
+ });
425
556
  }
426
- function c(f) {
427
- switch (f.key) {
557
+ function f(d) {
558
+ switch (d.key) {
428
559
  case "Enter":
429
560
  {
430
561
  i(!1);
431
- const m = Number.parseFloat(f.target.value), k = e.onMoveRequested(m);
432
- k && k.catch(() => {
562
+ const m = Number.parseFloat(d.target.value), N = e.onMoveRequested(m);
563
+ N && N.catch(() => {
433
564
  o(!0), setTimeout(() => {
434
- d(e.hardwareValue), o(!1);
565
+ l(e.hardwareValue), o(!1);
435
566
  }, 2e3);
436
567
  });
437
568
  }
438
- f.preventDefault(), f.stopPropagation();
569
+ d.preventDefault(), d.stopPropagation();
439
570
  break;
440
571
  case "Esc":
441
572
  case "Escape":
442
- n && (o(!1), i(!1), d(e.hardwareValue)), f.target.blur(), f.preventDefault(), f.stopPropagation();
573
+ n && (o(!1), i(!1), l(e.hardwareValue)), d.target.blur(), d.preventDefault(), d.stopPropagation();
443
574
  break;
444
575
  }
445
576
  }
446
577
  return /* @__PURE__ */ r(
447
- _e,
578
+ Ke,
448
579
  {
449
580
  id: e.id,
450
- className: H({
581
+ className: Y({
451
582
  "form-control-edited": n,
452
583
  "form-control-error": a,
453
584
  "hw-moving": e.hardwareIsMoving
@@ -455,10 +586,10 @@ function Pe(e) {
455
586
  type: e.readOnly ? "text" : "number",
456
587
  ref: t,
457
588
  precision: e.precision,
458
- onChange: h,
459
- onBlur: l,
460
- onStep: u,
461
- onKeyDown: c,
589
+ onChange: u,
590
+ onBlur: s,
591
+ onStep: h,
592
+ onKeyDown: f,
462
593
  disabled: e.hardwareIsDisabled || e.readOnly || !e.hardwareIsReady,
463
594
  step: e.step,
464
595
  steps: e.steps,
@@ -471,106 +602,112 @@ function Pe(e) {
471
602
  }
472
603
  );
473
604
  }
474
- function re(e) {
475
- const t = T(null), [n, i] = I(!1), [a, o] = I(!1);
476
- function d(c) {
477
- return e.precision !== void 0 ? Number.parseFloat(c).toFixed(e.precision) : c;
605
+ function le(e) {
606
+ const t = F(null), [n, i] = k(!1), [a, o] = k(!1);
607
+ function l(f) {
608
+ return e.precision !== void 0 ? Number.parseFloat(f).toFixed(e.precision) : f;
478
609
  }
479
- j(() => {
480
- var c;
481
- t.current && (t.current.value = d((c = e.hardwareValue) == null ? void 0 : c.toString()), i(!1));
610
+ P(() => {
611
+ var f;
612
+ t.current && (t.current.value = l((f = e.hardwareValue) == null ? void 0 : f.toString()), i(!1));
482
613
  }, [e.hardwareValue, e.precision]);
483
- function l(c) {
484
- const f = d(c);
485
- t != null && t.current && (t.current.value = f);
614
+ function s(f) {
615
+ const d = l(f);
616
+ t != null && t.current && (t.current.value = d);
486
617
  }
487
- function h(c) {
488
- switch (c.key) {
618
+ function u(f) {
619
+ switch (f.key) {
489
620
  case "Enter": {
490
621
  i(!1);
491
- const f = Number.parseFloat(c.target.value), m = e.onMoveRequested(f);
622
+ const d = Number.parseFloat(f.target.value), m = e.onMoveRequested(d);
492
623
  m && m.catch(() => {
493
624
  o(!0), setTimeout(() => {
494
- l(e.hardwareValue), o(!1);
625
+ s(e.hardwareValue), o(!1);
495
626
  }, 2e3);
496
- }), c.preventDefault(), c.stopPropagation();
627
+ }), f.preventDefault(), f.stopPropagation();
497
628
  break;
498
629
  }
499
630
  case "Esc":
500
631
  case "Escape":
501
- n && (o(!1), i(!1), l(e.hardwareValue)), c.target.blur(), c.preventDefault(), c.stopPropagation();
632
+ n && (o(!1), i(!1), s(e.hardwareValue)), f.target.blur(), f.preventDefault(), f.stopPropagation();
502
633
  break;
503
634
  }
504
635
  }
505
- function u(c) {
506
- i(!0), c.target, t != null && t.current && (t.current.value = c.target.value), c.target.value === e.hardwareValue.toString() && i(!1);
636
+ function h(f) {
637
+ i(f.target.value !== e.hardwareValue.toString());
507
638
  }
508
639
  return /* @__PURE__ */ r(
509
- N.Control,
640
+ C.Control,
510
641
  {
511
- className: H({
642
+ className: Y({
512
643
  "form-control-edited": n,
513
644
  "form-control-error": a,
514
645
  "hw-moving": e.hardwareIsMoving
515
646
  }),
516
647
  type: "number",
517
648
  ref: t,
518
- onChange: u,
519
- onKeyDown: h,
649
+ onChange: h,
650
+ onKeyDown: u,
520
651
  disabled: e.readOnly || e.hardwareIsMoving || e.hardwareIsDisabled,
521
652
  step: e.step
522
653
  }
523
654
  );
524
655
  }
525
- function Ve(e) {
526
- function t(a) {
527
- return e.hardware.requestChange({
528
- property: "velocity",
529
- value: a
530
- });
656
+ function ze(e, t = []) {
657
+ return te(() => {
658
+ const n = t.includes("auto_ready"), i = t.includes("auto_on");
659
+ if (e === void 0)
660
+ return { UNKNOWN: !0 };
661
+ if ((e == null ? void 0 : e.length) === 0)
662
+ return n ? { READY: !0 } : { NOT_READY: !0 };
663
+ const a = e.reduce((o, l) => (o[l] = !0, o), {});
664
+ return a.READY === void 0 && i && a.OFF && (a.READY = !0), a;
665
+ }, [e, t]);
666
+ }
667
+ function Be(e) {
668
+ var a, o;
669
+ const { states: t } = e;
670
+ function n(l) {
671
+ return e.hardware.actions.setProperty("velocity", l);
531
672
  }
532
- function n(a) {
533
- return e.hardware.requestChange({
534
- property: "acceleration",
535
- value: a
536
- });
673
+ function i(l) {
674
+ return e.hardware.actions.setProperty("acceleration", l);
537
675
  }
538
- let i = "UNKNOWN";
539
- return e.hardware.properties.state && ([i] = e.hardware.properties.state), /* @__PURE__ */ r(
676
+ return /* @__PURE__ */ r(
540
677
  R,
541
678
  {
542
679
  trigger: "click",
543
680
  rootClose: !0,
544
- overlay: /* @__PURE__ */ s(b, { id: "popid", children: [
545
- /* @__PURE__ */ s(b.Header, { children: [
681
+ overlay: /* @__PURE__ */ c(b, { id: "popid", children: [
682
+ /* @__PURE__ */ c(b.Header, { children: [
546
683
  e.hardware.name,
547
684
  " details"
548
685
  ] }),
549
- /* @__PURE__ */ s(b.Body, { children: [
550
- /* @__PURE__ */ s(N.Group, { children: [
551
- /* @__PURE__ */ r(N.Label, { children: "Velocity" }),
686
+ /* @__PURE__ */ c(b.Body, { children: [
687
+ /* @__PURE__ */ c(C.Group, { children: [
688
+ /* @__PURE__ */ r(C.Label, { children: "Velocity" }),
552
689
  /* @__PURE__ */ r(
553
- re,
690
+ le,
554
691
  {
555
- hardwareValue: e.hardware.properties.velocity,
556
- onMoveRequested: t,
692
+ hardwareValue: ((a = e.hardware.properties) == null ? void 0 : a.velocity) ?? 0,
693
+ onMoveRequested: n,
557
694
  hardwareIsDisabled: e.disabled,
558
- hardwareIsReady: i === "READY",
559
- hardwareIsMoving: i === "MOVING",
695
+ hardwareIsReady: t.READY,
696
+ hardwareIsMoving: t.MOVING,
560
697
  readOnly: e.readOnly
561
698
  }
562
699
  )
563
700
  ] }),
564
- /* @__PURE__ */ s(N.Group, { children: [
565
- /* @__PURE__ */ r(N.Label, { children: "Acceleration" }),
701
+ /* @__PURE__ */ c(C.Group, { children: [
702
+ /* @__PURE__ */ r(C.Label, { children: "Acceleration" }),
566
703
  /* @__PURE__ */ r(
567
- re,
704
+ le,
568
705
  {
569
- hardwareValue: e.hardware.properties.acceleration,
570
- onMoveRequested: n,
706
+ hardwareValue: ((o = e.hardware.properties) == null ? void 0 : o.acceleration) ?? 0,
707
+ onMoveRequested: i,
571
708
  hardwareIsDisabled: e.disabled,
572
- hardwareIsReady: i === "READY",
573
- hardwareIsMoving: i === "MOVING",
709
+ hardwareIsReady: t.READY,
710
+ hardwareIsMoving: t.MOVING,
574
711
  readOnly: e.readOnly
575
712
  }
576
713
  )
@@ -581,41 +718,33 @@ function Ve(e) {
581
718
  }
582
719
  );
583
720
  }
584
- function jt(e) {
585
- const { hardware: t, options: n = {} } = e;
586
- function i() {
587
- t.requestChange({
588
- function: "stop"
589
- });
721
+ function Wt(e) {
722
+ const { hardware: t, options: n = {} } = e, { properties: i, user_tags: a } = t;
723
+ function o() {
724
+ t.actions.call("stop");
590
725
  }
591
- function a(u) {
592
- return t.requestChange({
593
- property: "position",
594
- value: u,
595
- function: "move"
596
- });
726
+ function l(d) {
727
+ return t.actions.call("move", d);
597
728
  }
598
- let o = "UNKNOWN";
599
- e.hardware.properties.state && ([o] = e.hardware.properties.state);
600
- const d = /* @__PURE__ */ r(D, { name: "Motor", icon: "fam-hardware-motor", online: t.online }), l = /* @__PURE__ */ r(ce, { hardware: t }), h = e.options ? e.options.header : "top";
729
+ const s = ze(i.state, a), u = /* @__PURE__ */ r(T, { name: "Motor", icon: "fam-hardware-motor", online: t.online }), h = /* @__PURE__ */ r(Ye, { hardware: t }), f = e.options ? e.options.header : "top";
601
730
  return /* @__PURE__ */ r(
602
- Y,
731
+ G,
603
732
  {
604
733
  hardware: t,
605
- widgetIcon: d,
606
- widgetState: l,
607
- widgetContent: /* @__PURE__ */ s(A, { children: [
734
+ widgetIcon: u,
735
+ widgetState: h,
736
+ widgetContent: /* @__PURE__ */ c(I, { children: [
608
737
  /* @__PURE__ */ r(
609
- Pe,
738
+ Ue,
610
739
  {
611
740
  id: t.id,
612
- hardwareValue: t.properties.position,
741
+ hardwareValue: (i == null ? void 0 : i.position) ?? null,
613
742
  hardwareIsDisabled: e.disabled,
614
- hardwareIsReady: o === "READY",
615
- hardwareIsMoving: o === "MOVING",
616
- onMoveRequested: a,
617
- onAbortRequested: i,
618
- precision: n.precision,
743
+ hardwareIsReady: s.READY ?? !1,
744
+ hardwareIsMoving: s.MOVING ?? !1,
745
+ onMoveRequested: l,
746
+ onAbortRequested: o,
747
+ precision: n.precision ?? i.display_digits ?? void 0,
619
748
  readOnly: n.readOnly,
620
749
  step: n.step,
621
750
  steps: n.steps,
@@ -626,50 +755,46 @@ function jt(e) {
626
755
  largeArrows: n.largearrows
627
756
  }
628
757
  ),
629
- t.properties.unit && /* @__PURE__ */ r(A.Text, { children: t.properties.unit }),
630
- o !== "MOVING" && n.extended && /* @__PURE__ */ r(
631
- Ve,
758
+ i.unit && /* @__PURE__ */ r(I.Text, { children: i.unit }),
759
+ !s.MOVING && n.extended && /* @__PURE__ */ r(
760
+ Be,
632
761
  {
633
762
  hardware: t,
634
763
  disabled: e.disabled,
635
- readOnly: n.readOnly
764
+ readOnly: n.readOnly,
765
+ states: s
636
766
  }
637
767
  ),
638
- o === "MOVING" && !e.disabled && !n.step && /* @__PURE__ */ r(y, { variant: "danger", onClick: i, children: /* @__PURE__ */ r("i", { className: "fa fa-times" }) })
768
+ s.MOVING && !e.disabled && !n.step && /* @__PURE__ */ r(y, { variant: "danger", onClick: o, children: /* @__PURE__ */ r("i", { className: "fa fa-times" }) })
639
769
  ] }),
640
- headerMode: h
770
+ headerMode: f
641
771
  }
642
772
  );
643
773
  }
644
- function Yt(e) {
645
- const { hardware: t, options: n = {} } = e, i = T(null);
646
- j(() => {
774
+ function qt(e) {
775
+ const { hardware: t, options: n = {} } = e, i = F(null);
776
+ P(() => {
647
777
  if (!i.current) {
648
778
  console.error("selectionRef ref is unset");
649
779
  return;
650
780
  }
651
781
  i.current.value = t.properties.position;
652
782
  }, [t.properties.position]);
653
- function a(l) {
654
- if (console.debug("change", l), !i || !i.current) {
783
+ function a(s) {
784
+ if (console.debug("change", s), !i || !i.current) {
655
785
  console.error("selection ref is unset");
656
786
  return;
657
787
  }
658
- t.requestChange({
659
- value: i.current.value,
660
- function: "move"
661
- });
788
+ t.actions.call("move", i.current.value);
662
789
  }
663
- function o(l) {
664
- t.requestChange({
665
- function: "stop"
666
- });
790
+ function o(s) {
791
+ t.actions.call("stop");
667
792
  }
668
- const d = C(t.properties.positions, (l) => /* @__PURE__ */ r("option", { title: l.description, children: l.position }, l.position));
669
- return /* @__PURE__ */ s("div", { className: "hw-component", children: [
670
- /* @__PURE__ */ s("div", { className: "hw-head", children: [
793
+ const l = S(t.properties.positions, (s) => /* @__PURE__ */ r("option", { title: s.description, children: s.position }, s.position));
794
+ return /* @__PURE__ */ c("div", { className: "hw-component", children: [
795
+ /* @__PURE__ */ c("div", { className: "hw-head", children: [
671
796
  /* @__PURE__ */ r(
672
- D,
797
+ T,
673
798
  {
674
799
  name: "Multiposition",
675
800
  icon: "fam-hardware-multiposition",
@@ -678,16 +803,16 @@ function Yt(e) {
678
803
  ),
679
804
  /* @__PURE__ */ r("div", { className: "name", children: t.name }),
680
805
  /* @__PURE__ */ r(
681
- F,
806
+ A,
682
807
  {
683
808
  bg: t.properties.state === "READY" ? "success" : "warning",
684
809
  children: t.properties.state
685
810
  }
686
811
  )
687
812
  ] }),
688
- /* @__PURE__ */ r("div", { className: "hw-content", children: /* @__PURE__ */ s(A, { children: [
689
- /* @__PURE__ */ s(
690
- N.Control,
813
+ /* @__PURE__ */ r("div", { className: "hw-content", children: /* @__PURE__ */ c(I, { children: [
814
+ /* @__PURE__ */ c(
815
+ C.Control,
691
816
  {
692
817
  className: "custom-select",
693
818
  as: "select",
@@ -696,7 +821,7 @@ function Yt(e) {
696
821
  defaultValue: t.properties.position,
697
822
  children: [
698
823
  /* @__PURE__ */ r("option", { disabled: !0, children: "unknown" }),
699
- d
824
+ l
700
825
  ]
701
826
  }
702
827
  ),
@@ -705,95 +830,98 @@ function Yt(e) {
705
830
  ] }) })
706
831
  ] });
707
832
  }
708
- const Le = ke("daiquiri.components.hardware.NoObject");
709
- function Ut(e) {
710
- if (e.options.emptyifnone)
711
- return Le(
712
- 'Component id:"%s" name:"%s" not displayed cause setup with emptyifnone.',
713
- e.id,
714
- e.name
715
- ), /* @__PURE__ */ r(v, {});
716
- const t = /* @__PURE__ */ r(D, { name: "NoObject", icon: "fam-hardware-any", online: !1 }), n = /* @__PURE__ */ r(v, {}), i = /* @__PURE__ */ r(v, { children: "Missing" }), a = e.options ? e.options.header : "top", o = {
717
- id: e.id,
718
- name: e.name ?? "",
719
- alias: null,
720
- online: !1,
721
- properties: {},
722
- type: ""
723
- };
724
- return /* @__PURE__ */ r(
725
- Y,
726
- {
727
- hardware: o,
728
- widgetIcon: t,
729
- widgetState: n,
730
- widgetContent: i,
731
- headerMode: a
732
- }
733
- );
734
- }
735
- function je(e) {
833
+ function Ge(e) {
736
834
  const t = e.online ? "READY" : "OFFLINE";
737
- return /* @__PURE__ */ r(F, { bg: t === "READY" ? "success" : "warning", children: t });
835
+ return /* @__PURE__ */ r(A, { bg: t === "READY" ? "success" : "warning", children: t });
738
836
  }
739
- function Kt(e) {
740
- const { hardware: t, options: n = {} } = e, i = /* @__PURE__ */ r(D, { name: "Optic", icon: "fa-cog", online: t.online }), a = /* @__PURE__ */ r(je, { ...t });
837
+ function Zt(e) {
838
+ const { hardware: t, options: n = {} } = e, i = /* @__PURE__ */ r(T, { name: "Optic", icon: "fa-cog", online: t.online }), a = /* @__PURE__ */ r(Ge, { ...t });
741
839
  function o() {
742
- const c = n.property;
743
- if (c === void 0)
840
+ const f = n.property;
841
+ if (f === void 0)
744
842
  return "property is not set";
745
- if (c === null)
843
+ if (f === null)
746
844
  return "property is null";
747
- let f = t;
748
- for (const m of c.split("/"))
749
- if (f = f[m], f === void 0)
750
- return `property '${c}' not found`;
751
- return `${f}`;
845
+ let d = t;
846
+ for (const m of f.split("/"))
847
+ if (d = d[m], d === void 0)
848
+ return `property '${f}' not found`;
849
+ return `${d}`;
752
850
  }
753
- function d() {
754
- const c = n.unit;
755
- if (!c)
851
+ function l() {
852
+ const f = n.unit;
853
+ if (!f)
756
854
  return null;
757
- if (!c.includes("properties"))
758
- return c;
759
- let f = e;
760
- for (const m of c.split("/"))
761
- if (f = f[m], f === void 0)
855
+ if (!f.includes("properties"))
856
+ return f;
857
+ let d = e;
858
+ for (const m of f.split("/"))
859
+ if (d = d[m], d === void 0)
762
860
  return null;
763
- return `${f}`;
861
+ return `${d}`;
764
862
  }
765
- const l = d(), h = /* @__PURE__ */ s(A, { children: [
766
- /* @__PURE__ */ r(N.Control, { value: o(), readOnly: !0 }),
767
- l && /* @__PURE__ */ r(A.Text, { children: l })
768
- ] }), u = e.options.header || "top";
863
+ const s = l(), u = /* @__PURE__ */ c(I, { children: [
864
+ /* @__PURE__ */ r(C.Control, { value: o(), readOnly: !0 }),
865
+ s && /* @__PURE__ */ r(I.Text, { children: s })
866
+ ] }), h = e.options.header || "top";
769
867
  return /* @__PURE__ */ r(
770
- Y,
868
+ G,
771
869
  {
772
870
  hardware: t,
773
871
  widgetIcon: i,
774
872
  widgetState: a,
775
- widgetContent: h,
776
- headerMode: u
873
+ widgetContent: u,
874
+ headerMode: h
777
875
  }
778
876
  );
779
877
  }
780
- function Ye(e) {
781
- const { hardware: t } = e, n = () => {
782
- t.requestChange({
783
- function: "reset"
784
- });
785
- };
878
+ function We(e) {
879
+ const { hardware: t } = e;
880
+ function n() {
881
+ if (!t.online)
882
+ return "OFFLINE";
883
+ const o = t.properties.state;
884
+ return e.useReadyState && (o === "OPEN" || o === "CLOSED") ? "READY" : o;
885
+ }
886
+ const i = n();
887
+ function a() {
888
+ switch (i) {
889
+ case "READY":
890
+ return "success";
891
+ case "OPEN":
892
+ return "success";
893
+ case "CLOSED":
894
+ return "danger";
895
+ case "DISABLED":
896
+ return "secondary";
897
+ case "MOVING":
898
+ case "STANDBY":
899
+ case "OFFLINE":
900
+ return "warning";
901
+ case "FAULT":
902
+ return "fatal";
903
+ default:
904
+ return "fatal";
905
+ }
906
+ }
907
+ return /* @__PURE__ */ r(U, { state: i, minWidth: 6, variant: a() });
908
+ }
909
+ function qe(e) {
910
+ const { hardware: t } = e;
911
+ function n() {
912
+ t.actions.call("reset");
913
+ }
786
914
  return /* @__PURE__ */ r(
787
915
  R,
788
916
  {
789
917
  trigger: "click",
790
918
  rootClose: !0,
791
- overlay: /* @__PURE__ */ s(b, { id: "popid", children: [
792
- /* @__PURE__ */ s(b.Header, { children: [
919
+ overlay: /* @__PURE__ */ c(b, { id: "popid", children: [
920
+ /* @__PURE__ */ c(b.Header, { children: [
793
921
  t.name,
794
922
  " Details"
795
923
  ] }),
796
- /* @__PURE__ */ s(b.Body, { children: [
924
+ /* @__PURE__ */ c(b.Body, { children: [
797
925
  /* @__PURE__ */ r("h6", { children: "Status" }),
798
926
  /* @__PURE__ */ r("pre", { children: t.properties.status }),
799
927
  /* @__PURE__ */ r("div", { className: "d-grid gap-2", children: /* @__PURE__ */ r(y, { onClick: n, disabled: e.disabled, children: "Reset" }) })
@@ -803,22 +931,22 @@ function Ye(e) {
803
931
  }
804
932
  );
805
933
  }
806
- function zt(e) {
934
+ function Jt(e) {
807
935
  const { hardware: t, options: n = {} } = e, i = /* @__PURE__ */ r(
808
- D,
936
+ T,
809
937
  {
810
938
  name: "Shutter",
811
939
  icon: "fam-hardware-shutter",
812
940
  online: t.online
813
941
  }
814
- ), a = /* @__PURE__ */ r(de, { hardware: t });
942
+ ), a = /* @__PURE__ */ r(We, { hardware: t });
815
943
  function o() {
816
944
  return t.properties ? t.properties.state : "UNKNOWN";
817
945
  }
818
- function d(S) {
819
- return S === "OPEN" ? ["Close", "close"] : S === "CLOSED" ? ["Open", "open"] : S === "DISABLED" || S === "STANDBY" || S === "FAULT" ? ["Closed", ""] : S === "MOVING" ? ["...", ""] : ["Unknown", ""];
946
+ function l(x) {
947
+ return x === "OPEN" ? ["Close", "close"] : x === "CLOSED" ? ["Open", "open"] : x === "DISABLED" || x === "STANDBY" || x === "FAULT" ? ["Closed", ""] : x === "MOVING" ? ["...", ""] : ["Unknown", ""];
820
948
  }
821
- const l = o(), [h, u] = d(l), f = {
949
+ const s = o(), [u, h] = l(s), d = {
822
950
  OPEN: "danger",
823
951
  CLOSED: "success",
824
952
  MOVING: "warning",
@@ -826,36 +954,34 @@ function zt(e) {
826
954
  STANDBY: "danger",
827
955
  FAULT: "fatal",
828
956
  UNKNOWN: "warning"
829
- }[l] || "danger";
957
+ }[s] || "danger";
830
958
  function m() {
831
- t.requestChange({
832
- function: u
833
- });
959
+ t.actions.call(h);
834
960
  }
835
- const k = /* @__PURE__ */ s(oe, { className: "d-flex flex-nowrap", children: [
961
+ const N = /* @__PURE__ */ c(ue, { className: "d-flex flex-nowrap", children: [
836
962
  /* @__PURE__ */ r(
837
963
  y,
838
964
  {
839
- variant: f,
965
+ variant: d,
840
966
  onClick: m,
841
- disabled: e.disabled || u === "",
842
- children: h
967
+ disabled: e.disabled || h === "",
968
+ children: u
843
969
  }
844
970
  ),
845
- n.extended && /* @__PURE__ */ r(Ye, { ...e })
846
- ] }), K = e.options.header || "top";
971
+ n.extended && /* @__PURE__ */ r(qe, { ...e })
972
+ ] }), $ = e.options.header || "top";
847
973
  return /* @__PURE__ */ r(
848
- Y,
974
+ G,
849
975
  {
850
976
  hardware: t,
851
977
  widgetIcon: i,
852
978
  widgetState: a,
853
- widgetContent: k,
854
- headerMode: K
979
+ widgetContent: N,
980
+ headerMode: $
855
981
  }
856
982
  );
857
983
  }
858
- class qt extends se {
984
+ class Qt extends fe {
859
985
  constructor() {
860
986
  super(...arguments), this.variants = {};
861
987
  }
@@ -864,9 +990,38 @@ class qt extends se {
864
990
  return this.props.options.variant in this.variants && (t = this.variants[this.props.options.variant]), /* @__PURE__ */ r(t, { ...this.props });
865
991
  }
866
992
  }
867
- function Ue(e) {
868
- const [t, n] = I({}), i = T(null);
869
- return j(() => {
993
+ const Ze = Re("daiquiri.components.hardware.NoObject");
994
+ function Xt(e) {
995
+ if (e.options.emptyifnone)
996
+ return Ze(
997
+ 'Component id:"%s" name:"%s" not displayed cause setup with emptyifnone.',
998
+ e.id,
999
+ e.name
1000
+ ), /* @__PURE__ */ r(v, {});
1001
+ const t = /* @__PURE__ */ r(T, { name: "NoObject", icon: "fam-hardware-any", online: !1 }), n = /* @__PURE__ */ r(v, {}), i = /* @__PURE__ */ r(v, { children: "Missing" }), a = e.options ? e.options.header : "top", o = {
1002
+ id: e.id,
1003
+ name: e.name ?? "",
1004
+ alias: null,
1005
+ user_tags: [],
1006
+ online: !1,
1007
+ locked: null,
1008
+ properties: {},
1009
+ type: ""
1010
+ };
1011
+ return /* @__PURE__ */ r(
1012
+ G,
1013
+ {
1014
+ hardware: o,
1015
+ widgetIcon: t,
1016
+ widgetState: n,
1017
+ widgetContent: i,
1018
+ headerMode: a
1019
+ }
1020
+ );
1021
+ }
1022
+ function Je(e) {
1023
+ const [t, n] = k({}), i = F(null);
1024
+ return P(() => {
870
1025
  if (i.current) {
871
1026
  const a = i.current;
872
1027
  n({
@@ -895,75 +1050,75 @@ function Ue(e) {
895
1050
  }
896
1051
  );
897
1052
  }
898
- function Ke(e) {
1053
+ function Qe(e) {
899
1054
  return /* @__PURE__ */ r("div", { className: "panel-header", style: e.style, children: e.children });
900
1055
  }
901
- function ze(e) {
902
- return /* @__PURE__ */ r("div", { className: "panel-contents", style: e.style, children: e.children });
1056
+ function Xe(e) {
1057
+ return /* @__PURE__ */ r("div", { className: `panel-contents ${e.className}`, style: e.style, children: e.children });
903
1058
  }
904
- function p(e) {
905
- const t = e.scroll ? Ue : q;
1059
+ function g(e) {
1060
+ const t = e.scroll ? Je : Ie;
906
1061
  return /* @__PURE__ */ r("div", { className: `panel ${e.className ?? ""}`, style: e.style, children: /* @__PURE__ */ r(t, { children: e.children }) });
907
1062
  }
908
- p.Header = Ke;
909
- p.Contents = ze;
910
- const Gt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1063
+ g.Header = Qe;
1064
+ g.Contents = Xe;
1065
+ const en = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
911
1066
  __proto__: null
912
- }, Symbol.toStringTag, { value: "Module" })), Wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1067
+ }, Symbol.toStringTag, { value: "Module" })), tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
913
1068
  __proto__: null
914
- }, Symbol.toStringTag, { value: "Module" })), _ = {};
915
- function qe(e, t) {
916
- _[e] = t;
1069
+ }, Symbol.toStringTag, { value: "Module" })), K = {};
1070
+ function et(e, t) {
1071
+ K[e] = t;
917
1072
  }
918
- function O(e, t, n = !0) {
1073
+ function E(e, t, n = !0) {
919
1074
  if (!e)
920
1075
  return /* @__PURE__ */ r(v, {});
921
- const { type: i } = e, a = i && i in _ ? _[i] : _.component;
1076
+ const { type: i } = e, a = i && i in K ? K[i] : K.component;
922
1077
  return /* @__PURE__ */ r(a, { yamlNode: e, panel: n }, t);
923
1078
  }
924
- function Ge({
1079
+ function tt({
925
1080
  children: e,
926
1081
  key: t,
927
1082
  panel: n,
928
1083
  options: i
929
1084
  }) {
930
- return n ? /* @__PURE__ */ r(p, { style: i.style, scroll: i.scroll, children: /* @__PURE__ */ r(p.Contents, { children: e }) }, t) : /* @__PURE__ */ r(v, { children: Se.map(
1085
+ return n ? /* @__PURE__ */ r(g, { style: i.style, scroll: i.scroll, children: /* @__PURE__ */ r(g.Contents, { children: e }) }, t) : /* @__PURE__ */ r(v, { children: ke.map(
931
1086
  e,
932
- (a) => Ee(a) ? xe(a, { key: t, ...a.props }) : void 0
1087
+ (a) => $e(a) ? Fe(a, { key: t, ...a.props }) : void 0
933
1088
  ) });
934
1089
  }
935
- function ue(e, t) {
1090
+ function ge(e, t) {
936
1091
  const { _parentNode: n, _indexFromParent: i, ...a } = t;
937
1092
  if (e && Object.keys(a).length > 0)
938
- throw new V(e, Object.keys(a));
1093
+ throw new z(e, Object.keys(a));
939
1094
  }
940
- class M extends Error {
1095
+ class D extends Error {
941
1096
  constructor(t, n) {
942
1097
  super(t), this.yamlNode = n;
943
1098
  }
944
1099
  }
945
- class V extends M {
1100
+ class z extends D {
946
1101
  constructor(t, n) {
947
1102
  super(`Unexpected keys: ${n.join(", ")}`, t), this.keys = n;
948
1103
  }
949
1104
  }
950
- class L extends M {
1105
+ class B extends D {
951
1106
  constructor(t, n) {
952
1107
  super(`Keys ${n.join(", ")} are missing`, t), this.keys = n;
953
1108
  }
954
1109
  }
955
- class g extends M {
1110
+ class w extends D {
956
1111
  constructor(t, n, i) {
957
1112
  super(`Key ${n} error: ${i}`, t), this.key = n, this.keyMessage = i;
958
1113
  }
959
1114
  }
960
- function We(e) {
1115
+ function nt(e) {
961
1116
  let t = e;
962
1117
  for (; t._parentNode; )
963
1118
  t = t._parentNode;
964
1119
  return t;
965
1120
  }
966
- function Be(e) {
1121
+ function rt(e) {
967
1122
  const t = [];
968
1123
  let n = e;
969
1124
  for (; n; )
@@ -973,7 +1128,7 @@ function Be(e) {
973
1128
  }), n = n._parentNode;
974
1129
  return t.reverse(), t;
975
1130
  }
976
- function he(e, t = null, n = null) {
1131
+ function we(e, t = null, n = null) {
977
1132
  if (e._parentNode)
978
1133
  throw new Error(
979
1134
  "Attribute _parentNode was already defined by the yml layout."
@@ -985,62 +1140,62 @@ function he(e, t = null, n = null) {
985
1140
  };
986
1141
  if (e.children) {
987
1142
  const a = [...e.children];
988
- Object.freeze(a), i.children = a.map((o, d) => he(o, i, d));
1143
+ Object.freeze(a), i.children = a.map((o, l) => we(o, i, l));
989
1144
  }
990
1145
  return Object.freeze(i), i;
991
1146
  }
992
- function fe(e) {
1147
+ function ye(e) {
993
1148
  var t;
994
- return /* @__PURE__ */ s(x, { variant: "danger", children: [
1149
+ return /* @__PURE__ */ c(M, { variant: "danger", children: [
995
1150
  e.message,
996
1151
  /* @__PURE__ */ r("br", {}),
997
1152
  /* @__PURE__ */ r("pre", { children: (t = e.error) == null ? void 0 : t.stack })
998
1153
  ] });
999
1154
  }
1000
- function Ze(e) {
1155
+ function it(e) {
1001
1156
  const { error: t } = e;
1002
- if (!(t instanceof M))
1157
+ if (!(t instanceof D))
1003
1158
  return /* @__PURE__ */ r(v, {});
1004
- function n(o, d = 3) {
1005
- const l = Be(o.yamlNode), h = [];
1006
- let u = "";
1007
- for (let c = 1; c < l.length; c++) {
1008
- const { node: f, indexFromParent: m } = l[c];
1009
- h.push(`${u}children:`), u += " ".repeat(d), m === 1 ? h.push(`${u}- type: ...`) : (m ?? 0 > 1) && h.push(
1010
- `${u}...`,
1011
- `${u}...`,
1012
- `${u}# children number ${m ?? 0 + 1}`
1013
- ), h.push(`${u}- type: ${f.type}`), u += " ".repeat(2);
1159
+ function n(o, l = 3) {
1160
+ const s = rt(o.yamlNode), u = [];
1161
+ let h = "";
1162
+ for (let f = 1; f < s.length; f++) {
1163
+ const { node: d, indexFromParent: m } = s[f];
1164
+ u.push(`${h}children:`), h += " ".repeat(l), m === 1 ? u.push(`${h}- type: ...`) : (m ?? 0 > 1) && u.push(
1165
+ `${h}...`,
1166
+ `${h}...`,
1167
+ `${h}# children number ${m ?? 0 + 1}`
1168
+ ), u.push(`${h}- type: ${d.type}`), h += " ".repeat(2);
1014
1169
  }
1015
- return o instanceof V ? o.keys.forEach((c) => {
1016
- h.push(
1017
- `${u}${c}: ... ${" ".repeat(
1018
- 50 - u.length - c.length
1170
+ return o instanceof z ? o.keys.forEach((f) => {
1171
+ u.push(
1172
+ `${h}${f}: ... ${" ".repeat(
1173
+ 50 - h.length - f.length
1019
1174
  )}<-- unexpected key`
1020
1175
  );
1021
- }) : o instanceof L ? o.keys.forEach((c) => {
1022
- h.push(
1023
- `${u}???: ${" ".repeat(
1024
- 50 - u.length - c.length
1025
- )}<-- key **${c}** is expected`
1176
+ }) : o instanceof B ? o.keys.forEach((f) => {
1177
+ u.push(
1178
+ `${h}???: ${" ".repeat(
1179
+ 50 - h.length - f.length
1180
+ )}<-- key **${f}** is expected`
1026
1181
  );
1027
- }) : o instanceof g && h.push(
1028
- `${u}${o.key}: ${" ".repeat(
1029
- 50 - u.length - o.key.length
1182
+ }) : o instanceof w && u.push(
1183
+ `${h}${o.key}: ${" ".repeat(
1184
+ 50 - h.length - o.key.length
1030
1185
  )}<-- ${o.keyMessage}`
1031
- ), h.join(`
1186
+ ), u.join(`
1032
1187
  `);
1033
1188
  }
1034
- const a = We(t.yamlNode).name;
1035
- if (t instanceof V) {
1189
+ const a = nt(t.yamlNode).name;
1190
+ if (t instanceof z) {
1036
1191
  const o = t.keys.length === 1 ? "key" : "keys";
1037
- return /* @__PURE__ */ s(x, { variant: "danger", children: [
1192
+ return /* @__PURE__ */ c(M, { variant: "danger", children: [
1038
1193
  "Unexpected ",
1039
1194
  o,
1040
1195
  " ",
1041
- t.keys.map((d, l) => /* @__PURE__ */ s(v, { children: [
1042
- l !== 0 && ", ",
1043
- /* @__PURE__ */ r("b", { children: d })
1196
+ t.keys.map((l, s) => /* @__PURE__ */ c(v, { children: [
1197
+ s !== 0 && ", ",
1198
+ /* @__PURE__ */ r("b", { children: l })
1044
1199
  ] })),
1045
1200
  " ",
1046
1201
  "from the layout name ",
@@ -1051,15 +1206,15 @@ function Ze(e) {
1051
1206
  /* @__PURE__ */ r("br", {})
1052
1207
  ] });
1053
1208
  }
1054
- if (t instanceof L) {
1209
+ if (t instanceof B) {
1055
1210
  const o = t.keys.length === 1 ? "Key" : "Keys";
1056
- return /* @__PURE__ */ s(x, { variant: "danger", children: [
1211
+ return /* @__PURE__ */ c(M, { variant: "danger", children: [
1057
1212
  "Expected ",
1058
1213
  o,
1059
1214
  " ",
1060
- t.keys.map((d, l) => /* @__PURE__ */ s(v, { children: [
1061
- l !== 0 && ", ",
1062
- /* @__PURE__ */ r("b", { children: d })
1215
+ t.keys.map((l, s) => /* @__PURE__ */ c(v, { children: [
1216
+ s !== 0 && ", ",
1217
+ /* @__PURE__ */ r("b", { children: l })
1063
1218
  ] })),
1064
1219
  " ",
1065
1220
  "from the layout name ",
@@ -1070,7 +1225,7 @@ function Ze(e) {
1070
1225
  /* @__PURE__ */ r("br", {})
1071
1226
  ] });
1072
1227
  }
1073
- return t instanceof g ? /* @__PURE__ */ s(x, { variant: "danger", children: [
1228
+ return t instanceof w ? /* @__PURE__ */ c(M, { variant: "danger", children: [
1074
1229
  "Error on key ",
1075
1230
  /* @__PURE__ */ r("b", { children: t.key }),
1076
1231
  " from the layout name ",
@@ -1079,25 +1234,25 @@ function Ze(e) {
1079
1234
  /* @__PURE__ */ r("br", {}),
1080
1235
  /* @__PURE__ */ r("pre", { className: "mt-3", children: n(t) }),
1081
1236
  /* @__PURE__ */ r("br", {})
1082
- ] }) : /* @__PURE__ */ r(fe, { ...e });
1237
+ ] }) : /* @__PURE__ */ r(ye, { ...e });
1083
1238
  }
1084
- const ie = {
1239
+ const ce = {
1085
1240
  hasError: !1,
1086
1241
  message: "",
1087
1242
  error: void 0
1088
1243
  };
1089
- class Je extends se {
1244
+ class at extends fe {
1090
1245
  constructor(t) {
1091
1246
  super(t), this.reload = () => {
1092
1247
  window.location.reload();
1093
- }, this.state = ie;
1248
+ }, this.state = ce;
1094
1249
  }
1095
1250
  static getDerivedStateFromError() {
1096
1251
  return { hasError: !0 };
1097
1252
  }
1098
1253
  componentDidCatch(t) {
1099
1254
  var n, i;
1100
- if (t instanceof M || !this.props.unhandledComponentDidCatch) {
1255
+ if (t instanceof D || !this.props.unhandledComponentDidCatch) {
1101
1256
  this.setState({
1102
1257
  hasError: !0,
1103
1258
  message: t.message,
@@ -1116,31 +1271,31 @@ class Je extends se {
1116
1271
  }
1117
1272
  // https://github.com/bvaughn/react-error-boundary/blob/23a4d779744f3079dfe0960acaa4bdfd5dede87b/src/ErrorBoundary.ts#L53
1118
1273
  componentDidUpdate(t, n) {
1119
- this.state.hasError && n.error !== void 0 && t.resetKey !== this.props.resetKey && this.setState(ie);
1274
+ this.state.hasError && n.error !== void 0 && t.resetKey !== this.props.resetKey && this.setState(ce);
1120
1275
  }
1121
1276
  render() {
1122
1277
  if (this.state.hasError) {
1123
1278
  const { UnhandledErrorComponent: t } = this.props, { hasError: n, ...i } = this.state;
1124
- return /* @__PURE__ */ s($, { className: "mt-2", children: [
1279
+ return /* @__PURE__ */ c(L, { className: "mt-2", children: [
1125
1280
  /* @__PURE__ */ r("h4", { children: "Something went wrong" }),
1126
- this.state.error instanceof M && /* @__PURE__ */ r(
1127
- Ze,
1281
+ this.state.error instanceof D && /* @__PURE__ */ r(
1282
+ it,
1128
1283
  {
1129
1284
  message: this.state.message,
1130
1285
  error: this.state.error
1131
1286
  }
1132
1287
  ),
1133
- !(this.state.error instanceof M) && /* @__PURE__ */ r(v, { children: t ? /* @__PURE__ */ r(t, { ...i }) : /* @__PURE__ */ r(
1134
- fe,
1288
+ !(this.state.error instanceof D) && /* @__PURE__ */ r(v, { children: t ? /* @__PURE__ */ r(t, { ...i }) : /* @__PURE__ */ r(
1289
+ ye,
1135
1290
  {
1136
1291
  message: this.state.message,
1137
1292
  error: this.state.error
1138
1293
  }
1139
1294
  ) }),
1140
- /* @__PURE__ */ s("p", { children: [
1295
+ /* @__PURE__ */ c("p", { children: [
1141
1296
  "This error has been logged. Please",
1142
1297
  " ",
1143
- /* @__PURE__ */ s(y, { size: "sm", onClick: this.reload, children: [
1298
+ /* @__PURE__ */ c(y, { size: "sm", onClick: this.reload, children: [
1144
1299
  /* @__PURE__ */ r("i", { className: "fa fa-refresh" }),
1145
1300
  " Reload"
1146
1301
  ] }),
@@ -1152,49 +1307,49 @@ class Je extends se {
1152
1307
  return this.props.children;
1153
1308
  }
1154
1309
  }
1155
- function Qe(e, t, n) {
1310
+ function ot(e, t, n) {
1156
1311
  if (e && n === void 0)
1157
- throw new L(e, [t]);
1312
+ throw new B(e, [t]);
1158
1313
  }
1159
- function Xe(e, t, n) {
1314
+ function st(e, t, n) {
1160
1315
  if (typeof n != "string")
1161
- throw new g(e, t, "A string is expected");
1316
+ throw new w(e, t, "A string is expected");
1162
1317
  }
1163
- function et(e, t, n) {
1318
+ function lt(e, t, n) {
1164
1319
  if (typeof n != "boolean")
1165
- throw new g(e, t, "A boolean is expected");
1320
+ throw new w(e, t, "A boolean is expected");
1166
1321
  }
1167
- function tt(e, t, n) {
1322
+ function ct(e, t, n) {
1168
1323
  if (typeof n != "number")
1169
- throw new g(e, t, "A number is expected");
1324
+ throw new w(e, t, "A number is expected");
1170
1325
  }
1171
- function G(e, t, n) {
1326
+ function J(e, t, n) {
1172
1327
  if (n !== void 0 && typeof n != "boolean")
1173
- throw new g(e, t, "An optional boolean is expected");
1328
+ throw new w(e, t, "An optional boolean is expected");
1174
1329
  }
1175
- function me(e, t, n) {
1330
+ function ve(e, t, n) {
1176
1331
  if (n !== void 0 && typeof n != "string")
1177
- throw new g(e, t, "An optional string is expected");
1332
+ throw new w(e, t, "An optional string is expected");
1178
1333
  }
1179
- function nt(e, t, n) {
1334
+ function dt(e, t, n) {
1180
1335
  if (!Array.isArray(n))
1181
- throw new g(e, t, "A list of string is expected");
1336
+ throw new w(e, t, "A list of string is expected");
1182
1337
  n.forEach((i) => {
1183
1338
  if (typeof i != "string")
1184
- throw new g(e, t, "A list of string is expected");
1339
+ throw new w(e, t, "A list of string is expected");
1185
1340
  });
1186
1341
  }
1187
- function rt(e, t, n) {
1342
+ function ut(e, t, n) {
1188
1343
  if (n !== void 0 && typeof n != "string") {
1189
1344
  if (!Array.isArray(n))
1190
- throw new g(
1345
+ throw new w(
1191
1346
  e,
1192
1347
  t,
1193
1348
  "An optional string or list of string is expected"
1194
1349
  );
1195
1350
  n.forEach((i) => {
1196
1351
  if (typeof i != "string")
1197
- throw new g(
1352
+ throw new w(
1198
1353
  e,
1199
1354
  t,
1200
1355
  "An optional string or list of string is expected"
@@ -1202,13 +1357,13 @@ function rt(e, t, n) {
1202
1357
  });
1203
1358
  }
1204
1359
  }
1205
- function it(e, t, n) {
1360
+ function ht(e, t, n) {
1206
1361
  if (n !== void 0) {
1207
1362
  if (!Array.isArray(n))
1208
- throw new g(e, t, "An optional list of string is expected");
1363
+ throw new w(e, t, "An optional list of string is expected");
1209
1364
  n.forEach((i) => {
1210
1365
  if (typeof i != "string")
1211
- throw new g(
1366
+ throw new w(
1212
1367
  e,
1213
1368
  t,
1214
1369
  "A optional list of string is expected"
@@ -1216,21 +1371,21 @@ function it(e, t, n) {
1216
1371
  });
1217
1372
  }
1218
1373
  }
1219
- function pe(e, t, n) {
1374
+ function Ne(e, t, n) {
1220
1375
  if (n !== void 0 && typeof n != "number")
1221
- throw new g(e, t, "An optional number is expected");
1376
+ throw new w(e, t, "An optional number is expected");
1222
1377
  }
1223
- function at(e, t, n) {
1378
+ function ft(e, t, n) {
1224
1379
  if (n !== void 0) {
1225
1380
  if (!Array.isArray(n))
1226
- throw new g(
1381
+ throw new w(
1227
1382
  e,
1228
1383
  t,
1229
1384
  "An optional list of numbers is expected"
1230
1385
  );
1231
1386
  n.forEach((i) => {
1232
1387
  if (typeof i != "number")
1233
- throw new g(
1388
+ throw new w(
1234
1389
  e,
1235
1390
  t,
1236
1391
  "An optional list of numbers is expected"
@@ -1238,182 +1393,182 @@ function at(e, t, n) {
1238
1393
  });
1239
1394
  }
1240
1395
  }
1241
- function U(e, t) {
1396
+ function W(e, t) {
1242
1397
  const { _parentNode: n, _indexFromParent: i, ...a } = t;
1243
1398
  if (e && Object.keys(a).length > 0)
1244
- throw new V(e, Object.keys(a));
1399
+ throw new z(e, Object.keys(a));
1245
1400
  }
1246
- function ot(e, t, n) {
1401
+ function mt(e, t, n) {
1247
1402
  if (n !== "last" && typeof n != "number")
1248
- throw new g(e, t, '"last" or a number is expected');
1403
+ throw new w(e, t, '"last" or a number is expected');
1249
1404
  }
1250
- function st(e, t, n) {
1405
+ function pt(e, t, n) {
1251
1406
  if (n !== void 0 && n !== "h5web" && n !== "plotly")
1252
- throw new g(e, t, '"h5web" or "plotly" string is expected');
1407
+ throw new w(e, t, '"h5web" or "plotly" string is expected');
1253
1408
  }
1254
- const Bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1409
+ const nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1255
1410
  __proto__: null,
1256
- assertBoolean: et,
1257
- assertDataCollectionId: ot,
1258
- assertKeyExpected: Qe,
1259
- assertNoUnknownKeys: U,
1260
- assertNumber: tt,
1261
- assertOptionalBackend: st,
1262
- assertOptionalBoolean: G,
1263
- assertOptionalNumber: pe,
1264
- assertOptionalNumberList: at,
1265
- assertOptionalString: me,
1266
- assertOptionalStringList: it,
1267
- assertOptionalStringOrStringList: rt,
1268
- assertString: Xe,
1269
- assertStringList: nt
1411
+ assertBoolean: lt,
1412
+ assertDataCollectionId: mt,
1413
+ assertKeyExpected: ot,
1414
+ assertNoUnknownKeys: W,
1415
+ assertNumber: ct,
1416
+ assertOptionalBackend: pt,
1417
+ assertOptionalBoolean: J,
1418
+ assertOptionalNumber: Ne,
1419
+ assertOptionalNumberList: ft,
1420
+ assertOptionalString: ve,
1421
+ assertOptionalStringList: ht,
1422
+ assertOptionalStringOrStringList: ut,
1423
+ assertString: st,
1424
+ assertStringList: dt
1270
1425
  }, Symbol.toStringTag, { value: "Module" }));
1271
- function lt({ yamlNode: e, panel: t }) {
1426
+ function gt({ yamlNode: e, panel: t }) {
1272
1427
  const { type: n, style: i, children: a, ...o } = e;
1273
- return U(e, o), /* @__PURE__ */ r(P, { className: "ymllayout-row gx-0", style: i, children: C(a, (d, l) => O(d, l, t)) });
1428
+ return W(e, o), /* @__PURE__ */ r(V, { className: "ymllayout-row gx-0", style: i, children: S(a, (l, s) => E(l, s, t)) });
1274
1429
  }
1275
- function ct({ yamlNode: e, panel: t }) {
1276
- const { type: n, style: i, xs: a, children: o, ...d } = e;
1277
- return U(e, d), pe(e, "xs", a), /* @__PURE__ */ r(
1278
- E,
1430
+ function wt({ yamlNode: e, panel: t }) {
1431
+ const { type: n, style: i, xs: a, children: o, ...l } = e;
1432
+ return W(e, l), Ne(e, "xs", a), /* @__PURE__ */ r(
1433
+ O,
1279
1434
  {
1280
- className: H("yamymllayout-col", { col: !!a }),
1435
+ className: Y("yamymllayout-col", { col: !!a }),
1281
1436
  style: i,
1282
1437
  xs: a,
1283
- children: C(e.children, (l, h) => O(l, h, t))
1438
+ children: S(e.children, (s, u) => E(s, u, t))
1284
1439
  }
1285
1440
  );
1286
1441
  }
1287
- const W = {};
1288
- function Zt(e, t) {
1289
- W[e] = t;
1442
+ const Q = {};
1443
+ function rn(e, t) {
1444
+ Q[e] = t;
1290
1445
  }
1291
- function dt(e, t) {
1446
+ function yt(e, t) {
1292
1447
  if (t === void 0)
1293
- throw new L(e, ["id"]);
1448
+ throw new B(e, ["id"]);
1294
1449
  if (typeof t.id != "string")
1295
- throw new g(e, "id", "A string is expected");
1450
+ throw new w(e, "id", "A string is expected");
1296
1451
  }
1297
- function ut(e, t, n) {
1452
+ function vt(e, t, n) {
1298
1453
  if (n !== void 0) {
1299
1454
  if (!Array.isArray(n))
1300
- throw new g(e, "ids", "A option list is expected");
1455
+ throw new w(e, t, "A option list is expected");
1301
1456
  n.forEach((i, a) => {
1302
1457
  try {
1303
- dt(e, i);
1458
+ yt(e, i);
1304
1459
  } catch {
1305
- throw new g(
1460
+ throw new w(
1306
1461
  e,
1307
- "ids",
1462
+ t,
1308
1463
  `The hardware description ${a} is wrong`
1309
1464
  );
1310
1465
  }
1311
1466
  });
1312
1467
  }
1313
1468
  }
1314
- function ht(e) {
1469
+ function Nt(e) {
1315
1470
  const {
1316
1471
  providers: t = {},
1317
1472
  yamlNode: n,
1318
1473
  ids: i,
1319
1474
  groupid: a,
1320
1475
  even: o,
1321
- nowrap: d,
1322
- ...l
1476
+ nowrap: l,
1477
+ ...s
1323
1478
  } = e;
1324
- if (ut(n, "ids", i), me(n, "groupid", a), G(n, "even", o), G(n, "nowrap", d), U(n, l), !W.HardwareGroup)
1325
- return /* @__PURE__ */ r(x, { variant: "warning", children: "No `HardwareGroup` component registered" });
1326
- const h = W.HardwareGroup;
1479
+ if (vt(n, "ids", i), ve(n, "groupid", a), J(n, "even", o), J(n, "nowrap", l), W(n, s), !Q.HardwareGroup)
1480
+ return /* @__PURE__ */ r(M, { variant: "warning", children: "No `HardwareGroup` component registered" });
1481
+ const u = Q.HardwareGroup;
1327
1482
  return /* @__PURE__ */ r(
1328
- h,
1483
+ u,
1329
1484
  {
1330
1485
  providers: t,
1331
1486
  ids: i,
1332
1487
  groupid: a,
1333
- nowrap: d || !1,
1488
+ nowrap: l || !1,
1334
1489
  even: o || !1
1335
1490
  }
1336
1491
  );
1337
1492
  }
1338
- const B = {
1339
- hardwaregroup: ht
1493
+ const X = {
1494
+ hardwaregroup: Nt
1340
1495
  };
1341
- function ft(e, t) {
1342
- B[e] = t;
1496
+ function bt(e, t) {
1497
+ X[e] = t;
1343
1498
  }
1344
- function Jt(e) {
1499
+ function an(e) {
1345
1500
  Object.entries(e).forEach(
1346
- ([t, n]) => ft(t, n)
1501
+ ([t, n]) => bt(t, n)
1347
1502
  );
1348
1503
  }
1349
- function mt(e) {
1350
- const { yamlNode: t, panel: n } = e, { type: i, style: a, scroll: o, title: d, ...l } = t;
1351
- if (!(i in B))
1352
- return /* @__PURE__ */ r(p, { children: /* @__PURE__ */ r(p.Contents, { children: /* @__PURE__ */ s(x, { variant: "warning", children: [
1504
+ function Ot(e) {
1505
+ const { yamlNode: t, panel: n } = e, { type: i, style: a, scroll: o, title: l, ...s } = t;
1506
+ if (!(i in X))
1507
+ return /* @__PURE__ */ r(g, { children: /* @__PURE__ */ r(g.Contents, { children: /* @__PURE__ */ c(M, { variant: "warning", children: [
1353
1508
  'Unknown component "',
1354
1509
  i,
1355
1510
  '"'
1356
1511
  ] }) }) });
1357
- const h = B[t.type];
1358
- return n ? /* @__PURE__ */ r(p, { style: a, scroll: o, children: /* @__PURE__ */ s(ne, { fallback: /* @__PURE__ */ r("p", { children: "Loading..." }), children: [
1359
- d && /* @__PURE__ */ r(p.Header, { children: d }),
1360
- /* @__PURE__ */ r(p.Contents, { children: /* @__PURE__ */ r(h, { ...l, yamlNode: t }) })
1361
- ] }) }) : /* @__PURE__ */ r(ne, { fallback: /* @__PURE__ */ r("p", { children: "Loading..." }), children: /* @__PURE__ */ r(h, { ...l, yamlNode: t }) });
1512
+ const u = X[t.type];
1513
+ return n ? /* @__PURE__ */ r(g, { style: a, scroll: o, children: /* @__PURE__ */ c(se, { fallback: /* @__PURE__ */ r("p", { children: "Loading..." }), children: [
1514
+ l && /* @__PURE__ */ r(g.Header, { children: l }),
1515
+ /* @__PURE__ */ r(g.Contents, { children: /* @__PURE__ */ r(u, { ...s, yamlNode: t }) })
1516
+ ] }) }) : /* @__PURE__ */ r(se, { fallback: /* @__PURE__ */ r("p", { children: "Loading..." }), children: /* @__PURE__ */ r(u, { ...s, yamlNode: t }) });
1362
1517
  }
1363
- function pt({ yamlNode: e, panel: t }) {
1518
+ function Ct({ yamlNode: e, panel: t }) {
1364
1519
  const n = e.options || {};
1365
- return /* @__PURE__ */ r($, { className: "ymllayout-container", ...n, children: C(e.children, (i, a) => O(i, a, t)) });
1520
+ return /* @__PURE__ */ r(L, { className: "ymllayout-container", ...n, children: S(e.children, (i, a) => E(i, a, t)) });
1366
1521
  }
1367
- function gt(e) {
1522
+ function St(e) {
1368
1523
  const { yamlNode: t } = e, n = t.options || {}, i = {};
1369
- return n.centerContent && (i.margin = "auto"), /* @__PURE__ */ s(p, { className: "ymllayout-panel", ...n, children: [
1370
- t.title && /* @__PURE__ */ r(p.Header, { children: t.title }),
1371
- /* @__PURE__ */ r(p.Contents, { style: i, children: C(
1524
+ return n.centerContent && (i.margin = "auto"), /* @__PURE__ */ c(g, { className: "ymllayout-panel", ...n, children: [
1525
+ t.title && /* @__PURE__ */ r(g.Header, { children: t.title }),
1526
+ /* @__PURE__ */ r(g.Contents, { style: i, children: S(
1372
1527
  t.children,
1373
- (a, o) => O(a, o, !1)
1528
+ (a, o) => E(a, o, !1)
1374
1529
  ) })
1375
1530
  ] });
1376
1531
  }
1377
- const wt = () => Math.random().toString(36).slice(2, 15) + Math.random().toString(36).slice(2, 15);
1378
- function yt({ yamlNode: e, panel: t }) {
1532
+ const Et = () => Math.random().toString(36).slice(2, 15) + Math.random().toString(36).slice(2, 15);
1533
+ function xt({ yamlNode: e, panel: t }) {
1379
1534
  const n = [];
1380
- return be(e.children, (i, a) => {
1535
+ return Ae(e.children, (i, a) => {
1381
1536
  n.push(
1382
- /* @__PURE__ */ r(Ne, { eventKey: wt(), title: i.title, children: O(i, 0, !1) }, a)
1537
+ /* @__PURE__ */ r(Me, { eventKey: Et(), title: i.title, children: E(i, 0, !1) }, a)
1383
1538
  );
1384
- }), t ? /* @__PURE__ */ s(p, { className: "ymllayout-tabs", children: [
1385
- e.title && /* @__PURE__ */ r(p.Header, { children: e.title }),
1386
- /* @__PURE__ */ r(p.Contents, { children: /* @__PURE__ */ r(te, { mountOnEnter: !0, children: n }) })
1387
- ] }) : /* @__PURE__ */ r(te, { children: n });
1539
+ }), t ? /* @__PURE__ */ c(g, { className: "ymllayout-tabs", children: [
1540
+ e.title && /* @__PURE__ */ r(g.Header, { children: e.title }),
1541
+ /* @__PURE__ */ r(g.Contents, { children: /* @__PURE__ */ r(oe, { mountOnEnter: !0, children: n }) })
1542
+ ] }) : /* @__PURE__ */ r(oe, { children: n });
1388
1543
  }
1389
- function vt(e) {
1544
+ function At(e) {
1390
1545
  const { node: t } = e, { type: n, title: i, ...a } = t;
1391
- return ue(t, a), /* @__PURE__ */ r("div", { style: { gridColumn: "1 / 3" }, children: /* @__PURE__ */ r("h3", { children: i }) });
1546
+ return ge(t, a), /* @__PURE__ */ r("div", { className: "ymllayout-form-header", style: { gridColumn: "1 / 3" }, children: /* @__PURE__ */ r("h3", { children: i }) });
1392
1547
  }
1393
- function bt(e) {
1548
+ function Mt(e) {
1394
1549
  const { node: t, state: n, row: i } = e, { title: a } = t;
1395
1550
  function o() {
1396
1551
  if (t.id)
1397
1552
  return t.id;
1398
1553
  }
1399
- function d() {
1554
+ function l() {
1400
1555
  if (a !== void 0)
1401
1556
  return a;
1402
1557
  if (t.type === "hardware") {
1403
- const h = o(), u = {
1558
+ const u = o(), h = {
1404
1559
  _parentNode: t._parentNode,
1405
1560
  _indexFromParent: t._indexFromParent,
1406
1561
  type: "hardware",
1407
- id: h,
1562
+ id: u,
1408
1563
  variant: "name",
1409
1564
  emptyifnone: !0
1410
1565
  };
1411
- return O(u, "a", !1);
1566
+ return E(h, "a", !1);
1412
1567
  }
1413
1568
  return "";
1414
1569
  }
1415
- const l = d();
1416
- return /* @__PURE__ */ s(
1570
+ const s = l();
1571
+ return /* @__PURE__ */ c(
1417
1572
  "div",
1418
1573
  {
1419
1574
  style: {
@@ -1427,7 +1582,7 @@ function bt(e) {
1427
1582
  margin: "0px",
1428
1583
  whiteSpace: "nowrap"
1429
1584
  },
1430
- children: l
1585
+ children: s
1431
1586
  }
1432
1587
  ),
1433
1588
  n && /* @__PURE__ */ r("div", { style: { position: "relative", top: -5 }, children: n })
@@ -1435,34 +1590,34 @@ function bt(e) {
1435
1590
  }
1436
1591
  );
1437
1592
  }
1438
- function Nt(e) {
1593
+ function Dt(e) {
1439
1594
  const { node: t, row: n } = e, {
1440
1595
  titlealign: i,
1441
1596
  title: a,
1442
1597
  stateinheader: o = !1,
1443
- variant: d,
1444
- id: l,
1445
- ...h
1598
+ variant: l,
1599
+ id: s,
1600
+ ...u
1446
1601
  } = t;
1447
- let u, c;
1448
- if (h.type === "hardware")
1449
- if (u = {
1450
- ...h,
1451
- id: l,
1452
- variant: d
1602
+ let h, f;
1603
+ if (u.type === "hardware")
1604
+ if (h = {
1605
+ ...u,
1606
+ id: s,
1607
+ variant: l
1453
1608
  }, o) {
1454
- const f = {
1455
- ...h,
1456
- id: l,
1609
+ const d = {
1610
+ ...u,
1611
+ id: s,
1457
1612
  variant: "state",
1458
1613
  emptyifnone: !0
1459
1614
  };
1460
- c = O(f, "k", !1);
1615
+ f = E(d, "k", !1);
1461
1616
  } else
1462
- c = null;
1617
+ f = null;
1463
1618
  else
1464
- u = h, c = null;
1465
- return /* @__PURE__ */ s(v, { children: [
1619
+ h = u, f = null;
1620
+ return /* @__PURE__ */ c(v, { children: [
1466
1621
  /* @__PURE__ */ r(
1467
1622
  "div",
1468
1623
  {
@@ -1470,38 +1625,38 @@ function Nt(e) {
1470
1625
  gridColumn: 1,
1471
1626
  alignSelf: i ?? "center"
1472
1627
  },
1473
- children: /* @__PURE__ */ r(bt, { node: t, state: c, row: n })
1628
+ children: /* @__PURE__ */ r(Mt, { node: t, state: f, row: n })
1474
1629
  }
1475
1630
  ),
1476
- /* @__PURE__ */ r("div", { style: { gridColumn: 2 }, children: O(u, "k", !1) })
1631
+ /* @__PURE__ */ r("div", { style: { gridColumn: 2, alignSelf: "center" }, children: E(h, "k", !1) })
1477
1632
  ] });
1478
1633
  }
1479
- function Ct(e) {
1480
- const { yamlNode: t, panel: n } = e, { type: i, children: a, options: o = {}, title: d, ...l } = t;
1481
- return ue(t, l), /* @__PURE__ */ s(p, { className: "ymllayout-form", ...o, children: [
1482
- t.title && /* @__PURE__ */ r(p.Header, { children: t.title }),
1483
- /* @__PURE__ */ r(p.Contents, { children: /* @__PURE__ */ r(
1634
+ function It(e) {
1635
+ const { yamlNode: t, panel: n } = e, { type: i, children: a, options: o = {}, title: l, ...s } = t;
1636
+ return ge(t, s), /* @__PURE__ */ c(g, { className: "ymllayout-form", ...o, children: [
1637
+ t.title && /* @__PURE__ */ r(g.Header, { children: t.title }),
1638
+ /* @__PURE__ */ r(g.Contents, { className: "full-sizer", style: { overflow: "auto" }, children: /* @__PURE__ */ r(
1484
1639
  "div",
1485
1640
  {
1486
1641
  style: {
1487
1642
  display: "grid",
1488
1643
  gridTemplateColumns: "min-content auto"
1489
1644
  },
1490
- children: C(a, (h, u) => h.type === "formheader" ? /* @__PURE__ */ r(
1491
- vt,
1645
+ children: S(a, (u, h) => u.type === "formheader" ? /* @__PURE__ */ r(
1646
+ At,
1492
1647
  {
1493
- node: h,
1494
- row: u
1648
+ node: u,
1649
+ row: h
1495
1650
  },
1496
- u
1497
- ) : /* @__PURE__ */ r(Nt, { node: h, row: u }, u))
1651
+ h
1652
+ ) : /* @__PURE__ */ r(Dt, { node: u, row: h }, h))
1498
1653
  }
1499
1654
  ) })
1500
1655
  ] });
1501
1656
  }
1502
- function Ot(e) {
1657
+ function kt(e) {
1503
1658
  const { yamlNode: t, panel: n } = e;
1504
- return /* @__PURE__ */ s(
1659
+ return /* @__PURE__ */ c(
1505
1660
  "div",
1506
1661
  {
1507
1662
  className: "ymllayout-grid",
@@ -1510,17 +1665,17 @@ function Ot(e) {
1510
1665
  gridTemplateRows: t.rows
1511
1666
  },
1512
1667
  children: [
1513
- C(t.children, (i, a) => {
1514
- const { columnSpan: o = 1, rowSpan: d = 1, ...l } = i, h = o > 1 ? `span ${o}` : void 0, u = d > 1 ? `span ${d}` : void 0;
1668
+ S(t.children, (i, a) => {
1669
+ const { columnSpan: o = 1, rowSpan: l = 1, ...s } = i, u = o > 1 ? `span ${o}` : void 0, h = l > 1 ? `span ${l}` : void 0;
1515
1670
  return /* @__PURE__ */ r(
1516
1671
  "div",
1517
1672
  {
1518
1673
  className: "ymllayout-grid-cell",
1519
1674
  style: {
1520
- gridColumn: h,
1521
- gridRow: u
1675
+ gridColumn: u,
1676
+ gridRow: h
1522
1677
  },
1523
- children: O(l, a, n)
1678
+ children: E(s, a, n)
1524
1679
  },
1525
1680
  a
1526
1681
  );
@@ -1530,57 +1685,71 @@ function Ot(e) {
1530
1685
  }
1531
1686
  );
1532
1687
  }
1533
- function St({ yamlNode: e, panel: t }) {
1688
+ function $t({ yamlNode: e, panel: t }) {
1534
1689
  const n = e.options || {};
1535
- return /* @__PURE__ */ r(Ge, { panel: t, options: n, children: /* @__PURE__ */ r("div", { children: e.label }) });
1536
- }
1537
- const Et = {
1538
- row: lt,
1539
- col: ct,
1540
- container: pt,
1541
- component: mt,
1542
- panel: gt,
1543
- tabs: yt,
1544
- form: Ct,
1545
- grid: Ot,
1546
- label: St
1690
+ return /* @__PURE__ */ r(tt, { panel: t, options: n, children: /* @__PURE__ */ r("div", { children: e.label }) });
1691
+ }
1692
+ const Ft = {
1693
+ row: gt,
1694
+ col: wt,
1695
+ container: Ct,
1696
+ component: Ot,
1697
+ panel: St,
1698
+ tabs: xt,
1699
+ form: It,
1700
+ grid: kt,
1701
+ label: $t
1547
1702
  };
1548
- Object.entries(Et).forEach(([e, t]) => {
1549
- qe(e, t);
1703
+ Object.entries(Ft).forEach(([e, t]) => {
1704
+ et(e, t);
1550
1705
  });
1551
- function Qt(e) {
1706
+ function on(e) {
1552
1707
  var n;
1553
- const t = Me(() => he(e.layout), [e.layout]);
1554
- return t.error ? /* @__PURE__ */ r("div", { className: `${e.className ?? ""} ymllayout-main`, id: e.id, children: /* @__PURE__ */ s(p, { children: [
1555
- /* @__PURE__ */ r(p.Header, { children: "Layout Error" }),
1556
- /* @__PURE__ */ s(p.Contents, { children: [
1557
- /* @__PURE__ */ s("p", { children: [
1558
- "File: ",
1559
- t.name
1560
- ] }),
1561
- /* @__PURE__ */ r(x, { variant: "warning", children: /* @__PURE__ */ r("pre", { className: "mb-0", children: t.error }) })
1562
- ] })
1563
- ] }) }) : /* @__PURE__ */ r("div", { className: `${e.className ?? ""} ymllayout-main`, id: e.id, children: /* @__PURE__ */ r(
1564
- Je,
1708
+ const t = te(() => we(e.layout), [e.layout]);
1709
+ return t.error ? /* @__PURE__ */ r(
1710
+ "div",
1565
1711
  {
1566
- resetKey: t,
1567
- unhandledComponentDidCatch: e.unhandledComponentDidCatch,
1568
- UnhandledErrorComponent: e.UnhandledErrorComponent,
1569
- children: (n = t.children) == null ? void 0 : n.map((i, a) => O(i, a))
1712
+ className: `${e.className ?? ""} ymllayout-main`,
1713
+ "data-testid": e.testid,
1714
+ children: /* @__PURE__ */ c(g, { children: [
1715
+ /* @__PURE__ */ r(g.Header, { children: "Layout Error" }),
1716
+ /* @__PURE__ */ c(g.Contents, { children: [
1717
+ /* @__PURE__ */ c("p", { children: [
1718
+ "File: ",
1719
+ t.name
1720
+ ] }),
1721
+ /* @__PURE__ */ r(M, { variant: "warning", children: /* @__PURE__ */ r("pre", { className: "mb-0", children: t.error }) })
1722
+ ] })
1723
+ ] })
1570
1724
  }
1571
- ) });
1725
+ ) : /* @__PURE__ */ r(
1726
+ "div",
1727
+ {
1728
+ className: `${e.className ?? ""} ymllayout-main`,
1729
+ "data-testid": e.testid,
1730
+ children: /* @__PURE__ */ r(
1731
+ at,
1732
+ {
1733
+ resetKey: t,
1734
+ unhandledComponentDidCatch: e.unhandledComponentDidCatch,
1735
+ UnhandledErrorComponent: e.UnhandledErrorComponent,
1736
+ children: (n = t.children) == null ? void 0 : n.map((i, a) => E(i, a))
1737
+ }
1738
+ )
1739
+ }
1740
+ );
1572
1741
  }
1573
- const Xt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1742
+ const sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1574
1743
  __proto__: null
1575
- }, Symbol.toStringTag, { value: "Module" })), ge = {
1576
- hardware: It
1744
+ }, Symbol.toStringTag, { value: "Module" })), be = {
1745
+ hardware: Ht
1577
1746
  };
1578
- function en(e, t) {
1579
- ge[e] = t;
1747
+ function ln(e, t) {
1748
+ be[e] = t;
1580
1749
  }
1581
- function xt(e) {
1582
- return /* @__PURE__ */ s(
1583
- E,
1750
+ function Rt(e) {
1751
+ return /* @__PURE__ */ c(
1752
+ O,
1584
1753
  {
1585
1754
  className: "monitor-panel-item bg-fatal",
1586
1755
  title: `Error from yaml configuration: ${e.message}`,
@@ -1591,11 +1760,11 @@ function xt(e) {
1591
1760
  }
1592
1761
  );
1593
1762
  }
1594
- function tn(e) {
1595
- const t = C(e.monitors, (n, i) => {
1596
- const a = n.type ?? "hardware", o = ge[a];
1763
+ function cn(e) {
1764
+ const t = S(e.monitors, (n, i) => {
1765
+ const a = n.type ?? "hardware", o = be[a];
1597
1766
  return o === void 0 ? /* @__PURE__ */ r(
1598
- xt,
1767
+ Rt,
1599
1768
  {
1600
1769
  monitor: n,
1601
1770
  message: `Type ${a} unsupported`
@@ -1606,29 +1775,29 @@ function tn(e) {
1606
1775
  return /* @__PURE__ */ r(
1607
1776
  "div",
1608
1777
  {
1609
- className: H(
1778
+ className: Y(
1610
1779
  { "ms-auto": e.margin === "start" },
1611
1780
  "me-auto",
1612
1781
  "monitor-panel",
1613
1782
  { "monitor-panel-light": e.bg === "light" }
1614
1783
  ),
1615
- children: /* @__PURE__ */ r($, { fluid: !0, children: /* @__PURE__ */ r(P, { className: "flex-nowrap", children: t }) })
1784
+ children: /* @__PURE__ */ r(L, { fluid: !0, children: /* @__PURE__ */ r(V, { className: "flex-nowrap", children: t }) })
1616
1785
  }
1617
1786
  );
1618
1787
  }
1619
- function Mt(e) {
1620
- return /* @__PURE__ */ r(E, { className: "monitor-panel-item", children: e.children });
1788
+ function dn(e) {
1789
+ return /* @__PURE__ */ r(O, { className: "monitor-panel-item", children: e.children });
1621
1790
  }
1622
- const Z = {};
1623
- function nn(e, t) {
1624
- Z[e] = t;
1791
+ const ee = {};
1792
+ function un(e, t) {
1793
+ ee[e] = t;
1625
1794
  }
1626
- function we(e) {
1627
- if (!Z.useHardware)
1795
+ function Oe(e) {
1796
+ if (!ee.useHardware)
1628
1797
  throw new Error("No `useHardware` hook registered");
1629
- return Z.useHardware(e);
1798
+ return ee.useHardware(e);
1630
1799
  }
1631
- const At = (e, t, n) => {
1800
+ const Tt = (e, t, n) => {
1632
1801
  const i = {
1633
1802
  ">": (a, o) => a > o,
1634
1803
  "<": (a, o) => a < o,
@@ -1641,87 +1810,88 @@ const At = (e, t, n) => {
1641
1810
  if (e in i)
1642
1811
  return i[e](t, n);
1643
1812
  };
1644
- function ye(e, t, n) {
1813
+ function Ce(e, t, n) {
1645
1814
  const i = e.split(t);
1646
1815
  return n ? [i.slice(0, -n).join(t)].concat(i.slice(-n)) : i;
1647
1816
  }
1648
- function ae(e) {
1649
- const t = e !== void 0 ? ye(e, ".", 1) : [null, ""], n = we(t[0]);
1817
+ function de(e) {
1818
+ const t = e !== void 0 ? Ce(e, ".", 1) : [null, ""], n = Oe(t[0]);
1650
1819
  if (n && n.properties && t[1] !== null)
1651
1820
  return Array.isArray(n.properties[t[1]]) ? n.properties[t[1]][0] : n.properties[t[1]];
1652
1821
  }
1653
- function kt(e) {
1654
- const t = e !== void 0 && !e.includes("."), n = e !== void 0 ? ye(e, ".", 1) : [null, ""], i = we(n[0]);
1822
+ function _t(e) {
1823
+ const t = e !== void 0 && !e.includes("."), n = e !== void 0 ? Ce(e, ".", 1) : [null, ""], i = Oe(n[0]);
1655
1824
  if (t)
1656
1825
  return e;
1657
1826
  if (i && i.properties && n[1] !== null)
1658
1827
  return `${i.properties[n[1]]}`;
1659
1828
  }
1660
- function It(e) {
1829
+ function Ht(e) {
1661
1830
  const { monitor: t } = e;
1662
- let n = ae(t.value) ?? "-";
1663
- const i = kt(t.unit), a = ae(t.overlay), o = Number.parseFloat(`${n}`);
1831
+ let n = de(t.value) ?? "-";
1832
+ const i = _t(t.unit), a = de(t.overlay), o = Number.parseFloat(`${n}`);
1664
1833
  Number.isNaN(o) || String(o).length > 5 && (n = o.toPrecision(5));
1665
- let d;
1666
- t.comparator && t.comparison && (d = At(t.comparator, n, t.comparison) ? "valid" : "invalid"), Number.isNaN(o) || i !== void 0 && (n = `${n} ${i}`);
1667
- let l = q;
1668
- const h = {};
1669
- if (a) {
1670
- const u = `${a}`;
1671
- let c = q;
1672
- u.includes(`
1673
- `) && (c = "pre"), l = R, h.placement = "bottom", h.overlay = /* @__PURE__ */ r(Ce, {
1674
- id: "tooltipid",
1675
- className: "monitor-panel-tooltip",
1676
- // @ts-expect-error
1677
- children: /* @__PURE__ */ r(c, { children: u })
1678
- });
1834
+ let l;
1835
+ if (t.comparator && t.comparison && (l = Tt(t.comparator, n, t.comparison) ? "valid" : "invalid"), Number.isNaN(o) || i !== void 0 && (n = `${n} ${i}`), a) {
1836
+ const s = `${a}`;
1837
+ return /* @__PURE__ */ r(
1838
+ R,
1839
+ {
1840
+ placement: "bottom",
1841
+ overlay: /* @__PURE__ */ r(he, { id: "tooltipid", className: "monitor-panel-tooltip", children: s.includes(`
1842
+ `) ? /* @__PURE__ */ r("pre", { children: s }) : s }),
1843
+ children: /* @__PURE__ */ c(O, { className: "monitor-panel-item", children: [
1844
+ /* @__PURE__ */ r("h1", { children: t.name }),
1845
+ /* @__PURE__ */ r("div", { className: l, children: `${n}` })
1846
+ ] })
1847
+ },
1848
+ t.name
1849
+ );
1679
1850
  }
1680
- return (
1681
- // @ts-expect-error
1682
- /* @__PURE__ */ Ae(l, { ...h, key: t.name }, /* @__PURE__ */ s(Mt, { children: [
1683
- /* @__PURE__ */ r("h1", { children: t.name }),
1684
- /* @__PURE__ */ r("div", { className: d, children: `${n}` })
1685
- ] }))
1686
- );
1851
+ return /* @__PURE__ */ c(O, { className: "monitor-panel-item", children: [
1852
+ /* @__PURE__ */ r("h1", { children: t.name }),
1853
+ /* @__PURE__ */ r("div", { className: l, children: `${n}` })
1854
+ ] }, t.name);
1687
1855
  }
1688
1856
  export {
1689
- _t as Formatting,
1690
- Pt as Frontend,
1691
- Ue as FullSizer,
1692
- Xt as HWObject,
1693
- re as HardwareInputNumber,
1694
- Pe as HardwareNumericStep,
1695
- Wt as HardwareSchema,
1696
- Lt as HardwareState,
1697
- Y as HardwareTemplate,
1698
- Gt as HardwareTypes,
1699
- qt as HardwareVariant,
1700
- Vt as Info,
1701
- g as KeyError,
1702
- L as MissingKeysError,
1703
- It as MonitorHardware,
1704
- tn as MonitorPanel,
1705
- Mt as MonitorPanelItem,
1706
- jt as MotorDefault,
1707
- Yt as Multiposition,
1708
- Ut as NoObject,
1709
- _e as NumericStep,
1710
- p as Panel,
1711
- Kt as Property,
1712
- zt as ShutterDefault,
1713
- D as TypeIcon,
1714
- Je as YAMLErrorBoundary,
1715
- Qt as YAMLLayout,
1716
- Bt as YamlAsserts,
1717
- At as dynamicOp,
1718
- Zt as registerHardwareComponent,
1719
- en as registerMonitorComponent,
1720
- nn as registerRuntimeHook,
1721
- ft as registerYamlComponent,
1722
- Jt as registerYamlComponents,
1723
- qe as registerYamlType,
1724
- O as renderYamlNode,
1725
- Et as yamlMap
1857
+ Ut as Formatting,
1858
+ zt as Frontend,
1859
+ Je as FullSizer,
1860
+ sn as HWObject,
1861
+ le as HardwareInputNumber,
1862
+ Ue as HardwareNumericStep,
1863
+ tn as HardwareSchema,
1864
+ Gt as HardwareState,
1865
+ G as HardwareTemplate,
1866
+ en as HardwareTypes,
1867
+ Qt as HardwareVariant,
1868
+ Bt as Info,
1869
+ w as KeyError,
1870
+ B as MissingKeysError,
1871
+ Ht as MonitorHardware,
1872
+ cn as MonitorPanel,
1873
+ dn as MonitorPanelItem,
1874
+ Wt as MotorDefault,
1875
+ Ye as MotorState,
1876
+ qt as Multiposition,
1877
+ Xt as NoObject,
1878
+ Ke as NumericStep,
1879
+ g as Panel,
1880
+ Zt as Property,
1881
+ Jt as ShutterDefault,
1882
+ We as ShutterState,
1883
+ T as TypeIcon,
1884
+ at as YAMLErrorBoundary,
1885
+ on as YAMLLayout,
1886
+ nn as YamlAsserts,
1887
+ Tt as dynamicOp,
1888
+ rn as registerHardwareComponent,
1889
+ ln as registerMonitorComponent,
1890
+ un as registerRuntimeHook,
1891
+ bt as registerYamlComponent,
1892
+ an as registerYamlComponents,
1893
+ et as registerYamlType,
1894
+ E as renderYamlNode,
1895
+ Ft as yamlMap
1726
1896
  };
1727
1897
  //# sourceMappingURL=index.mjs.map