@glasshome/widget-sdk 1.6.1 → 1.7.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/host/index.d.ts +1 -0
- package/dist/host/index.js +51 -0
- package/dist/host/instantiate-widget.d.ts +48 -0
- package/dist/index.js +317 -339
- package/dist/tokens-Bdfb1xYe.js +33 -0
- package/dist/vite/index.d.ts +18 -0
- package/dist/vite/index.js +90 -60
- package/package.json +6 -1
package/dist/index.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { n as e, r as t, t as n } from "./tokens-Bdfb1xYe.js";
|
|
2
|
+
import { deprecate as r, deprecations as i, formatDeprecation as a } from "./deprecations.js";
|
|
3
|
+
import { WidgetManifestSchema as o, formatSchemaError as s } from "./schemas.js";
|
|
4
|
+
import { z as c, z as l } from "zod";
|
|
5
|
+
import { getForecasts as u, getStream as d, getWebRtcClientConfig as f, hassMediaUrl as p, sendWebRtcCandidate as m, startWebRtcSession as h, state as g, trackEntityHistory as _, untrackEntityHistory as v } from "@glasshome/sync-layer";
|
|
6
|
+
import { byDomain as ee, useArea as y, useCamera as b, useConnection as te, useCurrency as x, useEntities as ne, useEntity as S, useEntityHistory as re, useEntityStatistics as ie, useForecast as C, useHassConfig as ae, useLocale as oe, useService as se, useStore as ce, useTemperatureUnit as le, useToggle as ue, useTurnOff as de, useTurnOn as fe, useUnitSystem as pe } from "@glasshome/sync-layer/solid";
|
|
7
|
+
import { Show as w, createEffect as T, createMemo as E, createSignal as D, on as O, onCleanup as k, onMount as me, splitProps as he, untrack as ge, useContext as A } from "solid-js";
|
|
8
|
+
import { addEventListener as j, className as M, createComponent as N, delegateEvents as _e, effect as P, insert as F, memo as I, setStyleProperty as L, style as R, template as z, use as ve } from "solid-js/web";
|
|
8
9
|
import { clsx as ye } from "clsx";
|
|
9
10
|
import { twMerge as be } from "tailwind-merge";
|
|
10
11
|
//#region src/framework/to-form-schema.ts
|
|
11
12
|
function xe(e) {
|
|
12
|
-
return
|
|
13
|
-
let t =
|
|
13
|
+
return l.toJSONSchema(e, { override: (e) => {
|
|
14
|
+
let t = l.globalRegistry.get(e.zodSchema);
|
|
14
15
|
return t && typeof t == "object" && Object.keys(t).length > 0 ? {
|
|
15
16
|
...e.jsonSchema,
|
|
16
17
|
...t
|
|
@@ -30,78 +31,50 @@ function Ce(e) {
|
|
|
30
31
|
return e.configSchema && (e.manifest.schema || (e.manifest.schema = xe(e.configSchema)), e.manifest.defaultConfig || (e.manifest.defaultConfig = Se(e.configSchema))), e;
|
|
31
32
|
}
|
|
32
33
|
//#endregion
|
|
33
|
-
//#region src/framework/hooks/use-widget-context.ts
|
|
34
|
-
var R = fe();
|
|
35
|
-
function we() {
|
|
36
|
-
let e = k(R);
|
|
37
|
-
if (!e) throw Error("useWidgetContext must be used within a Widget component");
|
|
38
|
-
return e;
|
|
39
|
-
}
|
|
40
|
-
//#endregion
|
|
41
34
|
//#region src/framework/hooks/use-service.ts
|
|
42
|
-
function
|
|
35
|
+
function we(e) {
|
|
43
36
|
let t = Array.isArray(e) ? e[0] : e, n = t?.split(".")[0];
|
|
44
37
|
if (!n) throw Error(`Invalid entity ID: ${String(t)}`);
|
|
45
38
|
return n;
|
|
46
39
|
}
|
|
47
|
-
function
|
|
48
|
-
return (n, r = {}) => e(
|
|
40
|
+
function B(e, t) {
|
|
41
|
+
return (n, r = {}) => e(we(n), t, r, { entity_id: n });
|
|
42
|
+
}
|
|
43
|
+
function Te() {
|
|
44
|
+
let t = A(e)?.callService;
|
|
45
|
+
return t ? {
|
|
46
|
+
callService: t,
|
|
47
|
+
turnOn: B(t, "turn_on"),
|
|
48
|
+
turnOff: B(t, "turn_off"),
|
|
49
|
+
toggle: B(t, "toggle")
|
|
50
|
+
} : se();
|
|
49
51
|
}
|
|
50
52
|
function Ee() {
|
|
51
|
-
let
|
|
52
|
-
return
|
|
53
|
-
callService: e,
|
|
54
|
-
turnOn: z(e, "turn_on"),
|
|
55
|
-
turnOff: z(e, "turn_off"),
|
|
56
|
-
toggle: z(e, "toggle")
|
|
57
|
-
} : S();
|
|
53
|
+
let t = A(e)?.callService;
|
|
54
|
+
return t ? B(t, "turn_on") : fe();
|
|
58
55
|
}
|
|
59
56
|
function De() {
|
|
60
|
-
let
|
|
61
|
-
return
|
|
57
|
+
let t = A(e)?.callService;
|
|
58
|
+
return t ? B(t, "turn_off") : de();
|
|
62
59
|
}
|
|
63
60
|
function Oe() {
|
|
64
|
-
let
|
|
65
|
-
return
|
|
66
|
-
}
|
|
67
|
-
function ke() {
|
|
68
|
-
let e = k(R)?.callService;
|
|
69
|
-
return e ? z(e, "toggle") : ce();
|
|
61
|
+
let t = A(e)?.callService;
|
|
62
|
+
return t ? B(t, "toggle") : ue();
|
|
70
63
|
}
|
|
71
64
|
//#endregion
|
|
72
65
|
//#region src/framework/design-system/z-index.ts
|
|
73
|
-
var
|
|
66
|
+
var V = {
|
|
74
67
|
BACKGROUND: 0,
|
|
75
68
|
CONTENT: 10,
|
|
76
69
|
OVERLAY: 20,
|
|
77
70
|
ACTIONS: 30
|
|
78
|
-
}
|
|
79
|
-
function Ne() {
|
|
80
|
-
return V || (V = new CSSStyleSheet(), V.replaceSync(Ae.replace(/:root\b/g, ":host").replace(/^\.dark\b/gm, ":host(.dark)"))), V;
|
|
81
|
-
}
|
|
82
|
-
function Pe(e) {
|
|
83
|
-
if (typeof ShadowRoot < "u" && e instanceof ShadowRoot) {
|
|
84
|
-
if (Me.has(e)) return;
|
|
85
|
-
let t = Ne();
|
|
86
|
-
e.adoptedStyleSheets.includes(t) || (e.adoptedStyleSheets = [...e.adoptedStyleSheets, t]), Me.add(e);
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
if (je) return;
|
|
90
|
-
let t = e ?? (typeof document > "u" ? void 0 : document);
|
|
91
|
-
if (!t) return;
|
|
92
|
-
if (t.head.querySelector?.("style[data-glasshome-tokens]")) {
|
|
93
|
-
je = !0;
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
let n = t.createElement("style");
|
|
97
|
-
n.setAttribute("data-glasshome-tokens", ""), n.textContent = Ae, t.head.appendChild(n), je = !0;
|
|
98
|
-
}
|
|
71
|
+
};
|
|
99
72
|
//#endregion
|
|
100
73
|
//#region src/framework/utils/cn.ts
|
|
101
74
|
function H(...e) {
|
|
102
75
|
return be(ye(e));
|
|
103
76
|
}
|
|
104
|
-
var
|
|
77
|
+
var ke = {
|
|
105
78
|
"classic-glass": {
|
|
106
79
|
id: "classic-glass",
|
|
107
80
|
name: "Classic Glass",
|
|
@@ -187,22 +160,22 @@ var Fe = {
|
|
|
187
160
|
}
|
|
188
161
|
}
|
|
189
162
|
};
|
|
190
|
-
function
|
|
191
|
-
return
|
|
163
|
+
function Ae(e) {
|
|
164
|
+
return ke[e];
|
|
192
165
|
}
|
|
193
166
|
//#endregion
|
|
194
167
|
//#region src/framework/backgrounds/WidgetSliderFill.tsx
|
|
195
|
-
var
|
|
196
|
-
function
|
|
168
|
+
var je = /*#__PURE__*/ z("<div>");
|
|
169
|
+
function Me(e) {
|
|
197
170
|
return (() => {
|
|
198
|
-
var t =
|
|
199
|
-
return
|
|
171
|
+
var t = je();
|
|
172
|
+
return P((n) => {
|
|
200
173
|
var r = H("glasshome-widget-slider-fill pointer-events-none absolute inset-0", e.isDragging ? "duration-0" : "transition-all duration-300 ease-out", e.class), i = {
|
|
201
174
|
"--widget-fill-value": e.value,
|
|
202
|
-
"z-index":
|
|
175
|
+
"z-index": V.BACKGROUND,
|
|
203
176
|
...e.color ? { "--widget-icon-color": e.color } : {}
|
|
204
177
|
};
|
|
205
|
-
return r !== n.e &&
|
|
178
|
+
return r !== n.e && M(t, n.e = r), n.t = R(t, i, n.t), n;
|
|
206
179
|
}, {
|
|
207
180
|
e: void 0,
|
|
208
181
|
t: void 0
|
|
@@ -211,37 +184,37 @@ function Re(e) {
|
|
|
211
184
|
}
|
|
212
185
|
//#endregion
|
|
213
186
|
//#region src/framework/components/WidgetContent.tsx
|
|
214
|
-
var
|
|
215
|
-
function
|
|
187
|
+
var Ne = /*#__PURE__*/ z("<div>");
|
|
188
|
+
function Pe(e) {
|
|
216
189
|
return (() => {
|
|
217
|
-
var t =
|
|
218
|
-
return
|
|
190
|
+
var t = Ne();
|
|
191
|
+
return F(t, () => e.children), P(() => M(t, H("glasshome-widget-content", e.class))), t;
|
|
219
192
|
})();
|
|
220
193
|
}
|
|
221
194
|
//#endregion
|
|
222
195
|
//#region src/framework/components/WidgetIcon.tsx
|
|
223
|
-
var
|
|
224
|
-
function
|
|
196
|
+
var Fe = /*#__PURE__*/ z("<div class=\"glasshome-widget-icon glasshome-widget-icon-stack glasshome-widget-icon-stack-2\">"), Ie = /*#__PURE__*/ z("<div class=\"glasshome-widget-icon glasshome-widget-icon-stack glasshome-widget-icon-stack-3\">"), Le = /*#__PURE__*/ z("<div><div class=\"glasshome-widget-icon-glyph flex items-center justify-center\">");
|
|
197
|
+
function Re(e) {
|
|
225
198
|
let t = () => e.entityCount ?? 1;
|
|
226
199
|
return (() => {
|
|
227
|
-
var n =
|
|
228
|
-
return
|
|
200
|
+
var n = Le(), r = n.firstChild;
|
|
201
|
+
return F(n, N(w, {
|
|
229
202
|
get when() {
|
|
230
203
|
return t() >= 2;
|
|
231
204
|
},
|
|
232
205
|
get children() {
|
|
233
|
-
return
|
|
206
|
+
return Fe();
|
|
234
207
|
}
|
|
235
|
-
}), r),
|
|
208
|
+
}), r), F(n, N(w, {
|
|
236
209
|
get when() {
|
|
237
210
|
return t() >= 3;
|
|
238
211
|
},
|
|
239
212
|
get children() {
|
|
240
|
-
return
|
|
213
|
+
return Ie();
|
|
241
214
|
}
|
|
242
|
-
}), r),
|
|
215
|
+
}), r), F(r, () => e.icon), P((t) => {
|
|
243
216
|
var r = H("glasshome-widget-icon", "relative flex shrink-0 items-center justify-center pointer-events-none transition-all", e.dimmed && "opacity-50", e.class), i = e.color ? { "--widget-icon-color": e.color } : void 0;
|
|
244
|
-
return r !== t.e &&
|
|
217
|
+
return r !== t.e && M(n, t.e = r), t.t = R(n, i, t.t), t;
|
|
245
218
|
}, {
|
|
246
219
|
e: void 0,
|
|
247
220
|
t: void 0
|
|
@@ -250,16 +223,16 @@ function We(e) {
|
|
|
250
223
|
}
|
|
251
224
|
//#endregion
|
|
252
225
|
//#region src/framework/components/WidgetStatus.tsx
|
|
253
|
-
var
|
|
254
|
-
function
|
|
226
|
+
var ze = /*#__PURE__*/ z("<p>");
|
|
227
|
+
function Be(e) {
|
|
255
228
|
return (() => {
|
|
256
|
-
var t =
|
|
257
|
-
return
|
|
258
|
-
var t =
|
|
229
|
+
var t = ze();
|
|
230
|
+
return F(t, (() => {
|
|
231
|
+
var t = I(() => !!e.isUnavailable);
|
|
259
232
|
return () => t() ? "Unavailable" : e.children;
|
|
260
|
-
})()),
|
|
261
|
-
var r = H("glasshome-widget-status", "relative", e.dimmed && "opacity-40", e.class), i =
|
|
262
|
-
return r !== n.e &&
|
|
233
|
+
})()), P((n) => {
|
|
234
|
+
var r = H("glasshome-widget-status", "relative", e.dimmed && "opacity-40", e.class), i = V.ACTIONS;
|
|
235
|
+
return r !== n.e && M(t, n.e = r), i !== n.t && L(t, "z-index", n.t = i), n;
|
|
263
236
|
}, {
|
|
264
237
|
e: void 0,
|
|
265
238
|
t: void 0
|
|
@@ -268,21 +241,21 @@ function Ke(e) {
|
|
|
268
241
|
}
|
|
269
242
|
//#endregion
|
|
270
243
|
//#region src/framework/components/WidgetTitle.tsx
|
|
271
|
-
var
|
|
272
|
-
function
|
|
244
|
+
var Ve = /*#__PURE__*/ z("<span class=\"glasshome-widget-badge shrink-0\">"), He = /*#__PURE__*/ z("<div><h3 class=glasshome-widget-title>");
|
|
245
|
+
function Ue(e) {
|
|
273
246
|
return (() => {
|
|
274
|
-
var t =
|
|
275
|
-
return
|
|
247
|
+
var t = He(), n = t.firstChild;
|
|
248
|
+
return F(n, () => e.children), F(t, N(w, {
|
|
276
249
|
get when() {
|
|
277
|
-
return
|
|
250
|
+
return I(() => e.badge !== void 0)() && e.badge > 0;
|
|
278
251
|
},
|
|
279
252
|
get children() {
|
|
280
|
-
var t =
|
|
281
|
-
return
|
|
253
|
+
var t = Ve();
|
|
254
|
+
return F(t, () => e.badge), t;
|
|
282
255
|
}
|
|
283
|
-
}), null),
|
|
284
|
-
var r = H("relative flex items-center gap-2", e.class), i =
|
|
285
|
-
return r !== n.e &&
|
|
256
|
+
}), null), P((n) => {
|
|
257
|
+
var r = H("relative flex items-center gap-2", e.class), i = V.ACTIONS;
|
|
258
|
+
return r !== n.e && M(t, n.e = r), i !== n.t && L(t, "z-index", n.t = i), n;
|
|
286
259
|
}, {
|
|
287
260
|
e: void 0,
|
|
288
261
|
t: void 0
|
|
@@ -291,7 +264,7 @@ function Ye(e) {
|
|
|
291
264
|
}
|
|
292
265
|
//#endregion
|
|
293
266
|
//#region src/framework/utils/entity-aggregation.ts
|
|
294
|
-
function
|
|
267
|
+
function We(e, t = !1) {
|
|
295
268
|
if (e.length === 0) return {
|
|
296
269
|
isGroup: !1,
|
|
297
270
|
state: "unknown",
|
|
@@ -314,7 +287,7 @@ function Xe(e, t = !1) {
|
|
|
314
287
|
isUnavailable: t.state === "unavailable",
|
|
315
288
|
brightness: r,
|
|
316
289
|
brightnessPercent: i,
|
|
317
|
-
color:
|
|
290
|
+
color: qe(t),
|
|
318
291
|
onCount: +!!n,
|
|
319
292
|
totalCount: 1,
|
|
320
293
|
description: n ? "On" : "Off"
|
|
@@ -326,7 +299,7 @@ function Xe(e, t = !1) {
|
|
|
326
299
|
if (r++, t.attributes?.brightness !== void 0 && (s += t.attributes.brightness, c++), t.attributes?.rgb_color) l.push(t.attributes.rgb_color);
|
|
327
300
|
else if (t.attributes?.hs_color) {
|
|
328
301
|
let [e, n] = t.attributes.hs_color;
|
|
329
|
-
l.push(
|
|
302
|
+
l.push(Ke(e, n));
|
|
330
303
|
}
|
|
331
304
|
break;
|
|
332
305
|
case "off":
|
|
@@ -345,7 +318,7 @@ function Xe(e, t = !1) {
|
|
|
345
318
|
if (l.length > 0) {
|
|
346
319
|
let e = Math.round(l.reduce((e, t) => e + t[0], 0) / l.length), t = Math.round(l.reduce((e, t) => e + t[1], 0) / l.length), n = Math.round(l.reduce((e, t) => e + t[2], 0) / l.length), r = v / 255;
|
|
347
320
|
y = `rgb(${Math.round(e * r)}, ${Math.round(t * r)}, ${Math.round(n * r)})`;
|
|
348
|
-
} else y =
|
|
321
|
+
} else y = qe(e[0]);
|
|
349
322
|
let b;
|
|
350
323
|
return b = m ? "All on" : h ? "All off" : r > 0 ? `${r} of ${u} on` : "Off", {
|
|
351
324
|
isGroup: n,
|
|
@@ -360,7 +333,7 @@ function Xe(e, t = !1) {
|
|
|
360
333
|
description: b
|
|
361
334
|
};
|
|
362
335
|
}
|
|
363
|
-
function
|
|
336
|
+
function Ge(e, t = "mean", n = !0) {
|
|
364
337
|
if (e.length === 0) return {
|
|
365
338
|
isGroup: !1,
|
|
366
339
|
state: "unknown",
|
|
@@ -456,7 +429,7 @@ function Ze(e, t = "mean", n = !0) {
|
|
|
456
429
|
memberValues: a
|
|
457
430
|
};
|
|
458
431
|
}
|
|
459
|
-
function
|
|
432
|
+
function Ke(e, t) {
|
|
460
433
|
let n = t / 100, r = n * (1 - Math.abs(e / 60 % 2 - 1)), i = 1 - n, a = 0, o = 0, s = 0;
|
|
461
434
|
return e < 60 ? [a, o] = [n, r] : e < 120 ? [a, o] = [r, n] : e < 180 ? [o, s] = [n, r] : e < 240 ? [o, s] = [r, n] : e < 300 ? [a, s] = [r, n] : [a, s] = [n, r], [
|
|
462
435
|
(a + i) * 255,
|
|
@@ -464,7 +437,7 @@ function Qe(e, t) {
|
|
|
464
437
|
(s + i) * 255
|
|
465
438
|
];
|
|
466
439
|
}
|
|
467
|
-
function
|
|
440
|
+
function qe(e) {
|
|
468
441
|
if (e.state !== "on") return "rgb(100, 100, 100)";
|
|
469
442
|
let t = (e.attributes?.brightness ?? 255) / 255;
|
|
470
443
|
if (e.attributes?.rgb_color) {
|
|
@@ -472,7 +445,7 @@ function $e(e) {
|
|
|
472
445
|
return `rgb(${Math.round(n * t)}, ${Math.round(r * t)}, ${Math.round(i * t)})`;
|
|
473
446
|
}
|
|
474
447
|
if (e.attributes?.hs_color) {
|
|
475
|
-
let [n, r] = e.attributes.hs_color, [i, a, o] =
|
|
448
|
+
let [n, r] = e.attributes.hs_color, [i, a, o] = Ke(n, r);
|
|
476
449
|
return `rgb(${Math.round(i * t)}, ${Math.round(a * t)}, ${Math.round(o * t)})`;
|
|
477
450
|
}
|
|
478
451
|
if (e.attributes?.color_temp) {
|
|
@@ -483,7 +456,7 @@ function $e(e) {
|
|
|
483
456
|
}
|
|
484
457
|
//#endregion
|
|
485
458
|
//#region src/framework/utils/entity-state.ts
|
|
486
|
-
function
|
|
459
|
+
function Je(e) {
|
|
487
460
|
if (!e) return !1;
|
|
488
461
|
if ([
|
|
489
462
|
"on",
|
|
@@ -499,15 +472,15 @@ function et(e) {
|
|
|
499
472
|
}
|
|
500
473
|
return !1;
|
|
501
474
|
}
|
|
502
|
-
function
|
|
475
|
+
function Ye(e, t, n) {
|
|
503
476
|
return e?.attributes ? e.attributes[t] ?? n : n;
|
|
504
477
|
}
|
|
505
|
-
function
|
|
506
|
-
return e.filter(
|
|
478
|
+
function Xe(e) {
|
|
479
|
+
return e.filter(Je).length;
|
|
507
480
|
}
|
|
508
481
|
//#endregion
|
|
509
482
|
//#region src/framework/utils/format-value.ts
|
|
510
|
-
function
|
|
483
|
+
function Ze(e, t, n) {
|
|
511
484
|
let { decimals: r, scale: i = !0 } = n || {};
|
|
512
485
|
if (typeof e == "string") return t ? `${e}${t}` : e;
|
|
513
486
|
if (e == null || Number.isNaN(e)) return t ? `--${t}` : "--";
|
|
@@ -518,41 +491,41 @@ function rt(e, t, n) {
|
|
|
518
491
|
}
|
|
519
492
|
//#endregion
|
|
520
493
|
//#region src/framework/utils/interpret-value.ts
|
|
521
|
-
function
|
|
494
|
+
function Qe(e, t) {
|
|
522
495
|
return e == null || isNaN(e) ? null : t === "°C" ? e < 10 ? "Cold" : e < 18 ? "Cool" : e < 24 ? "Comfortable" : e < 28 ? "Warm" : "Hot" : t === "°F" ? e < 50 ? "Cold" : e < 64 ? "Cool" : e < 75 ? "Comfortable" : e < 82 ? "Warm" : "Hot" : t === "%" ? e < 20 ? "Very Low" : e < 40 ? "Low" : e < 60 ? "Medium" : e < 80 ? "High" : "Very High" : t === "ppm" ? e < 400 ? "Excellent" : e < 600 ? "Good" : e < 1e3 ? "Acceptable" : e < 1500 ? "Mediocre" : "Poor" : t === "lx" ? e < 50 ? "Dark" : e < 200 ? "Dim" : e < 500 ? "Moderate" : e < 1e3 ? "Bright" : "Very Bright" : t === "AQI" ? e <= 50 ? "Good" : e <= 100 ? "Moderate" : e <= 150 ? "Unhealthy for Sensitive" : e <= 200 ? "Unhealthy" : e <= 300 ? "Very Unhealthy" : "Hazardous" : t === "dB" ? e < 30 ? "Very Quiet" : e < 50 ? "Quiet" : e < 70 ? "Moderate" : e < 85 ? "Loud" : "Very Loud" : null;
|
|
523
496
|
}
|
|
524
497
|
//#endregion
|
|
525
498
|
//#region src/framework/components/WidgetValue.tsx
|
|
526
|
-
var
|
|
527
|
-
function
|
|
499
|
+
var $e = /*#__PURE__*/ z("<div class=glasshome-widget-subtitle>"), et = /*#__PURE__*/ z("<div><div class=glasshome-widget-value>");
|
|
500
|
+
function tt(e) {
|
|
528
501
|
return (() => {
|
|
529
|
-
var t =
|
|
530
|
-
return
|
|
502
|
+
var t = et(), n = t.firstChild;
|
|
503
|
+
return F(n, () => Ze(e.value, e.unit)), F(t, N(w, {
|
|
531
504
|
get when() {
|
|
532
|
-
return
|
|
505
|
+
return I(() => !!e.interpret)() && typeof e.value == "number";
|
|
533
506
|
},
|
|
534
507
|
get children() {
|
|
535
|
-
var t =
|
|
536
|
-
return
|
|
508
|
+
var t = $e();
|
|
509
|
+
return F(t, () => Qe(e.value, e.unit)), t;
|
|
537
510
|
}
|
|
538
|
-
}), null),
|
|
511
|
+
}), null), P(() => M(t, H("flex flex-col", e.class))), t;
|
|
539
512
|
})();
|
|
540
513
|
}
|
|
541
514
|
//#endregion
|
|
542
515
|
//#region src/framework/core/Widget.tsx
|
|
543
|
-
var
|
|
544
|
-
function
|
|
545
|
-
let
|
|
516
|
+
var nt = /*#__PURE__*/ z("<div><div class=\"relative h-full w-full\">"), rt = /*#__PURE__*/ z("<div class=\"glasshome-widget-loading pointer-events-none absolute inset-0 animate-pulse\">"), it = /*#__PURE__*/ z("<div class=\"flex h-full w-full flex-col items-center justify-center gap-2 text-center\">"), at = /*#__PURE__*/ z("<div class=\"flex items-center justify-center text-white/30\">"), ot = /*#__PURE__*/ z("<h3 class=\"font-semibold text-sm text-white/60\">"), st = /*#__PURE__*/ z("<p class=\"text-white/50 text-xs\">");
|
|
517
|
+
function ct(t) {
|
|
518
|
+
let r = A(e), [i, a] = D(), [o, s] = D({
|
|
546
519
|
width: 0,
|
|
547
520
|
height: 0
|
|
548
521
|
});
|
|
549
|
-
|
|
550
|
-
let e =
|
|
522
|
+
T(() => {
|
|
523
|
+
let e = i();
|
|
551
524
|
if (!e) return;
|
|
552
525
|
let t = new ResizeObserver(([e]) => {
|
|
553
526
|
if (!e) return;
|
|
554
527
|
let t = e.borderBoxSize?.[0];
|
|
555
|
-
|
|
528
|
+
s(t ? {
|
|
556
529
|
width: t.inlineSize,
|
|
557
530
|
height: t.blockSize
|
|
558
531
|
} : {
|
|
@@ -560,131 +533,131 @@ function mt(e) {
|
|
|
560
533
|
height: e.contentRect.height
|
|
561
534
|
});
|
|
562
535
|
});
|
|
563
|
-
t.observe(e),
|
|
564
|
-
}),
|
|
565
|
-
let e =
|
|
566
|
-
|
|
536
|
+
t.observe(e), k(() => t.disconnect());
|
|
537
|
+
}), me(() => {
|
|
538
|
+
let e = i()?.getRootNode();
|
|
539
|
+
n(typeof ShadowRoot < "u" && e instanceof ShadowRoot || typeof Document < "u" && e instanceof Document ? e : void 0);
|
|
567
540
|
});
|
|
568
|
-
let
|
|
569
|
-
isEditMode: () =>
|
|
570
|
-
updateConfig:
|
|
571
|
-
registerDialogOpener:
|
|
572
|
-
callService:
|
|
573
|
-
dimensions: () =>
|
|
574
|
-
},
|
|
575
|
-
if (
|
|
576
|
-
}),
|
|
541
|
+
let c = {
|
|
542
|
+
isEditMode: () => t.isEditMode ?? !1,
|
|
543
|
+
updateConfig: r?.updateConfig ?? (() => {}),
|
|
544
|
+
registerDialogOpener: r?.registerDialogOpener,
|
|
545
|
+
callService: r?.callService,
|
|
546
|
+
dimensions: () => o()
|
|
547
|
+
}, l = E(() => {
|
|
548
|
+
if (t.variant) return typeof t.variant == "string" ? Ae(t.variant) : t.variant;
|
|
549
|
+
}), u = E(() => ({
|
|
577
550
|
"container-type": "size",
|
|
578
551
|
"container-name": "widget",
|
|
579
|
-
"touch-action":
|
|
580
|
-
...
|
|
581
|
-
...
|
|
582
|
-
...
|
|
583
|
-
...
|
|
584
|
-
...
|
|
585
|
-
...
|
|
586
|
-
})),
|
|
587
|
-
|
|
588
|
-
},
|
|
589
|
-
|
|
590
|
-
},
|
|
591
|
-
|
|
592
|
-
},
|
|
593
|
-
|
|
594
|
-
},
|
|
595
|
-
|
|
552
|
+
"touch-action": t.gestures && !t.isEditMode ? t.gestures.touchAction() : void 0,
|
|
553
|
+
...l()?.styles?.container,
|
|
554
|
+
...l()?.styles?.cssVars || {},
|
|
555
|
+
...t.tone ? { "--widget-color": `var(--tone-${t.tone})` } : {},
|
|
556
|
+
...t.color ? { "--widget-color": t.color } : {},
|
|
557
|
+
...t.colorTo ? { "--widget-color-to": t.colorTo } : {},
|
|
558
|
+
...t.gradient ? { "--widget-gradient": t.gradient } : {}
|
|
559
|
+
})), d = () => !!t.gestures && !t.isEditMode, f = (e) => {
|
|
560
|
+
d() && t.gestures?.onPointerEnter(e);
|
|
561
|
+
}, p = (e) => {
|
|
562
|
+
d() && t.gestures?.onPointerDown(e);
|
|
563
|
+
}, m = (e) => {
|
|
564
|
+
d() && t.gestures?.onPointerMove(e);
|
|
565
|
+
}, h = (e) => {
|
|
566
|
+
d() && t.gestures?.onPointerUp(e);
|
|
567
|
+
}, g = (e) => {
|
|
568
|
+
d() && t.gestures?.onPointerCancel(e);
|
|
596
569
|
};
|
|
597
|
-
return
|
|
598
|
-
value:
|
|
570
|
+
return N(e.Provider, {
|
|
571
|
+
value: c,
|
|
599
572
|
get children() {
|
|
600
|
-
var
|
|
601
|
-
return
|
|
602
|
-
|
|
603
|
-
},
|
|
604
|
-
var
|
|
605
|
-
return () =>
|
|
573
|
+
var e = nt(), n = e.firstChild;
|
|
574
|
+
return j(e, "pointercancel", g), j(e, "pointerup", h), j(e, "pointermove", m), j(e, "pointerdown", p), j(e, "pointerenter", f), ve((e) => {
|
|
575
|
+
a(e), t.gestures?.bindElement(e);
|
|
576
|
+
}, e), F(n, (() => {
|
|
577
|
+
var e = I(() => !!t.emptyState);
|
|
578
|
+
return () => e() ? N(lt, {
|
|
606
579
|
get icon() {
|
|
607
|
-
return
|
|
580
|
+
return t.emptyState.icon;
|
|
608
581
|
},
|
|
609
582
|
get title() {
|
|
610
|
-
return
|
|
583
|
+
return t.emptyState.title;
|
|
611
584
|
},
|
|
612
585
|
get message() {
|
|
613
|
-
return
|
|
586
|
+
return t.emptyState.message;
|
|
614
587
|
}
|
|
615
|
-
}) :
|
|
616
|
-
})()),
|
|
617
|
-
var
|
|
618
|
-
return () =>
|
|
619
|
-
var e =
|
|
620
|
-
return
|
|
588
|
+
}) : t.children;
|
|
589
|
+
})()), F(e, (() => {
|
|
590
|
+
var e = I(() => !!t.loading);
|
|
591
|
+
return () => e() && (() => {
|
|
592
|
+
var e = rt();
|
|
593
|
+
return P((t) => L(e, "z-index", V.OVERLAY)), e;
|
|
621
594
|
})();
|
|
622
|
-
})(), null),
|
|
623
|
-
var i = H("glasshome-widget", "relative h-full w-full select-none overflow-hidden rounded-xl border border-border/50",
|
|
624
|
-
return i !== r.e &&
|
|
595
|
+
})(), null), P((r) => {
|
|
596
|
+
var i = H("glasshome-widget", "relative h-full w-full select-none overflow-hidden rounded-xl border border-border/50", l()?.styles?.class, t.class), a = u(), o = V.CONTENT;
|
|
597
|
+
return i !== r.e && M(e, r.e = i), r.t = R(e, a, r.t), o !== r.a && L(n, "z-index", r.a = o), r;
|
|
625
598
|
}, {
|
|
626
599
|
e: void 0,
|
|
627
600
|
t: void 0,
|
|
628
601
|
a: void 0
|
|
629
|
-
}),
|
|
602
|
+
}), e;
|
|
630
603
|
}
|
|
631
604
|
});
|
|
632
605
|
}
|
|
633
|
-
function
|
|
606
|
+
function lt(e) {
|
|
634
607
|
return (() => {
|
|
635
|
-
var t =
|
|
636
|
-
return
|
|
637
|
-
var t =
|
|
608
|
+
var t = it();
|
|
609
|
+
return F(t, (() => {
|
|
610
|
+
var t = I(() => !!e.icon);
|
|
638
611
|
return () => t() && (() => {
|
|
639
|
-
var t =
|
|
640
|
-
return
|
|
612
|
+
var t = at();
|
|
613
|
+
return F(t, () => e.icon), t;
|
|
641
614
|
})();
|
|
642
|
-
})(), null),
|
|
643
|
-
var t =
|
|
615
|
+
})(), null), F(t, (() => {
|
|
616
|
+
var t = I(() => !!e.title);
|
|
644
617
|
return () => t() && (() => {
|
|
645
|
-
var t =
|
|
646
|
-
return
|
|
618
|
+
var t = ot();
|
|
619
|
+
return F(t, () => e.title), t;
|
|
647
620
|
})();
|
|
648
|
-
})(), null),
|
|
649
|
-
var t =
|
|
621
|
+
})(), null), F(t, (() => {
|
|
622
|
+
var t = I(() => !!e.message);
|
|
650
623
|
return () => t() && (() => {
|
|
651
|
-
var t =
|
|
652
|
-
return
|
|
624
|
+
var t = st();
|
|
625
|
+
return F(t, () => e.message), t;
|
|
653
626
|
})();
|
|
654
627
|
})(), null), t;
|
|
655
628
|
})();
|
|
656
629
|
}
|
|
657
|
-
var U =
|
|
658
|
-
U.Content =
|
|
630
|
+
var U = ct;
|
|
631
|
+
U.Content = Pe, U.Icon = Re, U.Title = Ue, U.Status = Be, U.Value = tt, U.SliderFill = Me;
|
|
659
632
|
//#endregion
|
|
660
633
|
//#region src/framework/dialogs/WidgetDialog.tsx
|
|
661
|
-
var
|
|
662
|
-
function
|
|
634
|
+
var ut = /*#__PURE__*/ z("<span class=\"inline-flex size-3.5 shrink-0 items-center\">"), dt = /*#__PURE__*/ z("<button type=button>"), ft = /*#__PURE__*/ z("<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\">"), pt = /*#__PURE__*/ z("<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"), mt = /*#__PURE__*/ z("<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>"), ht = /*#__PURE__*/ z("<div class=\"rounded-lg bg-muted/30 p-2 text-center md:p-6\"><p class=\"text-muted-foreground text-sm\">No additional controls"), gt = /*#__PURE__*/ z("<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\">"), _t = /*#__PURE__*/ z("<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"), vt = /*#__PURE__*/ z("<div class=\"min-w-0 shrink-0\">"), yt = /*#__PURE__*/ z("<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\">"), bt = /*#__PURE__*/ z("<div class=\"gh-scroll min-h-0 flex-1 overflow-y-auto px-6\">"), xt = /*#__PURE__*/ z("<div class=\"flex shrink-0 items-center justify-end gap-2 border-border/50 border-t px-6 pt-3\">");
|
|
635
|
+
function St(e) {
|
|
663
636
|
return (() => {
|
|
664
|
-
var t =
|
|
665
|
-
return t.$$click = () => e.onClick(),
|
|
637
|
+
var t = dt();
|
|
638
|
+
return t.$$click = () => e.onClick(), F(t, N(w, {
|
|
666
639
|
get when() {
|
|
667
640
|
return e.isActive;
|
|
668
641
|
},
|
|
669
642
|
get children() {
|
|
670
|
-
var t =
|
|
671
|
-
return
|
|
643
|
+
var t = ut();
|
|
644
|
+
return F(t, () => e.icon), t;
|
|
672
645
|
}
|
|
673
|
-
}), null),
|
|
646
|
+
}), null), F(t, () => e.label, null), P(() => M(t, H("flex cursor-pointer items-center justify-center rounded-md px-3 py-1.5 text-xs transition-all duration-300 ease-in-out", e.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"))), t;
|
|
674
647
|
})();
|
|
675
648
|
}
|
|
676
|
-
function
|
|
677
|
-
let [t] =
|
|
678
|
-
|
|
649
|
+
function Ct(e) {
|
|
650
|
+
let [t] = he(e, /* @__PURE__ */ "open.onOpenChange.title.onSave.hasUnsavedChanges.onDelete.editContent.controlsContent.debugContent.debugData.tabs.class.maxWidth.defaultTab.activeTab.onActiveTabChange.headerActions.configSchema.config.onConfigSave.ResponsiveDialog.ResponsiveDialogContent.ResponsiveDialogHeader.ResponsiveDialogTitle.ResponsiveDialogDescription.Button.SchemaForm".split(".")), n = () => !!t.configSchema && !!t.config && !!t.onConfigSave && !!t.SchemaForm, [r, i] = D({}), [a, o] = D(null);
|
|
651
|
+
T(O(() => t.config, (e) => {
|
|
679
652
|
e && i({ ...e });
|
|
680
|
-
})),
|
|
653
|
+
})), T(O(() => t.configSchema, (e) => {
|
|
681
654
|
e && o(xe(e));
|
|
682
655
|
}));
|
|
683
656
|
let s = () => n() && JSON.stringify(r()) !== JSON.stringify(t.config), c = (e) => {
|
|
684
657
|
!e && t.config && i({ ...t.config }), t.onOpenChange(e);
|
|
685
658
|
}, l = () => {
|
|
686
659
|
t.onConfigSave?.(r());
|
|
687
|
-
}, [u, d] =
|
|
660
|
+
}, [u, d] = D(t.defaultTab ?? "controls"), f = () => t.activeTab ?? u(), p = (e) => {
|
|
688
661
|
t.onActiveTabChange ? t.onActiveTabChange(e) : d(e);
|
|
689
662
|
}, m = () => ({
|
|
690
663
|
sm: "max-w-sm",
|
|
@@ -700,26 +673,26 @@ function kt(e) {
|
|
|
700
673
|
return e.push({
|
|
701
674
|
id: "edit",
|
|
702
675
|
label: "Edit",
|
|
703
|
-
icon:
|
|
704
|
-
content: t.editContent ?? (n() && a() ?
|
|
676
|
+
icon: ft(),
|
|
677
|
+
content: t.editContent ?? (n() && a() ? N(ne, {
|
|
705
678
|
get schema() {
|
|
706
679
|
return a();
|
|
707
680
|
},
|
|
708
681
|
get data() {
|
|
709
|
-
return
|
|
682
|
+
return ge(r);
|
|
710
683
|
},
|
|
711
684
|
onChange: i
|
|
712
|
-
}) :
|
|
685
|
+
}) : pt())
|
|
713
686
|
}), e.push({
|
|
714
687
|
id: "controls",
|
|
715
688
|
label: "Controls",
|
|
716
|
-
icon:
|
|
717
|
-
content: t.controlsContent ??
|
|
689
|
+
icon: mt(),
|
|
690
|
+
content: t.controlsContent ?? ht()
|
|
718
691
|
}), e.push({
|
|
719
692
|
id: "debug",
|
|
720
693
|
label: "Debug",
|
|
721
|
-
icon:
|
|
722
|
-
content: t.debugContent ??
|
|
694
|
+
icon: gt(),
|
|
695
|
+
content: t.debugContent ?? _t()
|
|
723
696
|
}), e;
|
|
724
697
|
}, g = async () => {
|
|
725
698
|
if (t.debugData !== void 0) try {
|
|
@@ -727,43 +700,43 @@ function kt(e) {
|
|
|
727
700
|
await navigator.clipboard.writeText(e);
|
|
728
701
|
} catch {}
|
|
729
702
|
}, _ = () => {
|
|
730
|
-
let e =
|
|
703
|
+
let e = S();
|
|
731
704
|
return e.find((e) => e.id === f())?.content ?? e[0]?.content;
|
|
732
|
-
}, v = t.ResponsiveDialog, ee = t.ResponsiveDialogContent, y = t.ResponsiveDialogHeader, b = t.ResponsiveDialogTitle, te = t.ResponsiveDialogDescription, x = t.Button, ne = t.SchemaForm,
|
|
705
|
+
}, v = t.ResponsiveDialog, ee = t.ResponsiveDialogContent, y = t.ResponsiveDialogHeader, b = t.ResponsiveDialogTitle, te = t.ResponsiveDialogDescription, x = t.Button, ne = t.SchemaForm, S = E(O([
|
|
733
706
|
() => t.open,
|
|
734
707
|
a,
|
|
735
708
|
() => t.config,
|
|
736
709
|
() => t.tabs
|
|
737
|
-
], () => h())),
|
|
738
|
-
return
|
|
710
|
+
], () => h())), re = (e) => n() ? c(e) : t.onOpenChange(e), ie = () => n() ? s() : t.hasUnsavedChanges, C = () => n() ? l : t.onSave;
|
|
711
|
+
return N(v, {
|
|
739
712
|
get open() {
|
|
740
713
|
return t.open;
|
|
741
714
|
},
|
|
742
|
-
onOpenChange: (e) =>
|
|
715
|
+
onOpenChange: (e) => re(e),
|
|
743
716
|
get children() {
|
|
744
|
-
return
|
|
717
|
+
return N(ee, {
|
|
745
718
|
get class() {
|
|
746
719
|
return H(m(), "px-0", t.class);
|
|
747
720
|
},
|
|
748
721
|
get children() {
|
|
749
722
|
return [
|
|
750
|
-
|
|
723
|
+
N(y, {
|
|
751
724
|
class: "flex flex-row items-center justify-between gap-3 px-6",
|
|
752
725
|
get children() {
|
|
753
726
|
return [(() => {
|
|
754
|
-
var e =
|
|
755
|
-
return
|
|
727
|
+
var e = vt();
|
|
728
|
+
return F(e, N(b, {
|
|
756
729
|
class: "truncate leading-tight",
|
|
757
730
|
get children() {
|
|
758
731
|
return t.title;
|
|
759
732
|
}
|
|
760
|
-
}), null),
|
|
733
|
+
}), null), F(e, N(te, {
|
|
761
734
|
class: "sr-only",
|
|
762
735
|
children: "Widget configuration dialog"
|
|
763
736
|
}), null), e;
|
|
764
737
|
})(), (() => {
|
|
765
|
-
var e =
|
|
766
|
-
return
|
|
738
|
+
var e = yt(), n = e.firstChild;
|
|
739
|
+
return F(n, () => S().map((e) => N(St, {
|
|
767
740
|
get icon() {
|
|
768
741
|
return e.icon;
|
|
769
742
|
},
|
|
@@ -774,7 +747,7 @@ function kt(e) {
|
|
|
774
747
|
return f() === e.id;
|
|
775
748
|
},
|
|
776
749
|
onClick: () => p(e.id)
|
|
777
|
-
}))),
|
|
750
|
+
}))), F(e, N(w, {
|
|
778
751
|
get when() {
|
|
779
752
|
return t.headerActions;
|
|
780
753
|
},
|
|
@@ -786,47 +759,47 @@ function kt(e) {
|
|
|
786
759
|
}
|
|
787
760
|
}),
|
|
788
761
|
(() => {
|
|
789
|
-
var e =
|
|
790
|
-
return
|
|
762
|
+
var e = bt();
|
|
763
|
+
return F(e, _), e;
|
|
791
764
|
})(),
|
|
792
|
-
|
|
765
|
+
N(w, {
|
|
793
766
|
get when() {
|
|
794
|
-
return
|
|
767
|
+
return I(() => f() === "edit")() && (C() || t.onDelete) || f() === "debug" && t.debugData !== void 0;
|
|
795
768
|
},
|
|
796
769
|
get children() {
|
|
797
|
-
var e =
|
|
798
|
-
return
|
|
770
|
+
var e = xt();
|
|
771
|
+
return F(e, N(w, {
|
|
799
772
|
get when() {
|
|
800
|
-
return
|
|
773
|
+
return I(() => f() === "edit")() && t.onDelete;
|
|
801
774
|
},
|
|
802
775
|
get children() {
|
|
803
|
-
return
|
|
776
|
+
return N(x, {
|
|
804
777
|
size: "sm",
|
|
805
778
|
variant: "destructive",
|
|
806
779
|
onClick: () => t.onDelete?.(),
|
|
807
780
|
children: "Delete"
|
|
808
781
|
});
|
|
809
782
|
}
|
|
810
|
-
}), null),
|
|
783
|
+
}), null), F(e, N(w, {
|
|
811
784
|
get when() {
|
|
812
|
-
return
|
|
785
|
+
return I(() => f() === "edit")() && C();
|
|
813
786
|
},
|
|
814
787
|
get children() {
|
|
815
|
-
return
|
|
788
|
+
return N(x, {
|
|
816
789
|
size: "sm",
|
|
817
790
|
get disabled() {
|
|
818
|
-
return !
|
|
791
|
+
return !ie();
|
|
819
792
|
},
|
|
820
|
-
onClick: () =>
|
|
793
|
+
onClick: () => C()?.(),
|
|
821
794
|
children: "Save"
|
|
822
795
|
});
|
|
823
796
|
}
|
|
824
|
-
}), null),
|
|
797
|
+
}), null), F(e, N(w, {
|
|
825
798
|
get when() {
|
|
826
|
-
return
|
|
799
|
+
return I(() => f() === "debug")() && t.debugData !== void 0;
|
|
827
800
|
},
|
|
828
801
|
get children() {
|
|
829
|
-
return
|
|
802
|
+
return N(x, {
|
|
830
803
|
size: "sm",
|
|
831
804
|
variant: "outline",
|
|
832
805
|
onClick: g,
|
|
@@ -842,63 +815,63 @@ function kt(e) {
|
|
|
842
815
|
}
|
|
843
816
|
});
|
|
844
817
|
}
|
|
845
|
-
|
|
818
|
+
_e(["click"]);
|
|
846
819
|
//#endregion
|
|
847
820
|
//#region src/framework/hooks/use-intersection-pause.ts
|
|
848
|
-
function
|
|
821
|
+
function wt(e) {
|
|
849
822
|
if (typeof IntersectionObserver > "u") return () => !1;
|
|
850
|
-
let [t, n] =
|
|
823
|
+
let [t, n] = D(!1), r = new IntersectionObserver((e) => {
|
|
851
824
|
let t = e[0];
|
|
852
825
|
t && n(!t.isIntersecting);
|
|
853
826
|
});
|
|
854
|
-
return
|
|
827
|
+
return T(() => {
|
|
855
828
|
let t = e();
|
|
856
829
|
r.disconnect(), t && r.observe(t);
|
|
857
|
-
}),
|
|
830
|
+
}), k(() => r.disconnect()), t;
|
|
858
831
|
}
|
|
859
832
|
//#endregion
|
|
860
833
|
//#region src/framework/hooks/use-reduced-motion.ts
|
|
861
|
-
function
|
|
834
|
+
function Tt() {
|
|
862
835
|
if (typeof window > "u" || typeof window.matchMedia != "function") return () => !1;
|
|
863
|
-
let e = window.matchMedia("(prefers-reduced-motion: reduce)"), [t, n] =
|
|
864
|
-
return e.addEventListener("change", r),
|
|
836
|
+
let e = window.matchMedia("(prefers-reduced-motion: reduce)"), [t, n] = D(e.matches), r = (e) => n(e.matches);
|
|
837
|
+
return e.addEventListener("change", r), k(() => e.removeEventListener("change", r)), t;
|
|
865
838
|
}
|
|
866
839
|
//#endregion
|
|
867
840
|
//#region src/framework/hooks/use-widget-dialog.ts
|
|
868
|
-
function
|
|
869
|
-
let [
|
|
870
|
-
|
|
871
|
-
},
|
|
872
|
-
return
|
|
873
|
-
showDialog:
|
|
874
|
-
setShowDialog:
|
|
875
|
-
openDialog:
|
|
876
|
-
closeDialog: () =>
|
|
877
|
-
activeTab:
|
|
878
|
-
setActiveTab:
|
|
841
|
+
function Et(t = "controls") {
|
|
842
|
+
let [n, r] = D(!1), [i, a] = D(t), o = (e) => {
|
|
843
|
+
a(e ?? t), r(!0);
|
|
844
|
+
}, s = A(e);
|
|
845
|
+
return s?.registerDialogOpener?.(o), k(() => s?.registerDialogOpener?.(null)), {
|
|
846
|
+
showDialog: n,
|
|
847
|
+
setShowDialog: r,
|
|
848
|
+
openDialog: o,
|
|
849
|
+
closeDialog: () => r(!1),
|
|
850
|
+
activeTab: i,
|
|
851
|
+
setActiveTab: a,
|
|
879
852
|
dialogProps: {
|
|
880
853
|
get open() {
|
|
881
|
-
return
|
|
854
|
+
return n();
|
|
882
855
|
},
|
|
883
|
-
onOpenChange:
|
|
856
|
+
onOpenChange: r,
|
|
884
857
|
get activeTab() {
|
|
885
|
-
return
|
|
858
|
+
return i();
|
|
886
859
|
},
|
|
887
|
-
onActiveTabChange:
|
|
860
|
+
onActiveTabChange: a
|
|
888
861
|
}
|
|
889
862
|
};
|
|
890
863
|
}
|
|
891
864
|
//#endregion
|
|
892
865
|
//#region src/framework/hooks/use-widget-entity-group.ts
|
|
893
|
-
function
|
|
894
|
-
let t = e.minEntities ?? 1, n =
|
|
866
|
+
function Dt(e) {
|
|
867
|
+
let t = e.minEntities ?? 1, n = E(() => e.entities().length), r = E(() => n() >= t), i = E(() => !r() || !e.calculateGroupData ? null : e.calculateGroupData(e.entities())), a = E(() => {
|
|
895
868
|
if (!r()) return;
|
|
896
869
|
let t = e.aggregationMode?.();
|
|
897
870
|
if (!t || t === "none") return;
|
|
898
871
|
let n = e.entities();
|
|
899
|
-
if (t === "light" || t === "binary-sensor" || t === "switch") return
|
|
900
|
-
if (t === "sensor") return
|
|
901
|
-
}), o =
|
|
872
|
+
if (t === "light" || t === "binary-sensor" || t === "switch") return We(n, e.allEntitiesMode);
|
|
873
|
+
if (t === "sensor") return Ge(n, e.sensorGroupType?.() ?? "mean", !0);
|
|
874
|
+
}), o = E(() => r() ? void 0 : e.emptyStateConfig);
|
|
902
875
|
return {
|
|
903
876
|
entities: e.entities,
|
|
904
877
|
groupData: i,
|
|
@@ -911,13 +884,13 @@ function Nt(e) {
|
|
|
911
884
|
//#endregion
|
|
912
885
|
//#region src/framework/gestures/cursors.ts
|
|
913
886
|
var W = 32, G = W / 2, K = "white", q = "rgba(0,0,0,0.4)", J = 2, Y = 3;
|
|
914
|
-
function
|
|
887
|
+
function Ot(e) {
|
|
915
888
|
return `url("data:image/svg+xml,${encodeURIComponent(e)}")`;
|
|
916
889
|
}
|
|
917
890
|
function X(e) {
|
|
918
891
|
return `<svg xmlns="http://www.w3.org/2000/svg" width="${W}" height="${W}" viewBox="0 0 ${W} ${W}">${e}</svg>`;
|
|
919
892
|
}
|
|
920
|
-
var
|
|
893
|
+
var kt = X(`
|
|
921
894
|
<g transform="translate(6, 2)">
|
|
922
895
|
<!-- shadow -->
|
|
923
896
|
<g stroke="${q}" stroke-width="${Y}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
@@ -928,13 +901,13 @@ var Ft = X(`
|
|
|
928
901
|
<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"/>
|
|
929
902
|
</g>
|
|
930
903
|
</g>
|
|
931
|
-
`),
|
|
904
|
+
`), At = X(`
|
|
932
905
|
<g>
|
|
933
906
|
<circle cx="${G}" cy="${G}" r="8" stroke="${q}" stroke-width="${Y}" fill="none"/>
|
|
934
907
|
<circle cx="${G}" cy="${G}" r="8" stroke="${K}" stroke-width="1.5" fill="none"/>
|
|
935
908
|
<circle cx="${G}" cy="${G}" r="1.5" fill="${K}"/>
|
|
936
909
|
</g>
|
|
937
|
-
`),
|
|
910
|
+
`), jt = X(`
|
|
938
911
|
<g>
|
|
939
912
|
<!-- shadow -->
|
|
940
913
|
<g stroke="${q}" stroke-width="${Y}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
@@ -953,7 +926,7 @@ var Ft = X(`
|
|
|
953
926
|
<circle cx="${G - 5}" cy="${G}" r="1" fill="${K}" opacity="0.6"/>
|
|
954
927
|
<circle cx="21" cy="${G}" r="1" fill="${K}" opacity="0.6"/>
|
|
955
928
|
</g>
|
|
956
|
-
`),
|
|
929
|
+
`), Mt = X(`
|
|
957
930
|
<g>
|
|
958
931
|
<!-- shadow -->
|
|
959
932
|
<g stroke="${q}" stroke-width="${Y}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
@@ -972,7 +945,7 @@ var Ft = X(`
|
|
|
972
945
|
<circle cx="${G}" cy="${G - 5}" r="1" fill="${K}" opacity="0.6"/>
|
|
973
946
|
<circle cx="${G}" cy="21" r="1" fill="${K}" opacity="0.6"/>
|
|
974
947
|
</g>
|
|
975
|
-
`),
|
|
948
|
+
`), Nt = X(`
|
|
976
949
|
<g>
|
|
977
950
|
<!-- shadow -->
|
|
978
951
|
<g stroke="${q}" stroke-width="${Y}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
@@ -998,54 +971,54 @@ var Ft = X(`
|
|
|
998
971
|
`);
|
|
999
972
|
function Z(e, t, n) {
|
|
1000
973
|
return {
|
|
1001
|
-
css: `${
|
|
974
|
+
css: `${Ot(e)} ${t} ${n}, auto`,
|
|
1002
975
|
hotspotX: t,
|
|
1003
976
|
hotspotY: n
|
|
1004
977
|
};
|
|
1005
978
|
}
|
|
1006
979
|
var Q = {
|
|
1007
|
-
tap: Z(
|
|
1008
|
-
hold: Z(
|
|
1009
|
-
slideHorizontal: Z(
|
|
1010
|
-
slideVertical: Z(
|
|
1011
|
-
slideAuto: Z(
|
|
980
|
+
tap: Z(kt, 12, 4),
|
|
981
|
+
hold: Z(At, 16, 16),
|
|
982
|
+
slideHorizontal: Z(jt, G, G),
|
|
983
|
+
slideVertical: Z(Mt, G, G),
|
|
984
|
+
slideAuto: Z(Nt, G, G)
|
|
1012
985
|
};
|
|
1013
986
|
//#endregion
|
|
1014
987
|
//#region src/framework/gestures/haptics.ts
|
|
1015
|
-
function
|
|
988
|
+
function Pt() {
|
|
1016
989
|
if (typeof window > "u") return null;
|
|
1017
990
|
let e = window;
|
|
1018
991
|
return e.Capacitor?.isNativePlatform?.() ? e.Capacitor.Plugins?.Haptics ?? null : null;
|
|
1019
992
|
}
|
|
1020
|
-
function
|
|
993
|
+
function Ft(e) {
|
|
1021
994
|
if (!(typeof navigator > "u" || typeof navigator.vibrate != "function")) try {
|
|
1022
995
|
navigator.vibrate(e);
|
|
1023
996
|
} catch {}
|
|
1024
997
|
}
|
|
1025
|
-
var
|
|
998
|
+
var It = {
|
|
1026
999
|
tick() {
|
|
1027
|
-
let e =
|
|
1000
|
+
let e = Pt();
|
|
1028
1001
|
if (e) {
|
|
1029
1002
|
e.impact({ style: "Light" }).catch(() => {});
|
|
1030
1003
|
return;
|
|
1031
1004
|
}
|
|
1032
|
-
|
|
1005
|
+
Ft(8);
|
|
1033
1006
|
},
|
|
1034
1007
|
bump() {
|
|
1035
|
-
let e =
|
|
1008
|
+
let e = Pt();
|
|
1036
1009
|
if (e) {
|
|
1037
1010
|
e.impact({ style: "Medium" }).catch(() => {});
|
|
1038
1011
|
return;
|
|
1039
1012
|
}
|
|
1040
|
-
|
|
1013
|
+
Ft(20);
|
|
1041
1014
|
},
|
|
1042
1015
|
pulse() {
|
|
1043
|
-
let e =
|
|
1016
|
+
let e = Pt();
|
|
1044
1017
|
if (e) {
|
|
1045
1018
|
e.impact({ style: "Heavy" }).catch(() => {});
|
|
1046
1019
|
return;
|
|
1047
1020
|
}
|
|
1048
|
-
|
|
1021
|
+
Ft([
|
|
1049
1022
|
0,
|
|
1050
1023
|
15,
|
|
1051
1024
|
40,
|
|
@@ -1055,7 +1028,7 @@ var Ht = {
|
|
|
1055
1028
|
};
|
|
1056
1029
|
//#endregion
|
|
1057
1030
|
//#region src/framework/gestures/use-widget-gestures.ts
|
|
1058
|
-
function
|
|
1031
|
+
function Lt(e, t) {
|
|
1059
1032
|
let n = {
|
|
1060
1033
|
isDown: !1,
|
|
1061
1034
|
isTouch: !1,
|
|
@@ -1066,7 +1039,7 @@ function Ut(e, t) {
|
|
|
1066
1039
|
sliding: !1,
|
|
1067
1040
|
holdTimer: null,
|
|
1068
1041
|
element: null
|
|
1069
|
-
}, r = null, i = null, a = null, [o, s] =
|
|
1042
|
+
}, r = null, i = null, a = null, [o, s] = D(null);
|
|
1070
1043
|
function c(e) {
|
|
1071
1044
|
e !== i && (a && a.disconnect(), a = new ResizeObserver((e) => {
|
|
1072
1045
|
let t = e[0];
|
|
@@ -1098,7 +1071,7 @@ function Ut(e, t) {
|
|
|
1098
1071
|
if (n.isDown = !0, n.isTouch = t.pointerType === "touch", n.element = t.currentTarget, c(n.element), n.startX = t.clientX, n.startY = t.clientY, n.startTime = Date.now(), n.hasMoved = !1, n.sliding = !1, r.hold) {
|
|
1099
1072
|
let e = r.hold.delay ?? 300;
|
|
1100
1073
|
n.holdTimer = setTimeout(() => {
|
|
1101
|
-
n.holdTimer = null, !(!n.isDown || n.hasMoved) && (
|
|
1074
|
+
n.holdTimer = null, !(!n.isDown || n.hasMoved) && (It.bump(), r.hold?.action(), n.isDown = !1);
|
|
1102
1075
|
}, e);
|
|
1103
1076
|
}
|
|
1104
1077
|
if (!n.isTouch && r.slide) try {
|
|
@@ -1166,7 +1139,7 @@ function Ut(e, t) {
|
|
|
1166
1139
|
}
|
|
1167
1140
|
//#endregion
|
|
1168
1141
|
//#region src/framework/theming/svg-colors.ts
|
|
1169
|
-
var
|
|
1142
|
+
var Rt = {
|
|
1170
1143
|
solar: "oklch(0.74 0.18 60)",
|
|
1171
1144
|
grid: "oklch(0.62 0.12 245)",
|
|
1172
1145
|
battery: "oklch(0.70 0.18 145)",
|
|
@@ -1175,37 +1148,37 @@ var Wt = {
|
|
|
1175
1148
|
positive: "oklch(0.70 0.14 160)",
|
|
1176
1149
|
negative: "oklch(0.64 0.22 27)"
|
|
1177
1150
|
};
|
|
1178
|
-
function
|
|
1151
|
+
function zt(e) {
|
|
1179
1152
|
return {
|
|
1180
1153
|
fill: `color-mix(in oklch, ${e} 20%, transparent)`,
|
|
1181
1154
|
stroke: e,
|
|
1182
1155
|
solid: e
|
|
1183
1156
|
};
|
|
1184
1157
|
}
|
|
1185
|
-
var
|
|
1158
|
+
var Bt = Object.fromEntries(Object.entries(Rt).map(([e, t]) => [e, zt(t)])), Vt = l.enum([
|
|
1186
1159
|
"success",
|
|
1187
1160
|
"warning",
|
|
1188
1161
|
"danger",
|
|
1189
1162
|
"info",
|
|
1190
1163
|
"neutral",
|
|
1191
1164
|
"accent"
|
|
1192
|
-
]),
|
|
1193
|
-
title:
|
|
1165
|
+
]), Ht = {
|
|
1166
|
+
title: r(() => l.string().optional().meta({
|
|
1194
1167
|
title: "Title",
|
|
1195
1168
|
description: "Optional display name override"
|
|
1196
1169
|
}), "widgetFields.title"),
|
|
1197
|
-
entityIds:
|
|
1170
|
+
entityIds: r((e, t) => l.array(l.string()).default([]).meta({
|
|
1198
1171
|
domain: e,
|
|
1199
1172
|
title: "Entities",
|
|
1200
1173
|
...t?.deviceClass ? { deviceClass: t.deviceClass } : {}
|
|
1201
1174
|
}), "widgetFields.entityIds"),
|
|
1202
|
-
singleEntity:
|
|
1175
|
+
singleEntity: r((e, t) => l.array(l.string()).default([]).meta({
|
|
1203
1176
|
domain: e,
|
|
1204
1177
|
title: "Entity",
|
|
1205
1178
|
singleSelect: !0,
|
|
1206
1179
|
...t?.deviceClass ? { deviceClass: t.deviceClass } : {}
|
|
1207
1180
|
}), "widgetFields.singleEntity"),
|
|
1208
|
-
areaId:
|
|
1181
|
+
areaId: r(() => l.string().optional().meta({
|
|
1209
1182
|
formType: "area-picker",
|
|
1210
1183
|
title: "Area"
|
|
1211
1184
|
}), "widgetFields.areaId")
|
|
@@ -1217,48 +1190,48 @@ function $(e) {
|
|
|
1217
1190
|
for (let [n, r] of Object.entries(e)) r !== void 0 && (t[n] = r);
|
|
1218
1191
|
return t;
|
|
1219
1192
|
}
|
|
1220
|
-
function
|
|
1221
|
-
return
|
|
1193
|
+
function Ut() {
|
|
1194
|
+
return l.string().optional().meta({
|
|
1222
1195
|
title: "Title",
|
|
1223
1196
|
description: "Optional display name override"
|
|
1224
1197
|
});
|
|
1225
1198
|
}
|
|
1226
|
-
function
|
|
1227
|
-
return (e.default === void 0 ?
|
|
1199
|
+
function Wt(e) {
|
|
1200
|
+
return (e.default === void 0 ? l.string().optional() : l.string().default(e.default)).meta($({
|
|
1228
1201
|
title: e.title,
|
|
1229
1202
|
description: e.description
|
|
1230
1203
|
}));
|
|
1231
1204
|
}
|
|
1232
|
-
function
|
|
1233
|
-
let t =
|
|
1205
|
+
function Gt(e) {
|
|
1206
|
+
let t = l.number();
|
|
1234
1207
|
return e.min !== void 0 && (t = t.min(e.min)), e.max !== void 0 && (t = t.max(e.max)), (e.default === void 0 ? t.optional() : t.default(e.default)).meta($({
|
|
1235
1208
|
title: e.title,
|
|
1236
1209
|
description: e.description
|
|
1237
1210
|
}));
|
|
1238
1211
|
}
|
|
1239
|
-
function
|
|
1240
|
-
return
|
|
1212
|
+
function Kt(e) {
|
|
1213
|
+
return l.boolean().default(e.default ?? !1).meta($({
|
|
1241
1214
|
title: e.title,
|
|
1242
1215
|
description: e.description
|
|
1243
1216
|
}));
|
|
1244
1217
|
}
|
|
1245
|
-
function
|
|
1246
|
-
let n =
|
|
1218
|
+
function qt(e, t) {
|
|
1219
|
+
let n = l.enum(e);
|
|
1247
1220
|
return (t.default === void 0 ? n.optional() : n.default(t.default)).meta($({
|
|
1248
1221
|
title: t.title,
|
|
1249
1222
|
description: t.description
|
|
1250
1223
|
}));
|
|
1251
1224
|
}
|
|
1252
|
-
function
|
|
1253
|
-
return
|
|
1225
|
+
function Jt(e, t) {
|
|
1226
|
+
return l.array(l.string()).default([]).meta($({
|
|
1254
1227
|
domain: e,
|
|
1255
1228
|
title: t?.title ?? "Entities",
|
|
1256
1229
|
description: t?.description,
|
|
1257
1230
|
deviceClass: t?.deviceClass
|
|
1258
1231
|
}));
|
|
1259
1232
|
}
|
|
1260
|
-
function
|
|
1261
|
-
return
|
|
1233
|
+
function Yt(e, t) {
|
|
1234
|
+
return l.array(l.string()).default([]).meta($({
|
|
1262
1235
|
domain: e,
|
|
1263
1236
|
title: t?.title ?? "Entity",
|
|
1264
1237
|
description: t?.description,
|
|
@@ -1266,40 +1239,40 @@ function tn(e, t) {
|
|
|
1266
1239
|
singleSelect: !0
|
|
1267
1240
|
}));
|
|
1268
1241
|
}
|
|
1269
|
-
function
|
|
1270
|
-
return
|
|
1242
|
+
function Xt(e) {
|
|
1243
|
+
return l.string().optional().meta({
|
|
1271
1244
|
formType: "area-picker",
|
|
1272
1245
|
title: e?.title ?? "Area"
|
|
1273
1246
|
});
|
|
1274
1247
|
}
|
|
1275
|
-
function
|
|
1276
|
-
return
|
|
1248
|
+
function Zt(e) {
|
|
1249
|
+
return l.array(l.string()).default([]).meta($({
|
|
1277
1250
|
title: e.title,
|
|
1278
1251
|
description: e.description
|
|
1279
1252
|
}));
|
|
1280
1253
|
}
|
|
1281
|
-
function
|
|
1282
|
-
let n =
|
|
1254
|
+
function Qt(e, t) {
|
|
1255
|
+
let n = l.object(e);
|
|
1283
1256
|
return n.default(Se(n)).meta({ title: t.title });
|
|
1284
1257
|
}
|
|
1285
|
-
var
|
|
1286
|
-
title:
|
|
1287
|
-
text:
|
|
1288
|
-
number:
|
|
1289
|
-
toggle:
|
|
1290
|
-
choice:
|
|
1291
|
-
entities:
|
|
1292
|
-
entity:
|
|
1293
|
-
area:
|
|
1294
|
-
stringList:
|
|
1295
|
-
group:
|
|
1258
|
+
var $t = {
|
|
1259
|
+
title: Ut,
|
|
1260
|
+
text: Wt,
|
|
1261
|
+
number: Gt,
|
|
1262
|
+
toggle: Kt,
|
|
1263
|
+
choice: qt,
|
|
1264
|
+
entities: Jt,
|
|
1265
|
+
entity: Yt,
|
|
1266
|
+
area: Xt,
|
|
1267
|
+
stringList: Zt,
|
|
1268
|
+
group: Qt
|
|
1296
1269
|
};
|
|
1297
|
-
function
|
|
1298
|
-
return
|
|
1270
|
+
function en(e) {
|
|
1271
|
+
return l.object(e);
|
|
1299
1272
|
}
|
|
1300
1273
|
//#endregion
|
|
1301
1274
|
//#region src/shared/spline.ts
|
|
1302
|
-
function
|
|
1275
|
+
function tn(e) {
|
|
1303
1276
|
if (e.length < 2) return "";
|
|
1304
1277
|
let t = e[0], n = e[1];
|
|
1305
1278
|
if (!t || !n) return "";
|
|
@@ -1326,14 +1299,14 @@ function cn(e) {
|
|
|
1326
1299
|
}
|
|
1327
1300
|
//#endregion
|
|
1328
1301
|
//#region src/theme.ts
|
|
1329
|
-
function
|
|
1302
|
+
function nn() {
|
|
1330
1303
|
return document.documentElement.classList.contains("dark");
|
|
1331
1304
|
}
|
|
1332
1305
|
//#endregion
|
|
1333
1306
|
//#region src/version.ts
|
|
1334
|
-
var
|
|
1307
|
+
var rn = {
|
|
1335
1308
|
name: "@glasshome/widget-sdk",
|
|
1336
|
-
version: "1.
|
|
1309
|
+
version: "1.7.0",
|
|
1337
1310
|
description: "SDK for building GlassHome dashboard widgets with SolidJS",
|
|
1338
1311
|
keywords: [
|
|
1339
1312
|
"glasshome",
|
|
@@ -1365,6 +1338,11 @@ var un = {
|
|
|
1365
1338
|
types: "./dist/deprecations.d.ts",
|
|
1366
1339
|
import: "./dist/deprecations.js"
|
|
1367
1340
|
},
|
|
1341
|
+
"./host": {
|
|
1342
|
+
"@glasshome/source": "./src/host/index.ts",
|
|
1343
|
+
types: "./dist/host/index.d.ts",
|
|
1344
|
+
import: "./dist/host/index.js"
|
|
1345
|
+
},
|
|
1368
1346
|
"./vite": {
|
|
1369
1347
|
"@glasshome/source": "./src/vite/index.ts",
|
|
1370
1348
|
types: "./dist/vite/index.d.ts",
|
|
@@ -1416,4 +1394,4 @@ var un = {
|
|
|
1416
1394
|
engines: { node: ">=18" }
|
|
1417
1395
|
}.version;
|
|
1418
1396
|
//#endregion
|
|
1419
|
-
export {
|
|
1397
|
+
export { rn as SDK_VERSION, Vt as ToneSchema, U as Widget, Pe as WidgetContent, e as WidgetCtx, Ct as WidgetDialog, Re as WidgetIcon, o as WidgetManifestSchema, Me as WidgetSliderFill, Be as WidgetStatus, Ue as WidgetTitle, tt as WidgetValue, ee as byDomain, We as calculateLightGroup, Ge as calculateSensorGroup, Xe as countActiveEntities, en as defineConfig, Ce as defineWidget, i as deprecations, $t as field, a as formatDeprecation, s as formatSchemaError, Ye as getEntityAttribute, u as getForecasts, d as getStream, f as getWebRtcClientConfig, p as hassMediaUrl, n as injectTokens, nn as isDark, Je as isEntityActive, tn as monotoneCubicPath, m as sendWebRtcCandidate, h as startWebRtcSession, g as state, Bt as svgColors, _ as trackEntityHistory, v as untrackEntityHistory, y as useArea, b as useCamera, te as useConnection, x as useCurrency, ne as useEntities, S as useEntity, re as useEntityHistory, ie as useEntityStatistics, C as useForecast, ae as useHassConfig, wt as useIntersectionPause, oe as useLocale, Tt as useReducedMotion, Te as useService, ce as useStore, le as useTemperatureUnit, Oe as useToggle, De as useTurnOff, Ee as useTurnOn, pe as useUnitSystem, t as useWidgetContext, Et as useWidgetDialog, Dt as useWidgetEntityGroup, Lt as useWidgetGestures, Ht as widgetFields, c as z };
|