@glasshome/widget-sdk 1.15.0 → 1.16.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/deprecations.js +16 -0
- package/dist/framework/backgrounds/WidgetSliderFill.d.ts +1 -1
- package/dist/framework/core/Widget.d.ts +1 -1
- package/dist/framework/dialogs/debug-view.d.ts +27 -0
- package/dist/framework/dialogs/index.d.ts +1 -0
- package/dist/framework/index.d.ts +2 -2
- package/dist/framework/types.d.ts +1 -1
- package/dist/framework/utils/clipboard.d.ts +9 -0
- package/dist/framework/utils/index.d.ts +1 -0
- package/dist/framework/variants/variant-utils.d.ts +5 -5
- package/dist/index.js +756 -342
- package/dist/vite/index.js +83 -74
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -2,14 +2,14 @@ import { deprecate as e, deprecations as t, formatDeprecation as n } from "./dep
|
|
|
2
2
|
import { WidgetManifestSchema as r, formatSchemaError as i } from "./schemas.js";
|
|
3
3
|
import { z as a, z as o } from "zod";
|
|
4
4
|
import { getForecasts as s, getStream as c, getWebRtcClientConfig as l, hassMediaUrl as u, sendWebRtcCandidate as d, startWebRtcSession as f, state as p, trackEntityHistory as m, untrackEntityHistory as h } from "@glasshome/sync-layer";
|
|
5
|
-
import { byDomain as g, useArea as _, useCalendarEvents as v, useCamera as ee, useConnection as y, useCurrency as
|
|
6
|
-
import { For as
|
|
7
|
-
import { addEventListener as A, className as j, createComponent as M, effect as N, insert as P, memo as F, setStyleProperty as
|
|
8
|
-
import { clsx as
|
|
9
|
-
import { twMerge as
|
|
10
|
-
import { Badge as
|
|
5
|
+
import { byDomain as g, useArea as _, useCalendarEvents as v, useCamera as ee, useConnection as y, useCurrency as te, useEntities as ne, useEntity as re, useEntityHistory as ie, useEntityStatistics as ae, useForecast as oe, useHassConfig as se, useLocale as ce, useService as le, useStore as ue, useTemperatureUnit as b, useToggle as x, useTurnOff as de, useTurnOn as fe, useUnitSystem as S } from "@glasshome/sync-layer/solid";
|
|
6
|
+
import { For as C, Show as w, createContext as T, createEffect as pe, createMemo as E, createSignal as D, on as me, onCleanup as O, onMount as he, splitProps as ge, useContext as k } from "solid-js";
|
|
7
|
+
import { addEventListener as A, className as j, createComponent as M, effect as N, insert as P, memo as F, setStyleProperty as _e, style as ve, template as I, use as ye } from "solid-js/web";
|
|
8
|
+
import { clsx as be } from "clsx";
|
|
9
|
+
import { twMerge as xe } from "tailwind-merge";
|
|
10
|
+
import { Accordion as Se, AccordionContent as Ce, AccordionItem as we, AccordionTrigger as Te, Badge as Ee, Badge as De, Button as Oe, Button as ke, Carousel as Ae, CarouselContent as je, CarouselDots as Me, CarouselItem as Ne, CarouselNext as Pe, CarouselPrevious as Fe, ColorSlider as Ie, ColorWheel as Le, CountPill as Re, CountPill as ze, Empty as Be, EmptyDescription as Ve, EmptyHeader as He, EmptyTitle as Ue, FactRow as L, FieldGroup as We, FieldTitle as Ge, Icon as Ke, Icon as qe, Input as Je, Label as Ye, ResponsiveDialog as Xe, ResponsiveDialogBody as Ze, ResponsiveDialogBody as Qe, ResponsiveDialogClose as $e, ResponsiveDialogContent as et, ResponsiveDialogDescription as tt, ResponsiveDialogFooter as nt, ResponsiveDialogFooter as rt, ResponsiveDialogHeader as it, ResponsiveDialogTitle as at, SchemaForm as ot, SectionIcon as st, SectionIcon as ct, SectionMeta as lt, SectionRow as ut, SectionTitle as dt, Select as ft, SelectContent as pt, SelectItem as mt, SelectTrigger as ht, SelectValue as gt, Slider as _t, Switch as vt, Tabs as yt, Tabs as bt, TabsContent as xt, TabsContent as St, TabsList as Ct, TabsList as wt, TabsTrigger as Tt, TabsTrigger as Et, imageUrl as Dt, mediaUrl as Ot, parseColor as kt } from "@glasshome/ui/solid";
|
|
11
11
|
//#region src/framework/to-form-schema.ts
|
|
12
|
-
function
|
|
12
|
+
function At(e) {
|
|
13
13
|
return o.toJSONSchema(e, { override: (e) => {
|
|
14
14
|
let t = o.globalRegistry.get(e.zodSchema);
|
|
15
15
|
return t && typeof t == "object" && Object.keys(t).length > 0 ? {
|
|
@@ -18,7 +18,7 @@ function ft(e) {
|
|
|
18
18
|
} : e.jsonSchema;
|
|
19
19
|
} });
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function jt(e) {
|
|
22
22
|
try {
|
|
23
23
|
return e.parse({});
|
|
24
24
|
} catch {
|
|
@@ -27,49 +27,49 @@ function pt(e) {
|
|
|
27
27
|
}
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region src/define-widget.ts
|
|
30
|
-
function
|
|
31
|
-
return e.configSchema && (e.manifest.schema || (e.manifest.schema =
|
|
30
|
+
function Mt(e) {
|
|
31
|
+
return e.configSchema && (e.manifest.schema || (e.manifest.schema = At(e.configSchema)), e.manifest.defaultConfig || (e.manifest.defaultConfig = jt(e.configSchema))), e;
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region src/framework/hooks/use-widget-context.ts
|
|
35
|
-
var R =
|
|
36
|
-
function
|
|
35
|
+
var R = T();
|
|
36
|
+
function Nt() {
|
|
37
37
|
let e = k(R);
|
|
38
38
|
if (!e) throw Error("useWidgetContext must be used within a Widget component");
|
|
39
39
|
return e;
|
|
40
40
|
}
|
|
41
41
|
//#endregion
|
|
42
42
|
//#region src/framework/hooks/use-service.ts
|
|
43
|
-
function
|
|
43
|
+
function Pt(e) {
|
|
44
44
|
let t = Array.isArray(e) ? e[0] : e, n = t?.split(".")[0];
|
|
45
45
|
if (!n) throw Error(`Invalid entity ID: ${String(t)}`);
|
|
46
46
|
return n;
|
|
47
47
|
}
|
|
48
48
|
function z(e, t) {
|
|
49
49
|
return async (n, r = {}) => {
|
|
50
|
-
await e(
|
|
50
|
+
await e(Pt(n), t, r, { entity_id: n });
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function Ft() {
|
|
54
54
|
let e = k(R)?.callService;
|
|
55
55
|
return e ? {
|
|
56
56
|
callService: e,
|
|
57
57
|
turnOn: z(e, "turn_on"),
|
|
58
58
|
turnOff: z(e, "turn_off"),
|
|
59
59
|
toggle: z(e, "toggle")
|
|
60
|
-
} :
|
|
60
|
+
} : le();
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function It() {
|
|
63
63
|
let e = k(R)?.callService;
|
|
64
|
-
return e ? z(e, "turn_on") :
|
|
64
|
+
return e ? z(e, "turn_on") : fe();
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function Lt() {
|
|
67
67
|
let e = k(R)?.callService;
|
|
68
|
-
return e ? z(e, "turn_off") :
|
|
68
|
+
return e ? z(e, "turn_off") : de();
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function Rt() {
|
|
71
71
|
let e = k(R)?.callService;
|
|
72
|
-
return e ? z(e, "toggle") :
|
|
72
|
+
return e ? z(e, "toggle") : x();
|
|
73
73
|
}
|
|
74
74
|
//#endregion
|
|
75
75
|
//#region src/framework/design-system/z-index.ts
|
|
@@ -78,50 +78,46 @@ var B = {
|
|
|
78
78
|
CONTENT: 10,
|
|
79
79
|
OVERLAY: 20,
|
|
80
80
|
ACTIONS: 30
|
|
81
|
-
},
|
|
82
|
-
function
|
|
83
|
-
let e = k(
|
|
81
|
+
}, zt = T();
|
|
82
|
+
function Bt() {
|
|
83
|
+
let e = k(zt);
|
|
84
84
|
if (!e) throw Error("useWidgetDimensions must be called inside <Widget>: move the call into a component rendered within <Widget> (the top-level widget scope only sees the host stub).");
|
|
85
85
|
return e;
|
|
86
86
|
}
|
|
87
87
|
//#endregion
|
|
88
88
|
//#region src/framework/theming/tokens.css?raw
|
|
89
|
-
var
|
|
90
|
-
function
|
|
91
|
-
return
|
|
89
|
+
var Vt = "/* Authoritative SDK CSS contract. Injected once on first Widget mount\n * via framework/theming/tokens.ts.\n *\n * All widget-internal visual scale is driven from CSS custom properties +\n * container queries on the `.glasshome-widget` shell (`container-type: size`).\n * No JS classifier, no size tier enum.\n */\n\n:root {\n --tone-success: oklch(0.70 0.18 145);\n --tone-warning: oklch(0.80 0.17 75);\n --tone-danger: oklch(0.64 0.22 27);\n --tone-info: oklch(0.66 0.20 245);\n --tone-neutral: oklch(0.65 0.02 250);\n --tone-accent: oklch(0.74 0.18 60);\n\n --widget-glow-default: 0.4;\n}\n\n.dark {\n --tone-success: oklch(0.74 0.18 145);\n --tone-warning: oklch(0.82 0.17 75);\n --tone-danger: oklch(0.68 0.22 27);\n --tone-info: oklch(0.70 0.20 245);\n --tone-neutral: oklch(0.69 0.02 250);\n --tone-accent: oklch(0.78 0.18 60);\n\n --widget-glow-default: 0.5;\n}\n\n@property --widget-color {\n syntax: \"<color>\";\n inherits: true;\n initial-value: oklch(0.65 0.02 250);\n}\n\n/* === Widget shell ===\n * Fluid scale tokens — tied to the shell's own container box (cqb=height, cqi=width).\n * Icon/pad/gap track HEIGHT (cqb) not the shortest side: two widgets of equal\n * height match regardless of width (a 2×2 and a 4×2 get the same icon). cqmin\n * starved portrait tiles by pinning the icon to the narrow width. Tune\n * multipliers / clamps to adjust density. */\n.glasshome-widget {\n --widget-color: var(--tone-neutral);\n --widget-glow-strength: var(--widget-glow-default);\n --widget-radius: var(--radius-xl, 12px);\n\n --widget-icon-box: clamp(44px, 25cqb, 58px);\n --widget-icon-glyph: clamp(24px, 14cqb, 33px);\n --widget-pad: clamp(8px, 3.5cqb, 22px);\n --widget-gap: clamp(6px, 2cqb, 14px);\n --widget-title-size: clamp(12px, 2cqi, 18px);\n --widget-subtitle: clamp(12px, 2.5cqi, 20px);\n --widget-status-size: clamp(14px, 5cqi, 36px);\n --widget-value-size: clamp(18px, 7cqi, 48px);\n --widget-badge-size: clamp(11px, 1.6cqi, 14px);\n}\n\n/* Shell material: ui's .glass, worn through the class Widget.tsx carries.\n * Unlayered and class-specific, so these beat the formula's :where() defaults\n * (wash-2 is re-declared there and cannot be set from a utility). The tone\n * stays the formula's transparent default until Widget.tsx sets one inline:\n * a widget without a tone is the plain card, never a neutral-grey wash. */\n.glasshome-widget {\n --widget-wash: 22%;\n --widget-wash-2: 11%;\n --glass-wash: var(--widget-wash);\n --glass-wash-2: var(--widget-wash-2);\n --glass-wash-angle: 135deg;\n --glass-base: color-mix(in srgb, var(--card) var(--material-clarity, 60%), transparent);\n --glass-rim: 0.3;\n --glass-lift: 0.45;\n --glass-shade: 0.05;\n backdrop-filter: var(--widget-backdrop, none);\n -webkit-backdrop-filter: var(--widget-backdrop, none);\n}\n/* A fill widget keeps a neutral card; the fill carries the tone, so a full fill is the toned card. */\n.glasshome-widget:has(.glasshome-widget-slider-fill) {\n --glass-wash: 0%;\n --glass-wash-2: 0%;\n}\n.dark .glasshome-widget {\n --glass-shade: 0;\n}\n\n/* === Slot: content layout === */\n/* Default: column. Flip to row only on wide-and-short widgets (matches the\n * old contentLayout heuristic: aspect > 1 AND height < 150px). */\n.glasshome-widget-content {\n position: relative;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n width: 100%;\n height: 100%;\n padding: var(--widget-pad);\n gap: var(--widget-gap);\n overflow: hidden;\n border-radius: var(--widget-radius);\n}\n@container widget (min-aspect-ratio: 1) and (max-height: 149px) {\n .glasshome-widget-content {\n flex-direction: row;\n align-items: center;\n justify-content: flex-start;\n }\n}\n\n/* === Compact 1×1 ===\n * Small in BOTH axes → stack the tile: icon on top, label + status centered\n * under it. Icon stays moderate (not a hero) so the text keeps room. Wide\n * tiles (2×1) fail the width test and keep the row layout above. Placed after\n * the row-flip so it wins. */\n@container widget (max-width: 189px) and (max-height: 189px) {\n .glasshome-widget-content {\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n gap: clamp(4px, 2.5cqmin, 8px);\n }\n .glasshome-widget-content > * { align-items: center; text-align: center; }\n .glasshome-widget-icon {\n --widget-icon-box: clamp(36px, 30cqmin, 56px);\n --widget-icon-glyph: clamp(20px, 17cqmin, 32px);\n }\n .glasshome-widget-title { font-size: clamp(11px, 6cqmin, 14px); max-width: 100%; }\n .glasshome-widget-status,\n .glasshome-widget-value { font-size: clamp(13px, 7cqmin, 17px); }\n .glasshome-widget-content [class*=\"ml-auto\"] { margin-left: 0 !important; }\n}\n.glasshome-widget-content [class*=\"ml-auto\"] {\n position: relative;\n z-index: 30;\n}\n\n/* === Slot: icon ===\n * ui's tinted icon pill (ICON_PILL_TINT): the disc is .glass, so the material shapes it. */\n.glasshome-widget-icon {\n width: var(--widget-icon-box);\n height: var(--widget-icon-box);\n border-radius: var(--radius-sm, 12px);\n --glass-tone: var(--widget-icon-color, var(--widget-color));\n --glass-rim: 0.4;\n --glass-wash: 18%;\n}\n.glasshome-widget-icon-glyph {\n font-size: var(--widget-icon-glyph);\n line-height: 1;\n}\n.glasshome-widget-icon-stack {\n position: absolute;\n width: 102%;\n height: 102%;\n border-radius: var(--radius-sm, 12px);\n}\n.glasshome-widget-icon-stack-2 { bottom: -14%; right: -10%; opacity: 0.45; z-index: -2; }\n.glasshome-widget-icon-stack-3 { bottom: -28%; right: -20%; opacity: 0.20; z-index: -3; }\n\n/* === Slot: text === */\n.glasshome-widget-title {\n font-size: var(--widget-title-size);\n line-height: 1.2;\n color: var(--color-muted-foreground, currentColor);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.glasshome-widget-subtitle {\n font-size: var(--widget-subtitle);\n color: var(--color-muted-foreground, currentColor);\n}\n.glasshome-widget-status {\n font-size: var(--widget-status-size);\n font-weight: 700;\n color: var(--color-foreground, currentColor);\n line-height: 1.1;\n}\n.glasshome-widget-value {\n font-size: var(--widget-value-size);\n font-weight: 700;\n color: var(--color-foreground, currentColor);\n line-height: 1.05;\n}\n.glasshome-widget-badge {\n font-size: var(--widget-badge-size);\n font-weight: 500;\n padding: 0.125rem 0.5rem;\n border-radius: 9999px;\n background: color-mix(in oklch, var(--color-foreground, currentColor) 20%, transparent);\n color: var(--color-foreground, currentColor);\n}\n\n.glasshome-widget-loading {\n background: color-mix(in oklch, var(--widget-color) 20%, transparent);\n}\n\n/* === Slider fill ===\n * Value flows in via --widget-fill-value (0-100). Vertical orientation auto-\n * detected via container query. */\n.glasshome-widget-slider-fill {\n --widget-fill-value: 0;\n background: linear-gradient(\n 135deg,\n color-mix(in srgb, var(--widget-color) calc(var(--widget-wash) * var(--material-tint, 1)), transparent),\n color-mix(\n in srgb,\n var(--widget-color-to, var(--widget-color)) calc(var(--widget-wash-2) * var(--material-tint, 1)),\n transparent\n )\n );\n /* Inset: the clip-path cuts any outer shadow. */\n box-shadow: inset 0 0 calc(var(--material-glow, 0px) * 1.2)\n oklch(from var(--widget-color) l c h / 0.55);\n clip-path: inset(0 calc((100 - var(--widget-fill-value)) * 1%) 0 0 round var(--widget-radius));\n}\n@container widget (max-aspect-ratio: 1) {\n .glasshome-widget-slider-fill {\n clip-path: inset(calc((100 - var(--widget-fill-value)) * 1%) 0 0 0 round var(--widget-radius));\n }\n}\n", Ht = !1, Ut, Wt = /* @__PURE__ */ new WeakSet();
|
|
90
|
+
function Gt() {
|
|
91
|
+
return Ut || (Ut = new CSSStyleSheet(), Ut.replaceSync(Vt.replace(/:root\b/g, ":host").replace(/^\.dark\b/gm, ":host(.dark)"))), Ut;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function Kt(e) {
|
|
94
94
|
if (typeof ShadowRoot < "u" && e instanceof ShadowRoot) {
|
|
95
|
-
if (
|
|
96
|
-
let t =
|
|
97
|
-
e.adoptedStyleSheets.includes(t) || (e.adoptedStyleSheets = [...e.adoptedStyleSheets, t]),
|
|
95
|
+
if (Wt.has(e)) return;
|
|
96
|
+
let t = Gt();
|
|
97
|
+
e.adoptedStyleSheets.includes(t) || (e.adoptedStyleSheets = [...e.adoptedStyleSheets, t]), Wt.add(e);
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
|
-
if (
|
|
100
|
+
if (Ht) return;
|
|
101
101
|
let t = e ?? (typeof document > "u" ? void 0 : document);
|
|
102
102
|
if (!t) return;
|
|
103
103
|
if (t.head.querySelector?.("style[data-glasshome-tokens]")) {
|
|
104
|
-
|
|
104
|
+
Ht = !0;
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
107
|
let n = t.createElement("style");
|
|
108
|
-
n.setAttribute("data-glasshome-tokens", ""), n.textContent =
|
|
108
|
+
n.setAttribute("data-glasshome-tokens", ""), n.textContent = Vt, t.head.appendChild(n), Ht = !0;
|
|
109
109
|
}
|
|
110
110
|
//#endregion
|
|
111
111
|
//#region src/framework/utils/cn.ts
|
|
112
112
|
function V(...e) {
|
|
113
|
-
return be(
|
|
113
|
+
return xe(be(e));
|
|
114
114
|
}
|
|
115
|
-
var
|
|
115
|
+
var qt = {
|
|
116
116
|
"classic-glass": {
|
|
117
117
|
id: "classic-glass",
|
|
118
118
|
name: "Classic Glass",
|
|
119
119
|
description: "Default glassmorphism design with blur background and gradient",
|
|
120
120
|
styles: { cssVars: {
|
|
121
|
-
"--widget-bg": "rgba(255, 255, 255, 0.1)",
|
|
122
|
-
"--widget-border": "rgba(255, 255, 255, 0.2)",
|
|
123
|
-
"--widget-blur": "12px",
|
|
124
|
-
"--widget-shadow": "0 8px 32px rgba(0, 0, 0, 0.2)",
|
|
125
121
|
"--widget-padding": "1.5rem",
|
|
126
122
|
"--widget-backdrop": "blur(var(--glass-blur, 24px)) saturate(1.8)"
|
|
127
123
|
} },
|
|
@@ -145,9 +141,13 @@ var kt = {
|
|
|
145
141
|
name: "Minimal",
|
|
146
142
|
description: "Clean, minimal design with no background effects",
|
|
147
143
|
styles: { cssVars: {
|
|
148
|
-
"--widget-
|
|
149
|
-
"--
|
|
150
|
-
"--
|
|
144
|
+
"--widget-padding": "1rem",
|
|
145
|
+
"--glass-base": "transparent",
|
|
146
|
+
"--glass-wash": "0%",
|
|
147
|
+
"--glass-light": "0",
|
|
148
|
+
"--glass-rim": "0",
|
|
149
|
+
"--glass-lift": "0",
|
|
150
|
+
"--glass-edge": "transparent"
|
|
151
151
|
} },
|
|
152
152
|
layout: {
|
|
153
153
|
type: "flex",
|
|
@@ -171,9 +171,6 @@ var kt = {
|
|
|
171
171
|
name: "Compact Horizontal",
|
|
172
172
|
description: "Horizontal layout for compact widgets",
|
|
173
173
|
styles: { cssVars: {
|
|
174
|
-
"--widget-bg": "rgba(255, 255, 255, 0.08)",
|
|
175
|
-
"--widget-border": "rgba(255, 255, 255, 0.15)",
|
|
176
|
-
"--widget-blur": "10px",
|
|
177
174
|
"--widget-padding": "1rem",
|
|
178
175
|
"--widget-icon-size": "2.5rem",
|
|
179
176
|
"--widget-backdrop": "blur(16px) saturate(1.8)"
|
|
@@ -194,22 +191,21 @@ var kt = {
|
|
|
194
191
|
}
|
|
195
192
|
}
|
|
196
193
|
};
|
|
197
|
-
function
|
|
198
|
-
return
|
|
194
|
+
function Jt(e) {
|
|
195
|
+
return qt[e];
|
|
199
196
|
}
|
|
200
197
|
//#endregion
|
|
201
198
|
//#region src/framework/backgrounds/WidgetSliderFill.tsx
|
|
202
|
-
var
|
|
203
|
-
function
|
|
204
|
-
return (() => {
|
|
205
|
-
var t =
|
|
199
|
+
var Yt = /*#__PURE__*/ I("<div>"), Xt = e(() => void 0, "sliderFill.color");
|
|
200
|
+
function Zt(e) {
|
|
201
|
+
return e.color !== void 0 && Xt(), (() => {
|
|
202
|
+
var t = Yt();
|
|
206
203
|
return N((n) => {
|
|
207
204
|
var r = V("glasshome-widget-slider-fill pointer-events-none absolute inset-0", e.isDragging ? "duration-0" : "transition-all duration-300 ease-out", e.class), i = {
|
|
208
205
|
"--widget-fill-value": e.value,
|
|
209
|
-
"z-index": B.BACKGROUND
|
|
210
|
-
...e.color ? { "--widget-icon-color": e.color } : {}
|
|
206
|
+
"z-index": B.BACKGROUND
|
|
211
207
|
};
|
|
212
|
-
return r !== n.e && j(t, n.e = r), n.t =
|
|
208
|
+
return r !== n.e && j(t, n.e = r), n.t = ve(t, i, n.t), n;
|
|
213
209
|
}, {
|
|
214
210
|
e: void 0,
|
|
215
211
|
t: void 0
|
|
@@ -218,37 +214,37 @@ function Mt(e) {
|
|
|
218
214
|
}
|
|
219
215
|
//#endregion
|
|
220
216
|
//#region src/framework/components/WidgetContent.tsx
|
|
221
|
-
var
|
|
222
|
-
function
|
|
217
|
+
var Qt = /*#__PURE__*/ I("<div>");
|
|
218
|
+
function $t(e) {
|
|
223
219
|
return (() => {
|
|
224
|
-
var t =
|
|
220
|
+
var t = Qt();
|
|
225
221
|
return P(t, () => e.children), N(() => j(t, V("glasshome-widget-content", e.class))), t;
|
|
226
222
|
})();
|
|
227
223
|
}
|
|
228
224
|
//#endregion
|
|
229
225
|
//#region src/framework/components/WidgetIcon.tsx
|
|
230
|
-
var
|
|
231
|
-
function
|
|
226
|
+
var en = /*#__PURE__*/ I("<div class=\"glasshome-widget-icon glasshome-widget-icon-stack glasshome-widget-icon-stack-2 glass glass-tint\">"), tn = /*#__PURE__*/ I("<div class=\"glasshome-widget-icon glasshome-widget-icon-stack glasshome-widget-icon-stack-3 glass glass-tint\">"), nn = /*#__PURE__*/ I("<div><div class=\"glasshome-widget-icon-glyph flex items-center justify-center\">");
|
|
227
|
+
function rn(e) {
|
|
232
228
|
let t = () => e.entityCount ?? 1;
|
|
233
229
|
return (() => {
|
|
234
|
-
var n =
|
|
235
|
-
return P(n, M(
|
|
230
|
+
var n = nn(), r = n.firstChild;
|
|
231
|
+
return P(n, M(w, {
|
|
236
232
|
get when() {
|
|
237
233
|
return t() >= 2;
|
|
238
234
|
},
|
|
239
235
|
get children() {
|
|
240
|
-
return
|
|
236
|
+
return en();
|
|
241
237
|
}
|
|
242
|
-
}), r), P(n, M(
|
|
238
|
+
}), r), P(n, M(w, {
|
|
243
239
|
get when() {
|
|
244
240
|
return t() >= 3;
|
|
245
241
|
},
|
|
246
242
|
get children() {
|
|
247
|
-
return
|
|
243
|
+
return tn();
|
|
248
244
|
}
|
|
249
245
|
}), r), P(r, () => e.icon), N((t) => {
|
|
250
|
-
var r = V("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;
|
|
251
|
-
return r !== t.e && j(n, t.e = r), t.t =
|
|
246
|
+
var r = V("glasshome-widget-icon glass glass-tint", "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;
|
|
247
|
+
return r !== t.e && j(n, t.e = r), t.t = ve(n, i, t.t), t;
|
|
252
248
|
}, {
|
|
253
249
|
e: void 0,
|
|
254
250
|
t: void 0
|
|
@@ -257,16 +253,16 @@ function Rt(e) {
|
|
|
257
253
|
}
|
|
258
254
|
//#endregion
|
|
259
255
|
//#region src/framework/components/WidgetStatus.tsx
|
|
260
|
-
var
|
|
261
|
-
function
|
|
256
|
+
var an = /*#__PURE__*/ I("<p>");
|
|
257
|
+
function on(e) {
|
|
262
258
|
return (() => {
|
|
263
|
-
var t =
|
|
259
|
+
var t = an();
|
|
264
260
|
return P(t, (() => {
|
|
265
261
|
var t = F(() => !!e.isUnavailable);
|
|
266
262
|
return () => t() ? "Unavailable" : e.children;
|
|
267
263
|
})()), N((n) => {
|
|
268
264
|
var r = V("glasshome-widget-status", "relative", e.dimmed && "opacity-40", e.class), i = B.ACTIONS;
|
|
269
|
-
return r !== n.e && j(t, n.e = r), i !== n.t &&
|
|
265
|
+
return r !== n.e && j(t, n.e = r), i !== n.t && _e(t, "z-index", n.t = i), n;
|
|
270
266
|
}, {
|
|
271
267
|
e: void 0,
|
|
272
268
|
t: void 0
|
|
@@ -275,21 +271,21 @@ function Bt(e) {
|
|
|
275
271
|
}
|
|
276
272
|
//#endregion
|
|
277
273
|
//#region src/framework/components/WidgetTitle.tsx
|
|
278
|
-
var
|
|
279
|
-
function
|
|
274
|
+
var sn = /*#__PURE__*/ I("<span class=\"glasshome-widget-badge shrink-0\">"), cn = /*#__PURE__*/ I("<div><h3 class=glasshome-widget-title>");
|
|
275
|
+
function ln(e) {
|
|
280
276
|
return (() => {
|
|
281
|
-
var t =
|
|
282
|
-
return P(n, () => e.children), P(t, M(
|
|
277
|
+
var t = cn(), n = t.firstChild;
|
|
278
|
+
return P(n, () => e.children), P(t, M(w, {
|
|
283
279
|
get when() {
|
|
284
280
|
return F(() => e.badge !== void 0)() && e.badge > 0;
|
|
285
281
|
},
|
|
286
282
|
get children() {
|
|
287
|
-
var t =
|
|
283
|
+
var t = sn();
|
|
288
284
|
return P(t, () => e.badge), t;
|
|
289
285
|
}
|
|
290
286
|
}), null), N((n) => {
|
|
291
287
|
var r = V("relative flex items-center gap-2", e.class), i = B.ACTIONS;
|
|
292
|
-
return r !== n.e && j(t, n.e = r), i !== n.t &&
|
|
288
|
+
return r !== n.e && j(t, n.e = r), i !== n.t && _e(t, "z-index", n.t = i), n;
|
|
293
289
|
}, {
|
|
294
290
|
e: void 0,
|
|
295
291
|
t: void 0
|
|
@@ -297,8 +293,41 @@ function Ut(e) {
|
|
|
297
293
|
})();
|
|
298
294
|
}
|
|
299
295
|
//#endregion
|
|
296
|
+
//#region src/framework/utils/clipboard.ts
|
|
297
|
+
async function un(e) {
|
|
298
|
+
if (navigator.clipboard?.writeText) try {
|
|
299
|
+
return await navigator.clipboard.writeText(e), !0;
|
|
300
|
+
} catch {}
|
|
301
|
+
return dn(e);
|
|
302
|
+
}
|
|
303
|
+
function dn(e) {
|
|
304
|
+
let t = fn(), n = document.createElement("textarea");
|
|
305
|
+
n.value = e, n.setAttribute("readonly", ""), n.style.position = "fixed", n.style.top = "0", n.style.left = "0", n.style.opacity = "0", (t?.parentElement ?? document.body).append(n);
|
|
306
|
+
try {
|
|
307
|
+
return n.focus(), n.select(), n.setSelectionRange(0, e.length), n.getRootNode().activeElement === n && document.execCommand("copy");
|
|
308
|
+
} catch {
|
|
309
|
+
return !1;
|
|
310
|
+
} finally {
|
|
311
|
+
n.remove(), t?.focus();
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
function fn() {
|
|
315
|
+
let e = document.activeElement;
|
|
316
|
+
for (; e?.shadowRoot?.activeElement;) e = e.shadowRoot.activeElement;
|
|
317
|
+
return e instanceof HTMLElement ? e : null;
|
|
318
|
+
}
|
|
319
|
+
function pn(e = 2e3) {
|
|
320
|
+
let [t, n] = D("idle"), r;
|
|
321
|
+
return O(() => clearTimeout(r)), {
|
|
322
|
+
state: t,
|
|
323
|
+
copy: async (t) => {
|
|
324
|
+
n(await un(t) ? "copied" : "failed"), clearTimeout(r), r = setTimeout(() => n("idle"), e);
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
//#endregion
|
|
300
329
|
//#region src/framework/utils/entity-aggregation.ts
|
|
301
|
-
function
|
|
330
|
+
function mn(e, t = !1) {
|
|
302
331
|
if (e.length === 0) return {
|
|
303
332
|
isGroup: !1,
|
|
304
333
|
state: "unknown",
|
|
@@ -321,7 +350,7 @@ function Wt(e, t = !1) {
|
|
|
321
350
|
isUnavailable: t.state === "unavailable",
|
|
322
351
|
brightness: r,
|
|
323
352
|
brightnessPercent: i,
|
|
324
|
-
color:
|
|
353
|
+
color: _n(t),
|
|
325
354
|
onCount: +!!n,
|
|
326
355
|
totalCount: 1,
|
|
327
356
|
description: n ? "On" : "Off"
|
|
@@ -333,7 +362,7 @@ function Wt(e, t = !1) {
|
|
|
333
362
|
if (r++, t.attributes?.brightness !== void 0 && (s += t.attributes.brightness, c++), t.attributes?.rgb_color) l.push(t.attributes.rgb_color);
|
|
334
363
|
else if (t.attributes?.hs_color) {
|
|
335
364
|
let [e, n] = t.attributes.hs_color;
|
|
336
|
-
l.push(
|
|
365
|
+
l.push(gn(e, n));
|
|
337
366
|
}
|
|
338
367
|
break;
|
|
339
368
|
case "off":
|
|
@@ -350,9 +379,9 @@ function Wt(e, t = !1) {
|
|
|
350
379
|
if (l.length > 0) {
|
|
351
380
|
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;
|
|
352
381
|
y = `rgb(${Math.round(e * r)}, ${Math.round(t * r)}, ${Math.round(n * r)})`;
|
|
353
|
-
} else y =
|
|
354
|
-
let
|
|
355
|
-
return
|
|
382
|
+
} else y = _n(e[0]);
|
|
383
|
+
let te;
|
|
384
|
+
return te = m ? "All on" : h ? "All off" : r > 0 ? `${r} of ${u} on` : "Off", {
|
|
356
385
|
isGroup: n,
|
|
357
386
|
state: g,
|
|
358
387
|
isOn: _,
|
|
@@ -362,10 +391,10 @@ function Wt(e, t = !1) {
|
|
|
362
391
|
color: y,
|
|
363
392
|
onCount: r,
|
|
364
393
|
totalCount: u,
|
|
365
|
-
description:
|
|
394
|
+
description: te
|
|
366
395
|
};
|
|
367
396
|
}
|
|
368
|
-
function
|
|
397
|
+
function hn(e, t = "mean", n = !0) {
|
|
369
398
|
if (e.length === 0) return {
|
|
370
399
|
isGroup: !1,
|
|
371
400
|
state: "unknown",
|
|
@@ -461,7 +490,7 @@ function Gt(e, t = "mean", n = !0) {
|
|
|
461
490
|
memberValues: a
|
|
462
491
|
};
|
|
463
492
|
}
|
|
464
|
-
function
|
|
493
|
+
function gn(e, t) {
|
|
465
494
|
let n = t / 100, r = n * (1 - Math.abs(e / 60 % 2 - 1)), i = 1 - n, a = 0, o = 0, s = 0;
|
|
466
495
|
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], [
|
|
467
496
|
(a + i) * 255,
|
|
@@ -469,7 +498,7 @@ function Kt(e, t) {
|
|
|
469
498
|
(s + i) * 255
|
|
470
499
|
];
|
|
471
500
|
}
|
|
472
|
-
function
|
|
501
|
+
function _n(e) {
|
|
473
502
|
if (e.state !== "on") return "rgb(100, 100, 100)";
|
|
474
503
|
let t = (e.attributes?.brightness ?? 255) / 255;
|
|
475
504
|
if (e.attributes?.rgb_color) {
|
|
@@ -477,7 +506,7 @@ function qt(e) {
|
|
|
477
506
|
return `rgb(${Math.round(n * t)}, ${Math.round(r * t)}, ${Math.round(i * t)})`;
|
|
478
507
|
}
|
|
479
508
|
if (e.attributes?.hs_color) {
|
|
480
|
-
let [n, r] = e.attributes.hs_color, [i, a, o] =
|
|
509
|
+
let [n, r] = e.attributes.hs_color, [i, a, o] = gn(n, r);
|
|
481
510
|
return `rgb(${Math.round(i * t)}, ${Math.round(a * t)}, ${Math.round(o * t)})`;
|
|
482
511
|
}
|
|
483
512
|
if (e.attributes?.color_temp) {
|
|
@@ -488,7 +517,7 @@ function qt(e) {
|
|
|
488
517
|
}
|
|
489
518
|
//#endregion
|
|
490
519
|
//#region src/framework/utils/entity-state.ts
|
|
491
|
-
function
|
|
520
|
+
function vn(e) {
|
|
492
521
|
if (!e) return !1;
|
|
493
522
|
if ([
|
|
494
523
|
"on",
|
|
@@ -504,15 +533,15 @@ function Jt(e) {
|
|
|
504
533
|
}
|
|
505
534
|
return !1;
|
|
506
535
|
}
|
|
507
|
-
function
|
|
536
|
+
function yn(e, t, n) {
|
|
508
537
|
return e?.attributes ? e.attributes[t] ?? n : n;
|
|
509
538
|
}
|
|
510
|
-
function
|
|
511
|
-
return e.filter(
|
|
539
|
+
function bn(e) {
|
|
540
|
+
return e.filter(vn).length;
|
|
512
541
|
}
|
|
513
542
|
//#endregion
|
|
514
543
|
//#region src/framework/utils/format-value.ts
|
|
515
|
-
function
|
|
544
|
+
function xn(e, t, n) {
|
|
516
545
|
let { decimals: r, scale: i = !0 } = n || {};
|
|
517
546
|
if (typeof e == "string") return t ? `${e}${t}` : e;
|
|
518
547
|
if (e == null || Number.isNaN(e)) return t ? `--${t}` : "--";
|
|
@@ -523,35 +552,35 @@ function Zt(e, t, n) {
|
|
|
523
552
|
}
|
|
524
553
|
//#endregion
|
|
525
554
|
//#region src/framework/utils/interpret-value.ts
|
|
526
|
-
function
|
|
555
|
+
function Sn(e, t) {
|
|
527
556
|
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;
|
|
528
557
|
}
|
|
529
558
|
//#endregion
|
|
530
559
|
//#region src/framework/components/WidgetValue.tsx
|
|
531
|
-
var
|
|
532
|
-
function
|
|
560
|
+
var Cn = /*#__PURE__*/ I("<div class=glasshome-widget-subtitle>"), wn = /*#__PURE__*/ I("<div><div class=glasshome-widget-value>");
|
|
561
|
+
function Tn(e) {
|
|
533
562
|
return (() => {
|
|
534
|
-
var t =
|
|
535
|
-
return P(n, () =>
|
|
563
|
+
var t = wn(), n = t.firstChild;
|
|
564
|
+
return P(n, () => xn(e.value, e.unit)), P(t, M(w, {
|
|
536
565
|
get when() {
|
|
537
566
|
return F(() => !!e.interpret)() && typeof e.value == "number";
|
|
538
567
|
},
|
|
539
568
|
get children() {
|
|
540
|
-
var t =
|
|
541
|
-
return P(t, () =>
|
|
569
|
+
var t = Cn();
|
|
570
|
+
return P(t, () => Sn(e.value, e.unit)), t;
|
|
542
571
|
}
|
|
543
572
|
}), null), N(() => j(t, V("flex flex-col", e.class))), t;
|
|
544
573
|
})();
|
|
545
574
|
}
|
|
546
575
|
//#endregion
|
|
547
576
|
//#region src/framework/core/Widget.tsx
|
|
548
|
-
var
|
|
549
|
-
function
|
|
550
|
-
let n = k(R), [r, i] =
|
|
577
|
+
var En = /*#__PURE__*/ I("<div><div class=\"relative h-full w-full\">"), Dn = /*#__PURE__*/ I("<div class=\"glasshome-widget-loading pointer-events-none absolute inset-0 animate-pulse\">"), On = /*#__PURE__*/ I("<div class=\"flex h-full w-full flex-col items-center justify-center gap-2 text-center\">"), kn = /*#__PURE__*/ I("<div class=\"flex items-center justify-center text-muted-foreground\">"), An = /*#__PURE__*/ I("<h3 class=\"font-semibold text-sm text-foreground\">"), jn = /*#__PURE__*/ I("<p class=\"text-muted-foreground text-xs\">");
|
|
578
|
+
function Mn(t) {
|
|
579
|
+
let n = k(R), [r, i] = D(), [a, o] = D({
|
|
551
580
|
width: 0,
|
|
552
581
|
height: 0
|
|
553
582
|
});
|
|
554
|
-
|
|
583
|
+
pe(() => {
|
|
555
584
|
let e = r();
|
|
556
585
|
if (!e) return;
|
|
557
586
|
let t = new ResizeObserver(([e]) => {
|
|
@@ -565,19 +594,19 @@ function ln(t) {
|
|
|
565
594
|
height: e.contentRect.height
|
|
566
595
|
});
|
|
567
596
|
});
|
|
568
|
-
t.observe(e),
|
|
597
|
+
t.observe(e), O(() => t.disconnect());
|
|
569
598
|
}), he(() => {
|
|
570
599
|
let e = r()?.getRootNode();
|
|
571
|
-
|
|
600
|
+
Kt(typeof ShadowRoot < "u" && e instanceof ShadowRoot || typeof Document < "u" && e instanceof Document ? e : void 0);
|
|
572
601
|
});
|
|
573
602
|
let s = {
|
|
574
603
|
updateConfig: n?.updateConfig ?? (() => {}),
|
|
575
604
|
registerDialogOpener: n?.registerDialogOpener,
|
|
576
605
|
callService: n?.callService,
|
|
577
606
|
dimensions: e(() => a(), "ctx.dimensions")
|
|
578
|
-
}, c =
|
|
579
|
-
if (t.variant) return typeof t.variant == "string" ?
|
|
580
|
-
}), l =
|
|
607
|
+
}, c = E(() => {
|
|
608
|
+
if (t.variant) return typeof t.variant == "string" ? Jt(t.variant) : t.variant;
|
|
609
|
+
}), l = e(() => t.gradient, "widget.gradient"), u = E(() => ({
|
|
581
610
|
"container-type": "size",
|
|
582
611
|
"container-name": "widget",
|
|
583
612
|
"touch-action": t.gestures && !t.isEditMode ? t.gestures.touchAction() : void 0,
|
|
@@ -585,31 +614,35 @@ function ln(t) {
|
|
|
585
614
|
...c()?.styles?.cssVars || {},
|
|
586
615
|
...t.tone ? { "--widget-color": `var(--tone-${t.tone})` } : {},
|
|
587
616
|
...t.color ? { "--widget-color": t.color } : {},
|
|
588
|
-
...t.
|
|
589
|
-
...t.
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
617
|
+
...t.tone && t.tone !== "neutral" || t.color ? { "--glass-tone": "var(--widget-color)" } : {},
|
|
618
|
+
...t.colorTo ? {
|
|
619
|
+
"--widget-color-to": t.colorTo,
|
|
620
|
+
"--glass-tone-2": t.colorTo
|
|
621
|
+
} : {},
|
|
622
|
+
...t.gradient ? { "background-image": l() } : {}
|
|
623
|
+
})), d = () => !!t.gestures && !t.isEditMode, f = (e) => {
|
|
624
|
+
d() && t.gestures?.onPointerEnter(e);
|
|
594
625
|
}, p = (e) => {
|
|
595
|
-
|
|
626
|
+
d() && t.gestures?.onPointerDown(e);
|
|
596
627
|
}, m = (e) => {
|
|
597
|
-
|
|
628
|
+
d() && t.gestures?.onPointerMove(e);
|
|
598
629
|
}, h = (e) => {
|
|
599
|
-
|
|
630
|
+
d() && t.gestures?.onPointerUp(e);
|
|
631
|
+
}, g = (e) => {
|
|
632
|
+
d() && t.gestures?.onPointerCancel(e);
|
|
600
633
|
};
|
|
601
634
|
return M(R.Provider, {
|
|
602
635
|
value: s,
|
|
603
636
|
get children() {
|
|
604
|
-
return M(
|
|
637
|
+
return M(zt.Provider, {
|
|
605
638
|
value: a,
|
|
606
639
|
get children() {
|
|
607
|
-
var e =
|
|
608
|
-
return A(e, "pointercancel",
|
|
640
|
+
var e = En(), n = e.firstChild;
|
|
641
|
+
return A(e, "pointercancel", g), A(e, "pointerup", h), A(e, "pointermove", m), A(e, "pointerdown", p), A(e, "pointerenter", f), ye((e) => {
|
|
609
642
|
i(e), t.gestures?.bindElement(e);
|
|
610
643
|
}, e), P(n, (() => {
|
|
611
644
|
var e = F(() => !!t.emptyState);
|
|
612
|
-
return () => e() ? M(
|
|
645
|
+
return () => e() ? M(Nn, {
|
|
613
646
|
get icon() {
|
|
614
647
|
return t.emptyState.icon;
|
|
615
648
|
},
|
|
@@ -623,12 +656,12 @@ function ln(t) {
|
|
|
623
656
|
})()), P(e, (() => {
|
|
624
657
|
var e = F(() => !!t.loading);
|
|
625
658
|
return () => e() && (() => {
|
|
626
|
-
var e =
|
|
627
|
-
return N((t) =>
|
|
659
|
+
var e = Dn();
|
|
660
|
+
return N((t) => _e(e, "z-index", B.OVERLAY)), e;
|
|
628
661
|
})();
|
|
629
662
|
})(), null), N((r) => {
|
|
630
|
-
var i = V("glasshome-widget", "relative h-full w-full select-none overflow-hidden rounded-xl
|
|
631
|
-
return i !== r.e && j(e, r.e = i), r.t =
|
|
663
|
+
var i = V("glasshome-widget glass", "relative h-full w-full select-none overflow-hidden rounded-xl", c()?.styles?.class, t.class), a = u(), o = B.CONTENT;
|
|
664
|
+
return i !== r.e && j(e, r.e = i), r.t = ve(e, a, r.t), o !== r.a && _e(n, "z-index", r.a = o), r;
|
|
632
665
|
}, {
|
|
633
666
|
e: void 0,
|
|
634
667
|
t: void 0,
|
|
@@ -639,49 +672,419 @@ function ln(t) {
|
|
|
639
672
|
}
|
|
640
673
|
});
|
|
641
674
|
}
|
|
642
|
-
function
|
|
675
|
+
function Nn(e) {
|
|
643
676
|
return (() => {
|
|
644
|
-
var t =
|
|
677
|
+
var t = On();
|
|
645
678
|
return P(t, (() => {
|
|
646
679
|
var t = F(() => !!e.icon);
|
|
647
680
|
return () => t() && (() => {
|
|
648
|
-
var t =
|
|
681
|
+
var t = kn();
|
|
649
682
|
return P(t, () => e.icon), t;
|
|
650
683
|
})();
|
|
651
684
|
})(), null), P(t, (() => {
|
|
652
685
|
var t = F(() => !!e.title);
|
|
653
686
|
return () => t() && (() => {
|
|
654
|
-
var t =
|
|
687
|
+
var t = An();
|
|
655
688
|
return P(t, () => e.title), t;
|
|
656
689
|
})();
|
|
657
690
|
})(), null), P(t, (() => {
|
|
658
691
|
var t = F(() => !!e.message);
|
|
659
692
|
return () => t() && (() => {
|
|
660
|
-
var t =
|
|
693
|
+
var t = jn();
|
|
661
694
|
return P(t, () => e.message), t;
|
|
662
695
|
})();
|
|
663
696
|
})(), null), t;
|
|
664
697
|
})();
|
|
665
698
|
}
|
|
666
|
-
var H =
|
|
667
|
-
H.Content =
|
|
699
|
+
var H = Mn;
|
|
700
|
+
H.Content = $t, H.Icon = rn, H.Title = ln, H.Status = on, H.Value = Tn, H.SliderFill = Zt;
|
|
701
|
+
//#endregion
|
|
702
|
+
//#region src/framework/dialogs/debug-view.tsx
|
|
703
|
+
var Pn = /*#__PURE__*/ I("<pre class=\"max-h-64 overflow-auto p-3 font-mono text-muted-foreground text-xs leading-relaxed\">"), Fn = /*#__PURE__*/ I("<span class=\"flex items-center gap-2\">"), In = /*#__PURE__*/ I("<section class=\"flex min-w-0 flex-col gap-2\"><header class=\"flex items-center gap-3\"><div class=\"flex min-w-0 flex-1 flex-col\"></div></header><div class=\"flex flex-col gap-2\">"), Ln = /*#__PURE__*/ I("<div class=\"flex flex-col\">"), Rn = /*#__PURE__*/ I("<pre class=\"max-h-96 overflow-auto whitespace-pre-wrap p-3 font-mono text-muted-foreground text-xs leading-relaxed\">");
|
|
704
|
+
function zn(e, t, n) {
|
|
705
|
+
return {
|
|
706
|
+
widgetConfig: e,
|
|
707
|
+
entities: t.map((e) => ({
|
|
708
|
+
entity_id: e.id,
|
|
709
|
+
state: e.state,
|
|
710
|
+
domain: e.domain,
|
|
711
|
+
friendly_name: e.friendlyName,
|
|
712
|
+
device_class: e.deviceClass ?? null,
|
|
713
|
+
area_id: e.areaId,
|
|
714
|
+
last_changed: e.lastChanged.toISOString(),
|
|
715
|
+
last_updated: e.lastUpdated.toISOString(),
|
|
716
|
+
attributes: e.attributes
|
|
717
|
+
})),
|
|
718
|
+
...n
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
var Bn = (e) => JSON.stringify(e, null, 2), Vn = {
|
|
722
|
+
idle: "lucide:copy",
|
|
723
|
+
copied: "lucide:check",
|
|
724
|
+
failed: "lucide:triangle-alert"
|
|
725
|
+
}, Hn = {
|
|
726
|
+
idle: "text-muted-foreground",
|
|
727
|
+
copied: "text-success",
|
|
728
|
+
failed: "text-destructive"
|
|
729
|
+
};
|
|
730
|
+
function Un(e) {
|
|
731
|
+
let { state: t, copy: n } = pn();
|
|
732
|
+
return M(ke, {
|
|
733
|
+
variant: "ghost",
|
|
734
|
+
size: "icon",
|
|
735
|
+
class: "size-8",
|
|
736
|
+
get "aria-label"() {
|
|
737
|
+
return e.label;
|
|
738
|
+
},
|
|
739
|
+
onClick: () => void n(e.text()),
|
|
740
|
+
get children() {
|
|
741
|
+
return M(qe, {
|
|
742
|
+
get icon() {
|
|
743
|
+
return Vn[t()];
|
|
744
|
+
},
|
|
745
|
+
width: 16,
|
|
746
|
+
height: 16,
|
|
747
|
+
get class() {
|
|
748
|
+
return Hn[t()];
|
|
749
|
+
}
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
function Wn(e) {
|
|
755
|
+
let t = e.replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ");
|
|
756
|
+
return t.charAt(0).toUpperCase() + t.slice(1).toLowerCase();
|
|
757
|
+
}
|
|
758
|
+
var Gn = (e) => typeof e != "object" || !e;
|
|
759
|
+
function Kn(e) {
|
|
760
|
+
return e == null ? "None" : String(e);
|
|
761
|
+
}
|
|
762
|
+
function qn(e) {
|
|
763
|
+
return Array.isArray(e) ? e.length : typeof e == "object" && e ? Object.keys(e).length : 0;
|
|
764
|
+
}
|
|
765
|
+
function Jn(e) {
|
|
766
|
+
let t = new Date(e);
|
|
767
|
+
return Number.isNaN(t.getTime()) ? e : t.toLocaleString();
|
|
768
|
+
}
|
|
769
|
+
function Yn(e) {
|
|
770
|
+
return M(ut, {
|
|
771
|
+
class: "overflow-hidden p-0",
|
|
772
|
+
get children() {
|
|
773
|
+
var t = Pn();
|
|
774
|
+
return P(t, () => Bn(e.value)), t;
|
|
775
|
+
}
|
|
776
|
+
});
|
|
777
|
+
}
|
|
778
|
+
function Xn(e) {
|
|
779
|
+
return M(Se, {
|
|
780
|
+
collapsible: !0,
|
|
781
|
+
class: "border-border/50 border-t",
|
|
782
|
+
get children() {
|
|
783
|
+
return M(we, {
|
|
784
|
+
get value() {
|
|
785
|
+
return e.label;
|
|
786
|
+
},
|
|
787
|
+
get children() {
|
|
788
|
+
return [M(Te, {
|
|
789
|
+
class: "py-3 text-muted-foreground text-xs",
|
|
790
|
+
get children() {
|
|
791
|
+
var t = Fn();
|
|
792
|
+
return P(t, () => e.label, null), P(t, M(w, {
|
|
793
|
+
get when() {
|
|
794
|
+
return e.count !== void 0;
|
|
795
|
+
},
|
|
796
|
+
get children() {
|
|
797
|
+
return M(ze, { get children() {
|
|
798
|
+
return e.count;
|
|
799
|
+
} });
|
|
800
|
+
}
|
|
801
|
+
}), null), t;
|
|
802
|
+
}
|
|
803
|
+
}), M(Ce, { get children() {
|
|
804
|
+
return M(Yn, { get value() {
|
|
805
|
+
return e.value;
|
|
806
|
+
} });
|
|
807
|
+
} })];
|
|
808
|
+
}
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
function U(e) {
|
|
814
|
+
return (() => {
|
|
815
|
+
var t = In(), n = t.firstChild, r = n.firstChild, i = n.nextSibling;
|
|
816
|
+
return P(n, M(ct, {
|
|
817
|
+
get icon() {
|
|
818
|
+
return e.icon;
|
|
819
|
+
},
|
|
820
|
+
size: "sm"
|
|
821
|
+
}), r), P(r, M(Ge, {
|
|
822
|
+
class: "truncate",
|
|
823
|
+
get children() {
|
|
824
|
+
return e.title;
|
|
825
|
+
}
|
|
826
|
+
}), null), P(r, M(w, {
|
|
827
|
+
get when() {
|
|
828
|
+
return e.subtitle;
|
|
829
|
+
},
|
|
830
|
+
children: (e) => M(lt, {
|
|
831
|
+
class: "truncate font-mono",
|
|
832
|
+
get children() {
|
|
833
|
+
return e();
|
|
834
|
+
}
|
|
835
|
+
})
|
|
836
|
+
}), null), P(n, () => e.badge, null), P(n, M(Un, {
|
|
837
|
+
get label() {
|
|
838
|
+
return `Copy ${e.title}`;
|
|
839
|
+
},
|
|
840
|
+
text: () => Bn(e.source)
|
|
841
|
+
}), null), P(i, () => e.children), t;
|
|
842
|
+
})();
|
|
843
|
+
}
|
|
844
|
+
function Zn(e) {
|
|
845
|
+
let t = E(() => Object.entries(e.record)), n = E(() => t().filter(([, e]) => Gn(e))), r = E(() => t().filter(([, e]) => !Gn(e)));
|
|
846
|
+
return M(w, {
|
|
847
|
+
get when() {
|
|
848
|
+
return t().length > 0;
|
|
849
|
+
},
|
|
850
|
+
get fallback() {
|
|
851
|
+
return M(lt, { children: "Nothing set" });
|
|
852
|
+
},
|
|
853
|
+
get children() {
|
|
854
|
+
return [M(w, {
|
|
855
|
+
get when() {
|
|
856
|
+
return n().length > 0;
|
|
857
|
+
},
|
|
858
|
+
get children() {
|
|
859
|
+
var e = Ln();
|
|
860
|
+
return P(e, M(C, {
|
|
861
|
+
get each() {
|
|
862
|
+
return n();
|
|
863
|
+
},
|
|
864
|
+
children: ([e, t]) => M(L, {
|
|
865
|
+
get label() {
|
|
866
|
+
return Wn(e);
|
|
867
|
+
},
|
|
868
|
+
get children() {
|
|
869
|
+
return Kn(t);
|
|
870
|
+
}
|
|
871
|
+
})
|
|
872
|
+
})), e;
|
|
873
|
+
}
|
|
874
|
+
}), M(C, {
|
|
875
|
+
get each() {
|
|
876
|
+
return r();
|
|
877
|
+
},
|
|
878
|
+
children: ([e, t]) => M(Xn, {
|
|
879
|
+
get label() {
|
|
880
|
+
return Wn(e);
|
|
881
|
+
},
|
|
882
|
+
get count() {
|
|
883
|
+
return qn(t);
|
|
884
|
+
},
|
|
885
|
+
value: t
|
|
886
|
+
})
|
|
887
|
+
})];
|
|
888
|
+
}
|
|
889
|
+
});
|
|
890
|
+
}
|
|
891
|
+
function Qn(e) {
|
|
892
|
+
let t = () => e.entity.attributes ?? {};
|
|
893
|
+
return M(U, {
|
|
894
|
+
icon: "lucide:activity",
|
|
895
|
+
get title() {
|
|
896
|
+
return e.entity.friendly_name ?? e.entity.entity_id;
|
|
897
|
+
},
|
|
898
|
+
get subtitle() {
|
|
899
|
+
return e.entity.entity_id;
|
|
900
|
+
},
|
|
901
|
+
get badge() {
|
|
902
|
+
return M(De, { get children() {
|
|
903
|
+
return e.entity.state;
|
|
904
|
+
} });
|
|
905
|
+
},
|
|
906
|
+
get source() {
|
|
907
|
+
return e.entity;
|
|
908
|
+
},
|
|
909
|
+
get children() {
|
|
910
|
+
return [(() => {
|
|
911
|
+
var t = Ln();
|
|
912
|
+
return P(t, M(L, {
|
|
913
|
+
label: "Domain",
|
|
914
|
+
get children() {
|
|
915
|
+
return e.entity.domain;
|
|
916
|
+
}
|
|
917
|
+
}), null), P(t, M(w, {
|
|
918
|
+
get when() {
|
|
919
|
+
return e.entity.device_class;
|
|
920
|
+
},
|
|
921
|
+
children: (e) => M(L, {
|
|
922
|
+
label: "Device class",
|
|
923
|
+
get children() {
|
|
924
|
+
return e();
|
|
925
|
+
}
|
|
926
|
+
})
|
|
927
|
+
}), null), P(t, M(w, {
|
|
928
|
+
get when() {
|
|
929
|
+
return e.entity.area_id;
|
|
930
|
+
},
|
|
931
|
+
children: (e) => M(L, {
|
|
932
|
+
label: "Area",
|
|
933
|
+
get children() {
|
|
934
|
+
return e();
|
|
935
|
+
}
|
|
936
|
+
})
|
|
937
|
+
}), null), P(t, M(L, {
|
|
938
|
+
label: "Changed",
|
|
939
|
+
get children() {
|
|
940
|
+
return Jn(e.entity.last_changed);
|
|
941
|
+
}
|
|
942
|
+
}), null), P(t, M(L, {
|
|
943
|
+
label: "Updated",
|
|
944
|
+
get children() {
|
|
945
|
+
return Jn(e.entity.last_updated);
|
|
946
|
+
}
|
|
947
|
+
}), null), t;
|
|
948
|
+
})(), M(w, {
|
|
949
|
+
get when() {
|
|
950
|
+
return qn(t()) > 0;
|
|
951
|
+
},
|
|
952
|
+
get children() {
|
|
953
|
+
return M(Xn, {
|
|
954
|
+
label: "Attributes",
|
|
955
|
+
get count() {
|
|
956
|
+
return qn(t());
|
|
957
|
+
},
|
|
958
|
+
get value() {
|
|
959
|
+
return t();
|
|
960
|
+
}
|
|
961
|
+
});
|
|
962
|
+
}
|
|
963
|
+
})];
|
|
964
|
+
}
|
|
965
|
+
});
|
|
966
|
+
}
|
|
967
|
+
function $n(e) {
|
|
968
|
+
let t = E(() => Object.keys(e.data).filter((e) => e !== "widgetConfig" && e !== "entities"));
|
|
969
|
+
return M(We, { get children() {
|
|
970
|
+
return [
|
|
971
|
+
M(U, {
|
|
972
|
+
icon: "lucide:sliders-horizontal",
|
|
973
|
+
title: "Configuration",
|
|
974
|
+
get source() {
|
|
975
|
+
return e.data.widgetConfig;
|
|
976
|
+
},
|
|
977
|
+
get children() {
|
|
978
|
+
return M(Zn, { get record() {
|
|
979
|
+
return e.data.widgetConfig;
|
|
980
|
+
} });
|
|
981
|
+
}
|
|
982
|
+
}),
|
|
983
|
+
M(C, {
|
|
984
|
+
get each() {
|
|
985
|
+
return e.data.entities;
|
|
986
|
+
},
|
|
987
|
+
children: (e) => M(Qn, { entity: e })
|
|
988
|
+
}),
|
|
989
|
+
M(C, {
|
|
990
|
+
get each() {
|
|
991
|
+
return t();
|
|
992
|
+
},
|
|
993
|
+
children: (t) => M(U, {
|
|
994
|
+
icon: "lucide:braces",
|
|
995
|
+
get title() {
|
|
996
|
+
return Wn(t);
|
|
997
|
+
},
|
|
998
|
+
get source() {
|
|
999
|
+
return e.data[t];
|
|
1000
|
+
},
|
|
1001
|
+
get children() {
|
|
1002
|
+
return M(Yn, { get value() {
|
|
1003
|
+
return e.data[t];
|
|
1004
|
+
} });
|
|
1005
|
+
}
|
|
1006
|
+
})
|
|
1007
|
+
})
|
|
1008
|
+
];
|
|
1009
|
+
} });
|
|
1010
|
+
}
|
|
1011
|
+
function er(e) {
|
|
1012
|
+
if (typeof e != "object" || !e) return;
|
|
1013
|
+
let t = e;
|
|
1014
|
+
return Array.isArray(t.entities) && typeof t.widgetConfig == "object" ? t : void 0;
|
|
1015
|
+
}
|
|
1016
|
+
function tr(e) {
|
|
1017
|
+
let t = E(() => er(e.data));
|
|
1018
|
+
return M(w, {
|
|
1019
|
+
get when() {
|
|
1020
|
+
return e.data !== void 0;
|
|
1021
|
+
},
|
|
1022
|
+
get fallback() {
|
|
1023
|
+
return M(Be, { get children() {
|
|
1024
|
+
return M(He, { get children() {
|
|
1025
|
+
return [M(Ue, { children: "Nothing to inspect" }), M(Ve, { children: "This widget publishes no debug information." })];
|
|
1026
|
+
} });
|
|
1027
|
+
} });
|
|
1028
|
+
},
|
|
1029
|
+
get children() {
|
|
1030
|
+
return M(w, {
|
|
1031
|
+
get when() {
|
|
1032
|
+
return t();
|
|
1033
|
+
},
|
|
1034
|
+
get fallback() {
|
|
1035
|
+
return M(U, {
|
|
1036
|
+
icon: "lucide:braces",
|
|
1037
|
+
title: "Debug data",
|
|
1038
|
+
get source() {
|
|
1039
|
+
return e.data;
|
|
1040
|
+
},
|
|
1041
|
+
get children() {
|
|
1042
|
+
return M(w, {
|
|
1043
|
+
get when() {
|
|
1044
|
+
return typeof e.data == "string";
|
|
1045
|
+
},
|
|
1046
|
+
get fallback() {
|
|
1047
|
+
return M(Yn, { get value() {
|
|
1048
|
+
return e.data;
|
|
1049
|
+
} });
|
|
1050
|
+
},
|
|
1051
|
+
get children() {
|
|
1052
|
+
return M(ut, {
|
|
1053
|
+
class: "overflow-hidden p-0",
|
|
1054
|
+
get children() {
|
|
1055
|
+
var t = Rn();
|
|
1056
|
+
return P(t, () => e.data), t;
|
|
1057
|
+
}
|
|
1058
|
+
});
|
|
1059
|
+
}
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1062
|
+
});
|
|
1063
|
+
},
|
|
1064
|
+
children: (e) => M($n, { get data() {
|
|
1065
|
+
return e();
|
|
1066
|
+
} })
|
|
1067
|
+
});
|
|
1068
|
+
}
|
|
1069
|
+
});
|
|
1070
|
+
}
|
|
668
1071
|
//#endregion
|
|
669
1072
|
//#region src/framework/dialogs/validate-config.ts
|
|
670
|
-
function
|
|
1073
|
+
function nr(e) {
|
|
671
1074
|
let t = "";
|
|
672
1075
|
for (let n of e) t += typeof n == "number" ? `[${n}]` : t ? `.${String(n)}` : String(n);
|
|
673
1076
|
return t;
|
|
674
1077
|
}
|
|
675
|
-
function
|
|
1078
|
+
function rr(e, t) {
|
|
676
1079
|
let n = e.safeParse(t);
|
|
677
1080
|
return n.success ? null : n.error.issues.map((e) => {
|
|
678
|
-
let t =
|
|
1081
|
+
let t = nr(e.path);
|
|
679
1082
|
return t ? `${t}: ${e.message}` : e.message;
|
|
680
1083
|
});
|
|
681
1084
|
}
|
|
682
1085
|
//#endregion
|
|
683
1086
|
//#region src/framework/dialogs/WidgetDialog.tsx
|
|
684
|
-
var
|
|
1087
|
+
var ir = /*#__PURE__*/ I("<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\">"), ar = /*#__PURE__*/ I("<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"), or = /*#__PURE__*/ I("<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>"), sr = /*#__PURE__*/ I("<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\">"), cr = /*#__PURE__*/ I("<span class=\"inline-flex size-3.5 shrink-0 items-center\">"), lr = (e) => At(e), ur = {
|
|
685
1088
|
sm: "sm",
|
|
686
1089
|
md: "md",
|
|
687
1090
|
lg: "lg",
|
|
@@ -690,38 +1093,42 @@ var pn = /*#__PURE__*/ L("<svg xmlns=http://www.w3.org/2000/svg class=size-3.5 f
|
|
|
690
1093
|
"2xl": "xl",
|
|
691
1094
|
"3xl": "xl",
|
|
692
1095
|
"4xl": "full"
|
|
1096
|
+
}, dr = {
|
|
1097
|
+
idle: "Copy all",
|
|
1098
|
+
copied: "Copied",
|
|
1099
|
+
failed: "Copy failed"
|
|
693
1100
|
};
|
|
694
|
-
function
|
|
695
|
-
let [t] = ge(e, /* @__PURE__ */ "open.onOpenChange.title.description.onSave.hasUnsavedChanges.onDelete.editContent.controlsContent.debugContent.debugData.tabs.class.maxWidth.defaultTab.activeTab.onActiveTabChange.headerActions.configSchema.config.onConfigSave.ResponsiveDialog.ResponsiveDialogContent.ResponsiveDialogHeader.ResponsiveDialogTitle.ResponsiveDialogDescription.ResponsiveDialogBody.ResponsiveDialogFooter.Button.SchemaForm.Tabs.TabsList.TabsTrigger.TabsContent".split(".")), n = () => !!t.configSchema && !!t.config && !!t.onConfigSave && !!t.SchemaForm, [r, i] =
|
|
696
|
-
|
|
1101
|
+
function fr(e) {
|
|
1102
|
+
let [t] = ge(e, /* @__PURE__ */ "open.onOpenChange.title.description.onSave.hasUnsavedChanges.onDelete.editContent.controlsContent.debugContent.debugData.tabs.class.maxWidth.defaultTab.activeTab.onActiveTabChange.headerActions.configSchema.config.onConfigSave.ResponsiveDialog.ResponsiveDialogContent.ResponsiveDialogHeader.ResponsiveDialogTitle.ResponsiveDialogDescription.ResponsiveDialogBody.ResponsiveDialogFooter.Button.SchemaForm.Tabs.TabsList.TabsTrigger.TabsContent".split(".")), n = () => !!t.configSchema && !!t.config && !!t.onConfigSave && !!t.SchemaForm, [r, i] = D({}), [a, o] = D(null), [s, c] = D([]);
|
|
1103
|
+
pe(me(() => t.config, (e) => {
|
|
697
1104
|
e && i({ ...e });
|
|
698
|
-
})),
|
|
699
|
-
e && o(
|
|
1105
|
+
})), pe(me(() => t.configSchema, (e) => {
|
|
1106
|
+
e && o(lr(e));
|
|
700
1107
|
}));
|
|
701
1108
|
let l = () => n() && JSON.stringify(r()) !== JSON.stringify(t.config), u = (e) => {
|
|
702
1109
|
!e && t.config && (i({ ...t.config }), c([])), t.onOpenChange(e);
|
|
703
1110
|
}, d = () => {
|
|
704
1111
|
let e = t.configSchema;
|
|
705
1112
|
if (e) {
|
|
706
|
-
let t =
|
|
1113
|
+
let t = rr(e, r());
|
|
707
1114
|
if (t) {
|
|
708
1115
|
c(t);
|
|
709
1116
|
return;
|
|
710
1117
|
}
|
|
711
1118
|
}
|
|
712
1119
|
c([]), t.onConfigSave?.(r());
|
|
713
|
-
}, [f, p] =
|
|
1120
|
+
}, [f, p] = D(t.defaultTab ?? "controls"), m = () => t.activeTab ?? f(), h = (e) => {
|
|
714
1121
|
t.onActiveTabChange ? t.onActiveTabChange(e) : p(e);
|
|
715
|
-
}, g = () =>
|
|
1122
|
+
}, g = () => ur[t.maxWidth ?? "xl"], _ = () => {
|
|
716
1123
|
if (t.tabs) return t.tabs;
|
|
717
1124
|
let e = [];
|
|
718
1125
|
return e.push({
|
|
719
1126
|
id: "edit",
|
|
720
1127
|
label: "Edit",
|
|
721
|
-
icon:
|
|
1128
|
+
icon: ir(),
|
|
722
1129
|
content: t.editContent ?? (() => {
|
|
723
1130
|
let e = t.SchemaForm, o = n() ? a() : void 0;
|
|
724
|
-
return !o || !e ?
|
|
1131
|
+
return !o || !e ? ar() : M(e, {
|
|
725
1132
|
schema: o,
|
|
726
1133
|
get data() {
|
|
727
1134
|
return r();
|
|
@@ -735,35 +1142,40 @@ function Sn(e) {
|
|
|
735
1142
|
}), e.push({
|
|
736
1143
|
id: "controls",
|
|
737
1144
|
label: "Controls",
|
|
738
|
-
icon:
|
|
739
|
-
content: t.controlsContent ??
|
|
1145
|
+
icon: or(),
|
|
1146
|
+
content: t.controlsContent ?? M(Be, { get children() {
|
|
1147
|
+
return M(He, { get children() {
|
|
1148
|
+
return [M(Ue, { children: "No controls" }), M(Ve, { children: "This widget is shown as is." })];
|
|
1149
|
+
} });
|
|
1150
|
+
} })
|
|
740
1151
|
}), e.push({
|
|
741
1152
|
id: "debug",
|
|
742
1153
|
label: "Debug",
|
|
743
|
-
icon:
|
|
744
|
-
content: t.debugContent ??
|
|
1154
|
+
icon: sr(),
|
|
1155
|
+
content: t.debugContent ?? M(tr, { get data() {
|
|
1156
|
+
return t.debugData;
|
|
1157
|
+
} })
|
|
745
1158
|
}), e;
|
|
746
|
-
}, v =
|
|
747
|
-
if (t.debugData
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
}, ee = t.ResponsiveDialog, y = t.ResponsiveDialogContent, b = t.ResponsiveDialogHeader, te = t.ResponsiveDialogTitle, ne = t.ResponsiveDialogDescription, re = t.ResponsiveDialogBody ?? Le, ie = t.ResponsiveDialogFooter ?? He, ae = t.Tabs ?? nt, oe = t.TabsList ?? ot, se = t.TabsTrigger ?? ct, ce = t.TabsContent ?? it, x = t.Button, S = D(pe([
|
|
1159
|
+
}, v = pn(), ee = () => {
|
|
1160
|
+
if (t.debugData === void 0) return;
|
|
1161
|
+
let e = typeof t.debugData == "string" ? t.debugData : JSON.stringify(t.debugData, null, 2);
|
|
1162
|
+
v.copy(e);
|
|
1163
|
+
}, y = t.ResponsiveDialog, te = t.ResponsiveDialogContent, ne = t.ResponsiveDialogHeader, re = t.ResponsiveDialogTitle, ie = t.ResponsiveDialogDescription, ae = t.ResponsiveDialogBody ?? Qe, oe = t.ResponsiveDialogFooter ?? rt, se = t.Tabs ?? bt, ce = t.TabsList ?? wt, le = t.TabsTrigger ?? Et, ue = t.TabsContent ?? St, b = t.Button, x = E(me([
|
|
752
1164
|
() => t.open,
|
|
753
1165
|
a,
|
|
754
1166
|
() => t.config,
|
|
755
1167
|
() => t.tabs
|
|
756
|
-
], () => _())),
|
|
757
|
-
let e =
|
|
1168
|
+
], () => _())), de = (e) => n() ? u(e) : t.onOpenChange(e), fe = () => n() ? l() : t.hasUnsavedChanges, S = () => n() ? d : t.onSave, T = () => {
|
|
1169
|
+
let e = x(), t = m();
|
|
758
1170
|
return e.some((e) => e.id === t) ? t : e[0]?.id ?? t;
|
|
759
|
-
},
|
|
760
|
-
return M(
|
|
1171
|
+
}, O = () => T() === "edit" && (S() || t.onDelete) || T() === "debug" && t.debugData !== void 0;
|
|
1172
|
+
return M(y, {
|
|
761
1173
|
get open() {
|
|
762
1174
|
return t.open;
|
|
763
1175
|
},
|
|
764
|
-
onOpenChange: (e) =>
|
|
1176
|
+
onOpenChange: (e) => de(e),
|
|
765
1177
|
get children() {
|
|
766
|
-
return M(
|
|
1178
|
+
return M(te, {
|
|
767
1179
|
get size() {
|
|
768
1180
|
return g();
|
|
769
1181
|
},
|
|
@@ -771,31 +1183,31 @@ function Sn(e) {
|
|
|
771
1183
|
return t.class;
|
|
772
1184
|
},
|
|
773
1185
|
get children() {
|
|
774
|
-
return M(
|
|
1186
|
+
return M(se, {
|
|
775
1187
|
get value() {
|
|
776
|
-
return
|
|
1188
|
+
return T();
|
|
777
1189
|
},
|
|
778
1190
|
onChange: h,
|
|
779
1191
|
layout: "split",
|
|
780
1192
|
get children() {
|
|
781
1193
|
return [
|
|
782
|
-
M(
|
|
1194
|
+
M(ne, {
|
|
783
1195
|
class: "flex-wrap",
|
|
784
1196
|
get action() {
|
|
785
|
-
return [M(
|
|
1197
|
+
return [M(ce, {
|
|
786
1198
|
class: "w-auto",
|
|
787
1199
|
get children() {
|
|
788
|
-
return M(
|
|
1200
|
+
return M(C, {
|
|
789
1201
|
get each() {
|
|
790
|
-
return
|
|
1202
|
+
return x();
|
|
791
1203
|
},
|
|
792
|
-
children: (e) => M(
|
|
1204
|
+
children: (e) => M(le, {
|
|
793
1205
|
get value() {
|
|
794
1206
|
return e.id;
|
|
795
1207
|
},
|
|
796
1208
|
get children() {
|
|
797
1209
|
return [(() => {
|
|
798
|
-
var t =
|
|
1210
|
+
var t = cr();
|
|
799
1211
|
return P(t, () => e.icon), t;
|
|
800
1212
|
})(), F(() => e.label)];
|
|
801
1213
|
}
|
|
@@ -805,29 +1217,29 @@ function Sn(e) {
|
|
|
805
1217
|
}), F(() => t.headerActions)];
|
|
806
1218
|
},
|
|
807
1219
|
get children() {
|
|
808
|
-
return [M(
|
|
1220
|
+
return [M(re, {
|
|
809
1221
|
class: "truncate",
|
|
810
1222
|
get children() {
|
|
811
1223
|
return t.title;
|
|
812
1224
|
}
|
|
813
|
-
}), M(
|
|
1225
|
+
}), M(w, {
|
|
814
1226
|
get when() {
|
|
815
1227
|
return t.description;
|
|
816
1228
|
},
|
|
817
1229
|
get children() {
|
|
818
|
-
return M(
|
|
1230
|
+
return M(ie, { get children() {
|
|
819
1231
|
return t.description;
|
|
820
1232
|
} });
|
|
821
1233
|
}
|
|
822
1234
|
})];
|
|
823
1235
|
}
|
|
824
1236
|
}),
|
|
825
|
-
M(
|
|
826
|
-
return M(
|
|
1237
|
+
M(ae, { get children() {
|
|
1238
|
+
return M(C, {
|
|
827
1239
|
get each() {
|
|
828
|
-
return
|
|
1240
|
+
return x();
|
|
829
1241
|
},
|
|
830
|
-
children: (e) => M(
|
|
1242
|
+
children: (e) => M(ue, {
|
|
831
1243
|
get value() {
|
|
832
1244
|
return e.id;
|
|
833
1245
|
},
|
|
@@ -837,19 +1249,19 @@ function Sn(e) {
|
|
|
837
1249
|
})
|
|
838
1250
|
});
|
|
839
1251
|
} }),
|
|
840
|
-
M(
|
|
1252
|
+
M(w, {
|
|
841
1253
|
get when() {
|
|
842
|
-
return
|
|
1254
|
+
return O();
|
|
843
1255
|
},
|
|
844
1256
|
get children() {
|
|
845
|
-
return M(
|
|
1257
|
+
return M(oe, { get children() {
|
|
846
1258
|
return [
|
|
847
|
-
M(
|
|
1259
|
+
M(w, {
|
|
848
1260
|
get when() {
|
|
849
|
-
return F(() =>
|
|
1261
|
+
return F(() => T() === "edit")() && t.onDelete;
|
|
850
1262
|
},
|
|
851
1263
|
get children() {
|
|
852
|
-
return M(
|
|
1264
|
+
return M(b, {
|
|
853
1265
|
size: "sm",
|
|
854
1266
|
variant: "destructive",
|
|
855
1267
|
onClick: () => t.onDelete?.(),
|
|
@@ -857,31 +1269,33 @@ function Sn(e) {
|
|
|
857
1269
|
});
|
|
858
1270
|
}
|
|
859
1271
|
}),
|
|
860
|
-
M(
|
|
1272
|
+
M(w, {
|
|
861
1273
|
get when() {
|
|
862
|
-
return F(() =>
|
|
1274
|
+
return F(() => T() === "edit")() && S();
|
|
863
1275
|
},
|
|
864
1276
|
get children() {
|
|
865
|
-
return M(
|
|
1277
|
+
return M(b, {
|
|
866
1278
|
size: "sm",
|
|
867
1279
|
get disabled() {
|
|
868
|
-
return !
|
|
1280
|
+
return !fe();
|
|
869
1281
|
},
|
|
870
|
-
onClick: () =>
|
|
1282
|
+
onClick: () => S()?.(),
|
|
871
1283
|
children: "Save"
|
|
872
1284
|
});
|
|
873
1285
|
}
|
|
874
1286
|
}),
|
|
875
|
-
M(
|
|
1287
|
+
M(w, {
|
|
876
1288
|
get when() {
|
|
877
|
-
return F(() =>
|
|
1289
|
+
return F(() => T() === "debug")() && t.debugData !== void 0;
|
|
878
1290
|
},
|
|
879
1291
|
get children() {
|
|
880
|
-
return M(
|
|
1292
|
+
return M(b, {
|
|
881
1293
|
size: "sm",
|
|
882
1294
|
variant: "outline",
|
|
883
|
-
onClick:
|
|
884
|
-
children
|
|
1295
|
+
onClick: ee,
|
|
1296
|
+
get children() {
|
|
1297
|
+
return dr[v.state()];
|
|
1298
|
+
}
|
|
885
1299
|
});
|
|
886
1300
|
}
|
|
887
1301
|
})
|
|
@@ -899,49 +1313,49 @@ function Sn(e) {
|
|
|
899
1313
|
}
|
|
900
1314
|
//#endregion
|
|
901
1315
|
//#region src/framework/hooks/use-widget-dashboard.ts
|
|
902
|
-
var
|
|
1316
|
+
var pr = {
|
|
903
1317
|
name: "",
|
|
904
1318
|
icon: "",
|
|
905
1319
|
areaId: null
|
|
906
1320
|
};
|
|
907
|
-
function
|
|
1321
|
+
function mr() {
|
|
908
1322
|
let e = k(R);
|
|
909
|
-
return () => e?.dashboard?.() ??
|
|
1323
|
+
return () => e?.dashboard?.() ?? pr;
|
|
910
1324
|
}
|
|
911
1325
|
//#endregion
|
|
912
1326
|
//#region src/framework/hooks/use-widget-viewer.ts
|
|
913
|
-
var
|
|
914
|
-
function
|
|
1327
|
+
var hr = { name: null };
|
|
1328
|
+
function gr() {
|
|
915
1329
|
let e = k(R);
|
|
916
|
-
return () => e?.viewer?.() ??
|
|
1330
|
+
return () => e?.viewer?.() ?? hr;
|
|
917
1331
|
}
|
|
918
1332
|
//#endregion
|
|
919
1333
|
//#region src/framework/hooks/use-intersection-pause.ts
|
|
920
|
-
function
|
|
1334
|
+
function _r(e) {
|
|
921
1335
|
if (typeof IntersectionObserver > "u") return () => !1;
|
|
922
|
-
let [t, n] =
|
|
1336
|
+
let [t, n] = D(!1), r = new IntersectionObserver((e) => {
|
|
923
1337
|
let t = e[0];
|
|
924
1338
|
t && n(!t.isIntersecting);
|
|
925
1339
|
});
|
|
926
|
-
return
|
|
1340
|
+
return pe(() => {
|
|
927
1341
|
let t = e();
|
|
928
1342
|
r.disconnect(), t && r.observe(t);
|
|
929
|
-
}),
|
|
1343
|
+
}), O(() => r.disconnect()), t;
|
|
930
1344
|
}
|
|
931
1345
|
//#endregion
|
|
932
1346
|
//#region src/framework/hooks/use-reduced-motion.ts
|
|
933
|
-
function
|
|
1347
|
+
function vr() {
|
|
934
1348
|
if (typeof window > "u" || typeof window.matchMedia != "function") return () => !1;
|
|
935
|
-
let e = window.matchMedia("(prefers-reduced-motion: reduce)"), [t, n] =
|
|
936
|
-
return e.addEventListener("change", r),
|
|
1349
|
+
let e = window.matchMedia("(prefers-reduced-motion: reduce)"), [t, n] = D(e.matches), r = (e) => n(e.matches);
|
|
1350
|
+
return e.addEventListener("change", r), O(() => e.removeEventListener("change", r)), t;
|
|
937
1351
|
}
|
|
938
1352
|
//#endregion
|
|
939
1353
|
//#region src/framework/hooks/use-widget-dialog.ts
|
|
940
|
-
function
|
|
941
|
-
let [t, n] =
|
|
1354
|
+
function yr(e = "controls") {
|
|
1355
|
+
let [t, n] = D(!1), [r, i] = D(e), a = (t) => {
|
|
942
1356
|
i(t ?? e), n(!0);
|
|
943
1357
|
}, o = k(R);
|
|
944
|
-
return o?.registerDialogOpener?.(a),
|
|
1358
|
+
return o?.registerDialogOpener?.(a), O(() => o?.registerDialogOpener?.(null)), {
|
|
945
1359
|
showDialog: t,
|
|
946
1360
|
setShowDialog: n,
|
|
947
1361
|
openDialog: a,
|
|
@@ -962,15 +1376,15 @@ function kn(e = "controls") {
|
|
|
962
1376
|
}
|
|
963
1377
|
//#endregion
|
|
964
1378
|
//#region src/framework/hooks/use-widget-entity-group.ts
|
|
965
|
-
function
|
|
966
|
-
let t = e.minEntities ?? 1, n =
|
|
1379
|
+
function br(e) {
|
|
1380
|
+
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(() => {
|
|
967
1381
|
if (!r()) return;
|
|
968
1382
|
let t = e.aggregationMode?.();
|
|
969
1383
|
if (!t || t === "none") return;
|
|
970
1384
|
let n = e.entities();
|
|
971
|
-
if (t === "light" || t === "binary-sensor" || t === "switch") return
|
|
972
|
-
if (t === "sensor") return
|
|
973
|
-
}), o =
|
|
1385
|
+
if (t === "light" || t === "binary-sensor" || t === "switch") return mn(n, e.allEntitiesMode);
|
|
1386
|
+
if (t === "sensor") return hn(n, e.sensorGroupType?.() ?? "mean", !0);
|
|
1387
|
+
}), o = E(() => r() ? void 0 : e.emptyStateConfig);
|
|
974
1388
|
return {
|
|
975
1389
|
entities: e.entities,
|
|
976
1390
|
groupData: i,
|
|
@@ -982,142 +1396,142 @@ function An(e) {
|
|
|
982
1396
|
}
|
|
983
1397
|
//#endregion
|
|
984
1398
|
//#region src/framework/gestures/cursors.ts
|
|
985
|
-
var
|
|
986
|
-
function
|
|
1399
|
+
var W = 32, G = W / 2, K = "white", q = "rgba(0,0,0,0.4)", xr = 2, J = 3;
|
|
1400
|
+
function Sr(e) {
|
|
987
1401
|
return `url("data:image/svg+xml,${encodeURIComponent(e)}")`;
|
|
988
1402
|
}
|
|
989
1403
|
function Y(e) {
|
|
990
|
-
return `<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
1404
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${W}" height="${W}" viewBox="0 0 ${W} ${W}">${e}</svg>`;
|
|
991
1405
|
}
|
|
992
|
-
var
|
|
1406
|
+
var Cr = Y(`
|
|
993
1407
|
<g transform="translate(6, 2)">
|
|
994
1408
|
<!-- shadow -->
|
|
995
|
-
<g stroke="${
|
|
1409
|
+
<g stroke="${q}" stroke-width="${J}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
996
1410
|
<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"/>
|
|
997
1411
|
</g>
|
|
998
1412
|
<!-- main -->
|
|
999
|
-
<g stroke="${
|
|
1413
|
+
<g stroke="${K}" stroke-width="${xr}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1000
1414
|
<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"/>
|
|
1001
1415
|
</g>
|
|
1002
1416
|
</g>
|
|
1003
|
-
`),
|
|
1417
|
+
`), wr = Y(`
|
|
1004
1418
|
<g>
|
|
1005
|
-
<circle cx="${
|
|
1006
|
-
<circle cx="${
|
|
1007
|
-
<circle cx="${
|
|
1419
|
+
<circle cx="${G}" cy="${G}" r="8" stroke="${q}" stroke-width="${J}" fill="none"/>
|
|
1420
|
+
<circle cx="${G}" cy="${G}" r="8" stroke="${K}" stroke-width="1.5" fill="none"/>
|
|
1421
|
+
<circle cx="${G}" cy="${G}" r="1.5" fill="${K}"/>
|
|
1008
1422
|
</g>
|
|
1009
|
-
`),
|
|
1423
|
+
`), Tr = Y(`
|
|
1010
1424
|
<g>
|
|
1011
1425
|
<!-- shadow -->
|
|
1012
|
-
<g stroke="${
|
|
1013
|
-
<line x1="6" y1="${
|
|
1014
|
-
<polyline points="10,12 6,${
|
|
1015
|
-
<polyline points="22,12 26,${
|
|
1426
|
+
<g stroke="${q}" stroke-width="${J}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1427
|
+
<line x1="6" y1="${G}" x2="26" y2="${G}"/>
|
|
1428
|
+
<polyline points="10,12 6,${G} 10,20"/>
|
|
1429
|
+
<polyline points="22,12 26,${G} 22,20"/>
|
|
1016
1430
|
</g>
|
|
1017
1431
|
<!-- main -->
|
|
1018
|
-
<g stroke="${
|
|
1019
|
-
<line x1="6" y1="${
|
|
1020
|
-
<polyline points="10,12 6,${
|
|
1021
|
-
<polyline points="22,12 26,${
|
|
1432
|
+
<g stroke="${K}" stroke-width="${xr}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1433
|
+
<line x1="6" y1="${G}" x2="26" y2="${G}"/>
|
|
1434
|
+
<polyline points="10,12 6,${G} 10,20"/>
|
|
1435
|
+
<polyline points="22,12 26,${G} 22,20"/>
|
|
1022
1436
|
</g>
|
|
1023
1437
|
<!-- center grip dots -->
|
|
1024
|
-
<circle cx="${
|
|
1025
|
-
<circle cx="11" cy="${
|
|
1026
|
-
<circle cx="21" cy="${
|
|
1438
|
+
<circle cx="${G}" cy="${G}" r="1.5" fill="${K}"/>
|
|
1439
|
+
<circle cx="11" cy="${G}" r="1" fill="${K}" opacity="0.6"/>
|
|
1440
|
+
<circle cx="21" cy="${G}" r="1" fill="${K}" opacity="0.6"/>
|
|
1027
1441
|
</g>
|
|
1028
|
-
`),
|
|
1442
|
+
`), Er = Y(`
|
|
1029
1443
|
<g>
|
|
1030
1444
|
<!-- shadow -->
|
|
1031
|
-
<g stroke="${
|
|
1032
|
-
<line x1="${
|
|
1033
|
-
<polyline points="12,10 ${
|
|
1034
|
-
<polyline points="12,22 ${
|
|
1445
|
+
<g stroke="${q}" stroke-width="${J}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1446
|
+
<line x1="${G}" y1="6" x2="${G}" y2="26"/>
|
|
1447
|
+
<polyline points="12,10 ${G},6 20,10"/>
|
|
1448
|
+
<polyline points="12,22 ${G},26 20,22"/>
|
|
1035
1449
|
</g>
|
|
1036
1450
|
<!-- main -->
|
|
1037
|
-
<g stroke="${
|
|
1038
|
-
<line x1="${
|
|
1039
|
-
<polyline points="12,10 ${
|
|
1040
|
-
<polyline points="12,22 ${
|
|
1451
|
+
<g stroke="${K}" stroke-width="${xr}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1452
|
+
<line x1="${G}" y1="6" x2="${G}" y2="26"/>
|
|
1453
|
+
<polyline points="12,10 ${G},6 20,10"/>
|
|
1454
|
+
<polyline points="12,22 ${G},26 20,22"/>
|
|
1041
1455
|
</g>
|
|
1042
1456
|
<!-- center grip dots -->
|
|
1043
|
-
<circle cx="${
|
|
1044
|
-
<circle cx="${
|
|
1045
|
-
<circle cx="${
|
|
1457
|
+
<circle cx="${G}" cy="${G}" r="1.5" fill="${K}"/>
|
|
1458
|
+
<circle cx="${G}" cy="11" r="1" fill="${K}" opacity="0.6"/>
|
|
1459
|
+
<circle cx="${G}" cy="21" r="1" fill="${K}" opacity="0.6"/>
|
|
1046
1460
|
</g>
|
|
1047
|
-
`),
|
|
1461
|
+
`), Dr = Y(`
|
|
1048
1462
|
<g>
|
|
1049
1463
|
<!-- shadow -->
|
|
1050
|
-
<g stroke="${
|
|
1051
|
-
<line x1="7" y1="${
|
|
1052
|
-
<line x1="${
|
|
1053
|
-
<polyline points="11,13 7,${
|
|
1054
|
-
<polyline points="21,13 25,${
|
|
1055
|
-
<polyline points="13,11 ${
|
|
1056
|
-
<polyline points="13,21 ${
|
|
1464
|
+
<g stroke="${q}" stroke-width="${J}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1465
|
+
<line x1="7" y1="${G}" x2="25" y2="${G}"/>
|
|
1466
|
+
<line x1="${G}" y1="7" x2="${G}" y2="25"/>
|
|
1467
|
+
<polyline points="11,13 7,${G} 11,19"/>
|
|
1468
|
+
<polyline points="21,13 25,${G} 21,19"/>
|
|
1469
|
+
<polyline points="13,11 ${G},7 19,11"/>
|
|
1470
|
+
<polyline points="13,21 ${G},25 19,21"/>
|
|
1057
1471
|
</g>
|
|
1058
1472
|
<!-- main -->
|
|
1059
|
-
<g stroke="${
|
|
1060
|
-
<line x1="7" y1="${
|
|
1061
|
-
<line x1="${
|
|
1062
|
-
<polyline points="11,13 7,${
|
|
1063
|
-
<polyline points="21,13 25,${
|
|
1064
|
-
<polyline points="13,11 ${
|
|
1065
|
-
<polyline points="13,21 ${
|
|
1473
|
+
<g stroke="${K}" stroke-width="${xr}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1474
|
+
<line x1="7" y1="${G}" x2="25" y2="${G}"/>
|
|
1475
|
+
<line x1="${G}" y1="7" x2="${G}" y2="25"/>
|
|
1476
|
+
<polyline points="11,13 7,${G} 11,19"/>
|
|
1477
|
+
<polyline points="21,13 25,${G} 21,19"/>
|
|
1478
|
+
<polyline points="13,11 ${G},7 19,11"/>
|
|
1479
|
+
<polyline points="13,21 ${G},25 19,21"/>
|
|
1066
1480
|
</g>
|
|
1067
1481
|
<!-- center dot -->
|
|
1068
|
-
<circle cx="${
|
|
1482
|
+
<circle cx="${G}" cy="${G}" r="2" fill="${K}"/>
|
|
1069
1483
|
</g>
|
|
1070
1484
|
`);
|
|
1071
1485
|
function X(e, t, n) {
|
|
1072
1486
|
return {
|
|
1073
|
-
css: `${
|
|
1487
|
+
css: `${Sr(e)} ${t} ${n}, auto`,
|
|
1074
1488
|
hotspotX: t,
|
|
1075
1489
|
hotspotY: n
|
|
1076
1490
|
};
|
|
1077
1491
|
}
|
|
1078
1492
|
var Z = {
|
|
1079
|
-
tap: X(
|
|
1080
|
-
hold: X(
|
|
1081
|
-
slideHorizontal: X(
|
|
1082
|
-
slideVertical: X(
|
|
1083
|
-
slideAuto: X(
|
|
1493
|
+
tap: X(Cr, 12, 4),
|
|
1494
|
+
hold: X(wr, 16, 16),
|
|
1495
|
+
slideHorizontal: X(Tr, G, G),
|
|
1496
|
+
slideVertical: X(Er, G, G),
|
|
1497
|
+
slideAuto: X(Dr, G, G)
|
|
1084
1498
|
};
|
|
1085
1499
|
//#endregion
|
|
1086
1500
|
//#region src/framework/gestures/haptics.ts
|
|
1087
|
-
function
|
|
1501
|
+
function Or() {
|
|
1088
1502
|
if (typeof window > "u") return null;
|
|
1089
1503
|
let e = window;
|
|
1090
1504
|
return e.Capacitor?.isNativePlatform?.() ? e.Capacitor.Plugins?.Haptics ?? null : null;
|
|
1091
1505
|
}
|
|
1092
|
-
function
|
|
1093
|
-
if (
|
|
1506
|
+
function kr(e) {
|
|
1507
|
+
if (typeof navigator < "u" && typeof navigator.vibrate == "function") try {
|
|
1094
1508
|
navigator.vibrate(e);
|
|
1095
1509
|
} catch {}
|
|
1096
1510
|
}
|
|
1097
|
-
var
|
|
1511
|
+
var Ar = {
|
|
1098
1512
|
tick() {
|
|
1099
|
-
let e =
|
|
1513
|
+
let e = Or();
|
|
1100
1514
|
if (e) {
|
|
1101
1515
|
e.impact({ style: "Light" }).catch(() => {});
|
|
1102
1516
|
return;
|
|
1103
1517
|
}
|
|
1104
|
-
|
|
1518
|
+
kr(8);
|
|
1105
1519
|
},
|
|
1106
1520
|
bump() {
|
|
1107
|
-
let e =
|
|
1521
|
+
let e = Or();
|
|
1108
1522
|
if (e) {
|
|
1109
1523
|
e.impact({ style: "Medium" }).catch(() => {});
|
|
1110
1524
|
return;
|
|
1111
1525
|
}
|
|
1112
|
-
|
|
1526
|
+
kr(20);
|
|
1113
1527
|
},
|
|
1114
1528
|
pulse() {
|
|
1115
|
-
let e =
|
|
1529
|
+
let e = Or();
|
|
1116
1530
|
if (e) {
|
|
1117
1531
|
e.impact({ style: "Heavy" }).catch(() => {});
|
|
1118
1532
|
return;
|
|
1119
1533
|
}
|
|
1120
|
-
|
|
1534
|
+
kr([
|
|
1121
1535
|
0,
|
|
1122
1536
|
15,
|
|
1123
1537
|
40,
|
|
@@ -1127,7 +1541,7 @@ var zn = {
|
|
|
1127
1541
|
};
|
|
1128
1542
|
//#endregion
|
|
1129
1543
|
//#region src/framework/gestures/use-widget-gestures.ts
|
|
1130
|
-
function
|
|
1544
|
+
function jr(e, t) {
|
|
1131
1545
|
let n = {
|
|
1132
1546
|
isDown: !1,
|
|
1133
1547
|
isTouch: !1,
|
|
@@ -1138,7 +1552,7 @@ function Bn(e, t) {
|
|
|
1138
1552
|
sliding: !1,
|
|
1139
1553
|
holdTimer: null,
|
|
1140
1554
|
element: null
|
|
1141
|
-
}, r = null, i = null, a = null, [o, s] =
|
|
1555
|
+
}, r = null, i = null, a = null, [o, s] = D(null);
|
|
1142
1556
|
function c(e) {
|
|
1143
1557
|
e !== i && (a && a.disconnect(), a = new ResizeObserver((e) => {
|
|
1144
1558
|
let t = e[0];
|
|
@@ -1170,7 +1584,7 @@ function Bn(e, t) {
|
|
|
1170
1584
|
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) {
|
|
1171
1585
|
let e = r.hold.delay ?? 300;
|
|
1172
1586
|
n.holdTimer = setTimeout(() => {
|
|
1173
|
-
n.holdTimer = null, n.isDown && !n.hasMoved && (
|
|
1587
|
+
n.holdTimer = null, n.isDown && !n.hasMoved && (Ar.bump(), r.hold?.action(), n.isDown = !1);
|
|
1174
1588
|
}, e);
|
|
1175
1589
|
}
|
|
1176
1590
|
if (!n.isTouch && r.slide) try {
|
|
@@ -1238,7 +1652,7 @@ function Bn(e, t) {
|
|
|
1238
1652
|
}
|
|
1239
1653
|
//#endregion
|
|
1240
1654
|
//#region src/framework/theming/svg-colors.ts
|
|
1241
|
-
var
|
|
1655
|
+
var Mr = {
|
|
1242
1656
|
solar: "oklch(0.74 0.18 60)",
|
|
1243
1657
|
grid: "oklch(0.62 0.12 245)",
|
|
1244
1658
|
battery: "oklch(0.70 0.18 145)",
|
|
@@ -1247,21 +1661,21 @@ var Vn = {
|
|
|
1247
1661
|
positive: "oklch(0.70 0.14 160)",
|
|
1248
1662
|
negative: "oklch(0.64 0.22 27)"
|
|
1249
1663
|
};
|
|
1250
|
-
function
|
|
1664
|
+
function Nr(e) {
|
|
1251
1665
|
return {
|
|
1252
1666
|
fill: `color-mix(in oklch, ${e} 20%, transparent)`,
|
|
1253
1667
|
stroke: e,
|
|
1254
1668
|
solid: e
|
|
1255
1669
|
};
|
|
1256
1670
|
}
|
|
1257
|
-
var
|
|
1671
|
+
var Pr = Object.fromEntries(Object.entries(Mr).map(([e, t]) => [e, Nr(t)])), Fr = o.enum([
|
|
1258
1672
|
"success",
|
|
1259
1673
|
"warning",
|
|
1260
1674
|
"danger",
|
|
1261
1675
|
"info",
|
|
1262
1676
|
"neutral",
|
|
1263
1677
|
"accent"
|
|
1264
|
-
]),
|
|
1678
|
+
]), Ir = {
|
|
1265
1679
|
title: e(() => o.string().optional().meta({
|
|
1266
1680
|
title: "Title",
|
|
1267
1681
|
description: "Optional display name override"
|
|
@@ -1281,38 +1695,38 @@ var Un = Object.fromEntries(Object.entries(Vn).map(([e, t]) => [e, Hn(t)])), Wn
|
|
|
1281
1695
|
formType: "area-picker",
|
|
1282
1696
|
title: "Area"
|
|
1283
1697
|
}), "widgetFields.areaId")
|
|
1284
|
-
},
|
|
1698
|
+
}, Lr = 24;
|
|
1285
1699
|
function Q(e) {
|
|
1286
1700
|
let t = {};
|
|
1287
1701
|
for (let [n, r] of Object.entries(e)) r !== void 0 && (t[n] = r);
|
|
1288
1702
|
return t;
|
|
1289
1703
|
}
|
|
1290
|
-
function
|
|
1704
|
+
function Rr() {
|
|
1291
1705
|
return o.string().optional().meta({
|
|
1292
1706
|
title: "Title",
|
|
1293
1707
|
description: "Optional display name override"
|
|
1294
1708
|
});
|
|
1295
1709
|
}
|
|
1296
|
-
function
|
|
1710
|
+
function zr(e) {
|
|
1297
1711
|
return (e.default === void 0 ? o.string().optional() : o.string().default(e.default)).meta(Q({
|
|
1298
1712
|
title: e.title,
|
|
1299
1713
|
description: e.description
|
|
1300
1714
|
}));
|
|
1301
1715
|
}
|
|
1302
|
-
function
|
|
1716
|
+
function Br(e) {
|
|
1303
1717
|
let t = o.number();
|
|
1304
1718
|
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(Q({
|
|
1305
1719
|
title: e.title,
|
|
1306
1720
|
description: e.description
|
|
1307
1721
|
}));
|
|
1308
1722
|
}
|
|
1309
|
-
function
|
|
1723
|
+
function Vr(e) {
|
|
1310
1724
|
return o.boolean().default(e.default ?? !1).meta(Q({
|
|
1311
1725
|
title: e.title,
|
|
1312
1726
|
description: e.description
|
|
1313
1727
|
}));
|
|
1314
1728
|
}
|
|
1315
|
-
function
|
|
1729
|
+
function Hr(e, t) {
|
|
1316
1730
|
let n = o.enum(e);
|
|
1317
1731
|
return (t.default === void 0 ? n.optional() : n.default(t.default)).meta(Q({
|
|
1318
1732
|
title: t.title,
|
|
@@ -1320,14 +1734,14 @@ function Zn(e, t) {
|
|
|
1320
1734
|
labels: t.labels
|
|
1321
1735
|
}));
|
|
1322
1736
|
}
|
|
1323
|
-
function
|
|
1737
|
+
function Ur(e, t) {
|
|
1324
1738
|
return o.array(o.enum(e)).default([...t.default ?? []]).meta(Q({
|
|
1325
1739
|
title: t.title,
|
|
1326
1740
|
description: t.description,
|
|
1327
1741
|
labels: t.labels
|
|
1328
1742
|
}));
|
|
1329
1743
|
}
|
|
1330
|
-
function
|
|
1744
|
+
function Wr(e, t) {
|
|
1331
1745
|
return o.array(o.string()).default([]).meta(Q({
|
|
1332
1746
|
domain: e,
|
|
1333
1747
|
title: t?.title ?? "Entities",
|
|
@@ -1335,7 +1749,7 @@ function $n(e, t) {
|
|
|
1335
1749
|
deviceClass: t?.deviceClass
|
|
1336
1750
|
}));
|
|
1337
1751
|
}
|
|
1338
|
-
function
|
|
1752
|
+
function Gr(e, t) {
|
|
1339
1753
|
return o.array(o.string()).default([]).meta(Q({
|
|
1340
1754
|
domain: e,
|
|
1341
1755
|
title: t?.title ?? "Entity",
|
|
@@ -1344,13 +1758,13 @@ function er(e, t) {
|
|
|
1344
1758
|
singleSelect: !0
|
|
1345
1759
|
}));
|
|
1346
1760
|
}
|
|
1347
|
-
function
|
|
1761
|
+
function Kr(e) {
|
|
1348
1762
|
return o.string().optional().meta({
|
|
1349
1763
|
formType: "area-picker",
|
|
1350
1764
|
title: e?.title ?? "Area"
|
|
1351
1765
|
});
|
|
1352
1766
|
}
|
|
1353
|
-
function
|
|
1767
|
+
function qr(e) {
|
|
1354
1768
|
let t = o.string().meta(Q({
|
|
1355
1769
|
formType: "icon-picker",
|
|
1356
1770
|
title: e?.title ?? "Icon",
|
|
@@ -1358,7 +1772,7 @@ function nr(e) {
|
|
|
1358
1772
|
}));
|
|
1359
1773
|
return e?.default === void 0 ? t.optional() : t.default(e.default);
|
|
1360
1774
|
}
|
|
1361
|
-
function
|
|
1775
|
+
function Jr(e) {
|
|
1362
1776
|
let t = o.string().meta(Q({
|
|
1363
1777
|
formType: "image-picker",
|
|
1364
1778
|
title: e?.title ?? "Image",
|
|
@@ -1366,36 +1780,36 @@ function rr(e) {
|
|
|
1366
1780
|
}));
|
|
1367
1781
|
return e?.default === void 0 ? t.optional() : t.default(e.default);
|
|
1368
1782
|
}
|
|
1369
|
-
function
|
|
1783
|
+
function Yr(e) {
|
|
1370
1784
|
return o.array(o.string()).default([]).meta(Q({
|
|
1371
1785
|
title: e.title,
|
|
1372
1786
|
description: e.description
|
|
1373
1787
|
}));
|
|
1374
1788
|
}
|
|
1375
|
-
function
|
|
1789
|
+
function Xr(e, t) {
|
|
1376
1790
|
let n = o.object(e);
|
|
1377
|
-
return n.default(
|
|
1791
|
+
return n.default(jt(n)).meta({ title: t.title });
|
|
1378
1792
|
}
|
|
1379
|
-
function
|
|
1793
|
+
function Zr(e) {
|
|
1380
1794
|
return e.def;
|
|
1381
1795
|
}
|
|
1382
1796
|
function $(e) {
|
|
1383
1797
|
if (o.globalRegistry.get(e)?.formType === "list") return !0;
|
|
1384
|
-
let t =
|
|
1798
|
+
let t = Zr(e);
|
|
1385
1799
|
return t.shape ? Object.values(t.shape).some($) : t.options ? t.options.some($) : t.element ? $(t.element) : t.innerType ? $(t.innerType) : !1;
|
|
1386
1800
|
}
|
|
1387
|
-
function
|
|
1388
|
-
let t = e, n =
|
|
1389
|
-
for (; n;) t = n, n =
|
|
1801
|
+
function Qr(e) {
|
|
1802
|
+
let t = e, n = Zr(t).innerType;
|
|
1803
|
+
for (; n;) t = n, n = Zr(t).innerType;
|
|
1390
1804
|
return t;
|
|
1391
1805
|
}
|
|
1392
|
-
function
|
|
1393
|
-
let t =
|
|
1806
|
+
function $r(e) {
|
|
1807
|
+
let t = Zr(Qr(e));
|
|
1394
1808
|
if (t.shape) return new Set(Object.keys(t.shape));
|
|
1395
1809
|
if (t.options) {
|
|
1396
1810
|
let e = [];
|
|
1397
1811
|
for (let n of t.options) {
|
|
1398
|
-
let t =
|
|
1812
|
+
let t = $r(n);
|
|
1399
1813
|
if (!t) return null;
|
|
1400
1814
|
e.push(t);
|
|
1401
1815
|
}
|
|
@@ -1407,7 +1821,7 @@ function cr(e) {
|
|
|
1407
1821
|
}
|
|
1408
1822
|
return null;
|
|
1409
1823
|
}
|
|
1410
|
-
function
|
|
1824
|
+
function ei(e, t, n) {
|
|
1411
1825
|
let r = { [t]: n };
|
|
1412
1826
|
try {
|
|
1413
1827
|
return e.parse(r);
|
|
@@ -1415,12 +1829,12 @@ function lr(e, t, n) {
|
|
|
1415
1829
|
return r;
|
|
1416
1830
|
}
|
|
1417
1831
|
}
|
|
1418
|
-
function
|
|
1832
|
+
function ti(e, t) {
|
|
1419
1833
|
if (!Number.isInteger(t.max) || t.max < 1) throw Error(`field.list: max must be a positive integer, got ${t.max}`);
|
|
1420
|
-
if (t.max >
|
|
1834
|
+
if (t.max > Lr) throw Error(`field.list: max ${t.max} exceeds the ceiling of ${Lr}`);
|
|
1421
1835
|
if (t.min !== void 0 && (!Number.isInteger(t.min) || t.min < 0 || t.min > t.max)) throw Error(`field.list: min must be an integer between 0 and max, got ${t.min}`);
|
|
1422
1836
|
if ($(e)) throw Error("field.list: a list item cannot contain another field.list (depth 1 only)");
|
|
1423
|
-
if (t.labelField !== void 0 &&
|
|
1837
|
+
if (t.labelField !== void 0 && !$r(e)?.has(t.labelField)) throw Error(`field.list: labelField "${t.labelField}" must name a field present in every item`);
|
|
1424
1838
|
let n = o.array(e);
|
|
1425
1839
|
return t.min !== void 0 && (n = n.min(t.min)), n = n.max(t.max), n.default([]).meta(Q({
|
|
1426
1840
|
formType: "list",
|
|
@@ -1430,7 +1844,7 @@ function ur(e, t) {
|
|
|
1430
1844
|
labelField: t.labelField
|
|
1431
1845
|
}));
|
|
1432
1846
|
}
|
|
1433
|
-
function
|
|
1847
|
+
function ni(e, t, n) {
|
|
1434
1848
|
let r = Object.keys(t)[0];
|
|
1435
1849
|
if (r === void 0) throw Error("field.variants: at least one variant is required");
|
|
1436
1850
|
if (n.shared && e in n.shared) throw Error(`field.variants: shared fields cannot redefine the discriminator "${e}"`);
|
|
@@ -1443,7 +1857,7 @@ function dr(e, t, n) {
|
|
|
1443
1857
|
...r,
|
|
1444
1858
|
[e]: o.literal(t)
|
|
1445
1859
|
})), a = o.discriminatedUnion(e, i), s = i[0];
|
|
1446
|
-
return a.default(s ?
|
|
1860
|
+
return a.default(s ? ei(s, e, r) : {}).meta(Q({
|
|
1447
1861
|
formType: "variants",
|
|
1448
1862
|
discriminator: e,
|
|
1449
1863
|
title: n.title,
|
|
@@ -1451,29 +1865,29 @@ function dr(e, t, n) {
|
|
|
1451
1865
|
labels: n.labels
|
|
1452
1866
|
}));
|
|
1453
1867
|
}
|
|
1454
|
-
var
|
|
1455
|
-
title:
|
|
1456
|
-
text:
|
|
1457
|
-
number:
|
|
1458
|
-
toggle:
|
|
1459
|
-
choice:
|
|
1460
|
-
choices:
|
|
1461
|
-
entities:
|
|
1462
|
-
entity:
|
|
1463
|
-
area:
|
|
1464
|
-
icon:
|
|
1465
|
-
image:
|
|
1466
|
-
stringList:
|
|
1467
|
-
group:
|
|
1468
|
-
list:
|
|
1469
|
-
variants:
|
|
1868
|
+
var ri = {
|
|
1869
|
+
title: Rr,
|
|
1870
|
+
text: zr,
|
|
1871
|
+
number: Br,
|
|
1872
|
+
toggle: Vr,
|
|
1873
|
+
choice: Hr,
|
|
1874
|
+
choices: Ur,
|
|
1875
|
+
entities: Wr,
|
|
1876
|
+
entity: Gr,
|
|
1877
|
+
area: Kr,
|
|
1878
|
+
icon: qr,
|
|
1879
|
+
image: Jr,
|
|
1880
|
+
stringList: Yr,
|
|
1881
|
+
group: Xr,
|
|
1882
|
+
list: ti,
|
|
1883
|
+
variants: ni
|
|
1470
1884
|
};
|
|
1471
|
-
function
|
|
1885
|
+
function ii(e) {
|
|
1472
1886
|
return o.object(e);
|
|
1473
1887
|
}
|
|
1474
1888
|
//#endregion
|
|
1475
1889
|
//#region src/shared/spline.ts
|
|
1476
|
-
function
|
|
1890
|
+
function ai(e) {
|
|
1477
1891
|
if (e.length < 2) return "";
|
|
1478
1892
|
let t = e[0], n = e[1];
|
|
1479
1893
|
if (!t || !n) return "";
|
|
@@ -1500,14 +1914,14 @@ function mr(e) {
|
|
|
1500
1914
|
}
|
|
1501
1915
|
//#endregion
|
|
1502
1916
|
//#region src/theme.ts
|
|
1503
|
-
function
|
|
1917
|
+
function oi() {
|
|
1504
1918
|
return document.documentElement.classList.contains("dark");
|
|
1505
1919
|
}
|
|
1506
1920
|
//#endregion
|
|
1507
1921
|
//#region src/version.ts
|
|
1508
|
-
var
|
|
1922
|
+
var si = {
|
|
1509
1923
|
name: "@glasshome/widget-sdk",
|
|
1510
|
-
version: "1.
|
|
1924
|
+
version: "1.16.0",
|
|
1511
1925
|
description: "SDK for building GlassHome dashboard widgets with SolidJS",
|
|
1512
1926
|
keywords: [
|
|
1513
1927
|
"glasshome",
|
|
@@ -1567,7 +1981,7 @@ var gr = {
|
|
|
1567
1981
|
},
|
|
1568
1982
|
peerDependencies: {
|
|
1569
1983
|
"@glasshome/sync-layer": "0.8.1",
|
|
1570
|
-
"@glasshome/ui": "1.
|
|
1984
|
+
"@glasshome/ui": "1.18.0",
|
|
1571
1985
|
"solid-js": "^1.9.11"
|
|
1572
1986
|
},
|
|
1573
1987
|
dependencies: {
|
|
@@ -1582,7 +1996,7 @@ var gr = {
|
|
|
1582
1996
|
zod: "^4.1.13"
|
|
1583
1997
|
},
|
|
1584
1998
|
devDependencies: {
|
|
1585
|
-
"@glasshome/ui": "1.
|
|
1999
|
+
"@glasshome/ui": "1.18.0",
|
|
1586
2000
|
"@solidjs/testing-library": "^0.8.10",
|
|
1587
2001
|
"@types/bun": "^1.4.0",
|
|
1588
2002
|
"@types/node": "^25.2.2",
|
|
@@ -1603,4 +2017,4 @@ var gr = {
|
|
|
1603
2017
|
engines: { node: ">=18" }
|
|
1604
2018
|
}.version;
|
|
1605
2019
|
//#endregion
|
|
1606
|
-
export {
|
|
2020
|
+
export { Ee as Badge, Oe as Button, Ae as Carousel, je as CarouselContent, Me as CarouselDots, Ne as CarouselItem, Pe as CarouselNext, Fe as CarouselPrevious, Ie as ColorSlider, Le as ColorWheel, Re as CountPill, Ke as Icon, Je as Input, Ye as Label, Xe as ResponsiveDialog, Ze as ResponsiveDialogBody, $e as ResponsiveDialogClose, et as ResponsiveDialogContent, tt as ResponsiveDialogDescription, nt as ResponsiveDialogFooter, it as ResponsiveDialogHeader, at as ResponsiveDialogTitle, si as SDK_VERSION, ot as SchemaForm, st as SectionIcon, dt as SectionTitle, ft as Select, pt as SelectContent, mt as SelectItem, ht as SelectTrigger, gt as SelectValue, _t as Slider, vt as Switch, yt as Tabs, xt as TabsContent, Ct as TabsList, Tt as TabsTrigger, Fr as ToneSchema, H as Widget, $t as WidgetContent, R as WidgetCtx, tr as WidgetDebugTab, $n as WidgetDebugView, fr as WidgetDialog, rn as WidgetIcon, r as WidgetManifestSchema, zt as WidgetSizeCtx, Zt as WidgetSliderFill, on as WidgetStatus, ln as WidgetTitle, Tn as WidgetValue, zn as buildDebugData, g as byDomain, mn as calculateLightGroup, hn as calculateSensorGroup, un as copyText, bn as countActiveEntities, ii as defineConfig, Mt as defineWidget, t as deprecations, ri as field, n as formatDeprecation, i as formatSchemaError, yn as getEntityAttribute, s as getForecasts, c as getStream, l as getWebRtcClientConfig, u as hassMediaUrl, Dt as imageUrl, Kt as injectTokens, oi as isDark, vn as isEntityActive, Ot as mediaUrl, ai as monotoneCubicPath, kt as parseColor, d as sendWebRtcCandidate, f as startWebRtcSession, p as state, Pr as svgColors, m as trackEntityHistory, h as untrackEntityHistory, _ as useArea, v as useCalendarEvents, ee as useCamera, y as useConnection, pn as useCopyText, te as useCurrency, ne as useEntities, re as useEntity, ie as useEntityHistory, ae as useEntityStatistics, oe as useForecast, se as useHassConfig, _r as useIntersectionPause, ce as useLocale, vr as useReducedMotion, Ft as useService, ue as useStore, b as useTemperatureUnit, Rt as useToggle, Lt as useTurnOff, It as useTurnOn, S as useUnitSystem, Nt as useWidgetContext, mr as useWidgetDashboard, yr as useWidgetDialog, Bt as useWidgetDimensions, br as useWidgetEntityGroup, jr as useWidgetGestures, gr as useWidgetViewer, Ir as widgetFields, a as z };
|