@editora/core 1.0.28 → 1.0.30

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,13 +1,13 @@
1
- class Kt {
1
+ class qt {
2
2
  constructor(t, e, o) {
3
3
  this.doc = t, this.selection = e, this.schema = o;
4
4
  }
5
5
  static create(t, e) {
6
6
  const o = e || t.node("doc", {}, [t.node("paragraph")]);
7
- return new Kt(o, { anchor: 0, head: 0 }, t);
7
+ return new qt(o, { anchor: 0, head: 0 }, t);
8
8
  }
9
9
  apply(t, e) {
10
- return new Kt(t, e || this.selection, this.schema);
10
+ return new qt(t, e || this.selection, this.schema);
11
11
  }
12
12
  }
13
13
  class ln {
@@ -112,7 +112,7 @@ class Ao {
112
112
  await Promise.all(t), this.plugins = [], this.pluginConfigs.clear();
113
113
  }
114
114
  }
115
- function bi() {
115
+ function yi() {
116
116
  return new Ao();
117
117
  }
118
118
  class cn {
@@ -497,7 +497,7 @@ class un {
497
497
  constructor(t = {}) {
498
498
  this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new Ao(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((o) => this.pluginManager.register(o));
499
499
  const e = this.pluginManager.buildSchema();
500
- this.state = Kt.create(e), this.commandRegistry = new dn(this.pluginManager.getCommands());
500
+ this.state = qt.create(e), this.commandRegistry = new dn(this.pluginManager.getCommands());
501
501
  }
502
502
  /**
503
503
  * Execute a command
@@ -671,58 +671,58 @@ class pn {
671
671
  codeBlock: "insertCodeBlock"
672
672
  };
673
673
  return o.forEach((c) => {
674
- const f = [];
674
+ const p = [];
675
675
  c.split(/\s+/).filter(Boolean).forEach((g) => {
676
676
  if (g === "direction") {
677
- const w = r.get("setDirectionLTR"), v = r.get("setDirectionRTL");
678
- w && f.push({
677
+ const E = r.get("setDirectionLTR"), k = r.get("setDirectionRTL");
678
+ E && p.push({
679
679
  id: "directionLTR",
680
- label: w.label,
681
- command: w.command,
682
- icon: w.icon,
683
- type: w.type || "button",
684
- options: w.options
685
- }), v && f.push({
680
+ label: E.label,
681
+ command: E.command,
682
+ icon: E.icon,
683
+ type: E.type || "button",
684
+ options: E.options
685
+ }), k && p.push({
686
686
  id: "directionRTL",
687
- label: v.label,
688
- command: v.command,
689
- icon: v.icon,
690
- type: v.type || "button",
691
- options: v.options
687
+ label: k.label,
688
+ command: k.command,
689
+ icon: k.icon,
690
+ type: k.type || "button",
691
+ options: k.options
692
692
  });
693
693
  return;
694
694
  }
695
695
  if (g === "comments") {
696
- const w = r.get("addComment"), v = r.get("toggleComments");
697
- w && f.push({
696
+ const E = r.get("addComment"), k = r.get("toggleComments");
697
+ E && p.push({
698
698
  id: "addComment",
699
- label: w.label,
700
- command: w.command,
701
- icon: w.icon,
702
- type: w.type || "button",
703
- options: w.options
704
- }), v && f.push({
699
+ label: E.label,
700
+ command: E.command,
701
+ icon: E.icon,
702
+ type: E.type || "button",
703
+ options: E.options
704
+ }), k && p.push({
705
705
  id: "toggleComments",
706
- label: v.label,
707
- command: v.command,
708
- icon: v.icon,
709
- type: v.type || "button",
710
- options: v.options
706
+ label: k.label,
707
+ command: k.command,
708
+ icon: k.icon,
709
+ type: k.type || "button",
710
+ options: k.options
711
711
  });
712
712
  return;
713
713
  }
714
- const T = l[g] || g;
715
- let k = r.get(T);
716
- k || (k = r.get(g)), k && f.push({
714
+ const w = l[g] || g;
715
+ let T = r.get(w);
716
+ T || (T = r.get(g)), T && p.push({
717
717
  id: g,
718
- label: k.label,
719
- command: k.command,
720
- icon: k.icon,
721
- type: k.type === "separator" ? "separator" : k.type || "button",
722
- options: k.options,
723
- items: k.items
718
+ label: T.label,
719
+ command: T.command,
720
+ icon: T.icon,
721
+ type: T.type === "separator" ? "separator" : T.type || "button",
722
+ options: T.options,
723
+ items: T.items
724
724
  });
725
- }), f.length > 0 && e.push(f);
725
+ }), p.length > 0 && e.push(p);
726
726
  }), e;
727
727
  }
728
728
  /**
@@ -741,20 +741,21 @@ class pn {
741
741
  const o = this.config.items || this.getDefaultToolbarString(), i = this.parseToolbarString(o);
742
742
  i.forEach((r, l) => {
743
743
  const c = document.createElement("div");
744
- if (c.className = "editora-toolbar-group", r.forEach((f) => {
745
- this.appendToolbarButton(c, f);
744
+ if (c.className = "editora-toolbar-group", r.forEach((p) => {
745
+ this.appendToolbarButton(c, p);
746
746
  const m = c.lastElementChild;
747
747
  m instanceof HTMLElement && (this.overflowUnits.push(m), this.overflowUnitHomes.set(m, c));
748
748
  }), e.appendChild(c), l < i.length - 1) {
749
- const f = document.createElement("div");
750
- f.className = "editora-toolbar-separator", e.appendChild(f);
749
+ const p = document.createElement("div");
750
+ p.className = "editora-toolbar-separator", e.appendChild(p);
751
751
  }
752
752
  }), t.appendChild(e), this.setupOverflow(t);
753
753
  }
754
754
  /** Measures top-level items in `itemsContainer` and moves whatever doesn't
755
755
  * fit into a collapsible "more options" row, re-measuring on resize. */
756
756
  setupOverflow(t) {
757
- if (!this.itemsContainer || typeof ResizeObserver == "undefined") return;
757
+ const e = this.itemsContainer;
758
+ if (!e || typeof ResizeObserver == "undefined") return;
758
759
  const o = document.createElement("button");
759
760
  o.type = "button", o.className = "editora-toolbar-more-button", o.title = "Show more options", o.setAttribute("aria-label", "More toolbar options"), o.textContent = "☰", o.style.display = "none", o.addEventListener("click", (c) => {
760
761
  c.preventDefault(), this.setExpandedOpen(!this.expandedOpen);
@@ -764,23 +765,25 @@ class pn {
764
765
  const r = () => {
765
766
  const c = this.overflowUnits;
766
767
  if (c.length === 0) return;
767
- c.forEach((O) => {
768
- var N;
769
- O.parentElement === i && ((N = this.overflowUnitHomes.get(O)) == null || N.appendChild(O));
768
+ c.forEach((B) => {
769
+ var D;
770
+ B.parentElement === i && ((D = this.overflowUnitHomes.get(B)) == null || D.appendChild(B));
770
771
  });
771
- const f = t.clientWidth, m = 16, g = 40, T = 4, k = Math.max(0, f - m - g - T);
772
- let w = 0, v = 0;
773
- for (const O of c) {
774
- const N = O.getBoundingClientRect().width + T;
775
- if (w + N <= k)
776
- w += N, v++;
777
- else
778
- break;
779
- }
780
- v = Math.max(1, Math.min(v, c.length));
781
- const K = v < c.length;
782
- o.style.display = K ? "" : "none", o.classList.toggle("active", K && this.expandedOpen), !K && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((O, N) => {
783
- N >= v && i.appendChild(O);
772
+ const p = t.clientWidth, m = 16, g = 40, w = 4, T = Math.max(0, p - m), E = Math.max(0, T - g - w), k = getComputedStyle(t).direction === "rtl", tt = e.getBoundingClientRect(), $ = (B) => {
773
+ const D = B.getBoundingClientRect();
774
+ return k ? tt.right - D.left : D.right - tt.left;
775
+ };
776
+ let z = 0;
777
+ if ($(c[c.length - 1]) <= T)
778
+ z = c.length;
779
+ else
780
+ for (const B of c)
781
+ if ($(B) <= E) z++;
782
+ else break;
783
+ z = Math.max(1, Math.min(z, c.length));
784
+ const at = z < c.length;
785
+ o.style.display = at ? "" : "none", o.classList.toggle("active", at && this.expandedOpen), !at && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((B, D) => {
786
+ D >= z && i.appendChild(B);
784
787
  });
785
788
  }, l = () => {
786
789
  this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), this.overflowRafId = requestAnimationFrame(r);
@@ -875,33 +878,33 @@ class pn {
875
878
  e.setAttribute("aria-expanded", l() ? "true" : "false");
876
879
  });
877
880
  c.observe(o, { attributes: !0, attributeFilter: ["style"] });
878
- const f = t._cleanupDropdown;
881
+ const p = t._cleanupDropdown;
879
882
  t._cleanupDropdown = () => {
880
- c.disconnect(), f == null || f();
883
+ c.disconnect(), p == null || p();
881
884
  }, e.addEventListener("click", (m) => {
882
885
  var g;
883
886
  m.detail === 0 && l() && ((g = r()[0]) == null || g.focus());
884
887
  }), e.addEventListener("keydown", (m) => {
885
- var T;
888
+ var w;
886
889
  if (m.key !== "ArrowDown" && m.key !== "ArrowUp") return;
887
890
  m.preventDefault(), l() || e.click();
888
891
  const g = r();
889
- (T = m.key === "ArrowUp" ? g[g.length - 1] : g[0]) == null || T.focus();
892
+ (w = m.key === "ArrowUp" ? g[g.length - 1] : g[0]) == null || w.focus();
890
893
  }), o.addEventListener("keydown", (m) => {
891
894
  const g = r();
892
895
  if (g.length === 0) return;
893
- const T = g.indexOf(document.activeElement), k = (w) => {
894
- m.preventDefault(), g[(w + g.length) % g.length].focus();
896
+ const w = g.indexOf(document.activeElement), T = (E) => {
897
+ m.preventDefault(), g[(E + g.length) % g.length].focus();
895
898
  };
896
899
  switch (m.key) {
897
900
  case "ArrowDown":
898
- return k(T + 1);
901
+ return T(w + 1);
899
902
  case "ArrowUp":
900
- return k(T < 0 ? g.length - 1 : T - 1);
903
+ return T(w < 0 ? g.length - 1 : w - 1);
901
904
  case "Home":
902
- return k(0);
905
+ return T(0);
903
906
  case "End":
904
- return k(g.length - 1);
907
+ return T(g.length - 1);
905
908
  case "Escape":
906
909
  m.preventDefault(), m.stopPropagation(), o.style.display = "none", e.focus();
907
910
  return;
@@ -921,14 +924,14 @@ class pn {
921
924
  o.className = "editora-toolbar-button editora-toolbar-dropdown-trigger", o.type = "button", o.textContent = t.label;
922
925
  const i = document.createElement("div");
923
926
  i.className = "editora-toolbar-dropdown-menu", i.style.display = "none", t.options && t.options.forEach((c) => {
924
- const f = document.createElement("button");
925
- f.className = "editora-toolbar-dropdown-item", f.type = "button", f.textContent = c.label, f.setAttribute("data-value", c.value), f.addEventListener("click", (m) => {
927
+ const p = document.createElement("button");
928
+ p.className = "editora-toolbar-dropdown-item", p.type = "button", p.textContent = c.label, p.setAttribute("data-value", c.value), p.addEventListener("click", (m) => {
926
929
  m.preventDefault(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), i.style.display = "none";
927
- }), i.appendChild(f);
930
+ }), i.appendChild(p);
928
931
  }), o.addEventListener("click", (c) => {
929
932
  c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
930
- const f = i.style.display === "block";
931
- i.style.display = f ? "none" : "block";
933
+ const p = i.style.display === "block";
934
+ i.style.display = p ? "none" : "block";
932
935
  });
933
936
  const r = (c) => {
934
937
  e.contains(c.target) || (i.style.display = "none");
@@ -956,17 +959,17 @@ class pn {
956
959
  o.textContent = t.label;
957
960
  const i = document.createElement("div");
958
961
  i.className = "editora-toolbar-dropdown-menu", i.style.display = "none", t.options && t.options.forEach((c) => {
959
- const f = document.createElement("button");
960
- f.className = "editora-toolbar-dropdown-item", f.type = "button", f.textContent = c.label, f.setAttribute("data-value", c.value), f.addEventListener("click", (m) => {
962
+ const p = document.createElement("button");
963
+ p.className = "editora-toolbar-dropdown-item", p.type = "button", p.textContent = c.label, p.setAttribute("data-value", c.value), p.addEventListener("click", (m) => {
961
964
  m.preventDefault(), m.stopPropagation(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), i.style.display = "none";
962
- }), i.appendChild(f);
965
+ }), i.appendChild(p);
963
966
  }), o.addEventListener("click", (c) => {
964
967
  var m;
965
968
  c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
966
- const f = (m = this.container) == null ? void 0 : m.querySelectorAll(
969
+ const p = (m = this.container) == null ? void 0 : m.querySelectorAll(
967
970
  ".editora-toolbar-dropdown-menu"
968
971
  );
969
- f == null || f.forEach((g) => {
972
+ p == null || p.forEach((g) => {
970
973
  g !== i && (g.style.display = "none");
971
974
  }), i.style.display = i.style.display === "none" ? "block" : "none";
972
975
  });
@@ -1090,14 +1093,14 @@ class hn {
1090
1093
  }), o.forEach((r, l) => {
1091
1094
  const c = document.createElement("span");
1092
1095
  if (c.className = "editora-statusbar-item", c.textContent = r, t.appendChild(c), l < o.length - 1) {
1093
- const f = document.createElement("span");
1094
- f.className = "editora-statusbar-separator", f.textContent = "|", t.appendChild(f);
1096
+ const p = document.createElement("span");
1097
+ p.className = "editora-statusbar-separator", p.textContent = "|", t.appendChild(p);
1095
1098
  }
1096
1099
  }), i.forEach((r, l) => {
1097
1100
  const c = document.createElement("span");
1098
1101
  if (c.className = "editora-statusbar-item", c.textContent = r, e.appendChild(c), l < i.length - 1) {
1099
- const f = document.createElement("span");
1100
- f.className = "editora-statusbar-separator", f.textContent = "|", e.appendChild(f);
1102
+ const p = document.createElement("span");
1103
+ p.className = "editora-statusbar-separator", p.textContent = "|", e.appendChild(p);
1101
1104
  }
1102
1105
  }), this.container.appendChild(t), this.container.appendChild(e);
1103
1106
  }
@@ -1150,7 +1153,7 @@ function yn(s) {
1150
1153
  const t = s.trim() ? s.trim().split(/\s+/).length : 0, e = s.length;
1151
1154
  return { words: t, chars: e };
1152
1155
  }
1153
- function En(s, t) {
1156
+ function vn(s, t) {
1154
1157
  const e = s.toString();
1155
1158
  return {
1156
1159
  startLine: t.line,
@@ -1167,20 +1170,20 @@ function io(s, t) {
1167
1170
  for (var e = 0, o = Array(t); e < t; e++) o[e] = s[e];
1168
1171
  return o;
1169
1172
  }
1170
- function vn(s) {
1173
+ function En(s) {
1171
1174
  if (Array.isArray(s)) return s;
1172
1175
  }
1173
1176
  function wn(s, t) {
1174
1177
  var e = s == null ? null : typeof Symbol != "undefined" && s[Symbol.iterator] || s["@@iterator"];
1175
1178
  if (e != null) {
1176
- var o, i, r, l, c = [], f = !0, m = !1;
1179
+ var o, i, r, l, c = [], p = !0, m = !1;
1177
1180
  try {
1178
- if (r = (e = e.call(s)).next, t !== 0) for (; !(f = (o = r.call(e)).done) && (c.push(o.value), c.length !== t); f = !0) ;
1181
+ if (r = (e = e.call(s)).next, t !== 0) for (; !(p = (o = r.call(e)).done) && (c.push(o.value), c.length !== t); p = !0) ;
1179
1182
  } catch (g) {
1180
1183
  m = !0, i = g;
1181
1184
  } finally {
1182
1185
  try {
1183
- if (!f && e.return != null && (l = e.return(), Object(l) !== l)) return;
1186
+ if (!p && e.return != null && (l = e.return(), Object(l) !== l)) return;
1184
1187
  } finally {
1185
1188
  if (m) throw i;
1186
1189
  }
@@ -1193,7 +1196,7 @@ function Tn() {
1193
1196
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1194
1197
  }
1195
1198
  function kn(s, t) {
1196
- return vn(s) || wn(s, t) || xn(s, t) || Tn();
1199
+ return En(s) || wn(s, t) || xn(s, t) || Tn();
1197
1200
  }
1198
1201
  function xn(s, t) {
1199
1202
  if (s) {
@@ -1203,38 +1206,38 @@ function xn(s, t) {
1203
1206
  }
1204
1207
  }
1205
1208
  const Co = Object.entries, ro = Object.setPrototypeOf, An = Object.isFrozen, Cn = Object.getPrototypeOf, Sn = Object.getOwnPropertyDescriptor;
1206
- let M = Object.freeze, I = Object.seal, mt = Object.create, So = typeof Reflect != "undefined" && Reflect, we = So.apply, Te = So.construct;
1209
+ let M = Object.freeze, I = Object.seal, bt = Object.create, So = typeof Reflect != "undefined" && Reflect, Te = So.apply, ke = So.construct;
1207
1210
  M || (M = function(t) {
1208
1211
  return t;
1209
1212
  });
1210
1213
  I || (I = function(t) {
1211
1214
  return t;
1212
1215
  });
1213
- we || (we = function(t, e) {
1216
+ Te || (Te = function(t, e) {
1214
1217
  for (var o = arguments.length, i = new Array(o > 2 ? o - 2 : 0), r = 2; r < o; r++) i[r - 2] = arguments[r];
1215
1218
  return t.apply(e, i);
1216
1219
  });
1217
- Te || (Te = function(t) {
1220
+ ke || (ke = function(t) {
1218
1221
  for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
1219
1222
  return new t(...o);
1220
1223
  });
1221
- const it = L(Array.prototype.forEach), _n = L(Array.prototype.lastIndexOf), ao = L(Array.prototype.pop), kt = L(Array.prototype.push), Ln = L(Array.prototype.splice), bt = Array.isArray, _t = L(String.prototype.toLowerCase), fe = L(String.prototype.toString), so = L(String.prototype.match), xt = L(String.prototype.replace), lo = L(String.prototype.indexOf), Mn = L(String.prototype.trim), In = L(Number.prototype.toString), Dn = L(Boolean.prototype.toString), co = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), uo = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), z = L(Object.prototype.hasOwnProperty), At = L(Object.prototype.toString), D = L(RegExp.prototype.test), X = On(TypeError);
1224
+ const rt = L(Array.prototype.forEach), _n = L(Array.prototype.lastIndexOf), ao = L(Array.prototype.pop), At = L(Array.prototype.push), Ln = L(Array.prototype.splice), vt = Array.isArray, Mt = L(String.prototype.toLowerCase), he = L(String.prototype.toString), so = L(String.prototype.match), Ct = L(String.prototype.replace), lo = L(String.prototype.indexOf), Mn = L(String.prototype.trim), In = L(Number.prototype.toString), On = L(Boolean.prototype.toString), co = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), uo = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), P = L(Object.prototype.hasOwnProperty), St = L(Object.prototype.toString), O = L(RegExp.prototype.test), Z = Dn(TypeError);
1222
1225
  function L(s) {
1223
1226
  return function(t) {
1224
1227
  t instanceof RegExp && (t.lastIndex = 0);
1225
1228
  for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
1226
- return we(s, t, o);
1229
+ return Te(s, t, o);
1227
1230
  };
1228
1231
  }
1229
- function On(s) {
1232
+ function Dn(s) {
1230
1233
  return function() {
1231
1234
  for (var t = arguments.length, e = new Array(t), o = 0; o < t; o++) e[o] = arguments[o];
1232
- return Te(s, e);
1235
+ return ke(s, e);
1233
1236
  };
1234
1237
  }
1235
- function E(s, t) {
1236
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : _t;
1237
- if (ro && ro(s, null), !bt(t)) return s;
1238
+ function v(s, t) {
1239
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Mt;
1240
+ if (ro && ro(s, null), !vt(t)) return s;
1238
1241
  let o = t.length;
1239
1242
  for (; o--; ) {
1240
1243
  let i = t[o];
@@ -1247,15 +1250,15 @@ function E(s, t) {
1247
1250
  return s;
1248
1251
  }
1249
1252
  function Rn(s) {
1250
- for (let t = 0; t < s.length; t++) z(s, t) || (s[t] = null);
1253
+ for (let t = 0; t < s.length; t++) P(s, t) || (s[t] = null);
1251
1254
  return s;
1252
1255
  }
1253
- function F(s) {
1254
- const t = mt(null);
1256
+ function U(s) {
1257
+ const t = bt(null);
1255
1258
  for (const o of Co(s)) {
1256
1259
  var e = kn(o, 2);
1257
1260
  const i = e[0], r = e[1];
1258
- z(s, i) && (bt(r) ? t[i] = Rn(r) : r && typeof r == "object" && r.constructor === Object ? t[i] = F(r) : t[i] = r);
1261
+ P(s, i) && (vt(r) ? t[i] = Rn(r) : r && typeof r == "object" && r.constructor === Object ? t[i] = U(r) : t[i] = r);
1259
1262
  }
1260
1263
  return t;
1261
1264
  }
@@ -1266,28 +1269,28 @@ function Nn(s) {
1266
1269
  case "number":
1267
1270
  return In(s);
1268
1271
  case "boolean":
1269
- return Dn(s);
1272
+ return On(s);
1270
1273
  case "bigint":
1271
1274
  return co ? co(s) : "0";
1272
1275
  case "symbol":
1273
1276
  return uo ? uo(s) : "Symbol()";
1274
1277
  case "undefined":
1275
- return At(s);
1278
+ return St(s);
1276
1279
  case "function":
1277
1280
  case "object": {
1278
- if (s === null) return At(s);
1279
- const t = s, e = j(t, "toString");
1281
+ if (s === null) return St(s);
1282
+ const t = s, e = W(t, "toString");
1280
1283
  if (typeof e == "function") {
1281
1284
  const o = e(t);
1282
- return typeof o == "string" ? o : At(o);
1285
+ return typeof o == "string" ? o : St(o);
1283
1286
  }
1284
- return At(s);
1287
+ return St(s);
1285
1288
  }
1286
1289
  default:
1287
- return At(s);
1290
+ return St(s);
1288
1291
  }
1289
1292
  }
1290
- function j(s, t) {
1293
+ function W(s, t) {
1291
1294
  for (; s !== null; ) {
1292
1295
  const o = Sn(s, t);
1293
1296
  if (o) {
@@ -1303,7 +1306,7 @@ function j(s, t) {
1303
1306
  }
1304
1307
  function Pn(s) {
1305
1308
  try {
1306
- return D(s, ""), !0;
1309
+ return O(s, ""), !0;
1307
1310
  } catch (t) {
1308
1311
  return !1;
1309
1312
  }
@@ -1428,7 +1431,7 @@ const po = M([
1428
1431
  "var",
1429
1432
  "video",
1430
1433
  "wbr"
1431
- ]), he = M([
1434
+ ]), me = M([
1432
1435
  "svg",
1433
1436
  "a",
1434
1437
  "altglyph",
@@ -1476,7 +1479,7 @@ const po = M([
1476
1479
  "tspan",
1477
1480
  "view",
1478
1481
  "vkern"
1479
- ]), me = M([
1482
+ ]), ge = M([
1480
1483
  "feBlend",
1481
1484
  "feColorMatrix",
1482
1485
  "feComponentTransfer",
@@ -1525,7 +1528,7 @@ const po = M([
1525
1528
  "solidcolor",
1526
1529
  "unknown",
1527
1530
  "use"
1528
- ]), ge = M([
1531
+ ]), be = M([
1529
1532
  "math",
1530
1533
  "menclose",
1531
1534
  "merror",
@@ -1556,7 +1559,7 @@ const po = M([
1556
1559
  "munder",
1557
1560
  "munderover",
1558
1561
  "mprescripts"
1559
- ]), Hn = M([
1562
+ ]), Bn = M([
1560
1563
  "maction",
1561
1564
  "maligngroup",
1562
1565
  "malignmark",
@@ -1691,7 +1694,7 @@ const po = M([
1691
1694
  "width",
1692
1695
  "wrap",
1693
1696
  "xmlns"
1694
- ]), be = M([
1697
+ ]), ye = M([
1695
1698
  "accent-height",
1696
1699
  "accumulate",
1697
1700
  "additive",
@@ -1939,13 +1942,13 @@ const po = M([
1939
1942
  "voffset",
1940
1943
  "width",
1941
1944
  "xmlns"
1942
- ]), Wt = M([
1945
+ ]), Gt = M([
1943
1946
  "xlink:href",
1944
1947
  "xml:id",
1945
1948
  "xlink:title",
1946
1949
  "xml:space",
1947
1950
  "xmlns:xlink"
1948
- ]), Bn = I(/{{[\w\W]*|^[\w\W]*}}/g), Fn = I(/<%[\w\W]*|^[\w\W]*%>/g), Un = I(/\${[\w\W]*/g), jn = I(/^data-[\-\w.\u00B7-\uFFFF]+$/), Wn = I(/^aria-[\-\w]+$/), go = I(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), $n = I(/^(?:\w+script|data):/i), Gn = I(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Kn = I(/^html$/i), Yn = I(/^[a-z][.\w]*(-[.\w]+)+$/i), bo = I(/<[/\w!]/g), yo = I(/<[/\w]/g), qn = I(/<\/no(script|embed|frames)/i), Vn = I(/\/>/i), B = {
1951
+ ]), Hn = I(/{{[\w\W]*|^[\w\W]*}}/g), Fn = I(/<%[\w\W]*|^[\w\W]*%>/g), Un = I(/\${[\w\W]*/g), jn = I(/^data-[\-\w.\u00B7-\uFFFF]+$/), Wn = I(/^aria-[\-\w]+$/), go = I(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), $n = I(/^(?:\w+script|data):/i), Gn = I(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Kn = I(/^html$/i), Yn = I(/^[a-z][.\w]*(-[.\w]+)+$/i), bo = I(/<[/\w!]/g), yo = I(/<[/\w]/g), qn = I(/<\/no(script|embed|frames)/i), Vn = I(/\/>/i), F = {
1949
1952
  element: 1,
1950
1953
  attribute: 2,
1951
1954
  text: 3,
@@ -1967,9 +1970,9 @@ const po = M([
1967
1970
  "noframes",
1968
1971
  "plaintext",
1969
1972
  "noscript"
1970
- ], Xn = M(E({}, _o)), Zn = (function() {
1973
+ ], Xn = M(v({}, _o)), Zn = (function() {
1971
1974
  const s = {};
1972
- return it(_o, (t) => {
1975
+ return rt(_o, (t) => {
1973
1976
  s[t] = I(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
1974
1977
  }), M(s);
1975
1978
  })(), Jn = function() {
@@ -1992,7 +1995,7 @@ const po = M([
1992
1995
  } catch (l) {
1993
1996
  return console.warn("TrustedTypes policy " + r + " could not be created."), null;
1994
1997
  }
1995
- }, Eo = function() {
1998
+ }, vo = function() {
1996
1999
  return {
1997
2000
  afterSanitizeAttributes: [],
1998
2001
  afterSanitizeElements: [],
@@ -2004,70 +2007,70 @@ const po = M([
2004
2007
  uponSanitizeElement: [],
2005
2008
  uponSanitizeShadowNode: []
2006
2009
  };
2007
- }, Z = function(t, e, o, i) {
2008
- return z(t, e) && bt(t[e]) ? E(i.base ? F(i.base) : {}, t[e], i.transform) : o;
2009
- }, ye = function(t, e, o) {
2010
- const i = z(t, e) ? t[e] : void 0;
2011
- return i && typeof i == "object" ? F(i) : o();
2010
+ }, J = function(t, e, o, i) {
2011
+ return P(t, e) && vt(t[e]) ? v(i.base ? U(i.base) : {}, t[e], i.transform) : o;
2012
+ }, ve = function(t, e, o) {
2013
+ const i = P(t, e) ? t[e] : void 0;
2014
+ return i && typeof i == "object" ? U(i) : o();
2012
2015
  };
2013
2016
  function Lo() {
2014
2017
  let s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Jn();
2015
2018
  const t = (u) => Lo(u);
2016
- if (t.version = "3.4.16", t.removed = [], !s || !s.document || s.document.nodeType !== B.document || !s.Element)
2019
+ if (t.version = "3.4.16", t.removed = [], !s || !s.document || s.document.nodeType !== F.document || !s.Element)
2017
2020
  return t.isSupported = !1, t;
2018
2021
  let e = s.document;
2019
2022
  const o = e, i = o.currentScript;
2020
2023
  s.DocumentFragment;
2021
- const r = s.HTMLTemplateElement, l = s.Node, c = s.Element, f = s.NodeFilter;
2024
+ const r = s.HTMLTemplateElement, l = s.Node, c = s.Element, p = s.NodeFilter;
2022
2025
  s.NamedNodeMap === void 0 && (s.NamedNodeMap || s.MozNamedAttrMap), s.HTMLFormElement;
2023
- const m = s.DOMParser, g = s.trustedTypes, T = c.prototype, k = j(T, "cloneNode"), w = j(T, "remove"), v = j(T, "removeAttributeNode"), K = j(T, "nextSibling"), O = j(T, "childNodes"), N = j(T, "parentNode"), Ae = j(T, "shadowRoot"), qt = j(T, "attributes"), Q = l && l.prototype ? j(l.prototype, "nodeType") : null, rt = l && l.prototype ? j(l.prototype, "nodeName") : null, Lt = l && l.prototype ? j(l.prototype, "ownerDocument") : null, yt = function(n) {
2024
- return Q ? Q(n) : n.nodeType;
2025
- }, Vt = function(n) {
2026
- return rt ? rt(n) : n.nodeName;
2026
+ const m = s.DOMParser, g = s.trustedTypes, w = c.prototype, T = W(w, "cloneNode"), E = W(w, "remove"), k = W(w, "removeAttributeNode"), tt = W(w, "nextSibling"), $ = W(w, "childNodes"), z = W(w, "parentNode"), at = W(w, "shadowRoot"), B = W(w, "attributes"), D = l && l.prototype ? W(l.prototype, "nodeType") : null, st = l && l.prototype ? W(l.prototype, "nodeName") : null, It = l && l.prototype ? W(l.prototype, "ownerDocument") : null, Et = function(n) {
2027
+ return D ? D(n) : n.nodeType;
2028
+ }, Xt = function(n) {
2029
+ return st ? st(n) : n.nodeName;
2027
2030
  };
2028
2031
  if (typeof r == "function") {
2029
2032
  const u = e.createElement("template");
2030
2033
  u.content && u.content.ownerDocument && (e = u.content.ownerDocument);
2031
2034
  }
2032
- let P, tt = "", Xt, Ce = !1, Et = 0;
2035
+ let N, et = "", Zt, Ce = !1, wt = 0;
2033
2036
  const Se = function() {
2034
- if (Et > 0) throw X('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.');
2035
- }, at = function(n) {
2036
- Se(), Et++;
2037
+ if (wt > 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.');
2038
+ }, lt = function(n) {
2039
+ Se(), wt++;
2037
2040
  try {
2038
- return P.createHTML(n);
2041
+ return N.createHTML(n);
2039
2042
  } finally {
2040
- Et--;
2043
+ wt--;
2041
2044
  }
2042
- }, Oo = function(n) {
2043
- Se(), Et++;
2045
+ }, Do = function(n) {
2046
+ Se(), wt++;
2044
2047
  try {
2045
- return P.createScriptURL(n);
2048
+ return N.createScriptURL(n);
2046
2049
  } finally {
2047
- Et--;
2050
+ wt--;
2048
2051
  }
2049
2052
  }, Ro = function() {
2050
- return Ce || (Xt = Qn(g, i), Ce = !0), Xt;
2051
- }, Mt = e, Zt = Mt.implementation, _e = Mt.createNodeIterator, No = Mt.createDocumentFragment, Po = Mt.getElementsByTagName, zo = o.importNode;
2052
- let x = Eo();
2053
- t.isSupported = typeof Co == "function" && typeof N == "function" && Zt && Zt.createHTMLDocument !== void 0;
2054
- const Ho = Bn, Bo = Fn, Fo = Un, Uo = jn, jo = Wn, Wo = $n, Le = Gn, $o = Yn;
2053
+ return Ce || (Zt = Qn(g, i), Ce = !0), Zt;
2054
+ }, Ot = e, Jt = Ot.implementation, _e = Ot.createNodeIterator, No = Ot.createDocumentFragment, Po = Ot.getElementsByTagName, zo = o.importNode;
2055
+ let x = vo();
2056
+ t.isSupported = typeof Co == "function" && typeof z == "function" && Jt && Jt.createHTMLDocument !== void 0;
2057
+ const Bo = Hn, Ho = Fn, Fo = Un, Uo = jn, jo = Wn, Wo = $n, Le = Gn, $o = Yn;
2055
2058
  let Me = go, A = null;
2056
- const Jt = E({}, [
2059
+ const Qt = v({}, [
2057
2060
  ...po,
2058
- ...he,
2059
2061
  ...me,
2060
2062
  ...ge,
2063
+ ...be,
2061
2064
  ...fo
2062
2065
  ]);
2063
2066
  let C = null;
2064
- const Qt = E({}, [
2067
+ const te = v({}, [
2065
2068
  ...ho,
2066
- ...be,
2069
+ ...ye,
2067
2070
  ...mo,
2068
- ...Wt
2071
+ ...Gt
2069
2072
  ]);
2070
- let W = Object.seal(mt(null, {
2073
+ let G = Object.seal(bt(null, {
2071
2074
  tagNameCheck: {
2072
2075
  writable: !0,
2073
2076
  configurable: !1,
@@ -2086,8 +2089,8 @@ function Lo() {
2086
2089
  enumerable: !0,
2087
2090
  value: !1
2088
2091
  }
2089
- })), vt = null, Ie = null;
2090
- const Y = Object.seal(mt(null, {
2092
+ })), Tt = null, Ie = null;
2093
+ const q = Object.seal(bt(null, {
2091
2094
  tagCheck: {
2092
2095
  writable: !0,
2093
2096
  configurable: !1,
@@ -2101,10 +2104,10 @@ function Lo() {
2101
2104
  value: null
2102
2105
  }
2103
2106
  }));
2104
- let De = !0, te = !0, Oe = !1, Re = !0, q = !1, et = !0, ot = !1, ee = !1, It = null, Dt = null, oe = !1, st = !1, Ot = !1, Rt = !1, Ne = !0, Pe = !1;
2107
+ let Oe = !0, ee = !0, De = !1, Re = !0, V = !1, ot = !0, nt = !1, oe = !1, Dt = null, Rt = null, ne = !1, ct = !1, Nt = !1, Pt = !1, Ne = !0, Pe = !1;
2105
2108
  const ze = "user-content-";
2106
- let ne = !0, ie = !1, lt = {}, ct = null;
2107
- const He = E({}, [
2109
+ let ie = !0, re = !1, dt = {}, ut = null;
2110
+ const Be = v({}, [
2108
2111
  "annotation-xml",
2109
2112
  "audio",
2110
2113
  "colgroup",
@@ -2132,8 +2135,8 @@ function Lo() {
2132
2135
  "video",
2133
2136
  "xmp"
2134
2137
  ]);
2135
- let Be = null;
2136
- const Fe = E({}, [
2138
+ let He = null;
2139
+ const Fe = v({}, [
2137
2140
  "audio",
2138
2141
  "video",
2139
2142
  "img",
@@ -2142,7 +2145,7 @@ function Lo() {
2142
2145
  "track"
2143
2146
  ]);
2144
2147
  let Ue = null;
2145
- const je = E({}, [
2148
+ const je = v({}, [
2146
2149
  "alt",
2147
2150
  "class",
2148
2151
  "for",
@@ -2157,294 +2160,294 @@ function Lo() {
2157
2160
  "value",
2158
2161
  "style",
2159
2162
  "xmlns"
2160
- ]), Nt = "http://www.w3.org/1998/Math/MathML", Pt = "http://www.w3.org/2000/svg", $ = "http://www.w3.org/1999/xhtml";
2161
- let dt = $, re = !1, ae = null;
2162
- const Go = E({}, [
2163
- Nt,
2164
- Pt,
2165
- $
2166
- ], fe), We = M([
2163
+ ]), zt = "http://www.w3.org/1998/Math/MathML", Bt = "http://www.w3.org/2000/svg", K = "http://www.w3.org/1999/xhtml";
2164
+ let pt = K, ae = !1, se = null;
2165
+ const Go = v({}, [
2166
+ zt,
2167
+ Bt,
2168
+ K
2169
+ ], he), We = M([
2167
2170
  "mi",
2168
2171
  "mo",
2169
2172
  "mn",
2170
2173
  "ms",
2171
2174
  "mtext"
2172
2175
  ]);
2173
- let se = E({}, We);
2176
+ let le = v({}, We);
2174
2177
  const $e = M(["annotation-xml"]);
2175
- let le = E({}, $e);
2176
- const Ko = E({}, [
2178
+ let ce = v({}, $e);
2179
+ const Ko = v({}, [
2177
2180
  "title",
2178
2181
  "style",
2179
2182
  "font",
2180
2183
  "a",
2181
2184
  "script"
2182
2185
  ]);
2183
- let wt = null;
2186
+ let kt = null;
2184
2187
  const Yo = ["application/xhtml+xml", "text/html"], qo = "text/html";
2185
- let _ = null, ut = null;
2188
+ let _ = null, ft = null;
2186
2189
  const Vo = e.createElement("form"), Ge = function(n) {
2187
2190
  return n instanceof RegExp || n instanceof Function;
2188
- }, ce = function() {
2191
+ }, de = function() {
2189
2192
  let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2190
- if (ut && ut === n) return;
2191
- (!n || typeof n != "object") && (n = {}), n = F(n), wt = Yo.indexOf(n.PARSER_MEDIA_TYPE) === -1 ? qo : n.PARSER_MEDIA_TYPE, _ = wt === "application/xhtml+xml" ? fe : _t, A = Z(n, "ALLOWED_TAGS", Jt, { transform: _ }), C = Z(n, "ALLOWED_ATTR", Qt, { transform: _ }), ae = Z(n, "ALLOWED_NAMESPACES", Go, { transform: fe }), Ue = Z(n, "ADD_URI_SAFE_ATTR", je, {
2193
+ if (ft && ft === n) return;
2194
+ (!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 = J(n, "ALLOWED_TAGS", Qt, { transform: _ }), C = J(n, "ALLOWED_ATTR", te, { transform: _ }), se = J(n, "ALLOWED_NAMESPACES", Go, { transform: he }), Ue = J(n, "ADD_URI_SAFE_ATTR", je, {
2192
2195
  transform: _,
2193
2196
  base: je
2194
- }), Be = Z(n, "ADD_DATA_URI_TAGS", Fe, {
2197
+ }), He = J(n, "ADD_DATA_URI_TAGS", Fe, {
2195
2198
  transform: _,
2196
2199
  base: Fe
2197
- }), ct = Z(n, "FORBID_CONTENTS", He, { transform: _ }), vt = Z(n, "FORBID_TAGS", F({}), { transform: _ }), Ie = Z(n, "FORBID_ATTR", F({}), { transform: _ }), lt = z(n, "USE_PROFILES") ? n.USE_PROFILES && typeof n.USE_PROFILES == "object" ? F(n.USE_PROFILES) : n.USE_PROFILES : !1, De = n.ALLOW_ARIA_ATTR !== !1, te = n.ALLOW_DATA_ATTR !== !1, Oe = n.ALLOW_UNKNOWN_PROTOCOLS || !1, Re = n.ALLOW_SELF_CLOSE_IN_ATTR !== !1, q = n.SAFE_FOR_TEMPLATES || !1, et = n.SAFE_FOR_XML !== !1, ot = n.WHOLE_DOCUMENT || !1, st = n.RETURN_DOM || !1, Ot = n.RETURN_DOM_FRAGMENT || !1, Rt = n.RETURN_TRUSTED_TYPE || !1, oe = n.FORCE_BODY || !1, Ne = n.SANITIZE_DOM !== !1, Pe = n.SANITIZE_NAMED_PROPS || !1, ne = n.KEEP_CONTENT !== !1, ie = n.IN_PLACE || !1, Me = Pn(n.ALLOWED_URI_REGEXP) ? n.ALLOWED_URI_REGEXP : go, dt = typeof n.NAMESPACE == "string" ? n.NAMESPACE : $, se = ye(n, "MATHML_TEXT_INTEGRATION_POINTS", () => E({}, We)), le = ye(n, "HTML_INTEGRATION_POINTS", () => E({}, $e));
2198
- const a = ye(n, "CUSTOM_ELEMENT_HANDLING", () => mt(null));
2199
- if (W = mt(null), z(a, "tagNameCheck") && Ge(a.tagNameCheck) && (W.tagNameCheck = a.tagNameCheck), z(a, "attributeNameCheck") && Ge(a.attributeNameCheck) && (W.attributeNameCheck = a.attributeNameCheck), z(a, "allowCustomizedBuiltInElements") && typeof a.allowCustomizedBuiltInElements == "boolean" && (W.allowCustomizedBuiltInElements = a.allowCustomizedBuiltInElements), I(W), q && (te = !1), Ot && (st = !0), lt && (A = E({}, fo), C = mt(null), lt.html === !0 && (E(A, po), E(C, ho)), lt.svg === !0 && (E(A, he), E(C, be), E(C, Wt)), lt.svgFilters === !0 && (E(A, me), E(C, be), E(C, Wt)), lt.mathMl === !0 && (E(A, ge), E(C, mo), E(C, Wt))), Y.tagCheck = null, Y.attributeCheck = null, z(n, "ADD_TAGS") && (typeof n.ADD_TAGS == "function" ? Y.tagCheck = n.ADD_TAGS : bt(n.ADD_TAGS) && (A === Jt && (A = F(A)), E(A, n.ADD_TAGS, _))), z(n, "ADD_ATTR") && (typeof n.ADD_ATTR == "function" ? Y.attributeCheck = n.ADD_ATTR : bt(n.ADD_ATTR) && (C === Qt && (C = F(C)), E(C, n.ADD_ATTR, _))), z(n, "ADD_FORBID_CONTENTS") && bt(n.ADD_FORBID_CONTENTS) && (ct === He && (ct = F(ct)), E(ct, n.ADD_FORBID_CONTENTS, _)), ne && (A["#text"] = !0), ot && E(A, [
2200
+ }), ut = J(n, "FORBID_CONTENTS", Be, { transform: _ }), Tt = J(n, "FORBID_TAGS", U({}), { transform: _ }), Ie = J(n, "FORBID_ATTR", U({}), { transform: _ }), dt = P(n, "USE_PROFILES") ? n.USE_PROFILES && typeof n.USE_PROFILES == "object" ? U(n.USE_PROFILES) : n.USE_PROFILES : !1, Oe = n.ALLOW_ARIA_ATTR !== !1, ee = n.ALLOW_DATA_ATTR !== !1, De = n.ALLOW_UNKNOWN_PROTOCOLS || !1, Re = n.ALLOW_SELF_CLOSE_IN_ATTR !== !1, V = n.SAFE_FOR_TEMPLATES || !1, ot = n.SAFE_FOR_XML !== !1, nt = n.WHOLE_DOCUMENT || !1, ct = n.RETURN_DOM || !1, Nt = n.RETURN_DOM_FRAGMENT || !1, Pt = n.RETURN_TRUSTED_TYPE || !1, ne = n.FORCE_BODY || !1, Ne = n.SANITIZE_DOM !== !1, Pe = n.SANITIZE_NAMED_PROPS || !1, ie = n.KEEP_CONTENT !== !1, re = n.IN_PLACE || !1, Me = Pn(n.ALLOWED_URI_REGEXP) ? n.ALLOWED_URI_REGEXP : go, pt = typeof n.NAMESPACE == "string" ? n.NAMESPACE : K, le = ve(n, "MATHML_TEXT_INTEGRATION_POINTS", () => v({}, We)), ce = ve(n, "HTML_INTEGRATION_POINTS", () => v({}, $e));
2201
+ const a = ve(n, "CUSTOM_ELEMENT_HANDLING", () => bt(null));
2202
+ if (G = bt(null), P(a, "tagNameCheck") && Ge(a.tagNameCheck) && (G.tagNameCheck = a.tagNameCheck), P(a, "attributeNameCheck") && Ge(a.attributeNameCheck) && (G.attributeNameCheck = a.attributeNameCheck), P(a, "allowCustomizedBuiltInElements") && typeof a.allowCustomizedBuiltInElements == "boolean" && (G.allowCustomizedBuiltInElements = a.allowCustomizedBuiltInElements), I(G), V && (ee = !1), Nt && (ct = !0), dt && (A = v({}, fo), C = bt(null), dt.html === !0 && (v(A, po), v(C, ho)), dt.svg === !0 && (v(A, me), v(C, ye), v(C, Gt)), dt.svgFilters === !0 && (v(A, ge), v(C, ye), v(C, Gt)), dt.mathMl === !0 && (v(A, be), v(C, mo), v(C, Gt))), q.tagCheck = null, q.attributeCheck = null, P(n, "ADD_TAGS") && (typeof n.ADD_TAGS == "function" ? q.tagCheck = n.ADD_TAGS : vt(n.ADD_TAGS) && (A === Qt && (A = U(A)), v(A, n.ADD_TAGS, _))), P(n, "ADD_ATTR") && (typeof n.ADD_ATTR == "function" ? q.attributeCheck = n.ADD_ATTR : vt(n.ADD_ATTR) && (C === te && (C = U(C)), v(C, n.ADD_ATTR, _))), P(n, "ADD_FORBID_CONTENTS") && vt(n.ADD_FORBID_CONTENTS) && (ut === Be && (ut = U(ut)), v(ut, n.ADD_FORBID_CONTENTS, _)), ie && (A["#text"] = !0), nt && v(A, [
2200
2203
  "html",
2201
2204
  "head",
2202
2205
  "body"
2203
- ]), A.table && (E(A, ["tbody"]), delete vt.tbody), n.TRUSTED_TYPES_POLICY) {
2204
- if (typeof n.TRUSTED_TYPES_POLICY.createHTML != "function") throw X('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
2205
- if (typeof n.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw X('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
2206
- const d = P;
2207
- P = n.TRUSTED_TYPES_POLICY;
2206
+ ]), A.table && (v(A, ["tbody"]), delete Tt.tbody), n.TRUSTED_TYPES_POLICY) {
2207
+ if (typeof n.TRUSTED_TYPES_POLICY.createHTML != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
2208
+ if (typeof n.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
2209
+ const d = N;
2210
+ N = n.TRUSTED_TYPES_POLICY;
2208
2211
  try {
2209
- tt = at("");
2210
- } catch (p) {
2211
- throw P = d, p;
2212
+ et = lt("");
2213
+ } catch (f) {
2214
+ throw N = d, f;
2212
2215
  }
2213
- } else n.TRUSTED_TYPES_POLICY === null ? (P = void 0, tt = "") : (P === void 0 && (P = Ro()), P && typeof tt == "string" && (tt = at("")));
2214
- M && M(n), ut = n;
2215
- }, Ke = E({}, [
2216
- ...he,
2216
+ } else n.TRUSTED_TYPES_POLICY === null ? (N = void 0, et = "") : (N === void 0 && (N = Ro()), N && typeof et == "string" && (et = lt("")));
2217
+ M && M(n), ft = n;
2218
+ }, Ke = v({}, [
2217
2219
  ...me,
2220
+ ...ge,
2218
2221
  ...zn
2219
- ]), Ye = E({}, [...ge, ...Hn]), Xo = function(n, a, d) {
2220
- return a.namespaceURI === $ ? n === "svg" : a.namespaceURI === Nt ? n === "svg" && (d === "annotation-xml" || se[d]) : !!Ke[n];
2222
+ ]), Ye = v({}, [...be, ...Bn]), Xo = function(n, a, d) {
2223
+ return a.namespaceURI === K ? n === "svg" : a.namespaceURI === zt ? n === "svg" && (d === "annotation-xml" || le[d]) : !!Ke[n];
2221
2224
  }, Zo = function(n, a, d) {
2222
- return a.namespaceURI === $ ? n === "math" : a.namespaceURI === Pt ? n === "math" && le[d] : !!Ye[n];
2225
+ return a.namespaceURI === K ? n === "math" : a.namespaceURI === Bt ? n === "math" && ce[d] : !!Ye[n];
2223
2226
  }, Jo = function(n, a, d) {
2224
- return a.namespaceURI === Pt && !le[d] || a.namespaceURI === Nt && !se[d] ? !1 : !Ye[n] && (Ko[n] || !Ke[n]);
2227
+ return a.namespaceURI === Bt && !ce[d] || a.namespaceURI === zt && !le[d] ? !1 : !Ye[n] && (Ko[n] || !Ke[n]);
2225
2228
  }, Qo = function(n) {
2226
- let a = N(n);
2229
+ let a = z(n);
2227
2230
  (!a || !a.tagName) && (a = {
2228
- namespaceURI: dt,
2231
+ namespaceURI: pt,
2229
2232
  tagName: "template"
2230
2233
  });
2231
- const d = _t(n.tagName), p = _t(a.tagName);
2232
- return ae[n.namespaceURI] ? n.namespaceURI === Pt ? Xo(d, a, p) : n.namespaceURI === Nt ? Zo(d, a, p) : n.namespaceURI === $ ? Jo(d, a, p) : !!(wt === "application/xhtml+xml" && ae[n.namespaceURI]) : !1;
2233
- }, V = function(n) {
2234
- kt(t.removed, { element: n });
2234
+ const d = Mt(n.tagName), f = Mt(a.tagName);
2235
+ return se[n.namespaceURI] ? n.namespaceURI === Bt ? Xo(d, a, f) : n.namespaceURI === zt ? Zo(d, a, f) : n.namespaceURI === K ? Jo(d, a, f) : !!(kt === "application/xhtml+xml" && se[n.namespaceURI]) : !1;
2236
+ }, X = function(n) {
2237
+ At(t.removed, { element: n });
2235
2238
  try {
2236
- N(n).removeChild(n);
2239
+ z(n).removeChild(n);
2237
2240
  } catch (a) {
2238
- if (w(n), !N(n)) throw X("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
2241
+ if (E(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");
2239
2242
  }
2240
2243
  }, qe = function(n, a, d) {
2241
2244
  try {
2242
- v(n, a);
2243
- } catch (p) {
2245
+ k(n, a);
2246
+ } catch (f) {
2244
2247
  try {
2245
2248
  n.removeAttribute(d);
2246
2249
  } catch (h) {
2247
2250
  }
2248
2251
  }
2249
- }, zt = function(n) {
2250
- Ht(n);
2251
- const a = O(n);
2252
+ }, Ht = function(n) {
2253
+ Ft(n);
2254
+ const a = $(n);
2252
2255
  if (a) {
2253
- const p = [];
2254
- it(a, (h) => {
2255
- kt(p, h);
2256
- }), it(p, (h) => {
2256
+ const f = [];
2257
+ rt(a, (h) => {
2258
+ At(f, h);
2259
+ }), rt(f, (h) => {
2257
2260
  try {
2258
- w(h);
2261
+ E(h);
2259
2262
  } catch (b) {
2260
2263
  }
2261
2264
  });
2262
2265
  }
2263
- const d = qt(n);
2264
- if (d) for (let p = d.length - 1; p >= 0; --p) {
2265
- const h = d[p], b = h && h.name;
2266
+ const d = B(n);
2267
+ if (d) for (let f = d.length - 1; f >= 0; --f) {
2268
+ const h = d[f], b = h && h.name;
2266
2269
  typeof b == "string" && qe(n, h, b);
2267
2270
  }
2268
- }, nt = function(n, a, d) {
2271
+ }, it = function(n, a, d) {
2269
2272
  if (!d) try {
2270
2273
  d = a.getAttributeNode(n);
2271
- } catch (p) {
2274
+ } catch (f) {
2272
2275
  d = null;
2273
2276
  }
2274
- kt(t.removed, {
2277
+ At(t.removed, {
2275
2278
  attribute: d || null,
2276
2279
  from: a
2277
2280
  });
2278
2281
  try {
2279
- d ? v(a, d) : a.removeAttribute(n);
2280
- } catch (p) {
2282
+ d ? k(a, d) : a.removeAttribute(n);
2283
+ } catch (f) {
2281
2284
  try {
2282
2285
  a.removeAttribute(n);
2283
2286
  } catch (h) {
2284
2287
  }
2285
2288
  }
2286
2289
  if (n === "is")
2287
- if (st || Ot) try {
2288
- V(a);
2289
- } catch (p) {
2290
+ if (ct || Nt) try {
2291
+ X(a);
2292
+ } catch (f) {
2290
2293
  }
2291
2294
  else try {
2292
2295
  a.setAttribute(n, "");
2293
- } catch (p) {
2296
+ } catch (f) {
2294
2297
  }
2295
2298
  }, tn = function(n) {
2296
- const a = qt(n);
2299
+ const a = B(n);
2297
2300
  if (a)
2298
2301
  for (let d = a.length - 1; d >= 0; --d) {
2299
- const p = a[d], h = p && p.name;
2300
- typeof h != "string" || C[_(h)] || qe(n, p, h);
2302
+ const f = a[d], h = f && f.name;
2303
+ typeof h != "string" || C[_(h)] || qe(n, f, h);
2301
2304
  }
2302
- }, Ht = function(n) {
2305
+ }, Ft = function(n) {
2303
2306
  const a = [n];
2304
2307
  for (; a.length > 0; ) {
2305
2308
  const d = a.pop();
2306
- yt(d) === B.element && tn(d);
2307
- const p = O(d);
2308
- if (p) for (let h = p.length - 1; h >= 0; --h) a.push(p[h]);
2309
+ Et(d) === F.element && tn(d);
2310
+ const f = $(d);
2311
+ if (f) for (let h = f.length - 1; h >= 0; --h) a.push(f[h]);
2309
2312
  }
2310
2313
  }, Ve = function(n, a) {
2311
- return et ? n === "patchsrc" ? !0 : n === "for" && a !== "label" && a !== "output" : !1;
2314
+ return ot ? n === "patchsrc" ? !0 : n === "for" && a !== "label" && a !== "output" : !1;
2312
2315
  }, en = function(n) {
2313
- if (!et) return;
2316
+ if (!ot) return;
2314
2317
  const a = [n];
2315
2318
  for (; a.length > 0; ) {
2316
- const d = a.pop(), p = yt(d);
2317
- if (p === B.processingInstruction || p === B.comment && D(yo, d.data)) {
2319
+ const d = a.pop(), f = Et(d);
2320
+ if (f === F.processingInstruction || f === F.comment && O(yo, d.data)) {
2318
2321
  try {
2319
- w(d);
2322
+ E(d);
2320
2323
  } catch (b) {
2321
2324
  }
2322
2325
  continue;
2323
2326
  }
2324
- if (p === B.element) {
2325
- const b = d, y = _(Vt(d));
2327
+ if (f === F.element) {
2328
+ const b = d, y = _(Xt(d));
2326
2329
  try {
2327
2330
  b.hasAttribute && b.hasAttribute("patchsrc") && b.removeAttribute("patchsrc"), b.hasAttribute && b.hasAttribute("for") && Ve("for", y) && b.removeAttribute("for");
2328
2331
  } catch (S) {
2329
2332
  }
2330
2333
  }
2331
- const h = O(d);
2334
+ const h = $(d);
2332
2335
  if (h) for (let b = h.length - 1; b >= 0; --b) a.push(h[b]);
2333
2336
  }
2334
2337
  }, Xe = function(n) {
2335
2338
  let a = null, d = null;
2336
- if (oe) n = "<remove></remove>" + n;
2339
+ if (ne) n = "<remove></remove>" + n;
2337
2340
  else {
2338
2341
  const b = so(n, /^[\r\n\t ]+/);
2339
2342
  d = b && b[0];
2340
2343
  }
2341
- wt === "application/xhtml+xml" && dt === $ && (n = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + n + "</body></html>");
2342
- const p = P ? at(n) : n;
2343
- if (dt === $) try {
2344
- a = new m().parseFromString(p, wt);
2344
+ kt === "application/xhtml+xml" && pt === K && (n = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + n + "</body></html>");
2345
+ const f = N ? lt(n) : n;
2346
+ if (pt === K) try {
2347
+ a = new m().parseFromString(f, kt);
2345
2348
  } catch (b) {
2346
2349
  }
2347
2350
  if (!a || !a.documentElement) {
2348
- a = Zt.createDocument(dt, "template", null);
2351
+ a = Jt.createDocument(pt, "template", null);
2349
2352
  try {
2350
- a.documentElement.innerHTML = re ? tt : p;
2353
+ a.documentElement.innerHTML = ae ? et : f;
2351
2354
  } catch (b) {
2352
2355
  }
2353
2356
  }
2354
2357
  const h = a.body || a.documentElement;
2355
- return n && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null), dt === $ ? Po.call(a, ot ? "html" : "body")[0] : ot ? a.documentElement : h;
2358
+ return n && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null), pt === K ? Po.call(a, nt ? "html" : "body")[0] : nt ? a.documentElement : h;
2356
2359
  }, Ze = function(n) {
2357
- const a = Lt ? Lt(n) : n.ownerDocument;
2358
- return _e.call(a || n, n, f.SHOW_ELEMENT | f.SHOW_COMMENT | f.SHOW_TEXT | f.SHOW_PROCESSING_INSTRUCTION | f.SHOW_CDATA_SECTION, null);
2359
- }, Bt = function(n) {
2360
- return n = xt(n, Ho, " "), n = xt(n, Bo, " "), n = xt(n, Fo, " "), n;
2361
- }, de = function(n) {
2360
+ const a = It ? It(n) : n.ownerDocument;
2361
+ return _e.call(a || n, n, p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION, null);
2362
+ }, Ut = function(n) {
2363
+ return n = Ct(n, Bo, " "), n = Ct(n, Ho, " "), n = Ct(n, Fo, " "), n;
2364
+ }, ue = function(n) {
2362
2365
  var a;
2363
2366
  n.normalize();
2364
- const d = Lt ? Lt(n) : n.ownerDocument, p = _e.call(d || n, n, f.SHOW_TEXT | f.SHOW_COMMENT | f.SHOW_CDATA_SECTION | f.SHOW_PROCESSING_INSTRUCTION, null);
2365
- let h = p.nextNode();
2367
+ const d = It ? It(n) : n.ownerDocument, f = _e.call(d || n, n, p.SHOW_TEXT | p.SHOW_COMMENT | p.SHOW_CDATA_SECTION | p.SHOW_PROCESSING_INSTRUCTION, null);
2368
+ let h = f.nextNode();
2366
2369
  for (; h; )
2367
- h.data = Bt(h.data), h = p.nextNode();
2370
+ h.data = Ut(h.data), h = f.nextNode();
2368
2371
  const b = (a = n.querySelectorAll) === null || a === void 0 ? void 0 : a.call(n, "template");
2369
- b && it(b, (y) => {
2370
- pt(y.content) && de(y.content);
2372
+ b && rt(b, (y) => {
2373
+ ht(y.content) && ue(y.content);
2371
2374
  });
2372
- }, Ft = function(n) {
2373
- const a = rt ? rt(n) : null;
2374
- return typeof a != "string" || _(a) !== "form" ? !1 : typeof n.nodeName != "string" || typeof n.textContent != "string" || typeof n.removeChild != "function" || n.attributes !== qt(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 !== Q(n) || n.childNodes !== O(n);
2375
- }, pt = function(n) {
2376
- if (!Q || typeof n != "object" || n === null) return !1;
2375
+ }, jt = function(n) {
2376
+ const a = st ? st(n) : null;
2377
+ return typeof a != "string" || _(a) !== "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 !== D(n) || n.childNodes !== $(n);
2378
+ }, ht = function(n) {
2379
+ if (!D || typeof n != "object" || n === null) return !1;
2377
2380
  try {
2378
- return Q(n) === B.documentFragment;
2381
+ return D(n) === F.documentFragment;
2379
2382
  } catch (a) {
2380
2383
  return !1;
2381
2384
  }
2382
- }, Tt = function(n) {
2383
- if (!Q || typeof n != "object" || n === null) return !1;
2385
+ }, xt = function(n) {
2386
+ if (!D || typeof n != "object" || n === null) return !1;
2384
2387
  try {
2385
- return typeof Q(n) == "number";
2388
+ return typeof D(n) == "number";
2386
2389
  } catch (a) {
2387
2390
  return !1;
2388
2391
  }
2389
2392
  };
2390
- function G(u, n, a) {
2391
- u.length !== 0 && it(u, (d) => {
2392
- d.call(t, n, a, ut);
2393
+ function Y(u, n, a) {
2394
+ u.length !== 0 && rt(u, (d) => {
2395
+ d.call(t, n, a, ft);
2393
2396
  });
2394
2397
  }
2395
2398
  const on = function(n, a) {
2396
- return !!(et && n.hasChildNodes() && !Tt(n.firstElementChild) && D(bo, n.textContent) && D(bo, n.innerHTML) || et && n.namespaceURI === $ && Xn[a] && (Tt(n.firstElementChild) || typeof n.textContent == "string" && D(Zn[a], n.textContent)) || n.nodeType === B.processingInstruction || et && n.nodeType === B.comment && D(yo, n.data));
2397
- }, Ut = function(n, a) {
2398
- if (n instanceof RegExp) return D(n, a);
2399
+ return !!(ot && n.hasChildNodes() && !xt(n.firstElementChild) && O(bo, n.textContent) && O(bo, n.innerHTML) || ot && n.namespaceURI === K && Xn[a] && (xt(n.firstElementChild) || typeof n.textContent == "string" && O(Zn[a], n.textContent)) || n.nodeType === F.processingInstruction || ot && n.nodeType === F.comment && O(yo, n.data));
2400
+ }, Wt = function(n, a) {
2401
+ if (n instanceof RegExp) return O(n, a);
2399
2402
  if (n instanceof Function) {
2400
- for (var d = arguments.length, p = new Array(d > 2 ? d - 2 : 0), h = 2; h < d; h++) p[h - 2] = arguments[h];
2401
- return !!n(a, ...p);
2403
+ for (var d = arguments.length, f = new Array(d > 2 ? d - 2 : 0), h = 2; h < d; h++) f[h - 2] = arguments[h];
2404
+ return !!n(a, ...f);
2402
2405
  }
2403
2406
  return !1;
2404
2407
  }, nn = function(n, a, d) {
2405
- if (!vt[a] && eo(a) && Ut(W.tagNameCheck, a)) return !1;
2406
- if (ne && !ct[a]) {
2407
- const p = N(n), h = O(n);
2408
- if (h && p) {
2408
+ if (!Tt[a] && eo(a) && Wt(G.tagNameCheck, a)) return !1;
2409
+ if (ie && !ut[a]) {
2410
+ const f = z(n), h = $(n);
2411
+ if (h && f) {
2409
2412
  const b = h.length;
2410
2413
  for (let y = b - 1; y >= 0; --y) {
2411
- const S = n === d ? k(h[y], !0) : h[y];
2412
- p.insertBefore(S, K(n));
2414
+ const S = n === d ? T(h[y], !0) : h[y];
2415
+ f.insertBefore(S, tt(n));
2413
2416
  }
2414
2417
  }
2415
2418
  }
2416
- return V(n), !0;
2417
- }, Je = function(n, a, d, p) {
2418
- return n.length === 0 ? a : a === d || a === p ? F(a) : a;
2419
- }, ft = function(n, a) {
2420
- return n === a || N(n) !== null ? !1 : (ie && Ht(n), !0);
2419
+ return X(n), !0;
2420
+ }, Je = function(n, a, d, f) {
2421
+ return n.length === 0 ? a : a === d || a === f ? U(a) : a;
2422
+ }, mt = function(n, a) {
2423
+ return n === a || z(n) !== null ? !1 : (re && Ft(n), !0);
2421
2424
  }, Qe = function(n, a) {
2422
- if (G(x.beforeSanitizeElements, n, null), ft(n, a)) return !0;
2423
- if (Ft(n))
2424
- return V(n), !0;
2425
- const d = _(Vt(n));
2426
- if (A = Je(x.uponSanitizeElement, A, Jt, It), G(x.uponSanitizeElement, n, {
2425
+ if (Y(x.beforeSanitizeElements, n, null), mt(n, a)) return !0;
2426
+ if (jt(n))
2427
+ return X(n), !0;
2428
+ const d = _(Xt(n));
2429
+ if (A = Je(x.uponSanitizeElement, A, Qt, Dt), Y(x.uponSanitizeElement, n, {
2427
2430
  tagName: d,
2428
2431
  allowedTags: A
2429
- }), ft(n, a)) return !0;
2432
+ }), mt(n, a)) return !0;
2430
2433
  if (on(n, d))
2431
- return V(n), !0;
2432
- if (vt[d] || !(Y.tagCheck instanceof Function && Y.tagCheck(d)) && !A[d]) {
2433
- const p = nn(n, d, a);
2434
- return p === !1 && (G(x.afterSanitizeElements, n, null), ft(n, a)) ? !0 : p;
2435
- }
2436
- if (yt(n) === B.element && !Qo(n) || (d === "noscript" || d === "noembed" || d === "noframes") && D(qn, n.innerHTML))
2437
- return V(n), !0;
2438
- if (q && n.nodeType === B.text) {
2439
- const p = Bt(n.textContent);
2440
- n.textContent !== p && (kt(t.removed, { element: n.cloneNode() }), n.textContent = p);
2441
- }
2442
- return G(x.afterSanitizeElements, n, null), ft(n, a);
2434
+ return X(n), !0;
2435
+ if (Tt[d] || !(q.tagCheck instanceof Function && q.tagCheck(d)) && !A[d]) {
2436
+ const f = nn(n, d, a);
2437
+ return f === !1 && (Y(x.afterSanitizeElements, n, null), mt(n, a)) ? !0 : f;
2438
+ }
2439
+ if (Et(n) === F.element && !Qo(n) || (d === "noscript" || d === "noembed" || d === "noframes") && O(qn, n.innerHTML))
2440
+ return X(n), !0;
2441
+ if (V && n.nodeType === F.text) {
2442
+ const f = Ut(n.textContent);
2443
+ n.textContent !== f && (At(t.removed, { element: n.cloneNode() }), n.textContent = f);
2444
+ }
2445
+ return Y(x.afterSanitizeElements, n, null), mt(n, a);
2443
2446
  }, to = function(n, a, d) {
2444
2447
  if (Ie[a] || Ve(a, n) || Ne && (a === "id" || a === "name") && (d in e || d in Vo)) return !1;
2445
- const p = C[a] || Y.attributeCheck instanceof Function && Y.attributeCheck(a, n);
2446
- return te && D(Uo, a) || De && D(jo, a) ? !0 : p ? Ue[a] || D(Me, xt(d, Le, "")) || (a === "src" || a === "xlink:href" || a === "href") && n !== "script" && lo(d, "data:") === 0 && Be[n] || Oe && !D(Wo, xt(d, Le, "")) ? !0 : !d : eo(n) && Ut(W.tagNameCheck, n) && Ut(W.attributeNameCheck, a, n) || a === "is" && W.allowCustomizedBuiltInElements && Ut(W.tagNameCheck, d);
2447
- }, rn = E({}, [
2448
+ const f = C[a] || q.attributeCheck instanceof Function && q.attributeCheck(a, n);
2449
+ return ee && O(Uo, a) || Oe && O(jo, a) ? !0 : f ? Ue[a] || O(Me, Ct(d, Le, "")) || (a === "src" || a === "xlink:href" || a === "href") && n !== "script" && lo(d, "data:") === 0 && He[n] || De && !O(Wo, Ct(d, Le, "")) ? !0 : !d : eo(n) && Wt(G.tagNameCheck, n) && Wt(G.attributeNameCheck, a, n) || a === "is" && G.allowCustomizedBuiltInElements && Wt(G.tagNameCheck, d);
2450
+ }, rn = v({}, [
2448
2451
  "annotation-xml",
2449
2452
  "color-profile",
2450
2453
  "font-face",
@@ -2454,27 +2457,27 @@ function Lo() {
2454
2457
  "font-face-uri",
2455
2458
  "missing-glyph"
2456
2459
  ]), eo = function(n) {
2457
- return !rn[_t(n)] && D($o, n);
2458
- }, an = function(n, a, d, p) {
2459
- if (P && typeof g == "object" && typeof g.getAttributeType == "function" && !d) switch (g.getAttributeType(n, a)) {
2460
+ return !rn[Mt(n)] && O($o, n);
2461
+ }, an = function(n, a, d, f) {
2462
+ if (N && typeof g == "object" && typeof g.getAttributeType == "function" && !d) switch (g.getAttributeType(n, a)) {
2460
2463
  case "TrustedHTML":
2461
- return at(p);
2464
+ return lt(f);
2462
2465
  case "TrustedScriptURL":
2463
- return Oo(p);
2466
+ return Do(f);
2464
2467
  }
2465
- return p;
2466
- }, sn = function(n, a, d, p) {
2468
+ return f;
2469
+ }, sn = function(n, a, d, f) {
2467
2470
  try {
2468
- return d ? n.setAttributeNS(d, a, p) : n.setAttribute(a, p), Ft(n) ? (V(n), !1) : !0;
2471
+ return d ? n.setAttributeNS(d, a, f) : n.setAttribute(a, f), jt(n) ? (X(n), !1) : !0;
2469
2472
  } catch (h) {
2470
- return nt(a, n), !1;
2473
+ return it(a, n), !1;
2471
2474
  }
2472
2475
  }, oo = function(n, a) {
2473
- if (G(x.beforeSanitizeAttributes, n, null), ft(n, a)) return;
2476
+ if (Y(x.beforeSanitizeAttributes, n, null), mt(n, a)) return;
2474
2477
  const d = n.attributes;
2475
- if (!d || Ft(n)) return;
2476
- C = Je(x.uponSanitizeAttribute, C, Qt, Dt);
2477
- const p = {
2478
+ if (!d || jt(n)) return;
2479
+ C = Je(x.uponSanitizeAttribute, C, te, Rt);
2480
+ const f = {
2478
2481
  attrName: "",
2479
2482
  attrValue: "",
2480
2483
  keepAttr: !0,
@@ -2484,43 +2487,43 @@ function Lo() {
2484
2487
  let h = d.length;
2485
2488
  const b = _(n.nodeName);
2486
2489
  for (; h--; ) {
2487
- const y = d[h], S = y.name, U = y.namespaceURI, H = y.value, ht = _(S), pe = H;
2488
- let R = S === "value" ? pe : Mn(pe), no = !1;
2489
- if (p.attrName = ht, p.attrValue = R, p.keepAttr = !0, p.forceKeepAttr = void 0, G(x.uponSanitizeAttribute, n, p), R = p.attrValue, Pe && (ht === "id" || ht === "name") && lo(R, ze) !== 0 && (nt(S, n, y), R = ze + R, no = !0), et && D(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, R)) {
2490
- nt(S, n, y);
2490
+ const y = d[h], S = y.name, j = y.namespaceURI, H = y.value, gt = _(S), fe = H;
2491
+ let R = S === "value" ? fe : Mn(fe), no = !1;
2492
+ if (f.attrName = gt, f.attrValue = R, f.keepAttr = !0, f.forceKeepAttr = void 0, Y(x.uponSanitizeAttribute, n, f), R = f.attrValue, Pe && (gt === "id" || gt === "name") && lo(R, ze) !== 0 && (it(S, n, y), R = ze + R, no = !0), ot && O(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, R)) {
2493
+ it(S, n, y);
2491
2494
  continue;
2492
2495
  }
2493
- if (ht === "attributename" && so(R, "href")) {
2494
- nt(S, n, y);
2496
+ if (gt === "attributename" && so(R, "href")) {
2497
+ it(S, n, y);
2495
2498
  continue;
2496
2499
  }
2497
- if (!p.forceKeepAttr) {
2498
- if (!p.keepAttr) {
2499
- nt(S, n, y);
2500
+ if (!f.forceKeepAttr) {
2501
+ if (!f.keepAttr) {
2502
+ it(S, n, y);
2500
2503
  continue;
2501
2504
  }
2502
- if (!Re && D(Vn, R)) {
2503
- nt(S, n, y);
2505
+ if (!Re && O(Vn, R)) {
2506
+ it(S, n, y);
2504
2507
  continue;
2505
2508
  }
2506
- if (q && (R = Bt(R)), !to(b, ht, R)) {
2507
- nt(S, n, y);
2509
+ if (V && (R = Ut(R)), !to(b, gt, R)) {
2510
+ it(S, n, y);
2508
2511
  continue;
2509
2512
  }
2510
- R = an(b, ht, U, R), R !== pe && sn(n, S, U, R) && no && ao(t.removed);
2513
+ R = an(b, gt, j, R), R !== fe && sn(n, S, j, R) && no && ao(t.removed);
2511
2514
  }
2512
2515
  }
2513
- G(x.afterSanitizeAttributes, n, null), ft(n, a);
2514
- }, jt = function(n) {
2516
+ Y(x.afterSanitizeAttributes, n, null), mt(n, a);
2517
+ }, $t = function(n) {
2515
2518
  let a = null;
2516
2519
  const d = Ze(n);
2517
- for (G(x.beforeSanitizeShadowDOM, n, null); a = d.nextNode(); )
2518
- if (G(x.uponSanitizeShadowNode, a, null), Qe(a, n), oo(a, n), pt(a.content) && jt(a.content), yt(a) === B.element) {
2519
- const p = Ae(a);
2520
- pt(p) && (ue(p), jt(p));
2520
+ for (Y(x.beforeSanitizeShadowDOM, n, null); a = d.nextNode(); )
2521
+ if (Y(x.uponSanitizeShadowNode, a, null), Qe(a, n), oo(a, n), ht(a.content) && $t(a.content), Et(a) === F.element) {
2522
+ const f = at(a);
2523
+ ht(f) && (pe(f), $t(f));
2521
2524
  }
2522
- G(x.afterSanitizeShadowDOM, n, null);
2523
- }, ue = function(n) {
2525
+ Y(x.afterSanitizeShadowDOM, n, null);
2526
+ }, pe = function(n) {
2524
2527
  const a = [{
2525
2528
  node: n,
2526
2529
  shadow: null
@@ -2528,27 +2531,27 @@ function Lo() {
2528
2531
  for (; a.length > 0; ) {
2529
2532
  const d = a.pop();
2530
2533
  if (d.shadow) {
2531
- jt(d.shadow);
2534
+ $t(d.shadow);
2532
2535
  continue;
2533
2536
  }
2534
- const p = d.node, h = yt(p) === B.element, b = O(p);
2537
+ const f = d.node, h = Et(f) === F.element, b = $(f);
2535
2538
  if (b) for (let y = b.length - 1; y >= 0; --y) a.push({
2536
2539
  node: b[y],
2537
2540
  shadow: null
2538
2541
  });
2539
2542
  if (h) {
2540
- const y = rt ? rt(p) : null;
2543
+ const y = st ? st(f) : null;
2541
2544
  if (typeof y == "string" && _(y) === "template") {
2542
- const S = p.content;
2543
- pt(S) && a.push({
2545
+ const S = f.content;
2546
+ ht(S) && a.push({
2544
2547
  node: S,
2545
2548
  shadow: null
2546
2549
  });
2547
2550
  }
2548
2551
  }
2549
2552
  if (h) {
2550
- const y = Ae(p);
2551
- pt(y) && a.push({
2553
+ const y = at(f);
2554
+ ht(y) && a.push({
2552
2555
  node: null,
2553
2556
  shadow: y
2554
2557
  }, {
@@ -2559,73 +2562,73 @@ function Lo() {
2559
2562
  }
2560
2563
  };
2561
2564
  return t.sanitize = function(u) {
2562
- let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = null, d = null, p = null, h = null;
2563
- if (re = !u, re && (u = "<!-->"), typeof u != "string" && !Tt(u) && (u = Nn(u), typeof u != "string"))
2564
- throw X("dirty is not a string, aborting");
2565
+ let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = null, d = null, f = null, h = null;
2566
+ if (ae = !u, ae && (u = "<!-->"), typeof u != "string" && !xt(u) && (u = Nn(u), typeof u != "string"))
2567
+ throw Z("dirty is not a string, aborting");
2565
2568
  if (!t.isSupported) return u;
2566
- ee ? (A = It, C = Dt) : ce(n), (x.uponSanitizeElement.length > 0 || x.uponSanitizeAttribute.length > 0) && (A = F(A)), x.uponSanitizeAttribute.length > 0 && (C = F(C)), t.removed = [];
2567
- const b = ie && typeof u != "string" && Tt(u);
2569
+ 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 = [];
2570
+ const b = re && typeof u != "string" && xt(u);
2568
2571
  if (b) {
2569
2572
  en(u);
2570
- const U = Vt(u);
2571
- if (typeof U == "string") {
2572
- const H = _(U);
2573
- if (!A[H] || vt[H])
2574
- throw zt(u), X("root node is forbidden and cannot be sanitized in-place");
2573
+ const j = Xt(u);
2574
+ if (typeof j == "string") {
2575
+ const H = _(j);
2576
+ if (!A[H] || Tt[H])
2577
+ throw Ht(u), Z("root node is forbidden and cannot be sanitized in-place");
2575
2578
  }
2576
- if (Ft(u))
2577
- throw zt(u), X("root node is clobbered and cannot be sanitized in-place");
2579
+ if (jt(u))
2580
+ throw Ht(u), Z("root node is clobbered and cannot be sanitized in-place");
2578
2581
  try {
2579
- ue(u);
2582
+ pe(u);
2580
2583
  } catch (H) {
2581
- throw zt(u), H;
2584
+ throw Ht(u), H;
2582
2585
  }
2583
- } else if (Tt(u))
2584
- a = Xe("<!---->"), d = a.ownerDocument.importNode(u, !0), d.nodeType === B.element && d.nodeName === "BODY" || d.nodeName === "HTML" ? a = d : a.appendChild(d), ue(a);
2586
+ } else if (xt(u))
2587
+ a = Xe("<!---->"), d = a.ownerDocument.importNode(u, !0), d.nodeType === F.element && d.nodeName === "BODY" || d.nodeName === "HTML" ? a = d : a.appendChild(d), pe(a);
2585
2588
  else {
2586
- if (!st && !q && !ot && u.indexOf("<") === -1) return P && Rt ? at(u) : u;
2587
- if (a = Xe(u), !a) return st ? null : Rt ? tt : "";
2589
+ if (!ct && !V && !nt && u.indexOf("<") === -1) return N && Pt ? lt(u) : u;
2590
+ if (a = Xe(u), !a) return ct ? null : Pt ? et : "";
2588
2591
  }
2589
- a && oe && V(a.firstChild);
2592
+ a && ne && X(a.firstChild);
2590
2593
  const y = b ? u : a;
2591
2594
  try {
2592
- const U = Ze(y);
2593
- for (; p = U.nextNode(); )
2594
- Qe(p, y), oo(p, y), pt(p.content) && jt(p.content);
2595
- } catch (U) {
2596
- throw b && (zt(u), it(t.removed, (H) => {
2597
- H.element && Ht(H.element);
2598
- })), U;
2595
+ const j = Ze(y);
2596
+ for (; f = j.nextNode(); )
2597
+ Qe(f, y), oo(f, y), ht(f.content) && $t(f.content);
2598
+ } catch (j) {
2599
+ throw b && (Ht(u), rt(t.removed, (H) => {
2600
+ H.element && Ft(H.element);
2601
+ })), j;
2599
2602
  }
2600
2603
  if (b) {
2601
- let U = !1;
2602
- if (it(t.removed, (H) => {
2603
- H.element && (H.element === u && (U = !0), Ht(H.element));
2604
- }), U) throw X("a node selected for removal could not be safely returned; refusing to sanitize in place");
2605
- return q && de(u), u;
2606
- }
2607
- if (st) {
2608
- if (q && de(a), Ot)
2604
+ let j = !1;
2605
+ if (rt(t.removed, (H) => {
2606
+ H.element && (H.element === u && (j = !0), Ft(H.element));
2607
+ }), j) throw Z("a node selected for removal could not be safely returned; refusing to sanitize in place");
2608
+ return V && ue(u), u;
2609
+ }
2610
+ if (ct) {
2611
+ if (V && ue(a), Nt)
2609
2612
  for (h = No.call(a.ownerDocument); a.firstChild; ) h.appendChild(a.firstChild);
2610
2613
  else h = a;
2611
2614
  return (C.shadowroot || C.shadowrootmode) && (h = zo.call(o, h, !0)), h;
2612
2615
  }
2613
- let S = ot ? a.outerHTML : a.innerHTML;
2614
- return ot && A["!doctype"] && a.ownerDocument && a.ownerDocument.doctype && a.ownerDocument.doctype.name && D(Kn, a.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + a.ownerDocument.doctype.name + `>
2615
- ` + S), q && (S = Bt(S)), P && Rt ? at(S) : S;
2616
+ let S = nt ? a.outerHTML : a.innerHTML;
2617
+ return nt && A["!doctype"] && a.ownerDocument && a.ownerDocument.doctype && a.ownerDocument.doctype.name && O(Kn, a.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + a.ownerDocument.doctype.name + `>
2618
+ ` + S), V && (S = Ut(S)), N && Pt ? lt(S) : S;
2616
2619
  }, t.setConfig = function() {
2617
2620
  let u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2618
- ce(u), ee = !0, It = A, Dt = C;
2621
+ de(u), oe = !0, Dt = A, Rt = C;
2619
2622
  }, t.clearConfig = function() {
2620
- ut = null, ee = !1, It = null, Dt = null, P = Xt, tt = "";
2623
+ ft = null, oe = !1, Dt = null, Rt = null, N = Zt, et = "";
2621
2624
  }, t.isValidAttribute = function(u, n, a) {
2622
- ut || ce({});
2623
- const d = _(u), p = _(n);
2624
- return to(d, p, a);
2625
+ ft || de({});
2626
+ const d = _(u), f = _(n);
2627
+ return to(d, f, a);
2625
2628
  }, t.addHook = function(u, n) {
2626
- typeof n == "function" && z(x, u) && kt(x[u], n);
2629
+ typeof n == "function" && P(x, u) && At(x[u], n);
2627
2630
  }, t.removeHook = function(u, n) {
2628
- if (z(x, u)) {
2631
+ if (P(x, u)) {
2629
2632
  if (n !== void 0) {
2630
2633
  const a = _n(x[u], n);
2631
2634
  return a === -1 ? void 0 : Ln(x[u], a, 1)[0];
@@ -2633,12 +2636,12 @@ function Lo() {
2633
2636
  return ao(x[u]);
2634
2637
  }
2635
2638
  }, t.removeHooks = function(u) {
2636
- z(x, u) && (x[u] = []);
2639
+ P(x, u) && (x[u] = []);
2637
2640
  }, t.removeAllHooks = function() {
2638
- x = Eo();
2641
+ x = vo();
2639
2642
  }, t;
2640
2643
  }
2641
- var $t = Lo();
2644
+ var Kt = Lo();
2642
2645
  const ti = [
2643
2646
  "p",
2644
2647
  "br",
@@ -2718,29 +2721,29 @@ function ni(s) {
2718
2721
  function Mo(s, t, e, o) {
2719
2722
  if ((t == null ? void 0 : t.sanitize) === !1)
2720
2723
  return s;
2721
- const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : ti, 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 : ei, f = /* @__PURE__ */ new Set();
2722
- for (const T of Object.values(c))
2723
- for (const k of T) f.add(k);
2724
+ const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : ti, 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 : ei, p = /* @__PURE__ */ new Set();
2725
+ for (const w of Object.values(c))
2726
+ for (const T of w) p.add(T);
2724
2727
  const m = {
2725
2728
  ALLOWED_TAGS: r,
2726
- ALLOWED_ATTR: Array.from(f)
2729
+ ALLOWED_ATTR: Array.from(p)
2727
2730
  };
2728
2731
  if (!o)
2729
- return $t.sanitize(s, m);
2732
+ return Kt.sanitize(s, m);
2730
2733
  const g = r.includes("iframe");
2731
- $t.addHook(
2734
+ Kt.addHook(
2732
2735
  "uponSanitizeElement",
2733
- (T, k) => {
2734
- var v;
2735
- if (k.tagName !== "iframe") return;
2736
- const w = T;
2737
- k.allowedTags.iframe = g || ((v = w.getAttribute) == null ? void 0 : v.call(w, oi)) === "true" && ni(w.getAttribute("src"));
2736
+ (w, T) => {
2737
+ var k;
2738
+ if (T.tagName !== "iframe") return;
2739
+ const E = w;
2740
+ T.allowedTags.iframe = g || ((k = E.getAttribute) == null ? void 0 : k.call(E, oi)) === "true" && ni(E.getAttribute("src"));
2738
2741
  }
2739
2742
  );
2740
2743
  try {
2741
- return $t.sanitize(s, m);
2744
+ return Kt.sanitize(s, m);
2742
2745
  } finally {
2743
- $t.removeHook("uponSanitizeElement");
2746
+ Kt.removeHook("uponSanitizeElement");
2744
2747
  }
2745
2748
  }
2746
2749
  function ii(s, t, e, o) {
@@ -2749,7 +2752,7 @@ function ii(s, t, e, o) {
2749
2752
  function ri(s, t, e) {
2750
2753
  return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? s : ii(s, t);
2751
2754
  }
2752
- function vo(s, t, e, o) {
2755
+ function Eo(s, t, e, o) {
2753
2756
  return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? s : Mo(s, t, o, !0);
2754
2757
  }
2755
2758
  const ai = ".resize-handle, .table-resize-handle, [data-rte-media-pending]", si = /resize-handle|data-rte-media-pending|rte-media/;
@@ -2771,10 +2774,10 @@ function Io(s) {
2771
2774
  i && (i.removeAttribute("contenteditable"), !((r = i.textContent) != null && r.trim()) && !i.querySelector("img, video, a") && i.remove());
2772
2775
  }), t.innerHTML;
2773
2776
  }
2774
- function Ct(s) {
2777
+ function _t(s) {
2775
2778
  return s ? Io(s.innerHTML) : "";
2776
2779
  }
2777
- const Yt = class Yt {
2780
+ const Vt = class Vt {
2778
2781
  /**
2779
2782
  * Resolve configuration from multiple sources with priority
2780
2783
  */
@@ -2966,7 +2969,7 @@ const Yt = class Yt {
2966
2969
  return e;
2967
2970
  }
2968
2971
  };
2969
- Yt.EDITOR_DEFAULTS = {
2972
+ Vt.EDITOR_DEFAULTS = {
2970
2973
  height: 400,
2971
2974
  width: "100%",
2972
2975
  readonly: !1,
@@ -3015,7 +3018,7 @@ Yt.EDITOR_DEFAULTS = {
3015
3018
  sanitizeOnInput: !0
3016
3019
  },
3017
3020
  statusbar: !1
3018
- }, Yt.BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
3021
+ }, Vt.BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
3019
3022
  "readonly",
3020
3023
  "disabled",
3021
3024
  "autofocus",
@@ -3035,7 +3038,7 @@ Yt.EDITOR_DEFAULTS = {
3035
3038
  "security-sanitize-on-paste",
3036
3039
  "security-sanitize-on-input"
3037
3040
  ]);
3038
- let ke = Yt;
3041
+ let xe = Vt;
3039
3042
  class li {
3040
3043
  constructor() {
3041
3044
  this.loadedPlugins = /* @__PURE__ */ new Map(), this.pluginRegistry = /* @__PURE__ */ new Map();
@@ -3110,91 +3113,91 @@ class li {
3110
3113
  return this.loadedPlugins.has(t);
3111
3114
  }
3112
3115
  }
3113
- 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}}';
3114
- let Gt;
3115
- const di = "__editoraCommandEditorRoot", ui = "__editoraLastCommandButton", wo = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", To = ".rte-content, .editora-content", pi = "Rich text editor", xe = /* @__PURE__ */ new Set();
3116
- let J = null, ko = !1, Ee = null, ve = null;
3116
+ 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}}';
3117
+ let Yt;
3118
+ const di = "__editoraCommandEditorRoot", ui = "__editoraLastCommandButton", wo = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", To = ".rte-content, .editora-content", pi = "Rich text editor", fi = /* @__PURE__ */ new Set(["collaboration"]), Ae = /* @__PURE__ */ new Set();
3119
+ let Q = null, ko = !1, Ee = null, we = null;
3117
3120
  function xo(s) {
3118
3121
  if (!(s instanceof HTMLElement)) return !1;
3119
3122
  const t = s;
3120
3123
  return typeof t.execCommand == "function" && (t.tagName.toLowerCase() === "editora-editor" || t.classList.contains("editora-editor") || t.hasAttribute("data-editora-editor"));
3121
3124
  }
3122
- function fi(s) {
3125
+ function hi(s) {
3123
3126
  return s ? s.nodeType === Node.ELEMENT_NODE ? s : s.parentElement : null;
3124
3127
  }
3125
- function St(s) {
3128
+ function Lt(s) {
3126
3129
  if (!s) return null;
3127
3130
  if (xo(s))
3128
3131
  return s;
3129
3132
  const t = s.matches(wo) ? s : s.closest(wo);
3130
3133
  return !t || !xo(t) ? null : t;
3131
3134
  }
3132
- function hi() {
3135
+ function mi() {
3133
3136
  var i;
3134
3137
  if (typeof window == "undefined") return null;
3135
3138
  const s = window[di];
3136
3139
  if (s instanceof HTMLElement) {
3137
- const r = St(s);
3140
+ const r = Lt(s);
3138
3141
  if (r) return r;
3139
3142
  const l = s.matches(To) ? s : s.querySelector(To);
3140
3143
  if (l) {
3141
- const c = St(l);
3144
+ const c = Lt(l);
3142
3145
  if (c) return c;
3143
3146
  }
3144
3147
  }
3145
3148
  const t = window[ui];
3146
3149
  if (t instanceof HTMLElement) {
3147
- const r = St(t);
3150
+ const r = Lt(t);
3148
3151
  if (r) return r;
3149
3152
  }
3150
3153
  const e = document.activeElement;
3151
3154
  if (e) {
3152
- const r = St(e);
3155
+ const r = Lt(e);
3153
3156
  if (r) return r;
3154
3157
  }
3155
3158
  const o = (i = window.getSelection) == null ? void 0 : i.call(window);
3156
3159
  if (o && o.rangeCount > 0) {
3157
- const r = St(fi(o.getRangeAt(0).startContainer));
3160
+ const r = Lt(hi(o.getRangeAt(0).startContainer));
3158
3161
  if (r) return r;
3159
3162
  }
3160
- if (J && J.isConnected)
3161
- return J;
3162
- for (const r of xe)
3163
+ if (Q && Q.isConnected)
3164
+ return Q;
3165
+ for (const r of Ae)
3163
3166
  if (r.isConnected) return r;
3164
3167
  return null;
3165
3168
  }
3166
- function mi() {
3169
+ function gi() {
3167
3170
  if (typeof window == "undefined" || ko) return;
3168
- Ee = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, ve = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
3171
+ Ee = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, we = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
3169
3172
  const s = (t, ...e) => {
3170
- const o = hi();
3171
- return o ? o.execCommand(t, ...e) : Ee ? Ee(t, ...e) : ve ? ve(t, ...e) : !1;
3173
+ const o = mi();
3174
+ return o ? o.execCommand(t, ...e) : Ee ? Ee(t, ...e) : we ? we(t, ...e) : !1;
3172
3175
  };
3173
3176
  window.executeEditorCommand = s, window.execEditorCommand = s, ko = !0;
3174
3177
  }
3175
- function gi() {
3178
+ function bi() {
3176
3179
  const s = "editora-webcomponent-styles";
3177
3180
  if (!document.getElementById(s)) {
3178
3181
  const t = document.createElement("style");
3179
3182
  t.id = s, t.textContent = ci, document.head.appendChild(t);
3180
3183
  }
3181
3184
  }
3182
- function Do() {
3183
- if (!Gt) {
3184
- const s = gt.__globalPluginLoader;
3185
- s ? Gt = s : Gt = new li();
3185
+ function Oo() {
3186
+ if (!Yt) {
3187
+ const s = yt.__globalPluginLoader;
3188
+ s ? Yt = s : Yt = new li();
3186
3189
  }
3187
- return Gt;
3190
+ return Yt;
3188
3191
  }
3189
- function yi(s) {
3190
- const t = Do();
3192
+ function vi(s) {
3193
+ const t = Oo();
3191
3194
  Object.entries(s).forEach(([e, o]) => {
3192
3195
  t.register(e, o);
3193
3196
  });
3194
3197
  }
3195
- class gt extends HTMLElement {
3198
+ class yt extends HTMLElement {
3196
3199
  constructor() {
3197
- if (super(), this.pluginLoader = Do(), this.config = {}, this.isInitialized = !1, this.buildGeneration = 0, this.keyboardShortcutManager = new cn(), this.lastAutosavedContent = "", this.preservedContent = null, this.loadedPlugins = [], this.lastBeforeInputType = null, this.pendingHistorySnapshot = null, gi(), !this.hasAttribute("data-initial-content")) {
3200
+ if (super(), this.pluginLoader = Oo(), this.config = {}, this.isInitialized = !1, this.buildGeneration = 0, this.keyboardShortcutManager = new cn(), this.lastAutosavedContent = "", this.preservedContent = null, this.loadedPlugins = [], this.lastBeforeInputType = null, this.pendingHistorySnapshot = null, bi(), !this.hasAttribute("data-initial-content")) {
3198
3201
  const t = this.innerHTML.trim();
3199
3202
  t && this.setAttribute("data-initial-content", t);
3200
3203
  }
@@ -3261,13 +3264,13 @@ class gt extends HTMLElement {
3261
3264
  * Wait for the global plugin loader to be available
3262
3265
  */
3263
3266
  async waitForPluginLoader() {
3264
- if (gt.__globalPluginLoader) {
3265
- this.pluginLoader = gt.__globalPluginLoader;
3267
+ if (yt.__globalPluginLoader) {
3268
+ this.pluginLoader = yt.__globalPluginLoader;
3266
3269
  return;
3267
3270
  }
3268
3271
  return new Promise((t) => {
3269
3272
  const e = () => {
3270
- gt.__globalPluginLoader ? (this.pluginLoader = gt.__globalPluginLoader, t()) : setTimeout(e, 0);
3273
+ yt.__globalPluginLoader ? (this.pluginLoader = yt.__globalPluginLoader, t()) : setTimeout(e, 0);
3271
3274
  };
3272
3275
  e();
3273
3276
  });
@@ -3297,7 +3300,7 @@ class gt extends HTMLElement {
3297
3300
  var r;
3298
3301
  if (this.querySelector(".editora-toolbar") || this.isInitialized) return;
3299
3302
  const t = ++this.buildGeneration;
3300
- this.setAttribute("data-editora-editor", "true"), xe.add(this), J || (J = this), mi(), 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}`);
3303
+ this.setAttribute("data-editora-editor", "true"), Ae.add(this), Q || (Q = 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");
3301
3304
  const e = await this.loadPlugins();
3302
3305
  if (t !== this.buildGeneration || !this.isConnected) return;
3303
3306
  if (this.loadedPlugins = e, e.forEach((l) => {
@@ -3320,7 +3323,7 @@ class gt extends HTMLElement {
3320
3323
  content: i,
3321
3324
  plugins: e,
3322
3325
  readonly: this.config.readonly
3323
- }), this.createUI(e, i), this.setupEventListeners(), this.startAutosave(), this.isInitialized = !0, this.dispatchEvent(new CustomEvent("editor-ready", {
3326
+ }), 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", {
3324
3327
  detail: { api: this.getAPI() },
3325
3328
  bubbles: !0
3326
3329
  }));
@@ -3363,8 +3366,10 @@ class gt extends HTMLElement {
3363
3366
  } else {
3364
3367
  const r = this.pluginLoader.getRegisteredPluginNames();
3365
3368
  for (const l of r) {
3366
- const c = await this.pluginLoader.load(l, this.getPluginLoadConfig(l));
3367
- c && t.push(c);
3369
+ const c = this.getPluginLoadConfig(l);
3370
+ if (fi.has(l) && !c) continue;
3371
+ const p = await this.pluginLoader.load(l, c);
3372
+ p && t.push(p);
3368
3373
  }
3369
3374
  }
3370
3375
  return t;
@@ -3551,7 +3556,7 @@ class gt extends HTMLElement {
3551
3556
  * editable DOM: sanitizing only after the first edit leaves the page exposed until then.
3552
3557
  */
3553
3558
  sanitizeLoadedContent(t) {
3554
- return vo(t, this.getContentSanitizeConfig(), this.getSecurityConfig());
3559
+ return Eo(t, this.getContentSanitizeConfig(), this.getSecurityConfig());
3555
3560
  }
3556
3561
  getAutosaveConfig() {
3557
3562
  var e, o;
@@ -3619,7 +3624,7 @@ class gt extends HTMLElement {
3619
3624
  this.stopAutosave();
3620
3625
  const t = this.getAutosaveConfig();
3621
3626
  !t.enabled || !this.contentElement || (this.autosaveTimer = setInterval(() => {
3622
- this.persistAutosave(Ct(this.contentElement));
3627
+ this.persistAutosave(_t(this.contentElement));
3623
3628
  }, t.intervalMs));
3624
3629
  }
3625
3630
  insertHTMLAtSelection(t) {
@@ -3655,10 +3660,10 @@ class gt extends HTMLElement {
3655
3660
  var c;
3656
3661
  if (this.contentElement) {
3657
3662
  this.contentElement.focus();
3658
- const f = window.getSelection();
3659
- if (!f || f.rangeCount === 0 || !this.contentElement.contains(f.anchorNode)) {
3663
+ const p = window.getSelection();
3664
+ if (!p || p.rangeCount === 0 || !this.contentElement.contains(p.anchorNode)) {
3660
3665
  const m = document.createRange(), g = this.contentElement.lastChild || this.contentElement;
3661
- g.nodeType === Node.TEXT_NODE ? m.setStart(g, ((c = g.textContent) == null ? void 0 : c.length) || 0) : g.nodeType === Node.ELEMENT_NODE ? (m.selectNodeContents(g), m.collapse(!1)) : m.setStart(this.contentElement, 0), m.collapse(!0), f == null || f.removeAllRanges(), f == null || f.addRange(m);
3666
+ g.nodeType === Node.TEXT_NODE ? m.setStart(g, ((c = g.textContent) == null ? void 0 : c.length) || 0) : g.nodeType === Node.ELEMENT_NODE ? (m.selectNodeContents(g), m.collapse(!1)) : m.setStart(this.contentElement, 0), m.collapse(!0), p == null || p.removeAllRanges(), p == null || p.addRange(m);
3662
3667
  }
3663
3668
  }
3664
3669
  return this.executeCommand(r, l);
@@ -3672,8 +3677,8 @@ class gt extends HTMLElement {
3672
3677
  const r = document.createElement("div");
3673
3678
  r.innerHTML = e.trim(), !Array.from(r.childNodes).some((c) => {
3674
3679
  if (c.nodeType === Node.ELEMENT_NODE) {
3675
- const f = c.tagName;
3676
- return ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "UL", "OL", "BLOCKQUOTE", "PRE"].includes(f);
3680
+ const p = c.tagName;
3681
+ return ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "UL", "OL", "BLOCKQUOTE", "PRE"].includes(p);
3677
3682
  }
3678
3683
  return !1;
3679
3684
  }) && e.trim() ? this.contentElement.innerHTML = `<p>${e.trim()}</p>` : this.contentElement.innerHTML = e;
@@ -3713,41 +3718,41 @@ class gt extends HTMLElement {
3713
3718
  selectionCollapsed: (r = (i = window.getSelection()) == null ? void 0 : i.isCollapsed) != null ? r : !0
3714
3719
  });
3715
3720
  }), this.contentElement.addEventListener("input", (o) => {
3716
- var k;
3721
+ var T;
3717
3722
  if (!this.contentElement) return;
3718
3723
  let i = this.contentElement.innerHTML;
3719
- const r = (k = o == null ? void 0 : o.detail) == null ? void 0 : k.allowedTags, l = this.getPerformanceConfig(), c = this.getContentSanitizeConfig(), f = this.getSecurityConfig(), m = this.lastBeforeInputType;
3720
- if (this.lastBeforeInputType = null, f.sanitizeOnInput !== !1 && c.sanitize !== !1 && !m) {
3721
- const w = vo(i, c, f, r);
3722
- if (w !== i) {
3723
- const v = window.getSelection(), K = v && v.rangeCount > 0 ? v.getRangeAt(0) : null;
3724
- if (this.contentElement.innerHTML = w, K && v)
3724
+ 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;
3725
+ if (this.lastBeforeInputType = null, p.sanitizeOnInput !== !1 && c.sanitize !== !1 && !m) {
3726
+ const E = Eo(i, c, p, r);
3727
+ if (E !== i) {
3728
+ const k = window.getSelection(), tt = k && k.rangeCount > 0 ? k.getRangeAt(0) : null;
3729
+ if (this.contentElement.innerHTML = E, tt && k)
3725
3730
  try {
3726
- v.removeAllRanges(), v.addRange(K);
3727
- } catch (O) {
3731
+ k.removeAllRanges(), k.addRange(tt);
3732
+ } catch ($) {
3728
3733
  }
3729
- i = w;
3734
+ i = E;
3730
3735
  }
3731
3736
  }
3732
3737
  this.recordInputHistory(i), this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
3733
- const T = () => {
3738
+ const w = () => {
3734
3739
  this.dispatchEvent(new CustomEvent("content-change", {
3735
3740
  detail: { html: Io(i) },
3736
3741
  bubbles: !0
3737
3742
  }));
3738
3743
  };
3739
- l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(T, l.debounceInputMs) : T(), this.updateStatusBar();
3744
+ l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(w, l.debounceInputMs) : w(), this.updateStatusBar();
3740
3745
  }), this.contentElement.addEventListener("contextmenu", (o) => {
3741
3746
  const i = this.config.contextMenu;
3742
3747
  (i === !1 || typeof i == "object" && i !== null && i.enabled === !1) && o.preventDefault();
3743
3748
  }), this.contentElement.addEventListener("paste", (o) => {
3744
- var g, T;
3749
+ var g, w;
3745
3750
  if (o.__editoraSmartPasteHandled === !0 || o.defaultPrevented)
3746
3751
  return;
3747
3752
  o.preventDefault();
3748
3753
  const i = this.config.paste || {};
3749
3754
  let r = ((g = o.clipboardData) == null ? void 0 : g.getData("text/html")) || "";
3750
- const l = ((T = o.clipboardData) == null ? void 0 : T.getData("text/plain")) || "", c = this.getContentSanitizeConfig(), f = this.getSecurityConfig(), m = !!r && /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(r);
3755
+ const l = ((w = o.clipboardData) == null ? void 0 : w.getData("text/plain")) || "", c = this.getContentSanitizeConfig(), p = this.getSecurityConfig(), m = !!r && /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(r);
3751
3756
  if ((i.clean || !i.keepFormatting) && l) {
3752
3757
  document.execCommand("insertText", !1, l);
3753
3758
  return;
@@ -3757,15 +3762,15 @@ class gt extends HTMLElement {
3757
3762
  return;
3758
3763
  }
3759
3764
  if (r) {
3760
- f.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r = ri(r, c, f)), this.insertHTMLAtSelection(r);
3765
+ p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r = ri(r, c, p)), this.insertHTMLAtSelection(r);
3761
3766
  return;
3762
3767
  }
3763
3768
  l && document.execCommand("insertText", !1, l);
3764
3769
  }), this.contentElement.addEventListener("focus", () => {
3765
- J = this, this.dispatchEvent(new Event("editor-focus", { bubbles: !0 })), this.updateStatusBar();
3770
+ Q = this, this.dispatchEvent(new Event("editor-focus", { bubbles: !0 })), this.updateStatusBar();
3766
3771
  }), this.contentElement.addEventListener("blur", () => {
3767
3772
  this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.dispatchEvent(new CustomEvent("content-change", {
3768
- detail: { html: Ct(this.contentElement) },
3773
+ detail: { html: _t(this.contentElement) },
3769
3774
  bubbles: !0
3770
3775
  })), this.dispatchEvent(new Event("editor-blur", { bubbles: !0 })), this.updateFloatingToolbar(), this.updateStatusBar();
3771
3776
  }), this.contentElement.addEventListener("keydown", (o) => {
@@ -3847,14 +3852,14 @@ class gt extends HTMLElement {
3847
3852
  if (t.viewportOnlyScan && !this.isEditorInViewport() && !e)
3848
3853
  return;
3849
3854
  const o = this.contentElement.textContent || "", { words: i, chars: r } = yn(o), l = bn(this.contentElement);
3850
- let c, f;
3855
+ let c, p;
3851
3856
  const m = this.getSelectionRangeInEditor();
3852
- m && (c = mn(this.contentElement, m), m.collapsed || (f = En(m, c), c = void 0)), this.statusBar.update({
3857
+ m && (c = mn(this.contentElement, m), m.collapsed || (p = vn(m, c), c = void 0)), this.statusBar.update({
3853
3858
  wordCount: i,
3854
3859
  charCount: r,
3855
3860
  lineCount: l,
3856
3861
  cursorPosition: c,
3857
- selectionInfo: f
3862
+ selectionInfo: p
3858
3863
  });
3859
3864
  }
3860
3865
  /**
@@ -3942,7 +3947,7 @@ class gt extends HTMLElement {
3942
3947
  const o = this.attributes[e];
3943
3948
  t[o.name] = o.value;
3944
3949
  }
3945
- return ke.resolve({
3950
+ return xe.resolve({
3946
3951
  jsConfig: this.jsConfig,
3947
3952
  attributes: t
3948
3953
  });
@@ -3952,7 +3957,7 @@ class gt extends HTMLElement {
3952
3957
  */
3953
3958
  getAPI() {
3954
3959
  return {
3955
- getContent: () => Ct(this.contentElement),
3960
+ getContent: () => _t(this.contentElement),
3956
3961
  setContent: (t) => {
3957
3962
  this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
3958
3963
  },
@@ -3980,11 +3985,11 @@ class gt extends HTMLElement {
3980
3985
  */
3981
3986
  destroy() {
3982
3987
  var t, e, o, i;
3983
- this.buildGeneration += 1, this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent = Ct(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, xe.delete(this), J === this && (J = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
3988
+ 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), Q === this && (Q = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
3984
3989
  }
3985
3990
  // Public API methods
3986
3991
  getContent() {
3987
- return Ct(this.contentElement);
3992
+ return _t(this.contentElement);
3988
3993
  }
3989
3994
  setContent(t) {
3990
3995
  this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
@@ -4003,28 +4008,28 @@ class gt extends HTMLElement {
4003
4008
  }
4004
4009
  export {
4005
4010
  dn as C,
4006
- Kt as E,
4011
+ qt as E,
4007
4012
  fn as F,
4008
4013
  cn as K,
4009
4014
  Ao as P,
4010
- gt as R,
4015
+ yt as R,
4011
4016
  ln as S,
4012
4017
  pn as T,
4013
4018
  un as a,
4014
- ke as b,
4019
+ xe as b,
4015
4020
  li as c,
4016
4021
  hn as d,
4017
4022
  yn as e,
4018
4023
  bn as f,
4019
- bi as g,
4020
- Ct as h,
4024
+ yi as g,
4025
+ _t as h,
4021
4026
  mn as i,
4022
- En as j,
4027
+ vn as j,
4023
4028
  gn as k,
4024
- vo as l,
4029
+ Eo as l,
4025
4030
  ri as m,
4026
4031
  Io as n,
4027
- yi as o,
4032
+ vi as o,
4028
4033
  ii as s
4029
4034
  };
4030
- //# sourceMappingURL=index-B3zKYrPA.mjs.map
4035
+ //# sourceMappingURL=index-BIsub9gV.mjs.map