@glasshome/widget-sdk 0.2.1 → 0.2.3
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/framework/hooks/index.d.ts +1 -1
- package/dist/framework/hooks/use-widget-context.d.ts +28 -0
- package/dist/framework/index.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +440 -415
- package/dist/schemas.d.ts +92 -0
- package/dist/schemas.js +63 -0
- package/dist/types.d.ts +5 -1
- package/dist/vite/index.js +113 -83
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { createSignal as
|
|
2
|
-
import {
|
|
1
|
+
import { createSignal as j, createContext as wt, useContext as ht, createEffect as F, untrack as ut, createMemo as z, splitProps as $t, Show as K } from "solid-js";
|
|
2
|
+
import { GridSizeSchema as tr, PublishBodySchema as er, PublishConfirmSchema as nr, PublishRequestSchema as rr, WidgetManifestSchema as ir, formatSchemaError as ar, parseGridSize as sr, serializeGridSize as or } from "./schemas.js";
|
|
3
|
+
import { memo as D, effect as C, setStyleProperty as p, className as w, template as x, insert as f, style as tt, createComponent as W, use as kt, delegateEvents as pt } from "solid-js/web";
|
|
3
4
|
import { clsx as St } from "clsx";
|
|
4
5
|
import { twMerge as Ct } from "tailwind-merge";
|
|
5
6
|
import { createElementSize as Mt } from "@solid-primitives/resize-observer";
|
|
6
7
|
import { createForm as zt, zodForm as Dt, reset as _t, setValue as At, getValue as Nt } from "@modular-forms/solid";
|
|
7
8
|
function xn(t) {
|
|
8
|
-
const [e] =
|
|
9
|
+
const [e] = j(t);
|
|
9
10
|
return e;
|
|
10
11
|
}
|
|
11
12
|
function vn(t) {
|
|
12
13
|
return t;
|
|
13
14
|
}
|
|
14
|
-
const
|
|
15
|
+
const L = {
|
|
15
16
|
/** Background layer (gradients, images, glows) */
|
|
16
17
|
BACKGROUND: 0,
|
|
17
18
|
/** Main content layer (icon, title, text) */
|
|
@@ -20,14 +21,17 @@ const j = {
|
|
|
20
21
|
OVERLAY: 20,
|
|
21
22
|
/** Action layer (buttons, edit controls) */
|
|
22
23
|
ACTIONS: 30
|
|
23
|
-
}
|
|
24
|
-
function
|
|
25
|
-
|
|
24
|
+
};
|
|
25
|
+
function bn(t) {
|
|
26
|
+
}
|
|
27
|
+
const st = wt();
|
|
28
|
+
function G() {
|
|
29
|
+
const t = ht(st);
|
|
26
30
|
if (!t)
|
|
27
31
|
throw new Error("useWidgetContext must be used within a Widget component");
|
|
28
32
|
return t;
|
|
29
33
|
}
|
|
30
|
-
function
|
|
34
|
+
function y(...t) {
|
|
31
35
|
return Ct(St(t));
|
|
32
36
|
}
|
|
33
37
|
const Tt = {
|
|
@@ -115,21 +119,21 @@ const Tt = {
|
|
|
115
119
|
hoverScale: 1.02,
|
|
116
120
|
activeScale: 0.98
|
|
117
121
|
}
|
|
118
|
-
},
|
|
122
|
+
}, ot = {
|
|
119
123
|
"classic-glass": Tt,
|
|
120
124
|
minimal: Et,
|
|
121
125
|
"compact-horizontal": Ot
|
|
122
126
|
};
|
|
123
127
|
function Vt(t) {
|
|
124
|
-
return
|
|
128
|
+
return ot[t];
|
|
125
129
|
}
|
|
126
|
-
function
|
|
127
|
-
return t in
|
|
130
|
+
function yn(t) {
|
|
131
|
+
return t in ot;
|
|
128
132
|
}
|
|
129
|
-
function
|
|
130
|
-
return Object.keys(
|
|
133
|
+
function wn() {
|
|
134
|
+
return Object.keys(ot);
|
|
131
135
|
}
|
|
132
|
-
function
|
|
136
|
+
function xt(t, e) {
|
|
133
137
|
if (typeof t != "object" || t === null)
|
|
134
138
|
return e;
|
|
135
139
|
const n = { ...t };
|
|
@@ -141,7 +145,7 @@ function ft(t, e) {
|
|
|
141
145
|
continue;
|
|
142
146
|
}
|
|
143
147
|
if (typeof r == "object" && r !== null && !Array.isArray(r)) {
|
|
144
|
-
typeof a == "object" && a !== null ? n[i] =
|
|
148
|
+
typeof a == "object" && a !== null ? n[i] = xt(a, r) : n[i] = r;
|
|
145
149
|
continue;
|
|
146
150
|
}
|
|
147
151
|
n[i] = r;
|
|
@@ -164,7 +168,7 @@ function Rt(t, e) {
|
|
|
164
168
|
if (!(!t && !e))
|
|
165
169
|
return t ? e ? {
|
|
166
170
|
visible: { ...t.visible, ...e.visible },
|
|
167
|
-
styles:
|
|
171
|
+
styles: xt(t.styles ?? {}, e.styles ?? {}),
|
|
168
172
|
classNames: { ...t.classNames, ...e.classNames }
|
|
169
173
|
} : t : e;
|
|
170
174
|
}
|
|
@@ -176,7 +180,7 @@ function Gt(t, e) {
|
|
|
176
180
|
decorations: e.decorations ?? t.decorations
|
|
177
181
|
} : t : e;
|
|
178
182
|
}
|
|
179
|
-
function
|
|
183
|
+
function Bt(t, e) {
|
|
180
184
|
if (!(!t && !e))
|
|
181
185
|
return t ? e ? {
|
|
182
186
|
hover: e.hover ?? t.hover,
|
|
@@ -186,7 +190,7 @@ function Ht(t, e) {
|
|
|
186
190
|
activeScale: e.activeScale ?? t.activeScale
|
|
187
191
|
} : t : e;
|
|
188
192
|
}
|
|
189
|
-
function
|
|
193
|
+
function lt(t, e) {
|
|
190
194
|
return {
|
|
191
195
|
id: e.id ?? t.id,
|
|
192
196
|
name: e.name ?? t.name,
|
|
@@ -195,30 +199,30 @@ function st(t, e) {
|
|
|
195
199
|
layout: It(t.layout, e.layout),
|
|
196
200
|
elements: Rt(t.elements, e.elements),
|
|
197
201
|
plugins: Gt(t.plugins, e.plugins),
|
|
198
|
-
interactions:
|
|
202
|
+
interactions: Bt(t.interactions, e.interactions),
|
|
199
203
|
extends: e.extends ?? t.extends
|
|
200
204
|
};
|
|
201
205
|
}
|
|
202
|
-
function
|
|
206
|
+
function $n(t, e) {
|
|
203
207
|
return {
|
|
204
208
|
...e,
|
|
205
209
|
extends: t
|
|
206
210
|
};
|
|
207
211
|
}
|
|
208
|
-
function
|
|
212
|
+
function kn(...t) {
|
|
209
213
|
if (t.length === 0)
|
|
210
214
|
throw new Error("composeVariants requires at least one variant");
|
|
211
|
-
return t.length === 1 ? t[0] : t.reduce((e, n) =>
|
|
212
|
-
}
|
|
213
|
-
function kn(t, e) {
|
|
214
|
-
return st(t, { layout: e });
|
|
215
|
+
return t.length === 1 ? t[0] : t.reduce((e, n) => lt(e, n));
|
|
215
216
|
}
|
|
216
217
|
function pn(t, e) {
|
|
217
|
-
return
|
|
218
|
+
return lt(t, { layout: e });
|
|
219
|
+
}
|
|
220
|
+
function Sn(t, e) {
|
|
221
|
+
return lt(t, {
|
|
218
222
|
styles: { cssVars: e }
|
|
219
223
|
});
|
|
220
224
|
}
|
|
221
|
-
function
|
|
225
|
+
function Cn(t = "column", e = "start", n = "start", i) {
|
|
222
226
|
return {
|
|
223
227
|
type: "flex",
|
|
224
228
|
direction: t,
|
|
@@ -227,23 +231,23 @@ function Sn(t = "column", e = "start", n = "start", i) {
|
|
|
227
231
|
...i
|
|
228
232
|
};
|
|
229
233
|
}
|
|
230
|
-
var
|
|
231
|
-
function
|
|
232
|
-
const e =
|
|
234
|
+
var Ht = /* @__PURE__ */ x("<div>"), Lt = /* @__PURE__ */ x('<div class="pointer-events-none absolute inset-0 opacity-40 blur-2xl">');
|
|
235
|
+
function Pt(t) {
|
|
236
|
+
const e = G(), n = () => e.orientation() === "vertical" ? `inset(${100 - t.value}% 0 0 0)` : `inset(0 ${100 - t.value}% 0 0)`, i = () => t.color ?? "rgb(59, 130, 246)";
|
|
233
237
|
return [D(() => D(() => !!((t.glow ?? !1) && t.value > 0))() && (() => {
|
|
234
238
|
var r = Lt();
|
|
235
239
|
return C((a) => {
|
|
236
|
-
var s = i(),
|
|
237
|
-
return s !== a.e && p(r, "background", a.e = s),
|
|
240
|
+
var s = i(), l = L.BACKGROUND;
|
|
241
|
+
return s !== a.e && p(r, "background", a.e = s), l !== a.t && p(r, "z-index", a.t = l), a;
|
|
238
242
|
}, {
|
|
239
243
|
e: void 0,
|
|
240
244
|
t: void 0
|
|
241
245
|
}), r;
|
|
242
246
|
})()), (() => {
|
|
243
|
-
var r =
|
|
247
|
+
var r = Ht();
|
|
244
248
|
return C((a) => {
|
|
245
|
-
var s =
|
|
246
|
-
return s !== a.e &&
|
|
249
|
+
var s = y("pointer-events-none absolute inset-0", t.isDragging ? "duration-0" : "transition-all duration-300 ease-out", t.class), l = i(), c = n(), g = t.opacity ?? 0.3, d = L.BACKGROUND;
|
|
250
|
+
return s !== a.e && w(r, a.e = s), l !== a.t && p(r, "background", a.t = l), c !== a.a && p(r, "clip-path", a.a = c), g !== a.o && p(r, "opacity", a.o = g), d !== a.i && p(r, "z-index", a.i = d), a;
|
|
247
251
|
}, {
|
|
248
252
|
e: void 0,
|
|
249
253
|
t: void 0,
|
|
@@ -253,20 +257,20 @@ function jt(t) {
|
|
|
253
257
|
}), r;
|
|
254
258
|
})()];
|
|
255
259
|
}
|
|
256
|
-
const
|
|
260
|
+
const q = {
|
|
257
261
|
S1: { xs: 4, sm: 4, md: 6, lg: 6, xl: 8 },
|
|
258
262
|
S2: { xs: 6, sm: 8, md: 10, lg: 12, xl: 14 },
|
|
259
263
|
S3: { xs: 8, sm: 10, md: 12, lg: 14, xl: 16 },
|
|
260
264
|
S4: { xs: 12, sm: 14, md: 16, lg: 18, xl: 20 }
|
|
261
265
|
}, N = {
|
|
262
266
|
/** Extra small spacing (4-8px) */
|
|
263
|
-
S1: (t) => `${
|
|
267
|
+
S1: (t) => `${q.S1[t]}px`,
|
|
264
268
|
/** Small spacing (6-14px) - default for most layouts */
|
|
265
|
-
S2: (t) => `${
|
|
269
|
+
S2: (t) => `${q.S2[t]}px`,
|
|
266
270
|
/** Medium spacing (8-16px) */
|
|
267
|
-
S3: (t) => `${
|
|
271
|
+
S3: (t) => `${q.S3[t]}px`,
|
|
268
272
|
/** Large spacing (12-20px) */
|
|
269
|
-
S4: (t) => `${
|
|
273
|
+
S4: (t) => `${q.S4[t]}px`,
|
|
270
274
|
/** Icon container size in pixels */
|
|
271
275
|
icon: (t) => ({
|
|
272
276
|
xs: 32,
|
|
@@ -317,7 +321,7 @@ const K = {
|
|
|
317
321
|
// More padding for larger widgets
|
|
318
322
|
xl: "20px"
|
|
319
323
|
})[t]
|
|
320
|
-
},
|
|
324
|
+
}, jt = {
|
|
321
325
|
4: "gap-1",
|
|
322
326
|
6: "gap-1.5",
|
|
323
327
|
8: "gap-2",
|
|
@@ -329,24 +333,24 @@ const K = {
|
|
|
329
333
|
20: "gap-5"
|
|
330
334
|
};
|
|
331
335
|
function Ut(t, e) {
|
|
332
|
-
const n =
|
|
333
|
-
return
|
|
336
|
+
const n = q[t][e];
|
|
337
|
+
return jt[n] || `gap-[${n}px]`;
|
|
334
338
|
}
|
|
335
|
-
var Ft = /* @__PURE__ */
|
|
339
|
+
var Ft = /* @__PURE__ */ x("<div>");
|
|
336
340
|
function Yt(t) {
|
|
337
|
-
const e =
|
|
341
|
+
const e = G();
|
|
338
342
|
return (() => {
|
|
339
343
|
var n = Ft();
|
|
340
344
|
return f(n, () => t.children), C((i) => {
|
|
341
|
-
var r =
|
|
345
|
+
var r = y(
|
|
342
346
|
"relative flex h-full w-full overflow-hidden",
|
|
343
347
|
// Ensure controls (ml-auto divs) are above other content
|
|
344
348
|
"[&_div.ml-auto]:relative [&_div.ml-auto]:z-30",
|
|
345
349
|
e.contentLayout() === "horizontal" ? "flex-row items-center" : "flex-col justify-between",
|
|
346
350
|
Ut("S3", e.size()),
|
|
347
351
|
t.class
|
|
348
|
-
), a = N.container(e.size()), s =
|
|
349
|
-
return r !== i.e &&
|
|
352
|
+
), a = N.container(e.size()), s = L.CONTENT;
|
|
353
|
+
return r !== i.e && w(n, i.e = r), a !== i.t && p(n, "padding", i.t = a), s !== i.a && p(n, "z-index", i.a = s), i;
|
|
350
354
|
}, {
|
|
351
355
|
e: void 0,
|
|
352
356
|
t: void 0,
|
|
@@ -354,7 +358,7 @@ function Yt(t) {
|
|
|
354
358
|
}), n;
|
|
355
359
|
})();
|
|
356
360
|
}
|
|
357
|
-
const
|
|
361
|
+
const H = {
|
|
358
362
|
/** Container base text sizing */
|
|
359
363
|
container: (t) => ({
|
|
360
364
|
xs: "text-xs",
|
|
@@ -468,18 +472,18 @@ const B = {
|
|
|
468
472
|
// 16px
|
|
469
473
|
})[t]
|
|
470
474
|
};
|
|
471
|
-
var Xt = /* @__PURE__ */
|
|
475
|
+
var Xt = /* @__PURE__ */ x("<div><div>"), Kt = /* @__PURE__ */ x("<div>"), qt = /* @__PURE__ */ x("<h3>"), Zt = /* @__PURE__ */ x("<p>"), Qt = /* @__PURE__ */ x("<div class=mt-2>");
|
|
472
476
|
function Jt(t) {
|
|
473
|
-
const e =
|
|
477
|
+
const e = G(), n = () => e.contentLayout() === "horizontal";
|
|
474
478
|
return (() => {
|
|
475
479
|
var i = Xt(), r = i.firstChild;
|
|
476
480
|
return f(i, (() => {
|
|
477
481
|
var a = D(() => !!t.icon);
|
|
478
482
|
return () => a() && (() => {
|
|
479
483
|
var s = Kt();
|
|
480
|
-
return f(s, () => t.icon), C((
|
|
481
|
-
var c =
|
|
482
|
-
return c !==
|
|
484
|
+
return f(s, () => t.icon), C((l) => {
|
|
485
|
+
var c = y("flex items-center justify-center text-white/30", n() ? "shrink-0" : ""), g = `${N.icon(e.size())}px`, d = `${N.icon(e.size())}px`;
|
|
486
|
+
return c !== l.e && w(s, l.e = c), g !== l.t && p(s, "width", l.t = g), d !== l.a && p(s, "height", l.a = d), l;
|
|
483
487
|
}, {
|
|
484
488
|
e: void 0,
|
|
485
489
|
t: void 0,
|
|
@@ -490,9 +494,9 @@ function Jt(t) {
|
|
|
490
494
|
var a = D(() => !!(t.title ?? "No data"));
|
|
491
495
|
return () => a() && (() => {
|
|
492
496
|
var s = qt();
|
|
493
|
-
return f(s, () => t.title ?? "No data"), C((
|
|
494
|
-
var c =
|
|
495
|
-
return c !==
|
|
497
|
+
return f(s, () => t.title ?? "No data"), C((l) => {
|
|
498
|
+
var c = y("font-semibold text-white/60", H.subtitle(e.size())), g = n() ? "100%" : "80%";
|
|
499
|
+
return c !== l.e && w(s, l.e = c), g !== l.t && p(s, "max-width", l.t = g), l;
|
|
496
500
|
}, {
|
|
497
501
|
e: void 0,
|
|
498
502
|
t: void 0
|
|
@@ -502,9 +506,9 @@ function Jt(t) {
|
|
|
502
506
|
var a = D(() => !!t.message);
|
|
503
507
|
return () => a() && (() => {
|
|
504
508
|
var s = Zt();
|
|
505
|
-
return f(s, () => t.message), C((
|
|
506
|
-
var c =
|
|
507
|
-
return c !==
|
|
509
|
+
return f(s, () => t.message), C((l) => {
|
|
510
|
+
var c = y("text-white/50", H.emptyState(e.size())), g = n() ? "100%" : "85%";
|
|
511
|
+
return c !== l.e && w(s, l.e = c), g !== l.t && p(s, "max-width", l.t = g), l;
|
|
508
512
|
}, {
|
|
509
513
|
e: void 0,
|
|
510
514
|
t: void 0
|
|
@@ -517,8 +521,8 @@ function Jt(t) {
|
|
|
517
521
|
return f(s, () => t.action), s;
|
|
518
522
|
})();
|
|
519
523
|
})(), null), C((a) => {
|
|
520
|
-
var s =
|
|
521
|
-
return s !== a.e &&
|
|
524
|
+
var s = y("flex h-full w-full", n() ? "flex-row items-center justify-start" : "flex-col items-center justify-center text-center", t.class), l = N.S2(e.size()), c = N.container(e.size()), g = y("flex flex-col", n() ? "items-start text-left" : "items-center text-center"), d = N.S1(e.size());
|
|
525
|
+
return s !== a.e && w(i, a.e = s), l !== a.t && p(i, "gap", a.t = l), c !== a.a && p(i, "padding", a.a = c), g !== a.o && w(r, a.o = g), d !== a.i && p(r, "gap", a.i = d), a;
|
|
522
526
|
}, {
|
|
523
527
|
e: void 0,
|
|
524
528
|
t: void 0,
|
|
@@ -534,7 +538,7 @@ function te(t) {
|
|
|
534
538
|
}
|
|
535
539
|
function ee(t) {
|
|
536
540
|
const e = t.match(/rgb\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)/);
|
|
537
|
-
return e ?
|
|
541
|
+
return e ? vt(Number(e[1]), Number(e[2]), Number(e[3])) : null;
|
|
538
542
|
}
|
|
539
543
|
function ne(t) {
|
|
540
544
|
const e = t.match(/^#([0-9a-f]{3,8})$/i);
|
|
@@ -542,20 +546,20 @@ function ne(t) {
|
|
|
542
546
|
let n = e[1];
|
|
543
547
|
n.length === 3 && (n = n[0] + n[0] + n[1] + n[1] + n[2] + n[2]);
|
|
544
548
|
const i = Number.parseInt(n.slice(0, 2), 16), r = Number.parseInt(n.slice(2, 4), 16), a = Number.parseInt(n.slice(4, 6), 16);
|
|
545
|
-
return
|
|
549
|
+
return vt(i, r, a);
|
|
546
550
|
}
|
|
547
|
-
function
|
|
551
|
+
function vt(t, e, n) {
|
|
548
552
|
t /= 255, e /= 255, n /= 255;
|
|
549
553
|
const i = Math.max(t, e, n), r = Math.min(t, e, n), a = (i + r) / 2;
|
|
550
554
|
if (i === r) return { h: 0, s: 0, l: a * 100 };
|
|
551
|
-
const s = i - r,
|
|
555
|
+
const s = i - r, l = a > 0.5 ? s / (2 - i - r) : s / (i + r);
|
|
552
556
|
let c = 0;
|
|
553
|
-
return i === t ? c = ((e - n) / s + (e < n ? 6 : 0)) / 6 : i === e ? c = ((n - t) / s + 2) / 6 : c = ((t - e) / s + 4) / 6, { h: c * 360, s:
|
|
557
|
+
return i === t ? c = ((e - n) / s + (e < n ? 6 : 0)) / 6 : i === e ? c = ((n - t) / s + 2) / 6 : c = ((t - e) / s + 4) / 6, { h: c * 360, s: l * 100, l: a * 100 };
|
|
554
558
|
}
|
|
555
559
|
function re(t) {
|
|
556
560
|
return te(t) ?? ee(t) ?? ne(t);
|
|
557
561
|
}
|
|
558
|
-
function
|
|
562
|
+
function dt(t, e, n, i) {
|
|
559
563
|
const r = Math.round(t), a = Math.round(Math.min(100, Math.max(0, e))), s = Math.round(Math.min(100, Math.max(0, n)));
|
|
560
564
|
return i !== void 0 && i < 1 ? `hsla(${r}, ${a}%, ${s}%, ${i})` : `hsl(${r}, ${a}%, ${s}%)`;
|
|
561
565
|
}
|
|
@@ -565,12 +569,12 @@ function ie(t) {
|
|
|
565
569
|
const { h: n, s: i, l: r } = e;
|
|
566
570
|
let a, s = Math.min(i + 10, 100);
|
|
567
571
|
r < 25 ? (a = r + 12, s = Math.min(i + 15, 100)) : r < 40 ? a = Math.max(r - 8, 15) : a = Math.max(18, r * 0.3), i < 15 && (s = 10, a = Math.max(a, 20));
|
|
568
|
-
const
|
|
569
|
-
return { background:
|
|
572
|
+
const l = dt(n, s, a, 0.85), c = dt(n, Math.min(i, 90), Math.min(r, 55), 0.5);
|
|
573
|
+
return { background: l, glow: c };
|
|
570
574
|
}
|
|
571
|
-
var ae = /* @__PURE__ */
|
|
575
|
+
var ae = /* @__PURE__ */ x('<div><div class="flex items-center justify-center text-white">'), gt = /* @__PURE__ */ x("<div>");
|
|
572
576
|
function se(t) {
|
|
573
|
-
const e =
|
|
577
|
+
const e = G(), n = () => t.dynamicColor ? ie(t.dynamicColor) : null, i = () => !!n(), r = () => {
|
|
574
578
|
const c = n();
|
|
575
579
|
if (c)
|
|
576
580
|
return {
|
|
@@ -589,8 +593,8 @@ function se(t) {
|
|
|
589
593
|
"border-radius": "var(--radius-sm, 12px)"
|
|
590
594
|
}, g = r(), d = a();
|
|
591
595
|
return g && Object.assign(c, g), d && Object.assign(c, d), c;
|
|
592
|
-
},
|
|
593
|
-
const
|
|
596
|
+
}, l = (c, g, d) => {
|
|
597
|
+
const h = {
|
|
594
598
|
width: `${N.icon(e.size()) * 1.02}px`,
|
|
595
599
|
height: `${N.icon(e.size()) * 1.02}px`,
|
|
596
600
|
"border-radius": "var(--radius-sm, 12px)",
|
|
@@ -598,37 +602,37 @@ function se(t) {
|
|
|
598
602
|
right: `${-N.icon(e.size()) * (c * 0.71)}px`,
|
|
599
603
|
"z-index": g,
|
|
600
604
|
opacity: d
|
|
601
|
-
},
|
|
602
|
-
return
|
|
605
|
+
}, k = r();
|
|
606
|
+
return k && Object.assign(h, k), h;
|
|
603
607
|
};
|
|
604
608
|
return (() => {
|
|
605
609
|
var c = ae(), g = c.firstChild;
|
|
606
610
|
return f(c, (() => {
|
|
607
611
|
var d = D(() => (t.entityCount ?? 1) >= 2);
|
|
608
612
|
return () => d() && (() => {
|
|
609
|
-
var
|
|
610
|
-
return C((
|
|
611
|
-
var u =
|
|
612
|
-
return u !==
|
|
613
|
+
var h = gt();
|
|
614
|
+
return C((k) => {
|
|
615
|
+
var u = y("absolute", !i() && (t.color ?? "bg-white/10")), o = l(0.14, -2, 0.45);
|
|
616
|
+
return u !== k.e && w(h, k.e = u), k.t = tt(h, o, k.t), k;
|
|
613
617
|
}, {
|
|
614
618
|
e: void 0,
|
|
615
619
|
t: void 0
|
|
616
|
-
}),
|
|
620
|
+
}), h;
|
|
617
621
|
})();
|
|
618
622
|
})(), g), f(c, (() => {
|
|
619
623
|
var d = D(() => (t.entityCount ?? 1) >= 3);
|
|
620
624
|
return () => d() && (() => {
|
|
621
|
-
var
|
|
622
|
-
return C((
|
|
623
|
-
var u =
|
|
624
|
-
return u !==
|
|
625
|
+
var h = gt();
|
|
626
|
+
return C((k) => {
|
|
627
|
+
var u = y("absolute", !i() && (t.color ?? "bg-white/10")), o = l(0.28, -3, 0.2);
|
|
628
|
+
return u !== k.e && w(h, k.e = u), k.t = tt(h, o, k.t), k;
|
|
625
629
|
}, {
|
|
626
630
|
e: void 0,
|
|
627
631
|
t: void 0
|
|
628
|
-
}),
|
|
632
|
+
}), h;
|
|
629
633
|
})();
|
|
630
634
|
})(), g), f(g, () => t.icon), C((d) => {
|
|
631
|
-
var
|
|
635
|
+
var h = y(
|
|
632
636
|
"relative flex shrink-0 items-center justify-center transition-all",
|
|
633
637
|
"pointer-events-none",
|
|
634
638
|
t.dimmed && "opacity-50",
|
|
@@ -637,8 +641,8 @@ function se(t) {
|
|
|
637
641
|
!i() && (t.color ?? "bg-white/10"),
|
|
638
642
|
!i() && t.glow,
|
|
639
643
|
t.class
|
|
640
|
-
),
|
|
641
|
-
return
|
|
644
|
+
), k = s(), u = `${N.iconSize(e.size())}px`;
|
|
645
|
+
return h !== d.e && w(c, d.e = h), d.t = tt(c, k, d.t), u !== d.a && p(g, "font-size", d.a = u), d;
|
|
642
646
|
}, {
|
|
643
647
|
e: void 0,
|
|
644
648
|
t: void 0,
|
|
@@ -646,36 +650,36 @@ function se(t) {
|
|
|
646
650
|
}), c;
|
|
647
651
|
})();
|
|
648
652
|
}
|
|
649
|
-
var oe = /* @__PURE__ */
|
|
653
|
+
var oe = /* @__PURE__ */ x("<div>"), le = /* @__PURE__ */ x("<div><div><span></span></div><div>"), ce = /* @__PURE__ */ x("<span class=shrink-0>"), ue = /* @__PURE__ */ x('<span class="ml-1 text-white/70">');
|
|
650
654
|
function de(t) {
|
|
651
|
-
const e =
|
|
655
|
+
const e = G(), n = () => {
|
|
652
656
|
const i = t.direction ?? "auto";
|
|
653
657
|
return i === "auto" ? e.orientation() === "horizontal" ? "horizontal" : "vertical" : i;
|
|
654
658
|
};
|
|
655
659
|
return (() => {
|
|
656
660
|
var i = oe();
|
|
657
|
-
return f(i, () => t.children), C(() =>
|
|
661
|
+
return f(i, () => t.children), C(() => w(i, y("flex", n() === "horizontal" ? "flex-row gap-4" : "flex-col gap-2", t.class))), i;
|
|
658
662
|
})();
|
|
659
663
|
}
|
|
660
664
|
function ge(t) {
|
|
661
|
-
const e =
|
|
665
|
+
const e = G();
|
|
662
666
|
return (() => {
|
|
663
667
|
var n = le(), i = n.firstChild, r = i.firstChild, a = i.nextSibling;
|
|
664
668
|
return f(i, (() => {
|
|
665
669
|
var s = D(() => !!t.icon);
|
|
666
670
|
return () => s() && (() => {
|
|
667
|
-
var
|
|
668
|
-
return f(
|
|
671
|
+
var l = ce();
|
|
672
|
+
return f(l, () => t.icon), l;
|
|
669
673
|
})();
|
|
670
674
|
})(), r), f(r, () => t.label), f(a, () => t.value, null), f(a, (() => {
|
|
671
675
|
var s = D(() => !!t.unit);
|
|
672
676
|
return () => s() && (() => {
|
|
673
|
-
var
|
|
674
|
-
return f(
|
|
677
|
+
var l = ue();
|
|
678
|
+
return f(l, () => t.unit), l;
|
|
675
679
|
})();
|
|
676
680
|
})(), null), C((s) => {
|
|
677
|
-
var
|
|
678
|
-
return
|
|
681
|
+
var l = y("flex flex-col", t.dimmed && "opacity-50", t.class), c = N.S1(e.size()), g = y("flex items-center gap-1 text-white/60", H.metricLabel(e.size())), d = y("font-semibold text-white", H.metricValue(e.size()));
|
|
682
|
+
return l !== s.e && w(n, s.e = l), c !== s.t && p(n, "gap", s.t = c), g !== s.a && w(i, s.a = g), d !== s.o && w(a, s.o = d), s;
|
|
679
683
|
}, {
|
|
680
684
|
e: void 0,
|
|
681
685
|
t: void 0,
|
|
@@ -684,47 +688,47 @@ function ge(t) {
|
|
|
684
688
|
}), n;
|
|
685
689
|
})();
|
|
686
690
|
}
|
|
687
|
-
const
|
|
688
|
-
|
|
689
|
-
var me = /* @__PURE__ */
|
|
691
|
+
const bt = de;
|
|
692
|
+
bt.Item = ge;
|
|
693
|
+
var me = /* @__PURE__ */ x("<p>");
|
|
690
694
|
function fe(t) {
|
|
691
|
-
const e =
|
|
695
|
+
const e = G();
|
|
692
696
|
return (() => {
|
|
693
697
|
var n = me();
|
|
694
698
|
return f(n, (() => {
|
|
695
699
|
var i = D(() => !!t.isUnavailable);
|
|
696
700
|
return () => i() ? "Unavailable" : t.children;
|
|
697
701
|
})()), C((i) => {
|
|
698
|
-
var r =
|
|
699
|
-
return r !== i.e &&
|
|
702
|
+
var r = y("relative font-bold text-white", t.dimmed && "opacity-40", H.status(e.size()), t.class), a = L.ACTIONS;
|
|
703
|
+
return r !== i.e && w(n, i.e = r), a !== i.t && p(n, "z-index", i.t = a), i;
|
|
700
704
|
}, {
|
|
701
705
|
e: void 0,
|
|
702
706
|
t: void 0
|
|
703
707
|
}), n;
|
|
704
708
|
})();
|
|
705
709
|
}
|
|
706
|
-
var he = /* @__PURE__ */
|
|
710
|
+
var he = /* @__PURE__ */ x("<p>");
|
|
707
711
|
function xe(t) {
|
|
708
|
-
const e =
|
|
712
|
+
const e = G();
|
|
709
713
|
return (() => {
|
|
710
714
|
var n = he();
|
|
711
|
-
return f(n, () => t.children), C(() =>
|
|
715
|
+
return f(n, () => t.children), C(() => w(n, y("truncate font-medium text-white/80", t.dimmed && "text-white/50", H.subtitle(e.size()), t.class))), n;
|
|
712
716
|
})();
|
|
713
717
|
}
|
|
714
|
-
var ve = /* @__PURE__ */
|
|
718
|
+
var ve = /* @__PURE__ */ x("<div><h3>"), be = /* @__PURE__ */ x("<span>");
|
|
715
719
|
function ye(t) {
|
|
716
|
-
const e =
|
|
720
|
+
const e = G();
|
|
717
721
|
return (() => {
|
|
718
722
|
var n = ve(), i = n.firstChild;
|
|
719
723
|
return f(i, () => t.children), f(n, (() => {
|
|
720
724
|
var r = D(() => t.badge !== void 0 && t.badge > 0);
|
|
721
725
|
return () => r() && (() => {
|
|
722
726
|
var a = be();
|
|
723
|
-
return f(a, () => t.badge), C(() =>
|
|
727
|
+
return f(a, () => t.badge), C(() => w(a, y("shrink-0 rounded-full bg-white/20 px-2 py-0.5 font-medium text-white", H.badge(e.size())))), a;
|
|
724
728
|
})();
|
|
725
729
|
})(), null), C((r) => {
|
|
726
|
-
var a =
|
|
727
|
-
return a !== r.e &&
|
|
730
|
+
var a = y("relative flex items-center", t.class), s = N.S1(e.size()), l = L.ACTIONS, c = y("truncate text-white/60", H.title(e.size()));
|
|
731
|
+
return a !== r.e && w(n, r.e = a), s !== r.t && p(n, "gap", r.t = s), l !== r.a && p(n, "z-index", r.a = l), c !== r.o && w(i, r.o = c), r;
|
|
728
732
|
}, {
|
|
729
733
|
e: void 0,
|
|
730
734
|
t: void 0,
|
|
@@ -733,7 +737,7 @@ function ye(t) {
|
|
|
733
737
|
}), n;
|
|
734
738
|
})();
|
|
735
739
|
}
|
|
736
|
-
function
|
|
740
|
+
function Mn(t) {
|
|
737
741
|
return {
|
|
738
742
|
icon: t.icon,
|
|
739
743
|
title: t.title,
|
|
@@ -756,26 +760,26 @@ function we(t, e = !1) {
|
|
|
756
760
|
};
|
|
757
761
|
const n = t.length > 1;
|
|
758
762
|
if (!n) {
|
|
759
|
-
const
|
|
763
|
+
const _ = t[0], S = _.state === "on", O = _.attributes?.brightness || 0, I = Math.round(O / 255 * 100);
|
|
760
764
|
return {
|
|
761
765
|
isGroup: !1,
|
|
762
|
-
state:
|
|
763
|
-
isOn:
|
|
764
|
-
isUnavailable:
|
|
765
|
-
brightness:
|
|
766
|
-
brightnessPercent:
|
|
767
|
-
color:
|
|
768
|
-
onCount:
|
|
766
|
+
state: _.state,
|
|
767
|
+
isOn: S,
|
|
768
|
+
isUnavailable: _.state === "unavailable",
|
|
769
|
+
brightness: O,
|
|
770
|
+
brightnessPercent: I,
|
|
771
|
+
color: mt(_),
|
|
772
|
+
onCount: S ? 1 : 0,
|
|
769
773
|
totalCount: 1,
|
|
770
|
-
description:
|
|
774
|
+
description: S ? "On" : "Off"
|
|
771
775
|
};
|
|
772
776
|
}
|
|
773
|
-
let i = 0, r = 0, a = 0, s = 0,
|
|
777
|
+
let i = 0, r = 0, a = 0, s = 0, l = 0, c = 0;
|
|
774
778
|
const g = [];
|
|
775
|
-
for (const
|
|
776
|
-
switch (
|
|
779
|
+
for (const _ of t)
|
|
780
|
+
switch (_.state) {
|
|
777
781
|
case "on":
|
|
778
|
-
i++,
|
|
782
|
+
i++, _.attributes?.brightness !== void 0 && (l += _.attributes.brightness, c++), _.attributes?.rgb_color && g.push(_.attributes.rgb_color);
|
|
779
783
|
break;
|
|
780
784
|
case "off":
|
|
781
785
|
r++;
|
|
@@ -787,28 +791,28 @@ function we(t, e = !1) {
|
|
|
787
791
|
s++;
|
|
788
792
|
break;
|
|
789
793
|
}
|
|
790
|
-
const d = t.length,
|
|
794
|
+
const d = t.length, h = s === d, k = a + s === d, u = i > 0, o = i === d, b = r === d;
|
|
791
795
|
let v, T;
|
|
792
|
-
e ?
|
|
793
|
-
const
|
|
794
|
-
let
|
|
796
|
+
e ? h ? (v = "unavailable", T = !1) : a > 0 || s > 0 ? (v = "unknown", T = !1) : r > 0 ? (v = "off", T = !1) : (v = "on", T = !0) : h ? (v = "unavailable", T = !1) : k ? (v = "unknown", T = !1) : u ? (v = "on", T = !0) : (v = "off", T = !1);
|
|
797
|
+
const U = c > 0 ? Math.round(l / c) : 0, $ = Math.round(U / 255 * 100);
|
|
798
|
+
let A;
|
|
795
799
|
if (g.length > 0) {
|
|
796
|
-
const
|
|
797
|
-
|
|
800
|
+
const _ = Math.round(g.reduce((V, R) => V + R[0], 0) / g.length), S = Math.round(g.reduce((V, R) => V + R[1], 0) / g.length), O = Math.round(g.reduce((V, R) => V + R[2], 0) / g.length), I = U / 255;
|
|
801
|
+
A = `rgb(${Math.round(_ * I)}, ${Math.round(S * I)}, ${Math.round(O * I)})`;
|
|
798
802
|
} else
|
|
799
|
-
|
|
800
|
-
let
|
|
801
|
-
return
|
|
803
|
+
A = mt(t[0]);
|
|
804
|
+
let E;
|
|
805
|
+
return o ? E = "All on" : b ? E = "All off" : i > 0 ? E = `${i} of ${d} on` : E = "Off", {
|
|
802
806
|
isGroup: n,
|
|
803
807
|
state: v,
|
|
804
808
|
isOn: T,
|
|
805
809
|
isUnavailable: v === "unavailable",
|
|
806
|
-
brightness:
|
|
807
|
-
brightnessPercent:
|
|
808
|
-
color:
|
|
810
|
+
brightness: U,
|
|
811
|
+
brightnessPercent: $,
|
|
812
|
+
color: A,
|
|
809
813
|
onCount: i,
|
|
810
814
|
totalCount: d,
|
|
811
|
-
description:
|
|
815
|
+
description: E
|
|
812
816
|
};
|
|
813
817
|
}
|
|
814
818
|
function $e(t, e = "mean", n = !0) {
|
|
@@ -822,21 +826,21 @@ function $e(t, e = "mean", n = !0) {
|
|
|
822
826
|
};
|
|
823
827
|
const i = t.length > 1;
|
|
824
828
|
if (!i) {
|
|
825
|
-
const u = t[0],
|
|
829
|
+
const u = t[0], o = Number.parseFloat(u.state);
|
|
826
830
|
let b = u.state;
|
|
827
|
-
return Number.isNaN(
|
|
831
|
+
return Number.isNaN(o) || (b = Number.isInteger(o) ? o.toString() : o.toFixed(1)), {
|
|
828
832
|
isGroup: !1,
|
|
829
833
|
state: b,
|
|
830
|
-
numericValue: Number.isNaN(
|
|
834
|
+
numericValue: Number.isNaN(o) ? null : o,
|
|
831
835
|
isUnavailable: u.state === "unavailable",
|
|
832
836
|
unit: u.unitOfMeasurement ?? void 0,
|
|
833
837
|
description: b
|
|
834
838
|
};
|
|
835
839
|
}
|
|
836
840
|
const r = [], a = [];
|
|
837
|
-
let s = 0,
|
|
841
|
+
let s = 0, l;
|
|
838
842
|
for (const u of t) {
|
|
839
|
-
if (!
|
|
843
|
+
if (!l && u.unitOfMeasurement && (l = u.unitOfMeasurement), u.state === "unavailable") {
|
|
840
844
|
s++, a.push({
|
|
841
845
|
entityId: u.id,
|
|
842
846
|
value: "unavailable",
|
|
@@ -844,14 +848,14 @@ function $e(t, e = "mean", n = !0) {
|
|
|
844
848
|
});
|
|
845
849
|
continue;
|
|
846
850
|
}
|
|
847
|
-
const
|
|
848
|
-
isNaN(
|
|
851
|
+
const o = Number.parseFloat(u.state);
|
|
852
|
+
isNaN(o) ? n || a.push({
|
|
849
853
|
entityId: u.id,
|
|
850
854
|
value: u.state,
|
|
851
855
|
friendly_name: u.friendlyName
|
|
852
|
-
}) : (r.push(
|
|
856
|
+
}) : (r.push(o), a.push({
|
|
853
857
|
entityId: u.id,
|
|
854
|
-
value:
|
|
858
|
+
value: o,
|
|
855
859
|
friendly_name: u.friendlyName
|
|
856
860
|
}));
|
|
857
861
|
}
|
|
@@ -862,58 +866,58 @@ function $e(t, e = "mean", n = !0) {
|
|
|
862
866
|
state: c ? "unavailable" : "unknown",
|
|
863
867
|
numericValue: null,
|
|
864
868
|
isUnavailable: c,
|
|
865
|
-
unit:
|
|
869
|
+
unit: l,
|
|
866
870
|
description: c ? "Unavailable" : "No numeric values",
|
|
867
871
|
memberValues: a
|
|
868
872
|
};
|
|
869
|
-
let d,
|
|
873
|
+
let d, h;
|
|
870
874
|
switch (e) {
|
|
871
875
|
case "min":
|
|
872
|
-
d = Math.min(...r),
|
|
876
|
+
d = Math.min(...r), h = "Minimum";
|
|
873
877
|
break;
|
|
874
878
|
case "max":
|
|
875
|
-
d = Math.max(...r),
|
|
879
|
+
d = Math.max(...r), h = "Maximum";
|
|
876
880
|
break;
|
|
877
881
|
case "mean":
|
|
878
|
-
d = r.reduce((u,
|
|
882
|
+
d = r.reduce((u, o) => u + o, 0) / r.length, h = "Average";
|
|
879
883
|
break;
|
|
880
884
|
case "median": {
|
|
881
|
-
const u = [...r].sort((b, v) => b - v),
|
|
882
|
-
d = u.length % 2 === 0 ? (u[
|
|
885
|
+
const u = [...r].sort((b, v) => b - v), o = Math.floor(u.length / 2);
|
|
886
|
+
d = u.length % 2 === 0 ? (u[o - 1] + u[o]) / 2 : u[o], h = "Median";
|
|
883
887
|
break;
|
|
884
888
|
}
|
|
885
889
|
case "sum":
|
|
886
|
-
d = r.reduce((u,
|
|
890
|
+
d = r.reduce((u, o) => u + o, 0), h = "Sum";
|
|
887
891
|
break;
|
|
888
892
|
case "last":
|
|
889
|
-
d = r[r.length - 1],
|
|
893
|
+
d = r[r.length - 1], h = "Latest";
|
|
890
894
|
break;
|
|
891
895
|
case "range":
|
|
892
|
-
d = Math.max(...r) - Math.min(...r),
|
|
896
|
+
d = Math.max(...r) - Math.min(...r), h = "Range";
|
|
893
897
|
break;
|
|
894
898
|
case "product":
|
|
895
|
-
d = r.reduce((u,
|
|
899
|
+
d = r.reduce((u, o) => u * o, 1), h = "Product";
|
|
896
900
|
break;
|
|
897
901
|
case "std_dev": {
|
|
898
|
-
const u = r.reduce((b, v) => b + v, 0) / r.length,
|
|
899
|
-
d = Math.sqrt(
|
|
902
|
+
const u = r.reduce((b, v) => b + v, 0) / r.length, o = r.reduce((b, v) => b + (v - u) ** 2, 0) / r.length;
|
|
903
|
+
d = Math.sqrt(o), h = "Std Dev";
|
|
900
904
|
break;
|
|
901
905
|
}
|
|
902
906
|
default:
|
|
903
|
-
d = r.reduce((u,
|
|
907
|
+
d = r.reduce((u, o) => u + o, 0) / r.length, h = "Average";
|
|
904
908
|
}
|
|
905
|
-
const
|
|
909
|
+
const k = Number.isInteger(d) ? d.toString() : d.toFixed(1);
|
|
906
910
|
return {
|
|
907
911
|
isGroup: i,
|
|
908
|
-
state:
|
|
912
|
+
state: k,
|
|
909
913
|
numericValue: d,
|
|
910
914
|
isUnavailable: !1,
|
|
911
|
-
unit:
|
|
912
|
-
description: `${
|
|
915
|
+
unit: l,
|
|
916
|
+
description: `${h} of ${r.length}`,
|
|
913
917
|
memberValues: a
|
|
914
918
|
};
|
|
915
919
|
}
|
|
916
|
-
function
|
|
920
|
+
function mt(t) {
|
|
917
921
|
if (t.state !== "on") return "rgb(100, 100, 100)";
|
|
918
922
|
const n = (t.attributes?.brightness ?? 255) / 255;
|
|
919
923
|
if (t.attributes?.rgb_color) {
|
|
@@ -922,8 +926,8 @@ function dt(t) {
|
|
|
922
926
|
}
|
|
923
927
|
if (t.attributes?.color_temp) {
|
|
924
928
|
const r = 1e6 / t.attributes.color_temp / 100;
|
|
925
|
-
let a, s,
|
|
926
|
-
return r <= 66 ? (a = 255, s = r <= 19 ? 0 : 99.4708025861 * Math.log(r - 10) - 161.1195681661,
|
|
929
|
+
let a, s, l;
|
|
930
|
+
return r <= 66 ? (a = 255, s = r <= 19 ? 0 : 99.4708025861 * Math.log(r - 10) - 161.1195681661, l = r <= 19 ? 0 : r <= 66 ? 138.5177312231 * Math.log(r - 10) - 305.0447927307 : 255) : (a = 329.698727446 * (r - 60) ** -0.1332047592, s = 288.1221695283 * (r - 60) ** -0.0755148492, l = 255), a = Math.max(0, Math.min(255, a)) * n, s = Math.max(0, Math.min(255, s)) * n, l = Math.max(0, Math.min(255, l)) * n, `rgb(${Math.round(a)}, ${Math.round(s)}, ${Math.round(l)})`;
|
|
927
931
|
}
|
|
928
932
|
return `rgb(${Math.round(255 * n)}, ${Math.round(220 * n)}, ${Math.round(180 * n)})`;
|
|
929
933
|
}
|
|
@@ -940,25 +944,25 @@ function pe(t) {
|
|
|
940
944
|
}
|
|
941
945
|
return !1;
|
|
942
946
|
}
|
|
943
|
-
function
|
|
947
|
+
function zn(t, e = "unknown") {
|
|
944
948
|
return t?.state ?? e;
|
|
945
949
|
}
|
|
946
|
-
function
|
|
950
|
+
function Dn(t, e, n) {
|
|
947
951
|
return t?.attributes ? t.attributes[e] ?? n : n;
|
|
948
952
|
}
|
|
949
|
-
function
|
|
953
|
+
function _n(t, e) {
|
|
950
954
|
return t.filter((n) => n.state === e).length;
|
|
951
955
|
}
|
|
952
|
-
function
|
|
956
|
+
function An(t) {
|
|
953
957
|
return t.filter(ke).length;
|
|
954
958
|
}
|
|
955
|
-
function
|
|
959
|
+
function Nn(t) {
|
|
956
960
|
return t.filter(pe).length;
|
|
957
961
|
}
|
|
958
|
-
function
|
|
962
|
+
function Tn(t, e) {
|
|
959
963
|
return t.length > 0 && t.every((n) => n.state === e);
|
|
960
964
|
}
|
|
961
|
-
function
|
|
965
|
+
function En(t, e) {
|
|
962
966
|
return t.some((n) => n.state === e);
|
|
963
967
|
}
|
|
964
968
|
function Se(t, e, n) {
|
|
@@ -969,15 +973,15 @@ function Se(t, e, n) {
|
|
|
969
973
|
return e ? `--${e}` : "--";
|
|
970
974
|
let a = t, s = e || "";
|
|
971
975
|
r && e && (e === "W" || e === "kW" || e === "MW") && (t >= 1e6 ? (a = t / 1e6, s = "MW") : t >= 1e3 ? (a = t / 1e3, s = "kW") : s = "W"), r && e && (e === "B" || e === "KB" || e === "MB" || e === "GB") && (t >= 1073741824 ? (a = t / 1073741824, s = "GB") : t >= 1048576 ? (a = t / 1048576, s = "MB") : t >= 1024 ? (a = t / 1024, s = "KB") : s = "B");
|
|
972
|
-
let
|
|
973
|
-
return i !== void 0 ?
|
|
976
|
+
let l;
|
|
977
|
+
return i !== void 0 ? l = a.toFixed(i) : a !== t ? l = a.toFixed(1) : Number.isInteger(t) ? l = t.toString() : l = Number.parseFloat(t.toFixed(2)).toString(), s ? `${l}${s}` : l;
|
|
974
978
|
}
|
|
975
979
|
function Ce(t, e) {
|
|
976
980
|
return t == null || isNaN(t) ? null : e === "°C" ? t < 10 ? "Cold" : t < 18 ? "Cool" : t < 24 ? "Comfortable" : t < 28 ? "Warm" : "Hot" : e === "°F" ? t < 50 ? "Cold" : t < 64 ? "Cool" : t < 75 ? "Comfortable" : t < 82 ? "Warm" : "Hot" : e === "%" ? t < 20 ? "Very Low" : t < 40 ? "Low" : t < 60 ? "Medium" : t < 80 ? "High" : "Very High" : e === "ppm" ? t < 400 ? "Excellent" : t < 600 ? "Good" : t < 1e3 ? "Acceptable" : t < 1500 ? "Mediocre" : "Poor" : e === "lx" ? t < 50 ? "Dark" : t < 200 ? "Dim" : t < 500 ? "Moderate" : t < 1e3 ? "Bright" : "Very Bright" : e === "AQI" ? t <= 50 ? "Good" : t <= 100 ? "Moderate" : t <= 150 ? "Unhealthy for Sensitive" : t <= 200 ? "Unhealthy" : t <= 300 ? "Very Unhealthy" : "Hazardous" : e === "dB" ? t < 30 ? "Very Quiet" : t < 50 ? "Quiet" : t < 70 ? "Moderate" : t < 85 ? "Loud" : "Very Loud" : null;
|
|
977
981
|
}
|
|
978
|
-
var Me = /* @__PURE__ */
|
|
982
|
+
var Me = /* @__PURE__ */ x("<div><div>"), ze = /* @__PURE__ */ x("<div>");
|
|
979
983
|
function De(t) {
|
|
980
|
-
const e =
|
|
984
|
+
const e = G();
|
|
981
985
|
return (() => {
|
|
982
986
|
var n = Me(), i = n.firstChild;
|
|
983
987
|
return f(i, () => Se(t.value, t.unit)), f(n, (() => {
|
|
@@ -985,23 +989,23 @@ function De(t) {
|
|
|
985
989
|
return () => r() && (() => {
|
|
986
990
|
var a = ze();
|
|
987
991
|
return f(a, () => Ce(t.value, t.unit)), C((s) => {
|
|
988
|
-
var
|
|
989
|
-
return
|
|
992
|
+
var l = y("text-white/60", H.subtitle(e.size())), c = N.S1(e.size());
|
|
993
|
+
return l !== s.e && w(a, s.e = l), c !== s.t && p(a, "margin-top", s.t = c), s;
|
|
990
994
|
}, {
|
|
991
995
|
e: void 0,
|
|
992
996
|
t: void 0
|
|
993
997
|
}), a;
|
|
994
998
|
})();
|
|
995
999
|
})(), null), C((r) => {
|
|
996
|
-
var a =
|
|
997
|
-
return a !== r.e &&
|
|
1000
|
+
var a = y("flex flex-col", t.class), s = y("font-bold text-white", H.value(e.size()));
|
|
1001
|
+
return a !== r.e && w(n, r.e = a), s !== r.t && w(i, r.t = s), r;
|
|
998
1002
|
}, {
|
|
999
1003
|
e: void 0,
|
|
1000
1004
|
t: void 0
|
|
1001
1005
|
}), n;
|
|
1002
1006
|
})();
|
|
1003
1007
|
}
|
|
1004
|
-
var _e = /* @__PURE__ */
|
|
1008
|
+
var _e = /* @__PURE__ */ x('<div><div><div class="relative h-full w-full">'), Ae = /* @__PURE__ */ x('<div class="pointer-events-none absolute inset-0"><div>'), Ne = /* @__PURE__ */ x('<div class="pointer-events-none absolute inset-0 animate-pulse bg-blue-500/20">'), Te = /* @__PURE__ */ x('<div class="flex h-full w-full flex-col items-center justify-center gap-2 text-center">'), Ee = /* @__PURE__ */ x('<div class="flex items-center justify-center text-white/30">'), Oe = /* @__PURE__ */ x('<h3 class="font-semibold text-sm text-white/60">'), Ve = /* @__PURE__ */ x('<p class="text-white/50 text-xs">');
|
|
1005
1009
|
function We(t, e) {
|
|
1006
1010
|
const n = t * e;
|
|
1007
1011
|
return n <= 2 ? "xs" : n <= 4 ? "sm" : n <= 8 ? "md" : n <= 18 ? "lg" : "xl";
|
|
@@ -1014,10 +1018,10 @@ function Re(t, e) {
|
|
|
1014
1018
|
}
|
|
1015
1019
|
function Ge(t) {
|
|
1016
1020
|
let e;
|
|
1017
|
-
const n = Mt(() => e), i = 2, [r, a] =
|
|
1018
|
-
|
|
1019
|
-
const $ = Math.round(n.width ?? 0), A = Math.round(n.height ?? 0),
|
|
1020
|
-
(Math.abs($ -
|
|
1021
|
+
const n = Mt(() => e), i = 2, [r, a] = j(0), [s, l] = j(0);
|
|
1022
|
+
F(() => {
|
|
1023
|
+
const $ = Math.round(n.width ?? 0), A = Math.round(n.height ?? 0), E = ut(r), _ = ut(s);
|
|
1024
|
+
(Math.abs($ - E) > i || Math.abs(A - _) > i) && (a($), l(A));
|
|
1021
1025
|
});
|
|
1022
1026
|
const c = z(() => {
|
|
1023
1027
|
if (t.variant)
|
|
@@ -1032,45 +1036,57 @@ function Ge(t) {
|
|
|
1032
1036
|
}), d = z(() => {
|
|
1033
1037
|
const $ = g();
|
|
1034
1038
|
return We($.gridWidth, $.gridHeight);
|
|
1035
|
-
}),
|
|
1039
|
+
}), h = z(() => {
|
|
1036
1040
|
const $ = g();
|
|
1037
1041
|
return Ie($.width, $.height);
|
|
1038
|
-
}),
|
|
1042
|
+
}), k = z(() => {
|
|
1039
1043
|
const $ = g();
|
|
1040
1044
|
return Re($.width, $.height);
|
|
1041
|
-
}), u =
|
|
1045
|
+
}), u = ht(st), o = u;
|
|
1046
|
+
o?._isStub?.() && o._bridge && (F(() => {
|
|
1047
|
+
o._bridge.setSize(d());
|
|
1048
|
+
}), F(() => {
|
|
1049
|
+
o._bridge.setOrientation(h());
|
|
1050
|
+
}), F(() => {
|
|
1051
|
+
o._bridge.setContentLayout(k());
|
|
1052
|
+
}), F(() => {
|
|
1053
|
+
o._bridge.setDimensions(g());
|
|
1054
|
+
}), F(() => {
|
|
1055
|
+
o._bridge.setIsStub(!1);
|
|
1056
|
+
}));
|
|
1057
|
+
const b = {
|
|
1042
1058
|
size: d,
|
|
1043
|
-
orientation:
|
|
1044
|
-
contentLayout:
|
|
1059
|
+
orientation: h,
|
|
1060
|
+
contentLayout: k,
|
|
1045
1061
|
dimensions: g,
|
|
1046
1062
|
isEditMode: () => t.isEditMode ?? !1,
|
|
1047
1063
|
updateConfig: u?.updateConfig ?? (() => {
|
|
1048
1064
|
})
|
|
1049
|
-
},
|
|
1065
|
+
}, v = "bg-gradient-to-br from-gray-500/20 to-gray-600/20", T = z(() => t.emptyState && !t.gradient ? v : t.gradient), U = z(() => ({
|
|
1050
1066
|
"container-type": "size",
|
|
1051
1067
|
"container-name": "widget",
|
|
1052
1068
|
...c()?.styles?.container,
|
|
1053
1069
|
...c()?.styles?.cssVars || {}
|
|
1054
1070
|
}));
|
|
1055
|
-
return
|
|
1056
|
-
value:
|
|
1071
|
+
return W(st.Provider, {
|
|
1072
|
+
value: b,
|
|
1057
1073
|
get children() {
|
|
1058
|
-
var $ = _e(), A = $.firstChild,
|
|
1059
|
-
return typeof
|
|
1060
|
-
var
|
|
1061
|
-
return () =>
|
|
1062
|
-
var
|
|
1063
|
-
return C((
|
|
1064
|
-
var
|
|
1065
|
-
return
|
|
1074
|
+
var $ = _e(), A = $.firstChild, E = A.firstChild, _ = e;
|
|
1075
|
+
return typeof _ == "function" ? kt(_, $) : e = $, f(A, (() => {
|
|
1076
|
+
var S = D(() => !!t.backgroundGlow);
|
|
1077
|
+
return () => S() && (() => {
|
|
1078
|
+
var O = Ae(), I = O.firstChild;
|
|
1079
|
+
return C((V) => {
|
|
1080
|
+
var R = L.BACKGROUND, Q = y("absolute inset-0 opacity-20 blur-2xl", t.backgroundGlow);
|
|
1081
|
+
return R !== V.e && p(O, "z-index", V.e = R), Q !== V.t && w(I, V.t = Q), V;
|
|
1066
1082
|
}, {
|
|
1067
1083
|
e: void 0,
|
|
1068
1084
|
t: void 0
|
|
1069
|
-
}),
|
|
1085
|
+
}), O;
|
|
1070
1086
|
})();
|
|
1071
|
-
})(),
|
|
1072
|
-
var
|
|
1073
|
-
return () =>
|
|
1087
|
+
})(), E), f(E, (() => {
|
|
1088
|
+
var S = D(() => !!t.emptyState);
|
|
1089
|
+
return () => S() ? W(Be, {
|
|
1074
1090
|
get icon() {
|
|
1075
1091
|
return t.emptyState.icon;
|
|
1076
1092
|
},
|
|
@@ -1082,24 +1098,24 @@ function Ge(t) {
|
|
|
1082
1098
|
}
|
|
1083
1099
|
}) : t.children;
|
|
1084
1100
|
})()), f(A, (() => {
|
|
1085
|
-
var
|
|
1086
|
-
return () =>
|
|
1087
|
-
var
|
|
1088
|
-
return C((
|
|
1101
|
+
var S = D(() => !!t.loading);
|
|
1102
|
+
return () => S() && (() => {
|
|
1103
|
+
var O = Ne();
|
|
1104
|
+
return C((I) => p(O, "z-index", L.OVERLAY)), O;
|
|
1089
1105
|
})();
|
|
1090
|
-
})(), null), C((
|
|
1091
|
-
var
|
|
1106
|
+
})(), null), C((S) => {
|
|
1107
|
+
var O = y(
|
|
1092
1108
|
"relative h-full w-full select-none rounded-xl border border-border/50",
|
|
1093
1109
|
// Variant styles (lowest priority)
|
|
1094
1110
|
c()?.styles?.class,
|
|
1095
1111
|
// Custom class (highest priority)
|
|
1096
1112
|
t.class
|
|
1097
|
-
),
|
|
1113
|
+
), I = U(), V = y(
|
|
1098
1114
|
"relative h-full w-full overflow-hidden rounded-xl",
|
|
1099
1115
|
// Gradient prop (overrides variant, auto-applied for empty state)
|
|
1100
|
-
|
|
1101
|
-
),
|
|
1102
|
-
return
|
|
1116
|
+
T()
|
|
1117
|
+
), R = L.CONTENT;
|
|
1118
|
+
return O !== S.e && w($, S.e = O), S.t = tt($, I, S.t), V !== S.a && w(A, S.a = V), R !== S.o && p(E, "z-index", S.o = R), S;
|
|
1103
1119
|
}, {
|
|
1104
1120
|
e: void 0,
|
|
1105
1121
|
t: void 0,
|
|
@@ -1109,7 +1125,7 @@ function Ge(t) {
|
|
|
1109
1125
|
}
|
|
1110
1126
|
});
|
|
1111
1127
|
}
|
|
1112
|
-
function
|
|
1128
|
+
function Be(t) {
|
|
1113
1129
|
return (() => {
|
|
1114
1130
|
var e = Te();
|
|
1115
1131
|
return f(e, (() => {
|
|
@@ -1140,10 +1156,10 @@ P.Title = ye;
|
|
|
1140
1156
|
P.Subtitle = xe;
|
|
1141
1157
|
P.Status = fe;
|
|
1142
1158
|
P.Value = De;
|
|
1143
|
-
P.Metrics =
|
|
1159
|
+
P.Metrics = bt;
|
|
1144
1160
|
P.EmptyState = Jt;
|
|
1145
|
-
P.SliderFill =
|
|
1146
|
-
var
|
|
1161
|
+
P.SliderFill = Pt;
|
|
1162
|
+
var He = /* @__PURE__ */ x("<div><div>");
|
|
1147
1163
|
const Le = {
|
|
1148
1164
|
blue: "bg-blue-500/30",
|
|
1149
1165
|
green: "bg-green-500/30",
|
|
@@ -1152,13 +1168,13 @@ const Le = {
|
|
|
1152
1168
|
purple: "bg-purple-500/30",
|
|
1153
1169
|
gray: "bg-gray-500/30"
|
|
1154
1170
|
};
|
|
1155
|
-
function
|
|
1171
|
+
function On(t) {
|
|
1156
1172
|
const e = () => Le[t.color] ?? t.color;
|
|
1157
1173
|
return (() => {
|
|
1158
|
-
var n =
|
|
1174
|
+
var n = He(), i = n.firstChild;
|
|
1159
1175
|
return C((r) => {
|
|
1160
|
-
var a =
|
|
1161
|
-
return a !== r.e &&
|
|
1176
|
+
var a = y("pointer-events-none absolute inset-0", t.class), s = L.BACKGROUND, l = y("absolute inset-0 opacity-40 blur-3xl", e());
|
|
1177
|
+
return a !== r.e && w(n, r.e = a), s !== r.t && p(n, "z-index", r.t = s), l !== r.a && w(i, r.a = l), r;
|
|
1162
1178
|
}, {
|
|
1163
1179
|
e: void 0,
|
|
1164
1180
|
t: void 0,
|
|
@@ -1166,41 +1182,41 @@ function En(t) {
|
|
|
1166
1182
|
}), n;
|
|
1167
1183
|
})();
|
|
1168
1184
|
}
|
|
1169
|
-
var
|
|
1170
|
-
function
|
|
1171
|
-
const e =
|
|
1185
|
+
var Pe = /* @__PURE__ */ x("<div>");
|
|
1186
|
+
function Vn(t) {
|
|
1187
|
+
const e = G(), n = () => {
|
|
1172
1188
|
const i = t.spacing ?? "S2";
|
|
1173
1189
|
return N[i](e.size());
|
|
1174
1190
|
};
|
|
1175
1191
|
return (() => {
|
|
1176
|
-
var i =
|
|
1192
|
+
var i = Pe();
|
|
1177
1193
|
return f(i, () => t.children), C((r) => {
|
|
1178
|
-
var a =
|
|
1179
|
-
return a !== r.e &&
|
|
1194
|
+
var a = y("flex flex-col", t.class), s = n();
|
|
1195
|
+
return a !== r.e && w(i, r.e = a), s !== r.t && p(i, "gap", r.t = s), r;
|
|
1180
1196
|
}, {
|
|
1181
1197
|
e: void 0,
|
|
1182
1198
|
t: void 0
|
|
1183
1199
|
}), i;
|
|
1184
1200
|
})();
|
|
1185
1201
|
}
|
|
1186
|
-
var
|
|
1202
|
+
var je = /* @__PURE__ */ x('<span class="inline-flex size-3.5 shrink-0 items-center">'), Ue = /* @__PURE__ */ x("<button type=button>"), Fe = /* @__PURE__ */ x('<svg xmlns=http://www.w3.org/2000/svg class=size-3.5 fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z">'), Ye = /* @__PURE__ */ x('<div class="rounded-lg bg-muted/30 p-2 text-center md:p-6"><p class="text-muted-foreground text-sm">No edit options available'), Xe = /* @__PURE__ */ x('<svg xmlns=http://www.w3.org/2000/svg class=size-3.5 fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><line x1=4 y1=21 x2=4 y2=14></line><line x1=4 y1=10 x2=4 y2=3></line><line x1=12 y1=21 x2=12 y2=12></line><line x1=12 y1=8 x2=12 y2=3></line><line x1=20 y1=21 x2=20 y2=16></line><line x1=20 y1=12 x2=20 y2=3></line><line x1=1 y1=14 x2=7 y2=14></line><line x1=9 y1=8 x2=15 y2=8></line><line x1=17 y1=16 x2=23 y2=16>'), Ke = /* @__PURE__ */ x('<div class="rounded-lg bg-muted/30 p-2 text-center md:p-6"><p class="text-muted-foreground text-sm">No additional controls'), qe = /* @__PURE__ */ x('<svg xmlns=http://www.w3.org/2000/svg class=size-3.5 fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><path d="m8 2 1.88 1.88"></path><path d="M14.12 3.88 16 2"></path><path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"></path><path d="M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6"></path><path d="M12 20v-9"></path><path d="M6.53 9C4.6 8.8 3 7.1 3 5"></path><path d="M6 13H2"></path><path d="M3 21c0-2.1 1.7-3.9 3.8-4"></path><path d="M20.97 5c0 2.1-1.6 3.8-3.5 4"></path><path d="M22 13h-4"></path><path d="M17.2 17c2.1.1 3.8 1.9 3.8 4">'), Ze = /* @__PURE__ */ x('<div class="rounded-lg bg-muted/30 p-2 text-center md:p-6"><p class="text-muted-foreground text-sm">No debug information available'), Qe = /* @__PURE__ */ x('<div class="min-w-0 shrink-0">'), Je = /* @__PURE__ */ x('<div class="flex items-center gap-2"><div class="flex h-8 items-center rounded-lg border border-border/50 bg-muted/30 p-0.5">'), tn = /* @__PURE__ */ x('<div class="min-h-0 flex-1 overflow-y-auto p-2 md:p-6">'), en = /* @__PURE__ */ x('<div class="flex shrink-0 justify-end pt-3">');
|
|
1187
1203
|
function nn(t) {
|
|
1188
1204
|
return (() => {
|
|
1189
1205
|
var e = Ue();
|
|
1190
|
-
return e.$$click = () => t.onClick(), f(e,
|
|
1206
|
+
return e.$$click = () => t.onClick(), f(e, W(K, {
|
|
1191
1207
|
get when() {
|
|
1192
1208
|
return t.isActive;
|
|
1193
1209
|
},
|
|
1194
1210
|
get children() {
|
|
1195
|
-
var n =
|
|
1211
|
+
var n = je();
|
|
1196
1212
|
return f(n, () => t.icon), n;
|
|
1197
1213
|
}
|
|
1198
|
-
}), null), f(e, () => t.label, null), C(() =>
|
|
1214
|
+
}), null), f(e, () => t.label, null), C(() => w(e, y("flex cursor-pointer items-center justify-center rounded-md px-3 py-1.5 text-xs transition-all duration-300 ease-in-out", t.isActive ? "gap-1.5 bg-foreground/10 font-semibold text-foreground shadow-sm" : "gap-0 text-muted-foreground hover:bg-foreground/5 hover:text-foreground"))), e;
|
|
1199
1215
|
})();
|
|
1200
1216
|
}
|
|
1201
|
-
function
|
|
1202
|
-
const [e] = $t(t, ["open", "onOpenChange", "title", "onSave", "hasUnsavedChanges", "onDelete", "editContent", "controlsContent", "debugContent", "debugData", "tabs", "class", "maxWidth", "defaultTab", "headerActions", "ResponsiveDialog", "ResponsiveDialogContent", "ResponsiveDialogHeader", "ResponsiveDialogTitle", "ResponsiveDialogDescription", "Button"]), [n, i] =
|
|
1203
|
-
const
|
|
1217
|
+
function Wn(t) {
|
|
1218
|
+
const [e] = $t(t, ["open", "onOpenChange", "title", "onSave", "hasUnsavedChanges", "onDelete", "editContent", "controlsContent", "debugContent", "debugData", "tabs", "class", "maxWidth", "defaultTab", "headerActions", "ResponsiveDialog", "ResponsiveDialogContent", "ResponsiveDialogHeader", "ResponsiveDialogTitle", "ResponsiveDialogDescription", "Button"]), [n, i] = j(e.defaultTab ?? "controls"), r = () => {
|
|
1219
|
+
const o = e.maxWidth ?? "3xl";
|
|
1204
1220
|
return {
|
|
1205
1221
|
sm: "max-w-sm",
|
|
1206
1222
|
md: "max-w-md",
|
|
@@ -1209,38 +1225,38 @@ function Vn(t) {
|
|
|
1209
1225
|
"2xl": "max-w-2xl",
|
|
1210
1226
|
"3xl": "max-w-3xl",
|
|
1211
1227
|
"4xl": "max-w-4xl"
|
|
1212
|
-
}[
|
|
1228
|
+
}[o];
|
|
1213
1229
|
}, a = () => {
|
|
1214
1230
|
if (e.tabs) return e.tabs;
|
|
1215
|
-
const
|
|
1216
|
-
return
|
|
1231
|
+
const o = [];
|
|
1232
|
+
return o.push({
|
|
1217
1233
|
id: "edit",
|
|
1218
1234
|
label: "Edit",
|
|
1219
1235
|
icon: Fe(),
|
|
1220
1236
|
content: e.editContent ?? Ye()
|
|
1221
|
-
}),
|
|
1237
|
+
}), o.push({
|
|
1222
1238
|
id: "controls",
|
|
1223
1239
|
label: "Controls",
|
|
1224
1240
|
icon: Xe(),
|
|
1225
1241
|
content: e.controlsContent ?? Ke()
|
|
1226
|
-
}),
|
|
1242
|
+
}), o.push({
|
|
1227
1243
|
id: "debug",
|
|
1228
1244
|
label: "Debug",
|
|
1229
1245
|
icon: qe(),
|
|
1230
1246
|
content: e.debugContent ?? Ze()
|
|
1231
|
-
}),
|
|
1247
|
+
}), o;
|
|
1232
1248
|
}, s = async () => {
|
|
1233
1249
|
if (e.debugData !== void 0)
|
|
1234
1250
|
try {
|
|
1235
|
-
const
|
|
1236
|
-
await navigator.clipboard.writeText(
|
|
1251
|
+
const o = typeof e.debugData == "string" ? e.debugData : JSON.stringify(e.debugData, null, 2);
|
|
1252
|
+
await navigator.clipboard.writeText(o);
|
|
1237
1253
|
} catch {
|
|
1238
1254
|
}
|
|
1239
|
-
},
|
|
1240
|
-
const
|
|
1241
|
-
return
|
|
1242
|
-
}, c = e.ResponsiveDialog, g = e.ResponsiveDialogContent, d = e.ResponsiveDialogHeader,
|
|
1243
|
-
return
|
|
1255
|
+
}, l = () => {
|
|
1256
|
+
const o = a();
|
|
1257
|
+
return o.find((v) => v.id === n())?.content ?? o[0]?.content;
|
|
1258
|
+
}, c = e.ResponsiveDialog, g = e.ResponsiveDialogContent, d = e.ResponsiveDialogHeader, h = e.ResponsiveDialogTitle, k = e.ResponsiveDialogDescription, u = e.Button;
|
|
1259
|
+
return W(c, {
|
|
1244
1260
|
get open() {
|
|
1245
1261
|
return e.open;
|
|
1246
1262
|
},
|
|
@@ -1248,28 +1264,28 @@ function Vn(t) {
|
|
|
1248
1264
|
return e.onOpenChange;
|
|
1249
1265
|
},
|
|
1250
1266
|
get children() {
|
|
1251
|
-
return
|
|
1267
|
+
return W(g, {
|
|
1252
1268
|
get class() {
|
|
1253
|
-
return
|
|
1269
|
+
return y(r(), e.class);
|
|
1254
1270
|
},
|
|
1255
1271
|
get children() {
|
|
1256
|
-
return [
|
|
1272
|
+
return [W(d, {
|
|
1257
1273
|
class: "flex flex-row items-center justify-between gap-3",
|
|
1258
1274
|
get children() {
|
|
1259
1275
|
return [(() => {
|
|
1260
|
-
var
|
|
1261
|
-
return f(
|
|
1276
|
+
var o = Qe();
|
|
1277
|
+
return f(o, W(h, {
|
|
1262
1278
|
class: "truncate leading-tight",
|
|
1263
1279
|
get children() {
|
|
1264
1280
|
return e.title;
|
|
1265
1281
|
}
|
|
1266
|
-
}), null), f(
|
|
1282
|
+
}), null), f(o, W(k, {
|
|
1267
1283
|
class: "sr-only",
|
|
1268
1284
|
children: "Widget configuration dialog"
|
|
1269
|
-
}), null),
|
|
1285
|
+
}), null), o;
|
|
1270
1286
|
})(), (() => {
|
|
1271
|
-
var
|
|
1272
|
-
return f(b, () => a().map((v) =>
|
|
1287
|
+
var o = Je(), b = o.firstChild;
|
|
1288
|
+
return f(b, () => a().map((v) => W(nn, {
|
|
1273
1289
|
get icon() {
|
|
1274
1290
|
return v.icon;
|
|
1275
1291
|
},
|
|
@@ -1280,54 +1296,54 @@ function Vn(t) {
|
|
|
1280
1296
|
return n() === v.id;
|
|
1281
1297
|
},
|
|
1282
1298
|
onClick: () => i(v.id)
|
|
1283
|
-
}))), f(
|
|
1299
|
+
}))), f(o, W(K, {
|
|
1284
1300
|
get when() {
|
|
1285
1301
|
return e.headerActions;
|
|
1286
1302
|
},
|
|
1287
1303
|
get children() {
|
|
1288
1304
|
return e.headerActions;
|
|
1289
1305
|
}
|
|
1290
|
-
}), null), f(
|
|
1306
|
+
}), null), f(o, W(K, {
|
|
1291
1307
|
get when() {
|
|
1292
1308
|
return D(() => !!(n() === "edit" && e.onSave))() && e.hasUnsavedChanges;
|
|
1293
1309
|
},
|
|
1294
1310
|
get children() {
|
|
1295
|
-
return
|
|
1311
|
+
return W(u, {
|
|
1296
1312
|
size: "sm",
|
|
1297
1313
|
onClick: () => e.onSave?.(),
|
|
1298
1314
|
children: "Save"
|
|
1299
1315
|
});
|
|
1300
1316
|
}
|
|
1301
|
-
}), null), f(
|
|
1317
|
+
}), null), f(o, W(K, {
|
|
1302
1318
|
get when() {
|
|
1303
1319
|
return D(() => n() === "edit")() && e.onDelete;
|
|
1304
1320
|
},
|
|
1305
1321
|
get children() {
|
|
1306
|
-
return
|
|
1322
|
+
return W(u, {
|
|
1307
1323
|
size: "sm",
|
|
1308
1324
|
variant: "destructive",
|
|
1309
1325
|
onClick: () => e.onDelete?.(),
|
|
1310
1326
|
children: "Delete"
|
|
1311
1327
|
});
|
|
1312
1328
|
}
|
|
1313
|
-
}), null),
|
|
1329
|
+
}), null), o;
|
|
1314
1330
|
})()];
|
|
1315
1331
|
}
|
|
1316
1332
|
}), (() => {
|
|
1317
|
-
var
|
|
1318
|
-
return f(
|
|
1319
|
-
})(),
|
|
1333
|
+
var o = tn();
|
|
1334
|
+
return f(o, l), o;
|
|
1335
|
+
})(), W(K, {
|
|
1320
1336
|
get when() {
|
|
1321
1337
|
return D(() => n() === "debug")() && e.debugData !== void 0;
|
|
1322
1338
|
},
|
|
1323
1339
|
get children() {
|
|
1324
|
-
var
|
|
1325
|
-
return f(
|
|
1340
|
+
var o = en();
|
|
1341
|
+
return f(o, W(u, {
|
|
1326
1342
|
size: "sm",
|
|
1327
1343
|
variant: "outline",
|
|
1328
1344
|
onClick: s,
|
|
1329
1345
|
children: "Copy"
|
|
1330
|
-
})),
|
|
1346
|
+
})), o;
|
|
1331
1347
|
}
|
|
1332
1348
|
})];
|
|
1333
1349
|
}
|
|
@@ -1336,79 +1352,79 @@ function Vn(t) {
|
|
|
1336
1352
|
});
|
|
1337
1353
|
}
|
|
1338
1354
|
pt(["click"]);
|
|
1339
|
-
const
|
|
1355
|
+
const Z = 32, m = Z / 2, B = "white", et = "rgba(0,0,0,0.4)", ct = 2, nt = 3;
|
|
1340
1356
|
function rn(t) {
|
|
1341
1357
|
return `url("data:image/svg+xml,${encodeURIComponent(t)}")`;
|
|
1342
1358
|
}
|
|
1343
|
-
function
|
|
1344
|
-
return `<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
1359
|
+
function rt(t) {
|
|
1360
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${Z}" height="${Z}" viewBox="0 0 ${Z} ${Z}">${t}</svg>`;
|
|
1345
1361
|
}
|
|
1346
|
-
const an =
|
|
1362
|
+
const an = rt(`
|
|
1347
1363
|
<g transform="translate(6, 2)">
|
|
1348
1364
|
<!-- shadow -->
|
|
1349
|
-
<g stroke="${
|
|
1365
|
+
<g stroke="${et}" stroke-width="${nt}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1350
1366
|
<path d="M10 8V3a2 2 0 0 1 4 0v10l4.5-4.5a2 2 0 0 1 2.83 2.83L14 18.5c-2 2-4 3.5-8 3.5-3 0-5-2-5-5v-6a2 2 0 0 1 4 0v2"/>
|
|
1351
1367
|
</g>
|
|
1352
1368
|
<!-- main -->
|
|
1353
|
-
<g stroke="${
|
|
1369
|
+
<g stroke="${B}" stroke-width="${ct}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1354
1370
|
<path d="M10 8V3a2 2 0 0 1 4 0v10l4.5-4.5a2 2 0 0 1 2.83 2.83L14 18.5c-2 2-4 3.5-8 3.5-3 0-5-2-5-5v-6a2 2 0 0 1 4 0v2"/>
|
|
1355
1371
|
</g>
|
|
1356
1372
|
</g>
|
|
1357
|
-
`), sn =
|
|
1373
|
+
`), sn = rt(`
|
|
1358
1374
|
<g>
|
|
1359
|
-
<circle cx="${m}" cy="${m}" r="8" stroke="${
|
|
1360
|
-
<circle cx="${m}" cy="${m}" r="8" stroke="${
|
|
1361
|
-
<circle cx="${m}" cy="${m}" r="1.5" fill="${
|
|
1375
|
+
<circle cx="${m}" cy="${m}" r="8" stroke="${et}" stroke-width="${nt}" fill="none"/>
|
|
1376
|
+
<circle cx="${m}" cy="${m}" r="8" stroke="${B}" stroke-width="1.5" fill="none"/>
|
|
1377
|
+
<circle cx="${m}" cy="${m}" r="1.5" fill="${B}"/>
|
|
1362
1378
|
</g>
|
|
1363
|
-
`), on =
|
|
1379
|
+
`), on = rt(`
|
|
1364
1380
|
<g>
|
|
1365
1381
|
<!-- shadow -->
|
|
1366
|
-
<g stroke="${
|
|
1382
|
+
<g stroke="${et}" stroke-width="${nt}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1367
1383
|
<line x1="6" y1="${m}" x2="26" y2="${m}"/>
|
|
1368
1384
|
<polyline points="10,${m - 4} 6,${m} 10,${m + 4}"/>
|
|
1369
1385
|
<polyline points="22,${m - 4} 26,${m} 22,${m + 4}"/>
|
|
1370
1386
|
</g>
|
|
1371
1387
|
<!-- main -->
|
|
1372
|
-
<g stroke="${
|
|
1388
|
+
<g stroke="${B}" stroke-width="${ct}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1373
1389
|
<line x1="6" y1="${m}" x2="26" y2="${m}"/>
|
|
1374
1390
|
<polyline points="10,${m - 4} 6,${m} 10,${m + 4}"/>
|
|
1375
1391
|
<polyline points="22,${m - 4} 26,${m} 22,${m + 4}"/>
|
|
1376
1392
|
</g>
|
|
1377
1393
|
<!-- center grip dots -->
|
|
1378
|
-
<circle cx="${m}" cy="${m}" r="1.5" fill="${
|
|
1379
|
-
<circle cx="${m - 5}" cy="${m}" r="1" fill="${
|
|
1380
|
-
<circle cx="${m + 5}" cy="${m}" r="1" fill="${
|
|
1394
|
+
<circle cx="${m}" cy="${m}" r="1.5" fill="${B}"/>
|
|
1395
|
+
<circle cx="${m - 5}" cy="${m}" r="1" fill="${B}" opacity="0.6"/>
|
|
1396
|
+
<circle cx="${m + 5}" cy="${m}" r="1" fill="${B}" opacity="0.6"/>
|
|
1381
1397
|
</g>
|
|
1382
|
-
`), ln =
|
|
1398
|
+
`), ln = rt(`
|
|
1383
1399
|
<g>
|
|
1384
1400
|
<!-- shadow -->
|
|
1385
|
-
<g stroke="${
|
|
1401
|
+
<g stroke="${et}" stroke-width="${nt}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1386
1402
|
<line x1="${m}" y1="6" x2="${m}" y2="26"/>
|
|
1387
1403
|
<polyline points="${m - 4},10 ${m},6 ${m + 4},10"/>
|
|
1388
1404
|
<polyline points="${m - 4},22 ${m},26 ${m + 4},22"/>
|
|
1389
1405
|
</g>
|
|
1390
1406
|
<!-- main -->
|
|
1391
|
-
<g stroke="${
|
|
1407
|
+
<g stroke="${B}" stroke-width="${ct}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1392
1408
|
<line x1="${m}" y1="6" x2="${m}" y2="26"/>
|
|
1393
1409
|
<polyline points="${m - 4},10 ${m},6 ${m + 4},10"/>
|
|
1394
1410
|
<polyline points="${m - 4},22 ${m},26 ${m + 4},22"/>
|
|
1395
1411
|
</g>
|
|
1396
1412
|
<!-- center grip dots -->
|
|
1397
|
-
<circle cx="${m}" cy="${m}" r="1.5" fill="${
|
|
1398
|
-
<circle cx="${m}" cy="${m - 5}" r="1" fill="${
|
|
1399
|
-
<circle cx="${m}" cy="${m + 5}" r="1" fill="${
|
|
1413
|
+
<circle cx="${m}" cy="${m}" r="1.5" fill="${B}"/>
|
|
1414
|
+
<circle cx="${m}" cy="${m - 5}" r="1" fill="${B}" opacity="0.6"/>
|
|
1415
|
+
<circle cx="${m}" cy="${m + 5}" r="1" fill="${B}" opacity="0.6"/>
|
|
1400
1416
|
</g>
|
|
1401
1417
|
`);
|
|
1402
|
-
function
|
|
1418
|
+
function J(t, e, n) {
|
|
1403
1419
|
return { css: `${rn(t)} ${e} ${n}, auto`, hotspotX: e, hotspotY: n };
|
|
1404
1420
|
}
|
|
1405
|
-
const
|
|
1406
|
-
tap:
|
|
1407
|
-
hold:
|
|
1408
|
-
slideHorizontal:
|
|
1409
|
-
slideVertical:
|
|
1421
|
+
const Y = {
|
|
1422
|
+
tap: J(an, 12, 4),
|
|
1423
|
+
hold: J(sn, 16, 16),
|
|
1424
|
+
slideHorizontal: J(on, m, m),
|
|
1425
|
+
slideVertical: J(ln, m, m)
|
|
1410
1426
|
};
|
|
1411
|
-
function
|
|
1427
|
+
function In(t, e) {
|
|
1412
1428
|
const n = {
|
|
1413
1429
|
isDown: !1,
|
|
1414
1430
|
startX: 0,
|
|
@@ -1433,17 +1449,17 @@ function Wn(t, e) {
|
|
|
1433
1449
|
return T.height > T.width ? "vertical" : "horizontal";
|
|
1434
1450
|
}
|
|
1435
1451
|
return (e?.() ?? "horizontal") === "horizontal" ? "horizontal" : "vertical";
|
|
1436
|
-
},
|
|
1437
|
-
const
|
|
1438
|
-
if (!(!
|
|
1439
|
-
if (n.isDown = !0, n.element = u.currentTarget, n.startX = u.clientX, n.startY = u.clientY, n.currentX = u.clientX, n.currentY = u.clientY, n.startTime = Date.now(), n.hasMoved = !1, n.slideActive = !1, n.lockedAxis = null, u.currentTarget.setPointerCapture(u.pointerId),
|
|
1440
|
-
const b =
|
|
1452
|
+
}, l = (u) => {
|
|
1453
|
+
const o = t();
|
|
1454
|
+
if (!(!o.tap && !o.hold && !o.slide)) {
|
|
1455
|
+
if (n.isDown = !0, n.element = u.currentTarget, n.startX = u.clientX, n.startY = u.clientY, n.currentX = u.clientX, n.currentY = u.clientY, n.startTime = Date.now(), n.hasMoved = !1, n.slideActive = !1, n.lockedAxis = null, u.currentTarget.setPointerCapture(u.pointerId), o.hold) {
|
|
1456
|
+
const b = o.hold.delay ?? 300;
|
|
1441
1457
|
n.holdTimer = setTimeout(() => {
|
|
1442
|
-
n.isDown && !n.hasMoved && (
|
|
1458
|
+
n.isDown && !n.hasMoved && (o.hold.action(), n.isDown = !1);
|
|
1443
1459
|
}, b);
|
|
1444
1460
|
}
|
|
1445
|
-
if (
|
|
1446
|
-
const b =
|
|
1461
|
+
if (o.slide) {
|
|
1462
|
+
const b = o.slide.activationDelay ?? 0;
|
|
1447
1463
|
b > 0 ? n.slideActivationTimer = setTimeout(() => {
|
|
1448
1464
|
n.slideActive = !0;
|
|
1449
1465
|
}, b) : n.slideActive = !0;
|
|
@@ -1451,51 +1467,51 @@ function Wn(t, e) {
|
|
|
1451
1467
|
}
|
|
1452
1468
|
}, c = (u) => {
|
|
1453
1469
|
if (!n.isDown) return;
|
|
1454
|
-
const
|
|
1470
|
+
const o = t();
|
|
1455
1471
|
n.currentX = u.clientX, n.currentY = u.clientY;
|
|
1456
|
-
const b = n.currentX - n.startX, v = n.currentY - n.startY, T = Math.abs(b),
|
|
1457
|
-
if (!n.lockedAxis &&
|
|
1458
|
-
|
|
1472
|
+
const b = n.currentX - n.startX, v = n.currentY - n.startY, T = Math.abs(b), U = Math.abs(v), $ = Math.sqrt(b * b + v * v), A = u.currentTarget, E = s(A);
|
|
1473
|
+
if (!n.lockedAxis && $ > r && (T > U ? n.lockedAxis = "horizontal" : n.lockedAxis = "vertical", o.slide && n.lockedAxis !== E)) {
|
|
1474
|
+
A.releasePointerCapture(u.pointerId), n.isDown = !1, n.slideActive = !1, a();
|
|
1459
1475
|
return;
|
|
1460
1476
|
}
|
|
1461
|
-
if (
|
|
1462
|
-
const
|
|
1463
|
-
|
|
1477
|
+
if ($ > i && (n.hasMoved = !0, a()), o.slide && n.slideActive && n.hasMoved && n.lockedAxis === E) {
|
|
1478
|
+
const _ = o.slide.min ?? 0, S = o.slide.max ?? 100, O = S - _, I = E === "vertical" ? -v : b, V = E === "vertical" ? u.currentTarget.clientHeight : u.currentTarget.clientWidth, Q = I / V * O, yt = Math.max(_, Math.min(S, o.slide.value + Q));
|
|
1479
|
+
o.slide.onChange(Math.round(yt)), n.startX = n.currentX, n.startY = n.currentY, u.preventDefault();
|
|
1464
1480
|
}
|
|
1465
1481
|
}, g = (u) => {
|
|
1466
1482
|
if (!n.isDown) return;
|
|
1467
|
-
const
|
|
1468
|
-
if (a(),
|
|
1483
|
+
const o = t(), b = o.hold?.delay ?? 300;
|
|
1484
|
+
if (a(), o.tap && !n.hasMoved) {
|
|
1469
1485
|
const v = Date.now() - n.startTime;
|
|
1470
|
-
n.isDown && v < b &&
|
|
1486
|
+
n.isDown && v < b && o.tap();
|
|
1471
1487
|
}
|
|
1472
1488
|
n.isDown = !1, n.hasMoved = !1, n.slideActive = !1, n.lockedAxis = null, u.currentTarget.releasePointerCapture(u.pointerId);
|
|
1473
1489
|
}, d = (u) => {
|
|
1474
1490
|
a(), n.isDown = !1, n.hasMoved = !1, n.slideActive = !1, n.lockedAxis = null, u.currentTarget.releasePointerCapture(u.pointerId);
|
|
1475
|
-
},
|
|
1476
|
-
const
|
|
1477
|
-
if (
|
|
1478
|
-
const b =
|
|
1479
|
-
if (b === "horizontal") return
|
|
1480
|
-
if (b === "vertical") return
|
|
1491
|
+
}, h = (u) => {
|
|
1492
|
+
const o = t();
|
|
1493
|
+
if (o.slide) {
|
|
1494
|
+
const b = o.slide.orientation;
|
|
1495
|
+
if (b === "horizontal") return Y.slideHorizontal.css;
|
|
1496
|
+
if (b === "vertical") return Y.slideVertical.css;
|
|
1481
1497
|
const v = u.getBoundingClientRect();
|
|
1482
|
-
return v.height > v.width ?
|
|
1498
|
+
return v.height > v.width ? Y.slideVertical.css : Y.slideHorizontal.css;
|
|
1483
1499
|
}
|
|
1484
|
-
return
|
|
1500
|
+
return o.tap ? Y.tap.css : o.hold ? Y.hold.css : "";
|
|
1485
1501
|
};
|
|
1486
1502
|
return {
|
|
1487
|
-
onPointerDown:
|
|
1503
|
+
onPointerDown: l,
|
|
1488
1504
|
onPointerMove: c,
|
|
1489
1505
|
onPointerUp: g,
|
|
1490
1506
|
onPointerCancel: d,
|
|
1491
1507
|
onPointerEnter: (u) => {
|
|
1492
|
-
const
|
|
1493
|
-
n.element =
|
|
1508
|
+
const o = u.currentTarget;
|
|
1509
|
+
n.element = o, o.style.cursor = h(o);
|
|
1494
1510
|
},
|
|
1495
1511
|
dispose: a
|
|
1496
1512
|
};
|
|
1497
1513
|
}
|
|
1498
|
-
function
|
|
1514
|
+
function Rn(t) {
|
|
1499
1515
|
return z(() => {
|
|
1500
1516
|
const e = t.entities();
|
|
1501
1517
|
if (e.length === 0) return;
|
|
@@ -1517,14 +1533,14 @@ function In(t) {
|
|
|
1517
1533
|
return t.additionalData && Object.assign(n, t.additionalData), n;
|
|
1518
1534
|
});
|
|
1519
1535
|
}
|
|
1520
|
-
function
|
|
1521
|
-
const [e, n] =
|
|
1536
|
+
function Gn(t = {}) {
|
|
1537
|
+
const [e, n] = j(!1), [i, r] = j(!1);
|
|
1522
1538
|
return {
|
|
1523
|
-
save: async (
|
|
1539
|
+
save: async (l) => {
|
|
1524
1540
|
if (t.onSave) {
|
|
1525
1541
|
n(!0);
|
|
1526
1542
|
try {
|
|
1527
|
-
await t.onSave(
|
|
1543
|
+
await t.onSave(l), t.onSaveSuccess?.();
|
|
1528
1544
|
} finally {
|
|
1529
1545
|
n(!1);
|
|
1530
1546
|
}
|
|
@@ -1544,8 +1560,8 @@ function Rn(t = {}) {
|
|
|
1544
1560
|
isDeleting: i
|
|
1545
1561
|
};
|
|
1546
1562
|
}
|
|
1547
|
-
function
|
|
1548
|
-
const [e, n] =
|
|
1563
|
+
function Bn(t = "edit") {
|
|
1564
|
+
const [e, n] = j(!1), [i, r] = j(t);
|
|
1549
1565
|
return {
|
|
1550
1566
|
showDialog: e,
|
|
1551
1567
|
setShowDialog: n,
|
|
@@ -1567,15 +1583,15 @@ function Hn(t) {
|
|
|
1567
1583
|
hasEntity: e
|
|
1568
1584
|
};
|
|
1569
1585
|
}
|
|
1570
|
-
function
|
|
1586
|
+
function Ln(t) {
|
|
1571
1587
|
const e = t.minEntities ?? 1, n = z(() => t.entities().length), i = z(() => n() >= e), r = z(() => !i() || !t.calculateGroupData ? null : t.calculateGroupData(t.entities())), a = z(() => {
|
|
1572
1588
|
if (!i()) return;
|
|
1573
|
-
const
|
|
1574
|
-
if (!
|
|
1589
|
+
const l = t.aggregationMode?.();
|
|
1590
|
+
if (!l || l === "none") return;
|
|
1575
1591
|
const c = t.entities();
|
|
1576
|
-
if (
|
|
1592
|
+
if (l === "light" || l === "binary-sensor" || l === "switch")
|
|
1577
1593
|
return we(c, t.allEntitiesMode);
|
|
1578
|
-
if (
|
|
1594
|
+
if (l === "sensor") {
|
|
1579
1595
|
const g = t.sensorGroupType?.() ?? "mean";
|
|
1580
1596
|
return $e(c, g, !0);
|
|
1581
1597
|
}
|
|
@@ -1589,7 +1605,7 @@ function Bn(t) {
|
|
|
1589
1605
|
count: n
|
|
1590
1606
|
};
|
|
1591
1607
|
}
|
|
1592
|
-
function
|
|
1608
|
+
function Pn(t) {
|
|
1593
1609
|
const [e] = zt({
|
|
1594
1610
|
validate: Dt(t.schema),
|
|
1595
1611
|
initialValues: t.initialValues
|
|
@@ -1606,9 +1622,9 @@ function Ln(t) {
|
|
|
1606
1622
|
reset: _t
|
|
1607
1623
|
};
|
|
1608
1624
|
}
|
|
1609
|
-
const
|
|
1625
|
+
const it = ["xs", "sm", "md", "lg", "xl"];
|
|
1610
1626
|
function jn() {
|
|
1611
|
-
const t =
|
|
1627
|
+
const t = G(), e = z(() => it.indexOf(t.size())), n = z(() => {
|
|
1612
1628
|
const c = t.size();
|
|
1613
1629
|
return c === "xs" || c === "sm";
|
|
1614
1630
|
}), i = z(() => {
|
|
@@ -1624,12 +1640,12 @@ function jn() {
|
|
|
1624
1640
|
matches: (c) => {
|
|
1625
1641
|
const g = c.trim();
|
|
1626
1642
|
if (g.endsWith("+")) {
|
|
1627
|
-
const d = g.slice(0, -1),
|
|
1628
|
-
return
|
|
1643
|
+
const d = g.slice(0, -1), h = it.indexOf(d);
|
|
1644
|
+
return h >= 0 && e() >= h;
|
|
1629
1645
|
}
|
|
1630
1646
|
if (g.endsWith("-")) {
|
|
1631
|
-
const d = g.slice(0, -1),
|
|
1632
|
-
return
|
|
1647
|
+
const d = g.slice(0, -1), h = it.indexOf(d);
|
|
1648
|
+
return h >= 0 && e() <= h;
|
|
1633
1649
|
}
|
|
1634
1650
|
return t.size() === g;
|
|
1635
1651
|
}
|
|
@@ -1653,7 +1669,7 @@ const M = {
|
|
|
1653
1669
|
sage: "bg-gradient-to-br from-lime-600/20 to-green-600/20",
|
|
1654
1670
|
copper: "bg-gradient-to-br from-amber-600/20 to-amber-800/20",
|
|
1655
1671
|
dusk: "bg-gradient-to-br from-blue-500/20 to-purple-600/20"
|
|
1656
|
-
},
|
|
1672
|
+
}, Un = {
|
|
1657
1673
|
ocean: "Ocean Breeze",
|
|
1658
1674
|
sunset: "Sunset Glow",
|
|
1659
1675
|
forest: "Forest Dawn",
|
|
@@ -1671,8 +1687,8 @@ const M = {
|
|
|
1671
1687
|
sage: "Sage",
|
|
1672
1688
|
copper: "Copper",
|
|
1673
1689
|
dusk: "Dusk"
|
|
1674
|
-
},
|
|
1675
|
-
function
|
|
1690
|
+
}, Fn = Object.keys(M);
|
|
1691
|
+
function ft(t) {
|
|
1676
1692
|
const e = Object.keys(M);
|
|
1677
1693
|
let n = 0;
|
|
1678
1694
|
for (const r of t)
|
|
@@ -1680,19 +1696,19 @@ function gt(t) {
|
|
|
1680
1696
|
const i = Math.abs(n) % e.length;
|
|
1681
1697
|
return e[i];
|
|
1682
1698
|
}
|
|
1683
|
-
function
|
|
1699
|
+
function Yn(t, e) {
|
|
1684
1700
|
if (!t) {
|
|
1685
|
-
const i =
|
|
1701
|
+
const i = ft(e);
|
|
1686
1702
|
return M[i];
|
|
1687
1703
|
}
|
|
1688
1704
|
if (typeof t == "string" && t in M)
|
|
1689
1705
|
return M[t];
|
|
1690
1706
|
if (typeof t == "string")
|
|
1691
1707
|
return t;
|
|
1692
|
-
const n =
|
|
1708
|
+
const n = ft(e);
|
|
1693
1709
|
return M[n];
|
|
1694
1710
|
}
|
|
1695
|
-
const
|
|
1711
|
+
const X = {
|
|
1696
1712
|
ocean: {
|
|
1697
1713
|
gradient: M.ocean,
|
|
1698
1714
|
bg: "bg-cyan-600/20",
|
|
@@ -1863,93 +1879,102 @@ const Y = {
|
|
|
1863
1879
|
muted: "text-blue-400/60 dark:text-blue-300/60"
|
|
1864
1880
|
}
|
|
1865
1881
|
}
|
|
1866
|
-
},
|
|
1867
|
-
unavailable:
|
|
1868
|
-
active:
|
|
1869
|
-
inactive:
|
|
1870
|
-
success:
|
|
1871
|
-
warning:
|
|
1872
|
-
error:
|
|
1882
|
+
}, Xn = {
|
|
1883
|
+
unavailable: X.steel,
|
|
1884
|
+
active: X.ocean,
|
|
1885
|
+
inactive: X.steel,
|
|
1886
|
+
success: X.forest,
|
|
1887
|
+
warning: X.ember,
|
|
1888
|
+
error: X.rose
|
|
1873
1889
|
};
|
|
1874
|
-
let
|
|
1890
|
+
let at = null;
|
|
1875
1891
|
function cn() {
|
|
1876
|
-
return
|
|
1892
|
+
return at || (at = getComputedStyle(document.documentElement)), at;
|
|
1877
1893
|
}
|
|
1878
|
-
function
|
|
1894
|
+
function Kn(t) {
|
|
1879
1895
|
const e = t.startsWith("--") ? t : `--${t}`;
|
|
1880
1896
|
return cn().getPropertyValue(e).trim();
|
|
1881
1897
|
}
|
|
1882
|
-
function
|
|
1898
|
+
function qn() {
|
|
1883
1899
|
return document.documentElement.classList.contains("dark");
|
|
1884
1900
|
}
|
|
1885
|
-
const
|
|
1901
|
+
const Zn = "0.2.0";
|
|
1886
1902
|
export {
|
|
1887
|
-
|
|
1903
|
+
Un as GRADIENT_NAMES,
|
|
1888
1904
|
M as GRADIENT_PRESETS,
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1905
|
+
Fn as GRADIENT_PRESET_KEYS,
|
|
1906
|
+
On as Glow,
|
|
1907
|
+
tr as GridSizeSchema,
|
|
1908
|
+
er as PublishBodySchema,
|
|
1909
|
+
nr as PublishConfirmSchema,
|
|
1910
|
+
rr as PublishRequestSchema,
|
|
1911
|
+
Zn as SDK_VERSION,
|
|
1912
|
+
L as WIDGET_Z,
|
|
1893
1913
|
P as Widget,
|
|
1894
1914
|
Yt as WidgetContent,
|
|
1895
|
-
|
|
1896
|
-
|
|
1915
|
+
st as WidgetCtx,
|
|
1916
|
+
Wn as WidgetDialog,
|
|
1897
1917
|
Jt as WidgetEmptyState,
|
|
1898
1918
|
se as WidgetIcon,
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1919
|
+
ir as WidgetManifestSchema,
|
|
1920
|
+
bt as WidgetMetrics,
|
|
1921
|
+
Pt as WidgetSliderFill,
|
|
1922
|
+
Vn as WidgetStack,
|
|
1902
1923
|
fe as WidgetStatus,
|
|
1903
1924
|
xe as WidgetSubtitle,
|
|
1904
1925
|
ye as WidgetTitle,
|
|
1905
1926
|
De as WidgetValue,
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1927
|
+
Tn as allEntitiesInState,
|
|
1928
|
+
En as anyEntityInState,
|
|
1929
|
+
Sn as applyCssVars,
|
|
1930
|
+
pn as applyLayout,
|
|
1931
|
+
ot as builtInVariants,
|
|
1911
1932
|
we as calculateLightGroup,
|
|
1912
1933
|
$e as calculateSensorGroup,
|
|
1913
1934
|
Tt as classicGlass,
|
|
1914
|
-
|
|
1935
|
+
y as cn,
|
|
1915
1936
|
Ot as compactHorizontal,
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1937
|
+
kn as composeVariants,
|
|
1938
|
+
Nn as countActiveEntities,
|
|
1939
|
+
An as countAvailableEntities,
|
|
1940
|
+
_n as countEntitiesByState,
|
|
1941
|
+
Mn as createEmptyStateConfig,
|
|
1921
1942
|
xn as createEntity,
|
|
1922
|
-
|
|
1943
|
+
Cn as createFlexLayout,
|
|
1923
1944
|
vn as defineWidget,
|
|
1924
1945
|
ie as deriveAdaptiveIconColors,
|
|
1925
|
-
|
|
1946
|
+
$n as extendVariant,
|
|
1947
|
+
ar as formatSchemaError,
|
|
1926
1948
|
Se as formatValue,
|
|
1927
1949
|
Vt as getBuiltInVariant,
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1950
|
+
wn as getBuiltInVariantIds,
|
|
1951
|
+
Dn as getEntityAttribute,
|
|
1952
|
+
zn as getEntityState,
|
|
1953
|
+
Yn as getGradient,
|
|
1954
|
+
ft as getGradientFromString,
|
|
1933
1955
|
Ut as getSpacingClass,
|
|
1934
|
-
|
|
1935
|
-
|
|
1956
|
+
Kn as getThemeToken,
|
|
1957
|
+
X as gradientColorPresets,
|
|
1936
1958
|
Ce as interpretValue,
|
|
1937
|
-
|
|
1938
|
-
|
|
1959
|
+
yn as isBuiltInVariant,
|
|
1960
|
+
qn as isDark,
|
|
1939
1961
|
pe as isEntityActive,
|
|
1940
1962
|
ke as isEntityAvailable,
|
|
1941
|
-
|
|
1963
|
+
lt as mergeVariants,
|
|
1942
1964
|
Et as minimal,
|
|
1965
|
+
sr as parseGridSize,
|
|
1966
|
+
or as serializeGridSize,
|
|
1943
1967
|
N as spacing,
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1968
|
+
Xn as stateColors,
|
|
1969
|
+
H as typography,
|
|
1970
|
+
Rn as useDebugData,
|
|
1971
|
+
Gn as useWidgetConfig,
|
|
1972
|
+
G as useWidgetContext,
|
|
1973
|
+
Bn as useWidgetDialog,
|
|
1950
1974
|
Hn as useWidgetEntity,
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
jn as useWidgetResponsive
|
|
1975
|
+
Ln as useWidgetEntityGroup,
|
|
1976
|
+
Pn as useWidgetForm,
|
|
1977
|
+
In as useWidgetGestures,
|
|
1978
|
+
jn as useWidgetResponsive,
|
|
1979
|
+
bn as warnIfStub
|
|
1955
1980
|
};
|