@editora/core 1.0.31 → 1.0.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@ class qt {
10
10
  return new qt(t, e || this.selection, this.schema);
11
11
  }
12
12
  }
13
- class ln {
13
+ class dn {
14
14
  constructor(t, e) {
15
15
  this.nodes = new Map(Object.entries(t)), this.marks = new Map(Object.entries(e));
16
16
  }
@@ -21,7 +21,7 @@ class ln {
21
21
  return { type: "text", text: t, marks: e };
22
22
  }
23
23
  }
24
- class Ao {
24
+ class So {
25
25
  constructor() {
26
26
  this.plugins = [], this.pluginConfigs = /* @__PURE__ */ new Map();
27
27
  }
@@ -58,7 +58,7 @@ class Ao {
58
58
  const t = {}, e = {};
59
59
  return this.plugins.forEach((o) => {
60
60
  o.nodes && Object.assign(t, o.nodes), o.marks && Object.assign(e, o.marks);
61
- }), new ln(t, e);
61
+ }), new dn(t, e);
62
62
  }
63
63
  getCommands() {
64
64
  const t = {};
@@ -112,10 +112,10 @@ class Ao {
112
112
  await Promise.all(t), this.plugins = [], this.pluginConfigs.clear();
113
113
  }
114
114
  }
115
- function vi() {
116
- return new Ao();
115
+ function Ti() {
116
+ return new So();
117
117
  }
118
- class cn {
118
+ class un {
119
119
  constructor(t) {
120
120
  this.shortcuts = /* @__PURE__ */ new Map(), this.enabled = !0, this.isMac = typeof navigator != "undefined" && navigator.platform.toUpperCase().indexOf("MAC") >= 0, (t == null ? void 0 : t.enabled) === !1 && (this.enabled = !1), this.registerDefaultShortcuts(), t != null && t.shortcuts && t.shortcuts.forEach((e) => this.registerShortcut(e)), t != null && t.customShortcuts && Object.values(t.customShortcuts).forEach((e) => {
121
121
  this.registerShortcut(e);
@@ -450,7 +450,7 @@ class cn {
450
450
  return t.includes("toggle") && (t.includes("Bold") || t.includes("Italic") || t.includes("Underline") || t.includes("Strike") || t.includes("Code") || t.includes("Super") || t.includes("Sub")) ? "Text Formatting" : t.includes("Heading") || t.includes("Paragraph") ? "Block Formatting" : t.includes("List") || t.includes("Checklist") ? "Lists" : t.includes("Alignment") || t.includes("Indent") ? "Alignment & Indentation" : t.includes("undo") || t.includes("redo") ? "History" : t.includes("insert") ? "Insert" : t.includes("find") || t.includes("replace") ? "Find & Replace" : t.includes("Accessibility") || t.includes("spell") ? "Tools" : "Other";
451
451
  }
452
452
  }
453
- class dn {
453
+ class fn {
454
454
  constructor(t = {}) {
455
455
  this.commands = /* @__PURE__ */ new Map(), Object.entries(t).forEach(([e, o]) => {
456
456
  this.register(e, o);
@@ -493,11 +493,11 @@ class dn {
493
493
  this.commands.clear();
494
494
  }
495
495
  }
496
- class un {
496
+ class pn {
497
497
  constructor(t = {}) {
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));
498
+ this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new So(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((o) => this.pluginManager.register(o));
499
499
  const e = this.pluginManager.buildSchema();
500
- this.state = qt.create(e), this.commandRegistry = new dn(this.pluginManager.getCommands());
500
+ this.state = qt.create(e), this.commandRegistry = new fn(this.pluginManager.getCommands());
501
501
  }
502
502
  /**
503
503
  * Execute a command
@@ -579,7 +579,7 @@ class un {
579
579
  return this.isDestroyed;
580
580
  }
581
581
  }
582
- class pn {
582
+ class hn {
583
583
  constructor(t, e, o) {
584
584
  this.overflowUnits = [], this.overflowUnitHomes = /* @__PURE__ */ new WeakMap(), this.expandedOpen = !1, this.onDocumentPointerDownForOverflow = (i) => {
585
585
  var l, c;
@@ -671,18 +671,18 @@ class pn {
671
671
  codeBlock: "insertCodeBlock"
672
672
  };
673
673
  return o.forEach((c) => {
674
- const p = [];
674
+ const f = [];
675
675
  c.split(/\s+/).filter(Boolean).forEach((g) => {
676
676
  if (g === "direction") {
677
- const E = r.get("setDirectionLTR"), k = r.get("setDirectionRTL");
678
- E && p.push({
677
+ const v = r.get("setDirectionLTR"), k = r.get("setDirectionRTL");
678
+ v && f.push({
679
679
  id: "directionLTR",
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({
680
+ label: v.label,
681
+ command: v.command,
682
+ icon: v.icon,
683
+ type: v.type || "button",
684
+ options: v.options
685
+ }), k && f.push({
686
686
  id: "directionRTL",
687
687
  label: k.label,
688
688
  command: k.command,
@@ -693,15 +693,15 @@ class pn {
693
693
  return;
694
694
  }
695
695
  if (g === "comments") {
696
- const E = r.get("addComment"), k = r.get("toggleComments");
697
- E && p.push({
696
+ const v = r.get("addComment"), k = r.get("toggleComments");
697
+ v && f.push({
698
698
  id: "addComment",
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({
699
+ label: v.label,
700
+ command: v.command,
701
+ icon: v.icon,
702
+ type: v.type || "button",
703
+ options: v.options
704
+ }), k && f.push({
705
705
  id: "toggleComments",
706
706
  label: k.label,
707
707
  command: k.command,
@@ -713,7 +713,7 @@ class pn {
713
713
  }
714
714
  const w = l[g] || g;
715
715
  let T = r.get(w);
716
- T || (T = r.get(g)), T && p.push({
716
+ T || (T = r.get(g)), T && f.push({
717
717
  id: g,
718
718
  label: T.label,
719
719
  command: T.command,
@@ -722,7 +722,7 @@ class pn {
722
722
  options: T.options,
723
723
  items: T.items
724
724
  });
725
- }), p.length > 0 && e.push(p);
725
+ }), f.length > 0 && e.push(f);
726
726
  }), e;
727
727
  }
728
728
  /**
@@ -741,13 +741,13 @@ 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((p) => {
745
- this.appendToolbarButton(c, p);
744
+ if (c.className = "editora-toolbar-group", r.forEach((f) => {
745
+ this.appendToolbarButton(c, f);
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 p = document.createElement("div");
750
- p.className = "editora-toolbar-separator", e.appendChild(p);
749
+ const f = document.createElement("div");
750
+ f.className = "editora-toolbar-separator", e.appendChild(f);
751
751
  }
752
752
  }), t.appendChild(e), this.setupOverflow(t);
753
753
  }
@@ -766,24 +766,24 @@ class pn {
766
766
  const c = this.overflowUnits;
767
767
  if (c.length === 0) return;
768
768
  c.forEach((B) => {
769
- var D;
770
- B.parentElement === i && ((D = this.overflowUnitHomes.get(B)) == null || D.appendChild(B));
769
+ var O;
770
+ B.parentElement === i && ((O = this.overflowUnitHomes.get(B)) == null || O.appendChild(B));
771
771
  });
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;
772
+ const f = t.clientWidth, m = 16, g = 40, w = 4, T = Math.max(0, f - m), v = Math.max(0, T - g - w), k = getComputedStyle(t).direction === "rtl", tt = e.getBoundingClientRect(), $ = (B) => {
773
+ const O = B.getBoundingClientRect();
774
+ return k ? tt.right - O.left : O.right - tt.left;
775
775
  };
776
776
  let z = 0;
777
777
  if ($(c[c.length - 1]) <= T)
778
778
  z = c.length;
779
779
  else
780
780
  for (const B of c)
781
- if ($(B) <= E) z++;
781
+ if ($(B) <= v) z++;
782
782
  else break;
783
783
  z = Math.max(1, Math.min(z, c.length));
784
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);
785
+ o.style.display = at ? "" : "none", o.classList.toggle("active", at && this.expandedOpen), !at && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((B, O) => {
786
+ O >= z && i.appendChild(B);
787
787
  });
788
788
  }, l = () => {
789
789
  this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), this.overflowRafId = requestAnimationFrame(r);
@@ -878,9 +878,9 @@ class pn {
878
878
  e.setAttribute("aria-expanded", l() ? "true" : "false");
879
879
  });
880
880
  c.observe(o, { attributes: !0, attributeFilter: ["style"] });
881
- const p = t._cleanupDropdown;
881
+ const f = t._cleanupDropdown;
882
882
  t._cleanupDropdown = () => {
883
- c.disconnect(), p == null || p();
883
+ c.disconnect(), f == null || f();
884
884
  }, e.addEventListener("click", (m) => {
885
885
  var g;
886
886
  m.detail === 0 && l() && ((g = r()[0]) == null || g.focus());
@@ -893,8 +893,8 @@ class pn {
893
893
  }), o.addEventListener("keydown", (m) => {
894
894
  const g = r();
895
895
  if (g.length === 0) return;
896
- const w = g.indexOf(document.activeElement), T = (E) => {
897
- m.preventDefault(), g[(E + g.length) % g.length].focus();
896
+ const w = g.indexOf(document.activeElement), T = (v) => {
897
+ m.preventDefault(), g[(v + g.length) % g.length].focus();
898
898
  };
899
899
  switch (m.key) {
900
900
  case "ArrowDown":
@@ -924,14 +924,14 @@ class pn {
924
924
  o.className = "editora-toolbar-button editora-toolbar-dropdown-trigger", o.type = "button", o.textContent = t.label;
925
925
  const i = document.createElement("div");
926
926
  i.className = "editora-toolbar-dropdown-menu", i.style.display = "none", t.options && t.options.forEach((c) => {
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) => {
927
+ const f = document.createElement("button");
928
+ f.className = "editora-toolbar-dropdown-item", f.type = "button", f.textContent = c.label, f.setAttribute("data-value", c.value), f.addEventListener("click", (m) => {
929
929
  m.preventDefault(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), i.style.display = "none";
930
- }), i.appendChild(p);
930
+ }), i.appendChild(f);
931
931
  }), o.addEventListener("click", (c) => {
932
932
  c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
933
- const p = i.style.display === "block";
934
- i.style.display = p ? "none" : "block";
933
+ const f = i.style.display === "block";
934
+ i.style.display = f ? "none" : "block";
935
935
  });
936
936
  const r = (c) => {
937
937
  e.contains(c.target) || (i.style.display = "none");
@@ -959,17 +959,17 @@ class pn {
959
959
  o.textContent = t.label;
960
960
  const i = document.createElement("div");
961
961
  i.className = "editora-toolbar-dropdown-menu", i.style.display = "none", t.options && t.options.forEach((c) => {
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) => {
962
+ const f = document.createElement("button");
963
+ f.className = "editora-toolbar-dropdown-item", f.type = "button", f.textContent = c.label, f.setAttribute("data-value", c.value), f.addEventListener("click", (m) => {
964
964
  m.preventDefault(), m.stopPropagation(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), i.style.display = "none";
965
- }), i.appendChild(p);
965
+ }), i.appendChild(f);
966
966
  }), o.addEventListener("click", (c) => {
967
967
  var m;
968
968
  c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
969
- const p = (m = this.container) == null ? void 0 : m.querySelectorAll(
969
+ const f = (m = this.container) == null ? void 0 : m.querySelectorAll(
970
970
  ".editora-toolbar-dropdown-menu"
971
971
  );
972
- p == null || p.forEach((g) => {
972
+ f == null || f.forEach((g) => {
973
973
  g !== i && (g.style.display = "none");
974
974
  }), i.style.display = i.style.display === "none" ? "block" : "none";
975
975
  });
@@ -1009,7 +1009,7 @@ class pn {
1009
1009
  }), this.container.innerHTML = ""), (t = this.resizeObserver) == null || t.disconnect(), this.resizeObserver = void 0, this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), document.removeEventListener("mousedown", this.onDocumentPointerDownForOverflow, !0), this.itemsContainer = void 0, this.moreButton = void 0, this.expandedRow = void 0, this.commandHandler = void 0;
1010
1010
  }
1011
1011
  }
1012
- class fn {
1012
+ class mn {
1013
1013
  constructor(t) {
1014
1014
  this.visible = !1, this.config = t;
1015
1015
  }
@@ -1051,7 +1051,7 @@ class fn {
1051
1051
  this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0, this.visible = !1;
1052
1052
  }
1053
1053
  }
1054
- class hn {
1054
+ class gn {
1055
1055
  constructor(t = {}) {
1056
1056
  this.statusInfo = {}, this.config = t;
1057
1057
  }
@@ -1093,14 +1093,14 @@ class hn {
1093
1093
  }), o.forEach((r, l) => {
1094
1094
  const c = document.createElement("span");
1095
1095
  if (c.className = "editora-statusbar-item", c.textContent = r, t.appendChild(c), l < o.length - 1) {
1096
- const p = document.createElement("span");
1097
- p.className = "editora-statusbar-separator", p.textContent = "|", t.appendChild(p);
1096
+ const f = document.createElement("span");
1097
+ f.className = "editora-statusbar-separator", f.textContent = "|", t.appendChild(f);
1098
1098
  }
1099
1099
  }), i.forEach((r, l) => {
1100
1100
  const c = document.createElement("span");
1101
1101
  if (c.className = "editora-statusbar-item", c.textContent = r, e.appendChild(c), l < i.length - 1) {
1102
- const p = document.createElement("span");
1103
- p.className = "editora-statusbar-separator", p.textContent = "|", e.appendChild(p);
1102
+ const f = document.createElement("span");
1103
+ f.className = "editora-statusbar-separator", f.textContent = "|", e.appendChild(f);
1104
1104
  }
1105
1105
  }), this.container.appendChild(t), this.container.appendChild(e);
1106
1106
  }
@@ -1111,16 +1111,16 @@ class hn {
1111
1111
  this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0;
1112
1112
  }
1113
1113
  }
1114
- function mn(s, t) {
1115
- const e = s.textContent || "", o = gn(s, t.startContainer, t.startOffset), r = e.substring(0, o).split(`
1114
+ function bn(a, t) {
1115
+ const e = a.textContent || "", o = yn(a, t.startContainer, t.startOffset), r = e.substring(0, o).split(`
1116
1116
  `), l = r.length, c = r[r.length - 1].length + 1;
1117
1117
  return { line: l, column: c };
1118
1118
  }
1119
- function gn(s, t, e) {
1119
+ function yn(a, t, e) {
1120
1120
  var l;
1121
1121
  let o = 0;
1122
1122
  const i = document.createTreeWalker(
1123
- s,
1123
+ a,
1124
1124
  NodeFilter.SHOW_TEXT,
1125
1125
  null
1126
1126
  );
@@ -1134,27 +1134,27 @@ function gn(s, t, e) {
1134
1134
  }
1135
1135
  return o;
1136
1136
  }
1137
- function bn(s) {
1137
+ function En(a) {
1138
1138
  var o, i;
1139
- const t = s.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");
1139
+ const t = a.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");
1140
1140
  let e = 1;
1141
1141
  if (t.length > 0) {
1142
1142
  e = t.length;
1143
1143
  const r = t[t.length - 1];
1144
1144
  (r.tagName === "BR" || ((o = r.innerHTML) == null ? void 0 : o.trim()) === "" || ((i = r.textContent) == null ? void 0 : i.trim()) === "") && e++;
1145
1145
  } else {
1146
- const l = (s.textContent || "").split(`
1146
+ const l = (a.textContent || "").split(`
1147
1147
  `).length;
1148
1148
  e = Math.max(1, l);
1149
1149
  }
1150
1150
  return e;
1151
1151
  }
1152
- function yn(s) {
1153
- const t = s.trim() ? s.trim().split(/\s+/).length : 0, e = s.length;
1152
+ function vn(a) {
1153
+ const t = a.trim() ? a.trim().split(/\s+/).length : 0, e = a.length;
1154
1154
  return { words: t, chars: e };
1155
1155
  }
1156
- function vn(s, t) {
1157
- const e = s.toString();
1156
+ function wn(a, t) {
1157
+ const e = a.toString();
1158
1158
  return {
1159
1159
  startLine: t.line,
1160
1160
  startColumn: t.column,
@@ -1165,25 +1165,25 @@ function vn(s, t) {
1165
1165
  selectedWords: e.trim().split(/\s+/).filter(Boolean).length
1166
1166
  };
1167
1167
  }
1168
- function io(s, t) {
1169
- (t == null || t > s.length) && (t = s.length);
1170
- for (var e = 0, o = Array(t); e < t; e++) o[e] = s[e];
1168
+ function ro(a, t) {
1169
+ (t == null || t > a.length) && (t = a.length);
1170
+ for (var e = 0, o = Array(t); e < t; e++) o[e] = a[e];
1171
1171
  return o;
1172
1172
  }
1173
- function En(s) {
1174
- if (Array.isArray(s)) return s;
1173
+ function Tn(a) {
1174
+ if (Array.isArray(a)) return a;
1175
1175
  }
1176
- function wn(s, t) {
1177
- var e = s == null ? null : typeof Symbol != "undefined" && s[Symbol.iterator] || s["@@iterator"];
1176
+ function kn(a, t) {
1177
+ var e = a == null ? null : typeof Symbol != "undefined" && a[Symbol.iterator] || a["@@iterator"];
1178
1178
  if (e != null) {
1179
- var o, i, r, l, c = [], p = !0, m = !1;
1179
+ var o, i, r, l, c = [], f = !0, m = !1;
1180
1180
  try {
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) ;
1181
+ if (r = (e = e.call(a)).next, t !== 0) for (; !(f = (o = r.call(e)).done) && (c.push(o.value), c.length !== t); f = !0) ;
1182
1182
  } catch (g) {
1183
1183
  m = !0, i = g;
1184
1184
  } finally {
1185
1185
  try {
1186
- if (!p && e.return != null && (l = e.return(), Object(l) !== l)) return;
1186
+ if (!f && e.return != null && (l = e.return(), Object(l) !== l)) return;
1187
1187
  } finally {
1188
1188
  if (m) throw i;
1189
1189
  }
@@ -1191,122 +1191,122 @@ function wn(s, t) {
1191
1191
  return c;
1192
1192
  }
1193
1193
  }
1194
- function Tn() {
1194
+ function xn() {
1195
1195
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1196
1196
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1197
1197
  }
1198
- function kn(s, t) {
1199
- return En(s) || wn(s, t) || xn(s, t) || Tn();
1198
+ function An(a, t) {
1199
+ return Tn(a) || kn(a, t) || Cn(a, t) || xn();
1200
1200
  }
1201
- function xn(s, t) {
1202
- if (s) {
1203
- if (typeof s == "string") return io(s, t);
1204
- var e = {}.toString.call(s).slice(8, -1);
1205
- return e === "Object" && s.constructor && (e = s.constructor.name), e === "Map" || e === "Set" ? Array.from(s) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? io(s, t) : void 0;
1201
+ function Cn(a, t) {
1202
+ if (a) {
1203
+ if (typeof a == "string") return ro(a, t);
1204
+ var e = {}.toString.call(a).slice(8, -1);
1205
+ return e === "Object" && a.constructor && (e = a.constructor.name), e === "Map" || e === "Set" ? Array.from(a) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? ro(a, t) : void 0;
1206
1206
  }
1207
1207
  }
1208
- const Co = Object.entries, ro = Object.setPrototypeOf, An = Object.isFrozen, Cn = Object.getPrototypeOf, Sn = Object.getOwnPropertyDescriptor;
1209
- let M = Object.freeze, I = Object.seal, bt = Object.create, So = typeof Reflect != "undefined" && Reflect, Te = So.apply, ke = So.construct;
1208
+ const _o = Object.entries, ao = Object.setPrototypeOf, Sn = Object.isFrozen, _n = Object.getPrototypeOf, Ln = Object.getOwnPropertyDescriptor;
1209
+ let M = Object.freeze, D = Object.seal, yt = Object.create, Lo = typeof Reflect != "undefined" && Reflect, ke = Lo.apply, xe = Lo.construct;
1210
1210
  M || (M = function(t) {
1211
1211
  return t;
1212
1212
  });
1213
- I || (I = function(t) {
1213
+ D || (D = function(t) {
1214
1214
  return t;
1215
1215
  });
1216
- Te || (Te = function(t, e) {
1216
+ ke || (ke = function(t, e) {
1217
1217
  for (var o = arguments.length, i = new Array(o > 2 ? o - 2 : 0), r = 2; r < o; r++) i[r - 2] = arguments[r];
1218
1218
  return t.apply(e, i);
1219
1219
  });
1220
- ke || (ke = function(t) {
1220
+ xe || (xe = function(t) {
1221
1221
  for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
1222
1222
  return new t(...o);
1223
1223
  });
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);
1225
- function L(s) {
1224
+ const rt = L(Array.prototype.forEach), Mn = L(Array.prototype.lastIndexOf), so = L(Array.prototype.pop), Ct = L(Array.prototype.push), Dn = L(Array.prototype.splice), vt = Array.isArray, Mt = L(String.prototype.toLowerCase), he = L(String.prototype.toString), lo = L(String.prototype.match), St = L(String.prototype.replace), co = L(String.prototype.indexOf), In = L(String.prototype.trim), On = L(Number.prototype.toString), Rn = L(Boolean.prototype.toString), uo = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), fo = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), P = L(Object.prototype.hasOwnProperty), _t = L(Object.prototype.toString), I = L(RegExp.prototype.test), Q = Nn(TypeError);
1225
+ function L(a) {
1226
1226
  return function(t) {
1227
1227
  t instanceof RegExp && (t.lastIndex = 0);
1228
1228
  for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
1229
- return Te(s, t, o);
1229
+ return ke(a, t, o);
1230
1230
  };
1231
1231
  }
1232
- function Dn(s) {
1232
+ function Nn(a) {
1233
1233
  return function() {
1234
1234
  for (var t = arguments.length, e = new Array(t), o = 0; o < t; o++) e[o] = arguments[o];
1235
- return ke(s, e);
1235
+ return xe(a, e);
1236
1236
  };
1237
1237
  }
1238
- function v(s, t) {
1238
+ function E(a, t) {
1239
1239
  let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Mt;
1240
- if (ro && ro(s, null), !vt(t)) return s;
1240
+ if (ao && ao(a, null), !vt(t)) return a;
1241
1241
  let o = t.length;
1242
1242
  for (; o--; ) {
1243
1243
  let i = t[o];
1244
1244
  if (typeof i == "string") {
1245
1245
  const r = e(i);
1246
- r !== i && (An(t) || (t[o] = r), i = r);
1246
+ r !== i && (Sn(t) || (t[o] = r), i = r);
1247
1247
  }
1248
- s[i] = !0;
1248
+ a[i] = !0;
1249
1249
  }
1250
- return s;
1250
+ return a;
1251
1251
  }
1252
- function Rn(s) {
1253
- for (let t = 0; t < s.length; t++) P(s, t) || (s[t] = null);
1254
- return s;
1252
+ function Pn(a) {
1253
+ for (let t = 0; t < a.length; t++) P(a, t) || (a[t] = null);
1254
+ return a;
1255
1255
  }
1256
- function U(s) {
1257
- const t = bt(null);
1258
- for (const o of Co(s)) {
1259
- var e = kn(o, 2);
1256
+ function U(a) {
1257
+ const t = yt(null);
1258
+ for (const o of _o(a)) {
1259
+ var e = An(o, 2);
1260
1260
  const i = e[0], r = e[1];
1261
- P(s, i) && (vt(r) ? t[i] = Rn(r) : r && typeof r == "object" && r.constructor === Object ? t[i] = U(r) : t[i] = r);
1261
+ P(a, i) && (vt(r) ? t[i] = Pn(r) : r && typeof r == "object" && r.constructor === Object ? t[i] = U(r) : t[i] = r);
1262
1262
  }
1263
1263
  return t;
1264
1264
  }
1265
- function Nn(s) {
1266
- switch (typeof s) {
1265
+ function zn(a) {
1266
+ switch (typeof a) {
1267
1267
  case "string":
1268
- return s;
1268
+ return a;
1269
1269
  case "number":
1270
- return In(s);
1270
+ return On(a);
1271
1271
  case "boolean":
1272
- return On(s);
1272
+ return Rn(a);
1273
1273
  case "bigint":
1274
- return co ? co(s) : "0";
1274
+ return uo ? uo(a) : "0";
1275
1275
  case "symbol":
1276
- return uo ? uo(s) : "Symbol()";
1276
+ return fo ? fo(a) : "Symbol()";
1277
1277
  case "undefined":
1278
- return St(s);
1278
+ return _t(a);
1279
1279
  case "function":
1280
1280
  case "object": {
1281
- if (s === null) return St(s);
1282
- const t = s, e = W(t, "toString");
1281
+ if (a === null) return _t(a);
1282
+ const t = a, e = W(t, "toString");
1283
1283
  if (typeof e == "function") {
1284
1284
  const o = e(t);
1285
- return typeof o == "string" ? o : St(o);
1285
+ return typeof o == "string" ? o : _t(o);
1286
1286
  }
1287
- return St(s);
1287
+ return _t(a);
1288
1288
  }
1289
1289
  default:
1290
- return St(s);
1290
+ return _t(a);
1291
1291
  }
1292
1292
  }
1293
- function W(s, t) {
1294
- for (; s !== null; ) {
1295
- const o = Sn(s, t);
1293
+ function W(a, t) {
1294
+ for (; a !== null; ) {
1295
+ const o = Ln(a, t);
1296
1296
  if (o) {
1297
1297
  if (o.get) return L(o.get);
1298
1298
  if (typeof o.value == "function") return L(o.value);
1299
1299
  }
1300
- s = Cn(s);
1300
+ a = _n(a);
1301
1301
  }
1302
1302
  function e() {
1303
1303
  return null;
1304
1304
  }
1305
1305
  return e;
1306
1306
  }
1307
- function Pn(s) {
1307
+ function Bn(a) {
1308
1308
  try {
1309
- return O(s, ""), !0;
1309
+ return I(a, ""), !0;
1310
1310
  } catch (t) {
1311
1311
  return !1;
1312
1312
  }
@@ -1505,7 +1505,7 @@ const po = M([
1505
1505
  "feSpotLight",
1506
1506
  "feTile",
1507
1507
  "feTurbulence"
1508
- ]), zn = M([
1508
+ ]), Hn = M([
1509
1509
  "animate",
1510
1510
  "color-profile",
1511
1511
  "cursor",
@@ -1559,7 +1559,7 @@ const po = M([
1559
1559
  "munder",
1560
1560
  "munderover",
1561
1561
  "mprescripts"
1562
- ]), Bn = M([
1562
+ ]), Fn = M([
1563
1563
  "maction",
1564
1564
  "maligngroup",
1565
1565
  "malignmark",
@@ -1575,7 +1575,7 @@ const po = M([
1575
1575
  "annotation-xml",
1576
1576
  "mprescripts",
1577
1577
  "none"
1578
- ]), fo = M(["#text"]), ho = M([
1578
+ ]), ho = M(["#text"]), mo = M([
1579
1579
  "accept",
1580
1580
  "action",
1581
1581
  "align",
@@ -1887,7 +1887,7 @@ const po = M([
1887
1887
  "y2",
1888
1888
  "z",
1889
1889
  "zoomandpan"
1890
- ]), mo = M([
1890
+ ]), go = M([
1891
1891
  "accent",
1892
1892
  "accentunder",
1893
1893
  "align",
@@ -1948,7 +1948,7 @@ const po = M([
1948
1948
  "xlink:title",
1949
1949
  "xml:space",
1950
1950
  "xmlns:xlink"
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 = {
1951
+ ]), Un = D(/{{[\w\W]*|^[\w\W]*}}/g), jn = D(/<%[\w\W]*|^[\w\W]*%>/g), Wn = D(/\${[\w\W]*/g), $n = D(/^data-[\-\w.\u00B7-\uFFFF]+$/), Gn = D(/^aria-[\-\w]+$/), bo = D(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Kn = D(/^(?:\w+script|data):/i), Yn = D(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), qn = D(/^html$/i), Vn = D(/^[a-z][.\w]*(-[.\w]+)+$/i), yo = D(/<[/\w!]/g), Eo = D(/<[/\w]/g), Xn = D(/<\/no(script|embed|frames)/i), Qn = D(/\/>/i), F = {
1952
1952
  element: 1,
1953
1953
  attribute: 2,
1954
1954
  text: 3,
@@ -1961,7 +1961,7 @@ const po = M([
1961
1961
  documentType: 10,
1962
1962
  documentFragment: 11,
1963
1963
  notation: 12
1964
- }, _o = [
1964
+ }, Mo = [
1965
1965
  "style",
1966
1966
  "script",
1967
1967
  "xmp",
@@ -1970,14 +1970,14 @@ const po = M([
1970
1970
  "noframes",
1971
1971
  "plaintext",
1972
1972
  "noscript"
1973
- ], Xn = M(v({}, _o)), Zn = (function() {
1974
- const s = {};
1975
- return rt(_o, (t) => {
1976
- s[t] = I(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
1977
- }), M(s);
1978
- })(), Jn = function() {
1973
+ ], Zn = M(E({}, Mo)), Jn = (function() {
1974
+ const a = {};
1975
+ return rt(Mo, (t) => {
1976
+ a[t] = D(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
1977
+ }), M(a);
1978
+ })(), ti = function() {
1979
1979
  return typeof window == "undefined" ? null : window;
1980
- }, Qn = function(t, e) {
1980
+ }, ei = function(t, e) {
1981
1981
  if (typeof t != "object" || typeof t.createPolicy != "function") return null;
1982
1982
  let o = null;
1983
1983
  const i = "data-tt-policy-suffix";
@@ -2007,24 +2007,24 @@ const po = M([
2007
2007
  uponSanitizeElement: [],
2008
2008
  uponSanitizeShadowNode: []
2009
2009
  };
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) {
2010
+ }, Z = function(t, e, o, i) {
2011
+ return P(t, e) && vt(t[e]) ? E(i.base ? U(i.base) : {}, t[e], i.transform) : o;
2012
+ }, Ee = function(t, e, o) {
2013
2013
  const i = P(t, e) ? t[e] : void 0;
2014
2014
  return i && typeof i == "object" ? U(i) : o();
2015
2015
  };
2016
- function Lo() {
2017
- let s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Jn();
2018
- const t = (u) => Lo(u);
2019
- if (t.version = "3.4.16", t.removed = [], !s || !s.document || s.document.nodeType !== F.document || !s.Element)
2016
+ function Do() {
2017
+ let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ti();
2018
+ const t = (u) => Do(u);
2019
+ if (t.version = "3.4.16", t.removed = [], !a || !a.document || a.document.nodeType !== F.document || !a.Element)
2020
2020
  return t.isSupported = !1, t;
2021
- let e = s.document;
2021
+ let e = a.document;
2022
2022
  const o = e, i = o.currentScript;
2023
- s.DocumentFragment;
2024
- const r = s.HTMLTemplateElement, l = s.Node, c = s.Element, p = s.NodeFilter;
2025
- s.NamedNodeMap === void 0 && (s.NamedNodeMap || s.MozNamedAttrMap), s.HTMLFormElement;
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;
2023
+ a.DocumentFragment;
2024
+ const r = a.HTMLTemplateElement, l = a.Node, c = a.Element, f = a.NodeFilter;
2025
+ a.NamedNodeMap === void 0 && (a.NamedNodeMap || a.MozNamedAttrMap), a.HTMLFormElement;
2026
+ const m = a.DOMParser, g = a.trustedTypes, w = c.prototype, T = W(w, "cloneNode"), v = 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"), O = l && l.prototype ? W(l.prototype, "nodeType") : null, st = l && l.prototype ? W(l.prototype, "nodeName") : null, Dt = l && l.prototype ? W(l.prototype, "ownerDocument") : null, wt = function(n) {
2027
+ return O ? O(n) : n.nodeType;
2028
2028
  }, Xt = function(n) {
2029
2029
  return st ? st(n) : n.nodeName;
2030
2030
  };
@@ -2032,45 +2032,45 @@ function Lo() {
2032
2032
  const u = e.createElement("template");
2033
2033
  u.content && u.content.ownerDocument && (e = u.content.ownerDocument);
2034
2034
  }
2035
- let N, et = "", Zt, Ce = !1, wt = 0;
2036
- const Se = function() {
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.');
2035
+ let N, et = "", Qt, Se = !1, Tt = 0;
2036
+ const _e = function() {
2037
+ if (Tt > 0) throw Q('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
2038
  }, lt = function(n) {
2039
- Se(), wt++;
2039
+ _e(), Tt++;
2040
2040
  try {
2041
2041
  return N.createHTML(n);
2042
2042
  } finally {
2043
- wt--;
2043
+ Tt--;
2044
2044
  }
2045
- }, Do = function(n) {
2046
- Se(), wt++;
2045
+ }, No = function(n) {
2046
+ _e(), Tt++;
2047
2047
  try {
2048
2048
  return N.createScriptURL(n);
2049
2049
  } finally {
2050
- wt--;
2050
+ Tt--;
2051
2051
  }
2052
- }, Ro = function() {
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;
2052
+ }, Po = function() {
2053
+ return Se || (Qt = ei(g, i), Se = !0), Qt;
2054
+ }, It = e, Zt = It.implementation, Le = It.createNodeIterator, zo = It.createDocumentFragment, Bo = It.getElementsByTagName, Ho = o.importNode;
2055
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;
2058
- let Me = go, A = null;
2059
- const Qt = v({}, [
2056
+ t.isSupported = typeof _o == "function" && typeof z == "function" && Zt && Zt.createHTMLDocument !== void 0;
2057
+ const Fo = Un, Uo = jn, jo = Wn, Wo = $n, $o = Gn, Go = Kn, Me = Yn, Ko = Vn;
2058
+ let De = bo, A = null;
2059
+ const Jt = E({}, [
2060
2060
  ...po,
2061
2061
  ...me,
2062
2062
  ...ge,
2063
2063
  ...be,
2064
- ...fo
2064
+ ...ho
2065
2065
  ]);
2066
2066
  let C = null;
2067
- const te = v({}, [
2068
- ...ho,
2069
- ...ye,
2067
+ const te = E({}, [
2070
2068
  ...mo,
2069
+ ...ye,
2070
+ ...go,
2071
2071
  ...Gt
2072
2072
  ]);
2073
- let G = Object.seal(bt(null, {
2073
+ let G = Object.seal(yt(null, {
2074
2074
  tagNameCheck: {
2075
2075
  writable: !0,
2076
2076
  configurable: !1,
@@ -2089,8 +2089,8 @@ function Lo() {
2089
2089
  enumerable: !0,
2090
2090
  value: !1
2091
2091
  }
2092
- })), Tt = null, Ie = null;
2093
- const q = Object.seal(bt(null, {
2092
+ })), kt = null, Ie = null;
2093
+ const q = Object.seal(yt(null, {
2094
2094
  tagCheck: {
2095
2095
  writable: !0,
2096
2096
  configurable: !1,
@@ -2104,10 +2104,10 @@ function Lo() {
2104
2104
  value: null
2105
2105
  }
2106
2106
  }));
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;
2108
- const ze = "user-content-";
2107
+ let Oe = !0, ee = !0, Re = !1, Ne = !0, V = !1, ot = !0, nt = !1, oe = !1, Ot = null, Rt = null, ne = !1, ct = !1, Nt = !1, Pt = !1, Pe = !0, ze = !1;
2108
+ const Be = "user-content-";
2109
2109
  let ie = !0, re = !1, dt = {}, ut = null;
2110
- const Be = v({}, [
2110
+ const He = E({}, [
2111
2111
  "annotation-xml",
2112
2112
  "audio",
2113
2113
  "colgroup",
@@ -2135,8 +2135,8 @@ function Lo() {
2135
2135
  "video",
2136
2136
  "xmp"
2137
2137
  ]);
2138
- let He = null;
2139
- const Fe = v({}, [
2138
+ let Fe = null;
2139
+ const Ue = E({}, [
2140
2140
  "audio",
2141
2141
  "video",
2142
2142
  "img",
@@ -2144,8 +2144,8 @@ function Lo() {
2144
2144
  "image",
2145
2145
  "track"
2146
2146
  ]);
2147
- let Ue = null;
2148
- const je = v({}, [
2147
+ let je = null;
2148
+ const We = E({}, [
2149
2149
  "alt",
2150
2150
  "class",
2151
2151
  "for",
@@ -2161,89 +2161,89 @@ function Lo() {
2161
2161
  "style",
2162
2162
  "xmlns"
2163
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({}, [
2164
+ let ft = K, ae = !1, se = null;
2165
+ const Yo = E({}, [
2166
2166
  zt,
2167
2167
  Bt,
2168
2168
  K
2169
- ], he), We = M([
2169
+ ], he), $e = M([
2170
2170
  "mi",
2171
2171
  "mo",
2172
2172
  "mn",
2173
2173
  "ms",
2174
2174
  "mtext"
2175
2175
  ]);
2176
- let le = v({}, We);
2177
- const $e = M(["annotation-xml"]);
2178
- let ce = v({}, $e);
2179
- const Ko = v({}, [
2176
+ let le = E({}, $e);
2177
+ const Ge = M(["annotation-xml"]);
2178
+ let ce = E({}, Ge);
2179
+ const qo = E({}, [
2180
2180
  "title",
2181
2181
  "style",
2182
2182
  "font",
2183
2183
  "a",
2184
2184
  "script"
2185
2185
  ]);
2186
- let kt = null;
2187
- const Yo = ["application/xhtml+xml", "text/html"], qo = "text/html";
2188
- let _ = null, ft = null;
2189
- const Vo = e.createElement("form"), Ge = function(n) {
2186
+ let xt = null;
2187
+ const Vo = ["application/xhtml+xml", "text/html"], Xo = "text/html";
2188
+ let _ = null, pt = null;
2189
+ const Qo = e.createElement("form"), Ke = function(n) {
2190
2190
  return n instanceof RegExp || n instanceof Function;
2191
2191
  }, de = function() {
2192
2192
  let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
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, {
2193
+ if (pt && pt === n) return;
2194
+ (!n || typeof n != "object") && (n = {}), n = U(n), xt = Vo.indexOf(n.PARSER_MEDIA_TYPE) === -1 ? Xo : n.PARSER_MEDIA_TYPE, _ = xt === "application/xhtml+xml" ? he : Mt, A = Z(n, "ALLOWED_TAGS", Jt, { transform: _ }), C = Z(n, "ALLOWED_ATTR", te, { transform: _ }), se = Z(n, "ALLOWED_NAMESPACES", Yo, { transform: he }), je = Z(n, "ADD_URI_SAFE_ATTR", We, {
2195
2195
  transform: _,
2196
- base: je
2197
- }), He = J(n, "ADD_DATA_URI_TAGS", Fe, {
2196
+ base: We
2197
+ }), Fe = Z(n, "ADD_DATA_URI_TAGS", Ue, {
2198
2198
  transform: _,
2199
- base: Fe
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, [
2199
+ base: Ue
2200
+ }), ut = Z(n, "FORBID_CONTENTS", He, { transform: _ }), kt = Z(n, "FORBID_TAGS", U({}), { transform: _ }), Ie = Z(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, Re = n.ALLOW_UNKNOWN_PROTOCOLS || !1, Ne = 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, Pe = n.SANITIZE_DOM !== !1, ze = n.SANITIZE_NAMED_PROPS || !1, ie = n.KEEP_CONTENT !== !1, re = n.IN_PLACE || !1, De = Bn(n.ALLOWED_URI_REGEXP) ? n.ALLOWED_URI_REGEXP : bo, ft = typeof n.NAMESPACE == "string" ? n.NAMESPACE : K, le = Ee(n, "MATHML_TEXT_INTEGRATION_POINTS", () => E({}, $e)), ce = Ee(n, "HTML_INTEGRATION_POINTS", () => E({}, Ge));
2201
+ const s = Ee(n, "CUSTOM_ELEMENT_HANDLING", () => yt(null));
2202
+ if (G = yt(null), P(s, "tagNameCheck") && Ke(s.tagNameCheck) && (G.tagNameCheck = s.tagNameCheck), P(s, "attributeNameCheck") && Ke(s.attributeNameCheck) && (G.attributeNameCheck = s.attributeNameCheck), P(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && (G.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), D(G), V && (ee = !1), Nt && (ct = !0), dt && (A = E({}, ho), C = yt(null), dt.html === !0 && (E(A, po), E(C, mo)), dt.svg === !0 && (E(A, me), E(C, ye), E(C, Gt)), dt.svgFilters === !0 && (E(A, ge), E(C, ye), E(C, Gt)), dt.mathMl === !0 && (E(A, be), E(C, go), E(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 === Jt && (A = U(A)), E(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)), E(C, n.ADD_ATTR, _))), P(n, "ADD_FORBID_CONTENTS") && vt(n.ADD_FORBID_CONTENTS) && (ut === He && (ut = U(ut)), E(ut, n.ADD_FORBID_CONTENTS, _)), ie && (A["#text"] = !0), nt && E(A, [
2203
2203
  "html",
2204
2204
  "head",
2205
2205
  "body"
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.');
2206
+ ]), A.table && (E(A, ["tbody"]), delete kt.tbody), n.TRUSTED_TYPES_POLICY) {
2207
+ if (typeof n.TRUSTED_TYPES_POLICY.createHTML != "function") throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
2208
+ if (typeof n.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
2209
2209
  const d = N;
2210
2210
  N = n.TRUSTED_TYPES_POLICY;
2211
2211
  try {
2212
2212
  et = lt("");
2213
- } catch (f) {
2214
- throw N = d, f;
2213
+ } catch (p) {
2214
+ throw N = d, p;
2215
2215
  }
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({}, [
2216
+ } else n.TRUSTED_TYPES_POLICY === null ? (N = void 0, et = "") : (N === void 0 && (N = Po()), N && typeof et == "string" && (et = lt("")));
2217
+ M && M(n), pt = n;
2218
+ }, Ye = E({}, [
2219
2219
  ...me,
2220
2220
  ...ge,
2221
- ...zn
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];
2224
- }, Zo = function(n, a, d) {
2225
- return a.namespaceURI === K ? n === "math" : a.namespaceURI === Bt ? n === "math" && ce[d] : !!Ye[n];
2226
- }, Jo = function(n, a, d) {
2227
- return a.namespaceURI === Bt && !ce[d] || a.namespaceURI === zt && !le[d] ? !1 : !Ye[n] && (Ko[n] || !Ke[n]);
2228
- }, Qo = function(n) {
2229
- let a = z(n);
2230
- (!a || !a.tagName) && (a = {
2231
- namespaceURI: pt,
2221
+ ...Hn
2222
+ ]), qe = E({}, [...be, ...Fn]), Zo = function(n, s, d) {
2223
+ return s.namespaceURI === K ? n === "svg" : s.namespaceURI === zt ? n === "svg" && (d === "annotation-xml" || le[d]) : !!Ye[n];
2224
+ }, Jo = function(n, s, d) {
2225
+ return s.namespaceURI === K ? n === "math" : s.namespaceURI === Bt ? n === "math" && ce[d] : !!qe[n];
2226
+ }, tn = function(n, s, d) {
2227
+ return s.namespaceURI === Bt && !ce[d] || s.namespaceURI === zt && !le[d] ? !1 : !qe[n] && (qo[n] || !Ye[n]);
2228
+ }, en = function(n) {
2229
+ let s = z(n);
2230
+ (!s || !s.tagName) && (s = {
2231
+ namespaceURI: ft,
2232
2232
  tagName: "template"
2233
2233
  });
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;
2234
+ const d = Mt(n.tagName), p = Mt(s.tagName);
2235
+ return se[n.namespaceURI] ? n.namespaceURI === Bt ? Zo(d, s, p) : n.namespaceURI === zt ? Jo(d, s, p) : n.namespaceURI === K ? tn(d, s, p) : !!(xt === "application/xhtml+xml" && se[n.namespaceURI]) : !1;
2236
2236
  }, X = function(n) {
2237
- At(t.removed, { element: n });
2237
+ Ct(t.removed, { element: n });
2238
2238
  try {
2239
2239
  z(n).removeChild(n);
2240
- } catch (a) {
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");
2240
+ } catch (s) {
2241
+ if (v(n), !z(n)) throw Q("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
2242
2242
  }
2243
- }, qe = function(n, a, d) {
2243
+ }, Ve = function(n, s, d) {
2244
2244
  try {
2245
- k(n, a);
2246
- } catch (f) {
2245
+ k(n, s);
2246
+ } catch (p) {
2247
2247
  try {
2248
2248
  n.removeAttribute(d);
2249
2249
  } catch (h) {
@@ -2251,203 +2251,203 @@ function Lo() {
2251
2251
  }
2252
2252
  }, Ht = function(n) {
2253
2253
  Ft(n);
2254
- const a = $(n);
2255
- if (a) {
2256
- const f = [];
2257
- rt(a, (h) => {
2258
- At(f, h);
2259
- }), rt(f, (h) => {
2254
+ const s = $(n);
2255
+ if (s) {
2256
+ const p = [];
2257
+ rt(s, (h) => {
2258
+ Ct(p, h);
2259
+ }), rt(p, (h) => {
2260
2260
  try {
2261
- E(h);
2261
+ v(h);
2262
2262
  } catch (b) {
2263
2263
  }
2264
2264
  });
2265
2265
  }
2266
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;
2269
- typeof b == "string" && qe(n, h, b);
2267
+ if (d) for (let p = d.length - 1; p >= 0; --p) {
2268
+ const h = d[p], b = h && h.name;
2269
+ typeof b == "string" && Ve(n, h, b);
2270
2270
  }
2271
- }, it = function(n, a, d) {
2271
+ }, it = function(n, s, d) {
2272
2272
  if (!d) try {
2273
- d = a.getAttributeNode(n);
2274
- } catch (f) {
2273
+ d = s.getAttributeNode(n);
2274
+ } catch (p) {
2275
2275
  d = null;
2276
2276
  }
2277
- At(t.removed, {
2277
+ Ct(t.removed, {
2278
2278
  attribute: d || null,
2279
- from: a
2279
+ from: s
2280
2280
  });
2281
2281
  try {
2282
- d ? k(a, d) : a.removeAttribute(n);
2283
- } catch (f) {
2282
+ d ? k(s, d) : s.removeAttribute(n);
2283
+ } catch (p) {
2284
2284
  try {
2285
- a.removeAttribute(n);
2285
+ s.removeAttribute(n);
2286
2286
  } catch (h) {
2287
2287
  }
2288
2288
  }
2289
2289
  if (n === "is")
2290
2290
  if (ct || Nt) try {
2291
- X(a);
2292
- } catch (f) {
2291
+ X(s);
2292
+ } catch (p) {
2293
2293
  }
2294
2294
  else try {
2295
- a.setAttribute(n, "");
2296
- } catch (f) {
2295
+ s.setAttribute(n, "");
2296
+ } catch (p) {
2297
2297
  }
2298
- }, tn = function(n) {
2299
- const a = B(n);
2300
- if (a)
2301
- for (let d = a.length - 1; d >= 0; --d) {
2302
- const f = a[d], h = f && f.name;
2303
- typeof h != "string" || C[_(h)] || qe(n, f, h);
2298
+ }, on = function(n) {
2299
+ const s = B(n);
2300
+ if (s)
2301
+ for (let d = s.length - 1; d >= 0; --d) {
2302
+ const p = s[d], h = p && p.name;
2303
+ typeof h != "string" || C[_(h)] || Ve(n, p, h);
2304
2304
  }
2305
2305
  }, Ft = function(n) {
2306
- const a = [n];
2307
- for (; a.length > 0; ) {
2308
- const d = a.pop();
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]);
2312
- }
2313
- }, Ve = function(n, a) {
2314
- return ot ? n === "patchsrc" ? !0 : n === "for" && a !== "label" && a !== "output" : !1;
2315
- }, en = function(n) {
2306
+ const s = [n];
2307
+ for (; s.length > 0; ) {
2308
+ const d = s.pop();
2309
+ wt(d) === F.element && on(d);
2310
+ const p = $(d);
2311
+ if (p) for (let h = p.length - 1; h >= 0; --h) s.push(p[h]);
2312
+ }
2313
+ }, Xe = function(n, s) {
2314
+ return ot ? n === "patchsrc" ? !0 : n === "for" && s !== "label" && s !== "output" : !1;
2315
+ }, nn = function(n) {
2316
2316
  if (!ot) return;
2317
- const a = [n];
2318
- for (; a.length > 0; ) {
2319
- const d = a.pop(), f = Et(d);
2320
- if (f === F.processingInstruction || f === F.comment && O(yo, d.data)) {
2317
+ const s = [n];
2318
+ for (; s.length > 0; ) {
2319
+ const d = s.pop(), p = wt(d);
2320
+ if (p === F.processingInstruction || p === F.comment && I(Eo, d.data)) {
2321
2321
  try {
2322
- E(d);
2322
+ v(d);
2323
2323
  } catch (b) {
2324
2324
  }
2325
2325
  continue;
2326
2326
  }
2327
- if (f === F.element) {
2327
+ if (p === F.element) {
2328
2328
  const b = d, y = _(Xt(d));
2329
2329
  try {
2330
- b.hasAttribute && b.hasAttribute("patchsrc") && b.removeAttribute("patchsrc"), b.hasAttribute && b.hasAttribute("for") && Ve("for", y) && b.removeAttribute("for");
2330
+ b.hasAttribute && b.hasAttribute("patchsrc") && b.removeAttribute("patchsrc"), b.hasAttribute && b.hasAttribute("for") && Xe("for", y) && b.removeAttribute("for");
2331
2331
  } catch (S) {
2332
2332
  }
2333
2333
  }
2334
2334
  const h = $(d);
2335
- if (h) for (let b = h.length - 1; b >= 0; --b) a.push(h[b]);
2335
+ if (h) for (let b = h.length - 1; b >= 0; --b) s.push(h[b]);
2336
2336
  }
2337
- }, Xe = function(n) {
2338
- let a = null, d = null;
2337
+ }, Qe = function(n) {
2338
+ let s = null, d = null;
2339
2339
  if (ne) n = "<remove></remove>" + n;
2340
2340
  else {
2341
- const b = so(n, /^[\r\n\t ]+/);
2341
+ const b = lo(n, /^[\r\n\t ]+/);
2342
2342
  d = b && b[0];
2343
2343
  }
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);
2344
+ xt === "application/xhtml+xml" && ft === K && (n = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + n + "</body></html>");
2345
+ const p = N ? lt(n) : n;
2346
+ if (ft === K) try {
2347
+ s = new m().parseFromString(p, xt);
2348
2348
  } catch (b) {
2349
2349
  }
2350
- if (!a || !a.documentElement) {
2351
- a = Jt.createDocument(pt, "template", null);
2350
+ if (!s || !s.documentElement) {
2351
+ s = Zt.createDocument(ft, "template", null);
2352
2352
  try {
2353
- a.documentElement.innerHTML = ae ? et : f;
2353
+ s.documentElement.innerHTML = ae ? et : p;
2354
2354
  } catch (b) {
2355
2355
  }
2356
2356
  }
2357
- const h = a.body || a.documentElement;
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;
2357
+ const h = s.body || s.documentElement;
2358
+ return n && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null), ft === K ? Bo.call(s, nt ? "html" : "body")[0] : nt ? s.documentElement : h;
2359
2359
  }, Ze = 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);
2360
+ const s = Dt ? Dt(n) : n.ownerDocument;
2361
+ return Le.call(s || n, n, f.SHOW_ELEMENT | f.SHOW_COMMENT | f.SHOW_TEXT | f.SHOW_PROCESSING_INSTRUCTION | f.SHOW_CDATA_SECTION, null);
2362
2362
  }, Ut = function(n) {
2363
- return n = Ct(n, Bo, " "), n = Ct(n, Ho, " "), n = Ct(n, Fo, " "), n;
2363
+ return n = St(n, Fo, " "), n = St(n, Uo, " "), n = St(n, jo, " "), n;
2364
2364
  }, ue = function(n) {
2365
- var a;
2365
+ var s;
2366
2366
  n.normalize();
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();
2367
+ const d = Dt ? Dt(n) : n.ownerDocument, p = Le.call(d || n, n, f.SHOW_TEXT | f.SHOW_COMMENT | f.SHOW_CDATA_SECTION | f.SHOW_PROCESSING_INSTRUCTION, null);
2368
+ let h = p.nextNode();
2369
2369
  for (; h; )
2370
- h.data = Ut(h.data), h = f.nextNode();
2371
- const b = (a = n.querySelectorAll) === null || a === void 0 ? void 0 : a.call(n, "template");
2370
+ h.data = Ut(h.data), h = p.nextNode();
2371
+ const b = (s = n.querySelectorAll) === null || s === void 0 ? void 0 : s.call(n, "template");
2372
2372
  b && rt(b, (y) => {
2373
2373
  ht(y.content) && ue(y.content);
2374
2374
  });
2375
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);
2376
+ const s = st ? st(n) : null;
2377
+ return typeof s != "string" || _(s) !== "form" ? !1 : typeof n.nodeName != "string" || typeof n.textContent != "string" || typeof n.removeChild != "function" || n.attributes !== B(n) || typeof n.removeAttribute != "function" || typeof n.removeAttributeNode != "function" || typeof n.getAttributeNode != "function" || typeof n.setAttribute != "function" || typeof n.namespaceURI != "string" || typeof n.insertBefore != "function" || typeof n.hasChildNodes != "function" || n.nodeType !== O(n) || n.childNodes !== $(n);
2378
2378
  }, ht = function(n) {
2379
- if (!D || typeof n != "object" || n === null) return !1;
2379
+ if (!O || typeof n != "object" || n === null) return !1;
2380
2380
  try {
2381
- return D(n) === F.documentFragment;
2382
- } catch (a) {
2381
+ return O(n) === F.documentFragment;
2382
+ } catch (s) {
2383
2383
  return !1;
2384
2384
  }
2385
- }, xt = function(n) {
2386
- if (!D || typeof n != "object" || n === null) return !1;
2385
+ }, At = function(n) {
2386
+ if (!O || typeof n != "object" || n === null) return !1;
2387
2387
  try {
2388
- return typeof D(n) == "number";
2389
- } catch (a) {
2388
+ return typeof O(n) == "number";
2389
+ } catch (s) {
2390
2390
  return !1;
2391
2391
  }
2392
2392
  };
2393
- function Y(u, n, a) {
2393
+ function Y(u, n, s) {
2394
2394
  u.length !== 0 && rt(u, (d) => {
2395
- d.call(t, n, a, ft);
2395
+ d.call(t, n, s, pt);
2396
2396
  });
2397
2397
  }
2398
- const on = function(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);
2398
+ const rn = function(n, s) {
2399
+ return !!(ot && n.hasChildNodes() && !At(n.firstElementChild) && I(yo, n.textContent) && I(yo, n.innerHTML) || ot && n.namespaceURI === K && Zn[s] && (At(n.firstElementChild) || typeof n.textContent == "string" && I(Jn[s], n.textContent)) || n.nodeType === F.processingInstruction || ot && n.nodeType === F.comment && I(Eo, n.data));
2400
+ }, Wt = function(n, s) {
2401
+ if (n instanceof RegExp) return I(n, s);
2402
2402
  if (n instanceof Function) {
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);
2403
+ for (var d = arguments.length, p = new Array(d > 2 ? d - 2 : 0), h = 2; h < d; h++) p[h - 2] = arguments[h];
2404
+ return !!n(s, ...p);
2405
2405
  }
2406
2406
  return !1;
2407
- }, nn = function(n, a, d) {
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) {
2407
+ }, an = function(n, s, d) {
2408
+ if (!kt[s] && oo(s) && Wt(G.tagNameCheck, s)) return !1;
2409
+ if (ie && !ut[s]) {
2410
+ const p = z(n), h = $(n);
2411
+ if (h && p) {
2412
2412
  const b = h.length;
2413
2413
  for (let y = b - 1; y >= 0; --y) {
2414
2414
  const S = n === d ? T(h[y], !0) : h[y];
2415
- f.insertBefore(S, tt(n));
2415
+ p.insertBefore(S, tt(n));
2416
2416
  }
2417
2417
  }
2418
2418
  }
2419
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);
2424
- }, Qe = function(n, a) {
2425
- if (Y(x.beforeSanitizeElements, n, null), mt(n, a)) return !0;
2420
+ }, Je = function(n, s, d, p) {
2421
+ return n.length === 0 ? s : s === d || s === p ? U(s) : s;
2422
+ }, mt = function(n, s) {
2423
+ return n === s || z(n) !== null ? !1 : (re && Ft(n), !0);
2424
+ }, to = function(n, s) {
2425
+ if (Y(x.beforeSanitizeElements, n, null), mt(n, s)) return !0;
2426
2426
  if (jt(n))
2427
2427
  return X(n), !0;
2428
2428
  const d = _(Xt(n));
2429
- if (A = Je(x.uponSanitizeElement, A, Qt, Dt), Y(x.uponSanitizeElement, n, {
2429
+ if (A = Je(x.uponSanitizeElement, A, Jt, Ot), Y(x.uponSanitizeElement, n, {
2430
2430
  tagName: d,
2431
2431
  allowedTags: A
2432
- }), mt(n, a)) return !0;
2433
- if (on(n, d))
2432
+ }), mt(n, s)) return !0;
2433
+ if (rn(n, d))
2434
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;
2435
+ if (kt[d] || !(q.tagCheck instanceof Function && q.tagCheck(d)) && !A[d]) {
2436
+ const p = an(n, d, s);
2437
+ return p === !1 && (Y(x.afterSanitizeElements, n, null), mt(n, s)) ? !0 : p;
2438
2438
  }
2439
- if (Et(n) === F.element && !Qo(n) || (d === "noscript" || d === "noembed" || d === "noframes") && O(qn, n.innerHTML))
2439
+ if (wt(n) === F.element && !en(n) || (d === "noscript" || d === "noembed" || d === "noframes") && I(Xn, n.innerHTML))
2440
2440
  return X(n), !0;
2441
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);
2446
- }, to = function(n, a, d) {
2447
- if (Ie[a] || Ve(a, n) || Ne && (a === "id" || a === "name") && (d in e || d in Vo)) return !1;
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({}, [
2442
+ const p = Ut(n.textContent);
2443
+ n.textContent !== p && (Ct(t.removed, { element: n.cloneNode() }), n.textContent = p);
2444
+ }
2445
+ return Y(x.afterSanitizeElements, n, null), mt(n, s);
2446
+ }, eo = function(n, s, d) {
2447
+ if (Ie[s] || Xe(s, n) || Pe && (s === "id" || s === "name") && (d in e || d in Qo)) return !1;
2448
+ const p = C[s] || q.attributeCheck instanceof Function && q.attributeCheck(s, n);
2449
+ return ee && I(Wo, s) || Oe && I($o, s) ? !0 : p ? je[s] || I(De, St(d, Me, "")) || (s === "src" || s === "xlink:href" || s === "href") && n !== "script" && co(d, "data:") === 0 && Fe[n] || Re && !I(Go, St(d, Me, "")) ? !0 : !d : oo(n) && Wt(G.tagNameCheck, n) && Wt(G.attributeNameCheck, s, n) || s === "is" && G.allowCustomizedBuiltInElements && Wt(G.tagNameCheck, d);
2450
+ }, sn = E({}, [
2451
2451
  "annotation-xml",
2452
2452
  "color-profile",
2453
2453
  "font-face",
@@ -2456,28 +2456,28 @@ function Lo() {
2456
2456
  "font-face-src",
2457
2457
  "font-face-uri",
2458
2458
  "missing-glyph"
2459
- ]), eo = function(n) {
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)) {
2459
+ ]), oo = function(n) {
2460
+ return !sn[Mt(n)] && I(Ko, n);
2461
+ }, ln = function(n, s, d, p) {
2462
+ if (N && typeof g == "object" && typeof g.getAttributeType == "function" && !d) switch (g.getAttributeType(n, s)) {
2463
2463
  case "TrustedHTML":
2464
- return lt(f);
2464
+ return lt(p);
2465
2465
  case "TrustedScriptURL":
2466
- return Do(f);
2466
+ return No(p);
2467
2467
  }
2468
- return f;
2469
- }, sn = function(n, a, d, f) {
2468
+ return p;
2469
+ }, cn = function(n, s, d, p) {
2470
2470
  try {
2471
- return d ? n.setAttributeNS(d, a, f) : n.setAttribute(a, f), jt(n) ? (X(n), !1) : !0;
2471
+ return d ? n.setAttributeNS(d, s, p) : n.setAttribute(s, p), jt(n) ? (X(n), !1) : !0;
2472
2472
  } catch (h) {
2473
- return it(a, n), !1;
2473
+ return it(s, n), !1;
2474
2474
  }
2475
- }, oo = function(n, a) {
2476
- if (Y(x.beforeSanitizeAttributes, n, null), mt(n, a)) return;
2475
+ }, no = function(n, s) {
2476
+ if (Y(x.beforeSanitizeAttributes, n, null), mt(n, s)) return;
2477
2477
  const d = n.attributes;
2478
2478
  if (!d || jt(n)) return;
2479
2479
  C = Je(x.uponSanitizeAttribute, C, te, Rt);
2480
- const f = {
2480
+ const p = {
2481
2481
  attrName: "",
2482
2482
  attrValue: "",
2483
2483
  keepAttr: !0,
@@ -2487,71 +2487,71 @@ function Lo() {
2487
2487
  let h = d.length;
2488
2488
  const b = _(n.nodeName);
2489
2489
  for (; h--; ) {
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)) {
2490
+ const y = d[h], S = y.name, j = y.namespaceURI, H = y.value, gt = _(S), pe = H;
2491
+ let R = S === "value" ? pe : In(pe), io = !1;
2492
+ if (p.attrName = gt, p.attrValue = R, p.keepAttr = !0, p.forceKeepAttr = void 0, Y(x.uponSanitizeAttribute, n, p), R = p.attrValue, ze && (gt === "id" || gt === "name") && co(R, Be) !== 0 && (it(S, n, y), R = Be + R, io = !0), ot && I(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, R)) {
2493
2493
  it(S, n, y);
2494
2494
  continue;
2495
2495
  }
2496
- if (gt === "attributename" && so(R, "href")) {
2496
+ if (gt === "attributename" && lo(R, "href")) {
2497
2497
  it(S, n, y);
2498
2498
  continue;
2499
2499
  }
2500
- if (!f.forceKeepAttr) {
2501
- if (!f.keepAttr) {
2500
+ if (!p.forceKeepAttr) {
2501
+ if (!p.keepAttr) {
2502
2502
  it(S, n, y);
2503
2503
  continue;
2504
2504
  }
2505
- if (!Re && O(Vn, R)) {
2505
+ if (!Ne && I(Qn, R)) {
2506
2506
  it(S, n, y);
2507
2507
  continue;
2508
2508
  }
2509
- if (V && (R = Ut(R)), !to(b, gt, R)) {
2509
+ if (V && (R = Ut(R)), !eo(b, gt, R)) {
2510
2510
  it(S, n, y);
2511
2511
  continue;
2512
2512
  }
2513
- R = an(b, gt, j, R), R !== fe && sn(n, S, j, R) && no && ao(t.removed);
2513
+ R = ln(b, gt, j, R), R !== pe && cn(n, S, j, R) && io && so(t.removed);
2514
2514
  }
2515
2515
  }
2516
- Y(x.afterSanitizeAttributes, n, null), mt(n, a);
2516
+ Y(x.afterSanitizeAttributes, n, null), mt(n, s);
2517
2517
  }, $t = function(n) {
2518
- let a = null;
2518
+ let s = null;
2519
2519
  const d = Ze(n);
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));
2520
+ for (Y(x.beforeSanitizeShadowDOM, n, null); s = d.nextNode(); )
2521
+ if (Y(x.uponSanitizeShadowNode, s, null), to(s, n), no(s, n), ht(s.content) && $t(s.content), wt(s) === F.element) {
2522
+ const p = at(s);
2523
+ ht(p) && (fe(p), $t(p));
2524
2524
  }
2525
2525
  Y(x.afterSanitizeShadowDOM, n, null);
2526
- }, pe = function(n) {
2527
- const a = [{
2526
+ }, fe = function(n) {
2527
+ const s = [{
2528
2528
  node: n,
2529
2529
  shadow: null
2530
2530
  }];
2531
- for (; a.length > 0; ) {
2532
- const d = a.pop();
2531
+ for (; s.length > 0; ) {
2532
+ const d = s.pop();
2533
2533
  if (d.shadow) {
2534
2534
  $t(d.shadow);
2535
2535
  continue;
2536
2536
  }
2537
- const f = d.node, h = Et(f) === F.element, b = $(f);
2538
- if (b) for (let y = b.length - 1; y >= 0; --y) a.push({
2537
+ const p = d.node, h = wt(p) === F.element, b = $(p);
2538
+ if (b) for (let y = b.length - 1; y >= 0; --y) s.push({
2539
2539
  node: b[y],
2540
2540
  shadow: null
2541
2541
  });
2542
2542
  if (h) {
2543
- const y = st ? st(f) : null;
2543
+ const y = st ? st(p) : null;
2544
2544
  if (typeof y == "string" && _(y) === "template") {
2545
- const S = f.content;
2546
- ht(S) && a.push({
2545
+ const S = p.content;
2546
+ ht(S) && s.push({
2547
2547
  node: S,
2548
2548
  shadow: null
2549
2549
  });
2550
2550
  }
2551
2551
  }
2552
2552
  if (h) {
2553
- const y = at(f);
2554
- ht(y) && a.push({
2553
+ const y = at(p);
2554
+ ht(y) && s.push({
2555
2555
  node: null,
2556
2556
  shadow: y
2557
2557
  }, {
@@ -2562,39 +2562,39 @@ function Lo() {
2562
2562
  }
2563
2563
  };
2564
2564
  return t.sanitize = function(u) {
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
+ let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = null, d = null, p = null, h = null;
2566
+ if (ae = !u, ae && (u = "<!-->"), typeof u != "string" && !At(u) && (u = zn(u), typeof u != "string"))
2567
+ throw Q("dirty is not a string, aborting");
2568
2568
  if (!t.isSupported) return 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);
2569
+ oe ? (A = Ot, C = Rt) : de(n), (x.uponSanitizeElement.length > 0 || x.uponSanitizeAttribute.length > 0) && (A = U(A)), x.uponSanitizeAttribute.length > 0 && (C = U(C)), t.removed = [];
2570
+ const b = re && typeof u != "string" && At(u);
2571
2571
  if (b) {
2572
- en(u);
2572
+ nn(u);
2573
2573
  const j = Xt(u);
2574
2574
  if (typeof j == "string") {
2575
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");
2576
+ if (!A[H] || kt[H])
2577
+ throw Ht(u), Q("root node is forbidden and cannot be sanitized in-place");
2578
2578
  }
2579
2579
  if (jt(u))
2580
- throw Ht(u), Z("root node is clobbered and cannot be sanitized in-place");
2580
+ throw Ht(u), Q("root node is clobbered and cannot be sanitized in-place");
2581
2581
  try {
2582
- pe(u);
2582
+ fe(u);
2583
2583
  } catch (H) {
2584
2584
  throw Ht(u), H;
2585
2585
  }
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);
2586
+ } else if (At(u))
2587
+ s = Qe("<!---->"), d = s.ownerDocument.importNode(u, !0), d.nodeType === F.element && d.nodeName === "BODY" || d.nodeName === "HTML" ? s = d : s.appendChild(d), fe(s);
2588
2588
  else {
2589
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 : "";
2590
+ if (s = Qe(u), !s) return ct ? null : Pt ? et : "";
2591
2591
  }
2592
- a && ne && X(a.firstChild);
2593
- const y = b ? u : a;
2592
+ s && ne && X(s.firstChild);
2593
+ const y = b ? u : s;
2594
2594
  try {
2595
2595
  const j = Ze(y);
2596
- for (; f = j.nextNode(); )
2597
- Qe(f, y), oo(f, y), ht(f.content) && $t(f.content);
2596
+ for (; p = j.nextNode(); )
2597
+ to(p, y), no(p, y), ht(p.content) && $t(p.content);
2598
2598
  } catch (j) {
2599
2599
  throw b && (Ht(u), rt(t.removed, (H) => {
2600
2600
  H.element && Ft(H.element);
@@ -2604,36 +2604,36 @@ function Lo() {
2604
2604
  let j = !1;
2605
2605
  if (rt(t.removed, (H) => {
2606
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");
2607
+ }), j) throw Q("a node selected for removal could not be safely returned; refusing to sanitize in place");
2608
2608
  return V && ue(u), u;
2609
2609
  }
2610
2610
  if (ct) {
2611
- if (V && ue(a), Nt)
2612
- for (h = No.call(a.ownerDocument); a.firstChild; ) h.appendChild(a.firstChild);
2613
- else h = a;
2614
- return (C.shadowroot || C.shadowrootmode) && (h = zo.call(o, h, !0)), h;
2611
+ if (V && ue(s), Nt)
2612
+ for (h = zo.call(s.ownerDocument); s.firstChild; ) h.appendChild(s.firstChild);
2613
+ else h = s;
2614
+ return (C.shadowroot || C.shadowrootmode) && (h = Ho.call(o, h, !0)), h;
2615
2615
  }
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 + `>
2616
+ let S = nt ? s.outerHTML : s.innerHTML;
2617
+ return nt && A["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && I(qn, s.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + s.ownerDocument.doctype.name + `>
2618
2618
  ` + S), V && (S = Ut(S)), N && Pt ? lt(S) : S;
2619
2619
  }, t.setConfig = function() {
2620
2620
  let u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2621
- de(u), oe = !0, Dt = A, Rt = C;
2621
+ de(u), oe = !0, Ot = A, Rt = C;
2622
2622
  }, t.clearConfig = function() {
2623
- ft = null, oe = !1, Dt = null, Rt = null, N = Zt, et = "";
2624
- }, t.isValidAttribute = function(u, n, a) {
2625
- ft || de({});
2626
- const d = _(u), f = _(n);
2627
- return to(d, f, a);
2623
+ pt = null, oe = !1, Ot = null, Rt = null, N = Qt, et = "";
2624
+ }, t.isValidAttribute = function(u, n, s) {
2625
+ pt || de({});
2626
+ const d = _(u), p = _(n);
2627
+ return eo(d, p, s);
2628
2628
  }, t.addHook = function(u, n) {
2629
- typeof n == "function" && P(x, u) && At(x[u], n);
2629
+ typeof n == "function" && P(x, u) && Ct(x[u], n);
2630
2630
  }, t.removeHook = function(u, n) {
2631
2631
  if (P(x, u)) {
2632
2632
  if (n !== void 0) {
2633
- const a = _n(x[u], n);
2634
- return a === -1 ? void 0 : Ln(x[u], a, 1)[0];
2633
+ const s = Mn(x[u], n);
2634
+ return s === -1 ? void 0 : Dn(x[u], s, 1)[0];
2635
2635
  }
2636
- return ao(x[u]);
2636
+ return so(x[u]);
2637
2637
  }
2638
2638
  }, t.removeHooks = function(u) {
2639
2639
  P(x, u) && (x[u] = []);
@@ -2641,8 +2641,8 @@ function Lo() {
2641
2641
  x = vo();
2642
2642
  }, t;
2643
2643
  }
2644
- var Kt = Lo();
2645
- const ti = [
2644
+ var Kt = Do();
2645
+ const oi = [
2646
2646
  "p",
2647
2647
  "br",
2648
2648
  "strong",
@@ -2691,7 +2691,7 @@ const ti = [
2691
2691
  // user-initiated dialog, a different trust boundary that never calls
2692
2692
  // through this sanitizer. A consumer that genuinely wants iframes in
2693
2693
  // pasted/typed content can still opt in via a custom allowedTags list.
2694
- ], ei = {
2694
+ ], ni = {
2695
2695
  "*": ["class", "style", "id", "data-*", "role", "aria-*", "tabindex", "contenteditable", "spellcheck", "dir", "lang"],
2696
2696
  a: ["href", "target", "rel", "title"],
2697
2697
  img: ["src", "alt", "width", "height", "loading"],
@@ -2708,60 +2708,60 @@ const ti = [
2708
2708
  // additionalAllowedTags), restoring the attributes that make an inserted
2709
2709
  // iframe actually usable (src, sizing, fullscreen, scrolling/border).
2710
2710
  iframe: ["src", "width", "height", "name", "title", "frameborder", "scrolling", "allowfullscreen", "longdesc", "allow"]
2711
- }, oi = "data-editora-embed";
2712
- function ni(s) {
2713
- if (!s || /\s/.test(s.trim())) return !1;
2711
+ }, ii = "data-editora-embed";
2712
+ function ri(a) {
2713
+ if (!a || /\s/.test(a.trim())) return !1;
2714
2714
  try {
2715
- const t = new URL(s.trim());
2715
+ const t = new URL(a.trim());
2716
2716
  return (t.protocol === "https:" || t.protocol === "http:") && t.hostname.length > 0;
2717
2717
  } catch (t) {
2718
2718
  return !1;
2719
2719
  }
2720
2720
  }
2721
- function Mo(s, t, e, o) {
2721
+ function Io(a, t, e, o) {
2722
2722
  if ((t == null ? void 0 : t.sanitize) === !1)
2723
- return s;
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();
2723
+ return a;
2724
+ const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : oi, 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 : ni, f = /* @__PURE__ */ new Set();
2725
2725
  for (const w of Object.values(c))
2726
- for (const T of w) p.add(T);
2726
+ for (const T of w) f.add(T);
2727
2727
  const m = {
2728
2728
  ALLOWED_TAGS: r,
2729
- ALLOWED_ATTR: Array.from(p)
2729
+ ALLOWED_ATTR: Array.from(f)
2730
2730
  };
2731
2731
  if (!o)
2732
- return Kt.sanitize(s, m);
2732
+ return Kt.sanitize(a, m);
2733
2733
  const g = r.includes("iframe");
2734
2734
  Kt.addHook(
2735
2735
  "uponSanitizeElement",
2736
2736
  (w, T) => {
2737
2737
  var k;
2738
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"));
2739
+ const v = w;
2740
+ T.allowedTags.iframe = g || ((k = v.getAttribute) == null ? void 0 : k.call(v, ii)) === "true" && ri(v.getAttribute("src"));
2741
2741
  }
2742
2742
  );
2743
2743
  try {
2744
- return Kt.sanitize(s, m);
2744
+ return Kt.sanitize(a, m);
2745
2745
  } finally {
2746
2746
  Kt.removeHook("uponSanitizeElement");
2747
2747
  }
2748
2748
  }
2749
- function ii(s, t, e, o) {
2750
- return Mo(s, t, o, !1);
2749
+ function ai(a, t, e, o) {
2750
+ return Io(a, t, o, !1);
2751
2751
  }
2752
- function ri(s, t, e) {
2753
- return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? s : ii(s, t);
2752
+ function si(a, t, e) {
2753
+ return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? a : ai(a, t);
2754
2754
  }
2755
- function Eo(s, t, e, o) {
2756
- return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? s : Mo(s, t, o, !0);
2755
+ function wo(a, t, e, o) {
2756
+ return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? a : Io(a, t, o, !0);
2757
2757
  }
2758
- const ai = ".resize-handle, .table-resize-handle, [data-rte-media-pending]", si = /resize-handle|data-rte-media-pending|rte-media/;
2759
- function Io(s) {
2760
- if (!s || !si.test(s)) return s;
2758
+ const li = ".resize-handle, .table-resize-handle, [data-rte-media-pending]", ci = /resize-handle|data-rte-media-pending|rte-media/;
2759
+ function Oo(a) {
2760
+ if (!a || !ci.test(a)) return a;
2761
2761
  const t = document.createElement("template");
2762
- t.innerHTML = s;
2762
+ t.innerHTML = a;
2763
2763
  const e = /* @__PURE__ */ new Set();
2764
- return t.content.querySelectorAll(ai).forEach((o) => {
2764
+ return t.content.querySelectorAll(li).forEach((o) => {
2765
2765
  const i = o.parentElement;
2766
2766
  i && (i.tagName === "TD" || i.tagName === "TH") && e.add(i), o.remove();
2767
2767
  }), e.forEach((o) => {
@@ -2774,8 +2774,8 @@ function Io(s) {
2774
2774
  i && (i.removeAttribute("contenteditable"), !((r = i.textContent) != null && r.trim()) && !i.querySelector("img, video, a") && i.remove());
2775
2775
  }), t.innerHTML;
2776
2776
  }
2777
- function _t(s) {
2778
- return s ? Io(s.innerHTML) : "";
2777
+ function bt(a) {
2778
+ return a ? Oo(a.innerHTML) : "";
2779
2779
  }
2780
2780
  const Vt = class Vt {
2781
2781
  /**
@@ -2974,7 +2974,7 @@ Vt.EDITOR_DEFAULTS = {
2974
2974
  width: "100%",
2975
2975
  readonly: !1,
2976
2976
  disabled: !1,
2977
- menubar: !0,
2977
+ menubar: !1,
2978
2978
  toolbar: !0,
2979
2979
  plugins: [],
2980
2980
  theme: "light",
@@ -3038,8 +3038,8 @@ Vt.EDITOR_DEFAULTS = {
3038
3038
  "security-sanitize-on-paste",
3039
3039
  "security-sanitize-on-input"
3040
3040
  ]);
3041
- let xe = Vt;
3042
- class li {
3041
+ let Ae = Vt;
3042
+ class di {
3043
3043
  constructor() {
3044
3044
  this.loadedPlugins = /* @__PURE__ */ new Map(), this.pluginRegistry = /* @__PURE__ */ new Map();
3045
3045
  }
@@ -3050,16 +3050,30 @@ class li {
3050
3050
  this.pluginRegistry.set(t, e);
3051
3051
  }
3052
3052
  /**
3053
- * Load a plugin by name (async)
3053
+ * Load a plugin by name (async). The instance is cached by name: every later call gets the same
3054
+ * one, configured by the first call. For one instance per editor, use create().
3054
3055
  */
3055
3056
  async load(t, e) {
3056
3057
  if (this.loadedPlugins.has(t))
3057
3058
  return this.loadedPlugins.get(t);
3059
+ const o = await this.create(t, e);
3060
+ return o && this.loadedPlugins.set(t, o), o;
3061
+ }
3062
+ /**
3063
+ * Create a new instance of a registered plugin, configured with `config`, without caching it.
3064
+ */
3065
+ async create(t, e) {
3058
3066
  const o = this.pluginRegistry.get(t);
3059
3067
  if (!o)
3060
3068
  return console.warn(`Plugin not found: ${t}`), null;
3061
3069
  const i = await o();
3062
- return e && this.applyPluginConfig(i, e), this.loadedPlugins.set(t, i), i;
3070
+ return e && this.applyPluginConfig(i, e), i;
3071
+ }
3072
+ /**
3073
+ * Attach configuration to a plugin instance (read at runtime as `__pluginConfig`).
3074
+ */
3075
+ configure(t, e) {
3076
+ this.applyPluginConfig(t, e);
3063
3077
  }
3064
3078
  /**
3065
3079
  * Load multiple plugins
@@ -3113,39 +3127,45 @@ class li {
3113
3127
  return this.loadedPlugins.has(t);
3114
3128
  }
3115
3129
  }
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}}';
3130
+ const To = /* @__PURE__ */ new Set();
3131
+ function ui(a, t) {
3132
+ To.has(a) || (To.add(a), console.warn(
3133
+ `[Editora] The "${a}" option has no effect: ${t} It is still accepted so existing code keeps working, and will be removed in a future major release.`
3134
+ ));
3135
+ }
3136
+ const fi = '.editora-editor{display:flex;flex-direction:column;border:1px solid #ddd;border-radius:4px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;overflow:hidden}.editora-editor *{box-sizing:border-box}.editora-theme-light{background:#fff;color:#333}.editora-theme-dark{--editora-dark-toolbar-bg-start: #353d48;--editora-dark-toolbar-bg-end: #2d3540;--editora-dark-button-bg-start: #46505f;--editora-dark-button-bg-end: #3b4553;--editora-dark-button-hover-start: #525d6d;--editora-dark-button-hover-end: #465262;--editora-dark-button-active-start: #5eaaf6;--editora-dark-button-active-end: #4a95de;--editora-dark-border: #475263;--editora-dark-border-strong: #566275;--editora-dark-text: #e1e9f5;--editora-dark-text-strong: #f3f7ff;--editora-dark-text-muted: #aeb9cc;--editora-dark-surface: #1d242d;--editora-dark-content: #1f2732;background:linear-gradient(180deg,#1b2330,#1c2430);color:var(--editora-dark-text);border-color:var(--editora-dark-border)}.editora-toolbar{display:flex;align-items:center;gap:4px;padding:8px;background:#f5f5f5;border-bottom:1px solid #ddd;flex-wrap:wrap}.editora-theme-dark .editora-toolbar{background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%);border-bottom-color:var(--editora-dark-border);box-shadow:inset 0 1px #ffffff0d}.editora-toolbar-sticky{position:sticky;top:0;z-index:100;position:-webkit-sticky}.editora-toolbar-group{display:flex;align-items:center;gap:2px}.editora-toolbar-button{padding:6px 12px;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-weight:600;font-size:14px;height:30px;display:flex;align-items:center;white-space:nowrap}.editora-toolbar-group-button{display:flex;align-items:center}.editora-toolbar-input.font-size{width:40px;padding:.25rem;text-align:center;font-size:14px;background:#fff;border:1px solid var(--rte-color-border-light);border-radius:var(--rte-radius-sm)}.editora-toolbar-group-items{display:flex;align-items:center;border:1px solid #ccc;.editora-toolbar-button{border:none;border-radius:0;&:first-child{border-right:1px solid #ccc;border-top-left-radius:3px;border-bottom-left-radius:3px}&:last-child{border:0px solid #ccc;border-radius:0!important}&:hover{background:#e0e0e0;border-color:#ccc}}}.editora-theme-dark .editora-toolbar-button{background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%);border-color:var(--editora-dark-border-strong);color:var(--editora-dark-text);box-shadow:inset 0 1px #ffffff14,0 1px 1px #00000059}.editora-theme-dark .editora-toolbar-group-items{border-color:var(--editora-dark-border-strong);background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%)}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:first-child{border-right-color:#566275}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:last-child{border-left-color:#566275}.editora-theme-dark .editora-toolbar-input.font-size{background-color:#2e3642;color:var(--editora-dark-text-strong);border-color:var(--editora-dark-border-strong);caret-color:var(--editora-dark-text-strong)}.editora-theme-dark .editora-toolbar-input.font-size::placeholder{color:var(--editora-dark-text-strong);opacity:1}.editora-toolbar-button:hover{background:#e0e0e0;border-color:#ccc}.editora-theme-dark .editora-toolbar-button:hover{background:linear-gradient(180deg,var(--editora-dark-button-hover-start) 0%,var(--editora-dark-button-hover-end) 100%);border-color:#66748a;color:var(--editora-dark-text-strong)}.editora-toolbar-button:active,.editora-toolbar-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-button:active,.editora-theme-dark .editora-toolbar-button.active{background:linear-gradient(180deg,var(--editora-dark-button-active-start) 0%,var(--editora-dark-button-active-end) 100%);border-color:#67adf4;color:#0f1b2a}.editora-theme-dark .editora-toolbar-button:disabled{background:#313946;border-color:#424d5e;color:#7f8ca1}.editora-theme-dark .editora-toolbar-button[data-command=insertTable],.editora-theme-dark .editora-toolbar-button[data-command=print],.editora-theme-dark .editora-toolbar-button[data-command=toggleSpellCheck],.editora-theme-dark .editora-toolbar-button[data-command=toggleA11yChecker],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionLTR],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionRTL]{color:#f1f6ff}.editora-toolbar-button:disabled{opacity:.5;cursor:not-allowed}.editora-toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;line-height:1}.editora-toolbar-button svg,.editora-toolbar-icon svg{width:20px;height:20px;display:block;color:currentColor}.editora-theme-dark .editora-toolbar-button svg:not([fill=none i]),.editora-theme-dark .editora-toolbar-icon svg:not([fill=none i]){fill:currentColor}.editora-theme-dark .editora-toolbar-icon,.editora-theme-dark .editora-toolbar-icon *{color:inherit}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([stroke="#000" i],[stroke="#000000" i],[stroke=black i],[stroke="#0f0f0f" i],[stroke="#111111" i],[style*="stroke:#000" i],[style*="stroke: #000" i],[style*="stroke:black" i],[style*="stroke: black" i],[style*="stroke:#0f0f0f" i],[style*="stroke: #0f0f0f" i]){stroke:currentColor!important}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([fill="#000" i],[fill="#000000" i],[fill=black i],[fill="#0f0f0f" i],[fill="#111111" i],[style*="fill:#000" i],[style*="fill: #000" i],[style*="fill:black" i],[style*="fill: black" i],[style*="fill:#0f0f0f" i],[style*="fill: #0f0f0f" i]){fill:currentColor!important}.editora-toolbar-separator{width:1px;height:24px;background:#ddd;margin:0 4px}.editora-theme-dark .editora-toolbar-separator{background:#4d596b}.editora-toolbar-items-container{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow:hidden}.editora-toolbar-more-button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;padding:0;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-size:16px}.editora-toolbar-more-button:hover{background:#e0e0e0}.editora-toolbar-more-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-more-button{background:var(--editora-dark-content);border-color:var(--editora-dark-border);color:var(--editora-dark-text)}.editora-theme-dark .editora-toolbar-more-button:hover,.editora-theme-dark .editora-toolbar-more-button.active{background:#3a4554;border-color:#607088}.editora-toolbar-expanded-row{display:none;flex-wrap:wrap;align-items:center;gap:4px;width:100%;padding:8px;border-top:1px solid #ddd;background:#f5f5f5}.editora-toolbar-expanded-row.show{display:flex}.editora-theme-dark .editora-toolbar-expanded-row{border-top-color:var(--editora-dark-border);background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%)}.editora-toolbar-dropdown{position:relative}.editora-toolbar-dropdown-menu{position:absolute;top:100%;left:0;min-width:150px;margin-top:4px;padding:4px 0;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-toolbar-dropdown-menu{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;color:#333;text-align:left;cursor:pointer;font-size:13px;transition:background .15s ease}.editora-theme-dark .editora-toolbar-dropdown-item{color:#d7deea}.editora-toolbar-dropdown-item:hover{background:#f5f5f5}.editora-theme-dark .editora-toolbar-dropdown-item:hover{background:#3a4554;color:#f0f6ff}.editora-content{flex:1;min-height:200px;padding:16px;outline:none;overflow-y:auto;line-height:1.6}.editora-theme-dark .editora-content{color:#ecf3ff;background:linear-gradient(180deg,var(--editora-dark-content) 0%,#1c232e 100%)}.editora-content:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none}.editora-theme-dark .editora-content:empty:before{color:#8f9bb0}.editora-content h1{font-size:2em;margin:.67em 0;font-weight:600}.editora-content h2{font-size:1.5em;margin:.75em 0;font-weight:600}.editora-content h3{font-size:1.17em;margin:.83em 0;font-weight:600}.editora-content p{margin:1em 0}.editora-theme-dark .editora-content,.editora-theme-dark .editora-content :is(p,span,div,li,ul,ol,td,th,h1,h2,h3,h4,h5,h6,strong,em,u,s,small,sub,sup,blockquote,code,pre,a){color:#ecf3ff}.editora-content ul,.editora-content ol{margin:1em 0;padding-left:2em}.editora-content a{color:#06c;text-decoration:underline}.editora-theme-dark .editora-content a{color:#ecf3ff}.editora-content code{padding:2px 4px;background:#f5f5f5;border-radius:3px;font-family:Monaco,Menlo,Consolas,monospace;font-size:.9em}.editora-theme-dark .editora-content code{background:#1e1e1e}.editora-content pre{padding:12px;background:#f5f5f5;border-radius:4px;overflow-x:auto;margin:1em 0}.editora-theme-dark .editora-content pre{background:#1e1e1e}.editora-theme-dark .rte-code-block{background:linear-gradient(180deg,#212a36,#1b2430)!important;border-color:#4f5b70!important;color:#e7effc!important}.editora-theme-dark .rte-code-block code{color:#e7effc!important}.editora-theme-dark .rte-code-block:before{background:#111927!important;color:#dce8ff!important}.editora-theme-dark .rte-code-block .rte-code-copy{background:#2b3441!important;border-color:#5a667b!important;color:#dce8ff!important}.editora-content blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.editora-theme-dark .editora-content blockquote{border-left-color:#3c3c3c;color:#ecf3ff}.editora-floating-toolbar{position:absolute;padding:4px;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-floating-toolbar{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-statusbar-container{display:flex;flex-direction:column}.editora-statusbar-left{display:flex;align-items:center;gap:8px}.editora-statusbar-right{display:flex;align-items:center;gap:8px;margin-left:auto}.editora-statusbar{display:flex;align-items:center;gap:12px;padding:6px 12px;background:#f5f5f5;border-top:1px solid #ddd;font-size:12px;color:#666}.editora-theme-dark .editora-statusbar{background:linear-gradient(180deg,#2c3440,#252d37);border-top-color:#3f4a5b;color:#d7deea}.editora-statusbar-item{white-space:nowrap}.editora-statusbar-separator{color:#ddd}.editora-theme-dark .editora-statusbar-separator{color:#566275}.editora-editor[readonly] .editora-content{background:#fafafa;cursor:not-allowed}.editora-theme-dark.editora-editor[readonly] .editora-content{background:#1a1a1a}.editora-editor:focus-within{border-color:#06c;box-shadow:0 0 0 3px #0066cc1a}.editora-theme-dark.editora-editor:focus-within{border-color:#4db8ff;box-shadow:0 0 0 3px #4db8ff1a}.editora-editor.editora-disabled{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}editora-editor[data-loading]{display:block;position:relative;min-height:160px;border:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px);background:var(--ui-color-surface, #fff)}editora-editor[data-loading]:before{content:"";position:absolute;inset:0 0 auto;height:46px;border-bottom:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px) var(--ui-radius, 4px) 0 0;background:linear-gradient(90deg,var(--ui-color-surface-alt, #f5f5f5) 0%,color-mix(in srgb,var(--ui-color-surface-alt, #f5f5f5) 70%,var(--ui-color-border, #ddd)) 50%,var(--ui-color-surface-alt, #f5f5f5) 100%);background-size:220% 100%;animation:editora-loading-shimmer 1.2s linear infinite}editora-editor[data-loading]:after{content:"Loading editor…";position:absolute;top:62px;left:16px;font:14px/1.4 var(--ui-font-family, system-ui, sans-serif);color:var(--ui-color-muted, #6b7280)}editora-editor[data-loading]>*{visibility:hidden}@keyframes editora-loading-shimmer{to{background-position:-220% 0}}@media(prefers-reduced-motion:reduce){editora-editor[data-loading]:before{animation:none}}';
3117
3137
  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;
3120
- function xo(s) {
3121
- if (!(s instanceof HTMLElement)) return !1;
3122
- const t = s;
3138
+ const pi = "__editoraCommandEditorRoot", hi = "__editoraLastCommandButton", ko = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", xo = ".rte-content, .editora-content", mi = "Rich text editor", gi = /* @__PURE__ */ new Set(["collaboration"]), ve = "data-editora-disabled-by-host", Ce = /* @__PURE__ */ new Set();
3139
+ let J = null, Ao = !1, we = null, Te = null;
3140
+ function Co(a) {
3141
+ if (!(a instanceof HTMLElement)) return !1;
3142
+ const t = a;
3123
3143
  return typeof t.execCommand == "function" && (t.tagName.toLowerCase() === "editora-editor" || t.classList.contains("editora-editor") || t.hasAttribute("data-editora-editor"));
3124
3144
  }
3125
- function hi(s) {
3126
- return s ? s.nodeType === Node.ELEMENT_NODE ? s : s.parentElement : null;
3145
+ function bi(a) {
3146
+ return a ? a.nodeType === Node.ELEMENT_NODE ? a : a.parentElement : null;
3127
3147
  }
3128
- function Lt(s) {
3129
- if (!s) return null;
3130
- if (xo(s))
3131
- return s;
3132
- const t = s.matches(wo) ? s : s.closest(wo);
3133
- return !t || !xo(t) ? null : t;
3148
+ function Lt(a) {
3149
+ if (!a) return null;
3150
+ if (Co(a))
3151
+ return a;
3152
+ const t = a.matches(ko) ? a : a.closest(ko);
3153
+ return !t || !Co(t) ? null : t;
3134
3154
  }
3135
- function mi() {
3155
+ function yi() {
3136
3156
  var i;
3137
3157
  if (typeof window == "undefined") return null;
3138
- const s = window[di];
3139
- if (s instanceof HTMLElement) {
3140
- const r = Lt(s);
3158
+ const a = window[pi];
3159
+ if (a instanceof HTMLElement) {
3160
+ const r = Lt(a);
3141
3161
  if (r) return r;
3142
- const l = s.matches(To) ? s : s.querySelector(To);
3162
+ const l = a.matches(xo) ? a : a.querySelector(xo);
3143
3163
  if (l) {
3144
3164
  const c = Lt(l);
3145
3165
  if (c) return c;
3146
3166
  }
3147
3167
  }
3148
- const t = window[ui];
3168
+ const t = window[hi];
3149
3169
  if (t instanceof HTMLElement) {
3150
3170
  const r = Lt(t);
3151
3171
  if (r) return r;
@@ -3157,49 +3177,49 @@ function mi() {
3157
3177
  }
3158
3178
  const o = (i = window.getSelection) == null ? void 0 : i.call(window);
3159
3179
  if (o && o.rangeCount > 0) {
3160
- const r = Lt(hi(o.getRangeAt(0).startContainer));
3180
+ const r = Lt(bi(o.getRangeAt(0).startContainer));
3161
3181
  if (r) return r;
3162
3182
  }
3163
- if (Q && Q.isConnected)
3164
- return Q;
3165
- for (const r of Ae)
3183
+ if (J && J.isConnected)
3184
+ return J;
3185
+ for (const r of Ce)
3166
3186
  if (r.isConnected) return r;
3167
3187
  return null;
3168
3188
  }
3169
- function gi() {
3170
- if (typeof window == "undefined" || ko) return;
3171
- Ee = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, we = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
3172
- const s = (t, ...e) => {
3173
- const o = mi();
3174
- return o ? o.execCommand(t, ...e) : Ee ? Ee(t, ...e) : we ? we(t, ...e) : !1;
3189
+ function Ei() {
3190
+ if (typeof window == "undefined" || Ao) return;
3191
+ we = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, Te = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
3192
+ const a = (t, ...e) => {
3193
+ const o = yi();
3194
+ return o ? o.execCommand(t, ...e) : we ? we(t, ...e) : Te ? Te(t, ...e) : !1;
3175
3195
  };
3176
- window.executeEditorCommand = s, window.execEditorCommand = s, ko = !0;
3196
+ window.executeEditorCommand = a, window.execEditorCommand = a, Ao = !0;
3177
3197
  }
3178
- function bi() {
3179
- const s = "editora-webcomponent-styles";
3180
- if (!document.getElementById(s)) {
3198
+ function vi() {
3199
+ const a = "editora-webcomponent-styles";
3200
+ if (!document.getElementById(a)) {
3181
3201
  const t = document.createElement("style");
3182
- t.id = s, t.textContent = ci, document.head.appendChild(t);
3202
+ t.id = a, t.textContent = fi, document.head.appendChild(t);
3183
3203
  }
3184
3204
  }
3185
- function Oo() {
3205
+ function Ro() {
3186
3206
  if (!Yt) {
3187
- const s = yt.__globalPluginLoader;
3188
- s ? Yt = s : Yt = new li();
3207
+ const a = Et.__globalPluginLoader;
3208
+ a ? Yt = a : Yt = new di();
3189
3209
  }
3190
3210
  return Yt;
3191
3211
  }
3192
- function Ei(s) {
3193
- const t = Oo();
3194
- Object.entries(s).forEach(([e, o]) => {
3212
+ function ki(a) {
3213
+ const t = Ro();
3214
+ Object.entries(a).forEach(([e, o]) => {
3195
3215
  t.register(e, o);
3196
3216
  });
3197
3217
  }
3198
- const yi = typeof HTMLElement == "undefined" ? class {
3218
+ const wi = typeof HTMLElement == "undefined" ? class {
3199
3219
  } : HTMLElement;
3200
- class yt extends yi {
3220
+ class Et extends wi {
3201
3221
  constructor() {
3202
- 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")) {
3222
+ if (super(), this.pluginLoader = Ro(), this.config = {}, this.isInitialized = !1, this.buildGeneration = 0, this.keyboardShortcutManager = new un(), this.lastAutosavedContent = "", this.preservedContent = null, this.loadedPlugins = [], this.pluginInstances = /* @__PURE__ */ new Map(), this.lastBeforeInputType = null, this.pendingHistorySnapshot = null, this.hasConnected = !1, this.reinitializeQueued = !1, this.lastReportedContent = null, vi(), !this.hasAttribute("data-initial-content")) {
3203
3223
  const t = this.innerHTML.trim();
3204
3224
  t && this.setAttribute("data-initial-content", t);
3205
3225
  }
@@ -3256,7 +3276,7 @@ class yt extends yi {
3256
3276
  * Called when element is added to DOM
3257
3277
  */
3258
3278
  connectedCallback() {
3259
- this.config = this.resolveConfig(), this.waitForPluginLoader().then(() => {
3279
+ this.hasConnected = !0, this.config = this.resolveConfig(), this.waitForPluginLoader().then(() => {
3260
3280
  setTimeout(async () => {
3261
3281
  await this.initialize();
3262
3282
  }, 0);
@@ -3266,13 +3286,13 @@ class yt extends yi {
3266
3286
  * Wait for the global plugin loader to be available
3267
3287
  */
3268
3288
  async waitForPluginLoader() {
3269
- if (yt.__globalPluginLoader) {
3270
- this.pluginLoader = yt.__globalPluginLoader;
3289
+ if (Et.__globalPluginLoader) {
3290
+ this.pluginLoader = Et.__globalPluginLoader;
3271
3291
  return;
3272
3292
  }
3273
3293
  return new Promise((t) => {
3274
3294
  const e = () => {
3275
- yt.__globalPluginLoader ? (this.pluginLoader = yt.__globalPluginLoader, t()) : setTimeout(e, 0);
3295
+ Et.__globalPluginLoader ? (this.pluginLoader = Et.__globalPluginLoader, t()) : setTimeout(e, 0);
3276
3296
  };
3277
3297
  e();
3278
3298
  });
@@ -3293,7 +3313,22 @@ class yt extends yi {
3293
3313
  * Set configuration via JavaScript API
3294
3314
  */
3295
3315
  async setConfig(t) {
3296
- this.jsConfig = t, this.config = this.resolveConfig(), this.isConnected && (this.destroy(), await this.waitForPluginLoader(), await this.initialize());
3316
+ this.jsConfig = t, this.config = this.resolveConfig(), this.isConnected ? (this.destroy(), this.adoptConfiguredContent(t), await this.waitForPluginLoader(), await this.initialize()) : this.adoptConfiguredContent(t);
3317
+ }
3318
+ /**
3319
+ * `content` in setConfig() is a one-off replacement, not a setting: it feeds the next initialize()
3320
+ * the same way the live content that destroy() keeps does, so a later rebuild (a `plugins`
3321
+ * attribute change, the element being moved) resumes from what the user typed, not from this value.
3322
+ * It outranks that kept content, autosave and the element's own markup.
3323
+ */
3324
+ adoptConfiguredContent(t) {
3325
+ typeof t.content == "string" && (this.preservedContent = t.content);
3326
+ }
3327
+ /** Replace the `editora-theme-*` class (there is only ever one) with the one for `theme`. */
3328
+ applyThemeClass(t) {
3329
+ Array.from(this.classList).forEach((e) => {
3330
+ e.startsWith("editora-theme-") && this.classList.remove(e);
3331
+ }), t && this.classList.add(`editora-theme-${t}`);
3297
3332
  }
3298
3333
  /**
3299
3334
  * Initialize the editor
@@ -3302,7 +3337,7 @@ class yt extends yi {
3302
3337
  var r;
3303
3338
  if (this.querySelector(".editora-toolbar") || this.isInitialized) return;
3304
3339
  const t = ++this.buildGeneration;
3305
- 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");
3340
+ this.setAttribute("data-editora-editor", "true"), Ce.add(this), J || (J = this), Ei(), this.config.height && (this.style.height = typeof this.config.height == "number" ? `${this.config.height}px` : this.config.height), this.config.width && (this.style.width = typeof this.config.width == "number" ? `${this.config.width}px` : this.config.width), this.classList.add("editora-editor"), this.classList.toggle("editora-disabled", this.isEditorDisabled()), this.applyThemeClass(this.config.theme), this.isMenubarRequested() && ui("menubar", "<editora-editor> does not render a menu bar."), this.setAttribute("data-loading", "true"), this.setAttribute("aria-busy", "true");
3306
3341
  const e = await this.loadPlugins();
3307
3342
  if (t !== this.buildGeneration || !this.isConnected) return;
3308
3343
  if (this.loadedPlugins = e, e.forEach((l) => {
@@ -3321,10 +3356,10 @@ class yt extends yi {
3321
3356
  const i = this.sanitizeLoadedContent(
3322
3357
  (r = o != null ? o : this.restoreAutosavedContent()) != null ? r : this.getAttribute("data-initial-content") || ""
3323
3358
  );
3324
- this.engine = new un({
3359
+ this.engine = new pn({
3325
3360
  content: i,
3326
3361
  plugins: e,
3327
- readonly: this.config.readonly
3362
+ readonly: !!this.config.readonly || this.isEditorDisabled()
3328
3363
  }), 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", {
3329
3364
  detail: { api: this.getAPI() },
3330
3365
  bubbles: !0
@@ -3350,18 +3385,18 @@ class yt extends yi {
3350
3385
  const r = this.config.plugins.split(/\s+/).filter(Boolean);
3351
3386
  i && !r.includes("a11yChecker") && r.push("a11yChecker");
3352
3387
  for (const l of r) {
3353
- const c = await this.pluginLoader.load(l, this.getPluginLoadConfig(l));
3388
+ const c = await this.loadPlugin(l, this.getPluginLoadConfig(l));
3354
3389
  c && t.push(c);
3355
3390
  }
3356
3391
  } else if (Array.isArray(this.config.plugins)) {
3357
3392
  for (const r of this.config.plugins)
3358
3393
  if (typeof r == "string") {
3359
- const l = await this.pluginLoader.load(r, this.getPluginLoadConfig(r));
3394
+ const l = await this.loadPlugin(r, this.getPluginLoadConfig(r));
3360
3395
  l && t.push(l);
3361
3396
  } else
3362
3397
  t.push(r);
3363
3398
  if (i && !t.some((r) => (r == null ? void 0 : r.name) === "a11yChecker")) {
3364
- const r = await this.pluginLoader.load("a11yChecker", this.getPluginLoadConfig("a11yChecker"));
3399
+ const r = await this.loadPlugin("a11yChecker", this.getPluginLoadConfig("a11yChecker"));
3365
3400
  r && t.push(r);
3366
3401
  }
3367
3402
  }
@@ -3369,13 +3404,24 @@ class yt extends yi {
3369
3404
  const r = this.pluginLoader.getRegisteredPluginNames();
3370
3405
  for (const l of r) {
3371
3406
  const c = this.getPluginLoadConfig(l);
3372
- if (fi.has(l) && !c) continue;
3373
- const p = await this.pluginLoader.load(l, c);
3374
- p && t.push(p);
3407
+ if (gi.has(l) && !c) continue;
3408
+ const f = await this.loadPlugin(l, c);
3409
+ f && t.push(f);
3375
3410
  }
3376
3411
  }
3377
3412
  return t;
3378
3413
  }
3414
+ /**
3415
+ * This editor's instance of a registered plugin: created on first use, then reused (with the
3416
+ * current config) when the editor rebuilds.
3417
+ */
3418
+ async loadPlugin(t, e) {
3419
+ const o = this.pluginInstances.get(t);
3420
+ if (o)
3421
+ return e && this.pluginLoader.configure(o, e), o;
3422
+ const i = await this.pluginLoader.create(t, e);
3423
+ return i && this.pluginInstances.set(t, i), i;
3424
+ }
3379
3425
  resolveToolbarItems() {
3380
3426
  const t = this.config.toolbarItems;
3381
3427
  if (typeof t == "string") return t;
@@ -3456,12 +3502,15 @@ class yt extends yi {
3456
3502
  if (!this.contentElement) return;
3457
3503
  const t = this.getAccessibilityConfig();
3458
3504
  if (t.enableARIA) {
3459
- this.contentElement.setAttribute("role", "textbox"), this.contentElement.setAttribute("aria-multiline", "true"), this.contentElement.setAttribute("aria-disabled", this.config.readonly ? "true" : "false");
3505
+ this.contentElement.setAttribute("role", "textbox"), this.contentElement.setAttribute("aria-multiline", "true"), this.contentElement.setAttribute(
3506
+ "aria-disabled",
3507
+ this.config.readonly || this.isEditorDisabled() ? "true" : "false"
3508
+ );
3460
3509
  const o = (e = this.getAttribute("aria-label")) == null ? void 0 : e.trim(), i = typeof this.config.placeholder == "string" ? this.config.placeholder.trim() : "";
3461
- this.contentElement.setAttribute("aria-label", o || i || pi);
3510
+ this.contentElement.setAttribute("aria-label", o || i || mi);
3462
3511
  } else
3463
3512
  this.contentElement.removeAttribute("role"), this.contentElement.removeAttribute("aria-multiline"), this.contentElement.removeAttribute("aria-disabled"), this.contentElement.removeAttribute("aria-label");
3464
- this.contentElement.tabIndex = t.keyboardNavigation ? 0 : -1;
3513
+ this.contentElement.tabIndex = t.keyboardNavigation && !this.isEditorDisabled() ? 0 : -1;
3465
3514
  }
3466
3515
  applyLanguageSettings() {
3467
3516
  if (!this.contentElement) return;
@@ -3558,7 +3607,7 @@ class yt extends yi {
3558
3607
  * editable DOM: sanitizing only after the first edit leaves the page exposed until then.
3559
3608
  */
3560
3609
  sanitizeLoadedContent(t) {
3561
- return Eo(t, this.getContentSanitizeConfig(), this.getSecurityConfig());
3610
+ return wo(t, this.getContentSanitizeConfig(), this.getSecurityConfig());
3562
3611
  }
3563
3612
  getAutosaveConfig() {
3564
3613
  var e, o;
@@ -3626,7 +3675,7 @@ class yt extends yi {
3626
3675
  this.stopAutosave();
3627
3676
  const t = this.getAutosaveConfig();
3628
3677
  !t.enabled || !this.contentElement || (this.autosaveTimer = setInterval(() => {
3629
- this.persistAutosave(_t(this.contentElement));
3678
+ this.persistAutosave(bt(this.contentElement));
3630
3679
  }, t.intervalMs));
3631
3680
  }
3632
3681
  insertHTMLAtSelection(t) {
@@ -3649,7 +3698,7 @@ class yt extends yi {
3649
3698
  */
3650
3699
  createUI(t, e) {
3651
3700
  const o = this.querySelector('[slot="toolbar"]'), i = this.querySelector('[slot="statusbar"]');
3652
- this.innerHTML = "", this.config.toolbar !== !1 && !o ? (this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.appendChild(this.toolbarElement), this.toolbar = new pn(
3701
+ this.innerHTML = "", this.config.toolbar !== !1 && !o ? (this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.appendChild(this.toolbarElement), this.toolbar = new hn(
3653
3702
  {
3654
3703
  items: this.resolveToolbarItems(),
3655
3704
  sticky: this.isToolbarStickyEnabled(),
@@ -3660,16 +3709,17 @@ class yt extends yi {
3660
3709
  // Pass plugin loader to get all registered plugins
3661
3710
  ), this.toolbar.setCommandHandler((r, l) => {
3662
3711
  var c;
3712
+ if (this.isEditorDisabled()) return !1;
3663
3713
  if (this.contentElement) {
3664
3714
  this.contentElement.focus();
3665
- const p = window.getSelection();
3666
- if (!p || p.rangeCount === 0 || !this.contentElement.contains(p.anchorNode)) {
3715
+ const f = window.getSelection();
3716
+ if (!f || f.rangeCount === 0 || !this.contentElement.contains(f.anchorNode)) {
3667
3717
  const m = document.createRange(), g = this.contentElement.lastChild || this.contentElement;
3668
- 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);
3718
+ 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);
3669
3719
  }
3670
3720
  }
3671
3721
  return this.executeCommand(r, l);
3672
- }), this.toolbar.render(this.toolbarElement)) : o && this.appendChild(o), this.contentElement = document.createElement("div"), this.contentElement.className = "editora-content rte-content", this.contentElement.contentEditable = this.config.readonly ? "false" : "true", this.applyLanguageSettings(), this.applyAccessibilitySettings(), this.applySpellcheckSettings(), this.config.placeholder && this.contentElement.setAttribute("data-placeholder", this.config.placeholder);
3722
+ }), this.toolbar.render(this.toolbarElement)) : o && this.appendChild(o), this.contentElement = document.createElement("div"), this.contentElement.className = "editora-content rte-content", this.contentElement.contentEditable = this.config.readonly || this.isEditorDisabled() ? "false" : "true", this.applyLanguageSettings(), this.applyAccessibilitySettings(), this.applySpellcheckSettings(), this.config.placeholder && this.contentElement.setAttribute("data-placeholder", this.config.placeholder);
3673
3723
  try {
3674
3724
  document.execCommand("defaultParagraphSeparator", !1, "p");
3675
3725
  } catch (r) {
@@ -3679,18 +3729,27 @@ class yt extends yi {
3679
3729
  const r = document.createElement("div");
3680
3730
  r.innerHTML = e.trim(), !Array.from(r.childNodes).some((c) => {
3681
3731
  if (c.nodeType === Node.ELEMENT_NODE) {
3682
- const p = c.tagName;
3683
- return ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "UL", "OL", "BLOCKQUOTE", "PRE"].includes(p);
3732
+ const f = c.tagName;
3733
+ return ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "UL", "OL", "BLOCKQUOTE", "PRE"].includes(f);
3684
3734
  }
3685
3735
  return !1;
3686
3736
  }) && e.trim() ? this.contentElement.innerHTML = `<p>${e.trim()}</p>` : this.contentElement.innerHTML = e;
3687
3737
  } else
3688
3738
  this.config.placeholder ? this.contentElement.innerHTML = "" : this.contentElement.innerHTML = "<p><br></p>";
3689
- this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new fn({ enabled: !0 }), this.floatingToolbar.create(this)), i ? this.appendChild(i) : this.isStatusbarEnabled() && (this.statusBarElement = document.createElement("div"), this.statusBarElement.className = "editora-statusbar-container", this.appendChild(this.statusBarElement), this.statusBar = new hn({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.config.autofocus && setTimeout(() => {
3739
+ this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new mn({ enabled: !0 }), this.floatingToolbar.create(this)), i ? this.appendChild(i) : this.isStatusbarEnabled() && (this.statusBarElement = document.createElement("div"), this.statusBarElement.className = "editora-statusbar-container", this.appendChild(this.statusBarElement), this.statusBar = new gn({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.setToolbarControlsDisabled(this.isEditorDisabled()), this.lastReportedContent = bt(this.contentElement), this.config.autofocus && !this.isEditorDisabled() && setTimeout(() => {
3690
3740
  var r;
3691
3741
  return (r = this.contentElement) == null ? void 0 : r.focus();
3692
3742
  }, 0);
3693
3743
  }
3744
+ /** True only when the page asked for a menu bar (the default is not a request), through setConfig() or the attribute. */
3745
+ isMenubarRequested() {
3746
+ var o;
3747
+ const t = (o = this.jsConfig) == null ? void 0 : o.menubar;
3748
+ if (t !== void 0)
3749
+ return t === !0 || typeof t == "object" && t !== null && t.enabled !== !1;
3750
+ const e = this.getAttribute("menubar");
3751
+ return e !== null && e !== "false";
3752
+ }
3694
3753
  /**
3695
3754
  * Hands what a keystroke changed to the history plugin, so Undo takes back typing. Without this the
3696
3755
  * plugin only knew about changes that plugins reported themselves, and typed text could not be undone.
@@ -3705,6 +3764,30 @@ class yt extends yi {
3705
3764
  selectionCollapsed: e.selectionCollapsed
3706
3765
  });
3707
3766
  }
3767
+ /**
3768
+ * `disabled` is `readonly` plus a toolbar that cannot be pressed and a surface that leaves the tab
3769
+ * order, like a disabled form control.
3770
+ */
3771
+ isEditorDisabled() {
3772
+ return this.config.disabled === !0;
3773
+ }
3774
+ applyDisabledState() {
3775
+ var e, o;
3776
+ const t = this.isEditorDisabled();
3777
+ this.classList.toggle("editora-disabled", t), t && ((e = this.floatingToolbar) == null || e.hide()), this.contentElement && (this.contentElement.contentEditable = t || this.config.readonly ? "false" : "true", this.applyAccessibilitySettings()), (o = this.engine) == null || o.setReadonly(t || !!this.config.readonly), this.setToolbarControlsDisabled(t);
3778
+ }
3779
+ /**
3780
+ * Disable (or give back) every control the default toolbar rendered. Controls that were already
3781
+ * disabled for another reason are marked untouched, so enabling the editor does not wake them up.
3782
+ */
3783
+ setToolbarControlsDisabled(t) {
3784
+ if (!this.toolbarElement) return;
3785
+ this.toolbarElement.querySelectorAll(
3786
+ "button, input, select, textarea"
3787
+ ).forEach((o) => {
3788
+ t ? o.disabled || (o.disabled = !0, o.setAttribute(ve, "")) : o.hasAttribute(ve) && (o.disabled = !1, o.removeAttribute(ve));
3789
+ });
3790
+ }
3708
3791
  /**
3709
3792
  * Setup event listeners
3710
3793
  */
@@ -3723,25 +3806,22 @@ class yt extends yi {
3723
3806
  var T;
3724
3807
  if (!this.contentElement) return;
3725
3808
  let i = this.contentElement.innerHTML;
3726
- 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;
3727
- if (this.lastBeforeInputType = null, p.sanitizeOnInput !== !1 && c.sanitize !== !1 && !m) {
3728
- const E = Eo(i, c, p, r);
3729
- if (E !== i) {
3809
+ const r = (T = o == null ? void 0 : o.detail) == null ? void 0 : T.allowedTags, l = this.getPerformanceConfig(), c = this.getContentSanitizeConfig(), f = this.getSecurityConfig(), m = this.lastBeforeInputType;
3810
+ if (this.lastBeforeInputType = null, f.sanitizeOnInput !== !1 && c.sanitize !== !1 && !m) {
3811
+ const v = wo(i, c, f, r);
3812
+ if (v !== i) {
3730
3813
  const k = window.getSelection(), tt = k && k.rangeCount > 0 ? k.getRangeAt(0) : null;
3731
- if (this.contentElement.innerHTML = E, tt && k)
3814
+ if (this.contentElement.innerHTML = v, tt && k)
3732
3815
  try {
3733
3816
  k.removeAllRanges(), k.addRange(tt);
3734
3817
  } catch ($) {
3735
3818
  }
3736
- i = E;
3819
+ i = v;
3737
3820
  }
3738
3821
  }
3739
3822
  this.recordInputHistory(i), this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
3740
3823
  const w = () => {
3741
- this.dispatchEvent(new CustomEvent("content-change", {
3742
- detail: { html: Io(i) },
3743
- bubbles: !0
3744
- }));
3824
+ this.emitContentChange(Oo(i));
3745
3825
  };
3746
3826
  l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(w, l.debounceInputMs) : w(), this.updateStatusBar();
3747
3827
  }), this.contentElement.addEventListener("contextmenu", (o) => {
@@ -3754,7 +3834,7 @@ class yt extends yi {
3754
3834
  o.preventDefault();
3755
3835
  const i = this.config.paste || {};
3756
3836
  let r = ((g = o.clipboardData) == null ? void 0 : g.getData("text/html")) || "";
3757
- 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);
3837
+ const l = ((w = o.clipboardData) == null ? void 0 : w.getData("text/plain")) || "", c = this.getContentSanitizeConfig(), f = this.getSecurityConfig(), m = !!r && /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(r);
3758
3838
  if ((i.clean || !i.keepFormatting) && l) {
3759
3839
  document.execCommand("insertText", !1, l);
3760
3840
  return;
@@ -3764,19 +3844,20 @@ class yt extends yi {
3764
3844
  return;
3765
3845
  }
3766
3846
  if (r) {
3767
- p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r = ri(r, c, p)), this.insertHTMLAtSelection(r);
3847
+ f.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r = si(r, c, f)), this.insertHTMLAtSelection(r);
3768
3848
  return;
3769
3849
  }
3770
3850
  l && document.execCommand("insertText", !1, l);
3771
3851
  }), this.contentElement.addEventListener("focus", () => {
3772
- Q = this, this.dispatchEvent(new Event("editor-focus", { bubbles: !0 })), this.updateStatusBar();
3852
+ J = this, this.dispatchEvent(new Event("editor-focus", { bubbles: !0 })), this.updateStatusBar();
3773
3853
  }), this.contentElement.addEventListener("blur", () => {
3774
- this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.dispatchEvent(new CustomEvent("content-change", {
3775
- detail: { html: _t(this.contentElement) },
3776
- bubbles: !0
3777
- })), this.dispatchEvent(new Event("editor-blur", { bubbles: !0 })), this.updateFloatingToolbar(), this.updateStatusBar();
3854
+ if (this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement) {
3855
+ const o = bt(this.contentElement);
3856
+ o !== this.lastReportedContent && this.emitContentChange(o);
3857
+ }
3858
+ this.dispatchEvent(new Event("editor-blur", { bubbles: !0 })), this.updateFloatingToolbar(), this.updateStatusBar();
3778
3859
  }), this.contentElement.addEventListener("keydown", (o) => {
3779
- this.getAccessibilityConfig().keyboardNavigation && t.handleKeyDown(o, (r, l) => {
3860
+ !this.getAccessibilityConfig().keyboardNavigation || this.isEditorDisabled() || t.handleKeyDown(o, (r, l) => {
3780
3861
  this.executeCommand(r, l);
3781
3862
  });
3782
3863
  });
@@ -3786,6 +3867,12 @@ class yt extends yi {
3786
3867
  };
3787
3868
  this.selectionChangeHandler = e, document.addEventListener("selectionchange", this.selectionChangeHandler);
3788
3869
  }
3870
+ emitContentChange(t) {
3871
+ this.lastReportedContent = t, this.dispatchEvent(new CustomEvent("content-change", {
3872
+ detail: { html: t },
3873
+ bubbles: !0
3874
+ }));
3875
+ }
3789
3876
  getSelectionRangeInEditor() {
3790
3877
  if (!this.contentElement) return null;
3791
3878
  const t = window.getSelection();
@@ -3853,15 +3940,15 @@ class yt extends yi {
3853
3940
  const t = this.getPerformanceConfig(), e = document.activeElement === this.contentElement || this.contentElement.contains(document.activeElement);
3854
3941
  if (t.viewportOnlyScan && !this.isEditorInViewport() && !e)
3855
3942
  return;
3856
- const o = this.contentElement.textContent || "", { words: i, chars: r } = yn(o), l = bn(this.contentElement);
3857
- let c, p;
3943
+ const o = this.contentElement.textContent || "", { words: i, chars: r } = vn(o), l = En(this.contentElement);
3944
+ let c, f;
3858
3945
  const m = this.getSelectionRangeInEditor();
3859
- m && (c = mn(this.contentElement, m), m.collapsed || (p = vn(m, c), c = void 0)), this.statusBar.update({
3946
+ m && (c = bn(this.contentElement, m), m.collapsed || (f = wn(m, c), c = void 0)), this.statusBar.update({
3860
3947
  wordCount: i,
3861
3948
  charCount: r,
3862
3949
  lineCount: l,
3863
3950
  cursorPosition: c,
3864
- selectionInfo: p
3951
+ selectionInfo: f
3865
3952
  });
3866
3953
  }
3867
3954
  /**
@@ -3877,12 +3964,13 @@ class yt extends yi {
3877
3964
  handleAttributeChange(t, e) {
3878
3965
  switch (t) {
3879
3966
  case "readonly":
3880
- this.contentElement && (this.contentElement.contentEditable = this.isReadonlyAttribute(e) ? "false" : "true", this.applyAccessibilitySettings()), this.engine && this.engine.setReadonly(this.isReadonlyAttribute(e));
3967
+ this.contentElement && (this.contentElement.contentEditable = this.isReadonlyAttribute(e) || this.isEditorDisabled() ? "false" : "true", this.applyAccessibilitySettings()), this.engine && this.engine.setReadonly(this.isReadonlyAttribute(e) || this.isEditorDisabled());
3968
+ break;
3969
+ case "disabled":
3970
+ this.applyDisabledState();
3881
3971
  break;
3882
3972
  case "theme":
3883
- this.classList.forEach((o) => {
3884
- o.startsWith("editora-theme-") && this.classList.remove(o);
3885
- }), e && this.classList.add(`editora-theme-${e}`);
3973
+ this.applyThemeClass(e);
3886
3974
  break;
3887
3975
  case "placeholder":
3888
3976
  this.contentElement && (this.contentElement.setAttribute("data-placeholder", e), this.applyAccessibilitySettings());
@@ -3932,14 +4020,20 @@ class yt extends yi {
3932
4020
  case "toolbar-sticky":
3933
4021
  case "plugins":
3934
4022
  case "statusbar":
3935
- this.isConnected && (this.destroy(), this.waitForPluginLoader().then(() => {
3936
- this.initialize().catch((o) => {
3937
- console.error("[RichTextEditor] Error during attribute change re-initialization:", o);
3938
- });
3939
- }));
4023
+ this.isConnected && this.hasConnected && this.scheduleReinitialize();
3940
4024
  break;
3941
4025
  }
3942
4026
  }
4027
+ /** One rebuild for however many attributes are changed in the same task. */
4028
+ scheduleReinitialize() {
4029
+ this.reinitializeQueued || (this.reinitializeQueued = !0, queueMicrotask(() => {
4030
+ this.reinitializeQueued = !1, this.isConnected && (this.destroy(), this.waitForPluginLoader().then(() => {
4031
+ this.initialize().catch((t) => {
4032
+ console.error("[RichTextEditor] Error during attribute change re-initialization:", t);
4033
+ });
4034
+ }));
4035
+ }));
4036
+ }
3943
4037
  /**
3944
4038
  * Resolve configuration from all sources
3945
4039
  */
@@ -3949,7 +4043,7 @@ class yt extends yi {
3949
4043
  const o = this.attributes[e];
3950
4044
  t[o.name] = o.value;
3951
4045
  }
3952
- return xe.resolve({
4046
+ return Ae.resolve({
3953
4047
  jsConfig: this.jsConfig,
3954
4048
  attributes: t
3955
4049
  });
@@ -3959,7 +4053,7 @@ class yt extends yi {
3959
4053
  */
3960
4054
  getAPI() {
3961
4055
  return {
3962
- getContent: () => _t(this.contentElement),
4056
+ getContent: () => bt(this.contentElement),
3963
4057
  setContent: (t) => {
3964
4058
  this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
3965
4059
  },
@@ -3987,11 +4081,11 @@ class yt extends yi {
3987
4081
  */
3988
4082
  destroy() {
3989
4083
  var t, e, o, i;
3990
- 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 }));
4084
+ this.buildGeneration += 1, this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent = bt(this.contentElement), this.persistAutosave(this.preservedContent)), this.stopAutosave(), this.selectionChangeHandler && (document.removeEventListener("selectionchange", this.selectionChangeHandler), this.selectionChangeHandler = void 0), (t = this.engine) == null || t.destroy(), (e = this.toolbar) == null || e.destroy(), (o = this.floatingToolbar) == null || o.destroy(), (i = this.statusBar) == null || i.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.lastReportedContent = null, this.isInitialized = !1, Ce.delete(this), J === this && (J = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
3991
4085
  }
3992
4086
  // Public API methods
3993
4087
  getContent() {
3994
- return _t(this.contentElement);
4088
+ return bt(this.contentElement);
3995
4089
  }
3996
4090
  setContent(t) {
3997
4091
  this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
@@ -4009,29 +4103,29 @@ class yt extends yi {
4009
4103
  }
4010
4104
  }
4011
4105
  export {
4012
- dn as C,
4106
+ fn as C,
4013
4107
  qt as E,
4014
- fn as F,
4015
- cn as K,
4016
- Ao as P,
4017
- yt as R,
4018
- ln as S,
4019
- pn as T,
4020
- un as a,
4021
- xe as b,
4022
- li as c,
4023
- hn as d,
4024
- yn as e,
4025
- bn as f,
4026
- vi as g,
4027
- _t as h,
4028
- mn as i,
4029
- vn as j,
4030
- gn as k,
4031
- Eo as l,
4032
- ri as m,
4033
- Io as n,
4034
- Ei as o,
4035
- ii as s
4108
+ mn as F,
4109
+ un as K,
4110
+ So as P,
4111
+ Et as R,
4112
+ dn as S,
4113
+ hn as T,
4114
+ pn as a,
4115
+ Ae as b,
4116
+ di as c,
4117
+ gn as d,
4118
+ vn as e,
4119
+ En as f,
4120
+ Ti as g,
4121
+ bt as h,
4122
+ bn as i,
4123
+ wn as j,
4124
+ yn as k,
4125
+ wo as l,
4126
+ si as m,
4127
+ Oo as n,
4128
+ ki as o,
4129
+ ai as s
4036
4130
  };
4037
- //# sourceMappingURL=index-8WhEVFK8.mjs.map
4131
+ //# sourceMappingURL=index-BlsTuyTe.mjs.map