From a087be1ad313190aea11a0345d992dd242bcb5fc Mon Sep 17 00:00:00 2001 From: antmicrobot Date: Thu, 20 Feb 2025 10:11:40 +0000 Subject: [PATCH] deploy: 4be69769a5dd3d75ce4b6504eb765a3a9cf7f6a6 --- MystEditor.css | 2 +- MystEditor.js | 60089 +++++++++++++++++++------------------- docs/collaboration.html | 4 +- docs/comments.html | 4 +- docs/genindex.html | 4 +- docs/index.html | 4 +- docs/introduction.html | 4 +- docs/mermaid.html | 4 +- docs/rich-links.html | 4 +- docs/settings.html | 4 +- docs/topbar.html | 4 +- 11 files changed, 30103 insertions(+), 30024 deletions(-) diff --git a/MystEditor.css b/MystEditor.css index f9ff9c2..44b27d7 100644 --- a/MystEditor.css +++ b/MystEditor.css @@ -1 +1 @@ -:root{--border-radius: 5px;--black: #000;--gray-900: #333;--gray-800: #5c5c5c;--gray-700: #88818c;--gray-600: #cccccc;--gray-500: #dadada;--gray-400: #e5e5e5;--gray-300: #e8e6e8;--gray-200: #f8f8f8;--gray-100: #f9f9f9;--white: #fff;--blue-500: #0083e1;--blue-200: #82cfe6;--blue-100: #c1e4ef;--red-500: #e74a3c;--orange-500: #f59e0b;--green-500: #00af91;--green-400: #00ccaa;--border-2: 3px;--dark-violet: #332d37;--navbar-bg: var(--gray-200);--icon-border: var(--gray-600);--icon-bg: var(--white);--icon-main-selected: var(--blue-100);--icon-main-active: var(--blue-200);--icon-selected: var(--gray-400);--icon-color: var(--dark-violet);--separator: var(--gray-500);--alert: var(--blue-100)}@media print{@page{margin:1.5cm!important}}#myst-css-namespace{font-family:Lato,sans-serif;height:100%}#myst-css-namespace .todo{background-color:#ff0}@font-face{font-family:Lato;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/lato/v24/S6uyw4BMUTPHjxAwXjeu.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Lato;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/lato/v24/S6uyw4BMUTPHjx4wXg.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD} +@font-face{font-family:Lato;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/lato/v24/S6uyw4BMUTPHjxAwXjeu.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Lato;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/lato/v24/S6uyw4BMUTPHjx4wXg.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD} diff --git a/MystEditor.js b/MystEditor.js index 8c8723a..2472eb7 100644 --- a/MystEditor.js +++ b/MystEditor.js @@ -1,56 +1,56 @@ -var x3e = Object.defineProperty; -var w3e = (t, e, r) => e in t ? x3e(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r; -var zt = (t, e, r) => (w3e(t, typeof e != "symbol" ? e + "" : e, r), r), O3e = (t, e, r) => { +var l5e = Object.defineProperty; +var c5e = (t, e, r) => e in t ? l5e(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r; +var zt = (t, e, r) => (c5e(t, typeof e != "symbol" ? e + "" : e, r), r), u5e = (t, e, r) => { if (!e.has(t)) throw TypeError("Cannot " + r); }; -var z4 = (t, e, r) => { +var $4 = (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 $2 = (t, e, r) => (O3e(t, e, "access private method"), r); -var yk, cr, iie, sie, S0, KQ, aie, cM, oie, $x = {}, lie = [], k3e = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, I_ = Array.isArray; -function cf(t, e) { +var D2 = (t, e, r) => (u5e(t, e, "access private method"), r); +var gk, cr, Xne, jne, x0, FQ, Zne, iM, Kne, Nx = {}, Jne = [], h5e = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, M_ = Array.isArray; +function lf(t, e) { for (var r in e) t[r] = e[r]; return t; } -function cie(t) { +function eie(t) { var e = t.parentNode; e && e.removeChild(t); } -function ph(t, e, r) { +function hh(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 ? yk.call(arguments, 2) : r), typeof t == "function" && t.defaultProps != null) + if (arguments.length > 2 && (a.children = arguments.length > 3 ? gk.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 nx(t, a, n, i, null); + return tx(t, a, n, i, null); } -function nx(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 ? ++iie : i, __i: -1, __u: 0 }; +function tx(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 ? ++Xne : i, __i: -1, __u: 0 }; return i == null && cr.vnode != null && cr.vnode(s), s; } -function S3e() { +function f5e() { return { current: null }; } -function gh(t) { +function fh(t) { return t.children; } -function Hc(t, e) { +function Wc(t, e) { this.props = t, this.context = e; } -function av(t, e) { +function rv(t, e) { if (e == null) - return t.__ ? av(t.__, t.__i + 1) : null; + return t.__ ? rv(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" ? av(t) : null; + return typeof t.type == "function" ? rv(t) : null; } -function uie(t) { +function tie(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 uie(t) { t.__e = t.__c.base = r.__e; break; } - return uie(t); + return tie(t); } } -function uM(t) { - (!t.__d && (t.__d = !0) && S0.push(t) && !iT.__r++ || KQ !== cr.debounceRendering) && ((KQ = cr.debounceRendering) || aie)(iT); +function sM(t) { + (!t.__d && (t.__d = !0) && x0.push(t) && !rT.__r++ || FQ !== cr.debounceRendering) && ((FQ = cr.debounceRendering) || Zne)(rT); } -function iT() { +function rT() { var t, e, r, n, i, s, a, o, l; - for (S0.sort(cM); t = S0.shift(); ) - t.__d && (e = S0.length, n = void 0, s = (i = (r = t).__v).__e, o = [], l = [], (a = r.__P) && ((n = cf({}, i)).__v = i.__v + 1, cr.vnode && cr.vnode(n), w$(a, n, i, r.__n, a.ownerSVGElement !== void 0, 32 & i.__u ? [s] : null, o, s == null ? av(i) : s, !!(32 & i.__u), l), n.__.__k[n.__i] = n, die(o, n, l), n.__e != s && uie(n)), S0.length > e && S0.sort(cM)); - iT.__r = 0; -} -function hie(t, e, r, n, i, s, a, o, l, u, h) { - var f, d, p, g, m, v = n && n.__k || lie, y = e.length; - for (r.__d = l, T3e(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 ? $x : v[p.__i] || $x, p.__i = f, w$(t, p, d, i, s, a, o, l, u, h), g = p.__e, p.ref && d.ref != p.ref && (d.ref && O$(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 = fie(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 (x0.sort(iM); t = x0.shift(); ) + t.__d && (e = x0.length, n = void 0, s = (i = (r = t).__v).__e, o = [], l = [], (a = r.__P) && ((n = lf({}, i)).__v = i.__v + 1, cr.vnode && cr.vnode(n), c$(a, n, i, r.__n, a.ownerSVGElement !== void 0, 32 & i.__u ? [s] : null, o, s == null ? rv(i) : s, !!(32 & i.__u), l), n.__.__k[n.__i] = n, iie(o, n, l), n.__e != s && tie(n)), x0.length > e && x0.sort(iM)); + rT.__r = 0; +} +function rie(t, e, r, n, i, s, a, o, l, u, h) { + var f, d, p, g, m, v = n && n.__k || Jne, y = e.length; + for (r.__d = l, d5e(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 ? Nx : v[p.__i] || Nx, p.__i = f, c$(t, p, d, i, s, a, o, l, u, h), g = p.__e, p.ref && d.ref != p.ref && (d.ref && u$(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 = nie(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 T3e(t, e, r) { +function d5e(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 ? nx(null, i, null, null, i) : I_(i) ? nx(gh, { children: i }, null, null, null) : i.constructor === void 0 && i.__b > 0 ? nx(i.type, i.props, i.key, i.ref ? i.ref : null, i.__v) : i) != null ? (i.__ = t, i.__b = t.__b + 1, o = C3e(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 = av(s)), hM(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 ? tx(null, i, null, null, i) : M_(i) ? tx(fh, { children: i }, null, null, null) : i.constructor === void 0 && i.__b > 0 ? tx(i.type, i.props, i.key, i.ref ? i.ref : null, i.__v) : i) != null ? (i.__ = t, i.__b = t.__b + 1, o = p5e(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 = rv(s)), aM(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 = av(s)), hM(s, s)); + (s = r[n]) != null && (131072 & s.__u) == 0 && (s.__e == t.__d && (t.__d = rv(s)), aM(s, s)); } -function fie(t, e, r) { +function nie(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 = fie(n[i], e, r)); + n[i] && (n[i].__ = t, e = nie(n[i], e, r)); return e; } return t.__e != e && (r.insertBefore(t.__e, e || null), e = t.__e), e && e.nextSibling; } -function mf(t, e) { - return e = e || [], t == null || typeof t == "boolean" || (I_(t) ? t.some(function(r) { - mf(r, e); +function gf(t, e) { + return e = e || [], t == null || typeof t == "boolean" || (M_(t) ? t.some(function(r) { + gf(r, e); }) : e.push(t)), e; } -function C3e(t, e, r, n) { +function p5e(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 C3e(t, e, r, n) { } return -1; } -function JQ(t, e, r) { - e[0] === "-" ? t.setProperty(e, r == null ? "" : r) : t[e] = r == null ? "" : typeof r != "number" || k3e.test(e) ? r : r + "px"; +function zQ(t, e, r) { + e[0] === "-" ? t.setProperty(e, r == null ? "" : r) : t[e] = r == null ? "" : typeof r != "number" || h5e.test(e) ? r : r + "px"; } -function q4(t, e, r, n, i) { +function B4(t, e, r, n, i) { var s; e: if (e === "style") @@ -129,13 +129,13 @@ function q4(t, e, r, n, i) { else { if (typeof n == "string" && (t.style.cssText = n = ""), n) for (e in n) - r && e in r || JQ(t.style, e, ""); + r && e in r || zQ(t.style, e, ""); if (r) for (e in r) - n && r[e] === n[e] || JQ(t.style, e, r[e]); + n && r[e] === n[e] || zQ(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 ? tV : eV, s)) : t.removeEventListener(e, s ? tV : eV, 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 ? UQ : qQ, s)) : t.removeEventListener(e, s ? UQ : qQ, s); else { if (i) e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s"); @@ -148,7 +148,7 @@ function q4(t, e, r, n, i) { typeof r == "function" || (r == null || r === !1 && e[4] !== "-" ? t.removeAttribute(e) : t.setAttribute(e, r)); } } -function eV(t) { +function qQ(t) { var e = this.l[t.type + !1]; if (t.t) { if (t.t <= e.u) @@ -157,23 +157,23 @@ function eV(t) { t.t = Date.now(); return e(cr.event ? cr.event(t) : t); } -function tV(t) { +function UQ(t) { return this.l[t.type + !0](cr.event ? cr.event(t) : t); } -function w$(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, L, E = e.type; +function c$(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, D, E = e.type; if (e.constructor !== void 0) return null; 128 & r.__u && (l = !!(32 & r.__u), s = [o = e.__e = r.__e]), (h = cr.__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 Hc(y, w), f.constructor = E, f.render = _3e), 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 = cf({}, f.__s)), cf(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 Wc(y, w), f.constructor = E, f.render = m5e), 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 = lf({}, f.__s)), lf(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)) { - for (e.__v !== r.__v && (f.props = y, f.state = f.__s, f.__d = !1), e.__e = r.__e, e.__k = r.__k, e.__k.forEach(function(P) { - P && (P.__ = e); + for (e.__v !== r.__v && (f.props = y, f.state = f.__s, f.__d = !1), e.__e = r.__e, e.__k = r.__k, e.__k.forEach(function(N) { + N && (N.__ = e); }), O = 0; O < f._sb.length; O++) f.__h.push(f._sb[O]); f._sb = [], f.__h.length && a.push(f); @@ -191,18 +191,18 @@ function w$(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 = cf(cf({}, n), f.getChildContext())), d || f.getSnapshotBeforeUpdate == null || (m = f.getSnapshotBeforeUpdate(p, g)), hie(t, I_(L = h != null && h.type === gh && h.key == null ? h.props.children : h) ? L : [L], 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 (P) { - 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), cr.__e(P, e, r); + f.state = f.__s, f.getChildContext != null && (n = lf(lf({}, n), f.getChildContext())), d || f.getSnapshotBeforeUpdate == null || (m = f.getSnapshotBeforeUpdate(p, g)), rie(t, M_(D = h != null && h.type === fh && h.key == null ? h.props.children : h) ? D : [D], 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 (N) { + 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), cr.__e(N, e, r); } else - s == null && e.__v === r.__v ? (e.__k = r.__k, e.__e = r.__e) : e.__e = E3e(r.__e, e, r, n, i, s, a, l, u); + s == null && e.__v === r.__v ? (e.__k = r.__k, e.__e = r.__e) : e.__e = g5e(r.__e, e, r, n, i, s, a, l, u); (h = cr.diffed) && h(e); } -function die(t, e, r) { +function iie(t, e, r) { e.__d = void 0; for (var n = 0; n < r.length; n++) - O$(r[n], r[++n], r[++n]); + u$(r[n], r[++n], r[++n]); cr.__c && cr.__c(e, t), t.some(function(i) { try { t = i.__h, i.__h = [], t.some(function(s) { @@ -213,7 +213,7 @@ function die(t, e, r) { } }); } -function E3e(t, e, r, n, i, s, a, o, l) { +function g5e(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,32 +230,32 @@ function E3e(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 && yk.call(t.childNodes), v = r.props || $x, !o && s != null) + if (s = s && gk.call(t.childNodes), v = r.props || Nx, !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 || q4(t, u, null, p, i)); + p = v[u], u == "children" || (u == "dangerouslySetInnerHTML" ? f = p : u === "key" || u in y || B4(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 || q4(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 || B4(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 = ""), hie(t, I_(d) ? d : [d], e, r, n, i && b !== "foreignObject", s, a, s ? s[0] : r.__k && av(r, 0), o, l), s != null) + else if (f && (t.innerHTML = ""), rie(t, M_(d) ? d : [d], e, r, n, i && b !== "foreignObject", s, a, s ? s[0] : r.__k && rv(r, 0), o, l), s != null) for (u = s.length; u--; ) - s[u] != null && cie(s[u]); - o || (u = "value", g !== void 0 && (g !== t[u] || b === "progress" && !g || b === "option" && g !== v[u]) && q4(t, u, g, v[u], !1), u = "checked", m !== void 0 && m !== t[u] && q4(t, u, m, v[u], !1)); + s[u] != null && eie(s[u]); + o || (u = "value", g !== void 0 && (g !== t[u] || b === "progress" && !g || b === "option" && g !== v[u]) && B4(t, u, g, v[u], !1), u = "checked", m !== void 0 && m !== t[u] && B4(t, u, m, v[u], !1)); } return t; } -function O$(t, e, r) { +function u$(t, e, r) { try { typeof t == "function" ? t(e) : t.current = e; } catch (n) { cr.__e(n, r); } } -function hM(t, e, r) { +function aM(t, e, r) { var n, i; - if (cr.unmount && cr.unmount(t), (n = t.ref) && (n.current && n.current !== t.__e || O$(n, null, e)), (n = t.__c) != null) { + if (cr.unmount && cr.unmount(t), (n = t.ref) && (n.current && n.current !== t.__e || u$(n, null, e)), (n = t.__c) != null) { if (n.componentWillUnmount) try { n.componentWillUnmount(); @@ -266,27 +266,27 @@ function hM(t, e, r) { } if (n = t.__k) for (i = 0; i < n.length; i++) - n[i] && hM(n[i], e, r || typeof t.type != "function"); - r || t.__e == null || cie(t.__e), t.__ = t.__e = t.__d = void 0; + n[i] && aM(n[i], e, r || typeof t.type != "function"); + r || t.__e == null || eie(t.__e), t.__ = t.__e = t.__d = void 0; } -function _3e(t, e, r) { +function m5e(t, e, r) { return this.constructor(t, r); } -function Cf(t, e, r) { +function Sf(t, e, r) { var n, i, s, a; - cr.__ && cr.__(t, e), i = (n = typeof r == "function") ? null : r && r.__k || e.__k, s = [], a = [], w$(e, t = (!n && r || e).__k = ph(gh, null, [t]), i || $x, $x, e.ownerSVGElement !== void 0, !n && r ? [r] : i ? null : e.firstChild ? yk.call(e.childNodes) : null, s, !n && r ? r : i ? i.__e : e.firstChild, n, a), die(s, t, a); + cr.__ && cr.__(t, e), i = (n = typeof r == "function") ? null : r && r.__k || e.__k, s = [], a = [], c$(e, t = (!n && r || e).__k = hh(fh, null, [t]), i || Nx, Nx, e.ownerSVGElement !== void 0, !n && r ? [r] : i ? null : e.firstChild ? gk.call(e.childNodes) : null, s, !n && r ? r : i ? i.__e : e.firstChild, n, a), iie(s, t, a); } -function pie(t, e) { - Cf(t, e, pie); +function sie(t, e) { + Sf(t, e, sie); } -function A3e(t, e, r) { - var n, i, s, a, o = cf({}, t.props); +function v5e(t, e, r) { + var n, i, s, a, o = lf({}, 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 ? yk.call(arguments, 2) : r), nx(t.type, o, n || t.key, i || t.ref, null); + return arguments.length > 2 && (o.children = arguments.length > 3 ? gk.call(arguments, 2) : r), tx(t.type, o, n || t.key, i || t.ref, null); } -function gie(t, e) { - var r = { __c: e = "__cC" + oie++, __: t, Consumer: function(n, i) { +function aie(t, e) { + var r = { __c: e = "__cC" + Kne++, __: t, Consumer: function(n, i) { return n.children(i); }, Provider: function(n) { var i, s; @@ -294,7 +294,7 @@ function gie(t, e) { return s; }, this.shouldComponentUpdate = function(a) { this.props.value !== a.value && i.some(function(o) { - o.__e = !0, uM(o); + o.__e = !0, sM(o); }); }, this.sub = function(a) { i.push(a); @@ -306,7 +306,7 @@ function gie(t, e) { } }; return r.Provider.__ = r.Consumer.contextType = r; } -yk = lie.slice, cr = { __e: function(t, e, r, n) { +gk = Jne.slice, cr = { __e: function(t, e, r, n) { for (var i, s, a; e = e.__; ) if ((i = e.__c) && !i.__) try { @@ -316,28 +316,28 @@ yk = lie.slice, cr = { __e: function(t, e, r, n) { t = o; } throw t; -} }, iie = 0, sie = function(t) { +} }, Xne = 0, jne = function(t) { return t != null && t.constructor == null; -}, Hc.prototype.setState = function(t, e) { +}, Wc.prototype.setState = function(t, e) { var r; - r = this.__s != null && this.__s !== this.state ? this.__s : this.__s = cf({}, this.state), typeof t == "function" && (t = t(cf({}, r), this.props)), t && cf(r, t), t != null && this.__v && (e && this._sb.push(e), uM(this)); -}, Hc.prototype.forceUpdate = function(t) { - this.__v && (this.__e = !0, t && this.__h.push(t), uM(this)); -}, Hc.prototype.render = gh, S0 = [], aie = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, cM = function(t, e) { + r = this.__s != null && this.__s !== this.state ? this.__s : this.__s = lf({}, this.state), typeof t == "function" && (t = t(lf({}, r), this.props)), t && lf(r, t), t != null && this.__v && (e && this._sb.push(e), sM(this)); +}, Wc.prototype.forceUpdate = function(t) { + this.__v && (this.__e = !0, t && this.__h.push(t), sM(this)); +}, Wc.prototype.render = fh, x0 = [], Zne = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, iM = function(t, e) { return t.__v.__b - e.__v.__b; -}, iT.__r = 0, oie = 0; -var cp, ri, q7, rV, ov = 0, mie = [], I3 = [], nV = cr.__b, iV = cr.__r, sV = cr.diffed, aV = cr.__c, oV = cr.unmount; -function Py(t, e) { - cr.__h && cr.__h(ri, t, ov || e), ov = 0; +}, rT.__r = 0, Kne = 0; +var ip, ri, N7, QQ, nv = 0, oie = [], P5 = [], VQ = cr.__b, WQ = cr.__r, YQ = cr.diffed, GQ = cr.__c, HQ = cr.unmount; +function Ay(t, e) { + cr.__h && cr.__h(ri, t, nv || e), nv = 0; var r = ri.__H || (ri.__H = { __: [], __h: [] }); - return t >= r.__.length && r.__.push({ __V: I3 }), r.__[t]; + return t >= r.__.length && r.__.push({ __V: P5 }), r.__[t]; } -function na(t) { - return ov = 1, $_(vie, t); +function ra(t) { + return nv = 1, D_(lie, t); } -function $_(t, e, r) { - var n = Py(cp++, 2); - if (n.t = t, !n.__c && (n.__ = [r ? r(e) : vie(void 0, e), function(o) { +function D_(t, e, r) { + var n = Ay(ip++, 2); + if (n.t = t, !n.__c && (n.__ = [r ? r(e) : lie(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 = ri, !ri.u)) { @@ -371,21 +371,21 @@ function $_(t, e, r) { } return n.__N || n.__; } -function ts(t, e) { - var r = Py(cp++, 3); - !cr.__s && k$(r.__H, e) && (r.__ = t, r.i = e, ri.__H.__h.push(r)); +function Ji(t, e) { + var r = Ay(ip++, 3); + !cr.__s && h$(r.__H, e) && (r.__ = t, r.i = e, ri.__H.__h.push(r)); } -function B_(t, e) { - var r = Py(cp++, 4); - !cr.__s && k$(r.__H, e) && (r.__ = t, r.i = e, ri.__h.push(r)); +function P_(t, e) { + var r = Ay(ip++, 4); + !cr.__s && h$(r.__H, e) && (r.__ = t, r.i = e, ri.__h.push(r)); } -function ns(t) { - return ov = 5, Fs(function() { +function ts(t) { + return nv = 5, $s(function() { return { current: t }; }, []); } -function R3e(t, e, r) { - ov = 6, B_(function() { +function y5e(t, e, r) { + nv = 6, P_(function() { return typeof t == "function" ? (t(e()), function() { return t(null); }) : t ? (t.current = e(), function() { @@ -393,24 +393,24 @@ function R3e(t, e, r) { }) : void 0; }, r == null ? r : r.concat(t)); } -function Fs(t, e) { - var r = Py(cp++, 7); - return k$(r.__H, e) ? (r.__V = t(), r.i = e, r.__h = t, r.__V) : r.__; +function $s(t, e) { + var r = Ay(ip++, 7); + return h$(r.__H, e) ? (r.__V = t(), r.i = e, r.__h = t, r.__V) : r.__; } -function sT(t, e) { - return ov = 8, Fs(function() { +function nT(t, e) { + return nv = 8, $s(function() { return t; }, e); } -function Al(t) { - var e = ri.context[t.__c], r = Py(cp++, 9); +function Cl(t) { + var e = ri.context[t.__c], r = Ay(ip++, 9); return r.c = t, e ? (r.__ == null && (r.__ = !0, e.sub(ri)), e.props.value) : t.__; } -function fM(t, e) { +function oM(t, e) { cr.useDebugValue && cr.useDebugValue(e ? e(t) : t); } -function L3e() { - var t = Py(cp++, 11); +function b5e() { + var t = Ay(ip++, 11); if (!t.__) { for (var e = ri.__v; e !== null && !e.__m && e.__ !== null; ) e = e.__; @@ -419,223 +419,223 @@ function L3e() { } return t.__; } -function M3e() { - for (var t; t = mie.shift(); ) +function x5e() { + for (var t; t = oie.shift(); ) if (t.__P && t.__H) try { - t.__H.__h.forEach($3), t.__H.__h.forEach(dM), t.__H.__h = []; + t.__H.__h.forEach(N5), t.__H.__h.forEach(lM), t.__H.__h = []; } catch (e) { t.__H.__h = [], cr.__e(e, t.__v); } } cr.__b = function(t) { - ri = null, nV && nV(t); + ri = null, VQ && VQ(t); }, cr.__r = function(t) { - iV && iV(t), cp = 0; + WQ && WQ(t), ip = 0; var e = (ri = t.__c).__H; - e && (q7 === ri ? (e.__h = [], ri.__h = [], e.__.forEach(function(r) { - r.__N && (r.__ = r.__N), r.__V = I3, r.__N = r.i = void 0; - })) : (e.__h.forEach($3), e.__h.forEach(dM), e.__h = [], cp = 0)), q7 = ri; + e && (N7 === ri ? (e.__h = [], ri.__h = [], e.__.forEach(function(r) { + r.__N && (r.__ = r.__N), r.__V = P5, r.__N = r.i = void 0; + })) : (e.__h.forEach(N5), e.__h.forEach(lM), e.__h = [], ip = 0)), N7 = ri; }, cr.diffed = function(t) { - sV && sV(t); + YQ && YQ(t); var e = t.__c; - e && e.__H && (e.__H.__h.length && (mie.push(e) !== 1 && rV === cr.requestAnimationFrame || ((rV = cr.requestAnimationFrame) || D3e)(M3e)), e.__H.__.forEach(function(r) { - r.i && (r.__H = r.i), r.__V !== I3 && (r.__ = r.__V), r.i = void 0, r.__V = I3; - })), q7 = ri = null; + e && e.__H && (e.__H.__h.length && (oie.push(e) !== 1 && QQ === cr.requestAnimationFrame || ((QQ = cr.requestAnimationFrame) || w5e)(x5e)), e.__H.__.forEach(function(r) { + r.i && (r.__H = r.i), r.__V !== P5 && (r.__ = r.__V), r.i = void 0, r.__V = P5; + })), N7 = ri = null; }, cr.__c = function(t, e) { e.some(function(r) { try { - r.__h.forEach($3), r.__h = r.__h.filter(function(n) { - return !n.__ || dM(n); + r.__h.forEach(N5), r.__h = r.__h.filter(function(n) { + return !n.__ || lM(n); }); } catch (n) { e.some(function(i) { i.__h && (i.__h = []); }), e = [], cr.__e(n, r.__v); } - }), aV && aV(t, e); + }), GQ && GQ(t, e); }, cr.unmount = function(t) { - oV && oV(t); + HQ && HQ(t); var e, r = t.__c; r && r.__H && (r.__H.__.forEach(function(n) { try { - $3(n); + N5(n); } catch (i) { e = i; } }), r.__H = void 0, e && cr.__e(e, r.__v)); }; -var lV = typeof requestAnimationFrame == "function"; -function D3e(t) { +var XQ = typeof requestAnimationFrame == "function"; +function w5e(t) { var e, r = function() { - clearTimeout(n), lV && cancelAnimationFrame(e), setTimeout(t); + clearTimeout(n), XQ && cancelAnimationFrame(e), setTimeout(t); }, n = setTimeout(r, 100); - lV && (e = requestAnimationFrame(r)); + XQ && (e = requestAnimationFrame(r)); } -function $3(t) { +function N5(t) { var e = ri, r = t.__c; typeof r == "function" && (t.__c = void 0, r()), ri = e; } -function dM(t) { +function lM(t) { var e = ri; t.__c = t.__(), ri = e; } -function k$(t, e) { +function h$(t, e) { return !t || t.length !== e.length || e.some(function(r, n) { return r !== t[n]; }); } -function vie(t, e) { +function lie(t, e) { return typeof e == "function" ? e(t) : e; } -function P3e(t) { +function O5e(t) { return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; } -var yie = { exports: {} }, Yi = yie.exports = {}, Nu, Iu; -function pM() { +var cie = { exports: {} }, Wi = cie.exports = {}, Mu, Du; +function cM() { throw new Error("setTimeout has not been defined"); } -function gM() { +function uM() { throw new Error("clearTimeout has not been defined"); } (function() { try { - typeof setTimeout == "function" ? Nu = setTimeout : Nu = pM; + typeof setTimeout == "function" ? Mu = setTimeout : Mu = cM; } catch { - Nu = pM; + Mu = cM; } try { - typeof clearTimeout == "function" ? Iu = clearTimeout : Iu = gM; + typeof clearTimeout == "function" ? Du = clearTimeout : Du = uM; } catch { - Iu = gM; + Du = uM; } })(); -function bie(t) { - if (Nu === setTimeout) +function uie(t) { + if (Mu === setTimeout) return setTimeout(t, 0); - if ((Nu === pM || !Nu) && setTimeout) - return Nu = setTimeout, setTimeout(t, 0); + if ((Mu === cM || !Mu) && setTimeout) + return Mu = setTimeout, setTimeout(t, 0); try { - return Nu(t, 0); + return Mu(t, 0); } catch { try { - return Nu.call(null, t, 0); + return Mu.call(null, t, 0); } catch { - return Nu.call(this, t, 0); + return Mu.call(this, t, 0); } } } -function N3e(t) { - if (Iu === clearTimeout) +function k5e(t) { + if (Du === clearTimeout) return clearTimeout(t); - if ((Iu === gM || !Iu) && clearTimeout) - return Iu = clearTimeout, clearTimeout(t); + if ((Du === uM || !Du) && clearTimeout) + return Du = clearTimeout, clearTimeout(t); try { - return Iu(t); + return Du(t); } catch { try { - return Iu.call(null, t); + return Du.call(null, t); } catch { - return Iu.call(this, t); + return Du.call(this, t); } } } -var uf = [], M1 = !1, B0, B3 = -1; -function I3e() { - !M1 || !B0 || (M1 = !1, B0.length ? uf = B0.concat(uf) : B3 = -1, uf.length && xie()); +var cf = [], _1 = !1, P0, I5 = -1; +function S5e() { + !_1 || !P0 || (_1 = !1, P0.length ? cf = P0.concat(cf) : I5 = -1, cf.length && hie()); } -function xie() { - if (!M1) { - var t = bie(I3e); - M1 = !0; - for (var e = uf.length; e; ) { - for (B0 = uf, uf = []; ++B3 < e; ) - B0 && B0[B3].run(); - B3 = -1, e = uf.length; +function hie() { + if (!_1) { + var t = uie(S5e); + _1 = !0; + for (var e = cf.length; e; ) { + for (P0 = cf, cf = []; ++I5 < e; ) + P0 && P0[I5].run(); + I5 = -1, e = cf.length; } - B0 = null, M1 = !1, N3e(t); + P0 = null, _1 = !1, k5e(t); } } -Yi.nextTick = function(t) { +Wi.nextTick = function(t) { var e = new Array(arguments.length - 1); if (arguments.length > 1) for (var r = 1; r < arguments.length; r++) e[r - 1] = arguments[r]; - uf.push(new wie(t, e)), uf.length === 1 && !M1 && bie(xie); + cf.push(new fie(t, e)), cf.length === 1 && !_1 && uie(hie); }; -function wie(t, e) { +function fie(t, e) { this.fun = t, this.array = e; } -wie.prototype.run = function() { +fie.prototype.run = function() { this.fun.apply(null, this.array); }; -Yi.title = "browser"; -Yi.browser = !0; -Yi.env = {}; -Yi.argv = []; -Yi.version = ""; -Yi.versions = {}; -function Xf() { -} -Yi.on = Xf; -Yi.addListener = Xf; -Yi.once = Xf; -Yi.off = Xf; -Yi.removeListener = Xf; -Yi.removeAllListeners = Xf; -Yi.emit = Xf; -Yi.prependListener = Xf; -Yi.prependOnceListener = Xf; -Yi.listeners = function(t) { +Wi.title = "browser"; +Wi.browser = !0; +Wi.env = {}; +Wi.argv = []; +Wi.version = ""; +Wi.versions = {}; +function Gf() { +} +Wi.on = Gf; +Wi.addListener = Gf; +Wi.once = Gf; +Wi.off = Gf; +Wi.removeListener = Gf; +Wi.removeAllListeners = Gf; +Wi.emit = Gf; +Wi.prependListener = Gf; +Wi.prependOnceListener = Gf; +Wi.listeners = function(t) { return []; }; -Yi.binding = function(t) { +Wi.binding = function(t) { throw new Error("process.binding is not supported"); }; -Yi.cwd = function() { +Wi.cwd = function() { return "/"; }; -Yi.chdir = function(t) { +Wi.chdir = function(t) { throw new Error("process.chdir is not supported"); }; -Yi.umask = function() { +Wi.umask = function() { return 0; }; -var $3e = yie.exports; -const $s = /* @__PURE__ */ P3e($3e); -var Go = function() { - return Go = Object.assign || function(e) { +var T5e = cie.exports; +const Ns = /* @__PURE__ */ O5e(T5e); +var Vo = function() { + return Vo = 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; - }, Go.apply(this, arguments); + }, Vo.apply(this, arguments); }; -function lv(t, e, r) { +function iv(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 B3e(t) { +function C5e(t) { var e = /* @__PURE__ */ Object.create(null); return function(r) { return e[r] === void 0 && (e[r] = t(r)), e[r]; }; } -var F3e = /^((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)-.*))$/, z3e = /* @__PURE__ */ B3e( +var E5e = /^((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)-.*))$/, _5e = /* @__PURE__ */ C5e( function(t) { - return F3e.test(t) || t.charCodeAt(0) === 111 && t.charCodeAt(1) === 110 && t.charCodeAt(2) < 91; + return E5e.test(t) || t.charCodeAt(0) === 111 && t.charCodeAt(1) === 110 && t.charCodeAt(2) < 91; } ); -function Oie(t, e) { +function die(t, e) { for (var r in e) t[r] = e[r]; return t; } -function mM(t, e) { +function hM(t, e) { for (var r in t) if (r !== "__source" && !(r in e)) return !0; @@ -644,73 +644,73 @@ function mM(t, e) { return !0; return !1; } -function vM(t) { +function fM(t) { this.props = t; } -function q3e(t, e) { +function A5e(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 : mM(this.props, i); + return !a && s && (s.call ? s(null) : s.current = null), e ? !e(this.props, i) || !a : hM(this.props, i); } function n(i) { - return this.shouldComponentUpdate = r, ph(t, i); + return this.shouldComponentUpdate = r, hh(t, i); } return n.displayName = "Memo(" + (t.displayName || t.name) + ")", n.prototype.isReactComponent = !0, n.__f = !0, n; } -(vM.prototype = new Hc()).isPureReactComponent = !0, vM.prototype.shouldComponentUpdate = function(t, e) { - return mM(this.props, t) || mM(this.state, e); +(fM.prototype = new Wc()).isPureReactComponent = !0, fM.prototype.shouldComponentUpdate = function(t, e) { + return hM(this.props, t) || hM(this.state, e); }; -var cV = cr.__b; +var jQ = cr.__b; cr.__b = function(t) { - t.type && t.type.__f && t.ref && (t.props.ref = t.ref, t.ref = null), cV && cV(t); + t.type && t.type.__f && t.ref && (t.props.ref = t.ref, t.ref = null), jQ && jQ(t); }; -var U3e = typeof Symbol < "u" && Symbol.for && Symbol.for("react.forward_ref") || 3911; -function Q3e(t) { +var R5e = typeof Symbol < "u" && Symbol.for && Symbol.for("react.forward_ref") || 3911; +function L5e(t) { function e(r) { - var n = Oie({}, r); + var n = die({}, r); return delete n.ref, t(n, r.ref || null); } - return e.$$typeof = U3e, e.render = e, e.prototype.isReactComponent = e.__f = !0, e.displayName = "ForwardRef(" + (t.displayName || t.name) + ")", e; + return e.$$typeof = R5e, e.render = e, e.prototype.isReactComponent = e.__f = !0, e.displayName = "ForwardRef(" + (t.displayName || t.name) + ")", e; } -var uV = function(t, e) { - return t == null ? null : mf(mf(t).map(e)); -}, V3e = { map: uV, forEach: uV, count: function(t) { - return t ? mf(t).length : 0; +var ZQ = function(t, e) { + return t == null ? null : gf(gf(t).map(e)); +}, M5e = { map: ZQ, forEach: ZQ, count: function(t) { + return t ? gf(t).length : 0; }, only: function(t) { - var e = mf(t); + var e = gf(t); if (e.length !== 1) throw "Children.only"; return e[0]; -}, toArray: mf }, W3e = cr.__e; +}, toArray: gf }, D5e = cr.__e; cr.__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); } - W3e(t, e, r, n); + D5e(t, e, r, n); }; -var hV = cr.unmount; -function kie(t, e, r) { +var KQ = cr.unmount; +function pie(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 = Oie({}, t)).__c != null && (t.__c.__P === r && (t.__c.__P = e), t.__c = null), t.__k = t.__k && t.__k.map(function(n) { - return kie(n, e, r); + }), t.__c.__H = null), (t = die({}, t)).__c != null && (t.__c.__P === r && (t.__c.__P = e), t.__c = null), t.__k = t.__k && t.__k.map(function(n) { + return pie(n, e, r); })), t; } -function Sie(t, e, r) { +function gie(t, e, r) { return t && r && (t.__v = null, t.__k = t.__k && t.__k.map(function(n) { - return Sie(n, e, r); + return gie(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 F3() { +function $5() { this.__u = 0, this.t = null, this.__b = null; } -function Tie(t) { +function mie(t) { var e = t.__.__c; return e && e.__a && e.__a(t); } -function Y3e(t) { +function P5e(t) { var e, r, n; function i(s) { if (e || (e = t()).then(function(a) { @@ -721,20 +721,20 @@ function Y3e(t) { throw n; if (!r) throw e; - return ph(r, s); + return hh(r, s); } return i.displayName = "Lazy", i.__f = !0, i; } -function Sb() { +function kb() { this.u = null, this.o = null; } cr.unmount = function(t) { var e = t.__c; - e && e.__R && e.__R(), e && 32 & t.__u && (t.type = null), hV && hV(t); -}, (F3.prototype = new Hc()).__c = function(t, e) { + e && e.__R && e.__R(), e && 32 & t.__u && (t.type = null), KQ && KQ(t); +}, ($5.prototype = new Wc()).__c = function(t, e) { var r = e.__c, n = this; n.t == null && (n.t = []), n.t.push(r); - var i = Tie(n.__v), s = !1, a = function() { + var i = mie(n.__v), s = !1, a = function() { s || (s = !0, r.__R = null, i ? i(o) : o()); }; r.__R = a; @@ -742,7 +742,7 @@ cr.unmount = function(t) { if (!--n.__u) { if (n.state.__a) { var l = n.state.__a; - n.__v.__k[0] = Sie(l, l.__c.__P, l.__c.__O); + n.__v.__k[0] = gie(l, l.__c.__P, l.__c.__O); } var u; for (n.setState({ __a: n.__b = null }); u = n.t.pop(); ) @@ -750,20 +750,20 @@ cr.unmount = function(t) { } }; n.__u++ || 32 & e.__u || n.setState({ __a: n.__b = n.__v.__k[0] }), t.then(a, a); -}, F3.prototype.componentWillUnmount = function() { +}, $5.prototype.componentWillUnmount = function() { this.t = []; -}, F3.prototype.render = function(t, e) { +}, $5.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] = kie(this.__b, r, n.__O = n.__P); + this.__v.__k[0] = pie(this.__b, r, n.__O = n.__P); } this.__b = null; } - var i = e.__a && ph(gh, null, t.fallback); - return i && (i.__u &= -33), [ph(gh, null, e.__a ? null : t.children), i]; + var i = e.__a && hh(fh, null, t.fallback); + return i && (i.__u &= -33), [hh(fh, null, e.__a ? null : t.children), i]; }; -var fV = function(t, e, r) { +var JQ = 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; ) @@ -773,153 +773,153 @@ var fV = function(t, e, r) { t.u = r = r[2]; } }; -function G3e(t) { +function N5e(t) { return this.getChildContext = function() { return t.context; }, t.children; } -function H3e(t) { +function I5e(t) { var e = this, r = t.i; e.componentWillUnmount = function() { - Cf(null, e.l), e.l = null, e.i = null; + Sf(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); - } }), Cf(ph(G3e, { context: e.context }, t.__v), e.l); + } }), Sf(hh(N5e, { context: e.context }, t.__v), e.l); } -function X3e(t, e) { - var r = ph(H3e, { __v: t, i: e }); +function $5e(t, e) { + var r = hh(I5e, { __v: t, i: e }); return r.containerInfo = e, r; } -(Sb.prototype = new Hc()).__a = function(t) { - var e = this, r = Tie(e.__v), n = e.o.get(t); +(kb.prototype = new Wc()).__a = function(t) { + var e = this, r = mie(e.__v), n = e.o.get(t); return n[0]++, function(i) { var s = function() { - e.props.revealOrder ? (n.push(i), fV(e, t, n)) : i(); + e.props.revealOrder ? (n.push(i), JQ(e, t, n)) : i(); }; r ? r(s) : s(); }; -}, Sb.prototype.render = function(t) { +}, kb.prototype.render = function(t) { this.u = null, this.o = /* @__PURE__ */ new Map(); - var e = mf(t.children); + var e = gf(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; -}, Sb.prototype.componentDidUpdate = Sb.prototype.componentDidMount = function() { +}, kb.prototype.componentDidUpdate = kb.prototype.componentDidMount = function() { var t = this; this.o.forEach(function(e, r) { - fV(t, r, e); + JQ(t, r, e); }); }; -var Cie = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, j3e = /^(?: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]/, Z3e = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, K3e = /[A-Z0-9]/g, J3e = typeof document < "u", e5e = function(t) { +var vie = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, B5e = /^(?: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]/, F5e = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, z5e = /[A-Z0-9]/g, q5e = typeof document < "u", U5e = function(t) { return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(t); }; -function t5e(t, e, r) { - return e.__k == null && (e.textContent = ""), Cf(t, e), typeof r == "function" && r(), t ? t.__c : null; +function Q5e(t, e, r) { + return e.__k == null && (e.textContent = ""), Sf(t, e), typeof r == "function" && r(), t ? t.__c : null; } -function r5e(t, e, r) { - return pie(t, e), typeof r == "function" && r(), t ? t.__c : null; +function V5e(t, e, r) { + return sie(t, e), typeof r == "function" && r(), t ? t.__c : null; } -Hc.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(t) { - Object.defineProperty(Hc.prototype, t, { configurable: !0, get: function() { +Wc.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(t) { + Object.defineProperty(Wc.prototype, t, { configurable: !0, get: function() { return this["UNSAFE_" + t]; }, set: function(e) { Object.defineProperty(this, t, { configurable: !0, writable: !0, value: e }); } }); }); -var dV = cr.event; -function n5e() { +var eV = cr.event; +function W5e() { } -function i5e() { +function Y5e() { return this.cancelBubble; } -function s5e() { +function G5e() { return this.defaultPrevented; } cr.event = function(t) { - return dV && (t = dV(t)), t.persist = n5e, t.isPropagationStopped = i5e, t.isDefaultPrevented = s5e, t.nativeEvent = t; + return eV && (t = eV(t)), t.persist = W5e, t.isPropagationStopped = Y5e, t.isDefaultPrevented = G5e, t.nativeEvent = t; }; -var S$, a5e = { enumerable: !1, configurable: !0, get: function() { +var f$, H5e = { enumerable: !1, configurable: !0, get: function() { return this.class; -} }, pV = cr.vnode; +} }, tV = cr.vnode; cr.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 || J3e && s === "children" && n === "noscript" || s === "class" || s === "className")) { + if (!(s === "value" && "defaultValue" in r && a == null || q5e && 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" || e5e(r.type) ? o === "onfocus" ? s = "onfocusin" : o === "onblur" ? s = "onfocusout" : Z3e.test(s) ? s = o : n.indexOf("-") === -1 && j3e.test(s) ? s = s.replace(K3e, "-$&").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" || U5e(r.type) ? o === "onfocus" ? s = "onfocusin" : o === "onblur" ? s = "onfocusout" : F5e.test(s) ? s = o : n.indexOf("-") === -1 && B5e.test(s) ? s = s.replace(z5e, "-$&").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 = mf(r.children).forEach(function(l) { + n == "select" && i.multiple && Array.isArray(i.value) && (i.value = gf(r.children).forEach(function(l) { l.props.selected = i.value.indexOf(l.props.value) != -1; - })), n == "select" && i.defaultValue != null && (i.value = mf(r.children).forEach(function(l) { + })), n == "select" && i.defaultValue != null && (i.value = gf(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", a5e)) : (r.className && !r.class || r.class && r.className) && (i.class = i.className = r.className), e.props = i; - }(t), t.$$typeof = Cie, pV && pV(t); + })), r.class && !r.className ? (i.class = r.class, Object.defineProperty(i, "className", H5e)) : (r.className && !r.class || r.class && r.className) && (i.class = i.className = r.className), e.props = i; + }(t), t.$$typeof = vie, tV && tV(t); }; -var gV = cr.__r; +var rV = cr.__r; cr.__r = function(t) { - gV && gV(t), S$ = t.__c; + rV && rV(t), f$ = t.__c; }; -var mV = cr.diffed; +var nV = cr.diffed; cr.diffed = function(t) { - mV && mV(t); + nV && nV(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), S$ = null; + r != null && t.type === "textarea" && "value" in e && e.value !== r.value && (r.value = e.value == null ? "" : e.value), f$ = null; }; -var o5e = { ReactCurrentDispatcher: { current: { readContext: function(t) { - return S$.__n[t.__c].props.value; +var X5e = { ReactCurrentDispatcher: { current: { readContext: function(t) { + return f$.__n[t.__c].props.value; } } } }; -function l5e(t) { - return ph.bind(null, t); +function j5e(t) { + return hh.bind(null, t); } -function F_(t) { - return !!t && t.$$typeof === Cie; +function N_(t) { + return !!t && t.$$typeof === vie; } -function c5e(t) { - return F_(t) && t.type === gh; +function Z5e(t) { + return N_(t) && t.type === fh; } -function u5e(t) { - return F_(t) ? A3e.apply(null, arguments) : t; +function K5e(t) { + return N_(t) ? v5e.apply(null, arguments) : t; } -function h5e(t) { - return !!t.__k && (Cf(null, t), !0); +function J5e(t) { + return !!t.__k && (Sf(null, t), !0); } -function f5e(t) { +function e3e(t) { return t && (t.base || t.nodeType === 1 && t) || null; } -var d5e = function(t, e) { +var t3e = function(t, e) { return t(e); -}, p5e = function(t, e) { +}, r3e = function(t, e) { return t(e); -}, g5e = gh; -function Eie(t) { +}, n3e = fh; +function yie(t) { t(); } -function m5e(t) { +function i3e(t) { return t; } -function v5e() { - return [!1, Eie]; -} -var y5e = B_, b5e = F_; -function x5e(t, e) { - var r = e(), n = na({ h: { __: r, v: e } }), i = n[0].h, s = n[1]; - return B_(function() { - i.__ = r, i.v = e, U7(i) && s({ h: i }); - }, [t, r, e]), ts(function() { - return U7(i) && s({ h: i }), t(function() { - U7(i) && s({ h: i }); +function s3e() { + return [!1, yie]; +} +var a3e = P_, o3e = N_; +function l3e(t, e) { + var r = e(), n = ra({ h: { __: r, v: e } }), i = n[0].h, s = n[1]; + return P_(function() { + i.__ = r, i.v = e, I7(i) && s({ h: i }); + }, [t, r, e]), Ji(function() { + return I7(i) && s({ h: i }), t(function() { + I7(i) && s({ h: i }); }); }, [t]), r; } -function U7(t) { +function I7(t) { var e, r, n = t.v, i = t.__; try { var s = n(); @@ -928,11 +928,11 @@ function U7(t) { return !0; } } -var fg = { useState: na, useId: L3e, useReducer: $_, useEffect: ts, useLayoutEffect: B_, useInsertionEffect: y5e, useTransition: v5e, useDeferredValue: m5e, useSyncExternalStore: x5e, startTransition: Eie, useRef: ns, useImperativeHandle: R3e, useMemo: Fs, useCallback: sT, useContext: Al, useDebugValue: fM, version: "17.0.2", Children: V3e, render: t5e, hydrate: r5e, unmountComponentAtNode: h5e, createPortal: X3e, createElement: ph, createContext: gie, createFactory: l5e, cloneElement: u5e, createRef: S3e, Fragment: gh, isValidElement: F_, isElement: b5e, isFragment: c5e, findDOMNode: f5e, Component: Hc, PureComponent: vM, memo: q3e, forwardRef: Q3e, flushSync: p5e, unstable_batchedUpdates: d5e, StrictMode: g5e, Suspense: F3, SuspenseList: Sb, lazy: Y3e, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: o5e }, sr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; -function _ie(t) { +var lg = { useState: ra, useId: b5e, useReducer: D_, useEffect: Ji, useLayoutEffect: P_, useInsertionEffect: a3e, useTransition: s3e, useDeferredValue: i3e, useSyncExternalStore: l3e, startTransition: yie, useRef: ts, useImperativeHandle: y5e, useMemo: $s, useCallback: nT, useContext: Cl, useDebugValue: oM, version: "17.0.2", Children: M5e, render: Q5e, hydrate: V5e, unmountComponentAtNode: J5e, createPortal: $5e, createElement: hh, createContext: aie, createFactory: j5e, cloneElement: K5e, createRef: f5e, Fragment: fh, isValidElement: N_, isElement: o3e, isFragment: Z5e, findDOMNode: e3e, Component: Wc, PureComponent: fM, memo: A5e, forwardRef: L5e, flushSync: r3e, unstable_batchedUpdates: t3e, StrictMode: n3e, Suspense: $5, SuspenseList: kb, lazy: P5e, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: X5e }, sr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; +function bie(t) { return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; } -function z_(t) { +function I_(t) { var e = t.default; if (typeof e == "function") { var r = function() { @@ -953,7 +953,7 @@ function z_(t) { }); }), r; } -var w5e = function(e, r, n, i) { +var c3e = function(e, r, n, i) { var s = n ? n.call(i, e, r) : void 0; if (s !== void 0) return !!s; @@ -973,76 +973,76 @@ var w5e = function(e, r, n, i) { return !1; } return !0; -}, Jn = "-ms-", ix = "-moz-", yn = "-webkit-", Aie = "comm", q_ = "rule", T$ = "decl", O5e = "@import", Rie = "@keyframes", k5e = "@layer", S5e = Math.abs, C$ = String.fromCharCode, yM = Object.assign; -function T5e(t, e) { - return Ns(t, 0) ^ 45 ? (((e << 2 ^ Ns(t, 0)) << 2 ^ Ns(t, 1)) << 2 ^ Ns(t, 2)) << 2 ^ Ns(t, 3) : 0; +}, Jn = "-ms-", rx = "-moz-", yn = "-webkit-", xie = "comm", $_ = "rule", d$ = "decl", u3e = "@import", wie = "@keyframes", h3e = "@layer", f3e = Math.abs, p$ = String.fromCharCode, dM = Object.assign; +function d3e(t, e) { + return Ds(t, 0) ^ 45 ? (((e << 2 ^ Ds(t, 0)) << 2 ^ Ds(t, 1)) << 2 ^ Ds(t, 2)) << 2 ^ Ds(t, 3) : 0; } -function Lie(t) { +function Oie(t) { return t.trim(); } -function Kh(t, e) { +function Zh(t, e) { return (t = e.exec(t)) ? t[0] : t; } function Hr(t, e, r) { return t.replace(e, r); } -function z3(t, e) { +function B5(t, e) { return t.indexOf(e); } -function Ns(t, e) { +function Ds(t, e) { return t.charCodeAt(e) | 0; } -function cv(t, e, r) { +function sv(t, e, r) { return t.slice(e, r); } -function Fu(t) { +function Iu(t) { return t.length; } -function Mie(t) { +function kie(t) { return t.length; } -function Tb(t, e) { +function Sb(t, e) { return e.push(t), t; } -function C5e(t, e) { +function p3e(t, e) { return t.map(e).join(""); } -function vV(t, e) { +function iV(t, e) { return t.filter(function(r) { - return !Kh(r, e); + return !Zh(r, e); }); } -var U_ = 1, uv = 1, Die = 0, fc = 0, Zi = 0, Ny = ""; -function Q_(t, e, r, n, i, s, a, o) { - return { value: t, root: e, parent: r, type: n, props: i, children: s, line: U_, column: uv, length: a, return: "", siblings: o }; +var B_ = 1, av = 1, Sie = 0, cc = 0, Xi = 0, Ry = ""; +function F_(t, e, r, n, i, s, a, o) { + return { value: t, root: e, parent: r, type: n, props: i, children: s, line: B_, column: av, length: a, return: "", siblings: o }; } -function bd(t, e) { - return yM(Q_("", null, null, "", null, null, 0, t.siblings), t, { length: -t.length }, e); +function md(t, e) { + return dM(F_("", null, null, "", null, null, 0, t.siblings), t, { length: -t.length }, e); } -function Fm(t) { +function Im(t) { for (; t.root; ) - t = bd(t.root, { children: [t] }); - Tb(t, t.siblings); + t = md(t.root, { children: [t] }); + Sb(t, t.siblings); } -function E5e() { - return Zi; +function g3e() { + return Xi; } -function _5e() { - return Zi = fc > 0 ? Ns(Ny, --fc) : 0, uv--, Zi === 10 && (uv = 1, U_--), Zi; +function m3e() { + return Xi = cc > 0 ? Ds(Ry, --cc) : 0, av--, Xi === 10 && (av = 1, B_--), Xi; } -function Xc() { - return Zi = fc < Die ? Ns(Ny, fc++) : 0, uv++, Zi === 10 && (uv = 1, U_++), Zi; +function Yc() { + return Xi = cc < Sie ? Ds(Ry, cc++) : 0, av++, Xi === 10 && (av = 1, B_++), Xi; } -function eg() { - return Ns(Ny, fc); +function j0() { + return Ds(Ry, cc); } -function q3() { - return fc; +function F5() { + return cc; } -function V_(t, e) { - return cv(Ny, t, e); +function z_(t, e) { + return sv(Ry, t, e); } -function bM(t) { +function pM(t) { switch (t) { case 0: case 9: @@ -1074,91 +1074,91 @@ function bM(t) { } return 0; } -function A5e(t) { - return U_ = uv = 1, Die = Fu(Ny = t), fc = 0, []; +function v3e(t) { + return B_ = av = 1, Sie = Iu(Ry = t), cc = 0, []; } -function R5e(t) { - return Ny = "", t; +function y3e(t) { + return Ry = "", t; } -function Q7(t) { - return Lie(V_(fc - 1, xM(t === 91 ? t + 2 : t === 40 ? t + 1 : t))); +function $7(t) { + return Oie(z_(cc - 1, gM(t === 91 ? t + 2 : t === 40 ? t + 1 : t))); } -function L5e(t) { - for (; (Zi = eg()) && Zi < 33; ) - Xc(); - return bM(t) > 2 || bM(Zi) > 3 ? "" : " "; +function b3e(t) { + for (; (Xi = j0()) && Xi < 33; ) + Yc(); + return pM(t) > 2 || pM(Xi) > 3 ? "" : " "; } -function M5e(t, e) { - for (; --e && Xc() && !(Zi < 48 || Zi > 102 || Zi > 57 && Zi < 65 || Zi > 70 && Zi < 97); ) +function x3e(t, e) { + for (; --e && Yc() && !(Xi < 48 || Xi > 102 || Xi > 57 && Xi < 65 || Xi > 70 && Xi < 97); ) ; - return V_(t, q3() + (e < 6 && eg() == 32 && Xc() == 32)); + return z_(t, F5() + (e < 6 && j0() == 32 && Yc() == 32)); } -function xM(t) { - for (; Xc(); ) - switch (Zi) { +function gM(t) { + for (; Yc(); ) + switch (Xi) { case t: - return fc; + return cc; case 34: case 39: - t !== 34 && t !== 39 && xM(Zi); + t !== 34 && t !== 39 && gM(Xi); break; case 40: - t === 41 && xM(t); + t === 41 && gM(t); break; case 92: - Xc(); + Yc(); break; } - return fc; + return cc; } -function D5e(t, e) { - for (; Xc() && t + Zi !== 47 + 10; ) - if (t + Zi === 42 + 42 && eg() === 47) +function w3e(t, e) { + for (; Yc() && t + Xi !== 47 + 10; ) + if (t + Xi === 42 + 42 && j0() === 47) break; - return "/*" + V_(e, fc - 1) + "*" + C$(t === 47 ? t : Xc()); + return "/*" + z_(e, cc - 1) + "*" + p$(t === 47 ? t : Yc()); } -function P5e(t) { - for (; !bM(eg()); ) - Xc(); - return V_(t, fc); +function O3e(t) { + for (; !pM(j0()); ) + Yc(); + return z_(t, cc); } -function N5e(t) { - return R5e(U3("", null, null, null, [""], t = A5e(t), 0, [0], t)); +function k3e(t) { + return y3e(z5("", null, null, null, [""], t = v3e(t), 0, [0], t)); } -function U3(t, e, r, n, i, s, a, o, l) { +function z5(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 = Xc()) { + switch (g = b, b = Yc()) { case 40: - if (g != 108 && Ns(T, f - 1) == 58) { - z3(T += Hr(Q7(b), "&", "&\f"), "&\f") != -1 && (y = -1); + if (g != 108 && Ds(T, f - 1) == 58) { + B5(T += Hr($7(b), "&", "&\f"), "&\f") != -1 && (y = -1); break; } case 34: case 39: case 91: - T += Q7(b); + T += $7(b); break; case 9: case 10: case 13: case 32: - T += L5e(g); + T += b3e(g); break; case 92: - T += M5e(q3() - 1, 7); + T += x3e(F5() - 1, 7); continue; case 47: - switch (eg()) { + switch (j0()) { case 42: case 47: - Tb(I5e(D5e(Xc(), q3()), e, r, l), l); + Sb(S3e(w3e(Yc(), F5()), e, r, l), l); break; default: T += "/"; } break; case 123 * m: - o[u++] = Fu(T) * y; + o[u++] = Iu(T) * y; case 125 * m: case 59: case 0: @@ -1167,67 +1167,67 @@ function U3(t, e, r, n, i, s, a, o, l) { case 125: v = 0; case 59 + h: - y == -1 && (T = Hr(T, /\f/g, "")), p > 0 && Fu(T) - f && Tb(p > 32 ? bV(T + ";", n, r, f - 1, l) : bV(Hr(T, " ", "") + ";", n, r, f - 2, l), l); + y == -1 && (T = Hr(T, /\f/g, "")), p > 0 && Iu(T) - f && Sb(p > 32 ? aV(T + ";", n, r, f - 1, l) : aV(Hr(T, " ", "") + ";", n, r, f - 2, l), l); break; case 59: T += ";"; default: - if (Tb(C = yV(T, e, r, u, h, i, o, w, O = [], S = [], f, s), s), b === 123) + if (Sb(C = sV(T, e, r, u, h, i, o, w, O = [], S = [], f, s), s), b === 123) if (h === 0) - U3(T, e, C, C, O, s, f, o, S); + z5(T, e, C, C, O, s, f, o, S); else - switch (d === 99 && Ns(T, 3) === 110 ? 100 : d) { + switch (d === 99 && Ds(T, 3) === 110 ? 100 : d) { case 100: case 108: case 109: case 115: - U3(t, C, C, n && Tb(yV(t, C, C, 0, 0, i, o, w, i, O = [], f, S), S), i, S, f, o, n ? O : S); + z5(t, C, C, n && Sb(sV(t, C, C, 0, 0, i, o, w, i, O = [], f, S), S), i, S, f, o, n ? O : S); break; default: - U3(T, C, C, C, [""], S, 0, o, S); + z5(T, C, C, C, [""], S, 0, o, S); } } u = h = p = 0, m = y = 1, w = T = "", f = a; break; case 58: - f = 1 + Fu(T), p = g; + f = 1 + Iu(T), p = g; default: if (m < 1) { if (b == 123) --m; - else if (b == 125 && m++ == 0 && _5e() == 125) + else if (b == 125 && m++ == 0 && m3e() == 125) continue; } - switch (T += C$(b), b * m) { + switch (T += p$(b), b * m) { case 38: y = h > 0 ? 1 : (T += "\f", -1); break; case 44: - o[u++] = (Fu(T) - 1) * y, y = 1; + o[u++] = (Iu(T) - 1) * y, y = 1; break; case 64: - eg() === 45 && (T += Q7(Xc())), d = eg(), h = f = Fu(w = T += P5e(q3())), b++; + j0() === 45 && (T += $7(Yc())), d = j0(), h = f = Iu(w = T += O3e(F5())), b++; break; case 45: - g === 45 && Fu(T) == 2 && (m = 0); + g === 45 && Iu(T) == 2 && (m = 0); } } return s; } -function yV(t, e, r, n, i, s, a, o, l, u, h, f) { - for (var d = i - 1, p = i === 0 ? s : [""], g = Mie(p), m = 0, v = 0, y = 0; m < n; ++m) - for (var b = 0, w = cv(t, d + 1, d = S5e(v = a[m])), O = t; b < g; ++b) - (O = Lie(v > 0 ? p[b] + " " + w : Hr(w, /&\f/g, p[b]))) && (l[y++] = O); - return Q_(t, e, r, i === 0 ? q_ : o, l, u, h, f); +function sV(t, e, r, n, i, s, a, o, l, u, h, f) { + for (var d = i - 1, p = i === 0 ? s : [""], g = kie(p), m = 0, v = 0, y = 0; m < n; ++m) + for (var b = 0, w = sv(t, d + 1, d = f3e(v = a[m])), O = t; b < g; ++b) + (O = Oie(v > 0 ? p[b] + " " + w : Hr(w, /&\f/g, p[b]))) && (l[y++] = O); + return F_(t, e, r, i === 0 ? $_ : o, l, u, h, f); } -function I5e(t, e, r, n) { - return Q_(t, e, r, Aie, C$(E5e()), cv(t, 2, -2), 0, n); +function S3e(t, e, r, n) { + return F_(t, e, r, xie, p$(g3e()), sv(t, 2, -2), 0, n); } -function bV(t, e, r, n, i) { - return Q_(t, e, r, T$, cv(t, 0, n), cv(t, n + 1, -1), n, i); +function aV(t, e, r, n, i) { + return F_(t, e, r, d$, sv(t, 0, n), sv(t, n + 1, -1), n, i); } -function Pie(t, e, r) { - switch (T5e(t, e)) { +function Tie(t, e, r) { + switch (d3e(t, e)) { case 5103: return yn + "print-" + t + t; case 5737: @@ -1257,15 +1257,15 @@ function Pie(t, e, r) { case 3829: return yn + t + t; case 4789: - return ix + t + t; + return rx + t + t; case 5349: case 4246: case 4810: case 6968: case 2756: - return yn + t + ix + t + Jn + t + t; + return yn + t + rx + t + Jn + t + t; case 5936: - switch (Ns(t, e + 11)) { + switch (Ds(t, e + 11)) { case 114: return yn + t + Jn + Hr(t, /[svh]\w+-[tblr]{2}/, "tb") + t; case 108: @@ -1282,7 +1282,7 @@ function Pie(t, e, r) { case 5187: return yn + t + Hr(t, /(\w+).+(:[^]+)/, yn + "box-$1$2" + Jn + "flex-$1$2") + t; case 5443: - return yn + t + Jn + "flex-item-" + Hr(t, /flex-|-self/g, "") + (Kh(t, /flex-|baseline/) ? "" : Jn + "grid-row-" + Hr(t, /flex-|-self/g, "")) + t; + return yn + t + Jn + "flex-item-" + Hr(t, /flex-|-self/g, "") + (Zh(t, /flex-|baseline/) ? "" : Jn + "grid-row-" + Hr(t, /flex-|-self/g, "")) + t; case 4675: return yn + t + Jn + "flex-line-pack" + Hr(t, /align-content|flex-|-self/g, "") + t; case 5548: @@ -1301,8 +1301,8 @@ function Pie(t, e, r) { case 4968: return Hr(Hr(t, /(.+:)(flex-)?(.*)/, yn + "box-pack:$3" + Jn + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + yn + t + t; case 4200: - if (!Kh(t, /flex-|baseline/)) - return Jn + "grid-column-align" + cv(t, e) + t; + if (!Zh(t, /flex-|baseline/)) + return Jn + "grid-column-align" + sv(t, e) + t; break; case 2592: case 3360: @@ -1310,12 +1310,12 @@ function Pie(t, e, r) { case 4384: case 3616: return r && r.some(function(n, i) { - return e = i, Kh(n.props, /grid-\w+-end/); - }) ? ~z3(t + (r = r[e].value), "span") ? t : Jn + Hr(t, "-start", "") + t + Jn + "grid-row-span:" + (~z3(r, "span") ? Kh(r, /\d+/) : +Kh(r, /\d+/) - +Kh(t, /\d+/)) + ";" : Jn + Hr(t, "-start", "") + t; + return e = i, Zh(n.props, /grid-\w+-end/); + }) ? ~B5(t + (r = r[e].value), "span") ? t : Jn + Hr(t, "-start", "") + t + Jn + "grid-row-span:" + (~B5(r, "span") ? Zh(r, /\d+/) : +Zh(r, /\d+/) - +Zh(t, /\d+/)) + ";" : Jn + Hr(t, "-start", "") + t; case 4896: case 4128: return r && r.some(function(n) { - return Kh(n.props, /grid-\w+-start/); + return Zh(n.props, /grid-\w+-start/); }) ? t : Jn + Hr(Hr(t, "-end", "-span"), "span ", "") + t; case 4095: case 3583: @@ -1334,15 +1334,15 @@ function Pie(t, e, r) { case 5789: case 5021: case 4765: - if (Fu(t) - 1 - e > 6) - switch (Ns(t, e + 1)) { + if (Iu(t) - 1 - e > 6) + switch (Ds(t, e + 1)) { case 109: - if (Ns(t, e + 4) !== 45) + if (Ds(t, e + 4) !== 45) break; case 102: - return Hr(t, /(.+:)(.+)-([^]+)/, "$1" + yn + "$2-$3$1" + ix + (Ns(t, e + 3) == 108 ? "$3" : "$2-$3")) + t; + return Hr(t, /(.+:)(.+)-([^]+)/, "$1" + yn + "$2-$3$1" + rx + (Ds(t, e + 3) == 108 ? "$3" : "$2-$3")) + t; case 115: - return ~z3(t, "stretch") ? Pie(Hr(t, "stretch", "fill-available"), e, r) + t : t; + return ~B5(t, "stretch") ? Tie(Hr(t, "stretch", "fill-available"), e, r) + t : t; } break; case 5152: @@ -1351,13 +1351,13 @@ function Pie(t, e, r) { return Jn + i + ":" + s + u + (a ? Jn + i + "-span:" + (o ? l : +l - +s) + u : "") + t; }); case 4949: - if (Ns(t, e + 6) === 121) + if (Ds(t, e + 6) === 121) return Hr(t, ":", ":" + yn) + t; break; case 6444: - switch (Ns(t, Ns(t, 14) === 45 ? 18 : 11)) { + switch (Ds(t, Ds(t, 14) === 45 ? 18 : 11)) { case 120: - return Hr(t, /(.+:)([^;\s!]+)(;|(\s+)?!.+)?/, "$1" + yn + (Ns(t, 14) === 45 ? "inline-" : "") + "box$3$1" + yn + "$2$3$1" + Jn + "$2box$3") + t; + return Hr(t, /(.+:)([^;\s!]+)(;|(\s+)?!.+)?/, "$1" + yn + (Ds(t, 14) === 45 ? "inline-" : "") + "box$3$1" + yn + "$2$3$1" + Jn + "$2box$3") + t; case 100: return Hr(t, ":", ":" + Jn) + t; } @@ -1371,67 +1371,67 @@ function Pie(t, e, r) { } return t; } -function aT(t, e) { +function iT(t, e) { for (var r = "", n = 0; n < t.length; n++) r += e(t[n], n, t, e) || ""; return r; } -function $5e(t, e, r, n) { +function T3e(t, e, r, n) { switch (t.type) { - case k5e: + case h3e: if (t.children.length) break; - case O5e: - case T$: + case u3e: + case d$: return t.return = t.return || t.value; - case Aie: + case xie: return ""; - case Rie: - return t.return = t.value + "{" + aT(t.children, n) + "}"; - case q_: - if (!Fu(t.value = t.props.join(","))) + case wie: + return t.return = t.value + "{" + iT(t.children, n) + "}"; + case $_: + if (!Iu(t.value = t.props.join(","))) return ""; } - return Fu(r = aT(t.children, n)) ? t.return = t.value + "{" + r + "}" : ""; + return Iu(r = iT(t.children, n)) ? t.return = t.value + "{" + r + "}" : ""; } -function B5e(t) { - var e = Mie(t); +function C3e(t) { + var e = kie(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 F5e(t) { +function E3e(t) { return function(e) { e.root || (e = e.return) && t(e); }; } -function z5e(t, e, r, n) { +function _3e(t, e, r, n) { if (t.length > -1 && !t.return) switch (t.type) { - case T$: - t.return = Pie(t.value, t.length, r); + case d$: + t.return = Tie(t.value, t.length, r); return; - case Rie: - return aT([bd(t, { value: Hr(t.value, "@", "@" + yn) })], n); - case q_: + case wie: + return iT([md(t, { value: Hr(t.value, "@", "@" + yn) })], n); + case $_: if (t.length) - return C5e(r = t.props, function(i) { - switch (Kh(i, n = /(::plac\w+|:read-\w+)/)) { + return p3e(r = t.props, function(i) { + switch (Zh(i, n = /(::plac\w+|:read-\w+)/)) { case ":read-only": case ":read-write": - Fm(bd(t, { props: [Hr(i, /:(read-\w+)/, ":" + ix + "$1")] })), Fm(bd(t, { props: [i] })), yM(t, { props: vV(r, n) }); + Im(md(t, { props: [Hr(i, /:(read-\w+)/, ":" + rx + "$1")] })), Im(md(t, { props: [i] })), dM(t, { props: iV(r, n) }); break; case "::placeholder": - Fm(bd(t, { props: [Hr(i, /:(plac\w+)/, ":" + yn + "input-$1")] })), Fm(bd(t, { props: [Hr(i, /:(plac\w+)/, ":" + ix + "$1")] })), Fm(bd(t, { props: [Hr(i, /:(plac\w+)/, Jn + "input-$1")] })), Fm(bd(t, { props: [i] })), yM(t, { props: vV(r, n) }); + Im(md(t, { props: [Hr(i, /:(plac\w+)/, ":" + yn + "input-$1")] })), Im(md(t, { props: [Hr(i, /:(plac\w+)/, ":" + rx + "$1")] })), Im(md(t, { props: [Hr(i, /:(plac\w+)/, Jn + "input-$1")] })), Im(md(t, { props: [i] })), dM(t, { props: iV(r, n) }); break; } return ""; }); } } -var q5e = { +var A3e = { animationIterationCount: 1, aspectRatio: 1, borderImageOutset: 1, @@ -1478,8 +1478,8 @@ var q5e = { strokeMiterlimit: 1, strokeOpacity: 1, strokeWidth: 1 -}, dg = typeof $s < "u" && {} !== void 0 && ({}.REACT_APP_SC_ATTR || {}.SC_ATTR) || "data-styled", Nie = "active", Iie = "data-styled-version", W_ = "6.1.2", E$ = `/*!sc*/ -`, _$ = typeof window < "u" && "HTMLElement" in window, U5e = Boolean(typeof SC_DISABLE_SPEEDY == "boolean" ? SC_DISABLE_SPEEDY : typeof $s < "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 $s < "u" && {} !== void 0 && {}.SC_DISABLE_SPEEDY !== void 0 && {}.SC_DISABLE_SPEEDY !== "" ? {}.SC_DISABLE_SPEEDY !== "false" && {}.SC_DISABLE_SPEEDY : {}.NODE_ENV !== "production"), xV = /invalid hook call/i, U4 = /* @__PURE__ */ new Set(), Q5e = function(t, e) { +}, cg = typeof Ns < "u" && {} !== void 0 && ({}.REACT_APP_SC_ATTR || {}.SC_ATTR) || "data-styled", Cie = "active", Eie = "data-styled-version", q_ = "6.1.2", g$ = `/*!sc*/ +`, m$ = typeof window < "u" && "HTMLElement" in window, R3e = Boolean(typeof SC_DISABLE_SPEEDY == "boolean" ? SC_DISABLE_SPEEDY : typeof Ns < "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 Ns < "u" && {} !== void 0 && {}.SC_DISABLE_SPEEDY !== void 0 && {}.SC_DISABLE_SPEEDY !== "" ? {}.SC_DISABLE_SPEEDY !== "false" && {}.SC_DISABLE_SPEEDY : {}.NODE_ENV !== "production"), oV = /invalid hook call/i, F4 = /* @__PURE__ */ new Set(), L3e = 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. @@ -1489,67 +1489,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]; - xV.test(a) ? (s = !1, U4.delete(n)) : i.apply(void 0, lv([a], o, !1)); - }, ns(), s && !U4.has(n) && (console.warn(n), U4.add(n)); + oV.test(a) ? (s = !1, F4.delete(n)) : i.apply(void 0, iv([a], o, !1)); + }, ts(), s && !F4.has(n) && (console.warn(n), F4.add(n)); } catch (a) { - xV.test(a.message) && U4.delete(n); + oV.test(a.message) && F4.delete(n); } finally { console.error = i; } } -}, Y_ = Object.freeze([]), hv = Object.freeze({}); -function V5e(t, e, r) { - return r === void 0 && (r = hv), t.theme !== r.theme && t.theme || e || r.theme; +}, U_ = Object.freeze([]), ov = Object.freeze({}); +function M3e(t, e, r) { + return r === void 0 && (r = ov), t.theme !== r.theme && t.theme || e || r.theme; } -var wM = /* @__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"]), W5e = /[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g, Y5e = /(^-|-$)/g; -function wV(t) { - return t.replace(W5e, "-").replace(Y5e, ""); +var mM = /* @__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"]), D3e = /[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g, P3e = /(^-|-$)/g; +function lV(t) { + return t.replace(D3e, "-").replace(P3e, ""); } -var G5e = /(a)(d)/gi, Q4 = 52, OV = function(t) { +var N3e = /(a)(d)/gi, z4 = 52, cV = function(t) { return String.fromCharCode(t + (t > 25 ? 39 : 97)); }; -function OM(t) { +function vM(t) { var e, r = ""; - for (e = Math.abs(t); e > Q4; e = e / Q4 | 0) - r = OV(e % Q4) + r; - return (OV(e % Q4) + r).replace(G5e, "$1-$2"); + for (e = Math.abs(t); e > z4; e = e / z4 | 0) + r = cV(e % z4) + r; + return (cV(e % z4) + r).replace(N3e, "$1-$2"); } -var V7, $ie = 5381, T0 = function(t, e) { +var B7, _ie = 5381, w0 = function(t, e) { for (var r = e.length; r; ) t = 33 * t ^ e.charCodeAt(--r); return t; -}, Bie = function(t) { - return T0($ie, t); +}, Aie = function(t) { + return w0(_ie, t); }; -function H5e(t) { - return OM(Bie(t) >>> 0); +function I3e(t) { + return vM(Aie(t) >>> 0); } -function Fie(t) { +function Rie(t) { return {}.NODE_ENV !== "production" && typeof t == "string" && t || t.displayName || t.name || "Component"; } -function W7(t) { +function F7(t) { return typeof t == "string" && ({}.NODE_ENV === "production" || t.charAt(0) === t.charAt(0).toLowerCase()); } -var zie = typeof Symbol == "function" && Symbol.for, qie = zie ? Symbol.for("react.memo") : 60115, X5e = zie ? Symbol.for("react.forward_ref") : 60112, j5e = { childContextTypes: !0, contextType: !0, contextTypes: !0, defaultProps: !0, displayName: !0, getDefaultProps: !0, getDerivedStateFromError: !0, getDerivedStateFromProps: !0, mixins: !0, propTypes: !0, type: !0 }, Z5e = { name: !0, length: !0, prototype: !0, caller: !0, callee: !0, arguments: !0, arity: !0 }, Uie = { $$typeof: !0, compare: !0, defaultProps: !0, displayName: !0, propTypes: !0, type: !0 }, K5e = ((V7 = {})[X5e] = { $$typeof: !0, render: !0, defaultProps: !0, displayName: !0, propTypes: !0 }, V7[qie] = Uie, V7); -function kV(t) { - return ("type" in (e = t) && e.type.$$typeof) === qie ? Uie : "$$typeof" in t ? K5e[t.$$typeof] : j5e; +var Lie = typeof Symbol == "function" && Symbol.for, Mie = Lie ? Symbol.for("react.memo") : 60115, $3e = Lie ? Symbol.for("react.forward_ref") : 60112, B3e = { childContextTypes: !0, contextType: !0, contextTypes: !0, defaultProps: !0, displayName: !0, getDefaultProps: !0, getDerivedStateFromError: !0, getDerivedStateFromProps: !0, mixins: !0, propTypes: !0, type: !0 }, F3e = { name: !0, length: !0, prototype: !0, caller: !0, callee: !0, arguments: !0, arity: !0 }, Die = { $$typeof: !0, compare: !0, defaultProps: !0, displayName: !0, propTypes: !0, type: !0 }, z3e = ((B7 = {})[$3e] = { $$typeof: !0, render: !0, defaultProps: !0, displayName: !0, propTypes: !0 }, B7[Mie] = Die, B7); +function uV(t) { + return ("type" in (e = t) && e.type.$$typeof) === Mie ? Die : "$$typeof" in t ? z3e[t.$$typeof] : B3e; var e; } -var J5e = Object.defineProperty, eTe = Object.getOwnPropertyNames, SV = Object.getOwnPropertySymbols, tTe = Object.getOwnPropertyDescriptor, rTe = Object.getPrototypeOf, TV = Object.prototype; -function Qie(t, e, r) { +var q3e = Object.defineProperty, U3e = Object.getOwnPropertyNames, hV = Object.getOwnPropertySymbols, Q3e = Object.getOwnPropertyDescriptor, V3e = Object.getPrototypeOf, fV = Object.prototype; +function Pie(t, e, r) { if (typeof e != "string") { - if (TV) { - var n = rTe(e); - n && n !== TV && Qie(t, n, r); + if (fV) { + var n = V3e(e); + n && n !== fV && Pie(t, n, r); } - var i = eTe(e); - SV && (i = i.concat(SV(e))); - for (var s = kV(t), a = kV(e), o = 0; o < i.length; ++o) { + var i = U3e(e); + hV && (i = i.concat(hV(e))); + for (var s = uV(t), a = uV(e), o = 0; o < i.length; ++o) { var l = i[o]; - if (!(l in Z5e || r && r[l] || a && l in a || s && l in s)) { - var u = tTe(e, l); + if (!(l in F3e || r && r[l] || a && l in a || s && l in s)) { + var u = Q3e(e, l); try { - J5e(t, l, u); + q3e(t, l, u); } catch { } } @@ -1557,40 +1557,40 @@ function Qie(t, e, r) { } return t; } -function fv(t) { +function lv(t) { return typeof t == "function"; } -function A$(t) { +function v$(t) { return typeof t == "object" && "styledComponentId" in t; } -function F0(t, e) { +function N0(t, e) { return t && e ? "".concat(t, " ").concat(e) : t || e || ""; } -function CV(t, e) { +function dV(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 dv(t) { +function cv(t) { return t !== null && typeof t == "object" && t.constructor.name === Object.name && !("props" in t && t.$$typeof); } -function kM(t, e, r) { - if (r === void 0 && (r = !1), !r && !dv(t) && !Array.isArray(t)) +function yM(t, e, r) { + if (r === void 0 && (r = !1), !r && !cv(t) && !Array.isArray(t)) return e; if (Array.isArray(e)) for (var n = 0; n < e.length; n++) - t[n] = kM(t[n], e[n]); - else if (dv(e)) + t[n] = yM(t[n], e[n]); + else if (cv(e)) for (var n in e) - t[n] = kM(t[n], e[n]); + t[n] = yM(t[n], e[n]); return t; } -function R$(t, e) { +function y$(t, e) { Object.defineProperty(t, "toString", { value: e }); } -var nTe = {}.NODE_ENV !== "production" ? { 1: `Cannot create styled-component for component: %s. +var W3e = {}.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. @@ -1632,7 +1632,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 iTe() { +function Y3e() { 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) @@ -1641,12 +1641,12 @@ function iTe() { r = r.replace(/%[a-z]/, a); }), r; } -function Iy(t) { +function Ly(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(iTe.apply(void 0, lv([nTe[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(Y3e.apply(void 0, iv([W3e[t]], e, !1)).trim()); } -var sTe = function() { +var G3e = function() { function t(e) { this.groupSizes = new Uint32Array(512), this.length = 512, this.tag = e; } @@ -1658,7 +1658,7 @@ var sTe = function() { if (e >= this.groupSizes.length) { for (var n = this.groupSizes, i = n.length, s = i; e >= s; ) if ((s <<= 1) < 0) - throw Iy(16, "".concat(e)); + throw Ly(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; @@ -1677,50 +1677,50 @@ var sTe = 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(E$); + r += "".concat(this.tag.getRule(a)).concat(g$); return r; }, t; -}(), Q3 = /* @__PURE__ */ new Map(), oT = /* @__PURE__ */ new Map(), V3 = 1, V4 = function(t) { - if (Q3.has(t)) - return Q3.get(t); - for (; oT.has(V3); ) - V3++; - var e = V3++; +}(), q5 = /* @__PURE__ */ new Map(), sT = /* @__PURE__ */ new Map(), U5 = 1, q4 = function(t) { + if (q5.has(t)) + return q5.get(t); + for (; sT.has(U5); ) + U5++; + var e = U5++; if ({}.NODE_ENV !== "production" && ((0 | e) < 0 || e > 1073741824)) - throw Iy(16, "".concat(e)); - return Q3.set(t, e), oT.set(e, t), e; -}, aTe = function(t, e) { - V3 = e + 1, Q3.set(t, e), oT.set(e, t); -}, oTe = "style[".concat(dg, "][").concat(Iie, '="').concat(W_, '"]'), lTe = new RegExp("^".concat(dg, '\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')), cTe = function(t, e, r) { + throw Ly(16, "".concat(e)); + return q5.set(t, e), sT.set(e, t), e; +}, H3e = function(t, e) { + U5 = e + 1, q5.set(t, e), sT.set(e, t); +}, X3e = "style[".concat(cg, "][").concat(Eie, '="').concat(q_, '"]'), j3e = new RegExp("^".concat(cg, '\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')), Z3e = 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); -}, uTe = function(t, e) { - for (var r, n = ((r = e.textContent) !== null && r !== void 0 ? r : "").split(E$), i = [], s = 0, a = n.length; s < a; s++) { +}, K3e = function(t, e) { + for (var r, n = ((r = e.textContent) !== null && r !== void 0 ? r : "").split(g$), i = [], s = 0, a = n.length; s < a; s++) { var o = n[s].trim(); if (o) { - var l = o.match(lTe); + var l = o.match(j3e); if (l) { var u = 0 | parseInt(l[1], 10), h = l[2]; - u !== 0 && (aTe(h, u), cTe(t, h, l[3]), t.getTag().insertRules(u, i)), i.length = 0; + u !== 0 && (H3e(h, u), Z3e(t, h, l[3]), t.getTag().insertRules(u, i)), i.length = 0; } else i.push(o); } } }; -function hTe() { +function J3e() { return typeof __webpack_nonce__ < "u" ? __webpack_nonce__ : null; } -var Vie = function(t) { +var Nie = function(t) { var e = document.head, r = t || e, n = document.createElement("style"), i = function(o) { - var l = Array.from(o.querySelectorAll("style[".concat(dg, "]"))); + var l = Array.from(o.querySelectorAll("style[".concat(cg, "]"))); return l[l.length - 1]; }(r), s = i !== void 0 ? i.nextSibling : null; - n.setAttribute(dg, Nie), n.setAttribute(Iie, W_); - var a = hTe(); + n.setAttribute(cg, Cie), n.setAttribute(Eie, q_); + var a = J3e(); return a && n.setAttribute("nonce", a), r.insertBefore(n, s), n; -}, fTe = function() { +}, eTe = function() { function t(e) { - this.element = Vie(e), this.element.appendChild(document.createTextNode("")), this.sheet = function(r) { + this.element = Nie(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++) { @@ -1728,7 +1728,7 @@ var Vie = function(t) { if (a.ownerNode === r) return a; } - throw Iy(17); + throw Ly(17); }(this.element), this.length = 0; } return t.prototype.insertRule = function(e, r) { @@ -1743,9 +1743,9 @@ var Vie = function(t) { var r = this.sheet.cssRules[e]; return r && r.cssText ? r.cssText : ""; }, t; -}(), dTe = function() { +}(), tTe = function() { function t(e) { - this.element = Vie(e), this.nodes = this.element.childNodes, this.length = 0; + this.element = Nie(e), this.nodes = this.element.childNodes, this.length = 0; } return t.prototype.insertRule = function(e, r) { if (e <= this.length && e >= 0) { @@ -1758,7 +1758,7 @@ var Vie = function(t) { }, t.prototype.getRule = function(e) { return e < this.length ? this.nodes[e].textContent : ""; }, t; -}(), pTe = function() { +}(), rTe = function() { function t(e) { this.rules = [], this.length = 0; } @@ -1769,30 +1769,30 @@ var Vie = function(t) { }, t.prototype.getRule = function(e) { return e < this.length ? this.rules[e] : ""; }, t; -}(), EV = _$, gTe = { isServer: !_$, useCSSOMInjection: !U5e }, Wie = function() { +}(), pV = m$, nTe = { isServer: !m$, useCSSOMInjection: !R3e }, Iie = function() { function t(e, r, n) { - e === void 0 && (e = hv), r === void 0 && (r = {}); + e === void 0 && (e = ov), r === void 0 && (r = {}); var i = this; - this.options = Go(Go({}, gTe), e), this.gs = r, this.names = new Map(n), this.server = !!e.isServer, !this.server && _$ && EV && (EV = !1, function(s) { - for (var a = document.querySelectorAll(oTe), o = 0, l = a.length; o < l; o++) { + this.options = Vo(Vo({}, nTe), e), this.gs = r, this.names = new Map(n), this.server = !!e.isServer, !this.server && m$ && pV && (pV = !1, function(s) { + for (var a = document.querySelectorAll(X3e), o = 0, l = a.length; o < l; o++) { var u = a[o]; - u && u.getAttribute(dg) !== Nie && (uTe(s, u), u.parentNode && u.parentNode.removeChild(u)); + u && u.getAttribute(cg) !== Cie && (K3e(s, u), u.parentNode && u.parentNode.removeChild(u)); } - }(this)), R$(this, function() { + }(this)), y$(this, function() { return function(s) { for (var a = s.getTag(), o = a.length, l = "", u = function(f) { var d = function(y) { - return oT.get(y); + return sT.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(dg, ".g").concat(f, '[id="').concat(d, '"]'), v = ""; + var m = "".concat(cg, ".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(E$); + }), l += "".concat(g).concat(m, '{content:"').concat(v, '"}').concat(g$); }, h = 0; h < o; h++) u(h); return l; @@ -1800,190 +1800,190 @@ var Vie = function(t) { }); } return t.registerId = function(e) { - return V4(e); + return q4(e); }, t.prototype.reconstructWithOptions = function(e, r) { - return r === void 0 && (r = !0), new t(Go(Go({}, this.options), e), this.gs, r && this.names || void 0); + return r === void 0 && (r = !0), new t(Vo(Vo({}, 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 pTe(i) : n ? new fTe(i) : new dTe(i); - }(this.options), new sTe(e))); + return r.isServer ? new rTe(i) : n ? new eTe(i) : new tTe(i); + }(this.options), new G3e(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 (V4(e), this.names.has(e)) + if (q4(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(V4(e), n); + this.registerName(e, r), this.getTag().insertRules(q4(e), n); }, t.prototype.clearNames = function(e) { this.names.has(e) && this.names.get(e).clear(); }, t.prototype.clearRules = function(e) { - this.getTag().clearGroup(V4(e)), this.clearNames(e); + this.getTag().clearGroup(q4(e)), this.clearNames(e); }, t.prototype.clearTag = function() { this.tag = void 0; }, t; -}(), mTe = /&/g, vTe = /^\s*\/\/.*$/gm; -function Yie(t, e) { +}(), iTe = /&/g, sTe = /^\s*\/\/.*$/gm; +function $ie(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 = Yie(r.children, e)), r; + })), Array.isArray(r.children) && r.type !== "@keyframes" && (r.children = $ie(r.children, e)), r; }); } -function Gie(t) { - var e, r, n, i = t === void 0 ? hv : t, s = i.options, a = s === void 0 ? hv : s, o = i.plugins, l = o === void 0 ? Y_ : o, u = function(d, p, g) { +function Bie(t) { + var e, r, n, i = t === void 0 ? ov : t, s = i.options, a = s === void 0 ? ov : s, o = i.plugins, l = o === void 0 ? U_ : 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 === q_ && d.value.includes("&") && (d.props[0] = d.props[0].replace(mTe, r).replace(n, u)); - }), a.prefix && h.push(z5e), h.push($5e); + d.type === $_ && d.value.includes("&") && (d.props[0] = d.props[0].replace(iTe, r).replace(n, u)); + }), a.prefix && h.push(_3e), h.push(T3e); 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(vTe, ""), y = N5e(g || p ? "".concat(g, " ").concat(p, " { ").concat(v, " }") : v); - a.namespace && (y = Yie(y, a.namespace)); + var v = d.replace(sTe, ""), y = k3e(g || p ? "".concat(g, " ").concat(p, " { ").concat(v, " }") : v); + a.namespace && (y = $ie(y, a.namespace)); var b = []; - return aT(y, B5e(h.concat(F5e(function(w) { + return iT(y, C3e(h.concat(E3e(function(w) { return b.push(w); })))), b; }; return f.hash = l.length ? l.reduce(function(d, p) { - return p.name || Iy(15), T0(d, p.name); - }, $ie).toString() : "", f; + return p.name || Ly(15), w0(d, p.name); + }, _ie).toString() : "", f; } -var yTe = new Wie(), SM = Gie(), L$ = fg.createContext({ shouldForwardProp: void 0, styleSheet: yTe, stylis: SM }); -L$.Consumer; -var bTe = fg.createContext(void 0); -function TM() { - return Al(L$); +var aTe = new Iie(), bM = Bie(), b$ = lg.createContext({ shouldForwardProp: void 0, styleSheet: aTe, stylis: bM }); +b$.Consumer; +var oTe = lg.createContext(void 0); +function xM() { + return Cl(b$); } -function Hie(t) { - var e = na(t.stylisPlugins), r = e[0], n = e[1], i = TM().styleSheet, s = Fs(function() { +function Fie(t) { + var e = ra(t.stylisPlugins), r = e[0], n = e[1], i = xM().styleSheet, s = $s(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 = Fs(function() { - return Gie({ options: { namespace: t.namespace, prefix: t.enableVendorPrefixes }, plugins: r }); + }, [t.disableCSSOMInjection, t.sheet, t.target, i]), a = $s(function() { + return Bie({ options: { namespace: t.namespace, prefix: t.enableVendorPrefixes }, plugins: r }); }, [t.enableVendorPrefixes, t.namespace, r]); - ts(function() { - w5e(r, t.stylisPlugins) || n(t.stylisPlugins); + Ji(function() { + c3e(r, t.stylisPlugins) || n(t.stylisPlugins); }, [t.stylisPlugins]); - var o = Fs(function() { + var o = $s(function() { return { shouldForwardProp: t.shouldForwardProp, styleSheet: s, stylis: a }; }, [t.shouldForwardProp, s, a]); - return fg.createElement(L$.Provider, { value: o }, fg.createElement(bTe.Provider, { value: a }, t.children)); + return lg.createElement(b$.Provider, { value: o }, lg.createElement(oTe.Provider, { value: a }, t.children)); } -var _V = function() { +var gV = function() { function t(e, r) { var n = this; this.inject = function(i, s) { - s === void 0 && (s = SM); + s === void 0 && (s = bM); 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, R$(this, function() { - throw Iy(12, String(n.name)); + }, this.name = e, this.id = "sc-keyframes-".concat(e), this.rules = r, y$(this, function() { + throw Ly(12, String(n.name)); }); } return t.prototype.getName = function(e) { - return e === void 0 && (e = SM), this.name + e.hash; + return e === void 0 && (e = bM), this.name + e.hash; }, t; -}(), xTe = function(t) { +}(), lTe = function(t) { return t >= "A" && t <= "Z"; }; -function AV(t) { +function mV(t) { for (var e = "", r = 0; r < t.length; r++) { var n = t[r]; if (r === 1 && n === "-" && t[0] === "-") return t; - xTe(n) ? e += "-" + n.toLowerCase() : e += n; + lTe(n) ? e += "-" + n.toLowerCase() : e += n; } return e.startsWith("ms-") ? "-" + e : e; } -var Xie = function(t) { +var zie = function(t) { return t == null || t === !1 || t === ""; -}, jie = function(t) { +}, qie = function(t) { var e, r, n = []; for (var i in t) { var s = t[i]; - t.hasOwnProperty(i) && !Xie(s) && (Array.isArray(s) && s.isCss || fv(s) ? n.push("".concat(AV(i), ":"), s, ";") : dv(s) ? n.push.apply(n, lv(lv(["".concat(i, " {")], jie(s), !1), ["}"], !1)) : n.push("".concat(AV(i), ": ").concat((e = i, (r = s) == null || typeof r == "boolean" || r === "" ? "" : typeof r != "number" || r === 0 || e in q5e || e.startsWith("--") ? String(r).trim() : "".concat(r, "px")), ";"))); + t.hasOwnProperty(i) && !zie(s) && (Array.isArray(s) && s.isCss || lv(s) ? n.push("".concat(mV(i), ":"), s, ";") : cv(s) ? n.push.apply(n, iv(iv(["".concat(i, " {")], qie(s), !1), ["}"], !1)) : n.push("".concat(mV(i), ": ").concat((e = i, (r = s) == null || typeof r == "boolean" || r === "" ? "" : typeof r != "number" || r === 0 || e in A3e || e.startsWith("--") ? String(r).trim() : "".concat(r, "px")), ";"))); } return n; }; -function tg(t, e, r, n) { - if (Xie(t)) +function Z0(t, e, r, n) { + if (zie(t)) return []; - if (A$(t)) + if (v$(t)) return [".".concat(t.styledComponentId)]; - if (fv(t)) { - if (!fv(s = t) || s.prototype && s.prototype.isReactComponent || !e) + if (lv(t)) { + if (!lv(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 _V || dv(i) || i === null || console.error("".concat(Fie(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.")), tg(i, e, r, n); + return {}.NODE_ENV === "production" || typeof i != "object" || Array.isArray(i) || i instanceof gV || cv(i) || i === null || console.error("".concat(Rie(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.")), Z0(i, e, r, n); } var s; - return t instanceof _V ? r ? (t.inject(r, n), [t.getName(n)]) : [t] : dv(t) ? jie(t) : Array.isArray(t) ? Array.prototype.concat.apply(Y_, t.map(function(a) { - return tg(a, e, r, n); + return t instanceof gV ? r ? (t.inject(r, n), [t.getName(n)]) : [t] : cv(t) ? qie(t) : Array.isArray(t) ? Array.prototype.concat.apply(U_, t.map(function(a) { + return Z0(a, e, r, n); })) : [t.toString()]; } -function wTe(t) { +function cTe(t) { for (var e = 0; e < t.length; e += 1) { var r = t[e]; - if (fv(r) && !A$(r)) + if (lv(r) && !v$(r)) return !1; } return !0; } -var OTe = Bie(W_), kTe = function() { +var uTe = Aie(q_), hTe = function() { function t(e, r, n) { - this.rules = e, this.staticRulesId = "", this.isStatic = {}.NODE_ENV === "production" && (n === void 0 || n.isStatic) && wTe(e), this.componentId = r, this.baseHash = T0(OTe, r), this.baseStyle = n, Wie.registerId(r); + this.rules = e, this.staticRulesId = "", this.isStatic = {}.NODE_ENV === "production" && (n === void 0 || n.isStatic) && cTe(e), this.componentId = r, this.baseHash = w0(uTe, r), this.baseStyle = n, Iie.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 = F0(i, this.staticRulesId); + i = N0(i, this.staticRulesId); else { - var s = CV(tg(this.rules, e, r, n)), a = OM(T0(this.baseHash, s) >>> 0); + var s = dV(Z0(this.rules, e, r, n)), a = vM(w0(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 = F0(i, a), this.staticRulesId = a; + i = N0(i, a), this.staticRulesId = a; } else { - for (var l = T0(this.baseHash, n.hash), u = "", h = 0; h < this.rules.length; h++) { + for (var l = w0(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 = T0(l, f)); + u += f, {}.NODE_ENV !== "production" && (l = w0(l, f)); else if (f) { - var d = CV(tg(f, e, r, n)); - l = T0(l, d + h), u += d; + var d = dV(Z0(f, e, r, n)); + l = w0(l, d + h), u += d; } } if (u) { - var p = OM(l >>> 0); - r.hasNameForId(this.componentId, p) || r.insertRules(this.componentId, p, n(u, ".".concat(p), void 0, this.componentId)), i = F0(i, p); + var p = vM(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; -}(), Zie = fg.createContext(void 0); -Zie.Consumer; -var Y7 = {}, RV = /* @__PURE__ */ new Set(); -function STe(t, e, r) { - var n = A$(t), i = t, s = !W7(t), a = e.attrs, o = a === void 0 ? Y_ : a, l = e.componentId, u = l === void 0 ? function(O, S) { - var C = typeof O != "string" ? "sc" : wV(O); - Y7[C] = (Y7[C] || 0) + 1; - var T = "".concat(C, "-").concat(H5e(W_ + C + Y7[C])); +}(), Uie = lg.createContext(void 0); +Uie.Consumer; +var z7 = {}, vV = /* @__PURE__ */ new Set(); +function fTe(t, e, r) { + var n = v$(t), i = t, s = !F7(t), a = e.attrs, o = a === void 0 ? U_ : a, l = e.componentId, u = l === void 0 ? function(O, S) { + var C = typeof O != "string" ? "sc" : lV(O); + z7[C] = (z7[C] || 0) + 1; + var T = "".concat(C, "-").concat(I3e(q_ + C + z7[C])); return S ? "".concat(S, "-").concat(T) : T; }(e.displayName, e.parentComponentId) : l, h = e.displayName, f = h === void 0 ? function(O) { - return W7(O) ? "styled.".concat(O) : "Styled(".concat(Fie(O), ")"); - }(t) : h, d = e.displayName && e.componentId ? "".concat(wV(e.displayName), "-").concat(e.componentId) : e.componentId || u, p = n && i.attrs ? i.attrs.concat(o).filter(Boolean) : o, g = e.shouldForwardProp; + return F7(O) ? "styled.".concat(O) : "Styled(".concat(Rie(O), ")"); + }(t) : h, d = e.displayName && e.componentId ? "".concat(lV(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) { @@ -1994,46 +1994,46 @@ function STe(t, e, r) { } else g = m; } - var y = new kTe(r, d, n ? i.componentStyle : void 0); + var y = new hTe(r, d, n ? i.componentStyle : void 0); function b(O, S) { - return function(C, T, L) { - var E = C.attrs, P = C.componentStyle, M = C.defaultProps, N = C.foldedComponentIds, q = C.styledComponentId, k = C.target, B = fg.useContext(Zie), A = TM(), D = C.shouldForwardProp || A.shouldForwardProp; - ({}).NODE_ENV !== "production" && fM(q); + return function(C, T, D) { + var E = C.attrs, N = C.componentStyle, P = C.defaultProps, L = C.foldedComponentIds, F = C.styledComponentId, k = C.target, B = lg.useContext(Uie), A = xM(), M = C.shouldForwardProp || A.shouldForwardProp; + ({}).NODE_ENV !== "production" && oM(F); var I = function(re, pe, ne) { - for (var le, ge = Go(Go({}, pe), { className: void 0, theme: ne }), j = 0; j < re.length; j += 1) { - var oe = fv(le = re[j]) ? le(ge) : le; + for (var le, ge = Vo(Vo({}, pe), { className: void 0, theme: ne }), j = 0; j < re.length; j += 1) { + var oe = lv(le = re[j]) ? le(ge) : le; for (var ie in oe) - ge[ie] = ie === "className" ? F0(ge[ie], oe[ie]) : ie === "style" ? Go(Go({}, ge[ie]), oe[ie]) : oe[ie]; + ge[ie] = ie === "className" ? N0(ge[ie], oe[ie]) : ie === "style" ? Vo(Vo({}, ge[ie]), oe[ie]) : oe[ie]; } - return pe.className && (ge.className = F0(ge.className, pe.className)), ge; - }(E, T, V5e(T, B, M) || hv), z = I.as || k, Y = {}; + return pe.className && (ge.className = N0(ge.className, pe.className)), ge; + }(E, T, M3e(T, B, P) || ov), q = I.as || k, Y = {}; for (var W in I) - I[W] === void 0 || W[0] === "$" || W === "as" || W === "theme" || (W === "forwardedAs" ? Y.as = I.forwardedAs : D && !D(W, z) || (Y[W] = I[W], D || {}.NODE_ENV !== "development" || z3e(W) || RV.has(W) || !wM.has(z) || (RV.add(W), console.warn('styled-components: it looks like an unknown prop "'.concat(W, '" 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.)'))))); + I[W] === void 0 || W[0] === "$" || W === "as" || W === "theme" || (W === "forwardedAs" ? Y.as = I.forwardedAs : M && !M(W, q) || (Y[W] = I[W], M || {}.NODE_ENV !== "development" || _5e(W) || vV.has(W) || !mM.has(q) || (vV.add(W), console.warn('styled-components: it looks like an unknown prop "'.concat(W, '" 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 Z = function(re, pe) { - var ne = TM(), le = re.generateAndInjectStyles(pe, ne.styleSheet, ne.stylis); - return {}.NODE_ENV !== "production" && fM(le), le; - }(P, I); + var ne = xM(), le = re.generateAndInjectStyles(pe, ne.styleSheet, ne.stylis); + return {}.NODE_ENV !== "production" && oM(le), le; + }(N, I); ({}).NODE_ENV !== "production" && C.warnTooManyClasses && C.warnTooManyClasses(Z); - var K = F0(N, q); - return Z && (K += " " + Z), I.className && (K += " " + I.className), Y[W7(z) && !wM.has(z) ? "class" : "className"] = K, Y.ref = L, ph(z, Y); + var K = N0(L, F); + return Z && (K += " " + Z), I.className && (K += " " + I.className), Y[F7(q) && !mM.has(q) ? "class" : "className"] = K, Y.ref = D, hh(q, Y); }(w, O, S); } b.displayName = f; - var w = fg.forwardRef(b); - return w.attrs = p, w.componentStyle = y, w.displayName = f, w.shouldForwardProp = g, w.foldedComponentIds = n ? F0(i.foldedComponentIds, i.styledComponentId) : "", w.styledComponentId = d, w.target = n ? i.target : t, Object.defineProperty(w, "defaultProps", { get: function() { + var w = lg.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 L = 0, E = C; L < E.length; L++) - kM(S, E[L], !0); + for (var D = 0, E = C; D < E.length; D++) + yM(S, E[D], !0); return S; }({}, i.defaultProps, O) : O; - } }), {}.NODE_ENV !== "production" && (Q5e(f, d), w.warnTooManyClasses = function(O, S) { + } }), {}.NODE_ENV !== "production" && (L3e(f, d), w.warnTooManyClasses = function(O, S) { var C = {}, T = !1; - return function(L) { - if (!T && (C[L] = !0, Object.keys(C).length >= 200)) { + return function(D) { + if (!T && (C[D] = !0, Object.keys(C).length >= 200)) { var E = S ? ' with the id of "'.concat(S, '"') : ""; console.warn("Over ".concat(200, " classes were generated for component ").concat(O).concat(E, `. `) + `Consider using the attrs method, together with a style object for frequently changed styles. @@ -2047,67 +2047,67 @@ Example: `), T = !0, C = {}; } }; - }(f, d)), R$(w, function() { + }(f, d)), y$(w, function() { return ".".concat(w.styledComponentId); - }), s && Qie(w, t, { attrs: !0, componentStyle: !0, displayName: !0, foldedComponentIds: !0, shouldForwardProp: !0, styledComponentId: !0, target: !0 }), w; + }), s && Pie(w, t, { attrs: !0, componentStyle: !0, displayName: !0, foldedComponentIds: !0, shouldForwardProp: !0, styledComponentId: !0, target: !0 }), w; } -function LV(t, e) { +function yV(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 MV = function(t) { +var bV = function(t) { return Object.assign(t, { isCss: !0 }); }; -function Kie(t) { +function Qie(t) { for (var e = [], r = 1; r < arguments.length; r++) e[r - 1] = arguments[r]; - if (fv(t) || dv(t)) - return MV(tg(LV(Y_, lv([t], e, !0)))); + if (lv(t) || cv(t)) + return bV(Z0(yV(U_, iv([t], e, !0)))); var n = t; - return e.length === 0 && n.length === 1 && typeof n[0] == "string" ? tg(n) : MV(tg(LV(n, e))); + return e.length === 0 && n.length === 1 && typeof n[0] == "string" ? Z0(n) : bV(Z0(yV(n, e))); } -function CM(t, e, r) { - if (r === void 0 && (r = hv), !e) - throw Iy(1, e); +function wM(t, e, r) { + if (r === void 0 && (r = ov), !e) + throw Ly(1, e); var n = function(i) { for (var s = [], a = 1; a < arguments.length; a++) s[a - 1] = arguments[a]; - return t(e, r, Kie.apply(void 0, lv([i], s, !1))); + return t(e, r, Qie.apply(void 0, iv([i], s, !1))); }; return n.attrs = function(i) { - return CM(t, e, Go(Go({}, r), { attrs: Array.prototype.concat(r.attrs, i).filter(Boolean) })); + return wM(t, e, Vo(Vo({}, r), { attrs: Array.prototype.concat(r.attrs, i).filter(Boolean) })); }, n.withConfig = function(i) { - return CM(t, e, Go(Go({}, r), i)); + return wM(t, e, Vo(Vo({}, r), i)); }, n; } -var Jie = function(t) { - return CM(STe, t); -}, mr = Jie; -wM.forEach(function(t) { - mr[t] = Jie(t); +var Vie = function(t) { + return wM(fTe, t); +}, gr = Vie; +mM.forEach(function(t) { + gr[t] = Vie(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 W4 = "__sc-".concat(dg, "__"); -({}).NODE_ENV !== "production" && {}.NODE_ENV !== "test" && typeof window < "u" && (window[W4] || (window[W4] = 0), window[W4] === 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 U4 = "__sc-".concat(cg, "__"); +({}).NODE_ENV !== "production" && {}.NODE_ENV !== "test" && typeof window < "u" && (window[U4] || (window[U4] = 0), window[U4] === 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[W4] += 1); -let EM = [], ese = []; +See https://s-c.sh/2BAXzed for more info.`), window[U4] += 1); +let OM = [], Wie = []; (() => { let t = "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((e) => e ? parseInt(e, 36) : 1); for (let e = 0, r = 0; e < t.length; e++) - (e % 2 ? ese : EM).push(r = r + t[e]); + (e % 2 ? Wie : OM).push(r = r + t[e]); })(); -function TTe(t) { +function dTe(t) { if (t < 768) return !1; - for (let e = 0, r = EM.length; ; ) { + for (let e = 0, r = OM.length; ; ) { let n = e + r >> 1; - if (t < EM[n]) + if (t < OM[n]) r = n; - else if (t >= ese[n]) + else if (t >= Wie[n]) e = n + 1; else return !0; @@ -2115,25 +2115,25 @@ function TTe(t) { return !1; } } -function DV(t) { +function xV(t) { return t >= 127462 && t <= 127487; } -const PV = 8205; -function CTe(t, e, r = !0, n = !0) { - return (r ? tse : ETe)(t, e, n); +const wV = 8205; +function pTe(t, e, r = !0, n = !0) { + return (r ? Yie : gTe)(t, e, n); } -function tse(t, e, r) { +function Yie(t, e, r) { if (e == t.length) return e; - e && rse(t.charCodeAt(e)) && nse(t.charCodeAt(e - 1)) && e--; - let n = G7(t, e); - for (e += NV(n); e < t.length; ) { - let i = G7(t, e); - if (n == PV || i == PV || r && TTe(i)) - e += NV(i), n = i; - else if (DV(i)) { + e && Gie(t.charCodeAt(e)) && Hie(t.charCodeAt(e - 1)) && e--; + let n = q7(t, e); + for (e += OV(n); e < t.length; ) { + let i = q7(t, e); + if (n == wV || i == wV || r && dTe(i)) + e += OV(i), n = i; + else if (xV(i)) { let s = 0, a = e - 2; - for (; a >= 0 && DV(G7(t, a)); ) + for (; a >= 0 && xV(q7(t, a)); ) s++, a -= 2; if (s % 2 == 0) break; @@ -2143,29 +2143,29 @@ function tse(t, e, r) { } return e; } -function ETe(t, e, r) { +function gTe(t, e, r) { for (; e > 0; ) { - let n = tse(t, e - 2, r); + let n = Yie(t, e - 2, r); if (n < e) return n; e--; } return 0; } -function G7(t, e) { +function q7(t, e) { let r = t.charCodeAt(e); - if (!nse(r) || e + 1 == t.length) + if (!Hie(r) || e + 1 == t.length) return r; let n = t.charCodeAt(e + 1); - return rse(n) ? (r - 55296 << 10) + (n - 56320) + 65536 : r; + return Gie(n) ? (r - 55296 << 10) + (n - 56320) + 65536 : r; } -function rse(t) { +function Gie(t) { return t >= 56320 && t < 57344; } -function nse(t) { +function Hie(t) { return t >= 55296 && t < 56320; } -function NV(t) { +function OV(t) { return t < 65536 ? 1 : 2; } class nn { @@ -2180,24 +2180,24 @@ class nn { return this.lineInner(e, !0, 1, 0); } replace(e, r, n) { - [e, r] = pv(this, e, r); + [e, r] = uv(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), Qu.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), zu.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] = pv(this, e, r); + [e, r] = uv(this, e, r); let n = []; - return this.decompose(e, r, n, 0), Qu.from(n, r - e); + return this.decompose(e, r, n, 0), zu.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 sx(this), s = new sx(e); + let r = this.scanIdentical(e, 1), n = this.length - this.scanIdentical(e, -1), i = new nx(this), s = new nx(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; @@ -2206,10 +2206,10 @@ class nn { } } iter(e = 1) { - return new sx(this, e); + return new nx(this, e); } iterRange(e, r = this.length) { - return new ise(this, e, r); + return new Xie(this, e, r); } iterLines(e, r) { let n; @@ -2220,7 +2220,7 @@ class nn { 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 sse(n); + return new jie(n); } toString() { return this.sliceString(0); @@ -2234,11 +2234,11 @@ class nn { static of(e) { if (e.length == 0) throw new RangeError("A document must have at least one line"); - return e.length == 1 && !e[0] ? nn.empty : e.length <= 32 ? new Ii(e) : Qu.from(Ii.split(e, [])); + return e.length == 1 && !e[0] ? nn.empty : e.length <= 32 ? new Ni(e) : zu.from(Ni.split(e, [])); } } -class Ii extends nn { - constructor(e, r = _Te(e)) { +class Ni extends nn { + constructor(e, r = mTe(e)) { super(), this.text = e, this.length = r; } get lines() { @@ -2251,33 +2251,33 @@ class Ii extends nn { for (let s = 0; ; s++) { let a = this.text[s], o = i + a.length; if ((r ? n : o) >= e) - return new ATe(i, o, n, a); + return new vTe(i, o, n, a); i = o + 1, n++; } } decompose(e, r, n, i) { - let s = e <= 0 && r >= this.length ? this : new Ii(IV(this.text, e, r), Math.min(r, this.length) - Math.max(0, e)); + let s = e <= 0 && r >= this.length ? this : new Ni(kV(this.text, e, r), Math.min(r, this.length) - Math.max(0, e)); if (i & 1) { - let a = n.pop(), o = W3(s.text, a.text.slice(), 0, s.length); + let a = n.pop(), o = Q5(s.text, a.text.slice(), 0, s.length); if (o.length <= 32) - n.push(new Ii(o, a.length + s.length)); + n.push(new Ni(o, a.length + s.length)); else { let l = o.length >> 1; - n.push(new Ii(o.slice(0, l)), new Ii(o.slice(l))); + n.push(new Ni(o.slice(0, l)), new Ni(o.slice(l))); } } else n.push(s); } replace(e, r, n) { - if (!(n instanceof Ii)) + if (!(n instanceof Ni)) return super.replace(e, r, n); - [e, r] = pv(this, e, r); - let i = W3(this.text, W3(n.text, IV(this.text, 0, e)), r), s = this.length + n.length - (r - e); - return i.length <= 32 ? new Ii(i, s) : Qu.from(Ii.split(i, []), s); + [e, r] = uv(this, e, r); + let i = Q5(this.text, Q5(n.text, kV(this.text, 0, e)), r), s = this.length + n.length - (r - e); + return i.length <= 32 ? new Ni(i, s) : zu.from(Ni.split(i, []), s); } sliceString(e, r = this.length, n = ` `) { - [e, r] = pv(this, e, r); + [e, r] = uv(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; @@ -2295,11 +2295,11 @@ class Ii extends nn { 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 Ii(n, i)), n = [], i = -1); - return i > -1 && r.push(new Ii(n, i)), r; + n.push(s), i += s.length + 1, n.length == 32 && (r.push(new Ni(n, i)), n = [], i = -1); + return i > -1 && r.push(new Ni(n, i)), r; } } -class Qu extends nn { +class zu extends nn { constructor(e, r) { super(), this.children = e, this.length = r, this.lines = 0; for (let n of e) @@ -2324,14 +2324,14 @@ class Qu extends nn { } } replace(e, r, n) { - if ([e, r] = pv(this, e, r), n.lines < this.lines) + if ([e, r] = uv(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 Qu(h, this.length - (r - e) + n.length); + return h[i] = l, new zu(h, this.length - (r - e) + n.length); } return super.replace(s, o, l); } @@ -2341,7 +2341,7 @@ class Qu extends nn { } sliceString(e, r = this.length, n = ` `) { - [e, r] = pv(this, e, r); + [e, r] = uv(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; @@ -2354,7 +2354,7 @@ class Qu extends nn { r.flatten(e); } scanIdentical(e, r) { - if (!(e instanceof Qu)) + if (!(e instanceof zu)) 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) { @@ -2374,49 +2374,49 @@ class Qu extends nn { let p = []; for (let g of e) g.flatten(p); - return new Ii(p, r); + return new Ni(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 Qu) + if (p.lines > s && p instanceof zu) for (let m of p.children) f(m); else - p.lines > a && (l > a || !l) ? (d(), o.push(p)) : p instanceof Ii && l && (g = h[h.length - 1]) instanceof Ii && p.lines + g.lines <= 32 ? (l += p.lines, u += p.length + 1, h[h.length - 1] = new Ii(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 Ni && l && (g = h[h.length - 1]) instanceof Ni && p.lines + g.lines <= 32 ? (l += p.lines, u += p.length + 1, h[h.length - 1] = new Ni(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] : Qu.from(h, u)), u = -1, l = h.length = 0); + l != 0 && (o.push(h.length == 1 ? h[0] : zu.from(h, u)), u = -1, l = h.length = 0); } for (let p of e) f(p); - return d(), o.length == 1 ? o[0] : new Qu(o, r); + return d(), o.length == 1 ? o[0] : new zu(o, r); } } -nn.empty = /* @__PURE__ */ new Ii([""], 0); -function _Te(t) { +nn.empty = /* @__PURE__ */ new Ni([""], 0); +function mTe(t) { let e = -1; for (let r of t) e += r.length + 1; return e; } -function W3(t, e, r = 0, n = 1e9) { +function Q5(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 IV(t, e, r) { - return W3(t, [""], e, r); +function kV(t, e, r) { + return Q5(t, [""], e, r); } -class sx { +class nx { 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 Ii ? 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 Ni ? 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 Ii ? 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 Ni ? i.text.length : i.children.length; if (a == (r > 0 ? o : 0)) { if (n == 0) return this.done = !0, this.value = "", this; @@ -2426,14 +2426,14 @@ class sx { return this.lineBreak = !0, this.value = ` `, this; e--; - } else if (i instanceof Ii) { + } else if (i instanceof Ni) { 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 Ii ? 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 Ni ? l.text.length : l.children.length) << 1)); } } } @@ -2441,9 +2441,9 @@ class sx { return e < 0 && (this.nextInner(-e, -this.dir), e = this.value.length), this.nextInner(e, this.dir); } } -class ise { +class Xie { constructor(e, r, n) { - this.value = "", this.done = !1, this.cursor = new sx(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 nx(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) @@ -2461,7 +2461,7 @@ class ise { return this.cursor.lineBreak && this.value != ""; } } -class sse { +class jie { constructor(e) { this.inner = e, this.afterBreak = !0, this.value = "", this.done = !1; } @@ -2475,10 +2475,10 @@ class sse { } typeof Symbol < "u" && (nn.prototype[Symbol.iterator] = function() { return this.iter(); -}, sx.prototype[Symbol.iterator] = ise.prototype[Symbol.iterator] = sse.prototype[Symbol.iterator] = function() { +}, nx.prototype[Symbol.iterator] = Xie.prototype[Symbol.iterator] = jie.prototype[Symbol.iterator] = function() { return this; }); -class ATe { +class vTe { constructor(e, r, n, i) { this.from = e, this.to = r, this.number = n, this.text = i; } @@ -2486,36 +2486,36 @@ class ATe { return this.to - this.from; } } -function pv(t, e, r) { +function uv(t, e, r) { return e = Math.max(0, Math.min(t.length, e)), [e, Math.max(e, Math.min(t.length, r))]; } -function la(t, e, r = !0, n = !0) { - return CTe(t, e, r, n); +function oa(t, e, r = !0, n = !0) { + return pTe(t, e, r, n); } -function RTe(t) { +function yTe(t) { return t >= 56320 && t < 57344; } -function LTe(t) { +function bTe(t) { return t >= 55296 && t < 56320; } -function Gl(t, e) { +function Vl(t, e) { let r = t.charCodeAt(e); - if (!LTe(r) || e + 1 == t.length) + if (!bTe(r) || e + 1 == t.length) return r; let n = t.charCodeAt(e + 1); - return RTe(n) ? (r - 55296 << 10) + (n - 56320) + 65536 : r; + return yTe(n) ? (r - 55296 << 10) + (n - 56320) + 65536 : r; } -function M$(t) { +function x$(t) { return t <= 65535 ? String.fromCharCode(t) : (t -= 65536, String.fromCharCode((t >> 10) + 55296, (t & 1023) + 56320)); } -function sf(t) { +function nf(t) { return t < 65536 ? 1 : 2; } -const _M = /\r\n?|\n/; +const kM = /\r\n?|\n/; var gi = /* @__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; }(gi || (gi = {})); -class ah { +class nh { constructor(e) { this.sections = e; } @@ -2543,7 +2543,7 @@ class ah { } } iterChangedRanges(e, r = !1) { - AM(this, e, r); + SM(this, e, r); } get invertedDesc() { let e = []; @@ -2551,13 +2551,13 @@ class ah { let n = this.sections[r++], i = this.sections[r++]; i < 0 ? e.push(n, i) : e.push(i, n); } - return new ah(e); + return new nh(e); } composeDesc(e) { - return this.empty ? e : e.empty ? this : ase(this, e); + return this.empty ? e : e.empty ? this : Zie(this, e); } mapDesc(e, r = !1) { - return e.empty ? this : RM(this, e, r); + return e.empty ? this : TM(this, e, r); } mapPos(e, r = -1, n = gi.Simple) { let i = 0, s = 0; @@ -2603,23 +2603,23 @@ class ah { 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 ah(e); + return new nh(e); } static create(e) { - return new ah(e); + return new nh(e); } } -class Hi extends ah { +class Gi extends nh { 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 AM(this, (r, n, i, s, a) => e = e.replace(i, i + (n - r), a), !1), e; + return SM(this, (r, n, i, s, a) => e = e.replace(i, i + (n - r), a), !1), e; } mapDesc(e, r = !1) { - return RM(this, e, r, !0); + return TM(this, e, r, !0); } invert(e) { let r = this.sections.slice(), n = []; @@ -2634,22 +2634,22 @@ class Hi extends ah { } s += a; } - return new Hi(r, n); + return new Gi(r, n); } compose(e) { - return this.empty ? e : e.empty ? this : ase(this, e, !0); + return this.empty ? e : e.empty ? this : Zie(this, e, !0); } map(e, r = !1) { - return e.empty ? this : RM(this, e, r, !0); + return e.empty ? this : TM(this, e, r, !0); } iterChanges(e, r = !1) { - AM(this, e, r); + SM(this, e, r); } get desc() { - return ah.create(this.sections); + return nh.create(this.sections); } filter(e) { - let r = [], n = [], i = [], s = new Bx(this); + let r = [], n = [], i = [], s = new Ix(this); e: for (let a = 0, o = 0; ; ) { let l = a == e.length ? 1e9 : e[a++]; @@ -2657,21 +2657,21 @@ class Hi extends ah { if (s.done) break e; let h = Math.min(s.len, l - o); - Da(i, h, -1); + La(i, h, -1); let f = s.ins == -1 ? -1 : s.off == 0 ? s.ins : 0; - Da(r, h, f), f > 0 && Md(n, r, s.text), s.forward(h), o += h; + La(r, h, f), f > 0 && Ad(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); - Da(r, h, -1), Da(i, h, s.ins == -1 ? -1 : s.off == 0 ? s.ins : 0), s.forward(h), o += h; + La(r, h, -1), La(i, h, s.ins == -1 ? -1 : s.off == 0 ? s.ins : 0), s.forward(h), o += h; } } return { - changes: new Hi(r, n), - filtered: ah.create(i) + changes: new Gi(r, n), + filtered: nh.create(i) }; } toJSON() { @@ -2687,15 +2687,15 @@ class Hi extends ah { function l(h = !1) { if (!h && !i.length) return; - a < r && Da(i, r - a, -1); - let f = new Hi(i, s); + a < r && La(i, r - a, -1); + let f = new Gi(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 Hi) { + else if (h instanceof Gi) { 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; @@ -2703,16 +2703,16 @@ class Hi extends ah { 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" ? nn.of(p.split(n || _M)) : p : nn.empty, m = g.length; + let g = p ? typeof p == "string" ? nn.of(p.split(n || kM)) : p : nn.empty, m = g.length; if (f == d && m == 0) return; - f < a && l(), f > a && Da(i, f - a, -1), Da(i, d - f, m), Md(s, i, g), a = d; + f < a && l(), f > a && La(i, f - a, -1), La(i, d - f, m), Ad(s, i, g), a = d; } } return u(e), l(!o), o; } static empty(e) { - return new Hi(e ? [e, -1] : [], []); + return new Gi(e ? [e, -1] : [], []); } static fromJSON(e) { if (!Array.isArray(e)) @@ -2734,19 +2734,19 @@ class Hi extends ah { } } } - return new Hi(r, n); + return new Gi(r, n); } static createSet(e, r) { - return new Hi(e, r); + return new Gi(e, r); } } -function Da(t, e, r, n = !1) { +function La(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 : i >= 0 && e == 0 && t[i] == 0 ? t[i + 1] += r : n ? (t[i] += e, t[i + 1] += r) : t.push(e, r); } -function Md(t, e, r) { +function Ad(t, e, r) { if (r.length == 0) return; let n = e.length - 2 >> 1; @@ -2758,7 +2758,7 @@ function Md(t, e, r) { t.push(r); } } -function AM(t, e, r) { +function SM(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++]; @@ -2772,19 +2772,19 @@ function AM(t, e, r) { } } } -function RM(t, e, r, n = !1) { - let i = [], s = n ? [] : null, a = new Bx(t), o = new Bx(e); +function TM(t, e, r, n = !1) { + let i = [], s = n ? [] : null, a = new Ix(t), o = new Ix(e); for (let l = -1; ; ) { if (a.done && o.len || o.done && a.len) throw new Error("Mismatched change set lengths"); if (a.ins == -1 && o.ins == -1) { let u = Math.min(a.len, o.len); - Da(i, u, -1), a.forward(u), o.forward(u); + La(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 (Da(i, o.ins, -1); u; ) { + for (La(i, o.ins, -1); u; ) { let h = Math.min(a.len, u); - a.ins >= 0 && l < a.i && a.len <= h && (Da(i, 0, a.ins), s && Md(s, i, a.text), l = a.i), a.forward(h), u -= h; + a.ins >= 0 && l < a.i && a.len <= h && (La(i, 0, a.ins), s && Ad(s, i, a.text), l = a.i), a.forward(h), u -= h; } o.next(); } else if (a.ins >= 0) { @@ -2797,23 +2797,23 @@ function RM(t, e, r, n = !1) { h -= o.len, o.next(); else break; - Da(i, u, l < a.i ? a.ins : 0), s && l < a.i && Md(s, i, a.text), l = a.i, a.forward(a.len - h); + La(i, u, l < a.i ? a.ins : 0), s && l < a.i && Ad(s, i, a.text), l = a.i, a.forward(a.len - h); } else { if (a.done && o.done) - return s ? Hi.createSet(i, s) : ah.create(i); + return s ? Gi.createSet(i, s) : nh.create(i); throw new Error("Mismatched change set lengths"); } } } -function ase(t, e, r = !1) { - let n = [], i = r ? [] : null, s = new Bx(t), a = new Bx(e); +function Zie(t, e, r = !1) { + let n = [], i = r ? [] : null, s = new Ix(t), a = new Ix(e); for (let o = !1; ; ) { if (s.done && a.done) - return i ? Hi.createSet(n, i) : ah.create(n); + return i ? Gi.createSet(n, i) : nh.create(n); if (s.ins == 0) - Da(n, s.len, 0, o), s.next(); + La(n, s.len, 0, o), s.next(); else if (a.len == 0 && !a.done) - Da(n, 0, a.ins, o), i && Md(i, n, a.text), a.next(); + La(n, 0, a.ins, o), i && Ad(i, n, a.text), a.next(); else { if (s.done || a.done) throw new Error("Mismatched change set lengths"); @@ -2821,15 +2821,15 @@ function ase(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; - Da(n, l, h, o), i && h && Md(i, n, a.text); + La(n, l, h, o), i && h && Ad(i, n, a.text); } else - a.ins == -1 ? (Da(n, s.off ? 0 : s.len, l, o), i && Md(i, n, s.textBit(l))) : (Da(n, s.off ? 0 : s.len, a.off ? 0 : a.ins, o), i && !a.off && Md(i, n, a.text)); + a.ins == -1 ? (La(n, s.off ? 0 : s.len, l, o), i && Ad(i, n, s.textBit(l))) : (La(n, s.off ? 0 : s.len, a.off ? 0 : a.ins, o), i && !a.off && Ad(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 Bx { +class Ix { constructor(e) { this.set = e, this.i = 0, this.next(); } @@ -2858,7 +2858,7 @@ class Bx { this.ins == -1 ? this.forward(e) : e == this.ins ? this.next() : (this.ins -= e, this.off += e); } } -class z0 { +class I0 { constructor(e, r, n) { this.from = e, this.to = r, this.flags = n; } @@ -2884,7 +2884,7 @@ class z0 { } 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 z0(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) @@ -2904,7 +2904,7 @@ class z0 { return ft.range(e.anchor, e.head); } static create(e, r, n) { - return new z0(e, r, n); + return new I0(e, r, n); } } class ft { @@ -2941,7 +2941,7 @@ class ft { 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 ft(e.ranges.map((r) => z0.fromJSON(r)), e.main); + return new ft(e.ranges.map((r) => I0.fromJSON(r)), e.main); } static single(e, r = e) { return new ft([ft.range(e, r)], 0); @@ -2958,11 +2958,11 @@ class ft { return new ft(e, r); } static cursor(e, r = 0, n, i) { - return z0.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 ? z0.create(r, e, 48 | s) : z0.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]; @@ -2977,45 +2977,45 @@ class ft { return new ft(e, r); } } -function ose(t, e) { +function Kie(t, e) { for (let r of t.ranges) if (r.to > e) throw new RangeError("Selection points outside of document"); } -let D$ = 0; +let w$ = 0; class Gt { constructor(e, r, n, i, s) { - this.combine = e, this.compareInput = r, this.compare = n, this.isStatic = i, this.id = D$++, 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 = w$++, this.default = e([]), this.extensions = typeof s == "function" ? s(this) : s; } get reader() { return this; } static define(e = {}) { - return new Gt(e.combine || ((r) => r), e.compareInput || ((r, n) => r === n), e.compare || (e.combine ? (r, n) => r === n : P$), !!e.static, e.enables); + return new Gt(e.combine || ((r) => r), e.compareInput || ((r, n) => r === n), e.compare || (e.combine ? (r, n) => r === n : O$), !!e.static, e.enables); } of(e) { - return new Y3([], this, 0, e); + return new V5([], this, 0, e); } compute(e, r) { if (this.isStatic) throw new Error("Can't compute a static facet"); - return new Y3(e, this, 1, r); + return new V5(e, this, 1, r); } computeN(e, r) { if (this.isStatic) throw new Error("Can't compute a static facet"); - return new Y3(e, this, 2, r); + return new V5(e, this, 2, r); } from(e, r) { return r || (r = (n) => n), this.compute([e], (n) => r(n.field(e))); } } -function P$(t, e) { +function O$(t, e) { return t == e || t.length == e.length && t.every((r, n) => r === e[n]); } -class Y3 { +class V5 { constructor(e, r, n, i) { - this.dependencies = e, this.facet = r, this.type = n, this.value = i, this.id = D$++; + this.dependencies = e, this.facet = r, this.type = n, this.value = i, this.id = w$++; } dynamicSlot(e) { var r; @@ -3027,9 +3027,9 @@ class Y3 { return f.values[a] = n(f), 1; }, update(f, d) { - if (l && d.docChanged || u && (d.docChanged || d.selection) || LM(f, h)) { + if (l && d.docChanged || u && (d.docChanged || d.selection) || CM(f, h)) { let p = n(f); - if (o ? !$V(p, f.values[a], i) : !i(p, f.values[a])) + if (o ? !SV(p, f.values[a], i) : !i(p, f.values[a])) return f.values[a] = p, 1; } return 0; @@ -3037,8 +3037,8 @@ class Y3 { reconfigure: (f, d) => { let p, g = d.config.address[s]; if (g != null) { - let m = cT(d, g); - if (this.dependencies.every((v) => v instanceof Gt ? d.facet(v) === f.facet(v) : v instanceof ai ? d.field(v, !1) == f.field(v, !1) : !0) || (o ? $V(p = n(f), m, i) : i(p = n(f), m))) + let m = oT(d, g); + if (this.dependencies.every((v) => v instanceof Gt ? d.facet(v) === f.facet(v) : v instanceof ai ? d.field(v, !1) == f.field(v, !1) : !0) || (o ? SV(p = n(f), m, i) : i(p = n(f), m))) return f.values[a] = m, 0; } else p = n(f); @@ -3047,7 +3047,7 @@ class Y3 { }; } } -function $V(t, e, r) { +function SV(t, e, r) { if (t.length != e.length) return !1; for (let n = 0; n < t.length; n++) @@ -3055,18 +3055,18 @@ function $V(t, e, r) { return !1; return !0; } -function LM(t, e) { +function CM(t, e) { let r = !1; for (let n of e) - ax(t, n) & 1 && (r = !0); + ix(t, n) & 1 && (r = !0); return r; } -function MTe(t, e, r) { +function xTe(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 = cT(l, n[h]); + let f = oT(l, n[h]); if (i[h] == 2) for (let d of f) u.push(d); @@ -3078,35 +3078,35 @@ function MTe(t, e, r) { return { create(l) { for (let u of n) - ax(l, u); + ix(l, u); return l.values[a] = o(l), 1; }, update(l, u) { - if (!LM(l, s)) + if (!CM(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 = LM(l, n), f = u.config.facets[e.id], d = u.facet(e); - if (f && !h && P$(r, f)) + let h = CM(l, n), f = u.config.facets[e.id], d = u.facet(e); + if (f && !h && O$(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 Y4 = /* @__PURE__ */ Gt.define({ static: !0 }); +const Q4 = /* @__PURE__ */ Gt.define({ static: !0 }); class ai { 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 ai(D$++, e.create, e.update, e.compare || ((n, i) => n === i), e); + let r = new ai(w$++, 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(Y4).find((n) => n.field == this); + let r = e.facet(Q4).find((n) => n.field == this); return ((r == null ? void 0 : r.create) || this.createF)(e); } slot(e) { @@ -3118,51 +3118,51 @@ class ai { return this.compareF(s, a) ? 0 : (n.values[r] = a, 1); }, reconfigure: (n, i) => { - let s = n.facet(Y4), a = i.facet(Y4), o; + let s = n.facet(Q4), a = i.facet(Q4), o; return (o = s.find((l) => l.field == this)) && o != a.find((l) => l.field == this) ? (n.values[r] = o.create(n), 1) : i.config.address[this.id] != null ? (n.values[r] = i.field(this), 0) : (n.values[r] = this.create(n), 1); } }; } init(e) { - return [this, Y4.of({ field: this, create: e })]; + return [this, Q4.of({ field: this, create: e })]; } get extension() { return this; } } -const C0 = { lowest: 4, low: 3, default: 2, high: 1, highest: 0 }; -function B2(t) { - return (e) => new lse(e, t); +const O0 = { lowest: 4, low: 3, default: 2, high: 1, highest: 0 }; +function P2(t) { + return (e) => new Jie(e, t); } -const Va = { - highest: /* @__PURE__ */ B2(C0.highest), - high: /* @__PURE__ */ B2(C0.high), - default: /* @__PURE__ */ B2(C0.default), - low: /* @__PURE__ */ B2(C0.low), - lowest: /* @__PURE__ */ B2(C0.lowest) +const qa = { + highest: /* @__PURE__ */ P2(O0.highest), + high: /* @__PURE__ */ P2(O0.high), + default: /* @__PURE__ */ P2(O0.default), + low: /* @__PURE__ */ P2(O0.low), + lowest: /* @__PURE__ */ P2(O0.lowest) }; -class lse { +class Jie { constructor(e, r) { this.inner = e, this.prec = r; } } -class jf { +class Hf { of(e) { - return new MM(this, e); + return new EM(this, e); } reconfigure(e) { - return jf.reconfigure.of({ compartment: this, extension: e }); + return Hf.reconfigure.of({ compartment: this, extension: e }); } get(e) { return e.config.compartments.get(this); } } -class MM { +class EM { constructor(e, r) { this.compartment = e, this.inner = r; } } -class lT { +class aT { 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); @@ -3173,7 +3173,7 @@ class lT { } static resolve(e, r, n) { let i = [], s = /* @__PURE__ */ Object.create(null), a = /* @__PURE__ */ new Map(); - for (let d of DTe(e, r, a)) + for (let d of wTe(e, r, a)) d instanceof ai ? 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) @@ -3182,7 +3182,7 @@ class lT { 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, P$(m, p)) + if (o[g.id] = l.length << 1 | 1, O$(m, p)) l.push(n.facet(g)); else { let v = g.combine(p.map((y) => y.value)); @@ -3191,14 +3191,14 @@ class lT { 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) => MTe(v, g, p)); + o[g.id] = u.length << 1, u.push((v) => xTe(v, g, p)); } } let f = u.map((d) => d(o)); - return new lT(e, a, f, o, l, s); + return new aT(e, a, f, o, l, s); } } -function DTe(t, e, r) { +function wTe(t, e, r) { let n = [[], [], [], [], []], i = /* @__PURE__ */ new Map(); function s(a, o) { let l = i.get(a); @@ -3206,22 +3206,22 @@ function DTe(t, e, r) { if (l <= o) return; let u = n[l].indexOf(a); - u > -1 && n[l].splice(u, 1), a instanceof MM && r.delete(a.compartment); + u > -1 && n[l].splice(u, 1), a instanceof EM && r.delete(a.compartment); } if (i.set(a, o), Array.isArray(a)) for (let u of a) s(u, o); - else if (a instanceof MM) { + else if (a instanceof EM) { 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 lse) + } else if (a instanceof Jie) s(a.inner, a.prec); else if (a instanceof ai) n[o].push(a), a.provides && s(a.provides, o); - else if (a instanceof Y3) - n[o].push(a), a.facet.extensions && s(a.facet.extensions, C0.default); + else if (a instanceof V5) + n[o].push(a), a.facet.extensions && s(a.facet.extensions, O0.default); else { let u = a.extension; if (!u) @@ -3229,9 +3229,9 @@ function DTe(t, e, r) { s(u, o); } } - return s(t, C0.default), n.reduce((a, o) => a.concat(o)); + return s(t, O0.default), n.reduce((a, o) => a.concat(o)); } -function ax(t, e) { +function ix(t, e) { if (e & 1) return 2; let r = e >> 1, n = t.status[r]; @@ -3243,32 +3243,32 @@ function ax(t, e) { let i = t.computeSlot(t, t.config.dynamicSlots[r]); return t.status[r] = 2 | i; } -function cT(t, e) { +function oT(t, e) { return e & 1 ? t.config.staticValues[e >> 1] : t.values[e >> 1]; } -const cse = /* @__PURE__ */ Gt.define(), DM = /* @__PURE__ */ Gt.define({ +const ese = /* @__PURE__ */ Gt.define(), _M = /* @__PURE__ */ Gt.define({ combine: (t) => t.some((e) => e), static: !0 -}), use = /* @__PURE__ */ Gt.define({ +}), tse = /* @__PURE__ */ Gt.define({ combine: (t) => t.length ? t[0] : void 0, static: !0 -}), hse = /* @__PURE__ */ Gt.define(), fse = /* @__PURE__ */ Gt.define(), dse = /* @__PURE__ */ Gt.define(), pse = /* @__PURE__ */ Gt.define({ +}), rse = /* @__PURE__ */ Gt.define(), nse = /* @__PURE__ */ Gt.define(), ise = /* @__PURE__ */ Gt.define(), sse = /* @__PURE__ */ Gt.define({ combine: (t) => t.length ? t[0] : !1 }); -class Oo { +class bo { constructor(e, r) { this.type = e, this.value = r; } static define() { - return new PTe(); + return new OTe(); } } -class PTe { +class OTe { of(e) { - return new Oo(this, e); + return new bo(this, e); } } -class NTe { +class kTe { constructor(e) { this.map = e; } @@ -3288,7 +3288,7 @@ class _r { return this.type == e; } static define(e = {}) { - return new NTe(e.map || ((r) => r)); + return new kTe(e.map || ((r) => r)); } static mapEffects(e, r) { if (!e.length) @@ -3303,12 +3303,12 @@ class _r { } _r.reconfigure = /* @__PURE__ */ _r.define(); _r.appendConfig = /* @__PURE__ */ _r.define(); -class zi { +class Fi { 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 && ose(n, r.newLength), s.some((o) => o.type == zi.time) || (this.annotations = s.concat(zi.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 && Kie(n, r.newLength), s.some((o) => o.type == Fi.time) || (this.annotations = s.concat(Fi.time.of(Date.now()))); } static create(e, r, n, i, s, a) { - return new zi(e, r, n, i, s, a); + return new Fi(e, r, n, i, s, a); } get newDoc() { return this._doc || (this._doc = this.changes.apply(this.startState.doc)); @@ -3331,15 +3331,15 @@ class zi { return this.startState.config != this.state.config; } isUserEvent(e) { - let r = this.annotation(zi.userEvent); + let r = this.annotation(Fi.userEvent); return !!(r && (r == e || r.length > e.length && r.slice(0, e.length) == e && r[e.length] == ".")); } } -zi.time = /* @__PURE__ */ Oo.define(); -zi.userEvent = /* @__PURE__ */ Oo.define(); -zi.addToHistory = /* @__PURE__ */ Oo.define(); -zi.remote = /* @__PURE__ */ Oo.define(); -function ITe(t, e) { +Fi.time = /* @__PURE__ */ bo.define(); +Fi.userEvent = /* @__PURE__ */ bo.define(); +Fi.addToHistory = /* @__PURE__ */ bo.define(); +Fi.remote = /* @__PURE__ */ bo.define(); +function STe(t, e) { let r = []; for (let n = 0, i = 0; ; ) { let s, a; @@ -3352,10 +3352,10 @@ function ITe(t, e) { !r.length || r[r.length - 1] < s ? r.push(s, a) : r[r.length - 1] < a && (r[r.length - 1] = a); } } -function gse(t, e, r) { +function ase(t, e, r) { var n; let i, s, a; - return r ? (i = e.changes, s = Hi.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 = Gi.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: _r.mapEffects(t.effects, i).concat(_r.mapEffects(e.effects, s)), @@ -3363,90 +3363,90 @@ function gse(t, e, r) { scrollIntoView: t.scrollIntoView || e.scrollIntoView }; } -function PM(t, e, r) { - let n = e.selection, i = D1(e.annotations); - return e.userEvent && (i = i.concat(zi.userEvent.of(e.userEvent))), { - changes: e.changes instanceof Hi ? e.changes : Hi.of(e.changes || [], r, t.facet(use)), +function AM(t, e, r) { + let n = e.selection, i = A1(e.annotations); + return e.userEvent && (i = i.concat(Fi.userEvent.of(e.userEvent))), { + changes: e.changes instanceof Gi ? e.changes : Gi.of(e.changes || [], r, t.facet(tse)), selection: n && (n instanceof ft ? n : ft.single(n.anchor, n.head)), - effects: D1(e.effects), + effects: A1(e.effects), annotations: i, scrollIntoView: !!e.scrollIntoView }; } -function mse(t, e, r) { - let n = PM(t, e.length ? e[0] : {}, t.doc.length); +function ose(t, e, r) { + let n = AM(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 = gse(n, PM(t, e[s], a ? n.changes.newLength : t.doc.length), a); + n = ase(n, AM(t, e[s], a ? n.changes.newLength : t.doc.length), a); } - let i = zi.create(t, n.changes, n.selection, n.effects, n.annotations, n.scrollIntoView); - return BTe(r ? $Te(i) : i); + let i = Fi.create(t, n.changes, n.selection, n.effects, n.annotations, n.scrollIntoView); + return CTe(r ? TTe(i) : i); } -function $Te(t) { +function TTe(t) { let e = t.startState, r = !0; - for (let i of e.facet(hse)) { + for (let i of e.facet(rse)) { let s = i(t); if (s === !1) { r = !1; break; } - Array.isArray(s) && (r = r === !0 ? s : ITe(r, s)); + Array.isArray(s) && (r = r === !0 ? s : STe(r, s)); } if (r !== !0) { let i, s; if (r === !1) - s = t.changes.invertedDesc, i = Hi.empty(e.doc.length); + s = t.changes.invertedDesc, i = Gi.empty(e.doc.length); else { let a = t.changes.filter(r); i = a.changes, s = a.filtered.mapDesc(a.changes).invertedDesc; } - t = zi.create(e, i, t.selection && t.selection.map(s), _r.mapEffects(t.effects, s), t.annotations, t.scrollIntoView); + t = Fi.create(e, i, t.selection && t.selection.map(s), _r.mapEffects(t.effects, s), t.annotations, t.scrollIntoView); } - let n = e.facet(fse); + let n = e.facet(nse); for (let i = n.length - 1; i >= 0; i--) { let s = n[i](t); - s instanceof zi ? t = s : Array.isArray(s) && s.length == 1 && s[0] instanceof zi ? t = s[0] : t = mse(e, D1(s), !1); + s instanceof Fi ? t = s : Array.isArray(s) && s.length == 1 && s[0] instanceof Fi ? t = s[0] : t = ose(e, A1(s), !1); } return t; } -function BTe(t) { - let e = t.startState, r = e.facet(dse), n = t; +function CTe(t) { + let e = t.startState, r = e.facet(ise), n = t; for (let i = r.length - 1; i >= 0; i--) { let s = r[i](t); - s && Object.keys(s).length && (n = gse(n, PM(e, s, t.changes.newLength), !0)); + s && Object.keys(s).length && (n = ase(n, AM(e, s, t.changes.newLength), !0)); } - return n == t ? t : zi.create(e, t.changes, t.selection, n.effects, n.annotations, n.scrollIntoView); + return n == t ? t : Fi.create(e, t.changes, t.selection, n.effects, n.annotations, n.scrollIntoView); } -const FTe = []; -function D1(t) { - return t == null ? FTe : Array.isArray(t) ? t : [t]; +const ETe = []; +function A1(t) { + return t == null ? ETe : Array.isArray(t) ? t : [t]; } var li = /* @__PURE__ */ function(t) { return t[t.Word = 0] = "Word", t[t.Space = 1] = "Space", t[t.Other = 2] = "Other", t; }(li || (li = {})); -const zTe = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; -let NM; +const _Te = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; +let RM; try { - NM = /* @__PURE__ */ new RegExp("[\\p{Alphabetic}\\p{Number}_]", "u"); + RM = /* @__PURE__ */ new RegExp("[\\p{Alphabetic}\\p{Number}_]", "u"); } catch { } -function qTe(t) { - if (NM) - return NM.test(t); +function ATe(t) { + if (RM) + return RM.test(t); for (let e = 0; e < t.length; e++) { let r = t[e]; - if (/\w/.test(r) || r > "\x80" && (r.toUpperCase() != r.toLowerCase() || zTe.test(r))) + if (/\w/.test(r) || r > "\x80" && (r.toUpperCase() != r.toLowerCase() || _Te.test(r))) return !0; } return !1; } -function UTe(t) { +function RTe(t) { return (e) => { if (!/\S/.test(e)) return li.Space; - if (qTe(e)) + if (ATe(e)) return li.Word; for (let r = 0; r < t.length; r++) if (e.indexOf(t[r]) > -1) @@ -3458,7 +3458,7 @@ class qr { 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++) - ax(this, o << 1); + ix(this, o << 1); this.computeSlot = null; } field(e, r = !0) { @@ -3468,18 +3468,18 @@ class qr { throw new RangeError("Field is not present in this state"); return; } - return ax(this, n), cT(this, n); + return ix(this, n), oT(this, n); } update(...e) { - return mse(this, e, !0); + return ose(this, e, !0); } applyTransaction(e) { let r = this.config, { base: n, compartments: i } = r; for (let o of e.effects) - o.is(jf.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(_r.reconfigure) ? (r = null, n = o.value) : o.is(_r.appendConfig) && (r = null, n = D1(n).concat(o.value)); + o.is(Hf.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(_r.reconfigure) ? (r = null, n = o.value) : o.is(_r.appendConfig) && (r = null, n = A1(n).concat(o.value)); let s; - r ? s = e.startState.values.slice() : (r = lT.resolve(n, i, this), s = new qr(r, this.doc, this.selection, r.dynamicSlots.map(() => null), (l, u) => u.reconfigure(l, this), null).values); - let a = e.startState.facet(DM) ? e.newSelection : e.newSelection.asSingle(); + r ? s = e.startState.values.slice() : (r = aT.resolve(n, i, this), s = new qr(r, this.doc, this.selection, r.dynamicSlots.map(() => null), (l, u) => u.reconfigure(l, this), null).values); + let a = e.startState.facet(_M) ? e.newSelection : e.newSelection.asSingle(); new qr(r, e.newDoc, a, s, (o, l) => l.update(o, e), e); } replaceSelection(e) { @@ -3489,13 +3489,13 @@ class qr { })); } changeByRange(e) { - let r = this.selection, n = e(r.ranges[0]), i = this.changes(n.changes), s = [n.range], a = D1(n.effects); + let r = this.selection, n = e(r.ranges[0]), i = this.changes(n.changes), s = [n.range], a = A1(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 = _r.mapEffects(a, h).concat(_r.mapEffects(D1(l.effects), f)); + s.push(l.range.map(f)), i = i.compose(h), a = _r.mapEffects(a, h).concat(_r.mapEffects(A1(l.effects), f)); } return { changes: i, @@ -3504,17 +3504,17 @@ class qr { }; } changes(e = []) { - return e instanceof Hi ? e : Hi.of(e, this.doc.length, this.facet(qr.lineSeparator)); + return e instanceof Gi ? e : Gi.of(e, this.doc.length, this.facet(qr.lineSeparator)); } toText(e) { - return nn.of(e.split(this.facet(qr.lineSeparator) || _M)); + return nn.of(e.split(this.facet(qr.lineSeparator) || kM)); } 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 : (ax(this, r), cT(this, r)); + return r == null ? e.default : (ix(this, r), oT(this, r)); } toJSON(e) { let r = { @@ -3546,8 +3546,8 @@ class qr { }); } static create(e = {}) { - let r = lT.resolve(e.extensions || [], /* @__PURE__ */ new Map()), n = e.doc instanceof nn ? e.doc : nn.of((e.doc || "").split(r.staticFacet(qr.lineSeparator) || _M)), i = e.selection ? e.selection instanceof ft ? e.selection : ft.single(e.selection.anchor, e.selection.head) : ft.single(0); - return ose(i, n.length), r.staticFacet(DM) || (i = i.asSingle()), new qr(r, n, i, r.dynamicSlots.map(() => null), (s, a) => a.create(s), null); + let r = aT.resolve(e.extensions || [], /* @__PURE__ */ new Map()), n = e.doc instanceof nn ? e.doc : nn.of((e.doc || "").split(r.staticFacet(qr.lineSeparator) || kM)), i = e.selection ? e.selection instanceof ft ? e.selection : ft.single(e.selection.anchor, e.selection.head) : ft.single(0); + return Kie(i, n.length), r.staticFacet(_M) || (i = i.asSingle()), new qr(r, n, i, r.dynamicSlots.map(() => null), (s, a) => a.create(s), null); } get tabSize() { return this.facet(qr.tabSize); @@ -3557,7 +3557,7 @@ class qr { `; } get readOnly() { - return this.facet(pse); + return this.facet(sse); } phrase(e, ...r) { for (let n of this.facet(qr.phrases)) @@ -3574,24 +3574,24 @@ class qr { } languageDataAt(e, r, n = -1) { let i = []; - for (let s of this.facet(cse)) + for (let s of this.facet(ese)) for (let a of s(this, r, n)) Object.prototype.hasOwnProperty.call(a, e) && i.push(a[e]); return i; } charCategorizer(e) { - return UTe(this.languageDataAt("wordChars", e).join("")); + return RTe(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 = la(r, a, !1); + let l = oa(r, a, !1); if (s(r.slice(l, a)) != li.Word) break; a = l; } for (; o < i; ) { - let l = la(r, o); + let l = oa(r, o); if (s(r.slice(o, l)) != li.Word) break; o = l; @@ -3599,24 +3599,24 @@ class qr { return a == o ? null : ft.range(a + n, o + n); } } -qr.allowMultipleSelections = DM; +qr.allowMultipleSelections = _M; qr.tabSize = /* @__PURE__ */ Gt.define({ combine: (t) => t.length ? t[0] : 4 }); -qr.lineSeparator = use; -qr.readOnly = pse; +qr.lineSeparator = tse; +qr.readOnly = sse; qr.phrases = /* @__PURE__ */ Gt.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]); } }); -qr.languageData = cse; -qr.changeFilter = hse; -qr.transactionFilter = fse; -qr.transactionExtender = dse; -jf.reconfigure = /* @__PURE__ */ _r.define(); -function Ah(t, e, r = {}) { +qr.languageData = ese; +qr.changeFilter = rse; +qr.transactionFilter = nse; +qr.transactionExtender = ise; +Hf.reconfigure = /* @__PURE__ */ _r.define(); +function Th(t, e, r = {}) { let n = {}; for (let i of t) for (let s of Object.keys(i)) { @@ -3633,29 +3633,29 @@ function Ah(t, e, r = {}) { n[i] === void 0 && (n[i] = e[i]); return n; } -class pg { +class ug { eq(e) { return this == e; } range(e, r = e) { - return Fx.create(e, r, this); + return $x.create(e, r, this); } } -pg.prototype.startSide = pg.prototype.endSide = 0; -pg.prototype.point = !1; -pg.prototype.mapMode = gi.TrackDel; -class Fx { +ug.prototype.startSide = ug.prototype.endSide = 0; +ug.prototype.point = !1; +ug.prototype.mapMode = gi.TrackDel; +class $x { constructor(e, r, n) { this.from = e, this.to = r, this.value = n; } static create(e, r, n) { - return new Fx(e, r, n); + return new $x(e, r, n); } } -function IM(t, e) { +function LM(t, e) { return t.from - e.from || t.value.startSide - e.value.startSide; } -class N$ { +class k$ { constructor(e, r, n, i) { this.from = e, this.to = r, this.value = n, this.maxPoint = i; } @@ -3690,7 +3690,7 @@ class N$ { 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 N$(i, s, n, o) : null, pos: a }; + return { mapped: n.length ? new k$(i, s, n, o) : null, pos: a }; } } class jr { @@ -3719,15 +3719,15 @@ class jr { 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(IM)), this.isEmpty) + if (n && (r = r.slice().sort(LM)), this.isEmpty) return r.length ? jr.of(r) : this; - let o = new vse(this, null, -1).goto(0), l = 0, u = [], h = new is(); + let o = new lse(this, null, -1).goto(0), l = 0, u = [], h = new rs(); 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(Fx.create(o.from, o.to, o.value))), o.next()); + 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($x.create(o.from, o.to, o.value))), o.next()); return h.finishInner(this.nextLayer.isEmpty && !u.length ? jr.empty : this.nextLayer.update({ add: u, filter: a, filterFrom: i, filterTo: s })); } map(e) { @@ -3757,17 +3757,17 @@ class jr { } } iter(e = 0) { - return zx.from([this]).goto(e); + return Bx.from([this]).goto(e); } get isEmpty() { return this.nextLayer == this; } static iter(e, r = 0) { - return zx.from(e).goto(r); + return Bx.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 = BV(a, o, n), u = new F2(a, l, s), h = new F2(o, l, s); - n.iterGaps((f, d, p) => FV(u, f, h, d, p, i)), n.empty && n.length == 0 && FV(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 = TV(a, o, n), u = new N2(a, l, s), h = new N2(o, l, s); + n.iterGaps((f, d, p) => CV(u, f, h, d, p, i)), n.empty && n.length == 0 && CV(u, 0, h, 0, 0, i); } static eq(e, r, n = 0, i) { i == null && (i = 1e9 - 1); @@ -3776,9 +3776,9 @@ class jr { return !1; if (!s.length) return !0; - let o = BV(s, a), l = new F2(s, o, 0).goto(n), u = new F2(a, o, 0).goto(n); + let o = TV(s, a), l = new N2(s, o, 0).goto(n), u = new N2(a, o, 0).goto(n); for (; ; ) { - if (l.to != u.to || !$M(l.active, u.active) || l.point && (!u.point || !l.point.eq(u.point))) + if (l.to != u.to || !MM(l.active, u.active) || l.point && (!u.point || !l.point.eq(u.point))) return !1; if (l.to > i) return !0; @@ -3786,7 +3786,7 @@ class jr { } } static spans(e, r, n, i, s = -1) { - let a = new F2(e, null, s).goto(r), o = r, l = a.openStart; + let a = new N2(e, null, s).goto(r), o = r, l = a.openStart; for (; ; ) { let u = Math.min(a.to, n); if (a.point) { @@ -3800,8 +3800,8 @@ class jr { } } static of(e, r = !1) { - let n = new is(); - for (let i of e instanceof Fx ? [e] : r ? QTe(e) : e) + let n = new rs(); + for (let i of e instanceof $x ? [e] : r ? LTe(e) : e) n.add(i.from, i.to, i.value); return n.finish(); } @@ -3816,26 +3816,26 @@ class jr { } } jr.empty = /* @__PURE__ */ new jr([], [], null, -1); -function QTe(t) { +function LTe(t) { if (t.length > 1) for (let e = t[0], r = 1; r < t.length; r++) { let n = t[r]; - if (IM(e, n) > 0) - return t.slice().sort(IM); + if (LM(e, n) > 0) + return t.slice().sort(LM); e = n; } return t; } jr.empty.nextLayer = jr.empty; -class is { +class rs { finishChunk(e) { - this.chunks.push(new N$(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 k$(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 is())).add(e, r, n); + this.addInner(e, r, n) || (this.nextLayer || (this.nextLayer = new rs())).add(e, r, n); } addInner(e, r, n) { let i = e - this.lastTo || n.startSide - this.last.endSide; @@ -3860,7 +3860,7 @@ class is { return this.from = null, r; } } -function BV(t, e, r) { +function TV(t, e, r) { let n = /* @__PURE__ */ new Map(); for (let s of t) for (let a = 0; a < s.chunk.length; a++) @@ -3873,7 +3873,7 @@ function BV(t, e, r) { } return i; } -class vse { +class lse { constructor(e, r, n, i = 0) { this.layer = e, this.skip = r, this.minPoint = n, this.rank = i; } @@ -3929,7 +3929,7 @@ class vse { return this.from - e.from || this.startSide - e.startSide || this.rank - e.rank || this.to - e.to || this.endSide - e.endSide; } } -class zx { +class Bx { constructor(e) { this.heap = e; } @@ -3937,8 +3937,8 @@ class zx { 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 vse(a, r, n, s)); - return i.length == 1 ? i[0] : new zx(i); + a.maxPoint >= n && i.push(new lse(a, r, n, s)); + return i.length == 1 ? i[0] : new Bx(i); } get startSide() { return this.value ? this.value.startSide : 0; @@ -3947,14 +3947,14 @@ class zx { for (let n of this.heap) n.goto(e, r); for (let n = this.heap.length >> 1; n >= 0; n--) - H7(this.heap, n); + U7(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--) - H7(this.heap, n); + U7(this.heap, n); (this.to - e || this.value.endSide - r) < 0 && this.next(); } next() { @@ -3962,11 +3962,11 @@ class zx { 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(), H7(this.heap, 0); + this.from = e.from, this.to = e.to, this.value = e.value, this.rank = e.rank, e.value && e.next(), U7(this.heap, 0); } } } -function H7(t, e) { +function U7(t, e) { for (let r = t[e]; ; ) { let n = (e << 1) + 1; if (n >= t.length) @@ -3977,9 +3977,9 @@ function H7(t, e) { t[n] = r, t[e] = i, e = n; } } -class F2 { +class N2 { 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 = zx.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 = Bx.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; @@ -3990,13 +3990,13 @@ class F2 { this.cursor.forward(e, r); } removeActive(e) { - G4(this.active, e), G4(this.activeTo, e), G4(this.activeRank, e), this.minActive = zV(this.active, this.activeTo); + V4(this.active, e), V4(this.activeTo, e), V4(this.activeRank, e), this.minActive = EV(this.active, this.activeTo); } addActive(e) { let r = 0, { value: n, to: i, rank: s } = this.cursor; for (; r < this.activeRank.length && (s - this.activeRank[r] || i - this.activeTo[r]) > 0; ) r++; - H4(this.active, r, n), H4(this.activeTo, r, i), H4(this.activeRank, r, s), e && H4(e, r, this.cursor.from), this.minActive = zV(this.active, this.activeTo); + W4(this.active, r, n), W4(this.activeTo, r, i), W4(this.activeRank, r, s), e && W4(e, r, this.cursor.from), this.minActive = EV(this.active, this.activeTo); } next() { let e = this.to, r = this.point; @@ -4009,7 +4009,7 @@ class F2 { this.to = this.activeTo[i], this.endSide = this.active[i].endSide; break; } - this.removeActive(i), n && G4(n, i); + this.removeActive(i), n && V4(n, i); } else if (this.cursor.value) if (this.cursor.from > e) { this.to = this.cursor.from, this.endSide = this.cursor.startSide; @@ -4051,17 +4051,17 @@ class F2 { return r; } } -function FV(t, e, r, n, i, s) { +function CV(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, h = u || t.endSide - r.endSide, f = h < 0 ? t.to + l : r.to, d = Math.min(f, a); - if (t.point || r.point ? t.point && r.point && (t.point == r.point || t.point.eq(r.point)) && $M(t.activeForPoint(t.to), r.activeForPoint(r.to)) || s.comparePoint(o, d, t.point, r.point) : d > o && !$M(t.active, r.active) && s.compareRange(o, d, t.active, r.active), f > a) + if (t.point || r.point ? t.point && r.point && (t.point == r.point || t.point.eq(r.point)) && MM(t.activeForPoint(t.to), r.activeForPoint(r.to)) || s.comparePoint(o, d, t.point, r.point) : d > o && !MM(t.active, r.active) && s.compareRange(o, d, t.active, r.active), f > a) break; (u || t.openEnd != r.openEnd) && s.boundChange && s.boundChange(f), o = f, h <= 0 && t.next(), h >= 0 && r.next(); } } -function $M(t, e) { +function MM(t, e) { if (t.length != e.length) return !1; for (let r = 0; r < t.length; r++) @@ -4069,40 +4069,40 @@ function $M(t, e) { return !1; return !0; } -function G4(t, e) { +function V4(t, e) { for (let r = e, n = t.length - 1; r < n; r++) t[r] = t[r + 1]; t.pop(); } -function H4(t, e, r) { +function W4(t, e, r) { for (let n = t.length - 1; n >= e; n--) t[n + 1] = t[n]; t[e] = r; } -function zV(t, e) { +function EV(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 ou(t, e, r = t.length) { +function iu(t, e, r = t.length) { let n = 0; for (let i = 0; i < r && i < t.length; ) - t.charCodeAt(i) == 9 ? (n += e - n % e, i++) : (n++, i = la(t, i)); + t.charCodeAt(i) == 9 ? (n += e - n % e, i++) : (n++, i = oa(t, i)); return n; } -function BM(t, e, r, n) { +function DM(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 = la(t, i); + s += t.charCodeAt(i) == 9 ? r - s % r : 1, i = oa(t, i); } return n === !0 ? -1 : t.length; } -const FM = "\u037C", qV = typeof Symbol > "u" ? "__" + FM : Symbol.for(FM), zM = typeof Symbol > "u" ? "__styleSet" + Math.floor(Math.random() * 1e8) : Symbol("styleSet"), UV = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : {}; -class Ef { +const PM = "\u037C", _V = typeof Symbol > "u" ? "__" + PM : Symbol.for(PM), NM = typeof Symbol > "u" ? "__styleSet" + Math.floor(Math.random() * 1e8) : Symbol("styleSet"), AV = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : {}; +class Tf { constructor(e, r) { this.rules = []; let { finish: n } = r || {}; @@ -4138,29 +4138,29 @@ class Ef { `); } static newName() { - let e = UV[qV] || 1; - return UV[qV] = e + 1, FM + e.toString(36); + let e = AV[_V] || 1; + return AV[_V] = e + 1, PM + e.toString(36); } static mount(e, r, n) { - let i = e[zM], s = n && n.nonce; - i ? s && i.setNonce(s) : i = new VTe(e, s), i.mount(Array.isArray(r) ? r : [r]); + let i = e[NM], s = n && n.nonce; + i ? s && i.setNonce(s) : i = new MTe(e, s), i.mount(Array.isArray(r) ? r : [r]); } } -let QV = /* @__PURE__ */ new Map(); -class VTe { +let RV = /* @__PURE__ */ new Map(); +class MTe { constructor(e, r) { let n = e.ownerDocument || e, i = n.defaultView; if (!e.head && e.adoptedStyleSheets && i.CSSStyleSheet) { - let s = QV.get(n); + let s = RV.get(n); if (s) - return e.adoptedStyleSheets = [s.sheet, ...e.adoptedStyleSheets], e[zM] = s; - this.sheet = new i.CSSStyleSheet(), e.adoptedStyleSheets = [this.sheet, ...e.adoptedStyleSheets], QV.set(n, this); + return e.adoptedStyleSheets = [s.sheet, ...e.adoptedStyleSheets], e[NM] = s; + this.sheet = new i.CSSStyleSheet(), e.adoptedStyleSheets = [this.sheet, ...e.adoptedStyleSheets], RV.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[zM] = this; + this.modules = [], e[NM] = this; } mount(e) { let r = this.sheet, n = 0, i = 0; @@ -4188,7 +4188,7 @@ class VTe { this.styleTag && this.styleTag.getAttribute("nonce") != e && this.styleTag.setAttribute("nonce", e); } } -var up = { +var sp = { 8: "Backspace", 9: "Tab", 10: "Enter", @@ -4241,7 +4241,7 @@ var up = { 220: "\\", 221: "]", 222: "'" -}, qx = { +}, Fx = { 48: ")", 49: "!", 50: "@", @@ -4266,76 +4266,76 @@ var up = { 220: "|", 221: "}", 222: '"' -}, WTe = typeof navigator < "u" && /Mac/.test(navigator.platform), YTe = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent); -for (var ia = 0; ia < 10; ia++) - up[48 + ia] = up[96 + ia] = String(ia); -for (var ia = 1; ia <= 24; ia++) - up[ia + 111] = "F" + ia; -for (var ia = 65; ia <= 90; ia++) - up[ia] = String.fromCharCode(ia + 32), qx[ia] = String.fromCharCode(ia); -for (var X7 in up) - qx.hasOwnProperty(X7) || (qx[X7] = up[X7]); -function GTe(t) { - var e = WTe && t.metaKey && t.shiftKey && !t.ctrlKey && !t.altKey || YTe && t.shiftKey && t.key && t.key.length == 1 || t.key == "Unidentified", r = !e && t.key || (t.shiftKey ? qx : up)[t.keyCode] || t.key || "Unidentified"; +}, DTe = typeof navigator < "u" && /Mac/.test(navigator.platform), PTe = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent); +for (var na = 0; na < 10; na++) + sp[48 + na] = sp[96 + na] = String(na); +for (var na = 1; na <= 24; na++) + sp[na + 111] = "F" + na; +for (var na = 65; na <= 90; na++) + sp[na] = String.fromCharCode(na + 32), Fx[na] = String.fromCharCode(na); +for (var Q7 in sp) + Fx.hasOwnProperty(Q7) || (Fx[Q7] = sp[Q7]); +function NTe(t) { + var e = DTe && t.metaKey && t.shiftKey && !t.ctrlKey && !t.altKey || PTe && t.shiftKey && t.key && t.key.length == 1 || t.key == "Unidentified", r = !e && t.key || (t.shiftKey ? Fx : sp)[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 Ux(t) { +function zx(t) { let e; return t.nodeType == 11 ? e = t.getSelection ? t : t.ownerDocument : e = t, e.getSelection(); } -function qM(t, e) { +function IM(t, e) { return e ? t == e || t.contains(e.nodeType != 1 ? e.parentNode : e) : !1; } -function G3(t, e) { +function W5(t, e) { if (!e.anchorNode) return !1; try { - return qM(t, e.anchorNode); + return IM(t, e.anchorNode); } catch { return !1; } } -function Qx(t) { - return t.nodeType == 3 ? mg(t, 0, t.nodeValue.length).getClientRects() : t.nodeType == 1 ? t.getClientRects() : []; +function qx(t) { + return t.nodeType == 3 ? fg(t, 0, t.nodeValue.length).getClientRects() : t.nodeType == 1 ? t.getClientRects() : []; } -function ox(t, e, r, n) { - return r ? VV(t, e, r, n, -1) || VV(t, e, r, n, 1) : !1; +function sx(t, e, r, n) { + return r ? LV(t, e, r, n, -1) || LV(t, e, r, n, 1) : !1; } -function gg(t) { +function hg(t) { for (var e = 0; ; e++) if (t = t.previousSibling, !t) return e; } -function uT(t) { +function lT(t) { return t.nodeType == 1 && /^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName); } -function VV(t, e, r, n, i) { +function LV(t, e, r, n, i) { for (; ; ) { if (t == r && e == n) return !0; - if (e == (i < 0 ? 0 : mh(t))) { + if (e == (i < 0 ? 0 : dh(t))) { if (t.nodeName == "DIV") return !1; let s = t.parentNode; if (!s || s.nodeType != 1) return !1; - e = gg(t) + (i < 0 ? 0 : 1), t = s; + e = hg(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 ? mh(t) : 0; + e = i < 0 ? dh(t) : 0; } else return !1; } } -function mh(t) { +function dh(t) { return t.nodeType == 3 ? t.nodeValue.length : t.childNodes.length; } -function G_(t, e) { +function Q_(t, e) { let r = e ? t.left : t.right; return { left: r, right: r, top: t.top, bottom: t.bottom }; } -function HTe(t) { +function ITe(t) { let e = t.visualViewport; return e ? { left: 0, @@ -4349,24 +4349,24 @@ function HTe(t) { bottom: t.innerHeight }; } -function yse(t, e) { +function cse(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 XTe(t, e, r, n, i, s, a, o) { +function $Te(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 = HTe(u); + d = ITe(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 } = yse(h, b)), d = { + ({ scaleX: g, scaleY: m } = cse(h, b)), d = { left: b.left, right: b.left + h.clientWidth * g, top: b.top, @@ -4408,7 +4408,7 @@ function XTe(t, e, r, n, i, s, a, o) { else break; } -function jTe(t) { +function BTe(t) { let e = t.ownerDocument, r, n; for (let i = t.parentNode; i && !(i == e.body || r && n); ) if (i.nodeType == 1) @@ -4419,7 +4419,7 @@ function jTe(t) { break; return { x: r, y: n }; } -class ZTe { +class FTe { constructor() { this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0; } @@ -4428,39 +4428,39 @@ class ZTe { } setRange(e) { let { anchorNode: r, focusNode: n } = e; - this.set(r, Math.min(e.anchorOffset, r ? mh(r) : 0), n, Math.min(e.focusOffset, n ? mh(n) : 0)); + this.set(r, Math.min(e.anchorOffset, r ? dh(r) : 0), n, Math.min(e.focusOffset, n ? dh(n) : 0)); } set(e, r, n, i) { this.anchorNode = e, this.anchorOffset = r, this.focusNode = n, this.focusOffset = i; } } -let zm = null; -function bse(t) { +let $m = null; +function use(t) { if (t.setActive) return t.setActive(); - if (zm) - return t.focus(zm); + if ($m) + return t.focus($m); let e = []; for (let r = t; r && (e.push(r, r.scrollTop, r.scrollLeft), r != r.ownerDocument); r = r.parentNode) ; - if (t.focus(zm == null ? { + if (t.focus($m == null ? { get preventScroll() { - return zm = { preventScroll: !0 }, !0; + return $m = { preventScroll: !0 }, !0; } - } : void 0), !zm) { - zm = !1; + } : void 0), !$m) { + $m = !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 WV; -function mg(t, e, r = e) { - let n = WV || (WV = document.createRange()); +let MV; +function fg(t, e, r = e) { + let n = MV || (MV = document.createRange()); return n.setEnd(t, r), n.setStart(t, e), n; } -function P1(t, e, r, n) { +function R1(t, e, r, n) { let i = { key: e, code: e, keyCode: r, which: r, cancelable: !0 }; n && ({ altKey: i.altKey, ctrlKey: i.ctrlKey, shiftKey: i.shiftKey, metaKey: i.metaKey } = n); let s = new KeyboardEvent("keydown", i); @@ -4468,7 +4468,7 @@ function P1(t, e, r, n) { let a = new KeyboardEvent("keyup", i); return a.synthetic = !0, t.dispatchEvent(a), s.defaultPrevented || a.defaultPrevented; } -function KTe(t) { +function zTe(t) { for (; t; ) { if (t && (t.nodeType == 9 || t.nodeType == 11 && t.host)) return t; @@ -4476,44 +4476,44 @@ function KTe(t) { } return null; } -function xse(t) { +function hse(t) { for (; t.attributes.length; ) t.removeAttributeNode(t.attributes[0]); } -function JTe(t, e) { +function qTe(t, e) { let r = e.focusNode, n = e.focusOffset; if (!r || e.anchorNode != r || e.anchorOffset != n) return !1; - for (n = Math.min(n, mh(r)); ; ) + for (n = Math.min(n, dh(r)); ; ) if (n) { if (r.nodeType != 1) return !1; let i = r.childNodes[n - 1]; - i.contentEditable == "false" ? n-- : (r = i, n = mh(r)); + i.contentEditable == "false" ? n-- : (r = i, n = dh(r)); } else { if (r == t) return !0; - n = gg(r), r = r.parentNode; + n = hg(r), r = r.parentNode; } } -function wse(t) { +function fse(t) { return t.scrollTop > Math.max(1, t.scrollHeight - t.clientHeight - 4); } -function Ose(t, e) { +function dse(t, e) { for (let r = t, n = e; ; ) { if (r.nodeType == 3 && n > 0) return { node: r, offset: n }; if (r.nodeType == 1 && n > 0) { if (r.contentEditable == "false") return null; - r = r.childNodes[n - 1], n = mh(r); - } else if (r.parentNode && !uT(r)) - n = gg(r), r = r.parentNode; + r = r.childNodes[n - 1], n = dh(r); + } else if (r.parentNode && !lT(r)) + n = hg(r), r = r.parentNode; else return null; } } -function kse(t, e) { +function pse(t, e) { for (let r = t, n = e; ; ) { if (r.nodeType == 3 && n < r.nodeValue.length) return { node: r, offset: n }; @@ -4521,24 +4521,24 @@ function kse(t, e) { if (r.contentEditable == "false") return null; r = r.childNodes[n], n = 0; - } else if (r.parentNode && !uT(r)) - n = gg(r) + 1, r = r.parentNode; + } else if (r.parentNode && !lT(r)) + n = hg(r) + 1, r = r.parentNode; else return null; } } -class Ia { +class Pa { constructor(e, r, n = !0) { this.node = e, this.offset = r, this.precise = n; } static before(e, r) { - return new Ia(e.parentNode, gg(e), r); + return new Pa(e.parentNode, hg(e), r); } static after(e, r) { - return new Ia(e.parentNode, gg(e) + 1, r); + return new Pa(e.parentNode, hg(e) + 1, r); } } -const I$ = []; +const S$ = []; class Fn { constructor() { this.parent = null, this.dom = null, this.flags = 2; @@ -4577,13 +4577,13 @@ class Fn { } 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 = YV(s); + s = DV(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 = YV(s); + s = DV(s); } else if (this.flags & 1) for (let n of this.children) n.flags & 7 && (n.sync(e, r), n.flags &= -8); @@ -4595,7 +4595,7 @@ class Fn { if (e == this.dom) n = this.dom.childNodes[r]; else { - let i = mh(e) == 0 ? 0 : r == 0 ? -1 : 1; + let i = dh(e) == 0 ? 0 : r == 0 ? -1 : 1; for (; ; ) { let s = e.parentNode; if (s == this.dom) @@ -4660,7 +4660,7 @@ class Fn { e = r; } } - replaceChildren(e, r, n = I$) { + replaceChildren(e, r, n = S$) { this.markDirty(); for (let i = e; i < r; i++) { let s = this.children[i]; @@ -4677,7 +4677,7 @@ class Fn { return !1; } childCursor(e = this.length) { - return new Sse(this.children, e, this.children.length); + return new gse(this.children, e, this.children.length); } childPos(e, r = 1) { return this.childCursor().findPos(e, r); @@ -4717,11 +4717,11 @@ class Fn { } } Fn.prototype.breakAfter = 0; -function YV(t) { +function DV(t) { let e = t.nextSibling; return t.parentNode.removeChild(t), e; } -class Sse { +class gse { constructor(e, r, n) { this.children = e, this.pos = r, this.i = n, this.off = 0; } @@ -4734,7 +4734,7 @@ class Sse { } } } -function Tse(t, e, r, n, i, s, a, o, l) { +function mse(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) { @@ -4751,33 +4751,33 @@ function Tse(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 Cse(t, e, r, n, i, s) { +function vse(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, Tse(t, u, h, o, l, n, 0, i, s); + t.length += f, mse(t, u, h, o, l, n, 0, i, s); } -let Io = typeof navigator < "u" ? navigator : { userAgent: "", vendor: "", platform: "" }, UM = typeof document < "u" ? document : { documentElement: { style: {} } }; -const QM = /* @__PURE__ */ /Edge\/(\d+)/.exec(Io.userAgent), Ese = /* @__PURE__ */ /MSIE \d/.test(Io.userAgent), VM = /* @__PURE__ */ /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Io.userAgent), H_ = !!(Ese || VM || QM), GV = !H_ && /* @__PURE__ */ /gecko\/(\d+)/i.test(Io.userAgent), j7 = !H_ && /* @__PURE__ */ /Chrome\/(\d+)/.exec(Io.userAgent), HV = "webkitFontSmoothing" in UM.documentElement.style, _se = !H_ && /* @__PURE__ */ /Apple Computer/.test(Io.vendor), XV = _se && (/* @__PURE__ */ /Mobile\/\w+/.test(Io.userAgent) || Io.maxTouchPoints > 2); +let Do = typeof navigator < "u" ? navigator : { userAgent: "", vendor: "", platform: "" }, $M = typeof document < "u" ? document : { documentElement: { style: {} } }; +const BM = /* @__PURE__ */ /Edge\/(\d+)/.exec(Do.userAgent), yse = /* @__PURE__ */ /MSIE \d/.test(Do.userAgent), FM = /* @__PURE__ */ /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Do.userAgent), V_ = !!(yse || FM || BM), PV = !V_ && /* @__PURE__ */ /gecko\/(\d+)/i.test(Do.userAgent), V7 = !V_ && /* @__PURE__ */ /Chrome\/(\d+)/.exec(Do.userAgent), NV = "webkitFontSmoothing" in $M.documentElement.style, bse = !V_ && /* @__PURE__ */ /Apple Computer/.test(Do.vendor), IV = bse && (/* @__PURE__ */ /Mobile\/\w+/.test(Do.userAgent) || Do.maxTouchPoints > 2); var nr = { - mac: XV || /* @__PURE__ */ /Mac/.test(Io.platform), - windows: /* @__PURE__ */ /Win/.test(Io.platform), - linux: /* @__PURE__ */ /Linux|X11/.test(Io.platform), - ie: H_, - ie_version: Ese ? UM.documentMode || 6 : VM ? +VM[1] : QM ? +QM[1] : 0, - gecko: GV, - gecko_version: GV ? +(/* @__PURE__ */ /Firefox\/(\d+)/.exec(Io.userAgent) || [0, 0])[1] : 0, - chrome: !!j7, - chrome_version: j7 ? +j7[1] : 0, - ios: XV, - android: /* @__PURE__ */ /Android\b/.test(Io.userAgent), - webkit: HV, - safari: _se, - webkit_version: HV ? +(/* @__PURE__ */ /\bAppleWebKit\/(\d+)/.exec(Io.userAgent) || [0, 0])[1] : 0, - tabSize: UM.documentElement.style.tabSize != null ? "tab-size" : "-moz-tab-size" -}; -const eCe = 256; -class lu extends Fn { + mac: IV || /* @__PURE__ */ /Mac/.test(Do.platform), + windows: /* @__PURE__ */ /Win/.test(Do.platform), + linux: /* @__PURE__ */ /Linux|X11/.test(Do.platform), + ie: V_, + ie_version: yse ? $M.documentMode || 6 : FM ? +FM[1] : BM ? +BM[1] : 0, + gecko: PV, + gecko_version: PV ? +(/* @__PURE__ */ /Firefox\/(\d+)/.exec(Do.userAgent) || [0, 0])[1] : 0, + chrome: !!V7, + chrome_version: V7 ? +V7[1] : 0, + ios: IV, + android: /* @__PURE__ */ /Android\b/.test(Do.userAgent), + webkit: NV, + safari: bse, + webkit_version: NV ? +(/* @__PURE__ */ /\bAppleWebKit\/(\d+)/.exec(Do.userAgent) || [0, 0])[1] : 0, + tabSize: $M.documentElement.style.tabSize != null ? "tab-size" : "-moz-tab-size" +}; +const UTe = 256; +class su extends Fn { constructor(e) { super(), this.text = e; } @@ -4794,33 +4794,33 @@ class lu extends Fn { e.nodeType == 3 && this.createDOM(e); } merge(e, r, n) { - return this.flags & 8 || n && (!(n instanceof lu) || this.length - (r - e) + n.length > eCe || 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 su) || this.length - (r - e) + n.length > UTe || 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 lu(this.text.slice(e)); + let r = new su(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 Ia(this.dom, e); + return new Pa(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 tCe(this.dom, e, r); + return QTe(this.dom, e, r); } } -class _f extends Fn { +class Cf extends Fn { 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 (xse(e), this.mark.class && (e.className = this.mark.class), this.mark.attrs) + if (hse(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; @@ -4835,7 +4835,7 @@ class _f extends Fn { 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 _f && n.mark.eq(this.mark)) || e && s <= 0 || r < this.length && a <= 0) ? !1 : (Cse(this, e, r, n ? n.children.slice() : [], s - 1, a - 1), this.markDirty(), !0); + return n && (!(n instanceof Cf && n.mark.eq(this.mark)) || e && s <= 0 || r < this.length && a <= 0) ? !1 : (vse(this, e, r, n ? n.children.slice() : [], s - 1, a - 1), this.markDirty(), !0); } split(e) { let r = [], n = 0, i = -1, s = 0; @@ -4844,35 +4844,35 @@ class _f extends Fn { 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 _f(this.mark, r, a); + return this.length = e, i > -1 && (this.children.length = i, this.markDirty()), new Cf(this.mark, r, a); } domAtPos(e) { - return Ase(this, e); + return xse(this, e); } coordsAt(e, r) { - return Lse(this, e, r); + return Ose(this, e, r); } } -function tCe(t, e, r) { +function QTe(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 ? nr.chrome || nr.gecko || (e ? (i--, a = 1) : s < n && (s++, a = -1)) : r < 0 ? i-- : s < n && s++; - let o = mg(t, i, s).getClientRects(); + let o = fg(t, i, s).getClientRects(); if (!o.length) return null; let l = o[(a ? a < 0 : r >= 0) ? 0 : o.length - 1]; - return nr.safari && !a && l.width == 0 && (l = Array.prototype.find.call(o, (u) => u.width) || l), a ? G_(l, a < 0) : l || null; + return nr.safari && !a && l.width == 0 && (l = Array.prototype.find.call(o, (u) => u.width) || l), a ? Q_(l, a < 0) : l || null; } -class Dd extends Fn { +class Rd extends Fn { static create(e, r, n) { - return new Dd(e, r, n); + return new Rd(e, r, n); } constructor(e, r, n) { super(), this.widget = e, this.length = r, this.side = n, this.prevWidget = null; } split(e) { - let r = Dd.create(this.widget, this.length - e, this.side); + let r = Rd.create(this.widget, this.length - e, this.side); return this.length -= e, r; } sync(e) { @@ -4882,10 +4882,10 @@ class Dd extends Fn { return this.side; } merge(e, r, n, i, s, a) { - return n && (!(n instanceof Dd) || !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 Rd) || !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 Dd && 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 Rd && 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; @@ -4903,7 +4903,7 @@ class Dd extends Fn { return n ? n.slice(i, i + this.length) : nn.empty; } domAtPos(e) { - return (this.length ? e == 0 : this.side > 0) ? Ia.before(this.dom) : Ia.after(this.dom, e == this.length); + return (this.length ? e == 0 : this.side > 0) ? Pa.before(this.dom) : Pa.after(this.dom, e == this.length); } domBoundsAround() { return null; @@ -4918,7 +4918,7 @@ class Dd extends Fn { 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 G_(s, !a); + return Q_(s, !a); } get isEditable() { return !1; @@ -4933,7 +4933,7 @@ class Dd extends Fn { super.destroy(), this.dom && this.widget.destroy(this.dom); } } -class gv extends Fn { +class hv extends Fn { constructor(e) { super(), this.side = e; } @@ -4944,10 +4944,10 @@ class gv extends Fn { return !1; } become(e) { - return e instanceof gv && e.side == this.side; + return e instanceof hv && e.side == this.side; } split() { - return new gv(this.side); + return new hv(this.side); } sync() { if (!this.dom) { @@ -4959,7 +4959,7 @@ class gv extends Fn { return this.side; } domAtPos(e) { - return this.side > 0 ? Ia.before(this.dom) : Ia.after(this.dom); + return this.side > 0 ? Pa.before(this.dom) : Pa.after(this.dom); } localPosFromDOM() { return 0; @@ -4977,8 +4977,8 @@ class gv extends Fn { return !0; } } -lu.prototype.children = Dd.prototype.children = gv.prototype.children = I$; -function Ase(t, e) { +su.prototype.children = Rd.prototype.children = hv.prototype.children = S$; +function xse(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; @@ -5000,13 +5000,13 @@ function Ase(t, e) { if (a.dom.parentNode == r) return a.domAtPos(0); } - return new Ia(r, 0); + return new Pa(r, 0); } -function Rse(t, e, r) { +function wse(t, e, r) { let n, { children: i } = t; - r > 0 && e instanceof _f && i.length && (n = i[i.length - 1]) instanceof _f && n.mark.eq(e.mark) ? Rse(n, e.children[0], r - 1) : (i.push(e), e.setParent(t)), t.length += e.length; + r > 0 && e instanceof Cf && i.length && (n = i[i.length - 1]) instanceof Cf && n.mark.eq(e.mark) ? wse(n, e.children[0], r - 1) : (i.push(e), e.setParent(t)), t.length += e.length; } -function Lse(t, e, r) { +function Ose(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++) { @@ -5016,25 +5016,25 @@ function Lse(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) : rCe(t); + return l ? l.coordsAt(Math.max(0, l == n ? i : a), r) : VTe(t); } -function rCe(t) { +function VTe(t) { let e = t.dom.lastChild; if (!e) return t.dom.getBoundingClientRect(); - let r = Qx(e); + let r = qx(e); return r[r.length - 1] || null; } -function WM(t, e) { +function zM(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 jV = /* @__PURE__ */ Object.create(null); -function hT(t, e, r) { +const $V = /* @__PURE__ */ Object.create(null); +function cT(t, e, r) { if (t == e) return !0; - t || (t = jV), e || (e = jV); + t || (t = $V), e || (e = $V); 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; @@ -5043,7 +5043,7 @@ function hT(t, e, r) { return !1; return !0; } -function YM(t, e, r) { +function qM(t, e, r) { let n = !1; if (e) for (let i in e) @@ -5053,7 +5053,7 @@ function YM(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 nCe(t) { +function WTe(t) { let e = /* @__PURE__ */ Object.create(null); for (let r = 0; r < t.attributes.length; r++) { let n = t.attributes[r]; @@ -5061,7 +5061,7 @@ function nCe(t) { } return e; } -class nl { +class el { eq(e) { return !1; } @@ -5092,10 +5092,10 @@ class nl { destroy(e) { } } -var po = /* @__PURE__ */ function(t) { +var uo = /* @__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; -}(po || (po = {})); -class Ht extends pg { +}(uo || (uo = {})); +class Ht extends ug { constructor(e, r, n, i) { super(), this.startSide = e, this.endSide = r, this.widget = n, this.spec = i; } @@ -5103,24 +5103,24 @@ class Ht extends pg { return !1; } static mark(e) { - return new bk(e); + return new mk(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 hp(e, r, r, n, e.widget || null, !1); + return r += n && !e.inlineOrder ? r > 0 ? 3e8 : -4e8 : r > 0 ? 1e8 : -1e8, new ap(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 } = Mse(e, r); + let { start: s, end: a } = kse(e, r); n = (s ? r ? -3e8 : -1 : 5e8) - 1, i = (a ? r ? 2e8 : 1 : -6e8) + 1; } - return new hp(e, n, i, r, e.widget || null, !0); + return new ap(e, n, i, r, e.widget || null, !0); } static line(e) { - return new xk(e); + return new vk(e); } static set(e, r = !1) { return jr.of(e, r); @@ -5130,14 +5130,14 @@ class Ht extends pg { } } Ht.none = jr.empty; -class bk extends Ht { +class mk extends Ht { constructor(e) { - let { start: r, end: n } = Mse(e); + let { start: r, end: n } = kse(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 bk && 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)) && hT(this.attrs, e.attrs, "class"); + return this == e || e instanceof mk && 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)) && cT(this.attrs, e.attrs, "class"); } range(e, r = e) { if (e >= r) @@ -5145,13 +5145,13 @@ class bk extends Ht { return super.range(e, r); } } -bk.prototype.point = !1; -class xk extends Ht { +mk.prototype.point = !1; +class vk extends Ht { constructor(e) { super(-2e8, -2e8, null, e); } eq(e) { - return e instanceof xk && this.spec.class == e.spec.class && hT(this.spec.attributes, e.spec.attributes); + return e instanceof vk && this.spec.class == e.spec.class && cT(this.spec.attributes, e.spec.attributes); } range(e, r = e) { if (r != e) @@ -5159,20 +5159,20 @@ class xk extends Ht { return super.range(e, r); } } -xk.prototype.mapMode = gi.TrackBefore; -xk.prototype.point = !0; -class hp extends Ht { +vk.prototype.mapMode = gi.TrackBefore; +vk.prototype.point = !0; +class ap extends Ht { constructor(e, r, n, i, s, a) { super(r, n, s, e), this.block = i, this.isReplace = a, this.mapMode = i ? r <= 0 ? gi.TrackBefore : gi.TrackAfter : gi.TrackDel; } get type() { - return this.startSide != this.endSide ? po.WidgetRange : this.startSide <= 0 ? po.WidgetBefore : po.WidgetAfter; + return this.startSide != this.endSide ? uo.WidgetRange : this.startSide <= 0 ? uo.WidgetBefore : uo.WidgetAfter; } get heightRelevant() { return this.block || !!this.widget && (this.widget.estimatedHeight >= 5 || this.widget.lineBreaks > 0); } eq(e) { - return e instanceof hp && iCe(this.widget, e.widget) && this.block == e.block && this.startSide == e.startSide && this.endSide == e.endSide; + return e instanceof ap && YTe(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)) @@ -5182,32 +5182,32 @@ class hp extends Ht { return super.range(e, r); } } -hp.prototype.point = !0; -function Mse(t, e = !1) { +ap.prototype.point = !0; +function kse(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 iCe(t, e) { +function YTe(t, e) { return t == e || !!(t && e && t.compare(e)); } -function H3(t, e, r, n = 0) { +function Y5(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 Gi extends Fn { +class Yi extends Fn { 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 Gi)) + if (!(n instanceof Yi)) return !1; this.dom || n.transferDOM(this); } - return i && this.setDeco(n ? n.attrs : null), Cse(this, e, r, n ? n.children.slice() : [], s, a), !0; + return i && this.setDeco(n ? n.attrs : null), vse(this, e, r, n ? n.children.slice() : [], s, a), !0; } split(e) { - let r = new Gi(); + let r = new Yi(); if (r.breakAfter = this.breakAfter, this.length == 0) return r; let { i: n, off: i } = this.childPos(e); @@ -5222,28 +5222,28 @@ class Gi extends Fn { !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) { - hT(this.attrs, e) || (this.dom && (this.prevAttrs = this.attrs, this.markDirty()), this.attrs = e); + cT(this.attrs, e) || (this.dom && (this.prevAttrs = this.attrs, this.markDirty()), this.attrs = e); } append(e, r) { - Rse(this, e, r); + wse(this, e, r); } addLineDeco(e) { let r = e.spec.attributes, n = e.spec.class; - r && (this.attrs = WM(r, this.attrs || {})), n && (this.attrs = WM({ class: n }, this.attrs || {})); + r && (this.attrs = zM(r, this.attrs || {})), n && (this.attrs = zM({ class: n }, this.attrs || {})); } domAtPos(e) { - return Ase(this, e); + return xse(this, e); } reuseDOM(e) { e.nodeName == "DIV" && (this.setDOM(e), this.flags |= 6); } sync(e, r) { var n; - this.dom ? this.flags & 4 && (xse(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 && (YM(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 && (hse(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 && (qM(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 && Fn.get(i) instanceof _f; ) + for (; i && Fn.get(i) instanceof Cf; ) i = i.lastChild; - if (!i || !this.length || i.nodeName != "BR" && ((n = Fn.get(i)) === null || n === void 0 ? void 0 : n.isEditable) == !1 && (!nr.ios || !this.children.some((s) => s instanceof lu))) { + if (!i || !this.length || i.nodeName != "BR" && ((n = Fn.get(i)) === null || n === void 0 ? void 0 : n.isEditable) == !1 && (!nr.ios || !this.children.some((s) => s instanceof su))) { let s = document.createElement("BR"); s.cmIgnore = !0, this.dom.appendChild(s); } @@ -5253,9 +5253,9 @@ class Gi extends Fn { return null; let e = 0, r; for (let n of this.children) { - if (!(n instanceof lu) || /[^ -~]/.test(n.text)) + if (!(n instanceof su) || /[^ -~]/.test(n.text)) return null; - let i = Qx(n.dom); + let i = qx(n.dom); if (i.length != 1) return null; e += i[0].width, r = i[0].height; @@ -5267,7 +5267,7 @@ class Gi extends Fn { } : null; } coordsAt(e, r) { - let n = Lse(this, e, r); + let n = Ose(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) { @@ -5278,7 +5278,7 @@ class Gi extends Fn { return n; } become(e) { - return e instanceof Gi && this.children.length == 0 && e.children.length == 0 && hT(this.attrs, e.attrs) && this.breakAfter == e.breakAfter; + return e instanceof Yi && this.children.length == 0 && e.children.length == 0 && cT(this.attrs, e.attrs) && this.breakAfter == e.breakAfter; } covers() { return !0; @@ -5287,7 +5287,7 @@ class Gi extends Fn { 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 Gi) + if (s instanceof Yi) return s; if (a > r) break; @@ -5297,24 +5297,24 @@ class Gi extends Fn { return null; } } -class vf extends Fn { +class mf extends Fn { 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 vf) || !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 mf) || !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 ? Ia.before(this.dom) : Ia.after(this.dom, e == this.length); + return e == 0 ? Pa.before(this.dom) : Pa.after(this.dom, e == this.length); } split(e) { let r = this.length - e; this.length = e; - let n = new vf(this.widget, r, this.deco); + let n = new mf(this.widget, r, this.deco); return n.breakAfter = this.breakAfter, n; } get children() { - return I$; + return S$; } 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.widget.editable || (this.dom.contentEditable = "false")); @@ -5326,7 +5326,7 @@ class vf extends Fn { return null; } become(e) { - return e instanceof vf && 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 mf && 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; @@ -5342,7 +5342,7 @@ class vf extends Fn { } coordsAt(e, r) { let n = this.widget.coordsAt(this.dom, e, r); - return n || (this.widget instanceof GM ? null : G_(this.dom.getBoundingClientRect(), this.length ? e == 0 : r <= 0)); + return n || (this.widget instanceof UM ? null : Q_(this.dom.getBoundingClientRect(), this.length ? e == 0 : r <= 0)); } destroy() { super.destroy(), this.dom && this.widget.destroy(this.dom); @@ -5352,7 +5352,7 @@ class vf extends Fn { return r == n ? !1 : e < 0 ? r < 0 : n > 0; } } -class GM extends nl { +class UM extends el { constructor(e) { super(), this.height = e; } @@ -5376,7 +5376,7 @@ class GM extends nl { return !1; } } -class lx { +class ax { 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; } @@ -5384,19 +5384,19 @@ class lx { 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 vf && e.deco.endSide < 0); + return !(e.breakAfter || e instanceof mf && e.deco.endSide < 0); } getLine() { - return this.curLine || (this.content.push(this.curLine = new Gi()), this.atCursorPos = !0), this.curLine; + return this.curLine || (this.content.push(this.curLine = new Yi()), this.atCursorPos = !0), this.curLine; } flushBuffer(e = this.bufferMarks) { - this.pendingBuffer && (this.curLine.append(X4(new gv(-1), e), e.length), this.pendingBuffer = 0); + this.pendingBuffer && (this.curLine.append(Y4(new hv(-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 vf) && 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 mf) && this.getLine(); } buildText(e, r, n) { for (; e > 0; ) { @@ -5411,42 +5411,42 @@ class lx { 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(X4(new lu(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(Y4(new su(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 hp) { + if (this.disallowBlockEffectsFor[a] && n instanceof ap) { 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 hp) + if (n instanceof ap) if (n.block) - n.startSide > 0 && !this.posCovered() && this.getLine(), this.addBlockWidget(new vf(n.widget || mv.block, o, n)); + n.startSide > 0 && !this.posCovered() && this.getLine(), this.addBlockWidget(new mf(n.widget || fv.block, o, n)); else { - let l = Dd.create(n.widget || mv.inline, 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(X4(new gv(1), i), s), s = i.length + Math.max(0, s - i.length)), f.append(X4(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 = Rd.create(n.widget || fv.inline, 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(Y4(new hv(1), i), s), s = i.length + Math.max(0, s - i.length)), f.append(Y4(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 lx(e, r, n, s); + let a = new ax(e, r, n, s); return a.openEnd = jr.spans(i, r, n, a), a.openStart < 0 && (a.openStart = a.openEnd), a.finish(a.openEnd), a; } } -function X4(t, e) { +function Y4(t, e) { for (let r of e) - t = new _f(r, [t], t.length); + t = new Cf(r, [t], t.length); return t; } -class mv extends nl { +class fv extends el { constructor(e) { super(), this.tag = e; } @@ -5463,30 +5463,30 @@ class mv extends nl { return !0; } } -mv.inline = /* @__PURE__ */ new mv("span"); -mv.block = /* @__PURE__ */ new mv("div"); +fv.inline = /* @__PURE__ */ new fv("span"); +fv.block = /* @__PURE__ */ new fv("div"); var Xn = /* @__PURE__ */ function(t) { return t[t.LTR = 0] = "LTR", t[t.RTL = 1] = "RTL", t; }(Xn || (Xn = {})); -const vg = Xn.LTR, $$ = Xn.RTL; -function Dse(t) { +const dg = Xn.LTR, T$ = Xn.RTL; +function Sse(t) { let e = []; for (let r = 0; r < t.length; r++) e.push(1 << +t[r]); return e; } -const sCe = /* @__PURE__ */ Dse("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"), aCe = /* @__PURE__ */ Dse("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"), HM = /* @__PURE__ */ Object.create(null), Tu = []; +const GTe = /* @__PURE__ */ Sse("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"), HTe = /* @__PURE__ */ Sse("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"), QM = /* @__PURE__ */ Object.create(null), Ou = []; for (let t of ["()", "[]", "{}"]) { let e = /* @__PURE__ */ t.charCodeAt(0), r = /* @__PURE__ */ t.charCodeAt(1); - HM[e] = r, HM[r] = -e; + QM[e] = r, QM[r] = -e; } -function Pse(t) { - return t <= 247 ? sCe[t] : 1424 <= t && t <= 1524 ? 2 : 1536 <= t && t <= 1785 ? aCe[t - 1536] : 1774 <= t && t <= 2220 ? 4 : 8192 <= t && t <= 8204 ? 256 : 64336 <= t && t <= 65023 ? 4 : 1; +function Tse(t) { + return t <= 247 ? GTe[t] : 1424 <= t && t <= 1524 ? 2 : 1536 <= t && t <= 1785 ? HTe[t - 1536] : 1774 <= t && t <= 2220 ? 4 : 8192 <= t && t <= 8204 ? 256 : 64336 <= t && t <= 65023 ? 4 : 1; } -const oCe = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/; -class Pd { +const XTe = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/; +class Ld { get dir() { - return this.level % 2 ? $$ : vg; + return this.level % 2 ? T$ : dg; } constructor(e, r, n) { this.from = e, this.to = r, this.level = n; @@ -5512,22 +5512,22 @@ class Pd { return s; } } -function Nse(t, e) { +function Cse(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 || !Nse(n.inner, i.inner)) + if (n.from != i.from || n.to != i.to || n.direction != i.direction || !Cse(n.inner, i.inner)) return !1; } return !0; } const $n = []; -function lCe(t, e, r, n, i) { +function jTe(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 = Pse(t.charCodeAt(u)); + let d = Tse(t.charCodeAt(u)); d == 512 ? d = h : d == 8 && f == 4 && (d = 16), $n[u] = d == 4 ? 2 : d, d & 7 && (f = d), h = d; } for (let u = a, h = l, f = l; u < o; u++) { @@ -5548,43 +5548,43 @@ function lCe(t, e, r, n, i) { } } } -function cCe(t, e, r, n, i) { +function ZTe(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 = HM[d = t.charCodeAt(f)]) + if (p = QM[d = t.charCodeAt(f)]) if (p < 0) { for (let m = o - 3; m >= 0; m -= 3) - if (Tu[m + 1] == -p) { - let v = Tu[m + 2], y = v & 2 ? i : v & 4 ? v & 1 ? s : i : 0; - y && ($n[f] = $n[Tu[m]] = y), o = m; + if (Ou[m + 1] == -p) { + let v = Ou[m + 2], y = v & 2 ? i : v & 4 ? v & 1 ? s : i : 0; + y && ($n[f] = $n[Ou[m]] = y), o = m; break; } } else { - if (Tu.length == 189) + if (Ou.length == 189) break; - Tu[o++] = f, Tu[o++] = d, Tu[o++] = l; + Ou[o++] = f, Ou[o++] = d, Ou[o++] = l; } else if ((g = $n[f]) == 2 || g == 1) { let m = g == i; l = m ? 0 : 1; for (let v = o - 3; v >= 0; v -= 3) { - let y = Tu[v + 2]; + let y = Ou[v + 2]; if (y & 2) break; if (m) - Tu[v + 2] |= 2; + Ou[v + 2] |= 2; else { if (y & 4) break; - Tu[v + 2] |= 4; + Ou[v + 2] |= 4; } } } } } -function uCe(t, e, r, n) { +function KTe(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; ) { @@ -5609,7 +5609,7 @@ function uCe(t, e, r, n) { } } } -function XM(t, e, r, n, i, s, a) { +function VM(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; ) { @@ -5640,9 +5640,9 @@ function XM(t, e, r, n, i, s, a) { if (u++, d) d.push(m); else { - m.from > l && a.push(new Pd(l, m.from, p)); - let v = m.direction == vg != !(p % 2); - jM(t, v ? n + 1 : n, i, m.inner, m.from, m.to, a), l = m.to; + m.from > l && a.push(new Ld(l, m.from, p)); + let v = m.direction == dg != !(p % 2); + WM(t, v ? n + 1 : n, i, m.inner, m.from, m.to, a), l = m.to; } g = m.to; } else { @@ -5650,7 +5650,7 @@ function XM(t, e, r, n, i, s, a) { break; g++; } - d ? XM(t, l, g, n + 1, i, d, a) : l < g && a.push(new Pd(l, g, p)), l = g; + d ? VM(t, l, g, n + 1, i, d, a) : l < g && a.push(new Ld(l, g, p)), l = g; } else for (let l = r, u = s.length; l > e; ) { @@ -5681,9 +5681,9 @@ function XM(t, e, r, n, i, s, a) { if (d) d.push(m); else { - m.to < l && a.push(new Pd(m.to, l, p)); - let v = m.direction == vg != !(p % 2); - jM(t, v ? n + 1 : n, i, m.inner, m.from, m.to, a), l = m.from; + m.to < l && a.push(new Ld(m.to, l, p)); + let v = m.direction == dg != !(p % 2); + WM(t, v ? n + 1 : n, i, m.inner, m.from, m.to, a), l = m.from; } g = m.from; } else { @@ -5691,85 +5691,85 @@ function XM(t, e, r, n, i, s, a) { break; g--; } - d ? XM(t, g, l, n + 1, i, d, a) : g < l && a.push(new Pd(g, l, p)), l = g; + d ? VM(t, g, l, n + 1, i, d, a) : g < l && a.push(new Ld(g, l, p)), l = g; } } -function jM(t, e, r, n, i, s, a) { +function WM(t, e, r, n, i, s, a) { let o = e % 2 ? 2 : 1; - lCe(t, i, s, n, o), cCe(t, i, s, n, o), uCe(i, s, n, o), XM(t, i, s, e, r, n, a); + jTe(t, i, s, n, o), ZTe(t, i, s, n, o), KTe(i, s, n, o), VM(t, i, s, e, r, n, a); } -function hCe(t, e, r) { +function JTe(t, e, r) { if (!t) - return [new Pd(0, 0, e == $$ ? 1 : 0)]; - if (e == vg && !r.length && !oCe.test(t)) - return Ise(t.length); + return [new Ld(0, 0, e == T$ ? 1 : 0)]; + if (e == dg && !r.length && !XTe.test(t)) + return Ese(t.length); if (r.length) for (; t.length > $n.length; ) $n[$n.length] = 256; - let n = [], i = e == vg ? 0 : 1; - return jM(t, i, i, r, 0, t.length, n), n; + let n = [], i = e == dg ? 0 : 1; + return WM(t, i, i, r, 0, t.length, n), n; } -function Ise(t) { - return [new Pd(0, t, 0)]; +function Ese(t) { + return [new Ld(0, t, 0)]; } -let $se = ""; -function fCe(t, e, r, n, i) { +let _se = ""; +function eCe(t, e, r, n, i) { var s; - let a = n.head - t.from, o = Pd.find(e, a, (s = n.bidiLevel) !== null && s !== void 0 ? s : -1, n.assoc), l = e[o], u = l.side(i, r); + let a = n.head - t.from, o = Ld.find(e, a, (s = n.bidiLevel) !== null && s !== void 0 ? s : -1, n.assoc), l = e[o], u = l.side(i, r); if (a == u) { let d = o += i ? 1 : -1; if (d < 0 || d >= e.length) return null; l = e[o = d], a = l.side(!i, r), u = l.side(i, r); } - let h = la(t.text, a, l.forward(i, r)); - (h < l.from || h > l.to) && (h = u), $se = t.text.slice(Math.min(a, h), Math.max(a, h)); + let h = oa(t.text, a, l.forward(i, r)); + (h < l.from || h > l.to) && (h = u), _se = t.text.slice(Math.min(a, h), Math.max(a, h)); let f = o == (i ? e.length - 1 : 0) ? null : e[o + (i ? 1 : -1)]; return f && h == u && f.level + (i ? 0 : 1) < l.level ? ft.cursor(f.side(!i, r) + t.from, f.forward(i, r) ? 1 : -1, f.level) : ft.cursor(h + t.from, l.forward(i, r) ? -1 : 1, l.level); } -function dCe(t, e, r) { +function tCe(t, e, r) { for (let n = e; n < r; n++) { - let i = Pse(t.charCodeAt(n)); + let i = Tse(t.charCodeAt(n)); if (i == 1) - return vg; + return dg; if (i == 2 || i == 4) - return $$; + return T$; } - return vg; + return dg; } -const Bse = /* @__PURE__ */ Gt.define(), Fse = /* @__PURE__ */ Gt.define(), zse = /* @__PURE__ */ Gt.define(), qse = /* @__PURE__ */ Gt.define(), ZM = /* @__PURE__ */ Gt.define(), Use = /* @__PURE__ */ Gt.define(), Qse = /* @__PURE__ */ Gt.define(), B$ = /* @__PURE__ */ Gt.define(), F$ = /* @__PURE__ */ Gt.define(), Vse = /* @__PURE__ */ Gt.define({ +const Ase = /* @__PURE__ */ Gt.define(), Rse = /* @__PURE__ */ Gt.define(), Lse = /* @__PURE__ */ Gt.define(), Mse = /* @__PURE__ */ Gt.define(), YM = /* @__PURE__ */ Gt.define(), Dse = /* @__PURE__ */ Gt.define(), Pse = /* @__PURE__ */ Gt.define(), C$ = /* @__PURE__ */ Gt.define(), E$ = /* @__PURE__ */ Gt.define(), Nse = /* @__PURE__ */ Gt.define({ combine: (t) => t.some((e) => e) -}), Wse = /* @__PURE__ */ Gt.define({ +}), Ise = /* @__PURE__ */ Gt.define({ combine: (t) => t.some((e) => e) -}), Yse = /* @__PURE__ */ Gt.define(); -class N1 { +}), $se = /* @__PURE__ */ Gt.define(); +class L1 { 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 N1(this.range.map(e), this.y, this.x, this.yMargin, this.xMargin, this.isSnapshot); + return e.empty ? this : new L1(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 N1(ft.cursor(e.doc.length), this.y, this.x, this.yMargin, this.xMargin, this.isSnapshot); + return this.range.to <= e.doc.length ? this : new L1(ft.cursor(e.doc.length), this.y, this.x, this.yMargin, this.xMargin, this.isSnapshot); } } -const j4 = /* @__PURE__ */ _r.define({ map: (t, e) => t.map(e) }), Gse = /* @__PURE__ */ _r.define(); -function Ho(t, e, r) { - let n = t.facet(qse); +const G4 = /* @__PURE__ */ _r.define({ map: (t, e) => t.map(e) }), Bse = /* @__PURE__ */ _r.define(); +function Wo(t, e, r) { + let n = t.facet(Mse); 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 af = /* @__PURE__ */ Gt.define({ combine: (t) => t.length ? t[0] : !0 }); -let pCe = 0; -const Cb = /* @__PURE__ */ Gt.define(); +const sf = /* @__PURE__ */ Gt.define({ combine: (t) => t.length ? t[0] : !0 }); +let rCe = 0; +const Tb = /* @__PURE__ */ Gt.define(); class fn { 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 fn(pCe++, e, n, i, (o) => { - let l = [Cb.of(o)]; - return a && l.push(Vx.of((u) => { + return new fn(rCe++, e, n, i, (o) => { + let l = [Tb.of(o)]; + return a && l.push(Ux.of((u) => { let h = u.plugin(o); return h ? a(h) : Ht.none; })), s && l.push(s(o)), l; @@ -5779,7 +5779,7 @@ class fn { return fn.define((n) => new e(n), r); } } -class Z7 { +class W7 { constructor(e) { this.spec = e, this.mustUpdate = null, this.value = null; } @@ -5791,7 +5791,7 @@ class Z7 { try { this.value.update(r); } catch (n) { - if (Ho(r.state, n, "CodeMirror plugin crashed"), this.value.destroy) + if (Wo(r.state, n, "CodeMirror plugin crashed"), this.value.destroy) try { this.value.destroy(); } catch { @@ -5803,7 +5803,7 @@ class Z7 { try { this.value = this.spec.create(e); } catch (r) { - Ho(e.state, r, "CodeMirror plugin crashed"), this.deactivate(); + Wo(e.state, r, "CodeMirror plugin crashed"), this.deactivate(); } return this; } @@ -5813,16 +5813,16 @@ class Z7 { try { this.value.destroy(); } catch (n) { - Ho(e.state, n, "CodeMirror plugin crashed"); + Wo(e.state, n, "CodeMirror plugin crashed"); } } deactivate() { this.spec = this.value = null; } } -const Hse = /* @__PURE__ */ Gt.define(), z$ = /* @__PURE__ */ Gt.define(), Vx = /* @__PURE__ */ Gt.define(), Xse = /* @__PURE__ */ Gt.define(), q$ = /* @__PURE__ */ Gt.define(), jse = /* @__PURE__ */ Gt.define(); -function ZV(t, e) { - let r = t.state.facet(jse); +const Fse = /* @__PURE__ */ Gt.define(), _$ = /* @__PURE__ */ Gt.define(), Ux = /* @__PURE__ */ Gt.define(), zse = /* @__PURE__ */ Gt.define(), A$ = /* @__PURE__ */ Gt.define(), qse = /* @__PURE__ */ Gt.define(); +function BV(t, e) { + let r = t.state.facet(qse); if (!r.length) return r; let n = r.map((s) => s instanceof Function ? s(t) : s), i = []; @@ -5833,7 +5833,7 @@ function ZV(t, e) { let u = s - e.from, h = a - e.from, f = i; for (let d = o.length - 1; d >= 0; d--, l--) { let p = o[d].spec.bidiIsolate, g; - if (p == null && (p = dCe(e.text, u, h)), l > 0 && f.length && (g = f[f.length - 1]).to == u && g.direction == p) + if (p == null && (p = tCe(e.text, u, h)), l > 0 && f.length && (g = f[f.length - 1]).to == u && g.direction == p) g.to = h, f = g.inner; else { let m = { from: u, to: h, direction: p, inner: [] }; @@ -5843,22 +5843,22 @@ function ZV(t, e) { } }), i; } -const Zse = /* @__PURE__ */ Gt.define(); -function U$(t) { +const Use = /* @__PURE__ */ Gt.define(); +function R$(t) { let e = 0, r = 0, n = 0, i = 0; - for (let s of t.state.facet(Zse)) { + for (let s of t.state.facet(Use)) { 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 Eb = /* @__PURE__ */ Gt.define(); -class uc { +const Cb = /* @__PURE__ */ Gt.define(); +class oc { constructor(e, r, n, i) { this.fromA = e, this.toA = r, this.fromB = n, this.toB = i; } join(e) { - return new uc(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 oc(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; @@ -5880,26 +5880,26 @@ class uc { 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 uc(p + u, g + u, p, g).addToSet(n), d > h) + if (p <= g && new oc(p + u, g + u, p, g).addToSet(n), d > h) break; s += 2; } if (!l) return n; - new uc(l.fromA, l.toA, l.fromB, l.toB).addToSet(n), a = l.toA, o = l.toB; + new oc(l.fromA, l.toA, l.fromB, l.toB).addToSet(n), a = l.toA, o = l.toB; } } } -class fT { +class uT { constructor(e, r, n) { - this.view = e, this.state = r, this.transactions = n, this.flags = 0, this.startState = e.state, this.changes = Hi.empty(this.startState.doc.length); + this.view = e, this.state = r, this.transactions = n, this.flags = 0, this.startState = e.state, this.changes = Gi.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 uc(s, a, o, l))), this.changedRanges = i; + this.changes.iterChangedRanges((s, a, o, l) => i.push(new oc(s, a, o, l))), this.changedRanges = i; } static create(e, r, n) { - return new fT(e, r, n); + return new uT(e, r, n); } get viewportChanged() { return (this.flags & 4) > 0; @@ -5926,28 +5926,28 @@ class fT { return this.flags == 0 && this.transactions.length == 0; } } -class KV extends Fn { +class FV extends Fn { get length() { return this.view.state.doc.length; } constructor(e) { - super(), this.view = e, this.decorations = [], this.dynamicDecorationMap = [!1], this.domChanged = null, this.hasComposition = null, this.markedForComposition = /* @__PURE__ */ new Set(), this.editContextFormatting = Ht.none, this.lastCompositionAfterCursor = !1, 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 Gi()], this.children[0].setParent(this), this.updateDeco(), this.updateInner([new uc(0, 0, 0, e.state.doc.length)], 0, null); + super(), this.view = e, this.decorations = [], this.dynamicDecorationMap = [!1], this.domChanged = null, this.hasComposition = null, this.markedForComposition = /* @__PURE__ */ new Set(), this.editContextFormatting = Ht.none, this.lastCompositionAfterCursor = !1, 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 Yi()], this.children[0].setParent(this), this.updateDeco(), this.updateInner([new oc(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), this.updateEditContextFormatting(e); let i = -1; - this.view.inputState.composing >= 0 && !this.view.observer.editContext && (!((r = this.domChanged) === null || r === void 0) && r.newSel ? i = this.domChanged.newSel.head : !wCe(e.changes, this.hasComposition) && !e.selectionSet && (i = e.state.selection.main.head)); - let s = i > -1 ? mCe(this.view, e.changes, i) : null; + this.view.inputState.composing >= 0 && !this.view.observer.editContext && (!((r = this.domChanged) === null || r === void 0) && r.newSel ? i = this.domChanged.newSel.head : !cCe(e.changes, this.hasComposition) && !e.selectionSet && (i = e.state.selection.main.head)); + let s = i > -1 ? iCe(this.view, e.changes, i) : null; if (this.domChanged = null, this.hasComposition) { this.markedForComposition.clear(); let { from: u, to: h } = this.hasComposition; - n = new uc(u, h, e.changes.mapPos(u, -1), e.changes.mapPos(h, 1)).addToSet(n.slice()); + n = new oc(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, (nr.ie || nr.chrome) && !s && e && e.state.doc.lines != e.startState.doc.lines && (this.forceSelection = !0); - let a = this.decorations, o = this.updateDeco(), l = bCe(a, o, e.changes); - return n = uc.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); + let a = this.decorations, o = this.updateDeco(), l = oCe(a, o, e.changes); + return n = oc.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); @@ -5960,7 +5960,7 @@ class KV extends Fn { let s = []; if (this.view.viewport.from || this.view.viewport.to < this.view.state.doc.length) for (let a of this.children) - a instanceof vf && a.widget instanceof GM && s.push(a.dom); + a instanceof mf && a.widget instanceof UM && s.push(a.dom); i.updateGaps(s); } updateChildren(e, r, n) { @@ -5971,14 +5971,14 @@ class KV extends Fn { 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 = lx.build(this.view.state.doc, h, n.range.fromB, this.decorations, this.dynamicDecorationMap), S = lx.build(this.view.state.doc, n.range.toB, f, this.decorations, this.dynamicDecorationMap); + let O = ax.build(this.view.state.doc, h, n.range.fromB, this.decorations, this.dynamicDecorationMap), S = ax.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 } = lx.build(this.view.state.doc, h, f, this.decorations, this.dynamicDecorationMap)); + ({ content: d, breakAtStart: p, openStart: g, openEnd: m } = ax.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); - Tse(this, b, w, v, y, d, p, g, m); + mse(this, b, w, v, y, d, p, g, m); } n && this.fixCompositionDOM(n); } @@ -5986,14 +5986,14 @@ class KV extends Fn { this.editContextFormatting = this.editContextFormatting.map(e.changes); for (let r of e.transactions) for (let n of r.effects) - n.is(Gse) && (this.editContextFormatting = n.value); + n.is(Bse) && (this.editContextFormatting = n.value); } compositionView(e) { - let r = new lu(e.text.nodeValue); + let r = new su(e.text.nodeValue); r.flags |= 8; for (let { deco: i } of e.marks) - r = new _f(i, [r], r.length); - let n = new Gi(); + r = new Cf(i, [r], r.length); + let n = new Yi(); return n.append(r, 0), n; } fixCompositionDOM(e) { @@ -6008,27 +6008,27 @@ class KV extends Fn { } 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 && !(this.view.state.facet(af) || this.dom.tabIndex > -1) && G3(this.dom, this.view.observer.selectionRange) && !(n && this.dom.contains(n)); + let n = this.view.root.activeElement, i = n == this.dom, s = !i && !(this.view.state.facet(sf) || this.dom.tabIndex > -1) && W5(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 (nr.gecko && o.empty && !this.hasComposition && gCe(l)) { + if (nr.gecko && o.empty && !this.hasComposition && nCe(l)) { let f = document.createTextNode(""); - this.view.observer.ignore(() => l.node.insertBefore(f, l.node.childNodes[l.offset] || null)), l = u = new Ia(f, 0), a = !0; + this.view.observer.ignore(() => l.node.insertBefore(f, l.node.childNodes[l.offset] || null)), l = u = new Pa(f, 0), a = !0; } let h = this.view.observer.selectionRange; - (a || !h.focusNode || (!ox(l.node, l.offset, h.anchorNode, h.anchorOffset) || !ox(u.node, u.offset, h.focusNode, h.focusOffset)) && !this.suppressWidgetCursorChange(h, o)) && (this.view.observer.ignore(() => { - nr.android && nr.chrome && this.dom.contains(h.focusNode) && xCe(h.focusNode, this.dom) && (this.dom.blur(), this.dom.focus({ preventScroll: !0 })); - let f = Ux(this.view.root); + (a || !h.focusNode || (!sx(l.node, l.offset, h.anchorNode, h.anchorOffset) || !sx(u.node, u.offset, h.focusNode, h.focusOffset)) && !this.suppressWidgetCursorChange(h, o)) && (this.view.observer.ignore(() => { + nr.android && nr.chrome && this.dom.contains(h.focusNode) && lCe(h.focusNode, this.dom) && (this.dom.blur(), this.dom.focus({ preventScroll: !0 })); + let f = zx(this.view.root); if (f) if (o.empty) { if (nr.gecko) { - let d = vCe(l.node, l.offset); + let d = sCe(l.node, l.offset); if (d && d != 3) { - let p = (d == 1 ? Ose : kse)(l.node, l.offset); - p && (l = new Ia(p.node, p.offset)); + let p = (d == 1 ? dse : pse)(l.node, l.offset); + p && (l = new Pa(p.node, p.offset)); } } f.collapse(l.node, l.offset), o.bidiLevel != null && f.caretBidiLevel !== void 0 && (f.caretBidiLevel = o.bidiLevel); @@ -6043,18 +6043,18 @@ class KV extends Fn { 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 Ia(h.anchorNode, h.anchorOffset), this.impreciseHead = u.precise ? null : new Ia(h.focusNode, h.focusOffset); + }), this.view.observer.setSelectionRange(l, u)), this.impreciseAnchor = l.precise ? null : new Pa(h.anchorNode, h.anchorOffset), this.impreciseHead = u.precise ? null : new Pa(h.focusNode, h.focusOffset); } suppressWidgetCursorChange(e, r) { - return this.hasComposition && r.empty && ox(e.focusNode, e.focusOffset, e.anchorNode, e.anchorOffset) && this.posFromDOM(e.focusNode, e.focusOffset) == r.head; + return this.hasComposition && r.empty && sx(e.focusNode, e.focusOffset, e.anchorNode, e.anchorOffset) && this.posFromDOM(e.focusNode, e.focusOffset) == r.head; } enforceCursorAssoc() { if (this.hasComposition) return; - let { view: e } = this, r = e.state.selection.main, n = Ux(e.root), { anchorNode: i, anchorOffset: s } = e.observer.selectionRange; + let { view: e } = this, r = e.state.selection.main, n = zx(e.root), { anchorNode: i, anchorOffset: s } = e.observer.selectionRange; if (!n || !r.empty || !r.assoc || !n.modify) return; - let a = Gi.find(this, r.head); + let a = Yi.find(this, r.head); if (!a) return; let o = a.posAtStart; @@ -6074,13 +6074,13 @@ class KV extends Fn { return e; for (let i = e.offset; !n && i < r.childNodes.length; i++) { let s = Fn.get(r.childNodes[i]); - s instanceof Gi && (n = s.domAtPos(0)); + s instanceof Yi && (n = s.domAtPos(0)); } for (let i = e.offset - 1; !n && i >= 0; i--) { let s = Fn.get(r.childNodes[i]); - s instanceof Gi && (n = s.domAtPos(s.length)); + s instanceof Yi && (n = s.domAtPos(s.length)); } - return n ? new Ia(n.node, n.offset, !0) : e; + return n ? new Pa(n.node, n.offset, !0) : e; } nearest(e) { for (let r = e; r; ) { @@ -6101,7 +6101,7 @@ class KV extends Fn { 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 Gi) + if (n < i.length || i instanceof Yi) break; r++, n = 0; } @@ -6113,9 +6113,9 @@ class KV extends Fn { let o = this.children[a], l = s - o.breakAfter, u = l - o.length; if (l < e) break; - if (u <= e && (u < e || o.covers(-1)) && (l > e || o.covers(1)) && (!n || o instanceof Gi && !(n instanceof Gi && r >= 0))) + if (u <= e && (u < e || o.covers(-1)) && (l > e || o.covers(1)) && (!n || o instanceof Yi && !(n instanceof Yi && r >= 0))) n = o, i = u; - else if (n && u == e && l == e && o instanceof vf && Math.abs(r) < 2) { + else if (n && u == e && l == e && o instanceof mf && Math.abs(r) < 2) { if (o.deco.startSide < 0) break; a && (n = null); @@ -6126,7 +6126,7 @@ class KV extends Fn { } coordsForChar(e) { let { i: r, off: n } = this.childPos(e, 1), i = this.children[r]; - if (!(i instanceof Gi)) + if (!(i instanceof Yi)) return null; for (; i.children.length; ) { let { i: o, off: l } = i.childPos(n, 1); @@ -6138,12 +6138,12 @@ class KV extends Fn { } n = l; } - if (!(i instanceof lu)) + if (!(i instanceof su)) return null; - let s = la(i.text, n); + let s = oa(i.text, n); if (s == n) return null; - let a = mg(i.dom, n, s).getClientRects(); + let a = fg(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) @@ -6160,7 +6160,7 @@ class KV extends Fn { if (u >= n) { let p = f.dom.getBoundingClientRect(); if (r.push(p.height), a) { - let g = f.dom.lastChild, m = g ? Qx(g) : []; + let g = f.dom.lastChild, m = g ? qx(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); @@ -6177,7 +6177,7 @@ class KV extends Fn { } measureTextSize() { for (let s of this.children) - if (s instanceof Gi) { + if (s instanceof Yi) { let a = s.measureTextSize(); if (a) return a; @@ -6185,13 +6185,13 @@ class KV extends Fn { 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 = Qx(e.firstChild)[0]; + let s = qx(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 Sse(this.children, e, r); + return r && (e -= this.children[--r].length), new gse(this.children, e, r); } computeBlockGapDeco() { let e = [], r = this.view.viewState; @@ -6200,7 +6200,7 @@ class KV extends Fn { if (a > n) { let o = (r.lineBlockAt(a).bottom - r.lineBlockAt(n).top) / this.view.scaleY; e.push(Ht.replace({ - widget: new GM(o), + widget: new UM(o), block: !0, inclusive: !0, isBlockGap: !0 @@ -6213,7 +6213,7 @@ class KV extends Fn { return Ht.set(e); } updateDeco() { - let e = 1, r = this.view.state.facet(Vx).map((s) => (this.dynamicDecorationMap[e++] = typeof s == "function") ? s(this.view) : s), n = !1, i = this.view.state.facet(Xse).map((s, a) => { + let e = 1, r = this.view.state.facet(Ux).map((s) => (this.dynamicDecorationMap[e++] = typeof s == "function") ? s(this.view) : s), n = !1, i = this.view.state.facet(zse).map((s, a) => { let o = typeof s == "function"; return o && (n = !0), o ? s(this.view) : s; }); @@ -6232,12 +6232,12 @@ class KV extends Fn { this.view.scrollDOM.scrollTop = u.top - e.yMargin, this.view.scrollDOM.scrollLeft = e.xMargin; return; } - for (let u of this.view.state.facet(Yse)) + for (let u of this.view.state.facet($se)) try { if (u(this.view, e.range, e)) return !0; } catch (h) { - Ho(this.view.state, h, "scroll handler"); + Wo(this.view.state, h, "scroll handler"); } let { range: r } = e, n = this.coordsAt(r.head, r.empty ? r.assoc : r.head > r.anchor ? -1 : 1), i; if (!n) @@ -6248,30 +6248,30 @@ class KV extends Fn { right: Math.max(n.right, i.right), bottom: Math.max(n.bottom, i.bottom) }); - let s = U$(this.view), a = { + let s = R$(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; - XTe(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 == Xn.LTR); + $Te(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 == Xn.LTR); } } -function gCe(t) { +function nCe(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"); } -function Kse(t, e) { +function Qse(t, e) { let r = t.observer.selectionRange; if (!r.focusNode) return null; - let n = Ose(r.focusNode, r.focusOffset), i = kse(r.focusNode, r.focusOffset), s = n || i; + let n = dse(r.focusNode, r.focusOffset), i = pse(r.focusNode, r.focusOffset), s = n || i; if (i && n && i.node != n.node) { let o = Fn.get(i.node); - if (!o || o instanceof lu && o.text != i.node.nodeValue) + if (!o || o instanceof su && o.text != i.node.nodeValue) s = i; else if (t.docView.lastCompositionAfterCursor) { let l = Fn.get(n.node); - !l || l instanceof lu && l.text != n.node.nodeValue || (s = i); + !l || l instanceof su && l.text != n.node.nodeValue || (s = i); } } if (t.docView.lastCompositionAfterCursor = s != n, !s) @@ -6279,25 +6279,25 @@ function Kse(t, e) { let a = e - s.offset; return { from: a, to: a + s.node.nodeValue.length, node: s.node }; } -function mCe(t, e, r) { - let n = Kse(t, r); +function iCe(t, e, r) { + let n = Qse(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 uc(l.mapPos(s), l.mapPos(a), s, a), h = []; + let l = e.invertedDesc, u = new oc(l.mapPos(s), l.mapPos(a), s, a), h = []; for (let f = i.parentNode; ; f = f.parentNode) { let d = Fn.get(f); - if (d instanceof _f) + if (d instanceof Cf) h.push({ node: f, deco: d.mark }); else { - if (d instanceof Gi || f.nodeName == "DIV" && f.parentNode == t.contentDOM) + if (d instanceof Yi || 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 bk({ + h.push({ node: f, deco: new mk({ inclusive: !0, - attributes: nCe(f), + attributes: WTe(f), tagName: f.tagName.toLowerCase() }) }); else @@ -6305,108 +6305,108 @@ function mCe(t, e, r) { } } } -function vCe(t, e) { +function sCe(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 yCe = class { +let aCe = class { constructor() { this.changes = []; } compareRange(e, r) { - H3(e, r, this.changes); + Y5(e, r, this.changes); } comparePoint(e, r) { - H3(e, r, this.changes); + Y5(e, r, this.changes); } boundChange(e) { - H3(e, e, this.changes); + Y5(e, e, this.changes); } }; -function bCe(t, e, r) { - let n = new yCe(); +function oCe(t, e, r) { + let n = new aCe(); return jr.compare(t, e, r, n), n.changes; } -function xCe(t, e) { +function lCe(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 wCe(t, e) { +function cCe(t, e) { let r = !1; return e && t.iterChangedRanges((n, i) => { n < e.to && i > e.from && (r = !0); }), r; } -function OCe(t, e, r = 1) { +function uCe(t, e, r = 1) { let n = t.charCategorizer(e), i = t.doc.lineAt(e), s = e - i.from; if (i.length == 0) return ft.cursor(e); s == 0 ? r = 1 : s == i.length && (r = -1); let a = s, o = s; - r < 0 ? a = la(i.text, s, !1) : o = la(i.text, s); + r < 0 ? a = oa(i.text, s, !1) : o = oa(i.text, s); let l = n(i.text.slice(a, o)); for (; a > 0; ) { - let u = la(i.text, a, !1); + let u = oa(i.text, a, !1); if (n(i.text.slice(u, a)) != l) break; a = u; } for (; o < i.length; ) { - let u = la(i.text, o); + let u = oa(i.text, o); if (n(i.text.slice(o, u)) != l) break; o = u; } return ft.range(a + i.from, o + i.from); } -function kCe(t, e) { +function hCe(t, e) { return e.left > t ? e.left - t : Math.max(0, t - e.right); } -function SCe(t, e) { +function fCe(t, e) { return e.top > t ? e.top - t : Math.max(0, t - e.bottom); } -function K7(t, e) { +function Y7(t, e) { return t.top < e.bottom - 1 && t.bottom > e.top + 1; } -function JV(t, e) { +function zV(t, e) { return e < t.top ? { top: e, left: t.left, right: t.right, bottom: t.bottom } : t; } -function eW(t, e) { +function qV(t, e) { return e > t.bottom ? { top: t.top, left: t.left, right: t.right, bottom: e } : t; } -function KM(t, e, r) { +function GM(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 = Qx(g); + let m = qx(g); for (let v = 0; v < m.length; v++) { let y = m[v]; - i && K7(i, y) && (y = JV(eW(y, i.bottom), i.top)); - let b = kCe(e, y), w = SCe(r, y); + i && Y7(i, y) && (y = zV(qV(y, i.bottom), i.top)); + let b = hCe(e, y), w = fCe(r, y); if (b == 0 && w == 0) - return g.nodeType == 3 ? tW(g, e, r) : KM(g, e, r); + return g.nodeType == 3 ? UV(g, e, r) : GM(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 && K7(h, y) ? h = eW(h, y.bottom) : f && K7(f, y) && (f = JV(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 && Y7(h, y) ? h = qV(h, y.bottom) : f && Y7(f, y) && (f = zV(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 tW(n, d, r); + return UV(n, d, r); if (o && n.contentEditable != "false") - return KM(n, d, r); + return GM(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 tW(t, e, r) { +function UV(t, e, r) { let n = t.nodeValue.length, i = -1, s = 1e9, a = 0; for (let o = 0; o < n; o++) { - let l = mg(t, o, o + 1).getClientRects(); + let l = fg(t, o, o + 1).getClientRects(); for (let u = 0; u < l.length; u++) { let h = l[u]; if (h.top == h.bottom) @@ -6415,7 +6415,7 @@ function tW(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 ((nr.chrome || nr.gecko) && mg(t, o).getBoundingClientRect().left == h.right && (p = !d), f <= 0) + if ((nr.chrome || nr.gecko) && fg(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; } @@ -6423,14 +6423,14 @@ function tW(t, e, r) { } return { node: t, offset: i > -1 ? i : a > 0 ? t.nodeValue.length : 0 }; } -function Jse(t, e, r, n = -1) { +function Vse(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 != po.Text; ) + for (let O = t.viewState.heightOracle.textHeight / 2, S = !1; l = t.elementAtHeight(d), l.type != uo.Text; ) for (; d = n > 0 ? l.bottom + O : l.top - O, !(d >= 0 && d <= u); ) { if (S) return r ? null : 0; @@ -6439,9 +6439,9 @@ function Jse(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 : rW(t, a, l, h, f); + return t.viewport.from == 0 ? 0 : r ? null : QV(t, a, l, h, f); if (p > t.viewport.to) - return t.viewport.to == t.state.doc.length ? t.state.doc.length : r ? null : rW(t, a, l, h, f); + return t.viewport.to == t.state.doc.length ? t.state.doc.length : r ? null : QV(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; @@ -6451,15 +6451,15 @@ function Jse(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) || nr.safari && TCe(y, b, h) || nr.chrome && CCe(y, b, h)) && (y = void 0)); + O && ({ startContainer: y, startOffset: b } = O, (!t.contentDOM.contains(y) || nr.safari && dCe(y, b, h) || nr.chrome && pCe(y, b, h)) && (y = void 0)); } - y && (b = Math.min(mh(y), b)); + y && (b = Math.min(dh(y), b)); } if (!y || !t.docView.dom.contains(y)) { - let O = Gi.find(t.docView, p); + let O = Yi.find(t.docView, p); if (!O) return d > l.top + l.height / 2 ? l.to : l.from; - ({ node: y, offset: b } = KM(O.dom, h, f)); + ({ node: y, offset: b } = GM(O.dom, h, f)); } let w = t.docView.nearest(y); if (!w) @@ -6470,25 +6470,25 @@ function Jse(t, e, r, n = -1) { } else return w.localPosFromDOM(y, b) + w.posAtStart; } -function rW(t, e, r, n, i) { +function QV(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 + BM(a, s, t.state.tabSize); + return r.from + DM(a, s, t.state.tabSize); } -function TCe(t, e, r) { +function dCe(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 mg(t, n - 1, n).getBoundingClientRect().left > r; + return fg(t, n - 1, n).getBoundingClientRect().left > r; } -function CCe(t, e, r) { +function pCe(t, e, r) { if (e != 0) return !1; for (let i = t; ; ) { @@ -6499,20 +6499,20 @@ function CCe(t, e, r) { break; i = s; } - let n = t.nodeType == 1 ? t.getBoundingClientRect() : mg(t, 0, Math.max(t.nodeValue.length, 1)).getBoundingClientRect(); + let n = t.nodeType == 1 ? t.getBoundingClientRect() : fg(t, 0, Math.max(t.nodeValue.length, 1)).getBoundingClientRect(); return r - n.left > 5; } -function JM(t, e) { +function HM(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 == po.Text)) + if (n.to > e || n.to == e && (n.to == r.to || n.type == uo.Text)) return n; } return r; } -function ECe(t, e, r, n) { - let i = JM(t, e.head), s = !n || i.type != po.Text || !(t.lineWrapping || i.widgetLineBreaks) ? null : t.coordsAtPos(e.assoc < 0 && e.head > i.from ? e.head - 1 : e.head); +function gCe(t, e, r, n) { + let i = HM(t, e.head), s = !n || i.type != uo.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 == Xn.LTR) ? a.right - 1 : a.left + 1, @@ -6523,10 +6523,10 @@ function ECe(t, e, r, n) { } return ft.cursor(r ? i.to : i.from, r ? -1 : 1); } -function nW(t, e, r, n) { +function VV(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 = fCe(i, s, a, o, r), h = $se; + let u = eCe(i, s, a, o, r), h = _se; if (!u) { if (i.number == (r ? t.state.doc.lines : 1)) return o; @@ -6544,14 +6544,14 @@ function nW(t, e, r, n) { o = u; } } -function _Ce(t, e, r) { +function mCe(t, e, r) { let n = t.state.charCategorizer(e), i = n(r); return (s) => { let a = n(s); return i == li.Space && (i = a), i == a; }; } -function ACe(t, e, r, n) { +function vCe(t, e, r, n) { let i = e.head, s = r ? 1 : -1; if (i == (r ? t.state.doc.length : 0)) return ft.cursor(i, e.assoc); @@ -6564,14 +6564,14 @@ function ACe(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 = Jse(t, { x: f, y: g }, !1, s); + let g = o + (d + p) * s, m = Vse(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 ft.cursor(m, y, void 0, a); } } } -function X3(t, e, r) { +function G5(t, e, r) { for (; ; ) { let n = 0; for (let i of t) @@ -6585,12 +6585,12 @@ function X3(t, e, r) { return e; } } -function J7(t, e, r) { - let n = X3(t.state.facet(q$).map((i) => i(t)), r.from, e.head > r.from ? -1 : 1); +function G7(t, e, r) { + let n = G5(t.state.facet(A$).map((i) => i(t)), r.from, e.head > r.from ? -1 : 1); return n == r.from ? r : ft.cursor(n, n < r.from ? 1 : -1); } -const _b = "\uFFFF"; -class RCe { +const Eb = "\uFFFF"; +class yCe { constructor(e, r) { this.points = e, this.text = "", this.lineSeparator = r.facet(qr.lineSeparator); } @@ -6598,7 +6598,7 @@ class RCe { this.text += e; } lineBreak() { - this.text += _b; + this.text += Eb; } readRange(e, r) { if (!e) @@ -6612,7 +6612,7 @@ class RCe { if (a == r) break; let o = Fn.get(i), l = Fn.get(a); - (o && l ? o.breakAfter : (o ? o.breakAfter : uT(i)) || uT(a) && (i.nodeName != "BR" || i.cmIgnore) && this.text.length > s) && this.lineBreak(), i = a; + (o && l ? o.breakAfter : (o ? o.breakAfter : lT(i)) || lT(a) && (i.nodeName != "BR" || i.cmIgnore) && this.text.length > s) && this.lineBreak(), i = a; } return this.findPointBefore(n, r), this; } @@ -6647,34 +6647,34 @@ class RCe { } findPointInside(e, r) { for (let n of this.points) - (e.nodeType == 3 ? n.node == e : e.contains(n.node)) && (n.pos = this.text.length + (LCe(e, n.node, n.offset) ? r : 0)); + (e.nodeType == 3 ? n.node == e : e.contains(n.node)) && (n.pos = this.text.length + (bCe(e, n.node, n.offset) ? r : 0)); } } -function LCe(t, e, r) { +function bCe(t, e, r) { for (; ; ) { - if (!e || r < mh(e)) + if (!e || r < dh(e)) return !1; if (e == t) return !0; - r = gg(e) + 1, e = e.parentNode; + r = hg(e) + 1, e = e.parentNode; } } -class iW { +class WV { constructor(e, r) { this.node = e, this.offset = r, this.pos = -1; } } -class MCe { +class xCe { constructor(e, r, n, i) { this.typeOver = i, this.bounds = null, this.text = "", this.domChanged = r > -1; 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 ? [] : NCe(e), l = new RCe(o, e.state); - l.readRange(this.bounds.startDOM, this.bounds.endDOM), this.text = l.text, this.newSel = ICe(o, this.bounds.from); + let o = s || a ? [] : kCe(e), l = new yCe(o, e.state); + l.readRange(this.bounds.startDOM, this.bounds.endDOM), this.text = l.text, this.newSel = SCe(o, this.bounds.from); } else { - let o = e.observer.selectionRange, l = s && s.node == o.focusNode && s.offset == o.focusOffset || !qM(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 || !qM(e.contentDOM, o.anchorNode) ? e.state.selection.main.anchor : e.docView.posFromDOM(o.anchorNode, o.anchorOffset), h = e.viewport; + let o = e.observer.selectionRange, l = s && s.node == o.focusNode && s.offset == o.focusOffset || !IM(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 || !IM(e.contentDOM, o.anchorNode) ? e.state.selection.main.anchor : e.docView.posFromDOM(o.anchorNode, o.anchorOffset), h = e.viewport; if ((nr.ios || nr.chrome) && e.state.selection.main.empty && l != u && (h.from > 0 || h.to < e.state.doc.length)) { let f = Math.min(l, u), d = Math.max(l, u), p = h.from - f, g = h.to - d; (p == 0 || p == 1 || f == 0) && (g == 0 || g == -1 || d == e.state.doc.length) && (l = 0, u = e.state.doc.length); @@ -6683,19 +6683,19 @@ class MCe { } } } -function eae(t, e) { +function Wse(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 || nr.android && e.text.length < o - a) && (l = i.to, u = "end"); - let h = PCe(t.state.doc.sliceString(a, o, _b), e.text, l - a, u); - h && (nr.chrome && s == 13 && h.toB == h.from + 2 && e.text.slice(h.from, h.toB) == _b + _b && h.toB--, r = { + let h = OCe(t.state.doc.sliceString(a, o, Eb), e.text, l - a, u); + h && (nr.chrome && s == 13 && h.toB == h.from + 2 && e.text.slice(h.from, h.toB) == Eb + Eb && h.toB--, r = { from: a + h.from, to: a + h.toA, - insert: nn.of(e.text.slice(h.from, h.toB).split(_b)) + insert: nn.of(e.text.slice(h.from, h.toB).split(Eb)) }); } else - n && (!t.hasFocus && t.state.facet(af) || n.main.eq(i)) && (n = null); + n && (!t.hasFocus && t.state.facet(sf) || 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) } : (nr.mac || nr.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 = ft.single(n.main.anchor - 1, n.main.head - 1)), r = { from: r.from, to: r.to, insert: nn.of([r.insert.toString().replace(".", " ")]) }) : 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 = { @@ -6704,25 +6704,25 @@ function eae(t, e) { insert: t.state.doc.slice(i.from, r.from).append(r.insert).append(t.state.doc.slice(r.to, i.to)) } : nr.chrome && r && r.from == r.to && r.from == i.head && r.insert.toString() == ` ` && t.lineWrapping && (n && (n = ft.single(n.main.anchor - 1, n.main.head - 1)), r = { from: i.from, to: i.to, insert: nn.of([" "]) }), r) - return Q$(t, r, n, s); + return L$(t, r, n, s); 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 Q$(t, e, r, n = -1) { +function L$(t, e, r, n = -1) { if (nr.ios && t.inputState.flushIOSKey(e)) return !0; let i = t.state.selection.main; - if (nr.android && (e.to == i.to && (e.from == i.from || e.from == i.from - 1 && t.state.sliceDoc(e.from, i.from) == " ") && e.insert.length == 1 && e.insert.lines == 2 && P1(t.contentDOM, "Enter", 13) || (e.from == i.from - 1 && e.to == i.to && e.insert.length == 0 || n == 8 && e.insert.length < e.to - e.from && e.to > i.head) && P1(t.contentDOM, "Backspace", 8) || e.from == i.from && e.to == i.to + 1 && e.insert.length == 0 && P1(t.contentDOM, "Delete", 46))) + if (nr.android && (e.to == i.to && (e.from == i.from || e.from == i.from - 1 && t.state.sliceDoc(e.from, i.from) == " ") && e.insert.length == 1 && e.insert.lines == 2 && R1(t.contentDOM, "Enter", 13) || (e.from == i.from - 1 && e.to == i.to && e.insert.length == 0 || n == 8 && e.insert.length < e.to - e.from && e.to > i.head) && R1(t.contentDOM, "Backspace", 8) || e.from == i.from && e.to == i.to + 1 && e.insert.length == 0 && R1(t.contentDOM, "Delete", 46))) return !0; let s = e.insert.toString(); t.inputState.composing >= 0 && t.inputState.composing++; - let a, o = () => a || (a = DCe(t, e, r)); - return t.state.facet(Use).some((l) => l(t, e.from, e.to, s, o)) || t.dispatch(o()), !0; + let a, o = () => a || (a = wCe(t, e, r)); + return t.state.facet(Dse).some((l) => l(t, e.from, e.to, s, o)) || t.dispatch(o()), !0; } -function DCe(t, e, r) { +function wCe(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) : ""; @@ -6730,7 +6730,7 @@ function DCe(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 && Kse(t, r.main.head); + let u = t.state.sliceDoc(e.from, e.to), h, f = r && Qse(t, r.main.head); if (f) { let g = e.insert.length - (e.to - e.from); h = { from: f.from, to: f.to - g }; @@ -6758,7 +6758,7 @@ function DCe(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 PCe(t, e, r, n) { +function OCe(t, e, r, n) { let i = Math.min(t.length, e.length), s = 0; for (; s < i && t.charCodeAt(s) == e.charCodeAt(s); ) s++; @@ -6780,28 +6780,28 @@ function PCe(t, e, r, n) { } return { from: s, toA: a, toB: o }; } -function NCe(t) { +function kCe(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 iW(r, n)), (i != r || s != n) && e.push(new iW(i, s))), e; + return r && (e.push(new WV(r, n)), (i != r || s != n) && e.push(new WV(i, s))), e; } -function ICe(t, e) { +function SCe(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 ? ft.single(r + e, n + e) : null; } -class $Ce { +class TCe { 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.tabFocusMode = -1, this.lastSelectionOrigin = null, this.lastSelectionTime = 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, nr.safari && e.contentDOM.addEventListener("input", () => null), nr.gecko && JCe(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.tabFocusMode = -1, this.lastSelectionOrigin = null, this.lastSelectionTime = 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, nr.safari && e.contentDOM.addEventListener("input", () => null), nr.gecko && qCe(e.contentDOM.ownerDocument); } handleEvent(e) { - !WCe(this.view, e) || this.ignoreDuringComposition(e) || e.type == "keydown" && this.keydown(e) || this.runHandlers(e.type, e); + !DCe(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]; @@ -6819,7 +6819,7 @@ class $Ce { } } ensureHandlers(e) { - let r = BCe(e), n = this.handlers, i = this.view.contentDOM; + let r = CCe(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]; @@ -6832,14 +6832,14 @@ class $Ce { keydown(e) { if (this.lastKeyCode = e.keyCode, this.lastKeyTime = Date.now(), e.keyCode == 9 && this.tabFocusMode > -1 && (!this.tabFocusMode || Date.now() <= this.tabFocusMode)) return !0; - if (this.tabFocusMode > 0 && e.keyCode != 27 && rae.indexOf(e.keyCode) < 0 && (this.tabFocusMode = -1), nr.android && nr.chrome && !e.synthetic && (e.keyCode == 13 || e.keyCode == 8)) + if (this.tabFocusMode > 0 && e.keyCode != 27 && Gse.indexOf(e.keyCode) < 0 && (this.tabFocusMode = -1), nr.android && nr.chrome && !e.synthetic && (e.keyCode == 13 || e.keyCode == 8)) return this.view.observer.delayAndroidKey(e.key, e.keyCode), !0; let r; - return nr.ios && !e.synthetic && !e.altKey && !e.metaKey && ((r = tae.find((n) => n.keyCode == e.keyCode)) && !e.ctrlKey || FCe.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 nr.ios && !e.synthetic && !e.altKey && !e.metaKey && ((r = Yse.find((n) => n.keyCode == e.keyCode)) && !e.ctrlKey || ECe.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(e) { let r = this.pendingIOSKey; - return !r || r.key == "Enter" && e && e.from < e.to && /^\S+$/.test(e.insert.toString()) ? !1 : (this.pendingIOSKey = void 0, P1(this.view.contentDOM, r.key, r.keyCode, r instanceof KeyboardEvent ? r : void 0)); + return !r || r.key == "Enter" && e && e.from < e.to && /^\S+$/.test(e.insert.toString()) ? !1 : (this.pendingIOSKey = void 0, R1(this.view.contentDOM, r.key, r.keyCode, r instanceof KeyboardEvent ? r : void 0)); } ignoreDuringComposition(e) { return /^key/.test(e.type) ? this.composing > 0 ? !0 : nr.safari && !nr.ios && this.compositionPendingKey && Date.now() - this.compositionEndedAt < 100 ? (this.compositionPendingKey = !1, !0) : !1 : !1; @@ -6854,16 +6854,16 @@ class $Ce { this.mouseSelection && this.mouseSelection.destroy(); } } -function sW(t, e) { +function YV(t, e) { return (r, n) => { try { return e.call(t, n, r); } catch (i) { - Ho(r.state, i); + Wo(r.state, i); } }; } -function BCe(t) { +function CCe(t) { let e = /* @__PURE__ */ Object.create(null); function r(n) { return e[n] || (e[n] = { observers: [], handlers: [] }); @@ -6873,37 +6873,37 @@ function BCe(t) { if (i && i.domEventHandlers) for (let s in i.domEventHandlers) { let a = i.domEventHandlers[s]; - a && r(s).handlers.push(sW(n.value, a)); + a && r(s).handlers.push(YV(n.value, a)); } if (i && i.domEventObservers) for (let s in i.domEventObservers) { let a = i.domEventObservers[s]; - a && r(s).observers.push(sW(n.value, a)); + a && r(s).observers.push(YV(n.value, a)); } } - for (let n in cu) - r(n).handlers.push(cu[n]); - for (let n in dc) - r(n).observers.push(dc[n]); + for (let n in au) + r(n).handlers.push(au[n]); + for (let n in uc) + r(n).observers.push(uc[n]); return e; } -const tae = [ +const Yse = [ { key: "Backspace", keyCode: 8, inputType: "deleteContentBackward" }, { key: "Enter", keyCode: 13, inputType: "insertParagraph" }, { key: "Enter", keyCode: 13, inputType: "insertLineBreak" }, { key: "Delete", keyCode: 46, inputType: "deleteContentForward" } -], FCe = "dthko", rae = [16, 17, 18, 20, 91, 92, 224, 225], Z4 = 6; -function K4(t) { +], ECe = "dthko", Gse = [16, 17, 18, 20, 91, 92, 224, 225], H4 = 6; +function X4(t) { return Math.max(0, t) * 0.7 + 8; } -function zCe(t, e) { +function _Ce(t, e) { return Math.max(Math.abs(t.clientX - e.clientX), Math.abs(t.clientY - e.clientY)); } -class qCe { +class ACe { 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.scrollParents = jTe(e.contentDOM), this.atoms = e.state.facet(q$).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.scrollParents = BTe(e.contentDOM), this.atoms = e.state.facet(A$).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(qr.allowMultipleSelections) && UCe(e, r), this.dragging = VCe(e, r) && sae(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(qr.allowMultipleSelections) && RCe(e, r), this.dragging = MCe(e, r) && jse(r) == 1 ? null : !1; } start(e) { this.dragging === !1 && this.select(e); @@ -6911,13 +6911,13 @@ class qCe { move(e) { if (e.buttons == 0) return this.destroy(); - if (this.dragging || this.dragging == null && zCe(this.startEvent, e) < 10) + if (this.dragging || this.dragging == null && _Ce(this.startEvent, e) < 10) return; this.select(this.lastEvent = e); let r = 0, n = 0, i = 0, s = 0, a = this.view.win.innerWidth, o = this.view.win.innerHeight; this.scrollParents.x && ({ left: i, right: a } = this.scrollParents.x.getBoundingClientRect()), this.scrollParents.y && ({ top: s, bottom: o } = this.scrollParents.y.getBoundingClientRect()); - let l = U$(this.view); - e.clientX - l.left <= i + Z4 ? r = -K4(i - e.clientX) : e.clientX + l.right >= a - Z4 && (r = K4(e.clientX - a)), e.clientY - l.top <= s + Z4 ? n = -K4(s - e.clientY) : e.clientY + l.bottom >= o - Z4 && (n = K4(e.clientY - o)), this.setScrollSpeed(r, n); + let l = R$(this.view); + e.clientX - l.left <= i + H4 ? r = -X4(i - e.clientX) : e.clientX + l.right >= a - H4 && (r = X4(e.clientX - a)), e.clientY - l.top <= s + H4 ? n = -X4(s - e.clientY) : e.clientY + l.bottom >= o - H4 && (n = X4(e.clientY - o)), this.setScrollSpeed(r, n); } up(e) { this.dragging == null && this.select(this.lastEvent), this.dragging || e.preventDefault(), this.destroy(); @@ -6939,10 +6939,10 @@ class qCe { for (let n = 0; n < e.ranges.length; n++) { let i = e.ranges[n], s = null; if (i.empty) { - let a = X3(this.atoms, i.from, 0); + let a = G5(this.atoms, i.from, 0); a != i.from && (s = ft.cursor(a, -1)); } else { - let a = X3(this.atoms, i.from, -1), o = X3(this.atoms, i.to, 1); + let a = G5(this.atoms, i.from, -1), o = G5(this.atoms, i.to, 1); (a != i.from || o != i.to) && (s = ft.range(i.from == i.anchor ? a : o, i.from == i.head ? a : o)); } s && (r || (r = e.ranges.slice()), r[n] = s); @@ -6960,19 +6960,19 @@ class qCe { e.transactions.some((r) => r.isUserEvent("input.type")) ? this.destroy() : this.style.update(e) && setTimeout(() => this.select(this.lastEvent), 20); } } -function UCe(t, e) { - let r = t.state.facet(Bse); +function RCe(t, e) { + let r = t.state.facet(Ase); return r.length ? r[0](e) : nr.mac ? e.metaKey : e.ctrlKey; } -function QCe(t, e) { - let r = t.state.facet(Fse); +function LCe(t, e) { + let r = t.state.facet(Rse); return r.length ? r[0](e) : nr.mac ? !e.altKey : !e.ctrlKey; } -function VCe(t, e) { +function MCe(t, e) { let { main: r } = t.state.selection; if (r.empty) return !1; - let n = Ux(t.root); + let n = zx(t.root); if (!n || n.rangeCount == 0) return !0; let i = n.getRangeAt(0).getClientRects(); @@ -6983,7 +6983,7 @@ function VCe(t, e) { } return !1; } -function WCe(t, e) { +function DCe(t, e) { if (!e.bubbles) return !0; if (e.defaultPrevented) @@ -6993,25 +6993,25 @@ function WCe(t, e) { return !1; return !0; } -const cu = /* @__PURE__ */ Object.create(null), dc = /* @__PURE__ */ Object.create(null), nae = nr.ie && nr.ie_version < 15 || nr.ios && nr.webkit_version < 604; -function YCe(t) { +const au = /* @__PURE__ */ Object.create(null), uc = /* @__PURE__ */ Object.create(null), Hse = nr.ie && nr.ie_version < 15 || nr.ios && nr.webkit_version < 604; +function PCe(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(), iae(t, r.value); + t.focus(), r.remove(), Xse(t, r.value); }, 50); } -function X_(t, e, r) { +function W_(t, e, r) { for (let n of t.facet(e)) r = n(r, t); return r; } -function iae(t, e) { - e = X_(t.state, B$, e); +function Xse(t, e) { + e = W_(t.state, C$, e); let { state: r } = t, n, i = 1, s = r.toText(e), a = s.lines == r.selection.ranges.length; - if (e9 != null && r.selection.ranges.every((l) => l.empty) && e9 == s.toString()) { + if (XM != null && r.selection.ranges.every((l) => l.empty) && XM == s.toString()) { let l = -1; n = r.changeByRange((u) => { let h = r.doc.lineAt(u.from); @@ -7037,27 +7037,27 @@ function iae(t, e) { scrollIntoView: !0 }); } -dc.scroll = (t) => { +uc.scroll = (t) => { t.inputState.lastScrollTop = t.scrollDOM.scrollTop, t.inputState.lastScrollLeft = t.scrollDOM.scrollLeft; }; -cu.keydown = (t, e) => (t.inputState.setSelectionOrigin("select"), e.keyCode == 27 && t.inputState.tabFocusMode != 0 && (t.inputState.tabFocusMode = Date.now() + 2e3), !1); -dc.touchstart = (t, e) => { +au.keydown = (t, e) => (t.inputState.setSelectionOrigin("select"), e.keyCode == 27 && t.inputState.tabFocusMode != 0 && (t.inputState.tabFocusMode = Date.now() + 2e3), !1); +uc.touchstart = (t, e) => { t.inputState.lastTouchTime = Date.now(), t.inputState.setSelectionOrigin("select.pointer"); }; -dc.touchmove = (t) => { +uc.touchmove = (t) => { t.inputState.setSelectionOrigin("select.pointer"); }; -cu.mousedown = (t, e) => { +au.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(zse)) + for (let n of t.state.facet(Lse)) if (r = n(t, e), r) break; - if (!r && e.button == 0 && (r = XCe(t, e)), r) { + if (!r && e.button == 0 && (r = $Ce(t, e)), r) { let n = !t.hasFocus; - t.inputState.startMouseSelection(new qCe(t, e, r, n)), n && t.observer.ignore(() => { - bse(t.contentDOM); + t.inputState.startMouseSelection(new ACe(t, e, r, n)), n && t.observer.ignore(() => { + use(t.contentDOM); let s = t.root.activeElement; s && !s.contains(t.contentDOM) && s.blur(); }); @@ -7067,19 +7067,19 @@ cu.mousedown = (t, e) => { } return !1; }; -function aW(t, e, r, n) { +function GV(t, e, r, n) { if (n == 1) return ft.cursor(e, r); if (n == 2) - return OCe(t.state, e, r); + return uCe(t.state, e, r); { - let i = Gi.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; + let i = Yi.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++, ft.range(a, o); } } -let oW = (t, e, r) => e >= r.top && e <= r.bottom && t >= r.left && t <= r.right; -function GCe(t, e, r, n) { - let i = Gi.find(t.docView, e); +let HV = (t, e, r) => e >= r.top && e <= r.bottom && t >= r.left && t <= r.right; +function NCe(t, e, r, n) { + let i = Yi.find(t.docView, e); if (!i) return 1; let s = e - i.posAtStart; @@ -7088,40 +7088,40 @@ function GCe(t, e, r, n) { if (s == i.length) return -1; let a = i.coordsAt(s, -1); - if (a && oW(r, n, a)) + if (a && HV(r, n, a)) return -1; let o = i.coordsAt(s, 1); - return o && oW(r, n, o) ? 1 : a && a.bottom >= n ? -1 : 1; + return o && HV(r, n, o) ? 1 : a && a.bottom >= n ? -1 : 1; } -function lW(t, e) { +function XV(t, e) { let r = t.posAtCoords({ x: e.clientX, y: e.clientY }, !1); - return { pos: r, bias: GCe(t, r, e.clientX, e.clientY) }; + return { pos: r, bias: NCe(t, r, e.clientX, e.clientY) }; } -const HCe = nr.ie && nr.ie_version <= 11; -let cW = null, uW = 0, hW = 0; -function sae(t) { - if (!HCe) +const ICe = nr.ie && nr.ie_version <= 11; +let jV = null, ZV = 0, KV = 0; +function jse(t) { + if (!ICe) return t.detail; - let e = cW, r = hW; - return cW = t, hW = Date.now(), uW = !e || r > Date.now() - 400 && Math.abs(e.clientX - t.clientX) < 2 && Math.abs(e.clientY - t.clientY) < 2 ? (uW + 1) % 3 : 1; + let e = jV, r = KV; + return jV = t, KV = Date.now(), ZV = !e || r > Date.now() - 400 && Math.abs(e.clientX - t.clientX) < 2 && Math.abs(e.clientY - t.clientY) < 2 ? (ZV + 1) % 3 : 1; } -function XCe(t, e) { - let r = lW(t, e), n = sae(e), i = t.state.selection; +function $Ce(t, e) { + let r = XV(t, e), n = jse(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 = lW(t, s), u, h = aW(t, l.pos, l.bias, n); + let l = XV(t, s), u, h = GV(t, l.pos, l.bias, n); if (r.pos != l.pos && !a) { - let f = aW(t, r.pos, r.bias, n), d = Math.min(f.from, h.from), p = Math.max(f.to, h.to); + let f = GV(t, r.pos, r.bias, n), d = Math.min(f.from, h.from), p = Math.max(f.to, h.to); h = d < h.from ? ft.range(d, p) : ft.range(p, d); } - return a ? i.replaceRange(i.main.extend(h.from, h.to)) : o && n == 1 && i.ranges.length > 1 && (u = jCe(i, l.pos)) ? u : o ? i.addRange(h) : ft.create([h]); + return a ? i.replaceRange(i.main.extend(h.from, h.to)) : o && n == 1 && i.ranges.length > 1 && (u = BCe(i, l.pos)) ? u : o ? i.addRange(h) : ft.create([h]); } }; } -function jCe(t, e) { +function BCe(t, e) { for (let r = 0; r < t.ranges.length; r++) { let { from: n, to: i } = t.ranges[r]; if (n <= e && i >= e) @@ -7129,7 +7129,7 @@ function jCe(t, e) { } return null; } -cu.dragstart = (t, e) => { +au.dragstart = (t, e) => { let { selection: { main: r } } = t.state; if (e.target.draggable) { let i = t.docView.nearest(e.target); @@ -7139,20 +7139,20 @@ cu.dragstart = (t, e) => { } } let { inputState: n } = t; - return n.mouseSelection && (n.mouseSelection.dragging = !0), n.draggedContent = r, e.dataTransfer && (e.dataTransfer.setData("Text", X_(t.state, F$, t.state.sliceDoc(r.from, r.to))), e.dataTransfer.effectAllowed = "copyMove"), !1; + return n.mouseSelection && (n.mouseSelection.dragging = !0), n.draggedContent = r, e.dataTransfer && (e.dataTransfer.setData("Text", W_(t.state, E$, t.state.sliceDoc(r.from, r.to))), e.dataTransfer.effectAllowed = "copyMove"), !1; }; -cu.dragend = (t) => (t.inputState.draggedContent = null, !1); -function fW(t, e, r, n) { - if (r = X_(t.state, B$, r), !r) +au.dragend = (t) => (t.inputState.draggedContent = null, !1); +function JV(t, e, r, n) { + if (r = W_(t.state, C$, r), !r) return; - let i = t.posAtCoords({ x: e.clientX, y: e.clientY }, !1), { draggedContent: s } = t.inputState, a = n && s && QCe(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 && LCe(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; } -cu.drop = (t, e) => { +au.drop = (t, e) => { if (!e.dataTransfer) return !1; if (t.state.readOnly) @@ -7160,7 +7160,7 @@ cu.drop = (t, e) => { let r = e.dataTransfer.files; if (r && r.length) { let n = Array(r.length), i = 0, s = () => { - ++i == r.length && fW(t, e, n.filter((a) => a != null).join(t.state.lineBreak), !1); + ++i == r.length && JV(t, e, n.filter((a) => a != null).join(t.state.lineBreak), !1); }; for (let a = 0; a < r.length; a++) { let o = new FileReader(); @@ -7172,18 +7172,18 @@ cu.drop = (t, e) => { } else { let n = e.dataTransfer.getData("Text"); if (n) - return fW(t, e, n, !0), !0; + return JV(t, e, n, !0), !0; } return !1; }; -cu.paste = (t, e) => { +au.paste = (t, e) => { if (t.state.readOnly) return !0; t.observer.flush(); - let r = nae ? null : e.clipboardData; - return r ? (iae(t, r.getData("text/plain") || r.getData("text/uri-list")), !0) : (YCe(t), !1); + let r = Hse ? null : e.clipboardData; + return r ? (Xse(t, r.getData("text/plain") || r.getData("text/uri-list")), !0) : (PCe(t), !1); }; -function ZCe(t, e) { +function FCe(t, e) { let r = t.dom.parentNode; if (!r) return; @@ -7192,7 +7192,7 @@ function ZCe(t, e) { n.remove(), t.focus(); }, 50); } -function KCe(t) { +function zCe(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)); @@ -7204,87 +7204,87 @@ function KCe(t) { } n = !0; } - return { text: X_(t, F$, e.join(t.lineBreak)), ranges: r, linewise: n }; + return { text: W_(t, E$, e.join(t.lineBreak)), ranges: r, linewise: n }; } -let e9 = null; -cu.copy = cu.cut = (t, e) => { - let { text: r, ranges: n, linewise: i } = KCe(t.state); +let XM = null; +au.copy = au.cut = (t, e) => { + let { text: r, ranges: n, linewise: i } = zCe(t.state); if (!r && !i) return !1; - e9 = i ? r : null, e.type == "cut" && !t.state.readOnly && t.dispatch({ + XM = i ? r : null, e.type == "cut" && !t.state.readOnly && t.dispatch({ changes: n, scrollIntoView: !0, userEvent: "delete.cut" }); - let s = nae ? null : e.clipboardData; - return s ? (s.clearData(), s.setData("text/plain", r), !0) : (ZCe(t, r), !1); + let s = Hse ? null : e.clipboardData; + return s ? (s.clearData(), s.setData("text/plain", r), !0) : (FCe(t, r), !1); }; -const aae = /* @__PURE__ */ Oo.define(); -function oae(t, e) { +const Zse = /* @__PURE__ */ bo.define(); +function Kse(t, e) { let r = []; - for (let n of t.facet(Qse)) { + for (let n of t.facet(Pse)) { let i = n(t, e); i && r.push(i); } - return r ? t.update({ effects: r, annotations: aae.of(!0) }) : null; + return r ? t.update({ effects: r, annotations: Zse.of(!0) }) : null; } -function lae(t) { +function Jse(t) { setTimeout(() => { let e = t.hasFocus; if (e != t.inputState.notifiedFocused) { - let r = oae(t.state, e); + let r = Kse(t.state, e); r ? t.dispatch(r) : t.update([]); } }, 10); } -dc.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), lae(t); +uc.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), Jse(t); }; -dc.blur = (t) => { - t.observer.clearSelectionRange(), lae(t); +uc.blur = (t) => { + t.observer.clearSelectionRange(), Jse(t); }; -dc.compositionstart = dc.compositionupdate = (t) => { +uc.compositionstart = uc.compositionupdate = (t) => { t.observer.editContext || (t.inputState.compositionFirstChange == null && (t.inputState.compositionFirstChange = !0), t.inputState.composing < 0 && (t.inputState.composing = 0)); }; -dc.compositionend = (t) => { +uc.compositionend = (t) => { t.observer.editContext || (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, nr.chrome && nr.android ? t.observer.flushSoon() : t.inputState.compositionPendingChange ? Promise.resolve().then(() => t.observer.flush()) : setTimeout(() => { t.inputState.composing < 0 && t.docView.hasComposition && t.update([]); }, 50)); }; -dc.contextmenu = (t) => { +uc.contextmenu = (t) => { t.inputState.lastContextMenu = Date.now(); }; -cu.beforeinput = (t, e) => { +au.beforeinput = (t, e) => { var r, n; if (e.inputType == "insertReplacementText" && t.observer.editContext) { let s = (r = e.dataTransfer) === null || r === void 0 ? void 0 : r.getData("text/plain"), a = e.getTargetRanges(); if (s && a.length) { let o = a[0], l = t.posAtDOM(o.startContainer, o.startOffset), u = t.posAtDOM(o.endContainer, o.endOffset); - return Q$(t, { from: l, to: u, insert: t.state.toText(s) }, null), !0; + return L$(t, { from: l, to: u, insert: t.state.toText(s) }, null), !0; } } let i; - if (nr.chrome && nr.android && (i = tae.find((s) => s.inputType == e.inputType)) && (t.observer.delayAndroidKey(i.key, i.keyCode), i.key == "Backspace" || i.key == "Delete")) { + if (nr.chrome && nr.android && (i = Yse.find((s) => s.inputType == e.inputType)) && (t.observer.delayAndroidKey(i.key, i.keyCode), i.key == "Backspace" || i.key == "Delete")) { let s = ((n = window.visualViewport) === null || n === void 0 ? void 0 : n.height) || 0; setTimeout(() => { var a; (((a = window.visualViewport) === null || a === void 0 ? void 0 : a.height) || 0) > s + 10 && t.hasFocus && (t.contentDOM.blur(), t.focus()); }, 100); } - return nr.ios && e.inputType == "deleteContentForward" && t.observer.flushSoon(), nr.safari && e.inputType == "insertText" && t.inputState.composing >= 0 && setTimeout(() => dc.compositionend(t, e), 20), !1; + return nr.ios && e.inputType == "deleteContentForward" && t.observer.flushSoon(), nr.safari && e.inputType == "insertText" && t.inputState.composing >= 0 && setTimeout(() => uc.compositionend(t, e), 20), !1; }; -const dW = /* @__PURE__ */ new Set(); -function JCe(t) { - dW.has(t) || (dW.add(t), t.addEventListener("copy", () => { +const eW = /* @__PURE__ */ new Set(); +function qCe(t) { + eW.has(t) || (eW.add(t), t.addEventListener("copy", () => { }), t.addEventListener("cut", () => { })); } -const pW = ["pre-wrap", "normal", "pre-line", "break-spaces"]; -let vv = !1; -function gW() { - vv = !1; +const tW = ["pre-wrap", "normal", "pre-line", "break-spaces"]; +let dv = !1; +function rW() { + dv = !1; } -class eEe { +class UCe { constructor(e) { this.lineWrapping = e, this.doc = nn.empty, this.heightSamples = {}, this.lineHeight = 14, this.charWidth = 7, this.textHeight = 14, this.lineLength = 30; } @@ -7299,7 +7299,7 @@ class eEe { return this.doc = e, this; } mustRefreshForWrapping(e) { - return pW.indexOf(e) > -1 != this.lineWrapping; + return tW.indexOf(e) > -1 != this.lineWrapping; } mustRefreshForHeights(e) { let r = !1; @@ -7310,7 +7310,7 @@ class eEe { return r; } refresh(e, r, n, i, s, a) { - let o = pW.indexOf(e) > -1, l = Math.round(r) != Math.round(this.lineHeight) || this.lineWrapping != o; + let o = tW.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++) { @@ -7321,7 +7321,7 @@ class eEe { return l; } } -class tEe { +class QCe { constructor(e, r) { this.from = e, this.heights = r, this.index = 0; } @@ -7329,12 +7329,12 @@ class tEe { return this.index < this.heights.length; } } -class Vu { +class qu { 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" ? po.Text : Array.isArray(this._content) ? this._content : this._content.type; + return typeof this._content == "number" ? uo.Text : Array.isArray(this._content) ? this._content : this._content.type; } get to() { return this.from + this.length; @@ -7343,21 +7343,21 @@ class Vu { return this.top + this.height; } get widget() { - return this._content instanceof hp ? this._content.widget : null; + return this._content instanceof ap ? 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 Vu(this.from, this.length + e.length, this.top, this.height + e.height, r); + return new qu(this.from, this.length + e.length, this.top, this.height + e.height, r); } } var ti = /* @__PURE__ */ function(t) { return t[t.ByPos = 0] = "ByPos", t[t.ByHeight = 1] = "ByHeight", t[t.ByPosNoHeight = 2] = "ByPosNoHeight", t; }(ti || (ti = {})); -const j3 = 1e-3; -class go { +const H5 = 1e-3; +class ho { constructor(e, r, n = 2) { this.length = e, this.height = r, this.flags = n; } @@ -7368,10 +7368,10 @@ class go { this.flags = (e ? 2 : 0) | this.flags & -3; } setHeight(e) { - this.height != e && (Math.abs(this.height - e) > j3 && (vv = !0), this.height = e); + this.height != e && (Math.abs(this.height - e) > H5 && (dv = !0), this.height = e); } replace(e, r, n) { - return go.of(n); + return ho.of(n); } decomposeLeft(e, r) { r.push(this); @@ -7386,13 +7386,13 @@ class go { 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, ti.ByPosNoHeight, n, 0, 0)); h += d.from - l, l = d.from; - let g = V$.build(n.setDoc(a), e, h, f); - s = dT(s, s.replace(l, u, g)); + let g = M$.build(n.setDoc(a), e, h, f); + s = hT(s, s.replace(l, u, g)); } return s.updateHeight(n, 0); } static empty() { - return new gl(0, 0); + return new fl(0, 0); } static of(e) { if (e.length == 1) @@ -7416,19 +7416,19 @@ class go { o && (s += o.size); } let a = 0; - return e[r - 1] == null ? (a = 1, r--) : e[r] == null && (a = 1, n++), new rEe(go.of(e.slice(0, r)), a, go.of(e.slice(n))); + return e[r - 1] == null ? (a = 1, r--) : e[r] == null && (a = 1, n++), new VCe(ho.of(e.slice(0, r)), a, ho.of(e.slice(n))); } } -function dT(t, e) { - return t == e ? t : (t.constructor != e.constructor && (vv = !0), e); +function hT(t, e) { + return t == e ? t : (t.constructor != e.constructor && (dv = !0), e); } -go.prototype.size = 1; -class cae extends go { +ho.prototype.size = 1; +class eae extends ho { constructor(e, r, n) { super(e, r), this.deco = n; } blockAt(e, r, n, i) { - return new Vu(i, this.length, n, this.height, this.deco || 0); + return new qu(i, this.length, n, this.height, this.deco || 0); } lineAt(e, r, n, i, s) { return this.blockAt(0, n, i, s); @@ -7443,16 +7443,16 @@ class cae extends go { return `block(${this.length})`; } } -class gl extends cae { +class fl extends eae { constructor(e, r) { super(e, r, null), this.collapsed = 0, this.widgetHeight = 0, this.breaks = 0; } blockAt(e, r, n, i) { - return new Vu(i, this.length, n, this.height, this.breaks); + return new qu(i, this.length, n, this.height, this.breaks); } replace(e, r, n) { let i = n[0]; - return n.length == 1 && (i instanceof gl || i instanceof ra && i.flags & 4) && Math.abs(this.length - i.length) < 10 ? (i instanceof ra ? i = new gl(i.length, this.height) : i.height = this.height, this.outdated || (i.outdated = !1), i) : go.of(n); + return n.length == 1 && (i instanceof fl || i instanceof ta && i.flags & 4) && Math.abs(this.length - i.length) < 10 ? (i instanceof ta ? i = new fl(i.length, this.height) : i.height = this.height, this.outdated || (i.outdated = !1), i) : ho.of(n); } updateHeight(e, r = 0, n = !1, i) { return i && i.from <= r && i.more ? this.setHeight(i.heights[i.index++]) : (n || this.outdated) && this.setHeight(Math.max(this.widgetHeight, e.heightForLine(this.length - this.collapsed)) + this.breaks * e.lineHeight), this.outdated = !1, this; @@ -7461,7 +7461,7 @@ class gl extends cae { return `line(${this.length}${this.collapsed ? -this.collapsed : ""}${this.widgetHeight ? ":" + this.widgetHeight : ""})`; } } -class ra extends go { +class ta extends ho { constructor(e) { super(e, 0); } @@ -7478,10 +7478,10 @@ class ra extends go { let { firstLine: s, lastLine: a, perLine: o, perChar: l } = this.heightMetrics(r, i); if (r.lineWrapping) { let u = i + (e < r.lineHeight ? 0 : 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 Vu(h.from, h.length, d, f, 0); + return new qu(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 Vu(h, f, n + o * u, o, 0); + return new qu(h, f, n + o * u, o, 0); } } lineAt(e, r, n, i, s) { @@ -7489,10 +7489,10 @@ class ra extends go { return this.blockAt(e, n, i, s); if (r == ti.ByPosNoHeight) { let { from: p, to: g } = n.doc.lineAt(e); - return new Vu(p, g - p, 0, 0, 0); + return new qu(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 Vu(u.from, u.length, Math.max(i, Math.min(d, i + this.height - h)), h, 0); + return new qu(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); @@ -7504,42 +7504,42 @@ class ra extends go { f += l * g + u * (e - s - g); } let p = l + u * d.length; - a(new Vu(d.from, d.length, f, p, 0)), f += p, h = d.to + 1; + a(new qu(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 ra ? n[n.length - 1] = new ra(s.length + i) : n.push(null, new ra(i - 1)); + s instanceof ta ? n[n.length - 1] = new ta(s.length + i) : n.push(null, new ta(i - 1)); } if (e > 0) { let s = n[0]; - s instanceof ra ? n[0] = new ra(e + s.length) : n.unshift(new ra(e - 1), null); + s instanceof ta ? n[0] = new ta(e + s.length) : n.unshift(new ta(e - 1), null); } - return go.of(n); + return ho.of(n); } decomposeLeft(e, r) { - r.push(new ra(e - 1), null); + r.push(new ta(e - 1), null); } decomposeRight(e, r) { - r.push(null, new ra(this.length - e - 1)); + r.push(null, new ta(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 ra(i.from - r - 1).updateHeight(e, r)); o <= s && i.more; ) { + for (i.from > r && a.push(new ta(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) >= j3 && (l = -2); - let d = new gl(h, f); + l == -1 ? l = f : Math.abs(f - l) >= H5 && (l = -2); + let d = new fl(h, f); d.outdated = !1, a.push(d), o += h + 1; } - o <= s && a.push(null, new ra(s - o).updateHeight(e, o)); - let u = go.of(a); - return (l < 0 || Math.abs(u.height - this.height) >= j3 || Math.abs(l - this.heightMetrics(e, r).perLine) >= j3) && (vv = !0), dT(this, u); + o <= s && a.push(null, new ta(s - o).updateHeight(e, o)); + let u = ho.of(a); + return (l < 0 || Math.abs(u.height - this.height) >= H5 || Math.abs(l - this.heightMetrics(e, r).perLine) >= H5) && (dv = !0), hT(this, u); } else (n || this.outdated) && (this.setHeight(e.heightForGap(r, r + this.length)), this.outdated = !1); return this; @@ -7548,7 +7548,7 @@ class ra extends go { return `gap(${this.length})`; } } -class rEe extends go { +class VCe extends ho { 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; } @@ -7586,11 +7586,11 @@ class rEe extends go { let a = s.length; for (let o of n) s.push(o); - if (e > 0 && mW(s, a - 1), r < this.length) { + if (e > 0 && nW(s, a - 1), r < this.length) { let o = s.length; - this.decomposeRight(r, s), mW(s, o); + this.decomposeRight(r, s), nW(s, o); } - return go.of(s); + return ho.of(s); } decomposeLeft(e, r) { let n = this.left.length; @@ -7605,7 +7605,7 @@ class rEe extends go { 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 ? go.of(this.break ? [e, null, r] : [e, r]) : (this.left = dT(this.left, e), this.right = dT(this.right, r), this.setHeight(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 ? ho.of(this.break ? [e, null, r] : [e, r]) : (this.left = hT(this.left, e), this.right = hT(this.right, r), this.setHeight(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; @@ -7615,12 +7615,12 @@ class rEe extends go { return this.left + (this.break ? " " : "-") + this.right; } } -function mW(t, e) { +function nW(t, e) { let r, n; - t[e] == null && (r = t[e - 1]) instanceof ra && (n = t[e + 1]) instanceof ra && t.splice(e - 1, 3, new ra(r.length + 1 + n.length)); + t[e] == null && (r = t[e - 1]) instanceof ta && (n = t[e + 1]) instanceof ta && t.splice(e - 1, 3, new ta(r.length + 1 + n.length)); } -const nEe = 5; -class V$ { +const WCe = 5; +class M$ { constructor(e, r) { this.pos = e, this.oracle = r, this.nodes = [], this.lineStart = -1, this.lineEnd = -1, this.covering = null, this.writtenTo = e; } @@ -7630,7 +7630,7 @@ class V$ { span(e, r) { if (this.lineStart > -1) { let n = Math.min(r, this.lineEnd), i = this.nodes[this.nodes.length - 1]; - i instanceof gl ? i.length += n - this.pos : (n > this.pos || !this.isCovered) && this.nodes.push(new gl(n - this.pos, -1)), this.writtenTo = n, r > n && (this.nodes.push(null), this.writtenTo++, this.lineStart = -1); + i instanceof fl ? i.length += n - this.pos : (n > this.pos || !this.isCovered) && this.nodes.push(new fl(n - this.pos, -1)), this.writtenTo = n, r > n && (this.nodes.push(null), this.writtenTo++, this.lineStart = -1); } this.pos = r; } @@ -7639,7 +7639,7 @@ class V$ { 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 cae(a, i, n)) : (a || s || i >= nEe) && this.addLineDeco(i, s, a); + n.block ? this.addBlock(new eae(a, i, n)) : (a || s || i >= WCe) && 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); @@ -7648,18 +7648,18 @@ class V$ { 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 gl(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 fl(this.pos - e, -1)), this.writtenTo = this.pos; } blankContent(e, r) { - let n = new ra(r - e); + let n = new ta(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 gl) + if (e instanceof fl) return e; - let r = new gl(0, -1); + let r = new fl(0, -1); return this.nodes.push(r), r; } addBlock(e) { @@ -7673,32 +7673,32 @@ class V$ { } finish(e) { let r = this.nodes.length == 0 ? null : this.nodes[this.nodes.length - 1]; - this.lineStart > -1 && !(r instanceof gl) && !this.isCovered ? this.nodes.push(new gl(0, -1)) : (this.writtenTo < this.pos || r == null) && this.nodes.push(this.blankContent(this.writtenTo, this.pos)); + this.lineStart > -1 && !(r instanceof fl) && !this.isCovered ? this.nodes.push(new fl(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 gl && i.updateHeight(this.oracle, n), n += i ? i.length : 1; + i instanceof fl && i.updateHeight(this.oracle, n), n += i ? i.length : 1; return this.nodes; } static build(e, r, n, i) { - let s = new V$(n, e); + let s = new M$(n, e); return jr.spans(r, n, i, s, 0), s.finish(n); } } -function iEe(t, e, r) { - let n = new sEe(); +function YCe(t, e, r) { + let n = new GCe(); return jr.compare(t, e, r, n, 0), n.changes; } -class sEe { +class GCe { constructor() { this.changes = []; } compareRange() { } comparePoint(e, r, n, i) { - (e < r || n && n.heightRelevant || i && i.heightRelevant) && H3(e, r, this.changes, 5); + (e < r || n && n.heightRelevant || i && i.heightRelevant) && Y5(e, r, this.changes, 5); } } -function aEe(t, e) { +function HCe(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) { @@ -7719,11 +7719,11 @@ function aEe(t, e) { bottom: Math.max(o, l) - (r.top + e) }; } -function oEe(t) { +function XCe(t) { let e = t.getBoundingClientRect(), r = t.ownerDocument.defaultView || window; return e.left < r.innerWidth && e.right > 0 && e.top < r.innerHeight && e.bottom > 0; } -function lEe(t, e) { +function jCe(t, e) { let r = t.getBoundingClientRect(); return { left: 0, @@ -7732,7 +7732,7 @@ function lEe(t, e) { bottom: r.bottom - (r.top + e) }; } -class e8 { +class H7 { constructor(e, r, n, i) { this.from = e, this.to = r, this.size = n, this.displaySize = i; } @@ -7748,11 +7748,11 @@ class e8 { } draw(e, r) { return Ht.replace({ - widget: new cEe(this.displaySize * (r ? e.scaleY : e.scaleX), r) + widget: new ZCe(this.displaySize * (r ? e.scaleY : e.scaleX), r) }).range(this.from, this.to); } } -class cEe extends nl { +class ZCe extends el { constructor(e, r) { super(), this.size = e, this.vertical = r; } @@ -7767,11 +7767,11 @@ class cEe extends nl { return this.vertical ? this.size : -1; } } -class vW { +class iW { 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 = !1, this.scaleX = 1, this.scaleY = 1, this.scrollAnchorPos = 0, this.scrollAnchorHeight = -1, this.scaler = yW, this.scrollTarget = null, this.printing = !1, this.mustMeasureContent = !0, this.defaultTextDirection = Xn.LTR, this.visibleRanges = [], this.mustEnforceCursorAssoc = !1; - let r = e.facet(z$).some((n) => typeof n != "function" && n.class == "cm-lineWrapping"); - this.heightOracle = new eEe(r), this.stateDeco = e.facet(Vx).filter((n) => typeof n != "function"), this.heightMap = go.empty().applyChanges(this.stateDeco, nn.empty, this.heightOracle.setDoc(e.doc), [new uc(0, 0, 0, e.doc.length)]); + 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 = !1, this.scaleX = 1, this.scaleY = 1, this.scrollAnchorPos = 0, this.scrollAnchorHeight = -1, this.scaler = sW, this.scrollTarget = null, this.printing = !1, this.mustMeasureContent = !0, this.defaultTextDirection = Xn.LTR, this.visibleRanges = [], this.mustEnforceCursorAssoc = !1; + let r = e.facet(_$).some((n) => typeof n != "function" && n.class == "cm-lineWrapping"); + this.heightOracle = new UCe(r), this.stateDeco = e.facet(Ux).filter((n) => typeof n != "function"), this.heightMap = ho.empty().applyChanges(this.stateDeco, nn.empty, this.heightOracle.setDoc(e.doc), [new oc(0, 0, 0, e.doc.length)]); for (let n = 0; n < 2 && (this.viewport = this.getViewport(0, null), !!this.updateForViewport()); n++) ; this.updateViewportLines(), this.lineGaps = this.ensureLineGaps([]), this.lineGapDeco = Ht.set(this.lineGaps.map((n) => n.draw(this, !1))), this.computeVisibleRanges(); @@ -7782,30 +7782,30 @@ class vW { 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 J4(s, a)); + e.push(new j4(s, a)); } } return this.viewports = e.sort((n, i) => n.from - i.from), this.updateScaler(); } updateScaler() { let e = this.scaler; - return this.scaler = this.heightMap.height <= 7e6 ? yW : new W$(this.heightOracle, this.heightMap, this.viewports), e.eq(this.scaler) ? 0 : 2; + return this.scaler = this.heightMap.height <= 7e6 ? sW : new D$(this.heightOracle, this.heightMap, this.viewports), e.eq(this.scaler) ? 0 : 2; } updateViewportLines() { this.viewportLines = [], this.heightMap.forEachLine(this.viewport.from, this.viewport.to, this.heightOracle.setDoc(this.state.doc), 0, 0, (e) => { - this.viewportLines.push(Ab(e, this.scaler)); + this.viewportLines.push(_b(e, this.scaler)); }); } update(e, r = null) { this.state = e.state; let n = this.stateDeco; - this.stateDeco = this.state.facet(Vx).filter((h) => typeof h != "function"); - let i = e.changedRanges, s = uc.extendWithRanges(i, iEe(n, this.stateDeco, e ? e.changes : Hi.empty(this.state.doc.length))), a = this.heightMap.height, o = this.scrolledToBottom ? null : this.scrollAnchorAt(this.scrollTop); - gW(), this.heightMap = this.heightMap.applyChanges(this.stateDeco, e.startState.doc, this.heightOracle.setDoc(this.state.doc), s), (this.heightMap.height != a || vv) && (e.flags |= 2), o ? (this.scrollAnchorPos = e.changes.mapPos(o.from, -1), this.scrollAnchorHeight = o.top) : (this.scrollAnchorPos = -1, this.scrollAnchorHeight = this.heightMap.height); + this.stateDeco = this.state.facet(Ux).filter((h) => typeof h != "function"); + let i = e.changedRanges, s = oc.extendWithRanges(i, YCe(n, this.stateDeco, e ? e.changes : Gi.empty(this.state.doc.length))), a = this.heightMap.height, o = this.scrolledToBottom ? null : this.scrollAnchorAt(this.scrollTop); + rW(), this.heightMap = this.heightMap.applyChanges(this.stateDeco, e.startState.doc, this.heightOracle.setDoc(this.state.doc), s), (this.heightMap.height != a || dv) && (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 = l.from != this.viewport.from || l.to != this.viewport.to; - this.viewport = l, e.flags |= this.updateForViewport(), (u || !e.changes.empty || e.flags & 2) && 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(e.changes), r && (this.scrollTarget = r), !this.mustEnforceCursorAssoc && e.selectionSet && e.view.lineWrapping && e.state.selection.main.empty && e.state.selection.main.assoc && !e.state.facet(Wse) && (this.mustEnforceCursorAssoc = !0); + this.viewport = l, e.flags |= this.updateForViewport(), (u || !e.changes.empty || e.flags & 2) && 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(e.changes), r && (this.scrollTarget = r), !this.mustEnforceCursorAssoc && e.selectionSet && e.view.lineWrapping && e.state.selection.main.empty && e.state.selection.main.assoc && !e.state.facet(Ise) && (this.mustEnforceCursorAssoc = !0); } measure(e) { let r = e.contentDOM, n = window.getComputedStyle(r), i = this.heightOracle, s = n.whiteSpace; @@ -7814,17 +7814,17 @@ class vW { this.contentDOMHeight = o.height, this.mustMeasureContent = !1; let u = 0, h = 0; if (o.width && o.height) { - let { scaleX: O, scaleY: S } = yse(r, o); + let { scaleX: O, scaleY: S } = cse(r, o); (O > 5e-3 && Math.abs(this.scaleX - O) > 5e-3 || S > 5e-3 && Math.abs(this.scaleY - S) > 5e-3) && (this.scaleX = O, this.scaleY = S, u |= 16, 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 |= 18), this.editorWidth != e.scrollDOM.clientWidth && (i.lineWrapping && (l = !0), this.editorWidth = e.scrollDOM.clientWidth, u |= 16); let p = e.scrollDOM.scrollTop * this.scaleY; - this.scrollTop != p && (this.scrollAnchorHeight = -1, this.scrollTop = p), this.scrolledToBottom = wse(e.scrollDOM); - let g = (this.printing ? lEe : aEe)(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 = fse(e.scrollDOM); + let g = (this.printing ? jCe : HCe)(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 && !oEe(e.dom)) + if (y != this.inView && (this.inView = y, y && (l = !0)), !this.inView && !this.scrollTarget && !XCe(e.dom)) return 0; let b = o.width; if ((this.contentDOMWidth != b || this.editorHeight != e.scrollDOM.clientHeight) && (this.contentDOMWidth = o.width, this.editorHeight = e.scrollDOM.clientHeight, u |= 16), l) { @@ -7833,12 +7833,12 @@ class vW { let { lineHeight: S, charWidth: C, textHeight: T } = e.docView.measureTextSize(); a = S > 0 && i.refresh(s, S, C, T, b / C, O), a && (e.docView.minWidth = 0, u |= 16); } - m > 0 && v > 0 ? h = Math.max(m, v) : m < 0 && v < 0 && (h = Math.min(m, v)), gW(); + m > 0 && v > 0 ? h = Math.max(m, v) : m < 0 && v < 0 && (h = Math.min(m, v)), rW(); for (let S of this.viewports) { let C = S.from == this.viewport.from ? O : e.docView.measureVisibleLineHeights(S); - this.heightMap = (a ? go.empty().applyChanges(this.stateDeco, nn.empty, this.heightOracle, [new uc(0, 0, 0, e.state.doc.length)]) : this.heightMap).updateHeight(i, 0, a, new tEe(S.from, C)); + this.heightMap = (a ? ho.empty().applyChanges(this.stateDeco, nn.empty, this.heightOracle, [new oc(0, 0, 0, e.state.doc.length)]) : this.heightMap).updateHeight(i, 0, a, new QCe(S.from, C)); } - vv && (u |= 2); + dv && (u |= 2); } let w = !this.viewportIsAppropriate(this.viewport, h) || this.scrollTarget && (this.scrollTarget.range.head < this.viewport.from || this.scrollTarget.range.head > this.viewport.to); return w && (u & 2 && (u |= this.updateScaler()), this.viewport = this.getViewport(h, this.scrollTarget), u |= this.updateForViewport()), (u & 2 || w) && this.updateViewportLines(), (this.lineGaps.length || this.viewport.to - this.viewport.from > 2e3 << 1) && this.updateLineGaps(this.ensureLineGaps(a ? [] : this.lineGaps, e)), u |= this.computeVisibleRanges(), this.mustEnforceCursorAssoc && (this.mustEnforceCursorAssoc = !1, e.docView.enforceCursorAssoc()), u; @@ -7850,19 +7850,19 @@ class vW { 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 J4(i.lineAt(a - n * 1e3, ti.ByHeight, s, 0, 0).from, i.lineAt(o + (1 - n) * 1e3, ti.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 j4(i.lineAt(a - n * 1e3, ti.ByHeight, s, 0, 0).from, i.lineAt(o + (1 - n) * 1e3, ti.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, ti.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 J4(i.lineAt(d - 1e3 / 2, ti.ByHeight, s, 0, 0).from, i.lineAt(d + h + 1e3 / 2, ti.ByHeight, s, 0, 0).to); + 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 j4(i.lineAt(d - 1e3 / 2, ti.ByHeight, s, 0, 0).from, i.lineAt(d + h + 1e3 / 2, ti.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 J4(this.heightMap.lineAt(n, ti.ByPos, this.heightOracle, 0, 0).from, this.heightMap.lineAt(i, ti.ByPos, this.heightOracle, 0, 0).to); + return new j4(this.heightMap.lineAt(n, ti.ByPos, this.heightOracle, 0, 0).from, this.heightMap.lineAt(i, ti.ByPos, this.heightOracle, 0, 0).to); } viewportIsAppropriate({ from: e, to: r }, n = 0) { if (!this.inView) @@ -7875,7 +7875,7 @@ class vW { return e; let n = []; for (let i of e) - r.touchesRange(i.from, i.to) || n.push(new e8(r.mapPos(i.from), r.mapPos(i.to), i.size, i.displaySize)); + r.touchesRange(i.from, i.to) || n.push(new H7(r.mapPos(i.from), r.mapPos(i.to), i.size, i.displaySize)); return n; } ensureLineGaps(e, r) { @@ -7892,31 +7892,31 @@ class vW { l(h, y - 10, d, p), l(y + 10, f, d, p); return; } - let v = hEe(e, (y) => y.from >= d.from && y.to <= d.to && Math.abs(y.from - h) < s && Math.abs(y.to - f) < s && !m.some((b) => y.from < b && y.to > b)); + let v = JCe(e, (y) => y.from >= d.from && y.to <= d.to && Math.abs(y.from - h) < s && Math.abs(y.to - f) < s && !m.some((b) => y.from < b && y.to > b)); if (!v) { if (f < d.to && r && n && r.visibleRanges.some((w) => w.from <= f && w.to >= f)) { let w = r.moveToLineBoundary(ft.cursor(f), !1, !0).head; w > h && (f = w); } let y = this.gapSize(d, h, f, p), b = n || y < 2e6 ? y : 2e6; - v = new e8(h, f, y, b); + v = new H7(h, f, y, b); } o.push(v); }, u = (h) => { - if (h.length < a || h.type != po.Text) + if (h.length < a || h.type != uo.Text) return; - let f = uEe(h.from, h.to, this.stateDeco); + let f = KCe(h.from, h.to, this.stateDeco); if (f.total < a) return; let d = this.scrollTarget ? this.scrollTarget.range.head : null, p, g; if (n) { let m = i / this.heightOracle.lineLength * this.heightOracle.lineHeight, v, y; if (d != null) { - let b = tS(f, d), w = ((this.visibleBottom - this.visibleTop) / 2 + m) / h.height; + let b = K4(f, d), w = ((this.visibleBottom - this.visibleTop) / 2 + m) / h.height; v = b - w, y = b + w; } else v = (this.visibleTop - h.top - m) / h.height, y = (this.visibleBottom - h.top + m) / h.height; - p = eS(f, v), g = eS(f, y); + p = Z4(f, v), g = Z4(f, y); } else { let m = f.total * this.heightOracle.charWidth, v = i * this.heightOracle.charWidth, y = 0; if (m > 2e6) @@ -7924,11 +7924,11 @@ class vW { C.from >= h.from && C.from < h.to && C.size != C.displaySize && C.from * this.heightOracle.charWidth + y < this.pixelViewport.left && (y = C.size - C.displaySize); let b = this.pixelViewport.left + y, w = this.pixelViewport.right + y, O, S; if (d != null) { - let C = tS(f, d), T = ((w - b) / 2 + v) / m; + let C = K4(f, d), T = ((w - b) / 2 + v) / m; O = C - T, S = C + T; } else O = (b - v) / m, S = (w + v) / m; - p = eS(f, O), g = eS(f, S); + p = Z4(f, O), g = Z4(f, S); } p > h.from && l(h.from, p, h, f), g < h.to && l(g, h.to, h, f); }; @@ -7937,11 +7937,11 @@ class vW { return o; } gapSize(e, r, n, i) { - let s = tS(i, n) - tS(i, r); + let s = K4(i, n) - K4(i, r); return this.heightOracle.lineWrapping ? e.height * s : i.total * this.heightOracle.charWidth * s; } updateLineGaps(e) { - e8.same(e, this.lineGaps) || (this.lineGaps = e, this.lineGapDeco = Ht.set(e.map((r) => r.draw(this, this.heightOracle.lineWrapping)))); + H7.same(e, this.lineGaps) || (this.lineGaps = e, this.lineGapDeco = Ht.set(e.map((r) => r.draw(this, this.heightOracle.lineWrapping)))); } computeVisibleRanges(e) { let r = this.stateDeco; @@ -7965,17 +7965,17 @@ class vW { return this.visibleRanges = n, i; } lineBlockAt(e) { - return e >= this.viewport.from && e <= this.viewport.to && this.viewportLines.find((r) => r.from <= e && r.to >= e) || Ab(this.heightMap.lineAt(e, ti.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) || _b(this.heightMap.lineAt(e, ti.ByPos, this.heightOracle, 0, 0), this.scaler); } lineBlockAtHeight(e) { - return e >= this.viewportLines[0].top && e <= this.viewportLines[this.viewportLines.length - 1].bottom && this.viewportLines.find((r) => r.top <= e && r.bottom >= e) || Ab(this.heightMap.lineAt(this.scaler.fromDOM(e), ti.ByHeight, this.heightOracle, 0, 0), this.scaler); + return e >= this.viewportLines[0].top && e <= this.viewportLines[this.viewportLines.length - 1].bottom && this.viewportLines.find((r) => r.top <= e && r.bottom >= e) || _b(this.heightMap.lineAt(this.scaler.fromDOM(e), ti.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 Ab(this.heightMap.blockAt(this.scaler.fromDOM(e), this.heightOracle, 0, 0), this.scaler); + return _b(this.heightMap.blockAt(this.scaler.fromDOM(e), this.heightOracle, 0, 0), this.scaler); } get docHeight() { return this.scaler.toDOM(this.heightMap.height); @@ -7984,12 +7984,12 @@ class vW { return this.docHeight + this.paddingTop + this.paddingBottom; } } -class J4 { +class j4 { constructor(e, r) { this.from = e, this.to = r; } } -function uEe(t, e, r) { +function KCe(t, e, r) { let n = [], i = t, s = 0; return jr.spans(r, t, e, { span() { @@ -7999,7 +7999,7 @@ function uEe(t, e, r) { } }, 20), i < e && (n.push({ from: i, to: e }), s += e - i), { total: s, ranges: n }; } -function eS({ total: t, ranges: e }, r) { +function Z4({ total: t, ranges: e }, r) { if (r <= 0) return e[0].from; if (r >= 1) @@ -8012,7 +8012,7 @@ function eS({ total: t, ranges: e }, r) { n -= o; } } -function tS(t, e) { +function K4(t, e) { let r = 0; for (let { from: n, to: i } of t.ranges) { if (e <= i) { @@ -8023,12 +8023,12 @@ function tS(t, e) { } return r / t.total; } -function hEe(t, e) { +function JCe(t, e) { for (let r of t) if (e(r)) return r; } -const yW = { +const sW = { toDOM(t) { return t; }, @@ -8040,7 +8040,7 @@ const yW = { return t == this; } }; -class W$ { +class D$ { constructor(e, r, n) { let i = 0, s = 0, a = 0; this.viewports = n.map(({ from: o, to: l }) => { @@ -8071,18 +8071,18 @@ class W$ { } } eq(e) { - return e instanceof W$ ? this.scale == e.scale && this.viewports.length == e.viewports.length && this.viewports.every((r, n) => r.from == e.viewports[n].from && r.to == e.viewports[n].to) : !1; + return e instanceof D$ ? this.scale == e.scale && this.viewports.length == e.viewports.length && this.viewports.every((r, n) => r.from == e.viewports[n].from && r.to == e.viewports[n].to) : !1; } } -function Ab(t, e) { +function _b(t, e) { if (e.scale == 1) return t; let r = e.toDOM(t.top), n = e.toDOM(t.bottom); - return new Vu(t.from, t.length, r, n - r, Array.isArray(t._content) ? t._content.map((i) => Ab(i, e)) : t._content); + return new qu(t.from, t.length, r, n - r, Array.isArray(t._content) ? t._content.map((i) => _b(i, e)) : t._content); } -const rS = /* @__PURE__ */ Gt.define({ combine: (t) => t.join(" ") }), t9 = /* @__PURE__ */ Gt.define({ combine: (t) => t.indexOf(!0) > -1 }), r9 = /* @__PURE__ */ Ef.newName(), uae = /* @__PURE__ */ Ef.newName(), hae = /* @__PURE__ */ Ef.newName(), fae = { "&light": "." + uae, "&dark": "." + hae }; -function n9(t, e, r) { - return new Ef(e, { +const J4 = /* @__PURE__ */ Gt.define({ combine: (t) => t.join(" ") }), jM = /* @__PURE__ */ Gt.define({ combine: (t) => t.indexOf(!0) > -1 }), ZM = /* @__PURE__ */ Tf.newName(), tae = /* @__PURE__ */ Tf.newName(), rae = /* @__PURE__ */ Tf.newName(), nae = { "&light": "." + tae, "&dark": "." + rae }; +function KM(t, e, r) { + return new Tf(e, { finish(n) { return /&/.test(n) ? n.replace(/&\w*/, (i) => { if (i == "&") @@ -8094,7 +8094,7 @@ function n9(t, e, r) { } }); } -const fEe = /* @__PURE__ */ n9("." + r9, { +const eEe = /* @__PURE__ */ KM("." + ZM, { "&": { position: "relative !important", boxSizing: "border-box", @@ -8328,20 +8328,20 @@ const fEe = /* @__PURE__ */ n9("." + r9, { border: "1px solid #555", backgroundColor: "inherit" } -}, fae), dEe = { +}, nae), tEe = { childList: !0, characterData: !0, subtree: !0, attributes: !0, characterDataOldValue: !0 -}, t8 = nr.ie && nr.ie_version <= 11; -class pEe { +}, X7 = nr.ie && nr.ie_version <= 11; +class rEe { constructor(e) { - this.view = e, this.active = !1, this.editContext = null, this.selectionRange = new ZTe(), 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.printQuery = null, this.parentCheck = -1, this.dom = e.contentDOM, this.observer = new MutationObserver((r) => { + this.view = e, this.active = !1, this.editContext = null, this.selectionRange = new FTe(), 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.printQuery = null, this.parentCheck = -1, this.dom = e.contentDOM, this.observer = new MutationObserver((r) => { for (let n of r) this.queue.push(n); (nr.ie && nr.ie_version <= 11 || nr.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(); - }), window.EditContext && e.constructor.EDIT_CONTEXT !== !1 && !(nr.chrome && nr.chrome_version < 126) && (this.editContext = new mEe(e), e.state.facet(af) && (e.contentDOM.editContext = this.editContext.editContext)), t8 && (this.onCharData = (r) => { + }), window.EditContext && e.constructor.EDIT_CONTEXT !== !1 && !(nr.chrome && nr.chrome_version < 126) && (this.editContext = new iEe(e), e.state.facet(sf) && (e.contentDOM.editContext = this.editContext.editContext)), X7 && (this.onCharData = (r) => { this.queue.push({ target: r.target, type: "characterData", @@ -8385,24 +8385,24 @@ class pEe { if (!this.readSelectionRange() || this.delayedAndroidKey) return; let { view: n } = this, i = this.selectionRange; - if (n.state.facet(af) ? n.root.activeElement != this.dom : !G3(this.dom, i)) + if (n.state.facet(sf) ? n.root.activeElement != this.dom : !W5(this.dom, i)) return; let s = i.anchorNode && n.docView.nearest(i.anchorNode); if (s && s.ignoreEvent(e)) { r || (this.selectionChanged = !1); return; } - (nr.ie && nr.ie_version <= 11 || nr.android && nr.chrome) && !n.state.selection.main.empty && i.focusNode && ox(i.focusNode, i.focusOffset, i.anchorNode, i.anchorOffset) ? this.flushSoon() : this.flush(!1); + (nr.ie && nr.ie_version <= 11 || nr.android && nr.chrome) && !n.state.selection.main.empty && i.focusNode && sx(i.focusNode, i.focusOffset, i.anchorNode, i.anchorOffset) ? this.flushSoon() : this.flush(!1); } readSelectionRange() { - let { view: e } = this, r = Ux(e.root); + let { view: e } = this, r = zx(e.root); if (!r) return !1; - let n = nr.safari && e.root.nodeType == 11 && e.root.activeElement == this.dom && gEe(this.view, r) || r; + let n = nr.safari && e.root.nodeType == 11 && e.root.activeElement == this.dom && nEe(this.view, r) || r; if (!n || this.selectionRange.eq(n)) return !1; - let i = G3(this.dom, n); - return i && !this.selectionChanged && e.inputState.lastFocusTime > Date.now() - 200 && e.inputState.lastTouchTime < Date.now() - 300 && JTe(this.dom, n) ? (this.view.inputState.lastFocusTime = 0, e.docView.updateSelection(), !1) : (this.selectionRange.setRange(n), i && (this.selectionChanged = !0), !0); + let i = W5(this.dom, n); + return i && !this.selectionChanged && e.inputState.lastFocusTime > Date.now() - 200 && e.inputState.lastTouchTime < Date.now() - 300 && qTe(this.dom, n) ? (this.view.inputState.lastFocusTime = 0, e.docView.updateSelection(), !1) : (this.selectionRange.setRange(n), i && (this.selectionChanged = !0), !0); } setSelectionRange(e, r) { this.selectionRange.set(e.node, e.offset, r.node, r.offset), this.selectionChanged = !1; @@ -8437,10 +8437,10 @@ class pEe { } } start() { - this.active || (this.observer.observe(this.dom, dEe), t8 && this.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.active = !0); + this.active || (this.observer.observe(this.dom, tEe), X7 && this.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.active = !0); } stop() { - !this.active || (this.active = !1, this.observer.disconnect(), t8 && this.dom.removeEventListener("DOMCharacterDataModified", this.onCharData)); + !this.active || (this.active = !1, this.observer.disconnect(), X7 && this.dom.removeEventListener("DOMCharacterDataModified", this.onCharData)); } clear() { this.processRecords(), this.queue.length = 0, this.selectionChanged = !1; @@ -8450,7 +8450,7 @@ class pEe { 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 && P1(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 && R1(this.dom, s.key, s.keyCode)); }; this.flushingAndroidKey = this.view.win.requestAnimationFrame(i); } @@ -8487,11 +8487,11 @@ class pEe { return { from: r, to: n, typeOver: i }; } readChange() { - let { from: e, to: r, typeOver: n } = this.processRecords(), i = this.selectionChanged && G3(this.dom, this.selectionRange); + let { from: e, to: r, typeOver: n } = this.processRecords(), i = this.selectionChanged && W5(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 MCe(this.view, e, r, n); + let s = new xCe(this.view, e, r, n); return this.view.docView.domChanged = { newSel: s.newSel ? s.newSel.main : null }, s; } flush(e = !0) { @@ -8501,7 +8501,7 @@ class pEe { let r = this.readChange(); if (!r) return this.view.requestMeasure(), !1; - let n = this.view.state, i = eae(this.view, r); + let n = this.view.state, i = Wse(this.view, r); return this.view.state == n && (r.domChanged || r.newSel && !r.newSel.main.eq(this.view.state.selection.main)) && this.view.update([]), i; } readMutation(e) { @@ -8509,7 +8509,7 @@ class pEe { if (!r || r.ignoreMutation(e)) return null; if (r.markDirty(e.type == "attributes"), e.type == "attributes" && (r.flags |= 4), e.type == "childList") { - let n = bW(r, e.previousSibling || e.target.previousSibling, -1), i = bW(r, e.nextSibling || e.target.nextSibling, 1); + let n = aW(r, e.previousSibling || e.target.previousSibling, -1), i = aW(r, e.nextSibling || e.target.nextSibling, 1); return { from: n ? r.posAfter(n) : r.posAtStart, to: i ? r.posBefore(i) : r.posAtEnd, @@ -8528,7 +8528,7 @@ class pEe { e.removeEventListener("scroll", this.onScroll), e.removeEventListener("resize", this.onResize), this.printQuery ? this.printQuery.removeEventListener ? this.printQuery.removeEventListener("change", this.onPrint) : this.printQuery.removeListener(this.onPrint) : e.removeEventListener("beforeprint", this.onPrint), e.document.removeEventListener("selectionchange", this.onSelectionChange); } update(e) { - this.editContext && (this.editContext.update(e), e.startState.facet(af) != e.state.facet(af) && (e.view.contentDOM.editContext = e.state.facet(af) ? this.editContext.editContext : null)); + this.editContext && (this.editContext.update(e), e.startState.facet(sf) != e.state.facet(sf) && (e.view.contentDOM.editContext = e.state.facet(sf) ? this.editContext.editContext : null)); } destroy() { var e, r, n; @@ -8538,7 +8538,7 @@ class pEe { this.removeWindowListeners(this.win), clearTimeout(this.parentCheck), clearTimeout(this.resizeTimeout), this.win.cancelAnimationFrame(this.delayedFlush), this.win.cancelAnimationFrame(this.flushingAndroidKey), this.editContext && (this.view.contentDOM.editContext = null, this.editContext.destroy()); } } -function bW(t, e, r) { +function aW(t, e, r) { for (; e; ) { let n = Fn.get(e); if (n && n.parent == t) @@ -8548,23 +8548,23 @@ function bW(t, e, r) { } return null; } -function xW(t, e) { +function oW(t, e) { let r = e.startContainer, n = e.startOffset, i = e.endContainer, s = e.endOffset, a = t.docView.domAtPos(t.state.selection.main.anchor); - return ox(a.node, a.offset, i, s) && ([r, n, i, s] = [i, s, r, n]), { anchorNode: r, anchorOffset: n, focusNode: i, focusOffset: s }; + return sx(a.node, a.offset, i, s) && ([r, n, i, s] = [i, s, r, n]), { anchorNode: r, anchorOffset: n, focusNode: i, focusOffset: s }; } -function gEe(t, e) { +function nEe(t, e) { if (e.getComposedRanges) { let i = e.getComposedRanges(t.root)[0]; if (i) - return xW(t, i); + return oW(t, i); } let r = null; function n(i) { i.preventDefault(), i.stopImmediatePropagation(), r = i.getTargetRanges()[0]; } - return t.contentDOM.addEventListener("beforeinput", n, !0), t.dom.ownerDocument.execCommand("indent"), t.contentDOM.removeEventListener("beforeinput", n, !0), r ? xW(t, r) : null; + return t.contentDOM.addEventListener("beforeinput", n, !0), t.dom.ownerDocument.execCommand("indent"), t.contentDOM.removeEventListener("beforeinput", n, !0), r ? oW(t, r) : null; } -class mEe { +class iEe { constructor(e) { this.from = 0, this.to = 0, this.pendingContextChange = null, this.handlers = /* @__PURE__ */ Object.create(null), this.composing = null, this.resetRange(e.state); let r = this.editContext = new window.EditContext({ @@ -8584,7 +8584,7 @@ class mEe { } if ((nr.mac || nr.android) && u.from == a - 1 && /^\. ?$/.test(n.text) && e.contentDOM.getAttribute("autocorrect") == "off" && (u = { from: o, to: l, insert: nn.of([n.text.replace(".", " ")]) }), this.pendingContextChange = u, !e.state.readOnly) { let h = this.to - this.from + (u.to - u.from + u.insert.length); - Q$(e, u, ft.single(this.toEditorPos(n.selectionStart, h), this.toEditorPos(n.selectionEnd, h))); + L$(e, u, ft.single(this.toEditorPos(n.selectionStart, h), this.toEditorPos(n.selectionEnd, h))); } this.pendingContextChange && (this.revertPending(e.state), this.setSelection(e.state)); }, this.handlers.characterboundsupdate = (n) => { @@ -8606,7 +8606,7 @@ class mEe { } } } - e.dispatch({ effects: Gse.of(Ht.set(i)) }); + e.dispatch({ effects: Bse.of(Ht.set(i)) }); }, this.handlers.compositionstart = () => { e.inputState.composing < 0 && (e.inputState.composing = 0, e.inputState.compositionFirstChange = !0); }, this.handlers.compositionend = () => { @@ -8619,7 +8619,7 @@ class mEe { r.addEventListener(n, this.handlers[n]); this.measureReq = { read: (n) => { this.editContext.updateControlBounds(n.contentDOM.getBoundingClientRect()); - let i = Ux(n.root); + let i = zx(n.root); i && i.rangeCount && this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect()); } }; } @@ -8713,13 +8713,13 @@ class Mt { var r; 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: n } = e; - this.dispatchTransactions = e.dispatchTransactions || n && ((i) => i.forEach((s) => n(s, this))) || ((i) => this.update(i)), this.dispatch = this.dispatch.bind(this), this._root = e.root || KTe(e.parent) || document, this.viewState = new vW(e.state || qr.create(e)), e.scrollTo && e.scrollTo.is(j4) && (this.viewState.scrollTarget = e.scrollTo.value.clip(this.viewState.state)), this.plugins = this.state.facet(Cb).map((i) => new Z7(i)); + this.dispatchTransactions = e.dispatchTransactions || n && ((i) => i.forEach((s) => n(s, this))) || ((i) => this.update(i)), this.dispatch = this.dispatch.bind(this), this._root = e.root || zTe(e.parent) || document, this.viewState = new iW(e.state || qr.create(e)), e.scrollTo && e.scrollTo.is(G4) && (this.viewState.scrollTarget = e.scrollTo.value.clip(this.viewState.state)), this.plugins = this.state.facet(Tb).map((i) => new W7(i)); for (let i of this.plugins) i.update(this); - this.observer = new pEe(this), this.inputState = new $Ce(this), this.inputState.ensureHandlers(this.plugins), this.docView = new KV(this), this.mountStyles(), this.updateAttrs(), this.updateState = 0, this.requestMeasure(), !((r = document.fonts) === null || r === void 0) && r.ready && document.fonts.ready.then(() => this.requestMeasure()); + this.observer = new rEe(this), this.inputState = new TCe(this), this.inputState.ensureHandlers(this.plugins), this.docView = new FV(this), this.mountStyles(), this.updateAttrs(), this.updateState = 0, this.requestMeasure(), !((r = document.fonts) === null || r === void 0) && r.ready && document.fonts.ready.then(() => this.requestMeasure()); } dispatch(...e) { - let r = e.length == 1 && e[0] instanceof zi ? e : e.length == 1 && Array.isArray(e[0]) ? e[0] : [this.state.update(...e)]; + let r = e.length == 1 && e[0] instanceof Fi ? e : e.length == 1 && Array.isArray(e[0]) ? e[0] : [this.state.update(...e)]; this.dispatchTransactions(r, this); } update(e) { @@ -8736,35 +8736,35 @@ class Mt { return; } let a = this.hasFocus, o = 0, l = null; - e.some((d) => d.annotation(aae)) ? (this.inputState.notifiedFocused = a, o = 1) : a != this.inputState.notifiedFocused && (this.inputState.notifiedFocused = a, l = oae(s, a), l || (o = 1)); + e.some((d) => d.annotation(Zse)) ? (this.inputState.notifiedFocused = a, o = 1) : a != this.inputState.notifiedFocused && (this.inputState.notifiedFocused = a, l = Kse(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(qr.phrases) != this.state.facet(qr.phrases)) return this.setState(s); - i = fT.create(this, s, e), i.flags |= o; + i = uT.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 N1(p.empty ? p : ft.cursor(p.head, p.head > p.anchor ? -1 : 1)); + f = new L1(p.empty ? p : ft.cursor(p.head, p.head > p.anchor ? -1 : 1)); } for (let p of d.effects) - p.is(j4) && (f = p.value.clip(this.state)); + p.is(G4) && (f = p.value.clip(this.state)); } - this.viewState.update(i, f), this.bidiCache = pT.update(this.bidiCache, i.changes), i.empty || (this.updatePlugins(i), this.inputState.update(i)), r = this.docView.update(i), this.state.facet(Eb) != 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 = fT.update(this.bidiCache, i.changes), i.empty || (this.updatePlugins(i), this.inputState.update(i)), r = this.docView.update(i), this.state.facet(Cb) != 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(rS) != i.state.facet(rS) && (this.viewState.mustMeasureContent = !0), (r || n || f || this.viewState.mustEnforceCursorAssoc || this.viewState.mustMeasureContent) && this.requestMeasure(), r && this.docViewUpdate(), !i.empty) - for (let d of this.state.facet(ZM)) + if (i.startState.facet(J4) != i.state.facet(J4) && (this.viewState.mustMeasureContent = !0), (r || n || f || this.viewState.mustEnforceCursorAssoc || this.viewState.mustMeasureContent) && this.requestMeasure(), r && this.docViewUpdate(), !i.empty) + for (let d of this.state.facet(YM)) try { d(i); } catch (p) { - Ho(this.state, p, "update listener"); + Wo(this.state, p, "update listener"); } (l || h) && Promise.resolve().then(() => { - l && this.state == l.startState && this.dispatch(l), h && !eae(this, h) && u.force && P1(this.contentDOM, u.key, u.keyCode); + l && this.state == l.startState && this.dispatch(l), h && !Wse(this, h) && u.force && R1(this.contentDOM, u.key, u.keyCode); }); } setState(e) { @@ -8779,23 +8779,23 @@ class Mt { try { for (let n of this.plugins) n.destroy(this); - this.viewState = new vW(e), this.plugins = e.facet(Cb).map((n) => new Z7(n)), this.pluginMap.clear(); + this.viewState = new iW(e), this.plugins = e.facet(Tb).map((n) => new W7(n)), this.pluginMap.clear(); for (let n of this.plugins) n.update(this); - this.docView.destroy(), this.docView = new KV(this), this.inputState.ensureHandlers(this.plugins), this.mountStyles(), this.updateAttrs(), this.bidiCache = []; + this.docView.destroy(), this.docView = new FV(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(Cb), n = e.state.facet(Cb); + let r = e.startState.facet(Tb), n = e.state.facet(Tb); if (r != n) { let i = []; for (let s of n) { let a = r.indexOf(s); if (a < 0) - i.push(new Z7(s)); + i.push(new W7(s)); else { let o = this.plugins[a]; o.mustUpdate = e, i.push(o); @@ -8818,7 +8818,7 @@ class Mt { try { r.docViewUpdate(this); } catch (n) { - Ho(this.state, n, "doc view update listener"); + Wo(this.state, n, "doc view update listener"); } } } @@ -8835,7 +8835,7 @@ class Mt { try { for (let o = 0; ; o++) { if (a < 0) - if (wse(n)) + if (fse(n)) s = -1, a = this.viewState.heightMap.height; else { let p = this.viewState.scrollAnchorAt(i); @@ -8855,17 +8855,17 @@ class Mt { try { return p.read(this); } catch (g) { - return Ho(this.state, g), wW; + return Wo(this.state, g), lW; } - }), f = fT.create(this, this.state, []), d = !1; + }), f = uT.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), d && this.docViewUpdate()); for (let p = 0; p < u.length; p++) - if (h[p] != wW) + if (h[p] != lW) try { let g = u[p]; g.write && g.write(h[p], this); } catch (g) { - Ho(this.state, g); + Wo(this.state, g); } if (d && this.docView.updateSelection(!0), !f.viewportChanged && this.measureRequests.length == 0) { if (this.viewState.editorHeight) @@ -8886,14 +8886,14 @@ class Mt { this.updateState = 0, this.measureScheduled = -1; } if (r && !r.empty) - for (let o of this.state.facet(ZM)) + for (let o of this.state.facet(YM)) o(r); } get themeClasses() { - return r9 + " " + (this.state.facet(t9) ? hae : uae) + " " + this.state.facet(rS); + return ZM + " " + (this.state.facet(jM) ? rae : tae) + " " + this.state.facet(J4); } updateAttrs() { - let e = OW(this, Hse, { + let e = cW(this, Fse, { class: "cm-editor" + (this.hasFocus ? " cm-focused " : " ") + this.themeClasses }), r = { spellcheck: "false", @@ -8901,15 +8901,15 @@ class Mt { autocapitalize: "off", writingsuggestions: "false", translate: "no", - contenteditable: this.state.facet(af) ? "true" : "false", + contenteditable: this.state.facet(sf) ? "true" : "false", class: "cm-content", style: `${nr.tabSize}: ${this.state.tabSize}`, role: "textbox", "aria-multiline": "true" }; - this.state.readOnly && (r["aria-readonly"] = "true"), OW(this, z$, r); + this.state.readOnly && (r["aria-readonly"] = "true"), cW(this, _$, r); let n = this.observer.ignore(() => { - let i = YM(this.contentDOM, this.contentAttrs, r), s = YM(this.dom, this.editorAttrs, e); + let i = qM(this.contentDOM, this.contentAttrs, r), s = qM(this.dom, this.editorAttrs, e); return i || s; }); return this.editorAttrs = e, this.contentAttrs = r, n; @@ -8925,9 +8925,9 @@ class Mt { } } mountStyles() { - this.styleModules = this.state.facet(Eb); + this.styleModules = this.state.facet(Cb); let e = this.state.facet(Mt.cspNonce); - Ef.mount(this.root, this.styleModules.concat(fEe).reverse(), e ? { nonce: e } : void 0); + Tf.mount(this.root, this.styleModules.concat(eEe).reverse(), e ? { nonce: e } : void 0); } readMeasured() { if (this.updateState == 2) @@ -8980,20 +8980,20 @@ class Mt { return this.viewState.contentHeight; } moveByChar(e, r, n) { - return J7(this, e, nW(this, e, r, n)); + return G7(this, e, VV(this, e, r, n)); } moveByGroup(e, r) { - return J7(this, e, nW(this, e, r, (n) => _Ce(this, e.head, n))); + return G7(this, e, VV(this, e, r, (n) => mCe(this, e.head, n))); } visualLineSide(e, r) { let n = this.bidiSpans(e), i = this.textDirectionAt(e.from), s = n[r ? n.length - 1 : 0]; return ft.cursor(s.side(r, i) + e.from, s.forward(!r, i) ? 1 : -1); } moveToLineBoundary(e, r, n = !0) { - return ECe(this, e, r, n); + return gCe(this, e, r, n); } moveVertically(e, r, n) { - return J7(this, e, ACe(this, e, r, n)); + return G7(this, e, vCe(this, e, r, n)); } domAtPos(e) { return this.docView.domAtPos(e); @@ -9002,15 +9002,15 @@ class Mt { return this.docView.posFromDOM(e, r); } posAtCoords(e, r = !0) { - return this.readMeasured(), Jse(this, e, r); + return this.readMeasured(), Vse(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[Pd.find(s, e - i.from, -1, r)]; - return G_(n, a.dir == Xn.LTR == r > 0); + let i = this.state.doc.lineAt(e), s = this.bidiSpans(i), a = s[Ld.find(s, e - i.from, -1, r)]; + return Q_(n, a.dir == Xn.LTR == r > 0); } coordsForChar(e) { return this.readMeasured(), this.docView.coordsForChar(e); @@ -9025,21 +9025,21 @@ class Mt { return this.viewState.defaultTextDirection; } textDirectionAt(e) { - return !this.state.facet(Vse) || e < this.viewport.from || e > this.viewport.to ? this.textDirection : (this.readMeasured(), this.docView.textDirectionAt(e)); + return !this.state.facet(Nse) || 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 > vEe) - return Ise(e.length); + if (e.length > sEe) + return Ese(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 || Nse(s.isolates, n = ZV(this, e)))) + if (s.from == e.from && s.dir == r && (s.fresh || Cse(s.isolates, n = BV(this, e)))) return s.order; - n || (n = ZV(this, e)); - let i = hCe(e.text, r, n); - return this.bidiCache.push(new pT(e.from, e.to, r, n, !0, i)), i; + n || (n = BV(this, e)); + let i = JTe(e.text, r, n); + return this.bidiCache.push(new fT(e.from, e.to, r, n, !0, i)), i; } get hasFocus() { var e; @@ -9047,7 +9047,7 @@ class Mt { } focus() { this.observer.ignore(() => { - bse(this.contentDOM), this.docView.updateSelection(); + use(this.contentDOM), this.docView.updateSelection(); }); } setRoot(e) { @@ -9060,11 +9060,11 @@ class Mt { 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 j4.of(new N1(typeof e == "number" ? ft.cursor(e) : e, r.y, r.x, r.yMargin, r.xMargin)); + return G4.of(new L1(typeof e == "number" ? ft.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 j4.of(new N1(ft.cursor(n.from), "start", "start", n.top - e, r, !0)); + return G4.of(new L1(ft.cursor(n.from), "start", "start", n.top - e, r, !0)); } setTabFocusMode(e) { e == null ? this.inputState.tabFocusMode = this.inputState.tabFocusMode < 0 ? 0 : -1 : typeof e == "boolean" ? this.inputState.tabFocusMode = e ? 0 : -1 : this.inputState.tabFocusMode != 0 && (this.inputState.tabFocusMode = Date.now() + e); @@ -9076,11 +9076,11 @@ class Mt { return fn.define(() => ({}), { eventObservers: e }); } static theme(e, r) { - let n = Ef.newName(), i = [rS.of(n), Eb.of(n9(`.${n}`, e))]; - return r && r.dark && i.push(t9.of(!0)), i; + let n = Tf.newName(), i = [J4.of(n), Cb.of(KM(`.${n}`, e))]; + return r && r.dark && i.push(jM.of(!0)), i; } static baseTheme(e) { - return Va.lowest(Eb.of(n9("." + r9, e, fae))); + return qa.lowest(Cb.of(KM("." + ZM, e, nae))); } static findFromDOM(e) { var r; @@ -9088,32 +9088,32 @@ class Mt { return ((r = i == null ? void 0 : i.rootView) === null || r === void 0 ? void 0 : r.view) || null; } } -Mt.styleModule = Eb; -Mt.inputHandler = Use; -Mt.clipboardInputFilter = B$; -Mt.clipboardOutputFilter = F$; -Mt.scrollHandler = Yse; -Mt.focusChangeEffect = Qse; -Mt.perLineTextDirection = Vse; -Mt.exceptionSink = qse; -Mt.updateListener = ZM; -Mt.editable = af; -Mt.mouseSelectionStyle = zse; -Mt.dragMovesSelection = Fse; -Mt.clickAddsSelectionRange = Bse; -Mt.decorations = Vx; -Mt.outerDecorations = Xse; -Mt.atomicRanges = q$; -Mt.bidiIsolatedRanges = jse; -Mt.scrollMargins = Zse; -Mt.darkTheme = t9; +Mt.styleModule = Cb; +Mt.inputHandler = Dse; +Mt.clipboardInputFilter = C$; +Mt.clipboardOutputFilter = E$; +Mt.scrollHandler = $se; +Mt.focusChangeEffect = Pse; +Mt.perLineTextDirection = Nse; +Mt.exceptionSink = Mse; +Mt.updateListener = YM; +Mt.editable = sf; +Mt.mouseSelectionStyle = Lse; +Mt.dragMovesSelection = Rse; +Mt.clickAddsSelectionRange = Ase; +Mt.decorations = Ux; +Mt.outerDecorations = zse; +Mt.atomicRanges = A$; +Mt.bidiIsolatedRanges = qse; +Mt.scrollMargins = Use; +Mt.darkTheme = jM; Mt.cspNonce = /* @__PURE__ */ Gt.define({ combine: (t) => t.length ? t[0] : "" }); -Mt.contentAttributes = z$; -Mt.editorAttributes = Hse; +Mt.contentAttributes = _$; +Mt.editorAttributes = Fse; Mt.lineWrapping = /* @__PURE__ */ Mt.contentAttributes.of({ class: "cm-lineWrapping" }); Mt.announce = /* @__PURE__ */ _r.define(); -const vEe = 4096, wW = {}; -class pT { +const sEe = 4096, lW = {}; +class fT { 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; } @@ -9123,20 +9123,20 @@ class pT { let n = [], i = e.length ? e[e.length - 1].dir : Xn.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 pT(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 fT(r.mapPos(a.from, 1), r.mapPos(a.to, -1), a.dir, a.isolates, !1, a.order)); } return n; } } -function OW(t, e, r) { +function cW(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 && WM(a, r); + a && zM(a, r); } return r; } -const yEe = nr.mac ? "mac" : nr.windows ? "win" : nr.linux ? "linux" : "key"; -function bEe(t, e) { +const aEe = nr.mac ? "mac" : nr.windows ? "win" : nr.linux ? "linux" : "key"; +function oEe(t, e) { const r = t.split(/-(?!$)/); let n = r[r.length - 1]; n == "Space" && (n = " "); @@ -9158,24 +9158,24 @@ function bEe(t, e) { } return i && (n = "Alt-" + n), s && (n = "Ctrl-" + n), o && (n = "Meta-" + n), a && (n = "Shift-" + n), n; } -function nS(t, e, r) { +function eS(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 xEe = /* @__PURE__ */ Va.default(/* @__PURE__ */ Mt.domEventHandlers({ +const lEe = /* @__PURE__ */ qa.default(/* @__PURE__ */ Mt.domEventHandlers({ keydown(t, e) { - return pae(dae(e.state), t, e, "editor"); + return sae(iae(e.state), t, e, "editor"); } -})), Qc = /* @__PURE__ */ Gt.define({ enables: xEe }), kW = /* @__PURE__ */ new WeakMap(); -function dae(t) { - let e = t.facet(Qc), r = kW.get(e); - return r || kW.set(e, r = kEe(e.reduce((n, i) => n.concat(i), []))), r; +})), zc = /* @__PURE__ */ Gt.define({ enables: lEe }), uW = /* @__PURE__ */ new WeakMap(); +function iae(t) { + let e = t.facet(zc), r = uW.get(e); + return r || uW.set(e, r = hEe(e.reduce((n, i) => n.concat(i), []))), r; } -function wEe(t, e, r) { - return pae(dae(t.state), e, t, r); +function cEe(t, e, r) { + return sae(iae(t.state), e, t, r); } -let Td = null; -const OEe = 4e3; -function kEe(t, e = yEe) { +let Od = null; +const uEe = 4e3; +function hEe(t, e = aEe) { let r = /* @__PURE__ */ Object.create(null), n = /* @__PURE__ */ Object.create(null), i = (a, o) => { let l = n[a]; if (l == null) @@ -9184,17 +9184,17 @@ function kEe(t, e = yEe) { 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) => bEe(y, e)); + let p = r[a] || (r[a] = /* @__PURE__ */ Object.create(null)), g = o.split(/ (?!$)/).map((y) => oEe(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 = Td = { view: w, prefix: b, scope: a }; + let O = Od = { view: w, prefix: b, scope: a }; return setTimeout(() => { - Td == O && (Td = null); - }, OEe), !0; + Od == O && (Od = null); + }, uEe), !0; }] }); } @@ -9215,7 +9215,7 @@ function kEe(t, e = yEe) { h._any || (h._any = { preventDefault: !1, stopPropagation: !1, run: [] }); let { any: f } = a; for (let d in h) - h[d].run.push((p) => f(p, i9)); + h[d].run.push((p) => f(p, JM)); } let l = a[e] || a.key; if (!!l) @@ -9224,11 +9224,11 @@ function kEe(t, e = yEe) { } return r; } -let i9 = null; -function pae(t, e, r, n) { - i9 = e; - let i = GTe(e), s = Gl(i, 0), a = sf(s) == i.length && i != " ", o = "", l = !1, u = !1, h = !1; - Td && Td.view == r && Td.scope == n && (o = Td.prefix + " ", rae.indexOf(e.keyCode) < 0 && (u = !0, Td = null)); +let JM = null; +function sae(t, e, r, n) { + JM = e; + let i = NTe(e), s = Vl(i, 0), a = nf(s) == i.length && i != " ", o = "", l = !1, u = !1, h = !1; + Od && Od.view == r && Od.scope == n && (o = Od.prefix + " ", Gse.indexOf(e.keyCode) < 0 && (u = !0, Od = null)); let f = /* @__PURE__ */ new Set(), d = (v) => { if (v) { for (let y of v.run) @@ -9238,9 +9238,9 @@ function pae(t, e, r, n) { } return !1; }, p = t[n], g, m; - return p && (d(p[o + nS(i, e, !a)]) ? l = !0 : a && (e.altKey || e.metaKey || e.ctrlKey) && !(nr.windows && e.ctrlKey && e.altKey) && (g = up[e.keyCode]) && g != i ? (d(p[o + nS(g, e, !0)]) || e.shiftKey && (m = qx[e.keyCode]) != i && m != g && d(p[o + nS(m, e, !1)])) && (l = !0) : a && e.shiftKey && d(p[o + nS(i, e, !0)]) && (l = !0), !l && d(p._any) && (l = !0)), u && (l = !0), l && h && e.stopPropagation(), i9 = null, l; + return p && (d(p[o + eS(i, e, !a)]) ? l = !0 : a && (e.altKey || e.metaKey || e.ctrlKey) && !(nr.windows && e.ctrlKey && e.altKey) && (g = sp[e.keyCode]) && g != i ? (d(p[o + eS(g, e, !0)]) || e.shiftKey && (m = Fx[e.keyCode]) != i && m != g && d(p[o + eS(m, e, !1)])) && (l = !0) : a && e.shiftKey && d(p[o + eS(i, e, !0)]) && (l = !0), !l && d(p._any) && (l = !0)), u && (l = !0), l && h && e.stopPropagation(), JM = null, l; } -class wk { +class yk { constructor(e, r, n, i, s) { this.className = e, this.left = r, this.top = n, this.width = i, this.height = s; } @@ -9262,84 +9262,84 @@ class wk { let i = e.coordsAtPos(n.head, n.assoc || 1); if (!i) return []; - let s = gae(e); - return [new wk(r, i.left - s.left, i.top - s.top, null, i.bottom - i.top)]; + let s = aae(e); + return [new yk(r, i.left - s.left, i.top - s.top, null, i.bottom - i.top)]; } else - return SEe(e, r, n); + return fEe(e, r, n); } } -function gae(t) { +function aae(t) { let e = t.scrollDOM.getBoundingClientRect(); return { left: (t.textDirection == Xn.LTR ? e.left : e.right - t.scrollDOM.clientWidth * t.scaleX) - t.scrollDOM.scrollLeft * t.scaleX, top: e.top - t.scrollDOM.scrollTop * t.scaleY }; } -function SW(t, e, r, n) { +function hW(t, e, r, n) { let i = t.coordsAtPos(e, r * 2); if (!i) return n; let s = t.dom.getBoundingClientRect(), a = (i.top + i.bottom) / 2, o = t.posAtCoords({ x: s.left + 1, y: a }), l = t.posAtCoords({ x: s.right - 1, y: a }); return o == null || l == null ? n : { from: Math.max(n.from, Math.min(o, l)), to: Math.min(n.to, Math.max(o, l)) }; } -function SEe(t, e, r) { +function fEe(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 == Xn.LTR, a = t.contentDOM, o = a.getBoundingClientRect(), l = gae(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 = JM(t, n), g = JM(t, i), m = p.type == po.Text ? p : null, v = g.type == po.Text ? g : null; - if (m && (t.lineWrapping || p.widgetLineBreaks) && (m = SW(t, n, 1, m)), v && (t.lineWrapping || g.widgetLineBreaks) && (v = SW(t, i, -1, v)), m && v && m.from == v.from && m.to == v.to) + let n = Math.max(r.from, t.viewport.from), i = Math.min(r.to, t.viewport.to), s = t.textDirection == Xn.LTR, a = t.contentDOM, o = a.getBoundingClientRect(), l = aae(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 = HM(t, n), g = HM(t, i), m = p.type == uo.Text ? p : null, v = g.type == uo.Text ? g : null; + if (m && (t.lineWrapping || p.widgetLineBreaks) && (m = hW(t, n, 1, m)), v && (t.lineWrapping || g.widgetLineBreaks) && (v = hW(t, i, -1, v)), m && v && m.from == v.from && m.to == v.to) 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 == po.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 == uo.Text && (S.bottom = C.top = (S.bottom + C.top) / 2), b(S).concat(T).concat(b(C)); } - function y(S, C, T, L) { - return new wk(e, S - l.left, C - l.top, T - S, L - C); + function y(S, C, T, D) { + return new yk(e, S - l.left, C - l.top, T - S, D - C); } function b({ top: S, bottom: C, horizontal: T }) { - let L = []; + let D = []; for (let E = 0; E < T.length; E += 2) - L.push(y(T[E], S, T[E + 1], C)); - return L; + D.push(y(T[E], S, T[E + 1], C)); + return D; } function w(S, C, T) { - let L = 1e9, E = -1e9, P = []; - function M(k, B, A, D, I) { - let z = t.coordsAtPos(k, k == T.to ? -2 : 2), Y = t.coordsAtPos(A, A == T.from ? 2 : -2); - !z || !Y || (L = Math.min(z.top, Y.top, L), E = Math.max(z.bottom, Y.bottom, E), I == Xn.LTR ? P.push(s && B ? f : z.left, s && D ? d : Y.right) : P.push(!s && D ? f : Y.left, !s && B ? d : z.right)); + let D = 1e9, E = -1e9, N = []; + function P(k, B, A, M, I) { + let q = t.coordsAtPos(k, k == T.to ? -2 : 2), Y = t.coordsAtPos(A, A == T.from ? 2 : -2); + !q || !Y || (D = Math.min(q.top, Y.top, D), E = Math.max(q.bottom, Y.bottom, E), I == Xn.LTR ? N.push(s && B ? f : q.left, s && M ? d : Y.right) : N.push(!s && M ? f : Y.left, !s && B ? d : q.right)); } - let N = S != null ? S : T.from, q = C != null ? C : T.to; + let L = S != null ? S : T.from, F = C != null ? C : T.to; for (let k of t.visibleRanges) - if (k.to > N && k.from < q) - for (let B = Math.max(k.from, N), A = Math.min(k.to, q); ; ) { - let D = t.state.doc.lineAt(B); - for (let I of t.bidiSpans(D)) { - let z = I.from + D.from, Y = I.to + D.from; - if (z >= A) + if (k.to > L && k.from < F) + for (let B = Math.max(k.from, L), A = Math.min(k.to, F); ; ) { + let M = t.state.doc.lineAt(B); + for (let I of t.bidiSpans(M)) { + let q = I.from + M.from, Y = I.to + M.from; + if (q >= A) break; - Y > B && M(Math.max(z, B), S == null && z <= N, Math.min(Y, A), C == null && Y >= q, I.dir); + Y > B && P(Math.max(q, B), S == null && q <= L, Math.min(Y, A), C == null && Y >= F, I.dir); } - if (B = D.to + 1, B >= A) + if (B = M.to + 1, B >= A) break; } - return P.length == 0 && M(N, S == null, q, C == null, t.textDirection), { top: L, bottom: E, horizontal: P }; + return N.length == 0 && P(L, S == null, F, C == null, t.textDirection), { top: D, bottom: E, horizontal: N }; } function O(S, C) { let T = o.top + (C ? S.top : S.bottom); return { top: T, bottom: T, horizontal: [] }; } } -function TEe(t, e) { +function dEe(t, e) { return t.constructor == e.constructor && t.eq(e); } -class CEe { +class pEe { 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(Z3) != e.state.facet(Z3) && this.setOrder(e.state), (this.layer.update(e, this.dom) || e.geometryChanged) && (this.scale(), e.view.requestMeasure(this.measureReq)); + e.startState.facet(X5) != e.state.facet(X5) && this.setOrder(e.state), (this.layer.update(e, this.dom) || e.geometryChanged) && (this.scale(), e.view.requestMeasure(this.measureReq)); } docViewUpdate(e) { this.layer.updateOnDocViewUpdate !== !1 && e.requestMeasure(this.measureReq); } setOrder(e) { - let r = 0, n = e.facet(Z3); + let r = 0, n = e.facet(X5); for (; r < n.length && n[r] != this.layer; ) r++; this.dom.style.zIndex = String((this.layer.above ? 150 : -1) - r); @@ -9352,7 +9352,7 @@ class CEe { (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) => !TEe(r, this.drawn[n]))) { + if (e.length != this.drawn.length || e.some((r, n) => !dEe(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); @@ -9367,16 +9367,16 @@ class CEe { this.layer.destroy && this.layer.destroy(this.dom, this.view), this.dom.remove(); } } -const Z3 = /* @__PURE__ */ Gt.define(); -function mae(t) { +const X5 = /* @__PURE__ */ Gt.define(); +function oae(t) { return [ - fn.define((e) => new CEe(e, t)), - Z3.of(t) + fn.define((e) => new pEe(e, t)), + X5.of(t) ]; } -const vae = !(nr.ios && nr.webkit && nr.webkit_version < 534), yv = /* @__PURE__ */ Gt.define({ +const lae = !(nr.ios && nr.webkit && nr.webkit_version < 534), pv = /* @__PURE__ */ Gt.define({ combine(t) { - return Ah(t, { + return Th(t, { cursorBlinkRate: 1200, drawRangeCursor: !0 }, { @@ -9385,30 +9385,30 @@ const vae = !(nr.ios && nr.webkit && nr.webkit_version < 534), yv = /* @__PURE__ }); } }); -function TW(t = {}) { +function fW(t = {}) { return [ - yv.of(t), - _Ee, - AEe, - REe, - Wse.of(!0) + pv.of(t), + mEe, + vEe, + yEe, + Ise.of(!0) ]; } -function EEe(t) { - return t.facet(yv); +function gEe(t) { + return t.facet(pv); } -function yae(t) { - return t.startState.facet(yv) != t.state.facet(yv); +function cae(t) { + return t.startState.facet(pv) != t.state.facet(pv); } -const _Ee = /* @__PURE__ */ mae({ +const mEe = /* @__PURE__ */ oae({ above: !0, markers(t) { - let { state: e } = t, r = e.facet(yv), n = []; + let { state: e } = t, r = e.facet(pv), n = []; for (let i of e.selection.ranges) { let s = i == e.selection.main; - if (i.empty ? !s || vae : r.drawRangeCursor) { + if (i.empty ? !s || lae : r.drawRangeCursor) { let a = s ? "cm-cursor cm-cursor-primary" : "cm-cursor cm-cursor-secondary", o = i.empty ? i : ft.cursor(i.head, i.head > i.anchor ? -1 : 1); - for (let l of wk.forRange(t, a, o)) + for (let l of yk.forRange(t, a, o)) n.push(l); } } @@ -9416,27 +9416,27 @@ const _Ee = /* @__PURE__ */ mae({ }, update(t, e) { t.transactions.some((n) => n.selection) && (e.style.animationName = e.style.animationName == "cm-blink" ? "cm-blink2" : "cm-blink"); - let r = yae(t); - return r && CW(t.state, e), t.docChanged || t.selectionSet || r; + let r = cae(t); + return r && dW(t.state, e), t.docChanged || t.selectionSet || r; }, mount(t, e) { - CW(e.state, t); + dW(e.state, t); }, class: "cm-cursorLayer" }); -function CW(t, e) { - e.style.animationDuration = t.facet(yv).cursorBlinkRate + "ms"; +function dW(t, e) { + e.style.animationDuration = t.facet(pv).cursorBlinkRate + "ms"; } -const AEe = /* @__PURE__ */ mae({ +const vEe = /* @__PURE__ */ oae({ above: !1, markers(t) { - return t.state.selection.ranges.map((e) => e.empty ? [] : wk.forRange(t, "cm-selectionBackground", e)).reduce((e, r) => e.concat(r)); + return t.state.selection.ranges.map((e) => e.empty ? [] : yk.forRange(t, "cm-selectionBackground", e)).reduce((e, r) => e.concat(r)); }, update(t, e) { - return t.docChanged || t.selectionSet || t.viewportChanged || yae(t); + return t.docChanged || t.selectionSet || t.viewportChanged || cae(t); }, class: "cm-selectionLayer" -}), s9 = { +}), e9 = { ".cm-line": { "& ::selection, &::selection": { backgroundColor: "transparent !important" } }, @@ -9449,29 +9449,29 @@ const AEe = /* @__PURE__ */ mae({ } } }; -vae && (s9[".cm-line"].caretColor = s9[".cm-content"].caretColor = "transparent !important"); -const REe = /* @__PURE__ */ Va.highest(/* @__PURE__ */ Mt.theme(s9)), bae = /* @__PURE__ */ _r.define({ +lae && (e9[".cm-line"].caretColor = e9[".cm-content"].caretColor = "transparent !important"); +const yEe = /* @__PURE__ */ qa.highest(/* @__PURE__ */ Mt.theme(e9)), uae = /* @__PURE__ */ _r.define({ map(t, e) { return t == null ? null : e.mapPos(t); } -}), Rb = /* @__PURE__ */ ai.define({ +}), Ab = /* @__PURE__ */ ai.define({ create() { return null; }, update(t, e) { - return t != null && (t = e.changes.mapPos(t)), e.effects.reduce((r, n) => n.is(bae) ? n.value : r, t); + return t != null && (t = e.changes.mapPos(t)), e.effects.reduce((r, n) => n.is(uae) ? n.value : r, t); } -}), LEe = /* @__PURE__ */ fn.fromClass(class { +}), bEe = /* @__PURE__ */ fn.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(Rb); - 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(Rb) != r || t.docChanged || t.geometryChanged) && this.view.requestMeasure(this.measureReq)); + let r = t.state.field(Ab); + 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(Ab) != r || t.docChanged || t.geometryChanged) && this.view.requestMeasure(this.measureReq)); } readPos() { - let { view: t } = this, e = t.state.field(Rb), r = e != null && t.coordsAtPos(e); + let { view: t } = this, e = t.state.field(Ab), r = e != null && t.coordsAtPos(e); if (!r) return null; let n = t.scrollDOM.getBoundingClientRect(); @@ -9491,7 +9491,7 @@ const REe = /* @__PURE__ */ Va.highest(/* @__PURE__ */ Mt.theme(s9)), bae = /* @ this.cursor && this.cursor.remove(); } setDropPos(t) { - this.view.state.field(Rb) != t && this.view.dispatch({ effects: bae.of(t) }); + this.view.state.field(Ab) != t && this.view.dispatch({ effects: uae.of(t) }); } }, { eventObservers: { @@ -9509,17 +9509,17 @@ const REe = /* @__PURE__ */ Va.highest(/* @__PURE__ */ Mt.theme(s9)), bae = /* @ } } }); -function MEe() { - return [Rb, LEe]; +function xEe() { + return [Ab, bEe]; } -function EW(t, e, r, n, i) { +function pW(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 DEe(t, e) { +function wEe(t, e) { let r = t.visibleRanges; if (r.length == 1 && r[0].from == t.viewport.from && r[0].to == t.viewport.to) return r; @@ -9528,7 +9528,7 @@ function DEe(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 PEe { +class OEe { constructor(e) { const { regexp: r, decoration: n, decorate: i, boundary: s, maxLength: a = 1e3 } = e; if (!r.global) @@ -9547,9 +9547,9 @@ class PEe { this.boundary = s, this.maxLength = a; } createDeco(e) { - let r = new is(), n = r.add.bind(r); - for (let { from: i, to: s } of DEe(e, this.maxLength)) - EW(e.state.doc, this.regexp, i, s, (a, o) => this.addMatch(o, e, a, n)); + let r = new rs(), n = r.add.bind(r); + for (let { from: i, to: s } of wEe(e, this.maxLength)) + pW(e.state.doc, this.regexp, i, s, (a, o) => this.addMatch(o, e, a, n)); return r.finish(); } updateDeco(e, r) { @@ -9580,15 +9580,15 @@ class PEe { 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 - EW(e.state.doc, this.regexp, h, f, (m, v) => this.addMatch(v, e, m, g)); + pW(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 a9 = /x/.unicode != null ? "gu" : "g", NEe = /* @__PURE__ */ new RegExp(`[\0-\b --\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`, a9), IEe = { +const t9 = /x/.unicode != null ? "gu" : "g", kEe = /* @__PURE__ */ new RegExp(`[\0-\b +-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`, t9), SEe = { 0: "null", 7: "bell", 8: "backspace", @@ -9611,63 +9611,63 @@ const a9 = /x/.unicode != null ? "gu" : "g", NEe = /* @__PURE__ */ new RegExp(`[ 65279: "zero width no-break space", 65532: "object replacement" }; -let r8 = null; -function $Ee() { +let j7 = null; +function TEe() { var t; - if (r8 == null && typeof document < "u" && document.body) { + if (j7 == null && typeof document < "u" && document.body) { let e = document.body.style; - r8 = ((t = e.tabSize) !== null && t !== void 0 ? t : e.MozTabSize) != null; + j7 = ((t = e.tabSize) !== null && t !== void 0 ? t : e.MozTabSize) != null; } - return r8 || !1; + return j7 || !1; } -const K3 = /* @__PURE__ */ Gt.define({ +const j5 = /* @__PURE__ */ Gt.define({ combine(t) { - let e = Ah(t, { + let e = Th(t, { render: null, - specialChars: NEe, + specialChars: kEe, addSpecialChars: null }); - return (e.replaceTabs = !$Ee()) && (e.specialChars = new RegExp(" |" + e.specialChars.source, a9)), e.addSpecialChars && (e.specialChars = new RegExp(e.specialChars.source + "|" + e.addSpecialChars.source, a9)), e; + return (e.replaceTabs = !TEe()) && (e.specialChars = new RegExp(" |" + e.specialChars.source, t9)), e.addSpecialChars && (e.specialChars = new RegExp(e.specialChars.source + "|" + e.addSpecialChars.source, t9)), e; } }); -function _W(t = {}) { - return [K3.of(t), BEe()]; +function gW(t = {}) { + return [j5.of(t), CEe()]; } -let AW = null; -function BEe() { - return AW || (AW = fn.fromClass(class { +let mW = null; +function CEe() { + return mW || (mW = fn.fromClass(class { constructor(t) { - this.view = t, this.decorations = Ht.none, this.decorationCache = /* @__PURE__ */ Object.create(null), this.decorator = this.makeDecorator(t.state.facet(K3)), this.decorations = this.decorator.createDeco(t); + this.view = t, this.decorations = Ht.none, this.decorationCache = /* @__PURE__ */ Object.create(null), this.decorator = this.makeDecorator(t.state.facet(j5)), this.decorations = this.decorator.createDeco(t); } makeDecorator(t) { - return new PEe({ + return new OEe({ regexp: t.specialChars, decoration: (e, r, n) => { - let { doc: i } = r.state, s = Gl(e[0], 0); + let { doc: i } = r.state, s = Vl(e[0], 0); if (s == 9) { - let a = i.lineAt(n), o = r.state.tabSize, l = ou(a.text, o, n - a.from); + let a = i.lineAt(n), o = r.state.tabSize, l = iu(a.text, o, n - a.from); return Ht.replace({ - widget: new UEe((o - l % o) * this.view.defaultCharacterWidth / this.view.scaleX) + widget: new REe((o - l % o) * this.view.defaultCharacterWidth / this.view.scaleX) }); } - return this.decorationCache[s] || (this.decorationCache[s] = Ht.replace({ widget: new qEe(t, s) })); + return this.decorationCache[s] || (this.decorationCache[s] = Ht.replace({ widget: new AEe(t, s) })); }, boundary: t.replaceTabs ? void 0 : /[^]/ }); } update(t) { - let e = t.state.facet(K3); - t.startState.facet(K3) != 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(j5); + t.startState.facet(j5) != 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 FEe = "\u2022"; -function zEe(t) { - return t >= 32 ? FEe : t == 10 ? "\u2424" : String.fromCharCode(9216 + t); +const EEe = "\u2022"; +function _Ee(t) { + return t >= 32 ? EEe : t == 10 ? "\u2424" : String.fromCharCode(9216 + t); } -class qEe extends nl { +class AEe extends el { constructor(e, r) { super(), this.options = e, this.code = r; } @@ -9675,7 +9675,7 @@ class qEe extends nl { return e.code == this.code; } toDOM(e) { - let r = zEe(this.code), n = e.state.phrase("Control character") + " " + (IEe[this.code] || "0x" + this.code.toString(16)), i = this.options.render && this.options.render(this.code, n, r); + let r = _Ee(this.code), n = e.state.phrase("Control character") + " " + (SEe[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"); @@ -9685,7 +9685,7 @@ class qEe extends nl { return !1; } } -class UEe extends nl { +class REe extends el { constructor(e) { super(), this.width = e; } @@ -9700,10 +9700,10 @@ class UEe extends nl { return !1; } } -function RW() { - return VEe; +function vW() { + return MEe; } -const QEe = /* @__PURE__ */ Ht.line({ class: "cm-activeLine" }), VEe = /* @__PURE__ */ fn.fromClass(class { +const LEe = /* @__PURE__ */ Ht.line({ class: "cm-activeLine" }), MEe = /* @__PURE__ */ fn.fromClass(class { constructor(t) { this.decorations = this.getDeco(t); } @@ -9714,16 +9714,16 @@ const QEe = /* @__PURE__ */ Ht.line({ class: "cm-activeLine" }), VEe = /* @__PUR let e = -1, r = []; for (let n of t.state.selection.ranges) { let i = t.lineBlockAt(n.head); - i.from > e && (r.push(QEe.range(i.from)), e = i.from); + i.from > e && (r.push(LEe.range(i.from)), e = i.from); } return Ht.set(r); } }, { decorations: (t) => t.decorations -}), o9 = 2e3; -function WEe(t, e, r) { +}), r9 = 2e3; +function DEe(t, e, r) { let n = Math.min(e.line, r.line), i = Math.max(e.line, r.line), s = []; - if (e.off > o9 || r.off > o9 || e.col < 0 || r.col < 0) { + if (e.off > r9 || r.off > r9 || 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); @@ -9732,27 +9732,27 @@ function WEe(t, e, r) { } 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 = BM(u.text, a, t.tabSize, !0); + let u = t.doc.line(l), h = DM(u.text, a, t.tabSize, !0); if (h < 0) s.push(ft.cursor(u.to)); else { - let f = BM(u.text, o, t.tabSize); + let f = DM(u.text, o, t.tabSize); s.push(ft.range(u.from + h, u.from + f)); } } } return s; } -function YEe(t, e) { +function PEe(t, e) { let r = t.coordsAtPos(t.viewport.from); return r ? Math.round(Math.abs((r.left - e) / t.defaultCharacterWidth)) : -1; } -function LW(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 > o9 ? -1 : i == n.length ? YEe(t, e.clientX) : ou(n.text, t.state.tabSize, r - n.from); +function yW(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 > r9 ? -1 : i == n.length ? PEe(t, e.clientX) : iu(n.text, t.state.tabSize, r - n.from); return { line: n.number, col: s, off: i }; } -function GEe(t, e) { - let r = LW(t, e), n = t.state.selection; +function NEe(t, e) { + let r = yW(t, e), n = t.state.selection; return r ? { update(i) { if (i.docChanged) { @@ -9761,26 +9761,26 @@ function GEe(t, e) { } }, get(i, s, a) { - let o = LW(t, i); + let o = yW(t, i); if (!o) return n; - let l = WEe(t.state, r, o); + let l = DEe(t.state, r, o); return l.length ? a ? ft.create(l.concat(n.ranges)) : ft.create(l) : n; } } : null; } -function HEe(t) { +function IEe(t) { let e = (t == null ? void 0 : t.eventFilter) || ((r) => r.altKey && r.button == 0); - return Mt.mouseSelectionStyle.of((r, n) => e(n) ? GEe(r, n) : null); + return Mt.mouseSelectionStyle.of((r, n) => e(n) ? NEe(r, n) : null); } -const XEe = { +const $Ee = { Alt: [18, (t) => !!t.altKey], Control: [17, (t) => !!t.ctrlKey], Shift: [16, (t) => !!t.shiftKey], Meta: [91, (t) => !!t.metaKey] -}, jEe = { style: "cursor: crosshair" }; -function ZEe(t = {}) { - let [e, r] = XEe[t.key || "Alt"], n = fn.fromClass(class { +}, BEe = { style: "cursor: crosshair" }; +function FEe(t = {}) { + let [e, r] = $Ee[t.key || "Alt"], n = fn.fromClass(class { constructor(i) { this.view = i, this.isDown = !1; } @@ -9804,12 +9804,12 @@ function ZEe(t = {}) { n, Mt.contentAttributes.of((i) => { var s; - return !((s = i.plugin(n)) === null || s === void 0) && s.isDown ? jEe : null; + return !((s = i.plugin(n)) === null || s === void 0) && s.isDown ? BEe : null; }) ]; } -const z2 = "-10000px"; -class xae { +const I2 = "-10000px"; +class hae { constructor(e, r, n, i) { this.facet = r, this.createTooltipView = n, this.removeTooltipView = i, this.input = e.state.facet(r), this.tooltips = this.input.filter((a) => a); let s = null; @@ -9844,24 +9844,24 @@ class xae { return r && (o.forEach((l, u) => r[u] = l), r.length = o.length), this.input = i, this.tooltips = s, this.tooltipViews = a, !0; } } -function KEe(t) { +function zEe(t) { let { win: e } = t; return { top: 0, left: 0, bottom: e.innerHeight, right: e.innerWidth }; } -const n8 = /* @__PURE__ */ Gt.define({ +const Z7 = /* @__PURE__ */ Gt.define({ combine: (t) => { var e, r, n; return { position: nr.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) || KEe + tooltipSpace: ((n = t.find((i) => i.tooltipSpace)) === null || n === void 0 ? void 0 : n.tooltipSpace) || zEe }; } -}), MW = /* @__PURE__ */ new WeakMap(), Y$ = /* @__PURE__ */ fn.fromClass(class { +}), bW = /* @__PURE__ */ new WeakMap(), P$ = /* @__PURE__ */ fn.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(n8); - 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.resizeObserver = typeof ResizeObserver == "function" ? new ResizeObserver(() => this.measureSoon()) : null, this.manager = new xae(t, G$, (r, n) => this.createTooltip(r, n), (r) => { + let e = t.state.facet(Z7); + 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.resizeObserver = typeof ResizeObserver == "function" ? new ResizeObserver(() => this.measureSoon()) : null, this.manager = new hae(t, N$, (r, n) => this.createTooltip(r, n), (r) => { this.resizeObserver && this.resizeObserver.unobserve(r.dom), r.dom.remove(); }), this.above = this.manager.tooltips.map((r) => !!r.above), this.intersectionObserver = typeof IntersectionObserver == "function" ? new IntersectionObserver((r) => { Date.now() > this.lastTransaction - 50 && r.length > 0 && r[r.length - 1].intersectionRatio < 1 && this.measureSoon(); @@ -9886,7 +9886,7 @@ const n8 = /* @__PURE__ */ Gt.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(n8); + let r = e || t.geometryChanged, n = t.state.facet(Z7); if (n.position != this.position && !this.madeAbsolute) { this.position = n.position; for (let i of this.manager.tooltipViews) @@ -9908,7 +9908,7 @@ const n8 = /* @__PURE__ */ Gt.define({ let i = document.createElement("div"); i.className = "cm-tooltip-arrow", r.dom.appendChild(i); } - return r.dom.style.position = this.position, r.dom.style.top = z2, r.dom.style.left = "0px", this.container.insertBefore(r.dom, n), r.mount && r.mount(this.view), this.resizeObserver && this.resizeObserver.observe(r.dom), r; + return r.dom.style.position = this.position, r.dom.style.top = I2, r.dom.style.left = "0px", this.container.insertBefore(r.dom, n), r.mount && r.mount(this.view), this.resizeObserver && this.resizeObserver.observe(r.dom), r; } destroy() { var t, e, r; @@ -9923,7 +9923,7 @@ const n8 = /* @__PURE__ */ Gt.define({ let { dom: s } = this.manager.tooltipViews[0]; if (nr.gecko) r = s.offsetParent != this.container.ownerDocument.body; - else if (s.style.top == z2 && s.style.left == "0px") { + else if (s.style.top == I2 && s.style.left == "0px") { let a = s.getBoundingClientRect(); r = Math.abs(a.top + 1e4) > 1 || Math.abs(a.left) > 1; } @@ -9934,7 +9934,7 @@ const n8 = /* @__PURE__ */ Gt.define({ s.width && s.height && (t = s.width / this.parent.offsetWidth, e = s.height / this.parent.offsetHeight); } else ({ scaleX: t, scaleY: e } = this.view.viewState); - let n = this.view.scrollDOM.getBoundingClientRect(), i = U$(this.view); + let n = this.view.scrollDOM.getBoundingClientRect(), i = R$(this.view); return { visible: { left: n.left + i.left, @@ -9948,7 +9948,7 @@ const n8 = /* @__PURE__ */ Gt.define({ return o.getCoords ? o.getCoords(s.pos) : this.view.coordsAtPos(s.pos); }), size: this.manager.tooltipViews.map(({ dom: s }) => s.getBoundingClientRect()), - space: this.view.state.facet(n8).tooltipSpace(this.view), + space: this.view.state.facet(Z7).tooltipSpace(this.view), scaleX: t, scaleY: e, makeAbsolute: r @@ -9965,27 +9965,27 @@ const n8 = /* @__PURE__ */ Gt.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 || l.clip !== !1 && (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 = z2; + h.style.top = I2; continue; } - let p = l.arrow ? u.dom.querySelector(".cm-tooltip-arrow") : null, g = p ? 7 : 0, m = d.right - d.left, v = (e = MW.get(u)) !== null && e !== void 0 ? e : d.bottom - d.top, y = u.offset || e_e, b = this.view.textDirection == Xn.LTR, w = d.width > n.right - n.left ? b ? n.left : n.right - d.width : b ? Math.max(n.left, Math.min(f.left - (p ? 14 : 0) + y.x, n.right - m)) : Math.min(Math.max(n.left, f.left - m + (p ? 14 : 0) - y.x), n.right - m), 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 = bW.get(u)) !== null && e !== void 0 ? e : d.bottom - d.top, y = u.offset || UEe, b = this.view.textDirection == Xn.LTR, w = d.width > n.right - n.left ? b ? n.left : n.right - d.width : b ? Math.max(n.left, Math.min(f.left - (p ? 14 : 0) + y.x, n.right - m)) : Math.min(Math.max(n.left, f.left - m + (p ? 14 : 0) - y.x), n.right - m), O = this.above[o]; !l.strictSide && (O ? f.top - v - g - y.y < n.top : f.bottom + v + g + 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 = z2; + h.style.top = I2; continue; } - MW.set(u, v), h.style.height = (v = S) / s + "px"; + bW.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; if (u.overlap !== !0) - for (let L of a) - L.left < T && L.right > w && L.top < C + v && L.bottom > C && (C = O ? L.top - v - 2 - g : L.bottom + g + 2); - if (this.position == "absolute" ? (h.style.top = (C - t.parent.top) / s + "px", DW(h, (w - t.parent.left) / i)) : (h.style.top = C / s + "px", DW(h, w / i)), p) { - let L = f.left + (b ? y.x : -y.x) - (w + 14 - 7); - p.style.left = L / i + "px"; + for (let D of a) + D.left < T && D.right > w && D.top < C + v && D.bottom > C && (C = O ? D.top - v - 2 - g : D.bottom + g + 2); + if (this.position == "absolute" ? (h.style.top = (C - t.parent.top) / s + "px", xW(h, (w - t.parent.left) / i)) : (h.style.top = C / s + "px", xW(h, w / i)), p) { + let D = f.left + (b ? y.x : -y.x) - (w + 14 - 7); + p.style.left = D / i + "px"; } u.overlap !== !0 && a.push({ left: w, top: C, right: T, bottom: C + v }), h.classList.toggle("cm-tooltip-above", O), h.classList.toggle("cm-tooltip-below", !O), u.positioned && u.positioned(t.space); } @@ -9993,7 +9993,7 @@ const n8 = /* @__PURE__ */ Gt.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 = z2; + t.dom.style.top = I2; } }, { eventObservers: { @@ -10002,11 +10002,11 @@ const n8 = /* @__PURE__ */ Gt.define({ } } }); -function DW(t, e) { +function xW(t, e) { let r = parseInt(t.style.left, 10); (isNaN(r) || Math.abs(e - r) > 1) && (t.style.left = e + "px"); } -const JEe = /* @__PURE__ */ Mt.baseTheme({ +const qEe = /* @__PURE__ */ Mt.baseTheme({ ".cm-tooltip": { zIndex: 500, boxSizing: "border-box" @@ -10067,17 +10067,17 @@ const JEe = /* @__PURE__ */ Mt.baseTheme({ borderBottomColor: "transparent" } } -}), e_e = { x: 0, y: 0 }, G$ = /* @__PURE__ */ Gt.define({ - enables: [Y$, JEe] -}), gT = /* @__PURE__ */ Gt.define({ +}), UEe = { x: 0, y: 0 }, N$ = /* @__PURE__ */ Gt.define({ + enables: [P$, qEe] +}), dT = /* @__PURE__ */ Gt.define({ combine: (t) => t.reduce((e, r) => e.concat(r), []) }); -class j_ { +class Y_ { static create(e) { - return new j_(e); + return new Y_(e); } constructor(e) { - this.view = e, this.mounted = !1, this.dom = document.createElement("div"), this.dom.classList.add("cm-tooltip-hover"), this.manager = new xae(e, gT, (r, n) => this.createHostedView(r, n), (r) => r.dom.remove()); + this.view = e, this.mounted = !1, this.dom = document.createElement("div"), this.dom.classList.add("cm-tooltip-hover"), this.manager = new hae(e, dT, (r, n) => this.createHostedView(r, n), (r) => r.dom.remove()); } createHostedView(e, r) { let n = e.create(this.view); @@ -10126,20 +10126,20 @@ class j_ { return this.passProp("resize"); } } -const t_e = /* @__PURE__ */ G$.compute([gT], (t) => { - let e = t.facet(gT); +const QEe = /* @__PURE__ */ N$.compute([dT], (t) => { + let e = t.facet(dT); 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: j_.create, + create: Y_.create, above: e[0].above, arrow: e.some((r) => r.arrow) }; }); -class r_e { +class VEe { 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)); } @@ -10161,7 +10161,7 @@ class r_e { if (!n) return; let i, s = 1; - if (n instanceof Dd) + if (n instanceof Rd) i = n.posAtStart; else { if (i = e.posAtCoords(r), i == null) @@ -10177,21 +10177,21 @@ class r_e { let o = this.pending = { pos: i }; a.then((l) => { this.pending == o && (this.pending = null, l && !(Array.isArray(l) && !l.length) && e.dispatch({ effects: this.setHover.of(Array.isArray(l) ? l : [l]) })); - }, (l) => Ho(e.state, l, "hover tooltip")); + }, (l) => Wo(e.state, l, "hover tooltip")); } else a && !(Array.isArray(a) && !a.length) && e.dispatch({ effects: this.setHover.of(Array.isArray(a) ? a : [a]) }); } get tooltip() { - let e = this.view.plugin(Y$), r = e ? e.manager.tooltips.findIndex((n) => n.create == j_.create) : -1; + let e = this.view.plugin(P$), r = e ? e.manager.tooltips.findIndex((n) => n.create == Y_.create) : -1; return r > -1 ? e.manager.tooltipViews[r] : null; } mousemove(e) { var r, n; 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: i, tooltip: s } = this; - if (i.length && s && !n_e(s.dom, e) || this.pending) { + if (i.length && s && !WEe(s.dom, e) || this.pending) { let { pos: a } = i[0] || this.pending, o = (n = (r = i[0]) === null || r === void 0 ? void 0 : r.end) !== null && n !== void 0 ? n : a; - (a == o ? this.view.posAtCoords(this.lastMove) != a : !i_e(this.view, a, o, e.clientX, e.clientY)) && (this.view.dispatch({ effects: this.setHover.of([]) }), this.pending = null); + (a == o ? this.view.posAtCoords(this.lastMove) != a : !YEe(this.view, a, o, e.clientX, e.clientY)) && (this.view.dispatch({ effects: this.setHover.of([]) }), this.pending = null); } } mouseleave(e) { @@ -10212,23 +10212,23 @@ class r_e { clearTimeout(this.hoverTimeout), this.view.dom.removeEventListener("mouseleave", this.mouseleave), this.view.dom.removeEventListener("mousemove", this.mousemove); } } -const iS = 4; -function n_e(t, e) { +const tS = 4; +function WEe(t, e) { let { left: r, right: n, top: i, bottom: s } = t.getBoundingClientRect(), a; if (a = t.querySelector(".cm-tooltip-arrow")) { let o = a.getBoundingClientRect(); i = Math.min(o.top, i), s = Math.max(o.bottom, s); } - return e.clientX >= r - iS && e.clientX <= n + iS && e.clientY >= i - iS && e.clientY <= s + iS; + return e.clientX >= r - tS && e.clientX <= n + tS && e.clientY >= i - tS && e.clientY <= s + tS; } -function i_e(t, e, r, n, i, s) { +function YEe(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 wae(t, e = {}) { +function fae(t, e = {}) { let r = _r.define(), n = ai.define({ create() { return []; @@ -10246,28 +10246,28 @@ function wae(t, e = {}) { i = a; } for (let a of s.effects) - a.is(r) && (i = a.value), a.is(s_e) && (i = []); + a.is(r) && (i = a.value), a.is(GEe) && (i = []); return i; }, - provide: (i) => gT.from(i) + provide: (i) => dT.from(i) }); return { active: n, extension: [ n, - fn.define((i) => new r_e(i, t, n, r, e.hoverTime || 300)), - t_e + fn.define((i) => new VEe(i, t, n, r, e.hoverTime || 300)), + QEe ] }; } -function Oae(t, e) { - let r = t.plugin(Y$); +function dae(t, e) { + let r = t.plugin(P$); if (!r) return null; let n = r.manager.tooltips.indexOf(e); return n < 0 ? null : r.manager.tooltipViews[n]; } -const s_e = /* @__PURE__ */ _r.define(), PW = /* @__PURE__ */ Gt.define({ +const GEe = /* @__PURE__ */ _r.define(), wW = /* @__PURE__ */ Gt.define({ combine(t) { let e, r; for (let n of t) @@ -10275,22 +10275,22 @@ const s_e = /* @__PURE__ */ _r.define(), PW = /* @__PURE__ */ Gt.define({ return { topContainer: e, bottomContainer: r }; } }); -function Wx(t, e) { - let r = t.plugin(kae), n = r ? r.specs.indexOf(e) : -1; +function Qx(t, e) { + let r = t.plugin(pae), n = r ? r.specs.indexOf(e) : -1; return n > -1 ? r.panels[n] : null; } -const kae = /* @__PURE__ */ fn.fromClass(class { +const pae = /* @__PURE__ */ fn.fromClass(class { constructor(t) { - this.input = t.state.facet(yg), this.specs = this.input.filter((r) => r), this.panels = this.specs.map((r) => r(t)); - let e = t.state.facet(PW); - this.top = new sS(t, !0, e.topContainer), this.bottom = new sS(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(pg), this.specs = this.input.filter((r) => r), this.panels = this.specs.map((r) => r(t)); + let e = t.state.facet(wW); + this.top = new rS(t, !0, e.topContainer), this.bottom = new rS(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(PW); - this.top.container != e.topContainer && (this.top.sync([]), this.top = new sS(t.view, !0, e.topContainer)), this.bottom.container != e.bottomContainer && (this.bottom.sync([]), this.bottom = new sS(t.view, !1, e.bottomContainer)), this.top.syncClasses(), this.bottom.syncClasses(); - let r = t.state.facet(yg); + let e = t.state.facet(wW); + this.top.container != e.topContainer && (this.top.sync([]), this.top = new rS(t.view, !0, e.topContainer)), this.bottom.container != e.bottomContainer && (this.bottom.sync([]), this.bottom = new rS(t.view, !1, e.bottomContainer)), this.top.syncClasses(), this.bottom.syncClasses(); + let r = t.state.facet(pg); if (r != this.input) { let n = r.filter((l) => l), i = [], s = [], a = [], o = []; for (let l of n) { @@ -10313,7 +10313,7 @@ const kae = /* @__PURE__ */ fn.fromClass(class { return r && { top: r.top.scrollMargin(), bottom: r.bottom.scrollMargin() }; }) }); -class sS { +class rS { constructor(e, r, n) { this.view = e, this.top = r, this.container = n, this.dom = void 0, this.classes = "", this.panels = [], this.syncClasses(); } @@ -10336,12 +10336,12 @@ class sS { for (let r of this.panels) if (r.dom.parentNode == this.dom) { for (; e != r.dom; ) - e = NW(e); + e = OW(e); e = e.nextSibling; } else this.dom.insertBefore(r.dom, e); for (; e; ) - e = NW(e); + e = OW(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); @@ -10355,14 +10355,14 @@ class sS { } } } -function NW(t) { +function OW(t) { let e = t.nextSibling; return t.remove(), e; } -const yg = /* @__PURE__ */ Gt.define({ - enables: kae +const pg = /* @__PURE__ */ Gt.define({ + enables: pae }); -class pc extends pg { +class hc extends ug { compare(e) { return this == e || this.constructor == e.constructor && this.eq(e); } @@ -10372,12 +10372,12 @@ class pc extends pg { destroy(e) { } } -pc.prototype.elementClass = ""; -pc.prototype.toDOM = void 0; -pc.prototype.mapMode = gi.TrackBefore; -pc.prototype.startSide = pc.prototype.endSide = -1; -pc.prototype.point = !0; -const J3 = /* @__PURE__ */ Gt.define(), a_e = /* @__PURE__ */ Gt.define(), o_e = { +hc.prototype.elementClass = ""; +hc.prototype.toDOM = void 0; +hc.prototype.mapMode = gi.TrackBefore; +hc.prototype.startSide = hc.prototype.endSide = -1; +hc.prototype.point = !0; +const Z5 = /* @__PURE__ */ Gt.define(), HEe = /* @__PURE__ */ Gt.define(), XEe = { class: "", renderEmptyElements: !1, elementStyle: "", @@ -10388,51 +10388,51 @@ const J3 = /* @__PURE__ */ Gt.define(), a_e = /* @__PURE__ */ Gt.define(), o_e = initialSpacer: null, updateSpacer: null, domEventHandlers: {} -}, cx = /* @__PURE__ */ Gt.define(); -function Z_(t) { - return [Sae(), cx.of(Object.assign(Object.assign({}, o_e), t))]; +}, ox = /* @__PURE__ */ Gt.define(); +function G_(t) { + return [gae(), ox.of(Object.assign(Object.assign({}, XEe), t))]; } -const l9 = /* @__PURE__ */ Gt.define({ +const n9 = /* @__PURE__ */ Gt.define({ combine: (t) => t.some((e) => e) }); -function Sae(t) { +function gae(t) { let e = [ - l_e + jEe ]; - return t && t.fixed === !1 && e.push(l9.of(!0)), e; + return t && t.fixed === !1 && e.push(n9.of(!0)), e; } -const l_e = /* @__PURE__ */ fn.fromClass(class { +const jEe = /* @__PURE__ */ fn.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(cx).map((e) => new $W(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(ox).map((e) => new SW(t, e)); for (let e of this.gutters) this.dom.appendChild(e.dom); - this.fixed = !t.state.facet(l9), this.fixed && (this.dom.style.position = "sticky"), this.syncGutters(!1), t.scrollDOM.insertBefore(this.dom, t.contentDOM); + this.fixed = !t.state.facet(n9), 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 / this.view.scaleY + "px"), this.view.state.facet(l9) != !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 / this.view.scaleY + "px"), this.view.state.facet(n9) != !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 = jr.iter(this.view.state.facet(J3), this.view.viewport.from), n = [], i = this.gutters.map((s) => new c_e(s, this.view.viewport, -this.view.documentPadding.top)); + let r = jr.iter(this.view.state.facet(Z5), this.view.viewport.from), n = [], i = this.gutters.map((s) => new ZEe(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 == po.Text && a) { - c9(r, n, o.from); + if (o.type == uo.Text && a) { + i9(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 == po.Text) { - c9(r, n, s.from); + } else if (s.type == uo.Text) { + i9(r, n, s.from); for (let a of i) a.line(this.view, s, n); } else if (s.widget) @@ -10443,7 +10443,7 @@ const l_e = /* @__PURE__ */ fn.fromClass(class { t && this.view.scrollDOM.insertBefore(this.dom, e); } updateGutters(t) { - let e = t.startState.facet(cx), r = t.state.facet(cx), n = t.docChanged || t.heightChanged || t.viewportChanged || !jr.eq(t.startState.facet(J3), t.state.facet(J3), t.view.viewport.from, t.view.viewport.to); + let e = t.startState.facet(ox), r = t.state.facet(ox), n = t.docChanged || t.heightChanged || t.viewportChanged || !jr.eq(t.startState.facet(Z5), t.state.facet(Z5), t.view.viewport.from, t.view.viewport.to); if (e == r) for (let i of this.gutters) i.update(t) && (n = !0); @@ -10452,7 +10452,7 @@ const l_e = /* @__PURE__ */ fn.fromClass(class { let i = []; for (let s of r) { let a = e.indexOf(s); - a < 0 ? i.push(new $W(this.view, s)) : (this.gutters[a].update(t), i.push(this.gutters[a])); + a < 0 ? i.push(new SW(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(); @@ -10473,21 +10473,21 @@ const l_e = /* @__PURE__ */ fn.fromClass(class { return !r || r.gutters.length == 0 || !r.fixed ? null : e.textDirection == Xn.LTR ? { left: r.dom.offsetWidth * e.scaleX } : { right: r.dom.offsetWidth * e.scaleX }; }) }); -function IW(t) { +function kW(t) { return Array.isArray(t) ? t : [t]; } -function c9(t, e, r) { +function i9(t, e, r) { for (; t.value && t.from <= r; ) t.from == r && e.push(t.value), t.next(); } -class c_e { +class ZEe { constructor(e, r, n) { this.gutter = e, this.height = n, this.i = 0, this.cursor = jr.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 Tae(e, a, s, n); + let o = new mae(e, a, s, n); i.elements.push(o), i.dom.appendChild(o.dom); } else i.elements[this.i].update(e, a, s, n); @@ -10495,7 +10495,7 @@ class c_e { } line(e, r, n) { let i = []; - c9(this.cursor, i, r.from), n.length && (i = i.concat(n)); + i9(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; @@ -10503,7 +10503,7 @@ class c_e { } widget(e, r) { let n = this.gutter.config.widgetMarker(e, r.widget, r), i = n ? [n] : null; - for (let s of e.state.facet(a_e)) { + for (let s of e.state.facet(HEe)) { let a = s(e, r.widget, r); a && (i || (i = [])).push(a); } @@ -10517,7 +10517,7 @@ class c_e { } } } -class $W { +class SW { 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) @@ -10533,11 +10533,11 @@ class $W { let o = e.lineBlockAtHeight(a - e.documentTop); r.domEventHandlers[n](e, o, i) && i.preventDefault(); }); - this.markers = IW(r.markers(e)), r.initialSpacer && (this.spacer = new Tae(e, 0, 0, [r.initialSpacer(e)]), this.dom.appendChild(this.spacer.dom), this.spacer.dom.style.cssText += "visibility: hidden; pointer-events: none"); + this.markers = kW(r.markers(e)), r.initialSpacer && (this.spacer = new mae(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 = IW(this.config.markers(e.view)), this.spacer && this.config.updateSpacer) { + if (this.markers = kW(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]); } @@ -10549,12 +10549,12 @@ class $W { e.destroy(); } } -class Tae { +class mae { 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" : ""), u_e(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" : ""), KEe(this.markers, i) || this.setMarkers(e, i); } setMarkers(e, r) { let n = "cm-gutterElement", i = this.dom.firstChild; @@ -10588,7 +10588,7 @@ class Tae { this.setMarkers(null, []); } } -function u_e(t, e) { +function KEe(t, e) { if (t.length != e.length) return !1; for (let r = 0; r < t.length; r++) @@ -10596,9 +10596,9 @@ function u_e(t, e) { return !1; return !0; } -const h_e = /* @__PURE__ */ Gt.define(), f_e = /* @__PURE__ */ Gt.define(), v1 = /* @__PURE__ */ Gt.define({ +const JEe = /* @__PURE__ */ Gt.define(), e_e = /* @__PURE__ */ Gt.define(), d1 = /* @__PURE__ */ Gt.define({ combine(t) { - return Ah(t, { formatNumber: String, domEventHandlers: {} }, { + return Th(t, { formatNumber: String, domEventHandlers: {} }, { domEventHandlers(e, r) { let n = Object.assign({}, e); for (let i in r) { @@ -10610,7 +10610,7 @@ const h_e = /* @__PURE__ */ Gt.define(), f_e = /* @__PURE__ */ Gt.define(), v1 = }); } }); -class i8 extends pc { +class K7 extends hc { constructor(e) { super(), this.number = e; } @@ -10621,81 +10621,81 @@ class i8 extends pc { return document.createTextNode(this.number); } } -function s8(t, e) { - return t.state.facet(v1).formatNumber(e, t.state); +function J7(t, e) { + return t.state.facet(d1).formatNumber(e, t.state); } -const d_e = /* @__PURE__ */ cx.compute([v1], (t) => ({ +const t_e = /* @__PURE__ */ ox.compute([d1], (t) => ({ class: "cm-lineNumbers", renderEmptyElements: !1, markers(e) { - return e.state.facet(h_e); + return e.state.facet(JEe); }, lineMarker(e, r, n) { - return n.some((i) => i.toDOM) ? null : new i8(s8(e, e.state.doc.lineAt(r.from).number)); + return n.some((i) => i.toDOM) ? null : new K7(J7(e, e.state.doc.lineAt(r.from).number)); }, widgetMarker: (e, r, n) => { - for (let i of e.state.facet(f_e)) { + for (let i of e.state.facet(e_e)) { let s = i(e, r, n); if (s) return s; } return null; }, - lineMarkerChange: (e) => e.startState.facet(v1) != e.state.facet(v1), + lineMarkerChange: (e) => e.startState.facet(d1) != e.state.facet(d1), initialSpacer(e) { - return new i8(s8(e, BW(e.state.doc.lines))); + return new K7(J7(e, TW(e.state.doc.lines))); }, updateSpacer(e, r) { - let n = s8(r.view, BW(r.view.state.doc.lines)); - return n == e.number ? e : new i8(n); + let n = J7(r.view, TW(r.view.state.doc.lines)); + return n == e.number ? e : new K7(n); }, - domEventHandlers: t.facet(v1).domEventHandlers + domEventHandlers: t.facet(d1).domEventHandlers })); -function p_e(t = {}) { +function r_e(t = {}) { return [ - v1.of(t), - Sae(), - d_e + d1.of(t), + gae(), + t_e ]; } -function BW(t) { +function TW(t) { let e = 9; for (; e < t; ) e = e * 10 + 9; return e; } -const g_e = /* @__PURE__ */ new class extends pc { +const n_e = /* @__PURE__ */ new class extends hc { constructor() { super(...arguments), this.elementClass = "cm-activeLineGutter"; } -}(), m_e = /* @__PURE__ */ J3.compute(["selection"], (t) => { +}(), i_e = /* @__PURE__ */ Z5.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(g_e.range(i))); + i > r && (r = i, e.push(n_e.range(i))); } return jr.of(e); }); -function v_e() { - return m_e; +function s_e() { + return i_e; } -const Cae = 1024; -let y_e = 0; -class ec { +const vae = 1024; +let a_e = 0; +class Zl { constructor(e, r) { this.from = e, this.to = r; } } class Fr { constructor(e = {}) { - this.id = y_e++, this.perNode = !!e.perNode, this.deserialize = e.deserialize || (() => { + this.id = a_e++, 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 = xs.match(e)), (r) => { + return typeof e != "function" && (e = ys.match(e)), (r) => { let n = e(r); return n === void 0 ? null : [this, n]; }; @@ -10712,7 +10712,7 @@ Fr.isolate = new Fr({ deserialize: (t) => { Fr.contextHash = new Fr({ perNode: !0 }); Fr.lookAhead = new Fr({ perNode: !0 }); Fr.mounted = new Fr({ perNode: !0 }); -class Yx { +class Vx { constructor(e, r, n) { this.tree = e, this.overlay = r, this.parser = n; } @@ -10720,13 +10720,13 @@ class Yx { return e && e.props && e.props[Fr.mounted.id]; } } -const b_e = /* @__PURE__ */ Object.create(null); -class xs { +const o_e = /* @__PURE__ */ Object.create(null); +class ys { 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) : b_e, n = (e.top ? 1 : 0) | (e.skipped ? 2 : 0) | (e.error ? 4 : 0) | (e.name == null ? 8 : 0), i = new xs(e.name || "", r, e.id, n); + let r = e.props && e.props.length ? /* @__PURE__ */ Object.create(null) : o_e, n = (e.top ? 1 : 0) | (e.skipped ? 2 : 0) | (e.error ? 4 : 0) | (e.name == null ? 8 : 0), i = new ys(e.name || "", r, e.id, n); if (e.props) { for (let s of e.props) if (Array.isArray(s) || (s = s(i)), s) { @@ -10775,8 +10775,8 @@ class xs { }; } } -xs.none = new xs("", /* @__PURE__ */ Object.create(null), 0, 8); -class Ok { +ys.none = new ys("", /* @__PURE__ */ Object.create(null), 0, 8); +class bk { constructor(e) { this.types = e; for (let r = 0; r < e.length; r++) @@ -10791,12 +10791,12 @@ class Ok { let a = s(n); a && (i || (i = Object.assign({}, n.props)), i[a[0].id] = a[1]); } - r.push(i ? new xs(n.name, i, n.id, n.flags) : n); + r.push(i ? new ys(n.name, i, n.id, n.flags) : n); } - return new Ok(r); + return new bk(r); } } -const aS = /* @__PURE__ */ new WeakMap(), FW = /* @__PURE__ */ new WeakMap(); +const nS = /* @__PURE__ */ new WeakMap(), CW = /* @__PURE__ */ new WeakMap(); var Hn; (function(t) { t[t.ExcludeBuffers = 1] = "ExcludeBuffers", t[t.IncludeAnonymous = 2] = "IncludeAnonymous", t[t.IgnoreMounts = 4] = "IgnoreMounts", t[t.IgnoreOverlays = 8] = "IgnoreOverlays"; @@ -10810,7 +10810,7 @@ class kn { } } toString() { - let e = Yx.get(this); + let e = Vx.get(this); if (e && !e.overlay) return e.tree.toString(); let r = ""; @@ -10821,25 +10821,25 @@ class kn { 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 mT(this.topNode, e); + return new pT(this.topNode, e); } cursorAt(e, r = 0, n = 0) { - let i = aS.get(this) || this.topNode, s = new mT(i); - return s.moveTo(e, r), aS.set(this, s._tree), s; + let i = nS.get(this) || this.topNode, s = new pT(i); + return s.moveTo(e, r), nS.set(this, s._tree), s; } get topNode() { - return new za(this, 0, 0, null); + return new Ba(this, 0, 0, null); } resolve(e, r = 0) { - let n = Gx(aS.get(this) || this.topNode, e, r, !1); - return aS.set(this, n), n; + let n = Wx(nS.get(this) || this.topNode, e, r, !1); + return nS.set(this, n), n; } resolveInner(e, r = 0) { - let n = Gx(FW.get(this) || this.topNode, e, r, !0); - return FW.set(this, n), n; + let n = Wx(CW.get(this) || this.topNode, e, r, !0); + return CW.set(this, n), n; } resolveStack(e, r = 0) { - return O_e(this, e, r); + return u_e(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; @@ -10868,14 +10868,14 @@ class kn { return e; } balance(e = {}) { - return this.children.length <= 8 ? this : j$(xs.none, this.children, this.positions, 0, this.children.length, 0, this.length, (r, n, i) => new kn(this.type, r, n, i, this.propValues), e.makeTree || ((r, n, i) => new kn(xs.none, r, n, i))); + return this.children.length <= 8 ? this : B$(ys.none, this.children, this.positions, 0, this.children.length, 0, this.length, (r, n, i) => new kn(this.type, r, n, i, this.propValues), e.makeTree || ((r, n, i) => new kn(ys.none, r, n, i))); } static build(e) { - return k_e(e); + return h_e(e); } } -kn.empty = new kn(xs.none, [], [], 0); -class H$ { +kn.empty = new kn(ys.none, [], [], 0); +class I$ { constructor(e, r) { this.buffer = e, this.index = r; } @@ -10898,15 +10898,15 @@ class H$ { this.index -= 4; } fork() { - return new H$(this.buffer, this.index); + return new I$(this.buffer, this.index); } } -class fp { +class op { constructor(e, r, n) { this.buffer = e, this.length = r, this.set = n; } get type() { - return xs.none; + return ys.none; } toString() { let e = []; @@ -10925,7 +10925,7 @@ class fp { } findChild(e, r, n, i, s) { let { buffer: a } = this, o = -1; - for (let l = e; l != r && !(Eae(s, i, a[l + 1], a[l + 2]) && (o = l, n > 0)); l = a[l + 3]) + for (let l = e; l != r && !(yae(s, i, a[l + 1], a[l + 2]) && (o = l, n > 0)); l = a[l + 3]) ; return o; } @@ -10936,10 +10936,10 @@ class fp { let u = s[l++] = i[o++] - n; s[l++] = i[o++] - e, a = Math.max(a, u); } - return new fp(s, a, this.set); + return new op(s, a, this.set); } } -function Eae(t, e, r, n) { +function yae(t, e, r, n) { switch (t) { case -2: return r < e; @@ -10955,9 +10955,9 @@ function Eae(t, e, r, n) { return !0; } } -function Gx(t, e, r, n) { +function Wx(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 za && t.index < 0 ? null : t.parent; + let a = !n && t instanceof Ba && t.index < 0 ? null : t.parent; if (!a) return t; t = a; @@ -10965,7 +10965,7 @@ function Gx(t, e, r, n) { let s = n ? 0 : Hn.IgnoreOverlays; if (n) for (let a = t, o = a.parent; o; a = o, o = a.parent) - a instanceof za && a.index < 0 && ((i = o.enter(e, r, s)) === null || i === void 0 ? void 0 : i.from) != a.from && (t = o); + a instanceof Ba && 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) @@ -10973,25 +10973,25 @@ function Gx(t, e, r, n) { t = a; } } -class _ae { +class bae { cursor(e = 0) { - return new mT(this, e); + return new pT(this, e); } getChild(e, r = null, n = null) { - let i = zW(this, e, r, n); + let i = EW(this, e, r, n); return i.length ? i[0] : null; } getChildren(e, r = null, n = null) { - return zW(this, e, r, n); + return EW(this, e, r, n); } resolve(e, r = 0) { - return Gx(this, e, r, !1); + return Wx(this, e, r, !1); } resolveInner(e, r = 0) { - return Gx(this, e, r, !0); + return Wx(this, e, r, !0); } matchContext(e) { - return u9(this.parent, e); + return s9(this.parent, e); } enterUnfinishedNodesBefore(e) { let r = this.childBefore(e), n = this; @@ -11010,7 +11010,7 @@ class _ae { return this.parent; } } -class za extends _ae { +class Ba extends bae { constructor(e, r, n, i) { super(), this._tree = e, this.from = r, this.index = n, this._parent = i; } @@ -11027,18 +11027,18 @@ class za extends _ae { 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 (!!Eae(i, n, f, f + h.length)) { - if (h instanceof fp) { + if (!!yae(i, n, f, f + h.length)) { + if (h instanceof op) { if (s & Hn.ExcludeBuffers) continue; let d = h.findChild(0, h.buffer.length, r, n - f, i); if (d > -1) - return new Xu(new x_e(a, h, e, f), null, d); - } else if (s & Hn.IncludeAnonymous || !h.type.isAnonymous || X$(h)) { + return new Yu(new l_e(a, h, e, f), null, d); + } else if (s & Hn.IncludeAnonymous || !h.type.isAnonymous || $$(h)) { let d; - if (!(s & Hn.IgnoreMounts) && (d = Yx.get(h)) && !d.overlay) - return new za(d.tree, f, e, a); - let p = new za(h, f, e, a); + if (!(s & Hn.IgnoreMounts) && (d = Vx.get(h)) && !d.overlay) + return new Ba(d.tree, f, e, a); + let p = new Ba(h, f, e, a); return s & Hn.IncludeAnonymous || !p.type.isAnonymous ? p : p.nextChild(r < 0 ? h.children.length - 1 : 0, r, n, i); } } @@ -11061,11 +11061,11 @@ class za extends _ae { } enter(e, r, n = 0) { let i; - if (!(n & Hn.IgnoreOverlays) && (i = Yx.get(this._tree)) && i.overlay) { + if (!(n & Hn.IgnoreOverlays) && (i = Vx.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 za(i.tree, i.overlay[0].from + this.from, -1, this); + return new Ba(i.tree, i.overlay[0].from + this.from, -1, this); } return this.nextChild(0, 1, e, r, n); } @@ -11094,7 +11094,7 @@ class za extends _ae { return this._tree.toString(); } } -function zW(t, e, r, n) { +function EW(t, e, r, n) { let i = t.cursor(), s = []; if (!i.firstChild()) return s; @@ -11110,7 +11110,7 @@ function zW(t, e, r, n) { return n == null ? s : []; } } -function u9(t, e, r = e.length - 1) { +function s9(t, e, r = e.length - 1) { for (let n = t; r >= 0; n = n.parent) { if (!n) return !1; @@ -11122,12 +11122,12 @@ function u9(t, e, r = e.length - 1) { } return !0; } -class x_e { +class l_e { constructor(e, r, n, i) { this.parent = e, this.buffer = r, this.index = n, this.start = i; } } -class Xu extends _ae { +class Yu extends bae { get name() { return this.type.name; } @@ -11142,7 +11142,7 @@ class Xu extends _ae { } 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 Xu(this.context, this, s); + return s < 0 ? null : new Yu(this.context, this, s); } get firstChild() { return this.child(1, 0, 4); @@ -11160,7 +11160,7 @@ class Xu extends _ae { if (n & Hn.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 Xu(this.context, this, s); + return s < 0 ? null : new Yu(this.context, this, s); } get parent() { return this._parent || this.context.parent.nextSignificantParent(); @@ -11170,11 +11170,11 @@ class Xu extends _ae { } 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 Xu(this.context, this._parent, r) : this.externalSibling(1); + return r < (this._parent ? e.buffer[this._parent.index + 3] : e.buffer.length) ? new Yu(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 Xu(this.context, this._parent, e.findChild(r, this.index, -1, 0, 4)); + return this.index == r ? this.externalSibling(-1) : new Yu(this.context, this._parent, e.findChild(r, this.index, -1, 0, 4)); } get tree() { return null; @@ -11191,7 +11191,7 @@ class Xu extends _ae { return this.context.buffer.childString(this.index); } } -function Aae(t) { +function xae(t) { if (!t.length) return null; let e = 0, r = t[0]; @@ -11199,38 +11199,38 @@ function Aae(t) { let a = t[s]; (a.from > r.from || a.to < r.to) && (r = a, e = s); } - let n = r instanceof za && r.index < 0 ? null : r.parent, i = t.slice(); - return n ? i[e] = n : i.splice(e, 1), new w_e(i, r); + let n = r instanceof Ba && r.index < 0 ? null : r.parent, i = t.slice(); + return n ? i[e] = n : i.splice(e, 1), new c_e(i, r); } -class w_e { +class c_e { constructor(e, r) { this.heads = e, this.node = r; } get next() { - return Aae(this.heads); + return xae(this.heads); } } -function O_e(t, e, r) { +function u_e(t, e, r) { let n = t.resolveInner(e, r), i = null; - for (let s = n instanceof za ? n : n.context.parent; s; s = s.parent) + for (let s = n instanceof Ba ? 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 = Yx.get(s.tree); + let a = Vx.get(s.tree); if (a && a.overlay && a.overlay[0].from <= e && a.overlay[a.overlay.length - 1].to >= e) { - let o = new za(a.tree, a.overlay[0].from + s.from, -1, s); - (i || (i = [n])).push(Gx(o, e, r, !1)); + let o = new Ba(a.tree, a.overlay[0].from + s.from, -1, s); + (i || (i = [n])).push(Wx(o, e, r, !1)); } } - return i ? Aae(i) : n; + return i ? xae(i) : n; } -class mT { +class pT { 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 za) + if (this.mode = r, this.buffer = null, this.stack = [], this.index = 0, this.bufferNode = null, e instanceof Ba) this.yieldNode(e); else { this._tree = e.context.parent, this.buffer = e.context; @@ -11248,7 +11248,7 @@ class mT { 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 za ? (this.buffer = null, this.yieldNode(e)) : (this.buffer = e.context, this.yieldBuf(e.index, e.type)) : !1; + return e ? e instanceof Ba ? (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(); @@ -11320,7 +11320,7 @@ class mT { 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 fp || !o.type.isAnonymous || X$(o)) + if (this.mode & Hn.IncludeAnonymous || o instanceof op || !o.type.isAnonymous || $$(o)) return !1; } return !0; @@ -11366,8 +11366,8 @@ class mT { } } for (let i = n; i < this.stack.length; i++) - r = new Xu(this.buffer, r, this.stack[i]); - return this.bufferNode = new Xu(this.buffer, r, this.index); + r = new Yu(this.buffer, r, this.stack[i]); + return this.bufferNode = new Yu(this.buffer, r, this.index); } get tree() { return this.buffer ? null : this._tree._tree; @@ -11393,11 +11393,11 @@ class mT { } matchContext(e) { if (!this.buffer) - return u9(this.node.parent, e); + return s9(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 u9(this._tree, e, i); + return s9(this._tree, e, i); let a = n[r.buffer[this.stack[s]]]; if (!a.isAnonymous) { if (e[i] && e[i] != a.name) @@ -11408,107 +11408,107 @@ class mT { return !0; } } -function X$(t) { - return t.children.some((e) => e instanceof fp || !e.type.isAnonymous || X$(e)); +function $$(t) { + return t.children.some((e) => e instanceof op || !e.type.isAnonymous || $$(e)); } -function k_e(t) { +function h_e(t) { var e; - let { buffer: r, nodeSet: n, maxBufferLength: i = Cae, reused: s = [], minRepeatType: a = n.types.length } = t, o = Array.isArray(r) ? new H$(r, r.length) : r, l = n.types, u = 0, h = 0; - function f(S, C, T, L, E, P) { - let { id: M, start: N, end: q, size: k } = o, B = h, A = u; + let { buffer: r, nodeSet: n, maxBufferLength: i = vae, reused: s = [], minRepeatType: a = n.types.length } = t, o = Array.isArray(r) ? new I$(r, r.length) : r, l = n.types, u = 0, h = 0; + function f(S, C, T, D, E, N) { + let { id: P, start: L, end: F, size: k } = o, B = h, A = u; for (; k < 0; ) if (o.next(), k == -1) { - let W = s[M]; - T.push(W), L.push(N - S); + let W = s[P]; + T.push(W), D.push(L - S); return; } else if (k == -3) { - u = M; + u = P; return; } else if (k == -4) { - h = M; + h = P; return; } else throw new RangeError(`Unrecognized record size: ${k}`); - let D = l[M], I, z, Y = N - S; - if (q - N <= i && (z = v(o.pos - C, E))) { - let W = new Uint16Array(z.size - z.skip), Z = o.pos - z.size, K = W.length; + let M = l[P], I, q, Y = L - S; + if (F - L <= i && (q = v(o.pos - C, E))) { + let W = new Uint16Array(q.size - q.skip), Z = o.pos - q.size, K = W.length; for (; o.pos > Z; ) - K = y(z.start, W, K); - I = new fp(W, q - z.start, n), Y = z.start - S; + K = y(q.start, W, K); + I = new op(W, F - q.start, n), Y = q.start - S; } else { let W = o.pos - k; o.next(); - let Z = [], K = [], re = M >= a ? M : -1, pe = 0, ne = q; + let Z = [], K = [], re = P >= a ? P : -1, pe = 0, ne = F; for (; o.pos > W; ) - re >= 0 && o.id == re && o.size >= 0 ? (o.end <= ne - i && (g(Z, K, N, pe, o.end, ne, re, B, A), pe = Z.length, ne = o.end), o.next()) : P > 2500 ? d(N, W, Z, K) : f(N, W, Z, K, re, P + 1); - if (re >= 0 && pe > 0 && pe < Z.length && g(Z, K, N, pe, N, ne, re, B, A), Z.reverse(), K.reverse(), re > -1 && pe > 0) { - let le = p(D, A); - I = j$(D, Z, K, 0, Z.length, 0, q - N, le, le); + re >= 0 && o.id == re && o.size >= 0 ? (o.end <= ne - i && (g(Z, K, L, pe, o.end, ne, re, B, A), pe = Z.length, ne = o.end), o.next()) : N > 2500 ? d(L, W, Z, K) : f(L, W, Z, K, re, N + 1); + if (re >= 0 && pe > 0 && pe < Z.length && g(Z, K, L, pe, L, ne, re, B, A), Z.reverse(), K.reverse(), re > -1 && pe > 0) { + let le = p(M, A); + I = B$(M, Z, K, 0, Z.length, 0, F - L, le, le); } else - I = m(D, Z, K, q - N, B - q, A); + I = m(M, Z, K, F - L, B - F, A); } - T.push(I), L.push(Y); + T.push(I), D.push(Y); } - function d(S, C, T, L) { - let E = [], P = 0, M = -1; + function d(S, C, T, D) { + let E = [], N = 0, P = -1; for (; o.pos > C; ) { - let { id: N, start: q, end: k, size: B } = o; + let { id: L, start: F, end: k, size: B } = o; if (B > 4) o.next(); else { - if (M > -1 && q < M) + if (P > -1 && F < P) break; - M < 0 && (M = k - i), E.push(N, q, k), P++, o.next(); + P < 0 && (P = k - i), E.push(L, F, k), N++, o.next(); } } - if (P) { - let N = new Uint16Array(P * 4), q = E[E.length - 2]; + if (N) { + let L = new Uint16Array(N * 4), F = E[E.length - 2]; for (let k = E.length - 3, B = 0; k >= 0; k -= 3) - N[B++] = E[k], N[B++] = E[k + 1] - q, N[B++] = E[k + 2] - q, N[B++] = B; - T.push(new fp(N, E[2] - q, n)), L.push(q - S); + L[B++] = E[k], L[B++] = E[k + 1] - F, L[B++] = E[k + 2] - F, L[B++] = B; + T.push(new op(L, E[2] - F, n)), D.push(F - S); } } function p(S, C) { - return (T, L, E) => { - let P = 0, M = T.length - 1, N, q; - if (M >= 0 && (N = T[M]) instanceof kn) { - if (!M && N.type == S && N.length == E) - return N; - (q = N.prop(Fr.lookAhead)) && (P = L[M] + N.length + q); - } - return m(S, T, L, E, P, C); + return (T, D, E) => { + let N = 0, P = T.length - 1, L, F; + if (P >= 0 && (L = T[P]) instanceof kn) { + if (!P && L.type == S && L.length == E) + return L; + (F = L.prop(Fr.lookAhead)) && (N = D[P] + L.length + F); + } + return m(S, T, D, E, N, C); }; } - function g(S, C, T, L, E, P, M, N, q) { + function g(S, C, T, D, E, N, P, L, F) { let k = [], B = []; - for (; S.length > L; ) + for (; S.length > D; ) k.push(S.pop()), B.push(C.pop() + T - E); - S.push(m(n.types[M], k, B, P - E, N - P, q)), C.push(E - T); + S.push(m(n.types[P], k, B, N - E, L - N, F)), C.push(E - T); } - function m(S, C, T, L, E, P, M) { - if (P) { - let N = [Fr.contextHash, P]; - M = M ? [N].concat(M) : [N]; + function m(S, C, T, D, E, N, P) { + if (N) { + let L = [Fr.contextHash, N]; + P = P ? [L].concat(P) : [L]; } if (E > 25) { - let N = [Fr.lookAhead, E]; - M = M ? [N].concat(M) : [N]; + let L = [Fr.lookAhead, E]; + P = P ? [L].concat(P) : [L]; } - return new kn(S, C, T, L, M); + return new kn(S, C, T, D, P); } function v(S, C) { - let T = o.fork(), L = 0, E = 0, P = 0, M = T.end - i, N = { size: 0, start: 0, skip: 0 }; + let T = o.fork(), D = 0, E = 0, N = 0, P = T.end - i, L = { size: 0, start: 0, skip: 0 }; e: - for (let q = T.pos - S; T.pos > q; ) { + for (let F = T.pos - S; T.pos > F; ) { let k = T.size; if (T.id == C && k >= 0) { - N.size = L, N.start = E, N.skip = P, P += 4, L += 4, T.next(); + L.size = D, L.start = E, L.skip = N, N += 4, D += 4, T.next(); continue; } let B = T.pos - k; - if (k < 0 || B < q || T.start < M) + if (k < 0 || B < F || T.start < P) break; - let A = T.id >= a ? 4 : 0, D = T.start; + let A = T.id >= a ? 4 : 0, M = T.start; for (T.next(); T.pos > B; ) { if (T.size < 0) if (T.size == -3) @@ -11519,22 +11519,22 @@ function k_e(t) { T.id >= a && (A += 4); T.next(); } - E = D, L += k, P += A; + E = M, D += k, N += A; } - return (C < 0 || L == S) && (N.size = L, N.start = E, N.skip = P), N.size > 4 ? N : void 0; + return (C < 0 || D == S) && (L.size = D, L.start = E, L.skip = N), L.size > 4 ? L : void 0; } function y(S, C, T) { - let { id: L, start: E, end: P, size: M } = o; - if (o.next(), M >= 0 && L < a) { - let N = T; - if (M > 4) { - let q = o.pos - (M - 4); - for (; o.pos > q; ) + let { id: D, start: E, end: N, size: P } = o; + if (o.next(), P >= 0 && D < a) { + let L = T; + if (P > 4) { + let F = o.pos - (P - 4); + for (; o.pos > F; ) T = y(S, C, T); } - C[--T] = N, C[--T] = P - S, C[--T] = E - S, C[--T] = L; + C[--T] = L, C[--T] = N - S, C[--T] = E - S, C[--T] = D; } else - M == -3 ? u = L : M == -4 && (h = L); + P == -3 ? u = D : P == -4 && (h = D); return T; } let b = [], w = []; @@ -11543,11 +11543,11 @@ function k_e(t) { let O = (e = t.length) !== null && e !== void 0 ? e : b.length ? w[0] + b[0].length : 0; return new kn(l[t.topID], b.reverse(), w.reverse(), O); } -const qW = /* @__PURE__ */ new WeakMap(); -function e5(t, e) { - if (!t.isAnonymous || e instanceof fp || e.type != t) +const _W = /* @__PURE__ */ new WeakMap(); +function K5(t, e) { + if (!t.isAnonymous || e instanceof op || e.type != t) return 1; - let r = qW.get(e); + let r = _W.get(e); if (r == null) { r = 1; for (let n of e.children) { @@ -11555,22 +11555,22 @@ function e5(t, e) { r = 1; break; } - r += e5(t, n); + r += K5(t, n); } - qW.set(e, r); + _W.set(e, r); } return r; } -function j$(t, e, r, n, i, s, a, o, l) { +function B$(t, e, r, n, i, s, a, o, l) { let u = 0; for (let g = n; g < i; g++) - u += e5(t, e[g]); + u += K5(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 = e5(t, g[w]); + let O = w, S = m[w], C = K5(t, g[w]); for (w++; w < y; w++) { - let T = e5(t, g[w]); + let T = K5(t, g[w]); if (C + T >= h) break; C += T; @@ -11584,14 +11584,14 @@ function j$(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(j$(t, g, m, O, w, S, T, null, l)); + f.push(B$(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 Rae { +class wae { constructor() { this.map = /* @__PURE__ */ new WeakMap(); } @@ -11604,10 +11604,10 @@ class Rae { return n && n.get(r); } set(e, r) { - e instanceof Xu ? this.setBuffer(e.context.buffer, e.index, r) : e instanceof za && this.map.set(e.tree, r); + e instanceof Yu ? this.setBuffer(e.context.buffer, e.index, r) : e instanceof Ba && this.map.set(e.tree, r); } get(e) { - return e instanceof Xu ? this.getBuffer(e.context.buffer, e.index) : e instanceof za ? this.map.get(e.tree) : void 0; + return e instanceof Yu ? this.getBuffer(e.context.buffer, e.index) : e instanceof Ba ? 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); @@ -11616,7 +11616,7 @@ class Rae { return e.buffer ? this.getBuffer(e.buffer.buffer, e.index) : this.map.get(e.tree); } } -class yf { +class vf { 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); } @@ -11627,7 +11627,7 @@ class yf { return (this.open & 2) > 0; } static addTree(e, r = [], n = !1) { - let i = [new yf(0, e.length, e, 0, !1, n)]; + let i = [new vf(0, e.length, e, 0, !1, n)]; for (let s of r) s.to > e.length && i.push(s); return i; @@ -11643,7 +11643,7 @@ class yf { 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 yf(p, g, d.tree, d.offset + u, o > 0, !!h); + d = p >= g ? null : new vf(p, g, d.tree, d.offset + u, o > 0, !!h); } if (d && i.push(d), a.to > f) break; @@ -11656,9 +11656,9 @@ class yf { return i; } } -class Z$ { +class F$ { startParse(e, r, n) { - return typeof e == "string" && (e = new S_e(e)), n = n ? n.length ? n.map((i) => new ec(i.from, i.to)) : [new ec(0, 0)] : [new ec(0, e.length)], this.createParse(e, r || [], n); + return typeof e == "string" && (e = new f_e(e)), n = n ? n.length ? n.map((i) => new Zl(i.from, i.to)) : [new Zl(0, 0)] : [new Zl(0, e.length)], this.createParse(e, r || [], n); } parse(e, r, n) { let i = this.startParse(e, r, n); @@ -11669,7 +11669,7 @@ class Z$ { } } } -class S_e { +class f_e { constructor(e) { this.string = e; } @@ -11686,25 +11686,25 @@ class S_e { return this.string.slice(e, r); } } -function Lae(t) { - return (e, r, n, i) => new C_e(e, t, r, n, i); +function Oae(t) { + return (e, r, n, i) => new p_e(e, t, r, n, i); } -class UW { +class AW { constructor(e, r, n, i, s) { this.parser = e, this.parse = r, this.overlay = n, this.target = i, this.from = s; } } -function QW(t) { +function RW(t) { if (!t.length || t.some((e) => e.from >= e.to)) throw new RangeError("Invalid inner parse ranges given: " + JSON.stringify(t)); } -class T_e { +class d_e { 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 h9 = new Fr({ perNode: !0 }); -class C_e { +const a9 = new Fr({ perNode: !0 }); +class p_e { 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; } @@ -11719,13 +11719,13 @@ class C_e { } if (this.innerDone == this.inner.length) { let n = this.baseTree; - return this.stoppedAt != null && (n = new kn(n.type, n.children, n.positions, n.length, n.propValues.concat([[h9, this.stoppedAt]]))), n; + return this.stoppedAt != null && (n = new kn(n.type, n.children, n.positions, n.length, n.propValues.concat([[a9, 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[Fr.mounted.id] = new Yx(r, e.overlay, e.parser), e.target.props = n; + n[Fr.mounted.id] = new Vx(r, e.overlay, e.parser), e.target.props = n; } return null; } @@ -11745,7 +11745,7 @@ class C_e { this.inner[r].parse.stopAt(e); } startInner() { - let e = new A_e(this.fragments), r = null, n = null, i = new mT(new za(this.baseTree, this.ranges[0].from, 0, null), Hn.IncludeAnonymous | Hn.IgnoreMounts); + let e = new v_e(this.fragments), r = null, n = null, i = new pT(new Ba(this.baseTree, this.ranges[0].from, 0, null), Hn.IncludeAnonymous | Hn.IgnoreMounts); e: for (let s, a; ; ) { let o = !0, l; @@ -11761,18 +11761,18 @@ class C_e { } } o = !1; - } else if (n && (a = E_e(n.ranges, i.from, i.to))) + } else if (n && (a = g_e(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 || __e(i); + i.tree || m_e(i); let u = e.findMounts(i.from, s.parser); if (typeof s.overlay == "function") - r = new T_e(s.parser, s.overlay, u, this.inner.length, i.from, i.tree, r); + r = new d_e(s.parser, s.overlay, u, this.inner.length, i.from, i.tree, r); else { - let h = YW(this.ranges, s.overlay || (i.from < i.to ? [new ec(i.from, i.to)] : [])); - h.length && QW(h), (h.length || !s.overlay) && this.inner.push(new UW(s.parser, h.length ? s.parser.startParse(this.input, GW(u, h), h) : s.parser.startParse(""), s.overlay ? s.overlay.map((f) => new ec(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 = DW(this.ranges, s.overlay || (i.from < i.to ? [new Zl(i.from, i.to)] : [])); + h.length && RW(h), (h.length || !s.overlay) && this.inner.push(new AW(s.parser, h.length ? s.parser.startParse(this.input, PW(u, h), h) : s.parser.startParse(""), s.overlay ? s.overlay.map((f) => new Zl(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 ec(i.from, i.to)), l.from < l.to)) { + } else if (r && (l = r.predicate(i)) && (l === !0 && (l = new Zl(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); } @@ -11783,15 +11783,15 @@ class C_e { if (!i.parent()) break e; if (r && !--r.depth) { - let u = YW(this.ranges, r.ranges); - u.length && (QW(u), this.inner.splice(r.index, 0, new UW(r.parser, r.parser.startParse(this.input, GW(r.mounts, u), u), r.ranges.map((h) => new ec(h.from - r.start, h.to - r.start)), r.target, u[0].from))), r = r.prev; + let u = DW(this.ranges, r.ranges); + u.length && (RW(u), this.inner.splice(r.index, 0, new AW(r.parser, r.parser.startParse(this.input, PW(r.mounts, u), u), r.ranges.map((h) => new Zl(h.from - r.start, h.to - r.start)), r.target, u[0].from))), r = r.prev; } n && !--n.depth && (n = n.prev); } } } } -function E_e(t, e, r) { +function g_e(t, e, r) { for (let n of t) { if (n.from >= r) break; @@ -11800,13 +11800,13 @@ function E_e(t, e, r) { } return 0; } -function VW(t, e, r, n, i, s) { +function LW(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 __e(t) { +function m_e(t) { let { node: e } = t, r = [], n = e.context.buffer; do r.push(t.index), t.parent(); @@ -11814,19 +11814,19 @@ function __e(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 = []; - VW(a, h, v, y, b, p); + LW(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), VW(a, o[v + 3], f, y, b, p), new kn(d, y, b, g); + return y.push(S), b.push(w - p), LW(a, o[v + 3], f, y, b, p), new kn(d, y, b, g); } - i.children[s] = u(0, o.length, xs.none, 0, a.length, r.length - 1); + i.children[s] = u(0, o.length, ys.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 za(f, d + t.from, h, t._tree)); + t.yield(new Ba(f, d + t.from, h, t._tree)); } } -class WW { +class MW { constructor(e, r) { this.offset = r, this.done = !1, this.cursor = e.cursor(Hn.IncludeAnonymous | Hn.IgnoreMounts); } @@ -11848,12 +11848,12 @@ class WW { return !1; } } -class A_e { +class v_e { 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(h9)) !== null && r !== void 0 ? r : n.to, this.inner = new WW(n.tree, -n.offset); + this.curTo = (r = n.tree.prop(a9)) !== null && r !== void 0 ? r : n.to, this.inner = new MW(n.tree, -n.offset); } else this.curFrag = this.inner = null; } @@ -11868,7 +11868,7 @@ class A_e { this.curFrag = this.inner = null; else { let r = this.curFrag = this.fragments[this.fragI]; - this.curTo = (e = r.tree.prop(h9)) !== null && e !== void 0 ? e : r.to, this.inner = new WW(r.tree, -r.offset); + this.curTo = (e = r.tree.prop(a9)) !== null && e !== void 0 ? e : r.to, this.inner = new MW(r.tree, -r.offset); } } findMounts(e, r) { @@ -11894,7 +11894,7 @@ class A_e { return i; } } -function YW(t, e) { +function DW(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; @@ -11902,18 +11902,18 @@ function YW(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 ec(l.from, a), l.to > o && r.splice(s + 1, 0, new ec(o, l.to))) : l.to > o ? r[s--] = new ec(o, l.to) : r.splice(s--, 1)); + l.to <= a || (r || (n = r = e.slice()), l.from < a ? (r[s] = new Zl(l.from, a), l.to > o && r.splice(s + 1, 0, new Zl(o, l.to))) : l.to > o ? r[s--] = new Zl(o, l.to) : r.splice(s--, 1)); } } return n; } -function R_e(t, e, r, n) { +function y_e(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 ec(d, p)); + d < p && u.push(new Zl(d, p)); } if (l = Math.min(h, f), l == 1e9) break; @@ -11921,75 +11921,75 @@ function R_e(t, e, r, n) { } return u; } -function GW(t, e) { +function PW(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 ec(d.from + n, d.to + n)), f = R_e(e, h, l, u); + let h = i.overlay.map((d) => new Zl(d.from + n, d.to + n)), f = y_e(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 yf(p, m, i.tree, -a, s.from >= p || s.openStart, s.to <= m || s.openEnd)), g) + if (m > p && r.push(new vf(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 yf(l, u, i.tree, -a, s.from >= a || s.openStart, s.to <= o || s.openEnd)); + r.push(new vf(l, u, i.tree, -a, s.from >= a || s.openStart, s.to <= o || s.openEnd)); } return r; } -let L_e = 0; -class Fc { +let b_e = 0; +class Ic { constructor(e, r, n) { - this.set = e, this.base = r, this.modified = n, this.id = L_e++; + this.set = e, this.base = r, this.modified = n, this.id = b_e++; } static define(e) { if (e != null && e.base) throw new Error("Can not derive from a modified tag"); - let r = new Fc([], null, []); + let r = new Ic([], null, []); if (r.set.push(r), e) for (let n of e.set) r.set.push(n); return r; } static defineModifier() { - let e = new vT(); - return (r) => r.modified.indexOf(e) > -1 ? r : vT.get(r.base || r, r.modified.concat(e).sort((n, i) => n.id - i.id)); + let e = new gT(); + return (r) => r.modified.indexOf(e) > -1 ? r : gT.get(r.base || r, r.modified.concat(e).sort((n, i) => n.id - i.id)); } } -let M_e = 0; -class vT { +let x_e = 0; +class gT { constructor() { - this.instances = [], this.id = M_e++; + this.instances = [], this.id = x_e++; } static get(e, r) { if (!r.length) return e; - let n = r[0].instances.find((o) => o.base == e && D_e(r, o.modified)); + let n = r[0].instances.find((o) => o.base == e && w_e(r, o.modified)); if (n) return n; - let i = [], s = new Fc(i, e, r); + let i = [], s = new Ic(i, e, r); for (let o of r) o.instances.push(s); - let a = P_e(r); + let a = O_e(r); for (let o of e.set) if (!o.modified.length) for (let l of a) - i.push(vT.get(o, l)); + i.push(gT.get(o, l)); return s; } } -function D_e(t, e) { +function w_e(t, e) { return t.length == e.length && t.every((r, n) => r == e[n]); } -function P_e(t) { +function O_e(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 Vp(t) { +function Bp(t) { let e = /* @__PURE__ */ Object.create(null); for (let r in t) { let n = t[r]; @@ -12019,14 +12019,14 @@ function Vp(t) { let l = s.length - 1, u = s[l]; if (!u) throw new RangeError("Invalid path: " + i); - let h = new yT(n, a, l > 0 ? s.slice(0, l) : null); + let h = new mT(n, a, l > 0 ? s.slice(0, l) : null); e[u] = h.sort(e[u]); } } - return Mae.add(e); + return kae.add(e); } -const Mae = new Fr(); -class yT { +const kae = new Fr(); +class mT { constructor(e, r, n, i) { this.tags = e, this.mode = r, this.context = n, this.next = i; } @@ -12043,8 +12043,8 @@ class yT { return this.context ? this.context.length : 0; } } -yT.empty = new yT([], 2, null); -function Dae(t, e) { +mT.empty = new mT([], 2, null); +function Sae(t, e) { let r = /* @__PURE__ */ Object.create(null); for (let s of t) if (!Array.isArray(s.tag)) @@ -12069,7 +12069,7 @@ function Dae(t, e) { scope: n }; } -function N_e(t, e) { +function k_e(t, e) { let r = null; for (let n of t) { let i = n.style(e); @@ -12077,11 +12077,11 @@ function N_e(t, e) { } return r; } -function I_e(t, e, r, n = 0, i = t.length) { - let s = new $_e(n, Array.isArray(e) ? e : [e], r); +function S_e(t, e, r, n = 0, i = t.length) { + let s = new T_e(n, Array.isArray(e) ? e : [e], r); s.highlightRange(t.cursor(), n, i, "", s.highlighters), s.flush(i); } -class $_e { +class T_e { constructor(e, r, n) { this.at = e, this.highlighters = r, this.span = n, this.class = ""; } @@ -12096,7 +12096,7 @@ class $_e { if (o >= n || l <= r) return; a.isTop && (s = this.highlighters.filter((p) => !p.scope || p.scope(a))); - let u = i, h = B_e(e) || yT.empty, f = N_e(s, h.tags); + let u = i, h = C_e(e) || mT.empty, f = k_e(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(Fr.mounted); @@ -12125,99 +12125,99 @@ class $_e { } } } -function B_e(t) { - let e = t.type.prop(Mae); +function C_e(t) { + let e = t.type.prop(kae); for (; e && e.context && !t.matchContext(e.context); ) e = e.next; return e || null; } -const Zt = Fc.define, oS = Zt(), wd = Zt(), HW = Zt(wd), XW = Zt(wd), Od = Zt(), lS = Zt(Od), a8 = Zt(Od), Lu = Zt(), i0 = Zt(Lu), Cu = Zt(), Eu = Zt(), f9 = Zt(), q2 = Zt(f9), cS = Zt(), ze = { - comment: oS, - lineComment: Zt(oS), - blockComment: Zt(oS), - docComment: Zt(oS), - name: wd, - variableName: Zt(wd), - typeName: HW, - tagName: Zt(HW), - propertyName: XW, - attributeName: Zt(XW), - className: Zt(wd), - labelName: Zt(wd), - namespace: Zt(wd), - macroName: Zt(wd), - literal: Od, - string: lS, - docString: Zt(lS), - character: Zt(lS), - attributeValue: Zt(lS), - number: a8, - integer: Zt(a8), - float: Zt(a8), - bool: Zt(Od), - regexp: Zt(Od), - escape: Zt(Od), - color: Zt(Od), - url: Zt(Od), - keyword: Cu, - self: Zt(Cu), - null: Zt(Cu), - atom: Zt(Cu), - unit: Zt(Cu), - modifier: Zt(Cu), - operatorKeyword: Zt(Cu), - controlKeyword: Zt(Cu), - definitionKeyword: Zt(Cu), - moduleKeyword: Zt(Cu), - operator: Eu, - derefOperator: Zt(Eu), - arithmeticOperator: Zt(Eu), - logicOperator: Zt(Eu), - bitwiseOperator: Zt(Eu), - compareOperator: Zt(Eu), - updateOperator: Zt(Eu), - definitionOperator: Zt(Eu), - typeOperator: Zt(Eu), - controlOperator: Zt(Eu), - punctuation: f9, - separator: Zt(f9), - bracket: q2, - angleBracket: Zt(q2), - squareBracket: Zt(q2), - paren: Zt(q2), - brace: Zt(q2), - content: Lu, - heading: i0, - heading1: Zt(i0), - heading2: Zt(i0), - heading3: Zt(i0), - heading4: Zt(i0), - heading5: Zt(i0), - heading6: Zt(i0), - contentSeparator: Zt(Lu), - list: Zt(Lu), - quote: Zt(Lu), - emphasis: Zt(Lu), - strong: Zt(Lu), - link: Zt(Lu), - monospace: Zt(Lu), - strikethrough: Zt(Lu), +const Zt = Ic.define, iS = Zt(), yd = Zt(), NW = Zt(yd), IW = Zt(yd), bd = Zt(), sS = Zt(bd), e8 = Zt(bd), _u = Zt(), Kp = Zt(_u), ku = Zt(), Su = Zt(), o9 = Zt(), $2 = Zt(o9), aS = Zt(), ze = { + comment: iS, + lineComment: Zt(iS), + blockComment: Zt(iS), + docComment: Zt(iS), + name: yd, + variableName: Zt(yd), + typeName: NW, + tagName: Zt(NW), + propertyName: IW, + attributeName: Zt(IW), + className: Zt(yd), + labelName: Zt(yd), + namespace: Zt(yd), + macroName: Zt(yd), + literal: bd, + string: sS, + docString: Zt(sS), + character: Zt(sS), + attributeValue: Zt(sS), + number: e8, + integer: Zt(e8), + float: Zt(e8), + bool: Zt(bd), + regexp: Zt(bd), + escape: Zt(bd), + color: Zt(bd), + url: Zt(bd), + keyword: ku, + self: Zt(ku), + null: Zt(ku), + atom: Zt(ku), + unit: Zt(ku), + modifier: Zt(ku), + operatorKeyword: Zt(ku), + controlKeyword: Zt(ku), + definitionKeyword: Zt(ku), + moduleKeyword: Zt(ku), + operator: Su, + derefOperator: Zt(Su), + arithmeticOperator: Zt(Su), + logicOperator: Zt(Su), + bitwiseOperator: Zt(Su), + compareOperator: Zt(Su), + updateOperator: Zt(Su), + definitionOperator: Zt(Su), + typeOperator: Zt(Su), + controlOperator: Zt(Su), + punctuation: o9, + separator: Zt(o9), + bracket: $2, + angleBracket: Zt($2), + squareBracket: Zt($2), + paren: Zt($2), + brace: Zt($2), + content: _u, + heading: Kp, + heading1: Zt(Kp), + heading2: Zt(Kp), + heading3: Zt(Kp), + heading4: Zt(Kp), + heading5: Zt(Kp), + heading6: Zt(Kp), + contentSeparator: Zt(_u), + list: Zt(_u), + quote: Zt(_u), + emphasis: Zt(_u), + strong: Zt(_u), + link: Zt(_u), + monospace: Zt(_u), + strikethrough: Zt(_u), inserted: Zt(), deleted: Zt(), changed: Zt(), invalid: Zt(), - meta: cS, - documentMeta: Zt(cS), - annotation: Zt(cS), - processingInstruction: Zt(cS), - definition: Fc.defineModifier(), - constant: Fc.defineModifier(), - function: Fc.defineModifier(), - standard: Fc.defineModifier(), - local: Fc.defineModifier(), - special: Fc.defineModifier() -}; -Dae([ + meta: aS, + documentMeta: Zt(aS), + annotation: Zt(aS), + processingInstruction: Zt(aS), + definition: Ic.defineModifier(), + constant: Ic.defineModifier(), + function: Ic.defineModifier(), + standard: Ic.defineModifier(), + local: Ic.defineModifier(), + special: Ic.defineModifier() +}; +Sae([ { tag: ze.link, class: "tok-link" }, { tag: ze.heading, class: "tok-heading" }, { tag: ze.emphasis, class: "tok-emphasis" }, @@ -12249,25 +12249,25 @@ Dae([ { tag: ze.invalid, class: "tok-invalid" }, { tag: ze.punctuation, class: "tok-punctuation" } ]); -var o8; -const q0 = /* @__PURE__ */ new Fr(); -function K$(t) { +var t8; +const $0 = /* @__PURE__ */ new Fr(); +function z$(t) { return Gt.define({ combine: t ? (e) => e.concat(t) : void 0 }); } -const J$ = /* @__PURE__ */ new Fr(); -class bl { +const q$ = /* @__PURE__ */ new Fr(); +class ml { constructor(e, r, n = [], i = "") { this.data = e, this.name = i, qr.prototype.hasOwnProperty("tree") || Object.defineProperty(qr.prototype, "tree", { get() { return Qn(this); } }), this.parser = r, this.extension = [ - pp.of(this), + cp.of(this), qr.languageData.of((s, a, o) => { - let l = jW(s, a, o), u = l.type.prop(q0); + let l = $W(s, a, o), u = l.type.prop($0); if (!u) return []; - let h = s.facet(u), f = l.type.prop(J$); + let h = s.facet(u), f = l.type.prop(q$); if (f) { let d = l.resolve(a - l.from, o); for (let p of f) @@ -12281,22 +12281,22 @@ class bl { ].concat(n); } isActiveAt(e, r, n = -1) { - return jW(e, r, n).type.prop(q0) == this.data; + return $W(e, r, n).type.prop($0) == this.data; } findRegions(e) { - let r = e.facet(pp); + let r = e.facet(cp); 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(q0) == this.data) { + if (s.prop($0) == this.data) { n.push({ from: a, to: a + s.length }); return; } let o = s.prop(Fr.mounted); if (o) { - if (o.tree.prop(q0) == this.data) { + if (o.tree.prop($0) == this.data) { if (o.overlay) for (let l of o.overlay) n.push({ from: l.from + a, to: l.to + a }); @@ -12320,38 +12320,38 @@ class bl { return !0; } } -bl.setState = /* @__PURE__ */ _r.define(); -function jW(t, e, r) { - let n = t.facet(pp), i = Qn(t).topNode; +ml.setState = /* @__PURE__ */ _r.define(); +function $W(t, e, r) { + let n = t.facet(cp), i = Qn(t).topNode; if (!n || n.allowsNesting) for (let s = i; s; s = s.enter(e, r, Hn.ExcludeBuffers)) s.type.isTop && (i = s); return i; } -class dp extends bl { +class lp extends ml { constructor(e, r, n) { super(e, r, [], n), this.parser = r; } static define(e) { - let r = K$(e.languageData); - return new dp(r, e.parser.configure({ - props: [q0.add((n) => n.isTop ? r : void 0)] + let r = z$(e.languageData); + return new lp(r, e.parser.configure({ + props: [$0.add((n) => n.isTop ? r : void 0)] }), e.name); } configure(e, r) { - return new dp(this.data, this.parser.configure(e), r || this.name); + return new lp(this.data, this.parser.configure(e), r || this.name); } get allowsNesting() { return this.parser.hasWrappers(); } } function Qn(t) { - let e = t.field(bl.state, !1); + let e = t.field(ml.state, !1); return e ? e.tree : kn.empty; } -function eB(t, e, r = 50) { +function U$(t, e, r = 50) { var n; - let i = (n = t.field(bl.state, !1)) === null || n === void 0 ? void 0 : n.context; + let i = (n = t.field(ml.state, !1)) === null || n === void 0 ? void 0 : n.context; if (!i) return null; let s = i.viewport; @@ -12359,7 +12359,7 @@ function eB(t, e, r = 50) { let a = i.isDone(e) || i.work(r, e) ? i.tree : null; return i.updateViewport(s), a; } -class F_e { +class E_e { constructor(e) { this.doc = e, this.cursorPos = 0, this.string = "", this.cursor = e.iter(); } @@ -12380,16 +12380,16 @@ class F_e { return e < n || r >= this.cursorPos ? this.doc.sliceString(e, r) : this.string.slice(e - n, r - n); } } -let U2 = null; -class Hx { +let B2 = null; +class Yx { 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 Hx(e, r, [], kn.empty, 0, n, [], null); + return new Yx(e, r, [], kn.empty, 0, n, [], null); } startParse() { - return this.parser.startParse(new F_e(this.state.doc), this.fragments); + return this.parser.startParse(new E_e(this.state.doc), this.fragments); } work(e, r) { return r != null && r >= this.state.doc.length && (r = void 0), this.tree != kn.empty && this.isDone(r != null ? r : this.state.doc.length) ? (this.takeTree(), !0) : this.withContext(() => { @@ -12401,7 +12401,7 @@ class Hx { 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(yf.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(vf.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; @@ -12415,27 +12415,27 @@ class Hx { 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(yf.addTree(this.tree, this.fragments, !0)), this.parse = null); + }), this.treeLen = e, this.tree = r, this.fragments = this.withoutTempSkipped(vf.addTree(this.tree, this.fragments, !0)), this.parse = null); } withContext(e) { - let r = U2; - U2 = this; + let r = B2; + B2 = this; try { return e(); } finally { - U2 = r; + B2 = r; } } withoutTempSkipped(e) { for (let r; r = this.tempSkipped.pop(); ) - e = ZW(e, r.from, r.to); + e = BW(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 = yf.applyChanges(n, l), i = kn.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 = vf.applyChanges(n, l), i = kn.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); @@ -12443,7 +12443,7 @@ class Hx { } } } - return new Hx(this.parser, r, n, i, s, a, o, this.scheduleOn); + return new Yx(this.parser, r, n, i, s, a, o, this.scheduleOn); } updateViewport(e) { if (this.viewport.from == e.from && this.viewport.to == e.to) @@ -12452,7 +12452,7 @@ class Hx { 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 = ZW(this.fragments, i, s), this.skipped.splice(n--, 1)); + i < e.to && s > e.from && (this.fragments = BW(this.fragments, i, s), this.skipped.splice(n--, 1)); } return this.skipped.length >= r ? !1 : (this.reset(), !0); } @@ -12463,19 +12463,19 @@ class Hx { this.skipped.push({ from: e, to: r }); } static getSkippingParser(e) { - return new class extends Z$ { + return new class extends F$ { createParse(r, n, i) { let s = i[0].from, a = i[i.length - 1].to; return { parsedPos: s, advance() { - let l = U2; + let l = B2; 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 kn(xs.none, [], [], a - s); + return this.parsedPos = a, new kn(ys.none, [], [], a - s); }, stoppedAt: null, stopAt() { @@ -12490,13 +12490,13 @@ class Hx { return this.treeLen >= e && r.length && r[0].from == 0 && r[0].to >= e; } static get() { - return U2; + return B2; } } -function ZW(t, e, r) { - return yf.applyChanges(t, [{ fromA: e, toA: r, fromB: e, toB: r }]); +function BW(t, e, r) { + return vf.applyChanges(t, [{ fromA: e, toA: r, fromB: e, toB: r }]); } -class bv { +class gv { constructor(e) { this.context = e, this.tree = e.tree; } @@ -12504,59 +12504,59 @@ class bv { 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 bv(r); + return r.work(20, n) || r.takeTree(), new gv(r); } static init(e) { - let r = Math.min(3e3, e.doc.length), n = Hx.create(e.facet(pp).parser, e, { from: 0, to: r }); - return n.work(20, r) || n.takeTree(), new bv(n); + let r = Math.min(3e3, e.doc.length), n = Yx.create(e.facet(cp).parser, e, { from: 0, to: r }); + return n.work(20, r) || n.takeTree(), new gv(n); } } -bl.state = /* @__PURE__ */ ai.define({ - create: bv.init, +ml.state = /* @__PURE__ */ ai.define({ + create: gv.init, update(t, e) { for (let r of e.effects) - if (r.is(bl.setState)) + if (r.is(ml.setState)) return r.value; - return e.startState.facet(pp) != e.state.facet(pp) ? bv.init(e.state) : t.apply(e); + return e.startState.facet(cp) != e.state.facet(cp) ? gv.init(e.state) : t.apply(e); } }); -let Pae = (t) => { +let Tae = (t) => { let e = setTimeout(() => t(), 500); return () => clearTimeout(e); }; -typeof requestIdleCallback < "u" && (Pae = (t) => { +typeof requestIdleCallback < "u" && (Tae = (t) => { let e = -1, r = setTimeout(() => { e = requestIdleCallback(t, { timeout: 500 - 100 }); }, 100); return () => e < 0 ? clearTimeout(r) : cancelIdleCallback(e); }); -const l8 = typeof navigator < "u" && ((o8 = navigator.scheduling) === null || o8 === void 0 ? void 0 : o8.isInputPending) ? () => navigator.scheduling.isInputPending() : null, z_e = /* @__PURE__ */ fn.fromClass(class { +const r8 = typeof navigator < "u" && ((t8 = navigator.scheduling) === null || t8 === void 0 ? void 0 : t8.isInputPending) ? () => navigator.scheduling.isInputPending() : null, __e = /* @__PURE__ */ fn.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(bl.state).context; + let r = this.view.state.field(ml.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(bl.state); - (r.tree != r.context.tree || !r.context.isDone(e.doc.length)) && (this.working = Pae(this.work)); + let { state: e } = this.view, r = e.field(ml.state); + (r.tree != r.context.tree || !r.context.isDone(e.doc.length)) && (this.working = Tae(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(bl.state); + let { state: n, viewport: { to: i } } = this.view, s = n.field(ml.state); if (s.tree == s.context.tree && s.context.isDone(i + 1e5)) return; - let a = Date.now() + Math.min(this.chunkBudget, 100, e && !l8 ? Math.max(25, e.timeRemaining() - 5) : 1e9), o = s.context.treeLen < i && n.doc.length > i + 1e3, l = s.context.work(() => l8 && l8() || Date.now() > a, i + (o ? 0 : 1e5)); - this.chunkBudget -= Date.now() - r, (l || this.chunkBudget <= 0) && (s.context.takeTree(), this.view.dispatch({ effects: bl.setState.of(new bv(s.context)) })), this.chunkBudget > 0 && !(l && !o) && this.scheduleWork(), this.checkAsyncSchedule(s.context); + let a = Date.now() + Math.min(this.chunkBudget, 100, e && !r8 ? Math.max(25, e.timeRemaining() - 5) : 1e9), o = s.context.treeLen < i && n.doc.length > i + 1e3, l = s.context.work(() => r8 && r8() || Date.now() > a, i + (o ? 0 : 1e5)); + this.chunkBudget -= Date.now() - r, (l || this.chunkBudget <= 0) && (s.context.takeTree(), this.view.dispatch({ effects: ml.setState.of(new gv(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) => Ho(this.view.state, r)).then(() => this.workScheduled--), e.scheduleOn = null); + e.scheduleOn && (this.workScheduled++, e.scheduleOn.then(() => this.scheduleWork()).catch((r) => Wo(this.view.state, r)).then(() => this.workScheduled--), e.scheduleOn = null); } destroy() { this.working && this.working(); @@ -12568,25 +12568,25 @@ const l8 = typeof navigator < "u" && ((o8 = navigator.scheduling) === null || o8 eventHandlers: { focus() { this.scheduleWork(); } } -}), pp = /* @__PURE__ */ Gt.define({ +}), cp = /* @__PURE__ */ Gt.define({ combine(t) { return t.length ? t[0] : null; }, enables: (t) => [ - bl.state, - z_e, + ml.state, + __e, Mt.contentAttributes.compute([t], (e) => { let r = e.facet(t); return r && r.name ? { "data-language": r.name } : {}; }) ] }); -class xv { +class mv { constructor(e, r = []) { this.language = e, this.support = r, this.extension = [e, r]; } } -class bT { +class vT { 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; } @@ -12602,7 +12602,7 @@ class bT { throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of"); r = () => Promise.resolve(n); } - return new bT(e.name, (e.alias || []).concat(e.name).map((i) => i.toLowerCase()), e.extensions || [], e.filename, r, n); + return new vT(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) @@ -12631,7 +12631,7 @@ class bT { return null; } } -const q_e = /* @__PURE__ */ Gt.define(), bg = /* @__PURE__ */ Gt.define({ +const A_e = /* @__PURE__ */ Gt.define(), gg = /* @__PURE__ */ Gt.define({ combine: (t) => { if (!t.length) return " "; @@ -12641,12 +12641,12 @@ const q_e = /* @__PURE__ */ Gt.define(), bg = /* @__PURE__ */ Gt.define({ return e; } }); -function xT(t) { - let e = t.facet(bg); +function yT(t) { + let e = t.facet(gg); return e.charCodeAt(0) == 9 ? t.tabSize * e.length : e.length; } -function Xx(t, e) { - let r = "", n = t.tabSize, i = t.facet(bg)[0]; +function Gx(t, e) { + let r = "", n = t.tabSize, i = t.facet(gg)[0]; if (i == " ") { for (; e >= n; ) r += " ", e -= n; @@ -12656,19 +12656,19 @@ function Xx(t, e) { r += i; return r; } -function tB(t, e) { - t instanceof qr && (t = new K_(t)); - for (let n of t.state.facet(q_e)) { +function Q$(t, e) { + t instanceof qr && (t = new H_(t)); + for (let n of t.state.facet(A_e)) { let i = n(t, e); if (i !== void 0) return i; } let r = Qn(t.state); - return r.length >= e ? U_e(t, r, e) : null; + return r.length >= e ? R_e(t, r, e) : null; } -class K_ { +class H_ { constructor(e, r = {}) { - this.state = e, this.options = r, this.unit = xT(e); + this.state = e, this.options = r, this.unit = yT(e); } lineAt(e, r = 1) { let n = this.state.doc.lineAt(e), { simulateBreak: i, simulateDoubleBreak: s } = this.options; @@ -12685,7 +12685,7 @@ class K_ { return a > -1 && (s += a - this.countColumn(n, n.search(/\S|$/))), s; } countColumn(e, r = e.length) { - return ou(e, this.state.tabSize, r); + return iu(e, this.state.tabSize, r); } lineIndent(e, r = 1) { let { text: n, from: i } = this.lineAt(e, r), s = this.options.overrideIndentation; @@ -12700,8 +12700,8 @@ class K_ { return this.options.simulateBreak || null; } } -const $y = /* @__PURE__ */ new Fr(); -function U_e(t, e, r) { +const My = /* @__PURE__ */ new Fr(); +function R_e(t, e, r) { let n = e.resolveStack(r), i = e.resolveInner(r, -1).resolve(r, 0).enterUnfinishedNodesBefore(r); if (i != n.node) { let s = []; @@ -12710,34 +12710,34 @@ function U_e(t, e, r) { for (let a = s.length - 1; a >= 0; a--) n = { node: s[a], next: n }; } - return Nae(n, t, r); + return Cae(n, t, r); } -function Nae(t, e, r) { +function Cae(t, e, r) { for (let n = t; n; n = n.next) { - let i = V_e(n.node); + let i = M_e(n.node); if (i) - return i(rB.create(e, r, n)); + return i(V$.create(e, r, n)); } return 0; } -function Q_e(t) { +function L_e(t) { return t.pos == t.options.simulateBreak && t.options.simulateDoubleBreak; } -function V_e(t) { - let e = t.type.prop($y); +function M_e(t) { + let e = t.type.prop(My); if (e) return e; let r = t.firstChild, n; if (r && (n = r.type.prop(Fr.closedBy))) { let i = t.lastChild, s = i && n.indexOf(i.name) > -1; - return (a) => Iae(a, !0, 1, void 0, s && !Q_e(a) ? i.from : void 0); + return (a) => Eae(a, !0, 1, void 0, s && !L_e(a) ? i.from : void 0); } - return t.parent == null ? W_e : null; + return t.parent == null ? D_e : null; } -function W_e() { +function D_e() { return 0; } -class rB extends K_ { +class V$ extends H_ { constructor(e, r, n) { super(e.state, e.options), this.base = e, this.pos = r, this.context = n; } @@ -12745,7 +12745,7 @@ class rB extends K_ { return this.context.node; } static create(e, r, n) { - return new rB(e, r, n); + return new V$(e, r, n); } get textAfter() { return this.textAfterPos(this.pos); @@ -12759,23 +12759,23 @@ class rB extends K_ { let n = e.resolve(r.from); for (; n.parent && n.parent.from == n.from; ) n = n.parent; - if (Y_e(n, e)) + if (P_e(n, e)) break; r = this.state.doc.lineAt(n.from); } return this.lineIndent(r.from); } continue() { - return Nae(this.context.next, this.base, this.pos); + return Cae(this.context.next, this.base, this.pos); } } -function Y_e(t, e) { +function P_e(t, e) { for (let r = e; r; r = r.parent) if (t == r) return !0; return !1; } -function G_e(t) { +function N_e(t) { let e = t.node, r = e.childAfter(e.from), n = e.lastChild; if (!r) return null; @@ -12793,22 +12793,22 @@ function G_e(t) { o = l.to; } } -function d9({ closing: t, align: e = !0, units: r = 1 }) { - return (n) => Iae(n, e, r, t); +function l9({ closing: t, align: e = !0, units: r = 1 }) { + return (n) => Eae(n, e, r, t); } -function Iae(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 ? G_e(t) : null; +function Eae(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 ? N_e(t) : null; return l ? o ? t.column(l.from) : t.column(l.to) : t.baseIndent + (o ? 0 : t.unit * r); } -const H_e = (t) => t.baseIndent; -function t5({ except: t, units: e = 1 } = {}) { +const I_e = (t) => t.baseIndent; +function J5({ except: t, units: e = 1 } = {}) { return (r) => { let n = t && t.test(r.textAfter); return r.baseIndent + (n ? 0 : e * r.unit); }; } -const X_e = 200; -function j_e() { +const $_e = 200; +function B_e() { return qr.transactionFilter.of((t) => { if (!t.docChanged || !t.isUserEvent("input.type") && !t.isUserEvent("input.complete")) return t; @@ -12816,7 +12816,7 @@ function j_e() { if (!e.length) return t; let r = t.newDoc, { head: n } = t.newSelection.main, i = r.lineAt(n); - if (n > i.from + X_e) + if (n > i.from + $_e) return t; let s = r.sliceString(i.from, n); if (!e.some((u) => u.test(s))) @@ -12827,21 +12827,21 @@ function j_e() { if (h.from == o) continue; o = h.from; - let f = tB(a, h.from); + let f = Q$(a, h.from); if (f == null) continue; - let d = /^\s*/.exec(h.text)[0], p = Xx(a, f); + let d = /^\s*/.exec(h.text)[0], p = Gx(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 $ae = /* @__PURE__ */ Gt.define(), sm = /* @__PURE__ */ new Fr(); -function nB(t) { +const _ae = /* @__PURE__ */ Gt.define(), tm = /* @__PURE__ */ new Fr(); +function W$(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 Z_e(t, e, r) { +function F_e(t, e, r) { let n = Qn(t); if (n.length < r) return null; @@ -12852,49 +12852,49 @@ function Z_e(t, e, r) { continue; if (s && o.from < e) break; - let l = o.type.prop(sm); - if (l && (o.to < n.length - 50 || n.length == t.doc.length || !K_e(o))) { + let l = o.type.prop(tm); + if (l && (o.to < n.length - 50 || n.length == t.doc.length || !z_e(o))) { let u = l(o, t); u && u.from <= r && u.from >= e && u.to > r && (s = u); } } return s; } -function K_e(t) { +function z_e(t) { let e = t.lastChild; return e && e.to == t.to && e.type.isError; } -function jx(t, e, r) { - for (let n of t.facet($ae)) { +function Hx(t, e, r) { + for (let n of t.facet(_ae)) { let i = n(t, e, r); if (i) return i; } - return Z_e(t, e, r); + return F_e(t, e, r); } -function Bae(t, e) { +function Aae(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 Af = /* @__PURE__ */ _r.define({ map: Bae }), am = /* @__PURE__ */ _r.define({ map: Bae }); -function Fae(t) { +const Ef = /* @__PURE__ */ _r.define({ map: Aae }), rm = /* @__PURE__ */ _r.define({ map: Aae }); +function Rae(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 gp = /* @__PURE__ */ ai.define({ +const up = /* @__PURE__ */ ai.define({ create() { return Ht.none; }, update(t, e) { t = t.map(e.changes); for (let r of e.effects) - if (r.is(Af) && !e6e(t, r.value.from, r.value.to)) { - let { preparePlaceholder: n } = e.state.facet(iB), i = n ? Ht.replace({ widget: new a6e(n(e.state, r.value)) }) : KW; + if (r.is(Ef) && !U_e(t, r.value.from, r.value.to)) { + let { preparePlaceholder: n } = e.state.facet(Y$), i = n ? Ht.replace({ widget: new H_e(n(e.state, r.value)) }) : FW; t = t.update({ add: [i.range(r.value.from, r.value.to)] }); } else - r.is(am) && (t = t.update({ + r.is(rm) && (t = t.update({ filter: (n, i) => r.value.from != n || r.value.to != i, filterFrom: r.value.from, filterTo: r.value.to @@ -12926,100 +12926,100 @@ const gp = /* @__PURE__ */ ai.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(KW.range(n, i)); + e.push(FW.range(n, i)); } return Ht.set(e, !0); } }); -function J_e(t) { - return t.field(gp, !1) || jr.empty; +function q_e(t) { + return t.field(up, !1) || jr.empty; } -function wT(t, e, r) { +function bT(t, e, r) { var n; let i = null; - return (n = t.field(gp, !1)) === null || n === void 0 || n.between(e, r, (s, a) => { + return (n = t.field(up, !1)) === null || n === void 0 || n.between(e, r, (s, a) => { (!i || i.from > s) && (i = { from: s, to: a }); }), i; } -function e6e(t, e, r) { +function U_e(t, e, r) { let n = !1; return t.between(e, e, (i, s) => { i == e && s == r && (n = !0); }), n; } -function zae(t, e) { - return t.field(gp, !1) ? e : e.concat(_r.appendConfig.of(Qae())); +function Lae(t, e) { + return t.field(up, !1) ? e : e.concat(_r.appendConfig.of(Pae())); } -const qae = (t) => { - for (let e of Fae(t)) { - let r = jx(t.state, e.from, e.to); +const Mae = (t) => { + for (let e of Rae(t)) { + let r = Hx(t.state, e.from, e.to); if (r) - return t.dispatch({ effects: zae(t.state, [Af.of(r), Uae(t, r)]) }), !0; + return t.dispatch({ effects: Lae(t.state, [Ef.of(r), Dae(t, r)]) }), !0; } return !1; -}, t6e = (t) => { - if (!t.state.field(gp, !1)) +}, Q_e = (t) => { + if (!t.state.field(up, !1)) return !1; let e = []; - for (let r of Fae(t)) { - let n = wT(t.state, r.from, r.to); - n && e.push(am.of(n), Uae(t, n, !1)); + for (let r of Rae(t)) { + let n = bT(t.state, r.from, r.to); + n && e.push(rm.of(n), Dae(t, n, !1)); } return e.length && t.dispatch({ effects: e }), e.length > 0; }; -function Uae(t, e, r = !0) { +function Dae(t, e, r = !0) { let n = t.state.doc.lineAt(e.from).number, i = t.state.doc.lineAt(e.to).number; return Mt.announce.of(`${t.state.phrase(r ? "Folded lines" : "Unfolded lines")} ${n} ${t.state.phrase("to")} ${i}.`); } -const r6e = (t) => { +const V_e = (t) => { let { state: e } = t, r = []; for (let n = 0; n < e.doc.length; ) { - let i = t.lineBlockAt(n), s = jx(e, i.from, i.to); - s && r.push(Af.of(s)), n = (s ? t.lineBlockAt(s.to) : i).to + 1; + let i = t.lineBlockAt(n), s = Hx(e, i.from, i.to); + s && r.push(Ef.of(s)), n = (s ? t.lineBlockAt(s.to) : i).to + 1; } - return r.length && t.dispatch({ effects: zae(t.state, r) }), !!r.length; -}, n6e = (t) => { - let e = t.state.field(gp, !1); + return r.length && t.dispatch({ effects: Lae(t.state, r) }), !!r.length; +}, W_e = (t) => { + let e = t.state.field(up, !1); if (!e || !e.size) return !1; let r = []; return e.between(0, t.state.doc.length, (n, i) => { - r.push(am.of({ from: n, to: i })); + r.push(rm.of({ from: n, to: i })); }), t.dispatch({ effects: r }), !0; -}, i6e = [ - { key: "Ctrl-Shift-[", mac: "Cmd-Alt-[", run: qae }, - { key: "Ctrl-Shift-]", mac: "Cmd-Alt-]", run: t6e }, - { key: "Ctrl-Alt-[", run: r6e }, - { key: "Ctrl-Alt-]", run: n6e } -], s6e = { +}, Y_e = [ + { key: "Ctrl-Shift-[", mac: "Cmd-Alt-[", run: Mae }, + { key: "Ctrl-Shift-]", mac: "Cmd-Alt-]", run: Q_e }, + { key: "Ctrl-Alt-[", run: V_e }, + { key: "Ctrl-Alt-]", run: W_e } +], G_e = { placeholderDOM: null, preparePlaceholder: null, placeholderText: "\u2026" -}, iB = /* @__PURE__ */ Gt.define({ +}, Y$ = /* @__PURE__ */ Gt.define({ combine(t) { - return Ah(t, s6e); + return Th(t, G_e); } }); -function Qae(t) { - let e = [gp, c6e]; - return t && e.push(iB.of(t)), e; -} -function Vae(t, e) { - let { state: r } = t, n = r.facet(iB), i = (a) => { - let o = t.lineBlockAt(t.posAtDOM(a.target)), l = wT(t.state, o.from, o.to); - l && t.dispatch({ effects: am.of(l) }), a.preventDefault(); +function Pae(t) { + let e = [up, Z_e]; + return t && e.push(Y$.of(t)), e; +} +function Nae(t, e) { + let { state: r } = t, n = r.facet(Y$), i = (a) => { + let o = t.lineBlockAt(t.posAtDOM(a.target)), l = bT(t.state, o.from, o.to); + l && t.dispatch({ effects: rm.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 KW = /* @__PURE__ */ Ht.replace({ widget: /* @__PURE__ */ new class extends nl { +const FW = /* @__PURE__ */ Ht.replace({ widget: /* @__PURE__ */ new class extends el { toDOM(t) { - return Vae(t, null); + return Nae(t, null); } }() }); -class a6e extends nl { +class H_e extends el { constructor(e) { super(), this.value = e; } @@ -13027,17 +13027,17 @@ class a6e extends nl { return this.value == e.value; } toDOM(e) { - return Vae(e, this.value); + return Nae(e, this.value); } } -const o6e = { +const X_e = { openText: "\u2304", closedText: "\u203A", markerDOM: null, domEventHandlers: {}, foldingChanged: () => !1 }; -class c8 extends pc { +class n8 extends hc { constructor(e, r) { super(), this.config = e, this.open = r; } @@ -13051,18 +13051,18 @@ class c8 extends pc { return r.textContent = this.open ? this.config.openText : this.config.closedText, r.title = e.state.phrase(this.open ? "Fold line" : "Unfold line"), r; } } -function l6e(t = {}) { - let e = Object.assign(Object.assign({}, o6e), t), r = new c8(e, !0), n = new c8(e, !1), i = fn.fromClass(class { +function j_e(t = {}) { + let e = Object.assign(Object.assign({}, X_e), t), r = new n8(e, !0), n = new n8(e, !1), i = fn.fromClass(class { constructor(a) { this.from = a.viewport.from, this.markers = this.buildMarkers(a); } update(a) { - (a.docChanged || a.viewportChanged || a.startState.facet(pp) != a.state.facet(pp) || a.startState.field(gp, !1) != a.state.field(gp, !1) || Qn(a.startState) != Qn(a.state) || e.foldingChanged(a)) && (this.markers = this.buildMarkers(a.view)); + (a.docChanged || a.viewportChanged || a.startState.facet(cp) != a.state.facet(cp) || a.startState.field(up, !1) != a.state.field(up, !1) || Qn(a.startState) != Qn(a.state) || e.foldingChanged(a)) && (this.markers = this.buildMarkers(a.view)); } buildMarkers(a) { - let o = new is(); + let o = new rs(); for (let l of a.viewportLineBlocks) { - let u = wT(a.state, l.from, l.to) ? n : jx(a.state, l.from, l.to) ? r : null; + let u = bT(a.state, l.from, l.to) ? n : Hx(a.state, l.from, l.to) ? r : null; u && o.add(l.from, l.from, u); } return o.finish(); @@ -13070,29 +13070,29 @@ function l6e(t = {}) { }), { domEventHandlers: s } = e; return [ i, - Z_({ + G_({ class: "cm-foldGutter", markers(a) { var o; return ((o = a.plugin(i)) === null || o === void 0 ? void 0 : o.markers) || jr.empty; }, initialSpacer() { - return new c8(e, !1); + return new n8(e, !1); }, domEventHandlers: Object.assign(Object.assign({}, s), { click: (a, o, l) => { if (s.click && s.click(a, o, l)) return !0; - let u = wT(a.state, o.from, o.to); + let u = bT(a.state, o.from, o.to); if (u) - return a.dispatch({ effects: am.of(u) }), !0; - let h = jx(a.state, o.from, o.to); - return h ? (a.dispatch({ effects: Af.of(h) }), !0) : !1; + return a.dispatch({ effects: rm.of(u) }), !0; + let h = Hx(a.state, o.from, o.to); + return h ? (a.dispatch({ effects: Ef.of(h) }), !0) : !1; } }) }), - Qae() + Pae() ]; } -const c6e = /* @__PURE__ */ Mt.baseTheme({ +const Z_e = /* @__PURE__ */ Mt.baseTheme({ ".cm-foldPlaceholder": { backgroundColor: "#eee", border: "1px solid #ddd", @@ -13107,61 +13107,61 @@ const c6e = /* @__PURE__ */ Mt.baseTheme({ cursor: "pointer" } }); -class J_ { +class X_ { constructor(e, r) { this.specs = e; let n; function i(o) { - let l = Ef.newName(); + let l = Tf.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 bl ? (o) => o.prop(q0) == a.data : a ? (o) => o == a : void 0, this.style = Dae(e.map((o) => ({ + this.scope = a instanceof ml ? (o) => o.prop($0) == a.data : a ? (o) => o == a : void 0, this.style = Sae(e.map((o) => ({ tag: o.tag, class: o.class || i(Object.assign({}, o, { tag: null })) })), { all: s - }).style, this.module = n ? new Ef(n) : null, this.themeType = r.themeType; + }).style, this.module = n ? new Tf(n) : null, this.themeType = r.themeType; } static define(e, r) { - return new J_(e, r || {}); + return new X_(e, r || {}); } } -const p9 = /* @__PURE__ */ Gt.define(), Wae = /* @__PURE__ */ Gt.define({ +const c9 = /* @__PURE__ */ Gt.define(), Iae = /* @__PURE__ */ Gt.define({ combine(t) { return t.length ? [t[0]] : null; } }); -function u8(t) { - let e = t.facet(p9); - return e.length ? e : t.facet(Wae); +function i8(t) { + let e = t.facet(c9); + return e.length ? e : t.facet(Iae); } -function JW(t, e) { - let r = [h6e], n; - return t instanceof J_ && (t.module && r.push(Mt.styleModule.of(t.module)), n = t.themeType), e != null && e.fallback ? r.push(Wae.of(t)) : n ? r.push(p9.computeN([Mt.darkTheme], (i) => i.facet(Mt.darkTheme) == (n == "dark") ? [t] : [])) : r.push(p9.of(t)), r; +function zW(t, e) { + let r = [J_e], n; + return t instanceof X_ && (t.module && r.push(Mt.styleModule.of(t.module)), n = t.themeType), e != null && e.fallback ? r.push(Iae.of(t)) : n ? r.push(c9.computeN([Mt.darkTheme], (i) => i.facet(Mt.darkTheme) == (n == "dark") ? [t] : [])) : r.push(c9.of(t)), r; } -class u6e { +class K_e { constructor(e) { - this.markCache = /* @__PURE__ */ Object.create(null), this.tree = Qn(e.state), this.decorations = this.buildDeco(e, u8(e.state)), this.decoratedTo = e.viewport.to; + this.markCache = /* @__PURE__ */ Object.create(null), this.tree = Qn(e.state), this.decorations = this.buildDeco(e, i8(e.state)), this.decoratedTo = e.viewport.to; } update(e) { - let r = Qn(e.state), n = u8(e.state), i = n != u8(e.startState), { viewport: s } = e.view, a = e.changes.mapPos(this.decoratedTo, 1); + let r = Qn(e.state), n = i8(e.state), i = n != i8(e.startState), { viewport: s } = e.view, a = e.changes.mapPos(this.decoratedTo, 1); r.length < s.to && !i && r.type == this.tree.type && a >= s.to ? (this.decorations = this.decorations.map(e.changes), this.decoratedTo = a) : (r != this.tree || e.viewportChanged || i) && (this.tree = r, this.decorations = this.buildDeco(e.view, n), this.decoratedTo = s.to); } buildDeco(e, r) { if (!r || !this.tree.length) return Ht.none; - let n = new is(); + let n = new rs(); for (let { from: i, to: s } of e.visibleRanges) - I_e(this.tree, r, (a, o, l) => { + S_e(this.tree, r, (a, o, l) => { n.add(a, o, this.markCache[l] || (this.markCache[l] = Ht.mark({ class: l }))); }, i, s); return n.finish(); } } -const h6e = /* @__PURE__ */ Va.high(/* @__PURE__ */ fn.fromClass(u6e, { +const J_e = /* @__PURE__ */ qa.high(/* @__PURE__ */ fn.fromClass(K_e, { decorations: (t) => t.decorations -})), eY = /* @__PURE__ */ J_.define([ +})), qW = /* @__PURE__ */ X_.define([ { tag: ze.meta, color: "#404740" @@ -13239,49 +13239,49 @@ const h6e = /* @__PURE__ */ Va.high(/* @__PURE__ */ fn.fromClass(u6e, { tag: ze.invalid, color: "#f00" } -]), f6e = /* @__PURE__ */ Mt.baseTheme({ +]), e6e = /* @__PURE__ */ Mt.baseTheme({ "&.cm-focused .cm-matchingBracket": { backgroundColor: "#328c8252" }, "&.cm-focused .cm-nonmatchingBracket": { backgroundColor: "#bb555544" } -}), Yae = 1e4, Gae = "()[]{}", Hae = /* @__PURE__ */ Gt.define({ +}), $ae = 1e4, Bae = "()[]{}", Fae = /* @__PURE__ */ Gt.define({ combine(t) { - return Ah(t, { + return Th(t, { afterCursor: !0, - brackets: Gae, - maxScanDistance: Yae, - renderMatch: g6e + brackets: Bae, + maxScanDistance: $ae, + renderMatch: n6e }); } -}), d6e = /* @__PURE__ */ Ht.mark({ class: "cm-matchingBracket" }), p6e = /* @__PURE__ */ Ht.mark({ class: "cm-nonmatchingBracket" }); -function g6e(t) { - let e = [], r = t.matched ? d6e : p6e; +}), t6e = /* @__PURE__ */ Ht.mark({ class: "cm-matchingBracket" }), r6e = /* @__PURE__ */ Ht.mark({ class: "cm-nonmatchingBracket" }); +function n6e(t) { + let e = [], r = t.matched ? t6e : r6e; 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 m6e = /* @__PURE__ */ ai.define({ +const i6e = /* @__PURE__ */ ai.define({ create() { return Ht.none; }, update(t, e) { if (!e.docChanged && !e.selection) return t; - let r = [], n = e.state.facet(Hae); + let r = [], n = e.state.facet(Fae); for (let i of e.state.selection.ranges) { if (!i.empty) continue; - let s = tc(e.state, i.head, -1, n) || i.head > 0 && tc(e.state, i.head - 1, 1, n) || n.afterCursor && (tc(e.state, i.head, 1, n) || i.head < e.state.doc.length && tc(e.state, i.head + 1, -1, n)); + let s = Kl(e.state, i.head, -1, n) || i.head > 0 && Kl(e.state, i.head - 1, 1, n) || n.afterCursor && (Kl(e.state, i.head, 1, n) || i.head < e.state.doc.length && Kl(e.state, i.head + 1, -1, n)); s && (r = r.concat(n.renderMatch(s, e.state))); } return Ht.set(r, !0); }, provide: (t) => Mt.decorations.from(t) -}), v6e = [ - m6e, - f6e +}), s6e = [ + i6e, + e6e ]; -function y6e(t = {}) { - return [Hae.of(t), v6e]; +function a6e(t = {}) { + return [Fae.of(t), s6e]; } -const Xae = /* @__PURE__ */ new Fr(); -function g9(t, e, r) { +const zae = /* @__PURE__ */ new Fr(); +function u9(t, e, r) { let n = t.prop(e < 0 ? Fr.openedBy : Fr.closedBy); if (n) return n; @@ -13292,35 +13292,35 @@ function g9(t, e, r) { } return null; } -function m9(t) { - let e = t.type.prop(Xae); +function h9(t) { + let e = t.type.prop(zae); return e ? e(t.node) : t; } -function tc(t, e, r, n = {}) { - let i = n.maxScanDistance || Yae, s = n.brackets || Gae, a = Qn(t), o = a.resolveInner(e, r); +function Kl(t, e, r, n = {}) { + let i = n.maxScanDistance || $ae, s = n.brackets || Bae, a = Qn(t), o = a.resolveInner(e, r); for (let l = o; l; l = l.parent) { - let u = g9(l.type, r, s); + let u = u9(l.type, r, s); if (u && l.from < l.to) { - let h = m9(l); + let h = h9(l); if (h && (r > 0 ? e >= h.from && e < h.to : e > h.from && e <= h.to)) - return b6e(t, e, r, l, h, u, s); + return o6e(t, e, r, l, h, u, s); } } - return x6e(t, e, r, a, o.type, i, s); + return l6e(t, e, r, a, o.type, i, s); } -function b6e(t, e, r, n, i, s, a) { +function o6e(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 = m9(h); + let f = h9(h); return { start: l, end: f ? { from: f.from, to: f.to } : void 0, matched: !0 }; - } else if (g9(h.type, r, a)) + } else if (u9(h.type, r, a)) u++; - else if (g9(h.type, -r, a)) { + else if (u9(h.type, -r, a)) { if (u == 0) { - let f = m9(h); + let f = h9(h); return { start: l, end: f && f.from < f.to ? { from: f.from, to: f.to } : void 0, @@ -13333,7 +13333,7 @@ function b6e(t, e, r, n, i, s, a) { while (r < 0 ? h.prevSibling() : h.nextSibling()); return { start: l, matched: !1 }; } -function x6e(t, e, r, n, i, s, a) { +function l6e(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; @@ -13357,14 +13357,14 @@ function x6e(t, e, r, n, i, s, a) { } return h.done ? { start: u, matched: !1 } : null; } -function tY(t, e, r, n = 0, i = 0) { +function UW(t, e, r, n = 0, i = 0) { e == null && (e = t.search(/[^\s\u00a0]/), e == -1 && (e = t.length)); let s = i; for (let a = n; a < e; a++) t.charCodeAt(a) == 9 ? s += r - s % r : s++; return s; } -class w6e { +class c6e { constructor(e, r, n, i) { this.string = e, this.tabSize = r, this.indentUnit = n, this.overrideIndent = i, this.pos = 0, this.start = 0, this.lastColumnPos = 0, this.lastColumnValue = 0; } @@ -13410,11 +13410,11 @@ class w6e { this.pos -= e; } column() { - return this.lastColumnPos < this.start && (this.lastColumnValue = tY(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue), this.lastColumnPos = this.start), this.lastColumnValue; + return this.lastColumnPos < this.start && (this.lastColumnValue = UW(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue), this.lastColumnPos = this.start), this.lastColumnValue; } indentation() { var e; - return (e = this.overrideIndent) !== null && e !== void 0 ? e : tY(this.string, null, this.tabSize); + return (e = this.overrideIndent) !== null && e !== void 0 ? e : UW(this.string, null, this.tabSize); } match(e, r, n) { if (typeof e == "string") { @@ -13429,7 +13429,7 @@ class w6e { return this.string.slice(this.start, this.pos); } } -const O6e = /* @__PURE__ */ Object.create(null), rY = [xs.none], nY = [], iY = /* @__PURE__ */ Object.create(null), k6e = /* @__PURE__ */ Object.create(null); +const u6e = /* @__PURE__ */ Object.create(null), QW = [ys.none], VW = [], WW = /* @__PURE__ */ Object.create(null), h6e = /* @__PURE__ */ Object.create(null); for (let [t, e] of [ ["variable", "variableName"], ["variable-2", "variableName.special"], @@ -13444,39 +13444,39 @@ for (let [t, e] of [ ["header", "heading"], ["property", "propertyName"] ]) - k6e[t] = /* @__PURE__ */ S6e(O6e, e); -function h8(t, e) { - nY.indexOf(t) > -1 || (nY.push(t), console.warn(e)); + h6e[t] = /* @__PURE__ */ f6e(u6e, e); +function s8(t, e) { + VW.indexOf(t) > -1 || (VW.push(t), console.warn(e)); } -function S6e(t, e) { +function f6e(t, e) { let r = []; for (let o of e.split(" ")) { let l = []; for (let u of o.split(".")) { let h = t[u] || ze[u]; - h ? typeof h == "function" ? l.length ? l = l.map(h) : h8(u, `Modifier ${u} used at start of tag`) : l.length ? h8(u, `Tag ${u} used as modifier`) : l = Array.isArray(h) ? h : [h] : h8(u, `Unknown highlighting tag ${u}`); + h ? typeof h == "function" ? l.length ? l = l.map(h) : s8(u, `Modifier ${u} used at start of tag`) : l.length ? s8(u, `Tag ${u} used as modifier`) : l = Array.isArray(h) ? h : [h] : s8(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 = iY[i]; + let n = e.replace(/ /g, "_"), i = n + " " + r.map((o) => o.id), s = WW[i]; if (s) return s.id; - let a = iY[i] = xs.define({ - id: rY.length, + let a = WW[i] = ys.define({ + id: QW.length, name: n, - props: [Vp({ [n]: r })] + props: [Bp({ [n]: r })] }); - return rY.push(a), a.id; + return QW.push(a), a.id; } Xn.RTL, Xn.LTR; -const T6e = (t) => { - let { state: e } = t, r = e.doc.lineAt(e.selection.main.from), n = aB(t.state, r.from); - return n.line ? C6e(t) : n.block ? _6e(t) : !1; +const d6e = (t) => { + let { state: e } = t, r = e.doc.lineAt(e.selection.main.from), n = H$(t.state, r.from); + return n.line ? p6e(t) : n.block ? m6e(t) : !1; }; -function sB(t, e) { +function G$(t, e) { return ({ state: r, dispatch: n }) => { if (r.readOnly) return !1; @@ -13484,21 +13484,21 @@ function sB(t, e) { return i ? (n(r.update(i)), !0) : !1; }; } -const C6e = /* @__PURE__ */ sB(L6e, 0), E6e = /* @__PURE__ */ sB(jae, 0), _6e = /* @__PURE__ */ sB((t, e) => jae(t, e, R6e(e)), 0); -function aB(t, e) { +const p6e = /* @__PURE__ */ G$(b6e, 0), g6e = /* @__PURE__ */ G$(qae, 0), m6e = /* @__PURE__ */ G$((t, e) => qae(t, e, y6e(e)), 0); +function H$(t, e) { let r = t.languageDataAt("commentTokens", e); return r.length ? r[0] : {}; } -const Q2 = 50; -function A6e(t, { open: e, close: r }, n, i) { - let s = t.sliceDoc(n - Q2, n), a = t.sliceDoc(i, i + Q2), o = /\s*$/.exec(s)[0].length, l = /^\s*/.exec(a)[0].length, u = s.length - o; +const F2 = 50; +function v6e(t, { open: e, close: r }, n, i) { + let s = t.sliceDoc(n - F2, n), a = t.sliceDoc(i, i + F2), 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 * Q2 ? h = f = t.sliceDoc(n, i) : (h = t.sliceDoc(n, n + Q2), f = t.sliceDoc(i - Q2, i)); + i - n <= 2 * F2 ? h = f = t.sliceDoc(n, i) : (h = t.sliceDoc(n, n + F2), f = t.sliceDoc(i - F2, 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: { @@ -13511,7 +13511,7 @@ function A6e(t, { open: e, close: r }, n, i) { } } : null; } -function R6e(t) { +function y6e(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; @@ -13519,11 +13519,11 @@ function R6e(t) { } return e; } -function jae(t, e, r = e.selection.ranges) { - let n = r.map((s) => aB(e, s.from).block); +function qae(t, e, r = e.selection.ranges) { + let n = r.map((s) => H$(e, s.from).block); if (!n.every((s) => s)) return null; - let i = r.map((s, a) => A6e(e, n[a], s.from, s.to)); + let i = r.map((s, a) => v6e(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)) { @@ -13537,10 +13537,10 @@ function jae(t, e, r = e.selection.ranges) { } return null; } -function L6e(t, e, r = e.selection.ranges) { +function b6e(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 = aB(e, s).line; + let o = n.length, l = 1e9, u = H$(e, s).line; if (!!u) { for (let h = s; h <= a; ) { let f = e.doc.lineAt(h); @@ -13574,9 +13574,9 @@ function L6e(t, e, r = e.selection.ranges) { } return null; } -const v9 = /* @__PURE__ */ Oo.define(), M6e = /* @__PURE__ */ Oo.define(), D6e = /* @__PURE__ */ Gt.define(), Zae = /* @__PURE__ */ Gt.define({ +const f9 = /* @__PURE__ */ bo.define(), x6e = /* @__PURE__ */ bo.define(), w6e = /* @__PURE__ */ Gt.define(), Uae = /* @__PURE__ */ Gt.define({ combine(t) { - return Ah(t, { + return Th(t, { minDepth: 100, newGroupDelay: 500, joinToEvent: (e, r) => r @@ -13586,59 +13586,59 @@ const v9 = /* @__PURE__ */ Oo.define(), M6e = /* @__PURE__ */ Oo.define(), D6e = joinToEvent: (e, r) => (n, i) => e(n, i) || r(n, i) }); } -}), Kae = /* @__PURE__ */ ai.define({ +}), Qae = /* @__PURE__ */ ai.define({ create() { - return ju.empty; + return Gu.empty; }, update(t, e) { - let r = e.state.facet(Zae), n = e.annotation(v9); + let r = e.state.facet(Uae), n = e.annotation(f9); if (n) { - let l = Xo.fromTransaction(e, n.selection), u = n.side, h = u == 0 ? t.undone : t.done; - return l ? h = OT(h, h.length, r.minDepth, l) : h = eoe(h, e.startState.selection), new ju(u == 0 ? n.rest : h, u == 0 ? h : n.rest); + let l = Yo.fromTransaction(e, n.selection), u = n.side, h = u == 0 ? t.undone : t.done; + return l ? h = xT(h, h.length, r.minDepth, l) : h = Wae(h, e.startState.selection), new Gu(u == 0 ? n.rest : h, u == 0 ? h : n.rest); } - let i = e.annotation(M6e); - if ((i == "full" || i == "before") && (t = t.isolate()), e.annotation(zi.addToHistory) === !1) + let i = e.annotation(x6e); + if ((i == "full" || i == "before") && (t = t.isolate()), e.annotation(Fi.addToHistory) === !1) return e.changes.empty ? t : t.addMapping(e.changes.desc); - let s = Xo.fromTransaction(e), a = e.annotation(zi.time), o = e.annotation(zi.userEvent); + let s = Yo.fromTransaction(e), a = e.annotation(Fi.time), o = e.annotation(Fi.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 ju(t.done.map(Xo.fromJSON), t.undone.map(Xo.fromJSON)); + return new Gu(t.done.map(Yo.fromJSON), t.undone.map(Yo.fromJSON)); } }); -function P6e(t = {}) { +function O6e(t = {}) { return [ - Kae, - Zae.of(t), + Qae, + Uae.of(t), Mt.domEventHandlers({ beforeinput(e, r) { - let n = e.inputType == "historyUndo" ? oB : e.inputType == "historyRedo" ? Zx : null; + let n = e.inputType == "historyUndo" ? X$ : e.inputType == "historyRedo" ? Xx : null; return n ? (e.preventDefault(), n(r)) : !1; } }) ]; } -function e6(t, e) { +function j_(t, e) { return function({ state: r, dispatch: n }) { if (!e && r.readOnly) return !1; - let i = r.field(Kae, !1); + let i = r.field(Qae, !1); if (!i) return !1; let s = i.pop(t, r, e); return s ? (n(s), !0) : !1; }; } -const oB = /* @__PURE__ */ e6(0, !1), Zx = /* @__PURE__ */ e6(1, !1), N6e = /* @__PURE__ */ e6(0, !0), I6e = /* @__PURE__ */ e6(1, !0); -class Xo { +const X$ = /* @__PURE__ */ j_(0, !1), Xx = /* @__PURE__ */ j_(1, !1), k6e = /* @__PURE__ */ j_(0, !0), S6e = /* @__PURE__ */ j_(1, !0); +class Yo { 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 Xo(this.changes, this.effects, this.mapped, this.startSelection, e); + return new Yo(this.changes, this.effects, this.mapped, this.startSelection, e); } toJSON() { var e, r, n; @@ -13650,25 +13650,25 @@ class Xo { }; } static fromJSON(e) { - return new Xo(e.changes && Hi.fromJSON(e.changes), [], e.mapped && ah.fromJSON(e.mapped), e.startSelection && ft.fromJSON(e.startSelection), e.selectionsAfter.map(ft.fromJSON)); + return new Yo(e.changes && Gi.fromJSON(e.changes), [], e.mapped && nh.fromJSON(e.mapped), e.startSelection && ft.fromJSON(e.startSelection), e.selectionsAfter.map(ft.fromJSON)); } static fromTransaction(e, r) { - let n = rc; - for (let i of e.startState.facet(D6e)) { + let n = Jl; + for (let i of e.startState.facet(w6e)) { let s = i(e); s.length && (n = n.concat(s)); } - return !n.length && e.changes.empty ? null : new Xo(e.changes.invert(e.startState.doc), n, void 0, r || e.startState.selection, rc); + return !n.length && e.changes.empty ? null : new Yo(e.changes.invert(e.startState.doc), n, void 0, r || e.startState.selection, Jl); } static selection(e) { - return new Xo(void 0, rc, void 0, void 0, e); + return new Yo(void 0, Jl, void 0, void 0, e); } } -function OT(t, e, r, n) { +function xT(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 $6e(t, e) { +function T6e(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; ) { @@ -13677,63 +13677,63 @@ function $6e(t, e) { } }), n; } -function B6e(t, e) { +function C6e(t, e) { return t.ranges.length == e.ranges.length && t.ranges.filter((r, n) => r.empty != e.ranges[n].empty).length === 0; } -function Jae(t, e) { +function Vae(t, e) { return t.length ? e.length ? t.concat(e) : t : e; } -const rc = [], F6e = 200; -function eoe(t, e) { +const Jl = [], E6e = 200; +function Wae(t, e) { if (t.length) { - let r = t[t.length - 1], n = r.selectionsAfter.slice(Math.max(0, r.selectionsAfter.length - F6e)); - return n.length && n[n.length - 1].eq(e) ? t : (n.push(e), OT(t, t.length - 1, 1e9, r.setSelAfter(n))); + let r = t[t.length - 1], n = r.selectionsAfter.slice(Math.max(0, r.selectionsAfter.length - E6e)); + return n.length && n[n.length - 1].eq(e) ? t : (n.push(e), xT(t, t.length - 1, 1e9, r.setSelAfter(n))); } else - return [Xo.selection([e])]; + return [Yo.selection([e])]; } -function z6e(t) { +function _6e(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 f8(t, e) { +function a8(t, e) { if (!t.length) return t; - let r = t.length, n = rc; + let r = t.length, n = Jl; for (; r; ) { - let i = q6e(t[r - 1], e, n); + let i = A6e(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 ? [Xo.selection(n)] : rc; + return n.length ? [Yo.selection(n)] : Jl; } -function q6e(t, e, r) { - let n = Jae(t.selectionsAfter.length ? t.selectionsAfter.map((o) => o.map(e)) : rc, r); +function A6e(t, e, r) { + let n = Vae(t.selectionsAfter.length ? t.selectionsAfter.map((o) => o.map(e)) : Jl, r); if (!t.changes) - return Xo.selection(n); + return Yo.selection(n); let i = t.changes.map(e), s = e.mapDesc(t.changes, !0), a = t.mapped ? t.mapped.composeDesc(s) : s; - return new Xo(i, _r.mapEffects(t.effects, e), a, t.startSelection.map(s), n); + return new Yo(i, _r.mapEffects(t.effects, e), a, t.startSelection.map(s), n); } -const U6e = /^(input\.type|delete)($|\.)/; -class ju { +const R6e = /^(input\.type|delete)($|\.)/; +class Gu { 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 ju(this.done, this.undone) : this; + return this.prevTime ? new Gu(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 || U6e.test(n)) && (!o.selectionsAfter.length && r - this.prevTime < i.newGroupDelay && i.joinToEvent(s, $6e(o.changes, e.changes)) || n == "input.type.compose") ? a = OT(a, a.length - 1, i.minDepth, new Xo(e.changes.compose(o.changes), Jae(e.effects, o.effects), o.mapped, o.startSelection, rc)) : a = OT(a, a.length, i.minDepth, e), new ju(a, rc, r, n); + return o && o.changes && !o.changes.empty && e.changes && (!n || R6e.test(n)) && (!o.selectionsAfter.length && r - this.prevTime < i.newGroupDelay && i.joinToEvent(s, T6e(o.changes, e.changes)) || n == "input.type.compose") ? a = xT(a, a.length - 1, i.minDepth, new Yo(e.changes.compose(o.changes), Vae(e.effects, o.effects), o.mapped, o.startSelection, Jl)) : a = xT(a, a.length, i.minDepth, e), new Gu(a, Jl, r, n); } addSelection(e, r, n, i) { - let s = this.done.length ? this.done[this.done.length - 1].selectionsAfter : rc; - return s.length > 0 && r - this.prevTime < i && n == this.prevUserEvent && n && /^select($|\.)/.test(n) && B6e(s[s.length - 1], e) ? this : new ju(eoe(this.done, e), this.undone, r, n); + let s = this.done.length ? this.done[this.done.length - 1].selectionsAfter : Jl; + return s.length > 0 && r - this.prevTime < i && n == this.prevUserEvent && n && /^select($|\.)/.test(n) && C6e(s[s.length - 1], e) ? this : new Gu(Wae(this.done, e), this.undone, r, n); } addMapping(e) { - return new ju(f8(this.done, e), f8(this.undone, e), this.prevTime, this.prevUserEvent); + return new Gu(a8(this.done, e), a8(this.undone, e), this.prevTime, this.prevUserEvent); } pop(e, r, n) { let i = e == 0 ? this.done : this.undone; @@ -13743,17 +13743,17 @@ class ju { if (n && s.selectionsAfter.length) return r.update({ selection: s.selectionsAfter[s.selectionsAfter.length - 1], - annotations: v9.of({ side: e, rest: z6e(i), selection: a }), + annotations: f9.of({ side: e, rest: _6e(i), selection: a }), userEvent: e == 0 ? "select.undo" : "select.redo", scrollIntoView: !0 }); if (s.changes) { - let o = i.length == 1 ? rc : i.slice(0, i.length - 1); - return s.mapped && (o = f8(o, s.mapped)), r.update({ + let o = i.length == 1 ? Jl : i.slice(0, i.length - 1); + return s.mapped && (o = a8(o, s.mapped)), r.update({ changes: s.changes, selection: s.startSelection, effects: s.effects, - annotations: v9.of({ side: e, rest: o, selection: a }), + annotations: f9.of({ side: e, rest: o, selection: a }), filter: !1, userEvent: e == 0 ? "undo" : "redo", scrollIntoView: !0 @@ -13762,66 +13762,66 @@ class ju { return null; } } -ju.empty = /* @__PURE__ */ new ju(rc, rc); -const Q6e = [ - { key: "Mod-z", run: oB, preventDefault: !0 }, - { key: "Mod-y", mac: "Mod-Shift-z", run: Zx, preventDefault: !0 }, - { linux: "Ctrl-Shift-z", run: Zx, preventDefault: !0 }, - { key: "Mod-u", run: N6e, preventDefault: !0 }, - { key: "Alt-u", mac: "Mod-Shift-u", run: I6e, preventDefault: !0 } +Gu.empty = /* @__PURE__ */ new Gu(Jl, Jl); +const L6e = [ + { key: "Mod-z", run: X$, preventDefault: !0 }, + { key: "Mod-y", mac: "Mod-Shift-z", run: Xx, preventDefault: !0 }, + { linux: "Ctrl-Shift-z", run: Xx, preventDefault: !0 }, + { key: "Mod-u", run: k6e, preventDefault: !0 }, + { key: "Alt-u", mac: "Mod-Shift-u", run: S6e, preventDefault: !0 } ]; -function By(t, e) { +function Dy(t, e) { return ft.create(t.ranges.map(e), t.mainIndex); } -function Rh(t, e) { +function Ch(t, e) { return t.update({ selection: e, scrollIntoView: !0, userEvent: "select" }); } -function gu({ state: t, dispatch: e }, r) { - let n = By(t.selection, r); - return n.eq(t.selection) ? !1 : (e(Rh(t, n)), !0); +function fu({ state: t, dispatch: e }, r) { + let n = Dy(t.selection, r); + return n.eq(t.selection) ? !1 : (e(Ch(t, n)), !0); } -function t6(t, e) { +function Z_(t, e) { return ft.cursor(e ? t.to : t.from); } -function lB(t, e) { - return gu(t, (r) => r.empty ? t.moveByChar(r, e) : t6(r, e)); +function j$(t, e) { + return fu(t, (r) => r.empty ? t.moveByChar(r, e) : Z_(r, e)); } -function Ga(t) { +function Va(t) { return t.textDirectionAt(t.state.selection.main.head) == Xn.LTR; } -const cB = (t) => lB(t, !Ga(t)), toe = (t) => lB(t, Ga(t)), V6e = (t) => lB(t, !1); -function roe(t, e) { - return gu(t, (r) => r.empty ? t.moveByGroup(r, e) : t6(r, e)); +const Z$ = (t) => j$(t, !Va(t)), Yae = (t) => j$(t, Va(t)), M6e = (t) => j$(t, !1); +function Gae(t, e) { + return fu(t, (r) => r.empty ? t.moveByGroup(r, e) : Z_(r, e)); } -const W6e = (t) => roe(t, !Ga(t)), Y6e = (t) => roe(t, Ga(t)); -function G6e(t, e, r) { +const D6e = (t) => Gae(t, !Va(t)), P6e = (t) => Gae(t, Va(t)); +function N6e(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 r6(t, e, r) { +function K_(t, e, r) { let n = Qn(t).resolveInner(e.head), i = r ? Fr.closedBy : Fr.openedBy; for (let l = e.head; ; ) { let u = r ? n.childAfter(l) : n.childBefore(l); if (!u) break; - G6e(t, u, i) ? n = u : l = r ? u.to : u.from; + N6e(t, u, i) ? n = u : l = r ? u.to : u.from; } let s = n.type.prop(i), a, o; - return s && (a = r ? tc(t, n.from, 1) : tc(t, n.to, -1)) && a.matched ? o = r ? a.end.to : a.end.from : o = r ? n.to : n.from, ft.cursor(o, r ? -1 : 1); + return s && (a = r ? Kl(t, n.from, 1) : Kl(t, n.to, -1)) && a.matched ? o = r ? a.end.to : a.end.from : o = r ? n.to : n.from, ft.cursor(o, r ? -1 : 1); } -const H6e = (t) => gu(t, (e) => r6(t.state, e, !Ga(t))), X6e = (t) => gu(t, (e) => r6(t.state, e, Ga(t))); -function noe(t, e) { - return gu(t, (r) => { +const I6e = (t) => fu(t, (e) => K_(t.state, e, !Va(t))), $6e = (t) => fu(t, (e) => K_(t.state, e, Va(t))); +function Hae(t, e) { + return fu(t, (r) => { if (!r.empty) - return t6(r, e); + return Z_(r, e); let n = t.moveVertically(r, e); return n.head != r.head ? n : t.moveToLineBoundary(r, e); }); } -const ioe = (t) => noe(t, !1), soe = (t) => noe(t, !0); -function aoe(t) { +const Xae = (t) => Hae(t, !1), jae = (t) => Hae(t, !0); +function Zae(t) { let e = t.scrollDOM.clientHeight < t.scrollDOM.scrollHeight - 2, r = 0, n = 0, i; if (e) { for (let s of t.state.facet(Mt.scrollMargins)) { @@ -13838,8 +13838,8 @@ function aoe(t) { height: Math.max(t.defaultLineHeight, i - 5) }; } -function ooe(t, e) { - let r = aoe(t), { state: n } = t, i = By(n.selection, (a) => a.empty ? t.moveVertically(a, e, r.height) : t6(a, e)); +function Kae(t, e) { + let r = Zae(t), { state: n } = t, i = Dy(n.selection, (a) => a.empty ? t.moveVertically(a, e, r.height) : Z_(a, e)); if (i.eq(n.selection)) return !1; let s; @@ -13847,10 +13847,10 @@ function ooe(t, e) { 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 = Mt.scrollIntoView(i.main.head, { y: "start", yMargin: a.top - l })); } - return t.dispatch(Rh(n, i), { effects: s }), !0; + return t.dispatch(Ch(n, i), { effects: s }), !0; } -const sY = (t) => ooe(t, !1), y9 = (t) => ooe(t, !0); -function Wp(t, e, r) { +const YW = (t) => Kae(t, !1), d9 = (t) => Kae(t, !0); +function Fp(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; @@ -13858,46 +13858,46 @@ function Wp(t, e, r) { } return i; } -const loe = (t) => gu(t, (e) => Wp(t, e, !0)), coe = (t) => gu(t, (e) => Wp(t, e, !1)), j6e = (t) => gu(t, (e) => Wp(t, e, !Ga(t))), Z6e = (t) => gu(t, (e) => Wp(t, e, Ga(t))), K6e = (t) => gu(t, (e) => ft.cursor(t.lineBlockAt(e.head).from, 1)), J6e = (t) => gu(t, (e) => ft.cursor(t.lineBlockAt(e.head).to, -1)); -function eAe(t, e, r) { - let n = !1, i = By(t.selection, (s) => { - let a = tc(t, s.head, -1) || tc(t, s.head, 1) || s.head > 0 && tc(t, s.head - 1, 1) || s.head < t.doc.length && tc(t, s.head + 1, -1); +const Jae = (t) => fu(t, (e) => Fp(t, e, !0)), eoe = (t) => fu(t, (e) => Fp(t, e, !1)), B6e = (t) => fu(t, (e) => Fp(t, e, !Va(t))), F6e = (t) => fu(t, (e) => Fp(t, e, Va(t))), z6e = (t) => fu(t, (e) => ft.cursor(t.lineBlockAt(e.head).from, 1)), q6e = (t) => fu(t, (e) => ft.cursor(t.lineBlockAt(e.head).to, -1)); +function U6e(t, e, r) { + let n = !1, i = Dy(t.selection, (s) => { + let a = Kl(t, s.head, -1) || Kl(t, s.head, 1) || s.head > 0 && Kl(t, s.head - 1, 1) || s.head < t.doc.length && Kl(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 ? ft.range(s.anchor, o) : ft.cursor(o); }); - return n ? (e(Rh(t, i)), !0) : !1; + return n ? (e(Ch(t, i)), !0) : !1; } -const tAe = ({ state: t, dispatch: e }) => eAe(t, e, !1); -function _c(t, e) { - let r = By(t.state.selection, (n) => { +const Q6e = ({ state: t, dispatch: e }) => U6e(t, e, !1); +function Tc(t, e) { + let r = Dy(t.state.selection, (n) => { let i = e(n); return ft.range(n.anchor, i.head, i.goalColumn, i.bidiLevel || void 0); }); - return r.eq(t.state.selection) ? !1 : (t.dispatch(Rh(t.state, r)), !0); + return r.eq(t.state.selection) ? !1 : (t.dispatch(Ch(t.state, r)), !0); } -function uoe(t, e) { - return _c(t, (r) => t.moveByChar(r, e)); +function toe(t, e) { + return Tc(t, (r) => t.moveByChar(r, e)); } -const hoe = (t) => uoe(t, !Ga(t)), foe = (t) => uoe(t, Ga(t)); -function doe(t, e) { - return _c(t, (r) => t.moveByGroup(r, e)); +const roe = (t) => toe(t, !Va(t)), noe = (t) => toe(t, Va(t)); +function ioe(t, e) { + return Tc(t, (r) => t.moveByGroup(r, e)); } -const rAe = (t) => doe(t, !Ga(t)), nAe = (t) => doe(t, Ga(t)), iAe = (t) => _c(t, (e) => r6(t.state, e, !Ga(t))), sAe = (t) => _c(t, (e) => r6(t.state, e, Ga(t))); -function poe(t, e) { - return _c(t, (r) => t.moveVertically(r, e)); +const V6e = (t) => ioe(t, !Va(t)), W6e = (t) => ioe(t, Va(t)), Y6e = (t) => Tc(t, (e) => K_(t.state, e, !Va(t))), G6e = (t) => Tc(t, (e) => K_(t.state, e, Va(t))); +function soe(t, e) { + return Tc(t, (r) => t.moveVertically(r, e)); } -const goe = (t) => poe(t, !1), moe = (t) => poe(t, !0); -function voe(t, e) { - return _c(t, (r) => t.moveVertically(r, e, aoe(t).height)); +const aoe = (t) => soe(t, !1), ooe = (t) => soe(t, !0); +function loe(t, e) { + return Tc(t, (r) => t.moveVertically(r, e, Zae(t).height)); } -const aY = (t) => voe(t, !1), oY = (t) => voe(t, !0), aAe = (t) => _c(t, (e) => Wp(t, e, !0)), oAe = (t) => _c(t, (e) => Wp(t, e, !1)), lAe = (t) => _c(t, (e) => Wp(t, e, !Ga(t))), cAe = (t) => _c(t, (e) => Wp(t, e, Ga(t))), uAe = (t) => _c(t, (e) => ft.cursor(t.lineBlockAt(e.head).from)), hAe = (t) => _c(t, (e) => ft.cursor(t.lineBlockAt(e.head).to)), lY = ({ state: t, dispatch: e }) => (e(Rh(t, { anchor: 0 })), !0), cY = ({ state: t, dispatch: e }) => (e(Rh(t, { anchor: t.doc.length })), !0), uY = ({ state: t, dispatch: e }) => (e(Rh(t, { anchor: t.selection.main.anchor, head: 0 })), !0), hY = ({ state: t, dispatch: e }) => (e(Rh(t, { anchor: t.selection.main.anchor, head: t.doc.length })), !0), fAe = ({ state: t, dispatch: e }) => (e(t.update({ selection: { anchor: 0, head: t.doc.length }, userEvent: "select" })), !0), dAe = ({ state: t, dispatch: e }) => { - let r = n6(t).map(({ from: n, to: i }) => ft.range(n, Math.min(i + 1, t.doc.length))); +const GW = (t) => loe(t, !1), HW = (t) => loe(t, !0), H6e = (t) => Tc(t, (e) => Fp(t, e, !0)), X6e = (t) => Tc(t, (e) => Fp(t, e, !1)), j6e = (t) => Tc(t, (e) => Fp(t, e, !Va(t))), Z6e = (t) => Tc(t, (e) => Fp(t, e, Va(t))), K6e = (t) => Tc(t, (e) => ft.cursor(t.lineBlockAt(e.head).from)), J6e = (t) => Tc(t, (e) => ft.cursor(t.lineBlockAt(e.head).to)), XW = ({ state: t, dispatch: e }) => (e(Ch(t, { anchor: 0 })), !0), jW = ({ state: t, dispatch: e }) => (e(Ch(t, { anchor: t.doc.length })), !0), ZW = ({ state: t, dispatch: e }) => (e(Ch(t, { anchor: t.selection.main.anchor, head: 0 })), !0), KW = ({ state: t, dispatch: e }) => (e(Ch(t, { anchor: t.selection.main.anchor, head: t.doc.length })), !0), eAe = ({ state: t, dispatch: e }) => (e(t.update({ selection: { anchor: 0, head: t.doc.length }, userEvent: "select" })), !0), tAe = ({ state: t, dispatch: e }) => { + let r = J_(t).map(({ from: n, to: i }) => ft.range(n, Math.min(i + 1, t.doc.length))); return e(t.update({ selection: ft.create(r), userEvent: "select" })), !0; -}, pAe = ({ state: t, dispatch: e }) => { - let r = By(t.selection, (n) => { +}, rAe = ({ state: t, dispatch: e }) => { + let r = Dy(t.selection, (n) => { var i; let s = Qn(t).resolveStack(n.from, 1); for (let a = s; a; a = a.next) { @@ -13907,21 +13907,21 @@ const aY = (t) => voe(t, !1), oY = (t) => voe(t, !0), aAe = (t) => _c(t, (e) => } return n; }); - return e(Rh(t, r)), !0; -}, gAe = ({ state: t, dispatch: e }) => { + return e(Ch(t, r)), !0; +}, nAe = ({ state: t, dispatch: e }) => { let r = t.selection, n = null; - return r.ranges.length > 1 ? n = ft.create([r.main]) : r.main.empty || (n = ft.create([ft.cursor(r.main.head)])), n ? (e(Rh(t, n)), !0) : !1; + return r.ranges.length > 1 ? n = ft.create([r.main]) : r.main.empty || (n = ft.create([ft.cursor(r.main.head)])), n ? (e(Ch(t, n)), !0) : !1; }; -function kk(t, e) { +function xk(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 = uS(t, l, !1)) : l > a && (r = "delete.forward", l = uS(t, l, !0)), a = Math.min(a, l), o = Math.max(o, l); + l < a ? (r = "delete.backward", l = oS(t, l, !1)) : l > a && (r = "delete.forward", l = oS(t, l, !0)), a = Math.min(a, l), o = Math.max(o, l); } else - a = uS(t, a, !1), o = uS(t, o, !0); + a = oS(t, a, !1), o = oS(t, o, !0); return a == o ? { range: s } : { changes: { from: a, to: o }, range: ft.cursor(a, a < s.head ? -1 : 1) }; }); return i.changes.empty ? !1 : (t.dispatch(n.update(i, { @@ -13930,7 +13930,7 @@ function kk(t, e) { effects: r == "delete.selection" ? Mt.announce.of(n.phrase("Selection deleted")) : void 0 })), !0); } -function uS(t, e, r) { +function oS(t, e, r) { if (t instanceof Mt) for (let n of t.state.facet(Mt.atomicRanges).map((i) => i(t))) n.between(e, e, (i, s) => { @@ -13938,41 +13938,41 @@ function uS(t, e, r) { }); return e; } -const yoe = (t, e) => kk(t, (r) => { +const coe = (t, e) => xk(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 = ou(a, i.tabSize), u = l % xT(i) || xT(i); + let l = iu(a, i.tabSize), u = l % yT(i) || yT(i); for (let h = 0; h < u && a[a.length - 1 - h] == " "; h++) n--; o = n; } else - o = la(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 = la(s.text, o - s.from, !1, !1) + s.from); + o = oa(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 = oa(s.text, o - s.from, !1, !1) + s.from); return o; -}), b9 = (t) => yoe(t, !1), boe = (t) => yoe(t, !0), xoe = (t, e) => kk(t, (r) => { +}), p9 = (t) => coe(t, !1), uoe = (t) => coe(t, !0), hoe = (t, e) => xk(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 = la(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 = oa(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; -}), woe = (t) => xoe(t, !1), mAe = (t) => xoe(t, !0), vAe = (t) => kk(t, (e) => { +}), foe = (t) => hoe(t, !1), iAe = (t) => hoe(t, !0), sAe = (t) => xk(t, (e) => { let r = t.lineBlockAt(e.head).to; return e.head < r ? r : Math.min(t.state.doc.length, e.head + 1); -}), yAe = (t) => kk(t, (e) => { +}), aAe = (t) => xk(t, (e) => { let r = t.moveToLineBoundary(e, !1).head; return e.head > r ? r : Math.max(0, e.head - 1); -}), bAe = (t) => kk(t, (e) => { +}), oAe = (t) => xk(t, (e) => { let r = t.moveToLineBoundary(e, !0).head; return e.head < r ? r : Math.min(t.state.doc.length, e.head + 1); -}), xAe = ({ state: t, dispatch: e }) => { +}), lAe = ({ state: t, dispatch: e }) => { if (t.readOnly) return !1; let r = t.changeByRange((n) => ({ @@ -13980,13 +13980,13 @@ const yoe = (t, e) => kk(t, (r) => { range: ft.cursor(n.from) })); return e(t.update(r, { scrollIntoView: !0, userEvent: "input" })), !0; -}, wAe = ({ state: t, dispatch: e }) => { +}, cAe = ({ 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 : la(s.text, i - s.from, !1) + s.from, o = i == s.to ? i + 1 : la(s.text, i - s.from, !0) + s.from; + let i = n.from, s = t.doc.lineAt(i), a = i == s.from ? i - 1 : oa(s.text, i - s.from, !1) + s.from, o = i == s.to ? i + 1 : oa(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: ft.cursor(o) @@ -13994,7 +13994,7 @@ const yoe = (t, e) => kk(t, (r) => { }); return r.changes.empty ? !1 : (e(t.update(r, { scrollIntoView: !0, userEvent: "move.character" })), !0); }; -function n6(t) { +function J_(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); @@ -14007,11 +14007,11 @@ function n6(t) { } return e; } -function Ooe(t, e, r) { +function doe(t, e, r) { if (t.readOnly) return !1; let n = [], i = []; - for (let s of n6(t)) { + for (let s of J_(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; @@ -14032,41 +14032,41 @@ function Ooe(t, e, r) { userEvent: "move.line" })), !0) : !1; } -const OAe = ({ state: t, dispatch: e }) => Ooe(t, e, !1), kAe = ({ state: t, dispatch: e }) => Ooe(t, e, !0); -function koe(t, e, r) { +const uAe = ({ state: t, dispatch: e }) => doe(t, e, !1), hAe = ({ state: t, dispatch: e }) => doe(t, e, !0); +function poe(t, e, r) { if (t.readOnly) return !1; let n = []; - for (let i of n6(t)) + for (let i of J_(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 SAe = ({ state: t, dispatch: e }) => koe(t, e, !1), TAe = ({ state: t, dispatch: e }) => koe(t, e, !0), CAe = (t) => { +const fAe = ({ state: t, dispatch: e }) => poe(t, e, !1), dAe = ({ state: t, dispatch: e }) => poe(t, e, !0), pAe = (t) => { if (t.state.readOnly) return !1; - let { state: e } = t, r = e.changes(n6(e).map(({ from: i, to: s }) => (i > 0 ? i-- : s < e.doc.length && s++, { from: i, to: s }))), n = By(e.selection, (i) => t.moveVertically(i, !0)).map(r); + let { state: e } = t, r = e.changes(J_(e).map(({ from: i, to: s }) => (i > 0 ? i-- : s < e.doc.length && s++, { from: i, to: s }))), n = Dy(e.selection, (i) => t.moveVertically(i, !0)).map(r); return t.dispatch({ changes: r, selection: n, scrollIntoView: !0, userEvent: "delete.line" }), !0; }; -function EAe(t, e) { +function gAe(t, e) { if (/\(\)|\[\]|\{\}/.test(t.sliceDoc(e - 1, e + 1))) return { from: e, to: e }; let r = Qn(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(Fr.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 Soe = /* @__PURE__ */ Toe(!1), _Ae = /* @__PURE__ */ Toe(!0); -function Toe(t) { +const goe = /* @__PURE__ */ moe(!1), mAe = /* @__PURE__ */ moe(!0); +function moe(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 && EAe(e, s); + let { from: s, to: a } = i, o = e.doc.lineAt(s), l = !t && s == a && gAe(e, s); t && (s = a = (a <= o.to ? o : e.doc.lineAt(a)).to); - let u = new K_(e, { simulateBreak: s, simulateDoubleBreak: !!l }), h = tB(u, s); - for (h == null && (h = ou(/^\s*/.exec(e.doc.lineAt(s).text)[0], e.tabSize)); a < o.to && /\s/.test(o.text[a - o.from]); ) + let u = new H_(e, { simulateBreak: s, simulateDoubleBreak: !!l }), h = Q$(u, s); + for (h == null && (h = iu(/^\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 = ["", Xx(e, h)]; - return l && f.push(Xx(e, u.lineIndent(o.from, -1))), { + let f = ["", Gx(e, h)]; + return l && f.push(Gx(e, u.lineIndent(o.from, -1))), { changes: { from: s, to: a, insert: nn.of(f) }, range: ft.cursor(s + 1 + f[1].length) }; @@ -14074,7 +14074,7 @@ function Toe(t) { return r(e.update(n, { scrollIntoView: !0, userEvent: "input" })), !0; }; } -function uB(t, e) { +function K$(t, e) { let r = -1; return t.changeByRange((n) => { let i = []; @@ -14089,91 +14089,91 @@ function uB(t, e) { }; }); } -const Coe = ({ state: t, dispatch: e }) => { +const voe = ({ state: t, dispatch: e }) => { if (t.readOnly) return !1; - let r = /* @__PURE__ */ Object.create(null), n = new K_(t, { overrideIndentation: (s) => { + let r = /* @__PURE__ */ Object.create(null), n = new H_(t, { overrideIndentation: (s) => { let a = r[s]; return a == null ? -1 : a; - } }), i = uB(t, (s, a, o) => { - let l = tB(n, s.from); + } }), i = K$(t, (s, a, o) => { + let l = Q$(n, s.from); if (l == null) return; /\S/.test(s.text) || (l = 0); - let u = /^\s*/.exec(s.text)[0], h = Xx(t, l); + let u = /^\s*/.exec(s.text)[0], h = Gx(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; -}, hB = ({ state: t, dispatch: e }) => t.readOnly ? !1 : (e(t.update(uB(t, (r, n) => { - n.push({ from: r.from, insert: t.facet(bg) }); -}), { userEvent: "input.indent" })), !0), fB = ({ state: t, dispatch: e }) => t.readOnly ? !1 : (e(t.update(uB(t, (r, n) => { +}, J$ = ({ state: t, dispatch: e }) => t.readOnly ? !1 : (e(t.update(K$(t, (r, n) => { + n.push({ from: r.from, insert: t.facet(gg) }); +}), { userEvent: "input.indent" })), !0), eB = ({ state: t, dispatch: e }) => t.readOnly ? !1 : (e(t.update(K$(t, (r, n) => { let i = /^\s*/.exec(r.text)[0]; if (!i) return; - let s = ou(i, t.tabSize), a = 0, o = Xx(t, Math.max(0, s - xT(t))); + let s = iu(i, t.tabSize), a = 0, o = Gx(t, Math.max(0, s - yT(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), AAe = [ - { key: "Ctrl-b", run: cB, shift: hoe, preventDefault: !0 }, - { key: "Ctrl-f", run: toe, shift: foe }, - { key: "Ctrl-p", run: ioe, shift: goe }, - { key: "Ctrl-n", run: soe, shift: moe }, - { key: "Ctrl-a", run: K6e, shift: uAe }, - { key: "Ctrl-e", run: J6e, shift: hAe }, - { key: "Ctrl-d", run: boe }, - { key: "Ctrl-h", run: b9 }, - { key: "Ctrl-k", run: vAe }, - { key: "Ctrl-Alt-h", run: woe }, - { key: "Ctrl-o", run: xAe }, - { key: "Ctrl-t", run: wAe }, - { key: "Ctrl-v", run: y9 } -], RAe = /* @__PURE__ */ [ - { key: "ArrowLeft", run: cB, shift: hoe, preventDefault: !0 }, - { key: "Mod-ArrowLeft", mac: "Alt-ArrowLeft", run: W6e, shift: rAe, preventDefault: !0 }, - { mac: "Cmd-ArrowLeft", run: j6e, shift: lAe, preventDefault: !0 }, - { key: "ArrowRight", run: toe, shift: foe, preventDefault: !0 }, - { key: "Mod-ArrowRight", mac: "Alt-ArrowRight", run: Y6e, shift: nAe, preventDefault: !0 }, - { mac: "Cmd-ArrowRight", run: Z6e, shift: cAe, preventDefault: !0 }, - { key: "ArrowUp", run: ioe, shift: goe, preventDefault: !0 }, - { mac: "Cmd-ArrowUp", run: lY, shift: uY }, - { mac: "Ctrl-ArrowUp", run: sY, shift: aY }, - { key: "ArrowDown", run: soe, shift: moe, preventDefault: !0 }, - { mac: "Cmd-ArrowDown", run: cY, shift: hY }, - { mac: "Ctrl-ArrowDown", run: y9, shift: oY }, - { key: "PageUp", run: sY, shift: aY }, - { key: "PageDown", run: y9, shift: oY }, - { key: "Home", run: coe, shift: oAe, preventDefault: !0 }, - { key: "Mod-Home", run: lY, shift: uY }, - { key: "End", run: loe, shift: aAe, preventDefault: !0 }, - { key: "Mod-End", run: cY, shift: hY }, - { key: "Enter", run: Soe }, - { key: "Mod-a", run: fAe }, - { key: "Backspace", run: b9, shift: b9 }, - { key: "Delete", run: boe }, - { key: "Mod-Backspace", mac: "Alt-Backspace", run: woe }, - { key: "Mod-Delete", mac: "Alt-Delete", run: mAe }, - { mac: "Mod-Backspace", run: yAe }, - { mac: "Mod-Delete", run: bAe } -].concat(/* @__PURE__ */ AAe.map((t) => ({ mac: t.key, run: t.run, shift: t.shift }))), fY = /* @__PURE__ */ [ - { key: "Alt-ArrowLeft", mac: "Ctrl-ArrowLeft", run: H6e, shift: iAe }, - { key: "Alt-ArrowRight", mac: "Ctrl-ArrowRight", run: X6e, shift: sAe }, - { key: "Alt-ArrowUp", run: OAe }, - { key: "Shift-Alt-ArrowUp", run: SAe }, - { key: "Alt-ArrowDown", run: kAe }, - { key: "Shift-Alt-ArrowDown", run: TAe }, - { key: "Escape", run: gAe }, - { key: "Mod-Enter", run: _Ae }, - { key: "Alt-l", mac: "Ctrl-l", run: dAe }, - { key: "Mod-i", run: pAe, preventDefault: !0 }, - { key: "Mod-[", run: fB }, - { key: "Mod-]", run: hB }, - { key: "Mod-Alt-\\", run: Coe }, - { key: "Shift-Mod-k", run: CAe }, - { key: "Shift-Mod-\\", run: tAe }, - { key: "Mod-/", run: T6e }, - { key: "Alt-A", run: E6e } -].concat(RAe), LAe = { key: "Tab", run: hB, shift: fB }; +}), { userEvent: "delete.dedent" })), !0), vAe = [ + { key: "Ctrl-b", run: Z$, shift: roe, preventDefault: !0 }, + { key: "Ctrl-f", run: Yae, shift: noe }, + { key: "Ctrl-p", run: Xae, shift: aoe }, + { key: "Ctrl-n", run: jae, shift: ooe }, + { key: "Ctrl-a", run: z6e, shift: K6e }, + { key: "Ctrl-e", run: q6e, shift: J6e }, + { key: "Ctrl-d", run: uoe }, + { key: "Ctrl-h", run: p9 }, + { key: "Ctrl-k", run: sAe }, + { key: "Ctrl-Alt-h", run: foe }, + { key: "Ctrl-o", run: lAe }, + { key: "Ctrl-t", run: cAe }, + { key: "Ctrl-v", run: d9 } +], yAe = /* @__PURE__ */ [ + { key: "ArrowLeft", run: Z$, shift: roe, preventDefault: !0 }, + { key: "Mod-ArrowLeft", mac: "Alt-ArrowLeft", run: D6e, shift: V6e, preventDefault: !0 }, + { mac: "Cmd-ArrowLeft", run: B6e, shift: j6e, preventDefault: !0 }, + { key: "ArrowRight", run: Yae, shift: noe, preventDefault: !0 }, + { key: "Mod-ArrowRight", mac: "Alt-ArrowRight", run: P6e, shift: W6e, preventDefault: !0 }, + { mac: "Cmd-ArrowRight", run: F6e, shift: Z6e, preventDefault: !0 }, + { key: "ArrowUp", run: Xae, shift: aoe, preventDefault: !0 }, + { mac: "Cmd-ArrowUp", run: XW, shift: ZW }, + { mac: "Ctrl-ArrowUp", run: YW, shift: GW }, + { key: "ArrowDown", run: jae, shift: ooe, preventDefault: !0 }, + { mac: "Cmd-ArrowDown", run: jW, shift: KW }, + { mac: "Ctrl-ArrowDown", run: d9, shift: HW }, + { key: "PageUp", run: YW, shift: GW }, + { key: "PageDown", run: d9, shift: HW }, + { key: "Home", run: eoe, shift: X6e, preventDefault: !0 }, + { key: "Mod-Home", run: XW, shift: ZW }, + { key: "End", run: Jae, shift: H6e, preventDefault: !0 }, + { key: "Mod-End", run: jW, shift: KW }, + { key: "Enter", run: goe }, + { key: "Mod-a", run: eAe }, + { key: "Backspace", run: p9, shift: p9 }, + { key: "Delete", run: uoe }, + { key: "Mod-Backspace", mac: "Alt-Backspace", run: foe }, + { key: "Mod-Delete", mac: "Alt-Delete", run: iAe }, + { mac: "Mod-Backspace", run: aAe }, + { mac: "Mod-Delete", run: oAe } +].concat(/* @__PURE__ */ vAe.map((t) => ({ mac: t.key, run: t.run, shift: t.shift }))), JW = /* @__PURE__ */ [ + { key: "Alt-ArrowLeft", mac: "Ctrl-ArrowLeft", run: I6e, shift: Y6e }, + { key: "Alt-ArrowRight", mac: "Ctrl-ArrowRight", run: $6e, shift: G6e }, + { key: "Alt-ArrowUp", run: uAe }, + { key: "Shift-Alt-ArrowUp", run: fAe }, + { key: "Alt-ArrowDown", run: hAe }, + { key: "Shift-Alt-ArrowDown", run: dAe }, + { key: "Escape", run: nAe }, + { key: "Mod-Enter", run: mAe }, + { key: "Alt-l", mac: "Ctrl-l", run: tAe }, + { key: "Mod-i", run: rAe, preventDefault: !0 }, + { key: "Mod-[", run: eB }, + { key: "Mod-]", run: J$ }, + { key: "Mod-Alt-\\", run: voe }, + { key: "Shift-Mod-k", run: pAe }, + { key: "Shift-Mod-\\", run: Q6e }, + { key: "Mod-/", run: d6e }, + { key: "Alt-A", run: g6e } +].concat(yAe), bAe = { key: "Tab", run: J$, shift: eB }; function Gn() { var t = arguments[0]; typeof t == "string" && (t = document.createElement(t)); @@ -14187,10 +14187,10 @@ function Gn() { e++; } for (; e < arguments.length; e++) - Eoe(t, arguments[e]); + yoe(t, arguments[e]); return t; } -function Eoe(t, e) { +function yoe(t, e) { if (typeof e == "string") t.appendChild(document.createTextNode(e)); else if (e != null) @@ -14198,14 +14198,14 @@ function Eoe(t, e) { t.appendChild(e); else if (Array.isArray(e)) for (var r = 0; r < e.length; r++) - Eoe(t, e[r]); + yoe(t, e[r]); else throw new RangeError("Unsupported child node: " + e); } -const dY = typeof String.prototype.normalize == "function" ? (t) => t.normalize("NFKD") : (t) => t; -class wv { +const eY = typeof String.prototype.normalize == "function" ? (t) => t.normalize("NFKD") : (t) => t; +class vv { 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(dY(o)) : dY, 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(eY(o)) : eY, this.query = this.normalize(r); } peek() { if (this.bufferPos == this.buffer.length) { @@ -14213,7 +14213,7 @@ class wv { return -1; this.bufferPos = 0, this.buffer = this.iter.value; } - return Gl(this.buffer, this.bufferPos); + return Vl(this.buffer, this.bufferPos); } next() { for (; this.matches.length; ) @@ -14225,8 +14225,8 @@ class wv { let e = this.peek(); if (e < 0) return this.done = !0, this; - let r = M$(e), n = this.bufferStart + this.bufferPos; - this.bufferPos += sf(e); + let r = x$(e), n = this.bufferStart + this.bufferPos; + this.bufferPos += nf(e); let i = this.normalize(r); for (let s = 0, a = n; ; s++) { let o = i.charCodeAt(s), l = this.match(o, a); @@ -14248,17 +14248,17 @@ class wv { 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" && (wv.prototype[Symbol.iterator] = function() { +typeof Symbol < "u" && (vv.prototype[Symbol.iterator] = function() { return this; }); -const _oe = { from: -1, to: -1, match: /* @__PURE__ */ /.*/.exec("") }, dB = "gm" + (/x/.unicode == null ? "" : "u"); -class pB { +const boe = { from: -1, to: -1, match: /* @__PURE__ */ /.*/.exec("") }, tB = "gm" + (/x/.unicode == null ? "" : "u"); +class rB { constructor(e, r, n, i = 0, s = e.length) { - if (this.text = e, this.to = s, this.curLine = "", this.done = !1, this.value = _oe, /\\[sWDnr]|\n|\r|\[\^/.test(r)) - return new Aoe(e, r, n, i, s); - this.re = new RegExp(r, dB + (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 = boe, /\\[sWDnr]|\n|\r|\[\^/.test(r)) + return new xoe(e, r, n, i, s); + this.re = new RegExp(r, tB + (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 = kT(e, i), this.getLine(this.curLineStart); + this.curLineStart = a.from, this.matchPos = wT(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()); @@ -14272,7 +14272,7 @@ class pB { 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 = kT(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 = wT(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) @@ -14282,8 +14282,8 @@ class pB { } } } -const d8 = /* @__PURE__ */ new WeakMap(); -class I1 { +const o8 = /* @__PURE__ */ new WeakMap(); +class M1 { constructor(e, r) { this.from = e, this.text = r; } @@ -14291,20 +14291,20 @@ class I1 { return this.from + this.text.length; } static get(e, r, n) { - let i = d8.get(e); + let i = o8.get(e); if (!i || i.from >= n || i.to <= r) { - let o = new I1(r, e.sliceString(r, n)); - return d8.set(e, o), o; + let o = new M1(r, e.sliceString(r, n)); + return o8.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)), d8.set(e, new I1(a, s)), new I1(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)), o8.set(e, new M1(a, s)), new M1(r, s.slice(r - a, n - a)); } } -class Aoe { +class xoe { constructor(e, r, n, i, s) { - this.text = e, this.to = s, this.done = !1, this.value = _oe, this.matchPos = kT(e, i), this.re = new RegExp(r, dB + (n != null && n.ignoreCase ? "i" : "")), this.test = n == null ? void 0 : n.test, this.flat = I1.get(e, i, this.chunkEnd(i + 5e3)); + this.text = e, this.to = s, this.done = !1, this.value = boe, this.matchPos = wT(e, i), this.re = new RegExp(r, tB + (n != null && n.ignoreCase ? "i" : "")), this.test = n == null ? void 0 : n.test, this.flat = M1.get(e, i, this.chunkEnd(i + 5e3)); } chunkEnd(e) { return e >= this.to ? this.to : this.text.lineAt(e).to; @@ -14315,25 +14315,25 @@ class Aoe { 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 = kT(this.text, i + (n == i ? 1 : 0)), this; + return this.value = { from: n, to: i, match: r }, this.matchPos = wT(this.text, i + (n == i ? 1 : 0)), this; } if (this.flat.to == this.to) return this.done = !0, this; - this.flat = I1.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + this.flat.text.length * 2)); + this.flat = M1.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + this.flat.text.length * 2)); } } } -typeof Symbol < "u" && (pB.prototype[Symbol.iterator] = Aoe.prototype[Symbol.iterator] = function() { +typeof Symbol < "u" && (rB.prototype[Symbol.iterator] = xoe.prototype[Symbol.iterator] = function() { return this; }); -function MAe(t) { +function xAe(t) { try { - return new RegExp(t, dB), !0; + return new RegExp(t, tB), !0; } catch { return !1; } } -function kT(t, e) { +function wT(t, e) { if (e >= t.length) return e; let r = t.lineAt(e), n; @@ -14341,11 +14341,11 @@ function kT(t, e) { e++; return e; } -function x9(t) { +function g9(t) { let e = String(t.state.doc.lineAt(t.state.selection.main.head).number), r = Gn("input", { class: "cm-textfield", name: "line", value: e }), n = Gn("form", { class: "cm-gotoLine", onkeydown: (s) => { - s.keyCode == 27 ? (s.preventDefault(), t.dispatch({ effects: ST.of(!1) }), t.focus()) : s.keyCode == 13 && (s.preventDefault(), i()); + s.keyCode == 27 ? (s.preventDefault(), t.dispatch({ effects: OT.of(!1) }), t.focus()) : s.keyCode == 13 && (s.preventDefault(), i()); }, onsubmit: (s) => { s.preventDefault(), i(); @@ -14363,60 +14363,60 @@ function x9(t) { u && l && (p = p * (l == "-" ? -1 : 1) + o.number); let g = a.doc.line(Math.max(1, Math.min(a.doc.lines, p))), m = ft.cursor(g.from + Math.max(0, Math.min(d, g.length))); t.dispatch({ - effects: [ST.of(!1), Mt.scrollIntoView(m.from, { y: "center" })], + effects: [OT.of(!1), Mt.scrollIntoView(m.from, { y: "center" })], selection: m }), t.focus(); } return { dom: n }; } -const ST = /* @__PURE__ */ _r.define(), pY = /* @__PURE__ */ ai.define({ +const OT = /* @__PURE__ */ _r.define(), tY = /* @__PURE__ */ ai.define({ create() { return !0; }, update(t, e) { for (let r of e.effects) - r.is(ST) && (t = r.value); + r.is(OT) && (t = r.value); return t; }, - provide: (t) => yg.from(t, (e) => e ? x9 : null) -}), DAe = (t) => { - let e = Wx(t, x9); + provide: (t) => pg.from(t, (e) => e ? g9 : null) +}), wAe = (t) => { + let e = Qx(t, g9); if (!e) { - let r = [ST.of(!0)]; - t.state.field(pY, !1) == null && r.push(_r.appendConfig.of([pY, PAe])), t.dispatch({ effects: r }), e = Wx(t, x9); + let r = [OT.of(!0)]; + t.state.field(tY, !1) == null && r.push(_r.appendConfig.of([tY, OAe])), t.dispatch({ effects: r }), e = Qx(t, g9); } return e && e.dom.querySelector("input").select(), !0; -}, PAe = /* @__PURE__ */ Mt.baseTheme({ +}, OAe = /* @__PURE__ */ Mt.baseTheme({ ".cm-panel.cm-gotoLine": { padding: "2px 6px 4px", "& label": { fontSize: "80%" } } -}), NAe = { +}), kAe = { highlightWordAroundCursor: !1, minSelectionLength: 1, maxMatches: 100, wholeWords: !1 -}, Roe = /* @__PURE__ */ Gt.define({ +}, woe = /* @__PURE__ */ Gt.define({ combine(t) { - return Ah(t, NAe, { + return Th(t, kAe, { highlightWordAroundCursor: (e, r) => e || r, minSelectionLength: Math.min, maxMatches: Math.min }); } }); -function IAe(t) { - let e = [qAe, zAe]; - return t && e.push(Roe.of(t)), e; +function SAe(t) { + let e = [AAe, _Ae]; + return t && e.push(woe.of(t)), e; } -const $Ae = /* @__PURE__ */ Ht.mark({ class: "cm-selectionMatch" }), BAe = /* @__PURE__ */ Ht.mark({ class: "cm-selectionMatch cm-selectionMatch-main" }); -function gY(t, e, r, n) { +const TAe = /* @__PURE__ */ Ht.mark({ class: "cm-selectionMatch" }), CAe = /* @__PURE__ */ Ht.mark({ class: "cm-selectionMatch cm-selectionMatch-main" }); +function rY(t, e, r, n) { return (r == 0 || t(e.sliceDoc(r - 1, r)) != li.Word) && (n == e.doc.length || t(e.sliceDoc(n, n + 1)) != li.Word); } -function FAe(t, e, r, n) { +function EAe(t, e, r, n) { return t(e.sliceDoc(r, r + 1)) == li.Word && t(e.sliceDoc(n - 1, n)) == li.Word; } -const zAe = /* @__PURE__ */ fn.fromClass(class { +const _Ae = /* @__PURE__ */ fn.fromClass(class { constructor(t) { this.decorations = this.getDeco(t); } @@ -14424,7 +14424,7 @@ const zAe = /* @__PURE__ */ fn.fromClass(class { (t.selectionSet || t.docChanged || t.viewportChanged) && (this.decorations = this.getDeco(t.view)); } getDeco(t) { - let e = t.state.facet(Roe), { state: r } = t, n = r.selection; + let e = t.state.facet(woe), { state: r } = t, n = r.selection; if (n.ranges.length > 1) return Ht.none; let i = n.main, s, a = null; @@ -14440,17 +14440,17 @@ const zAe = /* @__PURE__ */ fn.fromClass(class { if (l < e.minSelectionLength || l > 200) return Ht.none; if (e.wholeWords) { - if (s = r.sliceDoc(i.from, i.to), a = r.charCategorizer(i.head), !(gY(a, r, i.from, i.to) && FAe(a, r, i.from, i.to))) + if (s = r.sliceDoc(i.from, i.to), a = r.charCategorizer(i.head), !(rY(a, r, i.from, i.to) && EAe(a, r, i.from, i.to))) return Ht.none; } else if (s = r.sliceDoc(i.from, i.to).trim(), !s) return Ht.none; } let o = []; for (let l of t.visibleRanges) { - let u = new wv(r.doc, s, l.from, l.to); + let u = new vv(r.doc, s, l.from, l.to); for (; !u.next().done; ) { let { from: h, to: f } = u.value; - if ((!a || gY(a, r, h, f)) && (i.empty && h <= i.from && f >= i.to ? o.push(BAe.range(h, f)) : (h >= i.to || f <= i.from) && o.push($Ae.range(h, f)), o.length > e.maxMatches)) + if ((!a || rY(a, r, h, f)) && (i.empty && h <= i.from && f >= i.to ? o.push(CAe.range(h, f)) : (h >= i.to || f <= i.from) && o.push(TAe.range(h, f)), o.length > e.maxMatches)) return Ht.none; } } @@ -14458,20 +14458,20 @@ const zAe = /* @__PURE__ */ fn.fromClass(class { } }, { decorations: (t) => t.decorations -}), qAe = /* @__PURE__ */ Mt.baseTheme({ +}), AAe = /* @__PURE__ */ Mt.baseTheme({ ".cm-selectionMatch": { backgroundColor: "#99ff7780" }, ".cm-searchMatch .cm-selectionMatch": { backgroundColor: "transparent" } -}), UAe = ({ state: t, dispatch: e }) => { +}), RAe = ({ state: t, dispatch: e }) => { let { selection: r } = t, n = ft.create(r.ranges.map((i) => t.wordAt(i.head) || ft.cursor(i.head)), r.mainIndex); return n.eq(r) ? !1 : (e(t.update({ selection: n })), !0); }; -function QAe(t, e) { +function LAe(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 wv(t.doc, e, n[n.length - 1].to); ; ) + for (let a = !1, o = new vv(t.doc, e, n[n.length - 1].to); ; ) if (o.next(), o.done) { if (a) return null; - o = new wv(t.doc, e, 0, Math.max(0, n[n.length - 1].from - 1)), a = !0; + o = new vv(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; @@ -14483,34 +14483,34 @@ function QAe(t, e) { return o.value; } } -const VAe = ({ state: t, dispatch: e }) => { +const MAe = ({ state: t, dispatch: e }) => { let { ranges: r } = t.selection; if (r.some((s) => s.from === s.to)) - return UAe({ state: t, dispatch: e }); + return RAe({ 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 = QAe(t, n); + let i = LAe(t, n); return i ? (e(t.update({ selection: t.selection.addRange(ft.range(i.from, i.to), !1), effects: Mt.scrollIntoView(i.to) })), !0) : !1; -}, Fy = /* @__PURE__ */ Gt.define({ +}, Py = /* @__PURE__ */ Gt.define({ combine(t) { - return Ah(t, { + return Th(t, { top: !1, caseSensitive: !1, literal: !1, regexp: !1, wholeWord: !1, - createPanel: (e) => new r7e(e), + createPanel: (e) => new VAe(e), scrollToMatch: (e) => Mt.scrollIntoView(e) }); } }); -class gB { +class nB { 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 || MAe(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 || xAe(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" ? ` @@ -14520,35 +14520,35 @@ class gB { 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 HAe(this) : new YAe(this); + return this.regexp ? new IAe(this) : new PAe(this); } getCursor(e, r = 0, n) { let i = e.doc ? e : qr.create({ doc: e }); - return n == null && (n = i.doc.length), this.regexp ? s1(this, i, r, n) : i1(this, i, r, n); + return n == null && (n = i.doc.length), this.regexp ? r1(this, i, r, n) : t1(this, i, r, n); } } -class Loe { +class Ooe { constructor(e) { this.spec = e; } } -function i1(t, e, r, n) { - return new wv(e.doc, t.unquoted, r, n, t.caseSensitive ? void 0 : (i) => i.toLowerCase(), t.wholeWord ? WAe(e.doc, e.charCategorizer(e.selection.main.head)) : void 0); +function t1(t, e, r, n) { + return new vv(e.doc, t.unquoted, r, n, t.caseSensitive ? void 0 : (i) => i.toLowerCase(), t.wholeWord ? DAe(e.doc, e.charCategorizer(e.selection.main.head)) : void 0); } -function WAe(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(TT(i, r - s)) != li.Word || e(CT(i, r - s)) != li.Word) && (e(CT(i, n - s)) != li.Word || e(TT(i, n - s)) != li.Word)); +function DAe(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(kT(i, r - s)) != li.Word || e(ST(i, r - s)) != li.Word) && (e(ST(i, n - s)) != li.Word || e(kT(i, n - s)) != li.Word)); } -class YAe extends Loe { +class PAe extends Ooe { constructor(e) { super(e); } nextMatch(e, r, n) { - let i = i1(this.spec, e, n, e.doc.length).nextOverlapping(); - return i.done && (i = i1(this.spec, e, 0, r).nextOverlapping()), i.done ? null : i.value; + let i = t1(this.spec, e, n, e.doc.length).nextOverlapping(); + return i.done && (i = t1(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 = i1(this.spec, e, s, i), o = null; + let s = Math.max(r, i - 1e4 - this.spec.unquoted.length), a = t1(this.spec, e, s, i), o = null; for (; !a.nextOverlapping().done; ) o = a.value; if (o) @@ -14565,7 +14565,7 @@ class YAe extends Loe { return this.spec.unquote(this.spec.replace); } matchAll(e, r) { - let n = i1(this.spec, e, 0, e.doc.length), i = []; + let n = t1(this.spec, e, 0, e.doc.length), i = []; for (; !n.next().done; ) { if (i.length >= r) return null; @@ -14574,34 +14574,34 @@ class YAe extends Loe { return i; } highlight(e, r, n, i) { - let s = i1(this.spec, e, Math.max(0, r - this.spec.unquoted.length), Math.min(n + this.spec.unquoted.length, e.doc.length)); + let s = t1(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 s1(t, e, r, n) { - return new pB(e.doc, t.search, { +function r1(t, e, r, n) { + return new rB(e.doc, t.search, { ignoreCase: !t.caseSensitive, - test: t.wholeWord ? GAe(e.charCategorizer(e.selection.main.head)) : void 0 + test: t.wholeWord ? NAe(e.charCategorizer(e.selection.main.head)) : void 0 }, r, n); } -function TT(t, e) { - return t.slice(la(t, e, !1), e); +function kT(t, e) { + return t.slice(oa(t, e, !1), e); } -function CT(t, e) { - return t.slice(e, la(t, e)); +function ST(t, e) { + return t.slice(e, oa(t, e)); } -function GAe(t) { - return (e, r, n) => !n[0].length || (t(TT(n.input, n.index)) != li.Word || t(CT(n.input, n.index)) != li.Word) && (t(CT(n.input, n.index + n[0].length)) != li.Word || t(TT(n.input, n.index + n[0].length)) != li.Word); +function NAe(t) { + return (e, r, n) => !n[0].length || (t(kT(n.input, n.index)) != li.Word || t(ST(n.input, n.index)) != li.Word) && (t(ST(n.input, n.index + n[0].length)) != li.Word || t(kT(n.input, n.index + n[0].length)) != li.Word); } -class HAe extends Loe { +class IAe extends Ooe { nextMatch(e, r, n) { - let i = s1(this.spec, e, n, e.doc.length).next(); - return i.done && (i = s1(this.spec, e, 0, r).next()), i.done ? null : i.value; + let i = r1(this.spec, e, n, e.doc.length).next(); + return i.done && (i = r1(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 = s1(this.spec, e, s, n), o = null; + let s = Math.max(r, n - i * 1e4), a = r1(this.spec, e, s, n), o = null; for (; !a.next().done; ) o = a.value; if (o && (s == r || o.from > s + 10)) @@ -14617,7 +14617,7 @@ class HAe extends Loe { 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 = s1(this.spec, e, 0, e.doc.length), i = []; + let n = r1(this.spec, e, 0, e.doc.length), i = []; for (; !n.next().done; ) { if (i.length >= r) return null; @@ -14626,46 +14626,46 @@ class HAe extends Loe { return i; } highlight(e, r, n, i) { - let s = s1(this.spec, e, Math.max(0, r - 250), Math.min(n + 250, e.doc.length)); + let s = r1(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 mp = /* @__PURE__ */ _r.define(), mB = /* @__PURE__ */ _r.define(), Wd = /* @__PURE__ */ ai.define({ +const hp = /* @__PURE__ */ _r.define(), iB = /* @__PURE__ */ _r.define(), Ud = /* @__PURE__ */ ai.define({ create(t) { - return new p8(w9(t).create(), null); + return new l8(m9(t).create(), null); }, update(t, e) { for (let r of e.effects) - r.is(mp) ? t = new p8(r.value.create(), t.panel) : r.is(mB) && (t = new p8(t.query, r.value ? vB : null)); + r.is(hp) ? t = new l8(r.value.create(), t.panel) : r.is(iB) && (t = new l8(t.query, r.value ? sB : null)); return t; }, - provide: (t) => yg.from(t, (e) => e.panel) + provide: (t) => pg.from(t, (e) => e.panel) }); -class p8 { +class l8 { constructor(e, r) { this.query = e, this.panel = r; } } -const XAe = /* @__PURE__ */ Ht.mark({ class: "cm-searchMatch" }), jAe = /* @__PURE__ */ Ht.mark({ class: "cm-searchMatch cm-searchMatch-selected" }), ZAe = /* @__PURE__ */ fn.fromClass(class { +const $Ae = /* @__PURE__ */ Ht.mark({ class: "cm-searchMatch" }), BAe = /* @__PURE__ */ Ht.mark({ class: "cm-searchMatch cm-searchMatch-selected" }), FAe = /* @__PURE__ */ fn.fromClass(class { constructor(t) { - this.view = t, this.decorations = this.highlight(t.state.field(Wd)); + this.view = t, this.decorations = this.highlight(t.state.field(Ud)); } update(t) { - let e = t.state.field(Wd); - (e != t.startState.field(Wd) || t.docChanged || t.selectionSet || t.viewportChanged) && (this.decorations = this.highlight(e)); + let e = t.state.field(Ud); + (e != t.startState.field(Ud) || t.docChanged || t.selectionSet || t.viewportChanged) && (this.decorations = this.highlight(e)); } highlight({ query: t, panel: e }) { if (!e || !t.spec.valid) return Ht.none; - let { view: r } = this, n = new is(); + let { view: r } = this, n = new rs(); 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 ? jAe : XAe); + n.add(u, h, f ? BAe : $Ae); }); } return n.finish(); @@ -14673,44 +14673,44 @@ const XAe = /* @__PURE__ */ Ht.mark({ class: "cm-searchMatch" }), jAe = /* @__PU }, { decorations: (t) => t.decorations }); -function Sk(t) { +function wk(t) { return (e) => { - let r = e.state.field(Wd, !1); - return r && r.query.spec.valid ? t(e, r) : Poe(e); + let r = e.state.field(Ud, !1); + return r && r.query.spec.valid ? t(e, r) : Toe(e); }; } -const ET = /* @__PURE__ */ Sk((t, { query: e }) => { +const TT = /* @__PURE__ */ wk((t, { query: e }) => { let { to: r } = t.state.selection.main, n = e.nextMatch(t.state, r, r); if (!n) return !1; - let i = ft.single(n.from, n.to), s = t.state.facet(Fy); + let i = ft.single(n.from, n.to), s = t.state.facet(Py); return t.dispatch({ selection: i, - effects: [yB(t, n), s.scrollToMatch(i.main, t)], + effects: [aB(t, n), s.scrollToMatch(i.main, t)], userEvent: "select.search" - }), Doe(t), !0; -}), _T = /* @__PURE__ */ Sk((t, { query: e }) => { + }), Soe(t), !0; +}), CT = /* @__PURE__ */ wk((t, { query: e }) => { let { state: r } = t, { from: n } = r.selection.main, i = e.prevMatch(r, n, n); if (!i) return !1; - let s = ft.single(i.from, i.to), a = t.state.facet(Fy); + let s = ft.single(i.from, i.to), a = t.state.facet(Py); return t.dispatch({ selection: s, - effects: [yB(t, i), a.scrollToMatch(s.main, t)], + effects: [aB(t, i), a.scrollToMatch(s.main, t)], userEvent: "select.search" - }), Doe(t), !0; -}), KAe = /* @__PURE__ */ Sk((t, { query: e }) => { + }), Soe(t), !0; +}), zAe = /* @__PURE__ */ wk((t, { query: e }) => { let r = e.matchAll(t.state, 1e3); return !r || !r.length ? !1 : (t.dispatch({ selection: ft.create(r.map((n) => ft.range(n.from, n.to))), userEvent: "select.search.matches" }), !0); -}), JAe = ({ state: t, dispatch: e }) => { +}), qAe = ({ 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 wv(t.doc, t.sliceDoc(n, i)); !o.next().done; ) { + for (let o = new vv(t.doc, t.sliceDoc(n, i)); !o.next().done; ) { if (s.length > 1e3) return !1; o.value.from == n && (a = s.length), s.push(ft.range(o.value.from, o.value.to)); @@ -14719,7 +14719,7 @@ const ET = /* @__PURE__ */ Sk((t, { query: e }) => { selection: ft.create(s, a), userEvent: "select.search.matches" })), !0; -}, mY = /* @__PURE__ */ Sk((t, { query: e }) => { +}, nY = /* @__PURE__ */ wk((t, { query: e }) => { let { state: r } = t, { from: n, to: i } = r.selection.main; if (r.readOnly) return !1; @@ -14729,7 +14729,7 @@ const ET = /* @__PURE__ */ Sk((t, { query: e }) => { 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(Mt.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 = ft.single(s.from - h, s.to - h), u.push(yB(t, s)), u.push(r.facet(Fy).scrollToMatch(o.main, t)); + o = ft.single(s.from - h, s.to - h), u.push(aB(t, s)), u.push(r.facet(Py).scrollToMatch(o.main, t)); } return t.dispatch({ changes: a, @@ -14737,7 +14737,7 @@ const ET = /* @__PURE__ */ Sk((t, { query: e }) => { effects: u, userEvent: "input.replace" }), !0; -}), e7e = /* @__PURE__ */ Sk((t, { query: e }) => { +}), UAe = /* @__PURE__ */ wk((t, { query: e }) => { if (t.state.readOnly) return !1; let r = e.matchAll(t.state, 1e9).map((i) => { @@ -14753,16 +14753,16 @@ const ET = /* @__PURE__ */ Sk((t, { query: e }) => { userEvent: "input.replace.all" }), !0; }); -function vB(t) { - return t.state.facet(Fy).createPanel(t); +function sB(t) { + return t.state.facet(Py).createPanel(t); } -function w9(t, e) { +function m9(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(Fy); - return new gB({ + let u = t.facet(Py); + return new nB({ 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, @@ -14770,51 +14770,51 @@ function w9(t, e) { wholeWord: (a = e == null ? void 0 : e.wholeWord) !== null && a !== void 0 ? a : u.wholeWord }); } -function Moe(t) { - let e = Wx(t, vB); +function koe(t) { + let e = Qx(t, sB); return e && e.dom.querySelector("[main-field]"); } -function Doe(t) { - let e = Moe(t); +function Soe(t) { + let e = koe(t); e && e == t.root.activeElement && e.select(); } -const Poe = (t) => { - let e = t.state.field(Wd, !1); +const Toe = (t) => { + let e = t.state.field(Ud, !1); if (e && e.panel) { - let r = Moe(t); + let r = koe(t); if (r && r != t.root.activeElement) { - let n = w9(t.state, e.query.spec); - n.valid && t.dispatch({ effects: mp.of(n) }), r.focus(), r.select(); + let n = m9(t.state, e.query.spec); + n.valid && t.dispatch({ effects: hp.of(n) }), r.focus(), r.select(); } } else t.dispatch({ effects: [ - mB.of(!0), - e ? mp.of(w9(t.state, e.query.spec)) : _r.appendConfig.of(i7e) + iB.of(!0), + e ? hp.of(m9(t.state, e.query.spec)) : _r.appendConfig.of(YAe) ] }); return !0; -}, Noe = (t) => { - let e = t.state.field(Wd, !1); +}, Coe = (t) => { + let e = t.state.field(Ud, !1); if (!e || !e.panel) return !1; - let r = Wx(t, vB); - return r && r.dom.contains(t.root.activeElement) && t.focus(), t.dispatch({ effects: mB.of(!1) }), !0; -}, t7e = [ - { key: "Mod-f", run: Poe, scope: "editor search-panel" }, - { key: "F3", run: ET, shift: _T, scope: "editor search-panel", preventDefault: !0 }, - { key: "Mod-g", run: ET, shift: _T, scope: "editor search-panel", preventDefault: !0 }, - { key: "Escape", run: Noe, scope: "editor search-panel" }, - { key: "Mod-Shift-l", run: JAe }, - { key: "Mod-Alt-g", run: DAe }, - { key: "Mod-d", run: VAe, preventDefault: !0 } + let r = Qx(t, sB); + return r && r.dom.contains(t.root.activeElement) && t.focus(), t.dispatch({ effects: iB.of(!1) }), !0; +}, QAe = [ + { key: "Mod-f", run: Toe, scope: "editor search-panel" }, + { key: "F3", run: TT, shift: CT, scope: "editor search-panel", preventDefault: !0 }, + { key: "Mod-g", run: TT, shift: CT, scope: "editor search-panel", preventDefault: !0 }, + { key: "Escape", run: Coe, scope: "editor search-panel" }, + { key: "Mod-Shift-l", run: qAe }, + { key: "Mod-Alt-g", run: wAe }, + { key: "Mod-d", run: MAe, preventDefault: !0 } ]; -class r7e { +class VAe { constructor(e) { this.view = e; - let r = this.query = e.state.field(Wd).query.spec; + let r = this.query = e.state.field(Ud).query.spec; this.commit = this.commit.bind(this), this.searchField = Gn("input", { value: r.search, - placeholder: cl(e, "Find"), - "aria-label": cl(e, "Find"), + placeholder: al(e, "Find"), + "aria-label": al(e, "Find"), class: "cm-textfield", name: "search", form: "", @@ -14823,8 +14823,8 @@ class r7e { onkeyup: this.commit }), this.replaceField = Gn("input", { value: r.replace, - placeholder: cl(e, "Replace"), - "aria-label": cl(e, "Replace"), + placeholder: al(e, "Replace"), + "aria-label": al(e, "Replace"), class: "cm-textfield", name: "replace", form: "", @@ -14854,43 +14854,43 @@ class r7e { } this.dom = Gn("div", { onkeydown: (i) => this.keydown(i), class: "cm-search" }, [ this.searchField, - n("next", () => ET(e), [cl(e, "next")]), - n("prev", () => _T(e), [cl(e, "previous")]), - n("select", () => KAe(e), [cl(e, "all")]), - Gn("label", null, [this.caseField, cl(e, "match case")]), - Gn("label", null, [this.reField, cl(e, "regexp")]), - Gn("label", null, [this.wordField, cl(e, "by word")]), + n("next", () => TT(e), [al(e, "next")]), + n("prev", () => CT(e), [al(e, "previous")]), + n("select", () => zAe(e), [al(e, "all")]), + Gn("label", null, [this.caseField, al(e, "match case")]), + Gn("label", null, [this.reField, al(e, "regexp")]), + Gn("label", null, [this.wordField, al(e, "by word")]), ...e.state.readOnly ? [] : [ Gn("br"), this.replaceField, - n("replace", () => mY(e), [cl(e, "replace")]), - n("replaceAll", () => e7e(e), [cl(e, "replace all")]) + n("replace", () => nY(e), [al(e, "replace")]), + n("replaceAll", () => UAe(e), [al(e, "replace all")]) ], Gn("button", { name: "close", - onclick: () => Noe(e), - "aria-label": cl(e, "close"), + onclick: () => Coe(e), + "aria-label": al(e, "close"), type: "button" }, ["\xD7"]) ]); } commit() { - let e = new gB({ + let e = new nB({ 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: mp.of(e) })); + e.eq(this.query) || (this.query = e, this.view.dispatch({ effects: hp.of(e) })); } keydown(e) { - wEe(this.view, e, "search-panel") ? e.preventDefault() : e.keyCode == 13 && e.target == this.searchField ? (e.preventDefault(), (e.shiftKey ? _T : ET)(this.view)) : e.keyCode == 13 && e.target == this.replaceField && (e.preventDefault(), mY(this.view)); + cEe(this.view, e, "search-panel") ? e.preventDefault() : e.keyCode == 13 && e.target == this.searchField ? (e.preventDefault(), (e.shiftKey ? CT : TT)(this.view)) : e.keyCode == 13 && e.target == this.replaceField && (e.preventDefault(), nY(this.view)); } update(e) { for (let r of e.transactions) for (let n of r.effects) - n.is(mp) && !n.value.eq(this.query) && this.setQuery(n.value); + n.is(hp) && !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; @@ -14902,32 +14902,32 @@ class r7e { return 80; } get top() { - return this.view.state.facet(Fy).top; + return this.view.state.facet(Py).top; } } -function cl(t, e) { +function al(t, e) { return t.state.phrase(e); } -const hS = 30, fS = /[\s\.,:;?!]/; -function yB(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 - hS), a = Math.min(i, r + hS), o = t.state.sliceDoc(s, a); +const lS = 30, cS = /[\s\.,:;?!]/; +function aB(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 - lS), a = Math.min(i, r + lS), o = t.state.sliceDoc(s, a); if (s != n.from) { - for (let l = 0; l < hS; l++) - if (!fS.test(o[l + 1]) && fS.test(o[l])) { + for (let l = 0; l < lS; l++) + if (!cS.test(o[l + 1]) && cS.test(o[l])) { o = o.slice(l); break; } } if (a != i) { - for (let l = o.length - 1; l > o.length - hS; l--) - if (!fS.test(o[l - 1]) && fS.test(o[l])) { + for (let l = o.length - 1; l > o.length - lS; l--) + if (!cS.test(o[l - 1]) && cS.test(o[l])) { o = o.slice(0, l); break; } } return Mt.announce.of(`${t.state.phrase("current match")}. ${o} ${t.state.phrase("on line")} ${n.number}.`); } -const n7e = /* @__PURE__ */ Mt.baseTheme({ +const WAe = /* @__PURE__ */ Mt.baseTheme({ ".cm-panel.cm-search": { padding: "2px 6px 4px", position: "relative", @@ -14956,12 +14956,12 @@ const n7e = /* @__PURE__ */ Mt.baseTheme({ "&dark .cm-searchMatch": { backgroundColor: "#00ffff8a" }, "&light .cm-searchMatch-selected": { backgroundColor: "#ff6a0054" }, "&dark .cm-searchMatch-selected": { backgroundColor: "#ff00ff8a" } -}), i7e = [ - Wd, - /* @__PURE__ */ Va.low(ZAe), - n7e +}), YAe = [ + Ud, + /* @__PURE__ */ qa.low(FAe), + WAe ]; -class i6 { +class e6 { constructor(e, r, n, i) { this.state = e, this.pos = r, this.explicit = n, this.view = i, this.abortListeners = [], this.abortOnDocChange = !1; } @@ -14977,7 +14977,7 @@ class i6 { } : 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($oe(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(_oe(e, !1)); return s < 0 ? null : { from: n + s, to: this.pos, text: i.slice(s) }; } get aborted() { @@ -14987,28 +14987,28 @@ class i6 { e == "abort" && this.abortListeners && (this.abortListeners.push(r), n && n.onDocChange && (this.abortOnDocChange = !0)); } } -function vY(t) { +function iY(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 s7e(t) { +function GAe(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 = vY(e) + vY(r) + "*$"; + let n = iY(e) + iY(r) + "*$"; return [new RegExp("^" + n), new RegExp(n)]; } -function Ioe(t) { - let e = t.map((i) => typeof i == "string" ? { label: i } : i), [r, n] = e.every((i) => /^\w+$/.test(i.label)) ? [/\w*$/, /\w+$/] : s7e(e); +function Eoe(t) { + let e = t.map((i) => typeof i == "string" ? { label: i } : i), [r, n] = e.every((i) => /^\w+$/.test(i.label)) ? [/\w*$/, /\w+$/] : GAe(e); return (i) => { let s = i.matchBefore(n); return s || i.explicit ? { from: s ? s.from : i.pos, options: e, validFor: r } : null; }; } -function a7e(t, e) { +function HAe(t, e) { return (r) => { for (let n = Qn(r.state).resolveInner(r.pos, -1); n; n = n.parent) { if (t.indexOf(n.name) > -1) @@ -15019,21 +15019,21 @@ function a7e(t, e) { return e(r); }; } -class yY { +class sY { constructor(e, r, n, i) { this.completion = e, this.source = r, this.match = n, this.score = i; } } -function rg(t) { +function K0(t) { return t.selection.main.from; } -function $oe(t, e) { +function _oe(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 bB = /* @__PURE__ */ Oo.define(); -function o7e(t, e, r, n) { +const oB = /* @__PURE__ */ bo.define(); +function XAe(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) => { if (o != i && r != n && t.sliceDoc(o.from + s, o.from + a) != t.sliceDoc(r, n)) @@ -15045,22 +15045,22 @@ function o7e(t, e, r, n) { }; })), { scrollIntoView: !0, userEvent: "input.complete" }); } -const bY = /* @__PURE__ */ new WeakMap(); -function l7e(t) { +const aY = /* @__PURE__ */ new WeakMap(); +function jAe(t) { if (!Array.isArray(t)) return t; - let e = bY.get(t); - return e || bY.set(t, e = Ioe(t)), e; + let e = aY.get(t); + return e || aY.set(t, e = Eoe(t)), e; } -const AT = /* @__PURE__ */ _r.define(), Kx = /* @__PURE__ */ _r.define(); -class c7e { +const ET = /* @__PURE__ */ _r.define(), jx = /* @__PURE__ */ _r.define(); +class ZAe { 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 = Gl(e, r), i = sf(n); + let n = Vl(e, r), i = nf(n); this.chars.push(n); let s = e.slice(r, r + i), a = s.toUpperCase(); - this.folded.push(Gl(a == s ? s.toLowerCase() : a, 0)), r += i; + this.folded.push(Vl(a == s ? s.toLowerCase() : a, 0)), r += i; } this.astral = e.length != this.chars.length; } @@ -15074,7 +15074,7 @@ class c7e { return null; let { chars: r, folded: n, any: i, precise: s, byWord: a } = this; if (r.length == 1) { - let b = Gl(e, 0), w = sf(b), O = w == e.length ? 0 : -100; + let b = Vl(e, 0), w = nf(b), O = w == e.length ? 0 : -100; if (b != r[0]) if (b == n[0]) O += -200; @@ -15088,31 +15088,31 @@ class c7e { 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 = Gl(e, b); - (O == r[u] || O == n[u]) && (i[u++] = b), b += sf(O); + let O = Vl(e, b); + (O == r[u] || O == n[u]) && (i[u++] = b), b += nf(O); } if (u < l) return null; } 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 = Gl(e, b); + let S = Vl(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 = M$(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 += sf(S); + let C, T = S < 255 ? S >= 48 && S <= 57 || S >= 97 && S <= 122 ? 2 : S >= 65 && S <= 90 ? 1 : 0 : (C = x$(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 += nf(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 ? null : 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 ? sf(Gl(n, a)) : 1); + let o = a + (this.astral ? nf(Vl(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); } } -class u7e { +class KAe { constructor(e) { this.pattern = e, this.matched = [], this.score = 0, this.folded = e.toLowerCase(); } @@ -15123,9 +15123,9 @@ class u7e { return n == null ? null : (this.matched = [0, r.length], this.score = n + (e.length == this.pattern.length ? 0 : -100), this); } } -const Bs = /* @__PURE__ */ Gt.define({ +const Is = /* @__PURE__ */ Gt.define({ combine(t) { - return Ah(t, { + return Th(t, { activateOnTyping: !0, activateOnCompletion: () => !1, activateOnTypingDelay: 100, @@ -15139,7 +15139,7 @@ const Bs = /* @__PURE__ */ Gt.define({ aboveCursor: !1, icons: !0, addToOptions: [], - positionInfo: h7e, + positionInfo: JAe, filterStrict: !1, compareCompletions: (e, r) => e.label.localeCompare(r.label), interactionDelay: 75, @@ -15148,17 +15148,17 @@ const Bs = /* @__PURE__ */ Gt.define({ defaultKeymap: (e, r) => e && r, closeOnBlur: (e, r) => e && r, icons: (e, r) => e && r, - tooltipClass: (e, r) => (n) => xY(e(n), r(n)), - optionClass: (e, r) => (n) => xY(e(n), r(n)), + tooltipClass: (e, r) => (n) => oY(e(n), r(n)), + optionClass: (e, r) => (n) => oY(e(n), r(n)), addToOptions: (e, r) => e.concat(r), filterStrict: (e, r) => e || r }); } }); -function xY(t, e) { +function oY(t, e) { return t ? e ? t + " " + e : t : e; } -function h7e(t, e, r, n, i, s) { +function JAe(t, e, r, n, i, s) { let a = t.textDirection == Xn.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); @@ -15173,7 +15173,7 @@ function h7e(t, e, r, n, i, s) { class: "cm-completionInfo-" + (l ? a ? "left-narrow" : "right-narrow" : o ? "left" : "right") }; } -function f7e(t) { +function e7e(t) { let e = t.addToOptions.slice(); return t.icons && e.push({ render(r) { @@ -15205,7 +15205,7 @@ function f7e(t) { position: 80 }), e.sort((r, n) => r.position - n.position).map((r) => r.render); } -function g8(t, e, r) { +function c8(t, e, r) { if (t <= r) return { from: 0, to: t }; if (e < 0 && (e = 0), e <= t >> 1) { @@ -15215,15 +15215,15 @@ function g8(t, e, r) { let n = Math.floor((t - e) / r); return { from: t - (n + 1) * r, to: t - n * r }; } -class d7e { +class t7e { 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(Bs); - this.optionContent = f7e(o), this.optionClass = o.optionClass, this.tooltipClass = o.tooltipClass, this.range = g8(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(Is); + this.optionContent = e7e(o), this.optionClass = o.optionClass, this.tooltipClass = o.tooltipClass, this.range = c8(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) { @@ -15232,7 +15232,7 @@ class d7e { } }), this.dom.addEventListener("focusout", (l) => { let u = e.state.field(this.stateField, !1); - u && u.tooltip && e.state.facet(Bs).closeOnBlur && l.relatedTarget != e.contentDOM && e.dispatch({ effects: Kx.of(null) }); + u && u.tooltip && e.state.facet(Is).closeOnBlur && l.relatedTarget != e.contentDOM && e.dispatch({ effects: jx.of(null) }); }), this.showOptions(s, i.id); } mount() { @@ -15248,7 +15248,7 @@ class d7e { 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 = g8(s.length, a, e.state.facet(Bs).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 = c8(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); } } updateTooltipClass(e) { @@ -15266,7 +15266,7 @@ class d7e { } 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 = g8(r.options.length, r.selected, this.view.state.facet(Bs).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 = c8(r.options.length, r.selected, this.view.state.facet(Is).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) @@ -15276,7 +15276,7 @@ class d7e { return; "then" in s ? s.then((a) => { a && this.view.state.field(this.stateField, !1) == e && this.addInfoPane(a, n); - }).catch((a) => Ho(this.view.state, a, "completion info")) : this.addInfoPane(s, n); + }).catch((a) => Wo(this.view.state, a, "completion info")) : this.addInfoPane(s, n); } } addInfoPane(e, r) { @@ -15294,7 +15294,7 @@ class d7e { 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 && g7e(this.list, r), r; + return r && n7e(this.list, r), r; } measureInfo() { let e = this.dom.querySelector("[aria-selected]"); @@ -15305,7 +15305,7 @@ class d7e { 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(Bs).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(Is).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"); @@ -15344,17 +15344,17 @@ class d7e { this.destroyInfo(); } } -function p7e(t, e) { - return (r) => new d7e(r, t, e); +function r7e(t, e) { + return (r) => new t7e(r, t, e); } -function g7e(t, e) { +function n7e(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 wY(t) { +function lY(t) { return (t.boost || 0) * 100 + (t.apply ? 10 : 0) + (t.info ? 5 : 0) + (t.type ? 1 : 0); } -function m7e(t, e) { +function i7e(t, e) { let r = [], n = null, i = (u) => { r.push(u); let { section: h } = u.completion; @@ -15363,19 +15363,19 @@ function m7e(t, e) { let f = typeof h == "string" ? h : h.name; n.some((d) => d.name == f) || n.push(typeof h == "string" ? { name: f } : h); } - }, s = e.facet(Bs); + }, s = e.facet(Is); for (let u of t) if (u.hasResult()) { let h = u.result.getMatch; if (u.result.filter === !1) for (let f of u.result.options) - i(new yY(f, u.source, h ? h(f) : [], 1e9 - r.length)); + i(new sY(f, u.source, h ? h(f) : [], 1e9 - r.length)); else { - let f = e.sliceDoc(u.from, u.to), d, p = s.filterStrict ? new u7e(f) : new c7e(f); + let f = e.sliceDoc(u.from, u.to), d, p = s.filterStrict ? new KAe(f) : new ZAe(f); for (let g of u.result.options) if (d = p.match(g.label)) { let m = g.displayLabel ? h ? h(g, d.matched) : [] : d.matched; - i(new yY(g, u.source, m, d.score + (g.boost || 0))); + i(new sY(g, u.source, m, d.score + (g.boost || 0))); } } } @@ -15394,24 +15394,24 @@ function m7e(t, e) { let a = [], o = null, l = s.compareCompletions; for (let u of r.sort((h, f) => f.score - h.score || l(h.completion, f.completion))) { let h = u.completion; - !o || o.label != h.label || o.detail != h.detail || o.type != null && h.type != null && o.type != h.type || o.apply != h.apply || o.boost != h.boost ? a.push(u) : wY(u.completion) > wY(o) && (a[a.length - 1] = u), o = u.completion; + !o || o.label != h.label || o.detail != h.detail || o.type != null && h.type != null && o.type != h.type || o.apply != h.apply || o.boost != h.boost ? a.push(u) : lY(u.completion) > lY(o) && (a[a.length - 1] = u), o = u.completion; } return a; } -class y1 { +class p1 { 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 y1(this.options, OY(r, e), this.tooltip, this.timestamp, e, this.disabled); + return e == this.selected || e >= this.options.length ? this : new p1(this.options, cY(r, e), this.tooltip, this.timestamp, e, this.disabled); } static build(e, r, n, i, s, a) { if (i && !a && e.some((u) => u.isPending)) return i.setDisabled(); - let o = m7e(e, r); + let o = i7e(e, r); if (!o.length) return i && e.some((u) => u.isPending) ? i.setDisabled() : null; - let l = r.facet(Bs).selectOnOpen ? 0 : -1; + let l = r.facet(Is).selectOnOpen ? 0 : -1; if (i && i.selected != l && i.selected != -1) { let u = i.options[i.selected].completion; for (let h = 0; h < o.length; h++) @@ -15420,43 +15420,43 @@ class y1 { break; } } - return new y1(o, OY(n, l), { + return new p1(o, cY(n, l), { pos: e.reduce((u, h) => h.hasResult() ? Math.min(u, h.from) : u, 1e8), - create: O7e, + create: u7e, above: s.aboveCursor }, i ? i.timestamp : Date.now(), l, !1); } map(e) { - return new y1(this.options, this.attrs, Object.assign(Object.assign({}, this.tooltip), { pos: e.mapPos(this.tooltip.pos) }), this.timestamp, this.selected, this.disabled); + return new p1(this.options, this.attrs, Object.assign(Object.assign({}, this.tooltip), { pos: e.mapPos(this.tooltip.pos) }), this.timestamp, this.selected, this.disabled); } setDisabled() { - return new y1(this.options, this.attrs, this.tooltip, this.timestamp, this.selected, !0); + return new p1(this.options, this.attrs, this.tooltip, this.timestamp, this.selected, !0); } } -class RT { +class _T { constructor(e, r, n) { this.active = e, this.id = r, this.open = n; } static start() { - return new RT(x7e, "cm-ac-" + Math.floor(Math.random() * 2e6).toString(36), null); + return new _T(l7e, "cm-ac-" + Math.floor(Math.random() * 2e6).toString(36), null); } update(e) { - let { state: r } = e, n = r.facet(Bs), s = (n.override || r.languageDataAt("autocomplete", rg(r)).map(l7e)).map((l) => (this.active.find((h) => h.source == l) || new nc(l, this.active.some((h) => h.state != 0) ? 1 : 0)).update(e, n)); + let { state: r } = e, n = r.facet(Is), s = (n.override || r.languageDataAt("autocomplete", K0(r)).map(jAe)).map((l) => (this.active.find((h) => h.source == l) || new ec(l, this.active.some((h) => h.state != 0) ? 1 : 0)).update(e, n)); s.length == this.active.length && s.every((l, u) => l == this.active[u]) && (s = this.active); - let a = this.open, o = e.effects.some((l) => l.is(xB)); - a && e.docChanged && (a = a.map(e.changes)), e.selection || s.some((l) => l.hasResult() && e.changes.touchesRange(l.from, l.to)) || !v7e(s, this.active) || o ? a = y1.build(s, r, this.id, a, n, o) : a && a.disabled && !s.some((l) => l.isPending) && (a = null), !a && s.every((l) => !l.isPending) && s.some((l) => l.hasResult()) && (s = s.map((l) => l.hasResult() ? new nc(l.source, 0) : l)); + let a = this.open, o = e.effects.some((l) => l.is(lB)); + a && e.docChanged && (a = a.map(e.changes)), e.selection || s.some((l) => l.hasResult() && e.changes.touchesRange(l.from, l.to)) || !s7e(s, this.active) || o ? a = p1.build(s, r, this.id, a, n, o) : a && a.disabled && !s.some((l) => l.isPending) && (a = null), !a && s.every((l) => !l.isPending) && s.some((l) => l.hasResult()) && (s = s.map((l) => l.hasResult() ? new ec(l.source, 0) : l)); for (let l of e.effects) - l.is(Foe) && (a = a && a.setSelected(l.value, this.id)); - return s == this.active && a == this.open ? this : new RT(s, this.id, a); + l.is(Roe) && (a = a && a.setSelected(l.value, this.id)); + return s == this.active && a == this.open ? this : new _T(s, this.id, a); } get tooltip() { return this.open ? this.open.tooltip : null; } get attrs() { - return this.open ? this.open.attrs : this.active.length ? y7e : b7e; + return this.open ? this.open.attrs : this.active.length ? a7e : o7e; } } -function v7e(t, e) { +function s7e(t, e) { if (t == e) return !0; for (let r = 0, n = 0; ; ) { @@ -15471,10 +15471,10 @@ function v7e(t, e) { return !1; } } -const y7e = { +const a7e = { "aria-autocomplete": "list" -}, b7e = {}; -function OY(t, e) { +}, o7e = {}; +function cY(t, e) { let r = { "aria-autocomplete": "list", "aria-haspopup": "listbox", @@ -15482,17 +15482,17 @@ function OY(t, e) { }; return e > -1 && (r["aria-activedescendant"] = t + "-" + e), r; } -const x7e = []; -function Boe(t, e) { +const l7e = []; +function Aoe(t, e) { if (t.isUserEvent("input.complete")) { - let n = t.annotation(bB); + let n = t.annotation(oB); if (n && e.activateOnCompletion(n)) return 12; } let r = t.isUserEvent("input.type"); return r && e.activateOnTyping ? 5 : r ? 1 : t.isUserEvent("delete.backward") ? 2 : t.selection ? 8 : t.docChanged ? 16 : 0; } -class nc { +class ec { constructor(e, r, n = !1) { this.source = e, this.state = r, this.explicit = n; } @@ -15503,14 +15503,14 @@ class nc { return this.state == 1; } update(e, r) { - let n = Boe(e, r), i = this; - (n & 8 || n & 16 && this.touches(e)) && (i = new nc(i.source, 0)), n & 4 && i.state == 0 && (i = new nc(this.source, 1)), i = i.updateFor(e, n); + let n = Aoe(e, r), i = this; + (n & 8 || n & 16 && this.touches(e)) && (i = new ec(i.source, 0)), n & 4 && i.state == 0 && (i = new ec(this.source, 1)), i = i.updateFor(e, n); for (let s of e.effects) - if (s.is(AT)) - i = new nc(i.source, 1, s.value); - else if (s.is(Kx)) - i = new nc(i.source, 0); - else if (s.is(xB)) + if (s.is(ET)) + i = new ec(i.source, 1, s.value); + else if (s.is(jx)) + i = new ec(i.source, 0); + else if (s.is(lB)) for (let a of s.value) a.source == i.source && (i = a); return i; @@ -15522,10 +15522,10 @@ class nc { return this; } touches(e) { - return e.changes.touchesRange(rg(e.state)); + return e.changes.touchesRange(K0(e.state)); } } -class $1 extends nc { +class D1 extends ec { constructor(e, r, n, i, s, a) { super(e, 3, r), this.limit = n, this.result = i, this.from = s, this.to = a; } @@ -15538,98 +15538,98 @@ class $1 extends nc { return this.map(e.changes); let i = this.result; i.map && !e.changes.empty && (i = i.map(i, e.changes)); - let s = e.changes.mapPos(this.from), a = e.changes.mapPos(this.to, 1), o = rg(e.state); - if (o > a || !i || r & 2 && (rg(e.startState) == this.from || o < this.limit)) - return new nc(this.source, r & 4 ? 1 : 0); + let s = e.changes.mapPos(this.from), a = e.changes.mapPos(this.to, 1), o = K0(e.state); + if (o > a || !i || r & 2 && (K0(e.startState) == this.from || o < this.limit)) + return new ec(this.source, r & 4 ? 1 : 0); let l = e.changes.mapPos(this.limit); - return w7e(i.validFor, e.state, s, a) ? new $1(this.source, this.explicit, l, i, s, a) : i.update && (i = i.update(i, s, a, new i6(e.state, o, !1))) ? new $1(this.source, this.explicit, l, i, i.from, (n = i.to) !== null && n !== void 0 ? n : rg(e.state)) : new nc(this.source, 1, this.explicit); + return c7e(i.validFor, e.state, s, a) ? new D1(this.source, this.explicit, l, i, s, a) : i.update && (i = i.update(i, s, a, new e6(e.state, o, !1))) ? new D1(this.source, this.explicit, l, i, i.from, (n = i.to) !== null && n !== void 0 ? n : K0(e.state)) : new ec(this.source, 1, this.explicit); } map(e) { - return e.empty ? this : (this.result.map ? this.result.map(this.result, e) : this.result) ? new $1(this.source, this.explicit, e.mapPos(this.limit), this.result, e.mapPos(this.from), e.mapPos(this.to, 1)) : new nc(this.source, 0); + return e.empty ? this : (this.result.map ? this.result.map(this.result, e) : this.result) ? new D1(this.source, this.explicit, e.mapPos(this.limit), this.result, e.mapPos(this.from), e.mapPos(this.to, 1)) : new ec(this.source, 0); } touches(e) { return e.changes.touchesRange(this.from, this.to); } } -function w7e(t, e, r, n) { +function c7e(t, e, r, n) { if (!t) return !1; let i = e.sliceDoc(r, n); - return typeof t == "function" ? t(i, r, n, e) : $oe(t, !0).test(i); + return typeof t == "function" ? t(i, r, n, e) : _oe(t, !0).test(i); } -const xB = /* @__PURE__ */ _r.define({ +const lB = /* @__PURE__ */ _r.define({ map(t, e) { return t.map((r) => r.map(e)); } -}), Foe = /* @__PURE__ */ _r.define(), $o = /* @__PURE__ */ ai.define({ +}), Roe = /* @__PURE__ */ _r.define(), Po = /* @__PURE__ */ ai.define({ create() { - return RT.start(); + return _T.start(); }, update(t, e) { return t.update(e); }, provide: (t) => [ - G$.from(t, (e) => e.tooltip), + N$.from(t, (e) => e.tooltip), Mt.contentAttributes.from(t, (e) => e.attrs) ] }); -function wB(t, e) { +function cB(t, e) { const r = e.completion.apply || e.completion.label; - let n = t.state.field($o).active.find((i) => i.source == e.source); - return n instanceof $1 ? (typeof r == "string" ? t.dispatch(Object.assign(Object.assign({}, o7e(t.state, r, n.from, n.to)), { annotations: bB.of(e.completion) })) : r(t, e.completion, n.from, n.to), !0) : !1; + let n = t.state.field(Po).active.find((i) => i.source == e.source); + return n instanceof D1 ? (typeof r == "string" ? t.dispatch(Object.assign(Object.assign({}, XAe(t.state, r, n.from, n.to)), { annotations: oB.of(e.completion) })) : r(t, e.completion, n.from, n.to), !0) : !1; } -const O7e = /* @__PURE__ */ p7e($o, wB); -function dS(t, e = "option") { +const u7e = /* @__PURE__ */ r7e(Po, cB); +function uS(t, e = "option") { return (r) => { - let n = r.state.field($o, !1); - if (!n || !n.open || n.open.disabled || Date.now() - n.open.timestamp < r.state.facet(Bs).interactionDelay) + let n = r.state.field(Po, !1); + if (!n || !n.open || n.open.disabled || Date.now() - n.open.timestamp < r.state.facet(Is).interactionDelay) return !1; let i = 1, s; - e == "page" && (s = Oae(r, n.open.tooltip)) && (i = Math.max(2, Math.floor(s.dom.offsetHeight / s.dom.querySelector("li").offsetHeight) - 1)); + e == "page" && (s = dae(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: Foe.of(o) }), !0; + return o < 0 ? o = e == "page" ? 0 : a - 1 : o >= a && (o = e == "page" ? a - 1 : 0), r.dispatch({ effects: Roe.of(o) }), !0; }; } -const zoe = (t) => { - let e = t.state.field($o, !1); - return t.state.readOnly || !e || !e.open || e.open.selected < 0 || e.open.disabled || Date.now() - e.open.timestamp < t.state.facet(Bs).interactionDelay ? !1 : wB(t, e.open.options[e.open.selected]); -}, kY = (t) => t.state.field($o, !1) ? (t.dispatch({ effects: AT.of(!0) }), !0) : !1, k7e = (t) => { - let e = t.state.field($o, !1); - return !e || !e.active.some((r) => r.state != 0) ? !1 : (t.dispatch({ effects: Kx.of(null) }), !0); +const Loe = (t) => { + let e = t.state.field(Po, !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 : cB(t, e.open.options[e.open.selected]); +}, uY = (t) => t.state.field(Po, !1) ? (t.dispatch({ effects: ET.of(!0) }), !0) : !1, h7e = (t) => { + let e = t.state.field(Po, !1); + return !e || !e.active.some((r) => r.state != 0) ? !1 : (t.dispatch({ effects: jx.of(null) }), !0); }; -class S7e { +class f7e { constructor(e, r) { this.active = e, this.context = r, this.time = Date.now(), this.updates = [], this.done = void 0; } } -const T7e = 50, C7e = 1e3, E7e = /* @__PURE__ */ fn.fromClass(class { +const d7e = 50, p7e = 1e3, g7e = /* @__PURE__ */ fn.fromClass(class { constructor(t) { this.view = t, this.debounceUpdate = -1, this.running = [], this.debounceAccept = -1, this.pendingStart = !1, this.composing = 0; - for (let e of t.state.field($o).active) + for (let e of t.state.field(Po).active) e.isPending && this.startQuery(e); } update(t) { - let e = t.state.field($o), r = t.state.facet(Bs); - if (!t.selectionSet && !t.docChanged && t.startState.field($o) == e) + let e = t.state.field(Po), r = t.state.facet(Is); + if (!t.selectionSet && !t.docChanged && t.startState.field(Po) == e) return; let n = t.transactions.some((s) => { - let a = Boe(s, r); + let a = Aoe(s, r); return a & 8 || (s.selection || s.docChanged) && !(a & 3); }); for (let s = 0; s < this.running.length; s++) { let a = this.running[s]; - if (n || a.context.abortOnDocChange && t.docChanged || a.updates.length + t.transactions.length > T7e && Date.now() - a.time > C7e) { + if (n || a.context.abortOnDocChange && t.docChanged || a.updates.length + t.transactions.length > d7e && Date.now() - a.time > p7e) { for (let o of a.context.abortListeners) try { o(); } catch (l) { - Ho(this.view.state, l); + Wo(this.view.state, l); } a.context.abortListeners = null, this.running.splice(s--, 1); } else a.updates.push(...t.transactions); } - this.debounceUpdate > -1 && clearTimeout(this.debounceUpdate), t.transactions.some((s) => s.effects.some((a) => a.is(AT))) && (this.pendingStart = !0); + this.debounceUpdate > -1 && clearTimeout(this.debounceUpdate), t.transactions.some((s) => s.effects.some((a) => a.is(ET))) && (this.pendingStart = !0); let i = this.pendingStart ? 50 : r.activateOnTypingDelay; if (this.debounceUpdate = e.active.some((s) => s.isPending && !this.running.some((a) => a.active.source == s.source)) ? setTimeout(() => this.startUpdate(), i) : -1, this.composing != 0) for (let s of t.transactions) @@ -15637,32 +15637,32 @@ const T7e = 50, C7e = 1e3, E7e = /* @__PURE__ */ fn.fromClass(class { } startUpdate() { this.debounceUpdate = -1, this.pendingStart = !1; - let { state: t } = this.view, e = t.field($o); + let { state: t } = this.view, e = t.field(Po); for (let r of e.active) r.isPending && !this.running.some((n) => n.active.source == r.source) && this.startQuery(r); - this.running.length && e.open && e.open.disabled && (this.debounceAccept = setTimeout(() => this.accept(), this.view.state.facet(Bs).updateSyncTime)); + this.running.length && e.open && e.open.disabled && (this.debounceAccept = setTimeout(() => this.accept(), this.view.state.facet(Is).updateSyncTime)); } startQuery(t) { - let { state: e } = this.view, r = rg(e), n = new i6(e, r, t.explicit, this.view), i = new S7e(t, n); + let { state: e } = this.view, r = K0(e), n = new e6(e, r, t.explicit, this.view), i = new f7e(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: Kx.of(null) }), Ho(this.view.state, s); + this.view.dispatch({ effects: jx.of(null) }), Wo(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(Bs).updateSyncTime)); + this.running.every((t) => t.done !== void 0) ? this.accept() : this.debounceAccept < 0 && (this.debounceAccept = setTimeout(() => this.accept(), this.view.state.facet(Is).updateSyncTime)); } accept() { var t; this.debounceAccept > -1 && clearTimeout(this.debounceAccept), this.debounceAccept = -1; - let e = [], r = this.view.state.facet(Bs), n = this.view.state.field($o); + let e = [], r = this.view.state.facet(Is), n = this.view.state.field(Po); for (let i = 0; i < this.running.length; i++) { let s = this.running[i]; if (s.done === void 0) continue; if (this.running.splice(i--, 1), s.done) { - let o = rg(s.updates.length ? s.updates[0].startState : this.view.state), l = Math.min(o, s.done.from + (s.active.explicit ? 0 : 1)), u = new $1(s.active.source, s.active.explicit, l, s.done, s.done.from, (t = s.done.to) !== null && t !== void 0 ? t : o); + let o = K0(s.updates.length ? s.updates[0].startState : this.view.state), l = Math.min(o, s.done.from + (s.active.explicit ? 0 : 1)), u = new D1(s.active.source, s.active.explicit, l, s.done, s.done.from, (t = s.done.to) !== null && t !== void 0 ? t : o); for (let h of s.updates) u = u.update(h, r); if (u.hasResult()) { @@ -15673,40 +15673,40 @@ const T7e = 50, C7e = 1e3, E7e = /* @__PURE__ */ fn.fromClass(class { let a = n.active.find((o) => o.source == s.active.source); if (a && a.isPending) if (s.done == null) { - let o = new nc(s.active.source, 0); + let o = new ec(s.active.source, 0); for (let l of s.updates) o = o.update(l, r); o.isPending || e.push(o); } else this.startQuery(a); } - (e.length || n.open && n.open.disabled) && this.view.dispatch({ effects: xB.of(e) }); + (e.length || n.open && n.open.disabled) && this.view.dispatch({ effects: lB.of(e) }); } }, { eventHandlers: { blur(t) { - let e = this.view.state.field($o, !1); - if (e && e.tooltip && this.view.state.facet(Bs).closeOnBlur) { - let r = e.open && Oae(this.view, e.open.tooltip); - (!r || !r.dom.contains(t.relatedTarget)) && setTimeout(() => this.view.dispatch({ effects: Kx.of(null) }), 10); + let e = this.view.state.field(Po, !1); + if (e && e.tooltip && this.view.state.facet(Is).closeOnBlur) { + let r = e.open && dae(this.view, e.open.tooltip); + (!r || !r.dom.contains(t.relatedTarget)) && setTimeout(() => this.view.dispatch({ effects: jx.of(null) }), 10); } }, compositionstart() { this.composing = 1; }, compositionend() { - this.composing == 3 && setTimeout(() => this.view.dispatch({ effects: AT.of(!1) }), 20), this.composing = 0; + this.composing == 3 && setTimeout(() => this.view.dispatch({ effects: ET.of(!1) }), 20), this.composing = 0; } } -}), _7e = typeof navigator == "object" && /* @__PURE__ */ /Win/.test(navigator.platform), A7e = /* @__PURE__ */ Va.highest(/* @__PURE__ */ Mt.domEventHandlers({ +}), m7e = typeof navigator == "object" && /* @__PURE__ */ /Win/.test(navigator.platform), v7e = /* @__PURE__ */ qa.highest(/* @__PURE__ */ Mt.domEventHandlers({ keydown(t, e) { - let r = e.state.field($o, !1); - if (!r || !r.open || r.open.disabled || r.open.selected < 0 || t.key.length > 1 || t.ctrlKey && !(_7e && t.altKey) || t.metaKey) + let r = e.state.field(Po, !1); + if (!r || !r.open || r.open.disabled || r.open.selected < 0 || t.key.length > 1 || t.ctrlKey && !(m7e && t.altKey) || t.metaKey) return !1; let n = r.open.options[r.open.selected], i = r.active.find((a) => a.source == n.source), s = n.completion.commitCharacters || i.result.commitCharacters; - return s && s.indexOf(t.key) > -1 && wB(e, n), !1; + return s && s.indexOf(t.key) > -1 && cB(e, n), !1; } -})), qoe = /* @__PURE__ */ Mt.baseTheme({ +})), Moe = /* @__PURE__ */ Mt.baseTheme({ ".cm-tooltip.cm-tooltip-autocomplete": { "& > ul": { fontFamily: "monospace", @@ -15829,21 +15829,21 @@ const T7e = 50, C7e = 1e3, E7e = /* @__PURE__ */ fn.fromClass(class { "&:after": { content: "'abc'", fontSize: "50%", verticalAlign: "middle" } } }); -class R7e { +class y7e { constructor(e, r, n, i) { this.field = e, this.line = r, this.from = n, this.to = i; } } -class OB { +class uB { constructor(e, r, n) { this.field = e, this.from = r, this.to = n; } map(e) { let r = e.mapPos(this.from, -1, gi.TrackDel), n = e.mapPos(this.to, 1, gi.TrackDel); - return r == null || n == null ? null : new OB(this.field, r, n); + return r == null || n == null ? null : new uB(this.field, r, n); } } -class kB { +class hB { constructor(e, r) { this.lines = e, this.fieldPositions = r; } @@ -15853,12 +15853,12 @@ class kB { if (n.length) { let u = a, h = /^\t*/.exec(l)[0].length; for (let f = 0; f < h; f++) - u += e.facet(bg); + u += e.facet(gg); 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 OB(l.field, i[l.line] + l.from, i[l.line] + l.to)); + let o = this.fieldPositions.map((l) => new uB(l.field, i[l.line] + l.from, i[l.line] + l.to)); return { text: n, ranges: o }; } static parse(e) { @@ -15876,7 +15876,7 @@ class kB { for (let d of i) d.field >= u && d.field++; } - i.push(new R7e(u, n.length, s.index, s.index + h.length)), a = a.slice(0, s.index) + l + a.slice(s.index + s[0].length); + i.push(new y7e(u, n.length, s.index, s.index + h.length)), a = a.slice(0, s.index) + l + a.slice(s.index + s[0].length); } a = a.replace(/\\([{}])/g, (o, l, u) => { for (let h of i) @@ -15884,10 +15884,10 @@ class kB { return l; }), n.push(a); } - return new kB(n, i); + return new hB(n, i); } } -let L7e = /* @__PURE__ */ Ht.widget({ widget: /* @__PURE__ */ new class extends nl { +let b7e = /* @__PURE__ */ Ht.widget({ widget: /* @__PURE__ */ new class extends el { toDOM() { let t = document.createElement("span"); return t.className = "cm-snippetFieldPosition", t; @@ -15895,10 +15895,10 @@ let L7e = /* @__PURE__ */ Ht.widget({ widget: /* @__PURE__ */ new class extends ignoreEvent() { return !1; } -}() }), M7e = /* @__PURE__ */ Ht.mark({ class: "cm-snippetField" }); -class zy { +}() }), x7e = /* @__PURE__ */ Ht.mark({ class: "cm-snippetField" }); +class Ny { constructor(e, r) { - this.ranges = e, this.active = r, this.deco = Ht.set(e.map((n) => (n.from == n.to ? L7e : M7e).range(n.from, n.to))); + this.ranges = e, this.active = r, this.deco = Ht.set(e.map((n) => (n.from == n.to ? b7e : x7e).range(n.from, n.to))); } map(e) { let r = []; @@ -15908,99 +15908,99 @@ class zy { return null; r.push(i); } - return new zy(r, this.active); + return new Ny(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 Tk = /* @__PURE__ */ _r.define({ +const Ok = /* @__PURE__ */ _r.define({ map(t, e) { return t && t.map(e); } -}), D7e = /* @__PURE__ */ _r.define(), Jx = /* @__PURE__ */ ai.define({ +}), w7e = /* @__PURE__ */ _r.define(), Zx = /* @__PURE__ */ ai.define({ create() { return null; }, update(t, e) { for (let r of e.effects) { - if (r.is(Tk)) + if (r.is(Ok)) return r.value; - if (r.is(D7e) && t) - return new zy(t.ranges, r.value); + if (r.is(w7e) && t) + return new Ny(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) => Mt.decorations.from(t, (e) => e ? e.deco : Ht.none) }); -function SB(t, e) { +function fB(t, e) { return ft.create(t.filter((r) => r.field == e).map((r) => ft.range(r.from, r.to))); } -function P7e(t) { - let e = kB.parse(t); +function O7e(t) { + let e = hB.parse(t); return (r, n, i, s) => { let { text: a, ranges: o } = e.instantiate(r.state, i), { main: l } = r.state.selection, u = { changes: { from: i, to: s == l.from ? l.to : s, insert: nn.of(a) }, scrollIntoView: !0, - annotations: n ? [bB.of(n), zi.userEvent.of("input.complete")] : void 0 + annotations: n ? [oB.of(n), Fi.userEvent.of("input.complete")] : void 0 }; - if (o.length && (u.selection = SB(o, 0)), o.some((h) => h.field > 0)) { - let h = new zy(o, 0), f = u.effects = [Tk.of(h)]; - r.state.field(Jx, !1) === void 0 && f.push(_r.appendConfig.of([Jx, F7e, z7e, qoe])); + if (o.length && (u.selection = fB(o, 0)), o.some((h) => h.field > 0)) { + let h = new Ny(o, 0), f = u.effects = [Ok.of(h)]; + r.state.field(Zx, !1) === void 0 && f.push(_r.appendConfig.of([Zx, E7e, _7e, Moe])); } r.dispatch(r.state.update(u)); }; } -function Uoe(t) { +function Doe(t) { return ({ state: e, dispatch: r }) => { - let n = e.field(Jx, !1); + let n = e.field(Zx, !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: SB(n.ranges, i), - effects: Tk.of(s ? null : new zy(n.ranges, i)), + selection: fB(n.ranges, i), + effects: Ok.of(s ? null : new Ny(n.ranges, i)), scrollIntoView: !0 })), !0; }; } -const N7e = ({ state: t, dispatch: e }) => t.field(Jx, !1) ? (e(t.update({ effects: Tk.of(null) })), !0) : !1, I7e = /* @__PURE__ */ Uoe(1), $7e = /* @__PURE__ */ Uoe(-1), B7e = [ - { key: "Tab", run: I7e, shift: $7e }, - { key: "Escape", run: N7e } -], SY = /* @__PURE__ */ Gt.define({ +const k7e = ({ state: t, dispatch: e }) => t.field(Zx, !1) ? (e(t.update({ effects: Ok.of(null) })), !0) : !1, S7e = /* @__PURE__ */ Doe(1), T7e = /* @__PURE__ */ Doe(-1), C7e = [ + { key: "Tab", run: S7e, shift: T7e }, + { key: "Escape", run: k7e } +], hY = /* @__PURE__ */ Gt.define({ combine(t) { - return t.length ? t[0] : B7e; + return t.length ? t[0] : C7e; } -}), F7e = /* @__PURE__ */ Va.highest(/* @__PURE__ */ Qc.compute([SY], (t) => t.facet(SY))); -function Lo(t, e) { - return Object.assign(Object.assign({}, e), { apply: P7e(t) }); +}), E7e = /* @__PURE__ */ qa.highest(/* @__PURE__ */ zc.compute([hY], (t) => t.facet(hY))); +function _o(t, e) { + return Object.assign(Object.assign({}, e), { apply: O7e(t) }); } -const z7e = /* @__PURE__ */ Mt.domEventHandlers({ +const _7e = /* @__PURE__ */ Mt.domEventHandlers({ mousedown(t, e) { - let r = e.state.field(Jx, !1), n; + let r = e.state.field(Zx, !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: SB(r.ranges, i.field), - effects: Tk.of(r.ranges.some((s) => s.field > i.field) ? new zy(r.ranges, i.field) : null), + selection: fB(r.ranges, i.field), + effects: Ok.of(r.ranges.some((s) => s.field > i.field) ? new Ny(r.ranges, i.field) : null), scrollIntoView: !0 }), !0); } -}), LT = { +}), AT = { brackets: ["(", "[", "{", "'", '"'], before: ")]}:;>", stringPrefixes: [] -}, U0 = /* @__PURE__ */ _r.define({ +}, B0 = /* @__PURE__ */ _r.define({ map(t, e) { let r = e.mapPos(t, -1, gi.TrackAfter); return r == null ? void 0 : r; } -}), TB = /* @__PURE__ */ new class extends pg { +}), dB = /* @__PURE__ */ new class extends ug { }(); -TB.startSide = 1; -TB.endSide = -1; -const Qoe = /* @__PURE__ */ ai.define({ +dB.startSide = 1; +dB.endSide = -1; +const Poe = /* @__PURE__ */ ai.define({ create() { return jr.empty; }, @@ -16010,65 +16010,65 @@ const Qoe = /* @__PURE__ */ ai.define({ t = t.update({ filter: (n) => n >= r.from && n <= r.to }); } for (let r of e.effects) - r.is(U0) && (t = t.update({ add: [TB.range(r.value, r.value + 1)] })); + r.is(B0) && (t = t.update({ add: [dB.range(r.value, r.value + 1)] })); return t; } }); -function q7e() { - return [W7e, Qoe]; +function A7e() { + return [D7e, Poe]; } -const m8 = "()[]{}<>"; -function U7e(t) { - for (let e = 0; e < m8.length; e += 2) - if (m8.charCodeAt(e) == t) - return m8.charAt(e + 1); - return M$(t < 128 ? t : t + 1); +const u8 = "()[]{}<>"; +function R7e(t) { + for (let e = 0; e < u8.length; e += 2) + if (u8.charCodeAt(e) == t) + return u8.charAt(e + 1); + return x$(t < 128 ? t : t + 1); } -function Q7e(t, e) { - return t.languageDataAt("closeBrackets", e)[0] || LT; +function L7e(t, e) { + return t.languageDataAt("closeBrackets", e)[0] || AT; } -const V7e = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(navigator.userAgent), W7e = /* @__PURE__ */ Mt.inputHandler.of((t, e, r, n) => { - if ((V7e ? t.composing : t.compositionStarted) || t.state.readOnly) +const M7e = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(navigator.userAgent), D7e = /* @__PURE__ */ Mt.inputHandler.of((t, e, r, n) => { + if ((M7e ? t.composing : t.compositionStarted) || t.state.readOnly) return !1; let i = t.state.selection.main; - if (n.length > 2 || n.length == 2 && sf(Gl(n, 0)) == 1 || e != i.from || r != i.to) + if (n.length > 2 || n.length == 2 && nf(Vl(n, 0)) == 1 || e != i.from || r != i.to) return !1; - let s = Y7e(t.state, n); + let s = P7e(t.state, n); return s ? (t.dispatch(s), !0) : !1; }); -function Y7e(t, e) { - let r = Q7e(t, t.selection.main.head), n = r.brackets || LT.brackets; +function P7e(t, e) { + let r = L7e(t, t.selection.main.head), n = r.brackets || AT.brackets; for (let i of n) { - let s = U7e(Gl(i, 0)); + let s = R7e(Vl(i, 0)); if (e == i) - return s == i ? X7e(t, i, n.indexOf(i + i + i) > -1, r) : G7e(t, i, s, r.before || LT.before); - if (e == s && Voe(t, t.selection.main.from)) - return H7e(t, i, s); + return s == i ? $7e(t, i, n.indexOf(i + i + i) > -1, r) : N7e(t, i, s, r.before || AT.before); + if (e == s && Noe(t, t.selection.main.from)) + return I7e(t, i, s); } return null; } -function Voe(t, e) { +function Noe(t, e) { let r = !1; - return t.field(Qoe).between(0, t.doc.length, (n) => { + return t.field(Poe).between(0, t.doc.length, (n) => { n == e && (r = !0); }), r; } -function CB(t, e) { +function pB(t, e) { let r = t.sliceString(e, e + 2); - return r.slice(0, sf(Gl(r, 0))); + return r.slice(0, nf(Vl(r, 0))); } -function G7e(t, e, r, n) { +function N7e(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: U0.of(a.to + e.length), + effects: B0.of(a.to + e.length), range: ft.range(a.anchor + e.length, a.head + e.length) }; - let o = CB(t.doc, a.head); + let o = pB(t.doc, a.head); return !o || /\s/.test(o) || n.indexOf(o) > -1 ? { changes: { insert: e + r, from: a.head }, - effects: U0.of(a.head + e.length), + effects: B0.of(a.head + e.length), range: ft.cursor(a.head + e.length) } : { range: i = a }; }); @@ -16077,8 +16077,8 @@ function G7e(t, e, r, n) { userEvent: "input.type" }); } -function H7e(t, e, r) { - let n = null, i = t.changeByRange((s) => s.empty && CB(t.doc, s.head) == r ? { +function I7e(t, e, r) { + let n = null, i = t.changeByRange((s) => s.empty && pB(t.doc, s.head) == r ? { changes: { from: s.head, to: s.head + r.length, insert: r }, range: ft.cursor(s.head + r.length) } : n = { range: s }); @@ -16087,23 +16087,23 @@ function H7e(t, e, r) { userEvent: "input.type" }); } -function X7e(t, e, r, n) { - let i = n.stringPrefixes || LT.stringPrefixes, s = null, a = t.changeByRange((o) => { +function $7e(t, e, r, n) { + let i = n.stringPrefixes || AT.stringPrefixes, s = null, a = t.changeByRange((o) => { if (!o.empty) return { changes: [{ insert: e, from: o.from }, { insert: e, from: o.to }], - effects: U0.of(o.to + e.length), + effects: B0.of(o.to + e.length), range: ft.range(o.anchor + e.length, o.head + e.length) }; - let l = o.head, u = CB(t.doc, l), h; + let l = o.head, u = pB(t.doc, l), h; if (u == e) { - if (TY(t, l)) + if (fY(t, l)) return { changes: { insert: e + e, from: l }, - effects: U0.of(l + e.length), + effects: B0.of(l + e.length), range: ft.cursor(l + e.length) }; - if (Voe(t, l)) { + if (Noe(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 }, @@ -16111,16 +16111,16 @@ function X7e(t, e, r, n) { }; } } else { - if (r && t.sliceDoc(l - 2 * e.length, l) == e + e && (h = CY(t, l - 2 * e.length, i)) > -1 && TY(t, h)) + if (r && t.sliceDoc(l - 2 * e.length, l) == e + e && (h = dY(t, l - 2 * e.length, i)) > -1 && fY(t, h)) return { changes: { insert: e + e + e + e, from: l }, - effects: U0.of(l + e.length), + effects: B0.of(l + e.length), range: ft.cursor(l + e.length) }; - if (t.charCategorizer(l)(u) != li.Word && CY(t, l, i) > -1 && !j7e(t, l, e, i)) + if (t.charCategorizer(l)(u) != li.Word && dY(t, l, i) > -1 && !B7e(t, l, e, i)) return { changes: { insert: e + e, from: l }, - effects: U0.of(l + e.length), + effects: B0.of(l + e.length), range: ft.cursor(l + e.length) }; } @@ -16131,11 +16131,11 @@ function X7e(t, e, r, n) { userEvent: "input.type" }); } -function TY(t, e) { +function fY(t, e) { let r = Qn(t).resolveInner(e + 1); return r.parent && r.from == e; } -function j7e(t, e, r, n) { +function B7e(t, e, r, n) { let i = Qn(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); @@ -16155,7 +16155,7 @@ function j7e(t, e, r, n) { } return !1; } -function CY(t, e, r) { +function dY(t, e, r) { let n = t.charCategorizer(e); if (n(t.sliceDoc(e - 1, e)) != li.Word) return e; @@ -16166,39 +16166,39 @@ function CY(t, e, r) { } return -1; } -function Woe(t = {}) { +function Ioe(t = {}) { return [ - A7e, - $o, - Bs.of(t), - E7e, - Z7e, - qoe + v7e, + Po, + Is.of(t), + g7e, + F7e, + Moe ]; } -const Yoe = [ - { key: "Ctrl-Space", run: kY }, - { mac: "Alt-`", run: kY }, - { key: "Escape", run: k7e }, - { key: "ArrowDown", run: /* @__PURE__ */ dS(!0) }, - { key: "ArrowUp", run: /* @__PURE__ */ dS(!1) }, - { key: "PageDown", run: /* @__PURE__ */ dS(!0, "page") }, - { key: "PageUp", run: /* @__PURE__ */ dS(!1, "page") }, - { key: "Enter", run: zoe } -], Z7e = /* @__PURE__ */ Va.highest(/* @__PURE__ */ Qc.computeN([Bs], (t) => t.facet(Bs).defaultKeymap ? [Yoe] : [])); -class EY { +const $oe = [ + { key: "Ctrl-Space", run: uY }, + { mac: "Alt-`", run: uY }, + { key: "Escape", run: h7e }, + { key: "ArrowDown", run: /* @__PURE__ */ uS(!0) }, + { key: "ArrowUp", run: /* @__PURE__ */ uS(!1) }, + { key: "PageDown", run: /* @__PURE__ */ uS(!0, "page") }, + { key: "PageUp", run: /* @__PURE__ */ uS(!1, "page") }, + { key: "Enter", run: Loe } +], F7e = /* @__PURE__ */ qa.highest(/* @__PURE__ */ zc.computeN([Is], (t) => t.facet(Is).defaultKeymap ? [$oe] : [])); +class pY { constructor(e, r, n) { this.from = e, this.to = r, this.diagnostic = n; } } -class E0 { +class k0 { constructor(e, r, n) { this.diagnostics = e, this.panel = r, this.selected = n; } static init(e, r, n) { - let i = e, s = n.facet(tw).markerFilter; + let i = e, s = n.facet(Jx).markerFilter; s && (i = s(i, n)); - let a = e.slice().sort((f, d) => f.from - d.from || f.to - d.to), o = new is(), l = [], u = 0; + let a = e.slice().sort((f, d) => f.from - d.from || f.to - d.to), o = new rs(), l = [], u = 0; for (let f = 0; ; ) { let d = f == a.length ? null : a[f]; if (!d && !l.length) @@ -16213,10 +16213,10 @@ class E0 { break; } } - let m = c8e(l); + let m = Z7e(l); if (l.some((v) => v.from == v.to || v.from == v.to - 1 && n.doc.lineAt(v.from).to == v.from)) o.add(p, p, Ht.widget({ - widget: new s8e(m), + widget: new G7e(m), diagnostics: l.slice() })); else { @@ -16232,102 +16232,102 @@ class E0 { l[v].to <= u && l.splice(v--, 1); } let h = o.finish(); - return new E0(h, r, Ov(h)); + return new k0(h, r, yv(h)); } } -function Ov(t, e = null, r = 0) { +function yv(t, e = null, r = 0) { let n = null; return t.between(r, 1e9, (i, s, { spec: a }) => { if (!(e && a.diagnostics.indexOf(e) < 0)) if (!n) - n = new EY(i, s, e || a.diagnostics[0]); + n = new pY(i, s, e || a.diagnostics[0]); else { if (a.diagnostics.indexOf(n.diagnostic) < 0) return !1; - n = new EY(n.from, s, n.diagnostic); + n = new pY(n.from, s, n.diagnostic); } }), n; } -function K7e(t, e) { - let r = e.pos, n = e.end || r, i = t.state.facet(tw).hideOn(t, r, n); +function z7e(t, e) { + let r = e.pos, n = e.end || r, i = t.state.facet(Jx).hideOn(t, r, n); if (i != null) return i; let s = t.startState.doc.lineAt(e.pos); - return !!(t.effects.some((a) => a.is(ew)) || t.changes.touchesRange(s.from, Math.max(s.to, n))); + return !!(t.effects.some((a) => a.is(Kx)) || t.changes.touchesRange(s.from, Math.max(s.to, n))); } -function Goe(t, e) { - return t.field(xl, !1) ? e : e.concat(_r.appendConfig.of(u8e)); +function Boe(t, e) { + return t.field(vl, !1) ? e : e.concat(_r.appendConfig.of(K7e)); } -function O9(t, e) { +function v9(t, e) { return { - effects: Goe(t, [ew.of(e)]) + effects: Boe(t, [Kx.of(e)]) }; } -const ew = /* @__PURE__ */ _r.define(), EB = /* @__PURE__ */ _r.define(), Hoe = /* @__PURE__ */ _r.define(), xl = /* @__PURE__ */ ai.define({ +const Kx = /* @__PURE__ */ _r.define(), gB = /* @__PURE__ */ _r.define(), Foe = /* @__PURE__ */ _r.define(), vl = /* @__PURE__ */ ai.define({ create() { - return new E0(Ht.none, null, null); + return new k0(Ht.none, null, null); }, update(t, e) { if (e.docChanged && t.diagnostics.size) { let r = t.diagnostics.map(e.changes), n = null, i = t.panel; if (t.selected) { let s = e.changes.mapPos(t.selected.from, 1); - n = Ov(r, t.selected.diagnostic, s) || Ov(r, null, s); + n = yv(r, t.selected.diagnostic, s) || yv(r, null, s); } - !r.size && i && e.state.facet(tw).autoPanel && (i = null), t = new E0(r, i, n); + !r.size && i && e.state.facet(Jx).autoPanel && (i = null), t = new k0(r, i, n); } for (let r of e.effects) - if (r.is(ew)) { - let n = e.state.facet(tw).autoPanel ? r.value.length ? rw.open : null : t.panel; - t = E0.init(r.value, n, e.state); + if (r.is(Kx)) { + let n = e.state.facet(Jx).autoPanel ? r.value.length ? ew.open : null : t.panel; + t = k0.init(r.value, n, e.state); } else - r.is(EB) ? t = new E0(t.diagnostics, r.value ? rw.open : null, t.selected) : r.is(Hoe) && (t = new E0(t.diagnostics, t.panel, r.value)); + r.is(gB) ? t = new k0(t.diagnostics, r.value ? ew.open : null, t.selected) : r.is(Foe) && (t = new k0(t.diagnostics, t.panel, r.value)); return t; }, provide: (t) => [ - yg.from(t, (e) => e.panel), + pg.from(t, (e) => e.panel), Mt.decorations.from(t, (e) => e.diagnostics) ] -}), J7e = /* @__PURE__ */ Ht.mark({ class: "cm-lintRange cm-lintRange-active" }); -function e8e(t, e, r) { - let { diagnostics: n } = t.state.field(xl), i, s = -1, a = -1; +}), q7e = /* @__PURE__ */ Ht.mark({ class: "cm-lintRange cm-lintRange-active" }); +function U7e(t, e, r) { + let { diagnostics: n } = t.state.field(vl), i, s = -1, a = -1; n.between(e - (r < 0 ? 1 : 0), e + (r > 0 ? 1 : 0), (l, u, { spec: h }) => { if (e >= l && e <= u && (l == u || (e > l || r > 0) && (e < u || r < 0))) return i = h.diagnostics, s = l, a = u, !1; }); - let o = t.state.facet(tw).tooltipFilter; + let o = t.state.facet(Jx).tooltipFilter; return i && o && (i = o(i, t.state)), i ? { pos: s, end: a, above: t.state.doc.lineAt(s).to < a, create() { - return { dom: t8e(t, i) }; + return { dom: Q7e(t, i) }; } } : null; } -function t8e(t, e) { - return Gn("ul", { class: "cm-tooltip-lint" }, e.map((r) => joe(t, r, !1))); +function Q7e(t, e) { + return Gn("ul", { class: "cm-tooltip-lint" }, e.map((r) => qoe(t, r, !1))); } -const r8e = (t) => { - let e = t.state.field(xl, !1); - (!e || !e.panel) && t.dispatch({ effects: Goe(t.state, [EB.of(!0)]) }); - let r = Wx(t, rw.open); +const V7e = (t) => { + let e = t.state.field(vl, !1); + (!e || !e.panel) && t.dispatch({ effects: Boe(t.state, [gB.of(!0)]) }); + let r = Qx(t, ew.open); return r && r.dom.querySelector(".cm-panel-lint ul").focus(), !0; -}, _Y = (t) => { - let e = t.state.field(xl, !1); - return !e || !e.panel ? !1 : (t.dispatch({ effects: EB.of(!1) }), !0); -}, n8e = (t) => { - let e = t.state.field(xl, !1); +}, gY = (t) => { + let e = t.state.field(vl, !1); + return !e || !e.panel ? !1 : (t.dispatch({ effects: gB.of(!1) }), !0); +}, W7e = (t) => { + let e = t.state.field(vl, !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); -}, i8e = [ - { key: "Mod-Shift-m", run: r8e, preventDefault: !0 }, - { key: "F8", run: n8e } -], tw = /* @__PURE__ */ Gt.define({ +}, Y7e = [ + { key: "Mod-Shift-m", run: V7e, preventDefault: !0 }, + { key: "F8", run: W7e } +], Jx = /* @__PURE__ */ Gt.define({ combine(t) { - return Object.assign({ sources: t.map((e) => e.source).filter((e) => e != null) }, Ah(t.map((e) => e.config), { + return Object.assign({ sources: t.map((e) => e.source).filter((e) => e != null) }, Th(t.map((e) => e.config), { delay: 750, markerFilter: null, tooltipFilter: null, @@ -16338,7 +16338,7 @@ const r8e = (t) => { })); } }); -function Xoe(t) { +function zoe(t) { let e = []; if (t) e: @@ -16354,15 +16354,15 @@ function Xoe(t) { } return e; } -function joe(t, e, r) { +function qoe(t, e, r) { var n; - let i = r ? Xoe(e.actions) : []; + let i = r ? zoe(e.actions) : []; return Gn("li", { class: "cm-diagnostic cm-diagnostic-" + e.severity }, Gn("span", { class: "cm-diagnosticText" }, e.renderMessage ? e.renderMessage(t) : 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 = Ov(t.state.field(xl).diagnostics, e); + let p = yv(t.state.field(vl).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), @@ -16378,7 +16378,7 @@ function joe(t, e, r) { }, f); }), e.source && Gn("div", { class: "cm-diagnosticSource" }, e.source)); } -class s8e extends nl { +class G7e extends el { constructor(e) { super(), this.sev = e; } @@ -16389,17 +16389,17 @@ class s8e extends nl { return Gn("span", { class: "cm-lintPoint cm-lintPoint-" + this.sev }); } } -class AY { +class mY { constructor(e, r) { - this.diagnostic = r, this.id = "item_" + Math.floor(Math.random() * 4294967295).toString(16), this.dom = joe(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 = qoe(e, r, !0), this.dom.id = this.id, this.dom.setAttribute("role", "option"); } } -class rw { +class ew { constructor(e) { this.view = e, this.items = []; let r = (i) => { if (i.keyCode == 27) - _Y(this.view), this.view.focus(); + gY(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) @@ -16411,10 +16411,10 @@ class rw { 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 = Xoe(s.actions); + let { diagnostic: s } = this.items[this.selectedIndex], a = zoe(s.actions); for (let o = 0; o < a.length; o++) if (a[o].toUpperCase().charCodeAt(0) == i.keyCode) { - let l = Ov(this.view.state.field(xl).diagnostics, s); + let l = yv(this.view.state.field(vl).diagnostics, s); l && s.actions[o].apply(e, l.from, l.to); } } else @@ -16434,11 +16434,11 @@ class rw { type: "button", name: "close", "aria-label": this.view.state.phrase("close"), - onclick: () => _Y(this.view) + onclick: () => gY(this.view) }, "\xD7")), this.update(); } get selectedIndex() { - let e = this.view.state.field(xl).selected; + let e = this.view.state.field(vl).selected; if (!e) return -1; for (let r = 0; r < this.items.length; r++) @@ -16447,7 +16447,7 @@ class rw { return -1; } update() { - let { diagnostics: e, selected: r } = this.view.state.field(xl), n = 0, i = !1, s = null, a = /* @__PURE__ */ new Set(); + let { diagnostics: e, selected: r } = this.view.state.field(vl), n = 0, i = !1, s = null, a = /* @__PURE__ */ new Set(); for (e.between(0, this.view.state.doc.length, (o, l, { spec: u }) => { for (let h of u.diagnostics) { if (a.has(h)) @@ -16459,11 +16459,11 @@ class rw { f = p; break; } - f < 0 ? (d = new AY(this.view, h), this.items.splice(n, 0, d), i = !0) : (d = this.items[f], f > n && (this.items.splice(n, f - n), i = !0)), r && d.diagnostic == r.diagnostic ? d.dom.hasAttribute("aria-selected") || (d.dom.setAttribute("aria-selected", "true"), s = d) : d.dom.hasAttribute("aria-selected") && d.dom.removeAttribute("aria-selected"), n++; + f < 0 ? (d = new mY(this.view, h), this.items.splice(n, 0, d), i = !0) : (d = this.items[f], f > n && (this.items.splice(n, f - n), i = !0)), r && d.diagnostic == r.diagnostic ? d.dom.hasAttribute("aria-selected") || (d.dom.setAttribute("aria-selected", "true"), s = d) : d.dom.hasAttribute("aria-selected") && d.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 AY(this.view, { + this.items.length == 0 && (this.items.push(new mY(this.view, { from: -1, to: -1, severity: "info", @@ -16496,24 +16496,24 @@ class rw { moveSelection(e) { if (this.selectedIndex < 0) return; - let r = this.view.state.field(xl), n = Ov(r.diagnostics, this.items[e].diagnostic); + let r = this.view.state.field(vl), n = yv(r.diagnostics, this.items[e].diagnostic); !n || this.view.dispatch({ selection: { anchor: n.from, head: n.to }, scrollIntoView: !0, - effects: Hoe.of(n) + effects: Foe.of(n) }); } static open(e) { - return new rw(e); + return new ew(e); } } -function a8e(t, e = 'viewBox="0 0 40 40"') { +function H7e(t, e = 'viewBox="0 0 40 40"') { return `url('data:image/svg+xml,${encodeURIComponent(t)}')`; } -function pS(t) { - return a8e(``, 'width="6" height="3"'); +function hS(t) { + return H7e(``, 'width="6" height="3"'); } -const o8e = /* @__PURE__ */ Mt.baseTheme({ +const X7e = /* @__PURE__ */ Mt.baseTheme({ ".cm-diagnostic": { padding: "3px 6px 3px 8px", marginLeft: "-1px", @@ -16543,10 +16543,10 @@ const o8e = /* @__PURE__ */ Mt.baseTheme({ backgroundRepeat: "repeat-x", paddingBottom: "0.7px" }, - ".cm-lintRange-error": { backgroundImage: /* @__PURE__ */ pS("#d11") }, - ".cm-lintRange-warning": { backgroundImage: /* @__PURE__ */ pS("orange") }, - ".cm-lintRange-info": { backgroundImage: /* @__PURE__ */ pS("#999") }, - ".cm-lintRange-hint": { backgroundImage: /* @__PURE__ */ pS("#66d") }, + ".cm-lintRange-error": { backgroundImage: /* @__PURE__ */ hS("#d11") }, + ".cm-lintRange-warning": { backgroundImage: /* @__PURE__ */ hS("orange") }, + ".cm-lintRange-info": { backgroundImage: /* @__PURE__ */ hS("#999") }, + ".cm-lintRange-hint": { backgroundImage: /* @__PURE__ */ hS("#66d") }, ".cm-lintRange-active": { backgroundColor: "#ffdd9980" }, ".cm-tooltip-lint": { padding: 0, @@ -16604,60 +16604,60 @@ const o8e = /* @__PURE__ */ Mt.baseTheme({ } } }); -function l8e(t) { +function j7e(t) { return t == "error" ? 4 : t == "warning" ? 3 : t == "info" ? 2 : 1; } -function c8e(t) { +function Z7e(t) { let e = "hint", r = 1; for (let n of t) { - let i = l8e(n.severity); + let i = j7e(n.severity); i > r && (r = i, e = n.severity); } return e; } -const u8e = [ - xl, - /* @__PURE__ */ Mt.decorations.compute([xl], (t) => { - let { selected: e, panel: r } = t.field(xl); +const K7e = [ + vl, + /* @__PURE__ */ Mt.decorations.compute([vl], (t) => { + let { selected: e, panel: r } = t.field(vl); return !e || !r || e.from == e.to ? Ht.none : Ht.set([ - J7e.range(e.from, e.to) + q7e.range(e.from, e.to) ]); }), - /* @__PURE__ */ wae(e8e, { hideOn: K7e }), - o8e -], wl = globalThis || void 0 || self, jc = () => /* @__PURE__ */ new Map(), k9 = (t) => { - const e = jc(); + /* @__PURE__ */ fae(U7e, { hideOn: z7e }), + X7e +], yl = globalThis || void 0 || self, Gc = () => /* @__PURE__ */ new Map(), y9 = (t) => { + const e = Gc(); return t.forEach((r, n) => { e.set(n, r); }), e; -}, Zf = (t, e, r) => { +}, Xf = (t, e, r) => { let n = t.get(e); return n === void 0 && t.set(e, n = r()), n; -}, h8e = (t, e) => { +}, J7e = (t, e) => { const r = []; for (const [n, i] of t) r.push(e(i, n)); return r; -}, f8e = (t, e) => { +}, e8e = (t, e) => { for (const [r, n] of t) if (e(n, r)) return !0; return !1; -}, xg = () => /* @__PURE__ */ new Set(), v8 = (t) => t[t.length - 1], d8e = (t, e) => { +}, mg = () => /* @__PURE__ */ new Set(), h8 = (t) => t[t.length - 1], t8e = (t, e) => { for (let r = 0; r < e.length; r++) t.push(e[r]); -}, vp = Array.from, p8e = (t, e) => { +}, fp = Array.from, r8e = (t, e) => { for (let r = 0; r < t.length; r++) if (e(t[r], r, t)) return !0; return !1; -}, S9 = Array.isArray; -class s6 { +}, b9 = Array.isArray; +class t6 { constructor() { - this._observers = jc(); + this._observers = Gc(); } on(e, r) { - Zf(this._observers, e, xg).add(r); + Xf(this._observers, e, mg).add(r); } once(e, r) { const n = (...i) => { @@ -16670,112 +16670,112 @@ class s6 { n !== void 0 && (n.delete(r), n.size === 0 && this._observers.delete(e)); } emit(e, r) { - return vp((this._observers.get(e) || jc()).values()).forEach((n) => n(...r)); + return fp((this._observers.get(e) || Gc()).values()).forEach((n) => n(...r)); } destroy() { - this._observers = jc(); + this._observers = Gc(); } } -const Rf = Math.floor, r5 = Math.abs, a6 = (t, e) => t < e ? t : e, Yp = (t, e) => t > e ? t : e, g8e = Math.pow, Zoe = (t) => t !== 0 ? t < 0 : 1 / t < 0, RY = 1, LY = 2, y8 = 4, b8 = 8, nw = 32, bf = 64, Ol = 128, o6 = 31, T9 = 63, ng = 127, m8e = 2147483647, Koe = Number.MAX_SAFE_INTEGER, v8e = Number.isInteger || ((t) => typeof t == "number" && isFinite(t) && Rf(t) === t), y8e = String.fromCharCode, b8e = (t) => t.toLowerCase(), x8e = /^\s*/g, w8e = (t) => t.replace(x8e, ""), O8e = /([A-Z])/g, MY = (t, e) => w8e(t.replace(O8e, (r) => `${e}${b8e(r)}`)), k8e = (t) => { +const _f = Math.floor, e3 = Math.abs, r6 = (t, e) => t < e ? t : e, zp = (t, e) => t > e ? t : e, n8e = Math.pow, Uoe = (t) => t !== 0 ? t < 0 : 1 / t < 0, vY = 1, yY = 2, f8 = 4, d8 = 8, tw = 32, yf = 64, bl = 128, n6 = 31, x9 = 63, J0 = 127, i8e = 2147483647, Qoe = Number.MAX_SAFE_INTEGER, s8e = Number.isInteger || ((t) => typeof t == "number" && isFinite(t) && _f(t) === t), a8e = String.fromCharCode, o8e = (t) => t.toLowerCase(), l8e = /^\s*/g, c8e = (t) => t.replace(l8e, ""), u8e = /([A-Z])/g, bY = (t, e) => c8e(t.replace(u8e, (r) => `${e}${o8e(r)}`)), h8e = (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; -}, iw = typeof TextEncoder < "u" ? new TextEncoder() : null, S8e = (t) => iw.encode(t), T8e = iw ? S8e : k8e; -let ux = typeof TextDecoder > "u" ? null : new TextDecoder("utf-8", { fatal: !0, ignoreBOM: !0 }); -ux && ux.decode(new Uint8Array()).length === 1 && (ux = null); -class Ck { +}, rw = typeof TextEncoder < "u" ? new TextEncoder() : null, f8e = (t) => rw.encode(t), d8e = rw ? f8e : h8e; +let lx = typeof TextDecoder > "u" ? null : new TextDecoder("utf-8", { fatal: !0, ignoreBOM: !0 }); +lx && lx.decode(new Uint8Array()).length === 1 && (lx = null); +class kk { constructor() { this.cpos = 0, this.cbuf = new Uint8Array(100), this.bufs = []; } } -const Ma = () => new Ck(), _B = (t) => { +const Ra = () => new kk(), mB = (t) => { let e = t.cpos; for (let r = 0; r < t.bufs.length; r++) e += t.bufs[r].length; return e; }, fi = (t) => { - const e = new Uint8Array(_B(t)); + const e = new Uint8Array(mB(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; -}, C8e = (t, e) => { +}, p8e = (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(Yp(r, e) * 2), t.cpos = 0); -}, Ps = (t, e) => { + r - t.cpos < e && (t.bufs.push(new Uint8Array(t.cbuf.buffer, 0, t.cpos)), t.cbuf = new Uint8Array(zp(r, e) * 2), t.cpos = 0); +}, Ms = (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; -}, C9 = Ps, Cr = (t, e) => { - for (; e > ng; ) - Ps(t, Ol | ng & e), e = Rf(e / 128); - Ps(t, ng & e); -}, AB = (t, e) => { - const r = Zoe(e); - for (r && (e = -e), Ps(t, (e > T9 ? Ol : 0) | (r ? bf : 0) | T9 & e), e = Rf(e / 64); e > 0; ) - Ps(t, (e > ng ? Ol : 0) | ng & e), e = Rf(e / 128); -}, E9 = new Uint8Array(3e4), E8e = E9.length / 3, _8e = (t, e) => { - if (e.length < E8e) { - const r = iw.encodeInto(e, E9).written || 0; +}, w9 = Ms, Cr = (t, e) => { + for (; e > J0; ) + Ms(t, bl | J0 & e), e = _f(e / 128); + Ms(t, J0 & e); +}, vB = (t, e) => { + const r = Uoe(e); + for (r && (e = -e), Ms(t, (e > x9 ? bl : 0) | (r ? yf : 0) | x9 & e), e = _f(e / 64); e > 0; ) + Ms(t, (e > J0 ? bl : 0) | J0 & e), e = _f(e / 128); +}, O9 = new Uint8Array(3e4), g8e = O9.length / 3, m8e = (t, e) => { + if (e.length < g8e) { + const r = rw.encodeInto(e, O9).written || 0; Cr(t, r); for (let n = 0; n < r; n++) - Ps(t, E9[n]); + Ms(t, O9[n]); } else - Pi(t, T8e(e)); -}, A8e = (t, e) => { + Di(t, d8e(e)); +}, v8e = (t, e) => { const r = unescape(encodeURIComponent(e)), n = r.length; Cr(t, n); for (let i = 0; i < n; i++) - Ps(t, r.codePointAt(i)); -}, ig = iw && iw.encodeInto ? _8e : A8e, l6 = (t, e) => { - const r = t.cbuf.length, n = t.cpos, i = a6(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(Yp(r * 2, s)), t.cbuf.set(e.subarray(i)), t.cpos = s); -}, Pi = (t, e) => { - Cr(t, e.byteLength), l6(t, e); -}, RB = (t, e) => { - C8e(t, e); + Ms(t, r.codePointAt(i)); +}, eg = rw && rw.encodeInto ? m8e : v8e, i6 = (t, e) => { + const r = t.cbuf.length, n = t.cpos, i = r6(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(zp(r * 2, s)), t.cbuf.set(e.subarray(i)), t.cpos = s); +}, Di = (t, e) => { + Cr(t, e.byteLength), i6(t, e); +}, yB = (t, e) => { + p8e(t, e); const r = new DataView(t.cbuf.buffer, t.cpos, e); return t.cpos += e, r; -}, R8e = (t, e) => RB(t, 4).setFloat32(0, e, !1), L8e = (t, e) => RB(t, 8).setFloat64(0, e, !1), M8e = (t, e) => RB(t, 8).setBigInt64(0, e, !1), DY = new DataView(new ArrayBuffer(4)), D8e = (t) => (DY.setFloat32(0, t), DY.getFloat32(0) === t), sw = (t, e) => { +}, y8e = (t, e) => yB(t, 4).setFloat32(0, e, !1), b8e = (t, e) => yB(t, 8).setFloat64(0, e, !1), x8e = (t, e) => yB(t, 8).setBigInt64(0, e, !1), xY = new DataView(new ArrayBuffer(4)), w8e = (t) => (xY.setFloat32(0, t), xY.getFloat32(0) === t), nw = (t, e) => { switch (typeof e) { case "string": - Ps(t, 119), ig(t, e); + Ms(t, 119), eg(t, e); break; case "number": - v8e(e) && r5(e) <= m8e ? (Ps(t, 125), AB(t, e)) : D8e(e) ? (Ps(t, 124), R8e(t, e)) : (Ps(t, 123), L8e(t, e)); + s8e(e) && e3(e) <= i8e ? (Ms(t, 125), vB(t, e)) : w8e(e) ? (Ms(t, 124), y8e(t, e)) : (Ms(t, 123), b8e(t, e)); break; case "bigint": - Ps(t, 122), M8e(t, e); + Ms(t, 122), x8e(t, e); break; case "object": if (e === null) - Ps(t, 126); - else if (S9(e)) { - Ps(t, 117), Cr(t, e.length); + Ms(t, 126); + else if (b9(e)) { + Ms(t, 117), Cr(t, e.length); for (let r = 0; r < e.length; r++) - sw(t, e[r]); + nw(t, e[r]); } else if (e instanceof Uint8Array) - Ps(t, 116), Pi(t, e); + Ms(t, 116), Di(t, e); else { - Ps(t, 118); + Ms(t, 118); const r = Object.keys(e); Cr(t, r.length); for (let n = 0; n < r.length; n++) { const i = r[n]; - ig(t, i), sw(t, e[i]); + eg(t, i), nw(t, e[i]); } } break; case "boolean": - Ps(t, e ? 120 : 121); + Ms(t, e ? 120 : 121); break; default: - Ps(t, 127); + Ms(t, 127); } }; -class PY extends Ck { +class wY extends kk { constructor(e) { super(), this.w = e, this.s = null, this.count = 0; } @@ -16783,95 +16783,95 @@ class PY extends Ck { this.s === e ? this.count++ : (this.count > 0 && Cr(this, this.count - 1), this.count = 1, this.w(this, e), this.s = e); } } -const NY = (t) => { - t.count > 0 && (AB(t.encoder, t.count === 1 ? t.s : -t.s), t.count > 1 && Cr(t.encoder, t.count - 2)); +const OY = (t) => { + t.count > 0 && (vB(t.encoder, t.count === 1 ? t.s : -t.s), t.count > 1 && Cr(t.encoder, t.count - 2)); }; -class n5 { +class t3 { constructor() { - this.encoder = new Ck(), this.s = 0, this.count = 0; + this.encoder = new kk(), this.s = 0, this.count = 0; } write(e) { - this.s === e ? this.count++ : (NY(this), this.count = 1, this.s = e); + this.s === e ? this.count++ : (OY(this), this.count = 1, this.s = e); } toUint8Array() { - return NY(this), fi(this.encoder); + return OY(this), fi(this.encoder); } } -const IY = (t) => { +const kY = (t) => { if (t.count > 0) { const e = t.diff * 2 + (t.count === 1 ? 0 : 1); - AB(t.encoder, e), t.count > 1 && Cr(t.encoder, t.count - 2); + vB(t.encoder, e), t.count > 1 && Cr(t.encoder, t.count - 2); } }; -class x8 { +class p8 { constructor() { - this.encoder = new Ck(), this.s = 0, this.count = 0, this.diff = 0; + this.encoder = new kk(), this.s = 0, this.count = 0, this.diff = 0; } write(e) { - this.diff === e - this.s ? (this.s = e, this.count++) : (IY(this), this.count = 1, this.diff = e - this.s, this.s = e); + this.diff === e - this.s ? (this.s = e, this.count++) : (kY(this), this.count = 1, this.diff = e - this.s, this.s = e); } toUint8Array() { - return IY(this), fi(this.encoder); + return kY(this), fi(this.encoder); } } -class P8e { +class O8e { constructor() { - this.sarr = [], this.s = "", this.lensE = new n5(); + this.sarr = [], this.s = "", this.lensE = new t3(); } 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 Ck(); - return this.sarr.push(this.s), this.s = "", ig(e, this.sarr.join("")), l6(e, this.lensE.toUint8Array()), fi(e); + const e = new kk(); + return this.sarr.push(this.s), this.s = "", eg(e, this.sarr.join("")), i6(e, this.lensE.toUint8Array()), fi(e); } } -const yp = (t) => new Error(t), oh = () => { - throw yp("Method unimplemented"); -}, uu = () => { - throw yp("Unexpected case"); -}, Joe = yp("Unexpected end of array"), ele = yp("Integer out of Range"); -class c6 { +const dp = (t) => new Error(t), ih = () => { + throw dp("Method unimplemented"); +}, ou = () => { + throw dp("Unexpected case"); +}, Voe = dp("Unexpected end of array"), Woe = dp("Integer out of Range"); +class s6 { constructor(e) { this.arr = e, this.pos = 0; } } -const Gp = (t) => new c6(t), N8e = (t) => t.pos !== t.arr.length, I8e = (t, e) => { +const qp = (t) => new s6(t), k8e = (t) => t.pos !== t.arr.length, S8e = (t, e) => { const r = new Uint8Array(t.arr.buffer, t.pos + t.arr.byteOffset, e); return t.pos += e, r; -}, La = (t) => I8e(t, zr(t)), kv = (t) => t.arr[t.pos++], zr = (t) => { +}, Aa = (t) => S8e(t, zr(t)), bv = (t) => t.arr[t.pos++], zr = (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 & ng) * r, r *= 128, i < Ol) + if (e = e + (i & J0) * r, r *= 128, i < bl) return e; - if (e > Koe) - throw ele; - } - throw Joe; -}, LB = (t) => { - let e = t.arr[t.pos++], r = e & T9, n = 64; - const i = (e & bf) > 0 ? -1 : 1; - if ((e & Ol) === 0) + if (e > Qoe) + throw Woe; + } + throw Voe; +}, bB = (t) => { + let e = t.arr[t.pos++], r = e & x9, n = 64; + const i = (e & yf) > 0 ? -1 : 1; + if ((e & bl) === 0) return i * r; const s = t.arr.length; for (; t.pos < s; ) { - if (e = t.arr[t.pos++], r = r + (e & ng) * n, n *= 128, e < Ol) + if (e = t.arr[t.pos++], r = r + (e & J0) * n, n *= 128, e < bl) return i * r; - if (r > Koe) - throw ele; + if (r > Qoe) + throw Woe; } - throw Joe; -}, $8e = (t) => { + throw Voe; +}, T8e = (t) => { let e = zr(t); if (e === 0) return ""; { - let r = String.fromCodePoint(kv(t)); + let r = String.fromCodePoint(bv(t)); if (--e < 100) for (; e--; ) - r += String.fromCodePoint(kv(t)); + r += String.fromCodePoint(bv(t)); else for (; e > 0; ) { const n = e < 1e4 ? e : 1e4, i = t.arr.subarray(t.pos, t.pos + n); @@ -16879,93 +16879,93 @@ const Gp = (t) => new c6(t), N8e = (t) => t.pos !== t.arr.length, I8e = (t, e) = } return decodeURIComponent(escape(r)); } -}, B8e = (t) => ux.decode(La(t)), Yd = ux ? B8e : $8e, MB = (t, e) => { +}, C8e = (t) => lx.decode(Aa(t)), Qd = lx ? C8e : T8e, xB = (t, e) => { const r = new DataView(t.arr.buffer, t.arr.byteOffset + t.pos, e); return t.pos += e, r; -}, F8e = (t) => MB(t, 4).getFloat32(0, !1), z8e = (t) => MB(t, 8).getFloat64(0, !1), q8e = (t) => MB(t, 8).getBigInt64(0, !1), U8e = [ +}, E8e = (t) => xB(t, 4).getFloat32(0, !1), _8e = (t) => xB(t, 8).getFloat64(0, !1), A8e = (t) => xB(t, 8).getBigInt64(0, !1), R8e = [ (t) => { }, (t) => null, - LB, - F8e, - z8e, - q8e, + bB, + E8e, + _8e, + A8e, (t) => !1, (t) => !0, - Yd, + Qd, (t) => { const e = zr(t), r = {}; for (let n = 0; n < e; n++) { - const i = Yd(t); - r[i] = aw(t); + const i = Qd(t); + r[i] = iw(t); } return r; }, (t) => { const e = zr(t), r = []; for (let n = 0; n < e; n++) - r.push(aw(t)); + r.push(iw(t)); return r; }, - La -], aw = (t) => U8e[127 - kv(t)](t); -class $Y extends c6 { + Aa +], iw = (t) => R8e[127 - bv(t)](t); +class SY extends s6 { constructor(e, r) { super(e), this.reader = r, this.s = null, this.count = 0; } read() { - return this.count === 0 && (this.s = this.reader(this), N8e(this) ? this.count = zr(this) + 1 : this.count = -1), this.count--, this.s; + return this.count === 0 && (this.s = this.reader(this), k8e(this) ? this.count = zr(this) + 1 : this.count = -1), this.count--, this.s; } } -class i5 extends c6 { +class r3 extends s6 { constructor(e) { super(e), this.s = 0, this.count = 0; } read() { if (this.count === 0) { - this.s = LB(this); - const e = Zoe(this.s); + this.s = bB(this); + const e = Uoe(this.s); this.count = 1, e && (this.s = -this.s, this.count = zr(this) + 2); } return this.count--, this.s; } } -class w8 extends c6 { +class g8 extends s6 { constructor(e) { super(e), this.s = 0, this.count = 0, this.diff = 0; } read() { if (this.count === 0) { - const e = LB(this), r = e & 1; - this.diff = Rf(e / 2), this.count = 1, r && (this.count = zr(this) + 2); + const e = bB(this), r = e & 1; + this.diff = _f(e / 2), this.count = 1, r && (this.count = zr(this) + 2); } return this.s += this.diff, this.count--, this.s; } } -class Q8e { +class L8e { constructor(e) { - this.decoder = new i5(e), this.str = Yd(this.decoder), this.spos = 0; + this.decoder = new r3(e), this.str = Qd(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 V8e = crypto.getRandomValues.bind(crypto), tle = () => V8e(new Uint32Array(1))[0], W8e = [1e7] + -1e3 + -4e3 + -8e3 + -1e11, Y8e = () => W8e.replace( +const M8e = crypto.getRandomValues.bind(crypto), Yoe = () => M8e(new Uint32Array(1))[0], D8e = [1e7] + -1e3 + -4e3 + -8e3 + -1e11, P8e = () => D8e.replace( /[018]/g, - (t) => (t ^ tle() & 15 >> t / 4).toString(16) -), bp = Date.now, BY = (t) => new Promise(t); + (t) => (t ^ Yoe() & 15 >> t / 4).toString(16) +), pp = Date.now, TY = (t) => new Promise(t); Promise.all.bind(Promise); -var Es = {}, u6 = {}; -u6.byteLength = X8e; -u6.toByteArray = Z8e; -u6.fromByteArray = eRe; -var Wu = [], Wl = [], G8e = typeof Uint8Array < "u" ? Uint8Array : Array, O8 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -for (var qm = 0, H8e = O8.length; qm < H8e; ++qm) - Wu[qm] = O8[qm], Wl[O8.charCodeAt(qm)] = qm; -Wl["-".charCodeAt(0)] = 62; -Wl["_".charCodeAt(0)] = 63; -function rle(t) { +var Ts = {}, a6 = {}; +a6.byteLength = $8e; +a6.toByteArray = F8e; +a6.fromByteArray = U8e; +var Uu = [], Ul = [], N8e = typeof Uint8Array < "u" ? Uint8Array : Array, m8 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +for (var Bm = 0, I8e = m8.length; Bm < I8e; ++Bm) + Uu[Bm] = m8[Bm], Ul[m8.charCodeAt(Bm)] = Bm; +Ul["-".charCodeAt(0)] = 62; +Ul["_".charCodeAt(0)] = 63; +function Goe(t) { var e = t.length; if (e % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4"); @@ -16974,39 +16974,39 @@ function rle(t) { var n = r === e ? 0 : 4 - r % 4; return [r, n]; } -function X8e(t) { - var e = rle(t), r = e[0], n = e[1]; +function $8e(t) { + var e = Goe(t), r = e[0], n = e[1]; return (r + n) * 3 / 4 - n; } -function j8e(t, e, r) { +function B8e(t, e, r) { return (e + r) * 3 / 4 - r; } -function Z8e(t) { - var e, r = rle(t), n = r[0], i = r[1], s = new G8e(j8e(t, n, i)), a = 0, o = i > 0 ? n - 4 : n, l; +function F8e(t) { + var e, r = Goe(t), n = r[0], i = r[1], s = new N8e(B8e(t, n, i)), a = 0, o = i > 0 ? n - 4 : n, l; for (l = 0; l < o; l += 4) - e = Wl[t.charCodeAt(l)] << 18 | Wl[t.charCodeAt(l + 1)] << 12 | Wl[t.charCodeAt(l + 2)] << 6 | Wl[t.charCodeAt(l + 3)], s[a++] = e >> 16 & 255, s[a++] = e >> 8 & 255, s[a++] = e & 255; - return i === 2 && (e = Wl[t.charCodeAt(l)] << 2 | Wl[t.charCodeAt(l + 1)] >> 4, s[a++] = e & 255), i === 1 && (e = Wl[t.charCodeAt(l)] << 10 | Wl[t.charCodeAt(l + 1)] << 4 | Wl[t.charCodeAt(l + 2)] >> 2, s[a++] = e >> 8 & 255, s[a++] = e & 255), s; + e = Ul[t.charCodeAt(l)] << 18 | Ul[t.charCodeAt(l + 1)] << 12 | Ul[t.charCodeAt(l + 2)] << 6 | Ul[t.charCodeAt(l + 3)], s[a++] = e >> 16 & 255, s[a++] = e >> 8 & 255, s[a++] = e & 255; + return i === 2 && (e = Ul[t.charCodeAt(l)] << 2 | Ul[t.charCodeAt(l + 1)] >> 4, s[a++] = e & 255), i === 1 && (e = Ul[t.charCodeAt(l)] << 10 | Ul[t.charCodeAt(l + 1)] << 4 | Ul[t.charCodeAt(l + 2)] >> 2, s[a++] = e >> 8 & 255, s[a++] = e & 255), s; } -function K8e(t) { - return Wu[t >> 18 & 63] + Wu[t >> 12 & 63] + Wu[t >> 6 & 63] + Wu[t & 63]; +function z8e(t) { + return Uu[t >> 18 & 63] + Uu[t >> 12 & 63] + Uu[t >> 6 & 63] + Uu[t & 63]; } -function J8e(t, e, r) { +function q8e(t, e, r) { for (var n, i = [], s = e; s < r; s += 3) - n = (t[s] << 16 & 16711680) + (t[s + 1] << 8 & 65280) + (t[s + 2] & 255), i.push(K8e(n)); + n = (t[s] << 16 & 16711680) + (t[s + 1] << 8 & 65280) + (t[s + 2] & 255), i.push(z8e(n)); return i.join(""); } -function eRe(t) { +function U8e(t) { for (var e, r = t.length, n = r % 3, i = [], s = 16383, a = 0, o = r - n; a < o; a += s) - i.push(J8e(t, a, a + s > o ? o : a + s)); + i.push(q8e(t, a, a + s > o ? o : a + s)); return n === 1 ? (e = t[r - 1], i.push( - Wu[e >> 2] + Wu[e << 4 & 63] + "==" + Uu[e >> 2] + Uu[e << 4 & 63] + "==" )) : n === 2 && (e = (t[r - 2] << 8) + t[r - 1], i.push( - Wu[e >> 10] + Wu[e >> 4 & 63] + Wu[e << 2 & 63] + "=" + Uu[e >> 10] + Uu[e >> 4 & 63] + Uu[e << 2 & 63] + "=" )), i.join(""); } -var DB = {}; +var wB = {}; /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ -DB.read = function(t, e, r, n, i) { +wB.read = function(t, e, r, n, i) { var s, a, o = i * 8 - n - 1, l = (1 << o) - 1, u = l >> 1, h = -7, f = r ? i - 1 : 0, d = r ? -1 : 1, p = t[e + f]; for (f += d, s = p & (1 << -h) - 1, p >>= -h, h += o; h > 0; s = s * 256 + t[e + f], f += d, h -= 8) ; @@ -17021,7 +17021,7 @@ DB.read = function(t, e, r, n, i) { } return (p ? -1 : 1) * a * Math.pow(2, s - n); }; -DB.write = function(t, e, r, n, i, s) { +wB.write = function(t, e, r, n, i, s) { var a, o, l, u = s * 8 - i - 1, h = (1 << u) - 1, f = h >> 1, d = i === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, p = n ? 0 : s - 1, g = n ? 1 : -1, m = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0; for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (o = isNaN(e) ? 1 : 0, a = h) : (a = Math.floor(Math.log(e) / Math.LN2), e * (l = Math.pow(2, -a)) < 1 && (a--, l *= 2), a + f >= 1 ? e += d / l : e += d * Math.pow(2, 1 - f), e * l >= 2 && (a++, l /= 2), a + f >= h ? (o = 0, a = h) : a + f >= 1 ? (o = (e * l - 1) * Math.pow(2, i), a = a + f) : (o = e * Math.pow(2, f - 1) * Math.pow(2, i), a = 0)); i >= 8; t[r + p] = o & 255, p += g, o /= 256, i -= 8) ; @@ -17036,7 +17036,7 @@ DB.write = function(t, e, r, n, i, s) { * @license MIT */ (function(t) { - const e = u6, r = DB, n = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null; + const e = a6, r = wB, n = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null; t.Buffer = h, t.SlowBuffer = S, t.INSPECT_MAX_BYTES = 50; const i = 2147483647; t.kMaxLength = i; @@ -17289,7 +17289,7 @@ DB.write = function(t, e, r, n, i, s) { return Z(this, U, Q); case "utf8": case "utf-8": - return D(this, U, Q); + return M(this, U, Q); case "ascii": return Y(this, U, Q); case "latin1": @@ -17309,7 +17309,7 @@ DB.write = function(t, e, r, n, i, s) { } } h.prototype._isBuffer = !0; - function L(H, U, Q) { + function D(H, U, Q) { const te = H[U]; H[U] = H[Q], H[Q] = te; } @@ -17318,25 +17318,25 @@ DB.write = function(t, e, r, n, i, s) { if (U % 2 !== 0) throw new RangeError("Buffer size must be a multiple of 16-bits"); for (let Q = 0; Q < U; Q += 2) - L(this, Q, Q + 1); + D(this, Q, Q + 1); return this; }, h.prototype.swap32 = function() { const U = this.length; if (U % 4 !== 0) throw new RangeError("Buffer size must be a multiple of 32-bits"); for (let Q = 0; Q < U; Q += 4) - L(this, Q, Q + 3), L(this, Q + 1, Q + 2); + D(this, Q, Q + 3), D(this, Q + 1, Q + 2); return this; }, h.prototype.swap64 = function() { const U = this.length; if (U % 8 !== 0) throw new RangeError("Buffer size must be a multiple of 64-bits"); for (let Q = 0; Q < U; Q += 8) - L(this, Q, Q + 7), L(this, Q + 1, Q + 6), L(this, Q + 2, Q + 5), L(this, Q + 3, Q + 4); + D(this, Q, Q + 7), D(this, Q + 1, Q + 6), D(this, Q + 2, Q + 5), D(this, Q + 3, Q + 4); return this; }, h.prototype.toString = function() { const U = this.length; - return U === 0 ? "" : arguments.length === 0 ? D(this, 0, U) : T.apply(this, arguments); + return U === 0 ? "" : arguments.length === 0 ? M(this, 0, U) : T.apply(this, arguments); }, h.prototype.toLocaleString = h.prototype.toString, h.prototype.equals = function(U) { if (!h.isBuffer(U)) throw new TypeError("Argument must be a Buffer"); @@ -17382,12 +17382,12 @@ DB.write = function(t, e, r, n, i, s) { else return -1; if (typeof U == "string" && (U = h.from(U, te)), h.isBuffer(U)) - return U.length === 0 ? -1 : P(H, U, Q, te, he); + return U.length === 0 ? -1 : N(H, U, Q, te, he); if (typeof U == "number") - return U = U & 255, typeof s.prototype.indexOf == "function" ? he ? s.prototype.indexOf.call(H, U, Q) : s.prototype.lastIndexOf.call(H, U, Q) : P(H, [U], Q, te, he); + return U = U & 255, typeof s.prototype.indexOf == "function" ? he ? s.prototype.indexOf.call(H, U, Q) : s.prototype.lastIndexOf.call(H, U, Q) : N(H, [U], Q, te, he); throw new TypeError("val must be string, number or Buffer"); } - function P(H, U, Q, te, he) { + function N(H, U, Q, te, he) { let Te = 1, Se = H.length, $e = U.length; if (te !== void 0 && (te = String(te).toLowerCase(), te === "ucs2" || te === "ucs-2" || te === "utf16le" || te === "utf-16le")) { if (H.length < 2 || U.length < 2) @@ -17426,7 +17426,7 @@ DB.write = function(t, e, r, n, i, s) { }, h.prototype.lastIndexOf = function(U, Q, te) { return E(this, U, Q, te, !1); }; - function M(H, U, Q, te) { + function P(H, U, Q, te) { Q = Number(Q) || 0; const he = H.length - Q; te ? (te = Number(te), te > he && (te = he)) : te = he; @@ -17441,10 +17441,10 @@ DB.write = function(t, e, r, n, i, s) { } return Se; } - function N(H, U, Q, te) { + function L(H, U, Q, te) { return Re(je(U, H.length - Q), H, Q, te); } - function q(H, U, Q, te) { + function F(H, U, Q, te) { return Re(at(U), H, Q, te); } function k(H, U, Q, te) { @@ -17472,14 +17472,14 @@ DB.write = function(t, e, r, n, i, s) { for (; ; ) switch (he) { case "hex": - return M(this, U, Q, te); + return P(this, U, Q, te); case "utf8": case "utf-8": - return N(this, U, Q, te); + return L(this, U, Q, te); case "ascii": case "latin1": case "binary": - return q(this, U, Q, te); + return F(this, U, Q, te); case "base64": return k(this, U, Q, te); case "ucs2": @@ -17501,7 +17501,7 @@ DB.write = function(t, e, r, n, i, s) { function A(H, U, Q) { return U === 0 && Q === H.length ? e.fromByteArray(H) : e.fromByteArray(H.slice(U, Q)); } - function D(H, U, Q) { + function M(H, U, Q) { Q = Math.min(H.length, Q); const te = []; let he = U; @@ -17526,10 +17526,10 @@ DB.write = function(t, e, r, n, i, s) { } Se === null ? (Se = 65533, $e = 1) : Se > 65535 && (Se -= 65536, te.push(Se >>> 10 & 1023 | 55296), Se = 56320 | Se & 1023), te.push(Se), he += $e; } - return z(te); + return q(te); } const I = 4096; - function z(H) { + function q(H) { const U = H.length; if (U <= I) return String.fromCharCode.apply(String, H); @@ -18005,27 +18005,27 @@ DB.write = function(t, e, r, n, i, s) { function ke() { throw new Error("BigInt not supported"); } -})(Es); -const nle = Es.Buffer; -Es.Blob; -Es.BlobOptions; -Es.Buffer; -Es.File; -Es.FileOptions; -Es.INSPECT_MAX_BYTES; -Es.SlowBuffer; -Es.TranscodeEncoding; -Es.atob; -Es.btoa; -Es.constants; -Es.isAscii; -Es.isUtf8; -Es.kMaxLength; -Es.kStringMaxLength; -Es.resolveObjectURL; -Es.transcode; -const FY = (t) => t === void 0 ? null : t; -class tRe { +})(Ts); +const Hoe = Ts.Buffer; +Ts.Blob; +Ts.BlobOptions; +Ts.Buffer; +Ts.File; +Ts.FileOptions; +Ts.INSPECT_MAX_BYTES; +Ts.SlowBuffer; +Ts.TranscodeEncoding; +Ts.atob; +Ts.btoa; +Ts.constants; +Ts.isAscii; +Ts.isUtf8; +Ts.kMaxLength; +Ts.kStringMaxLength; +Ts.resolveObjectURL; +Ts.transcode; +const CY = (t) => t === void 0 ? null : t; +class Q8e { constructor() { this.map = /* @__PURE__ */ new Map(); } @@ -18036,38 +18036,38 @@ class tRe { return this.map.get(e); } } -let ile = new tRe(), PB = !0; +let Xoe = new Q8e(), OB = !0; try { - typeof localStorage < "u" && localStorage && (ile = localStorage, PB = !1); + typeof localStorage < "u" && localStorage && (Xoe = localStorage, OB = !1); } catch { } -const sle = ile, rRe = (t) => PB || addEventListener("storage", t), nRe = (t) => PB || removeEventListener("storage", t), iRe = Object.assign, sRe = Object.keys, aRe = (t, e) => { +const joe = Xoe, V8e = (t) => OB || addEventListener("storage", t), W8e = (t) => OB || removeEventListener("storage", t), Y8e = Object.assign, G8e = Object.keys, H8e = (t, e) => { for (const r in t) e(t[r], r); -}, oRe = (t, e) => { +}, X8e = (t, e) => { const r = []; for (const n in t) r.push(e(t[n], n)); return r; -}, MT = (t) => sRe(t).length, lRe = (t) => { +}, RT = (t) => G8e(t).length, j8e = (t) => { for (const e in t) return !1; return !0; -}, cRe = (t, e) => { +}, Z8e = (t, e) => { for (const r in t) if (!e(t[r], r)) return !1; return !0; -}, ale = (t, e) => Object.prototype.hasOwnProperty.call(t, e), uRe = (t, e) => t === e || MT(t) === MT(e) && cRe(t, (r, n) => (r !== void 0 || ale(e, n)) && e[n] === r), NB = (t, e, r = 0) => { +}, Zoe = (t, e) => Object.prototype.hasOwnProperty.call(t, e), K8e = (t, e) => t === e || RT(t) === RT(e) && Z8e(t, (r, n) => (r !== void 0 || Zoe(e, n)) && e[n] === r), kB = (t, e, r = 0) => { try { for (; r < t.length; r++) t[r](...e); } finally { - r < t.length && NB(t, e, r + 1); + r < t.length && kB(t, e, r + 1); } -}, hRe = (t) => t, fRe = (t, e) => t === e, hx = (t, e) => { +}, J8e = (t) => t, eRe = (t, e) => t === e, cx = (t, e) => { if (t == null || e == null) - return fRe(t, e); + return eRe(t, e); if (t.constructor !== e.constructor) return !1; if (t === e) @@ -18095,92 +18095,92 @@ const sle = ile, rRe = (t) => PB || addEventListener("storage", t), nRe = (t) => if (t.size !== e.size) return !1; for (const r of t.keys()) - if (!e.has(r) || !hx(t.get(r), e.get(r))) + if (!e.has(r) || !cx(t.get(r), e.get(r))) return !1; break; } case Object: - if (MT(t) !== MT(e)) + if (RT(t) !== RT(e)) return !1; for (const r in t) - if (!ale(t, r) || !hx(t[r], e[r])) + if (!Zoe(t, r) || !cx(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 (!hx(t[r], e[r])) + if (!cx(t[r], e[r])) return !1; break; default: return !1; } return !0; -}, dRe = (t, e) => e.includes(t), Sv = typeof $s < "u" && $s.release && /node|io\.js/.test($s.release.name) && Object.prototype.toString.call(typeof $s < "u" ? $s : 0) === "[object process]", ole = typeof window < "u" && typeof document < "u" && !Sv; +}, tRe = (t, e) => e.includes(t), xv = typeof Ns < "u" && Ns.release && /node|io\.js/.test(Ns.release.name) && Object.prototype.toString.call(typeof Ns < "u" ? Ns : 0) === "[object process]", Koe = typeof window < "u" && typeof document < "u" && !xv; typeof navigator < "u" && /Mac/.test(navigator.platform); -let _u; -const pRe = () => { - if (_u === void 0) - if (Sv) { - _u = jc(); - const t = $s.argv; +let Tu; +const rRe = () => { + if (Tu === void 0) + if (xv) { + Tu = Gc(); + const t = Ns.argv; let e = null; for (let r = 0; r < t.length; r++) { const n = t[r]; - n[0] === "-" ? (e !== null && _u.set(e, ""), e = n) : e !== null && (_u.set(e, n), e = null); + n[0] === "-" ? (e !== null && Tu.set(e, ""), e = n) : e !== null && (Tu.set(e, n), e = null); } - e !== null && _u.set(e, ""); + e !== null && Tu.set(e, ""); } else - typeof location == "object" ? (_u = jc(), (location.search || "?").slice(1).split("&").forEach((t) => { + typeof location == "object" ? (Tu = Gc(), (location.search || "?").slice(1).split("&").forEach((t) => { if (t.length !== 0) { const [e, r] = t.split("="); - _u.set(`--${MY(e, "-")}`, r), _u.set(`-${MY(e, "-")}`, r); + Tu.set(`--${bY(e, "-")}`, r), Tu.set(`-${bY(e, "-")}`, r); } - })) : _u = jc(); - return _u; -}, _9 = (t) => pRe().has(t), A9 = (t) => FY(Sv ? {}[t.toUpperCase()] : sle.getItem(t)), gRe = (t) => _9("--" + t) || A9(t) !== null; -gRe("production"); -const zY = Sv && dRe({}.FORCE_COLOR, ["true", "1", "2"]), mRe = !_9("no-colors") && (!Sv || $s.stdout.isTTY || zY) && (!Sv || _9("color") || zY || A9("COLORTERM") !== null || (A9("TERM") || "").includes("color")), lle = (t) => new Uint8Array(t), vRe = (t, e, r) => new Uint8Array(t, e, r), yRe = (t) => new Uint8Array(t), bRe = (t) => { + })) : Tu = Gc(); + return Tu; +}, k9 = (t) => rRe().has(t), S9 = (t) => CY(xv ? {}[t.toUpperCase()] : joe.getItem(t)), nRe = (t) => k9("--" + t) || S9(t) !== null; +nRe("production"); +const EY = xv && tRe({}.FORCE_COLOR, ["true", "1", "2"]), iRe = !k9("no-colors") && (!xv || Ns.stdout.isTTY || EY) && (!xv || k9("color") || EY || S9("COLORTERM") !== null || (S9("TERM") || "").includes("color")), Joe = (t) => new Uint8Array(t), sRe = (t, e, r) => new Uint8Array(t, e, r), aRe = (t) => new Uint8Array(t), oRe = (t) => { let e = ""; for (let r = 0; r < t.byteLength; r++) - e += y8e(t[r]); + e += a8e(t[r]); return btoa(e); -}, xRe = (t) => nle.from(t.buffer, t.byteOffset, t.byteLength).toString("base64"), wRe = (t) => { - const e = atob(t), r = lle(e.length); +}, lRe = (t) => Hoe.from(t.buffer, t.byteOffset, t.byteLength).toString("base64"), cRe = (t) => { + const e = atob(t), r = Joe(e.length); for (let n = 0; n < e.length; n++) r[n] = e.charCodeAt(n); return r; -}, ORe = (t) => { - const e = nle.from(t, "base64"); - return vRe(e.buffer, e.byteOffset, e.byteLength); -}, kRe = ole ? bRe : xRe, SRe = ole ? wRe : ORe, TRe = (t) => { - const e = lle(t.byteLength); +}, uRe = (t) => { + const e = Hoe.from(t, "base64"); + return sRe(e.buffer, e.byteOffset, e.byteLength); +}, hRe = Koe ? oRe : lRe, fRe = Koe ? cRe : uRe, dRe = (t) => { + const e = Joe(t.byteLength); return e.set(t), e; }; -class CRe { +class pRe { constructor(e, r) { this.left = e, this.right = r; } } -const pl = (t, e) => new CRe(t, e), ERe = (t, e) => t.forEach((r) => e(r.left, r.right)), Lh = typeof document < "u" ? document : {}, _Re = (t) => Lh.createElement(t), ARe = () => Lh.createDocumentFragment(), RRe = (t) => Lh.createTextNode(t); +const hl = (t, e) => new pRe(t, e), gRe = (t, e) => t.forEach((r) => e(r.left, r.right)), Eh = typeof document < "u" ? document : {}, mRe = (t) => Eh.createElement(t), vRe = () => Eh.createDocumentFragment(), yRe = (t) => Eh.createTextNode(t); typeof DOMParser < "u" && new DOMParser(); -const LRe = (t, e) => (ERe(e, (r, n) => { +const bRe = (t, e) => (gRe(e, (r, n) => { n === !1 ? t.removeAttribute(r) : n === !0 ? t.setAttribute(r, "") : t.setAttribute(r, n); -}), t), MRe = (t) => { - const e = ARe(); +}), t), xRe = (t) => { + const e = vRe(); for (let r = 0; r < t.length; r++) - cle(e, t[r]); + ele(e, t[r]); return e; -}, DRe = (t, e) => (cle(t, MRe(e)), t), k8 = (t, e = [], r = []) => DRe(LRe(_Re(t), e), r), gS = RRe, PRe = (t) => h8e(t, (e, r) => `${r}:${e};`).join(""), cle = (t, e) => t.appendChild(e); -Lh.ELEMENT_NODE; -Lh.TEXT_NODE; -Lh.CDATA_SECTION_NODE; -Lh.COMMENT_NODE; -Lh.DOCUMENT_NODE; -Lh.DOCUMENT_TYPE_NODE; -Lh.DOCUMENT_FRAGMENT_NODE; -const Kf = Symbol, ule = Kf(), hle = Kf(), NRe = Kf(), IRe = Kf(), $Re = Kf(), fle = Kf(), BRe = Kf(), IB = Kf(), FRe = Kf(), zRe = (t) => { +}, wRe = (t, e) => (ele(t, xRe(e)), t), v8 = (t, e = [], r = []) => wRe(bRe(mRe(t), e), r), fS = yRe, ORe = (t) => J7e(t, (e, r) => `${r}:${e};`).join(""), ele = (t, e) => t.appendChild(e); +Eh.ELEMENT_NODE; +Eh.TEXT_NODE; +Eh.CDATA_SECTION_NODE; +Eh.COMMENT_NODE; +Eh.DOCUMENT_NODE; +Eh.DOCUMENT_TYPE_NODE; +Eh.DOCUMENT_FRAGMENT_NODE; +const jf = Symbol, tle = jf(), rle = jf(), kRe = jf(), SRe = jf(), TRe = jf(), nle = jf(), CRe = jf(), SB = jf(), ERe = jf(), _Re = (t) => { const e = []; let r = 0; for (; r < t.length; r++) { @@ -18188,25 +18188,25 @@ const Kf = Symbol, ule = Kf(), hle = Kf(), NRe = Kf(), IRe = Kf(), $Re = Kf(), f n.constructor === String || n.constructor === Number || n.constructor === Object && e.push(JSON.stringify(n)); } return e; -}, qRe = { - [ule]: pl("font-weight", "bold"), - [hle]: pl("font-weight", "normal"), - [NRe]: pl("color", "blue"), - [$Re]: pl("color", "green"), - [IRe]: pl("color", "grey"), - [fle]: pl("color", "red"), - [BRe]: pl("color", "purple"), - [IB]: pl("color", "orange"), - [FRe]: pl("color", "black") -}, URe = (t) => { - const e = [], r = [], n = jc(); +}, ARe = { + [tle]: hl("font-weight", "bold"), + [rle]: hl("font-weight", "normal"), + [kRe]: hl("color", "blue"), + [TRe]: hl("color", "green"), + [SRe]: hl("color", "grey"), + [nle]: hl("color", "red"), + [CRe]: hl("color", "purple"), + [SB]: hl("color", "orange"), + [ERe]: hl("color", "black") +}, RRe = (t) => { + const e = [], r = [], n = Gc(); let i = [], s = 0; for (; s < t.length; s++) { - const a = t[s], o = qRe[a]; + const a = t[s], o = ARe[a]; if (o !== void 0) n.set(o.left, o.right); else if (a.constructor === String || a.constructor === Number) { - const l = PRe(n); + const l = ORe(n); s > 0 || l.length > 0 ? (e.push("%c" + a), r.push(l)) : e.push(a); } else break; @@ -18216,45 +18216,45 @@ const Kf = Symbol, ule = Kf(), hle = Kf(), NRe = Kf(), IRe = Kf(), $Re = Kf(), f a instanceof Symbol || i.push(a); } return i; -}, dle = mRe ? URe : zRe, QRe = (...t) => { - console.log(...dle(t)), ple.forEach((e) => e.print(t)); -}, VRe = (...t) => { - console.warn(...dle(t)), t.unshift(IB), ple.forEach((e) => e.print(t)); -}, ple = xg(), gle = (t) => ({ +}, ile = iRe ? RRe : _Re, LRe = (...t) => { + console.log(...ile(t)), sle.forEach((e) => e.print(t)); +}, MRe = (...t) => { + console.warn(...ile(t)), t.unshift(SB), sle.forEach((e) => e.print(t)); +}, sle = mg(), ale = (t) => ({ [Symbol.iterator]() { return this; }, next: t -}), WRe = (t, e) => gle(() => { +}), DRe = (t, e) => ale(() => { let r; do r = t.next(); while (!r.done && !e(r.value)); return r; -}), S8 = (t, e) => gle(() => { +}), y8 = (t, e) => ale(() => { const { done: r, value: n } = t.next(); return { done: r, value: r ? void 0 : e(n) }; }); -class $B { +class TB { constructor(e, r) { this.clock = e, this.len = r; } } -class qy { +class Iy { constructor() { this.clients = /* @__PURE__ */ new Map(); } } -const Tv = (t, e, r) => e.clients.forEach((n, i) => { +const wv = (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]; - Rle(t, s, o.clock, o.len, r); + wle(t, s, o.clock, o.len, r); } -}), YRe = (t, e) => { +}), PRe = (t, e) => { let r = 0, n = t.length - 1; for (; r <= n; ) { - const i = Rf((r + n) / 2), s = t[i], a = s.clock; + const i = _f((r + n) / 2), s = t[i], a = s.clock; if (a <= e) { if (e < a + s.len) return i; @@ -18263,35 +18263,35 @@ const Tv = (t, e, r) => e.clients.forEach((n, i) => { n = i - 1; } return null; -}, Ek = (t, e) => { +}, Sk = (t, e) => { const r = t.clients.get(e.client); - return r !== void 0 && YRe(r, e.clock) !== null; -}, BB = (t) => { + return r !== void 0 && PRe(r, e.clock) !== null; +}, CB = (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 = Yp(i.len, s.clock + s.len - i.clock) : (n < r && (e[n] = s), n++); + i.clock + i.len >= s.clock ? i.len = zp(i.len, s.clock + s.len - i.clock) : (n < r && (e[n] = s), n++); } e.length = n; }); -}, R9 = (t) => { - const e = new qy(); +}, T9 = (t) => { + const e = new Iy(); 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++) - d8e(s, t[a].clients.get(i) || []); + t8e(s, t[a].clients.get(i) || []); e.clients.set(i, s); } }); - return BB(e), e; -}, ow = (t, e, r, n) => { - Zf(t.clients, e, () => []).push(new $B(r, n)); -}, mle = () => new qy(), GRe = (t) => { - const e = mle(); + return CB(e), e; +}, sw = (t, e, r, n) => { + Xf(t.clients, e, () => []).push(new TB(r, n)); +}, ole = () => new Iy(), NRe = (t) => { + const e = ole(); return t.clients.forEach((r, n) => { const i = []; for (let s = 0; s < r.length; s++) { @@ -18302,13 +18302,13 @@ const Tv = (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 $B(o, l)); + i.push(new TB(o, l)); } } i.length > 0 && e.clients.set(n, i); }), e; -}, Uy = (t, e) => { - Cr(t.restEncoder, e.clients.size), vp(e.clients.entries()).sort((r, n) => n[0] - r[0]).forEach(([r, n]) => { +}, $y = (t, e) => { + Cr(t.restEncoder, e.clients.size), fp(e.clients.entries()).sort((r, n) => n[0] - r[0]).forEach(([r, n]) => { t.resetDsCurVal(), Cr(t.restEncoder, r); const i = n.length; Cr(t.restEncoder, i); @@ -18317,48 +18317,48 @@ const Tv = (t, e, r) => e.clients.forEach((n, i) => { t.writeDsClock(a.clock), t.writeDsLen(a.len); } }); -}, FB = (t) => { - const e = new qy(), r = zr(t.restDecoder); +}, EB = (t) => { + const e = new Iy(), r = zr(t.restDecoder); for (let n = 0; n < r; n++) { t.resetDsCurVal(); const i = zr(t.restDecoder), s = zr(t.restDecoder); if (s > 0) { - const a = Zf(e.clients, i, () => []); + const a = Xf(e.clients, i, () => []); for (let o = 0; o < s; o++) - a.push(new $B(t.readDsClock(), t.readDsLen())); + a.push(new TB(t.readDsClock(), t.readDsLen())); } } return e; -}, qY = (t, e, r) => { - const n = new qy(), i = zr(t.restDecoder); +}, _Y = (t, e, r) => { + const n = new Iy(), i = zr(t.restDecoder); for (let s = 0; s < i; s++) { t.resetDsCurVal(); - const a = zr(t.restDecoder), o = zr(t.restDecoder), l = r.clients.get(a) || [], u = qi(r, a); + const a = zr(t.restDecoder), o = zr(t.restDecoder), l = r.clients.get(a) || [], u = zi(r, a); for (let h = 0; h < o; h++) { const f = t.readDsClock(), d = f + t.readDsLen(); if (f < u) { - u < d && ow(n, a, u, d - u); - let p = vh(l, f), g = l[p]; - for (!g.deleted && g.id.clock < f && (l.splice(p + 1, 0, zT(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, zT(e, g, d - g.id.clock)), g.delete(e)); + u < d && sw(n, a, u, d - u); + let p = ph(l, f), g = l[p]; + for (!g.deleted && g.id.clock < f && (l.splice(p + 1, 0, BT(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, BT(e, g, d - g.id.clock)), g.delete(e)); } else - ow(n, a, f, d - f); + sw(n, a, f, d - f); } } if (n.clients.size > 0) { - const s = new wg(); - return Cr(s.restEncoder, 0), Uy(s, n), s.toUint8Array(); + const s = new vg(); + return Cr(s.restEncoder, 0), $y(s, n), s.toUint8Array(); } return null; -}, vle = tle; -class Qy extends s6 { - constructor({ guid: e = Y8e(), 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 = vle(), this.guid = e, this.collectionid = r, this.share = /* @__PURE__ */ new Map(), this.store = new _le(), 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 = BY((u) => { +}, lle = Yoe; +class By extends t6 { + constructor({ guid: e = P8e(), 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 = lle(), this.guid = e, this.collectionid = r, this.share = /* @__PURE__ */ new Map(), this.store = new ble(), 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 = TY((u) => { this.on("load", () => { this.isLoaded = !0, u(this); }); }); - const l = () => BY((u) => { + const l = () => TY((u) => { const h = (f) => { (f === void 0 || f === !0) && (this.off("sync", h), u()); }; @@ -18378,18 +18378,18 @@ class Qy extends s6 { return this.subdocs; } getSubdocGuids() { - return new Set(vp(this.subdocs).map((e) => e.guid)); + return new Set(fp(this.subdocs).map((e) => e.guid)); } transact(e, r = null) { return Bn(this, e, r); } - get(e, r = ua) { - const n = Zf(this.share, e, () => { + get(e, r = ca) { + const n = Xf(this.share, e, () => { const s = new r(); return s._integrate(this, null), s; }), i = n.constructor; - if (r !== ua && i !== r) - if (i === ua) { + if (r !== ca && i !== r) + if (i === ca) { const s = new r(); s._map = n._map, n._map.forEach((a) => { for (; a !== null; a = a.left) @@ -18403,16 +18403,16 @@ class Qy extends s6 { return n; } getArray(e = "") { - return this.get(e, F1); + return this.get(e, N1); } getText(e = "") { - return this.get(e, Ev); + return this.get(e, kv); } getMap(e = "") { - return this.get(e, lh); + return this.get(e, sh); } getXmlFragment(e = "") { - return this.get(e, Og); + return this.get(e, yg); } toJSON() { const e = {}; @@ -18421,12 +18421,12 @@ class Qy extends s6 { }), e; } destroy() { - vp(this.subdocs).forEach((r) => r.destroy()); + fp(this.subdocs).forEach((r) => r.destroy()); const e = this._item; if (e !== null) { this._item = null; const r = e.content; - r.doc = new Qy({ guid: this.guid, ...r.opts, shouldLoad: !1 }), r.doc._item = e, Bn(e.parent.doc, (n) => { + r.doc = new By({ guid: this.guid, ...r.opts, shouldLoad: !1 }), r.doc._item = e, Bn(e.parent.doc, (n) => { const i = r.doc; e.deleted || n.subdocsAdded.add(i), n.subdocsRemoved.add(this); }, null, !0); @@ -18440,7 +18440,7 @@ class Qy extends s6 { super.off(e, r); } } -class yle { +class cle { constructor(e) { this.restDecoder = e; } @@ -18453,7 +18453,7 @@ class yle { return zr(this.restDecoder); } } -class ble extends yle { +class ule extends cle { readLeftID() { return Wr(zr(this.restDecoder), zr(this.restDecoder)); } @@ -18464,10 +18464,10 @@ class ble extends yle { return zr(this.restDecoder); } readInfo() { - return kv(this.restDecoder); + return bv(this.restDecoder); } readString() { - return Yd(this.restDecoder); + return Qd(this.restDecoder); } readParentInfo() { return zr(this.restDecoder) === 1; @@ -18479,19 +18479,19 @@ class ble extends yle { return zr(this.restDecoder); } readAny() { - return aw(this.restDecoder); + return iw(this.restDecoder); } readBuf() { - return TRe(La(this.restDecoder)); + return dRe(Aa(this.restDecoder)); } readJSON() { - return JSON.parse(Yd(this.restDecoder)); + return JSON.parse(Qd(this.restDecoder)); } readKey() { - return Yd(this.restDecoder); + return Qd(this.restDecoder); } } -class HRe { +class IRe { constructor(e) { this.dsCurrVal = 0, this.restDecoder = e; } @@ -18506,15 +18506,15 @@ class HRe { return this.dsCurrVal += e, e; } } -class Cv extends HRe { +class Ov extends IRe { constructor(e) { - super(e), this.keys = [], zr(e), this.keyClockDecoder = new w8(La(e)), this.clientDecoder = new i5(La(e)), this.leftClockDecoder = new w8(La(e)), this.rightClockDecoder = new w8(La(e)), this.infoDecoder = new $Y(La(e), kv), this.stringDecoder = new Q8e(La(e)), this.parentInfoDecoder = new $Y(La(e), kv), this.typeRefDecoder = new i5(La(e)), this.lenDecoder = new i5(La(e)); + super(e), this.keys = [], zr(e), this.keyClockDecoder = new g8(Aa(e)), this.clientDecoder = new r3(Aa(e)), this.leftClockDecoder = new g8(Aa(e)), this.rightClockDecoder = new g8(Aa(e)), this.infoDecoder = new SY(Aa(e), bv), this.stringDecoder = new L8e(Aa(e)), this.parentInfoDecoder = new SY(Aa(e), bv), this.typeRefDecoder = new r3(Aa(e)), this.lenDecoder = new r3(Aa(e)); } readLeftID() { - return new B1(this.clientDecoder.read(), this.leftClockDecoder.read()); + return new P1(this.clientDecoder.read(), this.leftClockDecoder.read()); } readRightID() { - return new B1(this.clientDecoder.read(), this.rightClockDecoder.read()); + return new P1(this.clientDecoder.read(), this.rightClockDecoder.read()); } readClient() { return this.clientDecoder.read(); @@ -18535,13 +18535,13 @@ class Cv extends HRe { return this.lenDecoder.read(); } readAny() { - return aw(this.restDecoder); + return iw(this.restDecoder); } readBuf() { - return La(this.restDecoder); + return Aa(this.restDecoder); } readJSON() { - return aw(this.restDecoder); + return iw(this.restDecoder); } readKey() { const e = this.keyClockDecoder.read(); @@ -18553,9 +18553,9 @@ class Cv extends HRe { } } } -class xle { +class hle { constructor() { - this.restEncoder = Ma(); + this.restEncoder = Ra(); } toUint8Array() { return fi(this.restEncoder); @@ -18569,7 +18569,7 @@ class xle { Cr(this.restEncoder, e); } } -class _k extends xle { +class Tk extends hle { writeLeftID(e) { Cr(this.restEncoder, e.client), Cr(this.restEncoder, e.clock); } @@ -18580,10 +18580,10 @@ class _k extends xle { Cr(this.restEncoder, e); } writeInfo(e) { - C9(this.restEncoder, e); + w9(this.restEncoder, e); } writeString(e) { - ig(this.restEncoder, e); + eg(this.restEncoder, e); } writeParentInfo(e) { Cr(this.restEncoder, e ? 1 : 0); @@ -18595,21 +18595,21 @@ class _k extends xle { Cr(this.restEncoder, e); } writeAny(e) { - sw(this.restEncoder, e); + nw(this.restEncoder, e); } writeBuf(e) { - Pi(this.restEncoder, e); + Di(this.restEncoder, e); } writeJSON(e) { - ig(this.restEncoder, JSON.stringify(e)); + eg(this.restEncoder, JSON.stringify(e)); } writeKey(e) { - ig(this.restEncoder, e); + eg(this.restEncoder, e); } } -class wle { +class fle { constructor() { - this.restEncoder = Ma(), this.dsCurrVal = 0; + this.restEncoder = Ra(), this.dsCurrVal = 0; } toUint8Array() { return fi(this.restEncoder); @@ -18622,16 +18622,16 @@ class wle { this.dsCurrVal = e, Cr(this.restEncoder, r); } writeDsLen(e) { - e === 0 && uu(), Cr(this.restEncoder, e - 1), this.dsCurrVal += e; + e === 0 && ou(), Cr(this.restEncoder, e - 1), this.dsCurrVal += e; } } -class wg extends wle { +class vg extends fle { constructor() { - super(), this.keyMap = /* @__PURE__ */ new Map(), this.keyClock = 0, this.keyClockEncoder = new x8(), this.clientEncoder = new n5(), this.leftClockEncoder = new x8(), this.rightClockEncoder = new x8(), this.infoEncoder = new PY(C9), this.stringEncoder = new P8e(), this.parentInfoEncoder = new PY(C9), this.typeRefEncoder = new n5(), this.lenEncoder = new n5(); + super(), this.keyMap = /* @__PURE__ */ new Map(), this.keyClock = 0, this.keyClockEncoder = new p8(), this.clientEncoder = new t3(), this.leftClockEncoder = new p8(), this.rightClockEncoder = new p8(), this.infoEncoder = new wY(w9), this.stringEncoder = new O8e(), this.parentInfoEncoder = new wY(w9), this.typeRefEncoder = new t3(), this.lenEncoder = new t3(); } toUint8Array() { - const e = Ma(); - return Cr(e, 0), Pi(e, this.keyClockEncoder.toUint8Array()), Pi(e, this.clientEncoder.toUint8Array()), Pi(e, this.leftClockEncoder.toUint8Array()), Pi(e, this.rightClockEncoder.toUint8Array()), Pi(e, fi(this.infoEncoder)), Pi(e, this.stringEncoder.toUint8Array()), Pi(e, fi(this.parentInfoEncoder)), Pi(e, this.typeRefEncoder.toUint8Array()), Pi(e, this.lenEncoder.toUint8Array()), l6(e, fi(this.restEncoder)), fi(e); + const e = Ra(); + return Cr(e, 0), Di(e, this.keyClockEncoder.toUint8Array()), Di(e, this.clientEncoder.toUint8Array()), Di(e, this.leftClockEncoder.toUint8Array()), Di(e, this.rightClockEncoder.toUint8Array()), Di(e, fi(this.infoEncoder)), Di(e, this.stringEncoder.toUint8Array()), Di(e, fi(this.parentInfoEncoder)), Di(e, this.typeRefEncoder.toUint8Array()), Di(e, this.lenEncoder.toUint8Array()), i6(e, fi(this.restEncoder)), fi(e); } writeLeftID(e) { this.clientEncoder.write(e.client), this.leftClockEncoder.write(e.clock); @@ -18658,65 +18658,65 @@ class wg extends wle { this.lenEncoder.write(e); } writeAny(e) { - sw(this.restEncoder, e); + nw(this.restEncoder, e); } writeBuf(e) { - Pi(this.restEncoder, e); + Di(this.restEncoder, e); } writeJSON(e) { - sw(this.restEncoder, e); + nw(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 XRe = (t, e, r, n) => { - n = Yp(n, e[0].id.clock); - const i = vh(e, n); +const $Re = (t, e, r, n) => { + n = zp(n, e[0].id.clock); + const i = ph(e, n); Cr(t.restEncoder, e.length - i), t.writeClient(r), Cr(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); -}, zB = (t, e, r) => { +}, _B = (t, e, r) => { const n = /* @__PURE__ */ new Map(); r.forEach((i, s) => { - qi(e, s) > i && n.set(s, i); - }), h6(e).forEach((i, s) => { + zi(e, s) > i && n.set(s, i); + }), o6(e).forEach((i, s) => { r.has(s) || n.set(s, 0); - }), Cr(t.restEncoder, n.size), vp(n.entries()).sort((i, s) => s[0] - i[0]).forEach(([i, s]) => { - XRe(t, e.clients.get(i), i, s); + }), Cr(t.restEncoder, n.size), fp(n.entries()).sort((i, s) => s[0] - i[0]).forEach(([i, s]) => { + $Re(t, e.clients.get(i), i, s); }); -}, jRe = (t, e) => { - const r = jc(), n = zr(t.restDecoder); +}, BRe = (t, e) => { + const r = Gc(), n = zr(t.restDecoder); for (let i = 0; i < n; i++) { const s = zr(t.restDecoder), a = new Array(s), o = t.readClient(); let l = zr(t.restDecoder); r.set(o, { i: 0, refs: a }); for (let u = 0; u < s; u++) { const h = t.readInfo(); - switch (o6 & h) { + switch (n6 & h) { case 0: { const f = t.readLen(); - a[u] = new jl(Wr(o, l), f), l += f; + a[u] = new Gl(Wr(o, l), f), l += f; break; } case 10: { const f = zr(t.restDecoder); - a[u] = new Zl(Wr(o, l), f), l += f; + a[u] = new Hl(Wr(o, l), f), l += f; break; } default: { - const f = (h & (bf | Ol)) === 0, d = new zn( + const f = (h & (yf | bl)) === 0, d = new zn( Wr(o, l), null, - (h & Ol) === Ol ? t.readLeftID() : null, + (h & bl) === bl ? t.readLeftID() : null, null, - (h & bf) === bf ? t.readRightID() : null, + (h & yf) === yf ? t.readRightID() : null, f ? t.readParentInfo() ? e.get(t.readString()) : t.readLeftID() : null, - f && (h & nw) === nw ? t.readString() : null, - jle(t, h) + f && (h & tw) === tw ? t.readString() : null, + qle(t, h) ); a[u] = d, l += d.length; } @@ -18724,9 +18724,9 @@ const XRe = (t, e, r, n) => { } } return r; -}, ZRe = (t, e, r) => { +}, FRe = (t, e, r) => { const n = []; - let i = vp(r.keys()).sort((p, g) => p - g); + let i = fp(r.keys()).sort((p, g) => p - g); if (i.length === 0) return null; const s = () => { @@ -18743,7 +18743,7 @@ const XRe = (t, e, r, n) => { let a = s(); if (a === null) return null; - const o = new _le(), l = /* @__PURE__ */ new Map(), u = (p, g) => { + const o = new ble(), l = /* @__PURE__ */ new Map(), u = (p, g) => { const m = l.get(p); (m == null || m > g) && l.set(p, g); }; @@ -18756,8 +18756,8 @@ const XRe = (t, e, r, n) => { n.length = 0; }; for (; ; ) { - if (h.constructor !== Zl) { - const g = Zf(f, h.id.client, () => qi(e, h.id.client)) - h.id.clock; + if (h.constructor !== Hl) { + const g = Xf(f, h.id.client, () => zi(e, h.id.client)) - h.id.clock; if (g < 0) n.push(h), u(h.id.client, h.id.clock - 1), d(); else { @@ -18766,7 +18766,7 @@ const XRe = (t, e, r, n) => { n.push(h); const v = r.get(m) || { refs: [], i: 0 }; if (v.refs.length === v.i) - u(m, qi(e, m)), d(); + u(m, zi(e, m)), d(); else { h = v.refs[v.i++]; continue; @@ -18786,17 +18786,17 @@ const XRe = (t, e, r, n) => { } } if (o.clients.size > 0) { - const p = new wg(); - return zB(p, o, /* @__PURE__ */ new Map()), Cr(p.restEncoder, 0), { missing: l, update: p.toUint8Array() }; + const p = new vg(); + return _B(p, o, /* @__PURE__ */ new Map()), Cr(p.restEncoder, 0), { missing: l, update: p.toUint8Array() }; } return null; -}, KRe = (t, e) => zB(t, e.doc.store, e.beforeState), JRe = (t, e, r, n = new Cv(t)) => Bn(e, (i) => { +}, zRe = (t, e) => _B(t, e.doc.store, e.beforeState), qRe = (t, e, r, n = new Ov(t)) => Bn(e, (i) => { i.local = !1; let s = !1; - const a = i.doc, o = a.store, l = jRe(n, a), u = ZRe(i, o, l), h = o.pendingStructs; + const a = i.doc, o = a.store, l = BRe(n, a), u = FRe(i, o, l), h = o.pendingStructs; if (h) { for (const [d, p] of h.missing) - if (p < qi(o, d)) { + if (p < zi(o, d)) { s = !0; break; } @@ -18805,68 +18805,68 @@ const XRe = (t, e, r, n) => { const g = h.missing.get(d); (g == null || g > p) && h.missing.set(d, p); } - h.update = PT([h.update, u.update]); + h.update = MT([h.update, u.update]); } } else o.pendingStructs = u; - const f = qY(n, i, o); + const f = _Y(n, i, o); if (o.pendingDs) { - const d = new Cv(Gp(o.pendingDs)); + const d = new Ov(qp(o.pendingDs)); zr(d.restDecoder); - const p = qY(d, i, o); - f && p ? o.pendingDs = PT([f, p]) : o.pendingDs = f || p; + const p = _Y(d, i, o); + f && p ? o.pendingDs = MT([f, p]) : o.pendingDs = f || p; } else o.pendingDs = f; if (s) { const d = o.pendingStructs.update; - o.pendingStructs = null, Ole(i.doc, d); - } -}, r, !1), Ole = (t, e, r, n = Cv) => { - const i = Gp(e); - JRe(i, t, r, new n(i)); -}, eLe = (t, e, r) => Ole(t, e, r, ble), tLe = (t, e, r = /* @__PURE__ */ new Map()) => { - zB(t, e.store, r), Uy(t, GRe(e.store)); -}, rLe = (t, e = new Uint8Array([0]), r = new wg()) => { - const n = kle(e); - tLe(r, t, n); + o.pendingStructs = null, dle(i.doc, d); + } +}, r, !1), dle = (t, e, r, n = Ov) => { + const i = qp(e); + qRe(i, t, r, new n(i)); +}, URe = (t, e, r) => dle(t, e, r, ule), QRe = (t, e, r = /* @__PURE__ */ new Map()) => { + _B(t, e.store, r), $y(t, NRe(e.store)); +}, VRe = (t, e = new Uint8Array([0]), r = new vg()) => { + const n = ple(e); + QRe(r, t, n); const i = [r.toUint8Array()]; - if (t.store.pendingDs && i.push(t.store.pendingDs), t.store.pendingStructs && i.push(OLe(t.store.pendingStructs.update, e)), i.length > 1) { - if (r.constructor === _k) - return xLe(i.map((s, a) => a === 0 ? s : SLe(s))); - if (r.constructor === wg) - return PT(i); + if (t.store.pendingDs && i.push(t.store.pendingDs), t.store.pendingStructs && i.push(uLe(t.store.pendingStructs.update, e)), i.length > 1) { + if (r.constructor === Tk) + return lLe(i.map((s, a) => a === 0 ? s : fLe(s))); + if (r.constructor === vg) + return MT(i); } return i[0]; -}, nLe = (t, e) => rLe(t, e, new _k()), iLe = (t) => { +}, WRe = (t, e) => VRe(t, e, new Tk()), YRe = (t) => { const e = /* @__PURE__ */ new Map(), r = zr(t.restDecoder); for (let n = 0; n < r; n++) { const i = zr(t.restDecoder), s = zr(t.restDecoder); e.set(i, s); } return e; -}, kle = (t) => iLe(new yle(Gp(t))), Sle = (t, e) => (Cr(t.restEncoder, e.size), vp(e.entries()).sort((r, n) => n[0] - r[0]).forEach(([r, n]) => { +}, ple = (t) => YRe(new cle(qp(t))), gle = (t, e) => (Cr(t.restEncoder, e.size), fp(e.entries()).sort((r, n) => n[0] - r[0]).forEach(([r, n]) => { Cr(t.restEncoder, r), Cr(t.restEncoder, n); -}), t), sLe = (t, e) => Sle(t, h6(e.store)), aLe = (t, e = new wle()) => (t instanceof Map ? Sle(e, t) : sLe(e, t), e.toUint8Array()), oLe = (t) => aLe(t, new xle()); -class lLe { +}), t), GRe = (t, e) => gle(t, o6(e.store)), HRe = (t, e = new fle()) => (t instanceof Map ? gle(e, t) : GRe(e, t), e.toUint8Array()), XRe = (t) => HRe(t, new hle()); +class jRe { constructor() { this.l = []; } } -const UY = () => new lLe(), QY = (t, e) => t.l.push(e), VY = (t, e) => { +const AY = () => new jRe(), RY = (t, e) => t.l.push(e), LY = (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."); -}, Tle = (t, e, r) => NB(t.l, [e, r]); -class B1 { +}, mle = (t, e, r) => kB(t.l, [e, r]); +class P1 { constructor(e, r) { this.client = e, this.clock = r; } } -const b1 = (t, e) => t === e || t !== null && e !== null && t.client === e.client && t.clock === e.clock, Wr = (t, e) => new B1(t, e), Cle = (t) => { +const g1 = (t, e) => t === e || t !== null && e !== null && t.client === e.client && t.clock === e.clock, Wr = (t, e) => new P1(t, e), vle = (t) => { for (const [e, r] of t.doc.share.entries()) if (r === t) return e; - throw uu(); -}, DT = (t, e) => { + throw ou(); +}, LT = (t, e) => { for (; e !== null; ) { if (e.parent === t) return !0; @@ -18874,48 +18874,48 @@ const b1 = (t, e) => t === e || t !== null && e !== null && t.client === e.clien } return !1; }; -class Ele { +class yle { constructor(e, r, n, i = 0) { this.type = e, this.tname = r, this.item = n, this.assoc = i; } } -const WY = (t) => { +const MY = (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; -}, lw = (t) => new Ele(t.type == null ? null : Wr(t.type.client, t.type.clock), t.tname || null, t.item == null ? null : Wr(t.item.client, t.item.clock), t.assoc == null ? 0 : t.assoc); -class cLe { +}, aw = (t) => new yle(t.type == null ? null : Wr(t.type.client, t.type.clock), t.tname || null, t.item == null ? null : Wr(t.item.client, t.item.clock), t.assoc == null ? 0 : t.assoc); +class ZRe { constructor(e, r, n = 0) { this.type = e, this.index = r, this.assoc = n; } } -const uLe = (t, e, r = 0) => new cLe(t, e, r), mS = (t, e, r) => { +const KRe = (t, e, r = 0) => new ZRe(t, e, r), dS = (t, e, r) => { let n = null, i = null; - return t._item === null ? i = Cle(t) : n = Wr(t._item.id.client, t._item.id.clock), new Ele(n, i, e, r); -}, L9 = (t, e, r = 0) => { + return t._item === null ? i = vle(t) : n = Wr(t._item.id.client, t._item.id.clock), new yle(n, i, e, r); +}, C9 = (t, e, r = 0) => { let n = t._start; if (r < 0) { if (e === 0) - return mS(t, null, r); + return dS(t, null, r); e--; } for (; n !== null; ) { if (!n.deleted && n.countable) { if (n.length > e) - return mS(t, Wr(n.id.client, n.id.clock + e), r); + return dS(t, Wr(n.id.client, n.id.clock + e), r); e -= n.length; } if (n.right === null && r < 0) - return mS(t, n.lastId, r); + return dS(t, n.lastId, r); n = n.right; } - return mS(t, null, r); -}, M9 = (t, e) => { + return dS(t, null, r); +}, E9 = (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 (qi(r, n.client) <= n.clock) + if (zi(r, n.client) <= n.clock) return null; - const u = I9(r, n), h = u.item; + const u = L9(r, n), h = u.item; if (!(h instanceof zn)) return null; if (o = h.parent, o._item === null || !o._item.deleted) { @@ -18928,65 +18928,65 @@ const uLe = (t, e, r = 0) => new cLe(t, e, r), mS = (t, e, r) => { if (s !== null) o = e.get(s); else if (i !== null) { - if (qi(r, i.client) <= i.clock) + if (zi(r, i.client) <= i.clock) return null; - const { item: u } = I9(r, i); - if (u instanceof zn && u.content instanceof Mh) + const { item: u } = L9(r, i); + if (u instanceof zn && u.content instanceof _h) o = u.content.type; else return null; } else - throw uu(); + throw ou(); a >= 0 ? l = o._length : l = 0; } - return uLe(o, l, t.assoc); -}, YY = (t, e) => t === e || t !== null && e !== null && t.tname === e.tname && b1(t.item, e.item) && b1(t.type, e.type) && t.assoc === e.assoc; -class hLe { + return KRe(o, l, t.assoc); +}, DY = (t, e) => t === e || t !== null && e !== null && t.tname === e.tname && g1(t.item, e.item) && g1(t.type, e.type) && t.assoc === e.assoc; +class JRe { constructor(e, r) { this.ds = e, this.sv = r; } } -const fLe = (t, e) => new hLe(t, e); -fLe(mle(), /* @__PURE__ */ new Map()); -const a1 = (t, e) => e === void 0 ? !t.deleted : e.sv.has(t.id.client) && (e.sv.get(t.id.client) || 0) > t.id.clock && !Ek(e.ds, t.id), D9 = (t, e) => { - const r = Zf(t.meta, D9, xg), n = t.doc.store; +const eLe = (t, e) => new JRe(t, e); +eLe(ole(), /* @__PURE__ */ new Map()); +const n1 = (t, e) => e === void 0 ? !t.deleted : e.sv.has(t.id.client) && (e.sv.get(t.id.client) || 0) > t.id.clock && !Sk(e.ds, t.id), _9 = (t, e) => { + const r = Xf(t.meta, _9, mg), n = t.doc.store; r.has(e) || (e.sv.forEach((i, s) => { - i < qi(n, s) && qo(t, Wr(s, i)); - }), Tv(t, e.ds, (i) => { + i < zi(n, s) && Bo(t, Wr(s, i)); + }), wv(t, e.ds, (i) => { }), r.add(e)); }; -class _le { +class ble { constructor() { this.clients = /* @__PURE__ */ new Map(), this.pendingStructs = null, this.pendingDs = null; } } -const h6 = (t) => { +const o6 = (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; -}, qi = (t, e) => { +}, zi = (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; -}, Ale = (t, e) => { +}, xle = (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 uu(); + throw ou(); } r.push(e); -}, vh = (t, e) => { +}, ph = (t, e) => { let r = 0, n = t.length - 1, i = t[n], s = i.id.clock; if (s === e) return n; - let a = Rf(e / (s + i.length - 1) * n); + let a = _f(e / (s + i.length - 1) * n); for (; r <= n; ) { if (i = t[a], s = i.id.clock, s <= e) { if (e < s + i.length) @@ -18994,42 +18994,42 @@ const h6 = (t) => { r = a + 1; } else n = a - 1; - a = Rf((r + n) / 2); + a = _f((r + n) / 2); } - throw uu(); -}, dLe = (t, e) => { + throw ou(); +}, tLe = (t, e) => { const r = t.clients.get(e.client); - return r[vh(r, e.clock)]; -}, s5 = dLe, P9 = (t, e, r) => { - const n = vh(e, r), i = e[n]; - return i.id.clock < r && i instanceof zn ? (e.splice(n + 1, 0, zT(t, i, r - i.id.clock)), n + 1) : n; -}, qo = (t, e) => { + return r[ph(r, e.clock)]; +}, n3 = tLe, A9 = (t, e, r) => { + const n = ph(e, r), i = e[n]; + return i.id.clock < r && i instanceof zn ? (e.splice(n + 1, 0, BT(t, i, r - i.id.clock)), n + 1) : n; +}, Bo = (t, e) => { const r = t.doc.store.clients.get(e.client); - return r[P9(t, r, e.clock)]; -}, GY = (t, e, r) => { - const n = e.clients.get(r.client), i = vh(n, r.clock), s = n[i]; - return r.clock !== s.id.clock + s.length - 1 && s.constructor !== jl && n.splice(i + 1, 0, zT(t, s, r.clock - s.id.clock + 1)), s; -}, pLe = (t, e, r) => { + return r[A9(t, r, e.clock)]; +}, PY = (t, e, r) => { + const n = e.clients.get(r.client), i = ph(n, r.clock), s = n[i]; + return r.clock !== s.id.clock + s.length - 1 && s.constructor !== Gl && n.splice(i + 1, 0, BT(t, s, r.clock - s.id.clock + 1)), s; +}, rLe = (t, e, r) => { const n = t.clients.get(e.id.client); - n[vh(n, e.id.clock)] = r; -}, Rle = (t, e, r, n, i) => { + n[ph(n, e.id.clock)] = r; +}, wle = (t, e, r, n, i) => { if (n === 0) return; const s = r + n; - let a = P9(t, e, r), o; + let a = A9(t, e, r), o; do - o = e[a++], s < o.id.clock + o.length && P9(t, e, s), i(o); + o = e[a++], s < o.id.clock + o.length && A9(t, e, s), i(o); while (a < e.length && e[a].id.clock < s); }; -class gLe { +class nLe { constructor(e, r, n) { - this.doc = e, this.deleteSet = new qy(), this.beforeState = h6(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 Iy(), this.beforeState = o6(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 HY = (t, e) => e.deleteSet.clients.size === 0 && !f8e(e.afterState, (r, n) => e.beforeState.get(n) !== r) ? !1 : (BB(e.deleteSet), KRe(t, e), Uy(t, e.deleteSet), !0), XY = (t, e, r) => { +const NY = (t, e) => e.deleteSet.clients.size === 0 && !e8e(e.afterState, (r, n) => e.beforeState.get(n) !== r) ? !1 : (CB(e.deleteSet), zRe(t, e), $y(t, e.deleteSet), !0), IY = (t, e, r) => { const n = e._item; - (n === null || n.id.clock < (t.beforeState.get(n.id.client) || 0) && !n.deleted) && Zf(t.changed, e, xg).add(r); -}, a5 = (t, e) => { + (n === null || n.id.clock < (t.beforeState.get(n.id.client) || 0) && !n.deleted) && Xf(t.changed, e, mg).add(r); +}, i3 = (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)) { @@ -19040,12 +19040,12 @@ const HY = (t, e) => e.deleteSet.clients.size === 0 && !f8e(e.afterState, (r, n) } const s = e - i; return s && t.splice(e + 1 - s, s), s; -}, mLe = (t, e, r) => { +}, iLe = (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 = vh(s, o.clock), h = s[u]; u < s.length && h.id.clock < l; h = s[++u]) { + for (let u = ph(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; @@ -19053,20 +19053,20 @@ const HY = (t, e) => e.deleteSet.clients.size === 0 && !f8e(e.afterState, (r, n) } } } -}, vLe = (t, e) => { +}, sLe = (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 = a6(i.length - 1, 1 + vh(i, a.clock + a.len - 1)); + const a = r[s], o = r6(i.length - 1, 1 + ph(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 + a5(i, l); + l -= 1 + i3(i, l); } }); -}, Lle = (t, e) => { +}, Ole = (t, e) => { if (e < t.length) { const r = t[e], n = r.doc, i = n.store, s = r.deleteSet, a = r._mergeStructs; try { - BB(s), r.afterState = h6(r.doc.store), n.emit("beforeObserverCalls", [r, n]); + CB(s), r.afterState = o6(r.doc.store), n.emit("beforeObserverCalls", [r, n]); const o = []; r.changed.forEach( (l, u) => o.push(() => { @@ -19078,78 +19078,78 @@ const HY = (t, e) => e.deleteSet.clients.size === 0 && !f8e(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), Tle(u._dEH, l, r)); + }), l.sort((h, f) => h.path.length - f.path.length), mle(u._dEH, l, r)); }); - }), o.push(() => n.emit("afterTransaction", [r, n])), NB(o, []), r._needFormattingCleanup && BLe(r); + }), o.push(() => n.emit("afterTransaction", [r, n])), kB(o, []), r._needFormattingCleanup && CLe(r); } finally { - n.gc && mLe(s, i, n.gcFilter), vLe(s, i), r.afterState.forEach((h, f) => { + n.gc && iLe(s, i, n.gcFilter), sLe(s, i), r.afterState.forEach((h, f) => { const d = r.beforeState.get(f) || 0; if (d !== h) { - const p = i.clients.get(f), g = Yp(vh(p, d), 1); + const p = i.clients.get(f), g = zp(ph(p, d), 1); for (let m = p.length - 1; m >= g; ) - m -= 1 + a5(p, m); + m -= 1 + i3(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 = vh(p, d); - g + 1 < p.length && a5(p, g + 1) > 1 || g > 0 && a5(p, g); + const { client: f, clock: d } = a[h].id, p = i.clients.get(f), g = ph(p, d); + g + 1 < p.length && i3(p, g + 1) > 1 || g > 0 && i3(p, g); } - if (!r.local && r.afterState.get(n.clientID) !== r.beforeState.get(n.clientID) && (QRe(IB, ule, "[yjs] ", hle, fle, "Changed the client-id because another client seems to be using it."), n.clientID = vle()), n.emit("afterTransactionCleanup", [r, n]), n._observers.has("update")) { - const h = new _k(); - HY(h, r) && n.emit("update", [h.toUint8Array(), r.origin, n, r]); + if (!r.local && r.afterState.get(n.clientID) !== r.beforeState.get(n.clientID) && (LRe(SB, tle, "[yjs] ", rle, nle, "Changed the client-id because another client seems to be using it."), n.clientID = lle()), n.emit("afterTransactionCleanup", [r, n]), n._observers.has("update")) { + const h = new Tk(); + NY(h, r) && n.emit("update", [h.toUint8Array(), r.origin, n, r]); } if (n._observers.has("updateV2")) { - const h = new wg(); - HY(h, r) && n.emit("updateV2", [h.toUint8Array(), r.origin, n, r]); + const h = new vg(); + NY(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])) : Lle(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])) : Ole(t, e + 1); } } }, Bn = (t, e, r = null, n = !0) => { const i = t._transactionCleanups; let s = !1, a = null; - t._transaction === null && (s = !0, t._transaction = new gLe(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 nLe(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 && Lle(i, 0); + t._transaction = null, o && Ole(i, 0); } } return a; }; -class yLe { +class aLe { constructor(e, r) { this.insertions = r, this.deletions = e, this.meta = /* @__PURE__ */ new Map(); } } -const jY = (t, e, r) => { - Tv(t, r.deletions, (n) => { - n instanceof zn && e.scope.some((i) => DT(i, n)) && XB(n, !1); +const $Y = (t, e, r) => { + wv(t, r.deletions, (n) => { + n instanceof zn && e.scope.some((i) => LT(i, n)) && $B(n, !1); }); -}, ZY = (t, e, r) => { +}, BY = (t, e, r) => { let n = null, i = null; const s = t.doc, a = t.scope; if (Bn(s, (o) => { for (; e.length > 0 && n === null; ) { const l = s.store, u = e.pop(), h = /* @__PURE__ */ new Set(), f = []; let d = !1; - Tv(o, u.insertions, (p) => { + wv(o, u.insertions, (p) => { if (p instanceof zn) { if (p.redone !== null) { - let { item: g, diff: m } = I9(l, p.id); - m > 0 && (g = qo(o, Wr(g.id.client, g.id.clock + m))), p = g; + let { item: g, diff: m } = L9(l, p.id); + m > 0 && (g = Bo(o, Wr(g.id.client, g.id.clock + m))), p = g; } - !p.deleted && a.some((g) => DT(g, p)) && f.push(p); + !p.deleted && a.some((g) => LT(g, p)) && f.push(p); } - }), Tv(o, u.deletions, (p) => { - p instanceof zn && a.some((g) => DT(g, p)) && !Ek(u.insertions, p.id) && h.add(p); + }), wv(o, u.deletions, (p) => { + p instanceof zn && a.some((g) => LT(g, p)) && !Sk(u.insertions, p.id) && h.add(p); }), h.forEach((p) => { - d = Xle(o, p, h, u.insertions, t.ignoreRemoteMapChanges, t) !== null || d; + d = zle(o, p, h, u.insertions, t.ignoreRemoteMapChanges, t) !== null || d; }); for (let p = f.length - 1; p >= 0; p--) { const g = f[p]; @@ -19166,34 +19166,34 @@ const jY = (t, e, r) => { } return n; }; -class qB extends s6 { +class AB extends t6 { constructor(e, { captureTimeout: r = 500, captureTransaction: n = (l) => !0, deleteFilter: i = () => !0, trackedOrigins: s = /* @__PURE__ */ new Set([null]), ignoreRemoteMapChanges: a = !1, - doc: o = S9(e) ? e[0].doc : e.doc + doc: o = b9(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 qy(); + const d = new Iy(); l.afterState.forEach((v, y) => { const b = l.beforeState.get(y) || 0, w = v - b; - w > 0 && ow(d, y, b, w); + w > 0 && sw(d, y, b, w); }); - const p = bp(); + const p = pp(); 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 = R9([v.deletions, l.deleteSet]), v.insertions = R9([v.insertions, d]); + v.deletions = T9([v.deletions, l.deleteSet]), v.insertions = T9([v.insertions, d]); } else - f.push(new yLe(l.deleteSet, d)), g = !0; - !u && !h && (this.lastChange = p), Tv(l, l.deleteSet, (v) => { - v instanceof zn && this.scope.some((y) => DT(y, v)) && XB(v, !0); + f.push(new aLe(l.deleteSet, d)), g = !0; + !u && !h && (this.lastChange = p), wv(l, l.deleteSet, (v) => { + v instanceof zn && this.scope.some((y) => LT(y, v)) && $B(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); @@ -19202,8 +19202,8 @@ class qB extends s6 { }); } addToScope(e) { - e = S9(e) ? e : [e], e.forEach((r) => { - this.scope.every((n) => n !== r) && (r.doc !== this.doc && VRe("[yjs#509] Not same Y.Doc"), this.scope.push(r)); + e = b9(e) ? e : [e], e.forEach((r) => { + this.scope.every((n) => n !== r) && (r.doc !== this.doc && MRe("[yjs#509] Not same Y.Doc"), this.scope.push(r)); }); } addTrackedOrigin(e) { @@ -19214,7 +19214,7 @@ class qB extends s6 { } clear(e = !0, r = !0) { (e && this.canUndo() || r && this.canRedo()) && this.doc.transact((n) => { - e && (this.undoStack.forEach((i) => jY(n, this, i)), this.undoStack = []), r && (this.redoStack.forEach((i) => jY(n, this, i)), this.redoStack = []), this.emit("stack-cleared", [{ undoStackCleared: e, redoStackCleared: r }]); + e && (this.undoStack.forEach((i) => $Y(n, this, i)), this.undoStack = []), r && (this.redoStack.forEach((i) => $Y(n, this, i)), this.redoStack = []), this.emit("stack-cleared", [{ undoStackCleared: e, redoStackCleared: r }]); }); } stopCapturing() { @@ -19224,7 +19224,7 @@ class qB extends s6 { this.undoing = !0; let e; try { - e = ZY(this, this.undoStack, "undo"); + e = BY(this, this.undoStack, "undo"); } finally { this.undoing = !1; } @@ -19234,7 +19234,7 @@ class qB extends s6 { this.redoing = !0; let e; try { - e = ZY(this, this.redoStack, "redo"); + e = BY(this, this.redoStack, "redo"); } finally { this.redoing = !1; } @@ -19250,7 +19250,7 @@ class qB extends s6 { this.trackedOrigins.delete(this), this.doc.off("afterTransaction", this.afterTransactionHandler), super.destroy(); } } -function* bLe(t) { +function* oLe(t) { const e = zr(t.restDecoder); for (let r = 0; r < e; r++) { const n = zr(t.restDecoder), i = t.readClient(); @@ -19259,49 +19259,49 @@ function* bLe(t) { const o = t.readInfo(); if (o === 10) { const l = zr(t.restDecoder); - yield new Zl(Wr(i, s), l), s += l; - } else if ((o6 & o) !== 0) { - const l = (o & (bf | Ol)) === 0, u = new zn( + yield new Hl(Wr(i, s), l), s += l; + } else if ((n6 & o) !== 0) { + const l = (o & (yf | bl)) === 0, u = new zn( Wr(i, s), null, - (o & Ol) === Ol ? t.readLeftID() : null, + (o & bl) === bl ? t.readLeftID() : null, null, - (o & bf) === bf ? t.readRightID() : null, + (o & yf) === yf ? t.readRightID() : null, l ? t.readParentInfo() ? t.readString() : t.readLeftID() : null, - l && (o & nw) === nw ? t.readString() : null, - jle(t, o) + l && (o & tw) === tw ? t.readString() : null, + qle(t, o) ); yield u, s += u.length; } else { const l = t.readLen(); - yield new jl(Wr(i, s), l), s += l; + yield new Gl(Wr(i, s), l), s += l; } } } } -class UB { +class RB { constructor(e, r) { - this.gen = bLe(e), this.curr = null, this.done = !1, this.filterSkips = r, this.next(); + this.gen = oLe(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 === Zl); + while (this.filterSkips && this.curr !== null && this.curr.constructor === Hl); return this.curr; } } -class QB { +class LB { constructor(e) { this.currClient = 0, this.startClock = 0, this.written = 0, this.encoder = e, this.clientStructs = []; } } -const xLe = (t) => PT(t, ble, _k), wLe = (t, e) => { - if (t.constructor === jl) { +const lLe = (t) => MT(t, ule, Tk), cLe = (t, e) => { + if (t.constructor === Gl) { const { client: r, clock: n } = t.id; - return new jl(Wr(r, n + e), t.length - e); - } else if (t.constructor === Zl) { + return new Gl(Wr(r, n + e), t.length - e); + } else if (t.constructor === Hl) { const { client: r, clock: n } = t.id; - return new Zl(Wr(r, n + e), t.length - e); + return new Hl(Wr(r, n + e), t.length - e); } else { const r = t, { client: n, clock: i } = r.id; return new zn( @@ -19315,17 +19315,17 @@ const xLe = (t) => PT(t, ble, _k), wLe = (t, e) => { r.content.splice(e) ); } -}, PT = (t, e = Cv, r = wg) => { +}, MT = (t, e = Ov, r = vg) => { if (t.length === 1) return t[0]; - const n = t.map((h) => new e(Gp(h))); - let i = n.map((h) => new UB(h, !0)), s = null; - const a = new r(), o = new QB(a); + const n = t.map((h) => new e(qp(h))); + let i = n.map((h) => new RB(h, !0)), s = null; + const a = new r(), o = new LB(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 === Zl ? 1 : -1 : g; + return g === 0 ? d.curr.constructor === p.curr.constructor ? 0 : d.curr.constructor === Hl ? 1 : -1 : g; } else return p.curr.id.client - d.curr.id.client; } @@ -19338,79 +19338,79 @@ const xLe = (t) => PT(t, ble, _k), wLe = (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) - Cd(o, s.struct, s.offset), s = { struct: d, offset: 0 }, h.next(); + kd(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 === Zl) + if (s.struct.constructor === Hl) s.struct.length = d.id.clock + d.length - s.struct.id.clock; else { - Cd(o, s.struct, s.offset); + kd(o, s.struct, s.offset); const g = d.id.clock - s.struct.id.clock - s.struct.length; - s = { struct: new Zl(Wr(f, s.struct.id.clock + s.struct.length), g), offset: 0 }; + s = { struct: new Hl(Wr(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 === Zl ? s.struct.length -= g : d = wLe(d, g)), s.struct.mergeWith(d) || (Cd(o, s.struct, s.offset), s = { struct: d, offset: 0 }, h.next()); + g > 0 && (s.struct.constructor === Hl ? s.struct.length -= g : d = cLe(d, g)), s.struct.mergeWith(d) || (kd(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 !== Zl; d = h.next()) - Cd(o, s.struct, s.offset), s = { struct: d, offset: 0 }; - } - s !== null && (Cd(o, s.struct, s.offset), s = null), VB(o); - const l = n.map((h) => FB(h)), u = R9(l); - return Uy(a, u), a.toUint8Array(); -}, OLe = (t, e, r = Cv, n = wg) => { - const i = kle(e), s = new n(), a = new QB(s), o = new r(Gp(t)), l = new UB(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 !== Hl; d = h.next()) + kd(o, s.struct, s.offset), s = { struct: d, offset: 0 }; + } + s !== null && (kd(o, s.struct, s.offset), s = null), MB(o); + const l = n.map((h) => EB(h)), u = T9(l); + return $y(a, u), a.toUint8Array(); +}, uLe = (t, e, r = Ov, n = vg) => { + const i = ple(e), s = new n(), a = new LB(s), o = new r(qp(t)), l = new RB(o, !1); for (; l.curr; ) { const h = l.curr, f = h.id.client, d = i.get(f) || 0; - if (l.curr.constructor === Zl) { + if (l.curr.constructor === Hl) { l.next(); continue; } if (h.id.clock + h.length > d) - for (Cd(a, h, Yp(d - h.id.clock, 0)), l.next(); l.curr && l.curr.id.client === f; ) - Cd(a, l.curr, 0), l.next(); + for (kd(a, h, zp(d - h.id.clock, 0)), l.next(); l.curr && l.curr.id.client === f; ) + kd(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(); } - VB(a); - const u = FB(o); - return Uy(s, u), s.toUint8Array(); -}, Mle = (t) => { - t.written > 0 && (t.clientStructs.push({ written: t.written, restEncoder: fi(t.encoder.restEncoder) }), t.encoder.restEncoder = Ma(), t.written = 0); -}, Cd = (t, e, r) => { - t.written > 0 && t.currClient !== e.id.client && Mle(t), t.written === 0 && (t.currClient = e.id.client, t.encoder.writeClient(e.id.client), Cr(t.encoder.restEncoder, e.id.clock + r)), e.write(t.encoder, r), t.written++; -}, VB = (t) => { - Mle(t); + MB(a); + const u = EB(o); + return $y(s, u), s.toUint8Array(); +}, kle = (t) => { + t.written > 0 && (t.clientStructs.push({ written: t.written, restEncoder: fi(t.encoder.restEncoder) }), t.encoder.restEncoder = Ra(), t.written = 0); +}, kd = (t, e, r) => { + t.written > 0 && t.currClient !== e.id.client && kle(t), t.written === 0 && (t.currClient = e.id.client, t.encoder.writeClient(e.id.client), Cr(t.encoder.restEncoder, e.id.clock + r)), e.write(t.encoder, r), t.written++; +}, MB = (t) => { + kle(t); const e = t.encoder.restEncoder; Cr(e, t.clientStructs.length); for (let r = 0; r < t.clientStructs.length; r++) { const n = t.clientStructs[r]; - Cr(e, n.written), l6(e, n.restEncoder); + Cr(e, n.written), i6(e, n.restEncoder); } -}, kLe = (t, e, r, n) => { - const i = new r(Gp(t)), s = new UB(i, !1), a = new n(), o = new QB(a); +}, hLe = (t, e, r, n) => { + const i = new r(qp(t)), s = new RB(i, !1), a = new n(), o = new LB(a); for (let u = s.curr; u !== null; u = s.next()) - Cd(o, e(u), 0); - VB(o); - const l = FB(i); - return Uy(a, l), a.toUint8Array(); -}, SLe = (t) => kLe(t, hRe, Cv, _k), KY = "You must not compute changes after the event-handler fired."; -class f6 { + kd(o, e(u), 0); + MB(o); + const l = EB(i); + return $y(a, l), a.toUint8Array(); +}, fLe = (t) => hLe(t, J8e, Ov, Tk), FY = "You must not compute changes after the event-handler fired."; +class l6 { 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 = TLe(this.currentTarget, this.target)); + return this._path || (this._path = dLe(this.currentTarget, this.target)); } deletes(e) { - return Ek(this.transaction.deleteSet, e.id); + return Sk(this.transaction.deleteSet, e.id); } get keys() { if (this._keys === null) { if (this.transaction.doc._transactionCleanups.length === 0) - throw yp(KY); + throw dp(FY); const e = /* @__PURE__ */ new Map(), r = this.target; this.transaction.changed.get(r).forEach((i) => { if (i !== null) { @@ -19422,13 +19422,13 @@ class f6 { l = l.left; if (this.deletes(s)) if (l !== null && this.deletes(l)) - a = "delete", o = v8(l.content.getContent()); + a = "delete", o = h8(l.content.getContent()); else return; else - l !== null && this.deletes(l) ? (a = "update", o = v8(l.content.getContent())) : (a = "add", o = void 0); + l !== null && this.deletes(l) ? (a = "update", o = h8(l.content.getContent())) : (a = "add", o = void 0); } else if (this.deletes(s)) - a = "delete", o = v8(s.content.getContent()); + a = "delete", o = h8(s.content.getContent()); else return; e.set(i, { action: a, oldValue: o }); @@ -19447,8 +19447,8 @@ class f6 { let e = this._changes; if (e === null) { if (this.transaction.doc._transactionCleanups.length === 0) - throw yp(KY); - const r = this.target, n = xg(), i = xg(), s = []; + throw dp(FY); + const r = this.target, n = mg(), i = mg(), s = []; if (e = { added: n, deleted: i, @@ -19468,7 +19468,7 @@ class f6 { return e; } } -const TLe = (t, e) => { +const dLe = (t, e) => { const r = []; for (; e._item !== null && e !== t; ) { if (e._item.parentSub !== null) @@ -19482,31 +19482,31 @@ const TLe = (t, e) => { e = e._item.parent; } return r; -}, Dle = 80; -let WB = 0; -class CLe { +}, Sle = 80; +let DB = 0; +class pLe { constructor(e, r) { - e.marker = !0, this.p = e, this.index = r, this.timestamp = WB++; + e.marker = !0, this.p = e, this.index = r, this.timestamp = DB++; } } -const ELe = (t) => { - t.timestamp = WB++; -}, Ple = (t, e, r) => { - t.p.marker = !1, t.p = e, e.marker = !0, t.index = r, t.timestamp = WB++; -}, _Le = (t, e, r) => { - if (t.length >= Dle) { +const gLe = (t) => { + t.timestamp = DB++; +}, Tle = (t, e, r) => { + t.p.marker = !1, t.p = e, e.marker = !0, t.index = r, t.timestamp = DB++; +}, mLe = (t, e, r) => { + if (t.length >= Sle) { const n = t.reduce((i, s) => i.timestamp < s.timestamp ? i : s); - return Ple(n, e, r), n; + return Tle(n, e, r), n; } else { - const n = new CLe(e, r); + const n = new pLe(e, r); return t.push(n), n; } -}, d6 = (t, e) => { +}, c6 = (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) => r5(e - s.index) < r5(e - a.index) ? s : a); + const r = t._searchMarker.length === 0 ? null : t._searchMarker.reduce((s, a) => e3(e - s.index) < e3(e - a.index) ? s : a); let n = t._start, i = 0; - for (r !== null && (n = r.p, i = r.index, ELe(r)); n.right !== null && i < e; ) { + for (r !== null && (n = r.p, i = r.index, gLe(r)); n.right !== null && i < e; ) { if (!n.deleted && n.countable) { if (e < i + n.length) break; @@ -19518,8 +19518,8 @@ const ELe = (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 && r5(r.index - i) < n.parent.length / Dle ? (Ple(r, n, i), r) : _Le(t._searchMarker, n, i); -}, cw = (t, e, r) => { + return r !== null && e3(r.index - i) < n.parent.length / Sle ? (Tle(r, n, i), r) : mLe(t._searchMarker, n, i); +}, ow = (t, e, r) => { for (let n = t.length - 1; n >= 0; n--) { const i = t[n]; if (r > 0) { @@ -19532,17 +19532,17 @@ const ELe = (t) => { } i.p = s, s.marker = !0; } - (e < i.index || r > 0 && e === i.index) && (i.index = Yp(e, i.index + r)); + (e < i.index || r > 0 && e === i.index) && (i.index = zp(e, i.index + r)); } -}, p6 = (t, e, r) => { +}, u6 = (t, e, r) => { const n = t, i = e.changedParentTypes; - for (; Zf(i, t, () => []).push(r), t._item !== null; ) + for (; Xf(i, t, () => []).push(r), t._item !== null; ) t = t._item.parent; - Tle(n._eH, r, e); + mle(n._eH, r, e); }; -class ua { +class ca { constructor() { - this._item = null, this._map = /* @__PURE__ */ new Map(), this._start = null, this.doc = null, this._length = 0, this._eH = UY(), this._dEH = UY(), this._searchMarker = null; + this._item = null, this._map = /* @__PURE__ */ new Map(), this._start = null, this.doc = null, this._length = 0, this._eH = AY(), this._dEH = AY(), this._searchMarker = null; } get parent() { return this._item ? this._item.parent : null; @@ -19551,10 +19551,10 @@ class ua { this.doc = e, this._item = r; } _copy() { - throw oh(); + throw ih(); } clone() { - throw oh(); + throw ih(); } _write(e) { } @@ -19568,21 +19568,21 @@ class ua { !e.local && this._searchMarker && (this._searchMarker.length = 0); } observe(e) { - QY(this._eH, e); + RY(this._eH, e); } observeDeep(e) { - QY(this._dEH, e); + RY(this._dEH, e); } unobserve(e) { - VY(this._eH, e); + LY(this._eH, e); } unobserveDeep(e) { - VY(this._dEH, e); + LY(this._dEH, e); } toJSON() { } } -const Nle = (t, e, r) => { +const Cle = (t, e, r) => { e < 0 && (e = t._length + e), r < 0 && (r = t._length + r); let n = r - e; const i = []; @@ -19601,7 +19601,7 @@ const Nle = (t, e, r) => { s = s.right; } return i; -}, Ile = (t) => { +}, Ele = (t) => { const e = []; let r = t._start; for (; r !== null; ) { @@ -19613,7 +19613,7 @@ const Nle = (t, e, r) => { r = r.right; } return e; -}, uw = (t, e) => { +}, lw = (t, e) => { let r = 0, n = t._start; for (; n !== null; ) { if (n.countable && !n.deleted) { @@ -19623,12 +19623,12 @@ const Nle = (t, e, r) => { } n = n.right; } -}, $le = (t, e) => { +}, _le = (t, e) => { const r = []; - return uw(t, (n, i) => { + return lw(t, (n, i) => { r.push(e(n, i, t)); }), r; -}, ALe = (t) => { +}, vLe = (t) => { let e = t._start, r = null, n = 0; return { [Symbol.iterator]() { @@ -19652,8 +19652,8 @@ const Nle = (t, e, r) => { }; } }; -}, Ble = (t, e) => { - const r = d6(t, e); +}, Ale = (t, e) => { + const r = c6(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) { @@ -19661,12 +19661,12 @@ const Nle = (t, e, r) => { return n.content.getContent()[e]; e -= n.length; } -}, NT = (t, e, r, n) => { +}, DT = (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 zn(Wr(a, qi(o, a)), i, i && i.lastId, l, l && l.id, e, null, new kg(u)), i.integrate(t, 0), u = []); + u.length > 0 && (i = new zn(Wr(a, zi(o, a)), i, i && i.lastId, l, l && l.id, e, null, new bg(u)), i.integrate(t, 0), u = []); }; n.forEach((f) => { if (f === null) @@ -19684,61 +19684,61 @@ const Nle = (t, e, r) => { switch (h(), f.constructor) { case Uint8Array: case ArrayBuffer: - i = new zn(Wr(a, qi(o, a)), i, i && i.lastId, l, l && l.id, e, null, new Ak(new Uint8Array(f))), i.integrate(t, 0); + i = new zn(Wr(a, zi(o, a)), i, i && i.lastId, l, l && l.id, e, null, new Ck(new Uint8Array(f))), i.integrate(t, 0); break; - case Qy: - i = new zn(Wr(a, qi(o, a)), i, i && i.lastId, l, l && l.id, e, null, new Rk(f)), i.integrate(t, 0); + case By: + i = new zn(Wr(a, zi(o, a)), i, i && i.lastId, l, l && l.id, e, null, new Ek(f)), i.integrate(t, 0); break; default: - if (f instanceof ua) - i = new zn(Wr(a, qi(o, a)), i, i && i.lastId, l, l && l.id, e, null, new Mh(f)), i.integrate(t, 0); + if (f instanceof ca) + i = new zn(Wr(a, zi(o, a)), i, i && i.lastId, l, l && l.id, e, null, new _h(f)), i.integrate(t, 0); else throw new Error("Unexpected content type in insert operation"); } } }), h(); -}, Fle = () => yp("Length exceeded!"), zle = (t, e, r, n) => { +}, Rle = () => dp("Length exceeded!"), Lle = (t, e, r, n) => { if (r > e._length) - throw Fle(); + throw Rle(); if (r === 0) - return e._searchMarker && cw(e._searchMarker, r, n.length), NT(t, e, null, n); - const i = r, s = d6(e, r); + return e._searchMarker && ow(e._searchMarker, r, n.length), DT(t, e, null, n); + const i = r, s = c6(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 && qo(t, Wr(a.id.client, a.id.clock + r)); + r < a.length && Bo(t, Wr(a.id.client, a.id.clock + r)); break; } r -= a.length; } - return e._searchMarker && cw(e._searchMarker, i, n.length), NT(t, e, a, n); -}, RLe = (t, e, r) => { + return e._searchMarker && ow(e._searchMarker, i, n.length), DT(t, e, a, n); +}, yLe = (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 NT(t, e, i, r); -}, qle = (t, e, r, n) => { + return DT(t, e, i, r); +}, Mle = (t, e, r, n) => { if (n === 0) return; - const i = r, s = n, a = d6(e, r); + const i = r, s = n, a = c6(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 && qo(t, Wr(o.id.client, o.id.clock + r)), r -= o.length); + !o.deleted && o.countable && (r < o.length && Bo(t, Wr(o.id.client, o.id.clock + r)), r -= o.length); for (; n > 0 && o !== null; ) - o.deleted || (n < o.length && qo(t, Wr(o.id.client, o.id.clock + n)), o.delete(t), n -= o.length), o = o.right; + o.deleted || (n < o.length && Bo(t, Wr(o.id.client, o.id.clock + n)), o.delete(t), n -= o.length), o = o.right; if (n > 0) - throw Fle(); - e._searchMarker && cw(e._searchMarker, i, -s + n); -}, IT = (t, e, r) => { + throw Rle(); + e._searchMarker && ow(e._searchMarker, i, -s + n); +}, PT = (t, e, r) => { const n = e._map.get(r); n !== void 0 && n.delete(t); -}, YB = (t, e, r, n) => { +}, PB = (t, e, r, n) => { const i = e._map.get(r) || null, s = t.doc, a = s.clientID; let o; if (n == null) - o = new kg([n]); + o = new bg([n]); else switch (n.constructor) { case Number: @@ -19746,80 +19746,80 @@ const Nle = (t, e, r) => { case Boolean: case Array: case String: - o = new kg([n]); + o = new bg([n]); break; case Uint8Array: - o = new Ak(n); + o = new Ck(n); break; - case Qy: - o = new Rk(n); + case By: + o = new Ek(n); break; default: - if (n instanceof ua) - o = new Mh(n); + if (n instanceof ca) + o = new _h(n); else throw new Error("Unexpected content type"); } - new zn(Wr(a, qi(s.store, a)), i, i && i.lastId, null, null, e, r, o).integrate(t, 0); -}, GB = (t, e) => { + new zn(Wr(a, zi(s.store, a)), i, i && i.lastId, null, null, e, r, o).integrate(t, 0); +}, NB = (t, e) => { const r = t._map.get(e); return r !== void 0 && !r.deleted ? r.content.getContent()[r.length - 1] : void 0; -}, Ule = (t) => { +}, Dle = (t) => { const e = {}; return t._map.forEach((r, n) => { r.deleted || (e[n] = r.content.getContent()[r.length - 1]); }), e; -}, Qle = (t, e) => { +}, Ple = (t, e) => { const r = t._map.get(e); return r !== void 0 && !r.deleted; -}, LLe = (t, e) => { +}, bLe = (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 && a1(s, e) && (r[i] = s.content.getContent()[s.length - 1]); + s !== null && n1(s, e) && (r[i] = s.content.getContent()[s.length - 1]); }), r; -}, vS = (t) => WRe(t.entries(), (e) => !e[1].deleted); -class MLe extends f6 { +}, pS = (t) => DRe(t.entries(), (e) => !e[1].deleted); +class xLe extends l6 { constructor(e, r) { super(e, r), this._transaction = r; } } -class F1 extends ua { +class N1 extends ca { constructor() { super(), this._prelimContent = [], this._searchMarker = []; } static from(e) { - const r = new F1(); + const r = new N1(); return r.push(e), r; } _integrate(e, r) { super._integrate(e, r), this.insert(0, this._prelimContent), this._prelimContent = null; } _copy() { - return new F1(); + return new N1(); } clone() { - const e = new F1(); + const e = new N1(); return e.insert(0, this.toArray().map( - (r) => r instanceof ua ? r.clone() : r + (r) => r instanceof ca ? r.clone() : r )), e; } get length() { return this._prelimContent === null ? this._length : this._prelimContent.length; } _callObserver(e, r) { - super._callObserver(e, r), p6(this, e, new MLe(this, e)); + super._callObserver(e, r), u6(this, e, new xLe(this, e)); } insert(e, r) { this.doc !== null ? Bn(this.doc, (n) => { - zle(n, this, e, r); + Lle(n, this, e, r); }) : this._prelimContent.splice(e, 0, ...r); } push(e) { this.doc !== null ? Bn(this.doc, (r) => { - RLe(r, this, e); + yLe(r, this, e); }) : this._prelimContent.push(...e); } unshift(e) { @@ -19827,41 +19827,41 @@ class F1 extends ua { } delete(e, r = 1) { this.doc !== null ? Bn(this.doc, (n) => { - qle(n, this, e, r); + Mle(n, this, e, r); }) : this._prelimContent.splice(e, r); } get(e) { - return Ble(this, e); + return Ale(this, e); } toArray() { - return Ile(this); + return Ele(this); } slice(e = 0, r = this.length) { - return Nle(this, e, r); + return Cle(this, e, r); } toJSON() { - return this.map((e) => e instanceof ua ? e.toJSON() : e); + return this.map((e) => e instanceof ca ? e.toJSON() : e); } map(e) { - return $le(this, e); + return _le(this, e); } forEach(e) { - uw(this, e); + lw(this, e); } [Symbol.iterator]() { - return ALe(this); + return vLe(this); } _write(e) { - e.writeTypeRef(rMe); + e.writeTypeRef(VLe); } } -const DLe = (t) => new F1(); -class PLe extends f6 { +const wLe = (t) => new N1(); +class OLe extends l6 { constructor(e, r, n) { super(e, r), this.keysChanged = n; } } -class lh extends ua { +class sh extends ca { constructor(e) { super(), this._prelimContent = null, e === void 0 ? this._prelimContent = /* @__PURE__ */ new Map() : this._prelimContent = new Map(e); } @@ -19871,37 +19871,37 @@ class lh extends ua { }), this._prelimContent = null; } _copy() { - return new lh(); + return new sh(); } clone() { - const e = new lh(); + const e = new sh(); return this.forEach((r, n) => { - e.set(n, r instanceof ua ? r.clone() : r); + e.set(n, r instanceof ca ? r.clone() : r); }), e; } _callObserver(e, r) { - p6(this, e, new PLe(this, e, r)); + u6(this, e, new OLe(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 ua ? i.toJSON() : i; + e[n] = i instanceof ca ? i.toJSON() : i; } }), e; } get size() { - return [...vS(this._map)].length; + return [...pS(this._map)].length; } keys() { - return S8(vS(this._map), (e) => e[0]); + return y8(pS(this._map), (e) => e[0]); } values() { - return S8(vS(this._map), (e) => e[1].content.getContent()[e[1].length - 1]); + return y8(pS(this._map), (e) => e[1].content.getContent()[e[1].length - 1]); } entries() { - return S8(vS(this._map), (e) => [e[0], e[1].content.getContent()[e[1].length - 1]]); + return y8(pS(this._map), (e) => [e[0], e[1].content.getContent()[e[1].length - 1]]); } forEach(e) { this._map.forEach((r, n) => { @@ -19913,40 +19913,40 @@ class lh extends ua { } delete(e) { this.doc !== null ? Bn(this.doc, (r) => { - IT(r, this, e); + PT(r, this, e); }) : this._prelimContent.delete(e); } set(e, r) { return this.doc !== null ? Bn(this.doc, (n) => { - YB(n, this, e, r); + PB(n, this, e, r); }) : this._prelimContent.set(e, r), r; } get(e) { - return GB(this, e); + return NB(this, e); } has(e) { - return Qle(this, e); + return Ple(this, e); } clear() { this.doc !== null ? Bn(this.doc, (e) => { this.forEach(function(r, n, i) { - IT(e, i, n); + PT(e, i, n); }); }) : this._prelimContent.clear(); } _write(e) { - e.writeTypeRef(nMe); + e.writeTypeRef(WLe); } } -const NLe = (t) => new lh(), Nd = (t, e) => t === e || typeof t == "object" && typeof e == "object" && t && e && uRe(t, e); -class N9 { +const kLe = (t) => new sh(), Md = (t, e) => t === e || typeof t == "object" && typeof e == "object" && t && e && K8e(t, e); +class R9 { constructor(e, r, n, i) { this.left = e, this.right = r, this.index = n, this.currentAttributes = i; } forward() { - switch (this.right === null && uu(), this.right.content.constructor) { - case ws: - this.right.deleted || Vy(this.currentAttributes, this.right.content); + switch (this.right === null && ou(), this.right.content.constructor) { + case bs: + this.right.deleted || Fy(this.currentAttributes, this.right.content); break; default: this.right.deleted || (this.index += this.right.length); @@ -19955,77 +19955,77 @@ class N9 { this.left = this.right, this.right = this.right.right; } } -const JY = (t, e, r) => { +const zY = (t, e, r) => { for (; e.right !== null && r > 0; ) { switch (e.right.content.constructor) { - case ws: - e.right.deleted || Vy(e.currentAttributes, e.right.content); + case bs: + e.right.deleted || Fy(e.currentAttributes, e.right.content); break; default: - e.right.deleted || (r < e.right.length && qo(t, Wr(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 && Bo(t, Wr(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; -}, yS = (t, e, r) => { - const n = /* @__PURE__ */ new Map(), i = d6(e, r); +}, gS = (t, e, r) => { + const n = /* @__PURE__ */ new Map(), i = c6(e, r); if (i) { - const s = new N9(i.p.left, i.p, i.index, n); - return JY(t, s, r - i.index); + const s = new R9(i.p.left, i.p, i.index, n); + return zY(t, s, r - i.index); } else { - const s = new N9(null, e._start, 0, n); - return JY(t, s, r); + const s = new R9(null, e._start, 0, n); + return zY(t, s, r); } -}, Vle = (t, e, r, n) => { - for (; r.right !== null && (r.right.deleted === !0 || r.right.content.constructor === ws && Nd(n.get(r.right.content.key), r.right.content.value)); ) +}, Nle = (t, e, r, n) => { + for (; r.right !== null && (r.right.deleted === !0 || r.right.content.constructor === bs && Md(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 zn(Wr(s, qi(i.store, s)), l, l && l.lastId, u, u && u.id, e, null, new ws(o, a)); + const l = r.left, u = r.right, h = new zn(Wr(s, zi(i.store, s)), l, l && l.lastId, u, u && u.id, e, null, new bs(o, a)); h.integrate(t, 0), r.right = h, r.forward(); }); -}, Vy = (t, e) => { +}, Fy = (t, e) => { const { key: r, value: n } = e; n === null ? t.delete(r) : t.set(r, n); -}, Wle = (t, e) => { +}, Ile = (t, e) => { for (; t.right !== null; ) { - if (!(t.right.deleted || t.right.content.constructor === ws && Nd(e[t.right.content.key] || null, t.right.content.value))) + if (!(t.right.deleted || t.right.content.constructor === bs && Md(e[t.right.content.key] || null, t.right.content.value))) break; t.forward(); } -}, Yle = (t, e, r, n) => { +}, $le = (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 (!Nd(u, l)) { + if (!Md(u, l)) { a.set(o, u); const { left: h, right: f } = r; - r.right = new zn(Wr(s, qi(i.store, s)), h, h && h.lastId, f, f && f.id, e, null, new ws(o, l)), r.right.integrate(t, 0), r.forward(); + r.right = new zn(Wr(s, zi(i.store, s)), h, h && h.lastId, f, f && f.id, e, null, new bs(o, l)), r.right.integrate(t, 0), r.forward(); } } return a; -}, T8 = (t, e, r, n, i) => { +}, b8 = (t, e, r, n, i) => { r.currentAttributes.forEach((d, p) => { i[p] === void 0 && (i[p] = null); }); const s = t.doc, a = s.clientID; - Wle(r, i); - const o = Yle(t, e, r, i), l = n.constructor === String ? new yh(n) : n instanceof ua ? new Mh(n) : new om(n); + Ile(r, i); + const o = $le(t, e, r, i), l = n.constructor === String ? new gh(n) : n instanceof ca ? new _h(n) : new nm(n); let { left: u, right: h, index: f } = r; - e._searchMarker && cw(e._searchMarker, r.index, l.getLength()), h = new zn(Wr(a, qi(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(), Vle(t, e, r, o); -}, eG = (t, e, r, n, i) => { + e._searchMarker && ow(e._searchMarker, r.index, l.getLength()), h = new zn(Wr(a, zi(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(), Nle(t, e, r, o); +}, qY = (t, e, r, n, i) => { const s = t.doc, a = s.clientID; - Wle(r, i); - const o = Yle(t, e, r, i); + Ile(r, i); + const o = $le(t, e, r, i); e: - for (; r.right !== null && (n > 0 || o.size > 0 && (r.right.deleted || r.right.content.constructor === ws)); ) { + for (; r.right !== null && (n > 0 || o.size > 0 && (r.right.deleted || r.right.content.constructor === bs)); ) { if (!r.right.deleted) switch (r.right.content.constructor) { - case ws: { + case bs: { const { key: l, value: u } = r.right.content, h = i[l]; if (h !== void 0) { - if (Nd(h, u)) + if (Md(h, u)) o.delete(l); else { if (n === 0) @@ -20038,7 +20038,7 @@ const JY = (t, e, r) => { break; } default: - n < r.right.length && qo(t, Wr(r.right.id.client, r.right.id.clock + n)), n -= r.right.length; + n < r.right.length && Bo(t, Wr(r.right.id.client, r.right.id.clock + n)), n -= r.right.length; break; } r.forward(); @@ -20048,14 +20048,14 @@ const JY = (t, e, r) => { for (; n > 0; n--) l += ` `; - r.right = new zn(Wr(a, qi(s.store, a)), r.left, r.left && r.left.lastId, r.right, r.right && r.right.id, e, null, new yh(l)), r.right.integrate(t, 0), r.forward(); + r.right = new zn(Wr(a, zi(s.store, a)), r.left, r.left && r.left.lastId, r.right, r.right && r.right.id, e, null, new gh(l)), r.right.integrate(t, 0), r.forward(); } - Vle(t, e, r, o); -}, Gle = (t, e, r, n, i) => { + Nle(t, e, r, o); +}, Ble = (t, e, r, n, i) => { let s = e; - const a = jc(); + const a = Gc(); for (; s && (!s.countable || s.deleted); ) { - if (!s.deleted && s.content.constructor === ws) { + if (!s.deleted && s.content.constructor === bs) { const u = s.content; a.set(u.key, u); } @@ -20066,9 +20066,9 @@ const JY = (t, e, r) => { if (r === e && (l = !0), !e.deleted) { const u = e.content; switch (u.constructor) { - case ws: { + case bs: { 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 && Vy(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 && Fy(i, u); break; } } @@ -20076,71 +20076,71 @@ const JY = (t, e, r) => { e = e.right; } return o; -}, ILe = (t, e) => { +}, SLe = (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 === ws) { + if (!e.deleted && e.content.constructor === bs) { const n = e.content.key; r.has(n) ? e.delete(t) : r.add(n); } e = e.left; } -}, $Le = (t) => { +}, TLe = (t) => { let e = 0; return Bn(t.doc, (r) => { - let n = t._start, i = t._start, s = jc(); - const a = k9(s); + let n = t._start, i = t._start, s = Gc(); + const a = y9(s); for (; i; ) { if (i.deleted === !1) switch (i.content.constructor) { - case ws: - Vy(a, i.content); + case bs: + Fy(a, i.content); break; default: - e += Gle(r, n, i, s, a), s = k9(a), n = i; + e += Ble(r, n, i, s, a), s = y9(a), n = i; break; } i = i.right; } }), e; -}, BLe = (t) => { +}, CLe = (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 && Rle(t, r.store.clients.get(n), s, i, (a) => { - !a.deleted && a.content.constructor === ws && a.constructor !== jl && e.add(a.parent); + i !== s && wle(t, r.store.clients.get(n), s, i, (a) => { + !a.deleted && a.content.constructor === bs && a.constructor !== Gl && e.add(a.parent); }); } Bn(r, (n) => { - Tv(t, t.deleteSet, (i) => { - if (i instanceof jl || !i.parent._hasFormatting || e.has(i.parent)) + wv(t, t.deleteSet, (i) => { + if (i instanceof Gl || !i.parent._hasFormatting || e.has(i.parent)) return; const s = i.parent; - i.content.constructor === ws ? e.add(s) : ILe(n, i); + i.content.constructor === bs ? e.add(s) : SLe(n, i); }); for (const i of e) - $Le(i); + TLe(i); }); -}, tG = (t, e, r) => { - const n = r, i = k9(e.currentAttributes), s = e.right; +}, UY = (t, e, r) => { + const n = r, i = y9(e.currentAttributes), s = e.right; for (; r > 0 && e.right !== null; ) { if (e.right.deleted === !1) switch (e.right.content.constructor) { - case Mh: - case om: - case yh: - r < e.right.length && qo(t, Wr(e.right.id.client, e.right.id.clock + r)), r -= e.right.length, e.right.delete(t); + case _h: + case nm: + case gh: + r < e.right.length && Bo(t, Wr(e.right.id.client, e.right.id.clock + r)), r -= e.right.length, e.right.delete(t); break; } e.forward(); } - s && Gle(t, s, e.right, i, e.currentAttributes); + s && Ble(t, s, e.right, i, e.currentAttributes); const a = (e.left || e.right).parent; - return a._searchMarker && cw(a._searchMarker, e.index, -n + r), e; + return a._searchMarker && ow(a._searchMarker, e.index, -n + r), e; }; -class FLe extends f6 { +class ELe extends l6 { 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); @@ -20179,7 +20179,7 @@ class FLe extends f6 { }))), u = ""; break; case "retain": - h > 0 && (p = { retain: h }, lRe(l) || (p.attributes = iRe({}, l))), h = 0; + h > 0 && (p = { retain: h }, j8e(l) || (p.attributes = Y8e({}, l))), h = 0; break; } p && r.push(p), o = null; @@ -20187,30 +20187,30 @@ class FLe extends f6 { }; for (; a !== null; ) { switch (a.content.constructor) { - case Mh: - case om: + case _h: + case nm: 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 yh: + case gh: 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 ws: { + case bs: { const { key: p, value: g } = a.content; if (this.adds(a)) { if (!this.deletes(a)) { const m = i.get(p) || null; - Nd(m, g) ? g !== null && a.delete(n) : (o === "retain" && d(), Nd(g, s.get(p) || null) ? delete l[p] : l[p] = g); + Md(m, g) ? g !== null && a.delete(n) : (o === "retain" && d(), Md(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; - Nd(m, g) || (o === "retain" && d(), l[p] = m); + Md(m, g) || (o === "retain" && d(), l[p] = m); } else if (!a.deleted) { s.set(p, g); const m = l[p]; - m !== void 0 && (Nd(m, g) ? m !== null && a.delete(n) : (o === "retain" && d(), g === null ? delete l[p] : l[p] = g)); + m !== void 0 && (Md(m, g) ? m !== null && a.delete(n) : (o === "retain" && d(), g === null ? delete l[p] : l[p] = g)); } - a.deleted || (o === "insert" && d(), Vy(i, a.content)); + a.deleted || (o === "insert" && d(), Fy(i, a.content)); break; } } @@ -20228,7 +20228,7 @@ class FLe extends f6 { return this._delta; } } -class Ev extends ua { +class kv extends ca { constructor(e) { super(), this._pending = e !== void 0 ? [() => this.insert(0, e)] : [], this._searchMarker = [], this._hasFormatting = !1; } @@ -20245,21 +20245,21 @@ class Ev extends ua { this._pending = null; } _copy() { - return new Ev(); + return new kv(); } clone() { - const e = new Ev(); + const e = new kv(); return e.applyDelta(this.toDelta()), e; } _callObserver(e, r) { super._callObserver(e, r); - const n = new FLe(this, e, r); - p6(this, e, n), !e.local && this._hasFormatting && (e._needFormattingCleanup = !0); + const n = new ELe(this, e, r); + u6(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 === yh && (e += r.content.str), r = r.right; + !r.deleted && r.countable && r.content.constructor === gh && (e += r.content.str), r = r.right; return e; } toJSON() { @@ -20267,15 +20267,15 @@ class Ev extends ua { } applyDelta(e, { sanitize: r = !0 } = {}) { this.doc !== null ? Bn(this.doc, (n) => { - const i = new N9(null, this._start, 0, /* @__PURE__ */ new Map()); + const i = new R9(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) && T8(n, this, i, o, a.attributes || {}); + (typeof o != "string" || o.length > 0) && b8(n, this, i, o, a.attributes || {}); } else - a.retain !== void 0 ? eG(n, this, i, a.retain, a.attributes || {}) : a.delete !== void 0 && tG(n, i, a.delete); + a.retain !== void 0 ? qY(n, this, i, a.retain, a.attributes || {}) : a.delete !== void 0 && UY(n, i, a.delete); } }) : this._pending.push(() => this.applyDelta(e)); } @@ -20295,15 +20295,15 @@ class Ev extends ua { } const h = () => { for (; l !== null; ) { - if (a1(l, e) || r !== void 0 && a1(l, r)) + if (n1(l, e) || r !== void 0 && n1(l, r)) switch (l.content.constructor) { - case yh: { + case gh: { const f = s.get("ychange"); - e !== void 0 && !a1(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 && !a1(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 && !n1(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 && !n1(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 Mh: - case om: { + case _h: + case nm: { u(); const f = { insert: l.content.getContent()[0] @@ -20317,8 +20317,8 @@ class Ev extends ua { i.push(f); break; } - case ws: - a1(l, e) && (u(), Vy(s, l.content)); + case bs: + n1(l, e) && (u(), Fy(s, l.content)); break; } l = l.right; @@ -20326,7 +20326,7 @@ class Ev extends ua { u(); }; return e || r ? Bn(a, (f) => { - e && D9(f, e), r && D9(f, r), h(); + e && _9(f, e), r && _9(f, r), h(); }, "cleanup") : h(), i; } insert(e, r, n) { @@ -20334,17 +20334,17 @@ class Ev extends ua { return; const i = this.doc; i !== null ? Bn(i, (s) => { - const a = yS(s, this, e); + const a = gS(s, this, e); n || (n = {}, a.currentAttributes.forEach((o, l) => { n[l] = o; - })), T8(s, this, a, r, n); + })), b8(s, this, a, r, n); }) : this._pending.push(() => this.insert(e, r, n)); } insertEmbed(e, r, n = {}) { const i = this.doc; i !== null ? Bn(i, (s) => { - const a = yS(s, this, e); - T8(s, this, a, r, n); + const a = gS(s, this, e); + b8(s, this, a, r, n); }) : this._pending.push(() => this.insertEmbed(e, r, n)); } delete(e, r) { @@ -20352,7 +20352,7 @@ class Ev extends ua { return; const n = this.doc; n !== null ? Bn(n, (i) => { - tG(i, yS(i, this, e), r); + UY(i, gS(i, this, e), r); }) : this._pending.push(() => this.delete(e, r)); } format(e, r, n) { @@ -20360,32 +20360,32 @@ class Ev extends ua { return; const i = this.doc; i !== null ? Bn(i, (s) => { - const a = yS(s, this, e); - a.right !== null && eG(s, this, a, r, n); + const a = gS(s, this, e); + a.right !== null && qY(s, this, a, r, n); }) : this._pending.push(() => this.format(e, r, n)); } removeAttribute(e) { this.doc !== null ? Bn(this.doc, (r) => { - IT(r, this, e); + PT(r, this, e); }) : this._pending.push(() => this.removeAttribute(e)); } setAttribute(e, r) { this.doc !== null ? Bn(this.doc, (n) => { - YB(n, this, e, r); + PB(n, this, e, r); }) : this._pending.push(() => this.setAttribute(e, r)); } getAttribute(e) { - return GB(this, e); + return NB(this, e); } getAttributes() { - return Ule(this); + return Dle(this); } _write(e) { - e.writeTypeRef(iMe); + e.writeTypeRef(YLe); } } -const zLe = (t) => new Ev(); -class C8 { +const _Le = (t) => new kv(); +class x8 { constructor(e, r = () => !0) { this._filter = r, this._root = e, this._currentNode = e._start, this._firstCall = !0; } @@ -20396,7 +20396,7 @@ class C8 { 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 === hw || r.constructor === Og) && r._start !== null) + if (r = e.content.type, !e.deleted && (r.constructor === cw || r.constructor === yg) && r._start !== null) e = r._start; else for (; e !== null; ) @@ -20409,7 +20409,7 @@ class C8 { return this._firstCall = !1, e === null ? { value: void 0, done: !0 } : (this._currentNode = e, { value: e.content.type, done: !1 }); } } -class Og extends ua { +class yg extends ca { constructor() { super(), this._prelimContent = []; } @@ -20421,66 +20421,66 @@ class Og extends ua { super._integrate(e, r), this.insert(0, this._prelimContent), this._prelimContent = null; } _copy() { - return new Og(); + return new yg(); } clone() { - const e = new Og(); - return e.insert(0, this.toArray().map((r) => r instanceof ua ? r.clone() : r)), e; + const e = new yg(); + return e.insert(0, this.toArray().map((r) => r instanceof ca ? r.clone() : r)), e; } get length() { return this._prelimContent === null ? this._length : this._prelimContent.length; } createTreeWalker(e) { - return new C8(this, e); + return new x8(this, e); } querySelector(e) { e = e.toUpperCase(); - const n = new C8(this, (i) => i.nodeName && i.nodeName.toUpperCase() === e).next(); + const n = new x8(this, (i) => i.nodeName && i.nodeName.toUpperCase() === e).next(); return n.done ? null : n.value; } querySelectorAll(e) { - return e = e.toUpperCase(), vp(new C8(this, (r) => r.nodeName && r.nodeName.toUpperCase() === e)); + return e = e.toUpperCase(), fp(new x8(this, (r) => r.nodeName && r.nodeName.toUpperCase() === e)); } _callObserver(e, r) { - p6(this, e, new QLe(this, r, e)); + u6(this, e, new LLe(this, r, e)); } toString() { - return $le(this, (e) => e.toString()).join(""); + return _le(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), uw(this, (s) => { + return n !== void 0 && n._createAssociation(i, this), lw(this, (s) => { i.insertBefore(s.toDOM(e, r, n), null); }), i; } insert(e, r) { this.doc !== null ? Bn(this.doc, (n) => { - zle(n, this, e, r); + Lle(n, this, e, r); }) : this._prelimContent.splice(e, 0, ...r); } insertAfter(e, r) { if (this.doc !== null) Bn(this.doc, (n) => { - const i = e && e instanceof ua ? e._item : e; - NT(n, this, i, r); + const i = e && e instanceof ca ? e._item : e; + DT(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 yp("Reference item not found"); + throw dp("Reference item not found"); n.splice(i, 0, ...r); } } delete(e, r = 1) { this.doc !== null ? Bn(this.doc, (n) => { - qle(n, this, e, r); + Mle(n, this, e, r); }) : this._prelimContent.splice(e, r); } toArray() { - return Ile(this); + return Ele(this); } push(e) { this.insert(this.length, e); @@ -20489,20 +20489,20 @@ class Og extends ua { this.insert(0, e); } get(e) { - return Ble(this, e); + return Ale(this, e); } slice(e = 0, r = this.length) { - return Nle(this, e, r); + return Cle(this, e, r); } forEach(e) { - uw(this, e); + lw(this, e); } _write(e) { - e.writeTypeRef(aMe); + e.writeTypeRef(HLe); } } -const qLe = (t) => new Og(); -class hw extends Og { +const ALe = (t) => new yg(); +class cw extends yg { constructor(e = "UNDEFINED") { super(), this.nodeName = e, this._prelimAttrs = /* @__PURE__ */ new Map(); } @@ -20520,13 +20520,13 @@ class hw extends Og { }), this._prelimAttrs = null; } _copy() { - return new hw(this.nodeName); + return new cw(this.nodeName); } clone() { - const e = new hw(this.nodeName), r = this.getAttributes(); - return aRe(r, (n, i) => { + const e = new cw(this.nodeName), r = this.getAttributes(); + return H8e(r, (n, i) => { typeof n == "string" && e.setAttribute(i, n); - }), e.insert(0, this.toArray().map((n) => n instanceof ua ? n.clone() : n)), e; + }), e.insert(0, this.toArray().map((n) => n instanceof ca ? n.clone() : n)), e; } toString() { const e = this.getAttributes(), r = [], n = []; @@ -20543,22 +20543,22 @@ class hw extends Og { } removeAttribute(e) { this.doc !== null ? Bn(this.doc, (r) => { - IT(r, this, e); + PT(r, this, e); }) : this._prelimAttrs.delete(e); } setAttribute(e, r) { this.doc !== null ? Bn(this.doc, (n) => { - YB(n, this, e, r); + PB(n, this, e, r); }) : this._prelimAttrs.set(e, r); } getAttribute(e) { - return GB(this, e); + return NB(this, e); } hasAttribute(e) { - return Qle(this, e); + return Ple(this, e); } getAttributes(e) { - return e ? LLe(this, e) : Ule(this); + return e ? bLe(this, e) : Dle(this); } toDOM(e = document, r = {}, n) { const i = e.createElement(this.nodeName), s = this.getAttributes(); @@ -20566,31 +20566,31 @@ class hw extends Og { const o = s[a]; typeof o == "string" && i.setAttribute(a, o); } - return uw(this, (a) => { + return lw(this, (a) => { i.appendChild(a.toDOM(e, r, n)); }), n !== void 0 && n._createAssociation(i, this), i; } _write(e) { - e.writeTypeRef(sMe), e.writeKey(this.nodeName); + e.writeTypeRef(GLe), e.writeKey(this.nodeName); } } -const ULe = (t) => new hw(t.readKey()); -class QLe extends f6 { +const RLe = (t) => new cw(t.readKey()); +class LLe extends l6 { 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 $T extends lh { +class NT extends sh { constructor(e) { super(), this.hookName = e; } _copy() { - return new $T(this.hookName); + return new NT(this.hookName); } clone() { - const e = new $T(this.hookName); + const e = new NT(this.hookName); return this.forEach((r, n) => { e.set(n, r); }), e; @@ -20601,11 +20601,11 @@ class $T extends lh { 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(oMe), e.writeKey(this.hookName); + e.writeTypeRef(XLe), e.writeKey(this.hookName); } } -const VLe = (t) => new $T(t.readKey()); -class BT extends Ev { +const MLe = (t) => new NT(t.readKey()); +class IT extends kv { get nextSibling() { const e = this._item ? this._item.next : null; return e ? e.content.type : null; @@ -20615,10 +20615,10 @@ class BT extends Ev { return e ? e.content.type : null; } _copy() { - return new BT(); + return new IT(); } clone() { - const e = new BT(); + const e = new IT(); return e.applyDelta(this.toDelta()), e; } toDOM(e = document, r, n) { @@ -20655,29 +20655,29 @@ class BT extends Ev { return this.toString(); } _write(e) { - e.writeTypeRef(lMe); + e.writeTypeRef(jLe); } } -const WLe = (t) => new BT(); -class HB { +const DLe = (t) => new IT(); +class IB { constructor(e, r) { this.id = e, this.length = r; } get deleted() { - throw oh(); + throw ih(); } mergeWith(e) { return !1; } write(e, r, n) { - throw oh(); + throw ih(); } integrate(e, r) { - throw oh(); + throw ih(); } } -const YLe = 0; -class jl extends HB { +const PLe = 0; +class Gl extends IB { get deleted() { return !0; } @@ -20687,16 +20687,16 @@ class jl extends HB { return this.constructor !== e.constructor ? !1 : (this.length += e.length, !0); } integrate(e, r) { - r > 0 && (this.id.clock += r, this.length -= r), Ale(e.doc.store, this); + r > 0 && (this.id.clock += r, this.length -= r), xle(e.doc.store, this); } write(e, r) { - e.writeInfo(YLe), e.writeLen(this.length - r); + e.writeInfo(PLe), e.writeLen(this.length - r); } getMissing(e, r) { return null; } } -class Ak { +class Ck { constructor(e) { this.content = e; } @@ -20710,10 +20710,10 @@ class Ak { return !0; } copy() { - return new Ak(this.content); + return new Ck(this.content); } splice(e) { - throw oh(); + throw ih(); } mergeWith(e) { return !1; @@ -20731,8 +20731,8 @@ class Ak { return 3; } } -const GLe = (t) => new Ak(t.readBuf()); -class fw { +const NLe = (t) => new Ck(t.readBuf()); +class uw { constructor(e) { this.len = e; } @@ -20746,17 +20746,17 @@ class fw { return !1; } copy() { - return new fw(this.len); + return new uw(this.len); } splice(e) { - const r = new fw(this.len - e); + const r = new uw(this.len - e); return this.len = e, r; } mergeWith(e) { return this.len += e.len, !0; } integrate(e, r) { - ow(e.deleteSet, r.id.client, r.id.clock, this.len), r.markDeleted(); + sw(e.deleteSet, r.id.client, r.id.clock, this.len), r.markDeleted(); } delete(e) { } @@ -20769,8 +20769,8 @@ class fw { return 1; } } -const HLe = (t) => new fw(t.readLen()), Hle = (t, e) => new Qy({ guid: t, ...e, shouldLoad: e.shouldLoad || e.autoLoad || !1 }); -class Rk { +const ILe = (t) => new uw(t.readLen()), Fle = (t, e) => new By({ guid: t, ...e, shouldLoad: e.shouldLoad || e.autoLoad || !1 }); +class Ek { 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 = {}; @@ -20786,10 +20786,10 @@ class Rk { return !0; } copy() { - return new Rk(Hle(this.doc.guid, this.opts)); + return new Ek(Fle(this.doc.guid, this.opts)); } splice(e) { - throw oh(); + throw ih(); } mergeWith(e) { return !1; @@ -20809,8 +20809,8 @@ class Rk { return 9; } } -const XLe = (t) => new Rk(Hle(t.readString(), t.readAny())); -class om { +const $Le = (t) => new Ek(Fle(t.readString(), t.readAny())); +class nm { constructor(e) { this.embed = e; } @@ -20824,10 +20824,10 @@ class om { return !0; } copy() { - return new om(this.embed); + return new nm(this.embed); } splice(e) { - throw oh(); + throw ih(); } mergeWith(e) { return !1; @@ -20845,8 +20845,8 @@ class om { return 5; } } -const jLe = (t) => new om(t.readJSON()); -class ws { +const BLe = (t) => new nm(t.readJSON()); +class bs { constructor(e, r) { this.key = e, this.value = r; } @@ -20860,10 +20860,10 @@ class ws { return !1; } copy() { - return new ws(this.key, this.value); + return new bs(this.key, this.value); } splice(e) { - throw oh(); + throw ih(); } mergeWith(e) { return !1; @@ -20883,8 +20883,8 @@ class ws { return 6; } } -const ZLe = (t) => new ws(t.readKey(), t.readJSON()); -class FT { +const FLe = (t) => new bs(t.readKey(), t.readJSON()); +class $T { constructor(e) { this.arr = e; } @@ -20898,10 +20898,10 @@ class FT { return !0; } copy() { - return new FT(this.arr); + return new $T(this.arr); } splice(e) { - const r = new FT(this.arr.slice(e)); + const r = new $T(this.arr.slice(e)); return this.arr = this.arr.slice(0, e), r; } mergeWith(e) { @@ -20925,15 +20925,15 @@ class FT { return 2; } } -const KLe = (t) => { +const zLe = (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 FT(r); + return new $T(r); }; -class kg { +class bg { constructor(e) { this.arr = e; } @@ -20947,10 +20947,10 @@ class kg { return !0; } copy() { - return new kg(this.arr); + return new bg(this.arr); } splice(e) { - const r = new kg(this.arr.slice(e)); + const r = new bg(this.arr.slice(e)); return this.arr = this.arr.slice(0, e), r; } mergeWith(e) { @@ -20974,13 +20974,13 @@ class kg { return 8; } } -const JLe = (t) => { +const qLe = (t) => { const e = t.readLen(), r = []; for (let n = 0; n < e; n++) r.push(t.readAny()); - return new kg(r); + return new bg(r); }; -class yh { +class gh { constructor(e) { this.str = e; } @@ -20994,10 +20994,10 @@ class yh { return !0; } copy() { - return new yh(this.str); + return new gh(this.str); } splice(e) { - const r = new yh(this.str.slice(e)); + const r = new gh(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; @@ -21018,16 +21018,16 @@ class yh { return 4; } } -const eMe = (t) => new yh(t.readString()), tMe = [ - DLe, - NLe, - zLe, - ULe, - qLe, - VLe, - WLe -], rMe = 0, nMe = 1, iMe = 2, sMe = 3, aMe = 4, oMe = 5, lMe = 6; -class Mh { +const ULe = (t) => new gh(t.readString()), QLe = [ + wLe, + kLe, + _Le, + RLe, + ALe, + MLe, + DLe +], VLe = 0, WLe = 1, YLe = 2, GLe = 3, HLe = 4, XLe = 5, jLe = 6; +class _h { constructor(e) { this.type = e; } @@ -21041,10 +21041,10 @@ class Mh { return !0; } copy() { - return new Mh(this.type._copy()); + return new _h(this.type._copy()); } splice(e) { - throw oh(); + throw ih(); } mergeWith(e) { return !1; @@ -21076,19 +21076,19 @@ class Mh { return 7; } } -const cMe = (t) => new Mh(tMe[t.readTypeRef()](t)), I9 = (t, e) => { +const ZLe = (t) => new _h(QLe[t.readTypeRef()](t)), L9 = (t, e) => { let r = e, n = 0, i; do - n > 0 && (r = Wr(r.client, r.clock + n)), i = s5(t, r), n = r.clock - i.id.clock, r = i.redone; + n > 0 && (r = Wr(r.client, r.clock + n)), i = n3(t, r), n = r.clock - i.id.clock, r = i.redone; while (r !== null && i instanceof zn); return { item: i, diff: n }; -}, XB = (t, e) => { +}, $B = (t, e) => { for (; t !== null && t.keep !== e; ) t.keep = e, t = t.parent._item; -}, zT = (t, e, r) => { +}, BT = (t, e, r) => { const { client: n, clock: i } = e.id, s = new zn( Wr(n, i + r), e, @@ -21100,23 +21100,23 @@ const cMe = (t) => new Mh(tMe[t.readTypeRef()](t)), I9 = (t, e) => { e.content.splice(r) ); return e.deleted && s.markDeleted(), e.keep && (s.keep = !0), e.redone !== null && (s.redone = Wr(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; -}, rG = (t, e) => p8e(t, (r) => Ek(r.deletions, e)), Xle = (t, e, r, n, i, s) => { +}, QY = (t, e) => r8e(t, (r) => Sk(r.deletions, e)), zle = (t, e, r, n, i, s) => { const a = t.doc, o = a.store, l = a.clientID, u = e.redone; if (u !== null) - return qo(t, u); + return Bo(t, u); let h = e.parent._item, f = null, d; if (h !== null && h.deleted === !0) { - if (h.redone === null && (!r.has(h) || Xle(t, h, r, n, i, s) === null)) + if (h.redone === null && (!r.has(h) || zle(t, h, r, n, i, s) === null)) return null; for (; h.redone !== null; ) - h = qo(t, h.redone); + h = Bo(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 : qo(t, y.redone); + y = y.redone === null ? null : Bo(t, y.redone); if (y !== null && y.parent._item === h) { f = y; break; @@ -21126,7 +21126,7 @@ const cMe = (t) => new Mh(tMe[t.readTypeRef()](t)), I9 = (t, e) => { for (; d !== null; ) { let y = d; for (; y !== null && y.parent._item !== h; ) - y = y.redone === null ? null : qo(t, y.redone); + y = y.redone === null ? null : Bo(t, y.redone); if (y !== null && y.parent._item === h) { d = y; break; @@ -21134,14 +21134,14 @@ const cMe = (t) => new Mh(tMe[t.readTypeRef()](t)), I9 = (t, e) => { d = d.right; } } else if (d = null, e.right && !i) { - for (f = e; f !== null && f.right !== null && (f.right.redone || Ek(n, f.right.id) || rG(s.undoStack, f.right.id) || rG(s.redoStack, f.right.id)); ) + for (f = e; f !== null && f.right !== null && (f.right.redone || Sk(n, f.right.id) || QY(s.undoStack, f.right.id) || QY(s.redoStack, f.right.id)); ) for (f = f.right; f.redone; ) - f = qo(t, f.redone); + f = Bo(t, f.redone); if (f && f.right !== null) return null; } else f = p._map.get(e.parentSub) || null; - const g = qi(o, l), m = Wr(l, g), v = new zn( + const g = zi(o, l), m = Wr(l, g), v = new zn( m, f, f && f.lastId, @@ -21151,55 +21151,55 @@ const cMe = (t) => new Mh(tMe[t.readTypeRef()](t)), I9 = (t, e) => { e.parentSub, e.content.copy() ); - return e.redone = m, XB(v, !0), v.integrate(t, 0), v; + return e.redone = m, $B(v, !0), v.integrate(t, 0), v; }; -class zn extends HB { +class zn extends IB { 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() ? LY : 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() ? yY : 0; } set marker(e) { - (this.info & b8) > 0 !== e && (this.info ^= b8); + (this.info & d8) > 0 !== e && (this.info ^= d8); } get marker() { - return (this.info & b8) > 0; + return (this.info & d8) > 0; } get keep() { - return (this.info & RY) > 0; + return (this.info & vY) > 0; } set keep(e) { - this.keep !== e && (this.info ^= RY); + this.keep !== e && (this.info ^= vY); } get countable() { - return (this.info & LY) > 0; + return (this.info & yY) > 0; } get deleted() { - return (this.info & y8) > 0; + return (this.info & f8) > 0; } set deleted(e) { - this.deleted !== e && (this.info ^= y8); + this.deleted !== e && (this.info ^= f8); } markDeleted() { - this.info |= y8; + this.info |= f8; } getMissing(e, r) { - if (this.origin && this.origin.client !== this.id.client && this.origin.clock >= qi(r, this.origin.client)) + if (this.origin && this.origin.client !== this.id.client && this.origin.clock >= zi(r, this.origin.client)) return this.origin.client; - if (this.rightOrigin && this.rightOrigin.client !== this.id.client && this.rightOrigin.clock >= qi(r, this.rightOrigin.client)) + if (this.rightOrigin && this.rightOrigin.client !== this.id.client && this.rightOrigin.clock >= zi(r, this.rightOrigin.client)) return this.rightOrigin.client; - if (this.parent && this.parent.constructor === B1 && this.id.client !== this.parent.client && this.parent.clock >= qi(r, this.parent.client)) + if (this.parent && this.parent.constructor === P1 && this.id.client !== this.parent.client && this.parent.clock >= zi(r, this.parent.client)) return this.parent.client; - if (this.origin && (this.left = GY(e, r, this.origin), this.origin = this.left.lastId), this.rightOrigin && (this.right = qo(e, this.rightOrigin), this.rightOrigin = this.right.id), this.left && this.left.constructor === jl || this.right && this.right.constructor === jl) + if (this.origin && (this.left = PY(e, r, this.origin), this.origin = this.left.lastId), this.rightOrigin && (this.right = Bo(e, this.rightOrigin), this.rightOrigin = this.right.id), this.left && this.left.constructor === Gl || this.right && this.right.constructor === Gl) this.parent = null; else if (!this.parent) this.left && this.left.constructor === zn && (this.parent = this.left.parent, this.parentSub = this.left.parentSub), this.right && this.right.constructor === zn && (this.parent = this.right.parent, this.parentSub = this.right.parentSub); - else if (this.parent.constructor === B1) { - const n = s5(r, this.parent); - n.constructor === jl ? this.parent = null : this.parent = n.content.type; + else if (this.parent.constructor === P1) { + const n = n3(r, this.parent); + n.constructor === Gl ? this.parent = null : this.parent = n.content.type; } return null; } integrate(e, r) { - if (r > 0 && (this.id.clock += r, this.left = GY(e, e.doc.store, Wr(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 = PY(e, e.doc.store, Wr(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) @@ -21211,13 +21211,13 @@ class zn extends HB { 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), b1(this.origin, i.origin)) { + if (a.add(i), s.add(i), g1(this.origin, i.origin)) { if (i.id.client < this.id.client) n = i, s.clear(); - else if (b1(this.rightOrigin, i.rightOrigin)) + else if (g1(this.rightOrigin, i.rightOrigin)) break; - } else if (i.origin !== null && a.has(s5(e.doc.store, i.origin))) - s.has(s5(e.doc.store, i.origin)) || (n = i, s.clear()); + } else if (i.origin !== null && a.has(n3(e.doc.store, i.origin))) + s.has(n3(e.doc.store, i.origin)) || (n = i, s.clear()); else break; i = i.right; @@ -21236,9 +21236,9 @@ class zn extends HB { 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), Ale(e.doc.store, this), this.content.integrate(e, this), XY(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), xle(e.doc.store, this), this.content.integrate(e, this), IY(e, this.parent, this.parentSub), (this.parent._item !== null && this.parent._item.deleted || this.parentSub !== null && this.right !== null) && this.delete(e); } else - new jl(this.id, this.length).integrate(e, 0); + new Gl(this.id, this.length).integrate(e, 0); } get next() { let e = this.right; @@ -21256,7 +21256,7 @@ class zn extends HB { return this.length === 1 ? this.id : Wr(this.id.client, this.id.clock + this.length - 1); } mergeWith(e) { - if (this.constructor === e.constructor && b1(e.origin, this.lastId) && this.right === e && b1(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 && g1(e.origin, this.lastId) && this.right === e && g1(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)); @@ -21267,50 +21267,50 @@ class zn extends HB { delete(e) { if (!this.deleted) { const r = this.parent; - this.countable && this.parentSub === null && (r._length -= this.length), this.markDeleted(), ow(e.deleteSet, this.id.client, this.id.clock, this.length), XY(e, r, this.parentSub), this.content.delete(e); + this.countable && this.parentSub === null && (r._length -= this.length), this.markDeleted(), sw(e.deleteSet, this.id.client, this.id.clock, this.length), IY(e, r, this.parentSub), this.content.delete(e); } } gc(e, r) { if (!this.deleted) - throw uu(); - this.content.gc(e), r ? pLe(e, this, new jl(this.id, this.length)) : this.content = new fw(this.length); + throw ou(); + this.content.gc(e), r ? rLe(e, this, new Gl(this.id, this.length)) : this.content = new uw(this.length); } write(e, r) { - const n = r > 0 ? Wr(this.id.client, this.id.clock + r - 1) : this.origin, i = this.rightOrigin, s = this.parentSub, a = this.content.getRef() & o6 | (n === null ? 0 : Ol) | (i === null ? 0 : bf) | (s === null ? 0 : nw); + const n = r > 0 ? Wr(this.id.client, this.id.clock + r - 1) : this.origin, i = this.rightOrigin, s = this.parentSub, a = this.content.getRef() & n6 | (n === null ? 0 : bl) | (i === null ? 0 : yf) | (s === null ? 0 : tw); 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 = Cle(o); + const u = vle(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 === B1 ? (e.writeParentInfo(!1), e.writeLeftID(o)) : uu(); + o.constructor === String ? (e.writeParentInfo(!0), e.writeString(o)) : o.constructor === P1 ? (e.writeParentInfo(!1), e.writeLeftID(o)) : ou(); s !== null && e.writeString(s); } this.content.write(e, r); } } -const jle = (t, e) => uMe[e & o6](t), uMe = [ +const qle = (t, e) => KLe[e & n6](t), KLe = [ () => { - uu(); + ou(); }, - HLe, - KLe, - GLe, - eMe, - jLe, + ILe, + zLe, + NLe, + ULe, + BLe, + FLe, ZLe, - cMe, - JLe, - XLe, + qLe, + $Le, () => { - uu(); + ou(); } -], hMe = 10; -class Zl extends HB { +], JLe = 10; +class Hl extends IB { get deleted() { return !0; } @@ -21320,41 +21320,41 @@ class Zl extends HB { return this.constructor !== e.constructor ? !1 : (this.length += e.length, !0); } integrate(e, r) { - uu(); + ou(); } write(e, r) { - e.writeInfo(hMe), Cr(e.restEncoder, this.length - r); + e.writeInfo(JLe), Cr(e.restEncoder, this.length - r); } getMissing(e, r) { return null; } } -const Zle = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof wl < "u" ? wl : {}, Kle = "__ $YJS$ __"; -Zle[Kle] === !0 && console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438"); -Zle[Kle] = !0; -class jB { +const Ule = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof yl < "u" ? yl : {}, Qle = "__ $YJS$ __"; +Ule[Qle] === !0 && console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438"); +Ule[Qle] = !0; +class BB { constructor(e, r) { this.yanchor = e, this.yhead = r; } toJSON() { return { - yanchor: WY(this.yanchor), - yhead: WY(this.yhead) + yanchor: MY(this.yanchor), + yhead: MY(this.yhead) }; } static fromJSON(e) { - return new jB(lw(e.yanchor), lw(e.yhead)); + return new BB(aw(e.yanchor), aw(e.yhead)); } } -class fMe { +class eMe { constructor(e, r) { - this.ytext = e, this.awareness = r, this.undoManager = new qB(e); + this.ytext = e, this.awareness = r, this.undoManager = new AB(e); } toYPos(e, r = 0) { - return L9(this.ytext, e, r); + return C9(this.ytext, e, r); } fromYPos(e) { - const r = M9(lw(e), this.ytext.doc); + const r = E9(aw(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 { @@ -21364,21 +21364,21 @@ class fMe { } toYRange(e) { const r = e.assoc, n = this.toYPos(e.anchor, r), i = this.toYPos(e.head, r); - return new jB(n, i); + return new BB(n, i); } fromYRange(e) { const r = this.fromYPos(e.yanchor), n = this.fromYPos(e.yhead); return r.pos === n.pos ? ft.cursor(n.pos, n.assoc) : ft.range(r.pos, n.pos); } } -const Lk = Gt.define({ +const _k = Gt.define({ combine(t) { return t[t.length - 1]; } -}), $9 = Oo.define(); -class dMe { +}), M9 = bo.define(); +class tMe { constructor(e) { - this.view = e, this.conf = e.state.facet(Lk), this._observer = (r, n) => { + this.view = e, this.conf = e.state.facet(_k), this._observer = (r, n) => { if (n.origin !== this.conf) { const i = r.delta, s = []; let a = 0; @@ -21386,12 +21386,12 @@ class dMe { 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: [$9.of(this.conf)] }); + e.dispatch({ changes: s, annotations: [M9.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($9) === this.conf) + if (!e.docChanged || e.transactions.length > 0 && e.transactions[0].annotation(M9) === this.conf) return; const r = this.conf.ytext; r.doc.transact(() => { @@ -21407,7 +21407,7 @@ class dMe { this._ytext.unobserve(this._observer); } } -const pMe = fn.fromClass(dMe), gMe = Mt.baseTheme({ +const rMe = fn.fromClass(tMe), nMe = Mt.baseTheme({ ".cm-ySelection": {}, ".cm-yLineSelection": { padding: 0, @@ -21461,24 +21461,24 @@ const pMe = fn.fromClass(dMe), gMe = Mt.baseTheme({ opacity: 1, transitionDelay: "0s" } -}), mMe = Oo.define(); -class vMe extends nl { +}), iMe = bo.define(); +class sMe extends el { constructor(e, r) { super(), this.color = e, this.name = r; } toDOM() { - return k8("span", [pl("class", "cm-ySelectionCaret"), pl("style", `background-color: ${this.color}; border-color: ${this.color}`)], [ - gS("\u2060"), - k8("div", [ - pl("class", "cm-ySelectionCaretDot") + return v8("span", [hl("class", "cm-ySelectionCaret"), hl("style", `background-color: ${this.color}; border-color: ${this.color}`)], [ + fS("\u2060"), + v8("div", [ + hl("class", "cm-ySelectionCaretDot") ]), - gS("\u2060"), - k8("div", [ - pl("class", "cm-ySelectionInfo") + fS("\u2060"), + v8("div", [ + hl("class", "cm-ySelectionInfo") ], [ - gS(this.name) + fS(this.name) ]), - gS("\u2060") + fS("\u2060") ]); } eq(e) { @@ -21497,10 +21497,10 @@ class vMe extends nl { return !0; } } -class yMe { +class aMe { constructor(e) { - this.conf = e.state.facet(Lk), 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: [mMe.of([])] }); + this.conf = e.state.facet(_k), 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: [iMe.of([])] }); }, this._awareness = this.conf.awareness, this._awareness.on("change", this._listener), this.decorations = jr.of([]); } destroy() { @@ -21509,10 +21509,10 @@ class yMe { 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 : lw(a.cursor.anchor), h = a.cursor == null ? null : lw(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 : aw(a.cursor.anchor), h = a.cursor == null ? null : aw(a.cursor.head); if (l != null) { - const f = L9(r, l.anchor), d = L9(r, l.head); - (a.cursor == null || !YY(u, f) || !YY(h, d)) && i.setLocalStateField("cursor", { + const f = C9(r, l.anchor), d = C9(r, l.head); + (a.cursor == null || !DY(u, f) || !DY(h, d)) && i.setLocalStateField("cursor", { anchor: f, head: d }); @@ -21525,10 +21525,10 @@ class yMe { const u = o.cursor; if (u == null || u.anchor == null || u.head == null) return; - const h = M9(u.anchor, n), f = M9(u.head, n); + const h = E9(u.anchor, n), f = E9(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 = a6(h.index, f.index), v = Yp(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 = r6(h.index, f.index), v = zp(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, @@ -21571,15 +21571,15 @@ class yMe { value: Ht.widget({ side: f.index - h.index > 0 ? -1 : 1, block: !1, - widget: new vMe(d, p) + widget: new sMe(d, p) }) }); }), this.decorations = Ht.set(s, !0); } } -const bMe = fn.fromClass(yMe, { +const oMe = fn.fromClass(aMe, { decorations: (t) => t.decorations -}), xMe = () => { +}), lMe = () => { let t = !0; return (e, r) => { if (t) { @@ -21593,7 +21593,7 @@ const bMe = fn.fromClass(yMe, { r !== void 0 && r(); }; }; -class wMe { +class cMe { constructor(e) { this.undoManager = e; } @@ -21610,14 +21610,14 @@ class wMe { return this.undoManager.redo() != null; } } -const g6 = Gt.define({ +const h6 = Gt.define({ combine(t) { return t[t.length - 1]; } }); -class OMe { +class uMe { constructor(e) { - this.view = e, this.conf = e.state.facet(g6), this._undoManager = this.conf.undoManager, this.syncConf = e.state.facet(Lk), this._beforeChangeSelection = null, this._mux = xMe(), this._onStackItemAdded = ({ stackItem: r, changedParentTypes: n }) => { + this.view = e, this.conf = e.state.facet(h6), this._undoManager = this.conf.undoManager, this.syncConf = e.state.facet(_k), this._beforeChangeSelection = null, this._mux = lMe(), 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); @@ -21630,34 +21630,34 @@ class OMe { }, 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($9) !== this.syncConf) && this._storeSelection(); + e.selectionSet && (e.transactions.length === 0 || e.transactions[0].annotation(M9) !== 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 kMe = fn.fromClass(OMe), SMe = ({ state: t, dispatch: e }) => t.facet(g6).undo() || !0, TMe = ({ state: t, dispatch: e }) => t.facet(g6).redo() || !0, CMe = (t, e, { undoManager: r = new qB(t) } = {}) => { - const n = new fMe(t, e), i = [ - Lk.of(n), - pMe +const hMe = fn.fromClass(uMe), fMe = ({ state: t, dispatch: e }) => t.facet(h6).undo() || !0, dMe = ({ state: t, dispatch: e }) => t.facet(h6).redo() || !0, pMe = (t, e, { undoManager: r = new AB(t) } = {}) => { + const n = new eMe(t, e), i = [ + _k.of(n), + rMe ]; return e && i.push( - gMe, - bMe + nMe, + oMe ), r !== !1 && i.push( - g6.of(new wMe(r)), - kMe, + h6.of(new cMe(r)), + hMe, Mt.domEventHandlers({ beforeinput(s, a) { - return s.inputType === "historyUndo" ? SMe(a) : s.inputType === "historyRedo" ? TMe(a) : !1; + return s.inputType === "historyUndo" ? fMe(a) : s.inputType === "historyRedo" ? dMe(a) : !1; } }) ), i; }; -class qT { +class FT { static create(e, r, n, i, s) { let a = i + (i << 8) + e + (r << 4) | 0; - return new qT(e, r, n, a, s, [], []); + return new FT(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 = [[Fr.contextHash, i]]; @@ -21668,7 +21668,7 @@ class qT { 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 kn(e.types[this.type], this.children, this.positions, r - this.from).balance({ - makeTree: (i, s, a) => new kn(xs.none, i, s, a, this.hashProp) + makeTree: (i, s, a) => new kn(ys.none, i, s, a, this.hashProp) }); } } @@ -21676,12 +21676,12 @@ var Vt; (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 EMe { +class gMe { constructor(e, r) { this.start = e, this.content = r, this.marks = [], this.parsers = []; } } -class _Me { +class mMe { constructor() { this.text = "", this.baseIndent = 0, this.basePos = 0, this.depth = 0, this.markers = [], this.pos = 0, this.indent = 0, this.next = -1; } @@ -21693,7 +21693,7 @@ class _Me { 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 fx(this.text, e); + return ux(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; ) @@ -21728,41 +21728,41 @@ class _Me { return e + this.text.slice(this.basePos); } } -function nG(t, e, r) { +function VY(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 ? JB : KB)(r, e, !1); - return n > 0 && (t.type != Vt.BulletList || ZB(r, e, !1) < 0) && r.text.charCodeAt(r.pos + n - 1) == t.value; + let n = (t.type == Vt.OrderedList ? qB : zB)(r, e, !1); + return n > 0 && (t.type != Vt.BulletList || FB(r, e, !1) < 0) && r.text.charCodeAt(r.pos + n - 1) == t.value; } -const Jle = { +const Vle = { [Vt.Blockquote](t, e, r) { - return r.next != 62 ? !1 : (r.markers.push(gn(Vt.QuoteMark, e.lineStart + r.pos, e.lineStart + r.pos + 1)), r.moveBase(r.pos + (Ac(r.text.charCodeAt(r.pos + 1)) ? 2 : 1)), t.end = e.lineStart + r.text.length, !0); + return r.next != 62 ? !1 : (r.markers.push(gn(Vt.QuoteMark, e.lineStart + r.pos, e.lineStart + r.pos + 1)), r.moveBase(r.pos + (Cc(r.text.charCodeAt(r.pos + 1)) ? 2 : 1)), t.end = e.lineStart + r.text.length, !0); }, [Vt.ListItem](t, e, r) { return r.indent < r.baseIndent + t.value && r.next > -1 ? !1 : (r.moveBaseColumn(r.baseIndent + t.value), !0); }, - [Vt.OrderedList]: nG, - [Vt.BulletList]: nG, + [Vt.OrderedList]: VY, + [Vt.BulletList]: VY, [Vt.Document]() { return !0; } }; -function Ac(t) { +function Cc(t) { return t == 32 || t == 9 || t == 10 || t == 13; } -function fx(t, e = 0) { - for (; e < t.length && Ac(t.charCodeAt(e)); ) +function ux(t, e = 0) { + for (; e < t.length && Cc(t.charCodeAt(e)); ) e++; return e; } -function iG(t, e, r) { - for (; e > r && Ac(t.charCodeAt(e - 1)); ) +function WY(t, e, r) { + for (; e > r && Cc(t.charCodeAt(e - 1)); ) e--; return e; } -function ece(t) { +function Wle(t) { if (t.next != 96 && t.next != 126) return -1; let e = t.pos + 1; @@ -21777,10 +21777,10 @@ function ece(t) { } return e; } -function tce(t) { +function Yle(t) { return t.next != 62 ? -1 : t.text.charCodeAt(t.pos + 1) == 32 ? 2 : 1; } -function ZB(t, e, r) { +function FB(t, e, r) { if (t.next != 42 && t.next != 45 && t.next != 95) return -1; let n = 1; @@ -21788,21 +21788,21 @@ function ZB(t, e, r) { let s = t.text.charCodeAt(i); if (s == t.next) n++; - else if (!Ac(s)) + else if (!Cc(s)) return -1; } - return r && t.next == 45 && ice(t) > -1 && t.depth == e.stack.length || n < 3 ? -1 : 1; + return r && t.next == 45 && Xle(t) > -1 && t.depth == e.stack.length || n < 3 ? -1 : 1; } -function rce(t, e) { +function Gle(t, e) { for (let r = t.stack.length - 1; r >= 0; r--) if (t.stack[r].type == e) return !0; return !1; } -function KB(t, e, r) { - return (t.next == 45 || t.next == 43 || t.next == 42) && (t.pos == t.text.length - 1 || Ac(t.text.charCodeAt(t.pos + 1))) && (!r || rce(e, Vt.BulletList) || t.skipSpace(t.pos + 2) < t.text.length) ? 1 : -1; +function zB(t, e, r) { + return (t.next == 45 || t.next == 43 || t.next == 42) && (t.pos == t.text.length - 1 || Cc(t.text.charCodeAt(t.pos + 1))) && (!r || Gle(e, Vt.BulletList) || t.skipSpace(t.pos + 2) < t.text.length) ? 1 : -1; } -function JB(t, e, r) { +function qB(t, e, r) { let n = t.pos, i = t.next; for (; i >= 48 && i <= 57; ) { n++; @@ -21810,9 +21810,9 @@ function JB(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 && !Ac(t.text.charCodeAt(n + 1)) || r && !rce(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 && !Cc(t.text.charCodeAt(n + 1)) || r && !Gle(e, Vt.OrderedList) && (t.skipSpace(n + 1) == t.text.length || n > t.pos + 1 || t.next != 49) ? -1 : n + 1 - t.pos; } -function nce(t) { +function Hle(t) { if (t.next != 35) return -1; let e = t.pos + 1; @@ -21823,53 +21823,53 @@ function nce(t) { let r = e - t.pos; return r > 6 ? -1 : r; } -function ice(t) { +function Xle(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 && Ac(t.text.charCodeAt(e)); ) + for (; e < t.text.length && Cc(t.text.charCodeAt(e)); ) e++; return e == t.text.length ? r : -1; } -const B9 = /^[ \t]*$/, sce = /-->/, ace = /\?>/, F9 = [ +const D9 = /^[ \t]*$/, jle = /-->/, Zle = /\?>/, P9 = [ [/^<(?:script|pre|style)(?:\s|>|$)/i, /<\/(?:script|pre|style)>/i], - [/^\s*" } } }), tue = /* @__PURE__ */ new Fr(), rue = /* @__PURE__ */ zMe.configure({ +}), Wce = /* @__PURE__ */ z$({ commentTokens: { block: { open: "" } } }), Yce = /* @__PURE__ */ new Fr(), Gce = /* @__PURE__ */ _Me.configure({ props: [ - /* @__PURE__ */ sm.add((t) => !t.is("Block") || t.is("Document") || Y9(t) != null ? void 0 : (e, r) => ({ from: r.doc.lineAt(e.from).to, to: e.to })), - /* @__PURE__ */ tue.add(Y9), - /* @__PURE__ */ $y.add({ + /* @__PURE__ */ tm.add((t) => !t.is("Block") || t.is("Document") || q9(t) != null ? void 0 : (e, r) => ({ from: r.doc.lineAt(e.from).to, to: e.to })), + /* @__PURE__ */ Yce.add(q9), + /* @__PURE__ */ My.add({ Document: () => null }), - /* @__PURE__ */ q0.add({ - Document: eue + /* @__PURE__ */ $0.add({ + Document: Wce }) ] }); -function Y9(t) { +function q9(t) { let e = /^(?:ATX|Setext)Heading(\d)$/.exec(t.name); return e ? +e[1] : void 0; } -function uPe(t, e) { +function KDe(t, e) { let r = t; for (; ; ) { let n = r.nextSibling, i; - if (!n || (i = Y9(n.type)) != null && i <= e) + if (!n || (i = q9(n.type)) != null && i <= e) break; r = n; } return r.to; } -const hPe = /* @__PURE__ */ $ae.of((t, e, r) => { +const JDe = /* @__PURE__ */ _ae.of((t, e, r) => { for (let n = Qn(t).resolveInner(r, -1); n && !(n.from < e); n = n.parent) { - let i = n.type.prop(tue); + let i = n.type.prop(Yce); if (i == null) continue; - let s = uPe(n, i); + let s = KDe(n, i); if (s > r) return { from: r, to: s }; } return null; }); -function iF(t) { - return new bl(eue, t, [hPe], "markdown"); +function YB(t) { + return new ml(Wce, t, [JDe], "markdown"); } -const fPe = /* @__PURE__ */ iF(rue), dPe = /* @__PURE__ */ rue.configure([ZMe, JMe, KMe, e9e, { +const ePe = /* @__PURE__ */ YB(Gce), tPe = /* @__PURE__ */ Gce.configure([FMe, qMe, zMe, UMe, { props: [ - /* @__PURE__ */ sm.add({ + /* @__PURE__ */ tm.add({ Table: (t, e) => ({ from: e.doc.lineAt(t.from).to, to: t.to }) }) ] -}]), nue = /* @__PURE__ */ iF(dPe); -function pPe(t, e) { +}]), Hce = /* @__PURE__ */ YB(tPe); +function rPe(t, e) { return (r) => { if (r && t) { let n = null; - if (r = /\S*/.exec(r)[0], typeof t == "function" ? n = t(r) : n = bT.matchLanguageName(t, r, !0), n instanceof bT) - return n.support ? n.support.language.parser : Hx.getSkippingParser(n.load()); + if (r = /\S*/.exec(r)[0], typeof t == "function" ? n = t(r) : n = vT.matchLanguageName(t, r, !0), n instanceof vT) + return n.support ? n.support.language.parser : Yx.getSkippingParser(n.load()); if (n) return n.parser; } return e ? e.parser : null; }; } -class wS { +class yS { 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; } @@ -26393,11 +26393,11 @@ class wS { } } marker(e, r) { - let n = this.node.name == "OrderedList" ? String(+sue(this.item, e)[2] + r) : ""; + let n = this.node.name == "OrderedList" ? String(+jce(this.item, e)[2] + r) : ""; return this.spaceBefore + n + this.type + this.spaceAfter; } } -function iue(t, e) { +function Xce(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); @@ -26405,28 +26405,28 @@ function iue(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 wS(s, l, l, "", "", "", null)); + n.push(new yS(s, l, l, "", "", "", null)); else if (s.name == "Blockquote" && (a = /^ *>( ?)/.exec(o.text.slice(l)))) - n.push(new wS(s, l, l + a[0].length, "", a[1], ">", null)); + n.push(new yS(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 wS(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 yS(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 wS(s.parent, l, l + h, a[1], u, f, s)); + a[3] && (f += a[3].replace(/[xX]/, " ")), n.push(new yS(s.parent, l, l + h, a[1], u, f, s)); } } return n; } -function sue(t, e) { +function jce(t, e) { return /^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from, t.from + 10)); } -function F8(t, e, r, n = 0) { +function D8(t, e, r, n = 0) { for (let i = -1, s = t; ; ) { if (s.name == "ListItem") { - let o = sue(s, e), l = +o[2]; + let o = jce(s, e), l = +o[2]; if (i >= 0) { if (l != i + 1) return; @@ -26440,20 +26440,20 @@ function F8(t, e, r, n = 0) { s = a; } } -function G9(t, e) { +function U9(t, e) { let r = /^[ \t]*/.exec(t)[0].length; - if (!r || e.facet(bg) != " ") + if (!r || e.facet(gg) != " ") return t; - let n = ou(t, 4, r), i = ""; + let n = iu(t, 4, r), i = ""; for (let s = n; s > 0; ) s >= 4 ? (i += " ", s -= 4) : (i += " ", s--); return i + t.slice(r); } -const gPe = ({ state: t, dispatch: e }) => { +const nPe = ({ state: t, dispatch: e }) => { let r = Qn(t), { doc: n } = t, i = null, s = t.changeByRange((a) => { - if (!a.empty || !nue.isActiveAt(t, a.from)) + if (!a.empty || !Hce.isActiveAt(t, a.from)) return i = { range: a }; - let o = a.from, l = n.lineAt(o), u = iue(r.resolveInner(o, -1), n); + let o = a.from, l = n.lineAt(o), u = Xce(r.resolveInner(o, -1), n); for (; u.length && u[u.length - 1].from > o - l.from; ) u.pop(); if (!u.length) @@ -26467,12 +26467,12 @@ const gPe = ({ 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" && F8(h.item, n, w, -2), v && v.node.name == "OrderedList" && F8(v.item, n, w), { range: ft.cursor(y + b.length), changes: w }; + return h.node.name == "OrderedList" && D8(h.item, n, w, -2), v && v.node.name == "OrderedList" && D8(v.item, n, w), { range: ft.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 ? ou(l.text, 4, u[y + 1].from) - v.length : null, y < b); - return v = G9(v, t), { + v += u[y].blank(y < b ? iu(l.text, 4, u[y + 1].from) - v.length : null, y < b); + return v = U9(v, t), { range: ft.cursor(o + v.length + 1), changes: { from: l.from, insert: v + t.lineBreak } }; @@ -26488,26 +26488,26 @@ const gPe = ({ state: t, dispatch: e }) => { } } let d = []; - h.node.name == "OrderedList" && F8(h.item, n, d); + h.node.name == "OrderedList" && D8(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 ? ou(l.text, 4, u[v + 1].from) - g.length : null); + g += v == y && !p ? u[v].marker(n, 1) : u[v].blank(v < y ? iu(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 = G9(g, t), d.push({ from: m, to: o, insert: t.lineBreak + g }), { range: ft.cursor(m + g.length + 1), changes: d }; + return g = U9(g, t), d.push({ from: m, to: o, insert: t.lineBreak + g }), { range: ft.cursor(m + g.length + 1), changes: d }; }); return i ? !1 : (e(t.update(s, { scrollIntoView: !0, userEvent: "input" })), !0); }; -function UG(t) { +function AG(t) { return t.name == "QuoteMark" || t.name == "ListMark"; } -function mPe(t, e) { +function iPe(t, e) { let r = t.resolveInner(e, -1), n = e; - UG(r) && (n = r.from, r = r.parent); + AG(r) && (n = r.from, r = r.parent); for (let i; i = r.childBefore(n); ) - if (UG(i)) + if (AG(i)) n = i.from; else if (i.name == "OrderedList" || i.name == "BulletList") r = i.lastChild, n = r.to; @@ -26515,11 +26515,11 @@ function mPe(t, e) { break; return r; } -const vPe = ({ state: t, dispatch: e }) => { +const sPe = ({ state: t, dispatch: e }) => { let r = Qn(t), n = null, i = t.changeByRange((s) => { let a = s.from, { doc: o } = t; - if (s.empty && nue.isActiveAt(t, s.from)) { - let l = o.lineAt(a), u = iue(mPe(r, a), o); + if (s.empty && Hce.isActiveAt(t, s.from)) { + let l = o.lineAt(a), u = Xce(iPe(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))) @@ -26530,8 +26530,8 @@ const vPe = ({ state: t, dispatch: e }) => { 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(ou(l.text, 4, h.to) - ou(l.text, 4, h.from)); - return d == l.from && (p = G9(p, t)), { + let p = h.blank(iu(l.text, 4, h.to) - iu(l.text, 4, h.from)); + return d == l.from && (p = U9(p, t)), { range: ft.cursor(d + p.length), changes: { from: d, to: l.from + h.to, insert: p } }; @@ -26544,22 +26544,22 @@ const vPe = ({ state: t, dispatch: e }) => { return n = { range: s }; }); return n ? !1 : (e(t.update(i, { scrollIntoView: !0, userEvent: "delete" })), !0); -}, aue = [ - { key: "Enter", run: gPe }, - { key: "Backspace", run: vPe } -], H9 = /* @__PURE__ */ lPe({ matchClosingTags: !1 }); -function yPe(t = {}) { - let { codeLanguages: e, defaultCodeLanguage: r, addKeymap: n = !0, base: { parser: i } = fPe, completeHTMLTags: s = !0 } = t; - if (!(i instanceof m6)) +}, Zce = [ + { key: "Enter", run: nPe }, + { key: "Backspace", run: sPe } +], Q9 = /* @__PURE__ */ jDe({ matchClosingTags: !1 }); +function aPe(t = {}) { + let { codeLanguages: e, defaultCodeLanguage: r, addKeymap: n = !0, base: { parser: i } = ePe, completeHTMLTags: s = !0 } = t; + if (!(i instanceof f6)) throw new RangeError("Base parser provided to `markdown` should be a Markdown parser"); - let a = t.extensions ? [t.extensions] : [], o = [H9.support], l; - r instanceof xv ? (o.push(r.support), l = r.language) : r && (l = r); - let u = e || l ? pPe(e, l) : void 0; - a.push(UMe({ codeParser: u, htmlParser: H9.language.parser })), n && o.push(Va.high(Qc.of(aue))); - let h = iF(i.configure(a)); - return s && o.push(h.data.of({ autocomplete: bPe })), new xv(h, o); -} -function bPe(t) { + let a = t.extensions ? [t.extensions] : [], o = [Q9.support], l; + r instanceof mv ? (o.push(r.support), l = r.language) : r && (l = r); + let u = e || l ? rPe(e, l) : void 0; + a.push(RMe({ codeParser: u, htmlParser: Q9.language.parser })), n && o.push(qa.high(zc.of(Zce))); + let h = YB(i.configure(a)); + return s && o.push(h.data.of({ autocomplete: oPe })), new mv(h, o); +} +function oPe(t) { let { state: e, pos: r } = t, n = /<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(r - 25, r)); if (!n) return null; @@ -26572,25 +26572,25 @@ function bPe(t) { return { from: r - n[0].length, to: r, - options: xPe(), + options: lPe(), validFor: /^<[:\-\.\w\u00b7-\uffff]*$/ }; } -let z8 = null; -function xPe() { - if (z8) - return z8; - let t = sPe(new i6(qr.create({ extensions: H9 }), 0, !0)); - return z8 = t ? t.options : []; +let P8 = null; +function lPe() { + if (P8) + return P8; + let t = GDe(new e6(qr.create({ extensions: Q9 }), 0, !0)); + return P8 = t ? t.options : []; } -function wPe(t) { +function cPe(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 oue = { exports: {} }; -const OPe = {}, kPe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ +var Kce = { exports: {} }; +const uPe = {}, hPe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, - default: OPe -}, Symbol.toStringTag, { value: "Module" })), SPe = /* @__PURE__ */ z_(kPe); + default: uPe +}, Symbol.toStringTag, { value: "Module" })), fPe = /* @__PURE__ */ I_(hPe); (function(t) { var e; (function() { @@ -26646,8 +26646,8 @@ const OPe = {}, kPe = /* @__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 wPe < "u") { - var o = SPe; + } else if (typeof cPe < "u") { + var o = fPe; try { if (o.existsSync(r)) return o.readFileSync(r, n); @@ -26689,8 +26689,8 @@ const OPe = {}, kPe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defin _parseDIC: function(r) { r = this._removeDicComments(r); var n = r.split(/\r?\n/), i = {}; - function s(M, N) { - i.hasOwnProperty(M) || (i[M] = null), N.length > 0 && (i[M] === null && (i[M] = []), i[M].push(N)); + function s(P, L) { + i.hasOwnProperty(P) || (i[P] = null), L.length > 0 && (i[P] === null && (i[P] = []), i[P].push(L)); } for (var a = 1, o = n.length; a < o; a++) { var l = n[a]; @@ -26708,9 +26708,9 @@ const OPe = {}, kPe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defin for (var O = d + 1; O < p; O++) { var S = f[O], C = this.rules[S]; if (C && C.combineable && m.type != C.type) - for (var T = this._applyRule(w, C), L = 0, E = T.length; L < E; L++) { - var P = T[L]; - s(P, []); + for (var T = this._applyRule(w, C), D = 0, E = T.length; D < E; D++) { + var N = T[D]; + s(N, []); } } } @@ -26841,16 +26841,16 @@ const OPe = {}, kPe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defin for (y = 0, w = C.length + 1; y < w; y++) { var T = [C.substring(0, y), C.substring(y)]; if (T[1] && (O = T[0] + T[1].substring(1), (!m || f.check(O)) && (O in v ? v[O] += 1 : v[O] = 1)), T[1].length > 1 && T[1][1] !== T[1][0] && (O = T[0] + T[1][1] + T[1][0] + T[1].substring(2), (!m || f.check(O)) && (O in v ? v[O] += 1 : v[O] = 1)), T[1]) { - var L = T[1].substring(0, 1).toUpperCase() === T[1].substring(0, 1) ? "uppercase" : "lowercase"; + var D = T[1].substring(0, 1).toUpperCase() === T[1].substring(0, 1) ? "uppercase" : "lowercase"; for (b = 0; b < S; b++) { var E = f.alphabet[b]; - L === "uppercase" && (E = E.toUpperCase()), E != T[1].substring(0, 1) && (O = T[0] + E + T[1].substring(1), (!m || f.check(O)) && (O in v ? v[O] += 1 : v[O] = 1)); + D === "uppercase" && (E = E.toUpperCase()), E != T[1].substring(0, 1) && (O = T[0] + E + T[1].substring(1), (!m || f.check(O)) && (O in v ? v[O] += 1 : v[O] = 1)); } } if (T[1]) for (b = 0; b < S; b++) { - var L = T[0].substring(-1).toUpperCase() === T[0].substring(-1) && T[1].substring(0, 1).toUpperCase() === T[1].substring(0, 1) ? "uppercase" : "lowercase", E = f.alphabet[b]; - L === "uppercase" && (E = E.toUpperCase()), O = T[0] + E + T[1], (!m || f.check(O)) && (O in v ? v[O] += 1 : v[O] = 1); + var D = T[0].substring(-1).toUpperCase() === T[0].substring(-1) && T[1].substring(0, 1).toUpperCase() === T[1].substring(0, 1) ? "uppercase" : "lowercase", E = f.alphabet[b]; + D === "uppercase" && (E = E.toUpperCase()), O = T[0] + E + T[1], (!m || f.check(O)) && (O in v ? v[O] += 1 : v[O] = 1); } } return v; @@ -26862,16 +26862,16 @@ const OPe = {}, kPe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defin var w, O = []; for (w in y) y.hasOwnProperty(w) && O.push([w, y[w]]); - function S(E, P) { - var M = E[1], N = P[1]; - return M < N ? -1 : M > N ? 1 : P[0].localeCompare(E[0]); + function S(E, N) { + var P = E[1], L = N[1]; + return P < L ? -1 : P > L ? 1 : N[0].localeCompare(E[0]); } O.sort(S).reverse(); var C = [], T = "lowercase"; g.toUpperCase() === g ? T = "uppercase" : g.substr(0, 1).toUpperCase() + g.substr(1).toLowerCase() === g && (T = "capitalized"); - var L = n; - for (w = 0; w < Math.min(L, O.length); w++) - T === "uppercase" ? O[w][0] = O[w][0].toUpperCase() : T === "capitalized" && (O[w][0] = O[w][0].substr(0, 1).toUpperCase() + O[w][0].substr(1)), !f.hasFlag(O[w][0], "NOSUGGEST") && C.indexOf(O[w][0]) == -1 ? C.push(O[w][0]) : L++; + var D = n; + for (w = 0; w < Math.min(D, O.length); w++) + T === "uppercase" ? O[w][0] = O[w][0].toUpperCase() : T === "capitalized" && (O[w][0] = O[w][0].substr(0, 1).toUpperCase() + O[w][0].substr(1)), !f.hasFlag(O[w][0], "NOSUGGEST") && C.indexOf(O[w][0]) == -1 ? C.push(O[w][0]) : D++; return C; } return this.memoized[r] = { @@ -26881,47 +26881,47 @@ const OPe = {}, kPe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defin } }; })(), t.exports = e; -})(oue); -const TPe = oue.exports, lue = Gt.define({ +})(Kce); +const dPe = Kce.exports, Jce = Gt.define({ combine: (t) => t[t.length - 1] -}), CPe = Ht.mark({ +}), pPe = Ht.mark({ class: "cm-error" -}), EPe = (t) => Object.keys(t.rules).length > 0; -function QG(t) { +}), gPe = (t) => Object.keys(t.rules).length > 0; +function RG(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 is(), i = t.state.facet(lue); - return EPe(i) && t.state.doc.sliceString(e, r).replaceAll(/\w+/g, (o, l) => !i.check(o) && n.add(e + l, e + l + o.length, CPe)), n.finish(); + const n = new rs(), i = t.state.facet(Jce); + return gPe(i) && t.state.doc.sliceString(e, r).replaceAll(/\w+/g, (o, l) => !i.check(o) && n.add(e + l, e + l + o.length, pPe)), n.finish(); } -const _Pe = fn.fromClass(class { +const mPe = fn.fromClass(class { constructor(t) { - this.decorations = QG(t); + this.decorations = RG(t); } update(t) { - (t.docChanged || t.viewportChanged) && (this.decorations = QG(t.view)); + (t.docChanged || t.viewportChanged) && (this.decorations = RG(t.view)); } }, { decorations: (t) => t.decorations }); -function APe(t) { +function vPe(t) { if (!t) return []; let { dict: e = "en_US", dictionaryPath: r = "/dictionaries" } = t; - return [lue.of(new TPe(e, null, null, { + return [Jce.of(new dPe(e, null, null, { dictionaryPath: r - })), _Pe]; + })), mPe]; } -const RPe = "cm-link", LPe = [{ +const yPe = "cm-link", bPe = [{ target: /`[^`\n]+`/g, cssClass: "cm-mono" }]; -function VG(t, e, r, n) { +function LG(t, e, r, n) { var u, h; let i = ((u = t.visibleRanges[0]) == null ? void 0 : u.from) || 0, s = ((h = t.visibleRanges[0]) == null ? void 0 : h.to) || void 0; - const a = new is(), o = t.state.doc.sliceString(i, s); + const a = new rs(), o = t.state.doc.sliceString(i, s); let l = 0; return e.filter((f) => !f.id || parseInt(n.get(f.id)) <= t.state.doc.lines).flatMap((f) => { const d = f.id ? t.state.doc.line(parseInt(n.get(f.id))).text : o, p = f.id ? t.state.doc.line(parseInt(n.get(f.id))).from : i; @@ -26943,7 +26943,7 @@ function VG(t, e, r, n) { match: d }) => { let p = { - class: RPe + class: yPe }; f.cssClass && (p.class = f.cssClass); let g; @@ -26957,89 +26957,89 @@ function VG(t, e, r, n) { })), f.remove || a.add(f.from + d.index, f.from + d.index + d[0].length, Ht.mark(p)), g == null || g(); }), a.finish(); } -const sF = (t, e, r) => { +const GB = (t, e, r) => { t || (t = []); - const n = t.concat(LPe); + const n = t.concat(bPe); return fn.fromClass(class { constructor(i) { - this.decorations = VG(i, n, e, r); + this.decorations = LG(i, n, e, r); } update(i) { - (i.docChanged || i.viewportChanged) && (this.decorations = VG(i.view, n, e, r)); + (i.docChanged || i.viewportChanged) && (this.decorations = LG(i.view, n, e, r)); } }, { decorations: (i) => i.decorations }); -}, cue = /* @__PURE__ */ new Map(); -class MPe { +}, eue = /* @__PURE__ */ new Map(); +class xPe { constructor(e) { - this.room = e, this.onmessage = null, this._onChange = (r) => r.key === e && this.onmessage !== null && this.onmessage({ data: SRe(r.newValue || "") }), rRe(this._onChange); + this.room = e, this.onmessage = null, this._onChange = (r) => r.key === e && this.onmessage !== null && this.onmessage({ data: fRe(r.newValue || "") }), V8e(this._onChange); } postMessage(e) { - sle.setItem(this.room, kRe(yRe(e))); + joe.setItem(this.room, hRe(aRe(e))); } close() { - nRe(this._onChange); + W8e(this._onChange); } } -const DPe = typeof BroadcastChannel > "u" ? MPe : BroadcastChannel, aF = (t) => Zf(cue, t, () => { - const e = xg(), r = new DPe(t); +const wPe = typeof BroadcastChannel > "u" ? xPe : BroadcastChannel, HB = (t) => Xf(eue, t, () => { + const e = mg(), r = new wPe(t); return r.onmessage = (n) => e.forEach((i) => i(n.data, "broadcastchannel")), { bc: r, subs: e }; -}), PPe = (t, e) => (aF(t).subs.add(e), e), NPe = (t, e) => { - const r = aF(t), n = r.subs.delete(e); - return n && r.subs.size === 0 && (r.bc.close(), cue.delete(t)), n; -}, o1 = (t, e, r = null) => { - const n = aF(t); +}), OPe = (t, e) => (HB(t).subs.add(e), e), kPe = (t, e) => { + const r = HB(t), n = r.subs.delete(e); + return n && r.subs.size === 0 && (r.bc.close(), eue.delete(t)), n; +}, i1 = (t, e, r = null) => { + const n = HB(t); n.bc.postMessage(e), n.subs.forEach((i) => i(e, r)); -}, uue = 0, oF = 1, hue = 2, X9 = (t, e) => { - Cr(t, uue); - const r = oLe(e); - Pi(t, r); -}, fue = (t, e, r) => { - Cr(t, oF), Pi(t, nLe(e, r)); -}, IPe = (t, e, r) => fue(e, r, La(t)), due = (t, e, r) => { +}, tue = 0, XB = 1, rue = 2, V9 = (t, e) => { + Cr(t, tue); + const r = XRe(e); + Di(t, r); +}, nue = (t, e, r) => { + Cr(t, XB), Di(t, WRe(e, r)); +}, SPe = (t, e, r) => nue(e, r, Aa(t)), iue = (t, e, r) => { try { - eLe(e, La(t), r); + URe(e, Aa(t), r); } catch (n) { console.error("Caught error while handling a Yjs update", n); } -}, $Pe = (t, e) => { - Cr(t, hue), Pi(t, e); -}, BPe = due, FPe = (t, e, r, n) => { +}, TPe = (t, e) => { + Cr(t, rue), Di(t, e); +}, CPe = iue, EPe = (t, e, r, n) => { const i = zr(t); switch (i) { - case uue: - IPe(t, e, r); + case tue: + SPe(t, e, r); break; - case oF: - due(t, r, n); + case XB: + iue(t, r, n); break; - case hue: - BPe(t, r, n); + case rue: + CPe(t, r, n); break; default: throw new Error("Unknown message type"); } return i; -}, zPe = 0, qPe = (t, e, r) => { +}, _Pe = 0, APe = (t, e, r) => { switch (zr(t)) { - case zPe: - r(e, Yd(t)); + case _Pe: + r(e, Qd(t)); } -}, q8 = 3e4; -class pue extends s6 { +}, N8 = 3e4; +class sue extends t6 { 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 = bp(); - this.getLocalState() !== null && q8 / 2 <= r - this.meta.get(this.clientID).lastUpdated && this.setLocalState(this.getLocalState()); + const r = pp(); + this.getLocalState() !== null && N8 / 2 <= r - this.meta.get(this.clientID).lastUpdated && this.setLocalState(this.getLocalState()); const n = []; this.meta.forEach((i, s) => { - s !== this.clientID && q8 <= r - i.lastUpdated && this.states.has(s) && n.push(s); - }), n.length > 0 && lF(this, n, "timeout"); - }, Rf(q8 / 10)), e.on("destroy", () => { + s !== this.clientID && N8 <= r - i.lastUpdated && this.states.has(s) && n.push(s); + }), n.length > 0 && jB(this, n, "timeout"); + }, _f(N8 / 10)), e.on("destroy", () => { this.destroy(); }), this.setLocalState({}); } @@ -27053,10 +27053,10 @@ class pue extends s6 { 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: bp() + lastUpdated: pp() }); const a = [], o = [], l = [], u = []; - e === null ? u.push(r) : s == null ? e != null && a.push(r) : (o.push(r), hx(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), cx(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(); @@ -27069,7 +27069,7 @@ class pue extends s6 { return this.states; } } -const lF = (t, e, r) => { +const jB = (t, e, r) => { const n = []; for (let i = 0; i < e.length; i++) { const s = e[i]; @@ -27078,31 +27078,31 @@ const lF = (t, e, r) => { const a = t.meta.get(s); t.meta.set(s, { clock: a.clock + 1, - lastUpdated: bp() + lastUpdated: pp() }); } n.push(s); } } n.length > 0 && (t.emit("change", [{ added: [], updated: [], removed: n }, r]), t.emit("update", [{ added: [], updated: [], removed: n }, r])); -}, px = (t, e, r = t.states) => { - const n = e.length, i = Ma(); +}, fx = (t, e, r = t.states) => { + const n = e.length, i = Ra(); Cr(i, n); for (let s = 0; s < n; s++) { const a = e[s], o = r.get(a) || null, l = t.meta.get(a).clock; - Cr(i, a), Cr(i, l), ig(i, JSON.stringify(o)); + Cr(i, a), Cr(i, l), eg(i, JSON.stringify(o)); } return fi(i); -}, UPe = (t, e, r) => { - const n = Gp(e), i = bp(), s = [], a = [], o = [], l = [], u = zr(n); +}, RPe = (t, e, r) => { + const n = qp(e), i = pp(), s = [], a = [], o = [], l = [], u = zr(n); for (let h = 0; h < u; h++) { const f = zr(n); let d = zr(n); - const p = JSON.parse(Yd(n)), g = t.meta.get(f), m = t.states.get(f), v = g === void 0 ? 0 : g.clock; + const p = JSON.parse(Qd(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 && (hx(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 && (cx(p, m) || o.push(f), a.push(f))); } (s.length > 0 || o.length > 0 || l.length > 0) && t.emit("change", [{ added: s, @@ -27113,55 +27113,55 @@ const lF = (t, e, r) => { updated: a, removed: l }, r]); -}, QPe = (t) => oRe(t, (e, r) => `${encodeURIComponent(r)}=${encodeURIComponent(e)}`).join("&"), Q0 = 0, gue = 3, q1 = 1, VPe = 2, Mk = []; -Mk[Q0] = (t, e, r, n, i) => { - Cr(t, Q0); - const s = FPe( +}, LPe = (t) => X8e(t, (e, r) => `${encodeURIComponent(r)}=${encodeURIComponent(e)}`).join("&"), F0 = 0, aue = 3, $1 = 1, MPe = 2, Ak = []; +Ak[F0] = (t, e, r, n, i) => { + Cr(t, F0); + const s = EPe( e, t, r.doc, r ); - n && s === oF && !r.synced && (r.synced = !0); + n && s === XB && !r.synced && (r.synced = !0); }; -Mk[gue] = (t, e, r, n, i) => { - Cr(t, q1), Pi( +Ak[aue] = (t, e, r, n, i) => { + Cr(t, $1), Di( t, - px( + fx( r.awareness, Array.from(r.awareness.getStates().keys()) ) ); }; -Mk[q1] = (t, e, r, n, i) => { - UPe( +Ak[$1] = (t, e, r, n, i) => { + RPe( r.awareness, - La(e), + Aa(e), r ); }; -Mk[VPe] = (t, e, r, n, i) => { - qPe( +Ak[MPe] = (t, e, r, n, i) => { + APe( e, r.doc, - (s, a) => WPe(r, a) + (s, a) => DPe(r, a) ); }; -const WG = 3e4, WPe = (t, e) => console.warn(`Permission denied to access ${t.url}. -${e}`), mue = (t, e, r) => { - const n = Gp(e), i = Ma(), s = zr(n), a = t.messageHandlers[s]; +const MG = 3e4, DPe = (t, e) => console.warn(`Permission denied to access ${t.url}. +${e}`), oue = (t, e, r) => { + const n = qp(e), i = Ra(), s = zr(n), a = t.messageHandlers[s]; return a ? a(i, n, t, r, s) : console.error("Unable to compute message"), i; -}, vue = (t) => { +}, lue = (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 = bp(); - const n = mue(t, new Uint8Array(r.data), !0); - _B(n) > 1 && e.send(fi(n)); + t.wsLastMessageReceived = pp(); + const n = oue(t, new Uint8Array(r.data), !0); + mB(n) > 1 && e.send(fi(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, lF( + t.emit("connection-close", [r, t]), t.ws = null, t.wsconnecting = !1, t.wsconnected ? (t.wsconnected = !1, t.synced = !1, jB( t.awareness, Array.from(t.awareness.getStates().keys()).filter( (n) => n !== t.doc.clientID @@ -27170,23 +27170,23 @@ ${e}`), mue = (t, e, r) => { ), t.emit("status", [{ status: "disconnected" }])) : t.wsUnsuccessfulReconnects++, setTimeout( - vue, - a6( - g8e(2, t.wsUnsuccessfulReconnects) * 100, + lue, + r6( + n8e(2, t.wsUnsuccessfulReconnects) * 100, t.maxBackoffTime ), t ); }, e.onopen = () => { - t.wsLastMessageReceived = bp(), t.wsconnecting = !1, t.wsconnected = !0, t.wsUnsuccessfulReconnects = 0, t.emit("status", [{ + t.wsLastMessageReceived = pp(), t.wsconnecting = !1, t.wsconnected = !0, t.wsUnsuccessfulReconnects = 0, t.emit("status", [{ status: "connected" }]); - const r = Ma(); - if (Cr(r, Q0), X9(r, t.doc), e.send(fi(r)), t.awareness.getLocalState() !== null) { - const n = Ma(); - Cr(n, q1), Pi( + const r = Ra(); + if (Cr(r, F0), V9(r, t.doc), e.send(fi(r)), t.awareness.getLocalState() !== null) { + const n = Ra(); + Cr(n, $1), Di( n, - px(t.awareness, [ + fx(t.awareness, [ t.doc.clientID ]) ), e.send(fi(n)); @@ -27195,14 +27195,14 @@ ${e}`), mue = (t, e, r) => { status: "connecting" }]); } -}, U8 = (t, e) => { +}, I8 = (t, e) => { const r = t.ws; - t.wsconnected && r && r.readyState === r.OPEN && r.send(e), t.bcconnected && o1(t.bcChannel, e, t); + t.wsconnected && r && r.readyState === r.OPEN && r.send(e), t.bcconnected && i1(t.bcChannel, e, t); }; -class yue extends s6 { +class cue extends t6 { constructor(e, r, n, { connect: i = !0, - awareness: s = new pue(n), + awareness: s = new sue(n), params: a = {}, WebSocketPolyfill: o = WebSocket, resyncInterval: l = -1, @@ -27211,37 +27211,37 @@ class yue extends s6 { } = {}) { for (super(); e[e.length - 1] === "/"; ) e = e.slice(0, e.length - 1); - const f = QPe(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 = Mk.slice(), this._synced = !1, this.ws = null, this.wsLastMessageReceived = 0, this.shouldConnect = i, this._resyncInterval = 0, l > 0 && (this._resyncInterval = setInterval(() => { + const f = LPe(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 = Ak.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 = Ma(); - Cr(d, Q0), X9(d, n), this.ws.send(fi(d)); + const d = Ra(); + Cr(d, F0), V9(d, n), this.ws.send(fi(d)); } }, l)), this._bcSubscriber = (d, p) => { if (p !== this) { - const g = mue(this, new Uint8Array(d), !1); - _B(g) > 1 && o1(this.bcChannel, fi(g), this); + const g = oue(this, new Uint8Array(d), !1); + mB(g) > 1 && i1(this.bcChannel, fi(g), this); } }, this._updateHandler = (d, p) => { if (p !== this) { - const g = Ma(); - Cr(g, Q0), $Pe(g, d), U8(this, fi(g)); + const g = Ra(); + Cr(g, F0), TPe(g, d), I8(this, fi(g)); } }, this.doc.on("update", this._updateHandler), this._awarenessUpdateHandler = ({ added: d, updated: p, removed: g }, m) => { - const v = d.concat(p).concat(g), y = Ma(); - Cr(y, q1), Pi( + const v = d.concat(p).concat(g), y = Ra(); + Cr(y, $1), Di( y, - px(s, v) - ), U8(this, fi(y)); + fx(s, v) + ), I8(this, fi(y)); }, this._unloadHandler = () => { - lF( + jB( this.awareness, [n.clientID], "window unload" ); - }, typeof window < "u" ? window.addEventListener("unload", this._unloadHandler) : typeof $s < "u" && $s.on("exit", this._unloadHandler), s.on("update", this._awarenessUpdateHandler), this._checkInterval = setInterval(() => { - this.wsconnected && WG < bp() - this.wsLastMessageReceived && this.ws.close(); - }, WG / 10), i && this.connect(); + }, typeof window < "u" ? window.addEventListener("unload", this._unloadHandler) : typeof Ns < "u" && Ns.on("exit", this._unloadHandler), s.on("update", this._awarenessUpdateHandler), this._checkInterval = setInterval(() => { + this.wsconnected && MG < pp() - this.wsLastMessageReceived && this.ws.close(); + }, MG / 10), i && this.connect(); } get synced() { return this._synced; @@ -27250,54 +27250,54 @@ class yue extends s6 { this._synced !== e && (this._synced = e, this.emit("synced", [e]), this.emit("sync", [e])); } destroy() { - this._resyncInterval !== 0 && clearInterval(this._resyncInterval), clearInterval(this._checkInterval), this.disconnect(), typeof window < "u" ? window.removeEventListener("unload", this._unloadHandler) : typeof $s < "u" && $s.off("exit", this._unloadHandler), this.awareness.off("update", this._awarenessUpdateHandler), this.doc.off("update", this._updateHandler), super.destroy(); + this._resyncInterval !== 0 && clearInterval(this._resyncInterval), clearInterval(this._checkInterval), this.disconnect(), typeof window < "u" ? window.removeEventListener("unload", this._unloadHandler) : typeof Ns < "u" && Ns.off("exit", this._unloadHandler), this.awareness.off("update", this._awarenessUpdateHandler), this.doc.off("update", this._updateHandler), super.destroy(); } connectBc() { if (this.disableBc) return; - this.bcconnected || (PPe(this.bcChannel, this._bcSubscriber), this.bcconnected = !0); - const e = Ma(); - Cr(e, Q0), X9(e, this.doc), o1(this.bcChannel, fi(e), this); - const r = Ma(); - Cr(r, Q0), fue(r, this.doc), o1(this.bcChannel, fi(r), this); - const n = Ma(); - Cr(n, gue), o1( + this.bcconnected || (OPe(this.bcChannel, this._bcSubscriber), this.bcconnected = !0); + const e = Ra(); + Cr(e, F0), V9(e, this.doc), i1(this.bcChannel, fi(e), this); + const r = Ra(); + Cr(r, F0), nue(r, this.doc), i1(this.bcChannel, fi(r), this); + const n = Ra(); + Cr(n, aue), i1( this.bcChannel, fi(n), this ); - const i = Ma(); - Cr(i, q1), Pi( + const i = Ra(); + Cr(i, $1), Di( i, - px(this.awareness, [ + fx(this.awareness, [ this.doc.clientID ]) - ), o1( + ), i1( this.bcChannel, fi(i), this ); } disconnectBc() { - const e = Ma(); - Cr(e, q1), Pi( + const e = Ra(); + Cr(e, $1), Di( e, - px(this.awareness, [ + fx(this.awareness, [ this.doc.clientID ], /* @__PURE__ */ new Map()) - ), U8(this, fi(e)), this.bcconnected && (NPe(this.bcChannel, this._bcSubscriber), this.bcconnected = !1); + ), I8(this, fi(e)), this.bcconnected && (kPe(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 && (vue(this), this.connectBc()); + this.shouldConnect = !0, !this.wsconnected && this.ws === null && (lue(this), this.connectBc()); } } -const YPe = (t) => ["input", "delete", "undo", "redo"].some((e) => t.isUserEvent(e)), mw = Gt.define({ +const PPe = (t) => ["input", "delete", "undo", "redo"].some((e) => t.isUserEvent(e)), pw = Gt.define({ combine: (t) => t[t.length - 1], static: !0 -}), bue = _r.define(), GPe = fn.fromClass(class { +}), uue = _r.define(), NPe = fn.fromClass(class { constructor(t) { this.decorations = this.colorEditorLines(t); } @@ -27315,7 +27315,7 @@ const YPe = (t) => ["input", "delete", "undo", "redo"].some((e) => t.isUserEvent }); } colorEditorLines(t) { - const e = t.state.facet(mw), r = new is(); + const e = t.state.facet(pw), r = new rs(); 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)); @@ -27323,7 +27323,7 @@ const YPe = (t) => ["input", "delete", "undo", "redo"].some((e) => t.isUserEvent return r.finish(); } markLinesEditedInTransaction(t) { - const e = t.state.facet(mw); + const e = t.state.facet(pw); 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) { @@ -27334,29 +27334,29 @@ const YPe = (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(bue)))) && (t.transactions.filter(YPe).forEach((e) => this.markLinesEditedInTransaction(e)), this.decorations = this.colorEditorLines(t.view)), t.view.dom.onmouseleave = () => t.view.dispatch({ - effects: j9.of(null) + (t.docChanged || t.viewportChanged || t.transactions.some((e) => e.effects.some((r) => r.is(uue)))) && (t.transactions.filter(PPe).forEach((e) => this.markLinesEditedInTransaction(e)), this.decorations = this.colorEditorLines(t.view)), t.view.dom.onmouseleave = () => t.view.dispatch({ + effects: W9.of(null) }), t.view.dom.querySelectorAll(".cm-line").forEach((e) => { e.onmouseenter = (r) => t.view.dispatch({ - effects: j9.of(parseInt(r.target.dataset.lineNumber)) + effects: W9.of(parseInt(r.target.dataset.lineNumber)) }); }); } }, { decorations: (t) => t.decorations -}), j9 = _r.define(), XT = ai.define({ +}), W9 = _r.define(), GT = ai.define({ create() { return null; }, update(t, e) { var i; - const r = e.state.facet(mw), n = (i = e.effects.find((s) => s.is(j9))) == null ? void 0 : i.value; + const r = e.state.facet(pw), n = (i = e.effects.find((s) => s.is(W9))) == null ? void 0 : i.value; return n ? r.firstLineOfSection(n) : null; } }); -class YG extends pc { +class DG extends hc { constructor(e, r) { - super(), r && e && (this.lineNumber = r.state.doc.lineAt(e.to).number, this.lineAuthors = r.state.facet(mw), this.selectedLine = r.state.facet(XT)); + super(), r && e && (this.lineNumber = r.state.doc.lineAt(e.to).number, this.lineAuthors = r.state.facet(pw), this.selectedLine = r.state.facet(GT)); } authorAvatar() { const { @@ -27369,11 +27369,11 @@ class YG extends pc { return this.selectedLine && this.selectedLine == this.lineNumber ? this.authorAvatar() : document.createElement("div"); } } -const HPe = Z_({ - lineMarker: (t, e) => new YG(e, t), - lineMarkerChange: (t) => t.startState.field(XT) != t.state.field(XT), - initialSpacer: () => new YG(null, null) -}), XPe = (t) => [mw.of(t), XT.init(null), HPe, GPe], lm = mr.button` +const IPe = G_({ + lineMarker: (t, e) => new DG(e, t), + lineMarkerChange: (t) => t.startState.field(GT) != t.state.field(GT), + initialSpacer: () => new DG(null, null) +}), $Pe = (t) => [pw.of(t), GT.init(null), IPe, NPe], im = gr.button` &:focus { outline: 0 !important; } @@ -27404,11 +27404,11 @@ const HPe = Z_({ } `; _r.define(); -const xue = new jf(); -function jPe(t) { +const hue = new Hf(); +function BPe(t) { return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); } -function ZPe({ +function FPe({ commentId: t, text: e, color: r @@ -27425,7 +27425,7 @@ function ZPe({ l.length === 0 ? o = !0 : a = l, s = s.slice(0, s.indexOf("->")).trimEnd(); } s.length !== 0 && n.push({ - targetRegexSrc: `(?<=^|[ \\t\\r\\.]|\\W)${jPe(s)}(?=$|[\\s\\.]|\\W)`, + targetRegexSrc: `(?<=^|[ \\t\\r\\.]|\\W)${BPe(s)}(?=$|[\\s\\.]|\\W)`, targetRegexFlags: "gm", id: t, cssClass: "cm-suggestion", @@ -27436,7 +27436,7 @@ function ZPe({ } return n; } -function KPe({ +function zPe({ builder: t, from: e, match: r, @@ -27449,7 +27449,7 @@ function KPe({ }), n.remove) return () => { t.add(e + r.index, e + r.index + r[0].length, Ht.replace({ - widget: new GG({ + widget: new PG({ text: s.state.doc.toString().slice(e + r.index, e + r.index + r[0].length), color: n.color, from: e + r.index, @@ -27462,7 +27462,7 @@ function KPe({ if (n.replacement) return i.class += " replaced", () => { t.add(e + r.index + r[0].length, e + r.index + r[0].length, Ht.widget({ - widget: new GG({ + widget: new PG({ text: n.replacement, color: n.color, from: e + r.index, @@ -27472,7 +27472,7 @@ function KPe({ })); }; } -class GG extends nl { +class PG extends el { constructor({ text: e, color: r, @@ -27496,7 +27496,7 @@ class GG extends nl { }), e; } } -function JPe(t, e, r) { +function qPe(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.view.hasFocus || s || a) { n.style.display = "none"; @@ -27523,19 +27523,19 @@ function JPe(t, e, r) { ` + w : O = e.newComment(g.number), e.ydoc.transact(() => { const T = e.getTextForComment(O); T.insert(T.length, w); - const L = e.lineAuthors(O); - L.mark(L.lineAuthors.length); + const D = e.lineAuthors(O); + D.mark(D.lineAuthors.length); }, e.provider.awareness.clientID), e.display().updateComment(O, { isShown: !0 }), e.updateMainCodeMirror(); const S = await e.getEditorForComment(O); S.focus(), S.dispatch({ selection: ft.create([ft.range(S.state.doc.length - 1, S.state.doc.length - 1)]), - effects: bue.of(null) + effects: uue.of(null) }); }; } -const eNe = mr(lm)` +const UPe = gr(im)` position: absolute; z-index: 10; display: none; @@ -27574,16 +27574,16 @@ const eNe = mr(lm)` border-top: 10px solid var(--icon-border); } `; -var tNe = Symbol.for("preact-signals"); -function v6() { - if (Gd > 1) - Gd--; +var QPe = Symbol.for("preact-signals"); +function d6() { + if (Vd > 1) + Vd--; else { - for (var t, e = !1; gx !== void 0; ) { - var r = gx; - for (gx = void 0, Z9++; r !== void 0; ) { + for (var t, e = !1; dx !== void 0; ) { + var r = dx; + for (dx = void 0, Y9++; r !== void 0; ) { var n = r.o; - if (r.o = void 0, r.f &= -3, !(8 & r.f) && Oue(r)) + if (r.o = void 0, r.f &= -3, !(8 & r.f) && due(r)) try { r.c(); } catch (i) { @@ -27592,22 +27592,22 @@ function v6() { r = n; } } - if (Z9 = 0, Gd--, e) + if (Y9 = 0, Vd--, e) throw t; } } -function l1(t) { - if (Gd > 0) +function s1(t) { + if (Vd > 0) return t(); - Gd++; + Vd++; try { return t(); } finally { - v6(); + d6(); } } -var In = void 0, gx = void 0, Gd = 0, Z9 = 0, jT = 0; -function wue(t) { +var In = void 0, dx = void 0, Vd = 0, Y9 = 0, HT = 0; +function fue(t) { if (In !== void 0) { var e = t.n; if (e === void 0 || e.t !== In) @@ -27616,25 +27616,25 @@ function wue(t) { return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p = In.s, e.n = void 0, In.s.n = e, In.s = e), e; } } -function ma(t) { +function ga(t) { this.v = t, this.i = 0, this.n = void 0, this.t = void 0; } -ma.prototype.brand = tNe; -ma.prototype.h = function() { +ga.prototype.brand = QPe; +ga.prototype.h = function() { return !0; }; -ma.prototype.S = function(t) { +ga.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); }; -ma.prototype.U = function(t) { +ga.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); } }; -ma.prototype.subscribe = function(t) { +ga.prototype.subscribe = function(t) { var e = this; - return Pk(function() { + return Lk(function() { var r = e.value, n = In; In = void 0; try { @@ -27644,16 +27644,16 @@ ma.prototype.subscribe = function(t) { } }); }; -ma.prototype.valueOf = function() { +ga.prototype.valueOf = function() { return this.value; }; -ma.prototype.toString = function() { +ga.prototype.toString = function() { return this.value + ""; }; -ma.prototype.toJSON = function() { +ga.prototype.toJSON = function() { return this.value; }; -ma.prototype.peek = function() { +ga.prototype.peek = function() { var t = In; In = void 0; try { @@ -27662,32 +27662,32 @@ ma.prototype.peek = function() { In = t; } }; -Object.defineProperty(ma.prototype, "value", { get: function() { - var t = wue(this); +Object.defineProperty(ga.prototype, "value", { get: function() { + var t = fue(this); return t !== void 0 && (t.i = this.i), this.v; }, set: function(t) { if (t !== this.v) { - if (Z9 > 100) + if (Y9 > 100) throw new Error("Cycle detected"); - this.v = t, this.i++, jT++, Gd++; + this.v = t, this.i++, HT++, Vd++; try { for (var e = this.t; e !== void 0; e = e.x) e.t.N(); } finally { - v6(); + d6(); } } } }); -function Uo(t) { - return new ma(t); +function Fo(t) { + return new ga(t); } -function Oue(t) { +function due(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 kue(t) { +function pue(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) { @@ -27696,95 +27696,95 @@ function kue(t) { } } } -function Sue(t) { +function gue(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 Wy(t) { - ma.call(this, void 0), this.x = t, this.s = void 0, this.g = jT - 1, this.f = 4; +function zy(t) { + ga.call(this, void 0), this.x = t, this.s = void 0, this.g = HT - 1, this.f = 4; } -(Wy.prototype = new ma()).h = function() { +(zy.prototype = new ga()).h = function() { if (this.f &= -3, 1 & this.f) return !1; - if ((36 & this.f) == 32 || (this.f &= -5, this.g === jT)) + if ((36 & this.f) == 32 || (this.f &= -5, this.g === HT)) return !0; - if (this.g = jT, this.f |= 1, this.i > 0 && !Oue(this)) + if (this.g = HT, this.f |= 1, this.i > 0 && !due(this)) return this.f &= -2, !0; var t = In; try { - kue(this), In = this; + pue(this), In = 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 In = t, Sue(this), this.f &= -2, !0; + return In = t, gue(this), this.f &= -2, !0; }; -Wy.prototype.S = function(t) { +zy.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); } - ma.prototype.S.call(this, t); + ga.prototype.S.call(this, t); }; -Wy.prototype.U = function(t) { - if (this.t !== void 0 && (ma.prototype.U.call(this, t), this.t === void 0)) { +zy.prototype.U = function(t) { + if (this.t !== void 0 && (ga.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); } }; -Wy.prototype.N = function() { +zy.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(Wy.prototype, "value", { get: function() { +Object.defineProperty(zy.prototype, "value", { get: function() { if (1 & this.f) throw new Error("Cycle detected"); - var t = wue(this); + var t = fue(this); if (this.h(), t !== void 0 && (t.i = this.i), 16 & this.f) throw this.v; return this.v; } }); -function y6(t) { - return new Wy(t); +function p6(t) { + return new zy(t); } -function Tue(t) { +function mue(t) { var e = t.u; if (t.u = void 0, typeof e == "function") { - Gd++; + Vd++; var r = In; In = void 0; try { e(); } catch (n) { - throw t.f &= -2, t.f |= 8, cF(t), n; + throw t.f &= -2, t.f |= 8, ZB(t), n; } finally { - In = r, v6(); + In = r, d6(); } } } -function cF(t) { +function ZB(t) { for (var e = t.s; e !== void 0; e = e.n) e.S.U(e); - t.x = void 0, t.s = void 0, Tue(t); + t.x = void 0, t.s = void 0, mue(t); } -function rNe(t) { +function VPe(t) { if (In !== this) throw new Error("Out-of-order effect"); - Sue(this), In = t, this.f &= -2, 8 & this.f && cF(this), v6(); + gue(this), In = t, this.f &= -2, 8 & this.f && ZB(this), d6(); } -function Dk(t) { +function Rk(t) { this.x = t, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32; } -Dk.prototype.c = function() { +Rk.prototype.c = function() { var t = this.S(); try { if (8 & this.f || this.x === void 0) @@ -27795,21 +27795,21 @@ Dk.prototype.c = function() { t(); } }; -Dk.prototype.S = function() { +Rk.prototype.S = function() { if (1 & this.f) throw new Error("Cycle detected"); - this.f |= 1, this.f &= -9, Tue(this), kue(this), Gd++; + this.f |= 1, this.f &= -9, mue(this), pue(this), Vd++; var t = In; - return In = this, rNe.bind(this, t); + return In = this, VPe.bind(this, t); }; -Dk.prototype.N = function() { - 2 & this.f || (this.f |= 2, this.o = gx, gx = this); +Rk.prototype.N = function() { + 2 & this.f || (this.f |= 2, this.o = dx, dx = this); }; -Dk.prototype.d = function() { - this.f |= 8, 1 & this.f || cF(this); +Rk.prototype.d = function() { + this.f |= 8, 1 & this.f || ZB(this); }; -function Pk(t) { - var e = new Dk(t); +function Lk(t) { + var e = new Rk(t); try { e.c(); } catch (r) { @@ -27817,18 +27817,18 @@ function Pk(t) { } return e.d.bind(e); } -var b6, Q8; -function Yy(t, e) { +var g6, $8; +function qy(t, e) { cr[t] = e.bind(null, cr[t] || function() { }); } -function ZT(t) { - Q8 && Q8(), Q8 = t && t.S(); +function XT(t) { + $8 && $8(), $8 = t && t.S(); } -function Cue(t) { - var e = this, r = t.data, n = Ni(r); +function vue(t) { + var e = this, r = t.data, n = Pi(r); n.value = r; - var i = Fs(function() { + var i = $s(function() { for (var s = e.__v; s = s.__; ) if (s.__c) { s.__c.__$f |= 4; @@ -27836,46 +27836,46 @@ function Cue(t) { } return e.__$u.c = function() { var a; - !sie(i.peek()) && ((a = e.base) == null ? void 0 : a.nodeType) === 3 ? e.base.data = i.peek() : (e.__$f |= 1, e.setState({})); - }, y6(function() { + !jne(i.peek()) && ((a = e.base) == null ? void 0 : a.nodeType) === 3 ? e.base.data = i.peek() : (e.__$f |= 1, e.setState({})); + }, p6(function() { var a = n.value.value; return a === 0 ? 0 : a === !0 ? "" : a || ""; }); }, []); return i.value; } -Cue.displayName = "_st"; -Object.defineProperties(ma.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: Cue }, props: { configurable: !0, get: function() { +vue.displayName = "_st"; +Object.defineProperties(ga.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: vue }, props: { configurable: !0, get: function() { return { data: this }; } }, __b: { configurable: !0, value: 1 } }); -Yy("__b", function(t, e) { +qy("__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 ma && (r || (e.__np = r = {}), r[i] = s, n[i] = s.peek()); + s instanceof ga && (r || (e.__np = r = {}), r[i] = s, n[i] = s.peek()); } } t(e); }); -Yy("__r", function(t, e) { - ZT(); +qy("__r", function(t, e) { + XT(); var r, n = e.__c; n && (n.__$f &= -2, (r = n.__$u) === void 0 && (n.__$u = r = function(i) { var s; - return Pk(function() { + return Lk(function() { s = this; }), s.c = function() { n.__$f |= 1, n.setState({}); }, s; - }())), b6 = n, ZT(r), t(e); + }())), g6 = n, XT(r), t(e); }); -Yy("__e", function(t, e, r, n) { - ZT(), b6 = void 0, t(e, r, n); +qy("__e", function(t, e, r, n) { + XT(), g6 = void 0, t(e, r, n); }); -Yy("diffed", function(t, e) { - ZT(), b6 = void 0; +qy("diffed", function(t, e) { + XT(), g6 = void 0; var r; if (typeof e.type == "string" && (r = e.__e)) { var n = e.__np, i = e.props; @@ -27890,22 +27890,22 @@ Yy("diffed", function(t, e) { r.U = s = {}; for (var l in n) { var u = s[l], h = n[l]; - u === void 0 ? (u = nNe(r, l, h, i), s[l] = u) : u.o(h, i); + u === void 0 ? (u = WPe(r, l, h, i), s[l] = u) : u.o(h, i); } } } t(e); }); -function nNe(t, e, r, n) { - var i = e in t && t.ownerSVGElement === void 0, s = Uo(r); +function WPe(t, e, r, n) { + var i = e in t && t.ownerSVGElement === void 0, s = Fo(r); return { o: function(a, o) { s.value = a, n = o; - }, d: Pk(function() { + }, d: Lk(function() { var a = s.value.value; n[e] !== a && (n[e] = a, i ? t[e] = a : a ? t.setAttribute(e, a) : t.removeAttribute(e)); }) }; } -Yy("unmount", function(t, e) { +qy("unmount", function(t, e) { if (typeof e.type == "string") { var r = e.__e; if (r) { @@ -27927,10 +27927,10 @@ Yy("unmount", function(t, e) { } t(e); }); -Yy("__h", function(t, e, r, n) { +qy("__h", function(t, e, r, n) { (n < 3 || n === 9) && (e.__$f |= 2), t(e, r, n); }); -Hc.prototype.shouldComponentUpdate = function(t, e) { +Wc.prototype.shouldComponentUpdate = function(t, e) { var r = this.__$u; if (!(r && r.s !== void 0 || 4 & this.__$f) || 3 & this.__$f) return !0; @@ -27944,34 +27944,34 @@ Hc.prototype.shouldComponentUpdate = function(t, e) { return !0; return !1; }; -function Ni(t) { - return Fs(function() { - return Uo(t); +function Pi(t) { + return $s(function() { + return Fo(t); }, []); } -function sg(t) { - var e = ns(t); - return e.current = t, b6.__$f |= 4, Fs(function() { - return y6(function() { +function tg(t) { + var e = ts(t); + return e.current = t, g6.__$f |= 4, $s(function() { + return p6(function() { return e.current(); }); }, []); } -function Wc(t) { - var e = ns(t); - e.current = t, ts(function() { - return Pk(function() { +function Uc(t) { + var e = ts(t); + e.current = t, Ji(function() { + return Lk(function() { return e.current(); }); }, []); } -const HG = Oo.define(), Eue = Oo.define(), _ue = Oo.define(); -class iNe { +const NG = bo.define(), yue = bo.define(), bue = bo.define(); +class YPe { constructor(e) { - this.view = e, this.conf = e.state.facet(Lk), this._observer = (r, n) => { + this.view = e, this.conf = e.state.facet(_k), this._observer = (r, n) => { if (n.origin !== this.conf) { - const i = [HG.of(this.conf)]; - n.local ? i.push(_ue.of(!0)) : i.push(Eue.of(!0)); + const i = [NG.of(this.conf)]; + n.local ? i.push(bue.of(!0)) : i.push(yue.of(!0)); const s = r.delta, a = []; let o = 0; for (let l = 0; l < s.length; l++) { @@ -27994,7 +27994,7 @@ class iNe { }, this._ytext = this.conf.ytext, this._ytext.observe(this._observer); } update(e) { - if (!e.docChanged || e.transactions.length > 0 && e.transactions[0].annotation(HG) === this.conf) + if (!e.docChanged || e.transactions.length > 0 && e.transactions[0].annotation(NG) === this.conf) return; const r = this.conf.ytext; r.doc.transact(() => { @@ -28010,8 +28010,8 @@ class iNe { this._ytext.unobserve(this._observer); } } -const sNe = fn.fromClass(iNe), aNe = () => "comment-" + Math.random().toString().replace(".", ""); -class oNe { +const GPe = fn.fromClass(YPe), HPe = () => "comment-" + Math.random().toString().replace(".", ""); +class XPe { 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; } @@ -28029,7 +28029,7 @@ class oNe { } mark(e) { for (; e >= this.lineAuthors.length; ) - this.lineAuthors.push([new lh()]); + this.lineAuthors.push([new sh()]); this.lineAuthors.get(e - 1).set("author", this.user); } remove(e, r) { @@ -28037,8 +28037,8 @@ class oNe { } insert(e, r) { e - 1 > this.lineAuthors.length && this.lineAuthors.push( - [...Array(e - 1 - this.lineAuthors.length).keys()].map((n) => new lh()) - ), this.lineAuthors.insert(e - 1, [...Array(r).keys()].map((n) => new lh([["author", this.user]]))); + [...Array(e - 1 - this.lineAuthors.length).keys()].map((n) => new sh()) + ), this.lineAuthors.insert(e - 1, [...Array(r).keys()].map((n) => new sh([["author", this.user]]))); } firstLineOfSection(e) { const r = this.get(e).name; @@ -28054,9 +28054,9 @@ class oNe { ); } } -class lNe { +class jPe { constructor(e, r) { - this.syncedPositions = e.getMap(mx.dataPath), this.positions = Uo([]), this.syncedPositions.observe(() => { + this.syncedPositions = e.getMap(px.dataPath), this.positions = Fo([]), this.syncedPositions.observe(() => { this.positions.value = [...this.syncedPositions.entries()].map(([n, i]) => ({ commentId: n, lineNumber: parseInt(i) @@ -28081,9 +28081,9 @@ class lNe { this.ydoc.transact(() => this.syncedPositions.delete(e), "comments"); } } -class cNe { +class ZPe { constructor() { - this.comments = Uo({}); + this.comments = Fo({}); } switchVisibility(e) { const r = this.isShown(e); @@ -28121,7 +28121,7 @@ class cNe { }; } } -class uNe { +class KPe { constructor(e, r) { this.user = e.awareness.getLocalState().user, this.resolvedComments = r.getMap("resolved-comments"), this.ydoc = r; } @@ -28153,9 +28153,9 @@ class uNe { this.resolvedComments.observe(() => e(this.resolved())); } } -const ZQ = class { +const BQ = 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 lNe(e, this), this.displayManager = new cNe(r), this.commentResolver = new uNe(r, e), this.draggedComment = Uo(null), this.commentWithPopup = Uo(null), this.comments = y6(() => 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 jPe(e, this), this.displayManager = new ZPe(r), this.commentResolver = new KPe(r, e), this.draggedComment = Fo(null), this.commentWithPopup = Fo(null), this.comments = p6(() => this.positions().positions.value.map(({ commentId: s, lineNumber: a }) => ({ @@ -28170,13 +28170,13 @@ const ZQ = class { target: new RegExp(a.targetRegexSrc, a.targetRegexFlags) })); this.mainCodeMirror.dispatch({ - effects: xue.reconfigure(sF(s, KPe, this.positions())), - annotations: zi.userEvent.of("suggestion") + effects: hue.reconfigure(GB(s, zPe, this.positions())), + annotations: Fi.userEvent.of("suggestion") }); }), this.positionManager.syncedPositions.observeDeep(() => this.updateMainCodeMirror()); } lineAuthors(e) { - return new oNe(this.ydoc, this.provider, this.getAvatar, this.getUserUrl, e); + return new XPe(this.ydoc, this.provider, this.getAvatar, this.getUserUrl, e); } positions() { return this.positionManager; @@ -28194,14 +28194,14 @@ const ZQ = class { return this.mainCodeMirror.dom.querySelector(".cm-gutters").offsetWidth; } getTextForComment(e) { - return this.ydoc.getText(ZQ.commentsPrefix + e); + return this.ydoc.getText(BQ.commentsPrefix + e); } delText(e) { let r = this.getTextForComment(e); r != null && r.parent && r.delete(); } newComment(e) { - const r = aNe(); + const r = HPe(); return this.positions().set(r, e.toString()), this.display().new(r), this.lineAuthors(r).mark(1), this.newLocalComment = !0, r; } deleteComment(e) { @@ -28255,12 +28255,12 @@ const ZQ = class { e.includes(r) || (this.display().del(r), this.suggestions.set(r, [])); } syncFoldedComments(e) { - if (!MN(e)) + if (!xN(e)) return; - const r = e.transactions[0].effects[0].is(Af), { + const r = e.transactions[0].effects[0].is(Ef), { 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 = J_e(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 = q_e(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, @@ -28291,7 +28291,7 @@ const ZQ = class { color: (h = (u = s.get(l + 1)) == null ? void 0 : u.color) != null ? h : "#111" }; }); - r[n] = a.flatMap(ZPe); + r[n] = a.flatMap(FPe); } this.suggestions.doc.transact(() => { for (const [n, i] of Object.entries(r)) @@ -28300,11 +28300,11 @@ const ZQ = class { } updateMainCodeMirror() { this.mainCodeMirror ? this.mainCodeMirror.dispatch({ - effects: vw.of(null) + effects: gw.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(Eue)), n = e.transactions.some((s) => s.effects.some((a) => a.is(vw))); + const r = !e.docChanged || e.transactions.some((s) => s.annotation(yue)), n = e.transactions.some((s) => s.effects.some((a) => a.is(gw))); if (r && !n) return; const i = this.resolver().resolved(); @@ -28422,7 +28422,7 @@ const ZQ = class { for (const a in i) { const o = this.lineAuthors(a); i[a].forEach((l) => { - const u = new lh(); + const u = new sh(); l.author && u.set("author", l.author), o.lineAuthors.push([u]); }); } @@ -28431,13 +28431,13 @@ const ZQ = class { }); } }; -let mx = ZQ; -zt(mx, "commentsPrefix", "comments/"); -const x6 = Gt.define({ +let px = BQ; +zt(px, "commentsPrefix", "comments/"); +const m6 = Gt.define({ combine: (t) => t[t.length - 1], static: !0 -}), vw = _r.define(); -class hNe extends nl { +}), gw = _r.define(); +class JPe extends el { constructor(e, r, n) { super(), this.height = e, this.commentId = r, this.isShown = n; } @@ -28449,12 +28449,12 @@ class hNe extends nl { return e.id = this.commentId, e.classList = "comment-box", this.isShown || (e.classList += " comment-box-hidden"), e.style.height = this.height + "px", e; } } -const fNe = (t, e, r) => Ht.widget({ - widget: new hNe(t, e, r), +const eNe = (t, e, r) => Ht.widget({ + widget: new JPe(t, e, r), side: 1e4, inlineOrder: !1, block: r -}), dNe = (t, e) => t.lineNumber - e.lineNumber, pNe = (t) => t.docChanged || t.effects.some((e) => e.is(vw)), gNe = (t) => [(e, { +}), tNe = (t, e) => t.lineNumber - e.lineNumber, rNe = (t) => t.docChanged || t.effects.some((e) => e.is(gw)), nNe = (t) => [(e, { commentId: r, lineNumber: n, height: i, @@ -28464,13 +28464,13 @@ const fNe = (t, e, r) => Ht.widget({ return e; try { const a = t.newDoc.line(n).to; - e.add(a, a, fNe(i, r, s)); + e.add(a, a, eNe(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 is()], mNe = (t, e) => { - if ((t.isUserEvent("input") || t.isUserEvent("delete") || t.annotation(_ue)) && t.startState.doc.lines != t.state.doc.lines) { +}, new rs()], iNe = (t, e) => { + if ((t.isUserEvent("input") || t.isUserEvent("delete") || t.annotation(bue)) && t.startState.doc.lines != t.state.doc.lines) { const r = []; e.positions().positions.value.forEach((n) => { const { @@ -28482,65 +28482,65 @@ const fNe = (t, e, r) => Ht.widget({ i ? e.deleteComment(n.commentId) : s != a && (r.push(n.commentId), e.positions().move(n.commentId, o, !1)); }), e.syncSuggestions(...r); } -}, vNe = ai.define({ +}, sNe = ai.define({ create() { - return new is().finish(); + return new rs().finish(); }, update(t, e) { - if (pNe(e)) { - const r = e.state.facet(x6); - return mNe(e, r), r.comments.value.sort(dNe).reduce(...gNe(e)).finish(); + if (rNe(e)) { + const r = e.state.facet(m6); + return iNe(e, r), r.comments.value.sort(tNe).reduce(...nNe(e)).finish(); } return t; }, provide(t) { return Mt.decorations.from(t); } -}), $0 = class extends pc { +}), D0 = class extends hc { constructor(e, r) { var n; - super(), this.gutterMarker = null, this.icon = null, r && e && (this.ycomments = r.state.facet(x6), 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(m6), 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($0.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(D0.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 = $0.ICON_CLASS, !this.draggedComment && !this.commentId ? (this.icon.onmouseenter = () => this.icon.classList.add($0.COMMENT_IMAGE_CLASS), this.icon.onmouseleave = () => this.icon.classList.remove($0.COMMENT_IMAGE_CLASS)) : (this.icon.onclick = () => this.ycomments.display().switchVisibility(this.commentId), this.icon.onmouseenter = () => { + this.icon = document.createElement("section"), this.icon.classList = D0.ICON_CLASS, !this.draggedComment && !this.commentId ? (this.icon.onmouseenter = () => this.icon.classList.add(D0.COMMENT_IMAGE_CLASS), this.icon.onmouseleave = () => this.icon.classList.remove(D0.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($0.COMMENT_IMAGE_CLASS); + this.icon.classList.add(D0.COMMENT_IMAGE_CLASS); } toDOM() { return this.createGutterMarker(), this.createPopupIcon(), this.hasComments() && this.markHasComments(), this.gutterMarker.appendChild(this.icon), this.gutterMarker; } }; -let _0 = $0; -zt(_0, "MAIN_CLASS", "comment-gutter"), zt(_0, "ICON_CLASS", "comment-gutter-icon"), zt(_0, "COMMENT_IMAGE_CLASS", "comment-image"); -const yNe = (t, e, r) => { +let S0 = D0; +zt(S0, "MAIN_CLASS", "comment-gutter"), zt(S0, "ICON_CLASS", "comment-gutter-icon"), zt(S0, "COMMENT_IMAGE_CLASS", "comment-image"); +const aNe = (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); -}, bNe = Z_({ +}, oNe = G_({ lineMarker(t, e) { - return new _0(e, t); + return new S0(e, t); }, - lineMarkerChange: (t) => t.transactions.some((e) => e.effects.some((r) => r.is(vw))), - initialSpacer: () => new _0(null, null), + lineMarkerChange: (t) => t.transactions.some((e) => e.effects.some((r) => r.is(gw))), + initialSpacer: () => new S0(null, null), domEventHandlers: { click(t, e) { - let r = t.state.facet(x6.reader), n = yNe(t, e, r); + let r = t.state.facet(m6.reader), n = aNe(t, e, r); r.display().switchVisibility(n), t.dispatch({ - effects: vw.of(null) + effects: gw.of(null) }); } } -}), xNe = (t) => [x6.of(t), vNe, bNe, Mt.updateListener.of((e) => t.syncComments(e))]; -class Jf { +}), lNe = (t) => [m6.of(t), sNe, oNe, Mt.updateListener.of((e) => t.syncComments(e))]; +class Zf { constructor(e) { this.state = e; } @@ -28548,42 +28548,42 @@ class Jf { return []; } } -class wNe extends Jf { +class cNe extends Zf { run(e) { const r = new this.state.Token("code_inline", "code", 0); return r.content = e.content, [r]; } } -const ONe = { - raw: wNe -}, K9 = "math_inline"; -class kNe extends Jf { +const uNe = { + raw: cNe +}, G9 = "math_inline"; +class hNe extends Zf { run(e) { - const r = new this.state.Token(K9, "span", 0); + const r = new this.state.Token(G9, "span", 0); return r.attrSet("class", "math inline"), r.markup = "$", r.content = e.content, [r]; } } -function SNe(t, e) { +function fNe(t, e) { var r; - !(!((r = e == null ? void 0 : e.roles) === null || r === void 0) && r.math) || t.renderer.rules[K9] || (t.renderer.rules[K9] = (n, i) => { + !(!((r = e == null ? void 0 : e.roles) === null || r === void 0) && r.math) || t.renderer.rules[G9] || (t.renderer.rules[G9] = (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 TNe = { - math: kNe +const dNe = { + math: hNe }; -function Aue(t, e) { - e.parseRoles && t.inline.ruler.before("backticks", "parse_roles", CNe), t.core.ruler.after(e.rolesAfter || "inline", "run_roles", _Ne(e.roles || {})), t.renderer.rules.role = (r, n) => { +function xue(t, e) { + e.parseRoles && t.inline.ruler.before("backticks", "parse_roles", pNe), t.core.ruler.after(e.rolesAfter || "inline", "run_roles", mNe(e.roles || {})), t.renderer.rules.role = (r, n) => { const i = r[n]; return `${i.meta.name}${i.content}`; - }, SNe(t, e); + }, fNe(t, e); } -function CNe(t, e) { +function pNe(t, e) { if (t.src.charCodeAt(t.pos - 1) === 92) return !1; - const r = ENe.exec(t.src.slice(t.pos)); + const r = gNe.exec(t.src.slice(t.pos)); if (r == null) return !1; const [n, i, , s] = r; @@ -28593,14 +28593,14 @@ function CNe(t, e) { } return !0; } -let J9; +let H9; try { - J9 = new RegExp("^\\{([a-zA-Z_\\-+:]{1,36})\\}(`+)(?!`)(.+?)(?]+)>$/; -class DNe extends Jf { +const Oue = /^(.+?)<([^<>]+)>$/; +class wNe extends Zf { 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 uF(this.state, { open: r, content: n, close: i }, { kind: "eq", label: e.content }, { - kind: yw.equation, + return KB(this.state, { open: r, content: n, close: i }, { kind: "eq", label: e.content }, { + kind: mw.equation, contentFromTarget: (s) => `(${s.number})` }), [r, n, i]; } } -class PNe extends Jf { +class ONe extends Zf { run(e) { - const r = Lue.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 uF(this.state, { open: a, content: o, close: l }, { kind: "numref", label: i || e.content, value: s }, { + const r = Oue.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 KB(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 NNe extends Jf { +class kNe extends Zf { run(e) { - const r = Lue.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 uF(this.state, { open: a, content: o, close: l }, { kind: "ref", label: i || e.content, value: s }, { + const r = Oue.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 KB(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 INe = { - eq: DNe, - ref: NNe, - numref: PNe -}, $Ne = Object.assign(Object.assign(Object.assign(Object.assign({}, ONe), RNe), TNe), INe); +const SNe = { + eq: wNe, + ref: kNe, + numref: ONe +}, TNe = Object.assign(Object.assign(Object.assign(Object.assign({}, uNe), yNe), dNe), SNe); /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ -function Mue(t) { +function kue(t) { return typeof t > "u" || t === null; } -function BNe(t) { +function CNe(t) { return typeof t == "object" && t !== null; } -function FNe(t) { - return Array.isArray(t) ? t : Mue(t) ? [] : [t]; +function ENe(t) { + return Array.isArray(t) ? t : kue(t) ? [] : [t]; } -function zNe(t, e) { +function _Ne(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 qNe(t, e) { +function ANe(t, e) { var r = "", n; for (n = 0; n < e; n += 1) r += t; return r; } -function UNe(t) { +function RNe(t) { return t === 0 && Number.NEGATIVE_INFINITY === 1 / t; } -var QNe = Mue, VNe = BNe, WNe = FNe, YNe = qNe, GNe = UNe, HNe = zNe, gs = { - isNothing: QNe, - isObject: VNe, - toArray: WNe, - repeat: YNe, - isNegativeZero: GNe, - extend: HNe +var LNe = kue, MNe = CNe, DNe = ENe, PNe = ANe, NNe = RNe, INe = _Ne, ds = { + isNothing: LNe, + isObject: MNe, + toArray: DNe, + repeat: PNe, + isNegativeZero: NNe, + extend: INe }; -function Due(t, e) { +function Sue(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 bw(t, e) { - Error.call(this), this.name = "YAMLException", this.reason = t, this.mark = e, this.message = Due(this, !1), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack || ""; +function vw(t, e) { + Error.call(this), this.name = "YAMLException", this.reason = t, this.mark = e, this.message = Sue(this, !1), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack || ""; } -bw.prototype = Object.create(Error.prototype); -bw.prototype.constructor = bw; -bw.prototype.toString = function(e) { - return this.name + ": " + Due(this, e); +vw.prototype = Object.create(Error.prototype); +vw.prototype.constructor = vw; +vw.prototype.toString = function(e) { + return this.name + ": " + Sue(this, e); }; -var lo = bw; -function V8(t, e, r, n, i) { +var so = vw; +function B8(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 W8(t, e) { - return gs.repeat(" ", e - t.length) + t; +function F8(t, e) { + return ds.repeat(" ", e - t.length) + t; } -function XNe(t, e) { +function $Ne(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); @@ -28804,28 +28804,28 @@ function XNe(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 = V8( + u = B8( t.buffer, n[a - l], i[a - l], t.position - (n[a] - n[a - l]), f - ), o = gs.repeat(" ", e.indent) + W8((t.line - l + 1).toString(), h) + " | " + u.str + ` + ), o = ds.repeat(" ", e.indent) + F8((t.line - l + 1).toString(), h) + " | " + u.str + ` ` + o; - for (u = V8(t.buffer, n[a], i[a], t.position, f), o += gs.repeat(" ", e.indent) + W8((t.line + 1).toString(), h) + " | " + u.str + ` -`, o += gs.repeat("-", e.indent + h + 3 + u.pos) + `^ + for (u = B8(t.buffer, n[a], i[a], t.position, f), o += ds.repeat(" ", e.indent) + F8((t.line + 1).toString(), h) + " | " + u.str + ` +`, o += ds.repeat("-", e.indent + h + 3 + u.pos) + `^ `, l = 1; l <= e.linesAfter && !(a + l >= i.length); l++) - u = V8( + u = B8( t.buffer, n[a + l], i[a + l], t.position - (n[a] - n[a + l]), f - ), o += gs.repeat(" ", e.indent) + W8((t.line + l + 1).toString(), h) + " | " + u.str + ` + ), o += ds.repeat(" ", e.indent) + F8((t.line + l + 1).toString(), h) + " | " + u.str + ` `; return o.replace(/\n$/, ""); } -var jNe = XNe, ZNe = [ +var BNe = $Ne, FNe = [ "kind", "multi", "resolve", @@ -28836,12 +28836,12 @@ var jNe = XNe, ZNe = [ "representName", "defaultStyle", "styleAliases" -], KNe = [ +], zNe = [ "scalar", "sequence", "mapping" ]; -function JNe(t) { +function qNe(t) { var e = {}; return t !== null && Object.keys(t).forEach(function(r) { t[r].forEach(function(n) { @@ -28849,19 +28849,19 @@ function JNe(t) { }); }), e; } -function eIe(t, e) { +function UNe(t, e) { if (e = e || {}, Object.keys(e).forEach(function(r) { - if (ZNe.indexOf(r) === -1) - throw new lo('Unknown option "' + r + '" is met in definition of "' + t + '" YAML type.'); + if (FNe.indexOf(r) === -1) + throw new so('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 = JNe(e.styleAliases || null), KNe.indexOf(this.kind) === -1) - throw new lo('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 = qNe(e.styleAliases || null), zNe.indexOf(this.kind) === -1) + throw new so('Unknown kind "' + this.kind + '" is specified for "' + t + '" YAML type.'); } -var ha = eIe; -function KG(t, e) { +var ua = UNe; +function FG(t, e) { var r = []; return t[e].forEach(function(n) { var i = r.length; @@ -28870,7 +28870,7 @@ function KG(t, e) { }), r[i] = n; }), r; } -function tIe() { +function QNe() { var t = { scalar: {}, sequence: {}, @@ -28890,72 +28890,72 @@ function tIe() { arguments[e].forEach(n); return t; } -function eD(t) { +function X9(t) { return this.extend(t); } -eD.prototype.extend = function(e) { +X9.prototype.extend = function(e) { var r = [], n = []; - if (e instanceof ha) + if (e instanceof ua) 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 lo("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })"); + throw new so("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })"); r.forEach(function(s) { - if (!(s instanceof ha)) - throw new lo("Specified list of YAML types (or a single Type object) contains a non-Type object."); + if (!(s instanceof ua)) + throw new so("Specified list of YAML types (or a single Type object) contains a non-Type object."); if (s.loadKind && s.loadKind !== "scalar") - throw new lo("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported."); + throw new so("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 lo("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit."); + throw new so("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 ha)) - throw new lo("Specified list of YAML types (or a single Type object) contains a non-Type object."); + if (!(s instanceof ua)) + throw new so("Specified list of YAML types (or a single Type object) contains a non-Type object."); }); - var i = Object.create(eD.prototype); - return i.implicit = (this.implicit || []).concat(r), i.explicit = (this.explicit || []).concat(n), i.compiledImplicit = KG(i, "implicit"), i.compiledExplicit = KG(i, "explicit"), i.compiledTypeMap = tIe(i.compiledImplicit, i.compiledExplicit), i; + var i = Object.create(X9.prototype); + return i.implicit = (this.implicit || []).concat(r), i.explicit = (this.explicit || []).concat(n), i.compiledImplicit = FG(i, "implicit"), i.compiledExplicit = FG(i, "explicit"), i.compiledTypeMap = QNe(i.compiledImplicit, i.compiledExplicit), i; }; -var Pue = eD, Nue = new ha("tag:yaml.org,2002:str", { +var Tue = X9, Cue = new ua("tag:yaml.org,2002:str", { kind: "scalar", construct: function(t) { return t !== null ? t : ""; } -}), Iue = new ha("tag:yaml.org,2002:seq", { +}), Eue = new ua("tag:yaml.org,2002:seq", { kind: "sequence", construct: function(t) { return t !== null ? t : []; } -}), $ue = new ha("tag:yaml.org,2002:map", { +}), _ue = new ua("tag:yaml.org,2002:map", { kind: "mapping", construct: function(t) { return t !== null ? t : {}; } -}), Bue = new Pue({ +}), Aue = new Tue({ explicit: [ - Nue, - Iue, - $ue + Cue, + Eue, + _ue ] }); -function rIe(t) { +function VNe(t) { if (t === null) return !0; var e = t.length; return e === 1 && t === "~" || e === 4 && (t === "null" || t === "Null" || t === "NULL"); } -function nIe() { +function WNe() { return null; } -function iIe(t) { +function YNe(t) { return t === null; } -var Fue = new ha("tag:yaml.org,2002:null", { +var Rue = new ua("tag:yaml.org,2002:null", { kind: "scalar", - resolve: rIe, - construct: nIe, - predicate: iIe, + resolve: VNe, + construct: WNe, + predicate: YNe, represent: { canonical: function() { return "~"; @@ -28975,23 +28975,23 @@ var Fue = new ha("tag:yaml.org,2002:null", { }, defaultStyle: "lowercase" }); -function sIe(t) { +function GNe(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 aIe(t) { +function HNe(t) { return t === "true" || t === "True" || t === "TRUE"; } -function oIe(t) { +function XNe(t) { return Object.prototype.toString.call(t) === "[object Boolean]"; } -var zue = new ha("tag:yaml.org,2002:bool", { +var Lue = new ua("tag:yaml.org,2002:bool", { kind: "scalar", - resolve: sIe, - construct: aIe, - predicate: oIe, + resolve: GNe, + construct: HNe, + predicate: XNe, represent: { lowercase: function(t) { return t ? "true" : "false"; @@ -29005,16 +29005,16 @@ var zue = new ha("tag:yaml.org,2002:bool", { }, defaultStyle: "lowercase" }); -function lIe(t) { +function jNe(t) { return 48 <= t && t <= 57 || 65 <= t && t <= 70 || 97 <= t && t <= 102; } -function cIe(t) { +function ZNe(t) { return 48 <= t && t <= 55; } -function uIe(t) { +function KNe(t) { return 48 <= t && t <= 57; } -function hIe(t) { +function JNe(t) { if (t === null) return !1; var e = t.length, r = 0, n = !1, i; @@ -29035,7 +29035,7 @@ function hIe(t) { if (i === "x") { for (r++; r < e; r++) if (i = t[r], i !== "_") { - if (!lIe(t.charCodeAt(r))) + if (!jNe(t.charCodeAt(r))) return !1; n = !0; } @@ -29044,7 +29044,7 @@ function hIe(t) { if (i === "o") { for (r++; r < e; r++) if (i = t[r], i !== "_") { - if (!cIe(t.charCodeAt(r))) + if (!ZNe(t.charCodeAt(r))) return !1; n = !0; } @@ -29055,13 +29055,13 @@ function hIe(t) { return !1; for (; r < e; r++) if (i = t[r], i !== "_") { - if (!uIe(t.charCodeAt(r))) + if (!KNe(t.charCodeAt(r))) return !1; n = !0; } return !(!n || i === "_"); } -function fIe(t) { +function eIe(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; @@ -29075,14 +29075,14 @@ function fIe(t) { } return r * parseInt(e, 10); } -function dIe(t) { - return Object.prototype.toString.call(t) === "[object Number]" && t % 1 === 0 && !gs.isNegativeZero(t); +function tIe(t) { + return Object.prototype.toString.call(t) === "[object Number]" && t % 1 === 0 && !ds.isNegativeZero(t); } -var que = new ha("tag:yaml.org,2002:int", { +var Mue = new ua("tag:yaml.org,2002:int", { kind: "scalar", - resolve: hIe, - construct: fIe, - predicate: dIe, + resolve: JNe, + construct: eIe, + predicate: tIe, represent: { binary: function(t) { return t >= 0 ? "0b" + t.toString(2) : "-0b" + t.toString(2).slice(1); @@ -29104,18 +29104,18 @@ var que = new ha("tag:yaml.org,2002:int", { decimal: [10, "dec"], hexadecimal: [16, "hex"] } -}), pIe = new RegExp( +}), rIe = new RegExp( "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$" ); -function gIe(t) { - return !(t === null || !pIe.test(t) || t[t.length - 1] === "_"); +function nIe(t) { + return !(t === null || !rIe.test(t) || t[t.length - 1] === "_"); } -function mIe(t) { +function iIe(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 vIe = /^[-+]?[0-9]+e/; -function yIe(t, e) { +var sIe = /^[-+]?[0-9]+e/; +function aIe(t, e) { var r; if (isNaN(t)) switch (e) { @@ -29144,38 +29144,38 @@ function yIe(t, e) { case "camelcase": return "-.Inf"; } - else if (gs.isNegativeZero(t)) + else if (ds.isNegativeZero(t)) return "-0.0"; - return r = t.toString(10), vIe.test(r) ? r.replace("e", ".e") : r; + return r = t.toString(10), sIe.test(r) ? r.replace("e", ".e") : r; } -function bIe(t) { - return Object.prototype.toString.call(t) === "[object Number]" && (t % 1 !== 0 || gs.isNegativeZero(t)); +function oIe(t) { + return Object.prototype.toString.call(t) === "[object Number]" && (t % 1 !== 0 || ds.isNegativeZero(t)); } -var Uue = new ha("tag:yaml.org,2002:float", { +var Due = new ua("tag:yaml.org,2002:float", { kind: "scalar", - resolve: gIe, - construct: mIe, - predicate: bIe, - represent: yIe, + resolve: nIe, + construct: iIe, + predicate: oIe, + represent: aIe, defaultStyle: "lowercase" -}), Que = Bue.extend({ +}), Pue = Aue.extend({ implicit: [ - Fue, - zue, - que, - Uue + Rue, + Lue, + Mue, + Due ] -}), Vue = Que, Wue = new RegExp( +}), Nue = Pue, Iue = new RegExp( "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$" -), Yue = new RegExp( +), $ue = 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 xIe(t) { - return t === null ? !1 : Wue.exec(t) !== null || Yue.exec(t) !== null; +function lIe(t) { + return t === null ? !1 : Iue.exec(t) !== null || $ue.exec(t) !== null; } -function wIe(t) { +function cIe(t) { var e, r, n, i, s, a, o, l = 0, u = null, h, f, d; - if (e = Wue.exec(t), e === null && (e = Yue.exec(t)), e === null) + if (e = Iue.exec(t), e === null && (e = $ue.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)); @@ -29186,28 +29186,28 @@ function wIe(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 OIe(t) { +function uIe(t) { return t.toISOString(); } -var Gue = new ha("tag:yaml.org,2002:timestamp", { +var Bue = new ua("tag:yaml.org,2002:timestamp", { kind: "scalar", - resolve: xIe, - construct: wIe, + resolve: lIe, + construct: cIe, instanceOf: Date, - represent: OIe + represent: uIe }); -function kIe(t) { +function hIe(t) { return t === "<<" || t === null; } -var Hue = new ha("tag:yaml.org,2002:merge", { +var Fue = new ua("tag:yaml.org,2002:merge", { kind: "scalar", - resolve: kIe -}), hF = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= + resolve: hIe +}), JB = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= \r`; -function SIe(t) { +function fIe(t) { if (t === null) return !1; - var e, r, n = 0, i = t.length, s = hF; + var e, r, n = 0, i = t.length, s = JB; for (r = 0; r < i; r++) if (e = s.indexOf(t.charAt(r)), !(e > 64)) { if (e < 0) @@ -29216,37 +29216,37 @@ function SIe(t) { } return n % 8 === 0; } -function TIe(t) { - var e, r, n = t.replace(/[\r\n=]/g, ""), i = n.length, s = hF, a = 0, o = []; +function dIe(t) { + var e, r, n = t.replace(/[\r\n=]/g, ""), i = n.length, s = JB, 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 CIe(t) { - var e = "", r = 0, n, i, s = t.length, a = hF; +function pIe(t) { + var e = "", r = 0, n, i, s = t.length, a = JB; 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 EIe(t) { +function gIe(t) { return Object.prototype.toString.call(t) === "[object Uint8Array]"; } -var Xue = new ha("tag:yaml.org,2002:binary", { +var zue = new ua("tag:yaml.org,2002:binary", { kind: "scalar", - resolve: SIe, - construct: TIe, - predicate: EIe, - represent: CIe -}), _Ie = Object.prototype.hasOwnProperty, AIe = Object.prototype.toString; -function RIe(t) { + resolve: fIe, + construct: dIe, + predicate: gIe, + represent: pIe +}), mIe = Object.prototype.hasOwnProperty, vIe = Object.prototype.toString; +function yIe(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, AIe.call(i) !== "[object Object]") + if (i = o[r], a = !1, vIe.call(i) !== "[object Object]") return !1; for (s in i) - if (_Ie.call(i, s)) + if (mIe.call(i, s)) if (!a) a = !0; else @@ -29260,26 +29260,26 @@ function RIe(t) { } return !0; } -function LIe(t) { +function bIe(t) { return t !== null ? t : []; } -var jue = new ha("tag:yaml.org,2002:omap", { +var que = new ua("tag:yaml.org,2002:omap", { kind: "sequence", - resolve: RIe, - construct: LIe -}), MIe = Object.prototype.toString; -function DIe(t) { + resolve: yIe, + construct: bIe +}), xIe = Object.prototype.toString; +function wIe(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], MIe.call(n) !== "[object Object]" || (i = Object.keys(n), i.length !== 1)) + if (n = a[e], xIe.call(n) !== "[object Object]" || (i = Object.keys(n), i.length !== 1)) return !1; s[e] = [i[0], n[i[0]]]; } return !0; } -function PIe(t) { +function OIe(t) { if (t === null) return []; var e, r, n, i, s, a = t; @@ -29287,81 +29287,81 @@ function PIe(t) { n = a[e], i = Object.keys(n), s[e] = [i[0], n[i[0]]]; return s; } -var Zue = new ha("tag:yaml.org,2002:pairs", { +var Uue = new ua("tag:yaml.org,2002:pairs", { kind: "sequence", - resolve: DIe, - construct: PIe -}), NIe = Object.prototype.hasOwnProperty; -function IIe(t) { + resolve: wIe, + construct: OIe +}), kIe = Object.prototype.hasOwnProperty; +function SIe(t) { if (t === null) return !0; var e, r = t; for (e in r) - if (NIe.call(r, e) && r[e] !== null) + if (kIe.call(r, e) && r[e] !== null) return !1; return !0; } -function $Ie(t) { +function TIe(t) { return t !== null ? t : {}; } -var Kue = new ha("tag:yaml.org,2002:set", { +var Que = new ua("tag:yaml.org,2002:set", { kind: "mapping", - resolve: IIe, - construct: $Ie -}), fF = Vue.extend({ + resolve: SIe, + construct: TIe +}), eF = Nue.extend({ implicit: [ - Gue, - Hue + Bue, + Fue ], explicit: [ - Xue, - jue, - Zue, - Kue + zue, + que, + Uue, + Que ] -}), wp = Object.prototype.hasOwnProperty, KT = 1, Jue = 2, ehe = 3, JT = 4, Y8 = 1, BIe = 2, JG = 3, FIe = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, zIe = /[\x85\u2028\u2029]/, qIe = /[,\[\]\{\}]/, the = /^(?:!|!!|![a-z\-]+!)$/i, rhe = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; -function eH(t) { +}), mp = Object.prototype.hasOwnProperty, jT = 1, Vue = 2, Wue = 3, ZT = 4, z8 = 1, CIe = 2, zG = 3, EIe = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, _Ie = /[\x85\u2028\u2029]/, AIe = /[,\[\]\{\}]/, Yue = /^(?:!|!!|![a-z\-]+!)$/i, Gue = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; +function qG(t) { return Object.prototype.toString.call(t); } -function uh(t) { +function oh(t) { return t === 10 || t === 13; } -function ag(t) { +function rg(t) { return t === 9 || t === 32; } -function jo(t) { +function Go(t) { return t === 9 || t === 32 || t === 10 || t === 13; } -function x1(t) { +function m1(t) { return t === 44 || t === 91 || t === 93 || t === 123 || t === 125; } -function UIe(t) { +function RIe(t) { var e; return 48 <= t && t <= 57 ? t - 48 : (e = t | 32, 97 <= e && e <= 102 ? e - 97 + 10 : -1); } -function QIe(t) { +function LIe(t) { return t === 120 ? 2 : t === 117 ? 4 : t === 85 ? 8 : 0; } -function VIe(t) { +function MIe(t) { return 48 <= t && t <= 57 ? t - 48 : -1; } -function tH(t) { +function UG(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 WIe(t) { +function DIe(t) { return t <= 65535 ? String.fromCharCode(t) : String.fromCharCode( (t - 65536 >> 10) + 55296, (t - 65536 & 1023) + 56320 ); } -var nhe = new Array(256), ihe = new Array(256); -for (var Um = 0; Um < 256; Um++) - nhe[Um] = tH(Um) ? 1 : 0, ihe[Um] = tH(Um); -function YIe(t, e) { - this.input = t, this.filename = e.filename || null, this.schema = e.schema || fF, 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 Hue = new Array(256), Xue = new Array(256); +for (var Fm = 0; Fm < 256; Fm++) + Hue[Fm] = UG(Fm) ? 1 : 0, Xue[Fm] = UG(Fm); +function PIe(t, e) { + this.input = t, this.filename = e.filename || null, this.schema = e.schema || eF, 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 she(t, e) { +function jue(t, e) { var r = { name: t.filename, buffer: t.input.slice(0, -1), @@ -29369,22 +29369,22 @@ function she(t, e) { line: t.line, column: t.position - t.lineStart }; - return r.snippet = jNe(r), new lo(e, r); + return r.snippet = BNe(r), new so(e, r); } function wr(t, e) { - throw she(t, e); + throw jue(t, e); } -function eC(t, e) { - t.onWarning && t.onWarning.call(null, she(t, e)); +function KT(t, e) { + t.onWarning && t.onWarning.call(null, jue(t, e)); } -var rH = { +var QG = { YAML: function(e, r, n) { var i, s, a; - e.version !== null && wr(e, "duplication of %YAML directive"), n.length !== 1 && wr(e, "YAML directive accepts exactly one argument"), i = /^([0-9]+)\.([0-9]+)$/.exec(n[0]), i === null && wr(e, "ill-formed argument of the YAML directive"), s = parseInt(i[1], 10), a = parseInt(i[2], 10), s !== 1 && wr(e, "unacceptable YAML version of the document"), e.version = n[0], e.checkLineBreaks = a < 2, a !== 1 && a !== 2 && eC(e, "unsupported YAML version of the document"); + e.version !== null && wr(e, "duplication of %YAML directive"), n.length !== 1 && wr(e, "YAML directive accepts exactly one argument"), i = /^([0-9]+)\.([0-9]+)$/.exec(n[0]), i === null && wr(e, "ill-formed argument of the YAML directive"), s = parseInt(i[1], 10), a = parseInt(i[2], 10), s !== 1 && wr(e, "unacceptable YAML version of the document"), e.version = n[0], e.checkLineBreaks = a < 2, a !== 1 && a !== 2 && KT(e, "unsupported YAML version of the document"); }, TAG: function(e, r, n) { var i, s; - n.length !== 2 && wr(e, "TAG directive accepts exactly two arguments"), i = n[0], s = n[1], the.test(i) || wr(e, "ill-formed tag handle (first argument) of the TAG directive"), wp.call(e.tagMap, i) && wr(e, 'there is a previously declared suffix for "' + i + '" tag handle'), rhe.test(s) || wr(e, "ill-formed tag prefix (second argument) of the TAG directive"); + n.length !== 2 && wr(e, "TAG directive accepts exactly two arguments"), i = n[0], s = n[1], Yue.test(i) || wr(e, "ill-formed tag handle (first argument) of the TAG directive"), mp.call(e.tagMap, i) && wr(e, 'there is a previously declared suffix for "' + i + '" tag handle'), Gue.test(s) || wr(e, "ill-formed tag prefix (second argument) of the TAG directive"); try { s = decodeURIComponent(s); } catch { @@ -29393,35 +29393,35 @@ var rH = { e.tagMap[i] = s; } }; -function Hd(t, e, r, n) { +function Wd(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 || wr(t, "expected valid JSON character"); else - FIe.test(o) && wr(t, "the stream contains non-printable characters"); + EIe.test(o) && wr(t, "the stream contains non-printable characters"); t.result += o; } } -function nH(t, e, r, n) { +function VG(t, e, r, n) { var i, s, a, o; - for (gs.isObject(r) || wr(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], wp.call(e, s) || (e[s] = r[s], n[s] = !0); + for (ds.isObject(r) || wr(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], mp.call(e, s) || (e[s] = r[s], n[s] = !0); } -function w1(t, e, r, n, i, s, a, o, l) { +function v1(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]) && wr(t, "nested arrays are not supported inside keys"), typeof i == "object" && eH(i[u]) === "[object Object]" && (i[u] = "[object Object]"); - if (typeof i == "object" && eH(i) === "[object Object]" && (i = "[object Object]"), i = String(i), e === null && (e = {}), n === "tag:yaml.org,2002:merge") + Array.isArray(i[u]) && wr(t, "nested arrays are not supported inside keys"), typeof i == "object" && qG(i[u]) === "[object Object]" && (i[u] = "[object Object]"); + if (typeof i == "object" && qG(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) - nH(t, e, s[u], r); + VG(t, e, s[u], r); else - nH(t, e, s, r); + VG(t, e, s, r); else - !t.json && !wp.call(r, i) && wp.call(e, i) && (t.line = a || t.line, t.lineStart = o || t.lineStart, t.position = l || t.position, wr(t, "duplicated mapping key")), i === "__proto__" ? Object.defineProperty(e, i, { + !t.json && !mp.call(r, i) && mp.call(e, i) && (t.line = a || t.line, t.lineStart = o || t.lineStart, t.position = l || t.position, wr(t, "duplicated mapping key")), i === "__proto__" ? Object.defineProperty(e, i, { configurable: !0, enumerable: !0, writable: !0, @@ -29429,50 +29429,50 @@ function w1(t, e, r, n, i, s, a, o, l) { }) : e[i] = s, delete r[i]; return e; } -function dF(t) { +function tF(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++) : wr(t, "a line break is expected"), t.line += 1, t.lineStart = t.position, t.firstTabInLine = -1; } -function es(t, e, r) { +function Ki(t, e, r) { for (var n = 0, i = t.input.charCodeAt(t.position); i !== 0; ) { - for (; ag(i); ) + for (; rg(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 (uh(i)) - for (dF(t), i = t.input.charCodeAt(t.position), n++, t.lineIndent = 0; i === 32; ) + if (oh(i)) + for (tF(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 && eC(t, "deficient indentation"), n; + return r !== -1 && n !== 0 && t.lineIndent < r && KT(t, "deficient indentation"), n; } -function O6(t) { +function y6(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 || jo(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 || Go(r))); } -function pF(t, e) { - e === 1 ? t.result += " " : e > 1 && (t.result += gs.repeat(` +function rF(t, e) { + e === 1 ? t.result += " " : e > 1 && (t.result += ds.repeat(` `, e - 1)); } -function GIe(t, e, r) { +function NIe(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), jo(p) || x1(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), jo(i) || r && x1(i))) + if (p = t.input.charCodeAt(t.position), Go(p) || m1(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), Go(i) || r && m1(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), jo(i) || r && x1(i)) + if (i = t.input.charCodeAt(t.position + 1), Go(i) || r && m1(i)) break; } else if (p === 35) { - if (n = t.input.charCodeAt(t.position - 1), jo(n)) + if (n = t.input.charCodeAt(t.position - 1), Go(n)) break; } else { - if (t.position === t.lineStart && O6(t) || r && x1(p)) + if (t.position === t.lineStart && y6(t) || r && m1(p)) break; - if (uh(p)) - if (l = t.line, u = t.lineStart, h = t.lineIndent, es(t, !1, -1), t.lineIndent >= e) { + if (oh(p)) + if (l = t.line, u = t.lineStart, h = t.lineIndent, Ki(t, !1, -1), t.lineIndent >= e) { o = !0, p = t.input.charCodeAt(t.position); continue; } else { @@ -29480,49 +29480,49 @@ function GIe(t, e, r) { break; } } - o && (Hd(t, s, a, !1), pF(t, t.line - l), s = a = t.position, o = !1), ag(p) || (a = t.position + 1), p = t.input.charCodeAt(++t.position); + o && (Wd(t, s, a, !1), rF(t, t.line - l), s = a = t.position, o = !1), rg(p) || (a = t.position + 1), p = t.input.charCodeAt(++t.position); } - return Hd(t, s, a, !1), t.result ? !0 : (t.kind = f, t.result = d, !1); + return Wd(t, s, a, !1), t.result ? !0 : (t.kind = f, t.result = d, !1); } -function HIe(t, e) { +function IIe(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 (Hd(t, n, t.position, !0), r = t.input.charCodeAt(++t.position), r === 39) + if (Wd(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 - uh(r) ? (Hd(t, n, i, !0), pF(t, es(t, !1, e)), n = i = t.position) : t.position === t.lineStart && O6(t) ? wr(t, "unexpected end of the document within a single quoted scalar") : (t.position++, i = t.position); + oh(r) ? (Wd(t, n, i, !0), rF(t, Ki(t, !1, e)), n = i = t.position) : t.position === t.lineStart && y6(t) ? wr(t, "unexpected end of the document within a single quoted scalar") : (t.position++, i = t.position); wr(t, "unexpected end of the stream within a single quoted scalar"); } -function XIe(t, e) { +function $Ie(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 Hd(t, r, t.position, !0), t.position++, !0; + return Wd(t, r, t.position, !0), t.position++, !0; if (o === 92) { - if (Hd(t, r, t.position, !0), o = t.input.charCodeAt(++t.position), uh(o)) - es(t, !1, e); - else if (o < 256 && nhe[o]) - t.result += ihe[o], t.position++; - else if ((a = QIe(o)) > 0) { + if (Wd(t, r, t.position, !0), o = t.input.charCodeAt(++t.position), oh(o)) + Ki(t, !1, e); + else if (o < 256 && Hue[o]) + t.result += Xue[o], t.position++; + else if ((a = LIe(o)) > 0) { for (i = a, s = 0; i > 0; i--) - o = t.input.charCodeAt(++t.position), (a = UIe(o)) >= 0 ? s = (s << 4) + a : wr(t, "expected hexadecimal character"); - t.result += WIe(s), t.position++; + o = t.input.charCodeAt(++t.position), (a = RIe(o)) >= 0 ? s = (s << 4) + a : wr(t, "expected hexadecimal character"); + t.result += DIe(s), t.position++; } else wr(t, "unknown escape sequence"); r = n = t.position; } else - uh(o) ? (Hd(t, r, n, !0), pF(t, es(t, !1, e)), r = n = t.position) : t.position === t.lineStart && O6(t) ? wr(t, "unexpected end of the document within a double quoted scalar") : (t.position++, n = t.position); + oh(o) ? (Wd(t, r, n, !0), rF(t, Ki(t, !1, e)), r = n = t.position) : t.position === t.lineStart && y6(t) ? wr(t, "unexpected end of the document within a double quoted scalar") : (t.position++, n = t.position); } wr(t, "unexpected end of the stream within a double quoted scalar"); } -function jIe(t, e) { +function BIe(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 = []; @@ -29531,14 +29531,14 @@ function jIe(t, e) { else return !1; for (t.anchor !== null && (t.anchorMap[t.anchor] = o), b = t.input.charCodeAt(++t.position); b !== 0; ) { - if (es(t, !0, e), b = t.input.charCodeAt(t.position), b === h) + if (Ki(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 && wr(t, "expected the node content, but found ','") : wr(t, "missed comma between flow collection entries"), v = m = y = null, f = d = !1, b === 63 && (u = t.input.charCodeAt(t.position + 1), jo(u) && (f = d = !0, t.position++, es(t, !0, e))), n = t.line, i = t.lineStart, s = t.position, Lv(t, e, KT, !1, !0), v = t.tag, m = t.result, es(t, !0, e), b = t.input.charCodeAt(t.position), (d || t.line === n) && b === 58 && (f = !0, b = t.input.charCodeAt(++t.position), es(t, !0, e), Lv(t, e, KT, !1, !0), y = t.result), p ? w1(t, o, g, v, m, y, n, i, s) : f ? o.push(w1(t, null, g, v, m, y, n, i, s)) : o.push(m), es(t, !0, e), b = t.input.charCodeAt(t.position), b === 44 ? (r = !0, b = t.input.charCodeAt(++t.position)) : r = !1; + r ? b === 44 && wr(t, "expected the node content, but found ','") : wr(t, "missed comma between flow collection entries"), v = m = y = null, f = d = !1, b === 63 && (u = t.input.charCodeAt(t.position + 1), Go(u) && (f = d = !0, t.position++, Ki(t, !0, e))), n = t.line, i = t.lineStart, s = t.position, Ev(t, e, jT, !1, !0), v = t.tag, m = t.result, Ki(t, !0, e), b = t.input.charCodeAt(t.position), (d || t.line === n) && b === 58 && (f = !0, b = t.input.charCodeAt(++t.position), Ki(t, !0, e), Ev(t, e, jT, !1, !0), y = t.result), p ? v1(t, o, g, v, m, y, n, i, s) : f ? o.push(v1(t, null, g, v, m, y, n, i, s)) : o.push(m), Ki(t, !0, e), b = t.input.charCodeAt(t.position), b === 44 ? (r = !0, b = t.input.charCodeAt(++t.position)) : r = !1; } wr(t, "unexpected end of the stream within a flow collection"); } -function ZIe(t, e) { - var r, n, i = Y8, s = !1, a = !1, o = e, l = 0, u = !1, h, f; +function FIe(t, e) { + var r, n, i = z8, 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) @@ -29547,74 +29547,74 @@ function ZIe(t, e) { return !1; for (t.kind = "scalar", t.result = ""; f !== 0; ) if (f = t.input.charCodeAt(++t.position), f === 43 || f === 45) - Y8 === i ? i = f === 43 ? JG : BIe : wr(t, "repeat of a chomping mode identifier"); - else if ((h = VIe(f)) >= 0) + z8 === i ? i = f === 43 ? zG : CIe : wr(t, "repeat of a chomping mode identifier"); + else if ((h = MIe(f)) >= 0) h === 0 ? wr(t, "bad explicit indentation width of a block scalar; it cannot be less than one") : a ? wr(t, "repeat of an indentation width identifier") : (o = e + h - 1, a = !0); else break; - if (ag(f)) { + if (rg(f)) { do f = t.input.charCodeAt(++t.position); - while (ag(f)); + while (rg(f)); if (f === 35) do f = t.input.charCodeAt(++t.position); - while (!uh(f) && f !== 0); + while (!oh(f) && f !== 0); } for (; f !== 0; ) { - for (dF(t), t.lineIndent = 0, f = t.input.charCodeAt(t.position); (!a || t.lineIndent < o) && f === 32; ) + for (tF(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), uh(f)) { + if (!a && t.lineIndent > o && (o = t.lineIndent), oh(f)) { l++; continue; } if (t.lineIndent < o) { - i === JG ? t.result += gs.repeat(` -`, s ? 1 + l : l) : i === Y8 && s && (t.result += ` + i === zG ? t.result += ds.repeat(` +`, s ? 1 + l : l) : i === z8 && s && (t.result += ` `); break; } - for (n ? ag(f) ? (u = !0, t.result += gs.repeat(` -`, s ? 1 + l : l)) : u ? (u = !1, t.result += gs.repeat(` -`, l + 1)) : l === 0 ? s && (t.result += " ") : t.result += gs.repeat(` -`, l) : t.result += gs.repeat(` -`, s ? 1 + l : l), s = !0, a = !0, l = 0, r = t.position; !uh(f) && f !== 0; ) + for (n ? rg(f) ? (u = !0, t.result += ds.repeat(` +`, s ? 1 + l : l)) : u ? (u = !1, t.result += ds.repeat(` +`, l + 1)) : l === 0 ? s && (t.result += " ") : t.result += ds.repeat(` +`, l) : t.result += ds.repeat(` +`, s ? 1 + l : l), s = !0, a = !0, l = 0, r = t.position; !oh(f) && f !== 0; ) f = t.input.charCodeAt(++t.position); - Hd(t, r, t.position, !1); + Wd(t, r, t.position, !1); } return !0; } -function iH(t, e) { +function WG(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, wr(t, "tab characters must not be used in indentation")), !(l !== 45 || (a = t.input.charCodeAt(t.position + 1), !jo(a)))); ) { - if (o = !0, t.position++, es(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, wr(t, "tab characters must not be used in indentation")), !(l !== 45 || (a = t.input.charCodeAt(t.position + 1), !Go(a)))); ) { + if (o = !0, t.position++, Ki(t, !0, -1) && t.lineIndent <= e) { s.push(null), l = t.input.charCodeAt(t.position); continue; } - if (r = t.line, Lv(t, e, ehe, !1, !0), s.push(t.result), es(t, !0, -1), l = t.input.charCodeAt(t.position), (t.line === r || t.lineIndent > e) && l !== 0) + if (r = t.line, Ev(t, e, Wue, !1, !0), s.push(t.result), Ki(t, !0, -1), l = t.input.charCodeAt(t.position), (t.line === r || t.lineIndent > e) && l !== 0) wr(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 KIe(t, e, r) { +function zIe(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, wr(t, "tab characters must not be used in indentation")), n = t.input.charCodeAt(t.position + 1), s = t.line, (b === 63 || b === 58) && jo(n)) - b === 63 ? (v && (w1(t, f, d, p, g, null, a, o, l), p = g = m = null), y = !0, v = !0, i = !0) : v ? (v = !1, i = !0) : wr(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, wr(t, "tab characters must not be used in indentation")), n = t.input.charCodeAt(t.position + 1), s = t.line, (b === 63 || b === 58) && Go(n)) + b === 63 ? (v && (v1(t, f, d, p, g, null, a, o, l), p = g = m = null), y = !0, v = !0, i = !0) : v ? (v = !1, i = !0) : wr(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, !Lv(t, r, Jue, !1, !0)) + if (a = t.line, o = t.lineStart, l = t.position, !Ev(t, r, Vue, !1, !0)) break; if (t.line === s) { - for (b = t.input.charCodeAt(t.position); ag(b); ) + for (b = t.input.charCodeAt(t.position); rg(b); ) b = t.input.charCodeAt(++t.position); if (b === 58) - b = t.input.charCodeAt(++t.position), jo(b) || wr(t, "a whitespace character is expected after the key-value separator within a block mapping"), v && (w1(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), Go(b) || wr(t, "a whitespace character is expected after the key-value separator within a block mapping"), v && (v1(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) wr(t, "can not read an implicit mapping pair; a colon is missed"); else @@ -29624,14 +29624,14 @@ function KIe(t, e, r) { 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), Lv(t, e, JT, !0, i) && (v ? g = t.result : m = t.result), v || (w1(t, f, d, p, g, m, a, o, l), p = g = m = null), es(t, !0, -1), b = t.input.charCodeAt(t.position)), (t.line === s || t.lineIndent > e) && b !== 0) + if ((t.line === s || t.lineIndent > e) && (v && (a = t.line, o = t.lineStart, l = t.position), Ev(t, e, ZT, !0, i) && (v ? g = t.result : m = t.result), v || (v1(t, f, d, p, g, m, a, o, l), p = g = m = null), Ki(t, !0, -1), b = t.input.charCodeAt(t.position)), (t.line === s || t.lineIndent > e) && b !== 0) wr(t, "bad indentation of a mapping entry"); else if (t.lineIndent < e) break; } - return v && w1(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 && v1(t, f, d, p, g, null, a, o, l), y && (t.tag = u, t.anchor = h, t.kind = "mapping", t.result = f), y; } -function JIe(t) { +function qIe(t) { var e, r = !1, n = !1, i, s, a; if (a = t.input.charCodeAt(t.position), a !== 33) return !1; @@ -29641,40 +29641,40 @@ function JIe(t) { while (a !== 0 && a !== 62); t.position < t.length ? (s = t.input.slice(e, t.position), a = t.input.charCodeAt(++t.position)) : wr(t, "unexpected end of the stream within a verbatim tag"); } else { - for (; a !== 0 && !jo(a); ) - a === 33 && (n ? wr(t, "tag suffix cannot contain exclamation marks") : (i = t.input.slice(e - 1, t.position + 1), the.test(i) || wr(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), qIe.test(s) && wr(t, "tag suffix cannot contain flow indicator characters"); + for (; a !== 0 && !Go(a); ) + a === 33 && (n ? wr(t, "tag suffix cannot contain exclamation marks") : (i = t.input.slice(e - 1, t.position + 1), Yue.test(i) || wr(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), AIe.test(s) && wr(t, "tag suffix cannot contain flow indicator characters"); } - s && !rhe.test(s) && wr(t, "tag name cannot contain such characters: " + s); + s && !Gue.test(s) && wr(t, "tag name cannot contain such characters: " + s); try { s = decodeURIComponent(s); } catch { wr(t, "tag name is malformed: " + s); } - return r ? t.tag = s : wp.call(t.tagMap, i) ? t.tag = t.tagMap[i] + s : i === "!" ? t.tag = "!" + s : i === "!!" ? t.tag = "tag:yaml.org,2002:" + s : wr(t, 'undeclared tag handle "' + i + '"'), !0; + return r ? t.tag = s : mp.call(t.tagMap, i) ? t.tag = t.tagMap[i] + s : i === "!" ? t.tag = "!" + s : i === "!!" ? t.tag = "tag:yaml.org,2002:" + s : wr(t, 'undeclared tag handle "' + i + '"'), !0; } -function e$e(t) { +function UIe(t) { var e, r; if (r = t.input.charCodeAt(t.position), r !== 38) return !1; - for (t.anchor !== null && wr(t, "duplication of an anchor property"), r = t.input.charCodeAt(++t.position), e = t.position; r !== 0 && !jo(r) && !x1(r); ) + for (t.anchor !== null && wr(t, "duplication of an anchor property"), r = t.input.charCodeAt(++t.position), e = t.position; r !== 0 && !Go(r) && !m1(r); ) r = t.input.charCodeAt(++t.position); return t.position === e && wr(t, "name of an anchor node must contain at least one character"), t.anchor = t.input.slice(e, t.position), !0; } -function t$e(t) { +function QIe(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 && !jo(n) && !x1(n); ) + for (n = t.input.charCodeAt(++t.position), e = t.position; n !== 0 && !Go(n) && !m1(n); ) n = t.input.charCodeAt(++t.position); - return t.position === e && wr(t, "name of an alias node must contain at least one character"), r = t.input.slice(e, t.position), wp.call(t.anchorMap, r) || wr(t, 'unidentified alias "' + r + '"'), t.result = t.anchorMap[r], es(t, !0, -1), !0; + return t.position === e && wr(t, "name of an alias node must contain at least one character"), r = t.input.slice(e, t.position), mp.call(t.anchorMap, r) || wr(t, 'unidentified alias "' + r + '"'), t.result = t.anchorMap[r], Ki(t, !0, -1), !0; } -function Lv(t, e, r, n, i) { +function Ev(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 = JT === r || ehe === r, n && es(t, !0, -1) && (u = !0, t.lineIndent > e ? l = 1 : t.lineIndent === e ? l = 0 : t.lineIndent < e && (l = -1)), l === 1) - for (; JIe(t) || e$e(t); ) - es(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 || JT === r) && (KT === r || Jue === r ? m = e : m = e + 1, v = t.position - t.lineStart, l === 1 ? o && (iH(t, v) || KIe(t, v, m)) || jIe(t, m) ? h = !0 : (a && ZIe(t, m) || HIe(t, m) || XIe(t, m) ? h = !0 : t$e(t) ? (h = !0, (t.tag !== null || t.anchor !== null) && wr(t, "alias node should not have any properties")) : GIe(t, m, KT === r) && (h = !0, t.tag === null && (t.tag = "?")), t.anchor !== null && (t.anchorMap[t.anchor] = t.result)) : l === 0 && (h = o && iH(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 = ZT === r || Wue === r, n && Ki(t, !0, -1) && (u = !0, t.lineIndent > e ? l = 1 : t.lineIndent === e ? l = 0 : t.lineIndent < e && (l = -1)), l === 1) + for (; qIe(t) || UIe(t); ) + Ki(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 || ZT === r) && (jT === r || Vue === r ? m = e : m = e + 1, v = t.position - t.lineStart, l === 1 ? o && (WG(t, v) || zIe(t, v, m)) || BIe(t, m) ? h = !0 : (a && FIe(t, m) || IIe(t, m) || $Ie(t, m) ? h = !0 : QIe(t) ? (h = !0, (t.tag !== null || t.anchor !== null) && wr(t, "alias node should not have any properties")) : NIe(t, m, jT === r) && (h = !0, t.tag === null && (t.tag = "?")), t.anchor !== null && (t.anchorMap[t.anchor] = t.result)) : l === 0 && (h = o && WG(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" && wr(t, 'unacceptable node kind for ! tag; it should be "scalar", not "' + t.kind + '"'), f = 0, d = t.implicitTypes.length; f < d; f += 1) @@ -29683,7 +29683,7 @@ function Lv(t, e, r, n, i) { break; } } else if (t.tag !== "!") { - if (wp.call(t.typeMap[t.kind || "fallback"], t.tag)) + if (mp.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) @@ -29695,30 +29695,30 @@ function Lv(t, e, r, n, i) { } return t.listener !== null && t.listener("close", t), t.tag !== null || t.anchor !== null || h; } -function r$e(t) { +function VIe(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 && (es(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 && !jo(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 && (Ki(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 && !Go(a); ) a = t.input.charCodeAt(++t.position); for (n = t.input.slice(r, t.position), i = [], n.length < 1 && wr(t, "directive name must not be less than one character in length"); a !== 0; ) { - for (; ag(a); ) + for (; rg(a); ) a = t.input.charCodeAt(++t.position); if (a === 35) { do a = t.input.charCodeAt(++t.position); - while (a !== 0 && !uh(a)); + while (a !== 0 && !oh(a)); break; } - if (uh(a)) + if (oh(a)) break; - for (r = t.position; a !== 0 && !jo(a); ) + for (r = t.position; a !== 0 && !Go(a); ) a = t.input.charCodeAt(++t.position); i.push(t.input.slice(r, t.position)); } - a !== 0 && dF(t), wp.call(rH, n) ? rH[n](t, n, i) : eC(t, 'unknown document directive "' + n + '"'); + a !== 0 && tF(t), mp.call(QG, n) ? QG[n](t, n, i) : KT(t, 'unknown document directive "' + n + '"'); } - if (es(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, es(t, !0, -1)) : s && wr(t, "directives end mark is expected"), Lv(t, t.lineIndent - 1, JT, !1, !0), es(t, !0, -1), t.checkLineBreaks && zIe.test(t.input.slice(e, t.position)) && eC(t, "non-ASCII line breaks are interpreted as content"), t.documents.push(t.result), t.position === t.lineStart && O6(t)) { - t.input.charCodeAt(t.position) === 46 && (t.position += 3, es(t, !0, -1)); + if (Ki(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, Ki(t, !0, -1)) : s && wr(t, "directives end mark is expected"), Ev(t, t.lineIndent - 1, ZT, !1, !0), Ki(t, !0, -1), t.checkLineBreaks && _Ie.test(t.input.slice(e, t.position)) && KT(t, "non-ASCII line breaks are interpreted as content"), t.documents.push(t.result), t.position === t.lineStart && y6(t)) { + t.input.charCodeAt(t.position) === 46 && (t.position += 3, Ki(t, !0, -1)); return; } if (t.position < t.length - 1) @@ -29726,52 +29726,52 @@ function r$e(t) { else return; } -function ahe(t, e) { +function Zue(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 YIe(t, e), n = t.indexOf("\0"); + var r = new PIe(t, e), n = t.indexOf("\0"); for (n !== -1 && (r.position = n, wr(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; ) - r$e(r); + VIe(r); return r.documents; } -function n$e(t, e, r) { +function WIe(t, e, r) { e !== null && typeof e == "object" && typeof r > "u" && (r = e, e = null); - var n = ahe(t, r); + var n = Zue(t, r); if (typeof e != "function") return n; for (var i = 0, s = n.length; i < s; i += 1) e(n[i]); } -function i$e(t, e) { - var r = ahe(t, e); +function YIe(t, e) { + var r = Zue(t, e); if (r.length !== 0) { if (r.length === 1) return r[0]; - throw new lo("expected a single document in the stream, but found more"); - } -} -var s$e = n$e, a$e = i$e, ohe = { - loadAll: s$e, - load: a$e -}, lhe = Object.prototype.toString, che = Object.prototype.hasOwnProperty, gF = 65279, o$e = 9, xw = 10, l$e = 13, c$e = 32, u$e = 33, h$e = 34, tD = 35, f$e = 37, d$e = 38, p$e = 39, g$e = 42, uhe = 44, m$e = 45, tC = 58, v$e = 61, y$e = 62, b$e = 63, x$e = 64, hhe = 91, fhe = 93, w$e = 96, dhe = 123, O$e = 124, phe = 125, Ha = {}; -Ha[0] = "\\0"; -Ha[7] = "\\a"; -Ha[8] = "\\b"; -Ha[9] = "\\t"; -Ha[10] = "\\n"; -Ha[11] = "\\v"; -Ha[12] = "\\f"; -Ha[13] = "\\r"; -Ha[27] = "\\e"; -Ha[34] = '\\"'; -Ha[92] = "\\\\"; -Ha[133] = "\\N"; -Ha[160] = "\\_"; -Ha[8232] = "\\L"; -Ha[8233] = "\\P"; -var k$e = [ + throw new so("expected a single document in the stream, but found more"); + } +} +var GIe = WIe, HIe = YIe, Kue = { + loadAll: GIe, + load: HIe +}, Jue = Object.prototype.toString, ehe = Object.prototype.hasOwnProperty, nF = 65279, XIe = 9, yw = 10, jIe = 13, ZIe = 32, KIe = 33, JIe = 34, j9 = 35, e$e = 37, t$e = 38, r$e = 39, n$e = 42, the = 44, i$e = 45, JT = 58, s$e = 61, a$e = 62, o$e = 63, l$e = 64, rhe = 91, nhe = 93, c$e = 96, ihe = 123, u$e = 124, she = 125, Wa = {}; +Wa[0] = "\\0"; +Wa[7] = "\\a"; +Wa[8] = "\\b"; +Wa[9] = "\\t"; +Wa[10] = "\\n"; +Wa[11] = "\\v"; +Wa[12] = "\\f"; +Wa[13] = "\\r"; +Wa[27] = "\\e"; +Wa[34] = '\\"'; +Wa[92] = "\\\\"; +Wa[133] = "\\N"; +Wa[160] = "\\_"; +Wa[8232] = "\\L"; +Wa[8233] = "\\P"; +var h$e = [ "y", "Y", "yes", @@ -29788,16 +29788,16 @@ var k$e = [ "off", "Off", "OFF" -], S$e = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/; -function T$e(t, e) { +], f$e = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/; +function d$e(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 && che.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 && ehe.call(l.styleAliases, o) && (o = l.styleAliases[o]), r[a] = o; return r; } -function C$e(t) { +function p$e(t) { var e, r, n; if (e = t.toString(16).toUpperCase(), t <= 255) r = "x", n = 2; @@ -29806,90 +29806,90 @@ function C$e(t) { else if (t <= 4294967295) r = "U", n = 8; else - throw new lo("code point within a string may not be greater than 0xFFFFFFFF"); - return "\\" + r + gs.repeat("0", n - e.length) + e; + throw new so("code point within a string may not be greater than 0xFFFFFFFF"); + return "\\" + r + ds.repeat("0", n - e.length) + e; } -var E$e = 1, ww = 2; -function _$e(t) { - this.schema = t.schema || fF, this.indent = Math.max(1, t.indent || 2), this.noArrayIndent = t.noArrayIndent || !1, this.skipInvalid = t.skipInvalid || !1, this.flowLevel = gs.isNothing(t.flowLevel) ? -1 : t.flowLevel, this.styleMap = T$e(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 === '"' ? ww : E$e, 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 g$e = 1, bw = 2; +function m$e(t) { + this.schema = t.schema || eF, this.indent = Math.max(1, t.indent || 2), this.noArrayIndent = t.noArrayIndent || !1, this.skipInvalid = t.skipInvalid || !1, this.flowLevel = ds.isNothing(t.flowLevel) ? -1 : t.flowLevel, this.styleMap = d$e(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 === '"' ? bw : g$e, 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 sH(t, e) { - for (var r = gs.repeat(" ", e), n = 0, i = -1, s = "", a, o = t.length; n < o; ) +function YG(t, e) { + for (var r = ds.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 rD(t, e) { +function Z9(t, e) { return ` -` + gs.repeat(" ", t.indent * e); +` + ds.repeat(" ", t.indent * e); } -function A$e(t, e) { +function v$e(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 rC(t) { - return t === c$e || t === o$e; +function eC(t) { + return t === ZIe || t === XIe; } -function Ow(t) { - return 32 <= t && t <= 126 || 161 <= t && t <= 55295 && t !== 8232 && t !== 8233 || 57344 <= t && t <= 65533 && t !== gF || 65536 <= t && t <= 1114111; +function xw(t) { + return 32 <= t && t <= 126 || 161 <= t && t <= 55295 && t !== 8232 && t !== 8233 || 57344 <= t && t <= 65533 && t !== nF || 65536 <= t && t <= 1114111; } -function aH(t) { - return Ow(t) && t !== gF && t !== l$e && t !== xw; +function GG(t) { + return xw(t) && t !== nF && t !== jIe && t !== yw; } -function oH(t, e, r) { - var n = aH(t), i = n && !rC(t); - return (r ? n : n && t !== uhe && t !== hhe && t !== fhe && t !== dhe && t !== phe) && t !== tD && !(e === tC && !i) || aH(e) && !rC(e) && t === tD || e === tC && i; +function HG(t, e, r) { + var n = GG(t), i = n && !eC(t); + return (r ? n : n && t !== the && t !== rhe && t !== nhe && t !== ihe && t !== she) && t !== j9 && !(e === JT && !i) || GG(e) && !eC(e) && t === j9 || e === JT && i; } -function R$e(t) { - return Ow(t) && t !== gF && !rC(t) && t !== m$e && t !== b$e && t !== tC && t !== uhe && t !== hhe && t !== fhe && t !== dhe && t !== phe && t !== tD && t !== d$e && t !== g$e && t !== u$e && t !== O$e && t !== v$e && t !== y$e && t !== p$e && t !== h$e && t !== f$e && t !== x$e && t !== w$e; +function y$e(t) { + return xw(t) && t !== nF && !eC(t) && t !== i$e && t !== o$e && t !== JT && t !== the && t !== rhe && t !== nhe && t !== ihe && t !== she && t !== j9 && t !== t$e && t !== n$e && t !== KIe && t !== u$e && t !== s$e && t !== a$e && t !== r$e && t !== JIe && t !== e$e && t !== l$e && t !== c$e; } -function L$e(t) { - return !rC(t) && t !== tC; +function b$e(t) { + return !eC(t) && t !== JT; } -function Mb(t, e) { +function Lb(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 ghe(t) { +function ahe(t) { var e = /^\n* /; return e.test(t); } -var mhe = 1, nD = 2, vhe = 3, yhe = 4, c1 = 5; -function M$e(t, e, r, n, i, s, a, o) { - var l, u = 0, h = null, f = !1, d = !1, p = n !== -1, g = -1, m = R$e(Mb(t, 0)) && L$e(Mb(t, t.length - 1)); +var ohe = 1, K9 = 2, lhe = 3, che = 4, a1 = 5; +function x$e(t, e, r, n, i, s, a, o) { + var l, u = 0, h = null, f = !1, d = !1, p = n !== -1, g = -1, m = y$e(Lb(t, 0)) && b$e(Lb(t, t.length - 1)); if (e || a) for (l = 0; l < t.length; u >= 65536 ? l += 2 : l++) { - if (u = Mb(t, l), !Ow(u)) - return c1; - m = m && oH(u, h, o), h = u; + if (u = Lb(t, l), !xw(u)) + return a1; + m = m && HG(u, h, o), h = u; } else { for (l = 0; l < t.length; u >= 65536 ? l += 2 : l++) { - if (u = Mb(t, l), u === xw) + if (u = Lb(t, l), u === yw) f = !0, p && (d = d || l - g - 1 > n && t[g + 1] !== " ", g = l); - else if (!Ow(u)) - return c1; - m = m && oH(u, h, o), h = u; + else if (!xw(u)) + return a1; + m = m && HG(u, h, o), h = u; } d = d || p && l - g - 1 > n && t[g + 1] !== " "; } - return !f && !d ? m && !a && !i(t) ? mhe : s === ww ? c1 : nD : r > 9 && ghe(t) ? c1 : a ? s === ww ? c1 : nD : d ? yhe : vhe; + return !f && !d ? m && !a && !i(t) ? ohe : s === bw ? a1 : K9 : r > 9 && ahe(t) ? a1 : a ? s === bw ? a1 : K9 : d ? che : lhe; } -function D$e(t, e, r, n, i) { +function w$e(t, e, r, n, i) { t.dump = function() { if (e.length === 0) - return t.quotingType === ww ? '""' : "''"; - if (!t.noCompatMode && (k$e.indexOf(e) !== -1 || S$e.test(e))) - return t.quotingType === ww ? '"' + e + '"' : "'" + e + "'"; + return t.quotingType === bw ? '""' : "''"; + if (!t.noCompatMode && (h$e.indexOf(e) !== -1 || f$e.test(e))) + return t.quotingType === bw ? '"' + 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 A$e(t, u); + return v$e(t, u); } - switch (M$e( + switch (x$e( e, o, t.indent, @@ -29899,47 +29899,47 @@ function D$e(t, e, r, n, i) { t.forceQuotes && !n, i )) { - case mhe: + case ohe: return e; - case nD: + case K9: return "'" + e.replace(/'/g, "''") + "'"; - case vhe: - return "|" + lH(e, t.indent) + cH(sH(e, s)); - case yhe: - return ">" + lH(e, t.indent) + cH(sH(P$e(e, a), s)); - case c1: - return '"' + N$e(e) + '"'; + case lhe: + return "|" + XG(e, t.indent) + jG(YG(e, s)); + case che: + return ">" + XG(e, t.indent) + jG(YG(O$e(e, a), s)); + case a1: + return '"' + k$e(e) + '"'; default: - throw new lo("impossible error: invalid scalar style"); + throw new so("impossible error: invalid scalar style"); } }(); } -function lH(t, e) { - var r = ghe(t) ? String(e) : "", n = t[t.length - 1] === ` +function XG(t, e) { + var r = ahe(t) ? String(e) : "", n = t[t.length - 1] === ` `, i = n && (t[t.length - 2] === ` ` || t === ` `), s = i ? "+" : n ? "" : "-"; return r + s + ` `; } -function cH(t) { +function jG(t) { return t[t.length - 1] === ` ` ? t.slice(0, -1) : t; } -function P$e(t, e) { +function O$e(t, e) { for (var r = /(\n+)([^\n]*)/g, n = function() { var u = t.indexOf(` `); - return u = u !== -1 ? u : t.length, r.lastIndex = u, uH(t.slice(0, u), e); + return u = u !== -1 ? u : t.length, r.lastIndex = u, ZG(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 !== "" ? ` -` : "") + uH(l, e), i = s; +` : "") + ZG(l, e), i = s; } return n; } -function uH(t, e) { +function ZG(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); ) @@ -29949,78 +29949,78 @@ function uH(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 N$e(t) { +function k$e(t) { for (var e = "", r = 0, n, i = 0; i < t.length; r >= 65536 ? i += 2 : i++) - r = Mb(t, i), n = Ha[r], !n && Ow(r) ? (e += t[i], r >= 65536 && (e += t[i + 1])) : e += n || C$e(r); + r = Lb(t, i), n = Wa[r], !n && xw(r) ? (e += t[i], r >= 65536 && (e += t[i + 1])) : e += n || p$e(r); return e; } -function I$e(t, e, r) { +function S$e(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)), (Lf(t, e, o, !1, !1) || typeof o > "u" && Lf(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)), (Af(t, e, o, !1, !1) || typeof o > "u" && Af(t, e, null, !1, !1)) && (n !== "" && (n += "," + (t.condenseFlow ? "" : " ")), n += t.dump); t.tag = i, t.dump = "[" + n + "]"; } -function hH(t, e, r, n) { +function KG(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)), (Lf(t, e + 1, l, !0, !0, !1, !0) || typeof l > "u" && Lf(t, e + 1, null, !0, !0, !1, !0)) && ((!n || i !== "") && (i += rD(t, e)), t.dump && xw === t.dump.charCodeAt(0) ? i += "-" : i += "- ", i += t.dump); + l = r[a], t.replacer && (l = t.replacer.call(r, String(a), l)), (Af(t, e + 1, l, !0, !0, !1, !0) || typeof l > "u" && Af(t, e + 1, null, !0, !0, !1, !0)) && ((!n || i !== "") && (i += Z9(t, e)), t.dump && yw === t.dump.charCodeAt(0) ? i += "-" : i += "- ", i += t.dump); t.tag = s, t.dump = i || "[]"; } -function $$e(t, e, r) { +function T$e(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)), Lf(t, e, l, !1, !1) && (t.dump.length > 1024 && (h += "? "), h += t.dump + (t.condenseFlow ? '"' : "") + ":" + (t.condenseFlow ? "" : " "), Lf(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)), Af(t, e, l, !1, !1) && (t.dump.length > 1024 && (h += "? "), h += t.dump + (t.condenseFlow ? '"' : "") + ":" + (t.condenseFlow ? "" : " "), Af(t, e, u, !1, !1) && (h += t.dump, n += h)); t.tag = i, t.dump = "{" + n + "}"; } -function B$e(t, e, r, n) { +function C$e(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 lo("sortKeys must be a boolean or a function"); + throw new so("sortKeys must be a boolean or a function"); for (o = 0, l = a.length; o < l; o += 1) - d = "", (!n || i !== "") && (d += rD(t, e)), u = a[o], h = r[u], t.replacer && (h = t.replacer.call(r, u, h)), Lf(t, e + 1, u, !0, !0, !0) && (f = t.tag !== null && t.tag !== "?" || t.dump && t.dump.length > 1024, f && (t.dump && xw === t.dump.charCodeAt(0) ? d += "?" : d += "? "), d += t.dump, f && (d += rD(t, e)), Lf(t, e + 1, h, !0, f) && (t.dump && xw === t.dump.charCodeAt(0) ? d += ":" : d += ": ", d += t.dump, i += d)); + d = "", (!n || i !== "") && (d += Z9(t, e)), u = a[o], h = r[u], t.replacer && (h = t.replacer.call(r, u, h)), Af(t, e + 1, u, !0, !0, !0) && (f = t.tag !== null && t.tag !== "?" || t.dump && t.dump.length > 1024, f && (t.dump && yw === t.dump.charCodeAt(0) ? d += "?" : d += "? "), d += t.dump, f && (d += Z9(t, e)), Af(t, e + 1, h, !0, f) && (t.dump && yw === t.dump.charCodeAt(0) ? d += ":" : d += ": ", d += t.dump, i += d)); t.tag = s, t.dump = i || "{}"; } -function fH(t, e, r) { +function JG(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, lhe.call(o.represent) === "[object Function]") + if (l = t.styleMap[o.tag] || o.defaultStyle, Jue.call(o.represent) === "[object Function]") n = o.represent(e, l); - else if (che.call(o.represent, l)) + else if (ehe.call(o.represent, l)) n = o.represent[l](e, l); else - throw new lo("!<" + o.tag + '> tag resolver accepts not "' + l + '" style'); + throw new so("!<" + o.tag + '> tag resolver accepts not "' + l + '" style'); t.dump = n; } return !0; } return !1; } -function Lf(t, e, r, n, i, s, a) { - t.tag = null, t.dump = r, fH(t, r, !1) || fH(t, r, !0); - var o = lhe.call(t.dump), l = n, u; +function Af(t, e, r, n, i, s, a) { + t.tag = null, t.dump = r, JG(t, r, !1) || JG(t, r, !0); + var o = Jue.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 ? (B$e(t, e, t.dump, i), d && (t.dump = "&ref_" + f + t.dump)) : ($$e(t, e, t.dump), d && (t.dump = "&ref_" + f + " " + t.dump)); + n && Object.keys(t.dump).length !== 0 ? (C$e(t, e, t.dump, i), d && (t.dump = "&ref_" + f + t.dump)) : (T$e(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 ? hH(t, e - 1, t.dump, i) : hH(t, e, t.dump, i), d && (t.dump = "&ref_" + f + t.dump)) : (I$e(t, e, t.dump), d && (t.dump = "&ref_" + f + " " + t.dump)); + n && t.dump.length !== 0 ? (t.noArrayIndent && !a && e > 0 ? KG(t, e - 1, t.dump, i) : KG(t, e, t.dump, i), d && (t.dump = "&ref_" + f + t.dump)) : (S$e(t, e, t.dump), d && (t.dump = "&ref_" + f + " " + t.dump)); else if (o === "[object String]") - t.tag !== "?" && D$e(t, t.dump, e, s, l); + t.tag !== "?" && w$e(t, t.dump, e, s, l); else { if (o === "[object Undefined]") return !1; if (t.skipInvalid) return !1; - throw new lo("unacceptable kind of an object to dump " + o); + throw new so("unacceptable kind of an object to dump " + o); } t.tag !== null && t.tag !== "?" && (u = encodeURI( t.tag[0] === "!" ? t.tag.slice(1) : t.tag @@ -30028,71 +30028,71 @@ function Lf(t, e, r, n, i, s, a) { } return !0; } -function F$e(t, e) { +function E$e(t, e) { var r = [], n = [], i, s; - for (iD(t, r, n), i = 0, s = n.length; i < s; i += 1) + for (J9(t, r, n), i = 0, s = n.length; i < s; i += 1) e.duplicates.push(r[n[i]]); e.usedDuplicates = new Array(s); } -function iD(t, e, r) { +function J9(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) - iD(t[i], e, r); + J9(t[i], e, r); else for (n = Object.keys(t), i = 0, s = n.length; i < s; i += 1) - iD(t[n[i]], e, r); + J9(t[n[i]], e, r); } -function z$e(t, e) { +function _$e(t, e) { e = e || {}; - var r = new _$e(e); - r.noRefs || F$e(t, r); + var r = new m$e(e); + r.noRefs || E$e(t, r); var n = t; - return r.replacer && (n = r.replacer.call({ "": n }, "", n)), Lf(r, 0, n, !0, !0) ? r.dump + ` + return r.replacer && (n = r.replacer.call({ "": n }, "", n)), Af(r, 0, n, !0, !0) ? r.dump + ` ` : ""; } -var q$e = z$e, U$e = { - dump: q$e +var A$e = _$e, R$e = { + dump: A$e }; -function mF(t, e) { +function iF(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 Q$e = ha, V$e = Pue, W$e = Bue, Y$e = Que, G$e = Vue, H$e = fF, X$e = ohe.load, j$e = ohe.loadAll, Z$e = U$e.dump, K$e = lo, J$e = { - binary: Xue, - float: Uue, - map: $ue, - null: Fue, - pairs: Zue, - set: Kue, - timestamp: Gue, - bool: zue, - int: que, - merge: Hue, - omap: jue, - seq: Iue, - str: Nue -}, eBe = mF("safeLoad", "load"), tBe = mF("safeLoadAll", "loadAll"), rBe = mF("safeDump", "dump"), nBe = { - Type: Q$e, - Schema: V$e, - FAILSAFE_SCHEMA: W$e, - JSON_SCHEMA: Y$e, - CORE_SCHEMA: G$e, - DEFAULT_SCHEMA: H$e, - load: X$e, - loadAll: j$e, - dump: Z$e, - YAMLException: K$e, - types: J$e, - safeLoad: eBe, - safeLoadAll: tBe, - safeDump: rBe -}; -function iBe(t, e, r, n, i, s = !0) { +var L$e = ua, M$e = Tue, D$e = Aue, P$e = Pue, N$e = Nue, I$e = eF, $$e = Kue.load, B$e = Kue.loadAll, F$e = R$e.dump, z$e = so, q$e = { + binary: zue, + float: Due, + map: _ue, + null: Rue, + pairs: Uue, + set: Que, + timestamp: Bue, + bool: Lue, + int: Mue, + merge: Fue, + omap: que, + seq: Eue, + str: Cue +}, U$e = iF("safeLoad", "load"), Q$e = iF("safeLoadAll", "loadAll"), V$e = iF("safeDump", "dump"), W$e = { + Type: L$e, + Schema: M$e, + FAILSAFE_SCHEMA: D$e, + JSON_SCHEMA: P$e, + CORE_SCHEMA: N$e, + DEFAULT_SCHEMA: I$e, + load: $$e, + loadAll: B$e, + dump: F$e, + YAMLException: z$e, + types: q$e, + safeLoad: U$e, + safeLoadAll: Q$e, + safeDump: V$e +}; +function Y$e(t, e, r, n, i, s = !0) { const a = []; for (const l of [...t.core.ruler.__rules__].reverse()) { if (l.name === e) { @@ -30112,7 +30112,7 @@ function iBe(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 ed { +class Kf { 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; } @@ -30132,21 +30132,21 @@ class ed { 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 iBe(this.state.md, "run_directives", e, this.state.env, r, !0); + return Y$e(this.state.md, "run_directives", e, this.state.env, r, !0); } } -class Id extends Error { +class Dd extends Error { constructor() { super(...arguments), this.name = "DirectiveParsingError"; } } -function sBe(t, e) { +function G$e(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] = bhe(i, e)); + (Object.keys(e.option_spec || {}) || e.rawOptions) && ([i, a, s] = uhe(i, e)); let o = []; - if (!e.required_arguments && !e.optional_arguments ? r && (s = 0, i = [r].concat(i)) : o = aBe(r, e), i.length && !i[0].trim() && (i.shift(), s++), i.length && !e.has_content) - throw new Id("Has content but content not allowed"); + if (!e.required_arguments && !e.optional_arguments ? r && (s = 0, i = [r].concat(i)) : o = H$e(r, e), i.length && !i[0].trim() && (i.shift(), s++), i.length && !e.has_content) + throw new Dd("Has content but content not allowed"); return { map: t.map ? t.map : [0, 0], args: o, @@ -30159,7 +30159,7 @@ function sBe(t, e) { ] : [0, 0] }; } -function bhe(t, e) { +function uhe(t, e) { let r = 1, n = {}, i = null; if (t.length && t[0].startsWith("---")) { r++; @@ -30189,51 +30189,51 @@ function bhe(t, e) { } if (i !== null) try { - const s = nBe.load(i.join(` + const s = W$e.load(i.join(` `)); if (s !== null && typeof s == "object") n = s; else - throw new Id(`not dict: ${s}`); + throw new Dd(`not dict: ${s}`); } catch (s) { - throw new Id(`Invalid options YAML: ${s}`); + throw new Dd(`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 Id(`Unknown option: ${s}`); + throw new Dd(`Unknown option: ${s}`); let l = a; (a === null || a === !1) && (l = ""); try { l = o(`${l || ""}`); } catch (u) { - throw new Id(`Invalid option value: (option: '${s}'; value: ${a}) + throw new Dd(`Invalid option value: (option: '${s}'; value: ${a}) ${u}`); } n[s] = l; } return [t, n, r]; } -function aBe(t, e) { +function H$e(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 Id(`${e.required_arguments} argument(s) required, ${n.length} supplied`); + throw new Dd(`${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 Id(`maximum ${i} argument(s) allowed, ${n.length} supplied`); + throw new Dd(`maximum ${i} argument(s) allowed, ${n.length} supplied`); return n; } -function xhe(t, e) { +function hhe(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", oBe), n = "fence_to_directive"), t.core.ruler.after(n, "run_directives", lBe(e.directives || {})), t.renderer.rules.directive = (i, s) => { + (!((r = e.replaceFences) !== null && r !== void 0) || r) && (t.core.ruler.after(n, "fence_to_directive", X$e), n = "fence_to_directive"), t.core.ruler.after(n, "run_directives", j$e(e.directives || {})), t.renderer.rules.directive = (i, s) => { const a = i[s]; return ` `; }; } -function oBe(t) { +function X$e(t) { for (const e of t.tokens) if (e.type === "fence" || e.type === "colon_fence") { const r = e.info.match(/^\{([^\s}]+)\}\s*(.*)$/); @@ -30260,13 +30260,13 @@ function oBe(t) { } return !0; } -function lBe(t) { +function j$e(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 = sBe(i, s), [o, l] = bhe(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 = G$e(i, s), [o, l] = uhe(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, @@ -30286,64 +30286,64 @@ function lBe(t) { } return e; } -function cBe(t) { +function Z$e(t) { return t.toLowerCase().split(/\s+/).join("-").replace(/[^a-z0-9]+/, "-").replace(/^[-0-9]+|-+$/, ""); } -class Sg extends Error { +class xg extends Error { constructor() { super(...arguments), this.name = "OptionSpecError"; } } -const bh = (t) => t, nC = (t) => { +const mh = (t) => t, tC = (t) => { if (!t) - throw new Sg("Argument required but none supplied"); + throw new xg("Argument required but none supplied"); return t; -}, sD = (t) => { +}, eD = (t) => { if (t.trim()) - throw new Sg(`No argument is allowed: "${t}" supplied`); + throw new xg(`No argument is allowed: "${t}" supplied`); return null; -}, Hp = (t) => `${t || ""}`.split(/\s+/).map((e) => cBe(e)); -function whe(t) { +}, Up = (t) => `${t || ""}`.split(/\s+/).map((e) => Z$e(e)); +function fhe(t) { if (!t) - throw new Sg("Value is not set"); + throw new xg("Value is not set"); const e = Number.parseFloat(t); if (Number.isNaN(e) || !Number.isInteger(e)) - throw new Sg(`Value "${t}" is not an integer`); + throw new xg(`Value "${t}" is not an integer`); return e; } -function iC(t) { - const e = whe(t); +function rC(t) { + const e = fhe(t); if (e < 0) - throw new Sg(`Value "${t}" must be positive or zero`); + throw new xg(`Value "${t}" must be positive or zero`); return e; } -const Ohe = (t) => t ? iC(t) : null, khe = (t) => (t = `${t || ""}`.replace(/\s+%$/, ""), iC(t)); -function She(t, e) { +const dhe = (t) => t ? rC(t) : null, phe = (t) => (t = `${t || ""}`.replace(/\s+%$/, ""), rC(t)); +function ghe(t, e) { const n = new RegExp(`^(?[0-9.]+)\\s*(?${e.join("|")})$`).exec(t); if (!n || !n.groups) - throw new Sg(`not a positive measure of one of the following units: ${e.join("|")}`); + throw new xg(`not a positive measure of one of the following units: ${e.join("|")}`); return n.groups.number + n.groups.units; } -const The = ["em", "ex", "px", "in", "cm", "mm", "pt", "pc"], vF = (t) => She(t, [...The, ""]), k6 = (t, e = "") => { +const mhe = ["em", "ex", "px", "in", "cm", "mm", "pt", "pc"], sF = (t) => ghe(t, [...mhe, ""]), b6 = (t, e = "") => { try { - return She(t, [...The, "%"]); + return ghe(t, [...mhe, "%"]); } catch { - return vF(t) + e; + return sF(t) + e; } -}, Che = (t, e = "") => t.toLowerCase() === "image" ? "image" : k6(t, e); -function S6(t) { +}, vhe = (t, e = "") => t.toLowerCase() === "image" ? "image" : b6(t, e); +function x6(t) { return (e) => { if (e = e.toLowerCase().trim(), t.includes(e)) return e; - throw new Sg(`must be in: ${t.join("|")}`); + throw new xg(`must be in: ${t.join("|")}`); }; } -const uBe = (t) => t; -class mu extends ed { +const K$e = (t) => t; +class du extends Kf { constructor() { super(...arguments), this.final_argument_whitespace = !0, this.has_content = !0, this.option_spec = { - class: Hp, - name: bh + class: Up, + name: mh }, this.title = "", this.kind = ""; } run(e) { @@ -30366,81 +30366,81 @@ class mu extends ed { return n.push(...o), n.push(this.createToken("admonition_close", "aside", -1, { block: !0 })), n; } } -class hBe extends mu { +class J$e extends du { constructor() { super(...arguments), this.required_arguments = 1; } } -class fBe extends mu { +class eBe extends du { constructor() { super(...arguments), this.title = "Attention", this.kind = "attention"; } } -class dBe extends mu { +class tBe extends du { constructor() { super(...arguments), this.title = "Caution", this.kind = "caution"; } } -class pBe extends mu { +class rBe extends du { constructor() { super(...arguments), this.title = "Danger", this.kind = "danger"; } } -class gBe extends mu { +class nBe extends du { constructor() { super(...arguments), this.title = "Error", this.kind = "error"; } } -class mBe extends mu { +class iBe extends du { constructor() { super(...arguments), this.title = "Important", this.kind = "important"; } } -class vBe extends mu { +class sBe extends du { constructor() { super(...arguments), this.title = "Hint", this.kind = "hint"; } } -class yBe extends mu { +class aBe extends du { constructor() { super(...arguments), this.title = "Note", this.kind = "note"; } } -class bBe extends mu { +class oBe extends du { constructor() { super(...arguments), this.title = "See Also", this.kind = "seealso"; } } -class xBe extends mu { +class lBe extends du { constructor() { super(...arguments), this.title = "Tip", this.kind = "tip"; } } -class wBe extends mu { +class cBe extends du { constructor() { super(...arguments), this.title = "Warning", this.kind = "warning"; } } -const OBe = { - admonition: hBe, - attention: fBe, - caution: dBe, - danger: pBe, - error: gBe, - important: mBe, - hint: vBe, - note: yBe, - seealso: bBe, - tip: xBe, - warning: wBe -}; -class kBe extends ed { +const uBe = { + admonition: J$e, + attention: eBe, + caution: tBe, + danger: rBe, + error: nBe, + important: iBe, + hint: sBe, + note: aBe, + seealso: oBe, + tip: lBe, + warning: cBe +}; +class hBe extends Kf { 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": Ohe, - force: sD, - name: bh, - class: Hp + "number-lines": dhe, + force: eD, + name: mh, + class: Up }; } run(e) { @@ -30451,17 +30451,17 @@ class kBe extends ed { })]; } } -class SBe extends ed { +class fBe extends Kf { constructor() { super(...arguments), this.required_arguments = 0, this.optional_arguments = 1, this.final_argument_whitespace = !1, this.has_content = !0, this.option_spec = { - linenos: sD, - "lineno-start": whe, - dedent: Ohe, - "emphasize-lines": nC, - caption: nC, - force: sD, - name: bh, - class: Hp + linenos: eD, + "lineno-start": fhe, + dedent: dhe, + "emphasize-lines": tC, + caption: tC, + force: eD, + name: mh, + class: Up }; } run(e) { @@ -30472,7 +30472,7 @@ class SBe extends ed { })]; } } -class TBe extends ed { +class dBe extends Kf { constructor() { super(...arguments), this.required_arguments = 0, this.optional_arguments = 1, this.final_argument_whitespace = !1, this.has_content = !0, this.rawOptions = !0; } @@ -30484,25 +30484,25 @@ class TBe extends ed { })]; } } -const CBe = { - code: kBe, - "code-block": SBe, - "code-cell": TBe -}, Ehe = { - alt: bh, - height: vF, - width: k6, - scale: khe, - target: nC, - class: Hp, - name: bh -}; -class _he extends ed { +const pBe = { + code: hBe, + "code-block": fBe, + "code-cell": dBe +}, yhe = { + alt: mh, + height: sF, + width: b6, + scale: phe, + target: tC, + class: Up, + name: mh +}; +class bhe extends Kf { constructor() { - super(...arguments), this.required_arguments = 1, this.optional_arguments = 0, this.final_argument_whitespace = !0, this.option_spec = Object.assign(Object.assign({}, Ehe), { align: S6(["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({}, yhe), { align: x6(["left", "center", "right", "top", "middle", "bottom"]) }); } create_image(e) { - const r = uBe(e.args[0] || ""), n = this.createToken("image", "img", 0, { map: e.map, block: !0 }); + const r = K$e(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; @@ -30511,9 +30511,9 @@ class _he extends ed { return [this.create_image(e)]; } } -class EBe extends _he { +class gBe extends bhe { constructor() { - super(...arguments), this.option_spec = Object.assign(Object.assign({}, Ehe), { align: S6(["left", "center", "right"]), figwidth: Che, figclass: Hp }), this.has_content = !0; + super(...arguments), this.option_spec = Object.assign(Object.assign({}, yhe), { align: x6(["left", "center", "right"]), figwidth: vhe, figclass: Up }), this.has_content = !0; } run(e) { const r = this.createToken("figure_open", "figure", 1, { @@ -30522,10 +30522,10 @@ class EBe extends _he { }); 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 = Rue( + e.options.name && (n = wue( this.state, r, - yw.figure, + mw.figure, e.options.name, e.body.trim() ), r.attrJoin("class", "numbered")); @@ -30558,11 +30558,11 @@ class EBe extends _he { return [r, i, ...s, ...a, o]; } } -const _Be = { - image: _he, - figure: EBe +const mBe = { + image: bhe, + figure: gBe }; -class yF { +class aF { constructor(e, r = !0) { if (this.children = [], this.children = [], r) { this._set_children_from_tokens(e); @@ -30598,7 +30598,7 @@ class yF { } } _add_child(e) { - const r = new yF(e, !1); + const r = new aF(e, !1); r.parent = this, this.children.push(r); } to_tokens() { @@ -30684,23 +30684,23 @@ class yF { return this.attribute_token().attrs; } } -class ABe extends ed { +class vBe extends Kf { 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": iC, - "stub-columns": iC, - width: k6, - widths: bh, - class: Hp, - name: bh, - align: S6(["left", "center", "right"]) + "header-rows": rC, + "stub-columns": rC, + width: b6, + widths: mh, + class: Up, + name: mh, + align: x6(["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 Id("Content is not a single bullet list"); + throw new Dd("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]], @@ -30710,7 +30710,7 @@ class ABe extends ed { 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 yF(n.slice(1, -1)).children) { + for (const u of new aF(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 })); @@ -30723,13 +30723,13 @@ class ABe extends ed { 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 RBe = { - "list-table": ABe +const yBe = { + "list-table": vBe }; -class LBe extends ed { +class bBe extends Kf { constructor() { super(...arguments), this.required_arguments = 0, this.optional_arguments = 0, this.final_argument_whitespace = !1, this.has_content = !0, this.option_spec = { - label: bh + label: mh }; } run(e) { @@ -30741,18 +30741,18 @@ class LBe extends ed { }); if (r.attrSet("class", "math block"), e.options.label) { r.attrSet("id", e.options.label); - const n = Rue(this.state, r, yw.equation, e.options.label, ""); + const n = wue(this.state, r, mw.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 MBe = { - math: LBe -}, bF = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, OBe), _Be), CBe), RBe), MBe); -function DBe(t) { +const xBe = { + math: bBe +}, oF = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, uBe), mBe), pBe), yBe), xBe); +function wBe(t) { return (e) => { - const r = w6(e); + const r = v6(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) @@ -30768,35 +30768,35 @@ function DBe(t) { }), !0; }; } -function PBe(t, e) { - t.core.ruler.push("docutils_number", DBe()); +function OBe(t, e) { + t.core.ruler.push("docutils_number", wBe()); } -const NBe = { +const kBe = { parseRoles: !0, replaceFences: !0, rolesAfter: "inline", directivesAfter: "block", - directives: bF, - roles: $Ne + directives: oF, + roles: TNe }; -function IBe(t, e) { - const r = Object.assign(Object.assign({}, NBe), e); - t.use(Aue, r), t.use(xhe, r), t.use(PBe, r); +function SBe(t, e) { + const r = Object.assign(Object.assign({}, kBe), e); + t.use(xue, r), t.use(hhe, r), t.use(OBe, 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 Ed(t) { - return Ed = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) { +function Sd(t) { + return Sd = 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; - }, Ed(t); + }, Sd(t); } -function aD(t, e) { - return aD = Object.setPrototypeOf || function(n, i) { +function tD(t, e) { + return tD = Object.setPrototypeOf || function(n, i) { return n.__proto__ = i, n; - }, aD(t, e); + }, tD(t, e); } -function $Be() { +function TBe() { if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1; if (typeof Proxy == "function") @@ -30808,117 +30808,117 @@ function $Be() { return !1; } } -function u5(t, e, r) { - return $Be() ? u5 = Reflect.construct : u5 = function(i, s, a) { +function l3(t, e, r) { + return TBe() ? l3 = Reflect.construct : l3 = function(i, s, a) { var o = [null]; o.push.apply(o, s); var l = Function.bind.apply(i, o), u = new l(); - return a && aD(u, a.prototype), u; - }, u5.apply(null, arguments); + return a && tD(u, a.prototype), u; + }, l3.apply(null, arguments); } -function Lc(t) { - return BBe(t) || FBe(t) || zBe(t) || qBe(); +function _c(t) { + return CBe(t) || EBe(t) || _Be(t) || ABe(); } -function BBe(t) { +function CBe(t) { if (Array.isArray(t)) - return oD(t); + return rD(t); } -function FBe(t) { +function EBe(t) { if (typeof Symbol < "u" && t[Symbol.iterator] != null || t["@@iterator"] != null) return Array.from(t); } -function zBe(t, e) { +function _Be(t, e) { if (!!t) { if (typeof t == "string") - return oD(t, e); + return rD(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 oD(t, e); + return rD(t, e); } } -function oD(t, e) { +function rD(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 qBe() { +function ABe() { 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 UBe = Object.hasOwnProperty, dH = Object.setPrototypeOf, QBe = Object.isFrozen, VBe = Object.getPrototypeOf, WBe = Object.getOwnPropertyDescriptor, vo = Object.freeze, hu = Object.seal, YBe = Object.create, Ahe = typeof Reflect < "u" && Reflect, sC = Ahe.apply, lD = Ahe.construct; -sC || (sC = function(e, r, n) { +var RBe = Object.hasOwnProperty, eH = Object.setPrototypeOf, LBe = Object.isFrozen, MBe = Object.getPrototypeOf, DBe = Object.getOwnPropertyDescriptor, po = Object.freeze, lu = Object.seal, PBe = Object.create, xhe = typeof Reflect < "u" && Reflect, nC = xhe.apply, nD = xhe.construct; +nC || (nC = function(e, r, n) { return e.apply(r, n); }); -vo || (vo = function(e) { +po || (po = function(e) { return e; }); -hu || (hu = function(e) { +lu || (lu = function(e) { return e; }); -lD || (lD = function(e, r) { - return u5(e, Lc(r)); +nD || (nD = function(e, r) { + return l3(e, _c(r)); }); -var GBe = gc(Array.prototype.forEach), pH = gc(Array.prototype.pop), H2 = gc(Array.prototype.push), h5 = gc(String.prototype.toLowerCase), G8 = gc(String.prototype.toString), HBe = gc(String.prototype.match), Rc = gc(String.prototype.replace), XBe = gc(String.prototype.indexOf), jBe = gc(String.prototype.trim), ro = gc(RegExp.prototype.test), H8 = ZBe(TypeError); -function gc(t) { +var NBe = fc(Array.prototype.forEach), tH = fc(Array.prototype.pop), V2 = fc(Array.prototype.push), c3 = fc(String.prototype.toLowerCase), q8 = fc(String.prototype.toString), IBe = fc(String.prototype.match), Ec = fc(String.prototype.replace), $Be = fc(String.prototype.indexOf), BBe = fc(String.prototype.trim), Ja = fc(RegExp.prototype.test), U8 = FBe(TypeError); +function fc(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 sC(t, e, n); + return nC(t, e, n); }; } -function ZBe(t) { +function FBe(t) { return function() { for (var e = arguments.length, r = new Array(e), n = 0; n < e; n++) r[n] = arguments[n]; - return lD(t, r); + return nD(t, r); }; } function Gr(t, e, r) { var n; - r = (n = r) !== null && n !== void 0 ? n : h5, dH && dH(t, null); + r = (n = r) !== null && n !== void 0 ? n : c3, eH && eH(t, null); for (var i = e.length; i--; ) { var s = e[i]; if (typeof s == "string") { var a = r(s); - a !== s && (QBe(e) || (e[i] = a), s = a); + a !== s && (LBe(e) || (e[i] = a), s = a); } t[s] = !0; } return t; } -function a0(t) { - var e = YBe(null), r; +function e0(t) { + var e = PBe(null), r; for (r in t) - sC(UBe, t, [r]) === !0 && (e[r] = t[r]); + nC(RBe, t, [r]) === !0 && (e[r] = t[r]); return e; } -function OS(t, e) { +function bS(t, e) { for (; t !== null; ) { - var r = WBe(t, e); + var r = DBe(t, e); if (r) { if (r.get) - return gc(r.get); + return fc(r.get); if (typeof r.value == "function") - return gc(r.value); + return fc(r.value); } - t = VBe(t); + t = MBe(t); } function n(i) { return console.warn("fallback value for", i), null; } return n; } -var gH = vo(["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"]), X8 = vo(["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"]), j8 = vo(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), KBe = vo(["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"]), Z8 = vo(["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"]), JBe = vo(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), mH = vo(["#text"]), vH = vo(["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"]), K8 = vo(["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"]), yH = vo(["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"]), kS = vo(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), eFe = hu(/\{\{[\w\W]*|[\w\W]*\}\}/gm), tFe = hu(/<%[\w\W]*|[\w\W]*%>/gm), rFe = hu(/\${[\w\W]*}/gm), nFe = hu(/^data-[\-\w.\u00B7-\uFFFF]/), iFe = hu(/^aria-[\-\w]+$/), sFe = hu( +var rH = po(["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"]), Q8 = po(["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"]), V8 = po(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), zBe = po(["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"]), W8 = po(["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"]), qBe = po(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), nH = po(["#text"]), iH = po(["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"]), Y8 = po(["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"]), sH = po(["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"]), xS = po(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), UBe = lu(/\{\{[\w\W]*|[\w\W]*\}\}/gm), QBe = lu(/<%[\w\W]*|[\w\W]*%>/gm), VBe = lu(/\${[\w\W]*}/gm), WBe = lu(/^data-[\-\w.\u00B7-\uFFFF]/), YBe = lu(/^aria-[\-\w]+$/), GBe = lu( /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i -), aFe = hu(/^(?:\w+script|data):/i), oFe = hu( +), HBe = lu(/^(?:\w+script|data):/i), XBe = lu( /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g -), lFe = hu(/^html$/i), cFe = function() { +), jBe = lu(/^html$/i), ZBe = function() { return typeof window > "u" ? null : window; -}, uFe = function(e, r) { - if (Ed(e) !== "object" || typeof e.createPolicy != "function") +}, KBe = function(e, r) { + if (Sd(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)); @@ -30936,25 +30936,25 @@ var gH = vo(["a", "abbr", "acronym", "address", "area", "article", "aside", "aud return console.warn("TrustedTypes policy " + s + " could not be created."), null; } }; -function Rhe() { - var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : cFe(), e = function(ye) { - return Rhe(ye); +function whe() { + var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ZBe(), e = function(ye) { + return whe(ye); }; 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 = OS(g, "cloneNode"), v = OS(g, "nextSibling"), y = OS(g, "childNodes"), b = OS(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 = bS(g, "cloneNode"), v = bS(g, "nextSibling"), y = bS(g, "childNodes"), b = bS(g, "parentNode"); if (typeof s == "function") { var w = n.createElement("template"); w.content && w.content.ownerDocument && (n = w.content.ownerDocument); } - var O = uFe(p, r), S = O ? O.createHTML("") : "", C = n, T = C.implementation, L = C.createNodeIterator, E = C.createDocumentFragment, P = C.getElementsByTagName, M = r.importNode, N = {}; + var O = KBe(p, r), S = O ? O.createHTML("") : "", C = n, T = C.implementation, D = C.createNodeIterator, E = C.createDocumentFragment, N = C.getElementsByTagName, P = r.importNode, L = {}; try { - N = a0(n).documentMode ? n.documentMode : {}; + L = e0(n).documentMode ? n.documentMode : {}; } catch { } - var q = {}; - e.isSupported = typeof b == "function" && T && T.createHTMLDocument !== void 0 && N !== 9; - var k = eFe, B = tFe, A = rFe, D = nFe, I = iFe, z = aFe, Y = oFe, W = sFe, Z = null, K = Gr({}, [].concat(Lc(gH), Lc(X8), Lc(j8), Lc(Z8), Lc(mH))), re = null, pe = Gr({}, [].concat(Lc(vH), Lc(K8), Lc(yH), Lc(kS))), ne = Object.seal(Object.create(null, { + var F = {}; + e.isSupported = typeof b == "function" && T && T.createHTMLDocument !== void 0 && L !== 9; + var k = UBe, B = QBe, A = VBe, M = WBe, I = YBe, q = HBe, Y = XBe, W = GBe, Z = null, K = Gr({}, [].concat(_c(rH), _c(Q8), _c(V8), _c(W8), _c(nH))), re = null, pe = Gr({}, [].concat(_c(iH), _c(Y8), _c(sH), _c(xS))), ne = Object.seal(Object.create(null, { tagNameCheck: { writable: !0, configurable: !1, @@ -30973,32 +30973,32 @@ function Rhe() { enumerable: !0, value: !1 } - })), le = null, ge = null, j = !0, oe = !0, ie = !1, ce = !0, we = !1, xe = !1, fe = !1, Ye = !1, Ce = !1, Le = !1, We = !1, je = !0, at = !1, tt = "user-content-", Ge = !0, Re = !1, se = {}, ve = null, Ee = Gr({}, ["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"]), de = null, ke = Gr({}, ["audio", "video", "img", "source", "image", "track"]), H = null, U = Gr({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Q = "http://www.w3.org/1998/Math/MathML", te = "http://www.w3.org/2000/svg", he = "http://www.w3.org/1999/xhtml", Te = he, Se = !1, $e = null, Ie = Gr({}, [Q, te, he], G8), ct, Ue = ["application/xhtml+xml", "text/html"], ut = "text/html", bt, Pt = null, At = n.createElement("form"), Ct = function(ye) { + })), le = null, ge = null, j = !0, oe = !0, ie = !1, ce = !0, we = !1, xe = !1, fe = !1, Ye = !1, Ce = !1, Le = !1, We = !1, je = !0, at = !1, tt = "user-content-", Ge = !0, Re = !1, se = {}, ve = null, Ee = Gr({}, ["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"]), de = null, ke = Gr({}, ["audio", "video", "img", "source", "image", "track"]), H = null, U = Gr({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Q = "http://www.w3.org/1998/Math/MathML", te = "http://www.w3.org/2000/svg", he = "http://www.w3.org/1999/xhtml", Te = he, Se = !1, $e = null, Ie = Gr({}, [Q, te, he], q8), ct, Ue = ["application/xhtml+xml", "text/html"], ut = "text/html", bt, Pt = null, At = n.createElement("form"), Ct = function(ye) { return ye instanceof RegExp || ye instanceof Function; }, dt = function(ye) { - Pt && Pt === ye || ((!ye || Ed(ye) !== "object") && (ye = {}), ye = a0(ye), ct = Ue.indexOf(ye.PARSER_MEDIA_TYPE) === -1 ? ct = ut : ct = ye.PARSER_MEDIA_TYPE, bt = ct === "application/xhtml+xml" ? G8 : h5, Z = "ALLOWED_TAGS" in ye ? Gr({}, ye.ALLOWED_TAGS, bt) : K, re = "ALLOWED_ATTR" in ye ? Gr({}, ye.ALLOWED_ATTR, bt) : pe, $e = "ALLOWED_NAMESPACES" in ye ? Gr({}, ye.ALLOWED_NAMESPACES, G8) : Ie, H = "ADD_URI_SAFE_ATTR" in ye ? Gr( - a0(U), + Pt && Pt === ye || ((!ye || Sd(ye) !== "object") && (ye = {}), ye = e0(ye), ct = Ue.indexOf(ye.PARSER_MEDIA_TYPE) === -1 ? ct = ut : ct = ye.PARSER_MEDIA_TYPE, bt = ct === "application/xhtml+xml" ? q8 : c3, Z = "ALLOWED_TAGS" in ye ? Gr({}, ye.ALLOWED_TAGS, bt) : K, re = "ALLOWED_ATTR" in ye ? Gr({}, ye.ALLOWED_ATTR, bt) : pe, $e = "ALLOWED_NAMESPACES" in ye ? Gr({}, ye.ALLOWED_NAMESPACES, q8) : Ie, H = "ADD_URI_SAFE_ATTR" in ye ? Gr( + e0(U), ye.ADD_URI_SAFE_ATTR, bt ) : U, de = "ADD_DATA_URI_TAGS" in ye ? Gr( - a0(ke), + e0(ke), ye.ADD_DATA_URI_TAGS, bt - ) : ke, ve = "FORBID_CONTENTS" in ye ? Gr({}, ye.FORBID_CONTENTS, bt) : Ee, le = "FORBID_TAGS" in ye ? Gr({}, ye.FORBID_TAGS, bt) : {}, ge = "FORBID_ATTR" in ye ? Gr({}, ye.FORBID_ATTR, bt) : {}, se = "USE_PROFILES" in ye ? ye.USE_PROFILES : !1, j = ye.ALLOW_ARIA_ATTR !== !1, oe = ye.ALLOW_DATA_ATTR !== !1, ie = ye.ALLOW_UNKNOWN_PROTOCOLS || !1, ce = ye.ALLOW_SELF_CLOSE_IN_ATTR !== !1, we = ye.SAFE_FOR_TEMPLATES || !1, xe = ye.WHOLE_DOCUMENT || !1, Ce = ye.RETURN_DOM || !1, Le = ye.RETURN_DOM_FRAGMENT || !1, We = ye.RETURN_TRUSTED_TYPE || !1, Ye = ye.FORCE_BODY || !1, je = ye.SANITIZE_DOM !== !1, at = ye.SANITIZE_NAMED_PROPS || !1, Ge = ye.KEEP_CONTENT !== !1, Re = ye.IN_PLACE || !1, W = ye.ALLOWED_URI_REGEXP || W, Te = ye.NAMESPACE || he, ne = ye.CUSTOM_ELEMENT_HANDLING || {}, ye.CUSTOM_ELEMENT_HANDLING && Ct(ye.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (ne.tagNameCheck = ye.CUSTOM_ELEMENT_HANDLING.tagNameCheck), ye.CUSTOM_ELEMENT_HANDLING && Ct(ye.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (ne.attributeNameCheck = ye.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), ye.CUSTOM_ELEMENT_HANDLING && typeof ye.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (ne.allowCustomizedBuiltInElements = ye.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), we && (oe = !1), Le && (Ce = !0), se && (Z = Gr({}, Lc(mH)), re = [], se.html === !0 && (Gr(Z, gH), Gr(re, vH)), se.svg === !0 && (Gr(Z, X8), Gr(re, K8), Gr(re, kS)), se.svgFilters === !0 && (Gr(Z, j8), Gr(re, K8), Gr(re, kS)), se.mathMl === !0 && (Gr(Z, Z8), Gr(re, yH), Gr(re, kS))), ye.ADD_TAGS && (Z === K && (Z = a0(Z)), Gr(Z, ye.ADD_TAGS, bt)), ye.ADD_ATTR && (re === pe && (re = a0(re)), Gr(re, ye.ADD_ATTR, bt)), ye.ADD_URI_SAFE_ATTR && Gr(H, ye.ADD_URI_SAFE_ATTR, bt), ye.FORBID_CONTENTS && (ve === Ee && (ve = a0(ve)), Gr(ve, ye.FORBID_CONTENTS, bt)), Ge && (Z["#text"] = !0), xe && Gr(Z, ["html", "head", "body"]), Z.table && (Gr(Z, ["tbody"]), delete le.tbody), vo && vo(ye), Pt = ye); - }, pt = Gr({}, ["mi", "mo", "mn", "ms", "mtext"]), Rt = Gr({}, ["foreignobject", "desc", "title", "annotation-xml"]), Ot = Gr({}, ["title", "style", "font", "a", "script"]), vt = Gr({}, X8); - Gr(vt, j8), Gr(vt, KBe); - var Ft = Gr({}, Z8); - Gr(Ft, JBe); + ) : ke, ve = "FORBID_CONTENTS" in ye ? Gr({}, ye.FORBID_CONTENTS, bt) : Ee, le = "FORBID_TAGS" in ye ? Gr({}, ye.FORBID_TAGS, bt) : {}, ge = "FORBID_ATTR" in ye ? Gr({}, ye.FORBID_ATTR, bt) : {}, se = "USE_PROFILES" in ye ? ye.USE_PROFILES : !1, j = ye.ALLOW_ARIA_ATTR !== !1, oe = ye.ALLOW_DATA_ATTR !== !1, ie = ye.ALLOW_UNKNOWN_PROTOCOLS || !1, ce = ye.ALLOW_SELF_CLOSE_IN_ATTR !== !1, we = ye.SAFE_FOR_TEMPLATES || !1, xe = ye.WHOLE_DOCUMENT || !1, Ce = ye.RETURN_DOM || !1, Le = ye.RETURN_DOM_FRAGMENT || !1, We = ye.RETURN_TRUSTED_TYPE || !1, Ye = ye.FORCE_BODY || !1, je = ye.SANITIZE_DOM !== !1, at = ye.SANITIZE_NAMED_PROPS || !1, Ge = ye.KEEP_CONTENT !== !1, Re = ye.IN_PLACE || !1, W = ye.ALLOWED_URI_REGEXP || W, Te = ye.NAMESPACE || he, ne = ye.CUSTOM_ELEMENT_HANDLING || {}, ye.CUSTOM_ELEMENT_HANDLING && Ct(ye.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (ne.tagNameCheck = ye.CUSTOM_ELEMENT_HANDLING.tagNameCheck), ye.CUSTOM_ELEMENT_HANDLING && Ct(ye.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (ne.attributeNameCheck = ye.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), ye.CUSTOM_ELEMENT_HANDLING && typeof ye.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (ne.allowCustomizedBuiltInElements = ye.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), we && (oe = !1), Le && (Ce = !0), se && (Z = Gr({}, _c(nH)), re = [], se.html === !0 && (Gr(Z, rH), Gr(re, iH)), se.svg === !0 && (Gr(Z, Q8), Gr(re, Y8), Gr(re, xS)), se.svgFilters === !0 && (Gr(Z, V8), Gr(re, Y8), Gr(re, xS)), se.mathMl === !0 && (Gr(Z, W8), Gr(re, sH), Gr(re, xS))), ye.ADD_TAGS && (Z === K && (Z = e0(Z)), Gr(Z, ye.ADD_TAGS, bt)), ye.ADD_ATTR && (re === pe && (re = e0(re)), Gr(re, ye.ADD_ATTR, bt)), ye.ADD_URI_SAFE_ATTR && Gr(H, ye.ADD_URI_SAFE_ATTR, bt), ye.FORBID_CONTENTS && (ve === Ee && (ve = e0(ve)), Gr(ve, ye.FORBID_CONTENTS, bt)), Ge && (Z["#text"] = !0), xe && Gr(Z, ["html", "head", "body"]), Z.table && (Gr(Z, ["tbody"]), delete le.tbody), po && po(ye), Pt = ye); + }, pt = Gr({}, ["mi", "mo", "mn", "ms", "mtext"]), Rt = Gr({}, ["foreignobject", "desc", "title", "annotation-xml"]), Ot = Gr({}, ["title", "style", "font", "a", "script"]), vt = Gr({}, Q8); + Gr(vt, V8), Gr(vt, zBe); + var Ft = Gr({}, W8); + Gr(Ft, qBe); var kt = function(ye) { var Qe = b(ye); (!Qe || !Qe.tagName) && (Qe = { namespaceURI: Te, tagName: "template" }); - var et = h5(ye.tagName), Et = h5(Qe.tagName); + var et = c3(ye.tagName), Et = c3(Qe.tagName); return $e[ye.namespaceURI] ? ye.namespaceURI === te ? Qe.namespaceURI === he ? et === "svg" : Qe.namespaceURI === Q ? et === "svg" && (Et === "annotation-xml" || pt[Et]) : Boolean(vt[et]) : ye.namespaceURI === Q ? Qe.namespaceURI === he ? et === "math" : Qe.namespaceURI === te ? et === "math" && Rt[Et] : Boolean(Ft[et]) : ye.namespaceURI === he ? Qe.namespaceURI === te && !Rt[Et] || Qe.namespaceURI === Q && !pt[Et] ? !1 : !Ft[et] && (Ot[et] || !vt[et]) : !!(ct === "application/xhtml+xml" && $e[ye.namespaceURI]) : !1; }, gt = function(ye) { - H2(e.removed, { + V2(e.removed, { element: ye }); try { @@ -31012,12 +31012,12 @@ function Rhe() { } }, Oe = function(ye, Qe) { try { - H2(e.removed, { + V2(e.removed, { attribute: Qe.getAttributeNode(ye), from: Qe }); } catch { - H2(e.removed, { + V2(e.removed, { attribute: null, from: Qe }); @@ -31038,7 +31038,7 @@ function Rhe() { if (Ye) ye = "" + ye; else { - var Et = HBe(ye, /^[\r\n\t ]+/); + var Et = IBe(ye, /^[\r\n\t ]+/); et = Et && Et[0]; } ct === "application/xhtml+xml" && Te === he && (ye = '' + ye + ""); @@ -31056,9 +31056,9 @@ function Rhe() { } } var tr = Qe.body || Qe.documentElement; - return ye && et && tr.insertBefore(n.createTextNode(et), tr.childNodes[0] || null), Te === he ? P.call(Qe, xe ? "html" : "body")[0] : xe ? Qe.documentElement : tr; + return ye && et && tr.insertBefore(n.createTextNode(et), tr.childNodes[0] || null), Te === he ? N.call(Qe, xe ? "html" : "body")[0] : xe ? Qe.documentElement : tr; }, er = function(ye) { - return L.call( + return D.call( ye.ownerDocument || ye, ye, l.SHOW_ELEMENT | l.SHOW_COMMENT | l.SHOW_TEXT, @@ -31068,23 +31068,23 @@ function Rhe() { }, xt = function(ye) { return ye instanceof f && (typeof ye.nodeName != "string" || typeof ye.textContent != "string" || typeof ye.removeChild != "function" || !(ye.attributes instanceof h) || typeof ye.removeAttribute != "function" || typeof ye.setAttribute != "function" || typeof ye.namespaceURI != "string" || typeof ye.insertBefore != "function" || typeof ye.hasChildNodes != "function"); }, Me = function(ye) { - return Ed(a) === "object" ? ye instanceof a : ye && Ed(ye) === "object" && typeof ye.nodeType == "number" && typeof ye.nodeName == "string"; + return Sd(a) === "object" ? ye instanceof a : ye && Sd(ye) === "object" && typeof ye.nodeType == "number" && typeof ye.nodeName == "string"; }, it = function(ye, Qe, et) { - !q[ye] || GBe(q[ye], function(Et) { + !F[ye] || NBe(F[ye], function(Et) { Et.call(e, Qe, et, Pt); }); }, St = function(ye) { var Qe; - if (it("beforeSanitizeElements", ye, null), xt(ye) || ro(/[\u0080-\uFFFF]/, ye.nodeName)) + if (it("beforeSanitizeElements", ye, null), xt(ye) || Ja(/[\u0080-\uFFFF]/, ye.nodeName)) return gt(ye), !0; var et = bt(ye.nodeName); if (it("uponSanitizeElement", ye, { tagName: et, allowedTags: Z - }), ye.hasChildNodes() && !Me(ye.firstElementChild) && (!Me(ye.content) || !Me(ye.content.firstElementChild)) && ro(/<[/\w]/g, ye.innerHTML) && ro(/<[/\w]/g, ye.textContent) || et === "select" && ro(/