//#region src/version.js var e = "1.2.0-beta.3", t = { area: "1.1.0", status: "1.1.0", action: "1.1.0", deck: "1.1.0", statusBadge: "0.6.0" }, n = "color: #ffffff; font-weight: 700; background: #6a6a6a; padding: 2px 8px; border-radius: 999px 0 0 999px;", r = "color: #ffffff; font-weight: 700; background: #d88989; padding: 2px 8px; border-radius: 0 999px 999px 0;"; function i(e, t) { console.info(`%c ${e} %c v${t} `, n, r); } //#endregion //#region node_modules/@lit/reactive-element/css-tag.js var a = globalThis, o = a.ShadowRoot && (a.ShadyCSS === void 0 || a.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, s = Symbol(), c = /* @__PURE__ */ new WeakMap(), l = class { constructor(e, t, n) { if (this._$cssResult$ = !0, n !== s) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); this.cssText = e, this.t = t; } get styleSheet() { let e = this.o, t = this.t; if (o && e === void 0) { let n = t !== void 0 && t.length === 1; n && (e = c.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), n && c.set(t, e)); } return e; } toString() { return this.cssText; } }, u = (e) => new l(typeof e == "string" ? e : e + "", void 0, s), d = (e, ...t) => new l(e.length === 1 ? e[0] : t.reduce((t, n, r) => t + ((e) => { if (!0 === e._$cssResult$) return e.cssText; if (typeof e == "number") return e; throw Error("Value passed to 'css' function must be a 'css' function result: " + e + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); })(n) + e[r + 1], e[0]), e, s), f = (e, t) => { if (o) e.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet); else for (let n of t) { let t = document.createElement("style"), r = a.litNonce; r !== void 0 && t.setAttribute("nonce", r), t.textContent = n.cssText, e.appendChild(t); } }, p = o ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((e) => { let t = ""; for (let n of e.cssRules) t += n.cssText; return u(t); })(e) : e, { is: m, defineProperty: h, getOwnPropertyDescriptor: g, getOwnPropertyNames: _, getOwnPropertySymbols: v, getPrototypeOf: ee } = Object, te = globalThis, y = te.trustedTypes, b = y ? y.emptyScript : "", ne = te.reactiveElementPolyfillSupport, x = (e, t) => e, re = { toAttribute(e, t) { switch (t) { case Boolean: e = e ? b : null; break; case Object: case Array: e = e == null ? e : JSON.stringify(e); } return e; }, fromAttribute(e, t) { let n = e; switch (t) { case Boolean: n = e !== null; break; case Number: n = e === null ? null : Number(e); break; case Object: case Array: try { n = JSON.parse(e); } catch { n = null; } } return n; } }, ie = (e, t) => !m(e, t), ae = { attribute: !0, type: String, converter: re, reflect: !1, useDefault: !1, hasChanged: ie }; Symbol.metadata ??= Symbol("metadata"), te.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap(); var S = class extends HTMLElement { static addInitializer(e) { this._$Ei(), (this.l ??= []).push(e); } static get observedAttributes() { return this.finalize(), this._$Eh && [...this._$Eh.keys()]; } static createProperty(e, t = ae) { if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) { let n = Symbol(), r = this.getPropertyDescriptor(e, n, t); r !== void 0 && h(this.prototype, e, r); } } static getPropertyDescriptor(e, t, n) { let { get: r, set: i } = g(this.prototype, e) ?? { get() { return this[t]; }, set(e) { this[t] = e; } }; return { get: r, set(t) { let a = r?.call(this); i?.call(this, t), this.requestUpdate(e, a, n); }, configurable: !0, enumerable: !0 }; } static getPropertyOptions(e) { return this.elementProperties.get(e) ?? ae; } static _$Ei() { if (this.hasOwnProperty(x("elementProperties"))) return; let e = ee(this); e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties); } static finalize() { if (this.hasOwnProperty(x("finalized"))) return; if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(x("properties"))) { let e = this.properties, t = [..._(e), ...v(e)]; for (let n of t) this.createProperty(n, e[n]); } let e = this[Symbol.metadata]; if (e !== null) { let t = litPropertyMetadata.get(e); if (t !== void 0) for (let [e, n] of t) this.elementProperties.set(e, n); } this._$Eh = /* @__PURE__ */ new Map(); for (let [e, t] of this.elementProperties) { let n = this._$Eu(e, t); n !== void 0 && this._$Eh.set(n, e); } this.elementStyles = this.finalizeStyles(this.styles); } static finalizeStyles(e) { let t = []; if (Array.isArray(e)) { let n = new Set(e.flat(Infinity).reverse()); for (let e of n) t.unshift(p(e)); } else e !== void 0 && t.push(p(e)); return t; } static _$Eu(e, t) { let n = t.attribute; return !1 === n ? void 0 : typeof n == "string" ? n : typeof e == "string" ? e.toLowerCase() : void 0; } constructor() { super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev(); } _$Ev() { this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((e) => e(this)); } addController(e) { (this._$EO ??= /* @__PURE__ */ new Set()).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.(); } removeController(e) { this._$EO?.delete(e); } _$E_() { let e = /* @__PURE__ */ new Map(), t = this.constructor.elementProperties; for (let n of t.keys()) this.hasOwnProperty(n) && (e.set(n, this[n]), delete this[n]); e.size > 0 && (this._$Ep = e); } createRenderRoot() { let e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); return f(e, this.constructor.elementStyles), e; } connectedCallback() { this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((e) => e.hostConnected?.()); } enableUpdating(e) {} disconnectedCallback() { this._$EO?.forEach((e) => e.hostDisconnected?.()); } attributeChangedCallback(e, t, n) { this._$AK(e, n); } _$ET(e, t) { let n = this.constructor.elementProperties.get(e), r = this.constructor._$Eu(e, n); if (r !== void 0 && !0 === n.reflect) { let i = (n.converter?.toAttribute === void 0 ? re : n.converter).toAttribute(t, n.type); this._$Em = e, i == null ? this.removeAttribute(r) : this.setAttribute(r, i), this._$Em = null; } } _$AK(e, t) { let n = this.constructor, r = n._$Eh.get(e); if (r !== void 0 && this._$Em !== r) { let e = n.getPropertyOptions(r), i = typeof e.converter == "function" ? { fromAttribute: e.converter } : e.converter?.fromAttribute === void 0 ? re : e.converter; this._$Em = r; let a = i.fromAttribute(t, e.type); this[r] = a ?? this._$Ej?.get(r) ?? a, this._$Em = null; } } requestUpdate(e, t, n, r = !1, i) { if (e !== void 0) { let a = this.constructor; if (!1 === r && (i = this[e]), n ??= a.getPropertyOptions(e), !((n.hasChanged ?? ie)(i, t) || n.useDefault && n.reflect && i === this._$Ej?.get(e) && !this.hasAttribute(a._$Eu(e, n)))) return; this.C(e, t, n); } !1 === this.isUpdatePending && (this._$ES = this._$EP()); } C(e, t, { useDefault: n, reflect: r, wrapped: i }, a) { n && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, a ?? t ?? this[e]), !0 !== i || a !== void 0) || (this._$AL.has(e) || (this.hasUpdated || n || (t = void 0), this._$AL.set(e, t)), !0 === r && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e)); } async _$EP() { this.isUpdatePending = !0; try { await this._$ES; } catch (e) { Promise.reject(e); } let e = this.scheduleUpdate(); return e != null && await e, !this.isUpdatePending; } scheduleUpdate() { return this.performUpdate(); } performUpdate() { if (!this.isUpdatePending) return; if (!this.hasUpdated) { if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) { for (let [e, t] of this._$Ep) this[e] = t; this._$Ep = void 0; } let e = this.constructor.elementProperties; if (e.size > 0) for (let [t, n] of e) { let { wrapped: e } = n, r = this[t]; !0 !== e || this._$AL.has(t) || r === void 0 || this.C(t, void 0, n, r); } } let e = !1, t = this._$AL; try { e = this.shouldUpdate(t), e ? (this.willUpdate(t), this._$EO?.forEach((e) => e.hostUpdate?.()), this.update(t)) : this._$EM(); } catch (t) { throw e = !1, this._$EM(), t; } e && this._$AE(t); } willUpdate(e) {} _$AE(e) { this._$EO?.forEach((e) => e.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e); } _$EM() { this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1; } get updateComplete() { return this.getUpdateComplete(); } getUpdateComplete() { return this._$ES; } shouldUpdate(e) { return !0; } update(e) { this._$Eq &&= this._$Eq.forEach((e) => this._$ET(e, this[e])), this._$EM(); } updated(e) {} firstUpdated(e) {} }; S.elementStyles = [], S.shadowRootOptions = { mode: "open" }, S[x("elementProperties")] = /* @__PURE__ */ new Map(), S[x("finalized")] = /* @__PURE__ */ new Map(), ne?.({ ReactiveElement: S }), (te.reactiveElementVersions ??= []).push("2.1.2"); //#endregion //#region node_modules/lit-html/lit-html.js var C = globalThis, oe = (e) => e, se = C.trustedTypes, ce = se ? se.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, le = "$lit$", w = `lit$${Math.random().toFixed(9).slice(2)}$`, ue = "?" + w, de = `<${ue}>`, T = document, fe = () => T.createComment(""), pe = (e) => e === null || typeof e != "object" && typeof e != "function", me = Array.isArray, he = (e) => me(e) || typeof e?.[Symbol.iterator] == "function", ge = "[ \n\f\r]", _e = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ve = /-->/g, ye = />/g, be = RegExp(`>|${ge}(?:([^\\s"'>=/]+)(${ge}*=${ge}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`, "g"), xe = /'/g, Se = /"/g, Ce = /^(?:script|style|textarea|title)$/i, E = ((e) => (t, ...n) => ({ _$litType$: e, strings: t, values: n }))(1), D = Symbol.for("lit-noChange"), O = Symbol.for("lit-nothing"), we = /* @__PURE__ */ new WeakMap(), Te = T.createTreeWalker(T, 129); function Ee(e, t) { if (!me(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array"); return ce === void 0 ? t : ce.createHTML(t); } var De = (e, t) => { let n = e.length - 1, r = [], i, a = t === 2 ? "" : t === 3 ? "" : "", o = _e; for (let t = 0; t < n; t++) { let n = e[t], s, c, l = -1, u = 0; for (; u < n.length && (o.lastIndex = u, c = o.exec(n), c !== null);) u = o.lastIndex, o === _e ? c[1] === "!--" ? o = ve : c[1] === void 0 ? c[2] === void 0 ? c[3] !== void 0 && (o = be) : (Ce.test(c[2]) && (i = RegExp("" ? (o = i ?? _e, l = -1) : c[1] === void 0 ? l = -2 : (l = o.lastIndex - c[2].length, s = c[1], o = c[3] === void 0 ? be : c[3] === "\"" ? Se : xe) : o === Se || o === xe ? o = be : o === ve || o === ye ? o = _e : (o = be, i = void 0); let d = o === be && e[t + 1].startsWith("/>") ? " " : ""; a += o === _e ? n + de : l >= 0 ? (r.push(s), n.slice(0, l) + le + n.slice(l) + w + d) : n + w + (l === -2 ? t : d); } return [Ee(e, a + (e[n] || "") + (t === 2 ? "" : t === 3 ? "" : "")), r]; }, Oe = class e { constructor({ strings: t, _$litType$: n }, r) { let i; this.parts = []; let a = 0, o = 0, s = t.length - 1, c = this.parts, [l, u] = De(t, n); if (this.el = e.createElement(l, r), Te.currentNode = this.el.content, n === 2 || n === 3) { let e = this.el.content.firstChild; e.replaceWith(...e.childNodes); } for (; (i = Te.nextNode()) !== null && c.length < s;) { if (i.nodeType === 1) { if (i.hasAttributes()) for (let e of i.getAttributeNames()) if (e.endsWith(le)) { let t = u[o++], n = i.getAttribute(e).split(w), r = /([.?@])?(.*)/.exec(t); c.push({ type: 1, index: a, name: r[2], strings: n, ctor: r[1] === "." ? Ne : r[1] === "?" ? Pe : r[1] === "@" ? Fe : Me }), i.removeAttribute(e); } else e.startsWith(w) && (c.push({ type: 6, index: a }), i.removeAttribute(e)); if (Ce.test(i.tagName)) { let e = i.textContent.split(w), t = e.length - 1; if (t > 0) { i.textContent = se ? se.emptyScript : ""; for (let n = 0; n < t; n++) i.append(e[n], fe()), Te.nextNode(), c.push({ type: 2, index: ++a }); i.append(e[t], fe()); } } } else if (i.nodeType === 8) if (i.data === ue) c.push({ type: 2, index: a }); else { let e = -1; for (; (e = i.data.indexOf(w, e + 1)) !== -1;) c.push({ type: 7, index: a }), e += w.length - 1; } a++; } } static createElement(e, t) { let n = T.createElement("template"); return n.innerHTML = e, n; } }; function ke(e, t, n = e, r) { if (t === D) return t; let i = r === void 0 ? n._$Cl : n._$Co?.[r], a = pe(t) ? void 0 : t._$litDirective$; return i?.constructor !== a && (i?._$AO?.(!1), a === void 0 ? i = void 0 : (i = new a(e), i._$AT(e, n, r)), r === void 0 ? n._$Cl = i : (n._$Co ??= [])[r] = i), i !== void 0 && (t = ke(e, i._$AS(e, t.values), i, r)), t; } var Ae = class { constructor(e, t) { this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t; } get parentNode() { return this._$AM.parentNode; } get _$AU() { return this._$AM._$AU; } u(e) { let { el: { content: t }, parts: n } = this._$AD, r = (e?.creationScope ?? T).importNode(t, !0); Te.currentNode = r; let i = Te.nextNode(), a = 0, o = 0, s = n[0]; for (; s !== void 0;) { if (a === s.index) { let t; s.type === 2 ? t = new je(i, i.nextSibling, this, e) : s.type === 1 ? t = new s.ctor(i, s.name, s.strings, this, e) : s.type === 6 && (t = new Ie(i, this, e)), this._$AV.push(t), s = n[++o]; } a !== s?.index && (i = Te.nextNode(), a++); } return Te.currentNode = T, r; } p(e) { let t = 0; for (let n of this._$AV) n !== void 0 && (n.strings === void 0 ? n._$AI(e[t]) : (n._$AI(e, n, t), t += n.strings.length - 2)), t++; } }, je = class e { get _$AU() { return this._$AM?._$AU ?? this._$Cv; } constructor(e, t, n, r) { this.type = 2, this._$AH = O, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = n, this.options = r, this._$Cv = r?.isConnected ?? !0; } get parentNode() { let e = this._$AA.parentNode, t = this._$AM; return t !== void 0 && e?.nodeType === 11 && (e = t.parentNode), e; } get startNode() { return this._$AA; } get endNode() { return this._$AB; } _$AI(e, t = this) { e = ke(this, e, t), pe(e) ? e === O || e == null || e === "" ? (this._$AH !== O && this._$AR(), this._$AH = O) : e !== this._$AH && e !== D && this._(e) : e._$litType$ === void 0 ? e.nodeType === void 0 ? he(e) ? this.k(e) : this._(e) : this.T(e) : this.$(e); } O(e) { return this._$AA.parentNode.insertBefore(e, this._$AB); } T(e) { this._$AH !== e && (this._$AR(), this._$AH = this.O(e)); } _(e) { this._$AH !== O && pe(this._$AH) ? this._$AA.nextSibling.data = e : this.T(T.createTextNode(e)), this._$AH = e; } $(e) { let { values: t, _$litType$: n } = e, r = typeof n == "number" ? this._$AC(e) : (n.el === void 0 && (n.el = Oe.createElement(Ee(n.h, n.h[0]), this.options)), n); if (this._$AH?._$AD === r) this._$AH.p(t); else { let e = new Ae(r, this), n = e.u(this.options); e.p(t), this.T(n), this._$AH = e; } } _$AC(e) { let t = we.get(e.strings); return t === void 0 && we.set(e.strings, t = new Oe(e)), t; } k(t) { me(this._$AH) || (this._$AH = [], this._$AR()); let n = this._$AH, r, i = 0; for (let a of t) i === n.length ? n.push(r = new e(this.O(fe()), this.O(fe()), this, this.options)) : r = n[i], r._$AI(a), i++; i < n.length && (this._$AR(r && r._$AB.nextSibling, i), n.length = i); } _$AR(e = this._$AA.nextSibling, t) { for (this._$AP?.(!1, !0, t); e !== this._$AB;) { let t = oe(e).nextSibling; oe(e).remove(), e = t; } } setConnected(e) { this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e)); } }, Me = class { get tagName() { return this.element.tagName; } get _$AU() { return this._$AM._$AU; } constructor(e, t, n, r, i) { this.type = 1, this._$AH = O, this._$AN = void 0, this.element = e, this.name = t, this._$AM = r, this.options = i, n.length > 2 || n[0] !== "" || n[1] !== "" ? (this._$AH = Array(n.length - 1).fill(/* @__PURE__ */ new String()), this.strings = n) : this._$AH = O; } _$AI(e, t = this, n, r) { let i = this.strings, a = !1; if (i === void 0) e = ke(this, e, t, 0), a = !pe(e) || e !== this._$AH && e !== D, a && (this._$AH = e); else { let r = e, o, s; for (e = i[0], o = 0; o < i.length - 1; o++) s = ke(this, r[n + o], t, o), s === D && (s = this._$AH[o]), a ||= !pe(s) || s !== this._$AH[o], s === O ? e = O : e !== O && (e += (s ?? "") + i[o + 1]), this._$AH[o] = s; } a && !r && this.j(e); } j(e) { e === O ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? ""); } }, Ne = class extends Me { constructor() { super(...arguments), this.type = 3; } j(e) { this.element[this.name] = e === O ? void 0 : e; } }, Pe = class extends Me { constructor() { super(...arguments), this.type = 4; } j(e) { this.element.toggleAttribute(this.name, !!e && e !== O); } }, Fe = class extends Me { constructor(e, t, n, r, i) { super(e, t, n, r, i), this.type = 5; } _$AI(e, t = this) { if ((e = ke(this, e, t, 0) ?? O) === D) return; let n = this._$AH, r = e === O && n !== O || e.capture !== n.capture || e.once !== n.once || e.passive !== n.passive, i = e !== O && (n === O || r); r && this.element.removeEventListener(this.name, this, n), i && this.element.addEventListener(this.name, this, e), this._$AH = e; } handleEvent(e) { typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e); } }, Ie = class { constructor(e, t, n) { this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = n; } get _$AU() { return this._$AM._$AU; } _$AI(e) { ke(this, e); } }, Le = { M: le, P: w, A: ue, C: 1, L: De, R: Ae, D: he, V: ke, I: je, H: Me, N: Pe, U: Fe, B: Ne, F: Ie }, Re = C.litHtmlPolyfillSupport; Re?.(Oe, je), (C.litHtmlVersions ??= []).push("3.3.3"); var ze = (e, t, n) => { let r = n?.renderBefore ?? t, i = r._$litPart$; if (i === void 0) { let e = n?.renderBefore ?? null; r._$litPart$ = i = new je(t.insertBefore(fe(), e), e, void 0, n ?? {}); } return i._$AI(e), i; }, Be = globalThis, k = class extends S { constructor() { super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0; } createRenderRoot() { let e = super.createRenderRoot(); return this.renderOptions.renderBefore ??= e.firstChild, e; } update(e) { let t = this.render(); this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = ze(t, this.renderRoot, this.renderOptions); } connectedCallback() { super.connectedCallback(), this._$Do?.setConnected(!0); } disconnectedCallback() { super.disconnectedCallback(), this._$Do?.setConnected(!1); } render() { return D; } }; k._$litElement$ = !0, k.finalized = !0, Be.litElementHydrateSupport?.({ LitElement: k }); var Ve = Be.litElementPolyfillSupport; Ve?.({ LitElement: k }), (Be.litElementVersions ??= []).push("4.2.2"); //#endregion //#region src/common/helpers/actions.js function He(e, t = null) { if (!(!e || !this.hass)) switch (e.action || "toggle") { case "toggle": { if (!t) return; let e = t.split(".")[0]; this.hass.callService(e, "toggle", { entity_id: t }); break; } case "more-info": { let n = e.entity || e.entity_id || t; this.dispatchEvent(new CustomEvent("hass-more-info", { detail: { entityId: n }, bubbles: !0, composed: !0 })); break; } case "navigate": this._navigate(e.navigation_path); break; case "url": if (!e.url_path) return; window.open(e.url_path, "_blank", "noopener,noreferrer"); break; case "perform-action": case "call-service": { let [t, n] = (e.perform_action || e.service || "").split("."); if (!t || !n) return; this.hass.callService(t, n, e.data || e.service_data || {}, e.target); break; } case "fire-dom-event": this.dispatchEvent(new CustomEvent("ll-custom", { detail: { browser_mod: e.browser_mod }, bubbles: !0, composed: !0 })); break; case "popup": { let t = e.popup_title || e.title || " ", n = e.popup_content || e.content; if (!n) return; let r = Ge(e, t, n); this.dispatchEvent(new CustomEvent("ll-custom", { detail: { browser_mod: { service: "browser_mod.popup", data: r } }, bubbles: !0, composed: !0 })); break; } default: break; } } function A(e) { return !!(e?.action && e.action !== "none"); } function j(e) { let t = e; for (; t;) { let e = t.localName || ""; if (e === "hui-card-picker" || e === "hui-dialog-add-card" || e === "hui-card-picker-card") return !0; let n = t.getRootNode?.(); t = t.parentElement || (n instanceof ShadowRoot ? n.host : null); } return !1; } function M(e, t, n, r) { if (!j(this)) { if (We(e), this._clearDoubleTapTimer?.(), A(r)) { this._doubleTapTimer = setTimeout(() => { this._doubleTapTimer = null, this._handleAction(n, t); }, 250); return; } this._handleAction(n, t); } } function N(e, t, n) { j(this) || (We(e), this._clearDoubleTapTimer?.(), A(n) && this._handleAction(n, t)); } function Ue() { this._doubleTapTimer &&= (clearTimeout(this._doubleTapTimer), null); } function We(e) { e?.preventDefault?.(), e?.stopPropagation?.(), e?.stopImmediatePropagation && e.stopImmediatePropagation(); } function Ge(e, t, n) { let { action: r, popup_title: i, popup_content: a, popup_options: o, title: s, content: c, ...l } = e; return { ...l, ...o || {}, title: t, content: n }; } function Ke(e) { e && (history.pushState(null, "", e), window.dispatchEvent(new CustomEvent("location-changed", { detail: { replace: !1 } }))); } function qe(e, t, n = null) { t.stopPropagation(), this._handleAction(n || { action: "toggle" }, e); } function Je(e) { let t = e.currentTarget.dataEntity, n = e.currentTarget.dataAction, r = e.currentTarget.dataDoubleAction; M.call(this, e, t, n, r); } function Ye(e) { N.call(this, e, e.currentTarget.dataEntity, e.currentTarget.dataDoubleAction); } function Xe(e) { if (this._longPressTriggered) { this._longPressTriggered = !1; return; } let t = e.currentTarget.dataEntity, n = e.currentTarget.dataAction, r = e.currentTarget.dataDoubleAction; M.call(this, e, t, n, r); } function Ze(e) { N.call(this, e, e.currentTarget.dataEntity, e.currentTarget.dataDoubleAction); } function Qe(e) { if (!j(this)) { if (this._longPressTriggered) { this._longPressTriggered = !1; return; } if (e.composedPath().some((e) => e?.classList && e.classList.contains("circle"))) return et.call(this, e); M.call(this, e, this._config.main_entity || this._config.entity, nt(this._config), this._config.double_tap_action); } } function $e(e) { if (!j(this)) { if (e.composedPath().some((e) => e?.classList && e.classList.contains("circle"))) return tt.call(this, e); N.call(this, e, this._config.main_entity || this._config.entity, this._config.double_tap_action); } } function et(e) { if (this._longPressTriggered) { this._longPressTriggered = !1; return; } let t = this._config.main_entity || this._config.entity; if (!t) { M.call(this, e, null, nt(this._config), this._config.double_tap_action); return; } M.call(this, e, t, rt(this._config), this._config.main_entity_double_tap_action); } function tt(e) { let t = this._config.main_entity || this._config.entity; if (!t) { N.call(this, e, null, this._config.double_tap_action); return; } N.call(this, e, t, this._config.main_entity_double_tap_action); } function nt(e = {}) { return e.tap_action?.action ? e.tap_action : { action: "navigate", navigation_path: e.navigate?.navigation_path || e.navigation_path || "/lovelace/home" }; } function rt(e = {}) { return e.main_entity_tap_action?.action === "none" ? nt(e) : e.main_entity_tap_action || { action: "more-info" }; } //#endregion //#region src/common/helpers/entities.js function it(e, t = null) { let n = null; try { n = t?.formatEntityState?.(e); } catch { n = null; } if (n != null && n !== "") return n; let r = e.attributes.unit_of_measurement || "", i = e.state; return r ? `${i}${r}` : i === "on" || i === "off" ? i.toUpperCase() : i; } function at(e) { if (!e) return !1; let t = e.entity_id.split(".")[0]; return ot(e.state, t); } function ot(e, t = "") { let n = String(e ?? "").trim().toLowerCase(); if (!n) return !1; if (!t) return !ct.has(n); if (st.has(t)) return n !== "unavailable"; if (["unavailable", "unknown"].includes(n) || n === "off" && t !== "alert") return !1; switch (t) { case "alarm_control_panel": return n !== "disarmed"; case "alert": return n !== "idle"; case "cover": case "valve": return n !== "closed"; case "device_tracker": case "person": return n !== "not_home"; case "lawn_mower": return !["docked", "paused"].includes(n); case "lock": return n !== "locked"; case "media_player": return n !== "standby"; case "vacuum": return ![ "idle", "docked", "paused" ].includes(n); case "plant": return n === "problem"; case "group": return [ "on", "home", "open", "locked", "problem" ].includes(n); case "timer": return n === "active"; case "camera": return ["streaming", "recording"].includes(n); default: return !0; } } var st = new Set([ "ai_task", "button", "conversation", "datetime", "event", "image", "infrared", "input_button", "notify", "radio_frequency", "scene", "stt", "tag", "tts", "wake_word" ]), ct = new Set([ "", "false", "off", "no", "none", "null", "unknown", "unavailable", "closed", "closing", "locked", "locking", "unlocking", "jammed", "not_home", "idle", "standby", "docked", "disarmed", "below_horizon" ]); function lt(e) { return e?.state?.toString().toLowerCase() === "unavailable"; } function ut(e, t) { return lt(t) ? "unavailable" : e && !t ? "missing" : null; } //#endregion //#region src/common/helpers/templates.js var dt = "__ORBIT_TEMPLATE_RESULT_START_8C4F2A__", ft = "__ORBIT_TEMPLATE_RESULT_END_8C4F2A__"; function pt(e) { if (typeof e != "string") return e; let t = e.trim(); return !t || P(t) ? e : `{{ ${t} }}`; } function P(e) { return /{{|{%|{#/.test(e || ""); } function mt(e = []) { let t = this.hass?.connection; if (!this.isConnected || !t?.subscribeMessage) { ht.call(this); return; } let n = Ot(this), r = jt(this._config || {}), i = /* @__PURE__ */ new Map(); for (let t of e) { let e = pt(t?.template || "")?.trim(); if (!e) continue; let n = t?.entityId || "", a = kt(e, n); i.set(a, { id: a, template: e, entityId: n, configSignature: r }); } for (let [e, t] of n) { let r = i.get(e); (!r || r.configSignature !== t.configSignature) && (At(t), n.delete(e)); } for (let e of i.values()) n.has(e.id) || Et.call(this, e); } function ht() { let e = this.__orbitTemplateSubscriptions; if (e) { for (let t of e.values()) At(t); e.clear(); } } function F(e, t = "") { if (!e) return null; let n = pt(e)?.trim(), r = this.__orbitTemplateSubscriptions; return (r?.get(kt(n, t)) || [...r?.values() || []].find((e) => e.template === n))?.result ?? null; } function gt(e, t = "") { if (!e) return ""; let n = pt(e)?.trim(); return this.__orbitTemplateSubscriptions?.get(kt(n, t))?.error || ""; } function _t(e, t = "") { let n = String(e ?? "").trim().toLowerCase(), r = Number(n); return n && Number.isFinite(r) ? r !== 0 : ["true", "yes"].includes(n) ? !0 : ["false", "no"].includes(n) ? !1 : ot(n, t); } function vt(e, t = null, n = "") { let r = String(e ?? "").trim(); return yt(r, t, n) || (r.includes("_") ? r.replace(/_+/g, " ").replace(/\b\p{L}/gu, (e) => e.toLocaleUpperCase()) : r.replace(/^\p{L}/u, (e) => e.toLocaleUpperCase())); } function yt(e, t, n) { if (!e || !t) return ""; let r = e.toLowerCase(), i = n ? [n] : bt(t), a = /* @__PURE__ */ new Set(); for (let e of i) { let n = [`component.${e}.entity_component._.state.${r}`, `state_badge.${e}.${r}`]; for (let e of n) { let n = t.localize?.(e); n && n !== e && a.add(n); } } if (a.size === 1) return [...a][0]; if (!n) return ""; let o = it({ entity_id: `${n}.orbit_template_state`, state: e, attributes: {} }, t); return o && o !== e ? o : ""; } function bt(e) { let t = Object.keys(e.states || {}).map((e) => e.split(".")[0]).filter(Boolean); return [...new Set([...t, ...xt])]; } var xt = /* @__PURE__ */ "alarm_control_panel.alert.automation.binary_sensor.calendar.camera.climate.cover.device_tracker.fan.humidifier.input_boolean.lawn_mower.light.lock.media_player.person.plant.remote.script.siren.sun.switch.timer.update.vacuum.valve.water_heater".split("."); function St(e) { let t = /* @__PURE__ */ new Map(); return wt(e, t), [...t.values()]; } function Ct(e) { let t = /* @__PURE__ */ new Map(); return Tt(e, t), [...t.values()]; } function wt(e, t, n = "", r = "") { if (Array.isArray(e)) { e.forEach((e) => wt(e, t, "", r)); return; } if (!e || typeof e != "object") { if (typeof e == "string" && (n === "color" || n.endsWith("_color")) && P(e)) { let n = kt(e, r); t.set(n, { template: e, entityId: r }); } return; } let i = e.entity || e.main_entity || r; Object.entries(e).forEach(([e, n]) => wt(n, t, e, i)); } function Tt(e, t, n = "", r = "") { if (Array.isArray(e)) { e.forEach((e) => Tt(e, t, "", r)); return; } if (!e || typeof e != "object") { if (typeof e == "string" && (/(^|_)icon$/.test(n) || n === "icon_template" || n.endsWith("_icon_template")) && P(e)) { let n = kt(e, r); t.set(n, { template: e, entityId: r }); } return; } let i = e.entity || e.main_entity || r; Object.entries(e).forEach(([n, r]) => { let a = n.match(/^(.*)_icon(?:_template)?$/)?.[1]; Tt(r, t, n, a === void 0 ? i : e[a] || i); }); } function Et(e) { let t = Ot(this), { id: n, template: r, entityId: i, configSignature: a } = e, o = { configSignature: a, template: r, entityId: i, result: null, error: "", subscription: void 0 }; t.set(n, o); let s = [ "{% set entity = states[orbit_entity_id] if orbit_entity_id else none %}", dt, r, ft ].join(""), c = this.hass.connection.subscribeMessage((e) => { t.get(n) === o && ("error" in e ? (o.error = Mt(e.error), o.result = null) : (o.error = "", o.result = Dt(e.result)), this._templateRevision = (this._templateRevision || 0) + 1); }, { type: "render_template", template: s, variables: { config: this._config || {}, orbit_entity_id: i }, strict: !0, report_errors: !0 }); o.subscription = c, c.catch((e) => { t.get(n) === o && (o.subscription = void 0, o.error = Mt(e), o.result = null, this._templateRevision = (this._templateRevision || 0) + 1); }); } function Dt(e) { let t = String(e ?? ""), n = t.indexOf(dt), r = t.lastIndexOf(ft); return n !== -1 && r > n ? t.slice(n + 38, r).trim() : t.trim(); } function Ot(e) { return e.__orbitTemplateSubscriptions ||= /* @__PURE__ */ new Map(), e.__orbitTemplateSubscriptions; } function kt(e, t) { return JSON.stringify([e || "", t || ""]); } function At(e) { e.subscription?.then((e) => e()).catch(() => {}); } function jt(e) { try { return JSON.stringify(e); } catch { return ""; } } function Mt(e) { if (!e) return "Template rendering failed"; if (typeof e == "string") return e; if (e.message) return e.message; try { return JSON.stringify(e); } catch { return String(e); } } //#endregion //#region src/common/helpers/colors.js function Nt(e) { if (e = I.call(this, e), !e) return "rgb(var(--color-theme))"; let t = e.toString().trim(); return Kt(t) ? t : Lt(t); } function Pt(e) { if (e = I.call(this, e), !e) return "rgba(var(--color-theme), 0.3)"; let t = e.toString().trim(); return t === "theme" ? "rgba(var(--color-theme), 0.3)" : Gt.call(this, t, 70); } function Ft(e) { if (e = I.call(this, e), !e) return "rgba(var(--color-theme), 0.2)"; let t = e.toString().trim(); return t === "theme" ? "rgba(var(--color-theme), 0.05)" : Gt.call(this, t, 20); } function It(e) { if (e = I.call(this, e), !e) return "rgba(var(--color-theme), 0.25)"; let t = e.toString().trim(); return Gt.call(this, t, 25); } function Lt(e) { let t = qt(e); if (!t) return "rgb(var(--color-theme))"; if (t === "light") return "var(--state-light-active-color, var(--state-active-color, rgb(var(--color-theme))))"; let n = Vt(t); return Rt(t) ? n ? `rgb(var(--${n}))` : `var(--${t}-color, var(--${t}, rgb(var(--color-theme))))` : t.startsWith("color-") ? `rgb(var(--${t}))` : `var(--${t}, rgb(var(--color-${t}, var(--color-theme))))`; } function Rt(e) { return zt.has(qt(e)); } var zt = new Set([ "red", "pink", "purple", "deep-purple", "indigo", "blue", "light-blue", "cyan", "teal", "green", "light-green", "lime", "yellow", "amber", "orange", "deep-orange", "brown", "light-grey", "grey", "dark-grey", "blue-grey", "black", "white", "disabled" ]); function Bt(e) { return !!Vt(e); } function Vt(e) { let t = qt(e); return t && Ht(t).find(Wt) || ""; } function Ht(e) { let t = e.startsWith("color-") ? e.slice(6) : e, n = Ut[t] || []; return [`color-${t}`, ...n.map((e) => `color-${e}`)]; } var Ut = { "blue-grey": ["bluegrey"], "dark-grey": ["darkgrey"], "deep-orange": ["deeporange"], "deep-purple": ["deeppurple"], "light-blue": ["lightblue"], "light-green": ["lightgreen"], "light-grey": ["lightgrey"] }; function Wt(e) { return typeof document > "u" ? !1 : [document.documentElement, document.body].filter(Boolean).some((t) => getComputedStyle(t).getPropertyValue(`--${e}`).trim()); } function Gt(e, t) { if (e = I.call(this, e), !e) return "transparent"; let n = e.toString().trim(); return `color-mix(in srgb, transparent, ${Kt(n) ? n : Lt(n)} ${t}%)`; } function I(e) { if (!P(e)) return e; let t = this?._orbitColorTemplateEntityId || ""; return F.call(this, e, t) || ""; } function Kt(e) { let t = e.toString().trim(); return t.startsWith("rgb") || t.startsWith("hsl") || t.startsWith("#"); } function qt(e) { return e.toString().trim().toLowerCase().replace(/[^a-z0-9-_]/g, ""); } //#endregion //#region src/common/helpers/card-name.js function Jt(e, t, n = "Card") { if (e.name) return e.name; if (e.card_name) return e.card_name; if (e.area_name) return Yt(e.area_name, e, t, n); if (e.room_name) return Yt(e.room_name, e, t, n); let r = e.area; return r && t?.areas?.[r] && t.areas[r].name || n; } function Yt(e, t, n, r = "") { return typeof e == "string" ? e : (Array.isArray(e) ? e : [e]).map((e) => Xt(e, t, n, r)).filter(Boolean).join(" "); } function Xt(e, t, n, r) { if (!e) return ""; if (typeof e == "string") return e; if (e.type === "text") return e.text || ""; if (e.type === "area") return Zt(t, n) || ""; if (e.type === "floor") return Qt(t, n) || ""; if (e.type === "device_class") return (Array.isArray(t.device_class) ? t.device_class : [t.device_class]).filter((e) => typeof e == "string" && e.trim()).map((e) => e.trim().replaceAll("_", " ").replace(/\b\w/g, (e) => e.toUpperCase())).join(", "); let i = $t(t, n); return i && typeof n?.formatEntityName == "function" ? n.formatEntityName(i, { type: e.type }) || "" : e.type === "entity" && (i?.attributes?.friendly_name || i?.entity_id) || ""; } function Zt(e, t) { let n = e.area; if (n && t?.areas?.[n]) return t.areas[n].name || ""; let r = $t(e, t); return r && typeof t?.formatEntityName == "function" ? t.formatEntityName(r, { type: "area" }) : ""; } function Qt(e, t) { let n = e.area, r = n && t?.areas?.[n] ? t.areas[n].floor_id : ""; if (r && t?.floors?.[r]) return t.floors[r].name || ""; let i = $t(e, t); return i && typeof t?.formatEntityName == "function" ? t.formatEntityName(i, { type: "floor" }) : ""; } function $t(e, t) { let n = e.main_entity || e.entity || ""; return n && t?.states ? t.states[n] : null; } //#endregion //#region src/common/helpers/documentation.js var en = "https://github.com/andyblac/Orbit-Cards/wiki", tn = { "orbit-area-card-dev": { default: "Area-Card", card: "Area-Card#main-layout", status: "Area-Card#status-row", buttons: "Area-Card#side-buttons", curve: "Area-Card#curved-buttons", action: "Area-Card#action-button" }, "orbit-room-card-dev": { default: "Area-Card", card: "Area-Card#main-layout", status: "Area-Card#status-row", buttons: "Area-Card#side-buttons", curve: "Area-Card#curved-buttons", action: "Area-Card#action-button" }, "orbit-status-card-dev": { default: "Status-Card" }, "orbit-action-card-dev": { default: "Action-Card" }, "orbit-deck-card-dev": { default: "Deck-Card", "setup-wrap": "Deck-Card#wrap-layout", "setup-tabs": "Deck-Card#tabs-layout", "setup-overlay": "Deck-Card#overlay-layout", card: "Deck-Card#deck-items" } }; function nn(e = "") { return e.replace(/^custom:/, ""); } function rn(e, t = "default") { let n = tn[nn(e)], r = n?.[t] || n?.default; return r ? `${en}/${r}` : `${en}`; } function an(e, t, n = "default") { let r = rn(t, n); queueMicrotask(() => { let t = on(e, "hui-dialog-edit-card") || on(e, "hui-dialog-edit-badge"); !t || t._documentationURL === r || (t._documentationURL = r, t.requestUpdate?.()); }); } function on(e, t) { let n = e; for (; n;) { if (n.localName === t) return n; let e = n.getRootNode?.(); n = n.parentElement || e?.host || null; } return null; } //#endregion //#region src/common/helpers/card-registration.js function sn({ tag: e, cardClass: t, name: n, description: r, version: a, getEntitySuggestion: o, documentationURL: s, aliases: c = [] }) { customElements.get(e) || customElements.define(e, t), c.forEach((e) => { customElements.get(e.tag) || customElements.define(e.tag, e.cardClass || t); }); let l = new Set([e, ...c.map((e) => e.tag)]); window.customCards = window.customCards || []; for (let e = window.customCards.length - 1; e >= 0; --e) l.has(window.customCards[e].type) && window.customCards.splice(e, 1); window.customCards.push({ type: e, name: n, description: r, preview: !0, version: a, documentationURL: s || rn(e), getEntitySuggestion: o }), i(n, a); } //#endregion //#region src/common/helpers/config-migration.js function cn(e = {}) { let t = { ...e || {} }, n = !1; return t.type === "custom:orbit-room-card-dev" && (t.type = "custom:orbit-area-card-dev", n = !0), Object.prototype.hasOwnProperty.call(t, "room_name") && (t.area_name === void 0 && t.room_name !== void 0 && t.room_name !== "" && (t.area_name = t.room_name), delete t.room_name, n = !0), n = wn(t) || n, n = gn(t) || n, { config: n ? t : e, migrated: n }; } function ln(e = {}) { let t = { ...e || {} }, n = wn(t); if (n = hn(t) || n, Array.isArray(t.entities)) { let e = t.entities.map((e) => { if (!e || typeof e == "string") return e; let t = { ...e }, r = wn(t), i = hn(t), a = r || i; return n ||= a, a ? t : e; }); n && (t.entities = e); } return { config: n ? t : e, migrated: n }; } function un(e = {}) { let t = { ...e || {} }, n = wn(t); return n = _n(t) || n, n = vn(t) || n, { config: n ? t : e, migrated: n }; } function dn(e = {}) { if (!Array.isArray(e?.decks)) return { config: e, migrated: !1 }; let t = !1, n = e.decks.map((e) => { if (!e?.card || typeof e.card != "object") return e; let n = fn(e.card); return n.migrated ? (t = !0, { ...e, card: n.config }) : e; }); return t ? { config: { ...e, decks: n }, migrated: t } : { config: e, migrated: t }; } function fn(e) { return pn(e, "orbit-status-card-dev") ? mn(e) : pn(e, "orbit-area-card-dev") || pn(e, "orbit-room-card-dev") ? cn(e) : pn(e, "orbit-action-card-dev") ? ln(e) : pn(e, "orbit-deck-card-dev") ? dn(e) : { config: e, migrated: !1 }; } function pn(e, t) { return e?.type === `custom:${t}` || e?.type === `custom:${t}-dev`; } function mn(e = {}) { let t = { ...e || {} }, n = wn(t); if (n = Sn(t) || n, t.mode !== "person" && (n = Cn(t) || n), n = xn(t) || n, n = bn(t) || n, n = _n(t) || n, Object.prototype.hasOwnProperty.call(t, "main_entity") && (t.entity === void 0 && t.main_entity !== void 0 && t.main_entity !== "" && (t.entity = t.main_entity), delete t.main_entity, n = !0), Array.isArray(t.entities)) { let e = t.entities.map((e) => { if (!e || typeof e == "string") return e; let t = { ...e }, r = wn(t), i = Sn(t), a = Cn(t), o = xn(t), s = bn(t), c = _n(t), l = r || i || a || o || s || c; return n ||= l, l ? t : e; }); n && (t.entities = e); } return { config: n ? t : e, migrated: n }; } function hn(e) { let t = !1; return t = L(e, "accent_color", "color") || t, t = yn(e, "main_entity_") || t, t; } function gn(e) { let t = !1; t = L(e, "accent_color", "color") || t, t = yn(e, "main_entity_") || t, t = L(e, "main_entity_state_template", "state_template") || t; for (let n of [ "status1", "status2", "status3", "button1", "button2", "button3", "button4", "curve_button1", "curve_button2", "curve_button3", "curve_button4", "curve_button5", "curve_button6", "action_button" ]) { let r = `${n}_icon_template`; Object.prototype.hasOwnProperty.call(e, r) && ((e[`${n}_icon_source`] === "template" && e[r] !== void 0 || e[`${n}_icon`] === void 0) && (e[`${n}_icon`] = e[r]), delete e[r], t = !0), t = L(e, `${n}_on_color`, `${n}_color_on`) || t, t = L(e, `${n}_off_color`, `${n}_color_off`) || t; } return t; } function _n(e) { let t = !1; return t = L(e, "accent_color_source", "color_source") || t, t = L(e, "accent_color", "color") || t, t = L(e, "accent_on_color", "color_on") || t, t = L(e, "accent_off_color", "color_off") || t, t; } function vn(e) { return Object.prototype.hasOwnProperty.call(e, "icon_template") ? ((e.icon_source === "template" && e.icon_template !== void 0 || e.icon === void 0) && (e.icon = e.icon_template), delete e.icon_template, !0) : !1; } function yn(e, t) { let n = !1; for (let r of [ "icon_source", "icon_template", "icon", "icon_on", "icon_off", "icon_svg_color_override", "icon_on_svg_color_override", "icon_off_svg_color_override" ]) { let i = r === "icon_template" ? "icon" : r; n = L(e, `${t}${r}`, i) || n; } return n; } function L(e, t, n) { return Object.prototype.hasOwnProperty.call(e, t) ? (e[n] === void 0 && e[t] !== void 0 && (e[n] = e[t]), delete e[t], !0) : !1; } function bn(e) { let t = yn(e, "entity_"); return t = yn(e, "main_entity_") || t, t = vn(e) || t, t; } function xn(e) { let t = [ "tap_action", "hold_action", "double_tap_action" ], n = !1; for (let r of t) { let t = `main_entity_${r}`, i = `entity_${r}`; Object.prototype.hasOwnProperty.call(e, t) && (e[i] === void 0 && e[t] !== void 0 && (e[i] = e[t]), delete e[t], n = !0); } return n; } function Sn(e) { return Object.prototype.hasOwnProperty.call(e, "status_name") ? (e.name === void 0 && e.status_name !== void 0 && e.status_name !== "" && (e.name = e.status_name), delete e.status_name, !0) : !1; } function Cn(e) { let t = e.state_template !== void 0 && e.state_template !== "", n = e.label_template !== void 0 && e.label_template !== ""; return !t && !n || e.state_source === "template" || e.state_source === "area_count" ? !1 : (e.state_source = "template", !0); } function wn(e) { let t = !1; for (let n of Object.keys(e || {})) { if (!n.endsWith("_template")) continue; let r = pt(e[n]); r !== e[n] && (e[n] = r, t = !0); } return t; } //#endregion //#region src/icons/fan.svg?raw var Tn = "\n\n \n\n \n \n \n\n", En = "\n garage-fixed\n\n \n \n\n \n \n \n\n \n\n \n \n\n \n \n \n \n\n \n \n\n \n \n", Dn = "\n garage-variant-open\n\n \n \n\n \n \n \n \n\n \n\n \n \n\n \n \n \n \n\n \n \n \n\n \n", On = "\n\n \n\n \n \n\n \n\n \n\n \n \n", kn = "\n \n \n \n", An = "\n\n \n\n \n \n\n \n\n \n\n \n \n", jn = "\r\n", Mn = "\n\n Animated shower\n A shower head icon with animated falling water droplets.\n \n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n", Nn = "\n Closing shutter\n A blue shutter smoothly closes from twenty percent closed to fully closed.\n \n\n \n \n \n\n \n \n\n \n \n \n\n", Pn = "\n Opening shutter\n A blue shutter smoothly opens from fully closed to twenty percent closed.\n \n\n \n \n \n\n \n \n\n \n \n \n\n", Fn = "\n\n \n\n \n \n\n \n \n", In = [ { name: "Fan", file: "fan.svg", tags: ["bathroom", "fan"] }, { name: "Garage Door Closed", file: "garage-door_closed.svg", tags: ["garage", "door"] }, { name: "Garage Door Open", file: "garage-door_open.svg", tags: ["garage", "door"] }, { name: "Motion Detected", file: "motion_detected.svg", tags: ["motion", "sensor"] }, { name: "No Motion", file: "motion_off.svg", tags: ["motion", "sensor"] }, { name: "Shutter Opening", file: "shutter-opening.svg", revision: "3bfde376", tags: [ "cover", "shade", "shutter", "opening" ] }, { name: "Shutter Closing", file: "shutter-closing.svg", revision: "458fb44b", tags: [ "cover", "shade", "shutter", "closing" ] }, { name: "Shower On", file: "shower_on.svg", tags: ["bathroom", "water"] }, { name: "Shower Off", file: "shower_off.svg", tags: ["bathroom", "water"] }, { name: "Washing Machine Running", file: "washing-machine-running.svg", tags: ["kitchen", "washing"] } ], Ln = Object.freeze({ "fan.svg": Tn, "garage-door_closed.svg": En, "garage-door_open.svg": Dn, "motion_detected.svg": On, "motion_off.svg": kn, "motion_on.svg": An, "shower_off.svg": jn, "shower_on.svg": Mn, "shutter-closing.svg": Nn, "shutter-opening.svg": Pn, "washing-machine-running.svg": Fn }); function Rn(e) { return e?.startsWith("orbit:") && Ln[decodeURIComponent(e.slice(6).split("?")[0])] || ""; } //#endregion //#region src/common/helpers/icons.js function zn(e, t = "") { return P(e) ? F.call(this, e, t) || "" : e || ""; } function Bn(e, t) { let n = I.call(this, this._config.color || "theme"); return t ? n === "light" ? this._getEntityColor(e) || this._computeFullColor("theme") : this._computeFullColor(n) : this._computeIconColor(n); } function Vn(e) { if (!e) return null; let t = e.entity_id?.split(".")[0], n = e.attributes || {}; if (t === "light") { if (Array.isArray(n.rgb_color)) { let [e, t, r] = n.rgb_color; return `rgb(${e}, ${t}, ${r})`; } if (Array.isArray(n.hs_color)) { let [e, t] = n.hs_color; return `hsl(${e}, ${t}%, 50%)`; } } return null; } function Hn(e) { if (!e) return !1; let t = e.split("?")[0].toLowerCase(); return t.endsWith(".svg") || t.endsWith(".png") || t.endsWith(".webp") || t.endsWith(".gif"); } function Un(e) { return e ? e.startsWith("orbit:") ? e : e.startsWith("local:") ? `/local/icons/${e.slice(6)}` : e.startsWith("/") || e.startsWith("http") ? e : `/local/icons/${e}` : ""; } function R(e, t = {}) { if (!e) return ""; let n = t.forceColor !== !1, r = t.animate === !0, i = [ e, n ? "forced" : "auto", r ? "animated" : "static" ].join("::"), a = this.constructor.svgCache, o = a[i]; if (typeof o == "string" && o !== "loading") return o; if (o === "loading") return qn(i, this), ""; let s = Rn(e); if (s) { let e = Gn(s, n, r); return a[i] = e, e; } return a[i] = "loading", qn(i, this), Yn(e).then((e) => { if (!e.ok) throw Error(`HTTP ${e.status}`); return e.text(); }).then((e) => { e = Gn(e, n, r), a[i] = e, Jn(i); }).catch((t) => { console.error("SVG load failed:", e, t), delete a[i], Jn(i); }), ""; } function Wn(e, t) { return !e || !t ? !0 : e[`${t}_svg_color_override`] !== !1; } function Gn(e, t, n = !1) { let r = e.replace(/]*>/i, (e) => { let t = e.replace(/\swidth="[^"]*"/i, " width=\"100%\"").replace(/\sheight="[^"]*"/i, " height=\"100%\""); return n && (t = t.replace(/^ { t.forEach((e) => { e.isConnected && e.requestUpdate(); }); })); } function Yn(e) { return fetch(e).then((t) => t.ok ? t : fetch(e, { cache: "reload" })); } //#endregion //#region src/common/helpers/long-press.js function Xn(e, t, n) { n && (e.stopPropagation(), this._cancelLongPress(), this._longPressTriggered = !1, this._longPressTimer = setTimeout(() => { this._longPressTriggered = !0, this._handleAction(n, t); }, this._LONG_PRESS_DELAY)); } function Zn() { this._longPressTimer &&= (clearTimeout(this._longPressTimer), null); } function Qn(e) { return this._cancelLongPress(), this._longPressTriggered ? (e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation && e.stopImmediatePropagation(), !0) : !1; } //#endregion //#region src/common/helpers/updates.js function $n(e, t, n = {}) { if (!e.has("hass") || e.has("_config") || [...e.keys()].some((e) => e !== "hass") || n.hasTemplates) return !0; let r = e.get("hass"), i = this.hass; if (!r || !i) return !0; let a = [...new Set(t.filter(Boolean))]; return !a.length && !n.includeZones ? !1 : a.some((e) => r.states?.[e] !== i.states?.[e]) ? !0 : n.includeZones ? tr(r, i) : !1; } function er(e) { return Object.entries(e || {}).some(([e, t]) => e.endsWith("_template") ? !0 : typeof t == "string" ? P(t) : t && typeof t == "object" ? er(t) : !1); } function tr(e, t) { return [...new Set([...Object.keys(e.states || {}), ...Object.keys(t.states || {})].filter((e) => e.startsWith("zone.")))].some((n) => e.states?.[n] !== t.states?.[n]); } //#endregion //#region src/common/helpers/suggestions.js function nr(e = "") { return e.split(".")[0] || ""; } function rr(e, t) { let n = e?.entities?.[t]; if (n?.area_id) return n.area_id; let r = n?.device_id; return r && e?.devices?.[r]?.area_id || ""; } function ir(e, t) { let n = e?.states?.[t]?.state; return n !== "" && Number.isFinite(Number(n)); } //#endregion //#region src/common/helpers/svg-cache.js var z = {}, ar = { Stronger: "Stronger", Weaker: "Weaker", "Current state": "Current state", "Current activity": "Current activity", "No entities available for activity": "No entities available for activity", "Unable to load current activity": "Unable to load current activity", "Currently {state}": "Currently {state}", "No active entities": "No active entities", "This will turn off {count} active entities.": "This will turn off {count} active entities.", Always: "Always", "Area Count": "Area Count", Badge: "Badge", "Device class": "Device class", "Hidden entities": "Hidden entities", "Name template": "Name template", "Not configured": "Not configured", "Entity not found": "Entity not found", "State type": "State type", "Active template": "Active template", "Inactive template": "Inactive template", "Action button": "Action button", "Actions per row": "Actions per row", "Add a card to start.": "Add a card to start.", "Battery entity {index}": "Battery entity {index}", "Button {index}": "Button {index}", Cards: "Cards", "Curve buttons": "Curve buttons", Dynamic: "Dynamic", "ETA entity": "ETA entity", Files: "Files", "Icon only": "Icon only", "Items per row": "Items per row", "Loading files...": "Loading files...", "Lock curve button positions": "Lock curve button positions", "Main entity": "Main entity", "Move left": "Move left", "Move right": "Move right", "No files found. Add a local icon manifest at /local/icons/manifest.json or type the filename manually.": "No files found. Add a local icon manifest at /local/icons/manifest.json or type the filename manually.", "No matching actions": "No matching actions", "No matching colors": "No matching colors", "No matching files": "No matching files", "Orbit Action Card (Dev) v{version}": "Orbit Action Card (Dev) v{version}", "Orbit Deck Card (Dev) v{version}": "Orbit Deck Card (Dev) v{version}", "Orbit Area Card (Dev) v{version}": "Orbit Area Card (Dev) v{version}", "Orbit Status Card (Dev) v{version}": "Orbit Status Card (Dev) v{version}", "Orbit Status Badge (Dev) v{version}": "Orbit Status Badge (Dev) v{version}", "Person entity": "Person entity", Picker: "Picker", "Separate cards": "Separate cards", "State light color": "State light color", "State color (default)": "State color (default)", "State template": "State template", "Status {index}": "Status {index}", "Card background": "Card background", "Force padding": "Force padding", Main: "Main", Overlay: "Overlay", Resize: "Resize", Height: "Height", "Transparent background": "Transparent background", "Primary text color": "Primary text color", "Secondary background color": "Secondary background color", "Tab font size": "Tab font size", "Tab width": "Tab width", Tabs: "Tabs", "Tracker entity": "Tracker entity", "Low sensors": "Low sensors", "Low sensors are only used when a device has no percentage sensor.": "Low sensors are only used when a device has no percentage sensor." }, or = { Stronger: "Stronger", Weaker: "Weaker", "Current state": "Current state", "Current activity": "Current activity", "No entities available for activity": "No entities available for activity", "Unable to load current activity": "Unable to load current activity", "Currently {state}": "Currently {state}", "No active entities": "No active entities", "This will turn off {count} active entities.": "This will turn off {count} active entities.", Always: "Always", "Area Count": "Area Count", Badge: "Badge", "Device class": "Device class", "Hidden entities": "Hidden entities", "Name template": "Name template", "Not configured": "Not configured", "Entity not found": "Entity not found", "State type": "State type", "Active template": "Active template", "Inactive template": "Inactive template", "Action button": "Action button", "Actions per row": "Actions per row", "Add a card to start.": "Add a card to start.", "Battery entity {index}": "Battery entity {index}", "Button {index}": "Button {index}", Cards: "Cards", "Curve buttons": "Curve buttons", Dynamic: "Dynamic", "ETA entity": "ETA entity", Files: "Files", "Icon only": "Icon only", "Items per row": "Items per row", "Loading files...": "Loading files...", "Lock curve button positions": "Lock curve button positions", "Main entity": "Main entity", "Move left": "Move left", "Move right": "Move right", "No files found. Add a local icon manifest at /local/icons/manifest.json or type the filename manually.": "No files found. Add a local icon manifest at /local/icons/manifest.json or type the filename manually.", "No matching actions": "No matching actions", "No matching colors": "No matching colours", "No matching files": "No matching files", "Orbit Action Card (Dev) v{version}": "Orbit Action Card (Dev) v{version}", "Orbit Deck Card (Dev) v{version}": "Orbit Deck Card (Dev) v{version}", "Orbit Area Card (Dev) v{version}": "Orbit Area Card (Dev) v{version}", "Orbit Status Card (Dev) v{version}": "Orbit Status Card (Dev) v{version}", "Orbit Status Badge (Dev) v{version}": "Orbit Status Badge (Dev) v{version}", "Person entity": "Person entity", Picker: "Picker", "Separate cards": "Separate cards", "State light color": "State light colour", "State color (default)": "State colour (default)", "State template": "State template", "Status {index}": "Status {index}", "Card background": "Card background", "Force padding": "Force padding", Main: "Main", Overlay: "Overlay", Resize: "Resize", Height: "Height", "Transparent background": "Transparent background", "Primary text color": "Primary text colour", "Secondary background color": "Secondary background colour", "Tab font size": "Tab font size", "Tab width": "Tab width", Tabs: "Tabs", "Tracker entity": "Tracker entity", "Low sensors": "Low sensors", "Low sensors are only used when a device has no percentage sensor.": "Low sensors are only used when a device has no percentage sensor." }, sr = { Stronger: "Stärker", Weaker: "Schwächer", "Current state": "Aktueller Zustand", "Current activity": "Aktuelle Aktivität", "No entities available for activity": "Keine Entitäten für Aktivitäten verfügbar", "Unable to load current activity": "Aktuelle Aktivität konnte nicht geladen werden", "Currently {state}": "Derzeit {state}", "No active entities": "Keine aktiven Entitäten", "This will turn off {count} active entities.": "Dadurch werden {count} aktive Entitäten ausgeschaltet.", Always: "Immer", "Area Count": "Bereichszähler", Badge: "Abzeichen", "Device class": "Geräteklasse", "Hidden entities": "Ausgeblendete Entitäten", "Name template": "Namensvorlage", "Not configured": "Nicht konfiguriert", "State type": "Zustandstyp", "Active template": "Aktivierungsvorlage", "Inactive template": "Inaktivitätsvorlage", "Action button": "Aktionstaste", "Actions per row": "Aktionen pro Zeile", "Add a card to start.": "Füge eine Karte hinzu, um zu beginnen.", "Battery entity {index}": "Batterie-Entität {index}", "Button {index}": "Taste {index}", Cards: "Karten", "Curve buttons": "Bogen-Tasten", Dynamic: "Dynamisch", "ETA entity": "ETA-Entität", Files: "Dateien", "Icon only": "Nur Symbol", "Items per row": "Elemente pro Zeile", "Loading files...": "Dateien werden geladen...", "Lock curve button positions": "Bogen-Tastenpositionen sperren", "Main entity": "Hauptentität", "Move left": "Nach links verschieben", "Move right": "Nach rechts verschieben", "No matching colors": "Keine passenden Farben", "No matching actions": "Keine passenden Aktionen", "No matching files": "Keine passenden Dateien", "Person entity": "Personen-Entität", Picker: "Auswahl", "Separate cards": "Separate Karten", "State light color": "Lichtstatusfarbe", "State color (default)": "Statusfarbe (Standard)", "State template": "Zustandsvorlage", "Status {index}": "Status {index}", "Card background": "Kartenhintergrund", "Force padding": "Padding erzwingen", Main: "Hauptkarte", Overlay: "Überlagerung", Resize: "Größe ändern", Height: "Höhe", "Transparent background": "Transparenter Hintergrund", "Primary text color": "Primäre Textfarbe", "Secondary background color": "Sekundäre Hintergrundfarbe", "Tab font size": "Tab-Schriftgröße", "Tab width": "Tab-Breite", Tabs: "Tabs", "Tracker entity": "Tracker-Entität", "No files found. Add a local icon manifest at /local/icons/manifest.json or type the filename manually.": "Keine Dateien gefunden. Füge ein lokales Symbolmanifest unter /local/icons/manifest.json hinzu oder gib den Dateinamen manuell ein.", "Orbit Action Card (Dev) v{version}": "Orbit Action Card (Dev) v{version}", "Orbit Area Card (Dev) v{version}": "Orbit Area Card (Dev) v{version}", "Orbit Deck Card (Dev) v{version}": "Orbit Deck Card (Dev) v{version}", "Orbit Status Card (Dev) v{version}": "Orbit Status Card (Dev) v{version}", "Orbit Status Badge (Dev) v{version}": "Orbit Status Badge (Dev) v{version}", "Low sensors": "Sensoren für niedrigen Batteriestand", "Low sensors are only used when a device has no percentage sensor.": "Sensoren für niedrigen Batteriestand werden nur verwendet, wenn ein Gerät keinen Prozentsensor hat." }, cr = { Stronger: "Más fuerte", Weaker: "Más débil", "Current state": "Estado actual", "Current activity": "Actividad actual", "No entities available for activity": "No hay entidades disponibles para la actividad", "Unable to load current activity": "No se pudo cargar la actividad actual", "Currently {state}": "Actualmente {state}", "No active entities": "No hay entidades activas", "This will turn off {count} active entities.": "Esto apagará {count} entidades activas.", Always: "Siempre", "Area Count": "Recuento de área", Badge: "Insignia", "Device class": "Clase de dispositivo", "Hidden entities": "Entidades ocultas", "Name template": "Plantilla de nombre", "Not configured": "Sin configurar", "State type": "Tipo de estado", "Active template": "Plantilla de activación", "Inactive template": "Plantilla de inactividad", "Action button": "Botón de acción", "Actions per row": "Acciones por fila", "Add a card to start.": "Añade una tarjeta para empezar.", "Battery entity {index}": "Entidad de batería {index}", "Button {index}": "Botón {index}", Cards: "Tarjetas", "Curve buttons": "Botones curvos", Dynamic: "Dinámico", "ETA entity": "Entidad ETA", Files: "Archivos", "Icon only": "Solo icono", "Items per row": "Elementos por fila", "Loading files...": "Cargando archivos...", "Lock curve button positions": "Bloquear posiciones de botones curvos", "Main entity": "Entidad principal", "Move left": "Mover a la izquierda", "Move right": "Mover a la derecha", "No matching colors": "No hay colores coincidentes", "No matching actions": "No hay acciones coincidentes", "No matching files": "No hay archivos coincidentes", "Person entity": "Entidad de persona", Picker: "Selector", "Separate cards": "Tarjetas separadas", "State light color": "Color de luz de estado", "State color (default)": "Color de estado (predeterminado)", "State template": "Plantilla de estado", "Status {index}": "Estado {index}", "Card background": "Fondo de tarjeta", "Force padding": "Forzar relleno", Main: "Principal", Overlay: "Superposición", Resize: "Redimensionar", Height: "Alto", "Transparent background": "Fondo transparente", "Primary text color": "Color de texto primario", "Secondary background color": "Color de fondo secundario", "Tab font size": "Tamaño de fuente de pestaña", "Tab width": "Ancho de pestaña", Tabs: "Pestañas", "Tracker entity": "Entidad de seguimiento", "No files found. Add a local icon manifest at /local/icons/manifest.json or type the filename manually.": "No se encontraron archivos. Añade un manifiesto de iconos local en /local/icons/manifest.json o escribe el nombre del archivo manualmente.", "Orbit Action Card (Dev) v{version}": "Orbit Action Card (Dev) v{version}", "Orbit Area Card (Dev) v{version}": "Orbit Area Card (Dev) v{version}", "Orbit Deck Card (Dev) v{version}": "Orbit Deck Card (Dev) v{version}", "Orbit Status Card (Dev) v{version}": "Orbit Status Card (Dev) v{version}", "Orbit Status Badge (Dev) v{version}": "Orbit Status Badge (Dev) v{version}", "Low sensors": "Sensores de batería baja", "Low sensors are only used when a device has no percentage sensor.": "Los sensores de batería baja solo se usan cuando un dispositivo no tiene un sensor de porcentaje." }, lr = { Stronger: "Plus fort", Weaker: "Plus faible", "Current state": "État actuel", "Current activity": "Activité actuelle", "No entities available for activity": "Aucune entité disponible pour l’activité", "Unable to load current activity": "Impossible de charger l’activité actuelle", "Currently {state}": "Actuellement {state}", "No active entities": "Aucune entité active", "This will turn off {count} active entities.": "Cela éteindra {count} entités actives.", Always: "Toujours", "Area Count": "Comptage de zone", Badge: "Badge", "Device class": "Classe d’appareil", "Hidden entities": "Entités masquées", "Name template": "Modèle de nom", "Not configured": "Non configuré", "State type": "Type d’état", "Active template": "Modèle d’activation", "Inactive template": "Modèle d’inactivité", "Action button": "Bouton d'action", "Actions per row": "Actions par ligne", "Add a card to start.": "Ajoutez une carte pour commencer.", "Battery entity {index}": "Entité batterie {index}", "Button {index}": "Bouton {index}", Cards: "Cartes", "Curve buttons": "Boutons courbes", Dynamic: "Dynamique", "ETA entity": "Entité ETA", Files: "Fichiers", "Icon only": "Icône seule", "Items per row": "Éléments par ligne", "Loading files...": "Chargement des fichiers...", "Lock curve button positions": "Verrouiller les positions des boutons courbes", "Main entity": "Entité principale", "Move left": "Déplacer à gauche", "Move right": "Déplacer à droite", "No matching colors": "Aucune couleur correspondante", "No matching actions": "Aucune action correspondante", "No matching files": "Aucun fichier correspondant", "Person entity": "Entité personne", Picker: "Sélecteur", "Separate cards": "Cartes séparées", "State light color": "Couleur d’état de lumière", "State color (default)": "Couleur d’état (par défaut)", "State template": "Modèle d'état", "Status {index}": "Statut {index}", "Card background": "Arrière-plan de la carte", "Force padding": "Forcer le remplissage", Main: "Principal", Overlay: "Superposition", Resize: "Redimensionner", Height: "Hauteur", "Transparent background": "Arrière-plan transparent", "Primary text color": "Couleur du texte principal", "Secondary background color": "Couleur d’arrière-plan secondaire", "Tab font size": "Taille de police de l’onglet", "Tab width": "Largeur de l’onglet", Tabs: "Onglets", "Tracker entity": "Entité de suivi", "No files found. Add a local icon manifest at /local/icons/manifest.json or type the filename manually.": "Aucun fichier trouvé. Ajoutez un manifeste d’icônes local dans /local/icons/manifest.json ou saisissez le nom du fichier manuellement.", "Orbit Action Card (Dev) v{version}": "Orbit Action Card (Dev) v{version}", "Orbit Area Card (Dev) v{version}": "Orbit Area Card (Dev) v{version}", "Orbit Deck Card (Dev) v{version}": "Orbit Deck Card (Dev) v{version}", "Orbit Status Card (Dev) v{version}": "Orbit Status Card (Dev) v{version}", "Orbit Status Badge (Dev) v{version}": "Orbit Status Badge (Dev) v{version}", "Low sensors": "Capteurs de batterie faible", "Low sensors are only used when a device has no percentage sensor.": "Les capteurs de batterie faible ne sont utilisés que lorsqu’un appareil ne possède pas de capteur de pourcentage." }, ur = { Stronger: "Più forte", Weaker: "Più debole", "Current state": "Stato attuale", "Current activity": "Attività corrente", "No entities available for activity": "Nessuna entità disponibile per l’attività", "Unable to load current activity": "Impossibile caricare l’attività corrente", "Currently {state}": "Attualmente {state}", "No active entities": "Nessuna entità attiva", "This will turn off {count} active entities.": "Verranno disattivate {count} entità attive.", Always: "Sempre", "Area Count": "Conteggio area", Badge: "Badge", "Device class": "Classe dispositivo", "Hidden entities": "Entità nascoste", "Name template": "Modello del nome", "Not configured": "Non configurato", "State type": "Tipo di stato", "Active template": "Modello di attivazione", "Inactive template": "Modello di inattività", "Action button": "Pulsante azione", "Actions per row": "Azioni per riga", "Add a card to start.": "Aggiungi una scheda per iniziare.", "Battery entity {index}": "Entità batteria {index}", "Button {index}": "Pulsante {index}", Cards: "Schede", "Curve buttons": "Pulsanti curvi", Dynamic: "Dinamico", "ETA entity": "Entità ETA", Files: "File", "Icon only": "Solo icona", "Items per row": "Elementi per riga", "Loading files...": "Caricamento file...", "Lock curve button positions": "Blocca posizioni dei pulsanti curvi", "Main entity": "Entità principale", "Move left": "Sposta a sinistra", "Move right": "Sposta a destra", "No matching colors": "Nessun colore corrispondente", "No matching actions": "Nessuna azione corrispondente", "No matching files": "Nessun file corrispondente", "Person entity": "Entità persona", Picker: "Selettore", "Separate cards": "Schede separate", "State light color": "Colore stato luce", "State color (default)": "Colore stato (predefinito)", "State template": "Template stato", "Status {index}": "Stato {index}", "Card background": "Sfondo scheda", "Force padding": "Forza padding", Main: "Principale", Overlay: "Sovrapposizione", Resize: "Ridimensiona", Height: "Altezza", "Transparent background": "Sfondo trasparente", "Primary text color": "Colore testo primario", "Secondary background color": "Colore sfondo secondario", "Tab font size": "Dimensione font scheda", "Tab width": "Larghezza scheda", Tabs: "Schede", "Tracker entity": "Entità tracker", "No files found. Add a local icon manifest at /local/icons/manifest.json or type the filename manually.": "Nessun file trovato. Aggiungi un manifesto icone locale in /local/icons/manifest.json oppure digita manualmente il nome del file.", "Orbit Action Card (Dev) v{version}": "Orbit Action Card (Dev) v{version}", "Orbit Area Card (Dev) v{version}": "Orbit Area Card (Dev) v{version}", "Orbit Deck Card (Dev) v{version}": "Orbit Deck Card (Dev) v{version}", "Orbit Status Card (Dev) v{version}": "Orbit Status Card (Dev) v{version}", "Orbit Status Badge (Dev) v{version}": "Orbit Status Badge (Dev) v{version}", "Low sensors": "Sensori di batteria scarica", "Low sensors are only used when a device has no percentage sensor.": "I sensori di batteria scarica vengono usati solo quando un dispositivo non dispone di un sensore percentuale." }, dr = { Stronger: "Sterker", Weaker: "Zwakker", "Current state": "Huidige status", "Current activity": "Huidige activiteit", "No entities available for activity": "Geen entiteiten beschikbaar voor activiteit", "Unable to load current activity": "Kan huidige activiteit niet laden", "Currently {state}": "Momenteel {state}", "No active entities": "Geen actieve entiteiten", "This will turn off {count} active entities.": "Hiermee worden {count} actieve entiteiten uitgeschakeld.", Always: "Altijd", "Area Count": "Gebiedstelling", Badge: "Badge", "Device class": "Apparaatklasse", "Hidden entities": "Verborgen entiteiten", "Name template": "Naamsjabloon", "Not configured": "Niet geconfigureerd", "State type": "Statustype", "Active template": "Activeringssjabloon", "Inactive template": "Deactiveringssjabloon", "Action button": "Actieknop", "Actions per row": "Acties per rij", "Add a card to start.": "Voeg een kaart toe om te beginnen.", "Battery entity {index}": "Batterij-entiteit {index}", "Button {index}": "Knop {index}", Cards: "Kaarten", "Curve buttons": "Gebogen knoppen", Dynamic: "Dynamisch", "ETA entity": "ETA-entiteit", Files: "Bestanden", "Icon only": "Alleen icoon", "Items per row": "Items per rij", "Loading files...": "Bestanden laden...", "Lock curve button positions": "Posities van gebogen knoppen vergrendelen", "Main entity": "Hoofdentiteit", "Move left": "Naar links verplaatsen", "Move right": "Naar rechts verplaatsen", "No matching colors": "Geen overeenkomende kleuren", "No matching actions": "Geen overeenkomende acties", "No matching files": "Geen overeenkomende bestanden", "Person entity": "Persoon-entiteit", Picker: "Kiezer", "Separate cards": "Aparte kaarten", "State light color": "Statuskleur licht", "State color (default)": "Statuskleur (standaard)", "State template": "Statussjabloon", "Status {index}": "Status {index}", "Card background": "Kaartachtergrond", "Force padding": "Padding afdwingen", Main: "Hoofdkaart", Overlay: "Overlay", Resize: "Formaat wijzigen", Height: "Hoogte", "Transparent background": "Transparante achtergrond", "Primary text color": "Primaire tekstkleur", "Secondary background color": "Secundaire achtergrondkleur", "Tab font size": "Tabblad lettergrootte", "Tab width": "Tabbladbreedte", Tabs: "Tabbladen", "Tracker entity": "Tracker-entiteit", "No files found. Add a local icon manifest at /local/icons/manifest.json or type the filename manually.": "Geen bestanden gevonden. Voeg een lokaal iconenmanifest toe op /local/icons/manifest.json of typ de bestandsnaam handmatig.", "Orbit Action Card (Dev) v{version}": "Orbit Action Card (Dev) v{version}", "Orbit Area Card (Dev) v{version}": "Orbit Area Card (Dev) v{version}", "Orbit Deck Card (Dev) v{version}": "Orbit Deck Card (Dev) v{version}", "Orbit Status Card (Dev) v{version}": "Orbit Status Card (Dev) v{version}", "Orbit Status Badge (Dev) v{version}": "Orbit Status Badge (Dev) v{version}", "Low sensors": "Sensoren voor lage batterij", "Low sensors are only used when a device has no percentage sensor.": "Sensoren voor lage batterij worden alleen gebruikt als een apparaat geen percentagesensor heeft." }, fr = { Stronger: "Mais forte", Weaker: "Mais fraco", "Current state": "Estado atual", "Current activity": "Atividade atual", "No entities available for activity": "Nenhuma entidade disponível para atividade", "Unable to load current activity": "Não foi possível carregar a atividade atual", "Currently {state}": "Atualmente {state}", "No active entities": "Nenhuma entidade ativa", "This will turn off {count} active entities.": "Isso desligará {count} entidades ativas.", Always: "Sempre", "Area Count": "Contagem da área", Badge: "Emblema", "Device class": "Classe do dispositivo", "Hidden entities": "Entidades ocultas", "Name template": "Modelo de nome", "Not configured": "Não configurado", "State type": "Tipo de estado", "Active template": "Modelo de ativação", "Inactive template": "Modelo de inatividade", "Action button": "Botão de ação", "Actions per row": "Ações por linha", "Add a card to start.": "Adicione um cartão para começar.", "Battery entity {index}": "Entidade de bateria {index}", "Button {index}": "Botão {index}", Cards: "Cartões", "Curve buttons": "Botões curvos", Dynamic: "Dinâmico", "ETA entity": "Entidade ETA", Files: "Arquivos", "Icon only": "Somente ícone", "Items per row": "Itens por linha", "Loading files...": "Carregando arquivos...", "Lock curve button positions": "Bloquear posições dos botões curvos", "Main entity": "Entidade principal", "Move left": "Mover para a esquerda", "Move right": "Mover para a direita", "No matching colors": "Nenhuma cor correspondente", "No matching actions": "Nenhuma ação correspondente", "No matching files": "Nenhum arquivo correspondente", "Person entity": "Entidade de pessoa", Picker: "Seletor", "Separate cards": "Cartões separados", "State light color": "Cor de estado da luz", "State color (default)": "Cor de estado (padrão)", "State template": "Modelo de estado", "Status {index}": "Status {index}", "Card background": "Fundo do cartão", "Force padding": "Forçar preenchimento", Main: "Principal", Overlay: "Sobreposição", Resize: "Redimensionar", Height: "Altura", "Transparent background": "Fundo transparente", "Primary text color": "Cor do texto primário", "Secondary background color": "Cor de fundo secundário", "Tab font size": "Tamanho da fonte da aba", "Tab width": "Largura da aba", Tabs: "Abas", "Tracker entity": "Entidade de rastreamento", "No files found. Add a local icon manifest at /local/icons/manifest.json or type the filename manually.": "Nenhum arquivo encontrado. Adicione um manifesto de ícones local em /local/icons/manifest.json ou digite o nome do arquivo manualmente.", "Orbit Action Card (Dev) v{version}": "Orbit Action Card (Dev) v{version}", "Orbit Area Card (Dev) v{version}": "Orbit Area Card (Dev) v{version}", "Orbit Deck Card (Dev) v{version}": "Orbit Deck Card (Dev) v{version}", "Orbit Status Card (Dev) v{version}": "Orbit Status Card (Dev) v{version}", "Orbit Status Badge (Dev) v{version}": "Orbit Status Badge (Dev) v{version}", "Low sensors": "Sensores de bateria fraca", "Low sensors are only used when a device has no percentage sensor.": "Os sensores de bateria fraca só são usados quando um dispositivo não tem um sensor de porcentagem." }, pr = { de: sr, en: ar, "en-gb": or, en_gb: or, es: cr, fr: lr, it: ur, nl: dr, "pt-br": fr, pt_br: fr }; function B(e, t, n = {}) { let r = _r(e), i = r.replace("_", "-"), a = r.split("-")[0], o = mr(e, t) || gr(r, t) || gr(i, t) || gr(a, t) || pr.en[t] || t; return Object.entries(n).reduce((e, [t, n]) => e.replaceAll(`{${t}}`, n ?? ""), o); } function mr(e, t) { if (!e?.localize || !t) return null; let n = hr[t] || []; for (let t of n) { let n = e.localize(t); if (n && n !== t) return n; } return null; } var hr = { Activity: ["panel.logbook"], Add: ["ui.common.add"], Above: ["ui.components.selectors.numeric_threshold.crossed.above", "ui.panel.config.automation.editor.conditions.type.numeric_state.above"], "Add card": ["ui.panel.lovelace.editor.edit_card.add"], All: ["ui.components.selectors.automation_behavior.trigger.options.all.label", "ui.panel.config.backup.data.apps_all"], Active: [ "ui.panel.config.users.editor.active", "ui.panel.config.users.picker.headers.is_active", "ui.panel.config.zwave_js.provisioned.active" ], Area: [ "ui.components.selectors.selector.types.area", "ui.components.entity.entity-name-picker.types.area", "ui.components.area-picker.area" ], Areas: ["ui.components.area-filter.title"], Background: ["ui.panel.lovelace.editor.card.tile.background", "ui.panel.lovelace.editor.card.generic.background"], Below: ["ui.components.selectors.numeric_threshold.crossed.below", "ui.panel.config.automation.editor.conditions.type.numeric_state.below"], "Binary sensors": ["component.binary_sensor.entity_component._.name_plural"], "Binary Sensors": ["component.binary_sensor.entity_component._.name_plural"], Badges: ["ui.panel.lovelace.editor.card.heading.badges", "ui.panel.lovelace.editor.badges.name"], Color: ["ui.panel.lovelace.editor.card.tile.color", "ui.dialogs.label-detail.color"], Clear: ["ui.common.clear"], Current: ["ui.common.current"], Custom: [ "ui.components.entity.entity-name-picker.mode_custom", "ui.panel.lovelace.editor.edit_card.pick_card.custom", "ui.panel.config.backup.setup.custom_heading", "ui.panel.config.backup.schedule.time_options.custom", "ui.panel.config.backup.data.apps_custom" ], Content: ["ui.panel.lovelace.editor.card.generic.content"], "Configuration error": ["ui.errors.config.configuration_error"], Domain: ["ui.panel.config.entities.picker.headers.domain"], Entity: [ "ui.components.selectors.selector.types.entity", "ui.components.entity.entity-picker.entity", "ui.panel.lovelace.editor.card.generic.entity" ], Divider: ["ui.panel.lovelace.editor.card.entities.entity_row.divider"], Default: ["ui.common.default"], Duplicate: ["ui.common.duplicate"], Equal: ["ui.components.selectors.select.options.equal"], Icon: ["ui.components.selectors.selector.types.icon", "ui.panel.lovelace.editor.card.generic.icon"], Hide: ["ui.common.hide"], Inactive: ["ui.components.color-picker.colors.inactive"], Interactions: ["ui.panel.lovelace.editor.card.tile.interactions", "ui.panel.lovelace.editor.card.generic.interactions"], Threshold: ["ui.components.selectors.selector.types.threshold", "ui.panel.config.automation.editor.conditions.type.numeric_state.threshold"], None: ["ui.common.none"], Accent: ["ui.components.color-picker.colors.accent"], Automations: ["ui.panel.config.automation.caption", "ui.dialogs.more_info_control.add_to.automations_heading"], Away: ["state_badge.person.not_home"], Buttons: ["ui.panel.lovelace.editor.card.entities.entity_row.buttons"], Card: ["ui.panel.lovelace.editor.card.conditional.card"], Cameras: ["component.camera.entity_component._.name_plural"], Climate: ["component.climate.entity_component._.name_plural", "panel.climate"], Covers: ["component.cover.entity_component._.name_plural"], Crop: ["ui.dialogs.image_cropper.crop"], "Display precision": ["ui.dialogs.entity_registry.editor.precision"], "Displayed elements": ["ui.panel.lovelace.editor.badge.entity.displayed_elements"], "Double tap behavior": ["ui.panel.lovelace.editor.card.generic.double_tap_action"], Home: ["state_badge.person.home"], Fans: ["component.fan.entity_component._.name_plural"], Header: ["ui.panel.lovelace.editor.header-footer.header"], Icons: ["ui.panel.lovelace.editor.features.types.climate-preset-modes.style_list.icons"], "Icon tap behavior": ["ui.panel.lovelace.editor.card.tile.icon_tap_action"], "Hold behavior": ["ui.panel.lovelace.editor.card.generic.hold_action"], "Icon hold behavior": ["ui.panel.lovelace.editor.card.tile.icon_hold_action"], "Icon double tap behavior": ["ui.panel.lovelace.editor.card.tile.icon_double_tap_action"], Mode: ["ui.card.climate.mode"], Multiple: ["ui.components.selectors.selector.multiple"], Person: ["component.person.entity_component._.name"], Prefix: ["ui.panel.lovelace.editor.elements.prefix"], Primary: ["ui.components.color-picker.colors.primary"], Name: ["ui.common.name"], Lights: ["component.light.entity_component._.name_plural"], Locks: ["component.lock.entity_component._.name_plural"], "Media players": ["component.media_player.entity_component._.name_plural"], Remove: ["ui.common.remove"], Search: ["ui.components.data-table.search", "ui.panel.lovelace.editor.card.generic.search"], Scenes: ["ui.panel.config.scene.caption"], Sensors: ["component.sensor.entity_component._.name_plural"], Scripts: ["ui.panel.config.script.caption"], Security: ["panel.security"], Separator: ["ui.panel.lovelace.editor.card.clock.date.sections.separator"], Standard: ["ui.panel.config.energy.battery.dialog.type_standard"], State: ["ui.panel.lovelace.editor.card.generic.state"], Switches: ["component.switch.entity_component._.name_plural"], "State content": ["ui.panel.lovelace.editor.badge.entity.state_content"], Status: ["ui.panel.config.entities.picker.headers.status"], Style: ["ui.panel.lovelace.editor.features.types.climate-preset-modes.style", "ui.panel.lovelace.editor.features.types.numeric-input.style"], "Tap behavior": ["ui.panel.lovelace.editor.card.generic.tap_action"], Theme: ["ui.components.selectors.selector.types.theme", "ui.components.theme-picker.theme"], Template: ["ui.components.selectors.selector.types.template"], Unavailable: ["state.default.unavailable"], Top: ["ui.panel.lovelace.editor.edit_view_header.settings.badges_position_options.top"], Right: ["ui.panel.lovelace.editor.card.energy-date-selection.opening_directions.right"], Bottom: ["ui.panel.lovelace.editor.card.tile.features_position_options.bottom", "ui.panel.lovelace.editor.edit_view_header.settings.badges_position_options.bottom"], Left: ["ui.panel.lovelace.editor.card.energy-date-selection.opening_directions.left"], Width: ["ui.panel.lovelace.editor.edit_section.settings.column_span"], Visibility: ["ui.panel.lovelace.editor.edit_card.tab_visibility"], "Visible if selected in state content": ["ui.panel.lovelace.editor.card.heading.entity_config.name_helper"], Wrap: ["ui.panel.lovelace.editor.edit_view_header.settings.badges_wrap_options.wrap"] }; function gr(e, t) { let n = pr[e]?.[t]; return n === "" ? null : n; } function _r(e) { return (e?.locale?.language || e?.language || "en").toLowerCase(); } //#endregion //#region src/common/helpers/default-actions.js var vr = { automation: "automation.trigger", button: "button.press", input_button: "input_button.press", scene: "scene.turn_on", script: "script.turn_on" }, yr = new Set([ "alarm_control_panel", "climate", "cover", "fan", "humidifier", "input_boolean", "light", "lock", "media_player", "remote", "siren", "switch", "vacuum", "water_heater" ]); function br(e, t = "more-info") { let n = e?.split(".")[0]; if (!n) return { action: t }; let r = vr[n]; return r ? { action: "call-service", service: r, service_data: { entity_id: e } } : yr.has(n) ? { action: "toggle" } : { action: t }; } //#endregion //#region src/cards/area/helpers/lifecycle.js function xr(e) { if (!e.has("_config") && !e.has("hass") && !e.has("_templateRevision")) return; this._cardName = this._getCardName(""); let t = this._config.main_entity || this._config.entity, n = this._config.area, r = t && this.hass ? this.hass.states[t] : null, i = this._config?.state_template, a = this._evaluateStateTemplate(i, t), o = i ? _t(a, t?.split(".")[0] || "") : r ? this._getEntityActiveState(r) : !1; this._iconColor = this._getMainIconColor(r, o); let s = this._config.icon_on, c = this._config.icon_off, l = Hr(this._config, n, t), u = zn.call(this, this._config.icon, t), d = ["custom", "template"].includes(l), f = n && this.hass?.areas?.[n] && this.hass.areas[n].icon || "mdi:sofa", p = l === "template" ? u : d && ((o ? s : c) || u) || ""; this._mainStateObj = r, this._useNativeMainIcon = !!r && l !== "area" && l !== "template" && !p; let m = l === "template" && u ? "icon" : d && o && s ? "icon_on" : d && !o && c ? "icon_off" : d && u ? "icon" : ""; this._icon = p || f, this._iconSvgForceColor = m ? this._getSvgColorOverride(m) : !0, this._statusItems = Sr.call(this), this._buttonModels = Er.call(this), this._curveButtonModels = Dr.call(this), this._actionButtonModel = Or.call(this); } function Sr() { return [ 1, 2, 3 ].map((e) => { let t = this._config[`status${e}`]; if (!t) return null; let n = this.hass?.states[t], r = `status${e}`, i = wr.call(this, r, t), a = zn.call(this, this._config[`${r}_icon`], t), o = ["custom", "template"].includes(i) ? a : n ? "" : "mdi:alert-circle-outline"; return { entityId: t, stateObj: n, useStateIcon: i === "entity" && !!n, text: Tr.call(this, n, this._config[`status${e}_decimal_places`]), icon: o, iconPath: this._isImageIcon(o) ? this._resolveIconPath(o) : "", isImage: this._isImageIcon(o), isHaIcon: Cr(o) }; }).filter(Boolean); } function Cr(e) { return /^[a-z0-9_-]+:/i.test(e || ""); } function wr(e, t = "") { let n = this._config?.[`${e}_icon_source`], r = !!(t || this._config?.[e]); return n === "custom" ? "custom" : n === "template" ? "template" : n === "none" ? "none" : n === "entity" && r ? "entity" : this._config?.[`${e}_icon`] ? "custom" : "none"; } function Tr(e, t) { if (!e) return "—"; if (t === void 0 || t === "") return this.formatState(e); let n = Number(t), r = Number(e.state); if (!Number.isFinite(n) || !Number.isFinite(r)) return this.formatState(e); let i = e.attributes.unit_of_measurement || ""; return `${r.toFixed(Math.max(0, n))}${i}`; } function Er() { return [ this._config.button1, this._config.button2, this._config.button3, this._config.button4 ].filter(Boolean).map((e, t) => kr.call(this, "button", e, t, { defaultAction: { action: "toggle" }, defaultHoldAction: { action: "more-info" }, getIconColor: Fr, getBackgroundColor: Pr })).filter(Boolean); } function Dr() { let e = this._config?.curve_buttons_lock_position ?? !1, t = [ this._config.curve_button1, this._config.curve_button2, this._config.curve_button3, this._config.curve_button4, this._config.curve_button5, this._config.curve_button6 ], n = t.filter(Boolean); return t.map((t, r) => { if (!e && !t) return null; if (e && !t) return { empty: !0, position: r }; let i = kr.call(this, "curve_button", t, r, { defaultAction: { action: "more-info" }, defaultHoldAction: null, getIconColor: Rr, getBackgroundColor: null }); return i ? (i.position = e ? r : n.indexOf(t), i) : null; }).filter(Boolean); } function Or() { let e = this._config.action_button; return e ? kr.call(this, "action_button", e, 0, { key: "action_button", defaultAction: br(e), defaultHoldAction: null, getIconColor: zr, getBackgroundColor: null }) : null; } function kr(e, t, n, r) { let i = this.hass?.states[t], a = !!(t && !i), o = r.key || `${e}${n + 1}`, s = this._config?.[`${o}_state_template`], c = this._evaluateStateTemplate(s, t), l = t.split(".")[0], u = s ? _t(c, l) : Ar.has(l) ? !1 : this._getEntityActiveState(i), d = Nr.call(this, o, t), f = Mr.call(this, o, u) || (a ? "mdi:alert-circle-outline" : ""), p = this._isImageIcon(f), m = this._buttonIconStates?.get(o), h = !!(m && m.entityId === t && m.isOn !== u); return this._buttonIconStates ||= /* @__PURE__ */ new Map(), this._buttonIconStates.set(o, { entityId: t, isOn: u }), { entityId: t, stateObj: i, useStateIcon: !!i && (d === "entity" || d !== "template" && !f), holdAction: this._config?.[`${o}_hold_action`] || r.defaultHoldAction, doubleTapAction: this._config?.[`${o}_double_tap_action`] || null, tapAction: this._config?.[`${o}_tap_action`] || r.defaultAction, backgroundColor: a ? "color-mix(in srgb, var(--error-color) 12%, transparent)" : r.getBackgroundColor ? r.getBackgroundColor.call(this, o, i, u) : "", icon: f, iconColor: a ? "var(--error-color)" : r.getIconColor.call(this, o, i, u), iconPath: p ? this._resolveIconPath(f) : "", svgForceColor: jr.call(this, o, u), animateIcon: h, isImage: p }; } var Ar = new Set(/* @__PURE__ */ "ai_task.button.conversation.date.datetime.event.image.infrared.input_button.input_datetime.input_number.input_select.input_text.notify.number.radio_frequency.scene.select.sensor.stt.tag.text.time.tts.wake_word.weather".split(".")); function jr(e, t) { let n = Nr.call(this, e); if (!["custom", "template"].includes(n)) return !0; let r = this._config?.[`${e}_icon`], i = n === "template" ? r ? `${e}_icon` : "" : t && this._config?.[`${e}_icon_on`] ? `${e}_icon_on` : !t && this._config?.[`${e}_icon_off`] ? `${e}_icon_off` : r ? `${e}_icon` : ""; return i ? this._getSvgColorOverride(i) : !0; } function Mr(e, t) { let n = this._config?.[`${e}_icon_on`], r = this._config?.[`${e}_icon_off`], i = Nr.call(this, e), a = zn.call(this, this._config?.[`${e}_icon`], this._config?.[e] || ""); return i === "entity" ? "" : i === "template" ? a : (t ? n : r) || a || ""; } function Nr(e, t = "") { let n = this._config?.[`${e}_icon_source`], r = !!(t || this._config?.[e]); return n === "custom" ? "custom" : n === "template" ? "template" : n === "entity" && r ? "entity" : this._config?.[`${e}_icon`] || this._config?.[`${e}_icon_on`] || this._config?.[`${e}_icon_off`] ? "custom" : "entity"; } function Pr(e, t, n) { if (n) return this._computeButtonBackground(Ir.call(this, e, t)); let r = I.call(this, Br.call(this, e, !1)); return !r || r === "theme" ? "rgba(var(--color-theme),0.05)" : Gt.call(this, r, 10); } function Fr(e, t, n) { if (n) return this._computeFullColor(Ir.call(this, e, t)); let r = I.call(this, Br.call(this, e, !1)); return r.startsWith("rgba(") ? r : this._computeIconColor(r); } function Ir(e, t) { let n = I.call(this, Br.call(this, e, !0)); return n === "light" ? this._getEntityColor(t) || this._config.color || "theme" : n; } function Lr(e, t, n) { let r = I.call(this, this._config.color || "theme"); return r === "theme" ? n ? "rgba(var(--color-theme),0.7)" : "rgba(var(--color-theme),0.2)" : n ? this._computeFullColor(r) : Gt.call(this, r, 40); } function Rr(e, t, n) { let r = Br.call(this, e, n, ""), i = I.call(this, r); return i && i !== "theme" ? Vr.call(this, e, t, n, i) : Lr.call(this, e, t, n); } function zr(e, t, n) { let r = Br.call(this, e, n, ""), i = I.call(this, r); return i && i !== "theme" ? Vr.call(this, e, t, n, i) : Lr.call(this, e, t, n); } function Br(e, t, n = "theme") { return this._config?.[`${e}_color_source`] === "template" ? this._config?.[`${e}_color`] || n : this._config?.[`${e}_color_${t ? "on" : "off"}`] || n; } function Vr(e, t, n, r) { return n ? Fr.call(this, e, t, !0) : r.startsWith("rgba(") ? r : Gt.call(this, r, 40); } function Hr(e = {}, t, n) { let r = e.icon_source, i = !!t, a = !!n; return r === "custom" ? r : r === "template" ? "template" : r === "area" && i ? "area" : r === "entity" && a ? "entity" : i ? "area" : a ? "entity" : "area"; } //#endregion //#region node_modules/lit-html/directive.js var Ur = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, Wr = (e) => (...t) => ({ _$litDirective$: e, values: t }), Gr = class { constructor(e) {} get _$AU() { return this._$AM._$AU; } _$AT(e, t, n) { this._$Ct = e, this._$AM = t, this._$Ci = n; } _$AS(e, t) { return this.update(e, t); } update(e, t) { return this.render(...t); } }, Kr = class extends Gr { constructor(e) { if (super(e), this.it = O, e.type !== Ur.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings"); } render(e) { if (e === O || e == null) return this._t = void 0, this.it = e; if (e === D) return e; if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value"); if (e === this.it) return this._t; this.it = e; let t = [e]; return t.raw = t, this._t = { _$litType$: this.constructor.resultType, strings: t, values: [] }; } }; Kr.directiveName = "unsafeHTML", Kr.resultType = 1; var V = Wr(Kr); //#endregion //#region src/cards/area/renders/buttons.js function qr(e) { if (!e) return null; let t = ut(e.entityId, e.stateObj), n = t ? this._t(t === "missing" ? "Entity not found" : "Unavailable") : ""; return E` `; } //#endregion //#region src/cards/area/renders/area-card.js function Jr() { let e = this._buttonModels || [], t = this._isImageIcon(this._icon) ? this._resolveIconPath(this._icon) : "", n = t ? this._getInlineSvg(t, this._iconSvgForceColor) : ""; return E`
${this._cardName}
${Yr.call(this)}
${e.length ? E`
${e.map((e) => this._renderButtons(e))}
` : ""}
${this._renderCurveButtons()}
${this._isImageIcon(this._icon) ? E`
${n ? V(n) : E``}
` : this._useNativeMainIcon && this._mainStateObj ? E` ` : E` `} ${Zr.call(this, this._config.main_entity || this._config.entity, this._mainStateObj)}
`; } function Yr() { let e = this._statusItems || []; if (!e.length) return this._statusText || ""; let t = this._config?.status_separator || "|"; return e.map((e, n) => E` ${n > 0 ? E` ${t} ` : ""} ${Xr.call(this, e)} ${e.text} `); } function Xr(e) { if (ut(e.entityId, e.stateObj) === "missing") { let e = this._t("Entity not found"); return E` `; } return !e.icon && !e.useStateIcon ? "" : e.isImage ? E` ${e.iconPath ? V(this._getInlineSvg(e.iconPath, !0)) : ""} ` : e.useStateIcon && e.stateObj ? E` ` : e.isHaIcon ? E` ` : E` ${e.icon} `; } function Zr(e, t) { let n = ut(e, t); if (!n) return ""; let r = this._t(n === "missing" ? "Entity not found" : "Unavailable"); return E` `; } //#endregion //#region node_modules/lit-html/directive-helpers.js var { I: Qr } = Le, $r = (e) => e, ei = () => document.createComment(""), ti = (e, t, n) => { let r = e._$AA.parentNode, i = t === void 0 ? e._$AB : t._$AA; if (n === void 0) n = new Qr(r.insertBefore(ei(), i), r.insertBefore(ei(), i), e, e.options); else { let t = n._$AB.nextSibling, a = n._$AM, o = a !== e; if (o) { let t; n._$AQ?.(e), n._$AM = e, n._$AP !== void 0 && (t = e._$AU) !== a._$AU && n._$AP(t); } if (t !== i || o) { let e = n._$AA; for (; e !== t;) { let t = $r(e).nextSibling; $r(r).insertBefore(e, i), e = t; } } } return n; }, ni = (e, t, n = e) => (e._$AI(t, n), e), ri = {}, ii = (e, t = ri) => e._$AH = t, ai = (e) => e._$AH, oi = (e) => { e._$AR(), e._$AA.remove(); }, si = (e, t, n) => { let r = /* @__PURE__ */ new Map(); for (let i = t; i <= n; i++) r.set(e[i], i); return r; }, ci = Wr(class extends Gr { constructor(e) { if (super(e), e.type !== Ur.CHILD) throw Error("repeat() can only be used in text expressions"); } dt(e, t, n) { let r; n === void 0 ? n = t : t !== void 0 && (r = t); let i = [], a = [], o = 0; for (let t of e) i[o] = r ? r(t, o) : o, a[o] = n(t, o), o++; return { values: a, keys: i }; } render(e, t, n) { return this.dt(e, t, n).values; } update(e, [t, n, r]) { let i = ai(e), { values: a, keys: o } = this.dt(t, n, r); if (!Array.isArray(i)) return this.ut = o, a; let s = this.ut ??= [], c = [], l, u, d = 0, f = i.length - 1, p = 0, m = a.length - 1; for (; d <= f && p <= m;) if (i[d] === null) d++; else if (i[f] === null) f--; else if (s[d] === o[p]) c[p] = ni(i[d], a[p]), d++, p++; else if (s[f] === o[m]) c[m] = ni(i[f], a[m]), f--, m--; else if (s[d] === o[m]) c[m] = ni(i[d], a[m]), ti(e, c[m + 1], i[d]), d++, m--; else if (s[f] === o[p]) c[p] = ni(i[f], a[p]), ti(e, i[d], i[f]), f--, p++; else if (l === void 0 && (l = si(o, p, m), u = si(s, d, f)), l.has(s[d])) if (l.has(s[f])) { let t = u.get(o[p]), n = t === void 0 ? null : i[t]; if (n === null) { let t = ti(e, i[d]); ni(t, a[p]), c[p] = t; } else c[p] = ni(n, a[p]), ti(e, i[d], n), i[t] = null; p++; } else oi(i[f]), f--; else oi(i[d]), d++; for (; p <= m;) { let t = ti(e, c[m + 1]); ni(t, a[p]), c[p++] = t; } for (; d <= f;) { let e = i[d++]; e !== null && oi(e); } return this.ut = o, ii(e, c), D; } }); //#endregion //#region src/cards/area/renders/curve-buttons.js function li() { let e = this._curveButtonModels || [], t = this._actionButtonModel; return E`
${ci(e, (e, t) => t, (e) => e.empty ? E`
` : E` `)} ${t ? ui.call(this, t) : ""}
`; } function ui(e) { return E` `; } function di(e, t) { let n = ut(e, t); if (!n) return ""; let r = this._t(n === "missing" ? "Entity not found" : "Unavailable"); return E` `; } //#endregion //#region src/common/styles/header.js var fi = d` .header { width: 100%; } .card-name { font-size: clamp(18px, 9cqw, 34px); font-weight: bold; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .status { font-size: clamp(13px, 6.7cqw, 26px); font-weight: bold; opacity: 0.4; line-height: 1.1; margin-top: clamp(6px, 1.8cqw, 28px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } `, pi = d` :host { display: block; } ha-card { display: block; width: 100%; box-sizing: border-box; background: var(--ha-card-background, var(--card-background-color, #1a1a1a)); border-radius: 18px; overflow: hidden; position: relative; cursor: pointer; transition: transform 0.2s ease; container-type: size; } ha-card:active { transform: scale(0.98); } .container { padding: clamp(14px, 2cqw, 24px); height: 100%; box-sizing: border-box; position: relative; } .content { position: relative; z-index: 2; display: flex; flex-direction: column; height: 100%; } `, mi = d` .main-icon { --orbit-main-icon-size: 45%; --mdc-icon-size: var(--orbit-main-icon-size); display: flex; align-items: center; justify-content: center; pointer-events: none; } ha-state-icon.main-icon { width: var(--orbit-main-icon-size); height: var(--orbit-main-icon-size); --mdc-icon-size: 100%; } .main-image-icon { width: 45%; height: 45%; display: flex; align-items: center; justify-content: center; pointer-events: none; user-select: none; position: relative; } .main-image-icon svg, .main-image-icon img { position: absolute; inset: 0; width: 100%; height: 100%; } .main-image-icon img { object-fit: contain; filter: brightness(0) invert(1); opacity: 0.8; } .main-icon-badge-anchor { position: relative; width: 45%; height: 45%; display: flex; align-items: center; justify-content: center; } .main-icon-badge-anchor .main-icon { --orbit-main-icon-size: 100%; } .main-icon-badge-anchor ha-state-icon.main-icon, .main-icon-badge-anchor .main-image-icon { width: 100%; height: 100%; } .entity-unavailable-badge { --tile-badge-background-color: var(--orange-color); position: absolute; top: 0; right: 0; transform: translate(22%, -22%); pointer-events: none; z-index: 10; } .entity-unavailable-badge.entity-missing-badge { --tile-badge-background-color: var(--error-color); } `, hi = d` .status { display: flex; align-items: center; min-width: 0; } .status-item { display: inline-flex; align-items: center; min-width: 0; } .status-separator { padding: 0 0.35em; } .status-prefix-icon { --mdc-icon-size: 0.9em; width: 0.9em; height: 0.9em; margin-right: 0.15em; flex: none; } ha-state-icon.status-prefix-icon { --mdc-icon-size: 100%; } .status-prefix-image { display: inline-flex; color: currentColor; } .status-prefix-image svg, .status-prefix-image img { width: 100%; height: 100%; display: block; } .status-prefix-text { margin-right: 0.15em; flex: none; } .header.compressed { width: calc(100% - (var(--button-area-width) - 5px)); } .button-column[style*="--button-count:4"] ~ .header.compressed { width: calc(100% - (var(--button-area-width) - 18px)); } `, gi = d` ha-card { aspect-ratio: 1 / 1; } .container { --button-area-width: clamp(46px, 23.5cqw, 210px); } `, _i = d` .curve-button { position: absolute; width: 22%; border: none; outline: none; padding: 0; margin: 0; background: transparent !important; box-shadow: none !important; display: flex; align-items: center; justify-content: center; pointer-events: auto; cursor: pointer; z-index: 5; transition: transform 0.2s ease; } .curve-button:hover { transform: scale(1.12); } .curve-button:active { transform: scale(0.92); } `, vi = d` .curve-buttons { position: absolute; inset: 0; pointer-events: none; z-index: 4; } `, yi = d` .curve-button ha-icon, .curve-button ha-state-icon { width: clamp(24px, 13cqw, 78px); height: clamp(24px, 13cqw, 78px); --mdc-icon-size: 100%; } .curve-image-icon { width: clamp(24px, 13cqw, 78px); height: clamp(24px, 13cqw, 78px); display: flex; align-items: center; justify-content: center; pointer-events: none; user-select: none; } .curve-image-icon svg { width: 100%; height: 100%; } .curve-button.action-button ha-icon, .curve-button.action-button ha-state-icon, .curve-button.action-button .curve-image-icon { width: clamp(30px, 16cqw, 96px); height: clamp(30px, 16cqw, 96px); } `, bi = d` .curve-button.pos-0 { top: 7%; left: 17%; } .curve-button.pos-1 { top: 2%; left: 37%; } .curve-button.pos-2 { top: 6%; right: 20%; } .curve-button.pos-3 { top: 22%; right: 4%; } .curve-button.pos-4 { bottom: 38%; right: 0%; } .curve-button.pos-5 { bottom: 16%; right: 7%; } .curve-button.action-button { top: -12%; right: 0%; width: 27%; } `, xi = d` .entity-button { width: min( clamp(44px, 26cqw, 250px), calc( (100cqh - (var(--button-count, 4) - 1) * clamp(10px, 2cqw, 22px)) / var(--button-count, 4) ) ); aspect-ratio: 1 / 1; border: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform 0.2s ease, background 0.2s ease; position: relative; overflow: visible; } .entity-button:hover { transform: scale(1.05); } .entity-button:active { transform: scale(0.95); } .entity-button ha-icon { --mdc-icon-size: 54%; } .entity-button ha-state-icon { width: 54%; height: 54%; --mdc-icon-size: 100%; } .button-image-icon { width: 54%; height: 54%; display: flex; align-items: center; justify-content: center; pointer-events: none; user-select: none; } .button-image-icon svg { width: 100%; height: 100%; } `, Si = d` .button-column { position: absolute; right: -2cqw; top: 0; bottom: -2cqw; display: flex; flex-direction: column; align-items: flex-end; width: var(--button-area-width); } .button-column[style*="--button-count:1"] { justify-content: center; } .button-column[style*="--button-count:2"] { justify-content: space-between; padding-top: 35%; } .button-column[style*="--button-count:3"], .button-column[style*="--button-count:4"] { justify-content: space-between; } `, Ci = [ pi, fi, mi, gi, hi, d` .circle { position: absolute; bottom: -12%; left: -12%; width: 75%; aspect-ratio: 1 / 1; border-radius: 50%; display: flex; align-items: center; justify-content: center; overflow: visible; z-index: 3; } `, xi, Si, _i, vi, yi, bi ]; //#endregion //#region src/common/editor/helpers/icon.js function H(e, t) { return Array.isArray(t) ? wi(e, t.map((t) => H(e, t))) : e._t ? e._t(t) : t; } function wi(e, t) { return (e?.hass?.locale?.language || e?.hass?.language || "en").toLowerCase().startsWith("en") ? t.map((e, t) => t === 0 ? e : Ti(e)).join(" ") : t.join(" "); } function Ti(e = "") { return e.replace(/^(\p{L})/u, (e) => e.toLocaleLowerCase()); } function Ei(e) { if (!e) return !1; let t = e.split("?")[0].toLowerCase(); return t.endsWith(".svg") || t.endsWith(".png") || t.endsWith(".gif") || t.endsWith(".webp"); } function Di(e) { return e ? e.startsWith("orbit:") ? e : e.startsWith("local:") ? `/local/icons/${e.slice(6)}` : e.startsWith("/") || e.startsWith("http") ? e : `/local/icons/${e}` : ""; } function Oi(e, t, n) { let r = this._config?.[t] || "", i = `${this._iconPickerPrefix || "icon"}-${t}`, a = r && this._isImageIcon(r) ? "files" : "ha", o = this._iconPickerKey === i && this._iconPickerTab || a; return o === "files" && !this._orbitIconFilesLoading && !this._localIconFilesLoading && !(this._orbitIconFiles || []).length && !(this._localIconFiles || []).length && queueMicrotask(() => this._loadLocalIconFiles?.(r)), E`
${e ? E`` : ""}
e.stopPropagation()} >
${o === "files" ? Ni.call(this, t, r) : Mi.call(this, t, r)}
`; } function ki({ label: e = "Icon", sourceKey: t = "main_entity_icon_source", entityKey: n = "main_entity", defaultSource: r = "entity", defaultSourceLabel: i = "Entity", areaKey: a = "area", allowArea: o = !1, allowNone: s = !1, customIconKeys: c = [], templateKey: l, legacySourceKey: u, legacyTemplateKeys: d = [], renderCustom: f } = {}) { let p = Ai(u && this._config?.[t] == null ? { ...this._config, [t]: this._config?.[u] } : this._config, { sourceKey: t, entityKey: n, defaultSource: r, areaKey: a, allowArea: o, allowNone: s, customIconKeys: c }), m = p === "custom", h = p === "template", g = c[0] || "icon", _ = l || `${g}_template`, v = P(this._config?.[g]) ? this._config[g] : "", ee = this._config?.[_] || d.map((e) => this._config?.[e]).find(Boolean) || v, te = [ s ? { label: H(this, "None"), value: "none" } : null, o ? { label: H(this, "Area"), value: "area" } : null, { label: H(this, i), value: r }, { label: H(this, "Custom"), value: "custom" }, { label: H(this, "Template"), value: "template" } ].filter(Boolean); return E`
{ let n = e.detail.value || (s ? "none" : "custom"); _ === g && p !== n && [p, n].includes("template") && this._handleConfigUpdate(g, ""), _ !== g && p === "template" && n !== "template" && v && (this._handleConfigUpdate(_, v), this._handleConfigUpdate(g, "")), this._handleConfigUpdate(t, n); }} >
${m && f ? f.call(this) : ""} ${h ? E`
{ v && this._handleConfigUpdate(g, ""), this._handleConfigUpdate(_, e.detail.value || ""); }} >
` : ""}
`; } function Ai(e = {}, { sourceKey: t = "main_entity_icon_source", entityKey: n = "main_entity", defaultSource: r = "entity", areaKey: i = "area", allowArea: a = !1, allowNone: o = !1, customIconKeys: s = [] } = {}) { let c = e[t], l = a && !!e[i], u = !!(e[n] || e.entity), d = r === "domain" ? !!e.domain : u, f = s.some((t) => !!e[t]); if (c === "custom") return "custom"; if (c === "template") return "template"; if (c === "none" && o) return "none"; if (c === "area" && l) return "area"; if (c === r && d) return r; if (a) { if (l) return "area"; if (u) return "entity"; } return f ? "custom" : o ? "none" : d ? r : a ? "area" : r; } async function ji(e = "") { let t = Qi(e); this._localIconFilesLoading = !0, this._orbitIconFilesLoading = !0, this.requestUpdate(); let [n, r] = await Promise.all([Gi(), Ki()]); this._orbitIconFiles = ea(n), this._localIconFiles = ea([t?.source === "local" || !t?.source ? t : null, ...r]), this._orbitIconFilesLoading = !1, this._localIconFilesLoading = !1, this.requestUpdate(); } function Mi(e, t) { return E` { this._handleConfigUpdate(e, t.detail.value || ""); }} > `; } function Ni(e, t) { let n = this._orbitIconFiles || [], r = this._localIconFiles || [], i = Pi([...n, ...r]); return this._orbitIconFilesLoading || this._localIconFilesLoading ? E`
${H(this, "Loading files...")}
` : !n.length && !r.length ? E`
${H(this, "No files found. Add a local icon manifest at /local/icons/manifest.json or type the filename manually.")}
` : E` Ii(i, e)} .rowRenderer=${(e) => Li.call(this, e)} .valueRenderer=${(e) => Ri.call(this, i.find((t) => t.id === e))} .notFoundLabel=${H(this, "No matching files")} .emptyLabel=${""} .noSort=${!0} @value-changed=${(t) => { t.stopPropagation(), this._handleConfigUpdate(e, t.detail.value || ""); }} > `; } function Pi(e) { return ea(e).map((e) => { let t = $i(e), n = Fi(e); return { id: t, primary: n, sorting_label: n, iconFile: e, search_labels: { label: n, file: e.file || "", name: e.name || "", value: t } }; }); } function Fi(e) { return `${e.source ? `${e.source}:` : ""}${(e.name || e.file || "").trim().replace(/\s+/g, "-")}`; } function Ii(e, t = "") { let n = t.trim().toLowerCase(); return n ? e.filter((e) => Object.values(e.search_labels || {}).some((e) => String(e).toLowerCase().includes(n))) : e; } function Li(e) { return E` ${zi.call(this, e)} ${e.primary} `; } function Ri(e) { return e ? E` ${zi.call(this, e)} ${e.primary} ` : ""; } function zi(e) { return e?.iconFile ? E` ${Bi.call(this, e.iconFile)} ` : ""; } function Bi(e) { let t = $i(e), n = this._resolveIconPath(t); if (!n) return E``; let r = this._getInlineSvg ? this._getInlineSvg(n) : "", i = this.hass?.themes?.darkMode ?? this.hass?.selectedTheme?.dark ?? !1, a = Vi(), o = Hi(i); return E` ${r ? E`${V(Ui(r))}` : E` `} `; } function Vi() { return [ "display:inline-flex", "flex:0 0 24px", "width:24px !important", "height:24px !important", "min-width:24px !important", "min-height:24px !important", "max-width:24px !important", "max-height:24px !important", "align-items:center", "justify-content:center", "overflow:hidden", "line-height:0", "box-sizing:border-box", "contain:layout paint", "color:var(--secondary-text-color)" ].join(";"); } function Hi(e) { return [ "display:block", "flex:none", "width:24px !important", "height:24px !important", "min-width:24px !important", "min-height:24px !important", "max-width:24px !important", "max-height:24px !important", "object-fit:contain", "box-sizing:border-box", "overflow:hidden", e ? "filter:brightness(0) invert(72%)" : "filter:brightness(0) opacity(72%)" ].join(";"); } function Ui(e) { if (!e) return ""; let t = Wi(e.replace(/<\?xml[^>]*>/gi, "").trim()), n = t.match(/]*>/i)?.[0]; if (!n) return t; let r = [ "display:block", "flex:none", "width:24px !important", "height:24px !important", "min-width:24px !important", "min-height:24px !important", "max-width:24px !important", "max-height:24px !important", "overflow:hidden", "box-sizing:border-box", "color:var(--secondary-text-color)", "vertical-align:middle", "pointer-events:none" ].join(";"), i = n.replace(/\swidth=(["'])[^"']*\1/gi, "").replace(/\sheight=(["'])[^"']*\1/gi, "").replace(/\sstyle=(["'])[^"']*\1/gi, "").replace(/\spreserveAspectRatio=(["'])[^"']*\1/gi, ""); return i = i.replace(/^