UNPKG

@chahindb7/vue3-editor

Version:

HTML editor using Vue.js 3, and Quill.js, an open source editor with advanced table functionality (quill-table-better)

1,624 lines (1,623 loc) 422 kB
var hh = Object.defineProperty; var uh = (s, t, e) => t in s ? hh(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e; var v = (s, t, e) => (uh(s, typeof t != "symbol" ? t + "" : t, e), e); import { openBlock as dh, createElementBlock as fh, createElementVNode as ph } from "vue"; var gh = typeof global == "object" && global && global.Object === Object && global; const Aa = gh; var mh = typeof self == "object" && self && self.Object === Object && self, bh = Aa || mh || Function("return this")(); const ce = bh; var yh = ce.Symbol; const _e = yh; var La = Object.prototype, vh = La.hasOwnProperty, wh = La.toString, os = _e ? _e.toStringTag : void 0; function xh(s) { var t = vh.call(s, os), e = s[os]; try { s[os] = void 0; var n = !0; } catch { } var i = wh.call(s); return n && (t ? s[os] = e : delete s[os]), i; } var Eh = Object.prototype, Ch = Eh.toString; function Nh(s) { return Ch.call(s); } var Th = "[object Null]", Ah = "[object Undefined]", oo = _e ? _e.toStringTag : void 0; function zn(s) { return s == null ? s === void 0 ? Ah : Th : oo && oo in Object(s) ? xh(s) : Nh(s); } function be(s) { return s != null && typeof s == "object"; } var Lh = Array.isArray; const Ge = Lh; function ke(s) { var t = typeof s; return s != null && (t == "object" || t == "function"); } function Sa(s) { return s; } var Sh = "[object AsyncFunction]", Ih = "[object Function]", qh = "[object GeneratorFunction]", Oh = "[object Proxy]"; function ql(s) { if (!ke(s)) return !1; var t = zn(s); return t == Ih || t == qh || t == Sh || t == Oh; } var Mh = ce["__core-js_shared__"]; const Br = Mh; var ao = function() { var s = /[^.]+$/.exec(Br && Br.keys && Br.keys.IE_PROTO || ""); return s ? "Symbol(src)_1." + s : ""; }(); function Rh(s) { return !!ao && ao in s; } var _h = Function.prototype, kh = _h.toString; function en(s) { if (s != null) { try { return kh.call(s); } catch { } try { return s + ""; } catch { } } return ""; } var Bh = /[\\^$.*+?()[\]{}|]/g, $h = /^\[object .+?Constructor\]$/, Dh = Function.prototype, jh = Object.prototype, Ph = Dh.toString, zh = jh.hasOwnProperty, Hh = RegExp( "^" + Ph.call(zh).replace(Bh, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function Uh(s) { if (!ke(s) || Rh(s)) return !1; var t = ql(s) ? Hh : $h; return t.test(en(s)); } function Fh(s, t) { return s == null ? void 0 : s[t]; } function nn(s, t) { var e = Fh(s, t); return Uh(e) ? e : void 0; } var Wh = nn(ce, "WeakMap"); const Jr = Wh; var co = Object.create, Vh = function() { function s() { } return function(t) { if (!ke(t)) return {}; if (co) return co(t); s.prototype = t; var e = new s(); return s.prototype = void 0, e; }; }(); const Kh = Vh; function Gh(s, t, e) { switch (e.length) { case 0: return s.call(t); case 1: return s.call(t, e[0]); case 2: return s.call(t, e[0], e[1]); case 3: return s.call(t, e[0], e[1], e[2]); } return s.apply(t, e); } function Ia(s, t) { var e = -1, n = s.length; for (t || (t = Array(n)); ++e < n; ) t[e] = s[e]; return t; } var Yh = 800, Zh = 16, Xh = Date.now; function Qh(s) { var t = 0, e = 0; return function() { var n = Xh(), i = Zh - (n - e); if (e = n, i > 0) { if (++t >= Yh) return arguments[0]; } else t = 0; return s.apply(void 0, arguments); }; } function Jh(s) { return function() { return s; }; } var tu = function() { try { var s = nn(Object, "defineProperty"); return s({}, "", {}), s; } catch { } }(); const wi = tu; var eu = wi ? function(s, t) { return wi(s, "toString", { configurable: !0, enumerable: !1, value: Jh(t), writable: !0 }); } : Sa; const nu = eu; var su = Qh(nu); const iu = su; function ru(s, t) { for (var e = -1, n = s == null ? 0 : s.length; ++e < n && t(s[e], e, s) !== !1; ) ; return s; } var lu = 9007199254740991, ou = /^(?:0|[1-9]\d*)$/; function qa(s, t) { var e = typeof s; return t = t ?? lu, !!t && (e == "number" || e != "symbol" && ou.test(s)) && s > -1 && s % 1 == 0 && s < t; } function Ol(s, t, e) { t == "__proto__" && wi ? wi(s, t, { configurable: !0, enumerable: !0, value: e, writable: !0 }) : s[t] = e; } function Ls(s, t) { return s === t || s !== s && t !== t; } var au = Object.prototype, cu = au.hasOwnProperty; function Oa(s, t, e) { var n = s[t]; (!(cu.call(s, t) && Ls(n, e)) || e === void 0 && !(t in s)) && Ol(s, t, e); } function Ss(s, t, e, n) { var i = !e; e || (e = {}); for (var r = -1, l = t.length; ++r < l; ) { var o = t[r], a = n ? n(e[o], s[o], o, e, s) : void 0; a === void 0 && (a = s[o]), i ? Ol(e, o, a) : Oa(e, o, a); } return e; } var ho = Math.max; function hu(s, t, e) { return t = ho(t === void 0 ? s.length - 1 : t, 0), function() { for (var n = arguments, i = -1, r = ho(n.length - t, 0), l = Array(r); ++i < r; ) l[i] = n[t + i]; i = -1; for (var o = Array(t + 1); ++i < t; ) o[i] = n[i]; return o[t] = e(l), Gh(s, this, o); }; } function uu(s, t) { return iu(hu(s, t, Sa), s + ""); } var du = 9007199254740991; function Ma(s) { return typeof s == "number" && s > -1 && s % 1 == 0 && s <= du; } function _i(s) { return s != null && Ma(s.length) && !ql(s); } function fu(s, t, e) { if (!ke(e)) return !1; var n = typeof t; return (n == "number" ? _i(e) && qa(t, e.length) : n == "string" && t in e) ? Ls(e[t], s) : !1; } function pu(s) { return uu(function(t, e) { var n = -1, i = e.length, r = i > 1 ? e[i - 1] : void 0, l = i > 2 ? e[2] : void 0; for (r = s.length > 3 && typeof r == "function" ? (i--, r) : void 0, l && fu(e[0], e[1], l) && (r = i < 3 ? void 0 : r, i = 1), t = Object(t); ++n < i; ) { var o = e[n]; o && s(t, o, n, r); } return t; }); } var gu = Object.prototype; function Ml(s) { var t = s && s.constructor, e = typeof t == "function" && t.prototype || gu; return s === e; } function mu(s, t) { for (var e = -1, n = Array(s); ++e < s; ) n[e] = t(e); return n; } var bu = "[object Arguments]"; function uo(s) { return be(s) && zn(s) == bu; } var Ra = Object.prototype, yu = Ra.hasOwnProperty, vu = Ra.propertyIsEnumerable, wu = uo(function() { return arguments; }()) ? uo : function(s) { return be(s) && yu.call(s, "callee") && !vu.call(s, "callee"); }; const tl = wu; function xu() { return !1; } var _a = typeof exports == "object" && exports && !exports.nodeType && exports, fo = _a && typeof module == "object" && module && !module.nodeType && module, Eu = fo && fo.exports === _a, po = Eu ? ce.Buffer : void 0, Cu = po ? po.isBuffer : void 0, Nu = Cu || xu; const ms = Nu; var Tu = "[object Arguments]", Au = "[object Array]", Lu = "[object Boolean]", Su = "[object Date]", Iu = "[object Error]", qu = "[object Function]", Ou = "[object Map]", Mu = "[object Number]", Ru = "[object Object]", _u = "[object RegExp]", ku = "[object Set]", Bu = "[object String]", $u = "[object WeakMap]", Du = "[object ArrayBuffer]", ju = "[object DataView]", Pu = "[object Float32Array]", zu = "[object Float64Array]", Hu = "[object Int8Array]", Uu = "[object Int16Array]", Fu = "[object Int32Array]", Wu = "[object Uint8Array]", Vu = "[object Uint8ClampedArray]", Ku = "[object Uint16Array]", Gu = "[object Uint32Array]", Q = {}; Q[Pu] = Q[zu] = Q[Hu] = Q[Uu] = Q[Fu] = Q[Wu] = Q[Vu] = Q[Ku] = Q[Gu] = !0; Q[Tu] = Q[Au] = Q[Du] = Q[Lu] = Q[ju] = Q[Su] = Q[Iu] = Q[qu] = Q[Ou] = Q[Mu] = Q[Ru] = Q[_u] = Q[ku] = Q[Bu] = Q[$u] = !1; function Yu(s) { return be(s) && Ma(s.length) && !!Q[zn(s)]; } function Rl(s) { return function(t) { return s(t); }; } var ka = typeof exports == "object" && exports && !exports.nodeType && exports, us = ka && typeof module == "object" && module && !module.nodeType && module, Zu = us && us.exports === ka, $r = Zu && Aa.process, Xu = function() { try { var s = us && us.require && us.require("util").types; return s || $r && $r.binding && $r.binding("util"); } catch { } }(); const _n = Xu; var go = _n && _n.isTypedArray, Qu = go ? Rl(go) : Yu; const _l = Qu; var Ju = Object.prototype, td = Ju.hasOwnProperty; function Ba(s, t) { var e = Ge(s), n = !e && tl(s), i = !e && !n && ms(s), r = !e && !n && !i && _l(s), l = e || n || i || r, o = l ? mu(s.length, String) : [], a = o.length; for (var h in s) (t || td.call(s, h)) && !(l && // Safari 9 has enumerable `arguments.length` in strict mode. (h == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. i && (h == "offset" || h == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. r && (h == "buffer" || h == "byteLength" || h == "byteOffset") || // Skip index properties. qa(h, a))) && o.push(h); return o; } function $a(s, t) { return function(e) { return s(t(e)); }; } var ed = $a(Object.keys, Object); const nd = ed; var sd = Object.prototype, id = sd.hasOwnProperty; function rd(s) { if (!Ml(s)) return nd(s); var t = []; for (var e in Object(s)) id.call(s, e) && e != "constructor" && t.push(e); return t; } function kl(s) { return _i(s) ? Ba(s) : rd(s); } function ld(s) { var t = []; if (s != null) for (var e in Object(s)) t.push(e); return t; } var od = Object.prototype, ad = od.hasOwnProperty; function cd(s) { if (!ke(s)) return ld(s); var t = Ml(s), e = []; for (var n in s) n == "constructor" && (t || !ad.call(s, n)) || e.push(n); return e; } function Is(s) { return _i(s) ? Ba(s, !0) : cd(s); } var hd = nn(Object, "create"); const bs = hd; function ud() { this.__data__ = bs ? bs(null) : {}, this.size = 0; } function dd(s) { var t = this.has(s) && delete this.__data__[s]; return this.size -= t ? 1 : 0, t; } var fd = "__lodash_hash_undefined__", pd = Object.prototype, gd = pd.hasOwnProperty; function md(s) { var t = this.__data__; if (bs) { var e = t[s]; return e === fd ? void 0 : e; } return gd.call(t, s) ? t[s] : void 0; } var bd = Object.prototype, yd = bd.hasOwnProperty; function vd(s) { var t = this.__data__; return bs ? t[s] !== void 0 : yd.call(t, s); } var wd = "__lodash_hash_undefined__"; function xd(s, t) { var e = this.__data__; return this.size += this.has(s) ? 0 : 1, e[s] = bs && t === void 0 ? wd : t, this; } function Ye(s) { var t = -1, e = s == null ? 0 : s.length; for (this.clear(); ++t < e; ) { var n = s[t]; this.set(n[0], n[1]); } } Ye.prototype.clear = ud; Ye.prototype.delete = dd; Ye.prototype.get = md; Ye.prototype.has = vd; Ye.prototype.set = xd; function Ed() { this.__data__ = [], this.size = 0; } function ki(s, t) { for (var e = s.length; e--; ) if (Ls(s[e][0], t)) return e; return -1; } var Cd = Array.prototype, Nd = Cd.splice; function Td(s) { var t = this.__data__, e = ki(t, s); if (e < 0) return !1; var n = t.length - 1; return e == n ? t.pop() : Nd.call(t, e, 1), --this.size, !0; } function Ad(s) { var t = this.__data__, e = ki(t, s); return e < 0 ? void 0 : t[e][1]; } function Ld(s) { return ki(this.__data__, s) > -1; } function Sd(s, t) { var e = this.__data__, n = ki(e, s); return n < 0 ? (++this.size, e.push([s, t])) : e[n][1] = t, this; } function we(s) { var t = -1, e = s == null ? 0 : s.length; for (this.clear(); ++t < e; ) { var n = s[t]; this.set(n[0], n[1]); } } we.prototype.clear = Ed; we.prototype.delete = Td; we.prototype.get = Ad; we.prototype.has = Ld; we.prototype.set = Sd; var Id = nn(ce, "Map"); const ys = Id; function qd() { this.size = 0, this.__data__ = { hash: new Ye(), map: new (ys || we)(), string: new Ye() }; } function Od(s) { var t = typeof s; return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? s !== "__proto__" : s === null; } function Bi(s, t) { var e = s.__data__; return Od(t) ? e[typeof t == "string" ? "string" : "hash"] : e.map; } function Md(s) { var t = Bi(this, s).delete(s); return this.size -= t ? 1 : 0, t; } function Rd(s) { return Bi(this, s).get(s); } function _d(s) { return Bi(this, s).has(s); } function kd(s, t) { var e = Bi(this, s), n = e.size; return e.set(s, t), this.size += e.size == n ? 0 : 1, this; } function sn(s) { var t = -1, e = s == null ? 0 : s.length; for (this.clear(); ++t < e; ) { var n = s[t]; this.set(n[0], n[1]); } } sn.prototype.clear = qd; sn.prototype.delete = Md; sn.prototype.get = Rd; sn.prototype.has = _d; sn.prototype.set = kd; function Da(s, t) { for (var e = -1, n = t.length, i = s.length; ++e < n; ) s[i + e] = t[e]; return s; } var Bd = $a(Object.getPrototypeOf, Object); const Bl = Bd; var $d = "[object Object]", Dd = Function.prototype, jd = Object.prototype, ja = Dd.toString, Pd = jd.hasOwnProperty, zd = ja.call(Object); function Hd(s) { if (!be(s) || zn(s) != $d) return !1; var t = Bl(s); if (t === null) return !0; var e = Pd.call(t, "constructor") && t.constructor; return typeof e == "function" && e instanceof e && ja.call(e) == zd; } function Ud() { this.__data__ = new we(), this.size = 0; } function Fd(s) { var t = this.__data__, e = t.delete(s); return this.size = t.size, e; } function Wd(s) { return this.__data__.get(s); } function Vd(s) { return this.__data__.has(s); } var Kd = 200; function Gd(s, t) { var e = this.__data__; if (e instanceof we) { var n = e.__data__; if (!ys || n.length < Kd - 1) return n.push([s, t]), this.size = ++e.size, this; e = this.__data__ = new sn(n); } return e.set(s, t), this.size = e.size, this; } function ne(s) { var t = this.__data__ = new we(s); this.size = t.size; } ne.prototype.clear = Ud; ne.prototype.delete = Fd; ne.prototype.get = Wd; ne.prototype.has = Vd; ne.prototype.set = Gd; function Yd(s, t) { return s && Ss(t, kl(t), s); } function Zd(s, t) { return s && Ss(t, Is(t), s); } var Pa = typeof exports == "object" && exports && !exports.nodeType && exports, mo = Pa && typeof module == "object" && module && !module.nodeType && module, Xd = mo && mo.exports === Pa, bo = Xd ? ce.Buffer : void 0, yo = bo ? bo.allocUnsafe : void 0; function za(s, t) { if (t) return s.slice(); var e = s.length, n = yo ? yo(e) : new s.constructor(e); return s.copy(n), n; } function Qd(s, t) { for (var e = -1, n = s == null ? 0 : s.length, i = 0, r = []; ++e < n; ) { var l = s[e]; t(l, e, s) && (r[i++] = l); } return r; } function Ha() { return []; } var Jd = Object.prototype, tf = Jd.propertyIsEnumerable, vo = Object.getOwnPropertySymbols, ef = vo ? function(s) { return s == null ? [] : (s = Object(s), Qd(vo(s), function(t) { return tf.call(s, t); })); } : Ha; const $l = ef; function nf(s, t) { return Ss(s, $l(s), t); } var sf = Object.getOwnPropertySymbols, rf = sf ? function(s) { for (var t = []; s; ) Da(t, $l(s)), s = Bl(s); return t; } : Ha; const Ua = rf; function lf(s, t) { return Ss(s, Ua(s), t); } function Fa(s, t, e) { var n = t(s); return Ge(s) ? n : Da(n, e(s)); } function el(s) { return Fa(s, kl, $l); } function of(s) { return Fa(s, Is, Ua); } var af = nn(ce, "DataView"); const nl = af; var cf = nn(ce, "Promise"); const sl = cf; var hf = nn(ce, "Set"); const il = hf; var wo = "[object Map]", uf = "[object Object]", xo = "[object Promise]", Eo = "[object Set]", Co = "[object WeakMap]", No = "[object DataView]", df = en(nl), ff = en(ys), pf = en(sl), gf = en(il), mf = en(Jr), We = zn; (nl && We(new nl(new ArrayBuffer(1))) != No || ys && We(new ys()) != wo || sl && We(sl.resolve()) != xo || il && We(new il()) != Eo || Jr && We(new Jr()) != Co) && (We = function(s) { var t = zn(s), e = t == uf ? s.constructor : void 0, n = e ? en(e) : ""; if (n) switch (n) { case df: return No; case ff: return wo; case pf: return xo; case gf: return Eo; case mf: return Co; } return t; }); const vs = We; var bf = Object.prototype, yf = bf.hasOwnProperty; function vf(s) { var t = s.length, e = new s.constructor(t); return t && typeof s[0] == "string" && yf.call(s, "index") && (e.index = s.index, e.input = s.input), e; } var wf = ce.Uint8Array; const xi = wf; function Dl(s) { var t = new s.constructor(s.byteLength); return new xi(t).set(new xi(s)), t; } function xf(s, t) { var e = t ? Dl(s.buffer) : s.buffer; return new s.constructor(e, s.byteOffset, s.byteLength); } var Ef = /\w*$/; function Cf(s) { var t = new s.constructor(s.source, Ef.exec(s)); return t.lastIndex = s.lastIndex, t; } var To = _e ? _e.prototype : void 0, Ao = To ? To.valueOf : void 0; function Nf(s) { return Ao ? Object(Ao.call(s)) : {}; } function Wa(s, t) { var e = t ? Dl(s.buffer) : s.buffer; return new s.constructor(e, s.byteOffset, s.length); } var Tf = "[object Boolean]", Af = "[object Date]", Lf = "[object Map]", Sf = "[object Number]", If = "[object RegExp]", qf = "[object Set]", Of = "[object String]", Mf = "[object Symbol]", Rf = "[object ArrayBuffer]", _f = "[object DataView]", kf = "[object Float32Array]", Bf = "[object Float64Array]", $f = "[object Int8Array]", Df = "[object Int16Array]", jf = "[object Int32Array]", Pf = "[object Uint8Array]", zf = "[object Uint8ClampedArray]", Hf = "[object Uint16Array]", Uf = "[object Uint32Array]"; function Ff(s, t, e) { var n = s.constructor; switch (t) { case Rf: return Dl(s); case Tf: case Af: return new n(+s); case _f: return xf(s, e); case kf: case Bf: case $f: case Df: case jf: case Pf: case zf: case Hf: case Uf: return Wa(s, e); case Lf: return new n(); case Sf: case Of: return new n(s); case If: return Cf(s); case qf: return new n(); case Mf: return Nf(s); } } function Va(s) { return typeof s.constructor == "function" && !Ml(s) ? Kh(Bl(s)) : {}; } var Wf = "[object Map]"; function Vf(s) { return be(s) && vs(s) == Wf; } var Lo = _n && _n.isMap, Kf = Lo ? Rl(Lo) : Vf; const Gf = Kf; var Yf = "[object Set]"; function Zf(s) { return be(s) && vs(s) == Yf; } var So = _n && _n.isSet, Xf = So ? Rl(So) : Zf; const Qf = Xf; var Jf = 1, tp = 2, ep = 4, Ka = "[object Arguments]", np = "[object Array]", sp = "[object Boolean]", ip = "[object Date]", rp = "[object Error]", Ga = "[object Function]", lp = "[object GeneratorFunction]", op = "[object Map]", ap = "[object Number]", Ya = "[object Object]", cp = "[object RegExp]", hp = "[object Set]", up = "[object String]", dp = "[object Symbol]", fp = "[object WeakMap]", pp = "[object ArrayBuffer]", gp = "[object DataView]", mp = "[object Float32Array]", bp = "[object Float64Array]", yp = "[object Int8Array]", vp = "[object Int16Array]", wp = "[object Int32Array]", xp = "[object Uint8Array]", Ep = "[object Uint8ClampedArray]", Cp = "[object Uint16Array]", Np = "[object Uint32Array]", X = {}; X[Ka] = X[np] = X[pp] = X[gp] = X[sp] = X[ip] = X[mp] = X[bp] = X[yp] = X[vp] = X[wp] = X[op] = X[ap] = X[Ya] = X[cp] = X[hp] = X[up] = X[dp] = X[xp] = X[Ep] = X[Cp] = X[Np] = !0; X[rp] = X[Ga] = X[fp] = !1; function mi(s, t, e, n, i, r) { var l, o = t & Jf, a = t & tp, h = t & ep; if (e && (l = i ? e(s, n, i, r) : e(s)), l !== void 0) return l; if (!ke(s)) return s; var u = Ge(s); if (u) { if (l = vf(s), !o) return Ia(s, l); } else { var f = vs(s), d = f == Ga || f == lp; if (ms(s)) return za(s, o); if (f == Ya || f == Ka || d && !i) { if (l = a || d ? {} : Va(s), !o) return a ? lf(s, Zd(l, s)) : nf(s, Yd(l, s)); } else { if (!X[f]) return i ? s : {}; l = Ff(s, f, o); } } r || (r = new ne()); var g = r.get(s); if (g) return g; r.set(s, l), Qf(s) ? s.forEach(function(y) { l.add(mi(y, t, e, y, s, r)); }) : Gf(s) && s.forEach(function(y, x) { l.set(x, mi(y, t, e, x, s, r)); }); var m = h ? a ? of : el : a ? Is : kl, b = u ? void 0 : m(s); return ru(b || s, function(y, x) { b && (x = y, y = s[x]), Oa(l, x, mi(y, t, e, x, s, r)); }), l; } var Tp = 1, Ap = 4; function Sn(s) { return mi(s, Tp | Ap); } var Lp = "__lodash_hash_undefined__"; function Sp(s) { return this.__data__.set(s, Lp), this; } function Ip(s) { return this.__data__.has(s); } function Ei(s) { var t = -1, e = s == null ? 0 : s.length; for (this.__data__ = new sn(); ++t < e; ) this.add(s[t]); } Ei.prototype.add = Ei.prototype.push = Sp; Ei.prototype.has = Ip; function qp(s, t) { for (var e = -1, n = s == null ? 0 : s.length; ++e < n; ) if (t(s[e], e, s)) return !0; return !1; } function Op(s, t) { return s.has(t); } var Mp = 1, Rp = 2; function Za(s, t, e, n, i, r) { var l = e & Mp, o = s.length, a = t.length; if (o != a && !(l && a > o)) return !1; var h = r.get(s), u = r.get(t); if (h && u) return h == t && u == s; var f = -1, d = !0, g = e & Rp ? new Ei() : void 0; for (r.set(s, t), r.set(t, s); ++f < o; ) { var m = s[f], b = t[f]; if (n) var y = l ? n(b, m, f, t, s, r) : n(m, b, f, s, t, r); if (y !== void 0) { if (y) continue; d = !1; break; } if (g) { if (!qp(t, function(x, C) { if (!Op(g, C) && (m === x || i(m, x, e, n, r))) return g.push(C); })) { d = !1; break; } } else if (!(m === b || i(m, b, e, n, r))) { d = !1; break; } } return r.delete(s), r.delete(t), d; } function _p(s) { var t = -1, e = Array(s.size); return s.forEach(function(n, i) { e[++t] = [i, n]; }), e; } function kp(s) { var t = -1, e = Array(s.size); return s.forEach(function(n) { e[++t] = n; }), e; } var Bp = 1, $p = 2, Dp = "[object Boolean]", jp = "[object Date]", Pp = "[object Error]", zp = "[object Map]", Hp = "[object Number]", Up = "[object RegExp]", Fp = "[object Set]", Wp = "[object String]", Vp = "[object Symbol]", Kp = "[object ArrayBuffer]", Gp = "[object DataView]", Io = _e ? _e.prototype : void 0, Dr = Io ? Io.valueOf : void 0; function Yp(s, t, e, n, i, r, l) { switch (e) { case Gp: if (s.byteLength != t.byteLength || s.byteOffset != t.byteOffset) return !1; s = s.buffer, t = t.buffer; case Kp: return !(s.byteLength != t.byteLength || !r(new xi(s), new xi(t))); case Dp: case jp: case Hp: return Ls(+s, +t); case Pp: return s.name == t.name && s.message == t.message; case Up: case Wp: return s == t + ""; case zp: var o = _p; case Fp: var a = n & Bp; if (o || (o = kp), s.size != t.size && !a) return !1; var h = l.get(s); if (h) return h == t; n |= $p, l.set(s, t); var u = Za(o(s), o(t), n, i, r, l); return l.delete(s), u; case Vp: if (Dr) return Dr.call(s) == Dr.call(t); } return !1; } var Zp = 1, Xp = Object.prototype, Qp = Xp.hasOwnProperty; function Jp(s, t, e, n, i, r) { var l = e & Zp, o = el(s), a = o.length, h = el(t), u = h.length; if (a != u && !l) return !1; for (var f = a; f--; ) { var d = o[f]; if (!(l ? d in t : Qp.call(t, d))) return !1; } var g = r.get(s), m = r.get(t); if (g && m) return g == t && m == s; var b = !0; r.set(s, t), r.set(t, s); for (var y = l; ++f < a; ) { d = o[f]; var x = s[d], C = t[d]; if (n) var N = l ? n(C, x, d, t, s, r) : n(x, C, d, s, t, r); if (!(N === void 0 ? x === C || i(x, C, e, n, r) : N)) { b = !1; break; } y || (y = d == "constructor"); } if (b && !y) { var L = s.constructor, A = t.constructor; L != A && "constructor" in s && "constructor" in t && !(typeof L == "function" && L instanceof L && typeof A == "function" && A instanceof A) && (b = !1); } return r.delete(s), r.delete(t), b; } var tg = 1, qo = "[object Arguments]", Oo = "[object Array]", li = "[object Object]", eg = Object.prototype, Mo = eg.hasOwnProperty; function ng(s, t, e, n, i, r) { var l = Ge(s), o = Ge(t), a = l ? Oo : vs(s), h = o ? Oo : vs(t); a = a == qo ? li : a, h = h == qo ? li : h; var u = a == li, f = h == li, d = a == h; if (d && ms(s)) { if (!ms(t)) return !1; l = !0, u = !1; } if (d && !u) return r || (r = new ne()), l || _l(s) ? Za(s, t, e, n, i, r) : Yp(s, t, a, e, n, i, r); if (!(e & tg)) { var g = u && Mo.call(s, "__wrapped__"), m = f && Mo.call(t, "__wrapped__"); if (g || m) { var b = g ? s.value() : s, y = m ? t.value() : t; return r || (r = new ne()), i(b, y, e, n, r); } } return d ? (r || (r = new ne()), Jp(s, t, e, n, i, r)) : !1; } function Xa(s, t, e, n, i) { return s === t ? !0 : s == null || t == null || !be(s) && !be(t) ? s !== s && t !== t : ng(s, t, e, n, Xa, i); } function sg(s) { return function(t, e, n) { for (var i = -1, r = Object(t), l = n(t), o = l.length; o--; ) { var a = l[s ? o : ++i]; if (e(r[a], a, r) === !1) break; } return t; }; } var ig = sg(); const rg = ig; function rl(s, t, e) { (e !== void 0 && !Ls(s[t], e) || e === void 0 && !(t in s)) && Ol(s, t, e); } function lg(s) { return be(s) && _i(s); } function ll(s, t) { if (!(t === "constructor" && typeof s[t] == "function") && t != "__proto__") return s[t]; } function og(s) { return Ss(s, Is(s)); } function ag(s, t, e, n, i, r, l) { var o = ll(s, e), a = ll(t, e), h = l.get(a); if (h) { rl(s, e, h); return; } var u = r ? r(o, a, e + "", s, t, l) : void 0, f = u === void 0; if (f) { var d = Ge(a), g = !d && ms(a), m = !d && !g && _l(a); u = a, d || g || m ? Ge(o) ? u = o : lg(o) ? u = Ia(o) : g ? (f = !1, u = za(a, !0)) : m ? (f = !1, u = Wa(a, !0)) : u = [] : Hd(a) || tl(a) ? (u = o, tl(o) ? u = og(o) : (!ke(o) || ql(o)) && (u = Va(a))) : f = !1; } f && (l.set(a, u), i(u, a, n, r, l), l.delete(a)), rl(s, e, u); } function Qa(s, t, e, n, i) { s !== t && rg(t, function(r, l) { if (i || (i = new ne()), ke(r)) ag(s, t, l, e, Qa, n, i); else { var o = n ? n(ll(s, l), r, l + "", s, t, i) : void 0; o === void 0 && (o = r), rl(s, l, o); } }, Is); } function jl(s, t) { return Xa(s, t); } var cg = pu(function(s, t, e) { Qa(s, t, e); }); const Me = cg; var M = /* @__PURE__ */ ((s) => (s[s.TYPE = 3] = "TYPE", s[s.LEVEL = 12] = "LEVEL", s[s.ATTRIBUTE = 13] = "ATTRIBUTE", s[s.BLOT = 14] = "BLOT", s[s.INLINE = 7] = "INLINE", s[s.BLOCK = 11] = "BLOCK", s[s.BLOCK_BLOT = 10] = "BLOCK_BLOT", s[s.INLINE_BLOT = 6] = "INLINE_BLOT", s[s.BLOCK_ATTRIBUTE = 9] = "BLOCK_ATTRIBUTE", s[s.INLINE_ATTRIBUTE = 5] = "INLINE_ATTRIBUTE", s[s.ANY = 15] = "ANY", s))(M || {}); class le { constructor(t, e, n = {}) { this.attrName = t, this.keyName = e; const i = M.TYPE & M.ATTRIBUTE; this.scope = n.scope != null ? ( // Ignore type bits, force attribute bit n.scope & M.LEVEL | i ) : M.ATTRIBUTE, n.whitelist != null && (this.whitelist = n.whitelist); } static keys(t) { return Array.from(t.attributes).map((e) => e.name); } add(t, e) { return this.canAdd(t, e) ? (t.setAttribute(this.keyName, e), !0) : !1; } canAdd(t, e) { return this.whitelist == null ? !0 : typeof e == "string" ? this.whitelist.indexOf(e.replace(/["']/g, "")) > -1 : this.whitelist.indexOf(e) > -1; } remove(t) { t.removeAttribute(this.keyName); } value(t) { const e = t.getAttribute(this.keyName); return this.canAdd(t, e) && e ? e : ""; } } class In extends Error { constructor(t) { t = "[Parchment] " + t, super(t), this.message = t, this.name = this.constructor.name; } } const Ja = class ol { constructor() { this.attributes = {}, this.classes = {}, this.tags = {}, this.types = {}; } static find(t, e = !1) { if (t == null) return null; if (this.blots.has(t)) return this.blots.get(t) || null; if (e) { let n = null; try { n = t.parentNode; } catch { return null; } return this.find(n, e); } return null; } create(t, e, n) { const i = this.query(e); if (i == null) throw new In(`Unable to create ${e} blot`); const r = i, l = ( // @ts-expect-error Fix me later e instanceof Node || e.nodeType === Node.TEXT_NODE ? e : r.create(n) ), o = new r(t, l, n); return ol.blots.set(o.domNode, o), o; } find(t, e = !1) { return ol.find(t, e); } query(t, e = M.ANY) { let n; return typeof t == "string" ? n = this.types[t] || this.attributes[t] : t instanceof Text || t.nodeType === Node.TEXT_NODE ? n = this.types.text : typeof t == "number" ? t & M.LEVEL & M.BLOCK ? n = this.types.block : t & M.LEVEL & M.INLINE && (n = this.types.inline) : t instanceof Element && ((t.getAttribute("class") || "").split(/\s+/).some((i) => (n = this.classes[i], !!n)), n = n || this.tags[t.tagName]), n == null ? null : "scope" in n && e & M.LEVEL & n.scope && e & M.TYPE & n.scope ? n : null; } register(...t) { return t.map((e) => { const n = "blotName" in e, i = "attrName" in e; if (!n && !i) throw new In("Invalid definition"); if (n && e.blotName === "abstract") throw new In("Cannot register abstract class"); const r = n ? e.blotName : i ? e.attrName : void 0; return this.types[r] = e, i ? typeof e.keyName == "string" && (this.attributes[e.keyName] = e) : n && (e.className && (this.classes[e.className] = e), e.tagName && (Array.isArray(e.tagName) ? e.tagName = e.tagName.map((l) => l.toUpperCase()) : e.tagName = e.tagName.toUpperCase(), (Array.isArray(e.tagName) ? e.tagName : [e.tagName]).forEach((l) => { (this.tags[l] == null || e.className == null) && (this.tags[l] = e); }))), e; }); } }; Ja.blots = /* @__PURE__ */ new WeakMap(); let kn = Ja; function Ro(s, t) { return (s.getAttribute("class") || "").split(/\s+/).filter((e) => e.indexOf(`${t}-`) === 0); } class hg extends le { static keys(t) { return (t.getAttribute("class") || "").split(/\s+/).map((e) => e.split("-").slice(0, -1).join("-")); } add(t, e) { return this.canAdd(t, e) ? (this.remove(t), t.classList.add(`${this.keyName}-${e}`), !0) : !1; } remove(t) { Ro(t, this.keyName).forEach((e) => { t.classList.remove(e); }), t.classList.length === 0 && t.removeAttribute("class"); } value(t) { const e = (Ro(t, this.keyName)[0] || "").slice(this.keyName.length + 1); return this.canAdd(t, e) ? e : ""; } } const Kt = hg; function jr(s) { const t = s.split("-"), e = t.slice(1).map((n) => n[0].toUpperCase() + n.slice(1)).join(""); return t[0] + e; } class ug extends le { static keys(t) { return (t.getAttribute("style") || "").split(";").map((e) => e.split(":")[0].trim()); } add(t, e) { return this.canAdd(t, e) ? (t.style[jr(this.keyName)] = e, !0) : !1; } remove(t) { t.style[jr(this.keyName)] = "", t.getAttribute("style") || t.removeAttribute("style"); } value(t) { const e = t.style[jr(this.keyName)]; return this.canAdd(t, e) ? e : ""; } } const Be = ug; class dg { constructor(t) { this.attributes = {}, this.domNode = t, this.build(); } attribute(t, e) { e ? t.add(this.domNode, e) && (t.value(this.domNode) != null ? this.attributes[t.attrName] = t : delete this.attributes[t.attrName]) : (t.remove(this.domNode), delete this.attributes[t.attrName]); } build() { this.attributes = {}; const t = kn.find(this.domNode); if (t == null) return; const e = le.keys(this.domNode), n = Kt.keys(this.domNode), i = Be.keys(this.domNode); e.concat(n).concat(i).forEach((r) => { const l = t.scroll.query(r, M.ATTRIBUTE); l instanceof le && (this.attributes[l.attrName] = l); }); } copy(t) { Object.keys(this.attributes).forEach((e) => { const n = this.attributes[e].value(this.domNode); t.format(e, n); }); } move(t) { this.copy(t), Object.keys(this.attributes).forEach((e) => { this.attributes[e].remove(this.domNode); }), this.attributes = {}; } values() { return Object.keys(this.attributes).reduce( (t, e) => (t[e] = this.attributes[e].value(this.domNode), t), {} ); } } const $i = dg, tc = class { constructor(t, e) { this.scroll = t, this.domNode = e, kn.blots.set(e, this), this.prev = null, this.next = null; } static create(t) { if (this.tagName == null) throw new In("Blot definition missing tagName"); let e, n; return Array.isArray(this.tagName) ? (typeof t == "string" ? (n = t.toUpperCase(), parseInt(n, 10).toString() === n && (n = parseInt(n, 10))) : typeof t == "number" && (n = t), typeof n == "number" ? e = document.createElement(this.tagName[n - 1]) : n && this.tagName.indexOf(n) > -1 ? e = document.createElement(n) : e = document.createElement(this.tagName[0])) : e = document.createElement(this.tagName), this.className && e.classList.add(this.className), e; } // Hack for accessing inherited static methods get statics() { return this.constructor; } attach() { } clone() { const t = this.domNode.cloneNode(!1); return this.scroll.create(t); } detach() { this.parent != null && this.parent.removeChild(this), kn.blots.delete(this.domNode); } deleteAt(t, e) { this.isolate(t, e).remove(); } formatAt(t, e, n, i) { const r = this.isolate(t, e); if (this.scroll.query(n, M.BLOT) != null && i) r.wrap(n, i); else if (this.scroll.query(n, M.ATTRIBUTE) != null) { const l = this.scroll.create(this.statics.scope); r.wrap(l), l.format(n, i); } } insertAt(t, e, n) { const i = n == null ? this.scroll.create("text", e) : this.scroll.create(e, n), r = this.split(t); this.parent.insertBefore(i, r || void 0); } isolate(t, e) { const n = this.split(t); if (n == null) throw new Error("Attempt to isolate at end"); return n.split(e), n; } length() { return 1; } offset(t = this.parent) { return this.parent == null || this === t ? 0 : this.parent.children.offset(this) + this.parent.offset(t); } optimize(t) { this.statics.requiredContainer && !(this.parent instanceof this.statics.requiredContainer) && this.wrap(this.statics.requiredContainer.blotName); } remove() { this.domNode.parentNode != null && this.domNode.parentNode.removeChild(this.domNode), this.detach(); } replaceWith(t, e) { const n = typeof t == "string" ? this.scroll.create(t, e) : t; return this.parent != null && (this.parent.insertBefore(n, this.next || void 0), this.remove()), n; } split(t, e) { return t === 0 ? this : this.next; } update(t, e) { } wrap(t, e) { const n = typeof t == "string" ? this.scroll.create(t, e) : t; if (this.parent != null && this.parent.insertBefore(n, this.next || void 0), typeof n.appendChild != "function") throw new In(`Cannot wrap ${t}`); return n.appendChild(this), n; } }; tc.blotName = "abstract"; let ec = tc; const nc = class extends ec { /** * Returns the value represented by domNode if it is this Blot's type * No checking that domNode can represent this Blot type is required so * applications needing it should check externally before calling. */ static value(t) { return !0; } /** * Given location represented by node and offset from DOM Selection Range, * return index to that location. */ index(t, e) { return this.domNode === t || this.domNode.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_CONTAINED_BY ? Math.min(e, 1) : -1; } /** * Given index to location within blot, return node and offset representing * that location, consumable by DOM Selection Range */ position(t, e) { let n = Array.from(this.parent.domNode.childNodes).indexOf(this.domNode); return t > 0 && (n += 1), [this.parent.domNode, n]; } /** * Return value represented by this blot * Should not change without interaction from API or * user change detectable by update() */ value() { return { [this.statics.blotName]: this.statics.value(this.domNode) || !0 }; } }; nc.scope = M.INLINE_BLOT; let fg = nc; const gt = fg; class pg { constructor() { this.head = null, this.tail = null, this.length = 0; } append(...t) { if (this.insertBefore(t[0], null), t.length > 1) { const e = t.slice(1); this.append(...e); } } at(t) { const e = this.iterator(); let n = e(); for (; n && t > 0; ) t -= 1, n = e(); return n; } contains(t) { const e = this.iterator(); let n = e(); for (; n; ) { if (n === t) return !0; n = e(); } return !1; } indexOf(t) { const e = this.iterator(); let n = e(), i = 0; for (; n; ) { if (n === t) return i; i += 1, n = e(); } return -1; } insertBefore(t, e) { t != null && (this.remove(t), t.next = e, e != null ? (t.prev = e.prev, e.prev != null && (e.prev.next = t), e.prev = t, e === this.head && (this.head = t)) : this.tail != null ? (this.tail.next = t, t.prev = this.tail, this.tail = t) : (t.prev = null, this.head = this.tail = t), this.length += 1); } offset(t) { let e = 0, n = this.head; for (; n != null; ) { if (n === t) return e; e += n.length(), n = n.next; } return -1; } remove(t) { this.contains(t) && (t.prev != null && (t.prev.next = t.next), t.next != null && (t.next.prev = t.prev), t === this.head && (this.head = t.next), t === this.tail && (this.tail = t.prev), this.length -= 1); } iterator(t = this.head) { return () => { const e = t; return t != null && (t = t.next), e; }; } find(t, e = !1) { const n = this.iterator(); let i = n(); for (; i; ) { const r = i.length(); if (t < r || e && t === r && (i.next == null || i.next.length() !== 0)) return [i, t]; t -= r, i = n(); } return [null, 0]; } forEach(t) { const e = this.iterator(); let n = e(); for (; n; ) t(n), n = e(); } forEachAt(t, e, n) { if (e <= 0) return; const [i, r] = this.find(t); let l = t - r; const o = this.iterator(i); let a = o(); for (; a && l < t + e; ) { const h = a.length(); t > l ? n( a, t - l, Math.min(e, l + h - t) ) : n(a, 0, Math.min(h, t + e - l)), l += h, a = o(); } } map(t) { return this.reduce((e, n) => (e.push(t(n)), e), []); } reduce(t, e) { const n = this.iterator(); let i = n(); for (; i; ) e = t(e, i), i = n(); return e; } } function _o(s, t) { const e = t.find(s); if (e) return e; try { return t.create(s); } catch { const n = t.create(M.INLINE); return Array.from(s.childNodes).forEach((i) => { n.domNode.appendChild(i); }), s.parentNode && s.parentNode.replaceChild(n.domNode, s), n.attach(), n; } } const sc = class Ne extends ec { constructor(t, e) { super(t, e), this.uiNode = null, this.build(); } appendChild(t) { this.insertBefore(t); } attach() { super.attach(), this.children.forEach((t) => { t.attach(); }); } attachUI(t) { this.uiNode != null && this.uiNode.remove(), this.uiNode = t, Ne.uiClass && this.uiNode.classList.add(Ne.uiClass), this.uiNode.setAttribute("contenteditable", "false"), this.domNode.insertBefore(this.uiNode, this.domNode.firstChild); } /** * Called during construction, should fill its own children LinkedList. */ build() { this.children = new pg(), Array.from(this.domNode.childNodes).filter((t) => t !== this.uiNode).reverse().forEach((t) => { try { const e = _o(t, this.scroll); this.insertBefore(e, this.children.head || void 0); } catch (e) { if (e instanceof In) return; throw e; } }); } deleteAt(t, e) { if (t === 0 && e === this.length()) return this.remove(); this.children.forEachAt(t, e, (n, i, r) => { n.deleteAt(i, r); }); } descendant(t, e = 0) { const [n, i] = this.children.find(e); return t.blotName == null && t(n) || t.blotName != null && n instanceof t ? [n, i] : n instanceof Ne ? n.descendant(t, i) : [null, -1]; } descendants(t, e = 0, n = Number.MAX_VALUE) { let i = [], r = n; return this.children.forEachAt( e, n, (l, o, a) => { (t.blotName == null && t(l) || t.blotName != null && l instanceof t) && i.push(l), l instanceof Ne && (i = i.concat( l.descendants(t, o, r) )), r -= a; } ), i; } detach() { this.children.forEach((t) => { t.detach(); }), super.detach(); } enforceAllowedChildren() { let t = !1; this.children.forEach((e) => { t || this.statics.allowedChildren.some( (n) => e instanceof n ) || (e.statics.scope === M.BLOCK_BLOT ? (e.next != null && this.splitAfter(e), e.prev != null && this.splitAfter(e.prev), e.parent.unwrap(), t = !0) : e instanceof Ne ? e.unwrap() : e.remove()); }); } formatAt(t, e, n, i) { this.children.forEachAt(t, e, (r, l, o) => { r.formatAt(l, o, n, i); }); } insertAt(t, e, n) { const [i, r] = this.children.find(t); if (i) i.insertAt(r, e, n); else { const l = n == null ? this.scroll.create("text", e) : this.scroll.create(e, n); this.appendChild(l); } } insertBefore(t, e) { t.parent != null && t.parent.children.remove(t); let n = null; this.children.insertBefore(t, e || null), t.parent = this, e != null && (n = e.domNode), (this.domNode.parentNode !== t.domNode || this.domNode.nextSibling !== n) && this.domNode.insertBefore(t.domNode, n), t.attach(); } length() { return this.children.reduce((t, e) => t + e.length(), 0); } moveChildren(t, e) { this.children.forEach((n) => { t.insertBefore(n, e); }); } optimize(t) { if (super.optimize(t), this.enforceAllowedChildren(), this.uiNode != null && this.uiNode !== this.domNode.firstChild && this.domNode.insertBefore(this.uiNode, this.domNode.firstChild), this.children.length === 0) if (this.statics.defaultChild != null) { const e = this.scroll.create(this.statics.defaultChild.blotName); this.appendChild(e); } else this.remove(); } path(t, e = !1) { const [n, i] = this.children.find(t, e), r = [[this, t]]; return n instanceof Ne ? r.concat(n.path(i, e)) : (n != null && r.push([n, i]), r); } removeChild(t) { this.children.remove(t); } replaceWith(t, e) { const n = typeof t == "string" ? this.scroll.create(t, e) : t; return n instanceof Ne && this.moveChildren(n), super.replaceWith(n); } split(t, e = !1) { if (!e) { if (t === 0) return this; if (t === this.length()) return this.next; } const n = this.clone(); return this.parent && this.parent.insertBefore(n, this.next || void 0), this.children.forEachAt(t, this.length(), (i, r, l) => { const o = i.split(r, e); o != null && n.appendChild(o); }), n; } splitAfter(t) { const e = this.clone(); for (; t.next != null; ) e.appendChild(t.next); return this.parent && this.parent.insertBefore(e, this.next || void 0), e; } unwrap() { this.parent && this.moveChildren(this.parent, this.next || void 0), this.remove(); } update(t, e) { const n = [], i = []; t.forEach((r) => { r.target === this.domNode && r.type === "childList" && (n.push(...r.addedNodes), i.push(...r.removedNodes)); }), i.forEach((r) => { if (r.parentNode != null && // @ts-expect-error Fix me later r.tagName !== "IFRAME" && document.body.compareDocumentPosition(r) & Node.DOCUMENT_POSITION_CONTAINED_BY) return; const l = this.scroll.find(r); l != null && (l.domNode.parentNode == null || l.domNode.parentNode === this.domNode) && l.detach(); }), n.filter((r) => r.parentNode === this.domNode && r !== this.uiNode).sort((r, l) => r === l ? 0 : r.compareDocumentPosition(l) & Node.DOCUMENT_POSITION_FOLLOWING ? 1 : -1).forEach((r) => { let l = null; r.nextSibling != null && (l = this.scroll.find(r.nextSibling)); const o = _o(r, this.scroll); (o.next !== l || o.next == null) && (o.parent != null && o.parent.removeChild(this), this.insertBefore(o, l || void 0)); }), this.enforceAllowedChildren(); } }; sc.uiClass = ""; let gg = sc; const Ut = gg; function mg(s, t) { if (Object.keys(s).length !== Object.keys(t).length) return !1; for (const e in s) if (s[e] !== t[e]) return !1; return !0; } const xn = class En extends Ut { static create(t) { return super.create(t); } static formats(t, e) { const n = e.query(En.blotName); if (!(n != null && t.tagName === n.tagName)) { if (typeof this.tagName == "string") return !0; if (Array.isArray(this.tagName)) return t.tagName.toLowerCase(); } } constructor(t, e) { super(t, e), this.attributes = new $i(this.domNode); } format(t, e) { if (t === this.statics.blotName && !e) this.children.forEach((n) => { n instanceof En || (n = n.wrap(En.blotName, !0)), this.attributes.copy(n); }), this.unwrap(); else { const n = this.scroll.query(t, M.INLINE); if (n == null) return; n instanceof le ? this.attributes.attribute(n, e) : e && (t !== this.statics.blotName || this.formats()[t] !== e) && this.replaceWith(t, e); } } formats() { const t = this.attributes.values(), e = this.statics.formats(this.domNode, this.scroll); return e != null && (t[this.statics.blotName] = e), t; } formatAt(t, e, n, i) { this.formats()[n] != null || this.scroll.query(n, M.ATTRIBUTE) ? this.isolate(t, e).format(n, i) : super.formatAt(t, e, n, i); } optimize(t) { super.optimize(t); const e = this.formats(); if (Object.keys(e).length === 0) return this.unwrap(); const n = this.next; n instanceof En && n.prev === this && mg(e, n.formats()) && (n.moveChildren(this), n.remove()); } replaceWith(t, e) { const n = super.replaceWith(t, e); return this.attributes.copy(n), n; } update(t, e) { super.update(t, e), t.some( (n) => n.target === this.domNode && n.type === "attributes" ) && this.attributes.build(); } wrap(t, e) { const n = super.wrap(t, e); return n instanceof En && this.attributes.move(n), n; } }; xn.allowedChildren = [xn, gt], xn.blotName = "inline", xn.scope = M.INLINE_BLOT, xn.tagName = "SPAN"; let bg = xn; const Pl = bg, Cn = class al extends Ut { static create(t) { return super.create(t); } static formats(t, e) { const n = e.query(al.blotName); if (!(n != null && t.tagName === n.tagName)) { if (typeof this.tagName == "string") return !0; if (Array.isArray(this.tagName)) return t.tagName.toLowerCase(); } } constructor(t, e) { super(t, e), this.attributes = new $i(this.domNode); } format(t, e) { const n = this.scroll.query(t, M.BLOCK); n != null && (n instanceof le ? this.attributes.attribute(n, e) : t === this.statics.blotName && !e ? this.replaceWith(al.blotName) : e && (t !== this.statics.blotName || this.formats()[t] !== e) && this.replaceWith(t, e)); } formats() { const t = this.attributes.values(), e = this.statics.formats(this.domNode, this.scroll); return e != null && (t[this.statics.blotName] = e), t; } formatAt(t, e, n, i) { this.scroll.query(n, M.BLOCK) != null ? this.format(n, i) : super.formatAt(t, e, n, i); } insertAt(t, e, n) { if (n == null || this.scroll.query(e, M.INLINE) != null) super.insertAt(t, e, n); else { const i = this.split(t); if (i != null) { const r = this.scroll.create(e, n); i.parent.insertBefore(r, i); } else throw new Error("Attempt to insertAt after block boundaries"); } } replaceWith(t, e) { const n = super.replaceWith(t, e); return this.attributes.copy(n), n; } update(t, e) { super.update(t, e), t.some( (n) => n.target === this.domNode && n.type === "attributes" ) && this.attributes.build(); } }; Cn.blotName = "block", Cn.scope = M.BLOCK_BLOT, Cn.tagName = "P", Cn.allowedChildren = [ Pl, Cn, gt ]; let yg = Cn; const ws = yg, cl = class extends Ut { checkMerge() { return this.next !== null && this.next.statics.blotName === this.statics.blotName; } deleteAt(t, e) { super.deleteAt(t, e), this.enforceAllowedChildren(); } formatAt(t, e, n, i) { super.formatAt(t, e, n, i), this.enforceAllowedChildren(); } insertAt(t, e, n) { super.insertAt(t, e, n), this.enforceAllowedChildren(); } optimize(t) { super.optimize(t), this.children.length > 0 && this.next != null && this.checkMerge() && (this.next.moveChildren(this), this.next.remove()); } }; cl.blotName = "container", cl.scope = M.BLOCK_BLOT; let vg = cl; const Di = vg; class wg extends gt { static formats(t, e) { } format(t, e) { super.formatAt(0, this.length(), t, e); } formatAt(t, e, n, i) { t === 0 && e === this.length() ? this.format(n, i) : super.formatAt(t, e, n, i); } formats() { return this.statics.formats(this.domNode, this.scroll); } } const At = wg, xg = { attributes: !0, characterData: !0, characterDataOldValue: !0, childList: !0, subtree: !0 }, Eg = 100, Nn = class extends Ut { constructor(t, e) { super(null, e), this.registry = t, this.scroll = this, this.build(), this.observer = new MutationObserver((n) => { this.update(n); }), this.observer.observe(this.domNode, xg), this.attach();