From 5aac07b80fdd7b2d3064c6da4c8e2b21fc2805e4 Mon Sep 17 00:00:00 2001 From: antmicrobot Date: Thu, 28 Nov 2024 11:08:14 +0000 Subject: [PATCH] deploy: ac681f343990881480dae0d6e94677c69681e167 --- MystEditor.js | 61242 +++++++++++++++++++------------------- docs/collaboration.html | 2 +- docs/comments.html | 2 +- docs/genindex.html | 2 +- docs/index.html | 2 +- docs/introduction.html | 2 +- docs/mermaid.html | 2 +- docs/rich-links.html | 2 +- docs/topbar.html | 2 +- 9 files changed, 31087 insertions(+), 30171 deletions(-) diff --git a/MystEditor.js b/MystEditor.js index 6128812..7243b95 100644 --- a/MystEditor.js +++ b/MystEditor.js @@ -1,56 +1,56 @@ -var Jye = Object.defineProperty; -var e2e = (t, e, r) => e in t ? Jye(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r; -var Or = (t, e, r) => (e2e(t, typeof e != "symbol" ? e + "" : e, r), r), t2e = (t, e, r) => { +var V2e = Object.defineProperty; +var q2e = (t, e, r) => e in t ? V2e(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r; +var Mr = (t, e, r) => (q2e(t, typeof e != "symbol" ? e + "" : e, r), r), Y2e = (t, e, r) => { if (!e.has(t)) throw TypeError("Cannot " + r); }; -var Tw = (t, e, r) => { +var Kw = (t, e, r) => { if (e.has(t)) throw TypeError("Cannot add the same private member more than once"); e instanceof WeakSet ? e.add(t) : e.set(t, r); }; -var V1 = (t, e, r) => (t2e(t, e, "access private method"), r); -var cx, Dt, WZ, GZ, Td, Z$, XZ, GA, HZ, $y = {}, ZZ = [], r2e = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, ZS = Array.isArray; -function Tu(t, e) { +var dv = (t, e, r) => (Y2e(t, e, "access private method"), r); +var Dx, Ut, Ej, _j, qd, RB, Aj, O7, Lj, o2 = {}, Rj = [], W2e = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, kT = Array.isArray; +function Vu(t, e) { for (var r in e) t[r] = e[r]; return t; } -function jZ(t) { +function Mj(t) { var e = t.parentNode; e && e.removeChild(t); } -function Fc(t, e, r) { +function iu(t, e, r) { var n, i, s, a = {}; for (s in e) s == "key" ? n = e[s] : s == "ref" ? i = e[s] : a[s] = e[s]; - if (arguments.length > 2 && (a.children = arguments.length > 3 ? cx.call(arguments, 2) : r), typeof t == "function" && t.defaultProps != null) + if (arguments.length > 2 && (a.children = arguments.length > 3 ? Dx.call(arguments, 2) : r), typeof t == "function" && t.defaultProps != null) for (s in t.defaultProps) a[s] === void 0 && (a[s] = t.defaultProps[s]); - return sy(t, a, n, i, null); + return Ay(t, a, n, i, null); } -function sy(t, e, r, n, i) { - var s = { type: t, props: e, key: r, ref: n, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: i == null ? ++WZ : i, __i: -1, __u: 0 }; - return i == null && Dt.vnode != null && Dt.vnode(s), s; +function Ay(t, e, r, n, i) { + var s = { type: t, props: e, key: r, ref: n, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: i == null ? ++Ej : i, __i: -1, __u: 0 }; + return i == null && Ut.vnode != null && Ut.vnode(s), s; } -function n2e() { +function G2e() { return { current: null }; } -function zc(t) { +function su(t) { return t.children; } -function Sl(t, e) { +function Ul(t, e) { this.props = t, this.context = e; } -function Ng(t, e) { +function rm(t, e) { if (e == null) - return t.__ ? Ng(t.__, t.__i + 1) : null; + return t.__ ? rm(t.__, t.__i + 1) : null; for (var r; e < t.__k.length; e++) if ((r = t.__k[e]) != null && r.__e != null) return r.__e; - return typeof t.type == "function" ? Ng(t) : null; + return typeof t.type == "function" ? rm(t) : null; } -function KZ(t) { +function Dj(t) { var e, r; if ((t = t.__) != null && t.__c != null) { for (t.__e = t.__c.base = null, e = 0; e < t.__k.length; e++) @@ -58,47 +58,47 @@ function KZ(t) { t.__e = t.__c.base = r.__e; break; } - return KZ(t); + return Dj(t); } } -function XA(t) { - (!t.__d && (t.__d = !0) && Td.push(t) && !N5.__r++ || Z$ !== Dt.debounceRendering) && ((Z$ = Dt.debounceRendering) || XZ)(N5); +function k7(t) { + (!t.__d && (t.__d = !0) && qd.push(t) && !lk.__r++ || RB !== Ut.debounceRendering) && ((RB = Ut.debounceRendering) || Aj)(lk); } -function N5() { +function lk() { var t, e, r, n, i, s, a, o, l; - for (Td.sort(GA); t = Td.shift(); ) - t.__d && (e = Td.length, n = void 0, s = (i = (r = t).__v).__e, o = [], l = [], (a = r.__P) && ((n = Tu({}, i)).__v = i.__v + 1, Dt.vnode && Dt.vnode(n), rM(a, n, i, r.__n, a.ownerSVGElement !== void 0, 32 & i.__u ? [s] : null, o, s == null ? Ng(i) : s, !!(32 & i.__u), l), n.__.__k[n.__i] = n, tj(o, n, l), n.__e != s && KZ(n)), Td.length > e && Td.sort(GA)); - N5.__r = 0; -} -function JZ(t, e, r, n, i, s, a, o, l, u, h) { - var f, d, p, g, m, v = n && n.__k || ZZ, y = e.length; - for (r.__d = l, i2e(r, e, v), l = r.__d, f = 0; f < y; f++) - (p = r.__k[f]) != null && typeof p != "boolean" && typeof p != "function" && (d = p.__i === -1 ? $y : v[p.__i] || $y, p.__i = f, rM(t, p, d, i, s, a, o, l, u, h), g = p.__e, p.ref && d.ref != p.ref && (d.ref && nM(d.ref, null, p), h.push(p.ref, p.__c || g, p)), m == null && g != null && (m = g), 65536 & p.__u || d.__k === p.__k ? l = ej(p, l, t) : typeof p.type == "function" && p.__d !== void 0 ? l = p.__d : g && (l = g.nextSibling), p.__d = void 0, p.__u &= -196609); + for (qd.sort(O7); t = qd.shift(); ) + t.__d && (e = qd.length, n = void 0, s = (i = (r = t).__v).__e, o = [], l = [], (a = r.__P) && ((n = Vu({}, i)).__v = i.__v + 1, Ut.vnode && Ut.vnode(n), RM(a, n, i, r.__n, a.ownerSVGElement !== void 0, 32 & i.__u ? [s] : null, o, s == null ? rm(i) : s, !!(32 & i.__u), l), n.__.__k[n.__i] = n, Ij(o, n, l), n.__e != s && Dj(n)), qd.length > e && qd.sort(O7)); + lk.__r = 0; +} +function Pj(t, e, r, n, i, s, a, o, l, u, h) { + var f, d, p, g, m, v = n && n.__k || Rj, y = e.length; + for (r.__d = l, X2e(r, e, v), l = r.__d, f = 0; f < y; f++) + (p = r.__k[f]) != null && typeof p != "boolean" && typeof p != "function" && (d = p.__i === -1 ? o2 : v[p.__i] || o2, p.__i = f, RM(t, p, d, i, s, a, o, l, u, h), g = p.__e, p.ref && d.ref != p.ref && (d.ref && MM(d.ref, null, p), h.push(p.ref, p.__c || g, p)), m == null && g != null && (m = g), 65536 & p.__u || d.__k === p.__k ? l = Nj(p, l, t) : typeof p.type == "function" && p.__d !== void 0 ? l = p.__d : g && (l = g.nextSibling), p.__d = void 0, p.__u &= -196609); r.__d = l, r.__e = m; } -function i2e(t, e, r) { +function X2e(t, e, r) { var n, i, s, a, o, l = e.length, u = r.length, h = u, f = 0; for (t.__k = [], n = 0; n < l; n++) - (i = t.__k[n] = (i = e[n]) == null || typeof i == "boolean" || typeof i == "function" ? null : typeof i == "string" || typeof i == "number" || typeof i == "bigint" || i.constructor == String ? sy(null, i, null, null, i) : ZS(i) ? sy(zc, { children: i }, null, null, null) : i.constructor === void 0 && i.__b > 0 ? sy(i.type, i.props, i.key, i.ref ? i.ref : null, i.__v) : i) != null ? (i.__ = t, i.__b = t.__b + 1, o = s2e(i, r, a = n + f, h), i.__i = o, s = null, o !== -1 && (h--, (s = r[o]) && (s.__u |= 131072)), s == null || s.__v === null ? (o == -1 && f--, typeof i.type != "function" && (i.__u |= 65536)) : o !== a && (o === a + 1 ? f++ : o > a ? h > l - a ? f += o - a : f-- : f = o < a && o == a - 1 ? o - a : 0, o !== n + f && (i.__u |= 65536))) : (s = r[n]) && s.key == null && s.__e && (s.__e == t.__d && (t.__d = Ng(s)), HA(s, s, !1), r[n] = null, h--); + (i = t.__k[n] = (i = e[n]) == null || typeof i == "boolean" || typeof i == "function" ? null : typeof i == "string" || typeof i == "number" || typeof i == "bigint" || i.constructor == String ? Ay(null, i, null, null, i) : kT(i) ? Ay(su, { children: i }, null, null, null) : i.constructor === void 0 && i.__b > 0 ? Ay(i.type, i.props, i.key, i.ref ? i.ref : null, i.__v) : i) != null ? (i.__ = t, i.__b = t.__b + 1, o = H2e(i, r, a = n + f, h), i.__i = o, s = null, o !== -1 && (h--, (s = r[o]) && (s.__u |= 131072)), s == null || s.__v === null ? (o == -1 && f--, typeof i.type != "function" && (i.__u |= 65536)) : o !== a && (o === a + 1 ? f++ : o > a ? h > l - a ? f += o - a : f-- : f = o < a && o == a - 1 ? o - a : 0, o !== n + f && (i.__u |= 65536))) : (s = r[n]) && s.key == null && s.__e && (s.__e == t.__d && (t.__d = rm(s)), S7(s, s, !1), r[n] = null, h--); if (h) for (n = 0; n < u; n++) - (s = r[n]) != null && (131072 & s.__u) == 0 && (s.__e == t.__d && (t.__d = Ng(s)), HA(s, s)); + (s = r[n]) != null && (131072 & s.__u) == 0 && (s.__e == t.__d && (t.__d = rm(s)), S7(s, s)); } -function ej(t, e, r) { +function Nj(t, e, r) { var n, i; if (typeof t.type == "function") { for (n = t.__k, i = 0; n && i < n.length; i++) - n[i] && (n[i].__ = t, e = ej(n[i], e, r)); + n[i] && (n[i].__ = t, e = Nj(n[i], e, r)); return e; } return t.__e != e && (r.insertBefore(t.__e, e || null), e = t.__e), e && e.nextSibling; } -function Ru(t, e) { - return e = e || [], t == null || typeof t == "boolean" || (ZS(t) ? t.some(function(r) { - Ru(r, e); +function Hu(t, e) { + return e = e || [], t == null || typeof t == "boolean" || (kT(t) ? t.some(function(r) { + Hu(r, e); }) : e.push(t)), e; } -function s2e(t, e, r, n) { +function H2e(t, e, r, n) { var i = t.key, s = t.type, a = r - 1, o = r + 1, l = e[r]; if (l === null || l && i == l.key && s === l.type) return r; @@ -117,10 +117,10 @@ function s2e(t, e, r, n) { } return -1; } -function j$(t, e, r) { - e[0] === "-" ? t.setProperty(e, r == null ? "" : r) : t[e] = r == null ? "" : typeof r != "number" || r2e.test(e) ? r : r + "px"; +function MB(t, e, r) { + e[0] === "-" ? t.setProperty(e, r == null ? "" : r) : t[e] = r == null ? "" : typeof r != "number" || W2e.test(e) ? r : r + "px"; } -function Cw(t, e, r, n, i) { +function Jw(t, e, r, n, i) { var s; e: if (e === "style") @@ -129,13 +129,13 @@ function Cw(t, e, r, n, i) { else { if (typeof n == "string" && (t.style.cssText = n = ""), n) for (e in n) - r && e in r || j$(t.style, e, ""); + r && e in r || MB(t.style, e, ""); if (r) for (e in r) - n && r[e] === n[e] || j$(t.style, e, r[e]); + n && r[e] === n[e] || MB(t.style, e, r[e]); } else if (e[0] === "o" && e[1] === "n") - s = e !== (e = e.replace(/(PointerCapture)$|Capture$/, "$1")), e = e.toLowerCase() in t ? e.toLowerCase().slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + s] = r, r ? n ? r.u = n.u : (r.u = Date.now(), t.addEventListener(e, s ? J$ : K$, s)) : t.removeEventListener(e, s ? J$ : K$, s); + s = e !== (e = e.replace(/(PointerCapture)$|Capture$/, "$1")), e = e.toLowerCase() in t ? e.toLowerCase().slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + s] = r, r ? n ? r.u = n.u : (r.u = Date.now(), t.addEventListener(e, s ? PB : DB, s)) : t.removeEventListener(e, s ? PB : DB, s); else { if (i) e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s"); @@ -148,27 +148,27 @@ function Cw(t, e, r, n, i) { typeof r == "function" || (r == null || r === !1 && e[4] !== "-" ? t.removeAttribute(e) : t.setAttribute(e, r)); } } -function K$(t) { +function DB(t) { var e = this.l[t.type + !1]; if (t.t) { if (t.t <= e.u) return; } else t.t = Date.now(); - return e(Dt.event ? Dt.event(t) : t); + return e(Ut.event ? Ut.event(t) : t); } -function J$(t) { - return this.l[t.type + !0](Dt.event ? Dt.event(t) : t); +function PB(t) { + return this.l[t.type + !0](Ut.event ? Ut.event(t) : t); } -function rM(t, e, r, n, i, s, a, o, l, u) { +function RM(t, e, r, n, i, s, a, o, l, u) { var h, f, d, p, g, m, v, y, b, w, O, S, C, T, A, E = e.type; if (e.constructor !== void 0) return null; - 128 & r.__u && (l = !!(32 & r.__u), s = [o = e.__e = r.__e]), (h = Dt.__b) && h(e); + 128 & r.__u && (l = !!(32 & r.__u), s = [o = e.__e = r.__e]), (h = Ut.__b) && h(e); e: if (typeof E == "function") try { - if (y = e.props, b = (h = E.contextType) && n[h.__c], w = h ? b ? b.props.value : h.__ : n, r.__c ? v = (f = e.__c = r.__c).__ = f.__E : ("prototype" in E && E.prototype.render ? e.__c = f = new E(y, w) : (e.__c = f = new Sl(y, w), f.constructor = E, f.render = o2e), b && b.sub(f), f.props = y, f.state || (f.state = {}), f.context = w, f.__n = n, d = f.__d = !0, f.__h = [], f._sb = []), f.__s == null && (f.__s = f.state), E.getDerivedStateFromProps != null && (f.__s == f.state && (f.__s = Tu({}, f.__s)), Tu(f.__s, E.getDerivedStateFromProps(y, f.__s))), p = f.props, g = f.state, f.__v = e, d) + if (y = e.props, b = (h = E.contextType) && n[h.__c], w = h ? b ? b.props.value : h.__ : n, r.__c ? v = (f = e.__c = r.__c).__ = f.__E : ("prototype" in E && E.prototype.render ? e.__c = f = new E(y, w) : (e.__c = f = new Ul(y, w), f.constructor = E, f.render = j2e), b && b.sub(f), f.props = y, f.state || (f.state = {}), f.context = w, f.__n = n, d = f.__d = !0, f.__h = [], f._sb = []), f.__s == null && (f.__s = f.state), E.getDerivedStateFromProps != null && (f.__s == f.state && (f.__s = Vu({}, f.__s)), Vu(f.__s, E.getDerivedStateFromProps(y, f.__s))), p = f.props, g = f.state, f.__v = e, d) E.getDerivedStateFromProps == null && f.componentWillMount != null && f.componentWillMount(), f.componentDidMount != null && f.__h.push(f.componentDidMount); else { if (E.getDerivedStateFromProps == null && y !== p && f.componentWillReceiveProps != null && f.componentWillReceiveProps(y, w), !f.__e && (f.shouldComponentUpdate != null && f.shouldComponentUpdate(y, f.__s, w) === !1 || e.__v === r.__v)) { @@ -183,7 +183,7 @@ function rM(t, e, r, n, i, s, a, o, l, u) { f.componentDidUpdate(p, g, m); }); } - if (f.context = w, f.props = y, f.__P = t, f.__e = !1, S = Dt.__r, C = 0, "prototype" in E && E.prototype.render) { + if (f.context = w, f.props = y, f.__P = t, f.__e = !1, S = Ut.__r, C = 0, "prototype" in E && E.prototype.render) { for (f.state = f.__s, f.__d = !1, S && S(e), h = f.render(f.props, f.state, f.context), T = 0; T < f._sb.length; T++) f.__h.push(f._sb[T]); f._sb = []; @@ -191,29 +191,29 @@ function rM(t, e, r, n, i, s, a, o, l, u) { do f.__d = !1, S && S(e), h = f.render(f.props, f.state, f.context), f.state = f.__s; while (f.__d && ++C < 25); - f.state = f.__s, f.getChildContext != null && (n = Tu(Tu({}, n), f.getChildContext())), d || f.getSnapshotBeforeUpdate == null || (m = f.getSnapshotBeforeUpdate(p, g)), JZ(t, ZS(A = h != null && h.type === zc && h.key == null ? h.props.children : h) ? A : [A], e, r, n, i, s, a, o, l, u), f.base = e.__e, e.__u &= -161, f.__h.length && a.push(f), v && (f.__E = f.__ = null); + f.state = f.__s, f.getChildContext != null && (n = Vu(Vu({}, n), f.getChildContext())), d || f.getSnapshotBeforeUpdate == null || (m = f.getSnapshotBeforeUpdate(p, g)), Pj(t, kT(A = h != null && h.type === su && h.key == null ? h.props.children : h) ? A : [A], e, r, n, i, s, a, o, l, u), f.base = e.__e, e.__u &= -161, f.__h.length && a.push(f), v && (f.__E = f.__ = null); } catch (R) { - e.__v = null, l || s != null ? (e.__e = o, e.__u |= l ? 160 : 32, s[s.indexOf(o)] = null) : (e.__e = r.__e, e.__k = r.__k), Dt.__e(R, e, r); + e.__v = null, l || s != null ? (e.__e = o, e.__u |= l ? 160 : 32, s[s.indexOf(o)] = null) : (e.__e = r.__e, e.__k = r.__k), Ut.__e(R, e, r); } else - s == null && e.__v === r.__v ? (e.__k = r.__k, e.__e = r.__e) : e.__e = a2e(r.__e, e, r, n, i, s, a, l, u); - (h = Dt.diffed) && h(e); + s == null && e.__v === r.__v ? (e.__k = r.__k, e.__e = r.__e) : e.__e = Z2e(r.__e, e, r, n, i, s, a, l, u); + (h = Ut.diffed) && h(e); } -function tj(t, e, r) { +function Ij(t, e, r) { e.__d = void 0; for (var n = 0; n < r.length; n++) - nM(r[n], r[++n], r[++n]); - Dt.__c && Dt.__c(e, t), t.some(function(i) { + MM(r[n], r[++n], r[++n]); + Ut.__c && Ut.__c(e, t), t.some(function(i) { try { t = i.__h, i.__h = [], t.some(function(s) { s.call(i); }); } catch (s) { - Dt.__e(s, i.__v); + Ut.__e(s, i.__v); } }); } -function a2e(t, e, r, n, i, s, a, o, l) { +function Z2e(t, e, r, n, i, s, a, o, l) { var u, h, f, d, p, g, m, v = r.props, y = e.props, b = e.type; if (b === "svg" && (i = !0), s != null) { for (u = 0; u < s.length; u++) @@ -230,63 +230,63 @@ function a2e(t, e, r, n, i, s, a, o, l) { if (b === null) v === y || o && t.data === y || (t.data = y); else { - if (s = s && cx.call(t.childNodes), v = r.props || $y, !o && s != null) + if (s = s && Dx.call(t.childNodes), v = r.props || o2, !o && s != null) for (v = {}, u = 0; u < t.attributes.length; u++) v[(p = t.attributes[u]).name] = p.value; for (u in v) - p = v[u], u == "children" || (u == "dangerouslySetInnerHTML" ? f = p : u === "key" || u in y || Cw(t, u, null, p, i)); + p = v[u], u == "children" || (u == "dangerouslySetInnerHTML" ? f = p : u === "key" || u in y || Jw(t, u, null, p, i)); for (u in y) - p = y[u], u == "children" ? d = p : u == "dangerouslySetInnerHTML" ? h = p : u == "value" ? g = p : u == "checked" ? m = p : u === "key" || o && typeof p != "function" || v[u] === p || Cw(t, u, p, v[u], i); + p = y[u], u == "children" ? d = p : u == "dangerouslySetInnerHTML" ? h = p : u == "value" ? g = p : u == "checked" ? m = p : u === "key" || o && typeof p != "function" || v[u] === p || Jw(t, u, p, v[u], i); if (h) o || f && (h.__html === f.__html || h.__html === t.innerHTML) || (t.innerHTML = h.__html), e.__k = []; - else if (f && (t.innerHTML = ""), JZ(t, ZS(d) ? d : [d], e, r, n, i && b !== "foreignObject", s, a, s ? s[0] : r.__k && Ng(r, 0), o, l), s != null) + else if (f && (t.innerHTML = ""), Pj(t, kT(d) ? d : [d], e, r, n, i && b !== "foreignObject", s, a, s ? s[0] : r.__k && rm(r, 0), o, l), s != null) for (u = s.length; u--; ) - s[u] != null && jZ(s[u]); - o || (u = "value", g !== void 0 && (g !== t[u] || b === "progress" && !g || b === "option" && g !== v[u]) && Cw(t, u, g, v[u], !1), u = "checked", m !== void 0 && m !== t[u] && Cw(t, u, m, v[u], !1)); + s[u] != null && Mj(s[u]); + o || (u = "value", g !== void 0 && (g !== t[u] || b === "progress" && !g || b === "option" && g !== v[u]) && Jw(t, u, g, v[u], !1), u = "checked", m !== void 0 && m !== t[u] && Jw(t, u, m, v[u], !1)); } return t; } -function nM(t, e, r) { +function MM(t, e, r) { try { typeof t == "function" ? t(e) : t.current = e; } catch (n) { - Dt.__e(n, r); + Ut.__e(n, r); } } -function HA(t, e, r) { +function S7(t, e, r) { var n, i; - if (Dt.unmount && Dt.unmount(t), (n = t.ref) && (n.current && n.current !== t.__e || nM(n, null, e)), (n = t.__c) != null) { + if (Ut.unmount && Ut.unmount(t), (n = t.ref) && (n.current && n.current !== t.__e || MM(n, null, e)), (n = t.__c) != null) { if (n.componentWillUnmount) try { n.componentWillUnmount(); } catch (s) { - Dt.__e(s, e); + Ut.__e(s, e); } n.base = n.__P = null, t.__c = void 0; } if (n = t.__k) for (i = 0; i < n.length; i++) - n[i] && HA(n[i], e, r || typeof t.type != "function"); - r || t.__e == null || jZ(t.__e), t.__ = t.__e = t.__d = void 0; + n[i] && S7(n[i], e, r || typeof t.type != "function"); + r || t.__e == null || Mj(t.__e), t.__ = t.__e = t.__d = void 0; } -function o2e(t, e, r) { +function j2e(t, e, r) { return this.constructor(t, r); } -function Mc(t, e, r) { +function jc(t, e, r) { var n, i, s, a; - Dt.__ && Dt.__(t, e), i = (n = typeof r == "function") ? null : r && r.__k || e.__k, s = [], a = [], rM(e, t = (!n && r || e).__k = Fc(zc, null, [t]), i || $y, $y, e.ownerSVGElement !== void 0, !n && r ? [r] : i ? null : e.firstChild ? cx.call(e.childNodes) : null, s, !n && r ? r : i ? i.__e : e.firstChild, n, a), tj(s, t, a); + Ut.__ && Ut.__(t, e), i = (n = typeof r == "function") ? null : r && r.__k || e.__k, s = [], a = [], RM(e, t = (!n && r || e).__k = iu(su, null, [t]), i || o2, o2, e.ownerSVGElement !== void 0, !n && r ? [r] : i ? null : e.firstChild ? Dx.call(e.childNodes) : null, s, !n && r ? r : i ? i.__e : e.firstChild, n, a), Ij(s, t, a); } -function rj(t, e) { - Mc(t, e, rj); +function $j(t, e) { + jc(t, e, $j); } -function l2e(t, e, r) { - var n, i, s, a, o = Tu({}, t.props); +function K2e(t, e, r) { + var n, i, s, a, o = Vu({}, t.props); for (s in t.type && t.type.defaultProps && (a = t.type.defaultProps), e) s == "key" ? n = e[s] : s == "ref" ? i = e[s] : o[s] = e[s] === void 0 && a !== void 0 ? a[s] : e[s]; - return arguments.length > 2 && (o.children = arguments.length > 3 ? cx.call(arguments, 2) : r), sy(t.type, o, n || t.key, i || t.ref, null); + return arguments.length > 2 && (o.children = arguments.length > 3 ? Dx.call(arguments, 2) : r), Ay(t.type, o, n || t.key, i || t.ref, null); } -function nj(t, e) { - var r = { __c: e = "__cC" + HZ++, __: t, Consumer: function(n, i) { +function Bj(t, e) { + var r = { __c: e = "__cC" + Lj++, __: t, Consumer: function(n, i) { return n.children(i); }, Provider: function(n) { var i, s; @@ -294,7 +294,7 @@ function nj(t, e) { return s; }, this.shouldComponentUpdate = function(a) { this.props.value !== a.value && i.some(function(o) { - o.__e = !0, XA(o); + o.__e = !0, k7(o); }); }, this.sub = function(a) { i.push(a); @@ -306,7 +306,7 @@ function nj(t, e) { } }; return r.Provider.__ = r.Consumer.contextType = r; } -cx = ZZ.slice, Dt = { __e: function(t, e, r, n) { +Dx = Rj.slice, Ut = { __e: function(t, e, r, n) { for (var i, s, a; e = e.__; ) if ((i = e.__c) && !i.__) try { @@ -316,31 +316,31 @@ cx = ZZ.slice, Dt = { __e: function(t, e, r, n) { t = o; } throw t; -} }, WZ = 0, GZ = function(t) { +} }, Ej = 0, _j = function(t) { return t != null && t.constructor == null; -}, Sl.prototype.setState = function(t, e) { +}, Ul.prototype.setState = function(t, e) { var r; - r = this.__s != null && this.__s !== this.state ? this.__s : this.__s = Tu({}, this.state), typeof t == "function" && (t = t(Tu({}, r), this.props)), t && Tu(r, t), t != null && this.__v && (e && this._sb.push(e), XA(this)); -}, Sl.prototype.forceUpdate = function(t) { - this.__v && (this.__e = !0, t && this.__h.push(t), XA(this)); -}, Sl.prototype.render = zc, Td = [], XZ = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, GA = function(t, e) { + r = this.__s != null && this.__s !== this.state ? this.__s : this.__s = Vu({}, this.state), typeof t == "function" && (t = t(Vu({}, r), this.props)), t && Vu(r, t), t != null && this.__v && (e && this._sb.push(e), k7(this)); +}, Ul.prototype.forceUpdate = function(t) { + this.__v && (this.__e = !0, t && this.__h.push(t), k7(this)); +}, Ul.prototype.render = su, qd = [], Aj = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, O7 = function(t, e) { return t.__v.__b - e.__v.__b; -}, N5.__r = 0, HZ = 0; -var pf, yn, ME, eB, Ig = 0, ij = [], v4 = [], tB = Dt.__b, rB = Dt.__r, nB = Dt.diffed, iB = Dt.__c, sB = Dt.unmount; -function Xm(t, e) { - Dt.__h && Dt.__h(yn, t, Ig || e), Ig = 0; - var r = yn.__H || (yn.__H = { __: [], __h: [] }); - return t >= r.__.length && r.__.push({ __V: v4 }), r.__[t]; -} -function Jn(t) { - return Ig = 1, jS(sj, t); -} -function jS(t, e, r) { - var n = Xm(pf++, 2); - if (n.t = t, !n.__c && (n.__ = [r ? r(e) : sj(void 0, e), function(o) { +}, lk.__r = 0, Lj = 0; +var Mf, Mn, o_, NB, nm = 0, Fj = [], q4 = [], IB = Ut.__b, $B = Ut.__r, BB = Ut.diffed, FB = Ut.__c, zB = Ut.unmount; +function g1(t, e) { + Ut.__h && Ut.__h(Mn, t, nm || e), nm = 0; + var r = Mn.__H || (Mn.__H = { __: [], __h: [] }); + return t >= r.__.length && r.__.push({ __V: q4 }), r.__[t]; +} +function fi(t) { + return nm = 1, ST(zj, t); +} +function ST(t, e, r) { + var n = g1(Mf++, 2); + if (n.t = t, !n.__c && (n.__ = [r ? r(e) : zj(void 0, e), function(o) { var l = n.__N ? n.__N[0] : n.__[0], u = n.t(l, o); l !== u && (n.__N = [u, n.__[1]], n.__c.setState({})); - }], n.__c = yn, !yn.u)) { + }], n.__c = Mn, !Mn.u)) { var i = function(o, l, u) { if (!n.__c.__H) return !0; @@ -359,33 +359,33 @@ function jS(t, e, r) { } }), !(!f && n.__c.props === o) && (!s || s.call(this, o, l, u)); }; - yn.u = !0; - var s = yn.shouldComponentUpdate, a = yn.componentWillUpdate; - yn.componentWillUpdate = function(o, l, u) { + Mn.u = !0; + var s = Mn.shouldComponentUpdate, a = Mn.componentWillUpdate; + Mn.componentWillUpdate = function(o, l, u) { if (this.__e) { var h = s; s = void 0, i(o, l, u), s = h; } a && a.call(this, o, l, u); - }, yn.shouldComponentUpdate = i; + }, Mn.shouldComponentUpdate = i; } return n.__N || n.__; } -function Vn(t, e) { - var r = Xm(pf++, 3); - !Dt.__s && iM(r.__H, e) && (r.__ = t, r.i = e, yn.__H.__h.push(r)); +function ri(t, e) { + var r = g1(Mf++, 3); + !Ut.__s && DM(r.__H, e) && (r.__ = t, r.i = e, Mn.__H.__h.push(r)); } -function KS(t, e) { - var r = Xm(pf++, 4); - !Dt.__s && iM(r.__H, e) && (r.__ = t, r.i = e, yn.__h.push(r)); +function TT(t, e) { + var r = g1(Mf++, 4); + !Ut.__s && DM(r.__H, e) && (r.__ = t, r.i = e, Mn.__h.push(r)); } -function hs(t) { - return Ig = 5, ii(function() { +function Ss(t) { + return nm = 5, vi(function() { return { current: t }; }, []); } -function c2e(t, e, r) { - Ig = 6, KS(function() { +function J2e(t, e, r) { + nm = 6, TT(function() { return typeof t == "function" ? (t(e()), function() { return t(null); }) : t ? (t.current = e(), function() { @@ -393,134 +393,134 @@ function c2e(t, e, r) { }) : void 0; }, r == null ? r : r.concat(t)); } -function ii(t, e) { - var r = Xm(pf++, 7); - return iM(r.__H, e) ? (r.__V = t(), r.i = e, r.__h = t, r.__V) : r.__; +function vi(t, e) { + var r = g1(Mf++, 7); + return DM(r.__H, e) ? (r.__V = t(), r.i = e, r.__h = t, r.__V) : r.__; } -function I5(t, e) { - return Ig = 8, ii(function() { +function ck(t, e) { + return nm = 8, vi(function() { return t; }, e); } -function Yl(t) { - var e = yn.context[t.__c], r = Xm(pf++, 9); - return r.c = t, e ? (r.__ == null && (r.__ = !0, e.sub(yn)), e.props.value) : t.__; +function cc(t) { + var e = Mn.context[t.__c], r = g1(Mf++, 9); + return r.c = t, e ? (r.__ == null && (r.__ = !0, e.sub(Mn)), e.props.value) : t.__; } -function ZA(t, e) { - Dt.useDebugValue && Dt.useDebugValue(e ? e(t) : t); +function T7(t, e) { + Ut.useDebugValue && Ut.useDebugValue(e ? e(t) : t); } -function u2e() { - var t = Xm(pf++, 11); +function ebe() { + var t = g1(Mf++, 11); if (!t.__) { - for (var e = yn.__v; e !== null && !e.__m && e.__ !== null; ) + for (var e = Mn.__v; e !== null && !e.__m && e.__ !== null; ) e = e.__; var r = e.__m || (e.__m = [0, 0]); t.__ = "P" + r[0] + "-" + r[1]++; } return t.__; } -function h2e() { - for (var t; t = ij.shift(); ) +function tbe() { + for (var t; t = Fj.shift(); ) if (t.__P && t.__H) try { - t.__H.__h.forEach(y4), t.__H.__h.forEach(jA), t.__H.__h = []; + t.__H.__h.forEach(Y4), t.__H.__h.forEach(C7), t.__H.__h = []; } catch (e) { - t.__H.__h = [], Dt.__e(e, t.__v); - } -} -Dt.__b = function(t) { - yn = null, tB && tB(t); -}, Dt.__r = function(t) { - rB && rB(t), pf = 0; - var e = (yn = t.__c).__H; - e && (ME === yn ? (e.__h = [], yn.__h = [], e.__.forEach(function(r) { - r.__N && (r.__ = r.__N), r.__V = v4, r.__N = r.i = void 0; - })) : (e.__h.forEach(y4), e.__h.forEach(jA), e.__h = [], pf = 0)), ME = yn; -}, Dt.diffed = function(t) { - nB && nB(t); + t.__H.__h = [], Ut.__e(e, t.__v); + } +} +Ut.__b = function(t) { + Mn = null, IB && IB(t); +}, Ut.__r = function(t) { + $B && $B(t), Mf = 0; + var e = (Mn = t.__c).__H; + e && (o_ === Mn ? (e.__h = [], Mn.__h = [], e.__.forEach(function(r) { + r.__N && (r.__ = r.__N), r.__V = q4, r.__N = r.i = void 0; + })) : (e.__h.forEach(Y4), e.__h.forEach(C7), e.__h = [], Mf = 0)), o_ = Mn; +}, Ut.diffed = function(t) { + BB && BB(t); var e = t.__c; - e && e.__H && (e.__H.__h.length && (ij.push(e) !== 1 && eB === Dt.requestAnimationFrame || ((eB = Dt.requestAnimationFrame) || f2e)(h2e)), e.__H.__.forEach(function(r) { - r.i && (r.__H = r.i), r.__V !== v4 && (r.__ = r.__V), r.i = void 0, r.__V = v4; - })), ME = yn = null; -}, Dt.__c = function(t, e) { + e && e.__H && (e.__H.__h.length && (Fj.push(e) !== 1 && NB === Ut.requestAnimationFrame || ((NB = Ut.requestAnimationFrame) || rbe)(tbe)), e.__H.__.forEach(function(r) { + r.i && (r.__H = r.i), r.__V !== q4 && (r.__ = r.__V), r.i = void 0, r.__V = q4; + })), o_ = Mn = null; +}, Ut.__c = function(t, e) { e.some(function(r) { try { - r.__h.forEach(y4), r.__h = r.__h.filter(function(n) { - return !n.__ || jA(n); + r.__h.forEach(Y4), r.__h = r.__h.filter(function(n) { + return !n.__ || C7(n); }); } catch (n) { e.some(function(i) { i.__h && (i.__h = []); - }), e = [], Dt.__e(n, r.__v); + }), e = [], Ut.__e(n, r.__v); } - }), iB && iB(t, e); -}, Dt.unmount = function(t) { - sB && sB(t); + }), FB && FB(t, e); +}, Ut.unmount = function(t) { + zB && zB(t); var e, r = t.__c; r && r.__H && (r.__H.__.forEach(function(n) { try { - y4(n); + Y4(n); } catch (i) { e = i; } - }), r.__H = void 0, e && Dt.__e(e, r.__v)); + }), r.__H = void 0, e && Ut.__e(e, r.__v)); }; -var aB = typeof requestAnimationFrame == "function"; -function f2e(t) { +var QB = typeof requestAnimationFrame == "function"; +function rbe(t) { var e, r = function() { - clearTimeout(n), aB && cancelAnimationFrame(e), setTimeout(t); + clearTimeout(n), QB && cancelAnimationFrame(e), setTimeout(t); }, n = setTimeout(r, 100); - aB && (e = requestAnimationFrame(r)); + QB && (e = requestAnimationFrame(r)); } -function y4(t) { - var e = yn, r = t.__c; - typeof r == "function" && (t.__c = void 0, r()), yn = e; +function Y4(t) { + var e = Mn, r = t.__c; + typeof r == "function" && (t.__c = void 0, r()), Mn = e; } -function jA(t) { - var e = yn; - t.__c = t.__(), yn = e; +function C7(t) { + var e = Mn; + t.__c = t.__(), Mn = e; } -function iM(t, e) { +function DM(t, e) { return !t || t.length !== e.length || e.some(function(r, n) { return r !== t[n]; }); } -function sj(t, e) { +function zj(t, e) { return typeof e == "function" ? e(t) : e; } -var Ia = function() { - return Ia = Object.assign || function(e) { +var eo = function() { + return eo = Object.assign || function(e) { for (var r, n = 1, i = arguments.length; n < i; n++) { r = arguments[n]; for (var s in r) Object.prototype.hasOwnProperty.call(r, s) && (e[s] = r[s]); } return e; - }, Ia.apply(this, arguments); + }, eo.apply(this, arguments); }; -function $g(t, e, r) { +function im(t, e, r) { if (r || arguments.length === 2) for (var n = 0, i = e.length, s; n < i; n++) (s || !(n in e)) && (s || (s = Array.prototype.slice.call(e, 0, n)), s[n] = e[n]); return t.concat(s || Array.prototype.slice.call(e)); } -function d2e(t) { +function nbe(t) { var e = /* @__PURE__ */ Object.create(null); return function(r) { return e[r] === void 0 && (e[r] = t(r)), e[r]; }; } -var p2e = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/, g2e = /* @__PURE__ */ d2e( +var ibe = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/, sbe = /* @__PURE__ */ nbe( function(t) { - return p2e.test(t) || t.charCodeAt(0) === 111 && t.charCodeAt(1) === 110 && t.charCodeAt(2) < 91; + return ibe.test(t) || t.charCodeAt(0) === 111 && t.charCodeAt(1) === 110 && t.charCodeAt(2) < 91; } ); -function aj(t, e) { +function Qj(t, e) { for (var r in e) t[r] = e[r]; return t; } -function KA(t, e) { +function E7(t, e) { for (var r in t) if (r !== "__source" && !(r in e)) return !0; @@ -529,73 +529,73 @@ function KA(t, e) { return !0; return !1; } -function JA(t) { +function _7(t) { this.props = t; } -function m2e(t, e) { +function abe(t, e) { function r(i) { var s = this.props.ref, a = s == i.ref; - return !a && s && (s.call ? s(null) : s.current = null), e ? !e(this.props, i) || !a : KA(this.props, i); + return !a && s && (s.call ? s(null) : s.current = null), e ? !e(this.props, i) || !a : E7(this.props, i); } function n(i) { - return this.shouldComponentUpdate = r, Fc(t, i); + return this.shouldComponentUpdate = r, iu(t, i); } return n.displayName = "Memo(" + (t.displayName || t.name) + ")", n.prototype.isReactComponent = !0, n.__f = !0, n; } -(JA.prototype = new Sl()).isPureReactComponent = !0, JA.prototype.shouldComponentUpdate = function(t, e) { - return KA(this.props, t) || KA(this.state, e); +(_7.prototype = new Ul()).isPureReactComponent = !0, _7.prototype.shouldComponentUpdate = function(t, e) { + return E7(this.props, t) || E7(this.state, e); }; -var oB = Dt.__b; -Dt.__b = function(t) { - t.type && t.type.__f && t.ref && (t.props.ref = t.ref, t.ref = null), oB && oB(t); +var UB = Ut.__b; +Ut.__b = function(t) { + t.type && t.type.__f && t.ref && (t.props.ref = t.ref, t.ref = null), UB && UB(t); }; -var v2e = typeof Symbol < "u" && Symbol.for && Symbol.for("react.forward_ref") || 3911; -function y2e(t) { +var obe = typeof Symbol < "u" && Symbol.for && Symbol.for("react.forward_ref") || 3911; +function lbe(t) { function e(r) { - var n = aj({}, r); + var n = Qj({}, r); return delete n.ref, t(n, r.ref || null); } - return e.$$typeof = v2e, e.render = e, e.prototype.isReactComponent = e.__f = !0, e.displayName = "ForwardRef(" + (t.displayName || t.name) + ")", e; + return e.$$typeof = obe, e.render = e, e.prototype.isReactComponent = e.__f = !0, e.displayName = "ForwardRef(" + (t.displayName || t.name) + ")", e; } -var lB = function(t, e) { - return t == null ? null : Ru(Ru(t).map(e)); -}, b2e = { map: lB, forEach: lB, count: function(t) { - return t ? Ru(t).length : 0; +var VB = function(t, e) { + return t == null ? null : Hu(Hu(t).map(e)); +}, cbe = { map: VB, forEach: VB, count: function(t) { + return t ? Hu(t).length : 0; }, only: function(t) { - var e = Ru(t); + var e = Hu(t); if (e.length !== 1) throw "Children.only"; return e[0]; -}, toArray: Ru }, x2e = Dt.__e; -Dt.__e = function(t, e, r, n) { +}, toArray: Hu }, ube = Ut.__e; +Ut.__e = function(t, e, r, n) { if (t.then) { for (var i, s = e; s = s.__; ) if ((i = s.__c) && i.__c) return e.__e == null && (e.__e = r.__e, e.__k = r.__k), i.__c(t, e); } - x2e(t, e, r, n); + ube(t, e, r, n); }; -var cB = Dt.unmount; -function oj(t, e, r) { +var qB = Ut.unmount; +function Uj(t, e, r) { return t && (t.__c && t.__c.__H && (t.__c.__H.__.forEach(function(n) { typeof n.__c == "function" && n.__c(); - }), t.__c.__H = null), (t = aj({}, t)).__c != null && (t.__c.__P === r && (t.__c.__P = e), t.__c = null), t.__k = t.__k && t.__k.map(function(n) { - return oj(n, e, r); + }), t.__c.__H = null), (t = Qj({}, t)).__c != null && (t.__c.__P === r && (t.__c.__P = e), t.__c = null), t.__k = t.__k && t.__k.map(function(n) { + return Uj(n, e, r); })), t; } -function lj(t, e, r) { +function Vj(t, e, r) { return t && r && (t.__v = null, t.__k = t.__k && t.__k.map(function(n) { - return lj(n, e, r); + return Vj(n, e, r); }), t.__c && t.__c.__P === e && (t.__e && r.appendChild(t.__e), t.__c.__e = !0, t.__c.__P = r)), t; } -function b4() { +function W4() { this.__u = 0, this.t = null, this.__b = null; } -function cj(t) { +function qj(t) { var e = t.__.__c; return e && e.__a && e.__a(t); } -function w2e(t) { +function hbe(t) { var e, r, n; function i(s) { if (e || (e = t()).then(function(a) { @@ -606,20 +606,20 @@ function w2e(t) { throw n; if (!r) throw e; - return Fc(r, s); + return iu(r, s); } return i.displayName = "Lazy", i.__f = !0, i; } -function _v() { +function Kv() { this.u = null, this.o = null; } -Dt.unmount = function(t) { +Ut.unmount = function(t) { var e = t.__c; - e && e.__R && e.__R(), e && 32 & t.__u && (t.type = null), cB && cB(t); -}, (b4.prototype = new Sl()).__c = function(t, e) { + e && e.__R && e.__R(), e && 32 & t.__u && (t.type = null), qB && qB(t); +}, (W4.prototype = new Ul()).__c = function(t, e) { var r = e.__c, n = this; n.t == null && (n.t = []), n.t.push(r); - var i = cj(n.__v), s = !1, a = function() { + var i = qj(n.__v), s = !1, a = function() { s || (s = !0, r.__R = null, i ? i(o) : o()); }; r.__R = a; @@ -627,7 +627,7 @@ Dt.unmount = function(t) { if (!--n.__u) { if (n.state.__a) { var l = n.state.__a; - n.__v.__k[0] = lj(l, l.__c.__P, l.__c.__O); + n.__v.__k[0] = Vj(l, l.__c.__P, l.__c.__O); } var u; for (n.setState({ __a: n.__b = null }); u = n.t.pop(); ) @@ -635,20 +635,20 @@ Dt.unmount = function(t) { } }; n.__u++ || 32 & e.__u || n.setState({ __a: n.__b = n.__v.__k[0] }), t.then(a, a); -}, b4.prototype.componentWillUnmount = function() { +}, W4.prototype.componentWillUnmount = function() { this.t = []; -}, b4.prototype.render = function(t, e) { +}, W4.prototype.render = function(t, e) { if (this.__b) { if (this.__v.__k) { var r = document.createElement("div"), n = this.__v.__k[0].__c; - this.__v.__k[0] = oj(this.__b, r, n.__O = n.__P); + this.__v.__k[0] = Uj(this.__b, r, n.__O = n.__P); } this.__b = null; } - var i = e.__a && Fc(zc, null, t.fallback); - return i && (i.__u &= -33), [Fc(zc, null, e.__a ? null : t.children), i]; + var i = e.__a && iu(su, null, t.fallback); + return i && (i.__u &= -33), [iu(su, null, e.__a ? null : t.children), i]; }; -var uB = function(t, e, r) { +var YB = function(t, e, r) { if (++r[1] === r[0] && t.o.delete(e), t.props.revealOrder && (t.props.revealOrder[0] !== "t" || !t.o.size)) for (r = t.u; r; ) { for (; r.length > 3; ) @@ -658,153 +658,153 @@ var uB = function(t, e, r) { t.u = r = r[2]; } }; -function O2e(t) { +function fbe(t) { return this.getChildContext = function() { return t.context; }, t.children; } -function k2e(t) { +function dbe(t) { var e = this, r = t.i; e.componentWillUnmount = function() { - Mc(null, e.l), e.l = null, e.i = null; + jc(null, e.l), e.l = null, e.i = null; }, e.i && e.i !== r && e.componentWillUnmount(), e.l || (e.i = r, e.l = { nodeType: 1, parentNode: r, childNodes: [], appendChild: function(n) { this.childNodes.push(n), e.i.appendChild(n); }, insertBefore: function(n, i) { this.childNodes.push(n), e.i.appendChild(n); }, removeChild: function(n) { this.childNodes.splice(this.childNodes.indexOf(n) >>> 1, 1), e.i.removeChild(n); - } }), Mc(Fc(O2e, { context: e.context }, t.__v), e.l); + } }), jc(iu(fbe, { context: e.context }, t.__v), e.l); } -function S2e(t, e) { - var r = Fc(k2e, { __v: t, i: e }); +function pbe(t, e) { + var r = iu(dbe, { __v: t, i: e }); return r.containerInfo = e, r; } -(_v.prototype = new Sl()).__a = function(t) { - var e = this, r = cj(e.__v), n = e.o.get(t); +(Kv.prototype = new Ul()).__a = function(t) { + var e = this, r = qj(e.__v), n = e.o.get(t); return n[0]++, function(i) { var s = function() { - e.props.revealOrder ? (n.push(i), uB(e, t, n)) : i(); + e.props.revealOrder ? (n.push(i), YB(e, t, n)) : i(); }; r ? r(s) : s(); }; -}, _v.prototype.render = function(t) { +}, Kv.prototype.render = function(t) { this.u = null, this.o = /* @__PURE__ */ new Map(); - var e = Ru(t.children); + var e = Hu(t.children); t.revealOrder && t.revealOrder[0] === "b" && e.reverse(); for (var r = e.length; r--; ) this.o.set(e[r], this.u = [1, 0, this.u]); return t.children; -}, _v.prototype.componentDidUpdate = _v.prototype.componentDidMount = function() { +}, Kv.prototype.componentDidUpdate = Kv.prototype.componentDidMount = function() { var t = this; this.o.forEach(function(e, r) { - uB(t, r, e); + YB(t, r, e); }); }; -var uj = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, T2e = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, C2e = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, E2e = /[A-Z0-9]/g, _2e = typeof document < "u", A2e = function(t) { +var Yj = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, gbe = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, mbe = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, vbe = /[A-Z0-9]/g, ybe = typeof document < "u", bbe = function(t) { return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(t); }; -function L2e(t, e, r) { - return e.__k == null && (e.textContent = ""), Mc(t, e), typeof r == "function" && r(), t ? t.__c : null; +function xbe(t, e, r) { + return e.__k == null && (e.textContent = ""), jc(t, e), typeof r == "function" && r(), t ? t.__c : null; } -function R2e(t, e, r) { - return rj(t, e), typeof r == "function" && r(), t ? t.__c : null; +function wbe(t, e, r) { + return $j(t, e), typeof r == "function" && r(), t ? t.__c : null; } -Sl.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(t) { - Object.defineProperty(Sl.prototype, t, { configurable: !0, get: function() { +Ul.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(t) { + Object.defineProperty(Ul.prototype, t, { configurable: !0, get: function() { return this["UNSAFE_" + t]; }, set: function(e) { Object.defineProperty(this, t, { configurable: !0, writable: !0, value: e }); } }); }); -var hB = Dt.event; -function M2e() { +var WB = Ut.event; +function Obe() { } -function D2e() { +function kbe() { return this.cancelBubble; } -function P2e() { +function Sbe() { return this.defaultPrevented; } -Dt.event = function(t) { - return hB && (t = hB(t)), t.persist = M2e, t.isPropagationStopped = D2e, t.isDefaultPrevented = P2e, t.nativeEvent = t; +Ut.event = function(t) { + return WB && (t = WB(t)), t.persist = Obe, t.isPropagationStopped = kbe, t.isDefaultPrevented = Sbe, t.nativeEvent = t; }; -var sM, N2e = { enumerable: !1, configurable: !0, get: function() { +var PM, Tbe = { enumerable: !1, configurable: !0, get: function() { return this.class; -} }, fB = Dt.vnode; -Dt.vnode = function(t) { +} }, GB = Ut.vnode; +Ut.vnode = function(t) { typeof t.type == "string" && function(e) { var r = e.props, n = e.type, i = {}; for (var s in r) { var a = r[s]; - if (!(s === "value" && "defaultValue" in r && a == null || _2e && s === "children" && n === "noscript" || s === "class" || s === "className")) { + if (!(s === "value" && "defaultValue" in r && a == null || ybe && s === "children" && n === "noscript" || s === "class" || s === "className")) { var o = s.toLowerCase(); - s === "defaultValue" && "value" in r && r.value == null ? s = "value" : s === "download" && a === !0 ? a = "" : o === "ondoubleclick" ? s = "ondblclick" : o !== "onchange" || n !== "input" && n !== "textarea" || A2e(r.type) ? o === "onfocus" ? s = "onfocusin" : o === "onblur" ? s = "onfocusout" : C2e.test(s) ? s = o : n.indexOf("-") === -1 && T2e.test(s) ? s = s.replace(E2e, "-$&").toLowerCase() : a === null && (a = void 0) : o = s = "oninput", o === "oninput" && i[s = o] && (s = "oninputCapture"), i[s] = a; + s === "defaultValue" && "value" in r && r.value == null ? s = "value" : s === "download" && a === !0 ? a = "" : o === "ondoubleclick" ? s = "ondblclick" : o !== "onchange" || n !== "input" && n !== "textarea" || bbe(r.type) ? o === "onfocus" ? s = "onfocusin" : o === "onblur" ? s = "onfocusout" : mbe.test(s) ? s = o : n.indexOf("-") === -1 && gbe.test(s) ? s = s.replace(vbe, "-$&").toLowerCase() : a === null && (a = void 0) : o = s = "oninput", o === "oninput" && i[s = o] && (s = "oninputCapture"), i[s] = a; } } - n == "select" && i.multiple && Array.isArray(i.value) && (i.value = Ru(r.children).forEach(function(l) { + n == "select" && i.multiple && Array.isArray(i.value) && (i.value = Hu(r.children).forEach(function(l) { l.props.selected = i.value.indexOf(l.props.value) != -1; - })), n == "select" && i.defaultValue != null && (i.value = Ru(r.children).forEach(function(l) { + })), n == "select" && i.defaultValue != null && (i.value = Hu(r.children).forEach(function(l) { l.props.selected = i.multiple ? i.defaultValue.indexOf(l.props.value) != -1 : i.defaultValue == l.props.value; - })), r.class && !r.className ? (i.class = r.class, Object.defineProperty(i, "className", N2e)) : (r.className && !r.class || r.class && r.className) && (i.class = i.className = r.className), e.props = i; - }(t), t.$$typeof = uj, fB && fB(t); + })), r.class && !r.className ? (i.class = r.class, Object.defineProperty(i, "className", Tbe)) : (r.className && !r.class || r.class && r.className) && (i.class = i.className = r.className), e.props = i; + }(t), t.$$typeof = Yj, GB && GB(t); }; -var dB = Dt.__r; -Dt.__r = function(t) { - dB && dB(t), sM = t.__c; +var XB = Ut.__r; +Ut.__r = function(t) { + XB && XB(t), PM = t.__c; }; -var pB = Dt.diffed; -Dt.diffed = function(t) { - pB && pB(t); +var HB = Ut.diffed; +Ut.diffed = function(t) { + HB && HB(t); var e = t.props, r = t.__e; - r != null && t.type === "textarea" && "value" in e && e.value !== r.value && (r.value = e.value == null ? "" : e.value), sM = null; + r != null && t.type === "textarea" && "value" in e && e.value !== r.value && (r.value = e.value == null ? "" : e.value), PM = null; }; -var I2e = { ReactCurrentDispatcher: { current: { readContext: function(t) { - return sM.__n[t.__c].props.value; +var Cbe = { ReactCurrentDispatcher: { current: { readContext: function(t) { + return PM.__n[t.__c].props.value; } } } }; -function $2e(t) { - return Fc.bind(null, t); +function Ebe(t) { + return iu.bind(null, t); } -function JS(t) { - return !!t && t.$$typeof === uj; +function CT(t) { + return !!t && t.$$typeof === Yj; } -function B2e(t) { - return JS(t) && t.type === zc; +function _be(t) { + return CT(t) && t.type === su; } -function F2e(t) { - return JS(t) ? l2e.apply(null, arguments) : t; +function Abe(t) { + return CT(t) ? K2e.apply(null, arguments) : t; } -function z2e(t) { - return !!t.__k && (Mc(null, t), !0); +function Lbe(t) { + return !!t.__k && (jc(null, t), !0); } -function Q2e(t) { +function Rbe(t) { return t && (t.base || t.nodeType === 1 && t) || null; } -var U2e = function(t, e) { +var Mbe = function(t, e) { return t(e); -}, V2e = function(t, e) { +}, Dbe = function(t, e) { return t(e); -}, q2e = zc; -function hj(t) { +}, Pbe = su; +function Wj(t) { t(); } -function Y2e(t) { +function Nbe(t) { return t; } -function W2e() { - return [!1, hj]; -} -var G2e = KS, X2e = JS; -function H2e(t, e) { - var r = e(), n = Jn({ h: { __: r, v: e } }), i = n[0].h, s = n[1]; - return KS(function() { - i.__ = r, i.v = e, DE(i) && s({ h: i }); - }, [t, r, e]), Vn(function() { - return DE(i) && s({ h: i }), t(function() { - DE(i) && s({ h: i }); +function Ibe() { + return [!1, Wj]; +} +var $be = TT, Bbe = CT; +function Fbe(t, e) { + var r = e(), n = fi({ h: { __: r, v: e } }), i = n[0].h, s = n[1]; + return TT(function() { + i.__ = r, i.v = e, l_(i) && s({ h: i }); + }, [t, r, e]), ri(function() { + return l_(i) && s({ h: i }), t(function() { + l_(i) && s({ h: i }); }); }, [t]), r; } -function DE(t) { +function l_(t) { var e, r, n = t.v, i = t.__; try { var s = n(); @@ -813,11 +813,11 @@ function DE(t) { return !0; } } -var o0 = { useState: Jn, useId: u2e, useReducer: jS, useEffect: Vn, useLayoutEffect: KS, useInsertionEffect: G2e, useTransition: W2e, useDeferredValue: Y2e, useSyncExternalStore: H2e, startTransition: hj, useRef: hs, useImperativeHandle: c2e, useMemo: ii, useCallback: I5, useContext: Yl, useDebugValue: ZA, version: "17.0.2", Children: b2e, render: L2e, hydrate: R2e, unmountComponentAtNode: z2e, createPortal: S2e, createElement: Fc, createContext: nj, createFactory: $2e, cloneElement: F2e, createRef: n2e, Fragment: zc, isValidElement: JS, isElement: X2e, isFragment: B2e, findDOMNode: Q2e, Component: Sl, PureComponent: JA, memo: m2e, forwardRef: y2e, flushSync: V2e, unstable_batchedUpdates: U2e, StrictMode: q2e, Suspense: b4, SuspenseList: _v, lazy: w2e, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: I2e }, Hc = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; -function fj(t) { +var C0 = { useState: fi, useId: ebe, useReducer: ST, useEffect: ri, useLayoutEffect: TT, useInsertionEffect: $be, useTransition: Ibe, useDeferredValue: Nbe, useSyncExternalStore: Fbe, startTransition: Wj, useRef: Ss, useImperativeHandle: J2e, useMemo: vi, useCallback: ck, useContext: cc, useDebugValue: T7, version: "17.0.2", Children: cbe, render: xbe, hydrate: wbe, unmountComponentAtNode: Lbe, createPortal: pbe, createElement: iu, createContext: Bj, createFactory: Ebe, cloneElement: Abe, createRef: G2e, Fragment: su, isValidElement: CT, isElement: Bbe, isFragment: _be, findDOMNode: Rbe, Component: Ul, PureComponent: _7, memo: abe, forwardRef: lbe, flushSync: Dbe, unstable_batchedUpdates: Mbe, StrictMode: Pbe, Suspense: W4, SuspenseList: Kv, lazy: hbe, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: Cbe }, wa = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; +function Gj(t) { return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; } -function dj(t) { +function Xj(t) { var e = t.default; if (typeof e == "function") { var r = function() { @@ -838,7 +838,7 @@ function dj(t) { }); }), r; } -var Z2e = function(e, r, n, i) { +var zbe = function(e, r, n, i) { var s = n ? n.call(i, e, r) : void 0; if (s !== void 0) return !!s; @@ -858,76 +858,76 @@ var Z2e = function(e, r, n, i) { return !1; } return !0; -}, gn = "-ms-", ay = "-moz-", Fr = "-webkit-", pj = "comm", eT = "rule", aM = "decl", j2e = "@import", gj = "@keyframes", K2e = "@layer", J2e = Math.abs, oM = String.fromCharCode, e7 = Object.assign; -function ebe(t, e) { - return qi(t, 0) ^ 45 ? (((e << 2 ^ qi(t, 0)) << 2 ^ qi(t, 1)) << 2 ^ qi(t, 2)) << 2 ^ qi(t, 3) : 0; +}, An = "-ms-", Ly = "-moz-", jr = "-webkit-", Hj = "comm", ET = "rule", NM = "decl", Qbe = "@import", Zj = "@keyframes", Ube = "@layer", Vbe = Math.abs, IM = String.fromCharCode, A7 = Object.assign; +function qbe(t, e) { + return rs(t, 0) ^ 45 ? (((e << 2 ^ rs(t, 0)) << 2 ^ rs(t, 1)) << 2 ^ rs(t, 2)) << 2 ^ rs(t, 3) : 0; } -function mj(t) { +function jj(t) { return t.trim(); } -function yu(t, e) { +function Iu(t, e) { return (t = e.exec(t)) ? t[0] : t; } -function vr(t, e, r) { +function Lr(t, e, r) { return t.replace(e, r); } -function x4(t, e) { +function G4(t, e) { return t.indexOf(e); } -function qi(t, e) { +function rs(t, e) { return t.charCodeAt(e) | 0; } -function Bg(t, e, r) { +function sm(t, e, r) { return t.slice(e, r); } -function dc(t) { +function Mc(t) { return t.length; } -function vj(t) { +function Kj(t) { return t.length; } -function Av(t, e) { +function Jv(t, e) { return e.push(t), t; } -function tbe(t, e) { +function Ybe(t, e) { return t.map(e).join(""); } -function gB(t, e) { +function ZB(t, e) { return t.filter(function(r) { - return !yu(r, e); + return !Iu(r, e); }); } -var tT = 1, Fg = 1, yj = 0, Wo = 0, ui = 0, Hm = ""; -function rT(t, e, r, n, i, s, a, o) { - return { value: t, root: e, parent: r, type: n, props: i, children: s, line: tT, column: Fg, length: a, return: "", siblings: o }; +var _T = 1, am = 1, Jj = 0, cl = 0, ki = 0, m1 = ""; +function AT(t, e, r, n, i, s, a, o) { + return { value: t, root: e, parent: r, type: n, props: i, children: s, line: _T, column: am, length: a, return: "", siblings: o }; } -function Ah(t, e) { - return e7(rT("", null, null, "", null, null, 0, t.siblings), t, { length: -t.length }, e); +function Gh(t, e) { + return A7(AT("", null, null, "", null, null, 0, t.siblings), t, { length: -t.length }, e); } -function wp(t) { +function Up(t) { for (; t.root; ) - t = Ah(t.root, { children: [t] }); - Av(t, t.siblings); + t = Gh(t.root, { children: [t] }); + Jv(t, t.siblings); } -function rbe() { - return ui; +function Wbe() { + return ki; } -function nbe() { - return ui = Wo > 0 ? qi(Hm, --Wo) : 0, Fg--, ui === 10 && (Fg = 1, tT--), ui; +function Gbe() { + return ki = cl > 0 ? rs(m1, --cl) : 0, am--, ki === 10 && (am = 1, _T--), ki; } -function Tl() { - return ui = Wo < yj ? qi(Hm, Wo++) : 0, Fg++, ui === 10 && (Fg = 1, tT++), ui; +function Vl() { + return ki = cl < Jj ? rs(m1, cl++) : 0, am++, ki === 10 && (am = 1, _T++), ki; } -function Jd() { - return qi(Hm, Wo); +function y0() { + return rs(m1, cl); } -function w4() { - return Wo; +function X4() { + return cl; } -function nT(t, e) { - return Bg(Hm, t, e); +function LT(t, e) { + return sm(m1, t, e); } -function t7(t) { +function L7(t) { switch (t) { case 0: case 9: @@ -959,91 +959,91 @@ function t7(t) { } return 0; } -function ibe(t) { - return tT = Fg = 1, yj = dc(Hm = t), Wo = 0, []; +function Xbe(t) { + return _T = am = 1, Jj = Mc(m1 = t), cl = 0, []; } -function sbe(t) { - return Hm = "", t; +function Hbe(t) { + return m1 = "", t; } -function PE(t) { - return mj(nT(Wo - 1, r7(t === 91 ? t + 2 : t === 40 ? t + 1 : t))); +function c_(t) { + return jj(LT(cl - 1, R7(t === 91 ? t + 2 : t === 40 ? t + 1 : t))); } -function abe(t) { - for (; (ui = Jd()) && ui < 33; ) - Tl(); - return t7(t) > 2 || t7(ui) > 3 ? "" : " "; +function Zbe(t) { + for (; (ki = y0()) && ki < 33; ) + Vl(); + return L7(t) > 2 || L7(ki) > 3 ? "" : " "; } -function obe(t, e) { - for (; --e && Tl() && !(ui < 48 || ui > 102 || ui > 57 && ui < 65 || ui > 70 && ui < 97); ) +function jbe(t, e) { + for (; --e && Vl() && !(ki < 48 || ki > 102 || ki > 57 && ki < 65 || ki > 70 && ki < 97); ) ; - return nT(t, w4() + (e < 6 && Jd() == 32 && Tl() == 32)); + return LT(t, X4() + (e < 6 && y0() == 32 && Vl() == 32)); } -function r7(t) { - for (; Tl(); ) - switch (ui) { +function R7(t) { + for (; Vl(); ) + switch (ki) { case t: - return Wo; + return cl; case 34: case 39: - t !== 34 && t !== 39 && r7(ui); + t !== 34 && t !== 39 && R7(ki); break; case 40: - t === 41 && r7(t); + t === 41 && R7(t); break; case 92: - Tl(); + Vl(); break; } - return Wo; + return cl; } -function lbe(t, e) { - for (; Tl() && t + ui !== 47 + 10; ) - if (t + ui === 42 + 42 && Jd() === 47) +function Kbe(t, e) { + for (; Vl() && t + ki !== 47 + 10; ) + if (t + ki === 42 + 42 && y0() === 47) break; - return "/*" + nT(e, Wo - 1) + "*" + oM(t === 47 ? t : Tl()); + return "/*" + LT(e, cl - 1) + "*" + IM(t === 47 ? t : Vl()); } -function cbe(t) { - for (; !t7(Jd()); ) - Tl(); - return nT(t, Wo); +function Jbe(t) { + for (; !L7(y0()); ) + Vl(); + return LT(t, cl); } -function ube(t) { - return sbe(O4("", null, null, null, [""], t = ibe(t), 0, [0], t)); +function exe(t) { + return Hbe(H4("", null, null, null, [""], t = Xbe(t), 0, [0], t)); } -function O4(t, e, r, n, i, s, a, o, l) { +function H4(t, e, r, n, i, s, a, o, l) { for (var u = 0, h = 0, f = a, d = 0, p = 0, g = 0, m = 1, v = 1, y = 1, b = 0, w = "", O = i, S = s, C = n, T = w; v; ) - switch (g = b, b = Tl()) { + switch (g = b, b = Vl()) { case 40: - if (g != 108 && qi(T, f - 1) == 58) { - x4(T += vr(PE(b), "&", "&\f"), "&\f") != -1 && (y = -1); + if (g != 108 && rs(T, f - 1) == 58) { + G4(T += Lr(c_(b), "&", "&\f"), "&\f") != -1 && (y = -1); break; } case 34: case 39: case 91: - T += PE(b); + T += c_(b); break; case 9: case 10: case 13: case 32: - T += abe(g); + T += Zbe(g); break; case 92: - T += obe(w4() - 1, 7); + T += jbe(X4() - 1, 7); continue; case 47: - switch (Jd()) { + switch (y0()) { case 42: case 47: - Av(hbe(lbe(Tl(), w4()), e, r, l), l); + Jv(txe(Kbe(Vl(), X4()), e, r, l), l); break; default: T += "/"; } break; case 123 * m: - o[u++] = dc(T) * y; + o[u++] = Mc(T) * y; case 125 * m: case 59: case 0: @@ -1052,69 +1052,69 @@ function O4(t, e, r, n, i, s, a, o, l) { case 125: v = 0; case 59 + h: - y == -1 && (T = vr(T, /\f/g, "")), p > 0 && dc(T) - f && Av(p > 32 ? vB(T + ";", n, r, f - 1, l) : vB(vr(T, " ", "") + ";", n, r, f - 2, l), l); + y == -1 && (T = Lr(T, /\f/g, "")), p > 0 && Mc(T) - f && Jv(p > 32 ? KB(T + ";", n, r, f - 1, l) : KB(Lr(T, " ", "") + ";", n, r, f - 2, l), l); break; case 59: T += ";"; default: - if (Av(C = mB(T, e, r, u, h, i, o, w, O = [], S = [], f, s), s), b === 123) + if (Jv(C = jB(T, e, r, u, h, i, o, w, O = [], S = [], f, s), s), b === 123) if (h === 0) - O4(T, e, C, C, O, s, f, o, S); + H4(T, e, C, C, O, s, f, o, S); else - switch (d === 99 && qi(T, 3) === 110 ? 100 : d) { + switch (d === 99 && rs(T, 3) === 110 ? 100 : d) { case 100: case 108: case 109: case 115: - O4(t, C, C, n && Av(mB(t, C, C, 0, 0, i, o, w, i, O = [], f, S), S), i, S, f, o, n ? O : S); + H4(t, C, C, n && Jv(jB(t, C, C, 0, 0, i, o, w, i, O = [], f, S), S), i, S, f, o, n ? O : S); break; default: - O4(T, C, C, C, [""], S, 0, o, S); + H4(T, C, C, C, [""], S, 0, o, S); } } u = h = p = 0, m = y = 1, w = T = "", f = a; break; case 58: - f = 1 + dc(T), p = g; + f = 1 + Mc(T), p = g; default: if (m < 1) { if (b == 123) --m; - else if (b == 125 && m++ == 0 && nbe() == 125) + else if (b == 125 && m++ == 0 && Gbe() == 125) continue; } - switch (T += oM(b), b * m) { + switch (T += IM(b), b * m) { case 38: y = h > 0 ? 1 : (T += "\f", -1); break; case 44: - o[u++] = (dc(T) - 1) * y, y = 1; + o[u++] = (Mc(T) - 1) * y, y = 1; break; case 64: - Jd() === 45 && (T += PE(Tl())), d = Jd(), h = f = dc(w = T += cbe(w4())), b++; + y0() === 45 && (T += c_(Vl())), d = y0(), h = f = Mc(w = T += Jbe(X4())), b++; break; case 45: - g === 45 && dc(T) == 2 && (m = 0); + g === 45 && Mc(T) == 2 && (m = 0); } } return s; } -function mB(t, e, r, n, i, s, a, o, l, u, h, f) { - for (var d = i - 1, p = i === 0 ? s : [""], g = vj(p), m = 0, v = 0, y = 0; m < n; ++m) - for (var b = 0, w = Bg(t, d + 1, d = J2e(v = a[m])), O = t; b < g; ++b) - (O = mj(v > 0 ? p[b] + " " + w : vr(w, /&\f/g, p[b]))) && (l[y++] = O); - return rT(t, e, r, i === 0 ? eT : o, l, u, h, f); +function jB(t, e, r, n, i, s, a, o, l, u, h, f) { + for (var d = i - 1, p = i === 0 ? s : [""], g = Kj(p), m = 0, v = 0, y = 0; m < n; ++m) + for (var b = 0, w = sm(t, d + 1, d = Vbe(v = a[m])), O = t; b < g; ++b) + (O = jj(v > 0 ? p[b] + " " + w : Lr(w, /&\f/g, p[b]))) && (l[y++] = O); + return AT(t, e, r, i === 0 ? ET : o, l, u, h, f); } -function hbe(t, e, r, n) { - return rT(t, e, r, pj, oM(rbe()), Bg(t, 2, -2), 0, n); +function txe(t, e, r, n) { + return AT(t, e, r, Hj, IM(Wbe()), sm(t, 2, -2), 0, n); } -function vB(t, e, r, n, i) { - return rT(t, e, r, aM, Bg(t, 0, n), Bg(t, n + 1, -1), n, i); +function KB(t, e, r, n, i) { + return AT(t, e, r, NM, sm(t, 0, n), sm(t, n + 1, -1), n, i); } -function bj(t, e, r) { - switch (ebe(t, e)) { +function eK(t, e, r) { + switch (qbe(t, e)) { case 5103: - return Fr + "print-" + t + t; + return jr + "print-" + t + t; case 5737: case 4201: case 3177: @@ -1140,73 +1140,73 @@ function bj(t, e, r) { case 5365: case 5621: case 3829: - return Fr + t + t; + return jr + t + t; case 4789: - return ay + t + t; + return Ly + t + t; case 5349: case 4246: case 4810: case 6968: case 2756: - return Fr + t + ay + t + gn + t + t; + return jr + t + Ly + t + An + t + t; case 5936: - switch (qi(t, e + 11)) { + switch (rs(t, e + 11)) { case 114: - return Fr + t + gn + vr(t, /[svh]\w+-[tblr]{2}/, "tb") + t; + return jr + t + An + Lr(t, /[svh]\w+-[tblr]{2}/, "tb") + t; case 108: - return Fr + t + gn + vr(t, /[svh]\w+-[tblr]{2}/, "tb-rl") + t; + return jr + t + An + Lr(t, /[svh]\w+-[tblr]{2}/, "tb-rl") + t; case 45: - return Fr + t + gn + vr(t, /[svh]\w+-[tblr]{2}/, "lr") + t; + return jr + t + An + Lr(t, /[svh]\w+-[tblr]{2}/, "lr") + t; } case 6828: case 4268: case 2903: - return Fr + t + gn + t + t; + return jr + t + An + t + t; case 6165: - return Fr + t + gn + "flex-" + t + t; + return jr + t + An + "flex-" + t + t; case 5187: - return Fr + t + vr(t, /(\w+).+(:[^]+)/, Fr + "box-$1$2" + gn + "flex-$1$2") + t; + return jr + t + Lr(t, /(\w+).+(:[^]+)/, jr + "box-$1$2" + An + "flex-$1$2") + t; case 5443: - return Fr + t + gn + "flex-item-" + vr(t, /flex-|-self/g, "") + (yu(t, /flex-|baseline/) ? "" : gn + "grid-row-" + vr(t, /flex-|-self/g, "")) + t; + return jr + t + An + "flex-item-" + Lr(t, /flex-|-self/g, "") + (Iu(t, /flex-|baseline/) ? "" : An + "grid-row-" + Lr(t, /flex-|-self/g, "")) + t; case 4675: - return Fr + t + gn + "flex-line-pack" + vr(t, /align-content|flex-|-self/g, "") + t; + return jr + t + An + "flex-line-pack" + Lr(t, /align-content|flex-|-self/g, "") + t; case 5548: - return Fr + t + gn + vr(t, "shrink", "negative") + t; + return jr + t + An + Lr(t, "shrink", "negative") + t; case 5292: - return Fr + t + gn + vr(t, "basis", "preferred-size") + t; + return jr + t + An + Lr(t, "basis", "preferred-size") + t; case 6060: - return Fr + "box-" + vr(t, "-grow", "") + Fr + t + gn + vr(t, "grow", "positive") + t; + return jr + "box-" + Lr(t, "-grow", "") + jr + t + An + Lr(t, "grow", "positive") + t; case 4554: - return Fr + vr(t, /([^-])(transform)/g, "$1" + Fr + "$2") + t; + return jr + Lr(t, /([^-])(transform)/g, "$1" + jr + "$2") + t; case 6187: - return vr(vr(vr(t, /(zoom-|grab)/, Fr + "$1"), /(image-set)/, Fr + "$1"), t, "") + t; + return Lr(Lr(Lr(t, /(zoom-|grab)/, jr + "$1"), /(image-set)/, jr + "$1"), t, "") + t; case 5495: case 3959: - return vr(t, /(image-set\([^]*)/, Fr + "$1$`$1"); + return Lr(t, /(image-set\([^]*)/, jr + "$1$`$1"); case 4968: - return vr(vr(t, /(.+:)(flex-)?(.*)/, Fr + "box-pack:$3" + gn + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + Fr + t + t; + return Lr(Lr(t, /(.+:)(flex-)?(.*)/, jr + "box-pack:$3" + An + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + jr + t + t; case 4200: - if (!yu(t, /flex-|baseline/)) - return gn + "grid-column-align" + Bg(t, e) + t; + if (!Iu(t, /flex-|baseline/)) + return An + "grid-column-align" + sm(t, e) + t; break; case 2592: case 3360: - return gn + vr(t, "template-", "") + t; + return An + Lr(t, "template-", "") + t; case 4384: case 3616: return r && r.some(function(n, i) { - return e = i, yu(n.props, /grid-\w+-end/); - }) ? ~x4(t + (r = r[e].value), "span") ? t : gn + vr(t, "-start", "") + t + gn + "grid-row-span:" + (~x4(r, "span") ? yu(r, /\d+/) : +yu(r, /\d+/) - +yu(t, /\d+/)) + ";" : gn + vr(t, "-start", "") + t; + return e = i, Iu(n.props, /grid-\w+-end/); + }) ? ~G4(t + (r = r[e].value), "span") ? t : An + Lr(t, "-start", "") + t + An + "grid-row-span:" + (~G4(r, "span") ? Iu(r, /\d+/) : +Iu(r, /\d+/) - +Iu(t, /\d+/)) + ";" : An + Lr(t, "-start", "") + t; case 4896: case 4128: return r && r.some(function(n) { - return yu(n.props, /grid-\w+-start/); - }) ? t : gn + vr(vr(t, "-end", "-span"), "span ", "") + t; + return Iu(n.props, /grid-\w+-start/); + }) ? t : An + Lr(Lr(t, "-end", "-span"), "span ", "") + t; case 4095: case 3583: case 4068: case 2532: - return vr(t, /(.+)-inline(.+)/, Fr + "$1$2") + t; + return Lr(t, /(.+)-inline(.+)/, jr + "$1$2") + t; case 8116: case 7059: case 5753: @@ -1219,32 +1219,32 @@ function bj(t, e, r) { case 5789: case 5021: case 4765: - if (dc(t) - 1 - e > 6) - switch (qi(t, e + 1)) { + if (Mc(t) - 1 - e > 6) + switch (rs(t, e + 1)) { case 109: - if (qi(t, e + 4) !== 45) + if (rs(t, e + 4) !== 45) break; case 102: - return vr(t, /(.+:)(.+)-([^]+)/, "$1" + Fr + "$2-$3$1" + ay + (qi(t, e + 3) == 108 ? "$3" : "$2-$3")) + t; + return Lr(t, /(.+:)(.+)-([^]+)/, "$1" + jr + "$2-$3$1" + Ly + (rs(t, e + 3) == 108 ? "$3" : "$2-$3")) + t; case 115: - return ~x4(t, "stretch") ? bj(vr(t, "stretch", "fill-available"), e, r) + t : t; + return ~G4(t, "stretch") ? eK(Lr(t, "stretch", "fill-available"), e, r) + t : t; } break; case 5152: case 5920: - return vr(t, /(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/, function(n, i, s, a, o, l, u) { - return gn + i + ":" + s + u + (a ? gn + i + "-span:" + (o ? l : +l - +s) + u : "") + t; + return Lr(t, /(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/, function(n, i, s, a, o, l, u) { + return An + i + ":" + s + u + (a ? An + i + "-span:" + (o ? l : +l - +s) + u : "") + t; }); case 4949: - if (qi(t, e + 6) === 121) - return vr(t, ":", ":" + Fr) + t; + if (rs(t, e + 6) === 121) + return Lr(t, ":", ":" + jr) + t; break; case 6444: - switch (qi(t, qi(t, 14) === 45 ? 18 : 11)) { + switch (rs(t, rs(t, 14) === 45 ? 18 : 11)) { case 120: - return vr(t, /(.+:)([^;\s!]+)(;|(\s+)?!.+)?/, "$1" + Fr + (qi(t, 14) === 45 ? "inline-" : "") + "box$3$1" + Fr + "$2$3$1" + gn + "$2box$3") + t; + return Lr(t, /(.+:)([^;\s!]+)(;|(\s+)?!.+)?/, "$1" + jr + (rs(t, 14) === 45 ? "inline-" : "") + "box$3$1" + jr + "$2$3$1" + An + "$2box$3") + t; case 100: - return vr(t, ":", ":" + gn) + t; + return Lr(t, ":", ":" + An) + t; } break; case 5719: @@ -1252,71 +1252,71 @@ function bj(t, e, r) { case 2135: case 3927: case 2391: - return vr(t, "scroll-", "scroll-snap-") + t; + return Lr(t, "scroll-", "scroll-snap-") + t; } return t; } -function $5(t, e) { +function uk(t, e) { for (var r = "", n = 0; n < t.length; n++) r += e(t[n], n, t, e) || ""; return r; } -function fbe(t, e, r, n) { +function rxe(t, e, r, n) { switch (t.type) { - case K2e: + case Ube: if (t.children.length) break; - case j2e: - case aM: + case Qbe: + case NM: return t.return = t.return || t.value; - case pj: + case Hj: return ""; - case gj: - return t.return = t.value + "{" + $5(t.children, n) + "}"; - case eT: - if (!dc(t.value = t.props.join(","))) + case Zj: + return t.return = t.value + "{" + uk(t.children, n) + "}"; + case ET: + if (!Mc(t.value = t.props.join(","))) return ""; } - return dc(r = $5(t.children, n)) ? t.return = t.value + "{" + r + "}" : ""; + return Mc(r = uk(t.children, n)) ? t.return = t.value + "{" + r + "}" : ""; } -function dbe(t) { - var e = vj(t); +function nxe(t) { + var e = Kj(t); return function(r, n, i, s) { for (var a = "", o = 0; o < e; o++) a += t[o](r, n, i, s) || ""; return a; }; } -function pbe(t) { +function ixe(t) { return function(e) { e.root || (e = e.return) && t(e); }; } -function gbe(t, e, r, n) { +function sxe(t, e, r, n) { if (t.length > -1 && !t.return) switch (t.type) { - case aM: - t.return = bj(t.value, t.length, r); + case NM: + t.return = eK(t.value, t.length, r); return; - case gj: - return $5([Ah(t, { value: vr(t.value, "@", "@" + Fr) })], n); - case eT: + case Zj: + return uk([Gh(t, { value: Lr(t.value, "@", "@" + jr) })], n); + case ET: if (t.length) - return tbe(r = t.props, function(i) { - switch (yu(i, n = /(::plac\w+|:read-\w+)/)) { + return Ybe(r = t.props, function(i) { + switch (Iu(i, n = /(::plac\w+|:read-\w+)/)) { case ":read-only": case ":read-write": - wp(Ah(t, { props: [vr(i, /:(read-\w+)/, ":" + ay + "$1")] })), wp(Ah(t, { props: [i] })), e7(t, { props: gB(r, n) }); + Up(Gh(t, { props: [Lr(i, /:(read-\w+)/, ":" + Ly + "$1")] })), Up(Gh(t, { props: [i] })), A7(t, { props: ZB(r, n) }); break; case "::placeholder": - wp(Ah(t, { props: [vr(i, /:(plac\w+)/, ":" + Fr + "input-$1")] })), wp(Ah(t, { props: [vr(i, /:(plac\w+)/, ":" + ay + "$1")] })), wp(Ah(t, { props: [vr(i, /:(plac\w+)/, gn + "input-$1")] })), wp(Ah(t, { props: [i] })), e7(t, { props: gB(r, n) }); + Up(Gh(t, { props: [Lr(i, /:(plac\w+)/, ":" + jr + "input-$1")] })), Up(Gh(t, { props: [Lr(i, /:(plac\w+)/, ":" + Ly + "$1")] })), Up(Gh(t, { props: [Lr(i, /:(plac\w+)/, An + "input-$1")] })), Up(Gh(t, { props: [i] })), A7(t, { props: ZB(r, n) }); break; } return ""; }); } } -var mbe = { +var axe = { animationIterationCount: 1, aspectRatio: 1, borderImageOutset: 1, @@ -1363,8 +1363,8 @@ var mbe = { strokeMiterlimit: 1, strokeOpacity: 1, strokeWidth: 1 -}, l0 = typeof process < "u" && {} !== void 0 && ({}.REACT_APP_SC_ATTR || {}.SC_ATTR) || "data-styled", xj = "active", wj = "data-styled-version", iT = "6.1.2", lM = `/*!sc*/ -`, cM = typeof window < "u" && "HTMLElement" in window, vbe = Boolean(typeof SC_DISABLE_SPEEDY == "boolean" ? SC_DISABLE_SPEEDY : typeof process < "u" && {} !== void 0 && {}.REACT_APP_SC_DISABLE_SPEEDY !== void 0 && {}.REACT_APP_SC_DISABLE_SPEEDY !== "" ? {}.REACT_APP_SC_DISABLE_SPEEDY !== "false" && {}.REACT_APP_SC_DISABLE_SPEEDY : typeof process < "u" && {} !== void 0 && {}.SC_DISABLE_SPEEDY !== void 0 && {}.SC_DISABLE_SPEEDY !== "" ? {}.SC_DISABLE_SPEEDY !== "false" && {}.SC_DISABLE_SPEEDY : {}.NODE_ENV !== "production"), yB = /invalid hook call/i, Ew = /* @__PURE__ */ new Set(), ybe = function(t, e) { +}, E0 = typeof process < "u" && {} !== void 0 && ({}.REACT_APP_SC_ATTR || {}.SC_ATTR) || "data-styled", tK = "active", rK = "data-styled-version", RT = "6.1.2", $M = `/*!sc*/ +`, BM = typeof window < "u" && "HTMLElement" in window, oxe = Boolean(typeof SC_DISABLE_SPEEDY == "boolean" ? SC_DISABLE_SPEEDY : typeof process < "u" && {} !== void 0 && {}.REACT_APP_SC_DISABLE_SPEEDY !== void 0 && {}.REACT_APP_SC_DISABLE_SPEEDY !== "" ? {}.REACT_APP_SC_DISABLE_SPEEDY !== "false" && {}.REACT_APP_SC_DISABLE_SPEEDY : typeof process < "u" && {} !== void 0 && {}.SC_DISABLE_SPEEDY !== void 0 && {}.SC_DISABLE_SPEEDY !== "" ? {}.SC_DISABLE_SPEEDY !== "false" && {}.SC_DISABLE_SPEEDY : {}.NODE_ENV !== "production"), JB = /invalid hook call/i, eO = /* @__PURE__ */ new Set(), lxe = function(t, e) { if ({}.NODE_ENV !== "production") { var r = e ? ' with the id of "'.concat(e, '"') : "", n = "The component ".concat(t).concat(r, ` has been created dynamically. `) + `You may see this warning because you've called styled inside another component. @@ -1374,67 +1374,67 @@ To resolve this only create new StyledComponents outside of any render method an console.error = function(a) { for (var o = [], l = 1; l < arguments.length; l++) o[l - 1] = arguments[l]; - yB.test(a) ? (s = !1, Ew.delete(n)) : i.apply(void 0, $g([a], o, !1)); - }, hs(), s && !Ew.has(n) && (console.warn(n), Ew.add(n)); + JB.test(a) ? (s = !1, eO.delete(n)) : i.apply(void 0, im([a], o, !1)); + }, Ss(), s && !eO.has(n) && (console.warn(n), eO.add(n)); } catch (a) { - yB.test(a.message) && Ew.delete(n); + JB.test(a.message) && eO.delete(n); } finally { console.error = i; } } -}, sT = Object.freeze([]), zg = Object.freeze({}); -function bbe(t, e, r) { - return r === void 0 && (r = zg), t.theme !== r.theme && t.theme || e || r.theme; +}, MT = Object.freeze([]), om = Object.freeze({}); +function cxe(t, e, r) { + return r === void 0 && (r = om), t.theme !== r.theme && t.theme || e || r.theme; } -var n7 = /* @__PURE__ */ new Set(["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "u", "ul", "use", "var", "video", "wbr", "circle", "clipPath", "defs", "ellipse", "foreignObject", "g", "image", "line", "linearGradient", "marker", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "text", "tspan"]), xbe = /[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g, wbe = /(^-|-$)/g; -function bB(t) { - return t.replace(xbe, "-").replace(wbe, ""); +var M7 = /* @__PURE__ */ new Set(["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "u", "ul", "use", "var", "video", "wbr", "circle", "clipPath", "defs", "ellipse", "foreignObject", "g", "image", "line", "linearGradient", "marker", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "text", "tspan"]), uxe = /[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g, hxe = /(^-|-$)/g; +function eF(t) { + return t.replace(uxe, "-").replace(hxe, ""); } -var Obe = /(a)(d)/gi, _w = 52, xB = function(t) { +var fxe = /(a)(d)/gi, tO = 52, tF = function(t) { return String.fromCharCode(t + (t > 25 ? 39 : 97)); }; -function i7(t) { +function D7(t) { var e, r = ""; - for (e = Math.abs(t); e > _w; e = e / _w | 0) - r = xB(e % _w) + r; - return (xB(e % _w) + r).replace(Obe, "$1-$2"); + for (e = Math.abs(t); e > tO; e = e / tO | 0) + r = tF(e % tO) + r; + return (tF(e % tO) + r).replace(fxe, "$1-$2"); } -var NE, Oj = 5381, Cd = function(t, e) { +var u_, nK = 5381, Yd = function(t, e) { for (var r = e.length; r; ) t = 33 * t ^ e.charCodeAt(--r); return t; -}, kj = function(t) { - return Cd(Oj, t); +}, iK = function(t) { + return Yd(nK, t); }; -function kbe(t) { - return i7(kj(t) >>> 0); +function dxe(t) { + return D7(iK(t) >>> 0); } -function Sj(t) { +function sK(t) { return {}.NODE_ENV !== "production" && typeof t == "string" && t || t.displayName || t.name || "Component"; } -function IE(t) { +function h_(t) { return typeof t == "string" && ({}.NODE_ENV === "production" || t.charAt(0) === t.charAt(0).toLowerCase()); } -var Tj = typeof Symbol == "function" && Symbol.for, Cj = Tj ? Symbol.for("react.memo") : 60115, Sbe = Tj ? Symbol.for("react.forward_ref") : 60112, Tbe = { childContextTypes: !0, contextType: !0, contextTypes: !0, defaultProps: !0, displayName: !0, getDefaultProps: !0, getDerivedStateFromError: !0, getDerivedStateFromProps: !0, mixins: !0, propTypes: !0, type: !0 }, Cbe = { name: !0, length: !0, prototype: !0, caller: !0, callee: !0, arguments: !0, arity: !0 }, Ej = { $$typeof: !0, compare: !0, defaultProps: !0, displayName: !0, propTypes: !0, type: !0 }, Ebe = ((NE = {})[Sbe] = { $$typeof: !0, render: !0, defaultProps: !0, displayName: !0, propTypes: !0 }, NE[Cj] = Ej, NE); -function wB(t) { - return ("type" in (e = t) && e.type.$$typeof) === Cj ? Ej : "$$typeof" in t ? Ebe[t.$$typeof] : Tbe; +var aK = typeof Symbol == "function" && Symbol.for, oK = aK ? Symbol.for("react.memo") : 60115, pxe = aK ? Symbol.for("react.forward_ref") : 60112, gxe = { childContextTypes: !0, contextType: !0, contextTypes: !0, defaultProps: !0, displayName: !0, getDefaultProps: !0, getDerivedStateFromError: !0, getDerivedStateFromProps: !0, mixins: !0, propTypes: !0, type: !0 }, mxe = { name: !0, length: !0, prototype: !0, caller: !0, callee: !0, arguments: !0, arity: !0 }, lK = { $$typeof: !0, compare: !0, defaultProps: !0, displayName: !0, propTypes: !0, type: !0 }, vxe = ((u_ = {})[pxe] = { $$typeof: !0, render: !0, defaultProps: !0, displayName: !0, propTypes: !0 }, u_[oK] = lK, u_); +function rF(t) { + return ("type" in (e = t) && e.type.$$typeof) === oK ? lK : "$$typeof" in t ? vxe[t.$$typeof] : gxe; var e; } -var _be = Object.defineProperty, Abe = Object.getOwnPropertyNames, OB = Object.getOwnPropertySymbols, Lbe = Object.getOwnPropertyDescriptor, Rbe = Object.getPrototypeOf, kB = Object.prototype; -function _j(t, e, r) { +var yxe = Object.defineProperty, bxe = Object.getOwnPropertyNames, nF = Object.getOwnPropertySymbols, xxe = Object.getOwnPropertyDescriptor, wxe = Object.getPrototypeOf, iF = Object.prototype; +function cK(t, e, r) { if (typeof e != "string") { - if (kB) { - var n = Rbe(e); - n && n !== kB && _j(t, n, r); + if (iF) { + var n = wxe(e); + n && n !== iF && cK(t, n, r); } - var i = Abe(e); - OB && (i = i.concat(OB(e))); - for (var s = wB(t), a = wB(e), o = 0; o < i.length; ++o) { + var i = bxe(e); + nF && (i = i.concat(nF(e))); + for (var s = rF(t), a = rF(e), o = 0; o < i.length; ++o) { var l = i[o]; - if (!(l in Cbe || r && r[l] || a && l in a || s && l in s)) { - var u = Lbe(e, l); + if (!(l in mxe || r && r[l] || a && l in a || s && l in s)) { + var u = xxe(e, l); try { - _be(t, l, u); + yxe(t, l, u); } catch { } } @@ -1442,40 +1442,40 @@ function _j(t, e, r) { } return t; } -function Qg(t) { +function lm(t) { return typeof t == "function"; } -function uM(t) { +function FM(t) { return typeof t == "object" && "styledComponentId" in t; } -function Bd(t, e) { +function n0(t, e) { return t && e ? "".concat(t, " ").concat(e) : t || e || ""; } -function SB(t, e) { +function sF(t, e) { if (t.length === 0) return ""; for (var r = t[0], n = 1; n < t.length; n++) r += e ? e + t[n] : t[n]; return r; } -function Ug(t) { +function cm(t) { return t !== null && typeof t == "object" && t.constructor.name === Object.name && !("props" in t && t.$$typeof); } -function s7(t, e, r) { - if (r === void 0 && (r = !1), !r && !Ug(t) && !Array.isArray(t)) +function P7(t, e, r) { + if (r === void 0 && (r = !1), !r && !cm(t) && !Array.isArray(t)) return e; if (Array.isArray(e)) for (var n = 0; n < e.length; n++) - t[n] = s7(t[n], e[n]); - else if (Ug(e)) + t[n] = P7(t[n], e[n]); + else if (cm(e)) for (var n in e) - t[n] = s7(t[n], e[n]); + t[n] = P7(t[n], e[n]); return t; } -function hM(t, e) { +function zM(t, e) { Object.defineProperty(t, "toString", { value: e }); } -var Mbe = {}.NODE_ENV !== "production" ? { 1: `Cannot create styled-component for component: %s. +var Oxe = {}.NODE_ENV !== "production" ? { 1: `Cannot create styled-component for component: %s. `, 2: `Can't collect styles once you've consumed a \`ServerStyleSheet\`'s styles! \`ServerStyleSheet\` is a one off instance for each server-side render cycle. @@ -1517,7 +1517,7 @@ as for instance in your render method then you may be running into this limitati `, 17: `CSSStyleSheet could not be found on HTMLStyleElement. Has styled-components' style tag been unmounted or altered by another script? `, 18: "ThemeProvider: Please make sure your useTheme hook is within a ``" } : {}; -function Dbe() { +function kxe() { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; for (var r = t[0], n = [], i = 1, s = t.length; i < s; i += 1) @@ -1526,12 +1526,12 @@ function Dbe() { r = r.replace(/%[a-z]/, a); }), r; } -function Zm(t) { +function v1(t) { for (var e = [], r = 1; r < arguments.length; r++) e[r - 1] = arguments[r]; - return {}.NODE_ENV === "production" ? new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t, " for more information.").concat(e.length > 0 ? " Args: ".concat(e.join(", ")) : "")) : new Error(Dbe.apply(void 0, $g([Mbe[t]], e, !1)).trim()); + return {}.NODE_ENV === "production" ? new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t, " for more information.").concat(e.length > 0 ? " Args: ".concat(e.join(", ")) : "")) : new Error(kxe.apply(void 0, im([Oxe[t]], e, !1)).trim()); } -var Pbe = function() { +var Sxe = function() { function t(e) { this.groupSizes = new Uint32Array(512), this.length = 512, this.tag = e; } @@ -1543,7 +1543,7 @@ var Pbe = function() { if (e >= this.groupSizes.length) { for (var n = this.groupSizes, i = n.length, s = i; e >= s; ) if ((s <<= 1) < 0) - throw Zm(16, "".concat(e)); + throw v1(16, "".concat(e)); this.groupSizes = new Uint32Array(s), this.groupSizes.set(n), this.length = s; for (var a = i; a < s; a++) this.groupSizes[a] = 0; @@ -1562,50 +1562,50 @@ var Pbe = function() { if (e >= this.length || this.groupSizes[e] === 0) return r; for (var n = this.groupSizes[e], i = this.indexOfGroup(e), s = i + n, a = i; a < s; a++) - r += "".concat(this.tag.getRule(a)).concat(lM); + r += "".concat(this.tag.getRule(a)).concat($M); return r; }, t; -}(), k4 = /* @__PURE__ */ new Map(), B5 = /* @__PURE__ */ new Map(), S4 = 1, Aw = function(t) { - if (k4.has(t)) - return k4.get(t); - for (; B5.has(S4); ) - S4++; - var e = S4++; +}(), Z4 = /* @__PURE__ */ new Map(), hk = /* @__PURE__ */ new Map(), j4 = 1, rO = function(t) { + if (Z4.has(t)) + return Z4.get(t); + for (; hk.has(j4); ) + j4++; + var e = j4++; if ({}.NODE_ENV !== "production" && ((0 | e) < 0 || e > 1073741824)) - throw Zm(16, "".concat(e)); - return k4.set(t, e), B5.set(e, t), e; -}, Nbe = function(t, e) { - S4 = e + 1, k4.set(t, e), B5.set(e, t); -}, Ibe = "style[".concat(l0, "][").concat(wj, '="').concat(iT, '"]'), $be = new RegExp("^".concat(l0, '\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')), Bbe = function(t, e, r) { + throw v1(16, "".concat(e)); + return Z4.set(t, e), hk.set(e, t), e; +}, Txe = function(t, e) { + j4 = e + 1, Z4.set(t, e), hk.set(e, t); +}, Cxe = "style[".concat(E0, "][").concat(rK, '="').concat(RT, '"]'), Exe = new RegExp("^".concat(E0, '\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')), _xe = function(t, e, r) { for (var n, i = r.split(","), s = 0, a = i.length; s < a; s++) (n = i[s]) && t.registerName(e, n); -}, Fbe = function(t, e) { - for (var r, n = ((r = e.textContent) !== null && r !== void 0 ? r : "").split(lM), i = [], s = 0, a = n.length; s < a; s++) { +}, Axe = function(t, e) { + for (var r, n = ((r = e.textContent) !== null && r !== void 0 ? r : "").split($M), i = [], s = 0, a = n.length; s < a; s++) { var o = n[s].trim(); if (o) { - var l = o.match($be); + var l = o.match(Exe); if (l) { var u = 0 | parseInt(l[1], 10), h = l[2]; - u !== 0 && (Nbe(h, u), Bbe(t, h, l[3]), t.getTag().insertRules(u, i)), i.length = 0; + u !== 0 && (Txe(h, u), _xe(t, h, l[3]), t.getTag().insertRules(u, i)), i.length = 0; } else i.push(o); } } }; -function zbe() { +function Lxe() { return typeof __webpack_nonce__ < "u" ? __webpack_nonce__ : null; } -var Aj = function(t) { +var uK = function(t) { var e = document.head, r = t || e, n = document.createElement("style"), i = function(o) { - var l = Array.from(o.querySelectorAll("style[".concat(l0, "]"))); + var l = Array.from(o.querySelectorAll("style[".concat(E0, "]"))); return l[l.length - 1]; }(r), s = i !== void 0 ? i.nextSibling : null; - n.setAttribute(l0, xj), n.setAttribute(wj, iT); - var a = zbe(); + n.setAttribute(E0, tK), n.setAttribute(rK, RT); + var a = Lxe(); return a && n.setAttribute("nonce", a), r.insertBefore(n, s), n; -}, Qbe = function() { +}, Rxe = function() { function t(e) { - this.element = Aj(e), this.element.appendChild(document.createTextNode("")), this.sheet = function(r) { + this.element = uK(e), this.element.appendChild(document.createTextNode("")), this.sheet = function(r) { if (r.sheet) return r.sheet; for (var n = document.styleSheets, i = 0, s = n.length; i < s; i++) { @@ -1613,7 +1613,7 @@ var Aj = function(t) { if (a.ownerNode === r) return a; } - throw Zm(17); + throw v1(17); }(this.element), this.length = 0; } return t.prototype.insertRule = function(e, r) { @@ -1628,9 +1628,9 @@ var Aj = function(t) { var r = this.sheet.cssRules[e]; return r && r.cssText ? r.cssText : ""; }, t; -}(), Ube = function() { +}(), Mxe = function() { function t(e) { - this.element = Aj(e), this.nodes = this.element.childNodes, this.length = 0; + this.element = uK(e), this.nodes = this.element.childNodes, this.length = 0; } return t.prototype.insertRule = function(e, r) { if (e <= this.length && e >= 0) { @@ -1643,7 +1643,7 @@ var Aj = function(t) { }, t.prototype.getRule = function(e) { return e < this.length ? this.nodes[e].textContent : ""; }, t; -}(), Vbe = function() { +}(), Dxe = function() { function t(e) { this.rules = [], this.length = 0; } @@ -1654,30 +1654,30 @@ var Aj = function(t) { }, t.prototype.getRule = function(e) { return e < this.length ? this.rules[e] : ""; }, t; -}(), TB = cM, qbe = { isServer: !cM, useCSSOMInjection: !vbe }, Lj = function() { +}(), aF = BM, Pxe = { isServer: !BM, useCSSOMInjection: !oxe }, hK = function() { function t(e, r, n) { - e === void 0 && (e = zg), r === void 0 && (r = {}); + e === void 0 && (e = om), r === void 0 && (r = {}); var i = this; - this.options = Ia(Ia({}, qbe), e), this.gs = r, this.names = new Map(n), this.server = !!e.isServer, !this.server && cM && TB && (TB = !1, function(s) { - for (var a = document.querySelectorAll(Ibe), o = 0, l = a.length; o < l; o++) { + this.options = eo(eo({}, Pxe), e), this.gs = r, this.names = new Map(n), this.server = !!e.isServer, !this.server && BM && aF && (aF = !1, function(s) { + for (var a = document.querySelectorAll(Cxe), o = 0, l = a.length; o < l; o++) { var u = a[o]; - u && u.getAttribute(l0) !== xj && (Fbe(s, u), u.parentNode && u.parentNode.removeChild(u)); + u && u.getAttribute(E0) !== tK && (Axe(s, u), u.parentNode && u.parentNode.removeChild(u)); } - }(this)), hM(this, function() { + }(this)), zM(this, function() { return function(s) { for (var a = s.getTag(), o = a.length, l = "", u = function(f) { var d = function(y) { - return B5.get(y); + return hk.get(y); }(f); if (d === void 0) return "continue"; var p = s.names.get(d), g = a.getGroup(f); if (p === void 0 || g.length === 0) return "continue"; - var m = "".concat(l0, ".g").concat(f, '[id="').concat(d, '"]'), v = ""; + var m = "".concat(E0, ".g").concat(f, '[id="').concat(d, '"]'), v = ""; p !== void 0 && p.forEach(function(y) { y.length > 0 && (v += "".concat(y, ",")); - }), l += "".concat(g).concat(m, '{content:"').concat(v, '"}').concat(lM); + }), l += "".concat(g).concat(m, '{content:"').concat(v, '"}').concat($M); }, h = 0; h < o; h++) u(h); return l; @@ -1685,190 +1685,190 @@ var Aj = function(t) { }); } return t.registerId = function(e) { - return Aw(e); + return rO(e); }, t.prototype.reconstructWithOptions = function(e, r) { - return r === void 0 && (r = !0), new t(Ia(Ia({}, this.options), e), this.gs, r && this.names || void 0); + return r === void 0 && (r = !0), new t(eo(eo({}, this.options), e), this.gs, r && this.names || void 0); }, t.prototype.allocateGSInstance = function(e) { return this.gs[e] = (this.gs[e] || 0) + 1; }, t.prototype.getTag = function() { return this.tag || (this.tag = (e = function(r) { var n = r.useCSSOMInjection, i = r.target; - return r.isServer ? new Vbe(i) : n ? new Qbe(i) : new Ube(i); - }(this.options), new Pbe(e))); + return r.isServer ? new Dxe(i) : n ? new Rxe(i) : new Mxe(i); + }(this.options), new Sxe(e))); var e; }, t.prototype.hasNameForId = function(e, r) { return this.names.has(e) && this.names.get(e).has(r); }, t.prototype.registerName = function(e, r) { - if (Aw(e), this.names.has(e)) + if (rO(e), this.names.has(e)) this.names.get(e).add(r); else { var n = /* @__PURE__ */ new Set(); n.add(r), this.names.set(e, n); } }, t.prototype.insertRules = function(e, r, n) { - this.registerName(e, r), this.getTag().insertRules(Aw(e), n); + this.registerName(e, r), this.getTag().insertRules(rO(e), n); }, t.prototype.clearNames = function(e) { this.names.has(e) && this.names.get(e).clear(); }, t.prototype.clearRules = function(e) { - this.getTag().clearGroup(Aw(e)), this.clearNames(e); + this.getTag().clearGroup(rO(e)), this.clearNames(e); }, t.prototype.clearTag = function() { this.tag = void 0; }, t; -}(), Ybe = /&/g, Wbe = /^\s*\/\/.*$/gm; -function Rj(t, e) { +}(), Nxe = /&/g, Ixe = /^\s*\/\/.*$/gm; +function fK(t, e) { return t.map(function(r) { return r.type === "rule" && (r.value = "".concat(e, " ").concat(r.value), r.value = r.value.replaceAll(",", ",".concat(e, " ")), r.props = r.props.map(function(n) { return "".concat(e, " ").concat(n); - })), Array.isArray(r.children) && r.type !== "@keyframes" && (r.children = Rj(r.children, e)), r; + })), Array.isArray(r.children) && r.type !== "@keyframes" && (r.children = fK(r.children, e)), r; }); } -function Mj(t) { - var e, r, n, i = t === void 0 ? zg : t, s = i.options, a = s === void 0 ? zg : s, o = i.plugins, l = o === void 0 ? sT : o, u = function(d, p, g) { +function dK(t) { + var e, r, n, i = t === void 0 ? om : t, s = i.options, a = s === void 0 ? om : s, o = i.plugins, l = o === void 0 ? MT : o, u = function(d, p, g) { return g === r || g.startsWith(r) && g.endsWith(r) && g.replaceAll(r, "").length > 0 ? ".".concat(e) : d; }, h = l.slice(); h.push(function(d) { - d.type === eT && d.value.includes("&") && (d.props[0] = d.props[0].replace(Ybe, r).replace(n, u)); - }), a.prefix && h.push(gbe), h.push(fbe); + d.type === ET && d.value.includes("&") && (d.props[0] = d.props[0].replace(Nxe, r).replace(n, u)); + }), a.prefix && h.push(sxe), h.push(rxe); var f = function(d, p, g, m) { p === void 0 && (p = ""), g === void 0 && (g = ""), m === void 0 && (m = "&"), e = m, r = p, n = new RegExp("\\".concat(r, "\\b"), "g"); - var v = d.replace(Wbe, ""), y = ube(g || p ? "".concat(g, " ").concat(p, " { ").concat(v, " }") : v); - a.namespace && (y = Rj(y, a.namespace)); + var v = d.replace(Ixe, ""), y = exe(g || p ? "".concat(g, " ").concat(p, " { ").concat(v, " }") : v); + a.namespace && (y = fK(y, a.namespace)); var b = []; - return $5(y, dbe(h.concat(pbe(function(w) { + return uk(y, nxe(h.concat(ixe(function(w) { return b.push(w); })))), b; }; return f.hash = l.length ? l.reduce(function(d, p) { - return p.name || Zm(15), Cd(d, p.name); - }, Oj).toString() : "", f; + return p.name || v1(15), Yd(d, p.name); + }, nK).toString() : "", f; } -var Gbe = new Lj(), a7 = Mj(), fM = o0.createContext({ shouldForwardProp: void 0, styleSheet: Gbe, stylis: a7 }); -fM.Consumer; -var Xbe = o0.createContext(void 0); -function o7() { - return Yl(fM); +var $xe = new hK(), N7 = dK(), QM = C0.createContext({ shouldForwardProp: void 0, styleSheet: $xe, stylis: N7 }); +QM.Consumer; +var Bxe = C0.createContext(void 0); +function I7() { + return cc(QM); } -function Dj(t) { - var e = Jn(t.stylisPlugins), r = e[0], n = e[1], i = o7().styleSheet, s = ii(function() { +function pK(t) { + var e = fi(t.stylisPlugins), r = e[0], n = e[1], i = I7().styleSheet, s = vi(function() { var l = i; return t.sheet ? l = t.sheet : t.target && (l = l.reconstructWithOptions({ target: t.target }, !1)), t.disableCSSOMInjection && (l = l.reconstructWithOptions({ useCSSOMInjection: !1 })), l; - }, [t.disableCSSOMInjection, t.sheet, t.target, i]), a = ii(function() { - return Mj({ options: { namespace: t.namespace, prefix: t.enableVendorPrefixes }, plugins: r }); + }, [t.disableCSSOMInjection, t.sheet, t.target, i]), a = vi(function() { + return dK({ options: { namespace: t.namespace, prefix: t.enableVendorPrefixes }, plugins: r }); }, [t.enableVendorPrefixes, t.namespace, r]); - Vn(function() { - Z2e(r, t.stylisPlugins) || n(t.stylisPlugins); + ri(function() { + zbe(r, t.stylisPlugins) || n(t.stylisPlugins); }, [t.stylisPlugins]); - var o = ii(function() { + var o = vi(function() { return { shouldForwardProp: t.shouldForwardProp, styleSheet: s, stylis: a }; }, [t.shouldForwardProp, s, a]); - return o0.createElement(fM.Provider, { value: o }, o0.createElement(Xbe.Provider, { value: a }, t.children)); + return C0.createElement(QM.Provider, { value: o }, C0.createElement(Bxe.Provider, { value: a }, t.children)); } -var CB = function() { +var oF = function() { function t(e, r) { var n = this; this.inject = function(i, s) { - s === void 0 && (s = a7); + s === void 0 && (s = N7); var a = n.name + s.hash; i.hasNameForId(n.id, a) || i.insertRules(n.id, a, s(n.rules, a, "@keyframes")); - }, this.name = e, this.id = "sc-keyframes-".concat(e), this.rules = r, hM(this, function() { - throw Zm(12, String(n.name)); + }, this.name = e, this.id = "sc-keyframes-".concat(e), this.rules = r, zM(this, function() { + throw v1(12, String(n.name)); }); } return t.prototype.getName = function(e) { - return e === void 0 && (e = a7), this.name + e.hash; + return e === void 0 && (e = N7), this.name + e.hash; }, t; -}(), Hbe = function(t) { +}(), Fxe = function(t) { return t >= "A" && t <= "Z"; }; -function EB(t) { +function lF(t) { for (var e = "", r = 0; r < t.length; r++) { var n = t[r]; if (r === 1 && n === "-" && t[0] === "-") return t; - Hbe(n) ? e += "-" + n.toLowerCase() : e += n; + Fxe(n) ? e += "-" + n.toLowerCase() : e += n; } return e.startsWith("ms-") ? "-" + e : e; } -var Pj = function(t) { +var gK = function(t) { return t == null || t === !1 || t === ""; -}, Nj = function(t) { +}, mK = function(t) { var e, r, n = []; for (var i in t) { var s = t[i]; - t.hasOwnProperty(i) && !Pj(s) && (Array.isArray(s) && s.isCss || Qg(s) ? n.push("".concat(EB(i), ":"), s, ";") : Ug(s) ? n.push.apply(n, $g($g(["".concat(i, " {")], Nj(s), !1), ["}"], !1)) : n.push("".concat(EB(i), ": ").concat((e = i, (r = s) == null || typeof r == "boolean" || r === "" ? "" : typeof r != "number" || r === 0 || e in mbe || e.startsWith("--") ? String(r).trim() : "".concat(r, "px")), ";"))); + t.hasOwnProperty(i) && !gK(s) && (Array.isArray(s) && s.isCss || lm(s) ? n.push("".concat(lF(i), ":"), s, ";") : cm(s) ? n.push.apply(n, im(im(["".concat(i, " {")], mK(s), !1), ["}"], !1)) : n.push("".concat(lF(i), ": ").concat((e = i, (r = s) == null || typeof r == "boolean" || r === "" ? "" : typeof r != "number" || r === 0 || e in axe || e.startsWith("--") ? String(r).trim() : "".concat(r, "px")), ";"))); } return n; }; -function e0(t, e, r, n) { - if (Pj(t)) +function b0(t, e, r, n) { + if (gK(t)) return []; - if (uM(t)) + if (FM(t)) return [".".concat(t.styledComponentId)]; - if (Qg(t)) { - if (!Qg(s = t) || s.prototype && s.prototype.isReactComponent || !e) + if (lm(t)) { + if (!lm(s = t) || s.prototype && s.prototype.isReactComponent || !e) return [t]; var i = t(e); - return {}.NODE_ENV === "production" || typeof i != "object" || Array.isArray(i) || i instanceof CB || Ug(i) || i === null || console.error("".concat(Sj(t), " is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")), e0(i, e, r, n); + return {}.NODE_ENV === "production" || typeof i != "object" || Array.isArray(i) || i instanceof oF || cm(i) || i === null || console.error("".concat(sK(t), " is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")), b0(i, e, r, n); } var s; - return t instanceof CB ? r ? (t.inject(r, n), [t.getName(n)]) : [t] : Ug(t) ? Nj(t) : Array.isArray(t) ? Array.prototype.concat.apply(sT, t.map(function(a) { - return e0(a, e, r, n); + return t instanceof oF ? r ? (t.inject(r, n), [t.getName(n)]) : [t] : cm(t) ? mK(t) : Array.isArray(t) ? Array.prototype.concat.apply(MT, t.map(function(a) { + return b0(a, e, r, n); })) : [t.toString()]; } -function Zbe(t) { +function zxe(t) { for (var e = 0; e < t.length; e += 1) { var r = t[e]; - if (Qg(r) && !uM(r)) + if (lm(r) && !FM(r)) return !1; } return !0; } -var jbe = kj(iT), Kbe = function() { +var Qxe = iK(RT), Uxe = function() { function t(e, r, n) { - this.rules = e, this.staticRulesId = "", this.isStatic = {}.NODE_ENV === "production" && (n === void 0 || n.isStatic) && Zbe(e), this.componentId = r, this.baseHash = Cd(jbe, r), this.baseStyle = n, Lj.registerId(r); + this.rules = e, this.staticRulesId = "", this.isStatic = {}.NODE_ENV === "production" && (n === void 0 || n.isStatic) && zxe(e), this.componentId = r, this.baseHash = Yd(Qxe, r), this.baseStyle = n, hK.registerId(r); } return t.prototype.generateAndInjectStyles = function(e, r, n) { var i = this.baseStyle ? this.baseStyle.generateAndInjectStyles(e, r, n) : ""; if (this.isStatic && !n.hash) if (this.staticRulesId && r.hasNameForId(this.componentId, this.staticRulesId)) - i = Bd(i, this.staticRulesId); + i = n0(i, this.staticRulesId); else { - var s = SB(e0(this.rules, e, r, n)), a = i7(Cd(this.baseHash, s) >>> 0); + var s = sF(b0(this.rules, e, r, n)), a = D7(Yd(this.baseHash, s) >>> 0); if (!r.hasNameForId(this.componentId, a)) { var o = n(s, ".".concat(a), void 0, this.componentId); r.insertRules(this.componentId, a, o); } - i = Bd(i, a), this.staticRulesId = a; + i = n0(i, a), this.staticRulesId = a; } else { - for (var l = Cd(this.baseHash, n.hash), u = "", h = 0; h < this.rules.length; h++) { + for (var l = Yd(this.baseHash, n.hash), u = "", h = 0; h < this.rules.length; h++) { var f = this.rules[h]; if (typeof f == "string") - u += f, {}.NODE_ENV !== "production" && (l = Cd(l, f)); + u += f, {}.NODE_ENV !== "production" && (l = Yd(l, f)); else if (f) { - var d = SB(e0(f, e, r, n)); - l = Cd(l, d + h), u += d; + var d = sF(b0(f, e, r, n)); + l = Yd(l, d + h), u += d; } } if (u) { - var p = i7(l >>> 0); - r.hasNameForId(this.componentId, p) || r.insertRules(this.componentId, p, n(u, ".".concat(p), void 0, this.componentId)), i = Bd(i, p); + var p = D7(l >>> 0); + r.hasNameForId(this.componentId, p) || r.insertRules(this.componentId, p, n(u, ".".concat(p), void 0, this.componentId)), i = n0(i, p); } } return i; }, t; -}(), Ij = o0.createContext(void 0); -Ij.Consumer; -var $E = {}, _B = /* @__PURE__ */ new Set(); -function Jbe(t, e, r) { - var n = uM(t), i = t, s = !IE(t), a = e.attrs, o = a === void 0 ? sT : a, l = e.componentId, u = l === void 0 ? function(O, S) { - var C = typeof O != "string" ? "sc" : bB(O); - $E[C] = ($E[C] || 0) + 1; - var T = "".concat(C, "-").concat(kbe(iT + C + $E[C])); +}(), vK = C0.createContext(void 0); +vK.Consumer; +var f_ = {}, cF = /* @__PURE__ */ new Set(); +function Vxe(t, e, r) { + var n = FM(t), i = t, s = !h_(t), a = e.attrs, o = a === void 0 ? MT : a, l = e.componentId, u = l === void 0 ? function(O, S) { + var C = typeof O != "string" ? "sc" : eF(O); + f_[C] = (f_[C] || 0) + 1; + var T = "".concat(C, "-").concat(dxe(RT + C + f_[C])); return S ? "".concat(S, "-").concat(T) : T; }(e.displayName, e.parentComponentId) : l, h = e.displayName, f = h === void 0 ? function(O) { - return IE(O) ? "styled.".concat(O) : "Styled(".concat(Sj(O), ")"); - }(t) : h, d = e.displayName && e.componentId ? "".concat(bB(e.displayName), "-").concat(e.componentId) : e.componentId || u, p = n && i.attrs ? i.attrs.concat(o).filter(Boolean) : o, g = e.shouldForwardProp; + return h_(O) ? "styled.".concat(O) : "Styled(".concat(sK(O), ")"); + }(t) : h, d = e.displayName && e.componentId ? "".concat(eF(e.displayName), "-").concat(e.componentId) : e.componentId || u, p = n && i.attrs ? i.attrs.concat(o).filter(Boolean) : o, g = e.shouldForwardProp; if (n && i.shouldForwardProp) { var m = i.shouldForwardProp; if (e.shouldForwardProp) { @@ -1879,43 +1879,43 @@ function Jbe(t, e, r) { } else g = m; } - var y = new Kbe(r, d, n ? i.componentStyle : void 0); + var y = new Uxe(r, d, n ? i.componentStyle : void 0); function b(O, S) { return function(C, T, A) { - var E = C.attrs, R = C.componentStyle, _ = C.defaultProps, L = C.foldedComponentIds, $ = C.styledComponentId, k = C.target, N = o0.useContext(Ij), M = o7(), D = C.shouldForwardProp || M.shouldForwardProp; - ({}).NODE_ENV !== "production" && ZA($); - var P = function(W, J, Y) { - for (var ne, ie = Ia(Ia({}, J), { className: void 0, theme: Y }), U = 0; U < W.length; U += 1) { - var Z = Qg(ne = W[U]) ? ne(ie) : ne; + var E = C.attrs, R = C.componentStyle, _ = C.defaultProps, L = C.foldedComponentIds, $ = C.styledComponentId, k = C.target, N = C0.useContext(vK), M = I7(), D = C.shouldForwardProp || M.shouldForwardProp; + ({}).NODE_ENV !== "production" && T7($); + var P = function(W, ee, Y) { + for (var re, se = eo(eo({}, ee), { className: void 0, theme: Y }), U = 0; U < W.length; U += 1) { + var Z = lm(re = W[U]) ? re(se) : re; for (var G in Z) - ie[G] = G === "className" ? Bd(ie[G], Z[G]) : G === "style" ? Ia(Ia({}, ie[G]), Z[G]) : Z[G]; + se[G] = G === "className" ? n0(se[G], Z[G]) : G === "style" ? eo(eo({}, se[G]), Z[G]) : Z[G]; } - return J.className && (ie.className = Bd(ie.className, J.className)), ie; - }(E, T, bbe(T, N, _) || zg), I = P.as || k, F = {}; + return ee.className && (se.className = n0(se.className, ee.className)), se; + }(E, T, cxe(T, N, _) || om), I = P.as || k, F = {}; for (var B in P) - P[B] === void 0 || B[0] === "$" || B === "as" || B === "theme" || (B === "forwardedAs" ? F.as = P.forwardedAs : D && !D(B, I) || (F[B] = P[B], D || {}.NODE_ENV !== "development" || g2e(B) || _B.has(B) || !n7.has(I) || (_B.add(B), console.warn('styled-components: it looks like an unknown prop "'.concat(B, '" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)'))))); - var Q = function(W, J) { - var Y = o7(), ne = W.generateAndInjectStyles(J, Y.styleSheet, Y.stylis); - return {}.NODE_ENV !== "production" && ZA(ne), ne; + P[B] === void 0 || B[0] === "$" || B === "as" || B === "theme" || (B === "forwardedAs" ? F.as = P.forwardedAs : D && !D(B, I) || (F[B] = P[B], D || {}.NODE_ENV !== "development" || sbe(B) || cF.has(B) || !M7.has(I) || (cF.add(B), console.warn('styled-components: it looks like an unknown prop "'.concat(B, '" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)'))))); + var Q = function(W, ee) { + var Y = I7(), re = W.generateAndInjectStyles(ee, Y.styleSheet, Y.stylis); + return {}.NODE_ENV !== "production" && T7(re), re; }(R, P); ({}).NODE_ENV !== "production" && C.warnTooManyClasses && C.warnTooManyClasses(Q); - var q = Bd(L, $); - return Q && (q += " " + Q), P.className && (q += " " + P.className), F[IE(I) && !n7.has(I) ? "class" : "className"] = q, F.ref = A, Fc(I, F); + var q = n0(L, $); + return Q && (q += " " + Q), P.className && (q += " " + P.className), F[h_(I) && !M7.has(I) ? "class" : "className"] = q, F.ref = A, iu(I, F); }(w, O, S); } b.displayName = f; - var w = o0.forwardRef(b); - return w.attrs = p, w.componentStyle = y, w.displayName = f, w.shouldForwardProp = g, w.foldedComponentIds = n ? Bd(i.foldedComponentIds, i.styledComponentId) : "", w.styledComponentId = d, w.target = n ? i.target : t, Object.defineProperty(w, "defaultProps", { get: function() { + var w = C0.forwardRef(b); + return w.attrs = p, w.componentStyle = y, w.displayName = f, w.shouldForwardProp = g, w.foldedComponentIds = n ? n0(i.foldedComponentIds, i.styledComponentId) : "", w.styledComponentId = d, w.target = n ? i.target : t, Object.defineProperty(w, "defaultProps", { get: function() { return this._foldedDefaultProps; }, set: function(O) { this._foldedDefaultProps = n ? function(S) { for (var C = [], T = 1; T < arguments.length; T++) C[T - 1] = arguments[T]; for (var A = 0, E = C; A < E.length; A++) - s7(S, E[A], !0); + P7(S, E[A], !0); return S; }({}, i.defaultProps, O) : O; - } }), {}.NODE_ENV !== "production" && (ybe(f, d), w.warnTooManyClasses = function(O, S) { + } }), {}.NODE_ENV !== "production" && (lxe(f, d), w.warnTooManyClasses = function(O, S) { var C = {}, T = !1; return function(A) { if (!T && (C[A] = !0, Object.keys(C).length >= 200)) { @@ -1932,54 +1932,54 @@ Example: `), T = !0, C = {}; } }; - }(f, d)), hM(w, function() { + }(f, d)), zM(w, function() { return ".".concat(w.styledComponentId); - }), s && _j(w, t, { attrs: !0, componentStyle: !0, displayName: !0, foldedComponentIds: !0, shouldForwardProp: !0, styledComponentId: !0, target: !0 }), w; + }), s && cK(w, t, { attrs: !0, componentStyle: !0, displayName: !0, foldedComponentIds: !0, shouldForwardProp: !0, styledComponentId: !0, target: !0 }), w; } -function AB(t, e) { +function uF(t, e) { for (var r = [t[0]], n = 0, i = e.length; n < i; n += 1) r.push(e[n], t[n + 1]); return r; } -var LB = function(t) { +var hF = function(t) { return Object.assign(t, { isCss: !0 }); }; -function oy(t) { +function Ry(t) { for (var e = [], r = 1; r < arguments.length; r++) e[r - 1] = arguments[r]; - if (Qg(t) || Ug(t)) - return LB(e0(AB(sT, $g([t], e, !0)))); + if (lm(t) || cm(t)) + return hF(b0(uF(MT, im([t], e, !0)))); var n = t; - return e.length === 0 && n.length === 1 && typeof n[0] == "string" ? e0(n) : LB(e0(AB(n, e))); + return e.length === 0 && n.length === 1 && typeof n[0] == "string" ? b0(n) : hF(b0(uF(n, e))); } -function l7(t, e, r) { - if (r === void 0 && (r = zg), !e) - throw Zm(1, e); +function $7(t, e, r) { + if (r === void 0 && (r = om), !e) + throw v1(1, e); var n = function(i) { for (var s = [], a = 1; a < arguments.length; a++) s[a - 1] = arguments[a]; - return t(e, r, oy.apply(void 0, $g([i], s, !1))); + return t(e, r, Ry.apply(void 0, im([i], s, !1))); }; return n.attrs = function(i) { - return l7(t, e, Ia(Ia({}, r), { attrs: Array.prototype.concat(r.attrs, i).filter(Boolean) })); + return $7(t, e, eo(eo({}, r), { attrs: Array.prototype.concat(r.attrs, i).filter(Boolean) })); }, n.withConfig = function(i) { - return l7(t, e, Ia(Ia({}, r), i)); + return $7(t, e, eo(eo({}, r), i)); }, n; } -var $j = function(t) { - return l7(Jbe, t); -}, qt = $j; -n7.forEach(function(t) { - qt[t] = $j(t); +var yK = function(t) { + return $7(Vxe, t); +}, Jt = yK; +M7.forEach(function(t) { + Jt[t] = yK(t); }); ({}).NODE_ENV !== "production" && typeof navigator < "u" && navigator.product === "ReactNative" && console.warn(`It looks like you've imported 'styled-components' on React Native. Perhaps you're looking to import 'styled-components/native'? Read more about this at https://www.styled-components.com/docs/basics#react-native`); -var Lw = "__sc-".concat(l0, "__"); -({}).NODE_ENV !== "production" && {}.NODE_ENV !== "test" && typeof window < "u" && (window[Lw] || (window[Lw] = 0), window[Lw] === 1 && console.warn(`It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason. +var nO = "__sc-".concat(E0, "__"); +({}).NODE_ENV !== "production" && {}.NODE_ENV !== "test" && typeof window < "u" && (window[nO] || (window[nO] = 0), window[nO] === 1 && console.warn(`It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason. -See https://s-c.sh/2BAXzed for more info.`), window[Lw] += 1); -class Dr { +See https://s-c.sh/2BAXzed for more info.`), window[nO] += 1); +class qr { lineAt(e) { if (e < 0 || e > this.length) throw new RangeError(`Invalid position ${e} in document of length ${this.length}`); @@ -1991,24 +1991,24 @@ class Dr { return this.lineInner(e, !0, 1, 0); } replace(e, r, n) { - [e, r] = Vg(this, e, r); + [e, r] = um(this, e, r); let i = []; - return this.decompose(0, e, i, 2), n.length && n.decompose(0, n.length, i, 3), this.decompose(r, this.length, i, 1), mc.from(i, this.length - (r - e) + n.length); + return this.decompose(0, e, i, 2), n.length && n.decompose(0, n.length, i, 3), this.decompose(r, this.length, i, 1), Nc.from(i, this.length - (r - e) + n.length); } append(e) { return this.replace(this.length, this.length, e); } slice(e, r = this.length) { - [e, r] = Vg(this, e, r); + [e, r] = um(this, e, r); let n = []; - return this.decompose(e, r, n, 0), mc.from(n, r - e); + return this.decompose(e, r, n, 0), Nc.from(n, r - e); } eq(e) { if (e == this) return !0; if (e.length != this.length || e.lines != this.lines) return !1; - let r = this.scanIdentical(e, 1), n = this.length - this.scanIdentical(e, -1), i = new ly(this), s = new ly(e); + let r = this.scanIdentical(e, 1), n = this.length - this.scanIdentical(e, -1), i = new My(this), s = new My(e); for (let a = r, o = r; ; ) { if (i.next(a), s.next(a), a = 0, i.lineBreak != s.lineBreak || i.done != s.done || i.value != s.value) return !1; @@ -2017,10 +2017,10 @@ class Dr { } } iter(e = 1) { - return new ly(this, e); + return new My(this, e); } iterRange(e, r = this.length) { - return new Bj(this, e, r); + return new bK(this, e, r); } iterLines(e, r) { let n; @@ -2031,7 +2031,7 @@ class Dr { let i = this.line(e).from; n = this.iterRange(i, Math.max(i, r == this.lines + 1 ? this.length : r <= 1 ? 0 : this.line(r - 1).to)); } - return new Fj(n); + return new xK(n); } toString() { return this.sliceString(0); @@ -2045,11 +2045,11 @@ class Dr { static of(e) { if (e.length == 0) throw new RangeError("A document must have at least one line"); - return e.length == 1 && !e[0] ? Dr.empty : e.length <= 32 ? new jn(e) : mc.from(jn.split(e, [])); + return e.length == 1 && !e[0] ? qr.empty : e.length <= 32 ? new ui(e) : Nc.from(ui.split(e, [])); } } -class jn extends Dr { - constructor(e, r = exe(e)) { +class ui extends qr { + constructor(e, r = qxe(e)) { super(), this.text = e, this.length = r; } get lines() { @@ -2062,33 +2062,33 @@ class jn extends Dr { for (let s = 0; ; s++) { let a = this.text[s], o = i + a.length; if ((r ? n : o) >= e) - return new txe(i, o, n, a); + return new Yxe(i, o, n, a); i = o + 1, n++; } } decompose(e, r, n, i) { - let s = e <= 0 && r >= this.length ? this : new jn(RB(this.text, e, r), Math.min(r, this.length) - Math.max(0, e)); + let s = e <= 0 && r >= this.length ? this : new ui(fF(this.text, e, r), Math.min(r, this.length) - Math.max(0, e)); if (i & 1) { - let a = n.pop(), o = T4(s.text, a.text.slice(), 0, s.length); + let a = n.pop(), o = K4(s.text, a.text.slice(), 0, s.length); if (o.length <= 32) - n.push(new jn(o, a.length + s.length)); + n.push(new ui(o, a.length + s.length)); else { let l = o.length >> 1; - n.push(new jn(o.slice(0, l)), new jn(o.slice(l))); + n.push(new ui(o.slice(0, l)), new ui(o.slice(l))); } } else n.push(s); } replace(e, r, n) { - if (!(n instanceof jn)) + if (!(n instanceof ui)) return super.replace(e, r, n); - [e, r] = Vg(this, e, r); - let i = T4(this.text, T4(n.text, RB(this.text, 0, e)), r), s = this.length + n.length - (r - e); - return i.length <= 32 ? new jn(i, s) : mc.from(jn.split(i, []), s); + [e, r] = um(this, e, r); + let i = K4(this.text, K4(n.text, fF(this.text, 0, e)), r), s = this.length + n.length - (r - e); + return i.length <= 32 ? new ui(i, s) : Nc.from(ui.split(i, []), s); } sliceString(e, r = this.length, n = ` `) { - [e, r] = Vg(this, e, r); + [e, r] = um(this, e, r); let i = ""; for (let s = 0, a = 0; s <= r && a < this.text.length; a++) { let o = this.text[a], l = s + o.length; @@ -2106,11 +2106,11 @@ class jn extends Dr { static split(e, r) { let n = [], i = -1; for (let s of e) - n.push(s), i += s.length + 1, n.length == 32 && (r.push(new jn(n, i)), n = [], i = -1); - return i > -1 && r.push(new jn(n, i)), r; + n.push(s), i += s.length + 1, n.length == 32 && (r.push(new ui(n, i)), n = [], i = -1); + return i > -1 && r.push(new ui(n, i)), r; } } -class mc extends Dr { +class Nc extends qr { constructor(e, r) { super(), this.children = e, this.length = r, this.lines = 0; for (let n of e) @@ -2135,14 +2135,14 @@ class mc extends Dr { } } replace(e, r, n) { - if ([e, r] = Vg(this, e, r), n.lines < this.lines) + if ([e, r] = um(this, e, r), n.lines < this.lines) for (let i = 0, s = 0; i < this.children.length; i++) { let a = this.children[i], o = s + a.length; if (e >= s && r <= o) { let l = a.replace(e - s, r - s, n), u = this.lines - a.lines + l.lines; if (l.lines < u >> 5 - 1 && l.lines > u >> 5 + 1) { let h = this.children.slice(); - return h[i] = l, new mc(h, this.length - (r - e) + n.length); + return h[i] = l, new Nc(h, this.length - (r - e) + n.length); } return super.replace(s, o, l); } @@ -2152,7 +2152,7 @@ class mc extends Dr { } sliceString(e, r = this.length, n = ` `) { - [e, r] = Vg(this, e, r); + [e, r] = um(this, e, r); let i = ""; for (let s = 0, a = 0; s < this.children.length && a <= r; s++) { let o = this.children[s], l = a + o.length; @@ -2165,7 +2165,7 @@ class mc extends Dr { r.flatten(e); } scanIdentical(e, r) { - if (!(e instanceof mc)) + if (!(e instanceof Nc)) return 0; let n = 0, [i, s, a, o] = r > 0 ? [0, 0, this.children.length, e.children.length] : [this.children.length - 1, e.children.length - 1, -1, -1]; for (; ; i += r, s += r) { @@ -2185,49 +2185,49 @@ class mc extends Dr { let p = []; for (let g of e) g.flatten(p); - return new jn(p, r); + return new ui(p, r); } let i = Math.max(32, n >> 5), s = i << 1, a = i >> 1, o = [], l = 0, u = -1, h = []; function f(p) { let g; - if (p.lines > s && p instanceof mc) + if (p.lines > s && p instanceof Nc) for (let m of p.children) f(m); else - p.lines > a && (l > a || !l) ? (d(), o.push(p)) : p instanceof jn && l && (g = h[h.length - 1]) instanceof jn && p.lines + g.lines <= 32 ? (l += p.lines, u += p.length + 1, h[h.length - 1] = new jn(g.text.concat(p.text), g.length + 1 + p.length)) : (l + p.lines > i && d(), l += p.lines, u += p.length + 1, h.push(p)); + p.lines > a && (l > a || !l) ? (d(), o.push(p)) : p instanceof ui && l && (g = h[h.length - 1]) instanceof ui && p.lines + g.lines <= 32 ? (l += p.lines, u += p.length + 1, h[h.length - 1] = new ui(g.text.concat(p.text), g.length + 1 + p.length)) : (l + p.lines > i && d(), l += p.lines, u += p.length + 1, h.push(p)); } function d() { - l != 0 && (o.push(h.length == 1 ? h[0] : mc.from(h, u)), u = -1, l = h.length = 0); + l != 0 && (o.push(h.length == 1 ? h[0] : Nc.from(h, u)), u = -1, l = h.length = 0); } for (let p of e) f(p); - return d(), o.length == 1 ? o[0] : new mc(o, r); + return d(), o.length == 1 ? o[0] : new Nc(o, r); } } -Dr.empty = /* @__PURE__ */ new jn([""], 0); -function exe(t) { +qr.empty = /* @__PURE__ */ new ui([""], 0); +function qxe(t) { let e = -1; for (let r of t) e += r.length + 1; return e; } -function T4(t, e, r = 0, n = 1e9) { +function K4(t, e, r = 0, n = 1e9) { for (let i = 0, s = 0, a = !0; s < t.length && i <= n; s++) { let o = t[s], l = i + o.length; l >= r && (l > n && (o = o.slice(0, n - i)), i < r && (o = o.slice(r - i)), a ? (e[e.length - 1] += o, a = !1) : e.push(o)), i = l + 1; } return e; } -function RB(t, e, r) { - return T4(t, [""], e, r); +function fF(t, e, r) { + return K4(t, [""], e, r); } -class ly { +class My { constructor(e, r = 1) { - this.dir = r, this.done = !1, this.lineBreak = !1, this.value = "", this.nodes = [e], this.offsets = [r > 0 ? 1 : (e instanceof jn ? e.text.length : e.children.length) << 1]; + this.dir = r, this.done = !1, this.lineBreak = !1, this.value = "", this.nodes = [e], this.offsets = [r > 0 ? 1 : (e instanceof ui ? e.text.length : e.children.length) << 1]; } nextInner(e, r) { for (this.done = this.lineBreak = !1; ; ) { - let n = this.nodes.length - 1, i = this.nodes[n], s = this.offsets[n], a = s >> 1, o = i instanceof jn ? i.text.length : i.children.length; + let n = this.nodes.length - 1, i = this.nodes[n], s = this.offsets[n], a = s >> 1, o = i instanceof ui ? i.text.length : i.children.length; if (a == (r > 0 ? o : 0)) { if (n == 0) return this.done = !0, this.value = "", this; @@ -2237,14 +2237,14 @@ class ly { return this.lineBreak = !0, this.value = ` `, this; e--; - } else if (i instanceof jn) { + } else if (i instanceof ui) { let l = i.text[a + (r < 0 ? -1 : 0)]; if (this.offsets[n] += r, l.length > Math.max(0, e)) return this.value = e == 0 ? l : r > 0 ? l.slice(e) : l.slice(0, l.length - e), this; e -= l.length; } else { let l = i.children[a + (r < 0 ? -1 : 0)]; - e > l.length ? (e -= l.length, this.offsets[n] += r) : (r < 0 && this.offsets[n]--, this.nodes.push(l), this.offsets.push(r > 0 ? 1 : (l instanceof jn ? l.text.length : l.children.length) << 1)); + e > l.length ? (e -= l.length, this.offsets[n] += r) : (r < 0 && this.offsets[n]--, this.nodes.push(l), this.offsets.push(r > 0 ? 1 : (l instanceof ui ? l.text.length : l.children.length) << 1)); } } } @@ -2252,9 +2252,9 @@ class ly { return e < 0 && (this.nextInner(-e, -this.dir), e = this.value.length), this.nextInner(e, this.dir); } } -class Bj { +class bK { constructor(e, r, n) { - this.value = "", this.done = !1, this.cursor = new ly(e, r > n ? -1 : 1), this.pos = r > n ? e.length : 0, this.from = Math.min(r, n), this.to = Math.max(r, n); + this.value = "", this.done = !1, this.cursor = new My(e, r > n ? -1 : 1), this.pos = r > n ? e.length : 0, this.from = Math.min(r, n), this.to = Math.max(r, n); } nextInner(e, r) { if (r < 0 ? this.pos <= this.from : this.pos >= this.to) @@ -2272,7 +2272,7 @@ class Bj { return this.cursor.lineBreak && this.value != ""; } } -class Fj { +class xK { constructor(e) { this.inner = e, this.afterBreak = !0, this.value = "", this.done = !1; } @@ -2284,12 +2284,12 @@ class Fj { return !1; } } -typeof Symbol < "u" && (Dr.prototype[Symbol.iterator] = function() { +typeof Symbol < "u" && (qr.prototype[Symbol.iterator] = function() { return this.iter(); -}, ly.prototype[Symbol.iterator] = Bj.prototype[Symbol.iterator] = Fj.prototype[Symbol.iterator] = function() { +}, My.prototype[Symbol.iterator] = bK.prototype[Symbol.iterator] = xK.prototype[Symbol.iterator] = function() { return this; }); -class txe { +class Yxe { constructor(e, r, n, i) { this.from = e, this.to = r, this.number = n, this.text = i; } @@ -2297,37 +2297,37 @@ class txe { return this.to - this.from; } } -function Vg(t, e, r) { +function um(t, e, r) { return e = Math.max(0, Math.min(t.length, e)), [e, Math.max(e, Math.min(t.length, r))]; } -let ag = /* @__PURE__ */ "lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((t) => t ? parseInt(t, 36) : 1); -for (let t = 1; t < ag.length; t++) - ag[t] += ag[t - 1]; -function rxe(t) { - for (let e = 1; e < ag.length; e += 2) - if (ag[e] > t) - return ag[e - 1] <= t; +let Eg = /* @__PURE__ */ "lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((t) => t ? parseInt(t, 36) : 1); +for (let t = 1; t < Eg.length; t++) + Eg[t] += Eg[t - 1]; +function Wxe(t) { + for (let e = 1; e < Eg.length; e += 2) + if (Eg[e] > t) + return Eg[e - 1] <= t; return !1; } -function MB(t) { +function dF(t) { return t >= 127462 && t <= 127487; } -const DB = 8205; -function cs(t, e, r = !0, n = !0) { - return (r ? zj : nxe)(t, e, n); +const pF = 8205; +function Os(t, e, r = !0, n = !0) { + return (r ? wK : Gxe)(t, e, n); } -function zj(t, e, r) { +function wK(t, e, r) { if (e == t.length) return e; - e && Qj(t.charCodeAt(e)) && Uj(t.charCodeAt(e - 1)) && e--; - let n = as(t, e); - for (e += Mo(n); e < t.length; ) { - let i = as(t, e); - if (n == DB || i == DB || r && rxe(i)) - e += Mo(i), n = i; - else if (MB(i)) { + e && OK(t.charCodeAt(e)) && kK(t.charCodeAt(e - 1)) && e--; + let n = bs(t, e); + for (e += Ho(n); e < t.length; ) { + let i = bs(t, e); + if (n == pF || i == pF || r && Wxe(i)) + e += Ho(i), n = i; + else if (dF(i)) { let s = 0, a = e - 2; - for (; a >= 0 && MB(as(t, a)); ) + for (; a >= 0 && dF(bs(t, a)); ) s++, a -= 2; if (s % 2 == 0) break; @@ -2337,39 +2337,39 @@ function zj(t, e, r) { } return e; } -function nxe(t, e, r) { +function Gxe(t, e, r) { for (; e > 0; ) { - let n = zj(t, e - 2, r); + let n = wK(t, e - 2, r); if (n < e) return n; e--; } return 0; } -function Qj(t) { +function OK(t) { return t >= 56320 && t < 57344; } -function Uj(t) { +function kK(t) { return t >= 55296 && t < 56320; } -function as(t, e) { +function bs(t, e) { let r = t.charCodeAt(e); - if (!Uj(r) || e + 1 == t.length) + if (!kK(r) || e + 1 == t.length) return r; let n = t.charCodeAt(e + 1); - return Qj(n) ? (r - 55296 << 10) + (n - 56320) + 65536 : r; + return OK(n) ? (r - 55296 << 10) + (n - 56320) + 65536 : r; } -function dM(t) { +function UM(t) { return t <= 65535 ? String.fromCharCode(t) : (t -= 65536, String.fromCharCode((t >> 10) + 55296, (t & 1023) + 56320)); } -function Mo(t) { +function Ho(t) { return t < 65536 ? 1 : 2; } -const c7 = /\r\n?|\n/; -var Ci = /* @__PURE__ */ function(t) { +const B7 = /\r\n?|\n/; +var Fi = /* @__PURE__ */ function(t) { return t[t.Simple = 0] = "Simple", t[t.TrackDel = 1] = "TrackDel", t[t.TrackBefore = 2] = "TrackBefore", t[t.TrackAfter = 3] = "TrackAfter", t; -}(Ci || (Ci = {})); -class Dc { +}(Fi || (Fi = {})); +class Kc { constructor(e) { this.sections = e; } @@ -2397,7 +2397,7 @@ class Dc { } } iterChangedRanges(e, r = !1) { - u7(this, e, r); + F7(this, e, r); } get invertedDesc() { let e = []; @@ -2405,15 +2405,15 @@ class Dc { let n = this.sections[r++], i = this.sections[r++]; i < 0 ? e.push(n, i) : e.push(i, n); } - return new Dc(e); + return new Kc(e); } composeDesc(e) { - return this.empty ? e : e.empty ? this : Vj(this, e); + return this.empty ? e : e.empty ? this : SK(this, e); } mapDesc(e, r = !1) { - return e.empty ? this : h7(this, e, r); + return e.empty ? this : z7(this, e, r); } - mapPos(e, r = -1, n = Ci.Simple) { + mapPos(e, r = -1, n = Fi.Simple) { let i = 0, s = 0; for (let a = 0; a < this.sections.length; ) { let o = this.sections[a++], l = this.sections[a++], u = i + o; @@ -2422,7 +2422,7 @@ class Dc { return s + (e - i); s += o; } else { - if (n != Ci.Simple && u >= e && (n == Ci.TrackDel && i < e && u > e || n == Ci.TrackBefore && i < e || n == Ci.TrackAfter && u > e)) + if (n != Fi.Simple && u >= e && (n == Fi.TrackDel && i < e && u > e || n == Fi.TrackBefore && i < e || n == Fi.TrackAfter && u > e)) return null; if (u > e || u == e && r < 0 && !o) return e == i || r < 0 ? s : s + l; @@ -2457,23 +2457,23 @@ class Dc { static fromJSON(e) { if (!Array.isArray(e) || e.length % 2 || e.some((r) => typeof r != "number")) throw new RangeError("Invalid JSON representation of ChangeDesc"); - return new Dc(e); + return new Kc(e); } static create(e) { - return new Dc(e); + return new Kc(e); } } -class li extends Dc { +class wi extends Kc { constructor(e, r) { super(e), this.inserted = r; } apply(e) { if (this.length != e.length) throw new RangeError("Applying change set to a document with the wrong length"); - return u7(this, (r, n, i, s, a) => e = e.replace(i, i + (n - r), a), !1), e; + return F7(this, (r, n, i, s, a) => e = e.replace(i, i + (n - r), a), !1), e; } mapDesc(e, r = !1) { - return h7(this, e, r, !0); + return z7(this, e, r, !0); } invert(e) { let r = this.sections.slice(), n = []; @@ -2483,27 +2483,27 @@ class li extends Dc { r[i] = o, r[i + 1] = a; let l = i >> 1; for (; n.length < l; ) - n.push(Dr.empty); - n.push(a ? e.slice(s, s + a) : Dr.empty); + n.push(qr.empty); + n.push(a ? e.slice(s, s + a) : qr.empty); } s += a; } - return new li(r, n); + return new wi(r, n); } compose(e) { - return this.empty ? e : e.empty ? this : Vj(this, e, !0); + return this.empty ? e : e.empty ? this : SK(this, e, !0); } map(e, r = !1) { - return e.empty ? this : h7(this, e, r, !0); + return e.empty ? this : z7(this, e, r, !0); } iterChanges(e, r = !1) { - u7(this, e, r); + F7(this, e, r); } get desc() { - return Dc.create(this.sections); + return Kc.create(this.sections); } filter(e) { - let r = [], n = [], i = [], s = new By(this); + let r = [], n = [], i = [], s = new l2(this); e: for (let a = 0, o = 0; ; ) { let l = a == e.length ? 1e9 : e[a++]; @@ -2511,21 +2511,21 @@ class li extends Dc { if (s.done) break e; let h = Math.min(s.len, l - o); - Ms(i, h, -1); + Ws(i, h, -1); let f = s.ins == -1 ? -1 : s.off == 0 ? s.ins : 0; - Ms(r, h, f), f > 0 && Uh(n, r, s.text), s.forward(h), o += h; + Ws(r, h, f), f > 0 && of(n, r, s.text), s.forward(h), o += h; } let u = e[a++]; for (; o < u; ) { if (s.done) break e; let h = Math.min(s.len, u - o); - Ms(r, h, -1), Ms(i, h, s.ins == -1 ? -1 : s.off == 0 ? s.ins : 0), s.forward(h), o += h; + Ws(r, h, -1), Ws(i, h, s.ins == -1 ? -1 : s.off == 0 ? s.ins : 0), s.forward(h), o += h; } } return { - changes: new li(r, n), - filtered: Dc.create(i) + changes: new wi(r, n), + filtered: Kc.create(i) }; } toJSON() { @@ -2541,15 +2541,15 @@ class li extends Dc { function l(h = !1) { if (!h && !i.length) return; - a < r && Ms(i, r - a, -1); - let f = new li(i, s); + a < r && Ws(i, r - a, -1); + let f = new wi(i, s); o = o ? o.compose(f.map(o)) : f, i = [], s = [], a = 0; } function u(h) { if (Array.isArray(h)) for (let f of h) u(f); - else if (h instanceof li) { + else if (h instanceof wi) { if (h.length != r) throw new RangeError(`Mismatched change set length (got ${h.length}, expected ${r})`); l(), o = o ? o.compose(h.map(o)) : h; @@ -2557,16 +2557,16 @@ class li extends Dc { let { from: f, to: d = f, insert: p } = h; if (f > d || f < 0 || d > r) throw new RangeError(`Invalid change range ${f} to ${d} (in doc of length ${r})`); - let g = p ? typeof p == "string" ? Dr.of(p.split(n || c7)) : p : Dr.empty, m = g.length; + let g = p ? typeof p == "string" ? qr.of(p.split(n || B7)) : p : qr.empty, m = g.length; if (f == d && m == 0) return; - f < a && l(), f > a && Ms(i, f - a, -1), Ms(i, d - f, m), Uh(s, i, g), a = d; + f < a && l(), f > a && Ws(i, f - a, -1), Ws(i, d - f, m), of(s, i, g), a = d; } } return u(e), l(!o), o; } static empty(e) { - return new li(e ? [e, -1] : [], []); + return new wi(e ? [e, -1] : [], []); } static fromJSON(e) { if (!Array.isArray(e)) @@ -2583,24 +2583,24 @@ class li extends Dc { r.push(s[0], 0); else { for (; n.length < i; ) - n.push(Dr.empty); - n[i] = Dr.of(s.slice(1)), r.push(s[0], n[i].length); + n.push(qr.empty); + n[i] = qr.of(s.slice(1)), r.push(s[0], n[i].length); } } } - return new li(r, n); + return new wi(r, n); } static createSet(e, r) { - return new li(e, r); + return new wi(e, r); } } -function Ms(t, e, r, n = !1) { +function Ws(t, e, r, n = !1) { if (e == 0 && r <= 0) return; let i = t.length - 2; i >= 0 && r <= 0 && r == t[i + 1] ? t[i] += e : e == 0 && t[i] == 0 ? t[i + 1] += r : n ? (t[i] += e, t[i + 1] += r) : t.push(e, r); } -function Uh(t, e, r) { +function of(t, e, r) { if (r.length == 0) return; let n = e.length - 2 >> 1; @@ -2608,35 +2608,35 @@ function Uh(t, e, r) { t[t.length - 1] = t[t.length - 1].append(r); else { for (; t.length < n; ) - t.push(Dr.empty); + t.push(qr.empty); t.push(r); } } -function u7(t, e, r) { +function F7(t, e, r) { let n = t.inserted; for (let i = 0, s = 0, a = 0; a < t.sections.length; ) { let o = t.sections[a++], l = t.sections[a++]; if (l < 0) i += o, s += o; else { - let u = i, h = s, f = Dr.empty; + let u = i, h = s, f = qr.empty; for (; u += o, h += l, l && n && (f = f.append(n[a - 2 >> 1])), !(r || a == t.sections.length || t.sections[a + 1] < 0); ) o = t.sections[a++], l = t.sections[a++]; e(i, u, s, h, f), i = u, s = h; } } } -function h7(t, e, r, n = !1) { - let i = [], s = n ? [] : null, a = new By(t), o = new By(e); +function z7(t, e, r, n = !1) { + let i = [], s = n ? [] : null, a = new l2(t), o = new l2(e); for (let l = -1; ; ) if (a.ins == -1 && o.ins == -1) { let u = Math.min(a.len, o.len); - Ms(i, u, -1), a.forward(u), o.forward(u); + Ws(i, u, -1), a.forward(u), o.forward(u); } else if (o.ins >= 0 && (a.ins < 0 || l == a.i || a.off == 0 && (o.len < a.len || o.len == a.len && !r))) { let u = o.len; - for (Ms(i, o.ins, -1); u; ) { + for (Ws(i, o.ins, -1); u; ) { let h = Math.min(a.len, u); - a.ins >= 0 && l < a.i && a.len <= h && (Ms(i, 0, a.ins), s && Uh(s, i, a.text), l = a.i), a.forward(h), u -= h; + a.ins >= 0 && l < a.i && a.len <= h && (Ws(i, 0, a.ins), s && of(s, i, a.text), l = a.i), a.forward(h), u -= h; } o.next(); } else if (a.ins >= 0) { @@ -2649,22 +2649,22 @@ function h7(t, e, r, n = !1) { h -= o.len, o.next(); else break; - Ms(i, u, l < a.i ? a.ins : 0), s && l < a.i && Uh(s, i, a.text), l = a.i, a.forward(a.len - h); + Ws(i, u, l < a.i ? a.ins : 0), s && l < a.i && of(s, i, a.text), l = a.i, a.forward(a.len - h); } else { if (a.done && o.done) - return s ? li.createSet(i, s) : Dc.create(i); + return s ? wi.createSet(i, s) : Kc.create(i); throw new Error("Mismatched change set lengths"); } } -function Vj(t, e, r = !1) { - let n = [], i = r ? [] : null, s = new By(t), a = new By(e); +function SK(t, e, r = !1) { + let n = [], i = r ? [] : null, s = new l2(t), a = new l2(e); for (let o = !1; ; ) { if (s.done && a.done) - return i ? li.createSet(n, i) : Dc.create(n); + return i ? wi.createSet(n, i) : Kc.create(n); if (s.ins == 0) - Ms(n, s.len, 0, o), s.next(); + Ws(n, s.len, 0, o), s.next(); else if (a.len == 0 && !a.done) - Ms(n, 0, a.ins, o), i && Uh(i, n, a.text), a.next(); + Ws(n, 0, a.ins, o), i && of(i, n, a.text), a.next(); else { if (s.done || a.done) throw new Error("Mismatched change set lengths"); @@ -2672,15 +2672,15 @@ function Vj(t, e, r = !1) { let l = Math.min(s.len2, a.len), u = n.length; if (s.ins == -1) { let h = a.ins == -1 ? -1 : a.off ? 0 : a.ins; - Ms(n, l, h, o), i && h && Uh(i, n, a.text); + Ws(n, l, h, o), i && h && of(i, n, a.text); } else - a.ins == -1 ? (Ms(n, s.off ? 0 : s.len, l, o), i && Uh(i, n, s.textBit(l))) : (Ms(n, s.off ? 0 : s.len, a.off ? 0 : a.ins, o), i && !a.off && Uh(i, n, a.text)); + a.ins == -1 ? (Ws(n, s.off ? 0 : s.len, l, o), i && of(i, n, s.textBit(l))) : (Ws(n, s.off ? 0 : s.len, a.off ? 0 : a.ins, o), i && !a.off && of(i, n, a.text)); o = (s.ins > l || a.ins >= 0 && a.len > l) && (o || n.length > u), s.forward2(l), a.forward(l); } } } } -class By { +class l2 { constructor(e) { this.set = e, this.i = 0, this.next(); } @@ -2696,11 +2696,11 @@ class By { } get text() { let { inserted: e } = this.set, r = this.i - 2 >> 1; - return r >= e.length ? Dr.empty : e[r]; + return r >= e.length ? qr.empty : e[r]; } textBit(e) { let { inserted: r } = this.set, n = this.i - 2 >> 1; - return n >= r.length && !e ? Dr.empty : r[n].slice(this.off, e == null ? void 0 : this.off + e); + return n >= r.length && !e ? qr.empty : r[n].slice(this.off, e == null ? void 0 : this.off + e); } forward(e) { e == this.len ? this.next() : (this.len -= e, this.off += e); @@ -2709,7 +2709,7 @@ class By { this.ins == -1 ? this.forward(e) : e == this.ins ? this.next() : (this.ins -= e, this.off += e); } } -class Fd { +class i0 { constructor(e, r, n) { this.from = e, this.to = r, this.flags = n; } @@ -2735,13 +2735,13 @@ class Fd { } map(e, r = -1) { let n, i; - return this.empty ? n = i = e.mapPos(this.from, r) : (n = e.mapPos(this.from, 1), i = e.mapPos(this.to, -1)), n == this.from && i == this.to ? this : new Fd(n, i, this.flags); + return this.empty ? n = i = e.mapPos(this.from, r) : (n = e.mapPos(this.from, 1), i = e.mapPos(this.to, -1)), n == this.from && i == this.to ? this : new i0(n, i, this.flags); } extend(e, r = e) { if (e <= this.anchor && r >= this.anchor) - return Ue.range(e, r); + return je.range(e, r); let n = Math.abs(e - this.anchor) > Math.abs(r - this.anchor) ? e : r; - return Ue.range(this.anchor, n); + return je.range(this.anchor, n); } eq(e) { return this.anchor == e.anchor && this.head == e.head; @@ -2752,18 +2752,18 @@ class Fd { static fromJSON(e) { if (!e || typeof e.anchor != "number" || typeof e.head != "number") throw new RangeError("Invalid JSON representation for SelectionRange"); - return Ue.range(e.anchor, e.head); + return je.range(e.anchor, e.head); } static create(e, r, n) { - return new Fd(e, r, n); + return new i0(e, r, n); } } -class Ue { +class je { constructor(e, r) { this.ranges = e, this.mainIndex = r; } map(e, r = -1) { - return e.empty ? this : Ue.create(this.ranges.map((n) => n.map(e, r)), this.mainIndex); + return e.empty ? this : je.create(this.ranges.map((n) => n.map(e, r)), this.mainIndex); } eq(e) { if (this.ranges.length != e.ranges.length || this.mainIndex != e.mainIndex) @@ -2777,14 +2777,14 @@ class Ue { return this.ranges[this.mainIndex]; } asSingle() { - return this.ranges.length == 1 ? this : new Ue([this.main], 0); + return this.ranges.length == 1 ? this : new je([this.main], 0); } addRange(e, r = !0) { - return Ue.create([e].concat(this.ranges), r ? 0 : this.mainIndex + 1); + return je.create([e].concat(this.ranges), r ? 0 : this.mainIndex + 1); } replaceRange(e, r = this.mainIndex) { let n = this.ranges.slice(); - return n[r] = e, Ue.create(n, this.mainIndex); + return n[r] = e, je.create(n, this.mainIndex); } toJSON() { return { ranges: this.ranges.map((e) => e.toJSON()), main: this.mainIndex }; @@ -2792,10 +2792,10 @@ class Ue { static fromJSON(e) { if (!e || !Array.isArray(e.ranges) || typeof e.main != "number" || e.main >= e.ranges.length) throw new RangeError("Invalid JSON representation for EditorSelection"); - return new Ue(e.ranges.map((r) => Fd.fromJSON(r)), e.main); + return new je(e.ranges.map((r) => i0.fromJSON(r)), e.main); } static single(e, r = e) { - return new Ue([Ue.range(e, r)], 0); + return new je([je.range(e, r)], 0); } static create(e, r = 0) { if (e.length == 0) @@ -2803,17 +2803,17 @@ class Ue { for (let n = 0, i = 0; i < e.length; i++) { let s = e[i]; if (s.empty ? s.from <= n : s.from < n) - return Ue.normalized(e.slice(), r); + return je.normalized(e.slice(), r); n = s.to; } - return new Ue(e, r); + return new je(e, r); } static cursor(e, r = 0, n, i) { - return Fd.create(e, e, (r == 0 ? 0 : r < 0 ? 8 : 16) | (n == null ? 7 : Math.min(6, n)) | (i != null ? i : 16777215) << 6); + return i0.create(e, e, (r == 0 ? 0 : r < 0 ? 8 : 16) | (n == null ? 7 : Math.min(6, n)) | (i != null ? i : 16777215) << 6); } static range(e, r, n, i) { let s = (n != null ? n : 16777215) << 6 | (i == null ? 7 : Math.min(6, i)); - return r < e ? Fd.create(r, e, 48 | s) : Fd.create(e, r, (r > e ? 8 : 0) | s); + return r < e ? i0.create(r, e, 48 | s) : i0.create(e, r, (r > e ? 8 : 0) | s); } static normalized(e, r = 0) { let n = e[r]; @@ -2822,51 +2822,51 @@ class Ue { let s = e[i], a = e[i - 1]; if (s.empty ? s.from <= a.to : s.from < a.to) { let o = a.from, l = Math.max(s.to, a.to); - i <= r && r--, e.splice(--i, 2, s.anchor > s.head ? Ue.range(l, o) : Ue.range(o, l)); + i <= r && r--, e.splice(--i, 2, s.anchor > s.head ? je.range(l, o) : je.range(o, l)); } } - return new Ue(e, r); + return new je(e, r); } } -function qj(t, e) { +function TK(t, e) { for (let r of t.ranges) if (r.to > e) throw new RangeError("Selection points outside of document"); } -let pM = 0; -class At { +let VM = 0; +class $t { constructor(e, r, n, i, s) { - this.combine = e, this.compareInput = r, this.compare = n, this.isStatic = i, this.id = pM++, this.default = e([]), this.extensions = typeof s == "function" ? s(this) : s; + this.combine = e, this.compareInput = r, this.compare = n, this.isStatic = i, this.id = VM++, this.default = e([]), this.extensions = typeof s == "function" ? s(this) : s; } get reader() { return this; } static define(e = {}) { - return new At(e.combine || ((r) => r), e.compareInput || ((r, n) => r === n), e.compare || (e.combine ? (r, n) => r === n : gM), !!e.static, e.enables); + return new $t(e.combine || ((r) => r), e.compareInput || ((r, n) => r === n), e.compare || (e.combine ? (r, n) => r === n : qM), !!e.static, e.enables); } of(e) { - return new C4([], this, 0, e); + return new J4([], this, 0, e); } compute(e, r) { if (this.isStatic) throw new Error("Can't compute a static facet"); - return new C4(e, this, 1, r); + return new J4(e, this, 1, r); } computeN(e, r) { if (this.isStatic) throw new Error("Can't compute a static facet"); - return new C4(e, this, 2, r); + return new J4(e, this, 2, r); } from(e, r) { return r || (r = (n) => n), this.compute([e], (n) => r(n.field(e))); } } -function gM(t, e) { +function qM(t, e) { return t == e || t.length == e.length && t.every((r, n) => r === e[n]); } -class C4 { +class J4 { constructor(e, r, n, i) { - this.dependencies = e, this.facet = r, this.type = n, this.value = i, this.id = pM++; + this.dependencies = e, this.facet = r, this.type = n, this.value = i, this.id = VM++; } dynamicSlot(e) { var r; @@ -2878,9 +2878,9 @@ class C4 { return f.values[a] = n(f), 1; }, update(f, d) { - if (l && d.docChanged || u && (d.docChanged || d.selection) || f7(f, h)) { + if (l && d.docChanged || u && (d.docChanged || d.selection) || Q7(f, h)) { let p = n(f); - if (o ? !PB(p, f.values[a], i) : !i(p, f.values[a])) + if (o ? !gF(p, f.values[a], i) : !i(p, f.values[a])) return f.values[a] = p, 1; } return 0; @@ -2888,8 +2888,8 @@ class C4 { reconfigure: (f, d) => { let p, g = d.config.address[s]; if (g != null) { - let m = z5(d, g); - if (this.dependencies.every((v) => v instanceof At ? d.facet(v) === f.facet(v) : v instanceof In ? d.field(v, !1) == f.field(v, !1) : !0) || (o ? PB(p = n(f), m, i) : i(p = n(f), m))) + let m = dk(d, g); + if (this.dependencies.every((v) => v instanceof $t ? d.facet(v) === f.facet(v) : v instanceof Xn ? d.field(v, !1) == f.field(v, !1) : !0) || (o ? gF(p = n(f), m, i) : i(p = n(f), m))) return f.values[a] = m, 0; } else p = n(f); @@ -2898,7 +2898,7 @@ class C4 { }; } } -function PB(t, e, r) { +function gF(t, e, r) { if (t.length != e.length) return !1; for (let n = 0; n < t.length; n++) @@ -2906,18 +2906,18 @@ function PB(t, e, r) { return !1; return !0; } -function f7(t, e) { +function Q7(t, e) { let r = !1; for (let n of e) - cy(t, n) & 1 && (r = !0); + Dy(t, n) & 1 && (r = !0); return r; } -function ixe(t, e, r) { +function Xxe(t, e, r) { let n = r.map((l) => t[l.id]), i = r.map((l) => l.type), s = n.filter((l) => !(l & 1)), a = t[e.id] >> 1; function o(l) { let u = []; for (let h = 0; h < n.length; h++) { - let f = z5(l, n[h]); + let f = dk(l, n[h]); if (i[h] == 2) for (let d of f) u.push(d); @@ -2929,35 +2929,35 @@ function ixe(t, e, r) { return { create(l) { for (let u of n) - cy(l, u); + Dy(l, u); return l.values[a] = o(l), 1; }, update(l, u) { - if (!f7(l, s)) + if (!Q7(l, s)) return 0; let h = o(l); return e.compare(h, l.values[a]) ? 0 : (l.values[a] = h, 1); }, reconfigure(l, u) { - let h = f7(l, n), f = u.config.facets[e.id], d = u.facet(e); - if (f && !h && gM(r, f)) + let h = Q7(l, n), f = u.config.facets[e.id], d = u.facet(e); + if (f && !h && qM(r, f)) return l.values[a] = d, 0; let p = o(l); return e.compare(p, d) ? (l.values[a] = d, 0) : (l.values[a] = p, 1); } }; } -const NB = /* @__PURE__ */ At.define({ static: !0 }); -class In { +const mF = /* @__PURE__ */ $t.define({ static: !0 }); +class Xn { constructor(e, r, n, i, s) { this.id = e, this.createF = r, this.updateF = n, this.compareF = i, this.spec = s, this.provides = void 0; } static define(e) { - let r = new In(pM++, e.create, e.update, e.compare || ((n, i) => n === i), e); + let r = new Xn(VM++, e.create, e.update, e.compare || ((n, i) => n === i), e); return e.provide && (r.provides = e.provide(r)), r; } create(e) { - let r = e.facet(NB).find((n) => n.field == this); + let r = e.facet(mF).find((n) => n.field == this); return ((r == null ? void 0 : r.create) || this.createF)(e); } slot(e) { @@ -2972,45 +2972,45 @@ class In { }; } init(e) { - return [this, NB.of({ field: this, create: e })]; + return [this, mF.of({ field: this, create: e })]; } get extension() { return this; } } -const Ed = { lowest: 4, low: 3, default: 2, high: 1, highest: 0 }; -function q1(t) { - return (e) => new Yj(e, t); +const Wd = { lowest: 4, low: 3, default: 2, high: 1, highest: 0 }; +function pv(t) { + return (e) => new CK(e, t); } -const Wl = { - highest: /* @__PURE__ */ q1(Ed.highest), - high: /* @__PURE__ */ q1(Ed.high), - default: /* @__PURE__ */ q1(Ed.default), - low: /* @__PURE__ */ q1(Ed.low), - lowest: /* @__PURE__ */ q1(Ed.lowest) +const uc = { + highest: /* @__PURE__ */ pv(Wd.highest), + high: /* @__PURE__ */ pv(Wd.high), + default: /* @__PURE__ */ pv(Wd.default), + low: /* @__PURE__ */ pv(Wd.low), + lowest: /* @__PURE__ */ pv(Wd.lowest) }; -class Yj { +class CK { constructor(e, r) { this.inner = e, this.prec = r; } } -class G0 { +class fp { of(e) { - return new d7(this, e); + return new U7(this, e); } reconfigure(e) { - return G0.reconfigure.of({ compartment: this, extension: e }); + return fp.reconfigure.of({ compartment: this, extension: e }); } get(e) { return e.config.compartments.get(this); } } -class d7 { +class U7 { constructor(e, r) { this.compartment = e, this.inner = r; } } -class F5 { +class fk { constructor(e, r, n, i, s, a) { for (this.base = e, this.compartments = r, this.dynamicSlots = n, this.address = i, this.staticValues = s, this.facets = a, this.statusTemplate = []; this.statusTemplate.length < n.length; ) this.statusTemplate.push(0); @@ -3021,8 +3021,8 @@ class F5 { } static resolve(e, r, n) { let i = [], s = /* @__PURE__ */ Object.create(null), a = /* @__PURE__ */ new Map(); - for (let d of sxe(e, r, a)) - d instanceof In ? i.push(d) : (s[d.facet.id] || (s[d.facet.id] = [])).push(d); + for (let d of Hxe(e, r, a)) + d instanceof Xn ? i.push(d) : (s[d.facet.id] || (s[d.facet.id] = [])).push(d); let o = /* @__PURE__ */ Object.create(null), l = [], u = []; for (let d of i) o[d.id] = u.length << 1, u.push((p) => d.slot(p)); @@ -3030,7 +3030,7 @@ class F5 { for (let d in s) { let p = s[d], g = p[0].facet, m = h && h[d] || []; if (p.every((v) => v.type == 0)) - if (o[g.id] = l.length << 1 | 1, gM(m, p)) + if (o[g.id] = l.length << 1 | 1, qM(m, p)) l.push(n.facet(g)); else { let v = g.combine(p.map((y) => y.value)); @@ -3039,14 +3039,14 @@ class F5 { else { for (let v of p) v.type == 0 ? (o[v.id] = l.length << 1 | 1, l.push(v.value)) : (o[v.id] = u.length << 1, u.push((y) => v.dynamicSlot(y))); - o[g.id] = u.length << 1, u.push((v) => ixe(v, g, p)); + o[g.id] = u.length << 1, u.push((v) => Xxe(v, g, p)); } } let f = u.map((d) => d(o)); - return new F5(e, a, f, o, l, s); + return new fk(e, a, f, o, l, s); } } -function sxe(t, e, r) { +function Hxe(t, e, r) { let n = [[], [], [], [], []], i = /* @__PURE__ */ new Map(); function s(a, o) { let l = i.get(a); @@ -3054,22 +3054,22 @@ function sxe(t, e, r) { if (l <= o) return; let u = n[l].indexOf(a); - u > -1 && n[l].splice(u, 1), a instanceof d7 && r.delete(a.compartment); + u > -1 && n[l].splice(u, 1), a instanceof U7 && r.delete(a.compartment); } if (i.set(a, o), Array.isArray(a)) for (let u of a) s(u, o); - else if (a instanceof d7) { + else if (a instanceof U7) { if (r.has(a.compartment)) throw new RangeError("Duplicate use of compartment in extensions"); let u = e.get(a.compartment) || a.inner; r.set(a.compartment, u), s(u, o); - } else if (a instanceof Yj) + } else if (a instanceof CK) s(a.inner, a.prec); - else if (a instanceof In) + else if (a instanceof Xn) n[o].push(a), a.provides && s(a.provides, o); - else if (a instanceof C4) - n[o].push(a), a.facet.extensions && s(a.facet.extensions, Ed.default); + else if (a instanceof J4) + n[o].push(a), a.facet.extensions && s(a.facet.extensions, Wd.default); else { let u = a.extension; if (!u) @@ -3077,9 +3077,9 @@ function sxe(t, e, r) { s(u, o); } } - return s(t, Ed.default), n.reduce((a, o) => a.concat(o)); + return s(t, Wd.default), n.reduce((a, o) => a.concat(o)); } -function cy(t, e) { +function Dy(t, e) { if (e & 1) return 2; let r = e >> 1, n = t.status[r]; @@ -3091,52 +3091,52 @@ function cy(t, e) { let i = t.computeSlot(t, t.config.dynamicSlots[r]); return t.status[r] = 2 | i; } -function z5(t, e) { +function dk(t, e) { return e & 1 ? t.config.staticValues[e >> 1] : t.values[e >> 1]; } -const Wj = /* @__PURE__ */ At.define(), p7 = /* @__PURE__ */ At.define({ +const EK = /* @__PURE__ */ $t.define(), V7 = /* @__PURE__ */ $t.define({ combine: (t) => t.some((e) => e), static: !0 -}), Gj = /* @__PURE__ */ At.define({ +}), _K = /* @__PURE__ */ $t.define({ combine: (t) => t.length ? t[0] : void 0, static: !0 -}), Xj = /* @__PURE__ */ At.define(), Hj = /* @__PURE__ */ At.define(), Zj = /* @__PURE__ */ At.define(), jj = /* @__PURE__ */ At.define({ +}), AK = /* @__PURE__ */ $t.define(), LK = /* @__PURE__ */ $t.define(), RK = /* @__PURE__ */ $t.define(), MK = /* @__PURE__ */ $t.define({ combine: (t) => t.length ? t[0] : !1 }); -class Ya { +class co { constructor(e, r) { this.type = e, this.value = r; } static define() { - return new axe(); + return new Zxe(); } } -class axe { +class Zxe { of(e) { - return new Ya(this, e); + return new co(this, e); } } -class oxe { +class jxe { constructor(e) { this.map = e; } of(e) { - return new jt(this, e); + return new or(this, e); } } -class jt { +class or { constructor(e, r) { this.type = e, this.value = r; } map(e) { let r = this.type.map(this.value, e); - return r === void 0 ? void 0 : r == this.value ? this : new jt(this.type, r); + return r === void 0 ? void 0 : r == this.value ? this : new or(this.type, r); } is(e) { return this.type == e; } static define(e = {}) { - return new oxe(e.map || ((r) => r)); + return new jxe(e.map || ((r) => r)); } static mapEffects(e, r) { if (!e.length) @@ -3149,14 +3149,14 @@ class jt { return n; } } -jt.reconfigure = /* @__PURE__ */ jt.define(); -jt.appendConfig = /* @__PURE__ */ jt.define(); -class pi { +or.reconfigure = /* @__PURE__ */ or.define(); +or.appendConfig = /* @__PURE__ */ or.define(); +class Ei { constructor(e, r, n, i, s, a) { - this.startState = e, this.changes = r, this.selection = n, this.effects = i, this.annotations = s, this.scrollIntoView = a, this._doc = null, this._state = null, n && qj(n, r.newLength), s.some((o) => o.type == pi.time) || (this.annotations = s.concat(pi.time.of(Date.now()))); + this.startState = e, this.changes = r, this.selection = n, this.effects = i, this.annotations = s, this.scrollIntoView = a, this._doc = null, this._state = null, n && TK(n, r.newLength), s.some((o) => o.type == Ei.time) || (this.annotations = s.concat(Ei.time.of(Date.now()))); } static create(e, r, n, i, s, a) { - return new pi(e, r, n, i, s, a); + return new Ei(e, r, n, i, s, a); } get newDoc() { return this._doc || (this._doc = this.changes.apply(this.startState.doc)); @@ -3179,15 +3179,15 @@ class pi { return this.startState.config != this.state.config; } isUserEvent(e) { - let r = this.annotation(pi.userEvent); + let r = this.annotation(Ei.userEvent); return !!(r && (r == e || r.length > e.length && r.slice(0, e.length) == e && r[e.length] == ".")); } } -pi.time = /* @__PURE__ */ Ya.define(); -pi.userEvent = /* @__PURE__ */ Ya.define(); -pi.addToHistory = /* @__PURE__ */ Ya.define(); -pi.remote = /* @__PURE__ */ Ya.define(); -function lxe(t, e) { +Ei.time = /* @__PURE__ */ co.define(); +Ei.userEvent = /* @__PURE__ */ co.define(); +Ei.addToHistory = /* @__PURE__ */ co.define(); +Ei.remote = /* @__PURE__ */ co.define(); +function Kxe(t, e) { let r = []; for (let n = 0, i = 0; ; ) { let s, a; @@ -3200,113 +3200,113 @@ function lxe(t, e) { !r.length || r[r.length - 1] < s ? r.push(s, a) : r[r.length - 1] < a && (r[r.length - 1] = a); } } -function Kj(t, e, r) { +function DK(t, e, r) { var n; let i, s, a; - return r ? (i = e.changes, s = li.empty(e.changes.length), a = t.changes.compose(e.changes)) : (i = e.changes.map(t.changes), s = t.changes.mapDesc(e.changes, !0), a = t.changes.compose(i)), { + return r ? (i = e.changes, s = wi.empty(e.changes.length), a = t.changes.compose(e.changes)) : (i = e.changes.map(t.changes), s = t.changes.mapDesc(e.changes, !0), a = t.changes.compose(i)), { changes: a, selection: e.selection ? e.selection.map(s) : (n = t.selection) === null || n === void 0 ? void 0 : n.map(i), - effects: jt.mapEffects(t.effects, i).concat(jt.mapEffects(e.effects, s)), + effects: or.mapEffects(t.effects, i).concat(or.mapEffects(e.effects, s)), annotations: t.annotations.length ? t.annotations.concat(e.annotations) : e.annotations, scrollIntoView: t.scrollIntoView || e.scrollIntoView }; } -function g7(t, e, r) { - let n = e.selection, i = og(e.annotations); - return e.userEvent && (i = i.concat(pi.userEvent.of(e.userEvent))), { - changes: e.changes instanceof li ? e.changes : li.of(e.changes || [], r, t.facet(Gj)), - selection: n && (n instanceof Ue ? n : Ue.single(n.anchor, n.head)), - effects: og(e.effects), +function q7(t, e, r) { + let n = e.selection, i = _g(e.annotations); + return e.userEvent && (i = i.concat(Ei.userEvent.of(e.userEvent))), { + changes: e.changes instanceof wi ? e.changes : wi.of(e.changes || [], r, t.facet(_K)), + selection: n && (n instanceof je ? n : je.single(n.anchor, n.head)), + effects: _g(e.effects), annotations: i, scrollIntoView: !!e.scrollIntoView }; } -function Jj(t, e, r) { - let n = g7(t, e.length ? e[0] : {}, t.doc.length); +function PK(t, e, r) { + let n = q7(t, e.length ? e[0] : {}, t.doc.length); e.length && e[0].filter === !1 && (r = !1); for (let s = 1; s < e.length; s++) { e[s].filter === !1 && (r = !1); let a = !!e[s].sequential; - n = Kj(n, g7(t, e[s], a ? n.changes.newLength : t.doc.length), a); + n = DK(n, q7(t, e[s], a ? n.changes.newLength : t.doc.length), a); } - let i = pi.create(t, n.changes, n.selection, n.effects, n.annotations, n.scrollIntoView); - return uxe(r ? cxe(i) : i); + let i = Ei.create(t, n.changes, n.selection, n.effects, n.annotations, n.scrollIntoView); + return ewe(r ? Jxe(i) : i); } -function cxe(t) { +function Jxe(t) { let e = t.startState, r = !0; - for (let i of e.facet(Xj)) { + for (let i of e.facet(AK)) { let s = i(t); if (s === !1) { r = !1; break; } - Array.isArray(s) && (r = r === !0 ? s : lxe(r, s)); + Array.isArray(s) && (r = r === !0 ? s : Kxe(r, s)); } if (r !== !0) { let i, s; if (r === !1) - s = t.changes.invertedDesc, i = li.empty(e.doc.length); + s = t.changes.invertedDesc, i = wi.empty(e.doc.length); else { let a = t.changes.filter(r); i = a.changes, s = a.filtered.mapDesc(a.changes).invertedDesc; } - t = pi.create(e, i, t.selection && t.selection.map(s), jt.mapEffects(t.effects, s), t.annotations, t.scrollIntoView); + t = Ei.create(e, i, t.selection && t.selection.map(s), or.mapEffects(t.effects, s), t.annotations, t.scrollIntoView); } - let n = e.facet(Hj); + let n = e.facet(LK); for (let i = n.length - 1; i >= 0; i--) { let s = n[i](t); - s instanceof pi ? t = s : Array.isArray(s) && s.length == 1 && s[0] instanceof pi ? t = s[0] : t = Jj(e, og(s), !1); + s instanceof Ei ? t = s : Array.isArray(s) && s.length == 1 && s[0] instanceof Ei ? t = s[0] : t = PK(e, _g(s), !1); } return t; } -function uxe(t) { - let e = t.startState, r = e.facet(Zj), n = t; +function ewe(t) { + let e = t.startState, r = e.facet(RK), n = t; for (let i = r.length - 1; i >= 0; i--) { let s = r[i](t); - s && Object.keys(s).length && (n = Kj(n, g7(e, s, t.changes.newLength), !0)); + s && Object.keys(s).length && (n = DK(n, q7(e, s, t.changes.newLength), !0)); } - return n == t ? t : pi.create(e, t.changes, t.selection, n.effects, n.annotations, n.scrollIntoView); + return n == t ? t : Ei.create(e, t.changes, t.selection, n.effects, n.annotations, n.scrollIntoView); } -const hxe = []; -function og(t) { - return t == null ? hxe : Array.isArray(t) ? t : [t]; +const twe = []; +function _g(t) { + return t == null ? twe : Array.isArray(t) ? t : [t]; } -var Tn = /* @__PURE__ */ function(t) { +var Fn = /* @__PURE__ */ function(t) { return t[t.Word = 0] = "Word", t[t.Space = 1] = "Space", t[t.Other = 2] = "Other", t; -}(Tn || (Tn = {})); -const fxe = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; -let m7; +}(Fn || (Fn = {})); +const rwe = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; +let Y7; try { - m7 = /* @__PURE__ */ new RegExp("[\\p{Alphabetic}\\p{Number}_]", "u"); + Y7 = /* @__PURE__ */ new RegExp("[\\p{Alphabetic}\\p{Number}_]", "u"); } catch { } -function dxe(t) { - if (m7) - return m7.test(t); +function nwe(t) { + if (Y7) + return Y7.test(t); for (let e = 0; e < t.length; e++) { let r = t[e]; - if (/\w/.test(r) || r > "\x80" && (r.toUpperCase() != r.toLowerCase() || fxe.test(r))) + if (/\w/.test(r) || r > "\x80" && (r.toUpperCase() != r.toLowerCase() || rwe.test(r))) return !0; } return !1; } -function pxe(t) { +function iwe(t) { return (e) => { if (!/\S/.test(e)) - return Tn.Space; - if (dxe(e)) - return Tn.Word; + return Fn.Space; + if (nwe(e)) + return Fn.Word; for (let r = 0; r < t.length; r++) if (e.indexOf(t[r]) > -1) - return Tn.Word; - return Tn.Other; + return Fn.Word; + return Fn.Other; }; } -class dr { +class Sr { constructor(e, r, n, i, s, a) { this.config = e, this.doc = r, this.selection = n, this.values = i, this.status = e.statusTemplate.slice(), this.computeSlot = s, a && (a._state = this); for (let o = 0; o < this.config.dynamicSlots.length; o++) - cy(this, o << 1); + Dy(this, o << 1); this.computeSlot = null; } field(e, r = !0) { @@ -3316,53 +3316,53 @@ class dr { throw new RangeError("Field is not present in this state"); return; } - return cy(this, n), z5(this, n); + return Dy(this, n), dk(this, n); } update(...e) { - return Jj(this, e, !0); + return PK(this, e, !0); } applyTransaction(e) { let r = this.config, { base: n, compartments: i } = r; for (let o of e.effects) - o.is(G0.reconfigure) ? (r && (i = /* @__PURE__ */ new Map(), r.compartments.forEach((l, u) => i.set(u, l)), r = null), i.set(o.value.compartment, o.value.extension)) : o.is(jt.reconfigure) ? (r = null, n = o.value) : o.is(jt.appendConfig) && (r = null, n = og(n).concat(o.value)); + o.is(fp.reconfigure) ? (r && (i = /* @__PURE__ */ new Map(), r.compartments.forEach((l, u) => i.set(u, l)), r = null), i.set(o.value.compartment, o.value.extension)) : o.is(or.reconfigure) ? (r = null, n = o.value) : o.is(or.appendConfig) && (r = null, n = _g(n).concat(o.value)); let s; - r ? s = e.startState.values.slice() : (r = F5.resolve(n, i, this), s = new dr(r, this.doc, this.selection, r.dynamicSlots.map(() => null), (l, u) => u.reconfigure(l, this), null).values); - let a = e.startState.facet(p7) ? e.newSelection : e.newSelection.asSingle(); - new dr(r, e.newDoc, a, s, (o, l) => l.update(o, e), e); + r ? s = e.startState.values.slice() : (r = fk.resolve(n, i, this), s = new Sr(r, this.doc, this.selection, r.dynamicSlots.map(() => null), (l, u) => u.reconfigure(l, this), null).values); + let a = e.startState.facet(V7) ? e.newSelection : e.newSelection.asSingle(); + new Sr(r, e.newDoc, a, s, (o, l) => l.update(o, e), e); } replaceSelection(e) { return typeof e == "string" && (e = this.toText(e)), this.changeByRange((r) => ({ changes: { from: r.from, to: r.to, insert: e }, - range: Ue.cursor(r.from + e.length) + range: je.cursor(r.from + e.length) })); } changeByRange(e) { - let r = this.selection, n = e(r.ranges[0]), i = this.changes(n.changes), s = [n.range], a = og(n.effects); + let r = this.selection, n = e(r.ranges[0]), i = this.changes(n.changes), s = [n.range], a = _g(n.effects); for (let o = 1; o < r.ranges.length; o++) { let l = e(r.ranges[o]), u = this.changes(l.changes), h = u.map(i); for (let d = 0; d < o; d++) s[d] = s[d].map(h); let f = i.mapDesc(u, !0); - s.push(l.range.map(f)), i = i.compose(h), a = jt.mapEffects(a, h).concat(jt.mapEffects(og(l.effects), f)); + s.push(l.range.map(f)), i = i.compose(h), a = or.mapEffects(a, h).concat(or.mapEffects(_g(l.effects), f)); } return { changes: i, - selection: Ue.create(s, r.mainIndex), + selection: je.create(s, r.mainIndex), effects: a }; } changes(e = []) { - return e instanceof li ? e : li.of(e, this.doc.length, this.facet(dr.lineSeparator)); + return e instanceof wi ? e : wi.of(e, this.doc.length, this.facet(Sr.lineSeparator)); } toText(e) { - return Dr.of(e.split(this.facet(dr.lineSeparator) || c7)); + return qr.of(e.split(this.facet(Sr.lineSeparator) || B7)); } sliceDoc(e = 0, r = this.doc.length) { return this.doc.sliceString(e, r, this.lineBreak); } facet(e) { let r = this.config.address[e.id]; - return r == null ? e.default : (cy(this, r), z5(this, r)); + return r == null ? e.default : (Dy(this, r), dk(this, r)); } toJSON(e) { let r = { @@ -3372,7 +3372,7 @@ class dr { if (e) for (let n in e) { let i = e[n]; - i instanceof In && this.config.address[i.id] != null && (r[n] = i.spec.toJSON(this.field(e[n]), this)); + i instanceof Xn && this.config.address[i.id] != null && (r[n] = i.spec.toJSON(this.field(e[n]), this)); } return r; } @@ -3387,28 +3387,28 @@ class dr { i.push(a.init((l) => a.spec.fromJSON(o, l))); } } - return dr.create({ + return Sr.create({ doc: e.doc, - selection: Ue.fromJSON(e.selection), + selection: je.fromJSON(e.selection), extensions: r.extensions ? i.concat([r.extensions]) : i }); } static create(e = {}) { - let r = F5.resolve(e.extensions || [], /* @__PURE__ */ new Map()), n = e.doc instanceof Dr ? e.doc : Dr.of((e.doc || "").split(r.staticFacet(dr.lineSeparator) || c7)), i = e.selection ? e.selection instanceof Ue ? e.selection : Ue.single(e.selection.anchor, e.selection.head) : Ue.single(0); - return qj(i, n.length), r.staticFacet(p7) || (i = i.asSingle()), new dr(r, n, i, r.dynamicSlots.map(() => null), (s, a) => a.create(s), null); + let r = fk.resolve(e.extensions || [], /* @__PURE__ */ new Map()), n = e.doc instanceof qr ? e.doc : qr.of((e.doc || "").split(r.staticFacet(Sr.lineSeparator) || B7)), i = e.selection ? e.selection instanceof je ? e.selection : je.single(e.selection.anchor, e.selection.head) : je.single(0); + return TK(i, n.length), r.staticFacet(V7) || (i = i.asSingle()), new Sr(r, n, i, r.dynamicSlots.map(() => null), (s, a) => a.create(s), null); } get tabSize() { - return this.facet(dr.tabSize); + return this.facet(Sr.tabSize); } get lineBreak() { - return this.facet(dr.lineSeparator) || ` + return this.facet(Sr.lineSeparator) || ` `; } get readOnly() { - return this.facet(jj); + return this.facet(MK); } phrase(e, ...r) { - for (let n of this.facet(dr.phrases)) + for (let n of this.facet(Sr.phrases)) if (Object.prototype.hasOwnProperty.call(n, e)) { e = n[e]; break; @@ -3422,49 +3422,49 @@ class dr { } languageDataAt(e, r, n = -1) { let i = []; - for (let s of this.facet(Wj)) + for (let s of this.facet(EK)) for (let a of s(this, r, n)) Object.prototype.hasOwnProperty.call(a, e) && i.push(a[e]); return i; } charCategorizer(e) { - return pxe(this.languageDataAt("wordChars", e).join("")); + return iwe(this.languageDataAt("wordChars", e).join("")); } wordAt(e) { let { text: r, from: n, length: i } = this.doc.lineAt(e), s = this.charCategorizer(e), a = e - n, o = e - n; for (; a > 0; ) { - let l = cs(r, a, !1); - if (s(r.slice(l, a)) != Tn.Word) + let l = Os(r, a, !1); + if (s(r.slice(l, a)) != Fn.Word) break; a = l; } for (; o < i; ) { - let l = cs(r, o); - if (s(r.slice(o, l)) != Tn.Word) + let l = Os(r, o); + if (s(r.slice(o, l)) != Fn.Word) break; o = l; } - return a == o ? null : Ue.range(a + n, o + n); + return a == o ? null : je.range(a + n, o + n); } } -dr.allowMultipleSelections = p7; -dr.tabSize = /* @__PURE__ */ At.define({ +Sr.allowMultipleSelections = V7; +Sr.tabSize = /* @__PURE__ */ $t.define({ combine: (t) => t.length ? t[0] : 4 }); -dr.lineSeparator = Gj; -dr.readOnly = jj; -dr.phrases = /* @__PURE__ */ At.define({ +Sr.lineSeparator = _K; +Sr.readOnly = MK; +Sr.phrases = /* @__PURE__ */ $t.define({ compare(t, e) { let r = Object.keys(t), n = Object.keys(e); return r.length == n.length && r.every((i) => t[i] == e[i]); } }); -dr.languageData = Wj; -dr.changeFilter = Xj; -dr.transactionFilter = Hj; -dr.transactionExtender = Zj; -G0.reconfigure = /* @__PURE__ */ jt.define(); -function Zc(t, e, r = {}) { +Sr.languageData = EK; +Sr.changeFilter = AK; +Sr.transactionFilter = LK; +Sr.transactionExtender = RK; +fp.reconfigure = /* @__PURE__ */ or.define(); +function pu(t, e, r = {}) { let n = {}; for (let i of t) for (let s of Object.keys(i)) { @@ -3481,29 +3481,29 @@ function Zc(t, e, r = {}) { n[i] === void 0 && (n[i] = e[i]); return n; } -class c0 { +class _0 { eq(e) { return this == e; } range(e, r = e) { - return Fy.create(e, r, this); + return c2.create(e, r, this); } } -c0.prototype.startSide = c0.prototype.endSide = 0; -c0.prototype.point = !1; -c0.prototype.mapMode = Ci.TrackDel; -class Fy { +_0.prototype.startSide = _0.prototype.endSide = 0; +_0.prototype.point = !1; +_0.prototype.mapMode = Fi.TrackDel; +class c2 { constructor(e, r, n) { this.from = e, this.to = r, this.value = n; } static create(e, r, n) { - return new Fy(e, r, n); + return new c2(e, r, n); } } -function v7(t, e) { +function W7(t, e) { return t.from - e.from || t.value.startSide - e.value.startSide; } -class mM { +class YM { constructor(e, r, n, i) { this.from = e, this.to = r, this.value = n, this.maxPoint = i; } @@ -3538,15 +3538,15 @@ class mM { continue; (p - d || u.endSide - u.startSide) < 0 || (a < 0 && (a = d), u.point && (o = Math.max(o, p - d)), n.push(u), i.push(d - a), s.push(p - a)); } - return { mapped: n.length ? new mM(i, s, n, o) : null, pos: a }; + return { mapped: n.length ? new YM(i, s, n, o) : null, pos: a }; } } -class Er { +class $r { constructor(e, r, n, i) { this.chunkPos = e, this.chunk = r, this.nextLayer = n, this.maxPoint = i; } static create(e, r, n, i) { - return new Er(e, r, n, i); + return new $r(e, r, n, i); } get length() { let e = this.chunk.length - 1; @@ -3567,16 +3567,16 @@ class Er { let { add: r = [], sort: n = !1, filterFrom: i = 0, filterTo: s = this.length } = e, a = e.filter; if (r.length == 0 && !a) return this; - if (n && (r = r.slice().sort(v7)), this.isEmpty) - return r.length ? Er.of(r) : this; - let o = new eK(this, null, -1).goto(0), l = 0, u = [], h = new Hi(); + if (n && (r = r.slice().sort(W7)), this.isEmpty) + return r.length ? $r.of(r) : this; + let o = new NK(this, null, -1).goto(0), l = 0, u = [], h = new os(); for (; o.value || l < r.length; ) if (l < r.length && (o.from - r[l].from || o.startSide - r[l].value.startSide) >= 0) { let f = r[l++]; h.addInner(f.from, f.to, f.value) || u.push(f); } else - o.rangeIndex == 1 && o.chunkIndex < this.chunk.length && (l == r.length || this.chunkEnd(o.chunkIndex) < r[l].from) && (!a || i > this.chunkEnd(o.chunkIndex) || s < this.chunkPos[o.chunkIndex]) && h.addChunk(this.chunkPos[o.chunkIndex], this.chunk[o.chunkIndex]) ? o.nextChunk() : ((!a || i > o.to || s < o.from || a(o.from, o.to, o.value)) && (h.addInner(o.from, o.to, o.value) || u.push(Fy.create(o.from, o.to, o.value))), o.next()); - return h.finishInner(this.nextLayer.isEmpty && !u.length ? Er.empty : this.nextLayer.update({ add: u, filter: a, filterFrom: i, filterTo: s })); + o.rangeIndex == 1 && o.chunkIndex < this.chunk.length && (l == r.length || this.chunkEnd(o.chunkIndex) < r[l].from) && (!a || i > this.chunkEnd(o.chunkIndex) || s < this.chunkPos[o.chunkIndex]) && h.addChunk(this.chunkPos[o.chunkIndex], this.chunk[o.chunkIndex]) ? o.nextChunk() : ((!a || i > o.to || s < o.from || a(o.from, o.to, o.value)) && (h.addInner(o.from, o.to, o.value) || u.push(c2.create(o.from, o.to, o.value))), o.next()); + return h.finishInner(this.nextLayer.isEmpty && !u.length ? $r.empty : this.nextLayer.update({ add: u, filter: a, filterFrom: i, filterTo: s })); } map(e) { if (e.empty || this.isEmpty) @@ -3592,7 +3592,7 @@ class Er { } } let s = this.nextLayer.map(e); - return r.length == 0 ? s : new Er(n, r, s || Er.empty, i); + return r.length == 0 ? s : new $r(n, r, s || $r.empty, i); } between(e, r, n) { if (!this.isEmpty) { @@ -3605,17 +3605,17 @@ class Er { } } iter(e = 0) { - return zy.from([this]).goto(e); + return u2.from([this]).goto(e); } get isEmpty() { return this.nextLayer == this; } static iter(e, r = 0) { - return zy.from(e).goto(r); + return u2.from(e).goto(r); } static compare(e, r, n, i, s = -1) { - let a = e.filter((f) => f.maxPoint > 0 || !f.isEmpty && f.maxPoint >= s), o = r.filter((f) => f.maxPoint > 0 || !f.isEmpty && f.maxPoint >= s), l = IB(a, o, n), u = new Y1(a, l, s), h = new Y1(o, l, s); - n.iterGaps((f, d, p) => $B(u, f, h, d, p, i)), n.empty && n.length == 0 && $B(u, 0, h, 0, 0, i); + let a = e.filter((f) => f.maxPoint > 0 || !f.isEmpty && f.maxPoint >= s), o = r.filter((f) => f.maxPoint > 0 || !f.isEmpty && f.maxPoint >= s), l = vF(a, o, n), u = new gv(a, l, s), h = new gv(o, l, s); + n.iterGaps((f, d, p) => yF(u, f, h, d, p, i)), n.empty && n.length == 0 && yF(u, 0, h, 0, 0, i); } static eq(e, r, n = 0, i) { i == null && (i = 1e9 - 1); @@ -3624,9 +3624,9 @@ class Er { return !1; if (!s.length) return !0; - let o = IB(s, a), l = new Y1(s, o, 0).goto(n), u = new Y1(a, o, 0).goto(n); + let o = vF(s, a), l = new gv(s, o, 0).goto(n), u = new gv(a, o, 0).goto(n); for (; ; ) { - if (l.to != u.to || !y7(l.active, u.active) || l.point && (!u.point || !l.point.eq(u.point))) + if (l.to != u.to || !G7(l.active, u.active) || l.point && (!u.point || !l.point.eq(u.point))) return !1; if (l.to > i) return !0; @@ -3634,7 +3634,7 @@ class Er { } } static spans(e, r, n, i, s = -1) { - let a = new Y1(e, null, s).goto(r), o = r, l = a.openStart; + let a = new gv(e, null, s).goto(r), o = r, l = a.openStart; for (; ; ) { let u = Math.min(a.to, n); if (a.point) { @@ -3648,33 +3648,33 @@ class Er { } } static of(e, r = !1) { - let n = new Hi(); - for (let i of e instanceof Fy ? [e] : r ? gxe(e) : e) + let n = new os(); + for (let i of e instanceof c2 ? [e] : r ? swe(e) : e) n.add(i.from, i.to, i.value); return n.finish(); } } -Er.empty = /* @__PURE__ */ new Er([], [], null, -1); -function gxe(t) { +$r.empty = /* @__PURE__ */ new $r([], [], null, -1); +function swe(t) { if (t.length > 1) for (let e = t[0], r = 1; r < t.length; r++) { let n = t[r]; - if (v7(e, n) > 0) - return t.slice().sort(v7); + if (W7(e, n) > 0) + return t.slice().sort(W7); e = n; } return t; } -Er.empty.nextLayer = Er.empty; -class Hi { +$r.empty.nextLayer = $r.empty; +class os { finishChunk(e) { - this.chunks.push(new mM(this.from, this.to, this.value, this.maxPoint)), this.chunkPos.push(this.chunkStart), this.chunkStart = -1, this.setMaxPoint = Math.max(this.setMaxPoint, this.maxPoint), this.maxPoint = -1, e && (this.from = [], this.to = [], this.value = []); + this.chunks.push(new YM(this.from, this.to, this.value, this.maxPoint)), this.chunkPos.push(this.chunkStart), this.chunkStart = -1, this.setMaxPoint = Math.max(this.setMaxPoint, this.maxPoint), this.maxPoint = -1, e && (this.from = [], this.to = [], this.value = []); } constructor() { this.chunks = [], this.chunkPos = [], this.chunkStart = -1, this.last = null, this.lastFrom = -1e9, this.lastTo = -1e9, this.from = [], this.to = [], this.value = [], this.maxPoint = -1, this.setMaxPoint = -1, this.nextLayer = null; } add(e, r, n) { - this.addInner(e, r, n) || (this.nextLayer || (this.nextLayer = new Hi())).add(e, r, n); + this.addInner(e, r, n) || (this.nextLayer || (this.nextLayer = new os())).add(e, r, n); } addInner(e, r, n) { let i = e - this.lastTo || n.startSide - this.last.endSide; @@ -3690,16 +3690,16 @@ class Hi { return this.last = r.value[n], this.lastFrom = r.from[n] + e, this.lastTo = r.to[n] + e, !0; } finish() { - return this.finishInner(Er.empty); + return this.finishInner($r.empty); } finishInner(e) { if (this.from.length && this.finishChunk(!1), this.chunks.length == 0) return e; - let r = Er.create(this.chunkPos, this.chunks, this.nextLayer ? this.nextLayer.finishInner(e) : e, this.setMaxPoint); + let r = $r.create(this.chunkPos, this.chunks, this.nextLayer ? this.nextLayer.finishInner(e) : e, this.setMaxPoint); return this.from = null, r; } } -function IB(t, e, r) { +function vF(t, e, r) { let n = /* @__PURE__ */ new Map(); for (let s of t) for (let a = 0; a < s.chunk.length; a++) @@ -3712,7 +3712,7 @@ function IB(t, e, r) { } return i; } -class eK { +class NK { constructor(e, r, n, i = 0) { this.layer = e, this.skip = r, this.minPoint = n, this.rank = i; } @@ -3768,7 +3768,7 @@ class eK { return this.from - e.from || this.startSide - e.startSide || this.rank - e.rank || this.to - e.to || this.endSide - e.endSide; } } -class zy { +class u2 { constructor(e) { this.heap = e; } @@ -3776,8 +3776,8 @@ class zy { let i = []; for (let s = 0; s < e.length; s++) for (let a = e[s]; !a.isEmpty; a = a.nextLayer) - a.maxPoint >= n && i.push(new eK(a, r, n, s)); - return i.length == 1 ? i[0] : new zy(i); + a.maxPoint >= n && i.push(new NK(a, r, n, s)); + return i.length == 1 ? i[0] : new u2(i); } get startSide() { return this.value ? this.value.startSide : 0; @@ -3786,14 +3786,14 @@ class zy { for (let n of this.heap) n.goto(e, r); for (let n = this.heap.length >> 1; n >= 0; n--) - BE(this.heap, n); + d_(this.heap, n); return this.next(), this; } forward(e, r) { for (let n of this.heap) n.forward(e, r); for (let n = this.heap.length >> 1; n >= 0; n--) - BE(this.heap, n); + d_(this.heap, n); (this.to - e || this.value.endSide - r) < 0 && this.next(); } next() { @@ -3801,11 +3801,11 @@ class zy { this.from = this.to = 1e9, this.value = null, this.rank = -1; else { let e = this.heap[0]; - this.from = e.from, this.to = e.to, this.value = e.value, this.rank = e.rank, e.value && e.next(), BE(this.heap, 0); + this.from = e.from, this.to = e.to, this.value = e.value, this.rank = e.rank, e.value && e.next(), d_(this.heap, 0); } } } -function BE(t, e) { +function d_(t, e) { for (let r = t[e]; ; ) { let n = (e << 1) + 1; if (n >= t.length) @@ -3816,9 +3816,9 @@ function BE(t, e) { t[n] = r, t[e] = i, e = n; } } -class Y1 { +class gv { constructor(e, r, n) { - this.minPoint = n, this.active = [], this.activeTo = [], this.activeRank = [], this.minActive = -1, this.point = null, this.pointFrom = 0, this.pointRank = 0, this.to = -1e9, this.endSide = 0, this.openStart = -1, this.cursor = zy.from(e, r, n); + this.minPoint = n, this.active = [], this.activeTo = [], this.activeRank = [], this.minActive = -1, this.point = null, this.pointFrom = 0, this.pointRank = 0, this.to = -1e9, this.endSide = 0, this.openStart = -1, this.cursor = u2.from(e, r, n); } goto(e, r = -1e9) { return this.cursor.goto(e, r), this.active.length = this.activeTo.length = this.activeRank.length = 0, this.minActive = -1, this.to = e, this.endSide = r, this.openStart = -1, this.next(), this; @@ -3829,13 +3829,13 @@ class Y1 { this.cursor.forward(e, r); } removeActive(e) { - Rw(this.active, e), Rw(this.activeTo, e), Rw(this.activeRank, e), this.minActive = BB(this.active, this.activeTo); + iO(this.active, e), iO(this.activeTo, e), iO(this.activeRank, e), this.minActive = bF(this.active, this.activeTo); } addActive(e) { let r = 0, { value: n, to: i, rank: s } = this.cursor; for (; r < this.activeRank.length && this.activeRank[r] <= s; ) r++; - Mw(this.active, r, n), Mw(this.activeTo, r, i), Mw(this.activeRank, r, s), e && Mw(e, r, this.cursor.from), this.minActive = BB(this.active, this.activeTo); + sO(this.active, r, n), sO(this.activeTo, r, i), sO(this.activeRank, r, s), e && sO(e, r, this.cursor.from), this.minActive = bF(this.active, this.activeTo); } next() { let e = this.to, r = this.point; @@ -3848,7 +3848,7 @@ class Y1 { this.to = this.activeTo[i], this.endSide = this.active[i].endSide; break; } - this.removeActive(i), n && Rw(n, i); + this.removeActive(i), n && iO(n, i); } else if (this.cursor.value) if (this.cursor.from > e) { this.to = this.cursor.from, this.endSide = this.cursor.startSide; @@ -3890,17 +3890,17 @@ class Y1 { return r; } } -function $B(t, e, r, n, i, s) { +function yF(t, e, r, n, i, s) { t.goto(e), r.goto(n); let a = n + i, o = n, l = n - e; for (; ; ) { let u = t.to + l - r.to || t.endSide - r.endSide, h = u < 0 ? t.to + l : r.to, f = Math.min(h, a); - if (t.point || r.point ? t.point && r.point && (t.point == r.point || t.point.eq(r.point)) && y7(t.activeForPoint(t.to), r.activeForPoint(r.to)) || s.comparePoint(o, f, t.point, r.point) : f > o && !y7(t.active, r.active) && s.compareRange(o, f, t.active, r.active), h > a) + if (t.point || r.point ? t.point && r.point && (t.point == r.point || t.point.eq(r.point)) && G7(t.activeForPoint(t.to), r.activeForPoint(r.to)) || s.comparePoint(o, f, t.point, r.point) : f > o && !G7(t.active, r.active) && s.compareRange(o, f, t.active, r.active), h > a) break; o = h, u <= 0 && t.next(), u >= 0 && r.next(); } } -function y7(t, e) { +function G7(t, e) { if (t.length != e.length) return !1; for (let r = 0; r < t.length; r++) @@ -3908,40 +3908,40 @@ function y7(t, e) { return !1; return !0; } -function Rw(t, e) { +function iO(t, e) { for (let r = e, n = t.length - 1; r < n; r++) t[r] = t[r + 1]; t.pop(); } -function Mw(t, e, r) { +function sO(t, e, r) { for (let n = t.length - 1; n >= e; n--) t[n + 1] = t[n]; t[e] = r; } -function BB(t, e) { +function bF(t, e) { let r = -1, n = 1e9; for (let i = 0; i < e.length; i++) (e[i] - n || t[i].endSide - t[r].endSide) < 0 && (r = i, n = e[i]); return r; } -function $l(t, e, r = t.length) { +function tc(t, e, r = t.length) { let n = 0; for (let i = 0; i < r; ) - t.charCodeAt(i) == 9 ? (n += e - n % e, i++) : (n++, i = cs(t, i)); + t.charCodeAt(i) == 9 ? (n += e - n % e, i++) : (n++, i = Os(t, i)); return n; } -function b7(t, e, r, n) { +function X7(t, e, r, n) { for (let i = 0, s = 0; ; ) { if (s >= e) return i; if (i == t.length) break; - s += t.charCodeAt(i) == 9 ? r - s % r : 1, i = cs(t, i); + s += t.charCodeAt(i) == 9 ? r - s % r : 1, i = Os(t, i); } return n === !0 ? -1 : t.length; } -const x7 = "\u037C", FB = typeof Symbol > "u" ? "__" + x7 : Symbol.for(x7), w7 = typeof Symbol > "u" ? "__styleSet" + Math.floor(Math.random() * 1e8) : Symbol("styleSet"), zB = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : {}; -class Uu { +const H7 = "\u037C", xF = typeof Symbol > "u" ? "__" + H7 : Symbol.for(H7), Z7 = typeof Symbol > "u" ? "__styleSet" + Math.floor(Math.random() * 1e8) : Symbol("styleSet"), wF = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : {}; +class ah { constructor(e, r) { this.rules = []; let { finish: n } = r || {}; @@ -3977,29 +3977,29 @@ class Uu { `); } static newName() { - let e = zB[FB] || 1; - return zB[FB] = e + 1, x7 + e.toString(36); + let e = wF[xF] || 1; + return wF[xF] = e + 1, H7 + e.toString(36); } static mount(e, r, n) { - let i = e[w7], s = n && n.nonce; - i ? s && i.setNonce(s) : i = new mxe(e, s), i.mount(Array.isArray(r) ? r : [r]); + let i = e[Z7], s = n && n.nonce; + i ? s && i.setNonce(s) : i = new awe(e, s), i.mount(Array.isArray(r) ? r : [r]); } } -let QB = /* @__PURE__ */ new Map(); -class mxe { +let OF = /* @__PURE__ */ new Map(); +class awe { constructor(e, r) { let n = e.ownerDocument || e, i = n.defaultView; if (!e.head && e.adoptedStyleSheets && i.CSSStyleSheet) { - let s = QB.get(n); + let s = OF.get(n); if (s) - return e.adoptedStyleSheets = [s.sheet, ...e.adoptedStyleSheets], e[w7] = s; - this.sheet = new i.CSSStyleSheet(), e.adoptedStyleSheets = [this.sheet, ...e.adoptedStyleSheets], QB.set(n, this); + return e.adoptedStyleSheets = [s.sheet, ...e.adoptedStyleSheets], e[Z7] = s; + this.sheet = new i.CSSStyleSheet(), e.adoptedStyleSheets = [this.sheet, ...e.adoptedStyleSheets], OF.set(n, this); } else { this.styleTag = n.createElement("style"), r && this.styleTag.setAttribute("nonce", r); let s = e.head || e; s.insertBefore(this.styleTag, s.firstChild); } - this.modules = [], e[w7] = this; + this.modules = [], e[Z7] = this; } mount(e) { let r = this.sheet, n = 0, i = 0; @@ -4027,7 +4027,7 @@ class mxe { this.styleTag && this.styleTag.getAttribute("nonce") != e && this.styleTag.setAttribute("nonce", e); } } -var gf = { +var Df = { 8: "Backspace", 9: "Tab", 10: "Enter", @@ -4080,7 +4080,7 @@ var gf = { 220: "\\", 221: "]", 222: "'" -}, Qy = { +}, h2 = { 48: ")", 49: "!", 50: "@", @@ -4105,79 +4105,79 @@ var gf = { 220: "|", 221: "}", 222: '"' -}, vxe = typeof navigator < "u" && /Mac/.test(navigator.platform), yxe = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent); -for (var os = 0; os < 10; os++) - gf[48 + os] = gf[96 + os] = String(os); -for (var os = 1; os <= 24; os++) - gf[os + 111] = "F" + os; -for (var os = 65; os <= 90; os++) - gf[os] = String.fromCharCode(os + 32), Qy[os] = String.fromCharCode(os); -for (var FE in gf) - Qy.hasOwnProperty(FE) || (Qy[FE] = gf[FE]); -function bxe(t) { - var e = vxe && t.metaKey && t.shiftKey && !t.ctrlKey && !t.altKey || yxe && t.shiftKey && t.key && t.key.length == 1 || t.key == "Unidentified", r = !e && t.key || (t.shiftKey ? Qy : gf)[t.keyCode] || t.key || "Unidentified"; +}, owe = typeof navigator < "u" && /Mac/.test(navigator.platform), lwe = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent); +for (var xs = 0; xs < 10; xs++) + Df[48 + xs] = Df[96 + xs] = String(xs); +for (var xs = 1; xs <= 24; xs++) + Df[xs + 111] = "F" + xs; +for (var xs = 65; xs <= 90; xs++) + Df[xs] = String.fromCharCode(xs + 32), h2[xs] = String.fromCharCode(xs); +for (var p_ in Df) + h2.hasOwnProperty(p_) || (h2[p_] = Df[p_]); +function cwe(t) { + var e = owe && t.metaKey && t.shiftKey && !t.ctrlKey && !t.altKey || lwe && t.shiftKey && t.key && t.key.length == 1 || t.key == "Unidentified", r = !e && t.key || (t.shiftKey ? h2 : Df)[t.keyCode] || t.key || "Unidentified"; return r == "Esc" && (r = "Escape"), r == "Del" && (r = "Delete"), r == "Left" && (r = "ArrowLeft"), r == "Up" && (r = "ArrowUp"), r == "Right" && (r = "ArrowRight"), r == "Down" && (r = "ArrowDown"), r; } -function Q5(t) { +function pk(t) { let e; return t.nodeType == 11 ? e = t.getSelection ? t : t.ownerDocument : e = t, e.getSelection(); } -function O7(t, e) { +function j7(t, e) { return e ? t == e || t.contains(e.nodeType != 1 ? e.parentNode : e) : !1; } -function xxe(t) { +function uwe(t) { let e = t.activeElement; for (; e && e.shadowRoot; ) e = e.shadowRoot.activeElement; return e; } -function E4(t, e) { +function e5(t, e) { if (!e.anchorNode) return !1; try { - return O7(t, e.anchorNode); + return j7(t, e.anchorNode); } catch { return !1; } } -function Uy(t) { - return t.nodeType == 3 ? u0(t, 0, t.nodeValue.length).getClientRects() : t.nodeType == 1 ? t.getClientRects() : []; +function f2(t) { + return t.nodeType == 3 ? A0(t, 0, t.nodeValue.length).getClientRects() : t.nodeType == 1 ? t.getClientRects() : []; } -function U5(t, e, r, n) { - return r ? UB(t, e, r, n, -1) || UB(t, e, r, n, 1) : !1; +function gk(t, e, r, n) { + return r ? kF(t, e, r, n, -1) || kF(t, e, r, n, 1) : !1; } -function Vy(t) { +function d2(t) { for (var e = 0; ; e++) if (t = t.previousSibling, !t) return e; } -function UB(t, e, r, n, i) { +function kF(t, e, r, n, i) { for (; ; ) { if (t == r && e == n) return !0; - if (e == (i < 0 ? 0 : Vu(t))) { + if (e == (i < 0 ? 0 : oh(t))) { if (t.nodeName == "DIV") return !1; let s = t.parentNode; if (!s || s.nodeType != 1) return !1; - e = Vy(t) + (i < 0 ? 0 : 1), t = s; + e = d2(t) + (i < 0 ? 0 : 1), t = s; } else if (t.nodeType == 1) { if (t = t.childNodes[e + (i < 0 ? -1 : 0)], t.nodeType == 1 && t.contentEditable == "false") return !1; - e = i < 0 ? Vu(t) : 0; + e = i < 0 ? oh(t) : 0; } else return !1; } } -function Vu(t) { +function oh(t) { return t.nodeType == 3 ? t.nodeValue.length : t.childNodes.length; } -function vM(t, e) { +function WM(t, e) { let r = e ? t.left : t.right; return { left: r, right: r, top: t.top, bottom: t.bottom }; } -function wxe(t) { +function hwe(t) { return { left: 0, right: t.innerWidth, @@ -4185,24 +4185,24 @@ function wxe(t) { bottom: t.innerHeight }; } -function tK(t, e) { +function IK(t, e) { let r = e.width / t.offsetWidth, n = e.height / t.offsetHeight; return (r > 0.995 && r < 1.005 || !isFinite(r) || Math.abs(e.width - t.offsetWidth) < 1) && (r = 1), (n > 0.995 && n < 1.005 || !isFinite(n) || Math.abs(e.height - t.offsetHeight) < 1) && (n = 1), { scaleX: r, scaleY: n }; } -function Oxe(t, e, r, n, i, s, a, o) { +function fwe(t, e, r, n, i, s, a, o) { let l = t.ownerDocument, u = l.defaultView || window; for (let h = t, f = !1; h && !f; ) if (h.nodeType == 1) { let d, p = h == l.body, g = 1, m = 1; if (p) - d = wxe(u); + d = hwe(u); else { if (/^(fixed|sticky)$/.test(getComputedStyle(h).position) && (f = !0), h.scrollHeight <= h.clientHeight && h.scrollWidth <= h.clientWidth) { h = h.assignedSlot || h.parentNode; continue; } let b = h.getBoundingClientRect(); - ({ scaleX: g, scaleY: m } = tK(h, b)), d = { + ({ scaleX: g, scaleY: m } = IK(h, b)), d = { left: b.left, right: b.left + h.clientWidth * g, top: b.top, @@ -4244,7 +4244,7 @@ function Oxe(t, e, r, n, i, s, a, o) { else break; } -function kxe(t) { +function dwe(t) { let e = t.ownerDocument; for (let r = t.parentNode; r && r != e.body; ) if (r.nodeType == 1) { @@ -4257,7 +4257,7 @@ function kxe(t) { break; return null; } -class Sxe { +class pwe { constructor() { this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0; } @@ -4266,45 +4266,45 @@ class Sxe { } setRange(e) { let { anchorNode: r, focusNode: n } = e; - this.set(r, Math.min(e.anchorOffset, r ? Vu(r) : 0), n, Math.min(e.focusOffset, n ? Vu(n) : 0)); + this.set(r, Math.min(e.anchorOffset, r ? oh(r) : 0), n, Math.min(e.focusOffset, n ? oh(n) : 0)); } set(e, r, n, i) { this.anchorNode = e, this.anchorOffset = r, this.focusNode = n, this.focusOffset = i; } } -let Op = null; -function rK(t) { +let Vp = null; +function $K(t) { if (t.setActive) return t.setActive(); - if (Op) - return t.focus(Op); + if (Vp) + return t.focus(Vp); let e = []; for (let r = t; r && (e.push(r, r.scrollTop, r.scrollLeft), r != r.ownerDocument); r = r.parentNode) ; - if (t.focus(Op == null ? { + if (t.focus(Vp == null ? { get preventScroll() { - return Op = { preventScroll: !0 }, !0; + return Vp = { preventScroll: !0 }, !0; } - } : void 0), !Op) { - Op = !1; + } : void 0), !Vp) { + Vp = !1; for (let r = 0; r < e.length; ) { let n = e[r++], i = e[r++], s = e[r++]; n.scrollTop != i && (n.scrollTop = i), n.scrollLeft != s && (n.scrollLeft = s); } } } -let VB; -function u0(t, e, r = e) { - let n = VB || (VB = document.createRange()); +let SF; +function A0(t, e, r = e) { + let n = SF || (SF = document.createRange()); return n.setEnd(t, r), n.setStart(t, e), n; } -function lg(t, e, r) { +function Ag(t, e, r) { let n = { key: e, code: e, keyCode: r, which: r, cancelable: !0 }, i = new KeyboardEvent("keydown", n); i.synthetic = !0, t.dispatchEvent(i); let s = new KeyboardEvent("keyup", n); return s.synthetic = !0, t.dispatchEvent(s), i.defaultPrevented || s.defaultPrevented; } -function Txe(t) { +function gwe(t) { for (; t; ) { if (t && (t.nodeType == 9 || t.nodeType == 11 && t.host)) return t; @@ -4312,42 +4312,42 @@ function Txe(t) { } return null; } -function nK(t) { +function BK(t) { for (; t.attributes.length; ) t.removeAttributeNode(t.attributes[0]); } -function Cxe(t, e) { +function mwe(t, e) { let r = e.focusNode, n = e.focusOffset; if (!r || e.anchorNode != r || e.anchorOffset != n) return !1; - for (n = Math.min(n, Vu(r)); ; ) + for (n = Math.min(n, oh(r)); ; ) if (n) { if (r.nodeType != 1) return !1; let i = r.childNodes[n - 1]; - i.contentEditable == "false" ? n-- : (r = i, n = Vu(r)); + i.contentEditable == "false" ? n-- : (r = i, n = oh(r)); } else { if (r == t) return !0; - n = Vy(r), r = r.parentNode; + n = d2(r), r = r.parentNode; } } -function iK(t) { +function FK(t) { return t.scrollTop > Math.max(1, t.scrollHeight - t.clientHeight - 4); } -class Ns { +class Hs { constructor(e, r, n = !0) { this.node = e, this.offset = r, this.precise = n; } static before(e, r) { - return new Ns(e.parentNode, Vy(e), r); + return new Hs(e.parentNode, d2(e), r); } static after(e, r) { - return new Ns(e.parentNode, Vy(e) + 1, r); + return new Hs(e.parentNode, d2(e) + 1, r); } } -const yM = []; -class bn { +const GM = []; +class Dn { constructor() { this.parent = null, this.dom = null, this.flags = 2; } @@ -4378,20 +4378,20 @@ class bn { for (let a of this.children) { if (a.flags & 7) { if (!a.dom && (s = i ? i.nextSibling : n.firstChild)) { - let o = bn.get(s); + let o = Dn.get(s); (!o || !o.parent && o.canReuseDOM(a)) && a.reuseDOM(s); } a.sync(e, r), a.flags &= -8; } if (s = i ? i.nextSibling : n.firstChild, r && !r.written && r.node == n && s != a.dom && (r.written = !0), a.dom.parentNode == n) for (; s && s != a.dom; ) - s = qB(s); + s = TF(s); else n.insertBefore(a.dom, s); i = a.dom; } for (s = i ? i.nextSibling : n.firstChild, s && r && r.node == n && (r.written = !0); s; ) - s = qB(s); + s = TF(s); } else if (this.flags & 1) for (let n of this.children) n.flags & 7 && (n.sync(e, r), n.flags &= -8); @@ -4403,7 +4403,7 @@ class bn { if (e == this.dom) n = this.dom.childNodes[r]; else { - let i = Vu(e) == 0 ? 0 : r == 0 ? -1 : 1; + let i = oh(e) == 0 ? 0 : r == 0 ? -1 : 1; for (; ; ) { let s = e.parentNode; if (s == this.dom) @@ -4414,7 +4414,7 @@ class bn { } if (n == this.dom.firstChild) return 0; - for (; n && !bn.get(n); ) + for (; n && !Dn.get(n); ) n = n.nextSibling; if (!n) return this.length; @@ -4468,7 +4468,7 @@ class bn { e = r; } } - replaceChildren(e, r, n = yM) { + replaceChildren(e, r, n = GM) { this.markDirty(); for (let i = e; i < r; i++) { let s = this.children[i]; @@ -4485,7 +4485,7 @@ class bn { return !1; } childCursor(e = this.length) { - return new sK(this.children, e, this.children.length); + return new zK(this.children, e, this.children.length); } childPos(e, r = 1) { return this.childCursor().findPos(e, r); @@ -4524,12 +4524,12 @@ class bn { this.parent = null; } } -bn.prototype.breakAfter = 0; -function qB(t) { +Dn.prototype.breakAfter = 0; +function TF(t) { let e = t.nextSibling; return t.parentNode.removeChild(t), e; } -class sK { +class zK { constructor(e, r, n) { this.children = e, this.pos = r, this.i = n, this.off = 0; } @@ -4542,7 +4542,7 @@ class sK { } } } -function aK(t, e, r, n, i, s, a, o, l) { +function QK(t, e, r, n, i, s, a, o, l) { let { children: u } = t, h = u.length ? u[e] : null, f = s.length ? s[s.length - 1] : null, d = f ? f.breakAfter : a; if (!(e == n && h && !a && !d && s.length < 2 && h.merge(r, i, s.length ? f : null, r == 0, o, l))) { if (n < u.length) { @@ -4559,33 +4559,33 @@ function aK(t, e, r, n, i, s, a, o, l) { !s.length && e && n < u.length && !u[e - 1].breakAfter && u[n].merge(0, 0, u[e - 1], !1, o, l) && e--, (e < n || s.length) && t.replaceChildren(e, n, s); } } -function oK(t, e, r, n, i, s) { +function UK(t, e, r, n, i, s) { let a = t.childCursor(), { i: o, off: l } = a.findPos(r, 1), { i: u, off: h } = a.findPos(e, -1), f = e - r; for (let d of n) f += d.length; - t.length += f, aK(t, u, h, o, l, n, 0, i, s); -} -let lo = typeof navigator < "u" ? navigator : { userAgent: "", vendor: "", platform: "" }, k7 = typeof document < "u" ? document : { documentElement: { style: {} } }; -const S7 = /* @__PURE__ */ /Edge\/(\d+)/.exec(lo.userAgent), lK = /* @__PURE__ */ /MSIE \d/.test(lo.userAgent), T7 = /* @__PURE__ */ /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(lo.userAgent), aT = !!(lK || T7 || S7), YB = !aT && /* @__PURE__ */ /gecko\/(\d+)/i.test(lo.userAgent), zE = !aT && /* @__PURE__ */ /Chrome\/(\d+)/.exec(lo.userAgent), WB = "webkitFontSmoothing" in k7.documentElement.style, cK = !aT && /* @__PURE__ */ /Apple Computer/.test(lo.vendor), GB = cK && (/* @__PURE__ */ /Mobile\/\w+/.test(lo.userAgent) || lo.maxTouchPoints > 2); -var Pt = { - mac: GB || /* @__PURE__ */ /Mac/.test(lo.platform), - windows: /* @__PURE__ */ /Win/.test(lo.platform), - linux: /* @__PURE__ */ /Linux|X11/.test(lo.platform), - ie: aT, - ie_version: lK ? k7.documentMode || 6 : T7 ? +T7[1] : S7 ? +S7[1] : 0, - gecko: YB, - gecko_version: YB ? +(/* @__PURE__ */ /Firefox\/(\d+)/.exec(lo.userAgent) || [0, 0])[1] : 0, - chrome: !!zE, - chrome_version: zE ? +zE[1] : 0, - ios: GB, - android: /* @__PURE__ */ /Android\b/.test(lo.userAgent), - webkit: WB, - safari: cK, - webkit_version: WB ? +(/* @__PURE__ */ /\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0, - tabSize: k7.documentElement.style.tabSize != null ? "tab-size" : "-moz-tab-size" -}; -const Exe = 256; -class qu extends bn { + t.length += f, QK(t, u, h, o, l, n, 0, i, s); +} +let Co = typeof navigator < "u" ? navigator : { userAgent: "", vendor: "", platform: "" }, K7 = typeof document < "u" ? document : { documentElement: { style: {} } }; +const J7 = /* @__PURE__ */ /Edge\/(\d+)/.exec(Co.userAgent), VK = /* @__PURE__ */ /MSIE \d/.test(Co.userAgent), e8 = /* @__PURE__ */ /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Co.userAgent), DT = !!(VK || e8 || J7), CF = !DT && /* @__PURE__ */ /gecko\/(\d+)/i.test(Co.userAgent), g_ = !DT && /* @__PURE__ */ /Chrome\/(\d+)/.exec(Co.userAgent), EF = "webkitFontSmoothing" in K7.documentElement.style, qK = !DT && /* @__PURE__ */ /Apple Computer/.test(Co.vendor), _F = qK && (/* @__PURE__ */ /Mobile\/\w+/.test(Co.userAgent) || Co.maxTouchPoints > 2); +var Vt = { + mac: _F || /* @__PURE__ */ /Mac/.test(Co.platform), + windows: /* @__PURE__ */ /Win/.test(Co.platform), + linux: /* @__PURE__ */ /Linux|X11/.test(Co.platform), + ie: DT, + ie_version: VK ? K7.documentMode || 6 : e8 ? +e8[1] : J7 ? +J7[1] : 0, + gecko: CF, + gecko_version: CF ? +(/* @__PURE__ */ /Firefox\/(\d+)/.exec(Co.userAgent) || [0, 0])[1] : 0, + chrome: !!g_, + chrome_version: g_ ? +g_[1] : 0, + ios: _F, + android: /* @__PURE__ */ /Android\b/.test(Co.userAgent), + webkit: EF, + safari: qK, + webkit_version: EF ? +(/* @__PURE__ */ /\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0, + tabSize: K7.documentElement.style.tabSize != null ? "tab-size" : "-moz-tab-size" +}; +const vwe = 256; +class lh extends Dn { constructor(e) { super(), this.text = e; } @@ -4602,33 +4602,33 @@ class qu extends bn { e.nodeType == 3 && this.createDOM(e); } merge(e, r, n) { - return this.flags & 8 || n && (!(n instanceof qu) || this.length - (r - e) + n.length > Exe || n.flags & 8) ? !1 : (this.text = this.text.slice(0, e) + (n ? n.text : "") + this.text.slice(r), this.markDirty(), !0); + return this.flags & 8 || n && (!(n instanceof lh) || this.length - (r - e) + n.length > vwe || n.flags & 8) ? !1 : (this.text = this.text.slice(0, e) + (n ? n.text : "") + this.text.slice(r), this.markDirty(), !0); } split(e) { - let r = new qu(this.text.slice(e)); + let r = new lh(this.text.slice(e)); return this.text = this.text.slice(0, e), this.markDirty(), r.flags |= this.flags & 8, r; } localPosFromDOM(e, r) { return e == this.dom ? r : r ? this.text.length : 0; } domAtPos(e) { - return new Ns(this.dom, e); + return new Hs(this.dom, e); } domBoundsAround(e, r, n) { return { from: n, to: n + this.length, startDOM: this.dom, endDOM: this.dom.nextSibling }; } coordsAt(e, r) { - return _xe(this.dom, e, r); + return ywe(this.dom, e, r); } } -class Yu extends bn { +class ch extends Dn { constructor(e, r = [], n = 0) { super(), this.mark = e, this.children = r, this.length = n; for (let i of r) i.setParent(this); } setAttrs(e) { - if (nK(e), this.mark.class && (e.className = this.mark.class), this.mark.attrs) + if (BK(e), this.mark.class && (e.className = this.mark.class), this.mark.attrs) for (let r in this.mark.attrs) e.setAttribute(r, this.mark.attrs[r]); return e; @@ -4643,7 +4643,7 @@ class Yu extends bn { this.dom ? this.flags & 4 && this.setAttrs(this.dom) : this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))), super.sync(e, r); } merge(e, r, n, i, s, a) { - return n && (!(n instanceof Yu && n.mark.eq(this.mark)) || e && s <= 0 || r < this.length && a <= 0) ? !1 : (oK(this, e, r, n ? n.children.slice() : [], s - 1, a - 1), this.markDirty(), !0); + return n && (!(n instanceof ch && n.mark.eq(this.mark)) || e && s <= 0 || r < this.length && a <= 0) ? !1 : (UK(this, e, r, n ? n.children.slice() : [], s - 1, a - 1), this.markDirty(), !0); } split(e) { let r = [], n = 0, i = -1, s = 0; @@ -4652,35 +4652,35 @@ class Yu extends bn { l > e && r.push(n < e ? o.split(e - n) : o), i < 0 && n >= e && (i = s), n = l, s++; } let a = this.length - e; - return this.length = e, i > -1 && (this.children.length = i, this.markDirty()), new Yu(this.mark, r, a); + return this.length = e, i > -1 && (this.children.length = i, this.markDirty()), new ch(this.mark, r, a); } domAtPos(e) { - return uK(this, e); + return YK(this, e); } coordsAt(e, r) { - return fK(this, e, r); + return GK(this, e, r); } } -function _xe(t, e, r) { +function ywe(t, e, r) { let n = t.nodeValue.length; e > n && (e = n); let i = e, s = e, a = 0; - e == 0 && r < 0 || e == n && r >= 0 ? Pt.chrome || Pt.gecko || (e ? (i--, a = 1) : s < n && (s++, a = -1)) : r < 0 ? i-- : s < n && s++; - let o = u0(t, i, s).getClientRects(); + e == 0 && r < 0 || e == n && r >= 0 ? Vt.chrome || Vt.gecko || (e ? (i--, a = 1) : s < n && (s++, a = -1)) : r < 0 ? i-- : s < n && s++; + let o = A0(t, i, s).getClientRects(); if (!o.length) return null; let l = o[(a ? a < 0 : r >= 0) ? 0 : o.length - 1]; - return Pt.safari && !a && l.width == 0 && (l = Array.prototype.find.call(o, (u) => u.width) || l), a ? vM(l, a < 0) : l || null; + return Vt.safari && !a && l.width == 0 && (l = Array.prototype.find.call(o, (u) => u.width) || l), a ? WM(l, a < 0) : l || null; } -class Vh extends bn { +class lf extends Dn { static create(e, r, n) { - return new Vh(e, r, n); + return new lf(e, r, n); } constructor(e, r, n) { super(), this.widget = e, this.length = r, this.side = n, this.prevWidget = null; } split(e) { - let r = Vh.create(this.widget, this.length - e, this.side); + let r = lf.create(this.widget, this.length - e, this.side); return this.length -= e, r; } sync(e) { @@ -4690,10 +4690,10 @@ class Vh extends bn { return this.side; } merge(e, r, n, i, s, a) { - return n && (!(n instanceof Vh) || !this.widget.compare(n.widget) || e > 0 && s <= 0 || r < this.length && a <= 0) ? !1 : (this.length = e + (n ? n.length : 0) + (this.length - r), !0); + return n && (!(n instanceof lf) || !this.widget.compare(n.widget) || e > 0 && s <= 0 || r < this.length && a <= 0) ? !1 : (this.length = e + (n ? n.length : 0) + (this.length - r), !0); } become(e) { - return e instanceof Vh && e.side == this.side && this.widget.constructor == e.widget.constructor ? (this.widget.compare(e.widget) || this.markDirty(!0), this.dom && !this.prevWidget && (this.prevWidget = this.widget), this.widget = e.widget, this.length = e.length, !0) : !1; + return e instanceof lf && e.side == this.side && this.widget.constructor == e.widget.constructor ? (this.widget.compare(e.widget) || this.markDirty(!0), this.dom && !this.prevWidget && (this.prevWidget = this.widget), this.widget = e.widget, this.length = e.length, !0) : !1; } ignoreMutation() { return !0; @@ -4703,15 +4703,15 @@ class Vh extends bn { } get overrideDOMText() { if (this.length == 0) - return Dr.empty; + return qr.empty; let e = this; for (; e.parent; ) e = e.parent; let { view: r } = e, n = r && r.state.doc, i = this.posAtStart; - return n ? n.slice(i, i + this.length) : Dr.empty; + return n ? n.slice(i, i + this.length) : qr.empty; } domAtPos(e) { - return (this.length ? e == 0 : this.side > 0) ? Ns.before(this.dom) : Ns.after(this.dom, e == this.length); + return (this.length ? e == 0 : this.side > 0) ? Hs.before(this.dom) : Hs.after(this.dom, e == this.length); } domBoundsAround() { return null; @@ -4726,7 +4726,7 @@ class Vh extends bn { let a = this.side ? this.side < 0 : e > 0; for (let o = a ? i.length - 1 : 0; s = i[o], !(e > 0 ? o == 0 : o == i.length - 1 || s.top < s.bottom); o += a ? -1 : 1) ; - return vM(s, !a); + return WM(s, !a); } get isEditable() { return !1; @@ -4741,7 +4741,7 @@ class Vh extends bn { super.destroy(), this.dom && this.widget.destroy(this.dom); } } -class qg extends bn { +class hm extends Dn { constructor(e) { super(), this.side = e; } @@ -4752,10 +4752,10 @@ class qg extends bn { return !1; } become(e) { - return e instanceof qg && e.side == this.side; + return e instanceof hm && e.side == this.side; } split() { - return new qg(this.side); + return new hm(this.side); } sync() { if (!this.dom) { @@ -4767,7 +4767,7 @@ class qg extends bn { return this.side; } domAtPos(e) { - return this.side > 0 ? Ns.before(this.dom) : Ns.after(this.dom); + return this.side > 0 ? Hs.before(this.dom) : Hs.after(this.dom); } localPosFromDOM() { return 0; @@ -4779,14 +4779,14 @@ class qg extends bn { return this.dom.getBoundingClientRect(); } get overrideDOMText() { - return Dr.empty; + return qr.empty; } get isHidden() { return !0; } } -qu.prototype.children = Vh.prototype.children = qg.prototype.children = yM; -function uK(t, e) { +lh.prototype.children = lf.prototype.children = hm.prototype.children = GM; +function YK(t, e) { let r = t.dom, { children: n } = t, i = 0; for (let s = 0; i < n.length; i++) { let a = n[i], o = s + a.length; @@ -4808,13 +4808,13 @@ function uK(t, e) { if (a.dom.parentNode == r) return a.domAtPos(0); } - return new Ns(r, 0); + return new Hs(r, 0); } -function hK(t, e, r) { +function WK(t, e, r) { let n, { children: i } = t; - r > 0 && e instanceof Yu && i.length && (n = i[i.length - 1]) instanceof Yu && n.mark.eq(e.mark) ? hK(n, e.children[0], r - 1) : (i.push(e), e.setParent(t)), t.length += e.length; + r > 0 && e instanceof ch && i.length && (n = i[i.length - 1]) instanceof ch && n.mark.eq(e.mark) ? WK(n, e.children[0], r - 1) : (i.push(e), e.setParent(t)), t.length += e.length; } -function fK(t, e, r) { +function GK(t, e, r) { let n = null, i = -1, s = null, a = -1; function o(u, h) { for (let f = 0, d = 0; f < u.children.length && d <= h; f++) { @@ -4824,25 +4824,25 @@ function fK(t, e, r) { } o(t, e); let l = (r < 0 ? n : s) || n || s; - return l ? l.coordsAt(Math.max(0, l == n ? i : a), r) : Axe(t); + return l ? l.coordsAt(Math.max(0, l == n ? i : a), r) : bwe(t); } -function Axe(t) { +function bwe(t) { let e = t.dom.lastChild; if (!e) return t.dom.getBoundingClientRect(); - let r = Uy(e); + let r = f2(e); return r[r.length - 1] || null; } -function C7(t, e) { +function t8(t, e) { for (let r in t) r == "class" && e.class ? e.class += " " + t.class : r == "style" && e.style ? e.style += ";" + t.style : e[r] = t[r]; return e; } -const XB = /* @__PURE__ */ Object.create(null); -function bM(t, e, r) { +const AF = /* @__PURE__ */ Object.create(null); +function XM(t, e, r) { if (t == e) return !0; - t || (t = XB), e || (e = XB); + t || (t = AF), e || (e = AF); let n = Object.keys(t), i = Object.keys(e); if (n.length - (r && n.indexOf(r) > -1 ? 1 : 0) != i.length - (r && i.indexOf(r) > -1 ? 1 : 0)) return !1; @@ -4851,7 +4851,7 @@ function bM(t, e, r) { return !1; return !0; } -function E7(t, e, r) { +function r8(t, e, r) { let n = !1; if (e) for (let i in e) @@ -4861,7 +4861,7 @@ function E7(t, e, r) { e && e[i] == r[i] || (n = !0, i == "style" ? t.style.cssText = r[i] : t.setAttribute(i, r[i])); return n; } -function Lxe(t) { +function xwe(t) { let e = /* @__PURE__ */ Object.create(null); for (let r = 0; r < t.attributes.length; r++) { let n = t.attributes[r]; @@ -4869,20 +4869,20 @@ function Lxe(t) { } return e; } -class wi extends bn { +class Pi extends Dn { constructor() { super(...arguments), this.children = [], this.length = 0, this.prevAttrs = void 0, this.attrs = null, this.breakAfter = 0; } merge(e, r, n, i, s, a) { if (n) { - if (!(n instanceof wi)) + if (!(n instanceof Pi)) return !1; this.dom || n.transferDOM(this); } - return i && this.setDeco(n ? n.attrs : null), oK(this, e, r, n ? n.children.slice() : [], s, a), !0; + return i && this.setDeco(n ? n.attrs : null), UK(this, e, r, n ? n.children.slice() : [], s, a), !0; } split(e) { - let r = new wi(); + let r = new Pi(); if (r.breakAfter = this.breakAfter, this.length == 0) return r; let { i: n, off: i } = this.childPos(e); @@ -4897,28 +4897,28 @@ class wi extends bn { !this.dom || (this.markDirty(), e.setDOM(this.dom), e.prevAttrs = this.prevAttrs === void 0 ? this.attrs : this.prevAttrs, this.prevAttrs = void 0, this.dom = null); } setDeco(e) { - bM(this.attrs, e) || (this.dom && (this.prevAttrs = this.attrs, this.markDirty()), this.attrs = e); + XM(this.attrs, e) || (this.dom && (this.prevAttrs = this.attrs, this.markDirty()), this.attrs = e); } append(e, r) { - hK(this, e, r); + WK(this, e, r); } addLineDeco(e) { let r = e.spec.attributes, n = e.spec.class; - r && (this.attrs = C7(r, this.attrs || {})), n && (this.attrs = C7({ class: n }, this.attrs || {})); + r && (this.attrs = t8(r, this.attrs || {})), n && (this.attrs = t8({ class: n }, this.attrs || {})); } domAtPos(e) { - return uK(this, e); + return YK(this, e); } reuseDOM(e) { e.nodeName == "DIV" && (this.setDOM(e), this.flags |= 6); } sync(e, r) { var n; - this.dom ? this.flags & 4 && (nK(this.dom), this.dom.className = "cm-line", this.prevAttrs = this.attrs ? null : void 0) : (this.setDOM(document.createElement("div")), this.dom.className = "cm-line", this.prevAttrs = this.attrs ? null : void 0), this.prevAttrs !== void 0 && (E7(this.dom, this.prevAttrs, this.attrs), this.dom.classList.add("cm-line"), this.prevAttrs = void 0), super.sync(e, r); + this.dom ? this.flags & 4 && (BK(this.dom), this.dom.className = "cm-line", this.prevAttrs = this.attrs ? null : void 0) : (this.setDOM(document.createElement("div")), this.dom.className = "cm-line", this.prevAttrs = this.attrs ? null : void 0), this.prevAttrs !== void 0 && (r8(this.dom, this.prevAttrs, this.attrs), this.dom.classList.add("cm-line"), this.prevAttrs = void 0), super.sync(e, r); let i = this.dom.lastChild; - for (; i && bn.get(i) instanceof Yu; ) + for (; i && Dn.get(i) instanceof ch; ) i = i.lastChild; - if (!i || !this.length || i.nodeName != "BR" && ((n = bn.get(i)) === null || n === void 0 ? void 0 : n.isEditable) == !1 && (!Pt.ios || !this.children.some((s) => s instanceof qu))) { + if (!i || !this.length || i.nodeName != "BR" && ((n = Dn.get(i)) === null || n === void 0 ? void 0 : n.isEditable) == !1 && (!Vt.ios || !this.children.some((s) => s instanceof lh))) { let s = document.createElement("BR"); s.cmIgnore = !0, this.dom.appendChild(s); } @@ -4928,9 +4928,9 @@ class wi extends bn { return null; let e = 0, r; for (let n of this.children) { - if (!(n instanceof qu) || /[^ -~]/.test(n.text)) + if (!(n instanceof lh) || /[^ -~]/.test(n.text)) return null; - let i = Uy(n.dom); + let i = f2(n.dom); if (i.length != 1) return null; e += i[0].width, r = i[0].height; @@ -4942,7 +4942,7 @@ class wi extends bn { } : null; } coordsAt(e, r) { - let n = fK(this, e, r); + let n = GK(this, e, r); if (!this.children.length && n && this.parent) { let { heightOracle: i } = this.parent.view.viewState, s = n.bottom - n.top; if (Math.abs(s - i.lineHeight) < 2 && i.textHeight < s) { @@ -4962,7 +4962,7 @@ class wi extends bn { for (let n = 0, i = 0; n < e.children.length; n++) { let s = e.children[n], a = i + s.length; if (a >= r) { - if (s instanceof wi) + if (s instanceof Pi) return s; if (a > r) break; @@ -4972,36 +4972,36 @@ class wi extends bn { return null; } } -class ef extends bn { +class bf extends Dn { constructor(e, r, n) { super(), this.widget = e, this.length = r, this.deco = n, this.breakAfter = 0, this.prevWidget = null; } merge(e, r, n, i, s, a) { - return n && (!(n instanceof ef) || !this.widget.compare(n.widget) || e > 0 && s <= 0 || r < this.length && a <= 0) ? !1 : (this.length = e + (n ? n.length : 0) + (this.length - r), !0); + return n && (!(n instanceof bf) || !this.widget.compare(n.widget) || e > 0 && s <= 0 || r < this.length && a <= 0) ? !1 : (this.length = e + (n ? n.length : 0) + (this.length - r), !0); } domAtPos(e) { - return e == 0 ? Ns.before(this.dom) : Ns.after(this.dom, e == this.length); + return e == 0 ? Hs.before(this.dom) : Hs.after(this.dom, e == this.length); } split(e) { let r = this.length - e; this.length = e; - let n = new ef(this.widget, r, this.deco); + let n = new bf(this.widget, r, this.deco); return n.breakAfter = this.breakAfter, n; } get children() { - return yM; + return GM; } sync(e) { (!this.dom || !this.widget.updateDOM(this.dom, e)) && (this.dom && this.prevWidget && this.prevWidget.destroy(this.dom), this.prevWidget = null, this.setDOM(this.widget.toDOM(e)), this.dom.contentEditable = "false"); } get overrideDOMText() { - return this.parent ? this.parent.view.state.doc.slice(this.posAtStart, this.posAtEnd) : Dr.empty; + return this.parent ? this.parent.view.state.doc.slice(this.posAtStart, this.posAtEnd) : qr.empty; } domBoundsAround() { return null; } become(e) { - return e instanceof ef && e.widget.constructor == this.widget.constructor ? (e.widget.compare(this.widget) || this.markDirty(!0), this.dom && !this.prevWidget && (this.prevWidget = this.widget), this.widget = e.widget, this.length = e.length, this.deco = e.deco, this.breakAfter = e.breakAfter, !0) : !1; + return e instanceof bf && e.widget.constructor == this.widget.constructor ? (e.widget.compare(this.widget) || this.markDirty(!0), this.dom && !this.prevWidget && (this.prevWidget = this.widget), this.widget = e.widget, this.length = e.length, this.deco = e.deco, this.breakAfter = e.breakAfter, !0) : !1; } ignoreMutation() { return !0; @@ -5026,7 +5026,7 @@ class ef extends bn { return r == n ? !1 : e < 0 ? r < 0 : n > 0; } } -class Wa { +class uo { eq(e) { return !1; } @@ -5054,10 +5054,10 @@ class Wa { destroy(e) { } } -var la = /* @__PURE__ */ function(t) { +var Ca = /* @__PURE__ */ function(t) { return t[t.Text = 0] = "Text", t[t.WidgetBefore = 1] = "WidgetBefore", t[t.WidgetAfter = 2] = "WidgetAfter", t[t.WidgetRange = 3] = "WidgetRange", t; -}(la || (la = {})); -class _t extends c0 { +}(Ca || (Ca = {})); +class It extends _0 { constructor(e, r, n, i) { super(), this.startSide = e, this.endSide = r, this.widget = n, this.spec = i; } @@ -5065,41 +5065,41 @@ class _t extends c0 { return !1; } static mark(e) { - return new ux(e); + return new Px(e); } static widget(e) { let r = Math.max(-1e4, Math.min(1e4, e.side || 0)), n = !!e.block; - return r += n && !e.inlineOrder ? r > 0 ? 3e8 : -4e8 : r > 0 ? 1e8 : -1e8, new mf(e, r, r, n, e.widget || null, !1); + return r += n && !e.inlineOrder ? r > 0 ? 3e8 : -4e8 : r > 0 ? 1e8 : -1e8, new Pf(e, r, r, n, e.widget || null, !1); } static replace(e) { let r = !!e.block, n, i; if (e.isBlockGap) n = -5e8, i = 4e8; else { - let { start: s, end: a } = dK(e, r); + let { start: s, end: a } = XK(e, r); n = (s ? r ? -3e8 : -1 : 5e8) - 1, i = (a ? r ? 2e8 : 1 : -6e8) + 1; } - return new mf(e, n, i, r, e.widget || null, !0); + return new Pf(e, n, i, r, e.widget || null, !0); } static line(e) { - return new hx(e); + return new Nx(e); } static set(e, r = !1) { - return Er.of(e, r); + return $r.of(e, r); } hasHeight() { return this.widget ? this.widget.estimatedHeight > -1 : !1; } } -_t.none = Er.empty; -class ux extends _t { +It.none = $r.empty; +class Px extends It { constructor(e) { - let { start: r, end: n } = dK(e); + let { start: r, end: n } = XK(e); super(r ? -1 : 5e8, n ? 1 : -6e8, null, e), this.tagName = e.tagName || "span", this.class = e.class || "", this.attrs = e.attributes || null; } eq(e) { var r, n; - return this == e || e instanceof ux && this.tagName == e.tagName && (this.class || ((r = this.attrs) === null || r === void 0 ? void 0 : r.class)) == (e.class || ((n = e.attrs) === null || n === void 0 ? void 0 : n.class)) && bM(this.attrs, e.attrs, "class"); + return this == e || e instanceof Px && this.tagName == e.tagName && (this.class || ((r = this.attrs) === null || r === void 0 ? void 0 : r.class)) == (e.class || ((n = e.attrs) === null || n === void 0 ? void 0 : n.class)) && XM(this.attrs, e.attrs, "class"); } range(e, r = e) { if (e >= r) @@ -5107,13 +5107,13 @@ class ux extends _t { return super.range(e, r); } } -ux.prototype.point = !1; -class hx extends _t { +Px.prototype.point = !1; +class Nx extends It { constructor(e) { super(-2e8, -2e8, null, e); } eq(e) { - return e instanceof hx && this.spec.class == e.spec.class && bM(this.spec.attributes, e.spec.attributes); + return e instanceof Nx && this.spec.class == e.spec.class && XM(this.spec.attributes, e.spec.attributes); } range(e, r = e) { if (r != e) @@ -5121,20 +5121,20 @@ class hx extends _t { return super.range(e, r); } } -hx.prototype.mapMode = Ci.TrackBefore; -hx.prototype.point = !0; -class mf extends _t { +Nx.prototype.mapMode = Fi.TrackBefore; +Nx.prototype.point = !0; +class Pf extends It { constructor(e, r, n, i, s, a) { - super(r, n, s, e), this.block = i, this.isReplace = a, this.mapMode = i ? r <= 0 ? Ci.TrackBefore : Ci.TrackAfter : Ci.TrackDel; + super(r, n, s, e), this.block = i, this.isReplace = a, this.mapMode = i ? r <= 0 ? Fi.TrackBefore : Fi.TrackAfter : Fi.TrackDel; } get type() { - return this.startSide != this.endSide ? la.WidgetRange : this.startSide <= 0 ? la.WidgetBefore : la.WidgetAfter; + return this.startSide != this.endSide ? Ca.WidgetRange : this.startSide <= 0 ? Ca.WidgetBefore : Ca.WidgetAfter; } get heightRelevant() { return this.block || !!this.widget && (this.widget.estimatedHeight >= 5 || this.widget.lineBreaks > 0); } eq(e) { - return e instanceof mf && Rxe(this.widget, e.widget) && this.block == e.block && this.startSide == e.startSide && this.endSide == e.endSide; + return e instanceof Pf && wwe(this.widget, e.widget) && this.block == e.block && this.startSide == e.startSide && this.endSide == e.endSide; } range(e, r = e) { if (this.isReplace && (e > r || e == r && this.startSide > 0 && this.endSide <= 0)) @@ -5144,19 +5144,19 @@ class mf extends _t { return super.range(e, r); } } -mf.prototype.point = !0; -function dK(t, e = !1) { +Pf.prototype.point = !0; +function XK(t, e = !1) { let { inclusiveStart: r, inclusiveEnd: n } = t; return r == null && (r = t.inclusive), n == null && (n = t.inclusive), { start: r != null ? r : e, end: n != null ? n : e }; } -function Rxe(t, e) { +function wwe(t, e) { return t == e || !!(t && e && t.compare(e)); } -function _7(t, e, r, n = 0) { +function n8(t, e, r, n = 0) { let i = r.length - 1; i >= 0 && r[i] + n >= t ? r[i] = Math.max(r[i], e) : r.push(t, e); } -class uy { +class Py { constructor(e, r, n, i) { this.doc = e, this.pos = r, this.end = n, this.disallowBlockEffectsFor = i, this.content = [], this.curLine = null, this.breakAtStart = 0, this.pendingBuffer = 0, this.bufferMarks = [], this.atCursorPos = !0, this.openStart = -1, this.openEnd = -1, this.text = "", this.textOff = 0, this.cursor = e.iter(), this.skip = r; } @@ -5164,19 +5164,19 @@ class uy { if (this.content.length == 0) return !this.breakAtStart && this.doc.lineAt(this.pos).from != this.pos; let e = this.content[this.content.length - 1]; - return !(e.breakAfter || e instanceof ef && e.deco.endSide < 0); + return !(e.breakAfter || e instanceof bf && e.deco.endSide < 0); } getLine() { - return this.curLine || (this.content.push(this.curLine = new wi()), this.atCursorPos = !0), this.curLine; + return this.curLine || (this.content.push(this.curLine = new Pi()), this.atCursorPos = !0), this.curLine; } flushBuffer(e = this.bufferMarks) { - this.pendingBuffer && (this.curLine.append(Dw(new qg(-1), e), e.length), this.pendingBuffer = 0); + this.pendingBuffer && (this.curLine.append(aO(new hm(-1), e), e.length), this.pendingBuffer = 0); } addBlockWidget(e) { this.flushBuffer(), this.curLine = null, this.content.push(e); } finish(e) { - this.pendingBuffer && e <= this.bufferMarks.length ? this.flushBuffer() : this.pendingBuffer = 0, !this.posCovered() && !(e && this.content.length && this.content[this.content.length - 1] instanceof ef) && this.getLine(); + this.pendingBuffer && e <= this.bufferMarks.length ? this.flushBuffer() : this.pendingBuffer = 0, !this.posCovered() && !(e && this.content.length && this.content[this.content.length - 1] instanceof bf) && this.getLine(); } buildText(e, r, n) { for (; e > 0; ) { @@ -5191,42 +5191,42 @@ class uy { this.text = s, this.textOff = 0; } let i = Math.min(this.text.length - this.textOff, e, 512); - this.flushBuffer(r.slice(r.length - n)), this.getLine().append(Dw(new qu(this.text.slice(this.textOff, this.textOff + i)), r), n), this.atCursorPos = !0, this.textOff += i, e -= i, n = 0; + this.flushBuffer(r.slice(r.length - n)), this.getLine().append(aO(new lh(this.text.slice(this.textOff, this.textOff + i)), r), n), this.atCursorPos = !0, this.textOff += i, e -= i, n = 0; } } span(e, r, n, i) { this.buildText(r - e, n, i), this.pos = r, this.openStart < 0 && (this.openStart = i); } point(e, r, n, i, s, a) { - if (this.disallowBlockEffectsFor[a] && n instanceof mf) { + if (this.disallowBlockEffectsFor[a] && n instanceof Pf) { if (n.block) throw new RangeError("Block decorations may not be specified via plugins"); if (r > this.doc.lineAt(this.pos).to) throw new RangeError("Decorations that replace line breaks may not be specified via plugins"); } let o = r - e; - if (n instanceof mf) + if (n instanceof Pf) if (n.block) - n.startSide > 0 && !this.posCovered() && this.getLine(), this.addBlockWidget(new ef(n.widget || new HB("div"), o, n)); + n.startSide > 0 && !this.posCovered() && this.getLine(), this.addBlockWidget(new bf(n.widget || new LF("div"), o, n)); else { - let l = Vh.create(n.widget || new HB("span"), o, o ? 0 : n.startSide), u = this.atCursorPos && !l.isEditable && s <= i.length && (e < r || n.startSide > 0), h = !l.isEditable && (e < r || s > i.length || n.startSide <= 0), f = this.getLine(); - this.pendingBuffer == 2 && !u && !l.isEditable && (this.pendingBuffer = 0), this.flushBuffer(i), u && (f.append(Dw(new qg(1), i), s), s = i.length + Math.max(0, s - i.length)), f.append(Dw(l, i), s), this.atCursorPos = h, this.pendingBuffer = h ? e < r || s > i.length ? 1 : 2 : 0, this.pendingBuffer && (this.bufferMarks = i.slice()); + let l = lf.create(n.widget || new LF("span"), o, o ? 0 : n.startSide), u = this.atCursorPos && !l.isEditable && s <= i.length && (e < r || n.startSide > 0), h = !l.isEditable && (e < r || s > i.length || n.startSide <= 0), f = this.getLine(); + this.pendingBuffer == 2 && !u && !l.isEditable && (this.pendingBuffer = 0), this.flushBuffer(i), u && (f.append(aO(new hm(1), i), s), s = i.length + Math.max(0, s - i.length)), f.append(aO(l, i), s), this.atCursorPos = h, this.pendingBuffer = h ? e < r || s > i.length ? 1 : 2 : 0, this.pendingBuffer && (this.bufferMarks = i.slice()); } else this.doc.lineAt(this.pos).from == this.pos && this.getLine().addLineDeco(n); o && (this.textOff + o <= this.text.length ? this.textOff += o : (this.skip += o - (this.text.length - this.textOff), this.text = "", this.textOff = 0), this.pos = r), this.openStart < 0 && (this.openStart = s); } static build(e, r, n, i, s) { - let a = new uy(e, r, n, s); - return a.openEnd = Er.spans(i, r, n, a), a.openStart < 0 && (a.openStart = a.openEnd), a.finish(a.openEnd), a; + let a = new Py(e, r, n, s); + return a.openEnd = $r.spans(i, r, n, a), a.openStart < 0 && (a.openStart = a.openEnd), a.finish(a.openEnd), a; } } -function Dw(t, e) { +function aO(t, e) { for (let r of e) - t = new Yu(r, [t], t.length); + t = new ch(r, [t], t.length); return t; } -class HB extends Wa { +class LF extends uo { constructor(e) { super(), this.tag = e; } @@ -5243,49 +5243,49 @@ class HB extends Wa { return !0; } } -const pK = /* @__PURE__ */ At.define(), gK = /* @__PURE__ */ At.define(), mK = /* @__PURE__ */ At.define(), vK = /* @__PURE__ */ At.define(), A7 = /* @__PURE__ */ At.define(), yK = /* @__PURE__ */ At.define(), bK = /* @__PURE__ */ At.define(), xK = /* @__PURE__ */ At.define({ +const HK = /* @__PURE__ */ $t.define(), ZK = /* @__PURE__ */ $t.define(), jK = /* @__PURE__ */ $t.define(), KK = /* @__PURE__ */ $t.define(), i8 = /* @__PURE__ */ $t.define(), JK = /* @__PURE__ */ $t.define(), eJ = /* @__PURE__ */ $t.define(), tJ = /* @__PURE__ */ $t.define({ combine: (t) => t.some((e) => e) -}), wK = /* @__PURE__ */ At.define({ +}), rJ = /* @__PURE__ */ $t.define({ combine: (t) => t.some((e) => e) }); -class cg { +class Lg { constructor(e, r = "nearest", n = "nearest", i = 5, s = 5, a = !1) { this.range = e, this.y = r, this.x = n, this.yMargin = i, this.xMargin = s, this.isSnapshot = a; } map(e) { - return e.empty ? this : new cg(this.range.map(e), this.y, this.x, this.yMargin, this.xMargin, this.isSnapshot); + return e.empty ? this : new Lg(this.range.map(e), this.y, this.x, this.yMargin, this.xMargin, this.isSnapshot); } clip(e) { - return this.range.to <= e.doc.length ? this : new cg(Ue.cursor(e.doc.length), this.y, this.x, this.yMargin, this.xMargin, this.isSnapshot); + return this.range.to <= e.doc.length ? this : new Lg(je.cursor(e.doc.length), this.y, this.x, this.yMargin, this.xMargin, this.isSnapshot); } } -const Pw = /* @__PURE__ */ jt.define({ map: (t, e) => t.map(e) }); -function Vo(t, e, r) { - let n = t.facet(vK); +const oO = /* @__PURE__ */ or.define({ map: (t, e) => t.map(e) }); +function al(t, e, r) { + let n = t.facet(KK); n.length ? n[0](e) : window.onerror ? window.onerror(String(e), r, void 0, void 0, e) : r ? console.error(r + ":", e) : console.error(e); } -const oT = /* @__PURE__ */ At.define({ combine: (t) => t.length ? t[0] : !0 }); -let Mxe = 0; -const Lv = /* @__PURE__ */ At.define(); -class Jr { +const PT = /* @__PURE__ */ $t.define({ combine: (t) => t.length ? t[0] : !0 }); +let Owe = 0; +const ey = /* @__PURE__ */ $t.define(); +class hn { constructor(e, r, n, i, s) { this.id = e, this.create = r, this.domEventHandlers = n, this.domEventObservers = i, this.extension = s(this); } static define(e, r) { const { eventHandlers: n, eventObservers: i, provide: s, decorations: a } = r || {}; - return new Jr(Mxe++, e, n, i, (o) => { - let l = [Lv.of(o)]; - return a && l.push(qy.of((u) => { + return new hn(Owe++, e, n, i, (o) => { + let l = [ey.of(o)]; + return a && l.push(p2.of((u) => { let h = u.plugin(o); - return h ? a(h) : _t.none; + return h ? a(h) : It.none; })), s && l.push(s(o)), l; }); } static fromClass(e, r) { - return Jr.define((n) => new e(n), r); + return hn.define((n) => new e(n), r); } } -class QE { +class m_ { constructor(e) { this.spec = e, this.mustUpdate = null, this.value = null; } @@ -5297,7 +5297,7 @@ class QE { try { this.value.update(r); } catch (n) { - if (Vo(r.state, n, "CodeMirror plugin crashed"), this.value.destroy) + if (al(r.state, n, "CodeMirror plugin crashed"), this.value.destroy) try { this.value.destroy(); } catch { @@ -5309,7 +5309,7 @@ class QE { try { this.value = this.spec.create(e); } catch (r) { - Vo(e.state, r, "CodeMirror plugin crashed"), this.deactivate(); + al(e.state, r, "CodeMirror plugin crashed"), this.deactivate(); } return this; } @@ -5319,20 +5319,20 @@ class QE { try { this.value.destroy(); } catch (n) { - Vo(e.state, n, "CodeMirror plugin crashed"); + al(e.state, n, "CodeMirror plugin crashed"); } } deactivate() { this.spec = this.value = null; } } -const OK = /* @__PURE__ */ At.define(), xM = /* @__PURE__ */ At.define(), qy = /* @__PURE__ */ At.define(), wM = /* @__PURE__ */ At.define(), kK = /* @__PURE__ */ At.define(); -function ZB(t, e, r) { - let n = t.state.facet(kK); +const nJ = /* @__PURE__ */ $t.define(), HM = /* @__PURE__ */ $t.define(), p2 = /* @__PURE__ */ $t.define(), ZM = /* @__PURE__ */ $t.define(), iJ = /* @__PURE__ */ $t.define(); +function RF(t, e, r) { + let n = t.state.facet(iJ); if (!n.length) return n; let i = n.map((a) => a instanceof Function ? a(t) : a), s = []; - return Er.spans(i, e, r, { + return $r.spans(i, e, r, { point() { }, span(a, o, l, u) { @@ -5350,22 +5350,22 @@ function ZB(t, e, r) { } }), s; } -const SK = /* @__PURE__ */ At.define(); -function TK(t) { +const sJ = /* @__PURE__ */ $t.define(); +function aJ(t) { let e = 0, r = 0, n = 0, i = 0; - for (let s of t.state.facet(SK)) { + for (let s of t.state.facet(sJ)) { let a = s(t); a && (a.left != null && (e = Math.max(e, a.left)), a.right != null && (r = Math.max(r, a.right)), a.top != null && (n = Math.max(n, a.top)), a.bottom != null && (i = Math.max(i, a.bottom))); } return { left: e, right: r, top: n, bottom: i }; } -const Rv = /* @__PURE__ */ At.define(); -class qo { +const ty = /* @__PURE__ */ $t.define(); +class ol { constructor(e, r, n, i) { this.fromA = e, this.toA = r, this.fromB = n, this.toB = i; } join(e) { - return new qo(Math.min(this.fromA, e.fromA), Math.max(this.toA, e.toA), Math.min(this.fromB, e.fromB), Math.max(this.toB, e.toB)); + return new ol(Math.min(this.fromA, e.fromA), Math.max(this.toA, e.toA), Math.min(this.fromB, e.fromB), Math.max(this.toB, e.toB)); } addToSet(e) { let r = e.length, n = this; @@ -5387,26 +5387,26 @@ class qo { let l = i == e.length ? null : e[i], u = a - o, h = l ? l.fromB : 1e9; for (; s < r.length && r[s] < h; ) { let f = r[s], d = r[s + 1], p = Math.max(o, f), g = Math.min(h, d); - if (p <= g && new qo(p + u, g + u, p, g).addToSet(n), d > h) + if (p <= g && new ol(p + u, g + u, p, g).addToSet(n), d > h) break; s += 2; } if (!l) return n; - new qo(l.fromA, l.toA, l.fromB, l.toB).addToSet(n), a = l.toA, o = l.toB; + new ol(l.fromA, l.toA, l.fromB, l.toB).addToSet(n), a = l.toA, o = l.toB; } } } -class V5 { +class mk { constructor(e, r, n) { - this.view = e, this.state = r, this.transactions = n, this.flags = 0, this.startState = e.state, this.changes = li.empty(this.startState.doc.length); + this.view = e, this.state = r, this.transactions = n, this.flags = 0, this.startState = e.state, this.changes = wi.empty(this.startState.doc.length); for (let s of n) this.changes = this.changes.compose(s.changes); let i = []; - this.changes.iterChangedRanges((s, a, o, l) => i.push(new qo(s, a, o, l))), this.changedRanges = i; + this.changes.iterChangedRanges((s, a, o, l) => i.push(new ol(s, a, o, l))), this.changedRanges = i; } static create(e, r, n) { - return new V5(e, r, n); + return new mk(e, r, n); } get viewportChanged() { return (this.flags & 4) > 0; @@ -5430,28 +5430,28 @@ class V5 { return this.flags == 0 && this.transactions.length == 0; } } -var Pn = /* @__PURE__ */ function(t) { +var Wn = /* @__PURE__ */ function(t) { return t[t.LTR = 0] = "LTR", t[t.RTL = 1] = "RTL", t; -}(Pn || (Pn = {})); -const Yy = Pn.LTR, CK = Pn.RTL; -function EK(t) { +}(Wn || (Wn = {})); +const g2 = Wn.LTR, oJ = Wn.RTL; +function lJ(t) { let e = []; for (let r = 0; r < t.length; r++) e.push(1 << +t[r]); return e; } -const Dxe = /* @__PURE__ */ EK("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"), Pxe = /* @__PURE__ */ EK("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"), L7 = /* @__PURE__ */ Object.create(null), rc = []; +const kwe = /* @__PURE__ */ lJ("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"), Swe = /* @__PURE__ */ lJ("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"), s8 = /* @__PURE__ */ Object.create(null), wc = []; for (let t of ["()", "[]", "{}"]) { let e = /* @__PURE__ */ t.charCodeAt(0), r = /* @__PURE__ */ t.charCodeAt(1); - L7[e] = r, L7[r] = -e; + s8[e] = r, s8[r] = -e; } -function Nxe(t) { - return t <= 247 ? Dxe[t] : 1424 <= t && t <= 1524 ? 2 : 1536 <= t && t <= 1785 ? Pxe[t - 1536] : 1774 <= t && t <= 2220 ? 4 : 8192 <= t && t <= 8204 ? 256 : 64336 <= t && t <= 65023 ? 4 : 1; +function Twe(t) { + return t <= 247 ? kwe[t] : 1424 <= t && t <= 1524 ? 2 : 1536 <= t && t <= 1785 ? Swe[t - 1536] : 1774 <= t && t <= 2220 ? 4 : 8192 <= t && t <= 8204 ? 256 : 64336 <= t && t <= 65023 ? 4 : 1; } -const Ixe = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/; -class qh { +const Cwe = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/; +class cf { get dir() { - return this.level % 2 ? CK : Yy; + return this.level % 2 ? oJ : g2; } constructor(e, r, n) { this.from = e, this.to = r, this.level = n; @@ -5474,83 +5474,83 @@ class qh { return s; } } -function _K(t, e) { +function cJ(t, e) { if (t.length != e.length) return !1; for (let r = 0; r < t.length; r++) { let n = t[r], i = e[r]; - if (n.from != i.from || n.to != i.to || n.direction != i.direction || !_K(n.inner, i.inner)) + if (n.from != i.from || n.to != i.to || n.direction != i.direction || !cJ(n.inner, i.inner)) return !1; } return !0; } -const rn = []; -function $xe(t, e, r, n, i) { +const pn = []; +function Ewe(t, e, r, n, i) { for (let s = 0; s <= n.length; s++) { let a = s ? n[s - 1].to : e, o = s < n.length ? n[s].from : r, l = s ? 256 : i; for (let u = a, h = l, f = l; u < o; u++) { - let d = Nxe(t.charCodeAt(u)); - d == 512 ? d = h : d == 8 && f == 4 && (d = 16), rn[u] = d == 4 ? 2 : d, d & 7 && (f = d), h = d; + let d = Twe(t.charCodeAt(u)); + d == 512 ? d = h : d == 8 && f == 4 && (d = 16), pn[u] = d == 4 ? 2 : d, d & 7 && (f = d), h = d; } for (let u = a, h = l, f = l; u < o; u++) { - let d = rn[u]; + let d = pn[u]; if (d == 128) - u < o - 1 && h == rn[u + 1] && h & 24 ? d = rn[u] = h : rn[u] = 256; + u < o - 1 && h == pn[u + 1] && h & 24 ? d = pn[u] = h : pn[u] = 256; else if (d == 64) { let p = u + 1; - for (; p < o && rn[p] == 64; ) + for (; p < o && pn[p] == 64; ) p++; - let g = u && h == 8 || p < r && rn[p] == 8 ? f == 1 ? 1 : 8 : 256; + let g = u && h == 8 || p < r && pn[p] == 8 ? f == 1 ? 1 : 8 : 256; for (let m = u; m < p; m++) - rn[m] = g; + pn[m] = g; u = p - 1; } else - d == 8 && f == 1 && (rn[u] = 1); + d == 8 && f == 1 && (pn[u] = 1); h = d, d & 7 && (f = d); } } } -function Bxe(t, e, r, n, i) { +function _we(t, e, r, n, i) { let s = i == 1 ? 2 : 1; for (let a = 0, o = 0, l = 0; a <= n.length; a++) { let u = a ? n[a - 1].to : e, h = a < n.length ? n[a].from : r; for (let f = u, d, p, g; f < h; f++) - if (p = L7[d = t.charCodeAt(f)]) + if (p = s8[d = t.charCodeAt(f)]) if (p < 0) { for (let m = o - 3; m >= 0; m -= 3) - if (rc[m + 1] == -p) { - let v = rc[m + 2], y = v & 2 ? i : v & 4 ? v & 1 ? s : i : 0; - y && (rn[f] = rn[rc[m]] = y), o = m; + if (wc[m + 1] == -p) { + let v = wc[m + 2], y = v & 2 ? i : v & 4 ? v & 1 ? s : i : 0; + y && (pn[f] = pn[wc[m]] = y), o = m; break; } } else { - if (rc.length == 189) + if (wc.length == 189) break; - rc[o++] = f, rc[o++] = d, rc[o++] = l; + wc[o++] = f, wc[o++] = d, wc[o++] = l; } - else if ((g = rn[f]) == 2 || g == 1) { + else if ((g = pn[f]) == 2 || g == 1) { let m = g == i; l = m ? 0 : 1; for (let v = o - 3; v >= 0; v -= 3) { - let y = rc[v + 2]; + let y = wc[v + 2]; if (y & 2) break; if (m) - rc[v + 2] |= 2; + wc[v + 2] |= 2; else { if (y & 4) break; - rc[v + 2] |= 4; + wc[v + 2] |= 4; } } } } } -function Fxe(t, e, r, n) { +function Awe(t, e, r, n) { for (let i = 0, s = n; i <= r.length; i++) { let a = i ? r[i - 1].to : t, o = i < r.length ? r[i].from : e; for (let l = a; l < o; ) { - let u = rn[l]; + let u = pn[l]; if (u == 256) { let h = l + 1; for (; ; ) @@ -5558,26 +5558,26 @@ function Fxe(t, e, r, n) { if (i == r.length) break; h = r[i++].to, o = i < r.length ? r[i].from : e; - } else if (rn[h] == 256) + } else if (pn[h] == 256) h++; else break; - let f = s == 1, d = (h < e ? rn[h] : n) == 1, p = f == d ? f ? 1 : 2 : n; + let f = s == 1, d = (h < e ? pn[h] : n) == 1, p = f == d ? f ? 1 : 2 : n; for (let g = h, m = i, v = m ? r[m - 1].to : t; g > l; ) - g == v && (g = r[--m].from, v = m ? r[m - 1].to : t), rn[--g] = p; + g == v && (g = r[--m].from, v = m ? r[m - 1].to : t), pn[--g] = p; l = h; } else s = u, l++; } } } -function R7(t, e, r, n, i, s, a) { +function a8(t, e, r, n, i, s, a) { let o = n % 2 ? 2 : 1; if (n % 2 == i % 2) for (let l = e, u = 0; l < r; ) { let h = !0, f = !1; if (u == s.length || l < s[u].from) { - let m = rn[l]; + let m = pn[l]; m != o && (h = !1, f = m == 16); } let d = !h && o == 1 ? [] : null, p = h ? n : n + 1, g = l; @@ -5594,7 +5594,7 @@ function R7(t, e, r, n, i, s, a) { if (y < s.length && s[y].from == v) v = s[y++].to; else { - if (rn[v] == o) + if (pn[v] == o) break e; break; } @@ -5602,23 +5602,23 @@ function R7(t, e, r, n, i, s, a) { if (u++, d) d.push(m); else { - m.from > l && a.push(new qh(l, m.from, p)); - let v = m.direction == Yy != !(p % 2); - M7(t, v ? n + 1 : n, i, m.inner, m.from, m.to, a), l = m.to; + m.from > l && a.push(new cf(l, m.from, p)); + let v = m.direction == g2 != !(p % 2); + o8(t, v ? n + 1 : n, i, m.inner, m.from, m.to, a), l = m.to; } g = m.to; } else { - if (g == r || (h ? rn[g] != o : rn[g] == o)) + if (g == r || (h ? pn[g] != o : pn[g] == o)) break; g++; } - d ? R7(t, l, g, n + 1, i, d, a) : l < g && a.push(new qh(l, g, p)), l = g; + d ? a8(t, l, g, n + 1, i, d, a) : l < g && a.push(new cf(l, g, p)), l = g; } else for (let l = r, u = s.length; l > e; ) { let h = !0, f = !1; if (!u || l > s[u - 1].to) { - let m = rn[l - 1]; + let m = pn[l - 1]; m != o && (h = !1, f = m == 16); } let d = !h && o == 1 ? [] : null, p = h ? n : n + 1, g = l; @@ -5635,7 +5635,7 @@ function R7(t, e, r, n, i, s, a) { if (y && s[y - 1].to == v) v = s[--y].from; else { - if (rn[v - 1] == o) + if (pn[v - 1] == o) break e; break; } @@ -5643,39 +5643,39 @@ function R7(t, e, r, n, i, s, a) { if (d) d.push(m); else { - m.to < l && a.push(new qh(m.to, l, p)); - let v = m.direction == Yy != !(p % 2); - M7(t, v ? n + 1 : n, i, m.inner, m.from, m.to, a), l = m.from; + m.to < l && a.push(new cf(m.to, l, p)); + let v = m.direction == g2 != !(p % 2); + o8(t, v ? n + 1 : n, i, m.inner, m.from, m.to, a), l = m.from; } g = m.from; } else { - if (g == e || (h ? rn[g - 1] != o : rn[g - 1] == o)) + if (g == e || (h ? pn[g - 1] != o : pn[g - 1] == o)) break; g--; } - d ? R7(t, g, l, n + 1, i, d, a) : g < l && a.push(new qh(g, l, p)), l = g; + d ? a8(t, g, l, n + 1, i, d, a) : g < l && a.push(new cf(g, l, p)), l = g; } } -function M7(t, e, r, n, i, s, a) { +function o8(t, e, r, n, i, s, a) { let o = e % 2 ? 2 : 1; - $xe(t, i, s, n, o), Bxe(t, i, s, n, o), Fxe(i, s, n, o), R7(t, i, s, e, r, n, a); + Ewe(t, i, s, n, o), _we(t, i, s, n, o), Awe(i, s, n, o), a8(t, i, s, e, r, n, a); } -function zxe(t, e, r) { +function Lwe(t, e, r) { if (!t) - return [new qh(0, 0, e == CK ? 1 : 0)]; - if (e == Yy && !r.length && !Ixe.test(t)) - return AK(t.length); + return [new cf(0, 0, e == oJ ? 1 : 0)]; + if (e == g2 && !r.length && !Cwe.test(t)) + return uJ(t.length); if (r.length) - for (; t.length > rn.length; ) - rn[rn.length] = 256; - let n = [], i = e == Yy ? 0 : 1; - return M7(t, i, i, r, 0, t.length, n), n; + for (; t.length > pn.length; ) + pn[pn.length] = 256; + let n = [], i = e == g2 ? 0 : 1; + return o8(t, i, i, r, 0, t.length, n), n; } -function AK(t) { - return [new qh(0, t, 0)]; +function uJ(t) { + return [new cf(0, t, 0)]; } -let LK = ""; -function Qxe(t, e, r, n, i) { +let hJ = ""; +function Rwe(t, e, r, n, i) { var s; let a = n.head - t.from, o = -1; if (a == 0) { @@ -5688,50 +5688,50 @@ function Qxe(t, e, r, n, i) { let d = e[e.length - 1]; d.level != r && (a = d.side(!0, r), o = e.length - 1); } - o < 0 && (o = qh.find(e, a, (s = n.bidiLevel) !== null && s !== void 0 ? s : -1, n.assoc)); + o < 0 && (o = cf.find(e, a, (s = n.bidiLevel) !== null && s !== void 0 ? s : -1, n.assoc)); let l = e[o]; a == l.side(i, r) && (l = e[o += i ? 1 : -1], a = l.side(!i, r)); - let u = i == (l.dir == r), h = cs(t.text, a, u); - if (LK = t.text.slice(Math.min(a, h), Math.max(a, h)), h > l.from && h < l.to) - return Ue.cursor(h + t.from, u ? -1 : 1, l.level); + let u = i == (l.dir == r), h = Os(t.text, a, u); + if (hJ = t.text.slice(Math.min(a, h), Math.max(a, h)), h > l.from && h < l.to) + return je.cursor(h + t.from, u ? -1 : 1, l.level); let f = o == (i ? e.length - 1 : 0) ? null : e[o + (i ? 1 : -1)]; - return !f && l.level != r ? Ue.cursor(i ? t.to : t.from, i ? -1 : 1, r) : f && f.level < l.level ? Ue.cursor(f.side(!i, r) + t.from, i ? 1 : -1, f.level) : Ue.cursor(h + t.from, i ? -1 : 1, l.level); + return !f && l.level != r ? je.cursor(i ? t.to : t.from, i ? -1 : 1, r) : f && f.level < l.level ? je.cursor(f.side(!i, r) + t.from, i ? 1 : -1, f.level) : je.cursor(h + t.from, i ? -1 : 1, l.level); } -class jB extends bn { +class MF extends Dn { get length() { return this.view.state.doc.length; } constructor(e) { - super(), this.view = e, this.decorations = [], this.dynamicDecorationMap = [], this.domChanged = null, this.hasComposition = null, this.markedForComposition = /* @__PURE__ */ new Set(), this.minWidth = 0, this.minWidthFrom = 0, this.minWidthTo = 0, this.impreciseAnchor = null, this.impreciseHead = null, this.forceSelection = !1, this.lastUpdate = Date.now(), this.setDOM(e.contentDOM), this.children = [new wi()], this.children[0].setParent(this), this.updateDeco(), this.updateInner([new qo(0, 0, 0, e.state.doc.length)], 0, null); + super(), this.view = e, this.decorations = [], this.dynamicDecorationMap = [], this.domChanged = null, this.hasComposition = null, this.markedForComposition = /* @__PURE__ */ new Set(), this.minWidth = 0, this.minWidthFrom = 0, this.minWidthTo = 0, this.impreciseAnchor = null, this.impreciseHead = null, this.forceSelection = !1, this.lastUpdate = Date.now(), this.setDOM(e.contentDOM), this.children = [new Pi()], this.children[0].setParent(this), this.updateDeco(), this.updateInner([new ol(0, 0, 0, e.state.doc.length)], 0, null); } update(e) { var r; let n = e.changedRanges; this.minWidth > 0 && n.length && (n.every(({ fromA: u, toA: h }) => h < this.minWidthFrom || u > this.minWidthTo) ? (this.minWidthFrom = e.changes.mapPos(this.minWidthFrom, 1), this.minWidthTo = e.changes.mapPos(this.minWidthTo, 1)) : this.minWidth = this.minWidthFrom = this.minWidthTo = 0); let i = -1; - this.view.inputState.composing >= 0 && (!((r = this.domChanged) === null || r === void 0) && r.newSel ? i = this.domChanged.newSel.head : !Xxe(e.changes, this.hasComposition) && !e.selectionSet && (i = e.state.selection.main.head)); - let s = i > -1 ? Vxe(this.view, e.changes, i) : null; + this.view.inputState.composing >= 0 && (!((r = this.domChanged) === null || r === void 0) && r.newSel ? i = this.domChanged.newSel.head : !Bwe(e.changes, this.hasComposition) && !e.selectionSet && (i = e.state.selection.main.head)); + let s = i > -1 ? Dwe(this.view, e.changes, i) : null; if (this.domChanged = null, this.hasComposition) { this.markedForComposition.clear(); let { from: u, to: h } = this.hasComposition; - n = new qo(u, h, e.changes.mapPos(u, -1), e.changes.mapPos(h, 1)).addToSet(n.slice()); + n = new ol(u, h, e.changes.mapPos(u, -1), e.changes.mapPos(h, 1)).addToSet(n.slice()); } - this.hasComposition = s ? { from: s.range.fromB, to: s.range.toB } : null, (Pt.ie || Pt.chrome) && !s && e && e.state.doc.lines != e.startState.doc.lines && (this.forceSelection = !0); - let a = this.decorations, o = this.updateDeco(), l = Wxe(a, o, e.changes); - return n = qo.extendWithRanges(n, l), !(this.flags & 7) && n.length == 0 ? !1 : (this.updateInner(n, e.startState.doc.length, s), e.transactions.length && (this.lastUpdate = Date.now()), !0); + this.hasComposition = s ? { from: s.range.fromB, to: s.range.toB } : null, (Vt.ie || Vt.chrome) && !s && e && e.state.doc.lines != e.startState.doc.lines && (this.forceSelection = !0); + let a = this.decorations, o = this.updateDeco(), l = Iwe(a, o, e.changes); + return n = ol.extendWithRanges(n, l), !(this.flags & 7) && n.length == 0 ? !1 : (this.updateInner(n, e.startState.doc.length, s), e.transactions.length && (this.lastUpdate = Date.now()), !0); } updateInner(e, r, n) { this.view.viewState.mustMeasureContent = !0, this.updateChildren(e, r, n); let { observer: i } = this.view; i.ignore(() => { this.dom.style.height = this.view.viewState.contentHeight / this.view.scaleY + "px", this.dom.style.flexBasis = this.minWidth ? this.minWidth + "px" : ""; - let a = Pt.chrome || Pt.ios ? { node: i.selectionRange.focusNode, written: !1 } : void 0; + let a = Vt.chrome || Vt.ios ? { node: i.selectionRange.focusNode, written: !1 } : void 0; this.sync(this.view, a), this.flags &= -8, a && (a.written || i.selectionRange.focusNode != a.node) && (this.forceSelection = !0), this.dom.style.height = ""; }), this.markedForComposition.forEach((a) => a.flags &= -9); let s = []; if (this.view.viewport.from || this.view.viewport.to < this.view.state.doc.length) for (let a of this.children) - a instanceof ef && a.widget instanceof KB && s.push(a.dom); + a instanceof bf && a.widget instanceof DF && s.push(a.dom); i.updateGaps(s); } updateChildren(e, r, n) { @@ -5742,29 +5742,29 @@ class jB extends bn { break; let { fromA: l, toA: u, fromB: h, toB: f } = o, d, p, g, m; if (n && n.range.fromB < f && n.range.toB > h) { - let O = uy.build(this.view.state.doc, h, n.range.fromB, this.decorations, this.dynamicDecorationMap), S = uy.build(this.view.state.doc, n.range.toB, f, this.decorations, this.dynamicDecorationMap); + let O = Py.build(this.view.state.doc, h, n.range.fromB, this.decorations, this.dynamicDecorationMap), S = Py.build(this.view.state.doc, n.range.toB, f, this.decorations, this.dynamicDecorationMap); p = O.breakAtStart, g = O.openStart, m = S.openEnd; let C = this.compositionView(n); S.breakAtStart ? C.breakAfter = 1 : S.content.length && C.merge(C.length, C.length, S.content[0], !1, S.openStart, 0) && (C.breakAfter = S.content[0].breakAfter, S.content.shift()), O.content.length && C.merge(0, 0, O.content[O.content.length - 1], !0, 0, O.openEnd) && O.content.pop(), d = O.content.concat(C).concat(S.content); } else - ({ content: d, breakAtStart: p, openStart: g, openEnd: m } = uy.build(this.view.state.doc, h, f, this.decorations, this.dynamicDecorationMap)); + ({ content: d, breakAtStart: p, openStart: g, openEnd: m } = Py.build(this.view.state.doc, h, f, this.decorations, this.dynamicDecorationMap)); let { i: v, off: y } = s.findPos(u, 1), { i: b, off: w } = s.findPos(l, -1); - aK(this, b, w, v, y, d, p, g, m); + QK(this, b, w, v, y, d, p, g, m); } n && this.fixCompositionDOM(n); } compositionView(e) { - let r = new qu(e.text.nodeValue); + let r = new lh(e.text.nodeValue); r.flags |= 8; for (let { deco: i } of e.marks) - r = new Yu(i, [r], r.length); - let n = new wi(); + r = new ch(i, [r], r.length); + let n = new Pi(); return n.append(r, 0), n; } fixCompositionDOM(e) { let r = (s, a) => { a.flags |= 8 | (a.children.some((l) => l.flags & 7) ? 1 : 0), this.markedForComposition.add(a); - let o = bn.get(s); + let o = Dn.get(s); o && o != a && (o.dom = null), a.setDOM(s); }, n = this.childPos(e.range.fromB, 1), i = this.children[n.i]; r(e.line, i); @@ -5773,27 +5773,27 @@ class jB extends bn { } updateSelection(e = !1, r = !1) { (e || !this.view.observer.selectionRange.focusNode) && this.view.observer.readSelectionRange(); - let n = this.view.root.activeElement, i = n == this.dom, s = !i && E4(this.dom, this.view.observer.selectionRange) && !(n && this.dom.contains(n)); + let n = this.view.root.activeElement, i = n == this.dom, s = !i && e5(this.dom, this.view.observer.selectionRange) && !(n && this.dom.contains(n)); if (!(i || r || s)) return; let a = this.forceSelection; this.forceSelection = !1; let o = this.view.state.selection.main, l = this.moveToLine(this.domAtPos(o.anchor)), u = o.empty ? l : this.moveToLine(this.domAtPos(o.head)); - if (Pt.gecko && o.empty && !this.hasComposition && Uxe(l)) { + if (Vt.gecko && o.empty && !this.hasComposition && Mwe(l)) { let f = document.createTextNode(""); - this.view.observer.ignore(() => l.node.insertBefore(f, l.node.childNodes[l.offset] || null)), l = u = new Ns(f, 0), a = !0; + this.view.observer.ignore(() => l.node.insertBefore(f, l.node.childNodes[l.offset] || null)), l = u = new Hs(f, 0), a = !0; } let h = this.view.observer.selectionRange; - (a || !h.focusNode || !U5(l.node, l.offset, h.anchorNode, h.anchorOffset) || !U5(u.node, u.offset, h.focusNode, h.focusOffset)) && (this.view.observer.ignore(() => { - Pt.android && Pt.chrome && this.dom.contains(h.focusNode) && Gxe(h.focusNode, this.dom) && (this.dom.blur(), this.dom.focus({ preventScroll: !0 })); - let f = Q5(this.view.root); + (a || !h.focusNode || !gk(l.node, l.offset, h.anchorNode, h.anchorOffset) || !gk(u.node, u.offset, h.focusNode, h.focusOffset)) && (this.view.observer.ignore(() => { + Vt.android && Vt.chrome && this.dom.contains(h.focusNode) && $we(h.focusNode, this.dom) && (this.dom.blur(), this.dom.focus({ preventScroll: !0 })); + let f = pk(this.view.root); if (f) if (o.empty) { - if (Pt.gecko) { - let d = qxe(l.node, l.offset); + if (Vt.gecko) { + let d = Pwe(l.node, l.offset); if (d && d != 3) { - let p = MK(l.node, l.offset, d == 1 ? 1 : -1); - p && (l = new Ns(p.node, p.offset)); + let p = dJ(l.node, l.offset, d == 1 ? 1 : -1); + p && (l = new Hs(p.node, p.offset)); } } f.collapse(l.node, l.offset), o.bidiLevel != null && f.caretBidiLevel !== void 0 && (f.caretBidiLevel = o.bidiLevel); @@ -5808,15 +5808,15 @@ class jB extends bn { o.anchor > o.head && ([l, u] = [u, l]), d.setEnd(u.node, u.offset), d.setStart(l.node, l.offset), f.removeAllRanges(), f.addRange(d); } s && this.view.root.activeElement == this.dom && (this.dom.blur(), n && n.focus()); - }), this.view.observer.setSelectionRange(l, u)), this.impreciseAnchor = l.precise ? null : new Ns(h.anchorNode, h.anchorOffset), this.impreciseHead = u.precise ? null : new Ns(h.focusNode, h.focusOffset); + }), this.view.observer.setSelectionRange(l, u)), this.impreciseAnchor = l.precise ? null : new Hs(h.anchorNode, h.anchorOffset), this.impreciseHead = u.precise ? null : new Hs(h.focusNode, h.focusOffset); } enforceCursorAssoc() { if (this.hasComposition) return; - let { view: e } = this, r = e.state.selection.main, n = Q5(e.root), { anchorNode: i, anchorOffset: s } = e.observer.selectionRange; + let { view: e } = this, r = e.state.selection.main, n = pk(e.root), { anchorNode: i, anchorOffset: s } = e.observer.selectionRange; if (!n || !r.empty || !r.assoc || !n.modify) return; - let a = wi.find(this, r.head); + let a = Pi.find(this, r.head); if (!a) return; let o = a.posAtStart; @@ -5835,18 +5835,18 @@ class jB extends bn { if (e.node != r) return e; for (let i = e.offset; !n && i < r.childNodes.length; i++) { - let s = bn.get(r.childNodes[i]); - s instanceof wi && (n = s.domAtPos(0)); + let s = Dn.get(r.childNodes[i]); + s instanceof Pi && (n = s.domAtPos(0)); } for (let i = e.offset - 1; !n && i >= 0; i--) { - let s = bn.get(r.childNodes[i]); - s instanceof wi && (n = s.domAtPos(s.length)); + let s = Dn.get(r.childNodes[i]); + s instanceof Pi && (n = s.domAtPos(s.length)); } - return n ? new Ns(n.node, n.offset, !0) : e; + return n ? new Hs(n.node, n.offset, !0) : e; } nearest(e) { for (let r = e; r; ) { - let n = bn.get(r); + let n = Dn.get(r); if (n && n.rootView == this) return n; r = r.parentNode; @@ -5863,7 +5863,7 @@ class jB extends bn { let { i: r, off: n } = this.childCursor().findPos(e, -1); for (; r < this.children.length - 1; ) { let i = this.children[r]; - if (n < i.length || i instanceof wi) + if (n < i.length || i instanceof Pi) break; r++, n = 0; } @@ -5875,13 +5875,13 @@ class jB extends bn { let o = this.children[a], l = s - o.breakAfter, u = l - o.length; if (l < e) break; - u <= e && (u < e || o.covers(-1)) && (l > e || o.covers(1)) && (!n || o instanceof wi && !(n instanceof wi && r >= 0)) && (n = o, i = u), s = u; + u <= e && (u < e || o.covers(-1)) && (l > e || o.covers(1)) && (!n || o instanceof Pi && !(n instanceof Pi && r >= 0)) && (n = o, i = u), s = u; } return n ? n.coordsAt(e - i, r) : null; } coordsForChar(e) { let { i: r, off: n } = this.childPos(e, 1), i = this.children[r]; - if (!(i instanceof wi)) + if (!(i instanceof Pi)) return null; for (; i.children.length; ) { let { i: o, off: l } = i.childPos(n, 1); @@ -5893,12 +5893,12 @@ class jB extends bn { } n = l; } - if (!(i instanceof qu)) + if (!(i instanceof lh)) return null; - let s = cs(i.text, n); + let s = Os(i.text, n); if (s == n) return null; - let a = u0(i.dom, n, s).getClientRects(); + let a = A0(i.dom, n, s).getClientRects(); for (let o = 0; o < a.length; o++) { let l = a[o]; if (o == a.length - 1 || l.top < l.bottom && l.left < l.right) @@ -5907,7 +5907,7 @@ class jB extends bn { return null; } measureVisibleLineHeights(e) { - let r = [], { from: n, to: i } = e, s = this.view.contentDOM.clientWidth, a = s > Math.max(this.view.scrollDOM.clientWidth, this.minWidth) + 1, o = -1, l = this.view.textDirection == Pn.LTR; + let r = [], { from: n, to: i } = e, s = this.view.contentDOM.clientWidth, a = s > Math.max(this.view.scrollDOM.clientWidth, this.minWidth) + 1, o = -1, l = this.view.textDirection == Wn.LTR; for (let u = 0, h = 0; h < this.children.length; h++) { let f = this.children[h], d = u + f.length; if (d > i) @@ -5915,7 +5915,7 @@ class jB extends bn { if (u >= n) { let p = f.dom.getBoundingClientRect(); if (r.push(p.height), a) { - let g = f.dom.lastChild, m = g ? Uy(g) : []; + let g = f.dom.lastChild, m = g ? f2(g) : []; if (m.length) { let v = m[m.length - 1], y = l ? v.right - p.left : p.right - v.left; y > o && (o = y, this.minWidth = s, this.minWidthFrom = u, this.minWidthTo = d); @@ -5928,11 +5928,11 @@ class jB extends bn { } textDirectionAt(e) { let { i: r } = this.childPos(e, 1); - return getComputedStyle(this.children[r].dom).direction == "rtl" ? Pn.RTL : Pn.LTR; + return getComputedStyle(this.children[r].dom).direction == "rtl" ? Wn.RTL : Wn.LTR; } measureTextSize() { for (let s of this.children) - if (s instanceof wi) { + if (s instanceof Pi) { let a = s.measureTextSize(); if (a) return a; @@ -5940,13 +5940,13 @@ class jB extends bn { let e = document.createElement("div"), r, n, i; return e.className = "cm-line", e.style.width = "99999px", e.style.position = "absolute", e.textContent = "abc def ghi jkl mno pqr stu", this.view.observer.ignore(() => { this.dom.appendChild(e); - let s = Uy(e.firstChild)[0]; + let s = f2(e.firstChild)[0]; r = e.getBoundingClientRect().height, n = s ? s.width / 27 : 7, i = s ? s.height : r, e.remove(); }), { lineHeight: r, charWidth: n, textHeight: i }; } childCursor(e = this.length) { let r = this.children.length; - return r && (e -= this.children[--r].length), new sK(this.children, e, r); + return r && (e -= this.children[--r].length), new zK(this.children, e, r); } computeBlockGapDeco() { let e = [], r = this.view.viewState; @@ -5954,8 +5954,8 @@ class jB extends bn { let s = i == r.viewports.length ? null : r.viewports[i], a = s ? s.from - 1 : this.length; if (a > n) { let o = (r.lineBlockAt(a).bottom - r.lineBlockAt(n).top) / this.view.scaleY; - e.push(_t.replace({ - widget: new KB(o), + e.push(It.replace({ + widget: new DF(o), block: !0, inclusive: !0, isBlockGap: !0 @@ -5965,10 +5965,10 @@ class jB extends bn { break; n = s.to + 1; } - return _t.set(e); + return It.set(e); } updateDeco() { - let e = this.view.state.facet(qy).map((r, n) => (this.dynamicDecorationMap[n] = typeof r == "function") ? r(this.view) : r); + let e = this.view.state.facet(p2).map((r, n) => (this.dynamicDecorationMap[n] = typeof r == "function") ? r(this.view) : r); for (let r = e.length; r < e.length + 3; r++) this.dynamicDecorationMap[r] = !1; return this.decorations = [ @@ -5992,19 +5992,19 @@ class jB extends bn { right: Math.max(n.right, i.right), bottom: Math.max(n.bottom, i.bottom) }); - let s = TK(this.view), a = { + let s = aJ(this.view), a = { left: n.left - s.left, top: n.top - s.top, right: n.right + s.right, bottom: n.bottom + s.bottom }, { offsetWidth: o, offsetHeight: l } = this.view.scrollDOM; - Oxe(this.view.scrollDOM, a, r.head < r.anchor ? -1 : 1, e.x, e.y, Math.max(Math.min(e.xMargin, o), -o), Math.max(Math.min(e.yMargin, l), -l), this.view.textDirection == Pn.LTR); + fwe(this.view.scrollDOM, a, r.head < r.anchor ? -1 : 1, e.x, e.y, Math.max(Math.min(e.xMargin, o), -o), Math.max(Math.min(e.yMargin, l), -l), this.view.textDirection == Wn.LTR); } } -function Uxe(t) { +function Mwe(t) { return t.node.nodeType == 1 && t.node.firstChild && (t.offset == 0 || t.node.childNodes[t.offset - 1].contentEditable == "false") && (t.offset == t.node.childNodes.length || t.node.childNodes[t.offset].contentEditable == "false"); } -class KB extends Wa { +class DF extends uo { constructor(e) { super(), this.height = e; } @@ -6022,32 +6022,32 @@ class KB extends Wa { return this.height; } } -function RK(t, e) { - let r = t.observer.selectionRange, n = r.focusNode && MK(r.focusNode, r.focusOffset, 0); +function fJ(t, e) { + let r = t.observer.selectionRange, n = r.focusNode && dJ(r.focusNode, r.focusOffset, 0); if (!n) return null; let i = e - n.offset; return { from: i, to: i + n.node.nodeValue.length, node: n.node }; } -function Vxe(t, e, r) { - let n = RK(t, r); +function Dwe(t, e, r) { + let n = fJ(t, r); if (!n) return null; let { node: i, from: s, to: a } = n, o = i.nodeValue; if (/[\n\r]/.test(o) || t.state.doc.sliceString(n.from, n.to) != o) return null; - let l = e.invertedDesc, u = new qo(l.mapPos(s), l.mapPos(a), s, a), h = []; + let l = e.invertedDesc, u = new ol(l.mapPos(s), l.mapPos(a), s, a), h = []; for (let f = i.parentNode; ; f = f.parentNode) { - let d = bn.get(f); - if (d instanceof Yu) + let d = Dn.get(f); + if (d instanceof ch) h.push({ node: f, deco: d.mark }); else { - if (d instanceof wi || f.nodeName == "DIV" && f.parentNode == t.contentDOM) + if (d instanceof Pi || f.nodeName == "DIV" && f.parentNode == t.contentDOM) return { range: u, text: i, marks: h, line: f }; if (f != t.contentDOM) - h.push({ node: f, deco: new ux({ + h.push({ node: f, deco: new Px({ inclusive: !0, - attributes: Lxe(f), + attributes: xwe(f), tagName: f.tagName.toLowerCase() }) }); else @@ -6055,13 +6055,13 @@ function Vxe(t, e, r) { } } } -function MK(t, e, r) { +function dJ(t, e, r) { if (r <= 0) for (let n = t, i = e; ; ) { if (n.nodeType == 3) return { node: n, offset: i }; if (n.nodeType == 1 && i > 0) - n = n.childNodes[i - 1], i = Vu(n); + n = n.childNodes[i - 1], i = oh(n); else break; } @@ -6076,105 +6076,105 @@ function MK(t, e, r) { } return null; } -function qxe(t, e) { +function Pwe(t, e) { return t.nodeType != 1 ? 0 : (e && t.childNodes[e - 1].contentEditable == "false" ? 1 : 0) | (e < t.childNodes.length && t.childNodes[e].contentEditable == "false" ? 2 : 0); } -let Yxe = class { +let Nwe = class { constructor() { this.changes = []; } compareRange(e, r) { - _7(e, r, this.changes); + n8(e, r, this.changes); } comparePoint(e, r) { - _7(e, r, this.changes); + n8(e, r, this.changes); } }; -function Wxe(t, e, r) { - let n = new Yxe(); - return Er.compare(t, e, r, n), n.changes; +function Iwe(t, e, r) { + let n = new Nwe(); + return $r.compare(t, e, r, n), n.changes; } -function Gxe(t, e) { +function $we(t, e) { for (let r = t; r && r != e; r = r.assignedSlot || r.parentNode) if (r.nodeType == 1 && r.contentEditable == "false") return !0; return !1; } -function Xxe(t, e) { +function Bwe(t, e) { let r = !1; return e && t.iterChangedRanges((n, i) => { n < e.to && i > e.from && (r = !0); }), r; } -function Hxe(t, e, r = 1) { +function Fwe(t, e, r = 1) { let n = t.charCategorizer(e), i = t.doc.lineAt(e), s = e - i.from; if (i.length == 0) - return Ue.cursor(e); + return je.cursor(e); s == 0 ? r = 1 : s == i.length && (r = -1); let a = s, o = s; - r < 0 ? a = cs(i.text, s, !1) : o = cs(i.text, s); + r < 0 ? a = Os(i.text, s, !1) : o = Os(i.text, s); let l = n(i.text.slice(a, o)); for (; a > 0; ) { - let u = cs(i.text, a, !1); + let u = Os(i.text, a, !1); if (n(i.text.slice(u, a)) != l) break; a = u; } for (; o < i.length; ) { - let u = cs(i.text, o); + let u = Os(i.text, o); if (n(i.text.slice(o, u)) != l) break; o = u; } - return Ue.range(a + i.from, o + i.from); + return je.range(a + i.from, o + i.from); } -function Zxe(t, e) { +function zwe(t, e) { return e.left > t ? e.left - t : Math.max(0, t - e.right); } -function jxe(t, e) { +function Qwe(t, e) { return e.top > t ? e.top - t : Math.max(0, t - e.bottom); } -function UE(t, e) { +function v_(t, e) { return t.top < e.bottom - 1 && t.bottom > e.top + 1; } -function JB(t, e) { +function PF(t, e) { return e < t.top ? { top: e, left: t.left, right: t.right, bottom: t.bottom } : t; } -function eF(t, e) { +function NF(t, e) { return e > t.bottom ? { top: t.top, left: t.left, right: t.right, bottom: e } : t; } -function D7(t, e, r) { +function l8(t, e, r) { let n, i, s, a, o = !1, l, u, h, f; for (let g = t.firstChild; g; g = g.nextSibling) { - let m = Uy(g); + let m = f2(g); for (let v = 0; v < m.length; v++) { let y = m[v]; - i && UE(i, y) && (y = JB(eF(y, i.bottom), i.top)); - let b = Zxe(e, y), w = jxe(r, y); + i && v_(i, y) && (y = PF(NF(y, i.bottom), i.top)); + let b = zwe(e, y), w = Qwe(r, y); if (b == 0 && w == 0) - return g.nodeType == 3 ? tF(g, e, r) : D7(g, e, r); + return g.nodeType == 3 ? IF(g, e, r) : l8(g, e, r); if (!n || a > w || a == w && s > b) { n = g, i = y, s = b, a = w; let O = w ? r < y.top ? -1 : 1 : b ? e < y.left ? -1 : 1 : 0; o = !O || (O > 0 ? v < m.length - 1 : v > 0); } - b == 0 ? r > y.bottom && (!h || h.bottom < y.bottom) ? (l = g, h = y) : r < y.top && (!f || f.top > y.top) && (u = g, f = y) : h && UE(h, y) ? h = eF(h, y.bottom) : f && UE(f, y) && (f = JB(f, y.top)); + b == 0 ? r > y.bottom && (!h || h.bottom < y.bottom) ? (l = g, h = y) : r < y.top && (!f || f.top > y.top) && (u = g, f = y) : h && v_(h, y) ? h = NF(h, y.bottom) : f && v_(f, y) && (f = PF(f, y.top)); } } if (h && h.bottom >= r ? (n = l, i = h) : f && f.top <= r && (n = u, i = f), !n) return { node: t, offset: 0 }; let d = Math.max(i.left, Math.min(i.right, e)); if (n.nodeType == 3) - return tF(n, d, r); + return IF(n, d, r); if (o && n.contentEditable != "false") - return D7(n, d, r); + return l8(n, d, r); let p = Array.prototype.indexOf.call(t.childNodes, n) + (e >= (i.left + i.right) / 2 ? 1 : 0); return { node: t, offset: p }; } -function tF(t, e, r) { +function IF(t, e, r) { let n = t.nodeValue.length, i = -1, s = 1e9, a = 0; for (let o = 0; o < n; o++) { - let l = u0(t, o, o + 1).getClientRects(); + let l = A0(t, o, o + 1).getClientRects(); for (let u = 0; u < l.length; u++) { let h = l[u]; if (h.top == h.bottom) @@ -6183,7 +6183,7 @@ function tF(t, e, r) { let f = (h.top > r ? h.top - r : r - h.bottom) - 1; if (h.left - 1 <= e && h.right + 1 >= e && f < s) { let d = e >= (h.left + h.right) / 2, p = d; - if ((Pt.chrome || Pt.gecko) && u0(t, o).getBoundingClientRect().left == h.right && (p = !d), f <= 0) + if ((Vt.chrome || Vt.gecko) && A0(t, o).getBoundingClientRect().left == h.right && (p = !d), f <= 0) return { node: t, offset: o + (p ? 1 : 0) }; i = o + (p ? 1 : 0), s = f; } @@ -6191,14 +6191,14 @@ function tF(t, e, r) { } return { node: t, offset: i > -1 ? i : a > 0 ? t.nodeValue.length : 0 }; } -function DK(t, e, r, n = -1) { +function pJ(t, e, r, n = -1) { var i, s; let a = t.contentDOM.getBoundingClientRect(), o = a.top + t.viewState.paddingTop, l, { docHeight: u } = t.viewState, { x: h, y: f } = e, d = f - o; if (d < 0) return 0; if (d > u) return t.state.doc.length; - for (let O = t.viewState.heightOracle.textHeight / 2, S = !1; l = t.elementAtHeight(d), l.type != la.Text; ) + for (let O = t.viewState.heightOracle.textHeight / 2, S = !1; l = t.elementAtHeight(d), l.type != Ca.Text; ) for (; d = n > 0 ? l.bottom + O : l.top - O, !(d >= 0 && d <= u); ) { if (S) return r ? null : 0; @@ -6207,9 +6207,9 @@ function DK(t, e, r, n = -1) { f = o + d; let p = l.from; if (p < t.viewport.from) - return t.viewport.from == 0 ? 0 : r ? null : rF(t, a, l, h, f); + return t.viewport.from == 0 ? 0 : r ? null : $F(t, a, l, h, f); if (p > t.viewport.to) - return t.viewport.to == t.state.doc.length ? t.state.doc.length : r ? null : rF(t, a, l, h, f); + return t.viewport.to == t.state.doc.length ? t.state.doc.length : r ? null : $F(t, a, l, h, f); let g = t.dom.ownerDocument, m = t.root.elementFromPoint ? t.root : g, v = m.elementFromPoint(h, f); v && !t.contentDOM.contains(v) && (v = null), v || (h = Math.max(a.left + 1, Math.min(a.right - 1, h)), v = m.elementFromPoint(h, f), v && !t.contentDOM.contains(v) && (v = null)); let y, b = -1; @@ -6219,14 +6219,14 @@ function DK(t, e, r, n = -1) { O && ({ offsetNode: y, offset: b } = O); } else if (g.caretRangeFromPoint) { let O = g.caretRangeFromPoint(h, f); - O && ({ startContainer: y, startOffset: b } = O, (!t.contentDOM.contains(y) || Pt.safari && Kxe(y, b, h) || Pt.chrome && Jxe(y, b, h)) && (y = void 0)); + O && ({ startContainer: y, startOffset: b } = O, (!t.contentDOM.contains(y) || Vt.safari && Uwe(y, b, h) || Vt.chrome && Vwe(y, b, h)) && (y = void 0)); } } if (!y || !t.docView.dom.contains(y)) { - let O = wi.find(t.docView, p); + let O = Pi.find(t.docView, p); if (!O) return d > l.top + l.height / 2 ? l.to : l.from; - ({ node: y, offset: b } = D7(O.dom, h, f)); + ({ node: y, offset: b } = l8(O.dom, h, f)); } let w = t.docView.nearest(y); if (!w) @@ -6237,25 +6237,25 @@ function DK(t, e, r, n = -1) { } else return w.localPosFromDOM(y, b) + w.posAtStart; } -function rF(t, e, r, n, i) { +function $F(t, e, r, n, i) { let s = Math.round((n - e.left) * t.defaultCharacterWidth); if (t.lineWrapping && r.height > t.defaultLineHeight * 1.5) { let o = t.viewState.heightOracle.textHeight, l = Math.floor((i - r.top - (t.defaultLineHeight - o) * 0.5) / o); s += l * t.viewState.heightOracle.lineLength; } let a = t.state.sliceDoc(r.from, r.to); - return r.from + b7(a, s, t.state.tabSize); + return r.from + X7(a, s, t.state.tabSize); } -function Kxe(t, e, r) { +function Uwe(t, e, r) { let n; if (t.nodeType != 3 || e != (n = t.nodeValue.length)) return !1; for (let i = t.nextSibling; i; i = i.nextSibling) if (i.nodeType != 1 || i.nodeName != "BR") return !1; - return u0(t, n - 1, n).getBoundingClientRect().left > r; + return A0(t, n - 1, n).getBoundingClientRect().left > r; } -function Jxe(t, e, r) { +function Vwe(t, e, r) { if (e != 0) return !1; for (let i = t; ; ) { @@ -6266,39 +6266,39 @@ function Jxe(t, e, r) { break; i = s; } - let n = t.nodeType == 1 ? t.getBoundingClientRect() : u0(t, 0, Math.max(t.nodeValue.length, 1)).getBoundingClientRect(); + let n = t.nodeType == 1 ? t.getBoundingClientRect() : A0(t, 0, Math.max(t.nodeValue.length, 1)).getBoundingClientRect(); return r - n.left > 5; } -function P7(t, e) { +function c8(t, e) { let r = t.lineBlockAt(e); if (Array.isArray(r.type)) { for (let n of r.type) - if (n.to > e || n.to == e && (n.to == r.to || n.type == la.Text)) + if (n.to > e || n.to == e && (n.to == r.to || n.type == Ca.Text)) return n; } return r; } -function ewe(t, e, r, n) { - let i = P7(t, e.head), s = !n || i.type != la.Text || !(t.lineWrapping || i.widgetLineBreaks) ? null : t.coordsAtPos(e.assoc < 0 && e.head > i.from ? e.head - 1 : e.head); +function qwe(t, e, r, n) { + let i = c8(t, e.head), s = !n || i.type != Ca.Text || !(t.lineWrapping || i.widgetLineBreaks) ? null : t.coordsAtPos(e.assoc < 0 && e.head > i.from ? e.head - 1 : e.head); if (s) { let a = t.dom.getBoundingClientRect(), o = t.textDirectionAt(i.from), l = t.posAtCoords({ - x: r == (o == Pn.LTR) ? a.right - 1 : a.left + 1, + x: r == (o == Wn.LTR) ? a.right - 1 : a.left + 1, y: (s.top + s.bottom) / 2 }); if (l != null) - return Ue.cursor(l, r ? -1 : 1); + return je.cursor(l, r ? -1 : 1); } - return Ue.cursor(r ? i.to : i.from, r ? -1 : 1); + return je.cursor(r ? i.to : i.from, r ? -1 : 1); } -function nF(t, e, r, n) { +function BF(t, e, r, n) { let i = t.state.doc.lineAt(e.head), s = t.bidiSpans(i), a = t.textDirectionAt(i.from); for (let o = e, l = null; ; ) { - let u = Qxe(i, s, a, o, r), h = LK; + let u = Rwe(i, s, a, o, r), h = hJ; if (!u) { if (i.number == (r ? t.state.doc.lines : 1)) return o; h = ` -`, i = t.state.doc.line(i.number + (r ? 1 : -1)), s = t.bidiSpans(i), u = Ue.cursor(r ? i.from : i.to); +`, i = t.state.doc.line(i.number + (r ? 1 : -1)), s = t.bidiSpans(i), u = je.cursor(r ? i.from : i.to); } if (l) { if (!l(h)) @@ -6311,17 +6311,17 @@ function nF(t, e, r, n) { o = u; } } -function twe(t, e, r) { +function Ywe(t, e, r) { let n = t.state.charCategorizer(e), i = n(r); return (s) => { let a = n(s); - return i == Tn.Space && (i = a), i == a; + return i == Fn.Space && (i = a), i == a; }; } -function rwe(t, e, r, n) { +function Wwe(t, e, r, n) { let i = e.head, s = r ? 1 : -1; if (i == (r ? t.state.doc.length : 0)) - return Ue.cursor(i, e.assoc); + return je.cursor(i, e.assoc); let a = e.goalColumn, o, l = t.contentDOM.getBoundingClientRect(), u = t.coordsAtPos(i, e.assoc || -1), h = t.documentTop; if (u) a == null && (a = u.left - l.left), o = s < 0 ? u.top : u.bottom; @@ -6331,14 +6331,14 @@ function rwe(t, e, r, n) { } let f = l.left + a, d = n != null ? n : t.viewState.heightOracle.textHeight >> 1; for (let p = 0; ; p += 10) { - let g = o + (d + p) * s, m = DK(t, { x: f, y: g }, !1, s); + let g = o + (d + p) * s, m = pJ(t, { x: f, y: g }, !1, s); if (g < l.top || g > l.bottom || (s < 0 ? m < i : m > i)) { let v = t.docView.coordsForChar(m), y = !v || g < v.top ? -1 : 1; - return Ue.cursor(m, y, void 0, a); + return je.cursor(m, y, void 0, a); } } } -function _4(t, e, r) { +function t5(t, e, r) { for (; ; ) { let n = 0; for (let i of t) @@ -6352,19 +6352,19 @@ function _4(t, e, r) { return e; } } -function VE(t, e, r) { - let n = _4(t.state.facet(wM).map((i) => i(t)), r.from, e.head > r.from ? -1 : 1); - return n == r.from ? r : Ue.cursor(n, n < r.from ? 1 : -1); +function y_(t, e, r) { + let n = t5(t.state.facet(ZM).map((i) => i(t)), r.from, e.head > r.from ? -1 : 1); + return n == r.from ? r : je.cursor(n, n < r.from ? 1 : -1); } -class nwe { +class Gwe { setSelectionOrigin(e) { this.lastSelectionOrigin = e, this.lastSelectionTime = Date.now(); } constructor(e) { - this.view = e, this.lastKeyCode = 0, this.lastKeyTime = 0, this.lastTouchTime = 0, this.lastFocusTime = 0, this.lastScrollTop = 0, this.lastScrollLeft = 0, this.pendingIOSKey = void 0, this.lastSelectionOrigin = null, this.lastSelectionTime = 0, this.lastEscPress = 0, this.lastContextMenu = 0, this.scrollHandlers = [], this.handlers = /* @__PURE__ */ Object.create(null), this.composing = -1, this.compositionFirstChange = null, this.compositionEndedAt = 0, this.compositionPendingKey = !1, this.compositionPendingChange = !1, this.mouseSelection = null, this.draggedContent = null, this.handleEvent = this.handleEvent.bind(this), this.notifiedFocused = e.hasFocus, Pt.safari && e.contentDOM.addEventListener("input", () => null), Pt.gecko && bwe(e.contentDOM.ownerDocument); + this.view = e, this.lastKeyCode = 0, this.lastKeyTime = 0, this.lastTouchTime = 0, this.lastFocusTime = 0, this.lastScrollTop = 0, this.lastScrollLeft = 0, this.pendingIOSKey = void 0, this.lastSelectionOrigin = null, this.lastSelectionTime = 0, this.lastEscPress = 0, this.lastContextMenu = 0, this.scrollHandlers = [], this.handlers = /* @__PURE__ */ Object.create(null), this.composing = -1, this.compositionFirstChange = null, this.compositionEndedAt = 0, this.compositionPendingKey = !1, this.compositionPendingChange = !1, this.mouseSelection = null, this.draggedContent = null, this.handleEvent = this.handleEvent.bind(this), this.notifiedFocused = e.hasFocus, Vt.safari && e.contentDOM.addEventListener("input", () => null), Vt.gecko && cOe(e.contentDOM.ownerDocument); } handleEvent(e) { - !hwe(this.view, e) || this.ignoreDuringComposition(e) || e.type == "keydown" && this.keydown(e) || this.runHandlers(e.type, e); + !tOe(this.view, e) || this.ignoreDuringComposition(e) || e.type == "keydown" && this.keydown(e) || this.runHandlers(e.type, e); } runHandlers(e, r) { let n = this.handlers[e]; @@ -6382,7 +6382,7 @@ class nwe { } } ensureHandlers(e) { - let r = iwe(e), n = this.handlers, i = this.view.contentDOM; + let r = Xwe(e), n = this.handlers, i = this.view.contentDOM; for (let s in r) if (s != "scroll") { let a = !r[s].handlers.length, o = n[s]; @@ -6395,17 +6395,17 @@ class nwe { keydown(e) { if (this.lastKeyCode = e.keyCode, this.lastKeyTime = Date.now(), e.keyCode == 9 && Date.now() < this.lastEscPress + 2e3) return !0; - if (e.keyCode != 27 && NK.indexOf(e.keyCode) < 0 && (this.view.inputState.lastEscPress = 0), Pt.android && Pt.chrome && !e.synthetic && (e.keyCode == 13 || e.keyCode == 8)) + if (e.keyCode != 27 && mJ.indexOf(e.keyCode) < 0 && (this.view.inputState.lastEscPress = 0), Vt.android && Vt.chrome && !e.synthetic && (e.keyCode == 13 || e.keyCode == 8)) return this.view.observer.delayAndroidKey(e.key, e.keyCode), !0; let r; - return Pt.ios && !e.synthetic && !e.altKey && !e.metaKey && ((r = PK.find((n) => n.keyCode == e.keyCode)) && !e.ctrlKey || swe.indexOf(e.key) > -1 && e.ctrlKey && !e.shiftKey) ? (this.pendingIOSKey = r || e, setTimeout(() => this.flushIOSKey(), 250), !0) : (e.keyCode != 229 && this.view.observer.forceFlush(), !1); + return Vt.ios && !e.synthetic && !e.altKey && !e.metaKey && ((r = gJ.find((n) => n.keyCode == e.keyCode)) && !e.ctrlKey || Hwe.indexOf(e.key) > -1 && e.ctrlKey && !e.shiftKey) ? (this.pendingIOSKey = r || e, setTimeout(() => this.flushIOSKey(), 250), !0) : (e.keyCode != 229 && this.view.observer.forceFlush(), !1); } flushIOSKey() { let e = this.pendingIOSKey; - return e ? (this.pendingIOSKey = void 0, lg(this.view.contentDOM, e.key, e.keyCode)) : !1; + return e ? (this.pendingIOSKey = void 0, Ag(this.view.contentDOM, e.key, e.keyCode)) : !1; } ignoreDuringComposition(e) { - return /^key/.test(e.type) ? this.composing > 0 ? !0 : Pt.safari && !Pt.ios && this.compositionPendingKey && Date.now() - this.compositionEndedAt < 100 ? (this.compositionPendingKey = !1, !0) : !1 : !1; + return /^key/.test(e.type) ? this.composing > 0 ? !0 : Vt.safari && !Vt.ios && this.compositionPendingKey && Date.now() - this.compositionEndedAt < 100 ? (this.compositionPendingKey = !1, !0) : !1 : !1; } startMouseSelection(e) { this.mouseSelection && this.mouseSelection.destroy(), this.mouseSelection = e; @@ -6417,16 +6417,16 @@ class nwe { this.mouseSelection && this.mouseSelection.destroy(); } } -function iF(t, e) { +function FF(t, e) { return (r, n) => { try { return e.call(t, n, r); } catch (i) { - Vo(r.state, i); + al(r.state, i); } }; } -function iwe(t) { +function Xwe(t) { let e = /* @__PURE__ */ Object.create(null); function r(n) { return e[n] || (e[n] = { observers: [], handlers: [] }); @@ -6436,37 +6436,37 @@ function iwe(t) { if (i && i.domEventHandlers) for (let s in i.domEventHandlers) { let a = i.domEventHandlers[s]; - a && r(s).handlers.push(iF(n.value, a)); + a && r(s).handlers.push(FF(n.value, a)); } if (i && i.domEventObservers) for (let s in i.domEventObservers) { let a = i.domEventObservers[s]; - a && r(s).observers.push(iF(n.value, a)); + a && r(s).observers.push(FF(n.value, a)); } } - for (let n in Bl) - r(n).handlers.push(Bl[n]); - for (let n in Fl) - r(n).observers.push(Fl[n]); + for (let n in rc) + r(n).handlers.push(rc[n]); + for (let n in nc) + r(n).observers.push(nc[n]); return e; } -const PK = [ +const gJ = [ { key: "Backspace", keyCode: 8, inputType: "deleteContentBackward" }, { key: "Enter", keyCode: 13, inputType: "insertParagraph" }, { key: "Enter", keyCode: 13, inputType: "insertLineBreak" }, { key: "Delete", keyCode: 46, inputType: "deleteContentForward" } -], swe = "dthko", NK = [16, 17, 18, 20, 91, 92, 224, 225], Nw = 6; -function Iw(t) { +], Hwe = "dthko", mJ = [16, 17, 18, 20, 91, 92, 224, 225], lO = 6; +function cO(t) { return Math.max(0, t) * 0.7 + 8; } -function awe(t, e) { +function Zwe(t, e) { return Math.max(Math.abs(t.clientX - e.clientX), Math.abs(t.clientY - e.clientY)); } -class owe { +class jwe { constructor(e, r, n, i) { - this.view = e, this.startEvent = r, this.style = n, this.mustSelect = i, this.scrollSpeed = { x: 0, y: 0 }, this.scrolling = -1, this.lastEvent = r, this.scrollParent = kxe(e.contentDOM), this.atoms = e.state.facet(wM).map((a) => a(e)); + this.view = e, this.startEvent = r, this.style = n, this.mustSelect = i, this.scrollSpeed = { x: 0, y: 0 }, this.scrolling = -1, this.lastEvent = r, this.scrollParent = dwe(e.contentDOM), this.atoms = e.state.facet(ZM).map((a) => a(e)); let s = e.contentDOM.ownerDocument; - s.addEventListener("mousemove", this.move = this.move.bind(this)), s.addEventListener("mouseup", this.up = this.up.bind(this)), this.extend = r.shiftKey, this.multiple = e.state.facet(dr.allowMultipleSelections) && lwe(e, r), this.dragging = uwe(e, r) && FK(r) == 1 ? null : !1; + s.addEventListener("mousemove", this.move = this.move.bind(this)), s.addEventListener("mouseup", this.up = this.up.bind(this)), this.extend = r.shiftKey, this.multiple = e.state.facet(Sr.allowMultipleSelections) && Kwe(e, r), this.dragging = eOe(e, r) && xJ(r) == 1 ? null : !1; } start(e) { this.dragging === !1 && this.select(e); @@ -6475,11 +6475,11 @@ class owe { var r; if (e.buttons == 0) return this.destroy(); - if (this.dragging || this.dragging == null && awe(this.startEvent, e) < 10) + if (this.dragging || this.dragging == null && Zwe(this.startEvent, e) < 10) return; this.select(this.lastEvent = e); - let n = 0, i = 0, s = ((r = this.scrollParent) === null || r === void 0 ? void 0 : r.getBoundingClientRect()) || { left: 0, top: 0, right: this.view.win.innerWidth, bottom: this.view.win.innerHeight }, a = TK(this.view); - e.clientX - a.left <= s.left + Nw ? n = -Iw(s.left - e.clientX) : e.clientX + a.right >= s.right - Nw && (n = Iw(e.clientX - s.right)), e.clientY - a.top <= s.top + Nw ? i = -Iw(s.top - e.clientY) : e.clientY + a.bottom >= s.bottom - Nw && (i = Iw(e.clientY - s.bottom)), this.setScrollSpeed(n, i); + let n = 0, i = 0, s = ((r = this.scrollParent) === null || r === void 0 ? void 0 : r.getBoundingClientRect()) || { left: 0, top: 0, right: this.view.win.innerWidth, bottom: this.view.win.innerHeight }, a = aJ(this.view); + e.clientX - a.left <= s.left + lO ? n = -cO(s.left - e.clientX) : e.clientX + a.right >= s.right - lO && (n = cO(e.clientX - s.right)), e.clientY - a.top <= s.top + lO ? i = -cO(s.top - e.clientY) : e.clientY + a.bottom >= s.bottom - lO && (i = cO(e.clientY - s.bottom)), this.setScrollSpeed(n, i); } up(e) { this.dragging == null && this.select(this.lastEvent), this.dragging || e.preventDefault(), this.destroy(); @@ -6500,15 +6500,15 @@ class owe { for (let n = 0; n < e.ranges.length; n++) { let i = e.ranges[n], s = null; if (i.empty) { - let a = _4(this.atoms, i.from, 0); - a != i.from && (s = Ue.cursor(a, -1)); + let a = t5(this.atoms, i.from, 0); + a != i.from && (s = je.cursor(a, -1)); } else { - let a = _4(this.atoms, i.from, -1), o = _4(this.atoms, i.to, 1); - (a != i.from || o != i.to) && (s = Ue.range(i.from == i.anchor ? a : o, i.from == i.head ? a : o)); + let a = t5(this.atoms, i.from, -1), o = t5(this.atoms, i.to, 1); + (a != i.from || o != i.to) && (s = je.range(i.from == i.anchor ? a : o, i.from == i.head ? a : o)); } s && (r || (r = e.ranges.slice()), r[n] = s); } - return r ? Ue.create(r, e.mainIndex) : e; + return r ? je.create(r, e.mainIndex) : e; } select(e) { let { view: r } = this, n = this.skipAtoms(this.style.get(e, this.extend, this.multiple)); @@ -6521,19 +6521,19 @@ class owe { this.style.update(e) && setTimeout(() => this.select(this.lastEvent), 20); } } -function lwe(t, e) { - let r = t.state.facet(pK); - return r.length ? r[0](e) : Pt.mac ? e.metaKey : e.ctrlKey; +function Kwe(t, e) { + let r = t.state.facet(HK); + return r.length ? r[0](e) : Vt.mac ? e.metaKey : e.ctrlKey; } -function cwe(t, e) { - let r = t.state.facet(gK); - return r.length ? r[0](e) : Pt.mac ? !e.altKey : !e.ctrlKey; +function Jwe(t, e) { + let r = t.state.facet(ZK); + return r.length ? r[0](e) : Vt.mac ? !e.altKey : !e.ctrlKey; } -function uwe(t, e) { +function eOe(t, e) { let { main: r } = t.state.selection; if (r.empty) return !1; - let n = Q5(t.root); + let n = pk(t.root); if (!n || n.rangeCount == 0) return !0; let i = n.getRangeAt(0).getClientRects(); @@ -6544,29 +6544,29 @@ function uwe(t, e) { } return !1; } -function hwe(t, e) { +function tOe(t, e) { if (!e.bubbles) return !0; if (e.defaultPrevented) return !1; for (let r = e.target, n; r != t.contentDOM; r = r.parentNode) - if (!r || r.nodeType == 11 || (n = bn.get(r)) && n.ignoreEvent(e)) + if (!r || r.nodeType == 11 || (n = Dn.get(r)) && n.ignoreEvent(e)) return !1; return !0; } -const Bl = /* @__PURE__ */ Object.create(null), Fl = /* @__PURE__ */ Object.create(null), IK = Pt.ie && Pt.ie_version < 15 || Pt.ios && Pt.webkit_version < 604; -function fwe(t) { +const rc = /* @__PURE__ */ Object.create(null), nc = /* @__PURE__ */ Object.create(null), vJ = Vt.ie && Vt.ie_version < 15 || Vt.ios && Vt.webkit_version < 604; +function rOe(t) { let e = t.dom.parentNode; if (!e) return; let r = e.appendChild(document.createElement("textarea")); r.style.cssText = "position: fixed; left: -10000px; top: 10px", r.focus(), setTimeout(() => { - t.focus(), r.remove(), $K(t, r.value); + t.focus(), r.remove(), yJ(t, r.value); }, 50); } -function $K(t, e) { +function yJ(t, e) { let { state: r } = t, n, i = 1, s = r.toText(e), a = s.lines == r.selection.ranges.length; - if (N7 != null && r.selection.ranges.every((l) => l.empty) && N7 == s.toString()) { + if (u8 != null && r.selection.ranges.every((l) => l.empty) && u8 == s.toString()) { let l = -1; n = r.changeByRange((u) => { let h = r.doc.lineAt(u.from); @@ -6576,7 +6576,7 @@ function $K(t, e) { let f = r.toText((a ? s.line(i++).text : e) + r.lineBreak); return { changes: { from: h.from, insert: f }, - range: Ue.cursor(u.from + f.length) + range: je.cursor(u.from + f.length) }; }); } else @@ -6584,7 +6584,7 @@ function $K(t, e) { let u = s.line(i++); return { changes: { from: l.from, to: l.to, insert: u.text }, - range: Ue.cursor(l.from + u.length) + range: je.cursor(l.from + u.length) }; }) : n = r.replaceSelection(s); t.dispatch(n, { @@ -6592,45 +6592,45 @@ function $K(t, e) { scrollIntoView: !0 }); } -Fl.scroll = (t) => { +nc.scroll = (t) => { t.inputState.lastScrollTop = t.scrollDOM.scrollTop, t.inputState.lastScrollLeft = t.scrollDOM.scrollLeft; }; -Bl.keydown = (t, e) => (t.inputState.setSelectionOrigin("select"), e.keyCode == 27 && (t.inputState.lastEscPress = Date.now()), !1); -Fl.touchstart = (t, e) => { +rc.keydown = (t, e) => (t.inputState.setSelectionOrigin("select"), e.keyCode == 27 && (t.inputState.lastEscPress = Date.now()), !1); +nc.touchstart = (t, e) => { t.inputState.lastTouchTime = Date.now(), t.inputState.setSelectionOrigin("select.pointer"); }; -Fl.touchmove = (t) => { +nc.touchmove = (t) => { t.inputState.setSelectionOrigin("select.pointer"); }; -Bl.mousedown = (t, e) => { +rc.mousedown = (t, e) => { if (t.observer.flush(), t.inputState.lastTouchTime > Date.now() - 2e3) return !1; let r = null; - for (let n of t.state.facet(mK)) + for (let n of t.state.facet(jK)) if (r = n(t, e), r) break; - if (!r && e.button == 0 && (r = gwe(t, e)), r) { + if (!r && e.button == 0 && (r = sOe(t, e)), r) { let n = !t.hasFocus; - t.inputState.startMouseSelection(new owe(t, e, r, n)), n && t.observer.ignore(() => rK(t.contentDOM)); + t.inputState.startMouseSelection(new jwe(t, e, r, n)), n && t.observer.ignore(() => $K(t.contentDOM)); let i = t.inputState.mouseSelection; if (i) return i.start(e), i.dragging === !1; } return !1; }; -function sF(t, e, r, n) { +function zF(t, e, r, n) { if (n == 1) - return Ue.cursor(e, r); + return je.cursor(e, r); if (n == 2) - return Hxe(t.state, e, r); + return Fwe(t.state, e, r); { - let i = wi.find(t.docView, e), s = t.state.doc.lineAt(i ? i.posAtEnd : e), a = i ? i.posAtStart : s.from, o = i ? i.posAtEnd : s.to; - return o < t.state.doc.length && o == s.to && o++, Ue.range(a, o); + let i = Pi.find(t.docView, e), s = t.state.doc.lineAt(i ? i.posAtEnd : e), a = i ? i.posAtStart : s.from, o = i ? i.posAtEnd : s.to; + return o < t.state.doc.length && o == s.to && o++, je.range(a, o); } } -let BK = (t, e) => t >= e.top && t <= e.bottom, aF = (t, e, r) => BK(e, r) && t >= r.left && t <= r.right; -function dwe(t, e, r, n) { - let i = wi.find(t.docView, e); +let bJ = (t, e) => t >= e.top && t <= e.bottom, QF = (t, e, r) => bJ(e, r) && t >= r.left && t <= r.right; +function nOe(t, e, r, n) { + let i = Pi.find(t.docView, e); if (!i) return 1; let s = e - i.posAtStart; @@ -6639,71 +6639,71 @@ function dwe(t, e, r, n) { if (s == i.length) return -1; let a = i.coordsAt(s, -1); - if (a && aF(r, n, a)) + if (a && QF(r, n, a)) return -1; let o = i.coordsAt(s, 1); - return o && aF(r, n, o) ? 1 : a && BK(n, a) ? -1 : 1; + return o && QF(r, n, o) ? 1 : a && bJ(n, a) ? -1 : 1; } -function oF(t, e) { +function UF(t, e) { let r = t.posAtCoords({ x: e.clientX, y: e.clientY }, !1); - return { pos: r, bias: dwe(t, r, e.clientX, e.clientY) }; + return { pos: r, bias: nOe(t, r, e.clientX, e.clientY) }; } -const pwe = Pt.ie && Pt.ie_version <= 11; -let lF = null, cF = 0, uF = 0; -function FK(t) { - if (!pwe) +const iOe = Vt.ie && Vt.ie_version <= 11; +let VF = null, qF = 0, YF = 0; +function xJ(t) { + if (!iOe) return t.detail; - let e = lF, r = uF; - return lF = t, uF = Date.now(), cF = !e || r > Date.now() - 400 && Math.abs(e.clientX - t.clientX) < 2 && Math.abs(e.clientY - t.clientY) < 2 ? (cF + 1) % 3 : 1; + let e = VF, r = YF; + return VF = t, YF = Date.now(), qF = !e || r > Date.now() - 400 && Math.abs(e.clientX - t.clientX) < 2 && Math.abs(e.clientY - t.clientY) < 2 ? (qF + 1) % 3 : 1; } -function gwe(t, e) { - let r = oF(t, e), n = FK(e), i = t.state.selection; +function sOe(t, e) { + let r = UF(t, e), n = xJ(e), i = t.state.selection; return { update(s) { s.docChanged && (r.pos = s.changes.mapPos(r.pos), i = i.map(s.changes)); }, get(s, a, o) { - let l = oF(t, s), u, h = sF(t, l.pos, l.bias, n); + let l = UF(t, s), u, h = zF(t, l.pos, l.bias, n); if (r.pos != l.pos && !a) { - let f = sF(t, r.pos, r.bias, n), d = Math.min(f.from, h.from), p = Math.max(f.to, h.to); - h = d < h.from ? Ue.range(d, p) : Ue.range(p, d); + let f = zF(t, r.pos, r.bias, n), d = Math.min(f.from, h.from), p = Math.max(f.to, h.to); + h = d < h.from ? je.range(d, p) : je.range(p, d); } - return a ? i.replaceRange(i.main.extend(h.from, h.to)) : o && n == 1 && i.ranges.length > 1 && (u = mwe(i, l.pos)) ? u : o ? i.addRange(h) : Ue.create([h]); + return a ? i.replaceRange(i.main.extend(h.from, h.to)) : o && n == 1 && i.ranges.length > 1 && (u = aOe(i, l.pos)) ? u : o ? i.addRange(h) : je.create([h]); } }; } -function mwe(t, e) { +function aOe(t, e) { for (let r = 0; r < t.ranges.length; r++) { let { from: n, to: i } = t.ranges[r]; if (n <= e && i >= e) - return Ue.create(t.ranges.slice(0, r).concat(t.ranges.slice(r + 1)), t.mainIndex == r ? 0 : t.mainIndex - (t.mainIndex > r ? 1 : 0)); + return je.create(t.ranges.slice(0, r).concat(t.ranges.slice(r + 1)), t.mainIndex == r ? 0 : t.mainIndex - (t.mainIndex > r ? 1 : 0)); } return null; } -Bl.dragstart = (t, e) => { +rc.dragstart = (t, e) => { let { selection: { main: r } } = t.state; if (e.target.draggable) { let i = t.docView.nearest(e.target); if (i && i.isWidget) { let s = i.posAtStart, a = s + i.length; - (s >= r.to || a <= r.from) && (r = Ue.range(s, a)); + (s >= r.to || a <= r.from) && (r = je.range(s, a)); } } let { inputState: n } = t; return n.mouseSelection && (n.mouseSelection.dragging = !0), n.draggedContent = r, e.dataTransfer && (e.dataTransfer.setData("Text", t.state.sliceDoc(r.from, r.to)), e.dataTransfer.effectAllowed = "copyMove"), !1; }; -Bl.dragend = (t) => (t.inputState.draggedContent = null, !1); -function hF(t, e, r, n) { +rc.dragend = (t) => (t.inputState.draggedContent = null, !1); +function WF(t, e, r, n) { if (!r) return; - let i = t.posAtCoords({ x: e.clientX, y: e.clientY }, !1), { draggedContent: s } = t.inputState, a = n && s && cwe(t, e) ? { from: s.from, to: s.to } : null, o = { from: i, insert: r }, l = t.state.changes(a ? [a, o] : o); + let i = t.posAtCoords({ x: e.clientX, y: e.clientY }, !1), { draggedContent: s } = t.inputState, a = n && s && Jwe(t, e) ? { from: s.from, to: s.to } : null, o = { from: i, insert: r }, l = t.state.changes(a ? [a, o] : o); t.focus(), t.dispatch({ changes: l, selection: { anchor: l.mapPos(i, -1), head: l.mapPos(i, 1) }, userEvent: a ? "move.drop" : "input.drop" }), t.inputState.draggedContent = null; } -Bl.drop = (t, e) => { +rc.drop = (t, e) => { if (!e.dataTransfer) return !1; if (t.state.readOnly) @@ -6711,7 +6711,7 @@ Bl.drop = (t, e) => { let r = e.dataTransfer.files; if (r && r.length) { let n = Array(r.length), i = 0, s = () => { - ++i == r.length && hF(t, e, n.filter((a) => a != null).join(t.state.lineBreak), !1); + ++i == r.length && WF(t, e, n.filter((a) => a != null).join(t.state.lineBreak), !1); }; for (let a = 0; a < r.length; a++) { let o = new FileReader(); @@ -6723,18 +6723,18 @@ Bl.drop = (t, e) => { } else { let n = e.dataTransfer.getData("Text"); if (n) - return hF(t, e, n, !0), !0; + return WF(t, e, n, !0), !0; } return !1; }; -Bl.paste = (t, e) => { +rc.paste = (t, e) => { if (t.state.readOnly) return !0; t.observer.flush(); - let r = IK ? null : e.clipboardData; - return r ? ($K(t, r.getData("text/plain") || r.getData("text/uri-text")), !0) : (fwe(t), !1); + let r = vJ ? null : e.clipboardData; + return r ? (yJ(t, r.getData("text/plain") || r.getData("text/uri-text")), !0) : (rOe(t), !1); }; -function vwe(t, e) { +function oOe(t, e) { let r = t.dom.parentNode; if (!r) return; @@ -6743,7 +6743,7 @@ function vwe(t, e) { n.remove(), t.focus(); }, 50); } -function ywe(t) { +function lOe(t) { let e = [], r = [], n = !1; for (let i of t.selection.ranges) i.empty || (e.push(t.sliceDoc(i.from, i.to)), r.push(i)); @@ -6757,58 +6757,58 @@ function ywe(t) { } return { text: e.join(t.lineBreak), ranges: r, linewise: n }; } -let N7 = null; -Bl.copy = Bl.cut = (t, e) => { - let { text: r, ranges: n, linewise: i } = ywe(t.state); +let u8 = null; +rc.copy = rc.cut = (t, e) => { + let { text: r, ranges: n, linewise: i } = lOe(t.state); if (!r && !i) return !1; - N7 = i ? r : null, e.type == "cut" && !t.state.readOnly && t.dispatch({ + u8 = i ? r : null, e.type == "cut" && !t.state.readOnly && t.dispatch({ changes: n, scrollIntoView: !0, userEvent: "delete.cut" }); - let s = IK ? null : e.clipboardData; - return s ? (s.clearData(), s.setData("text/plain", r), !0) : (vwe(t, r), !1); + let s = vJ ? null : e.clipboardData; + return s ? (s.clearData(), s.setData("text/plain", r), !0) : (oOe(t, r), !1); }; -const zK = /* @__PURE__ */ Ya.define(); -function QK(t, e) { +const wJ = /* @__PURE__ */ co.define(); +function OJ(t, e) { let r = []; - for (let n of t.facet(bK)) { + for (let n of t.facet(eJ)) { let i = n(t, e); i && r.push(i); } - return r ? t.update({ effects: r, annotations: zK.of(!0) }) : null; + return r ? t.update({ effects: r, annotations: wJ.of(!0) }) : null; } -function UK(t) { +function kJ(t) { setTimeout(() => { let e = t.hasFocus; if (e != t.inputState.notifiedFocused) { - let r = QK(t.state, e); + let r = OJ(t.state, e); r ? t.dispatch(r) : t.update([]); } }, 10); } -Fl.focus = (t) => { - t.inputState.lastFocusTime = Date.now(), !t.scrollDOM.scrollTop && (t.inputState.lastScrollTop || t.inputState.lastScrollLeft) && (t.scrollDOM.scrollTop = t.inputState.lastScrollTop, t.scrollDOM.scrollLeft = t.inputState.lastScrollLeft), UK(t); +nc.focus = (t) => { + t.inputState.lastFocusTime = Date.now(), !t.scrollDOM.scrollTop && (t.inputState.lastScrollTop || t.inputState.lastScrollLeft) && (t.scrollDOM.scrollTop = t.inputState.lastScrollTop, t.scrollDOM.scrollLeft = t.inputState.lastScrollLeft), kJ(t); }; -Fl.blur = (t) => { - t.observer.clearSelectionRange(), UK(t); +nc.blur = (t) => { + t.observer.clearSelectionRange(), kJ(t); }; -Fl.compositionstart = Fl.compositionupdate = (t) => { +nc.compositionstart = nc.compositionupdate = (t) => { t.inputState.compositionFirstChange == null && (t.inputState.compositionFirstChange = !0), t.inputState.composing < 0 && (t.inputState.composing = 0); }; -Fl.compositionend = (t) => { - t.inputState.composing = -1, t.inputState.compositionEndedAt = Date.now(), t.inputState.compositionPendingKey = !0, t.inputState.compositionPendingChange = t.observer.pendingRecords().length > 0, t.inputState.compositionFirstChange = null, Pt.chrome && Pt.android ? t.observer.flushSoon() : t.inputState.compositionPendingChange ? Promise.resolve().then(() => t.observer.flush()) : setTimeout(() => { +nc.compositionend = (t) => { + t.inputState.composing = -1, t.inputState.compositionEndedAt = Date.now(), t.inputState.compositionPendingKey = !0, t.inputState.compositionPendingChange = t.observer.pendingRecords().length > 0, t.inputState.compositionFirstChange = null, Vt.chrome && Vt.android ? t.observer.flushSoon() : t.inputState.compositionPendingChange ? Promise.resolve().then(() => t.observer.flush()) : setTimeout(() => { t.inputState.composing < 0 && t.docView.hasComposition && t.update([]); }, 50); }; -Fl.contextmenu = (t) => { +nc.contextmenu = (t) => { t.inputState.lastContextMenu = Date.now(); }; -Bl.beforeinput = (t, e) => { +rc.beforeinput = (t, e) => { var r; let n; - if (Pt.chrome && Pt.android && (n = PK.find((i) => i.inputType == e.inputType)) && (t.observer.delayAndroidKey(n.key, n.keyCode), n.key == "Backspace" || n.key == "Delete")) { + if (Vt.chrome && Vt.android && (n = gJ.find((i) => i.inputType == e.inputType)) && (t.observer.delayAndroidKey(n.key, n.keyCode), n.key == "Backspace" || n.key == "Delete")) { let i = ((r = window.visualViewport) === null || r === void 0 ? void 0 : r.height) || 0; setTimeout(() => { var s; @@ -6817,16 +6817,16 @@ Bl.beforeinput = (t, e) => { } return !1; }; -const fF = /* @__PURE__ */ new Set(); -function bwe(t) { - fF.has(t) || (fF.add(t), t.addEventListener("copy", () => { +const GF = /* @__PURE__ */ new Set(); +function cOe(t) { + GF.has(t) || (GF.add(t), t.addEventListener("copy", () => { }), t.addEventListener("cut", () => { })); } -const dF = ["pre-wrap", "normal", "pre-line", "break-spaces"]; -class xwe { +const XF = ["pre-wrap", "normal", "pre-line", "break-spaces"]; +class uOe { constructor(e) { - this.lineWrapping = e, this.doc = Dr.empty, this.heightSamples = {}, this.lineHeight = 14, this.charWidth = 7, this.textHeight = 14, this.lineLength = 30, this.heightChanged = !1; + this.lineWrapping = e, this.doc = qr.empty, this.heightSamples = {}, this.lineHeight = 14, this.charWidth = 7, this.textHeight = 14, this.lineLength = 30, this.heightChanged = !1; } heightForGap(e, r) { let n = this.doc.lineAt(r).number - this.doc.lineAt(e).number + 1; @@ -6839,7 +6839,7 @@ class xwe { return this.doc = e, this; } mustRefreshForWrapping(e) { - return dF.indexOf(e) > -1 != this.lineWrapping; + return XF.indexOf(e) > -1 != this.lineWrapping; } mustRefreshForHeights(e) { let r = !1; @@ -6850,7 +6850,7 @@ class xwe { return r; } refresh(e, r, n, i, s, a) { - let o = dF.indexOf(e) > -1, l = Math.round(r) != Math.round(this.lineHeight) || this.lineWrapping != o; + let o = XF.indexOf(e) > -1, l = Math.round(r) != Math.round(this.lineHeight) || this.lineWrapping != o; if (this.lineWrapping = o, this.lineHeight = r, this.charWidth = n, this.textHeight = i, this.lineLength = s, l) { this.heightSamples = {}; for (let u = 0; u < a.length; u++) { @@ -6861,7 +6861,7 @@ class xwe { return l; } } -class wwe { +class hOe { constructor(e, r) { this.from = e, this.heights = r, this.index = 0; } @@ -6869,12 +6869,12 @@ class wwe { return this.index < this.heights.length; } } -class vc { +class Ic { constructor(e, r, n, i, s) { this.from = e, this.length = r, this.top = n, this.height = i, this._content = s; } get type() { - return typeof this._content == "number" ? la.Text : Array.isArray(this._content) ? this._content : this._content.type; + return typeof this._content == "number" ? Ca.Text : Array.isArray(this._content) ? this._content : this._content.type; } get to() { return this.from + this.length; @@ -6883,21 +6883,21 @@ class vc { return this.top + this.height; } get widget() { - return this._content instanceof mf ? this._content.widget : null; + return this._content instanceof Pf ? this._content.widget : null; } get widgetLineBreaks() { return typeof this._content == "number" ? this._content : 0; } join(e) { let r = (Array.isArray(this._content) ? this._content : [this]).concat(Array.isArray(e._content) ? e._content : [e]); - return new vc(this.from, this.length + e.length, this.top, this.height + e.height, r); + return new Ic(this.from, this.length + e.length, this.top, this.height + e.height, r); } } -var vn = /* @__PURE__ */ function(t) { +var Rn = /* @__PURE__ */ function(t) { return t[t.ByPos = 0] = "ByPos", t[t.ByHeight = 1] = "ByHeight", t[t.ByPosNoHeight = 2] = "ByPosNoHeight", t; -}(vn || (vn = {})); -const A4 = 1e-3; -class ca { +}(Rn || (Rn = {})); +const r5 = 1e-3; +class Ea { constructor(e, r, n = 2) { this.length = e, this.height = r, this.flags = n; } @@ -6908,10 +6908,10 @@ class ca { this.flags = (e ? 2 : 0) | this.flags & -3; } setHeight(e, r) { - this.height != r && (Math.abs(this.height - r) > A4 && (e.heightChanged = !0), this.height = r); + this.height != r && (Math.abs(this.height - r) > r5 && (e.heightChanged = !0), this.height = r); } replace(e, r, n) { - return ca.of(n); + return Ea.of(n); } decomposeLeft(e, r) { r.push(this); @@ -6922,17 +6922,17 @@ class ca { applyChanges(e, r, n, i) { let s = this, a = n.doc; for (let o = i.length - 1; o >= 0; o--) { - let { fromA: l, toA: u, fromB: h, toB: f } = i[o], d = s.lineAt(l, vn.ByPosNoHeight, n.setDoc(r), 0, 0), p = d.to >= u ? d : s.lineAt(u, vn.ByPosNoHeight, n, 0, 0); + let { fromA: l, toA: u, fromB: h, toB: f } = i[o], d = s.lineAt(l, Rn.ByPosNoHeight, n.setDoc(r), 0, 0), p = d.to >= u ? d : s.lineAt(u, Rn.ByPosNoHeight, n, 0, 0); for (f += p.to - u, u = p.to; o > 0 && d.from <= i[o - 1].toA; ) - l = i[o - 1].fromA, h = i[o - 1].fromB, o--, l < d.from && (d = s.lineAt(l, vn.ByPosNoHeight, n, 0, 0)); + l = i[o - 1].fromA, h = i[o - 1].fromB, o--, l < d.from && (d = s.lineAt(l, Rn.ByPosNoHeight, n, 0, 0)); h += d.from - l, l = d.from; - let g = OM.build(n.setDoc(a), e, h, f); + let g = jM.build(n.setDoc(a), e, h, f); s = s.replace(l, u, g); } return s.updateHeight(n, 0); } static empty() { - return new no(0, 0); + return new wo(0, 0); } static of(e) { if (e.length == 1) @@ -6956,16 +6956,16 @@ class ca { o && (s += o.size); } let a = 0; - return e[r - 1] == null ? (a = 1, r--) : e[r] == null && (a = 1, n++), new Owe(ca.of(e.slice(0, r)), a, ca.of(e.slice(n))); + return e[r - 1] == null ? (a = 1, r--) : e[r] == null && (a = 1, n++), new fOe(Ea.of(e.slice(0, r)), a, Ea.of(e.slice(n))); } } -ca.prototype.size = 1; -class VK extends ca { +Ea.prototype.size = 1; +class SJ extends Ea { constructor(e, r, n) { super(e, r), this.deco = n; } blockAt(e, r, n, i) { - return new vc(i, this.length, n, this.height, this.deco || 0); + return new Ic(i, this.length, n, this.height, this.deco || 0); } lineAt(e, r, n, i, s) { return this.blockAt(0, n, i, s); @@ -6980,16 +6980,16 @@ class VK extends ca { return `block(${this.length})`; } } -class no extends VK { +class wo extends SJ { constructor(e, r) { super(e, r, null), this.collapsed = 0, this.widgetHeight = 0, this.breaks = 0; } blockAt(e, r, n, i) { - return new vc(i, this.length, n, this.height, this.breaks); + return new Ic(i, this.length, n, this.height, this.breaks); } replace(e, r, n) { let i = n[0]; - return n.length == 1 && (i instanceof no || i instanceof ss && i.flags & 4) && Math.abs(this.length - i.length) < 10 ? (i instanceof ss ? i = new no(i.length, this.height) : i.height = this.height, this.outdated || (i.outdated = !1), i) : ca.of(n); + return n.length == 1 && (i instanceof wo || i instanceof ys && i.flags & 4) && Math.abs(this.length - i.length) < 10 ? (i instanceof ys ? i = new wo(i.length, this.height) : i.height = this.height, this.outdated || (i.outdated = !1), i) : Ea.of(n); } updateHeight(e, r = 0, n = !1, i) { return i && i.from <= r && i.more ? this.setHeight(e, i.heights[i.index++]) : (n || this.outdated) && this.setHeight(e, Math.max(this.widgetHeight, e.heightForLine(this.length - this.collapsed)) + this.breaks * e.lineHeight), this.outdated = !1, this; @@ -6998,7 +6998,7 @@ class no extends VK { return `line(${this.length}${this.collapsed ? -this.collapsed : ""}${this.widgetHeight ? ":" + this.widgetHeight : ""})`; } } -class ss extends ca { +class ys extends Ea { constructor(e) { super(e, 0); } @@ -7015,21 +7015,21 @@ class ss extends ca { let { firstLine: s, lastLine: a, perLine: o, perChar: l } = this.heightMetrics(r, i); if (r.lineWrapping) { let u = i + Math.round(Math.max(0, Math.min(1, (e - n) / this.height)) * this.length), h = r.doc.lineAt(u), f = o + h.length * l, d = Math.max(n, e - f / 2); - return new vc(h.from, h.length, d, f, 0); + return new Ic(h.from, h.length, d, f, 0); } else { let u = Math.max(0, Math.min(a - s, Math.floor((e - n) / o))), { from: h, length: f } = r.doc.line(s + u); - return new vc(h, f, n + o * u, o, 0); + return new Ic(h, f, n + o * u, o, 0); } } lineAt(e, r, n, i, s) { - if (r == vn.ByHeight) + if (r == Rn.ByHeight) return this.blockAt(e, n, i, s); - if (r == vn.ByPosNoHeight) { + if (r == Rn.ByPosNoHeight) { let { from: p, to: g } = n.doc.lineAt(e); - return new vc(p, g - p, 0, 0, 0); + return new Ic(p, g - p, 0, 0, 0); } let { firstLine: a, perLine: o, perChar: l } = this.heightMetrics(n, s), u = n.doc.lineAt(e), h = o + u.length * l, f = u.number - a, d = i + o * f + l * (u.from - s - f); - return new vc(u.from, u.length, Math.max(i, Math.min(d, i + this.height - h)), h, 0); + return new Ic(u.from, u.length, Math.max(i, Math.min(d, i + this.height - h)), h, 0); } forEachLine(e, r, n, i, s, a) { e = Math.max(e, s), r = Math.min(r, s + this.length); @@ -7041,42 +7041,42 @@ class ss extends ca { f += l * g + u * (e - s - g); } let p = l + u * d.length; - a(new vc(d.from, d.length, f, p, 0)), f += p, h = d.to + 1; + a(new Ic(d.from, d.length, f, p, 0)), f += p, h = d.to + 1; } } replace(e, r, n) { let i = this.length - r; if (i > 0) { let s = n[n.length - 1]; - s instanceof ss ? n[n.length - 1] = new ss(s.length + i) : n.push(null, new ss(i - 1)); + s instanceof ys ? n[n.length - 1] = new ys(s.length + i) : n.push(null, new ys(i - 1)); } if (e > 0) { let s = n[0]; - s instanceof ss ? n[0] = new ss(e + s.length) : n.unshift(new ss(e - 1), null); + s instanceof ys ? n[0] = new ys(e + s.length) : n.unshift(new ys(e - 1), null); } - return ca.of(n); + return Ea.of(n); } decomposeLeft(e, r) { - r.push(new ss(e - 1), null); + r.push(new ys(e - 1), null); } decomposeRight(e, r) { - r.push(null, new ss(this.length - e - 1)); + r.push(null, new ys(this.length - e - 1)); } updateHeight(e, r = 0, n = !1, i) { let s = r + this.length; if (i && i.from <= r + this.length && i.more) { let a = [], o = Math.max(r, i.from), l = -1; - for (i.from > r && a.push(new ss(i.from - r - 1).updateHeight(e, r)); o <= s && i.more; ) { + for (i.from > r && a.push(new ys(i.from - r - 1).updateHeight(e, r)); o <= s && i.more; ) { let h = e.doc.lineAt(o).length; a.length && a.push(null); let f = i.heights[i.index++]; - l == -1 ? l = f : Math.abs(f - l) >= A4 && (l = -2); - let d = new no(h, f); + l == -1 ? l = f : Math.abs(f - l) >= r5 && (l = -2); + let d = new wo(h, f); d.outdated = !1, a.push(d), o += h + 1; } - o <= s && a.push(null, new ss(s - o).updateHeight(e, o)); - let u = ca.of(a); - return (l < 0 || Math.abs(u.height - this.height) >= A4 || Math.abs(l - this.heightMetrics(e, r).perLine) >= A4) && (e.heightChanged = !0), u; + o <= s && a.push(null, new ys(s - o).updateHeight(e, o)); + let u = Ea.of(a); + return (l < 0 || Math.abs(u.height - this.height) >= r5 || Math.abs(l - this.heightMetrics(e, r).perLine) >= r5) && (e.heightChanged = !0), u; } else (n || this.outdated) && (this.setHeight(e, e.heightForGap(r, r + this.length)), this.outdated = !1); return this; @@ -7085,7 +7085,7 @@ class ss extends ca { return `gap(${this.length})`; } } -class Owe extends ca { +class fOe extends Ea { constructor(e, r, n) { super(e.length + r + n.length, e.height + n.height, r | (e.outdated || n.outdated ? 2 : 0)), this.left = e, this.right = n, this.size = e.size + n.size; } @@ -7097,10 +7097,10 @@ class Owe extends ca { return e < s ? this.left.blockAt(e, r, n, i) : this.right.blockAt(e, r, s, i + this.left.length + this.break); } lineAt(e, r, n, i, s) { - let a = i + this.left.height, o = s + this.left.length + this.break, l = r == vn.ByHeight ? e < a : e < o, u = l ? this.left.lineAt(e, r, n, i, s) : this.right.lineAt(e, r, n, a, o); + let a = i + this.left.height, o = s + this.left.length + this.break, l = r == Rn.ByHeight ? e < a : e < o, u = l ? this.left.lineAt(e, r, n, i, s) : this.right.lineAt(e, r, n, a, o); if (this.break || (l ? u.to < o : u.from > o)) return u; - let h = r == vn.ByPosNoHeight ? vn.ByPosNoHeight : vn.ByPos; + let h = r == Rn.ByPosNoHeight ? Rn.ByPosNoHeight : Rn.ByPos; return l ? u.join(this.right.lineAt(o, h, n, a, o)) : this.left.lineAt(o, h, n, i, s).join(u); } forEachLine(e, r, n, i, s, a) { @@ -7108,7 +7108,7 @@ class Owe extends ca { if (this.break) e < l && this.left.forEachLine(e, r, n, i, s, a), r >= l && this.right.forEachLine(e, r, n, o, l, a); else { - let u = this.lineAt(l, vn.ByPos, n, i, s); + let u = this.lineAt(l, Rn.ByPos, n, i, s); e < u.from && this.left.forEachLine(e, u.from - 1, n, i, s, a), u.to >= e && u.from <= r && a(u), r > u.to && this.right.forEachLine(u.to + 1, r, n, o, l, a); } } @@ -7123,11 +7123,11 @@ class Owe extends ca { let a = s.length; for (let o of n) s.push(o); - if (e > 0 && pF(s, a - 1), r < this.length) { + if (e > 0 && HF(s, a - 1), r < this.length) { let o = s.length; - this.decomposeRight(r, s), pF(s, o); + this.decomposeRight(r, s), HF(s, o); } - return ca.of(s); + return Ea.of(s); } decomposeLeft(e, r) { let n = this.left.length; @@ -7142,7 +7142,7 @@ class Owe extends ca { e < n && this.left.decomposeRight(e, r), this.break && e < i && r.push(null), r.push(this.right); } balanced(e, r) { - return e.size > 2 * r.size || r.size > 2 * e.size ? ca.of(this.break ? [e, null, r] : [e, r]) : (this.left = e, this.right = r, this.height = e.height + r.height, this.outdated = e.outdated || r.outdated, this.size = e.size + r.size, this.length = e.length + this.break + r.length, this); + return e.size > 2 * r.size || r.size > 2 * e.size ? Ea.of(this.break ? [e, null, r] : [e, r]) : (this.left = e, this.right = r, this.height = e.height + r.height, this.outdated = e.outdated || r.outdated, this.size = e.size + r.size, this.length = e.length + this.break + r.length, this); } updateHeight(e, r = 0, n = !1, i) { let { left: s, right: a } = this, o = r + s.length + this.break, l = null; @@ -7152,12 +7152,12 @@ class Owe extends ca { return this.left + (this.break ? " " : "-") + this.right; } } -function pF(t, e) { +function HF(t, e) { let r, n; - t[e] == null && (r = t[e - 1]) instanceof ss && (n = t[e + 1]) instanceof ss && t.splice(e - 1, 3, new ss(r.length + 1 + n.length)); + t[e] == null && (r = t[e - 1]) instanceof ys && (n = t[e + 1]) instanceof ys && t.splice(e - 1, 3, new ys(r.length + 1 + n.length)); } -const kwe = 5; -class OM { +const dOe = 5; +class jM { constructor(e, r) { this.pos = e, this.oracle = r, this.nodes = [], this.lineStart = -1, this.lineEnd = -1, this.covering = null, this.writtenTo = e; } @@ -7167,7 +7167,7 @@ class OM { span(e, r) { if (this.lineStart > -1) { let n = Math.min(r, this.lineEnd), i = this.nodes[this.nodes.length - 1]; - i instanceof no ? i.length += n - this.pos : (n > this.pos || !this.isCovered) && this.nodes.push(new no(n - this.pos, -1)), this.writtenTo = n, r > n && (this.nodes.push(null), this.writtenTo++, this.lineStart = -1); + i instanceof wo ? i.length += n - this.pos : (n > this.pos || !this.isCovered) && this.nodes.push(new wo(n - this.pos, -1)), this.writtenTo = n, r > n && (this.nodes.push(null), this.writtenTo++, this.lineStart = -1); } this.pos = r; } @@ -7176,7 +7176,7 @@ class OM { let i = n.widget ? n.widget.estimatedHeight : 0, s = n.widget ? n.widget.lineBreaks : 0; i < 0 && (i = this.oracle.lineHeight); let a = r - e; - n.block ? this.addBlock(new VK(a, i, n)) : (a || s || i >= kwe) && this.addLineDeco(i, s, a); + n.block ? this.addBlock(new SJ(a, i, n)) : (a || s || i >= dOe) && this.addLineDeco(i, s, a); } else r > e && this.span(e, r); this.lineEnd > -1 && this.lineEnd < this.pos && (this.lineEnd = this.oracle.doc.lineAt(this.pos).to); @@ -7185,18 +7185,18 @@ class OM { if (this.lineStart > -1) return; let { from: e, to: r } = this.oracle.doc.lineAt(this.pos); - this.lineStart = e, this.lineEnd = r, this.writtenTo < e && ((this.writtenTo < e - 1 || this.nodes[this.nodes.length - 1] == null) && this.nodes.push(this.blankContent(this.writtenTo, e - 1)), this.nodes.push(null)), this.pos > e && this.nodes.push(new no(this.pos - e, -1)), this.writtenTo = this.pos; + this.lineStart = e, this.lineEnd = r, this.writtenTo < e && ((this.writtenTo < e - 1 || this.nodes[this.nodes.length - 1] == null) && this.nodes.push(this.blankContent(this.writtenTo, e - 1)), this.nodes.push(null)), this.pos > e && this.nodes.push(new wo(this.pos - e, -1)), this.writtenTo = this.pos; } blankContent(e, r) { - let n = new ss(r - e); + let n = new ys(r - e); return this.oracle.doc.lineAt(e).to == r && (n.flags |= 4), n; } ensureLine() { this.enterLine(); let e = this.nodes.length ? this.nodes[this.nodes.length - 1] : null; - if (e instanceof no) + if (e instanceof wo) return e; - let r = new no(0, -1); + let r = new wo(0, -1); return this.nodes.push(r), r; } addBlock(e) { @@ -7210,32 +7210,32 @@ class OM { } finish(e) { let r = this.nodes.length == 0 ? null : this.nodes[this.nodes.length - 1]; - this.lineStart > -1 && !(r instanceof no) && !this.isCovered ? this.nodes.push(new no(0, -1)) : (this.writtenTo < this.pos || r == null) && this.nodes.push(this.blankContent(this.writtenTo, this.pos)); + this.lineStart > -1 && !(r instanceof wo) && !this.isCovered ? this.nodes.push(new wo(0, -1)) : (this.writtenTo < this.pos || r == null) && this.nodes.push(this.blankContent(this.writtenTo, this.pos)); let n = e; for (let i of this.nodes) - i instanceof no && i.updateHeight(this.oracle, n), n += i ? i.length : 1; + i instanceof wo && i.updateHeight(this.oracle, n), n += i ? i.length : 1; return this.nodes; } static build(e, r, n, i) { - let s = new OM(n, e); - return Er.spans(r, n, i, s, 0), s.finish(n); + let s = new jM(n, e); + return $r.spans(r, n, i, s, 0), s.finish(n); } } -function Swe(t, e, r) { - let n = new Twe(); - return Er.compare(t, e, r, n, 0), n.changes; +function pOe(t, e, r) { + let n = new gOe(); + return $r.compare(t, e, r, n, 0), n.changes; } -class Twe { +class gOe { constructor() { this.changes = []; } compareRange() { } comparePoint(e, r, n, i) { - (e < r || n && n.heightRelevant || i && i.heightRelevant) && _7(e, r, this.changes, 5); + (e < r || n && n.heightRelevant || i && i.heightRelevant) && n8(e, r, this.changes, 5); } } -function Cwe(t, e) { +function mOe(t, e) { let r = t.getBoundingClientRect(), n = t.ownerDocument, i = n.defaultView || window, s = Math.max(0, r.left), a = Math.min(i.innerWidth, r.right), o = Math.max(0, r.top), l = Math.min(i.innerHeight, r.bottom); for (let u = t.parentNode; u && u != n.body; ) if (u.nodeType == 1) { @@ -7256,7 +7256,7 @@ function Cwe(t, e) { bottom: Math.max(o, l) - (r.top + e) }; } -function Ewe(t, e) { +function vOe(t, e) { let r = t.getBoundingClientRect(); return { left: 0, @@ -7265,7 +7265,7 @@ function Ewe(t, e) { bottom: r.bottom - (r.top + e) }; } -class qE { +class b_ { constructor(e, r, n) { this.from = e, this.to = r, this.size = n; } @@ -7280,12 +7280,12 @@ class qE { return !0; } draw(e, r) { - return _t.replace({ - widget: new _we(this.size * (r ? e.scaleY : e.scaleX), r) + return It.replace({ + widget: new yOe(this.size * (r ? e.scaleY : e.scaleX), r) }).range(this.from, this.to); } } -class _we extends Wa { +class yOe extends uo { constructor(e, r) { super(), this.size = e, this.vertical = r; } @@ -7300,11 +7300,11 @@ class _we extends Wa { return this.vertical ? this.size : -1; } } -class gF { +class ZF { constructor(e) { - this.state = e, this.pixelViewport = { left: 0, right: window.innerWidth, top: 0, bottom: 0 }, this.inView = !0, this.paddingTop = 0, this.paddingBottom = 0, this.contentDOMWidth = 0, this.contentDOMHeight = 0, this.editorHeight = 0, this.editorWidth = 0, this.scrollTop = 0, this.scrolledToBottom = !0, this.scaleX = 1, this.scaleY = 1, this.scrollAnchorPos = 0, this.scrollAnchorHeight = -1, this.scaler = mF, this.scrollTarget = null, this.printing = !1, this.mustMeasureContent = !0, this.defaultTextDirection = Pn.LTR, this.visibleRanges = [], this.mustEnforceCursorAssoc = !1; - let r = e.facet(xM).some((n) => typeof n != "function" && n.class == "cm-lineWrapping"); - this.heightOracle = new xwe(r), this.stateDeco = e.facet(qy).filter((n) => typeof n != "function"), this.heightMap = ca.empty().applyChanges(this.stateDeco, Dr.empty, this.heightOracle.setDoc(e.doc), [new qo(0, 0, 0, e.doc.length)]), this.viewport = this.getViewport(0, null), this.updateViewportLines(), this.updateForViewport(), this.lineGaps = this.ensureLineGaps([]), this.lineGapDeco = _t.set(this.lineGaps.map((n) => n.draw(this, !1))), this.computeVisibleRanges(); + this.state = e, this.pixelViewport = { left: 0, right: window.innerWidth, top: 0, bottom: 0 }, this.inView = !0, this.paddingTop = 0, this.paddingBottom = 0, this.contentDOMWidth = 0, this.contentDOMHeight = 0, this.editorHeight = 0, this.editorWidth = 0, this.scrollTop = 0, this.scrolledToBottom = !0, this.scaleX = 1, this.scaleY = 1, this.scrollAnchorPos = 0, this.scrollAnchorHeight = -1, this.scaler = jF, this.scrollTarget = null, this.printing = !1, this.mustMeasureContent = !0, this.defaultTextDirection = Wn.LTR, this.visibleRanges = [], this.mustEnforceCursorAssoc = !1; + let r = e.facet(HM).some((n) => typeof n != "function" && n.class == "cm-lineWrapping"); + this.heightOracle = new uOe(r), this.stateDeco = e.facet(p2).filter((n) => typeof n != "function"), this.heightMap = Ea.empty().applyChanges(this.stateDeco, qr.empty, this.heightOracle.setDoc(e.doc), [new ol(0, 0, 0, e.doc.length)]), this.viewport = this.getViewport(0, null), this.updateViewportLines(), this.updateForViewport(), this.lineGaps = this.ensureLineGaps([]), this.lineGapDeco = It.set(this.lineGaps.map((n) => n.draw(this, !1))), this.computeVisibleRanges(); } updateForViewport() { let e = [this.viewport], { main: r } = this.state.selection; @@ -7312,42 +7312,42 @@ class gF { let i = n ? r.head : r.anchor; if (!e.some(({ from: s, to: a }) => i >= s && i <= a)) { let { from: s, to: a } = this.lineBlockAt(i); - e.push(new $w(s, a)); + e.push(new uO(s, a)); } } - this.viewports = e.sort((n, i) => n.from - i.from), this.scaler = this.heightMap.height <= 7e6 ? mF : new Rwe(this.heightOracle, this.heightMap, this.viewports); + this.viewports = e.sort((n, i) => n.from - i.from), this.scaler = this.heightMap.height <= 7e6 ? jF : new wOe(this.heightOracle, this.heightMap, this.viewports); } updateViewportLines() { this.viewportLines = [], this.heightMap.forEachLine(this.viewport.from, this.viewport.to, this.heightOracle.setDoc(this.state.doc), 0, 0, (e) => { - this.viewportLines.push(this.scaler.scale == 1 ? e : Mv(e, this.scaler)); + this.viewportLines.push(this.scaler.scale == 1 ? e : ry(e, this.scaler)); }); } update(e, r = null) { this.state = e.state; let n = this.stateDeco; - this.stateDeco = this.state.facet(qy).filter((h) => typeof h != "function"); - let i = e.changedRanges, s = qo.extendWithRanges(i, Swe(n, this.stateDeco, e ? e.changes : li.empty(this.state.doc.length))), a = this.heightMap.height, o = this.scrolledToBottom ? null : this.scrollAnchorAt(this.scrollTop); + this.stateDeco = this.state.facet(p2).filter((h) => typeof h != "function"); + let i = e.changedRanges, s = ol.extendWithRanges(i, pOe(n, this.stateDeco, e ? e.changes : wi.empty(this.state.doc.length))), a = this.heightMap.height, o = this.scrolledToBottom ? null : this.scrollAnchorAt(this.scrollTop); this.heightMap = this.heightMap.applyChanges(this.stateDeco, e.startState.doc, this.heightOracle.setDoc(this.state.doc), s), this.heightMap.height != a && (e.flags |= 2), o ? (this.scrollAnchorPos = e.changes.mapPos(o.from, -1), this.scrollAnchorHeight = o.top) : (this.scrollAnchorPos = -1, this.scrollAnchorHeight = this.heightMap.height); let l = s.length ? this.mapViewport(this.viewport, e.changes) : this.viewport; (r && (r.range.head < l.from || r.range.head > l.to) || !this.viewportIsAppropriate(l)) && (l = this.getViewport(0, r)); let u = !e.changes.empty || e.flags & 2 || l.from != this.viewport.from || l.to != this.viewport.to; - this.viewport = l, this.updateForViewport(), u && this.updateViewportLines(), (this.lineGaps.length || this.viewport.to - this.viewport.from > 2e3 << 1) && this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps, e.changes))), e.flags |= this.computeVisibleRanges(), r && (this.scrollTarget = r), !this.mustEnforceCursorAssoc && e.selectionSet && e.view.lineWrapping && e.state.selection.main.empty && e.state.selection.main.assoc && !e.state.facet(wK) && (this.mustEnforceCursorAssoc = !0); + this.viewport = l, this.updateForViewport(), u && this.updateViewportLines(), (this.lineGaps.length || this.viewport.to - this.viewport.from > 2e3 << 1) && this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps, e.changes))), e.flags |= this.computeVisibleRanges(), r && (this.scrollTarget = r), !this.mustEnforceCursorAssoc && e.selectionSet && e.view.lineWrapping && e.state.selection.main.empty && e.state.selection.main.assoc && !e.state.facet(rJ) && (this.mustEnforceCursorAssoc = !0); } measure(e) { let r = e.contentDOM, n = window.getComputedStyle(r), i = this.heightOracle, s = n.whiteSpace; - this.defaultTextDirection = n.direction == "rtl" ? Pn.RTL : Pn.LTR; + this.defaultTextDirection = n.direction == "rtl" ? Wn.RTL : Wn.LTR; let a = this.heightOracle.mustRefreshForWrapping(s), o = r.getBoundingClientRect(), l = a || this.mustMeasureContent || this.contentDOMHeight != o.height; this.contentDOMHeight = o.height, this.mustMeasureContent = !1; let u = 0, h = 0; if (o.width && o.height) { - let { scaleX: O, scaleY: S } = tK(r, o); + let { scaleX: O, scaleY: S } = IK(r, o); (this.scaleX != O || this.scaleY != S) && (this.scaleX = O, this.scaleY = S, u |= 8, a = l = !0); } let f = (parseInt(n.paddingTop) || 0) * this.scaleY, d = (parseInt(n.paddingBottom) || 0) * this.scaleY; (this.paddingTop != f || this.paddingBottom != d) && (this.paddingTop = f, this.paddingBottom = d, u |= 10), this.editorWidth != e.scrollDOM.clientWidth && (i.lineWrapping && (l = !0), this.editorWidth = e.scrollDOM.clientWidth, u |= 8); let p = e.scrollDOM.scrollTop * this.scaleY; - this.scrollTop != p && (this.scrollAnchorHeight = -1, this.scrollTop = p), this.scrolledToBottom = iK(e.scrollDOM); - let g = (this.printing ? Ewe : Cwe)(r, this.paddingTop), m = g.top - this.pixelViewport.top, v = g.bottom - this.pixelViewport.bottom; + this.scrollTop != p && (this.scrollAnchorHeight = -1, this.scrollTop = p), this.scrolledToBottom = FK(e.scrollDOM); + let g = (this.printing ? vOe : mOe)(r, this.paddingTop), m = g.top - this.pixelViewport.top, v = g.bottom - this.pixelViewport.bottom; this.pixelViewport = g; let y = this.pixelViewport.bottom > this.pixelViewport.top && this.pixelViewport.right > this.pixelViewport.left; if (y != this.inView && (this.inView = y, y && (l = !0)), !this.inView && !this.scrollTarget) @@ -7362,7 +7362,7 @@ class gF { m > 0 && v > 0 ? h = Math.max(m, v) : m < 0 && v < 0 && (h = Math.min(m, v)), i.heightChanged = !1; for (let S of this.viewports) { let C = S.from == this.viewport.from ? O : e.docView.measureVisibleLineHeights(S); - this.heightMap = (a ? ca.empty().applyChanges(this.stateDeco, Dr.empty, this.heightOracle, [new qo(0, 0, 0, e.state.doc.length)]) : this.heightMap).updateHeight(i, 0, a, new wwe(S.from, C)); + this.heightMap = (a ? Ea.empty().applyChanges(this.stateDeco, qr.empty, this.heightOracle, [new ol(0, 0, 0, e.state.doc.length)]) : this.heightMap).updateHeight(i, 0, a, new hOe(S.from, C)); } i.heightChanged && (u |= 2); } @@ -7376,24 +7376,24 @@ class gF { return this.scaler.fromDOM(this.pixelViewport.bottom); } getViewport(e, r) { - let n = 0.5 - Math.max(-0.5, Math.min(0.5, e / 1e3 / 2)), i = this.heightMap, s = this.heightOracle, { visibleTop: a, visibleBottom: o } = this, l = new $w(i.lineAt(a - n * 1e3, vn.ByHeight, s, 0, 0).from, i.lineAt(o + (1 - n) * 1e3, vn.ByHeight, s, 0, 0).to); + let n = 0.5 - Math.max(-0.5, Math.min(0.5, e / 1e3 / 2)), i = this.heightMap, s = this.heightOracle, { visibleTop: a, visibleBottom: o } = this, l = new uO(i.lineAt(a - n * 1e3, Rn.ByHeight, s, 0, 0).from, i.lineAt(o + (1 - n) * 1e3, Rn.ByHeight, s, 0, 0).to); if (r) { let { head: u } = r.range; if (u < l.from || u > l.to) { - let h = Math.min(this.editorHeight, this.pixelViewport.bottom - this.pixelViewport.top), f = i.lineAt(u, vn.ByPos, s, 0, 0), d; - r.y == "center" ? d = (f.top + f.bottom) / 2 - h / 2 : r.y == "start" || r.y == "nearest" && u < l.from ? d = f.top : d = f.bottom - h, l = new $w(i.lineAt(d - 1e3 / 2, vn.ByHeight, s, 0, 0).from, i.lineAt(d + h + 1e3 / 2, vn.ByHeight, s, 0, 0).to); + let h = Math.min(this.editorHeight, this.pixelViewport.bottom - this.pixelViewport.top), f = i.lineAt(u, Rn.ByPos, s, 0, 0), d; + r.y == "center" ? d = (f.top + f.bottom) / 2 - h / 2 : r.y == "start" || r.y == "nearest" && u < l.from ? d = f.top : d = f.bottom - h, l = new uO(i.lineAt(d - 1e3 / 2, Rn.ByHeight, s, 0, 0).from, i.lineAt(d + h + 1e3 / 2, Rn.ByHeight, s, 0, 0).to); } } return l; } mapViewport(e, r) { let n = r.mapPos(e.from, -1), i = r.mapPos(e.to, 1); - return new $w(this.heightMap.lineAt(n, vn.ByPos, this.heightOracle, 0, 0).from, this.heightMap.lineAt(i, vn.ByPos, this.heightOracle, 0, 0).to); + return new uO(this.heightMap.lineAt(n, Rn.ByPos, this.heightOracle, 0, 0).from, this.heightMap.lineAt(i, Rn.ByPos, this.heightOracle, 0, 0).to); } viewportIsAppropriate({ from: e, to: r }, n = 0) { if (!this.inView) return !0; - let { top: i } = this.heightMap.lineAt(e, vn.ByPos, this.heightOracle, 0, 0), { bottom: s } = this.heightMap.lineAt(r, vn.ByPos, this.heightOracle, 0, 0), { visibleTop: a, visibleBottom: o } = this; + let { top: i } = this.heightMap.lineAt(e, Rn.ByPos, this.heightOracle, 0, 0), { bottom: s } = this.heightMap.lineAt(r, Rn.ByPos, this.heightOracle, 0, 0), { visibleTop: a, visibleBottom: o } = this; return (e == 0 || i <= a - Math.max(10, Math.min(-n, 250))) && (r == this.state.doc.length || s >= o + Math.max(10, Math.min(n, 250))) && i > a - 2 * 1e3 && s < o + 2 * 1e3; } mapLineGaps(e, r) { @@ -7401,12 +7401,12 @@ class gF { return e; let n = []; for (let i of e) - r.touchesRange(i.from, i.to) || n.push(new qE(r.mapPos(i.from), r.mapPos(i.to), i.size)); + r.touchesRange(i.from, i.to) || n.push(new b_(r.mapPos(i.from), r.mapPos(i.to), i.size)); return n; } ensureLineGaps(e, r) { let n = this.heightOracle.lineWrapping, i = n ? 1e4 : 2e3, s = i >> 1, a = i << 1; - if (this.defaultTextDirection != Pn.LTR && !n) + if (this.defaultTextDirection != Wn.LTR && !n) return []; let o = [], l = (u, h, f, d) => { if (h - u < s) @@ -7418,56 +7418,56 @@ class gF { l(u, v - 10, f, d), l(v + 10, h, f, d); return; } - let m = Lwe(e, (v) => v.from >= f.from && v.to <= f.to && Math.abs(v.from - u) < s && Math.abs(v.to - h) < s && !g.some((y) => v.from < y && v.to > y)); + let m = xOe(e, (v) => v.from >= f.from && v.to <= f.to && Math.abs(v.from - u) < s && Math.abs(v.to - h) < s && !g.some((y) => v.from < y && v.to > y)); if (!m) { if (h < f.to && r && n && r.visibleRanges.some((v) => v.from <= h && v.to >= h)) { - let v = r.moveToLineBoundary(Ue.cursor(h), !1, !0).head; + let v = r.moveToLineBoundary(je.cursor(h), !1, !0).head; v > u && (h = v); } - m = new qE(u, h, this.gapSize(f, u, h, d)); + m = new b_(u, h, this.gapSize(f, u, h, d)); } o.push(m); }; for (let u of this.viewportLines) { if (u.length < a) continue; - let h = Awe(u.from, u.to, this.stateDeco); + let h = bOe(u.from, u.to, this.stateDeco); if (h.total < a) continue; let f = this.scrollTarget ? this.scrollTarget.range.head : null, d, p; if (n) { let g = i / this.heightOracle.lineLength * this.heightOracle.lineHeight, m, v; if (f != null) { - let y = Fw(h, f), b = ((this.visibleBottom - this.visibleTop) / 2 + g) / u.height; + let y = fO(h, f), b = ((this.visibleBottom - this.visibleTop) / 2 + g) / u.height; m = y - b, v = y + b; } else m = (this.visibleTop - u.top - g) / u.height, v = (this.visibleBottom - u.top + g) / u.height; - d = Bw(h, m), p = Bw(h, v); + d = hO(h, m), p = hO(h, v); } else { let g = h.total * this.heightOracle.charWidth, m = i * this.heightOracle.charWidth, v, y; if (f != null) { - let b = Fw(h, f), w = ((this.pixelViewport.right - this.pixelViewport.left) / 2 + m) / g; + let b = fO(h, f), w = ((this.pixelViewport.right - this.pixelViewport.left) / 2 + m) / g; v = b - w, y = b + w; } else v = (this.pixelViewport.left - m) / g, y = (this.pixelViewport.right + m) / g; - d = Bw(h, v), p = Bw(h, y); + d = hO(h, v), p = hO(h, y); } d > u.from && l(u.from, d, u, h), p < u.to && l(p, u.to, u, h); } return o; } gapSize(e, r, n, i) { - let s = Fw(i, n) - Fw(i, r); + let s = fO(i, n) - fO(i, r); return this.heightOracle.lineWrapping ? e.height * s : i.total * this.heightOracle.charWidth * s; } updateLineGaps(e) { - qE.same(e, this.lineGaps) || (this.lineGaps = e, this.lineGapDeco = _t.set(e.map((r) => r.draw(this, this.heightOracle.lineWrapping)))); + b_.same(e, this.lineGaps) || (this.lineGaps = e, this.lineGapDeco = It.set(e.map((r) => r.draw(this, this.heightOracle.lineWrapping)))); } computeVisibleRanges() { let e = this.stateDeco; this.lineGaps.length && (e = e.concat(this.lineGapDeco)); let r = []; - Er.spans(e, this.viewport.from, this.viewport.to, { + $r.spans(e, this.viewport.from, this.viewport.to, { span(i, s) { r.push({ from: i, to: s }); }, @@ -7478,17 +7478,17 @@ class gF { return this.visibleRanges = r, n ? 4 : 0; } lineBlockAt(e) { - return e >= this.viewport.from && e <= this.viewport.to && this.viewportLines.find((r) => r.from <= e && r.to >= e) || Mv(this.heightMap.lineAt(e, vn.ByPos, this.heightOracle, 0, 0), this.scaler); + return e >= this.viewport.from && e <= this.viewport.to && this.viewportLines.find((r) => r.from <= e && r.to >= e) || ry(this.heightMap.lineAt(e, Rn.ByPos, this.heightOracle, 0, 0), this.scaler); } lineBlockAtHeight(e) { - return Mv(this.heightMap.lineAt(this.scaler.fromDOM(e), vn.ByHeight, this.heightOracle, 0, 0), this.scaler); + return ry(this.heightMap.lineAt(this.scaler.fromDOM(e), Rn.ByHeight, this.heightOracle, 0, 0), this.scaler); } scrollAnchorAt(e) { let r = this.lineBlockAtHeight(e + 8); return r.from >= this.viewport.from || this.viewportLines[0].top - e > 200 ? r : this.viewportLines[0]; } elementAtHeight(e) { - return Mv(this.heightMap.blockAt(this.scaler.fromDOM(e), this.heightOracle, 0, 0), this.scaler); + return ry(this.heightMap.blockAt(this.scaler.fromDOM(e), this.heightOracle, 0, 0), this.scaler); } get docHeight() { return this.scaler.toDOM(this.heightMap.height); @@ -7497,14 +7497,14 @@ class gF { return this.docHeight + this.paddingTop + this.paddingBottom; } } -class $w { +class uO { constructor(e, r) { this.from = e, this.to = r; } } -function Awe(t, e, r) { +function bOe(t, e, r) { let n = [], i = t, s = 0; - return Er.spans(r, t, e, { + return $r.spans(r, t, e, { span() { }, point(a, o) { @@ -7512,7 +7512,7 @@ function Awe(t, e, r) { } }, 20), i < e && (n.push({ from: i, to: e }), s += e - i), { total: s, ranges: n }; } -function Bw({ total: t, ranges: e }, r) { +function hO({ total: t, ranges: e }, r) { if (r <= 0) return e[0].from; if (r >= 1) @@ -7525,7 +7525,7 @@ function Bw({ total: t, ranges: e }, r) { n -= o; } } -function Fw(t, e) { +function fO(t, e) { let r = 0; for (let { from: n, to: i } of t.ranges) { if (e <= i) { @@ -7536,12 +7536,12 @@ function Fw(t, e) { } return r / t.total; } -function Lwe(t, e) { +function xOe(t, e) { for (let r of t) if (e(r)) return r; } -const mF = { +const jF = { toDOM(t) { return t; }, @@ -7550,11 +7550,11 @@ const mF = { }, scale: 1 }; -class Rwe { +class wOe { constructor(e, r, n) { let i = 0, s = 0, a = 0; this.viewports = n.map(({ from: o, to: l }) => { - let u = r.lineAt(o, vn.ByPos, e, 0, 0).top, h = r.lineAt(l, vn.ByPos, e, 0, 0).bottom; + let u = r.lineAt(o, Rn.ByPos, e, 0, 0).top, h = r.lineAt(l, Rn.ByPos, e, 0, 0).bottom; return i += h - u, { from: o, to: l, top: u, bottom: h, domTop: 0, domBottom: 0 }; }), this.scale = (7e6 - i) / (r.height - i); for (let o of this.viewports) @@ -7581,15 +7581,15 @@ class Rwe { } } } -function Mv(t, e) { +function ry(t, e) { if (e.scale == 1) return t; let r = e.toDOM(t.top), n = e.toDOM(t.bottom); - return new vc(t.from, t.length, r, n - r, Array.isArray(t._content) ? t._content.map((i) => Mv(i, e)) : t._content); + return new Ic(t.from, t.length, r, n - r, Array.isArray(t._content) ? t._content.map((i) => ry(i, e)) : t._content); } -const zw = /* @__PURE__ */ At.define({ combine: (t) => t.join(" ") }), I7 = /* @__PURE__ */ At.define({ combine: (t) => t.indexOf(!0) > -1 }), $7 = /* @__PURE__ */ Uu.newName(), qK = /* @__PURE__ */ Uu.newName(), YK = /* @__PURE__ */ Uu.newName(), WK = { "&light": "." + qK, "&dark": "." + YK }; -function B7(t, e, r) { - return new Uu(e, { +const dO = /* @__PURE__ */ $t.define({ combine: (t) => t.join(" ") }), h8 = /* @__PURE__ */ $t.define({ combine: (t) => t.indexOf(!0) > -1 }), f8 = /* @__PURE__ */ ah.newName(), TJ = /* @__PURE__ */ ah.newName(), CJ = /* @__PURE__ */ ah.newName(), EJ = { "&light": "." + TJ, "&dark": "." + CJ }; +function d8(t, e, r) { + return new ah(e, { finish(n) { return /&/.test(n) ? n.replace(/&\w*/, (i) => { if (i == "&") @@ -7601,7 +7601,7 @@ function B7(t, e, r) { } }); } -const Mwe = /* @__PURE__ */ B7("." + $7, { +const OOe = /* @__PURE__ */ d8("." + f8, { "&": { position: "relative !important", boxSizing: "border-box", @@ -7832,16 +7832,16 @@ const Mwe = /* @__PURE__ */ B7("." + $7, { border: "1px solid #555", backgroundColor: "inherit" } -}, WK), Dv = "\uFFFF"; -class Dwe { +}, EJ), ny = "\uFFFF"; +class kOe { constructor(e, r) { - this.points = e, this.text = "", this.lineSeparator = r.facet(dr.lineSeparator); + this.points = e, this.text = "", this.lineSeparator = r.facet(Sr.lineSeparator); } append(e) { this.text += e; } lineBreak() { - this.text += Dv; + this.text += ny; } readRange(e, r) { if (!e) @@ -7854,8 +7854,8 @@ class Dwe { let a = i.nextSibling; if (a == r) break; - let o = bn.get(i), l = bn.get(a); - (o && l ? o.breakAfter : (o ? o.breakAfter : vF(i)) || vF(a) && (i.nodeName != "BR" || i.cmIgnore) && this.text.length > s) && this.lineBreak(), i = a; + let o = Dn.get(i), l = Dn.get(a); + (o && l ? o.breakAfter : (o ? o.breakAfter : KF(i)) || KF(a) && (i.nodeName != "BR" || i.cmIgnore) && this.text.length > s) && this.lineBreak(), i = a; } return this.findPointBefore(n, r), this; } @@ -7876,7 +7876,7 @@ class Dwe { readNode(e) { if (e.cmIgnore) return; - let r = bn.get(e), n = r && r.overrideDOMText; + let r = Dn.get(e), n = r && r.overrideDOMText; if (n != null) { this.findPointInside(e, n.length); for (let i = n.iter(); !i.next().done; ) @@ -7890,75 +7890,75 @@ class Dwe { } findPointInside(e, r) { for (let n of this.points) - (e.nodeType == 3 ? n.node == e : e.contains(n.node)) && (n.pos = this.text.length + (Pwe(e, n.node, n.offset) ? r : 0)); + (e.nodeType == 3 ? n.node == e : e.contains(n.node)) && (n.pos = this.text.length + (SOe(e, n.node, n.offset) ? r : 0)); } } -function Pwe(t, e, r) { +function SOe(t, e, r) { for (; ; ) { - if (!e || r < Vu(e)) + if (!e || r < oh(e)) return !1; if (e == t) return !0; - r = Vy(e) + 1, e = e.parentNode; + r = d2(e) + 1, e = e.parentNode; } } -function vF(t) { +function KF(t) { return t.nodeType == 1 && /^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName); } -class yF { +class JF { constructor(e, r) { this.node = e, this.offset = r, this.pos = -1; } } -class Nwe { +class TOe { constructor(e, r, n, i) { this.typeOver = i, this.bounds = null, this.text = ""; let { impreciseHead: s, impreciseAnchor: a } = e.docView; if (e.state.readOnly && r > -1) this.newSel = null; else if (r > -1 && (this.bounds = e.docView.domBoundsAround(r, n, 0))) { - let o = s || a ? [] : Bwe(e), l = new Dwe(o, e.state); - l.readRange(this.bounds.startDOM, this.bounds.endDOM), this.text = l.text, this.newSel = Fwe(o, this.bounds.from); + let o = s || a ? [] : _Oe(e), l = new kOe(o, e.state); + l.readRange(this.bounds.startDOM, this.bounds.endDOM), this.text = l.text, this.newSel = AOe(o, this.bounds.from); } else { - let o = e.observer.selectionRange, l = s && s.node == o.focusNode && s.offset == o.focusOffset || !O7(e.contentDOM, o.focusNode) ? e.state.selection.main.head : e.docView.posFromDOM(o.focusNode, o.focusOffset), u = a && a.node == o.anchorNode && a.offset == o.anchorOffset || !O7(e.contentDOM, o.anchorNode) ? e.state.selection.main.anchor : e.docView.posFromDOM(o.anchorNode, o.anchorOffset); - this.newSel = Ue.single(u, l); + let o = e.observer.selectionRange, l = s && s.node == o.focusNode && s.offset == o.focusOffset || !j7(e.contentDOM, o.focusNode) ? e.state.selection.main.head : e.docView.posFromDOM(o.focusNode, o.focusOffset), u = a && a.node == o.anchorNode && a.offset == o.anchorOffset || !j7(e.contentDOM, o.anchorNode) ? e.state.selection.main.anchor : e.docView.posFromDOM(o.anchorNode, o.anchorOffset); + this.newSel = je.single(u, l); } } } -function GK(t, e) { +function _J(t, e) { let r, { newSel: n } = e, i = t.state.selection.main, s = t.inputState.lastKeyTime > Date.now() - 100 ? t.inputState.lastKeyCode : -1; if (e.bounds) { let { from: a, to: o } = e.bounds, l = i.from, u = null; - (s === 8 || Pt.android && e.text.length < o - a) && (l = i.to, u = "end"); - let h = $we(t.state.doc.sliceString(a, o, Dv), e.text, l - a, u); - h && (Pt.chrome && s == 13 && h.toB == h.from + 2 && e.text.slice(h.from, h.toB) == Dv + Dv && h.toB--, r = { + (s === 8 || Vt.android && e.text.length < o - a) && (l = i.to, u = "end"); + let h = EOe(t.state.doc.sliceString(a, o, ny), e.text, l - a, u); + h && (Vt.chrome && s == 13 && h.toB == h.from + 2 && e.text.slice(h.from, h.toB) == ny + ny && h.toB--, r = { from: a + h.from, to: a + h.toA, - insert: Dr.of(e.text.slice(h.from, h.toB).split(Dv)) + insert: qr.of(e.text.slice(h.from, h.toB).split(ny)) }); } else - n && (!t.hasFocus && t.state.facet(oT) || n.main.eq(i)) && (n = null); + n && (!t.hasFocus && t.state.facet(PT) || n.main.eq(i)) && (n = null); if (!r && !n) return !1; if (!r && e.typeOver && !i.empty && n && n.main.empty ? r = { from: i.from, to: i.to, insert: t.state.doc.slice(i.from, i.to) } : r && r.from >= i.from && r.to <= i.to && (r.from != i.from || r.to != i.to) && i.to - i.from - (r.to - r.from) <= 4 ? r = { from: i.from, to: i.to, insert: t.state.doc.slice(i.from, r.from).append(r.insert).append(t.state.doc.slice(r.to, i.to)) - } : (Pt.mac || Pt.android) && r && r.from == r.to && r.from == i.head - 1 && /^\. ?$/.test(r.insert.toString()) && t.contentDOM.getAttribute("autocorrect") == "off" ? (n && r.insert.length == 2 && (n = Ue.single(n.main.anchor - 1, n.main.head - 1)), r = { from: i.from, to: i.to, insert: Dr.of([" "]) }) : Pt.chrome && r && r.from == r.to && r.from == i.head && r.insert.toString() == ` - ` && t.lineWrapping && (n && (n = Ue.single(n.main.anchor - 1, n.main.head - 1)), r = { from: i.from, to: i.to, insert: Dr.of([" "]) }), r) { - if (Pt.ios && t.inputState.flushIOSKey() || Pt.android && (r.from == i.from && r.to == i.to && r.insert.length == 1 && r.insert.lines == 2 && lg(t.contentDOM, "Enter", 13) || (r.from == i.from - 1 && r.to == i.to && r.insert.length == 0 || s == 8 && r.insert.length < r.to - r.from && r.to > i.head) && lg(t.contentDOM, "Backspace", 8) || r.from == i.from && r.to == i.to + 1 && r.insert.length == 0 && lg(t.contentDOM, "Delete", 46))) + } : (Vt.mac || Vt.android) && r && r.from == r.to && r.from == i.head - 1 && /^\. ?$/.test(r.insert.toString()) && t.contentDOM.getAttribute("autocorrect") == "off" ? (n && r.insert.length == 2 && (n = je.single(n.main.anchor - 1, n.main.head - 1)), r = { from: i.from, to: i.to, insert: qr.of([" "]) }) : Vt.chrome && r && r.from == r.to && r.from == i.head && r.insert.toString() == ` + ` && t.lineWrapping && (n && (n = je.single(n.main.anchor - 1, n.main.head - 1)), r = { from: i.from, to: i.to, insert: qr.of([" "]) }), r) { + if (Vt.ios && t.inputState.flushIOSKey() || Vt.android && (r.from == i.from && r.to == i.to && r.insert.length == 1 && r.insert.lines == 2 && Ag(t.contentDOM, "Enter", 13) || (r.from == i.from - 1 && r.to == i.to && r.insert.length == 0 || s == 8 && r.insert.length < r.to - r.from && r.to > i.head) && Ag(t.contentDOM, "Backspace", 8) || r.from == i.from && r.to == i.to + 1 && r.insert.length == 0 && Ag(t.contentDOM, "Delete", 46))) return !0; let a = r.insert.toString(); t.inputState.composing >= 0 && t.inputState.composing++; - let o, l = () => o || (o = Iwe(t, r, n)); - return t.state.facet(yK).some((u) => u(t, r.from, r.to, a, l)) || t.dispatch(l()), !0; + let o, l = () => o || (o = COe(t, r, n)); + return t.state.facet(JK).some((u) => u(t, r.from, r.to, a, l)) || t.dispatch(l()), !0; } else if (n && !n.main.eq(i)) { let a = !1, o = "select"; return t.inputState.lastSelectionTime > Date.now() - 50 && (t.inputState.lastSelectionOrigin == "select" && (a = !0), o = t.inputState.lastSelectionOrigin), t.dispatch({ selection: n, scrollIntoView: a, userEvent: o }), !0; } else return !1; } -function Iwe(t, e, r) { +function COe(t, e, r) { let n, i = t.state, s = i.selection.main; if (e.from >= s.from && e.to <= s.to && e.to - e.from >= (s.to - s.from) / 3 && (!r || r.main.empty && r.main.from == e.from + e.insert.length) && t.inputState.composing < 0) { let o = s.from < e.from ? i.sliceDoc(s.from, e.from) : "", l = s.to > e.to ? i.sliceDoc(e.to, s.to) : ""; @@ -7966,7 +7966,7 @@ function Iwe(t, e, r) { } else { let o = i.changes(e), l = r && r.main.to <= o.newLength ? r.main : void 0; if (i.selection.ranges.length > 1 && t.inputState.composing >= 0 && e.to <= s.to && e.to >= s.to - 10) { - let u = t.state.sliceDoc(e.from, e.to), h, f = r && RK(t, r.main.head); + let u = t.state.sliceDoc(e.from, e.to), h, f = r && fJ(t, r.main.head); if (f) { let g = e.insert.length - (e.to - e.from); h = { from: f.from, to: f.to - g }; @@ -7982,7 +7982,7 @@ function Iwe(t, e, r) { let y = i.changes({ from: v, to: m, insert: e.insert }), b = g.to - s.to; return { changes: y, - range: l ? Ue.range(Math.max(0, l.anchor + b), Math.max(0, l.head + b)) : g.map(y) + range: l ? je.range(Math.max(0, l.anchor + b), Math.max(0, l.head + b)) : g.map(y) }; }); } else @@ -7994,7 +7994,7 @@ function Iwe(t, e, r) { let a = "input.type"; return (t.composing || t.inputState.compositionPendingChange && t.inputState.compositionEndedAt > Date.now() - 50) && (t.inputState.compositionPendingChange = !1, a += ".compose", t.inputState.compositionFirstChange && (a += ".start", t.inputState.compositionFirstChange = !1)), i.update(n, { userEvent: a, scrollIntoView: !0 }); } -function $we(t, e, r, n) { +function EOe(t, e, r, n) { let i = Math.min(t.length, e.length), s = 0; for (; s < i && t.charCodeAt(s) == e.charCodeAt(s); ) s++; @@ -8016,33 +8016,33 @@ function $we(t, e, r, n) { } return { from: s, toA: a, toB: o }; } -function Bwe(t) { +function _Oe(t) { let e = []; if (t.root.activeElement != t.contentDOM) return e; let { anchorNode: r, anchorOffset: n, focusNode: i, focusOffset: s } = t.observer.selectionRange; - return r && (e.push(new yF(r, n)), (i != r || s != n) && e.push(new yF(i, s))), e; + return r && (e.push(new JF(r, n)), (i != r || s != n) && e.push(new JF(i, s))), e; } -function Fwe(t, e) { +function AOe(t, e) { if (t.length == 0) return null; let r = t[0].pos, n = t.length == 2 ? t[1].pos : r; - return r > -1 && n > -1 ? Ue.single(r + e, n + e) : null; + return r > -1 && n > -1 ? je.single(r + e, n + e) : null; } -const zwe = { +const LOe = { childList: !0, characterData: !0, subtree: !0, attributes: !0, characterDataOldValue: !0 -}, YE = Pt.ie && Pt.ie_version <= 11; -class Qwe { +}, x_ = Vt.ie && Vt.ie_version <= 11; +class ROe { constructor(e) { - this.view = e, this.active = !1, this.selectionRange = new Sxe(), this.selectionChanged = !1, this.delayedFlush = -1, this.resizeTimeout = -1, this.queue = [], this.delayedAndroidKey = null, this.flushingAndroidKey = -1, this.lastChange = 0, this.scrollTargets = [], this.intersection = null, this.resizeScroll = null, this.intersecting = !1, this.gapIntersection = null, this.gaps = [], this.parentCheck = -1, this.dom = e.contentDOM, this.observer = new MutationObserver((r) => { + this.view = e, this.active = !1, this.selectionRange = new pwe(), this.selectionChanged = !1, this.delayedFlush = -1, this.resizeTimeout = -1, this.queue = [], this.delayedAndroidKey = null, this.flushingAndroidKey = -1, this.lastChange = 0, this.scrollTargets = [], this.intersection = null, this.resizeScroll = null, this.intersecting = !1, this.gapIntersection = null, this.gaps = [], this.parentCheck = -1, this.dom = e.contentDOM, this.observer = new MutationObserver((r) => { for (let n of r) this.queue.push(n); - (Pt.ie && Pt.ie_version <= 11 || Pt.ios && e.composing) && r.some((n) => n.type == "childList" && n.removedNodes.length || n.type == "characterData" && n.oldValue.length > n.target.nodeValue.length) ? this.flushSoon() : this.flush(); - }), YE && (this.onCharData = (r) => { + (Vt.ie && Vt.ie_version <= 11 || Vt.ios && e.composing) && r.some((n) => n.type == "childList" && n.removedNodes.length || n.type == "characterData" && n.oldValue.length > n.target.nodeValue.length) ? this.flushSoon() : this.flush(); + }), x_ && (this.onCharData = (r) => { this.queue.push({ target: r.target, type: "characterData", @@ -8086,21 +8086,21 @@ class Qwe { if (!this.readSelectionRange() || this.delayedAndroidKey) return; let { view: n } = this, i = this.selectionRange; - if (n.state.facet(oT) ? n.root.activeElement != this.dom : !E4(n.dom, i)) + if (n.state.facet(PT) ? n.root.activeElement != this.dom : !e5(n.dom, i)) return; let s = i.anchorNode && n.docView.nearest(i.anchorNode); if (s && s.ignoreEvent(e)) { r || (this.selectionChanged = !1); return; } - (Pt.ie && Pt.ie_version <= 11 || Pt.android && Pt.chrome) && !n.state.selection.main.empty && i.focusNode && U5(i.focusNode, i.focusOffset, i.anchorNode, i.anchorOffset) ? this.flushSoon() : this.flush(!1); + (Vt.ie && Vt.ie_version <= 11 || Vt.android && Vt.chrome) && !n.state.selection.main.empty && i.focusNode && gk(i.focusNode, i.focusOffset, i.anchorNode, i.anchorOffset) ? this.flushSoon() : this.flush(!1); } readSelectionRange() { - let { view: e } = this, r = Pt.safari && e.root.nodeType == 11 && xxe(this.dom.ownerDocument) == this.dom && Uwe(this.view) || Q5(e.root); + let { view: e } = this, r = Vt.safari && e.root.nodeType == 11 && uwe(this.dom.ownerDocument) == this.dom && MOe(this.view) || pk(e.root); if (!r || this.selectionRange.eq(r)) return !1; - let n = E4(this.dom, r); - return n && !this.selectionChanged && e.inputState.lastFocusTime > Date.now() - 200 && e.inputState.lastTouchTime < Date.now() - 300 && Cxe(this.dom, r) ? (this.view.inputState.lastFocusTime = 0, e.docView.updateSelection(), !1) : (this.selectionRange.setRange(r), n && (this.selectionChanged = !0), !0); + let n = e5(this.dom, r); + return n && !this.selectionChanged && e.inputState.lastFocusTime > Date.now() - 200 && e.inputState.lastTouchTime < Date.now() - 300 && mwe(this.dom, r) ? (this.view.inputState.lastFocusTime = 0, e.docView.updateSelection(), !1) : (this.selectionRange.setRange(r), n && (this.selectionChanged = !0), !0); } setSelectionRange(e, r) { this.selectionRange.set(e.node, e.offset, r.node, r.offset), this.selectionChanged = !1; @@ -8135,10 +8135,10 @@ class Qwe { } } start() { - this.active || (this.observer.observe(this.dom, zwe), YE && this.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.active = !0); + this.active || (this.observer.observe(this.dom, LOe), x_ && this.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.active = !0); } stop() { - !this.active || (this.active = !1, this.observer.disconnect(), YE && this.dom.removeEventListener("DOMCharacterDataModified", this.onCharData)); + !this.active || (this.active = !1, this.observer.disconnect(), x_ && this.dom.removeEventListener("DOMCharacterDataModified", this.onCharData)); } clear() { this.processRecords(), this.queue.length = 0, this.selectionChanged = !1; @@ -8148,7 +8148,7 @@ class Qwe { if (!this.delayedAndroidKey) { let i = () => { let s = this.delayedAndroidKey; - s && (this.clearDelayedAndroidKey(), this.view.inputState.lastKeyCode = s.keyCode, this.view.inputState.lastKeyTime = Date.now(), !this.flush() && s.force && lg(this.dom, s.key, s.keyCode)); + s && (this.clearDelayedAndroidKey(), this.view.inputState.lastKeyCode = s.keyCode, this.view.inputState.lastKeyTime = Date.now(), !this.flush() && s.force && Ag(this.dom, s.key, s.keyCode)); }; this.flushingAndroidKey = this.view.win.requestAnimationFrame(i); } @@ -8185,11 +8185,11 @@ class Qwe { return { from: r, to: n, typeOver: i }; } readChange() { - let { from: e, to: r, typeOver: n } = this.processRecords(), i = this.selectionChanged && E4(this.dom, this.selectionRange); + let { from: e, to: r, typeOver: n } = this.processRecords(), i = this.selectionChanged && e5(this.dom, this.selectionRange); if (e < 0 && !i) return null; e > -1 && (this.lastChange = Date.now()), this.view.inputState.lastFocusTime = 0, this.selectionChanged = !1; - let s = new Nwe(this.view, e, r, n); + let s = new TOe(this.view, e, r, n); return this.view.docView.domChanged = { newSel: s.newSel ? s.newSel.main : null }, s; } flush(e = !0) { @@ -8199,7 +8199,7 @@ class Qwe { let r = this.readChange(); if (!r) return this.view.requestMeasure(), !1; - let n = this.view.state, i = GK(this.view, r); + let n = this.view.state, i = _J(this.view, r); return this.view.state == n && this.view.update([]), i; } readMutation(e) { @@ -8207,7 +8207,7 @@ class Qwe { if (!r || r.ignoreMutation(e)) return null; if (r.markDirty(e.type == "attributes"), e.type == "attributes" && (r.flags |= 4), e.type == "childList") { - let n = bF(r, e.previousSibling || e.target.previousSibling, -1), i = bF(r, e.nextSibling || e.target.nextSibling, 1); + let n = ez(r, e.previousSibling || e.target.previousSibling, -1), i = ez(r, e.nextSibling || e.target.nextSibling, 1); return { from: n ? r.posAfter(n) : r.posAtStart, to: i ? r.posBefore(i) : r.posAtEnd, @@ -8233,9 +8233,9 @@ class Qwe { this.removeWindowListeners(this.win), clearTimeout(this.parentCheck), clearTimeout(this.resizeTimeout), this.win.cancelAnimationFrame(this.delayedFlush), this.win.cancelAnimationFrame(this.flushingAndroidKey); } } -function bF(t, e, r) { +function ez(t, e, r) { for (; e; ) { - let n = bn.get(e); + let n = Dn.get(e); if (n && n.parent == t) return n; let i = e.parentNode; @@ -8243,7 +8243,7 @@ function bF(t, e, r) { } return null; } -function Uwe(t) { +function MOe(t) { let e = null; function r(l) { l.preventDefault(), l.stopImmediatePropagation(), e = l.getTargetRanges()[0]; @@ -8251,9 +8251,9 @@ function Uwe(t) { if (t.contentDOM.addEventListener("beforeinput", r, !0), t.dom.ownerDocument.execCommand("indent"), t.contentDOM.removeEventListener("beforeinput", r, !0), !e) return null; let n = e.startContainer, i = e.startOffset, s = e.endContainer, a = e.endOffset, o = t.docView.domAtPos(t.state.selection.main.anchor); - return U5(o.node, o.offset, s, a) && ([n, i, s, a] = [s, a, n, i]), { anchorNode: n, anchorOffset: i, focusNode: s, focusOffset: a }; + return gk(o.node, o.offset, s, a) && ([n, i, s, a] = [s, a, n, i]), { anchorNode: n, anchorOffset: i, focusNode: s, focusOffset: a }; } -class ft { +class kt { get state() { return this.viewState.state; } @@ -8281,13 +8281,13 @@ class ft { constructor(e = {}) { this.plugins = [], this.pluginMap = /* @__PURE__ */ new Map(), this.editorAttrs = {}, this.contentAttrs = {}, this.bidiCache = [], this.destroyed = !1, this.updateState = 2, this.measureScheduled = -1, this.measureRequests = [], this.contentDOM = document.createElement("div"), this.scrollDOM = document.createElement("div"), this.scrollDOM.tabIndex = -1, this.scrollDOM.className = "cm-scroller", this.scrollDOM.appendChild(this.contentDOM), this.announceDOM = document.createElement("div"), this.announceDOM.className = "cm-announced", this.announceDOM.setAttribute("aria-live", "polite"), this.dom = document.createElement("div"), this.dom.appendChild(this.announceDOM), this.dom.appendChild(this.scrollDOM), e.parent && e.parent.appendChild(this.dom); let { dispatch: r } = e; - this.dispatchTransactions = e.dispatchTransactions || r && ((n) => n.forEach((i) => r(i, this))) || ((n) => this.update(n)), this.dispatch = this.dispatch.bind(this), this._root = e.root || Txe(e.parent) || document, this.viewState = new gF(e.state || dr.create(e)), e.scrollTo && e.scrollTo.is(Pw) && (this.viewState.scrollTarget = e.scrollTo.value.clip(this.viewState.state)), this.plugins = this.state.facet(Lv).map((n) => new QE(n)); + this.dispatchTransactions = e.dispatchTransactions || r && ((n) => n.forEach((i) => r(i, this))) || ((n) => this.update(n)), this.dispatch = this.dispatch.bind(this), this._root = e.root || gwe(e.parent) || document, this.viewState = new ZF(e.state || Sr.create(e)), e.scrollTo && e.scrollTo.is(oO) && (this.viewState.scrollTarget = e.scrollTo.value.clip(this.viewState.state)), this.plugins = this.state.facet(ey).map((n) => new m_(n)); for (let n of this.plugins) n.update(this); - this.observer = new Qwe(this), this.inputState = new nwe(this), this.inputState.ensureHandlers(this.plugins), this.docView = new jB(this), this.mountStyles(), this.updateAttrs(), this.updateState = 0, this.requestMeasure(); + this.observer = new ROe(this), this.inputState = new Gwe(this), this.inputState.ensureHandlers(this.plugins), this.docView = new MF(this), this.mountStyles(), this.updateAttrs(), this.updateState = 0, this.requestMeasure(); } dispatch(...e) { - let r = e.length == 1 && e[0] instanceof pi ? e : e.length == 1 && Array.isArray(e[0]) ? e[0] : [this.state.update(...e)]; + let r = e.length == 1 && e[0] instanceof Ei ? e : e.length == 1 && Array.isArray(e[0]) ? e[0] : [this.state.update(...e)]; this.dispatchTransactions(r, this); } update(e) { @@ -8304,35 +8304,35 @@ class ft { return; } let a = this.hasFocus, o = 0, l = null; - e.some((d) => d.annotation(zK)) ? (this.inputState.notifiedFocused = a, o = 1) : a != this.inputState.notifiedFocused && (this.inputState.notifiedFocused = a, l = QK(s, a), l || (o = 1)); + e.some((d) => d.annotation(wJ)) ? (this.inputState.notifiedFocused = a, o = 1) : a != this.inputState.notifiedFocused && (this.inputState.notifiedFocused = a, l = OJ(s, a), l || (o = 1)); let u = this.observer.delayedAndroidKey, h = null; - if (u ? (this.observer.clearDelayedAndroidKey(), h = this.observer.readChange(), (h && !this.state.doc.eq(s.doc) || !this.state.selection.eq(s.selection)) && (h = null)) : this.observer.clear(), s.facet(dr.phrases) != this.state.facet(dr.phrases)) + if (u ? (this.observer.clearDelayedAndroidKey(), h = this.observer.readChange(), (h && !this.state.doc.eq(s.doc) || !this.state.selection.eq(s.selection)) && (h = null)) : this.observer.clear(), s.facet(Sr.phrases) != this.state.facet(Sr.phrases)) return this.setState(s); - i = V5.create(this, s, e), i.flags |= o; + i = mk.create(this, s, e), i.flags |= o; let f = this.viewState.scrollTarget; try { this.updateState = 2; for (let d of e) { if (f && (f = f.map(d.changes)), d.scrollIntoView) { let { main: p } = d.state.selection; - f = new cg(p.empty ? p : Ue.cursor(p.head, p.head > p.anchor ? -1 : 1)); + f = new Lg(p.empty ? p : je.cursor(p.head, p.head > p.anchor ? -1 : 1)); } for (let p of d.effects) - p.is(Pw) && (f = p.value.clip(this.state)); + p.is(oO) && (f = p.value.clip(this.state)); } - this.viewState.update(i, f), this.bidiCache = q5.update(this.bidiCache, i.changes), i.empty || (this.updatePlugins(i), this.inputState.update(i)), r = this.docView.update(i), this.state.facet(Rv) != this.styleModules && this.mountStyles(), n = this.updateAttrs(), this.showAnnouncements(e), this.docView.updateSelection(r, e.some((d) => d.isUserEvent("select.pointer"))); + this.viewState.update(i, f), this.bidiCache = vk.update(this.bidiCache, i.changes), i.empty || (this.updatePlugins(i), this.inputState.update(i)), r = this.docView.update(i), this.state.facet(ty) != this.styleModules && this.mountStyles(), n = this.updateAttrs(), this.showAnnouncements(e), this.docView.updateSelection(r, e.some((d) => d.isUserEvent("select.pointer"))); } finally { this.updateState = 0; } - if (i.startState.facet(zw) != i.state.facet(zw) && (this.viewState.mustMeasureContent = !0), (r || n || f || this.viewState.mustEnforceCursorAssoc || this.viewState.mustMeasureContent) && this.requestMeasure(), !i.empty) - for (let d of this.state.facet(A7)) + if (i.startState.facet(dO) != i.state.facet(dO) && (this.viewState.mustMeasureContent = !0), (r || n || f || this.viewState.mustEnforceCursorAssoc || this.viewState.mustMeasureContent) && this.requestMeasure(), !i.empty) + for (let d of this.state.facet(i8)) try { d(i); } catch (p) { - Vo(this.state, p, "update listener"); + al(this.state, p, "update listener"); } (l || h) && Promise.resolve().then(() => { - l && this.state == l.startState && this.dispatch(l), h && !GK(this, h) && u.force && lg(this.contentDOM, u.key, u.keyCode); + l && this.state == l.startState && this.dispatch(l), h && !_J(this, h) && u.force && Ag(this.contentDOM, u.key, u.keyCode); }); } setState(e) { @@ -8347,23 +8347,23 @@ class ft { try { for (let n of this.plugins) n.destroy(this); - this.viewState = new gF(e), this.plugins = e.facet(Lv).map((n) => new QE(n)), this.pluginMap.clear(); + this.viewState = new ZF(e), this.plugins = e.facet(ey).map((n) => new m_(n)), this.pluginMap.clear(); for (let n of this.plugins) n.update(this); - this.docView.destroy(), this.docView = new jB(this), this.inputState.ensureHandlers(this.plugins), this.mountStyles(), this.updateAttrs(), this.bidiCache = []; + this.docView.destroy(), this.docView = new MF(this), this.inputState.ensureHandlers(this.plugins), this.mountStyles(), this.updateAttrs(), this.bidiCache = []; } finally { this.updateState = 0; } r && this.focus(), this.requestMeasure(); } updatePlugins(e) { - let r = e.startState.facet(Lv), n = e.state.facet(Lv); + let r = e.startState.facet(ey), n = e.state.facet(ey); if (r != n) { let i = []; for (let s of n) { let a = r.indexOf(s); if (a < 0) - i.push(new QE(s)); + i.push(new m_(s)); else { let o = this.plugins[a]; o.mustUpdate = e, i.push(o); @@ -8392,7 +8392,7 @@ class ft { try { for (let o = 0; ; o++) { if (a < 0) - if (iK(n)) + if (FK(n)) s = -1, a = this.viewState.heightMap.height; else { let p = this.viewState.scrollAnchorAt(i); @@ -8412,17 +8412,17 @@ class ft { try { return p.read(this); } catch (g) { - return Vo(this.state, g), xF; + return al(this.state, g), tz; } - }), f = V5.create(this, this.state, []), d = !1; + }), f = mk.create(this, this.state, []), d = !1; f.flags |= l, r ? r.flags |= l : r = f, this.updateState = 2, f.empty || (this.updatePlugins(f), this.inputState.update(f), this.updateAttrs(), d = this.docView.update(f)); for (let p = 0; p < u.length; p++) - if (h[p] != xF) + if (h[p] != tz) try { let g = u[p]; g.write && g.write(h[p], this); } catch (g) { - Vo(this.state, g); + al(this.state, g); } if (d && this.docView.updateSelection(!0), !f.viewportChanged && this.measureRequests.length == 0) { if (this.viewState.editorHeight) @@ -8443,29 +8443,29 @@ class ft { this.updateState = 0, this.measureScheduled = -1; } if (r && !r.empty) - for (let o of this.state.facet(A7)) + for (let o of this.state.facet(i8)) o(r); } get themeClasses() { - return $7 + " " + (this.state.facet(I7) ? YK : qK) + " " + this.state.facet(zw); + return f8 + " " + (this.state.facet(h8) ? CJ : TJ) + " " + this.state.facet(dO); } updateAttrs() { - let e = wF(this, OK, { + let e = rz(this, nJ, { class: "cm-editor" + (this.hasFocus ? " cm-focused " : " ") + this.themeClasses }), r = { spellcheck: "false", autocorrect: "off", autocapitalize: "off", translate: "no", - contenteditable: this.state.facet(oT) ? "true" : "false", + contenteditable: this.state.facet(PT) ? "true" : "false", class: "cm-content", - style: `${Pt.tabSize}: ${this.state.tabSize}`, + style: `${Vt.tabSize}: ${this.state.tabSize}`, role: "textbox", "aria-multiline": "true" }; - this.state.readOnly && (r["aria-readonly"] = "true"), wF(this, xM, r); + this.state.readOnly && (r["aria-readonly"] = "true"), rz(this, HM, r); let n = this.observer.ignore(() => { - let i = E7(this.contentDOM, this.contentAttrs, r), s = E7(this.dom, this.editorAttrs, e); + let i = r8(this.contentDOM, this.contentAttrs, r), s = r8(this.dom, this.editorAttrs, e); return i || s; }); return this.editorAttrs = e, this.contentAttrs = r, n; @@ -8474,16 +8474,16 @@ class ft { let r = !0; for (let n of e) for (let i of n.effects) - if (i.is(ft.announce)) { + if (i.is(kt.announce)) { r && (this.announceDOM.textContent = ""), r = !1; let s = this.announceDOM.appendChild(document.createElement("div")); s.textContent = i.value; } } mountStyles() { - this.styleModules = this.state.facet(Rv); - let e = this.state.facet(ft.cspNonce); - Uu.mount(this.root, this.styleModules.concat(Mwe).reverse(), e ? { nonce: e } : void 0); + this.styleModules = this.state.facet(ty); + let e = this.state.facet(kt.cspNonce); + ah.mount(this.root, this.styleModules.concat(OOe).reverse(), e ? { nonce: e } : void 0); } readMeasured() { if (this.updateState == 2) @@ -8536,16 +8536,16 @@ class ft { return this.viewState.contentHeight; } moveByChar(e, r, n) { - return VE(this, e, nF(this, e, r, n)); + return y_(this, e, BF(this, e, r, n)); } moveByGroup(e, r) { - return VE(this, e, nF(this, e, r, (n) => twe(this, e.head, n))); + return y_(this, e, BF(this, e, r, (n) => Ywe(this, e.head, n))); } moveToLineBoundary(e, r, n = !0) { - return ewe(this, e, r, n); + return qwe(this, e, r, n); } moveVertically(e, r, n) { - return VE(this, e, rwe(this, e, r, n)); + return y_(this, e, Wwe(this, e, r, n)); } domAtPos(e) { return this.docView.domAtPos(e); @@ -8554,15 +8554,15 @@ class ft { return this.docView.posFromDOM(e, r); } posAtCoords(e, r = !0) { - return this.readMeasured(), DK(this, e, r); + return this.readMeasured(), pJ(this, e, r); } coordsAtPos(e, r = 1) { this.readMeasured(); let n = this.docView.coordsAt(e, r); if (!n || n.left == n.right) return n; - let i = this.state.doc.lineAt(e), s = this.bidiSpans(i), a = s[qh.find(s, e - i.from, -1, r)]; - return vM(n, a.dir == Pn.LTR == r > 0); + let i = this.state.doc.lineAt(e), s = this.bidiSpans(i), a = s[cf.find(s, e - i.from, -1, r)]; + return WM(n, a.dir == Wn.LTR == r > 0); } coordsForChar(e) { return this.readMeasured(), this.docView.coordsForChar(e); @@ -8577,29 +8577,29 @@ class ft { return this.viewState.defaultTextDirection; } textDirectionAt(e) { - return !this.state.facet(xK) || e < this.viewport.from || e > this.viewport.to ? this.textDirection : (this.readMeasured(), this.docView.textDirectionAt(e)); + return !this.state.facet(tJ) || e < this.viewport.from || e > this.viewport.to ? this.textDirection : (this.readMeasured(), this.docView.textDirectionAt(e)); } get lineWrapping() { return this.viewState.heightOracle.lineWrapping; } bidiSpans(e) { - if (e.length > Vwe) - return AK(e.length); + if (e.length > DOe) + return uJ(e.length); let r = this.textDirectionAt(e.from), n; for (let s of this.bidiCache) - if (s.from == e.from && s.dir == r && (s.fresh || _K(s.isolates, n = ZB(this, e.from, e.to)))) + if (s.from == e.from && s.dir == r && (s.fresh || cJ(s.isolates, n = RF(this, e.from, e.to)))) return s.order; - n || (n = ZB(this, e.from, e.to)); - let i = zxe(e.text, r, n); - return this.bidiCache.push(new q5(e.from, e.to, r, n, !0, i)), i; + n || (n = RF(this, e.from, e.to)); + let i = Lwe(e.text, r, n); + return this.bidiCache.push(new vk(e.from, e.to, r, n, !0, i)), i; } get hasFocus() { var e; - return (this.dom.ownerDocument.hasFocus() || Pt.safari && ((e = this.inputState) === null || e === void 0 ? void 0 : e.lastContextMenu) > Date.now() - 3e4) && this.root.activeElement == this.contentDOM; + return (this.dom.ownerDocument.hasFocus() || Vt.safari && ((e = this.inputState) === null || e === void 0 ? void 0 : e.lastContextMenu) > Date.now() - 3e4) && this.root.activeElement == this.contentDOM; } focus() { this.observer.ignore(() => { - rK(this.contentDOM), this.docView.updateSelection(); + $K(this.contentDOM), this.docView.updateSelection(); }); } setRoot(e) { @@ -8611,76 +8611,76 @@ class ft { this.plugins = [], this.inputState.destroy(), this.docView.destroy(), this.dom.remove(), this.observer.destroy(), this.measureScheduled > -1 && this.win.cancelAnimationFrame(this.measureScheduled), this.destroyed = !0; } static scrollIntoView(e, r = {}) { - return Pw.of(new cg(typeof e == "number" ? Ue.cursor(e) : e, r.y, r.x, r.yMargin, r.xMargin)); + return oO.of(new Lg(typeof e == "number" ? je.cursor(e) : e, r.y, r.x, r.yMargin, r.xMargin)); } scrollSnapshot() { let { scrollTop: e, scrollLeft: r } = this.scrollDOM, n = this.viewState.scrollAnchorAt(e); - return Pw.of(new cg(Ue.cursor(n.from), "start", "start", n.top - e, r, !0)); + return oO.of(new Lg(je.cursor(n.from), "start", "start", n.top - e, r, !0)); } static domEventHandlers(e) { - return Jr.define(() => ({}), { eventHandlers: e }); + return hn.define(() => ({}), { eventHandlers: e }); } static domEventObservers(e) { - return Jr.define(() => ({}), { eventObservers: e }); + return hn.define(() => ({}), { eventObservers: e }); } static theme(e, r) { - let n = Uu.newName(), i = [zw.of(n), Rv.of(B7(`.${n}`, e))]; - return r && r.dark && i.push(I7.of(!0)), i; + let n = ah.newName(), i = [dO.of(n), ty.of(d8(`.${n}`, e))]; + return r && r.dark && i.push(h8.of(!0)), i; } static baseTheme(e) { - return Wl.lowest(Rv.of(B7("." + $7, e, WK))); + return uc.lowest(ty.of(d8("." + f8, e, EJ))); } static findFromDOM(e) { var r; - let n = e.querySelector(".cm-content"), i = n && bn.get(n) || bn.get(e); + let n = e.querySelector(".cm-content"), i = n && Dn.get(n) || Dn.get(e); return ((r = i == null ? void 0 : i.rootView) === null || r === void 0 ? void 0 : r.view) || null; } } -ft.styleModule = Rv; -ft.inputHandler = yK; -ft.focusChangeEffect = bK; -ft.perLineTextDirection = xK; -ft.exceptionSink = vK; -ft.updateListener = A7; -ft.editable = oT; -ft.mouseSelectionStyle = mK; -ft.dragMovesSelection = gK; -ft.clickAddsSelectionRange = pK; -ft.decorations = qy; -ft.atomicRanges = wM; -ft.bidiIsolatedRanges = kK; -ft.scrollMargins = SK; -ft.darkTheme = I7; -ft.cspNonce = /* @__PURE__ */ At.define({ combine: (t) => t.length ? t[0] : "" }); -ft.contentAttributes = xM; -ft.editorAttributes = OK; -ft.lineWrapping = /* @__PURE__ */ ft.contentAttributes.of({ class: "cm-lineWrapping" }); -ft.announce = /* @__PURE__ */ jt.define(); -const Vwe = 4096, xF = {}; -class q5 { +kt.styleModule = ty; +kt.inputHandler = JK; +kt.focusChangeEffect = eJ; +kt.perLineTextDirection = tJ; +kt.exceptionSink = KK; +kt.updateListener = i8; +kt.editable = PT; +kt.mouseSelectionStyle = jK; +kt.dragMovesSelection = ZK; +kt.clickAddsSelectionRange = HK; +kt.decorations = p2; +kt.atomicRanges = ZM; +kt.bidiIsolatedRanges = iJ; +kt.scrollMargins = sJ; +kt.darkTheme = h8; +kt.cspNonce = /* @__PURE__ */ $t.define({ combine: (t) => t.length ? t[0] : "" }); +kt.contentAttributes = HM; +kt.editorAttributes = nJ; +kt.lineWrapping = /* @__PURE__ */ kt.contentAttributes.of({ class: "cm-lineWrapping" }); +kt.announce = /* @__PURE__ */ or.define(); +const DOe = 4096, tz = {}; +class vk { constructor(e, r, n, i, s, a) { this.from = e, this.to = r, this.dir = n, this.isolates = i, this.fresh = s, this.order = a; } static update(e, r) { if (r.empty && !e.some((s) => s.fresh)) return e; - let n = [], i = e.length ? e[e.length - 1].dir : Pn.LTR; + let n = [], i = e.length ? e[e.length - 1].dir : Wn.LTR; for (let s = Math.max(0, e.length - 10); s < e.length; s++) { let a = e[s]; - a.dir == i && !r.touchesRange(a.from, a.to) && n.push(new q5(r.mapPos(a.from, 1), r.mapPos(a.to, -1), a.dir, a.isolates, !1, a.order)); + a.dir == i && !r.touchesRange(a.from, a.to) && n.push(new vk(r.mapPos(a.from, 1), r.mapPos(a.to, -1), a.dir, a.isolates, !1, a.order)); } return n; } } -function wF(t, e, r) { +function rz(t, e, r) { for (let n = t.state.facet(e), i = n.length - 1; i >= 0; i--) { let s = n[i], a = typeof s == "function" ? s(t) : s; - a && C7(a, r); + a && t8(a, r); } return r; } -const qwe = Pt.mac ? "mac" : Pt.windows ? "win" : Pt.linux ? "linux" : "key"; -function Ywe(t, e) { +const POe = Vt.mac ? "mac" : Vt.windows ? "win" : Vt.linux ? "linux" : "key"; +function NOe(t, e) { const r = t.split(/-(?!$)/); let n = r[r.length - 1]; n == "Space" && (n = " "); @@ -8702,24 +8702,24 @@ function Ywe(t, e) { } return i && (n = "Alt-" + n), s && (n = "Ctrl-" + n), o && (n = "Meta-" + n), a && (n = "Shift-" + n), n; } -function Qw(t, e, r) { +function pO(t, e, r) { return e.altKey && (t = "Alt-" + t), e.ctrlKey && (t = "Ctrl-" + t), e.metaKey && (t = "Meta-" + t), r !== !1 && e.shiftKey && (t = "Shift-" + t), t; } -const Wwe = /* @__PURE__ */ Wl.default(/* @__PURE__ */ ft.domEventHandlers({ +const IOe = /* @__PURE__ */ uc.default(/* @__PURE__ */ kt.domEventHandlers({ keydown(t, e) { - return HK(XK(e.state), t, e, "editor"); + return LJ(AJ(e.state), t, e, "editor"); } -})), Mu = /* @__PURE__ */ At.define({ enables: Wwe }), OF = /* @__PURE__ */ new WeakMap(); -function XK(t) { - let e = t.facet(Mu), r = OF.get(e); - return r || OF.set(e, r = Hwe(e.reduce((n, i) => n.concat(i), []))), r; +})), Zu = /* @__PURE__ */ $t.define({ enables: IOe }), nz = /* @__PURE__ */ new WeakMap(); +function AJ(t) { + let e = t.facet(Zu), r = nz.get(e); + return r || nz.set(e, r = FOe(e.reduce((n, i) => n.concat(i), []))), r; } -function Gwe(t, e, r) { - return HK(XK(t.state), e, t, r); +function $Oe(t, e, r) { + return LJ(AJ(t.state), e, t, r); } -let Nh = null; -const Xwe = 4e3; -function Hwe(t, e = qwe) { +let Jh = null; +const BOe = 4e3; +function FOe(t, e = POe) { let r = /* @__PURE__ */ Object.create(null), n = /* @__PURE__ */ Object.create(null), i = (a, o) => { let l = n[a]; if (l == null) @@ -8728,17 +8728,17 @@ function Hwe(t, e = qwe) { throw new Error("Key binding " + a + " is used both as a regular binding and as a multi-stroke prefix"); }, s = (a, o, l, u, h) => { var f, d; - let p = r[a] || (r[a] = /* @__PURE__ */ Object.create(null)), g = o.split(/ (?!$)/).map((y) => Ywe(y, e)); + let p = r[a] || (r[a] = /* @__PURE__ */ Object.create(null)), g = o.split(/ (?!$)/).map((y) => NOe(y, e)); for (let y = 1; y < g.length; y++) { let b = g.slice(0, y).join(" "); i(b, !0), p[b] || (p[b] = { preventDefault: !0, stopPropagation: !1, run: [(w) => { - let O = Nh = { view: w, prefix: b, scope: a }; + let O = Jh = { view: w, prefix: b, scope: a }; return setTimeout(() => { - Nh == O && (Nh = null); - }, Xwe), !0; + Jh == O && (Jh = null); + }, BOe), !0; }] }); } @@ -8767,9 +8767,9 @@ function Hwe(t, e = qwe) { } return r; } -function HK(t, e, r, n) { - let i = bxe(e), s = as(i, 0), a = Mo(s) == i.length && i != " ", o = "", l = !1, u = !1, h = !1; - Nh && Nh.view == r && Nh.scope == n && (o = Nh.prefix + " ", NK.indexOf(e.keyCode) < 0 && (u = !0, Nh = null)); +function LJ(t, e, r, n) { + let i = cwe(e), s = bs(i, 0), a = Ho(s) == i.length && i != " ", o = "", l = !1, u = !1, h = !1; + Jh && Jh.view == r && Jh.scope == n && (o = Jh.prefix + " ", mJ.indexOf(e.keyCode) < 0 && (u = !0, Jh = null)); let f = /* @__PURE__ */ new Set(), d = (v) => { if (v) { for (let y of v.run) @@ -8779,9 +8779,9 @@ function HK(t, e, r, n) { } return !1; }, p = t[n], g, m; - return p && (d(p[o + Qw(i, e, !a)]) ? l = !0 : a && (e.altKey || e.metaKey || e.ctrlKey) && !(Pt.windows && e.ctrlKey && e.altKey) && (g = gf[e.keyCode]) && g != i ? (d(p[o + Qw(g, e, !0)]) || e.shiftKey && (m = Qy[e.keyCode]) != i && m != g && d(p[o + Qw(m, e, !1)])) && (l = !0) : a && e.shiftKey && d(p[o + Qw(i, e, !0)]) && (l = !0), !l && d(p._any) && (l = !0)), u && (l = !0), l && h && e.stopPropagation(), l; + return p && (d(p[o + pO(i, e, !a)]) ? l = !0 : a && (e.altKey || e.metaKey || e.ctrlKey) && !(Vt.windows && e.ctrlKey && e.altKey) && (g = Df[e.keyCode]) && g != i ? (d(p[o + pO(g, e, !0)]) || e.shiftKey && (m = h2[e.keyCode]) != i && m != g && d(p[o + pO(m, e, !1)])) && (l = !0) : a && e.shiftKey && d(p[o + pO(i, e, !0)]) && (l = !0), !l && d(p._any) && (l = !0)), u && (l = !0), l && h && e.stopPropagation(), l; } -class fx { +class Ix { constructor(e, r, n, i, s) { this.className = e, this.left = r, this.top = n, this.width = i, this.height = s; } @@ -8803,36 +8803,36 @@ class fx { let i = e.coordsAtPos(n.head, n.assoc || 1); if (!i) return []; - let s = ZK(e); - return [new fx(r, i.left - s.left, i.top - s.top, null, i.bottom - i.top)]; + let s = RJ(e); + return [new Ix(r, i.left - s.left, i.top - s.top, null, i.bottom - i.top)]; } else - return Zwe(e, r, n); + return zOe(e, r, n); } } -function ZK(t) { +function RJ(t) { let e = t.scrollDOM.getBoundingClientRect(); - return { left: (t.textDirection == Pn.LTR ? e.left : e.right - t.scrollDOM.clientWidth * t.scaleX) - t.scrollDOM.scrollLeft * t.scaleX, top: e.top - t.scrollDOM.scrollTop * t.scaleY }; + return { left: (t.textDirection == Wn.LTR ? e.left : e.right - t.scrollDOM.clientWidth * t.scaleX) - t.scrollDOM.scrollLeft * t.scaleX, top: e.top - t.scrollDOM.scrollTop * t.scaleY }; } -function kF(t, e, r) { - let n = Ue.cursor(e); +function iz(t, e, r) { + let n = je.cursor(e); return { from: Math.max(r.from, t.moveToLineBoundary(n, !1, !0).from), to: Math.min(r.to, t.moveToLineBoundary(n, !0, !0).from), - type: la.Text + type: Ca.Text }; } -function Zwe(t, e, r) { +function zOe(t, e, r) { if (r.to <= t.viewport.from || r.from >= t.viewport.to) return []; - let n = Math.max(r.from, t.viewport.from), i = Math.min(r.to, t.viewport.to), s = t.textDirection == Pn.LTR, a = t.contentDOM, o = a.getBoundingClientRect(), l = ZK(t), u = a.querySelector(".cm-line"), h = u && window.getComputedStyle(u), f = o.left + (h ? parseInt(h.paddingLeft) + Math.min(0, parseInt(h.textIndent)) : 0), d = o.right - (h ? parseInt(h.paddingRight) : 0), p = P7(t, n), g = P7(t, i), m = p.type == la.Text ? p : null, v = g.type == la.Text ? g : null; - if (m && (t.lineWrapping || p.widgetLineBreaks) && (m = kF(t, n, m)), v && (t.lineWrapping || g.widgetLineBreaks) && (v = kF(t, i, v)), m && v && m.from == v.from) + let n = Math.max(r.from, t.viewport.from), i = Math.min(r.to, t.viewport.to), s = t.textDirection == Wn.LTR, a = t.contentDOM, o = a.getBoundingClientRect(), l = RJ(t), u = a.querySelector(".cm-line"), h = u && window.getComputedStyle(u), f = o.left + (h ? parseInt(h.paddingLeft) + Math.min(0, parseInt(h.textIndent)) : 0), d = o.right - (h ? parseInt(h.paddingRight) : 0), p = c8(t, n), g = c8(t, i), m = p.type == Ca.Text ? p : null, v = g.type == Ca.Text ? g : null; + if (m && (t.lineWrapping || p.widgetLineBreaks) && (m = iz(t, n, m)), v && (t.lineWrapping || g.widgetLineBreaks) && (v = iz(t, i, v)), m && v && m.from == v.from) return b(w(r.from, r.to, m)); { let S = m ? w(r.from, null, m) : O(p, !1), C = v ? w(null, r.to, v) : O(g, !0), T = []; - return (m || p).to < (v || g).from - (m && v ? 1 : 0) || p.widgetLineBreaks > 1 && S.bottom + t.defaultLineHeight / 2 < C.top ? T.push(y(f, S.bottom, d, C.top)) : S.bottom < C.top && t.elementAtHeight((S.bottom + C.top) / 2).type == la.Text && (S.bottom = C.top = (S.bottom + C.top) / 2), b(S).concat(T).concat(b(C)); + return (m || p).to < (v || g).from - (m && v ? 1 : 0) || p.widgetLineBreaks > 1 && S.bottom + t.defaultLineHeight / 2 < C.top ? T.push(y(f, S.bottom, d, C.top)) : S.bottom < C.top && t.elementAtHeight((S.bottom + C.top) / 2).type == Ca.Text && (S.bottom = C.top = (S.bottom + C.top) / 2), b(S).concat(T).concat(b(C)); } function y(S, C, T, A) { - return new fx(e, S - l.left, C - l.top - 0.01, T - S, A - C + 0.01); + return new Ix(e, S - l.left, C - l.top - 0.01, T - S, A - C + 0.01); } function b({ top: S, bottom: C, horizontal: T }) { let A = []; @@ -8844,7 +8844,7 @@ function Zwe(t, e, r) { let A = 1e9, E = -1e9, R = []; function _(k, N, M, D, P) { let I = t.coordsAtPos(k, k == T.to ? -2 : 2), F = t.coordsAtPos(M, M == T.from ? 2 : -2); - !I || !F || (A = Math.min(I.top, F.top, A), E = Math.max(I.bottom, F.bottom, E), P == Pn.LTR ? R.push(s && N ? f : I.left, s && D ? d : F.right) : R.push(!s && D ? f : F.left, !s && N ? d : I.right)); + !I || !F || (A = Math.min(I.top, F.top, A), E = Math.max(I.bottom, F.bottom, E), P == Wn.LTR ? R.push(s && N ? f : I.left, s && D ? d : F.right) : R.push(!s && D ? f : F.left, !s && N ? d : I.right)); } let L = S != null ? S : T.from, $ = C != null ? C : T.to; for (let k of t.visibleRanges) @@ -8867,18 +8867,18 @@ function Zwe(t, e, r) { return { top: T, bottom: T, horizontal: [] }; } } -function jwe(t, e) { +function QOe(t, e) { return t.constructor == e.constructor && t.eq(e); } -class Kwe { +class UOe { constructor(e, r) { this.view = e, this.layer = r, this.drawn = [], this.scaleX = 1, this.scaleY = 1, this.measureReq = { read: this.measure.bind(this), write: this.draw.bind(this) }, this.dom = e.scrollDOM.appendChild(document.createElement("div")), this.dom.classList.add("cm-layer"), r.above && this.dom.classList.add("cm-layer-above"), r.class && this.dom.classList.add(r.class), this.scale(), this.dom.setAttribute("aria-hidden", "true"), this.setOrder(e.state), e.requestMeasure(this.measureReq), r.mount && r.mount(this.dom, e); } update(e) { - e.startState.facet(L4) != e.state.facet(L4) && this.setOrder(e.state), (this.layer.update(e, this.dom) || e.geometryChanged) && (this.scale(), e.view.requestMeasure(this.measureReq)); + e.startState.facet(n5) != e.state.facet(n5) && this.setOrder(e.state), (this.layer.update(e, this.dom) || e.geometryChanged) && (this.scale(), e.view.requestMeasure(this.measureReq)); } setOrder(e) { - let r = 0, n = e.facet(L4); + let r = 0, n = e.facet(n5); for (; r < n.length && n[r] != this.layer; ) r++; this.dom.style.zIndex = String((this.layer.above ? 150 : -1) - r); @@ -8891,7 +8891,7 @@ class Kwe { (e != this.scaleX || r != this.scaleY) && (this.scaleX = e, this.scaleY = r, this.dom.style.transform = `scale(${1 / e}, ${1 / r})`); } draw(e) { - if (e.length != this.drawn.length || e.some((r, n) => !jwe(r, this.drawn[n]))) { + if (e.length != this.drawn.length || e.some((r, n) => !QOe(r, this.drawn[n]))) { let r = this.dom.firstChild, n = 0; for (let i of e) i.update && r && i.constructor && this.drawn[n].constructor && i.update(r, this.drawn[n]) ? (r = r.nextSibling, n++) : this.dom.insertBefore(i.draw(), r); @@ -8906,16 +8906,16 @@ class Kwe { this.layer.destroy && this.layer.destroy(this.dom, this.view), this.dom.remove(); } } -const L4 = /* @__PURE__ */ At.define(); -function jK(t) { +const n5 = /* @__PURE__ */ $t.define(); +function MJ(t) { return [ - Jr.define((e) => new Kwe(e, t)), - L4.of(t) + hn.define((e) => new UOe(e, t)), + n5.of(t) ]; } -const KK = !Pt.ios, Wy = /* @__PURE__ */ At.define({ +const DJ = !Vt.ios, m2 = /* @__PURE__ */ $t.define({ combine(t) { - return Zc(t, { + return pu(t, { cursorBlinkRate: 1200, drawRangeCursor: !0 }, { @@ -8924,27 +8924,27 @@ const KK = !Pt.ios, Wy = /* @__PURE__ */ At.define({ }); } }); -function JK(t = {}) { +function PJ(t = {}) { return [ - Wy.of(t), - Jwe, - eOe, - tOe, - wK.of(!0) + m2.of(t), + VOe, + qOe, + YOe, + rJ.of(!0) ]; } -function eJ(t) { - return t.startState.facet(Wy) != t.state.facet(Wy); +function NJ(t) { + return t.startState.facet(m2) != t.state.facet(m2); } -const Jwe = /* @__PURE__ */ jK({ +const VOe = /* @__PURE__ */ MJ({ above: !0, markers(t) { - let { state: e } = t, r = e.facet(Wy), n = []; + let { state: e } = t, r = e.facet(m2), n = []; for (let i of e.selection.ranges) { let s = i == e.selection.main; - if (i.empty ? !s || KK : r.drawRangeCursor) { - let a = s ? "cm-cursor cm-cursor-primary" : "cm-cursor cm-cursor-secondary", o = i.empty ? i : Ue.cursor(i.head, i.head > i.anchor ? -1 : 1); - for (let l of fx.forRange(t, a, o)) + if (i.empty ? !s || DJ : r.drawRangeCursor) { + let a = s ? "cm-cursor cm-cursor-primary" : "cm-cursor cm-cursor-secondary", o = i.empty ? i : je.cursor(i.head, i.head > i.anchor ? -1 : 1); + for (let l of Ix.forRange(t, a, o)) n.push(l); } } @@ -8952,55 +8952,55 @@ const Jwe = /* @__PURE__ */ jK({ }, update(t, e) { t.transactions.some((n) => n.selection) && (e.style.animationName = e.style.animationName == "cm-blink" ? "cm-blink2" : "cm-blink"); - let r = eJ(t); - return r && SF(t.state, e), t.docChanged || t.selectionSet || r; + let r = NJ(t); + return r && sz(t.state, e), t.docChanged || t.selectionSet || r; }, mount(t, e) { - SF(e.state, t); + sz(e.state, t); }, class: "cm-cursorLayer" }); -function SF(t, e) { - e.style.animationDuration = t.facet(Wy).cursorBlinkRate + "ms"; +function sz(t, e) { + e.style.animationDuration = t.facet(m2).cursorBlinkRate + "ms"; } -const eOe = /* @__PURE__ */ jK({ +const qOe = /* @__PURE__ */ MJ({ above: !1, markers(t) { - return t.state.selection.ranges.map((e) => e.empty ? [] : fx.forRange(t, "cm-selectionBackground", e)).reduce((e, r) => e.concat(r)); + return t.state.selection.ranges.map((e) => e.empty ? [] : Ix.forRange(t, "cm-selectionBackground", e)).reduce((e, r) => e.concat(r)); }, update(t, e) { - return t.docChanged || t.selectionSet || t.viewportChanged || eJ(t); + return t.docChanged || t.selectionSet || t.viewportChanged || NJ(t); }, class: "cm-selectionLayer" -}), F7 = { +}), p8 = { ".cm-line": { "& ::selection": { backgroundColor: "transparent !important" }, "&::selection": { backgroundColor: "transparent !important" } } }; -KK && (F7[".cm-line"].caretColor = "transparent !important", F7[".cm-content"] = { caretColor: "transparent !important" }); -const tOe = /* @__PURE__ */ Wl.highest(/* @__PURE__ */ ft.theme(F7)), tJ = /* @__PURE__ */ jt.define({ +DJ && (p8[".cm-line"].caretColor = "transparent !important", p8[".cm-content"] = { caretColor: "transparent !important" }); +const YOe = /* @__PURE__ */ uc.highest(/* @__PURE__ */ kt.theme(p8)), IJ = /* @__PURE__ */ or.define({ map(t, e) { return t == null ? null : e.mapPos(t); } -}), Pv = /* @__PURE__ */ In.define({ +}), iy = /* @__PURE__ */ Xn.define({ create() { return null; }, update(t, e) { - return t != null && (t = e.changes.mapPos(t)), e.effects.reduce((r, n) => n.is(tJ) ? n.value : r, t); + return t != null && (t = e.changes.mapPos(t)), e.effects.reduce((r, n) => n.is(IJ) ? n.value : r, t); } -}), rOe = /* @__PURE__ */ Jr.fromClass(class { +}), WOe = /* @__PURE__ */ hn.fromClass(class { constructor(t) { this.view = t, this.cursor = null, this.measureReq = { read: this.readPos.bind(this), write: this.drawCursor.bind(this) }; } update(t) { var e; - let r = t.state.field(Pv); - r == null ? this.cursor != null && ((e = this.cursor) === null || e === void 0 || e.remove(), this.cursor = null) : (this.cursor || (this.cursor = this.view.scrollDOM.appendChild(document.createElement("div")), this.cursor.className = "cm-dropCursor"), (t.startState.field(Pv) != r || t.docChanged || t.geometryChanged) && this.view.requestMeasure(this.measureReq)); + let r = t.state.field(iy); + r == null ? this.cursor != null && ((e = this.cursor) === null || e === void 0 || e.remove(), this.cursor = null) : (this.cursor || (this.cursor = this.view.scrollDOM.appendChild(document.createElement("div")), this.cursor.className = "cm-dropCursor"), (t.startState.field(iy) != r || t.docChanged || t.geometryChanged) && this.view.requestMeasure(this.measureReq)); } readPos() { - let { view: t } = this, e = t.state.field(Pv), r = e != null && t.coordsAtPos(e); + let { view: t } = this, e = t.state.field(iy), r = e != null && t.coordsAtPos(e); if (!r) return null; let n = t.scrollDOM.getBoundingClientRect(); @@ -9020,7 +9020,7 @@ const tOe = /* @__PURE__ */ Wl.highest(/* @__PURE__ */ ft.theme(F7)), tJ = /* @_ this.cursor && this.cursor.remove(); } setDropPos(t) { - this.view.state.field(Pv) != t && this.view.dispatch({ effects: tJ.of(t) }); + this.view.state.field(iy) != t && this.view.dispatch({ effects: IJ.of(t) }); } }, { eventObservers: { @@ -9038,17 +9038,17 @@ const tOe = /* @__PURE__ */ Wl.highest(/* @__PURE__ */ ft.theme(F7)), tJ = /* @_ } } }); -function nOe() { - return [Pv, rOe]; +function GOe() { + return [iy, WOe]; } -function TF(t, e, r, n, i) { +function az(t, e, r, n, i) { e.lastIndex = 0; for (let s = t.iterRange(r, n), a = r, o; !s.next().done; a += s.value.length) if (!s.lineBreak) for (; o = e.exec(s.value); ) i(a + o.index, o); } -function iOe(t, e) { +function XOe(t, e) { let r = t.visibleRanges; if (r.length == 1 && r[0].from == t.viewport.from && r[0].to == t.viewport.to) return r; @@ -9057,7 +9057,7 @@ function iOe(t, e) { i = Math.max(t.state.doc.lineAt(i).from, i - e), s = Math.min(t.state.doc.lineAt(s).to, s + e), n.length && n[n.length - 1].to >= i ? n[n.length - 1].to = s : n.push({ from: i, to: s }); return n; } -class sOe { +class HOe { constructor(e) { const { regexp: r, decoration: n, decorate: i, boundary: s, maxLength: a = 1e3 } = e; if (!r.global) @@ -9076,9 +9076,9 @@ class sOe { this.boundary = s, this.maxLength = a; } createDeco(e) { - let r = new Hi(), n = r.add.bind(r); - for (let { from: i, to: s } of iOe(e, this.maxLength)) - TF(e.state.doc, this.regexp, i, s, (a, o) => this.addMatch(o, e, a, n)); + let r = new os(), n = r.add.bind(r); + for (let { from: i, to: s } of XOe(e, this.maxLength)) + az(e.state.doc, this.regexp, i, s, (a, o) => this.addMatch(o, e, a, n)); return r.finish(); } updateDeco(e, r) { @@ -9109,15 +9109,15 @@ class sOe { for (this.regexp.lastIndex = h - l.from; (p = this.regexp.exec(l.text)) && p.index < f - l.from; ) this.addMatch(p, e, p.index + l.from, g); else - TF(e.state.doc, this.regexp, h, f, (m, v) => this.addMatch(v, e, m, g)); + az(e.state.doc, this.regexp, h, f, (m, v) => this.addMatch(v, e, m, g)); r = r.update({ filterFrom: h, filterTo: f, filter: (m, v) => m < h || v > f, add: d }); } } return r; } } -const z7 = /x/.unicode != null ? "gu" : "g", aOe = /* @__PURE__ */ new RegExp(`[\0-\b --\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`, z7), oOe = { +const g8 = /x/.unicode != null ? "gu" : "g", ZOe = /* @__PURE__ */ new RegExp(`[\0-\b +-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`, g8), jOe = { 0: "null", 7: "bell", 8: "backspace", @@ -9140,63 +9140,63 @@ const z7 = /x/.unicode != null ? "gu" : "g", aOe = /* @__PURE__ */ new RegExp(`[ 65279: "zero width no-break space", 65532: "object replacement" }; -let WE = null; -function lOe() { +let w_ = null; +function KOe() { var t; - if (WE == null && typeof document < "u" && document.body) { + if (w_ == null && typeof document < "u" && document.body) { let e = document.body.style; - WE = ((t = e.tabSize) !== null && t !== void 0 ? t : e.MozTabSize) != null; + w_ = ((t = e.tabSize) !== null && t !== void 0 ? t : e.MozTabSize) != null; } - return WE || !1; + return w_ || !1; } -const R4 = /* @__PURE__ */ At.define({ +const i5 = /* @__PURE__ */ $t.define({ combine(t) { - let e = Zc(t, { + let e = pu(t, { render: null, - specialChars: aOe, + specialChars: ZOe, addSpecialChars: null }); - return (e.replaceTabs = !lOe()) && (e.specialChars = new RegExp(" |" + e.specialChars.source, z7)), e.addSpecialChars && (e.specialChars = new RegExp(e.specialChars.source + "|" + e.addSpecialChars.source, z7)), e; + return (e.replaceTabs = !KOe()) && (e.specialChars = new RegExp(" |" + e.specialChars.source, g8)), e.addSpecialChars && (e.specialChars = new RegExp(e.specialChars.source + "|" + e.addSpecialChars.source, g8)), e; } }); -function rJ(t = {}) { - return [R4.of(t), cOe()]; +function $J(t = {}) { + return [i5.of(t), JOe()]; } -let CF = null; -function cOe() { - return CF || (CF = Jr.fromClass(class { +let oz = null; +function JOe() { + return oz || (oz = hn.fromClass(class { constructor(t) { - this.view = t, this.decorations = _t.none, this.decorationCache = /* @__PURE__ */ Object.create(null), this.decorator = this.makeDecorator(t.state.facet(R4)), this.decorations = this.decorator.createDeco(t); + this.view = t, this.decorations = It.none, this.decorationCache = /* @__PURE__ */ Object.create(null), this.decorator = this.makeDecorator(t.state.facet(i5)), this.decorations = this.decorator.createDeco(t); } makeDecorator(t) { - return new sOe({ + return new HOe({ regexp: t.specialChars, decoration: (e, r, n) => { - let { doc: i } = r.state, s = as(e[0], 0); + let { doc: i } = r.state, s = bs(e[0], 0); if (s == 9) { - let a = i.lineAt(n), o = r.state.tabSize, l = $l(a.text, o, n - a.from); - return _t.replace({ - widget: new dOe((o - l % o) * this.view.defaultCharacterWidth / this.view.scaleX) + let a = i.lineAt(n), o = r.state.tabSize, l = tc(a.text, o, n - a.from); + return It.replace({ + widget: new n4e((o - l % o) * this.view.defaultCharacterWidth / this.view.scaleX) }); } - return this.decorationCache[s] || (this.decorationCache[s] = _t.replace({ widget: new fOe(t, s) })); + return this.decorationCache[s] || (this.decorationCache[s] = It.replace({ widget: new r4e(t, s) })); }, boundary: t.replaceTabs ? void 0 : /[^]/ }); } update(t) { - let e = t.state.facet(R4); - t.startState.facet(R4) != e ? (this.decorator = this.makeDecorator(e), this.decorations = this.decorator.createDeco(t.view)) : this.decorations = this.decorator.updateDeco(t, this.decorations); + let e = t.state.facet(i5); + t.startState.facet(i5) != e ? (this.decorator = this.makeDecorator(e), this.decorations = this.decorator.createDeco(t.view)) : this.decorations = this.decorator.updateDeco(t, this.decorations); } }, { decorations: (t) => t.decorations })); } -const uOe = "\u2022"; -function hOe(t) { - return t >= 32 ? uOe : t == 10 ? "\u2424" : String.fromCharCode(9216 + t); +const e4e = "\u2022"; +function t4e(t) { + return t >= 32 ? e4e : t == 10 ? "\u2424" : String.fromCharCode(9216 + t); } -class fOe extends Wa { +class r4e extends uo { constructor(e, r) { super(), this.options = e, this.code = r; } @@ -9204,7 +9204,7 @@ class fOe extends Wa { return e.code == this.code; } toDOM(e) { - let r = hOe(this.code), n = e.state.phrase("Control character") + " " + (oOe[this.code] || "0x" + this.code.toString(16)), i = this.options.render && this.options.render(this.code, n, r); + let r = t4e(this.code), n = e.state.phrase("Control character") + " " + (jOe[this.code] || "0x" + this.code.toString(16)), i = this.options.render && this.options.render(this.code, n, r); if (i) return i; let s = document.createElement("span"); @@ -9214,7 +9214,7 @@ class fOe extends Wa { return !1; } } -class dOe extends Wa { +class n4e extends uo { constructor(e) { super(), this.width = e; } @@ -9229,10 +9229,10 @@ class dOe extends Wa { return !1; } } -function nJ() { - return gOe; +function BJ() { + return s4e; } -const pOe = /* @__PURE__ */ _t.line({ class: "cm-activeLine" }), gOe = /* @__PURE__ */ Jr.fromClass(class { +const i4e = /* @__PURE__ */ It.line({ class: "cm-activeLine" }), s4e = /* @__PURE__ */ hn.fromClass(class { constructor(t) { this.decorations = this.getDeco(t); } @@ -9243,45 +9243,45 @@ const pOe = /* @__PURE__ */ _t.line({ class: "cm-activeLine" }), gOe = /* @__PUR let e = -1, r = []; for (let n of t.state.selection.ranges) { let i = t.lineBlockAt(n.head); - i.from > e && (r.push(pOe.range(i.from)), e = i.from); + i.from > e && (r.push(i4e.range(i.from)), e = i.from); } - return _t.set(r); + return It.set(r); } }, { decorations: (t) => t.decorations -}), Q7 = 2e3; -function mOe(t, e, r) { +}), m8 = 2e3; +function a4e(t, e, r) { let n = Math.min(e.line, r.line), i = Math.max(e.line, r.line), s = []; - if (e.off > Q7 || r.off > Q7 || e.col < 0 || r.col < 0) { + if (e.off > m8 || r.off > m8 || e.col < 0 || r.col < 0) { let a = Math.min(e.off, r.off), o = Math.max(e.off, r.off); for (let l = n; l <= i; l++) { let u = t.doc.line(l); - u.length <= o && s.push(Ue.range(u.from + a, u.to + o)); + u.length <= o && s.push(je.range(u.from + a, u.to + o)); } } else { let a = Math.min(e.col, r.col), o = Math.max(e.col, r.col); for (let l = n; l <= i; l++) { - let u = t.doc.line(l), h = b7(u.text, a, t.tabSize, !0); + let u = t.doc.line(l), h = X7(u.text, a, t.tabSize, !0); if (h < 0) - s.push(Ue.cursor(u.to)); + s.push(je.cursor(u.to)); else { - let f = b7(u.text, o, t.tabSize); - s.push(Ue.range(u.from + h, u.from + f)); + let f = X7(u.text, o, t.tabSize); + s.push(je.range(u.from + h, u.from + f)); } } } return s; } -function vOe(t, e) { +function o4e(t, e) { let r = t.coordsAtPos(t.viewport.from); return r ? Math.round(Math.abs((r.left - e) / t.defaultCharacterWidth)) : -1; } -function EF(t, e) { - let r = t.posAtCoords({ x: e.clientX, y: e.clientY }, !1), n = t.state.doc.lineAt(r), i = r - n.from, s = i > Q7 ? -1 : i == n.length ? vOe(t, e.clientX) : $l(n.text, t.state.tabSize, r - n.from); +function lz(t, e) { + let r = t.posAtCoords({ x: e.clientX, y: e.clientY }, !1), n = t.state.doc.lineAt(r), i = r - n.from, s = i > m8 ? -1 : i == n.length ? o4e(t, e.clientX) : tc(n.text, t.state.tabSize, r - n.from); return { line: n.number, col: s, off: i }; } -function yOe(t, e) { - let r = EF(t, e), n = t.state.selection; +function l4e(t, e) { + let r = lz(t, e), n = t.state.selection; return r ? { update(i) { if (i.docChanged) { @@ -9290,26 +9290,26 @@ function yOe(t, e) { } }, get(i, s, a) { - let o = EF(t, i); + let o = lz(t, i); if (!o) return n; - let l = mOe(t.state, r, o); - return l.length ? a ? Ue.create(l.concat(n.ranges)) : Ue.create(l) : n; + let l = a4e(t.state, r, o); + return l.length ? a ? je.create(l.concat(n.ranges)) : je.create(l) : n; } } : null; } -function bOe(t) { +function c4e(t) { let e = (t == null ? void 0 : t.eventFilter) || ((r) => r.altKey && r.button == 0); - return ft.mouseSelectionStyle.of((r, n) => e(n) ? yOe(r, n) : null); + return kt.mouseSelectionStyle.of((r, n) => e(n) ? l4e(r, n) : null); } -const xOe = { +const u4e = { Alt: [18, (t) => !!t.altKey], Control: [17, (t) => !!t.ctrlKey], Shift: [16, (t) => !!t.shiftKey], Meta: [91, (t) => !!t.metaKey] -}, wOe = { style: "cursor: crosshair" }; -function OOe(t = {}) { - let [e, r] = xOe[t.key || "Alt"], n = Jr.fromClass(class { +}, h4e = { style: "cursor: crosshair" }; +function f4e(t = {}) { + let [e, r] = u4e[t.key || "Alt"], n = hn.fromClass(class { constructor(i) { this.view = i, this.isDown = !1; } @@ -9331,14 +9331,14 @@ function OOe(t = {}) { }); return [ n, - ft.contentAttributes.of((i) => { + kt.contentAttributes.of((i) => { var s; - return !((s = i.plugin(n)) === null || s === void 0) && s.isDown ? wOe : null; + return !((s = i.plugin(n)) === null || s === void 0) && s.isDown ? h4e : null; }) ]; } -const W1 = "-10000px"; -class iJ { +const mv = "-10000px"; +class FJ { constructor(e, r, n) { this.facet = r, this.createTooltipView = n, this.input = e.state.facet(r), this.tooltips = this.input.filter((i) => i), this.tooltipViews = this.tooltips.map(n); } @@ -9371,24 +9371,24 @@ class iJ { return r && (o.forEach((l, u) => r[u] = l), r.length = o.length), this.input = i, this.tooltips = s, this.tooltipViews = a, !0; } } -function kOe(t) { +function d4e(t) { let { win: e } = t; return { top: 0, left: 0, bottom: e.innerHeight, right: e.innerWidth }; } -const GE = /* @__PURE__ */ At.define({ +const O_ = /* @__PURE__ */ $t.define({ combine: (t) => { var e, r, n; return { - position: Pt.ios ? "absolute" : ((e = t.find((i) => i.position)) === null || e === void 0 ? void 0 : e.position) || "fixed", + position: Vt.ios ? "absolute" : ((e = t.find((i) => i.position)) === null || e === void 0 ? void 0 : e.position) || "fixed", parent: ((r = t.find((i) => i.parent)) === null || r === void 0 ? void 0 : r.parent) || null, - tooltipSpace: ((n = t.find((i) => i.tooltipSpace)) === null || n === void 0 ? void 0 : n.tooltipSpace) || kOe + tooltipSpace: ((n = t.find((i) => i.tooltipSpace)) === null || n === void 0 ? void 0 : n.tooltipSpace) || d4e }; } -}), _F = /* @__PURE__ */ new WeakMap(), kM = /* @__PURE__ */ Jr.fromClass(class { +}), cz = /* @__PURE__ */ new WeakMap(), KM = /* @__PURE__ */ hn.fromClass(class { constructor(t) { this.view = t, this.above = [], this.inView = !0, this.madeAbsolute = !1, this.lastTransaction = 0, this.measureTimeout = -1; - let e = t.state.facet(GE); - this.position = e.position, this.parent = e.parent, this.classes = t.themeClasses, this.createContainer(), this.measureReq = { read: this.readMeasure.bind(this), write: this.writeMeasure.bind(this), key: this }, this.manager = new iJ(t, SM, (r) => this.createTooltip(r)), this.intersectionObserver = typeof IntersectionObserver == "function" ? new IntersectionObserver((r) => { + let e = t.state.facet(O_); + this.position = e.position, this.parent = e.parent, this.classes = t.themeClasses, this.createContainer(), this.measureReq = { read: this.readMeasure.bind(this), write: this.writeMeasure.bind(this), key: this }, this.manager = new FJ(t, JM, (r) => this.createTooltip(r)), this.intersectionObserver = typeof IntersectionObserver == "function" ? new IntersectionObserver((r) => { Date.now() > this.lastTransaction - 50 && r.length > 0 && r[r.length - 1].intersectionRatio < 1 && this.measureSoon(); }, { threshold: [1] }) : null, this.observeIntersection(), t.win.addEventListener("resize", this.measureSoon = this.measureSoon.bind(this)), this.maybeMeasure(); } @@ -9411,7 +9411,7 @@ const GE = /* @__PURE__ */ At.define({ t.transactions.length && (this.lastTransaction = Date.now()); let e = this.manager.update(t, this.above); e && this.observeIntersection(); - let r = e || t.geometryChanged, n = t.state.facet(GE); + let r = e || t.geometryChanged, n = t.state.facet(O_); if (n.position != this.position && !this.madeAbsolute) { this.position = n.position; for (let i of this.manager.tooltipViews) @@ -9433,7 +9433,7 @@ const GE = /* @__PURE__ */ At.define({ let r = document.createElement("div"); r.className = "cm-tooltip-arrow", e.dom.appendChild(r); } - return e.dom.style.position = this.position, e.dom.style.top = W1, e.dom.style.left = "0px", this.container.appendChild(e.dom), e.mount && e.mount(this.view), e; + return e.dom.style.position = this.position, e.dom.style.top = mv, e.dom.style.left = "0px", this.container.appendChild(e.dom), e.mount && e.mount(this.view), e; } destroy() { var t, e; @@ -9446,9 +9446,9 @@ const GE = /* @__PURE__ */ At.define({ let t = this.view.dom.getBoundingClientRect(), e = 1, r = 1, n = !1; if (this.position == "fixed" && this.manager.tooltipViews.length) { let { dom: i } = this.manager.tooltipViews[0]; - if (Pt.gecko) + if (Vt.gecko) n = i.offsetParent != this.container.ownerDocument.body; - else if (i.style.top == W1 && i.style.left == "0px") { + else if (i.style.top == mv && i.style.left == "0px") { let s = i.getBoundingClientRect(); n = Math.abs(s.top + 1e4) > 1 || Math.abs(s.left) > 1; } @@ -9467,7 +9467,7 @@ const GE = /* @__PURE__ */ At.define({ return a.getCoords ? a.getCoords(i.pos) : this.view.coordsAtPos(i.pos); }), size: this.manager.tooltipViews.map(({ dom: i }) => i.getBoundingClientRect()), - space: this.view.state.facet(GE).tooltipSpace(this.view), + space: this.view.state.facet(O_).tooltipSpace(this.view), scaleX: e, scaleY: r, makeAbsolute: n @@ -9484,18 +9484,18 @@ const GE = /* @__PURE__ */ At.define({ for (let o = 0; o < this.manager.tooltips.length; o++) { let l = this.manager.tooltips[o], u = this.manager.tooltipViews[o], { dom: h } = u, f = t.pos[o], d = t.size[o]; if (!f || f.bottom <= Math.max(r.top, n.top) || f.top >= Math.min(r.bottom, n.bottom) || f.right < Math.max(r.left, n.left) - 0.1 || f.left > Math.min(r.right, n.right) + 0.1) { - h.style.top = W1; + h.style.top = mv; continue; } - let p = l.arrow ? u.dom.querySelector(".cm-tooltip-arrow") : null, g = p ? 7 : 0, m = d.right - d.left, v = (e = _F.get(u)) !== null && e !== void 0 ? e : d.bottom - d.top, y = u.offset || TOe, b = this.view.textDirection == Pn.LTR, w = d.width > n.right - n.left ? b ? n.left : n.right - d.width : b ? Math.min(f.left - (p ? 14 : 0) + y.x, n.right - m) : Math.max(n.left, f.left - m + (p ? 14 : 0) - y.x), O = this.above[o]; + let p = l.arrow ? u.dom.querySelector(".cm-tooltip-arrow") : null, g = p ? 7 : 0, m = d.right - d.left, v = (e = cz.get(u)) !== null && e !== void 0 ? e : d.bottom - d.top, y = u.offset || g4e, b = this.view.textDirection == Wn.LTR, w = d.width > n.right - n.left ? b ? n.left : n.right - d.width : b ? Math.min(f.left - (p ? 14 : 0) + y.x, n.right - m) : Math.max(n.left, f.left - m + (p ? 14 : 0) - y.x), O = this.above[o]; !l.strictSide && (O ? f.top - (d.bottom - d.top) - y.y < n.top : f.bottom + (d.bottom - d.top) + y.y > n.bottom) && O == n.bottom - f.bottom > f.top - n.top && (O = this.above[o] = !O); let S = (O ? f.top - n.top : n.bottom - f.bottom) - g; if (S < v && u.resize !== !1) { if (S < this.view.defaultLineHeight) { - h.style.top = W1; + h.style.top = mv; continue; } - _F.set(u, v), h.style.height = (v = S) / s + "px"; + cz.set(u, v), h.style.height = (v = S) / s + "px"; } else h.style.height && (h.style.height = ""); let C = O ? f.top - v - g - y.y : f.bottom + g + y.y, T = w + m; @@ -9512,7 +9512,7 @@ const GE = /* @__PURE__ */ At.define({ maybeMeasure() { if (this.manager.tooltips.length && (this.view.inView && this.view.requestMeasure(this.measureReq), this.inView != this.view.inView && (this.inView = this.view.inView, !this.inView))) for (let t of this.manager.tooltipViews) - t.dom.style.top = W1; + t.dom.style.top = mv; } }, { eventObservers: { @@ -9520,7 +9520,7 @@ const GE = /* @__PURE__ */ At.define({ this.maybeMeasure(); } } -}), SOe = /* @__PURE__ */ ft.baseTheme({ +}), p4e = /* @__PURE__ */ kt.baseTheme({ ".cm-tooltip": { zIndex: 100, boxSizing: "border-box" @@ -9581,15 +9581,15 @@ const GE = /* @__PURE__ */ At.define({ borderBottomColor: "transparent" } } -}), TOe = { x: 0, y: 0 }, SM = /* @__PURE__ */ At.define({ - enables: [kM, SOe] -}), Y5 = /* @__PURE__ */ At.define(); -class lT { +}), g4e = { x: 0, y: 0 }, JM = /* @__PURE__ */ $t.define({ + enables: [KM, p4e] +}), yk = /* @__PURE__ */ $t.define(); +class NT { static create(e) { - return new lT(e); + return new NT(e); } constructor(e) { - this.view = e, this.mounted = !1, this.dom = document.createElement("div"), this.dom.classList.add("cm-tooltip-hover"), this.manager = new iJ(e, Y5, (r) => this.createHostedView(r)); + this.view = e, this.mounted = !1, this.dom = document.createElement("div"), this.dom.classList.add("cm-tooltip-hover"), this.manager = new FJ(e, yk, (r) => this.createHostedView(r)); } createHostedView(e) { let r = e.create(this.view); @@ -9638,20 +9638,20 @@ class lT { return this.passProp("resize"); } } -const COe = /* @__PURE__ */ SM.compute([Y5], (t) => { - let e = t.facet(Y5).filter((r) => r); +const m4e = /* @__PURE__ */ JM.compute([yk], (t) => { + let e = t.facet(yk).filter((r) => r); return e.length === 0 ? null : { pos: Math.min(...e.map((r) => r.pos)), end: Math.max(...e.map((r) => { var n; return (n = r.end) !== null && n !== void 0 ? n : r.pos; })), - create: lT.create, + create: NT.create, above: e[0].above, arrow: e.some((r) => r.arrow) }; }); -class EOe { +class v4e { constructor(e, r, n, i, s) { this.view = e, this.source = r, this.field = n, this.setHover = i, this.hoverTime = s, this.hoverTimeout = -1, this.restartTimeout = -1, this.pending = null, this.lastMove = { x: 0, y: 0, target: e.dom, time: 0 }, this.checkHover = this.checkHover.bind(this), e.dom.addEventListener("mouseleave", this.mouseleave = this.mouseleave.bind(this)), e.dom.addEventListener("mousemove", this.mousemove = this.mousemove.bind(this)); } @@ -9673,7 +9673,7 @@ class EOe { if (!n) return; let i, s = 1; - if (n instanceof Vh) + if (n instanceof lf) i = n.posAtStart; else { if (i = e.posAtCoords(r), i == null) @@ -9681,7 +9681,7 @@ class EOe { let o = e.coordsAtPos(i); if (!o || r.y < o.top || r.y > o.bottom || r.x < o.left - e.defaultCharacterWidth || r.x > o.right + e.defaultCharacterWidth) return; - let l = e.bidiSpans(e.state.doc.lineAt(i)).find((h) => h.from <= i && h.to >= i), u = l && l.dir == Pn.RTL ? -1 : 1; + let l = e.bidiSpans(e.state.doc.lineAt(i)).find((h) => h.from <= i && h.to >= i), u = l && l.dir == Wn.RTL ? -1 : 1; s = r.x < o.left ? -u : u; } let a = this.source(e, i, s); @@ -9689,21 +9689,21 @@ class EOe { let o = this.pending = { pos: i }; a.then((l) => { this.pending == o && (this.pending = null, l && e.dispatch({ effects: this.setHover.of(l) })); - }, (l) => Vo(e.state, l, "hover tooltip")); + }, (l) => al(e.state, l, "hover tooltip")); } else a && e.dispatch({ effects: this.setHover.of(a) }); } get tooltip() { - let e = this.view.plugin(kM), r = e ? e.manager.tooltips.findIndex((n) => n.create == lT.create) : -1; + let e = this.view.plugin(KM), r = e ? e.manager.tooltips.findIndex((n) => n.create == NT.create) : -1; return r > -1 ? e.manager.tooltipViews[r] : null; } mousemove(e) { var r; this.lastMove = { x: e.clientX, y: e.clientY, target: e.target, time: Date.now() }, this.hoverTimeout < 0 && (this.hoverTimeout = setTimeout(this.checkHover, this.hoverTime)); let { active: n, tooltip: i } = this; - if (n && i && !_Oe(i.dom, e) || this.pending) { + if (n && i && !y4e(i.dom, e) || this.pending) { let { pos: s } = n || this.pending, a = (r = n == null ? void 0 : n.end) !== null && r !== void 0 ? r : s; - (s == a ? this.view.posAtCoords(this.lastMove) != s : !AOe(this.view, s, a, e.clientX, e.clientY)) && (this.view.dispatch({ effects: this.setHover.of(null) }), this.pending = null); + (s == a ? this.view.posAtCoords(this.lastMove) != s : !b4e(this.view, s, a, e.clientX, e.clientY)) && (this.view.dispatch({ effects: this.setHover.of(null) }), this.pending = null); } } mouseleave(e) { @@ -9724,20 +9724,20 @@ class EOe { clearTimeout(this.hoverTimeout), this.view.dom.removeEventListener("mouseleave", this.mouseleave), this.view.dom.removeEventListener("mousemove", this.mousemove); } } -const Uw = 4; -function _Oe(t, e) { +const gO = 4; +function y4e(t, e) { let r = t.getBoundingClientRect(); - return e.clientX >= r.left - Uw && e.clientX <= r.right + Uw && e.clientY >= r.top - Uw && e.clientY <= r.bottom + Uw; + return e.clientX >= r.left - gO && e.clientX <= r.right + gO && e.clientY >= r.top - gO && e.clientY <= r.bottom + gO; } -function AOe(t, e, r, n, i, s) { +function b4e(t, e, r, n, i, s) { let a = t.scrollDOM.getBoundingClientRect(), o = t.documentTop + t.documentPadding.top + t.contentHeight; if (a.left > n || a.right < n || a.top > i || Math.min(a.bottom, o) < i) return !1; let l = t.posAtCoords({ x: n, y: i }, !1); return l >= e && l <= r; } -function LOe(t, e = {}) { - let r = jt.define(), n = In.define({ +function x4e(t, e = {}) { + let r = or.define(), n = Xn.define({ create() { return null; }, @@ -9745,32 +9745,32 @@ function LOe(t, e = {}) { if (i && (e.hideOnChange && (s.docChanged || s.selection) || e.hideOn && e.hideOn(s, i))) return null; if (i && s.docChanged) { - let a = s.changes.mapPos(i.pos, -1, Ci.TrackDel); + let a = s.changes.mapPos(i.pos, -1, Fi.TrackDel); if (a == null) return null; let o = Object.assign(/* @__PURE__ */ Object.create(null), i); o.pos = a, i.end != null && (o.end = s.changes.mapPos(i.end)), i = o; } for (let a of s.effects) - a.is(r) && (i = a.value), a.is(ROe) && (i = null); + a.is(r) && (i = a.value), a.is(w4e) && (i = null); return i; }, - provide: (i) => Y5.from(i) + provide: (i) => yk.from(i) }); return [ n, - Jr.define((i) => new EOe(i, t, n, r, e.hoverTime || 300)), - COe + hn.define((i) => new v4e(i, t, n, r, e.hoverTime || 300)), + m4e ]; } -function sJ(t, e) { - let r = t.plugin(kM); +function zJ(t, e) { + let r = t.plugin(KM); if (!r) return null; let n = r.manager.tooltips.indexOf(e); return n < 0 ? null : r.manager.tooltipViews[n]; } -const ROe = /* @__PURE__ */ jt.define(), AF = /* @__PURE__ */ At.define({ +const w4e = /* @__PURE__ */ or.define(), uz = /* @__PURE__ */ $t.define({ combine(t) { let e, r; for (let n of t) @@ -9778,22 +9778,22 @@ const ROe = /* @__PURE__ */ jt.define(), AF = /* @__PURE__ */ At.define({ return { topContainer: e, bottomContainer: r }; } }); -function Gy(t, e) { - let r = t.plugin(aJ), n = r ? r.specs.indexOf(e) : -1; +function v2(t, e) { + let r = t.plugin(QJ), n = r ? r.specs.indexOf(e) : -1; return n > -1 ? r.panels[n] : null; } -const aJ = /* @__PURE__ */ Jr.fromClass(class { +const QJ = /* @__PURE__ */ hn.fromClass(class { constructor(t) { - this.input = t.state.facet(Xy), this.specs = this.input.filter((r) => r), this.panels = this.specs.map((r) => r(t)); - let e = t.state.facet(AF); - this.top = new Vw(t, !0, e.topContainer), this.bottom = new Vw(t, !1, e.bottomContainer), this.top.sync(this.panels.filter((r) => r.top)), this.bottom.sync(this.panels.filter((r) => !r.top)); + this.input = t.state.facet(y2), this.specs = this.input.filter((r) => r), this.panels = this.specs.map((r) => r(t)); + let e = t.state.facet(uz); + this.top = new mO(t, !0, e.topContainer), this.bottom = new mO(t, !1, e.bottomContainer), this.top.sync(this.panels.filter((r) => r.top)), this.bottom.sync(this.panels.filter((r) => !r.top)); for (let r of this.panels) r.dom.classList.add("cm-panel"), r.mount && r.mount(); } update(t) { - let e = t.state.facet(AF); - this.top.container != e.topContainer && (this.top.sync([]), this.top = new Vw(t.view, !0, e.topContainer)), this.bottom.container != e.bottomContainer && (this.bottom.sync([]), this.bottom = new Vw(t.view, !1, e.bottomContainer)), this.top.syncClasses(), this.bottom.syncClasses(); - let r = t.state.facet(Xy); + let e = t.state.facet(uz); + this.top.container != e.topContainer && (this.top.sync([]), this.top = new mO(t.view, !0, e.topContainer)), this.bottom.container != e.bottomContainer && (this.bottom.sync([]), this.bottom = new mO(t.view, !1, e.bottomContainer)), this.top.syncClasses(), this.bottom.syncClasses(); + let r = t.state.facet(y2); if (r != this.input) { let n = r.filter((l) => l), i = [], s = [], a = [], o = []; for (let l of n) { @@ -9811,12 +9811,12 @@ const aJ = /* @__PURE__ */ Jr.fromClass(class { this.top.sync([]), this.bottom.sync([]); } }, { - provide: (t) => ft.scrollMargins.of((e) => { + provide: (t) => kt.scrollMargins.of((e) => { let r = e.plugin(t); return r && { top: r.top.scrollMargin(), bottom: r.bottom.scrollMargin() }; }) }); -class Vw { +class mO { constructor(e, r, n) { this.view = e, this.top = r, this.container = n, this.dom = void 0, this.classes = "", this.panels = [], this.syncClasses(); } @@ -9839,12 +9839,12 @@ class Vw { for (let r of this.panels) if (r.dom.parentNode == this.dom) { for (; e != r.dom; ) - e = LF(e); + e = hz(e); e = e.nextSibling; } else this.dom.insertBefore(r.dom, e); for (; e; ) - e = LF(e); + e = hz(e); } scrollMargin() { return !this.dom || this.container ? 0 : Math.max(0, this.top ? this.dom.getBoundingClientRect().bottom - Math.max(0, this.view.scrollDOM.getBoundingClientRect().top) : Math.min(innerHeight, this.view.scrollDOM.getBoundingClientRect().bottom) - this.dom.getBoundingClientRect().top); @@ -9858,14 +9858,14 @@ class Vw { } } } -function LF(t) { +function hz(t) { let e = t.nextSibling; return t.remove(), e; } -const Xy = /* @__PURE__ */ At.define({ - enables: aJ +const y2 = /* @__PURE__ */ $t.define({ + enables: QJ }); -class Go extends c0 { +class ul extends _0 { compare(e) { return this == e || this.constructor == e.constructor && this.eq(e); } @@ -9875,67 +9875,67 @@ class Go extends c0 { destroy(e) { } } -Go.prototype.elementClass = ""; -Go.prototype.toDOM = void 0; -Go.prototype.mapMode = Ci.TrackBefore; -Go.prototype.startSide = Go.prototype.endSide = -1; -Go.prototype.point = !0; -const M4 = /* @__PURE__ */ At.define(), MOe = { +ul.prototype.elementClass = ""; +ul.prototype.toDOM = void 0; +ul.prototype.mapMode = Fi.TrackBefore; +ul.prototype.startSide = ul.prototype.endSide = -1; +ul.prototype.point = !0; +const s5 = /* @__PURE__ */ $t.define(), O4e = { class: "", renderEmptyElements: !1, elementStyle: "", - markers: () => Er.empty, + markers: () => $r.empty, lineMarker: () => null, widgetMarker: () => null, lineMarkerChange: null, initialSpacer: null, updateSpacer: null, domEventHandlers: {} -}, hy = /* @__PURE__ */ At.define(); -function cT(t) { - return [oJ(), hy.of(Object.assign(Object.assign({}, MOe), t))]; +}, Ny = /* @__PURE__ */ $t.define(); +function IT(t) { + return [UJ(), Ny.of(Object.assign(Object.assign({}, O4e), t))]; } -const U7 = /* @__PURE__ */ At.define({ +const v8 = /* @__PURE__ */ $t.define({ combine: (t) => t.some((e) => e) }); -function oJ(t) { +function UJ(t) { let e = [ - DOe + k4e ]; - return t && t.fixed === !1 && e.push(U7.of(!0)), e; + return t && t.fixed === !1 && e.push(v8.of(!0)), e; } -const DOe = /* @__PURE__ */ Jr.fromClass(class { +const k4e = /* @__PURE__ */ hn.fromClass(class { constructor(t) { - this.view = t, this.prevViewport = t.viewport, this.dom = document.createElement("div"), this.dom.className = "cm-gutters", this.dom.setAttribute("aria-hidden", "true"), this.dom.style.minHeight = this.view.contentHeight / this.view.scaleY + "px", this.gutters = t.state.facet(hy).map((e) => new MF(t, e)); + this.view = t, this.prevViewport = t.viewport, this.dom = document.createElement("div"), this.dom.className = "cm-gutters", this.dom.setAttribute("aria-hidden", "true"), this.dom.style.minHeight = this.view.contentHeight / this.view.scaleY + "px", this.gutters = t.state.facet(Ny).map((e) => new dz(t, e)); for (let e of this.gutters) this.dom.appendChild(e.dom); - this.fixed = !t.state.facet(U7), this.fixed && (this.dom.style.position = "sticky"), this.syncGutters(!1), t.scrollDOM.insertBefore(this.dom, t.contentDOM); + this.fixed = !t.state.facet(v8), this.fixed && (this.dom.style.position = "sticky"), this.syncGutters(!1), t.scrollDOM.insertBefore(this.dom, t.contentDOM); } update(t) { if (this.updateGutters(t)) { let e = this.prevViewport, r = t.view.viewport, n = Math.min(e.to, r.to) - Math.max(e.from, r.from); this.syncGutters(n < (r.to - r.from) * 0.8); } - t.geometryChanged && (this.dom.style.minHeight = this.view.contentHeight + "px"), this.view.state.facet(U7) != !this.fixed && (this.fixed = !this.fixed, this.dom.style.position = this.fixed ? "sticky" : ""), this.prevViewport = t.view.viewport; + t.geometryChanged && (this.dom.style.minHeight = this.view.contentHeight + "px"), this.view.state.facet(v8) != !this.fixed && (this.fixed = !this.fixed, this.dom.style.position = this.fixed ? "sticky" : ""), this.prevViewport = t.view.viewport; } syncGutters(t) { let e = this.dom.nextSibling; t && this.dom.remove(); - let r = Er.iter(this.view.state.facet(M4), this.view.viewport.from), n = [], i = this.gutters.map((s) => new POe(s, this.view.viewport, -this.view.documentPadding.top)); + let r = $r.iter(this.view.state.facet(s5), this.view.viewport.from), n = [], i = this.gutters.map((s) => new S4e(s, this.view.viewport, -this.view.documentPadding.top)); for (let s of this.view.viewportLineBlocks) if (n.length && (n = []), Array.isArray(s.type)) { let a = !0; for (let o of s.type) - if (o.type == la.Text && a) { - V7(r, n, o.from); + if (o.type == Ca.Text && a) { + y8(r, n, o.from); for (let l of i) l.line(this.view, o, n); a = !1; } else if (o.widget) for (let l of i) l.widget(this.view, o); - } else if (s.type == la.Text) { - V7(r, n, s.from); + } else if (s.type == Ca.Text) { + y8(r, n, s.from); for (let a of i) a.line(this.view, s, n); } else if (s.widget) @@ -9946,7 +9946,7 @@ const DOe = /* @__PURE__ */ Jr.fromClass(class { t && this.view.scrollDOM.insertBefore(this.dom, e); } updateGutters(t) { - let e = t.startState.facet(hy), r = t.state.facet(hy), n = t.docChanged || t.heightChanged || t.viewportChanged || !Er.eq(t.startState.facet(M4), t.state.facet(M4), t.view.viewport.from, t.view.viewport.to); + let e = t.startState.facet(Ny), r = t.state.facet(Ny), n = t.docChanged || t.heightChanged || t.viewportChanged || !$r.eq(t.startState.facet(s5), t.state.facet(s5), t.view.viewport.from, t.view.viewport.to); if (e == r) for (let i of this.gutters) i.update(t) && (n = !0); @@ -9955,7 +9955,7 @@ const DOe = /* @__PURE__ */ Jr.fromClass(class { let i = []; for (let s of r) { let a = e.indexOf(s); - a < 0 ? i.push(new MF(this.view, s)) : (this.gutters[a].update(t), i.push(this.gutters[a])); + a < 0 ? i.push(new dz(this.view, s)) : (this.gutters[a].update(t), i.push(this.gutters[a])); } for (let s of this.gutters) s.dom.remove(), i.indexOf(s) < 0 && s.destroy(); @@ -9971,26 +9971,26 @@ const DOe = /* @__PURE__ */ Jr.fromClass(class { this.dom.remove(); } }, { - provide: (t) => ft.scrollMargins.of((e) => { + provide: (t) => kt.scrollMargins.of((e) => { let r = e.plugin(t); - return !r || r.gutters.length == 0 || !r.fixed ? null : e.textDirection == Pn.LTR ? { left: r.dom.offsetWidth * e.scaleX } : { right: r.dom.offsetWidth * e.scaleX }; + return !r || r.gutters.length == 0 || !r.fixed ? null : e.textDirection == Wn.LTR ? { left: r.dom.offsetWidth * e.scaleX } : { right: r.dom.offsetWidth * e.scaleX }; }) }); -function RF(t) { +function fz(t) { return Array.isArray(t) ? t : [t]; } -function V7(t, e, r) { +function y8(t, e, r) { for (; t.value && t.from <= r; ) t.from == r && e.push(t.value), t.next(); } -class POe { +class S4e { constructor(e, r, n) { - this.gutter = e, this.height = n, this.i = 0, this.cursor = Er.iter(e.markers, r.from); + this.gutter = e, this.height = n, this.i = 0, this.cursor = $r.iter(e.markers, r.from); } addElement(e, r, n) { let { gutter: i } = this, s = (r.top - this.height) / e.scaleY, a = r.height / e.scaleY; if (this.i == i.elements.length) { - let o = new lJ(e, a, s, n); + let o = new VJ(e, a, s, n); i.elements.push(o), i.dom.appendChild(o.dom); } else i.elements[this.i].update(e, a, s, n); @@ -9998,7 +9998,7 @@ class POe { } line(e, r, n) { let i = []; - V7(this.cursor, i, r.from), n.length && (i = i.concat(n)); + y8(this.cursor, i, r.from), n.length && (i = i.concat(n)); let s = this.gutter.config.lineMarker(e, r, i); s && i.unshift(s); let a = this.gutter; @@ -10016,7 +10016,7 @@ class POe { } } } -class MF { +class dz { constructor(e, r) { this.view = e, this.config = r, this.elements = [], this.spacer = null, this.dom = document.createElement("div"), this.dom.className = "cm-gutter" + (this.config.class ? " " + this.config.class : ""); for (let n in r.domEventHandlers) @@ -10032,28 +10032,28 @@ class MF { let o = e.lineBlockAtHeight(a - e.documentTop); r.domEventHandlers[n](e, o, i) && i.preventDefault(); }); - this.markers = RF(r.markers(e)), r.initialSpacer && (this.spacer = new lJ(e, 0, 0, [r.initialSpacer(e)]), this.dom.appendChild(this.spacer.dom), this.spacer.dom.style.cssText += "visibility: hidden; pointer-events: none"); + this.markers = fz(r.markers(e)), r.initialSpacer && (this.spacer = new VJ(e, 0, 0, [r.initialSpacer(e)]), this.dom.appendChild(this.spacer.dom), this.spacer.dom.style.cssText += "visibility: hidden; pointer-events: none"); } update(e) { let r = this.markers; - if (this.markers = RF(this.config.markers(e.view)), this.spacer && this.config.updateSpacer) { + if (this.markers = fz(this.config.markers(e.view)), this.spacer && this.config.updateSpacer) { let i = this.config.updateSpacer(this.spacer.markers[0], e); i != this.spacer.markers[0] && this.spacer.update(e.view, 0, 0, [i]); } let n = e.view.viewport; - return !Er.eq(this.markers, r, n.from, n.to) || (this.config.lineMarkerChange ? this.config.lineMarkerChange(e) : !1); + return !$r.eq(this.markers, r, n.from, n.to) || (this.config.lineMarkerChange ? this.config.lineMarkerChange(e) : !1); } destroy() { for (let e of this.elements) e.destroy(); } } -class lJ { +class VJ { constructor(e, r, n, i) { this.height = -1, this.above = 0, this.markers = [], this.dom = document.createElement("div"), this.dom.className = "cm-gutterElement", this.update(e, r, n, i); } update(e, r, n, i) { - this.height != r && (this.height = r, this.dom.style.height = r + "px"), this.above != n && (this.dom.style.marginTop = (this.above = n) ? n + "px" : ""), NOe(this.markers, i) || this.setMarkers(e, i); + this.height != r && (this.height = r, this.dom.style.height = r + "px"), this.above != n && (this.dom.style.marginTop = (this.above = n) ? n + "px" : ""), T4e(this.markers, i) || this.setMarkers(e, i); } setMarkers(e, r) { let n = "cm-gutterElement", i = this.dom.firstChild; @@ -10087,7 +10087,7 @@ class lJ { this.setMarkers(null, []); } } -function NOe(t, e) { +function T4e(t, e) { if (t.length != e.length) return !1; for (let r = 0; r < t.length; r++) @@ -10095,9 +10095,9 @@ function NOe(t, e) { return !1; return !0; } -const IOe = /* @__PURE__ */ At.define(), Yp = /* @__PURE__ */ At.define({ +const C4e = /* @__PURE__ */ $t.define(), fg = /* @__PURE__ */ $t.define({ combine(t) { - return Zc(t, { formatNumber: String, domEventHandlers: {} }, { + return pu(t, { formatNumber: String, domEventHandlers: {} }, { domEventHandlers(e, r) { let n = Object.assign({}, e); for (let i in r) { @@ -10109,7 +10109,7 @@ const IOe = /* @__PURE__ */ At.define(), Yp = /* @__PURE__ */ At.define({ }); } }); -class XE extends Go { +class k_ extends ul { constructor(e) { super(), this.number = e; } @@ -10120,105 +10120,105 @@ class XE extends Go { return document.createTextNode(this.number); } } -function HE(t, e) { - return t.state.facet(Yp).formatNumber(e, t.state); +function S_(t, e) { + return t.state.facet(fg).formatNumber(e, t.state); } -const $Oe = /* @__PURE__ */ hy.compute([Yp], (t) => ({ +const E4e = /* @__PURE__ */ Ny.compute([fg], (t) => ({ class: "cm-lineNumbers", renderEmptyElements: !1, markers(e) { - return e.state.facet(IOe); + return e.state.facet(C4e); }, lineMarker(e, r, n) { - return n.some((i) => i.toDOM) ? null : new XE(HE(e, e.state.doc.lineAt(r.from).number)); + return n.some((i) => i.toDOM) ? null : new k_(S_(e, e.state.doc.lineAt(r.from).number)); }, widgetMarker: () => null, - lineMarkerChange: (e) => e.startState.facet(Yp) != e.state.facet(Yp), + lineMarkerChange: (e) => e.startState.facet(fg) != e.state.facet(fg), initialSpacer(e) { - return new XE(HE(e, DF(e.state.doc.lines))); + return new k_(S_(e, pz(e.state.doc.lines))); }, updateSpacer(e, r) { - let n = HE(r.view, DF(r.view.state.doc.lines)); - return n == e.number ? e : new XE(n); + let n = S_(r.view, pz(r.view.state.doc.lines)); + return n == e.number ? e : new k_(n); }, - domEventHandlers: t.facet(Yp).domEventHandlers + domEventHandlers: t.facet(fg).domEventHandlers })); -function BOe(t = {}) { +function _4e(t = {}) { return [ - Yp.of(t), - oJ(), - $Oe + fg.of(t), + UJ(), + E4e ]; } -function DF(t) { +function pz(t) { let e = 9; for (; e < t; ) e = e * 10 + 9; return e; } -const FOe = /* @__PURE__ */ new class extends Go { +const A4e = /* @__PURE__ */ new class extends ul { constructor() { super(...arguments), this.elementClass = "cm-activeLineGutter"; } -}(), zOe = /* @__PURE__ */ M4.compute(["selection"], (t) => { +}(), L4e = /* @__PURE__ */ s5.compute(["selection"], (t) => { let e = [], r = -1; for (let n of t.selection.ranges) { let i = t.doc.lineAt(n.head).from; - i > r && (r = i, e.push(FOe.range(i))); + i > r && (r = i, e.push(A4e.range(i))); } - return Er.of(e); + return $r.of(e); }); -function QOe() { - return zOe; +function R4e() { + return L4e; } -const cJ = 1024; -let UOe = 0; -class Io { +const qJ = 1024; +let M4e = 0; +class Jo { constructor(e, r) { this.from = e, this.to = r; } } -class or { +class yr { constructor(e = {}) { - this.id = UOe++, this.perNode = !!e.perNode, this.deserialize = e.deserialize || (() => { + this.id = M4e++, this.perNode = !!e.perNode, this.deserialize = e.deserialize || (() => { throw new Error("This node type doesn't define a deserialize function"); }); } add(e) { if (this.perNode) throw new RangeError("Can't add per-node props to node types"); - return typeof e != "function" && (e = Mi.match(e)), (r) => { + return typeof e != "function" && (e = Yi.match(e)), (r) => { let n = e(r); return n === void 0 ? null : [this, n]; }; } } -or.closedBy = new or({ deserialize: (t) => t.split(" ") }); -or.openedBy = new or({ deserialize: (t) => t.split(" ") }); -or.group = new or({ deserialize: (t) => t.split(" ") }); -or.isolate = new or({ deserialize: (t) => { +yr.closedBy = new yr({ deserialize: (t) => t.split(" ") }); +yr.openedBy = new yr({ deserialize: (t) => t.split(" ") }); +yr.group = new yr({ deserialize: (t) => t.split(" ") }); +yr.isolate = new yr({ deserialize: (t) => { if (t && t != "rtl" && t != "ltr" && t != "auto") throw new RangeError("Invalid value for isolate: " + t); return t || "auto"; } }); -or.contextHash = new or({ perNode: !0 }); -or.lookAhead = new or({ perNode: !0 }); -or.mounted = new or({ perNode: !0 }); -class Hy { +yr.contextHash = new yr({ perNode: !0 }); +yr.lookAhead = new yr({ perNode: !0 }); +yr.mounted = new yr({ perNode: !0 }); +class b2 { constructor(e, r, n) { this.tree = e, this.overlay = r, this.parser = n; } static get(e) { - return e && e.props && e.props[or.mounted.id]; + return e && e.props && e.props[yr.mounted.id]; } } -const VOe = /* @__PURE__ */ Object.create(null); -class Mi { +const D4e = /* @__PURE__ */ Object.create(null); +class Yi { constructor(e, r, n, i = 0) { this.name = e, this.props = r, this.id = n, this.flags = i; } static define(e) { - let r = e.props && e.props.length ? /* @__PURE__ */ Object.create(null) : VOe, n = (e.top ? 1 : 0) | (e.skipped ? 2 : 0) | (e.error ? 4 : 0) | (e.name == null ? 8 : 0), i = new Mi(e.name || "", r, e.id, n); + let r = e.props && e.props.length ? /* @__PURE__ */ Object.create(null) : D4e, n = (e.top ? 1 : 0) | (e.skipped ? 2 : 0) | (e.error ? 4 : 0) | (e.name == null ? 8 : 0), i = new Yi(e.name || "", r, e.id, n); if (e.props) { for (let s of e.props) if (Array.isArray(s) || (s = s(i)), s) { @@ -10248,7 +10248,7 @@ class Mi { if (typeof e == "string") { if (this.name == e) return !0; - let r = this.prop(or.group); + let r = this.prop(yr.group); return r ? r.indexOf(e) > -1 : !1; } return this.id == e; @@ -10259,7 +10259,7 @@ class Mi { for (let i of n.split(" ")) r[i] = e[n]; return (n) => { - for (let i = n.prop(or.group), s = -1; s < (i ? i.length : 0); s++) { + for (let i = n.prop(yr.group), s = -1; s < (i ? i.length : 0); s++) { let a = r[s < 0 ? n.name : i[s]]; if (a) return a; @@ -10267,8 +10267,8 @@ class Mi { }; } } -Mi.none = new Mi("", /* @__PURE__ */ Object.create(null), 0, 8); -class dx { +Yi.none = new Yi("", /* @__PURE__ */ Object.create(null), 0, 8); +class $x { constructor(e) { this.types = e; for (let r = 0; r < e.length; r++) @@ -10283,17 +10283,17 @@ class dx { let a = s(n); a && (i || (i = Object.assign({}, n.props)), i[a[0].id] = a[1]); } - r.push(i ? new Mi(n.name, i, n.id, n.flags) : n); + r.push(i ? new Yi(n.name, i, n.id, n.flags) : n); } - return new dx(r); + return new $x(r); } } -const qw = /* @__PURE__ */ new WeakMap(), PF = /* @__PURE__ */ new WeakMap(); -var hn; +const vO = /* @__PURE__ */ new WeakMap(), gz = /* @__PURE__ */ new WeakMap(); +var Sn; (function(t) { t[t.ExcludeBuffers = 1] = "ExcludeBuffers", t[t.IncludeAnonymous = 2] = "IncludeAnonymous", t[t.IgnoreMounts = 4] = "IgnoreMounts", t[t.IgnoreOverlays = 8] = "IgnoreOverlays"; -})(hn || (hn = {})); -class Yr { +})(Sn || (Sn = {})); +class nn { constructor(e, r, n, i, s) { if (this.type = e, this.children = r, this.positions = n, this.length = i, this.props = null, s && s.length) { this.props = /* @__PURE__ */ Object.create(null); @@ -10302,7 +10302,7 @@ class Yr { } } toString() { - let e = Hy.get(this); + let e = b2.get(this); if (e && !e.overlay) return e.tree.toString(); let r = ""; @@ -10313,29 +10313,29 @@ class Yr { return this.type.name ? (/\W/.test(this.type.name) && !this.type.isError ? JSON.stringify(this.type.name) : this.type.name) + (r.length ? "(" + r + ")" : "") : r; } cursor(e = 0) { - return new W5(this.topNode, e); + return new bk(this.topNode, e); } cursorAt(e, r = 0, n = 0) { - let i = qw.get(this) || this.topNode, s = new W5(i); - return s.moveTo(e, r), qw.set(this, s._tree), s; + let i = vO.get(this) || this.topNode, s = new bk(i); + return s.moveTo(e, r), vO.set(this, s._tree), s; } get topNode() { - return new zs(this, 0, 0, null); + return new ea(this, 0, 0, null); } resolve(e, r = 0) { - let n = Zy(qw.get(this) || this.topNode, e, r, !1); - return qw.set(this, n), n; + let n = x2(vO.get(this) || this.topNode, e, r, !1); + return vO.set(this, n), n; } resolveInner(e, r = 0) { - let n = Zy(PF.get(this) || this.topNode, e, r, !0); - return PF.set(this, n), n; + let n = x2(gz.get(this) || this.topNode, e, r, !0); + return gz.set(this, n), n; } resolveStack(e, r = 0) { - return WOe(this, e, r); + return I4e(this, e, r); } iterate(e) { - let { enter: r, leave: n, from: i = 0, to: s = this.length } = e, a = e.mode || 0, o = (a & hn.IncludeAnonymous) > 0; - for (let l = this.cursor(a | hn.IncludeAnonymous); ; ) { + let { enter: r, leave: n, from: i = 0, to: s = this.length } = e, a = e.mode || 0, o = (a & Sn.IncludeAnonymous) > 0; + for (let l = this.cursor(a | Sn.IncludeAnonymous); ; ) { let u = !1; if (l.from <= s && l.to >= i && (!o && l.type.isAnonymous || r(l) !== !1)) { if (l.firstChild()) @@ -10360,14 +10360,14 @@ class Yr { return e; } balance(e = {}) { - return this.children.length <= 8 ? this : EM(Mi.none, this.children, this.positions, 0, this.children.length, 0, this.length, (r, n, i) => new Yr(this.type, r, n, i, this.propValues), e.makeTree || ((r, n, i) => new Yr(Mi.none, r, n, i))); + return this.children.length <= 8 ? this : rD(Yi.none, this.children, this.positions, 0, this.children.length, 0, this.length, (r, n, i) => new nn(this.type, r, n, i, this.propValues), e.makeTree || ((r, n, i) => new nn(Yi.none, r, n, i))); } static build(e) { - return GOe(e); + return $4e(e); } } -Yr.empty = new Yr(Mi.none, [], [], 0); -class TM { +nn.empty = new nn(Yi.none, [], [], 0); +class eD { constructor(e, r) { this.buffer = e, this.index = r; } @@ -10390,15 +10390,15 @@ class TM { this.index -= 4; } fork() { - return new TM(this.buffer, this.index); + return new eD(this.buffer, this.index); } } -class vf { +class Nf { constructor(e, r, n) { this.buffer = e, this.length = r, this.set = n; } get type() { - return Mi.none; + return Yi.none; } toString() { let e = []; @@ -10417,7 +10417,7 @@ class vf { } findChild(e, r, n, i, s) { let { buffer: a } = this, o = -1; - for (let l = e; l != r && !(uJ(s, i, a[l + 1], a[l + 2]) && (o = l, n > 0)); l = a[l + 3]) + for (let l = e; l != r && !(YJ(s, i, a[l + 1], a[l + 2]) && (o = l, n > 0)); l = a[l + 3]) ; return o; } @@ -10428,10 +10428,10 @@ class vf { let u = s[l++] = i[o++] - n; s[l++] = i[o++] - e, a = Math.max(a, u); } - return new vf(s, a, this.set); + return new Nf(s, a, this.set); } } -function uJ(t, e, r, n) { +function YJ(t, e, r, n) { switch (t) { case -2: return r < e; @@ -10447,17 +10447,17 @@ function uJ(t, e, r, n) { return !0; } } -function Zy(t, e, r, n) { +function x2(t, e, r, n) { for (var i; t.from == t.to || (r < 1 ? t.from >= e : t.from > e) || (r > -1 ? t.to <= e : t.to < e); ) { - let a = !n && t instanceof zs && t.index < 0 ? null : t.parent; + let a = !n && t instanceof ea && t.index < 0 ? null : t.parent; if (!a) return t; t = a; } - let s = n ? 0 : hn.IgnoreOverlays; + let s = n ? 0 : Sn.IgnoreOverlays; if (n) for (let a = t, o = a.parent; o; a = o, o = a.parent) - a instanceof zs && a.index < 0 && ((i = o.enter(e, r, s)) === null || i === void 0 ? void 0 : i.from) != a.from && (t = o); + a instanceof ea && a.index < 0 && ((i = o.enter(e, r, s)) === null || i === void 0 ? void 0 : i.from) != a.from && (t = o); for (; ; ) { let a = t.enter(e, r, s); if (!a) @@ -10465,25 +10465,25 @@ function Zy(t, e, r, n) { t = a; } } -class hJ { +class WJ { cursor(e = 0) { - return new W5(this, e); + return new bk(this, e); } getChild(e, r = null, n = null) { - let i = NF(this, e, r, n); + let i = mz(this, e, r, n); return i.length ? i[0] : null; } getChildren(e, r = null, n = null) { - return NF(this, e, r, n); + return mz(this, e, r, n); } resolve(e, r = 0) { - return Zy(this, e, r, !1); + return x2(this, e, r, !1); } resolveInner(e, r = 0) { - return Zy(this, e, r, !0); + return x2(this, e, r, !0); } matchContext(e) { - return q7(this.parent, e); + return b8(this.parent, e); } enterUnfinishedNodesBefore(e) { let r = this.childBefore(e), n = this; @@ -10502,7 +10502,7 @@ class hJ { return this.parent; } } -class zs extends hJ { +class ea extends WJ { constructor(e, r, n, i) { super(), this._tree = e, this.from = r, this.index = n, this._parent = i; } @@ -10519,23 +10519,23 @@ class zs extends hJ { for (let a = this; ; ) { for (let { children: o, positions: l } = a._tree, u = r > 0 ? o.length : -1; e != u; e += r) { let h = o[e], f = l[e] + a.from; - if (!!uJ(i, n, f, f + h.length)) { - if (h instanceof vf) { - if (s & hn.ExcludeBuffers) + if (!!YJ(i, n, f, f + h.length)) { + if (h instanceof Nf) { + if (s & Sn.ExcludeBuffers) continue; let d = h.findChild(0, h.buffer.length, r, n - f, i); if (d > -1) - return new xc(new qOe(a, h, e, f), null, d); - } else if (s & hn.IncludeAnonymous || !h.type.isAnonymous || CM(h)) { + return new Fc(new P4e(a, h, e, f), null, d); + } else if (s & Sn.IncludeAnonymous || !h.type.isAnonymous || tD(h)) { let d; - if (!(s & hn.IgnoreMounts) && (d = Hy.get(h)) && !d.overlay) - return new zs(d.tree, f, e, a); - let p = new zs(h, f, e, a); - return s & hn.IncludeAnonymous || !p.type.isAnonymous ? p : p.nextChild(r < 0 ? h.children.length - 1 : 0, r, n, i); + if (!(s & Sn.IgnoreMounts) && (d = b2.get(h)) && !d.overlay) + return new ea(d.tree, f, e, a); + let p = new ea(h, f, e, a); + return s & Sn.IncludeAnonymous || !p.type.isAnonymous ? p : p.nextChild(r < 0 ? h.children.length - 1 : 0, r, n, i); } } } - if (s & hn.IncludeAnonymous || !a.type.isAnonymous || (a.index >= 0 ? e = a.index + r : e = r < 0 ? -1 : a._parent._tree.children.length, a = a._parent, !a)) + if (s & Sn.IncludeAnonymous || !a.type.isAnonymous || (a.index >= 0 ? e = a.index + r : e = r < 0 ? -1 : a._parent._tree.children.length, a = a._parent, !a)) return null; } } @@ -10553,11 +10553,11 @@ class zs extends hJ { } enter(e, r, n = 0) { let i; - if (!(n & hn.IgnoreOverlays) && (i = Hy.get(this._tree)) && i.overlay) { + if (!(n & Sn.IgnoreOverlays) && (i = b2.get(this._tree)) && i.overlay) { let s = e - this.from; for (let { from: a, to: o } of i.overlay) if ((r > 0 ? a <= s : a < s) && (r < 0 ? o >= s : o > s)) - return new zs(i.tree, i.overlay[0].from + this.from, -1, this); + return new ea(i.tree, i.overlay[0].from + this.from, -1, this); } return this.nextChild(0, 1, e, r, n); } @@ -10586,7 +10586,7 @@ class zs extends hJ { return this._tree.toString(); } } -function NF(t, e, r, n) { +function mz(t, e, r, n) { let i = t.cursor(), s = []; if (!i.firstChild()) return s; @@ -10602,7 +10602,7 @@ function NF(t, e, r, n) { return n == null ? s : []; } } -function q7(t, e, r = e.length - 1) { +function b8(t, e, r = e.length - 1) { for (let n = t; r >= 0; n = n.parent) { if (!n) return !1; @@ -10614,12 +10614,12 @@ function q7(t, e, r = e.length - 1) { } return !0; } -class qOe { +class P4e { constructor(e, r, n, i) { this.parent = e, this.buffer = r, this.index = n, this.start = i; } } -class xc extends hJ { +class Fc extends WJ { get name() { return this.type.name; } @@ -10634,7 +10634,7 @@ class xc extends hJ { } child(e, r, n) { let { buffer: i } = this.context, s = i.findChild(this.index + 4, i.buffer[this.index + 3], e, r - this.context.start, n); - return s < 0 ? null : new xc(this.context, this, s); + return s < 0 ? null : new Fc(this.context, this, s); } get firstChild() { return this.child(1, 0, 4); @@ -10649,10 +10649,10 @@ class xc extends hJ { return this.child(-1, e, -2); } enter(e, r, n = 0) { - if (n & hn.ExcludeBuffers) + if (n & Sn.ExcludeBuffers) return null; let { buffer: i } = this.context, s = i.findChild(this.index + 4, i.buffer[this.index + 3], r > 0 ? 1 : -1, e - this.context.start, r); - return s < 0 ? null : new xc(this.context, this, s); + return s < 0 ? null : new Fc(this.context, this, s); } get parent() { return this._parent || this.context.parent.nextSignificantParent(); @@ -10662,11 +10662,11 @@ class xc extends hJ { } get nextSibling() { let { buffer: e } = this.context, r = e.buffer[this.index + 3]; - return r < (this._parent ? e.buffer[this._parent.index + 3] : e.buffer.length) ? new xc(this.context, this._parent, r) : this.externalSibling(1); + return r < (this._parent ? e.buffer[this._parent.index + 3] : e.buffer.length) ? new Fc(this.context, this._parent, r) : this.externalSibling(1); } get prevSibling() { let { buffer: e } = this.context, r = this._parent ? this._parent.index + 4 : 0; - return this.index == r ? this.externalSibling(-1) : new xc(this.context, this._parent, e.findChild(r, this.index, -1, 0, 4)); + return this.index == r ? this.externalSibling(-1) : new Fc(this.context, this._parent, e.findChild(r, this.index, -1, 0, 4)); } get tree() { return null; @@ -10677,13 +10677,13 @@ class xc extends hJ { let a = n.buffer[this.index + 1]; e.push(n.slice(i, s, a)), r.push(0); } - return new Yr(this.type, e, r, this.to - this.from); + return new nn(this.type, e, r, this.to - this.from); } toString() { return this.context.buffer.childString(this.index); } } -function fJ(t) { +function GJ(t) { if (!t.length) return null; let e = 0, r = t[0]; @@ -10691,38 +10691,38 @@ function fJ(t) { let a = t[s]; (a.from > r.from || a.to < r.to) && (r = a, e = s); } - let n = r instanceof zs && r.index < 0 ? null : r.parent, i = t.slice(); - return n ? i[e] = n : i.splice(e, 1), new YOe(i, r); + let n = r instanceof ea && r.index < 0 ? null : r.parent, i = t.slice(); + return n ? i[e] = n : i.splice(e, 1), new N4e(i, r); } -class YOe { +class N4e { constructor(e, r) { this.heads = e, this.node = r; } get next() { - return fJ(this.heads); + return GJ(this.heads); } } -function WOe(t, e, r) { +function I4e(t, e, r) { let n = t.resolveInner(e, r), i = null; - for (let s = n instanceof zs ? n : n.context.parent; s; s = s.parent) + for (let s = n instanceof ea ? n : n.context.parent; s; s = s.parent) if (s.index < 0) { let a = s.parent; (i || (i = [n])).push(a.resolve(e, r)), s = a; } else { - let a = Hy.get(s.tree); + let a = b2.get(s.tree); if (a && a.overlay && a.overlay[0].from <= e && a.overlay[a.overlay.length - 1].to >= e) { - let o = new zs(a.tree, a.overlay[0].from + s.from, -1, s); - (i || (i = [n])).push(Zy(o, e, r, !1)); + let o = new ea(a.tree, a.overlay[0].from + s.from, -1, s); + (i || (i = [n])).push(x2(o, e, r, !1)); } } - return i ? fJ(i) : n; + return i ? GJ(i) : n; } -class W5 { +class bk { get name() { return this.type.name; } constructor(e, r = 0) { - if (this.mode = r, this.buffer = null, this.stack = [], this.index = 0, this.bufferNode = null, e instanceof zs) + if (this.mode = r, this.buffer = null, this.stack = [], this.index = 0, this.bufferNode = null, e instanceof ea) this.yieldNode(e); else { this._tree = e.context.parent, this.buffer = e.context; @@ -10740,7 +10740,7 @@ class W5 { return this.type = r || i.set.types[i.buffer[e]], this.from = n + i.buffer[e + 1], this.to = n + i.buffer[e + 2], !0; } yield(e) { - return e ? e instanceof zs ? (this.buffer = null, this.yieldNode(e)) : (this.buffer = e.context, this.yieldBuf(e.index, e.type)) : !1; + return e ? e instanceof ea ? (this.buffer = null, this.yieldNode(e)) : (this.buffer = e.context, this.yieldBuf(e.index, e.type)) : !1; } toString() { return this.buffer ? this.buffer.buffer.childString(this.index) : this._tree.toString(); @@ -10764,14 +10764,14 @@ class W5 { return this.enterChild(-1, e, -2); } enter(e, r, n = this.mode) { - return this.buffer ? n & hn.ExcludeBuffers ? !1 : this.enterChild(1, e, r) : this.yield(this._tree.enter(e, r, n)); + return this.buffer ? n & Sn.ExcludeBuffers ? !1 : this.enterChild(1, e, r) : this.yield(this._tree.enter(e, r, n)); } parent() { if (!this.buffer) - return this.yieldNode(this.mode & hn.IncludeAnonymous ? this._tree._parent : this._tree.parent); + return this.yieldNode(this.mode & Sn.IncludeAnonymous ? this._tree._parent : this._tree.parent); if (this.stack.length) return this.yieldBuf(this.stack.pop()); - let e = this.mode & hn.IncludeAnonymous ? this.buffer.parent : this.buffer.parent.nextSignificantParent(); + let e = this.mode & Sn.IncludeAnonymous ? this.buffer.parent : this.buffer.parent.nextSignificantParent(); return this.buffer = null, this.yieldNode(e); } sibling(e) { @@ -10812,7 +10812,7 @@ class W5 { if (r > -1) for (let s = r + e, a = e < 0 ? -1 : n._tree.children.length; s != a; s += e) { let o = n._tree.children[s]; - if (this.mode & hn.IncludeAnonymous || o instanceof vf || !o.type.isAnonymous || CM(o)) + if (this.mode & Sn.IncludeAnonymous || o instanceof Nf || !o.type.isAnonymous || tD(o)) return !1; } return !0; @@ -10858,8 +10858,8 @@ class W5 { } } for (let i = n; i < this.stack.length; i++) - r = new xc(this.buffer, r, this.stack[i]); - return this.bufferNode = new xc(this.buffer, r, this.index); + r = new Fc(this.buffer, r, this.stack[i]); + return this.bufferNode = new Fc(this.buffer, r, this.index); } get tree() { return this.buffer ? null : this._tree._tree; @@ -10885,11 +10885,11 @@ class W5 { } matchContext(e) { if (!this.buffer) - return q7(this.node.parent, e); + return b8(this.node.parent, e); let { buffer: r } = this.buffer, { types: n } = r.set; for (let i = e.length - 1, s = this.stack.length - 1; i >= 0; s--) { if (s < 0) - return q7(this._tree, e, i); + return b8(this._tree, e, i); let a = n[r.buffer[this.stack[s]]]; if (!a.isAnonymous) { if (e[i] && e[i] != a.name) @@ -10900,12 +10900,12 @@ class W5 { return !0; } } -function CM(t) { - return t.children.some((e) => e instanceof vf || !e.type.isAnonymous || CM(e)); +function tD(t) { + return t.children.some((e) => e instanceof Nf || !e.type.isAnonymous || tD(e)); } -function GOe(t) { +function $4e(t) { var e; - let { buffer: r, nodeSet: n, maxBufferLength: i = cJ, reused: s = [], minRepeatType: a = n.types.length } = t, o = Array.isArray(r) ? new TM(r, r.length) : r, l = n.types, u = 0, h = 0; + let { buffer: r, nodeSet: n, maxBufferLength: i = qJ, reused: s = [], minRepeatType: a = n.types.length } = t, o = Array.isArray(r) ? new eD(r, r.length) : r, l = n.types, u = 0, h = 0; function f(S, C, T, A, E, R) { let { id: _, start: L, end: $, size: k } = o, N = h, M = u; for (; k < 0; ) @@ -10926,16 +10926,16 @@ function GOe(t) { let B = new Uint16Array(I.size - I.skip), Q = o.pos - I.size, q = B.length; for (; o.pos > Q; ) q = y(I.start, B, q); - P = new vf(B, $ - I.start, n), F = I.start - S; + P = new Nf(B, $ - I.start, n), F = I.start - S; } else { let B = o.pos - k; o.next(); - let Q = [], q = [], W = _ >= a ? _ : -1, J = 0, Y = $; + let Q = [], q = [], W = _ >= a ? _ : -1, ee = 0, Y = $; for (; o.pos > B; ) - W >= 0 && o.id == W && o.size >= 0 ? (o.end <= Y - i && (g(Q, q, L, J, o.end, Y, W, N, M), J = Q.length, Y = o.end), o.next()) : R > 2500 ? d(L, B, Q, q) : f(L, B, Q, q, W, R + 1); - if (W >= 0 && J > 0 && J < Q.length && g(Q, q, L, J, L, Y, W, N, M), Q.reverse(), q.reverse(), W > -1 && J > 0) { - let ne = p(D, M); - P = EM(D, Q, q, 0, Q.length, 0, $ - L, ne, ne); + W >= 0 && o.id == W && o.size >= 0 ? (o.end <= Y - i && (g(Q, q, L, ee, o.end, Y, W, N, M), ee = Q.length, Y = o.end), o.next()) : R > 2500 ? d(L, B, Q, q) : f(L, B, Q, q, W, R + 1); + if (W >= 0 && ee > 0 && ee < Q.length && g(Q, q, L, ee, L, Y, W, N, M), Q.reverse(), q.reverse(), W > -1 && ee > 0) { + let re = p(D, M); + P = rD(D, Q, q, 0, Q.length, 0, $ - L, re, re); } else P = m(D, Q, q, $ - L, N - $, M); } @@ -10957,16 +10957,16 @@ function GOe(t) { let L = new Uint16Array(R * 4), $ = E[E.length - 2]; for (let k = E.length - 3, N = 0; k >= 0; k -= 3) L[N++] = E[k], L[N++] = E[k + 1] - $, L[N++] = E[k + 2] - $, L[N++] = N; - T.push(new vf(L, E[2] - $, n)), A.push($ - S); + T.push(new Nf(L, E[2] - $, n)), A.push($ - S); } } function p(S, C) { return (T, A, E) => { let R = 0, _ = T.length - 1, L, $; - if (_ >= 0 && (L = T[_]) instanceof Yr) { + if (_ >= 0 && (L = T[_]) instanceof nn) { if (!_ && L.type == S && L.length == E) return L; - ($ = L.prop(or.lookAhead)) && (R = A[_] + L.length + $); + ($ = L.prop(yr.lookAhead)) && (R = A[_] + L.length + $); } return m(S, T, A, E, R, C); }; @@ -10979,14 +10979,14 @@ function GOe(t) { } function m(S, C, T, A, E, R, _) { if (R) { - let L = [or.contextHash, R]; + let L = [yr.contextHash, R]; _ = _ ? [L].concat(_) : [L]; } if (E > 25) { - let L = [or.lookAhead, E]; + let L = [yr.lookAhead, E]; _ = _ ? [L].concat(_) : [L]; } - return new Yr(S, C, T, A, _); + return new nn(S, C, T, A, _); } function v(S, C) { let T = o.fork(), A = 0, E = 0, R = 0, _ = T.end - i, L = { size: 0, start: 0, skip: 0 }; @@ -11033,36 +11033,36 @@ function GOe(t) { for (; o.pos > 0; ) f(t.start || 0, t.bufferStart || 0, b, w, -1, 0); let O = (e = t.length) !== null && e !== void 0 ? e : b.length ? w[0] + b[0].length : 0; - return new Yr(l[t.topID], b.reverse(), w.reverse(), O); + return new nn(l[t.topID], b.reverse(), w.reverse(), O); } -const IF = /* @__PURE__ */ new WeakMap(); -function D4(t, e) { - if (!t.isAnonymous || e instanceof vf || e.type != t) +const vz = /* @__PURE__ */ new WeakMap(); +function a5(t, e) { + if (!t.isAnonymous || e instanceof Nf || e.type != t) return 1; - let r = IF.get(e); + let r = vz.get(e); if (r == null) { r = 1; for (let n of e.children) { - if (n.type != t || !(n instanceof Yr)) { + if (n.type != t || !(n instanceof nn)) { r = 1; break; } - r += D4(t, n); + r += a5(t, n); } - IF.set(e, r); + vz.set(e, r); } return r; } -function EM(t, e, r, n, i, s, a, o, l) { +function rD(t, e, r, n, i, s, a, o, l) { let u = 0; for (let g = n; g < i; g++) - u += D4(t, e[g]); + u += a5(t, e[g]); let h = Math.ceil(u * 1.5 / 8), f = [], d = []; function p(g, m, v, y, b) { for (let w = v; w < y; ) { - let O = w, S = m[w], C = D4(t, g[w]); + let O = w, S = m[w], C = a5(t, g[w]); for (w++; w < y; w++) { - let T = D4(t, g[w]); + let T = a5(t, g[w]); if (C + T >= h) break; C += T; @@ -11076,14 +11076,14 @@ function EM(t, e, r, n, i, s, a, o, l) { f.push(g[O]); } else { let T = m[w - 1] + g[w - 1].length - S; - f.push(EM(t, g, m, O, w, S, T, null, l)); + f.push(rD(t, g, m, O, w, S, T, null, l)); } d.push(S + b - s); } } return p(e, r, n, i, 0), (o || l)(f, d, a); } -class dJ { +class XJ { constructor() { this.map = /* @__PURE__ */ new WeakMap(); } @@ -11096,10 +11096,10 @@ class dJ { return n && n.get(r); } set(e, r) { - e instanceof xc ? this.setBuffer(e.context.buffer, e.index, r) : e instanceof zs && this.map.set(e.tree, r); + e instanceof Fc ? this.setBuffer(e.context.buffer, e.index, r) : e instanceof ea && this.map.set(e.tree, r); } get(e) { - return e instanceof xc ? this.getBuffer(e.context.buffer, e.index) : e instanceof zs ? this.map.get(e.tree) : void 0; + return e instanceof Fc ? this.getBuffer(e.context.buffer, e.index) : e instanceof ea ? this.map.get(e.tree) : void 0; } cursorSet(e, r) { e.buffer ? this.setBuffer(e.buffer.buffer, e.index, r) : this.map.set(e.tree, r); @@ -11108,7 +11108,7 @@ class dJ { return e.buffer ? this.getBuffer(e.buffer.buffer, e.index) : this.map.get(e.tree); } } -class Du { +class ju { constructor(e, r, n, i, s = !1, a = !1) { this.from = e, this.to = r, this.tree = n, this.offset = i, this.open = (s ? 1 : 0) | (a ? 2 : 0); } @@ -11119,7 +11119,7 @@ class Du { return (this.open & 2) > 0; } static addTree(e, r = [], n = !1) { - let i = [new Du(0, e.length, e, 0, !1, n)]; + let i = [new ju(0, e.length, e, 0, !1, n)]; for (let s of r) s.to > e.length && i.push(s); return i; @@ -11135,7 +11135,7 @@ class Du { let d = a; if (l >= d.from || f <= d.to || u) { let p = Math.max(d.from, l) - u, g = Math.min(d.to, f) - u; - d = p >= g ? null : new Du(p, g, d.tree, d.offset + u, o > 0, !!h); + d = p >= g ? null : new ju(p, g, d.tree, d.offset + u, o > 0, !!h); } if (d && i.push(d), a.to > f) break; @@ -11148,9 +11148,9 @@ class Du { return i; } } -class _M { +class nD { startParse(e, r, n) { - return typeof e == "string" && (e = new XOe(e)), n = n ? n.length ? n.map((i) => new Io(i.from, i.to)) : [new Io(0, 0)] : [new Io(0, e.length)], this.createParse(e, r || [], n); + return typeof e == "string" && (e = new B4e(e)), n = n ? n.length ? n.map((i) => new Jo(i.from, i.to)) : [new Jo(0, 0)] : [new Jo(0, e.length)], this.createParse(e, r || [], n); } parse(e, r, n) { let i = this.startParse(e, r, n); @@ -11161,7 +11161,7 @@ class _M { } } } -class XOe { +class B4e { constructor(e) { this.string = e; } @@ -11178,25 +11178,25 @@ class XOe { return this.string.slice(e, r); } } -function pJ(t) { - return (e, r, n, i) => new ZOe(e, t, r, n, i); +function HJ(t) { + return (e, r, n, i) => new z4e(e, t, r, n, i); } -class $F { +class yz { constructor(e, r, n, i, s) { this.parser = e, this.parse = r, this.overlay = n, this.target = i, this.from = s; } } -function BF(t) { +function bz(t) { if (!t.length || t.some((e) => e.from >= e.to)) throw new RangeError("Invalid inner parse ranges given: " + JSON.stringify(t)); } -class HOe { +class F4e { constructor(e, r, n, i, s, a, o) { this.parser = e, this.predicate = r, this.mounts = n, this.index = i, this.start = s, this.target = a, this.prev = o, this.depth = 0, this.ranges = []; } } -const Y7 = new or({ perNode: !0 }); -class ZOe { +const x8 = new yr({ perNode: !0 }); +class z4e { constructor(e, r, n, i, s) { this.nest = r, this.input = n, this.fragments = i, this.ranges = s, this.inner = [], this.innerDone = 0, this.baseTree = null, this.stoppedAt = null, this.baseParse = e; } @@ -11211,13 +11211,13 @@ class ZOe { } if (this.innerDone == this.inner.length) { let n = this.baseTree; - return this.stoppedAt != null && (n = new Yr(n.type, n.children, n.positions, n.length, n.propValues.concat([[Y7, this.stoppedAt]]))), n; + return this.stoppedAt != null && (n = new nn(n.type, n.children, n.positions, n.length, n.propValues.concat([[x8, this.stoppedAt]]))), n; } let e = this.inner[this.innerDone], r = e.parse.advance(); if (r) { this.innerDone++; let n = Object.assign(/* @__PURE__ */ Object.create(null), e.target.props); - n[or.mounted.id] = new Hy(r, e.overlay, e.parser), e.target.props = n; + n[yr.mounted.id] = new b2(r, e.overlay, e.parser), e.target.props = n; } return null; } @@ -11237,7 +11237,7 @@ class ZOe { this.inner[r].parse.stopAt(e); } startInner() { - let e = new JOe(this.fragments), r = null, n = null, i = new W5(new zs(this.baseTree, this.ranges[0].from, 0, null), hn.IncludeAnonymous | hn.IgnoreMounts); + let e = new V4e(this.fragments), r = null, n = null, i = new bk(new ea(this.baseTree, this.ranges[0].from, 0, null), Sn.IncludeAnonymous | Sn.IgnoreMounts); e: for (let s, a; ; ) { let o = !0, l; @@ -11253,18 +11253,18 @@ class ZOe { } } o = !1; - } else if (n && (a = jOe(n.ranges, i.from, i.to))) + } else if (n && (a = Q4e(n.ranges, i.from, i.to))) o = a != 2; else if (!i.type.isAnonymous && (s = this.nest(i, this.input)) && (i.from < i.to || !s.overlay)) { - i.tree || KOe(i); + i.tree || U4e(i); let u = e.findMounts(i.from, s.parser); if (typeof s.overlay == "function") - r = new HOe(s.parser, s.overlay, u, this.inner.length, i.from, i.tree, r); + r = new F4e(s.parser, s.overlay, u, this.inner.length, i.from, i.tree, r); else { - let h = QF(this.ranges, s.overlay || (i.from < i.to ? [new Io(i.from, i.to)] : [])); - h.length && BF(h), (h.length || !s.overlay) && this.inner.push(new $F(s.parser, h.length ? s.parser.startParse(this.input, UF(u, h), h) : s.parser.startParse(""), s.overlay ? s.overlay.map((f) => new Io(f.from - i.from, f.to - i.from)) : null, i.tree, h.length ? h[0].from : i.from)), s.overlay ? h.length && (n = { ranges: h, depth: 0, prev: n }) : o = !1; + let h = Oz(this.ranges, s.overlay || (i.from < i.to ? [new Jo(i.from, i.to)] : [])); + h.length && bz(h), (h.length || !s.overlay) && this.inner.push(new yz(s.parser, h.length ? s.parser.startParse(this.input, kz(u, h), h) : s.parser.startParse(""), s.overlay ? s.overlay.map((f) => new Jo(f.from - i.from, f.to - i.from)) : null, i.tree, h.length ? h[0].from : i.from)), s.overlay ? h.length && (n = { ranges: h, depth: 0, prev: n }) : o = !1; } - } else if (r && (l = r.predicate(i)) && (l === !0 && (l = new Io(i.from, i.to)), l.from < l.to)) { + } else if (r && (l = r.predicate(i)) && (l === !0 && (l = new Jo(i.from, i.to)), l.from < l.to)) { let u = r.ranges.length - 1; u >= 0 && r.ranges[u].to == l.from ? r.ranges[u] = { from: r.ranges[u].from, to: l.to } : r.ranges.push(l); } @@ -11275,15 +11275,15 @@ class ZOe { if (!i.parent()) break e; if (r && !--r.depth) { - let u = QF(this.ranges, r.ranges); - u.length && (BF(u), this.inner.splice(r.index, 0, new $F(r.parser, r.parser.startParse(this.input, UF(r.mounts, u), u), r.ranges.map((h) => new Io(h.from - r.start, h.to - r.start)), r.target, u[0].from))), r = r.prev; + let u = Oz(this.ranges, r.ranges); + u.length && (bz(u), this.inner.splice(r.index, 0, new yz(r.parser, r.parser.startParse(this.input, kz(r.mounts, u), u), r.ranges.map((h) => new Jo(h.from - r.start, h.to - r.start)), r.target, u[0].from))), r = r.prev; } n && !--n.depth && (n = n.prev); } } } } -function jOe(t, e, r) { +function Q4e(t, e, r) { for (let n of t) { if (n.from >= r) break; @@ -11292,13 +11292,13 @@ function jOe(t, e, r) { } return 0; } -function FF(t, e, r, n, i, s) { +function xz(t, e, r, n, i, s) { if (e < r) { let a = t.buffer[e + 1]; n.push(t.slice(e, r, a)), i.push(a - s); } } -function KOe(t) { +function U4e(t) { let { node: e } = t, r = [], n = e.context.buffer; do r.push(t.index), t.parent(); @@ -11306,33 +11306,33 @@ function KOe(t) { let i = t.tree, s = i.children.indexOf(n), a = i.children[s], o = a.buffer, l = [s]; function u(h, f, d, p, g, m) { let v = r[m], y = [], b = []; - FF(a, h, v, y, b, p); + xz(a, h, v, y, b, p); let w = o[v + 1], O = o[v + 2]; l.push(y.length); let S = m ? u(v + 4, o[v + 3], a.set.types[o[v]], w, O - w, m - 1) : e.toTree(); - return y.push(S), b.push(w - p), FF(a, o[v + 3], f, y, b, p), new Yr(d, y, b, g); + return y.push(S), b.push(w - p), xz(a, o[v + 3], f, y, b, p), new nn(d, y, b, g); } - i.children[s] = u(0, o.length, Mi.none, 0, a.length, r.length - 1); + i.children[s] = u(0, o.length, Yi.none, 0, a.length, r.length - 1); for (let h of l) { let f = t.tree.children[h], d = t.tree.positions[h]; - t.yield(new zs(f, d + t.from, h, t._tree)); + t.yield(new ea(f, d + t.from, h, t._tree)); } } -class zF { +class wz { constructor(e, r) { - this.offset = r, this.done = !1, this.cursor = e.cursor(hn.IncludeAnonymous | hn.IgnoreMounts); + this.offset = r, this.done = !1, this.cursor = e.cursor(Sn.IncludeAnonymous | Sn.IgnoreMounts); } moveTo(e) { let { cursor: r } = this, n = e - this.offset; for (; !this.done && r.from < n; ) - r.to >= e && r.enter(n, 1, hn.IgnoreOverlays | hn.ExcludeBuffers) || r.next(!1) || (this.done = !0); + r.to >= e && r.enter(n, 1, Sn.IgnoreOverlays | Sn.ExcludeBuffers) || r.next(!1) || (this.done = !0); } hasNode(e) { if (this.moveTo(e.from), !this.done && this.cursor.from + this.offset == e.from && this.cursor.tree) for (let r = this.cursor.tree; ; ) { if (r == e.tree) return !0; - if (r.children.length && r.positions[0] == 0 && r.children[0] instanceof Yr) + if (r.children.length && r.positions[0] == 0 && r.children[0] instanceof nn) r = r.children[0]; else break; @@ -11340,12 +11340,12 @@ class zF { return !1; } } -class JOe { +class V4e { constructor(e) { var r; if (this.fragments = e, this.curTo = 0, this.fragI = 0, e.length) { let n = this.curFrag = e[0]; - this.curTo = (r = n.tree.prop(Y7)) !== null && r !== void 0 ? r : n.to, this.inner = new zF(n.tree, -n.offset); + this.curTo = (r = n.tree.prop(x8)) !== null && r !== void 0 ? r : n.to, this.inner = new wz(n.tree, -n.offset); } else this.curFrag = this.inner = null; } @@ -11360,7 +11360,7 @@ class JOe { this.curFrag = this.inner = null; else { let r = this.curFrag = this.fragments[this.fragI]; - this.curTo = (e = r.tree.prop(Y7)) !== null && e !== void 0 ? e : r.to, this.inner = new zF(r.tree, -r.offset); + this.curTo = (e = r.tree.prop(x8)) !== null && e !== void 0 ? e : r.to, this.inner = new wz(r.tree, -r.offset); } } findMounts(e, r) { @@ -11369,7 +11369,7 @@ class JOe { if (this.inner) { this.inner.cursor.moveTo(e, 1); for (let s = this.inner.cursor.node; s; s = s.parent) { - let a = (n = s.tree) === null || n === void 0 ? void 0 : n.prop(or.mounted); + let a = (n = s.tree) === null || n === void 0 ? void 0 : n.prop(yr.mounted); if (a && a.parser == r) for (let o = this.fragI; o < this.fragments.length; o++) { let l = this.fragments[o]; @@ -11386,7 +11386,7 @@ class JOe { return i; } } -function QF(t, e) { +function Oz(t, e) { let r = null, n = e; for (let i = 1, s = 0; i < t.length; i++) { let a = t[i - 1].to, o = t[i].from; @@ -11394,18 +11394,18 @@ function QF(t, e) { let l = n[s]; if (l.from >= o) break; - l.to <= a || (r || (n = r = e.slice()), l.from < a ? (r[s] = new Io(l.from, a), l.to > o && r.splice(s + 1, 0, new Io(o, l.to))) : l.to > o ? r[s--] = new Io(o, l.to) : r.splice(s--, 1)); + l.to <= a || (r || (n = r = e.slice()), l.from < a ? (r[s] = new Jo(l.from, a), l.to > o && r.splice(s + 1, 0, new Jo(o, l.to))) : l.to > o ? r[s--] = new Jo(o, l.to) : r.splice(s--, 1)); } } return n; } -function e4e(t, e, r, n) { +function q4e(t, e, r, n) { let i = 0, s = 0, a = !1, o = !1, l = -1e9, u = []; for (; ; ) { let h = i == t.length ? 1e9 : a ? t[i].to : t[i].from, f = s == e.length ? 1e9 : o ? e[s].to : e[s].from; if (a != o) { let d = Math.max(l, r), p = Math.min(h, f, n); - d < p && u.push(new Io(d, p)); + d < p && u.push(new Jo(d, p)); } if (l = Math.min(h, f), l == 1e9) break; @@ -11413,75 +11413,75 @@ function e4e(t, e, r, n) { } return u; } -function UF(t, e) { +function kz(t, e) { let r = []; for (let { pos: n, mount: i, frag: s } of t) { let a = n + (i.overlay ? i.overlay[0].from : 0), o = a + i.tree.length, l = Math.max(s.from, a), u = Math.min(s.to, o); if (i.overlay) { - let h = i.overlay.map((d) => new Io(d.from + n, d.to + n)), f = e4e(e, h, l, u); + let h = i.overlay.map((d) => new Jo(d.from + n, d.to + n)), f = q4e(e, h, l, u); for (let d = 0, p = l; ; d++) { let g = d == f.length, m = g ? u : f[d].from; - if (m > p && r.push(new Du(p, m, i.tree, -a, s.from >= p || s.openStart, s.to <= m || s.openEnd)), g) + if (m > p && r.push(new ju(p, m, i.tree, -a, s.from >= p || s.openStart, s.to <= m || s.openEnd)), g) break; p = f[d].to; } } else - r.push(new Du(l, u, i.tree, -a, s.from >= a || s.openStart, s.to <= o || s.openEnd)); + r.push(new ju(l, u, i.tree, -a, s.from >= a || s.openStart, s.to <= o || s.openEnd)); } return r; } -let t4e = 0; -class yl { +let Y4e = 0; +class Il { constructor(e, r, n) { - this.set = e, this.base = r, this.modified = n, this.id = t4e++; + this.set = e, this.base = r, this.modified = n, this.id = Y4e++; } static define(e) { if (e != null && e.base) throw new Error("Can not derive from a modified tag"); - let r = new yl([], null, []); + let r = new Il([], null, []); if (r.set.push(r), e) for (let n of e.set) r.set.push(n); return r; } static defineModifier() { - let e = new G5(); - return (r) => r.modified.indexOf(e) > -1 ? r : G5.get(r.base || r, r.modified.concat(e).sort((n, i) => n.id - i.id)); + let e = new xk(); + return (r) => r.modified.indexOf(e) > -1 ? r : xk.get(r.base || r, r.modified.concat(e).sort((n, i) => n.id - i.id)); } } -let r4e = 0; -class G5 { +let W4e = 0; +class xk { constructor() { - this.instances = [], this.id = r4e++; + this.instances = [], this.id = W4e++; } static get(e, r) { if (!r.length) return e; - let n = r[0].instances.find((o) => o.base == e && n4e(r, o.modified)); + let n = r[0].instances.find((o) => o.base == e && G4e(r, o.modified)); if (n) return n; - let i = [], s = new yl(i, e, r); + let i = [], s = new Il(i, e, r); for (let o of r) o.instances.push(s); - let a = i4e(r); + let a = X4e(r); for (let o of e.set) if (!o.modified.length) for (let l of a) - i.push(G5.get(o, l)); + i.push(xk.get(o, l)); return s; } } -function n4e(t, e) { +function G4e(t, e) { return t.length == e.length && t.every((r, n) => r == e[n]); } -function i4e(t) { +function X4e(t) { let e = [[]]; for (let r = 0; r < t.length; r++) for (let n = 0, i = e.length; n < i; n++) e.push(e[n].concat(t[r])); return e.sort((r, n) => n.length - r.length); } -function Xf(t) { +function fd(t) { let e = /* @__PURE__ */ Object.create(null); for (let r in t) { let n = t[r]; @@ -11511,14 +11511,14 @@ function Xf(t) { let l = s.length - 1, u = s[l]; if (!u) throw new RangeError("Invalid path: " + i); - let h = new X5(n, a, l > 0 ? s.slice(0, l) : null); + let h = new wk(n, a, l > 0 ? s.slice(0, l) : null); e[u] = h.sort(e[u]); } } - return gJ.add(e); + return ZJ.add(e); } -const gJ = new or(); -class X5 { +const ZJ = new yr(); +class wk { constructor(e, r, n, i) { this.tags = e, this.mode = r, this.context = n, this.next = i; } @@ -11535,8 +11535,8 @@ class X5 { return this.context ? this.context.length : 0; } } -X5.empty = new X5([], 2, null); -function mJ(t, e) { +wk.empty = new wk([], 2, null); +function jJ(t, e) { let r = /* @__PURE__ */ Object.create(null); for (let s of t) if (!Array.isArray(s.tag)) @@ -11561,7 +11561,7 @@ function mJ(t, e) { scope: n }; } -function s4e(t, e) { +function H4e(t, e) { let r = null; for (let n of t) { let i = n.style(e); @@ -11569,11 +11569,11 @@ function s4e(t, e) { } return r; } -function a4e(t, e, r, n = 0, i = t.length) { - let s = new o4e(n, Array.isArray(e) ? e : [e], r); +function Z4e(t, e, r, n = 0, i = t.length) { + let s = new j4e(n, Array.isArray(e) ? e : [e], r); s.highlightRange(t.cursor(), n, i, "", s.highlighters), s.flush(i); } -class o4e { +class j4e { constructor(e, r, n) { this.at = e, this.highlighters = r, this.span = n, this.class = ""; } @@ -11588,10 +11588,10 @@ class o4e { if (o >= n || l <= r) return; a.isTop && (s = this.highlighters.filter((p) => !p.scope || p.scope(a))); - let u = i, h = l4e(e) || X5.empty, f = s4e(s, h.tags); + let u = i, h = K4e(e) || wk.empty, f = H4e(s, h.tags); if (f && (u && (u += " "), u += f, h.mode == 1 && (i += (i ? " " : "") + f)), this.startSpan(Math.max(r, o), u), h.opaque) return; - let d = e.tree && e.tree.prop(or.mounted); + let d = e.tree && e.tree.prop(yr.mounted); if (d && d.overlay) { let p = e.node.enter(d.overlay[0].from + o, 1), g = this.highlighters.filter((v) => !v.scope || v.scope(d.tree.type)), m = e.firstChild(); for (let v = 0, y = o; ; v++) { @@ -11617,149 +11617,149 @@ class o4e { } } } -function l4e(t) { - let e = t.type.prop(gJ); +function K4e(t) { + let e = t.type.prop(ZJ); for (; e && e.context && !t.matchContext(e.context); ) e = e.next; return e || null; } -const wt = yl.define, Yw = wt(), Rh = wt(), VF = wt(Rh), qF = wt(Rh), Mh = wt(), Ww = wt(Mh), ZE = wt(Mh), lc = wt(), od = wt(lc), nc = wt(), ic = wt(), W7 = wt(), G1 = wt(W7), Gw = wt(), we = { - comment: Yw, - lineComment: wt(Yw), - blockComment: wt(Yw), - docComment: wt(Yw), - name: Rh, - variableName: wt(Rh), - typeName: VF, - tagName: wt(VF), - propertyName: qF, - attributeName: wt(qF), - className: wt(Rh), - labelName: wt(Rh), - namespace: wt(Rh), - macroName: wt(Rh), - literal: Mh, - string: Ww, - docString: wt(Ww), - character: wt(Ww), - attributeValue: wt(Ww), - number: ZE, - integer: wt(ZE), - float: wt(ZE), - bool: wt(Mh), - regexp: wt(Mh), - escape: wt(Mh), - color: wt(Mh), - url: wt(Mh), - keyword: nc, - self: wt(nc), - null: wt(nc), - atom: wt(nc), - unit: wt(nc), - modifier: wt(nc), - operatorKeyword: wt(nc), - controlKeyword: wt(nc), - definitionKeyword: wt(nc), - moduleKeyword: wt(nc), - operator: ic, - derefOperator: wt(ic), - arithmeticOperator: wt(ic), - logicOperator: wt(ic), - bitwiseOperator: wt(ic), - compareOperator: wt(ic), - updateOperator: wt(ic), - definitionOperator: wt(ic), - typeOperator: wt(ic), - controlOperator: wt(ic), - punctuation: W7, - separator: wt(W7), - bracket: G1, - angleBracket: wt(G1), - squareBracket: wt(G1), - paren: wt(G1), - brace: wt(G1), - content: lc, - heading: od, - heading1: wt(od), - heading2: wt(od), - heading3: wt(od), - heading4: wt(od), - heading5: wt(od), - heading6: wt(od), - contentSeparator: wt(lc), - list: wt(lc), - quote: wt(lc), - emphasis: wt(lc), - strong: wt(lc), - link: wt(lc), - monospace: wt(lc), - strikethrough: wt(lc), - inserted: wt(), - deleted: wt(), - changed: wt(), - invalid: wt(), - meta: Gw, - documentMeta: wt(Gw), - annotation: wt(Gw), - processingInstruction: wt(Gw), - definition: yl.defineModifier(), - constant: yl.defineModifier(), - function: yl.defineModifier(), - standard: yl.defineModifier(), - local: yl.defineModifier(), - special: yl.defineModifier() -}; -mJ([ - { tag: we.link, class: "tok-link" }, - { tag: we.heading, class: "tok-heading" }, - { tag: we.emphasis, class: "tok-emphasis" }, - { tag: we.strong, class: "tok-strong" }, - { tag: we.keyword, class: "tok-keyword" }, - { tag: we.atom, class: "tok-atom" }, - { tag: we.bool, class: "tok-bool" }, - { tag: we.url, class: "tok-url" }, - { tag: we.labelName, class: "tok-labelName" }, - { tag: we.inserted, class: "tok-inserted" }, - { tag: we.deleted, class: "tok-deleted" }, - { tag: we.literal, class: "tok-literal" }, - { tag: we.string, class: "tok-string" }, - { tag: we.number, class: "tok-number" }, - { tag: [we.regexp, we.escape, we.special(we.string)], class: "tok-string2" }, - { tag: we.variableName, class: "tok-variableName" }, - { tag: we.local(we.variableName), class: "tok-variableName tok-local" }, - { tag: we.definition(we.variableName), class: "tok-variableName tok-definition" }, - { tag: we.special(we.variableName), class: "tok-variableName2" }, - { tag: we.definition(we.propertyName), class: "tok-propertyName tok-definition" }, - { tag: we.typeName, class: "tok-typeName" }, - { tag: we.namespace, class: "tok-namespace" }, - { tag: we.className, class: "tok-className" }, - { tag: we.macroName, class: "tok-macroName" }, - { tag: we.propertyName, class: "tok-propertyName" }, - { tag: we.operator, class: "tok-operator" }, - { tag: we.comment, class: "tok-comment" }, - { tag: we.meta, class: "tok-meta" }, - { tag: we.invalid, class: "tok-invalid" }, - { tag: we.punctuation, class: "tok-punctuation" } +const Rt = Il.define, yO = Rt(), Hh = Rt(), Sz = Rt(Hh), Tz = Rt(Hh), Zh = Rt(), bO = Rt(Zh), T_ = Rt(Zh), Ec = Rt(), Cd = Rt(Ec), Oc = Rt(), kc = Rt(), w8 = Rt(), vv = Rt(w8), xO = Rt(), Se = { + comment: yO, + lineComment: Rt(yO), + blockComment: Rt(yO), + docComment: Rt(yO), + name: Hh, + variableName: Rt(Hh), + typeName: Sz, + tagName: Rt(Sz), + propertyName: Tz, + attributeName: Rt(Tz), + className: Rt(Hh), + labelName: Rt(Hh), + namespace: Rt(Hh), + macroName: Rt(Hh), + literal: Zh, + string: bO, + docString: Rt(bO), + character: Rt(bO), + attributeValue: Rt(bO), + number: T_, + integer: Rt(T_), + float: Rt(T_), + bool: Rt(Zh), + regexp: Rt(Zh), + escape: Rt(Zh), + color: Rt(Zh), + url: Rt(Zh), + keyword: Oc, + self: Rt(Oc), + null: Rt(Oc), + atom: Rt(Oc), + unit: Rt(Oc), + modifier: Rt(Oc), + operatorKeyword: Rt(Oc), + controlKeyword: Rt(Oc), + definitionKeyword: Rt(Oc), + moduleKeyword: Rt(Oc), + operator: kc, + derefOperator: Rt(kc), + arithmeticOperator: Rt(kc), + logicOperator: Rt(kc), + bitwiseOperator: Rt(kc), + compareOperator: Rt(kc), + updateOperator: Rt(kc), + definitionOperator: Rt(kc), + typeOperator: Rt(kc), + controlOperator: Rt(kc), + punctuation: w8, + separator: Rt(w8), + bracket: vv, + angleBracket: Rt(vv), + squareBracket: Rt(vv), + paren: Rt(vv), + brace: Rt(vv), + content: Ec, + heading: Cd, + heading1: Rt(Cd), + heading2: Rt(Cd), + heading3: Rt(Cd), + heading4: Rt(Cd), + heading5: Rt(Cd), + heading6: Rt(Cd), + contentSeparator: Rt(Ec), + list: Rt(Ec), + quote: Rt(Ec), + emphasis: Rt(Ec), + strong: Rt(Ec), + link: Rt(Ec), + monospace: Rt(Ec), + strikethrough: Rt(Ec), + inserted: Rt(), + deleted: Rt(), + changed: Rt(), + invalid: Rt(), + meta: xO, + documentMeta: Rt(xO), + annotation: Rt(xO), + processingInstruction: Rt(xO), + definition: Il.defineModifier(), + constant: Il.defineModifier(), + function: Il.defineModifier(), + standard: Il.defineModifier(), + local: Il.defineModifier(), + special: Il.defineModifier() +}; +jJ([ + { tag: Se.link, class: "tok-link" }, + { tag: Se.heading, class: "tok-heading" }, + { tag: Se.emphasis, class: "tok-emphasis" }, + { tag: Se.strong, class: "tok-strong" }, + { tag: Se.keyword, class: "tok-keyword" }, + { tag: Se.atom, class: "tok-atom" }, + { tag: Se.bool, class: "tok-bool" }, + { tag: Se.url, class: "tok-url" }, + { tag: Se.labelName, class: "tok-labelName" }, + { tag: Se.inserted, class: "tok-inserted" }, + { tag: Se.deleted, class: "tok-deleted" }, + { tag: Se.literal, class: "tok-literal" }, + { tag: Se.string, class: "tok-string" }, + { tag: Se.number, class: "tok-number" }, + { tag: [Se.regexp, Se.escape, Se.special(Se.string)], class: "tok-string2" }, + { tag: Se.variableName, class: "tok-variableName" }, + { tag: Se.local(Se.variableName), class: "tok-variableName tok-local" }, + { tag: Se.definition(Se.variableName), class: "tok-variableName tok-definition" }, + { tag: Se.special(Se.variableName), class: "tok-variableName2" }, + { tag: Se.definition(Se.propertyName), class: "tok-propertyName tok-definition" }, + { tag: Se.typeName, class: "tok-typeName" }, + { tag: Se.namespace, class: "tok-namespace" }, + { tag: Se.className, class: "tok-className" }, + { tag: Se.macroName, class: "tok-macroName" }, + { tag: Se.propertyName, class: "tok-propertyName" }, + { tag: Se.operator, class: "tok-operator" }, + { tag: Se.comment, class: "tok-comment" }, + { tag: Se.meta, class: "tok-meta" }, + { tag: Se.invalid, class: "tok-invalid" }, + { tag: Se.punctuation, class: "tok-punctuation" } ]); -var jE; -const zd = /* @__PURE__ */ new or(); -function AM(t) { - return At.define({ +var C_; +const s0 = /* @__PURE__ */ new yr(); +function iD(t) { + return $t.define({ combine: t ? (e) => e.concat(t) : void 0 }); } -const LM = /* @__PURE__ */ new or(); -class $o { +const sD = /* @__PURE__ */ new yr(); +class el { constructor(e, r, n = [], i = "") { - this.data = e, this.name = i, dr.prototype.hasOwnProperty("tree") || Object.defineProperty(dr.prototype, "tree", { get() { - return dn(this); + this.data = e, this.name = i, Sr.prototype.hasOwnProperty("tree") || Object.defineProperty(Sr.prototype, "tree", { get() { + return Cn(this); } }), this.parser = r, this.extension = [ - bf.of(this), - dr.languageData.of((s, a, o) => { - let l = YF(s, a, o), u = l.type.prop(zd); + $f.of(this), + Sr.languageData.of((s, a, o) => { + let l = Cz(s, a, o), u = l.type.prop(s0); if (!u) return []; - let h = s.facet(u), f = l.type.prop(LM); + let h = s.facet(u), f = l.type.prop(sD); if (f) { let d = l.resolve(a - l.from, o); for (let p of f) @@ -11773,22 +11773,22 @@ class $o { ].concat(n); } isActiveAt(e, r, n = -1) { - return YF(e, r, n).type.prop(zd) == this.data; + return Cz(e, r, n).type.prop(s0) == this.data; } findRegions(e) { - let r = e.facet(bf); + let r = e.facet($f); if ((r == null ? void 0 : r.data) == this.data) return [{ from: 0, to: e.doc.length }]; if (!r || !r.allowsNesting) return []; let n = [], i = (s, a) => { - if (s.prop(zd) == this.data) { + if (s.prop(s0) == this.data) { n.push({ from: a, to: a + s.length }); return; } - let o = s.prop(or.mounted); + let o = s.prop(yr.mounted); if (o) { - if (o.tree.prop(zd) == this.data) { + if (o.tree.prop(s0) == this.data) { if (o.overlay) for (let l of o.overlay) n.push({ from: l.from + a, to: l.to + a }); @@ -11803,45 +11803,45 @@ class $o { } for (let l = 0; l < s.children.length; l++) { let u = s.children[l]; - u instanceof Yr && i(u, s.positions[l] + a); + u instanceof nn && i(u, s.positions[l] + a); } }; - return i(dn(e), 0), n; + return i(Cn(e), 0), n; } get allowsNesting() { return !0; } } -$o.setState = /* @__PURE__ */ jt.define(); -function YF(t, e, r) { - let n = t.facet(bf), i = dn(t).topNode; +el.setState = /* @__PURE__ */ or.define(); +function Cz(t, e, r) { + let n = t.facet($f), i = Cn(t).topNode; if (!n || n.allowsNesting) - for (let s = i; s; s = s.enter(e, r, hn.ExcludeBuffers)) + for (let s = i; s; s = s.enter(e, r, Sn.ExcludeBuffers)) s.type.isTop && (i = s); return i; } -class yf extends $o { +class If extends el { constructor(e, r, n) { super(e, r, [], n), this.parser = r; } static define(e) { - let r = AM(e.languageData); - return new yf(r, e.parser.configure({ - props: [zd.add((n) => n.isTop ? r : void 0)] + let r = iD(e.languageData); + return new If(r, e.parser.configure({ + props: [s0.add((n) => n.isTop ? r : void 0)] }), e.name); } configure(e, r) { - return new yf(this.data, this.parser.configure(e), r || this.name); + return new If(this.data, this.parser.configure(e), r || this.name); } get allowsNesting() { return this.parser.hasWrappers(); } } -function dn(t) { - let e = t.field($o.state, !1); - return e ? e.tree : Yr.empty; +function Cn(t) { + let e = t.field(el.state, !1); + return e ? e.tree : nn.empty; } -class c4e { +class J4e { constructor(e) { this.doc = e, this.cursorPos = 0, this.string = "", this.cursor = e.iter(); } @@ -11862,19 +11862,19 @@ class c4e { return e < n || r >= this.cursorPos ? this.doc.sliceString(e, r) : this.string.slice(e - n, r - n); } } -let X1 = null; -class jy { +let yv = null; +class w2 { constructor(e, r, n = [], i, s, a, o, l) { this.parser = e, this.state = r, this.fragments = n, this.tree = i, this.treeLen = s, this.viewport = a, this.skipped = o, this.scheduleOn = l, this.parse = null, this.tempSkipped = []; } static create(e, r, n) { - return new jy(e, r, [], Yr.empty, 0, n, [], null); + return new w2(e, r, [], nn.empty, 0, n, [], null); } startParse() { - return this.parser.startParse(new c4e(this.state.doc), this.fragments); + return this.parser.startParse(new J4e(this.state.doc), this.fragments); } work(e, r) { - return r != null && r >= this.state.doc.length && (r = void 0), this.tree != Yr.empty && this.isDone(r != null ? r : this.state.doc.length) ? (this.takeTree(), !0) : this.withContext(() => { + return r != null && r >= this.state.doc.length && (r = void 0), this.tree != nn.empty && this.isDone(r != null ? r : this.state.doc.length) ? (this.takeTree(), !0) : this.withContext(() => { var n; if (typeof e == "number") { let i = Date.now() + e; @@ -11883,7 +11883,7 @@ class jy { for (this.parse || (this.parse = this.startParse()), r != null && (this.parse.stoppedAt == null || this.parse.stoppedAt > r) && r < this.state.doc.length && this.parse.stopAt(r); ; ) { let i = this.parse.advance(); if (i) - if (this.fragments = this.withoutTempSkipped(Du.addTree(i, this.fragments, this.parse.stoppedAt != null)), this.treeLen = (n = this.parse.stoppedAt) !== null && n !== void 0 ? n : this.state.doc.length, this.tree = i, this.parse = null, this.treeLen < (r != null ? r : this.state.doc.length)) + if (this.fragments = this.withoutTempSkipped(ju.addTree(i, this.fragments, this.parse.stoppedAt != null)), this.treeLen = (n = this.parse.stoppedAt) !== null && n !== void 0 ? n : this.state.doc.length, this.tree = i, this.parse = null, this.treeLen < (r != null ? r : this.state.doc.length)) this.parse = this.startParse(); else return !0; @@ -11897,27 +11897,27 @@ class jy { this.parse && (e = this.parse.parsedPos) >= this.treeLen && ((this.parse.stoppedAt == null || this.parse.stoppedAt > e) && this.parse.stopAt(e), this.withContext(() => { for (; !(r = this.parse.advance()); ) ; - }), this.treeLen = e, this.tree = r, this.fragments = this.withoutTempSkipped(Du.addTree(this.tree, this.fragments, !0)), this.parse = null); + }), this.treeLen = e, this.tree = r, this.fragments = this.withoutTempSkipped(ju.addTree(this.tree, this.fragments, !0)), this.parse = null); } withContext(e) { - let r = X1; - X1 = this; + let r = yv; + yv = this; try { return e(); } finally { - X1 = r; + yv = r; } } withoutTempSkipped(e) { for (let r; r = this.tempSkipped.pop(); ) - e = WF(e, r.from, r.to); + e = Ez(e, r.from, r.to); return e; } changes(e, r) { let { fragments: n, tree: i, treeLen: s, viewport: a, skipped: o } = this; if (this.takeTree(), !e.empty) { let l = []; - if (e.iterChangedRanges((u, h, f, d) => l.push({ fromA: u, toA: h, fromB: f, toB: d })), n = Du.applyChanges(n, l), i = Yr.empty, s = 0, a = { from: e.mapPos(a.from, -1), to: e.mapPos(a.to, 1) }, this.skipped.length) { + if (e.iterChangedRanges((u, h, f, d) => l.push({ fromA: u, toA: h, fromB: f, toB: d })), n = ju.applyChanges(n, l), i = nn.empty, s = 0, a = { from: e.mapPos(a.from, -1), to: e.mapPos(a.to, 1) }, this.skipped.length) { o = []; for (let u of this.skipped) { let h = e.mapPos(u.from, 1), f = e.mapPos(u.to, -1); @@ -11925,7 +11925,7 @@ class jy { } } } - return new jy(this.parser, r, n, i, s, a, o, this.scheduleOn); + return new w2(this.parser, r, n, i, s, a, o, this.scheduleOn); } updateViewport(e) { if (this.viewport.from == e.from && this.viewport.to == e.to) @@ -11934,7 +11934,7 @@ class jy { let r = this.skipped.length; for (let n = 0; n < this.skipped.length; n++) { let { from: i, to: s } = this.skipped[n]; - i < e.to && s > e.from && (this.fragments = WF(this.fragments, i, s), this.skipped.splice(n--, 1)); + i < e.to && s > e.from && (this.fragments = Ez(this.fragments, i, s), this.skipped.splice(n--, 1)); } return this.skipped.length >= r ? !1 : (this.reset(), !0); } @@ -11945,19 +11945,19 @@ class jy { this.skipped.push({ from: e, to: r }); } static getSkippingParser(e) { - return new class extends _M { + return new class extends nD { createParse(r, n, i) { let s = i[0].from, a = i[i.length - 1].to; return { parsedPos: s, advance() { - let l = X1; + let l = yv; if (l) { for (let u of i) l.tempSkipped.push(u); e && (l.scheduleOn = l.scheduleOn ? Promise.all([l.scheduleOn, e]) : e); } - return this.parsedPos = a, new Yr(Mi.none, [], [], a - s); + return this.parsedPos = a, new nn(Yi.none, [], [], a - s); }, stoppedAt: null, stopAt() { @@ -11972,13 +11972,13 @@ class jy { return this.treeLen >= e && r.length && r[0].from == 0 && r[0].to >= e; } static get() { - return X1; + return yv; } } -function WF(t, e, r) { - return Du.applyChanges(t, [{ fromA: e, toA: r, fromB: e, toB: r }]); +function Ez(t, e, r) { + return ju.applyChanges(t, [{ fromA: e, toA: r, fromB: e, toB: r }]); } -class Yg { +class fm { constructor(e) { this.context = e, this.tree = e.tree; } @@ -11986,59 +11986,59 @@ class Yg { if (!e.docChanged && this.tree == this.context.tree) return this; let r = this.context.changes(e.changes, e.state), n = this.context.treeLen == e.startState.doc.length ? void 0 : Math.max(e.changes.mapPos(this.context.treeLen), r.viewport.to); - return r.work(20, n) || r.takeTree(), new Yg(r); + return r.work(20, n) || r.takeTree(), new fm(r); } static init(e) { - let r = Math.min(3e3, e.doc.length), n = jy.create(e.facet(bf).parser, e, { from: 0, to: r }); - return n.work(20, r) || n.takeTree(), new Yg(n); + let r = Math.min(3e3, e.doc.length), n = w2.create(e.facet($f).parser, e, { from: 0, to: r }); + return n.work(20, r) || n.takeTree(), new fm(n); } } -$o.state = /* @__PURE__ */ In.define({ - create: Yg.init, +el.state = /* @__PURE__ */ Xn.define({ + create: fm.init, update(t, e) { for (let r of e.effects) - if (r.is($o.setState)) + if (r.is(el.setState)) return r.value; - return e.startState.facet(bf) != e.state.facet(bf) ? Yg.init(e.state) : t.apply(e); + return e.startState.facet($f) != e.state.facet($f) ? fm.init(e.state) : t.apply(e); } }); -let vJ = (t) => { +let KJ = (t) => { let e = setTimeout(() => t(), 500); return () => clearTimeout(e); }; -typeof requestIdleCallback < "u" && (vJ = (t) => { +typeof requestIdleCallback < "u" && (KJ = (t) => { let e = -1, r = setTimeout(() => { e = requestIdleCallback(t, { timeout: 500 - 100 }); }, 100); return () => e < 0 ? clearTimeout(r) : cancelIdleCallback(e); }); -const KE = typeof navigator < "u" && ((jE = navigator.scheduling) === null || jE === void 0 ? void 0 : jE.isInputPending) ? () => navigator.scheduling.isInputPending() : null, u4e = /* @__PURE__ */ Jr.fromClass(class { +const E_ = typeof navigator < "u" && ((C_ = navigator.scheduling) === null || C_ === void 0 ? void 0 : C_.isInputPending) ? () => navigator.scheduling.isInputPending() : null, e5e = /* @__PURE__ */ hn.fromClass(class { constructor(e) { this.view = e, this.working = null, this.workScheduled = 0, this.chunkEnd = -1, this.chunkBudget = -1, this.work = this.work.bind(this), this.scheduleWork(); } update(e) { - let r = this.view.state.field($o.state).context; + let r = this.view.state.field(el.state).context; (r.updateViewport(e.view.viewport) || this.view.viewport.to > r.treeLen) && this.scheduleWork(), (e.docChanged || e.selectionSet) && (this.view.hasFocus && (this.chunkBudget += 50), this.scheduleWork()), this.checkAsyncSchedule(r); } scheduleWork() { if (this.working) return; - let { state: e } = this.view, r = e.field($o.state); - (r.tree != r.context.tree || !r.context.isDone(e.doc.length)) && (this.working = vJ(this.work)); + let { state: e } = this.view, r = e.field(el.state); + (r.tree != r.context.tree || !r.context.isDone(e.doc.length)) && (this.working = KJ(this.work)); } work(e) { this.working = null; let r = Date.now(); if (this.chunkEnd < r && (this.chunkEnd < 0 || this.view.hasFocus) && (this.chunkEnd = r + 3e4, this.chunkBudget = 3e3), this.chunkBudget <= 0) return; - let { state: n, viewport: { to: i } } = this.view, s = n.field($o.state); + let { state: n, viewport: { to: i } } = this.view, s = n.field(el.state); if (s.tree == s.context.tree && s.context.isDone(i + 1e5)) return; - let a = Date.now() + Math.min(this.chunkBudget, 100, e && !KE ? Math.max(25, e.timeRemaining() - 5) : 1e9), o = s.context.treeLen < i && n.doc.length > i + 1e3, l = s.context.work(() => KE && KE() || Date.now() > a, i + (o ? 0 : 1e5)); - this.chunkBudget -= Date.now() - r, (l || this.chunkBudget <= 0) && (s.context.takeTree(), this.view.dispatch({ effects: $o.setState.of(new Yg(s.context)) })), this.chunkBudget > 0 && !(l && !o) && this.scheduleWork(), this.checkAsyncSchedule(s.context); + let a = Date.now() + Math.min(this.chunkBudget, 100, e && !E_ ? Math.max(25, e.timeRemaining() - 5) : 1e9), o = s.context.treeLen < i && n.doc.length > i + 1e3, l = s.context.work(() => E_ && E_() || Date.now() > a, i + (o ? 0 : 1e5)); + this.chunkBudget -= Date.now() - r, (l || this.chunkBudget <= 0) && (s.context.takeTree(), this.view.dispatch({ effects: el.setState.of(new fm(s.context)) })), this.chunkBudget > 0 && !(l && !o) && this.scheduleWork(), this.checkAsyncSchedule(s.context); } checkAsyncSchedule(e) { - e.scheduleOn && (this.workScheduled++, e.scheduleOn.then(() => this.scheduleWork()).catch((r) => Vo(this.view.state, r)).then(() => this.workScheduled--), e.scheduleOn = null); + e.scheduleOn && (this.workScheduled++, e.scheduleOn.then(() => this.scheduleWork()).catch((r) => al(this.view.state, r)).then(() => this.workScheduled--), e.scheduleOn = null); } destroy() { this.working && this.working(); @@ -12050,25 +12050,25 @@ const KE = typeof navigator < "u" && ((jE = navigator.scheduling) === null || jE eventHandlers: { focus() { this.scheduleWork(); } } -}), bf = /* @__PURE__ */ At.define({ +}), $f = /* @__PURE__ */ $t.define({ combine(t) { return t.length ? t[0] : null; }, enables: (t) => [ - $o.state, - u4e, - ft.contentAttributes.compute([t], (e) => { + el.state, + e5e, + kt.contentAttributes.compute([t], (e) => { let r = e.facet(t); return r && r.name ? { "data-language": r.name } : {}; }) ] }); -class Wg { +class dm { constructor(e, r = []) { this.language = e, this.support = r, this.extension = [e, r]; } } -class H5 { +class Ok { constructor(e, r, n, i, s, a = void 0) { this.name = e, this.alias = r, this.extensions = n, this.filename = i, this.loadFunc = s, this.support = a, this.loading = null; } @@ -12084,7 +12084,7 @@ class H5 { throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of"); r = () => Promise.resolve(n); } - return new H5(e.name, (e.alias || []).concat(e.name).map((i) => i.toLowerCase()), e.extensions || [], e.filename, r, n); + return new Ok(e.name, (e.alias || []).concat(e.name).map((i) => i.toLowerCase()), e.extensions || [], e.filename, r, n); } static matchFilename(e, r) { for (let i of e) @@ -12113,7 +12113,7 @@ class H5 { return null; } } -const h4e = /* @__PURE__ */ At.define(), px = /* @__PURE__ */ At.define({ +const t5e = /* @__PURE__ */ $t.define(), Bx = /* @__PURE__ */ $t.define({ combine: (t) => { if (!t.length) return " "; @@ -12123,12 +12123,12 @@ const h4e = /* @__PURE__ */ At.define(), px = /* @__PURE__ */ At.define({ return e; } }); -function Z5(t) { - let e = t.facet(px); +function kk(t) { + let e = t.facet(Bx); return e.charCodeAt(0) == 9 ? t.tabSize * e.length : e.length; } -function Ky(t, e) { - let r = "", n = t.tabSize, i = t.facet(px)[0]; +function O2(t, e) { + let r = "", n = t.tabSize, i = t.facet(Bx)[0]; if (i == " ") { for (; e >= n; ) r += " ", e -= n; @@ -12138,19 +12138,19 @@ function Ky(t, e) { r += i; return r; } -function RM(t, e) { - t instanceof dr && (t = new uT(t)); - for (let n of t.state.facet(h4e)) { +function aD(t, e) { + t instanceof Sr && (t = new $T(t)); + for (let n of t.state.facet(t5e)) { let i = n(t, e); if (i !== void 0) return i; } - let r = dn(t.state); - return r.length >= e ? f4e(t, r, e) : null; + let r = Cn(t.state); + return r.length >= e ? r5e(t, r, e) : null; } -class uT { +class $T { constructor(e, r = {}) { - this.state = e, this.options = r, this.unit = Z5(e); + this.state = e, this.options = r, this.unit = kk(e); } lineAt(e, r = 1) { let n = this.state.doc.lineAt(e), { simulateBreak: i, simulateDoubleBreak: s } = this.options; @@ -12167,7 +12167,7 @@ class uT { return a > -1 && (s += a - this.countColumn(n, n.search(/\S|$/))), s; } countColumn(e, r = e.length) { - return $l(e, this.state.tabSize, r); + return tc(e, this.state.tabSize, r); } lineIndent(e, r = 1) { let { text: n, from: i } = this.lineAt(e, r), s = this.options.overrideIndentation; @@ -12182,8 +12182,8 @@ class uT { return this.options.simulateBreak || null; } } -const jm = /* @__PURE__ */ new or(); -function f4e(t, e, r) { +const y1 = /* @__PURE__ */ new yr(); +function r5e(t, e, r) { let n = e.resolveStack(r), i = n.node.enterUnfinishedNodesBefore(r); if (i != n.node) { let s = []; @@ -12192,34 +12192,34 @@ function f4e(t, e, r) { for (let a = s.length - 1; a >= 0; a--) n = { node: s[a], next: n }; } - return yJ(n, t, r); + return JJ(n, t, r); } -function yJ(t, e, r) { +function JJ(t, e, r) { for (let n = t; n; n = n.next) { - let i = p4e(n.node); + let i = i5e(n.node); if (i) - return i(MM.create(e, r, n)); + return i(oD.create(e, r, n)); } return 0; } -function d4e(t) { +function n5e(t) { return t.pos == t.options.simulateBreak && t.options.simulateDoubleBreak; } -function p4e(t) { - let e = t.type.prop(jm); +function i5e(t) { + let e = t.type.prop(y1); if (e) return e; let r = t.firstChild, n; - if (r && (n = r.type.prop(or.closedBy))) { + if (r && (n = r.type.prop(yr.closedBy))) { let i = t.lastChild, s = i && n.indexOf(i.name) > -1; - return (a) => bJ(a, !0, 1, void 0, s && !d4e(a) ? i.from : void 0); + return (a) => eee(a, !0, 1, void 0, s && !n5e(a) ? i.from : void 0); } - return t.parent == null ? g4e : null; + return t.parent == null ? s5e : null; } -function g4e() { +function s5e() { return 0; } -class MM extends uT { +class oD extends $T { constructor(e, r, n) { super(e.state, e.options), this.base = e, this.pos = r, this.context = n; } @@ -12227,7 +12227,7 @@ class MM extends uT { return this.context.node; } static create(e, r, n) { - return new MM(e, r, n); + return new oD(e, r, n); } get textAfter() { return this.textAfterPos(this.pos); @@ -12241,23 +12241,23 @@ class MM extends uT { let n = e.resolve(r.from); for (; n.parent && n.parent.from == n.from; ) n = n.parent; - if (m4e(n, e)) + if (a5e(n, e)) break; r = this.state.doc.lineAt(n.from); } return this.lineIndent(r.from); } continue() { - return yJ(this.context.next, this.base, this.pos); + return JJ(this.context.next, this.base, this.pos); } } -function m4e(t, e) { +function a5e(t, e) { for (let r = e; r; r = r.parent) if (t == r) return !0; return !1; } -function v4e(t) { +function o5e(t) { let e = t.node, r = e.childAfter(e.from), n = e.lastChild; if (!r) return null; @@ -12271,30 +12271,30 @@ function v4e(t) { o = l.to; } } -function G7({ closing: t, align: e = !0, units: r = 1 }) { - return (n) => bJ(n, e, r, t); +function O8({ closing: t, align: e = !0, units: r = 1 }) { + return (n) => eee(n, e, r, t); } -function bJ(t, e, r, n, i) { - let s = t.textAfter, a = s.match(/^\s*/)[0].length, o = n && s.slice(a, a + n.length) == n || i == t.pos + a, l = e ? v4e(t) : null; +function eee(t, e, r, n, i) { + let s = t.textAfter, a = s.match(/^\s*/)[0].length, o = n && s.slice(a, a + n.length) == n || i == t.pos + a, l = e ? o5e(t) : null; return l ? o ? t.column(l.from) : t.column(l.to) : t.baseIndent + (o ? 0 : t.unit * r); } -const y4e = (t) => t.baseIndent; -function P4({ except: t, units: e = 1 } = {}) { +const l5e = (t) => t.baseIndent; +function o5({ except: t, units: e = 1 } = {}) { return (r) => { let n = t && t.test(r.textAfter); return r.baseIndent + (n ? 0 : e * r.unit); }; } -const b4e = 200; -function x4e() { - return dr.transactionFilter.of((t) => { +const c5e = 200; +function u5e() { + return Sr.transactionFilter.of((t) => { if (!t.docChanged || !t.isUserEvent("input.type") && !t.isUserEvent("input.complete")) return t; let e = t.startState.languageDataAt("indentOnInput", t.startState.selection.main.head); if (!e.length) return t; let r = t.newDoc, { head: n } = t.newSelection.main, i = r.lineAt(n); - if (n > i.from + b4e) + if (n > i.from + c5e) return t; let s = r.sliceString(i.from, n); if (!e.some((u) => u.test(s))) @@ -12305,22 +12305,22 @@ function x4e() { if (h.from == o) continue; o = h.from; - let f = RM(a, h.from); + let f = aD(a, h.from); if (f == null) continue; - let d = /^\s*/.exec(h.text)[0], p = Ky(a, f); + let d = /^\s*/.exec(h.text)[0], p = O2(a, f); d != p && l.push({ from: h.from, to: h.from + d.length, insert: p }); } return l.length ? [t, { changes: l, sequential: !0 }] : t; }); } -const xJ = /* @__PURE__ */ At.define(), X0 = /* @__PURE__ */ new or(); -function DM(t) { +const tee = /* @__PURE__ */ $t.define(), dp = /* @__PURE__ */ new yr(); +function lD(t) { let e = t.firstChild, r = t.lastChild; return e && e.to < r.from ? { from: e.to, to: r.type.isError ? t.to : r.from } : null; } -function w4e(t, e, r) { - let n = dn(t); +function h5e(t, e, r) { + let n = Cn(t); if (n.length < r) return null; let i = n.resolveStack(r, 1), s = null; @@ -12330,49 +12330,49 @@ function w4e(t, e, r) { continue; if (s && o.from < e) break; - let l = o.type.prop(X0); - if (l && (o.to < n.length - 50 || n.length == t.doc.length || !O4e(o))) { + let l = o.type.prop(dp); + if (l && (o.to < n.length - 50 || n.length == t.doc.length || !f5e(o))) { let u = l(o, t); u && u.from <= r && u.from >= e && u.to > r && (s = u); } } return s; } -function O4e(t) { +function f5e(t) { let e = t.lastChild; return e && e.to == t.to && e.type.isError; } -function Jy(t, e, r) { - for (let n of t.facet(xJ)) { +function k2(t, e, r) { + for (let n of t.facet(tee)) { let i = n(t, e, r); if (i) return i; } - return w4e(t, e, r); + return h5e(t, e, r); } -function wJ(t, e) { +function ree(t, e) { let r = e.mapPos(t.from, 1), n = e.mapPos(t.to, -1); return r >= n ? void 0 : { from: r, to: n }; } -const Wu = /* @__PURE__ */ jt.define({ map: wJ }), H0 = /* @__PURE__ */ jt.define({ map: wJ }); -function OJ(t) { +const uh = /* @__PURE__ */ or.define({ map: ree }), pp = /* @__PURE__ */ or.define({ map: ree }); +function nee(t) { let e = []; for (let { head: r } of t.state.selection.ranges) e.some((n) => n.from <= r && n.to >= r) || e.push(t.lineBlockAt(r)); return e; } -const xf = /* @__PURE__ */ In.define({ +const Bf = /* @__PURE__ */ Xn.define({ create() { - return _t.none; + return It.none; }, update(t, e) { t = t.map(e.changes); for (let r of e.effects) - if (r.is(Wu) && !S4e(t, r.value.from, r.value.to)) { - let { preparePlaceholder: n } = e.state.facet(PM), i = n ? _t.replace({ widget: new R4e(n(e.state, r.value)) }) : GF; + if (r.is(uh) && !p5e(t, r.value.from, r.value.to)) { + let { preparePlaceholder: n } = e.state.facet(cD), i = n ? It.replace({ widget: new w5e(n(e.state, r.value)) }) : _z; t = t.update({ add: [i.range(r.value.from, r.value.to)] }); } else - r.is(H0) && (t = t.update({ + r.is(pp) && (t = t.update({ filter: (n, i) => r.value.from != n || r.value.to != i, filterFrom: r.value.from, filterTo: r.value.to @@ -12389,7 +12389,7 @@ const xf = /* @__PURE__ */ In.define({ } return t; }, - provide: (t) => ft.decorations.from(t), + provide: (t) => kt.decorations.from(t), toJSON(t, e) { let r = []; return t.between(0, e.doc.length, (n, i) => { @@ -12404,100 +12404,100 @@ const xf = /* @__PURE__ */ In.define({ let n = t[r++], i = t[r++]; if (typeof n != "number" || typeof i != "number") throw new RangeError("Invalid JSON for fold state"); - e.push(GF.range(n, i)); + e.push(_z.range(n, i)); } - return _t.set(e, !0); + return It.set(e, !0); } }); -function k4e(t) { - return t.field(xf, !1) || Er.empty; +function d5e(t) { + return t.field(Bf, !1) || $r.empty; } -function j5(t, e, r) { +function Sk(t, e, r) { var n; let i = null; - return (n = t.field(xf, !1)) === null || n === void 0 || n.between(e, r, (s, a) => { + return (n = t.field(Bf, !1)) === null || n === void 0 || n.between(e, r, (s, a) => { (!i || i.from > s) && (i = { from: s, to: a }); }), i; } -function S4e(t, e, r) { +function p5e(t, e, r) { let n = !1; return t.between(e, e, (i, s) => { i == e && s == r && (n = !0); }), n; } -function kJ(t, e) { - return t.field(xf, !1) ? e : e.concat(jt.appendConfig.of(TJ())); +function iee(t, e) { + return t.field(Bf, !1) ? e : e.concat(or.appendConfig.of(aee())); } -const T4e = (t) => { - for (let e of OJ(t)) { - let r = Jy(t.state, e.from, e.to); +const g5e = (t) => { + for (let e of nee(t)) { + let r = k2(t.state, e.from, e.to); if (r) - return t.dispatch({ effects: kJ(t.state, [Wu.of(r), SJ(t, r)]) }), !0; + return t.dispatch({ effects: iee(t.state, [uh.of(r), see(t, r)]) }), !0; } return !1; -}, C4e = (t) => { - if (!t.state.field(xf, !1)) +}, m5e = (t) => { + if (!t.state.field(Bf, !1)) return !1; let e = []; - for (let r of OJ(t)) { - let n = j5(t.state, r.from, r.to); - n && e.push(H0.of(n), SJ(t, n, !1)); + for (let r of nee(t)) { + let n = Sk(t.state, r.from, r.to); + n && e.push(pp.of(n), see(t, n, !1)); } return e.length && t.dispatch({ effects: e }), e.length > 0; }; -function SJ(t, e, r = !0) { +function see(t, e, r = !0) { let n = t.state.doc.lineAt(e.from).number, i = t.state.doc.lineAt(e.to).number; - return ft.announce.of(`${t.state.phrase(r ? "Folded lines" : "Unfolded lines")} ${n} ${t.state.phrase("to")} ${i}.`); + return kt.announce.of(`${t.state.phrase(r ? "Folded lines" : "Unfolded lines")} ${n} ${t.state.phrase("to")} ${i}.`); } -const E4e = (t) => { +const v5e = (t) => { let { state: e } = t, r = []; for (let n = 0; n < e.doc.length; ) { - let i = t.lineBlockAt(n), s = Jy(e, i.from, i.to); - s && r.push(Wu.of(s)), n = (s ? t.lineBlockAt(s.to) : i).to + 1; + let i = t.lineBlockAt(n), s = k2(e, i.from, i.to); + s && r.push(uh.of(s)), n = (s ? t.lineBlockAt(s.to) : i).to + 1; } - return r.length && t.dispatch({ effects: kJ(t.state, r) }), !!r.length; -}, _4e = (t) => { - let e = t.state.field(xf, !1); + return r.length && t.dispatch({ effects: iee(t.state, r) }), !!r.length; +}, y5e = (t) => { + let e = t.state.field(Bf, !1); if (!e || !e.size) return !1; let r = []; return e.between(0, t.state.doc.length, (n, i) => { - r.push(H0.of({ from: n, to: i })); + r.push(pp.of({ from: n, to: i })); }), t.dispatch({ effects: r }), !0; -}, A4e = [ - { key: "Ctrl-Shift-[", mac: "Cmd-Alt-[", run: T4e }, - { key: "Ctrl-Shift-]", mac: "Cmd-Alt-]", run: C4e }, - { key: "Ctrl-Alt-[", run: E4e }, - { key: "Ctrl-Alt-]", run: _4e } -], L4e = { +}, b5e = [ + { key: "Ctrl-Shift-[", mac: "Cmd-Alt-[", run: g5e }, + { key: "Ctrl-Shift-]", mac: "Cmd-Alt-]", run: m5e }, + { key: "Ctrl-Alt-[", run: v5e }, + { key: "Ctrl-Alt-]", run: y5e } +], x5e = { placeholderDOM: null, preparePlaceholder: null, placeholderText: "\u2026" -}, PM = /* @__PURE__ */ At.define({ +}, cD = /* @__PURE__ */ $t.define({ combine(t) { - return Zc(t, L4e); + return pu(t, x5e); } }); -function TJ(t) { - let e = [xf, P4e]; - return t && e.push(PM.of(t)), e; -} -function CJ(t, e) { - let { state: r } = t, n = r.facet(PM), i = (a) => { - let o = t.lineBlockAt(t.posAtDOM(a.target)), l = j5(t.state, o.from, o.to); - l && t.dispatch({ effects: H0.of(l) }), a.preventDefault(); +function aee(t) { + let e = [Bf, S5e]; + return t && e.push(cD.of(t)), e; +} +function oee(t, e) { + let { state: r } = t, n = r.facet(cD), i = (a) => { + let o = t.lineBlockAt(t.posAtDOM(a.target)), l = Sk(t.state, o.from, o.to); + l && t.dispatch({ effects: pp.of(l) }), a.preventDefault(); }; if (n.placeholderDOM) return n.placeholderDOM(t, i, e); let s = document.createElement("span"); return s.textContent = n.placeholderText, s.setAttribute("aria-label", r.phrase("folded code")), s.title = r.phrase("unfold"), s.className = "cm-foldPlaceholder", s.onclick = i, s; } -const GF = /* @__PURE__ */ _t.replace({ widget: /* @__PURE__ */ new class extends Wa { +const _z = /* @__PURE__ */ It.replace({ widget: /* @__PURE__ */ new class extends uo { toDOM(t) { - return CJ(t, null); + return oee(t, null); } }() }); -class R4e extends Wa { +class w5e extends uo { constructor(e) { super(), this.value = e; } @@ -12505,17 +12505,17 @@ class R4e extends Wa { return this.value == e.value; } toDOM(e) { - return CJ(e, this.value); + return oee(e, this.value); } } -const M4e = { +const O5e = { openText: "\u2304", closedText: "\u203A", markerDOM: null, domEventHandlers: {}, foldingChanged: () => !1 }; -class JE extends Go { +class __ extends ul { constructor(e, r) { super(), this.config = e, this.open = r; } @@ -12529,18 +12529,18 @@ class JE extends Go { return r.textContent = this.open ? this.config.openText : this.config.closedText, r.title = e.state.phrase(this.open ? "Fold line" : "Unfold line"), r; } } -function D4e(t = {}) { - let e = Object.assign(Object.assign({}, M4e), t), r = new JE(e, !0), n = new JE(e, !1), i = Jr.fromClass(class { +function k5e(t = {}) { + let e = Object.assign(Object.assign({}, O5e), t), r = new __(e, !0), n = new __(e, !1), i = hn.fromClass(class { constructor(a) { this.from = a.viewport.from, this.markers = this.buildMarkers(a); } update(a) { - (a.docChanged || a.viewportChanged || a.startState.facet(bf) != a.state.facet(bf) || a.startState.field(xf, !1) != a.state.field(xf, !1) || dn(a.startState) != dn(a.state) || e.foldingChanged(a)) && (this.markers = this.buildMarkers(a.view)); + (a.docChanged || a.viewportChanged || a.startState.facet($f) != a.state.facet($f) || a.startState.field(Bf, !1) != a.state.field(Bf, !1) || Cn(a.startState) != Cn(a.state) || e.foldingChanged(a)) && (this.markers = this.buildMarkers(a.view)); } buildMarkers(a) { - let o = new Hi(); + let o = new os(); for (let l of a.viewportLineBlocks) { - let u = j5(a.state, l.from, l.to) ? n : Jy(a.state, l.from, l.to) ? r : null; + let u = Sk(a.state, l.from, l.to) ? n : k2(a.state, l.from, l.to) ? r : null; u && o.add(l.from, l.from, u); } return o.finish(); @@ -12548,29 +12548,29 @@ function D4e(t = {}) { }), { domEventHandlers: s } = e; return [ i, - cT({ + IT({ class: "cm-foldGutter", markers(a) { var o; - return ((o = a.plugin(i)) === null || o === void 0 ? void 0 : o.markers) || Er.empty; + return ((o = a.plugin(i)) === null || o === void 0 ? void 0 : o.markers) || $r.empty; }, initialSpacer() { - return new JE(e, !1); + return new __(e, !1); }, domEventHandlers: Object.assign(Object.assign({}, s), { click: (a, o, l) => { if (s.click && s.click(a, o, l)) return !0; - let u = j5(a.state, o.from, o.to); + let u = Sk(a.state, o.from, o.to); if (u) - return a.dispatch({ effects: H0.of(u) }), !0; - let h = Jy(a.state, o.from, o.to); - return h ? (a.dispatch({ effects: Wu.of(h) }), !0) : !1; + return a.dispatch({ effects: pp.of(u) }), !0; + let h = k2(a.state, o.from, o.to); + return h ? (a.dispatch({ effects: uh.of(h) }), !0) : !1; } }) }), - TJ() + aee() ]; } -const P4e = /* @__PURE__ */ ft.baseTheme({ +const S5e = /* @__PURE__ */ kt.baseTheme({ ".cm-foldPlaceholder": { backgroundColor: "#eee", border: "1px solid #ddd", @@ -12585,182 +12585,182 @@ const P4e = /* @__PURE__ */ ft.baseTheme({ cursor: "pointer" } }); -class hT { +class BT { constructor(e, r) { this.specs = e; let n; function i(o) { - let l = Uu.newName(); + let l = ah.newName(); return (n || (n = /* @__PURE__ */ Object.create(null)))["." + l] = o, l; } const s = typeof r.all == "string" ? r.all : r.all ? i(r.all) : void 0, a = r.scope; - this.scope = a instanceof $o ? (o) => o.prop(zd) == a.data : a ? (o) => o == a : void 0, this.style = mJ(e.map((o) => ({ + this.scope = a instanceof el ? (o) => o.prop(s0) == a.data : a ? (o) => o == a : void 0, this.style = jJ(e.map((o) => ({ tag: o.tag, class: o.class || i(Object.assign({}, o, { tag: null })) })), { all: s - }).style, this.module = n ? new Uu(n) : null, this.themeType = r.themeType; + }).style, this.module = n ? new ah(n) : null, this.themeType = r.themeType; } static define(e, r) { - return new hT(e, r || {}); + return new BT(e, r || {}); } } -const X7 = /* @__PURE__ */ At.define(), EJ = /* @__PURE__ */ At.define({ +const k8 = /* @__PURE__ */ $t.define(), lee = /* @__PURE__ */ $t.define({ combine(t) { return t.length ? [t[0]] : null; } }); -function e6(t) { - let e = t.facet(X7); - return e.length ? e : t.facet(EJ); +function A_(t) { + let e = t.facet(k8); + return e.length ? e : t.facet(lee); } -function _J(t, e) { - let r = [I4e], n; - return t instanceof hT && (t.module && r.push(ft.styleModule.of(t.module)), n = t.themeType), e != null && e.fallback ? r.push(EJ.of(t)) : n ? r.push(X7.computeN([ft.darkTheme], (i) => i.facet(ft.darkTheme) == (n == "dark") ? [t] : [])) : r.push(X7.of(t)), r; +function cee(t, e) { + let r = [C5e], n; + return t instanceof BT && (t.module && r.push(kt.styleModule.of(t.module)), n = t.themeType), e != null && e.fallback ? r.push(lee.of(t)) : n ? r.push(k8.computeN([kt.darkTheme], (i) => i.facet(kt.darkTheme) == (n == "dark") ? [t] : [])) : r.push(k8.of(t)), r; } -class N4e { +class T5e { constructor(e) { - this.markCache = /* @__PURE__ */ Object.create(null), this.tree = dn(e.state), this.decorations = this.buildDeco(e, e6(e.state)); + this.markCache = /* @__PURE__ */ Object.create(null), this.tree = Cn(e.state), this.decorations = this.buildDeco(e, A_(e.state)); } update(e) { - let r = dn(e.state), n = e6(e.state), i = n != e6(e.startState); + let r = Cn(e.state), n = A_(e.state), i = n != A_(e.startState); r.length < e.view.viewport.to && !i && r.type == this.tree.type ? this.decorations = this.decorations.map(e.changes) : (r != this.tree || e.viewportChanged || i) && (this.tree = r, this.decorations = this.buildDeco(e.view, n)); } buildDeco(e, r) { if (!r || !this.tree.length) - return _t.none; - let n = new Hi(); + return It.none; + let n = new os(); for (let { from: i, to: s } of e.visibleRanges) - a4e(this.tree, r, (a, o, l) => { - n.add(a, o, this.markCache[l] || (this.markCache[l] = _t.mark({ class: l }))); + Z4e(this.tree, r, (a, o, l) => { + n.add(a, o, this.markCache[l] || (this.markCache[l] = It.mark({ class: l }))); }, i, s); return n.finish(); } } -const I4e = /* @__PURE__ */ Wl.high(/* @__PURE__ */ Jr.fromClass(N4e, { +const C5e = /* @__PURE__ */ uc.high(/* @__PURE__ */ hn.fromClass(T5e, { decorations: (t) => t.decorations -})), AJ = /* @__PURE__ */ hT.define([ +})), uee = /* @__PURE__ */ BT.define([ { - tag: we.meta, + tag: Se.meta, color: "#404740" }, { - tag: we.link, + tag: Se.link, textDecoration: "underline" }, { - tag: we.heading, + tag: Se.heading, textDecoration: "underline", fontWeight: "bold" }, { - tag: we.emphasis, + tag: Se.emphasis, fontStyle: "italic" }, { - tag: we.strong, + tag: Se.strong, fontWeight: "bold" }, { - tag: we.strikethrough, + tag: Se.strikethrough, textDecoration: "line-through" }, { - tag: we.keyword, + tag: Se.keyword, color: "#708" }, { - tag: [we.atom, we.bool, we.url, we.contentSeparator, we.labelName], + tag: [Se.atom, Se.bool, Se.url, Se.contentSeparator, Se.labelName], color: "#219" }, { - tag: [we.literal, we.inserted], + tag: [Se.literal, Se.inserted], color: "#164" }, { - tag: [we.string, we.deleted], + tag: [Se.string, Se.deleted], color: "#a11" }, { - tag: [we.regexp, we.escape, /* @__PURE__ */ we.special(we.string)], + tag: [Se.regexp, Se.escape, /* @__PURE__ */ Se.special(Se.string)], color: "#e40" }, { - tag: /* @__PURE__ */ we.definition(we.variableName), + tag: /* @__PURE__ */ Se.definition(Se.variableName), color: "#00f" }, { - tag: /* @__PURE__ */ we.local(we.variableName), + tag: /* @__PURE__ */ Se.local(Se.variableName), color: "#30a" }, { - tag: [we.typeName, we.namespace], + tag: [Se.typeName, Se.namespace], color: "#085" }, { - tag: we.className, + tag: Se.className, color: "#167" }, { - tag: [/* @__PURE__ */ we.special(we.variableName), we.macroName], + tag: [/* @__PURE__ */ Se.special(Se.variableName), Se.macroName], color: "#256" }, { - tag: /* @__PURE__ */ we.definition(we.propertyName), + tag: /* @__PURE__ */ Se.definition(Se.propertyName), color: "#00c" }, { - tag: we.comment, + tag: Se.comment, color: "#940" }, { - tag: we.invalid, + tag: Se.invalid, color: "#f00" } -]), $4e = /* @__PURE__ */ ft.baseTheme({ +]), E5e = /* @__PURE__ */ kt.baseTheme({ "&.cm-focused .cm-matchingBracket": { backgroundColor: "#328c8252" }, "&.cm-focused .cm-nonmatchingBracket": { backgroundColor: "#bb555544" } -}), LJ = 1e4, RJ = "()[]{}", MJ = /* @__PURE__ */ At.define({ +}), hee = 1e4, fee = "()[]{}", dee = /* @__PURE__ */ $t.define({ combine(t) { - return Zc(t, { + return pu(t, { afterCursor: !0, - brackets: RJ, - maxScanDistance: LJ, - renderMatch: z4e + brackets: fee, + maxScanDistance: hee, + renderMatch: L5e }); } -}), B4e = /* @__PURE__ */ _t.mark({ class: "cm-matchingBracket" }), F4e = /* @__PURE__ */ _t.mark({ class: "cm-nonmatchingBracket" }); -function z4e(t) { - let e = [], r = t.matched ? B4e : F4e; +}), _5e = /* @__PURE__ */ It.mark({ class: "cm-matchingBracket" }), A5e = /* @__PURE__ */ It.mark({ class: "cm-nonmatchingBracket" }); +function L5e(t) { + let e = [], r = t.matched ? _5e : A5e; return e.push(r.range(t.start.from, t.start.to)), t.end && e.push(r.range(t.end.from, t.end.to)), e; } -const Q4e = /* @__PURE__ */ In.define({ +const R5e = /* @__PURE__ */ Xn.define({ create() { - return _t.none; + return It.none; }, update(t, e) { if (!e.docChanged && !e.selection) return t; - let r = [], n = e.state.facet(MJ); + let r = [], n = e.state.facet(dee); for (let i of e.state.selection.ranges) { if (!i.empty) continue; - let s = wc(e.state, i.head, -1, n) || i.head > 0 && wc(e.state, i.head - 1, 1, n) || n.afterCursor && (wc(e.state, i.head, 1, n) || i.head < e.state.doc.length && wc(e.state, i.head + 1, -1, n)); + let s = zc(e.state, i.head, -1, n) || i.head > 0 && zc(e.state, i.head - 1, 1, n) || n.afterCursor && (zc(e.state, i.head, 1, n) || i.head < e.state.doc.length && zc(e.state, i.head + 1, -1, n)); s && (r = r.concat(n.renderMatch(s, e.state))); } - return _t.set(r, !0); + return It.set(r, !0); }, - provide: (t) => ft.decorations.from(t) -}), U4e = [ - Q4e, - $4e + provide: (t) => kt.decorations.from(t) +}), M5e = [ + R5e, + E5e ]; -function V4e(t = {}) { - return [MJ.of(t), U4e]; +function D5e(t = {}) { + return [dee.of(t), M5e]; } -const DJ = /* @__PURE__ */ new or(); -function H7(t, e, r) { - let n = t.prop(e < 0 ? or.openedBy : or.closedBy); +const pee = /* @__PURE__ */ new yr(); +function S8(t, e, r) { + let n = t.prop(e < 0 ? yr.openedBy : yr.closedBy); if (n) return n; if (t.name.length == 1) { @@ -12770,35 +12770,35 @@ function H7(t, e, r) { } return null; } -function Z7(t) { - let e = t.type.prop(DJ); +function T8(t) { + let e = t.type.prop(pee); return e ? e(t.node) : t; } -function wc(t, e, r, n = {}) { - let i = n.maxScanDistance || LJ, s = n.brackets || RJ, a = dn(t), o = a.resolveInner(e, r); +function zc(t, e, r, n = {}) { + let i = n.maxScanDistance || hee, s = n.brackets || fee, a = Cn(t), o = a.resolveInner(e, r); for (let l = o; l; l = l.parent) { - let u = H7(l.type, r, s); + let u = S8(l.type, r, s); if (u && l.from < l.to) { - let h = Z7(l); + let h = T8(l); if (h && (r > 0 ? e >= h.from && e < h.to : e > h.from && e <= h.to)) - return q4e(t, e, r, l, h, u, s); + return P5e(t, e, r, l, h, u, s); } } - return Y4e(t, e, r, a, o.type, i, s); + return N5e(t, e, r, a, o.type, i, s); } -function q4e(t, e, r, n, i, s, a) { +function P5e(t, e, r, n, i, s, a) { let o = n.parent, l = { from: i.from, to: i.to }, u = 0, h = o == null ? void 0 : o.cursor(); if (h && (r < 0 ? h.childBefore(n.from) : h.childAfter(n.to))) do if (r < 0 ? h.to <= n.from : h.from >= n.to) { if (u == 0 && s.indexOf(h.type.name) > -1 && h.from < h.to) { - let f = Z7(h); + let f = T8(h); return { start: l, end: f ? { from: f.from, to: f.to } : void 0, matched: !0 }; - } else if (H7(h.type, r, a)) + } else if (S8(h.type, r, a)) u++; - else if (H7(h.type, -r, a)) { + else if (S8(h.type, -r, a)) { if (u == 0) { - let f = Z7(h); + let f = T8(h); return { start: l, end: f && f.from < f.to ? { from: f.from, to: f.to } : void 0, @@ -12811,7 +12811,7 @@ function q4e(t, e, r, n, i, s, a) { while (r < 0 ? h.prevSibling() : h.nextSibling()); return { start: l, matched: !1 }; } -function Y4e(t, e, r, n, i, s, a) { +function N5e(t, e, r, n, i, s, a) { let o = r < 0 ? t.sliceDoc(e - 1, e) : t.sliceDoc(e, e + 1), l = a.indexOf(o); if (l < 0 || l % 2 == 0 != r > 0) return null; @@ -12835,7 +12835,7 @@ function Y4e(t, e, r, n, i, s, a) { } return h.done ? { start: u, matched: !1 } : null; } -const W4e = /* @__PURE__ */ Object.create(null), XF = [Mi.none], HF = [], ZF = /* @__PURE__ */ Object.create(null), G4e = /* @__PURE__ */ Object.create(null); +const I5e = /* @__PURE__ */ Object.create(null), Az = [Yi.none], Lz = [], Rz = /* @__PURE__ */ Object.create(null), $5e = /* @__PURE__ */ Object.create(null); for (let [t, e] of [ ["variable", "variableName"], ["variable-2", "variableName.special"], @@ -12850,38 +12850,38 @@ for (let [t, e] of [ ["header", "heading"], ["property", "propertyName"] ]) - G4e[t] = /* @__PURE__ */ X4e(W4e, e); -function t6(t, e) { - HF.indexOf(t) > -1 || (HF.push(t), console.warn(e)); + $5e[t] = /* @__PURE__ */ B5e(I5e, e); +function L_(t, e) { + Lz.indexOf(t) > -1 || (Lz.push(t), console.warn(e)); } -function X4e(t, e) { +function B5e(t, e) { let r = []; for (let o of e.split(" ")) { let l = []; for (let u of o.split(".")) { - let h = t[u] || we[u]; - h ? typeof h == "function" ? l.length ? l = l.map(h) : t6(u, `Modifier ${u} used at start of tag`) : l.length ? t6(u, `Tag ${u} used as modifier`) : l = Array.isArray(h) ? h : [h] : t6(u, `Unknown highlighting tag ${u}`); + let h = t[u] || Se[u]; + h ? typeof h == "function" ? l.length ? l = l.map(h) : L_(u, `Modifier ${u} used at start of tag`) : l.length ? L_(u, `Tag ${u} used as modifier`) : l = Array.isArray(h) ? h : [h] : L_(u, `Unknown highlighting tag ${u}`); } for (let u of l) r.push(u); } if (!r.length) return 0; - let n = e.replace(/ /g, "_"), i = n + " " + r.map((o) => o.id), s = ZF[i]; + let n = e.replace(/ /g, "_"), i = n + " " + r.map((o) => o.id), s = Rz[i]; if (s) return s.id; - let a = ZF[i] = Mi.define({ - id: XF.length, + let a = Rz[i] = Yi.define({ + id: Az.length, name: n, - props: [Xf({ [n]: r })] + props: [fd({ [n]: r })] }); - return XF.push(a), a.id; + return Az.push(a), a.id; } -const H4e = (t) => { - let { state: e } = t, r = e.doc.lineAt(e.selection.main.from), n = IM(t.state, r.from); - return n.line ? Z4e(t) : n.block ? K4e(t) : !1; +const F5e = (t) => { + let { state: e } = t, r = e.doc.lineAt(e.selection.main.from), n = hD(t.state, r.from); + return n.line ? z5e(t) : n.block ? U5e(t) : !1; }; -function NM(t, e) { +function uD(t, e) { return ({ state: r, dispatch: n }) => { if (r.readOnly) return !1; @@ -12889,21 +12889,21 @@ function NM(t, e) { return i ? (n(r.update(i)), !0) : !1; }; } -const Z4e = /* @__PURE__ */ NM(t5e, 0), j4e = /* @__PURE__ */ NM(PJ, 0), K4e = /* @__PURE__ */ NM((t, e) => PJ(t, e, e5e(e)), 0); -function IM(t, e) { +const z5e = /* @__PURE__ */ uD(Y5e, 0), Q5e = /* @__PURE__ */ uD(gee, 0), U5e = /* @__PURE__ */ uD((t, e) => gee(t, e, q5e(e)), 0); +function hD(t, e) { let r = t.languageDataAt("commentTokens", e); return r.length ? r[0] : {}; } -const H1 = 50; -function J4e(t, { open: e, close: r }, n, i) { - let s = t.sliceDoc(n - H1, n), a = t.sliceDoc(i, i + H1), o = /\s*$/.exec(s)[0].length, l = /^\s*/.exec(a)[0].length, u = s.length - o; +const bv = 50; +function V5e(t, { open: e, close: r }, n, i) { + let s = t.sliceDoc(n - bv, n), a = t.sliceDoc(i, i + bv), o = /\s*$/.exec(s)[0].length, l = /^\s*/.exec(a)[0].length, u = s.length - o; if (s.slice(u - e.length, u) == e && a.slice(l, l + r.length) == r) return { open: { pos: n - o, margin: o && 1 }, close: { pos: i + l, margin: l && 1 } }; let h, f; - i - n <= 2 * H1 ? h = f = t.sliceDoc(n, i) : (h = t.sliceDoc(n, n + H1), f = t.sliceDoc(i - H1, i)); + i - n <= 2 * bv ? h = f = t.sliceDoc(n, i) : (h = t.sliceDoc(n, n + bv), f = t.sliceDoc(i - bv, i)); let d = /^\s*/.exec(h)[0].length, p = /\s*$/.exec(f)[0].length, g = f.length - p - r.length; return h.slice(d, d + e.length) == e && f.slice(g, g + r.length) == r ? { open: { @@ -12916,7 +12916,7 @@ function J4e(t, { open: e, close: r }, n, i) { } } : null; } -function e5e(t) { +function q5e(t) { let e = []; for (let r of t.selection.ranges) { let n = t.doc.lineAt(r.from), i = r.to <= n.to ? n : t.doc.lineAt(r.to), s = e.length - 1; @@ -12924,11 +12924,11 @@ function e5e(t) { } return e; } -function PJ(t, e, r = e.selection.ranges) { - let n = r.map((s) => IM(e, s.from).block); +function gee(t, e, r = e.selection.ranges) { + let n = r.map((s) => hD(e, s.from).block); if (!n.every((s) => s)) return null; - let i = r.map((s, a) => J4e(e, n[a], s.from, s.to)); + let i = r.map((s, a) => V5e(e, n[a], s.from, s.to)); if (t != 2 && !i.every((s) => s)) return { changes: e.changes(r.map((s, a) => i[a] ? [] : [{ from: s.from, insert: n[a].open + " " }, { from: s.to, insert: " " + n[a].close }])) }; if (t != 1 && i.some((s) => s)) { @@ -12942,10 +12942,10 @@ function PJ(t, e, r = e.selection.ranges) { } return null; } -function t5e(t, e, r = e.selection.ranges) { +function Y5e(t, e, r = e.selection.ranges) { let n = [], i = -1; for (let { from: s, to: a } of r) { - let o = n.length, l = 1e9, u = IM(e, s).line; + let o = n.length, l = 1e9, u = hD(e, s).line; if (!!u) { for (let h = s; h <= a; ) { let f = e.doc.lineAt(h); @@ -12979,9 +12979,9 @@ function t5e(t, e, r = e.selection.ranges) { } return null; } -const j7 = /* @__PURE__ */ Ya.define(), r5e = /* @__PURE__ */ Ya.define(), n5e = /* @__PURE__ */ At.define(), NJ = /* @__PURE__ */ At.define({ +const C8 = /* @__PURE__ */ co.define(), W5e = /* @__PURE__ */ co.define(), G5e = /* @__PURE__ */ $t.define(), mee = /* @__PURE__ */ $t.define({ combine(t) { - return Zc(t, { + return pu(t, { minDepth: 100, newGroupDelay: 500, joinToEvent: (e, r) => r @@ -12991,59 +12991,59 @@ const j7 = /* @__PURE__ */ Ya.define(), r5e = /* @__PURE__ */ Ya.define(), n5e = joinToEvent: (e, r) => (n, i) => e(n, i) || r(n, i) }); } -}), IJ = /* @__PURE__ */ In.define({ +}), vee = /* @__PURE__ */ Xn.define({ create() { - return Oc.empty; + return Qc.empty; }, update(t, e) { - let r = e.state.facet(NJ), n = e.annotation(j7); + let r = e.state.facet(mee), n = e.annotation(C8); if (n) { - let l = $a.fromTransaction(e, n.selection), u = n.side, h = u == 0 ? t.undone : t.done; - return l ? h = J5(h, h.length, r.minDepth, l) : h = FJ(h, e.startState.selection), new Oc(u == 0 ? n.rest : h, u == 0 ? h : n.rest); + let l = to.fromTransaction(e, n.selection), u = n.side, h = u == 0 ? t.undone : t.done; + return l ? h = Ck(h, h.length, r.minDepth, l) : h = xee(h, e.startState.selection), new Qc(u == 0 ? n.rest : h, u == 0 ? h : n.rest); } - let i = e.annotation(r5e); - if ((i == "full" || i == "before") && (t = t.isolate()), e.annotation(pi.addToHistory) === !1) + let i = e.annotation(W5e); + if ((i == "full" || i == "before") && (t = t.isolate()), e.annotation(Ei.addToHistory) === !1) return e.changes.empty ? t : t.addMapping(e.changes.desc); - let s = $a.fromTransaction(e), a = e.annotation(pi.time), o = e.annotation(pi.userEvent); + let s = to.fromTransaction(e), a = e.annotation(Ei.time), o = e.annotation(Ei.userEvent); return s ? t = t.addChanges(s, a, o, r, e) : e.selection && (t = t.addSelection(e.startState.selection, a, o, r.newGroupDelay)), (i == "full" || i == "after") && (t = t.isolate()), t; }, toJSON(t) { return { done: t.done.map((e) => e.toJSON()), undone: t.undone.map((e) => e.toJSON()) }; }, fromJSON(t) { - return new Oc(t.done.map($a.fromJSON), t.undone.map($a.fromJSON)); + return new Qc(t.done.map(to.fromJSON), t.undone.map(to.fromJSON)); } }); -function $M(t = {}) { +function fD(t = {}) { return [ - IJ, - NJ.of(t), - ft.domEventHandlers({ + vee, + mee.of(t), + kt.domEventHandlers({ beforeinput(e, r) { - let n = e.inputType == "historyUndo" ? $J : e.inputType == "historyRedo" ? K5 : null; + let n = e.inputType == "historyUndo" ? yee : e.inputType == "historyRedo" ? Tk : null; return n ? (e.preventDefault(), n(r)) : !1; } }) ]; } -function fT(t, e) { +function FT(t, e) { return function({ state: r, dispatch: n }) { if (!e && r.readOnly) return !1; - let i = r.field(IJ, !1); + let i = r.field(vee, !1); if (!i) return !1; let s = i.pop(t, r, e); return s ? (n(s), !0) : !1; }; } -const $J = /* @__PURE__ */ fT(0, !1), K5 = /* @__PURE__ */ fT(1, !1), i5e = /* @__PURE__ */ fT(0, !0), s5e = /* @__PURE__ */ fT(1, !0); -class $a { +const yee = /* @__PURE__ */ FT(0, !1), Tk = /* @__PURE__ */ FT(1, !1), X5e = /* @__PURE__ */ FT(0, !0), H5e = /* @__PURE__ */ FT(1, !0); +class to { constructor(e, r, n, i, s) { this.changes = e, this.effects = r, this.mapped = n, this.startSelection = i, this.selectionsAfter = s; } setSelAfter(e) { - return new $a(this.changes, this.effects, this.mapped, this.startSelection, e); + return new to(this.changes, this.effects, this.mapped, this.startSelection, e); } toJSON() { var e, r, n; @@ -13055,25 +13055,25 @@ class $a { }; } static fromJSON(e) { - return new $a(e.changes && li.fromJSON(e.changes), [], e.mapped && Dc.fromJSON(e.mapped), e.startSelection && Ue.fromJSON(e.startSelection), e.selectionsAfter.map(Ue.fromJSON)); + return new to(e.changes && wi.fromJSON(e.changes), [], e.mapped && Kc.fromJSON(e.mapped), e.startSelection && je.fromJSON(e.startSelection), e.selectionsAfter.map(je.fromJSON)); } static fromTransaction(e, r) { - let n = Bo; - for (let i of e.startState.facet(n5e)) { + let n = tl; + for (let i of e.startState.facet(G5e)) { let s = i(e); s.length && (n = n.concat(s)); } - return !n.length && e.changes.empty ? null : new $a(e.changes.invert(e.startState.doc), n, void 0, r || e.startState.selection, Bo); + return !n.length && e.changes.empty ? null : new to(e.changes.invert(e.startState.doc), n, void 0, r || e.startState.selection, tl); } static selection(e) { - return new $a(void 0, Bo, void 0, void 0, e); + return new to(void 0, tl, void 0, void 0, e); } } -function J5(t, e, r, n) { +function Ck(t, e, r, n) { let i = e + 1 > r + 20 ? e - r - 1 : 0, s = t.slice(i, e); return s.push(n), s; } -function a5e(t, e) { +function Z5e(t, e) { let r = [], n = !1; return t.iterChangedRanges((i, s) => r.push(i, s)), e.iterChangedRanges((i, s, a, o) => { for (let l = 0; l < r.length; ) { @@ -13082,63 +13082,63 @@ function a5e(t, e) { } }), n; } -function o5e(t, e) { +function j5e(t, e) { return t.ranges.length == e.ranges.length && t.ranges.filter((r, n) => r.empty != e.ranges[n].empty).length === 0; } -function BJ(t, e) { +function bee(t, e) { return t.length ? e.length ? t.concat(e) : t : e; } -const Bo = [], l5e = 200; -function FJ(t, e) { +const tl = [], K5e = 200; +function xee(t, e) { if (t.length) { - let r = t[t.length - 1], n = r.selectionsAfter.slice(Math.max(0, r.selectionsAfter.length - l5e)); - return n.length && n[n.length - 1].eq(e) ? t : (n.push(e), J5(t, t.length - 1, 1e9, r.setSelAfter(n))); + let r = t[t.length - 1], n = r.selectionsAfter.slice(Math.max(0, r.selectionsAfter.length - K5e)); + return n.length && n[n.length - 1].eq(e) ? t : (n.push(e), Ck(t, t.length - 1, 1e9, r.setSelAfter(n))); } else - return [$a.selection([e])]; + return [to.selection([e])]; } -function c5e(t) { +function J5e(t) { let e = t[t.length - 1], r = t.slice(); return r[t.length - 1] = e.setSelAfter(e.selectionsAfter.slice(0, e.selectionsAfter.length - 1)), r; } -function r6(t, e) { +function R_(t, e) { if (!t.length) return t; - let r = t.length, n = Bo; + let r = t.length, n = tl; for (; r; ) { - let i = u5e(t[r - 1], e, n); + let i = eke(t[r - 1], e, n); if (i.changes && !i.changes.empty || i.effects.length) { let s = t.slice(0, r); return s[r - 1] = i, s; } else e = i.mapped, r--, n = i.selectionsAfter; } - return n.length ? [$a.selection(n)] : Bo; + return n.length ? [to.selection(n)] : tl; } -function u5e(t, e, r) { - let n = BJ(t.selectionsAfter.length ? t.selectionsAfter.map((o) => o.map(e)) : Bo, r); +function eke(t, e, r) { + let n = bee(t.selectionsAfter.length ? t.selectionsAfter.map((o) => o.map(e)) : tl, r); if (!t.changes) - return $a.selection(n); + return to.selection(n); let i = t.changes.map(e), s = e.mapDesc(t.changes, !0), a = t.mapped ? t.mapped.composeDesc(s) : s; - return new $a(i, jt.mapEffects(t.effects, e), a, t.startSelection.map(s), n); + return new to(i, or.mapEffects(t.effects, e), a, t.startSelection.map(s), n); } -const h5e = /^(input\.type|delete)($|\.)/; -class Oc { +const tke = /^(input\.type|delete)($|\.)/; +class Qc { constructor(e, r, n = 0, i = void 0) { this.done = e, this.undone = r, this.prevTime = n, this.prevUserEvent = i; } isolate() { - return this.prevTime ? new Oc(this.done, this.undone) : this; + return this.prevTime ? new Qc(this.done, this.undone) : this; } addChanges(e, r, n, i, s) { let a = this.done, o = a[a.length - 1]; - return o && o.changes && !o.changes.empty && e.changes && (!n || h5e.test(n)) && (!o.selectionsAfter.length && r - this.prevTime < i.newGroupDelay && i.joinToEvent(s, a5e(o.changes, e.changes)) || n == "input.type.compose") ? a = J5(a, a.length - 1, i.minDepth, new $a(e.changes.compose(o.changes), BJ(e.effects, o.effects), o.mapped, o.startSelection, Bo)) : a = J5(a, a.length, i.minDepth, e), new Oc(a, Bo, r, n); + return o && o.changes && !o.changes.empty && e.changes && (!n || tke.test(n)) && (!o.selectionsAfter.length && r - this.prevTime < i.newGroupDelay && i.joinToEvent(s, Z5e(o.changes, e.changes)) || n == "input.type.compose") ? a = Ck(a, a.length - 1, i.minDepth, new to(e.changes.compose(o.changes), bee(e.effects, o.effects), o.mapped, o.startSelection, tl)) : a = Ck(a, a.length, i.minDepth, e), new Qc(a, tl, r, n); } addSelection(e, r, n, i) { - let s = this.done.length ? this.done[this.done.length - 1].selectionsAfter : Bo; - return s.length > 0 && r - this.prevTime < i && n == this.prevUserEvent && n && /^select($|\.)/.test(n) && o5e(s[s.length - 1], e) ? this : new Oc(FJ(this.done, e), this.undone, r, n); + let s = this.done.length ? this.done[this.done.length - 1].selectionsAfter : tl; + return s.length > 0 && r - this.prevTime < i && n == this.prevUserEvent && n && /^select($|\.)/.test(n) && j5e(s[s.length - 1], e) ? this : new Qc(xee(this.done, e), this.undone, r, n); } addMapping(e) { - return new Oc(r6(this.done, e), r6(this.undone, e), this.prevTime, this.prevUserEvent); + return new Qc(R_(this.done, e), R_(this.undone, e), this.prevTime, this.prevUserEvent); } pop(e, r, n) { let i = e == 0 ? this.done : this.undone; @@ -13148,17 +13148,17 @@ class Oc { if (n && s.selectionsAfter.length) return r.update({ selection: s.selectionsAfter[s.selectionsAfter.length - 1], - annotations: j7.of({ side: e, rest: c5e(i), selection: a }), + annotations: C8.of({ side: e, rest: J5e(i), selection: a }), userEvent: e == 0 ? "select.undo" : "select.redo", scrollIntoView: !0 }); if (s.changes) { - let o = i.length == 1 ? Bo : i.slice(0, i.length - 1); - return s.mapped && (o = r6(o, s.mapped)), r.update({ + let o = i.length == 1 ? tl : i.slice(0, i.length - 1); + return s.mapped && (o = R_(o, s.mapped)), r.update({ changes: s.changes, selection: s.startSelection, effects: s.effects, - annotations: j7.of({ side: e, rest: o, selection: a }), + annotations: C8.of({ side: e, rest: o, selection: a }), filter: !1, userEvent: e == 0 ? "undo" : "redo", scrollIntoView: !0 @@ -13167,69 +13167,69 @@ class Oc { return null; } } -Oc.empty = /* @__PURE__ */ new Oc(Bo, Bo); -const zJ = [ - { key: "Mod-z", run: $J, preventDefault: !0 }, - { key: "Mod-y", mac: "Mod-Shift-z", run: K5, preventDefault: !0 }, - { linux: "Ctrl-Shift-z", run: K5, preventDefault: !0 }, - { key: "Mod-u", run: i5e, preventDefault: !0 }, - { key: "Alt-u", mac: "Mod-Shift-u", run: s5e, preventDefault: !0 } +Qc.empty = /* @__PURE__ */ new Qc(tl, tl); +const wee = [ + { key: "Mod-z", run: yee, preventDefault: !0 }, + { key: "Mod-y", mac: "Mod-Shift-z", run: Tk, preventDefault: !0 }, + { linux: "Ctrl-Shift-z", run: Tk, preventDefault: !0 }, + { key: "Mod-u", run: X5e, preventDefault: !0 }, + { key: "Alt-u", mac: "Mod-Shift-u", run: H5e, preventDefault: !0 } ]; -function Km(t, e) { - return Ue.create(t.ranges.map(e), t.mainIndex); +function b1(t, e) { + return je.create(t.ranges.map(e), t.mainIndex); } -function jc(t, e) { +function gu(t, e) { return t.update({ selection: e, scrollIntoView: !0, userEvent: "select" }); } -function Gl({ state: t, dispatch: e }, r) { - let n = Km(t.selection, r); - return n.eq(t.selection) ? !1 : (e(jc(t, n)), !0); +function hc({ state: t, dispatch: e }, r) { + let n = b1(t.selection, r); + return n.eq(t.selection) ? !1 : (e(gu(t, n)), !0); } -function dT(t, e) { - return Ue.cursor(e ? t.to : t.from); +function zT(t, e) { + return je.cursor(e ? t.to : t.from); } -function QJ(t, e) { - return Gl(t, (r) => r.empty ? t.moveByChar(r, e) : dT(r, e)); +function Oee(t, e) { + return hc(t, (r) => r.empty ? t.moveByChar(r, e) : zT(r, e)); } -function Ys(t) { - return t.textDirectionAt(t.state.selection.main.head) == Pn.LTR; +function sa(t) { + return t.textDirectionAt(t.state.selection.main.head) == Wn.LTR; } -const UJ = (t) => QJ(t, !Ys(t)), VJ = (t) => QJ(t, Ys(t)); -function qJ(t, e) { - return Gl(t, (r) => r.empty ? t.moveByGroup(r, e) : dT(r, e)); +const kee = (t) => Oee(t, !sa(t)), See = (t) => Oee(t, sa(t)); +function Tee(t, e) { + return hc(t, (r) => r.empty ? t.moveByGroup(r, e) : zT(r, e)); } -const f5e = (t) => qJ(t, !Ys(t)), d5e = (t) => qJ(t, Ys(t)); -function p5e(t, e, r) { +const rke = (t) => Tee(t, !sa(t)), nke = (t) => Tee(t, sa(t)); +function ike(t, e, r) { if (e.type.prop(r)) return !0; let n = e.to - e.from; return n && (n > 2 || /[^\s,.;:]/.test(t.sliceDoc(e.from, e.to))) || e.firstChild; } -function pT(t, e, r) { - let n = dn(t).resolveInner(e.head), i = r ? or.closedBy : or.openedBy; +function QT(t, e, r) { + let n = Cn(t).resolveInner(e.head), i = r ? yr.closedBy : yr.openedBy; for (let l = e.head; ; ) { let u = r ? n.childAfter(l) : n.childBefore(l); if (!u) break; - p5e(t, u, i) ? n = u : l = r ? u.to : u.from; + ike(t, u, i) ? n = u : l = r ? u.to : u.from; } let s = n.type.prop(i), a, o; - return s && (a = r ? wc(t, n.from, 1) : wc(t, n.to, -1)) && a.matched ? o = r ? a.end.to : a.end.from : o = r ? n.to : n.from, Ue.cursor(o, r ? -1 : 1); + return s && (a = r ? zc(t, n.from, 1) : zc(t, n.to, -1)) && a.matched ? o = r ? a.end.to : a.end.from : o = r ? n.to : n.from, je.cursor(o, r ? -1 : 1); } -const g5e = (t) => Gl(t, (e) => pT(t.state, e, !Ys(t))), m5e = (t) => Gl(t, (e) => pT(t.state, e, Ys(t))); -function YJ(t, e) { - return Gl(t, (r) => { +const ske = (t) => hc(t, (e) => QT(t.state, e, !sa(t))), ake = (t) => hc(t, (e) => QT(t.state, e, sa(t))); +function Cee(t, e) { + return hc(t, (r) => { if (!r.empty) - return dT(r, e); + return zT(r, e); let n = t.moveVertically(r, e); return n.head != r.head ? n : t.moveToLineBoundary(r, e); }); } -const WJ = (t) => YJ(t, !1), GJ = (t) => YJ(t, !0); -function XJ(t) { +const Eee = (t) => Cee(t, !1), _ee = (t) => Cee(t, !0); +function Aee(t) { let e = t.scrollDOM.clientHeight < t.scrollDOM.scrollHeight - 2, r = 0, n = 0, i; if (e) { - for (let s of t.state.facet(ft.scrollMargins)) { + for (let s of t.state.facet(kt.scrollMargins)) { let a = s(t); a != null && a.top && (r = Math.max(a == null ? void 0 : a.top, r)), a != null && a.bottom && (n = Math.max(a == null ? void 0 : a.bottom, n)); } @@ -13243,163 +13243,163 @@ function XJ(t) { height: Math.max(t.defaultLineHeight, i - 5) }; } -function HJ(t, e) { - let r = XJ(t), { state: n } = t, i = Km(n.selection, (a) => a.empty ? t.moveVertically(a, e, r.height) : dT(a, e)); +function Lee(t, e) { + let r = Aee(t), { state: n } = t, i = b1(n.selection, (a) => a.empty ? t.moveVertically(a, e, r.height) : zT(a, e)); if (i.eq(n.selection)) return !1; let s; if (r.selfScroll) { let a = t.coordsAtPos(n.selection.main.head), o = t.scrollDOM.getBoundingClientRect(), l = o.top + r.marginTop, u = o.bottom - r.marginBottom; - a && a.top > l && a.bottom < u && (s = ft.scrollIntoView(i.main.head, { y: "start", yMargin: a.top - l })); + a && a.top > l && a.bottom < u && (s = kt.scrollIntoView(i.main.head, { y: "start", yMargin: a.top - l })); } - return t.dispatch(jc(n, i), { effects: s }), !0; + return t.dispatch(gu(n, i), { effects: s }), !0; } -const jF = (t) => HJ(t, !1), K7 = (t) => HJ(t, !0); -function Hf(t, e, r) { +const Mz = (t) => Lee(t, !1), E8 = (t) => Lee(t, !0); +function dd(t, e, r) { let n = t.lineBlockAt(e.head), i = t.moveToLineBoundary(e, r); if (i.head == e.head && i.head != (r ? n.to : n.from) && (i = t.moveToLineBoundary(e, r, !1)), !r && i.head == n.from && n.length) { let s = /^\s*/.exec(t.state.sliceDoc(n.from, Math.min(n.from + 100, n.to)))[0].length; - s && e.head != n.from + s && (i = Ue.cursor(n.from + s)); + s && e.head != n.from + s && (i = je.cursor(n.from + s)); } return i; } -const v5e = (t) => Gl(t, (e) => Hf(t, e, !0)), y5e = (t) => Gl(t, (e) => Hf(t, e, !1)), b5e = (t) => Gl(t, (e) => Hf(t, e, !Ys(t))), x5e = (t) => Gl(t, (e) => Hf(t, e, Ys(t))), w5e = (t) => Gl(t, (e) => Ue.cursor(t.lineBlockAt(e.head).from, 1)), O5e = (t) => Gl(t, (e) => Ue.cursor(t.lineBlockAt(e.head).to, -1)); -function k5e(t, e, r) { - let n = !1, i = Km(t.selection, (s) => { - let a = wc(t, s.head, -1) || wc(t, s.head, 1) || s.head > 0 && wc(t, s.head - 1, 1) || s.head < t.doc.length && wc(t, s.head + 1, -1); +const oke = (t) => hc(t, (e) => dd(t, e, !0)), lke = (t) => hc(t, (e) => dd(t, e, !1)), cke = (t) => hc(t, (e) => dd(t, e, !sa(t))), uke = (t) => hc(t, (e) => dd(t, e, sa(t))), hke = (t) => hc(t, (e) => je.cursor(t.lineBlockAt(e.head).from, 1)), fke = (t) => hc(t, (e) => je.cursor(t.lineBlockAt(e.head).to, -1)); +function dke(t, e, r) { + let n = !1, i = b1(t.selection, (s) => { + let a = zc(t, s.head, -1) || zc(t, s.head, 1) || s.head > 0 && zc(t, s.head - 1, 1) || s.head < t.doc.length && zc(t, s.head + 1, -1); if (!a || !a.end) return s; n = !0; let o = a.start.from == s.head ? a.end.to : a.end.from; - return r ? Ue.range(s.anchor, o) : Ue.cursor(o); + return r ? je.range(s.anchor, o) : je.cursor(o); }); - return n ? (e(jc(t, i)), !0) : !1; + return n ? (e(gu(t, i)), !0) : !1; } -const S5e = ({ state: t, dispatch: e }) => k5e(t, e, !1); -function al(t, e) { - let r = Km(t.state.selection, (n) => { +const pke = ({ state: t, dispatch: e }) => dke(t, e, !1); +function kl(t, e) { + let r = b1(t.state.selection, (n) => { let i = e(n); - return Ue.range(n.anchor, i.head, i.goalColumn, i.bidiLevel || void 0); + return je.range(n.anchor, i.head, i.goalColumn, i.bidiLevel || void 0); }); - return r.eq(t.state.selection) ? !1 : (t.dispatch(jc(t.state, r)), !0); + return r.eq(t.state.selection) ? !1 : (t.dispatch(gu(t.state, r)), !0); } -function ZJ(t, e) { - return al(t, (r) => t.moveByChar(r, e)); +function Ree(t, e) { + return kl(t, (r) => t.moveByChar(r, e)); } -const jJ = (t) => ZJ(t, !Ys(t)), KJ = (t) => ZJ(t, Ys(t)); -function JJ(t, e) { - return al(t, (r) => t.moveByGroup(r, e)); +const Mee = (t) => Ree(t, !sa(t)), Dee = (t) => Ree(t, sa(t)); +function Pee(t, e) { + return kl(t, (r) => t.moveByGroup(r, e)); } -const T5e = (t) => JJ(t, !Ys(t)), C5e = (t) => JJ(t, Ys(t)), E5e = (t) => al(t, (e) => pT(t.state, e, !Ys(t))), _5e = (t) => al(t, (e) => pT(t.state, e, Ys(t))); -function eee(t, e) { - return al(t, (r) => t.moveVertically(r, e)); +const gke = (t) => Pee(t, !sa(t)), mke = (t) => Pee(t, sa(t)), vke = (t) => kl(t, (e) => QT(t.state, e, !sa(t))), yke = (t) => kl(t, (e) => QT(t.state, e, sa(t))); +function Nee(t, e) { + return kl(t, (r) => t.moveVertically(r, e)); } -const tee = (t) => eee(t, !1), ree = (t) => eee(t, !0); -function nee(t, e) { - return al(t, (r) => t.moveVertically(r, e, XJ(t).height)); +const Iee = (t) => Nee(t, !1), $ee = (t) => Nee(t, !0); +function Bee(t, e) { + return kl(t, (r) => t.moveVertically(r, e, Aee(t).height)); } -const KF = (t) => nee(t, !1), JF = (t) => nee(t, !0), A5e = (t) => al(t, (e) => Hf(t, e, !0)), L5e = (t) => al(t, (e) => Hf(t, e, !1)), R5e = (t) => al(t, (e) => Hf(t, e, !Ys(t))), M5e = (t) => al(t, (e) => Hf(t, e, Ys(t))), D5e = (t) => al(t, (e) => Ue.cursor(t.lineBlockAt(e.head).from)), P5e = (t) => al(t, (e) => Ue.cursor(t.lineBlockAt(e.head).to)), ez = ({ state: t, dispatch: e }) => (e(jc(t, { anchor: 0 })), !0), tz = ({ state: t, dispatch: e }) => (e(jc(t, { anchor: t.doc.length })), !0), rz = ({ state: t, dispatch: e }) => (e(jc(t, { anchor: t.selection.main.anchor, head: 0 })), !0), nz = ({ state: t, dispatch: e }) => (e(jc(t, { anchor: t.selection.main.anchor, head: t.doc.length })), !0), N5e = ({ state: t, dispatch: e }) => (e(t.update({ selection: { anchor: 0, head: t.doc.length }, userEvent: "select" })), !0), I5e = ({ state: t, dispatch: e }) => { - let r = gT(t).map(({ from: n, to: i }) => Ue.range(n, Math.min(i + 1, t.doc.length))); - return e(t.update({ selection: Ue.create(r), userEvent: "select" })), !0; -}, $5e = ({ state: t, dispatch: e }) => { - let r = Km(t.selection, (n) => { +const Dz = (t) => Bee(t, !1), Pz = (t) => Bee(t, !0), bke = (t) => kl(t, (e) => dd(t, e, !0)), xke = (t) => kl(t, (e) => dd(t, e, !1)), wke = (t) => kl(t, (e) => dd(t, e, !sa(t))), Oke = (t) => kl(t, (e) => dd(t, e, sa(t))), kke = (t) => kl(t, (e) => je.cursor(t.lineBlockAt(e.head).from)), Ske = (t) => kl(t, (e) => je.cursor(t.lineBlockAt(e.head).to)), Nz = ({ state: t, dispatch: e }) => (e(gu(t, { anchor: 0 })), !0), Iz = ({ state: t, dispatch: e }) => (e(gu(t, { anchor: t.doc.length })), !0), $z = ({ state: t, dispatch: e }) => (e(gu(t, { anchor: t.selection.main.anchor, head: 0 })), !0), Bz = ({ state: t, dispatch: e }) => (e(gu(t, { anchor: t.selection.main.anchor, head: t.doc.length })), !0), Tke = ({ state: t, dispatch: e }) => (e(t.update({ selection: { anchor: 0, head: t.doc.length }, userEvent: "select" })), !0), Cke = ({ state: t, dispatch: e }) => { + let r = UT(t).map(({ from: n, to: i }) => je.range(n, Math.min(i + 1, t.doc.length))); + return e(t.update({ selection: je.create(r), userEvent: "select" })), !0; +}, Eke = ({ state: t, dispatch: e }) => { + let r = b1(t.selection, (n) => { var i; - let s = dn(t).resolveStack(n.from, 1); + let s = Cn(t).resolveStack(n.from, 1); for (let a = s; a; a = a.next) { let { node: o } = a; if ((o.from < n.from && o.to >= n.to || o.to > n.to && o.from <= n.from) && ((i = o.parent) === null || i === void 0 ? void 0 : i.parent)) - return Ue.range(o.to, o.from); + return je.range(o.to, o.from); } return n; }); - return e(jc(t, r)), !0; -}, B5e = ({ state: t, dispatch: e }) => { + return e(gu(t, r)), !0; +}, _ke = ({ state: t, dispatch: e }) => { let r = t.selection, n = null; - return r.ranges.length > 1 ? n = Ue.create([r.main]) : r.main.empty || (n = Ue.create([Ue.cursor(r.main.head)])), n ? (e(jc(t, n)), !0) : !1; + return r.ranges.length > 1 ? n = je.create([r.main]) : r.main.empty || (n = je.create([je.cursor(r.main.head)])), n ? (e(gu(t, n)), !0) : !1; }; -function gx(t, e) { +function Fx(t, e) { if (t.state.readOnly) return !1; let r = "delete.selection", { state: n } = t, i = n.changeByRange((s) => { let { from: a, to: o } = s; if (a == o) { let l = e(s); - l < a ? (r = "delete.backward", l = Xw(t, l, !1)) : l > a && (r = "delete.forward", l = Xw(t, l, !0)), a = Math.min(a, l), o = Math.max(o, l); + l < a ? (r = "delete.backward", l = wO(t, l, !1)) : l > a && (r = "delete.forward", l = wO(t, l, !0)), a = Math.min(a, l), o = Math.max(o, l); } else - a = Xw(t, a, !1), o = Xw(t, o, !0); - return a == o ? { range: s } : { changes: { from: a, to: o }, range: Ue.cursor(a, a < s.head ? -1 : 1) }; + a = wO(t, a, !1), o = wO(t, o, !0); + return a == o ? { range: s } : { changes: { from: a, to: o }, range: je.cursor(a, a < s.head ? -1 : 1) }; }); return i.changes.empty ? !1 : (t.dispatch(n.update(i, { scrollIntoView: !0, userEvent: r, - effects: r == "delete.selection" ? ft.announce.of(n.phrase("Selection deleted")) : void 0 + effects: r == "delete.selection" ? kt.announce.of(n.phrase("Selection deleted")) : void 0 })), !0); } -function Xw(t, e, r) { - if (t instanceof ft) - for (let n of t.state.facet(ft.atomicRanges).map((i) => i(t))) +function wO(t, e, r) { + if (t instanceof kt) + for (let n of t.state.facet(kt.atomicRanges).map((i) => i(t))) n.between(e, e, (i, s) => { i < e && s > e && (e = r ? s : i); }); return e; } -const iee = (t, e) => gx(t, (r) => { +const Fee = (t, e) => Fx(t, (r) => { let n = r.from, { state: i } = t, s = i.doc.lineAt(n), a, o; if (!e && n > s.from && n < s.from + 200 && !/[^ \t]/.test(a = s.text.slice(0, n - s.from))) { if (a[a.length - 1] == " ") return n - 1; - let l = $l(a, i.tabSize), u = l % Z5(i) || Z5(i); + let l = tc(a, i.tabSize), u = l % kk(i) || kk(i); for (let h = 0; h < u && a[a.length - 1 - h] == " "; h++) n--; o = n; } else - o = cs(s.text, n - s.from, e, e) + s.from, o == n && s.number != (e ? i.doc.lines : 1) ? o += e ? 1 : -1 : !e && /[\ufe00-\ufe0f]/.test(s.text.slice(o - s.from, n - s.from)) && (o = cs(s.text, o - s.from, !1, !1) + s.from); + o = Os(s.text, n - s.from, e, e) + s.from, o == n && s.number != (e ? i.doc.lines : 1) ? o += e ? 1 : -1 : !e && /[\ufe00-\ufe0f]/.test(s.text.slice(o - s.from, n - s.from)) && (o = Os(s.text, o - s.from, !1, !1) + s.from); return o; -}), J7 = (t) => iee(t, !1), see = (t) => iee(t, !0), aee = (t, e) => gx(t, (r) => { +}), _8 = (t) => Fee(t, !1), zee = (t) => Fee(t, !0), Qee = (t, e) => Fx(t, (r) => { let n = r.head, { state: i } = t, s = i.doc.lineAt(n), a = i.charCategorizer(n); for (let o = null; ; ) { if (n == (e ? s.to : s.from)) { n == r.head && s.number != (e ? i.doc.lines : 1) && (n += e ? 1 : -1); break; } - let l = cs(s.text, n - s.from, e) + s.from, u = s.text.slice(Math.min(n, l) - s.from, Math.max(n, l) - s.from), h = a(u); + let l = Os(s.text, n - s.from, e) + s.from, u = s.text.slice(Math.min(n, l) - s.from, Math.max(n, l) - s.from), h = a(u); if (o != null && h != o) break; (u != " " || n != r.head) && (o = h), n = l; } return n; -}), oee = (t) => aee(t, !1), F5e = (t) => aee(t, !0), z5e = (t) => gx(t, (e) => { +}), Uee = (t) => Qee(t, !1), Ake = (t) => Qee(t, !0), Lke = (t) => Fx(t, (e) => { let r = t.lineBlockAt(e.head).to; return e.head < r ? r : Math.min(t.state.doc.length, e.head + 1); -}), Q5e = (t) => gx(t, (e) => { +}), Rke = (t) => Fx(t, (e) => { let r = t.moveToLineBoundary(e, !1).head; return e.head > r ? r : Math.max(0, e.head - 1); -}), U5e = (t) => gx(t, (e) => { +}), Mke = (t) => Fx(t, (e) => { let r = t.moveToLineBoundary(e, !0).head; return e.head < r ? r : Math.min(t.state.doc.length, e.head + 1); -}), V5e = ({ state: t, dispatch: e }) => { +}), Dke = ({ state: t, dispatch: e }) => { if (t.readOnly) return !1; let r = t.changeByRange((n) => ({ - changes: { from: n.from, to: n.to, insert: Dr.of(["", ""]) }, - range: Ue.cursor(n.from) + changes: { from: n.from, to: n.to, insert: qr.of(["", ""]) }, + range: je.cursor(n.from) })); return e(t.update(r, { scrollIntoView: !0, userEvent: "input" })), !0; -}, q5e = ({ state: t, dispatch: e }) => { +}, Pke = ({ state: t, dispatch: e }) => { if (t.readOnly) return !1; let r = t.changeByRange((n) => { if (!n.empty || n.from == 0 || n.from == t.doc.length) return { range: n }; - let i = n.from, s = t.doc.lineAt(i), a = i == s.from ? i - 1 : cs(s.text, i - s.from, !1) + s.from, o = i == s.to ? i + 1 : cs(s.text, i - s.from, !0) + s.from; + let i = n.from, s = t.doc.lineAt(i), a = i == s.from ? i - 1 : Os(s.text, i - s.from, !1) + s.from, o = i == s.to ? i + 1 : Os(s.text, i - s.from, !0) + s.from; return { changes: { from: a, to: o, insert: t.doc.slice(i, o).append(t.doc.slice(a, i)) }, - range: Ue.cursor(o) + range: je.cursor(o) }; }); return r.changes.empty ? !1 : (e(t.update(r, { scrollIntoView: !0, userEvent: "move.character" })), !0); }; -function gT(t) { +function UT(t) { let e = [], r = -1; for (let n of t.selection.ranges) { let i = t.doc.lineAt(n.from), s = t.doc.lineAt(n.to); @@ -13412,74 +13412,74 @@ function gT(t) { } return e; } -function lee(t, e, r) { +function Vee(t, e, r) { if (t.readOnly) return !1; let n = [], i = []; - for (let s of gT(t)) { + for (let s of UT(t)) { if (r ? s.to == t.doc.length : s.from == 0) continue; let a = t.doc.lineAt(r ? s.to + 1 : s.from - 1), o = a.length + 1; if (r) { n.push({ from: s.to, to: a.to }, { from: s.from, insert: a.text + t.lineBreak }); for (let l of s.ranges) - i.push(Ue.range(Math.min(t.doc.length, l.anchor + o), Math.min(t.doc.length, l.head + o))); + i.push(je.range(Math.min(t.doc.length, l.anchor + o), Math.min(t.doc.length, l.head + o))); } else { n.push({ from: a.from, to: s.from }, { from: s.to, insert: t.lineBreak + a.text }); for (let l of s.ranges) - i.push(Ue.range(l.anchor - o, l.head - o)); + i.push(je.range(l.anchor - o, l.head - o)); } } return n.length ? (e(t.update({ changes: n, scrollIntoView: !0, - selection: Ue.create(i, t.selection.mainIndex), + selection: je.create(i, t.selection.mainIndex), userEvent: "move.line" })), !0) : !1; } -const Y5e = ({ state: t, dispatch: e }) => lee(t, e, !1), W5e = ({ state: t, dispatch: e }) => lee(t, e, !0); -function cee(t, e, r) { +const Nke = ({ state: t, dispatch: e }) => Vee(t, e, !1), Ike = ({ state: t, dispatch: e }) => Vee(t, e, !0); +function qee(t, e, r) { if (t.readOnly) return !1; let n = []; - for (let i of gT(t)) + for (let i of UT(t)) r ? n.push({ from: i.from, insert: t.doc.slice(i.from, i.to) + t.lineBreak }) : n.push({ from: i.to, insert: t.lineBreak + t.doc.slice(i.from, i.to) }); return e(t.update({ changes: n, scrollIntoView: !0, userEvent: "input.copyline" })), !0; } -const G5e = ({ state: t, dispatch: e }) => cee(t, e, !1), X5e = ({ state: t, dispatch: e }) => cee(t, e, !0), H5e = (t) => { +const $ke = ({ state: t, dispatch: e }) => qee(t, e, !1), Bke = ({ state: t, dispatch: e }) => qee(t, e, !0), Fke = (t) => { if (t.state.readOnly) return !1; - let { state: e } = t, r = e.changes(gT(e).map(({ from: i, to: s }) => (i > 0 ? i-- : s < e.doc.length && s++, { from: i, to: s }))), n = Km(e.selection, (i) => t.moveVertically(i, !0)).map(r); + let { state: e } = t, r = e.changes(UT(e).map(({ from: i, to: s }) => (i > 0 ? i-- : s < e.doc.length && s++, { from: i, to: s }))), n = b1(e.selection, (i) => t.moveVertically(i, !0)).map(r); return t.dispatch({ changes: r, selection: n, scrollIntoView: !0, userEvent: "delete.line" }), !0; }; -function Z5e(t, e) { +function zke(t, e) { if (/\(\)|\[\]|\{\}/.test(t.sliceDoc(e - 1, e + 1))) return { from: e, to: e }; - let r = dn(t).resolveInner(e), n = r.childBefore(e), i = r.childAfter(e), s; - return n && i && n.to <= e && i.from >= e && (s = n.type.prop(or.closedBy)) && s.indexOf(i.name) > -1 && t.doc.lineAt(n.to).from == t.doc.lineAt(i.from).from && !/\S/.test(t.sliceDoc(n.to, i.from)) ? { from: n.to, to: i.from } : null; + let r = Cn(t).resolveInner(e), n = r.childBefore(e), i = r.childAfter(e), s; + return n && i && n.to <= e && i.from >= e && (s = n.type.prop(yr.closedBy)) && s.indexOf(i.name) > -1 && t.doc.lineAt(n.to).from == t.doc.lineAt(i.from).from && !/\S/.test(t.sliceDoc(n.to, i.from)) ? { from: n.to, to: i.from } : null; } -const j5e = /* @__PURE__ */ uee(!1), K5e = /* @__PURE__ */ uee(!0); -function uee(t) { +const Qke = /* @__PURE__ */ Yee(!1), Uke = /* @__PURE__ */ Yee(!0); +function Yee(t) { return ({ state: e, dispatch: r }) => { if (e.readOnly) return !1; let n = e.changeByRange((i) => { - let { from: s, to: a } = i, o = e.doc.lineAt(s), l = !t && s == a && Z5e(e, s); + let { from: s, to: a } = i, o = e.doc.lineAt(s), l = !t && s == a && zke(e, s); t && (s = a = (a <= o.to ? o : e.doc.lineAt(a)).to); - let u = new uT(e, { simulateBreak: s, simulateDoubleBreak: !!l }), h = RM(u, s); - for (h == null && (h = $l(/^\s*/.exec(e.doc.lineAt(s).text)[0], e.tabSize)); a < o.to && /\s/.test(o.text[a - o.from]); ) + let u = new $T(e, { simulateBreak: s, simulateDoubleBreak: !!l }), h = aD(u, s); + for (h == null && (h = tc(/^\s*/.exec(e.doc.lineAt(s).text)[0], e.tabSize)); a < o.to && /\s/.test(o.text[a - o.from]); ) a++; l ? { from: s, to: a } = l : s > o.from && s < o.from + 100 && !/\S/.test(o.text.slice(0, s)) && (s = o.from); - let f = ["", Ky(e, h)]; - return l && f.push(Ky(e, u.lineIndent(o.from, -1))), { - changes: { from: s, to: a, insert: Dr.of(f) }, - range: Ue.cursor(s + 1 + f[1].length) + let f = ["", O2(e, h)]; + return l && f.push(O2(e, u.lineIndent(o.from, -1))), { + changes: { from: s, to: a, insert: qr.of(f) }, + range: je.cursor(s + 1 + f[1].length) }; }); return r(e.update(n, { scrollIntoView: !0, userEvent: "input" })), !0; }; } -function BM(t, e) { +function dD(t, e) { let r = -1; return t.changeByRange((n) => { let i = []; @@ -13490,96 +13490,96 @@ function BM(t, e) { let s = t.changes(i); return { changes: i, - range: Ue.range(s.mapPos(n.anchor, 1), s.mapPos(n.head, 1)) + range: je.range(s.mapPos(n.anchor, 1), s.mapPos(n.head, 1)) }; }); } -const J5e = ({ state: t, dispatch: e }) => { +const Vke = ({ state: t, dispatch: e }) => { if (t.readOnly) return !1; - let r = /* @__PURE__ */ Object.create(null), n = new uT(t, { overrideIndentation: (s) => { + let r = /* @__PURE__ */ Object.create(null), n = new $T(t, { overrideIndentation: (s) => { let a = r[s]; return a == null ? -1 : a; - } }), i = BM(t, (s, a, o) => { - let l = RM(n, s.from); + } }), i = dD(t, (s, a, o) => { + let l = aD(n, s.from); if (l == null) return; /\S/.test(s.text) || (l = 0); - let u = /^\s*/.exec(s.text)[0], h = Ky(t, l); + let u = /^\s*/.exec(s.text)[0], h = O2(t, l); (u != h || o.from < s.from + u.length) && (r[s.from] = l, a.push({ from: s.from, to: s.from + u.length, insert: h })); }); return i.changes.empty || e(t.update(i, { userEvent: "indent" })), !0; -}, hee = ({ state: t, dispatch: e }) => t.readOnly ? !1 : (e(t.update(BM(t, (r, n) => { - n.push({ from: r.from, insert: t.facet(px) }); -}), { userEvent: "input.indent" })), !0), fee = ({ state: t, dispatch: e }) => t.readOnly ? !1 : (e(t.update(BM(t, (r, n) => { +}, Wee = ({ state: t, dispatch: e }) => t.readOnly ? !1 : (e(t.update(dD(t, (r, n) => { + n.push({ from: r.from, insert: t.facet(Bx) }); +}), { userEvent: "input.indent" })), !0), Gee = ({ state: t, dispatch: e }) => t.readOnly ? !1 : (e(t.update(dD(t, (r, n) => { let i = /^\s*/.exec(r.text)[0]; if (!i) return; - let s = $l(i, t.tabSize), a = 0, o = Ky(t, Math.max(0, s - Z5(t))); + let s = tc(i, t.tabSize), a = 0, o = O2(t, Math.max(0, s - kk(t))); for (; a < i.length && a < o.length && i.charCodeAt(a) == o.charCodeAt(a); ) a++; n.push({ from: r.from + a, to: r.from + i.length, insert: o.slice(a) }); -}), { userEvent: "delete.dedent" })), !0), eke = [ - { key: "Ctrl-b", run: UJ, shift: jJ, preventDefault: !0 }, - { key: "Ctrl-f", run: VJ, shift: KJ }, - { key: "Ctrl-p", run: WJ, shift: tee }, - { key: "Ctrl-n", run: GJ, shift: ree }, - { key: "Ctrl-a", run: w5e, shift: D5e }, - { key: "Ctrl-e", run: O5e, shift: P5e }, - { key: "Ctrl-d", run: see }, - { key: "Ctrl-h", run: J7 }, - { key: "Ctrl-k", run: z5e }, - { key: "Ctrl-Alt-h", run: oee }, - { key: "Ctrl-o", run: V5e }, - { key: "Ctrl-t", run: q5e }, - { key: "Ctrl-v", run: K7 } -], tke = /* @__PURE__ */ [ - { key: "ArrowLeft", run: UJ, shift: jJ, preventDefault: !0 }, - { key: "Mod-ArrowLeft", mac: "Alt-ArrowLeft", run: f5e, shift: T5e, preventDefault: !0 }, - { mac: "Cmd-ArrowLeft", run: b5e, shift: R5e, preventDefault: !0 }, - { key: "ArrowRight", run: VJ, shift: KJ, preventDefault: !0 }, - { key: "Mod-ArrowRight", mac: "Alt-ArrowRight", run: d5e, shift: C5e, preventDefault: !0 }, - { mac: "Cmd-ArrowRight", run: x5e, shift: M5e, preventDefault: !0 }, - { key: "ArrowUp", run: WJ, shift: tee, preventDefault: !0 }, - { mac: "Cmd-ArrowUp", run: ez, shift: rz }, - { mac: "Ctrl-ArrowUp", run: jF, shift: KF }, - { key: "ArrowDown", run: GJ, shift: ree, preventDefault: !0 }, - { mac: "Cmd-ArrowDown", run: tz, shift: nz }, - { mac: "Ctrl-ArrowDown", run: K7, shift: JF }, - { key: "PageUp", run: jF, shift: KF }, - { key: "PageDown", run: K7, shift: JF }, - { key: "Home", run: y5e, shift: L5e, preventDefault: !0 }, - { key: "Mod-Home", run: ez, shift: rz }, - { key: "End", run: v5e, shift: A5e, preventDefault: !0 }, - { key: "Mod-End", run: tz, shift: nz }, - { key: "Enter", run: j5e }, - { key: "Mod-a", run: N5e }, - { key: "Backspace", run: J7, shift: J7 }, - { key: "Delete", run: see }, - { key: "Mod-Backspace", mac: "Alt-Backspace", run: oee }, - { key: "Mod-Delete", mac: "Alt-Delete", run: F5e }, - { mac: "Mod-Backspace", run: Q5e }, - { mac: "Mod-Delete", run: U5e } -].concat(/* @__PURE__ */ eke.map((t) => ({ mac: t.key, run: t.run, shift: t.shift }))), dee = /* @__PURE__ */ [ - { key: "Alt-ArrowLeft", mac: "Ctrl-ArrowLeft", run: g5e, shift: E5e }, - { key: "Alt-ArrowRight", mac: "Ctrl-ArrowRight", run: m5e, shift: _5e }, - { key: "Alt-ArrowUp", run: Y5e }, - { key: "Shift-Alt-ArrowUp", run: G5e }, - { key: "Alt-ArrowDown", run: W5e }, - { key: "Shift-Alt-ArrowDown", run: X5e }, - { key: "Escape", run: B5e }, - { key: "Mod-Enter", run: K5e }, - { key: "Alt-l", mac: "Ctrl-l", run: I5e }, - { key: "Mod-i", run: $5e, preventDefault: !0 }, - { key: "Mod-[", run: fee }, - { key: "Mod-]", run: hee }, - { key: "Mod-Alt-\\", run: J5e }, - { key: "Shift-Mod-k", run: H5e }, - { key: "Shift-Mod-\\", run: S5e }, - { key: "Mod-/", run: H4e }, - { key: "Alt-A", run: j4e } -].concat(tke), rke = { key: "Tab", run: hee, shift: fee }; -function un() { +}), { userEvent: "delete.dedent" })), !0), qke = [ + { key: "Ctrl-b", run: kee, shift: Mee, preventDefault: !0 }, + { key: "Ctrl-f", run: See, shift: Dee }, + { key: "Ctrl-p", run: Eee, shift: Iee }, + { key: "Ctrl-n", run: _ee, shift: $ee }, + { key: "Ctrl-a", run: hke, shift: kke }, + { key: "Ctrl-e", run: fke, shift: Ske }, + { key: "Ctrl-d", run: zee }, + { key: "Ctrl-h", run: _8 }, + { key: "Ctrl-k", run: Lke }, + { key: "Ctrl-Alt-h", run: Uee }, + { key: "Ctrl-o", run: Dke }, + { key: "Ctrl-t", run: Pke }, + { key: "Ctrl-v", run: E8 } +], Yke = /* @__PURE__ */ [ + { key: "ArrowLeft", run: kee, shift: Mee, preventDefault: !0 }, + { key: "Mod-ArrowLeft", mac: "Alt-ArrowLeft", run: rke, shift: gke, preventDefault: !0 }, + { mac: "Cmd-ArrowLeft", run: cke, shift: wke, preventDefault: !0 }, + { key: "ArrowRight", run: See, shift: Dee, preventDefault: !0 }, + { key: "Mod-ArrowRight", mac: "Alt-ArrowRight", run: nke, shift: mke, preventDefault: !0 }, + { mac: "Cmd-ArrowRight", run: uke, shift: Oke, preventDefault: !0 }, + { key: "ArrowUp", run: Eee, shift: Iee, preventDefault: !0 }, + { mac: "Cmd-ArrowUp", run: Nz, shift: $z }, + { mac: "Ctrl-ArrowUp", run: Mz, shift: Dz }, + { key: "ArrowDown", run: _ee, shift: $ee, preventDefault: !0 }, + { mac: "Cmd-ArrowDown", run: Iz, shift: Bz }, + { mac: "Ctrl-ArrowDown", run: E8, shift: Pz }, + { key: "PageUp", run: Mz, shift: Dz }, + { key: "PageDown", run: E8, shift: Pz }, + { key: "Home", run: lke, shift: xke, preventDefault: !0 }, + { key: "Mod-Home", run: Nz, shift: $z }, + { key: "End", run: oke, shift: bke, preventDefault: !0 }, + { key: "Mod-End", run: Iz, shift: Bz }, + { key: "Enter", run: Qke }, + { key: "Mod-a", run: Tke }, + { key: "Backspace", run: _8, shift: _8 }, + { key: "Delete", run: zee }, + { key: "Mod-Backspace", mac: "Alt-Backspace", run: Uee }, + { key: "Mod-Delete", mac: "Alt-Delete", run: Ake }, + { mac: "Mod-Backspace", run: Rke }, + { mac: "Mod-Delete", run: Mke } +].concat(/* @__PURE__ */ qke.map((t) => ({ mac: t.key, run: t.run, shift: t.shift }))), Xee = /* @__PURE__ */ [ + { key: "Alt-ArrowLeft", mac: "Ctrl-ArrowLeft", run: ske, shift: vke }, + { key: "Alt-ArrowRight", mac: "Ctrl-ArrowRight", run: ake, shift: yke }, + { key: "Alt-ArrowUp", run: Nke }, + { key: "Shift-Alt-ArrowUp", run: $ke }, + { key: "Alt-ArrowDown", run: Ike }, + { key: "Shift-Alt-ArrowDown", run: Bke }, + { key: "Escape", run: _ke }, + { key: "Mod-Enter", run: Uke }, + { key: "Alt-l", mac: "Ctrl-l", run: Cke }, + { key: "Mod-i", run: Eke, preventDefault: !0 }, + { key: "Mod-[", run: Gee }, + { key: "Mod-]", run: Wee }, + { key: "Mod-Alt-\\", run: Vke }, + { key: "Shift-Mod-k", run: Fke }, + { key: "Shift-Mod-\\", run: pke }, + { key: "Mod-/", run: F5e }, + { key: "Alt-A", run: Q5e } +].concat(Yke), Wke = { key: "Tab", run: Wee, shift: Gee }; +function kn() { var t = arguments[0]; typeof t == "string" && (t = document.createElement(t)); var e = 1, r = arguments[1]; @@ -13592,10 +13592,10 @@ function un() { e++; } for (; e < arguments.length; e++) - pee(t, arguments[e]); + Hee(t, arguments[e]); return t; } -function pee(t, e) { +function Hee(t, e) { if (typeof e == "string") t.appendChild(document.createTextNode(e)); else if (e != null) @@ -13603,14 +13603,14 @@ function pee(t, e) { t.appendChild(e); else if (Array.isArray(e)) for (var r = 0; r < e.length; r++) - pee(t, e[r]); + Hee(t, e[r]); else throw new RangeError("Unsupported child node: " + e); } -const iz = typeof String.prototype.normalize == "function" ? (t) => t.normalize("NFKD") : (t) => t; -class Gg { +const Fz = typeof String.prototype.normalize == "function" ? (t) => t.normalize("NFKD") : (t) => t; +class pm { constructor(e, r, n = 0, i = e.length, s, a) { - this.test = a, this.value = { from: 0, to: 0 }, this.done = !1, this.matches = [], this.buffer = "", this.bufferPos = 0, this.iter = e.iterRange(n, i), this.bufferStart = n, this.normalize = s ? (o) => s(iz(o)) : iz, this.query = this.normalize(r); + this.test = a, this.value = { from: 0, to: 0 }, this.done = !1, this.matches = [], this.buffer = "", this.bufferPos = 0, this.iter = e.iterRange(n, i), this.bufferStart = n, this.normalize = s ? (o) => s(Fz(o)) : Fz, this.query = this.normalize(r); } peek() { if (this.bufferPos == this.buffer.length) { @@ -13618,7 +13618,7 @@ class Gg { return -1; this.bufferPos = 0, this.buffer = this.iter.value; } - return as(this.buffer, this.bufferPos); + return bs(this.buffer, this.bufferPos); } next() { for (; this.matches.length; ) @@ -13630,8 +13630,8 @@ class Gg { let e = this.peek(); if (e < 0) return this.done = !0, this; - let r = dM(e), n = this.bufferStart + this.bufferPos; - this.bufferPos += Mo(e); + let r = UM(e), n = this.bufferStart + this.bufferPos; + this.bufferPos += Ho(e); let i = this.normalize(r); for (let s = 0, a = n; ; s++) { let o = i.charCodeAt(s), l = this.match(o, a); @@ -13653,17 +13653,17 @@ class Gg { return this.query.charCodeAt(0) == e && (this.query.length == 1 ? n = { from: r, to: r + 1 } : this.matches.push(1, r)), n && this.test && !this.test(n.from, n.to, this.buffer, this.bufferStart) && (n = null), n; } } -typeof Symbol < "u" && (Gg.prototype[Symbol.iterator] = function() { +typeof Symbol < "u" && (pm.prototype[Symbol.iterator] = function() { return this; }); -const gee = { from: -1, to: -1, match: /* @__PURE__ */ /.*/.exec("") }, FM = "gm" + (/x/.unicode == null ? "" : "u"); -class mee { +const Zee = { from: -1, to: -1, match: /* @__PURE__ */ /.*/.exec("") }, pD = "gm" + (/x/.unicode == null ? "" : "u"); +class jee { constructor(e, r, n, i = 0, s = e.length) { - if (this.text = e, this.to = s, this.curLine = "", this.done = !1, this.value = gee, /\\[sWDnr]|\n|\r|\[\^/.test(r)) - return new vee(e, r, n, i, s); - this.re = new RegExp(r, FM + (n != null && n.ignoreCase ? "i" : "")), this.test = n == null ? void 0 : n.test, this.iter = e.iter(); + if (this.text = e, this.to = s, this.curLine = "", this.done = !1, this.value = Zee, /\\[sWDnr]|\n|\r|\[\^/.test(r)) + return new Kee(e, r, n, i, s); + this.re = new RegExp(r, pD + (n != null && n.ignoreCase ? "i" : "")), this.test = n == null ? void 0 : n.test, this.iter = e.iter(); let a = e.lineAt(i); - this.curLineStart = a.from, this.matchPos = ek(e, i), this.getLine(this.curLineStart); + this.curLineStart = a.from, this.matchPos = Ek(e, i), this.getLine(this.curLineStart); } getLine(e) { this.iter.next(e), this.iter.lineBreak ? this.curLine = "" : (this.curLine = this.iter.value, this.curLineStart + this.curLine.length > this.to && (this.curLine = this.curLine.slice(0, this.to - this.curLineStart)), this.iter.next()); @@ -13677,7 +13677,7 @@ class mee { let r = this.matchPos <= this.to && this.re.exec(this.curLine); if (r) { let n = this.curLineStart + r.index, i = n + r[0].length; - if (this.matchPos = ek(this.text, i + (n == i ? 1 : 0)), n == this.curLineStart + this.curLine.length && this.nextLine(), (n < i || n > this.value.to) && (!this.test || this.test(n, i, r))) + if (this.matchPos = Ek(this.text, i + (n == i ? 1 : 0)), n == this.curLineStart + this.curLine.length && this.nextLine(), (n < i || n > this.value.to) && (!this.test || this.test(n, i, r))) return this.value = { from: n, to: i, match: r }, this; e = this.matchPos - this.curLineStart; } else if (this.curLineStart + this.curLine.length < this.to) @@ -13687,8 +13687,8 @@ class mee { } } } -const n6 = /* @__PURE__ */ new WeakMap(); -class ug { +const M_ = /* @__PURE__ */ new WeakMap(); +class Rg { constructor(e, r) { this.from = e, this.text = r; } @@ -13696,20 +13696,20 @@ class ug { return this.from + this.text.length; } static get(e, r, n) { - let i = n6.get(e); + let i = M_.get(e); if (!i || i.from >= n || i.to <= r) { - let o = new ug(r, e.sliceString(r, n)); - return n6.set(e, o), o; + let o = new Rg(r, e.sliceString(r, n)); + return M_.set(e, o), o; } if (i.from == r && i.to == n) return i; let { text: s, from: a } = i; - return a > r && (s = e.sliceString(r, a) + s, a = r), i.to < n && (s += e.sliceString(i.to, n)), n6.set(e, new ug(a, s)), new ug(r, s.slice(r - a, n - a)); + return a > r && (s = e.sliceString(r, a) + s, a = r), i.to < n && (s += e.sliceString(i.to, n)), M_.set(e, new Rg(a, s)), new Rg(r, s.slice(r - a, n - a)); } } -class vee { +class Kee { constructor(e, r, n, i, s) { - this.text = e, this.to = s, this.done = !1, this.value = gee, this.matchPos = ek(e, i), this.re = new RegExp(r, FM + (n != null && n.ignoreCase ? "i" : "")), this.test = n == null ? void 0 : n.test, this.flat = ug.get(e, i, this.chunkEnd(i + 5e3)); + this.text = e, this.to = s, this.done = !1, this.value = Zee, this.matchPos = Ek(e, i), this.re = new RegExp(r, pD + (n != null && n.ignoreCase ? "i" : "")), this.test = n == null ? void 0 : n.test, this.flat = Rg.get(e, i, this.chunkEnd(i + 5e3)); } chunkEnd(e) { return e >= this.to ? this.to : this.text.lineAt(e).to; @@ -13720,25 +13720,25 @@ class vee { if (r && !r[0] && r.index == e && (this.re.lastIndex = e + 1, r = this.re.exec(this.flat.text)), r) { let n = this.flat.from + r.index, i = n + r[0].length; if ((this.flat.to >= this.to || r.index + r[0].length <= this.flat.text.length - 10) && (!this.test || this.test(n, i, r))) - return this.value = { from: n, to: i, match: r }, this.matchPos = ek(this.text, i + (n == i ? 1 : 0)), this; + return this.value = { from: n, to: i, match: r }, this.matchPos = Ek(this.text, i + (n == i ? 1 : 0)), this; } if (this.flat.to == this.to) return this.done = !0, this; - this.flat = ug.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + this.flat.text.length * 2)); + this.flat = Rg.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + this.flat.text.length * 2)); } } } -typeof Symbol < "u" && (mee.prototype[Symbol.iterator] = vee.prototype[Symbol.iterator] = function() { +typeof Symbol < "u" && (jee.prototype[Symbol.iterator] = Kee.prototype[Symbol.iterator] = function() { return this; }); -function nke(t) { +function Gke(t) { try { - return new RegExp(t, FM), !0; + return new RegExp(t, pD), !0; } catch { return !1; } } -function ek(t, e) { +function Ek(t, e) { if (e >= t.length) return e; let r = t.lineAt(e), n; @@ -13746,16 +13746,16 @@ function ek(t, e) { e++; return e; } -function e8(t) { - let e = String(t.state.doc.lineAt(t.state.selection.main.head).number), r = un("input", { class: "cm-textfield", name: "line", value: e }), n = un("form", { +function A8(t) { + let e = String(t.state.doc.lineAt(t.state.selection.main.head).number), r = kn("input", { class: "cm-textfield", name: "line", value: e }), n = kn("form", { class: "cm-gotoLine", onkeydown: (s) => { - s.keyCode == 27 ? (s.preventDefault(), t.dispatch({ effects: tk.of(!1) }), t.focus()) : s.keyCode == 13 && (s.preventDefault(), i()); + s.keyCode == 27 ? (s.preventDefault(), t.dispatch({ effects: _k.of(!1) }), t.focus()) : s.keyCode == 13 && (s.preventDefault(), i()); }, onsubmit: (s) => { s.preventDefault(), i(); } - }, un("label", t.state.phrase("Go to line"), ": ", r), " ", un("button", { class: "cm-button", type: "submit" }, t.state.phrase("go"))); + }, kn("label", t.state.phrase("Go to line"), ": ", r), " ", kn("button", { class: "cm-button", type: "submit" }, t.state.phrase("go"))); function i() { let s = /^([+-])?(\d+)?(:\d+)?(%)?$/.exec(r.value); if (!s) @@ -13766,62 +13766,62 @@ function e8(t) { l && (v = v * (l == "-" ? -1 : 1) + o.number / a.doc.lines), p = Math.round(a.doc.lines * v); } else u && l && (p = p * (l == "-" ? -1 : 1) + o.number); - let g = a.doc.line(Math.max(1, Math.min(a.doc.lines, p))), m = Ue.cursor(g.from + Math.max(0, Math.min(d, g.length))); + let g = a.doc.line(Math.max(1, Math.min(a.doc.lines, p))), m = je.cursor(g.from + Math.max(0, Math.min(d, g.length))); t.dispatch({ - effects: [tk.of(!1), ft.scrollIntoView(m.from, { y: "center" })], + effects: [_k.of(!1), kt.scrollIntoView(m.from, { y: "center" })], selection: m }), t.focus(); } return { dom: n }; } -const tk = /* @__PURE__ */ jt.define(), sz = /* @__PURE__ */ In.define({ +const _k = /* @__PURE__ */ or.define(), zz = /* @__PURE__ */ Xn.define({ create() { return !0; }, update(t, e) { for (let r of e.effects) - r.is(tk) && (t = r.value); + r.is(_k) && (t = r.value); return t; }, - provide: (t) => Xy.from(t, (e) => e ? e8 : null) -}), ike = (t) => { - let e = Gy(t, e8); + provide: (t) => y2.from(t, (e) => e ? A8 : null) +}), Xke = (t) => { + let e = v2(t, A8); if (!e) { - let r = [tk.of(!0)]; - t.state.field(sz, !1) == null && r.push(jt.appendConfig.of([sz, ske])), t.dispatch({ effects: r }), e = Gy(t, e8); + let r = [_k.of(!0)]; + t.state.field(zz, !1) == null && r.push(or.appendConfig.of([zz, Hke])), t.dispatch({ effects: r }), e = v2(t, A8); } return e && e.dom.querySelector("input").select(), !0; -}, ske = /* @__PURE__ */ ft.baseTheme({ +}, Hke = /* @__PURE__ */ kt.baseTheme({ ".cm-panel.cm-gotoLine": { padding: "2px 6px 4px", "& label": { fontSize: "80%" } } -}), ake = { +}), Zke = { highlightWordAroundCursor: !1, minSelectionLength: 1, maxMatches: 100, wholeWords: !1 -}, yee = /* @__PURE__ */ At.define({ +}, Jee = /* @__PURE__ */ $t.define({ combine(t) { - return Zc(t, ake, { + return pu(t, Zke, { highlightWordAroundCursor: (e, r) => e || r, minSelectionLength: Math.min, maxMatches: Math.min }); } }); -function oke(t) { - let e = [fke, hke]; - return t && e.push(yee.of(t)), e; +function jke(t) { + let e = [r3e, t3e]; + return t && e.push(Jee.of(t)), e; } -const lke = /* @__PURE__ */ _t.mark({ class: "cm-selectionMatch" }), cke = /* @__PURE__ */ _t.mark({ class: "cm-selectionMatch cm-selectionMatch-main" }); -function az(t, e, r, n) { - return (r == 0 || t(e.sliceDoc(r - 1, r)) != Tn.Word) && (n == e.doc.length || t(e.sliceDoc(n, n + 1)) != Tn.Word); +const Kke = /* @__PURE__ */ It.mark({ class: "cm-selectionMatch" }), Jke = /* @__PURE__ */ It.mark({ class: "cm-selectionMatch cm-selectionMatch-main" }); +function Qz(t, e, r, n) { + return (r == 0 || t(e.sliceDoc(r - 1, r)) != Fn.Word) && (n == e.doc.length || t(e.sliceDoc(n, n + 1)) != Fn.Word); } -function uke(t, e, r, n) { - return t(e.sliceDoc(r, r + 1)) == Tn.Word && t(e.sliceDoc(n - 1, n)) == Tn.Word; +function e3e(t, e, r, n) { + return t(e.sliceDoc(r, r + 1)) == Fn.Word && t(e.sliceDoc(n - 1, n)) == Fn.Word; } -const hke = /* @__PURE__ */ Jr.fromClass(class { +const t3e = /* @__PURE__ */ hn.fromClass(class { constructor(t) { this.decorations = this.getDeco(t); } @@ -13829,54 +13829,54 @@ const hke = /* @__PURE__ */ Jr.fromClass(class { (t.selectionSet || t.docChanged || t.viewportChanged) && (this.decorations = this.getDeco(t.view)); } getDeco(t) { - let e = t.state.facet(yee), { state: r } = t, n = r.selection; + let e = t.state.facet(Jee), { state: r } = t, n = r.selection; if (n.ranges.length > 1) - return _t.none; + return It.none; let i = n.main, s, a = null; if (i.empty) { if (!e.highlightWordAroundCursor) - return _t.none; + return It.none; let l = r.wordAt(i.head); if (!l) - return _t.none; + return It.none; a = r.charCategorizer(i.head), s = r.sliceDoc(l.from, l.to); } else { let l = i.to - i.from; if (l < e.minSelectionLength || l > 200) - return _t.none; + return It.none; if (e.wholeWords) { - if (s = r.sliceDoc(i.from, i.to), a = r.charCategorizer(i.head), !(az(a, r, i.from, i.to) && uke(a, r, i.from, i.to))) - return _t.none; + if (s = r.sliceDoc(i.from, i.to), a = r.charCategorizer(i.head), !(Qz(a, r, i.from, i.to) && e3e(a, r, i.from, i.to))) + return It.none; } else if (s = r.sliceDoc(i.from, i.to).trim(), !s) - return _t.none; + return It.none; } let o = []; for (let l of t.visibleRanges) { - let u = new Gg(r.doc, s, l.from, l.to); + let u = new pm(r.doc, s, l.from, l.to); for (; !u.next().done; ) { let { from: h, to: f } = u.value; - if ((!a || az(a, r, h, f)) && (i.empty && h <= i.from && f >= i.to ? o.push(cke.range(h, f)) : (h >= i.to || f <= i.from) && o.push(lke.range(h, f)), o.length > e.maxMatches)) - return _t.none; + if ((!a || Qz(a, r, h, f)) && (i.empty && h <= i.from && f >= i.to ? o.push(Jke.range(h, f)) : (h >= i.to || f <= i.from) && o.push(Kke.range(h, f)), o.length > e.maxMatches)) + return It.none; } } - return _t.set(o); + return It.set(o); } }, { decorations: (t) => t.decorations -}), fke = /* @__PURE__ */ ft.baseTheme({ +}), r3e = /* @__PURE__ */ kt.baseTheme({ ".cm-selectionMatch": { backgroundColor: "#99ff7780" }, ".cm-searchMatch .cm-selectionMatch": { backgroundColor: "transparent" } -}), dke = ({ state: t, dispatch: e }) => { - let { selection: r } = t, n = Ue.create(r.ranges.map((i) => t.wordAt(i.head) || Ue.cursor(i.head)), r.mainIndex); +}), n3e = ({ state: t, dispatch: e }) => { + let { selection: r } = t, n = je.create(r.ranges.map((i) => t.wordAt(i.head) || je.cursor(i.head)), r.mainIndex); return n.eq(r) ? !1 : (e(t.update({ selection: n })), !0); }; -function pke(t, e) { +function i3e(t, e) { let { main: r, ranges: n } = t.selection, i = t.wordAt(r.head), s = i && i.from == r.from && i.to == r.to; - for (let a = !1, o = new Gg(t.doc, e, n[n.length - 1].to); ; ) + for (let a = !1, o = new pm(t.doc, e, n[n.length - 1].to); ; ) if (o.next(), o.done) { if (a) return null; - o = new Gg(t.doc, e, 0, Math.max(0, n[n.length - 1].from - 1)), a = !0; + o = new pm(t.doc, e, 0, Math.max(0, n[n.length - 1].from - 1)), a = !0; } else { if (a && n.some((l) => l.from == o.value.from)) continue; @@ -13888,34 +13888,34 @@ function pke(t, e) { return o.value; } } -const gke = ({ state: t, dispatch: e }) => { +const s3e = ({ state: t, dispatch: e }) => { let { ranges: r } = t.selection; if (r.some((s) => s.from === s.to)) - return dke({ state: t, dispatch: e }); + return n3e({ state: t, dispatch: e }); let n = t.sliceDoc(r[0].from, r[0].to); if (t.selection.ranges.some((s) => t.sliceDoc(s.from, s.to) != n)) return !1; - let i = pke(t, n); + let i = i3e(t, n); return i ? (e(t.update({ - selection: t.selection.addRange(Ue.range(i.from, i.to), !1), - effects: ft.scrollIntoView(i.to) + selection: t.selection.addRange(je.range(i.from, i.to), !1), + effects: kt.scrollIntoView(i.to) })), !0) : !1; -}, Jm = /* @__PURE__ */ At.define({ +}, x1 = /* @__PURE__ */ $t.define({ combine(t) { - return Zc(t, { + return pu(t, { top: !1, caseSensitive: !1, literal: !1, regexp: !1, wholeWord: !1, - createPanel: (e) => new Eke(e), - scrollToMatch: (e) => ft.scrollIntoView(e) + createPanel: (e) => new v3e(e), + scrollToMatch: (e) => kt.scrollIntoView(e) }); } }); -class bee { +class ete { constructor(e) { - this.search = e.search, this.caseSensitive = !!e.caseSensitive, this.literal = !!e.literal, this.regexp = !!e.regexp, this.replace = e.replace || "", this.valid = !!this.search && (!this.regexp || nke(this.search)), this.unquoted = this.unquote(this.search), this.wholeWord = !!e.wholeWord; + this.search = e.search, this.caseSensitive = !!e.caseSensitive, this.literal = !!e.literal, this.regexp = !!e.regexp, this.replace = e.replace || "", this.valid = !!this.search && (!this.regexp || Gke(this.search)), this.unquoted = this.unquote(this.search), this.wholeWord = !!e.wholeWord; } unquote(e) { return this.literal ? e : e.replace(/\\([nrt\\])/g, (r, n) => n == "n" ? ` @@ -13925,35 +13925,35 @@ class bee { return this.search == e.search && this.replace == e.replace && this.caseSensitive == e.caseSensitive && this.regexp == e.regexp && this.wholeWord == e.wholeWord; } create() { - return this.regexp ? new bke(this) : new vke(this); + return this.regexp ? new c3e(this) : new o3e(this); } getCursor(e, r = 0, n) { - let i = e.doc ? e : dr.create({ doc: e }); - return n == null && (n = i.doc.length), this.regexp ? $p(this, i, r, n) : Ip(this, i, r, n); + let i = e.doc ? e : Sr.create({ doc: e }); + return n == null && (n = i.doc.length), this.regexp ? ig(this, i, r, n) : ng(this, i, r, n); } } -class xee { +class tte { constructor(e) { this.spec = e; } } -function Ip(t, e, r, n) { - return new Gg(e.doc, t.unquoted, r, n, t.caseSensitive ? void 0 : (i) => i.toLowerCase(), t.wholeWord ? mke(e.doc, e.charCategorizer(e.selection.main.head)) : void 0); +function ng(t, e, r, n) { + return new pm(e.doc, t.unquoted, r, n, t.caseSensitive ? void 0 : (i) => i.toLowerCase(), t.wholeWord ? a3e(e.doc, e.charCategorizer(e.selection.main.head)) : void 0); } -function mke(t, e) { - return (r, n, i, s) => ((s > r || s + i.length < n) && (s = Math.max(0, r - 2), i = t.sliceString(s, Math.min(t.length, n + 2))), (e(rk(i, r - s)) != Tn.Word || e(nk(i, r - s)) != Tn.Word) && (e(nk(i, n - s)) != Tn.Word || e(rk(i, n - s)) != Tn.Word)); +function a3e(t, e) { + return (r, n, i, s) => ((s > r || s + i.length < n) && (s = Math.max(0, r - 2), i = t.sliceString(s, Math.min(t.length, n + 2))), (e(Ak(i, r - s)) != Fn.Word || e(Lk(i, r - s)) != Fn.Word) && (e(Lk(i, n - s)) != Fn.Word || e(Ak(i, n - s)) != Fn.Word)); } -class vke extends xee { +class o3e extends tte { constructor(e) { super(e); } nextMatch(e, r, n) { - let i = Ip(this.spec, e, n, e.doc.length).nextOverlapping(); - return i.done && (i = Ip(this.spec, e, 0, r).nextOverlapping()), i.done ? null : i.value; + let i = ng(this.spec, e, n, e.doc.length).nextOverlapping(); + return i.done && (i = ng(this.spec, e, 0, r).nextOverlapping()), i.done ? null : i.value; } prevMatchInRange(e, r, n) { for (let i = n; ; ) { - let s = Math.max(r, i - 1e4 - this.spec.unquoted.length), a = Ip(this.spec, e, s, i), o = null; + let s = Math.max(r, i - 1e4 - this.spec.unquoted.length), a = ng(this.spec, e, s, i), o = null; for (; !a.nextOverlapping().done; ) o = a.value; if (o) @@ -13970,7 +13970,7 @@ class vke extends xee { return this.spec.unquote(this.spec.replace); } matchAll(e, r) { - let n = Ip(this.spec, e, 0, e.doc.length), i = []; + let n = ng(this.spec, e, 0, e.doc.length), i = []; for (; !n.next().done; ) { if (i.length >= r) return null; @@ -13979,34 +13979,34 @@ class vke extends xee { return i; } highlight(e, r, n, i) { - let s = Ip(this.spec, e, Math.max(0, r - this.spec.unquoted.length), Math.min(n + this.spec.unquoted.length, e.doc.length)); + let s = ng(this.spec, e, Math.max(0, r - this.spec.unquoted.length), Math.min(n + this.spec.unquoted.length, e.doc.length)); for (; !s.next().done; ) i(s.value.from, s.value.to); } } -function $p(t, e, r, n) { - return new mee(e.doc, t.search, { +function ig(t, e, r, n) { + return new jee(e.doc, t.search, { ignoreCase: !t.caseSensitive, - test: t.wholeWord ? yke(e.charCategorizer(e.selection.main.head)) : void 0 + test: t.wholeWord ? l3e(e.charCategorizer(e.selection.main.head)) : void 0 }, r, n); } -function rk(t, e) { - return t.slice(cs(t, e, !1), e); +function Ak(t, e) { + return t.slice(Os(t, e, !1), e); } -function nk(t, e) { - return t.slice(e, cs(t, e)); +function Lk(t, e) { + return t.slice(e, Os(t, e)); } -function yke(t) { - return (e, r, n) => !n[0].length || (t(rk(n.input, n.index)) != Tn.Word || t(nk(n.input, n.index)) != Tn.Word) && (t(nk(n.input, n.index + n[0].length)) != Tn.Word || t(rk(n.input, n.index + n[0].length)) != Tn.Word); +function l3e(t) { + return (e, r, n) => !n[0].length || (t(Ak(n.input, n.index)) != Fn.Word || t(Lk(n.input, n.index)) != Fn.Word) && (t(Lk(n.input, n.index + n[0].length)) != Fn.Word || t(Ak(n.input, n.index + n[0].length)) != Fn.Word); } -class bke extends xee { +class c3e extends tte { nextMatch(e, r, n) { - let i = $p(this.spec, e, n, e.doc.length).next(); - return i.done && (i = $p(this.spec, e, 0, r).next()), i.done ? null : i.value; + let i = ig(this.spec, e, n, e.doc.length).next(); + return i.done && (i = ig(this.spec, e, 0, r).next()), i.done ? null : i.value; } prevMatchInRange(e, r, n) { for (let i = 1; ; i++) { - let s = Math.max(r, n - i * 1e4), a = $p(this.spec, e, s, n), o = null; + let s = Math.max(r, n - i * 1e4), a = ig(this.spec, e, s, n), o = null; for (; !a.next().done; ) o = a.value; if (o && (s == r || o.from > s + 10)) @@ -14022,7 +14022,7 @@ class bke extends xee { return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g, (r, n) => n == "$" ? "$" : n == "&" ? e.match[0] : n != "0" && +n < e.match.length ? e.match[n] : r); } matchAll(e, r) { - let n = $p(this.spec, e, 0, e.doc.length), i = []; + let n = ig(this.spec, e, 0, e.doc.length), i = []; for (; !n.next().done; ) { if (i.length >= r) return null; @@ -14031,46 +14031,46 @@ class bke extends xee { return i; } highlight(e, r, n, i) { - let s = $p(this.spec, e, Math.max(0, r - 250), Math.min(n + 250, e.doc.length)); + let s = ig(this.spec, e, Math.max(0, r - 250), Math.min(n + 250, e.doc.length)); for (; !s.next().done; ) i(s.value.from, s.value.to); } } -const e2 = /* @__PURE__ */ jt.define(), zM = /* @__PURE__ */ jt.define(), tf = /* @__PURE__ */ In.define({ +const S2 = /* @__PURE__ */ or.define(), gD = /* @__PURE__ */ or.define(), xf = /* @__PURE__ */ Xn.define({ create(t) { - return new i6(t8(t).create(), null); + return new D_(L8(t).create(), null); }, update(t, e) { for (let r of e.effects) - r.is(e2) ? t = new i6(r.value.create(), t.panel) : r.is(zM) && (t = new i6(t.query, r.value ? QM : null)); + r.is(S2) ? t = new D_(r.value.create(), t.panel) : r.is(gD) && (t = new D_(t.query, r.value ? mD : null)); return t; }, - provide: (t) => Xy.from(t, (e) => e.panel) + provide: (t) => y2.from(t, (e) => e.panel) }); -class i6 { +class D_ { constructor(e, r) { this.query = e, this.panel = r; } } -const xke = /* @__PURE__ */ _t.mark({ class: "cm-searchMatch" }), wke = /* @__PURE__ */ _t.mark({ class: "cm-searchMatch cm-searchMatch-selected" }), Oke = /* @__PURE__ */ Jr.fromClass(class { +const u3e = /* @__PURE__ */ It.mark({ class: "cm-searchMatch" }), h3e = /* @__PURE__ */ It.mark({ class: "cm-searchMatch cm-searchMatch-selected" }), f3e = /* @__PURE__ */ hn.fromClass(class { constructor(t) { - this.view = t, this.decorations = this.highlight(t.state.field(tf)); + this.view = t, this.decorations = this.highlight(t.state.field(xf)); } update(t) { - let e = t.state.field(tf); - (e != t.startState.field(tf) || t.docChanged || t.selectionSet || t.viewportChanged) && (this.decorations = this.highlight(e)); + let e = t.state.field(xf); + (e != t.startState.field(xf) || t.docChanged || t.selectionSet || t.viewportChanged) && (this.decorations = this.highlight(e)); } highlight({ query: t, panel: e }) { if (!e || !t.spec.valid) - return _t.none; - let { view: r } = this, n = new Hi(); + return It.none; + let { view: r } = this, n = new os(); for (let i = 0, s = r.visibleRanges, a = s.length; i < a; i++) { let { from: o, to: l } = s[i]; for (; i < a - 1 && l > s[i + 1].from - 2 * 250; ) l = s[++i].to; t.highlight(r.state, o, l, (u, h) => { let f = r.state.selection.ranges.some((d) => d.from == u && d.to == h); - n.add(u, h, f ? wke : xke); + n.add(u, h, f ? h3e : u3e); }); } return n.finish(); @@ -14078,53 +14078,53 @@ const xke = /* @__PURE__ */ _t.mark({ class: "cm-searchMatch" }), wke = /* @__PU }, { decorations: (t) => t.decorations }); -function mx(t) { +function zx(t) { return (e) => { - let r = e.state.field(tf, !1); - return r && r.query.spec.valid ? t(e, r) : kee(e); + let r = e.state.field(xf, !1); + return r && r.query.spec.valid ? t(e, r) : ite(e); }; } -const ik = /* @__PURE__ */ mx((t, { query: e }) => { +const Rk = /* @__PURE__ */ zx((t, { query: e }) => { let { to: r } = t.state.selection.main, n = e.nextMatch(t.state, r, r); if (!n) return !1; - let i = Ue.single(n.from, n.to), s = t.state.facet(Jm); + let i = je.single(n.from, n.to), s = t.state.facet(x1); return t.dispatch({ selection: i, - effects: [UM(t, n), s.scrollToMatch(i.main, t)], + effects: [vD(t, n), s.scrollToMatch(i.main, t)], userEvent: "select.search" - }), Oee(t), !0; -}), sk = /* @__PURE__ */ mx((t, { query: e }) => { + }), nte(t), !0; +}), Mk = /* @__PURE__ */ zx((t, { query: e }) => { let { state: r } = t, { from: n } = r.selection.main, i = e.prevMatch(r, n, n); if (!i) return !1; - let s = Ue.single(i.from, i.to), a = t.state.facet(Jm); + let s = je.single(i.from, i.to), a = t.state.facet(x1); return t.dispatch({ selection: s, - effects: [UM(t, i), a.scrollToMatch(s.main, t)], + effects: [vD(t, i), a.scrollToMatch(s.main, t)], userEvent: "select.search" - }), Oee(t), !0; -}), kke = /* @__PURE__ */ mx((t, { query: e }) => { + }), nte(t), !0; +}), d3e = /* @__PURE__ */ zx((t, { query: e }) => { let r = e.matchAll(t.state, 1e3); return !r || !r.length ? !1 : (t.dispatch({ - selection: Ue.create(r.map((n) => Ue.range(n.from, n.to))), + selection: je.create(r.map((n) => je.range(n.from, n.to))), userEvent: "select.search.matches" }), !0); -}), Ske = ({ state: t, dispatch: e }) => { +}), p3e = ({ state: t, dispatch: e }) => { let r = t.selection; if (r.ranges.length > 1 || r.main.empty) return !1; let { from: n, to: i } = r.main, s = [], a = 0; - for (let o = new Gg(t.doc, t.sliceDoc(n, i)); !o.next().done; ) { + for (let o = new pm(t.doc, t.sliceDoc(n, i)); !o.next().done; ) { if (s.length > 1e3) return !1; - o.value.from == n && (a = s.length), s.push(Ue.range(o.value.from, o.value.to)); + o.value.from == n && (a = s.length), s.push(je.range(o.value.from, o.value.to)); } return e(t.update({ - selection: Ue.create(s, a), + selection: je.create(s, a), userEvent: "select.search.matches" })), !0; -}, oz = /* @__PURE__ */ mx((t, { query: e }) => { +}, Uz = /* @__PURE__ */ zx((t, { query: e }) => { let { state: r } = t, { from: n, to: i } = r.selection.main; if (r.readOnly) return !1; @@ -14132,9 +14132,9 @@ const ik = /* @__PURE__ */ mx((t, { query: e }) => { if (!s) return !1; let a = [], o, l, u = []; - if (s.from == n && s.to == i && (l = r.toText(e.getReplacement(s)), a.push({ from: s.from, to: s.to, insert: l }), s = e.nextMatch(r, s.from, s.to), u.push(ft.announce.of(r.phrase("replaced match on line $", r.doc.lineAt(n).number) + "."))), s) { + if (s.from == n && s.to == i && (l = r.toText(e.getReplacement(s)), a.push({ from: s.from, to: s.to, insert: l }), s = e.nextMatch(r, s.from, s.to), u.push(kt.announce.of(r.phrase("replaced match on line $", r.doc.lineAt(n).number) + "."))), s) { let h = a.length == 0 || a[0].from >= s.to ? 0 : s.to - s.from - l.length; - o = Ue.single(s.from - h, s.to - h), u.push(UM(t, s)), u.push(r.facet(Jm).scrollToMatch(o.main, t)); + o = je.single(s.from - h, s.to - h), u.push(vD(t, s)), u.push(r.facet(x1).scrollToMatch(o.main, t)); } return t.dispatch({ changes: a, @@ -14142,7 +14142,7 @@ const ik = /* @__PURE__ */ mx((t, { query: e }) => { effects: u, userEvent: "input.replace" }), !0; -}), Tke = /* @__PURE__ */ mx((t, { query: e }) => { +}), g3e = /* @__PURE__ */ zx((t, { query: e }) => { if (t.state.readOnly) return !1; let r = e.matchAll(t.state, 1e9).map((i) => { @@ -14154,20 +14154,20 @@ const ik = /* @__PURE__ */ mx((t, { query: e }) => { let n = t.state.phrase("replaced $ matches", r.length) + "."; return t.dispatch({ changes: r, - effects: ft.announce.of(n), + effects: kt.announce.of(n), userEvent: "input.replace.all" }), !0; }); -function QM(t) { - return t.state.facet(Jm).createPanel(t); +function mD(t) { + return t.state.facet(x1).createPanel(t); } -function t8(t, e) { +function L8(t, e) { var r, n, i, s, a; let o = t.selection.main, l = o.empty || o.to > o.from + 100 ? "" : t.sliceDoc(o.from, o.to); if (e && !l) return e; - let u = t.facet(Jm); - return new bee({ + let u = t.facet(x1); + return new ete({ search: ((r = e == null ? void 0 : e.literal) !== null && r !== void 0 ? r : u.literal) ? l : l.replace(/\n/g, "\\n"), caseSensitive: (n = e == null ? void 0 : e.caseSensitive) !== null && n !== void 0 ? n : u.caseSensitive, literal: (i = e == null ? void 0 : e.literal) !== null && i !== void 0 ? i : u.literal, @@ -14175,79 +14175,79 @@ function t8(t, e) { wholeWord: (a = e == null ? void 0 : e.wholeWord) !== null && a !== void 0 ? a : u.wholeWord }); } -function wee(t) { - let e = Gy(t, QM); +function rte(t) { + let e = v2(t, mD); return e && e.dom.querySelector("[main-field]"); } -function Oee(t) { - let e = wee(t); +function nte(t) { + let e = rte(t); e && e == t.root.activeElement && e.select(); } -const kee = (t) => { - let e = t.state.field(tf, !1); +const ite = (t) => { + let e = t.state.field(xf, !1); if (e && e.panel) { - let r = wee(t); + let r = rte(t); if (r && r != t.root.activeElement) { - let n = t8(t.state, e.query.spec); - n.valid && t.dispatch({ effects: e2.of(n) }), r.focus(), r.select(); + let n = L8(t.state, e.query.spec); + n.valid && t.dispatch({ effects: S2.of(n) }), r.focus(), r.select(); } } else t.dispatch({ effects: [ - zM.of(!0), - e ? e2.of(t8(t.state, e.query.spec)) : jt.appendConfig.of(Ake) + gD.of(!0), + e ? S2.of(L8(t.state, e.query.spec)) : or.appendConfig.of(b3e) ] }); return !0; -}, See = (t) => { - let e = t.state.field(tf, !1); +}, ste = (t) => { + let e = t.state.field(xf, !1); if (!e || !e.panel) return !1; - let r = Gy(t, QM); - return r && r.dom.contains(t.root.activeElement) && t.focus(), t.dispatch({ effects: zM.of(!1) }), !0; -}, Cke = [ - { key: "Mod-f", run: kee, scope: "editor search-panel" }, - { key: "F3", run: ik, shift: sk, scope: "editor search-panel", preventDefault: !0 }, - { key: "Mod-g", run: ik, shift: sk, scope: "editor search-panel", preventDefault: !0 }, - { key: "Escape", run: See, scope: "editor search-panel" }, - { key: "Mod-Shift-l", run: Ske }, - { key: "Mod-Alt-g", run: ike }, - { key: "Mod-d", run: gke, preventDefault: !0 } + let r = v2(t, mD); + return r && r.dom.contains(t.root.activeElement) && t.focus(), t.dispatch({ effects: gD.of(!1) }), !0; +}, m3e = [ + { key: "Mod-f", run: ite, scope: "editor search-panel" }, + { key: "F3", run: Rk, shift: Mk, scope: "editor search-panel", preventDefault: !0 }, + { key: "Mod-g", run: Rk, shift: Mk, scope: "editor search-panel", preventDefault: !0 }, + { key: "Escape", run: ste, scope: "editor search-panel" }, + { key: "Mod-Shift-l", run: p3e }, + { key: "Mod-Alt-g", run: Xke }, + { key: "Mod-d", run: s3e, preventDefault: !0 } ]; -class Eke { +class v3e { constructor(e) { this.view = e; - let r = this.query = e.state.field(tf).query.spec; - this.commit = this.commit.bind(this), this.searchField = un("input", { + let r = this.query = e.state.field(xf).query.spec; + this.commit = this.commit.bind(this), this.searchField = kn("input", { value: r.search, - placeholder: Ka(e, "Find"), - "aria-label": Ka(e, "Find"), + placeholder: mo(e, "Find"), + "aria-label": mo(e, "Find"), class: "cm-textfield", name: "search", form: "", "main-field": "true", onchange: this.commit, onkeyup: this.commit - }), this.replaceField = un("input", { + }), this.replaceField = kn("input", { value: r.replace, - placeholder: Ka(e, "Replace"), - "aria-label": Ka(e, "Replace"), + placeholder: mo(e, "Replace"), + "aria-label": mo(e, "Replace"), class: "cm-textfield", name: "replace", form: "", onchange: this.commit, onkeyup: this.commit - }), this.caseField = un("input", { + }), this.caseField = kn("input", { type: "checkbox", name: "case", form: "", checked: r.caseSensitive, onchange: this.commit - }), this.reField = un("input", { + }), this.reField = kn("input", { type: "checkbox", name: "re", form: "", checked: r.regexp, onchange: this.commit - }), this.wordField = un("input", { + }), this.wordField = kn("input", { type: "checkbox", name: "word", form: "", @@ -14255,47 +14255,47 @@ class Eke { onchange: this.commit }); function n(i, s, a) { - return un("button", { class: "cm-button", name: i, onclick: s, type: "button" }, a); + return kn("button", { class: "cm-button", name: i, onclick: s, type: "button" }, a); } - this.dom = un("div", { onkeydown: (i) => this.keydown(i), class: "cm-search" }, [ + this.dom = kn("div", { onkeydown: (i) => this.keydown(i), class: "cm-search" }, [ this.searchField, - n("next", () => ik(e), [Ka(e, "next")]), - n("prev", () => sk(e), [Ka(e, "previous")]), - n("select", () => kke(e), [Ka(e, "all")]), - un("label", null, [this.caseField, Ka(e, "match case")]), - un("label", null, [this.reField, Ka(e, "regexp")]), - un("label", null, [this.wordField, Ka(e, "by word")]), + n("next", () => Rk(e), [mo(e, "next")]), + n("prev", () => Mk(e), [mo(e, "previous")]), + n("select", () => d3e(e), [mo(e, "all")]), + kn("label", null, [this.caseField, mo(e, "match case")]), + kn("label", null, [this.reField, mo(e, "regexp")]), + kn("label", null, [this.wordField, mo(e, "by word")]), ...e.state.readOnly ? [] : [ - un("br"), + kn("br"), this.replaceField, - n("replace", () => oz(e), [Ka(e, "replace")]), - n("replaceAll", () => Tke(e), [Ka(e, "replace all")]) + n("replace", () => Uz(e), [mo(e, "replace")]), + n("replaceAll", () => g3e(e), [mo(e, "replace all")]) ], - un("button", { + kn("button", { name: "close", - onclick: () => See(e), - "aria-label": Ka(e, "close"), + onclick: () => ste(e), + "aria-label": mo(e, "close"), type: "button" }, ["\xD7"]) ]); } commit() { - let e = new bee({ + let e = new ete({ search: this.searchField.value, caseSensitive: this.caseField.checked, regexp: this.reField.checked, wholeWord: this.wordField.checked, replace: this.replaceField.value }); - e.eq(this.query) || (this.query = e, this.view.dispatch({ effects: e2.of(e) })); + e.eq(this.query) || (this.query = e, this.view.dispatch({ effects: S2.of(e) })); } keydown(e) { - Gwe(this.view, e, "search-panel") ? e.preventDefault() : e.keyCode == 13 && e.target == this.searchField ? (e.preventDefault(), (e.shiftKey ? sk : ik)(this.view)) : e.keyCode == 13 && e.target == this.replaceField && (e.preventDefault(), oz(this.view)); + $Oe(this.view, e, "search-panel") ? e.preventDefault() : e.keyCode == 13 && e.target == this.searchField ? (e.preventDefault(), (e.shiftKey ? Mk : Rk)(this.view)) : e.keyCode == 13 && e.target == this.replaceField && (e.preventDefault(), Uz(this.view)); } update(e) { for (let r of e.transactions) for (let n of r.effects) - n.is(e2) && !n.value.eq(this.query) && this.setQuery(n.value); + n.is(S2) && !n.value.eq(this.query) && this.setQuery(n.value); } setQuery(e) { this.query = e, this.searchField.value = e.search, this.replaceField.value = e.replace, this.caseField.checked = e.caseSensitive, this.reField.checked = e.regexp, this.wordField.checked = e.wholeWord; @@ -14307,32 +14307,32 @@ class Eke { return 80; } get top() { - return this.view.state.facet(Jm).top; + return this.view.state.facet(x1).top; } } -function Ka(t, e) { +function mo(t, e) { return t.state.phrase(e); } -const Hw = 30, Zw = /[\s\.,:;?!]/; -function UM(t, { from: e, to: r }) { - let n = t.state.doc.lineAt(e), i = t.state.doc.lineAt(r).to, s = Math.max(n.from, e - Hw), a = Math.min(i, r + Hw), o = t.state.sliceDoc(s, a); +const OO = 30, kO = /[\s\.,:;?!]/; +function vD(t, { from: e, to: r }) { + let n = t.state.doc.lineAt(e), i = t.state.doc.lineAt(r).to, s = Math.max(n.from, e - OO), a = Math.min(i, r + OO), o = t.state.sliceDoc(s, a); if (s != n.from) { - for (let l = 0; l < Hw; l++) - if (!Zw.test(o[l + 1]) && Zw.test(o[l])) { + for (let l = 0; l < OO; l++) + if (!kO.test(o[l + 1]) && kO.test(o[l])) { o = o.slice(l); break; } } if (a != i) { - for (let l = o.length - 1; l > o.length - Hw; l--) - if (!Zw.test(o[l - 1]) && Zw.test(o[l])) { + for (let l = o.length - 1; l > o.length - OO; l--) + if (!kO.test(o[l - 1]) && kO.test(o[l])) { o = o.slice(0, l); break; } } - return ft.announce.of(`${t.state.phrase("current match")}. ${o} ${t.state.phrase("on line")} ${n.number}.`); + return kt.announce.of(`${t.state.phrase("current match")}. ${o} ${t.state.phrase("on line")} ${n.number}.`); } -const _ke = /* @__PURE__ */ ft.baseTheme({ +const y3e = /* @__PURE__ */ kt.baseTheme({ ".cm-panel.cm-search": { padding: "2px 6px 4px", position: "relative", @@ -14361,17 +14361,17 @@ const _ke = /* @__PURE__ */ ft.baseTheme({ "&dark .cm-searchMatch": { backgroundColor: "#00ffff8a" }, "&light .cm-searchMatch-selected": { backgroundColor: "#ff6a0054" }, "&dark .cm-searchMatch-selected": { backgroundColor: "#ff00ff8a" } -}), Ake = [ - tf, - /* @__PURE__ */ Wl.low(Oke), - _ke +}), b3e = [ + xf, + /* @__PURE__ */ uc.low(f3e), + y3e ]; -class VM { +class yD { constructor(e, r, n) { this.state = e, this.pos = r, this.explicit = n, this.abortListeners = []; } tokenBefore(e) { - let r = dn(this.state).resolveInner(this.pos, -1); + let r = Cn(this.state).resolveInner(this.pos, -1); for (; r && e.indexOf(r.name) < 0; ) r = r.parent; return r ? { @@ -14382,7 +14382,7 @@ class VM { } : null; } matchBefore(e) { - let r = this.state.doc.lineAt(this.pos), n = Math.max(r.from, this.pos - 250), i = r.text.slice(n - r.from, this.pos - r.from), s = i.search(Cee(e, !1)); + let r = this.state.doc.lineAt(this.pos), n = Math.max(r.from, this.pos - 250), i = r.text.slice(n - r.from, this.pos - r.from), s = i.search(ote(e, !1)); return s < 0 ? null : { from: n + s, to: this.pos, text: i.slice(s) }; } get aborted() { @@ -14392,30 +14392,30 @@ class VM { e == "abort" && this.abortListeners && this.abortListeners.push(r); } } -function lz(t) { +function Vz(t) { let e = Object.keys(t).join(""), r = /\w/.test(e); return r && (e = e.replace(/\w/g, "")), `[${r ? "\\w" : ""}${e.replace(/[^\w\s]/g, "\\$&")}]`; } -function Lke(t) { +function x3e(t) { let e = /* @__PURE__ */ Object.create(null), r = /* @__PURE__ */ Object.create(null); for (let { label: i } of t) { e[i[0]] = !0; for (let s = 1; s < i.length; s++) r[i[s]] = !0; } - let n = lz(e) + lz(r) + "*$"; + let n = Vz(e) + Vz(r) + "*$"; return [new RegExp("^" + n), new RegExp(n)]; } -function Tee(t) { - let e = t.map((i) => typeof i == "string" ? { label: i } : i), [r, n] = e.every((i) => /^\w+$/.test(i.label)) ? [/\w*$/, /\w+$/] : Lke(e); +function ate(t) { + let e = t.map((i) => typeof i == "string" ? { label: i } : i), [r, n] = e.every((i) => /^\w+$/.test(i.label)) ? [/\w*$/, /\w+$/] : x3e(e); return (i) => { let s = i.matchBefore(n); return s || i.explicit ? { from: s ? s.from : i.pos, options: e, validFor: r } : null; }; } -function Rke(t, e) { +function w3e(t, e) { return (r) => { - for (let n = dn(r.state).resolveInner(r.pos, -1); n; n = n.parent) { + for (let n = Cn(r.state).resolveInner(r.pos, -1); n; n = n.parent) { if (t.indexOf(n.name) > -1) return null; if (n.type.isTop) @@ -14424,43 +14424,43 @@ function Rke(t, e) { return e(r); }; } -class cz { +class qz { constructor(e, r, n, i) { this.completion = e, this.source = r, this.match = n, this.score = i; } } -function rf(t) { +function wf(t) { return t.selection.main.from; } -function Cee(t, e) { +function ote(t, e) { var r; let { source: n } = t, i = e && n[0] != "^", s = n[n.length - 1] != "$"; return !i && !s ? t : new RegExp(`${i ? "^" : ""}(?:${n})${s ? "$" : ""}`, (r = t.flags) !== null && r !== void 0 ? r : t.ignoreCase ? "i" : ""); } -const Eee = /* @__PURE__ */ Ya.define(); -function Mke(t, e, r, n) { +const lte = /* @__PURE__ */ co.define(); +function O3e(t, e, r, n) { let { main: i } = t.selection, s = r - i.from, a = n - i.from; return Object.assign(Object.assign({}, t.changeByRange((o) => o != i && r != n && t.sliceDoc(o.from + s, o.from + a) != t.sliceDoc(r, n) ? { range: o } : { changes: { from: o.from + s, to: n == i.from ? o.to : o.from + a, insert: e }, - range: Ue.cursor(o.from + s + e.length) + range: je.cursor(o.from + s + e.length) })), { scrollIntoView: !0, userEvent: "input.complete" }); } -const uz = /* @__PURE__ */ new WeakMap(); -function Dke(t) { +const Yz = /* @__PURE__ */ new WeakMap(); +function k3e(t) { if (!Array.isArray(t)) return t; - let e = uz.get(t); - return e || uz.set(t, e = Tee(t)), e; + let e = Yz.get(t); + return e || Yz.set(t, e = ate(t)), e; } -const qM = /* @__PURE__ */ jt.define(), t2 = /* @__PURE__ */ jt.define(); -class Pke { +const bD = /* @__PURE__ */ or.define(), T2 = /* @__PURE__ */ or.define(); +class S3e { constructor(e) { this.pattern = e, this.chars = [], this.folded = [], this.any = [], this.precise = [], this.byWord = [], this.score = 0, this.matched = []; for (let r = 0; r < e.length; ) { - let n = as(e, r), i = Mo(n); + let n = bs(e, r), i = Ho(n); this.chars.push(n); let s = e.slice(r, r + i), a = s.toUpperCase(); - this.folded.push(as(a == s ? s.toLowerCase() : a, 0)), r += i; + this.folded.push(bs(a == s ? s.toLowerCase() : a, 0)), r += i; } this.astral = e.length != this.chars.length; } @@ -14474,7 +14474,7 @@ class Pke { return !1; let { chars: r, folded: n, any: i, precise: s, byWord: a } = this; if (r.length == 1) { - let b = as(e, 0), w = Mo(b), O = w == e.length ? 0 : -100; + let b = bs(e, 0), w = Ho(b), O = w == e.length ? 0 : -100; if (b != r[0]) if (b == n[0]) O += -200; @@ -14488,33 +14488,33 @@ class Pke { let l = r.length, u = 0; if (o < 0) { for (let b = 0, w = Math.min(e.length, 200); b < w && u < l; ) { - let O = as(e, b); - (O == r[u] || O == n[u]) && (i[u++] = b), b += Mo(O); + let O = bs(e, b); + (O == r[u] || O == n[u]) && (i[u++] = b), b += Ho(O); } if (u < l) return !1; } let h = 0, f = 0, d = !1, p = 0, g = -1, m = -1, v = /[a-z]/.test(e), y = !0; for (let b = 0, w = Math.min(e.length, 200), O = 0; b < w && f < l; ) { - let S = as(e, b); + let S = bs(e, b); o < 0 && (h < l && S == r[h] && (s[h++] = b), p < l && (S == r[p] || S == n[p] ? (p == 0 && (g = b), m = b + 1, p++) : p = 0)); - let C, T = S < 255 ? S >= 48 && S <= 57 || S >= 97 && S <= 122 ? 2 : S >= 65 && S <= 90 ? 1 : 0 : (C = dM(S)) != C.toLowerCase() ? 1 : C != C.toUpperCase() ? 2 : 0; - (!b || T == 1 && v || O == 0 && T != 0) && (r[f] == S || n[f] == S && (d = !0) ? a[f++] = b : a.length && (y = !1)), O = T, b += Mo(S); + let C, T = S < 255 ? S >= 48 && S <= 57 || S >= 97 && S <= 122 ? 2 : S >= 65 && S <= 90 ? 1 : 0 : (C = UM(S)) != C.toLowerCase() ? 1 : C != C.toUpperCase() ? 2 : 0; + (!b || T == 1 && v || O == 0 && T != 0) && (r[f] == S || n[f] == S && (d = !0) ? a[f++] = b : a.length && (y = !1)), O = T, b += Ho(S); } return f == l && a[0] == 0 && y ? this.result(-100 + (d ? -200 : 0), a, e) : p == l && g == 0 ? this.ret(-200 - e.length + (m == e.length ? 0 : -100), [0, m]) : o > -1 ? this.ret(-700 - e.length, [o, o + this.pattern.length]) : p == l ? this.ret(-200 + -700 - e.length, [g, m]) : f == l ? this.result(-100 + (d ? -200 : 0) + -700 + (y ? 0 : -1100), a, e) : r.length == 2 ? !1 : this.result((i[0] ? -700 : 0) + -200 + -1100, i, e); } result(e, r, n) { let i = [], s = 0; for (let a of r) { - let o = a + (this.astral ? Mo(as(n, a)) : 1); + let o = a + (this.astral ? Ho(bs(n, a)) : 1); s && i[s - 1] == a ? i[s - 1] = o : (i[s++] = a, i[s++] = o); } return this.ret(e - n.length, i); } } -const Is = /* @__PURE__ */ At.define({ +const Zs = /* @__PURE__ */ $t.define({ combine(t) { - return Zc(t, { + return pu(t, { activateOnTyping: !0, selectOnOpen: !0, override: null, @@ -14526,7 +14526,7 @@ const Is = /* @__PURE__ */ At.define({ aboveCursor: !1, icons: !0, addToOptions: [], - positionInfo: Nke, + positionInfo: T3e, compareCompletions: (e, r) => e.label.localeCompare(r.label), interactionDelay: 75, updateSyncTime: 100 @@ -14534,17 +14534,17 @@ const Is = /* @__PURE__ */ At.define({ defaultKeymap: (e, r) => e && r, closeOnBlur: (e, r) => e && r, icons: (e, r) => e && r, - tooltipClass: (e, r) => (n) => hz(e(n), r(n)), - optionClass: (e, r) => (n) => hz(e(n), r(n)), + tooltipClass: (e, r) => (n) => Wz(e(n), r(n)), + optionClass: (e, r) => (n) => Wz(e(n), r(n)), addToOptions: (e, r) => e.concat(r) }); } }); -function hz(t, e) { +function Wz(t, e) { return t ? e ? t + " " + e : t : e; } -function Nke(t, e, r, n, i, s) { - let a = t.textDirection == Pn.RTL, o = a, l = !1, u = "top", h, f, d = e.left - i.left, p = i.right - e.right, g = n.right - n.left, m = n.bottom - n.top; +function T3e(t, e, r, n, i, s) { + let a = t.textDirection == Wn.RTL, o = a, l = !1, u = "top", h, f, d = e.left - i.left, p = i.right - e.right, g = n.right - n.left, m = n.bottom - n.top; if (o && d < Math.min(g, p) ? o = !1 : !o && p < Math.min(g, d) && (o = !0), g <= (o ? d : p)) h = Math.max(i.top, Math.min(r.top, i.bottom - m)) - e.top, f = Math.min(400, o ? d : p); else { @@ -14558,7 +14558,7 @@ function Nke(t, e, r, n, i, s) { class: "cm-completionInfo-" + (l ? a ? "left-narrow" : "right-narrow" : o ? "left" : "right") }; } -function Ike(t) { +function C3e(t) { let e = t.addToOptions.slice(); return t.icons && e.push({ render(r) { @@ -14590,7 +14590,7 @@ function Ike(t) { position: 80 }), e.sort((r, n) => r.position - n.position).map((r) => r.render); } -function s6(t, e, r) { +function P_(t, e, r) { if (t <= r) return { from: 0, to: t }; if (e < 0 && (e = 0), e <= t >> 1) { @@ -14600,15 +14600,15 @@ function s6(t, e, r) { let n = Math.floor((t - e) / r); return { from: t - (n + 1) * r, to: t - n * r }; } -class $ke { +class E3e { constructor(e, r, n) { this.view = e, this.stateField = r, this.applyCompletion = n, this.info = null, this.infoDestroy = null, this.placeInfoReq = { read: () => this.measureInfo(), write: (l) => this.placeInfo(l), key: this }, this.space = null, this.currentClass = ""; - let i = e.state.field(r), { options: s, selected: a } = i.open, o = e.state.facet(Is); - this.optionContent = Ike(o), this.optionClass = o.optionClass, this.tooltipClass = o.tooltipClass, this.range = s6(s.length, a, o.maxRenderedOptions), this.dom = document.createElement("div"), this.dom.className = "cm-tooltip-autocomplete", this.updateTooltipClass(e.state), this.dom.addEventListener("mousedown", (l) => { + let i = e.state.field(r), { options: s, selected: a } = i.open, o = e.state.facet(Zs); + this.optionContent = C3e(o), this.optionClass = o.optionClass, this.tooltipClass = o.tooltipClass, this.range = P_(s.length, a, o.maxRenderedOptions), this.dom = document.createElement("div"), this.dom.className = "cm-tooltip-autocomplete", this.updateTooltipClass(e.state), this.dom.addEventListener("mousedown", (l) => { let { options: u } = e.state.field(r).open; for (let h = l.target, f; h && h != this.dom; h = h.parentNode) if (h.nodeName == "LI" && (f = /-(\d+)$/.exec(h.id)) && +f[1] < u.length) { @@ -14617,7 +14617,7 @@ class $ke { } }), this.dom.addEventListener("focusout", (l) => { let u = e.state.field(this.stateField, !1); - u && u.tooltip && e.state.facet(Is).closeOnBlur && l.relatedTarget != e.contentDOM && e.dispatch({ effects: t2.of(null) }); + u && u.tooltip && e.state.facet(Zs).closeOnBlur && l.relatedTarget != e.contentDOM && e.dispatch({ effects: T2.of(null) }); }), this.showOptions(s, i.id); } mount() { @@ -14633,7 +14633,7 @@ class $ke { let n = e.state.field(this.stateField), i = e.startState.field(this.stateField); if (this.updateTooltipClass(e.state), n != i) { let { options: s, selected: a, disabled: o } = n.open; - (!i.open || i.open.options != s) && (this.range = s6(s.length, a, e.state.facet(Is).maxRenderedOptions), this.showOptions(s, n.id)), this.updateSel(), o != ((r = i.open) === null || r === void 0 ? void 0 : r.disabled) && this.dom.classList.toggle("cm-tooltip-autocomplete-disabled", !!o); + (!i.open || i.open.options != s) && (this.range = P_(s.length, a, e.state.facet(Zs).maxRenderedOptions), this.showOptions(s, n.id)), this.updateSel(), o != ((r = i.open) === null || r === void 0 ? void 0 : r.disabled) && this.dom.classList.toggle("cm-tooltip-autocomplete-disabled", !!o); } } updateTooltipClass(e) { @@ -14651,7 +14651,7 @@ class $ke { } updateSel() { let e = this.view.state.field(this.stateField), r = e.open; - if ((r.selected > -1 && r.selected < this.range.from || r.selected >= this.range.to) && (this.range = s6(r.options.length, r.selected, this.view.state.facet(Is).maxRenderedOptions), this.showOptions(r.options, e.id)), this.updateSelectedOption(r.selected)) { + if ((r.selected > -1 && r.selected < this.range.from || r.selected >= this.range.to) && (this.range = P_(r.options.length, r.selected, this.view.state.facet(Zs).maxRenderedOptions), this.showOptions(r.options, e.id)), this.updateSelectedOption(r.selected)) { this.destroyInfo(); let { completion: n } = r.options[r.selected], { info: i } = n; if (!i) @@ -14661,7 +14661,7 @@ class $ke { return; "then" in s ? s.then((a) => { a && this.view.state.field(this.stateField, !1) == e && this.addInfoPane(a, n); - }).catch((a) => Vo(this.view.state, a, "completion info")) : this.addInfoPane(s, n); + }).catch((a) => al(this.view.state, a, "completion info")) : this.addInfoPane(s, n); } } addInfoPane(e, r) { @@ -14679,7 +14679,7 @@ class $ke { let r = null; for (let n = this.list.firstChild, i = this.range.from; n; n = n.nextSibling, i++) n.nodeName != "LI" || !n.id ? i-- : i == e ? n.hasAttribute("aria-selected") || (n.setAttribute("aria-selected", "true"), r = n) : n.hasAttribute("aria-selected") && n.removeAttribute("aria-selected"); - return r && Fke(this.list, r), r; + return r && A3e(this.list, r), r; } measureInfo() { let e = this.dom.querySelector("[aria-selected]"); @@ -14690,7 +14690,7 @@ class $ke { let a = this.dom.ownerDocument.defaultView || window; s = { left: 0, top: 0, right: a.innerWidth, bottom: a.innerHeight }; } - return i.top > Math.min(s.bottom, r.bottom) - 10 || i.bottom < Math.max(s.top, r.top) + 10 ? null : this.view.state.facet(Is).positionInfo(this.view, r, i, n, s, this.dom); + return i.top > Math.min(s.bottom, r.bottom) - 10 || i.bottom < Math.max(s.top, r.top) + 10 ? null : this.view.state.facet(Zs).positionInfo(this.view, r, i, n, s, this.dom); } placeInfo(e) { this.info && (e ? (e.style && (this.info.style.cssText = e.style), this.info.className = "cm-tooltip cm-completionInfo " + (e.class || "")) : this.info.style.cssText = "top: -1e6px"); @@ -14729,17 +14729,17 @@ class $ke { this.destroyInfo(); } } -function Bke(t, e) { - return (r) => new $ke(r, t, e); +function _3e(t, e) { + return (r) => new E3e(r, t, e); } -function Fke(t, e) { +function A3e(t, e) { let r = t.getBoundingClientRect(), n = e.getBoundingClientRect(), i = r.height / t.offsetHeight; n.top < r.top ? t.scrollTop -= (r.top - n.top) / i : n.bottom > r.bottom && (t.scrollTop += (n.bottom - r.bottom) / i); } -function fz(t) { +function Gz(t) { return (t.boost || 0) * 100 + (t.apply ? 10 : 0) + (t.info ? 5 : 0) + (t.type ? 1 : 0); } -function zke(t, e) { +function L3e(t, e) { let r = [], n = null, i = (l) => { r.push(l); let { section: u } = l.completion; @@ -14754,13 +14754,13 @@ function zke(t, e) { let u = l.result.getMatch; if (l.result.filter === !1) for (let h of l.result.options) - i(new cz(h, l.source, u ? u(h) : [], 1e9 - r.length)); + i(new qz(h, l.source, u ? u(h) : [], 1e9 - r.length)); else { - let h = new Pke(e.sliceDoc(l.from, l.to)); + let h = new S3e(e.sliceDoc(l.from, l.to)); for (let f of l.result.options) if (h.match(f.label)) { let d = f.displayLabel ? u ? u(f, h.matched) : [] : h.matched; - i(new cz(f, l.source, d, h.score + (f.boost || 0))); + i(new qz(f, l.source, d, h.score + (f.boost || 0))); } } } @@ -14776,25 +14776,25 @@ function zke(t, e) { d && (f.score += l[typeof d == "string" ? d : d.name]); } } - let s = [], a = null, o = e.facet(Is).compareCompletions; + let s = [], a = null, o = e.facet(Zs).compareCompletions; for (let l of r.sort((u, h) => h.score - u.score || o(u.completion, h.completion))) { let u = l.completion; - !a || a.label != u.label || a.detail != u.detail || a.type != null && u.type != null && a.type != u.type || a.apply != u.apply || a.boost != u.boost ? s.push(l) : fz(l.completion) > fz(a) && (s[s.length - 1] = l), a = l.completion; + !a || a.label != u.label || a.detail != u.detail || a.type != null && u.type != null && a.type != u.type || a.apply != u.apply || a.boost != u.boost ? s.push(l) : Gz(l.completion) > Gz(a) && (s[s.length - 1] = l), a = l.completion; } return s; } -class Wp { +class dg { constructor(e, r, n, i, s, a) { this.options = e, this.attrs = r, this.tooltip = n, this.timestamp = i, this.selected = s, this.disabled = a; } setSelected(e, r) { - return e == this.selected || e >= this.options.length ? this : new Wp(this.options, dz(r, e), this.tooltip, this.timestamp, e, this.disabled); + return e == this.selected || e >= this.options.length ? this : new dg(this.options, Xz(r, e), this.tooltip, this.timestamp, e, this.disabled); } static build(e, r, n, i, s) { - let a = zke(e, r); + let a = L3e(e, r); if (!a.length) - return i && e.some((l) => l.state == 1) ? new Wp(i.options, i.attrs, i.tooltip, i.timestamp, i.selected, !0) : null; - let o = r.facet(Is).selectOnOpen ? 0 : -1; + return i && e.some((l) => l.state == 1) ? new dg(i.options, i.attrs, i.tooltip, i.timestamp, i.selected, !0) : null; + let o = r.facet(Zs).selectOnOpen ? 0 : -1; if (i && i.selected != o && i.selected != -1) { let l = i.options[i.selected].completion; for (let u = 0; u < a.length; u++) @@ -14803,40 +14803,40 @@ class Wp { break; } } - return new Wp(a, dz(n, o), { + return new dg(a, Xz(n, o), { pos: e.reduce((l, u) => u.hasResult() ? Math.min(l, u.from) : l, 1e8), - create: Yke, + create: N3e, above: s.aboveCursor }, i ? i.timestamp : Date.now(), o, !1); } map(e) { - return new Wp(this.options, this.attrs, Object.assign(Object.assign({}, this.tooltip), { pos: e.mapPos(this.tooltip.pos) }), this.timestamp, this.selected, this.disabled); + return new dg(this.options, this.attrs, Object.assign(Object.assign({}, this.tooltip), { pos: e.mapPos(this.tooltip.pos) }), this.timestamp, this.selected, this.disabled); } } -class ak { +class Dk { constructor(e, r, n) { this.active = e, this.id = r, this.open = n; } static start() { - return new ak(Vke, "cm-ac-" + Math.floor(Math.random() * 2e6).toString(36), null); + return new Dk(D3e, "cm-ac-" + Math.floor(Math.random() * 2e6).toString(36), null); } update(e) { - let { state: r } = e, n = r.facet(Is), s = (n.override || r.languageDataAt("autocomplete", rf(r)).map(Dke)).map((o) => (this.active.find((u) => u.source == o) || new _a(o, this.active.some((u) => u.state != 0) ? 1 : 0)).update(e, n)); + let { state: r } = e, n = r.facet(Zs), s = (n.override || r.languageDataAt("autocomplete", wf(r)).map(k3e)).map((o) => (this.active.find((u) => u.source == o) || new Wa(o, this.active.some((u) => u.state != 0) ? 1 : 0)).update(e, n)); s.length == this.active.length && s.every((o, l) => o == this.active[l]) && (s = this.active); let a = this.open; - a && e.docChanged && (a = a.map(e.changes)), e.selection || s.some((o) => o.hasResult() && e.changes.touchesRange(o.from, o.to)) || !Qke(s, this.active) ? a = Wp.build(s, r, this.id, a, n) : a && a.disabled && !s.some((o) => o.state == 1) && (a = null), !a && s.every((o) => o.state != 1) && s.some((o) => o.hasResult()) && (s = s.map((o) => o.hasResult() ? new _a(o.source, 0) : o)); + a && e.docChanged && (a = a.map(e.changes)), e.selection || s.some((o) => o.hasResult() && e.changes.touchesRange(o.from, o.to)) || !R3e(s, this.active) ? a = dg.build(s, r, this.id, a, n) : a && a.disabled && !s.some((o) => o.state == 1) && (a = null), !a && s.every((o) => o.state != 1) && s.some((o) => o.hasResult()) && (s = s.map((o) => o.hasResult() ? new Wa(o.source, 0) : o)); for (let o of e.effects) - o.is(Aee) && (a = a && a.setSelected(o.value, this.id)); - return s == this.active && a == this.open ? this : new ak(s, this.id, a); + o.is(ute) && (a = a && a.setSelected(o.value, this.id)); + return s == this.active && a == this.open ? this : new Dk(s, this.id, a); } get tooltip() { return this.open ? this.open.tooltip : null; } get attrs() { - return this.open ? this.open.attrs : Uke; + return this.open ? this.open.attrs : M3e; } } -function Qke(t, e) { +function R3e(t, e) { if (t == e) return !0; for (let r = 0, n = 0; ; ) { @@ -14851,10 +14851,10 @@ function Qke(t, e) { return !1; } } -const Uke = { +const M3e = { "aria-autocomplete": "list" }; -function dz(t, e) { +function Xz(t, e) { let r = { "aria-autocomplete": "list", "aria-haspopup": "listbox", @@ -14862,11 +14862,11 @@ function dz(t, e) { }; return e > -1 && (r["aria-activedescendant"] = t + "-" + e), r; } -const Vke = []; -function r8(t) { +const D3e = []; +function R8(t) { return t.isUserEvent("input.type") ? "input" : t.isUserEvent("delete.backward") ? "delete" : null; } -class _a { +class Wa { constructor(e, r, n = -1) { this.source = e, this.state = r, this.explicitPos = n; } @@ -14874,29 +14874,29 @@ class _a { return !1; } update(e, r) { - let n = r8(e), i = this; - n ? i = i.handleUserEvent(e, n, r) : e.docChanged ? i = i.handleChange(e) : e.selection && i.state != 0 && (i = new _a(i.source, 0)); + let n = R8(e), i = this; + n ? i = i.handleUserEvent(e, n, r) : e.docChanged ? i = i.handleChange(e) : e.selection && i.state != 0 && (i = new Wa(i.source, 0)); for (let s of e.effects) - if (s.is(qM)) - i = new _a(i.source, 1, s.value ? rf(e.state) : -1); - else if (s.is(t2)) - i = new _a(i.source, 0); - else if (s.is(_ee)) + if (s.is(bD)) + i = new Wa(i.source, 1, s.value ? wf(e.state) : -1); + else if (s.is(T2)) + i = new Wa(i.source, 0); + else if (s.is(cte)) for (let a of s.value) a.source == i.source && (i = a); return i; } handleUserEvent(e, r, n) { - return r == "delete" || !n.activateOnTyping ? this.map(e.changes) : new _a(this.source, 1); + return r == "delete" || !n.activateOnTyping ? this.map(e.changes) : new Wa(this.source, 1); } handleChange(e) { - return e.changes.touchesRange(rf(e.startState)) ? new _a(this.source, 0) : this.map(e.changes); + return e.changes.touchesRange(wf(e.startState)) ? new Wa(this.source, 0) : this.map(e.changes); } map(e) { - return e.empty || this.explicitPos < 0 ? this : new _a(this.source, this.state, e.mapPos(this.explicitPos)); + return e.empty || this.explicitPos < 0 ? this : new Wa(this.source, this.state, e.mapPos(this.explicitPos)); } } -class hg extends _a { +class Mg extends Wa { constructor(e, r, n, i, s) { super(e, 2, r), this.result = n, this.from = i, this.to = s; } @@ -14905,89 +14905,89 @@ class hg extends _a { } handleUserEvent(e, r, n) { var i; - let s = e.changes.mapPos(this.from), a = e.changes.mapPos(this.to, 1), o = rf(e.state); - if ((this.explicitPos < 0 ? o <= s : o < this.from) || o > a || r == "delete" && rf(e.startState) == this.from) - return new _a(this.source, r == "input" && n.activateOnTyping ? 1 : 0); + let s = e.changes.mapPos(this.from), a = e.changes.mapPos(this.to, 1), o = wf(e.state); + if ((this.explicitPos < 0 ? o <= s : o < this.from) || o > a || r == "delete" && wf(e.startState) == this.from) + return new Wa(this.source, r == "input" && n.activateOnTyping ? 1 : 0); let l = this.explicitPos < 0 ? -1 : e.changes.mapPos(this.explicitPos), u; - return qke(this.result.validFor, e.state, s, a) ? new hg(this.source, l, this.result, s, a) : this.result.update && (u = this.result.update(this.result, s, a, new VM(e.state, o, l >= 0))) ? new hg(this.source, l, u, u.from, (i = u.to) !== null && i !== void 0 ? i : rf(e.state)) : new _a(this.source, 1, l); + return P3e(this.result.validFor, e.state, s, a) ? new Mg(this.source, l, this.result, s, a) : this.result.update && (u = this.result.update(this.result, s, a, new yD(e.state, o, l >= 0))) ? new Mg(this.source, l, u, u.from, (i = u.to) !== null && i !== void 0 ? i : wf(e.state)) : new Wa(this.source, 1, l); } handleChange(e) { - return e.changes.touchesRange(this.from, this.to) ? new _a(this.source, 0) : this.map(e.changes); + return e.changes.touchesRange(this.from, this.to) ? new Wa(this.source, 0) : this.map(e.changes); } map(e) { - return e.empty ? this : new hg(this.source, this.explicitPos < 0 ? -1 : e.mapPos(this.explicitPos), this.result, e.mapPos(this.from), e.mapPos(this.to, 1)); + return e.empty ? this : new Mg(this.source, this.explicitPos < 0 ? -1 : e.mapPos(this.explicitPos), this.result, e.mapPos(this.from), e.mapPos(this.to, 1)); } } -function qke(t, e, r, n) { +function P3e(t, e, r, n) { if (!t) return !1; let i = e.sliceDoc(r, n); - return typeof t == "function" ? t(i, r, n, e) : Cee(t, !0).test(i); + return typeof t == "function" ? t(i, r, n, e) : ote(t, !0).test(i); } -const _ee = /* @__PURE__ */ jt.define({ +const cte = /* @__PURE__ */ or.define({ map(t, e) { return t.map((r) => r.map(e)); } -}), Aee = /* @__PURE__ */ jt.define(), oo = /* @__PURE__ */ In.define({ +}), ute = /* @__PURE__ */ or.define(), To = /* @__PURE__ */ Xn.define({ create() { - return ak.start(); + return Dk.start(); }, update(t, e) { return t.update(e); }, provide: (t) => [ - SM.from(t, (e) => e.tooltip), - ft.contentAttributes.from(t, (e) => e.attrs) + JM.from(t, (e) => e.tooltip), + kt.contentAttributes.from(t, (e) => e.attrs) ] }); -function Lee(t, e) { +function hte(t, e) { const r = e.completion.apply || e.completion.label; - let n = t.state.field(oo).active.find((i) => i.source == e.source); - return n instanceof hg ? (typeof r == "string" ? t.dispatch(Object.assign(Object.assign({}, Mke(t.state, r, n.from, n.to)), { annotations: Eee.of(e.completion) })) : r(t, e.completion, n.from, n.to), !0) : !1; + let n = t.state.field(To).active.find((i) => i.source == e.source); + return n instanceof Mg ? (typeof r == "string" ? t.dispatch(Object.assign(Object.assign({}, O3e(t.state, r, n.from, n.to)), { annotations: lte.of(e.completion) })) : r(t, e.completion, n.from, n.to), !0) : !1; } -const Yke = /* @__PURE__ */ Bke(oo, Lee); -function jw(t, e = "option") { +const N3e = /* @__PURE__ */ _3e(To, hte); +function SO(t, e = "option") { return (r) => { - let n = r.state.field(oo, !1); - if (!n || !n.open || n.open.disabled || Date.now() - n.open.timestamp < r.state.facet(Is).interactionDelay) + let n = r.state.field(To, !1); + if (!n || !n.open || n.open.disabled || Date.now() - n.open.timestamp < r.state.facet(Zs).interactionDelay) return !1; let i = 1, s; - e == "page" && (s = sJ(r, n.open.tooltip)) && (i = Math.max(2, Math.floor(s.dom.offsetHeight / s.dom.querySelector("li").offsetHeight) - 1)); + e == "page" && (s = zJ(r, n.open.tooltip)) && (i = Math.max(2, Math.floor(s.dom.offsetHeight / s.dom.querySelector("li").offsetHeight) - 1)); let { length: a } = n.open.options, o = n.open.selected > -1 ? n.open.selected + i * (t ? 1 : -1) : t ? 0 : a - 1; - return o < 0 ? o = e == "page" ? 0 : a - 1 : o >= a && (o = e == "page" ? a - 1 : 0), r.dispatch({ effects: Aee.of(o) }), !0; + return o < 0 ? o = e == "page" ? 0 : a - 1 : o >= a && (o = e == "page" ? a - 1 : 0), r.dispatch({ effects: ute.of(o) }), !0; }; } -const Wke = (t) => { - let e = t.state.field(oo, !1); - return t.state.readOnly || !e || !e.open || e.open.selected < 0 || e.open.disabled || Date.now() - e.open.timestamp < t.state.facet(Is).interactionDelay ? !1 : Lee(t, e.open.options[e.open.selected]); -}, Gke = (t) => t.state.field(oo, !1) ? (t.dispatch({ effects: qM.of(!0) }), !0) : !1, Xke = (t) => { - let e = t.state.field(oo, !1); - return !e || !e.active.some((r) => r.state != 0) ? !1 : (t.dispatch({ effects: t2.of(null) }), !0); +const I3e = (t) => { + let e = t.state.field(To, !1); + return t.state.readOnly || !e || !e.open || e.open.selected < 0 || e.open.disabled || Date.now() - e.open.timestamp < t.state.facet(Zs).interactionDelay ? !1 : hte(t, e.open.options[e.open.selected]); +}, $3e = (t) => t.state.field(To, !1) ? (t.dispatch({ effects: bD.of(!0) }), !0) : !1, B3e = (t) => { + let e = t.state.field(To, !1); + return !e || !e.active.some((r) => r.state != 0) ? !1 : (t.dispatch({ effects: T2.of(null) }), !0); }; -class Hke { +class F3e { constructor(e, r) { this.active = e, this.context = r, this.time = Date.now(), this.updates = [], this.done = void 0; } } -const Zke = 50, jke = 1e3, Kke = /* @__PURE__ */ Jr.fromClass(class { +const z3e = 50, Q3e = 1e3, U3e = /* @__PURE__ */ hn.fromClass(class { constructor(t) { this.view = t, this.debounceUpdate = -1, this.running = [], this.debounceAccept = -1, this.composing = 0; - for (let e of t.state.field(oo).active) + for (let e of t.state.field(To).active) e.state == 1 && this.startQuery(e); } update(t) { - let e = t.state.field(oo); - if (!t.selectionSet && !t.docChanged && t.startState.field(oo) == e) + let e = t.state.field(To); + if (!t.selectionSet && !t.docChanged && t.startState.field(To) == e) return; - let r = t.transactions.some((n) => (n.selection || n.docChanged) && !r8(n)); + let r = t.transactions.some((n) => (n.selection || n.docChanged) && !R8(n)); for (let n = 0; n < this.running.length; n++) { let i = this.running[n]; - if (r || i.updates.length + t.transactions.length > Zke && Date.now() - i.time > jke) { + if (r || i.updates.length + t.transactions.length > z3e && Date.now() - i.time > Q3e) { for (let s of i.context.abortListeners) try { s(); } catch (a) { - Vo(this.view.state, a); + al(this.view.state, a); } i.context.abortListeners = null, this.running.splice(n--, 1); } else @@ -14995,35 +14995,35 @@ const Zke = 50, jke = 1e3, Kke = /* @__PURE__ */ Jr.fromClass(class { } if (this.debounceUpdate > -1 && clearTimeout(this.debounceUpdate), this.debounceUpdate = e.active.some((n) => n.state == 1 && !this.running.some((i) => i.active.source == n.source)) ? setTimeout(() => this.startUpdate(), 50) : -1, this.composing != 0) for (let n of t.transactions) - r8(n) == "input" ? this.composing = 2 : this.composing == 2 && n.selection && (this.composing = 3); + R8(n) == "input" ? this.composing = 2 : this.composing == 2 && n.selection && (this.composing = 3); } startUpdate() { this.debounceUpdate = -1; - let { state: t } = this.view, e = t.field(oo); + let { state: t } = this.view, e = t.field(To); for (let r of e.active) r.state == 1 && !this.running.some((n) => n.active.source == r.source) && this.startQuery(r); } startQuery(t) { - let { state: e } = this.view, r = rf(e), n = new VM(e, r, t.explicitPos == r), i = new Hke(t, n); + let { state: e } = this.view, r = wf(e), n = new yD(e, r, t.explicitPos == r), i = new F3e(t, n); this.running.push(i), Promise.resolve(t.source(n)).then((s) => { i.context.aborted || (i.done = s || null, this.scheduleAccept()); }, (s) => { - this.view.dispatch({ effects: t2.of(null) }), Vo(this.view.state, s); + this.view.dispatch({ effects: T2.of(null) }), al(this.view.state, s); }); } scheduleAccept() { - this.running.every((t) => t.done !== void 0) ? this.accept() : this.debounceAccept < 0 && (this.debounceAccept = setTimeout(() => this.accept(), this.view.state.facet(Is).updateSyncTime)); + this.running.every((t) => t.done !== void 0) ? this.accept() : this.debounceAccept < 0 && (this.debounceAccept = setTimeout(() => this.accept(), this.view.state.facet(Zs).updateSyncTime)); } accept() { var t; this.debounceAccept > -1 && clearTimeout(this.debounceAccept), this.debounceAccept = -1; - let e = [], r = this.view.state.facet(Is); + let e = [], r = this.view.state.facet(Zs); for (let n = 0; n < this.running.length; n++) { let i = this.running[n]; if (i.done === void 0) continue; if (this.running.splice(n--, 1), i.done) { - let a = new hg(i.active.source, i.active.explicitPos, i.done, i.done.from, (t = i.done.to) !== null && t !== void 0 ? t : rf(i.updates.length ? i.updates[0].startState : this.view.state)); + let a = new Mg(i.active.source, i.active.explicitPos, i.done, i.done.from, (t = i.done.to) !== null && t !== void 0 ? t : wf(i.updates.length ? i.updates[0].startState : this.view.state)); for (let o of i.updates) a = a.update(o, r); if (a.hasResult()) { @@ -15031,35 +15031,35 @@ const Zke = 50, jke = 1e3, Kke = /* @__PURE__ */ Jr.fromClass(class { continue; } } - let s = this.view.state.field(oo).active.find((a) => a.source == i.active.source); + let s = this.view.state.field(To).active.find((a) => a.source == i.active.source); if (s && s.state == 1) if (i.done == null) { - let a = new _a(i.active.source, 0); + let a = new Wa(i.active.source, 0); for (let o of i.updates) a = a.update(o, r); a.state != 1 && e.push(a); } else this.startQuery(s); } - e.length && this.view.dispatch({ effects: _ee.of(e) }); + e.length && this.view.dispatch({ effects: cte.of(e) }); } }, { eventHandlers: { blur(t) { - let e = this.view.state.field(oo, !1); - if (e && e.tooltip && this.view.state.facet(Is).closeOnBlur) { - let r = e.open && sJ(this.view, e.open.tooltip); - (!r || !r.dom.contains(t.relatedTarget)) && this.view.dispatch({ effects: t2.of(null) }); + let e = this.view.state.field(To, !1); + if (e && e.tooltip && this.view.state.facet(Zs).closeOnBlur) { + let r = e.open && zJ(this.view, e.open.tooltip); + (!r || !r.dom.contains(t.relatedTarget)) && this.view.dispatch({ effects: T2.of(null) }); } }, compositionstart() { this.composing = 1; }, compositionend() { - this.composing == 3 && setTimeout(() => this.view.dispatch({ effects: qM.of(!1) }), 20), this.composing = 0; + this.composing == 3 && setTimeout(() => this.view.dispatch({ effects: bD.of(!1) }), 20), this.composing = 0; } } -}), Ree = /* @__PURE__ */ ft.baseTheme({ +}), fte = /* @__PURE__ */ kt.baseTheme({ ".cm-tooltip.cm-tooltip-autocomplete": { "& > ul": { fontFamily: "monospace", @@ -15181,21 +15181,21 @@ const Zke = 50, jke = 1e3, Kke = /* @__PURE__ */ Jr.fromClass(class { "&:after": { content: "'abc'", fontSize: "50%", verticalAlign: "middle" } } }); -class Jke { +class V3e { constructor(e, r, n, i) { this.field = e, this.line = r, this.from = n, this.to = i; } } -class YM { +class xD { constructor(e, r, n) { this.field = e, this.from = r, this.to = n; } map(e) { - let r = e.mapPos(this.from, -1, Ci.TrackDel), n = e.mapPos(this.to, 1, Ci.TrackDel); - return r == null || n == null ? null : new YM(this.field, r, n); + let r = e.mapPos(this.from, -1, Fi.TrackDel), n = e.mapPos(this.to, 1, Fi.TrackDel); + return r == null || n == null ? null : new xD(this.field, r, n); } } -class WM { +class wD { constructor(e, r) { this.lines = e, this.fieldPositions = r; } @@ -15205,12 +15205,12 @@ class WM { if (n.length) { let u = a, h = /^\t*/.exec(l)[0].length; for (let f = 0; f < h; f++) - u += e.facet(px); + u += e.facet(Bx); i.push(r + u.length - h), l = u + l.slice(h); } n.push(l), r += l.length + 1; } - let o = this.fieldPositions.map((l) => new YM(l.field, i[l.line] + l.from, i[l.line] + l.to)); + let o = this.fieldPositions.map((l) => new xD(l.field, i[l.line] + l.from, i[l.line] + l.to)); return { text: n, ranges: o }; } static parse(e) { @@ -15228,7 +15228,7 @@ class WM { for (let f of i) f.field >= u && f.field++; } - i.push(new Jke(u, n.length, s.index, s.index + l.length)), a = a.slice(0, s.index) + l + a.slice(s.index + s[0].length); + i.push(new V3e(u, n.length, s.index, s.index + l.length)), a = a.slice(0, s.index) + l + a.slice(s.index + s[0].length); } for (let o; o = /\\([{}])/.exec(a); ) { a = a.slice(0, o.index) + o[1] + a.slice(o.index + o[0].length); @@ -15237,10 +15237,10 @@ class WM { } n.push(a); } - return new WM(n, i); + return new wD(n, i); } } -let e3e = /* @__PURE__ */ _t.widget({ widget: /* @__PURE__ */ new class extends Wa { +let q3e = /* @__PURE__ */ It.widget({ widget: /* @__PURE__ */ new class extends uo { toDOM() { let t = document.createElement("span"); return t.className = "cm-snippetFieldPosition", t; @@ -15248,10 +15248,10 @@ let e3e = /* @__PURE__ */ _t.widget({ widget: /* @__PURE__ */ new class extends ignoreEvent() { return !1; } -}() }), t3e = /* @__PURE__ */ _t.mark({ class: "cm-snippetField" }); -class e1 { +}() }), Y3e = /* @__PURE__ */ It.mark({ class: "cm-snippetField" }); +class w1 { constructor(e, r) { - this.ranges = e, this.active = r, this.deco = _t.set(e.map((n) => (n.from == n.to ? e3e : t3e).range(n.from, n.to))); + this.ranges = e, this.active = r, this.deco = It.set(e.map((n) => (n.from == n.to ? q3e : Y3e).range(n.from, n.to))); } map(e) { let r = []; @@ -15261,101 +15261,101 @@ class e1 { return null; r.push(i); } - return new e1(r, this.active); + return new w1(r, this.active); } selectionInsideField(e) { return e.ranges.every((r) => this.ranges.some((n) => n.field == this.active && n.from <= r.from && n.to >= r.to)); } } -const vx = /* @__PURE__ */ jt.define({ +const Qx = /* @__PURE__ */ or.define({ map(t, e) { return t && t.map(e); } -}), r3e = /* @__PURE__ */ jt.define(), r2 = /* @__PURE__ */ In.define({ +}), W3e = /* @__PURE__ */ or.define(), C2 = /* @__PURE__ */ Xn.define({ create() { return null; }, update(t, e) { for (let r of e.effects) { - if (r.is(vx)) + if (r.is(Qx)) return r.value; - if (r.is(r3e) && t) - return new e1(t.ranges, r.value); + if (r.is(W3e) && t) + return new w1(t.ranges, r.value); } return t && e.docChanged && (t = t.map(e.changes)), t && e.selection && !t.selectionInsideField(e.selection) && (t = null), t; }, - provide: (t) => ft.decorations.from(t, (e) => e ? e.deco : _t.none) + provide: (t) => kt.decorations.from(t, (e) => e ? e.deco : It.none) }); -function GM(t, e) { - return Ue.create(t.filter((r) => r.field == e).map((r) => Ue.range(r.from, r.to))); +function OD(t, e) { + return je.create(t.filter((r) => r.field == e).map((r) => je.range(r.from, r.to))); } -function n3e(t) { - let e = WM.parse(t); +function G3e(t) { + let e = wD.parse(t); return (r, n, i, s) => { let { text: a, ranges: o } = e.instantiate(r.state, i), l = { - changes: { from: i, to: s, insert: Dr.of(a) }, + changes: { from: i, to: s, insert: qr.of(a) }, scrollIntoView: !0, - annotations: n ? Eee.of(n) : void 0 + annotations: n ? lte.of(n) : void 0 }; - if (o.length && (l.selection = GM(o, 0)), o.length > 1) { - let u = new e1(o, 0), h = l.effects = [vx.of(u)]; - r.state.field(r2, !1) === void 0 && h.push(jt.appendConfig.of([r2, l3e, c3e, Ree])); + if (o.length && (l.selection = OD(o, 0)), o.length > 1) { + let u = new w1(o, 0), h = l.effects = [Qx.of(u)]; + r.state.field(C2, !1) === void 0 && h.push(or.appendConfig.of([C2, K3e, J3e, fte])); } r.dispatch(r.state.update(l)); }; } -function Mee(t) { +function dte(t) { return ({ state: e, dispatch: r }) => { - let n = e.field(r2, !1); + let n = e.field(C2, !1); if (!n || t < 0 && n.active == 0) return !1; let i = n.active + t, s = t > 0 && !n.ranges.some((a) => a.field == i + t); return r(e.update({ - selection: GM(n.ranges, i), - effects: vx.of(s ? null : new e1(n.ranges, i)), + selection: OD(n.ranges, i), + effects: Qx.of(s ? null : new w1(n.ranges, i)), scrollIntoView: !0 })), !0; }; } -const i3e = ({ state: t, dispatch: e }) => t.field(r2, !1) ? (e(t.update({ effects: vx.of(null) })), !0) : !1, s3e = /* @__PURE__ */ Mee(1), a3e = /* @__PURE__ */ Mee(-1), o3e = [ - { key: "Tab", run: s3e, shift: a3e }, - { key: "Escape", run: i3e } -], pz = /* @__PURE__ */ At.define({ +const X3e = ({ state: t, dispatch: e }) => t.field(C2, !1) ? (e(t.update({ effects: Qx.of(null) })), !0) : !1, H3e = /* @__PURE__ */ dte(1), Z3e = /* @__PURE__ */ dte(-1), j3e = [ + { key: "Tab", run: H3e, shift: Z3e }, + { key: "Escape", run: X3e } +], Hz = /* @__PURE__ */ $t.define({ combine(t) { - return t.length ? t[0] : o3e; + return t.length ? t[0] : j3e; } -}), l3e = /* @__PURE__ */ Wl.highest(/* @__PURE__ */ Mu.compute([pz], (t) => t.facet(pz))); -function ka(t, e) { - return Object.assign(Object.assign({}, e), { apply: n3e(t) }); +}), K3e = /* @__PURE__ */ uc.highest(/* @__PURE__ */ Zu.compute([Hz], (t) => t.facet(Hz))); +function Qa(t, e) { + return Object.assign(Object.assign({}, e), { apply: G3e(t) }); } -const c3e = /* @__PURE__ */ ft.domEventHandlers({ +const J3e = /* @__PURE__ */ kt.domEventHandlers({ mousedown(t, e) { - let r = e.state.field(r2, !1), n; + let r = e.state.field(C2, !1), n; if (!r || (n = e.posAtCoords({ x: t.clientX, y: t.clientY })) == null) return !1; let i = r.ranges.find((s) => s.from <= n && s.to >= n); return !i || i.field == r.active ? !1 : (e.dispatch({ - selection: GM(r.ranges, i.field), - effects: vx.of(r.ranges.some((s) => s.field > i.field) ? new e1(r.ranges, i.field) : null), + selection: OD(r.ranges, i.field), + effects: Qx.of(r.ranges.some((s) => s.field > i.field) ? new w1(r.ranges, i.field) : null), scrollIntoView: !0 }), !0); } -}), n2 = { +}), E2 = { brackets: ["(", "[", "{", "'", '"'], before: ")]}:;>", stringPrefixes: [] -}, Qd = /* @__PURE__ */ jt.define({ +}, a0 = /* @__PURE__ */ or.define({ map(t, e) { - let r = e.mapPos(t, -1, Ci.TrackAfter); + let r = e.mapPos(t, -1, Fi.TrackAfter); return r == null ? void 0 : r; } -}), XM = /* @__PURE__ */ new class extends c0 { +}), kD = /* @__PURE__ */ new class extends _0 { }(); -XM.startSide = 1; -XM.endSide = -1; -const Dee = /* @__PURE__ */ In.define({ +kD.startSide = 1; +kD.endSide = -1; +const pte = /* @__PURE__ */ Xn.define({ create() { - return Er.empty; + return $r.empty; }, update(t, e) { if (t = t.map(e.changes), e.selection) { @@ -15363,88 +15363,88 @@ const Dee = /* @__PURE__ */ In.define({ t = t.update({ filter: (n) => n >= r.from && n <= r.to }); } for (let r of e.effects) - r.is(Qd) && (t = t.update({ add: [XM.range(r.value, r.value + 1)] })); + r.is(a0) && (t = t.update({ add: [kD.range(r.value, r.value + 1)] })); return t; } }); -function u3e() { - return [f3e, Dee]; +function eSe() { + return [rSe, pte]; } -const a6 = "()[]{}<>"; -function Pee(t) { - for (let e = 0; e < a6.length; e += 2) - if (a6.charCodeAt(e) == t) - return a6.charAt(e + 1); - return dM(t < 128 ? t : t + 1); +const N_ = "()[]{}<>"; +function gte(t) { + for (let e = 0; e < N_.length; e += 2) + if (N_.charCodeAt(e) == t) + return N_.charAt(e + 1); + return UM(t < 128 ? t : t + 1); } -function Nee(t, e) { - return t.languageDataAt("closeBrackets", e)[0] || n2; +function mte(t, e) { + return t.languageDataAt("closeBrackets", e)[0] || E2; } -const h3e = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(navigator.userAgent), f3e = /* @__PURE__ */ ft.inputHandler.of((t, e, r, n) => { - if ((h3e ? t.composing : t.compositionStarted) || t.state.readOnly) +const tSe = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(navigator.userAgent), rSe = /* @__PURE__ */ kt.inputHandler.of((t, e, r, n) => { + if ((tSe ? t.composing : t.compositionStarted) || t.state.readOnly) return !1; let i = t.state.selection.main; - if (n.length > 2 || n.length == 2 && Mo(as(n, 0)) == 1 || e != i.from || r != i.to) + if (n.length > 2 || n.length == 2 && Ho(bs(n, 0)) == 1 || e != i.from || r != i.to) return !1; - let s = g3e(t.state, n); + let s = sSe(t.state, n); return s ? (t.dispatch(s), !0) : !1; -}), d3e = ({ state: t, dispatch: e }) => { +}), nSe = ({ state: t, dispatch: e }) => { if (t.readOnly) return !1; - let n = Nee(t, t.selection.main.head).brackets || n2.brackets, i = null, s = t.changeByRange((a) => { + let n = mte(t, t.selection.main.head).brackets || E2.brackets, i = null, s = t.changeByRange((a) => { if (a.empty) { - let o = m3e(t.doc, a.head); + let o = aSe(t.doc, a.head); for (let l of n) - if (l == o && mT(t.doc, a.head) == Pee(as(l, 0))) + if (l == o && VT(t.doc, a.head) == gte(bs(l, 0))) return { changes: { from: a.head - l.length, to: a.head + l.length }, - range: Ue.cursor(a.head - l.length) + range: je.cursor(a.head - l.length) }; } return { range: i = a }; }); return i || e(t.update(s, { scrollIntoView: !0, userEvent: "delete.backward" })), !i; -}, p3e = [ - { key: "Backspace", run: d3e } +}, iSe = [ + { key: "Backspace", run: nSe } ]; -function g3e(t, e) { - let r = Nee(t, t.selection.main.head), n = r.brackets || n2.brackets; +function sSe(t, e) { + let r = mte(t, t.selection.main.head), n = r.brackets || E2.brackets; for (let i of n) { - let s = Pee(as(i, 0)); + let s = gte(bs(i, 0)); if (e == i) - return s == i ? b3e(t, i, n.indexOf(i + i + i) > -1, r) : v3e(t, i, s, r.before || n2.before); - if (e == s && Iee(t, t.selection.main.from)) - return y3e(t, i, s); + return s == i ? cSe(t, i, n.indexOf(i + i + i) > -1, r) : oSe(t, i, s, r.before || E2.before); + if (e == s && vte(t, t.selection.main.from)) + return lSe(t, i, s); } return null; } -function Iee(t, e) { +function vte(t, e) { let r = !1; - return t.field(Dee).between(0, t.doc.length, (n) => { + return t.field(pte).between(0, t.doc.length, (n) => { n == e && (r = !0); }), r; } -function mT(t, e) { +function VT(t, e) { let r = t.sliceString(e, e + 2); - return r.slice(0, Mo(as(r, 0))); + return r.slice(0, Ho(bs(r, 0))); } -function m3e(t, e) { +function aSe(t, e) { let r = t.sliceString(e - 2, e); - return Mo(as(r, 0)) == r.length ? r : r.slice(1); + return Ho(bs(r, 0)) == r.length ? r : r.slice(1); } -function v3e(t, e, r, n) { +function oSe(t, e, r, n) { let i = null, s = t.changeByRange((a) => { if (!a.empty) return { changes: [{ insert: e, from: a.from }, { insert: r, from: a.to }], - effects: Qd.of(a.to + e.length), - range: Ue.range(a.anchor + e.length, a.head + e.length) + effects: a0.of(a.to + e.length), + range: je.range(a.anchor + e.length, a.head + e.length) }; - let o = mT(t.doc, a.head); + let o = VT(t.doc, a.head); return !o || /\s/.test(o) || n.indexOf(o) > -1 ? { changes: { insert: e + r, from: a.head }, - effects: Qd.of(a.head + e.length), - range: Ue.cursor(a.head + e.length) + effects: a0.of(a.head + e.length), + range: je.cursor(a.head + e.length) } : { range: i = a }; }); return i ? null : t.update(s, { @@ -15452,51 +15452,51 @@ function v3e(t, e, r, n) { userEvent: "input.type" }); } -function y3e(t, e, r) { - let n = null, i = t.changeByRange((s) => s.empty && mT(t.doc, s.head) == r ? { +function lSe(t, e, r) { + let n = null, i = t.changeByRange((s) => s.empty && VT(t.doc, s.head) == r ? { changes: { from: s.head, to: s.head + r.length, insert: r }, - range: Ue.cursor(s.head + r.length) + range: je.cursor(s.head + r.length) } : n = { range: s }); return n ? null : t.update(i, { scrollIntoView: !0, userEvent: "input.type" }); } -function b3e(t, e, r, n) { - let i = n.stringPrefixes || n2.stringPrefixes, s = null, a = t.changeByRange((o) => { +function cSe(t, e, r, n) { + let i = n.stringPrefixes || E2.stringPrefixes, s = null, a = t.changeByRange((o) => { if (!o.empty) return { changes: [{ insert: e, from: o.from }, { insert: e, from: o.to }], - effects: Qd.of(o.to + e.length), - range: Ue.range(o.anchor + e.length, o.head + e.length) + effects: a0.of(o.to + e.length), + range: je.range(o.anchor + e.length, o.head + e.length) }; - let l = o.head, u = mT(t.doc, l), h; + let l = o.head, u = VT(t.doc, l), h; if (u == e) { - if (gz(t, l)) + if (Zz(t, l)) return { changes: { insert: e + e, from: l }, - effects: Qd.of(l + e.length), - range: Ue.cursor(l + e.length) + effects: a0.of(l + e.length), + range: je.cursor(l + e.length) }; - if (Iee(t, l)) { + if (vte(t, l)) { let d = r && t.sliceDoc(l, l + e.length * 3) == e + e + e ? e + e + e : e; return { changes: { from: l, to: l + d.length, insert: d }, - range: Ue.cursor(l + d.length) + range: je.cursor(l + d.length) }; } } else { - if (r && t.sliceDoc(l - 2 * e.length, l) == e + e && (h = mz(t, l - 2 * e.length, i)) > -1 && gz(t, h)) + if (r && t.sliceDoc(l - 2 * e.length, l) == e + e && (h = jz(t, l - 2 * e.length, i)) > -1 && Zz(t, h)) return { changes: { insert: e + e + e + e, from: l }, - effects: Qd.of(l + e.length), - range: Ue.cursor(l + e.length) + effects: a0.of(l + e.length), + range: je.cursor(l + e.length) }; - if (t.charCategorizer(l)(u) != Tn.Word && mz(t, l, i) > -1 && !x3e(t, l, e, i)) + if (t.charCategorizer(l)(u) != Fn.Word && jz(t, l, i) > -1 && !uSe(t, l, e, i)) return { changes: { insert: e + e, from: l }, - effects: Qd.of(l + e.length), - range: Ue.cursor(l + e.length) + effects: a0.of(l + e.length), + range: je.cursor(l + e.length) }; } return { range: s = o }; @@ -15506,12 +15506,12 @@ function b3e(t, e, r, n) { userEvent: "input.type" }); } -function gz(t, e) { - let r = dn(t).resolveInner(e + 1); +function Zz(t, e) { + let r = Cn(t).resolveInner(e + 1); return r.parent && r.from == e; } -function x3e(t, e, r, n) { - let i = dn(t).resolveInner(e, -1), s = n.reduce((a, o) => Math.max(a, o.length), 0); +function uSe(t, e, r, n) { + let i = Cn(t).resolveInner(e, -1), s = n.reduce((a, o) => Math.max(a, o.length), 0); for (let a = 0; a < 5; a++) { let o = t.sliceDoc(i.from, Math.min(i.to, i.from + r.length + s)), l = o.indexOf(r); if (!l || l > -1 && n.indexOf(o.slice(0, l)) > -1) { @@ -15530,131 +15530,131 @@ function x3e(t, e, r, n) { } return !1; } -function mz(t, e, r) { +function jz(t, e, r) { let n = t.charCategorizer(e); - if (n(t.sliceDoc(e - 1, e)) != Tn.Word) + if (n(t.sliceDoc(e - 1, e)) != Fn.Word) return e; for (let i of r) { let s = e - i.length; - if (t.sliceDoc(s, e) == i && n(t.sliceDoc(s - 1, s)) != Tn.Word) + if (t.sliceDoc(s, e) == i && n(t.sliceDoc(s - 1, s)) != Fn.Word) return s; } return -1; } -function w3e(t = {}) { +function hSe(t = {}) { return [ - oo, - Is.of(t), - Kke, - O3e, - Ree + To, + Zs.of(t), + U3e, + fSe, + fte ]; } -const $ee = [ - { key: "Ctrl-Space", run: Gke }, - { key: "Escape", run: Xke }, - { key: "ArrowDown", run: /* @__PURE__ */ jw(!0) }, - { key: "ArrowUp", run: /* @__PURE__ */ jw(!1) }, - { key: "PageDown", run: /* @__PURE__ */ jw(!0, "page") }, - { key: "PageUp", run: /* @__PURE__ */ jw(!1, "page") }, - { key: "Enter", run: Wke } -], O3e = /* @__PURE__ */ Wl.highest(/* @__PURE__ */ Mu.computeN([Is], (t) => t.facet(Is).defaultKeymap ? [$ee] : [])); -class k3e { +const yte = [ + { key: "Ctrl-Space", run: $3e }, + { key: "Escape", run: B3e }, + { key: "ArrowDown", run: /* @__PURE__ */ SO(!0) }, + { key: "ArrowUp", run: /* @__PURE__ */ SO(!1) }, + { key: "PageDown", run: /* @__PURE__ */ SO(!0, "page") }, + { key: "PageUp", run: /* @__PURE__ */ SO(!1, "page") }, + { key: "Enter", run: I3e } +], fSe = /* @__PURE__ */ uc.highest(/* @__PURE__ */ Zu.computeN([Zs], (t) => t.facet(Zs).defaultKeymap ? [yte] : [])); +class dSe { constructor(e, r, n) { this.from = e, this.to = r, this.diagnostic = n; } } -class _d { +class Gd { constructor(e, r, n) { this.diagnostics = e, this.panel = r, this.selected = n; } static init(e, r, n) { - let i = e, s = n.facet(zee).markerFilter; + let i = e, s = n.facet(wte).markerFilter; s && (i = s(i)); - let a = _t.set(i.map((o) => o.from == o.to || o.from == o.to - 1 && n.doc.lineAt(o.from).to == o.from ? _t.widget({ - widget: new M3e(o), + let a = It.set(i.map((o) => o.from == o.to || o.from == o.to - 1 && n.doc.lineAt(o.from).to == o.from ? It.widget({ + widget: new OSe(o), diagnostic: o - }).range(o.from) : _t.mark({ + }).range(o.from) : It.mark({ attributes: { class: "cm-lintRange cm-lintRange-" + o.severity + (o.markClass ? " " + o.markClass : "") }, diagnostic: o }).range(o.from, o.to)), !0); - return new _d(a, r, Xg(a)); + return new Gd(a, r, gm(a)); } } -function Xg(t, e = null, r = 0) { +function gm(t, e = null, r = 0) { let n = null; return t.between(r, 1e9, (i, s, { spec: a }) => { if (!(e && a.diagnostic != e)) - return n = new k3e(i, s, a.diagnostic), !1; + return n = new dSe(i, s, a.diagnostic), !1; }), n; } -function S3e(t, e) { +function pSe(t, e) { let r = t.startState.doc.lineAt(e.pos); - return !!(t.effects.some((n) => n.is(Bee)) || t.changes.touchesRange(r.from, r.to)); + return !!(t.effects.some((n) => n.is(bte)) || t.changes.touchesRange(r.from, r.to)); } -function T3e(t, e) { - return t.field(co, !1) ? e : e.concat(jt.appendConfig.of(N3e)); +function gSe(t, e) { + return t.field(Eo, !1) ? e : e.concat(or.appendConfig.of(TSe)); } -const Bee = /* @__PURE__ */ jt.define(), HM = /* @__PURE__ */ jt.define(), Fee = /* @__PURE__ */ jt.define(), co = /* @__PURE__ */ In.define({ +const bte = /* @__PURE__ */ or.define(), SD = /* @__PURE__ */ or.define(), xte = /* @__PURE__ */ or.define(), Eo = /* @__PURE__ */ Xn.define({ create() { - return new _d(_t.none, null, null); + return new Gd(It.none, null, null); }, update(t, e) { if (e.docChanged) { let r = t.diagnostics.map(e.changes), n = null; if (t.selected) { let i = e.changes.mapPos(t.selected.from, 1); - n = Xg(r, t.selected.diagnostic, i) || Xg(r, null, i); + n = gm(r, t.selected.diagnostic, i) || gm(r, null, i); } - t = new _d(r, t.panel, n); + t = new Gd(r, t.panel, n); } for (let r of e.effects) - r.is(Bee) ? t = _d.init(r.value, t.panel, e.state) : r.is(HM) ? t = new _d(t.diagnostics, r.value ? vT.open : null, t.selected) : r.is(Fee) && (t = new _d(t.diagnostics, t.panel, r.value)); + r.is(bte) ? t = Gd.init(r.value, t.panel, e.state) : r.is(SD) ? t = new Gd(t.diagnostics, r.value ? qT.open : null, t.selected) : r.is(xte) && (t = new Gd(t.diagnostics, t.panel, r.value)); return t; }, provide: (t) => [ - Xy.from(t, (e) => e.panel), - ft.decorations.from(t, (e) => e.diagnostics) + y2.from(t, (e) => e.panel), + kt.decorations.from(t, (e) => e.diagnostics) ] -}), C3e = /* @__PURE__ */ _t.mark({ class: "cm-lintRange cm-lintRange-active" }); -function E3e(t, e, r) { - let { diagnostics: n } = t.state.field(co), i = [], s = 2e8, a = 0; +}), mSe = /* @__PURE__ */ It.mark({ class: "cm-lintRange cm-lintRange-active" }); +function vSe(t, e, r) { + let { diagnostics: n } = t.state.field(Eo), i = [], s = 2e8, a = 0; n.between(e - (r < 0 ? 1 : 0), e + (r > 0 ? 1 : 0), (l, u, { spec: h }) => { e >= l && e <= u && (l == u || (e > l || r > 0) && (e < u || r < 0)) && (i.push(h.diagnostic), s = Math.min(l, s), a = Math.max(u, a)); }); - let o = t.state.facet(zee).tooltipFilter; + let o = t.state.facet(wte).tooltipFilter; return o && (i = o(i)), i.length ? { pos: s, end: a, above: t.state.doc.lineAt(s).to < a, create() { - return { dom: _3e(t, i) }; + return { dom: ySe(t, i) }; } } : null; } -function _3e(t, e) { - return un("ul", { class: "cm-tooltip-lint" }, e.map((r) => Uee(t, r, !1))); +function ySe(t, e) { + return kn("ul", { class: "cm-tooltip-lint" }, e.map((r) => kte(t, r, !1))); } -const A3e = (t) => { - let e = t.state.field(co, !1); - (!e || !e.panel) && t.dispatch({ effects: T3e(t.state, [HM.of(!0)]) }); - let r = Gy(t, vT.open); +const bSe = (t) => { + let e = t.state.field(Eo, !1); + (!e || !e.panel) && t.dispatch({ effects: gSe(t.state, [SD.of(!0)]) }); + let r = v2(t, qT.open); return r && r.dom.querySelector(".cm-panel-lint ul").focus(), !0; -}, vz = (t) => { - let e = t.state.field(co, !1); - return !e || !e.panel ? !1 : (t.dispatch({ effects: HM.of(!1) }), !0); -}, L3e = (t) => { - let e = t.state.field(co, !1); +}, Kz = (t) => { + let e = t.state.field(Eo, !1); + return !e || !e.panel ? !1 : (t.dispatch({ effects: SD.of(!1) }), !0); +}, xSe = (t) => { + let e = t.state.field(Eo, !1); if (!e) return !1; let r = t.state.selection.main, n = e.diagnostics.iter(r.to + 1); return !n.value && (n = e.diagnostics.iter(0), !n.value || n.from == r.from && n.to == r.to) ? !1 : (t.dispatch({ selection: { anchor: n.from, head: n.to }, scrollIntoView: !0 }), !0); -}, R3e = [ - { key: "Mod-Shift-m", run: A3e, preventDefault: !0 }, - { key: "F8", run: L3e } -], zee = /* @__PURE__ */ At.define({ +}, wSe = [ + { key: "Mod-Shift-m", run: bSe, preventDefault: !0 }, + { key: "F8", run: xSe } +], wte = /* @__PURE__ */ $t.define({ combine(t) { - return Object.assign({ sources: t.map((e) => e.source) }, Zc(t.map((e) => e.config), { + return Object.assign({ sources: t.map((e) => e.source) }, pu(t.map((e) => e.config), { delay: 750, markerFilter: null, tooltipFilter: null, @@ -15664,7 +15664,7 @@ const A3e = (t) => { })); } }); -function Qee(t) { +function Ote(t) { let e = []; if (t) e: @@ -15680,31 +15680,31 @@ function Qee(t) { } return e; } -function Uee(t, e, r) { +function kte(t, e, r) { var n; - let i = r ? Qee(e.actions) : []; - return un("li", { class: "cm-diagnostic cm-diagnostic-" + e.severity }, un("span", { class: "cm-diagnosticText" }, e.renderMessage ? e.renderMessage() : e.message), (n = e.actions) === null || n === void 0 ? void 0 : n.map((s, a) => { + let i = r ? Ote(e.actions) : []; + return kn("li", { class: "cm-diagnostic cm-diagnostic-" + e.severity }, kn("span", { class: "cm-diagnosticText" }, e.renderMessage ? e.renderMessage() : e.message), (n = e.actions) === null || n === void 0 ? void 0 : n.map((s, a) => { let o = !1, l = (d) => { if (d.preventDefault(), o) return; o = !0; - let p = Xg(t.state.field(co).diagnostics, e); + let p = gm(t.state.field(Eo).diagnostics, e); p && s.apply(t, p.from, p.to); }, { name: u } = s, h = i[a] ? u.indexOf(i[a]) : -1, f = h < 0 ? u : [ u.slice(0, h), - un("u", u.slice(h, h + 1)), + kn("u", u.slice(h, h + 1)), u.slice(h + 1) ]; - return un("button", { + return kn("button", { type: "button", class: "cm-diagnosticAction", onclick: l, onmousedown: l, "aria-label": ` Action: ${u}${h < 0 ? "" : ` (access key "${i[a]})"`}.` }, f); - }), e.source && un("div", { class: "cm-diagnosticSource" }, e.source)); + }), e.source && kn("div", { class: "cm-diagnosticSource" }, e.source)); } -class M3e extends Wa { +class OSe extends uo { constructor(e) { super(), this.diagnostic = e; } @@ -15712,20 +15712,20 @@ class M3e extends Wa { return e.diagnostic == this.diagnostic; } toDOM() { - return un("span", { class: "cm-lintPoint cm-lintPoint-" + this.diagnostic.severity }); + return kn("span", { class: "cm-lintPoint cm-lintPoint-" + this.diagnostic.severity }); } } -class yz { +class Jz { constructor(e, r) { - this.diagnostic = r, this.id = "item_" + Math.floor(Math.random() * 4294967295).toString(16), this.dom = Uee(e, r, !0), this.dom.id = this.id, this.dom.setAttribute("role", "option"); + this.diagnostic = r, this.id = "item_" + Math.floor(Math.random() * 4294967295).toString(16), this.dom = kte(e, r, !0), this.dom.id = this.id, this.dom.setAttribute("role", "option"); } } -class vT { +class qT { constructor(e) { this.view = e, this.items = []; let r = (i) => { if (i.keyCode == 27) - vz(this.view), this.view.focus(); + Kz(this.view), this.view.focus(); else if (i.keyCode == 38 || i.keyCode == 33) this.moveSelection((this.selectedIndex - 1 + this.items.length) % this.items.length); else if (i.keyCode == 40 || i.keyCode == 34) @@ -15737,10 +15737,10 @@ class vT { else if (i.keyCode == 13) this.view.focus(); else if (i.keyCode >= 65 && i.keyCode <= 90 && this.selectedIndex >= 0) { - let { diagnostic: s } = this.items[this.selectedIndex], a = Qee(s.actions); + let { diagnostic: s } = this.items[this.selectedIndex], a = Ote(s.actions); for (let o = 0; o < a.length; o++) if (a[o].toUpperCase().charCodeAt(0) == i.keyCode) { - let l = Xg(this.view.state.field(co).diagnostics, s); + let l = gm(this.view.state.field(Eo).diagnostics, s); l && s.actions[o].apply(e, l.from, l.to); } } else @@ -15750,21 +15750,21 @@ class vT { for (let s = 0; s < this.items.length; s++) this.items[s].dom.contains(i.target) && this.moveSelection(s); }; - this.list = un("ul", { + this.list = kn("ul", { tabIndex: 0, role: "listbox", "aria-label": this.view.state.phrase("Diagnostics"), onkeydown: r, onclick: n - }), this.dom = un("div", { class: "cm-panel-lint" }, this.list, un("button", { + }), this.dom = kn("div", { class: "cm-panel-lint" }, this.list, kn("button", { type: "button", name: "close", "aria-label": this.view.state.phrase("close"), - onclick: () => vz(this.view) + onclick: () => Kz(this.view) }, "\xD7")), this.update(); } get selectedIndex() { - let e = this.view.state.field(co).selected; + let e = this.view.state.field(Eo).selected; if (!e) return -1; for (let r = 0; r < this.items.length; r++) @@ -15773,7 +15773,7 @@ class vT { return -1; } update() { - let { diagnostics: e, selected: r } = this.view.state.field(co), n = 0, i = !1, s = null; + let { diagnostics: e, selected: r } = this.view.state.field(Eo), n = 0, i = !1, s = null; for (e.between(0, this.view.state.doc.length, (a, o, { spec: l }) => { let u = -1, h; for (let f = n; f < this.items.length; f++) @@ -15781,10 +15781,10 @@ class vT { u = f; break; } - u < 0 ? (h = new yz(this.view, l.diagnostic), this.items.splice(n, 0, h), i = !0) : (h = this.items[u], u > n && (this.items.splice(n, u - n), i = !0)), r && h.diagnostic == r.diagnostic ? h.dom.hasAttribute("aria-selected") || (h.dom.setAttribute("aria-selected", "true"), s = h) : h.dom.hasAttribute("aria-selected") && h.dom.removeAttribute("aria-selected"), n++; + u < 0 ? (h = new Jz(this.view, l.diagnostic), this.items.splice(n, 0, h), i = !0) : (h = this.items[u], u > n && (this.items.splice(n, u - n), i = !0)), r && h.diagnostic == r.diagnostic ? h.dom.hasAttribute("aria-selected") || (h.dom.setAttribute("aria-selected", "true"), s = h) : h.dom.hasAttribute("aria-selected") && h.dom.removeAttribute("aria-selected"), n++; }); n < this.items.length && !(this.items.length == 1 && this.items[0].diagnostic.from < 0); ) i = !0, this.items.pop(); - this.items.length == 0 && (this.items.push(new yz(this.view, { + this.items.length == 0 && (this.items.push(new Jz(this.view, { from: -1, to: -1, severity: "info", @@ -15817,24 +15817,24 @@ class vT { moveSelection(e) { if (this.selectedIndex < 0) return; - let r = this.view.state.field(co), n = Xg(r.diagnostics, this.items[e].diagnostic); + let r = this.view.state.field(Eo), n = gm(r.diagnostics, this.items[e].diagnostic); !n || this.view.dispatch({ selection: { anchor: n.from, head: n.to }, scrollIntoView: !0, - effects: Fee.of(n) + effects: xte.of(n) }); } static open(e) { - return new vT(e); + return new qT(e); } } -function D3e(t, e = 'viewBox="0 0 40 40"') { +function kSe(t, e = 'viewBox="0 0 40 40"') { return `url('data:image/svg+xml,${encodeURIComponent(t)}')`; } -function Kw(t) { - return D3e(``, 'width="6" height="3"'); +function TO(t) { + return kSe(``, 'width="6" height="3"'); } -const P3e = /* @__PURE__ */ ft.baseTheme({ +const SSe = /* @__PURE__ */ kt.baseTheme({ ".cm-diagnostic": { padding: "3px 6px 3px 8px", marginLeft: "-1px", @@ -15864,10 +15864,10 @@ const P3e = /* @__PURE__ */ ft.baseTheme({ backgroundRepeat: "repeat-x", paddingBottom: "0.7px" }, - ".cm-lintRange-error": { backgroundImage: /* @__PURE__ */ Kw("#d11") }, - ".cm-lintRange-warning": { backgroundImage: /* @__PURE__ */ Kw("orange") }, - ".cm-lintRange-info": { backgroundImage: /* @__PURE__ */ Kw("#999") }, - ".cm-lintRange-hint": { backgroundImage: /* @__PURE__ */ Kw("#66d") }, + ".cm-lintRange-error": { backgroundImage: /* @__PURE__ */ TO("#d11") }, + ".cm-lintRange-warning": { backgroundImage: /* @__PURE__ */ TO("orange") }, + ".cm-lintRange-info": { backgroundImage: /* @__PURE__ */ TO("#999") }, + ".cm-lintRange-hint": { backgroundImage: /* @__PURE__ */ TO("#66d") }, ".cm-lintRange-active": { backgroundColor: "#ffdd9980" }, ".cm-tooltip-lint": { padding: 0, @@ -15924,85 +15924,85 @@ const P3e = /* @__PURE__ */ ft.baseTheme({ margin: 0 } } -}), N3e = [ - co, - /* @__PURE__ */ ft.decorations.compute([co], (t) => { - let { selected: e, panel: r } = t.field(co); - return !e || !r || e.from == e.to ? _t.none : _t.set([ - C3e.range(e.from, e.to) +}), TSe = [ + Eo, + /* @__PURE__ */ kt.decorations.compute([Eo], (t) => { + let { selected: e, panel: r } = t.field(Eo); + return !e || !r || e.from == e.to ? It.none : It.set([ + mSe.range(e.from, e.to) ]); }), - /* @__PURE__ */ LOe(E3e, { hideOn: S3e }), - P3e -], I3e = /* @__PURE__ */ (() => [ - BOe(), - QOe(), - rJ(), - $M(), - D4e(), - JK(), - nOe(), - dr.allowMultipleSelections.of(!0), - x4e(), - _J(AJ, { fallback: !0 }), - V4e(), - u3e(), - w3e(), - bOe(), - OOe(), - nJ(), - oke(), - Mu.of([ - ...p3e, - ...dee, - ...Cke, - ...zJ, - ...A4e, - ...$ee, - ...R3e + /* @__PURE__ */ x4e(vSe, { hideOn: pSe }), + SSe +], CSe = /* @__PURE__ */ (() => [ + _4e(), + R4e(), + $J(), + fD(), + k5e(), + PJ(), + GOe(), + Sr.allowMultipleSelections.of(!0), + u5e(), + cee(uee, { fallback: !0 }), + D5e(), + eSe(), + hSe(), + c4e(), + f4e(), + BJ(), + jke(), + Zu.of([ + ...iSe, + ...Xee, + ...m3e, + ...wee, + ...b5e, + ...yte, + ...wSe ]) -])(), $3e = /* @__PURE__ */ (() => [ - rJ(), - $M(), - JK(), - _J(AJ, { fallback: !0 }), - Mu.of([ - ...dee, - ...zJ +])(), ESe = /* @__PURE__ */ (() => [ + $J(), + fD(), + PJ(), + cee(uee, { fallback: !0 }), + Zu.of([ + ...Xee, + ...wee ]) -])(), Cl = () => /* @__PURE__ */ new Map(), n8 = (t) => { - const e = Cl(); +])(), ql = () => /* @__PURE__ */ new Map(), M8 = (t) => { + const e = ql(); return t.forEach((r, n) => { e.set(n, r); }), e; -}, hh = (t, e, r) => { +}, Ah = (t, e, r) => { let n = t.get(e); return n === void 0 && t.set(e, n = r()), n; -}, B3e = (t, e) => { +}, _Se = (t, e) => { const r = []; for (const [n, i] of t) r.push(e(i, n)); return r; -}, F3e = (t, e) => { +}, ASe = (t, e) => { for (const [r, n] of t) if (e(n, r)) return !0; return !1; -}, h0 = () => /* @__PURE__ */ new Set(), o6 = (t) => t[t.length - 1], z3e = (t, e) => { +}, L0 = () => /* @__PURE__ */ new Set(), I_ = (t) => t[t.length - 1], LSe = (t, e) => { for (let r = 0; r < e.length; r++) t.push(e[r]); -}, wf = Array.from, Q3e = (t, e) => { +}, Ff = Array.from, RSe = (t, e) => { for (let r = 0; r < t.length; r++) if (e(t[r], r, t)) return !0; return !1; -}, i8 = Array.isArray; -class yT { +}, D8 = Array.isArray; +class YT { constructor() { - this._observers = Cl(); + this._observers = ql(); } on(e, r) { - hh(this._observers, e, h0).add(r); + Ah(this._observers, e, L0).add(r); } once(e, r) { const n = (...i) => { @@ -16015,208 +16015,208 @@ class yT { n !== void 0 && (n.delete(r), n.size === 0 && this._observers.delete(e)); } emit(e, r) { - return wf((this._observers.get(e) || Cl()).values()).forEach((n) => n(...r)); + return Ff((this._observers.get(e) || ql()).values()).forEach((n) => n(...r)); } destroy() { - this._observers = Cl(); + this._observers = ql(); } } -const Gu = Math.floor, N4 = Math.abs, bT = (t, e) => t < e ? t : e, Zf = (t, e) => t > e ? t : e, U3e = Math.pow, Vee = (t) => t !== 0 ? t < 0 : 1 / t < 0, bz = 1, xz = 2, l6 = 4, c6 = 8, i2 = 32, Pu = 64, uo = 128, xT = 31, s8 = 63, t0 = 127, V3e = 2147483647, qee = Number.MAX_SAFE_INTEGER, q3e = Number.isInteger || ((t) => typeof t == "number" && isFinite(t) && Gu(t) === t), Y3e = String.fromCharCode, W3e = (t) => t.toLowerCase(), G3e = /^\s*/g, X3e = (t) => t.replace(G3e, ""), H3e = /([A-Z])/g, wz = (t, e) => X3e(t.replace(H3e, (r) => `${e}${W3e(r)}`)), Z3e = (t) => { +const hh = Math.floor, l5 = Math.abs, WT = (t, e) => t < e ? t : e, pd = (t, e) => t > e ? t : e, MSe = Math.pow, Ste = (t) => t !== 0 ? t < 0 : 1 / t < 0, eQ = 1, tQ = 2, $_ = 4, B_ = 8, _2 = 32, Ku = 64, _o = 128, GT = 31, P8 = 63, x0 = 127, DSe = 2147483647, Tte = Number.MAX_SAFE_INTEGER, PSe = Number.isInteger || ((t) => typeof t == "number" && isFinite(t) && hh(t) === t), NSe = String.fromCharCode, ISe = (t) => t.toLowerCase(), $Se = /^\s*/g, BSe = (t) => t.replace($Se, ""), FSe = /([A-Z])/g, rQ = (t, e) => BSe(t.replace(FSe, (r) => `${e}${ISe(r)}`)), zSe = (t) => { const e = unescape(encodeURIComponent(t)), r = e.length, n = new Uint8Array(r); for (let i = 0; i < r; i++) n[i] = e.codePointAt(i); return n; -}, s2 = typeof TextEncoder < "u" ? new TextEncoder() : null, j3e = (t) => s2.encode(t), K3e = s2 ? j3e : Z3e; -let fy = typeof TextDecoder > "u" ? null : new TextDecoder("utf-8", { fatal: !0, ignoreBOM: !0 }); -fy && fy.decode(new Uint8Array()).length === 1 && (fy = null); -class yx { +}, A2 = typeof TextEncoder < "u" ? new TextEncoder() : null, QSe = (t) => A2.encode(t), USe = A2 ? QSe : zSe; +let Iy = typeof TextDecoder > "u" ? null : new TextDecoder("utf-8", { fatal: !0, ignoreBOM: !0 }); +Iy && Iy.decode(new Uint8Array()).length === 1 && (Iy = null); +class Ux { constructor() { this.cpos = 0, this.cbuf = new Uint8Array(100), this.bufs = []; } } -const Rs = () => new yx(), ZM = (t) => { +const Ys = () => new Ux(), TD = (t) => { let e = t.cpos; for (let r = 0; r < t.bufs.length; r++) e += t.bufs[r].length; return e; -}, Rn = (t) => { - const e = new Uint8Array(ZM(t)); +}, Vn = (t) => { + const e = new Uint8Array(TD(t)); let r = 0; for (let n = 0; n < t.bufs.length; n++) { const i = t.bufs[n]; e.set(i, r), r += i.length; } return e.set(new Uint8Array(t.cbuf.buffer, 0, t.cpos), r), e; -}, J3e = (t, e) => { +}, VSe = (t, e) => { const r = t.cbuf.length; - r - t.cpos < e && (t.bufs.push(new Uint8Array(t.cbuf.buffer, 0, t.cpos)), t.cbuf = new Uint8Array(Zf(r, e) * 2), t.cpos = 0); -}, Vi = (t, e) => { + r - t.cpos < e && (t.bufs.push(new Uint8Array(t.cbuf.buffer, 0, t.cpos)), t.cbuf = new Uint8Array(pd(r, e) * 2), t.cpos = 0); +}, ts = (t, e) => { const r = t.cbuf.length; t.cpos === r && (t.bufs.push(t.cbuf), t.cbuf = new Uint8Array(r * 2), t.cpos = 0), t.cbuf[t.cpos++] = e; -}, a8 = Vi, Gt = (t, e) => { - for (; e > t0; ) - Vi(t, uo | t0 & e), e = Gu(e / 128); - Vi(t, t0 & e); -}, jM = (t, e) => { - const r = Vee(e); - for (r && (e = -e), Vi(t, (e > s8 ? uo : 0) | (r ? Pu : 0) | s8 & e), e = Gu(e / 64); e > 0; ) - Vi(t, (e > t0 ? uo : 0) | t0 & e), e = Gu(e / 128); -}, o8 = new Uint8Array(3e4), eSe = o8.length / 3, tSe = (t, e) => { - if (e.length < eSe) { - const r = s2.encodeInto(e, o8).written || 0; - Gt(t, r); +}, N8 = ts, rr = (t, e) => { + for (; e > x0; ) + ts(t, _o | x0 & e), e = hh(e / 128); + ts(t, x0 & e); +}, CD = (t, e) => { + const r = Ste(e); + for (r && (e = -e), ts(t, (e > P8 ? _o : 0) | (r ? Ku : 0) | P8 & e), e = hh(e / 64); e > 0; ) + ts(t, (e > x0 ? _o : 0) | x0 & e), e = hh(e / 128); +}, I8 = new Uint8Array(3e4), qSe = I8.length / 3, YSe = (t, e) => { + if (e.length < qSe) { + const r = A2.encodeInto(e, I8).written || 0; + rr(t, r); for (let n = 0; n < r; n++) - Vi(t, o8[n]); + ts(t, I8[n]); } else - Zn(t, K3e(e)); -}, rSe = (t, e) => { + ci(t, USe(e)); +}, WSe = (t, e) => { const r = unescape(encodeURIComponent(e)), n = r.length; - Gt(t, n); + rr(t, n); for (let i = 0; i < n; i++) - Vi(t, r.codePointAt(i)); -}, r0 = s2 && s2.encodeInto ? tSe : rSe, wT = (t, e) => { - const r = t.cbuf.length, n = t.cpos, i = bT(r - n, e.length), s = e.length - i; - t.cbuf.set(e.subarray(0, i), n), t.cpos += i, s > 0 && (t.bufs.push(t.cbuf), t.cbuf = new Uint8Array(Zf(r * 2, s)), t.cbuf.set(e.subarray(i)), t.cpos = s); -}, Zn = (t, e) => { - Gt(t, e.byteLength), wT(t, e); -}, KM = (t, e) => { - J3e(t, e); + ts(t, r.codePointAt(i)); +}, w0 = A2 && A2.encodeInto ? YSe : WSe, XT = (t, e) => { + const r = t.cbuf.length, n = t.cpos, i = WT(r - n, e.length), s = e.length - i; + t.cbuf.set(e.subarray(0, i), n), t.cpos += i, s > 0 && (t.bufs.push(t.cbuf), t.cbuf = new Uint8Array(pd(r * 2, s)), t.cbuf.set(e.subarray(i)), t.cpos = s); +}, ci = (t, e) => { + rr(t, e.byteLength), XT(t, e); +}, ED = (t, e) => { + VSe(t, e); const r = new DataView(t.cbuf.buffer, t.cpos, e); return t.cpos += e, r; -}, nSe = (t, e) => KM(t, 4).setFloat32(0, e, !1), iSe = (t, e) => KM(t, 8).setFloat64(0, e, !1), sSe = (t, e) => KM(t, 8).setBigInt64(0, e, !1), Oz = new DataView(new ArrayBuffer(4)), aSe = (t) => (Oz.setFloat32(0, t), Oz.getFloat32(0) === t), a2 = (t, e) => { +}, GSe = (t, e) => ED(t, 4).setFloat32(0, e, !1), XSe = (t, e) => ED(t, 8).setFloat64(0, e, !1), HSe = (t, e) => ED(t, 8).setBigInt64(0, e, !1), nQ = new DataView(new ArrayBuffer(4)), ZSe = (t) => (nQ.setFloat32(0, t), nQ.getFloat32(0) === t), L2 = (t, e) => { switch (typeof e) { case "string": - Vi(t, 119), r0(t, e); + ts(t, 119), w0(t, e); break; case "number": - q3e(e) && N4(e) <= V3e ? (Vi(t, 125), jM(t, e)) : aSe(e) ? (Vi(t, 124), nSe(t, e)) : (Vi(t, 123), iSe(t, e)); + PSe(e) && l5(e) <= DSe ? (ts(t, 125), CD(t, e)) : ZSe(e) ? (ts(t, 124), GSe(t, e)) : (ts(t, 123), XSe(t, e)); break; case "bigint": - Vi(t, 122), sSe(t, e); + ts(t, 122), HSe(t, e); break; case "object": if (e === null) - Vi(t, 126); - else if (i8(e)) { - Vi(t, 117), Gt(t, e.length); + ts(t, 126); + else if (D8(e)) { + ts(t, 117), rr(t, e.length); for (let r = 0; r < e.length; r++) - a2(t, e[r]); + L2(t, e[r]); } else if (e instanceof Uint8Array) - Vi(t, 116), Zn(t, e); + ts(t, 116), ci(t, e); else { - Vi(t, 118); + ts(t, 118); const r = Object.keys(e); - Gt(t, r.length); + rr(t, r.length); for (let n = 0; n < r.length; n++) { const i = r[n]; - r0(t, i), a2(t, e[i]); + w0(t, i), L2(t, e[i]); } } break; case "boolean": - Vi(t, e ? 120 : 121); + ts(t, e ? 120 : 121); break; default: - Vi(t, 127); + ts(t, 127); } }; -class kz extends yx { +class iQ extends Ux { constructor(e) { super(), this.w = e, this.s = null, this.count = 0; } write(e) { - this.s === e ? this.count++ : (this.count > 0 && Gt(this, this.count - 1), this.count = 1, this.w(this, e), this.s = e); + this.s === e ? this.count++ : (this.count > 0 && rr(this, this.count - 1), this.count = 1, this.w(this, e), this.s = e); } } -const Sz = (t) => { - t.count > 0 && (jM(t.encoder, t.count === 1 ? t.s : -t.s), t.count > 1 && Gt(t.encoder, t.count - 2)); +const sQ = (t) => { + t.count > 0 && (CD(t.encoder, t.count === 1 ? t.s : -t.s), t.count > 1 && rr(t.encoder, t.count - 2)); }; -class I4 { +class c5 { constructor() { - this.encoder = new yx(), this.s = 0, this.count = 0; + this.encoder = new Ux(), this.s = 0, this.count = 0; } write(e) { - this.s === e ? this.count++ : (Sz(this), this.count = 1, this.s = e); + this.s === e ? this.count++ : (sQ(this), this.count = 1, this.s = e); } toUint8Array() { - return Sz(this), Rn(this.encoder); + return sQ(this), Vn(this.encoder); } } -const Tz = (t) => { +const aQ = (t) => { if (t.count > 0) { const e = t.diff * 2 + (t.count === 1 ? 0 : 1); - jM(t.encoder, e), t.count > 1 && Gt(t.encoder, t.count - 2); + CD(t.encoder, e), t.count > 1 && rr(t.encoder, t.count - 2); } }; -class u6 { +class F_ { constructor() { - this.encoder = new yx(), this.s = 0, this.count = 0, this.diff = 0; + this.encoder = new Ux(), this.s = 0, this.count = 0, this.diff = 0; } write(e) { - this.diff === e - this.s ? (this.s = e, this.count++) : (Tz(this), this.count = 1, this.diff = e - this.s, this.s = e); + this.diff === e - this.s ? (this.s = e, this.count++) : (aQ(this), this.count = 1, this.diff = e - this.s, this.s = e); } toUint8Array() { - return Tz(this), Rn(this.encoder); + return aQ(this), Vn(this.encoder); } } -class oSe { +class jSe { constructor() { - this.sarr = [], this.s = "", this.lensE = new I4(); + this.sarr = [], this.s = "", this.lensE = new c5(); } write(e) { this.s += e, this.s.length > 19 && (this.sarr.push(this.s), this.s = ""), this.lensE.write(e.length); } toUint8Array() { - const e = new yx(); - return this.sarr.push(this.s), this.s = "", r0(e, this.sarr.join("")), wT(e, this.lensE.toUint8Array()), Rn(e); + const e = new Ux(); + return this.sarr.push(this.s), this.s = "", w0(e, this.sarr.join("")), XT(e, this.lensE.toUint8Array()), Vn(e); } } -const Of = (t) => new Error(t), Pc = () => { - throw Of("Method unimplemented"); -}, zl = () => { - throw Of("Unexpected case"); -}, Yee = Of("Unexpected end of array"), Wee = Of("Integer out of Range"); -class OT { +const zf = (t) => new Error(t), Jc = () => { + throw zf("Method unimplemented"); +}, ic = () => { + throw zf("Unexpected case"); +}, Cte = zf("Unexpected end of array"), Ete = zf("Integer out of Range"); +class HT { constructor(e) { this.arr = e, this.pos = 0; } } -const jf = (t) => new OT(t), lSe = (t) => t.pos !== t.arr.length, cSe = (t, e) => { +const gd = (t) => new HT(t), KSe = (t) => t.pos !== t.arr.length, JSe = (t, e) => { const r = new Uint8Array(t.arr.buffer, t.pos + t.arr.byteOffset, e); return t.pos += e, r; -}, Ls = (t) => cSe(t, lr(t)), Hg = (t) => t.arr[t.pos++], lr = (t) => { +}, qs = (t) => JSe(t, xr(t)), mm = (t) => t.arr[t.pos++], xr = (t) => { let e = 0, r = 1; const n = t.arr.length; for (; t.pos < n; ) { const i = t.arr[t.pos++]; - if (e = e + (i & t0) * r, r *= 128, i < uo) + if (e = e + (i & x0) * r, r *= 128, i < _o) return e; - if (e > qee) - throw Wee; - } - throw Yee; -}, JM = (t) => { - let e = t.arr[t.pos++], r = e & s8, n = 64; - const i = (e & Pu) > 0 ? -1 : 1; - if ((e & uo) === 0) + if (e > Tte) + throw Ete; + } + throw Cte; +}, _D = (t) => { + let e = t.arr[t.pos++], r = e & P8, n = 64; + const i = (e & Ku) > 0 ? -1 : 1; + if ((e & _o) === 0) return i * r; const s = t.arr.length; for (; t.pos < s; ) { - if (e = t.arr[t.pos++], r = r + (e & t0) * n, n *= 128, e < uo) + if (e = t.arr[t.pos++], r = r + (e & x0) * n, n *= 128, e < _o) return i * r; - if (r > qee) - throw Wee; + if (r > Tte) + throw Ete; } - throw Yee; -}, uSe = (t) => { - let e = lr(t); + throw Cte; +}, eTe = (t) => { + let e = xr(t); if (e === 0) return ""; { - let r = String.fromCodePoint(Hg(t)); + let r = String.fromCodePoint(mm(t)); if (--e < 100) for (; e--; ) - r += String.fromCodePoint(Hg(t)); + r += String.fromCodePoint(mm(t)); else for (; e > 0; ) { const n = e < 1e4 ? e : 1e4, i = t.arr.subarray(t.pos, t.pos + n); @@ -16224,85 +16224,85 @@ const jf = (t) => new OT(t), lSe = (t) => t.pos !== t.arr.length, cSe = (t, e) = } return decodeURIComponent(escape(r)); } -}, hSe = (t) => fy.decode(Ls(t)), nf = fy ? hSe : uSe, eD = (t, e) => { +}, tTe = (t) => Iy.decode(qs(t)), Of = Iy ? tTe : eTe, AD = (t, e) => { const r = new DataView(t.arr.buffer, t.arr.byteOffset + t.pos, e); return t.pos += e, r; -}, fSe = (t) => eD(t, 4).getFloat32(0, !1), dSe = (t) => eD(t, 8).getFloat64(0, !1), pSe = (t) => eD(t, 8).getBigInt64(0, !1), gSe = [ +}, rTe = (t) => AD(t, 4).getFloat32(0, !1), nTe = (t) => AD(t, 8).getFloat64(0, !1), iTe = (t) => AD(t, 8).getBigInt64(0, !1), sTe = [ (t) => { }, (t) => null, - JM, - fSe, - dSe, - pSe, + _D, + rTe, + nTe, + iTe, (t) => !1, (t) => !0, - nf, + Of, (t) => { - const e = lr(t), r = {}; + const e = xr(t), r = {}; for (let n = 0; n < e; n++) { - const i = nf(t); - r[i] = o2(t); + const i = Of(t); + r[i] = R2(t); } return r; }, (t) => { - const e = lr(t), r = []; + const e = xr(t), r = []; for (let n = 0; n < e; n++) - r.push(o2(t)); + r.push(R2(t)); return r; }, - Ls -], o2 = (t) => gSe[127 - Hg(t)](t); -class Cz extends OT { + qs +], R2 = (t) => sTe[127 - mm(t)](t); +class oQ extends HT { constructor(e, r) { super(e), this.reader = r, this.s = null, this.count = 0; } read() { - return this.count === 0 && (this.s = this.reader(this), lSe(this) ? this.count = lr(this) + 1 : this.count = -1), this.count--, this.s; + return this.count === 0 && (this.s = this.reader(this), KSe(this) ? this.count = xr(this) + 1 : this.count = -1), this.count--, this.s; } } -class $4 extends OT { +class u5 extends HT { constructor(e) { super(e), this.s = 0, this.count = 0; } read() { if (this.count === 0) { - this.s = JM(this); - const e = Vee(this.s); - this.count = 1, e && (this.s = -this.s, this.count = lr(this) + 2); + this.s = _D(this); + const e = Ste(this.s); + this.count = 1, e && (this.s = -this.s, this.count = xr(this) + 2); } return this.count--, this.s; } } -class h6 extends OT { +class z_ extends HT { constructor(e) { super(e), this.s = 0, this.count = 0, this.diff = 0; } read() { if (this.count === 0) { - const e = JM(this), r = e & 1; - this.diff = Gu(e / 2), this.count = 1, r && (this.count = lr(this) + 2); + const e = _D(this), r = e & 1; + this.diff = hh(e / 2), this.count = 1, r && (this.count = xr(this) + 2); } return this.s += this.diff, this.count--, this.s; } } -class mSe { +class aTe { constructor(e) { - this.decoder = new $4(e), this.str = nf(this.decoder), this.spos = 0; + this.decoder = new u5(e), this.str = Of(this.decoder), this.spos = 0; } read() { const e = this.spos + this.decoder.read(), r = this.str.slice(this.spos, e); return this.spos = e, r; } } -const vSe = crypto.getRandomValues.bind(crypto), Gee = () => vSe(new Uint32Array(1))[0], ySe = [1e7] + -1e3 + -4e3 + -8e3 + -1e11, bSe = () => ySe.replace( +const oTe = crypto.getRandomValues.bind(crypto), _te = () => oTe(new Uint32Array(1))[0], lTe = [1e7] + -1e3 + -4e3 + -8e3 + -1e11, cTe = () => lTe.replace( /[018]/g, - (t) => (t ^ Gee() & 15 >> t / 4).toString(16) -), kf = Date.now, Ez = (t) => new Promise(t); + (t) => (t ^ _te() & 15 >> t / 4).toString(16) +), Qf = Date.now, lQ = (t) => new Promise(t); Promise.all.bind(Promise); -const _z = (t) => t === void 0 ? null : t; -class xSe { +const cQ = (t) => t === void 0 ? null : t; +class uTe { constructor() { this.map = /* @__PURE__ */ new Map(); } @@ -16313,38 +16313,38 @@ class xSe { return this.map.get(e); } } -let Xee = new xSe(), tD = !0; +let Ate = new uTe(), LD = !0; try { - typeof localStorage < "u" && localStorage && (Xee = localStorage, tD = !1); + typeof localStorage < "u" && localStorage && (Ate = localStorage, LD = !1); } catch { } -const Hee = Xee, wSe = (t) => tD || addEventListener("storage", t), OSe = (t) => tD || removeEventListener("storage", t), kSe = Object.assign, SSe = Object.keys, TSe = (t, e) => { +const Lte = Ate, hTe = (t) => LD || addEventListener("storage", t), fTe = (t) => LD || removeEventListener("storage", t), dTe = Object.assign, pTe = Object.keys, gTe = (t, e) => { for (const r in t) e(t[r], r); -}, CSe = (t, e) => { +}, mTe = (t, e) => { const r = []; for (const n in t) r.push(e(t[n], n)); return r; -}, ok = (t) => SSe(t).length, ESe = (t) => { +}, Pk = (t) => pTe(t).length, vTe = (t) => { for (const e in t) return !1; return !0; -}, _Se = (t, e) => { +}, yTe = (t, e) => { for (const r in t) if (!e(t[r], r)) return !1; return !0; -}, Zee = (t, e) => Object.prototype.hasOwnProperty.call(t, e), ASe = (t, e) => t === e || ok(t) === ok(e) && _Se(t, (r, n) => (r !== void 0 || Zee(e, n)) && e[n] === r), rD = (t, e, r = 0) => { +}, Rte = (t, e) => Object.prototype.hasOwnProperty.call(t, e), bTe = (t, e) => t === e || Pk(t) === Pk(e) && yTe(t, (r, n) => (r !== void 0 || Rte(e, n)) && e[n] === r), RD = (t, e, r = 0) => { try { for (; r < t.length; r++) t[r](...e); } finally { - r < t.length && rD(t, e, r + 1); + r < t.length && RD(t, e, r + 1); } -}, LSe = (t) => t, RSe = (t, e) => t === e, dy = (t, e) => { +}, xTe = (t) => t, wTe = (t, e) => t === e, $y = (t, e) => { if (t == null || e == null) - return RSe(t, e); + return wTe(t, e); if (t.constructor !== e.constructor) return !1; if (t === e) @@ -16372,92 +16372,92 @@ const Hee = Xee, wSe = (t) => tD || addEventListener("storage", t), OSe = (t) => if (t.size !== e.size) return !1; for (const r of t.keys()) - if (!e.has(r) || !dy(t.get(r), e.get(r))) + if (!e.has(r) || !$y(t.get(r), e.get(r))) return !1; break; } case Object: - if (ok(t) !== ok(e)) + if (Pk(t) !== Pk(e)) return !1; for (const r in t) - if (!Zee(t, r) || !dy(t[r], e[r])) + if (!Rte(t, r) || !$y(t[r], e[r])) return !1; break; case Array: if (t.length !== e.length) return !1; for (let r = 0; r < t.length; r++) - if (!dy(t[r], e[r])) + if (!$y(t[r], e[r])) return !1; break; default: return !1; } return !0; -}, MSe = (t, e) => e.includes(t), Zg = typeof process < "u" && process.release && /node|io\.js/.test(process.release.name) && Object.prototype.toString.call(typeof process < "u" ? process : 0) === "[object process]", jee = typeof window < "u" && typeof document < "u" && !Zg; +}, OTe = (t, e) => e.includes(t), vm = typeof process < "u" && process.release && /node|io\.js/.test(process.release.name) && Object.prototype.toString.call(typeof process < "u" ? process : 0) === "[object process]", Mte = typeof window < "u" && typeof document < "u" && !vm; typeof navigator < "u" && /Mac/.test(navigator.platform); -let sc; -const DSe = () => { - if (sc === void 0) - if (Zg) { - sc = Cl(); +let Sc; +const kTe = () => { + if (Sc === void 0) + if (vm) { + Sc = ql(); const t = process.argv; let e = null; for (let r = 0; r < t.length; r++) { const n = t[r]; - n[0] === "-" ? (e !== null && sc.set(e, ""), e = n) : e !== null && (sc.set(e, n), e = null); + n[0] === "-" ? (e !== null && Sc.set(e, ""), e = n) : e !== null && (Sc.set(e, n), e = null); } - e !== null && sc.set(e, ""); + e !== null && Sc.set(e, ""); } else - typeof location == "object" ? (sc = Cl(), (location.search || "?").slice(1).split("&").forEach((t) => { + typeof location == "object" ? (Sc = ql(), (location.search || "?").slice(1).split("&").forEach((t) => { if (t.length !== 0) { const [e, r] = t.split("="); - sc.set(`--${wz(e, "-")}`, r), sc.set(`-${wz(e, "-")}`, r); + Sc.set(`--${rQ(e, "-")}`, r), Sc.set(`-${rQ(e, "-")}`, r); } - })) : sc = Cl(); - return sc; -}, l8 = (t) => DSe().has(t), c8 = (t) => _z(Zg ? {}[t.toUpperCase()] : Hee.getItem(t)), PSe = (t) => l8("--" + t) || c8(t) !== null; -PSe("production"); -const Az = Zg && MSe({}.FORCE_COLOR, ["true", "1", "2"]), NSe = !l8("no-colors") && (!Zg || process.stdout.isTTY || Az) && (!Zg || l8("color") || Az || c8("COLORTERM") !== null || (c8("TERM") || "").includes("color")), Kee = (t) => new Uint8Array(t), ISe = (t, e, r) => new Uint8Array(t, e, r), $Se = (t) => new Uint8Array(t), BSe = (t) => { + })) : Sc = ql(); + return Sc; +}, $8 = (t) => kTe().has(t), B8 = (t) => cQ(vm ? {}[t.toUpperCase()] : Lte.getItem(t)), STe = (t) => $8("--" + t) || B8(t) !== null; +STe("production"); +const uQ = vm && OTe({}.FORCE_COLOR, ["true", "1", "2"]), TTe = !$8("no-colors") && (!vm || process.stdout.isTTY || uQ) && (!vm || $8("color") || uQ || B8("COLORTERM") !== null || (B8("TERM") || "").includes("color")), Dte = (t) => new Uint8Array(t), CTe = (t, e, r) => new Uint8Array(t, e, r), ETe = (t) => new Uint8Array(t), _Te = (t) => { let e = ""; for (let r = 0; r < t.byteLength; r++) - e += Y3e(t[r]); + e += NSe(t[r]); return btoa(e); -}, FSe = (t) => Buffer.from(t.buffer, t.byteOffset, t.byteLength).toString("base64"), zSe = (t) => { - const e = atob(t), r = Kee(e.length); +}, ATe = (t) => Buffer.from(t.buffer, t.byteOffset, t.byteLength).toString("base64"), LTe = (t) => { + const e = atob(t), r = Dte(e.length); for (let n = 0; n < e.length; n++) r[n] = e.charCodeAt(n); return r; -}, QSe = (t) => { +}, RTe = (t) => { const e = Buffer.from(t, "base64"); - return ISe(e.buffer, e.byteOffset, e.byteLength); -}, USe = jee ? BSe : FSe, VSe = jee ? zSe : QSe, qSe = (t) => { - const e = Kee(t.byteLength); + return CTe(e.buffer, e.byteOffset, e.byteLength); +}, MTe = Mte ? _Te : ATe, DTe = Mte ? LTe : RTe, PTe = (t) => { + const e = Dte(t.byteLength); return e.set(t), e; }; -class YSe { +class NTe { constructor(e, r) { this.left = e, this.right = r; } } -const ro = (t, e) => new YSe(t, e), WSe = (t, e) => t.forEach((r) => e(r.left, r.right)), Kc = typeof document < "u" ? document : {}, GSe = (t) => Kc.createElement(t), XSe = () => Kc.createDocumentFragment(), HSe = (t) => Kc.createTextNode(t); +const xo = (t, e) => new NTe(t, e), ITe = (t, e) => t.forEach((r) => e(r.left, r.right)), mu = typeof document < "u" ? document : {}, $Te = (t) => mu.createElement(t), BTe = () => mu.createDocumentFragment(), FTe = (t) => mu.createTextNode(t); typeof DOMParser < "u" && new DOMParser(); -const ZSe = (t, e) => (WSe(e, (r, n) => { +const zTe = (t, e) => (ITe(e, (r, n) => { n === !1 ? t.removeAttribute(r) : n === !0 ? t.setAttribute(r, "") : t.setAttribute(r, n); -}), t), jSe = (t) => { - const e = XSe(); +}), t), QTe = (t) => { + const e = BTe(); for (let r = 0; r < t.length; r++) - Jee(e, t[r]); + Pte(e, t[r]); return e; -}, KSe = (t, e) => (Jee(t, jSe(e)), t), f6 = (t, e = [], r = []) => KSe(ZSe(GSe(t), e), r), Jw = HSe, JSe = (t) => B3e(t, (e, r) => `${r}:${e};`).join(""), Jee = (t, e) => t.appendChild(e); -Kc.ELEMENT_NODE; -Kc.TEXT_NODE; -Kc.CDATA_SECTION_NODE; -Kc.COMMENT_NODE; -Kc.DOCUMENT_NODE; -Kc.DOCUMENT_TYPE_NODE; -Kc.DOCUMENT_FRAGMENT_NODE; -const fh = Symbol, ete = fh(), tte = fh(), eTe = fh(), tTe = fh(), rTe = fh(), rte = fh(), nTe = fh(), nD = fh(), iTe = fh(), sTe = (t) => { +}, UTe = (t, e) => (Pte(t, QTe(e)), t), Q_ = (t, e = [], r = []) => UTe(zTe($Te(t), e), r), CO = FTe, VTe = (t) => _Se(t, (e, r) => `${r}:${e};`).join(""), Pte = (t, e) => t.appendChild(e); +mu.ELEMENT_NODE; +mu.TEXT_NODE; +mu.CDATA_SECTION_NODE; +mu.COMMENT_NODE; +mu.DOCUMENT_NODE; +mu.DOCUMENT_TYPE_NODE; +mu.DOCUMENT_FRAGMENT_NODE; +const Lh = Symbol, Nte = Lh(), Ite = Lh(), qTe = Lh(), YTe = Lh(), WTe = Lh(), $te = Lh(), GTe = Lh(), MD = Lh(), XTe = Lh(), HTe = (t) => { const e = []; let r = 0; for (; r < t.length; r++) { @@ -16465,25 +16465,25 @@ const fh = Symbol, ete = fh(), tte = fh(), eTe = fh(), tTe = fh(), rTe = fh(), r n.constructor === String || n.constructor === Number || n.constructor === Object && e.push(JSON.stringify(n)); } return e; -}, aTe = { - [ete]: ro("font-weight", "bold"), - [tte]: ro("font-weight", "normal"), - [eTe]: ro("color", "blue"), - [rTe]: ro("color", "green"), - [tTe]: ro("color", "grey"), - [rte]: ro("color", "red"), - [nTe]: ro("color", "purple"), - [nD]: ro("color", "orange"), - [iTe]: ro("color", "black") -}, oTe = (t) => { - const e = [], r = [], n = Cl(); +}, ZTe = { + [Nte]: xo("font-weight", "bold"), + [Ite]: xo("font-weight", "normal"), + [qTe]: xo("color", "blue"), + [WTe]: xo("color", "green"), + [YTe]: xo("color", "grey"), + [$te]: xo("color", "red"), + [GTe]: xo("color", "purple"), + [MD]: xo("color", "orange"), + [XTe]: xo("color", "black") +}, jTe = (t) => { + const e = [], r = [], n = ql(); let i = [], s = 0; for (; s < t.length; s++) { - const a = t[s], o = aTe[a]; + const a = t[s], o = ZTe[a]; if (o !== void 0) n.set(o.left, o.right); else if (a.constructor === String || a.constructor === Number) { - const l = JSe(n); + const l = VTe(n); s > 0 || l.length > 0 ? (e.push("%c" + a), r.push(l)) : e.push(a); } else break; @@ -16493,45 +16493,45 @@ const fh = Symbol, ete = fh(), tte = fh(), eTe = fh(), tTe = fh(), rTe = fh(), r a instanceof Symbol || i.push(a); } return i; -}, nte = NSe ? oTe : sTe, lTe = (...t) => { - console.log(...nte(t)), ite.forEach((e) => e.print(t)); -}, cTe = (...t) => { - console.warn(...nte(t)), t.unshift(nD), ite.forEach((e) => e.print(t)); -}, ite = h0(), ste = (t) => ({ +}, Bte = TTe ? jTe : HTe, KTe = (...t) => { + console.log(...Bte(t)), Fte.forEach((e) => e.print(t)); +}, JTe = (...t) => { + console.warn(...Bte(t)), t.unshift(MD), Fte.forEach((e) => e.print(t)); +}, Fte = L0(), zte = (t) => ({ [Symbol.iterator]() { return this; }, next: t -}), uTe = (t, e) => ste(() => { +}), eCe = (t, e) => zte(() => { let r; do r = t.next(); while (!r.done && !e(r.value)); return r; -}), d6 = (t, e) => ste(() => { +}), U_ = (t, e) => zte(() => { const { done: r, value: n } = t.next(); return { done: r, value: r ? void 0 : e(n) }; }); -class iD { +class DD { constructor(e, r) { this.clock = e, this.len = r; } } -class t1 { +class O1 { constructor() { this.clients = /* @__PURE__ */ new Map(); } } -const jg = (t, e, r) => e.clients.forEach((n, i) => { +const ym = (t, e, r) => e.clients.forEach((n, i) => { const s = t.doc.store.clients.get(i); for (let a = 0; a < n.length; a++) { const o = n[a]; - xte(t, s, o.clock, o.len, r); + tre(t, s, o.clock, o.len, r); } -}), hTe = (t, e) => { +}), tCe = (t, e) => { let r = 0, n = t.length - 1; for (; r <= n; ) { - const i = Gu((r + n) / 2), s = t[i], a = s.clock; + const i = hh((r + n) / 2), s = t[i], a = s.clock; if (a <= e) { if (e < a + s.len) return i; @@ -16540,35 +16540,35 @@ const jg = (t, e, r) => e.clients.forEach((n, i) => { n = i - 1; } return null; -}, bx = (t, e) => { +}, Vx = (t, e) => { const r = t.clients.get(e.client); - return r !== void 0 && hTe(r, e.clock) !== null; -}, sD = (t) => { + return r !== void 0 && tCe(r, e.clock) !== null; +}, PD = (t) => { t.clients.forEach((e) => { e.sort((i, s) => i.clock - s.clock); let r, n; for (r = 1, n = 1; r < e.length; r++) { const i = e[n - 1], s = e[r]; - i.clock + i.len >= s.clock ? i.len = Zf(i.len, s.clock + s.len - i.clock) : (n < r && (e[n] = s), n++); + i.clock + i.len >= s.clock ? i.len = pd(i.len, s.clock + s.len - i.clock) : (n < r && (e[n] = s), n++); } e.length = n; }); -}, u8 = (t) => { - const e = new t1(); +}, F8 = (t) => { + const e = new O1(); for (let r = 0; r < t.length; r++) t[r].clients.forEach((n, i) => { if (!e.clients.has(i)) { const s = n.slice(); for (let a = r + 1; a < t.length; a++) - z3e(s, t[a].clients.get(i) || []); + LSe(s, t[a].clients.get(i) || []); e.clients.set(i, s); } }); - return sD(e), e; -}, l2 = (t, e, r, n) => { - hh(t.clients, e, () => []).push(new iD(r, n)); -}, ate = () => new t1(), fTe = (t) => { - const e = ate(); + return PD(e), e; +}, M2 = (t, e, r, n) => { + Ah(t.clients, e, () => []).push(new DD(r, n)); +}, Qte = () => new O1(), rCe = (t) => { + const e = Qte(); return t.clients.forEach((r, n) => { const i = []; for (let s = 0; s < r.length; s++) { @@ -16579,63 +16579,63 @@ const jg = (t, e, r) => e.clients.forEach((n, i) => { if (s + 1 < r.length) for (let u = r[s + 1]; s + 1 < r.length && u.deleted; u = r[++s + 1]) l += u.length; - i.push(new iD(o, l)); + i.push(new DD(o, l)); } } i.length > 0 && e.clients.set(n, i); }), e; -}, r1 = (t, e) => { - Gt(t.restEncoder, e.clients.size), wf(e.clients.entries()).sort((r, n) => n[0] - r[0]).forEach(([r, n]) => { - t.resetDsCurVal(), Gt(t.restEncoder, r); +}, k1 = (t, e) => { + rr(t.restEncoder, e.clients.size), Ff(e.clients.entries()).sort((r, n) => n[0] - r[0]).forEach(([r, n]) => { + t.resetDsCurVal(), rr(t.restEncoder, r); const i = n.length; - Gt(t.restEncoder, i); + rr(t.restEncoder, i); for (let s = 0; s < i; s++) { const a = n[s]; t.writeDsClock(a.clock), t.writeDsLen(a.len); } }); -}, aD = (t) => { - const e = new t1(), r = lr(t.restDecoder); +}, ND = (t) => { + const e = new O1(), r = xr(t.restDecoder); for (let n = 0; n < r; n++) { t.resetDsCurVal(); - const i = lr(t.restDecoder), s = lr(t.restDecoder); + const i = xr(t.restDecoder), s = xr(t.restDecoder); if (s > 0) { - const a = hh(e.clients, i, () => []); + const a = Ah(e.clients, i, () => []); for (let o = 0; o < s; o++) - a.push(new iD(t.readDsClock(), t.readDsLen())); + a.push(new DD(t.readDsClock(), t.readDsLen())); } } return e; -}, Lz = (t, e, r) => { - const n = new t1(), i = lr(t.restDecoder); +}, hQ = (t, e, r) => { + const n = new O1(), i = xr(t.restDecoder); for (let s = 0; s < i; s++) { t.resetDsCurVal(); - const a = lr(t.restDecoder), o = lr(t.restDecoder), l = r.clients.get(a) || [], u = ri(r, a); + const a = xr(t.restDecoder), o = xr(t.restDecoder), l = r.clients.get(a) || [], u = gi(r, a); for (let h = 0; h < o; h++) { const f = t.readDsClock(), d = f + t.readDsLen(); if (f < u) { - u < d && l2(n, a, u, d - u); - let p = Qc(l, f), g = l[p]; - for (!g.deleted && g.id.clock < f && (l.splice(p + 1, 0, gk(e, g, f - g.id.clock)), p++); p < l.length && (g = l[p++], g.id.clock < d); ) - g.deleted || (d < g.id.clock + g.length && l.splice(p, 0, gk(e, g, d - g.id.clock)), g.delete(e)); + u < d && M2(n, a, u, d - u); + let p = au(l, f), g = l[p]; + for (!g.deleted && g.id.clock < f && (l.splice(p + 1, 0, Uk(e, g, f - g.id.clock)), p++); p < l.length && (g = l[p++], g.id.clock < d); ) + g.deleted || (d < g.id.clock + g.length && l.splice(p, 0, Uk(e, g, d - g.id.clock)), g.delete(e)); } else - l2(n, a, f, d - f); + M2(n, a, f, d - f); } } if (n.clients.size > 0) { - const s = new f0(); - return Gt(s.restEncoder, 0), r1(s, n), s.toUint8Array(); + const s = new R0(); + return rr(s.restEncoder, 0), k1(s, n), s.toUint8Array(); } return null; -}, ote = Gee; -class n1 extends yT { - constructor({ guid: e = bSe(), collectionid: r = null, gc: n = !0, gcFilter: i = () => !0, meta: s = null, autoLoad: a = !1, shouldLoad: o = !0 } = {}) { - super(), this.gc = n, this.gcFilter = i, this.clientID = ote(), this.guid = e, this.collectionid = r, this.share = /* @__PURE__ */ new Map(), this.store = new yte(), this._transaction = null, this._transactionCleanups = [], this.subdocs = /* @__PURE__ */ new Set(), this._item = null, this.shouldLoad = o, this.autoLoad = a, this.meta = s, this.isLoaded = !1, this.isSynced = !1, this.whenLoaded = Ez((u) => { +}, Ute = _te; +class S1 extends YT { + constructor({ guid: e = cTe(), collectionid: r = null, gc: n = !0, gcFilter: i = () => !0, meta: s = null, autoLoad: a = !1, shouldLoad: o = !0 } = {}) { + super(), this.gc = n, this.gcFilter = i, this.clientID = Ute(), this.guid = e, this.collectionid = r, this.share = /* @__PURE__ */ new Map(), this.store = new Jte(), this._transaction = null, this._transactionCleanups = [], this.subdocs = /* @__PURE__ */ new Set(), this._item = null, this.shouldLoad = o, this.autoLoad = a, this.meta = s, this.isLoaded = !1, this.isSynced = !1, this.whenLoaded = lQ((u) => { this.on("load", () => { this.isLoaded = !0, u(this); }); }); - const l = () => Ez((u) => { + const l = () => lQ((u) => { const h = (f) => { (f === void 0 || f === !0) && (this.off("sync", h), u()); }; @@ -16647,7 +16647,7 @@ class n1 extends yT { } load() { const e = this._item; - e !== null && !this.shouldLoad && nn(e.parent.doc, (r) => { + e !== null && !this.shouldLoad && gn(e.parent.doc, (r) => { r.subdocsLoaded.add(this); }, null, !0), this.shouldLoad = !0; } @@ -16655,18 +16655,18 @@ class n1 extends yT { return this.subdocs; } getSubdocGuids() { - return new Set(wf(this.subdocs).map((e) => e.guid)); + return new Set(Ff(this.subdocs).map((e) => e.guid)); } transact(e, r = null) { - return nn(this, e, r); + return gn(this, e, r); } - get(e, r = fs) { - const n = hh(this.share, e, () => { + get(e, r = Ts) { + const n = Ah(this.share, e, () => { const s = new r(); return s._integrate(this, null), s; }), i = n.constructor; - if (r !== fs && i !== r) - if (i === fs) { + if (r !== Ts && i !== r) + if (i === Ts) { const s = new r(); s._map = n._map, n._map.forEach((a) => { for (; a !== null; a = a.left) @@ -16680,16 +16680,16 @@ class n1 extends yT { return n; } getArray(e = "") { - return this.get(e, dg); + return this.get(e, Pg); } getText(e = "") { - return this.get(e, Jg); + return this.get(e, xm); } getMap(e = "") { - return this.get(e, Nu); + return this.get(e, Ju); } getXmlFragment(e = "") { - return this.get(e, d0); + return this.get(e, M0); } toJSON() { const e = {}; @@ -16698,12 +16698,12 @@ class n1 extends yT { }), e; } destroy() { - wf(this.subdocs).forEach((r) => r.destroy()); + Ff(this.subdocs).forEach((r) => r.destroy()); const e = this._item; if (e !== null) { this._item = null; const r = e.content; - r.doc = new n1({ guid: this.guid, ...r.opts, shouldLoad: !1 }), r.doc._item = e, nn(e.parent.doc, (n) => { + r.doc = new S1({ guid: this.guid, ...r.opts, shouldLoad: !1 }), r.doc._item = e, gn(e.parent.doc, (n) => { const i = r.doc; e.deleted || n.subdocsAdded.add(i), n.subdocsRemoved.add(this); }, null, !0); @@ -16717,58 +16717,58 @@ class n1 extends yT { super.off(e, r); } } -class lte { +class Vte { constructor(e) { this.restDecoder = e; } resetDsCurVal() { } readDsClock() { - return lr(this.restDecoder); + return xr(this.restDecoder); } readDsLen() { - return lr(this.restDecoder); + return xr(this.restDecoder); } } -class cte extends lte { +class qte extends Vte { readLeftID() { - return pr(lr(this.restDecoder), lr(this.restDecoder)); + return Tr(xr(this.restDecoder), xr(this.restDecoder)); } readRightID() { - return pr(lr(this.restDecoder), lr(this.restDecoder)); + return Tr(xr(this.restDecoder), xr(this.restDecoder)); } readClient() { - return lr(this.restDecoder); + return xr(this.restDecoder); } readInfo() { - return Hg(this.restDecoder); + return mm(this.restDecoder); } readString() { - return nf(this.restDecoder); + return Of(this.restDecoder); } readParentInfo() { - return lr(this.restDecoder) === 1; + return xr(this.restDecoder) === 1; } readTypeRef() { - return lr(this.restDecoder); + return xr(this.restDecoder); } readLen() { - return lr(this.restDecoder); + return xr(this.restDecoder); } readAny() { - return o2(this.restDecoder); + return R2(this.restDecoder); } readBuf() { - return qSe(Ls(this.restDecoder)); + return PTe(qs(this.restDecoder)); } readJSON() { - return JSON.parse(nf(this.restDecoder)); + return JSON.parse(Of(this.restDecoder)); } readKey() { - return nf(this.restDecoder); + return Of(this.restDecoder); } } -class dTe { +class nCe { constructor(e) { this.dsCurrVal = 0, this.restDecoder = e; } @@ -16776,22 +16776,22 @@ class dTe { this.dsCurrVal = 0; } readDsClock() { - return this.dsCurrVal += lr(this.restDecoder), this.dsCurrVal; + return this.dsCurrVal += xr(this.restDecoder), this.dsCurrVal; } readDsLen() { - const e = lr(this.restDecoder) + 1; + const e = xr(this.restDecoder) + 1; return this.dsCurrVal += e, e; } } -class Kg extends dTe { +class bm extends nCe { constructor(e) { - super(e), this.keys = [], lr(e), this.keyClockDecoder = new h6(Ls(e)), this.clientDecoder = new $4(Ls(e)), this.leftClockDecoder = new h6(Ls(e)), this.rightClockDecoder = new h6(Ls(e)), this.infoDecoder = new Cz(Ls(e), Hg), this.stringDecoder = new mSe(Ls(e)), this.parentInfoDecoder = new Cz(Ls(e), Hg), this.typeRefDecoder = new $4(Ls(e)), this.lenDecoder = new $4(Ls(e)); + super(e), this.keys = [], xr(e), this.keyClockDecoder = new z_(qs(e)), this.clientDecoder = new u5(qs(e)), this.leftClockDecoder = new z_(qs(e)), this.rightClockDecoder = new z_(qs(e)), this.infoDecoder = new oQ(qs(e), mm), this.stringDecoder = new aTe(qs(e)), this.parentInfoDecoder = new oQ(qs(e), mm), this.typeRefDecoder = new u5(qs(e)), this.lenDecoder = new u5(qs(e)); } readLeftID() { - return new fg(this.clientDecoder.read(), this.leftClockDecoder.read()); + return new Dg(this.clientDecoder.read(), this.leftClockDecoder.read()); } readRightID() { - return new fg(this.clientDecoder.read(), this.rightClockDecoder.read()); + return new Dg(this.clientDecoder.read(), this.rightClockDecoder.read()); } readClient() { return this.clientDecoder.read(); @@ -16812,13 +16812,13 @@ class Kg extends dTe { return this.lenDecoder.read(); } readAny() { - return o2(this.restDecoder); + return R2(this.restDecoder); } readBuf() { - return Ls(this.restDecoder); + return qs(this.restDecoder); } readJSON() { - return o2(this.restDecoder); + return R2(this.restDecoder); } readKey() { const e = this.keyClockDecoder.read(); @@ -16830,85 +16830,85 @@ class Kg extends dTe { } } } -class ute { +class Yte { constructor() { - this.restEncoder = Rs(); + this.restEncoder = Ys(); } toUint8Array() { - return Rn(this.restEncoder); + return Vn(this.restEncoder); } resetDsCurVal() { } writeDsClock(e) { - Gt(this.restEncoder, e); + rr(this.restEncoder, e); } writeDsLen(e) { - Gt(this.restEncoder, e); + rr(this.restEncoder, e); } } -class xx extends ute { +class qx extends Yte { writeLeftID(e) { - Gt(this.restEncoder, e.client), Gt(this.restEncoder, e.clock); + rr(this.restEncoder, e.client), rr(this.restEncoder, e.clock); } writeRightID(e) { - Gt(this.restEncoder, e.client), Gt(this.restEncoder, e.clock); + rr(this.restEncoder, e.client), rr(this.restEncoder, e.clock); } writeClient(e) { - Gt(this.restEncoder, e); + rr(this.restEncoder, e); } writeInfo(e) { - a8(this.restEncoder, e); + N8(this.restEncoder, e); } writeString(e) { - r0(this.restEncoder, e); + w0(this.restEncoder, e); } writeParentInfo(e) { - Gt(this.restEncoder, e ? 1 : 0); + rr(this.restEncoder, e ? 1 : 0); } writeTypeRef(e) { - Gt(this.restEncoder, e); + rr(this.restEncoder, e); } writeLen(e) { - Gt(this.restEncoder, e); + rr(this.restEncoder, e); } writeAny(e) { - a2(this.restEncoder, e); + L2(this.restEncoder, e); } writeBuf(e) { - Zn(this.restEncoder, e); + ci(this.restEncoder, e); } writeJSON(e) { - r0(this.restEncoder, JSON.stringify(e)); + w0(this.restEncoder, JSON.stringify(e)); } writeKey(e) { - r0(this.restEncoder, e); + w0(this.restEncoder, e); } } -class hte { +class Wte { constructor() { - this.restEncoder = Rs(), this.dsCurrVal = 0; + this.restEncoder = Ys(), this.dsCurrVal = 0; } toUint8Array() { - return Rn(this.restEncoder); + return Vn(this.restEncoder); } resetDsCurVal() { this.dsCurrVal = 0; } writeDsClock(e) { const r = e - this.dsCurrVal; - this.dsCurrVal = e, Gt(this.restEncoder, r); + this.dsCurrVal = e, rr(this.restEncoder, r); } writeDsLen(e) { - e === 0 && zl(), Gt(this.restEncoder, e - 1), this.dsCurrVal += e; + e === 0 && ic(), rr(this.restEncoder, e - 1), this.dsCurrVal += e; } } -class f0 extends hte { +class R0 extends Wte { constructor() { - super(), this.keyMap = /* @__PURE__ */ new Map(), this.keyClock = 0, this.keyClockEncoder = new u6(), this.clientEncoder = new I4(), this.leftClockEncoder = new u6(), this.rightClockEncoder = new u6(), this.infoEncoder = new kz(a8), this.stringEncoder = new oSe(), this.parentInfoEncoder = new kz(a8), this.typeRefEncoder = new I4(), this.lenEncoder = new I4(); + super(), this.keyMap = /* @__PURE__ */ new Map(), this.keyClock = 0, this.keyClockEncoder = new F_(), this.clientEncoder = new c5(), this.leftClockEncoder = new F_(), this.rightClockEncoder = new F_(), this.infoEncoder = new iQ(N8), this.stringEncoder = new jSe(), this.parentInfoEncoder = new iQ(N8), this.typeRefEncoder = new c5(), this.lenEncoder = new c5(); } toUint8Array() { - const e = Rs(); - return Gt(e, 0), Zn(e, this.keyClockEncoder.toUint8Array()), Zn(e, this.clientEncoder.toUint8Array()), Zn(e, this.leftClockEncoder.toUint8Array()), Zn(e, this.rightClockEncoder.toUint8Array()), Zn(e, Rn(this.infoEncoder)), Zn(e, this.stringEncoder.toUint8Array()), Zn(e, Rn(this.parentInfoEncoder)), Zn(e, this.typeRefEncoder.toUint8Array()), Zn(e, this.lenEncoder.toUint8Array()), wT(e, Rn(this.restEncoder)), Rn(e); + const e = Ys(); + return rr(e, 0), ci(e, this.keyClockEncoder.toUint8Array()), ci(e, this.clientEncoder.toUint8Array()), ci(e, this.leftClockEncoder.toUint8Array()), ci(e, this.rightClockEncoder.toUint8Array()), ci(e, Vn(this.infoEncoder)), ci(e, this.stringEncoder.toUint8Array()), ci(e, Vn(this.parentInfoEncoder)), ci(e, this.typeRefEncoder.toUint8Array()), ci(e, this.lenEncoder.toUint8Array()), XT(e, Vn(this.restEncoder)), Vn(e); } writeLeftID(e) { this.clientEncoder.write(e.client), this.leftClockEncoder.write(e.clock); @@ -16935,65 +16935,65 @@ class f0 extends hte { this.lenEncoder.write(e); } writeAny(e) { - a2(this.restEncoder, e); + L2(this.restEncoder, e); } writeBuf(e) { - Zn(this.restEncoder, e); + ci(this.restEncoder, e); } writeJSON(e) { - a2(this.restEncoder, e); + L2(this.restEncoder, e); } writeKey(e) { const r = this.keyMap.get(e); r === void 0 ? (this.keyClockEncoder.write(this.keyClock++), this.stringEncoder.write(e)) : this.keyClockEncoder.write(r); } } -const pTe = (t, e, r, n) => { - n = Zf(n, e[0].id.clock); - const i = Qc(e, n); - Gt(t.restEncoder, e.length - i), t.writeClient(r), Gt(t.restEncoder, n); +const iCe = (t, e, r, n) => { + n = pd(n, e[0].id.clock); + const i = au(e, n); + rr(t.restEncoder, e.length - i), t.writeClient(r), rr(t.restEncoder, n); const s = e[i]; s.write(t, n - s.id.clock); for (let a = i + 1; a < e.length; a++) e[a].write(t, 0); -}, oD = (t, e, r) => { +}, ID = (t, e, r) => { const n = /* @__PURE__ */ new Map(); r.forEach((i, s) => { - ri(e, s) > i && n.set(s, i); - }), kT(e).forEach((i, s) => { + gi(e, s) > i && n.set(s, i); + }), ZT(e).forEach((i, s) => { r.has(s) || n.set(s, 0); - }), Gt(t.restEncoder, n.size), wf(n.entries()).sort((i, s) => s[0] - i[0]).forEach(([i, s]) => { - pTe(t, e.clients.get(i), i, s); + }), rr(t.restEncoder, n.size), Ff(n.entries()).sort((i, s) => s[0] - i[0]).forEach(([i, s]) => { + iCe(t, e.clients.get(i), i, s); }); -}, gTe = (t, e) => { - const r = Cl(), n = lr(t.restDecoder); +}, sCe = (t, e) => { + const r = ql(), n = xr(t.restDecoder); for (let i = 0; i < n; i++) { - const s = lr(t.restDecoder), a = new Array(s), o = t.readClient(); - let l = lr(t.restDecoder); + const s = xr(t.restDecoder), a = new Array(s), o = t.readClient(); + let l = xr(t.restDecoder); r.set(o, { i: 0, refs: a }); for (let u = 0; u < s; u++) { const h = t.readInfo(); - switch (xT & h) { + switch (GT & h) { case 0: { const f = t.readLen(); - a[u] = new Do(pr(o, l), f), l += f; + a[u] = new Zo(Tr(o, l), f), l += f; break; } case 10: { - const f = lr(t.restDecoder); - a[u] = new Po(pr(o, l), f), l += f; + const f = xr(t.restDecoder); + a[u] = new jo(Tr(o, l), f), l += f; break; } default: { - const f = (h & (Pu | uo)) === 0, d = new sn( - pr(o, l), + const f = (h & (Ku | _o)) === 0, d = new mn( + Tr(o, l), null, - (h & uo) === uo ? t.readLeftID() : null, + (h & _o) === _o ? t.readLeftID() : null, null, - (h & Pu) === Pu ? t.readRightID() : null, + (h & Ku) === Ku ? t.readRightID() : null, f ? t.readParentInfo() ? e.get(t.readString()) : t.readLeftID() : null, - f && (h & i2) === i2 ? t.readString() : null, - zte(t, h) + f && (h & _2) === _2 ? t.readString() : null, + wre(t, h) ); a[u] = d, l += d.length; } @@ -17001,9 +17001,9 @@ const pTe = (t, e, r, n) => { } } return r; -}, mTe = (t, e, r) => { +}, aCe = (t, e, r) => { const n = []; - let i = wf(r.keys()).sort((p, g) => p - g); + let i = Ff(r.keys()).sort((p, g) => p - g); if (i.length === 0) return null; const s = () => { @@ -17020,7 +17020,7 @@ const pTe = (t, e, r, n) => { let a = s(); if (a === null) return null; - const o = new yte(), l = /* @__PURE__ */ new Map(), u = (p, g) => { + const o = new Jte(), l = /* @__PURE__ */ new Map(), u = (p, g) => { const m = l.get(p); (m == null || m > g) && l.set(p, g); }; @@ -17033,8 +17033,8 @@ const pTe = (t, e, r, n) => { n.length = 0; }; for (; ; ) { - if (h.constructor !== Po) { - const g = hh(f, h.id.client, () => ri(e, h.id.client)) - h.id.clock; + if (h.constructor !== jo) { + const g = Ah(f, h.id.client, () => gi(e, h.id.client)) - h.id.clock; if (g < 0) n.push(h), u(h.id.client, h.id.clock - 1), d(); else { @@ -17043,7 +17043,7 @@ const pTe = (t, e, r, n) => { n.push(h); const v = r.get(m) || { refs: [], i: 0 }; if (v.refs.length === v.i) - u(m, ri(e, m)), d(); + u(m, gi(e, m)), d(); else { h = v.refs[v.i++]; continue; @@ -17063,17 +17063,17 @@ const pTe = (t, e, r, n) => { } } if (o.clients.size > 0) { - const p = new f0(); - return oD(p, o, /* @__PURE__ */ new Map()), Gt(p.restEncoder, 0), { missing: l, update: p.toUint8Array() }; + const p = new R0(); + return ID(p, o, /* @__PURE__ */ new Map()), rr(p.restEncoder, 0), { missing: l, update: p.toUint8Array() }; } return null; -}, vTe = (t, e) => oD(t, e.doc.store, e.beforeState), yTe = (t, e, r, n = new Kg(t)) => nn(e, (i) => { +}, oCe = (t, e) => ID(t, e.doc.store, e.beforeState), lCe = (t, e, r, n = new bm(t)) => gn(e, (i) => { i.local = !1; let s = !1; - const a = i.doc, o = a.store, l = gTe(n, a), u = mTe(i, o, l), h = o.pendingStructs; + const a = i.doc, o = a.store, l = sCe(n, a), u = aCe(i, o, l), h = o.pendingStructs; if (h) { for (const [d, p] of h.missing) - if (p < ri(o, d)) { + if (p < gi(o, d)) { s = !0; break; } @@ -17082,68 +17082,68 @@ const pTe = (t, e, r, n) => { const g = h.missing.get(d); (g == null || g > p) && h.missing.set(d, p); } - h.update = ck([h.update, u.update]); + h.update = Ik([h.update, u.update]); } } else o.pendingStructs = u; - const f = Lz(n, i, o); + const f = hQ(n, i, o); if (o.pendingDs) { - const d = new Kg(jf(o.pendingDs)); - lr(d.restDecoder); - const p = Lz(d, i, o); - f && p ? o.pendingDs = ck([f, p]) : o.pendingDs = f || p; + const d = new bm(gd(o.pendingDs)); + xr(d.restDecoder); + const p = hQ(d, i, o); + f && p ? o.pendingDs = Ik([f, p]) : o.pendingDs = f || p; } else o.pendingDs = f; if (s) { const d = o.pendingStructs.update; - o.pendingStructs = null, fte(i.doc, d); - } -}, r, !1), fte = (t, e, r, n = Kg) => { - const i = jf(e); - yTe(i, t, r, new n(i)); -}, bTe = (t, e, r) => fte(t, e, r, cte), xTe = (t, e, r = /* @__PURE__ */ new Map()) => { - oD(t, e.store, r), r1(t, fTe(e.store)); -}, wTe = (t, e = new Uint8Array([0]), r = new f0()) => { - const n = dte(e); - xTe(r, t, n); + o.pendingStructs = null, Gte(i.doc, d); + } +}, r, !1), Gte = (t, e, r, n = bm) => { + const i = gd(e); + lCe(i, t, r, new n(i)); +}, cCe = (t, e, r) => Gte(t, e, r, qte), uCe = (t, e, r = /* @__PURE__ */ new Map()) => { + ID(t, e.store, r), k1(t, rCe(e.store)); +}, hCe = (t, e = new Uint8Array([0]), r = new R0()) => { + const n = Xte(e); + uCe(r, t, n); const i = [r.toUint8Array()]; - if (t.store.pendingDs && i.push(t.store.pendingDs), t.store.pendingStructs && i.push(QTe(t.store.pendingStructs.update, e)), i.length > 1) { - if (r.constructor === xx) - return FTe(i.map((s, a) => a === 0 ? s : VTe(s))); - if (r.constructor === f0) - return ck(i); + if (t.store.pendingDs && i.push(t.store.pendingDs), t.store.pendingStructs && i.push(RCe(t.store.pendingStructs.update, e)), i.length > 1) { + if (r.constructor === qx) + return ACe(i.map((s, a) => a === 0 ? s : DCe(s))); + if (r.constructor === R0) + return Ik(i); } return i[0]; -}, OTe = (t, e) => wTe(t, e, new xx()), kTe = (t) => { - const e = /* @__PURE__ */ new Map(), r = lr(t.restDecoder); +}, fCe = (t, e) => hCe(t, e, new qx()), dCe = (t) => { + const e = /* @__PURE__ */ new Map(), r = xr(t.restDecoder); for (let n = 0; n < r; n++) { - const i = lr(t.restDecoder), s = lr(t.restDecoder); + const i = xr(t.restDecoder), s = xr(t.restDecoder); e.set(i, s); } return e; -}, dte = (t) => kTe(new lte(jf(t))), pte = (t, e) => (Gt(t.restEncoder, e.size), wf(e.entries()).sort((r, n) => n[0] - r[0]).forEach(([r, n]) => { - Gt(t.restEncoder, r), Gt(t.restEncoder, n); -}), t), STe = (t, e) => pte(t, kT(e.store)), TTe = (t, e = new hte()) => (t instanceof Map ? pte(e, t) : STe(e, t), e.toUint8Array()), CTe = (t) => TTe(t, new ute()); -class ETe { +}, Xte = (t) => dCe(new Vte(gd(t))), Hte = (t, e) => (rr(t.restEncoder, e.size), Ff(e.entries()).sort((r, n) => n[0] - r[0]).forEach(([r, n]) => { + rr(t.restEncoder, r), rr(t.restEncoder, n); +}), t), pCe = (t, e) => Hte(t, ZT(e.store)), gCe = (t, e = new Wte()) => (t instanceof Map ? Hte(e, t) : pCe(e, t), e.toUint8Array()), mCe = (t) => gCe(t, new Yte()); +class vCe { constructor() { this.l = []; } } -const Rz = () => new ETe(), Mz = (t, e) => t.l.push(e), Dz = (t, e) => { +const fQ = () => new vCe(), dQ = (t, e) => t.l.push(e), pQ = (t, e) => { const r = t.l, n = r.length; t.l = r.filter((i) => e !== i), n === t.l.length && console.error("[yjs] Tried to remove event handler that doesn't exist."); -}, gte = (t, e, r) => rD(t.l, [e, r]); -class fg { +}, Zte = (t, e, r) => RD(t.l, [e, r]); +class Dg { constructor(e, r) { this.client = e, this.clock = r; } } -const Gp = (t, e) => t === e || t !== null && e !== null && t.client === e.client && t.clock === e.clock, pr = (t, e) => new fg(t, e), mte = (t) => { +const pg = (t, e) => t === e || t !== null && e !== null && t.client === e.client && t.clock === e.clock, Tr = (t, e) => new Dg(t, e), jte = (t) => { for (const [e, r] of t.doc.share.entries()) if (r === t) return e; - throw zl(); -}, lk = (t, e) => { + throw ic(); +}, Nk = (t, e) => { for (; e !== null; ) { if (e.parent === t) return !0; @@ -17151,49 +17151,49 @@ const Gp = (t, e) => t === e || t !== null && e !== null && t.client === e.clien } return !1; }; -class vte { +class Kte { constructor(e, r, n, i = 0) { this.type = e, this.tname = r, this.item = n, this.assoc = i; } } -const Pz = (t) => { +const gQ = (t) => { const e = {}; return t.type && (e.type = t.type), t.tname && (e.tname = t.tname), t.item && (e.item = t.item), t.assoc != null && (e.assoc = t.assoc), e; -}, c2 = (t) => new vte(t.type == null ? null : pr(t.type.client, t.type.clock), t.tname || null, t.item == null ? null : pr(t.item.client, t.item.clock), t.assoc == null ? 0 : t.assoc); -class _Te { +}, D2 = (t) => new Kte(t.type == null ? null : Tr(t.type.client, t.type.clock), t.tname || null, t.item == null ? null : Tr(t.item.client, t.item.clock), t.assoc == null ? 0 : t.assoc); +class yCe { constructor(e, r, n = 0) { this.type = e, this.index = r, this.assoc = n; } } -const ATe = (t, e, r = 0) => new _Te(t, e, r), eO = (t, e, r) => { +const bCe = (t, e, r = 0) => new yCe(t, e, r), EO = (t, e, r) => { let n = null, i = null; - return t._item === null ? i = mte(t) : n = pr(t._item.id.client, t._item.id.clock), new vte(n, i, e, r); -}, h8 = (t, e, r = 0) => { + return t._item === null ? i = jte(t) : n = Tr(t._item.id.client, t._item.id.clock), new Kte(n, i, e, r); +}, z8 = (t, e, r = 0) => { let n = t._start; if (r < 0) { if (e === 0) - return eO(t, null, r); + return EO(t, null, r); e--; } for (; n !== null; ) { if (!n.deleted && n.countable) { if (n.length > e) - return eO(t, pr(n.id.client, n.id.clock + e), r); + return EO(t, Tr(n.id.client, n.id.clock + e), r); e -= n.length; } if (n.right === null && r < 0) - return eO(t, n.lastId, r); + return EO(t, n.lastId, r); n = n.right; } - return eO(t, null, r); -}, f8 = (t, e) => { + return EO(t, null, r); +}, Q8 = (t, e) => { const r = e.store, n = t.item, i = t.type, s = t.tname, a = t.assoc; let o = null, l = 0; if (n !== null) { - if (ri(r, n.client) <= n.clock) + if (gi(r, n.client) <= n.clock) return null; - const u = m8(r, n), h = u.item; - if (!(h instanceof sn)) + const u = Y8(r, n), h = u.item; + if (!(h instanceof mn)) return null; if (o = h.parent, o._item === null || !o._item.deleted) { l = h.deleted || !h.countable ? 0 : u.diff + (a >= 0 ? 0 : 1); @@ -17205,65 +17205,65 @@ const ATe = (t, e, r = 0) => new _Te(t, e, r), eO = (t, e, r) => { if (s !== null) o = e.get(s); else if (i !== null) { - if (ri(r, i.client) <= i.clock) + if (gi(r, i.client) <= i.clock) return null; - const { item: u } = m8(r, i); - if (u instanceof sn && u.content instanceof Jc) + const { item: u } = Y8(r, i); + if (u instanceof mn && u.content instanceof vu) o = u.content.type; else return null; } else - throw zl(); + throw ic(); a >= 0 ? l = o._length : l = 0; } - return ATe(o, l, t.assoc); -}, Nz = (t, e) => t === e || t !== null && e !== null && t.tname === e.tname && Gp(t.item, e.item) && Gp(t.type, e.type) && t.assoc === e.assoc; -class LTe { + return bCe(o, l, t.assoc); +}, mQ = (t, e) => t === e || t !== null && e !== null && t.tname === e.tname && pg(t.item, e.item) && pg(t.type, e.type) && t.assoc === e.assoc; +class xCe { constructor(e, r) { this.ds = e, this.sv = r; } } -const RTe = (t, e) => new LTe(t, e); -RTe(ate(), /* @__PURE__ */ new Map()); -const Bp = (t, e) => e === void 0 ? !t.deleted : e.sv.has(t.id.client) && (e.sv.get(t.id.client) || 0) > t.id.clock && !bx(e.ds, t.id), d8 = (t, e) => { - const r = hh(t.meta, d8, h0), n = t.doc.store; +const wCe = (t, e) => new xCe(t, e); +wCe(Qte(), /* @__PURE__ */ new Map()); +const sg = (t, e) => e === void 0 ? !t.deleted : e.sv.has(t.id.client) && (e.sv.get(t.id.client) || 0) > t.id.clock && !Vx(e.ds, t.id), U8 = (t, e) => { + const r = Ah(t.meta, U8, L0), n = t.doc.store; r.has(e) || (e.sv.forEach((i, s) => { - i < ri(n, s) && Ra(t, pr(s, i)); - }), jg(t, e.ds, (i) => { + i < gi(n, s) && Ha(t, Tr(s, i)); + }), ym(t, e.ds, (i) => { }), r.add(e)); }; -class yte { +class Jte { constructor() { this.clients = /* @__PURE__ */ new Map(), this.pendingStructs = null, this.pendingDs = null; } } -const kT = (t) => { +const ZT = (t) => { const e = /* @__PURE__ */ new Map(); return t.clients.forEach((r, n) => { const i = r[r.length - 1]; e.set(n, i.id.clock + i.length); }), e; -}, ri = (t, e) => { +}, gi = (t, e) => { const r = t.clients.get(e); if (r === void 0) return 0; const n = r[r.length - 1]; return n.id.clock + n.length; -}, bte = (t, e) => { +}, ere = (t, e) => { let r = t.clients.get(e.id.client); if (r === void 0) r = [], t.clients.set(e.id.client, r); else { const n = r[r.length - 1]; if (n.id.clock + n.length !== e.id.clock) - throw zl(); + throw ic(); } r.push(e); -}, Qc = (t, e) => { +}, au = (t, e) => { let r = 0, n = t.length - 1, i = t[n], s = i.id.clock; if (s === e) return n; - let a = Gu(e / (s + i.length - 1) * n); + let a = hh(e / (s + i.length - 1) * n); for (; r <= n; ) { if (i = t[a], s = i.id.clock, s <= e) { if (e < s + i.length) @@ -17271,79 +17271,79 @@ const kT = (t) => { r = a + 1; } else n = a - 1; - a = Gu((r + n) / 2); + a = hh((r + n) / 2); } - throw zl(); -}, MTe = (t, e) => { + throw ic(); +}, OCe = (t, e) => { const r = t.clients.get(e.client); - return r[Qc(r, e.clock)]; -}, B4 = MTe, p8 = (t, e, r) => { - const n = Qc(e, r), i = e[n]; - return i.id.clock < r && i instanceof sn ? (e.splice(n + 1, 0, gk(t, i, r - i.id.clock)), n + 1) : n; -}, Ra = (t, e) => { + return r[au(r, e.clock)]; +}, h5 = OCe, V8 = (t, e, r) => { + const n = au(e, r), i = e[n]; + return i.id.clock < r && i instanceof mn ? (e.splice(n + 1, 0, Uk(t, i, r - i.id.clock)), n + 1) : n; +}, Ha = (t, e) => { const r = t.doc.store.clients.get(e.client); - return r[p8(t, r, e.clock)]; -}, Iz = (t, e, r) => { - const n = e.clients.get(r.client), i = Qc(n, r.clock), s = n[i]; - return r.clock !== s.id.clock + s.length - 1 && s.constructor !== Do && n.splice(i + 1, 0, gk(t, s, r.clock - s.id.clock + 1)), s; -}, DTe = (t, e, r) => { + return r[V8(t, r, e.clock)]; +}, vQ = (t, e, r) => { + const n = e.clients.get(r.client), i = au(n, r.clock), s = n[i]; + return r.clock !== s.id.clock + s.length - 1 && s.constructor !== Zo && n.splice(i + 1, 0, Uk(t, s, r.clock - s.id.clock + 1)), s; +}, kCe = (t, e, r) => { const n = t.clients.get(e.id.client); - n[Qc(n, e.id.clock)] = r; -}, xte = (t, e, r, n, i) => { + n[au(n, e.id.clock)] = r; +}, tre = (t, e, r, n, i) => { if (n === 0) return; const s = r + n; - let a = p8(t, e, r), o; + let a = V8(t, e, r), o; do - o = e[a++], s < o.id.clock + o.length && p8(t, e, s), i(o); + o = e[a++], s < o.id.clock + o.length && V8(t, e, s), i(o); while (a < e.length && e[a].id.clock < s); }; -class PTe { +class SCe { constructor(e, r, n) { - this.doc = e, this.deleteSet = new t1(), this.beforeState = kT(e.store), this.afterState = /* @__PURE__ */ new Map(), this.changed = /* @__PURE__ */ new Map(), this.changedParentTypes = /* @__PURE__ */ new Map(), this._mergeStructs = [], this.origin = r, this.meta = /* @__PURE__ */ new Map(), this.local = n, this.subdocsAdded = /* @__PURE__ */ new Set(), this.subdocsRemoved = /* @__PURE__ */ new Set(), this.subdocsLoaded = /* @__PURE__ */ new Set(), this._needFormattingCleanup = !1; + this.doc = e, this.deleteSet = new O1(), this.beforeState = ZT(e.store), this.afterState = /* @__PURE__ */ new Map(), this.changed = /* @__PURE__ */ new Map(), this.changedParentTypes = /* @__PURE__ */ new Map(), this._mergeStructs = [], this.origin = r, this.meta = /* @__PURE__ */ new Map(), this.local = n, this.subdocsAdded = /* @__PURE__ */ new Set(), this.subdocsRemoved = /* @__PURE__ */ new Set(), this.subdocsLoaded = /* @__PURE__ */ new Set(), this._needFormattingCleanup = !1; } } -const $z = (t, e) => e.deleteSet.clients.size === 0 && !F3e(e.afterState, (r, n) => e.beforeState.get(n) !== r) ? !1 : (sD(e.deleteSet), vTe(t, e), r1(t, e.deleteSet), !0), Bz = (t, e, r) => { +const yQ = (t, e) => e.deleteSet.clients.size === 0 && !ASe(e.afterState, (r, n) => e.beforeState.get(n) !== r) ? !1 : (PD(e.deleteSet), oCe(t, e), k1(t, e.deleteSet), !0), bQ = (t, e, r) => { const n = e._item; - (n === null || n.id.clock < (t.beforeState.get(n.id.client) || 0) && !n.deleted) && hh(t.changed, e, h0).add(r); -}, F4 = (t, e) => { + (n === null || n.id.clock < (t.beforeState.get(n.id.client) || 0) && !n.deleted) && Ah(t.changed, e, L0).add(r); +}, f5 = (t, e) => { let r = t[e], n = t[e - 1], i = e; for (; i > 0; r = n, n = t[--i - 1]) { if (n.deleted === r.deleted && n.constructor === r.constructor && n.mergeWith(r)) { - r instanceof sn && r.parentSub !== null && r.parent._map.get(r.parentSub) === r && r.parent._map.set(r.parentSub, n); + r instanceof mn && r.parentSub !== null && r.parent._map.get(r.parentSub) === r && r.parent._map.set(r.parentSub, n); continue; } break; } const s = e - i; return s && t.splice(e + 1 - s, s), s; -}, NTe = (t, e, r) => { +}, TCe = (t, e, r) => { for (const [n, i] of t.clients.entries()) { const s = e.clients.get(n); for (let a = i.length - 1; a >= 0; a--) { const o = i[a], l = o.clock + o.len; - for (let u = Qc(s, o.clock), h = s[u]; u < s.length && h.id.clock < l; h = s[++u]) { + for (let u = au(s, o.clock), h = s[u]; u < s.length && h.id.clock < l; h = s[++u]) { const f = s[u]; if (o.clock + o.len <= f.id.clock) break; - f instanceof sn && f.deleted && !f.keep && r(f) && f.gc(e, !1); + f instanceof mn && f.deleted && !f.keep && r(f) && f.gc(e, !1); } } } -}, ITe = (t, e) => { +}, CCe = (t, e) => { t.clients.forEach((r, n) => { const i = e.clients.get(n); for (let s = r.length - 1; s >= 0; s--) { - const a = r[s], o = bT(i.length - 1, 1 + Qc(i, a.clock + a.len - 1)); + const a = r[s], o = WT(i.length - 1, 1 + au(i, a.clock + a.len - 1)); for (let l = o, u = i[l]; l > 0 && u.id.clock >= a.clock; u = i[l]) - l -= 1 + F4(i, l); + l -= 1 + f5(i, l); } }); -}, wte = (t, e) => { +}, rre = (t, e) => { if (e < t.length) { const r = t[e], n = r.doc, i = n.store, s = r.deleteSet, a = r._mergeStructs; try { - sD(s), r.afterState = kT(r.doc.store), n.emit("beforeObserverCalls", [r, n]); + PD(s), r.afterState = ZT(r.doc.store), n.emit("beforeObserverCalls", [r, n]); const o = []; r.changed.forEach( (l, u) => o.push(() => { @@ -17355,78 +17355,78 @@ const $z = (t, e) => e.deleteSet.clients.size === 0 && !F3e(e.afterState, (r, n) (h) => h.target._item === null || !h.target._item.deleted ), l.forEach((h) => { h.currentTarget = u, h._path = null; - }), l.sort((h, f) => h.path.length - f.path.length), gte(u._dEH, l, r)); + }), l.sort((h, f) => h.path.length - f.path.length), Zte(u._dEH, l, r)); }); - }), o.push(() => n.emit("afterTransaction", [r, n])), rD(o, []), r._needFormattingCleanup && nCe(r); + }), o.push(() => n.emit("afterTransaction", [r, n])), RD(o, []), r._needFormattingCleanup && GCe(r); } finally { - n.gc && NTe(s, i, n.gcFilter), ITe(s, i), r.afterState.forEach((h, f) => { + n.gc && TCe(s, i, n.gcFilter), CCe(s, i), r.afterState.forEach((h, f) => { const d = r.beforeState.get(f) || 0; if (d !== h) { - const p = i.clients.get(f), g = Zf(Qc(p, d), 1); + const p = i.clients.get(f), g = pd(au(p, d), 1); for (let m = p.length - 1; m >= g; ) - m -= 1 + F4(p, m); + m -= 1 + f5(p, m); } }); for (let h = a.length - 1; h >= 0; h--) { - const { client: f, clock: d } = a[h].id, p = i.clients.get(f), g = Qc(p, d); - g + 1 < p.length && F4(p, g + 1) > 1 || g > 0 && F4(p, g); + const { client: f, clock: d } = a[h].id, p = i.clients.get(f), g = au(p, d); + g + 1 < p.length && f5(p, g + 1) > 1 || g > 0 && f5(p, g); } - if (!r.local && r.afterState.get(n.clientID) !== r.beforeState.get(n.clientID) && (lTe(nD, ete, "[yjs] ", tte, rte, "Changed the client-id because another client seems to be using it."), n.clientID = ote()), n.emit("afterTransactionCleanup", [r, n]), n._observers.has("update")) { - const h = new xx(); - $z(h, r) && n.emit("update", [h.toUint8Array(), r.origin, n, r]); + if (!r.local && r.afterState.get(n.clientID) !== r.beforeState.get(n.clientID) && (KTe(MD, Nte, "[yjs] ", Ite, $te, "Changed the client-id because another client seems to be using it."), n.clientID = Ute()), n.emit("afterTransactionCleanup", [r, n]), n._observers.has("update")) { + const h = new qx(); + yQ(h, r) && n.emit("update", [h.toUint8Array(), r.origin, n, r]); } if (n._observers.has("updateV2")) { - const h = new f0(); - $z(h, r) && n.emit("updateV2", [h.toUint8Array(), r.origin, n, r]); + const h = new R0(); + yQ(h, r) && n.emit("updateV2", [h.toUint8Array(), r.origin, n, r]); } const { subdocsAdded: o, subdocsLoaded: l, subdocsRemoved: u } = r; (o.size > 0 || u.size > 0 || l.size > 0) && (o.forEach((h) => { h.clientID = n.clientID, h.collectionid == null && (h.collectionid = n.collectionid), n.subdocs.add(h); - }), u.forEach((h) => n.subdocs.delete(h)), n.emit("subdocs", [{ loaded: l, added: o, removed: u }, n, r]), u.forEach((h) => h.destroy())), t.length <= e + 1 ? (n._transactionCleanups = [], n.emit("afterAllTransactions", [n, t])) : wte(t, e + 1); + }), u.forEach((h) => n.subdocs.delete(h)), n.emit("subdocs", [{ loaded: l, added: o, removed: u }, n, r]), u.forEach((h) => h.destroy())), t.length <= e + 1 ? (n._transactionCleanups = [], n.emit("afterAllTransactions", [n, t])) : rre(t, e + 1); } } -}, nn = (t, e, r = null, n = !0) => { +}, gn = (t, e, r = null, n = !0) => { const i = t._transactionCleanups; let s = !1, a = null; - t._transaction === null && (s = !0, t._transaction = new PTe(t, r, n), i.push(t._transaction), i.length === 1 && t.emit("beforeAllTransactions", [t]), t.emit("beforeTransaction", [t._transaction, t])); + t._transaction === null && (s = !0, t._transaction = new SCe(t, r, n), i.push(t._transaction), i.length === 1 && t.emit("beforeAllTransactions", [t]), t.emit("beforeTransaction", [t._transaction, t])); try { a = e(t._transaction); } finally { if (s) { const o = t._transaction === i[0]; - t._transaction = null, o && wte(i, 0); + t._transaction = null, o && rre(i, 0); } } return a; }; -class $Te { +class ECe { constructor(e, r) { this.insertions = r, this.deletions = e, this.meta = /* @__PURE__ */ new Map(); } } -const Fz = (t, e, r) => { - jg(t, r.deletions, (n) => { - n instanceof sn && e.scope.some((i) => lk(i, n)) && mD(n, !1); +const xQ = (t, e, r) => { + ym(t, r.deletions, (n) => { + n instanceof mn && e.scope.some((i) => Nk(i, n)) && YD(n, !1); }); -}, zz = (t, e, r) => { +}, wQ = (t, e, r) => { let n = null, i = null; const s = t.doc, a = t.scope; - if (nn(s, (o) => { + if (gn(s, (o) => { for (; e.length > 0 && n === null; ) { const l = s.store, u = e.pop(), h = /* @__PURE__ */ new Set(), f = []; let d = !1; - jg(o, u.insertions, (p) => { - if (p instanceof sn) { + ym(o, u.insertions, (p) => { + if (p instanceof mn) { if (p.redone !== null) { - let { item: g, diff: m } = m8(l, p.id); - m > 0 && (g = Ra(o, pr(g.id.client, g.id.clock + m))), p = g; + let { item: g, diff: m } = Y8(l, p.id); + m > 0 && (g = Ha(o, Tr(g.id.client, g.id.clock + m))), p = g; } - !p.deleted && a.some((g) => lk(g, p)) && f.push(p); + !p.deleted && a.some((g) => Nk(g, p)) && f.push(p); } - }), jg(o, u.deletions, (p) => { - p instanceof sn && a.some((g) => lk(g, p)) && !bx(u.insertions, p.id) && h.add(p); + }), ym(o, u.deletions, (p) => { + p instanceof mn && a.some((g) => Nk(g, p)) && !Vx(u.insertions, p.id) && h.add(p); }), h.forEach((p) => { - d = Fte(o, p, h, u.insertions, t.ignoreRemoteMapChanges, t) !== null || d; + d = xre(o, p, h, u.insertions, t.ignoreRemoteMapChanges, t) !== null || d; }); for (let p = f.length - 1; p >= 0; p--) { const g = f[p]; @@ -17443,34 +17443,34 @@ const Fz = (t, e, r) => { } return n; }; -class lD extends yT { +class $D extends YT { constructor(e, { captureTimeout: r = 500, captureTransaction: n = (l) => !0, deleteFilter: i = () => !0, trackedOrigins: s = /* @__PURE__ */ new Set([null]), ignoreRemoteMapChanges: a = !1, - doc: o = i8(e) ? e[0].doc : e.doc + doc: o = D8(e) ? e[0].doc : e.doc } = {}) { super(), this.scope = [], this.doc = o, this.addToScope(e), this.deleteFilter = i, s.add(this), this.trackedOrigins = s, this.captureTransaction = n, this.undoStack = [], this.redoStack = [], this.undoing = !1, this.redoing = !1, this.lastChange = 0, this.ignoreRemoteMapChanges = a, this.captureTimeout = r, this.afterTransactionHandler = (l) => { if (!this.captureTransaction(l) || !this.scope.some((v) => l.changedParentTypes.has(v)) || !this.trackedOrigins.has(l.origin) && (!l.origin || !this.trackedOrigins.has(l.origin.constructor))) return; const u = this.undoing, h = this.redoing, f = u ? this.redoStack : this.undoStack; u ? this.stopCapturing() : h || this.clear(!1, !0); - const d = new t1(); + const d = new O1(); l.afterState.forEach((v, y) => { const b = l.beforeState.get(y) || 0, w = v - b; - w > 0 && l2(d, y, b, w); + w > 0 && M2(d, y, b, w); }); - const p = kf(); + const p = Qf(); let g = !1; if (this.lastChange > 0 && p - this.lastChange < this.captureTimeout && f.length > 0 && !u && !h) { const v = f[f.length - 1]; - v.deletions = u8([v.deletions, l.deleteSet]), v.insertions = u8([v.insertions, d]); + v.deletions = F8([v.deletions, l.deleteSet]), v.insertions = F8([v.insertions, d]); } else - f.push(new $Te(l.deleteSet, d)), g = !0; - !u && !h && (this.lastChange = p), jg(l, l.deleteSet, (v) => { - v instanceof sn && this.scope.some((y) => lk(y, v)) && mD(v, !0); + f.push(new ECe(l.deleteSet, d)), g = !0; + !u && !h && (this.lastChange = p), ym(l, l.deleteSet, (v) => { + v instanceof mn && this.scope.some((y) => Nk(y, v)) && YD(v, !0); }); const m = [{ stackItem: f[f.length - 1], origin: l.origin, type: u ? "redo" : "undo", changedParentTypes: l.changedParentTypes }, this]; g ? this.emit("stack-item-added", m) : this.emit("stack-item-updated", m); @@ -17479,8 +17479,8 @@ class lD extends yT { }); } addToScope(e) { - e = i8(e) ? e : [e], e.forEach((r) => { - this.scope.every((n) => n !== r) && (r.doc !== this.doc && cTe("[yjs#509] Not same Y.Doc"), this.scope.push(r)); + e = D8(e) ? e : [e], e.forEach((r) => { + this.scope.every((n) => n !== r) && (r.doc !== this.doc && JTe("[yjs#509] Not same Y.Doc"), this.scope.push(r)); }); } addTrackedOrigin(e) { @@ -17491,7 +17491,7 @@ class lD extends yT { } clear(e = !0, r = !0) { (e && this.canUndo() || r && this.canRedo()) && this.doc.transact((n) => { - e && (this.undoStack.forEach((i) => Fz(n, this, i)), this.undoStack = []), r && (this.redoStack.forEach((i) => Fz(n, this, i)), this.redoStack = []), this.emit("stack-cleared", [{ undoStackCleared: e, redoStackCleared: r }]); + e && (this.undoStack.forEach((i) => xQ(n, this, i)), this.undoStack = []), r && (this.redoStack.forEach((i) => xQ(n, this, i)), this.redoStack = []), this.emit("stack-cleared", [{ undoStackCleared: e, redoStackCleared: r }]); }); } stopCapturing() { @@ -17501,7 +17501,7 @@ class lD extends yT { this.undoing = !0; let e; try { - e = zz(this, this.undoStack, "undo"); + e = wQ(this, this.undoStack, "undo"); } finally { this.undoing = !1; } @@ -17511,7 +17511,7 @@ class lD extends yT { this.redoing = !0; let e; try { - e = zz(this, this.redoStack, "redo"); + e = wQ(this, this.redoStack, "redo"); } finally { this.redoing = !1; } @@ -17527,64 +17527,64 @@ class lD extends yT { this.trackedOrigins.delete(this), this.doc.off("afterTransaction", this.afterTransactionHandler), super.destroy(); } } -function* BTe(t) { - const e = lr(t.restDecoder); +function* _Ce(t) { + const e = xr(t.restDecoder); for (let r = 0; r < e; r++) { - const n = lr(t.restDecoder), i = t.readClient(); - let s = lr(t.restDecoder); + const n = xr(t.restDecoder), i = t.readClient(); + let s = xr(t.restDecoder); for (let a = 0; a < n; a++) { const o = t.readInfo(); if (o === 10) { - const l = lr(t.restDecoder); - yield new Po(pr(i, s), l), s += l; - } else if ((xT & o) !== 0) { - const l = (o & (Pu | uo)) === 0, u = new sn( - pr(i, s), + const l = xr(t.restDecoder); + yield new jo(Tr(i, s), l), s += l; + } else if ((GT & o) !== 0) { + const l = (o & (Ku | _o)) === 0, u = new mn( + Tr(i, s), null, - (o & uo) === uo ? t.readLeftID() : null, + (o & _o) === _o ? t.readLeftID() : null, null, - (o & Pu) === Pu ? t.readRightID() : null, + (o & Ku) === Ku ? t.readRightID() : null, l ? t.readParentInfo() ? t.readString() : t.readLeftID() : null, - l && (o & i2) === i2 ? t.readString() : null, - zte(t, o) + l && (o & _2) === _2 ? t.readString() : null, + wre(t, o) ); yield u, s += u.length; } else { const l = t.readLen(); - yield new Do(pr(i, s), l), s += l; + yield new Zo(Tr(i, s), l), s += l; } } } } -class cD { +class BD { constructor(e, r) { - this.gen = BTe(e), this.curr = null, this.done = !1, this.filterSkips = r, this.next(); + this.gen = _Ce(e), this.curr = null, this.done = !1, this.filterSkips = r, this.next(); } next() { do this.curr = this.gen.next().value || null; - while (this.filterSkips && this.curr !== null && this.curr.constructor === Po); + while (this.filterSkips && this.curr !== null && this.curr.constructor === jo); return this.curr; } } -class uD { +class FD { constructor(e) { this.currClient = 0, this.startClock = 0, this.written = 0, this.encoder = e, this.clientStructs = []; } } -const FTe = (t) => ck(t, cte, xx), zTe = (t, e) => { - if (t.constructor === Do) { +const ACe = (t) => Ik(t, qte, qx), LCe = (t, e) => { + if (t.constructor === Zo) { const { client: r, clock: n } = t.id; - return new Do(pr(r, n + e), t.length - e); - } else if (t.constructor === Po) { + return new Zo(Tr(r, n + e), t.length - e); + } else if (t.constructor === jo) { const { client: r, clock: n } = t.id; - return new Po(pr(r, n + e), t.length - e); + return new jo(Tr(r, n + e), t.length - e); } else { const r = t, { client: n, clock: i } = r.id; - return new sn( - pr(n, i + e), + return new mn( + Tr(n, i + e), null, - pr(n, i + e - 1), + Tr(n, i + e - 1), null, r.rightOrigin, r.parent, @@ -17592,17 +17592,17 @@ const FTe = (t) => ck(t, cte, xx), zTe = (t, e) => { r.content.splice(e) ); } -}, ck = (t, e = Kg, r = f0) => { +}, Ik = (t, e = bm, r = R0) => { if (t.length === 1) return t[0]; - const n = t.map((h) => new e(jf(h))); - let i = n.map((h) => new cD(h, !0)), s = null; - const a = new r(), o = new uD(a); + const n = t.map((h) => new e(gd(h))); + let i = n.map((h) => new BD(h, !0)), s = null; + const a = new r(), o = new FD(a); for (; i = i.filter((d) => d.curr !== null), i.sort( (d, p) => { if (d.curr.id.client === p.curr.id.client) { const g = d.curr.id.clock - p.curr.id.clock; - return g === 0 ? d.curr.constructor === p.curr.constructor ? 0 : d.curr.constructor === Po ? 1 : -1 : g; + return g === 0 ? d.curr.constructor === p.curr.constructor ? 0 : d.curr.constructor === jo ? 1 : -1 : g; } else return p.curr.id.client - d.curr.id.client; } @@ -17615,79 +17615,79 @@ const FTe = (t) => ck(t, cte, xx), zTe = (t, e) => { if (d === null || d.id.client !== f || p && d.id.clock > s.struct.id.clock + s.struct.length) continue; if (f !== s.struct.id.client) - Ih(o, s.struct, s.offset), s = { struct: d, offset: 0 }, h.next(); + ef(o, s.struct, s.offset), s = { struct: d, offset: 0 }, h.next(); else if (s.struct.id.clock + s.struct.length < d.id.clock) - if (s.struct.constructor === Po) + if (s.struct.constructor === jo) s.struct.length = d.id.clock + d.length - s.struct.id.clock; else { - Ih(o, s.struct, s.offset); + ef(o, s.struct, s.offset); const g = d.id.clock - s.struct.id.clock - s.struct.length; - s = { struct: new Po(pr(f, s.struct.id.clock + s.struct.length), g), offset: 0 }; + s = { struct: new jo(Tr(f, s.struct.id.clock + s.struct.length), g), offset: 0 }; } else { const g = s.struct.id.clock + s.struct.length - d.id.clock; - g > 0 && (s.struct.constructor === Po ? s.struct.length -= g : d = zTe(d, g)), s.struct.mergeWith(d) || (Ih(o, s.struct, s.offset), s = { struct: d, offset: 0 }, h.next()); + g > 0 && (s.struct.constructor === jo ? s.struct.length -= g : d = LCe(d, g)), s.struct.mergeWith(d) || (ef(o, s.struct, s.offset), s = { struct: d, offset: 0 }, h.next()); } } else s = { struct: h.curr, offset: 0 }, h.next(); - for (let d = h.curr; d !== null && d.id.client === f && d.id.clock === s.struct.id.clock + s.struct.length && d.constructor !== Po; d = h.next()) - Ih(o, s.struct, s.offset), s = { struct: d, offset: 0 }; - } - s !== null && (Ih(o, s.struct, s.offset), s = null), hD(o); - const l = n.map((h) => aD(h)), u = u8(l); - return r1(a, u), a.toUint8Array(); -}, QTe = (t, e, r = Kg, n = f0) => { - const i = dte(e), s = new n(), a = new uD(s), o = new r(jf(t)), l = new cD(o, !1); + for (let d = h.curr; d !== null && d.id.client === f && d.id.clock === s.struct.id.clock + s.struct.length && d.constructor !== jo; d = h.next()) + ef(o, s.struct, s.offset), s = { struct: d, offset: 0 }; + } + s !== null && (ef(o, s.struct, s.offset), s = null), zD(o); + const l = n.map((h) => ND(h)), u = F8(l); + return k1(a, u), a.toUint8Array(); +}, RCe = (t, e, r = bm, n = R0) => { + const i = Xte(e), s = new n(), a = new FD(s), o = new r(gd(t)), l = new BD(o, !1); for (; l.curr; ) { const h = l.curr, f = h.id.client, d = i.get(f) || 0; - if (l.curr.constructor === Po) { + if (l.curr.constructor === jo) { l.next(); continue; } if (h.id.clock + h.length > d) - for (Ih(a, h, Zf(d - h.id.clock, 0)), l.next(); l.curr && l.curr.id.client === f; ) - Ih(a, l.curr, 0), l.next(); + for (ef(a, h, pd(d - h.id.clock, 0)), l.next(); l.curr && l.curr.id.client === f; ) + ef(a, l.curr, 0), l.next(); else for (; l.curr && l.curr.id.client === f && l.curr.id.clock + l.curr.length <= d; ) l.next(); } - hD(a); - const u = aD(o); - return r1(s, u), s.toUint8Array(); -}, Ote = (t) => { - t.written > 0 && (t.clientStructs.push({ written: t.written, restEncoder: Rn(t.encoder.restEncoder) }), t.encoder.restEncoder = Rs(), t.written = 0); -}, Ih = (t, e, r) => { - t.written > 0 && t.currClient !== e.id.client && Ote(t), t.written === 0 && (t.currClient = e.id.client, t.encoder.writeClient(e.id.client), Gt(t.encoder.restEncoder, e.id.clock + r)), e.write(t.encoder, r), t.written++; -}, hD = (t) => { - Ote(t); + zD(a); + const u = ND(o); + return k1(s, u), s.toUint8Array(); +}, nre = (t) => { + t.written > 0 && (t.clientStructs.push({ written: t.written, restEncoder: Vn(t.encoder.restEncoder) }), t.encoder.restEncoder = Ys(), t.written = 0); +}, ef = (t, e, r) => { + t.written > 0 && t.currClient !== e.id.client && nre(t), t.written === 0 && (t.currClient = e.id.client, t.encoder.writeClient(e.id.client), rr(t.encoder.restEncoder, e.id.clock + r)), e.write(t.encoder, r), t.written++; +}, zD = (t) => { + nre(t); const e = t.encoder.restEncoder; - Gt(e, t.clientStructs.length); + rr(e, t.clientStructs.length); for (let r = 0; r < t.clientStructs.length; r++) { const n = t.clientStructs[r]; - Gt(e, n.written), wT(e, n.restEncoder); + rr(e, n.written), XT(e, n.restEncoder); } -}, UTe = (t, e, r, n) => { - const i = new r(jf(t)), s = new cD(i, !1), a = new n(), o = new uD(a); +}, MCe = (t, e, r, n) => { + const i = new r(gd(t)), s = new BD(i, !1), a = new n(), o = new FD(a); for (let u = s.curr; u !== null; u = s.next()) - Ih(o, e(u), 0); - hD(o); - const l = aD(i); - return r1(a, l), a.toUint8Array(); -}, VTe = (t) => UTe(t, LSe, Kg, xx), Qz = "You must not compute changes after the event-handler fired."; -class ST { + ef(o, e(u), 0); + zD(o); + const l = ND(i); + return k1(a, l), a.toUint8Array(); +}, DCe = (t) => MCe(t, xTe, bm, qx), OQ = "You must not compute changes after the event-handler fired."; +class jT { constructor(e, r) { this.target = e, this.currentTarget = e, this.transaction = r, this._changes = null, this._keys = null, this._delta = null, this._path = null; } get path() { - return this._path || (this._path = qTe(this.currentTarget, this.target)); + return this._path || (this._path = PCe(this.currentTarget, this.target)); } deletes(e) { - return bx(this.transaction.deleteSet, e.id); + return Vx(this.transaction.deleteSet, e.id); } get keys() { if (this._keys === null) { if (this.transaction.doc._transactionCleanups.length === 0) - throw Of(Qz); + throw zf(OQ); const e = /* @__PURE__ */ new Map(), r = this.target; this.transaction.changed.get(r).forEach((i) => { if (i !== null) { @@ -17699,13 +17699,13 @@ class ST { l = l.left; if (this.deletes(s)) if (l !== null && this.deletes(l)) - a = "delete", o = o6(l.content.getContent()); + a = "delete", o = I_(l.content.getContent()); else return; else - l !== null && this.deletes(l) ? (a = "update", o = o6(l.content.getContent())) : (a = "add", o = void 0); + l !== null && this.deletes(l) ? (a = "update", o = I_(l.content.getContent())) : (a = "add", o = void 0); } else if (this.deletes(s)) - a = "delete", o = o6(s.content.getContent()); + a = "delete", o = I_(s.content.getContent()); else return; e.set(i, { action: a, oldValue: o }); @@ -17724,8 +17724,8 @@ class ST { let e = this._changes; if (e === null) { if (this.transaction.doc._transactionCleanups.length === 0) - throw Of(Qz); - const r = this.target, n = h0(), i = h0(), s = []; + throw zf(OQ); + const r = this.target, n = L0(), i = L0(), s = []; if (e = { added: n, deleted: i, @@ -17745,7 +17745,7 @@ class ST { return e; } } -const qTe = (t, e) => { +const PCe = (t, e) => { const r = []; for (; e._item !== null && e !== t; ) { if (e._item.parentSub !== null) @@ -17759,31 +17759,31 @@ const qTe = (t, e) => { e = e._item.parent; } return r; -}, kte = 80; -let fD = 0; -class YTe { +}, ire = 80; +let QD = 0; +class NCe { constructor(e, r) { - e.marker = !0, this.p = e, this.index = r, this.timestamp = fD++; + e.marker = !0, this.p = e, this.index = r, this.timestamp = QD++; } } -const WTe = (t) => { - t.timestamp = fD++; -}, Ste = (t, e, r) => { - t.p.marker = !1, t.p = e, e.marker = !0, t.index = r, t.timestamp = fD++; -}, GTe = (t, e, r) => { - if (t.length >= kte) { +const ICe = (t) => { + t.timestamp = QD++; +}, sre = (t, e, r) => { + t.p.marker = !1, t.p = e, e.marker = !0, t.index = r, t.timestamp = QD++; +}, $Ce = (t, e, r) => { + if (t.length >= ire) { const n = t.reduce((i, s) => i.timestamp < s.timestamp ? i : s); - return Ste(n, e, r), n; + return sre(n, e, r), n; } else { - const n = new YTe(e, r); + const n = new NCe(e, r); return t.push(n), n; } -}, TT = (t, e) => { +}, KT = (t, e) => { if (t._start === null || e === 0 || t._searchMarker === null) return null; - const r = t._searchMarker.length === 0 ? null : t._searchMarker.reduce((s, a) => N4(e - s.index) < N4(e - a.index) ? s : a); + const r = t._searchMarker.length === 0 ? null : t._searchMarker.reduce((s, a) => l5(e - s.index) < l5(e - a.index) ? s : a); let n = t._start, i = 0; - for (r !== null && (n = r.p, i = r.index, WTe(r)); n.right !== null && i < e; ) { + for (r !== null && (n = r.p, i = r.index, ICe(r)); n.right !== null && i < e; ) { if (!n.deleted && n.countable) { if (e < i + n.length) break; @@ -17795,8 +17795,8 @@ const WTe = (t) => { n = n.left, !n.deleted && n.countable && (i -= n.length); for (; n.left !== null && n.left.id.client === n.id.client && n.left.id.clock + n.left.length === n.id.clock; ) n = n.left, !n.deleted && n.countable && (i -= n.length); - return r !== null && N4(r.index - i) < n.parent.length / kte ? (Ste(r, n, i), r) : GTe(t._searchMarker, n, i); -}, u2 = (t, e, r) => { + return r !== null && l5(r.index - i) < n.parent.length / ire ? (sre(r, n, i), r) : $Ce(t._searchMarker, n, i); +}, P2 = (t, e, r) => { for (let n = t.length - 1; n >= 0; n--) { const i = t[n]; if (r > 0) { @@ -17809,17 +17809,17 @@ const WTe = (t) => { } i.p = s, s.marker = !0; } - (e < i.index || r > 0 && e === i.index) && (i.index = Zf(e, i.index + r)); + (e < i.index || r > 0 && e === i.index) && (i.index = pd(e, i.index + r)); } -}, CT = (t, e, r) => { +}, JT = (t, e, r) => { const n = t, i = e.changedParentTypes; - for (; hh(i, t, () => []).push(r), t._item !== null; ) + for (; Ah(i, t, () => []).push(r), t._item !== null; ) t = t._item.parent; - gte(n._eH, r, e); + Zte(n._eH, r, e); }; -class fs { +class Ts { constructor() { - this._item = null, this._map = /* @__PURE__ */ new Map(), this._start = null, this.doc = null, this._length = 0, this._eH = Rz(), this._dEH = Rz(), this._searchMarker = null; + this._item = null, this._map = /* @__PURE__ */ new Map(), this._start = null, this.doc = null, this._length = 0, this._eH = fQ(), this._dEH = fQ(), this._searchMarker = null; } get parent() { return this._item ? this._item.parent : null; @@ -17828,10 +17828,10 @@ class fs { this.doc = e, this._item = r; } _copy() { - throw Pc(); + throw Jc(); } clone() { - throw Pc(); + throw Jc(); } _write(e) { } @@ -17845,21 +17845,21 @@ class fs { !e.local && this._searchMarker && (this._searchMarker.length = 0); } observe(e) { - Mz(this._eH, e); + dQ(this._eH, e); } observeDeep(e) { - Mz(this._dEH, e); + dQ(this._dEH, e); } unobserve(e) { - Dz(this._eH, e); + pQ(this._eH, e); } unobserveDeep(e) { - Dz(this._dEH, e); + pQ(this._dEH, e); } toJSON() { } } -const Tte = (t, e, r) => { +const are = (t, e, r) => { e < 0 && (e = t._length + e), r < 0 && (r = t._length + r); let n = r - e; const i = []; @@ -17878,7 +17878,7 @@ const Tte = (t, e, r) => { s = s.right; } return i; -}, Cte = (t) => { +}, ore = (t) => { const e = []; let r = t._start; for (; r !== null; ) { @@ -17890,7 +17890,7 @@ const Tte = (t, e, r) => { r = r.right; } return e; -}, h2 = (t, e) => { +}, N2 = (t, e) => { let r = 0, n = t._start; for (; n !== null; ) { if (n.countable && !n.deleted) { @@ -17900,12 +17900,12 @@ const Tte = (t, e, r) => { } n = n.right; } -}, Ete = (t, e) => { +}, lre = (t, e) => { const r = []; - return h2(t, (n, i) => { + return N2(t, (n, i) => { r.push(e(n, i, t)); }), r; -}, XTe = (t) => { +}, BCe = (t) => { let e = t._start, r = null, n = 0; return { [Symbol.iterator]() { @@ -17929,8 +17929,8 @@ const Tte = (t, e, r) => { }; } }; -}, _te = (t, e) => { - const r = TT(t, e); +}, cre = (t, e) => { + const r = KT(t, e); let n = t._start; for (r !== null && (n = r.p, e -= r.index); n !== null; n = n.right) if (!n.deleted && n.countable) { @@ -17938,12 +17938,12 @@ const Tte = (t, e, r) => { return n.content.getContent()[e]; e -= n.length; } -}, uk = (t, e, r, n) => { +}, $k = (t, e, r, n) => { let i = r; const s = t.doc, a = s.clientID, o = s.store, l = r === null ? e._start : r.right; let u = []; const h = () => { - u.length > 0 && (i = new sn(pr(a, ri(o, a)), i, i && i.lastId, l, l && l.id, e, null, new p0(u)), i.integrate(t, 0), u = []); + u.length > 0 && (i = new mn(Tr(a, gi(o, a)), i, i && i.lastId, l, l && l.id, e, null, new D0(u)), i.integrate(t, 0), u = []); }; n.forEach((f) => { if (f === null) @@ -17961,61 +17961,61 @@ const Tte = (t, e, r) => { switch (h(), f.constructor) { case Uint8Array: case ArrayBuffer: - i = new sn(pr(a, ri(o, a)), i, i && i.lastId, l, l && l.id, e, null, new wx(new Uint8Array(f))), i.integrate(t, 0); + i = new mn(Tr(a, gi(o, a)), i, i && i.lastId, l, l && l.id, e, null, new Yx(new Uint8Array(f))), i.integrate(t, 0); break; - case n1: - i = new sn(pr(a, ri(o, a)), i, i && i.lastId, l, l && l.id, e, null, new Ox(f)), i.integrate(t, 0); + case S1: + i = new mn(Tr(a, gi(o, a)), i, i && i.lastId, l, l && l.id, e, null, new Wx(f)), i.integrate(t, 0); break; default: - if (f instanceof fs) - i = new sn(pr(a, ri(o, a)), i, i && i.lastId, l, l && l.id, e, null, new Jc(f)), i.integrate(t, 0); + if (f instanceof Ts) + i = new mn(Tr(a, gi(o, a)), i, i && i.lastId, l, l && l.id, e, null, new vu(f)), i.integrate(t, 0); else throw new Error("Unexpected content type in insert operation"); } } }), h(); -}, Ate = () => Of("Length exceeded!"), Lte = (t, e, r, n) => { +}, ure = () => zf("Length exceeded!"), hre = (t, e, r, n) => { if (r > e._length) - throw Ate(); + throw ure(); if (r === 0) - return e._searchMarker && u2(e._searchMarker, r, n.length), uk(t, e, null, n); - const i = r, s = TT(e, r); + return e._searchMarker && P2(e._searchMarker, r, n.length), $k(t, e, null, n); + const i = r, s = KT(e, r); let a = e._start; for (s !== null && (a = s.p, r -= s.index, r === 0 && (a = a.prev, r += a && a.countable && !a.deleted ? a.length : 0)); a !== null; a = a.right) if (!a.deleted && a.countable) { if (r <= a.length) { - r < a.length && Ra(t, pr(a.id.client, a.id.clock + r)); + r < a.length && Ha(t, Tr(a.id.client, a.id.clock + r)); break; } r -= a.length; } - return e._searchMarker && u2(e._searchMarker, i, n.length), uk(t, e, a, n); -}, HTe = (t, e, r) => { + return e._searchMarker && P2(e._searchMarker, i, n.length), $k(t, e, a, n); +}, FCe = (t, e, r) => { let i = (e._searchMarker || []).reduce((s, a) => a.index > s.index ? a : s, { index: 0, p: e._start }).p; if (i) for (; i.right; ) i = i.right; - return uk(t, e, i, r); -}, Rte = (t, e, r, n) => { + return $k(t, e, i, r); +}, fre = (t, e, r, n) => { if (n === 0) return; - const i = r, s = n, a = TT(e, r); + const i = r, s = n, a = KT(e, r); let o = e._start; for (a !== null && (o = a.p, r -= a.index); o !== null && r > 0; o = o.right) - !o.deleted && o.countable && (r < o.length && Ra(t, pr(o.id.client, o.id.clock + r)), r -= o.length); + !o.deleted && o.countable && (r < o.length && Ha(t, Tr(o.id.client, o.id.clock + r)), r -= o.length); for (; n > 0 && o !== null; ) - o.deleted || (n < o.length && Ra(t, pr(o.id.client, o.id.clock + n)), o.delete(t), n -= o.length), o = o.right; + o.deleted || (n < o.length && Ha(t, Tr(o.id.client, o.id.clock + n)), o.delete(t), n -= o.length), o = o.right; if (n > 0) - throw Ate(); - e._searchMarker && u2(e._searchMarker, i, -s + n); -}, hk = (t, e, r) => { + throw ure(); + e._searchMarker && P2(e._searchMarker, i, -s + n); +}, Bk = (t, e, r) => { const n = e._map.get(r); n !== void 0 && n.delete(t); -}, dD = (t, e, r, n) => { +}, UD = (t, e, r, n) => { const i = e._map.get(r) || null, s = t.doc, a = s.clientID; let o; if (n == null) - o = new p0([n]); + o = new D0([n]); else switch (n.constructor) { case Number: @@ -18023,122 +18023,122 @@ const Tte = (t, e, r) => { case Boolean: case Array: case String: - o = new p0([n]); + o = new D0([n]); break; case Uint8Array: - o = new wx(n); + o = new Yx(n); break; - case n1: - o = new Ox(n); + case S1: + o = new Wx(n); break; default: - if (n instanceof fs) - o = new Jc(n); + if (n instanceof Ts) + o = new vu(n); else throw new Error("Unexpected content type"); } - new sn(pr(a, ri(s.store, a)), i, i && i.lastId, null, null, e, r, o).integrate(t, 0); -}, pD = (t, e) => { + new mn(Tr(a, gi(s.store, a)), i, i && i.lastId, null, null, e, r, o).integrate(t, 0); +}, VD = (t, e) => { const r = t._map.get(e); return r !== void 0 && !r.deleted ? r.content.getContent()[r.length - 1] : void 0; -}, Mte = (t) => { +}, dre = (t) => { const e = {}; return t._map.forEach((r, n) => { r.deleted || (e[n] = r.content.getContent()[r.length - 1]); }), e; -}, Dte = (t, e) => { +}, pre = (t, e) => { const r = t._map.get(e); return r !== void 0 && !r.deleted; -}, ZTe = (t, e) => { +}, zCe = (t, e) => { const r = {}; return t._map.forEach((n, i) => { let s = n; for (; s !== null && (!e.sv.has(s.id.client) || s.id.clock >= (e.sv.get(s.id.client) || 0)); ) s = s.left; - s !== null && Bp(s, e) && (r[i] = s.content.getContent()[s.length - 1]); + s !== null && sg(s, e) && (r[i] = s.content.getContent()[s.length - 1]); }), r; -}, tO = (t) => uTe(t.entries(), (e) => !e[1].deleted); -class jTe extends ST { +}, _O = (t) => eCe(t.entries(), (e) => !e[1].deleted); +class QCe extends jT { constructor(e, r) { super(e, r), this._transaction = r; } } -class dg extends fs { +class Pg extends Ts { constructor() { super(), this._prelimContent = [], this._searchMarker = []; } static from(e) { - const r = new dg(); + const r = new Pg(); return r.push(e), r; } _integrate(e, r) { super._integrate(e, r), this.insert(0, this._prelimContent), this._prelimContent = null; } _copy() { - return new dg(); + return new Pg(); } clone() { - const e = new dg(); + const e = new Pg(); return e.insert(0, this.toArray().map( - (r) => r instanceof fs ? r.clone() : r + (r) => r instanceof Ts ? r.clone() : r )), e; } get length() { return this._prelimContent === null ? this._length : this._prelimContent.length; } _callObserver(e, r) { - super._callObserver(e, r), CT(this, e, new jTe(this, e)); + super._callObserver(e, r), JT(this, e, new QCe(this, e)); } insert(e, r) { - this.doc !== null ? nn(this.doc, (n) => { - Lte(n, this, e, r); + this.doc !== null ? gn(this.doc, (n) => { + hre(n, this, e, r); }) : this._prelimContent.splice(e, 0, ...r); } push(e) { - this.doc !== null ? nn(this.doc, (r) => { - HTe(r, this, e); + this.doc !== null ? gn(this.doc, (r) => { + FCe(r, this, e); }) : this._prelimContent.push(...e); } unshift(e) { this.insert(0, e); } delete(e, r = 1) { - this.doc !== null ? nn(this.doc, (n) => { - Rte(n, this, e, r); + this.doc !== null ? gn(this.doc, (n) => { + fre(n, this, e, r); }) : this._prelimContent.splice(e, r); } get(e) { - return _te(this, e); + return cre(this, e); } toArray() { - return Cte(this); + return ore(this); } slice(e = 0, r = this.length) { - return Tte(this, e, r); + return are(this, e, r); } toJSON() { - return this.map((e) => e instanceof fs ? e.toJSON() : e); + return this.map((e) => e instanceof Ts ? e.toJSON() : e); } map(e) { - return Ete(this, e); + return lre(this, e); } forEach(e) { - h2(this, e); + N2(this, e); } [Symbol.iterator]() { - return XTe(this); + return BCe(this); } _write(e) { - e.writeTypeRef(wCe); + e.writeTypeRef(hEe); } } -const KTe = (t) => new dg(); -class JTe extends ST { +const UCe = (t) => new Pg(); +class VCe extends jT { constructor(e, r, n) { super(e, r), this.keysChanged = n; } } -class Nu extends fs { +class Ju extends Ts { constructor(e) { super(), this._prelimContent = null, e === void 0 ? this._prelimContent = /* @__PURE__ */ new Map() : this._prelimContent = new Map(e); } @@ -18148,37 +18148,37 @@ class Nu extends fs { }), this._prelimContent = null; } _copy() { - return new Nu(); + return new Ju(); } clone() { - const e = new Nu(); + const e = new Ju(); return this.forEach((r, n) => { - e.set(n, r instanceof fs ? r.clone() : r); + e.set(n, r instanceof Ts ? r.clone() : r); }), e; } _callObserver(e, r) { - CT(this, e, new JTe(this, e, r)); + JT(this, e, new VCe(this, e, r)); } toJSON() { const e = {}; return this._map.forEach((r, n) => { if (!r.deleted) { const i = r.content.getContent()[r.length - 1]; - e[n] = i instanceof fs ? i.toJSON() : i; + e[n] = i instanceof Ts ? i.toJSON() : i; } }), e; } get size() { - return [...tO(this._map)].length; + return [..._O(this._map)].length; } keys() { - return d6(tO(this._map), (e) => e[0]); + return U_(_O(this._map), (e) => e[0]); } values() { - return d6(tO(this._map), (e) => e[1].content.getContent()[e[1].length - 1]); + return U_(_O(this._map), (e) => e[1].content.getContent()[e[1].length - 1]); } entries() { - return d6(tO(this._map), (e) => [e[0], e[1].content.getContent()[e[1].length - 1]]); + return U_(_O(this._map), (e) => [e[0], e[1].content.getContent()[e[1].length - 1]]); } forEach(e) { this._map.forEach((r, n) => { @@ -18189,41 +18189,41 @@ class Nu extends fs { return this.entries(); } delete(e) { - this.doc !== null ? nn(this.doc, (r) => { - hk(r, this, e); + this.doc !== null ? gn(this.doc, (r) => { + Bk(r, this, e); }) : this._prelimContent.delete(e); } set(e, r) { - return this.doc !== null ? nn(this.doc, (n) => { - dD(n, this, e, r); + return this.doc !== null ? gn(this.doc, (n) => { + UD(n, this, e, r); }) : this._prelimContent.set(e, r), r; } get(e) { - return pD(this, e); + return VD(this, e); } has(e) { - return Dte(this, e); + return pre(this, e); } clear() { - this.doc !== null ? nn(this.doc, (e) => { + this.doc !== null ? gn(this.doc, (e) => { this.forEach(function(r, n, i) { - hk(e, i, n); + Bk(e, i, n); }); }) : this._prelimContent.clear(); } _write(e) { - e.writeTypeRef(OCe); + e.writeTypeRef(fEe); } } -const eCe = (t) => new Nu(), Yh = (t, e) => t === e || typeof t == "object" && typeof e == "object" && t && e && ASe(t, e); -class g8 { +const qCe = (t) => new Ju(), uf = (t, e) => t === e || typeof t == "object" && typeof e == "object" && t && e && bTe(t, e); +class q8 { constructor(e, r, n, i) { this.left = e, this.right = r, this.index = n, this.currentAttributes = i; } forward() { - switch (this.right === null && zl(), this.right.content.constructor) { - case Di: - this.right.deleted || i1(this.currentAttributes, this.right.content); + switch (this.right === null && ic(), this.right.content.constructor) { + case Wi: + this.right.deleted || T1(this.currentAttributes, this.right.content); break; default: this.right.deleted || (this.index += this.right.length); @@ -18232,77 +18232,77 @@ class g8 { this.left = this.right, this.right = this.right.right; } } -const Uz = (t, e, r) => { +const kQ = (t, e, r) => { for (; e.right !== null && r > 0; ) { switch (e.right.content.constructor) { - case Di: - e.right.deleted || i1(e.currentAttributes, e.right.content); + case Wi: + e.right.deleted || T1(e.currentAttributes, e.right.content); break; default: - e.right.deleted || (r < e.right.length && Ra(t, pr(e.right.id.client, e.right.id.clock + r)), e.index += e.right.length, r -= e.right.length); + e.right.deleted || (r < e.right.length && Ha(t, Tr(e.right.id.client, e.right.id.clock + r)), e.index += e.right.length, r -= e.right.length); break; } e.left = e.right, e.right = e.right.right; } return e; -}, rO = (t, e, r) => { - const n = /* @__PURE__ */ new Map(), i = TT(e, r); +}, AO = (t, e, r) => { + const n = /* @__PURE__ */ new Map(), i = KT(e, r); if (i) { - const s = new g8(i.p.left, i.p, i.index, n); - return Uz(t, s, r - i.index); + const s = new q8(i.p.left, i.p, i.index, n); + return kQ(t, s, r - i.index); } else { - const s = new g8(null, e._start, 0, n); - return Uz(t, s, r); + const s = new q8(null, e._start, 0, n); + return kQ(t, s, r); } -}, Pte = (t, e, r, n) => { - for (; r.right !== null && (r.right.deleted === !0 || r.right.content.constructor === Di && Yh(n.get(r.right.content.key), r.right.content.value)); ) +}, gre = (t, e, r, n) => { + for (; r.right !== null && (r.right.deleted === !0 || r.right.content.constructor === Wi && uf(n.get(r.right.content.key), r.right.content.value)); ) r.right.deleted || n.delete(r.right.content.key), r.forward(); const i = t.doc, s = i.clientID; n.forEach((a, o) => { - const l = r.left, u = r.right, h = new sn(pr(s, ri(i.store, s)), l, l && l.lastId, u, u && u.id, e, null, new Di(o, a)); + const l = r.left, u = r.right, h = new mn(Tr(s, gi(i.store, s)), l, l && l.lastId, u, u && u.id, e, null, new Wi(o, a)); h.integrate(t, 0), r.right = h, r.forward(); }); -}, i1 = (t, e) => { +}, T1 = (t, e) => { const { key: r, value: n } = e; n === null ? t.delete(r) : t.set(r, n); -}, Nte = (t, e) => { +}, mre = (t, e) => { for (; t.right !== null; ) { - if (!(t.right.deleted || t.right.content.constructor === Di && Yh(e[t.right.content.key] || null, t.right.content.value))) + if (!(t.right.deleted || t.right.content.constructor === Wi && uf(e[t.right.content.key] || null, t.right.content.value))) break; t.forward(); } -}, Ite = (t, e, r, n) => { +}, vre = (t, e, r, n) => { const i = t.doc, s = i.clientID, a = /* @__PURE__ */ new Map(); for (const o in n) { const l = n[o], u = r.currentAttributes.get(o) || null; - if (!Yh(u, l)) { + if (!uf(u, l)) { a.set(o, u); const { left: h, right: f } = r; - r.right = new sn(pr(s, ri(i.store, s)), h, h && h.lastId, f, f && f.id, e, null, new Di(o, l)), r.right.integrate(t, 0), r.forward(); + r.right = new mn(Tr(s, gi(i.store, s)), h, h && h.lastId, f, f && f.id, e, null, new Wi(o, l)), r.right.integrate(t, 0), r.forward(); } } return a; -}, p6 = (t, e, r, n, i) => { +}, V_ = (t, e, r, n, i) => { r.currentAttributes.forEach((d, p) => { i[p] === void 0 && (i[p] = null); }); const s = t.doc, a = s.clientID; - Nte(r, i); - const o = Ite(t, e, r, i), l = n.constructor === String ? new Uc(n) : n instanceof fs ? new Jc(n) : new Z0(n); + mre(r, i); + const o = vre(t, e, r, i), l = n.constructor === String ? new ou(n) : n instanceof Ts ? new vu(n) : new gp(n); let { left: u, right: h, index: f } = r; - e._searchMarker && u2(e._searchMarker, r.index, l.getLength()), h = new sn(pr(a, ri(s.store, a)), u, u && u.lastId, h, h && h.id, e, null, l), h.integrate(t, 0), r.right = h, r.index = f, r.forward(), Pte(t, e, r, o); -}, Vz = (t, e, r, n, i) => { + e._searchMarker && P2(e._searchMarker, r.index, l.getLength()), h = new mn(Tr(a, gi(s.store, a)), u, u && u.lastId, h, h && h.id, e, null, l), h.integrate(t, 0), r.right = h, r.index = f, r.forward(), gre(t, e, r, o); +}, SQ = (t, e, r, n, i) => { const s = t.doc, a = s.clientID; - Nte(r, i); - const o = Ite(t, e, r, i); + mre(r, i); + const o = vre(t, e, r, i); e: - for (; r.right !== null && (n > 0 || o.size > 0 && (r.right.deleted || r.right.content.constructor === Di)); ) { + for (; r.right !== null && (n > 0 || o.size > 0 && (r.right.deleted || r.right.content.constructor === Wi)); ) { if (!r.right.deleted) switch (r.right.content.constructor) { - case Di: { + case Wi: { const { key: l, value: u } = r.right.content, h = i[l]; if (h !== void 0) { - if (Yh(h, u)) + if (uf(h, u)) o.delete(l); else { if (n === 0) @@ -18315,7 +18315,7 @@ const Uz = (t, e, r) => { break; } default: - n < r.right.length && Ra(t, pr(r.right.id.client, r.right.id.clock + n)), n -= r.right.length; + n < r.right.length && Ha(t, Tr(r.right.id.client, r.right.id.clock + n)), n -= r.right.length; break; } r.forward(); @@ -18325,14 +18325,14 @@ const Uz = (t, e, r) => { for (; n > 0; n--) l += ` `; - r.right = new sn(pr(a, ri(s.store, a)), r.left, r.left && r.left.lastId, r.right, r.right && r.right.id, e, null, new Uc(l)), r.right.integrate(t, 0), r.forward(); + r.right = new mn(Tr(a, gi(s.store, a)), r.left, r.left && r.left.lastId, r.right, r.right && r.right.id, e, null, new ou(l)), r.right.integrate(t, 0), r.forward(); } - Pte(t, e, r, o); -}, $te = (t, e, r, n, i) => { + gre(t, e, r, o); +}, yre = (t, e, r, n, i) => { let s = e; - const a = Cl(); + const a = ql(); for (; s && (!s.countable || s.deleted); ) { - if (!s.deleted && s.content.constructor === Di) { + if (!s.deleted && s.content.constructor === Wi) { const u = s.content; a.set(u.key, u); } @@ -18343,9 +18343,9 @@ const Uz = (t, e, r) => { if (r === e && (l = !0), !e.deleted) { const u = e.content; switch (u.constructor) { - case Di: { + case Wi: { const { key: h, value: f } = u, d = n.get(h) || null; - (a.get(h) !== u || d === f) && (e.delete(t), o++, !l && (i.get(h) || null) === f && d !== f && (d === null ? i.delete(h) : i.set(h, d))), !l && !e.deleted && i1(i, u); + (a.get(h) !== u || d === f) && (e.delete(t), o++, !l && (i.get(h) || null) === f && d !== f && (d === null ? i.delete(h) : i.set(h, d))), !l && !e.deleted && T1(i, u); break; } } @@ -18353,71 +18353,71 @@ const Uz = (t, e, r) => { e = e.right; } return o; -}, tCe = (t, e) => { +}, YCe = (t, e) => { for (; e && e.right && (e.right.deleted || !e.right.countable); ) e = e.right; const r = /* @__PURE__ */ new Set(); for (; e && (e.deleted || !e.countable); ) { - if (!e.deleted && e.content.constructor === Di) { + if (!e.deleted && e.content.constructor === Wi) { const n = e.content.key; r.has(n) ? e.delete(t) : r.add(n); } e = e.left; } -}, rCe = (t) => { +}, WCe = (t) => { let e = 0; - return nn(t.doc, (r) => { - let n = t._start, i = t._start, s = Cl(); - const a = n8(s); + return gn(t.doc, (r) => { + let n = t._start, i = t._start, s = ql(); + const a = M8(s); for (; i; ) { if (i.deleted === !1) switch (i.content.constructor) { - case Di: - i1(a, i.content); + case Wi: + T1(a, i.content); break; default: - e += $te(r, n, i, s, a), s = n8(a), n = i; + e += yre(r, n, i, s, a), s = M8(a), n = i; break; } i = i.right; } }), e; -}, nCe = (t) => { +}, GCe = (t) => { const e = /* @__PURE__ */ new Set(), r = t.doc; for (const [n, i] of t.afterState.entries()) { const s = t.beforeState.get(n) || 0; - i !== s && xte(t, r.store.clients.get(n), s, i, (a) => { - !a.deleted && a.content.constructor === Di && a.constructor !== Do && e.add(a.parent); + i !== s && tre(t, r.store.clients.get(n), s, i, (a) => { + !a.deleted && a.content.constructor === Wi && a.constructor !== Zo && e.add(a.parent); }); } - nn(r, (n) => { - jg(t, t.deleteSet, (i) => { - if (i instanceof Do || !i.parent._hasFormatting || e.has(i.parent)) + gn(r, (n) => { + ym(t, t.deleteSet, (i) => { + if (i instanceof Zo || !i.parent._hasFormatting || e.has(i.parent)) return; const s = i.parent; - i.content.constructor === Di ? e.add(s) : tCe(n, i); + i.content.constructor === Wi ? e.add(s) : YCe(n, i); }); for (const i of e) - rCe(i); + WCe(i); }); -}, qz = (t, e, r) => { - const n = r, i = n8(e.currentAttributes), s = e.right; +}, TQ = (t, e, r) => { + const n = r, i = M8(e.currentAttributes), s = e.right; for (; r > 0 && e.right !== null; ) { if (e.right.deleted === !1) switch (e.right.content.constructor) { - case Jc: - case Z0: - case Uc: - r < e.right.length && Ra(t, pr(e.right.id.client, e.right.id.clock + r)), r -= e.right.length, e.right.delete(t); + case vu: + case gp: + case ou: + r < e.right.length && Ha(t, Tr(e.right.id.client, e.right.id.clock + r)), r -= e.right.length, e.right.delete(t); break; } e.forward(); } - s && $te(t, s, e.right, i, e.currentAttributes); + s && yre(t, s, e.right, i, e.currentAttributes); const a = (e.left || e.right).parent; - return a._searchMarker && u2(a._searchMarker, e.index, -n + r), e; + return a._searchMarker && P2(a._searchMarker, e.index, -n + r), e; }; -class iCe extends ST { +class XCe extends jT { constructor(e, r, n) { super(e, r), this.childListChanged = !1, this.keysChanged = /* @__PURE__ */ new Set(), n.forEach((i) => { i === null ? this.childListChanged = !0 : this.keysChanged.add(i); @@ -18438,7 +18438,7 @@ class iCe extends ST { get delta() { if (this._delta === null) { const e = this.target.doc, r = []; - nn(e, (n) => { + gn(e, (n) => { const i = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(); let a = this.target._start, o = null; const l = {}; @@ -18456,7 +18456,7 @@ class iCe extends ST { }))), u = ""; break; case "retain": - h > 0 && (p = { retain: h }, ESe(l) || (p.attributes = kSe({}, l))), h = 0; + h > 0 && (p = { retain: h }, vTe(l) || (p.attributes = dTe({}, l))), h = 0; break; } p && r.push(p), o = null; @@ -18464,30 +18464,30 @@ class iCe extends ST { }; for (; a !== null; ) { switch (a.content.constructor) { - case Jc: - case Z0: + case vu: + case gp: this.adds(a) ? this.deletes(a) || (d(), o = "insert", u = a.content.getContent()[0], d()) : this.deletes(a) ? (o !== "delete" && (d(), o = "delete"), f += 1) : a.deleted || (o !== "retain" && (d(), o = "retain"), h += 1); break; - case Uc: + case ou: this.adds(a) ? this.deletes(a) || (o !== "insert" && (d(), o = "insert"), u += a.content.str) : this.deletes(a) ? (o !== "delete" && (d(), o = "delete"), f += a.length) : a.deleted || (o !== "retain" && (d(), o = "retain"), h += a.length); break; - case Di: { + case Wi: { const { key: p, value: g } = a.content; if (this.adds(a)) { if (!this.deletes(a)) { const m = i.get(p) || null; - Yh(m, g) ? g !== null && a.delete(n) : (o === "retain" && d(), Yh(g, s.get(p) || null) ? delete l[p] : l[p] = g); + uf(m, g) ? g !== null && a.delete(n) : (o === "retain" && d(), uf(g, s.get(p) || null) ? delete l[p] : l[p] = g); } } else if (this.deletes(a)) { s.set(p, g); const m = i.get(p) || null; - Yh(m, g) || (o === "retain" && d(), l[p] = m); + uf(m, g) || (o === "retain" && d(), l[p] = m); } else if (!a.deleted) { s.set(p, g); const m = l[p]; - m !== void 0 && (Yh(m, g) ? m !== null && a.delete(n) : (o === "retain" && d(), g === null ? delete l[p] : l[p] = g)); + m !== void 0 && (uf(m, g) ? m !== null && a.delete(n) : (o === "retain" && d(), g === null ? delete l[p] : l[p] = g)); } - a.deleted || (o === "insert" && d(), i1(i, a.content)); + a.deleted || (o === "insert" && d(), T1(i, a.content)); break; } } @@ -18505,7 +18505,7 @@ class iCe extends ST { return this._delta; } } -class Jg extends fs { +class xm extends Ts { constructor(e) { super(), this._pending = e !== void 0 ? [() => this.insert(0, e)] : [], this._searchMarker = [], this._hasFormatting = !1; } @@ -18522,37 +18522,37 @@ class Jg extends fs { this._pending = null; } _copy() { - return new Jg(); + return new xm(); } clone() { - const e = new Jg(); + const e = new xm(); return e.applyDelta(this.toDelta()), e; } _callObserver(e, r) { super._callObserver(e, r); - const n = new iCe(this, e, r); - CT(this, e, n), !e.local && this._hasFormatting && (e._needFormattingCleanup = !0); + const n = new XCe(this, e, r); + JT(this, e, n), !e.local && this._hasFormatting && (e._needFormattingCleanup = !0); } toString() { let e = "", r = this._start; for (; r !== null; ) - !r.deleted && r.countable && r.content.constructor === Uc && (e += r.content.str), r = r.right; + !r.deleted && r.countable && r.content.constructor === ou && (e += r.content.str), r = r.right; return e; } toJSON() { return this.toString(); } applyDelta(e, { sanitize: r = !0 } = {}) { - this.doc !== null ? nn(this.doc, (n) => { - const i = new g8(null, this._start, 0, /* @__PURE__ */ new Map()); + this.doc !== null ? gn(this.doc, (n) => { + const i = new q8(null, this._start, 0, /* @__PURE__ */ new Map()); for (let s = 0; s < e.length; s++) { const a = e[s]; if (a.insert !== void 0) { const o = !r && typeof a.insert == "string" && s === e.length - 1 && i.right === null && a.insert.slice(-1) === ` ` ? a.insert.slice(0, -1) : a.insert; - (typeof o != "string" || o.length > 0) && p6(n, this, i, o, a.attributes || {}); + (typeof o != "string" || o.length > 0) && V_(n, this, i, o, a.attributes || {}); } else - a.retain !== void 0 ? Vz(n, this, i, a.retain, a.attributes || {}) : a.delete !== void 0 && qz(n, i, a.delete); + a.retain !== void 0 ? SQ(n, this, i, a.retain, a.attributes || {}) : a.delete !== void 0 && TQ(n, i, a.delete); } }) : this._pending.push(() => this.applyDelta(e)); } @@ -18572,15 +18572,15 @@ class Jg extends fs { } const h = () => { for (; l !== null; ) { - if (Bp(l, e) || r !== void 0 && Bp(l, r)) + if (sg(l, e) || r !== void 0 && sg(l, r)) switch (l.content.constructor) { - case Uc: { + case ou: { const f = s.get("ychange"); - e !== void 0 && !Bp(l, e) ? (f === void 0 || f.user !== l.id.client || f.type !== "removed") && (u(), s.set("ychange", n ? n("removed", l.id) : { type: "removed" })) : r !== void 0 && !Bp(l, r) ? (f === void 0 || f.user !== l.id.client || f.type !== "added") && (u(), s.set("ychange", n ? n("added", l.id) : { type: "added" })) : f !== void 0 && (u(), s.delete("ychange")), o += l.content.str; + e !== void 0 && !sg(l, e) ? (f === void 0 || f.user !== l.id.client || f.type !== "removed") && (u(), s.set("ychange", n ? n("removed", l.id) : { type: "removed" })) : r !== void 0 && !sg(l, r) ? (f === void 0 || f.user !== l.id.client || f.type !== "added") && (u(), s.set("ychange", n ? n("added", l.id) : { type: "added" })) : f !== void 0 && (u(), s.delete("ychange")), o += l.content.str; break; } - case Jc: - case Z0: { + case vu: + case gp: { u(); const f = { insert: l.content.getContent()[0] @@ -18594,75 +18594,75 @@ class Jg extends fs { i.push(f); break; } - case Di: - Bp(l, e) && (u(), i1(s, l.content)); + case Wi: + sg(l, e) && (u(), T1(s, l.content)); break; } l = l.right; } u(); }; - return e || r ? nn(a, (f) => { - e && d8(f, e), r && d8(f, r), h(); + return e || r ? gn(a, (f) => { + e && U8(f, e), r && U8(f, r), h(); }, "cleanup") : h(), i; } insert(e, r, n) { if (r.length <= 0) return; const i = this.doc; - i !== null ? nn(i, (s) => { - const a = rO(s, this, e); + i !== null ? gn(i, (s) => { + const a = AO(s, this, e); n || (n = {}, a.currentAttributes.forEach((o, l) => { n[l] = o; - })), p6(s, this, a, r, n); + })), V_(s, this, a, r, n); }) : this._pending.push(() => this.insert(e, r, n)); } insertEmbed(e, r, n = {}) { const i = this.doc; - i !== null ? nn(i, (s) => { - const a = rO(s, this, e); - p6(s, this, a, r, n); + i !== null ? gn(i, (s) => { + const a = AO(s, this, e); + V_(s, this, a, r, n); }) : this._pending.push(() => this.insertEmbed(e, r, n)); } delete(e, r) { if (r === 0) return; const n = this.doc; - n !== null ? nn(n, (i) => { - qz(i, rO(i, this, e), r); + n !== null ? gn(n, (i) => { + TQ(i, AO(i, this, e), r); }) : this._pending.push(() => this.delete(e, r)); } format(e, r, n) { if (r === 0) return; const i = this.doc; - i !== null ? nn(i, (s) => { - const a = rO(s, this, e); - a.right !== null && Vz(s, this, a, r, n); + i !== null ? gn(i, (s) => { + const a = AO(s, this, e); + a.right !== null && SQ(s, this, a, r, n); }) : this._pending.push(() => this.format(e, r, n)); } removeAttribute(e) { - this.doc !== null ? nn(this.doc, (r) => { - hk(r, this, e); + this.doc !== null ? gn(this.doc, (r) => { + Bk(r, this, e); }) : this._pending.push(() => this.removeAttribute(e)); } setAttribute(e, r) { - this.doc !== null ? nn(this.doc, (n) => { - dD(n, this, e, r); + this.doc !== null ? gn(this.doc, (n) => { + UD(n, this, e, r); }) : this._pending.push(() => this.setAttribute(e, r)); } getAttribute(e) { - return pD(this, e); + return VD(this, e); } getAttributes() { - return Mte(this); + return dre(this); } _write(e) { - e.writeTypeRef(kCe); + e.writeTypeRef(dEe); } } -const sCe = (t) => new Jg(); -class g6 { +const HCe = (t) => new xm(); +class q_ { constructor(e, r = () => !0) { this._filter = r, this._root = e, this._currentNode = e._start, this._firstCall = !0; } @@ -18673,7 +18673,7 @@ class g6 { let e = this._currentNode, r = e && e.content && e.content.type; if (e !== null && (!this._firstCall || e.deleted || !this._filter(r))) do - if (r = e.content.type, !e.deleted && (r.constructor === f2 || r.constructor === d0) && r._start !== null) + if (r = e.content.type, !e.deleted && (r.constructor === I2 || r.constructor === M0) && r._start !== null) e = r._start; else for (; e !== null; ) @@ -18686,7 +18686,7 @@ class g6 { return this._firstCall = !1, e === null ? { value: void 0, done: !0 } : (this._currentNode = e, { value: e.content.type, done: !1 }); } } -class d0 extends fs { +class M0 extends Ts { constructor() { super(), this._prelimContent = []; } @@ -18698,66 +18698,66 @@ class d0 extends fs { super._integrate(e, r), this.insert(0, this._prelimContent), this._prelimContent = null; } _copy() { - return new d0(); + return new M0(); } clone() { - const e = new d0(); - return e.insert(0, this.toArray().map((r) => r instanceof fs ? r.clone() : r)), e; + const e = new M0(); + return e.insert(0, this.toArray().map((r) => r instanceof Ts ? r.clone() : r)), e; } get length() { return this._prelimContent === null ? this._length : this._prelimContent.length; } createTreeWalker(e) { - return new g6(this, e); + return new q_(this, e); } querySelector(e) { e = e.toUpperCase(); - const n = new g6(this, (i) => i.nodeName && i.nodeName.toUpperCase() === e).next(); + const n = new q_(this, (i) => i.nodeName && i.nodeName.toUpperCase() === e).next(); return n.done ? null : n.value; } querySelectorAll(e) { - return e = e.toUpperCase(), wf(new g6(this, (r) => r.nodeName && r.nodeName.toUpperCase() === e)); + return e = e.toUpperCase(), Ff(new q_(this, (r) => r.nodeName && r.nodeName.toUpperCase() === e)); } _callObserver(e, r) { - CT(this, e, new lCe(this, r, e)); + JT(this, e, new KCe(this, r, e)); } toString() { - return Ete(this, (e) => e.toString()).join(""); + return lre(this, (e) => e.toString()).join(""); } toJSON() { return this.toString(); } toDOM(e = document, r = {}, n) { const i = e.createDocumentFragment(); - return n !== void 0 && n._createAssociation(i, this), h2(this, (s) => { + return n !== void 0 && n._createAssociation(i, this), N2(this, (s) => { i.insertBefore(s.toDOM(e, r, n), null); }), i; } insert(e, r) { - this.doc !== null ? nn(this.doc, (n) => { - Lte(n, this, e, r); + this.doc !== null ? gn(this.doc, (n) => { + hre(n, this, e, r); }) : this._prelimContent.splice(e, 0, ...r); } insertAfter(e, r) { if (this.doc !== null) - nn(this.doc, (n) => { - const i = e && e instanceof fs ? e._item : e; - uk(n, this, i, r); + gn(this.doc, (n) => { + const i = e && e instanceof Ts ? e._item : e; + $k(n, this, i, r); }); else { const n = this._prelimContent, i = e === null ? 0 : n.findIndex((s) => s === e) + 1; if (i === 0 && e !== null) - throw Of("Reference item not found"); + throw zf("Reference item not found"); n.splice(i, 0, ...r); } } delete(e, r = 1) { - this.doc !== null ? nn(this.doc, (n) => { - Rte(n, this, e, r); + this.doc !== null ? gn(this.doc, (n) => { + fre(n, this, e, r); }) : this._prelimContent.splice(e, r); } toArray() { - return Cte(this); + return ore(this); } push(e) { this.insert(this.length, e); @@ -18766,20 +18766,20 @@ class d0 extends fs { this.insert(0, e); } get(e) { - return _te(this, e); + return cre(this, e); } slice(e = 0, r = this.length) { - return Tte(this, e, r); + return are(this, e, r); } forEach(e) { - h2(this, e); + N2(this, e); } _write(e) { - e.writeTypeRef(TCe); + e.writeTypeRef(gEe); } } -const aCe = (t) => new d0(); -class f2 extends d0 { +const ZCe = (t) => new M0(); +class I2 extends M0 { constructor(e = "UNDEFINED") { super(), this.nodeName = e, this._prelimAttrs = /* @__PURE__ */ new Map(); } @@ -18797,13 +18797,13 @@ class f2 extends d0 { }), this._prelimAttrs = null; } _copy() { - return new f2(this.nodeName); + return new I2(this.nodeName); } clone() { - const e = new f2(this.nodeName), r = this.getAttributes(); - return TSe(r, (n, i) => { + const e = new I2(this.nodeName), r = this.getAttributes(); + return gTe(r, (n, i) => { typeof n == "string" && e.setAttribute(i, n); - }), e.insert(0, this.toArray().map((n) => n instanceof fs ? n.clone() : n)), e; + }), e.insert(0, this.toArray().map((n) => n instanceof Ts ? n.clone() : n)), e; } toString() { const e = this.getAttributes(), r = [], n = []; @@ -18819,23 +18819,23 @@ class f2 extends d0 { return `<${s}${a}>${super.toString()}`; } removeAttribute(e) { - this.doc !== null ? nn(this.doc, (r) => { - hk(r, this, e); + this.doc !== null ? gn(this.doc, (r) => { + Bk(r, this, e); }) : this._prelimAttrs.delete(e); } setAttribute(e, r) { - this.doc !== null ? nn(this.doc, (n) => { - dD(n, this, e, r); + this.doc !== null ? gn(this.doc, (n) => { + UD(n, this, e, r); }) : this._prelimAttrs.set(e, r); } getAttribute(e) { - return pD(this, e); + return VD(this, e); } hasAttribute(e) { - return Dte(this, e); + return pre(this, e); } getAttributes(e) { - return e ? ZTe(this, e) : Mte(this); + return e ? zCe(this, e) : dre(this); } toDOM(e = document, r = {}, n) { const i = e.createElement(this.nodeName), s = this.getAttributes(); @@ -18843,31 +18843,31 @@ class f2 extends d0 { const o = s[a]; typeof o == "string" && i.setAttribute(a, o); } - return h2(this, (a) => { + return N2(this, (a) => { i.appendChild(a.toDOM(e, r, n)); }), n !== void 0 && n._createAssociation(i, this), i; } _write(e) { - e.writeTypeRef(SCe), e.writeKey(this.nodeName); + e.writeTypeRef(pEe), e.writeKey(this.nodeName); } } -const oCe = (t) => new f2(t.readKey()); -class lCe extends ST { +const jCe = (t) => new I2(t.readKey()); +class KCe extends jT { constructor(e, r, n) { super(e, n), this.childListChanged = !1, this.attributesChanged = /* @__PURE__ */ new Set(), r.forEach((i) => { i === null ? this.childListChanged = !0 : this.attributesChanged.add(i); }); } } -class fk extends Nu { +class Fk extends Ju { constructor(e) { super(), this.hookName = e; } _copy() { - return new fk(this.hookName); + return new Fk(this.hookName); } clone() { - const e = new fk(this.hookName); + const e = new Fk(this.hookName); return this.forEach((r, n) => { e.set(n, r); }), e; @@ -18878,11 +18878,11 @@ class fk extends Nu { return i !== void 0 ? s = i.createDom(this) : s = document.createElement(this.hookName), s.setAttribute("data-yjs-hook", this.hookName), n !== void 0 && n._createAssociation(s, this), s; } _write(e) { - e.writeTypeRef(CCe), e.writeKey(this.hookName); + e.writeTypeRef(mEe), e.writeKey(this.hookName); } } -const cCe = (t) => new fk(t.readKey()); -class dk extends Jg { +const JCe = (t) => new Fk(t.readKey()); +class zk extends xm { get nextSibling() { const e = this._item ? this._item.next : null; return e ? e.content.type : null; @@ -18892,10 +18892,10 @@ class dk extends Jg { return e ? e.content.type : null; } _copy() { - return new dk(); + return new zk(); } clone() { - const e = new dk(); + const e = new zk(); return e.applyDelta(this.toDelta()), e; } toDOM(e = document, r, n) { @@ -18932,29 +18932,29 @@ class dk extends Jg { return this.toString(); } _write(e) { - e.writeTypeRef(ECe); + e.writeTypeRef(vEe); } } -const uCe = (t) => new dk(); -class gD { +const eEe = (t) => new zk(); +class qD { constructor(e, r) { this.id = e, this.length = r; } get deleted() { - throw Pc(); + throw Jc(); } mergeWith(e) { return !1; } write(e, r, n) { - throw Pc(); + throw Jc(); } integrate(e, r) { - throw Pc(); + throw Jc(); } } -const hCe = 0; -class Do extends gD { +const tEe = 0; +class Zo extends qD { get deleted() { return !0; } @@ -18964,16 +18964,16 @@ class Do extends gD { return this.constructor !== e.constructor ? !1 : (this.length += e.length, !0); } integrate(e, r) { - r > 0 && (this.id.clock += r, this.length -= r), bte(e.doc.store, this); + r > 0 && (this.id.clock += r, this.length -= r), ere(e.doc.store, this); } write(e, r) { - e.writeInfo(hCe), e.writeLen(this.length - r); + e.writeInfo(tEe), e.writeLen(this.length - r); } getMissing(e, r) { return null; } } -class wx { +class Yx { constructor(e) { this.content = e; } @@ -18987,10 +18987,10 @@ class wx { return !0; } copy() { - return new wx(this.content); + return new Yx(this.content); } splice(e) { - throw Pc(); + throw Jc(); } mergeWith(e) { return !1; @@ -19008,8 +19008,8 @@ class wx { return 3; } } -const fCe = (t) => new wx(t.readBuf()); -class d2 { +const rEe = (t) => new Yx(t.readBuf()); +class $2 { constructor(e) { this.len = e; } @@ -19023,17 +19023,17 @@ class d2 { return !1; } copy() { - return new d2(this.len); + return new $2(this.len); } splice(e) { - const r = new d2(this.len - e); + const r = new $2(this.len - e); return this.len = e, r; } mergeWith(e) { return this.len += e.len, !0; } integrate(e, r) { - l2(e.deleteSet, r.id.client, r.id.clock, this.len), r.markDeleted(); + M2(e.deleteSet, r.id.client, r.id.clock, this.len), r.markDeleted(); } delete(e) { } @@ -19046,8 +19046,8 @@ class d2 { return 1; } } -const dCe = (t) => new d2(t.readLen()), Bte = (t, e) => new n1({ guid: t, ...e, shouldLoad: e.shouldLoad || e.autoLoad || !1 }); -class Ox { +const nEe = (t) => new $2(t.readLen()), bre = (t, e) => new S1({ guid: t, ...e, shouldLoad: e.shouldLoad || e.autoLoad || !1 }); +class Wx { constructor(e) { e._item && console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."), this.doc = e; const r = {}; @@ -19063,10 +19063,10 @@ class Ox { return !0; } copy() { - return new Ox(Bte(this.doc.guid, this.opts)); + return new Wx(bre(this.doc.guid, this.opts)); } splice(e) { - throw Pc(); + throw Jc(); } mergeWith(e) { return !1; @@ -19086,8 +19086,8 @@ class Ox { return 9; } } -const pCe = (t) => new Ox(Bte(t.readString(), t.readAny())); -class Z0 { +const iEe = (t) => new Wx(bre(t.readString(), t.readAny())); +class gp { constructor(e) { this.embed = e; } @@ -19101,10 +19101,10 @@ class Z0 { return !0; } copy() { - return new Z0(this.embed); + return new gp(this.embed); } splice(e) { - throw Pc(); + throw Jc(); } mergeWith(e) { return !1; @@ -19122,8 +19122,8 @@ class Z0 { return 5; } } -const gCe = (t) => new Z0(t.readJSON()); -class Di { +const sEe = (t) => new gp(t.readJSON()); +class Wi { constructor(e, r) { this.key = e, this.value = r; } @@ -19137,10 +19137,10 @@ class Di { return !1; } copy() { - return new Di(this.key, this.value); + return new Wi(this.key, this.value); } splice(e) { - throw Pc(); + throw Jc(); } mergeWith(e) { return !1; @@ -19160,8 +19160,8 @@ class Di { return 6; } } -const mCe = (t) => new Di(t.readKey(), t.readJSON()); -class pk { +const aEe = (t) => new Wi(t.readKey(), t.readJSON()); +class Qk { constructor(e) { this.arr = e; } @@ -19175,10 +19175,10 @@ class pk { return !0; } copy() { - return new pk(this.arr); + return new Qk(this.arr); } splice(e) { - const r = new pk(this.arr.slice(e)); + const r = new Qk(this.arr.slice(e)); return this.arr = this.arr.slice(0, e), r; } mergeWith(e) { @@ -19202,15 +19202,15 @@ class pk { return 2; } } -const vCe = (t) => { +const oEe = (t) => { const e = t.readLen(), r = []; for (let n = 0; n < e; n++) { const i = t.readString(); i === "undefined" ? r.push(void 0) : r.push(JSON.parse(i)); } - return new pk(r); + return new Qk(r); }; -class p0 { +class D0 { constructor(e) { this.arr = e; } @@ -19224,10 +19224,10 @@ class p0 { return !0; } copy() { - return new p0(this.arr); + return new D0(this.arr); } splice(e) { - const r = new p0(this.arr.slice(e)); + const r = new D0(this.arr.slice(e)); return this.arr = this.arr.slice(0, e), r; } mergeWith(e) { @@ -19251,13 +19251,13 @@ class p0 { return 8; } } -const yCe = (t) => { +const lEe = (t) => { const e = t.readLen(), r = []; for (let n = 0; n < e; n++) r.push(t.readAny()); - return new p0(r); + return new D0(r); }; -class Uc { +class ou { constructor(e) { this.str = e; } @@ -19271,10 +19271,10 @@ class Uc { return !0; } copy() { - return new Uc(this.str); + return new ou(this.str); } splice(e) { - const r = new Uc(this.str.slice(e)); + const r = new ou(this.str.slice(e)); this.str = this.str.slice(0, e); const n = this.str.charCodeAt(e - 1); return n >= 55296 && n <= 56319 && (this.str = this.str.slice(0, e - 1) + "\uFFFD", r.str = "\uFFFD" + r.str.slice(1)), r; @@ -19295,16 +19295,16 @@ class Uc { return 4; } } -const bCe = (t) => new Uc(t.readString()), xCe = [ - KTe, - eCe, - sCe, - oCe, - aCe, - cCe, - uCe -], wCe = 0, OCe = 1, kCe = 2, SCe = 3, TCe = 4, CCe = 5, ECe = 6; -class Jc { +const cEe = (t) => new ou(t.readString()), uEe = [ + UCe, + qCe, + HCe, + jCe, + ZCe, + JCe, + eEe +], hEe = 0, fEe = 1, dEe = 2, pEe = 3, gEe = 4, mEe = 5, vEe = 6; +class vu { constructor(e) { this.type = e; } @@ -19318,10 +19318,10 @@ class Jc { return !0; } copy() { - return new Jc(this.type._copy()); + return new vu(this.type._copy()); } splice(e) { - throw Pc(); + throw Jc(); } mergeWith(e) { return !1; @@ -19353,47 +19353,47 @@ class Jc { return 7; } } -const _Ce = (t) => new Jc(xCe[t.readTypeRef()](t)), m8 = (t, e) => { +const yEe = (t) => new vu(uEe[t.readTypeRef()](t)), Y8 = (t, e) => { let r = e, n = 0, i; do - n > 0 && (r = pr(r.client, r.clock + n)), i = B4(t, r), n = r.clock - i.id.clock, r = i.redone; - while (r !== null && i instanceof sn); + n > 0 && (r = Tr(r.client, r.clock + n)), i = h5(t, r), n = r.clock - i.id.clock, r = i.redone; + while (r !== null && i instanceof mn); return { item: i, diff: n }; -}, mD = (t, e) => { +}, YD = (t, e) => { for (; t !== null && t.keep !== e; ) t.keep = e, t = t.parent._item; -}, gk = (t, e, r) => { - const { client: n, clock: i } = e.id, s = new sn( - pr(n, i + r), +}, Uk = (t, e, r) => { + const { client: n, clock: i } = e.id, s = new mn( + Tr(n, i + r), e, - pr(n, i + r - 1), + Tr(n, i + r - 1), e.right, e.rightOrigin, e.parent, e.parentSub, e.content.splice(r) ); - return e.deleted && s.markDeleted(), e.keep && (s.keep = !0), e.redone !== null && (s.redone = pr(e.redone.client, e.redone.clock + r)), e.right = s, s.right !== null && (s.right.left = s), t._mergeStructs.push(s), s.parentSub !== null && s.right === null && s.parent._map.set(s.parentSub, s), e.length = r, s; -}, Yz = (t, e) => Q3e(t, (r) => bx(r.deletions, e)), Fte = (t, e, r, n, i, s) => { + return e.deleted && s.markDeleted(), e.keep && (s.keep = !0), e.redone !== null && (s.redone = Tr(e.redone.client, e.redone.clock + r)), e.right = s, s.right !== null && (s.right.left = s), t._mergeStructs.push(s), s.parentSub !== null && s.right === null && s.parent._map.set(s.parentSub, s), e.length = r, s; +}, CQ = (t, e) => RSe(t, (r) => Vx(r.deletions, e)), xre = (t, e, r, n, i, s) => { const a = t.doc, o = a.store, l = a.clientID, u = e.redone; if (u !== null) - return Ra(t, u); + return Ha(t, u); let h = e.parent._item, f = null, d; if (h !== null && h.deleted === !0) { - if (h.redone === null && (!r.has(h) || Fte(t, h, r, n, i, s) === null)) + if (h.redone === null && (!r.has(h) || xre(t, h, r, n, i, s) === null)) return null; for (; h.redone !== null; ) - h = Ra(t, h.redone); + h = Ha(t, h.redone); } const p = h === null ? e.parent : h.content.type; if (e.parentSub === null) { for (f = e.left, d = e; f !== null; ) { let y = f; for (; y !== null && y.parent._item !== h; ) - y = y.redone === null ? null : Ra(t, y.redone); + y = y.redone === null ? null : Ha(t, y.redone); if (y !== null && y.parent._item === h) { f = y; break; @@ -19403,7 +19403,7 @@ const _Ce = (t) => new Jc(xCe[t.readTypeRef()](t)), m8 = (t, e) => { for (; d !== null; ) { let y = d; for (; y !== null && y.parent._item !== h; ) - y = y.redone === null ? null : Ra(t, y.redone); + y = y.redone === null ? null : Ha(t, y.redone); if (y !== null && y.parent._item === h) { d = y; break; @@ -19411,14 +19411,14 @@ const _Ce = (t) => new Jc(xCe[t.readTypeRef()](t)), m8 = (t, e) => { d = d.right; } } else if (d = null, e.right && !i) { - for (f = e; f !== null && f.right !== null && (f.right.redone || bx(n, f.right.id) || Yz(s.undoStack, f.right.id) || Yz(s.redoStack, f.right.id)); ) + for (f = e; f !== null && f.right !== null && (f.right.redone || Vx(n, f.right.id) || CQ(s.undoStack, f.right.id) || CQ(s.redoStack, f.right.id)); ) for (f = f.right; f.redone; ) - f = Ra(t, f.redone); + f = Ha(t, f.redone); if (f && f.right !== null) return null; } else f = p._map.get(e.parentSub) || null; - const g = ri(o, l), m = pr(l, g), v = new sn( + const g = gi(o, l), m = Tr(l, g), v = new mn( m, f, f && f.lastId, @@ -19428,55 +19428,55 @@ const _Ce = (t) => new Jc(xCe[t.readTypeRef()](t)), m8 = (t, e) => { e.parentSub, e.content.copy() ); - return e.redone = m, mD(v, !0), v.integrate(t, 0), v; + return e.redone = m, YD(v, !0), v.integrate(t, 0), v; }; -class sn extends gD { +class mn extends qD { constructor(e, r, n, i, s, a, o, l) { - super(e, l.getLength()), this.origin = n, this.left = r, this.right = i, this.rightOrigin = s, this.parent = a, this.parentSub = o, this.redone = null, this.content = l, this.info = this.content.isCountable() ? xz : 0; + super(e, l.getLength()), this.origin = n, this.left = r, this.right = i, this.rightOrigin = s, this.parent = a, this.parentSub = o, this.redone = null, this.content = l, this.info = this.content.isCountable() ? tQ : 0; } set marker(e) { - (this.info & c6) > 0 !== e && (this.info ^= c6); + (this.info & B_) > 0 !== e && (this.info ^= B_); } get marker() { - return (this.info & c6) > 0; + return (this.info & B_) > 0; } get keep() { - return (this.info & bz) > 0; + return (this.info & eQ) > 0; } set keep(e) { - this.keep !== e && (this.info ^= bz); + this.keep !== e && (this.info ^= eQ); } get countable() { - return (this.info & xz) > 0; + return (this.info & tQ) > 0; } get deleted() { - return (this.info & l6) > 0; + return (this.info & $_) > 0; } set deleted(e) { - this.deleted !== e && (this.info ^= l6); + this.deleted !== e && (this.info ^= $_); } markDeleted() { - this.info |= l6; + this.info |= $_; } getMissing(e, r) { - if (this.origin && this.origin.client !== this.id.client && this.origin.clock >= ri(r, this.origin.client)) + if (this.origin && this.origin.client !== this.id.client && this.origin.clock >= gi(r, this.origin.client)) return this.origin.client; - if (this.rightOrigin && this.rightOrigin.client !== this.id.client && this.rightOrigin.clock >= ri(r, this.rightOrigin.client)) + if (this.rightOrigin && this.rightOrigin.client !== this.id.client && this.rightOrigin.clock >= gi(r, this.rightOrigin.client)) return this.rightOrigin.client; - if (this.parent && this.parent.constructor === fg && this.id.client !== this.parent.client && this.parent.clock >= ri(r, this.parent.client)) + if (this.parent && this.parent.constructor === Dg && this.id.client !== this.parent.client && this.parent.clock >= gi(r, this.parent.client)) return this.parent.client; - if (this.origin && (this.left = Iz(e, r, this.origin), this.origin = this.left.lastId), this.rightOrigin && (this.right = Ra(e, this.rightOrigin), this.rightOrigin = this.right.id), this.left && this.left.constructor === Do || this.right && this.right.constructor === Do) + if (this.origin && (this.left = vQ(e, r, this.origin), this.origin = this.left.lastId), this.rightOrigin && (this.right = Ha(e, this.rightOrigin), this.rightOrigin = this.right.id), this.left && this.left.constructor === Zo || this.right && this.right.constructor === Zo) this.parent = null; else if (!this.parent) - this.left && this.left.constructor === sn && (this.parent = this.left.parent, this.parentSub = this.left.parentSub), this.right && this.right.constructor === sn && (this.parent = this.right.parent, this.parentSub = this.right.parentSub); - else if (this.parent.constructor === fg) { - const n = B4(r, this.parent); - n.constructor === Do ? this.parent = null : this.parent = n.content.type; + this.left && this.left.constructor === mn && (this.parent = this.left.parent, this.parentSub = this.left.parentSub), this.right && this.right.constructor === mn && (this.parent = this.right.parent, this.parentSub = this.right.parentSub); + else if (this.parent.constructor === Dg) { + const n = h5(r, this.parent); + n.constructor === Zo ? this.parent = null : this.parent = n.content.type; } return null; } integrate(e, r) { - if (r > 0 && (this.id.clock += r, this.left = Iz(e, e.doc.store, pr(this.id.client, this.id.clock - 1)), this.origin = this.left.lastId, this.content = this.content.splice(r), this.length -= r), this.parent) { + if (r > 0 && (this.id.clock += r, this.left = vQ(e, e.doc.store, Tr(this.id.client, this.id.clock - 1)), this.origin = this.left.lastId, this.content = this.content.splice(r), this.length -= r), this.parent) { if (!this.left && (!this.right || this.right.left !== null) || this.left && this.left.right !== this.right) { let n = this.left, i; if (n !== null) @@ -19488,13 +19488,13 @@ class sn extends gD { i = this.parent._start; const s = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(); for (; i !== null && i !== this.right; ) { - if (a.add(i), s.add(i), Gp(this.origin, i.origin)) { + if (a.add(i), s.add(i), pg(this.origin, i.origin)) { if (i.id.client < this.id.client) n = i, s.clear(); - else if (Gp(this.rightOrigin, i.rightOrigin)) + else if (pg(this.rightOrigin, i.rightOrigin)) break; - } else if (i.origin !== null && a.has(B4(e.doc.store, i.origin))) - s.has(B4(e.doc.store, i.origin)) || (n = i, s.clear()); + } else if (i.origin !== null && a.has(h5(e.doc.store, i.origin))) + s.has(h5(e.doc.store, i.origin)) || (n = i, s.clear()); else break; i = i.right; @@ -19513,9 +19513,9 @@ class sn extends gD { n = this.parent._start, this.parent._start = this; this.right = n; } - this.right !== null ? this.right.left = this : this.parentSub !== null && (this.parent._map.set(this.parentSub, this), this.left !== null && this.left.delete(e)), this.parentSub === null && this.countable && !this.deleted && (this.parent._length += this.length), bte(e.doc.store, this), this.content.integrate(e, this), Bz(e, this.parent, this.parentSub), (this.parent._item !== null && this.parent._item.deleted || this.parentSub !== null && this.right !== null) && this.delete(e); + this.right !== null ? this.right.left = this : this.parentSub !== null && (this.parent._map.set(this.parentSub, this), this.left !== null && this.left.delete(e)), this.parentSub === null && this.countable && !this.deleted && (this.parent._length += this.length), ere(e.doc.store, this), this.content.integrate(e, this), bQ(e, this.parent, this.parentSub), (this.parent._item !== null && this.parent._item.deleted || this.parentSub !== null && this.right !== null) && this.delete(e); } else - new Do(this.id, this.length).integrate(e, 0); + new Zo(this.id, this.length).integrate(e, 0); } get next() { let e = this.right; @@ -19530,10 +19530,10 @@ class sn extends gD { return e; } get lastId() { - return this.length === 1 ? this.id : pr(this.id.client, this.id.clock + this.length - 1); + return this.length === 1 ? this.id : Tr(this.id.client, this.id.clock + this.length - 1); } mergeWith(e) { - if (this.constructor === e.constructor && Gp(e.origin, this.lastId) && this.right === e && Gp(this.rightOrigin, e.rightOrigin) && this.id.client === e.id.client && this.id.clock + this.length === e.id.clock && this.deleted === e.deleted && this.redone === null && e.redone === null && this.content.constructor === e.content.constructor && this.content.mergeWith(e.content)) { + if (this.constructor === e.constructor && pg(e.origin, this.lastId) && this.right === e && pg(this.rightOrigin, e.rightOrigin) && this.id.client === e.id.client && this.id.clock + this.length === e.id.clock && this.deleted === e.deleted && this.redone === null && e.redone === null && this.content.constructor === e.content.constructor && this.content.mergeWith(e.content)) { const r = this.parent._searchMarker; return r && r.forEach((n) => { n.p === e && (n.p = this, !this.deleted && this.countable && (n.index -= this.length)); @@ -19544,50 +19544,50 @@ class sn extends gD { delete(e) { if (!this.deleted) { const r = this.parent; - this.countable && this.parentSub === null && (r._length -= this.length), this.markDeleted(), l2(e.deleteSet, this.id.client, this.id.clock, this.length), Bz(e, r, this.parentSub), this.content.delete(e); + this.countable && this.parentSub === null && (r._length -= this.length), this.markDeleted(), M2(e.deleteSet, this.id.client, this.id.clock, this.length), bQ(e, r, this.parentSub), this.content.delete(e); } } gc(e, r) { if (!this.deleted) - throw zl(); - this.content.gc(e), r ? DTe(e, this, new Do(this.id, this.length)) : this.content = new d2(this.length); + throw ic(); + this.content.gc(e), r ? kCe(e, this, new Zo(this.id, this.length)) : this.content = new $2(this.length); } write(e, r) { - const n = r > 0 ? pr(this.id.client, this.id.clock + r - 1) : this.origin, i = this.rightOrigin, s = this.parentSub, a = this.content.getRef() & xT | (n === null ? 0 : uo) | (i === null ? 0 : Pu) | (s === null ? 0 : i2); + const n = r > 0 ? Tr(this.id.client, this.id.clock + r - 1) : this.origin, i = this.rightOrigin, s = this.parentSub, a = this.content.getRef() & GT | (n === null ? 0 : _o) | (i === null ? 0 : Ku) | (s === null ? 0 : _2); if (e.writeInfo(a), n !== null && e.writeLeftID(n), i !== null && e.writeRightID(i), n === null && i === null) { const o = this.parent; if (o._item !== void 0) { const l = o._item; if (l === null) { - const u = mte(o); + const u = jte(o); e.writeParentInfo(!0), e.writeString(u); } else e.writeParentInfo(!1), e.writeLeftID(l.id); } else - o.constructor === String ? (e.writeParentInfo(!0), e.writeString(o)) : o.constructor === fg ? (e.writeParentInfo(!1), e.writeLeftID(o)) : zl(); + o.constructor === String ? (e.writeParentInfo(!0), e.writeString(o)) : o.constructor === Dg ? (e.writeParentInfo(!1), e.writeLeftID(o)) : ic(); s !== null && e.writeString(s); } this.content.write(e, r); } } -const zte = (t, e) => ACe[e & xT](t), ACe = [ +const wre = (t, e) => bEe[e & GT](t), bEe = [ () => { - zl(); - }, - dCe, - vCe, - fCe, - bCe, - gCe, - mCe, - _Ce, - yCe, - pCe, + ic(); + }, + nEe, + oEe, + rEe, + cEe, + sEe, + aEe, + yEe, + lEe, + iEe, () => { - zl(); + ic(); } -], LCe = 10; -class Po extends gD { +], xEe = 10; +class jo extends qD { get deleted() { return !0; } @@ -19597,41 +19597,41 @@ class Po extends gD { return this.constructor !== e.constructor ? !1 : (this.length += e.length, !0); } integrate(e, r) { - zl(); + ic(); } write(e, r) { - e.writeInfo(LCe), Gt(e.restEncoder, this.length - r); + e.writeInfo(xEe), rr(e.restEncoder, this.length - r); } getMissing(e, r) { return null; } } -const Qte = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : {}, Ute = "__ $YJS$ __"; -Qte[Ute] === !0 && console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438"); -Qte[Ute] = !0; -class vD { +const Ore = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : {}, kre = "__ $YJS$ __"; +Ore[kre] === !0 && console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438"); +Ore[kre] = !0; +class WD { constructor(e, r) { this.yanchor = e, this.yhead = r; } toJSON() { return { - yanchor: Pz(this.yanchor), - yhead: Pz(this.yhead) + yanchor: gQ(this.yanchor), + yhead: gQ(this.yhead) }; } static fromJSON(e) { - return new vD(c2(e.yanchor), c2(e.yhead)); + return new WD(D2(e.yanchor), D2(e.yhead)); } } -class RCe { +class wEe { constructor(e, r) { - this.ytext = e, this.awareness = r, this.undoManager = new lD(e); + this.ytext = e, this.awareness = r, this.undoManager = new $D(e); } toYPos(e, r = 0) { - return h8(this.ytext, e, r); + return z8(this.ytext, e, r); } fromYPos(e) { - const r = f8(c2(e), this.ytext.doc); + const r = Q8(D2(e), this.ytext.doc); if (r == null || r.type !== this.ytext) throw new Error("[y-codemirror] The position you want to retrieve was created by a different document"); return { @@ -19641,21 +19641,21 @@ class RCe { } toYRange(e) { const r = e.assoc, n = this.toYPos(e.anchor, r), i = this.toYPos(e.head, r); - return new vD(n, i); + return new WD(n, i); } fromYRange(e) { const r = this.fromYPos(e.yanchor), n = this.fromYPos(e.yhead); - return r.pos === n.pos ? Ue.cursor(n.pos, n.assoc) : Ue.range(r.pos, n.pos); + return r.pos === n.pos ? je.cursor(n.pos, n.assoc) : je.range(r.pos, n.pos); } } -const kx = At.define({ +const Gx = $t.define({ combine(t) { return t[t.length - 1]; } -}), v8 = Ya.define(); -class MCe { +}), W8 = co.define(); +class OEe { constructor(e) { - this.view = e, this.conf = e.state.facet(kx), this._observer = (r, n) => { + this.view = e, this.conf = e.state.facet(Gx), this._observer = (r, n) => { if (n.origin !== this.conf) { const i = r.delta, s = []; let a = 0; @@ -19663,12 +19663,12 @@ class MCe { const l = i[o]; l.insert != null ? s.push({ from: a, to: a, insert: l.insert }) : l.delete != null ? (s.push({ from: a, to: a + l.delete, insert: "" }), a += l.delete) : a += l.retain; } - e.dispatch({ changes: s, annotations: [v8.of(this.conf)] }); + e.dispatch({ changes: s, annotations: [W8.of(this.conf)] }); } }, this._ytext = this.conf.ytext, this._ytext.observe(this._observer); } update(e) { - if (!e.docChanged || e.transactions.length > 0 && e.transactions[0].annotation(v8) === this.conf) + if (!e.docChanged || e.transactions.length > 0 && e.transactions[0].annotation(W8) === this.conf) return; const r = this.conf.ytext; r.doc.transact(() => { @@ -19684,7 +19684,7 @@ class MCe { this._ytext.unobserve(this._observer); } } -const DCe = Jr.fromClass(MCe), PCe = ft.baseTheme({ +const kEe = hn.fromClass(OEe), SEe = kt.baseTheme({ ".cm-ySelection": {}, ".cm-yLineSelection": { padding: 0, @@ -19738,24 +19738,24 @@ const DCe = Jr.fromClass(MCe), PCe = ft.baseTheme({ opacity: 1, transitionDelay: "0s" } -}), NCe = Ya.define(); -class ICe extends Wa { +}), TEe = co.define(); +class CEe extends uo { constructor(e, r) { super(), this.color = e, this.name = r; } toDOM() { - return f6("span", [ro("class", "cm-ySelectionCaret"), ro("style", `background-color: ${this.color}; border-color: ${this.color}`)], [ - Jw("\u2060"), - f6("div", [ - ro("class", "cm-ySelectionCaretDot") + return Q_("span", [xo("class", "cm-ySelectionCaret"), xo("style", `background-color: ${this.color}; border-color: ${this.color}`)], [ + CO("\u2060"), + Q_("div", [ + xo("class", "cm-ySelectionCaretDot") ]), - Jw("\u2060"), - f6("div", [ - ro("class", "cm-ySelectionInfo") + CO("\u2060"), + Q_("div", [ + xo("class", "cm-ySelectionInfo") ], [ - Jw(this.name) + CO(this.name) ]), - Jw("\u2060") + CO("\u2060") ]); } eq(e) { @@ -19774,11 +19774,11 @@ class ICe extends Wa { return !0; } } -class $Ce { +class EEe { constructor(e) { - this.conf = e.state.facet(kx), this._listener = ({ added: r, updated: n, removed: i }, s, a) => { - r.concat(n).concat(i).findIndex((l) => l !== this.conf.awareness.doc.clientID) >= 0 && e.dispatch({ annotations: [NCe.of([])] }); - }, this._awareness = this.conf.awareness, this._awareness.on("change", this._listener), this.decorations = Er.of([]); + this.conf = e.state.facet(Gx), this._listener = ({ added: r, updated: n, removed: i }, s, a) => { + r.concat(n).concat(i).findIndex((l) => l !== this.conf.awareness.doc.clientID) >= 0 && e.dispatch({ annotations: [TEe.of([])] }); + }, this._awareness = this.conf.awareness, this._awareness.on("change", this._listener), this.decorations = $r.of([]); } destroy() { this._awareness.off("change", this._listener); @@ -19786,10 +19786,10 @@ class $Ce { update(e) { const r = this.conf.ytext, n = r.doc, i = this.conf.awareness, s = [], a = this.conf.awareness.getLocalState(); if (a != null) { - const o = e.view.hasFocus && e.view.dom.ownerDocument.hasFocus(), l = o ? e.state.selection.main : null, u = a.cursor == null ? null : c2(a.cursor.anchor), h = a.cursor == null ? null : c2(a.cursor.head); + const o = e.view.hasFocus && e.view.dom.ownerDocument.hasFocus(), l = o ? e.state.selection.main : null, u = a.cursor == null ? null : D2(a.cursor.anchor), h = a.cursor == null ? null : D2(a.cursor.head); if (l != null) { - const f = h8(r, l.anchor), d = h8(r, l.head); - (a.cursor == null || !Nz(u, f) || !Nz(h, d)) && i.setLocalStateField("cursor", { + const f = z8(r, l.anchor), d = z8(r, l.head); + (a.cursor == null || !mQ(u, f) || !mQ(h, d)) && i.setLocalStateField("cursor", { anchor: f, head: d }); @@ -19802,15 +19802,15 @@ class $Ce { const u = o.cursor; if (u == null || u.anchor == null || u.head == null) return; - const h = f8(u.anchor, n), f = f8(u.head, n); + const h = Q8(u.anchor, n), f = Q8(u.head, n); if (h == null || f == null || h.type !== r || f.type !== r) return; - const { color: d = "#30bced", name: p = "Anonymous" } = o.user || {}, g = o.user && o.user.colorLight || d + "33", m = bT(h.index, f.index), v = Zf(h.index, f.index), y = e.view.state.doc.lineAt(m), b = e.view.state.doc.lineAt(v); + const { color: d = "#30bced", name: p = "Anonymous" } = o.user || {}, g = o.user && o.user.colorLight || d + "33", m = WT(h.index, f.index), v = pd(h.index, f.index), y = e.view.state.doc.lineAt(m), b = e.view.state.doc.lineAt(v); if (y.number === b.number) s.push({ from: m, to: v, - value: _t.mark({ + value: It.mark({ attributes: { style: `background-color: ${g}` }, class: "cm-ySelection" }) @@ -19819,14 +19819,14 @@ class $Ce { s.push({ from: m, to: y.from + y.length, - value: _t.mark({ + value: It.mark({ attributes: { style: `background-color: ${g}` }, class: "cm-ySelection" }) }), s.push({ from: b.from, to: v, - value: _t.mark({ + value: It.mark({ attributes: { style: `background-color: ${g}` }, class: "cm-ySelection" }) @@ -19836,7 +19836,7 @@ class $Ce { s.push({ from: O, to: O, - value: _t.line({ + value: It.line({ attributes: { style: `background-color: ${g}`, class: "cm-yLineSelection" } }) }); @@ -19845,18 +19845,18 @@ class $Ce { s.push({ from: f.index, to: f.index, - value: _t.widget({ + value: It.widget({ side: f.index - h.index > 0 ? -1 : 1, block: !1, - widget: new ICe(d, p) + widget: new CEe(d, p) }) }); - }), this.decorations = _t.set(s, !0); + }), this.decorations = It.set(s, !0); } } -const BCe = Jr.fromClass($Ce, { +const _Ee = hn.fromClass(EEe, { decorations: (t) => t.decorations -}), FCe = () => { +}), AEe = () => { let t = !0; return (e, r) => { if (t) { @@ -19870,7 +19870,7 @@ const BCe = Jr.fromClass($Ce, { r !== void 0 && r(); }; }; -class zCe { +class LEe { constructor(e) { this.undoManager = e; } @@ -19887,14 +19887,14 @@ class zCe { return this.undoManager.redo() != null; } } -const ET = At.define({ +const eC = $t.define({ combine(t) { return t[t.length - 1]; } }); -class QCe { +class REe { constructor(e) { - this.view = e, this.conf = e.state.facet(ET), this._undoManager = this.conf.undoManager, this.syncConf = e.state.facet(kx), this._beforeChangeSelection = null, this._mux = FCe(), this._onStackItemAdded = ({ stackItem: r, changedParentTypes: n }) => { + this.view = e, this.conf = e.state.facet(eC), this._undoManager = this.conf.undoManager, this.syncConf = e.state.facet(Gx), this._beforeChangeSelection = null, this._mux = AEe(), this._onStackItemAdded = ({ stackItem: r, changedParentTypes: n }) => { n.has(this.syncConf.ytext) && this._beforeChangeSelection && !r.meta.has(this) && r.meta.set(this, this._beforeChangeSelection); }, this._onStackItemPopped = ({ stackItem: r }) => { const n = r.meta.get(this); @@ -19907,58 +19907,58 @@ class QCe { }, this._undoManager.on("stack-item-added", this._onStackItemAdded), this._undoManager.on("stack-item-popped", this._onStackItemPopped), this._undoManager.addTrackedOrigin(this.syncConf); } update(e) { - e.selectionSet && (e.transactions.length === 0 || e.transactions[0].annotation(v8) !== this.syncConf) && this._storeSelection(); + e.selectionSet && (e.transactions.length === 0 || e.transactions[0].annotation(W8) !== this.syncConf) && this._storeSelection(); } destroy() { this._undoManager.off("stack-item-added", this._onStackItemAdded), this._undoManager.off("stack-item-popped", this._onStackItemPopped), this._undoManager.removeTrackedOrigin(this.syncConf); } } -const UCe = Jr.fromClass(QCe), VCe = ({ state: t, dispatch: e }) => t.facet(ET).undo() || !0, qCe = ({ state: t, dispatch: e }) => t.facet(ET).redo() || !0, YCe = (t, e, { undoManager: r = new lD(t) } = {}) => { - const n = new RCe(t, e), i = [ - kx.of(n), - DCe +const MEe = hn.fromClass(REe), DEe = ({ state: t, dispatch: e }) => t.facet(eC).undo() || !0, PEe = ({ state: t, dispatch: e }) => t.facet(eC).redo() || !0, NEe = (t, e, { undoManager: r = new $D(t) } = {}) => { + const n = new wEe(t, e), i = [ + Gx.of(n), + kEe ]; return e && i.push( - PCe, - BCe + SEe, + _Ee ), r !== !1 && i.push( - ET.of(new zCe(r)), - UCe, - ft.domEventHandlers({ + eC.of(new LEe(r)), + MEe, + kt.domEventHandlers({ beforeinput(s, a) { - return s.inputType === "historyUndo" ? VCe(a) : s.inputType === "historyRedo" ? qCe(a) : !1; + return s.inputType === "historyUndo" ? DEe(a) : s.inputType === "historyRedo" ? PEe(a) : !1; } }) ), i; }; -class mk { +class Vk { static create(e, r, n, i, s) { let a = i + (i << 8) + e + (r << 4) | 0; - return new mk(e, r, n, a, s, [], []); + return new Vk(e, r, n, a, s, [], []); } constructor(e, r, n, i, s, a, o) { - this.type = e, this.value = r, this.from = n, this.hash = i, this.end = s, this.children = a, this.positions = o, this.hashProp = [[or.contextHash, i]]; + this.type = e, this.value = r, this.from = n, this.hash = i, this.end = s, this.children = a, this.positions = o, this.hashProp = [[yr.contextHash, i]]; } addChild(e, r) { - e.prop(or.contextHash) != this.hash && (e = new Yr(e.type, e.children, e.positions, e.length, this.hashProp)), this.children.push(e), this.positions.push(r); + e.prop(yr.contextHash) != this.hash && (e = new nn(e.type, e.children, e.positions, e.length, this.hashProp)), this.children.push(e), this.positions.push(r); } toTree(e, r = this.end) { let n = this.children.length - 1; - return n >= 0 && (r = Math.max(r, this.positions[n] + this.children[n].length + this.from)), new Yr(e.types[this.type], this.children, this.positions, r - this.from).balance({ - makeTree: (i, s, a) => new Yr(Mi.none, i, s, a, this.hashProp) + return n >= 0 && (r = Math.max(r, this.positions[n] + this.children[n].length + this.from)), new nn(e.types[this.type], this.children, this.positions, r - this.from).balance({ + makeTree: (i, s, a) => new nn(Yi.none, i, s, a, this.hashProp) }); } } -var vt; +var Tt; (function(t) { t[t.Document = 1] = "Document", t[t.CodeBlock = 2] = "CodeBlock", t[t.FencedCode = 3] = "FencedCode", t[t.Blockquote = 4] = "Blockquote", t[t.HorizontalRule = 5] = "HorizontalRule", t[t.BulletList = 6] = "BulletList", t[t.OrderedList = 7] = "OrderedList", t[t.ListItem = 8] = "ListItem", t[t.ATXHeading1 = 9] = "ATXHeading1", t[t.ATXHeading2 = 10] = "ATXHeading2", t[t.ATXHeading3 = 11] = "ATXHeading3", t[t.ATXHeading4 = 12] = "ATXHeading4", t[t.ATXHeading5 = 13] = "ATXHeading5", t[t.ATXHeading6 = 14] = "ATXHeading6", t[t.SetextHeading1 = 15] = "SetextHeading1", t[t.SetextHeading2 = 16] = "SetextHeading2", t[t.HTMLBlock = 17] = "HTMLBlock", t[t.LinkReference = 18] = "LinkReference", t[t.Paragraph = 19] = "Paragraph", t[t.CommentBlock = 20] = "CommentBlock", t[t.ProcessingInstructionBlock = 21] = "ProcessingInstructionBlock", t[t.Escape = 22] = "Escape", t[t.Entity = 23] = "Entity", t[t.HardBreak = 24] = "HardBreak", t[t.Emphasis = 25] = "Emphasis", t[t.StrongEmphasis = 26] = "StrongEmphasis", t[t.Link = 27] = "Link", t[t.Image = 28] = "Image", t[t.InlineCode = 29] = "InlineCode", t[t.HTMLTag = 30] = "HTMLTag", t[t.Comment = 31] = "Comment", t[t.ProcessingInstruction = 32] = "ProcessingInstruction", t[t.URL = 33] = "URL", t[t.HeaderMark = 34] = "HeaderMark", t[t.QuoteMark = 35] = "QuoteMark", t[t.ListMark = 36] = "ListMark", t[t.LinkMark = 37] = "LinkMark", t[t.EmphasisMark = 38] = "EmphasisMark", t[t.CodeMark = 39] = "CodeMark", t[t.CodeText = 40] = "CodeText", t[t.CodeInfo = 41] = "CodeInfo", t[t.LinkTitle = 42] = "LinkTitle", t[t.LinkLabel = 43] = "LinkLabel"; -})(vt || (vt = {})); -class WCe { +})(Tt || (Tt = {})); +class IEe { constructor(e, r) { this.start = e, this.content = r, this.marks = [], this.parsers = []; } } -class GCe { +class $Ee { constructor() { this.text = "", this.baseIndent = 0, this.basePos = 0, this.depth = 0, this.markers = [], this.pos = 0, this.indent = 0, this.next = -1; } @@ -19970,7 +19970,7 @@ class GCe { this.indent = this.countIndent(e, this.pos, this.indent), this.pos = e, this.next = e == this.text.length ? -1 : this.text.charCodeAt(e); } skipSpace(e) { - return py(this.text, e); + return By(this.text, e); } reset(e) { for (this.text = e, this.baseIndent = this.basePos = this.pos = this.indent = 0, this.forwardInner(), this.depth = 1; this.markers.length; ) @@ -20005,41 +20005,41 @@ class GCe { return e + this.text.slice(this.basePos); } } -function Wz(t, e, r) { +function EQ(t, e, r) { if (r.pos == r.text.length || t != e.block && r.indent >= e.stack[r.depth + 1].value + r.baseIndent) return !0; if (r.indent >= r.baseIndent + 4) return !1; - let n = (t.type == vt.OrderedList ? xD : bD)(r, e, !1); - return n > 0 && (t.type != vt.BulletList || yD(r, e, !1) < 0) && r.text.charCodeAt(r.pos + n - 1) == t.value; + let n = (t.type == Tt.OrderedList ? HD : XD)(r, e, !1); + return n > 0 && (t.type != Tt.BulletList || GD(r, e, !1) < 0) && r.text.charCodeAt(r.pos + n - 1) == t.value; } -const Vte = { - [vt.Blockquote](t, e, r) { - return r.next != 62 ? !1 : (r.markers.push(Ir(vt.QuoteMark, e.lineStart + r.pos, e.lineStart + r.pos + 1)), r.moveBase(r.pos + (ol(r.text.charCodeAt(r.pos + 1)) ? 2 : 1)), t.end = e.lineStart + r.text.length, !0); +const Sre = { + [Tt.Blockquote](t, e, r) { + return r.next != 62 ? !1 : (r.markers.push(Xr(Tt.QuoteMark, e.lineStart + r.pos, e.lineStart + r.pos + 1)), r.moveBase(r.pos + (Sl(r.text.charCodeAt(r.pos + 1)) ? 2 : 1)), t.end = e.lineStart + r.text.length, !0); }, - [vt.ListItem](t, e, r) { + [Tt.ListItem](t, e, r) { return r.indent < r.baseIndent + t.value && r.next > -1 ? !1 : (r.moveBaseColumn(r.baseIndent + t.value), !0); }, - [vt.OrderedList]: Wz, - [vt.BulletList]: Wz, - [vt.Document]() { + [Tt.OrderedList]: EQ, + [Tt.BulletList]: EQ, + [Tt.Document]() { return !0; } }; -function ol(t) { +function Sl(t) { return t == 32 || t == 9 || t == 10 || t == 13; } -function py(t, e = 0) { - for (; e < t.length && ol(t.charCodeAt(e)); ) +function By(t, e = 0) { + for (; e < t.length && Sl(t.charCodeAt(e)); ) e++; return e; } -function Gz(t, e, r) { - for (; e > r && ol(t.charCodeAt(e - 1)); ) +function _Q(t, e, r) { + for (; e > r && Sl(t.charCodeAt(e - 1)); ) e--; return e; } -function qte(t) { +function Tre(t) { if (t.next != 96 && t.next != 126) return -1; let e = t.pos + 1; @@ -20054,10 +20054,10 @@ function qte(t) { } return e; } -function Yte(t) { +function Cre(t) { return t.next != 62 ? -1 : t.text.charCodeAt(t.pos + 1) == 32 ? 2 : 1; } -function yD(t, e, r) { +function GD(t, e, r) { if (t.next != 42 && t.next != 45 && t.next != 95) return -1; let n = 1; @@ -20065,21 +20065,21 @@ function yD(t, e, r) { let s = t.text.charCodeAt(i); if (s == t.next) n++; - else if (!ol(s)) + else if (!Sl(s)) return -1; } - return r && t.next == 45 && Xte(t) > -1 && t.depth == e.stack.length || n < 3 ? -1 : 1; + return r && t.next == 45 && Are(t) > -1 && t.depth == e.stack.length || n < 3 ? -1 : 1; } -function Wte(t, e) { +function Ere(t, e) { for (let r = t.stack.length - 1; r >= 0; r--) if (t.stack[r].type == e) return !0; return !1; } -function bD(t, e, r) { - return (t.next == 45 || t.next == 43 || t.next == 42) && (t.pos == t.text.length - 1 || ol(t.text.charCodeAt(t.pos + 1))) && (!r || Wte(e, vt.BulletList) || t.skipSpace(t.pos + 2) < t.text.length) ? 1 : -1; +function XD(t, e, r) { + return (t.next == 45 || t.next == 43 || t.next == 42) && (t.pos == t.text.length - 1 || Sl(t.text.charCodeAt(t.pos + 1))) && (!r || Ere(e, Tt.BulletList) || t.skipSpace(t.pos + 2) < t.text.length) ? 1 : -1; } -function xD(t, e, r) { +function HD(t, e, r) { let n = t.pos, i = t.next; for (; i >= 48 && i <= 57; ) { n++; @@ -20087,9 +20087,9 @@ function xD(t, e, r) { return -1; i = t.text.charCodeAt(n); } - return n == t.pos || n > t.pos + 9 || i != 46 && i != 41 || n < t.text.length - 1 && !ol(t.text.charCodeAt(n + 1)) || r && !Wte(e, vt.OrderedList) && (t.skipSpace(n + 1) == t.text.length || n > t.pos + 1 || t.next != 49) ? -1 : n + 1 - t.pos; + return n == t.pos || n > t.pos + 9 || i != 46 && i != 41 || n < t.text.length - 1 && !Sl(t.text.charCodeAt(n + 1)) || r && !Ere(e, Tt.OrderedList) && (t.skipSpace(n + 1) == t.text.length || n > t.pos + 1 || t.next != 49) ? -1 : n + 1 - t.pos; } -function Gte(t) { +function _re(t) { if (t.next != 35) return -1; let e = t.pos + 1; @@ -20100,53 +20100,53 @@ function Gte(t) { let r = e - t.pos; return r > 6 ? -1 : r; } -function Xte(t) { +function Are(t) { if (t.next != 45 && t.next != 61 || t.indent >= t.baseIndent + 4) return -1; let e = t.pos + 1; for (; e < t.text.length && t.text.charCodeAt(e) == t.next; ) e++; let r = e; - for (; e < t.text.length && ol(t.text.charCodeAt(e)); ) + for (; e < t.text.length && Sl(t.text.charCodeAt(e)); ) e++; return e == t.text.length ? r : -1; } -const y8 = /^[ \t]*$/, Hte = /-->/, Zte = /\?>/, b8 = [ +const G8 = /^[ \t]*$/, Lre = /-->/, Rre = /\?>/, X8 = [ [/^<(?:script|pre|style)(?:\s|>|$)/i, /<\/(?:script|pre|style)>/i], - [/^\s*/i.exec(n); if (s) - return t.append(Ir(vt.Comment, r, r + 1 + s[0].length)); + return t.append(Xr(Tt.Comment, r, r + 1 + s[0].length)); let a = /^\?[^]*?\?>/.exec(n); if (a) - return t.append(Ir(vt.ProcessingInstruction, r, r + 1 + a[0].length)); + return t.append(Xr(Tt.ProcessingInstruction, r, r + 1 + a[0].length)); let o = /^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(n); - return o ? t.append(Ir(vt.HTMLTag, r, r + 1 + o[0].length)) : -1; + return o ? t.append(Xr(Tt.HTMLTag, r, r + 1 + o[0].length)) : -1; }, Emphasis(t, e, r) { if (e != 95 && e != 42) @@ -20776,40 +20776,40 @@ const v6 = { let n = r + 1; for (; t.char(n) == e; ) n++; - let i = t.slice(r - 1, r), s = t.slice(n, n + 1), a = g2.test(i), o = g2.test(s), l = /\s|^$/.test(i), u = /\s|^$/.test(s), h = !u && (!o || l || a), f = !l && (!a || u || o), d = h && (e == 42 || !f || a), p = f && (e == 42 || !h || o); - return t.append(new bl(e == 95 ? rre : nre, r, n, (d ? 1 : 0) | (p ? 2 : 0))); + let i = t.slice(r - 1, r), s = t.slice(n, n + 1), a = F2.test(i), o = F2.test(s), l = /\s|^$/.test(i), u = /\s|^$/.test(s), h = !u && (!o || l || a), f = !l && (!a || u || o), d = h && (e == 42 || !f || a), p = f && (e == 42 || !h || o); + return t.append(new $l(e == 95 ? $re : Bre, r, n, (d ? 1 : 0) | (p ? 2 : 0))); }, HardBreak(t, e, r) { if (e == 92 && t.char(r + 1) == 10) - return t.append(Ir(vt.HardBreak, r, r + 2)); + return t.append(Xr(Tt.HardBreak, r, r + 2)); if (e == 32) { let n = r + 1; for (; t.char(n) == 32; ) n++; if (t.char(n) == 10 && n >= r + 2) - return t.append(Ir(vt.HardBreak, r, n + 1)); + return t.append(Xr(Tt.HardBreak, r, n + 1)); } return -1; }, Link(t, e, r) { - return e == 91 ? t.append(new bl(j1, r, r + 1, 1)) : -1; + return e == 91 ? t.append(new $l(wv, r, r + 1, 1)) : -1; }, Image(t, e, r) { - return e == 33 && t.char(r + 1) == 91 ? t.append(new bl(Hz, r, r + 2, 1)) : -1; + return e == 33 && t.char(r + 1) == 91 ? t.append(new $l(LQ, r, r + 2, 1)) : -1; }, LinkEnd(t, e, r) { if (e != 93) return -1; for (let n = t.parts.length - 1; n >= 0; n--) { let i = t.parts[n]; - if (i instanceof bl && (i.type == j1 || i.type == Hz)) { + if (i instanceof $l && (i.type == wv || i.type == LQ)) { if (!i.side || t.skipSpace(i.to) == r && !/[(\[]/.test(t.slice(r + 1, r + 2))) return t.parts[n] = null, -1; - let s = t.takeContent(n), a = t.parts[n] = eEe(t, s, i.type == j1 ? vt.Link : vt.Image, i.from, r + 1); - if (i.type == j1) + let s = t.takeContent(n), a = t.parts[n] = qEe(t, s, i.type == wv ? Tt.Link : Tt.Image, i.from, r + 1); + if (i.type == wv) for (let o = 0; o < n; o++) { let l = t.parts[o]; - l instanceof bl && l.type == j1 && (l.side = 0); + l instanceof $l && l.type == wv && (l.side = 0); } return a.to; } @@ -20817,23 +20817,23 @@ const v6 = { return -1; } }; -function eEe(t, e, r, n, i) { +function qEe(t, e, r, n, i) { let { text: s } = t, a = t.char(i), o = i; - if (e.unshift(Ir(vt.LinkMark, n, n + (r == vt.Image ? 2 : 1))), e.push(Ir(vt.LinkMark, i - 1, i)), a == 40) { - let l = t.skipSpace(i + 1), u = ire(s, l - t.offset, t.offset), h; - u && (l = t.skipSpace(u.to), h = sre(s, l - t.offset, t.offset), h && (l = t.skipSpace(h.to))), t.char(l) == 41 && (e.push(Ir(vt.LinkMark, i, i + 1)), o = l + 1, u && e.push(u), h && e.push(h), e.push(Ir(vt.LinkMark, l, o))); + if (e.unshift(Xr(Tt.LinkMark, n, n + (r == Tt.Image ? 2 : 1))), e.push(Xr(Tt.LinkMark, i - 1, i)), a == 40) { + let l = t.skipSpace(i + 1), u = Fre(s, l - t.offset, t.offset), h; + u && (l = t.skipSpace(u.to), h = zre(s, l - t.offset, t.offset), h && (l = t.skipSpace(h.to))), t.char(l) == 41 && (e.push(Xr(Tt.LinkMark, i, i + 1)), o = l + 1, u && e.push(u), h && e.push(h), e.push(Xr(Tt.LinkMark, l, o))); } else if (a == 91) { - let l = are(s, i - t.offset, t.offset, !1); + let l = Qre(s, i - t.offset, t.offset, !1); l && (e.push(l), o = l.to); } - return Ir(r, n, o, e); + return Xr(r, n, o, e); } -function ire(t, e, r) { +function Fre(t, e, r) { if (t.charCodeAt(e) == 60) { for (let i = e + 1; i < t.length; i++) { let s = t.charCodeAt(i); if (s == 62) - return Ir(vt.URL, e + r, i + 1 + r); + return Xr(Tt.URL, e + r, i + 1 + r); if (s == 60 || s == 10) return !1; } @@ -20842,7 +20842,7 @@ function ire(t, e, r) { let i = 0, s = e; for (let a = !1; s < t.length; s++) { let o = t.charCodeAt(s); - if (ol(o)) + if (Sl(o)) break; if (a) a = !1; @@ -20855,10 +20855,10 @@ function ire(t, e, r) { } else o == 92 && (a = !0); } - return s > e ? Ir(vt.URL, e + r, s + r) : s == t.length ? null : !1; + return s > e ? Xr(Tt.URL, e + r, s + r) : s == t.length ? null : !1; } } -function sre(t, e, r) { +function zre(t, e, r) { let n = t.charCodeAt(e); if (n != 39 && n != 34 && n != 40) return !1; @@ -20869,28 +20869,28 @@ function sre(t, e, r) { a = !1; else { if (o == i) - return Ir(vt.LinkTitle, e + r, s + 1 + r); + return Xr(Tt.LinkTitle, e + r, s + 1 + r); o == 92 && (a = !0); } } return null; } -function are(t, e, r, n) { +function Qre(t, e, r, n) { for (let i = !1, s = e + 1, a = Math.min(t.length, s + 999); s < a; s++) { let o = t.charCodeAt(s); if (i) i = !1; else { if (o == 93) - return n ? !1 : Ir(vt.LinkLabel, e + r, s + 1 + r); - if (n && !ol(o) && (n = !1), o == 91) + return n ? !1 : Xr(Tt.LinkLabel, e + r, s + 1 + r); + if (n && !Sl(o) && (n = !1), o == 91) return !1; o == 92 && (i = !0); } } return null; } -class tEe { +class YEe { constructor(e, r, n) { this.parser = e, this.text = r, this.offset = n, this.parts = []; } @@ -20907,7 +20907,7 @@ class tEe { return this.parts.push(e), e.to; } addDelimiter(e, r, n, i, s) { - return this.append(new bl(e, r, n, (i ? 1 : 0) | (s ? 2 : 0))); + return this.append(new $l(e, r, n, (i ? 1 : 0) | (s ? 2 : 0))); } addElement(e) { return this.append(e); @@ -20915,12 +20915,12 @@ class tEe { resolveMarkers(e) { for (let n = e; n < this.parts.length; n++) { let i = this.parts[n]; - if (!(i instanceof bl && i.type.resolve && i.side & 2)) + if (!(i instanceof $l && i.type.resolve && i.side & 2)) continue; - let s = i.type == rre || i.type == nre, a = i.to - i.from, o, l = n - 1; + let s = i.type == $re || i.type == Bre, a = i.to - i.from, o, l = n - 1; for (; l >= e; l--) { let m = this.parts[l]; - if (m instanceof bl && m.side & 1 && m.type == i.type && !(s && (i.side & 1 || m.side & 2) && (m.to - m.from + a) % 3 == 0 && ((m.to - m.from) % 3 || a % 3))) { + if (m instanceof $l && m.side & 1 && m.type == i.type && !(s && (i.side & 1 || m.side & 2) && (m.to - m.from + a) % 3 == 0 && ((m.to - m.from) % 3 || a % 3))) { o = m; break; } @@ -20934,22 +20934,22 @@ class tEe { } o.type.mark && h.push(this.elt(o.type.mark, f, o.to)); for (let m = l + 1; m < n; m++) - this.parts[m] instanceof p2 && h.push(this.parts[m]), this.parts[m] = null; + this.parts[m] instanceof B2 && h.push(this.parts[m]), this.parts[m] = null; i.type.mark && h.push(this.elt(i.type.mark, i.from, d)); let p = this.elt(u, f, d, h); - this.parts[l] = s && o.from != f ? new bl(o.type, o.from, f, o.side) : null, (this.parts[n] = s && i.to != d ? new bl(i.type, d, i.to, i.side) : null) ? this.parts.splice(n, 0, p) : this.parts[n] = p; + this.parts[l] = s && o.from != f ? new $l(o.type, o.from, f, o.side) : null, (this.parts[n] = s && i.to != d ? new $l(i.type, d, i.to, i.side) : null) ? this.parts.splice(n, 0, p) : this.parts[n] = p; } let r = []; for (let n = e; n < this.parts.length; n++) { let i = this.parts[n]; - i instanceof p2 && r.push(i); + i instanceof B2 && r.push(i); } return r; } findOpeningDelimiter(e) { for (let r = this.parts.length - 1; r >= 0; r--) { let n = this.parts[r]; - if (n instanceof bl && n.type == e) + if (n instanceof $l && n.type == e) return r; } return null; @@ -20959,13 +20959,13 @@ class tEe { return this.parts.length = e, r; } skipSpace(e) { - return py(this.text, e - this.offset) + this.offset; + return By(this.text, e - this.offset) + this.offset; } elt(e, r, n, i) { - return typeof e == "string" ? Ir(this.parser.getNodeType(e), r, n, i) : new tre(e, r); + return typeof e == "string" ? Xr(this.parser.getNodeType(e), r, n, i) : new Ire(e, r); } } -function w8(t, e) { +function Z8(t, e) { if (!e.length) return t; if (!t.length) @@ -20976,14 +20976,14 @@ function w8(t, e) { n++; if (n < r.length && r[n].from < i.from) { let s = r[n]; - s instanceof p2 && (r[n] = new p2(s.type, s.from, s.to, w8(s.children, [i]))); + s instanceof B2 && (r[n] = new B2(s.type, s.from, s.to, Z8(s.children, [i]))); } else r.splice(n++, 0, i); } return r; } -const rEe = [vt.CodeBlock, vt.ListItem, vt.OrderedList, vt.BulletList]; -class nEe { +const WEe = [Tt.CodeBlock, Tt.ListItem, Tt.OrderedList, Tt.BulletList]; +class GEe { constructor(e, r) { this.fragments = e, this.input = r, this.i = 0, this.fragment = null, this.fragmentEnd = -1, this.cursor = null, e.length && (this.fragment = e[this.i++]); } @@ -21017,7 +21017,7 @@ class nEe { } matches(e) { let r = this.cursor.tree; - return r && r.prop(or.contextHash) == e; + return r && r.prop(yr.contextHash) == e; } takeNodes(e) { let r = this.cursor, n = this.fragment.offset, i = this.fragmentEnd - (this.fragment.openEnd ? 1 : 0), s = e.absoluteLineStart, a = s, o = e.block.children.length, l = a, u = o; @@ -21027,14 +21027,14 @@ class nEe { continue; break; } - let h = ore(r.from - n, e.ranges); + let h = Ure(r.from - n, e.ranges); if (r.to - n <= e.ranges[e.rangeI].to) e.addNode(r.tree, h); else { - let f = new Yr(e.parser.nodeSet.types[vt.Paragraph], [], [], 0, e.block.hashProp); + let f = new nn(e.parser.nodeSet.types[Tt.Paragraph], [], [], 0, e.block.hashProp); e.reusePlaceholders.set(f, r.tree), e.addNode(f, h); } - if (r.type.is("Block") && (rEe.indexOf(r.type.id) < 0 ? (a = r.to - n, o = e.block.children.length) : (a = l, o = u, l = r.to - n, u = e.block.children.length)), !r.nextSibling()) + if (r.type.is("Block") && (WEe.indexOf(r.type.id) < 0 ? (a = r.to - n, o = e.block.children.length) : (a = l, o = u, l = r.to - n, u = e.block.children.length)), !r.nextSibling()) break; } for (; e.block.children.length > o; ) @@ -21042,7 +21042,7 @@ class nEe { return a - s; } } -function ore(t, e) { +function Ure(t, e) { let r = t; for (let n = 1; n < e.length; n++) { let i = e[n - 1].to, s = e[n].from; @@ -21050,31 +21050,31 @@ function ore(t, e) { } return r; } -const iEe = Xf({ - "Blockquote/...": we.quote, - HorizontalRule: we.contentSeparator, - "ATXHeading1/... SetextHeading1/...": we.heading1, - "ATXHeading2/... SetextHeading2/...": we.heading2, - "ATXHeading3/...": we.heading3, - "ATXHeading4/...": we.heading4, - "ATXHeading5/...": we.heading5, - "ATXHeading6/...": we.heading6, - "Comment CommentBlock": we.comment, - Escape: we.escape, - Entity: we.character, - "Emphasis/...": we.emphasis, - "StrongEmphasis/...": we.strong, - "Link/... Image/...": we.link, - "OrderedList/... BulletList/...": we.list, - "BlockQuote/...": we.quote, - "InlineCode CodeText": we.monospace, - URL: we.url, - "HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark": we.processingInstruction, - "CodeInfo LinkLabel": we.labelName, - LinkTitle: we.string, - Paragraph: we.content -}), sEe = new _T(new dx(Jte).extend(iEe), Object.keys(nO).map((t) => nO[t]), Object.keys(nO).map((t) => ZCe[t]), Object.keys(nO), jCe, Vte, Object.keys(v6).map((t) => v6[t]), Object.keys(v6), []); -function aEe(t, e, r) { +const XEe = fd({ + "Blockquote/...": Se.quote, + HorizontalRule: Se.contentSeparator, + "ATXHeading1/... SetextHeading1/...": Se.heading1, + "ATXHeading2/... SetextHeading2/...": Se.heading2, + "ATXHeading3/...": Se.heading3, + "ATXHeading4/...": Se.heading4, + "ATXHeading5/...": Se.heading5, + "ATXHeading6/...": Se.heading6, + "Comment CommentBlock": Se.comment, + Escape: Se.escape, + Entity: Se.character, + "Emphasis/...": Se.emphasis, + "StrongEmphasis/...": Se.strong, + "Link/... Image/...": Se.link, + "OrderedList/... BulletList/...": Se.list, + "BlockQuote/...": Se.quote, + "InlineCode CodeText": Se.monospace, + URL: Se.url, + "HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark": Se.processingInstruction, + "CodeInfo LinkLabel": Se.labelName, + LinkTitle: Se.string, + Paragraph: Se.content +}), HEe = new tC(new $x(Pre).extend(XEe), Object.keys(LO).map((t) => LO[t]), Object.keys(LO).map((t) => zEe[t]), Object.keys(LO), QEe, Sre, Object.keys(W_).map((t) => W_[t]), Object.keys(W_), []); +function ZEe(t, e, r) { let n = []; for (let i = t.firstChild, s = e; ; i = i.nextSibling) { let a = i ? i.from : r; @@ -21084,44 +21084,44 @@ function aEe(t, e, r) { } return n; } -function oEe(t) { +function jEe(t) { let { codeParser: e, htmlParser: r } = t; - return { wrap: pJ((i, s) => { + return { wrap: HJ((i, s) => { let a = i.type.id; - if (e && (a == vt.CodeBlock || a == vt.FencedCode)) { + if (e && (a == Tt.CodeBlock || a == Tt.FencedCode)) { let o = ""; - if (a == vt.FencedCode) { - let u = i.node.getChild(vt.CodeInfo); + if (a == Tt.FencedCode) { + let u = i.node.getChild(Tt.CodeInfo); u && (o = s.read(u.from, u.to)); } let l = e(o); if (l) - return { parser: l, overlay: (u) => u.type.id == vt.CodeText }; - } else if (r && (a == vt.HTMLBlock || a == vt.HTMLTag)) - return { parser: r, overlay: aEe(i.node, i.from, i.to) }; + return { parser: l, overlay: (u) => u.type.id == Tt.CodeText }; + } else if (r && (a == Tt.HTMLBlock || a == Tt.HTMLTag)) + return { parser: r, overlay: ZEe(i.node, i.from, i.to) }; return null; }) }; } -const lEe = { resolve: "Strikethrough", mark: "StrikethroughMark" }, cEe = { +const KEe = { resolve: "Strikethrough", mark: "StrikethroughMark" }, JEe = { defineNodes: [{ name: "Strikethrough", - style: { "Strikethrough/...": we.strikethrough } + style: { "Strikethrough/...": Se.strikethrough } }, { name: "StrikethroughMark", - style: we.processingInstruction + style: Se.processingInstruction }], parseInline: [{ name: "Strikethrough", parse(t, e, r) { if (e != 126 || t.char(r + 1) != 126 || t.char(r + 2) == 126) return -1; - let n = t.slice(r - 1, r), i = t.slice(r + 2, r + 3), s = /\s|^$/.test(n), a = /\s|^$/.test(i), o = g2.test(n), l = g2.test(i); - return t.addDelimiter(lEe, r, r + 2, !a && (!l || s || o), !s && (!o || a || l)); + let n = t.slice(r - 1, r), i = t.slice(r + 2, r + 3), s = /\s|^$/.test(n), a = /\s|^$/.test(i), o = F2.test(n), l = F2.test(i); + return t.addDelimiter(KEe, r, r + 2, !a && (!l || s || o), !s && (!o || a || l)); }, after: "Emphasis" }] }; -function gy(t, e, r = 0, n, i = 0) { +function Fy(t, e, r = 0, n, i = 0) { let s = 0, a = !0, o = -1, l = -1, u = !1, h = () => { n.push(t.elt("TableCell", i + o, i + l, t.parser.parseInline(e.slice(o, l), i + o))); }; @@ -21131,7 +21131,7 @@ function gy(t, e, r = 0, n, i = 0) { } return o > -1 && (s++, n && h()), s; } -function jz(t, e) { +function MQ(t, e) { for (let r = e; r < t.length; r++) { let n = t.charCodeAt(r); if (n == 124) @@ -21140,8 +21140,8 @@ function jz(t, e) { } return !1; } -const lre = /^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/; -class Kz { +const Vre = /^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/; +class DQ { constructor() { this.rows = null; } @@ -21149,16 +21149,16 @@ class Kz { if (this.rows == null) { this.rows = !1; let i; - if ((r.next == 45 || r.next == 58 || r.next == 124) && lre.test(i = r.text.slice(r.pos))) { + if ((r.next == 45 || r.next == 58 || r.next == 124) && Vre.test(i = r.text.slice(r.pos))) { let s = []; - gy(e, n.content, 0, s, n.start) == gy(e, i, r.pos) && (this.rows = [ + Fy(e, n.content, 0, s, n.start) == Fy(e, i, r.pos) && (this.rows = [ e.elt("TableHeader", n.start, n.start + n.content.length, s), e.elt("TableDelimiter", e.lineStart + r.pos, e.lineStart + r.text.length) ]); } } else if (this.rows) { let i = []; - gy(e, r.text, r.pos, i, e.lineStart), this.rows.push(e.elt("TableRow", e.lineStart + r.pos, e.lineStart + r.text.length, i)); + Fy(e, r.text, r.pos, i, e.lineStart), this.rows.push(e.elt("TableRow", e.lineStart + r.pos, e.lineStart + r.text.length, i)); } return !1; } @@ -21166,29 +21166,29 @@ class Kz { return this.rows ? (e.addLeafElement(r, e.elt("Table", r.start, r.start + r.content.length, this.rows)), !0) : !1; } } -const uEe = { +const e_e = { defineNodes: [ { name: "Table", block: !0 }, - { name: "TableHeader", style: { "TableHeader/...": we.heading } }, + { name: "TableHeader", style: { "TableHeader/...": Se.heading } }, "TableRow", - { name: "TableCell", style: we.content }, - { name: "TableDelimiter", style: we.processingInstruction } + { name: "TableCell", style: Se.content }, + { name: "TableDelimiter", style: Se.processingInstruction } ], parseBlock: [{ name: "Table", leaf(t, e) { - return jz(e.content, 0) ? new Kz() : null; + return MQ(e.content, 0) ? new DQ() : null; }, endLeaf(t, e, r) { - if (r.parsers.some((i) => i instanceof Kz) || !jz(e.text, e.basePos)) + if (r.parsers.some((i) => i instanceof DQ) || !MQ(e.text, e.basePos)) return !1; let n = t.scanLine(t.absoluteLineEnd + 1).text; - return lre.test(n) && gy(t, e.text, e.basePos) == gy(t, n, e.basePos); + return Vre.test(n) && Fy(t, e.text, e.basePos) == Fy(t, n, e.basePos); }, before: "SetextHeading" }] }; -class hEe { +class t_e { nextLine() { return !1; } @@ -21199,34 +21199,34 @@ class hEe { ])), !0; } } -const fEe = { +const r_e = { defineNodes: [ - { name: "Task", block: !0, style: we.list }, - { name: "TaskMarker", style: we.atom } + { name: "Task", block: !0, style: Se.list }, + { name: "TaskMarker", style: Se.atom } ], parseBlock: [{ name: "TaskList", leaf(t, e) { - return /^\[[ xX]\][ \t]/.test(e.content) && t.parentType().name == "ListItem" ? new hEe() : null; + return /^\[[ xX]\][ \t]/.test(e.content) && t.parentType().name == "ListItem" ? new t_e() : null; }, after: "SetextHeading" }] -}, Jz = /(www\.)|(https?:\/\/)|([\w.+-]+@)|(mailto:|xmpp:)/gy, eQ = /[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy, dEe = /[\w-]+\.[\w-]+($|\/)/, tQ = /[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy, rQ = /\/[a-zA-Z\d@.]+/gy; -function nQ(t, e, r, n) { +}, PQ = /(www\.)|(https?:\/\/)|([\w.+-]+@)|(mailto:|xmpp:)/gy, NQ = /[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy, n_e = /[\w-]+\.[\w-]+($|\/)/, IQ = /[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy, $Q = /\/[a-zA-Z\d@.]+/gy; +function BQ(t, e, r, n) { let i = 0; for (let s = e; s < r; s++) t[s] == n && i++; return i; } -function pEe(t, e) { - eQ.lastIndex = e; - let r = eQ.exec(t); - if (!r || dEe.exec(r[0])[0].indexOf("_") > -1) +function i_e(t, e) { + NQ.lastIndex = e; + let r = NQ.exec(t); + if (!r || n_e.exec(r[0])[0].indexOf("_") > -1) return -1; let n = e + r[0].length; for (; ; ) { let i = t[n - 1], s; - if (/[?!.,:*_~]/.test(i) || i == ")" && nQ(t, e, n, ")") > nQ(t, e, n, "(")) + if (/[?!.,:*_~]/.test(i) || i == ")" && BQ(t, e, n, ")") > BQ(t, e, n, "(")) n--; else if (i == ";" && (s = /&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(e, n)))) n = e + s.index; @@ -21235,26 +21235,26 @@ function pEe(t, e) { } return n; } -function iQ(t, e) { - tQ.lastIndex = e; - let r = tQ.exec(t); +function FQ(t, e) { + IQ.lastIndex = e; + let r = IQ.exec(t); if (!r) return -1; let n = r[0][r[0].length - 1]; return n == "_" || n == "-" ? -1 : e + r[0].length - (n == "." ? 1 : 0); } -const gEe = { +const s_e = { parseInline: [{ name: "Autolink", parse(t, e, r) { let n = r - t.offset; - Jz.lastIndex = n; - let i = Jz.exec(t.text), s = -1; - return !i || (i[1] || i[2] ? s = pEe(t.text, n + i[0].length) : i[3] ? s = iQ(t.text, n) : (s = iQ(t.text, n + i[0].length), s > -1 && i[0] == "xmpp:" && (rQ.lastIndex = s, i = rQ.exec(t.text), i && (s = i.index + i[0].length))), s < 0) ? -1 : (t.addElement(t.elt("URL", r, s + t.offset)), s + t.offset); + PQ.lastIndex = n; + let i = PQ.exec(t.text), s = -1; + return !i || (i[1] || i[2] ? s = i_e(t.text, n + i[0].length) : i[3] ? s = FQ(t.text, n) : (s = FQ(t.text, n + i[0].length), s > -1 && i[0] == "xmpp:" && ($Q.lastIndex = s, i = $Q.exec(t.text), i && (s = i.index + i[0].length))), s < 0) ? -1 : (t.addElement(t.elt("URL", r, s + t.offset)), s + t.offset); } }] -}, mEe = [uEe, fEe, cEe, gEe]; -function cre(t, e, r) { +}, a_e = [e_e, r_e, JEe, s_e]; +function qre(t, e, r) { return (n, i, s) => { if (i != t || n.char(s + 1) == t) return -1; @@ -21263,32 +21263,32 @@ function cre(t, e, r) { let l = n.char(o); if (l == t) return n.addElement(n.elt(e, s, o + 1, a.concat(n.elt(r, o, o + 1)))); - if (l == 92 && a.push(n.elt("Escape", o, o++ + 2)), ol(l)) + if (l == 92 && a.push(n.elt("Escape", o, o++ + 2)), Sl(l)) break; } return -1; }; } -const vEe = { +const o_e = { defineNodes: [ - { name: "Superscript", style: we.special(we.content) }, - { name: "SuperscriptMark", style: we.processingInstruction } + { name: "Superscript", style: Se.special(Se.content) }, + { name: "SuperscriptMark", style: Se.processingInstruction } ], parseInline: [{ name: "Superscript", - parse: cre(94, "Superscript", "SuperscriptMark") + parse: qre(94, "Superscript", "SuperscriptMark") }] -}, yEe = { +}, l_e = { defineNodes: [ - { name: "Subscript", style: we.special(we.content) }, - { name: "SubscriptMark", style: we.processingInstruction } + { name: "Subscript", style: Se.special(Se.content) }, + { name: "SubscriptMark", style: Se.processingInstruction } ], parseInline: [{ name: "Subscript", - parse: cre(126, "Subscript", "SubscriptMark") + parse: qre(126, "Subscript", "SubscriptMark") }] -}, bEe = { - defineNodes: [{ name: "Emoji", style: we.character }], +}, c_e = { + defineNodes: [{ name: "Emoji", style: Se.character }], parseInline: [{ name: "Emoji", parse(t, e, r) { @@ -21297,7 +21297,7 @@ const vEe = { } }] }; -class vk { +class qk { constructor(e, r, n, i, s, a, o, l, u, h = 0, f) { this.p = e, this.stack = r, this.state = n, this.reducePos = i, this.pos = s, this.score = a, this.buffer = o, this.bufferBase = l, this.curContext = u, this.lookAhead = h, this.parent = f; } @@ -21306,7 +21306,7 @@ class vk { } static start(e, r, n = 0) { let i = e.parser.context; - return new vk(e, [], r, n, n, 0, [], 0, i ? new sQ(i, i.start) : null, 0, null); + return new qk(e, [], r, n, n, 0, [], 0, i ? new zQ(i, i.start) : null, 0, null); } get context() { return this.curContext ? this.curContext.context : null; @@ -21395,14 +21395,14 @@ class vk { let n = e.buffer.slice(r), i = e.bufferBase + r; for (; e && i == e.bufferBase; ) e = e.parent; - return new vk(this.p, this.stack.slice(), this.state, this.reducePos, this.pos, this.score, n, i, this.curContext, this.lookAhead, e); + return new qk(this.p, this.stack.slice(), this.state, this.reducePos, this.pos, this.score, n, i, this.curContext, this.lookAhead, e); } recoverByDelete(e, r) { let n = e <= this.p.parser.maxNode; n && this.storeNode(e, this.pos, r, 4), this.storeNode(0, this.pos, r, n ? 8 : 4), this.pos = this.reducePos = r, this.score -= 190; } canShift(e) { - for (let r = new xEe(this); ; ) { + for (let r = new u_e(this); ; ) { let n = this.p.parser.stateSlot(r.state, 4) || this.p.parser.hasAction(r.state, e); if (n == 0) return !1; @@ -21520,7 +21520,7 @@ class vk { } updateContext(e) { if (e != this.curContext.context) { - let r = new sQ(this.curContext.tracker, e); + let r = new zQ(this.curContext.tracker, e); r.hash != this.curContext.hash && this.emitContext(), this.curContext = r; } } @@ -21531,12 +21531,12 @@ class vk { this.curContext && this.curContext.tracker.strict && this.emitContext(), this.lookAhead > 0 && this.emitLookAhead(); } } -class sQ { +class zQ { constructor(e, r) { this.tracker = e, this.context = r, this.hash = e.strict ? e.hash(r) : 0; } } -class xEe { +class u_e { constructor(e) { this.start = e, this.state = e.state, this.stack = e.stack, this.base = this.stack.length; } @@ -21547,12 +21547,12 @@ class xEe { this.state = i; } } -class yk { +class Yk { constructor(e, r, n) { this.stack = e, this.pos = r, this.index = n, this.buffer = e.buffer, this.index == 0 && this.maybeNext(); } static create(e, r = e.bufferBase + e.buffer.length) { - return new yk(e, r, r - e.bufferBase); + return new Yk(e, r, r - e.bufferBase); } maybeNext() { let e = this.stack.parent; @@ -21574,10 +21574,10 @@ class yk { this.index -= 4, this.pos -= 4, this.index == 0 && this.maybeNext(); } fork() { - return new yk(this.stack, this.pos, this.index); + return new Yk(this.stack, this.pos, this.index); } } -function Nv(t, e = Uint16Array) { +function sy(t, e = Uint16Array) { if (typeof t != "string") return t; let r = null; @@ -21599,15 +21599,15 @@ function Nv(t, e = Uint16Array) { } return r; } -class z4 { +class d5 { constructor() { this.start = -1, this.value = -1, this.end = -1, this.extended = -1, this.lookAhead = 0, this.mask = 0, this.context = 0; } } -const aQ = new z4(); -class wEe { +const QQ = new d5(); +class h_e { constructor(e, r) { - this.input = e, this.ranges = r, this.chunk = "", this.chunkOff = 0, this.chunk2 = "", this.chunk2Pos = 0, this.next = -1, this.token = aQ, this.rangeIndex = 0, this.pos = this.chunkPos = r[0].from, this.range = r[0], this.end = r[r.length - 1].to, this.readNext(); + this.input = e, this.ranges = r, this.chunk = "", this.chunkOff = 0, this.chunk2 = "", this.chunk2Pos = 0, this.next = -1, this.token = QQ, this.rangeIndex = 0, this.pos = this.chunkPos = r[0].from, this.range = r[0], this.end = r[r.length - 1].to, this.readNext(); } resolveOffset(e, r) { let n = this.range, i = this.rangeIndex, s = this.pos + e; @@ -21686,7 +21686,7 @@ class wEe { return this.pos = this.chunkPos = this.end, this.range = this.ranges[this.rangeIndex = this.ranges.length - 1], this.chunk = "", this.next = -1; } reset(e, r) { - if (r ? (this.token = r, r.start = e, r.lookAhead = e + 1, r.value = r.extended = -1) : this.token = aQ, this.pos != e) { + if (r ? (this.token = r, r.start = e, r.lookAhead = e + 1, r.value = r.extended = -1) : this.token = QQ, this.pos != e) { if (this.pos = e, e == this.end) return this.setDone(), this; for (; e < this.range.from; ) @@ -21713,25 +21713,25 @@ class wEe { return n; } } -class pg { +class Ng { constructor(e, r) { this.data = e, this.id = r; } token(e, r) { let { parser: n } = r.p; - ure(this.data, e, r, this.id, n.data, n.tokenPrecTable); + Yre(this.data, e, r, this.id, n.data, n.tokenPrecTable); } } -pg.prototype.contextual = pg.prototype.fallback = pg.prototype.extend = !1; -class bk { +Ng.prototype.contextual = Ng.prototype.fallback = Ng.prototype.extend = !1; +class Wk { constructor(e, r, n) { - this.precTable = r, this.elseToken = n, this.data = typeof e == "string" ? Nv(e) : e; + this.precTable = r, this.elseToken = n, this.data = typeof e == "string" ? sy(e) : e; } token(e, r) { let n = e.pos, i = 0; for (; ; ) { let s = e.next < 0, a = e.resolveOffset(1, 1); - if (ure(this.data, e, r, 0, this.data, this.precTable), e.token.value > -1) + if (Yre(this.data, e, r, 0, this.data, this.precTable), e.token.value > -1) break; if (this.elseToken == null) return; @@ -21742,13 +21742,13 @@ class bk { i && (e.reset(n, e.token), e.acceptToken(this.elseToken, i)); } } -bk.prototype.contextual = pg.prototype.fallback = pg.prototype.extend = !1; -class ma { +Wk.prototype.contextual = Ng.prototype.fallback = Ng.prototype.extend = !1; +class Pa { constructor(e, r = {}) { this.token = e, this.contextual = !!r.contextual, this.fallback = !!r.fallback, this.extend = !!r.extend; } } -function ure(t, e, r, n, i, s) { +function Yre(t, e, r, n, i, s) { let a = 0, o = 1 << n, { dialect: l } = r.p.parser; e: for (; (o & t[a]) != 0; ) { @@ -21756,7 +21756,7 @@ function ure(t, e, r, n, i, s) { for (let p = a + 3; p < u; p += 2) if ((t[p + 1] & o) > 0) { let g = t[p]; - if (l.allows(g) && (e.token.value == -1 || e.token.value == g || OEe(g, e.token.value, i, s))) { + if (l.allows(g) && (e.token.value == -1 || e.token.value == g || f_e(g, e.token.value, i, s))) { e.acceptToken(g); break; } @@ -21780,20 +21780,20 @@ function ure(t, e, r, n, i, s) { break; } } -function oQ(t, e, r) { +function UQ(t, e, r) { for (let n = e, i; (i = t[n]) != 65535; n++) if (i == r) return n - e; return -1; } -function OEe(t, e, r, n) { - let i = oQ(r, n, e); - return i < 0 || oQ(r, n, t) < i; +function f_e(t, e, r, n) { + let i = UQ(r, n, e); + return i < 0 || UQ(r, n, t) < i; } -const Ja = typeof process < "u" && {} && /\bparse\b/.test({}.LOG); -let y6 = null; -function lQ(t, e, r) { - let n = t.cursor(hn.IncludeAnonymous); +const vo = typeof process < "u" && {} && /\bparse\b/.test({}.LOG); +let G_ = null; +function VQ(t, e, r) { + let n = t.cursor(Sn.IncludeAnonymous); for (n.moveTo(e); ; ) if (!(r < 0 ? n.childBefore(e) : n.childAfter(e))) for (; ; ) { @@ -21805,14 +21805,14 @@ function lQ(t, e, r) { return r < 0 ? 0 : t.length; } } -class kEe { +class d_e { constructor(e, r) { this.fragments = e, this.nodeSet = r, this.i = 0, this.fragment = null, this.safeFrom = -1, this.safeTo = -1, this.trees = [], this.start = [], this.index = [], this.nextFragment(); } nextFragment() { let e = this.fragment = this.i == this.fragments.length ? null : this.fragments[this.i++]; if (e) { - for (this.safeFrom = e.openStart ? lQ(e.tree, e.from + e.offset, 1) - e.offset : e.from, this.safeTo = e.openEnd ? lQ(e.tree, e.to + e.offset, -1) - e.offset : e.to; this.trees.length; ) + for (this.safeFrom = e.openStart ? VQ(e.tree, e.from + e.offset, 1) - e.offset : e.from, this.safeTo = e.openEnd ? VQ(e.tree, e.to + e.offset, -1) - e.offset : e.to; this.trees.length; ) this.trees.pop(), this.start.pop(), this.index.pop(); this.trees.push(e.tree), this.start.push(-e.offset), this.index.push(0), this.nextStart = this.safeFrom; } else @@ -21837,13 +21837,13 @@ class kEe { let s = n.children[i], a = this.start[r] + n.positions[i]; if (a > e) return this.nextStart = a, null; - if (s instanceof Yr) { + if (s instanceof nn) { if (a == e) { if (a < this.safeFrom) return null; let o = a + s.length; if (o <= this.safeTo) { - let l = s.prop(or.lookAhead); + let l = s.prop(yr.lookAhead); if (!l || o + l < this.fragment.to) return s; } @@ -21854,9 +21854,9 @@ class kEe { } } } -class SEe { +class p_e { constructor(e, r) { - this.stream = r, this.tokens = [], this.mainToken = null, this.actions = [], this.tokens = e.tokenizers.map((n) => new z4()); + this.stream = r, this.tokens = [], this.mainToken = null, this.actions = [], this.tokens = e.tokenizers.map((n) => new d5()); } getActions(e) { let r = 0, n = null, { parser: i } = e.p, { tokenizers: s } = i, a = i.stateSlot(e.state, 3), o = e.curContext ? e.curContext.hash : 0, l = 0; @@ -21872,12 +21872,12 @@ class SEe { } for (; this.actions.length > r; ) this.actions.pop(); - return l && e.setLookAhead(l), !n && e.pos == this.stream.end && (n = new z4(), n.value = e.p.parser.eofTerm, n.start = n.end = e.pos, r = this.addActions(e, n.value, n.end, r)), this.mainToken = n, this.actions; + return l && e.setLookAhead(l), !n && e.pos == this.stream.end && (n = new d5(), n.value = e.p.parser.eofTerm, n.start = n.end = e.pos, r = this.addActions(e, n.value, n.end, r)), this.mainToken = n, this.actions; } getMainToken(e) { if (this.mainToken) return this.mainToken; - let r = new z4(), { pos: n, p: i } = e; + let r = new d5(), { pos: n, p: i } = e; return r.start = n, r.end = Math.min(n + 1, i.stream.end), r.value = n == i.stream.end ? i.parser.eofTerm : 0, r; } updateCachedToken(e, r, n) { @@ -21907,21 +21907,21 @@ class SEe { for (let u = a.stateSlot(s, l ? 2 : 1); ; u += 3) { if (o[u] == 65535) if (o[u + 1] == 1) - u = xu(o, u + 2); + u = Bu(o, u + 2); else { - i == 0 && o[u + 1] == 2 && (i = this.putAction(xu(o, u + 2), r, n, i)); + i == 0 && o[u + 1] == 2 && (i = this.putAction(Bu(o, u + 2), r, n, i)); break; } - o[u] == r && (i = this.putAction(xu(o, u + 1), r, n, i)); + o[u] == r && (i = this.putAction(Bu(o, u + 1), r, n, i)); } return i; } } -class TEe { +class g_e { constructor(e, r, n, i) { - this.parser = e, this.input = r, this.ranges = i, this.recovering = 0, this.nextStackID = 9812, this.minStackPos = 0, this.reused = [], this.stoppedAt = null, this.lastBigReductionStart = -1, this.lastBigReductionSize = 0, this.bigReductionCount = 0, this.stream = new wEe(r, i), this.tokens = new SEe(e, this.stream), this.topTerm = e.top[1]; + this.parser = e, this.input = r, this.ranges = i, this.recovering = 0, this.nextStackID = 9812, this.minStackPos = 0, this.reused = [], this.stoppedAt = null, this.lastBigReductionStart = -1, this.lastBigReductionSize = 0, this.bigReductionCount = 0, this.stream = new h_e(r, i), this.tokens = new p_e(e, this.stream), this.topTerm = e.top[1]; let { from: s } = i[0]; - this.stacks = [vk.start(this, e.top[0], s)], this.fragments = n.length && this.stream.end - s > e.bufferLength * 4 ? new kEe(n, e.nodeSet) : null; + this.stacks = [qk.start(this, e.top[0], s)], this.fragments = n.length && this.stream.end - s > e.bufferLength * 4 ? new d_e(n, e.nodeSet) : null; } get parsedPos() { return this.minStackPos; @@ -21952,17 +21952,17 @@ class TEe { } } if (!n.length) { - let a = i && EEe(i); + let a = i && v_e(i); if (a) - return Ja && console.log("Finish with " + this.stackID(a)), this.stackToTree(a); + return vo && console.log("Finish with " + this.stackID(a)), this.stackToTree(a); if (this.parser.strict) - throw Ja && i && console.log("Stuck with token " + (this.tokens.mainToken ? this.parser.getName(this.tokens.mainToken.value) : "none")), new SyntaxError("No parse at " + r); + throw vo && i && console.log("Stuck with token " + (this.tokens.mainToken ? this.parser.getName(this.tokens.mainToken.value) : "none")), new SyntaxError("No parse at " + r); this.recovering || (this.recovering = 5); } if (this.recovering && i) { let a = this.stoppedAt != null && i[0].pos > this.stoppedAt ? i[0] : this.runRecovery(i, s, n); if (a) - return Ja && console.log("Force-finish " + this.stackID(a)), this.stackToTree(a.forceAll()); + return vo && console.log("Force-finish " + this.stackID(a)), this.stackToTree(a.forceAll()); } if (this.recovering) { let a = this.recovering == 1 ? 1 : this.recovering * 3; @@ -21998,19 +21998,19 @@ class TEe { this.stoppedAt = e; } advanceStack(e, r, n) { - let i = e.pos, { parser: s } = this, a = Ja ? this.stackID(e) + " -> " : ""; + let i = e.pos, { parser: s } = this, a = vo ? this.stackID(e) + " -> " : ""; if (this.stoppedAt != null && i > this.stoppedAt) return e.forceReduce() ? e : null; if (this.fragments) { let u = e.curContext && e.curContext.tracker.strict, h = u ? e.curContext.hash : 0; for (let f = this.fragments.nodeAt(i); f; ) { let d = this.parser.nodeSet.types[f.type.id] == f.type ? s.getGoto(e.state, f.type.id) : -1; - if (d > -1 && f.length && (!u || (f.prop(or.contextHash) || 0) == h)) - return e.useNode(f, d), Ja && console.log(a + this.stackID(e) + ` (via reuse of ${s.getName(f.type.id)})`), !0; - if (!(f instanceof Yr) || f.children.length == 0 || f.positions[0] > 0) + if (d > -1 && f.length && (!u || (f.prop(yr.contextHash) || 0) == h)) + return e.useNode(f, d), vo && console.log(a + this.stackID(e) + ` (via reuse of ${s.getName(f.type.id)})`), !0; + if (!(f instanceof nn) || f.children.length == 0 || f.positions[0] > 0) break; let p = f.children[0]; - if (p instanceof Yr && f.positions[0] == 0) + if (p instanceof nn && f.positions[0] == 0) f = p; else break; @@ -22018,14 +22018,14 @@ class TEe { } let o = s.stateSlot(e.state, 4); if (o > 0) - return e.reduce(o), Ja && console.log(a + this.stackID(e) + ` (via always-reduce ${s.getName(o & 65535)})`), !0; + return e.reduce(o), vo && console.log(a + this.stackID(e) + ` (via always-reduce ${s.getName(o & 65535)})`), !0; if (e.stack.length >= 8400) for (; e.stack.length > 6e3 && e.forceReduce(); ) ; let l = this.tokens.getActions(e); for (let u = 0; u < l.length; ) { let h = l[u++], f = l[u++], d = l[u++], p = u == l.length || !n, g = p ? e : e.split(), m = this.tokens.mainToken; - if (g.apply(h, f, m ? m.start : g.pos, d), Ja && console.log(a + this.stackID(g) + ` (via ${(h & 65536) == 0 ? "shift" : `reduce of ${s.getName(h & 65535)}`} for ${s.getName(f)} @ ${i}${g == e ? "" : ", split"})`), p) + if (g.apply(h, f, m ? m.start : g.pos, d), vo && console.log(a + this.stackID(g) + ` (via ${(h & 65536) == 0 ? "shift" : `reduce of ${s.getName(h & 65535)}`} for ${s.getName(f)} @ ${i}${g == e ? "" : ", split"})`), p) return !0; g.pos > i ? r.push(g) : n.push(g); } @@ -22037,27 +22037,27 @@ class TEe { if (!this.advanceStack(e, null, null)) return !1; if (e.pos > n) - return cQ(e, r), !0; + return qQ(e, r), !0; } } runRecovery(e, r, n) { let i = null, s = !1; for (let a = 0; a < e.length; a++) { - let o = e[a], l = r[a << 1], u = r[(a << 1) + 1], h = Ja ? this.stackID(o) + " -> " : ""; - if (o.deadEnd && (s || (s = !0, o.restart(), Ja && console.log(h + this.stackID(o) + " (restarted)"), this.advanceFully(o, n)))) + let o = e[a], l = r[a << 1], u = r[(a << 1) + 1], h = vo ? this.stackID(o) + " -> " : ""; + if (o.deadEnd && (s || (s = !0, o.restart(), vo && console.log(h + this.stackID(o) + " (restarted)"), this.advanceFully(o, n)))) continue; let f = o.split(), d = h; - for (let p = 0; f.forceReduce() && p < 10 && (Ja && console.log(d + this.stackID(f) + " (via force-reduce)"), !this.advanceFully(f, n)); p++) - Ja && (d = this.stackID(f) + " -> "); + for (let p = 0; f.forceReduce() && p < 10 && (vo && console.log(d + this.stackID(f) + " (via force-reduce)"), !this.advanceFully(f, n)); p++) + vo && (d = this.stackID(f) + " -> "); for (let p of o.recoverByInsert(l)) - Ja && console.log(h + this.stackID(p) + " (via recover-insert)"), this.advanceFully(p, n); - this.stream.end > o.pos ? (u == o.pos && (u++, l = 0), o.recoverByDelete(l, u), Ja && console.log(h + this.stackID(o) + ` (via recover-delete ${this.parser.getName(l)})`), cQ(o, n)) : (!i || i.score < o.score) && (i = o); + vo && console.log(h + this.stackID(p) + " (via recover-insert)"), this.advanceFully(p, n); + this.stream.end > o.pos ? (u == o.pos && (u++, l = 0), o.recoverByDelete(l, u), vo && console.log(h + this.stackID(o) + ` (via recover-delete ${this.parser.getName(l)})`), qQ(o, n)) : (!i || i.score < o.score) && (i = o); } return i; } stackToTree(e) { - return e.close(), Yr.build({ - buffer: yk.create(e), + return e.close(), nn.build({ + buffer: Yk.create(e), nodeSet: this.parser.nodeSet, topID: this.topTerm, maxBufferLength: this.parser.bufferLength, @@ -22068,11 +22068,11 @@ class TEe { }); } stackID(e) { - let r = (y6 || (y6 = /* @__PURE__ */ new WeakMap())).get(e); - return r || y6.set(e, r = String.fromCodePoint(this.nextStackID++)), r + e; + let r = (G_ || (G_ = /* @__PURE__ */ new WeakMap())).get(e); + return r || G_.set(e, r = String.fromCodePoint(this.nextStackID++)), r + e; } } -function cQ(t, e) { +function qQ(t, e) { for (let r = 0; r < e.length; r++) { let n = e[r]; if (n.pos == t.pos && n.sameState(t)) { @@ -22082,7 +22082,7 @@ function cQ(t, e) { } e.push(t); } -class CEe { +class m_e { constructor(e, r, n) { this.source = e, this.flags = r, this.disabled = n; } @@ -22090,13 +22090,13 @@ class CEe { return !this.disabled || this.disabled[e] == 0; } } -const b6 = (t) => t; -class wD { +const X_ = (t) => t; +class ZD { constructor(e) { - this.start = e.start, this.shift = e.shift || b6, this.reduce = e.reduce || b6, this.reuse = e.reuse || b6, this.hash = e.hash || (() => 0), this.strict = e.strict !== !1; + this.start = e.start, this.shift = e.shift || X_, this.reduce = e.reduce || X_, this.reuse = e.reuse || X_, this.hash = e.hash || (() => 0), this.strict = e.strict !== !1; } } -class Sf extends _M { +class Uf extends nD { constructor(e) { if (super(), this.wrappers = [], e.version != 14) throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (${14})`); @@ -22113,7 +22113,7 @@ class Sf extends _M { if (e.nodeProps) for (let o of e.nodeProps) { let l = o[0]; - typeof l == "string" && (l = or[l]); + typeof l == "string" && (l = yr[l]); for (let u = 1; u < o.length; ) { let h = o[u++]; if (h >= 0) @@ -22126,22 +22126,22 @@ class Sf extends _M { } } } - this.nodeSet = new dx(r.map((o, l) => Mi.define({ + this.nodeSet = new $x(r.map((o, l) => Yi.define({ name: l >= this.minRepeatTerm ? void 0 : o, id: l, props: i[l], top: n.indexOf(l) > -1, error: l == 0, skipped: e.skippedNodes && e.skippedNodes.indexOf(l) > -1 - }))), e.propSources && (this.nodeSet = this.nodeSet.extend(...e.propSources)), this.strict = !1, this.bufferLength = cJ; - let a = Nv(e.tokenData); + }))), e.propSources && (this.nodeSet = this.nodeSet.extend(...e.propSources)), this.strict = !1, this.bufferLength = qJ; + let a = sy(e.tokenData); this.context = e.context, this.specializerSpecs = e.specialized || [], this.specialized = new Uint16Array(this.specializerSpecs.length); for (let o = 0; o < this.specializerSpecs.length; o++) this.specialized[o] = this.specializerSpecs[o].term; - this.specializers = this.specializerSpecs.map(uQ), this.states = Nv(e.states, Uint32Array), this.data = Nv(e.stateData), this.goto = Nv(e.goto), this.maxTerm = e.maxTerm, this.tokenizers = e.tokenizers.map((o) => typeof o == "number" ? new pg(a, o) : o), this.topRules = e.topRules, this.dialects = e.dialects || {}, this.dynamicPrecedences = e.dynamicPrecedences || null, this.tokenPrecTable = e.tokenPrec, this.termNames = e.termNames || null, this.maxNode = this.nodeSet.types.length - 1, this.dialect = this.parseDialect(), this.top = this.topRules[Object.keys(this.topRules)[0]]; + this.specializers = this.specializerSpecs.map(YQ), this.states = sy(e.states, Uint32Array), this.data = sy(e.stateData), this.goto = sy(e.goto), this.maxTerm = e.maxTerm, this.tokenizers = e.tokenizers.map((o) => typeof o == "number" ? new Ng(a, o) : o), this.topRules = e.topRules, this.dialects = e.dialects || {}, this.dynamicPrecedences = e.dynamicPrecedences || null, this.tokenPrecTable = e.tokenPrec, this.termNames = e.termNames || null, this.maxNode = this.nodeSet.types.length - 1, this.dialect = this.parseDialect(), this.top = this.topRules[Object.keys(this.topRules)[0]]; } createParse(e, r, n) { - let i = new TEe(this, e, r, n); + let i = new g_e(this, e, r, n); for (let s of this.wrappers) i = s(i, e, r, n); return i; @@ -22167,14 +22167,14 @@ class Sf extends _M { for (let s = this.stateSlot(e, i ? 2 : 1), a; ; s += 3) { if ((a = n[s]) == 65535) if (n[s + 1] == 1) - a = n[s = xu(n, s + 2)]; + a = n[s = Bu(n, s + 2)]; else { if (n[s + 1] == 2) - return xu(n, s + 2); + return Bu(n, s + 2); break; } if (a == r || a == 0) - return xu(n, s + 1); + return Bu(n, s + 1); } return 0; } @@ -22192,10 +22192,10 @@ class Sf extends _M { for (let s = this.stateSlot(e, 1); i == null; s += 3) { if (this.data[s] == 65535) if (this.data[s + 1] == 1) - s = xu(this.data, s + 2); + s = Bu(this.data, s + 2); else break; - i = r(xu(this.data, s + 1)); + i = r(Bu(this.data, s + 1)); } return i; } @@ -22204,7 +22204,7 @@ class Sf extends _M { for (let n = this.stateSlot(e, 1); ; n += 3) { if (this.data[n] == 65535) if (this.data[n + 1] == 1) - n = xu(this.data, n + 2); + n = Bu(this.data, n + 2); else break; if ((this.data[n + 2] & 1) == 0) { @@ -22215,7 +22215,7 @@ class Sf extends _M { return r; } configure(e) { - let r = Object.assign(Object.create(Sf.prototype), this); + let r = Object.assign(Object.create(Uf.prototype), this); if (e.props && (r.nodeSet = this.nodeSet.extend(...e.props)), e.top) { let n = this.topRules[e.top]; if (!n) @@ -22230,7 +22230,7 @@ class Sf extends _M { if (!s) return n; let a = Object.assign(Object.assign({}, n), { external: s.to }); - return r.specializers[i] = uQ(a), a; + return r.specializers[i] = YQ(a), a; })), e.contextTracker && (r.context = e.contextTracker), e.dialect && (r.dialect = this.parseDialect(e.dialect)), e.strict != null && (r.strict = e.strict), e.wrap && (r.wrappers = r.wrappers.concat(e.wrap)), e.bufferLength != null && (r.bufferLength = e.bufferLength), r; } hasWrappers() { @@ -22261,16 +22261,16 @@ class Sf extends _M { if (!n[s]) for (let a = this.dialects[r[s]], o; (o = this.data[a++]) != 65535; ) (i || (i = new Uint8Array(this.maxTerm + 1)))[o] = 1; - return new CEe(e, n, i); + return new m_e(e, n, i); } static deserialize(e) { - return new Sf(e); + return new Uf(e); } } -function xu(t, e) { +function Bu(t, e) { return t[e] | t[e + 1] << 16; } -function EEe(t) { +function v_e(t) { let e = null; for (let r of t) { let n = r.p.stoppedAt; @@ -22278,14 +22278,14 @@ function EEe(t) { } return e; } -function uQ(t) { +function YQ(t) { if (t.external) { let e = t.extend ? 1 : 0; return (r, n) => t.external(r, n) << 1 | e; } return t.get; } -const _Ee = 54, AEe = 1, LEe = 55, REe = 2, MEe = 56, DEe = 3, hQ = 4, PEe = 5, xk = 6, hre = 7, fre = 8, dre = 9, pre = 10, NEe = 11, IEe = 12, $Ee = 13, x6 = 57, BEe = 14, fQ = 58, gre = 20, FEe = 22, mre = 23, zEe = 24, O8 = 26, vre = 27, QEe = 28, UEe = 31, VEe = 34, qEe = 36, YEe = 37, WEe = 0, GEe = 1, XEe = { +const y_e = 54, b_e = 1, x_e = 55, w_e = 2, O_e = 56, k_e = 3, WQ = 4, S_e = 5, Gk = 6, Wre = 7, Gre = 8, Xre = 9, Hre = 10, T_e = 11, C_e = 12, E_e = 13, H_ = 57, __e = 14, GQ = 58, Zre = 20, A_e = 22, jre = 23, L_e = 24, j8 = 26, Kre = 27, R_e = 28, M_e = 31, D_e = 34, P_e = 36, N_e = 37, I_e = 0, $_e = 1, B_e = { area: !0, base: !0, br: !0, @@ -22304,7 +22304,7 @@ const _Ee = 54, AEe = 1, LEe = 55, REe = 2, MEe = 56, DEe = 3, hQ = 4, PEe = 5, track: !0, wbr: !0, menuitem: !0 -}, HEe = { +}, F_e = { dd: !0, li: !0, optgroup: !0, @@ -22317,7 +22317,7 @@ const _Ee = 54, AEe = 1, LEe = 55, REe = 2, MEe = 56, DEe = 3, hQ = 4, PEe = 5, tfoot: !0, th: !0, tr: !0 -}, dQ = { +}, XQ = { dd: { dd: !0, dt: !0 }, dt: { dd: !0, dt: !0 }, li: { li: !0 }, @@ -22361,125 +22361,125 @@ const _Ee = 54, AEe = 1, LEe = 55, REe = 2, MEe = 56, DEe = 3, hQ = 4, PEe = 5, thead: { tbody: !0, tfoot: !0 }, tr: { tr: !0 } }; -function ZEe(t) { +function z_e(t) { return t == 45 || t == 46 || t == 58 || t >= 65 && t <= 90 || t == 95 || t >= 97 && t <= 122 || t >= 161; } -function yre(t) { +function Jre(t) { return t == 9 || t == 10 || t == 13 || t == 32; } -let pQ = null, gQ = null, mQ = 0; -function k8(t, e) { +let HQ = null, ZQ = null, jQ = 0; +function K8(t, e) { let r = t.pos + e; - if (mQ == r && gQ == t) - return pQ; + if (jQ == r && ZQ == t) + return HQ; let n = t.peek(e); - for (; yre(n); ) + for (; Jre(n); ) n = t.peek(++e); let i = ""; - for (; ZEe(n); ) + for (; z_e(n); ) i += String.fromCharCode(n), n = t.peek(++e); - return gQ = t, mQ = r, pQ = i ? i.toLowerCase() : n == jEe || n == KEe ? void 0 : null; + return ZQ = t, jQ = r, HQ = i ? i.toLowerCase() : n == Q_e || n == U_e ? void 0 : null; } -const bre = 60, wk = 62, OD = 47, jEe = 63, KEe = 33, JEe = 45; -function vQ(t, e) { +const ene = 60, Xk = 62, jD = 47, Q_e = 63, U_e = 33, V_e = 45; +function KQ(t, e) { this.name = t, this.parent = e, this.hash = e ? e.hash : 0; for (let r = 0; r < t.length; r++) this.hash += (this.hash << 4) + t.charCodeAt(r) + (t.charCodeAt(r) << 8); } -const e6e = [xk, pre, hre, fre, dre], t6e = new wD({ +const q_e = [Gk, Hre, Wre, Gre, Xre], Y_e = new ZD({ start: null, shift(t, e, r, n) { - return e6e.indexOf(e) > -1 ? new vQ(k8(n, 1) || "", t) : t; + return q_e.indexOf(e) > -1 ? new KQ(K8(n, 1) || "", t) : t; }, reduce(t, e) { - return e == gre && t ? t.parent : t; + return e == Zre && t ? t.parent : t; }, reuse(t, e, r, n) { let i = e.type.id; - return i == xk || i == qEe ? new vQ(k8(n, 1) || "", t) : t; + return i == Gk || i == P_e ? new KQ(K8(n, 1) || "", t) : t; }, hash(t) { return t ? t.hash : 0; }, strict: !1 -}), r6e = new ma((t, e) => { - if (t.next != bre) { - t.next < 0 && e.context && t.acceptToken(x6); +}), W_e = new Pa((t, e) => { + if (t.next != ene) { + t.next < 0 && e.context && t.acceptToken(H_); return; } t.advance(); - let r = t.next == OD; + let r = t.next == jD; r && t.advance(); - let n = k8(t, 0); + let n = K8(t, 0); if (n === void 0) return; if (!n) - return t.acceptToken(r ? BEe : xk); + return t.acceptToken(r ? __e : Gk); let i = e.context ? e.context.name : null; if (r) { if (n == i) - return t.acceptToken(NEe); - if (i && HEe[i]) - return t.acceptToken(x6, -2); - if (e.dialectEnabled(WEe)) - return t.acceptToken(IEe); + return t.acceptToken(T_e); + if (i && F_e[i]) + return t.acceptToken(H_, -2); + if (e.dialectEnabled(I_e)) + return t.acceptToken(C_e); for (let s = e.context; s; s = s.parent) if (s.name == n) return; - t.acceptToken($Ee); + t.acceptToken(E_e); } else { if (n == "script") - return t.acceptToken(hre); + return t.acceptToken(Wre); if (n == "style") - return t.acceptToken(fre); + return t.acceptToken(Gre); if (n == "textarea") - return t.acceptToken(dre); - if (XEe.hasOwnProperty(n)) - return t.acceptToken(pre); - i && dQ[i] && dQ[i][n] ? t.acceptToken(x6, -1) : t.acceptToken(xk); + return t.acceptToken(Xre); + if (B_e.hasOwnProperty(n)) + return t.acceptToken(Hre); + i && XQ[i] && XQ[i][n] ? t.acceptToken(H_, -1) : t.acceptToken(Gk); } -}, { contextual: !0 }), n6e = new ma((t) => { +}, { contextual: !0 }), G_e = new Pa((t) => { for (let e = 0, r = 0; ; r++) { if (t.next < 0) { - r && t.acceptToken(fQ); + r && t.acceptToken(GQ); break; } - if (t.next == JEe) + if (t.next == V_e) e++; - else if (t.next == wk && e >= 2) { - r >= 3 && t.acceptToken(fQ, -2); + else if (t.next == Xk && e >= 2) { + r >= 3 && t.acceptToken(GQ, -2); break; } else e = 0; t.advance(); } }); -function i6e(t) { +function X_e(t) { for (; t; t = t.parent) if (t.name == "svg" || t.name == "math") return !0; return !1; } -const s6e = new ma((t, e) => { - if (t.next == OD && t.peek(1) == wk) { - let r = e.dialectEnabled(GEe) || i6e(e.context); - t.acceptToken(r ? PEe : hQ, 2); +const H_e = new Pa((t, e) => { + if (t.next == jD && t.peek(1) == Xk) { + let r = e.dialectEnabled($_e) || X_e(e.context); + t.acceptToken(r ? S_e : WQ, 2); } else - t.next == wk && t.acceptToken(hQ, 1); + t.next == Xk && t.acceptToken(WQ, 1); }); -function kD(t, e, r) { +function KD(t, e, r) { let n = 2 + t.length; - return new ma((i) => { + return new Pa((i) => { for (let s = 0, a = 0, o = 0; ; o++) { if (i.next < 0) { o && i.acceptToken(e); break; } - if (s == 0 && i.next == bre || s == 1 && i.next == OD || s >= 2 && s < n && i.next == t.charCodeAt(s - 2)) + if (s == 0 && i.next == ene || s == 1 && i.next == jD || s >= 2 && s < n && i.next == t.charCodeAt(s - 2)) s++, a++; - else if ((s == 2 || s == n) && yre(i.next)) + else if ((s == 2 || s == n) && Jre(i.next)) a++; - else if (s == n && i.next == wk) { + else if (s == n && i.next == Xk) { o > a ? i.acceptToken(e, -a) : i.acceptToken(r, -(a - 2)); break; } else if ((i.next == 10 || i.next == 13) && o) { @@ -22491,99 +22491,99 @@ function kD(t, e, r) { } }); } -const a6e = kD("script", _Ee, AEe), o6e = kD("style", LEe, REe), l6e = kD("textarea", MEe, DEe), c6e = Xf({ - "Text RawText": we.content, - "StartTag StartCloseTag SelfClosingEndTag EndTag": we.angleBracket, - TagName: we.tagName, - "MismatchedCloseTag/TagName": [we.tagName, we.invalid], - AttributeName: we.attributeName, - "AttributeValue UnquotedAttributeValue": we.attributeValue, - Is: we.definitionOperator, - "EntityReference CharacterReference": we.character, - Comment: we.blockComment, - ProcessingInst: we.processingInstruction, - DoctypeDecl: we.documentMeta -}), u6e = Sf.deserialize({ +const Z_e = KD("script", y_e, b_e), j_e = KD("style", x_e, w_e), K_e = KD("textarea", O_e, k_e), J_e = fd({ + "Text RawText": Se.content, + "StartTag StartCloseTag SelfClosingEndTag EndTag": Se.angleBracket, + TagName: Se.tagName, + "MismatchedCloseTag/TagName": [Se.tagName, Se.invalid], + AttributeName: Se.attributeName, + "AttributeValue UnquotedAttributeValue": Se.attributeValue, + Is: Se.definitionOperator, + "EntityReference CharacterReference": Se.character, + Comment: Se.blockComment, + ProcessingInst: Se.processingInstruction, + DoctypeDecl: Se.documentMeta +}), e6e = Uf.deserialize({ version: 14, states: ",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%WQ&rO,59fO%`Q&rO,59iO%hQ&rO,59lO%sQ&rO,59nOOOa'#D^'#D^O%{OaO'#CxO&WOaO,59[OOOb'#D_'#D_O&`ObO'#C{O&kObO,59[OOOd'#D`'#D`O&sOdO'#DOO'OOdO,59[OOO`'#Da'#DaO'WO!rO,59[O'_Q#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'dO$fO,59oOOO`,59o,59oO'lQ#|O,59qO'qQ#|O,59rOOO`-E7W-E7WO'vQ&rO'#CsOOQW'#DZ'#DZO(UQ&rO1G.wOOOa1G.w1G.wO(^Q&rO1G/QOOOb1G/Q1G/QO(fQ&rO1G/TOOOd1G/T1G/TO(nQ&rO1G/WOOO`1G/W1G/WOOO`1G/Y1G/YO(yQ&rO1G/YOOOa-E7[-E7[O)RQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)WQ#tO'#C|OOOd-E7^-E7^O)]Q#tO'#DPOOO`-E7_-E7_O)bQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O)gQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rOOO`7+$t7+$tO)rQ#|O,59eO)wQ#|O,59hO)|Q#|O,59kOOO`1G/X1G/XO*RO7[O'#CvO*dOMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O*uO7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+WOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z", stateData: "+s~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OhyO~OS!OOhyO~OS!QOhyO~OS!SOT!TOhyO~OS!TOhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXhgXTgX~OS!fOhyO~OS!gOhyO~OS!hOhyO~OS!iOT!jOhyO~OS!jOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~", goto: "%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{}!P!R!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ}bQ!PcQ!RdQ!UeZ!e{}!P!R!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp", nodeNames: "\u26A0 StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl", maxTerm: 67, - context: t6e, + context: Y_e, nodeProps: [ ["closedBy", -10, 1, 2, 3, 7, 8, 9, 10, 11, 12, 13, "EndTag", 6, "EndTag SelfClosingEndTag", -4, 21, 30, 33, 36, "CloseTag"], ["openedBy", 4, "StartTag StartCloseTag", 5, "StartTag", -4, 29, 32, 35, 37, "OpenTag"], ["group", -9, 14, 17, 18, 19, 20, 39, 40, 41, 42, "Entity", 16, "Entity TextContent", -3, 28, 31, 34, "TextContent Entity"] ], - propSources: [c6e], + propSources: [J_e], skippedNodes: [0], repeatNodeCount: 9, tokenData: "!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V! { + return HJ((o, l) => { let u = o.type.id; - if (u == QEe) - return w6(o, l, r); - if (u == UEe) - return w6(o, l, n); - if (u == VEe) - return w6(o, l, i); - if (u == gre && s.length) { - let h = o.node, f = h.firstChild, d = f && yQ(f, l), p; + if (u == R_e) + return Z_(o, l, r); + if (u == M_e) + return Z_(o, l, n); + if (u == D_e) + return Z_(o, l, i); + if (u == Zre && s.length) { + let h = o.node, f = h.firstChild, d = f && JQ(f, l), p; if (d) { for (let g of s) - if (g.tag == d && (!g.attrs || g.attrs(p || (p = xre(h, l))))) { - let m = h.lastChild, v = m.type.id == YEe ? m.from : h.to; + if (g.tag == d && (!g.attrs || g.attrs(p || (p = tne(h, l))))) { + let m = h.lastChild, v = m.type.id == N_e ? m.from : h.to; if (v > f.to) return { parser: g.parser, overlay: [{ from: f.to, to: v }] }; } } } - if (a && u == mre) { + if (a && u == jre) { let h = o.node, f; if (f = h.firstChild) { let d = a[l.read(f.from, f.to)]; if (d) for (let p of d) { - if (p.tagName && p.tagName != yQ(h.parent, l)) + if (p.tagName && p.tagName != JQ(h.parent, l)) continue; let g = h.lastChild; - if (g.type.id == O8) { + if (g.type.id == j8) { let m = g.from + 1, v = g.lastChild, y = g.to - (v && v.isError ? 0 : 1); if (y > m) return { parser: p.parser, overlay: [{ from: m, to: y }] }; - } else if (g.type.id == vre) + } else if (g.type.id == Kre) return { parser: p.parser, overlay: [{ from: g.from, to: g.to }] }; } } @@ -22591,7 +22591,7 @@ function wre(t = [], e = []) { return null; }); } -const h6e = 96, bQ = 1, f6e = 97, d6e = 98, xQ = 2, Ore = [ +const t6e = 96, eU = 1, r6e = 97, n6e = 98, tU = 2, nne = [ 9, 10, 11, @@ -22617,74 +22617,74 @@ const h6e = 96, bQ = 1, f6e = 97, d6e = 98, xQ = 2, Ore = [ 8239, 8287, 12288 -], p6e = 58, g6e = 40, kre = 95, m6e = 91, Q4 = 45, v6e = 46, y6e = 35, b6e = 37, x6e = 38, w6e = 92, O6e = 10; -function Ok(t) { +], i6e = 58, s6e = 40, ine = 95, a6e = 91, p5 = 45, o6e = 46, l6e = 35, c6e = 37, u6e = 38, h6e = 92, f6e = 10; +function Hk(t) { return t >= 65 && t <= 90 || t >= 97 && t <= 122 || t >= 161; } -function k6e(t) { +function d6e(t) { return t >= 48 && t <= 57; } -const S6e = new ma((t, e) => { +const p6e = new Pa((t, e) => { for (let r = !1, n = 0, i = 0; ; i++) { let { next: s } = t; - if (Ok(s) || s == Q4 || s == kre || r && k6e(s)) - !r && (s != Q4 || i > 0) && (r = !0), n === i && s == Q4 && n++, t.advance(); - else if (s == w6e && t.peek(1) != O6e) + if (Hk(s) || s == p5 || s == ine || r && d6e(s)) + !r && (s != p5 || i > 0) && (r = !0), n === i && s == p5 && n++, t.advance(); + else if (s == h6e && t.peek(1) != f6e) t.advance(), t.next > -1 && t.advance(), r = !0; else { - r && t.acceptToken(s == g6e ? f6e : n == 2 && e.canShift(xQ) ? xQ : d6e); + r && t.acceptToken(s == s6e ? r6e : n == 2 && e.canShift(tU) ? tU : n6e); break; } } -}), T6e = new ma((t) => { - if (Ore.includes(t.peek(-1))) { +}), g6e = new Pa((t) => { + if (nne.includes(t.peek(-1))) { let { next: e } = t; - (Ok(e) || e == kre || e == y6e || e == v6e || e == m6e || e == p6e || e == Q4 || e == x6e) && t.acceptToken(h6e); + (Hk(e) || e == ine || e == l6e || e == o6e || e == a6e || e == i6e || e == p5 || e == u6e) && t.acceptToken(t6e); } -}), C6e = new ma((t) => { - if (!Ore.includes(t.peek(-1))) { +}), m6e = new Pa((t) => { + if (!nne.includes(t.peek(-1))) { let { next: e } = t; - if (e == b6e && (t.advance(), t.acceptToken(bQ)), Ok(e)) { + if (e == c6e && (t.advance(), t.acceptToken(eU)), Hk(e)) { do t.advance(); - while (Ok(t.next)); - t.acceptToken(bQ); - } - } -}), E6e = Xf({ - "AtKeyword import charset namespace keyframes media supports": we.definitionKeyword, - "from to selector": we.keyword, - NamespaceName: we.namespace, - KeyframeName: we.labelName, - KeyframeRangeName: we.operatorKeyword, - TagName: we.tagName, - ClassName: we.className, - PseudoClassName: we.constant(we.className), - IdName: we.labelName, - "FeatureName PropertyName": we.propertyName, - AttributeName: we.attributeName, - NumberLiteral: we.number, - KeywordQuery: we.keyword, - UnaryQueryOp: we.operatorKeyword, - "CallTag ValueName": we.atom, - VariableName: we.variableName, - Callee: we.operatorKeyword, - Unit: we.unit, - "UniversalSelector NestingSelector": we.definitionOperator, - MatchOp: we.compareOperator, - "ChildOp SiblingOp, LogicOp": we.logicOperator, - BinOp: we.arithmeticOperator, - Important: we.modifier, - Comment: we.blockComment, - ColorLiteral: we.color, - "ParenthesizedContent StringLiteral": we.string, - ":": we.punctuation, - "PseudoOp #": we.derefOperator, - "; ,": we.separator, - "( )": we.paren, - "[ ]": we.squareBracket, - "{ }": we.brace -}), _6e = { __proto__: null, lang: 32, "nth-child": 32, "nth-last-child": 32, "nth-of-type": 32, "nth-last-of-type": 32, dir: 32, "host-context": 32, url: 60, "url-prefix": 60, domain: 60, regexp: 60, selector: 134 }, A6e = { __proto__: null, "@import": 114, "@media": 138, "@charset": 142, "@namespace": 146, "@keyframes": 152, "@supports": 164 }, L6e = { __proto__: null, not: 128, only: 128 }, R6e = Sf.deserialize({ + while (Hk(t.next)); + t.acceptToken(eU); + } + } +}), v6e = fd({ + "AtKeyword import charset namespace keyframes media supports": Se.definitionKeyword, + "from to selector": Se.keyword, + NamespaceName: Se.namespace, + KeyframeName: Se.labelName, + KeyframeRangeName: Se.operatorKeyword, + TagName: Se.tagName, + ClassName: Se.className, + PseudoClassName: Se.constant(Se.className), + IdName: Se.labelName, + "FeatureName PropertyName": Se.propertyName, + AttributeName: Se.attributeName, + NumberLiteral: Se.number, + KeywordQuery: Se.keyword, + UnaryQueryOp: Se.operatorKeyword, + "CallTag ValueName": Se.atom, + VariableName: Se.variableName, + Callee: Se.operatorKeyword, + Unit: Se.unit, + "UniversalSelector NestingSelector": Se.definitionOperator, + MatchOp: Se.compareOperator, + "ChildOp SiblingOp, LogicOp": Se.logicOperator, + BinOp: Se.arithmeticOperator, + Important: Se.modifier, + Comment: Se.blockComment, + ColorLiteral: Se.color, + "ParenthesizedContent StringLiteral": Se.string, + ":": Se.punctuation, + "PseudoOp #": Se.derefOperator, + "; ,": Se.separator, + "( )": Se.paren, + "[ ]": Se.squareBracket, + "{ }": Se.brace +}), y6e = { __proto__: null, lang: 32, "nth-child": 32, "nth-last-child": 32, "nth-of-type": 32, "nth-last-of-type": 32, dir: 32, "host-context": 32, url: 60, "url-prefix": 60, domain: 60, regexp: 60, selector: 134 }, b6e = { __proto__: null, "@import": 114, "@media": 138, "@charset": 142, "@namespace": 146, "@keyframes": 152, "@supports": 164 }, x6e = { __proto__: null, not: 128, only: 128 }, w6e = Uf.deserialize({ version: 14, states: "9bQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DPO$vQ[O'#DTOOQP'#Ej'#EjO${QdO'#DeO%gQ[O'#DrO${QdO'#DtO%xQ[O'#DvO&TQ[O'#DyO&]Q[O'#EPO&kQ[O'#EROOQS'#Ei'#EiOOQS'#EU'#EUQYQ[OOO&rQXO'#CdO'gQWO'#DaO'lQWO'#EpO'wQ[O'#EpQOQWOOP(RO#tO'#C_POOO)C@X)C@XOOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(^Q[O'#EXO(xQWO,58{O)QQ[O,59SO$qQ[O,59kO$vQ[O,59oO(^Q[O,59sO(^Q[O,59uO(^Q[O,59vO)]Q[O'#D`OOQS,58{,58{OOQP'#Ck'#CkOOQO'#C}'#C}OOQP,59S,59SO)dQWO,59SO)iQWO,59SOOQP'#DR'#DROOQP,59k,59kOOQO'#DV'#DVO)nQ`O,59oOOQS'#Cp'#CpO${QdO'#CqO)vQvO'#CsO+TQtO,5:POOQO'#Cx'#CxO)iQWO'#CwO+iQWO'#CyOOQS'#Em'#EmOOQO'#Dh'#DhO+nQ[O'#DoO+|QWO'#EqO&]Q[O'#DmO,[QWO'#DpOOQO'#Er'#ErO({QWO,5:^O,aQpO,5:`OOQS'#Dx'#DxO,iQWO,5:bO,nQ[O,5:bOOQO'#D{'#D{O,vQWO,5:eO,{QWO,5:kO-TQWO,5:mOOQS-E8S-E8SO${QdO,59{O-]Q[O'#EZO-jQWO,5;[O-jQWO,5;[POOO'#ET'#ETP-uO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO.lQXO,5:sOOQO-E8V-E8VOOQS1G.g1G.gOOQP1G.n1G.nO)dQWO1G.nO)iQWO1G.nOOQP1G/V1G/VO.yQ`O1G/ZO/dQXO1G/_O/zQXO1G/aO0bQXO1G/bO0xQWO,59zO0}Q[O'#DOO1UQdO'#CoOOQP1G/Z1G/ZO${QdO1G/ZO1]QpO,59]OOQS,59_,59_O${QdO,59aO1eQWO1G/kOOQS,59c,59cO1jQ!bO,59eO1rQWO'#DhO1}QWO,5:TO2SQWO,5:ZO&]Q[O,5:VO&]Q[O'#E[O2[QWO,5;]O2gQWO,5:XO(^Q[O,5:[OOQS1G/x1G/xOOQS1G/z1G/zOOQS1G/|1G/|O2xQWO1G/|O2}QdO'#D|OOQS1G0P1G0POOQS1G0V1G0VOOQS1G0X1G0XO3YQtO1G/gOOQO,5:u,5:uO3pQ[O,5:uOOQO-E8X-E8XO3}QWO1G0vPOOO-E8R-E8RPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$u7+$uO${QdO7+$uOOQS1G/f1G/fO4YQXO'#EoO4aQWO,59jO4fQtO'#EVO5ZQdO'#ElO5eQWO,59ZO5jQpO7+$uOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%V7+%VO5rQWO1G/PO${QdO1G/oOOQO1G/u1G/uOOQO1G/q1G/qO5wQWO,5:vOOQO-E8Y-E8YO6VQXO1G/vOOQS7+%h7+%hO6^QYO'#CsOOQO'#EO'#EOO6iQ`O'#D}OOQO'#D}'#D}O6tQWO'#E]O6|QdO,5:hOOQS,5:h,5:hO7XQtO'#EYO${QdO'#EYO8VQdO7+%ROOQO7+%R7+%ROOQO1G0a1G0aO8jQpO< { ["openedBy", 17, "(", 48, "{"], ["closedBy", 18, ")", 49, "}"] ], - propSources: [E6e], + propSources: [v6e], skippedNodes: [0, 3, 85], repeatNodeCount: 10, tokenData: "J^~R!^OX$}X^%u^p$}pq%uqr)Xrs.Rst/utu6duv$}vw7^wx7oxy9^yz9oz{9t{|:_|}?Q}!O?c!O!P@Q!P!Q@i!Q![Ab![!]B]!]!^CX!^!_$}!_!`Cj!`!aC{!a!b$}!b!cDw!c!}$}!}#OFa#O#P$}#P#QFr#Q#R6d#R#T$}#T#UGT#U#c$}#c#dHf#d#o$}#o#pH{#p#q6d#q#rI^#r#sIo#s#y$}#y#z%u#z$f$}$f$g%u$g#BY$}#BY#BZ%u#BZ$IS$}$IS$I_%u$I_$I|$}$I|$JO%u$JO$JT$}$JT$JU%u$JU$KV$}$KV$KW%u$KW&FU$}&FU&FV%u&FV;'S$};'S;=`JW<%lO$}`%QSOy%^z;'S%^;'S;=`%o<%lO%^`%cSo`Oy%^z;'S%^;'S;=`%o<%lO%^`%rP;=`<%l%^~%zh#W~OX%^X^'f^p%^pq'fqy%^z#y%^#y#z'f#z$f%^$f$g'f$g#BY%^#BY#BZ'f#BZ$IS%^$IS$I_'f$I_$I|%^$I|$JO'f$JO$JT%^$JT$JU'f$JU$KV%^$KV$KW'f$KW&FU%^&FU&FV'f&FV;'S%^;'S;=`%o<%lO%^~'mh#W~o`OX%^X^'f^p%^pq'fqy%^z#y%^#y#z'f#z$f%^$f$g'f$g#BY%^#BY#BZ'f#BZ$IS%^$IS$I_'f$I_$I|%^$I|$JO'f$JO$JT%^$JT$JU'f$JU$KV%^$KV$KW'f$KW&FU%^&FU&FV'f&FV;'S%^;'S;=`%o<%lO%^l)[UOy%^z#]%^#]#^)n#^;'S%^;'S;=`%o<%lO%^l)sUo`Oy%^z#a%^#a#b*V#b;'S%^;'S;=`%o<%lO%^l*[Uo`Oy%^z#d%^#d#e*n#e;'S%^;'S;=`%o<%lO%^l*sUo`Oy%^z#c%^#c#d+V#d;'S%^;'S;=`%o<%lO%^l+[Uo`Oy%^z#f%^#f#g+n#g;'S%^;'S;=`%o<%lO%^l+sUo`Oy%^z#h%^#h#i,V#i;'S%^;'S;=`%o<%lO%^l,[Uo`Oy%^z#T%^#T#U,n#U;'S%^;'S;=`%o<%lO%^l,sUo`Oy%^z#b%^#b#c-V#c;'S%^;'S;=`%o<%lO%^l-[Uo`Oy%^z#h%^#h#i-n#i;'S%^;'S;=`%o<%lO%^l-uS!V[o`Oy%^z;'S%^;'S;=`%o<%lO%^~.UWOY.RZr.Rrs.ns#O.R#O#P.s#P;'S.R;'S;=`/o<%lO.R~.sOh~~.vRO;'S.R;'S;=`/P;=`O.R~/SXOY.RZr.Rrs.ns#O.R#O#P.s#P;'S.R;'S;=`/o;=`<%l.R<%lO.R~/rP;=`<%l.Rn/zYtQOy%^z!Q%^!Q![0j![!c%^!c!i0j!i#T%^#T#Z0j#Z;'S%^;'S;=`%o<%lO%^l0oYo`Oy%^z!Q%^!Q![1_![!c%^!c!i1_!i#T%^#T#Z1_#Z;'S%^;'S;=`%o<%lO%^l1dYo`Oy%^z!Q%^!Q![2S![!c%^!c!i2S!i#T%^#T#Z2S#Z;'S%^;'S;=`%o<%lO%^l2ZYf[o`Oy%^z!Q%^!Q![2y![!c%^!c!i2y!i#T%^#T#Z2y#Z;'S%^;'S;=`%o<%lO%^l3QYf[o`Oy%^z!Q%^!Q![3p![!c%^!c!i3p!i#T%^#T#Z3p#Z;'S%^;'S;=`%o<%lO%^l3uYo`Oy%^z!Q%^!Q![4e![!c%^!c!i4e!i#T%^#T#Z4e#Z;'S%^;'S;=`%o<%lO%^l4lYf[o`Oy%^z!Q%^!Q![5[![!c%^!c!i5[!i#T%^#T#Z5[#Z;'S%^;'S;=`%o<%lO%^l5aYo`Oy%^z!Q%^!Q![6P![!c%^!c!i6P!i#T%^#T#Z6P#Z;'S%^;'S;=`%o<%lO%^l6WSf[o`Oy%^z;'S%^;'S;=`%o<%lO%^d6gUOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^d7QSzSo`Oy%^z;'S%^;'S;=`%o<%lO%^b7cSXQOy%^z;'S%^;'S;=`%o<%lO%^~7rWOY7oZw7owx.nx#O7o#O#P8[#P;'S7o;'S;=`9W<%lO7o~8_RO;'S7o;'S;=`8h;=`O7o~8kXOY7oZw7owx.nx#O7o#O#P8[#P;'S7o;'S;=`9W;=`<%l7o<%lO7o~9ZP;=`<%l7on9cSb^Oy%^z;'S%^;'S;=`%o<%lO%^~9tOa~n9{UUQjWOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^n:fWjW!PQOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#b[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#b[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSp^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#_QOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#X~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#b[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!W^Oy%^z;'S%^;'S;=`%o<%lO%^dCoSzSOy%^z;'S%^;'S;=`%o<%lO%^bDQU|QOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS|Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[!YQo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bFfSxQOy%^z;'S%^;'S;=`%o<%lO%^lFwSv[Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!`Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!RUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!Q^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!PQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}", - tokenizers: [T6e, C6e, S6e, 1, 2, 3, 4, new bk("m~RRYZ[z{a~~g~aO#Z~~dP!P!Qg~lO#[~~", 28, 102)], + tokenizers: [g6e, m6e, p6e, 1, 2, 3, 4, new Wk("m~RRYZ[z{a~~g~aO#Z~~dP!P!Qg~lO#[~~", 28, 102)], topRules: { StyleSheet: [0, 4], Styles: [1, 84] }, - specialized: [{ term: 97, get: (t) => _6e[t] || -1 }, { term: 56, get: (t) => A6e[t] || -1 }, { term: 98, get: (t) => L6e[t] || -1 }], + specialized: [{ term: 97, get: (t) => y6e[t] || -1 }, { term: 56, get: (t) => b6e[t] || -1 }, { term: 98, get: (t) => x6e[t] || -1 }], tokenPrec: 1169 }); -let O6 = null; -function k6() { - if (!O6 && typeof document == "object" && document.body) { +let j_ = null; +function K_() { + if (!j_ && typeof document == "object" && document.body) { let { style: t } = document.body, e = [], r = /* @__PURE__ */ new Set(); for (let n in t) n != "cssText" && n != "cssFloat" && typeof t[n] == "string" && (/[A-Z]/.test(n) && (n = n.replace(/[A-Z]/g, (i) => "-" + i.toLowerCase())), r.has(n) || (e.push(n), r.add(n))); - O6 = e.sort().map((n) => ({ type: "property", label: n })); + j_ = e.sort().map((n) => ({ type: "property", label: n })); } - return O6 || []; + return j_ || []; } -const wQ = /* @__PURE__ */ [ +const rU = /* @__PURE__ */ [ "active", "after", "any-link", @@ -22778,7 +22778,7 @@ const wQ = /* @__PURE__ */ [ "valid", "visited", "where" -].map((t) => ({ type: "class", label: t })), OQ = /* @__PURE__ */ [ +].map((t) => ({ type: "class", label: t })), nU = /* @__PURE__ */ [ "above", "absolute", "activeborder", @@ -23341,7 +23341,7 @@ const wQ = /* @__PURE__ */ [ "whitesmoke", "yellow", "yellowgreen" -].map((t) => ({ type: "constant", label: t }))), M6e = /* @__PURE__ */ [ +].map((t) => ({ type: "constant", label: t }))), O6e = /* @__PURE__ */ [ "a", "abbr", "address", @@ -23420,16 +23420,16 @@ const wQ = /* @__PURE__ */ [ "tr", "u", "ul" -].map((t) => ({ type: "type", label: t })), Oh = /^(\w[\w-]*|-\w[\w-]*|)$/, D6e = /^-(-[\w-]*)?$/; -function P6e(t, e) { +].map((t) => ({ type: "type", label: t })), zh = /^(\w[\w-]*|-\w[\w-]*|)$/, k6e = /^-(-[\w-]*)?$/; +function S6e(t, e) { var r; if ((t.name == "(" || t.type.isError) && (t = t.parent || t), t.name != "ArgList") return !1; let n = (r = t.parent) === null || r === void 0 ? void 0 : r.firstChild; return (n == null ? void 0 : n.name) != "Callee" ? !1 : e.sliceString(n.from, n.to) == "var"; } -const kQ = /* @__PURE__ */ new dJ(), N6e = ["Declaration"]; -function I6e(t) { +const iU = /* @__PURE__ */ new XJ(), T6e = ["Declaration"]; +function C6e(t) { for (let e = t; ; ) { if (e.type.isTop) return e; @@ -23437,62 +23437,62 @@ function I6e(t) { return t; } } -function Sre(t, e, r) { +function sne(t, e, r) { if (e.to - e.from > 4096) { - let n = kQ.get(e); + let n = iU.get(e); if (n) return n; - let i = [], s = /* @__PURE__ */ new Set(), a = e.cursor(hn.IncludeAnonymous); + let i = [], s = /* @__PURE__ */ new Set(), a = e.cursor(Sn.IncludeAnonymous); if (a.firstChild()) do - for (let o of Sre(t, a.node, r)) + for (let o of sne(t, a.node, r)) s.has(o.label) || (s.add(o.label), i.push(o)); while (a.nextSibling()); - return kQ.set(e, i), i; + return iU.set(e, i), i; } else { let n = [], i = /* @__PURE__ */ new Set(); return e.cursor().iterate((s) => { var a; - if (r(s) && s.matchContext(N6e) && ((a = s.node.nextSibling) === null || a === void 0 ? void 0 : a.name) == ":") { + if (r(s) && s.matchContext(T6e) && ((a = s.node.nextSibling) === null || a === void 0 ? void 0 : a.name) == ":") { let o = t.sliceString(s.from, s.to); i.has(o) || (i.add(o), n.push({ label: o, type: "variable" })); } }), n; } } -const $6e = (t) => (e) => { - let { state: r, pos: n } = e, i = dn(r).resolveInner(n, -1), s = i.type.isError && i.from == i.to - 1 && r.doc.sliceString(i.from, i.to) == "-"; +const E6e = (t) => (e) => { + let { state: r, pos: n } = e, i = Cn(r).resolveInner(n, -1), s = i.type.isError && i.from == i.to - 1 && r.doc.sliceString(i.from, i.to) == "-"; if (i.name == "PropertyName" || (s || i.name == "TagName") && /^(Block|Styles)$/.test(i.resolve(i.to).name)) - return { from: i.from, options: k6(), validFor: Oh }; + return { from: i.from, options: K_(), validFor: zh }; if (i.name == "ValueName") - return { from: i.from, options: OQ, validFor: Oh }; + return { from: i.from, options: nU, validFor: zh }; if (i.name == "PseudoClassName") - return { from: i.from, options: wQ, validFor: Oh }; - if (t(i) || (e.explicit || s) && P6e(i, r.doc)) + return { from: i.from, options: rU, validFor: zh }; + if (t(i) || (e.explicit || s) && S6e(i, r.doc)) return { from: t(i) || s ? i.from : n, - options: Sre(r.doc, I6e(i), t), - validFor: D6e + options: sne(r.doc, C6e(i), t), + validFor: k6e }; if (i.name == "TagName") { for (let { parent: l } = i; l; l = l.parent) if (l.name == "Block") - return { from: i.from, options: k6(), validFor: Oh }; - return { from: i.from, options: M6e, validFor: Oh }; + return { from: i.from, options: K_(), validFor: zh }; + return { from: i.from, options: O6e, validFor: zh }; } if (!e.explicit) return null; let a = i.resolve(n), o = a.childBefore(n); - return o && o.name == ":" && a.name == "PseudoClassSelector" ? { from: n, options: wQ, validFor: Oh } : o && o.name == ":" && a.name == "Declaration" || a.name == "ArgList" ? { from: n, options: OQ, validFor: Oh } : a.name == "Block" || a.name == "Styles" ? { from: n, options: k6(), validFor: Oh } : null; -}, B6e = /* @__PURE__ */ $6e((t) => t.name == "VariableName"), kk = /* @__PURE__ */ yf.define({ + return o && o.name == ":" && a.name == "PseudoClassSelector" ? { from: n, options: rU, validFor: zh } : o && o.name == ":" && a.name == "Declaration" || a.name == "ArgList" ? { from: n, options: nU, validFor: zh } : a.name == "Block" || a.name == "Styles" ? { from: n, options: K_(), validFor: zh } : null; +}, _6e = /* @__PURE__ */ E6e((t) => t.name == "VariableName"), Zk = /* @__PURE__ */ If.define({ name: "css", - parser: /* @__PURE__ */ R6e.configure({ + parser: /* @__PURE__ */ w6e.configure({ props: [ - /* @__PURE__ */ jm.add({ - Declaration: /* @__PURE__ */ P4() + /* @__PURE__ */ y1.add({ + Declaration: /* @__PURE__ */ o5() }), - /* @__PURE__ */ X0.add({ - "Block KeyframeList": DM + /* @__PURE__ */ dp.add({ + "Block KeyframeList": lD }) ] }), @@ -23502,10 +23502,10 @@ const $6e = (t) => (e) => { wordChars: "-" } }); -function F6e() { - return new Wg(kk, kk.data.of({ autocomplete: B6e })); +function A6e() { + return new dm(Zk, Zk.data.of({ autocomplete: _6e })); } -const z6e = 309, SQ = 1, Q6e = 2, U6e = 3, V6e = 310, q6e = 312, Y6e = 313, W6e = 4, G6e = 5, X6e = 0, S8 = [ +const L6e = 309, sU = 1, R6e = 2, M6e = 3, D6e = 310, P6e = 312, N6e = 313, I6e = 4, $6e = 5, B6e = 0, J8 = [ 9, 10, 11, @@ -23531,45 +23531,45 @@ const z6e = 309, SQ = 1, Q6e = 2, U6e = 3, V6e = 310, q6e = 312, Y6e = 313, W6e 8239, 8287, 12288 -], Tre = 125, H6e = 59, T8 = 47, Z6e = 42, j6e = 43, K6e = 45, J6e = 60, e_e = 44, t_e = new wD({ +], ane = 125, F6e = 59, e9 = 47, z6e = 42, Q6e = 43, U6e = 45, V6e = 60, q6e = 44, Y6e = new ZD({ start: !1, shift(t, e) { - return e == W6e || e == G6e || e == q6e ? t : e == Y6e; + return e == I6e || e == $6e || e == P6e ? t : e == N6e; }, strict: !1 -}), r_e = new ma((t, e) => { +}), W6e = new Pa((t, e) => { let { next: r } = t; - (r == Tre || r == -1 || e.context) && t.acceptToken(V6e); -}, { contextual: !0, fallback: !0 }), n_e = new ma((t, e) => { + (r == ane || r == -1 || e.context) && t.acceptToken(D6e); +}, { contextual: !0, fallback: !0 }), G6e = new Pa((t, e) => { let { next: r } = t, n; - S8.indexOf(r) > -1 || r == T8 && ((n = t.peek(1)) == T8 || n == Z6e) || r != Tre && r != H6e && r != -1 && !e.context && t.acceptToken(z6e); -}, { contextual: !0 }), i_e = new ma((t, e) => { + J8.indexOf(r) > -1 || r == e9 && ((n = t.peek(1)) == e9 || n == z6e) || r != ane && r != F6e && r != -1 && !e.context && t.acceptToken(L6e); +}, { contextual: !0 }), X6e = new Pa((t, e) => { let { next: r } = t; - if ((r == j6e || r == K6e) && (t.advance(), r == t.next)) { + if ((r == Q6e || r == U6e) && (t.advance(), r == t.next)) { t.advance(); - let n = !e.context && e.canShift(SQ); - t.acceptToken(n ? SQ : Q6e); + let n = !e.context && e.canShift(sU); + t.acceptToken(n ? sU : R6e); } }, { contextual: !0 }); -function S6(t, e) { +function J_(t, e) { return t >= 65 && t <= 90 || t >= 97 && t <= 122 || t == 95 || t >= 192 || !e && t >= 48 && t <= 57; } -const s_e = new ma((t, e) => { - if (t.next != J6e || !e.dialectEnabled(X6e) || (t.advance(), t.next == T8)) +const H6e = new Pa((t, e) => { + if (t.next != V6e || !e.dialectEnabled(B6e) || (t.advance(), t.next == e9)) return; let r = 0; - for (; S8.indexOf(t.next) > -1; ) + for (; J8.indexOf(t.next) > -1; ) t.advance(), r++; - if (S6(t.next, !0)) { - for (t.advance(), r++; S6(t.next, !1); ) + if (J_(t.next, !0)) { + for (t.advance(), r++; J_(t.next, !1); ) t.advance(), r++; - for (; S8.indexOf(t.next) > -1; ) + for (; J8.indexOf(t.next) > -1; ) t.advance(), r++; - if (t.next == e_e) + if (t.next == q6e) return; for (let n = 0; ; n++) { if (n == 7) { - if (!S6(t.next, !0)) + if (!J_(t.next, !0)) return; break; } @@ -23578,113 +23578,113 @@ const s_e = new ma((t, e) => { t.advance(), r++; } } - t.acceptToken(U6e, -r); -}), a_e = Xf({ - "get set async static": we.modifier, - "for while do if else switch try catch finally return throw break continue default case": we.controlKeyword, - "in of await yield void typeof delete instanceof": we.operatorKeyword, - "let var const using function class extends": we.definitionKeyword, - "import export from": we.moduleKeyword, - "with debugger as new": we.keyword, - TemplateString: we.special(we.string), - super: we.atom, - BooleanLiteral: we.bool, - this: we.self, - null: we.null, - Star: we.modifier, - VariableName: we.variableName, - "CallExpression/VariableName TaggedTemplateExpression/VariableName": we.function(we.variableName), - VariableDefinition: we.definition(we.variableName), - Label: we.labelName, - PropertyName: we.propertyName, - PrivatePropertyName: we.special(we.propertyName), - "CallExpression/MemberExpression/PropertyName": we.function(we.propertyName), - "FunctionDeclaration/VariableDefinition": we.function(we.definition(we.variableName)), - "ClassDeclaration/VariableDefinition": we.definition(we.className), - PropertyDefinition: we.definition(we.propertyName), - PrivatePropertyDefinition: we.definition(we.special(we.propertyName)), - UpdateOp: we.updateOperator, - "LineComment Hashbang": we.lineComment, - BlockComment: we.blockComment, - Number: we.number, - String: we.string, - Escape: we.escape, - ArithOp: we.arithmeticOperator, - LogicOp: we.logicOperator, - BitOp: we.bitwiseOperator, - CompareOp: we.compareOperator, - RegExp: we.regexp, - Equals: we.definitionOperator, - Arrow: we.function(we.punctuation), - ": Spread": we.punctuation, - "( )": we.paren, - "[ ]": we.squareBracket, - "{ }": we.brace, - "InterpolationStart InterpolationEnd": we.special(we.brace), - ".": we.derefOperator, - ", ;": we.separator, - "@": we.meta, - TypeName: we.typeName, - TypeDefinition: we.definition(we.typeName), - "type enum interface implements namespace module declare": we.definitionKeyword, - "abstract global Privacy readonly override": we.modifier, - "is keyof unique infer": we.operatorKeyword, - JSXAttributeValue: we.attributeValue, - JSXText: we.content, - "JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag": we.angleBracket, - "JSXIdentifier JSXNameSpacedName": we.tagName, - "JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName": we.attributeName, - "JSXBuiltin/JSXIdentifier": we.standard(we.tagName) -}), o_e = { __proto__: null, export: 18, as: 23, from: 31, default: 34, async: 39, function: 40, extends: 52, this: 56, true: 64, false: 64, null: 76, void: 80, typeof: 84, super: 102, new: 136, delete: 152, yield: 161, await: 165, class: 170, public: 227, private: 227, protected: 227, readonly: 229, instanceof: 248, satisfies: 251, in: 252, const: 254, import: 286, keyof: 339, unique: 343, infer: 349, is: 385, abstract: 405, implements: 407, type: 409, let: 412, var: 414, using: 417, interface: 423, enum: 427, namespace: 433, module: 435, declare: 439, global: 443, for: 462, of: 471, while: 474, with: 478, do: 482, if: 486, else: 488, switch: 492, case: 498, try: 504, catch: 508, finally: 512, return: 516, throw: 520, break: 524, continue: 528, debugger: 532 }, l_e = { __proto__: null, async: 123, get: 125, set: 127, declare: 187, public: 189, private: 189, protected: 189, static: 191, abstract: 193, override: 195, readonly: 201, accessor: 203, new: 389 }, c_e = { __proto__: null, "<": 143 }, u_e = Sf.deserialize({ + t.acceptToken(M6e, -r); +}), Z6e = fd({ + "get set async static": Se.modifier, + "for while do if else switch try catch finally return throw break continue default case": Se.controlKeyword, + "in of await yield void typeof delete instanceof": Se.operatorKeyword, + "let var const using function class extends": Se.definitionKeyword, + "import export from": Se.moduleKeyword, + "with debugger as new": Se.keyword, + TemplateString: Se.special(Se.string), + super: Se.atom, + BooleanLiteral: Se.bool, + this: Se.self, + null: Se.null, + Star: Se.modifier, + VariableName: Se.variableName, + "CallExpression/VariableName TaggedTemplateExpression/VariableName": Se.function(Se.variableName), + VariableDefinition: Se.definition(Se.variableName), + Label: Se.labelName, + PropertyName: Se.propertyName, + PrivatePropertyName: Se.special(Se.propertyName), + "CallExpression/MemberExpression/PropertyName": Se.function(Se.propertyName), + "FunctionDeclaration/VariableDefinition": Se.function(Se.definition(Se.variableName)), + "ClassDeclaration/VariableDefinition": Se.definition(Se.className), + PropertyDefinition: Se.definition(Se.propertyName), + PrivatePropertyDefinition: Se.definition(Se.special(Se.propertyName)), + UpdateOp: Se.updateOperator, + "LineComment Hashbang": Se.lineComment, + BlockComment: Se.blockComment, + Number: Se.number, + String: Se.string, + Escape: Se.escape, + ArithOp: Se.arithmeticOperator, + LogicOp: Se.logicOperator, + BitOp: Se.bitwiseOperator, + CompareOp: Se.compareOperator, + RegExp: Se.regexp, + Equals: Se.definitionOperator, + Arrow: Se.function(Se.punctuation), + ": Spread": Se.punctuation, + "( )": Se.paren, + "[ ]": Se.squareBracket, + "{ }": Se.brace, + "InterpolationStart InterpolationEnd": Se.special(Se.brace), + ".": Se.derefOperator, + ", ;": Se.separator, + "@": Se.meta, + TypeName: Se.typeName, + TypeDefinition: Se.definition(Se.typeName), + "type enum interface implements namespace module declare": Se.definitionKeyword, + "abstract global Privacy readonly override": Se.modifier, + "is keyof unique infer": Se.operatorKeyword, + JSXAttributeValue: Se.attributeValue, + JSXText: Se.content, + "JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag": Se.angleBracket, + "JSXIdentifier JSXNameSpacedName": Se.tagName, + "JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName": Se.attributeName, + "JSXBuiltin/JSXIdentifier": Se.standard(Se.tagName) +}), j6e = { __proto__: null, export: 18, as: 23, from: 31, default: 34, async: 39, function: 40, extends: 52, this: 56, true: 64, false: 64, null: 76, void: 80, typeof: 84, super: 102, new: 136, delete: 152, yield: 161, await: 165, class: 170, public: 227, private: 227, protected: 227, readonly: 229, instanceof: 248, satisfies: 251, in: 252, const: 254, import: 286, keyof: 339, unique: 343, infer: 349, is: 385, abstract: 405, implements: 407, type: 409, let: 412, var: 414, using: 417, interface: 423, enum: 427, namespace: 433, module: 435, declare: 439, global: 443, for: 462, of: 471, while: 474, with: 478, do: 482, if: 486, else: 488, switch: 492, case: 498, try: 504, catch: 508, finally: 512, return: 516, throw: 520, break: 524, continue: 528, debugger: 532 }, K6e = { __proto__: null, async: 123, get: 125, set: 127, declare: 187, public: 189, private: 189, protected: 189, static: 191, abstract: 193, override: 195, readonly: 201, accessor: 203, new: 389 }, J6e = { __proto__: null, "<": 143 }, eAe = Uf.deserialize({ version: 14, states: "$RQWO'#CdO>cQWO'#H[O>kQWO'#HbO>kQWO'#HdO`Q^O'#HfO>kQWO'#HhO>kQWO'#HkO>pQWO'#HqO>uQ07iO'#HwO%[Q^O'#HyO?QQ07iO'#H{O?]Q07iO'#H}O9kQ07hO'#IPO?hQ08SO'#ChO@jQ`O'#DiQOQWOOO%[Q^O'#EPOAQQWO'#ESO:RQ7[O'#EjOA]QWO'#EjOAhQpO'#FbOOQU'#Cf'#CfOOQ07`'#Dn'#DnOOQ07`'#Jm'#JmO%[Q^O'#JmOOQO'#Jq'#JqOOQO'#Ib'#IbOBhQ`O'#EcOOQ07`'#Eb'#EbOCdQ07pO'#EcOCnQ`O'#EVOOQO'#Jp'#JpODSQ`O'#JqOEaQ`O'#EVOCnQ`O'#EcPEnO!0LbO'#CaPOOO)CDu)CDuOOOO'#IX'#IXOEyO!bO,59TOOQ07b,59T,59TOOOO'#IY'#IYOFXO#tO,59TO%[Q^O'#D`OOOO'#I['#I[OFgO?MpO,59xOOQ07b,59x,59xOFuQ^O'#I]OGYQWO'#JkOI[QrO'#JkO+}Q^O'#JkOIcQWO,5:OOIyQWO'#ElOJWQWO'#JyOJcQWO'#JxOJcQWO'#JxOJkQWO,5;YOJpQWO'#JwOOQ07f,5:Z,5:ZOJwQ^O,5:ZOLxQ08SO,5:eOMiQWO,5:mONSQ07hO'#JvONZQWO'#JuO9ZQWO'#JuONoQWO'#JuONwQWO,5;XON|QWO'#JuO!#UQrO'#JjOOQ07b'#Ch'#ChO%[Q^O'#ERO!#tQpO,5:rOOQO'#Jr'#JrOOQO-EmOOQU'#J`'#J`OOQU,5>n,5>nOOQU-EpQWO'#HQO9aQWO'#HSO!CgQWO'#HSO:RQ7[O'#HUO!ClQWO'#HUOOQU,5=j,5=jO!CqQWO'#HVO!DSQWO'#CnO!DXQWO,59OO!DcQWO,59OO!FhQ^O,59OOOQU,59O,59OO!FxQ07hO,59OO%[Q^O,59OO!ITQ^O'#H^OOQU'#H_'#H_OOQU'#H`'#H`O`Q^O,5=vO!IkQWO,5=vO`Q^O,5=|O`Q^O,5>OO!IpQWO,5>QO`Q^O,5>SO!IuQWO,5>VO!IzQ^O,5>]OOQU,5>c,5>cO%[Q^O,5>cO9kQ07hO,5>eOOQU,5>g,5>gO!NUQWO,5>gOOQU,5>i,5>iO!NUQWO,5>iOOQU,5>k,5>kO!NZQ`O'#D[O%[Q^O'#JmO!NxQ`O'#JmO# gQ`O'#DjO# xQ`O'#DjO#$ZQ^O'#DjO#$bQWO'#JlO#$jQWO,5:TO#$oQWO'#EpO#$}QWO'#JzO#%VQWO,5;ZO#%[Q`O'#DjO#%iQ`O'#EUOOQ07b,5:n,5:nO%[Q^O,5:nO#%pQWO,5:nO>pQWO,5;UO!@}Q`O,5;UO!AVQ7[O,5;UO:RQ7[O,5;UO#%xQWO,5@XO#%}Q$ISO,5:rOOQO-E<`-E<`O#'TQ07pO,5:}OCnQ`O,5:qO#'_Q`O,5:qOCnQ`O,5:}O!@rQ07hO,5:qOOQ07`'#Ef'#EfOOQO,5:},5:}O%[Q^O,5:}O#'lQ07hO,5:}O#'wQ07hO,5:}O!@}Q`O,5:qOOQO,5;T,5;TO#(VQ07hO,5:}POOO'#IV'#IVP#(kO!0LbO,58{POOO,58{,58{OOOO-EwO+}Q^O,5>wOOQO,5>},5>}O#)VQ^O'#I]OOQO-EpQ08SO1G0{O#>wQ08SO1G0{O#@oQ08SO1G0{O#CoQ(CYO'#ChO#EmQ(CYO1G1^O#EtQ(CYO'#JjO!,lQWO1G1dO#FUQ08SO,5?TOOQ07`-EkQWO1G3lO$2^Q^O1G3nO$6bQ^O'#HmOOQU1G3q1G3qO$6oQWO'#HsO>pQWO'#HuOOQU1G3w1G3wO$6wQ^O1G3wO9kQ07hO1G3}OOQU1G4P1G4POOQ07`'#GY'#GYO9kQ07hO1G4RO9kQ07hO1G4TO$;OQWO,5@XO!*fQ^O,5;[O9ZQWO,5;[O>pQWO,5:UO!*fQ^O,5:UO!@}Q`O,5:UO$;TQ(CYO,5:UOOQO,5;[,5;[O$;_Q`O'#I^O$;uQWO,5@WOOQ07b1G/o1G/oO$;}Q`O'#IdO$pQWO1G0pO!@}Q`O1G0pO!AVQ7[O1G0pOOQ07`1G5s1G5sO!@rQ07hO1G0]OOQO1G0i1G0iO%[Q^O1G0iO$wO$>TQWO1G5qO$>]QWO1G6OO$>eQrO1G6PO9ZQWO,5>}O$>oQ08SO1G5|O%[Q^O1G5|O$?PQ07hO1G5|O$?bQWO1G5{O$?bQWO1G5{O9ZQWO1G5{O$?jQWO,5?QO9ZQWO,5?QOOQO,5?Q,5?QO$@OQWO,5?QO$'TQWO,5?QOOQO-EXOOQU,5>X,5>XO%[Q^O'#HnO%7^QWO'#HpOOQU,5>_,5>_O9ZQWO,5>_OOQU,5>a,5>aOOQU7+)c7+)cOOQU7+)i7+)iOOQU7+)m7+)mOOQU7+)o7+)oO%7cQ`O1G5sO%7wQ(CYO1G0vO%8RQWO1G0vOOQO1G/p1G/pO%8^Q(CYO1G/pO>pQWO1G/pO!*fQ^O'#DjOOQO,5>x,5>xOOQO-E<[-E<[OOQO,5?O,5?OOOQO-EpQWO7+&[O!@}Q`O7+&[OOQO7+%w7+%wO$=gQ08SO7+&TOOQO7+&T7+&TO%[Q^O7+&TO%8hQ07hO7+&TO!@rQ07hO7+%wO!@}Q`O7+%wO%8sQ07hO7+&TO%9RQ08SO7++hO%[Q^O7++hO%9cQWO7++gO%9cQWO7++gOOQO1G4l1G4lO9ZQWO1G4lO%9kQWO1G4lOOQO7+%|7+%|O#%sQWO<tQ08SO1G2ZO%AVQ08SO1G2mO%CbQ08SO1G2oO%EmQ7[O,5>yOOQO-E<]-E<]O%EwQrO,5>zO%[Q^O,5>zOOQO-E<^-E<^O%FRQWO1G5uOOQ07b<YOOQU,5>[,5>[O&5cQWO1G3yO9ZQWO7+&bO!*fQ^O7+&bOOQO7+%[7+%[O&5hQ(CYO1G6PO>pQWO7+%[OOQ07b<pQWO<pQWO7+)eO'&gQWO<}AN>}O%[Q^OAN?ZOOQO<eQ(CYOG26}O!*fQ^O'#DyO1PQWO'#EWO'@ZQrO'#JiO!*fQ^O'#DqO'@bQ^O'#D}O'@iQrO'#ChO'CPQrO'#ChO!*fQ^O'#EPO'CaQ^O,5;VO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O'#IiO'EdQWO,5a#@O#@^#@d#Ax#BW#Cr#DQ#DW#D^#Dd#Dn#Dt#Dz#EU#Eh#EnPPPPPPPPPP#EtPPPPPPP#Fi#Ip#KP#KW#K`PPPP$!d$%Z$+r$+u$+x$,q$,t$,w$-O$-WPP$-^$-b$.Y$/X$/]$/qPP$/u$/{$0PP$0S$0W$0Z$1P$1h$2P$2T$2W$2Z$2a$2d$2h$2lR!{RoqOXst!Z#c%j&m&o&p&r,h,m1w1zY!uQ'Z-Y1[5]Q%pvQ%xyQ&P|Q&e!VS'R!e-QQ'a!iS'g!r!xS*c$|*hQ+f%yQ+s&RQ,X&_Q-W'YQ-b'bQ-j'hQ/|*jQ1f,YR;Y:g%OdOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%j%p%}&f&i&m&o&p&r&v'O']'m'}(P(V(^(r(v(z)y+O+S,e,h,m-^-f-t-z.l.s0[0a0q1_1o1p1r1t1w1z1|2m2s3Z5Y5d5t5u5x6]7w7|8]8gS#p]:d!r)[$[$m'S)n,y,|.{2]3p5W6S9W9i:c:f:g:j:k:l:m:n:o:p:q:r:s:t:u:v:w:{;Y;Z;[;^;e;f;o;p<]Q*u%ZQ+k%{Q,Z&bQ,b&jQ.c;QQ0h+^Q0l+`Q0w+lQ1n,`Q2{.[Q4v0rQ5k1gQ6i3PQ6u;RQ7h4wR8m6j&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%j%p%}&f&i&j&m&o&p&r&v'O'S']'m'}(P(V(^(r(v(z)n)y+O+S+^,e,h,m,y,|-^-f-t-z.[.l.s.{0[0a0q1_1o1p1r1t1w1z1|2]2m2s3P3Z3p5W5Y5d5t5u5x6S6]6j7w7|8]8g9W9i:c:f:g:j:k:l:m:n:o:p:q:r:s:t:u:v:w:{;Y;Z;[;^;e;f;o;p<]t!nQ!r!u!x!y'R'Y'Z'g'h'i-Q-W-Y-j1[5]5_$v$si#u#w$c$d$x${%O%Q%[%]%a)u){)}*P*R*Y*`*p*q+]+`+w+z.Z.i/Z/j/k/m0Q0S0^1R1U1^3O3x4S4[4f4n4p5c6g7T7^7y8j8w9[9n:O:W:y:z:|:};O;P;S;T;U;V;W;X;_;`;a;b;c;d;g;h;i;j;k;l;m;n;q;r < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem", maxTerm: 371, - context: t_e, + context: Y6e, nodeProps: [ ["group", -26, 8, 16, 18, 65, 201, 205, 209, 210, 212, 215, 218, 228, 230, 236, 238, 240, 242, 245, 251, 257, 259, 261, 263, 265, 267, 268, "Statement", -32, 12, 13, 28, 31, 32, 38, 48, 51, 52, 54, 59, 67, 75, 79, 81, 83, 84, 106, 107, 116, 117, 134, 137, 139, 140, 141, 142, 144, 145, 164, 165, 167, "Expression", -23, 27, 29, 33, 37, 39, 41, 168, 170, 172, 173, 175, 176, 177, 179, 180, 181, 183, 184, 185, 195, 197, 199, 200, "Type", -3, 87, 99, 105, "ClassItem"], ["openedBy", 22, "<", 34, "InterpolationStart", 53, "[", 57, "{", 72, "(", 157, "JSXStartCloseTag"], ["closedBy", 23, ">", 36, "InterpolationEnd", 47, "]", 58, "}", 73, ")", 162, "JSXEndTag"] ], - propSources: [a_e], + propSources: [Z6e], skippedNodes: [0, 4, 5, 271], repeatNodeCount: 37, tokenData: "$Fj(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#8g!R![#:v![!]#Gv!]!^#IS!^!_#J^!_!`#Ns!`!a$#_!a!b$(l!b!c$,k!c!}Er!}#O$-u#O#P$/P#P#Q$4h#Q#R$5r#R#SEr#S#T$7P#T#o$8Z#o#p$q#r#s$?}#s$f%Z$f$g+g$g#BYEr#BY#BZ$AX#BZ$ISEr$IS$I_$AX$I_$I|Er$I|$I}$Dd$I}$JO$Dd$JO$JTEr$JT$JU$AX$JU$KVEr$KV$KW$AX$KW&FUEr&FU&FV$AX&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$AX?HUOEr(n%d_$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$f&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$f&j(R!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(R!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$f&j(OpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(OpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Op(R!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z(CS+rq$f&j(Op(R!b't(;dOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z(CS.ST(P#S$f&j'u(;dO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c(CS.n_$f&j(Op(R!b'u(;dOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`/x`$f&j!o$Ip(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S1V`#t$Id$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S2d_#t$Id$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/|3l_'}$(n$f&j(R!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$f&j(R!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$f&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$a`$f&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$a``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$a`$f&j(R!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(R!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$a`(R!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k#%|:hh$f&j(Op(R!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXVS$f&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSVSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWVS(R!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]VS$f&j(OpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWVS(OpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYVS(Op(R!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%lQ^$f&j!USOY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@Y!_!}!=y!}#O!Bw#O#P!Dj#P#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!?Ta$f&j!USO!^&c!_#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&cS!@_X!USOY!@YZ!P!@Y!P!Q!@z!Q!}!@Y!}#O!Ac#O#P!Bb#P;'S!@Y;'S;=`!Bq<%lO!@YS!APU!US#Z#[!@z#]#^!@z#a#b!@z#g#h!@z#i#j!@z#m#n!@zS!AfVOY!AcZ#O!Ac#O#P!A{#P#Q!@Y#Q;'S!Ac;'S;=`!B[<%lO!AcS!BOSOY!AcZ;'S!Ac;'S;=`!B[<%lO!AcS!B_P;=`<%l!AcS!BeSOY!@YZ;'S!@Y;'S;=`!Bq<%lO!@YS!BtP;=`<%l!@Y&n!B|[$f&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#O!Bw#O#P!Cr#P#Q!=y#Q#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!CwX$f&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!DgP;=`<%l!Bw&n!DoX$f&jOY!=yYZ&cZ!^!=y!^!_!@Y!_#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!E_P;=`<%l!=y(Q!Eki$f&j(R!b!USOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#Z&}#Z#[!Eb#[#]&}#]#^!Eb#^#a&}#a#b!Eb#b#g&}#g#h!Eb#h#i&}#i#j!Eb#j#m&}#m#n!Eb#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!f!GaZ(R!b!USOY!GYZw!GYwx!@Yx!P!GY!P!Q!HS!Q!}!GY!}#O!Ic#O#P!Bb#P;'S!GY;'S;=`!JZ<%lO!GY!f!HZb(R!b!USOY'}Zw'}x#O'}#P#Z'}#Z#[!HS#[#]'}#]#^!HS#^#a'}#a#b!HS#b#g'}#g#h!HS#h#i'}#i#j!HS#j#m'}#m#n!HS#n;'S'};'S;=`(f<%lO'}!f!IhX(R!bOY!IcZw!Icwx!Acx#O!Ic#O#P!A{#P#Q!GY#Q;'S!Ic;'S;=`!JT<%lO!Ic!f!JWP;=`<%l!Ic!f!J^P;=`<%l!GY(Q!Jh^$f&j(R!bOY!JaYZ&cZw!Jawx!Bwx!^!Ja!^!_!Ic!_#O!Ja#O#P!Cr#P#Q!Q#V#X%Z#X#Y!4|#Y#b%Z#b#c#Zd$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#?tf$f&j(Op(R!bo$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#b%Z#b#c# o_e[t] || -1 }, { term: 334, get: (t) => l_e[t] || -1 }, { term: 70, get: (t) => c_e[t] || -1 }], + specialized: [{ term: 319, get: (t) => j6e[t] || -1 }, { term: 334, get: (t) => K6e[t] || -1 }, { term: 70, get: (t) => J6e[t] || -1 }], tokenPrec: 14626 -}), Cre = [ - /* @__PURE__ */ ka("function ${name}(${params}) {\n ${}\n}", { +}), one = [ + /* @__PURE__ */ Qa("function ${name}(${params}) {\n ${}\n}", { label: "function", detail: "definition", type: "keyword" }), - /* @__PURE__ */ ka("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}", { + /* @__PURE__ */ Qa("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}", { label: "for", detail: "loop", type: "keyword" }), - /* @__PURE__ */ ka("for (let ${name} of ${collection}) {\n ${}\n}", { + /* @__PURE__ */ Qa("for (let ${name} of ${collection}) {\n ${}\n}", { label: "for", detail: "of loop", type: "keyword" }), - /* @__PURE__ */ ka("do {\n ${}\n} while (${})", { + /* @__PURE__ */ Qa("do {\n ${}\n} while (${})", { label: "do", detail: "loop", type: "keyword" }), - /* @__PURE__ */ ka("while (${}) {\n ${}\n}", { + /* @__PURE__ */ Qa("while (${}) {\n ${}\n}", { label: "while", detail: "loop", type: "keyword" }), - /* @__PURE__ */ ka(`try { + /* @__PURE__ */ Qa(`try { \${} } catch (\${error}) { \${} @@ -23693,12 +23693,12 @@ const s_e = new ma((t, e) => { detail: "/ catch block", type: "keyword" }), - /* @__PURE__ */ ka("if (${}) {\n ${}\n}", { + /* @__PURE__ */ Qa("if (${}) {\n ${}\n}", { label: "if", detail: "block", type: "keyword" }), - /* @__PURE__ */ ka(`if (\${}) { + /* @__PURE__ */ Qa(`if (\${}) { \${} } else { \${} @@ -23707,7 +23707,7 @@ const s_e = new ma((t, e) => { detail: "/ else block", type: "keyword" }), - /* @__PURE__ */ ka(`class \${name} { + /* @__PURE__ */ Qa(`class \${name} { constructor(\${params}) { \${} } @@ -23716,33 +23716,33 @@ const s_e = new ma((t, e) => { detail: "definition", type: "keyword" }), - /* @__PURE__ */ ka('import {${names}} from "${module}"\n${}', { + /* @__PURE__ */ Qa('import {${names}} from "${module}"\n${}', { label: "import", detail: "named", type: "keyword" }), - /* @__PURE__ */ ka('import ${name} from "${module}"\n${}', { + /* @__PURE__ */ Qa('import ${name} from "${module}"\n${}', { label: "import", detail: "default", type: "keyword" }) -], h_e = /* @__PURE__ */ Cre.concat([ - /* @__PURE__ */ ka("interface ${name} {\n ${}\n}", { +], tAe = /* @__PURE__ */ one.concat([ + /* @__PURE__ */ Qa("interface ${name} {\n ${}\n}", { label: "interface", detail: "definition", type: "keyword" }), - /* @__PURE__ */ ka("type ${name} = ${type}", { + /* @__PURE__ */ Qa("type ${name} = ${type}", { label: "type", detail: "definition", type: "keyword" }), - /* @__PURE__ */ ka("enum ${name} {\n ${}\n}", { + /* @__PURE__ */ Qa("enum ${name} {\n ${}\n}", { label: "enum", detail: "definition", type: "keyword" }) -]), TQ = /* @__PURE__ */ new dJ(), Ere = /* @__PURE__ */ new Set([ +]), aU = /* @__PURE__ */ new XJ(), lne = /* @__PURE__ */ new Set([ "Script", "Block", "FunctionExpression", @@ -23751,29 +23751,29 @@ const s_e = new ma((t, e) => { "MethodDeclaration", "ForStatement" ]); -function K1(t) { +function Ov(t) { return (e, r) => { let n = e.node.getChild("VariableDefinition"); return n && r(n, t), !0; }; } -const f_e = ["FunctionDeclaration"], d_e = { - FunctionDeclaration: /* @__PURE__ */ K1("function"), - ClassDeclaration: /* @__PURE__ */ K1("class"), +const rAe = ["FunctionDeclaration"], nAe = { + FunctionDeclaration: /* @__PURE__ */ Ov("function"), + ClassDeclaration: /* @__PURE__ */ Ov("class"), ClassExpression: () => !0, - EnumDeclaration: /* @__PURE__ */ K1("constant"), - TypeAliasDeclaration: /* @__PURE__ */ K1("type"), - NamespaceDeclaration: /* @__PURE__ */ K1("namespace"), + EnumDeclaration: /* @__PURE__ */ Ov("constant"), + TypeAliasDeclaration: /* @__PURE__ */ Ov("type"), + NamespaceDeclaration: /* @__PURE__ */ Ov("namespace"), VariableDefinition(t, e) { - t.matchContext(f_e) || e(t, "variable"); + t.matchContext(rAe) || e(t, "variable"); }, TypeDefinition(t, e) { e(t, "type"); }, __proto__: null }; -function _re(t, e) { - let r = TQ.get(e); +function cne(t, e) { + let r = aU.get(e); if (r) return r; let n = [], i = !0; @@ -23781,21 +23781,21 @@ function _re(t, e) { let l = t.sliceString(a.from, a.to); n.push({ label: l, type: o }); } - return e.cursor(hn.IncludeAnonymous).iterate((a) => { + return e.cursor(Sn.IncludeAnonymous).iterate((a) => { if (i) i = !1; else if (a.name) { - let o = d_e[a.name]; - if (o && o(a, s) || Ere.has(a.name)) + let o = nAe[a.name]; + if (o && o(a, s) || lne.has(a.name)) return !1; } else if (a.to - a.from > 8192) { - for (let o of _re(t, a.node)) + for (let o of cne(t, a.node)) n.push(o); return !1; } - }), TQ.set(e, n), n; + }), aU.set(e, n), n; } -const CQ = /^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/, Are = [ +const oU = /^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/, une = [ "TemplateString", "String", "RegExp", @@ -23811,38 +23811,38 @@ const CQ = /^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/, Are = [ ".", "?." ]; -function p_e(t) { - let e = dn(t.state).resolveInner(t.pos, -1); - if (Are.indexOf(e.name) > -1) +function iAe(t) { + let e = Cn(t.state).resolveInner(t.pos, -1); + if (une.indexOf(e.name) > -1) return null; - let r = e.name == "VariableName" || e.to - e.from < 20 && CQ.test(t.state.sliceDoc(e.from, e.to)); + let r = e.name == "VariableName" || e.to - e.from < 20 && oU.test(t.state.sliceDoc(e.from, e.to)); if (!r && !t.explicit) return null; let n = []; for (let i = e; i; i = i.parent) - Ere.has(i.name) && (n = n.concat(_re(t.state.doc, i))); + lne.has(i.name) && (n = n.concat(cne(t.state.doc, i))); return { options: n, from: r ? e.from : t.pos, - validFor: CQ + validFor: oU }; } -const Nc = /* @__PURE__ */ yf.define({ +const eu = /* @__PURE__ */ If.define({ name: "javascript", - parser: /* @__PURE__ */ u_e.configure({ + parser: /* @__PURE__ */ eAe.configure({ props: [ - /* @__PURE__ */ jm.add({ - IfStatement: /* @__PURE__ */ P4({ except: /^\s*({|else\b)/ }), - TryStatement: /* @__PURE__ */ P4({ except: /^\s*({|catch\b|finally\b)/ }), - LabeledStatement: y4e, + /* @__PURE__ */ y1.add({ + IfStatement: /* @__PURE__ */ o5({ except: /^\s*({|else\b)/ }), + TryStatement: /* @__PURE__ */ o5({ except: /^\s*({|catch\b|finally\b)/ }), + LabeledStatement: l5e, SwitchBody: (t) => { let e = t.textAfter, r = /^\s*\}/.test(e), n = /^\s*(case|default)\b/.test(e); return t.baseIndent + (r ? 0 : n ? 1 : 2) * t.unit; }, - Block: /* @__PURE__ */ G7({ closing: "}" }), + Block: /* @__PURE__ */ O8({ closing: "}" }), ArrowFunction: (t) => t.baseIndent + t.unit, "TemplateString BlockComment": () => null, - "Statement Property": /* @__PURE__ */ P4({ except: /^{/ }), + "Statement Property": /* @__PURE__ */ o5({ except: /^{/ }), JSXElement(t) { let e = /^\s*<\//.test(t.textAfter); return t.lineIndent(t.node.from) + (e ? 0 : t.unit); @@ -23855,8 +23855,8 @@ const Nc = /* @__PURE__ */ yf.define({ return t.column(t.node.from) + t.unit; } }), - /* @__PURE__ */ X0.add({ - "Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType": DM, + /* @__PURE__ */ dp.add({ + "Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType": lD, BlockComment(t) { return { from: t.from + 2, to: t.to - 2 }; } @@ -23869,31 +23869,31 @@ const Nc = /* @__PURE__ */ yf.define({ indentOnInput: /^\s*(?:case |default:|\{|\}|<\/)$/, wordChars: "$" } -}), Lre = { +}), hne = { test: (t) => /^JSX/.test(t.name), - facet: /* @__PURE__ */ AM({ commentTokens: { block: { open: "{/*", close: "*/}" } } }) -}, Rre = /* @__PURE__ */ Nc.configure({ dialect: "ts" }, "typescript"), Mre = /* @__PURE__ */ Nc.configure({ + facet: /* @__PURE__ */ iD({ commentTokens: { block: { open: "{/*", close: "*/}" } } }) +}, fne = /* @__PURE__ */ eu.configure({ dialect: "ts" }, "typescript"), dne = /* @__PURE__ */ eu.configure({ dialect: "jsx", - props: [/* @__PURE__ */ LM.add((t) => t.isTop ? [Lre] : void 0)] -}), Dre = /* @__PURE__ */ Nc.configure({ + props: [/* @__PURE__ */ sD.add((t) => t.isTop ? [hne] : void 0)] +}), pne = /* @__PURE__ */ eu.configure({ dialect: "jsx ts", - props: [/* @__PURE__ */ LM.add((t) => t.isTop ? [Lre] : void 0)] + props: [/* @__PURE__ */ sD.add((t) => t.isTop ? [hne] : void 0)] }, "typescript"); -let Pre = (t) => ({ label: t, type: "keyword" }); -const Nre = /* @__PURE__ */ "break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(Pre), g_e = /* @__PURE__ */ Nre.concat(/* @__PURE__ */ ["declare", "implements", "private", "protected", "public"].map(Pre)); -function m_e(t = {}) { - let e = t.jsx ? t.typescript ? Dre : Mre : t.typescript ? Rre : Nc, r = t.typescript ? h_e.concat(g_e) : Cre.concat(Nre); - return new Wg(e, [ - Nc.data.of({ - autocomplete: Rke(Are, Tee(r)) +let gne = (t) => ({ label: t, type: "keyword" }); +const mne = /* @__PURE__ */ "break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(gne), sAe = /* @__PURE__ */ mne.concat(/* @__PURE__ */ ["declare", "implements", "private", "protected", "public"].map(gne)); +function aAe(t = {}) { + let e = t.jsx ? t.typescript ? pne : dne : t.typescript ? fne : eu, r = t.typescript ? tAe.concat(sAe) : one.concat(mne); + return new dm(e, [ + eu.data.of({ + autocomplete: w3e(une, ate(r)) }), - Nc.data.of({ - autocomplete: p_e + eu.data.of({ + autocomplete: iAe }), - t.jsx ? b_e : [] + t.jsx ? cAe : [] ]); } -function v_e(t) { +function oAe(t) { for (; ; ) { if (t.name == "JSXOpenTag" || t.name == "JSXSelfClosingTag" || t.name == "JSXFragmentTag") return t; @@ -23902,30 +23902,30 @@ function v_e(t) { t = t.parent; } } -function EQ(t, e, r = t.length) { +function lU(t, e, r = t.length) { for (let n = e == null ? void 0 : e.firstChild; n; n = n.nextSibling) if (n.name == "JSXIdentifier" || n.name == "JSXBuiltin" || n.name == "JSXNamespacedName" || n.name == "JSXMemberExpression") return t.sliceString(n.from, Math.min(n.to, r)); return ""; } -const y_e = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(navigator.userAgent), b_e = /* @__PURE__ */ ft.inputHandler.of((t, e, r, n, i) => { - if ((y_e ? t.composing : t.compositionStarted) || t.state.readOnly || e != r || n != ">" && n != "/" || !Nc.isActiveAt(t.state, e, -1)) +const lAe = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(navigator.userAgent), cAe = /* @__PURE__ */ kt.inputHandler.of((t, e, r, n, i) => { + if ((lAe ? t.composing : t.compositionStarted) || t.state.readOnly || e != r || n != ">" && n != "/" || !eu.isActiveAt(t.state, e, -1)) return !1; let s = i(), { state: a } = s, o = a.changeByRange((l) => { var u; - let { head: h } = l, f = dn(a).resolveInner(h - 1, -1), d; + let { head: h } = l, f = Cn(a).resolveInner(h - 1, -1), d; if (f.name == "JSXStartTag" && (f = f.parent), !(a.doc.sliceString(h - 1, h) != n || f.name == "JSXAttributeValue" && f.to > h)) { if (n == ">" && f.name == "JSXFragmentTag") return { range: l, changes: { from: h, insert: "" } }; if (n == "/" && f.name == "JSXStartCloseTag") { let p = f.parent, g = p.parent; - if (g && p.from == h - 2 && ((d = EQ(a.doc, g.firstChild, h)) || ((u = g.firstChild) === null || u === void 0 ? void 0 : u.name) == "JSXFragmentTag")) { + if (g && p.from == h - 2 && ((d = lU(a.doc, g.firstChild, h)) || ((u = g.firstChild) === null || u === void 0 ? void 0 : u.name) == "JSXFragmentTag")) { let m = `${d}>`; - return { range: Ue.cursor(h + m.length, -1), changes: { from: h, insert: m } }; + return { range: je.cursor(h + m.length, -1), changes: { from: h, insert: m } }; } } else if (n == ">") { - let p = v_e(f); - if (p && !/^\/?>|^<\//.test(a.doc.sliceString(h, h + 2)) && (d = EQ(a.doc, p, h))) + let p = oAe(f); + if (p && !/^\/?>|^<\//.test(a.doc.sliceString(h, h + 2)) && (d = lU(a.doc, p, h))) return { range: l, changes: { from: h, insert: `` } }; } } @@ -23935,19 +23935,19 @@ const y_e = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(nav s, a.update(o, { userEvent: "input.complete", scrollIntoView: !0 }) ]), !0); -}), J1 = ["_blank", "_self", "_top", "_parent"], T6 = ["ascii", "utf-8", "utf-16", "latin1", "latin1"], C6 = ["get", "post", "put", "delete"], E6 = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], eo = ["true", "false"], Bt = {}, x_e = { +}), kv = ["_blank", "_self", "_top", "_parent"], e6 = ["ascii", "utf-8", "utf-16", "latin1", "latin1"], t6 = ["get", "post", "put", "delete"], r6 = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], yo = ["true", "false"], Xt = {}, uAe = { a: { attrs: { href: null, ping: null, type: null, media: null, - target: J1, + target: kv, hreflang: null } }, - abbr: Bt, - address: Bt, + abbr: Xt, + address: Xt, area: { attrs: { alt: null, @@ -23961,8 +23961,8 @@ const y_e = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(nav shape: ["default", "rect", "circle", "poly"] } }, - article: Bt, - aside: Bt, + article: Xt, + aside: Xt, audio: { attrs: { src: null, @@ -23974,13 +23974,13 @@ const y_e = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(nav controls: ["controls"] } }, - b: Bt, - base: { attrs: { href: null, target: J1 } }, - bdi: Bt, - bdo: Bt, + b: Xt, + base: { attrs: { href: null, target: kv } }, + bdi: Xt, + bdo: Xt, blockquote: { attrs: { cite: null } }, - body: Bt, - br: Bt, + body: Xt, + br: Xt, button: { attrs: { form: null, @@ -23989,18 +23989,18 @@ const y_e = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(nav value: null, autofocus: ["autofocus"], disabled: ["autofocus"], - formenctype: E6, - formmethod: C6, + formenctype: r6, + formmethod: t6, formnovalidate: ["novalidate"], - formtarget: J1, + formtarget: kv, type: ["submit", "reset", "button"] } }, canvas: { attrs: { width: null, height: null } }, - caption: Bt, - center: Bt, - cite: Bt, - code: Bt, + caption: Xt, + center: Xt, + cite: Xt, + code: Xt, col: { attrs: { span: null } }, colgroup: { attrs: { span: null } }, command: { @@ -24018,48 +24018,48 @@ const y_e = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(nav data: { attrs: { value: null } }, datagrid: { attrs: { disabled: ["disabled"], multiple: ["multiple"] } }, datalist: { attrs: { data: null } }, - dd: Bt, + dd: Xt, del: { attrs: { cite: null, datetime: null } }, details: { attrs: { open: ["open"] } }, - dfn: Bt, - div: Bt, - dl: Bt, - dt: Bt, - em: Bt, + dfn: Xt, + div: Xt, + dl: Xt, + dt: Xt, + em: Xt, embed: { attrs: { src: null, type: null, width: null, height: null } }, eventsource: { attrs: { src: null } }, fieldset: { attrs: { disabled: ["disabled"], form: null, name: null } }, - figcaption: Bt, - figure: Bt, - footer: Bt, + figcaption: Xt, + figure: Xt, + footer: Xt, form: { attrs: { action: null, name: null, - "accept-charset": T6, + "accept-charset": e6, autocomplete: ["on", "off"], - enctype: E6, - method: C6, + enctype: r6, + method: t6, novalidate: ["novalidate"], - target: J1 + target: kv } }, - h1: Bt, - h2: Bt, - h3: Bt, - h4: Bt, - h5: Bt, - h6: Bt, + h1: Xt, + h2: Xt, + h3: Xt, + h4: Xt, + h5: Xt, + h6: Xt, head: { children: ["title", "base", "link", "style", "meta", "script", "noscript", "command"] }, - header: Bt, - hgroup: Bt, - hr: Bt, + header: Xt, + hgroup: Xt, + hr: Xt, html: { attrs: { manifest: null } }, - i: Bt, + i: Xt, iframe: { attrs: { src: null, @@ -24106,10 +24106,10 @@ const y_e = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(nav autofocus: ["autofocus"], checked: ["checked"], disabled: ["disabled"], - formenctype: E6, - formmethod: C6, + formenctype: r6, + formmethod: t6, formnovalidate: ["novalidate"], - formtarget: J1, + formtarget: kv, multiple: ["multiple"], readonly: ["readonly"], required: ["required"], @@ -24141,7 +24141,7 @@ const y_e = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(nav } }, ins: { attrs: { cite: null, datetime: null } }, - kbd: Bt, + kbd: Xt, keygen: { attrs: { challenge: null, @@ -24153,7 +24153,7 @@ const y_e = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(nav } }, label: { attrs: { for: null, form: null } }, - legend: Bt, + legend: Xt, li: { attrs: { value: null } }, link: { attrs: { @@ -24165,19 +24165,19 @@ const y_e = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(nav } }, map: { attrs: { name: null } }, - mark: Bt, + mark: Xt, menu: { attrs: { label: null, type: ["list", "context", "toolbar"] } }, meta: { attrs: { content: null, - charset: T6, + charset: e6, name: ["viewport", "application-name", "author", "description", "generator", "keywords"], "http-equiv": ["content-language", "content-type", "default-style", "refresh"] } }, meter: { attrs: { value: null, min: null, low: null, high: null, max: null, optimum: null } }, - nav: Bt, - noscript: Bt, + nav: Xt, + noscript: Xt, object: { attrs: { data: null, @@ -24197,25 +24197,25 @@ const y_e = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(nav optgroup: { attrs: { disabled: ["disabled"], label: null } }, option: { attrs: { disabled: ["disabled"], label: null, selected: ["selected"], value: null } }, output: { attrs: { for: null, form: null, name: null } }, - p: Bt, + p: Xt, param: { attrs: { name: null, value: null } }, - pre: Bt, + pre: Xt, progress: { attrs: { value: null, max: null } }, q: { attrs: { cite: null } }, - rp: Bt, - rt: Bt, - ruby: Bt, - samp: Bt, + rp: Xt, + rt: Xt, + ruby: Xt, + samp: Xt, script: { attrs: { type: ["text/javascript"], src: null, async: ["async"], defer: ["defer"], - charset: T6 + charset: e6 } }, - section: Bt, + section: Xt, select: { attrs: { form: null, @@ -24227,10 +24227,10 @@ const y_e = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(nav } }, slot: { attrs: { name: null } }, - small: Bt, + small: Xt, source: { attrs: { src: null, type: null, media: null } }, - span: Bt, - strong: Bt, + span: Xt, + strong: Xt, style: { attrs: { type: ["text/css"], @@ -24238,13 +24238,13 @@ const y_e = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(nav scoped: null } }, - sub: Bt, - summary: Bt, - sup: Bt, - table: Bt, - tbody: Bt, + sub: Xt, + summary: Xt, + sup: Xt, + table: Xt, + tbody: Xt, td: { attrs: { colspan: null, rowspan: null, headers: null } }, - template: Bt, + template: Xt, textarea: { attrs: { dirname: null, @@ -24261,12 +24261,12 @@ const y_e = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(nav wrap: ["soft", "hard"] } }, - tfoot: Bt, + tfoot: Xt, th: { attrs: { colspan: null, rowspan: null, headers: null, scope: ["row", "col", "rowgroup", "colgroup"] } }, - thead: Bt, + thead: Xt, time: { attrs: { datetime: null } }, - title: Bt, - tr: Bt, + title: Xt, + tr: Xt, track: { attrs: { src: null, @@ -24277,7 +24277,7 @@ const y_e = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(nav } }, ul: { children: ["li", "script", "template", "ul", "ol"] }, - var: Bt, + var: Xt, video: { attrs: { src: null, @@ -24292,11 +24292,11 @@ const y_e = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(nav controls: ["controls"] } }, - wbr: Bt -}, Ire = { + wbr: Xt +}, vne = { accesskey: null, class: null, - contenteditable: eo, + contenteditable: yo, contextmenu: null, dir: ["ltr", "rtl", "auto"], draggable: ["true", "false", "auto"], @@ -24310,9 +24310,9 @@ const y_e = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(nav itemscope: ["itemscope"], itemtype: null, lang: ["ar", "bn", "de", "en-GB", "en-US", "es", "fr", "hi", "id", "ja", "pa", "pt", "ru", "tr", "zh"], - spellcheck: eo, - autocorrect: eo, - autocapitalize: eo, + spellcheck: yo, + autocorrect: yo, + autocapitalize: yo, style: null, tabindex: null, title: null, @@ -24320,32 +24320,32 @@ const y_e = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(nav rel: ["stylesheet", "alternate", "author", "bookmark", "help", "license", "next", "nofollow", "noreferrer", "prefetch", "prev", "search", "tag"], role: /* @__PURE__ */ "alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "), "aria-activedescendant": null, - "aria-atomic": eo, + "aria-atomic": yo, "aria-autocomplete": ["inline", "list", "both", "none"], - "aria-busy": eo, + "aria-busy": yo, "aria-checked": ["true", "false", "mixed", "undefined"], "aria-controls": null, "aria-describedby": null, - "aria-disabled": eo, + "aria-disabled": yo, "aria-dropeffect": null, "aria-expanded": ["true", "false", "undefined"], "aria-flowto": null, "aria-grabbed": ["true", "false", "undefined"], - "aria-haspopup": eo, - "aria-hidden": eo, + "aria-haspopup": yo, + "aria-hidden": yo, "aria-invalid": ["true", "false", "grammar", "spelling"], "aria-label": null, "aria-labelledby": null, "aria-level": null, "aria-live": ["off", "polite", "assertive"], - "aria-multiline": eo, - "aria-multiselectable": eo, + "aria-multiline": yo, + "aria-multiselectable": yo, "aria-owns": null, "aria-posinset": null, "aria-pressed": ["true", "false", "mixed", "undefined"], - "aria-readonly": eo, + "aria-readonly": yo, "aria-relevant": null, - "aria-required": eo, + "aria-required": yo, "aria-selected": ["true", "false", "undefined"], "aria-setsize": null, "aria-sort": ["ascending", "descending", "none", "other"], @@ -24353,22 +24353,22 @@ const y_e = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(nav "aria-valuemin": null, "aria-valuenow": null, "aria-valuetext": null -}, $re = /* @__PURE__ */ "beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map((t) => "on" + t); -for (let t of $re) - Ire[t] = null; -class m2 { +}, yne = /* @__PURE__ */ "beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map((t) => "on" + t); +for (let t of yne) + vne[t] = null; +class z2 { constructor(e, r) { - this.tags = Object.assign(Object.assign({}, x_e), e), this.globalAttrs = Object.assign(Object.assign({}, Ire), r), this.allTags = Object.keys(this.tags), this.globalAttrNames = Object.keys(this.globalAttrs); + this.tags = Object.assign(Object.assign({}, uAe), e), this.globalAttrs = Object.assign(Object.assign({}, vne), r), this.allTags = Object.keys(this.tags), this.globalAttrNames = Object.keys(this.globalAttrs); } } -m2.default = /* @__PURE__ */ new m2(); -function tm(t, e, r = t.length) { +z2.default = /* @__PURE__ */ new z2(); +function Om(t, e, r = t.length) { if (!e) return ""; let n = e.firstChild, i = n && n.getChild("TagName"); return i ? t.sliceString(i.from, Math.min(i.to, r)) : ""; } -function rm(t, e = !1) { +function km(t, e = !1) { for (; t; t = t.parent) if (t.name == "Element") if (e) @@ -24377,27 +24377,27 @@ function rm(t, e = !1) { return t; return null; } -function Bre(t, e, r) { - let n = r.tags[tm(t, rm(e))]; +function bne(t, e, r) { + let n = r.tags[Om(t, km(e))]; return (n == null ? void 0 : n.children) || r.allTags; } -function SD(t, e) { +function JD(t, e) { let r = []; - for (let n = rm(e); n && !n.type.isTop; n = rm(n.parent)) { - let i = tm(t, n); + for (let n = km(e); n && !n.type.isTop; n = km(n.parent)) { + let i = Om(t, n); if (i && n.lastChild.name == "CloseTag") break; i && r.indexOf(i) < 0 && (e.name == "EndTag" || e.from >= n.firstChild.to) && r.push(i); } return r; } -const Fre = /^[:\-\.\w\u00b7-\uffff]*$/; -function _Q(t, e, r, n, i) { - let s = /\s*>/.test(t.sliceDoc(i, i + 5)) ? "" : ">", a = rm(r, !0); +const xne = /^[:\-\.\w\u00b7-\uffff]*$/; +function cU(t, e, r, n, i) { + let s = /\s*>/.test(t.sliceDoc(i, i + 5)) ? "" : ">", a = km(r, !0); return { from: n, to: i, - options: Bre(t.doc, a, e).map((o) => ({ label: o, type: "type" })).concat(SD(t.doc, r).map((o, l) => ({ + options: bne(t.doc, a, e).map((o) => ({ label: o, type: "type" })).concat(JD(t.doc, r).map((o, l) => ({ label: "/" + o, apply: "/" + o + s, type: "type", @@ -24406,39 +24406,39 @@ function _Q(t, e, r, n, i) { validFor: /^\/?[:\-\.\w\u00b7-\uffff]*$/ }; } -function AQ(t, e, r, n) { +function uU(t, e, r, n) { let i = /\s*>/.test(t.sliceDoc(n, n + 5)) ? "" : ">"; return { from: r, to: n, - options: SD(t.doc, e).map((s, a) => ({ label: s, apply: s + i, type: "type", boost: 99 - a })), - validFor: Fre + options: JD(t.doc, e).map((s, a) => ({ label: s, apply: s + i, type: "type", boost: 99 - a })), + validFor: xne }; } -function w_e(t, e, r, n) { +function hAe(t, e, r, n) { let i = [], s = 0; - for (let a of Bre(t.doc, r, e)) + for (let a of bne(t.doc, r, e)) i.push({ label: "<" + a, type: "type" }); - for (let a of SD(t.doc, r)) + for (let a of JD(t.doc, r)) i.push({ label: "", type: "type", boost: 99 - s++ }); return { from: n, to: n, options: i, validFor: /^<\/?[:\-\.\w\u00b7-\uffff]*$/ }; } -function O_e(t, e, r, n, i) { - let s = rm(r), a = s ? e.tags[tm(t.doc, s)] : null, o = a && a.attrs ? Object.keys(a.attrs) : [], l = a && a.globalAttrs === !1 ? o : o.length ? o.concat(e.globalAttrNames) : e.globalAttrNames; +function fAe(t, e, r, n, i) { + let s = km(r), a = s ? e.tags[Om(t.doc, s)] : null, o = a && a.attrs ? Object.keys(a.attrs) : [], l = a && a.globalAttrs === !1 ? o : o.length ? o.concat(e.globalAttrNames) : e.globalAttrNames; return { from: n, to: i, options: l.map((u) => ({ label: u, type: "property" })), - validFor: Fre + validFor: xne }; } -function k_e(t, e, r, n, i) { +function dAe(t, e, r, n, i) { var s; let a = (s = r.parent) === null || s === void 0 ? void 0 : s.getChild("AttributeName"), o = [], l; if (a) { let u = t.sliceDoc(a.from, a.to), h = e.globalAttrs[u]; if (!h) { - let f = rm(r), d = f ? e.tags[tm(t.doc, f)] : null; + let f = km(r), d = f ? e.tags[Om(t.doc, f)] : null; h = (d == null ? void 0 : d.attrs) && d.attrs[u]; } if (h) { @@ -24450,70 +24450,70 @@ function k_e(t, e, r, n, i) { } return { from: n, to: i, options: o, validFor: l }; } -function zre(t, e) { - let { state: r, pos: n } = e, i = dn(r).resolveInner(n, -1), s = i.resolve(n); +function wne(t, e) { + let { state: r, pos: n } = e, i = Cn(r).resolveInner(n, -1), s = i.resolve(n); for (let a = n, o; s == i && (o = i.childBefore(a)); ) { let l = o.lastChild; if (!l || !l.type.isError || l.from < l.to) break; s = i = o, a = l.from; } - return i.name == "TagName" ? i.parent && /CloseTag$/.test(i.parent.name) ? AQ(r, i, i.from, n) : _Q(r, t, i, i.from, n) : i.name == "StartTag" ? _Q(r, t, i, n, n) : i.name == "StartCloseTag" || i.name == "IncompleteCloseTag" ? AQ(r, i, n, n) : e.explicit && (i.name == "OpenTag" || i.name == "SelfClosingTag") || i.name == "AttributeName" ? O_e(r, t, i, i.name == "AttributeName" ? i.from : n, n) : i.name == "Is" || i.name == "AttributeValue" || i.name == "UnquotedAttributeValue" ? k_e(r, t, i, i.name == "Is" ? n : i.from, n) : e.explicit && (s.name == "Element" || s.name == "Text" || s.name == "Document") ? w_e(r, t, i, n) : null; + return i.name == "TagName" ? i.parent && /CloseTag$/.test(i.parent.name) ? uU(r, i, i.from, n) : cU(r, t, i, i.from, n) : i.name == "StartTag" ? cU(r, t, i, n, n) : i.name == "StartCloseTag" || i.name == "IncompleteCloseTag" ? uU(r, i, n, n) : e.explicit && (i.name == "OpenTag" || i.name == "SelfClosingTag") || i.name == "AttributeName" ? fAe(r, t, i, i.name == "AttributeName" ? i.from : n, n) : i.name == "Is" || i.name == "AttributeValue" || i.name == "UnquotedAttributeValue" ? dAe(r, t, i, i.name == "Is" ? n : i.from, n) : e.explicit && (s.name == "Element" || s.name == "Text" || s.name == "Document") ? hAe(r, t, i, n) : null; } -function S_e(t) { - return zre(m2.default, t); +function pAe(t) { + return wne(z2.default, t); } -function T_e(t) { - let { extraTags: e, extraGlobalAttributes: r } = t, n = r || e ? new m2(e, r) : m2.default; - return (i) => zre(n, i); +function gAe(t) { + let { extraTags: e, extraGlobalAttributes: r } = t, n = r || e ? new z2(e, r) : z2.default; + return (i) => wne(n, i); } -const C_e = /* @__PURE__ */ Nc.parser.configure({ top: "SingleExpression" }), Qre = [ +const mAe = /* @__PURE__ */ eu.parser.configure({ top: "SingleExpression" }), One = [ { tag: "script", attrs: (t) => t.type == "text/typescript" || t.lang == "ts", - parser: Rre.parser + parser: fne.parser }, { tag: "script", attrs: (t) => t.type == "text/babel" || t.type == "text/jsx", - parser: Mre.parser + parser: dne.parser }, { tag: "script", attrs: (t) => t.type == "text/typescript-jsx", - parser: Dre.parser + parser: pne.parser }, { tag: "script", attrs(t) { return /^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type); }, - parser: C_e + parser: mAe }, { tag: "script", attrs(t) { return !t.type || /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type); }, - parser: Nc.parser + parser: eu.parser }, { tag: "style", attrs(t) { return (!t.lang || t.lang == "css") && (!t.type || /^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type)); }, - parser: kk.parser + parser: Zk.parser } -], Ure = /* @__PURE__ */ [ +], kne = /* @__PURE__ */ [ { name: "style", - parser: /* @__PURE__ */ kk.parser.configure({ top: "Styles" }) + parser: /* @__PURE__ */ Zk.parser.configure({ top: "Styles" }) } -].concat(/* @__PURE__ */ $re.map((t) => ({ name: t, parser: Nc.parser }))), Vre = /* @__PURE__ */ yf.define({ +].concat(/* @__PURE__ */ yne.map((t) => ({ name: t, parser: eu.parser }))), Sne = /* @__PURE__ */ If.define({ name: "html", - parser: /* @__PURE__ */ u6e.configure({ + parser: /* @__PURE__ */ e6e.configure({ props: [ - /* @__PURE__ */ jm.add({ + /* @__PURE__ */ y1.add({ Element(t) { let e = /^(\s*)(<\/)?/.exec(t.textAfter); return t.node.to <= t.pos + e[0].length ? t.continue() : t.lineIndent(t.node.from) + (e[2] ? 0 : t.unit); @@ -24534,13 +24534,13 @@ const C_e = /* @__PURE__ */ Nc.parser.configure({ top: "SingleExpression" }), Qr return e && !((r = e.lastChild) && (r.name == "CloseTag" || r.name == "SelfClosingTag")) ? t.lineIndent(e.from) + t.unit : null; } }), - /* @__PURE__ */ X0.add({ + /* @__PURE__ */ dp.add({ Element(t) { let e = t.firstChild, r = t.lastChild; return !e || e.name != "OpenTag" ? null : { from: e.to, to: r.name == "CloseTag" ? r.from : t.to }; } }), - /* @__PURE__ */ DJ.add({ + /* @__PURE__ */ pee.add({ "OpenTag CloseTag": (t) => t.getChild("TagName") }) ] @@ -24550,37 +24550,37 @@ const C_e = /* @__PURE__ */ Nc.parser.configure({ top: "SingleExpression" }), Qr indentOnInput: /^\s*<\/\w+\W$/, wordChars: "-._" } -}), U4 = /* @__PURE__ */ Vre.configure({ - wrap: /* @__PURE__ */ wre(Qre, Ure) +}), g5 = /* @__PURE__ */ Sne.configure({ + wrap: /* @__PURE__ */ rne(One, kne) }); -function E_e(t = {}) { +function vAe(t = {}) { let e = "", r; - t.matchClosingTags === !1 && (e = "noMatch"), t.selfClosingTags === !0 && (e = (e ? e + " " : "") + "selfClosing"), (t.nestedLanguages && t.nestedLanguages.length || t.nestedAttributes && t.nestedAttributes.length) && (r = wre((t.nestedLanguages || []).concat(Qre), (t.nestedAttributes || []).concat(Ure))); - let n = r ? Vre.configure({ wrap: r, dialect: e }) : e ? U4.configure({ dialect: e }) : U4; - return new Wg(n, [ - U4.data.of({ autocomplete: T_e(t) }), - t.autoCloseTags !== !1 ? __e : [], - m_e().support, - F6e().support + t.matchClosingTags === !1 && (e = "noMatch"), t.selfClosingTags === !0 && (e = (e ? e + " " : "") + "selfClosing"), (t.nestedLanguages && t.nestedLanguages.length || t.nestedAttributes && t.nestedAttributes.length) && (r = rne((t.nestedLanguages || []).concat(One), (t.nestedAttributes || []).concat(kne))); + let n = r ? Sne.configure({ wrap: r, dialect: e }) : e ? g5.configure({ dialect: e }) : g5; + return new dm(n, [ + g5.data.of({ autocomplete: gAe(t) }), + t.autoCloseTags !== !1 ? yAe : [], + aAe().support, + A6e().support ]); } -const LQ = /* @__PURE__ */ new Set(/* @__PURE__ */ "area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")), __e = /* @__PURE__ */ ft.inputHandler.of((t, e, r, n, i) => { - if (t.composing || t.state.readOnly || e != r || n != ">" && n != "/" || !U4.isActiveAt(t.state, e, -1)) +const hU = /* @__PURE__ */ new Set(/* @__PURE__ */ "area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")), yAe = /* @__PURE__ */ kt.inputHandler.of((t, e, r, n, i) => { + if (t.composing || t.state.readOnly || e != r || n != ">" && n != "/" || !g5.isActiveAt(t.state, e, -1)) return !1; let s = i(), { state: a } = s, o = a.changeByRange((l) => { var u, h, f; - let d = a.doc.sliceString(l.from - 1, l.to) == n, { head: p } = l, g = dn(a).resolveInner(p - 1, -1), m; + let d = a.doc.sliceString(l.from - 1, l.to) == n, { head: p } = l, g = Cn(a).resolveInner(p - 1, -1), m; if ((g.name == "TagName" || g.name == "StartTag") && (g = g.parent), d && n == ">" && g.name == "OpenTag") { - if (((h = (u = g.parent) === null || u === void 0 ? void 0 : u.lastChild) === null || h === void 0 ? void 0 : h.name) != "CloseTag" && (m = tm(a.doc, g.parent, p)) && !LQ.has(m)) { + if (((h = (u = g.parent) === null || u === void 0 ? void 0 : u.lastChild) === null || h === void 0 ? void 0 : h.name) != "CloseTag" && (m = Om(a.doc, g.parent, p)) && !hU.has(m)) { let v = p + (a.doc.sliceString(p, p + 1) === ">" ? 1 : 0), y = ``; return { range: l, changes: { from: p, to: v, insert: y } }; } } else if (d && n == "/" && g.name == "IncompleteCloseTag") { let v = g.parent; - if (g.from == p - 2 && ((f = v.lastChild) === null || f === void 0 ? void 0 : f.name) != "CloseTag" && (m = tm(a.doc, v, p)) && !LQ.has(m)) { + if (g.from == p - 2 && ((f = v.lastChild) === null || f === void 0 ? void 0 : f.name) != "CloseTag" && (m = Om(a.doc, v, p)) && !hU.has(m)) { let y = p + (a.doc.sliceString(p, p + 1) === ">" ? 1 : 0), b = `${m}>`; return { - range: Ue.cursor(p + b.length, -1), + range: je.cursor(p + b.length, -1), changes: { from: p, to: y, insert: b } }; } @@ -24594,66 +24594,66 @@ const LQ = /* @__PURE__ */ new Set(/* @__PURE__ */ "area base br col command emb scrollIntoView: !0 }) ]), !0); -}), qre = /* @__PURE__ */ AM({ commentTokens: { block: { open: "" } } }), Yre = /* @__PURE__ */ new or(), Wre = /* @__PURE__ */ sEe.configure({ +}), Tne = /* @__PURE__ */ iD({ commentTokens: { block: { open: "" } } }), Cne = /* @__PURE__ */ new yr(), Ene = /* @__PURE__ */ HEe.configure({ props: [ - /* @__PURE__ */ X0.add((t) => !t.is("Block") || t.is("Document") || C8(t) != null ? void 0 : (e, r) => ({ from: r.doc.lineAt(e.from).to, to: e.to })), - /* @__PURE__ */ Yre.add(C8), - /* @__PURE__ */ jm.add({ + /* @__PURE__ */ dp.add((t) => !t.is("Block") || t.is("Document") || t9(t) != null ? void 0 : (e, r) => ({ from: r.doc.lineAt(e.from).to, to: e.to })), + /* @__PURE__ */ Cne.add(t9), + /* @__PURE__ */ y1.add({ Document: () => null }), - /* @__PURE__ */ zd.add({ - Document: qre + /* @__PURE__ */ s0.add({ + Document: Tne }) ] }); -function C8(t) { +function t9(t) { let e = /^(?:ATX|Setext)Heading(\d)$/.exec(t.name); return e ? +e[1] : void 0; } -function A_e(t, e) { +function bAe(t, e) { let r = t; for (; ; ) { let n = r.nextSibling, i; - if (!n || (i = C8(n.type)) != null && i <= e) + if (!n || (i = t9(n.type)) != null && i <= e) break; r = n; } return r.to; } -const L_e = /* @__PURE__ */ xJ.of((t, e, r) => { - for (let n = dn(t).resolveInner(r, -1); n && !(n.from < e); n = n.parent) { - let i = n.type.prop(Yre); +const xAe = /* @__PURE__ */ tee.of((t, e, r) => { + for (let n = Cn(t).resolveInner(r, -1); n && !(n.from < e); n = n.parent) { + let i = n.type.prop(Cne); if (i == null) continue; - let s = A_e(n, i); + let s = bAe(n, i); if (s > r) return { from: r, to: s }; } return null; }); -function TD(t) { - return new $o(qre, t, [L_e], "markdown"); +function eP(t) { + return new el(Tne, t, [xAe], "markdown"); } -const R_e = /* @__PURE__ */ TD(Wre), M_e = /* @__PURE__ */ Wre.configure([mEe, yEe, vEe, bEe, { +const wAe = /* @__PURE__ */ eP(Ene), OAe = /* @__PURE__ */ Ene.configure([a_e, l_e, o_e, c_e, { props: [ - /* @__PURE__ */ X0.add({ + /* @__PURE__ */ dp.add({ Table: (t, e) => ({ from: e.doc.lineAt(t.from).to, to: t.to }) }) ] -}]), Gre = /* @__PURE__ */ TD(M_e); -function D_e(t, e) { +}]), _ne = /* @__PURE__ */ eP(OAe); +function kAe(t, e) { return (r) => { if (r && t) { let n = null; - if (r = /\S*/.exec(r)[0], typeof t == "function" ? n = t(r) : n = H5.matchLanguageName(t, r, !0), n instanceof H5) - return n.support ? n.support.language.parser : jy.getSkippingParser(n.load()); + if (r = /\S*/.exec(r)[0], typeof t == "function" ? n = t(r) : n = Ok.matchLanguageName(t, r, !0), n instanceof Ok) + return n.support ? n.support.language.parser : w2.getSkippingParser(n.load()); if (n) return n.parser; } return e ? e.parser : null; }; } -class sO { +class MO { constructor(e, r, n, i, s, a, o) { this.node = e, this.from = r, this.to = n, this.spaceBefore = i, this.spaceAfter = s, this.type = a, this.item = o; } @@ -24670,11 +24670,11 @@ class sO { } } marker(e, r) { - let n = this.node.name == "OrderedList" ? String(+Hre(this.item, e)[2] + r) : ""; + let n = this.node.name == "OrderedList" ? String(+Lne(this.item, e)[2] + r) : ""; return this.spaceBefore + n + this.type + this.spaceAfter; } } -function Xre(t, e) { +function Ane(t, e) { let r = []; for (let i = t; i && i.name != "Document"; i = i.parent) (i.name == "ListItem" || i.name == "Blockquote" || i.name == "FencedCode") && r.push(i); @@ -24682,28 +24682,28 @@ function Xre(t, e) { for (let i = r.length - 1; i >= 0; i--) { let s = r[i], a, o = e.lineAt(s.from), l = s.from - o.from; if (s.name == "FencedCode") - n.push(new sO(s, l, l, "", "", "", null)); + n.push(new MO(s, l, l, "", "", "", null)); else if (s.name == "Blockquote" && (a = /^ *>( ?)/.exec(o.text.slice(l)))) - n.push(new sO(s, l, l + a[0].length, "", a[1], ">", null)); + n.push(new MO(s, l, l + a[0].length, "", a[1], ">", null)); else if (s.name == "ListItem" && s.parent.name == "OrderedList" && (a = /^( *)\d+([.)])( *)/.exec(o.text.slice(l)))) { let u = a[3], h = a[0].length; - u.length >= 4 && (u = u.slice(0, u.length - 4), h -= 4), n.push(new sO(s.parent, l, l + h, a[1], u, a[2], s)); + u.length >= 4 && (u = u.slice(0, u.length - 4), h -= 4), n.push(new MO(s.parent, l, l + h, a[1], u, a[2], s)); } else if (s.name == "ListItem" && s.parent.name == "BulletList" && (a = /^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(l)))) { let u = a[4], h = a[0].length; u.length > 4 && (u = u.slice(0, u.length - 4), h -= 4); let f = a[2]; - a[3] && (f += a[3].replace(/[xX]/, " ")), n.push(new sO(s.parent, l, l + h, a[1], u, f, s)); + a[3] && (f += a[3].replace(/[xX]/, " ")), n.push(new MO(s.parent, l, l + h, a[1], u, f, s)); } } return n; } -function Hre(t, e) { +function Lne(t, e) { return /^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from, t.from + 10)); } -function _6(t, e, r, n = 0) { +function n6(t, e, r, n = 0) { for (let i = -1, s = t; ; ) { if (s.name == "ListItem") { - let o = Hre(s, e), l = +o[2]; + let o = Lne(s, e), l = +o[2]; if (i >= 0) { if (l != i + 1) return; @@ -24717,20 +24717,20 @@ function _6(t, e, r, n = 0) { s = a; } } -function E8(t, e) { +function r9(t, e) { let r = /^[ \t]*/.exec(t)[0].length; - if (!r || e.facet(px) != " ") + if (!r || e.facet(Bx) != " ") return t; - let n = $l(t, 4, r), i = ""; + let n = tc(t, 4, r), i = ""; for (let s = n; s > 0; ) s >= 4 ? (i += " ", s -= 4) : (i += " ", s--); return i + t.slice(r); } -const P_e = ({ state: t, dispatch: e }) => { - let r = dn(t), { doc: n } = t, i = null, s = t.changeByRange((a) => { - if (!a.empty || !Gre.isActiveAt(t, a.from)) +const SAe = ({ state: t, dispatch: e }) => { + let r = Cn(t), { doc: n } = t, i = null, s = t.changeByRange((a) => { + if (!a.empty || !_ne.isActiveAt(t, a.from)) return i = { range: a }; - let o = a.from, l = n.lineAt(o), u = Xre(r.resolveInner(o, -1), n); + let o = a.from, l = n.lineAt(o), u = Ane(r.resolveInner(o, -1), n); for (; u.length && u[u.length - 1].from > o - l.from; ) u.pop(); if (!u.length) @@ -24744,13 +24744,13 @@ const P_e = ({ state: t, dispatch: e }) => { let v = u.length > 1 ? u[u.length - 2] : null, y, b = ""; v && v.item ? (y = l.from + v.from, b = v.marker(n, 1)) : y = l.from + (v ? v.to : 0); let w = [{ from: y, to: o, insert: b }]; - return h.node.name == "OrderedList" && _6(h.item, n, w, -2), v && v.node.name == "OrderedList" && _6(v.item, n, w), { range: Ue.cursor(y + b.length), changes: w }; + return h.node.name == "OrderedList" && n6(h.item, n, w, -2), v && v.node.name == "OrderedList" && n6(v.item, n, w), { range: je.cursor(y + b.length), changes: w }; } else { let v = ""; for (let y = 0, b = u.length - 2; y <= b; y++) - v += u[y].blank(y < b ? $l(l.text, 4, u[y + 1].from) - v.length : null, y < b); - return v = E8(v, t), { - range: Ue.cursor(o + v.length + 1), + v += u[y].blank(y < b ? tc(l.text, 4, u[y + 1].from) - v.length : null, y < b); + return v = r9(v, t), { + range: je.cursor(o + v.length + 1), changes: { from: l.from, insert: v + t.lineBreak } }; } @@ -24765,26 +24765,26 @@ const P_e = ({ state: t, dispatch: e }) => { } } let d = []; - h.node.name == "OrderedList" && _6(h.item, n, d); + h.node.name == "OrderedList" && n6(h.item, n, d); let p = h.item && h.item.from < l.from, g = ""; if (!p || /^[\s\d.)\-+*>]*/.exec(l.text)[0].length >= h.to) for (let v = 0, y = u.length - 1; v <= y; v++) - g += v == y && !p ? u[v].marker(n, 1) : u[v].blank(v < y ? $l(l.text, 4, u[v + 1].from) - g.length : null); + g += v == y && !p ? u[v].marker(n, 1) : u[v].blank(v < y ? tc(l.text, 4, u[v + 1].from) - g.length : null); let m = o; for (; m > l.from && /\s/.test(l.text.charAt(m - l.from - 1)); ) m--; - return g = E8(g, t), d.push({ from: m, to: o, insert: t.lineBreak + g }), { range: Ue.cursor(m + g.length + 1), changes: d }; + return g = r9(g, t), d.push({ from: m, to: o, insert: t.lineBreak + g }), { range: je.cursor(m + g.length + 1), changes: d }; }); return i ? !1 : (e(t.update(s, { scrollIntoView: !0, userEvent: "input" })), !0); }; -function RQ(t) { +function fU(t) { return t.name == "QuoteMark" || t.name == "ListMark"; } -function N_e(t, e) { +function TAe(t, e) { let r = t.resolveInner(e, -1), n = e; - RQ(r) && (n = r.from, r = r.parent); + fU(r) && (n = r.from, r = r.parent); for (let i; i = r.childBefore(n); ) - if (RQ(i)) + if (fU(i)) n = i.from; else if (i.name == "OrderedList" || i.name == "BulletList") r = i.lastChild, n = r.to; @@ -24792,55 +24792,55 @@ function N_e(t, e) { break; return r; } -const I_e = ({ state: t, dispatch: e }) => { - let r = dn(t), n = null, i = t.changeByRange((s) => { +const CAe = ({ state: t, dispatch: e }) => { + let r = Cn(t), n = null, i = t.changeByRange((s) => { let a = s.from, { doc: o } = t; - if (s.empty && Gre.isActiveAt(t, s.from)) { - let l = o.lineAt(a), u = Xre(N_e(r, a), o); + if (s.empty && _ne.isActiveAt(t, s.from)) { + let l = o.lineAt(a), u = Ane(TAe(r, a), o); if (u.length) { let h = u[u.length - 1], f = h.to - h.spaceAfter.length + (h.spaceAfter ? 1 : 0); if (a - l.from > f && !/\S/.test(l.text.slice(f, a - l.from))) return { - range: Ue.cursor(l.from + f), + range: je.cursor(l.from + f), changes: { from: l.from + f, to: a } }; if (a - l.from == f && (!h.item || l.from <= h.item.from || !/\S/.test(l.text.slice(0, h.to)))) { let d = l.from + h.from; if (h.item && h.node.from < h.item.from && /\S/.test(l.text.slice(h.from, h.to))) { - let p = h.blank($l(l.text, 4, h.to) - $l(l.text, 4, h.from)); - return d == l.from && (p = E8(p, t)), { - range: Ue.cursor(d + p.length), + let p = h.blank(tc(l.text, 4, h.to) - tc(l.text, 4, h.from)); + return d == l.from && (p = r9(p, t)), { + range: je.cursor(d + p.length), changes: { from: d, to: l.from + h.to, insert: p } }; } if (d < a) - return { range: Ue.cursor(d), changes: { from: d, to: a } }; + return { range: je.cursor(d), changes: { from: d, to: a } }; } } } return n = { range: s }; }); return n ? !1 : (e(t.update(i, { scrollIntoView: !0, userEvent: "delete" })), !0); -}, $_e = [ - { key: "Enter", run: P_e }, - { key: "Backspace", run: I_e } -], _8 = /* @__PURE__ */ E_e({ matchClosingTags: !1 }); -function B_e(t = {}) { - let { codeLanguages: e, defaultCodeLanguage: r, addKeymap: n = !0, base: { parser: i } = R_e, completeHTMLTags: s = !0 } = t; - if (!(i instanceof _T)) +}, EAe = [ + { key: "Enter", run: SAe }, + { key: "Backspace", run: CAe } +], n9 = /* @__PURE__ */ vAe({ matchClosingTags: !1 }); +function _Ae(t = {}) { + let { codeLanguages: e, defaultCodeLanguage: r, addKeymap: n = !0, base: { parser: i } = wAe, completeHTMLTags: s = !0 } = t; + if (!(i instanceof tC)) throw new RangeError("Base parser provided to `markdown` should be a Markdown parser"); - let a = t.extensions ? [t.extensions] : [], o = [_8.support], l; - r instanceof Wg ? (o.push(r.support), l = r.language) : r && (l = r); - let u = e || l ? D_e(e, l) : void 0; - a.push(oEe({ codeParser: u, htmlParser: _8.language.parser })), n && o.push(Wl.high(Mu.of($_e))); - let h = TD(i.configure(a)); - return s && o.push(h.data.of({ autocomplete: F_e })), new Wg(h, o); -} -function F_e(t) { + let a = t.extensions ? [t.extensions] : [], o = [n9.support], l; + r instanceof dm ? (o.push(r.support), l = r.language) : r && (l = r); + let u = e || l ? kAe(e, l) : void 0; + a.push(jEe({ codeParser: u, htmlParser: n9.language.parser })), n && o.push(uc.high(Zu.of(EAe))); + let h = eP(i.configure(a)); + return s && o.push(h.data.of({ autocomplete: AAe })), new dm(h, o); +} +function AAe(t) { let { state: e, pos: r } = t, n = /<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(r - 25, r)); if (!n) return null; - let i = dn(e).resolveInner(r, -1); + let i = Cn(e).resolveInner(r, -1); for (; i && !i.type.isTop; ) { if (i.name == "CodeBlock" || i.name == "FencedCode" || i.name == "ProcessingInstructionBlock" || i.name == "CommentBlock" || i.name == "Link" || i.name == "Image") return null; @@ -24849,25 +24849,25 @@ function F_e(t) { return { from: r - n[0].length, to: r, - options: z_e(), + options: LAe(), validFor: /^<[:\-\.\w\u00b7-\uffff]*$/ }; } -let A6 = null; -function z_e() { - if (A6) - return A6; - let t = S_e(new VM(dr.create({ extensions: _8 }), 0, !0)); - return A6 = t ? t.options : []; +let i6 = null; +function LAe() { + if (i6) + return i6; + let t = pAe(new yD(Sr.create({ extensions: n9 }), 0, !0)); + return i6 = t ? t.options : []; } -function Q_e(t) { +function RAe(t) { throw new Error('Could not dynamically require "' + t + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); } -var Zre = { exports: {} }; -const U_e = {}, V_e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ +var Rne = { exports: {} }; +const MAe = {}, DAe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, - default: U_e -}, Symbol.toStringTag, { value: "Module" })), q_e = /* @__PURE__ */ dj(V_e); + default: MAe +}, Symbol.toStringTag, { value: "Module" })), PAe = /* @__PURE__ */ Xj(DAe); (function(t) { var e; (function() { @@ -24923,8 +24923,8 @@ const U_e = {}, V_e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defin u(a.statusText); }; })), a.overrideMimeType && a.overrideMimeType("text/plain; charset=" + n), a.send(null), i ? s : a.responseText; - } else if (typeof Q_e < "u") { - var o = q_e; + } else if (typeof RAe < "u") { + var o = PAe; try { if (o.existsSync(r)) return o.readFileSync(r, n); @@ -25158,47 +25158,47 @@ const U_e = {}, V_e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defin } }; })(), t.exports = e; -})(Zre); -const Y_e = Zre.exports, jre = At.define({ +})(Rne); +const NAe = Rne.exports, Mne = $t.define({ combine: (t) => t[t.length - 1] -}), W_e = _t.mark({ +}), IAe = It.mark({ class: "cm-error" -}), G_e = (t) => Object.keys(t.rules).length > 0; -function MQ(t) { +}), $Ae = (t) => Object.keys(t.rules).length > 0; +function dU(t) { var s, a; let e = ((s = t.visibleRanges[0]) == null ? void 0 : s.from) || 0, r = ((a = t.visibleRanges[0]) == null ? void 0 : a.to) || void 0; - const n = new Hi(), i = t.state.facet(jre); - return G_e(i) && t.state.doc.sliceString(e, r).replaceAll(/\w+/g, (o, l) => !i.check(o) && n.add(e + l, e + l + o.length, W_e)), n.finish(); + const n = new os(), i = t.state.facet(Mne); + return $Ae(i) && t.state.doc.sliceString(e, r).replaceAll(/\w+/g, (o, l) => !i.check(o) && n.add(e + l, e + l + o.length, IAe)), n.finish(); } -const X_e = Jr.fromClass(class { +const BAe = hn.fromClass(class { constructor(t) { - this.decorations = MQ(t); + this.decorations = dU(t); } update(t) { - (t.docChanged || t.viewportChanged) && (this.decorations = MQ(t.view)); + (t.docChanged || t.viewportChanged) && (this.decorations = dU(t.view)); } }, { decorations: (t) => t.decorations }); -function H_e(t) { +function FAe(t) { if (!t) return []; let { dict: e = "en_US", dictionaryPath: r = "/dictionaries" } = t; - return [jre.of(new Y_e(e, null, null, { + return [Mne.of(new NAe(e, null, null, { dictionaryPath: r - })), X_e]; + })), BAe]; } -const Z_e = "cm-link", j_e = [{ +const zAe = "cm-link", QAe = [{ target: /`[^`\n]+`/g, cssClass: "cm-mono" }]; -function DQ(t, e, r, n) { +function pU(t, e, r, n) { var l, u; let i = ((l = t.visibleRanges[0]) == null ? void 0 : l.from) || 0, s = ((u = t.visibleRanges[0]) == null ? void 0 : u.to) || void 0; - const a = new Hi(), o = t.state.doc.sliceString(i, s); + const a = new os(), o = t.state.doc.sliceString(i, s); return e.flatMap((h) => { const f = h.id ? t.state.doc.line(parseInt(n.get(h.id))).text : o, d = h.id ? t.state.doc.line(parseInt(n.get(h.id))).from : i; return [...f.matchAll(h.target)].map((p) => ({ @@ -25213,7 +25213,7 @@ function DQ(t, e, r, n) { match: f }) => { let d = { - class: Z_e + class: zAe }; h.cssClass && (d.class = h.cssClass); let p; @@ -25224,92 +25224,92 @@ function DQ(t, e, r, n) { hl: h, markParams: d, view: t - })), a.add(h.from + f.index, h.from + f.index + f[0].length, _t.mark(d)), p == null || p(); + })), a.add(h.from + f.index, h.from + f.index + f[0].length, It.mark(d)), p == null || p(); }), a.finish(); } -const CD = (t, e, r) => { +const tP = (t, e, r) => { t || (t = []); - const n = t.concat(j_e); - return Jr.fromClass(class { + const n = t.concat(QAe); + return hn.fromClass(class { constructor(i) { - this.decorations = DQ(i, n, e, r); + this.decorations = pU(i, n, e, r); } update(i) { - (i.docChanged || i.viewportChanged) && (this.decorations = DQ(i.view, n, e, r)); + (i.docChanged || i.viewportChanged) && (this.decorations = pU(i.view, n, e, r)); } }, { decorations: (i) => i.decorations }); -}, Kre = /* @__PURE__ */ new Map(); -class K_e { +}, Dne = /* @__PURE__ */ new Map(); +class UAe { constructor(e) { - this.room = e, this.onmessage = null, this._onChange = (r) => r.key === e && this.onmessage !== null && this.onmessage({ data: VSe(r.newValue || "") }), wSe(this._onChange); + this.room = e, this.onmessage = null, this._onChange = (r) => r.key === e && this.onmessage !== null && this.onmessage({ data: DTe(r.newValue || "") }), hTe(this._onChange); } postMessage(e) { - Hee.setItem(this.room, USe($Se(e))); + Lte.setItem(this.room, MTe(ETe(e))); } close() { - OSe(this._onChange); + fTe(this._onChange); } } -const J_e = typeof BroadcastChannel > "u" ? K_e : BroadcastChannel, ED = (t) => hh(Kre, t, () => { - const e = h0(), r = new J_e(t); +const VAe = typeof BroadcastChannel > "u" ? UAe : BroadcastChannel, rP = (t) => Ah(Dne, t, () => { + const e = L0(), r = new VAe(t); return r.onmessage = (n) => e.forEach((i) => i(n.data, "broadcastchannel")), { bc: r, subs: e }; -}), eAe = (t, e) => (ED(t).subs.add(e), e), tAe = (t, e) => { - const r = ED(t), n = r.subs.delete(e); - return n && r.subs.size === 0 && (r.bc.close(), Kre.delete(t)), n; -}, Fp = (t, e, r = null) => { - const n = ED(t); +}), qAe = (t, e) => (rP(t).subs.add(e), e), YAe = (t, e) => { + const r = rP(t), n = r.subs.delete(e); + return n && r.subs.size === 0 && (r.bc.close(), Dne.delete(t)), n; +}, ag = (t, e, r = null) => { + const n = rP(t); n.bc.postMessage(e), n.subs.forEach((i) => i(e, r)); -}, Jre = 0, _D = 1, ene = 2, A8 = (t, e) => { - Gt(t, Jre); - const r = CTe(e); - Zn(t, r); -}, tne = (t, e, r) => { - Gt(t, _D), Zn(t, OTe(e, r)); -}, rAe = (t, e, r) => tne(e, r, Ls(t)), rne = (t, e, r) => { +}, Pne = 0, nP = 1, Nne = 2, i9 = (t, e) => { + rr(t, Pne); + const r = mCe(e); + ci(t, r); +}, Ine = (t, e, r) => { + rr(t, nP), ci(t, fCe(e, r)); +}, WAe = (t, e, r) => Ine(e, r, qs(t)), $ne = (t, e, r) => { try { - bTe(e, Ls(t), r); + cCe(e, qs(t), r); } catch (n) { console.error("Caught error while handling a Yjs update", n); } -}, nAe = (t, e) => { - Gt(t, ene), Zn(t, e); -}, iAe = rne, sAe = (t, e, r, n) => { - const i = lr(t); +}, GAe = (t, e) => { + rr(t, Nne), ci(t, e); +}, XAe = $ne, HAe = (t, e, r, n) => { + const i = xr(t); switch (i) { - case Jre: - rAe(t, e, r); + case Pne: + WAe(t, e, r); break; - case _D: - rne(t, r, n); + case nP: + $ne(t, r, n); break; - case ene: - iAe(t, r, n); + case Nne: + XAe(t, r, n); break; default: throw new Error("Unknown message type"); } return i; -}, aAe = 0, oAe = (t, e, r) => { - switch (lr(t)) { - case aAe: - r(e, nf(t)); +}, ZAe = 0, jAe = (t, e, r) => { + switch (xr(t)) { + case ZAe: + r(e, Of(t)); } -}, L6 = 3e4; -class nne extends yT { +}, s6 = 3e4; +class Bne extends YT { constructor(e) { super(), this.doc = e, this.clientID = e.clientID, this.states = /* @__PURE__ */ new Map(), this.meta = /* @__PURE__ */ new Map(), this._checkInterval = setInterval(() => { - const r = kf(); - this.getLocalState() !== null && L6 / 2 <= r - this.meta.get(this.clientID).lastUpdated && this.setLocalState(this.getLocalState()); + const r = Qf(); + this.getLocalState() !== null && s6 / 2 <= r - this.meta.get(this.clientID).lastUpdated && this.setLocalState(this.getLocalState()); const n = []; this.meta.forEach((i, s) => { - s !== this.clientID && L6 <= r - i.lastUpdated && this.states.has(s) && n.push(s); - }), n.length > 0 && AD(this, n, "timeout"); - }, Gu(L6 / 10)), e.on("destroy", () => { + s !== this.clientID && s6 <= r - i.lastUpdated && this.states.has(s) && n.push(s); + }), n.length > 0 && iP(this, n, "timeout"); + }, hh(s6 / 10)), e.on("destroy", () => { this.destroy(); }), this.setLocalState({}); } @@ -25323,10 +25323,10 @@ class nne extends yT { const r = this.clientID, n = this.meta.get(r), i = n === void 0 ? 0 : n.clock + 1, s = this.states.get(r); e === null ? this.states.delete(r) : this.states.set(r, e), this.meta.set(r, { clock: i, - lastUpdated: kf() + lastUpdated: Qf() }); const a = [], o = [], l = [], u = []; - e === null ? u.push(r) : s == null ? e != null && a.push(r) : (o.push(r), dy(s, e) || l.push(r)), (a.length > 0 || l.length > 0 || u.length > 0) && this.emit("change", [{ added: a, updated: l, removed: u }, "local"]), this.emit("update", [{ added: a, updated: o, removed: u }, "local"]); + e === null ? u.push(r) : s == null ? e != null && a.push(r) : (o.push(r), $y(s, e) || l.push(r)), (a.length > 0 || l.length > 0 || u.length > 0) && this.emit("change", [{ added: a, updated: l, removed: u }, "local"]), this.emit("update", [{ added: a, updated: o, removed: u }, "local"]); } setLocalStateField(e, r) { const n = this.getLocalState(); @@ -25339,7 +25339,7 @@ class nne extends yT { return this.states; } } -const AD = (t, e, r) => { +const iP = (t, e, r) => { const n = []; for (let i = 0; i < e.length; i++) { const s = e[i]; @@ -25348,31 +25348,31 @@ const AD = (t, e, r) => { const a = t.meta.get(s); t.meta.set(s, { clock: a.clock + 1, - lastUpdated: kf() + lastUpdated: Qf() }); } n.push(s); } } n.length > 0 && (t.emit("change", [{ added: [], updated: [], removed: n }, r]), t.emit("update", [{ added: [], updated: [], removed: n }, r])); -}, my = (t, e, r = t.states) => { - const n = e.length, i = Rs(); - Gt(i, n); +}, zy = (t, e, r = t.states) => { + const n = e.length, i = Ys(); + rr(i, n); for (let s = 0; s < n; s++) { const a = e[s], o = r.get(a) || null, l = t.meta.get(a).clock; - Gt(i, a), Gt(i, l), r0(i, JSON.stringify(o)); + rr(i, a), rr(i, l), w0(i, JSON.stringify(o)); } - return Rn(i); -}, lAe = (t, e, r) => { - const n = jf(e), i = kf(), s = [], a = [], o = [], l = [], u = lr(n); + return Vn(i); +}, KAe = (t, e, r) => { + const n = gd(e), i = Qf(), s = [], a = [], o = [], l = [], u = xr(n); for (let h = 0; h < u; h++) { - const f = lr(n); - let d = lr(n); - const p = JSON.parse(nf(n)), g = t.meta.get(f), m = t.states.get(f), v = g === void 0 ? 0 : g.clock; + const f = xr(n); + let d = xr(n); + const p = JSON.parse(Of(n)), g = t.meta.get(f), m = t.states.get(f), v = g === void 0 ? 0 : g.clock; (v < d || v === d && p === null && t.states.has(f)) && (p === null ? f === t.clientID && t.getLocalState() != null ? d++ : t.states.delete(f) : t.states.set(f, p), t.meta.set(f, { clock: d, lastUpdated: i - }), g === void 0 && p !== null ? s.push(f) : g !== void 0 && p === null ? l.push(f) : p !== null && (dy(p, m) || o.push(f), a.push(f))); + }), g === void 0 && p !== null ? s.push(f) : g !== void 0 && p === null ? l.push(f) : p !== null && ($y(p, m) || o.push(f), a.push(f))); } (s.length > 0 || o.length > 0 || l.length > 0) && t.emit("change", [{ added: s, @@ -25383,55 +25383,55 @@ const AD = (t, e, r) => { updated: a, removed: l }, r]); -}, cAe = (t) => CSe(t, (e, r) => `${encodeURIComponent(r)}=${encodeURIComponent(e)}`).join("&"), Ud = 0, ine = 3, gg = 1, uAe = 2, Sx = []; -Sx[Ud] = (t, e, r, n, i) => { - Gt(t, Ud); - const s = sAe( +}, JAe = (t) => mTe(t, (e, r) => `${encodeURIComponent(r)}=${encodeURIComponent(e)}`).join("&"), o0 = 0, Fne = 3, Ig = 1, e7e = 2, Xx = []; +Xx[o0] = (t, e, r, n, i) => { + rr(t, o0); + const s = HAe( e, t, r.doc, r ); - n && s === _D && !r.synced && (r.synced = !0); + n && s === nP && !r.synced && (r.synced = !0); }; -Sx[ine] = (t, e, r, n, i) => { - Gt(t, gg), Zn( +Xx[Fne] = (t, e, r, n, i) => { + rr(t, Ig), ci( t, - my( + zy( r.awareness, Array.from(r.awareness.getStates().keys()) ) ); }; -Sx[gg] = (t, e, r, n, i) => { - lAe( +Xx[Ig] = (t, e, r, n, i) => { + KAe( r.awareness, - Ls(e), + qs(e), r ); }; -Sx[uAe] = (t, e, r, n, i) => { - oAe( +Xx[e7e] = (t, e, r, n, i) => { + jAe( e, r.doc, - (s, a) => hAe(r, a) + (s, a) => t7e(r, a) ); }; -const PQ = 3e4, hAe = (t, e) => console.warn(`Permission denied to access ${t.url}. -${e}`), sne = (t, e, r) => { - const n = jf(e), i = Rs(), s = lr(n), a = t.messageHandlers[s]; +const gU = 3e4, t7e = (t, e) => console.warn(`Permission denied to access ${t.url}. +${e}`), zne = (t, e, r) => { + const n = gd(e), i = Ys(), s = xr(n), a = t.messageHandlers[s]; return a ? a(i, n, t, r, s) : console.error("Unable to compute message"), i; -}, ane = (t) => { +}, Qne = (t) => { if (t.shouldConnect && t.ws === null) { const e = new t._WS(t.url); e.binaryType = "arraybuffer", t.ws = e, t.wsconnecting = !0, t.wsconnected = !1, t.synced = !1, e.onmessage = (r) => { - t.wsLastMessageReceived = kf(); - const n = sne(t, new Uint8Array(r.data), !0); - ZM(n) > 1 && e.send(Rn(n)); + t.wsLastMessageReceived = Qf(); + const n = zne(t, new Uint8Array(r.data), !0); + TD(n) > 1 && e.send(Vn(n)); }, e.onerror = (r) => { t.emit("connection-error", [r, t]); }, e.onclose = (r) => { - t.emit("connection-close", [r, t]), t.ws = null, t.wsconnecting = !1, t.wsconnected ? (t.wsconnected = !1, t.synced = !1, AD( + t.emit("connection-close", [r, t]), t.ws = null, t.wsconnecting = !1, t.wsconnected ? (t.wsconnected = !1, t.synced = !1, iP( t.awareness, Array.from(t.awareness.getStates().keys()).filter( (n) => n !== t.doc.clientID @@ -25440,39 +25440,39 @@ ${e}`), sne = (t, e, r) => { ), t.emit("status", [{ status: "disconnected" }])) : t.wsUnsuccessfulReconnects++, setTimeout( - ane, - bT( - U3e(2, t.wsUnsuccessfulReconnects) * 100, + Qne, + WT( + MSe(2, t.wsUnsuccessfulReconnects) * 100, t.maxBackoffTime ), t ); }, e.onopen = () => { - t.wsLastMessageReceived = kf(), t.wsconnecting = !1, t.wsconnected = !0, t.wsUnsuccessfulReconnects = 0, t.emit("status", [{ + t.wsLastMessageReceived = Qf(), t.wsconnecting = !1, t.wsconnected = !0, t.wsUnsuccessfulReconnects = 0, t.emit("status", [{ status: "connected" }]); - const r = Rs(); - if (Gt(r, Ud), A8(r, t.doc), e.send(Rn(r)), t.awareness.getLocalState() !== null) { - const n = Rs(); - Gt(n, gg), Zn( + const r = Ys(); + if (rr(r, o0), i9(r, t.doc), e.send(Vn(r)), t.awareness.getLocalState() !== null) { + const n = Ys(); + rr(n, Ig), ci( n, - my(t.awareness, [ + zy(t.awareness, [ t.doc.clientID ]) - ), e.send(Rn(n)); + ), e.send(Vn(n)); } }, t.emit("status", [{ status: "connecting" }]); } -}, R6 = (t, e) => { +}, a6 = (t, e) => { const r = t.ws; - t.wsconnected && r && r.readyState === r.OPEN && r.send(e), t.bcconnected && Fp(t.bcChannel, e, t); + t.wsconnected && r && r.readyState === r.OPEN && r.send(e), t.bcconnected && ag(t.bcChannel, e, t); }; -class one extends yT { +class Une extends YT { constructor(e, r, n, { connect: i = !0, - awareness: s = new nne(n), + awareness: s = new Bne(n), params: a = {}, WebSocketPolyfill: o = WebSocket, resyncInterval: l = -1, @@ -25481,37 +25481,37 @@ class one extends yT { } = {}) { for (super(); e[e.length - 1] === "/"; ) e = e.slice(0, e.length - 1); - const f = cAe(a); - this.maxBackoffTime = u, this.bcChannel = e + "/" + r, this.url = e + "/" + r + (f.length === 0 ? "" : "?" + f), this.roomname = r, this.doc = n, this._WS = o, this.awareness = s, this.wsconnected = !1, this.wsconnecting = !1, this.bcconnected = !1, this.disableBc = h, this.wsUnsuccessfulReconnects = 0, this.messageHandlers = Sx.slice(), this._synced = !1, this.ws = null, this.wsLastMessageReceived = 0, this.shouldConnect = i, this._resyncInterval = 0, l > 0 && (this._resyncInterval = setInterval(() => { + const f = JAe(a); + this.maxBackoffTime = u, this.bcChannel = e + "/" + r, this.url = e + "/" + r + (f.length === 0 ? "" : "?" + f), this.roomname = r, this.doc = n, this._WS = o, this.awareness = s, this.wsconnected = !1, this.wsconnecting = !1, this.bcconnected = !1, this.disableBc = h, this.wsUnsuccessfulReconnects = 0, this.messageHandlers = Xx.slice(), this._synced = !1, this.ws = null, this.wsLastMessageReceived = 0, this.shouldConnect = i, this._resyncInterval = 0, l > 0 && (this._resyncInterval = setInterval(() => { if (this.ws && this.ws.readyState === WebSocket.OPEN) { - const d = Rs(); - Gt(d, Ud), A8(d, n), this.ws.send(Rn(d)); + const d = Ys(); + rr(d, o0), i9(d, n), this.ws.send(Vn(d)); } }, l)), this._bcSubscriber = (d, p) => { if (p !== this) { - const g = sne(this, new Uint8Array(d), !1); - ZM(g) > 1 && Fp(this.bcChannel, Rn(g), this); + const g = zne(this, new Uint8Array(d), !1); + TD(g) > 1 && ag(this.bcChannel, Vn(g), this); } }, this._updateHandler = (d, p) => { if (p !== this) { - const g = Rs(); - Gt(g, Ud), nAe(g, d), R6(this, Rn(g)); + const g = Ys(); + rr(g, o0), GAe(g, d), a6(this, Vn(g)); } }, this.doc.on("update", this._updateHandler), this._awarenessUpdateHandler = ({ added: d, updated: p, removed: g }, m) => { - const v = d.concat(p).concat(g), y = Rs(); - Gt(y, gg), Zn( + const v = d.concat(p).concat(g), y = Ys(); + rr(y, Ig), ci( y, - my(s, v) - ), R6(this, Rn(y)); + zy(s, v) + ), a6(this, Vn(y)); }, this._unloadHandler = () => { - AD( + iP( this.awareness, [n.clientID], "window unload" ); }, typeof window < "u" ? window.addEventListener("unload", this._unloadHandler) : typeof process < "u" && process.on("exit", this._unloadHandler), s.on("update", this._awarenessUpdateHandler), this._checkInterval = setInterval(() => { - this.wsconnected && PQ < kf() - this.wsLastMessageReceived && this.ws.close(); - }, PQ / 10), i && this.connect(); + this.wsconnected && gU < Qf() - this.wsLastMessageReceived && this.ws.close(); + }, gU / 10), i && this.connect(); } get synced() { return this._synced; @@ -25525,54 +25525,54 @@ class one extends yT { connectBc() { if (this.disableBc) return; - this.bcconnected || (eAe(this.bcChannel, this._bcSubscriber), this.bcconnected = !0); - const e = Rs(); - Gt(e, Ud), A8(e, this.doc), Fp(this.bcChannel, Rn(e), this); - const r = Rs(); - Gt(r, Ud), tne(r, this.doc), Fp(this.bcChannel, Rn(r), this); - const n = Rs(); - Gt(n, ine), Fp( + this.bcconnected || (qAe(this.bcChannel, this._bcSubscriber), this.bcconnected = !0); + const e = Ys(); + rr(e, o0), i9(e, this.doc), ag(this.bcChannel, Vn(e), this); + const r = Ys(); + rr(r, o0), Ine(r, this.doc), ag(this.bcChannel, Vn(r), this); + const n = Ys(); + rr(n, Fne), ag( this.bcChannel, - Rn(n), + Vn(n), this ); - const i = Rs(); - Gt(i, gg), Zn( + const i = Ys(); + rr(i, Ig), ci( i, - my(this.awareness, [ + zy(this.awareness, [ this.doc.clientID ]) - ), Fp( + ), ag( this.bcChannel, - Rn(i), + Vn(i), this ); } disconnectBc() { - const e = Rs(); - Gt(e, gg), Zn( + const e = Ys(); + rr(e, Ig), ci( e, - my(this.awareness, [ + zy(this.awareness, [ this.doc.clientID ], /* @__PURE__ */ new Map()) - ), R6(this, Rn(e)), this.bcconnected && (tAe(this.bcChannel, this._bcSubscriber), this.bcconnected = !1); + ), a6(this, Vn(e)), this.bcconnected && (YAe(this.bcChannel, this._bcSubscriber), this.bcconnected = !1); } disconnect() { this.shouldConnect = !1, this.disconnectBc(), this.ws !== null && this.ws.close(); } connect() { - this.shouldConnect = !0, !this.wsconnected && this.ws === null && (ane(this), this.connectBc()); + this.shouldConnect = !0, !this.wsconnected && this.ws === null && (Qne(this), this.connectBc()); } } -const fAe = (t) => ["input", "delete", "undo", "redo"].some((e) => t.isUserEvent(e)), v2 = At.define({ +const r7e = (t) => ["input", "delete", "undo", "redo"].some((e) => t.isUserEvent(e)), Q2 = $t.define({ combine: (t) => t[t.length - 1], static: !0 -}), lne = jt.define(), dAe = Jr.fromClass(class { +}), Vne = or.define(), n7e = hn.fromClass(class { constructor(t) { this.decorations = this.colorEditorLines(t); } markAuthor(t, e) { - return _t.line({ + return It.line({ attributes: { "data-line-number": e, style: ` @@ -25585,7 +25585,7 @@ const fAe = (t) => ["input", "delete", "undo", "redo"].some((e) => t.isUserEvent }); } colorEditorLines(t) { - const e = t.state.facet(v2), r = new Hi(); + const e = t.state.facet(Q2), r = new os(); for (let n = 1; n <= t.state.doc.lines; n++) { const i = t.state.doc.line(n), s = e.get(n); s && r.add(i.from, i.from, this.markAuthor(s, n)); @@ -25593,7 +25593,7 @@ const fAe = (t) => ["input", "delete", "undo", "redo"].some((e) => t.isUserEvent return r.finish(); } markLinesEditedInTransaction(t) { - const e = t.state.facet(v2); + const e = t.state.facet(Q2); t.changes.iterChangedRanges((r, n, i, s) => { const a = t.newDoc.lineAt(i), o = t.newDoc.lineAt(s), l = t.newDoc.slice(i, s).toString().trim().length == 0, u = t.state.doc.lines - t.startState.doc.lines; if (u > 0 && (l && !o.length ? e.insert(a.number + 1, u) : a.from == i ? e.insert(a.number, u) : (e.insert(a.number, u), e.mark(o.number))), u < 0) { @@ -25604,29 +25604,29 @@ const fAe = (t) => ["input", "delete", "undo", "redo"].some((e) => t.isUserEvent }); } update(t) { - (t.docChanged || t.viewportChanged || t.transactions.some((e) => e.effects.some((r) => r.is(lne)))) && (t.transactions.filter(fAe).forEach((e) => this.markLinesEditedInTransaction(e)), this.decorations = this.colorEditorLines(t.view)), t.view.dom.onmouseleave = () => t.view.dispatch({ - effects: L8.of(null) + (t.docChanged || t.viewportChanged || t.transactions.some((e) => e.effects.some((r) => r.is(Vne)))) && (t.transactions.filter(r7e).forEach((e) => this.markLinesEditedInTransaction(e)), this.decorations = this.colorEditorLines(t.view)), t.view.dom.onmouseleave = () => t.view.dispatch({ + effects: s9.of(null) }), t.view.dom.querySelectorAll(".cm-line").forEach((e) => { e.onmouseenter = (r) => t.view.dispatch({ - effects: L8.of(parseInt(r.target.dataset.lineNumber)) + effects: s9.of(parseInt(r.target.dataset.lineNumber)) }); }); } }, { decorations: (t) => t.decorations -}), L8 = jt.define(), Sk = In.define({ +}), s9 = or.define(), jk = Xn.define({ create() { return null; }, update(t, e) { var i; - const r = e.state.facet(v2), n = (i = e.effects.find((s) => s.is(L8))) == null ? void 0 : i.value; + const r = e.state.facet(Q2), n = (i = e.effects.find((s) => s.is(s9))) == null ? void 0 : i.value; return n ? r.firstLineOfSection(n) : null; } }); -class NQ extends Go { +class mU extends ul { constructor(e, r) { - super(), r && e && (this.lineNumber = r.state.doc.lineAt(e.to).number, this.lineAuthors = r.state.facet(v2), this.selectedLine = r.state.facet(Sk)); + super(), r && e && (this.lineNumber = r.state.doc.lineAt(e.to).number, this.lineAuthors = r.state.facet(Q2), this.selectedLine = r.state.facet(jk)); } authorAvatar() { const { @@ -25639,11 +25639,11 @@ class NQ extends Go { return this.selectedLine && this.selectedLine == this.lineNumber ? this.authorAvatar() : document.createElement("div"); } } -const pAe = cT({ - lineMarker: (t, e) => new NQ(e, t), - lineMarkerChange: (t) => t.startState.field(Sk) != t.state.field(Sk), - initialSpacer: () => new NQ(null, null) -}), gAe = (t) => [v2.of(t), Sk.init(null), pAe, dAe], j0 = qt.button` +const i7e = IT({ + lineMarker: (t, e) => new mU(e, t), + lineMarkerChange: (t) => t.startState.field(jk) != t.state.field(jk), + initialSpacer: () => new mU(null, null) +}), s7e = (t) => [Q2.of(t), jk.init(null), i7e, n7e], mp = Jt.button` &:focus { outline: 0 !important; } @@ -25671,12 +25671,12 @@ const pAe = cT({ margin: 5px; } `; -jt.define(); -const cne = new G0(); -function mAe(t) { +or.define(); +const qne = new fp(); +function a7e(t) { return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); } -function vAe({ +function o7e({ commentId: t, text: e, color: r @@ -25689,7 +25689,7 @@ function vAe({ break; let s = e.slice(0, i), a = ""; s.includes("->") && (a = s.slice(s.indexOf("->") + 2).trimStart(), s = s.slice(0, s.indexOf("->")).trimEnd()), s.length !== 0 && n.push({ - targetRegexSrc: `(?<=^|[ \\t\\r\\.]|\\W)${mAe(s)}(?=$|[\\s\\.]|\\W)`, + targetRegexSrc: `(?<=^|[ \\t\\r\\.]|\\W)${a7e(s)}(?=$|[\\s\\.]|\\W)`, targetRegexFlags: "gm", id: t, cssClass: "cm-suggestion", @@ -25699,7 +25699,7 @@ function vAe({ } return n; } -function yAe({ +function l7e({ builder: t, from: e, match: r, @@ -25711,8 +25711,8 @@ function yAe({ style: `color: ${n.color}` }), n.replacement) return i.class += " replaced", () => { - t.add(e + r.index + r[0].length, e + r.index + r[0].length, _t.widget({ - widget: new bAe({ + t.add(e + r.index + r[0].length, e + r.index + r[0].length, It.widget({ + widget: new c7e({ text: n.replacement, color: n.color, from: e + r.index, @@ -25722,7 +25722,7 @@ function yAe({ })); }; } -class bAe extends Wa { +class c7e extends uo { constructor({ text: e, color: r, @@ -25745,7 +25745,7 @@ class bAe extends Wa { }), e; } } -function xAe(t, e, r) { +function u7e(t, e, r) { const n = r.current.querySelector(".myst-add-suggestion"), i = t.state.selection.main, s = i.head === i.anchor, a = t.state.doc.lineAt(i.head).number !== t.state.doc.lineAt(i.anchor).number; if (!t.selectionSet || s || a) { n.style.display = "none"; @@ -25778,12 +25778,12 @@ function xAe(t, e, r) { }), e.updateMainCodeMirror(); const w = await e.getEditorForComment(b); w.focus(), w.dispatch({ - selection: Ue.create([Ue.range(w.state.doc.length - 1, w.state.doc.length - 1)]), - effects: lne.of(null) + selection: je.create([je.range(w.state.doc.length - 1, w.state.doc.length - 1)]), + effects: Vne.of(null) }); }; } -const wAe = qt(j0)` +const h7e = Jt(mp)` position: absolute; z-index: 10; display: none; @@ -25812,16 +25812,16 @@ const wAe = qt(j0)` border-top: 10px solid var(--icon-border); } `; -var OAe = Symbol.for("preact-signals"); -function AT() { - if (sf > 1) - sf--; +var f7e = Symbol.for("preact-signals"); +function rC() { + if (kf > 1) + kf--; else { - for (var t, e = !1; vy !== void 0; ) { - var r = vy; - for (vy = void 0, R8++; r !== void 0; ) { + for (var t, e = !1; Qy !== void 0; ) { + var r = Qy; + for (Qy = void 0, a9++; r !== void 0; ) { var n = r.o; - if (r.o = void 0, r.f &= -3, !(8 & r.f) && hne(r)) + if (r.o = void 0, r.f &= -3, !(8 & r.f) && Wne(r)) try { r.c(); } catch (i) { @@ -25830,102 +25830,102 @@ function AT() { r = n; } } - if (R8 = 0, sf--, e) + if (a9 = 0, kf--, e) throw t; } } -function ev(t) { - if (sf > 0) +function Sv(t) { + if (kf > 0) return t(); - sf++; + kf++; try { return t(); } finally { - AT(); + rC(); } } -var tn = void 0, vy = void 0, sf = 0, R8 = 0, Tk = 0; -function une(t) { - if (tn !== void 0) { +var dn = void 0, Qy = void 0, kf = 0, a9 = 0, Kk = 0; +function Yne(t) { + if (dn !== void 0) { var e = t.n; - if (e === void 0 || e.t !== tn) - return e = { i: 0, S: t, p: tn.s, n: void 0, t: tn, e: void 0, x: void 0, r: e }, tn.s !== void 0 && (tn.s.n = e), tn.s = e, t.n = e, 32 & tn.f && t.S(e), e; + if (e === void 0 || e.t !== dn) + return e = { i: 0, S: t, p: dn.s, n: void 0, t: dn, e: void 0, x: void 0, r: e }, dn.s !== void 0 && (dn.s.n = e), dn.s = e, t.n = e, 32 & dn.f && t.S(e), e; if (e.i === -1) - return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p = tn.s, e.n = void 0, tn.s.n = e, tn.s = e), e; + return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p = dn.s, e.n = void 0, dn.s.n = e, dn.s = e), e; } } -function ys(t) { +function Rs(t) { this.v = t, this.i = 0, this.n = void 0, this.t = void 0; } -ys.prototype.brand = OAe; -ys.prototype.h = function() { +Rs.prototype.brand = f7e; +Rs.prototype.h = function() { return !0; }; -ys.prototype.S = function(t) { +Rs.prototype.S = function(t) { this.t !== t && t.e === void 0 && (t.x = this.t, this.t !== void 0 && (this.t.e = t), this.t = t); }; -ys.prototype.U = function(t) { +Rs.prototype.U = function(t) { if (this.t !== void 0) { var e = t.e, r = t.x; e !== void 0 && (e.x = r, t.e = void 0), r !== void 0 && (r.e = e, t.x = void 0), t === this.t && (this.t = r); } }; -ys.prototype.subscribe = function(t) { +Rs.prototype.subscribe = function(t) { var e = this; - return LT(function() { - var r = e.value, n = tn; - tn = void 0; + return nC(function() { + var r = e.value, n = dn; + dn = void 0; try { t(r); } finally { - tn = n; + dn = n; } }); }; -ys.prototype.valueOf = function() { +Rs.prototype.valueOf = function() { return this.value; }; -ys.prototype.toString = function() { +Rs.prototype.toString = function() { return this.value + ""; }; -ys.prototype.toJSON = function() { +Rs.prototype.toJSON = function() { return this.value; }; -ys.prototype.peek = function() { - var t = tn; - tn = void 0; +Rs.prototype.peek = function() { + var t = dn; + dn = void 0; try { return this.value; } finally { - tn = t; + dn = t; } }; -Object.defineProperty(ys.prototype, "value", { get: function() { - var t = une(this); +Object.defineProperty(Rs.prototype, "value", { get: function() { + var t = Yne(this); return t !== void 0 && (t.i = this.i), this.v; }, set: function(t) { if (t !== this.v) { - if (R8 > 100) + if (a9 > 100) throw new Error("Cycle detected"); - this.v = t, this.i++, Tk++, sf++; + this.v = t, this.i++, Kk++, kf++; try { for (var e = this.t; e !== void 0; e = e.x) e.t.N(); } finally { - AT(); + rC(); } } } }); -function Iu(t) { - return new ys(t); +function eh(t) { + return new Rs(t); } -function hne(t) { +function Wne(t) { for (var e = t.s; e !== void 0; e = e.n) if (e.S.i !== e.i || !e.S.h() || e.S.i !== e.i) return !0; return !1; } -function fne(t) { +function Gne(t) { for (var e = t.s; e !== void 0; e = e.n) { var r = e.S.n; if (r !== void 0 && (e.r = r), e.S.n = e, e.i = -1, e.n === void 0) { @@ -25934,95 +25934,95 @@ function fne(t) { } } } -function dne(t) { +function Xne(t) { for (var e = t.s, r = void 0; e !== void 0; ) { var n = e.p; e.i === -1 ? (e.S.U(e), n !== void 0 && (n.n = e.n), e.n !== void 0 && (e.n.p = n)) : r = e, e.S.n = e.r, e.r !== void 0 && (e.r = void 0), e = n; } t.s = r; } -function s1(t) { - ys.call(this, void 0), this.x = t, this.s = void 0, this.g = Tk - 1, this.f = 4; +function C1(t) { + Rs.call(this, void 0), this.x = t, this.s = void 0, this.g = Kk - 1, this.f = 4; } -(s1.prototype = new ys()).h = function() { +(C1.prototype = new Rs()).h = function() { if (this.f &= -3, 1 & this.f) return !1; - if ((36 & this.f) == 32 || (this.f &= -5, this.g === Tk)) + if ((36 & this.f) == 32 || (this.f &= -5, this.g === Kk)) return !0; - if (this.g = Tk, this.f |= 1, this.i > 0 && !hne(this)) + if (this.g = Kk, this.f |= 1, this.i > 0 && !Wne(this)) return this.f &= -2, !0; - var t = tn; + var t = dn; try { - fne(this), tn = this; + Gne(this), dn = this; var e = this.x(); (16 & this.f || this.v !== e || this.i === 0) && (this.v = e, this.f &= -17, this.i++); } catch (r) { this.v = r, this.f |= 16, this.i++; } - return tn = t, dne(this), this.f &= -2, !0; + return dn = t, Xne(this), this.f &= -2, !0; }; -s1.prototype.S = function(t) { +C1.prototype.S = function(t) { if (this.t === void 0) { this.f |= 36; for (var e = this.s; e !== void 0; e = e.n) e.S.S(e); } - ys.prototype.S.call(this, t); + Rs.prototype.S.call(this, t); }; -s1.prototype.U = function(t) { - if (this.t !== void 0 && (ys.prototype.U.call(this, t), this.t === void 0)) { +C1.prototype.U = function(t) { + if (this.t !== void 0 && (Rs.prototype.U.call(this, t), this.t === void 0)) { this.f &= -33; for (var e = this.s; e !== void 0; e = e.n) e.S.U(e); } }; -s1.prototype.N = function() { +C1.prototype.N = function() { if (!(2 & this.f)) { this.f |= 6; for (var t = this.t; t !== void 0; t = t.x) t.t.N(); } }; -Object.defineProperty(s1.prototype, "value", { get: function() { +Object.defineProperty(C1.prototype, "value", { get: function() { if (1 & this.f) throw new Error("Cycle detected"); - var t = une(this); + var t = Yne(this); if (this.h(), t !== void 0 && (t.i = this.i), 16 & this.f) throw this.v; return this.v; } }); -function LD(t) { - return new s1(t); +function sP(t) { + return new C1(t); } -function pne(t) { +function Hne(t) { var e = t.u; if (t.u = void 0, typeof e == "function") { - sf++; - var r = tn; - tn = void 0; + kf++; + var r = dn; + dn = void 0; try { e(); } catch (n) { - throw t.f &= -2, t.f |= 8, RD(t), n; + throw t.f &= -2, t.f |= 8, aP(t), n; } finally { - tn = r, AT(); + dn = r, rC(); } } } -function RD(t) { +function aP(t) { for (var e = t.s; e !== void 0; e = e.n) e.S.U(e); - t.x = void 0, t.s = void 0, pne(t); + t.x = void 0, t.s = void 0, Hne(t); } -function kAe(t) { - if (tn !== this) +function d7e(t) { + if (dn !== this) throw new Error("Out-of-order effect"); - dne(this), tn = t, this.f &= -2, 8 & this.f && RD(this), AT(); + Xne(this), dn = t, this.f &= -2, 8 & this.f && aP(this), rC(); } -function Tx(t) { +function Hx(t) { this.x = t, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32; } -Tx.prototype.c = function() { +Hx.prototype.c = function() { var t = this.S(); try { if (8 & this.f || this.x === void 0) @@ -26033,21 +26033,21 @@ Tx.prototype.c = function() { t(); } }; -Tx.prototype.S = function() { +Hx.prototype.S = function() { if (1 & this.f) throw new Error("Cycle detected"); - this.f |= 1, this.f &= -9, pne(this), fne(this), sf++; - var t = tn; - return tn = this, kAe.bind(this, t); + this.f |= 1, this.f &= -9, Hne(this), Gne(this), kf++; + var t = dn; + return dn = this, d7e.bind(this, t); }; -Tx.prototype.N = function() { - 2 & this.f || (this.f |= 2, this.o = vy, vy = this); +Hx.prototype.N = function() { + 2 & this.f || (this.f |= 2, this.o = Qy, Qy = this); }; -Tx.prototype.d = function() { - this.f |= 8, 1 & this.f || RD(this); +Hx.prototype.d = function() { + this.f |= 8, 1 & this.f || aP(this); }; -function LT(t) { - var e = new Tx(t); +function nC(t) { + var e = new Hx(t); try { e.c(); } catch (r) { @@ -26055,18 +26055,18 @@ function LT(t) { } return e.d.bind(e); } -var RT, M6; -function a1(t, e) { - Dt[t] = e.bind(null, Dt[t] || function() { +var iC, o6; +function E1(t, e) { + Ut[t] = e.bind(null, Ut[t] || function() { }); } -function Ck(t) { - M6 && M6(), M6 = t && t.S(); +function Jk(t) { + o6 && o6(), o6 = t && t.S(); } -function gne(t) { - var e = this, r = t.data, n = na(r); +function Zne(t) { + var e = this, r = t.data, n = xa(r); n.value = r; - var i = ii(function() { + var i = vi(function() { for (var s = e.__v; s = s.__; ) if (s.__c) { s.__c.__$f |= 4; @@ -26074,46 +26074,46 @@ function gne(t) { } return e.__$u.c = function() { var a; - !GZ(i.peek()) && ((a = e.base) == null ? void 0 : a.nodeType) === 3 ? e.base.data = i.peek() : (e.__$f |= 1, e.setState({})); - }, LD(function() { + !_j(i.peek()) && ((a = e.base) == null ? void 0 : a.nodeType) === 3 ? e.base.data = i.peek() : (e.__$f |= 1, e.setState({})); + }, sP(function() { var a = n.value.value; return a === 0 ? 0 : a === !0 ? "" : a || ""; }); }, []); return i.value; } -gne.displayName = "_st"; -Object.defineProperties(ys.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: gne }, props: { configurable: !0, get: function() { +Zne.displayName = "_st"; +Object.defineProperties(Rs.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: Zne }, props: { configurable: !0, get: function() { return { data: this }; } }, __b: { configurable: !0, value: 1 } }); -a1("__b", function(t, e) { +E1("__b", function(t, e) { if (typeof e.type == "string") { var r, n = e.props; for (var i in n) if (i !== "children") { var s = n[i]; - s instanceof ys && (r || (e.__np = r = {}), r[i] = s, n[i] = s.peek()); + s instanceof Rs && (r || (e.__np = r = {}), r[i] = s, n[i] = s.peek()); } } t(e); }); -a1("__r", function(t, e) { - Ck(); +E1("__r", function(t, e) { + Jk(); var r, n = e.__c; n && (n.__$f &= -2, (r = n.__$u) === void 0 && (n.__$u = r = function(i) { var s; - return LT(function() { + return nC(function() { s = this; }), s.c = function() { n.__$f |= 1, n.setState({}); }, s; - }())), RT = n, Ck(r), t(e); + }())), iC = n, Jk(r), t(e); }); -a1("__e", function(t, e, r, n) { - Ck(), RT = void 0, t(e, r, n); +E1("__e", function(t, e, r, n) { + Jk(), iC = void 0, t(e, r, n); }); -a1("diffed", function(t, e) { - Ck(), RT = void 0; +E1("diffed", function(t, e) { + Jk(), iC = void 0; var r; if (typeof e.type == "string" && (r = e.__e)) { var n = e.__np, i = e.props; @@ -26128,22 +26128,22 @@ a1("diffed", function(t, e) { r.U = s = {}; for (var l in n) { var u = s[l], h = n[l]; - u === void 0 ? (u = SAe(r, l, h, i), s[l] = u) : u.o(h, i); + u === void 0 ? (u = p7e(r, l, h, i), s[l] = u) : u.o(h, i); } } } t(e); }); -function SAe(t, e, r, n) { - var i = e in t && t.ownerSVGElement === void 0, s = Iu(r); +function p7e(t, e, r, n) { + var i = e in t && t.ownerSVGElement === void 0, s = eh(r); return { o: function(a, o) { s.value = a, n = o; - }, d: LT(function() { + }, d: nC(function() { var a = s.value.value; n[e] !== a && (n[e] = a, i ? t[e] = a : a ? t.setAttribute(e, a) : t.removeAttribute(e)); }) }; } -a1("unmount", function(t, e) { +E1("unmount", function(t, e) { if (typeof e.type == "string") { var r = e.__e; if (r) { @@ -26165,10 +26165,10 @@ a1("unmount", function(t, e) { } t(e); }); -a1("__h", function(t, e, r, n) { +E1("__h", function(t, e, r, n) { (n < 3 || n === 9) && (e.__$f |= 2), t(e, r, n); }); -Sl.prototype.shouldComponentUpdate = function(t, e) { +Ul.prototype.shouldComponentUpdate = function(t, e) { var r = this.__$u; if (!(r && r.s !== void 0 || 4 & this.__$f) || 3 & this.__$f) return !0; @@ -26182,34 +26182,34 @@ Sl.prototype.shouldComponentUpdate = function(t, e) { return !0; return !1; }; -function na(t) { - return ii(function() { - return Iu(t); +function xa(t) { + return vi(function() { + return eh(t); }, []); } -function mg(t) { - var e = hs(t); - return e.current = t, RT.__$f |= 4, ii(function() { - return LD(function() { +function $g(t) { + var e = Ss(t); + return e.current = t, iC.__$f |= 4, vi(function() { + return sP(function() { return e.current(); }); }, []); } -function vg(t) { - var e = hs(t); - e.current = t, Vn(function() { - return LT(function() { +function Bg(t) { + var e = Ss(t); + e.current = t, ri(function() { + return nC(function() { return e.current(); }); }, []); } -const IQ = Ya.define(), mne = Ya.define(), vne = Ya.define(); -class TAe { +const vU = co.define(), jne = co.define(), Kne = co.define(); +class g7e { constructor(e) { - this.view = e, this.conf = e.state.facet(kx), this._observer = (r, n) => { + this.view = e, this.conf = e.state.facet(Gx), this._observer = (r, n) => { if (n.origin !== this.conf) { - const i = [IQ.of(this.conf)]; - n.local ? i.push(vne.of(!0)) : i.push(mne.of(!0)); + const i = [vU.of(this.conf)]; + n.local ? i.push(Kne.of(!0)) : i.push(jne.of(!0)); const s = r.delta, a = []; let o = 0; for (let l = 0; l < s.length; l++) { @@ -26232,7 +26232,7 @@ class TAe { }, this._ytext = this.conf.ytext, this._ytext.observe(this._observer); } update(e) { - if (!e.docChanged || e.transactions.length > 0 && e.transactions[0].annotation(IQ) === this.conf) + if (!e.docChanged || e.transactions.length > 0 && e.transactions[0].annotation(vU) === this.conf) return; const r = this.conf.ytext; r.doc.transact(() => { @@ -26248,8 +26248,8 @@ class TAe { this._ytext.unobserve(this._observer); } } -const CAe = Jr.fromClass(TAe), EAe = () => "comment-" + Math.random().toString().replace(".", ""); -class _Ae { +const m7e = hn.fromClass(g7e), v7e = () => "comment-" + Math.random().toString().replace(".", ""); +class y7e { constructor(e, r, n, i, s) { this.user = r.awareness.getLocalState().user, this.lineAuthors = e.getArray(s + "/commentLineAuthors"), this.ydoc = e, this.getAvatar = n, this.getUserUrl = i, this.commentId = s; } @@ -26267,7 +26267,7 @@ class _Ae { } mark(e) { for (; e >= this.lineAuthors.length; ) - this.lineAuthors.push([new Nu()]); + this.lineAuthors.push([new Ju()]); this.lineAuthors.get(e - 1).set("author", this.user); } remove(e, r) { @@ -26275,8 +26275,8 @@ class _Ae { } insert(e, r) { e - 1 > this.lineAuthors.length && this.lineAuthors.push( - [...Array(e - 1 - this.lineAuthors.length).keys()].map((n) => new Nu()) - ), this.lineAuthors.insert(e - 1, [...Array(r).keys()].map((n) => new Nu([["author", this.user]]))); + [...Array(e - 1 - this.lineAuthors.length).keys()].map((n) => new Ju()) + ), this.lineAuthors.insert(e - 1, [...Array(r).keys()].map((n) => new Ju([["author", this.user]]))); } firstLineOfSection(e) { const r = this.get(e).name; @@ -26292,9 +26292,9 @@ class _Ae { ); } } -class AAe { +class b7e { constructor(e, r) { - this.syncedPositions = e.getMap(yy.dataPath), this.positions = Iu([]), this.syncedPositions.observe(() => { + this.syncedPositions = e.getMap(Uy.dataPath), this.positions = eh([]), this.syncedPositions.observe(() => { this.positions.value = [...this.syncedPositions.entries()].map(([n, i]) => ({ commentId: n, lineNumber: parseInt(i) @@ -26319,9 +26319,9 @@ class AAe { this.ydoc.transact(() => this.syncedPositions.delete(e), "comments"); } } -class LAe { +class x7e { constructor() { - this.comments = Iu({}); + this.comments = eh({}); } switchVisibility(e) { const r = this.isShown(e); @@ -26359,7 +26359,7 @@ class LAe { }; } } -class RAe { +class w7e { constructor(e, r) { this.user = e.awareness.getLocalState().user, this.resolvedComments = r.getMap("resolved-comments"), this.ydoc = r; } @@ -26391,9 +26391,9 @@ class RAe { this.resolvedComments.observe(() => e(this.resolved())); } } -const W$ = class { +const OB = class { constructor(e, r, n, i) { - this.ydoc = e, this.provider = r, this.getAvatar = n, this.getUserUrl = i, this.mainCodeMirror = null, this.newLocalComment = !1, this.positionManager = new AAe(e, this), this.displayManager = new LAe(r), this.commentResolver = new RAe(r, e), this.draggedComment = Iu(null), this.commentWithPopup = Iu(null), this.comments = LD(() => this.positions().positions.value.map(({ + this.ydoc = e, this.provider = r, this.getAvatar = n, this.getUserUrl = i, this.mainCodeMirror = null, this.newLocalComment = !1, this.positionManager = new b7e(e, this), this.displayManager = new x7e(r), this.commentResolver = new w7e(r, e), this.draggedComment = eh(null), this.commentWithPopup = eh(null), this.comments = sP(() => this.positions().positions.value.map(({ commentId: s, lineNumber: a }) => ({ @@ -26408,13 +26408,13 @@ const W$ = class { target: new RegExp(a.targetRegexSrc, a.targetRegexFlags) })); this.mainCodeMirror.dispatch({ - effects: cne.reconfigure(CD(s, yAe, this.positions())), - annotations: pi.userEvent.of("suggestion") + effects: qne.reconfigure(tP(s, l7e, this.positions())), + annotations: Ei.userEvent.of("suggestion") }); }), this.positionManager.syncedPositions.observeDeep(() => this.updateMainCodeMirror()); } lineAuthors(e) { - return new _Ae(this.ydoc, this.provider, this.getAvatar, this.getUserUrl, e); + return new y7e(this.ydoc, this.provider, this.getAvatar, this.getUserUrl, e); } positions() { return this.positionManager; @@ -26432,14 +26432,14 @@ const W$ = class { return this.mainCodeMirror.dom.querySelector(".cm-gutters").offsetWidth; } getTextForComment(e) { - return this.ydoc.getText(W$.commentsPrefix + e); + return this.ydoc.getText(OB.commentsPrefix + e); } delText(e) { let r = this.getTextForComment(e); r != null && r.parent && r.delete(); } newComment(e) { - const r = EAe(); + const r = v7e(); return this.positions().set(r, e.toString()), this.display().new(r), this.lineAuthors(r).mark(1), this.newLocalComment = !0, r; } deleteComment(e) { @@ -26490,12 +26490,12 @@ const W$ = class { e.includes(r) || (this.display().del(r), this.suggestions.set(r, [])); } syncFoldedComments(e) { - if (!Z9(e)) + if (!TL(e)) return; - const r = e.transactions[0].effects[0].is(Wu), { + const r = e.transactions[0].effects[0].is(uh), { from: n, to: i - } = e.transactions[0].effects[0].value, s = e.state.doc.lineAt(n).number, a = e.state.doc.lineAt(i).number, o = k4e(e.state).iter(0), l = []; + } = e.transactions[0].effects[0].value, s = e.state.doc.lineAt(n).number, a = e.state.doc.lineAt(i).number, o = d5e(e.state).iter(0), l = []; for (let u = o; u.value != null; o.next()) (u.from != n || u.to != i) && l.push({ fromLine: e.state.doc.lineAt(u.from).number, @@ -26526,7 +26526,7 @@ const W$ = class { color: (h = (u = s.get(l + 1)) == null ? void 0 : u.color) != null ? h : "#111" }; }); - r[n] = a.flatMap(vAe); + r[n] = a.flatMap(o7e); } this.suggestions.doc.transact(() => { for (const [n, i] of Object.entries(r)) @@ -26535,11 +26535,11 @@ const W$ = class { } updateMainCodeMirror() { this.mainCodeMirror ? this.mainCodeMirror.dispatch({ - effects: y2.of(null) + effects: U2.of(null) }) : console.warn("[YComments] Failed to update the main CodeMirror instance since it doesn't exist."); } syncResolvedComments(e) { - const r = !e.docChanged || e.transactions.some((s) => s.annotation(mne)), n = e.transactions.some((s) => s.effects.some((a) => a.is(y2))); + const r = !e.docChanged || e.transactions.some((s) => s.annotation(jne)), n = e.transactions.some((s) => s.effects.some((a) => a.is(U2))); if (r && !n) return; const i = this.resolver().resolved(); @@ -26611,7 +26611,7 @@ const W$ = class { }); } mapThroughChanges(e, r, n = !1) { - const i = r.startState.doc.line(e.lineNumber).from, s = r.changes.mapPos(i, 1), a = r.changes.mapPos(i, 1, Ci.TrackDel) == null, o = r.changes.mapPos(i, 1, Ci.TrackBefore) == null && (!n || r.startState.doc.line(e.lineNumber).text == ""); + const i = r.startState.doc.line(e.lineNumber).from, s = r.changes.mapPos(i, 1), a = r.changes.mapPos(i, 1, Fi.TrackDel) == null, o = r.changes.mapPos(i, 1, Fi.TrackBefore) == null && (!n || r.startState.doc.line(e.lineNumber).text == ""); let l = !1; return r.changes.iterChangedRanges((u) => { u == i && (l = !0); @@ -26623,13 +26623,13 @@ const W$ = class { }; } }; -let yy = W$; -Or(yy, "commentsPrefix", "comments/"); -const MT = At.define({ +let Uy = OB; +Mr(Uy, "commentsPrefix", "comments/"); +const sC = $t.define({ combine: (t) => t[t.length - 1], static: !0 -}), y2 = jt.define(); -class MAe extends Wa { +}), U2 = or.define(); +class O7e extends uo { constructor(e, r, n) { super(), this.height = e, this.commentId = r, this.isShown = n; } @@ -26641,12 +26641,12 @@ class MAe extends Wa { return e.id = this.commentId, e.classList = "comment-box", this.isShown || (e.classList += " comment-box-hidden"), e.style.height = this.height + "px", e; } } -const DAe = (t, e, r) => _t.widget({ - widget: new MAe(t, e, r), +const k7e = (t, e, r) => It.widget({ + widget: new O7e(t, e, r), side: 1e4, inlineOrder: !1, block: r -}), PAe = (t, e) => t.lineNumber - e.lineNumber, NAe = (t) => t.docChanged || t.effects.some((e) => e.is(y2)), IAe = (t) => [(e, { +}), S7e = (t, e) => t.lineNumber - e.lineNumber, T7e = (t) => t.docChanged || t.effects.some((e) => e.is(U2)), C7e = (t) => [(e, { commentId: r, lineNumber: n, height: i, @@ -26654,13 +26654,13 @@ const DAe = (t, e, r) => _t.widget({ }) => { try { const a = t.newDoc.line(n).to; - e.add(a, a, DAe(i, r, s)); + e.add(a, a, k7e(i, r, s)); } catch (a) { console.warn(a), console.warn(`An error occured when rendering comment ${r}. Comment will not be shown.`); } return e; -}, new Hi()], $Ae = (t, e) => { - if ((t.isUserEvent("input") || t.isUserEvent("delete") || t.annotation(vne)) && t.startState.doc.lines != t.state.doc.lines) { +}, new os()], E7e = (t, e) => { + if ((t.isUserEvent("input") || t.isUserEvent("delete") || t.annotation(Kne)) && t.startState.doc.lines != t.state.doc.lines) { const r = []; e.positions().positions.value.forEach((n) => { const { @@ -26672,65 +26672,65 @@ const DAe = (t, e, r) => _t.widget({ i ? e.deleteComment(n.commentId) : s != a && (r.push(n.commentId), e.positions().move(n.commentId, o, !1)); }), e.syncSuggestions(...r); } -}, BAe = In.define({ +}, _7e = Xn.define({ create() { - return new Hi().finish(); + return new os().finish(); }, update(t, e) { - if (NAe(e)) { - const r = e.state.facet(MT); - return $Ae(e, r), r.comments.value.sort(PAe).reduce(...IAe(e)).finish(); + if (T7e(e)) { + const r = e.state.facet(sC); + return E7e(e, r), r.comments.value.sort(S7e).reduce(...C7e(e)).finish(); } return t; }, provide(t) { - return ft.decorations.from(t); + return kt.decorations.from(t); } -}), $d = class extends Go { +}), r0 = class extends ul { constructor(e, r) { var n; - super(), this.gutterMarker = null, this.icon = null, r && e && (this.ycomments = r.state.facet(MT), this.lineNumber = r.state.doc.lineAt(e.to).number, this.commentId = (n = this.ycomments.findCommentOn(this.lineNumber)) == null ? void 0 : n.commentId); + super(), this.gutterMarker = null, this.icon = null, r && e && (this.ycomments = r.state.facet(sC), this.lineNumber = r.state.doc.lineAt(e.to).number, this.commentId = (n = this.ycomments.findCommentOn(this.lineNumber)) == null ? void 0 : n.commentId); } hasComments() { return Boolean(this.commentId); } createGutterMarker() { - this.gutterMarker = document.createElement("div"), this.gutterMarker.classList.add($d.MAIN_CLASS), this.lineNumber && (this.gutterMarker.style.width = this.lineNumber.toString().length * 7 + "px", this.gutterMarker.ondrop = () => this.ycomments.moveOrMerge(this.ycomments.draggedComment.value, this.lineNumber), this.gutterMarker.ondragover = (e) => e.preventDefault()); + this.gutterMarker = document.createElement("div"), this.gutterMarker.classList.add(r0.MAIN_CLASS), this.lineNumber && (this.gutterMarker.style.width = this.lineNumber.toString().length * 7 + "px", this.gutterMarker.ondrop = () => this.ycomments.moveOrMerge(this.ycomments.draggedComment.value, this.lineNumber), this.gutterMarker.ondragover = (e) => e.preventDefault()); } createPopupIcon() { - this.icon = document.createElement("section"), this.icon.classList = $d.ICON_CLASS, !this.draggedComment && !this.commentId ? (this.icon.onmouseenter = () => this.icon.classList.add($d.COMMENT_IMAGE_CLASS), this.icon.onmouseleave = () => this.icon.classList.remove($d.COMMENT_IMAGE_CLASS)) : (this.icon.onclick = () => this.ycomments.display().switchVisibility(this.commentId), this.icon.onmouseenter = () => { + this.icon = document.createElement("section"), this.icon.classList = r0.ICON_CLASS, !this.draggedComment && !this.commentId ? (this.icon.onmouseenter = () => this.icon.classList.add(r0.COMMENT_IMAGE_CLASS), this.icon.onmouseleave = () => this.icon.classList.remove(r0.COMMENT_IMAGE_CLASS)) : (this.icon.onclick = () => this.ycomments.display().switchVisibility(this.commentId), this.icon.onmouseenter = () => { this.ycomments.commentWithPopup.value = this.commentId, this.ycomments.updateMainCodeMirror(); }); } markHasComments() { - this.icon.classList.add($d.COMMENT_IMAGE_CLASS); + this.icon.classList.add(r0.COMMENT_IMAGE_CLASS); } toDOM() { return this.createGutterMarker(), this.createPopupIcon(), this.hasComments() && this.markHasComments(), this.gutterMarker.appendChild(this.icon), this.gutterMarker; } }; -let Ad = $d; -Or(Ad, "MAIN_CLASS", "comment-gutter"), Or(Ad, "ICON_CLASS", "comment-gutter-icon"), Or(Ad, "COMMENT_IMAGE_CLASS", "comment-image"); -const FAe = (t, e, r) => { +let Xd = r0; +Mr(Xd, "MAIN_CLASS", "comment-gutter"), Mr(Xd, "ICON_CLASS", "comment-gutter-icon"), Mr(Xd, "COMMENT_IMAGE_CLASS", "comment-image"); +const A7e = (t, e, r) => { var s; const n = t.state.doc.lineAt(e.to).number, i = (s = r.findCommentOn(n)) == null ? void 0 : s.commentId; return i || r.newComment(n); -}, zAe = cT({ +}, L7e = IT({ lineMarker(t, e) { - return new Ad(e, t); + return new Xd(e, t); }, - lineMarkerChange: (t) => t.transactions.some((e) => e.effects.some((r) => r.is(y2))), - initialSpacer: () => new Ad(null, null), + lineMarkerChange: (t) => t.transactions.some((e) => e.effects.some((r) => r.is(U2))), + initialSpacer: () => new Xd(null, null), domEventHandlers: { click(t, e) { - let r = t.state.facet(MT.reader), n = FAe(t, e, r); + let r = t.state.facet(sC.reader), n = A7e(t, e, r); r.display().switchVisibility(n), t.dispatch({ - effects: y2.of(null) + effects: U2.of(null) }); } } -}), QAe = (t) => [MT.of(t), BAe, zAe, ft.updateListener.of((e) => t.syncComments(e))]; -class dh { +}), R7e = (t) => [sC.of(t), _7e, L7e, kt.updateListener.of((e) => t.syncComments(e))]; +class Rh { constructor(e) { this.state = e; } @@ -26738,42 +26738,42 @@ class dh { return []; } } -class UAe extends dh { +class M7e extends Rh { run(e) { const r = new this.state.Token("code_inline", "code", 0); return r.content = e.content, [r]; } } -const VAe = { - raw: UAe -}, M8 = "math_inline"; -class qAe extends dh { +const D7e = { + raw: M7e +}, o9 = "math_inline"; +class P7e extends Rh { run(e) { - const r = new this.state.Token(M8, "span", 0); + const r = new this.state.Token(o9, "span", 0); return r.attrSet("class", "math inline"), r.markup = "$", r.content = e.content, [r]; } } -function YAe(t, e) { +function N7e(t, e) { var r; - !(!((r = e == null ? void 0 : e.roles) === null || r === void 0) && r.math) || t.renderer.rules[M8] || (t.renderer.rules[M8] = (n, i) => { + !(!((r = e == null ? void 0 : e.roles) === null || r === void 0) && r.math) || t.renderer.rules[o9] || (t.renderer.rules[o9] = (n, i) => { var s, a, o; const l = (o = (a = (s = e == null ? void 0 : e.opts) === null || s === void 0 ? void 0 : s.math) === null || a === void 0 ? void 0 : a.renderer) !== null && o !== void 0 ? o : (d) => t.utils.escapeHtml(d), u = n[i], h = u.content.trim(), f = l(h, { displayMode: !1 }); return `${f}`; }); } -const WAe = { - math: qAe +const I7e = { + math: P7e }; -function yne(t, e) { - e.parseRoles && t.inline.ruler.before("backticks", "parse_roles", GAe), t.core.ruler.after(e.rolesAfter || "inline", "run_roles", HAe(e.roles || {})), t.renderer.rules.role = (r, n) => { +function Jne(t, e) { + e.parseRoles && t.inline.ruler.before("backticks", "parse_roles", $7e), t.core.ruler.after(e.rolesAfter || "inline", "run_roles", F7e(e.roles || {})), t.renderer.rules.role = (r, n) => { const i = r[n]; return `${i.meta.name}${i.content}`; - }, YAe(t, e); + }, N7e(t, e); } -function GAe(t, e) { +function $7e(t, e) { if (t.src.charCodeAt(t.pos - 1) === 92) return !1; - const r = XAe.exec(t.src.slice(t.pos)); + const r = B7e.exec(t.src.slice(t.pos)); if (r == null) return !1; const [n, i, , s] = r; @@ -26783,14 +26783,14 @@ function GAe(t, e) { } return !0; } -let D8; +let l9; try { - D8 = new RegExp("^\\{([a-zA-Z_\\-+:]{1,36})\\}(`+)(?!`)(.+?)(?]+)>$/; -class e7e extends dh { +const tie = /^(.+?)<([^<>]+)>$/; +class q7e extends Rh { run(e) { const r = new this.state.Token("ref_open", "a", 1), n = new this.state.Token("text", "", 0), i = new this.state.Token("ref_close", "a", -1); - return MD(this.state, { open: r, content: n, close: i }, { kind: "eq", label: e.content }, { - kind: b2.equation, + return oP(this.state, { open: r, content: n, close: i }, { kind: "eq", label: e.content }, { + kind: V2.equation, contentFromTarget: (s) => `(${s.number})` }), [r, n, i]; } } -class t7e extends dh { +class Y7e extends Rh { run(e) { - const r = xne.exec(e.content), [, n, i] = r != null ? r : [], s = n == null ? void 0 : n.trim(), a = new this.state.Token("ref_open", "a", 1), o = new this.state.Token("text", "", 0), l = new this.state.Token("ref_close", "a", -1); - return MD(this.state, { open: a, content: o, close: l }, { kind: "numref", label: i || e.content, value: s }, { + const r = tie.exec(e.content), [, n, i] = r != null ? r : [], s = n == null ? void 0 : n.trim(), a = new this.state.Token("ref_open", "a", 1), o = new this.state.Token("text", "", 0), l = new this.state.Token("ref_close", "a", -1); + return oP(this.state, { open: a, content: o, close: l }, { kind: "numref", label: i || e.content, value: s }, { contentFromTarget: (u) => r ? s.replace(/%s/g, String(u.number)).replace(/\{number\}/g, String(u.number)) : u.title.trim() }), [a, o, l]; } } -class r7e extends dh { +class W7e extends Rh { run(e) { - const r = xne.exec(e.content), [, n, i] = r != null ? r : [], s = n == null ? void 0 : n.trim(), a = new this.state.Token("ref_open", "a", 1), o = new this.state.Token("text", "", 0), l = new this.state.Token("ref_close", "a", -1); - return MD(this.state, { open: a, content: o, close: l }, { kind: "ref", label: i || e.content, value: s }, { + const r = tie.exec(e.content), [, n, i] = r != null ? r : [], s = n == null ? void 0 : n.trim(), a = new this.state.Token("ref_open", "a", 1), o = new this.state.Token("text", "", 0), l = new this.state.Token("ref_close", "a", -1); + return oP(this.state, { open: a, content: o, close: l }, { kind: "ref", label: i || e.content, value: s }, { contentFromTarget: (u) => s || u.title }), [a, o, l]; } } -const n7e = { - eq: e7e, - ref: r7e, - numref: t7e -}, i7e = Object.assign(Object.assign(Object.assign(Object.assign({}, VAe), jAe), WAe), n7e); +const G7e = { + eq: q7e, + ref: W7e, + numref: Y7e +}, X7e = Object.assign(Object.assign(Object.assign(Object.assign({}, D7e), Q7e), I7e), G7e); /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ -function wne(t) { +function rie(t) { return typeof t > "u" || t === null; } -function s7e(t) { +function H7e(t) { return typeof t == "object" && t !== null; } -function a7e(t) { - return Array.isArray(t) ? t : wne(t) ? [] : [t]; +function Z7e(t) { + return Array.isArray(t) ? t : rie(t) ? [] : [t]; } -function o7e(t, e) { +function j7e(t, e) { var r, n, i, s; if (e) for (s = Object.keys(e), r = 0, n = s.length; r < n; r += 1) i = s[r], t[i] = e[i]; return t; } -function l7e(t, e) { +function K7e(t, e) { var r = "", n; for (n = 0; n < e; n += 1) r += t; return r; } -function c7e(t) { +function J7e(t) { return t === 0 && Number.NEGATIVE_INFINITY === 1 / t; } -var u7e = wne, h7e = s7e, f7e = a7e, d7e = l7e, p7e = c7e, g7e = o7e, Ei = { - isNothing: u7e, - isObject: h7e, - toArray: f7e, - repeat: d7e, - isNegativeZero: p7e, - extend: g7e +var e8e = rie, t8e = H7e, r8e = Z7e, n8e = K7e, i8e = J7e, s8e = j7e, zi = { + isNothing: e8e, + isObject: t8e, + toArray: r8e, + repeat: n8e, + isNegativeZero: i8e, + extend: s8e }; -function One(t, e) { +function nie(t, e) { var r = "", n = t.reason || "(unknown reason)"; return t.mark ? (t.mark.name && (r += 'in "' + t.mark.name + '" '), r += "(" + (t.mark.line + 1) + ":" + (t.mark.column + 1) + ")", !e && t.mark.snippet && (r += ` ` + t.mark.snippet), n + " " + r) : n; } -function x2(t, e) { - Error.call(this), this.name = "YAMLException", this.reason = t, this.mark = e, this.message = One(this, !1), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack || ""; +function q2(t, e) { + Error.call(this), this.name = "YAMLException", this.reason = t, this.mark = e, this.message = nie(this, !1), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack || ""; } -x2.prototype = Object.create(Error.prototype); -x2.prototype.constructor = x2; -x2.prototype.toString = function(e) { - return this.name + ": " + One(this, e); +q2.prototype = Object.create(Error.prototype); +q2.prototype.constructor = q2; +q2.prototype.toString = function(e) { + return this.name + ": " + nie(this, e); }; -var ia = x2; -function D6(t, e, r, n, i) { +var Oa = q2; +function l6(t, e, r, n, i) { var s = "", a = "", o = Math.floor(i / 2) - 1; return n - e > o && (s = " ... ", e = n - o + s.length), r - n > o && (a = " ...", r = n + o - a.length), { str: s + t.slice(e, r).replace(/\t/g, "\u2192") + a, pos: n - e + s.length }; } -function P6(t, e) { - return Ei.repeat(" ", e - t.length) + t; +function c6(t, e) { + return zi.repeat(" ", e - t.length) + t; } -function m7e(t, e) { +function a8e(t, e) { if (e = Object.create(e || null), !t.buffer) return null; e.maxLength || (e.maxLength = 79), typeof e.indent != "number" && (e.indent = 1), typeof e.linesBefore != "number" && (e.linesBefore = 3), typeof e.linesAfter != "number" && (e.linesAfter = 2); @@ -26994,28 +26994,28 @@ function m7e(t, e) { a < 0 && (a = n.length - 1); var o = "", l, u, h = Math.min(t.line + e.linesAfter, i.length).toString().length, f = e.maxLength - (e.indent + h + 3); for (l = 1; l <= e.linesBefore && !(a - l < 0); l++) - u = D6( + u = l6( t.buffer, n[a - l], i[a - l], t.position - (n[a] - n[a - l]), f - ), o = Ei.repeat(" ", e.indent) + P6((t.line - l + 1).toString(), h) + " | " + u.str + ` + ), o = zi.repeat(" ", e.indent) + c6((t.line - l + 1).toString(), h) + " | " + u.str + ` ` + o; - for (u = D6(t.buffer, n[a], i[a], t.position, f), o += Ei.repeat(" ", e.indent) + P6((t.line + 1).toString(), h) + " | " + u.str + ` -`, o += Ei.repeat("-", e.indent + h + 3 + u.pos) + `^ + for (u = l6(t.buffer, n[a], i[a], t.position, f), o += zi.repeat(" ", e.indent) + c6((t.line + 1).toString(), h) + " | " + u.str + ` +`, o += zi.repeat("-", e.indent + h + 3 + u.pos) + `^ `, l = 1; l <= e.linesAfter && !(a + l >= i.length); l++) - u = D6( + u = l6( t.buffer, n[a + l], i[a + l], t.position - (n[a] - n[a + l]), f - ), o += Ei.repeat(" ", e.indent) + P6((t.line + l + 1).toString(), h) + " | " + u.str + ` + ), o += zi.repeat(" ", e.indent) + c6((t.line + l + 1).toString(), h) + " | " + u.str + ` `; return o.replace(/\n$/, ""); } -var v7e = m7e, y7e = [ +var o8e = a8e, l8e = [ "kind", "multi", "resolve", @@ -27026,12 +27026,12 @@ var v7e = m7e, y7e = [ "representName", "defaultStyle", "styleAliases" -], b7e = [ +], c8e = [ "scalar", "sequence", "mapping" ]; -function x7e(t) { +function u8e(t) { var e = {}; return t !== null && Object.keys(t).forEach(function(r) { t[r].forEach(function(n) { @@ -27039,19 +27039,19 @@ function x7e(t) { }); }), e; } -function w7e(t, e) { +function h8e(t, e) { if (e = e || {}, Object.keys(e).forEach(function(r) { - if (y7e.indexOf(r) === -1) - throw new ia('Unknown option "' + r + '" is met in definition of "' + t + '" YAML type.'); + if (l8e.indexOf(r) === -1) + throw new Oa('Unknown option "' + r + '" is met in definition of "' + t + '" YAML type.'); }), this.options = e, this.tag = t, this.kind = e.kind || null, this.resolve = e.resolve || function() { return !0; }, this.construct = e.construct || function(r) { return r; - }, this.instanceOf = e.instanceOf || null, this.predicate = e.predicate || null, this.represent = e.represent || null, this.representName = e.representName || null, this.defaultStyle = e.defaultStyle || null, this.multi = e.multi || !1, this.styleAliases = x7e(e.styleAliases || null), b7e.indexOf(this.kind) === -1) - throw new ia('Unknown kind "' + this.kind + '" is specified for "' + t + '" YAML type.'); + }, this.instanceOf = e.instanceOf || null, this.predicate = e.predicate || null, this.represent = e.represent || null, this.representName = e.representName || null, this.defaultStyle = e.defaultStyle || null, this.multi = e.multi || !1, this.styleAliases = u8e(e.styleAliases || null), c8e.indexOf(this.kind) === -1) + throw new Oa('Unknown kind "' + this.kind + '" is specified for "' + t + '" YAML type.'); } -var ds = w7e; -function zQ(t, e) { +var Cs = h8e; +function wU(t, e) { var r = []; return t[e].forEach(function(n) { var i = r.length; @@ -27060,7 +27060,7 @@ function zQ(t, e) { }), r[i] = n; }), r; } -function O7e() { +function f8e() { var t = { scalar: {}, sequence: {}, @@ -27080,72 +27080,72 @@ function O7e() { arguments[e].forEach(n); return t; } -function P8(t) { +function c9(t) { return this.extend(t); } -P8.prototype.extend = function(e) { +c9.prototype.extend = function(e) { var r = [], n = []; - if (e instanceof ds) + if (e instanceof Cs) n.push(e); else if (Array.isArray(e)) n = n.concat(e); else if (e && (Array.isArray(e.implicit) || Array.isArray(e.explicit))) e.implicit && (r = r.concat(e.implicit)), e.explicit && (n = n.concat(e.explicit)); else - throw new ia("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })"); + throw new Oa("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })"); r.forEach(function(s) { - if (!(s instanceof ds)) - throw new ia("Specified list of YAML types (or a single Type object) contains a non-Type object."); + if (!(s instanceof Cs)) + throw new Oa("Specified list of YAML types (or a single Type object) contains a non-Type object."); if (s.loadKind && s.loadKind !== "scalar") - throw new ia("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported."); + throw new Oa("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported."); if (s.multi) - throw new ia("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit."); + throw new Oa("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit."); }), n.forEach(function(s) { - if (!(s instanceof ds)) - throw new ia("Specified list of YAML types (or a single Type object) contains a non-Type object."); + if (!(s instanceof Cs)) + throw new Oa("Specified list of YAML types (or a single Type object) contains a non-Type object."); }); - var i = Object.create(P8.prototype); - return i.implicit = (this.implicit || []).concat(r), i.explicit = (this.explicit || []).concat(n), i.compiledImplicit = zQ(i, "implicit"), i.compiledExplicit = zQ(i, "explicit"), i.compiledTypeMap = O7e(i.compiledImplicit, i.compiledExplicit), i; + var i = Object.create(c9.prototype); + return i.implicit = (this.implicit || []).concat(r), i.explicit = (this.explicit || []).concat(n), i.compiledImplicit = wU(i, "implicit"), i.compiledExplicit = wU(i, "explicit"), i.compiledTypeMap = f8e(i.compiledImplicit, i.compiledExplicit), i; }; -var kne = P8, Sne = new ds("tag:yaml.org,2002:str", { +var iie = c9, sie = new Cs("tag:yaml.org,2002:str", { kind: "scalar", construct: function(t) { return t !== null ? t : ""; } -}), Tne = new ds("tag:yaml.org,2002:seq", { +}), aie = new Cs("tag:yaml.org,2002:seq", { kind: "sequence", construct: function(t) { return t !== null ? t : []; } -}), Cne = new ds("tag:yaml.org,2002:map", { +}), oie = new Cs("tag:yaml.org,2002:map", { kind: "mapping", construct: function(t) { return t !== null ? t : {}; } -}), Ene = new kne({ +}), lie = new iie({ explicit: [ - Sne, - Tne, - Cne + sie, + aie, + oie ] }); -function k7e(t) { +function d8e(t) { if (t === null) return !0; var e = t.length; return e === 1 && t === "~" || e === 4 && (t === "null" || t === "Null" || t === "NULL"); } -function S7e() { +function p8e() { return null; } -function T7e(t) { +function g8e(t) { return t === null; } -var _ne = new ds("tag:yaml.org,2002:null", { +var cie = new Cs("tag:yaml.org,2002:null", { kind: "scalar", - resolve: k7e, - construct: S7e, - predicate: T7e, + resolve: d8e, + construct: p8e, + predicate: g8e, represent: { canonical: function() { return "~"; @@ -27165,23 +27165,23 @@ var _ne = new ds("tag:yaml.org,2002:null", { }, defaultStyle: "lowercase" }); -function C7e(t) { +function m8e(t) { if (t === null) return !1; var e = t.length; return e === 4 && (t === "true" || t === "True" || t === "TRUE") || e === 5 && (t === "false" || t === "False" || t === "FALSE"); } -function E7e(t) { +function v8e(t) { return t === "true" || t === "True" || t === "TRUE"; } -function _7e(t) { +function y8e(t) { return Object.prototype.toString.call(t) === "[object Boolean]"; } -var Ane = new ds("tag:yaml.org,2002:bool", { +var uie = new Cs("tag:yaml.org,2002:bool", { kind: "scalar", - resolve: C7e, - construct: E7e, - predicate: _7e, + resolve: m8e, + construct: v8e, + predicate: y8e, represent: { lowercase: function(t) { return t ? "true" : "false"; @@ -27195,16 +27195,16 @@ var Ane = new ds("tag:yaml.org,2002:bool", { }, defaultStyle: "lowercase" }); -function A7e(t) { +function b8e(t) { return 48 <= t && t <= 57 || 65 <= t && t <= 70 || 97 <= t && t <= 102; } -function L7e(t) { +function x8e(t) { return 48 <= t && t <= 55; } -function R7e(t) { +function w8e(t) { return 48 <= t && t <= 57; } -function M7e(t) { +function O8e(t) { if (t === null) return !1; var e = t.length, r = 0, n = !1, i; @@ -27225,7 +27225,7 @@ function M7e(t) { if (i === "x") { for (r++; r < e; r++) if (i = t[r], i !== "_") { - if (!A7e(t.charCodeAt(r))) + if (!b8e(t.charCodeAt(r))) return !1; n = !0; } @@ -27234,7 +27234,7 @@ function M7e(t) { if (i === "o") { for (r++; r < e; r++) if (i = t[r], i !== "_") { - if (!L7e(t.charCodeAt(r))) + if (!x8e(t.charCodeAt(r))) return !1; n = !0; } @@ -27245,13 +27245,13 @@ function M7e(t) { return !1; for (; r < e; r++) if (i = t[r], i !== "_") { - if (!R7e(t.charCodeAt(r))) + if (!w8e(t.charCodeAt(r))) return !1; n = !0; } return !(!n || i === "_"); } -function D7e(t) { +function k8e(t) { var e = t, r = 1, n; if (e.indexOf("_") !== -1 && (e = e.replace(/_/g, "")), n = e[0], (n === "-" || n === "+") && (n === "-" && (r = -1), e = e.slice(1), n = e[0]), e === "0") return 0; @@ -27265,14 +27265,14 @@ function D7e(t) { } return r * parseInt(e, 10); } -function P7e(t) { - return Object.prototype.toString.call(t) === "[object Number]" && t % 1 === 0 && !Ei.isNegativeZero(t); +function S8e(t) { + return Object.prototype.toString.call(t) === "[object Number]" && t % 1 === 0 && !zi.isNegativeZero(t); } -var Lne = new ds("tag:yaml.org,2002:int", { +var hie = new Cs("tag:yaml.org,2002:int", { kind: "scalar", - resolve: M7e, - construct: D7e, - predicate: P7e, + resolve: O8e, + construct: k8e, + predicate: S8e, represent: { binary: function(t) { return t >= 0 ? "0b" + t.toString(2) : "-0b" + t.toString(2).slice(1); @@ -27294,18 +27294,18 @@ var Lne = new ds("tag:yaml.org,2002:int", { decimal: [10, "dec"], hexadecimal: [16, "hex"] } -}), N7e = new RegExp( +}), T8e = new RegExp( "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$" ); -function I7e(t) { - return !(t === null || !N7e.test(t) || t[t.length - 1] === "_"); +function C8e(t) { + return !(t === null || !T8e.test(t) || t[t.length - 1] === "_"); } -function $7e(t) { +function E8e(t) { var e, r; return e = t.replace(/_/g, "").toLowerCase(), r = e[0] === "-" ? -1 : 1, "+-".indexOf(e[0]) >= 0 && (e = e.slice(1)), e === ".inf" ? r === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY : e === ".nan" ? NaN : r * parseFloat(e, 10); } -var B7e = /^[-+]?[0-9]+e/; -function F7e(t, e) { +var _8e = /^[-+]?[0-9]+e/; +function A8e(t, e) { var r; if (isNaN(t)) switch (e) { @@ -27334,38 +27334,38 @@ function F7e(t, e) { case "camelcase": return "-.Inf"; } - else if (Ei.isNegativeZero(t)) + else if (zi.isNegativeZero(t)) return "-0.0"; - return r = t.toString(10), B7e.test(r) ? r.replace("e", ".e") : r; + return r = t.toString(10), _8e.test(r) ? r.replace("e", ".e") : r; } -function z7e(t) { - return Object.prototype.toString.call(t) === "[object Number]" && (t % 1 !== 0 || Ei.isNegativeZero(t)); +function L8e(t) { + return Object.prototype.toString.call(t) === "[object Number]" && (t % 1 !== 0 || zi.isNegativeZero(t)); } -var Rne = new ds("tag:yaml.org,2002:float", { +var fie = new Cs("tag:yaml.org,2002:float", { kind: "scalar", - resolve: I7e, - construct: $7e, - predicate: z7e, - represent: F7e, + resolve: C8e, + construct: E8e, + predicate: L8e, + represent: A8e, defaultStyle: "lowercase" -}), Mne = Ene.extend({ +}), die = lie.extend({ implicit: [ - _ne, - Ane, - Lne, - Rne + cie, + uie, + hie, + fie ] -}), Dne = Mne, Pne = new RegExp( +}), pie = die, gie = new RegExp( "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$" -), Nne = new RegExp( +), mie = new RegExp( "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$" ); -function Q7e(t) { - return t === null ? !1 : Pne.exec(t) !== null || Nne.exec(t) !== null; +function R8e(t) { + return t === null ? !1 : gie.exec(t) !== null || mie.exec(t) !== null; } -function U7e(t) { +function M8e(t) { var e, r, n, i, s, a, o, l = 0, u = null, h, f, d; - if (e = Pne.exec(t), e === null && (e = Nne.exec(t)), e === null) + if (e = gie.exec(t), e === null && (e = mie.exec(t)), e === null) throw new Error("Date resolve error"); if (r = +e[1], n = +e[2] - 1, i = +e[3], !e[4]) return new Date(Date.UTC(r, n, i)); @@ -27376,28 +27376,28 @@ function U7e(t) { } return e[9] && (h = +e[10], f = +(e[11] || 0), u = (h * 60 + f) * 6e4, e[9] === "-" && (u = -u)), d = new Date(Date.UTC(r, n, i, s, a, o, l)), u && d.setTime(d.getTime() - u), d; } -function V7e(t) { +function D8e(t) { return t.toISOString(); } -var Ine = new ds("tag:yaml.org,2002:timestamp", { +var vie = new Cs("tag:yaml.org,2002:timestamp", { kind: "scalar", - resolve: Q7e, - construct: U7e, + resolve: R8e, + construct: M8e, instanceOf: Date, - represent: V7e + represent: D8e }); -function q7e(t) { +function P8e(t) { return t === "<<" || t === null; } -var $ne = new ds("tag:yaml.org,2002:merge", { +var yie = new Cs("tag:yaml.org,2002:merge", { kind: "scalar", - resolve: q7e -}), DD = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= + resolve: P8e +}), lP = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= \r`; -function Y7e(t) { +function N8e(t) { if (t === null) return !1; - var e, r, n = 0, i = t.length, s = DD; + var e, r, n = 0, i = t.length, s = lP; for (r = 0; r < i; r++) if (e = s.indexOf(t.charAt(r)), !(e > 64)) { if (e < 0) @@ -27406,37 +27406,37 @@ function Y7e(t) { } return n % 8 === 0; } -function W7e(t) { - var e, r, n = t.replace(/[\r\n=]/g, ""), i = n.length, s = DD, a = 0, o = []; +function I8e(t) { + var e, r, n = t.replace(/[\r\n=]/g, ""), i = n.length, s = lP, a = 0, o = []; for (e = 0; e < i; e++) e % 4 === 0 && e && (o.push(a >> 16 & 255), o.push(a >> 8 & 255), o.push(a & 255)), a = a << 6 | s.indexOf(n.charAt(e)); return r = i % 4 * 6, r === 0 ? (o.push(a >> 16 & 255), o.push(a >> 8 & 255), o.push(a & 255)) : r === 18 ? (o.push(a >> 10 & 255), o.push(a >> 2 & 255)) : r === 12 && o.push(a >> 4 & 255), new Uint8Array(o); } -function G7e(t) { - var e = "", r = 0, n, i, s = t.length, a = DD; +function $8e(t) { + var e = "", r = 0, n, i, s = t.length, a = lP; for (n = 0; n < s; n++) n % 3 === 0 && n && (e += a[r >> 18 & 63], e += a[r >> 12 & 63], e += a[r >> 6 & 63], e += a[r & 63]), r = (r << 8) + t[n]; return i = s % 3, i === 0 ? (e += a[r >> 18 & 63], e += a[r >> 12 & 63], e += a[r >> 6 & 63], e += a[r & 63]) : i === 2 ? (e += a[r >> 10 & 63], e += a[r >> 4 & 63], e += a[r << 2 & 63], e += a[64]) : i === 1 && (e += a[r >> 2 & 63], e += a[r << 4 & 63], e += a[64], e += a[64]), e; } -function X7e(t) { +function B8e(t) { return Object.prototype.toString.call(t) === "[object Uint8Array]"; } -var Bne = new ds("tag:yaml.org,2002:binary", { +var bie = new Cs("tag:yaml.org,2002:binary", { kind: "scalar", - resolve: Y7e, - construct: W7e, - predicate: X7e, - represent: G7e -}), H7e = Object.prototype.hasOwnProperty, Z7e = Object.prototype.toString; -function j7e(t) { + resolve: N8e, + construct: I8e, + predicate: B8e, + represent: $8e +}), F8e = Object.prototype.hasOwnProperty, z8e = Object.prototype.toString; +function Q8e(t) { if (t === null) return !0; var e = [], r, n, i, s, a, o = t; for (r = 0, n = o.length; r < n; r += 1) { - if (i = o[r], a = !1, Z7e.call(i) !== "[object Object]") + if (i = o[r], a = !1, z8e.call(i) !== "[object Object]") return !1; for (s in i) - if (H7e.call(i, s)) + if (F8e.call(i, s)) if (!a) a = !0; else @@ -27450,26 +27450,26 @@ function j7e(t) { } return !0; } -function K7e(t) { +function U8e(t) { return t !== null ? t : []; } -var Fne = new ds("tag:yaml.org,2002:omap", { +var xie = new Cs("tag:yaml.org,2002:omap", { kind: "sequence", - resolve: j7e, - construct: K7e -}), J7e = Object.prototype.toString; -function e8e(t) { + resolve: Q8e, + construct: U8e +}), V8e = Object.prototype.toString; +function q8e(t) { if (t === null) return !0; var e, r, n, i, s, a = t; for (s = new Array(a.length), e = 0, r = a.length; e < r; e += 1) { - if (n = a[e], J7e.call(n) !== "[object Object]" || (i = Object.keys(n), i.length !== 1)) + if (n = a[e], V8e.call(n) !== "[object Object]" || (i = Object.keys(n), i.length !== 1)) return !1; s[e] = [i[0], n[i[0]]]; } return !0; } -function t8e(t) { +function Y8e(t) { if (t === null) return []; var e, r, n, i, s, a = t; @@ -27477,81 +27477,81 @@ function t8e(t) { n = a[e], i = Object.keys(n), s[e] = [i[0], n[i[0]]]; return s; } -var zne = new ds("tag:yaml.org,2002:pairs", { +var wie = new Cs("tag:yaml.org,2002:pairs", { kind: "sequence", - resolve: e8e, - construct: t8e -}), r8e = Object.prototype.hasOwnProperty; -function n8e(t) { + resolve: q8e, + construct: Y8e +}), W8e = Object.prototype.hasOwnProperty; +function G8e(t) { if (t === null) return !0; var e, r = t; for (e in r) - if (r8e.call(r, e) && r[e] !== null) + if (W8e.call(r, e) && r[e] !== null) return !1; return !0; } -function i8e(t) { +function X8e(t) { return t !== null ? t : {}; } -var Qne = new ds("tag:yaml.org,2002:set", { +var Oie = new Cs("tag:yaml.org,2002:set", { kind: "mapping", - resolve: n8e, - construct: i8e -}), PD = Dne.extend({ + resolve: G8e, + construct: X8e +}), cP = pie.extend({ implicit: [ - Ine, - $ne + vie, + yie ], explicit: [ - Bne, - Fne, - zne, - Qne + bie, + xie, + wie, + Oie ] -}), Tf = Object.prototype.hasOwnProperty, Ek = 1, Une = 2, Vne = 3, _k = 4, N6 = 1, s8e = 2, QQ = 3, a8e = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, o8e = /[\x85\u2028\u2029]/, l8e = /[,\[\]\{\}]/, qne = /^(?:!|!!|![a-z\-]+!)$/i, Yne = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; -function UQ(t) { +}), Vf = Object.prototype.hasOwnProperty, e3 = 1, kie = 2, Sie = 3, t3 = 4, u6 = 1, H8e = 2, OU = 3, Z8e = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, j8e = /[\x85\u2028\u2029]/, K8e = /[,\[\]\{\}]/, Tie = /^(?:!|!!|![a-z\-]+!)$/i, Cie = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; +function kU(t) { return Object.prototype.toString.call(t); } -function Ic(t) { +function tu(t) { return t === 10 || t === 13; } -function n0(t) { +function O0(t) { return t === 9 || t === 32; } -function Ba(t) { +function ro(t) { return t === 9 || t === 32 || t === 10 || t === 13; } -function Xp(t) { +function gg(t) { return t === 44 || t === 91 || t === 93 || t === 123 || t === 125; } -function c8e(t) { +function J8e(t) { var e; return 48 <= t && t <= 57 ? t - 48 : (e = t | 32, 97 <= e && e <= 102 ? e - 97 + 10 : -1); } -function u8e(t) { +function e9e(t) { return t === 120 ? 2 : t === 117 ? 4 : t === 85 ? 8 : 0; } -function h8e(t) { +function t9e(t) { return 48 <= t && t <= 57 ? t - 48 : -1; } -function VQ(t) { +function SU(t) { return t === 48 ? "\0" : t === 97 ? "\x07" : t === 98 ? "\b" : t === 116 || t === 9 ? " " : t === 110 ? ` ` : t === 118 ? "\v" : t === 102 ? "\f" : t === 114 ? "\r" : t === 101 ? "\x1B" : t === 32 ? " " : t === 34 ? '"' : t === 47 ? "/" : t === 92 ? "\\" : t === 78 ? "\x85" : t === 95 ? "\xA0" : t === 76 ? "\u2028" : t === 80 ? "\u2029" : ""; } -function f8e(t) { +function r9e(t) { return t <= 65535 ? String.fromCharCode(t) : String.fromCharCode( (t - 65536 >> 10) + 55296, (t - 65536 & 1023) + 56320 ); } -var Wne = new Array(256), Gne = new Array(256); -for (var kp = 0; kp < 256; kp++) - Wne[kp] = VQ(kp) ? 1 : 0, Gne[kp] = VQ(kp); -function d8e(t, e) { - this.input = t, this.filename = e.filename || null, this.schema = e.schema || PD, this.onWarning = e.onWarning || null, this.legacy = e.legacy || !1, this.json = e.json || !1, this.listener = e.listener || null, this.implicitTypes = this.schema.compiledImplicit, this.typeMap = this.schema.compiledTypeMap, this.length = t.length, this.position = 0, this.line = 0, this.lineStart = 0, this.lineIndent = 0, this.firstTabInLine = -1, this.documents = []; +var Eie = new Array(256), _ie = new Array(256); +for (var qp = 0; qp < 256; qp++) + Eie[qp] = SU(qp) ? 1 : 0, _ie[qp] = SU(qp); +function n9e(t, e) { + this.input = t, this.filename = e.filename || null, this.schema = e.schema || cP, this.onWarning = e.onWarning || null, this.legacy = e.legacy || !1, this.json = e.json || !1, this.listener = e.listener || null, this.implicitTypes = this.schema.compiledImplicit, this.typeMap = this.schema.compiledTypeMap, this.length = t.length, this.position = 0, this.line = 0, this.lineStart = 0, this.lineIndent = 0, this.firstTabInLine = -1, this.documents = []; } -function Xne(t, e) { +function Aie(t, e) { var r = { name: t.filename, buffer: t.input.slice(0, -1), @@ -27559,59 +27559,59 @@ function Xne(t, e) { line: t.line, column: t.position - t.lineStart }; - return r.snippet = v7e(r), new ia(e, r); + return r.snippet = o8e(r), new Oa(e, r); } -function Ut(t, e) { - throw Xne(t, e); +function jt(t, e) { + throw Aie(t, e); } -function Ak(t, e) { - t.onWarning && t.onWarning.call(null, Xne(t, e)); +function r3(t, e) { + t.onWarning && t.onWarning.call(null, Aie(t, e)); } -var qQ = { +var TU = { YAML: function(e, r, n) { var i, s, a; - e.version !== null && Ut(e, "duplication of %YAML directive"), n.length !== 1 && Ut(e, "YAML directive accepts exactly one argument"), i = /^([0-9]+)\.([0-9]+)$/.exec(n[0]), i === null && Ut(e, "ill-formed argument of the YAML directive"), s = parseInt(i[1], 10), a = parseInt(i[2], 10), s !== 1 && Ut(e, "unacceptable YAML version of the document"), e.version = n[0], e.checkLineBreaks = a < 2, a !== 1 && a !== 2 && Ak(e, "unsupported YAML version of the document"); + e.version !== null && jt(e, "duplication of %YAML directive"), n.length !== 1 && jt(e, "YAML directive accepts exactly one argument"), i = /^([0-9]+)\.([0-9]+)$/.exec(n[0]), i === null && jt(e, "ill-formed argument of the YAML directive"), s = parseInt(i[1], 10), a = parseInt(i[2], 10), s !== 1 && jt(e, "unacceptable YAML version of the document"), e.version = n[0], e.checkLineBreaks = a < 2, a !== 1 && a !== 2 && r3(e, "unsupported YAML version of the document"); }, TAG: function(e, r, n) { var i, s; - n.length !== 2 && Ut(e, "TAG directive accepts exactly two arguments"), i = n[0], s = n[1], qne.test(i) || Ut(e, "ill-formed tag handle (first argument) of the TAG directive"), Tf.call(e.tagMap, i) && Ut(e, 'there is a previously declared suffix for "' + i + '" tag handle'), Yne.test(s) || Ut(e, "ill-formed tag prefix (second argument) of the TAG directive"); + n.length !== 2 && jt(e, "TAG directive accepts exactly two arguments"), i = n[0], s = n[1], Tie.test(i) || jt(e, "ill-formed tag handle (first argument) of the TAG directive"), Vf.call(e.tagMap, i) && jt(e, 'there is a previously declared suffix for "' + i + '" tag handle'), Cie.test(s) || jt(e, "ill-formed tag prefix (second argument) of the TAG directive"); try { s = decodeURIComponent(s); } catch { - Ut(e, "tag prefix is malformed: " + s); + jt(e, "tag prefix is malformed: " + s); } e.tagMap[i] = s; } }; -function af(t, e, r, n) { +function Sf(t, e, r, n) { var i, s, a, o; if (e < r) { if (o = t.input.slice(e, r), n) for (i = 0, s = o.length; i < s; i += 1) - a = o.charCodeAt(i), a === 9 || 32 <= a && a <= 1114111 || Ut(t, "expected valid JSON character"); + a = o.charCodeAt(i), a === 9 || 32 <= a && a <= 1114111 || jt(t, "expected valid JSON character"); else - a8e.test(o) && Ut(t, "the stream contains non-printable characters"); + Z8e.test(o) && jt(t, "the stream contains non-printable characters"); t.result += o; } } -function YQ(t, e, r, n) { +function CU(t, e, r, n) { var i, s, a, o; - for (Ei.isObject(r) || Ut(t, "cannot merge mappings; the provided source object is unacceptable"), i = Object.keys(r), a = 0, o = i.length; a < o; a += 1) - s = i[a], Tf.call(e, s) || (e[s] = r[s], n[s] = !0); + for (zi.isObject(r) || jt(t, "cannot merge mappings; the provided source object is unacceptable"), i = Object.keys(r), a = 0, o = i.length; a < o; a += 1) + s = i[a], Vf.call(e, s) || (e[s] = r[s], n[s] = !0); } -function Hp(t, e, r, n, i, s, a, o, l) { +function mg(t, e, r, n, i, s, a, o, l) { var u, h; if (Array.isArray(i)) for (i = Array.prototype.slice.call(i), u = 0, h = i.length; u < h; u += 1) - Array.isArray(i[u]) && Ut(t, "nested arrays are not supported inside keys"), typeof i == "object" && UQ(i[u]) === "[object Object]" && (i[u] = "[object Object]"); - if (typeof i == "object" && UQ(i) === "[object Object]" && (i = "[object Object]"), i = String(i), e === null && (e = {}), n === "tag:yaml.org,2002:merge") + Array.isArray(i[u]) && jt(t, "nested arrays are not supported inside keys"), typeof i == "object" && kU(i[u]) === "[object Object]" && (i[u] = "[object Object]"); + if (typeof i == "object" && kU(i) === "[object Object]" && (i = "[object Object]"), i = String(i), e === null && (e = {}), n === "tag:yaml.org,2002:merge") if (Array.isArray(s)) for (u = 0, h = s.length; u < h; u += 1) - YQ(t, e, s[u], r); + CU(t, e, s[u], r); else - YQ(t, e, s, r); + CU(t, e, s, r); else - !t.json && !Tf.call(r, i) && Tf.call(e, i) && (t.line = a || t.line, t.lineStart = o || t.lineStart, t.position = l || t.position, Ut(t, "duplicated mapping key")), i === "__proto__" ? Object.defineProperty(e, i, { + !t.json && !Vf.call(r, i) && Vf.call(e, i) && (t.line = a || t.line, t.lineStart = o || t.lineStart, t.position = l || t.position, jt(t, "duplicated mapping key")), i === "__proto__" ? Object.defineProperty(e, i, { configurable: !0, enumerable: !0, writable: !0, @@ -27619,50 +27619,50 @@ function Hp(t, e, r, n, i, s, a, o, l) { }) : e[i] = s, delete r[i]; return e; } -function ND(t) { +function uP(t) { var e; - e = t.input.charCodeAt(t.position), e === 10 ? t.position++ : e === 13 ? (t.position++, t.input.charCodeAt(t.position) === 10 && t.position++) : Ut(t, "a line break is expected"), t.line += 1, t.lineStart = t.position, t.firstTabInLine = -1; + e = t.input.charCodeAt(t.position), e === 10 ? t.position++ : e === 13 ? (t.position++, t.input.charCodeAt(t.position) === 10 && t.position++) : jt(t, "a line break is expected"), t.line += 1, t.lineStart = t.position, t.firstTabInLine = -1; } -function di(t, e, r) { +function Ci(t, e, r) { for (var n = 0, i = t.input.charCodeAt(t.position); i !== 0; ) { - for (; n0(i); ) + for (; O0(i); ) i === 9 && t.firstTabInLine === -1 && (t.firstTabInLine = t.position), i = t.input.charCodeAt(++t.position); if (e && i === 35) do i = t.input.charCodeAt(++t.position); while (i !== 10 && i !== 13 && i !== 0); - if (Ic(i)) - for (ND(t), i = t.input.charCodeAt(t.position), n++, t.lineIndent = 0; i === 32; ) + if (tu(i)) + for (uP(t), i = t.input.charCodeAt(t.position), n++, t.lineIndent = 0; i === 32; ) t.lineIndent++, i = t.input.charCodeAt(++t.position); else break; } - return r !== -1 && n !== 0 && t.lineIndent < r && Ak(t, "deficient indentation"), n; + return r !== -1 && n !== 0 && t.lineIndent < r && r3(t, "deficient indentation"), n; } -function PT(t) { +function oC(t) { var e = t.position, r; - return r = t.input.charCodeAt(e), !!((r === 45 || r === 46) && r === t.input.charCodeAt(e + 1) && r === t.input.charCodeAt(e + 2) && (e += 3, r = t.input.charCodeAt(e), r === 0 || Ba(r))); + return r = t.input.charCodeAt(e), !!((r === 45 || r === 46) && r === t.input.charCodeAt(e + 1) && r === t.input.charCodeAt(e + 2) && (e += 3, r = t.input.charCodeAt(e), r === 0 || ro(r))); } -function ID(t, e) { - e === 1 ? t.result += " " : e > 1 && (t.result += Ei.repeat(` +function hP(t, e) { + e === 1 ? t.result += " " : e > 1 && (t.result += zi.repeat(` `, e - 1)); } -function p8e(t, e, r) { +function i9e(t, e, r) { var n, i, s, a, o, l, u, h, f = t.kind, d = t.result, p; - if (p = t.input.charCodeAt(t.position), Ba(p) || Xp(p) || p === 35 || p === 38 || p === 42 || p === 33 || p === 124 || p === 62 || p === 39 || p === 34 || p === 37 || p === 64 || p === 96 || (p === 63 || p === 45) && (i = t.input.charCodeAt(t.position + 1), Ba(i) || r && Xp(i))) + if (p = t.input.charCodeAt(t.position), ro(p) || gg(p) || p === 35 || p === 38 || p === 42 || p === 33 || p === 124 || p === 62 || p === 39 || p === 34 || p === 37 || p === 64 || p === 96 || (p === 63 || p === 45) && (i = t.input.charCodeAt(t.position + 1), ro(i) || r && gg(i))) return !1; for (t.kind = "scalar", t.result = "", s = a = t.position, o = !1; p !== 0; ) { if (p === 58) { - if (i = t.input.charCodeAt(t.position + 1), Ba(i) || r && Xp(i)) + if (i = t.input.charCodeAt(t.position + 1), ro(i) || r && gg(i)) break; } else if (p === 35) { - if (n = t.input.charCodeAt(t.position - 1), Ba(n)) + if (n = t.input.charCodeAt(t.position - 1), ro(n)) break; } else { - if (t.position === t.lineStart && PT(t) || r && Xp(p)) + if (t.position === t.lineStart && oC(t) || r && gg(p)) break; - if (Ic(p)) - if (l = t.line, u = t.lineStart, h = t.lineIndent, di(t, !1, -1), t.lineIndent >= e) { + if (tu(p)) + if (l = t.line, u = t.lineStart, h = t.lineIndent, Ci(t, !1, -1), t.lineIndent >= e) { o = !0, p = t.input.charCodeAt(t.position); continue; } else { @@ -27670,49 +27670,49 @@ function p8e(t, e, r) { break; } } - o && (af(t, s, a, !1), ID(t, t.line - l), s = a = t.position, o = !1), n0(p) || (a = t.position + 1), p = t.input.charCodeAt(++t.position); + o && (Sf(t, s, a, !1), hP(t, t.line - l), s = a = t.position, o = !1), O0(p) || (a = t.position + 1), p = t.input.charCodeAt(++t.position); } - return af(t, s, a, !1), t.result ? !0 : (t.kind = f, t.result = d, !1); + return Sf(t, s, a, !1), t.result ? !0 : (t.kind = f, t.result = d, !1); } -function g8e(t, e) { +function s9e(t, e) { var r, n, i; if (r = t.input.charCodeAt(t.position), r !== 39) return !1; for (t.kind = "scalar", t.result = "", t.position++, n = i = t.position; (r = t.input.charCodeAt(t.position)) !== 0; ) if (r === 39) - if (af(t, n, t.position, !0), r = t.input.charCodeAt(++t.position), r === 39) + if (Sf(t, n, t.position, !0), r = t.input.charCodeAt(++t.position), r === 39) n = t.position, t.position++, i = t.position; else return !0; else - Ic(r) ? (af(t, n, i, !0), ID(t, di(t, !1, e)), n = i = t.position) : t.position === t.lineStart && PT(t) ? Ut(t, "unexpected end of the document within a single quoted scalar") : (t.position++, i = t.position); - Ut(t, "unexpected end of the stream within a single quoted scalar"); + tu(r) ? (Sf(t, n, i, !0), hP(t, Ci(t, !1, e)), n = i = t.position) : t.position === t.lineStart && oC(t) ? jt(t, "unexpected end of the document within a single quoted scalar") : (t.position++, i = t.position); + jt(t, "unexpected end of the stream within a single quoted scalar"); } -function m8e(t, e) { +function a9e(t, e) { var r, n, i, s, a, o; if (o = t.input.charCodeAt(t.position), o !== 34) return !1; for (t.kind = "scalar", t.result = "", t.position++, r = n = t.position; (o = t.input.charCodeAt(t.position)) !== 0; ) { if (o === 34) - return af(t, r, t.position, !0), t.position++, !0; + return Sf(t, r, t.position, !0), t.position++, !0; if (o === 92) { - if (af(t, r, t.position, !0), o = t.input.charCodeAt(++t.position), Ic(o)) - di(t, !1, e); - else if (o < 256 && Wne[o]) - t.result += Gne[o], t.position++; - else if ((a = u8e(o)) > 0) { + if (Sf(t, r, t.position, !0), o = t.input.charCodeAt(++t.position), tu(o)) + Ci(t, !1, e); + else if (o < 256 && Eie[o]) + t.result += _ie[o], t.position++; + else if ((a = e9e(o)) > 0) { for (i = a, s = 0; i > 0; i--) - o = t.input.charCodeAt(++t.position), (a = c8e(o)) >= 0 ? s = (s << 4) + a : Ut(t, "expected hexadecimal character"); - t.result += f8e(s), t.position++; + o = t.input.charCodeAt(++t.position), (a = J8e(o)) >= 0 ? s = (s << 4) + a : jt(t, "expected hexadecimal character"); + t.result += r9e(s), t.position++; } else - Ut(t, "unknown escape sequence"); + jt(t, "unknown escape sequence"); r = n = t.position; } else - Ic(o) ? (af(t, r, n, !0), ID(t, di(t, !1, e)), r = n = t.position) : t.position === t.lineStart && PT(t) ? Ut(t, "unexpected end of the document within a double quoted scalar") : (t.position++, n = t.position); + tu(o) ? (Sf(t, r, n, !0), hP(t, Ci(t, !1, e)), r = n = t.position) : t.position === t.lineStart && oC(t) ? jt(t, "unexpected end of the document within a double quoted scalar") : (t.position++, n = t.position); } - Ut(t, "unexpected end of the stream within a double quoted scalar"); + jt(t, "unexpected end of the stream within a double quoted scalar"); } -function v8e(t, e) { +function o9e(t, e) { var r = !0, n, i, s, a = t.tag, o, l = t.anchor, u, h, f, d, p, g = /* @__PURE__ */ Object.create(null), m, v, y, b; if (b = t.input.charCodeAt(t.position), b === 91) h = 93, p = !1, o = []; @@ -27721,14 +27721,14 @@ function v8e(t, e) { else return !1; for (t.anchor !== null && (t.anchorMap[t.anchor] = o), b = t.input.charCodeAt(++t.position); b !== 0; ) { - if (di(t, !0, e), b = t.input.charCodeAt(t.position), b === h) + if (Ci(t, !0, e), b = t.input.charCodeAt(t.position), b === h) return t.position++, t.tag = a, t.anchor = l, t.kind = p ? "mapping" : "sequence", t.result = o, !0; - r ? b === 44 && Ut(t, "expected the node content, but found ','") : Ut(t, "missed comma between flow collection entries"), v = m = y = null, f = d = !1, b === 63 && (u = t.input.charCodeAt(t.position + 1), Ba(u) && (f = d = !0, t.position++, di(t, !0, e))), n = t.line, i = t.lineStart, s = t.position, nm(t, e, Ek, !1, !0), v = t.tag, m = t.result, di(t, !0, e), b = t.input.charCodeAt(t.position), (d || t.line === n) && b === 58 && (f = !0, b = t.input.charCodeAt(++t.position), di(t, !0, e), nm(t, e, Ek, !1, !0), y = t.result), p ? Hp(t, o, g, v, m, y, n, i, s) : f ? o.push(Hp(t, null, g, v, m, y, n, i, s)) : o.push(m), di(t, !0, e), b = t.input.charCodeAt(t.position), b === 44 ? (r = !0, b = t.input.charCodeAt(++t.position)) : r = !1; + r ? b === 44 && jt(t, "expected the node content, but found ','") : jt(t, "missed comma between flow collection entries"), v = m = y = null, f = d = !1, b === 63 && (u = t.input.charCodeAt(t.position + 1), ro(u) && (f = d = !0, t.position++, Ci(t, !0, e))), n = t.line, i = t.lineStart, s = t.position, Sm(t, e, e3, !1, !0), v = t.tag, m = t.result, Ci(t, !0, e), b = t.input.charCodeAt(t.position), (d || t.line === n) && b === 58 && (f = !0, b = t.input.charCodeAt(++t.position), Ci(t, !0, e), Sm(t, e, e3, !1, !0), y = t.result), p ? mg(t, o, g, v, m, y, n, i, s) : f ? o.push(mg(t, null, g, v, m, y, n, i, s)) : o.push(m), Ci(t, !0, e), b = t.input.charCodeAt(t.position), b === 44 ? (r = !0, b = t.input.charCodeAt(++t.position)) : r = !1; } - Ut(t, "unexpected end of the stream within a flow collection"); + jt(t, "unexpected end of the stream within a flow collection"); } -function y8e(t, e) { - var r, n, i = N6, s = !1, a = !1, o = e, l = 0, u = !1, h, f; +function l9e(t, e) { + var r, n, i = u6, s = !1, a = !1, o = e, l = 0, u = !1, h, f; if (f = t.input.charCodeAt(t.position), f === 124) n = !1; else if (f === 62) @@ -27737,143 +27737,143 @@ function y8e(t, e) { return !1; for (t.kind = "scalar", t.result = ""; f !== 0; ) if (f = t.input.charCodeAt(++t.position), f === 43 || f === 45) - N6 === i ? i = f === 43 ? QQ : s8e : Ut(t, "repeat of a chomping mode identifier"); - else if ((h = h8e(f)) >= 0) - h === 0 ? Ut(t, "bad explicit indentation width of a block scalar; it cannot be less than one") : a ? Ut(t, "repeat of an indentation width identifier") : (o = e + h - 1, a = !0); + u6 === i ? i = f === 43 ? OU : H8e : jt(t, "repeat of a chomping mode identifier"); + else if ((h = t9e(f)) >= 0) + h === 0 ? jt(t, "bad explicit indentation width of a block scalar; it cannot be less than one") : a ? jt(t, "repeat of an indentation width identifier") : (o = e + h - 1, a = !0); else break; - if (n0(f)) { + if (O0(f)) { do f = t.input.charCodeAt(++t.position); - while (n0(f)); + while (O0(f)); if (f === 35) do f = t.input.charCodeAt(++t.position); - while (!Ic(f) && f !== 0); + while (!tu(f) && f !== 0); } for (; f !== 0; ) { - for (ND(t), t.lineIndent = 0, f = t.input.charCodeAt(t.position); (!a || t.lineIndent < o) && f === 32; ) + for (uP(t), t.lineIndent = 0, f = t.input.charCodeAt(t.position); (!a || t.lineIndent < o) && f === 32; ) t.lineIndent++, f = t.input.charCodeAt(++t.position); - if (!a && t.lineIndent > o && (o = t.lineIndent), Ic(f)) { + if (!a && t.lineIndent > o && (o = t.lineIndent), tu(f)) { l++; continue; } if (t.lineIndent < o) { - i === QQ ? t.result += Ei.repeat(` -`, s ? 1 + l : l) : i === N6 && s && (t.result += ` + i === OU ? t.result += zi.repeat(` +`, s ? 1 + l : l) : i === u6 && s && (t.result += ` `); break; } - for (n ? n0(f) ? (u = !0, t.result += Ei.repeat(` -`, s ? 1 + l : l)) : u ? (u = !1, t.result += Ei.repeat(` -`, l + 1)) : l === 0 ? s && (t.result += " ") : t.result += Ei.repeat(` -`, l) : t.result += Ei.repeat(` -`, s ? 1 + l : l), s = !0, a = !0, l = 0, r = t.position; !Ic(f) && f !== 0; ) + for (n ? O0(f) ? (u = !0, t.result += zi.repeat(` +`, s ? 1 + l : l)) : u ? (u = !1, t.result += zi.repeat(` +`, l + 1)) : l === 0 ? s && (t.result += " ") : t.result += zi.repeat(` +`, l) : t.result += zi.repeat(` +`, s ? 1 + l : l), s = !0, a = !0, l = 0, r = t.position; !tu(f) && f !== 0; ) f = t.input.charCodeAt(++t.position); - af(t, r, t.position, !1); + Sf(t, r, t.position, !1); } return !0; } -function WQ(t, e) { +function EU(t, e) { var r, n = t.tag, i = t.anchor, s = [], a, o = !1, l; if (t.firstTabInLine !== -1) return !1; - for (t.anchor !== null && (t.anchorMap[t.anchor] = s), l = t.input.charCodeAt(t.position); l !== 0 && (t.firstTabInLine !== -1 && (t.position = t.firstTabInLine, Ut(t, "tab characters must not be used in indentation")), !(l !== 45 || (a = t.input.charCodeAt(t.position + 1), !Ba(a)))); ) { - if (o = !0, t.position++, di(t, !0, -1) && t.lineIndent <= e) { + for (t.anchor !== null && (t.anchorMap[t.anchor] = s), l = t.input.charCodeAt(t.position); l !== 0 && (t.firstTabInLine !== -1 && (t.position = t.firstTabInLine, jt(t, "tab characters must not be used in indentation")), !(l !== 45 || (a = t.input.charCodeAt(t.position + 1), !ro(a)))); ) { + if (o = !0, t.position++, Ci(t, !0, -1) && t.lineIndent <= e) { s.push(null), l = t.input.charCodeAt(t.position); continue; } - if (r = t.line, nm(t, e, Vne, !1, !0), s.push(t.result), di(t, !0, -1), l = t.input.charCodeAt(t.position), (t.line === r || t.lineIndent > e) && l !== 0) - Ut(t, "bad indentation of a sequence entry"); + if (r = t.line, Sm(t, e, Sie, !1, !0), s.push(t.result), Ci(t, !0, -1), l = t.input.charCodeAt(t.position), (t.line === r || t.lineIndent > e) && l !== 0) + jt(t, "bad indentation of a sequence entry"); else if (t.lineIndent < e) break; } return o ? (t.tag = n, t.anchor = i, t.kind = "sequence", t.result = s, !0) : !1; } -function b8e(t, e, r) { +function c9e(t, e, r) { var n, i, s, a, o, l, u = t.tag, h = t.anchor, f = {}, d = /* @__PURE__ */ Object.create(null), p = null, g = null, m = null, v = !1, y = !1, b; if (t.firstTabInLine !== -1) return !1; for (t.anchor !== null && (t.anchorMap[t.anchor] = f), b = t.input.charCodeAt(t.position); b !== 0; ) { - if (!v && t.firstTabInLine !== -1 && (t.position = t.firstTabInLine, Ut(t, "tab characters must not be used in indentation")), n = t.input.charCodeAt(t.position + 1), s = t.line, (b === 63 || b === 58) && Ba(n)) - b === 63 ? (v && (Hp(t, f, d, p, g, null, a, o, l), p = g = m = null), y = !0, v = !0, i = !0) : v ? (v = !1, i = !0) : Ut(t, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"), t.position += 1, b = n; + if (!v && t.firstTabInLine !== -1 && (t.position = t.firstTabInLine, jt(t, "tab characters must not be used in indentation")), n = t.input.charCodeAt(t.position + 1), s = t.line, (b === 63 || b === 58) && ro(n)) + b === 63 ? (v && (mg(t, f, d, p, g, null, a, o, l), p = g = m = null), y = !0, v = !0, i = !0) : v ? (v = !1, i = !0) : jt(t, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"), t.position += 1, b = n; else { - if (a = t.line, o = t.lineStart, l = t.position, !nm(t, r, Une, !1, !0)) + if (a = t.line, o = t.lineStart, l = t.position, !Sm(t, r, kie, !1, !0)) break; if (t.line === s) { - for (b = t.input.charCodeAt(t.position); n0(b); ) + for (b = t.input.charCodeAt(t.position); O0(b); ) b = t.input.charCodeAt(++t.position); if (b === 58) - b = t.input.charCodeAt(++t.position), Ba(b) || Ut(t, "a whitespace character is expected after the key-value separator within a block mapping"), v && (Hp(t, f, d, p, g, null, a, o, l), p = g = m = null), y = !0, v = !1, i = !1, p = t.tag, g = t.result; + b = t.input.charCodeAt(++t.position), ro(b) || jt(t, "a whitespace character is expected after the key-value separator within a block mapping"), v && (mg(t, f, d, p, g, null, a, o, l), p = g = m = null), y = !0, v = !1, i = !1, p = t.tag, g = t.result; else if (y) - Ut(t, "can not read an implicit mapping pair; a colon is missed"); + jt(t, "can not read an implicit mapping pair; a colon is missed"); else return t.tag = u, t.anchor = h, !0; } else if (y) - Ut(t, "can not read a block mapping entry; a multiline key may not be an implicit key"); + jt(t, "can not read a block mapping entry; a multiline key may not be an implicit key"); else return t.tag = u, t.anchor = h, !0; } - if ((t.line === s || t.lineIndent > e) && (v && (a = t.line, o = t.lineStart, l = t.position), nm(t, e, _k, !0, i) && (v ? g = t.result : m = t.result), v || (Hp(t, f, d, p, g, m, a, o, l), p = g = m = null), di(t, !0, -1), b = t.input.charCodeAt(t.position)), (t.line === s || t.lineIndent > e) && b !== 0) - Ut(t, "bad indentation of a mapping entry"); + if ((t.line === s || t.lineIndent > e) && (v && (a = t.line, o = t.lineStart, l = t.position), Sm(t, e, t3, !0, i) && (v ? g = t.result : m = t.result), v || (mg(t, f, d, p, g, m, a, o, l), p = g = m = null), Ci(t, !0, -1), b = t.input.charCodeAt(t.position)), (t.line === s || t.lineIndent > e) && b !== 0) + jt(t, "bad indentation of a mapping entry"); else if (t.lineIndent < e) break; } - return v && Hp(t, f, d, p, g, null, a, o, l), y && (t.tag = u, t.anchor = h, t.kind = "mapping", t.result = f), y; + return v && mg(t, f, d, p, g, null, a, o, l), y && (t.tag = u, t.anchor = h, t.kind = "mapping", t.result = f), y; } -function x8e(t) { +function u9e(t) { var e, r = !1, n = !1, i, s, a; if (a = t.input.charCodeAt(t.position), a !== 33) return !1; - if (t.tag !== null && Ut(t, "duplication of a tag property"), a = t.input.charCodeAt(++t.position), a === 60 ? (r = !0, a = t.input.charCodeAt(++t.position)) : a === 33 ? (n = !0, i = "!!", a = t.input.charCodeAt(++t.position)) : i = "!", e = t.position, r) { + if (t.tag !== null && jt(t, "duplication of a tag property"), a = t.input.charCodeAt(++t.position), a === 60 ? (r = !0, a = t.input.charCodeAt(++t.position)) : a === 33 ? (n = !0, i = "!!", a = t.input.charCodeAt(++t.position)) : i = "!", e = t.position, r) { do a = t.input.charCodeAt(++t.position); while (a !== 0 && a !== 62); - t.position < t.length ? (s = t.input.slice(e, t.position), a = t.input.charCodeAt(++t.position)) : Ut(t, "unexpected end of the stream within a verbatim tag"); + t.position < t.length ? (s = t.input.slice(e, t.position), a = t.input.charCodeAt(++t.position)) : jt(t, "unexpected end of the stream within a verbatim tag"); } else { - for (; a !== 0 && !Ba(a); ) - a === 33 && (n ? Ut(t, "tag suffix cannot contain exclamation marks") : (i = t.input.slice(e - 1, t.position + 1), qne.test(i) || Ut(t, "named tag handle cannot contain such characters"), n = !0, e = t.position + 1)), a = t.input.charCodeAt(++t.position); - s = t.input.slice(e, t.position), l8e.test(s) && Ut(t, "tag suffix cannot contain flow indicator characters"); + for (; a !== 0 && !ro(a); ) + a === 33 && (n ? jt(t, "tag suffix cannot contain exclamation marks") : (i = t.input.slice(e - 1, t.position + 1), Tie.test(i) || jt(t, "named tag handle cannot contain such characters"), n = !0, e = t.position + 1)), a = t.input.charCodeAt(++t.position); + s = t.input.slice(e, t.position), K8e.test(s) && jt(t, "tag suffix cannot contain flow indicator characters"); } - s && !Yne.test(s) && Ut(t, "tag name cannot contain such characters: " + s); + s && !Cie.test(s) && jt(t, "tag name cannot contain such characters: " + s); try { s = decodeURIComponent(s); } catch { - Ut(t, "tag name is malformed: " + s); + jt(t, "tag name is malformed: " + s); } - return r ? t.tag = s : Tf.call(t.tagMap, i) ? t.tag = t.tagMap[i] + s : i === "!" ? t.tag = "!" + s : i === "!!" ? t.tag = "tag:yaml.org,2002:" + s : Ut(t, 'undeclared tag handle "' + i + '"'), !0; + return r ? t.tag = s : Vf.call(t.tagMap, i) ? t.tag = t.tagMap[i] + s : i === "!" ? t.tag = "!" + s : i === "!!" ? t.tag = "tag:yaml.org,2002:" + s : jt(t, 'undeclared tag handle "' + i + '"'), !0; } -function w8e(t) { +function h9e(t) { var e, r; if (r = t.input.charCodeAt(t.position), r !== 38) return !1; - for (t.anchor !== null && Ut(t, "duplication of an anchor property"), r = t.input.charCodeAt(++t.position), e = t.position; r !== 0 && !Ba(r) && !Xp(r); ) + for (t.anchor !== null && jt(t, "duplication of an anchor property"), r = t.input.charCodeAt(++t.position), e = t.position; r !== 0 && !ro(r) && !gg(r); ) r = t.input.charCodeAt(++t.position); - return t.position === e && Ut(t, "name of an anchor node must contain at least one character"), t.anchor = t.input.slice(e, t.position), !0; + return t.position === e && jt(t, "name of an anchor node must contain at least one character"), t.anchor = t.input.slice(e, t.position), !0; } -function O8e(t) { +function f9e(t) { var e, r, n; if (n = t.input.charCodeAt(t.position), n !== 42) return !1; - for (n = t.input.charCodeAt(++t.position), e = t.position; n !== 0 && !Ba(n) && !Xp(n); ) + for (n = t.input.charCodeAt(++t.position), e = t.position; n !== 0 && !ro(n) && !gg(n); ) n = t.input.charCodeAt(++t.position); - return t.position === e && Ut(t, "name of an alias node must contain at least one character"), r = t.input.slice(e, t.position), Tf.call(t.anchorMap, r) || Ut(t, 'unidentified alias "' + r + '"'), t.result = t.anchorMap[r], di(t, !0, -1), !0; + return t.position === e && jt(t, "name of an alias node must contain at least one character"), r = t.input.slice(e, t.position), Vf.call(t.anchorMap, r) || jt(t, 'unidentified alias "' + r + '"'), t.result = t.anchorMap[r], Ci(t, !0, -1), !0; } -function nm(t, e, r, n, i) { +function Sm(t, e, r, n, i) { var s, a, o, l = 1, u = !1, h = !1, f, d, p, g, m, v; - if (t.listener !== null && t.listener("open", t), t.tag = null, t.anchor = null, t.kind = null, t.result = null, s = a = o = _k === r || Vne === r, n && di(t, !0, -1) && (u = !0, t.lineIndent > e ? l = 1 : t.lineIndent === e ? l = 0 : t.lineIndent < e && (l = -1)), l === 1) - for (; x8e(t) || w8e(t); ) - di(t, !0, -1) ? (u = !0, o = s, t.lineIndent > e ? l = 1 : t.lineIndent === e ? l = 0 : t.lineIndent < e && (l = -1)) : o = !1; - if (o && (o = u || i), (l === 1 || _k === r) && (Ek === r || Une === r ? m = e : m = e + 1, v = t.position - t.lineStart, l === 1 ? o && (WQ(t, v) || b8e(t, v, m)) || v8e(t, m) ? h = !0 : (a && y8e(t, m) || g8e(t, m) || m8e(t, m) ? h = !0 : O8e(t) ? (h = !0, (t.tag !== null || t.anchor !== null) && Ut(t, "alias node should not have any properties")) : p8e(t, m, Ek === r) && (h = !0, t.tag === null && (t.tag = "?")), t.anchor !== null && (t.anchorMap[t.anchor] = t.result)) : l === 0 && (h = o && WQ(t, v))), t.tag === null) + if (t.listener !== null && t.listener("open", t), t.tag = null, t.anchor = null, t.kind = null, t.result = null, s = a = o = t3 === r || Sie === r, n && Ci(t, !0, -1) && (u = !0, t.lineIndent > e ? l = 1 : t.lineIndent === e ? l = 0 : t.lineIndent < e && (l = -1)), l === 1) + for (; u9e(t) || h9e(t); ) + Ci(t, !0, -1) ? (u = !0, o = s, t.lineIndent > e ? l = 1 : t.lineIndent === e ? l = 0 : t.lineIndent < e && (l = -1)) : o = !1; + if (o && (o = u || i), (l === 1 || t3 === r) && (e3 === r || kie === r ? m = e : m = e + 1, v = t.position - t.lineStart, l === 1 ? o && (EU(t, v) || c9e(t, v, m)) || o9e(t, m) ? h = !0 : (a && l9e(t, m) || s9e(t, m) || a9e(t, m) ? h = !0 : f9e(t) ? (h = !0, (t.tag !== null || t.anchor !== null) && jt(t, "alias node should not have any properties")) : i9e(t, m, e3 === r) && (h = !0, t.tag === null && (t.tag = "?")), t.anchor !== null && (t.anchorMap[t.anchor] = t.result)) : l === 0 && (h = o && EU(t, v))), t.tag === null) t.anchor !== null && (t.anchorMap[t.anchor] = t.result); else if (t.tag === "?") { - for (t.result !== null && t.kind !== "scalar" && Ut(t, 'unacceptable node kind for ! tag; it should be "scalar", not "' + t.kind + '"'), f = 0, d = t.implicitTypes.length; f < d; f += 1) + for (t.result !== null && t.kind !== "scalar" && jt(t, 'unacceptable node kind for ! tag; it should be "scalar", not "' + t.kind + '"'), f = 0, d = t.implicitTypes.length; f < d; f += 1) if (g = t.implicitTypes[f], g.resolve(t.result)) { t.result = g.construct(t.result), t.tag = g.tag, t.anchor !== null && (t.anchorMap[t.anchor] = t.result); break; } } else if (t.tag !== "!") { - if (Tf.call(t.typeMap[t.kind || "fallback"], t.tag)) + if (Vf.call(t.typeMap[t.kind || "fallback"], t.tag)) g = t.typeMap[t.kind || "fallback"][t.tag]; else for (g = null, p = t.typeMap.multi[t.kind || "fallback"], f = 0, d = p.length; f < d; f += 1) @@ -27881,87 +27881,87 @@ function nm(t, e, r, n, i) { g = p[f]; break; } - g || Ut(t, "unknown tag !<" + t.tag + ">"), t.result !== null && g.kind !== t.kind && Ut(t, "unacceptable node kind for !<" + t.tag + '> tag; it should be "' + g.kind + '", not "' + t.kind + '"'), g.resolve(t.result, t.tag) ? (t.result = g.construct(t.result, t.tag), t.anchor !== null && (t.anchorMap[t.anchor] = t.result)) : Ut(t, "cannot resolve a node with !<" + t.tag + "> explicit tag"); + g || jt(t, "unknown tag !<" + t.tag + ">"), t.result !== null && g.kind !== t.kind && jt(t, "unacceptable node kind for !<" + t.tag + '> tag; it should be "' + g.kind + '", not "' + t.kind + '"'), g.resolve(t.result, t.tag) ? (t.result = g.construct(t.result, t.tag), t.anchor !== null && (t.anchorMap[t.anchor] = t.result)) : jt(t, "cannot resolve a node with !<" + t.tag + "> explicit tag"); } return t.listener !== null && t.listener("close", t), t.tag !== null || t.anchor !== null || h; } -function k8e(t) { +function d9e(t) { var e = t.position, r, n, i, s = !1, a; - for (t.version = null, t.checkLineBreaks = t.legacy, t.tagMap = /* @__PURE__ */ Object.create(null), t.anchorMap = /* @__PURE__ */ Object.create(null); (a = t.input.charCodeAt(t.position)) !== 0 && (di(t, !0, -1), a = t.input.charCodeAt(t.position), !(t.lineIndent > 0 || a !== 37)); ) { - for (s = !0, a = t.input.charCodeAt(++t.position), r = t.position; a !== 0 && !Ba(a); ) + for (t.version = null, t.checkLineBreaks = t.legacy, t.tagMap = /* @__PURE__ */ Object.create(null), t.anchorMap = /* @__PURE__ */ Object.create(null); (a = t.input.charCodeAt(t.position)) !== 0 && (Ci(t, !0, -1), a = t.input.charCodeAt(t.position), !(t.lineIndent > 0 || a !== 37)); ) { + for (s = !0, a = t.input.charCodeAt(++t.position), r = t.position; a !== 0 && !ro(a); ) a = t.input.charCodeAt(++t.position); - for (n = t.input.slice(r, t.position), i = [], n.length < 1 && Ut(t, "directive name must not be less than one character in length"); a !== 0; ) { - for (; n0(a); ) + for (n = t.input.slice(r, t.position), i = [], n.length < 1 && jt(t, "directive name must not be less than one character in length"); a !== 0; ) { + for (; O0(a); ) a = t.input.charCodeAt(++t.position); if (a === 35) { do a = t.input.charCodeAt(++t.position); - while (a !== 0 && !Ic(a)); + while (a !== 0 && !tu(a)); break; } - if (Ic(a)) + if (tu(a)) break; - for (r = t.position; a !== 0 && !Ba(a); ) + for (r = t.position; a !== 0 && !ro(a); ) a = t.input.charCodeAt(++t.position); i.push(t.input.slice(r, t.position)); } - a !== 0 && ND(t), Tf.call(qQ, n) ? qQ[n](t, n, i) : Ak(t, 'unknown document directive "' + n + '"'); + a !== 0 && uP(t), Vf.call(TU, n) ? TU[n](t, n, i) : r3(t, 'unknown document directive "' + n + '"'); } - if (di(t, !0, -1), t.lineIndent === 0 && t.input.charCodeAt(t.position) === 45 && t.input.charCodeAt(t.position + 1) === 45 && t.input.charCodeAt(t.position + 2) === 45 ? (t.position += 3, di(t, !0, -1)) : s && Ut(t, "directives end mark is expected"), nm(t, t.lineIndent - 1, _k, !1, !0), di(t, !0, -1), t.checkLineBreaks && o8e.test(t.input.slice(e, t.position)) && Ak(t, "non-ASCII line breaks are interpreted as content"), t.documents.push(t.result), t.position === t.lineStart && PT(t)) { - t.input.charCodeAt(t.position) === 46 && (t.position += 3, di(t, !0, -1)); + if (Ci(t, !0, -1), t.lineIndent === 0 && t.input.charCodeAt(t.position) === 45 && t.input.charCodeAt(t.position + 1) === 45 && t.input.charCodeAt(t.position + 2) === 45 ? (t.position += 3, Ci(t, !0, -1)) : s && jt(t, "directives end mark is expected"), Sm(t, t.lineIndent - 1, t3, !1, !0), Ci(t, !0, -1), t.checkLineBreaks && j8e.test(t.input.slice(e, t.position)) && r3(t, "non-ASCII line breaks are interpreted as content"), t.documents.push(t.result), t.position === t.lineStart && oC(t)) { + t.input.charCodeAt(t.position) === 46 && (t.position += 3, Ci(t, !0, -1)); return; } if (t.position < t.length - 1) - Ut(t, "end of the stream or a document separator is expected"); + jt(t, "end of the stream or a document separator is expected"); else return; } -function Hne(t, e) { +function Lie(t, e) { t = String(t), e = e || {}, t.length !== 0 && (t.charCodeAt(t.length - 1) !== 10 && t.charCodeAt(t.length - 1) !== 13 && (t += ` `), t.charCodeAt(0) === 65279 && (t = t.slice(1))); - var r = new d8e(t, e), n = t.indexOf("\0"); - for (n !== -1 && (r.position = n, Ut(r, "null byte is not allowed in input")), r.input += "\0"; r.input.charCodeAt(r.position) === 32; ) + var r = new n9e(t, e), n = t.indexOf("\0"); + for (n !== -1 && (r.position = n, jt(r, "null byte is not allowed in input")), r.input += "\0"; r.input.charCodeAt(r.position) === 32; ) r.lineIndent += 1, r.position += 1; for (; r.position < r.length - 1; ) - k8e(r); + d9e(r); return r.documents; } -function S8e(t, e, r) { +function p9e(t, e, r) { e !== null && typeof e == "object" && typeof r > "u" && (r = e, e = null); - var n = Hne(t, r); + var n = Lie(t, r); if (typeof e != "function") return n; for (var i = 0, s = n.length; i < s; i += 1) e(n[i]); } -function T8e(t, e) { - var r = Hne(t, e); +function g9e(t, e) { + var r = Lie(t, e); if (r.length !== 0) { if (r.length === 1) return r[0]; - throw new ia("expected a single document in the stream, but found more"); - } -} -var C8e = S8e, E8e = T8e, Zne = { - loadAll: C8e, - load: E8e -}, jne = Object.prototype.toString, Kne = Object.prototype.hasOwnProperty, $D = 65279, _8e = 9, w2 = 10, A8e = 13, L8e = 32, R8e = 33, M8e = 34, N8 = 35, D8e = 37, P8e = 38, N8e = 39, I8e = 42, Jne = 44, $8e = 45, Lk = 58, B8e = 61, F8e = 62, z8e = 63, Q8e = 64, eie = 91, tie = 93, U8e = 96, rie = 123, V8e = 124, nie = 125, Ws = {}; -Ws[0] = "\\0"; -Ws[7] = "\\a"; -Ws[8] = "\\b"; -Ws[9] = "\\t"; -Ws[10] = "\\n"; -Ws[11] = "\\v"; -Ws[12] = "\\f"; -Ws[13] = "\\r"; -Ws[27] = "\\e"; -Ws[34] = '\\"'; -Ws[92] = "\\\\"; -Ws[133] = "\\N"; -Ws[160] = "\\_"; -Ws[8232] = "\\L"; -Ws[8233] = "\\P"; -var q8e = [ + throw new Oa("expected a single document in the stream, but found more"); + } +} +var m9e = p9e, v9e = g9e, Rie = { + loadAll: m9e, + load: v9e +}, Mie = Object.prototype.toString, Die = Object.prototype.hasOwnProperty, fP = 65279, y9e = 9, Y2 = 10, b9e = 13, x9e = 32, w9e = 33, O9e = 34, u9 = 35, k9e = 37, S9e = 38, T9e = 39, C9e = 42, Pie = 44, E9e = 45, n3 = 58, _9e = 61, A9e = 62, L9e = 63, R9e = 64, Nie = 91, Iie = 93, M9e = 96, $ie = 123, D9e = 124, Bie = 125, aa = {}; +aa[0] = "\\0"; +aa[7] = "\\a"; +aa[8] = "\\b"; +aa[9] = "\\t"; +aa[10] = "\\n"; +aa[11] = "\\v"; +aa[12] = "\\f"; +aa[13] = "\\r"; +aa[27] = "\\e"; +aa[34] = '\\"'; +aa[92] = "\\\\"; +aa[133] = "\\N"; +aa[160] = "\\_"; +aa[8232] = "\\L"; +aa[8233] = "\\P"; +var P9e = [ "y", "Y", "yes", @@ -27978,16 +27978,16 @@ var q8e = [ "off", "Off", "OFF" -], Y8e = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/; -function W8e(t, e) { +], N9e = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/; +function I9e(t, e) { var r, n, i, s, a, o, l; if (e === null) return {}; for (r = {}, n = Object.keys(e), i = 0, s = n.length; i < s; i += 1) - a = n[i], o = String(e[a]), a.slice(0, 2) === "!!" && (a = "tag:yaml.org,2002:" + a.slice(2)), l = t.compiledTypeMap.fallback[a], l && Kne.call(l.styleAliases, o) && (o = l.styleAliases[o]), r[a] = o; + a = n[i], o = String(e[a]), a.slice(0, 2) === "!!" && (a = "tag:yaml.org,2002:" + a.slice(2)), l = t.compiledTypeMap.fallback[a], l && Die.call(l.styleAliases, o) && (o = l.styleAliases[o]), r[a] = o; return r; } -function G8e(t) { +function $9e(t) { var e, r, n; if (e = t.toString(16).toUpperCase(), t <= 255) r = "x", n = 2; @@ -27996,90 +27996,90 @@ function G8e(t) { else if (t <= 4294967295) r = "U", n = 8; else - throw new ia("code point within a string may not be greater than 0xFFFFFFFF"); - return "\\" + r + Ei.repeat("0", n - e.length) + e; + throw new Oa("code point within a string may not be greater than 0xFFFFFFFF"); + return "\\" + r + zi.repeat("0", n - e.length) + e; } -var X8e = 1, O2 = 2; -function H8e(t) { - this.schema = t.schema || PD, this.indent = Math.max(1, t.indent || 2), this.noArrayIndent = t.noArrayIndent || !1, this.skipInvalid = t.skipInvalid || !1, this.flowLevel = Ei.isNothing(t.flowLevel) ? -1 : t.flowLevel, this.styleMap = W8e(this.schema, t.styles || null), this.sortKeys = t.sortKeys || !1, this.lineWidth = t.lineWidth || 80, this.noRefs = t.noRefs || !1, this.noCompatMode = t.noCompatMode || !1, this.condenseFlow = t.condenseFlow || !1, this.quotingType = t.quotingType === '"' ? O2 : X8e, this.forceQuotes = t.forceQuotes || !1, this.replacer = typeof t.replacer == "function" ? t.replacer : null, this.implicitTypes = this.schema.compiledImplicit, this.explicitTypes = this.schema.compiledExplicit, this.tag = null, this.result = "", this.duplicates = [], this.usedDuplicates = null; +var B9e = 1, W2 = 2; +function F9e(t) { + this.schema = t.schema || cP, this.indent = Math.max(1, t.indent || 2), this.noArrayIndent = t.noArrayIndent || !1, this.skipInvalid = t.skipInvalid || !1, this.flowLevel = zi.isNothing(t.flowLevel) ? -1 : t.flowLevel, this.styleMap = I9e(this.schema, t.styles || null), this.sortKeys = t.sortKeys || !1, this.lineWidth = t.lineWidth || 80, this.noRefs = t.noRefs || !1, this.noCompatMode = t.noCompatMode || !1, this.condenseFlow = t.condenseFlow || !1, this.quotingType = t.quotingType === '"' ? W2 : B9e, this.forceQuotes = t.forceQuotes || !1, this.replacer = typeof t.replacer == "function" ? t.replacer : null, this.implicitTypes = this.schema.compiledImplicit, this.explicitTypes = this.schema.compiledExplicit, this.tag = null, this.result = "", this.duplicates = [], this.usedDuplicates = null; } -function GQ(t, e) { - for (var r = Ei.repeat(" ", e), n = 0, i = -1, s = "", a, o = t.length; n < o; ) +function _U(t, e) { + for (var r = zi.repeat(" ", e), n = 0, i = -1, s = "", a, o = t.length; n < o; ) i = t.indexOf(` `, n), i === -1 ? (a = t.slice(n), n = o) : (a = t.slice(n, i + 1), n = i + 1), a.length && a !== ` ` && (s += r), s += a; return s; } -function I8(t, e) { +function h9(t, e) { return ` -` + Ei.repeat(" ", t.indent * e); +` + zi.repeat(" ", t.indent * e); } -function Z8e(t, e) { +function z9e(t, e) { var r, n, i; for (r = 0, n = t.implicitTypes.length; r < n; r += 1) if (i = t.implicitTypes[r], i.resolve(e)) return !0; return !1; } -function Rk(t) { - return t === L8e || t === _8e; +function i3(t) { + return t === x9e || t === y9e; } -function k2(t) { - return 32 <= t && t <= 126 || 161 <= t && t <= 55295 && t !== 8232 && t !== 8233 || 57344 <= t && t <= 65533 && t !== $D || 65536 <= t && t <= 1114111; +function G2(t) { + return 32 <= t && t <= 126 || 161 <= t && t <= 55295 && t !== 8232 && t !== 8233 || 57344 <= t && t <= 65533 && t !== fP || 65536 <= t && t <= 1114111; } -function XQ(t) { - return k2(t) && t !== $D && t !== A8e && t !== w2; +function AU(t) { + return G2(t) && t !== fP && t !== b9e && t !== Y2; } -function HQ(t, e, r) { - var n = XQ(t), i = n && !Rk(t); - return (r ? n : n && t !== Jne && t !== eie && t !== tie && t !== rie && t !== nie) && t !== N8 && !(e === Lk && !i) || XQ(e) && !Rk(e) && t === N8 || e === Lk && i; +function LU(t, e, r) { + var n = AU(t), i = n && !i3(t); + return (r ? n : n && t !== Pie && t !== Nie && t !== Iie && t !== $ie && t !== Bie) && t !== u9 && !(e === n3 && !i) || AU(e) && !i3(e) && t === u9 || e === n3 && i; } -function j8e(t) { - return k2(t) && t !== $D && !Rk(t) && t !== $8e && t !== z8e && t !== Lk && t !== Jne && t !== eie && t !== tie && t !== rie && t !== nie && t !== N8 && t !== P8e && t !== I8e && t !== R8e && t !== V8e && t !== B8e && t !== F8e && t !== N8e && t !== M8e && t !== D8e && t !== Q8e && t !== U8e; +function Q9e(t) { + return G2(t) && t !== fP && !i3(t) && t !== E9e && t !== L9e && t !== n3 && t !== Pie && t !== Nie && t !== Iie && t !== $ie && t !== Bie && t !== u9 && t !== S9e && t !== C9e && t !== w9e && t !== D9e && t !== _9e && t !== A9e && t !== T9e && t !== O9e && t !== k9e && t !== R9e && t !== M9e; } -function K8e(t) { - return !Rk(t) && t !== Lk; +function U9e(t) { + return !i3(t) && t !== n3; } -function Iv(t, e) { +function ay(t, e) { var r = t.charCodeAt(e), n; return r >= 55296 && r <= 56319 && e + 1 < t.length && (n = t.charCodeAt(e + 1), n >= 56320 && n <= 57343) ? (r - 55296) * 1024 + n - 56320 + 65536 : r; } -function iie(t) { +function Fie(t) { var e = /^\n* /; return e.test(t); } -var sie = 1, $8 = 2, aie = 3, oie = 4, zp = 5; -function J8e(t, e, r, n, i, s, a, o) { - var l, u = 0, h = null, f = !1, d = !1, p = n !== -1, g = -1, m = j8e(Iv(t, 0)) && K8e(Iv(t, t.length - 1)); +var zie = 1, f9 = 2, Qie = 3, Uie = 4, og = 5; +function V9e(t, e, r, n, i, s, a, o) { + var l, u = 0, h = null, f = !1, d = !1, p = n !== -1, g = -1, m = Q9e(ay(t, 0)) && U9e(ay(t, t.length - 1)); if (e || a) for (l = 0; l < t.length; u >= 65536 ? l += 2 : l++) { - if (u = Iv(t, l), !k2(u)) - return zp; - m = m && HQ(u, h, o), h = u; + if (u = ay(t, l), !G2(u)) + return og; + m = m && LU(u, h, o), h = u; } else { for (l = 0; l < t.length; u >= 65536 ? l += 2 : l++) { - if (u = Iv(t, l), u === w2) + if (u = ay(t, l), u === Y2) f = !0, p && (d = d || l - g - 1 > n && t[g + 1] !== " ", g = l); - else if (!k2(u)) - return zp; - m = m && HQ(u, h, o), h = u; + else if (!G2(u)) + return og; + m = m && LU(u, h, o), h = u; } d = d || p && l - g - 1 > n && t[g + 1] !== " "; } - return !f && !d ? m && !a && !i(t) ? sie : s === O2 ? zp : $8 : r > 9 && iie(t) ? zp : a ? s === O2 ? zp : $8 : d ? oie : aie; + return !f && !d ? m && !a && !i(t) ? zie : s === W2 ? og : f9 : r > 9 && Fie(t) ? og : a ? s === W2 ? og : f9 : d ? Uie : Qie; } -function e9e(t, e, r, n, i) { +function q9e(t, e, r, n, i) { t.dump = function() { if (e.length === 0) - return t.quotingType === O2 ? '""' : "''"; - if (!t.noCompatMode && (q8e.indexOf(e) !== -1 || Y8e.test(e))) - return t.quotingType === O2 ? '"' + e + '"' : "'" + e + "'"; + return t.quotingType === W2 ? '""' : "''"; + if (!t.noCompatMode && (P9e.indexOf(e) !== -1 || N9e.test(e))) + return t.quotingType === W2 ? '"' + e + '"' : "'" + e + "'"; var s = t.indent * Math.max(1, r), a = t.lineWidth === -1 ? -1 : Math.max(Math.min(t.lineWidth, 40), t.lineWidth - s), o = n || t.flowLevel > -1 && r >= t.flowLevel; function l(u) { - return Z8e(t, u); + return z9e(t, u); } - switch (J8e( + switch (V9e( e, o, t.indent, @@ -28089,47 +28089,47 @@ function e9e(t, e, r, n, i) { t.forceQuotes && !n, i )) { - case sie: + case zie: return e; - case $8: + case f9: return "'" + e.replace(/'/g, "''") + "'"; - case aie: - return "|" + ZQ(e, t.indent) + jQ(GQ(e, s)); - case oie: - return ">" + ZQ(e, t.indent) + jQ(GQ(t9e(e, a), s)); - case zp: - return '"' + r9e(e) + '"'; + case Qie: + return "|" + RU(e, t.indent) + MU(_U(e, s)); + case Uie: + return ">" + RU(e, t.indent) + MU(_U(Y9e(e, a), s)); + case og: + return '"' + W9e(e) + '"'; default: - throw new ia("impossible error: invalid scalar style"); + throw new Oa("impossible error: invalid scalar style"); } }(); } -function ZQ(t, e) { - var r = iie(t) ? String(e) : "", n = t[t.length - 1] === ` +function RU(t, e) { + var r = Fie(t) ? String(e) : "", n = t[t.length - 1] === ` `, i = n && (t[t.length - 2] === ` ` || t === ` `), s = i ? "+" : n ? "" : "-"; return r + s + ` `; } -function jQ(t) { +function MU(t) { return t[t.length - 1] === ` ` ? t.slice(0, -1) : t; } -function t9e(t, e) { +function Y9e(t, e) { for (var r = /(\n+)([^\n]*)/g, n = function() { var u = t.indexOf(` `); - return u = u !== -1 ? u : t.length, r.lastIndex = u, KQ(t.slice(0, u), e); + return u = u !== -1 ? u : t.length, r.lastIndex = u, DU(t.slice(0, u), e); }(), i = t[0] === ` ` || t[0] === " ", s, a; a = r.exec(t); ) { var o = a[1], l = a[2]; s = l[0] === " ", n += o + (!i && !s && l !== "" ? ` -` : "") + KQ(l, e), i = s; +` : "") + DU(l, e), i = s; } return n; } -function KQ(t, e) { +function DU(t, e) { if (t === "" || t[0] === " ") return t; for (var r = / [^ ]/g, n, i = 0, s, a = 0, o = 0, l = ""; n = r.exec(t); ) @@ -28139,78 +28139,78 @@ function KQ(t, e) { `, t.length - i > e && a > i ? l += t.slice(i, a) + ` ` + t.slice(a + 1) : l += t.slice(i), l.slice(1); } -function r9e(t) { +function W9e(t) { for (var e = "", r = 0, n, i = 0; i < t.length; r >= 65536 ? i += 2 : i++) - r = Iv(t, i), n = Ws[r], !n && k2(r) ? (e += t[i], r >= 65536 && (e += t[i + 1])) : e += n || G8e(r); + r = ay(t, i), n = aa[r], !n && G2(r) ? (e += t[i], r >= 65536 && (e += t[i + 1])) : e += n || $9e(r); return e; } -function n9e(t, e, r) { +function G9e(t, e, r) { var n = "", i = t.tag, s, a, o; for (s = 0, a = r.length; s < a; s += 1) - o = r[s], t.replacer && (o = t.replacer.call(r, String(s), o)), (Xu(t, e, o, !1, !1) || typeof o > "u" && Xu(t, e, null, !1, !1)) && (n !== "" && (n += "," + (t.condenseFlow ? "" : " ")), n += t.dump); + o = r[s], t.replacer && (o = t.replacer.call(r, String(s), o)), (fh(t, e, o, !1, !1) || typeof o > "u" && fh(t, e, null, !1, !1)) && (n !== "" && (n += "," + (t.condenseFlow ? "" : " ")), n += t.dump); t.tag = i, t.dump = "[" + n + "]"; } -function JQ(t, e, r, n) { +function PU(t, e, r, n) { var i = "", s = t.tag, a, o, l; for (a = 0, o = r.length; a < o; a += 1) - l = r[a], t.replacer && (l = t.replacer.call(r, String(a), l)), (Xu(t, e + 1, l, !0, !0, !1, !0) || typeof l > "u" && Xu(t, e + 1, null, !0, !0, !1, !0)) && ((!n || i !== "") && (i += I8(t, e)), t.dump && w2 === t.dump.charCodeAt(0) ? i += "-" : i += "- ", i += t.dump); + l = r[a], t.replacer && (l = t.replacer.call(r, String(a), l)), (fh(t, e + 1, l, !0, !0, !1, !0) || typeof l > "u" && fh(t, e + 1, null, !0, !0, !1, !0)) && ((!n || i !== "") && (i += h9(t, e)), t.dump && Y2 === t.dump.charCodeAt(0) ? i += "-" : i += "- ", i += t.dump); t.tag = s, t.dump = i || "[]"; } -function i9e(t, e, r) { +function X9e(t, e, r) { var n = "", i = t.tag, s = Object.keys(r), a, o, l, u, h; for (a = 0, o = s.length; a < o; a += 1) - h = "", n !== "" && (h += ", "), t.condenseFlow && (h += '"'), l = s[a], u = r[l], t.replacer && (u = t.replacer.call(r, l, u)), Xu(t, e, l, !1, !1) && (t.dump.length > 1024 && (h += "? "), h += t.dump + (t.condenseFlow ? '"' : "") + ":" + (t.condenseFlow ? "" : " "), Xu(t, e, u, !1, !1) && (h += t.dump, n += h)); + h = "", n !== "" && (h += ", "), t.condenseFlow && (h += '"'), l = s[a], u = r[l], t.replacer && (u = t.replacer.call(r, l, u)), fh(t, e, l, !1, !1) && (t.dump.length > 1024 && (h += "? "), h += t.dump + (t.condenseFlow ? '"' : "") + ":" + (t.condenseFlow ? "" : " "), fh(t, e, u, !1, !1) && (h += t.dump, n += h)); t.tag = i, t.dump = "{" + n + "}"; } -function s9e(t, e, r, n) { +function H9e(t, e, r, n) { var i = "", s = t.tag, a = Object.keys(r), o, l, u, h, f, d; if (t.sortKeys === !0) a.sort(); else if (typeof t.sortKeys == "function") a.sort(t.sortKeys); else if (t.sortKeys) - throw new ia("sortKeys must be a boolean or a function"); + throw new Oa("sortKeys must be a boolean or a function"); for (o = 0, l = a.length; o < l; o += 1) - d = "", (!n || i !== "") && (d += I8(t, e)), u = a[o], h = r[u], t.replacer && (h = t.replacer.call(r, u, h)), Xu(t, e + 1, u, !0, !0, !0) && (f = t.tag !== null && t.tag !== "?" || t.dump && t.dump.length > 1024, f && (t.dump && w2 === t.dump.charCodeAt(0) ? d += "?" : d += "? "), d += t.dump, f && (d += I8(t, e)), Xu(t, e + 1, h, !0, f) && (t.dump && w2 === t.dump.charCodeAt(0) ? d += ":" : d += ": ", d += t.dump, i += d)); + d = "", (!n || i !== "") && (d += h9(t, e)), u = a[o], h = r[u], t.replacer && (h = t.replacer.call(r, u, h)), fh(t, e + 1, u, !0, !0, !0) && (f = t.tag !== null && t.tag !== "?" || t.dump && t.dump.length > 1024, f && (t.dump && Y2 === t.dump.charCodeAt(0) ? d += "?" : d += "? "), d += t.dump, f && (d += h9(t, e)), fh(t, e + 1, h, !0, f) && (t.dump && Y2 === t.dump.charCodeAt(0) ? d += ":" : d += ": ", d += t.dump, i += d)); t.tag = s, t.dump = i || "{}"; } -function eU(t, e, r) { +function NU(t, e, r) { var n, i, s, a, o, l; for (i = r ? t.explicitTypes : t.implicitTypes, s = 0, a = i.length; s < a; s += 1) if (o = i[s], (o.instanceOf || o.predicate) && (!o.instanceOf || typeof e == "object" && e instanceof o.instanceOf) && (!o.predicate || o.predicate(e))) { if (r ? o.multi && o.representName ? t.tag = o.representName(e) : t.tag = o.tag : t.tag = "?", o.represent) { - if (l = t.styleMap[o.tag] || o.defaultStyle, jne.call(o.represent) === "[object Function]") + if (l = t.styleMap[o.tag] || o.defaultStyle, Mie.call(o.represent) === "[object Function]") n = o.represent(e, l); - else if (Kne.call(o.represent, l)) + else if (Die.call(o.represent, l)) n = o.represent[l](e, l); else - throw new ia("!<" + o.tag + '> tag resolver accepts not "' + l + '" style'); + throw new Oa("!<" + o.tag + '> tag resolver accepts not "' + l + '" style'); t.dump = n; } return !0; } return !1; } -function Xu(t, e, r, n, i, s, a) { - t.tag = null, t.dump = r, eU(t, r, !1) || eU(t, r, !0); - var o = jne.call(t.dump), l = n, u; +function fh(t, e, r, n, i, s, a) { + t.tag = null, t.dump = r, NU(t, r, !1) || NU(t, r, !0); + var o = Mie.call(t.dump), l = n, u; n && (n = t.flowLevel < 0 || t.flowLevel > e); var h = o === "[object Object]" || o === "[object Array]", f, d; if (h && (f = t.duplicates.indexOf(r), d = f !== -1), (t.tag !== null && t.tag !== "?" || d || t.indent !== 2 && e > 0) && (i = !1), d && t.usedDuplicates[f]) t.dump = "*ref_" + f; else { if (h && d && !t.usedDuplicates[f] && (t.usedDuplicates[f] = !0), o === "[object Object]") - n && Object.keys(t.dump).length !== 0 ? (s9e(t, e, t.dump, i), d && (t.dump = "&ref_" + f + t.dump)) : (i9e(t, e, t.dump), d && (t.dump = "&ref_" + f + " " + t.dump)); + n && Object.keys(t.dump).length !== 0 ? (H9e(t, e, t.dump, i), d && (t.dump = "&ref_" + f + t.dump)) : (X9e(t, e, t.dump), d && (t.dump = "&ref_" + f + " " + t.dump)); else if (o === "[object Array]") - n && t.dump.length !== 0 ? (t.noArrayIndent && !a && e > 0 ? JQ(t, e - 1, t.dump, i) : JQ(t, e, t.dump, i), d && (t.dump = "&ref_" + f + t.dump)) : (n9e(t, e, t.dump), d && (t.dump = "&ref_" + f + " " + t.dump)); + n && t.dump.length !== 0 ? (t.noArrayIndent && !a && e > 0 ? PU(t, e - 1, t.dump, i) : PU(t, e, t.dump, i), d && (t.dump = "&ref_" + f + t.dump)) : (G9e(t, e, t.dump), d && (t.dump = "&ref_" + f + " " + t.dump)); else if (o === "[object String]") - t.tag !== "?" && e9e(t, t.dump, e, s, l); + t.tag !== "?" && q9e(t, t.dump, e, s, l); else { if (o === "[object Undefined]") return !1; if (t.skipInvalid) return !1; - throw new ia("unacceptable kind of an object to dump " + o); + throw new Oa("unacceptable kind of an object to dump " + o); } t.tag !== null && t.tag !== "?" && (u = encodeURI( t.tag[0] === "!" ? t.tag.slice(1) : t.tag @@ -28218,71 +28218,71 @@ function Xu(t, e, r, n, i, s, a) { } return !0; } -function a9e(t, e) { +function Z9e(t, e) { var r = [], n = [], i, s; - for (B8(t, r, n), i = 0, s = n.length; i < s; i += 1) + for (d9(t, r, n), i = 0, s = n.length; i < s; i += 1) e.duplicates.push(r[n[i]]); e.usedDuplicates = new Array(s); } -function B8(t, e, r) { +function d9(t, e, r) { var n, i, s; if (t !== null && typeof t == "object") if (i = e.indexOf(t), i !== -1) r.indexOf(i) === -1 && r.push(i); else if (e.push(t), Array.isArray(t)) for (i = 0, s = t.length; i < s; i += 1) - B8(t[i], e, r); + d9(t[i], e, r); else for (n = Object.keys(t), i = 0, s = n.length; i < s; i += 1) - B8(t[n[i]], e, r); + d9(t[n[i]], e, r); } -function o9e(t, e) { +function j9e(t, e) { e = e || {}; - var r = new H8e(e); - r.noRefs || a9e(t, r); + var r = new F9e(e); + r.noRefs || Z9e(t, r); var n = t; - return r.replacer && (n = r.replacer.call({ "": n }, "", n)), Xu(r, 0, n, !0, !0) ? r.dump + ` + return r.replacer && (n = r.replacer.call({ "": n }, "", n)), fh(r, 0, n, !0, !0) ? r.dump + ` ` : ""; } -var l9e = o9e, c9e = { - dump: l9e +var K9e = j9e, J9e = { + dump: K9e }; -function BD(t, e) { +function dP(t, e) { return function() { throw new Error("Function yaml." + t + " is removed in js-yaml 4. Use yaml." + e + " instead, which is now safe by default."); }; } -var u9e = ds, h9e = kne, f9e = Ene, d9e = Mne, p9e = Dne, g9e = PD, m9e = Zne.load, v9e = Zne.loadAll, y9e = c9e.dump, b9e = ia, x9e = { - binary: Bne, - float: Rne, - map: Cne, - null: _ne, - pairs: zne, - set: Qne, - timestamp: Ine, - bool: Ane, - int: Lne, - merge: $ne, - omap: Fne, - seq: Tne, - str: Sne -}, w9e = BD("safeLoad", "load"), O9e = BD("safeLoadAll", "loadAll"), k9e = BD("safeDump", "dump"), S9e = { - Type: u9e, - Schema: h9e, - FAILSAFE_SCHEMA: f9e, - JSON_SCHEMA: d9e, - CORE_SCHEMA: p9e, - DEFAULT_SCHEMA: g9e, - load: m9e, - loadAll: v9e, - dump: y9e, - YAMLException: b9e, - types: x9e, - safeLoad: w9e, - safeLoadAll: O9e, - safeDump: k9e -}; -function T9e(t, e, r, n, i, s = !0) { +var eLe = Cs, tLe = iie, rLe = lie, nLe = die, iLe = pie, sLe = cP, aLe = Rie.load, oLe = Rie.loadAll, lLe = J9e.dump, cLe = Oa, uLe = { + binary: bie, + float: fie, + map: oie, + null: cie, + pairs: wie, + set: Oie, + timestamp: vie, + bool: uie, + int: hie, + merge: yie, + omap: xie, + seq: aie, + str: sie +}, hLe = dP("safeLoad", "load"), fLe = dP("safeLoadAll", "loadAll"), dLe = dP("safeDump", "dump"), pLe = { + Type: eLe, + Schema: tLe, + FAILSAFE_SCHEMA: rLe, + JSON_SCHEMA: nLe, + CORE_SCHEMA: iLe, + DEFAULT_SCHEMA: sLe, + load: aLe, + loadAll: oLe, + dump: lLe, + YAMLException: cLe, + types: uLe, + safeLoad: hLe, + safeLoadAll: fLe, + safeDump: dLe +}; +function gLe(t, e, r, n, i, s = !0) { const a = []; for (const l of [...t.core.ruler.__rules__].reverse()) { if (l.name === e) { @@ -28302,7 +28302,7 @@ function T9e(t, e, r, n, i, s = !0) { l.map = l.map !== null ? [l.map[0] + i, l.map[1] + i] : l.map; return o; } -class K0 { +class vp { constructor(e) { this.required_arguments = 0, this.optional_arguments = 0, this.final_argument_whitespace = !1, this.has_content = !1, this.option_spec = {}, this.rawOptions = !1, this.state = e; } @@ -28322,21 +28322,21 @@ class K0 { return (i == null ? void 0 : i.content) !== void 0 && (s.content = i.content), (i == null ? void 0 : i.level) !== void 0 && (s.level = i.level), (i == null ? void 0 : i.map) !== void 0 && (s.map = i.map), (i == null ? void 0 : i.block) !== void 0 && (s.block = i.block), (i == null ? void 0 : i.info) !== void 0 && (s.info = i.info), (i == null ? void 0 : i.meta) !== void 0 && (s.meta = i.meta), (i == null ? void 0 : i.children) !== void 0 && (s.children = i.children), s; } nestedParse(e, r) { - return T9e(this.state.md, "run_directives", e, this.state.env, r, !0); + return gLe(this.state.md, "run_directives", e, this.state.env, r, !0); } } -class Wh extends Error { +class hf extends Error { constructor() { super(...arguments), this.name = "DirectiveParsingError"; } } -function C9e(t, e) { +function mLe(t, e) { const r = t.meta.arg || "", n = t.content; let i = n.trim() ? n.split(/\r?\n/) : [], s = 0, a = {}; - (Object.keys(e.option_spec || {}) || e.rawOptions) && ([i, a, s] = lie(i, e)); + (Object.keys(e.option_spec || {}) || e.rawOptions) && ([i, a, s] = Vie(i, e)); let o = []; - if (!e.required_arguments && !e.optional_arguments ? r && (s = 0, i = [r].concat(i)) : o = E9e(r, e), i.length && !i[0].trim() && (i.shift(), s++), i.length && !e.has_content) - throw new Wh("Has content but content not allowed"); + if (!e.required_arguments && !e.optional_arguments ? r && (s = 0, i = [r].concat(i)) : o = vLe(r, e), i.length && !i[0].trim() && (i.shift(), s++), i.length && !e.has_content) + throw new hf("Has content but content not allowed"); return { map: t.map ? t.map : [0, 0], args: o, @@ -28349,7 +28349,7 @@ function C9e(t, e) { ] : [0, 0] }; } -function lie(t, e) { +function Vie(t, e) { let r = 1, n = {}, i = null; if (t.length && t[0].startsWith("---")) { r++; @@ -28379,51 +28379,51 @@ function lie(t, e) { } if (i !== null) try { - const s = S9e.load(i.join(` + const s = pLe.load(i.join(` `)); if (s !== null && typeof s == "object") n = s; else - throw new Wh(`not dict: ${s}`); + throw new hf(`not dict: ${s}`); } catch (s) { - throw new Wh(`Invalid options YAML: ${s}`); + throw new hf(`Invalid options YAML: ${s}`); } if (e.rawOptions) return [t, n, r]; for (const [s, a] of Object.entries(n)) { const o = e.option_spec ? e.option_spec[s] : null; if (!o) - throw new Wh(`Unknown option: ${s}`); + throw new hf(`Unknown option: ${s}`); let l = a; (a === null || a === !1) && (l = ""); try { l = o(`${l || ""}`); } catch (u) { - throw new Wh(`Invalid option value: (option: '${s}'; value: ${a}) + throw new hf(`Invalid option value: (option: '${s}'; value: ${a}) ${u}`); } n[s] = l; } return [t, n, r]; } -function E9e(t, e) { +function vLe(t, e) { var r; let n = t.trim() ? (r = t.trim()) === null || r === void 0 ? void 0 : r.split(/\s+/) : []; const i = (e.required_arguments || 0) + (e.optional_arguments || 0); if (n.length < (e.required_arguments || 0)) - throw new Wh(`${e.required_arguments} argument(s) required, ${n.length} supplied`); + throw new hf(`${e.required_arguments} argument(s) required, ${n.length} supplied`); if (n.length > i) if (e.final_argument_whitespace) { const s = t.split(/\s+/); n = s.splice(0, i - 1), n.push(s.join(" ")); } else - throw new Wh(`maximum ${i} argument(s) allowed, ${n.length} supplied`); + throw new hf(`maximum ${i} argument(s) allowed, ${n.length} supplied`); return n; } -function _9e(t, e) { +function yLe(t, e) { var r; let n = e.directivesAfter || "block"; - (!((r = e.replaceFences) !== null && r !== void 0) || r) && (t.core.ruler.after(n, "fence_to_directive", A9e), n = "fence_to_directive"), t.core.ruler.after(n, "run_directives", L9e(e.directives || {})), t.renderer.rules.directive = (i, s) => { + (!((r = e.replaceFences) !== null && r !== void 0) || r) && (t.core.ruler.after(n, "fence_to_directive", bLe), n = "fence_to_directive"), t.core.ruler.after(n, "run_directives", xLe(e.directives || {})), t.renderer.rules.directive = (i, s) => { const a = i[s]; return ` `; }; } -function A9e(t) { +function bLe(t) { for (const e of t.tokens) if (e.type === "fence" || e.type === "colon_fence") { const r = e.info.match(/^\{([^\s}]+)\}\s*(.*)$/); @@ -28450,13 +28450,13 @@ function A9e(t) { } return !0; } -function L9e(t) { +function xLe(t) { function e(r) { const n = []; for (const i of r.tokens) if (i.type === "directive" && i.info in t) try { - const s = new t[i.info](r), a = C9e(i, s), [o, l] = lie(i.content.trim() ? i.content.split(/\r?\n/) : [], s), u = new r.Token("parsed_directive_open", "", 1); + const s = new t[i.info](r), a = mLe(i, s), [o, l] = Vie(i.content.trim() ? i.content.split(/\r?\n/) : [], s), u = new r.Token("parsed_directive_open", "", 1); u.info = i.info, u.hidden = !0, u.content = o.join(` `).trim(), u.meta = { arg: i.meta.arg, @@ -28476,64 +28476,64 @@ function L9e(t) { } return e; } -function R9e(t) { +function wLe(t) { return t.toLowerCase().split(/\s+/).join("-").replace(/[^a-z0-9]+/, "-").replace(/^[-0-9]+|-+$/, ""); } -class g0 extends Error { +class P0 extends Error { constructor() { super(...arguments), this.name = "OptionSpecError"; } } -const Cf = (t) => t, F8 = (t) => { +const qf = (t) => t, p9 = (t) => { if (!t) - throw new g0("Argument required but none supplied"); + throw new P0("Argument required but none supplied"); return t; -}, z8 = (t) => { +}, g9 = (t) => { if (t.trim()) - throw new g0(`No argument is allowed: "${t}" supplied`); + throw new P0(`No argument is allowed: "${t}" supplied`); return null; -}, o1 = (t) => `${t || ""}`.split(/\s+/).map((e) => R9e(e)); -function cie(t) { +}, _1 = (t) => `${t || ""}`.split(/\s+/).map((e) => wLe(e)); +function qie(t) { if (!t) - throw new g0("Value is not set"); + throw new P0("Value is not set"); const e = Number.parseFloat(t); if (Number.isNaN(e) || !Number.isInteger(e)) - throw new g0(`Value "${t}" is not an integer`); + throw new P0(`Value "${t}" is not an integer`); return e; } -function Mk(t) { - const e = cie(t); +function s3(t) { + const e = qie(t); if (e < 0) - throw new g0(`Value "${t}" must be positive or zero`); + throw new P0(`Value "${t}" must be positive or zero`); return e; } -const uie = (t) => t ? Mk(t) : null, M9e = (t) => (t = `${t || ""}`.replace(/\s+%$/, ""), Mk(t)); -function hie(t, e) { +const Yie = (t) => t ? s3(t) : null, OLe = (t) => (t = `${t || ""}`.replace(/\s+%$/, ""), s3(t)); +function Wie(t, e) { const n = new RegExp(`^(?[0-9.]+)\\s*(?${e.join("|")})$`).exec(t); if (!n || !n.groups) - throw new g0(`not a positive measure of one of the following units: ${e.join("|")}`); + throw new P0(`not a positive measure of one of the following units: ${e.join("|")}`); return n.groups.number + n.groups.units; } -const fie = ["em", "ex", "px", "in", "cm", "mm", "pt", "pc"], die = (t) => hie(t, [...fie, ""]), FD = (t, e = "") => { +const Gie = ["em", "ex", "px", "in", "cm", "mm", "pt", "pc"], Xie = (t) => Wie(t, [...Gie, ""]), pP = (t, e = "") => { try { - return hie(t, [...fie, "%"]); + return Wie(t, [...Gie, "%"]); } catch { - return die(t) + e; + return Xie(t) + e; } -}, D9e = (t, e = "") => t.toLowerCase() === "image" ? "image" : FD(t, e); -function zD(t) { +}, kLe = (t, e = "") => t.toLowerCase() === "image" ? "image" : pP(t, e); +function gP(t) { return (e) => { if (e = e.toLowerCase().trim(), t.includes(e)) return e; - throw new g0(`must be in: ${t.join("|")}`); + throw new P0(`must be in: ${t.join("|")}`); }; } -const P9e = (t) => t; -class Xl extends K0 { +const SLe = (t) => t; +class fc extends vp { constructor() { super(...arguments), this.final_argument_whitespace = !0, this.has_content = !0, this.option_spec = { - class: o1, - name: Cf + class: _1, + name: qf }, this.title = "", this.kind = ""; } run(e) { @@ -28556,81 +28556,81 @@ class Xl extends K0 { return n.push(...o), n.push(this.createToken("admonition_close", "aside", -1, { block: !0 })), n; } } -class N9e extends Xl { +class TLe extends fc { constructor() { super(...arguments), this.required_arguments = 1; } } -class I9e extends Xl { +class CLe extends fc { constructor() { super(...arguments), this.title = "Attention", this.kind = "attention"; } } -class $9e extends Xl { +class ELe extends fc { constructor() { super(...arguments), this.title = "Caution", this.kind = "caution"; } } -class B9e extends Xl { +class _Le extends fc { constructor() { super(...arguments), this.title = "Danger", this.kind = "danger"; } } -class F9e extends Xl { +class ALe extends fc { constructor() { super(...arguments), this.title = "Error", this.kind = "error"; } } -class z9e extends Xl { +class LLe extends fc { constructor() { super(...arguments), this.title = "Important", this.kind = "important"; } } -class Q9e extends Xl { +class RLe extends fc { constructor() { super(...arguments), this.title = "Hint", this.kind = "hint"; } } -class U9e extends Xl { +class MLe extends fc { constructor() { super(...arguments), this.title = "Note", this.kind = "note"; } } -class V9e extends Xl { +class DLe extends fc { constructor() { super(...arguments), this.title = "See Also", this.kind = "seealso"; } } -class q9e extends Xl { +class PLe extends fc { constructor() { super(...arguments), this.title = "Tip", this.kind = "tip"; } } -class Y9e extends Xl { +class NLe extends fc { constructor() { super(...arguments), this.title = "Warning", this.kind = "warning"; } } -const W9e = { - admonition: N9e, - attention: I9e, - caution: $9e, - danger: B9e, - error: F9e, - important: z9e, - hint: Q9e, - note: U9e, - seealso: V9e, - tip: q9e, - warning: Y9e -}; -class G9e extends K0 { +const ILe = { + admonition: TLe, + attention: CLe, + caution: ELe, + danger: _Le, + error: ALe, + important: LLe, + hint: RLe, + note: MLe, + seealso: DLe, + tip: PLe, + warning: NLe +}; +class $Le extends vp { constructor() { super(...arguments), this.required_arguments = 0, this.optional_arguments = 1, this.final_argument_whitespace = !1, this.has_content = !0, this.option_spec = { - "number-lines": uie, - force: z8, - name: Cf, - class: o1 + "number-lines": Yie, + force: g9, + name: qf, + class: _1 }; } run(e) { @@ -28641,17 +28641,17 @@ class G9e extends K0 { })]; } } -class X9e extends K0 { +class BLe extends vp { constructor() { super(...arguments), this.required_arguments = 0, this.optional_arguments = 1, this.final_argument_whitespace = !1, this.has_content = !0, this.option_spec = { - linenos: z8, - "lineno-start": cie, - dedent: uie, - "emphasize-lines": F8, - caption: F8, - force: z8, - name: Cf, - class: o1 + linenos: g9, + "lineno-start": qie, + dedent: Yie, + "emphasize-lines": p9, + caption: p9, + force: g9, + name: qf, + class: _1 }; } run(e) { @@ -28662,7 +28662,7 @@ class X9e extends K0 { })]; } } -class H9e extends K0 { +class FLe extends vp { constructor() { super(...arguments), this.required_arguments = 0, this.optional_arguments = 1, this.final_argument_whitespace = !1, this.has_content = !0, this.rawOptions = !0; } @@ -28674,25 +28674,25 @@ class H9e extends K0 { })]; } } -const Z9e = { - code: G9e, - "code-block": X9e, - "code-cell": H9e -}, pie = { - alt: Cf, - height: die, - width: FD, - scale: M9e, - target: F8, - class: o1, - name: Cf -}; -class gie extends K0 { +const zLe = { + code: $Le, + "code-block": BLe, + "code-cell": FLe +}, Hie = { + alt: qf, + height: Xie, + width: pP, + scale: OLe, + target: p9, + class: _1, + name: qf +}; +class Zie extends vp { constructor() { - super(...arguments), this.required_arguments = 1, this.optional_arguments = 0, this.final_argument_whitespace = !0, this.option_spec = Object.assign(Object.assign({}, pie), { align: zD(["left", "center", "right", "top", "middle", "bottom"]) }); + super(...arguments), this.required_arguments = 1, this.optional_arguments = 0, this.final_argument_whitespace = !0, this.option_spec = Object.assign(Object.assign({}, Hie), { align: gP(["left", "center", "right", "top", "middle", "bottom"]) }); } create_image(e) { - const r = P9e(e.args[0] || ""), n = this.createToken("image", "img", 0, { map: e.map, block: !0 }); + const r = SLe(e.args[0] || ""), n = this.createToken("image", "img", 0, { map: e.map, block: !0 }); n.attrSet("src", r), n.attrSet("alt", e.options.alt || ""); const i = []; return e.options.alt && this.state.md.inline.parse(e.options.alt, this.state.md, this.state.env, i), n.children = i, e.options.height && n.attrSet("height", e.options.height), e.options.width && n.attrSet("width", e.options.width), e.options.align && n.attrJoin("class", `align-${e.options.align}`), e.options.class && n.attrJoin("class", e.options.class.join(" ")), n; @@ -28701,9 +28701,9 @@ class gie extends K0 { return [this.create_image(e)]; } } -class j9e extends gie { +class QLe extends Zie { constructor() { - super(...arguments), this.option_spec = Object.assign(Object.assign({}, pie), { align: zD(["left", "center", "right"]), figwidth: D9e, figclass: o1 }), this.has_content = !0; + super(...arguments), this.option_spec = Object.assign(Object.assign({}, Hie), { align: gP(["left", "center", "right"]), figwidth: kLe, figclass: _1 }), this.has_content = !0; } run(e) { const r = this.createToken("figure_open", "figure", 1, { @@ -28712,10 +28712,10 @@ class j9e extends gie { }); e.options.figclass && r.attrJoin("class", e.options.figclass.join(" ")), e.options.align && r.attrJoin("class", `align-${e.options.align}`), e.options.figwidth && e.options.figwidth !== "image" && r.attrSet("width", e.options.figwidth); let n; - e.options.name && (n = bne( + e.options.name && (n = eie( this.state, r, - b2.figure, + V2.figure, e.options.name, e.body.trim() ), r.attrJoin("class", "numbered")); @@ -28748,11 +28748,11 @@ class j9e extends gie { return [r, i, ...s, ...a, o]; } } -const K9e = { - image: gie, - figure: j9e +const ULe = { + image: Zie, + figure: QLe }; -class QD { +class mP { constructor(e, r = !0) { if (this.children = [], this.children = [], r) { this._set_children_from_tokens(e); @@ -28788,7 +28788,7 @@ class QD { } } _add_child(e) { - const r = new QD(e, !1); + const r = new mP(e, !1); r.parent = this, this.children.push(r); } to_tokens() { @@ -28874,23 +28874,23 @@ class QD { return this.attribute_token().attrs; } } -class J9e extends K0 { +class VLe extends vp { constructor() { super(...arguments), this.required_arguments = 0, this.optional_arguments = 1, this.final_argument_whitespace = !0, this.has_content = !0, this.option_spec = { - "header-rows": Mk, - "stub-columns": Mk, - width: FD, - widths: Cf, - class: o1, - name: Cf, - align: zD(["left", "center", "right"]) + "header-rows": s3, + "stub-columns": s3, + width: pP, + widths: qf, + class: _1, + name: qf, + align: gP(["left", "center", "right"]) }; } run(e) { this.assert_has_content(e); const r = e.options["header-rows"] || 0, n = this.nestedParse(e.body, e.bodyMap[0]); if (n.length < 2 || n[0].type !== "bullet_list_open" || n[n.length - 1].type !== "bullet_list_close") - throw new Wh("Content is not a single bullet list"); + throw new hf("Content is not a single bullet list"); const i = [], s = this.createToken("table_open", "table", 1, { map: e.bodyMap }); e.options.align && s.attrJoin("class", `align-${e.options.align}`), e.options.class && s.attrJoin("class", e.options.class.join(" ")), i.push(s), e.args.length && e.args[0] && (i.push(this.createToken("table_caption_open", "caption", 1)), i.push(this.createToken("inline", "", 0, { map: [e.map[0], e.map[0]], @@ -28900,7 +28900,7 @@ class J9e extends K0 { let a = "th"; r ? (i.push(this.createToken("thead_open", "thead", 1, { level: 1 })), a = "th") : (i.push(this.createToken("tbody_open", "tbody", 1, { level: 1 })), a = "td"); let o, l = 0; - for (const u of new QD(n.slice(1, -1)).children) { + for (const u of new mP(n.slice(1, -1)).children) { l += 1, this.assert(u.type === "list_item", `list item ${l} not of type 'list_item': ${u.type}`), this.assert(u.children.length === 1 && u.children[0].type === "bullet_list", `list item ${l} content not a nested bullet list`); const h = u.children[0].children; o === void 0 ? o = h.length : this.assert(h.length === o, `list item ${l} does not contain the same number of columns as previous items`), r && l === r + 1 && (i.push(this.createToken("thead_close", "thead", -1, { level: 1 })), i.push(this.createToken("tbody_open", "tbody", 1, { level: 1 })), a = "td"), i.push(this.createToken("tr_open", "tr", 1, { map: u.map, level: 2 })); @@ -28913,13 +28913,13 @@ class J9e extends K0 { return a === "td" ? i.push(this.createToken("tbody_close", "tbody", -1, { level: 1 })) : i.push(this.createToken("thead_close", "thead", -1, { level: 1 })), i.push(this.createToken("table_close", "table", -1)), i; } } -const eLe = { - "list-table": J9e +const qLe = { + "list-table": VLe }; -class tLe extends K0 { +class YLe extends vp { constructor() { super(...arguments), this.required_arguments = 0, this.optional_arguments = 0, this.final_argument_whitespace = !1, this.has_content = !0, this.option_spec = { - label: Cf + label: qf }; } run(e) { @@ -28931,18 +28931,18 @@ class tLe extends K0 { }); if (r.attrSet("class", "math block"), e.options.label) { r.attrSet("id", e.options.label); - const n = bne(this.state, r, b2.equation, e.options.label, ""); + const n = eie(this.state, r, V2.equation, e.options.label, ""); r.attrSet("number", `${n.number}`), r.info = e.options.label, r.meta = { label: e.options.label, numbered: !0, number: n.number }; } return [r]; } } -const rLe = { - math: tLe -}, nLe = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, W9e), K9e), Z9e), eLe), rLe); -function iLe(t) { +const WLe = { + math: YLe +}, GLe = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, ILe), ULe), zLe), qLe), WLe); +function XLe(t) { return (e) => { - const r = DT(e); + const r = aC(e); return r.references.forEach((n) => { const { label: i, tokens: s, contentFromTarget: a } = n, o = (u, h) => (s.open.attrJoin("class", "error"), s.open.tag = s.close.tag = "code", a && h ? s.content.content = a(h) : s.content.content = u, !0), l = r.targets[i]; if (!l) @@ -28958,35 +28958,35 @@ function iLe(t) { }), !0; }; } -function sLe(t, e) { - t.core.ruler.push("docutils_number", iLe()); +function HLe(t, e) { + t.core.ruler.push("docutils_number", XLe()); } -const aLe = { +const ZLe = { parseRoles: !0, replaceFences: !0, rolesAfter: "inline", directivesAfter: "block", - directives: nLe, - roles: i7e + directives: GLe, + roles: X7e }; -function oLe(t, e) { - const r = Object.assign(Object.assign({}, aLe), e); - t.use(yne, r), t.use(_9e, r), t.use(sLe, r); +function jLe(t, e) { + const r = Object.assign(Object.assign({}, ZLe), e); + t.use(Jne, r), t.use(yLe, r), t.use(HLe, r); } /*! @license DOMPurify 2.4.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.4.7/LICENSE */ -function $h(t) { - return $h = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) { +function tf(t) { + return tf = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) { return typeof e; } : function(e) { return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; - }, $h(t); + }, tf(t); } -function Q8(t, e) { - return Q8 = Object.setPrototypeOf || function(n, i) { +function m9(t, e) { + return m9 = Object.setPrototypeOf || function(n, i) { return n.__proto__ = i, n; - }, Q8(t, e); + }, m9(t, e); } -function lLe() { +function KLe() { if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1; if (typeof Proxy == "function") @@ -28998,117 +28998,117 @@ function lLe() { return !1; } } -function V4(t, e, r) { - return lLe() ? V4 = Reflect.construct : V4 = function(i, s, a) { +function m5(t, e, r) { + return KLe() ? m5 = Reflect.construct : m5 = function(i, s, a) { var o = [null]; o.push.apply(o, s); var l = Function.bind.apply(i, o), u = new l(); - return a && Q8(u, a.prototype), u; - }, V4.apply(null, arguments); + return a && m9(u, a.prototype), u; + }, m5.apply(null, arguments); } -function ul(t) { - return cLe(t) || uLe(t) || hLe(t) || fLe(); +function _l(t) { + return JLe(t) || eRe(t) || tRe(t) || rRe(); } -function cLe(t) { +function JLe(t) { if (Array.isArray(t)) - return U8(t); + return v9(t); } -function uLe(t) { +function eRe(t) { if (typeof Symbol < "u" && t[Symbol.iterator] != null || t["@@iterator"] != null) return Array.from(t); } -function hLe(t, e) { +function tRe(t, e) { if (!!t) { if (typeof t == "string") - return U8(t, e); + return v9(t, e); var r = Object.prototype.toString.call(t).slice(8, -1); if (r === "Object" && t.constructor && (r = t.constructor.name), r === "Map" || r === "Set") return Array.from(t); if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) - return U8(t, e); + return v9(t, e); } } -function U8(t, e) { +function v9(t, e) { (e == null || e > t.length) && (e = t.length); for (var r = 0, n = new Array(e); r < e; r++) n[r] = t[r]; return n; } -function fLe() { +function rRe() { throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`); } -var dLe = Object.hasOwnProperty, tU = Object.setPrototypeOf, pLe = Object.isFrozen, gLe = Object.getPrototypeOf, mLe = Object.getOwnPropertyDescriptor, ha = Object.freeze, Ql = Object.seal, vLe = Object.create, mie = typeof Reflect < "u" && Reflect, Dk = mie.apply, V8 = mie.construct; -Dk || (Dk = function(e, r, n) { +var nRe = Object.hasOwnProperty, IU = Object.setPrototypeOf, iRe = Object.isFrozen, sRe = Object.getPrototypeOf, aRe = Object.getOwnPropertyDescriptor, Aa = Object.freeze, sc = Object.seal, oRe = Object.create, jie = typeof Reflect < "u" && Reflect, a3 = jie.apply, y9 = jie.construct; +a3 || (a3 = function(e, r, n) { return e.apply(r, n); }); -ha || (ha = function(e) { +Aa || (Aa = function(e) { return e; }); -Ql || (Ql = function(e) { +sc || (sc = function(e) { return e; }); -V8 || (V8 = function(e, r) { - return V4(e, ul(r)); +y9 || (y9 = function(e, r) { + return m5(e, _l(r)); }); -var yLe = Xo(Array.prototype.forEach), rU = Xo(Array.prototype.pop), tv = Xo(Array.prototype.push), q4 = Xo(String.prototype.toLowerCase), I6 = Xo(String.prototype.toString), bLe = Xo(String.prototype.match), cl = Xo(String.prototype.replace), xLe = Xo(String.prototype.indexOf), wLe = Xo(String.prototype.trim), Ks = Xo(RegExp.prototype.test), $6 = OLe(TypeError); -function Xo(t) { +var lRe = hl(Array.prototype.forEach), $U = hl(Array.prototype.pop), Tv = hl(Array.prototype.push), v5 = hl(String.prototype.toLowerCase), h6 = hl(String.prototype.toString), cRe = hl(String.prototype.match), El = hl(String.prototype.replace), uRe = hl(String.prototype.indexOf), hRe = hl(String.prototype.trim), ga = hl(RegExp.prototype.test), f6 = fRe(TypeError); +function hl(t) { return function(e) { for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), i = 1; i < r; i++) n[i - 1] = arguments[i]; - return Dk(t, e, n); + return a3(t, e, n); }; } -function OLe(t) { +function fRe(t) { return function() { for (var e = arguments.length, r = new Array(e), n = 0; n < e; n++) r[n] = arguments[n]; - return V8(t, r); + return y9(t, r); }; } -function mr(t, e, r) { +function Ar(t, e, r) { var n; - r = (n = r) !== null && n !== void 0 ? n : q4, tU && tU(t, null); + r = (n = r) !== null && n !== void 0 ? n : v5, IU && IU(t, null); for (var i = e.length; i--; ) { var s = e[i]; if (typeof s == "string") { var a = r(s); - a !== s && (pLe(e) || (e[i] = a), s = a); + a !== s && (iRe(e) || (e[i] = a), s = a); } t[s] = !0; } return t; } -function cd(t) { - var e = vLe(null), r; +function _d(t) { + var e = oRe(null), r; for (r in t) - Dk(dLe, t, [r]) === !0 && (e[r] = t[r]); + a3(nRe, t, [r]) === !0 && (e[r] = t[r]); return e; } -function aO(t, e) { +function DO(t, e) { for (; t !== null; ) { - var r = mLe(t, e); + var r = aRe(t, e); if (r) { if (r.get) - return Xo(r.get); + return hl(r.get); if (typeof r.value == "function") - return Xo(r.value); + return hl(r.value); } - t = gLe(t); + t = sRe(t); } function n(i) { return console.warn("fallback value for", i), null; } return n; } -var nU = ha(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), B6 = ha(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), F6 = ha(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), kLe = ha(["animate", "color-profile", "cursor", "discard", "fedropshadow", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), z6 = ha(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover"]), SLe = ha(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), iU = ha(["#text"]), sU = ha(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "xmlns", "slot"]), Q6 = ha(["accent-height", "accumulate", "additive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), aU = ha(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), oO = ha(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), TLe = Ql(/\{\{[\w\W]*|[\w\W]*\}\}/gm), CLe = Ql(/<%[\w\W]*|[\w\W]*%>/gm), ELe = Ql(/\${[\w\W]*}/gm), _Le = Ql(/^data-[\-\w.\u00B7-\uFFFF]/), ALe = Ql(/^aria-[\-\w]+$/), LLe = Ql( +var BU = Aa(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), d6 = Aa(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), p6 = Aa(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), dRe = Aa(["animate", "color-profile", "cursor", "discard", "fedropshadow", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), g6 = Aa(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover"]), pRe = Aa(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), FU = Aa(["#text"]), zU = Aa(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "xmlns", "slot"]), m6 = Aa(["accent-height", "accumulate", "additive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), QU = Aa(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), PO = Aa(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), gRe = sc(/\{\{[\w\W]*|[\w\W]*\}\}/gm), mRe = sc(/<%[\w\W]*|[\w\W]*%>/gm), vRe = sc(/\${[\w\W]*}/gm), yRe = sc(/^data-[\-\w.\u00B7-\uFFFF]/), bRe = sc(/^aria-[\-\w]+$/), xRe = sc( /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i -), RLe = Ql(/^(?:\w+script|data):/i), MLe = Ql( +), wRe = sc(/^(?:\w+script|data):/i), ORe = sc( /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g -), DLe = Ql(/^html$/i), PLe = function() { +), kRe = sc(/^html$/i), SRe = function() { return typeof window > "u" ? null : window; -}, NLe = function(e, r) { - if ($h(e) !== "object" || typeof e.createPolicy != "function") +}, TRe = function(e, r) { + if (tf(e) !== "object" || typeof e.createPolicy != "function") return null; var n = null, i = "data-tt-policy-suffix"; r.currentScript && r.currentScript.hasAttribute(i) && (n = r.currentScript.getAttribute(i)); @@ -29126,25 +29126,25 @@ var nU = ha(["a", "abbr", "acronym", "address", "area", "article", "aside", "aud return console.warn("TrustedTypes policy " + s + " could not be created."), null; } }; -function vie() { - var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : PLe(), e = function(te) { - return vie(te); +function Kie() { + var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : SRe(), e = function(ne) { + return Kie(ne); }; if (e.version = "2.4.7", e.removed = [], !t || !t.document || t.document.nodeType !== 9) return e.isSupported = !1, e; - var r = t.document, n = t.document, i = t.DocumentFragment, s = t.HTMLTemplateElement, a = t.Node, o = t.Element, l = t.NodeFilter, u = t.NamedNodeMap, h = u === void 0 ? t.NamedNodeMap || t.MozNamedAttrMap : u, f = t.HTMLFormElement, d = t.DOMParser, p = t.trustedTypes, g = o.prototype, m = aO(g, "cloneNode"), v = aO(g, "nextSibling"), y = aO(g, "childNodes"), b = aO(g, "parentNode"); + var r = t.document, n = t.document, i = t.DocumentFragment, s = t.HTMLTemplateElement, a = t.Node, o = t.Element, l = t.NodeFilter, u = t.NamedNodeMap, h = u === void 0 ? t.NamedNodeMap || t.MozNamedAttrMap : u, f = t.HTMLFormElement, d = t.DOMParser, p = t.trustedTypes, g = o.prototype, m = DO(g, "cloneNode"), v = DO(g, "nextSibling"), y = DO(g, "childNodes"), b = DO(g, "parentNode"); if (typeof s == "function") { var w = n.createElement("template"); w.content && w.content.ownerDocument && (n = w.content.ownerDocument); } - var O = NLe(p, r), S = O ? O.createHTML("") : "", C = n, T = C.implementation, A = C.createNodeIterator, E = C.createDocumentFragment, R = C.getElementsByTagName, _ = r.importNode, L = {}; + var O = TRe(p, r), S = O ? O.createHTML("") : "", C = n, T = C.implementation, A = C.createNodeIterator, E = C.createDocumentFragment, R = C.getElementsByTagName, _ = r.importNode, L = {}; try { - L = cd(n).documentMode ? n.documentMode : {}; + L = _d(n).documentMode ? n.documentMode : {}; } catch { } var $ = {}; e.isSupported = typeof b == "function" && T && T.createHTMLDocument !== void 0 && L !== 9; - var k = TLe, N = CLe, M = ELe, D = _Le, P = ALe, I = RLe, F = MLe, B = LLe, Q = null, q = mr({}, [].concat(ul(nU), ul(B6), ul(F6), ul(z6), ul(iU))), W = null, J = mr({}, [].concat(ul(sU), ul(Q6), ul(aU), ul(oO))), Y = Object.seal(Object.create(null, { + var k = gRe, N = mRe, M = vRe, D = yRe, P = bRe, I = wRe, F = ORe, B = xRe, Q = null, q = Ar({}, [].concat(_l(BU), _l(d6), _l(p6), _l(g6), _l(FU))), W = null, ee = Ar({}, [].concat(_l(zU), _l(m6), _l(QU), _l(PO))), Y = Object.seal(Object.create(null, { tagNameCheck: { writable: !0, configurable: !1, @@ -29163,143 +29163,143 @@ function vie() { enumerable: !0, value: !1 } - })), ne = null, ie = null, U = !0, Z = !0, G = !1, j = !0, ae = !1, se = !1, K = !1, _e = !1, ce = !1, Ee = !1, Ae = !1, Ve = !0, Xe = !1, We = "user-content-", Pe = !0, he = !1, X = {}, oe = null, ve = mr({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]), re = null, ue = mr({}, ["audio", "video", "img", "source", "image", "track"]), fe = null, de = mr({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ge = "http://www.w3.org/1998/Math/MathML", xe = "http://www.w3.org/2000/svg", Se = "http://www.w3.org/1999/xhtml", Ce = Se, ke = !1, De = null, Te = mr({}, [ge, xe, Se], I6), Ze, Ne = ["application/xhtml+xml", "text/html"], Je = "text/html", Ke, ht = null, dt = n.createElement("form"), lt = function(te) { - return te instanceof RegExp || te instanceof Function; - }, Ge = function(te) { - ht && ht === te || ((!te || $h(te) !== "object") && (te = {}), te = cd(te), Ze = Ne.indexOf(te.PARSER_MEDIA_TYPE) === -1 ? Ze = Je : Ze = te.PARSER_MEDIA_TYPE, Ke = Ze === "application/xhtml+xml" ? I6 : q4, Q = "ALLOWED_TAGS" in te ? mr({}, te.ALLOWED_TAGS, Ke) : q, W = "ALLOWED_ATTR" in te ? mr({}, te.ALLOWED_ATTR, Ke) : J, De = "ALLOWED_NAMESPACES" in te ? mr({}, te.ALLOWED_NAMESPACES, I6) : Te, fe = "ADD_URI_SAFE_ATTR" in te ? mr( - cd(de), - te.ADD_URI_SAFE_ATTR, - Ke - ) : de, re = "ADD_DATA_URI_TAGS" in te ? mr( - cd(ue), - te.ADD_DATA_URI_TAGS, - Ke - ) : ue, oe = "FORBID_CONTENTS" in te ? mr({}, te.FORBID_CONTENTS, Ke) : ve, ne = "FORBID_TAGS" in te ? mr({}, te.FORBID_TAGS, Ke) : {}, ie = "FORBID_ATTR" in te ? mr({}, te.FORBID_ATTR, Ke) : {}, X = "USE_PROFILES" in te ? te.USE_PROFILES : !1, U = te.ALLOW_ARIA_ATTR !== !1, Z = te.ALLOW_DATA_ATTR !== !1, G = te.ALLOW_UNKNOWN_PROTOCOLS || !1, j = te.ALLOW_SELF_CLOSE_IN_ATTR !== !1, ae = te.SAFE_FOR_TEMPLATES || !1, se = te.WHOLE_DOCUMENT || !1, ce = te.RETURN_DOM || !1, Ee = te.RETURN_DOM_FRAGMENT || !1, Ae = te.RETURN_TRUSTED_TYPE || !1, _e = te.FORCE_BODY || !1, Ve = te.SANITIZE_DOM !== !1, Xe = te.SANITIZE_NAMED_PROPS || !1, Pe = te.KEEP_CONTENT !== !1, he = te.IN_PLACE || !1, B = te.ALLOWED_URI_REGEXP || B, Ce = te.NAMESPACE || Se, Y = te.CUSTOM_ELEMENT_HANDLING || {}, te.CUSTOM_ELEMENT_HANDLING && lt(te.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (Y.tagNameCheck = te.CUSTOM_ELEMENT_HANDLING.tagNameCheck), te.CUSTOM_ELEMENT_HANDLING && lt(te.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (Y.attributeNameCheck = te.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), te.CUSTOM_ELEMENT_HANDLING && typeof te.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (Y.allowCustomizedBuiltInElements = te.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), ae && (Z = !1), Ee && (ce = !0), X && (Q = mr({}, ul(iU)), W = [], X.html === !0 && (mr(Q, nU), mr(W, sU)), X.svg === !0 && (mr(Q, B6), mr(W, Q6), mr(W, oO)), X.svgFilters === !0 && (mr(Q, F6), mr(W, Q6), mr(W, oO)), X.mathMl === !0 && (mr(Q, z6), mr(W, aU), mr(W, oO))), te.ADD_TAGS && (Q === q && (Q = cd(Q)), mr(Q, te.ADD_TAGS, Ke)), te.ADD_ATTR && (W === J && (W = cd(W)), mr(W, te.ADD_ATTR, Ke)), te.ADD_URI_SAFE_ATTR && mr(fe, te.ADD_URI_SAFE_ATTR, Ke), te.FORBID_CONTENTS && (oe === ve && (oe = cd(oe)), mr(oe, te.FORBID_CONTENTS, Ke)), Pe && (Q["#text"] = !0), se && mr(Q, ["html", "head", "body"]), Q.table && (mr(Q, ["tbody"]), delete ne.tbody), ha && ha(te), ht = te); - }, Ye = mr({}, ["mi", "mo", "mn", "ms", "mtext"]), gt = mr({}, ["foreignobject", "desc", "title", "annotation-xml"]), rt = mr({}, ["title", "style", "font", "a", "script"]), He = mr({}, B6); - mr(He, F6), mr(He, kLe); - var St = mr({}, z6); - mr(St, SLe); - var at = function(te) { - var Re = b(te); - (!Re || !Re.tagName) && (Re = { - namespaceURI: Ce, + })), re = null, se = null, U = !0, Z = !0, G = !1, K = !0, oe = !1, ae = !1, J = !1, Me = !1, he = !1, _e = !1, De = !1, He = !0, nt = !1, Ge = "user-content-", Ie = !0, de = !1, X = {}, le = null, ye = Ar({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]), ie = null, fe = Ar({}, ["audio", "video", "img", "source", "image", "track"]), pe = null, ge = Ar({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ve = "http://www.w3.org/1998/Math/MathML", we = "http://www.w3.org/2000/svg", Ee = "http://www.w3.org/1999/xhtml", Re = Ee, Ce = !1, $e = null, Le = Ar({}, [ve, we, Ee], h6), tt, Fe = ["application/xhtml+xml", "text/html"], ot = "text/html", at, bt = null, xt = n.createElement("form"), gt = function(ne) { + return ne instanceof RegExp || ne instanceof Function; + }, et = function(ne) { + bt && bt === ne || ((!ne || tf(ne) !== "object") && (ne = {}), ne = _d(ne), tt = Fe.indexOf(ne.PARSER_MEDIA_TYPE) === -1 ? tt = ot : tt = ne.PARSER_MEDIA_TYPE, at = tt === "application/xhtml+xml" ? h6 : v5, Q = "ALLOWED_TAGS" in ne ? Ar({}, ne.ALLOWED_TAGS, at) : q, W = "ALLOWED_ATTR" in ne ? Ar({}, ne.ALLOWED_ATTR, at) : ee, $e = "ALLOWED_NAMESPACES" in ne ? Ar({}, ne.ALLOWED_NAMESPACES, h6) : Le, pe = "ADD_URI_SAFE_ATTR" in ne ? Ar( + _d(ge), + ne.ADD_URI_SAFE_ATTR, + at + ) : ge, ie = "ADD_DATA_URI_TAGS" in ne ? Ar( + _d(fe), + ne.ADD_DATA_URI_TAGS, + at + ) : fe, le = "FORBID_CONTENTS" in ne ? Ar({}, ne.FORBID_CONTENTS, at) : ye, re = "FORBID_TAGS" in ne ? Ar({}, ne.FORBID_TAGS, at) : {}, se = "FORBID_ATTR" in ne ? Ar({}, ne.FORBID_ATTR, at) : {}, X = "USE_PROFILES" in ne ? ne.USE_PROFILES : !1, U = ne.ALLOW_ARIA_ATTR !== !1, Z = ne.ALLOW_DATA_ATTR !== !1, G = ne.ALLOW_UNKNOWN_PROTOCOLS || !1, K = ne.ALLOW_SELF_CLOSE_IN_ATTR !== !1, oe = ne.SAFE_FOR_TEMPLATES || !1, ae = ne.WHOLE_DOCUMENT || !1, he = ne.RETURN_DOM || !1, _e = ne.RETURN_DOM_FRAGMENT || !1, De = ne.RETURN_TRUSTED_TYPE || !1, Me = ne.FORCE_BODY || !1, He = ne.SANITIZE_DOM !== !1, nt = ne.SANITIZE_NAMED_PROPS || !1, Ie = ne.KEEP_CONTENT !== !1, de = ne.IN_PLACE || !1, B = ne.ALLOWED_URI_REGEXP || B, Re = ne.NAMESPACE || Ee, Y = ne.CUSTOM_ELEMENT_HANDLING || {}, ne.CUSTOM_ELEMENT_HANDLING && gt(ne.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (Y.tagNameCheck = ne.CUSTOM_ELEMENT_HANDLING.tagNameCheck), ne.CUSTOM_ELEMENT_HANDLING && gt(ne.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (Y.attributeNameCheck = ne.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), ne.CUSTOM_ELEMENT_HANDLING && typeof ne.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (Y.allowCustomizedBuiltInElements = ne.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), oe && (Z = !1), _e && (he = !0), X && (Q = Ar({}, _l(FU)), W = [], X.html === !0 && (Ar(Q, BU), Ar(W, zU)), X.svg === !0 && (Ar(Q, d6), Ar(W, m6), Ar(W, PO)), X.svgFilters === !0 && (Ar(Q, p6), Ar(W, m6), Ar(W, PO)), X.mathMl === !0 && (Ar(Q, g6), Ar(W, QU), Ar(W, PO))), ne.ADD_TAGS && (Q === q && (Q = _d(Q)), Ar(Q, ne.ADD_TAGS, at)), ne.ADD_ATTR && (W === ee && (W = _d(W)), Ar(W, ne.ADD_ATTR, at)), ne.ADD_URI_SAFE_ATTR && Ar(pe, ne.ADD_URI_SAFE_ATTR, at), ne.FORBID_CONTENTS && (le === ye && (le = _d(le)), Ar(le, ne.FORBID_CONTENTS, at)), Ie && (Q["#text"] = !0), ae && Ar(Q, ["html", "head", "body"]), Q.table && (Ar(Q, ["tbody"]), delete re.tbody), Aa && Aa(ne), bt = ne); + }, Ke = Ar({}, ["mi", "mo", "mn", "ms", "mtext"]), wt = Ar({}, ["foreignobject", "desc", "title", "annotation-xml"]), ct = Ar({}, ["title", "style", "font", "a", "script"]), it = Ar({}, d6); + Ar(it, p6), Ar(it, dRe); + var At = Ar({}, g6); + Ar(At, pRe); + var ft = function(ne) { + var Pe = b(ne); + (!Pe || !Pe.tagName) && (Pe = { + namespaceURI: Re, tagName: "template" }); - var Qe = q4(te.tagName), Rt = q4(Re.tagName); - return De[te.namespaceURI] ? te.namespaceURI === xe ? Re.namespaceURI === Se ? Qe === "svg" : Re.namespaceURI === ge ? Qe === "svg" && (Rt === "annotation-xml" || Ye[Rt]) : Boolean(He[Qe]) : te.namespaceURI === ge ? Re.namespaceURI === Se ? Qe === "math" : Re.namespaceURI === xe ? Qe === "math" && gt[Rt] : Boolean(St[Qe]) : te.namespaceURI === Se ? Re.namespaceURI === xe && !gt[Rt] || Re.namespaceURI === ge && !Ye[Rt] ? !1 : !St[Qe] && (rt[Qe] || !He[Qe]) : !!(Ze === "application/xhtml+xml" && De[te.namespaceURI]) : !1; - }, je = function(te) { - tv(e.removed, { - element: te + var Xe = v5(ne.tagName), Ft = v5(Pe.tagName); + return $e[ne.namespaceURI] ? ne.namespaceURI === we ? Pe.namespaceURI === Ee ? Xe === "svg" : Pe.namespaceURI === ve ? Xe === "svg" && (Ft === "annotation-xml" || Ke[Ft]) : Boolean(it[Xe]) : ne.namespaceURI === ve ? Pe.namespaceURI === Ee ? Xe === "math" : Pe.namespaceURI === we ? Xe === "math" && wt[Ft] : Boolean(At[Xe]) : ne.namespaceURI === Ee ? Pe.namespaceURI === we && !wt[Ft] || Pe.namespaceURI === ve && !Ke[Ft] ? !1 : !At[Xe] && (ct[Xe] || !it[Xe]) : !!(tt === "application/xhtml+xml" && $e[ne.namespaceURI]) : !1; + }, st = function(ne) { + Tv(e.removed, { + element: ne }); try { - te.parentNode.removeChild(te); + ne.parentNode.removeChild(ne); } catch { try { - te.outerHTML = S; + ne.outerHTML = S; } catch { - te.remove(); + ne.remove(); } } - }, pt = function(te, Re) { + }, yt = function(ne, Pe) { try { - tv(e.removed, { - attribute: Re.getAttributeNode(te), - from: Re + Tv(e.removed, { + attribute: Pe.getAttributeNode(ne), + from: Pe }); } catch { - tv(e.removed, { + Tv(e.removed, { attribute: null, - from: Re + from: Pe }); } - if (Re.removeAttribute(te), te === "is" && !W[te]) - if (ce || Ee) + if (Pe.removeAttribute(ne), ne === "is" && !W[ne]) + if (he || _e) try { - je(Re); + st(Pe); } catch { } else try { - Re.setAttribute(te, ""); + Pe.setAttribute(ne, ""); } catch { } - }, zt = function(te) { - var Re, Qe; - if (_e) - te = "" + te; + }, Yt = function(ne) { + var Pe, Xe; + if (Me) + ne = "" + ne; else { - var Rt = bLe(te, /^[\r\n\t ]+/); - Qe = Rt && Rt[0]; + var Ft = cRe(ne, /^[\r\n\t ]+/); + Xe = Ft && Ft[0]; } - Ze === "application/xhtml+xml" && Ce === Se && (te = '' + te + ""); - var cr = O ? O.createHTML(te) : te; - if (Ce === Se) + tt === "application/xhtml+xml" && Re === Ee && (ne = '' + ne + ""); + var br = O ? O.createHTML(ne) : ne; + if (Re === Ee) try { - Re = new d().parseFromString(cr, Ze); + Pe = new d().parseFromString(br, tt); } catch { } - if (!Re || !Re.documentElement) { - Re = T.createDocument(Ce, "template", null); + if (!Pe || !Pe.documentElement) { + Pe = T.createDocument(Re, "template", null); try { - Re.documentElement.innerHTML = ke ? S : cr; + Pe.documentElement.innerHTML = Ce ? S : br; } catch { } } - var er = Re.body || Re.documentElement; - return te && Qe && er.insertBefore(n.createTextNode(Qe), er.childNodes[0] || null), Ce === Se ? R.call(Re, se ? "html" : "body")[0] : se ? Re.documentElement : er; - }, yr = function(te) { + var lr = Pe.body || Pe.documentElement; + return ne && Xe && lr.insertBefore(n.createTextNode(Xe), lr.childNodes[0] || null), Re === Ee ? R.call(Pe, ae ? "html" : "body")[0] : ae ? Pe.documentElement : lr; + }, wr = function(ne) { return A.call( - te.ownerDocument || te, - te, + ne.ownerDocument || ne, + ne, l.SHOW_ELEMENT | l.SHOW_COMMENT | l.SHOW_TEXT, null, !1 ); - }, Yt = function(te) { - return te instanceof f && (typeof te.nodeName != "string" || typeof te.textContent != "string" || typeof te.removeChild != "function" || !(te.attributes instanceof h) || typeof te.removeAttribute != "function" || typeof te.setAttribute != "function" || typeof te.namespaceURI != "string" || typeof te.insertBefore != "function" || typeof te.hasChildNodes != "function"); - }, wr = function(te) { - return $h(a) === "object" ? te instanceof a : te && $h(te) === "object" && typeof te.nodeType == "number" && typeof te.nodeName == "string"; - }, tr = function(te, Re, Qe) { - !$[te] || yLe($[te], function(Rt) { - Rt.call(e, Re, Qe, ht); + }, Bt = function(ne) { + return ne instanceof f && (typeof ne.nodeName != "string" || typeof ne.textContent != "string" || typeof ne.removeChild != "function" || !(ne.attributes instanceof h) || typeof ne.removeAttribute != "function" || typeof ne.setAttribute != "function" || typeof ne.namespaceURI != "string" || typeof ne.insertBefore != "function" || typeof ne.hasChildNodes != "function"); + }, Er = function(ne) { + return tf(a) === "object" ? ne instanceof a : ne && tf(ne) === "object" && typeof ne.nodeType == "number" && typeof ne.nodeName == "string"; + }, ir = function(ne, Pe, Xe) { + !$[ne] || lRe($[ne], function(Ft) { + Ft.call(e, Pe, Xe, bt); }); - }, kn = function(te) { - var Re; - if (tr("beforeSanitizeElements", te, null), Yt(te) || Ks(/[\u0080-\uFFFF]/, te.nodeName)) - return je(te), !0; - var Qe = Ke(te.nodeName); - if (tr("uponSanitizeElement", te, { - tagName: Qe, + }, Zr = function(ne) { + var Pe; + if (ir("beforeSanitizeElements", ne, null), Bt(ne) || ga(/[\u0080-\uFFFF]/, ne.nodeName)) + return st(ne), !0; + var Xe = at(ne.nodeName); + if (ir("uponSanitizeElement", ne, { + tagName: Xe, allowedTags: Q - }), te.hasChildNodes() && !wr(te.firstElementChild) && (!wr(te.content) || !wr(te.content.firstElementChild)) && Ks(/<[/\w]/g, te.innerHTML) && Ks(/<[/\w]/g, te.textContent) || Qe === "select" && Ks(/