@editora/core 1.0.9 → 1.0.11

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.
Files changed (99) hide show
  1. package/README.md +1 -1
  2. package/dist/{A11yCheckerPlugin.native-58d12bed.mjs → A11yCheckerPlugin.native-BRdGYMju.mjs} +12 -23
  3. package/dist/{AnchorPlugin.native-289a112a.mjs → AnchorPlugin.native-BcYGEtd9.mjs} +102 -112
  4. package/dist/{ApprovalWorkflowPlugin.native-449ce66c.mjs → ApprovalWorkflowPlugin.native-BZ6jO-Wj.mjs} +173 -209
  5. package/dist/{BackgroundColorPlugin.native-8aceb5cc.mjs → BackgroundColorPlugin.native-50iAT9xU.mjs} +9 -16
  6. package/dist/BlockquotePlugin.native-57_Xcjl1.mjs +212 -0
  7. package/dist/{BlocksLibraryPlugin.native-1cc51e63.mjs → BlocksLibraryPlugin.native-5sdsXsiE.mjs} +149 -205
  8. package/dist/{BoldPlugin.native-f9d7f8e4.mjs → BoldPlugin.native-CSh_LiIJ.mjs} +11 -7
  9. package/dist/CapitalizationPlugin.native-DLV4oPmB.mjs +159 -0
  10. package/dist/ChecklistPlugin.native-BS-kMz9O.mjs +371 -0
  11. package/dist/{CitationsPlugin.native-169fb1e8.mjs → CitationsPlugin.native-DQgoCd1B.mjs} +196 -261
  12. package/dist/ClearFormattingPlugin.native-DIS6AN2t.mjs +172 -0
  13. package/dist/CodePlugin.native-veDC_kx5.mjs +4600 -0
  14. package/dist/{CodeSamplePlugin.native-6cc0148e.mjs → CodeSamplePlugin.native-CgGoH-X4.mjs} +10 -19
  15. package/dist/{CommentsPlugin.native-03659874.mjs → CommentsPlugin.native-DPSqTkiv.mjs} +28 -55
  16. package/dist/{ConditionalContentPlugin.native-4983143a.mjs → ConditionalContentPlugin.native-CfhY46rU.mjs} +51 -108
  17. package/dist/{ContentRulesPlugin.native-63ed405b.mjs → ContentRulesPlugin.native-vPx5nC73.mjs} +153 -200
  18. package/dist/{DataBindingPlugin.native-427e9d75.mjs → DataBindingPlugin.native-BoXwghTz.mjs} +88 -124
  19. package/dist/DirectionPlugin.native-Bl-QLFzO.mjs +153 -0
  20. package/dist/{DocSchemaPlugin.native-8e41eda0.mjs → DocSchemaPlugin.native-DUSVRHqT.mjs} +112 -166
  21. package/dist/{DocumentManagerPlugin.native-e69895ad.mjs → DocumentManagerPlugin.native-C2cs_1w4.mjs} +4 -4
  22. package/dist/EmbedIframePlugin.native-BF_-LjTq.mjs +740 -0
  23. package/dist/{EmojisPlugin.native-65c5ac47.mjs → EmojisPlugin.native-CitxxlWX.mjs} +6 -11
  24. package/dist/{FontFamilyPlugin.native-f9bc255a.mjs → FontFamilyPlugin.native-j8hMTbg4.mjs} +4 -7
  25. package/dist/{FontSizePlugin.native-f5647872.mjs → FontSizePlugin.native-B_jCh7dY.mjs} +10 -19
  26. package/dist/{FootnotePlugin.native-494657b3.mjs → FootnotePlugin.native-D730OGRm.mjs} +39 -77
  27. package/dist/{FullscreenPlugin.native-87ce92e9.mjs → FullscreenPlugin.native-ChXyxeNw.mjs} +1 -1
  28. package/dist/HeadingPlugin.native-DZdvubrQ.mjs +249 -0
  29. package/dist/{HistoryPlugin.native-92ed4be4.mjs → HistoryPlugin.native-D2wl32jV.mjs} +107 -143
  30. package/dist/{IndentPlugin.native-e4ee902b.mjs → IndentPlugin.native-BHixp8sP.mjs} +12 -23
  31. package/dist/{ItalicPlugin.native-7c95cfbc.mjs → ItalicPlugin.native-CmnlwFHB.mjs} +15 -11
  32. package/dist/{LineHeightPlugin.native-5668f78c.mjs → LineHeightPlugin.native-CM7iXdQj.mjs} +10 -19
  33. package/dist/{LinkPlugin.native-6df29111.mjs → LinkPlugin.native-DYCIcdTm.mjs} +5 -9
  34. package/dist/{ListPlugin.native-fe2e115a.mjs → ListPlugin.native-V7EZC1lM.mjs} +5 -9
  35. package/dist/MathPlugin.native-NwWPHVmj.mjs +369 -0
  36. package/dist/{MediaManagerPlugin.native-3cf48a00.mjs → MediaManagerPlugin.native-eOsTJFpw.mjs} +11 -21
  37. package/dist/{MentionPlugin.native-3b1e8c05.mjs → MentionPlugin.native-BMDlOqur.mjs} +45 -89
  38. package/dist/MergeTagPlugin.native-BzRVoD9-.mjs +580 -0
  39. package/dist/{PIIRedactionPlugin.native-7ab10b9f.mjs → PIIRedactionPlugin.native-g7j4jOmm.mjs} +210 -260
  40. package/dist/{PageBreakPlugin.native-1794c5fb.mjs → PageBreakPlugin.native-DijGuHJZ.mjs} +16 -31
  41. package/dist/{PreviewPlugin.native-f7b67cc0.mjs → PreviewPlugin.native-WuIwOAOR.mjs} +6 -11
  42. package/dist/{PrintPlugin.native-f6a168c2.mjs → PrintPlugin.native-7qt5v7L5.mjs} +3 -5
  43. package/dist/{SlashCommandsPlugin.native-8d45e511.mjs → SlashCommandsPlugin.native-BiN6ODw5.mjs} +36 -71
  44. package/dist/{SmartPastePlugin.native-a6c5efec.mjs → SmartPastePlugin.native-CZAEHkyt.mjs} +173 -219
  45. package/dist/{SpecialCharactersPlugin.native-7f06d4ba.mjs → SpecialCharactersPlugin.native-DaG4b19I.mjs} +101 -85
  46. package/dist/{SpellCheckPlugin.native-04e20834.mjs → SpellCheckPlugin.native-BZB9AewP.mjs} +21 -41
  47. package/dist/{StrikethroughPlugin.native-905e9501.mjs → StrikethroughPlugin.native-V0TL4F48.mjs} +12 -30
  48. package/dist/{TablePlugin.native-7d5458c1.mjs → TablePlugin.native-DrHX-efe.mjs} +30 -58
  49. package/dist/TemplatePlugin.native-DLjFUaPW.mjs +1150 -0
  50. package/dist/{TextAlignmentPlugin.native-9357b3ed.mjs → TextAlignmentPlugin.native-sM_1s00t.mjs} +6 -11
  51. package/dist/{TextColorPlugin.native-d53ed459.mjs → TextColorPlugin.native-Bwl_bSmc.mjs} +14 -26
  52. package/dist/{TrackChangesPlugin.native-e96da509.mjs → TrackChangesPlugin.native-Bghu2q4a.mjs} +58 -115
  53. package/dist/{TranslationWorkflowPlugin.native-4e711b1e.mjs → TranslationWorkflowPlugin.native-DdF16tgT.mjs} +191 -257
  54. package/dist/{UnderlinePlugin.native-8080c998.mjs → UnderlinePlugin.native-DZzg23rv.mjs} +8 -4
  55. package/dist/{VersionDiffPlugin.native-5bbeff85.mjs → VersionDiffPlugin.native-Bvxgy--t.mjs} +26 -51
  56. package/dist/_commonjsHelpers-DOllISpa.mjs +32 -0
  57. package/dist/{anchoredPopover-5cca53ba.mjs → anchoredPopover-Bxds0VoB.mjs} +1 -1
  58. package/dist/core.css +1 -0
  59. package/dist/documentManager-vQ1VkbUY.mjs +8418 -0
  60. package/dist/{editorContainerHelpers-69585c07.mjs → editorContainerHelpers-C7kdWnS0.mjs} +2 -3
  61. package/dist/editora.min.js +13 -14
  62. package/dist/editora.umd.js +13 -14
  63. package/dist/{html2canvas.esm-c51cb3b9.mjs → html2canvas.esm-AYkPY5LS.mjs} +894 -978
  64. package/dist/index-BslAFzmv.mjs +16544 -0
  65. package/dist/index-CPMGUZfB.js +10 -0
  66. package/dist/{index-7da30697.mjs → index-DBoj6QfW.mjs} +127 -164
  67. package/dist/index.cjs.js +1 -1
  68. package/dist/index.es-BYD2KEo6.mjs +6666 -0
  69. package/dist/index.esm.js +7 -12
  70. package/dist/inlineFormatting-DJ0-NZtx.mjs +97 -0
  71. package/dist/{jspdf.es.min-780c82db.mjs → jspdf.es.min-BJGtOnRT.mjs} +3784 -4808
  72. package/dist/plugin-loader.js +67 -67
  73. package/dist/{purify.es-3bdbcfc5.mjs → purify.es-CKpwg8Tk.mjs} +10 -20
  74. package/dist/webcomponent-core.js +131 -168
  75. package/dist/webcomponent-core.min.css +1 -1
  76. package/dist/webcomponent-core.min.js +147 -65
  77. package/dist/webcomponent.cjs.js +1 -1
  78. package/dist/webcomponent.esm.js +1 -1
  79. package/dist/webcomponent.js +191 -228
  80. package/dist/webcomponent.min.css +1 -1
  81. package/dist/webcomponent.min.js +1248 -1346
  82. package/package.json +1 -1
  83. package/dist/BlockquotePlugin.native-3541c714.mjs +0 -49
  84. package/dist/CapitalizationPlugin.native-42c135dc.mjs +0 -80
  85. package/dist/ChecklistPlugin.native-3b397ee9.mjs +0 -330
  86. package/dist/ClearFormattingPlugin.native-77baa514.mjs +0 -145
  87. package/dist/CodePlugin.native-989cf0aa.mjs +0 -2740
  88. package/dist/DirectionPlugin.native-4e742f42.mjs +0 -139
  89. package/dist/EmbedIframePlugin.native-55209c87.mjs +0 -568
  90. package/dist/HeadingPlugin.native-e38c4a16.mjs +0 -64
  91. package/dist/MathPlugin.native-735bbac2.mjs +0 -296
  92. package/dist/MergeTagPlugin.native-31cf7d48.mjs +0 -584
  93. package/dist/TemplatePlugin.native-580f0f63.mjs +0 -617
  94. package/dist/_commonjsHelpers-69d58be2.mjs +0 -31
  95. package/dist/documentManager-8327fb6e.mjs +0 -9166
  96. package/dist/index-072ef022.js +0 -11
  97. package/dist/index-49d31221.mjs +0 -16860
  98. package/dist/index.es-b47a189f.mjs +0 -5782
  99. package/dist/style.css +0 -1
@@ -10,7 +10,7 @@ class v {
10
10
  return new v(t, e || this.selection, this.schema);
11
11
  }
12
12
  }
13
- class D {
13
+ class N {
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 D {
21
21
  return { type: "text", text: t, marks: e };
22
22
  }
23
23
  }
24
- class N {
24
+ class P {
25
25
  constructor() {
26
26
  this.plugins = [], this.pluginConfigs = /* @__PURE__ */ new Map();
27
27
  }
@@ -58,7 +58,7 @@ class N {
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 D(t, e);
61
+ }), new N(t, e);
62
62
  }
63
63
  getCommands() {
64
64
  const t = {};
@@ -112,7 +112,7 @@ class N {
112
112
  await Promise.all(t), this.plugins = [], this.pluginConfigs.clear();
113
113
  }
114
114
  }
115
- class P {
115
+ class O {
116
116
  constructor(t) {
117
117
  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) => {
118
118
  this.registerShortcut(e);
@@ -398,8 +398,7 @@ class P {
398
398
  return t.ctrlKey && e.push("ctrl"), t.altKey && e.push("alt"), t.shiftKey && e.push("shift"), t.metaKey && e.push("meta"), e.push(t.key.toLowerCase()), e.join("+");
399
399
  }
400
400
  handleKeyDown(t, e) {
401
- if (!this.enabled)
402
- return !1;
401
+ if (!this.enabled) return !1;
403
402
  const o = this.getEventKey(t), n = this.shortcuts.get(o);
404
403
  return n ? (n.preventDefault !== !1 && (t.preventDefault(), t.stopPropagation()), e(n.command, n.params), !0) : !1;
405
404
  }
@@ -448,7 +447,7 @@ class P {
448
447
  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";
449
448
  }
450
449
  }
451
- class O {
450
+ class B {
452
451
  constructor(t = {}) {
453
452
  this.commands = /* @__PURE__ */ new Map(), Object.entries(t).forEach(([e, o]) => {
454
453
  this.register(e, o);
@@ -491,11 +490,11 @@ class O {
491
490
  this.commands.clear();
492
491
  }
493
492
  }
494
- class B {
493
+ class z {
495
494
  constructor(t = {}) {
496
- this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new N(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((o) => this.pluginManager.register(o));
495
+ this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new P(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((o) => this.pluginManager.register(o));
497
496
  const e = this.pluginManager.buildSchema();
498
- this.state = v.create(e), this.commandRegistry = new O(this.pluginManager.getCommands());
497
+ this.state = v.create(e), this.commandRegistry = new B(this.pluginManager.getCommands());
499
498
  }
500
499
  /**
501
500
  * Execute a command
@@ -577,11 +576,10 @@ class B {
577
576
  return this.isDestroyed;
578
577
  }
579
578
  }
580
- class z {
579
+ class R {
581
580
  // PluginLoader instance to get all registered plugins
582
581
  setLastCommandTrigger(t, e) {
583
- if (typeof window == "undefined" || !t)
584
- return;
582
+ if (typeof window == "undefined" || !t) return;
585
583
  const o = e || t.getAttribute("data-command") || void 0;
586
584
  o && (window.__editoraLastCommandButton = t, window.__editoraLastCommand = o);
587
585
  }
@@ -888,8 +886,7 @@ class z {
888
886
  * Update button state
889
887
  */
890
888
  updateButtonState(t, e) {
891
- if (!this.container)
892
- return;
889
+ if (!this.container) return;
893
890
  const o = this.container.querySelector(
894
891
  `[data-command="${t}"]`
895
892
  );
@@ -905,7 +902,7 @@ class z {
905
902
  }), this.container.innerHTML = ""), this.commandHandler = void 0;
906
903
  }
907
904
  }
908
- class R {
905
+ class H {
909
906
  constructor(t) {
910
907
  this.visible = !1, this.config = t;
911
908
  }
@@ -947,7 +944,7 @@ class R {
947
944
  this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0, this.visible = !1;
948
945
  }
949
946
  }
950
- class H {
947
+ class j {
951
948
  constructor(t = {}) {
952
949
  this.statusInfo = {}, this.config = t;
953
950
  }
@@ -968,8 +965,7 @@ class H {
968
965
  * Render status bar content
969
966
  */
970
967
  render() {
971
- if (!this.container)
972
- return;
968
+ if (!this.container) return;
973
969
  this.container.innerHTML = "";
974
970
  const t = document.createElement("div");
975
971
  t.className = "editora-statusbar-left";
@@ -1008,12 +1004,12 @@ class H {
1008
1004
  this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0;
1009
1005
  }
1010
1006
  }
1011
- function j(s, t) {
1012
- const e = s.textContent || "", o = F(s, t.startContainer, t.startOffset), i = e.substring(0, o).split(`
1007
+ function F(s, t) {
1008
+ const e = s.textContent || "", o = $(s, t.startContainer, t.startOffset), i = e.substring(0, o).split(`
1013
1009
  `), r = i.length, a = i[i.length - 1].length + 1;
1014
1010
  return { line: r, column: a };
1015
1011
  }
1016
- function F(s, t, e) {
1012
+ function $(s, t, e) {
1017
1013
  var r;
1018
1014
  let o = 0;
1019
1015
  const n = document.createTreeWalker(
@@ -1026,13 +1022,12 @@ function F(s, t, e) {
1026
1022
  if (i === t) {
1027
1023
  o += e;
1028
1024
  break;
1029
- } else
1030
- i.nodeType === Node.TEXT_NODE && (o += ((r = i.textContent) == null ? void 0 : r.length) || 0);
1025
+ } else i.nodeType === Node.TEXT_NODE && (o += ((r = i.textContent) == null ? void 0 : r.length) || 0);
1031
1026
  i = n.nextNode();
1032
1027
  }
1033
1028
  return o;
1034
1029
  }
1035
- function $(s) {
1030
+ function _(s) {
1036
1031
  var o, n;
1037
1032
  const t = s.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");
1038
1033
  let e = 1;
@@ -1047,11 +1042,11 @@ function $(s) {
1047
1042
  }
1048
1043
  return e;
1049
1044
  }
1050
- function _(s) {
1045
+ function W(s) {
1051
1046
  const t = s.trim() ? s.trim().split(/\s+/).length : 0, e = s.length;
1052
1047
  return { words: t, chars: e };
1053
1048
  }
1054
- function W(s, t) {
1049
+ function U(s, t) {
1055
1050
  const e = s.toString();
1056
1051
  return {
1057
1052
  startLine: t.line,
@@ -1063,7 +1058,7 @@ function W(s, t) {
1063
1058
  selectedWords: e.trim().split(/\s+/).filter(Boolean).length
1064
1059
  };
1065
1060
  }
1066
- class A {
1061
+ const E = class E {
1067
1062
  /**
1068
1063
  * Resolve configuration from multiple sources with priority
1069
1064
  */
@@ -1210,14 +1205,10 @@ class A {
1210
1205
  * Parse attribute value to appropriate type
1211
1206
  */
1212
1207
  static parseAttributeValue(t) {
1213
- if (t === "true")
1214
- return !0;
1215
- if (t === "false")
1216
- return !1;
1217
- if (/^\d+$/.test(t))
1218
- return parseInt(t, 10);
1219
- if (/^\d+\.\d+$/.test(t))
1220
- return parseFloat(t);
1208
+ if (t === "true") return !0;
1209
+ if (t === "false") return !1;
1210
+ if (/^\d+$/.test(t)) return parseInt(t, 10);
1211
+ if (/^\d+\.\d+$/.test(t)) return parseFloat(t);
1221
1212
  if (t.startsWith("{") || t.startsWith("["))
1222
1213
  try {
1223
1214
  return JSON.parse(t);
@@ -1258,8 +1249,8 @@ class A {
1258
1249
  i != null && (typeof i == "object" && !Array.isArray(i) && e[n] ? e[n] = this.merge(e[n], i) : e[n] = i);
1259
1250
  return e;
1260
1251
  }
1261
- }
1262
- A.EDITOR_DEFAULTS = {
1252
+ };
1253
+ E.EDITOR_DEFAULTS = {
1263
1254
  height: 400,
1264
1255
  width: "100%",
1265
1256
  readonly: !1,
@@ -1309,7 +1300,8 @@ A.EDITOR_DEFAULTS = {
1309
1300
  },
1310
1301
  statusbar: !1
1311
1302
  };
1312
- class U {
1303
+ let x = E;
1304
+ class K {
1313
1305
  constructor() {
1314
1306
  this.loadedPlugins = /* @__PURE__ */ new Map(), this.pluginRegistry = /* @__PURE__ */ new Map();
1315
1307
  }
@@ -1383,7 +1375,7 @@ class U {
1383
1375
  return this.loadedPlugins.has(t);
1384
1376
  }
1385
1377
  }
1386
- const K = [
1378
+ const q = [
1387
1379
  "p",
1388
1380
  "br",
1389
1381
  "strong",
@@ -1407,6 +1399,7 @@ const K = [
1407
1399
  "img",
1408
1400
  "video",
1409
1401
  "audio",
1402
+ "iframe",
1410
1403
  "table",
1411
1404
  "thead",
1412
1405
  "tbody",
@@ -1422,12 +1415,13 @@ const K = [
1422
1415
  "sup",
1423
1416
  "sub",
1424
1417
  "hr"
1425
- ], q = {
1426
- "*": ["class", "style", "id", "data-*", "role", "aria-*", "tabindex", "contenteditable", "spellcheck"],
1418
+ ], V = {
1419
+ "*": ["class", "style", "id", "data-*", "role", "aria-*", "tabindex", "contenteditable", "spellcheck", "dir", "lang"],
1427
1420
  a: ["href", "target", "rel", "title"],
1428
1421
  img: ["src", "alt", "width", "height", "loading"],
1429
1422
  video: ["src", "controls", "width", "height", "autoplay", "loop", "muted"],
1430
1423
  audio: ["src", "controls", "autoplay", "loop", "muted"],
1424
+ iframe: ["src", "width", "height", "name", "title", "longdesc", "allow", "allowfullscreen", "frameborder", "scrolling", "loading", "referrerpolicy"],
1431
1425
  table: ["border", "cellpadding", "cellspacing"],
1432
1426
  td: ["colspan", "rowspan", "align", "valign"],
1433
1427
  th: ["colspan", "rowspan", "align", "valign"]
@@ -1435,10 +1429,10 @@ const K = [
1435
1429
  function M(s, t, e) {
1436
1430
  if ((t == null ? void 0 : t.sanitize) === !1)
1437
1431
  return s;
1438
- const o = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : K, i = !!(t != null && t.allowedAttributes) && Object.keys(t.allowedAttributes).length > 0 ? t.allowedAttributes : q, r = document.createElement("div");
1439
- return r.innerHTML = s, L(r, o, i), r.innerHTML;
1432
+ const o = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : q, i = !!(t != null && t.allowedAttributes) && Object.keys(t.allowedAttributes).length > 0 ? t.allowedAttributes : V, r = document.createElement("div");
1433
+ return r.innerHTML = s, I(r, o, i), r.innerHTML;
1440
1434
  }
1441
- function L(s, t, e) {
1435
+ function I(s, t, e) {
1442
1436
  const o = Array.from(s.childNodes);
1443
1437
  for (const n of o)
1444
1438
  if (n.nodeType === Node.ELEMENT_NODE) {
@@ -1449,11 +1443,10 @@ function L(s, t, e) {
1449
1443
  s.removeChild(i);
1450
1444
  continue;
1451
1445
  }
1452
- V(i, e), L(i, t, e);
1453
- } else
1454
- n.nodeType !== Node.TEXT_NODE && s.removeChild(n);
1446
+ G(i, e), I(i, t, e);
1447
+ } else n.nodeType !== Node.TEXT_NODE && s.removeChild(n);
1455
1448
  }
1456
- function V(s, t) {
1449
+ function G(s, t) {
1457
1450
  const e = s.tagName.toLowerCase(), o = Array.from(s.attributes), n = t[e] || [], i = t["*"] || [], r = [...n, ...i];
1458
1451
  for (const a of o) {
1459
1452
  const l = a.name.toLowerCase();
@@ -1467,112 +1460,101 @@ function V(s, t) {
1467
1460
  break;
1468
1461
  }
1469
1462
  }
1470
- (l.startsWith("on") || l === "javascript:" || l === "href" && a.value.trim().toLowerCase().startsWith("javascript:") || l === "src" && a.value.trim().toLowerCase().startsWith("javascript:")) && (c = !1), c || s.removeAttribute(a.name);
1463
+ (l.startsWith("on") || l === "javascript:" || l === "href" && a.value.trim().toLowerCase().startsWith("javascript:") || l === "src" && a.value.trim().toLowerCase().startsWith("javascript:")) && (c = !1), l === "dir" && !["ltr", "rtl", "auto"].includes(a.value.trim().toLowerCase()) && (c = !1), c || s.removeAttribute(a.name);
1471
1464
  }
1472
1465
  s.hasAttribute("href") && (s.getAttribute("href") || "").trim().toLowerCase().startsWith("javascript:") && s.removeAttribute("href"), s.hasAttribute("src") && (s.getAttribute("src") || "").trim().toLowerCase().startsWith("javascript:") && s.removeAttribute("src");
1473
1466
  }
1474
- function G(s, t, e) {
1467
+ function X(s, t, e) {
1475
1468
  return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? s : M(s, t);
1476
1469
  }
1477
- function X(s, t, e) {
1470
+ function Y(s, t, e) {
1478
1471
  return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? s : M(s, t);
1479
1472
  }
1480
- const Y = `.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 0%,#1c2430 100%);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:white;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;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-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 0%,#1b2430 100%)!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 0%,#252d37 100%);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:rgba(0,102,204,.2)}.editora-theme-dark .editora-content ::selection{background:rgba(77,184,255,.2)}.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:#ffffff;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:#ffffff;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:#ffffff;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}}
1481
- `;
1473
+ const J = '.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;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-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}}';
1482
1474
  let y;
1483
- const J = "__editoraCommandEditorRoot", Q = "__editoraLastCommandButton", C = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", E = ".rte-content, .editora-content", w = /* @__PURE__ */ new Set();
1484
- let g = null, S = !1, k = null, x = null;
1485
- function T(s) {
1486
- if (!(s instanceof HTMLElement))
1487
- return !1;
1475
+ const Q = "__editoraCommandEditorRoot", Z = "__editoraLastCommandButton", S = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", T = ".rte-content, .editora-content", C = /* @__PURE__ */ new Set();
1476
+ let g = null, A = !1, k = null, w = null;
1477
+ function L(s) {
1478
+ if (!(s instanceof HTMLElement)) return !1;
1488
1479
  const t = s;
1489
1480
  return typeof t.execCommand == "function" && (t.tagName.toLowerCase() === "editora-editor" || t.classList.contains("editora-editor") || t.hasAttribute("data-editora-editor"));
1490
1481
  }
1491
- function Z(s) {
1482
+ function tt(s) {
1492
1483
  return s ? s.nodeType === Node.ELEMENT_NODE ? s : s.parentElement : null;
1493
1484
  }
1494
1485
  function b(s) {
1495
- if (!s)
1496
- return null;
1497
- if (T(s))
1486
+ if (!s) return null;
1487
+ if (L(s))
1498
1488
  return s;
1499
- const t = s.matches(C) ? s : s.closest(C);
1500
- return !t || !T(t) ? null : t;
1489
+ const t = s.matches(S) ? s : s.closest(S);
1490
+ return !t || !L(t) ? null : t;
1501
1491
  }
1502
- function tt() {
1492
+ function et() {
1503
1493
  var n;
1504
- if (typeof window == "undefined")
1505
- return null;
1506
- const s = window[J];
1494
+ if (typeof window == "undefined") return null;
1495
+ const s = window[Q];
1507
1496
  if (s instanceof HTMLElement) {
1508
1497
  const i = b(s);
1509
- if (i)
1510
- return i;
1511
- const r = s.matches(E) ? s : s.querySelector(E);
1498
+ if (i) return i;
1499
+ const r = s.matches(T) ? s : s.querySelector(T);
1512
1500
  if (r) {
1513
1501
  const a = b(r);
1514
- if (a)
1515
- return a;
1502
+ if (a) return a;
1516
1503
  }
1517
1504
  }
1518
- const t = window[Q];
1505
+ const t = window[Z];
1519
1506
  if (t instanceof HTMLElement) {
1520
1507
  const i = b(t);
1521
- if (i)
1522
- return i;
1508
+ if (i) return i;
1523
1509
  }
1524
1510
  const e = document.activeElement;
1525
1511
  if (e) {
1526
1512
  const i = b(e);
1527
- if (i)
1528
- return i;
1513
+ if (i) return i;
1529
1514
  }
1530
1515
  const o = (n = window.getSelection) == null ? void 0 : n.call(window);
1531
1516
  if (o && o.rangeCount > 0) {
1532
- const i = b(Z(o.getRangeAt(0).startContainer));
1533
- if (i)
1534
- return i;
1517
+ const i = b(tt(o.getRangeAt(0).startContainer));
1518
+ if (i) return i;
1535
1519
  }
1536
1520
  if (g && g.isConnected)
1537
1521
  return g;
1538
- for (const i of w)
1539
- if (i.isConnected)
1540
- return i;
1522
+ for (const i of C)
1523
+ if (i.isConnected) return i;
1541
1524
  return null;
1542
1525
  }
1543
- function et() {
1544
- if (typeof window == "undefined" || S)
1545
- return;
1546
- k = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, x = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
1526
+ function ot() {
1527
+ if (typeof window == "undefined" || A) return;
1528
+ k = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, w = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
1547
1529
  const s = (t, e) => {
1548
- const o = tt();
1549
- return o ? o.execCommand(t, e) : k ? k(t, e) : x ? x(t, e) : !1;
1530
+ const o = et();
1531
+ return o ? o.execCommand(t, e) : k ? k(t, e) : w ? w(t, e) : !1;
1550
1532
  };
1551
- window.executeEditorCommand = s, window.execEditorCommand = s, S = !0;
1533
+ window.executeEditorCommand = s, window.execEditorCommand = s, A = !0;
1552
1534
  }
1553
- function ot() {
1535
+ function it() {
1554
1536
  const s = "editora-webcomponent-styles";
1555
1537
  if (!document.getElementById(s)) {
1556
1538
  const t = document.createElement("style");
1557
- t.id = s, t.textContent = Y, document.head.appendChild(t);
1539
+ t.id = s, t.textContent = J, document.head.appendChild(t);
1558
1540
  }
1559
1541
  }
1560
- function I() {
1542
+ function D() {
1561
1543
  if (!y) {
1562
1544
  const s = m.__globalPluginLoader;
1563
- s ? y = s : y = new U();
1545
+ s ? y = s : y = new K();
1564
1546
  }
1565
1547
  return y;
1566
1548
  }
1567
- function it(s) {
1568
- const t = I();
1549
+ function nt(s) {
1550
+ const t = D();
1569
1551
  Object.entries(s).forEach(([e, o]) => {
1570
1552
  t.register(e, o);
1571
1553
  });
1572
1554
  }
1573
1555
  class m extends HTMLElement {
1574
1556
  constructor() {
1575
- if (super(), this.pluginLoader = I(), this.config = {}, this.isInitialized = !1, this.keyboardShortcutManager = new P(), this.lastAutosavedContent = "", this.loadedPlugins = [], this.lastBeforeInputType = null, ot(), !this.hasAttribute("data-initial-content")) {
1557
+ if (super(), this.pluginLoader = D(), this.config = {}, this.isInitialized = !1, this.keyboardShortcutManager = new O(), this.lastAutosavedContent = "", this.loadedPlugins = [], this.lastBeforeInputType = null, it(), !this.hasAttribute("data-initial-content")) {
1576
1558
  const t = this.innerHTML.trim();
1577
1559
  t && this.setAttribute("data-initial-content", t);
1578
1560
  }
@@ -1672,9 +1654,8 @@ class m extends HTMLElement {
1672
1654
  */
1673
1655
  async initialize() {
1674
1656
  var o;
1675
- if (this.querySelector(".editora-toolbar") || this.isInitialized)
1676
- return;
1677
- this.setAttribute("data-editora-editor", "true"), w.add(this), g || (g = this), et(), 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}`);
1657
+ if (this.querySelector(".editora-toolbar") || this.isInitialized) return;
1658
+ this.setAttribute("data-editora-editor", "true"), C.add(this), g || (g = this), ot(), 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}`);
1678
1659
  const t = await this.loadPlugins();
1679
1660
  this.loadedPlugins = t, t.forEach((n) => {
1680
1661
  if (n.init && typeof n.init == "function")
@@ -1685,7 +1666,7 @@ class m extends HTMLElement {
1685
1666
  }
1686
1667
  });
1687
1668
  const e = (o = this.restoreAutosavedContent()) != null ? o : this.getAttribute("data-initial-content") || "";
1688
- this.engine = new B({
1669
+ this.engine = new z({
1689
1670
  content: e,
1690
1671
  plugins: t,
1691
1672
  readonly: this.config.readonly
@@ -1740,20 +1721,14 @@ class m extends HTMLElement {
1740
1721
  }
1741
1722
  resolveToolbarItems() {
1742
1723
  const t = this.config.toolbarItems;
1743
- if (typeof t == "string")
1744
- return t;
1745
- if (Array.isArray(t))
1746
- return t.join(" ");
1724
+ if (typeof t == "string") return t;
1725
+ if (Array.isArray(t)) return t.join(" ");
1747
1726
  const e = this.config.toolbar;
1748
- if (typeof e == "string")
1749
- return e;
1750
- if (!e || typeof e != "object")
1751
- return;
1727
+ if (typeof e == "string") return e;
1728
+ if (!e || typeof e != "object") return;
1752
1729
  const o = e.items;
1753
- if (typeof o == "string")
1754
- return o;
1755
- if (Array.isArray(o))
1756
- return o.join(" ");
1730
+ if (typeof o == "string") return o;
1731
+ if (Array.isArray(o)) return o.join(" ");
1757
1732
  }
1758
1733
  isToolbarStickyEnabled() {
1759
1734
  const t = this.config.toolbar;
@@ -1815,14 +1790,12 @@ class m extends HTMLElement {
1815
1790
  };
1816
1791
  }
1817
1792
  isEditorInViewport() {
1818
- if (!this.contentElement || typeof window == "undefined")
1819
- return !0;
1793
+ if (!this.contentElement || typeof window == "undefined") return !0;
1820
1794
  const t = this.contentElement.getBoundingClientRect();
1821
1795
  return t.bottom >= 0 && t.top <= window.innerHeight;
1822
1796
  }
1823
1797
  applyAccessibilitySettings() {
1824
- if (!this.contentElement)
1825
- return;
1798
+ if (!this.contentElement) return;
1826
1799
  const t = this.getAccessibilityConfig();
1827
1800
  if (t.enableARIA) {
1828
1801
  this.contentElement.setAttribute("role", "textbox"), this.contentElement.setAttribute("aria-multiline", "true"), this.contentElement.setAttribute("aria-disabled", this.config.readonly ? "true" : "false");
@@ -1833,8 +1806,7 @@ class m extends HTMLElement {
1833
1806
  this.contentElement.tabIndex = t.keyboardNavigation ? 0 : -1;
1834
1807
  }
1835
1808
  applyLanguageSettings() {
1836
- if (!this.contentElement)
1837
- return;
1809
+ if (!this.contentElement) return;
1838
1810
  const t = this.getLanguageConfig();
1839
1811
  this.contentElement.setAttribute("lang", t.locale), this.contentElement.setAttribute("dir", t.direction);
1840
1812
  }
@@ -1856,8 +1828,7 @@ class m extends HTMLElement {
1856
1828
  return { enabled: !1, provider: "browser" };
1857
1829
  }
1858
1830
  applySpellcheckSettings() {
1859
- if (!this.contentElement)
1860
- return;
1831
+ if (!this.contentElement) return;
1861
1832
  const t = this.getSpellcheckConfig(), e = t.enabled && t.provider === "browser";
1862
1833
  this.contentElement.spellcheck = e, this.contentElement.setAttribute("spellcheck", e ? "true" : "false");
1863
1834
  }
@@ -1970,8 +1941,7 @@ class m extends HTMLElement {
1970
1941
  }
1971
1942
  restoreAutosavedContent() {
1972
1943
  const t = this.getAutosaveConfig();
1973
- if (!t.enabled || t.provider !== "localStorage")
1974
- return null;
1944
+ if (!t.enabled || t.provider !== "localStorage") return null;
1975
1945
  try {
1976
1946
  const e = localStorage.getItem(t.storageKey);
1977
1947
  if (e)
@@ -1993,8 +1963,7 @@ class m extends HTMLElement {
1993
1963
  }, t.intervalMs));
1994
1964
  }
1995
1965
  insertHTMLAtSelection(t) {
1996
- if (!this.contentElement)
1997
- return;
1966
+ if (!this.contentElement) return;
1998
1967
  const e = window.getSelection();
1999
1968
  if (e && e.rangeCount > 0) {
2000
1969
  const o = e.getRangeAt(0);
@@ -2013,7 +1982,7 @@ class m extends HTMLElement {
2013
1982
  */
2014
1983
  createUI(t, e) {
2015
1984
  const o = this.querySelector('[slot="toolbar"]'), n = this.querySelector('[slot="statusbar"]');
2016
- 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 z(
1985
+ 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 R(
2017
1986
  {
2018
1987
  items: this.resolveToolbarItems(),
2019
1988
  sticky: this.isToolbarStickyEnabled(),
@@ -2050,7 +2019,7 @@ class m extends HTMLElement {
2050
2019
  }) && e.trim() ? this.contentElement.innerHTML = `<p>${e.trim()}</p>` : this.contentElement.innerHTML = e;
2051
2020
  } else
2052
2021
  this.config.placeholder ? this.contentElement.innerHTML = "" : this.contentElement.innerHTML = "<p><br></p>";
2053
- this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new R({ enabled: !0 }), this.floatingToolbar.create(this)), n ? this.appendChild(n) : this.isStatusbarEnabled() && (this.statusBarElement = document.createElement("div"), this.statusBarElement.className = "editora-statusbar-container", this.appendChild(this.statusBarElement), this.statusBar = new H({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.config.autofocus && setTimeout(() => {
2022
+ this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new H({ enabled: !0 }), this.floatingToolbar.create(this)), n ? this.appendChild(n) : this.isStatusbarEnabled() && (this.statusBarElement = document.createElement("div"), this.statusBarElement.className = "editora-statusbar-container", this.appendChild(this.statusBarElement), this.statusBar = new j({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.config.autofocus && setTimeout(() => {
2054
2023
  var i;
2055
2024
  return (i = this.contentElement) == null ? void 0 : i.focus();
2056
2025
  }, 0);
@@ -2059,18 +2028,16 @@ class m extends HTMLElement {
2059
2028
  * Setup event listeners
2060
2029
  */
2061
2030
  setupEventListeners() {
2062
- if (!this.contentElement || !this.engine)
2063
- return;
2031
+ if (!this.contentElement || !this.engine) return;
2064
2032
  const t = this.keyboardShortcutManager;
2065
2033
  this.contentElement.addEventListener("beforeinput", (o) => {
2066
2034
  this.lastBeforeInputType = o.inputType || null;
2067
2035
  }), this.contentElement.addEventListener("input", () => {
2068
- if (!this.contentElement)
2069
- return;
2036
+ if (!this.contentElement) return;
2070
2037
  let o = this.contentElement.innerHTML;
2071
2038
  const n = this.getPerformanceConfig(), i = this.getContentSanitizeConfig(), r = this.getSecurityConfig(), a = this.lastBeforeInputType;
2072
2039
  if (this.lastBeforeInputType = null, r.sanitizeOnInput !== !1 && i.sanitize !== !1 && !a) {
2073
- const d = X(o, i, r);
2040
+ const d = Y(o, i, r);
2074
2041
  if (d !== o) {
2075
2042
  const h = window.getSelection(), p = h && h.rangeCount > 0 ? h.getRangeAt(0) : null;
2076
2043
  if (this.contentElement.innerHTML = d, p && h)
@@ -2109,7 +2076,7 @@ class m extends HTMLElement {
2109
2076
  return;
2110
2077
  }
2111
2078
  if (i) {
2112
- l.sanitizeOnPaste !== !1 && a.sanitize !== !1 && (i = G(i, a, l)), this.insertHTMLAtSelection(i);
2079
+ l.sanitizeOnPaste !== !1 && a.sanitize !== !1 && (i = X(i, a, l)), this.insertHTMLAtSelection(i);
2113
2080
  return;
2114
2081
  }
2115
2082
  r && document.execCommand("insertText", !1, r);
@@ -2132,8 +2099,7 @@ class m extends HTMLElement {
2132
2099
  this.selectionChangeHandler = e, document.addEventListener("selectionchange", this.selectionChangeHandler);
2133
2100
  }
2134
2101
  getSelectionRangeInEditor() {
2135
- if (!this.contentElement)
2136
- return null;
2102
+ if (!this.contentElement) return null;
2137
2103
  const t = window.getSelection();
2138
2104
  if (!t || t.rangeCount === 0)
2139
2105
  return null;
@@ -2141,8 +2107,7 @@ class m extends HTMLElement {
2141
2107
  return this.contentElement.contains(o) ? e : null;
2142
2108
  }
2143
2109
  isSelectionBackward(t) {
2144
- if (!t.anchorNode || !t.focusNode)
2145
- return !1;
2110
+ if (!t.anchorNode || !t.focusNode) return !1;
2146
2111
  try {
2147
2112
  const e = document.createRange();
2148
2113
  return e.setStart(t.anchorNode, t.anchorOffset), e.setEnd(t.focusNode, t.focusOffset), e.collapsed;
@@ -2158,8 +2123,7 @@ class m extends HTMLElement {
2158
2123
  * Update floating toolbar position
2159
2124
  */
2160
2125
  updateFloatingToolbar() {
2161
- if (!this.floatingToolbar || !this.contentElement)
2162
- return;
2126
+ if (!this.floatingToolbar || !this.contentElement) return;
2163
2127
  if (this.config.readonly || this.contentElement.contentEditable === "false" || this.contentElement.getAttribute("data-readonly") === "true" || this.getAttribute("readonly") === "true" || this.getAttribute("data-readonly") === "true") {
2164
2128
  this.floatingToolbar.hide();
2165
2129
  return;
@@ -2197,15 +2161,14 @@ class m extends HTMLElement {
2197
2161
  * Update status bar with current content and cursor information
2198
2162
  */
2199
2163
  updateStatusBar() {
2200
- if (!this.statusBar || !this.contentElement)
2201
- return;
2164
+ if (!this.statusBar || !this.contentElement) return;
2202
2165
  const t = this.getPerformanceConfig(), e = document.activeElement === this.contentElement || this.contentElement.contains(document.activeElement);
2203
2166
  if (t.viewportOnlyScan && !this.isEditorInViewport() && !e)
2204
2167
  return;
2205
- const o = this.contentElement.textContent || "", { words: n, chars: i } = _(o), r = $(this.contentElement);
2168
+ const o = this.contentElement.textContent || "", { words: n, chars: i } = W(o), r = _(this.contentElement);
2206
2169
  let a, l;
2207
2170
  const c = this.getSelectionRangeInEditor();
2208
- c && (a = j(this.contentElement, c), c.collapsed || (l = W(c, a), a = void 0)), this.statusBar.update({
2171
+ c && (a = F(this.contentElement, c), c.collapsed || (l = U(c, a), a = void 0)), this.statusBar.update({
2209
2172
  wordCount: n,
2210
2173
  charCount: i,
2211
2174
  lineCount: r,
@@ -2290,7 +2253,7 @@ class m extends HTMLElement {
2290
2253
  const o = this.attributes[e];
2291
2254
  t[o.name] = o.value;
2292
2255
  }
2293
- return A.resolve({
2256
+ return x.resolve({
2294
2257
  jsConfig: this.jsConfig,
2295
2258
  attributes: t
2296
2259
  });
@@ -2331,7 +2294,7 @@ class m extends HTMLElement {
2331
2294
  */
2332
2295
  destroy() {
2333
2296
  var t, e, o, n;
2334
- this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.persistAutosave(this.contentElement.innerHTML || ""), 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(), (n = this.statusBar) == null || n.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.isInitialized = !1, w.delete(this), g === this && (g = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
2297
+ this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.persistAutosave(this.contentElement.innerHTML || ""), 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(), (n = this.statusBar) == null || n.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.isInitialized = !1, C.delete(this), g === this && (g = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
2335
2298
  }
2336
2299
  // Public API methods
2337
2300
  getContent() {
@@ -2354,23 +2317,23 @@ class m extends HTMLElement {
2354
2317
  }
2355
2318
  }
2356
2319
  export {
2357
- O as C,
2320
+ B as C,
2358
2321
  v as E,
2359
- R as F,
2360
- P as K,
2361
- N as P,
2322
+ H as F,
2323
+ O as K,
2324
+ P,
2362
2325
  m as R,
2363
- D as S,
2364
- z as T,
2365
- B as a,
2366
- H as b,
2367
- F as c,
2368
- $ as d,
2369
- _ as e,
2370
- W as f,
2371
- j as g,
2372
- A as h,
2373
- U as i,
2374
- it as j
2326
+ N as S,
2327
+ R as T,
2328
+ z as a,
2329
+ j as b,
2330
+ $ as c,
2331
+ _ as d,
2332
+ W as e,
2333
+ U as f,
2334
+ F as g,
2335
+ x as h,
2336
+ K as i,
2337
+ nt as j
2375
2338
  };
2376
- //# sourceMappingURL=index-7da30697.mjs.map
2339
+ //# sourceMappingURL=index-DBoj6QfW.mjs.map