@editora/core 1.0.32 → 1.0.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- class Co {
1
+ class _o {
2
2
  constructor() {
3
3
  this.loadedPlugins = /* @__PURE__ */ new Map(), this.pluginRegistry = /* @__PURE__ */ new Map();
4
4
  }
@@ -86,19 +86,19 @@ class Co {
86
86
  return this.loadedPlugins.has(t);
87
87
  }
88
88
  }
89
- class qt {
89
+ class Yt {
90
90
  constructor(t, e, o) {
91
91
  this.doc = t, this.selection = e, this.schema = o;
92
92
  }
93
93
  static create(t, e) {
94
94
  const o = e || t.node("doc", {}, [t.node("paragraph")]);
95
- return new qt(o, { anchor: 0, head: 0 }, t);
95
+ return new Yt(o, { anchor: 0, head: 0 }, t);
96
96
  }
97
97
  apply(t, e) {
98
- return new qt(t, e || this.selection, this.schema);
98
+ return new Yt(t, e || this.selection, this.schema);
99
99
  }
100
100
  }
101
- class ln {
101
+ class dn {
102
102
  constructor(t, e) {
103
103
  this.nodes = new Map(Object.entries(t)), this.marks = new Map(Object.entries(e));
104
104
  }
@@ -109,7 +109,7 @@ class ln {
109
109
  return { type: "text", text: t, marks: e };
110
110
  }
111
111
  }
112
- class cn {
112
+ class un {
113
113
  constructor() {
114
114
  this.plugins = [], this.pluginConfigs = /* @__PURE__ */ new Map();
115
115
  }
@@ -146,7 +146,7 @@ class cn {
146
146
  const t = {}, e = {};
147
147
  return this.plugins.forEach((o) => {
148
148
  o.nodes && Object.assign(t, o.nodes), o.marks && Object.assign(e, o.marks);
149
- }), new ln(t, e);
149
+ }), new dn(t, e);
150
150
  }
151
151
  getCommands() {
152
152
  const t = {};
@@ -200,7 +200,7 @@ class cn {
200
200
  await Promise.all(t), this.plugins = [], this.pluginConfigs.clear();
201
201
  }
202
202
  }
203
- class dn {
203
+ class pn {
204
204
  constructor(t = {}) {
205
205
  this.commands = /* @__PURE__ */ new Map(), Object.entries(t).forEach(([e, o]) => {
206
206
  this.register(e, o);
@@ -243,11 +243,11 @@ class dn {
243
243
  this.commands.clear();
244
244
  }
245
245
  }
246
- class un {
246
+ class fn {
247
247
  constructor(t = {}) {
248
- this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new cn(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((o) => this.pluginManager.register(o));
248
+ this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new un(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((o) => this.pluginManager.register(o));
249
249
  const e = this.pluginManager.buildSchema();
250
- this.state = qt.create(e), this.commandRegistry = new dn(this.pluginManager.getCommands());
250
+ this.state = Yt.create(e), this.commandRegistry = new pn(this.pluginManager.getCommands());
251
251
  }
252
252
  /**
253
253
  * Execute a command
@@ -329,7 +329,7 @@ class un {
329
329
  return this.isDestroyed;
330
330
  }
331
331
  }
332
- class pn {
332
+ class hn {
333
333
  constructor(t, e, o) {
334
334
  this.overflowUnits = [], this.overflowUnitHomes = /* @__PURE__ */ new WeakMap(), this.expandedOpen = !1, this.onDocumentPointerDownForOverflow = (i) => {
335
335
  var l, c;
@@ -515,25 +515,25 @@ class pn {
515
515
  const r = () => {
516
516
  const c = this.overflowUnits;
517
517
  if (c.length === 0) return;
518
- c.forEach((H) => {
519
- var D;
520
- H.parentElement === i && ((D = this.overflowUnitHomes.get(H)) == null || D.appendChild(H));
518
+ c.forEach((B) => {
519
+ var O;
520
+ B.parentElement === i && ((O = this.overflowUnitHomes.get(B)) == null || O.appendChild(B));
521
521
  });
522
- const p = t.clientWidth, m = 16, g = 40, w = 4, T = Math.max(0, p - m), v = Math.max(0, T - g - w), k = getComputedStyle(t).direction === "rtl", et = e.getBoundingClientRect(), $ = (H) => {
523
- const D = H.getBoundingClientRect();
524
- return k ? et.right - D.left : D.right - et.left;
522
+ const p = t.clientWidth, m = 16, g = 40, w = 4, T = Math.max(0, p - m), v = Math.max(0, T - g - w), k = getComputedStyle(t).direction === "rtl", et = e.getBoundingClientRect(), $ = (B) => {
523
+ const O = B.getBoundingClientRect();
524
+ return k ? et.right - O.left : O.right - et.left;
525
525
  };
526
526
  let z = 0;
527
527
  if ($(c[c.length - 1]) <= T)
528
528
  z = c.length;
529
529
  else
530
- for (const H of c)
531
- if ($(H) <= v) z++;
530
+ for (const B of c)
531
+ if ($(B) <= v) z++;
532
532
  else break;
533
533
  z = Math.max(1, Math.min(z, c.length));
534
534
  const st = z < c.length;
535
- o.style.display = st ? "" : "none", o.classList.toggle("active", st && this.expandedOpen), !st && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((H, D) => {
536
- D >= z && i.appendChild(H);
535
+ o.style.display = st ? "" : "none", o.classList.toggle("active", st && this.expandedOpen), !st && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((B, O) => {
536
+ O >= z && i.appendChild(B);
537
537
  });
538
538
  }, l = () => {
539
539
  this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), this.overflowRafId = requestAnimationFrame(r);
@@ -759,7 +759,7 @@ class pn {
759
759
  }), this.container.innerHTML = ""), (t = this.resizeObserver) == null || t.disconnect(), this.resizeObserver = void 0, this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), document.removeEventListener("mousedown", this.onDocumentPointerDownForOverflow, !0), this.itemsContainer = void 0, this.moreButton = void 0, this.expandedRow = void 0, this.commandHandler = void 0;
760
760
  }
761
761
  }
762
- class fn {
762
+ class mn {
763
763
  constructor(t) {
764
764
  this.visible = !1, this.config = t;
765
765
  }
@@ -801,7 +801,7 @@ class fn {
801
801
  this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0, this.visible = !1;
802
802
  }
803
803
  }
804
- class hn {
804
+ class gn {
805
805
  constructor(t = {}) {
806
806
  this.statusInfo = {}, this.config = t;
807
807
  }
@@ -861,12 +861,12 @@ class hn {
861
861
  this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0;
862
862
  }
863
863
  }
864
- function mn(a, t) {
865
- const e = a.textContent || "", o = gn(a, t.startContainer, t.startOffset), r = e.substring(0, o).split(`
864
+ function bn(a, t) {
865
+ const e = a.textContent || "", o = yn(a, t.startContainer, t.startOffset), r = e.substring(0, o).split(`
866
866
  `), l = r.length, c = r[r.length - 1].length + 1;
867
867
  return { line: l, column: c };
868
868
  }
869
- function gn(a, t, e) {
869
+ function yn(a, t, e) {
870
870
  var l;
871
871
  let o = 0;
872
872
  const i = document.createTreeWalker(
@@ -884,7 +884,7 @@ function gn(a, t, e) {
884
884
  }
885
885
  return o;
886
886
  }
887
- function bn(a) {
887
+ function En(a) {
888
888
  var o, i;
889
889
  const t = a.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");
890
890
  let e = 1;
@@ -899,11 +899,11 @@ function bn(a) {
899
899
  }
900
900
  return e;
901
901
  }
902
- function yn(a) {
902
+ function vn(a) {
903
903
  const t = a.trim() ? a.trim().split(/\s+/).length : 0, e = a.length;
904
904
  return { words: t, chars: e };
905
905
  }
906
- function En(a, t) {
906
+ function wn(a, t) {
907
907
  const e = a.toString();
908
908
  return {
909
909
  startLine: t.line,
@@ -915,7 +915,7 @@ function En(a, t) {
915
915
  selectedWords: e.trim().split(/\s+/).filter(Boolean).length
916
916
  };
917
917
  }
918
- class vn {
918
+ class Tn {
919
919
  constructor(t) {
920
920
  this.shortcuts = /* @__PURE__ */ new Map(), this.enabled = !0, this.isMac = typeof navigator != "undefined" && navigator.platform.toUpperCase().indexOf("MAC") >= 0, (t == null ? void 0 : t.enabled) === !1 && (this.enabled = !1), this.registerDefaultShortcuts(), t != null && t.shortcuts && t.shortcuts.forEach((e) => this.registerShortcut(e)), t != null && t.customShortcuts && Object.values(t.customShortcuts).forEach((e) => {
921
921
  this.registerShortcut(e);
@@ -1250,15 +1250,15 @@ class vn {
1250
1250
  return t.includes("toggle") && (t.includes("Bold") || t.includes("Italic") || t.includes("Underline") || t.includes("Strike") || t.includes("Code") || t.includes("Super") || t.includes("Sub")) ? "Text Formatting" : t.includes("Heading") || t.includes("Paragraph") ? "Block Formatting" : t.includes("List") || t.includes("Checklist") ? "Lists" : t.includes("Alignment") || t.includes("Indent") ? "Alignment & Indentation" : t.includes("undo") || t.includes("redo") ? "History" : t.includes("insert") ? "Insert" : t.includes("find") || t.includes("replace") ? "Find & Replace" : t.includes("Accessibility") || t.includes("spell") ? "Tools" : "Other";
1251
1251
  }
1252
1252
  }
1253
- function ro(a, t) {
1253
+ function ao(a, t) {
1254
1254
  (t == null || t > a.length) && (t = a.length);
1255
1255
  for (var e = 0, o = Array(t); e < t; e++) o[e] = a[e];
1256
1256
  return o;
1257
1257
  }
1258
- function wn(a) {
1258
+ function kn(a) {
1259
1259
  if (Array.isArray(a)) return a;
1260
1260
  }
1261
- function Tn(a, t) {
1261
+ function xn(a, t) {
1262
1262
  var e = a == null ? null : typeof Symbol != "undefined" && a[Symbol.iterator] || a["@@iterator"];
1263
1263
  if (e != null) {
1264
1264
  var o, i, r, l, c = [], p = !0, m = !1;
@@ -1276,127 +1276,127 @@ function Tn(a, t) {
1276
1276
  return c;
1277
1277
  }
1278
1278
  }
1279
- function kn() {
1279
+ function An() {
1280
1280
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1281
1281
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1282
1282
  }
1283
- function xn(a, t) {
1284
- return wn(a) || Tn(a, t) || An(a, t) || kn();
1283
+ function Cn(a, t) {
1284
+ return kn(a) || xn(a, t) || Sn(a, t) || An();
1285
1285
  }
1286
- function An(a, t) {
1286
+ function Sn(a, t) {
1287
1287
  if (a) {
1288
- if (typeof a == "string") return ro(a, t);
1288
+ if (typeof a == "string") return ao(a, t);
1289
1289
  var e = {}.toString.call(a).slice(8, -1);
1290
- return e === "Object" && a.constructor && (e = a.constructor.name), e === "Map" || e === "Set" ? Array.from(a) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? ro(a, t) : void 0;
1290
+ return e === "Object" && a.constructor && (e = a.constructor.name), e === "Map" || e === "Set" ? Array.from(a) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? ao(a, t) : void 0;
1291
1291
  }
1292
1292
  }
1293
- const So = Object.entries, ao = Object.setPrototypeOf, Cn = Object.isFrozen, Sn = Object.getPrototypeOf, _n = Object.getOwnPropertyDescriptor;
1294
- let M = Object.freeze, I = Object.seal, yt = Object.create, _o = typeof Reflect != "undefined" && Reflect, Te = _o.apply, ke = _o.construct;
1293
+ const Lo = Object.entries, so = Object.setPrototypeOf, _n = Object.isFrozen, Ln = Object.getPrototypeOf, Mn = Object.getOwnPropertyDescriptor;
1294
+ let M = Object.freeze, I = Object.seal, Et = Object.create, Mo = typeof Reflect != "undefined" && Reflect, ke = Mo.apply, xe = Mo.construct;
1295
1295
  M || (M = function(t) {
1296
1296
  return t;
1297
1297
  });
1298
1298
  I || (I = function(t) {
1299
1299
  return t;
1300
1300
  });
1301
- Te || (Te = function(t, e) {
1301
+ ke || (ke = function(t, e) {
1302
1302
  for (var o = arguments.length, i = new Array(o > 2 ? o - 2 : 0), r = 2; r < o; r++) i[r - 2] = arguments[r];
1303
1303
  return t.apply(e, i);
1304
1304
  });
1305
- ke || (ke = function(t) {
1305
+ xe || (xe = function(t) {
1306
1306
  for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
1307
1307
  return new t(...o);
1308
1308
  });
1309
- const at = L(Array.prototype.forEach), Ln = L(Array.prototype.lastIndexOf), so = L(Array.prototype.pop), At = L(Array.prototype.push), Mn = L(Array.prototype.splice), Et = Array.isArray, Mt = L(String.prototype.toLowerCase), he = L(String.prototype.toString), lo = L(String.prototype.match), Ct = L(String.prototype.replace), co = L(String.prototype.indexOf), In = L(String.prototype.trim), On = L(Number.prototype.toString), Dn = L(Boolean.prototype.toString), uo = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), po = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), N = L(Object.prototype.hasOwnProperty), St = L(Object.prototype.toString), O = L(RegExp.prototype.test), J = Rn(TypeError);
1309
+ const at = L(Array.prototype.forEach), In = L(Array.prototype.lastIndexOf), lo = L(Array.prototype.pop), Ct = L(Array.prototype.push), Dn = L(Array.prototype.splice), vt = Array.isArray, Mt = L(String.prototype.toLowerCase), he = L(String.prototype.toString), co = L(String.prototype.match), St = L(String.prototype.replace), uo = L(String.prototype.indexOf), On = L(String.prototype.trim), Rn = L(Number.prototype.toString), Pn = L(Boolean.prototype.toString), po = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), fo = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), N = L(Object.prototype.hasOwnProperty), _t = L(Object.prototype.toString), D = L(RegExp.prototype.test), Z = Nn(TypeError);
1310
1310
  function L(a) {
1311
1311
  return function(t) {
1312
1312
  t instanceof RegExp && (t.lastIndex = 0);
1313
1313
  for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
1314
- return Te(a, t, o);
1314
+ return ke(a, t, o);
1315
1315
  };
1316
1316
  }
1317
- function Rn(a) {
1317
+ function Nn(a) {
1318
1318
  return function() {
1319
1319
  for (var t = arguments.length, e = new Array(t), o = 0; o < t; o++) e[o] = arguments[o];
1320
- return ke(a, e);
1320
+ return xe(a, e);
1321
1321
  };
1322
1322
  }
1323
1323
  function E(a, t) {
1324
1324
  let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Mt;
1325
- if (ao && ao(a, null), !Et(t)) return a;
1325
+ if (so && so(a, null), !vt(t)) return a;
1326
1326
  let o = t.length;
1327
1327
  for (; o--; ) {
1328
1328
  let i = t[o];
1329
1329
  if (typeof i == "string") {
1330
1330
  const r = e(i);
1331
- r !== i && (Cn(t) || (t[o] = r), i = r);
1331
+ r !== i && (_n(t) || (t[o] = r), i = r);
1332
1332
  }
1333
1333
  a[i] = !0;
1334
1334
  }
1335
1335
  return a;
1336
1336
  }
1337
- function Pn(a) {
1337
+ function zn(a) {
1338
1338
  for (let t = 0; t < a.length; t++) N(a, t) || (a[t] = null);
1339
1339
  return a;
1340
1340
  }
1341
1341
  function U(a) {
1342
- const t = yt(null);
1343
- for (const o of So(a)) {
1344
- var e = xn(o, 2);
1342
+ const t = Et(null);
1343
+ for (const o of Lo(a)) {
1344
+ var e = Cn(o, 2);
1345
1345
  const i = e[0], r = e[1];
1346
- N(a, i) && (Et(r) ? t[i] = Pn(r) : r && typeof r == "object" && r.constructor === Object ? t[i] = U(r) : t[i] = r);
1346
+ N(a, i) && (vt(r) ? t[i] = zn(r) : r && typeof r == "object" && r.constructor === Object ? t[i] = U(r) : t[i] = r);
1347
1347
  }
1348
1348
  return t;
1349
1349
  }
1350
- function Nn(a) {
1350
+ function Bn(a) {
1351
1351
  switch (typeof a) {
1352
1352
  case "string":
1353
1353
  return a;
1354
1354
  case "number":
1355
- return On(a);
1355
+ return Rn(a);
1356
1356
  case "boolean":
1357
- return Dn(a);
1357
+ return Pn(a);
1358
1358
  case "bigint":
1359
- return uo ? uo(a) : "0";
1359
+ return po ? po(a) : "0";
1360
1360
  case "symbol":
1361
- return po ? po(a) : "Symbol()";
1361
+ return fo ? fo(a) : "Symbol()";
1362
1362
  case "undefined":
1363
- return St(a);
1363
+ return _t(a);
1364
1364
  case "function":
1365
1365
  case "object": {
1366
- if (a === null) return St(a);
1366
+ if (a === null) return _t(a);
1367
1367
  const t = a, e = W(t, "toString");
1368
1368
  if (typeof e == "function") {
1369
1369
  const o = e(t);
1370
- return typeof o == "string" ? o : St(o);
1370
+ return typeof o == "string" ? o : _t(o);
1371
1371
  }
1372
- return St(a);
1372
+ return _t(a);
1373
1373
  }
1374
1374
  default:
1375
- return St(a);
1375
+ return _t(a);
1376
1376
  }
1377
1377
  }
1378
1378
  function W(a, t) {
1379
1379
  for (; a !== null; ) {
1380
- const o = _n(a, t);
1380
+ const o = Mn(a, t);
1381
1381
  if (o) {
1382
1382
  if (o.get) return L(o.get);
1383
1383
  if (typeof o.value == "function") return L(o.value);
1384
1384
  }
1385
- a = Sn(a);
1385
+ a = Ln(a);
1386
1386
  }
1387
1387
  function e() {
1388
1388
  return null;
1389
1389
  }
1390
1390
  return e;
1391
1391
  }
1392
- function zn(a) {
1392
+ function Hn(a) {
1393
1393
  try {
1394
- return O(a, ""), !0;
1394
+ return D(a, ""), !0;
1395
1395
  } catch (t) {
1396
1396
  return !1;
1397
1397
  }
1398
1398
  }
1399
- const fo = M([
1399
+ const ho = M([
1400
1400
  "a",
1401
1401
  "abbr",
1402
1402
  "acronym",
@@ -1590,7 +1590,7 @@ const fo = M([
1590
1590
  "feSpotLight",
1591
1591
  "feTile",
1592
1592
  "feTurbulence"
1593
- ]), Hn = M([
1593
+ ]), Fn = M([
1594
1594
  "animate",
1595
1595
  "color-profile",
1596
1596
  "cursor",
@@ -1644,7 +1644,7 @@ const fo = M([
1644
1644
  "munder",
1645
1645
  "munderover",
1646
1646
  "mprescripts"
1647
- ]), Bn = M([
1647
+ ]), Un = M([
1648
1648
  "maction",
1649
1649
  "maligngroup",
1650
1650
  "malignmark",
@@ -1660,7 +1660,7 @@ const fo = M([
1660
1660
  "annotation-xml",
1661
1661
  "mprescripts",
1662
1662
  "none"
1663
- ]), ho = M(["#text"]), mo = M([
1663
+ ]), mo = M(["#text"]), go = M([
1664
1664
  "accept",
1665
1665
  "action",
1666
1666
  "align",
@@ -1972,7 +1972,7 @@ const fo = M([
1972
1972
  "y2",
1973
1973
  "z",
1974
1974
  "zoomandpan"
1975
- ]), go = M([
1975
+ ]), bo = M([
1976
1976
  "accent",
1977
1977
  "accentunder",
1978
1978
  "align",
@@ -2033,7 +2033,7 @@ const fo = M([
2033
2033
  "xlink:title",
2034
2034
  "xml:space",
2035
2035
  "xmlns:xlink"
2036
- ]), Fn = I(/{{[\w\W]*|^[\w\W]*}}/g), Un = I(/<%[\w\W]*|^[\w\W]*%>/g), jn = I(/\${[\w\W]*/g), Wn = I(/^data-[\-\w.\u00B7-\uFFFF]+$/), $n = I(/^aria-[\-\w]+$/), bo = I(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Gn = I(/^(?:\w+script|data):/i), Kn = I(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Yn = I(/^html$/i), qn = I(/^[a-z][.\w]*(-[.\w]+)+$/i), yo = I(/<[/\w!]/g), Eo = I(/<[/\w]/g), Vn = I(/<\/no(script|embed|frames)/i), Xn = I(/\/>/i), F = {
2036
+ ]), jn = I(/{{[\w\W]*|^[\w\W]*}}/g), Wn = I(/<%[\w\W]*|^[\w\W]*%>/g), $n = I(/\${[\w\W]*/g), Gn = I(/^data-[\-\w.\u00B7-\uFFFF]+$/), Kn = I(/^aria-[\-\w]+$/), yo = I(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), qn = I(/^(?:\w+script|data):/i), Yn = I(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Vn = I(/^html$/i), Xn = I(/^[a-z][.\w]*(-[.\w]+)+$/i), Eo = I(/<[/\w!]/g), vo = I(/<[/\w]/g), Qn = I(/<\/no(script|embed|frames)/i), Zn = I(/\/>/i), F = {
2037
2037
  element: 1,
2038
2038
  attribute: 2,
2039
2039
  text: 3,
@@ -2046,7 +2046,7 @@ const fo = M([
2046
2046
  documentType: 10,
2047
2047
  documentFragment: 11,
2048
2048
  notation: 12
2049
- }, Lo = [
2049
+ }, Io = [
2050
2050
  "style",
2051
2051
  "script",
2052
2052
  "xmp",
@@ -2055,14 +2055,14 @@ const fo = M([
2055
2055
  "noframes",
2056
2056
  "plaintext",
2057
2057
  "noscript"
2058
- ], Zn = M(E({}, Lo)), Jn = (function() {
2058
+ ], Jn = M(E({}, Io)), ti = (function() {
2059
2059
  const a = {};
2060
- return at(Lo, (t) => {
2060
+ return at(Io, (t) => {
2061
2061
  a[t] = I(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
2062
2062
  }), M(a);
2063
- })(), Qn = function() {
2063
+ })(), ei = function() {
2064
2064
  return typeof window == "undefined" ? null : window;
2065
- }, ti = function(t, e) {
2065
+ }, oi = function(t, e) {
2066
2066
  if (typeof t != "object" || typeof t.createPolicy != "function") return null;
2067
2067
  let o = null;
2068
2068
  const i = "data-tt-policy-suffix";
@@ -2080,7 +2080,7 @@ const fo = M([
2080
2080
  } catch (l) {
2081
2081
  return console.warn("TrustedTypes policy " + r + " could not be created."), null;
2082
2082
  }
2083
- }, vo = function() {
2083
+ }, wo = function() {
2084
2084
  return {
2085
2085
  afterSanitizeAttributes: [],
2086
2086
  afterSanitizeElements: [],
@@ -2092,15 +2092,15 @@ const fo = M([
2092
2092
  uponSanitizeElement: [],
2093
2093
  uponSanitizeShadowNode: []
2094
2094
  };
2095
- }, Q = function(t, e, o, i) {
2096
- return N(t, e) && Et(t[e]) ? E(i.base ? U(i.base) : {}, t[e], i.transform) : o;
2095
+ }, J = function(t, e, o, i) {
2096
+ return N(t, e) && vt(t[e]) ? E(i.base ? U(i.base) : {}, t[e], i.transform) : o;
2097
2097
  }, Ee = function(t, e, o) {
2098
2098
  const i = N(t, e) ? t[e] : void 0;
2099
2099
  return i && typeof i == "object" ? U(i) : o();
2100
2100
  };
2101
- function Mo() {
2102
- let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Qn();
2103
- const t = (u) => Mo(u);
2101
+ function Do() {
2102
+ let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ei();
2103
+ const t = (u) => Do(u);
2104
2104
  if (t.version = "3.4.16", t.removed = [], !a || !a.document || a.document.nodeType !== F.document || !a.Element)
2105
2105
  return t.isSupported = !1, t;
2106
2106
  let e = a.document;
@@ -2108,8 +2108,8 @@ function Mo() {
2108
2108
  a.DocumentFragment;
2109
2109
  const r = a.HTMLTemplateElement, l = a.Node, c = a.Element, p = a.NodeFilter;
2110
2110
  a.NamedNodeMap === void 0 && (a.NamedNodeMap || a.MozNamedAttrMap), a.HTMLFormElement;
2111
- const m = a.DOMParser, g = a.trustedTypes, w = c.prototype, T = W(w, "cloneNode"), v = W(w, "remove"), k = W(w, "removeAttributeNode"), et = W(w, "nextSibling"), $ = W(w, "childNodes"), z = W(w, "parentNode"), st = W(w, "shadowRoot"), H = W(w, "attributes"), D = l && l.prototype ? W(l.prototype, "nodeType") : null, lt = l && l.prototype ? W(l.prototype, "nodeName") : null, It = l && l.prototype ? W(l.prototype, "ownerDocument") : null, vt = function(n) {
2112
- return D ? D(n) : n.nodeType;
2111
+ const m = a.DOMParser, g = a.trustedTypes, w = c.prototype, T = W(w, "cloneNode"), v = W(w, "remove"), k = W(w, "removeAttributeNode"), et = W(w, "nextSibling"), $ = W(w, "childNodes"), z = W(w, "parentNode"), st = W(w, "shadowRoot"), B = W(w, "attributes"), O = l && l.prototype ? W(l.prototype, "nodeType") : null, lt = l && l.prototype ? W(l.prototype, "nodeName") : null, It = l && l.prototype ? W(l.prototype, "ownerDocument") : null, wt = function(n) {
2112
+ return O ? O(n) : n.nodeType;
2113
2113
  }, Xt = function(n) {
2114
2114
  return lt ? lt(n) : n.nodeName;
2115
2115
  };
@@ -2117,45 +2117,45 @@ function Mo() {
2117
2117
  const u = e.createElement("template");
2118
2118
  u.content && u.content.ownerDocument && (e = u.content.ownerDocument);
2119
2119
  }
2120
- let P, ot = "", Zt, Se = !1, wt = 0;
2121
- const _e = function() {
2122
- if (wt > 0) throw J('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
2120
+ let P, ot = "", Qt, _e = !1, Tt = 0;
2121
+ const Le = function() {
2122
+ if (Tt > 0) throw Z('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
2123
2123
  }, ct = function(n) {
2124
- _e(), wt++;
2124
+ Le(), Tt++;
2125
2125
  try {
2126
2126
  return P.createHTML(n);
2127
2127
  } finally {
2128
- wt--;
2128
+ Tt--;
2129
2129
  }
2130
- }, Do = function(n) {
2131
- _e(), wt++;
2130
+ }, Po = function(n) {
2131
+ Le(), Tt++;
2132
2132
  try {
2133
2133
  return P.createScriptURL(n);
2134
2134
  } finally {
2135
- wt--;
2136
- }
2137
- }, Ro = function() {
2138
- return Se || (Zt = ti(g, i), Se = !0), Zt;
2139
- }, Ot = e, Jt = Ot.implementation, Le = Ot.createNodeIterator, Po = Ot.createDocumentFragment, No = Ot.getElementsByTagName, zo = o.importNode;
2140
- let x = vo();
2141
- t.isSupported = typeof So == "function" && typeof z == "function" && Jt && Jt.createHTMLDocument !== void 0;
2142
- const Ho = Fn, Bo = Un, Fo = jn, Uo = Wn, jo = $n, Wo = Gn, Me = Kn, $o = qn;
2143
- let Ie = bo, A = null;
2144
- const Qt = E({}, [
2145
- ...fo,
2135
+ Tt--;
2136
+ }
2137
+ }, No = function() {
2138
+ return _e || (Qt = oi(g, i), _e = !0), Qt;
2139
+ }, Dt = e, Zt = Dt.implementation, Me = Dt.createNodeIterator, zo = Dt.createDocumentFragment, Bo = Dt.getElementsByTagName, Ho = o.importNode;
2140
+ let x = wo();
2141
+ t.isSupported = typeof Lo == "function" && typeof z == "function" && Zt && Zt.createHTMLDocument !== void 0;
2142
+ const Fo = jn, Uo = Wn, jo = $n, Wo = Gn, $o = Kn, Go = qn, Ie = Yn, Ko = Xn;
2143
+ let De = yo, A = null;
2144
+ const Jt = E({}, [
2145
+ ...ho,
2146
2146
  ...me,
2147
2147
  ...ge,
2148
2148
  ...be,
2149
- ...ho
2149
+ ...mo
2150
2150
  ]);
2151
2151
  let C = null;
2152
2152
  const te = E({}, [
2153
- ...mo,
2154
- ...ye,
2155
2153
  ...go,
2154
+ ...ye,
2155
+ ...bo,
2156
2156
  ...Gt
2157
2157
  ]);
2158
- let G = Object.seal(yt(null, {
2158
+ let G = Object.seal(Et(null, {
2159
2159
  tagNameCheck: {
2160
2160
  writable: !0,
2161
2161
  configurable: !1,
@@ -2174,8 +2174,8 @@ function Mo() {
2174
2174
  enumerable: !0,
2175
2175
  value: !1
2176
2176
  }
2177
- })), Tt = null, Oe = null;
2178
- const V = Object.seal(yt(null, {
2177
+ })), kt = null, Oe = null;
2178
+ const V = Object.seal(Et(null, {
2179
2179
  tagCheck: {
2180
2180
  writable: !0,
2181
2181
  configurable: !1,
@@ -2189,10 +2189,10 @@ function Mo() {
2189
2189
  value: null
2190
2190
  }
2191
2191
  }));
2192
- let De = !0, ee = !0, Re = !1, Pe = !0, X = !1, nt = !0, it = !1, oe = !1, Dt = null, Rt = null, ne = !1, dt = !1, Pt = !1, Nt = !1, Ne = !0, ze = !1;
2192
+ let Re = !0, ee = !0, Pe = !1, Ne = !0, X = !1, nt = !0, it = !1, oe = !1, Ot = null, Rt = null, ne = !1, dt = !1, Pt = !1, Nt = !1, ze = !0, Be = !1;
2193
2193
  const He = "user-content-";
2194
2194
  let ie = !0, re = !1, ut = {}, pt = null;
2195
- const Be = E({}, [
2195
+ const Fe = E({}, [
2196
2196
  "annotation-xml",
2197
2197
  "audio",
2198
2198
  "colgroup",
@@ -2220,8 +2220,8 @@ function Mo() {
2220
2220
  "video",
2221
2221
  "xmp"
2222
2222
  ]);
2223
- let Fe = null;
2224
- const Ue = E({}, [
2223
+ let Ue = null;
2224
+ const je = E({}, [
2225
2225
  "audio",
2226
2226
  "video",
2227
2227
  "img",
@@ -2229,8 +2229,8 @@ function Mo() {
2229
2229
  "image",
2230
2230
  "track"
2231
2231
  ]);
2232
- let je = null;
2233
- const We = E({}, [
2232
+ let We = null;
2233
+ const $e = E({}, [
2234
2234
  "alt",
2235
2235
  "class",
2236
2236
  "for",
@@ -2245,52 +2245,52 @@ function Mo() {
2245
2245
  "value",
2246
2246
  "style",
2247
2247
  "xmlns"
2248
- ]), zt = "http://www.w3.org/1998/Math/MathML", Ht = "http://www.w3.org/2000/svg", K = "http://www.w3.org/1999/xhtml";
2248
+ ]), zt = "http://www.w3.org/1998/Math/MathML", Bt = "http://www.w3.org/2000/svg", K = "http://www.w3.org/1999/xhtml";
2249
2249
  let ft = K, ae = !1, se = null;
2250
- const Go = E({}, [
2250
+ const qo = E({}, [
2251
2251
  zt,
2252
- Ht,
2252
+ Bt,
2253
2253
  K
2254
- ], he), $e = M([
2254
+ ], he), Ge = M([
2255
2255
  "mi",
2256
2256
  "mo",
2257
2257
  "mn",
2258
2258
  "ms",
2259
2259
  "mtext"
2260
2260
  ]);
2261
- let le = E({}, $e);
2262
- const Ge = M(["annotation-xml"]);
2263
- let ce = E({}, Ge);
2264
- const Ko = E({}, [
2261
+ let le = E({}, Ge);
2262
+ const Ke = M(["annotation-xml"]);
2263
+ let ce = E({}, Ke);
2264
+ const Yo = E({}, [
2265
2265
  "title",
2266
2266
  "style",
2267
2267
  "font",
2268
2268
  "a",
2269
2269
  "script"
2270
2270
  ]);
2271
- let kt = null;
2272
- const Yo = ["application/xhtml+xml", "text/html"], qo = "text/html";
2271
+ let xt = null;
2272
+ const Vo = ["application/xhtml+xml", "text/html"], Xo = "text/html";
2273
2273
  let _ = null, ht = null;
2274
- const Vo = e.createElement("form"), Ke = function(n) {
2274
+ const Qo = e.createElement("form"), qe = function(n) {
2275
2275
  return n instanceof RegExp || n instanceof Function;
2276
2276
  }, de = function() {
2277
2277
  let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2278
2278
  if (ht && ht === n) return;
2279
- (!n || typeof n != "object") && (n = {}), n = U(n), kt = Yo.indexOf(n.PARSER_MEDIA_TYPE) === -1 ? qo : n.PARSER_MEDIA_TYPE, _ = kt === "application/xhtml+xml" ? he : Mt, A = Q(n, "ALLOWED_TAGS", Qt, { transform: _ }), C = Q(n, "ALLOWED_ATTR", te, { transform: _ }), se = Q(n, "ALLOWED_NAMESPACES", Go, { transform: he }), je = Q(n, "ADD_URI_SAFE_ATTR", We, {
2279
+ (!n || typeof n != "object") && (n = {}), n = U(n), xt = Vo.indexOf(n.PARSER_MEDIA_TYPE) === -1 ? Xo : n.PARSER_MEDIA_TYPE, _ = xt === "application/xhtml+xml" ? he : Mt, A = J(n, "ALLOWED_TAGS", Jt, { transform: _ }), C = J(n, "ALLOWED_ATTR", te, { transform: _ }), se = J(n, "ALLOWED_NAMESPACES", qo, { transform: he }), We = J(n, "ADD_URI_SAFE_ATTR", $e, {
2280
2280
  transform: _,
2281
- base: We
2282
- }), Fe = Q(n, "ADD_DATA_URI_TAGS", Ue, {
2281
+ base: $e
2282
+ }), Ue = J(n, "ADD_DATA_URI_TAGS", je, {
2283
2283
  transform: _,
2284
- base: Ue
2285
- }), pt = Q(n, "FORBID_CONTENTS", Be, { transform: _ }), Tt = Q(n, "FORBID_TAGS", U({}), { transform: _ }), Oe = Q(n, "FORBID_ATTR", U({}), { transform: _ }), ut = N(n, "USE_PROFILES") ? n.USE_PROFILES && typeof n.USE_PROFILES == "object" ? U(n.USE_PROFILES) : n.USE_PROFILES : !1, De = n.ALLOW_ARIA_ATTR !== !1, ee = n.ALLOW_DATA_ATTR !== !1, Re = n.ALLOW_UNKNOWN_PROTOCOLS || !1, Pe = n.ALLOW_SELF_CLOSE_IN_ATTR !== !1, X = n.SAFE_FOR_TEMPLATES || !1, nt = n.SAFE_FOR_XML !== !1, it = n.WHOLE_DOCUMENT || !1, dt = n.RETURN_DOM || !1, Pt = n.RETURN_DOM_FRAGMENT || !1, Nt = n.RETURN_TRUSTED_TYPE || !1, ne = n.FORCE_BODY || !1, Ne = n.SANITIZE_DOM !== !1, ze = n.SANITIZE_NAMED_PROPS || !1, ie = n.KEEP_CONTENT !== !1, re = n.IN_PLACE || !1, Ie = zn(n.ALLOWED_URI_REGEXP) ? n.ALLOWED_URI_REGEXP : bo, ft = typeof n.NAMESPACE == "string" ? n.NAMESPACE : K, le = Ee(n, "MATHML_TEXT_INTEGRATION_POINTS", () => E({}, $e)), ce = Ee(n, "HTML_INTEGRATION_POINTS", () => E({}, Ge));
2286
- const s = Ee(n, "CUSTOM_ELEMENT_HANDLING", () => yt(null));
2287
- if (G = yt(null), N(s, "tagNameCheck") && Ke(s.tagNameCheck) && (G.tagNameCheck = s.tagNameCheck), N(s, "attributeNameCheck") && Ke(s.attributeNameCheck) && (G.attributeNameCheck = s.attributeNameCheck), N(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && (G.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), I(G), X && (ee = !1), Pt && (dt = !0), ut && (A = E({}, ho), C = yt(null), ut.html === !0 && (E(A, fo), E(C, mo)), ut.svg === !0 && (E(A, me), E(C, ye), E(C, Gt)), ut.svgFilters === !0 && (E(A, ge), E(C, ye), E(C, Gt)), ut.mathMl === !0 && (E(A, be), E(C, go), E(C, Gt))), V.tagCheck = null, V.attributeCheck = null, N(n, "ADD_TAGS") && (typeof n.ADD_TAGS == "function" ? V.tagCheck = n.ADD_TAGS : Et(n.ADD_TAGS) && (A === Qt && (A = U(A)), E(A, n.ADD_TAGS, _))), N(n, "ADD_ATTR") && (typeof n.ADD_ATTR == "function" ? V.attributeCheck = n.ADD_ATTR : Et(n.ADD_ATTR) && (C === te && (C = U(C)), E(C, n.ADD_ATTR, _))), N(n, "ADD_FORBID_CONTENTS") && Et(n.ADD_FORBID_CONTENTS) && (pt === Be && (pt = U(pt)), E(pt, n.ADD_FORBID_CONTENTS, _)), ie && (A["#text"] = !0), it && E(A, [
2284
+ base: je
2285
+ }), pt = J(n, "FORBID_CONTENTS", Fe, { transform: _ }), kt = J(n, "FORBID_TAGS", U({}), { transform: _ }), Oe = J(n, "FORBID_ATTR", U({}), { transform: _ }), ut = N(n, "USE_PROFILES") ? n.USE_PROFILES && typeof n.USE_PROFILES == "object" ? U(n.USE_PROFILES) : n.USE_PROFILES : !1, Re = n.ALLOW_ARIA_ATTR !== !1, ee = n.ALLOW_DATA_ATTR !== !1, Pe = n.ALLOW_UNKNOWN_PROTOCOLS || !1, Ne = n.ALLOW_SELF_CLOSE_IN_ATTR !== !1, X = n.SAFE_FOR_TEMPLATES || !1, nt = n.SAFE_FOR_XML !== !1, it = n.WHOLE_DOCUMENT || !1, dt = n.RETURN_DOM || !1, Pt = n.RETURN_DOM_FRAGMENT || !1, Nt = n.RETURN_TRUSTED_TYPE || !1, ne = n.FORCE_BODY || !1, ze = n.SANITIZE_DOM !== !1, Be = n.SANITIZE_NAMED_PROPS || !1, ie = n.KEEP_CONTENT !== !1, re = n.IN_PLACE || !1, De = Hn(n.ALLOWED_URI_REGEXP) ? n.ALLOWED_URI_REGEXP : yo, ft = typeof n.NAMESPACE == "string" ? n.NAMESPACE : K, le = Ee(n, "MATHML_TEXT_INTEGRATION_POINTS", () => E({}, Ge)), ce = Ee(n, "HTML_INTEGRATION_POINTS", () => E({}, Ke));
2286
+ const s = Ee(n, "CUSTOM_ELEMENT_HANDLING", () => Et(null));
2287
+ if (G = Et(null), N(s, "tagNameCheck") && qe(s.tagNameCheck) && (G.tagNameCheck = s.tagNameCheck), N(s, "attributeNameCheck") && qe(s.attributeNameCheck) && (G.attributeNameCheck = s.attributeNameCheck), N(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && (G.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), I(G), X && (ee = !1), Pt && (dt = !0), ut && (A = E({}, mo), C = Et(null), ut.html === !0 && (E(A, ho), E(C, go)), ut.svg === !0 && (E(A, me), E(C, ye), E(C, Gt)), ut.svgFilters === !0 && (E(A, ge), E(C, ye), E(C, Gt)), ut.mathMl === !0 && (E(A, be), E(C, bo), E(C, Gt))), V.tagCheck = null, V.attributeCheck = null, N(n, "ADD_TAGS") && (typeof n.ADD_TAGS == "function" ? V.tagCheck = n.ADD_TAGS : vt(n.ADD_TAGS) && (A === Jt && (A = U(A)), E(A, n.ADD_TAGS, _))), N(n, "ADD_ATTR") && (typeof n.ADD_ATTR == "function" ? V.attributeCheck = n.ADD_ATTR : vt(n.ADD_ATTR) && (C === te && (C = U(C)), E(C, n.ADD_ATTR, _))), N(n, "ADD_FORBID_CONTENTS") && vt(n.ADD_FORBID_CONTENTS) && (pt === Fe && (pt = U(pt)), E(pt, n.ADD_FORBID_CONTENTS, _)), ie && (A["#text"] = !0), it && E(A, [
2288
2288
  "html",
2289
2289
  "head",
2290
2290
  "body"
2291
- ]), A.table && (E(A, ["tbody"]), delete Tt.tbody), n.TRUSTED_TYPES_POLICY) {
2292
- if (typeof n.TRUSTED_TYPES_POLICY.createHTML != "function") throw J('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
2293
- if (typeof n.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw J('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
2291
+ ]), A.table && (E(A, ["tbody"]), delete kt.tbody), n.TRUSTED_TYPES_POLICY) {
2292
+ if (typeof n.TRUSTED_TYPES_POLICY.createHTML != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
2293
+ if (typeof n.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
2294
2294
  const d = P;
2295
2295
  P = n.TRUSTED_TYPES_POLICY;
2296
2296
  try {
@@ -2298,34 +2298,34 @@ function Mo() {
2298
2298
  } catch (f) {
2299
2299
  throw P = d, f;
2300
2300
  }
2301
- } else n.TRUSTED_TYPES_POLICY === null ? (P = void 0, ot = "") : (P === void 0 && (P = Ro()), P && typeof ot == "string" && (ot = ct("")));
2301
+ } else n.TRUSTED_TYPES_POLICY === null ? (P = void 0, ot = "") : (P === void 0 && (P = No()), P && typeof ot == "string" && (ot = ct("")));
2302
2302
  M && M(n), ht = n;
2303
2303
  }, Ye = E({}, [
2304
2304
  ...me,
2305
2305
  ...ge,
2306
- ...Hn
2307
- ]), qe = E({}, [...be, ...Bn]), Xo = function(n, s, d) {
2306
+ ...Fn
2307
+ ]), Ve = E({}, [...be, ...Un]), Zo = function(n, s, d) {
2308
2308
  return s.namespaceURI === K ? n === "svg" : s.namespaceURI === zt ? n === "svg" && (d === "annotation-xml" || le[d]) : !!Ye[n];
2309
- }, Zo = function(n, s, d) {
2310
- return s.namespaceURI === K ? n === "math" : s.namespaceURI === Ht ? n === "math" && ce[d] : !!qe[n];
2311
2309
  }, Jo = function(n, s, d) {
2312
- return s.namespaceURI === Ht && !ce[d] || s.namespaceURI === zt && !le[d] ? !1 : !qe[n] && (Ko[n] || !Ye[n]);
2313
- }, Qo = function(n) {
2310
+ return s.namespaceURI === K ? n === "math" : s.namespaceURI === Bt ? n === "math" && ce[d] : !!Ve[n];
2311
+ }, tn = function(n, s, d) {
2312
+ return s.namespaceURI === Bt && !ce[d] || s.namespaceURI === zt && !le[d] ? !1 : !Ve[n] && (Yo[n] || !Ye[n]);
2313
+ }, en = function(n) {
2314
2314
  let s = z(n);
2315
2315
  (!s || !s.tagName) && (s = {
2316
2316
  namespaceURI: ft,
2317
2317
  tagName: "template"
2318
2318
  });
2319
2319
  const d = Mt(n.tagName), f = Mt(s.tagName);
2320
- return se[n.namespaceURI] ? n.namespaceURI === Ht ? Xo(d, s, f) : n.namespaceURI === zt ? Zo(d, s, f) : n.namespaceURI === K ? Jo(d, s, f) : !!(kt === "application/xhtml+xml" && se[n.namespaceURI]) : !1;
2321
- }, Z = function(n) {
2322
- At(t.removed, { element: n });
2320
+ return se[n.namespaceURI] ? n.namespaceURI === Bt ? Zo(d, s, f) : n.namespaceURI === zt ? Jo(d, s, f) : n.namespaceURI === K ? tn(d, s, f) : !!(xt === "application/xhtml+xml" && se[n.namespaceURI]) : !1;
2321
+ }, Q = function(n) {
2322
+ Ct(t.removed, { element: n });
2323
2323
  try {
2324
2324
  z(n).removeChild(n);
2325
2325
  } catch (s) {
2326
- if (v(n), !z(n)) throw J("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
2326
+ if (v(n), !z(n)) throw Z("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
2327
2327
  }
2328
- }, Ve = function(n, s, d) {
2328
+ }, Xe = function(n, s, d) {
2329
2329
  try {
2330
2330
  k(n, s);
2331
2331
  } catch (f) {
@@ -2334,13 +2334,13 @@ function Mo() {
2334
2334
  } catch (h) {
2335
2335
  }
2336
2336
  }
2337
- }, Bt = function(n) {
2337
+ }, Ht = function(n) {
2338
2338
  Ft(n);
2339
2339
  const s = $(n);
2340
2340
  if (s) {
2341
2341
  const f = [];
2342
2342
  at(s, (h) => {
2343
- At(f, h);
2343
+ Ct(f, h);
2344
2344
  }), at(f, (h) => {
2345
2345
  try {
2346
2346
  v(h);
@@ -2348,10 +2348,10 @@ function Mo() {
2348
2348
  }
2349
2349
  });
2350
2350
  }
2351
- const d = H(n);
2351
+ const d = B(n);
2352
2352
  if (d) for (let f = d.length - 1; f >= 0; --f) {
2353
2353
  const h = d[f], b = h && h.name;
2354
- typeof b == "string" && Ve(n, h, b);
2354
+ typeof b == "string" && Xe(n, h, b);
2355
2355
  }
2356
2356
  }, rt = function(n, s, d) {
2357
2357
  if (!d) try {
@@ -2359,7 +2359,7 @@ function Mo() {
2359
2359
  } catch (f) {
2360
2360
  d = null;
2361
2361
  }
2362
- At(t.removed, {
2362
+ Ct(t.removed, {
2363
2363
  attribute: d || null,
2364
2364
  from: s
2365
2365
  });
@@ -2373,36 +2373,36 @@ function Mo() {
2373
2373
  }
2374
2374
  if (n === "is")
2375
2375
  if (dt || Pt) try {
2376
- Z(s);
2376
+ Q(s);
2377
2377
  } catch (f) {
2378
2378
  }
2379
2379
  else try {
2380
2380
  s.setAttribute(n, "");
2381
2381
  } catch (f) {
2382
2382
  }
2383
- }, tn = function(n) {
2384
- const s = H(n);
2383
+ }, on = function(n) {
2384
+ const s = B(n);
2385
2385
  if (s)
2386
2386
  for (let d = s.length - 1; d >= 0; --d) {
2387
2387
  const f = s[d], h = f && f.name;
2388
- typeof h != "string" || C[_(h)] || Ve(n, f, h);
2388
+ typeof h != "string" || C[_(h)] || Xe(n, f, h);
2389
2389
  }
2390
2390
  }, Ft = function(n) {
2391
2391
  const s = [n];
2392
2392
  for (; s.length > 0; ) {
2393
2393
  const d = s.pop();
2394
- vt(d) === F.element && tn(d);
2394
+ wt(d) === F.element && on(d);
2395
2395
  const f = $(d);
2396
2396
  if (f) for (let h = f.length - 1; h >= 0; --h) s.push(f[h]);
2397
2397
  }
2398
- }, Xe = function(n, s) {
2398
+ }, Qe = function(n, s) {
2399
2399
  return nt ? n === "patchsrc" ? !0 : n === "for" && s !== "label" && s !== "output" : !1;
2400
- }, en = function(n) {
2400
+ }, nn = function(n) {
2401
2401
  if (!nt) return;
2402
2402
  const s = [n];
2403
2403
  for (; s.length > 0; ) {
2404
- const d = s.pop(), f = vt(d);
2405
- if (f === F.processingInstruction || f === F.comment && O(Eo, d.data)) {
2404
+ const d = s.pop(), f = wt(d);
2405
+ if (f === F.processingInstruction || f === F.comment && D(vo, d.data)) {
2406
2406
  try {
2407
2407
  v(d);
2408
2408
  } catch (b) {
@@ -2412,7 +2412,7 @@ function Mo() {
2412
2412
  if (f === F.element) {
2413
2413
  const b = d, y = _(Xt(d));
2414
2414
  try {
2415
- b.hasAttribute && b.hasAttribute("patchsrc") && b.removeAttribute("patchsrc"), b.hasAttribute && b.hasAttribute("for") && Xe("for", y) && b.removeAttribute("for");
2415
+ b.hasAttribute && b.hasAttribute("patchsrc") && b.removeAttribute("patchsrc"), b.hasAttribute && b.hasAttribute("for") && Qe("for", y) && b.removeAttribute("for");
2416
2416
  } catch (S) {
2417
2417
  }
2418
2418
  }
@@ -2423,33 +2423,33 @@ function Mo() {
2423
2423
  let s = null, d = null;
2424
2424
  if (ne) n = "<remove></remove>" + n;
2425
2425
  else {
2426
- const b = lo(n, /^[\r\n\t ]+/);
2426
+ const b = co(n, /^[\r\n\t ]+/);
2427
2427
  d = b && b[0];
2428
2428
  }
2429
- kt === "application/xhtml+xml" && ft === K && (n = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + n + "</body></html>");
2429
+ xt === "application/xhtml+xml" && ft === K && (n = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + n + "</body></html>");
2430
2430
  const f = P ? ct(n) : n;
2431
2431
  if (ft === K) try {
2432
- s = new m().parseFromString(f, kt);
2432
+ s = new m().parseFromString(f, xt);
2433
2433
  } catch (b) {
2434
2434
  }
2435
2435
  if (!s || !s.documentElement) {
2436
- s = Jt.createDocument(ft, "template", null);
2436
+ s = Zt.createDocument(ft, "template", null);
2437
2437
  try {
2438
2438
  s.documentElement.innerHTML = ae ? ot : f;
2439
2439
  } catch (b) {
2440
2440
  }
2441
2441
  }
2442
2442
  const h = s.body || s.documentElement;
2443
- return n && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null), ft === K ? No.call(s, it ? "html" : "body")[0] : it ? s.documentElement : h;
2443
+ return n && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null), ft === K ? Bo.call(s, it ? "html" : "body")[0] : it ? s.documentElement : h;
2444
2444
  }, Je = function(n) {
2445
2445
  const s = It ? It(n) : n.ownerDocument;
2446
- return Le.call(s || n, n, p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION, null);
2446
+ return Me.call(s || n, n, p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION, null);
2447
2447
  }, Ut = function(n) {
2448
- return n = Ct(n, Ho, " "), n = Ct(n, Bo, " "), n = Ct(n, Fo, " "), n;
2448
+ return n = St(n, Fo, " "), n = St(n, Uo, " "), n = St(n, jo, " "), n;
2449
2449
  }, ue = function(n) {
2450
2450
  var s;
2451
2451
  n.normalize();
2452
- const d = It ? It(n) : n.ownerDocument, f = Le.call(d || n, n, p.SHOW_TEXT | p.SHOW_COMMENT | p.SHOW_CDATA_SECTION | p.SHOW_PROCESSING_INSTRUCTION, null);
2452
+ const d = It ? It(n) : n.ownerDocument, f = Me.call(d || n, n, p.SHOW_TEXT | p.SHOW_COMMENT | p.SHOW_CDATA_SECTION | p.SHOW_PROCESSING_INSTRUCTION, null);
2453
2453
  let h = f.nextNode();
2454
2454
  for (; h; )
2455
2455
  h.data = Ut(h.data), h = f.nextNode();
@@ -2459,38 +2459,38 @@ function Mo() {
2459
2459
  });
2460
2460
  }, jt = function(n) {
2461
2461
  const s = lt ? lt(n) : null;
2462
- return typeof s != "string" || _(s) !== "form" ? !1 : typeof n.nodeName != "string" || typeof n.textContent != "string" || typeof n.removeChild != "function" || n.attributes !== H(n) || typeof n.removeAttribute != "function" || typeof n.removeAttributeNode != "function" || typeof n.getAttributeNode != "function" || typeof n.setAttribute != "function" || typeof n.namespaceURI != "string" || typeof n.insertBefore != "function" || typeof n.hasChildNodes != "function" || n.nodeType !== D(n) || n.childNodes !== $(n);
2462
+ return typeof s != "string" || _(s) !== "form" ? !1 : typeof n.nodeName != "string" || typeof n.textContent != "string" || typeof n.removeChild != "function" || n.attributes !== B(n) || typeof n.removeAttribute != "function" || typeof n.removeAttributeNode != "function" || typeof n.getAttributeNode != "function" || typeof n.setAttribute != "function" || typeof n.namespaceURI != "string" || typeof n.insertBefore != "function" || typeof n.hasChildNodes != "function" || n.nodeType !== O(n) || n.childNodes !== $(n);
2463
2463
  }, mt = function(n) {
2464
- if (!D || typeof n != "object" || n === null) return !1;
2464
+ if (!O || typeof n != "object" || n === null) return !1;
2465
2465
  try {
2466
- return D(n) === F.documentFragment;
2466
+ return O(n) === F.documentFragment;
2467
2467
  } catch (s) {
2468
2468
  return !1;
2469
2469
  }
2470
- }, xt = function(n) {
2471
- if (!D || typeof n != "object" || n === null) return !1;
2470
+ }, At = function(n) {
2471
+ if (!O || typeof n != "object" || n === null) return !1;
2472
2472
  try {
2473
- return typeof D(n) == "number";
2473
+ return typeof O(n) == "number";
2474
2474
  } catch (s) {
2475
2475
  return !1;
2476
2476
  }
2477
2477
  };
2478
- function Y(u, n, s) {
2478
+ function q(u, n, s) {
2479
2479
  u.length !== 0 && at(u, (d) => {
2480
2480
  d.call(t, n, s, ht);
2481
2481
  });
2482
2482
  }
2483
- const on = function(n, s) {
2484
- return !!(nt && n.hasChildNodes() && !xt(n.firstElementChild) && O(yo, n.textContent) && O(yo, n.innerHTML) || nt && n.namespaceURI === K && Zn[s] && (xt(n.firstElementChild) || typeof n.textContent == "string" && O(Jn[s], n.textContent)) || n.nodeType === F.processingInstruction || nt && n.nodeType === F.comment && O(Eo, n.data));
2483
+ const rn = function(n, s) {
2484
+ return !!(nt && n.hasChildNodes() && !At(n.firstElementChild) && D(Eo, n.textContent) && D(Eo, n.innerHTML) || nt && n.namespaceURI === K && Jn[s] && (At(n.firstElementChild) || typeof n.textContent == "string" && D(ti[s], n.textContent)) || n.nodeType === F.processingInstruction || nt && n.nodeType === F.comment && D(vo, n.data));
2485
2485
  }, Wt = function(n, s) {
2486
- if (n instanceof RegExp) return O(n, s);
2486
+ if (n instanceof RegExp) return D(n, s);
2487
2487
  if (n instanceof Function) {
2488
2488
  for (var d = arguments.length, f = new Array(d > 2 ? d - 2 : 0), h = 2; h < d; h++) f[h - 2] = arguments[h];
2489
2489
  return !!n(s, ...f);
2490
2490
  }
2491
2491
  return !1;
2492
- }, nn = function(n, s, d) {
2493
- if (!Tt[s] && oo(s) && Wt(G.tagNameCheck, s)) return !1;
2492
+ }, an = function(n, s, d) {
2493
+ if (!kt[s] && no(s) && Wt(G.tagNameCheck, s)) return !1;
2494
2494
  if (ie && !pt[s]) {
2495
2495
  const f = z(n), h = $(n);
2496
2496
  if (h && f) {
@@ -2501,38 +2501,38 @@ function Mo() {
2501
2501
  }
2502
2502
  }
2503
2503
  }
2504
- return Z(n), !0;
2505
- }, Qe = function(n, s, d, f) {
2504
+ return Q(n), !0;
2505
+ }, to = function(n, s, d, f) {
2506
2506
  return n.length === 0 ? s : s === d || s === f ? U(s) : s;
2507
2507
  }, gt = function(n, s) {
2508
2508
  return n === s || z(n) !== null ? !1 : (re && Ft(n), !0);
2509
- }, to = function(n, s) {
2510
- if (Y(x.beforeSanitizeElements, n, null), gt(n, s)) return !0;
2509
+ }, eo = function(n, s) {
2510
+ if (q(x.beforeSanitizeElements, n, null), gt(n, s)) return !0;
2511
2511
  if (jt(n))
2512
- return Z(n), !0;
2512
+ return Q(n), !0;
2513
2513
  const d = _(Xt(n));
2514
- if (A = Qe(x.uponSanitizeElement, A, Qt, Dt), Y(x.uponSanitizeElement, n, {
2514
+ if (A = to(x.uponSanitizeElement, A, Jt, Ot), q(x.uponSanitizeElement, n, {
2515
2515
  tagName: d,
2516
2516
  allowedTags: A
2517
2517
  }), gt(n, s)) return !0;
2518
- if (on(n, d))
2519
- return Z(n), !0;
2520
- if (Tt[d] || !(V.tagCheck instanceof Function && V.tagCheck(d)) && !A[d]) {
2521
- const f = nn(n, d, s);
2522
- return f === !1 && (Y(x.afterSanitizeElements, n, null), gt(n, s)) ? !0 : f;
2523
- }
2524
- if (vt(n) === F.element && !Qo(n) || (d === "noscript" || d === "noembed" || d === "noframes") && O(Vn, n.innerHTML))
2525
- return Z(n), !0;
2518
+ if (rn(n, d))
2519
+ return Q(n), !0;
2520
+ if (kt[d] || !(V.tagCheck instanceof Function && V.tagCheck(d)) && !A[d]) {
2521
+ const f = an(n, d, s);
2522
+ return f === !1 && (q(x.afterSanitizeElements, n, null), gt(n, s)) ? !0 : f;
2523
+ }
2524
+ if (wt(n) === F.element && !en(n) || (d === "noscript" || d === "noembed" || d === "noframes") && D(Qn, n.innerHTML))
2525
+ return Q(n), !0;
2526
2526
  if (X && n.nodeType === F.text) {
2527
2527
  const f = Ut(n.textContent);
2528
- n.textContent !== f && (At(t.removed, { element: n.cloneNode() }), n.textContent = f);
2528
+ n.textContent !== f && (Ct(t.removed, { element: n.cloneNode() }), n.textContent = f);
2529
2529
  }
2530
- return Y(x.afterSanitizeElements, n, null), gt(n, s);
2531
- }, eo = function(n, s, d) {
2532
- if (Oe[s] || Xe(s, n) || Ne && (s === "id" || s === "name") && (d in e || d in Vo)) return !1;
2530
+ return q(x.afterSanitizeElements, n, null), gt(n, s);
2531
+ }, oo = function(n, s, d) {
2532
+ if (Oe[s] || Qe(s, n) || ze && (s === "id" || s === "name") && (d in e || d in Qo)) return !1;
2533
2533
  const f = C[s] || V.attributeCheck instanceof Function && V.attributeCheck(s, n);
2534
- return ee && O(Uo, s) || De && O(jo, s) ? !0 : f ? je[s] || O(Ie, Ct(d, Me, "")) || (s === "src" || s === "xlink:href" || s === "href") && n !== "script" && co(d, "data:") === 0 && Fe[n] || Re && !O(Wo, Ct(d, Me, "")) ? !0 : !d : oo(n) && Wt(G.tagNameCheck, n) && Wt(G.attributeNameCheck, s, n) || s === "is" && G.allowCustomizedBuiltInElements && Wt(G.tagNameCheck, d);
2535
- }, rn = E({}, [
2534
+ return ee && D(Wo, s) || Re && D($o, s) ? !0 : f ? We[s] || D(De, St(d, Ie, "")) || (s === "src" || s === "xlink:href" || s === "href") && n !== "script" && uo(d, "data:") === 0 && Ue[n] || Pe && !D(Go, St(d, Ie, "")) ? !0 : !d : no(n) && Wt(G.tagNameCheck, n) && Wt(G.attributeNameCheck, s, n) || s === "is" && G.allowCustomizedBuiltInElements && Wt(G.tagNameCheck, d);
2535
+ }, sn = E({}, [
2536
2536
  "annotation-xml",
2537
2537
  "color-profile",
2538
2538
  "font-face",
@@ -2541,27 +2541,27 @@ function Mo() {
2541
2541
  "font-face-src",
2542
2542
  "font-face-uri",
2543
2543
  "missing-glyph"
2544
- ]), oo = function(n) {
2545
- return !rn[Mt(n)] && O($o, n);
2546
- }, an = function(n, s, d, f) {
2544
+ ]), no = function(n) {
2545
+ return !sn[Mt(n)] && D(Ko, n);
2546
+ }, ln = function(n, s, d, f) {
2547
2547
  if (P && typeof g == "object" && typeof g.getAttributeType == "function" && !d) switch (g.getAttributeType(n, s)) {
2548
2548
  case "TrustedHTML":
2549
2549
  return ct(f);
2550
2550
  case "TrustedScriptURL":
2551
- return Do(f);
2551
+ return Po(f);
2552
2552
  }
2553
2553
  return f;
2554
- }, sn = function(n, s, d, f) {
2554
+ }, cn = function(n, s, d, f) {
2555
2555
  try {
2556
- return d ? n.setAttributeNS(d, s, f) : n.setAttribute(s, f), jt(n) ? (Z(n), !1) : !0;
2556
+ return d ? n.setAttributeNS(d, s, f) : n.setAttribute(s, f), jt(n) ? (Q(n), !1) : !0;
2557
2557
  } catch (h) {
2558
2558
  return rt(s, n), !1;
2559
2559
  }
2560
- }, no = function(n, s) {
2561
- if (Y(x.beforeSanitizeAttributes, n, null), gt(n, s)) return;
2560
+ }, io = function(n, s) {
2561
+ if (q(x.beforeSanitizeAttributes, n, null), gt(n, s)) return;
2562
2562
  const d = n.attributes;
2563
2563
  if (!d || jt(n)) return;
2564
- C = Qe(x.uponSanitizeAttribute, C, te, Rt);
2564
+ C = to(x.uponSanitizeAttribute, C, te, Rt);
2565
2565
  const f = {
2566
2566
  attrName: "",
2567
2567
  attrValue: "",
@@ -2572,13 +2572,13 @@ function Mo() {
2572
2572
  let h = d.length;
2573
2573
  const b = _(n.nodeName);
2574
2574
  for (; h--; ) {
2575
- const y = d[h], S = y.name, j = y.namespaceURI, B = y.value, bt = _(S), fe = B;
2576
- let R = S === "value" ? fe : In(fe), io = !1;
2577
- if (f.attrName = bt, f.attrValue = R, f.keepAttr = !0, f.forceKeepAttr = void 0, Y(x.uponSanitizeAttribute, n, f), R = f.attrValue, ze && (bt === "id" || bt === "name") && co(R, He) !== 0 && (rt(S, n, y), R = He + R, io = !0), nt && O(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, R)) {
2575
+ const y = d[h], S = y.name, j = y.namespaceURI, H = y.value, bt = _(S), fe = H;
2576
+ let R = S === "value" ? fe : On(fe), ro = !1;
2577
+ if (f.attrName = bt, f.attrValue = R, f.keepAttr = !0, f.forceKeepAttr = void 0, q(x.uponSanitizeAttribute, n, f), R = f.attrValue, Be && (bt === "id" || bt === "name") && uo(R, He) !== 0 && (rt(S, n, y), R = He + R, ro = !0), nt && D(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, R)) {
2578
2578
  rt(S, n, y);
2579
2579
  continue;
2580
2580
  }
2581
- if (bt === "attributename" && lo(R, "href")) {
2581
+ if (bt === "attributename" && co(R, "href")) {
2582
2582
  rt(S, n, y);
2583
2583
  continue;
2584
2584
  }
@@ -2587,27 +2587,27 @@ function Mo() {
2587
2587
  rt(S, n, y);
2588
2588
  continue;
2589
2589
  }
2590
- if (!Pe && O(Xn, R)) {
2590
+ if (!Ne && D(Zn, R)) {
2591
2591
  rt(S, n, y);
2592
2592
  continue;
2593
2593
  }
2594
- if (X && (R = Ut(R)), !eo(b, bt, R)) {
2594
+ if (X && (R = Ut(R)), !oo(b, bt, R)) {
2595
2595
  rt(S, n, y);
2596
2596
  continue;
2597
2597
  }
2598
- R = an(b, bt, j, R), R !== fe && sn(n, S, j, R) && io && so(t.removed);
2598
+ R = ln(b, bt, j, R), R !== fe && cn(n, S, j, R) && ro && lo(t.removed);
2599
2599
  }
2600
2600
  }
2601
- Y(x.afterSanitizeAttributes, n, null), gt(n, s);
2601
+ q(x.afterSanitizeAttributes, n, null), gt(n, s);
2602
2602
  }, $t = function(n) {
2603
2603
  let s = null;
2604
2604
  const d = Je(n);
2605
- for (Y(x.beforeSanitizeShadowDOM, n, null); s = d.nextNode(); )
2606
- if (Y(x.uponSanitizeShadowNode, s, null), to(s, n), no(s, n), mt(s.content) && $t(s.content), vt(s) === F.element) {
2605
+ for (q(x.beforeSanitizeShadowDOM, n, null); s = d.nextNode(); )
2606
+ if (q(x.uponSanitizeShadowNode, s, null), eo(s, n), io(s, n), mt(s.content) && $t(s.content), wt(s) === F.element) {
2607
2607
  const f = st(s);
2608
2608
  mt(f) && (pe(f), $t(f));
2609
2609
  }
2610
- Y(x.afterSanitizeShadowDOM, n, null);
2610
+ q(x.afterSanitizeShadowDOM, n, null);
2611
2611
  }, pe = function(n) {
2612
2612
  const s = [{
2613
2613
  node: n,
@@ -2619,7 +2619,7 @@ function Mo() {
2619
2619
  $t(d.shadow);
2620
2620
  continue;
2621
2621
  }
2622
- const f = d.node, h = vt(f) === F.element, b = $(f);
2622
+ const f = d.node, h = wt(f) === F.element, b = $(f);
2623
2623
  if (b) for (let y = b.length - 1; y >= 0; --y) s.push({
2624
2624
  node: b[y],
2625
2625
  shadow: null
@@ -2648,86 +2648,86 @@ function Mo() {
2648
2648
  };
2649
2649
  return t.sanitize = function(u) {
2650
2650
  let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = null, d = null, f = null, h = null;
2651
- if (ae = !u, ae && (u = "<!-->"), typeof u != "string" && !xt(u) && (u = Nn(u), typeof u != "string"))
2652
- throw J("dirty is not a string, aborting");
2651
+ if (ae = !u, ae && (u = "<!-->"), typeof u != "string" && !At(u) && (u = Bn(u), typeof u != "string"))
2652
+ throw Z("dirty is not a string, aborting");
2653
2653
  if (!t.isSupported) return u;
2654
- oe ? (A = Dt, C = Rt) : de(n), (x.uponSanitizeElement.length > 0 || x.uponSanitizeAttribute.length > 0) && (A = U(A)), x.uponSanitizeAttribute.length > 0 && (C = U(C)), t.removed = [];
2655
- const b = re && typeof u != "string" && xt(u);
2654
+ oe ? (A = Ot, C = Rt) : de(n), (x.uponSanitizeElement.length > 0 || x.uponSanitizeAttribute.length > 0) && (A = U(A)), x.uponSanitizeAttribute.length > 0 && (C = U(C)), t.removed = [];
2655
+ const b = re && typeof u != "string" && At(u);
2656
2656
  if (b) {
2657
- en(u);
2657
+ nn(u);
2658
2658
  const j = Xt(u);
2659
2659
  if (typeof j == "string") {
2660
- const B = _(j);
2661
- if (!A[B] || Tt[B])
2662
- throw Bt(u), J("root node is forbidden and cannot be sanitized in-place");
2660
+ const H = _(j);
2661
+ if (!A[H] || kt[H])
2662
+ throw Ht(u), Z("root node is forbidden and cannot be sanitized in-place");
2663
2663
  }
2664
2664
  if (jt(u))
2665
- throw Bt(u), J("root node is clobbered and cannot be sanitized in-place");
2665
+ throw Ht(u), Z("root node is clobbered and cannot be sanitized in-place");
2666
2666
  try {
2667
2667
  pe(u);
2668
- } catch (B) {
2669
- throw Bt(u), B;
2668
+ } catch (H) {
2669
+ throw Ht(u), H;
2670
2670
  }
2671
- } else if (xt(u))
2671
+ } else if (At(u))
2672
2672
  s = Ze("<!---->"), d = s.ownerDocument.importNode(u, !0), d.nodeType === F.element && d.nodeName === "BODY" || d.nodeName === "HTML" ? s = d : s.appendChild(d), pe(s);
2673
2673
  else {
2674
2674
  if (!dt && !X && !it && u.indexOf("<") === -1) return P && Nt ? ct(u) : u;
2675
2675
  if (s = Ze(u), !s) return dt ? null : Nt ? ot : "";
2676
2676
  }
2677
- s && ne && Z(s.firstChild);
2677
+ s && ne && Q(s.firstChild);
2678
2678
  const y = b ? u : s;
2679
2679
  try {
2680
2680
  const j = Je(y);
2681
2681
  for (; f = j.nextNode(); )
2682
- to(f, y), no(f, y), mt(f.content) && $t(f.content);
2682
+ eo(f, y), io(f, y), mt(f.content) && $t(f.content);
2683
2683
  } catch (j) {
2684
- throw b && (Bt(u), at(t.removed, (B) => {
2685
- B.element && Ft(B.element);
2684
+ throw b && (Ht(u), at(t.removed, (H) => {
2685
+ H.element && Ft(H.element);
2686
2686
  })), j;
2687
2687
  }
2688
2688
  if (b) {
2689
2689
  let j = !1;
2690
- if (at(t.removed, (B) => {
2691
- B.element && (B.element === u && (j = !0), Ft(B.element));
2692
- }), j) throw J("a node selected for removal could not be safely returned; refusing to sanitize in place");
2690
+ if (at(t.removed, (H) => {
2691
+ H.element && (H.element === u && (j = !0), Ft(H.element));
2692
+ }), j) throw Z("a node selected for removal could not be safely returned; refusing to sanitize in place");
2693
2693
  return X && ue(u), u;
2694
2694
  }
2695
2695
  if (dt) {
2696
2696
  if (X && ue(s), Pt)
2697
- for (h = Po.call(s.ownerDocument); s.firstChild; ) h.appendChild(s.firstChild);
2697
+ for (h = zo.call(s.ownerDocument); s.firstChild; ) h.appendChild(s.firstChild);
2698
2698
  else h = s;
2699
- return (C.shadowroot || C.shadowrootmode) && (h = zo.call(o, h, !0)), h;
2699
+ return (C.shadowroot || C.shadowrootmode) && (h = Ho.call(o, h, !0)), h;
2700
2700
  }
2701
2701
  let S = it ? s.outerHTML : s.innerHTML;
2702
- return it && A["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && O(Yn, s.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + s.ownerDocument.doctype.name + `>
2702
+ return it && A["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && D(Vn, s.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + s.ownerDocument.doctype.name + `>
2703
2703
  ` + S), X && (S = Ut(S)), P && Nt ? ct(S) : S;
2704
2704
  }, t.setConfig = function() {
2705
2705
  let u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2706
- de(u), oe = !0, Dt = A, Rt = C;
2706
+ de(u), oe = !0, Ot = A, Rt = C;
2707
2707
  }, t.clearConfig = function() {
2708
- ht = null, oe = !1, Dt = null, Rt = null, P = Zt, ot = "";
2708
+ ht = null, oe = !1, Ot = null, Rt = null, P = Qt, ot = "";
2709
2709
  }, t.isValidAttribute = function(u, n, s) {
2710
2710
  ht || de({});
2711
2711
  const d = _(u), f = _(n);
2712
- return eo(d, f, s);
2712
+ return oo(d, f, s);
2713
2713
  }, t.addHook = function(u, n) {
2714
- typeof n == "function" && N(x, u) && At(x[u], n);
2714
+ typeof n == "function" && N(x, u) && Ct(x[u], n);
2715
2715
  }, t.removeHook = function(u, n) {
2716
2716
  if (N(x, u)) {
2717
2717
  if (n !== void 0) {
2718
- const s = Ln(x[u], n);
2719
- return s === -1 ? void 0 : Mn(x[u], s, 1)[0];
2718
+ const s = In(x[u], n);
2719
+ return s === -1 ? void 0 : Dn(x[u], s, 1)[0];
2720
2720
  }
2721
- return so(x[u]);
2721
+ return lo(x[u]);
2722
2722
  }
2723
2723
  }, t.removeHooks = function(u) {
2724
2724
  N(x, u) && (x[u] = []);
2725
2725
  }, t.removeAllHooks = function() {
2726
- x = vo();
2726
+ x = wo();
2727
2727
  }, t;
2728
2728
  }
2729
- var Kt = Mo();
2730
- const ei = [
2729
+ var Kt = Do();
2730
+ const ni = [
2731
2731
  "p",
2732
2732
  "br",
2733
2733
  "strong",
@@ -2776,7 +2776,7 @@ const ei = [
2776
2776
  // user-initiated dialog, a different trust boundary that never calls
2777
2777
  // through this sanitizer. A consumer that genuinely wants iframes in
2778
2778
  // pasted/typed content can still opt in via a custom allowedTags list.
2779
- ], oi = {
2779
+ ], ii = {
2780
2780
  "*": ["class", "style", "id", "data-*", "role", "aria-*", "tabindex", "contenteditable", "spellcheck", "dir", "lang"],
2781
2781
  a: ["href", "target", "rel", "title"],
2782
2782
  img: ["src", "alt", "width", "height", "loading"],
@@ -2793,8 +2793,8 @@ const ei = [
2793
2793
  // additionalAllowedTags), restoring the attributes that make an inserted
2794
2794
  // iframe actually usable (src, sizing, fullscreen, scrolling/border).
2795
2795
  iframe: ["src", "width", "height", "name", "title", "frameborder", "scrolling", "allowfullscreen", "longdesc", "allow"]
2796
- }, ni = "data-editora-embed";
2797
- function ii(a) {
2796
+ }, ri = "data-editora-embed";
2797
+ function ai(a) {
2798
2798
  if (!a || /\s/.test(a.trim())) return !1;
2799
2799
  try {
2800
2800
  const t = new URL(a.trim());
@@ -2803,10 +2803,10 @@ function ii(a) {
2803
2803
  return !1;
2804
2804
  }
2805
2805
  }
2806
- function Io(a, t, e, o) {
2806
+ function Oo(a, t, e, o) {
2807
2807
  if ((t == null ? void 0 : t.sanitize) === !1)
2808
2808
  return a;
2809
- const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : ei, r = e != null && e.length ? Array.from(/* @__PURE__ */ new Set([...i, ...e])) : i, c = !!(t != null && t.allowedAttributes) && Object.keys(t.allowedAttributes).length > 0 ? t.allowedAttributes : oi, p = /* @__PURE__ */ new Set();
2809
+ const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : ni, r = e != null && e.length ? Array.from(/* @__PURE__ */ new Set([...i, ...e])) : i, c = !!(t != null && t.allowedAttributes) && Object.keys(t.allowedAttributes).length > 0 ? t.allowedAttributes : ii, p = /* @__PURE__ */ new Set();
2810
2810
  for (const w of Object.values(c))
2811
2811
  for (const T of w) p.add(T);
2812
2812
  const m = {
@@ -2822,7 +2822,7 @@ function Io(a, t, e, o) {
2822
2822
  var k;
2823
2823
  if (T.tagName !== "iframe") return;
2824
2824
  const v = w;
2825
- T.allowedTags.iframe = g || ((k = v.getAttribute) == null ? void 0 : k.call(v, ni)) === "true" && ii(v.getAttribute("src"));
2825
+ T.allowedTags.iframe = g || ((k = v.getAttribute) == null ? void 0 : k.call(v, ri)) === "true" && ai(v.getAttribute("src"));
2826
2826
  }
2827
2827
  );
2828
2828
  try {
@@ -2831,22 +2831,22 @@ function Io(a, t, e, o) {
2831
2831
  Kt.removeHook("uponSanitizeElement");
2832
2832
  }
2833
2833
  }
2834
- function ri(a, t, e, o) {
2835
- return Io(a, t, o, !1);
2834
+ function si(a, t, e, o) {
2835
+ return Oo(a, t, o, !1);
2836
2836
  }
2837
- function ai(a, t, e) {
2838
- return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? a : ri(a, t);
2837
+ function li(a, t, e) {
2838
+ return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? a : si(a, t);
2839
2839
  }
2840
- function wo(a, t, e, o) {
2841
- return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? a : Io(a, t, o, !0);
2840
+ function To(a, t, e, o) {
2841
+ return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? a : Oo(a, t, o, !0);
2842
2842
  }
2843
- const si = ".resize-handle, .table-resize-handle, [data-rte-media-pending]", li = /resize-handle|data-rte-media-pending|rte-media/;
2844
- function Oo(a) {
2845
- if (!a || !li.test(a)) return a;
2843
+ const ci = ".resize-handle, .table-resize-handle, [data-rte-media-pending]", di = /resize-handle|data-rte-media-pending|rte-media/;
2844
+ function Ro(a) {
2845
+ if (!a || !di.test(a)) return a;
2846
2846
  const t = document.createElement("template");
2847
2847
  t.innerHTML = a;
2848
2848
  const e = /* @__PURE__ */ new Set();
2849
- return t.content.querySelectorAll(si).forEach((o) => {
2849
+ return t.content.querySelectorAll(ci).forEach((o) => {
2850
2850
  const i = o.parentElement;
2851
2851
  i && (i.tagName === "TD" || i.tagName === "TH") && e.add(i), o.remove();
2852
2852
  }), e.forEach((o) => {
@@ -2859,8 +2859,8 @@ function Oo(a) {
2859
2859
  i && (i.removeAttribute("contenteditable"), !((r = i.textContent) != null && r.trim()) && !i.querySelector("img, video, a") && i.remove());
2860
2860
  }), t.innerHTML;
2861
2861
  }
2862
- function _t(a) {
2863
- return a ? Oo(a.innerHTML) : "";
2862
+ function yt(a) {
2863
+ return a ? Ro(a.innerHTML) : "";
2864
2864
  }
2865
2865
  const Vt = class Vt {
2866
2866
  /**
@@ -3059,7 +3059,7 @@ Vt.EDITOR_DEFAULTS = {
3059
3059
  width: "100%",
3060
3060
  readonly: !1,
3061
3061
  disabled: !1,
3062
- menubar: !0,
3062
+ menubar: !1,
3063
3063
  toolbar: !0,
3064
3064
  plugins: [],
3065
3065
  theme: "light",
@@ -3123,40 +3123,46 @@ Vt.EDITOR_DEFAULTS = {
3123
3123
  "security-sanitize-on-paste",
3124
3124
  "security-sanitize-on-input"
3125
3125
  ]);
3126
- let xe = Vt;
3127
- const ci = '.editora-editor{display:flex;flex-direction:column;border:1px solid #ddd;border-radius:4px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;overflow:hidden}.editora-editor *{box-sizing:border-box}.editora-theme-light{background:#fff;color:#333}.editora-theme-dark{--editora-dark-toolbar-bg-start: #353d48;--editora-dark-toolbar-bg-end: #2d3540;--editora-dark-button-bg-start: #46505f;--editora-dark-button-bg-end: #3b4553;--editora-dark-button-hover-start: #525d6d;--editora-dark-button-hover-end: #465262;--editora-dark-button-active-start: #5eaaf6;--editora-dark-button-active-end: #4a95de;--editora-dark-border: #475263;--editora-dark-border-strong: #566275;--editora-dark-text: #e1e9f5;--editora-dark-text-strong: #f3f7ff;--editora-dark-text-muted: #aeb9cc;--editora-dark-surface: #1d242d;--editora-dark-content: #1f2732;background:linear-gradient(180deg,#1b2330,#1c2430);color:var(--editora-dark-text);border-color:var(--editora-dark-border)}.editora-toolbar{display:flex;align-items:center;gap:4px;padding:8px;background:#f5f5f5;border-bottom:1px solid #ddd;flex-wrap:wrap}.editora-theme-dark .editora-toolbar{background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%);border-bottom-color:var(--editora-dark-border);box-shadow:inset 0 1px #ffffff0d}.editora-toolbar-sticky{position:sticky;top:0;z-index:100;position:-webkit-sticky}.editora-toolbar-group{display:flex;align-items:center;gap:2px}.editora-toolbar-button{padding:6px 12px;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-weight:600;font-size:14px;height:30px;display:flex;align-items:center;white-space:nowrap}.editora-toolbar-group-button{display:flex;align-items:center}.editora-toolbar-input.font-size{width:40px;padding:.25rem;text-align:center;font-size:14px;background:#fff;border:1px solid var(--rte-color-border-light);border-radius:var(--rte-radius-sm)}.editora-toolbar-group-items{display:flex;align-items:center;border:1px solid #ccc;.editora-toolbar-button{border:none;border-radius:0;&:first-child{border-right:1px solid #ccc;border-top-left-radius:3px;border-bottom-left-radius:3px}&:last-child{border:0px solid #ccc;border-radius:0!important}&:hover{background:#e0e0e0;border-color:#ccc}}}.editora-theme-dark .editora-toolbar-button{background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%);border-color:var(--editora-dark-border-strong);color:var(--editora-dark-text);box-shadow:inset 0 1px #ffffff14,0 1px 1px #00000059}.editora-theme-dark .editora-toolbar-group-items{border-color:var(--editora-dark-border-strong);background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%)}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:first-child{border-right-color:#566275}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:last-child{border-left-color:#566275}.editora-theme-dark .editora-toolbar-input.font-size{background-color:#2e3642;color:var(--editora-dark-text-strong);border-color:var(--editora-dark-border-strong);caret-color:var(--editora-dark-text-strong)}.editora-theme-dark .editora-toolbar-input.font-size::placeholder{color:var(--editora-dark-text-strong);opacity:1}.editora-toolbar-button:hover{background:#e0e0e0;border-color:#ccc}.editora-theme-dark .editora-toolbar-button:hover{background:linear-gradient(180deg,var(--editora-dark-button-hover-start) 0%,var(--editora-dark-button-hover-end) 100%);border-color:#66748a;color:var(--editora-dark-text-strong)}.editora-toolbar-button:active,.editora-toolbar-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-button:active,.editora-theme-dark .editora-toolbar-button.active{background:linear-gradient(180deg,var(--editora-dark-button-active-start) 0%,var(--editora-dark-button-active-end) 100%);border-color:#67adf4;color:#0f1b2a}.editora-theme-dark .editora-toolbar-button:disabled{background:#313946;border-color:#424d5e;color:#7f8ca1}.editora-theme-dark .editora-toolbar-button[data-command=insertTable],.editora-theme-dark .editora-toolbar-button[data-command=print],.editora-theme-dark .editora-toolbar-button[data-command=toggleSpellCheck],.editora-theme-dark .editora-toolbar-button[data-command=toggleA11yChecker],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionLTR],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionRTL]{color:#f1f6ff}.editora-toolbar-button:disabled{opacity:.5;cursor:not-allowed}.editora-toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;line-height:1}.editora-toolbar-button svg,.editora-toolbar-icon svg{width:20px;height:20px;display:block;color:currentColor}.editora-theme-dark .editora-toolbar-button svg:not([fill=none i]),.editora-theme-dark .editora-toolbar-icon svg:not([fill=none i]){fill:currentColor}.editora-theme-dark .editora-toolbar-icon,.editora-theme-dark .editora-toolbar-icon *{color:inherit}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([stroke="#000" i],[stroke="#000000" i],[stroke=black i],[stroke="#0f0f0f" i],[stroke="#111111" i],[style*="stroke:#000" i],[style*="stroke: #000" i],[style*="stroke:black" i],[style*="stroke: black" i],[style*="stroke:#0f0f0f" i],[style*="stroke: #0f0f0f" i]){stroke:currentColor!important}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([fill="#000" i],[fill="#000000" i],[fill=black i],[fill="#0f0f0f" i],[fill="#111111" i],[style*="fill:#000" i],[style*="fill: #000" i],[style*="fill:black" i],[style*="fill: black" i],[style*="fill:#0f0f0f" i],[style*="fill: #0f0f0f" i]){fill:currentColor!important}.editora-toolbar-separator{width:1px;height:24px;background:#ddd;margin:0 4px}.editora-theme-dark .editora-toolbar-separator{background:#4d596b}.editora-toolbar-items-container{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow:hidden}.editora-toolbar-more-button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;padding:0;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-size:16px}.editora-toolbar-more-button:hover{background:#e0e0e0}.editora-toolbar-more-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-more-button{background:var(--editora-dark-content);border-color:var(--editora-dark-border);color:var(--editora-dark-text)}.editora-theme-dark .editora-toolbar-more-button:hover,.editora-theme-dark .editora-toolbar-more-button.active{background:#3a4554;border-color:#607088}.editora-toolbar-expanded-row{display:none;flex-wrap:wrap;align-items:center;gap:4px;width:100%;padding:8px;border-top:1px solid #ddd;background:#f5f5f5}.editora-toolbar-expanded-row.show{display:flex}.editora-theme-dark .editora-toolbar-expanded-row{border-top-color:var(--editora-dark-border);background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%)}.editora-toolbar-dropdown{position:relative}.editora-toolbar-dropdown-menu{position:absolute;top:100%;left:0;min-width:150px;margin-top:4px;padding:4px 0;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-toolbar-dropdown-menu{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;color:#333;text-align:left;cursor:pointer;font-size:13px;transition:background .15s ease}.editora-theme-dark .editora-toolbar-dropdown-item{color:#d7deea}.editora-toolbar-dropdown-item:hover{background:#f5f5f5}.editora-theme-dark .editora-toolbar-dropdown-item:hover{background:#3a4554;color:#f0f6ff}.editora-content{flex:1;min-height:200px;padding:16px;outline:none;overflow-y:auto;line-height:1.6}.editora-theme-dark .editora-content{color:#ecf3ff;background:linear-gradient(180deg,var(--editora-dark-content) 0%,#1c232e 100%)}.editora-content:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none}.editora-theme-dark .editora-content:empty:before{color:#8f9bb0}.editora-content h1{font-size:2em;margin:.67em 0;font-weight:600}.editora-content h2{font-size:1.5em;margin:.75em 0;font-weight:600}.editora-content h3{font-size:1.17em;margin:.83em 0;font-weight:600}.editora-content p{margin:1em 0}.editora-theme-dark .editora-content,.editora-theme-dark .editora-content :is(p,span,div,li,ul,ol,td,th,h1,h2,h3,h4,h5,h6,strong,em,u,s,small,sub,sup,blockquote,code,pre,a){color:#ecf3ff}.editora-content ul,.editora-content ol{margin:1em 0;padding-left:2em}.editora-content a{color:#06c;text-decoration:underline}.editora-theme-dark .editora-content a{color:#ecf3ff}.editora-content code{padding:2px 4px;background:#f5f5f5;border-radius:3px;font-family:Monaco,Menlo,Consolas,monospace;font-size:.9em}.editora-theme-dark .editora-content code{background:#1e1e1e}.editora-content pre{padding:12px;background:#f5f5f5;border-radius:4px;overflow-x:auto;margin:1em 0}.editora-theme-dark .editora-content pre{background:#1e1e1e}.editora-theme-dark .rte-code-block{background:linear-gradient(180deg,#212a36,#1b2430)!important;border-color:#4f5b70!important;color:#e7effc!important}.editora-theme-dark .rte-code-block code{color:#e7effc!important}.editora-theme-dark .rte-code-block:before{background:#111927!important;color:#dce8ff!important}.editora-theme-dark .rte-code-block .rte-code-copy{background:#2b3441!important;border-color:#5a667b!important;color:#dce8ff!important}.editora-content blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.editora-theme-dark .editora-content blockquote{border-left-color:#3c3c3c;color:#ecf3ff}.editora-floating-toolbar{position:absolute;padding:4px;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-floating-toolbar{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-statusbar-container{display:flex;flex-direction:column}.editora-statusbar-left{display:flex;align-items:center;gap:8px}.editora-statusbar-right{display:flex;align-items:center;gap:8px;margin-left:auto}.editora-statusbar{display:flex;align-items:center;gap:12px;padding:6px 12px;background:#f5f5f5;border-top:1px solid #ddd;font-size:12px;color:#666}.editora-theme-dark .editora-statusbar{background:linear-gradient(180deg,#2c3440,#252d37);border-top-color:#3f4a5b;color:#d7deea}.editora-statusbar-item{white-space:nowrap}.editora-statusbar-separator{color:#ddd}.editora-theme-dark .editora-statusbar-separator{color:#566275}.editora-editor[readonly] .editora-content{background:#fafafa;cursor:not-allowed}.editora-theme-dark.editora-editor[readonly] .editora-content{background:#1a1a1a}.editora-editor:focus-within{border-color:#06c;box-shadow:0 0 0 3px #0066cc1a}.editora-theme-dark.editora-editor:focus-within{border-color:#4db8ff;box-shadow:0 0 0 3px #4db8ff1a}.editora-editor[disabled]{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}editora-editor[data-loading]{display:block;position:relative;min-height:160px;border:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px);background:var(--ui-color-surface, #fff)}editora-editor[data-loading]:before{content:"";position:absolute;inset:0 0 auto;height:46px;border-bottom:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px) var(--ui-radius, 4px) 0 0;background:linear-gradient(90deg,var(--ui-color-surface-alt, #f5f5f5) 0%,color-mix(in srgb,var(--ui-color-surface-alt, #f5f5f5) 70%,var(--ui-color-border, #ddd)) 50%,var(--ui-color-surface-alt, #f5f5f5) 100%);background-size:220% 100%;animation:editora-loading-shimmer 1.2s linear infinite}editora-editor[data-loading]:after{content:"Loading editor…";position:absolute;top:62px;left:16px;font:14px/1.4 var(--ui-font-family, system-ui, sans-serif);color:var(--ui-color-muted, #6b7280)}editora-editor[data-loading]>*{visibility:hidden}@keyframes editora-loading-shimmer{to{background-position:-220% 0}}@media(prefers-reduced-motion:reduce){editora-editor[data-loading]:before{animation:none}}';
3128
- let Yt;
3129
- const di = "__editoraCommandEditorRoot", ui = "__editoraLastCommandButton", To = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", ko = ".rte-content, .editora-content", pi = "Rich text editor", fi = /* @__PURE__ */ new Set(["collaboration"]), Ae = /* @__PURE__ */ new Set();
3130
- let tt = null, xo = !1, ve = null, we = null;
3131
- function Ao(a) {
3126
+ let Ae = Vt;
3127
+ const ko = /* @__PURE__ */ new Set();
3128
+ function ui(a, t) {
3129
+ ko.has(a) || (ko.add(a), console.warn(
3130
+ `[Editora] The "${a}" option has no effect: ${t} It is still accepted so existing code keeps working, and will be removed in a future major release.`
3131
+ ));
3132
+ }
3133
+ const pi = '.editora-editor{display:flex;flex-direction:column;border:1px solid #ddd;border-radius:4px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;overflow:hidden}.editora-editor *{box-sizing:border-box}.editora-theme-light{background:#fff;color:#333}.editora-theme-dark{--editora-dark-toolbar-bg-start: #353d48;--editora-dark-toolbar-bg-end: #2d3540;--editora-dark-button-bg-start: #46505f;--editora-dark-button-bg-end: #3b4553;--editora-dark-button-hover-start: #525d6d;--editora-dark-button-hover-end: #465262;--editora-dark-button-active-start: #5eaaf6;--editora-dark-button-active-end: #4a95de;--editora-dark-border: #475263;--editora-dark-border-strong: #566275;--editora-dark-text: #e1e9f5;--editora-dark-text-strong: #f3f7ff;--editora-dark-text-muted: #aeb9cc;--editora-dark-surface: #1d242d;--editora-dark-content: #1f2732;background:linear-gradient(180deg,#1b2330,#1c2430);color:var(--editora-dark-text);border-color:var(--editora-dark-border)}.editora-toolbar{display:flex;align-items:center;gap:4px;padding:8px;background:#f5f5f5;border-bottom:1px solid #ddd;flex-wrap:wrap}.editora-theme-dark .editora-toolbar{background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%);border-bottom-color:var(--editora-dark-border);box-shadow:inset 0 1px #ffffff0d}.editora-toolbar-sticky{position:sticky;top:0;z-index:100;position:-webkit-sticky}.editora-toolbar-group{display:flex;align-items:center;gap:2px}.editora-toolbar-button{padding:6px 12px;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-weight:600;font-size:14px;height:30px;display:flex;align-items:center;white-space:nowrap}.editora-toolbar-group-button{display:flex;align-items:center}.editora-toolbar-input.font-size{width:40px;padding:.25rem;text-align:center;font-size:14px;background:#fff;border:1px solid var(--rte-color-border-light);border-radius:var(--rte-radius-sm)}.editora-toolbar-group-items{display:flex;align-items:center;border:1px solid #ccc;.editora-toolbar-button{border:none;border-radius:0;&:first-child{border-right:1px solid #ccc;border-top-left-radius:3px;border-bottom-left-radius:3px}&:last-child{border:0px solid #ccc;border-radius:0!important}&:hover{background:#e0e0e0;border-color:#ccc}}}.editora-theme-dark .editora-toolbar-button{background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%);border-color:var(--editora-dark-border-strong);color:var(--editora-dark-text);box-shadow:inset 0 1px #ffffff14,0 1px 1px #00000059}.editora-theme-dark .editora-toolbar-group-items{border-color:var(--editora-dark-border-strong);background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%)}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:first-child{border-right-color:#566275}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:last-child{border-left-color:#566275}.editora-theme-dark .editora-toolbar-input.font-size{background-color:#2e3642;color:var(--editora-dark-text-strong);border-color:var(--editora-dark-border-strong);caret-color:var(--editora-dark-text-strong)}.editora-theme-dark .editora-toolbar-input.font-size::placeholder{color:var(--editora-dark-text-strong);opacity:1}.editora-toolbar-button:hover{background:#e0e0e0;border-color:#ccc}.editora-theme-dark .editora-toolbar-button:hover{background:linear-gradient(180deg,var(--editora-dark-button-hover-start) 0%,var(--editora-dark-button-hover-end) 100%);border-color:#66748a;color:var(--editora-dark-text-strong)}.editora-toolbar-button:active,.editora-toolbar-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-button:active,.editora-theme-dark .editora-toolbar-button.active{background:linear-gradient(180deg,var(--editora-dark-button-active-start) 0%,var(--editora-dark-button-active-end) 100%);border-color:#67adf4;color:#0f1b2a}.editora-theme-dark .editora-toolbar-button:disabled{background:#313946;border-color:#424d5e;color:#7f8ca1}.editora-theme-dark .editora-toolbar-button[data-command=insertTable],.editora-theme-dark .editora-toolbar-button[data-command=print],.editora-theme-dark .editora-toolbar-button[data-command=toggleSpellCheck],.editora-theme-dark .editora-toolbar-button[data-command=toggleA11yChecker],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionLTR],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionRTL]{color:#f1f6ff}.editora-toolbar-button:disabled{opacity:.5;cursor:not-allowed}.editora-toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;line-height:1}.editora-toolbar-button svg,.editora-toolbar-icon svg{width:20px;height:20px;display:block;color:currentColor}.editora-theme-dark .editora-toolbar-button svg:not([fill=none i]),.editora-theme-dark .editora-toolbar-icon svg:not([fill=none i]){fill:currentColor}.editora-theme-dark .editora-toolbar-icon,.editora-theme-dark .editora-toolbar-icon *{color:inherit}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([stroke="#000" i],[stroke="#000000" i],[stroke=black i],[stroke="#0f0f0f" i],[stroke="#111111" i],[style*="stroke:#000" i],[style*="stroke: #000" i],[style*="stroke:black" i],[style*="stroke: black" i],[style*="stroke:#0f0f0f" i],[style*="stroke: #0f0f0f" i]){stroke:currentColor!important}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([fill="#000" i],[fill="#000000" i],[fill=black i],[fill="#0f0f0f" i],[fill="#111111" i],[style*="fill:#000" i],[style*="fill: #000" i],[style*="fill:black" i],[style*="fill: black" i],[style*="fill:#0f0f0f" i],[style*="fill: #0f0f0f" i]){fill:currentColor!important}.editora-toolbar-separator{width:1px;height:24px;background:#ddd;margin:0 4px}.editora-theme-dark .editora-toolbar-separator{background:#4d596b}.editora-toolbar-items-container{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow:hidden}.editora-toolbar-more-button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;padding:0;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-size:16px}.editora-toolbar-more-button:hover{background:#e0e0e0}.editora-toolbar-more-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-more-button{background:var(--editora-dark-content);border-color:var(--editora-dark-border);color:var(--editora-dark-text)}.editora-theme-dark .editora-toolbar-more-button:hover,.editora-theme-dark .editora-toolbar-more-button.active{background:#3a4554;border-color:#607088}.editora-toolbar-expanded-row{display:none;flex-wrap:wrap;align-items:center;gap:4px;width:100%;padding:8px;border-top:1px solid #ddd;background:#f5f5f5}.editora-toolbar-expanded-row.show{display:flex}.editora-theme-dark .editora-toolbar-expanded-row{border-top-color:var(--editora-dark-border);background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%)}.editora-toolbar-dropdown{position:relative}.editora-toolbar-dropdown-menu{position:absolute;top:100%;left:0;min-width:150px;margin-top:4px;padding:4px 0;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-toolbar-dropdown-menu{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;color:#333;text-align:left;cursor:pointer;font-size:13px;transition:background .15s ease}.editora-theme-dark .editora-toolbar-dropdown-item{color:#d7deea}.editora-toolbar-dropdown-item:hover{background:#f5f5f5}.editora-theme-dark .editora-toolbar-dropdown-item:hover{background:#3a4554;color:#f0f6ff}.editora-content{flex:1;min-height:200px;padding:16px;outline:none;overflow-y:auto;line-height:1.6}.editora-theme-dark .editora-content{color:#ecf3ff;background:linear-gradient(180deg,var(--editora-dark-content) 0%,#1c232e 100%)}.editora-content:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none}.editora-theme-dark .editora-content:empty:before{color:#8f9bb0}.editora-content h1{font-size:2em;margin:.67em 0;font-weight:600}.editora-content h2{font-size:1.5em;margin:.75em 0;font-weight:600}.editora-content h3{font-size:1.17em;margin:.83em 0;font-weight:600}.editora-content p{margin:1em 0}.editora-theme-dark .editora-content,.editora-theme-dark .editora-content :is(p,span,div,li,ul,ol,td,th,h1,h2,h3,h4,h5,h6,strong,em,u,s,small,sub,sup,blockquote,code,pre,a){color:#ecf3ff}.editora-content ul,.editora-content ol{margin:1em 0;padding-left:2em}.editora-content a{color:#06c;text-decoration:underline}.editora-theme-dark .editora-content a{color:#ecf3ff}.editora-content code{padding:2px 4px;background:#f5f5f5;border-radius:3px;font-family:Monaco,Menlo,Consolas,monospace;font-size:.9em}.editora-theme-dark .editora-content code{background:#1e1e1e}.editora-content pre{padding:12px;background:#f5f5f5;border-radius:4px;overflow-x:auto;margin:1em 0}.editora-theme-dark .editora-content pre{background:#1e1e1e}.editora-theme-dark .rte-code-block{background:linear-gradient(180deg,#212a36,#1b2430)!important;border-color:#4f5b70!important;color:#e7effc!important}.editora-theme-dark .rte-code-block code{color:#e7effc!important}.editora-theme-dark .rte-code-block:before{background:#111927!important;color:#dce8ff!important}.editora-theme-dark .rte-code-block .rte-code-copy{background:#2b3441!important;border-color:#5a667b!important;color:#dce8ff!important}.editora-content blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.editora-theme-dark .editora-content blockquote{border-left-color:#3c3c3c;color:#ecf3ff}.editora-floating-toolbar{position:absolute;padding:4px;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-floating-toolbar{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-statusbar-container{display:flex;flex-direction:column}.editora-statusbar-left{display:flex;align-items:center;gap:8px}.editora-statusbar-right{display:flex;align-items:center;gap:8px;margin-left:auto}.editora-statusbar{display:flex;align-items:center;gap:12px;padding:6px 12px;background:#f5f5f5;border-top:1px solid #ddd;font-size:12px;color:#666}.editora-theme-dark .editora-statusbar{background:linear-gradient(180deg,#2c3440,#252d37);border-top-color:#3f4a5b;color:#d7deea}.editora-statusbar-item{white-space:nowrap}.editora-statusbar-separator{color:#ddd}.editora-theme-dark .editora-statusbar-separator{color:#566275}.editora-editor[readonly] .editora-content{background:#fafafa;cursor:not-allowed}.editora-theme-dark.editora-editor[readonly] .editora-content{background:#1a1a1a}.editora-editor:focus-within{border-color:#06c;box-shadow:0 0 0 3px #0066cc1a}.editora-theme-dark.editora-editor:focus-within{border-color:#4db8ff;box-shadow:0 0 0 3px #4db8ff1a}.editora-editor.editora-disabled{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}editora-editor[data-loading]{display:block;position:relative;min-height:160px;border:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px);background:var(--ui-color-surface, #fff)}editora-editor[data-loading]:before{content:"";position:absolute;inset:0 0 auto;height:46px;border-bottom:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px) var(--ui-radius, 4px) 0 0;background:linear-gradient(90deg,var(--ui-color-surface-alt, #f5f5f5) 0%,color-mix(in srgb,var(--ui-color-surface-alt, #f5f5f5) 70%,var(--ui-color-border, #ddd)) 50%,var(--ui-color-surface-alt, #f5f5f5) 100%);background-size:220% 100%;animation:editora-loading-shimmer 1.2s linear infinite}editora-editor[data-loading]:after{content:"Loading editor…";position:absolute;top:62px;left:16px;font:14px/1.4 var(--ui-font-family, system-ui, sans-serif);color:var(--ui-color-muted, #6b7280)}editora-editor[data-loading]>*{visibility:hidden}@keyframes editora-loading-shimmer{to{background-position:-220% 0}}@media(prefers-reduced-motion:reduce){editora-editor[data-loading]:before{animation:none}}';
3134
+ let qt;
3135
+ const fi = "__editoraCommandEditorRoot", hi = "__editoraLastCommandButton", xo = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", Ao = ".rte-content, .editora-content", mi = "Rich text editor", gi = /* @__PURE__ */ new Set(["collaboration"]), ve = "data-editora-disabled-by-host", Ce = /* @__PURE__ */ new Set();
3136
+ let tt = null, Co = !1, we = null, Te = null;
3137
+ function So(a) {
3132
3138
  if (!(a instanceof HTMLElement)) return !1;
3133
3139
  const t = a;
3134
3140
  return typeof t.execCommand == "function" && (t.tagName.toLowerCase() === "editora-editor" || t.classList.contains("editora-editor") || t.hasAttribute("data-editora-editor"));
3135
3141
  }
3136
- function hi(a) {
3142
+ function bi(a) {
3137
3143
  return a ? a.nodeType === Node.ELEMENT_NODE ? a : a.parentElement : null;
3138
3144
  }
3139
3145
  function Lt(a) {
3140
3146
  if (!a) return null;
3141
- if (Ao(a))
3147
+ if (So(a))
3142
3148
  return a;
3143
- const t = a.matches(To) ? a : a.closest(To);
3144
- return !t || !Ao(t) ? null : t;
3149
+ const t = a.matches(xo) ? a : a.closest(xo);
3150
+ return !t || !So(t) ? null : t;
3145
3151
  }
3146
- function mi() {
3152
+ function yi() {
3147
3153
  var i;
3148
3154
  if (typeof window == "undefined") return null;
3149
- const a = window[di];
3155
+ const a = window[fi];
3150
3156
  if (a instanceof HTMLElement) {
3151
3157
  const r = Lt(a);
3152
3158
  if (r) return r;
3153
- const l = a.matches(ko) ? a : a.querySelector(ko);
3159
+ const l = a.matches(Ao) ? a : a.querySelector(Ao);
3154
3160
  if (l) {
3155
3161
  const c = Lt(l);
3156
3162
  if (c) return c;
3157
3163
  }
3158
3164
  }
3159
- const t = window[ui];
3165
+ const t = window[hi];
3160
3166
  if (t instanceof HTMLElement) {
3161
3167
  const r = Lt(t);
3162
3168
  if (r) return r;
@@ -3168,43 +3174,43 @@ function mi() {
3168
3174
  }
3169
3175
  const o = (i = window.getSelection) == null ? void 0 : i.call(window);
3170
3176
  if (o && o.rangeCount > 0) {
3171
- const r = Lt(hi(o.getRangeAt(0).startContainer));
3177
+ const r = Lt(bi(o.getRangeAt(0).startContainer));
3172
3178
  if (r) return r;
3173
3179
  }
3174
3180
  if (tt && tt.isConnected)
3175
3181
  return tt;
3176
- for (const r of Ae)
3182
+ for (const r of Ce)
3177
3183
  if (r.isConnected) return r;
3178
3184
  return null;
3179
3185
  }
3180
- function gi() {
3181
- if (typeof window == "undefined" || xo) return;
3182
- ve = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, we = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
3186
+ function Ei() {
3187
+ if (typeof window == "undefined" || Co) return;
3188
+ we = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, Te = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
3183
3189
  const a = (t, ...e) => {
3184
- const o = mi();
3185
- return o ? o.execCommand(t, ...e) : ve ? ve(t, ...e) : we ? we(t, ...e) : !1;
3190
+ const o = yi();
3191
+ return o ? o.execCommand(t, ...e) : we ? we(t, ...e) : Te ? Te(t, ...e) : !1;
3186
3192
  };
3187
- window.executeEditorCommand = a, window.execEditorCommand = a, xo = !0;
3193
+ window.executeEditorCommand = a, window.execEditorCommand = a, Co = !0;
3188
3194
  }
3189
- function bi() {
3195
+ function vi() {
3190
3196
  const a = "editora-webcomponent-styles";
3191
3197
  if (!document.getElementById(a)) {
3192
3198
  const t = document.createElement("style");
3193
- t.id = a, t.textContent = ci, document.head.appendChild(t);
3199
+ t.id = a, t.textContent = pi, document.head.appendChild(t);
3194
3200
  }
3195
3201
  }
3196
- function yi() {
3197
- if (!Yt) {
3198
- const a = q.__globalPluginLoader;
3199
- a ? Yt = a : Yt = new Co();
3202
+ function wi() {
3203
+ if (!qt) {
3204
+ const a = Y.__globalPluginLoader;
3205
+ a ? qt = a : qt = new _o();
3200
3206
  }
3201
- return Yt;
3207
+ return qt;
3202
3208
  }
3203
- const Ei = typeof HTMLElement == "undefined" ? class {
3209
+ const Ti = typeof HTMLElement == "undefined" ? class {
3204
3210
  } : HTMLElement;
3205
- class q extends Ei {
3211
+ class Y extends Ti {
3206
3212
  constructor() {
3207
- if (super(), this.pluginLoader = yi(), this.config = {}, this.isInitialized = !1, this.buildGeneration = 0, this.keyboardShortcutManager = new vn(), this.lastAutosavedContent = "", this.preservedContent = null, this.loadedPlugins = [], this.pluginInstances = /* @__PURE__ */ new Map(), this.lastBeforeInputType = null, this.pendingHistorySnapshot = null, bi(), !this.hasAttribute("data-initial-content")) {
3213
+ if (super(), this.pluginLoader = wi(), this.config = {}, this.isInitialized = !1, this.buildGeneration = 0, this.keyboardShortcutManager = new Tn(), this.lastAutosavedContent = "", this.preservedContent = null, this.loadedPlugins = [], this.pluginInstances = /* @__PURE__ */ new Map(), this.lastBeforeInputType = null, this.pendingHistorySnapshot = null, this.hasConnected = !1, this.reinitializeQueued = !1, this.lastReportedContent = null, vi(), !this.hasAttribute("data-initial-content")) {
3208
3214
  const t = this.innerHTML.trim();
3209
3215
  t && this.setAttribute("data-initial-content", t);
3210
3216
  }
@@ -3261,7 +3267,7 @@ class q extends Ei {
3261
3267
  * Called when element is added to DOM
3262
3268
  */
3263
3269
  connectedCallback() {
3264
- this.config = this.resolveConfig(), this.waitForPluginLoader().then(() => {
3270
+ this.hasConnected = !0, this.config = this.resolveConfig(), this.waitForPluginLoader().then(() => {
3265
3271
  setTimeout(async () => {
3266
3272
  await this.initialize();
3267
3273
  }, 0);
@@ -3271,13 +3277,13 @@ class q extends Ei {
3271
3277
  * Wait for the global plugin loader to be available
3272
3278
  */
3273
3279
  async waitForPluginLoader() {
3274
- if (q.__globalPluginLoader) {
3275
- this.pluginLoader = q.__globalPluginLoader;
3280
+ if (Y.__globalPluginLoader) {
3281
+ this.pluginLoader = Y.__globalPluginLoader;
3276
3282
  return;
3277
3283
  }
3278
3284
  return new Promise((t) => {
3279
3285
  const e = () => {
3280
- q.__globalPluginLoader ? (this.pluginLoader = q.__globalPluginLoader, t()) : setTimeout(e, 0);
3286
+ Y.__globalPluginLoader ? (this.pluginLoader = Y.__globalPluginLoader, t()) : setTimeout(e, 0);
3281
3287
  };
3282
3288
  e();
3283
3289
  });
@@ -3298,7 +3304,22 @@ class q extends Ei {
3298
3304
  * Set configuration via JavaScript API
3299
3305
  */
3300
3306
  async setConfig(t) {
3301
- this.jsConfig = t, this.config = this.resolveConfig(), this.isConnected && (this.destroy(), await this.waitForPluginLoader(), await this.initialize());
3307
+ this.jsConfig = t, this.config = this.resolveConfig(), this.isConnected ? (this.destroy(), this.adoptConfiguredContent(t), await this.waitForPluginLoader(), await this.initialize()) : this.adoptConfiguredContent(t);
3308
+ }
3309
+ /**
3310
+ * `content` in setConfig() is a one-off replacement, not a setting: it feeds the next initialize()
3311
+ * the same way the live content that destroy() keeps does, so a later rebuild (a `plugins`
3312
+ * attribute change, the element being moved) resumes from what the user typed, not from this value.
3313
+ * It outranks that kept content, autosave and the element's own markup.
3314
+ */
3315
+ adoptConfiguredContent(t) {
3316
+ typeof t.content == "string" && (this.preservedContent = t.content);
3317
+ }
3318
+ /** Replace the `editora-theme-*` class (there is only ever one) with the one for `theme`. */
3319
+ applyThemeClass(t) {
3320
+ Array.from(this.classList).forEach((e) => {
3321
+ e.startsWith("editora-theme-") && this.classList.remove(e);
3322
+ }), t && this.classList.add(`editora-theme-${t}`);
3302
3323
  }
3303
3324
  /**
3304
3325
  * Initialize the editor
@@ -3307,7 +3328,7 @@ class q extends Ei {
3307
3328
  var r;
3308
3329
  if (this.querySelector(".editora-toolbar") || this.isInitialized) return;
3309
3330
  const t = ++this.buildGeneration;
3310
- this.setAttribute("data-editora-editor", "true"), Ae.add(this), tt || (tt = this), gi(), this.config.height && (this.style.height = typeof this.config.height == "number" ? `${this.config.height}px` : this.config.height), this.config.width && (this.style.width = typeof this.config.width == "number" ? `${this.config.width}px` : this.config.width), this.classList.add("editora-editor"), this.config.theme && this.classList.add(`editora-theme-${this.config.theme}`), this.setAttribute("data-loading", "true"), this.setAttribute("aria-busy", "true");
3331
+ this.setAttribute("data-editora-editor", "true"), Ce.add(this), tt || (tt = this), Ei(), this.config.height && (this.style.height = typeof this.config.height == "number" ? `${this.config.height}px` : this.config.height), this.config.width && (this.style.width = typeof this.config.width == "number" ? `${this.config.width}px` : this.config.width), this.classList.add("editora-editor"), this.classList.toggle("editora-disabled", this.isEditorDisabled()), this.applyThemeClass(this.config.theme), this.isMenubarRequested() && ui("menubar", "<editora-editor> does not render a menu bar."), this.setAttribute("data-loading", "true"), this.setAttribute("aria-busy", "true");
3311
3332
  const e = await this.loadPlugins();
3312
3333
  if (t !== this.buildGeneration || !this.isConnected) return;
3313
3334
  if (this.loadedPlugins = e, e.forEach((l) => {
@@ -3326,10 +3347,10 @@ class q extends Ei {
3326
3347
  const i = this.sanitizeLoadedContent(
3327
3348
  (r = o != null ? o : this.restoreAutosavedContent()) != null ? r : this.getAttribute("data-initial-content") || ""
3328
3349
  );
3329
- this.engine = new un({
3350
+ this.engine = new fn({
3330
3351
  content: i,
3331
3352
  plugins: e,
3332
- readonly: this.config.readonly
3353
+ readonly: !!this.config.readonly || this.isEditorDisabled()
3333
3354
  }), this.createUI(e, i), this.setupEventListeners(), this.startAutosave(), this.isInitialized = !0, this.removeAttribute("data-loading"), this.removeAttribute("aria-busy"), this.dispatchEvent(new CustomEvent("editor-ready", {
3334
3355
  detail: { api: this.getAPI() },
3335
3356
  bubbles: !0
@@ -3374,7 +3395,7 @@ class q extends Ei {
3374
3395
  const r = this.pluginLoader.getRegisteredPluginNames();
3375
3396
  for (const l of r) {
3376
3397
  const c = this.getPluginLoadConfig(l);
3377
- if (fi.has(l) && !c) continue;
3398
+ if (gi.has(l) && !c) continue;
3378
3399
  const p = await this.loadPlugin(l, c);
3379
3400
  p && t.push(p);
3380
3401
  }
@@ -3472,12 +3493,15 @@ class q extends Ei {
3472
3493
  if (!this.contentElement) return;
3473
3494
  const t = this.getAccessibilityConfig();
3474
3495
  if (t.enableARIA) {
3475
- this.contentElement.setAttribute("role", "textbox"), this.contentElement.setAttribute("aria-multiline", "true"), this.contentElement.setAttribute("aria-disabled", this.config.readonly ? "true" : "false");
3496
+ this.contentElement.setAttribute("role", "textbox"), this.contentElement.setAttribute("aria-multiline", "true"), this.contentElement.setAttribute(
3497
+ "aria-disabled",
3498
+ this.config.readonly || this.isEditorDisabled() ? "true" : "false"
3499
+ );
3476
3500
  const o = (e = this.getAttribute("aria-label")) == null ? void 0 : e.trim(), i = typeof this.config.placeholder == "string" ? this.config.placeholder.trim() : "";
3477
- this.contentElement.setAttribute("aria-label", o || i || pi);
3501
+ this.contentElement.setAttribute("aria-label", o || i || mi);
3478
3502
  } else
3479
3503
  this.contentElement.removeAttribute("role"), this.contentElement.removeAttribute("aria-multiline"), this.contentElement.removeAttribute("aria-disabled"), this.contentElement.removeAttribute("aria-label");
3480
- this.contentElement.tabIndex = t.keyboardNavigation ? 0 : -1;
3504
+ this.contentElement.tabIndex = t.keyboardNavigation && !this.isEditorDisabled() ? 0 : -1;
3481
3505
  }
3482
3506
  applyLanguageSettings() {
3483
3507
  if (!this.contentElement) return;
@@ -3574,7 +3598,7 @@ class q extends Ei {
3574
3598
  * editable DOM: sanitizing only after the first edit leaves the page exposed until then.
3575
3599
  */
3576
3600
  sanitizeLoadedContent(t) {
3577
- return wo(t, this.getContentSanitizeConfig(), this.getSecurityConfig());
3601
+ return To(t, this.getContentSanitizeConfig(), this.getSecurityConfig());
3578
3602
  }
3579
3603
  getAutosaveConfig() {
3580
3604
  var e, o;
@@ -3642,7 +3666,7 @@ class q extends Ei {
3642
3666
  this.stopAutosave();
3643
3667
  const t = this.getAutosaveConfig();
3644
3668
  !t.enabled || !this.contentElement || (this.autosaveTimer = setInterval(() => {
3645
- this.persistAutosave(_t(this.contentElement));
3669
+ this.persistAutosave(yt(this.contentElement));
3646
3670
  }, t.intervalMs));
3647
3671
  }
3648
3672
  insertHTMLAtSelection(t) {
@@ -3665,7 +3689,7 @@ class q extends Ei {
3665
3689
  */
3666
3690
  createUI(t, e) {
3667
3691
  const o = this.querySelector('[slot="toolbar"]'), i = this.querySelector('[slot="statusbar"]');
3668
- this.innerHTML = "", this.config.toolbar !== !1 && !o ? (this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.appendChild(this.toolbarElement), this.toolbar = new pn(
3692
+ this.innerHTML = "", this.config.toolbar !== !1 && !o ? (this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.appendChild(this.toolbarElement), this.toolbar = new hn(
3669
3693
  {
3670
3694
  items: this.resolveToolbarItems(),
3671
3695
  sticky: this.isToolbarStickyEnabled(),
@@ -3676,6 +3700,7 @@ class q extends Ei {
3676
3700
  // Pass plugin loader to get all registered plugins
3677
3701
  ), this.toolbar.setCommandHandler((r, l) => {
3678
3702
  var c;
3703
+ if (this.isEditorDisabled()) return !1;
3679
3704
  if (this.contentElement) {
3680
3705
  this.contentElement.focus();
3681
3706
  const p = window.getSelection();
@@ -3685,7 +3710,7 @@ class q extends Ei {
3685
3710
  }
3686
3711
  }
3687
3712
  return this.executeCommand(r, l);
3688
- }), this.toolbar.render(this.toolbarElement)) : o && this.appendChild(o), this.contentElement = document.createElement("div"), this.contentElement.className = "editora-content rte-content", this.contentElement.contentEditable = this.config.readonly ? "false" : "true", this.applyLanguageSettings(), this.applyAccessibilitySettings(), this.applySpellcheckSettings(), this.config.placeholder && this.contentElement.setAttribute("data-placeholder", this.config.placeholder);
3713
+ }), this.toolbar.render(this.toolbarElement)) : o && this.appendChild(o), this.contentElement = document.createElement("div"), this.contentElement.className = "editora-content rte-content", this.contentElement.contentEditable = this.config.readonly || this.isEditorDisabled() ? "false" : "true", this.applyLanguageSettings(), this.applyAccessibilitySettings(), this.applySpellcheckSettings(), this.config.placeholder && this.contentElement.setAttribute("data-placeholder", this.config.placeholder);
3689
3714
  try {
3690
3715
  document.execCommand("defaultParagraphSeparator", !1, "p");
3691
3716
  } catch (r) {
@@ -3702,11 +3727,20 @@ class q extends Ei {
3702
3727
  }) && e.trim() ? this.contentElement.innerHTML = `<p>${e.trim()}</p>` : this.contentElement.innerHTML = e;
3703
3728
  } else
3704
3729
  this.config.placeholder ? this.contentElement.innerHTML = "" : this.contentElement.innerHTML = "<p><br></p>";
3705
- this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new fn({ enabled: !0 }), this.floatingToolbar.create(this)), i ? this.appendChild(i) : this.isStatusbarEnabled() && (this.statusBarElement = document.createElement("div"), this.statusBarElement.className = "editora-statusbar-container", this.appendChild(this.statusBarElement), this.statusBar = new hn({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.config.autofocus && setTimeout(() => {
3730
+ this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new mn({ enabled: !0 }), this.floatingToolbar.create(this)), i ? this.appendChild(i) : this.isStatusbarEnabled() && (this.statusBarElement = document.createElement("div"), this.statusBarElement.className = "editora-statusbar-container", this.appendChild(this.statusBarElement), this.statusBar = new gn({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.setToolbarControlsDisabled(this.isEditorDisabled()), this.lastReportedContent = yt(this.contentElement), this.config.autofocus && !this.isEditorDisabled() && setTimeout(() => {
3706
3731
  var r;
3707
3732
  return (r = this.contentElement) == null ? void 0 : r.focus();
3708
3733
  }, 0);
3709
3734
  }
3735
+ /** True only when the page asked for a menu bar (the default is not a request), through setConfig() or the attribute. */
3736
+ isMenubarRequested() {
3737
+ var o;
3738
+ const t = (o = this.jsConfig) == null ? void 0 : o.menubar;
3739
+ if (t !== void 0)
3740
+ return t === !0 || typeof t == "object" && t !== null && t.enabled !== !1;
3741
+ const e = this.getAttribute("menubar");
3742
+ return e !== null && e !== "false";
3743
+ }
3710
3744
  /**
3711
3745
  * Hands what a keystroke changed to the history plugin, so Undo takes back typing. Without this the
3712
3746
  * plugin only knew about changes that plugins reported themselves, and typed text could not be undone.
@@ -3721,6 +3755,30 @@ class q extends Ei {
3721
3755
  selectionCollapsed: e.selectionCollapsed
3722
3756
  });
3723
3757
  }
3758
+ /**
3759
+ * `disabled` is `readonly` plus a toolbar that cannot be pressed and a surface that leaves the tab
3760
+ * order, like a disabled form control.
3761
+ */
3762
+ isEditorDisabled() {
3763
+ return this.config.disabled === !0;
3764
+ }
3765
+ applyDisabledState() {
3766
+ var e, o;
3767
+ const t = this.isEditorDisabled();
3768
+ this.classList.toggle("editora-disabled", t), t && ((e = this.floatingToolbar) == null || e.hide()), this.contentElement && (this.contentElement.contentEditable = t || this.config.readonly ? "false" : "true", this.applyAccessibilitySettings()), (o = this.engine) == null || o.setReadonly(t || !!this.config.readonly), this.setToolbarControlsDisabled(t);
3769
+ }
3770
+ /**
3771
+ * Disable (or give back) every control the default toolbar rendered. Controls that were already
3772
+ * disabled for another reason are marked untouched, so enabling the editor does not wake them up.
3773
+ */
3774
+ setToolbarControlsDisabled(t) {
3775
+ if (!this.toolbarElement) return;
3776
+ this.toolbarElement.querySelectorAll(
3777
+ "button, input, select, textarea"
3778
+ ).forEach((o) => {
3779
+ t ? o.disabled || (o.disabled = !0, o.setAttribute(ve, "")) : o.hasAttribute(ve) && (o.disabled = !1, o.removeAttribute(ve));
3780
+ });
3781
+ }
3724
3782
  /**
3725
3783
  * Setup event listeners
3726
3784
  */
@@ -3741,7 +3799,7 @@ class q extends Ei {
3741
3799
  let i = this.contentElement.innerHTML;
3742
3800
  const r = (T = o == null ? void 0 : o.detail) == null ? void 0 : T.allowedTags, l = this.getPerformanceConfig(), c = this.getContentSanitizeConfig(), p = this.getSecurityConfig(), m = this.lastBeforeInputType;
3743
3801
  if (this.lastBeforeInputType = null, p.sanitizeOnInput !== !1 && c.sanitize !== !1 && !m) {
3744
- const v = wo(i, c, p, r);
3802
+ const v = To(i, c, p, r);
3745
3803
  if (v !== i) {
3746
3804
  const k = window.getSelection(), et = k && k.rangeCount > 0 ? k.getRangeAt(0) : null;
3747
3805
  if (this.contentElement.innerHTML = v, et && k)
@@ -3754,10 +3812,7 @@ class q extends Ei {
3754
3812
  }
3755
3813
  this.recordInputHistory(i), this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
3756
3814
  const w = () => {
3757
- this.dispatchEvent(new CustomEvent("content-change", {
3758
- detail: { html: Oo(i) },
3759
- bubbles: !0
3760
- }));
3815
+ this.emitContentChange(Ro(i));
3761
3816
  };
3762
3817
  l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(w, l.debounceInputMs) : w(), this.updateStatusBar();
3763
3818
  }), this.contentElement.addEventListener("contextmenu", (o) => {
@@ -3780,19 +3835,20 @@ class q extends Ei {
3780
3835
  return;
3781
3836
  }
3782
3837
  if (r) {
3783
- p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r = ai(r, c, p)), this.insertHTMLAtSelection(r);
3838
+ p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r = li(r, c, p)), this.insertHTMLAtSelection(r);
3784
3839
  return;
3785
3840
  }
3786
3841
  l && document.execCommand("insertText", !1, l);
3787
3842
  }), this.contentElement.addEventListener("focus", () => {
3788
3843
  tt = this, this.dispatchEvent(new Event("editor-focus", { bubbles: !0 })), this.updateStatusBar();
3789
3844
  }), this.contentElement.addEventListener("blur", () => {
3790
- this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.dispatchEvent(new CustomEvent("content-change", {
3791
- detail: { html: _t(this.contentElement) },
3792
- bubbles: !0
3793
- })), this.dispatchEvent(new Event("editor-blur", { bubbles: !0 })), this.updateFloatingToolbar(), this.updateStatusBar();
3845
+ if (this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement) {
3846
+ const o = yt(this.contentElement);
3847
+ o !== this.lastReportedContent && this.emitContentChange(o);
3848
+ }
3849
+ this.dispatchEvent(new Event("editor-blur", { bubbles: !0 })), this.updateFloatingToolbar(), this.updateStatusBar();
3794
3850
  }), this.contentElement.addEventListener("keydown", (o) => {
3795
- this.getAccessibilityConfig().keyboardNavigation && t.handleKeyDown(o, (r, l) => {
3851
+ !this.getAccessibilityConfig().keyboardNavigation || this.isEditorDisabled() || t.handleKeyDown(o, (r, l) => {
3796
3852
  this.executeCommand(r, l);
3797
3853
  });
3798
3854
  });
@@ -3802,6 +3858,12 @@ class q extends Ei {
3802
3858
  };
3803
3859
  this.selectionChangeHandler = e, document.addEventListener("selectionchange", this.selectionChangeHandler);
3804
3860
  }
3861
+ emitContentChange(t) {
3862
+ this.lastReportedContent = t, this.dispatchEvent(new CustomEvent("content-change", {
3863
+ detail: { html: t },
3864
+ bubbles: !0
3865
+ }));
3866
+ }
3805
3867
  getSelectionRangeInEditor() {
3806
3868
  if (!this.contentElement) return null;
3807
3869
  const t = window.getSelection();
@@ -3869,10 +3931,10 @@ class q extends Ei {
3869
3931
  const t = this.getPerformanceConfig(), e = document.activeElement === this.contentElement || this.contentElement.contains(document.activeElement);
3870
3932
  if (t.viewportOnlyScan && !this.isEditorInViewport() && !e)
3871
3933
  return;
3872
- const o = this.contentElement.textContent || "", { words: i, chars: r } = yn(o), l = bn(this.contentElement);
3934
+ const o = this.contentElement.textContent || "", { words: i, chars: r } = vn(o), l = En(this.contentElement);
3873
3935
  let c, p;
3874
3936
  const m = this.getSelectionRangeInEditor();
3875
- m && (c = mn(this.contentElement, m), m.collapsed || (p = En(m, c), c = void 0)), this.statusBar.update({
3937
+ m && (c = bn(this.contentElement, m), m.collapsed || (p = wn(m, c), c = void 0)), this.statusBar.update({
3876
3938
  wordCount: i,
3877
3939
  charCount: r,
3878
3940
  lineCount: l,
@@ -3893,12 +3955,13 @@ class q extends Ei {
3893
3955
  handleAttributeChange(t, e) {
3894
3956
  switch (t) {
3895
3957
  case "readonly":
3896
- this.contentElement && (this.contentElement.contentEditable = this.isReadonlyAttribute(e) ? "false" : "true", this.applyAccessibilitySettings()), this.engine && this.engine.setReadonly(this.isReadonlyAttribute(e));
3958
+ this.contentElement && (this.contentElement.contentEditable = this.isReadonlyAttribute(e) || this.isEditorDisabled() ? "false" : "true", this.applyAccessibilitySettings()), this.engine && this.engine.setReadonly(this.isReadonlyAttribute(e) || this.isEditorDisabled());
3959
+ break;
3960
+ case "disabled":
3961
+ this.applyDisabledState();
3897
3962
  break;
3898
3963
  case "theme":
3899
- this.classList.forEach((o) => {
3900
- o.startsWith("editora-theme-") && this.classList.remove(o);
3901
- }), e && this.classList.add(`editora-theme-${e}`);
3964
+ this.applyThemeClass(e);
3902
3965
  break;
3903
3966
  case "placeholder":
3904
3967
  this.contentElement && (this.contentElement.setAttribute("data-placeholder", e), this.applyAccessibilitySettings());
@@ -3948,14 +4011,20 @@ class q extends Ei {
3948
4011
  case "toolbar-sticky":
3949
4012
  case "plugins":
3950
4013
  case "statusbar":
3951
- this.isConnected && (this.destroy(), this.waitForPluginLoader().then(() => {
3952
- this.initialize().catch((o) => {
3953
- console.error("[RichTextEditor] Error during attribute change re-initialization:", o);
3954
- });
3955
- }));
4014
+ this.isConnected && this.hasConnected && this.scheduleReinitialize();
3956
4015
  break;
3957
4016
  }
3958
4017
  }
4018
+ /** One rebuild for however many attributes are changed in the same task. */
4019
+ scheduleReinitialize() {
4020
+ this.reinitializeQueued || (this.reinitializeQueued = !0, queueMicrotask(() => {
4021
+ this.reinitializeQueued = !1, this.isConnected && (this.destroy(), this.waitForPluginLoader().then(() => {
4022
+ this.initialize().catch((t) => {
4023
+ console.error("[RichTextEditor] Error during attribute change re-initialization:", t);
4024
+ });
4025
+ }));
4026
+ }));
4027
+ }
3959
4028
  /**
3960
4029
  * Resolve configuration from all sources
3961
4030
  */
@@ -3965,7 +4034,7 @@ class q extends Ei {
3965
4034
  const o = this.attributes[e];
3966
4035
  t[o.name] = o.value;
3967
4036
  }
3968
- return xe.resolve({
4037
+ return Ae.resolve({
3969
4038
  jsConfig: this.jsConfig,
3970
4039
  attributes: t
3971
4040
  });
@@ -3975,7 +4044,7 @@ class q extends Ei {
3975
4044
  */
3976
4045
  getAPI() {
3977
4046
  return {
3978
- getContent: () => _t(this.contentElement),
4047
+ getContent: () => yt(this.contentElement),
3979
4048
  setContent: (t) => {
3980
4049
  this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
3981
4050
  },
@@ -4003,11 +4072,11 @@ class q extends Ei {
4003
4072
  */
4004
4073
  destroy() {
4005
4074
  var t, e, o, i;
4006
- this.buildGeneration += 1, this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent = _t(this.contentElement), this.persistAutosave(this.preservedContent)), this.stopAutosave(), this.selectionChangeHandler && (document.removeEventListener("selectionchange", this.selectionChangeHandler), this.selectionChangeHandler = void 0), (t = this.engine) == null || t.destroy(), (e = this.toolbar) == null || e.destroy(), (o = this.floatingToolbar) == null || o.destroy(), (i = this.statusBar) == null || i.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.isInitialized = !1, Ae.delete(this), tt === this && (tt = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
4075
+ this.buildGeneration += 1, this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent = yt(this.contentElement), this.persistAutosave(this.preservedContent)), this.stopAutosave(), this.selectionChangeHandler && (document.removeEventListener("selectionchange", this.selectionChangeHandler), this.selectionChangeHandler = void 0), (t = this.engine) == null || t.destroy(), (e = this.toolbar) == null || e.destroy(), (o = this.floatingToolbar) == null || o.destroy(), (i = this.statusBar) == null || i.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.lastReportedContent = null, this.isInitialized = !1, Ce.delete(this), tt === this && (tt = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
4007
4076
  }
4008
4077
  // Public API methods
4009
4078
  getContent() {
4010
- return _t(this.contentElement);
4079
+ return yt(this.contentElement);
4011
4080
  }
4012
4081
  setContent(t) {
4013
4082
  this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
@@ -4024,9 +4093,9 @@ class q extends Ei {
4024
4093
  (t = this.contentElement) == null || t.blur();
4025
4094
  }
4026
4095
  }
4027
- const Ce = new Co();
4028
- q.__globalPluginLoader = Ce;
4029
- const vi = {
4096
+ const Se = new _o();
4097
+ Y.__globalPluginLoader = Se;
4098
+ const ki = {
4030
4099
  // Core editing plugins (always loaded)
4031
4100
  bold: () => import("./BoldPlugin.native-CSh_LiIJ.mjs").then((a) => a.BoldPlugin()),
4032
4101
  italic: () => import("./ItalicPlugin.native-CmnlwFHB.mjs").then((a) => a.ItalicPlugin()),
@@ -4039,22 +4108,22 @@ const vi = {
4039
4108
  list: () => import("./ListPlugin.native-UYaoRiub.mjs").then((a) => a.ListPlugin()),
4040
4109
  history: () => import("./HistoryPlugin.native-C8GyxsgC.mjs").then((a) => a.HistoryPlugin())
4041
4110
  };
4042
- async function wi() {
4043
- return Object.entries(vi).forEach(([a, t]) => {
4044
- Ce.register(a, t);
4045
- }), Ce;
4111
+ async function xi() {
4112
+ return Object.entries(ki).forEach(([a, t]) => {
4113
+ Se.register(a, t);
4114
+ }), Se;
4046
4115
  }
4047
- typeof window != "undefined" && wi().then((a) => {
4048
- q.__globalPluginLoader = a, customElements.get("editora-editor") || customElements.define("editora-editor", q);
4116
+ typeof window != "undefined" && xi().then((a) => {
4117
+ Y.__globalPluginLoader = a, customElements.get("editora-editor") || customElements.define("editora-editor", Y);
4049
4118
  const t = document.querySelectorAll("editora-editor:not([data-initial-content])"), e = [];
4050
4119
  t.forEach((o) => {
4051
4120
  const i = o.innerHTML.trim();
4052
4121
  i && (e.push(i), o.setAttribute("data-initial-content", i), o.innerHTML = "");
4053
4122
  }), t.forEach((o, i) => {
4054
- o instanceof q && !o.isInitialized && e[i] && o.setAttribute("content", e[i]);
4123
+ o instanceof Y && !o.isInitialized && e[i] && o.setAttribute("content", e[i]);
4055
4124
  });
4056
4125
  });
4057
4126
  export {
4058
- wi as initWebComponent
4127
+ xi as initWebComponent
4059
4128
  };
4060
4129
  //# sourceMappingURL=webcomponent-core.js.map