UNPKG

@thatopen/ui

Version:

Collection of web components (UI components) meant to be used, but not limited to, BIM applications.

1,654 lines 235 kB
var Us = Object.defineProperty; var Ws = (i, t, e) => t in i ? Us(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e; var at = (i, t, e) => (Ws(i, typeof t != "symbol" ? t + "" : t, e), e); const Bt = Math.min, et = Math.max, Ae = Math.round, ut = (i) => ({ x: i, y: i }), Ys = { left: "right", right: "left", bottom: "top", top: "bottom" }, Gs = { start: "end", end: "start" }; function nn(i, t, e) { return et(i, Bt(t, e)); } function ue(i, t) { return typeof i == "function" ? i(t) : i; } function it(i) { return i.split("-")[0]; } function He(i) { return i.split("-")[1]; } function Nn(i) { return i === "x" ? "y" : "x"; } function qn(i) { return i === "y" ? "height" : "width"; } const Qs = /* @__PURE__ */ new Set(["top", "bottom"]); function tt(i) { return Qs.has(it(i)) ? "y" : "x"; } function Vn(i) { return Nn(tt(i)); } function Ks(i, t, e) { e === void 0 && (e = !1); const n = He(i), s = Vn(i), r = qn(s); let o = s === "x" ? n === (e ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top"; return t.reference[r] > t.floating[r] && (o = Se(o)), [o, Se(o)]; } function Xs(i) { const t = Se(i); return [ri(i), t, ri(t)]; } function ri(i) { return i.replace(/start|end/g, (t) => Gs[t]); } const sn = ["left", "right"], rn = ["right", "left"], Js = ["top", "bottom"], Zs = ["bottom", "top"]; function tr(i, t, e) { switch (i) { case "top": case "bottom": return e ? t ? rn : sn : t ? sn : rn; case "left": case "right": return t ? Js : Zs; default: return []; } } function er(i, t, e, n) { const s = He(i); let r = tr(it(i), e === "start", n); return s && (r = r.map((o) => o + "-" + s), t && (r = r.concat(r.map(ri)))), r; } function Se(i) { return i.replace(/left|right|bottom|top/g, (t) => Ys[t]); } function ir(i) { return { top: 0, right: 0, bottom: 0, left: 0, ...i }; } function Un(i) { return typeof i != "number" ? ir(i) : { top: i, right: i, bottom: i, left: i }; } function Mt(i) { const { x: t, y: e, width: n, height: s } = i; return { width: n, height: s, top: e, left: t, right: t + n, bottom: e + s, x: t, y: e }; } function on(i, t, e) { let { reference: n, floating: s } = i; const r = tt(t), o = Vn(t), l = qn(o), a = it(t), c = r === "y", u = n.x + n.width / 2 - s.width / 2, h = n.y + n.height / 2 - s.height / 2, p = n[l] / 2 - s[l] / 2; let f; switch (a) { case "top": f = { x: u, y: n.y - s.height }; break; case "bottom": f = { x: u, y: n.y + n.height }; break; case "right": f = { x: n.x + n.width, y: h }; break; case "left": f = { x: n.x - s.width, y: h }; break; default: f = { x: n.x, y: n.y }; } switch (He(t)) { case "start": f[o] -= p * (e && c ? -1 : 1); break; case "end": f[o] += p * (e && c ? -1 : 1); break; } return f; } const nr = async (i, t, e) => { const { placement: n = "bottom", strategy: s = "absolute", middleware: r = [], platform: o } = e, l = r.filter(Boolean), a = await (o.isRTL == null ? void 0 : o.isRTL(t)); let c = await o.getElementRects({ reference: i, floating: t, strategy: s }), { x: u, y: h } = on(c, n, a), p = n, f = {}, g = 0; for (let v = 0; v < l.length; v++) { const { name: b, fn: $ } = l[v], { x: y, y: w, data: A, reset: k } = await $({ x: u, y: h, initialPlacement: n, placement: p, strategy: s, middlewareData: f, rects: c, platform: o, elements: { reference: i, floating: t } }); u = y ?? u, h = w ?? h, f = { ...f, [b]: { ...f[b], ...A } }, k && g <= 50 && (g++, typeof k == "object" && (k.placement && (p = k.placement), k.rects && (c = k.rects === !0 ? await o.getElementRects({ reference: i, floating: t, strategy: s }) : k.rects), { x: u, y: h } = on(c, p, a)), v = -1); } return { x: u, y: h, placement: p, strategy: s, middlewareData: f }; }; async function Wn(i, t) { var e; t === void 0 && (t = {}); const { x: n, y: s, platform: r, rects: o, elements: l, strategy: a } = i, { boundary: c = "clippingAncestors", rootBoundary: u = "viewport", elementContext: h = "floating", altBoundary: p = !1, padding: f = 0 } = ue(t, i), g = Un(f), b = l[p ? h === "floating" ? "reference" : "floating" : h], $ = Mt(await r.getClippingRect({ element: (e = await (r.isElement == null ? void 0 : r.isElement(b))) == null || e ? b : b.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(l.floating)), boundary: c, rootBoundary: u, strategy: a })), y = h === "floating" ? { x: n, y: s, width: o.floating.width, height: o.floating.height } : o.reference, w = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(l.floating)), A = await (r.isElement == null ? void 0 : r.isElement(w)) ? await (r.getScale == null ? void 0 : r.getScale(w)) || { x: 1, y: 1 } : { x: 1, y: 1 }, k = Mt(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({ elements: l, rect: y, offsetParent: w, strategy: a }) : y); return { top: ($.top - k.top + g.top) / A.y, bottom: (k.bottom - $.bottom + g.bottom) / A.y, left: ($.left - k.left + g.left) / A.x, right: (k.right - $.right + g.right) / A.x }; } const sr = function(i) { return i === void 0 && (i = {}), { name: "flip", options: i, async fn(t) { var e, n; const { placement: s, middlewareData: r, rects: o, initialPlacement: l, platform: a, elements: c } = t, { mainAxis: u = !0, crossAxis: h = !0, fallbackPlacements: p, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: g = "none", flipAlignment: v = !0, ...b } = ue(i, t); if ((e = r.arrow) != null && e.alignmentOffset) return {}; const $ = it(s), y = tt(l), w = it(l) === l, A = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), k = p || (w || !v ? [Se(l)] : Xs(l)), x = g !== "none"; !p && x && k.push(...er(l, v, g, A)); const I = [l, ...k], V = await Wn(t, b), U = []; let E = ((n = r.flip) == null ? void 0 : n.overflows) || []; if (u && U.push(V[$]), h) { const Q = Ks(s, o, A); U.push(V[Q[0]], V[Q[1]]); } if (E = [...E, { placement: s, overflows: U }], !U.every((Q) => Q <= 0)) { var It, Yt; const Q = (((It = r.flip) == null ? void 0 : It.index) || 0) + 1, xt = I[Q]; if (xt && (!(h === "alignment" ? y !== tt(xt) : !1) || // We leave the current main axis only if every placement on that axis // overflows the main axis. E.every((M) => M.overflows[0] > 0 && tt(M.placement) === y))) return { data: { index: Q, overflows: E }, reset: { placement: xt } }; let rt = (Yt = E.filter((Z) => Z.overflows[0] <= 0).sort((Z, M) => Z.overflows[1] - M.overflows[1])[0]) == null ? void 0 : Yt.placement; if (!rt) switch (f) { case "bestFit": { var Lt; const Z = (Lt = E.filter((M) => { if (x) { const ot = tt(M.placement); return ot === y || // Create a bias to the `y` side axis due to horizontal // reading directions favoring greater width. ot === "y"; } return !0; }).map((M) => [M.placement, M.overflows.filter((ot) => ot > 0).reduce((ot, Vs) => ot + Vs, 0)]).sort((M, ot) => M[1] - ot[1])[0]) == null ? void 0 : Lt[0]; Z && (rt = Z); break; } case "initialPlacement": rt = l; break; } if (s !== rt) return { reset: { placement: rt } }; } return {}; } }; }; function Yn(i) { const t = Bt(...i.map((r) => r.left)), e = Bt(...i.map((r) => r.top)), n = et(...i.map((r) => r.right)), s = et(...i.map((r) => r.bottom)); return { x: t, y: e, width: n - t, height: s - e }; } function rr(i) { const t = i.slice().sort((s, r) => s.y - r.y), e = []; let n = null; for (let s = 0; s < t.length; s++) { const r = t[s]; !n || r.y - n.y > n.height / 2 ? e.push([r]) : e[e.length - 1].push(r), n = r; } return e.map((s) => Mt(Yn(s))); } const or = function(i) { return i === void 0 && (i = {}), { name: "inline", options: i, async fn(t) { const { placement: e, elements: n, rects: s, platform: r, strategy: o } = t, { padding: l = 2, x: a, y: c } = ue(i, t), u = Array.from(await (r.getClientRects == null ? void 0 : r.getClientRects(n.reference)) || []), h = rr(u), p = Mt(Yn(u)), f = Un(l); function g() { if (h.length === 2 && h[0].left > h[1].right && a != null && c != null) return h.find((b) => a > b.left - f.left && a < b.right + f.right && c > b.top - f.top && c < b.bottom + f.bottom) || p; if (h.length >= 2) { if (tt(e) === "y") { const E = h[0], It = h[h.length - 1], Yt = it(e) === "top", Lt = E.top, Q = It.bottom, xt = Yt ? E.left : It.left, rt = Yt ? E.right : It.right, Z = rt - xt, M = Q - Lt; return { top: Lt, bottom: Q, left: xt, right: rt, width: Z, height: M, x: xt, y: Lt }; } const b = it(e) === "left", $ = et(...h.map((E) => E.right)), y = Bt(...h.map((E) => E.left)), w = h.filter((E) => b ? E.left === y : E.right === $), A = w[0].top, k = w[w.length - 1].bottom, x = y, I = $, V = I - x, U = k - A; return { top: A, bottom: k, left: x, right: I, width: V, height: U, x, y: A }; } return p; } const v = await r.getElementRects({ reference: { getBoundingClientRect: g }, floating: n.floating, strategy: o }); return s.reference.x !== v.reference.x || s.reference.y !== v.reference.y || s.reference.width !== v.reference.width || s.reference.height !== v.reference.height ? { reset: { rects: v } } : {}; } }; }, ar = /* @__PURE__ */ new Set(["left", "top"]); async function lr(i, t) { const { placement: e, platform: n, elements: s } = i, r = await (n.isRTL == null ? void 0 : n.isRTL(s.floating)), o = it(e), l = He(e), a = tt(e) === "y", c = ar.has(o) ? -1 : 1, u = r && a ? -1 : 1, h = ue(t, i); let { mainAxis: p, crossAxis: f, alignmentAxis: g } = typeof h == "number" ? { mainAxis: h, crossAxis: 0, alignmentAxis: null } : { mainAxis: h.mainAxis || 0, crossAxis: h.crossAxis || 0, alignmentAxis: h.alignmentAxis }; return l && typeof g == "number" && (f = l === "end" ? g * -1 : g), a ? { x: f * u, y: p * c } : { x: p * c, y: f * u }; } const Gn = function(i) { return { name: "offset", options: i, async fn(t) { var e, n; const { x: s, y: r, placement: o, middlewareData: l } = t, a = await lr(t, i); return o === ((e = l.offset) == null ? void 0 : e.placement) && (n = l.arrow) != null && n.alignmentOffset ? {} : { x: s + a.x, y: r + a.y, data: { ...a, placement: o } }; } }; }, cr = function(i) { return i === void 0 && (i = {}), { name: "shift", options: i, async fn(t) { const { x: e, y: n, placement: s } = t, { mainAxis: r = !0, crossAxis: o = !1, limiter: l = { fn: (b) => { let { x: $, y } = b; return { x: $, y }; } }, ...a } = ue(i, t), c = { x: e, y: n }, u = await Wn(t, a), h = tt(it(s)), p = Nn(h); let f = c[p], g = c[h]; if (r) { const b = p === "y" ? "top" : "left", $ = p === "y" ? "bottom" : "right", y = f + u[b], w = f - u[$]; f = nn(y, f, w); } if (o) { const b = h === "y" ? "top" : "left", $ = h === "y" ? "bottom" : "right", y = g + u[b], w = g - u[$]; g = nn(y, g, w); } const v = l.fn({ ...t, [p]: f, [h]: g }); return { ...v, data: { x: v.x - e, y: v.y - n, enabled: { [p]: r, [h]: o } } }; } }; }; function De() { return typeof window < "u"; } function ht(i) { return Qn(i) ? (i.nodeName || "").toLowerCase() : "#document"; } function j(i) { var t; return (i == null || (t = i.ownerDocument) == null ? void 0 : t.defaultView) || window; } function yt(i) { var t; return (t = (Qn(i) ? i.ownerDocument : i.document) || window.document) == null ? void 0 : t.documentElement; } function Qn(i) { return De() ? i instanceof Node || i instanceof j(i).Node : !1; } function K(i) { return De() ? i instanceof Element || i instanceof j(i).Element : !1; } function X(i) { return De() ? i instanceof HTMLElement || i instanceof j(i).HTMLElement : !1; } function an(i) { return !De() || typeof ShadowRoot > "u" ? !1 : i instanceof ShadowRoot || i instanceof j(i).ShadowRoot; } const ur = /* @__PURE__ */ new Set(["inline", "contents"]); function he(i) { const { overflow: t, overflowX: e, overflowY: n, display: s } = H(i); return /auto|scroll|overlay|hidden|clip/.test(t + n + e) && !ur.has(s); } const hr = /* @__PURE__ */ new Set(["table", "td", "th"]); function dr(i) { return hr.has(ht(i)); } const pr = [":popover-open", ":modal"]; function fr(i) { return pr.some((t) => { try { return i.matches(t); } catch { return !1; } }); } const mr = ["transform", "translate", "scale", "rotate", "perspective"], br = ["transform", "translate", "scale", "rotate", "perspective", "filter"], gr = ["paint", "layout", "strict", "content"]; function yi(i) { const t = _i(), e = K(i) ? H(i) : i; return mr.some((n) => e[n] ? e[n] !== "none" : !1) || (e.containerType ? e.containerType !== "normal" : !1) || !t && (e.backdropFilter ? e.backdropFilter !== "none" : !1) || !t && (e.filter ? e.filter !== "none" : !1) || br.some((n) => (e.willChange || "").includes(n)) || gr.some((n) => (e.contain || "").includes(n)); } function vr(i) { let t = jt(i); for (; X(t) && !Fe(t); ) { if (yi(t)) return t; if (fr(t)) return null; t = jt(t); } return null; } function _i() { return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none"); } const yr = /* @__PURE__ */ new Set(["html", "body", "#document"]); function Fe(i) { return yr.has(ht(i)); } function H(i) { return j(i).getComputedStyle(i); } function Ne(i) { return K(i) ? { scrollLeft: i.scrollLeft, scrollTop: i.scrollTop } : { scrollLeft: i.scrollX, scrollTop: i.scrollY }; } function jt(i) { if (ht(i) === "html") return i; const t = ( // Step into the shadow DOM of the parent of a slotted node. i.assignedSlot || // DOM Element detected. i.parentNode || // ShadowRoot detected. an(i) && i.host || // Fallback. yt(i) ); return an(t) ? t.host : t; } function Kn(i) { const t = jt(i); return Fe(t) ? i.ownerDocument ? i.ownerDocument.body : i.body : X(t) && he(t) ? t : Kn(t); } function Xn(i, t, e) { var n; t === void 0 && (t = []); const s = Kn(i), r = s === ((n = i.ownerDocument) == null ? void 0 : n.body), o = j(s); return r ? (_r(o), t.concat(o, o.visualViewport || [], he(s) ? s : [], [])) : t.concat(s, Xn(s, [])); } function _r(i) { return i.parent && Object.getPrototypeOf(i.parent) ? i.frameElement : null; } function Jn(i) { const t = H(i); let e = parseFloat(t.width) || 0, n = parseFloat(t.height) || 0; const s = X(i), r = s ? i.offsetWidth : e, o = s ? i.offsetHeight : n, l = Ae(e) !== r || Ae(n) !== o; return l && (e = r, n = o), { width: e, height: n, $: l }; } function Zn(i) { return K(i) ? i : i.contextElement; } function zt(i) { const t = Zn(i); if (!X(t)) return ut(1); const e = t.getBoundingClientRect(), { width: n, height: s, $: r } = Jn(t); let o = (r ? Ae(e.width) : e.width) / n, l = (r ? Ae(e.height) : e.height) / s; return (!o || !Number.isFinite(o)) && (o = 1), (!l || !Number.isFinite(l)) && (l = 1), { x: o, y: l }; } const wr = /* @__PURE__ */ ut(0); function ts(i) { const t = j(i); return !_i() || !t.visualViewport ? wr : { x: t.visualViewport.offsetLeft, y: t.visualViewport.offsetTop }; } function xr(i, t, e) { return t === void 0 && (t = !1), !e || t && e !== j(i) ? !1 : t; } function ee(i, t, e, n) { t === void 0 && (t = !1), e === void 0 && (e = !1); const s = i.getBoundingClientRect(), r = Zn(i); let o = ut(1); t && (n ? K(n) && (o = zt(n)) : o = zt(i)); const l = xr(r, e, n) ? ts(r) : ut(0); let a = (s.left + l.x) / o.x, c = (s.top + l.y) / o.y, u = s.width / o.x, h = s.height / o.y; if (r) { const p = j(r), f = n && K(n) ? j(n) : n; let g = p, v = g.frameElement; for (; v && n && f !== g; ) { const b = zt(v), $ = v.getBoundingClientRect(), y = H(v), w = $.left + (v.clientLeft + parseFloat(y.paddingLeft)) * b.x, A = $.top + (v.clientTop + parseFloat(y.paddingTop)) * b.y; a *= b.x, c *= b.y, u *= b.x, h *= b.y, a += w, c += A, g = j(v), v = g.frameElement; } } return Mt({ width: u, height: h, x: a, y: c }); } const $r = [":popover-open", ":modal"]; function es(i) { return $r.some((t) => { try { return i.matches(t); } catch { return !1; } }); } function Cr(i) { let { elements: t, rect: e, offsetParent: n, strategy: s } = i; const r = s === "fixed", o = yt(n), l = t ? es(t.floating) : !1; if (n === o || l && r) return e; let a = { scrollLeft: 0, scrollTop: 0 }, c = ut(1); const u = ut(0), h = X(n); if ((h || !h && !r) && ((ht(n) !== "body" || he(o)) && (a = Ne(n)), X(n))) { const p = ee(n); c = zt(n), u.x = p.x + n.clientLeft, u.y = p.y + n.clientTop; } return { width: e.width * c.x, height: e.height * c.y, x: e.x * c.x - a.scrollLeft * c.x + u.x, y: e.y * c.y - a.scrollTop * c.y + u.y }; } function Ar(i) { return Array.from(i.getClientRects()); } function is(i) { return ee(yt(i)).left + Ne(i).scrollLeft; } function Sr(i) { const t = yt(i), e = Ne(i), n = i.ownerDocument.body, s = et(t.scrollWidth, t.clientWidth, n.scrollWidth, n.clientWidth), r = et(t.scrollHeight, t.clientHeight, n.scrollHeight, n.clientHeight); let o = -e.scrollLeft + is(i); const l = -e.scrollTop; return H(n).direction === "rtl" && (o += et(t.clientWidth, n.clientWidth) - s), { width: s, height: r, x: o, y: l }; } function Er(i, t) { const e = j(i), n = yt(i), s = e.visualViewport; let r = n.clientWidth, o = n.clientHeight, l = 0, a = 0; if (s) { r = s.width, o = s.height; const c = _i(); (!c || c && t === "fixed") && (l = s.offsetLeft, a = s.offsetTop); } return { width: r, height: o, x: l, y: a }; } function kr(i, t) { const e = ee(i, !0, t === "fixed"), n = e.top + i.clientTop, s = e.left + i.clientLeft, r = X(i) ? zt(i) : ut(1), o = i.clientWidth * r.x, l = i.clientHeight * r.y, a = s * r.x, c = n * r.y; return { width: o, height: l, x: a, y: c }; } function ln(i, t, e) { let n; if (t === "viewport") n = Er(i, e); else if (t === "document") n = Sr(yt(i)); else if (K(t)) n = kr(t, e); else { const s = ts(i); n = { ...t, x: t.x - s.x, y: t.y - s.y }; } return Mt(n); } function ns(i, t) { const e = jt(i); return e === t || !K(e) || Fe(e) ? !1 : H(e).position === "fixed" || ns(e, t); } function Pr(i, t) { const e = t.get(i); if (e) return e; let n = Xn(i, []).filter((l) => K(l) && ht(l) !== "body"), s = null; const r = H(i).position === "fixed"; let o = r ? jt(i) : i; for (; K(o) && !Fe(o); ) { const l = H(o), a = yi(o); !a && l.position === "fixed" && (s = null), (r ? !a && !s : !a && l.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || he(o) && !a && ns(i, o)) ? n = n.filter((u) => u !== o) : s = l, o = jt(o); } return t.set(i, n), n; } function Or(i) { let { element: t, boundary: e, rootBoundary: n, strategy: s } = i; const o = [...e === "clippingAncestors" ? Pr(t, this._c) : [].concat(e), n], l = o[0], a = o.reduce((c, u) => { const h = ln(t, u, s); return c.top = et(h.top, c.top), c.right = Bt(h.right, c.right), c.bottom = Bt(h.bottom, c.bottom), c.left = et(h.left, c.left), c; }, ln(t, l, s)); return { width: a.right - a.left, height: a.bottom - a.top, x: a.left, y: a.top }; } function Tr(i) { const { width: t, height: e } = Jn(i); return { width: t, height: e }; } function Ir(i, t, e) { const n = X(t), s = yt(t), r = e === "fixed", o = ee(i, !0, r, t); let l = { scrollLeft: 0, scrollTop: 0 }; const a = ut(0); if (n || !n && !r) if ((ht(t) !== "body" || he(s)) && (l = Ne(t)), n) { const h = ee(t, !0, r, t); a.x = h.x + t.clientLeft, a.y = h.y + t.clientTop; } else s && (a.x = is(s)); const c = o.left + l.scrollLeft - a.x, u = o.top + l.scrollTop - a.y; return { x: c, y: u, width: o.width, height: o.height }; } function cn(i, t) { return !X(i) || H(i).position === "fixed" ? null : t ? t(i) : i.offsetParent; } function ss(i, t) { const e = j(i); if (!X(i) || es(i)) return e; let n = cn(i, t); for (; n && dr(n) && H(n).position === "static"; ) n = cn(n, t); return n && (ht(n) === "html" || ht(n) === "body" && H(n).position === "static" && !yi(n)) ? e : n || vr(i) || e; } const Lr = async function(i) { const t = this.getOffsetParent || ss, e = this.getDimensions; return { reference: Ir(i.reference, await t(i.floating), i.strategy), floating: { x: 0, y: 0, ...await e(i.floating) } }; }; function Rr(i) { return H(i).direction === "rtl"; } const zr = { convertOffsetParentRelativeRectToViewportRelativeRect: Cr, getDocumentElement: yt, getClippingRect: Or, getOffsetParent: ss, getElementRects: Lr, getClientRects: Ar, getDimensions: Tr, getScale: zt, isElement: K, isRTL: Rr }, rs = cr, os = sr, as = or, ls = (i, t, e) => { const n = /* @__PURE__ */ new Map(), s = { platform: zr, ...e }, r = { ...s.platform, _c: n }; return nr(i, t, { ...s, platform: r }); }; /** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const xe = globalThis, wi = xe.ShadowRoot && (xe.ShadyCSS === void 0 || xe.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, xi = Symbol(), un = /* @__PURE__ */ new WeakMap(); let cs = class { constructor(t, e, n) { if (this._$cssResult$ = !0, n !== xi) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); this.cssText = t, this.t = e; } get styleSheet() { let t = this.o; const e = this.t; if (wi && t === void 0) { const n = e !== void 0 && e.length === 1; n && (t = un.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), n && un.set(e, t)); } return t; } toString() { return this.cssText; } }; const Br = (i) => new cs(typeof i == "string" ? i : i + "", void 0, xi), S = (i, ...t) => { const e = i.length === 1 ? i[0] : t.reduce((n, s, 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."); })(s) + i[r + 1], i[0]); return new cs(e, i, xi); }, Mr = (i, t) => { if (wi) i.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet); else for (const e of t) { const n = document.createElement("style"), s = xe.litNonce; s !== void 0 && n.setAttribute("nonce", s), n.textContent = e.cssText, i.appendChild(n); } }, hn = wi ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((t) => { let e = ""; for (const n of t.cssRules) e += n.cssText; return Br(e); })(i) : i; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const { is: jr, defineProperty: Hr, getOwnPropertyDescriptor: Dr, getOwnPropertyNames: Fr, getOwnPropertySymbols: Nr, getPrototypeOf: qr } = Object, ct = globalThis, dn = ct.trustedTypes, Vr = dn ? dn.emptyScript : "", Ke = ct.reactiveElementPolyfillSupport, Kt = (i, t) => i, Ee = { toAttribute(i, t) { switch (t) { case Boolean: i = i ? Vr : null; break; case Object: case Array: i = i == null ? i : JSON.stringify(i); } return i; }, fromAttribute(i, t) { let e = i; switch (t) { case Boolean: e = i !== null; break; case Number: e = i === null ? null : Number(i); break; case Object: case Array: try { e = JSON.parse(i); } catch { e = null; } } return e; } }, $i = (i, t) => !jr(i, t), pn = { attribute: !0, type: String, converter: Ee, reflect: !1, useDefault: !1, hasChanged: $i }; Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), ct.litPropertyMetadata ?? (ct.litPropertyMetadata = /* @__PURE__ */ new WeakMap()); let Rt = class extends HTMLElement { static addInitializer(t) { this._$Ei(), (this.l ?? (this.l = [])).push(t); } static get observedAttributes() { return this.finalize(), this._$Eh && [...this._$Eh.keys()]; } static createProperty(t, e = pn) { 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 = Symbol(), s = this.getPropertyDescriptor(t, n, e); s !== void 0 && Hr(this.prototype, t, s); } } static getPropertyDescriptor(t, e, n) { const { get: s, set: r } = Dr(this.prototype, t) ?? { get() { return this[e]; }, set(o) { this[e] = o; } }; return { get: s, set(o) { const l = s == null ? void 0 : s.call(this); r == null || r.call(this, o), this.requestUpdate(t, l, n); }, configurable: !0, enumerable: !0 }; } static getPropertyOptions(t) { return this.elementProperties.get(t) ?? pn; } static _$Ei() { if (this.hasOwnProperty(Kt("elementProperties"))) return; const t = qr(this); t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties); } static finalize() { if (this.hasOwnProperty(Kt("finalized"))) return; if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(Kt("properties"))) { const e = this.properties, n = [...Fr(e), ...Nr(e)]; for (const s of n) this.createProperty(s, e[s]); } const t = this[Symbol.metadata]; if (t !== null) { const e = litPropertyMetadata.get(t); if (e !== void 0) for (const [n, s] of e) this.elementProperties.set(n, s); } this._$Eh = /* @__PURE__ */ new Map(); for (const [e, n] of this.elementProperties) { const s = this._$Eu(e, n); s !== void 0 && this._$Eh.set(s, e); } this.elementStyles = this.finalizeStyles(this.styles); } static finalizeStyles(t) { const e = []; if (Array.isArray(t)) { const n = new Set(t.flat(1 / 0).reverse()); for (const s of n) e.unshift(hn(s)); } else t !== void 0 && e.push(hn(t)); return e; } 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() { var t; this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this)); } addController(t) { var e; (this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t)); } removeController(t) { var e; (e = this._$EO) == null || e.delete(t); } _$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 t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); return Mr(t, this.constructor.elementStyles), t; } connectedCallback() { var t; this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => { var n; return (n = e.hostConnected) == null ? void 0 : n.call(e); }); } enableUpdating(t) { } disconnectedCallback() { var t; (t = this._$EO) == null || t.forEach((e) => { var n; return (n = e.hostDisconnected) == null ? void 0 : n.call(e); }); } attributeChangedCallback(t, e, n) { this._$AK(t, n); } _$ET(t, e) { var r; const n = this.constructor.elementProperties.get(t), s = this.constructor._$Eu(t, n); if (s !== void 0 && n.reflect === !0) { const o = (((r = n.converter) == null ? void 0 : r.toAttribute) !== void 0 ? n.converter : Ee).toAttribute(e, n.type); this._$Em = t, o == null ? this.removeAttribute(s) : this.setAttribute(s, o), this._$Em = null; } } _$AK(t, e) { var r, o; const n = this.constructor, s = n._$Eh.get(t); if (s !== void 0 && this._$Em !== s) { const l = n.getPropertyOptions(s), a = typeof l.converter == "function" ? { fromAttribute: l.converter } : ((r = l.converter) == null ? void 0 : r.fromAttribute) !== void 0 ? l.converter : Ee; this._$Em = s, this[s] = a.fromAttribute(e, l.type) ?? ((o = this._$Ej) == null ? void 0 : o.get(s)) ?? null, this._$Em = null; } } requestUpdate(t, e, n) { var s; if (t !== void 0) { const r = this.constructor, o = this[t]; if (n ?? (n = r.getPropertyOptions(t)), !((n.hasChanged ?? $i)(o, e) || n.useDefault && n.reflect && o === ((s = this._$Ej) == null ? void 0 : s.get(t)) && !this.hasAttribute(r._$Eu(t, n)))) return; this.C(t, e, n); } this.isUpdatePending === !1 && (this._$ES = this._$EP()); } C(t, e, { useDefault: n, reflect: s, wrapped: r }, o) { n && !(this._$Ej ?? (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)), s === !0 && this._$Em !== t && (this._$Eq ?? (this._$Eq = /* @__PURE__ */ new Set())).add(t)); } async _$EP() { this.isUpdatePending = !0; try { await this._$ES; } catch (e) { Promise.reject(e); } const t = this.scheduleUpdate(); return t != null && await t, !this.isUpdatePending; } scheduleUpdate() { return this.performUpdate(); } performUpdate() { var n; if (!this.isUpdatePending) return; if (!this.hasUpdated) { if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) { for (const [r, o] of this._$Ep) this[r] = o; this._$Ep = void 0; } const s = this.constructor.elementProperties; if (s.size > 0) for (const [r, o] of s) { const { wrapped: l } = o, a = this[r]; l !== !0 || this._$AL.has(r) || a === void 0 || this.C(r, void 0, o, a); } } let t = !1; const e = this._$AL; try { t = this.shouldUpdate(e), t ? (this.willUpdate(e), (n = this._$EO) == null || n.forEach((s) => { var r; return (r = s.hostUpdate) == null ? void 0 : r.call(s); }), this.update(e)) : this._$EM(); } catch (s) { throw t = !1, this._$EM(), s; } t && this._$AE(e); } willUpdate(t) { } _$AE(t) { var e; (e = this._$EO) == null || e.forEach((n) => { var s; return (s = n.hostUpdated) == null ? void 0 : s.call(n); }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t); } _$EM() { this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1; } get updateComplete() { return this.getUpdateComplete(); } getUpdateComplete() { return this._$ES; } shouldUpdate(t) { return !0; } update(t) { this._$Eq && (this._$Eq = this._$Eq.forEach((e) => this._$ET(e, this[e]))), this._$EM(); } updated(t) { } firstUpdated(t) { } }; Rt.elementStyles = [], Rt.shadowRootOptions = { mode: "open" }, Rt[Kt("elementProperties")] = /* @__PURE__ */ new Map(), Rt[Kt("finalized")] = /* @__PURE__ */ new Map(), Ke == null || Ke({ ReactiveElement: Rt }), (ct.reactiveElementVersions ?? (ct.reactiveElementVersions = [])).push("2.1.0"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const Xt = globalThis, ke = Xt.trustedTypes, fn = ke ? ke.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, us = "$lit$", lt = `lit$${Math.random().toFixed(9).slice(2)}$`, hs = "?" + lt, Ur = `<${hs}>`, kt = document, ie = () => kt.createComment(""), ne = (i) => i === null || typeof i != "object" && typeof i != "function", Ci = Array.isArray, Wr = (i) => Ci(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", Xe = `[ \f\r]`, Gt = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, mn = /-->/g, bn = />/g, $t = RegExp(`>|${Xe}(?:([^\\s"'>=/]+)(${Xe}*=${Xe}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"), gn = /'/g, vn = /"/g, ds = /^(?:script|style|textarea|title)$/i, Yr = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }), m = Yr(1), Pt = Symbol.for("lit-noChange"), P = Symbol.for("lit-nothing"), yn = /* @__PURE__ */ new WeakMap(), Ct = kt.createTreeWalker(kt, 129); function ps(i, t) { if (!Ci(i) || !i.hasOwnProperty("raw")) throw Error("invalid template strings array"); return fn !== void 0 ? fn.createHTML(t) : t; } const Gr = (i, t) => { const e = i.length - 1, n = []; let s, r = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = Gt; for (let l = 0; l < e; l++) { const a = i[l]; let c, u, h = -1, p = 0; for (; p < a.length && (o.lastIndex = p, u = o.exec(a), u !== null); ) p = o.lastIndex, o === Gt ? u[1] === "!--" ? o = mn : u[1] !== void 0 ? o = bn : u[2] !== void 0 ? (ds.test(u[2]) && (s = RegExp("</" + u[2], "g")), o = $t) : u[3] !== void 0 && (o = $t) : o === $t ? u[0] === ">" ? (o = s ?? Gt, h = -1) : u[1] === void 0 ? h = -2 : (h = o.lastIndex - u[2].length, c = u[1], o = u[3] === void 0 ? $t : u[3] === '"' ? vn : gn) : o === vn || o === gn ? o = $t : o === mn || o === bn ? o = Gt : (o = $t, s = void 0); const f = o === $t && i[l + 1].startsWith("/>") ? " " : ""; r += o === Gt ? a + Ur : h >= 0 ? (n.push(c), a.slice(0, h) + us + a.slice(h) + lt + f) : a + lt + (h === -2 ? l : f); } return [ps(i, r + (i[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), n]; }; class se { constructor({ strings: t, _$litType$: e }, n) { let s; this.parts = []; let r = 0, o = 0; const l = t.length - 1, a = this.parts, [c, u] = Gr(t, e); if (this.el = se.createElement(c, n), Ct.currentNode = this.el.content, e === 2 || e === 3) { const h = this.el.content.firstChild; h.replaceWith(...h.childNodes); } for (; (s = Ct.nextNode()) !== null && a.length < l; ) { if (s.nodeType === 1) { if (s.hasAttributes()) for (const h of s.getAttributeNames()) if (h.endsWith(us)) { const p = u[o++], f = s.getAttribute(h).split(lt), g = /([.?@])?(.*)/.exec(p); a.push({ type: 1, index: r, name: g[2], strings: f, ctor: g[1] === "." ? Kr : g[1] === "?" ? Xr : g[1] === "@" ? Jr : qe }), s.removeAttribute(h); } else h.startsWith(lt) && (a.push({ type: 6, index: r }), s.removeAttribute(h)); if (ds.test(s.tagName)) { const h = s.textContent.split(lt), p = h.length - 1; if (p > 0) { s.textContent = ke ? ke.emptyScript : ""; for (let f = 0; f < p; f++) s.append(h[f], ie()), Ct.nextNode(), a.push({ type: 2, index: ++r }); s.append(h[p], ie()); } } } else if (s.nodeType === 8) if (s.data === hs) a.push({ type: 2, index: r }); else { let h = -1; for (; (h = s.data.indexOf(lt, h + 1)) !== -1; ) a.push({ type: 7, index: r }), h += lt.length - 1; } r++; } } static createElement(t, e) { const n = kt.createElement("template"); return n.innerHTML = t, n; } } function Ht(i, t, e = i, n) { var o, l; if (t === Pt) return t; let s = n !== void 0 ? (o = e._$Co) == null ? void 0 : o[n] : e._$Cl; const r = ne(t) ? void 0 : t._$litDirective$; return (s == null ? void 0 : s.constructor) !== r && ((l = s == null ? void 0 : s._$AO) == null || l.call(s, !1), r === void 0 ? s = void 0 : (s = new r(i), s._$AT(i, e, n)), n !== void 0 ? (e._$Co ?? (e._$Co = []))[n] = s : e._$Cl = s), s !== void 0 && (t = Ht(i, s._$AS(i, t.values), s, n)), t; } class Qr { constructor(t, e) { this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e; } get parentNode() { return this._$AM.parentNode; } get _$AU() { return this._$AM._$AU; } u(t) { const { el: { content: e }, parts: n } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? kt).importNode(e, !0); Ct.currentNode = s; let r = Ct.nextNode(), o = 0, l = 0, a = n[0]; for (; a !== void 0; ) { if (o === a.index) { let c; a.type === 2 ? c = new de(r, r.nextSibling, this, t) : a.type === 1 ? c = new a.ctor(r, a.name, a.strings, this, t) : a.type === 6 && (c = new Zr(r, this, t)), this._$AV.push(c), a = n[++l]; } o !== (a == null ? void 0 : a.index) && (r = Ct.nextNode(), o++); } return Ct.currentNode = kt, s; } 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 de { get _$AU() { var t; return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv; } constructor(t, e, n, s) { this.type = 2, this._$AH = P, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = n, this.options = s, this._$Cv = (s == null ? void 0 : s.isConnected) ?? !0; } get parentNode() { let t = this._$AA.parentNode; const e = this._$AM; return e !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = e.parentNode), t; } get startNode() { return this._$AA; } get endNode() { return this._$AB; } _$AI(t, e = this) { t = Ht(this, t, e), ne(t) ? t === P || t == null || t === "" ? (this._$AH !== P && this._$AR(), this._$AH = P) : t !== this._$AH && t !== Pt && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Wr(t) ? this.k(t) : this._(t); } O(t) { return this._$AA.parentNode.insertBefore(t, this._$AB); } T(t) { this._$AH !== t && (this._$AR(), this._$AH = this.O(t)); } _(t) { this._$AH !== P && ne(this._$AH) ? this._$AA.nextSibling.data = t : this.T(kt.createTextNode(t)), this._$AH = t; } $(t) { var r; const { values: e, _$litType$: n } = t, s = typeof n == "number" ? this._$AC(t) : (n.el === void 0 && (n.el = se.createElement(ps(n.h, n.h[0]), this.options)), n); if (((r = this._$AH) == null ? void 0 : r._$AD) === s) this._$AH.p(e); else { const o = new Qr(s, this), l = o.u(this.options); o.p(e), this.T(l), this._$AH = o; } } _$AC(t) { let e = yn.get(t.strings); return e === void 0 && yn.set(t.strings, e = new se(t)), e; } k(t) { Ci(this._$AH) || (this._$AH = [], this._$AR()); const e = this._$AH; let n, s = 0; for (const r of t) s === e.length ? e.push(n = new de(this.O(ie()), this.O(ie()), this, this.options)) : n = e[s], n._$AI(r), s++; s < e.length && (this._$AR(n && n._$AB.nextSibling, s), e.length = s); } _$AR(t = this._$AA.nextSibling, e) { var n; for ((n = this._$AP) == null ? void 0 : n.call(this, !1, !0, e); t && t !== this._$AB; ) { const s = t.nextSibling; t.remove(), t = s; } } setConnected(t) { var e; this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t)); } } class qe { get tagName() { return this.element.tagName; } get _$AU() { return this._$AM._$AU; } constructor(t, e, n, s, r) { this.type = 1, this._$AH = P, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = r, n.length > 2 || n[0] !== "" || n[1] !== "" ? (this._$AH = Array(n.length - 1).fill(new String()), this.strings = n) : this._$AH = P; } _$AI(t, e = this, n, s) { const r = this.strings; let o = !1; if (r === void 0) t = Ht(this, t, e, 0), o = !ne(t) || t !== this._$AH && t !== Pt, o && (this._$AH = t); else { const l = t; let a, c; for (t = r[0], a = 0; a < r.length - 1; a++) c = Ht(this, l[n + a], e, a), c === Pt && (c = this._$AH[a]), o || (o = !ne(c) || c !== this._$AH[a]), c === P ? t = P : t !== P && (t += (c ?? "") + r[a + 1]), this._$AH[a] = c; } o && !s && this.j(t); } j(t) { t === P ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? ""); } } class Kr extends qe { constructor() { super(...arguments), this.type = 3; } j(t) { this.element[this.name] = t === P ? void 0 : t; } } class Xr extends qe { constructor() { super(...arguments), this.type = 4; } j(t) { this.element.toggleAttribute(this.name, !!t && t !== P); } } class Jr extends qe { constructor(t, e, n, s, r) { super(t, e, n, s, r), this.type = 5; } _$AI(t, e = this) { if ((t = Ht(this, t, e, 0) ?? P) === Pt) return; const n = this._$AH, s = t === P && n !== P || t.capture !== n.capture || t.once !== n.once || t.passive !== n.passive, r = t !== P && (n === P || s); s && this.element.removeEventListener(this.name, this, n), r && this.element.addEventListener(this.name, this, t), this._$AH = t; } handleEvent(t) { var e; typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t); } } class Zr { 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(t) { Ht(this, t); } } const Je = Xt.litHtmlPolyfillSupport; Je == null || Je(se, de), (Xt.litHtmlVersions ?? (Xt.litHtmlVersions = [])).push("3.3.0"); const Dt = (i, t, e) => { const n = (e == null ? void 0 : e.renderBefore) ?? t; let s = n._$litPart$; if (s === void 0) { const r = (e == null ? void 0 : e.renderBefore) ?? null; n._$litPart$ = s = new de(t.insertBefore(ie(), r), r, void 0, e ?? {}); } return s._$AI(i), s; }; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const At = globalThis; let C = class extends Rt { constructor() { super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0; } createRenderRoot() { var e; const t = super.createRenderRoot(); return (e = this.renderOptions).renderBefore ?? (e.renderBefore = t.firstChild), t; } update(t) { const e = this.render(); this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Dt(e, this.renderRoot, this.renderOptions); } connectedCallback() { var t; super.connectedCallback(), (t = this._$Do) == null || t.setConnected(!0); } disconnectedCallback() { var t; super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1); } render() { return Pt; } }; var Fn; C._$litElement$ = !0, C.finalized = !0, (Fn = At.litElementHydrateSupport) == null || Fn.call(At, { LitElement: C }); const Ze = At.litElementPolyfillSupport; Ze == null || Ze({ LitElement: C }); (At.litElementVersions ?? (At.litElementVersions = [])).push("4.2.0"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const to = { attribute: !0, type: String, converter: Ee, reflect: !1, hasChanged: $i }, eo = (i = to, t, e) => { const { kind: n, metadata: s } = e; let r = globalThis.litPropertyMetadata.get(s); if (r === void 0 && globalThis.litPropertyMetadata.set(s, r = /* @__PURE__ */ new Map()), n === "setter" && ((i = Object.create(i)).wrapped = !0), r.set(e.name, i), n === "accessor") { const { name: o } = e; return { set(l) { const a = t.get.call(this); t.set.call(this, l), this.requestUpdate(o, a, i); }, init(l) { return l !== void 0 && this.C(o, void 0, i, l), l; } }; } if (n === "setter") { const { name: o } = e; return function(l) { const a = this[o]; t.call(this, l), this.requestUpdate(o, a, i); }; } throw Error("Unsupported decorator location: " + n); }; function d(i) { return (t, e) => typeof e == "object" ? eo(i, t, e) : ((n, s, r) => { const o = s.hasOwnProperty(r); return s.constructor.createProperty(r, n), o ? Object.getOwnPropertyDescriptor(s, r) : void 0; })(i, t, e); } /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ function Ut(i) { return d({ ...i, state: !0, attribute: !1 }); } /** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const io = (i) => i.strings === void 0; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const fs = { ATTRIBUTE: 1, CHILD: 2 }, ms = (i) => (...t) => ({ _$litDirective$: i, values: t }); let bs = class { constructor(t) { } get _$AU() { return this._$AM._$AU; } _$AT(t, e, n) { this._$Ct = t, this._$AM = e, this._$Ci = n; } _$AS(t, e) { return this.update(t, e); } update(t, e) { return this.render(...e); } }; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const Jt = (i, t) => { var n; const e = i._$AN; if (e === void 0) return !1; for (const s of e) (n = s._$AO) == null || n.call(s, t, !1), Jt(s, t); return !0; }, Pe = (i) => { let t, e; do { if ((t = i._$AM) === void 0) break; e = t._$AN, e.delete(i), i = t; } while ((e == null ? void 0 : e.size) === 0); }, gs = (i) => { for (let t; t = i._$AM; i = t) { let e = t._$AN; if (e === void 0) t._$AN = e = /* @__PURE__ */ new Set(); else if (e.has(i)) break; e.add(i), ro(t); } }; function no(i) { this._$AN !== void 0 ? (Pe(this), this._$AM = i, gs(this)) : this._$AM = i; } function so(i, t = !1, e = 0) { const n = this._$AH, s = this._$AN; if (s !== void 0 && s.size !== 0) if (t) if (Array.isArray(n)) for (let r = e; r < n.length; r++) Jt(n[r], !1), Pe(n[r]); else n != null && (Jt(n, !1), Pe(n)); else Jt(this, i); } const ro = (i) => { i.type == fs.CHILD && (i._$AP ?? (i._$AP = so), i._$AQ ?? (i._$AQ = no)); }; class oo extends bs { constructor() { super(...arguments), this._$AN = void 0; } _$AT(t, e, n) { super._$AT(t, e, n), gs(this), this.isConnected = t._$AU; } _$AO(t, e = !0) { var n, s; t !== this.isConnected && (this.isConnected = t, t ? (n = this.reconnected) == null || n.call(this) : (s = this.disconnected) == null || s.call(this)), e && (Jt(this, t), Pe(this)); } setValue(t) { if (io(this._$Ct)) this._$Ct._$AI(t, this); else { const e = [...this._$Ct._$AH]; e[this._$Ci] = t, this._$Ct._$AI(e, this, 0); } } disconnected() { } reconnected() { } } /** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const Ft = () => new ao(); class ao { } const ti = /* @__PURE__ */ new WeakMap(), Nt = ms(class extends oo { render(i) { return P; } update(i, [t]) { var n; const e = t !== this.G; return e && this.G !== void 0 && this.rt(void 0), (e