diff --git a/custom_components/nestquest/www/nestquest-cards.js b/custom_components/nestquest/www/nestquest-cards.js index 6b9d8d9..e60d13e 100644 --- a/custom_components/nestquest/www/nestquest-cards.js +++ b/custom_components/nestquest/www/nestquest-cards.js @@ -1,200 +1,200 @@ -const L = globalThis, te = L.ShadowRoot && (L.ShadyCSS === void 0 || L.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ne = /* @__PURE__ */ Symbol(), ae = /* @__PURE__ */ new WeakMap(); -let ze = class { - constructor(e, t, n) { - if (this._$cssResult$ = !0, n !== ne) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); - this.cssText = e, this.t = t; +const L = globalThis, et = L.ShadowRoot && (L.ShadyCSS === void 0 || L.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, nt = /* @__PURE__ */ Symbol(), at = /* @__PURE__ */ new WeakMap(); +let zt = class { + constructor(t, e, n) { + if (this._$cssResult$ = !0, n !== nt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); + this.cssText = t, this.t = e; } get styleSheet() { - let e = this.o; - const t = this.t; - if (te && e === void 0) { - const n = t !== void 0 && t.length === 1; - n && (e = ae.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), n && ae.set(t, e)); + let t = this.o; + const e = this.t; + if (et && t === void 0) { + const n = e !== void 0 && e.length === 1; + n && (t = at.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), n && at.set(e, t)); } - return e; + return t; } toString() { return this.cssText; } }; -const v = (s) => new ze(typeof s == "string" ? s : s + "", void 0, ne), Pe = (s, ...e) => { - const t = s.length === 1 ? s[0] : e.reduce((n, i, r) => n + ((o) => { +const v = (s) => new zt(typeof s == "string" ? s : s + "", void 0, nt), Pt = (s, ...t) => { + const e = s.length === 1 ? s[0] : t.reduce((n, i, r) => n + ((o) => { if (o._$cssResult$ === !0) return o.cssText; if (typeof o == "number") return o; throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); })(i) + s[r + 1], s[0]); - return new ze(t, s, ne); -}, Be = (s, e) => { - if (te) s.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet); - else for (const t of e) { + return new zt(e, s, nt); +}, Bt = (s, t) => { + if (et) s.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet); + else for (const e of t) { const n = document.createElement("style"), i = L.litNonce; - i !== void 0 && n.setAttribute("nonce", i), n.textContent = t.cssText, s.appendChild(n); + i !== void 0 && n.setAttribute("nonce", i), n.textContent = e.cssText, s.appendChild(n); } -}, le = te ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((e) => { - let t = ""; - for (const n of e.cssRules) t += n.cssText; - return v(t); +}, lt = et ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => { + let e = ""; + for (const n of t.cssRules) e += n.cssText; + return v(e); })(s) : s; -const { is: Fe, defineProperty: Qe, getOwnPropertyDescriptor: We, getOwnPropertyNames: Ze, getOwnPropertySymbols: Ve, getPrototypeOf: Ge } = Object, Q = globalThis, de = Q.trustedTypes, Ke = de ? de.emptyScript : "", Je = Q.reactiveElementPolyfillSupport, P = (s, e) => s, ee = { toAttribute(s, e) { - switch (e) { +const { is: Ft, defineProperty: Qt, getOwnPropertyDescriptor: Wt, getOwnPropertyNames: Zt, getOwnPropertySymbols: Vt, getPrototypeOf: Gt } = Object, Q = globalThis, dt = Q.trustedTypes, Kt = dt ? dt.emptyScript : "", Jt = Q.reactiveElementPolyfillSupport, P = (s, t) => s, tt = { toAttribute(s, t) { + switch (t) { case Boolean: - s = s ? Ke : null; + s = s ? Kt : null; break; case Object: case Array: s = s == null ? s : JSON.stringify(s); } return s; -}, fromAttribute(s, e) { - let t = s; - switch (e) { +}, fromAttribute(s, t) { + let e = s; + switch (t) { case Boolean: - t = s !== null; + e = s !== null; break; case Number: - t = s === null ? null : Number(s); + e = s === null ? null : Number(s); break; case Object: case Array: try { - t = JSON.parse(s); + e = JSON.parse(s); } catch { - t = null; + e = null; } } - return t; -} }, Ie = (s, e) => !Fe(s, e), ce = { attribute: !0, type: String, converter: ee, reflect: !1, useDefault: !1, hasChanged: Ie }; + return e; +} }, It = (s, t) => !Ft(s, t), ct = { attribute: !0, type: String, converter: tt, reflect: !1, useDefault: !1, hasChanged: It }; Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), Q.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap(); let N = class extends HTMLElement { - static addInitializer(e) { - this._$Ei(), (this.l ??= []).push(e); + static addInitializer(t) { + this._$Ei(), (this.l ??= []).push(t); } static get observedAttributes() { return this.finalize(), this._$Eh && [...this._$Eh.keys()]; } - static createProperty(e, t = ce) { - 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) { - const n = /* @__PURE__ */ Symbol(), i = this.getPropertyDescriptor(e, n, t); - i !== void 0 && Qe(this.prototype, e, i); + static createProperty(t, e = ct) { + if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) { + const n = /* @__PURE__ */ Symbol(), i = this.getPropertyDescriptor(t, n, e); + i !== void 0 && Qt(this.prototype, t, i); } } - static getPropertyDescriptor(e, t, n) { - const { get: i, set: r } = We(this.prototype, e) ?? { get() { - return this[t]; + static getPropertyDescriptor(t, e, n) { + const { get: i, set: r } = Wt(this.prototype, t) ?? { get() { + return this[e]; }, set(o) { - this[t] = o; + this[e] = o; } }; return { get: i, set(o) { const l = i?.call(this); - r?.call(this, o), this.requestUpdate(e, l, n); + r?.call(this, o), this.requestUpdate(t, l, n); }, configurable: !0, enumerable: !0 }; } - static getPropertyOptions(e) { - return this.elementProperties.get(e) ?? ce; + static getPropertyOptions(t) { + return this.elementProperties.get(t) ?? ct; } static _$Ei() { if (this.hasOwnProperty(P("elementProperties"))) return; - const e = Ge(this); - e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties); + const t = Gt(this); + t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties); } static finalize() { if (this.hasOwnProperty(P("finalized"))) return; if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(P("properties"))) { - const t = this.properties, n = [...Ze(t), ...Ve(t)]; - for (const i of n) this.createProperty(i, t[i]); + const e = this.properties, n = [...Zt(e), ...Vt(e)]; + for (const i of n) this.createProperty(i, e[i]); } - const e = this[Symbol.metadata]; - if (e !== null) { - const t = litPropertyMetadata.get(e); - if (t !== void 0) for (const [n, i] of t) this.elementProperties.set(n, i); + const t = this[Symbol.metadata]; + if (t !== null) { + const e = litPropertyMetadata.get(t); + if (e !== void 0) for (const [n, i] of e) this.elementProperties.set(n, i); } this._$Eh = /* @__PURE__ */ new Map(); - for (const [t, n] of this.elementProperties) { - const i = this._$Eu(t, n); - i !== void 0 && this._$Eh.set(i, t); + for (const [e, n] of this.elementProperties) { + const i = this._$Eu(e, n); + i !== void 0 && this._$Eh.set(i, e); } this.elementStyles = this.finalizeStyles(this.styles); } - static finalizeStyles(e) { - const t = []; - if (Array.isArray(e)) { - const n = new Set(e.flat(1 / 0).reverse()); - for (const i of n) t.unshift(le(i)); - } else e !== void 0 && t.push(le(e)); - return t; + static finalizeStyles(t) { + const e = []; + if (Array.isArray(t)) { + const n = new Set(t.flat(1 / 0).reverse()); + for (const i of n) e.unshift(lt(i)); + } else t !== void 0 && e.push(lt(t)); + return e; } - static _$Eu(e, t) { - const n = t.attribute; - return n === !1 ? void 0 : typeof n == "string" ? n : typeof e == "string" ? e.toLowerCase() : void 0; + static _$Eu(t, e) { + const n = e.attribute; + return n === !1 ? void 0 : typeof n == "string" ? n : typeof t == "string" ? t.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)); + this._$ES = new Promise((t) => this.enableUpdating = t), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t) => t(this)); } - addController(e) { - (this._$EO ??= /* @__PURE__ */ new Set()).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.(); + addController(t) { + (this._$EO ??= /* @__PURE__ */ new Set()).add(t), this.renderRoot !== void 0 && this.isConnected && t.hostConnected?.(); } - removeController(e) { - this._$EO?.delete(e); + removeController(t) { + this._$EO?.delete(t); } _$E_() { - const e = /* @__PURE__ */ new Map(), t = this.constructor.elementProperties; - for (const n of t.keys()) this.hasOwnProperty(n) && (e.set(n, this[n]), delete this[n]); - e.size > 0 && (this._$Ep = e); + const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties; + for (const n of e.keys()) this.hasOwnProperty(n) && (t.set(n, this[n]), delete this[n]); + t.size > 0 && (this._$Ep = t); } createRenderRoot() { - const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); - return Be(e, this.constructor.elementStyles), e; + const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); + return Bt(t, this.constructor.elementStyles), t; } connectedCallback() { - this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((e) => e.hostConnected?.()); + this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((t) => t.hostConnected?.()); } - enableUpdating(e) { + enableUpdating(t) { } disconnectedCallback() { - this._$EO?.forEach((e) => e.hostDisconnected?.()); + this._$EO?.forEach((t) => t.hostDisconnected?.()); } - attributeChangedCallback(e, t, n) { - this._$AK(e, n); + attributeChangedCallback(t, e, n) { + this._$AK(t, n); } - _$ET(e, t) { - const n = this.constructor.elementProperties.get(e), i = this.constructor._$Eu(e, n); + _$ET(t, e) { + const n = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, n); if (i !== void 0 && n.reflect === !0) { - const r = (n.converter?.toAttribute !== void 0 ? n.converter : ee).toAttribute(t, n.type); - this._$Em = e, r == null ? this.removeAttribute(i) : this.setAttribute(i, r), this._$Em = null; + const r = (n.converter?.toAttribute !== void 0 ? n.converter : tt).toAttribute(e, n.type); + this._$Em = t, r == null ? this.removeAttribute(i) : this.setAttribute(i, r), this._$Em = null; } } - _$AK(e, t) { - const n = this.constructor, i = n._$Eh.get(e); + _$AK(t, e) { + const n = this.constructor, i = n._$Eh.get(t); if (i !== void 0 && this._$Em !== i) { - const r = n.getPropertyOptions(i), o = typeof r.converter == "function" ? { fromAttribute: r.converter } : r.converter?.fromAttribute !== void 0 ? r.converter : ee; + const r = n.getPropertyOptions(i), o = typeof r.converter == "function" ? { fromAttribute: r.converter } : r.converter?.fromAttribute !== void 0 ? r.converter : tt; this._$Em = i; - const l = o.fromAttribute(t, r.type); + const l = o.fromAttribute(e, r.type); this[i] = l ?? this._$Ej?.get(i) ?? l, this._$Em = null; } } - requestUpdate(e, t, n, i = !1, r) { - if (e !== void 0) { + requestUpdate(t, e, n, i = !1, r) { + if (t !== void 0) { const o = this.constructor; - if (i === !1 && (r = this[e]), n ??= o.getPropertyOptions(e), !((n.hasChanged ?? Ie)(r, t) || n.useDefault && n.reflect && r === this._$Ej?.get(e) && !this.hasAttribute(o._$Eu(e, n)))) return; - this.C(e, t, n); + if (i === !1 && (r = this[t]), n ??= o.getPropertyOptions(t), !((n.hasChanged ?? It)(r, e) || n.useDefault && n.reflect && r === this._$Ej?.get(t) && !this.hasAttribute(o._$Eu(t, n)))) return; + this.C(t, e, n); } this.isUpdatePending === !1 && (this._$ES = this._$EP()); } - C(e, t, { useDefault: n, reflect: i, wrapped: r }, o) { - n && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, o ?? t ?? this[e]), r !== !0 || o !== void 0) || (this._$AL.has(e) || (this.hasUpdated || n || (t = void 0), this._$AL.set(e, t)), i === !0 && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e)); + C(t, e, { useDefault: n, reflect: i, wrapped: r }, o) { + n && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, o ?? e ?? this[t]), r !== !0 || o !== void 0) || (this._$AL.has(t) || (this.hasUpdated || n || (e = void 0), this._$AL.set(t, e)), i === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t)); } async _$EP() { this.isUpdatePending = !0; try { await this._$ES; - } catch (t) { - Promise.reject(t); + } catch (e) { + Promise.reject(e); } - const e = this.scheduleUpdate(); - return e != null && await e, !this.isUpdatePending; + const t = this.scheduleUpdate(); + return t != null && await t, !this.isUpdatePending; } scheduleUpdate() { return this.performUpdate(); @@ -212,19 +212,19 @@ let N = class extends HTMLElement { o !== !0 || this._$AL.has(i) || l === void 0 || this.C(i, void 0, r, l); } } - let e = !1; - const t = this._$AL; + let t = !1; + const e = this._$AL; try { - e = this.shouldUpdate(t), e ? (this.willUpdate(t), this._$EO?.forEach((n) => n.hostUpdate?.()), this.update(t)) : this._$EM(); + t = this.shouldUpdate(e), t ? (this.willUpdate(e), this._$EO?.forEach((n) => n.hostUpdate?.()), this.update(e)) : this._$EM(); } catch (n) { - throw e = !1, this._$EM(), n; + throw t = !1, this._$EM(), n; } - e && this._$AE(t); + t && this._$AE(e); } - willUpdate(e) { + willUpdate(t) { } - _$AE(e) { - this._$EO?.forEach((t) => t.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e); + _$AE(t) { + this._$EO?.forEach((e) => e.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t); } _$EM() { this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1; @@ -235,83 +235,83 @@ let N = class extends HTMLElement { getUpdateComplete() { return this._$ES; } - shouldUpdate(e) { + shouldUpdate(t) { return !0; } - update(e) { - this._$Eq &&= this._$Eq.forEach((t) => this._$ET(t, this[t])), this._$EM(); + update(t) { + this._$Eq &&= this._$Eq.forEach((e) => this._$ET(e, this[e])), this._$EM(); } - updated(e) { + updated(t) { } - firstUpdated(e) { + firstUpdated(t) { } }; -N.elementStyles = [], N.shadowRootOptions = { mode: "open" }, N[P("elementProperties")] = /* @__PURE__ */ new Map(), N[P("finalized")] = /* @__PURE__ */ new Map(), Je?.({ ReactiveElement: N }), (Q.reactiveElementVersions ??= []).push("2.1.2"); -const se = globalThis, pe = (s) => s, B = se.trustedTypes, he = B ? B.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, Ue = "$lit$", x = `lit$${Math.random().toFixed(9).slice(2)}$`, De = "?" + x, Xe = `<${De}>`, S = document, I = () => S.createComment(""), U = (s) => s === null || typeof s != "object" && typeof s != "function", ie = Array.isArray, Ye = (s) => ie(s) || typeof s?.[Symbol.iterator] == "function", V = `[ -\f\r]`, O = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ue = /-->/g, fe = />/g, q = RegExp(`>|${V}(?:([^\\s"'>=/]+)(${V}*=${V}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`, "g"), me = /'/g, ge = /"/g, He = /^(?:script|style|textarea|title)$/i, et = (s) => (e, ...t) => ({ _$litType$: s, strings: e, values: t }), p = et(1), E = /* @__PURE__ */ Symbol.for("lit-noChange"), g = /* @__PURE__ */ Symbol.for("lit-nothing"), ye = /* @__PURE__ */ new WeakMap(), A = S.createTreeWalker(S, 129); -function je(s, e) { - if (!ie(s) || !s.hasOwnProperty("raw")) throw Error("invalid template strings array"); - return he !== void 0 ? he.createHTML(e) : e; +N.elementStyles = [], N.shadowRootOptions = { mode: "open" }, N[P("elementProperties")] = /* @__PURE__ */ new Map(), N[P("finalized")] = /* @__PURE__ */ new Map(), Jt?.({ ReactiveElement: N }), (Q.reactiveElementVersions ??= []).push("2.1.2"); +const st = globalThis, pt = (s) => s, B = st.trustedTypes, ht = B ? B.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, Ut = "$lit$", $ = `lit$${Math.random().toFixed(9).slice(2)}$`, Dt = "?" + $, Xt = `<${Dt}>`, S = document, I = () => S.createComment(""), U = (s) => s === null || typeof s != "object" && typeof s != "function", it = Array.isArray, Yt = (s) => it(s) || typeof s?.[Symbol.iterator] == "function", V = `[ +\f\r]`, O = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ut = /-->/g, ft = />/g, w = RegExp(`>|${V}(?:([^\\s"'>=/]+)(${V}*=${V}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`, "g"), mt = /'/g, gt = /"/g, Ht = /^(?:script|style|textarea|title)$/i, te = (s) => (t, ...e) => ({ _$litType$: s, strings: t, values: e }), c = te(1), E = /* @__PURE__ */ Symbol.for("lit-noChange"), g = /* @__PURE__ */ Symbol.for("lit-nothing"), _t = /* @__PURE__ */ new WeakMap(), A = S.createTreeWalker(S, 129); +function jt(s, t) { + if (!it(s) || !s.hasOwnProperty("raw")) throw Error("invalid template strings array"); + return ht !== void 0 ? ht.createHTML(t) : t; } -const tt = (s, e) => { - const t = s.length - 1, n = []; - let i, r = e === 2 ? "" : e === 3 ? "" : "", o = O; - for (let l = 0; l < t; l++) { +const ee = (s, t) => { + const e = s.length - 1, n = []; + let i, r = t === 2 ? "" : t === 3 ? "" : "", o = O; + for (let l = 0; l < e; l++) { const a = s[l]; - let c, u, d = -1, f = 0; - for (; f < a.length && (o.lastIndex = f, u = o.exec(a), u !== null); ) f = o.lastIndex, o === O ? u[1] === "!--" ? o = ue : u[1] !== void 0 ? o = fe : u[2] !== void 0 ? (He.test(u[2]) && (i = RegExp("" ? (o = i ?? O, d = -1) : u[1] === void 0 ? d = -2 : (d = o.lastIndex - u[2].length, c = u[1], o = u[3] === void 0 ? q : u[3] === '"' ? ge : me) : o === ge || o === me ? o = q : o === ue || o === fe ? o = O : (o = q, i = void 0); - const h = o === q && s[l + 1].startsWith("/>") ? " " : ""; - r += o === O ? a + Xe : d >= 0 ? (n.push(c), a.slice(0, d) + Ue + a.slice(d) + x + h) : a + x + (d === -2 ? l : h); + let p, u, d = -1, f = 0; + for (; f < a.length && (o.lastIndex = f, u = o.exec(a), u !== null); ) f = o.lastIndex, o === O ? u[1] === "!--" ? o = ut : u[1] !== void 0 ? o = ft : u[2] !== void 0 ? (Ht.test(u[2]) && (i = RegExp("" ? (o = i ?? O, d = -1) : u[1] === void 0 ? d = -2 : (d = o.lastIndex - u[2].length, p = u[1], o = u[3] === void 0 ? w : u[3] === '"' ? gt : mt) : o === gt || o === mt ? o = w : o === ut || o === ft ? o = O : (o = w, i = void 0); + const h = o === w && s[l + 1].startsWith("/>") ? " " : ""; + r += o === O ? a + Xt : d >= 0 ? (n.push(p), a.slice(0, d) + Ut + a.slice(d) + $ + h) : a + $ + (d === -2 ? l : h); } - return [je(s, r + (s[t] || "") + (e === 2 ? "" : e === 3 ? "" : "")), n]; + return [jt(s, r + (s[e] || "") + (t === 2 ? "" : t === 3 ? "" : "")), n]; }; class D { - constructor({ strings: e, _$litType$: t }, n) { + constructor({ strings: t, _$litType$: e }, n) { let i; this.parts = []; let r = 0, o = 0; - const l = e.length - 1, a = this.parts, [c, u] = tt(e, t); - if (this.el = D.createElement(c, n), A.currentNode = this.el.content, t === 2 || t === 3) { + const l = t.length - 1, a = this.parts, [p, u] = ee(t, e); + if (this.el = D.createElement(p, n), A.currentNode = this.el.content, e === 2 || e === 3) { const d = this.el.content.firstChild; d.replaceWith(...d.childNodes); } for (; (i = A.nextNode()) !== null && a.length < l; ) { if (i.nodeType === 1) { - if (i.hasAttributes()) for (const d of i.getAttributeNames()) if (d.endsWith(Ue)) { - const f = u[o++], h = i.getAttribute(d).split(x), m = /([.?@])?(.*)/.exec(f); - a.push({ type: 1, index: r, name: m[2], strings: h, ctor: m[1] === "." ? st : m[1] === "?" ? it : m[1] === "@" ? rt : W }), i.removeAttribute(d); - } else d.startsWith(x) && (a.push({ type: 6, index: r }), i.removeAttribute(d)); - if (He.test(i.tagName)) { - const d = i.textContent.split(x), f = d.length - 1; + if (i.hasAttributes()) for (const d of i.getAttributeNames()) if (d.endsWith(Ut)) { + const f = u[o++], h = i.getAttribute(d).split($), m = /([.?@])?(.*)/.exec(f); + a.push({ type: 1, index: r, name: m[2], strings: h, ctor: m[1] === "." ? se : m[1] === "?" ? ie : m[1] === "@" ? re : W }), i.removeAttribute(d); + } else d.startsWith($) && (a.push({ type: 6, index: r }), i.removeAttribute(d)); + if (Ht.test(i.tagName)) { + const d = i.textContent.split($), f = d.length - 1; if (f > 0) { i.textContent = B ? B.emptyScript : ""; for (let h = 0; h < f; h++) i.append(d[h], I()), A.nextNode(), a.push({ type: 2, index: ++r }); i.append(d[f], I()); } } - } else if (i.nodeType === 8) if (i.data === De) a.push({ type: 2, index: r }); + } else if (i.nodeType === 8) if (i.data === Dt) a.push({ type: 2, index: r }); else { let d = -1; - for (; (d = i.data.indexOf(x, d + 1)) !== -1; ) a.push({ type: 7, index: r }), d += x.length - 1; + for (; (d = i.data.indexOf($, d + 1)) !== -1; ) a.push({ type: 7, index: r }), d += $.length - 1; } r++; } } - static createElement(e, t) { + static createElement(t, e) { const n = S.createElement("template"); - return n.innerHTML = e, n; + return n.innerHTML = t, n; } } -function T(s, e, t = s, n) { - if (e === E) return e; - let i = n !== void 0 ? t._$Co?.[n] : t._$Cl; - const r = U(e) ? void 0 : e._$litDirective$; - return i?.constructor !== r && (i?._$AO?.(!1), r === void 0 ? i = void 0 : (i = new r(s), i._$AT(s, t, n)), n !== void 0 ? (t._$Co ??= [])[n] = i : t._$Cl = i), i !== void 0 && (e = T(s, i._$AS(s, e.values), i, n)), e; +function T(s, t, e = s, n) { + if (t === E) return t; + let i = n !== void 0 ? e._$Co?.[n] : e._$Cl; + const r = U(t) ? void 0 : t._$litDirective$; + return i?.constructor !== r && (i?._$AO?.(!1), r === void 0 ? i = void 0 : (i = new r(s), i._$AT(s, e, n)), n !== void 0 ? (e._$Co ??= [])[n] = i : e._$Cl = i), i !== void 0 && (t = T(s, i._$AS(s, t.values), i, n)), t; } -class nt { - constructor(e, t) { - this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t; +class ne { + constructor(t, e) { + this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e; } get parentNode() { return this._$AM.parentNode; @@ -319,35 +319,35 @@ class nt { get _$AU() { return this._$AM._$AU; } - u(e) { - const { el: { content: t }, parts: n } = this._$AD, i = (e?.creationScope ?? S).importNode(t, !0); + u(t) { + const { el: { content: e }, parts: n } = this._$AD, i = (t?.creationScope ?? S).importNode(e, !0); A.currentNode = i; let r = A.nextNode(), o = 0, l = 0, a = n[0]; for (; a !== void 0; ) { if (o === a.index) { - let c; - a.type === 2 ? c = new M(r, r.nextSibling, this, e) : a.type === 1 ? c = new a.ctor(r, a.name, a.strings, this, e) : a.type === 6 && (c = new ot(r, this, e)), this._$AV.push(c), a = n[++l]; + let p; + a.type === 2 ? p = new M(r, r.nextSibling, this, t) : a.type === 1 ? p = new a.ctor(r, a.name, a.strings, this, t) : a.type === 6 && (p = new oe(r, this, t)), this._$AV.push(p), a = n[++l]; } o !== a?.index && (r = A.nextNode(), o++); } return A.currentNode = S, i; } - p(e) { - let t = 0; - for (const n of this._$AV) n !== void 0 && (n.strings !== void 0 ? (n._$AI(e, n, t), t += n.strings.length - 2) : n._$AI(e[t])), t++; + p(t) { + let e = 0; + for (const n of this._$AV) n !== void 0 && (n.strings !== void 0 ? (n._$AI(t, n, e), e += n.strings.length - 2) : n._$AI(t[e])), e++; } } class M { get _$AU() { return this._$AM?._$AU ?? this._$Cv; } - constructor(e, t, n, i) { - this.type = 2, this._$AH = g, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = n, this.options = i, this._$Cv = i?.isConnected ?? !0; + constructor(t, e, n, i) { + this.type = 2, this._$AH = g, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = n, this.options = i, this._$Cv = i?.isConnected ?? !0; } get parentNode() { - let e = this._$AA.parentNode; - const t = this._$AM; - return t !== void 0 && e?.nodeType === 11 && (e = t.parentNode), e; + let t = this._$AA.parentNode; + const e = this._$AM; + return e !== void 0 && t?.nodeType === 11 && (t = e.parentNode), t; } get startNode() { return this._$AA; @@ -355,45 +355,45 @@ class M { get endNode() { return this._$AB; } - _$AI(e, t = this) { - e = T(this, e, t), U(e) ? e === g || e == null || e === "" ? (this._$AH !== g && this._$AR(), this._$AH = g) : e !== this._$AH && e !== E && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Ye(e) ? this.k(e) : this._(e); + _$AI(t, e = this) { + t = T(this, t, e), U(t) ? t === g || t == null || t === "" ? (this._$AH !== g && this._$AR(), this._$AH = g) : t !== this._$AH && t !== E && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Yt(t) ? this.k(t) : this._(t); } - O(e) { - return this._$AA.parentNode.insertBefore(e, this._$AB); + O(t) { + return this._$AA.parentNode.insertBefore(t, this._$AB); } - T(e) { - this._$AH !== e && (this._$AR(), this._$AH = this.O(e)); + T(t) { + this._$AH !== t && (this._$AR(), this._$AH = this.O(t)); } - _(e) { - this._$AH !== g && U(this._$AH) ? this._$AA.nextSibling.data = e : this.T(S.createTextNode(e)), this._$AH = e; + _(t) { + this._$AH !== g && U(this._$AH) ? this._$AA.nextSibling.data = t : this.T(S.createTextNode(t)), this._$AH = t; } - $(e) { - const { values: t, _$litType$: n } = e, i = typeof n == "number" ? this._$AC(e) : (n.el === void 0 && (n.el = D.createElement(je(n.h, n.h[0]), this.options)), n); - if (this._$AH?._$AD === i) this._$AH.p(t); + $(t) { + const { values: e, _$litType$: n } = t, i = typeof n == "number" ? this._$AC(t) : (n.el === void 0 && (n.el = D.createElement(jt(n.h, n.h[0]), this.options)), n); + if (this._$AH?._$AD === i) this._$AH.p(e); else { - const r = new nt(i, this), o = r.u(this.options); - r.p(t), this.T(o), this._$AH = r; + const r = new ne(i, this), o = r.u(this.options); + r.p(e), this.T(o), this._$AH = r; } } - _$AC(e) { - let t = ye.get(e.strings); - return t === void 0 && ye.set(e.strings, t = new D(e)), t; + _$AC(t) { + let e = _t.get(t.strings); + return e === void 0 && _t.set(t.strings, e = new D(t)), e; } - k(e) { - ie(this._$AH) || (this._$AH = [], this._$AR()); - const t = this._$AH; + k(t) { + it(this._$AH) || (this._$AH = [], this._$AR()); + const e = this._$AH; let n, i = 0; - for (const r of e) i === t.length ? t.push(n = new M(this.O(I()), this.O(I()), this, this.options)) : n = t[i], n._$AI(r), i++; - i < t.length && (this._$AR(n && n._$AB.nextSibling, i), t.length = i); + for (const r of t) i === e.length ? e.push(n = new M(this.O(I()), this.O(I()), this, this.options)) : n = e[i], n._$AI(r), i++; + i < e.length && (this._$AR(n && n._$AB.nextSibling, i), e.length = i); } - _$AR(e = this._$AA.nextSibling, t) { - for (this._$AP?.(!1, !0, t); e !== this._$AB; ) { - const n = pe(e).nextSibling; - pe(e).remove(), e = n; + _$AR(t = this._$AA.nextSibling, e) { + for (this._$AP?.(!1, !0, e); t !== this._$AB; ) { + const n = pt(t).nextSibling; + pt(t).remove(), t = n; } } - setConnected(e) { - this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e)); + setConnected(t) { + this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t)); } } class W { @@ -403,87 +403,87 @@ class W { get _$AU() { return this._$AM._$AU; } - constructor(e, t, n, i, r) { - this.type = 1, this._$AH = g, this._$AN = void 0, this.element = e, this.name = t, this._$AM = i, this.options = r, n.length > 2 || n[0] !== "" || n[1] !== "" ? (this._$AH = Array(n.length - 1).fill(new String()), this.strings = n) : this._$AH = g; + constructor(t, e, n, i, r) { + this.type = 1, this._$AH = g, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = r, n.length > 2 || n[0] !== "" || n[1] !== "" ? (this._$AH = Array(n.length - 1).fill(new String()), this.strings = n) : this._$AH = g; } - _$AI(e, t = this, n, i) { + _$AI(t, e = this, n, i) { const r = this.strings; let o = !1; - if (r === void 0) e = T(this, e, t, 0), o = !U(e) || e !== this._$AH && e !== E, o && (this._$AH = e); + if (r === void 0) t = T(this, t, e, 0), o = !U(t) || t !== this._$AH && t !== E, o && (this._$AH = t); else { - const l = e; - let a, c; - for (e = r[0], a = 0; a < r.length - 1; a++) c = T(this, l[n + a], t, a), c === E && (c = this._$AH[a]), o ||= !U(c) || c !== this._$AH[a], c === g ? e = g : e !== g && (e += (c ?? "") + r[a + 1]), this._$AH[a] = c; + const l = t; + let a, p; + for (t = r[0], a = 0; a < r.length - 1; a++) p = T(this, l[n + a], e, a), p === E && (p = this._$AH[a]), o ||= !U(p) || p !== this._$AH[a], p === g ? t = g : t !== g && (t += (p ?? "") + r[a + 1]), this._$AH[a] = p; } - o && !i && this.j(e); + o && !i && this.j(t); } - j(e) { - e === g ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? ""); + j(t) { + t === g ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? ""); } } -class st extends W { +class se extends W { constructor() { super(...arguments), this.type = 3; } - j(e) { - this.element[this.name] = e === g ? void 0 : e; + j(t) { + this.element[this.name] = t === g ? void 0 : t; } } -class it extends W { +class ie extends W { constructor() { super(...arguments), this.type = 4; } - j(e) { - this.element.toggleAttribute(this.name, !!e && e !== g); + j(t) { + this.element.toggleAttribute(this.name, !!t && t !== g); } } -class rt extends W { - constructor(e, t, n, i, r) { - super(e, t, n, i, r), this.type = 5; +class re extends W { + constructor(t, e, n, i, r) { + super(t, e, n, i, r), this.type = 5; } - _$AI(e, t = this) { - if ((e = T(this, e, t, 0) ?? g) === E) return; - const n = this._$AH, i = e === g && n !== g || e.capture !== n.capture || e.once !== n.once || e.passive !== n.passive, r = e !== g && (n === g || i); - i && this.element.removeEventListener(this.name, this, n), r && this.element.addEventListener(this.name, this, e), this._$AH = e; + _$AI(t, e = this) { + if ((t = T(this, t, e, 0) ?? g) === E) return; + const n = this._$AH, i = t === g && n !== g || t.capture !== n.capture || t.once !== n.once || t.passive !== n.passive, r = t !== g && (n === g || i); + i && this.element.removeEventListener(this.name, this, n), r && this.element.addEventListener(this.name, this, t), this._$AH = t; } - handleEvent(e) { - typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e); + handleEvent(t) { + typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t); } } -class ot { - constructor(e, t, n) { - this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = n; +class oe { + constructor(t, e, n) { + this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = n; } get _$AU() { return this._$AM._$AU; } - _$AI(e) { - T(this, e); + _$AI(t) { + T(this, t); } } -const at = { I: M }, lt = se.litHtmlPolyfillSupport; -lt?.(D, M), (se.litHtmlVersions ??= []).push("3.3.3"); -const dt = (s, e, t) => { - const n = t?.renderBefore ?? e; +const ae = { I: M }, le = st.litHtmlPolyfillSupport; +le?.(D, M), (st.litHtmlVersions ??= []).push("3.3.3"); +const de = (s, t, e) => { + const n = e?.renderBefore ?? t; let i = n._$litPart$; if (i === void 0) { - const r = t?.renderBefore ?? null; - n._$litPart$ = i = new M(e.insertBefore(I(), r), r, void 0, t ?? {}); + const r = e?.renderBefore ?? null; + n._$litPart$ = i = new M(t.insertBefore(I(), r), r, void 0, e ?? {}); } return i._$AI(s), i; }; -const re = globalThis; +const rt = globalThis; let C = class extends N { constructor() { super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0; } createRenderRoot() { - const e = super.createRenderRoot(); - return this.renderOptions.renderBefore ??= e.firstChild, e; + const t = super.createRenderRoot(); + return this.renderOptions.renderBefore ??= t.firstChild, t; } - update(e) { - const t = this.render(); - this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = dt(t, this.renderRoot, this.renderOptions); + update(t) { + const e = this.render(); + this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = de(e, this.renderRoot, this.renderOptions); } connectedCallback() { super.connectedCallback(), this._$Do?.setConnected(!0); @@ -495,48 +495,48 @@ let C = class extends N { return E; } }; -C._$litElement$ = !0, C.finalized = !0, re.litElementHydrateSupport?.({ LitElement: C }); -const ct = re.litElementPolyfillSupport; -ct?.({ LitElement: C }); -(re.litElementVersions ??= []).push("4.2.2"); -const Re = ':host{--nq-p-parchment-top: #f0e4c7;--nq-p-parchment-bottom: #ddcca3;--nq-p-parchment: radial-gradient(ellipse at 25% 10%, rgba(255,255,255,.5), transparent 55%), radial-gradient(ellipse at 85% 90%, rgba(120,86,44,.28), transparent 60%), repeating-linear-gradient(93deg, rgba(150,115,70,.05) 0 2px, transparent 2px 6px), repeating-linear-gradient(2deg, rgba(150,115,70,.04) 0 3px, transparent 3px 7px), linear-gradient(var(--nq-p-parchment-top), var(--nq-p-parchment-bottom));--nq-p-vignette: inset 0 0 200px rgba(80,52,20,.35);--nq-p-card-open: linear-gradient(#fdf7e6, #f2e7c9);--nq-p-card-done: linear-gradient(#f0e8d3, #e6dcc2);--nq-p-card-panel: linear-gradient(#fcf6e6, #f1e6ca);--nq-p-card-border: rgba(120,88,48,.38);--nq-p-panel-border: rgba(92,62,26,.4);--nq-p-card-shadow: 0 3px 0 rgba(120,88,48,.2), inset 0 1px 0 rgba(255,255,255,.7);--nq-p-panel-shadow: 0 6px 0 rgba(92,62,26,.18), inset 0 2px 0 rgba(255,255,255,.7);--nq-p-frame-outer: 2px solid rgba(92,62,26,.45);--nq-p-frame-inner: 1px solid rgba(92,62,26,.28);--nq-p-rule: 2px solid rgba(92,62,26,.35);--nq-p-ink: #2b1f14;--nq-p-ink-secondary: #5c452a;--nq-p-ink-muted: #6f6455;--nq-p-ink-away: #4d4433;--nq-p-ink-late: #8f1526;--nq-brand-blue: #3B3AB8;--nq-brand-purple: #A035CC;--nq-brand-gradient: linear-gradient(135deg, var(--nq-brand-blue), var(--nq-brand-purple));--nq-p-icon-tile: var(--nq-brand-gradient);--nq-p-icon-tile-done: rgba(92,62,26,.16);--nq-p-crest: var(--nq-brand-gradient);--nq-p-crest-away: linear-gradient(135deg, #6b6b7a, #7a7286);--nq-p-seal: radial-gradient(circle at 35% 30%, #a8283a, #6d1322);--nq-p-seal-shadow: 0 4px 10px rgba(60,10,20,.4), inset 0 0 0 4px rgba(255,255,255,.14);--nq-p-seal-size: 78px;--nq-p-dock-bg: rgba(43,31,20,.9);--nq-p-dock-ink: #f7efdb;--nq-p-dock-ink-secondary: #d8c9a6;--nq-p-dock-divider: rgba(233,220,189,.3);--nq-p-dock-height: 84px;--nq-p-font-display: "Cinzel Decorative", Cinzel, serif;--nq-p-font-heading: Cinzel, serif;--nq-p-font-body: Nunito, system-ui, sans-serif;--nq-p-size-hero: 86px;--nq-p-size-wordmark: 66px;--nq-p-size-title: 56px;--nq-p-size-name: 48px;--nq-p-size-section: 32px;--nq-p-size-quest: 30px;--nq-p-size-body: 22px;--nq-p-size-label: 21px;--nq-p-track-label: .14em;--nq-p-track-kicker: .3em;--nq-p-quest-min-height: 116px;--nq-p-quest-gap: 24px;--nq-p-quest-pad: 22px;--nq-p-tile-size: 64px;--nq-p-button-height: 72px;--nq-p-button-min-width: 150px;--nq-p-confirm-button: 108px;--nq-p-radius-card: 12px;--nq-p-radius-panel: 20px;--nq-p-radius-pill: 9999px;--nq-p-page-inset: 62px;--nq-p-frame-inset: 26px;--nq-ease-out: cubic-bezier(0, 0, .2, 1);--nq-dur-micro: .12s;--nq-dur-base: .2s;--nq-dur-modal: .35s}'; -function oe(s) { +C._$litElement$ = !0, C.finalized = !0, rt.litElementHydrateSupport?.({ LitElement: C }); +const ce = rt.litElementPolyfillSupport; +ce?.({ LitElement: C }); +(rt.litElementVersions ??= []).push("4.2.2"); +const Rt = ':host{--nq-p-parchment-top: #f0e4c7;--nq-p-parchment-bottom: #ddcca3;--nq-p-parchment: radial-gradient(ellipse at 25% 10%, rgba(255,255,255,.5), transparent 55%), radial-gradient(ellipse at 85% 90%, rgba(120,86,44,.28), transparent 60%), repeating-linear-gradient(93deg, rgba(150,115,70,.05) 0 2px, transparent 2px 6px), repeating-linear-gradient(2deg, rgba(150,115,70,.04) 0 3px, transparent 3px 7px), linear-gradient(var(--nq-p-parchment-top), var(--nq-p-parchment-bottom));--nq-p-vignette: inset 0 0 200px rgba(80,52,20,.35);--nq-p-card-open: linear-gradient(#fdf7e6, #f2e7c9);--nq-p-card-done: linear-gradient(#f0e8d3, #e6dcc2);--nq-p-card-panel: linear-gradient(#fcf6e6, #f1e6ca);--nq-p-card-border: rgba(120,88,48,.38);--nq-p-panel-border: rgba(92,62,26,.4);--nq-p-card-shadow: 0 3px 0 rgba(120,88,48,.2), inset 0 1px 0 rgba(255,255,255,.7);--nq-p-panel-shadow: 0 6px 0 rgba(92,62,26,.18), inset 0 2px 0 rgba(255,255,255,.7);--nq-p-frame-outer: 2px solid rgba(92,62,26,.45);--nq-p-frame-inner: 1px solid rgba(92,62,26,.28);--nq-p-rule: 2px solid rgba(92,62,26,.35);--nq-p-ink: #2b1f14;--nq-p-ink-secondary: #5c452a;--nq-p-ink-muted: #6f6455;--nq-p-ink-away: #4d4433;--nq-p-ink-late: #8f1526;--nq-brand-blue: #3B3AB8;--nq-brand-purple: #A035CC;--nq-brand-gradient: linear-gradient(135deg, var(--nq-brand-blue), var(--nq-brand-purple));--nq-p-icon-tile: var(--nq-brand-gradient);--nq-p-icon-tile-done: rgba(92,62,26,.16);--nq-p-crest: var(--nq-brand-gradient);--nq-p-crest-away: linear-gradient(135deg, #6b6b7a, #7a7286);--nq-p-seal: radial-gradient(circle at 35% 30%, #a8283a, #6d1322);--nq-p-seal-shadow: 0 4px 10px rgba(60,10,20,.4), inset 0 0 0 4px rgba(255,255,255,.14);--nq-p-seal-size: 78px;--nq-p-dock-bg: rgba(43,31,20,.9);--nq-p-dock-ink: #f7efdb;--nq-p-dock-ink-secondary: #d8c9a6;--nq-p-dock-divider: rgba(233,220,189,.3);--nq-p-dock-height: 84px;--nq-p-font-display: "Cinzel Decorative", Cinzel, serif;--nq-p-font-heading: Cinzel, serif;--nq-p-font-body: Nunito, system-ui, sans-serif;--nq-p-size-hero: 86px;--nq-p-size-wordmark: 66px;--nq-p-size-title: 56px;--nq-p-size-name: 48px;--nq-p-size-section: 32px;--nq-p-size-quest: 30px;--nq-p-size-body: 22px;--nq-p-size-label: 21px;--nq-p-track-label: .14em;--nq-p-track-kicker: .3em;--nq-p-quest-min-height: 116px;--nq-p-quest-gap: 24px;--nq-p-quest-pad: 22px;--nq-p-tile-size: 64px;--nq-p-button-height: 72px;--nq-p-button-min-width: 150px;--nq-p-confirm-button: 108px;--nq-p-radius-card: 12px;--nq-p-radius-panel: 20px;--nq-p-radius-pill: 9999px;--nq-p-page-inset: 62px;--nq-p-frame-inset: 26px;--nq-ease-out: cubic-bezier(0, 0, .2, 1);--nq-dur-micro: .12s;--nq-dur-base: .2s;--nq-dur-modal: .35s}'; +function ot(s) { window.customCards = window.customCards ?? [], window.customCards.push(s); } -const _e = /* @__PURE__ */ new Map(); -function F(s, e) { - const t = `${s ?? "local"}|${JSON.stringify(e)}`, n = _e.get(t); +const yt = /* @__PURE__ */ new Map(); +function F(s, t) { + const e = `${s ?? "local"}|${JSON.stringify(t)}`, n = yt.get(e); if (n) return n; let i; try { i = new Intl.DateTimeFormat("en-US", { - ...e, + ...t, ...s ? { timeZone: s } : {} }); } catch { - i = new Intl.DateTimeFormat("en-US", e); + i = new Intl.DateTimeFormat("en-US", t); } - return _e.set(t, i), i; + return yt.set(e, i), i; } -function pt(s) { - const e = s?.config; - if (!e || typeof e != "object") +function pe(s) { + const t = s?.config; + if (!t || typeof t != "object") return; - const t = e.time_zone; - return typeof t == "string" && t.trim() ? t.trim() : void 0; + const e = t.time_zone; + return typeof e == "string" && e.trim() ? e.trim() : void 0; } -function G(s, e) { - return `${F(e, { weekday: "long" }).format(s)}, ${F(e, { month: "short", day: "numeric" }).format(s)}`; +function G(s, t) { + return `${F(t, { weekday: "long" }).format(s)}, ${F(t, { month: "short", day: "numeric" }).format(s)}`; } -function ht(s, e) { - return F(e, { +function he(s, t) { + return F(t, { hour: "numeric", minute: "2-digit", hour12: !0 }).format(s); } -const ut = { +const ue = { "clear-night": "Clear", cloudy: "Cloudy", exceptional: "Clear", @@ -552,7 +552,7 @@ const ut = { sunny: "Sunny", windy: "Windy", "windy-variant": "Windy" -}, ft = { +}, fe = { "clear-night": "Clear night skies", cloudy: "Grey skies today", exceptional: "A striking day", @@ -569,26 +569,26 @@ const ut = { windy: "A blustery day", "windy-variant": "A blustery day" }; -function ve(s) { +function vt(s) { return typeof s == "string" ? s.trim() : ""; } -function K(s, e) { +function K(s, t) { if (s == null || s === "") - return e; - const t = typeof s == "number" ? s : Number(s); - return Number.isFinite(t) ? t : e; + return t; + const e = typeof s == "number" ? s : Number(s); + return Number.isFinite(e) ? e : t; } -function be(s) { +function bt(s) { return Number.isFinite(s) ? Math.min(100, Math.max(0, s)) : 0; } -function $e(s) { +function xt(s) { return Math.max(0, Math.round(s)); } -function mt(s) { - return s.split(/[-_]+/).filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" "); +function me(s) { + return s.split(/[-_]+/).filter(Boolean).map((t) => t.charAt(0).toUpperCase() + t.slice(1)).join(" "); } -function gt(s, e) { - const t = F(e, { +function ge(s, t) { + const e = F(t, { year: "numeric", month: "2-digit", day: "2-digit", @@ -597,7 +597,7 @@ function gt(s, e) { second: "2-digit", hourCycle: "h23" }).formatToParts(new Date(s)), n = (r) => { - const o = t.find((l) => l.type === r); + const o = e.find((l) => l.type === r); return o ? Number(o.value) : Number.NaN; }, i = Date.UTC( n("year"), @@ -609,30 +609,30 @@ function gt(s, e) { ); return Number.isFinite(i) ? i - s : 0; } -function yt(s, e) { +function _e(s, t) { if (typeof s != "string") return null; - const t = s.split("-"); - if (t.length !== 3) + const e = s.split("-"); + if (e.length !== 3) return null; - const [n, i, r] = t.map((a) => Number(a)); + const [n, i, r] = e.map((a) => Number(a)); if (!n || !i || !r) return null; - if (!e) { + if (!t) { const a = new Date(n, i - 1, r); return Number.isNaN(a.getTime()) ? null : a; } - const o = Date.UTC(n, i - 1, r), l = new Date(o - gt(o, e)); + const o = Date.UTC(n, i - 1, r), l = new Date(o - ge(o, t)); return Number.isNaN(l.getTime()) ? null : l; } -function _t(s) { - const e = ut[s]; - return e || s.charAt(0).toUpperCase() + s.slice(1); +function ye(s) { + const t = ue[s]; + return t || s.charAt(0).toUpperCase() + s.slice(1); } -function vt(s, e) { - return ft[s] ?? e; +function ve(s, t) { + return fe[s] ?? t; } -const xe = "polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%)", bt = "polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%)", $t = Pe` +const $t = "polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%)", be = "polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%)", xe = Pt` * { box-sizing: border-box; } @@ -704,7 +704,7 @@ const xe = "polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%)", bt = "polygon(50% justify-content: center; width: 34px; height: 34px; - clip-path: ${v(bt)}; + clip-path: ${v(be)}; background: var(--nq-brand-gradient); } @@ -798,7 +798,7 @@ const xe = "polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%)", bt = "polygon(50% width: 188px; height: 214px; padding: 4px; - clip-path: ${v(xe)}; + clip-path: ${v($t)}; background: rgba(255, 255, 255, 0.22); } @@ -809,7 +809,7 @@ const xe = "polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%)", bt = "polygon(50% align-items: center; justify-content: center; padding-bottom: 70px; - clip-path: ${v(xe)}; + clip-path: ${v($t)}; background: var(--nq-p-crest); } @@ -1027,7 +1027,7 @@ const xe = "polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%)", bt = "polygon(50% font-weight: 800; line-height: 1; } -`, xt = p` -`, qt = p``, we = c` -`, wt = p``, qe = c` -`, kt = p``, ke = c` -`, At = p``, Ae = c` -`, qe = { - icon: kt, +`, wt = { + icon: ke, headline: "NestQuest is not set up yet", body: "A parent needs to finish setting up NestQuest before the party can gather." -}, Ct = { - icon: At, +}, Ce = { + icon: Ae, headline: "The records cannot be reached", body: "The party's records are quiet right now. NestQuest will return shortly." -}, St = p` `; -class Et extends C { +class Ee extends C { static properties = { hass: { attribute: !1 }, _config: { state: !0 }, _now: { state: !0 } }; - static styles = [v(Re), $t]; + static styles = [v(Rt), xe]; hass; _config; _now = /* @__PURE__ */ new Date(); _clockTimer; - setConfig(e) { - if (!e || typeof e != "object") + setConfig(t) { + if (!t || typeof t != "object") throw new Error("Invalid configuration"); - this._config = e; + this._config = t; } getCardSize() { return 22; @@ -1135,8 +1135,8 @@ class Et extends C { this._clockTimer !== void 0 && (window.clearInterval(this._clockTimer), this._clockTimer = void 0), super.disconnectedCallback(); } render() { - const e = this._boardNotice(); - return p` + const t = this._boardNotice(); + return c`
@@ -1152,9 +1152,9 @@ class Et extends C {

The Party · ${G(this._now, this._timeZone())}

- ${e ? this._renderNotice(e) : p` + ${t ? this._renderNotice(t) : c`
- ${this._plates().map((t) => this._renderPlate(t))} + ${this._plates().map((e) => this._renderPlate(e))}

Tap your crest to open your Quest Log

`} @@ -1164,164 +1164,164 @@ class Et extends C { `; } _timeZone() { - return pt(this.hass); + return pe(this.hass); } - _state(e) { - const n = this.hass?.states?.[e]; + _state(t) { + const n = this.hass?.states?.[t]; return n && typeof n == "object" ? n : null; } _childSlugs() { if (!this._config) return []; - const e = this._config.child_order; - return Array.isArray(e) ? e.filter( - (t) => typeof t == "string" && t.trim().length > 0 - ).map((t) => t.trim()) : []; + const t = this._config.child_order; + return Array.isArray(t) ? t.filter( + (e) => typeof e == "string" && e.trim().length > 0 + ).map((e) => e.trim()) : []; } _plates() { - return this._childSlugs().map((e) => this._plate(e)); + return this._childSlugs().map((t) => this._plate(t)); } - _plate(e) { - const t = this._dueSensorResolution(e), n = this._state(`sensor.nestquest_${e}_quests_due_today`), i = this._state( - `sensor.nestquest_${e}_quests_completed_today` + _plate(t) { + const e = this._dueSensorResolution(t), n = this._state(`sensor.nestquest_${t}_quests_due_today`), i = this._state( + `sensor.nestquest_${t}_quests_completed_today` ), r = this._state( - `sensor.nestquest_${e}_completion_pct_today` + `sensor.nestquest_${t}_completion_pct_today` ), o = this._state( - `binary_sensor.nestquest_${e}_present_today` - ), l = n?.attributes ?? {}, a = $e(K(n?.state, 0)), c = $e(K(i?.state, 0)), u = r ? K(r.state, Number.NaN) : Number.NaN, d = Number.isFinite(u) ? be(u) : a > 0 ? be(c / a * 100) : 0; + `binary_sensor.nestquest_${t}_present_today` + ), l = n?.attributes ?? {}, a = xt(K(n?.state, 0)), p = xt(K(i?.state, 0)), u = r ? K(r.state, Number.NaN) : Number.NaN, d = Number.isFinite(u) ? bt(u) : a > 0 ? bt(p / a * 100) : 0; let f = !0; const h = l.present; typeof h == "boolean" ? f = h : o && (f = String(o.state ?? "").trim().toLowerCase() === "on"); let m = ""; - const y = l.child_name; - if (typeof y == "string" && y.trim()) - m = y.trim(); + const _ = l.child_name; + if (typeof _ == "string" && _.trim()) + m = _.trim(); else { const Z = o?.attributes?.child_name; typeof Z == "string" && Z.trim() && (m = Z.trim()); } - m || (m = mt(e)); - const b = yt( + m || (m = me(t)); + const b = _e( o?.attributes?.next_present, this._timeZone() ), j = b ? `Returns ${G(b, this._timeZone())}` : null; return { - slug: e, + slug: t, name: m, initial: (m.charAt(0) || "?").toUpperCase(), - present: t === null ? f : !1, - completed: c, + present: e === null ? f : !1, + completed: p, due: a, pct: d, returns: j, - unresolved: t + unresolved: e }; } /** "missing" when the due sensor does not exist (integration not * configured), "stale" when it answers unavailable/unknown (backend * unreachable or the child is absent from the snapshot), null when * it resolves. */ - _dueSensorResolution(e) { - const t = this._state(`sensor.nestquest_${e}_quests_due_today`); - if (!t) + _dueSensorResolution(t) { + const e = this._state(`sensor.nestquest_${t}_quests_due_today`); + if (!e) return "missing"; - const n = String(t.state ?? "").trim().toLowerCase(); + const n = String(e.state ?? "").trim().toLowerCase(); return !n || n === "unavailable" || n === "unknown" ? "stale" : null; } _boardNotice() { - const e = this._plates(); - return e.length === 0 ? qe : e.every((t) => t.unresolved !== null) ? e.some((t) => t.unresolved === "stale") ? Ct : qe : null; + const t = this._plates(); + return t.length === 0 ? wt : t.every((e) => e.unresolved !== null) ? t.some((e) => e.unresolved === "stale") ? Ce : wt : null; } - _renderNotice(e) { - return p` + _renderNotice(t) { + return c`
- ${e.icon} - ${e.headline} -

${e.body}

+ ${t.icon} + ${t.headline} +

${t.body}

`; } - _renderPlate(e) { - return e.unresolved ? p` + _renderPlate(t) { + return t.unresolved ? c`
- ${e.initial} + ${t.initial} - ${e.name} + ${t.name} - ${wt} + ${qe} Unknown —
- ` : e.present ? p` + ` : t.present ? c` - ` : p` + ` : c`
- ${e.initial} + ${t.initial} - ${e.name} + ${t.name} - ${qt} + ${we} On travels - ${e.returns ?? "Returns —"} + ${t.returns ?? "Returns —"}
`; } - _openQuestLog(e) { - const t = ve(this._config?.quest_log_path); - t && (window.history.pushState(null, "", `${t.replace(/\/+$/, "")}/${e}`), window.dispatchEvent(new Event("location-changed"))); + _openQuestLog(t) { + const e = vt(this._config?.quest_log_path); + e && (window.history.pushState(null, "", `${e.replace(/\/+$/, "")}/${t}`), window.dispatchEvent(new Event("location-changed"))); } _dockWeather() { - const e = ve(this._config?.weather_entity); - if (!e) - return null; - const t = this._state(e); + const t = vt(this._config?.weather_entity); if (!t) return null; - const n = String(t.state ?? "").trim(); + const e = this._state(t); + if (!e) + return null; + const n = String(e.state ?? "").trim(); if (!n || n === "unavailable" || n === "unknown") return null; - const i = t.attributes ?? {}; + const i = e.attributes ?? {}; let r = null, o = null; const l = i.forecast; if (Array.isArray(l) && l.length > 0) { const a = l[0]; if (a && typeof a == "object") { - const c = a; - r = this._optionalNumber(c.temperature), o = this._optionalNumber(c.templow); + const p = a; + r = this._optionalNumber(p.temperature), o = this._optionalNumber(p.templow); } } return { @@ -1331,30 +1331,30 @@ class Et extends C { low: o }; } - _optionalNumber(e) { - if (e == null || e === "") + _optionalNumber(t) { + if (t == null || t === "") return null; - const t = typeof e == "number" ? e : Number(e); - return Number.isFinite(t) ? t : null; + const e = typeof t == "number" ? t : Number(t); + return Number.isFinite(e) ? e : null; } _renderDock() { - const e = this._dockWeather(); - if (!e) - return p` + const t = this._dockWeather(); + if (!t) + return c`
${G(this._now, this._timeZone())} - ${ht(this._now, this._timeZone())} + ${he(this._now, this._timeZone())}
`; - const t = _t(e.condition), n = vt(e.condition, t), i = e.temperature === null ? g : p`${Math.round(e.temperature)}°`, r = e.high === null || e.low === null ? null : `${Math.round(e.high)}° / ${Math.round(e.low)}°`; - return p` + const e = ye(t.condition), n = ve(t.condition, e), i = t.temperature === null ? g : c`${Math.round(t.temperature)}°`, r = t.high === null || t.low === null ? null : `${Math.round(t.high)}° / ${Math.round(t.low)}°`; + return c`
- ${St} + ${Se} ${i} - ${r === null ? t : `${t} · ${r}`} + ${r === null ? e : `${e} · ${r}`} ${n} @@ -1362,167 +1362,167 @@ class Et extends C { `; } } -customElements.define("nestquest-party-board-card", Et); -oe({ +customElements.define("nestquest-party-board-card", Ee); +ot({ type: "nestquest-party-board-card", name: "NestQuest Party Board", description: "Kids' attract screen for present and away adventurers." }); -const Nt = { CHILD: 2 }, Tt = (s) => (...e) => ({ _$litDirective$: s, values: e }); -let Mt = class { - constructor(e) { +const Ne = { CHILD: 2 }, Te = (s) => (...t) => ({ _$litDirective$: s, values: t }); +let Me = class { + constructor(t) { } get _$AU() { return this._$AM._$AU; } - _$AT(e, t, n) { - this._$Ct = e, this._$AM = t, this._$Ci = n; + _$AT(t, e, n) { + this._$Ct = t, this._$AM = e, this._$Ci = n; } - _$AS(e, t) { - return this.update(e, t); + _$AS(t, e) { + return this.update(t, e); } - update(e, t) { - return this.render(...t); + update(t, e) { + return this.render(...e); } }; -const { I: Ot } = at, we = (s) => s, ke = () => document.createComment(""), z = (s, e, t) => { - const n = s._$AA.parentNode, i = e === void 0 ? s._$AB : e._$AA; - if (t === void 0) { - const r = n.insertBefore(ke(), i), o = n.insertBefore(ke(), i); - t = new Ot(r, o, s, s.options); +const { I: Oe } = ae, qt = (s) => s, kt = () => document.createComment(""), z = (s, t, e) => { + const n = s._$AA.parentNode, i = t === void 0 ? s._$AB : t._$AA; + if (e === void 0) { + const r = n.insertBefore(kt(), i), o = n.insertBefore(kt(), i); + e = new Oe(r, o, s, s.options); } else { - const r = t._$AB.nextSibling, o = t._$AM, l = o !== s; + const r = e._$AB.nextSibling, o = e._$AM, l = o !== s; if (l) { let a; - t._$AQ?.(s), t._$AM = s, t._$AP !== void 0 && (a = s._$AU) !== o._$AU && t._$AP(a); + e._$AQ?.(s), e._$AM = s, e._$AP !== void 0 && (a = s._$AU) !== o._$AU && e._$AP(a); } if (r !== i || l) { - let a = t._$AA; + let a = e._$AA; for (; a !== r; ) { - const c = we(a).nextSibling; - we(n).insertBefore(a, i), a = c; + const p = qt(a).nextSibling; + qt(n).insertBefore(a, i), a = p; } } } - return t; -}, w = (s, e, t = s) => (s._$AI(e, t), s), zt = {}, Pt = (s, e = zt) => s._$AH = e, It = (s) => s._$AH, J = (s) => { + return e; +}, q = (s, t, e = s) => (s._$AI(t, e), s), ze = {}, Pe = (s, t = ze) => s._$AH = t, Ie = (s) => s._$AH, J = (s) => { s._$AR(), s._$AA.remove(); }; -const Ae = (s, e, t) => { +const At = (s, t, e) => { const n = /* @__PURE__ */ new Map(); - for (let i = e; i <= t; i++) n.set(s[i], i); + for (let i = t; i <= e; i++) n.set(s[i], i); return n; -}, Ce = Tt(class extends Mt { +}, Ct = Te(class extends Me { constructor(s) { - if (super(s), s.type !== Nt.CHILD) throw Error("repeat() can only be used in text expressions"); + if (super(s), s.type !== Ne.CHILD) throw Error("repeat() can only be used in text expressions"); } - dt(s, e, t) { + dt(s, t, e) { let n; - t === void 0 ? t = e : e !== void 0 && (n = e); + e === void 0 ? e = t : t !== void 0 && (n = t); const i = [], r = []; let o = 0; - for (const l of s) i[o] = n ? n(l, o) : o, r[o] = t(l, o), o++; + for (const l of s) i[o] = n ? n(l, o) : o, r[o] = e(l, o), o++; return { values: r, keys: i }; } - render(s, e, t) { - return this.dt(s, e, t).values; + render(s, t, e) { + return this.dt(s, t, e).values; } - update(s, [e, t, n]) { - const i = It(s), { values: r, keys: o } = this.dt(e, t, n); + update(s, [t, e, n]) { + const i = Ie(s), { values: r, keys: o } = this.dt(t, e, n); if (!Array.isArray(i)) return this.ut = o, r; const l = this.ut ??= [], a = []; - let c, u, d = 0, f = i.length - 1, h = 0, m = r.length - 1; + let p, u, d = 0, f = i.length - 1, h = 0, m = r.length - 1; for (; d <= f && h <= m; ) if (i[d] === null) d++; else if (i[f] === null) f--; - else if (l[d] === o[h]) a[h] = w(i[d], r[h]), d++, h++; - else if (l[f] === o[m]) a[m] = w(i[f], r[m]), f--, m--; - else if (l[d] === o[m]) a[m] = w(i[d], r[m]), z(s, a[m + 1], i[d]), d++, m--; - else if (l[f] === o[h]) a[h] = w(i[f], r[h]), z(s, i[d], i[f]), f--, h++; - else if (c === void 0 && (c = Ae(o, h, m), u = Ae(l, d, f)), c.has(l[d])) if (c.has(l[f])) { - const y = u.get(o[h]), b = y !== void 0 ? i[y] : null; + else if (l[d] === o[h]) a[h] = q(i[d], r[h]), d++, h++; + else if (l[f] === o[m]) a[m] = q(i[f], r[m]), f--, m--; + else if (l[d] === o[m]) a[m] = q(i[d], r[m]), z(s, a[m + 1], i[d]), d++, m--; + else if (l[f] === o[h]) a[h] = q(i[f], r[h]), z(s, i[d], i[f]), f--, h++; + else if (p === void 0 && (p = At(o, h, m), u = At(l, d, f)), p.has(l[d])) if (p.has(l[f])) { + const _ = u.get(o[h]), b = _ !== void 0 ? i[_] : null; if (b === null) { const j = z(s, i[d]); - w(j, r[h]), a[h] = j; - } else a[h] = w(b, r[h]), z(s, i[d], b), i[y] = null; + q(j, r[h]), a[h] = j; + } else a[h] = q(b, r[h]), z(s, i[d], b), i[_] = null; h++; } else J(i[f]), f--; else J(i[d]), d++; for (; h <= m; ) { - const y = z(s, a[m + 1]); - w(y, r[h]), a[h++] = y; + const _ = z(s, a[m + 1]); + q(_, r[h]), a[h++] = _; } for (; d <= f; ) { - const y = i[d++]; - y !== null && J(y); + const _ = i[d++]; + _ !== null && J(_); } - return this.ut = o, Pt(s, a), E; + return this.ut = o, Pe(s, a), E; } -}), Se = /* @__PURE__ */ new Map(); -function H(s, e) { - const t = `${s ?? "local"}|${JSON.stringify(e)}`, n = Se.get(t); +}), St = /* @__PURE__ */ new Map(); +function H(s, t) { + const e = `${s ?? "local"}|${JSON.stringify(t)}`, n = St.get(e); if (n) return n; let i; try { i = new Intl.DateTimeFormat("en-US", { - ...e, + ...t, ...s ? { timeZone: s } : {} }); } catch { - i = new Intl.DateTimeFormat("en-US", e); + i = new Intl.DateTimeFormat("en-US", t); } - return Se.set(t, i), i; + return St.set(e, i), i; } -function Ut(s) { - const e = s?.config; - if (!e || typeof e != "object") +function Ue(s) { + const t = s?.config; + if (!t || typeof t != "object") return; - const t = e.time_zone; - return typeof t == "string" && t.trim() ? t.trim() : void 0; + const e = t.time_zone; + return typeof e == "string" && e.trim() ? e.trim() : void 0; } -function Ee(s, e) { - return `${H(e, { weekday: "long" }).format(s)}, ${H(e, { month: "short", day: "numeric" }).format(s)}`; +function Et(s, t) { + return `${H(t, { weekday: "long" }).format(s)}, ${H(t, { month: "short", day: "numeric" }).format(s)}`; } -function Dt(s, e) { - return H(e, { weekday: "long" }).format(s); +function De(s, t) { + return H(t, { weekday: "long" }).format(s); } -function Ht(s, e) { - const t = new Date(s); - return Number.isNaN(t.getTime()) ? "" : H(e, { +function He(s, t) { + const e = new Date(s); + return Number.isNaN(e.getTime()) ? "" : H(t, { hour: "numeric", minute: "2-digit", hour12: !0 - }).format(t); + }).format(e); } -function jt(s) { +function je(s) { if (!s) return null; - const e = /^(\d{1,2}):(\d{2})$/.exec(s.trim()); - if (!e) + const t = /^(\d{1,2}):(\d{2})$/.exec(s.trim()); + if (!t) return null; - const t = Number(e[1]); - if (t > 23) + const e = Number(t[1]); + if (e > 23) return null; - const n = t >= 12 ? "PM" : "AM"; - return `${t % 12 === 0 ? 12 : t % 12}:${e[2]} ${n}`; + const n = e >= 12 ? "PM" : "AM"; + return `${e % 12 === 0 ? 12 : e % 12}:${t[2]} ${n}`; } function k(s) { return typeof s == "string" ? s.trim() : ""; } -function _(s, e) { +function y(s, t) { if (s == null || s === "") - return e; - const t = typeof s == "number" ? s : Number(s); - return Number.isFinite(t) ? t : e; + return t; + const e = typeof s == "number" ? s : Number(s); + return Number.isFinite(e) ? e : t; } -function $(s) { +function x(s) { return Math.max(0, Math.round(s)); } function X(s) { - return s.split(/[-_]+/).filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" "); + return s.split(/[-_]+/).filter(Boolean).map((t) => t.charAt(0).toUpperCase() + t.slice(1)).join(" "); } -function Rt(s, e) { - const t = H(e, { +function Re(s, t) { + const e = H(t, { year: "numeric", month: "2-digit", day: "2-digit", @@ -1531,7 +1531,7 @@ function Rt(s, e) { second: "2-digit", hourCycle: "h23" }).formatToParts(new Date(s)), n = (r) => { - const o = t.find((l) => l.type === r); + const o = e.find((l) => l.type === r); return o ? Number(o.value) : Number.NaN; }, i = Date.UTC( n("year"), @@ -1543,45 +1543,49 @@ function Rt(s, e) { ); return Number.isFinite(i) ? i - s : 0; } -function Ne(s, e) { +function Nt(s, t) { if (typeof s != "string") return null; - const t = s.split("-"); - if (t.length !== 3) + const e = s.split("-"); + if (e.length !== 3) return null; - const [n, i, r] = t.map((a) => Number(a)); + const [n, i, r] = e.map((a) => Number(a)); if (!n || !i || !r) return null; - if (!e) { + if (!t) { const a = new Date(n, i - 1, r); return Number.isNaN(a.getTime()) ? null : a; } - const o = Date.UTC(n, i - 1, r), l = new Date(o - Rt(o, e)); + const o = Date.UTC(n, i - 1, r), l = new Date(o - Re(o, t)); return Number.isNaN(l.getTime()) ? null : l; } -function Lt() { +function Le() { const s = window.location.pathname.split("/").filter(Boolean); return s.length > 0 ? s[s.length - 1].toLowerCase() : ""; } -function Bt(s) { +function Be(s) { if (!s || typeof s != "object") return null; - const e = s, t = k(e.state).toLowerCase(); - if (t !== "open" && t !== "completed") + const t = s, e = k(t.state).toLowerCase(); + if (e !== "open" && e !== "completed") return null; - const n = _(e.id, 0); - return n ? { + const n = y(t.id, 0); + if (!n) + return null; + const i = y(t.child_id, 0); + return { id: n, - title: k(e.title) || "Quest", - icon: k(e.icon) || null, - window: k(e.window).toLowerCase(), - due_time: k(e.due_time) || null, - state: t, - overdue: e.overdue === !0, - completed_at: k(e.completed_at) || null - } : null; + child_id: i > 0 ? i : null, + title: k(t.title) || "Quest", + icon: k(t.icon) || null, + window: k(t.window).toLowerCase(), + due_time: k(t.due_time) || null, + state: e, + overdue: t.overdue === !0, + completed_at: k(t.completed_at) || null + }; } -const Te = "polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%)", Ft = "polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%)", Me = [-9, 6, -4], Qt = Pe` +const Tt = "polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%)", Fe = "polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%)", Mt = [-9, 6, -4], Qe = Pt` * { box-sizing: border-box; } @@ -1641,7 +1645,7 @@ const Te = "polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%)", Ft = "polygon(50% width: 96px; height: 110px; padding: 3px; - clip-path: ${v(Te)}; + clip-path: ${v(Tt)}; background: rgba(255, 255, 255, 0.22); } @@ -1652,7 +1656,7 @@ const Te = "polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%)", Ft = "polygon(50% align-items: center; justify-content: center; padding-bottom: 32px; - clip-path: ${v(Te)}; + clip-path: ${v(Tt)}; background: var(--nq-p-crest); } @@ -1718,7 +1722,7 @@ const Te = "polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%)", Ft = "polygon(50% justify-content: center; width: 44px; height: 44px; - clip-path: ${v(Ft)}; + clip-path: ${v(Fe)}; background: var(--nq-brand-gradient); } @@ -2229,7 +2233,42 @@ const Te = "polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%)", Ft = "polygon(50% width: 38px; height: 38px; } -`, R = p` -`, Wt = p``, We = c` -`, Y = p``, Y = c` -`, Zt = p``, Ze = c` -`, Le = p``, Lt = c` -`, Vt = p``, Ve = c` -`, Gt = p``, Ge = c` -`, Kt = p``, Ke = c` -`, Jt = p``, Je = c` -`, Xt = p``, Xe = c` -`, Yt = { - icon: Kt, +`, Ye = { + icon: Ke, headline: "No adventurer chosen", body: "Open The Party and tap your crest to open your quest log." -}, en = { - icon: Jt, +}, tn = { + icon: Je, headline: "NestQuest is not set up yet", body: "A parent needs to finish setting up NestQuest." -}, tn = { - icon: Xt, +}, en = { + icon: Xe, headline: "The records cannot be reached", body: "The party's records are quiet right now. NestQuest will return shortly." -}, Oe = [ - { key: "morning", name: "Morning", range: "Until 11:59 AM", icon: Zt }, - { key: "afternoon", name: "Afternoon", range: "12:00–5:00 PM", icon: Le }, - { key: "evening", name: "Evening", range: "5:00–9:00 PM", icon: Vt } +}, Ot = [ + { key: "morning", name: "Morning", range: "Until 11:59 AM", icon: Ze }, + { key: "afternoon", name: "Afternoon", range: "12:00–5:00 PM", icon: Lt }, + { key: "evening", name: "Evening", range: "5:00–9:00 PM", icon: Ve } ]; class nn extends C { static properties = { hass: { attribute: !1 }, _config: { state: !0 }, _now: { state: !0 }, - _confirm: { state: !0 } + _confirm: { state: !0 }, + _optimistic: { state: !0 }, + _toast: { state: !0 } }; - static styles = [v(Re), Qt]; + static styles = [v(Rt), Qe]; hass; _config; _now = /* @__PURE__ */ new Date(); _confirm = null; + /** instanceId → the completion instant stamped before the service has + * answered; the seal shows immediately and reverts on failure. */ + _optimistic = /* @__PURE__ */ new Map(); + _toast = null; _clockTimer; _idleTimer; _confirmTimer; - setConfig(e) { - if (!e || typeof e != "object") + _toastTimer; + setConfig(t) { + if (!t || typeof t != "object") throw new Error("Invalid configuration"); - this._config = e; + this._config = t; } getCardSize() { return 22; @@ -2398,72 +2444,78 @@ class nn extends C { }, 6e4), window.addEventListener("pointerdown", this._onActivity, !0), window.addEventListener("touchstart", this._onActivity, !0), window.addEventListener("keydown", this._onActivity, !0), this._armIdle(); } disconnectedCallback() { - this._stopClock(), this._clearIdle(), this._clearConfirmTimer(), window.removeEventListener("pointerdown", this._onActivity, !0), window.removeEventListener("touchstart", this._onActivity, !0), window.removeEventListener("keydown", this._onActivity, !0), super.disconnectedCallback(); + this._stopClock(), this._clearIdle(), this._clearConfirmTimer(), this._clearToastTimer(), window.removeEventListener("pointerdown", this._onActivity, !0), window.removeEventListener("touchstart", this._onActivity, !0), window.removeEventListener("keydown", this._onActivity, !0), super.disconnectedCallback(); } render() { - const e = this._logView(); - return p` + const t = this._logView(); + return c`
- ${this._renderMain(e)} + ${this._renderMain(t)} ${this._renderConfirm()} + ${this._renderToast()}
`; } - _renderMain(e) { - switch (e.kind) { + _renderToast() { + return this._toast === null ? g : c` +
${this._toast}
+ `; + } + _renderMain(t) { + switch (t.kind) { case "no-adventurer": - return this._renderNotice(Yt); + return this._renderNotice(Ye); case "not-set-up": - return this._renderNotice(en); - case "unreachable": return this._renderNotice(tn); + case "unreachable": + return this._renderNotice(en); case "away": { - const t = ["The quest log unlocks when they return."]; - return e.returns && t.push(`Returns ${e.returns}`), p` - ${this._renderHeader(e)} + const e = ["The quest log unlocks when they return."]; + return t.returns && e.push(`Returns ${t.returns}`), c` + ${this._renderHeader(t)}
- ${Gt} - ${e.name} is on travels - ${t.map((n) => p`

${n}

`)} + ${Ge} + ${t.name} is on travels + ${e.map((n) => c`

${n}

`)}
`; } case "empty-day": - return p` - ${this._renderHeader(e)} + return c` + ${this._renderHeader(t)}
- ${Le} + ${Lt} No quests today

- ${`Nothing was posted for today, ${e.name}. Enjoy the day's rest!`} + ${`Nothing was posted for today, ${t.name}. Enjoy the day's rest!`}

`; case "complete-day": - return p` - ${this._renderHeader(e)} + return c` + ${this._renderHeader(t)}
${R} Quest complete

- ${`Every quest is claimed, ${e.name}. The seal is set for today.`} + ${`Every quest is claimed, ${t.name}. The seal is set for today.`}

Returning to The Party shortly.

`; default: - return p` - ${this._renderHeader(e)} + return c` + ${this._renderHeader(t)}
- ${Oe.map((t) => this._renderColumn(t))} + ${Ot.map((e) => this._renderColumn(e))}
`; } @@ -2471,163 +2523,179 @@ class nn extends C { /** Resolve the log's single render state; the priority order is * design/PANEL-EMPTY-STATES.md §2. */ _logView() { - const e = this._childSlug(); - if (!e) + const t = this._childSlug(); + if (!t) return { kind: "no-adventurer" }; - const t = this._dueSensorResolution(e); - if (t === "missing") + const e = this._dueSensorResolution(t); + if (e === "missing") return { kind: "not-set-up" }; - if (t === "stale") + if (e === "stale") return { kind: "unreachable" }; - const n = this._childName(e) ?? X(e); - if (!this._childPresent(e)) - return { kind: "away", name: n, returns: this._awayReturns(e) }; - const i = this._state(`sensor.nestquest_${e}_quests_due_today`); - return $(_(i?.state, 0)) === 0 ? { kind: "empty-day", name: n } : this._remaining() === 0 ? { kind: "complete-day", name: n } : { kind: "normal" }; + const n = this._childName(t) ?? X(t); + if (!this._childPresent(t)) + return { kind: "away", name: n, returns: this._awayReturns(t) }; + const i = this._state(`sensor.nestquest_${t}_quests_due_today`); + return x(y(i?.state, 0)) === 0 ? { kind: "empty-day", name: n } : this._remaining() === 0 ? { kind: "complete-day", name: n } : { kind: "normal" }; } /** "missing" when the due sensor does not exist (integration not * configured), "stale" when it answers unavailable/unknown (backend * unreachable or the child is absent from the snapshot), null when * it resolves. */ - _dueSensorResolution(e) { - const t = this._state(`sensor.nestquest_${e}_quests_due_today`); - if (!t) + _dueSensorResolution(t) { + const e = this._state(`sensor.nestquest_${t}_quests_due_today`); + if (!e) return "missing"; - const n = String(t.state ?? "").trim().toLowerCase(); + const n = String(e.state ?? "").trim().toLowerCase(); return !n || n === "unavailable" || n === "unknown" ? "stale" : null; } - _childPresent(e) { - const n = this._state(`sensor.nestquest_${e}_quests_due_today`)?.attributes?.present; + _childPresent(t) { + const n = this._state(`sensor.nestquest_${t}_quests_due_today`)?.attributes?.present; if (typeof n == "boolean") return n; const i = this._state( - `binary_sensor.nestquest_${e}_present_today` + `binary_sensor.nestquest_${t}_present_today` ); return i ? String(i.state ?? "").trim().toLowerCase() === "on" : !0; } - _awayReturns(e) { - const t = this._timeZone(), n = this._state( - `binary_sensor.nestquest_${e}_present_today` - ), i = Ne( + _awayReturns(t) { + const e = this._timeZone(), n = this._state( + `binary_sensor.nestquest_${t}_present_today` + ), i = Nt( n?.attributes?.next_present, - t + e ); - return i ? Ee(i, t) : null; + return i ? Et(i, e) : null; } - _renderNotice(e) { - return p` + _renderNotice(t) { + return c`
- ${e.icon} - ${e.headline} -

${e.body}

+ ${t.icon} + ${t.headline} +

${t.body}

`; } _timeZone() { - return Ut(this.hass); + return Ue(this.hass); } - _state(e) { - const n = this.hass?.states?.[e]; + _state(t) { + const n = this.hass?.states?.[t]; return n && typeof n == "object" ? n : null; } _childSlug() { - return Lt(); + return Le(); } _boardPath() { return k(this._config?.board_path).replace(/\/+$/, ""); } _idleSeconds() { - const e = _(this._config?.idle_return_seconds, 40); - return e > 0 ? e : 40; + const t = y(this._config?.idle_return_seconds, 40); + return t > 0 ? t : 40; } _confirmSeconds() { - const e = _(this._config?.confirm_timeout_seconds, 15); - return e > 0 ? e : 15; + const t = y(this._config?.confirm_timeout_seconds, 15); + return t > 0 ? t : 15; } - _childName(e) { - if (!e) + _childName(t) { + if (!t) return null; - const t = this._state(`sensor.nestquest_${e}_quests_due_today`)?.attributes?.child_name; - return typeof t == "string" && t.trim() ? t.trim() : null; + const e = this._state(`sensor.nestquest_${t}_quests_due_today`)?.attributes?.child_name; + return typeof e == "string" && e.trim() ? e.trim() : null; } - _childCounts(e) { - const t = this._state(`sensor.nestquest_${e}_quests_due_today`), n = this._state( - `sensor.nestquest_${e}_quests_completed_today` - ), i = $(_(t?.state, 0)), r = $(_(n?.state, 0)); + _childCounts(t) { + const e = this._state(`sensor.nestquest_${t}_quests_due_today`), n = this._state( + `sensor.nestquest_${t}_quests_completed_today` + ), i = x(y(e?.state, 0)), r = x(y(n?.state, 0)); return { due: i, completed: r }; } _instances() { - const e = this._childSlug(); - if (!e) + const t = this._childSlug(); + if (!t) return []; - const t = this._state(`sensor.nestquest_${e}_quests_due_today`)?.attributes?.instances; - return Array.isArray(t) ? t.map(Bt).filter((n) => n !== null) : []; + const e = this._state(`sensor.nestquest_${t}_quests_due_today`)?.attributes?.instances; + if (!Array.isArray(e)) + return []; + const n = e.map(Be).filter((r) => r !== null); + if (this._optimistic.size === 0) + return n; + let i = !1; + for (const r of n) { + const o = this._optimistic.get(r.id); + if (o !== void 0) { + if (r.state === "completed") { + this._optimistic.delete(r.id), i = !0; + continue; + } + r.state = "completed", r.overdue = !1, r.completed_at = o; + } + } + return i && (this._optimistic = new Map(this._optimistic)), n; } _remaining() { - const e = this._childSlug(); - if (!e) + const t = this._childSlug(); + if (!t) return 0; - const t = this._state( - `sensor.nestquest_${e}_quests_remaining_today` + const e = this._state( + `sensor.nestquest_${t}_quests_remaining_today` ); - if (t) - return $(_(t.state, 0)); - const { due: n, completed: i } = this._childCounts(e); - return $(n - i); + if (e) + return x(y(e.state, 0)); + const { due: n, completed: i } = this._childCounts(t); + return x(n - i); } _partyCounts() { - const e = this._state( + const t = this._state( "sensor.nestquest_household_quests_due_today" - ), t = this._state( + ), e = this._state( "sensor.nestquest_household_quests_completed_today" ); - if (e || t) + if (t || e) return { - completed: $(_(t?.state, 0)), - due: $(_(e?.state, 0)) + completed: x(y(e?.state, 0)), + due: x(y(t?.state, 0)) }; const n = this._childSlug(), { due: i, completed: r } = this._childCounts(n); return { completed: r, due: i }; } _otherChildren() { - const e = this.hass?.states; - if (!e) + const t = this.hass?.states; + if (!t) return []; - const t = this._childSlug(), n = this._timeZone(), i = []; - for (const r of Object.keys(e)) { + const e = this._childSlug(), n = this._timeZone(), i = []; + for (const r of Object.keys(t)) { const o = /^sensor\.nestquest_(.+)_quests_due_today$/.exec(r); - if (!o || o[1] === "household" || o[1] === t) + if (!o || o[1] === "household" || o[1] === e) continue; - const l = o[1], a = e[r]?.attributes ?? {}; - let c = ""; - typeof a.child_name == "string" && a.child_name.trim() ? c = a.child_name.trim() : c = X(l); + const l = o[1], a = t[r]?.attributes ?? {}; + let p = ""; + typeof a.child_name == "string" && a.child_name.trim() ? p = a.child_name.trim() : p = X(l); let u = !0; if (typeof a.present == "boolean") u = a.present; else { - const y = this._state( + const _ = this._state( `binary_sensor.nestquest_${l}_present_today` ); - u = y === null || String(y.state ?? "").trim().toLowerCase() !== "off"; + u = _ === null || String(_.state ?? "").trim().toLowerCase() !== "off"; } const d = this._state( `sensor.nestquest_${l}_quests_completed_today` - ), f = $(_(e[r]?.state, 0)), h = $(_(d?.state, 0)); + ), f = x(y(t[r]?.state, 0)), h = x(y(d?.state, 0)); let m = null; if (!u) { - const y = this._state( + const _ = this._state( `binary_sensor.nestquest_${l}_present_today` - ), b = Ne( - y?.attributes?.next_present, + ), b = Nt( + _?.attributes?.next_present, n ); - m = b ? Dt(b, n) : null; + m = b ? De(b, n) : null; } i.push({ slug: l, - name: c, + name: p, present: u, due: f, completed: h, @@ -2636,9 +2704,9 @@ class nn extends C { } return i.sort((r, o) => r.name.localeCompare(o.name)); } - _renderHeader(e) { - const t = this._childSlug(), n = e.kind === "away", i = n ? e.name : this._childName(t) ?? (t ? X(t) : null), { due: r, completed: o } = this._childCounts(t), l = this._remaining(), a = this._partyCounts(), c = i ? `${i}'s Quest Log` : "Quest Log", u = (i?.charAt(0) || "?").toUpperCase(); - return p` + _renderHeader(t) { + const e = this._childSlug(), n = t.kind === "away", i = n ? t.name : this._childName(e) ?? (e ? X(e) : null), { due: r, completed: o } = this._childCounts(e), l = this._remaining(), a = this._partyCounts(), p = i ? `${i}'s Quest Log` : "Quest Log", u = (i?.charAt(0) || "?").toUpperCase(); + return c`
-

${c}

+

${p}

- ${Ee(this._now, this._timeZone())} · + ${Et(this._now, this._timeZone())} · ${n ? "On travels" : `${o} of ${r} claimed`}

- ${n ? g : p` + ${n ? g : c`
`; } - _renderColumn(e) { - const t = this._instances().filter( - (l) => l.window === e.key - ), n = t.filter((l) => l.state === "open").sort( + _renderColumn(t) { + const e = this._instances().filter( + (l) => l.window === t.key + ), n = e.filter((l) => l.state === "open").sort( (l, a) => (l.due_time ?? "99:99").localeCompare(a.due_time ?? "99:99") - ), i = t.filter( + ), i = e.filter( (l) => l.state === "completed" - ), r = t.length; + ), r = e.length; let o = g; if (r > 0) { - const a = 644 - (e.key === "afternoon" && this._otherChildren().length > 0 ? 160 : 0), c = Math.min( + const a = 644 - (t.key === "afternoon" && this._otherChildren().length > 0 ? 160 : 0), p = Math.min( 24, Math.max(8, Math.floor((a - r * 74) / Math.max(r - 1, 1))) ), u = Math.min( 116, - Math.max(58, Math.floor((a - (r - 1) * c) / r)) + Math.max(58, Math.floor((a - (r - 1) * p) / r)) ), d = Math.max(56, Math.min(72, u - 2)); - let f = `--nq-p-quest-gap: ${c}px; --nq-p-quest-min-height: ${u}px; --nq-p-button-height: ${d}px`; + let f = `--nq-p-quest-gap: ${p}px; --nq-p-quest-min-height: ${u}px; --nq-p-button-height: ${d}px`; if (r >= 5) { const h = Math.max(0, Math.min(22, Math.floor((u - d - 2) / 2))), m = Math.max(44, Math.min(64, u - 2 * h - 2)); f += `; --nq-p-quest-pad: ${h}px; --nq-p-tile-size: ${m}px`; } o = f; } - return p` + return c`
- ${e.icon} + ${t.icon}
- ${e.name} - ${e.range} + ${t.name} + ${t.range}
- ${i.length}/${t.length} + ${i.length}/${e.length}
- ${Ce( + ${Ct( n, (l) => l.id, (l) => this._renderQuest(l, !1, 0) )} - ${Ce( + ${Ct( i, (l) => l.id, (l, a) => this._renderQuest(l, !0, a) )} - ${e.key === "afternoon" ? this._renderRollup() : g} + ${t.key === "afternoon" ? this._renderRollup() : g}
`; } - _renderQuest(e, t, n) { - if (t) { - const o = Me[n % Me.length], l = e.completed_at ? Ht(e.completed_at, this._timeZone()) : ""; - return p` -
+ _renderQuest(t, e, n) { + if (e) { + const o = Mt[n % Mt.length], l = t.completed_at ? He(t.completed_at, this._timeZone()) : ""; + return c` +
- ${e.title} + ${t.title} ${l ? `Claimed ${l}` : "Claimed"} @@ -2746,34 +2814,34 @@ class nn extends C {
`; } - const i = jt(e.due_time), r = e.overdue ? { + const i = je(t.due_time), r = t.overdue ? { text: i ? `Overdue · due ${i}` : "Overdue", late: !0 } : { text: i ? `Due by ${i}` : "Due today", late: !1 }; - return p` + return c`
this._openConfirm(e.id)} + data-instance-id=${t.id} + aria-label="Complete ${t.title}" + @click=${() => this._openConfirm(t.id)} @keydown=${(o) => { - (o.key === "Enter" || o.key === " ") && (o.preventDefault(), this._openConfirm(e.id)); + (o.key === "Enter" || o.key === " ") && (o.preventDefault(), this._openConfirm(t.id)); }} >
- ${e.title} + ${t.title} ${r.text}
`; } + private _renderToast(): TemplateResult | typeof nothing { + if (this._toast === null) { + return nothing; + } + return html` +
${this._toast}
+ `; + } + private _renderMain(view: LogView): TemplateResult { switch (view.kind) { case "no-adventurer": @@ -1318,9 +1374,32 @@ export class NestQuestQuestLogCard extends LitElement { if (!Array.isArray(payload)) { return []; } - return payload + const instances = payload .map(toPanelInstance) .filter((instance): instance is PanelInstance => instance !== null); + if (this._optimistic.size === 0) { + return instances; + } + let settled = false; + for (const instance of instances) { + const stampedAt = this._optimistic.get(instance.id); + if (stampedAt === undefined) { + continue; + } + if (instance.state === "completed") { + // the backend has caught up; the real record replaces the overlay + this._optimistic.delete(instance.id); + settled = true; + continue; + } + instance.state = "completed"; + instance.overdue = false; + instance.completed_at = stampedAt; + } + if (settled) { + this._optimistic = new Map(this._optimistic); + } + return instances; } private _remaining(): number { @@ -1698,7 +1777,94 @@ export class NestQuestQuestLogCard extends LitElement { } private _confirmComplete(): void { + const instance = + this._confirm === null + ? undefined + : this._instances().find( + (candidate) => candidate.id === this._confirm + ); this._closeConfirm(); + if (!instance || instance.state !== "open") { + return; + } + this._completeQuest(instance); + } + + /** Seal first, ask the service second: the seal is stamped and the column + * re-sorted immediately (PANEL-SPEC §4); a service failure reverts the + * card and raises the parchment toast. */ + private async _completeQuest(instance: PanelInstance): Promise { + if (this._optimistic.has(instance.id)) { + return; + } + const stampedAt = new Date().toISOString(); + this._optimistic = new Map(this._optimistic).set(instance.id, stampedAt); + try { + await this._callCompleteQuest(instance); + } catch { + const reverted = new Map(this._optimistic); + reverted.delete(instance.id); + this._optimistic = reverted; + this._showToast( + "NestQuest could not set the seal just now. Please try again." + ); + } + } + + private async _callCompleteQuest(instance: PanelInstance): Promise { + const hass = this.hass as + | { + callService?: ( + this: unknown, + domain: string, + service: string, + data?: Record + ) => Promise; + } + | undefined; + if (typeof hass?.callService !== "function") { + throw new Error("Home Assistant is not connected"); + } + const actorChildId = this._actorChildId(instance); + if (actorChildId === null) { + throw new Error("The tapped adventurer is unknown"); + } + await hass.callService.call(hass, "nestquest", "complete_quest", { + instance_id: instance.id, + actor: "panel", + actor_child_id: actorChildId, + }); + } + + /** The tapped profile (decision 9): the instance's own child_id, falling + * back to the due sensor's child-level attribute. */ + private _actorChildId(instance: PanelInstance): number | null { + if (instance.child_id !== null) { + return instance.child_id; + } + const slug = this._childSlug(); + const fromSensor = asNumber( + this._state(`sensor.nestquest_${slug}_quests_due_today`)?.attributes + ?.child_id, + 0 + ); + return fromSensor > 0 ? fromSensor : null; + } + + private _showToast(message: string): void { + this._toast = message; + this._clearToastTimer(); + this._toastTimer = window.setTimeout(() => { + this._toastTimer = undefined; + this._toast = null; + }, 6000); + } + + private _clearToastTimer(): void { + if (this._toastTimer !== undefined) { + window.clearTimeout(this._toastTimer); + this._toastTimer = undefined; + } } private _armConfirmTimer(): void {